"use strict";(self.webpackChunknewfold_Onboarding=self.webpackChunknewfold_Onboarding||[]).push([[426],{426:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(1609),s=a(3988),r=a(8468),o=a(7143),i=a(7675),c=a(8969),l=a(7044),d=a(7517),g=a(6087),p=a(7708),m=a(1032);const u=()=>{const[e,t]=(0,r.useState)(!1),[a,u]=(0,r.useState)(!1),{setIsHeaderEnabled:h,setHeaderActiveView:y,setDrawerActiveView:f,setHideFooterNav:b,setCurrentOnboardingData:v,setIsHeaderNavigationEnabled:w}=(0,o.useDispatch)(i.M),{currentData:E,themeStatus:k}=(0,o.useSelect)((e=>({currentData:e(i.M).getCurrentOnboardingData(),themeStatus:e(i.M).getThemeStatus()})));return(0,r.useEffect)((()=>{c.Er===k&&(h(!0),y(c.Ix),f(!1),(async()=>{b(!0),h(!0),y(c.Ix),f(!1),w(!1);const e=E.sitegen.homepages.active;t(e);const a=await(0,d.w6)();u(a.body)})(),(async()=>{!1===E?.sitegen?.sitemapPagesGenerated&&((await(0,p.rZ)(E.sitegen.siteDetails.prompt)).error||(E.sitegen.sitemapPagesGenerated=!0,v(E)))})())}),[k]),(0,r.useEffect)((()=>{E?.sitegen?.homepages?.active&&t(E.sitegen.homepages.active)}),[E]),(0,n.createElement)(m.UX,{render:!1},(0,n.createElement)(s.A,{isCentered:!0,className:"nfd-onboarding-step--site-gen__editor"},(0,n.createElement)("div",{className:"nfd-onboarding-step--site-gen__editor__live-preview"},(()=>{if(!e||!a)return(0,n.createElement)(n.Fragment,null);let t=(0,g.cloneDeep)(a[0]);t.settings.color.palette=e.color.palette,e?.styles?.blocks?.length>0&&(t=(t=>{const a=e.styles.blocks[0];return a["core/heading"]&&(t.styles.blocks["core/heading"].typography.fontFamily=a["core/heading"].typography.fontFamily),a["core/body"]&&(t.styles.typography.fontFamily=a["core/body"].typography.fontFamily),t})(t));let s="";return["header","content","footer"].forEach((t=>{t in e&&(s+=e[t])})),(0,n.createElement)(l.pA,{blockGrammer:s,styling:"custom",previewSettings:t,viewportWidth:1300,skeletonLoadingTime:0})})()),(0,n.createElement)("div",{className:"nfd-onboarding-screenshot-container"})))}}}]);