(()=>{"use strict";var e={n:n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return e.d(t,{a:t}),t},d:(n,t)=>{for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n);var t={};e.r(t),e.d(t,{setIsModalOpen:()=>a});var o={};e.r(o),e.d(o,{isModalOpen:()=>c});const i=window.React,l=window.wp.domReady;var s=e.n(l);const d=window.wp.element,r=window.wp.data;function a(e){return{type:"SET_MODAL_OPEN",isOpen:e}}function c(e){return e.modal.isOpen}const u={reducer:(0,r.combineReducers)({modal:function(e={isOpen:!1},n){return"SET_MODAL_OPEN"===n.type?{...e,isOpen:n.isOpen}:e}}),actions:t,selectors:o},p=(0,r.createReduxStore)("newfold/coming-soon",u);(0,r.register)(p);const w=window.wp.components,m=window.wp.i18n,f=()=>{const{setIsModalOpen:e}=(0,r.useDispatch)(p),{isModalOpen:n}=(0,r.useSelect)((e=>({isModalOpen:e(p).isModalOpen()})));if(!n||!window.NewfoldRuntime.comingSoon.isEnabled)return null;const t=(0,m.__)("Ready to launch your Site?","nfd-coming-soon"),o=(0,m.__)("Pages and posts you publish will not be visible to the public until you launch your site.","nfd-coming-soon"),l=(0,m.__)("Publish & Launch Site","nfd-coming-soon"),s=(0,m.__)("Publish Without Launching","nfd-coming-soon");return(0,i.createElement)(w.Modal,{title:t,onRequestClose:()=>e(!1)},(0,i.createElement)("div",null,(0,i.createElement)("p",null,o),(0,i.createElement)("br",null),(0,i.createElement)("div",{style:{alignContent:"space-between",display:"flex",flexWrap:"wrap",gap:"16px",boxSizing:"inherit"}},(0,i.createElement)(w.Button,{variant:"primary",onClick:()=>{window.NewfoldRuntime.comingSoon.disable(),e(!1)},style:{flex:1,justifyContent:"center"}},l),(0,i.createElement)(w.Button,{variant:"link",onClick:()=>e(!1),style:{flex:1,justifyContent:"center"}},s))))};s()((()=>{b("nfd-pre-publish-modal")}));const b=e=>{const n=document.createElement("div");n.id=e,document.getElementById(e)||document.body.append(n),(0,d.render)((0,i.createElement)(f,null),n)},y=()=>{const e=window.wp.data.select("core/editor").getEditedPostAttribute("status");void 0!==e?(e=>{if("publish"!==e){const e=(0,r.subscribe)((()=>{if("publish"===window.wp.data.select("core/editor").getEditedPostAttribute("status")){e();const n=()=>{document.querySelector(".components-snackbar-list__notice-container")?(0,r.dispatch)(p).setIsModalOpen(!0):setTimeout(n,50)};n()}}))}})(e):setTimeout(y,50)};y(),((window.newfold=window.newfold||{}).ComingSoon=window.newfold.ComingSoon||{})["coming-soon"]=n})();