import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import"./watchers2.js";import{s as state}from"./store.js";import{c 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,a,i,l;const d=null===(e=state.checkout)||void 0===e?void 0:e.manual_payment_method;return h(Host,{key:"e0bd7fae3712d03728032918e6181057d4d3d1b0"},h("slot",{key:"5b2e3a3418ec43ee9d6eaaf81ed5e7769f1ab3ea"}),isBusy()&&h("sc-block-ui",{key:"55eabf65db2d383f824e809c92eb510041b69ab9",style:{"z-index":"30","--sc-block-ui-position":"fixed"}}),h("sc-dialog",{key:"e67185f02d31cd37f8846b2f6ed2719b1f34ce4d",open:"complete"===state.loading,style:{"--body-spacing":"var(--sc-spacing-xxx-large)"},noHeader:!0,onScRequestClose:e=>e.preventDefault()},h("div",{key:"923a7b386af088712fc46ae7edab8bc36d95214d",class:"confirm__icon"},h("div",{key:"77e7db08c7ca8e9d014afa1e63faeaab3588c295",class:"confirm__icon-container"},h("sc-icon",{key:"cda8b7a13bae75bbbdd3d15d8d4cffbfc9ca1a42",name:"check"}))),h("sc-dashboard-module",{key:"84e9fc75822805427a0defb80b2cc21c9230591d",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:"521bad972d87e95191a2b2ccf5d4fa87aadbf6a2",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:"ac3e953b0d02566e8ef99fe9eb223247e813f08f",type:"info",open:!0,style:{"text-align":"left"}},h("span",{key:"22f5bd4fe83fb3aa7fd5f1846cad7134f629793a",slot:"title"},null==d?void 0:d.name),h("div",{key:"4ac526b8a096d8634f4c132dd310dd94be38c2ba",innerHTML:null==d?void 0:d.instructions})),h("sc-button",{key:"285c4c49700ac269cccc3e025537219293d5ce61",href:null===(a=null===(n=null===window||void 0===window?void 0:window.scData)||void 0===n?void 0:n.pages)||void 0===a?void 0:a.dashboard,size:"large",type:"primary",autofocus:!0},(null===(l=null===(i=null==state?void 0:state.text)||void 0===i?void 0:i.success)||void 0===l?void 0:l.button)||wp.i18n.__("Continue","surecart"),h("sc-icon",{key:"79d3d417f5e1c3aeec68461e29a918b18907a988",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};