import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import"./watchers2.js";import{s as state}from"./store.js";import{a as isBusy}from"./getters.js";import{t as trackOffer,p as preview}from"./mutations.js";import{d as defineCustomElement$8}from"./sc-alert2.js";import{d as defineCustomElement$7}from"./sc-block-ui2.js";import{d as defineCustomElement$6}from"./sc-button2.js";import{d as defineCustomElement$5}from"./sc-dashboard-module2.js";import{d as defineCustomElement$4}from"./sc-dialog2.js";import{d as defineCustomElement$3}from"./sc-icon2.js";import{d as defineCustomElement$2}from"./sc-spinner2.js";const scUpsellCss=":host{display:block}.confirm__icon{margin-bottom:var(--sc-spacing-medium);display:flex;justify-content:center}.confirm__icon-container{background:var(--sc-color-primary-500);width:55px;height:55px;border-radius:999999px;display:flex;align-items:center;justify-content:center;font-size:26px;line-height:1;color:white}",ScUpsellStyle0=scUpsellCss,ScUpsell$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow()}componentWillLoad(){trackOffer(),preview()}render(){var e,s,t,o,c,n,i,a,l;const d=null===(e=state.checkout)||void 0===e?void 0:e.manual_payment_method;return h(Host,{key:"5a5ccb40408bb12b013981123e775bebb69414a1"},h("slot",{key:"d4a4fbc31372bf47404d74bd3b642ea3b5ebf359"}),isBusy()&&h("sc-block-ui",{key:"c67cc77f8b58098ba21bcde7eb7f736cc684b324",style:{"z-index":"30","--sc-block-ui-position":"fixed"}}),h("sc-dialog",{key:"17fe9ac372b7a15f70d5750d0c35f310c7e6d3d8",open:"complete"===state.loading,style:{"--body-spacing":"var(--sc-spacing-xxx-large)"},noHeader:!0,onScRequestClose:e=>e.preventDefault()},h("div",{key:"d7f66a09a0fa771352e068cc1b84622d62e0e077",class:"confirm__icon"},h("div",{key:"5f1bd21266ea19d9fe71a100a3c3ca599d86eefe",class:"confirm__icon-container"},h("sc-icon",{key:"4423780f17684d15821ed498cbe9a5883456793b",name:"check"}))),h("sc-dashboard-module",{key:"81881198ccac737cdc6b8090005e2fd681796267",heading:(null===(t=null===(s=null==state?void 0:state.text)||void 0===s?void 0:s.success)||void 0===t?void 0:t.title)||wp.i18n.__("Thank you!","surecart"),style:{"--sc-dashboard-module-spacing":"var(--sc-spacing-x-large)",textAlign:"center"}},h("span",{key:"4f39e49eed4878abbc807fe185e0a962a5b948a2",slot:"description"},(null===(c=null===(o=null==state?void 0:state.text)||void 0===o?void 0:o.success)||void 0===c?void 0:c.description)||wp.i18n.__("Your purchase was successful. A receipt is on its way to your inbox.","surecart")),!!(null==d?void 0:d.name)&&!!(null==d?void 0:d.instructions)&&h("sc-alert",{key:"c2d1f31cbd76ec5f6effbba271fcc9aeb8097820",type:"info",open:!0,style:{"text-align":"left"}},h("span",{key:"330c419ae8b7386cc12cbe1db62792d20dec4993",slot:"title"},null==d?void 0:d.name),h("div",{key:"26059fa92fcd82498fa7695e400f608439d24cc5",innerHTML:null==d?void 0:d.instructions})),h("sc-button",{key:"5a5a00990a9127a957cdf198cd8a37daaef77484",href:null===(i=null===(n=null===window||void 0===window?void 0:window.scData)||void 0===n?void 0:n.pages)||void 0===i?void 0:i.dashboard,size:"large",type:"primary",autofocus:!0},(null===(l=null===(a=null==state?void 0:state.text)||void 0===a?void 0:a.success)||void 0===l?void 0:l.button)||wp.i18n.__("Continue","surecart"),h("sc-icon",{key:"e5e83144788e5345cdf2e2d308eb08f10a9abc44",name:"arrow-right",slot:"suffix"})))))}static get style(){return ScUpsellStyle0}},[1,"sc-upsell"]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["sc-upsell","sc-alert","sc-block-ui","sc-button","sc-dashboard-module","sc-dialog","sc-icon","sc-spinner"].forEach((e=>{switch(e){case"sc-upsell":customElements.get(e)||customElements.define(e,ScUpsell$1);break;case"sc-alert":customElements.get(e)||defineCustomElement$8();break;case"sc-block-ui":customElements.get(e)||defineCustomElement$7();break;case"sc-button":customElements.get(e)||defineCustomElement$6();break;case"sc-dashboard-module":customElements.get(e)||defineCustomElement$5();break;case"sc-dialog":customElements.get(e)||defineCustomElement$4();break;case"sc-icon":customElements.get(e)||defineCustomElement$3();break;case"sc-spinner":customElements.get(e)||defineCustomElement$2()}}))}const ScUpsell=ScUpsell$1,defineCustomElement=defineCustomElement$1;export{ScUpsell,defineCustomElement};