import { jsx as e } from "react/jsx-runtime";
//#region src/shared/currencyAmount.tsx
var t = "—", n = (e) => Object.is(e, -0) ? 0 : e;
function r(e, r = {}) {
	let i = r.fallback ?? t;
	if (e == null) return i;
	let a = Number(e.amount), o = e.currency.trim();
	if (!Number.isFinite(a) || o.length === 0) return i;
	try {
		return new Intl.NumberFormat(r.locale, {
			style: "currency",
			currency: o,
			currencyDisplay: r.currencyDisplay ?? "symbol",
			minimumFractionDigits: 2,
			maximumFractionDigits: 2
		}).format(n(a));
	} catch {
		return i;
	}
}
var i = ({ amount: t, currency: n, locale: i, fallback: a, currencyDisplay: o, className: s }) => {
	let c = null;
	t != null && n != null && (c = {
		amount: t,
		currency: n
	});
	let l = {};
	return i != null && (l.locale = i), a != null && (l.fallback = a), o != null && (l.currencyDisplay = o), /* @__PURE__ */ e("span", {
		className: s,
		children: r(c, l)
	});
};
//#endregion
export { i as MoneyAmount, r as formatCurrencyAmount };

//# sourceMappingURL=currencyAmount.js.map