import{proxyCustomElement,HTMLElement,h,Fragment,Host}from"@stencil/core/internal/client";import{s as state}from"./store3.js";import{s as state$1}from"./mutations2.js";import{d as defineCustomElement$2}from"./sc-line-item2.js";import{d as defineCustomElement$1}from"./sc-skeleton2.js";const scLineItemShippingCss=":host{display:block}",ScLineItemShippingStyle0=scLineItemShippingCss,ScLineItemShipping=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.label=void 0}renderShippingFees(e){var t,i,s,n;return(null===(i=null===(t=null==e?void 0:e.shipping_fees)||void 0===t?void 0:t.data)||void 0===i?void 0:i.length)?h(Fragment,null,null===(n=null===(s=null==e?void 0:e.shipping_fees)||void 0===s?void 0:s.data)||void 0===n?void 0:n.map((e=>h("sc-line-item",{key:e.id},h("span",{slot:"description"},e.description),h("span",{slot:"price"},e.display_amount))))):null}render(){const{checkout:e}=state$1;return(null==e?void 0:e.selected_shipping_choice)?"loading"===state.formState.value?h("sc-line-item",null,h("sc-skeleton",{slot:"title",style:{width:"120px",display:"inline-block"}}),h("sc-skeleton",{slot:"price",style:{width:"70px",display:"inline-block","--border-radius":"6px"}})):h(Fragment,null,h("sc-line-item",null,h("span",{slot:"description"},this.label||wp.i18n.__("Shipping","surecart")),h("span",{slot:"price"},null==e?void 0:e.shipping_display_amount)),this.renderShippingFees(e)):h(Host,{style:{display:"none"}})}static get style(){return ScLineItemShippingStyle0}},[1,"sc-line-item-shipping",{label:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-line-item-shipping","sc-line-item","sc-skeleton"].forEach((e=>{switch(e){case"sc-line-item-shipping":customElements.get(e)||customElements.define(e,ScLineItemShipping);break;case"sc-line-item":customElements.get(e)||defineCustomElement$2();break;case"sc-skeleton":customElements.get(e)||defineCustomElement$1()}}))}export{ScLineItemShipping as S,defineCustomElement as d};