View file File name : 287.js Content :"use strict";(globalThis.webpackChunknewfold_Onboarding=globalThis.webpackChunknewfold_Onboarding||[]).push([[287],{5287:(e,t,a)=>{a.r(t),a.d(t,{default:()=>E});var n=a(1609),s=a(7143),i=a(8468),r=a(7723);var l=a(1056),o=a(3988),d=a(6942),c=a.n(d);const _=(0,i.memo)((({idx:e,title:t,desc:a,isSelected:s,callback:i})=>(0,n.createElement)("div",{key:e,role:"button",tabIndex:0,className:"nfd__option_heading_subheading",onClick:()=>{i&&"function"==typeof i&&i(e+1)},onKeyDown:()=>{i&&"function"==typeof i&&i(e+1)}},(0,n.createElement)("div",{className:c()("nfd__option_heading_subheading__wrapper",s&&"nfd__option_heading_subheading__wrapper--selected")},(0,n.createElement)("div",{className:"nfd__option_heading_subheading__left"},(0,n.createElement)("div",{className:"nfd__option_heading_subheading__left_top"},t),(0,n.createElement)("div",{className:"nfd__option_heading_subheading__left_bottom"},a)))))),g=(0,i.memo)((({title:e,options:t,selection:a,callback:s})=>(0,n.createElement)("div",{className:"nfd-sg-card"},(0,n.createElement)("div",{className:"nfd-sg-card__title"},e),(0,n.createElement)("div",{className:"nfd-sg-card__data"},t.map(((e,t)=>(0,n.createElement)(_,{key:t,idx:t,title:e.title,desc:e.desc,isSelected:e.key===a,callback:s})))))));var u=a(148),m=a(7675);const p=(0,i.memo)((({customNavPercentage:e,watcher:t=null})=>{let a=0;const l={title:(0,r.__)("Building Website","wp-module-onboarding"),status:[{title:(0,r.__)("Generating Website","wp-module-onboarding")},{title:(0,r.__)("Finding Font Pairings","wp-module-onboarding")},{title:(0,r.__)("Building Custom Color Palettes","wp-module-onboarding")},{title:(0,r.__)("Populating Images","wp-module-onboarding")},{title:(0,r.__)("Finalizing Previews","wp-module-onboarding")},{title:(0,r.__)("Packaging Website","wp-module-onboarding")}]},o=(0,u.Zp)(),[d,c]=(0,i.useState)(0),[_,g]=(0,i.useState)(l.status[a].title),{currentData:p,nextStep:b,isGeneratingHomepages:f}=(0,s.useSelect)((e=>({currentData:e(m.M).getCurrentOnboardingData(),nextStep:e(m.M).getNextStep(),isGeneratingHomepages:e(m.M).isGeneratingHomepages()})));return(0,i.useEffect)((()=>{const e=setInterval((()=>{a+=1,a===l.status.length&&(a=0),g(l.status[a].title)}),3e3);return()=>{clearInterval(e)}}),[]),(0,i.useEffect)((()=>{c(p?.sitegen?.siteGenMetaStatus?.currentStatus/p?.sitegen?.siteGenMetaStatus?.totalCount*100)}),[p?.sitegen?.siteGenMetaStatus?.currentStatus]),(0,i.useEffect)((()=>{if(d===e&&!f&&b){if(null!==t&&!1===t)return;o(b.path)}}),[d,t,f]),(0,n.createElement)("div",{className:"nfd-sg-loader"},(0,n.createElement)("div",{className:"nfd-sg-loader__title"},l.title),(0,n.createElement)("div",{className:"nfd-sg-loader__progress"},(0,n.createElement)("div",{className:"nfd-sg-loader__progress_bars"},(0,n.createElement)("div",{className:"nfd-sg-loader__progress_bars_bg"}),(0,n.createElement)("div",{className:"nfd-sg-loader__progress_bars_bar",style:{width:`${d}%`}}))),(0,n.createElement)("div",{className:"nfd-sg-loader__status"},`${_}...`))}));var b=a(1032),f=a(8969),v=a(2202),w=a(8744);const E=()=>{const[e,t]=(0,i.useState)(0),{currentData:a,siteGenErrorStatus:d}=(0,s.useSelect)((e=>({currentData:e(m.M).getCurrentOnboardingData(),siteGenErrorStatus:e(m.M).getSiteGenErrorStatus()}))),{setIsHeaderEnabled:c,setSidebarActiveView:_,setHeaderActiveView:u,setDrawerActiveView:E,setHideFooterNav:h,setCurrentOnboardingData:N,setIsHeaderNavigationEnabled:S}=(0,s.useDispatch)(m.M);(0,i.useEffect)((()=>{h(!0),c(!0),_(!1),S(!1),u(f.Ix),E(!1)}),[]),(0,i.useEffect)((()=>{!0!==d&&a.sitegen.experience?.level&&t(a.sitegen.experience.level)}),[d]);const k={heading:(0,r.__)("How familiar are you with using WordPress?","wp-module-onboarding"),options:[{key:1,title:(0,r.__)("Beginner","wp-module-onboarding"),desc:(0,r.__)("First time building a website using WordPress","wp-module-onboarding")},{key:2,title:(0,r.__)("Intermediate","wp-module-onboarding"),desc:(0,r.__)("I’ve built a few sites for myself or others","wp-module-onboarding")},{key:3,title:(0,r.__)("Expert","wp-module-onboarding"),desc:(0,r.__)("I do this frequently","wp-module-onboarding")}]};return(0,n.createElement)(b.tR,null,(0,n.createElement)(o.A,{isCentered:!0},(0,n.createElement)("div",{className:"nfd-sg-experience-level"},(0,n.createElement)(p,{watcher:0!==e,customNavPercentage:100}),(0,n.createElement)(g,{title:k.heading,options:k.options,selection:e,callback:e=>{t(e),a.sitegen.experience.level=e,N(a);let n=!1;switch(e){case 1:n="novice";break;case 2:n="intermediate";break;case 3:n="expert"}n&&(0,l.v)(new l.iC(v.k2,n,{source:w.d0}))}}))))}}}]);