import{r as i,h as o,a as s,H as t}from"./p-9add63ef.js";import{s as e}from"./p-bfa929cc.js";import"./p-2b28ea49.js";import"./p-dd24e53c.js";import"./p-73151c01.js";import"./p-1282ed4a.js";import"./p-d3366af3.js";import"./p-401e165e.js";import"./p-830ab1a3.js";import"./p-ec182234.js";import"./p-3f6362a4.js";import"./p-31faf2b8.js";import"./p-610295e2.js";import"./p-e2e1fe1f.js";import"./p-fb28f84f.js";import"./p-0646489c.js";import"./p-78468e45.js";import"./p-c1ecac8a.js";import"./p-445fd8b4.js";import"./p-259c3935.js";const r=":host{display:block}.sc-product-donation-choices{display:grid;gap:2em;position:relative;--columns:4}.sc-product-donation-choices__form{display:grid;gap:var(--sc-spacing-small)}.sc-donation-recurring-choices{display:grid;gap:var(--sc-spacing-small);position:relative;--columns:2}";const n=r;const c=class{constructor(o){i(this,o);this.productId=undefined;this.label=undefined;this.recurring=undefined}state(){return e[this.productId]}updateState(i){e[this.productId]={...e[this.productId],...i}}render(){var i,s,e,r;const n=(((e=(s=(i=this.state())===null||i===void 0?void 0:i.product)===null||s===void 0?void 0:s.prices)===null||e===void 0?void 0:e.data)||[]).filter((i=>this.recurring?(i===null||i===void 0?void 0:i.recurring_interval)&&(i===null||i===void 0?void 0:i.ad_hoc):!(i===null||i===void 0?void 0:i.recurring_interval)&&(i===null||i===void 0?void 0:i.ad_hoc))).filter((i=>!(i===null||i===void 0?void 0:i.archived)));if(!(n===null||n===void 0?void 0:n.length)){return o(t,{style:{display:"none"}})}return o("sc-recurring-price-choice-container",{prices:n.sort(((i,o)=>(i===null||i===void 0?void 0:i.position)-(o===null||o===void 0?void 0:o.position))),product:(r=this.state())===null||r===void 0?void 0:r.product,selectedPrice:this.state().selectedPrice,showDetails:false,showAmount:false,onScChange:i=>{var o,s;const t=(((s=(o=this.state().product)===null||o===void 0?void 0:o.prices)===null||s===void 0?void 0:s.data)||[]).find((({id:o})=>o==i.detail));this.updateState({selectedPrice:t})},"aria-label":this.recurring?wp.i18n.__("If you want to make your donation recurring then Press Tab once & select the recurring interval from the dropdown. ","surecart"):wp.i18n.__("If you want to make your donation once then Press Enter. ","surecart"),style:{"--sc-recurring-price-choice-white-space":"wrap","--sc-recurring-price-choice-text-align":"left"}},o("slot",null,this.label))}get el(){return s(this)}};c.style=n;export{c as sc_product_donation_choices};
//# sourceMappingURL=p-b8429d95.entry.js.map