View file File name : 270.js Content :"use strict";(globalThis.webpackChunknewfold_Onboarding=globalThis.webpackChunknewfold_Onboarding||[]).push([[270],{1270:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var r=n(1609),a=n(7675),o=n(7143),i=n(8468),s=n(148),u=n(7723),l=n(3474);var d=n(6079),g=n(518),b=n(5677),c=n(8969),w=n(1032);const m=()=>{const{setIsDrawerSuppressed:e,setIsHeaderNavigationEnabled:t,setSidebarActiveView:n,updateThemeStatus:m,flushQueue:p}=(0,o.useDispatch)(a.M),f=(0,s.Zp)(),[S,h]=(0,i.useState)(!1),{nextStep:_,brandName:E,isQueueEmpty:y,currentData:N}=(0,o.useSelect)((e=>({nextStep:e(a.M).getNextStep(),brandName:e(a.M).getNewfoldBrandName(),isQueueEmpty:e(a.M).isQueueEmpty(),currentData:e(a.M).getCurrentOnboardingData()})),[]),k=(e=>({loader:{title:(0,u.sprintf)(/* translators: 1: Brand 2: site or store */ /* translators: 1: Brand 2: site or store */ (0,u.__)("Hang tight, we’re building your %1$s %2$s","wp-module-onboarding"),e,(0,l.P)("site")),subtitle:(0,u.__)("We’re assembling your unique design and installing useful tools","wp-module-onboarding")},errorState:{title:(0,u.sprintf)(/* translators: 1: Brand 2: site or store */ /* translators: 1: Brand 2: site or store */ (0,u.__)("Hang tight, we’re building your %1$s %2$s","wp-module-onboarding"),e,(0,l.P)("site")),subtitle:(0,u.__)("We’re assembling your unique design and installing useful tools","wp-module-onboarding"),error:(0,u.__)("Uh-oh, something went wrong. Please contact support.","wp-module-onboarding")}}))(E);async function v(){const e=await(0,d.IS)();return!e?.error}const D=()=>{t(!1),e(!0),n(!1)};return(0,i.useEffect)((()=>{y?(async()=>{!0===N?.data?.comingSoon&&window.NewfoldRuntime?.comingSoon&&await window.NewfoldRuntime.comingSoon.enable(),await Promise.all([v()]).then((e=>e.forEach((e=>{if(!e)return t(!0),h(!0)})))),f(_.path),m(c.So)})():p()}),[y]),(0,i.useEffect)((()=>{D()}),[]),(0,r.createElement)(w.UX,{navigationStateCallback:D,refresh:!1},S?(0,r.createElement)(b.W,{title:k.errorState.title,subtitle:k.errorState.subtitle,error:k.errorState.error}):(0,r.createElement)(g.S,{title:k.loader.title,subtitle:k.loader.subtitle}))}}}]);