(()=>{"use strict";const e=window.React,o=window.wp.i18n,s=window.wp.components,t=window.ReactJSXRuntime;!function(a,n){const i=i=>{const l=`${n.pluginURL}/inc/assets/img/welcome.svg`,[d,c]=(0,e.useState)(""),r=()=>(a.post(ajaxurl,{action:n.onboardingModalAction,_wpnonce:n.onboardingModalNonce,email:d}),i.onRequestClose());return(0,t.jsx)(s.Guide,{onFinish:r,className:"wp-modal wp-modal--onboarding",pages:[{image:(0,t.jsx)("picture",{children:(0,t.jsx)("img",{src:l})}),content:(0,t.jsxs)("form",{onSubmit:r,children:[(0,t.jsxs)("div",{className:"wp-modal__header",children:[(0,t.jsx)("h1",{children:(0,o.__)("One last thing","the-block")}),(0,t.jsx)("p",{children:(0,o.__)("We'll occasionally send you emails about theme updates. And don't sweat it, you can unsubscribe anytime.","wp-modal")})]}),(0,t.jsxs)("div",{className:"wp-modal__body",children:[(0,t.jsx)("label",{children:(0,o.__)("Email address","the-block")}),(0,t.jsx)("input",{type:"email",value:d,onChange:e=>{c(e.target.value)},autoFocus:!0})]}),(0,t.jsx)("div",{className:"wp-modal__footer",children:(0,t.jsx)(s.BaseControl,{children:(0,t.jsx)(s.Button,{isPrimary:!0,onClick:r,text:(0,o.__)("Continue","the-block")})})})]})}]})},l=e=>{const a=`${n.pluginURL}/inc/assets/img/welcome.svg`;return(0,t.jsx)(s.Guide,{onFinish:e.onRequestClose,className:"wp-modal wp-modal--upgrade",pages:[{image:(0,t.jsx)("picture",{children:(0,t.jsx)("img",{src:a})}),content:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"wp-modal__header",children:(0,t.jsx)("h1",{children:(0,o.__)("You'll need to upgrade to get access to this","the-block")})}),(0,t.jsxs)("div",{className:"wp-modal__body",children:[(0,t.jsx)("p",{children:(0,o.__)("You're just a mouse click and a few key taps away from building better modals.","wp-modal")}),(0,t.jsxs)("ul",{children:[(0,t.jsx)("li",{children:(0,o.__)("Advanced features and integrations","the-block")}),(0,t.jsx)("li",{children:(0,o.__)("Help from our friendly support team","the-block")}),(0,t.jsx)("li",{children:(0,o.__)("New updates every second week","the-block")})]}),(0,t.jsx)("p",{children:(0,o.__)("Ready to build better modals?","the-block")})]}),(0,t.jsx)("div",{className:"wp-modal__footer",children:(0,t.jsxs)(s.BaseControl,{children:[(0,t.jsx)(s.Button,{isPrimary:!0,href:"https://www.riangle.com",target:"_blank",text:(0,o.__)("Learn More Now","the-block")}),(0,t.jsx)(s.Button,{isSecondary:!0,onClick:e.onRequestClose,text:(0,o.__)("Nope, Maybe Later","the-block")})]})})]})}]})},d=function(e,o){const{render:a}=wp.element,n=e=>(0,t.jsxs)(s.SlotFillProvider,{children:[e.modal,(0,t.jsx)(s.Popover.Slot,{})]});return class{area=null;constructor(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>this.initialize())):this.initialize()}initialize(){const e=document.getElementById("wp-modal-area");e?this.area=e:console.warn("Modal area element not found")}openModal(e){this.area?a((0,t.jsx)(n,{modal:e}),this.area):setTimeout((()=>this.openModal(e)),100)}closeModal(s){this.area&&(a((0,t.jsx)(t.Fragment,{}),this.area),s&&e.post(ajaxurl,{action:o.actionModalDismiss,id:s}))}}}(a,n);var c=window.theblockModal||{};window.theblockModal=c,c.modals=new class extends d{constructor(){super(),n.isJustActivated&&this.openOnboardingModal()}openOnboardingModal(){const e=(0,t.jsx)(i,{onRequestClose:this.closeModal.bind(this,"onboarding"),status:n.trackingStatus});this.openModal(e)}openUpgradeModal(){const e=(0,t.jsx)(l,{onRequestClose:this.closeModal.bind(this,"upgrade")});this.openModal(e)}}}(jQuery,_theblockModalSettings)})();