'use strict';

var config_default = require('./config.default-Cko-wpRU.js');
var config_utils = require('./config.utils-Civnz2jT.js');

const getLocale = () => {
    const config = config_utils.useBalConfig();
    // workaround for swiss french locale which uses non standard number formatting
    if (config && config.locale && config.locale === 'fr-CH') {
        return 'de-CH';
    }
    return (config && config.locale) || config_default.defaultLocale;
};
function getDecimalSeparator() {
    return Intl.NumberFormat(getLocale())
        .format(1.1)
        .replace(/\p{Number}/gu, '');
}
function getThousandSeparator() {
    return Intl.NumberFormat(getLocale())
        .format(11111)
        .replace(/\p{Number}/gu, '');
}
function formatLocaleNumber(number, minimumFractionDigits) {
    const options = minimumFractionDigits !== undefined ? { minimumFractionDigits, maximumFractionDigits: minimumFractionDigits } : {};
    const formattedNumber = Intl.NumberFormat(getLocale(), Object.assign({}, options)).format(number);
    if (formattedNumber === 'NaN') {
        return '';
    }
    return formattedNumber;
}
const getNegativeSymbol = () => {
    return '-';
};

exports.formatLocaleNumber = formatLocaleNumber;
exports.getDecimalSeparator = getDecimalSeparator;
exports.getNegativeSymbol = getNegativeSymbol;
exports.getThousandSeparator = getThousandSeparator;
