import{r as e,h as i,F as r,H as s}from"./p-9add63ef.js";import{i as o}from"./p-610295e2.js";import{j as t,s as c,b as n}from"./p-38b12af4.js";import"./p-3f6362a4.js";import"./p-2b28ea49.js";import"./p-07a2074d.js";import"./p-ec182234.js";import"./p-dd24e53c.js";import"./p-fb28f84f.js";import"./p-830ab1a3.js";const d=":host{display:block;text-align:left;position:relative;z-index:1}";const p=d;const l=class{constructor(i){e(this,i);this.label=undefined;this.showPrice=undefined;this.productId=undefined}renderPrice(e){return i(r,null,i("sc-format-number",{type:"currency",value:e.amount,currency:e.currency}),i("span",{slot:"per"},o(e,{labels:{interval:wp.i18n.__("Every","surecart"),period:wp.i18n.__("for","surecart"),once:wp.i18n.__("Once","surecart")},showOnce:true})))}render(){const e=t(this.productId);if((e===null||e===void 0?void 0:e.length)<2)return i(s,{style:{display:"none"}});return i("sc-choices",{label:this.label,required:true,style:{"--sc-input-required-indicator":" "}},(e||[]).map((e=>{var r,s,o,t;return i("sc-price-choice-container",{label:(e===null||e===void 0?void 0:e.name)||((s=(r=c[this.productId])===null||r===void 0?void 0:r.product)===null||s===void 0?void 0:s.name),showPrice:!!this.showPrice,price:e,checked:((t=(o=c[this.productId])===null||o===void 0?void 0:o.selectedPrice)===null||t===void 0?void 0:t.id)===(e===null||e===void 0?void 0:e.id),onScChange:i=>{if(i.target.checked){n(this.productId,{selectedPrice:e})}}})})))}};l.style=p;export{l as sc_product_price_choices};
//# sourceMappingURL=p-5904e0b9.entry.js.map