"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get getDisplayValue () {
        return getDisplayValue;
    },
    get getHelperTextPlacement () {
        return getHelperTextPlacement;
    },
    get getInnerValue () {
        return getInnerValue;
    },
    get helperTextPlacements () {
        return helperTextPlacements;
    },
    get valueConstraints () {
        return valueConstraints;
    }
});
const valueConstraints = {
    min: 0,
    max: 5
};
const helperTextPlacements = {
    inner: 'inner',
    outer: 'outer'
};
const getHelperTextPlacement = (value, size, hasIcons, iconQuantity)=>{
    if (!value || !size || !hasIcons) {
        return helperTextPlacements.outer;
    }
    if (size.includes('display') && iconQuantity !== 1) {
        return helperTextPlacements.inner;
    }
    return helperTextPlacements.outer;
};
const getInnerValue = (value, precision, iconQuantity = 5)=>{
    let innerValue = value ? String(value) : '';
    if (value && value > iconQuantity) {
        innerValue = iconQuantity === 1 ? String(value) : String(iconQuantity);
    }
    if (value && value < valueConstraints.min) {
        innerValue = String(valueConstraints.min);
    }
    if (precision !== undefined) {
        innerValue = Number(innerValue).toFixed(precision);
    }
    return innerValue;
};
const getDisplayValue = (innerValue, decimalSeparator = '.')=>{
    if (decimalSeparator === '.') {
        return innerValue;
    }
    return innerValue.replace('.', decimalSeparator);
};
