{"version":3,"file":"Money.cjs","names":[],"sources":["../../../src/components/Money/Money.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport { numberFormat } from \"@/utils/intl-cache\";\n\nexport interface MoneyProps extends HTMLAttributes<HTMLSpanElement> {\n    /** Amount in the smallest currency unit (e.g. cents). */\n    cents: number;\n    /** ISO 4217 currency code. Defaults to \"BRL\". */\n    currency?: string;\n    /** BCP 47 locale used for formatting. Defaults to \"pt-BR\". */\n    locale?: string;\n}\n\n/**\n * Render a monetary amount given in cents as a localized currency string\n * inside a `<span>`.\n *\n * The integer cents are divided by 100 and formatted with `Intl.NumberFormat`.\n *\n * @example\n * <Money cents={1990} />            // \"R$ 19,90\"\n * <Money cents={500} currency=\"USD\" locale=\"en-US\" /> // \"$5.00\"\n */\nexport function Money({ cents, currency = \"BRL\", locale = \"pt-BR\", ...props }: MoneyProps) {\n    const formatted = numberFormat(locale, { style: \"currency\", currency }).format(cents / 100);\n\n    return <span {...props}>{formatted}</span>;\n}\n"],"mappings":"iFAsBA,SAAgB,EAAM,CAAE,QAAO,WAAW,MAAO,SAAS,QAAS,GAAG,GAAqB,CACvF,IAAM,EAAY,EAAA,aAAa,EAAQ,CAAE,MAAO,WAAY,UAAS,CAAC,CAAC,CAAC,OAAO,EAAQ,GAAG,EAE1F,OAAO,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,GAAI,EAAQ,SAAA,CAAgB,CAAA,CAC7C"}