"use strict";(self.webpackChunknewfold_Onboarding=self.webpackChunknewfold_Onboarding||[]).push([[705],{6999:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(1609),s=n(6942),i=n.n(s),l=n(148),r=n(7143),o=n(6427),c=n(7677),d=n(6655),u=n(7675);const m=({text:e,className:t,callback:n=null,disabled:s=!1,showChevronRight:m=!0})=>{const g=(0,l.Zp)(),{nextStep:h}=(0,r.useSelect)((e=>({nextStep:e(u.M).getNextStep()})));return(0,a.createElement)(o.Button,{className:i()("nfd-onboarding-button--site-gen-next",{"nfd-onboarding-button--site-gen-next--disabled":s},t),onClick:()=>{s||(n&&"function"==typeof n&&n(),h&&g(h.path))}},(0,a.createElement)("p",{className:"nfd-onboarding-button--site-gen-next--text"},e),m&&(0,a.createElement)(c.A,{className:"nfd-onboarding-button--site-gen-next--icon",icon:d.A}))}},513:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(1609),s=n(8468),i=n(7673);const l=(0,s.memo)((({title:e})=>(0,a.createElement)("div",{className:"ai-heading"},(0,a.createElement)(i.A,{height:"40px"}),(0,a.createElement)("div",{className:"ai-heading--title"},e))))},8705:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var a=n(1609),s=n(9491),i=n(7143),l=n(8468),r=n(1056),o=n(7723);var c=n(431),d=n(513),u=n(3988);const m=(0,l.memo)((({hint:e,height:t,children:n,placeholder:s,customerInput:i,setCustomerInput:r,setCustomerInputStrength:o,customChildren:c=!1})=>{const d=(0,l.useRef)(null),[u,m]=(0,l.useState)("nfd-sg-input-box__field");(0,l.useEffect)((()=>{d.current.style.height=t;const e=d.current.scrollHeight;d.current.style.height=e+"px";const n=g(i?.trim());o(n)}),[i]);const g=e=>{const t=e?.length;let n=0;return t>200?n=3:t>150?n=2:t>100&&(n=1),n};return(0,a.createElement)("div",{className:"nfd-sg-input"},(0,a.createElement)("label",{htmlFor:u},(0,a.createElement)("div",{className:"nfd-sg-input-box"},(0,a.createElement)("textarea",{"data-wnd-ai-logo":!0,type:"text",className:u,ref:d,style:{height:"47px"},placeholder:s,value:i,onChange:e=>(e=>{e.preventDefault(),r(e.target.value),m("nfd-sg-input-box__field")})(e)})),(0,a.createElement)("div",{className:"nfd-sg-input-box_bottom"},(0,a.createElement)("p",{className:"nfd-sg-input-box__hint"},e),c&&n)))}));var g=n(6999),h=n(1032),p=n(8969),f=n(7675),b=n(2202),v=n(8744);const w=()=>{const[e,t]=(0,l.useState)(""),[n,w]=(0,l.useState)(0),[x,E]=(0,l.useState)(!1),{currentData:N}=(0,i.useSelect)((e=>({currentData:e(f.M).getCurrentOnboardingData()}))),{setIsFooterNavAllowed:_,setIsHeaderEnabled:C,setSidebarActiveView:D,setHeaderActiveView:A,setDrawerActiveView:k,setHideFooterNav:I,setCurrentOnboardingData:S,setIsHeaderNavigationEnabled:y}=(0,i.useDispatch)(f.M),H=(0,s.useViewportMatch)("small");(0,l.useEffect)((()=>{if(I(!1),C(!0),D(!1),A(p.Ix),y(!0),k(!1),""!==N.sitegen.siteDetails?.prompt)return N.sitegen.siteDetails?.prompt.length<N.sitegen.siteDetails?.minCharLimit?(E(!1),_(!1),N.sitegen.siteDetails.prompt="",S(N)):(E(!0),_(!0)),t(N.sitegen.siteDetails.prompt);_(!1)}),[]),(0,l.useEffect)((()=>{if(void 0!==e){const t=e.trim();""!==t?(t!==N.sitegen.siteDetails.prompt&&(N.sitegen.siteDetails.prompt=t,N.sitegen.siteDetails.mode="simple",N.sitegen.skipCache=!0,N.sitegen.sitemapPagesGenerated=!1,N.sitegen.homepages.active={},N.sitegen.homepages.data={},S(N)),E(!0),_(!0)):(E(!1),_(!1))}}),[e]);const T={heading:(0,o.__)("Tell me some details about the site you want created?","wp-module-onboarding"),inputPlaceholder:(0,o.__)("Bean There Café - A cozy, sustainable coffee shop in Asheville, North Carolina, focused on fair-trade coffee and local pastries. Their site will feature their menu, special events, and a blog on coffee culture.","wp-module-onboarding"),inputHint:(0,o.__)("The more detail the better","wp-module-onboarding"),buttonText:(0,o.__)("Next","wp-module-onboarding"),walkThroughText:(0,o.__)("Not sure what to say? We can walk you through it.","wp-module-onboarding"),walkThroughlink:(0,o.__)("click here","wp-module-onboarding")};return(0,a.createElement)(h.tR,null,(0,a.createElement)(u.A,{isCentered:!0},(0,a.createElement)(c.A,{type:"fade-in"},(0,a.createElement)("div",{className:"nfd-sg-site-details"},(0,a.createElement)(d.A,{title:T.heading}),(0,a.createElement)(m,{placeholder:T.inputPlaceholder,hint:T.inputHint,height:"40px",customerInput:e,setCustomerInput:t,setCustomerInputStrength:w,customChildren:!0},H&&(0,a.createElement)("div",{className:"nfd-sg-site-details-endrow"},(0,a.createElement)(g.A,{className:"nfd-sg-site-details--next-btn",callback:()=>{(()=>{let t=!1;switch(n){case 2:t="MEDIUM";break;case 3:t="HIGH"}t&&(0,r.v)(new r.iC(b.WN,e,{strength:t,source:v.d0}))})()},text:T.buttonText,disabled:!x})))))))}}}]);