import{r as t,h as i}from"./p-dfbe004d.js";import{o as s}from"./p-d63f2554.js";import{_ as l}from"./p-8415f806.js";import"./p-fd56940f.js";import"./p-9a7a47e8.js";const o=class{constructor(i){t(this,i),this.total="total",this.order_key={total:"total_amount",subtotal:"subtotal_amount",amount_due:"amount_due"}}render(){var t,s,o,e,r,a,n,c,d,p,u;return this.loading&&!(null===(t=this.order)||void 0===t?void 0:t[null===(s=null==this?void 0:this.order_key)||void 0===s?void 0:s[null==this?void 0:this.total]])?i("sc-line-item",null,i("sc-skeleton",{slot:"title",style:{width:"120px",display:"inline-block"}}),i("sc-skeleton",{slot:"price",style:{width:"70px",display:"inline-block",height:"large"===this.size?"40px":"","--border-radius":"6px"}})):(null===(o=this.order)||void 0===o?void 0:o.currency)?"total"===this.total&&(null===(e=this.order)||void 0===e?void 0:e.total_amount)!==(null===(r=this.order)||void 0===r?void 0:r.amount_due)?i("div",{class:"line-item-total__group"},i("sc-line-item",null,i("span",{slot:"description"},i("slot",{name:"title"}),i("slot",{name:"description"})),i("span",{slot:"price"},i("sc-total",{order:this.order,total:this.total}))),i("sc-line-item",{style:{"--price-size":"var(--sc-font-size-x-large)"}},i("span",{slot:"title"},i("slot",{name:"subscription-title"},l("Total Due Today","surecart"))),i("span",{slot:"price"},i("sc-format-number",{type:"currency",currency:null===(a=this.order)||void 0===a?void 0:a.currency,value:null===(n=this.order)||void 0===n?void 0:n.amount_due})))):i("sc-line-item",{style:"large"===this.size?{"--price-size":"var(--sc-font-size-x-large)"}:{}},i("span",{slot:"title"},i("slot",{name:"title"})),i("span",{slot:"description"},i("slot",{name:"description"})),i("span",{slot:"price"},!!(null===(c=this.order)||void 0===c?void 0:c.total_savings_amount)&&"total"===this.total&&i("sc-format-number",{class:"scratch-price",type:"currency",value:-(null===(d=this.order)||void 0===d?void 0:d.total_savings_amount)+(null===(p=this.order)||void 0===p?void 0:p.total_amount),currency:(null===(u=this.order)||void 0===u?void 0:u.currency)||"usd"}),i("sc-total",{order:this.order,total:this.total}))):void 0}};s(o,["order","loading","calculating"],!1),o.style=":host{display:block}sc-line-item{text-align:left}.line-item-total__group sc-line-item{margin:4px 0px !important}.scratch-price{text-decoration:line-through;color:var(--sc-color-gray-500);font-size:var(--sc-font-size-small);margin-right:var(--sc-spacing-xx-small)}";export{o as sc_line_item_total}