import{r as i,h as l}from"./p-b891c2f1.js";import{o as s}from"./p-494248b1.js";import{h as o}from"./p-eaac2001.js";import{i as t,g as n}from"./p-936390dd.js";import{_ as e}from"./p-684c85b4.js";import"./p-aafd8ea4.js";import"./p-112455b1.js";const r=class{constructor(l){i(this,l)}render(){var i,s;return this.loading?l("sc-line-item",null,l("sc-skeleton",{style:{width:"50px",height:"50px","--border-radius":"0"},slot:"image"}),l("sc-skeleton",{slot:"title",style:{width:"120px",display:"inline-block"}}),l("sc-skeleton",{slot:"description",style:{width:"60px",display:"inline-block"}}),l("sc-skeleton",{style:{width:"120px",display:"inline-block"},slot:"price"}),l("sc-skeleton",{style:{width:"60px",display:"inline-block"},slot:"price-description"})):l("div",{class:{"confirmation-summary":!0}},l("div",{class:"line-items",part:"line-items"},null===(s=null===(i=this.order)||void 0===i?void 0:i.line_items)||void 0===s?void 0:s.data.map((i=>{var s,n,e,r,d,a;return l("sc-product-line-item",{key:i.id,imageUrl:null===(n=null===(s=null==i?void 0:i.price)||void 0===s?void 0:s.product)||void 0===n?void 0:n.image_url,name:`${null===(r=null===(e=null==i?void 0:i.price)||void 0===e?void 0:e.product)||void 0===r?void 0:r.name}`,editable:!1,removable:!1,quantity:i.quantity,amount:null!==i.ad_hoc_amount?i.ad_hoc_amount:i.subtotal_amount,currency:null===(d=this.order)||void 0===d?void 0:d.currency,trialDurationDays:null===(a=null==i?void 0:i.price)||void 0===a?void 0:a.trial_duration_days,interval:t(null==i?void 0:i.price,{showOnce:o(this.order)})})}))))}};s(r,["order","busy","loading","empty"],!1),r.style=":host{display:block}.line-items{display:grid;gap:var(--sc-spacing-small)}::part(line-items){display:grid;gap:var(--sc-spacing-small)}";const d=class{constructor(l){i(this,l)}renderDiscountLine(){var i,s,o,t,r,d,a,c,v,u,p,m,h,y,b;if(!(null===(o=null===(s=null===(i=this.order)||void 0===i?void 0:i.discount)||void 0===s?void 0:s.promotion)||void 0===o?void 0:o.code))return null;let g="";return(null===(r=null===(t=this.order)||void 0===t?void 0:t.discount)||void 0===r?void 0:r.coupon)&&(g=n(null===(a=null===(d=this.order)||void 0===d?void 0:d.discount)||void 0===a?void 0:a.coupon)),l("sc-line-item",{style:{marginTop:"var(--sc-spacing-small)"}},l("span",{slot:"description"},e("Discount","surecart"),l("br",null),(null===(u=null===(v=null===(c=this.order)||void 0===c?void 0:c.discount)||void 0===v?void 0:v.promotion)||void 0===u?void 0:u.code)&&l("sc-tag",{type:"success",size:"small"},null===(h=null===(m=null===(p=this.order)||void 0===p?void 0:p.discount)||void 0===m?void 0:m.promotion)||void 0===h?void 0:h.code)),g&&l("span",{class:"coupon-human-discount",slot:"price-description"},"(",g,")"),l("sc-format-number",{slot:"price",type:"currency",currency:null===(y=this.order)||void 0===y?void 0:y.currency,value:-(null===(b=this.order)||void 0===b?void 0:b.discount_amount)}))}render(){return l("div",{class:{"line-item-totals":!0}},l("sc-line-item-total",{order:this.order,total:"subtotal"},l("span",{slot:"description"},e("Subtotal","surecart"))),this.renderDiscountLine(),l("sc-divider",{style:{"--spacing":"var(--sc-spacing-small)"}}),l("sc-line-item-total",{order:this.order,size:"large","show-currency":!0},l("span",{slot:"description"},e("Total","surecart"))))}};s(d,["order","busy","loading","empty"],!1),d.style=":host{display:block}";export{r as sc_order_confirmation_line_items,d as sc_order_confirmation_totals}