(()=>{"use strict";var e={d:(r,t)=>{for(var n in t)e.o(t,n)&&!e.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{formatPrice:()=>i,getCurrency:()=>o,getCurrencyFromPriceResponse:()=>n});const t=window.wc.wcSettings,n=e=>{if(null==e||!e.currency_code)return t.SITE_CURRENCY;const{currency_code:r,currency_symbol:n,currency_thousand_separator:o,currency_decimal_separator:i,currency_minor_unit:c,currency_prefix:a,currency_suffix:u}=e;return{code:r||t.SITE_CURRENCY.code,symbol:n||t.SITE_CURRENCY.symbol,thousandSeparator:"string"==typeof o?o:t.SITE_CURRENCY.thousandSeparator,decimalSeparator:"string"==typeof i?i:t.SITE_CURRENCY.decimalSeparator,minorUnit:Number.isFinite(c)?c:t.SITE_CURRENCY.minorUnit,prefix:"string"==typeof a?a:t.SITE_CURRENCY.prefix,suffix:"string"==typeof u?u:t.SITE_CURRENCY.suffix}},o=(e={})=>({...t.SITE_CURRENCY,...e}),i=(e,r)=>{if(""===e||void 0===e)return"";const t="number"==typeof e?e:parseInt(e,10);if(!Number.isFinite(t))return"";const n=o(r),{minorUnit:i,prefix:c,suffix:a,decimalSeparator:u,thousandSeparator:s}=n,f=t/10**i,{beforeDecimal:p,afterDecimal:d}=(e=>{const r=e.split(".");return{beforeDecimal:r[0],afterDecimal:r[1]||""}})(f.toString()),l=`${c}${((e,r)=>e.replace(/\B(?=(\d{3})+(?!\d))/g,r))(p,s)}${((e,r,t)=>e?`${r}${e.padEnd(t,"0")}`:t>0?`${r}${"0".repeat(t)}`:"")(d,u,i)}${a}`,m=document.createElement("textarea");return m.innerHTML=l,m.value};(this.wc=this.wc||{}).priceFormat=r})();