import{r as i,h as o,F as e}from"./p-e97fde0a.js";import"./p-2d2ea552.js";import{s as d}from"./p-86fd1a31.js";import"./p-863940e9.js";import"./p-03631502.js";import"./p-13f5e4e1.js";import"./p-3f6362a4.js";import"./p-ec182234.js";import"./p-9dbc54d6.js";import"./p-93127aa7.js";import"./p-830ab1a3.js";import"./p-fd1598d9.js";import"./p-3b9fdf35.js";import"./p-d9fa04f9.js";import"./p-401e165e.js";import"./p-d3366af3.js";import"./p-1f60f497.js";const l=":host{display:block}sc-divider{margin:16px 0 !important}.conversion-description{color:var(--sc-color-gray-500);font-size:var(--sc-font-size-small);margin-right:var(--sc-spacing-xx-small)}";const s=l;const a=class{constructor(o){i(this,o)}renderAmountDue(){var i,o;return d.amount_due>0?(i=d===null||d===void 0?void 0:d.line_item)===null||i===void 0?void 0:i.total_display_amount:!!((o=d===null||d===void 0?void 0:d.line_item)===null||o===void 0?void 0:o.trial_amount)?wp.i18n.__("Trial","surecart"):wp.i18n.__("Free","surecart")}getCurrencyToDisplay(){var i,o,e,l,s,a,r;return((e=(o=(i=d===null||d===void 0?void 0:d.line_item)===null||i===void 0?void 0:i.total_default_currency_display_amount)===null||o===void 0?void 0:o.toLowerCase())===null||e===void 0?void 0:e.includes((s=(l=d===null||d===void 0?void 0:d.line_item)===null||l===void 0?void 0:l.currency)===null||s===void 0?void 0:s.toLowerCase()))?"":(r=(a=d===null||d===void 0?void 0:d.line_item)===null||a===void 0?void 0:a.currency)===null||r===void 0?void 0:r.toUpperCase()}renderConversion(){var i,l,s,a,r,n;const t=d===null||d===void 0?void 0:d.checkout;if(!(t===null||t===void 0?void 0:t.show_converted_total)){return null}if((t===null||t===void 0?void 0:t.currency)===(t===null||t===void 0?void 0:t.current_currency)){return null}if(!((i=d===null||d===void 0?void 0:d.line_item)===null||i===void 0?void 0:i.total_amount)){return null}return o(e,null,o("sc-divider",null),o("sc-line-item",{style:{"--price-size":"var(--sc-font-size-x-large)"}},o("span",{slot:"title"},o("slot",{name:"charge-amount-description"},wp.i18n.sprintf(wp.i18n.__("Payment Total","surecart"),(s=(l=d===null||d===void 0?void 0:d.line_item)===null||l===void 0?void 0:l.currency)===null||s===void 0?void 0:s.toUpperCase()))),o("span",{slot:"price"},this.getCurrencyToDisplay()&&o("span",{class:"currency-label"},this.getCurrencyToDisplay()),(a=d===null||d===void 0?void 0:d.line_item)===null||a===void 0?void 0:a.total_default_currency_display_amount)),o("sc-line-item",null,o("span",{slot:"description",class:"conversion-description"},wp.i18n.sprintf(wp.i18n.__("Your payment will be processed in %s.","surecart"),(n=(r=d===null||d===void 0?void 0:d.line_item)===null||r===void 0?void 0:r.currency)===null||n===void 0?void 0:n.toUpperCase()))))}render(){var i,e,l,s,a,r,n;return o("sc-summary",{key:"d0d12a58c74d07ef3df64884fd83c14f1cdb91f1","open-text":"Total","closed-text":"Total",collapsible:true,collapsed:true},!!((i=d.line_item)===null||i===void 0?void 0:i.id)&&o("span",{key:"a64782bc4695295a7aaf844035da31be972c3d5d",slot:"price"},this.renderAmountDue()),o("sc-divider",{key:"b4ddc70dbedafd762a4edafe3f5df24602cf5e02"}),o("sc-line-item",{key:"415e58357e653dd79aa311e7a604901bbe5e9e19"},o("span",{key:"05c22e31706d880770915afc9a96035005bc1d03",slot:"description"},wp.i18n.__("Subtotal","surecart")),o("span",{key:"9bba8fbb76724f9f912fa40560a61507835820f0",slot:"price"},(e=d.line_item)===null||e===void 0?void 0:e.subtotal_display_amount)),(((s=(l=d===null||d===void 0?void 0:d.line_item)===null||l===void 0?void 0:l.fees)===null||s===void 0?void 0:s.data)||[]).filter((i=>i.fee_type==="upsell")).map((i=>o("sc-line-item",null,o("span",{slot:"description"},i.description," ",`(${wp.i18n.__("one time","surecart")})`),o("span",{slot:"price"},i===null||i===void 0?void 0:i.display_amount)))),!!((a=d.line_item)===null||a===void 0?void 0:a.tax_amount)&&o("sc-line-item",{key:"253a7c26828cb55cfaefd429e9f67c38ceb431e0"},o("span",{key:"1ca1729c406b63c2e9dc81d3a230ef8e60ad8353",slot:"description"},wp.i18n.__("Tax","surecart")),o("span",{key:"203dbda52aa43411007a9a3bb61bdb9b8bcea0f7",slot:"price"},(r=d.line_item)===null||r===void 0?void 0:r.tax_display_amount)),o("sc-divider",{key:"e2478a9ae4bd9caa0990d1a6ea4eb5430083028d"}),o("sc-line-item",{key:"0fca131b074ed922d33fc9f5cdf69bffd8be4438",style:{"--price-size":"var(--sc-font-size-x-large)"}},o("span",{key:"418c622522e2f3bd6c43c0be2757a5a5e8f5b67b",slot:"title"},wp.i18n.__("Total","surecart")),o("span",{key:"db8f061f6ce6ddf011ad103aaf8cd90653bbf840",slot:"price"},(n=d.line_item)===null||n===void 0?void 0:n.total_display_amount)),this.renderConversion())}};a.style=s;export{a as sc_upsell_totals};
//# sourceMappingURL=p-cc00398e.entry.js.map