"use strict";(globalThis.webpackChunknewfold_Onboarding=globalThis.webpackChunknewfold_Onboarding||[]).push([[426],{426:(e,t,a)=>{a.r(t),a.d(t,{default:()=>h});var n=a(1609),s=a(3988),r=a(8468),o=a(7143),i=a(7675),c=a(8969),l=a(7044),g=a(7517),d=a(6087),p=a(7708),m=a(1032);const h=()=>{const[e,t]=(0,r.useState)(!1),[a,h]=(0,r.useState)(!1),{setIsHeaderEnabled:u,setHeaderActiveView:y,setDrawerActiveView:b,setHideFooterNav:f,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&&(u(!0),y(c.Ix),b(!1),(async()=>{f(!0),u(!0),y(c.Ix),b(!1),w(!1);const e=E.sitegen.homepages.active;t(e);const a=await(0,g.w6)();h(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,d.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"})))}}}]);