{"version":3,"file":"usePercentage.mjs","names":[],"sources":["../../../../src/server/format/usePercentage.ts"],"sourcesContent":["import { percentage } from '@intlayer/core/formatters';\nimport { resolveAmbientLocale } from '../ambientLocale';\n\n/**\n * On the server side, hook returning a `percentage` formatter bound to the ambient\n * locale: the server context, falling back to the locale carried by the\n * request. A per-call `locale` option still wins.\n *\n * Reimplemented rather than re-exported from `react-intlayer/server/format`:\n * that one takes no locale argument, so there is no way to hand it the ambient\n * locale — it would read the server context alone and format with the default\n * locale on any render the provider did not reach.\n */\nexport const usePercentage = () => {\n  const locale = resolveAmbientLocale();\n\n  return (...args: Parameters<typeof percentage>) =>\n    percentage(args[0], {\n      ...args[1],\n      locale: args[1]?.locale ?? locale,\n    });\n};\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,sBAAsB;CACjC,MAAM,SAAS,qBAAqB;CAEpC,QAAQ,GAAG,SACT,WAAW,KAAK,IAAI;EAClB,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}