"use strict";(globalThis.webpackChunknewfold_Onboarding=globalThis.webpackChunknewfold_Onboarding||[]).push([[560],{9964:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(1609),r=a(6942),s=a.n(r);const i=({className:e="",size:t,colGap:a=0,children:r})=>(0,n.createElement)("div",{className:s()("nfd-onboarding-grid",e),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,gridColumnGap:`${a}px`}},r)},560:(e,t,a)=>{a.r(t),a.d(t,{default:()=>b});var n=a(1609),r=a(148),s=a(8468),i=a(7143),o=a(8520),c=a(7675),l=a(3988),u=a(8969),m=a(4639),d=a(1032),p=a(7044),g=a(1056),h=a(7723);var w=a(2202),_=a(9964);const b=()=>{const e=(0,r.zy)(),[t,a]=(0,s.useState)(),[b,v]=(0,s.useState)([]),[f,E]=(0,s.useState)(0),{currentStep:S,currentData:k,themeStatus:y,themeVariations:C}=(0,i.useSelect)((t=>({currentStep:t(c.M).getStepFromPath(e.pathname),currentData:t(c.M).getCurrentOnboardingData(),themeStatus:t(c.M).getThemeStatus(),themeVariations:t(c.M).getStepPreviewData()})),[]),{setDrawerActiveView:P,setSidebarActiveView:D,setCurrentOnboardingData:N,updateThemeStatus:T}=(0,i.useDispatch)(c.M);(0,s.useEffect)((()=>{D(u.Qe),P(u.VG)}),[]),(0,s.useEffect)((()=>{y===u.Er&&async function(){const e=await(0,o.O)(S?.data?.patternId);if(e?.error)return T(u.So);a(function(e){const t=[];return e.forEach((e=>{t.push(e.content),b.push(e.slug)})),v(b),t}(e?.body)),""!==k?.data.sitePages.homepage?E(b?.indexOf(k?.data.sitePages.homepage)):(k.data.sitePages={...k.data.sitePages,homepage:b[0]},N(k))}()}),[y]);const A={heading:(0,h.__)("There’s no place like a great home page","wp-module-onboarding"),subheading:(0,h.__)("Pick a starter layout you can refine and remix with your content","wp-module-onboarding")};return(0,n.createElement)(d.UX,null,(0,n.createElement)(p.Th,null,(0,n.createElement)(l.A,null,(0,n.createElement)("div",{className:"homepage_preview"},(0,n.createElement)(m.A,{title:A.heading,subtitle:A.subheading}),(0,n.createElement)("div",{className:"homepage_preview__list"},(0,n.createElement)(_.A,{size:3,colGap:50},(0,n.createElement)(p._Z,{watch:t,count:C[S?.data?.patternId]?.previewCount,callback:function(){return t?.map(((e,t)=>e?(0,n.createElement)(p.ph,{key:t,className:"homepage_preview__list__item",selected:t===f,blockGrammer:e,viewportWidth:1200,styling:"custom",overlay:!1,onClick:()=>function(e){E(e);const t=b[e];k.data.sitePages={...k.data.sitePages,homepage:t},N(k),(0,g.v)(new g.iC(w.DN,t))}(t)}):null))},className:"homepage_preview__list__item",viewportWidth:1200})))))))}}}]);