"use strict";(self.webpackChunknewfold_Onboarding=self.webpackChunknewfold_Onboarding||[]).push([[127],{1127:(e,a,n)=>{n.r(a),n.d(a,{default:()=>k});var t=n(1609),r=n(8468),l=n(7723),s=n(6427),o=n(7143),d=n(7675);const i=()=>{const{currentUserInfo:e}=(0,o.useSelect)((e=>({currentUserInfo:e(d.M).getCurrentUserDetails()})),[]);return e?(0,t.createElement)("div",{className:"nfd-onboarding-header__admin-bar"},(0,t.createElement)("div",{className:"nfd-onboarding-header__admin-bar__wplogo"},(0,t.createElement)(s.Dashicon,{icon:"wordpress"}),(0,t.createElement)("span",null,(0,l.__)("WordPress","wp-module-onboarding"))),(0,t.createElement)("div",{className:"nfd-onboarding-header__admin-bar__profile"},(0,t.createElement)("span",{className:"nfd-onboarding-header__admin-bar__profile__greeting"},(0,t.createElement)("span",null,(0,l.__)("Howdy! ","wp-module-onboarding"),e.displayName)),(0,t.createElement)("div",{className:"nfd-onboarding-header__admin-bar__profile__avatar"},(0,t.createElement)("img",{src:e.avatarUrl,alt:e.displayName})))):null},c=({progress:e=20})=>(0,t.createElement)("div",{className:"nfd-onboarding-header__progress-bar"},(0,t.createElement)("div",{style:{width:`${e}%`},className:"nfd-onboarding-header__progress-bar__progress"}));var m=n(8969),u=n(9034),p=n(7677),g=n(1607),_=n(148),E=n(6942),b=n.n(E);const h=({children:e,onClick:a})=>(0,t.createElement)(s.Button,{onClick:()=>a(),className:b()("nfd-onboarding-button--dark")},e);var S=n(4487);const v=({path:e})=>{const{siteGenErrorStatus:a}=(0,o.useSelect)((e=>({siteGenErrorStatus:e(d.M).getSiteGenErrorStatus()}))),{updateSiteGenErrorStatus:n}=(0,o.useDispatch)(d.M),r=(0,_.Zp)();return(0,t.createElement)(h,{onClick:()=>{!0===a&&n(!1),r(e,{state:{origin:"header"}})},variant:"secondary"},(0,t.createElement)(p.A,{icon:g.A}),(0,l.__)("Back","wp-module-onboarding"))},f=()=>{const{previousStep:e,currentStep:a}=(0,o.useSelect)((e=>({previousStep:e(d.M).getPreviousStep(),currentStep:e(d.M).getCurrentStep()})),[]),n=null===e||!1===e,r=a?.path===S.b?.path;return(0,t.createElement)("div",{className:"nfd-onboarding-header--sitegen__step-navigation"},n||r?(0,t.createElement)(t.Fragment,null):(0,t.createElement)(v,{path:e.path}))};var N=n(6087),w=n(3731);const k=(0,r.memo)((()=>{const{isHeaderNavigationEnabled:e,currentStep:a,allSteps:n}=(0,o.useSelect)((e=>({currentStep:e(d.M).getCurrentStep(),isHeaderNavigationEnabled:e(d.M).isHeaderNavigationEnabled(),allSteps:e(d.M).getAllSteps()}))),r=(0,N.findIndex)(n,{path:a?.path}),l=Math.abs((r-1)/(n.length-1)*100);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(s.Fill,{name:`${m.Ix}/${m.KK}`},(0,t.createElement)(t.Fragment,null,(0,t.createElement)(i,null),a!==u.O&&a!==w.O&&(0,t.createElement)(c,{progress:l}))),(0,t.createElement)(s.Fill,{name:`${m.Ix}/${m.nK}`},(0,t.createElement)(t.Fragment,null,e&&(0,t.createElement)(f,null))),a?.header&&(0,t.createElement)(a.header,null))}))}}]);