import { CURRENCY_SYMBOL_MAP as n } from "../constants.js";
import { locale as t } from "../locale.js";
const m = (r) => {
  if (typeof r != "string")
    return;
  const e = r.toUpperCase();
  if (Object.prototype.hasOwnProperty.call(n, e))
    return n[e];
}, y = a(t), o = m("USD"), g = {
  default: "USD",
  position: u(),
  symbol: o
};
function a(r) {
  return 1.1.toLocaleString(r).replace(/\d/g, "");
}
function u({ type: r = "currency" } = {}) {
  return r === "percent" && p(1).indexOf("%") === 0 || r === "currency" && l({ amount: 1 }).indexOf(o) === 0 ? "prepend" : "append";
}
function D(r, e) {
  return new Intl.NumberFormat(t, {
    minimumFractionDigits: e,
    maximumFractionDigits: e,
    style: "decimal"
  }).format(r);
}
function l({ amount: r, currency: e = "USD" }) {
  return new Intl.NumberFormat(t, {
    style: "currency",
    currency: e
  }).format(r);
}
function p(r, e) {
  return new Intl.NumberFormat(t, {
    style: "percent",
    minimumFractionDigits: e,
    maximumFractionDigits: e || 2
  }).format(r);
}
function S(r, e = ".") {
  const c = `[^0-9${e}+-]*`, i = new RegExp(c, "g");
  return `${r}`.replace(i, "");
}
function d(r, e = ".") {
  return `${r}`.replace(e === "." ? "," : ".", e);
}
export {
  d as convertDecimal,
  g as currency,
  o as currencySymbol,
  D as decimal,
  y as decimalSeparator,
  u as getLocaleSymbolPosition,
  m as getSymbolFromCurrency,
  l as money,
  p as percent,
  S as sanitizeDecimal
};
//# sourceMappingURL=i18n.js.map
