"use strict";Object.defineProperty(exports, "__esModule", {value: true});


var _chunkZ6EUSUADcjs = require('./chunk-Z6EUSUAD.cjs');

// src/hooks/useNumberInput/utils/getLocaleConfig.ts
var defaultConfig = {
  currencySymbol: "",
  groupSeparator: "",
  decimalSeparator: "",
  prefix: "",
  suffix: ""
};
var getLocaleConfig = (intlConfig) => {
  const { locale, currency } = intlConfig || {};
  const numberFormatter = locale ? new Intl.NumberFormat(
    locale,
    currency ? { currency, style: "currency" } : void 0
  ) : new Intl.NumberFormat();
  return numberFormatter.formatToParts(1000.1).reduce((prev, curr, i) => {
    if (curr.type === "currency") {
      if (i === 0) {
        return _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, prev), { currencySymbol: curr.value, prefix: curr.value });
      } else {
        return _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, prev), { currencySymbol: curr.value, suffix: curr.value });
      }
    }
    if (curr.type === "group") {
      return _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, prev), { groupSeparator: curr.value });
    }
    if (curr.type === "decimal") {
      return _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, prev), { decimalSeparator: curr.value });
    }
    return prev;
  }, defaultConfig);
};



exports.getLocaleConfig = getLocaleConfig;
