var r=new Set(["BIF","CLP","DJF","GNF","ISK","JPY","KMF","KRW","MGA","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"]),n=new Set(["BHD","JOD","KWD","OMR","TND"]);function e(e){const o=e.toUpperCase();return r.has(o)?0:n.has(o)?3:2}function o(r,n){const o=null!=n?e(n):2;return Math.round(r*10**(2-o))}function t(r){return r%100==0}function c(r,n,o="narrowSymbol"){const t=e(n);return new Intl.NumberFormat(void 0,{style:"currency",currency:n,currencyDisplay:o,minimumFractionDigits:t,maximumFractionDigits:t}).format(r/10**t)}function i(r,n,o){const t=e(n);return new Intl.NumberFormat(void 0,{style:"currency",currency:n,currencyDisplay:o,minimumFractionDigits:t,maximumFractionDigits:t}).format(r/100)}function u(r,n){if(!r||"number"!=typeof r.minor)return null;const e=r.currency.toUpperCase();if(n&&e===n.currency)return i(r.minor,e,"code");if(n&&e===n.baseCurrency){if("number"==typeof n.baseAnchorMinor&&"number"==typeof n.refLocalMinor&&r.minor===n.baseAnchorMinor)return c(n.refLocalMinor,n.currency,"code");if(null!==n.fxFromBase)return c(Math.round(r.minor*n.fxFromBase),n.currency,"code")}return i(r.minor,e,"code")}export{o as a,e as i,c as n,t as r,u as t};