import{_ as r,s as e,a}from"./p-684c85b4.js";import"./p-aafd8ea4.js";const n=r=>r.amount_off&&r.currency?t({amount:r.amount_off,currency:r.currency}):r.percent_off?(0|r.percent_off)+"% off":"",t=({amount:r,currency:e})=>{const a=((r,e)=>["bif","clp","djf","gnf","jpy","kmf","krw"].includes(e)?r:r/100)(r,e);return`${new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format(parseFloat(a.toFixed(2)))}`},s=(r="usd")=>{const[e]=new Intl.NumberFormat(void 0,{style:"currency",currency:r}).formatToParts();return null==e?void 0:e.value},c=(n,t,s=r("every","surecart"),c=r("once","surecart"),u=!1)=>{switch(t){case"day":return`${s} ${e(a(u?"%d day":"day","%d days",n,"surecart"),n)}`;case"week":return`${s} ${e(a(u?"%d week":"week","%d weeks",n,"surecart"),n)}`;case"month":return`${s} ${e(a(u?"%d month":"month","%d months",n,"surecart"),n)}`;case"year":return`${s} ${e(a(u?"%d year":"year","%d years",n,"surecart"),n)}`;default:return c}},u=(e,a={})=>{if(!e)return"";const{showOnce:n,labels:t}=a,{interval:s=r("every","surecart"),period:c=r("for","surecart")}=t||{};return`${o(e,s,n?r("once","surecart"):"")} ${d(e,c)}`},o=(e,a,n=r("once","surecart"))=>e.recurring_interval_count&&e.recurring_interval?c(e.recurring_interval_count,e.recurring_interval,` ${a}`,n):"",d=(r,e,a="")=>(null==r?void 0:r.recurring_period_count)&&(null==r?void 0:r.recurring_interval)?c(((null==r?void 0:r.recurring_period_count)||0)*(null==r?void 0:r.recurring_interval_count),null==r?void 0:r.recurring_interval,` ${e}`,a,!0):"";export{s as a,n as g,u as i,c as t}