import{Host,h}from"@stencil/core";import{state}from"../../../../store/upsell/index";import{isBusy}from"../../../../store/upsell/getters";import{preview,trackOffer}from"../../../../store/upsell/mutations";import{__}from"@wordpress/i18n";export class ScUpsell{componentWillLoad(){trackOffer(),preview()}render(){var e,s,t,a,c,o,i,d,l;const n=null===(e=state.checkout)||void 0===e?void 0:e.manual_payment_method;return h(Host,{key:"825ae2a4f3f84010cac7fd7f3785fd430308db10"},h("slot",{key:"295c692a66a8d5a417f5624293efa4dab1a26af1"}),isBusy()&&h("sc-block-ui",{key:"0d880ea8736b2cecfe0662e993e0a0629e7ed4e0",style:{"z-index":"30","--sc-block-ui-position":"fixed"}}),h("sc-dialog",{key:"8aab41e8939ea2db2cb23becf2039f7f0f6bd70b",open:"complete"===state.loading,style:{"--body-spacing":"var(--sc-spacing-xxx-large)"},noHeader:!0,onScRequestClose:e=>e.preventDefault()},h("div",{key:"7e201705d4cd9bce69932c7dcd6bae8b44634817",class:"confirm__icon"},h("div",{key:"4e06bdda114d9d4dcb1e3b0e9cf58cea56cc76e2",class:"confirm__icon-container"},h("sc-icon",{key:"70120a9c028272f9ede9d806418b2be14197dd26",name:"check"}))),h("sc-dashboard-module",{key:"3373a97815eacdeb2d1e38d19ef54715a9452b13",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)||__("Thank you!","surecart"),style:{"--sc-dashboard-module-spacing":"var(--sc-spacing-x-large)",textAlign:"center"}},h("span",{key:"cf2c4e4bc3f177cd85acbacd8543b3d7fe2f6900",slot:"description"},(null===(c=null===(a=null==state?void 0:state.text)||void 0===a?void 0:a.success)||void 0===c?void 0:c.description)||__("Your purchase was successful. A receipt is on its way to your inbox.","surecart")),!!(null==n?void 0:n.name)&&!!(null==n?void 0:n.instructions)&&h("sc-alert",{key:"394b429e4117f3fa12acfa44434758cf0998c29c",type:"info",open:!0,style:{"text-align":"left"}},h("span",{key:"ad9f1de6f14eb86f16ee9e5e92b4a38aeac8523d",slot:"title"},null==n?void 0:n.name),h("div",{key:"b112a0497b50ac9cdfa878d8bcf92cc41846f855",innerHTML:null==n?void 0:n.instructions})),h("sc-button",{key:"09b3f6c210b4ca818ab4a99e61067d1876c070be",href:null===(i=null===(o=null===window||void 0===window?void 0:window.scData)||void 0===o?void 0:o.pages)||void 0===i?void 0:i.dashboard,size:"large",type:"primary",autofocus:!0},(null===(l=null===(d=null==state?void 0:state.text)||void 0===d?void 0:d.success)||void 0===l?void 0:l.button)||__("Continue","surecart"),h("sc-icon",{key:"905f641e22947da1af52198d8d150dfdce1b183f",name:"arrow-right",slot:"suffix"})))))}static get is(){return"sc-upsell"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-upsell.scss"]}}static get styleUrls(){return{$:["sc-upsell.css"]}}}