import{r as i,h as o,H as d}from"./p-9add63ef.js";import{s as l}from"./p-b3860daf.js";import"./p-338ab6f8.js";import{s as n}from"./p-71d77b7d.js";import"./p-2b28ea49.js";import"./p-13f5e4e1.js";import"./p-3f6362a4.js";import"./p-ec182234.js";import"./p-dd24e53c.js";import"./p-fb28f84f.js";import"./p-830ab1a3.js";import"./p-1365bb41.js";import"./p-efa47a7e.js";import"./p-445fd8b4.js";import"./p-259c3935.js";import"./p-401e165e.js";import"./p-d3366af3.js";import"./p-78468e45.js";const r=":host{display:block}";const t=r;const v=class{constructor(o){i(this,o);this.prices=undefined;this.saleText=undefined;this.productId=undefined}renderRange(){var i;return(i=l[this.productId])===null||i===void 0?void 0:i.range_display_amount}renderVariantPrice(i){var o,d;const n=(d=(o=l[this.productId])===null||o===void 0?void 0:o.variants)===null||d===void 0?void 0:d.find((o=>(o===null||o===void 0?void 0:o.id)===(i===null||i===void 0?void 0:i.id)));return this.renderPrice(l[this.productId].selectedPrice,n)}renderPrice(i,d=null){var l,r,t,v,s,u;const e=(r=(l=d===null||d===void 0?void 0:d.display_amount)!==null&&l!==void 0?l:i===null||i===void 0?void 0:i.display_amount)!==null&&r!==void 0?r:"";const p=((t=n===null||n===void 0?void 0:n.line_item)===null||t===void 0?void 0:t.subtotal_with_upsell_discount_amount)||(i===null||i===void 0?void 0:i.amount);const a=(v=n===null||n===void 0?void 0:n.line_item)===null||v===void 0?void 0:v.subtotal_with_upsell_discount_display_amount;const c=a?a:e;const m=((s=n===null||n===void 0?void 0:n.line_item)===null||s===void 0?void 0:s.subtotal_amount)||(i===null||i===void 0?void 0:i.scratch_amount);const f=(u=n===null||n===void 0?void 0:n.line_item)===null||u===void 0?void 0:u.subtotal_display_amount;const h=f?f:i===null||i===void 0?void 0:i.scratch_display_amount;return o("sc-price",{currency:i===null||i===void 0?void 0:i.currency,amount:p,displayAmount:c,scratchAmount:m,scratchDisplayAmount:h,saleText:this.saleText,adHoc:i===null||i===void 0?void 0:i.ad_hoc,trialDurationDays:i===null||i===void 0?void 0:i.trial_duration_days,setupFeeText:i===null||i===void 0?void 0:i.setup_fee_text,setupFeeAmount:(i===null||i===void 0?void 0:i.setup_fee_enabled)?i===null||i===void 0?void 0:i.setup_fee_amount:null,setupFeeName:(i===null||i===void 0?void 0:i.setup_fee_enabled)?i===null||i===void 0?void 0:i.setup_fee_name:null,recurringPeriodCount:i===null||i===void 0?void 0:i.recurring_period_count,recurringInterval:i===null||i===void 0?void 0:i.recurring_interval,recurringIntervalCount:i===null||i===void 0?void 0:i.recurring_interval_count})}render(){return o(d,{key:"4421254d0bcbdf8aba2fc35fe14bc09e5b8b38ea",role:"paragraph"},(()=>{var i,d,n,r,t;if((i=l[this.productId])===null||i===void 0?void 0:i.selectedVariant){return this.renderVariantPrice((d=l[this.productId])===null||d===void 0?void 0:d.selectedVariant)}if((n=l[this.productId])===null||n===void 0?void 0:n.selectedPrice){return this.renderPrice(l[this.productId].selectedPrice)}if((t=(r=l[this.productId])===null||r===void 0?void 0:r.prices)===null||t===void 0?void 0:t.length){return this.renderRange()}return o("slot",null)})())}};v.style=t;export{v as sc_product_price};
//# sourceMappingURL=p-5b8620bc.entry.js.map