"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[925],{37557:(e,t,o)=>{o.d(t,{U:()=>u});var r=o(74776);const n="I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.";let i="I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.";const a=window.wcSettings,s=a?.admin,l=parseFloat(a?.wpVersion),c=parseFloat(s?.gutenberg_version);!isNaN(l)&&l>=6.4&&(i=n),!isNaN(c)&&c>=16.9&&(i=n);const{lock:M,unlock:u}=(0,r.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(i,"@wordpress/edit-site")},51975:(e,t,o)=>{o.r(t),o.d(t,{CustomizeStoreController:()=>zr,customizeStoreStateMachineActions:()=>Er,customizeStoreStateMachineDefinition:()=>jr,customizeStoreStateMachineServices:()=>Tr,default:()=>wr,machineActions:()=>Dr});var r={};o.r(r),o.d(r,{assignActiveThemeHasMods:()=>R,assignCurrentThemeIsAiGenerated:()=>H,assignCustomizeStoreCompleted:()=>Z,assignFetchIntroDataError:()=>W,assignThemeData:()=>Y,recordTracksBrowseAllThemesClicked:()=>G,recordTracksDesignWithAIClicked:()=>P,recordTracksThemeSelected:()=>B});var n={};o.r(n),o.d(n,{fetchIntroData:()=>K,fetchThemeCards:()=>X});var i={};o.r(i),o.d(i,{assignHasCompleteSurvey:()=>lr,completeSurvey:()=>cr});var a={};o.r(a),o.d(a,{fetchSurveyCompletedOption:()=>Mr});var s=o(69307),l=o(37798),c=o(11122),M=o(28226),u=o(50883),g=o(10431),m=o(67221),d=o(9818),y=o(86020),N=o(74617),p=o(98817),I=o(34374),D=o(65736),E=o(70048),T=o(55609),j=o(5267),z=o(83849),w=o.n(z),k=o(94333),h=o(22629),f=o(40800);const A=(0,s.forwardRef)(((e,t)=>{let{isTransparent:o,...r}=e;const{siteTitle:n}=(0,d.useSelect)((e=>{var t;const{getSite:o}=e(l.store);return{siteTitle:null===(t=o())||void 0===t?void 0:t.title}}),[]),i=(0,k.useReducedMotion)();return(0,s.createElement)(T.__unstableMotion.div,(0,j.Z)({ref:t},r,{className:w()("edit-site-site-hub",r.className),initial:!1,transition:{type:"tween",duration:i?0:.3,ease:"easeOut"}}),(0,s.createElement)(T.__experimentalHStack,{justify:"space-between",alignment:"center",className:"edit-site-site-hub__container"},(0,s.createElement)(T.__experimentalHStack,{justify:"flex-start",className:"edit-site-site-hub__text-content",spacing:"0"},(0,s.createElement)(T.__unstableMotion.div,{className:w()("edit-site-site-hub__view-mode-toggle-container",{"has-transparent-background":o}),layout:!0,transition:{type:"tween",duration:i?0:.3,ease:"easeOut"}},(0,s.createElement)(y.Link,{href:(0,g.getNewPath)({},"/",{}),type:"wp-admin"},(0,s.createElement)(f.Z,{className:"edit-site-layout__view-mode-toggle-icon"}))),(0,s.createElement)(T.__unstableAnimatePresence,null,(0,s.createElement)(T.__unstableMotion.div,{layout:!1,animate:{opacity:1},exit:{opacity:0},className:w()("edit-site-site-hub__site-title",{"is-transparent":o}),transition:{type:"tween",duration:i?0:.2,ease:"easeOut",delay:.1}},(0,h.decodeEntities)(n))))))})),x=e=>{let{colorPalettes:t,totalPalettes:o}=e,r=null;return o>4&&(r=(0,s.createElement)("li",{className:"more_palettes"},"+",o-4)),(0,s.createElement)("ul",{className:"theme-card__color-palettes"},t.map((e=>(0,s.createElement)("li",{key:e.title,style:{background:"linear-gradient(to right, "+e.primary+" 0px, "+e.primary+" 50%, "+e.secondary+" 50%, "+e.secondary+" 100%)"}}))),r)},_=e=>{let{slug:t,description:o,thumbnail_url:r,name:n,color_palettes:i=[],total_palettes:a=0,link_url:l="",is_active:c=!1,onClick:M}=e;return(0,s.createElement)("div",{className:"theme-card",key:t},(0,s.createElement)("div",null,l?(0,s.createElement)(y.Link,{href:l,onClick:M},(0,s.createElement)("img",{src:r,alt:o})):(0,s.createElement)("img",{src:r,alt:o})),(0,s.createElement)("div",{className:"theme-card__info"},(0,s.createElement)("h2",{className:"theme-card__title"},n),i&&(0,s.createElement)(x,{colorPalettes:i,totalPalettes:a})),(0,s.createElement)("div",null,c&&(0,s.createElement)("span",{className:"theme-card__active"},(0,D.__)("Active theme","woocommerce")),(0,s.createElement)("span",{className:"theme-card__free"},"Free")))};var L=o(14599),O=o(73463),S=o(75283);const b=e=>{let{siteUrl:t}=e;return(0,s.createElement)("iframe",{className:"preview-iframe",src:t,title:"Preview",tabIndex:-1})},v=["image"];function C(e,t){!function(e){return e.document!==e.parent.document}(e)?e.location.href=t:e.parent.postMessage({type:"navigate",url:t},"*")}const Q=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60;const o=//g;return e.replaceAll(o,((e,o)=>{if(o){const e=JSON.parse(o);return e.width=t,`\x3c!-- wp:site-logo ${JSON.stringify(e)} /--\x3e`}return`\x3c!-- wp:site-logo {"width":${t}} /--\x3e`}))},U=e=>{let{bannerTitle:t,bannerText:o,bannerClass:r,buttonIsLink:n,bannerButtonOnClick:i,bannerButtonText:a,secondaryButton:l,children:c}=e;return(0,s.createElement)("div",{className:w()("woocommerce-customize-store-banner",r)},(0,s.createElement)("div",{className:"woocommerce-customize-store-banner-content"},(0,s.createElement)("div",{className:"banner-actions"},(0,s.createElement)("h1",null,t),(0,s.createElement)("p",null,o),a&&(0,s.createElement)(T.Button,{onClick:()=>i&&i(),variant:n?"link":"primary"},a),l,(0,s.createElement)("p",{className:"ai-disclaimer"},(0,S.Z)({mixedString:(0,D.__)("Powered by experimental AI. {{link}}Learn more{{/link}}","woocommerce"),components:{link:(0,s.createElement)(y.Link,{href:"https://automattic.com/ai-guidelines",target:"_blank",type:"external"})}}))),c))};var F=o(5031);const Y=(0,F.f0)({intro:(e,t)=>{const o=t.data.themeData;return{...e.intro,themeData:o}}}),P=()=>{(0,L.recordEvent)("customize_your_store_intro_design_with_ai_click")},B=(e,t)=>{(0,L.recordEvent)("customize_your_store_intro_theme_select",{theme:t.payload.theme,is_active:"SELECTED_ACTIVE_THEME"===t.type?"yes":"no"})},G=()=>{(0,L.recordEvent)("customize_your_store_intro_browse_all_themes_click")},R=(0,F.f0)({intro:(e,t)=>{const o=t.data.activeThemeHasMods;return{...e.intro,activeThemeHasMods:o}}}),Z=(0,F.f0)({intro:(e,t)=>{const o=t.data.customizeStoreTaskCompleted;return{...e.intro,customizeStoreTaskCompleted:o}}}),W=(0,F.f0)({intro:e=>({...e.intro,hasErrors:!0})}),H=(0,F.f0)({intro:(e,t)=>{const o=t.data.currentThemeIsAiGenerated;return{...e.intro,currentThemeIsAiGenerated:o}}});var V=o(86989),J=o.n(V);const X=async()=>await J()({path:"/wc-admin/onboarding/themes/recommended",method:"GET"}),K=async()=>{const e=(0,d.resolveSelect)(l.store).__experimentalGetTemplateForLink("/"),t=(0,d.resolveSelect)(m.OPTIONS_STORE_NAME).getOption("woocommerce_admin_customize_store_completed_theme_id"),o=(0,d.resolveSelect)(l.store).getCurrentThemeGlobalStylesRevisions(),r=(0,d.resolveSelect)(l.store).getEntityRecords("postType","page",{per_page:100,_fields:["id","_links.version-history"],orderby:"menu_order",order:"asc"}),n=(0,d.resolveSelect)(m.ONBOARDING_STORE_NAME).getTask("customize-store"),i=X(),[a,s,c,M,u,g]=await Promise.all([e,t,o,r,n,i]);let y=!1;s&&(null==a?void 0:a.id)===s&&(y=!0);const N=null==M?void 0:M.some((e=>{var t,o;return(null===(t=e._links)||void 0===t||null===(o=t["version-history"])||void 0===o?void 0:o.length)>1}));return{activeThemeHasMods:!(null==a||!a.modified)||(null==c?void 0:c.length)>0||N,customizeStoreTaskCompleted:null==u?void 0:u.isComplete,themeData:g,currentThemeIsAiGenerated:y}},q={"network-offline":()=>(0,s.createElement)(U,{bannerTitle:(0,D.__)("Looking to design your store using AI?","woocommerce"),bannerText:(0,D.__)("Unfortunately, the [AI Store designer] isn't available right now as we can't detect your network. Please check your internet connection.","woocommerce"),bannerClass:"offline-banner",bannerButtonOnClick:()=>{}}),"task-incomplete-active-theme-has-mods":e=>{let{setOpenDesignChangeWarningModal:t}=e;return(0,s.createElement)(U,{bannerTitle:(0,D.__)("Use the power of AI to design your store","woocommerce"),bannerText:(0,D.__)("Design the look of your store, create pages, and generate copy using our built-in AI tools.","woocommerce"),bannerClass:"",buttonIsLink:!1,bannerButtonOnClick:()=>{t(!0)},bannerButtonText:(0,D.__)("Design with AI","woocommerce")})},"jetpack-offline":e=>{let{sendEvent:t}=e;return(0,s.createElement)(U,{bannerTitle:(0,D.__)("Looking to design your store using AI?","woocommerce"),bannerText:(0,D.__)("It looks like you're using Jetpack's offline mode — switch to online mode to start designing with AI.","woocommerce"),bannerClass:"offline-banner",buttonIsLink:!1,bannerButtonOnClick:()=>{t({type:"JETPACK_OFFLINE_HOWTO"})},bannerButtonText:(0,D.__)("Find out how","woocommerce")})},"existing-ai-theme":e=>{let{setOpenDesignChangeWarningModal:t}=e;const o=(0,s.createElement)(T.Button,{className:"",onClick:()=>{(0,L.recordEvent)("customize_your_store_intro_create_a_new_one_click"),t(!0)},variant:"secondary"},(0,D.__)("Create a new one","woocommerce")),r=(0,O.O3)("siteUrl")+"?cys-hide-admin-bar=1";return(0,s.createElement)(U,{bannerTitle:(0,D.__)("Customize your custom theme","woocommerce"),bannerText:(0,D.__)("Keep customizing the look of your AI-generated store, or start over and create a new one.","woocommerce"),bannerClass:"existing-ai-theme-banner",buttonIsLink:!1,bannerButtonOnClick:()=>{(0,L.recordEvent)("customize_your_store_intro_customize_click"),C(window,(0,g.getNewPath)({},"/customize-store/assembler-hub",{}))},bannerButtonText:(0,D.__)("Customize","woocommerce"),secondaryButton:o},(0,s.createElement)("div",{className:"woocommerce-block-preview-container"},(0,s.createElement)("div",{className:"iframe-container"},(0,s.createElement)(b,{siteUrl:r}))))},"existing-theme":e=>{let{setOpenDesignChangeWarningModal:t}=e;return(0,s.createElement)(U,{bannerTitle:(0,D.__)("Use the power of AI to design your store","woocommerce"),bannerText:(0,D.__)("Design the look of your store, create pages, and generate copy using our built-in AI tools.","woocommerce"),bannerClass:"",buttonIsLink:!1,bannerButtonOnClick:()=>{t(!0)},bannerButtonText:(0,D.__)("Design with AI","woocommerce")})},default:e=>{let{sendEvent:t}=e;return(0,s.createElement)(U,{bannerTitle:(0,D.__)("Use the power of AI to design your store","woocommerce"),bannerText:(0,D.__)("Design the look of your store, create pages, and generate copy using our built-in AI tools.","woocommerce"),bannerClass:"",buttonIsLink:!1,bannerButtonOnClick:()=>{t({type:"DESIGN_WITH_AI"})},bannerButtonText:(0,D.__)("Design with AI","woocommerce")})}},$={"no-modal":null,"task-incomplete-override-design-changes":e=>{let{setOpenDesignChangeWarningModal:t,sendEvent:o,classname:r="woocommerce-customize-store__design-change-warning-modal"}=e;return(0,s.createElement)(T.Modal,{className:r,title:(0,D.__)("Are you sure you want to start a new design?","woocommerce"),onRequestClose:()=>t(!1),shouldCloseOnClickOutside:!1},(0,s.createElement)("p",null,(0,s.createInterpolateElement)((0,D.__)("The Store Designer will create a new store design for you, and you'll lose any changes you've made to your active theme. If you'd prefer to continue editing your theme, you can do so via the Editor.","woocommerce"),{EditorLink:(0,s.createElement)(y.Link,{onClick:()=>(window.open(`${O.SX}site-editor.php`,"_blank"),!1),href:""})})),(0,s.createElement)("div",{className:"woocommerce-customize-store__design-change-warning-modal-footer"},(0,s.createElement)(T.Button,{onClick:()=>t(!1),variant:"link"},(0,D.__)("Cancel","woocommerce")),(0,s.createElement)(T.Button,{onClick:()=>o({type:"DESIGN_WITH_AI"}),variant:"primary"},(0,D.__)("Design with AI","woocommerce"))))},"task-complete-with-ai-theme":e=>{let{setOpenDesignChangeWarningModal:t,sendEvent:o,classname:r="woocommerce-customize-store__design-change-warning-modal"}=e;return(0,s.createElement)(T.Modal,{className:r,title:(0,D.__)("Are you sure you want to start over?","woocommerce"),onRequestClose:()=>t(!1),shouldCloseOnClickOutside:!1},(0,s.createElement)("p",null,(0,s.createInterpolateElement)((0,D.__)("You'll be asked to provide your business info again, and will lose your existing AI design. If you want to customize your existing design, you can do so via the Editor.","woocommerce"),{EditorLink:(0,s.createElement)(y.Link,{onClick:()=>(window.open(`${O.SX}site-editor.php`,"_blank"),!1),href:""})})),(0,s.createElement)("div",{className:"woocommerce-customize-store__design-change-warning-modal-footer"},(0,s.createElement)(T.Button,{onClick:()=>t(!1),variant:"link"},(0,D.__)("Cancel","woocommerce")),(0,s.createElement)(T.Button,{onClick:()=>{o({type:"DESIGN_WITH_AI"}),(0,L.recordEvent)("customize_your_store_intro_start_again_click")},variant:"primary"},(0,D.__)("Start again","woocommerce"))))},"task-complete-without-ai-theme":e=>{let{setOpenDesignChangeWarningModal:t,sendEvent:o,classname:r="woocommerce-customize-store__design-change-warning-modal"}=e;return(0,s.createElement)(T.Modal,{className:r,title:(0,D.__)("Are you sure you want to start a new design?","woocommerce"),onRequestClose:()=>t(!1),shouldCloseOnClickOutside:!1},(0,s.createElement)("p",null,(0,s.createInterpolateElement)((0,D.__)("The Store Designer will create a new store design for you, and you'll lose any changes you've made to your active theme. If you'd prefer to continue editing your theme, you can do so via the Editor.","woocommerce"),{EditorLink:(0,s.createElement)(y.Link,{onClick:()=>(window.open(`${O.SX}site-editor.php`,"_blank"),!1),href:""})})),(0,s.createElement)("div",{className:"woocommerce-customize-store__design-change-warning-modal-footer"},(0,s.createElement)(T.Button,{onClick:()=>t(!1),variant:"link"},(0,D.__)("Cancel","woocommerce")),(0,s.createElement)(T.Button,{onClick:()=>o({type:"DESIGN_WITH_AI"}),variant:"primary"},(0,D.__)("Design with AI","woocommerce"))))}},ee=e=>{let{onClick:t}=e;return(0,s.createElement)("div",null,(0,s.createElement)(T.Button,{className:"close-cys-design-with-ai",onClick:t||(()=>{})},(0,s.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)("path",{d:"M5.40456 5L19 19M5 19L18.5954 5",stroke:"#1E1E1E",strokeWidth:"1.5"}))))},te=e=>{let{className:t,selected:o,title:r,subtitle:n,name:i,value:a,onChange:l}=e;const c=()=>{l(a)},M="woocommerce-"+a.replace(/_/g,"-");return(0,s.createElement)("div",{role:"radio",className:w()("woocommerce-cys-choice-container",t),onClick:c,onKeyDown:e=>{"Enter"===e.key&&c()},"data-selected":o||null,tabIndex:0},(0,s.createElement)("div",{className:"woocommerce-cys-choice"},(0,s.createElement)("input",{className:"woocommerce-cys-choice-input",id:M,name:i,type:"radio",value:a,checked:!!o,onChange:c,"data-selected":o||null,tabIndex:-1}),(0,s.createElement)("label",{htmlFor:M,className:"choice__title"},r),n&&(0,s.createElement)("p",{className:"choice__subtitle"},n)))};var oe=o(72456),re=o(44305),ne=o(92728),ie=o(60516),ae=o(87842),se=o(5526),le=o(95058),ce=o(78406);const Me=[{title:(0,D.__)("Analyzing your responses","woocommerce"),image:(0,s.createElement)("img",{src:re,alt:(0,D.__)("Analyzing your responses","woocommerce")}),progress:14},{title:(0,D.__)("Comparing the top performing stores","woocommerce"),image:(0,s.createElement)("img",{src:ie,alt:(0,D.__)("Comparing the top performing stores","woocommerce")}),progress:28},{title:(0,D.__)("Designing the best look for your business","woocommerce"),image:(0,s.createElement)("img",{src:ne,alt:(0,D.__)("Designing the best look for your business","woocommerce")}),progress:42},{title:(0,D.__)("Generating content","woocommerce"),image:(0,s.createElement)("img",{src:le,alt:(0,D.__)("Generating content","woocommerce")}),progress:56},{title:(0,D.__)("Assembling your AI-optimized store","woocommerce"),image:(0,s.createElement)("img",{src:ae,alt:(0,D.__)("Assembling your AI-optimized store","woocommerce")}),progress:70},{title:(0,D.__)("Applying the finishing touches","woocommerce"),image:(0,s.createElement)("img",{src:se,alt:(0,D.__)("Applying the finishing touches","woocommerce")}),progress:84},{title:(0,D.__)("Opening the doors","woocommerce"),image:(0,s.createElement)("img",{src:ce,alt:(0,D.__)("Opening the doors","woocommerce")}),progress:100}],ue=e=>e.map(((e,t,o)=>{const r=o[t+1];if(!r)return[e];const n=[e],i=(r.progress-e.progress)/2;for(let t=0;t<2;t++)n.push({...e,progress:e.progress+(t+1)*i});return n})).flat();var ge=o(47090);const me=(0,F.f0)({startLoadingTime:()=>performance.now()}),de=(0,F.f0)({businessInfoDescription:(e,t)=>({descriptionText:t.payload})}),ye=(0,F.f0)({lookAndFeel:(e,t)=>({...e.lookAndFeel,choice:t.payload})}),Ne=(0,F.f0)({toneOfVoice:(e,t)=>({...e.toneOfVoice,choice:t.payload})}),pe=(0,F.f0)({lookAndFeel:(e,t)=>({choice:t.data.look,aiRecommended:t.data.look}),toneOfVoice:(e,t)=>({choice:t.data.tone,aiRecommended:t.data.tone})}),Ie=(0,F.f0)({aiSuggestions:(e,t)=>({...e.aiSuggestions,defaultColorPalette:t.data.response})}),De=(0,F.f0)({aiSuggestions:e=>{let t=e.aiSuggestions.fontPairing;const o=e.lookAndFeel.choice;switch(!0){case"Contemporary"===o:t="Inter + Inter";break;case"Classic"===o:t="Bodoni Moda + Overpass";break;case"Bold"===o:t="Plus Jakarta Sans + Plus Jakarta Sans"}return{...e.aiSuggestions,fontPairing:t}}}),Ee=(0,F.f0)({aiSuggestions:(e,t)=>({...e.aiSuggestions,header:t.data.response.slug})}),Te=(0,F.f0)({aiSuggestions:(e,t)=>({...e.aiSuggestions,footer:t.data.response.slug})}),je=(0,F.f0)({aiSuggestions:(e,t)=>({...e.aiSuggestions,homepageTemplate:t.data.response.homepage_template})}),ze=(0,F.f0)({spawnSaveDescriptionToOptionRef:e=>(0,ge.Cs)((()=>{return t=e.businessInfoDescription.descriptionText,(0,d.dispatch)(m.OPTIONS_STORE_NAME).updateOptions({woo_ai_describe_store_description:t});var t}),"update-woo-ai-business-description-option")}),we={assignStartLoadingTime:me,assignBusinessInfoDescription:de,assignLookAndFeel:ye,assignToneOfVoice:Ne,assignLookAndTone:pe,assignDefaultColorPalette:Ie,assignFontPairing:De,assignHeader:Ee,assignFooter:Te,assignHomepageTemplate:je,assignAPICallLoaderError:(0,F.f0)({apiCallLoader:()=>((0,L.recordEvent)("customize_your_store_ai_wizard_error"),{hasErrors:!0})}),logAIAPIRequestError:()=>{console.log("API Request error")},updateQueryStep:(e,t,o)=>{let{action:r}=o;const{path:n}=(0,g.getQuery)(),i=r.step,a=n.split("/");"customize-store"===a[1]&&"design-with-ai"===a[2]&&a[3]!==i&&(0,g.updateQueryString)({},`/customize-store/design-with-ai/${i}`)},recordTracksStepViewed:(e,t,o)=>{let{action:r}=o;const{step:n}=r;(0,L.recordEvent)("customize_your_store_ai_wizard_step_view",{step:n})},recordTracksStepClosed:(e,t)=>{const{step:o}=t.payload;(0,L.recordEvent)("customize_your_store_ai_wizard_step_close",{step:o.replaceAll("-","_")})},recordTracksStepCompleted:(e,t,o)=>{let{action:r}=o;const{step:n}=r;(0,L.recordEvent)("customize_your_store_ai_wizard_step_complete",{step:n})},spawnSaveDescriptionToOption:ze,redirectToAssemblerHub:async e=>{const t=(0,g.getNewPath)({},"/customize-store/assembler-hub",{}),o=document.createElement("iframe");o.classList.add("cys-fullscreen-iframe"),o.src=t;const r=()=>{if("1"===o.style.opacity)return;const t=document.getElementsByClassName("woocommerce-onboarding-loader");if(t[0]&&(t[0].style.display="none"),o.style.opacity="1",e.startLoadingTime){const t=performance.now()-e.startLoadingTime;(0,L.recordEvent)("customize_your_store_ai_wizard_loading_time",{time_in_s:(t/1e3).toFixed(2)})}};o.onload=()=>{var e,n;!function(e){var t;const o=e.contentWindow,r=e.contentDocument||(null===(t=e.contentWindow)||void 0===t?void 0:t.document);if(null!=o&&o.history){const e=o.history.pushState;o.history.pushState=function(t,o,r){const n=null==r?void 0:r.toString();n&&(-1===(null==n?void 0:n.indexOf("customize-store"))?window.location.href=n:(window.history.pushState(t,o,r),e(t,o,r)))}}null==o||o.addEventListener("popstate",(function(e){window.history.replaceState(e.state,"",o.location.href)})),null==r||r.addEventListener("click",(function(e){if(e.target){var t;const o=null===(t=e.target)||void 0===t?void 0:t.closest("a");o&&"_blank"===o.target?(e.preventDefault(),window.open(o.href,"_blank")):o&&(e.preventDefault(),window.location.href=o.href)}}))}(o),n=r,window.addEventListener("message",(e=>{"iframe-loaded"===e.data.type&&n()})),setTimeout(r,6e4),null===(e=window.history)||void 0===e||e.pushState({},"",t)},document.body.appendChild(o)}};var ke=o(25516);const he=(e,t,o)=>Object.assign(new Error(e),{code:t,cause:o}),fe=o.n(ke)()("jetpack-ai-assistant:token"),Ae="jetpack-ai-jwt-token";var xe=o(55954),_e=o(64567);const Le=[{title:"Inter + Inter",version:2,lookAndFeel:["Contemporary","Bold"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Inter",slug:"inter"}]}}},styles:{elements:{button:{typography:{fontFamily:"var(--wp--preset--font-family--inter)",fontWeight:"400",lineHeight:"1"}},heading:{typography:{fontFamily:"var(--wp--preset--font-family--inter)",fontStyle:"normal",fontWeight:"600",lineHeight:"1.2"}}},blocks:{"core/site-title":{typography:{fontFamily:"var(--wp--preset--font-family--inter)",fontSize:"var(--wp--preset--font-size--medium)",fontStyle:"normal"}},"core/post-navigation-link":{typography:{fontFamily:"var(--wp--preset--font-family--inter)"}}},typography:{fontFamily:"var(--wp--preset--font-family--inter)",fontSize:"var(--wp--preset--font-size--medium)",fontStyle:"normal",fontWeight:"400",lineHeight:"1.6"}}},{title:"Albert Sans + Lora",version:2,lookAndFeel:["Contemporary","Bold"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Albert Sans",slug:"albert-sans"},{fontFamily:"Lora",slug:"lora"}]}}},styles:{elements:{heading:{typography:{fontFamily:"var(--wp--preset--font-family--albert-sans)",fontStyle:"normal",fontWeight:"700"}}},typography:{fontFamily:"var(--wp--preset--font-family--lora)",fontStyle:"normal",fontWeight:"400",lineHeight:"1.67"}}},{title:"Bodoni Moda + Overpass",version:2,lookAndFeel:["Classic"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Bodoni Moda",slug:"bodoni-moda"},{fontFamily:"Overpass",slug:"overpass"}]}}},styles:{elements:{button:{typography:{fontFamily:"var(--wp--preset--font-family--overpass)",fontWeight:"400",lineHeight:"1"}},heading:{typography:{fontFamily:"var(--wp--preset--font-family--bodoni-moda)",fontStyle:"normal",fontWeight:"400"}}},blocks:{"core/site-title":{typography:{fontFamily:"var(--wp--preset--font-family--bodoni-moda)"}},"core/post-navigation-link":{typography:{fontFamily:"var(--wp--preset--font-family--bodoni-moda)"}}},typography:{fontFamily:"var(--wp--preset--font-family--overpass)",fontSize:"var(--wp--preset--font-size--medium)",fontStyle:"normal",fontWeight:"300",lineHeight:"1.6"}}},{title:"Commissioner + Crimson Pro",version:2,lookAndFeel:["Contemporary"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Commissioner",slug:"commissioner"},{fontFamily:"Crimson Pro",slug:"crimson-pro"}]}}},styles:{elements:{button:{typography:{fontFamily:"var(--wp--preset--font-family--commissioner)",fontWeight:"400",lineHeight:"1"}},heading:{typography:{fontFamily:"var(--wp--preset--font-family--commissioner)",fontStyle:"normal",fontWeight:"300"}}},blocks:{"core/site-title":{typography:{fontFamily:"var(--wp--preset--font-family--commissioner)",fontWeight:"300"}},"core/post-navigation-link":{typography:{fontFamily:"var(--wp--preset--font-family--commissioner)"}}},typography:{fontFamily:"var(--wp--preset--font-family--crimson-pro)",fontSize:"var(--wp--preset--font-size--medium)",fontStyle:"normal",fontWeight:"400",lineHeight:"1.6"}}},{title:"Cormorant + Work Sans",version:2,lookAndFeel:[],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Cormorant",slug:"cormorant"},{fontFamily:"Work Sans",slug:"work-sans"}]}}},styles:{elements:{heading:{typography:{fontFamily:"var(--wp--preset--font-family--cormorant)",fontStyle:"normal",fontWeight:"500"}}},typography:{fontFamily:"var(--wp--preset--font-family--work-sans)"}}},{title:"DM Sans + IBM Plex Mono",version:2,lookAndFeel:[],settings:{typography:{fontFamilies:{theme:[{fontFamily:"DM Sans",slug:"dm-sans"},{fontFamily:"IBM Plex Mono",slug:"ibm-plex-mono"}]}}},styles:{elements:{heading:{typography:{fontFamily:"var(--wp--preset--font-family--dm-sans)",fontStyle:"normal",fontWeight:"700"}}},typography:{fontFamily:"var(--wp--preset--font-family--ibm-plex-mono)",fontSize:"var(--wp--preset--font-size--small)",fontStyle:"normal",fontWeight:"300",lineHeight:"1.67"}}},{title:"Fraunces + Libre Franklin",version:2,lookAndFeel:["Classic"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Fraunces",slug:"fraunces"},{fontFamily:"Libre Franklin",slug:"libre-franklin"}]}}},styles:{elements:{heading:{typography:{fontFamily:"var(--wp--preset--font-family--fraunces)",fontStyle:"normal",fontWeight:"500"}}},typography:{fontFamily:"var(--wp--preset--font-family--libre-franklin)",lineHeight:"1.67"}}},{title:"Libre Baskerville + DM Sans",version:2,lookAndFeel:[],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Libre Baskerville",slug:"libre-baskerville"},{fontFamily:"DM Sans",slug:"dm-sans"}]}}},styles:{elements:{button:{typography:{fontFamily:"var(--wp--preset--font-family--dm-sans)",fontWeight:"400",lineHeight:"1"}},heading:{typography:{fontFamily:"var(--wp--preset--font-family--libre-baskerville)",fontStyle:"normal",fontWeight:"700"}}},blocks:{"core/site-title":{typography:{fontFamily:"var(--wp--preset--font-family--libre-baskerville)"}},"core/post-navigation-link":{typography:{fontFamily:"var(--wp--preset--font-family--libre-baskerville)"}}},typography:{fontFamily:"var(--wp--preset--font-family--dm-sans)",fontSize:"var(--wp--preset--font-size--small)",fontStyle:"normal",fontWeight:"400",lineHeight:"1.6"}}},{title:"Libre Franklin + EB Garamond",version:2,lookAndFeel:["Classic"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Libre Franklin",slug:"libre-franklin"},{fontFamily:"EB Garamond",slug:"eb-garamond"}]}}},styles:{elements:{button:{typography:{fontFamily:"var(--wp--preset--font-family--libre-franklin)",fontSize:"var(--wp--preset--font-size--small)",fontWeight:"400",lineHeight:"1"}},heading:{typography:{fontFamily:"var(--wp--preset--font-family--libre-franklin)",fontStyle:"normal",fontWeight:"700"}}},blocks:{"core/site-title":{typography:{fontFamily:"var(--wp--preset--font-family--libre-franklin)",fontWeight:"500"}},"core/post-navigation-link":{typography:{fontFamily:"var(--wp--preset--font-family--libre-franklin)"}}},typography:{fontFamily:"var(--wp--preset--font-family--eb-garamond)",fontSize:"var(--wp--preset--font-size--medium)",fontStyle:"normal",fontWeight:"400",lineHeight:"1.6"}}},{title:"Montserrat + Arvo",version:2,lookAndFeel:["Contemporary","Bold"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Montserrat",slug:"montserrat"},{fontFamily:"Arvo",slug:"arvo"}]}}},styles:{elements:{button:{typography:{fontFamily:"var(--wp--preset--font-family--montserrat)",fontStyle:"normal",fontWeight:"500"}},heading:{typography:{fontFamily:"var(--wp--preset--font-family--montserrat)",fontStyle:"normal",fontWeight:"700",lineHeight:"1.4"}}},blocks:{"core/site-title":{typography:{fontFamily:"var(--wp--preset--font-family--montserrat)",fontWeight:"700"}},"core/post-navigation-link":{typography:{fontFamily:"var(--wp--preset--font-family--montserrat)"}}},typography:{fontFamily:"var(--wp--preset--font-family--arvo)",fontSize:"var(--wp--preset--font-size--small)",fontStyle:"normal",fontWeight:"400",lineHeight:"1.6"}}},{title:"Newsreader + Newsreader",version:2,lookAndFeel:["Classic"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Newsreader",slug:"newsreader"}]}}},styles:{elements:{heading:{typography:{fontFamily:"var(--wp--preset--font-family--newsreader)",fontStyle:"normal",fontWeight:"400"}}},typography:{fontFamily:"var(--wp--preset--font-family--newsreader)",fontSize:"var(--wp--preset--font-size--medium)",lineHeight:"1.67"}}},{title:"Playfair Display + Fira Sans",version:2,lookAndFeel:["Classic"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Playfair Display",slug:"playfair-display"},{fontFamily:"Fira Sans",slug:"fira-sans"}]}}},styles:{elements:{button:{typography:{fontFamily:"var(--wp--preset--font-family--fira-sans)",fontWeight:"400",lineHeight:"1"}},heading:{typography:{fontFamily:"var(--wp--preset--font-family--playfair-display)",fontStyle:"italic",fontWeight:"400"}}},blocks:{"core/site-title":{typography:{fontFamily:"var(--wp--preset--font-family--playfair-display)",fontStyle:"italic",fontWeight:"400"}},"core/post-navigation-link":{typography:{fontFamily:"var(--wp--preset--font-family--playfair-display)",fontStyle:"italic",fontWeight:"400"}}},typography:{fontFamily:"var(--wp--preset--font-family--fira-sans)",fontSize:"var(--wp--preset--font-size--medium)",fontStyle:"normal",fontWeight:"400",lineHeight:"1.6"}}},{title:"Plus Jakarta Sans + Plus Jakarta Sans",version:2,lookAndFeel:["Contemporary","Bold"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Plus Jakarta Sans",slug:"plus-jakarta-sans"}]}}},styles:{elements:{heading:{typography:{fontFamily:"var(--wp--preset--font-family--plus-jakarta-sans)",fontStyle:"normal",fontWeight:"700"}}},typography:{fontFamily:"var(--wp--preset--font-family--plus-jakarta-sans)",lineHeight:"1.67"}}},{title:"Raleway + Cormorant",version:2,lookAndFeel:["Classic","Bold"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Raleway",slug:"raleway"},{fontFamily:"Cormorant",slug:"cormorant"}]}}},styles:{elements:{heading:{typography:{fontFamily:"var(--wp--preset--font-family--raleway)",fontStyle:"normal",fontWeight:"700"}}},typography:{fontFamily:"var(--wp--preset--font-family--cormorant)",fontSize:"var(--wp--preset--font-size--medium)",lineHeight:"1.67"}}},{title:"Rubik + Inter",version:2,lookAndFeel:["Bold"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Rubik",slug:"rubik"},{fontFamily:"Inter",slug:"inter"}]}}},styles:{elements:{button:{typography:{fontFamily:"var(--wp--preset--font-family--inter)",fontWeight:"400",lineHeight:"1"}},heading:{typography:{fontFamily:"var(--wp--preset--font-family--rubik)",fontStyle:"normal",fontWeight:"800"}}},blocks:{"core/site-title":{typography:{fontFamily:"var(--wp--preset--font-family--rubik)",fontWeight:"800"}},"core/post-navigation-link":{typography:{fontFamily:"var(--wp--preset--font-family--rubik)"}}},typography:{fontFamily:"var(--wp--preset--font-family--inter)",fontSize:"var(--wp--preset--font-size--medium)",fontStyle:"normal",fontWeight:"400",lineHeight:"1.6"}}},{title:"Rubik + Rubik",version:2,lookAndFeel:["Contemporary"],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Rubik",slug:"rubik"}]}}},styles:{elements:{heading:{typography:{fontFamily:"var(--wp--preset--font-family--rubik)"}}},typography:{fontFamily:"var(--wp--preset--font-family--rubik)",fontWeight:"400",lineHeight:"1.67"}}},{title:"Space Mono + Roboto",version:2,lookAndFeel:[],settings:{typography:{fontFamilies:{theme:[{fontFamily:"Space Mono",slug:"space-mono"},{fontFamily:"Roboto",slug:"roboto"}]}}},styles:{elements:{button:{typography:{fontFamily:"var(--wp--preset--font-family--roboto)",fontWeight:"400",lineHeight:"1"}},heading:{typography:{fontFamily:"var(--wp--preset--font-family--space-mono)",fontStyle:"normal",fontWeight:"400",lineHeight:"1.15"}}},blocks:{"core/site-title":{typography:{fontFamily:"var(--wp--preset--font-family--space-mono)",fontStyle:"normal",fontWeight:"400"}},"core/post-navigation-link":{typography:{fontFamily:"var(--wp--preset--font-family--space-mono)"}}},typography:{fontFamily:"var(--wp--preset--font-family--roboto)",fontSize:"var(--wp--preset--font-size--small)",fontStyle:"normal",fontWeight:"400",lineHeight:"1.6"}}}],Oe=[{title:"Ancient Bronze",version:2,settings:{color:{palette:{theme:[{color:"#323856",name:"Primary",slug:"primary"},{color:"#8C8369",name:"Secondary",slug:"secondary"},{color:"#323856",name:"Foreground",slug:"foreground"},{color:"#ffffff",name:"Background",slug:"background"},{color:"#F7F2EE",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Neutral"},{title:"Arctic Dawn",version:2,settings:{color:{palette:{theme:[{color:"#1E226F",name:"Primary",slug:"primary"},{color:"#DD301D",name:"Secondary",slug:"secondary"},{color:"#0D1263",name:"Foreground",slug:"foreground"},{color:"#ffffff",name:"Background",slug:"background"},{color:"#F0F1F5",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Neutral"},{title:"Bronze Serenity",version:2,settings:{color:{palette:{theme:[{color:"#1e4b4b",name:"Primary",slug:"primary"},{color:"#9e7047",name:"Secondary",slug:"secondary"},{color:"#1e4b4b",name:"Foreground",slug:"foreground"},{color:"#ffffff",name:"Background",slug:"background"},{color:"#e9eded",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Neutral"},{title:"Purple Twilight",version:2,settings:{color:{palette:{theme:[{color:"#301834",name:"Primary",slug:"primary"},{color:"#6a5eb7",name:"Secondary",slug:"secondary"},{color:"#090909",name:"Foreground",slug:"foreground"},{color:"#fefbff",name:"Background",slug:"background"},{color:"#f3eaf5",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Neutral"},{title:"Candy Store",version:2,settings:{color:{palette:{theme:[{color:"#293852",name:"Primary",slug:"primary"},{color:"#f1bea7",name:"Secondary",slug:"secondary"},{color:"#293852",name:"Foreground",slug:"foreground"},{color:"#ffffff",name:"Background",slug:"background"},{color:"#fffddb",name:"Tertiary",slug:"tertiary"}]}}},styles:{blocks:{"core/button":{color:{background:"var(--wp--preset--color--secondary)"},variations:{outline:{border:{color:"var(--wp--preset--color--secondary)"},color:{text:"var(--wp--preset--color--primary)"}}}}},color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"},elements:{button:{color:{background:"var(--wp--preset--color--secondary)",text:"var(--wp--preset--color--primary)"}}}},wpcom_category:"Neutral"},{title:"Midnight Citrus",version:2,settings:{color:{palette:{theme:[{color:"#222222",name:"Primary",slug:"primary"},{color:"#c0f500",name:"Secondary",slug:"secondary"},{color:"#222222",name:"Foreground",slug:"foreground"},{color:"#ffffff",name:"Background",slug:"background"},{color:"#f7faed",name:"Tertiary",slug:"tertiary"}]}}},styles:{blocks:{"core/button":{color:{background:"var(--wp--preset--color--secondary)"},variations:{outline:{border:{color:"var(--wp--preset--color--secondary)"},color:{text:"var(--wp--preset--color--primary)"}}}}},color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"},elements:{button:{":hover":{color:{background:"var(--wp--preset--color--secondary)",text:"var(--wp--preset--color--primary)"}},color:{background:"var(--wp--preset--color--secondary)",text:"var(--wp--preset--color--primary)"}}}},wpcom_category:"Neutral"},{title:"Crimson Tide",version:2,settings:{color:{palette:{theme:[{color:"#101317",name:"Primary",slug:"primary"},{color:"#EC5E3F",name:"Secondary",slug:"secondary"},{color:"#101317",name:"Foreground",slug:"foreground"},{color:"#ffffff",name:"Background",slug:"background"},{color:"#EEEEEE",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Neutral"},{title:"Raspberry Chocolate",version:2,settings:{color:{palette:{theme:[{color:"#42332e",name:"Primary",slug:"primary"},{color:"#d64d68",name:"Secondary",slug:"secondary"},{color:"#241d1a",name:"Foreground",slug:"foreground"},{color:"#eeeae6",name:"Background",slug:"background"},{color:"#D6CCC2",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Bright"},{title:"Gumtree Sunset",version:2,settings:{color:{palette:{theme:[{color:"#8699A1",name:"Primary",slug:"primary"},{color:"#BB6154",name:"Secondary",slug:"secondary"},{color:"#476C77",name:"Foreground",slug:"foreground"},{color:"#F4F7F7",name:"Background",slug:"background"},{color:"#ffffff",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Bright"},{title:"Fuchsia",version:2,settings:{color:{palette:{theme:[{color:"#b7127f",name:"Primary",slug:"primary"},{color:"#18020C",name:"Secondary",slug:"secondary"},{color:"#b7127f",name:"Foreground",slug:"foreground"},{color:"#f7edf6",name:"Background",slug:"background"},{color:"#ffffff",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Bright"},{title:"Cinder",version:2,settings:{color:{palette:{theme:[{color:"#c14420",name:"Primary",slug:"primary"},{color:"#2F2D2D",name:"Secondary",slug:"secondary"},{color:"#c14420",name:"Foreground",slug:"foreground"},{color:"#f1f2f2",name:"Background",slug:"background"},{color:"#DCDCDC",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Bright"},{title:"Canary",version:2,settings:{color:{palette:{theme:[{color:"#0F0F05",name:"Primary",slug:"primary"},{color:"#666666",name:"Secondary",slug:"secondary"},{color:"#0F0F05",name:"Foreground",slug:"foreground"},{color:"#FCFF9B",name:"Background",slug:"background"},{color:"#E8EB8C",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Bright"},{title:"Blue Lagoon",version:2,settings:{color:{palette:{theme:[{color:"#004DE5",name:"Primary",slug:"primary"},{color:"#0496FF",name:"Secondary",slug:"secondary"},{color:"#0036A3",name:"Foreground",slug:"foreground"},{color:"#FEFDF8",name:"Background",slug:"background"},{color:"#DEF2F7",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Bright"},{title:"Vibrant Berry",version:2,settings:{color:{palette:{theme:[{slug:"primary",color:"#7C1D6F",name:"Primary"},{slug:"secondary",color:"#C62FB2",name:"Secondary"},{slug:"foreground",color:"#7C1D6F",name:"Foreground"},{slug:"background",color:"#FFEED6",name:"Background"},{slug:"tertiary",color:"#FDD8DE",name:"Tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Bright"},{title:"Aquamarine Night",version:2,settings:{color:{palette:{theme:[{color:"#deffef",name:"Primary",slug:"primary"},{color:"#56fbb9",name:"Secondary",slug:"secondary"},{color:"#ffffff",name:"Foreground",slug:"foreground"},{color:"#091C48",name:"Background",slug:"background"},{color:"#10317F",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Dark"},{title:"Evergreen Twilight",version:2,settings:{color:{palette:{theme:[{color:"#ffffff",name:"Primary",slug:"primary"},{color:"#8EE978",name:"Secondary",slug:"secondary"},{color:"#ffffff",name:"Foreground",slug:"foreground"},{color:"#181818",name:"Background",slug:"background"},{color:"#636363",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Dark"},{title:"Cinnamon Latte",version:2,settings:{color:{palette:{theme:[{slug:"primary",color:"#D9CAB3",name:"Primary"},{slug:"secondary",color:"#BC8034",name:"Secondary"},{slug:"foreground",color:"#FFFFFF",name:"Foreground"},{slug:"background",color:"#3C3F4D",name:"Background"},{slug:"tertiary",color:"#2B2D36",name:"Tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Dark"},{title:"Lightning",version:2,settings:{color:{palette:{theme:[{color:"#ebffd2",name:"Primary",slug:"primary"},{color:"#fefefe",name:"Secondary",slug:"secondary"},{color:"#ebffd2",name:"Foreground",slug:"foreground"},{color:"#0e1fb5",name:"Background",slug:"background"},{color:"#0A1680",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Dark"},{title:"Lilac Nightshade",version:2,settings:{color:{palette:{theme:[{color:"#f5d6ff",name:"Primary",slug:"primary"},{color:"#C48DDA",name:"Secondary",slug:"secondary"},{color:"#ffffff",name:"Foreground",slug:"foreground"},{color:"#000000",name:"Background",slug:"background"},{color:"#462749",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Dark"},{title:"Charcoal",version:2,settings:{color:{palette:{theme:[{color:"#dbdbdb",name:"Primary",slug:"primary"},{color:"#efefef",name:"Secondary",slug:"secondary"},{color:"#dbdbdb",name:"Foreground",slug:"foreground"},{color:"#1e1e1e",name:"Background",slug:"background"},{color:"#000000",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Dark"},{title:"Rustic Rosewood",version:2,settings:{color:{palette:{theme:[{color:"#F4F4F2",name:"Primary",slug:"primary"},{color:"#EE797C",name:"Secondary",slug:"secondary"},{color:"#ffffff",name:"Foreground",slug:"foreground"},{color:"#1A1A1A",name:"Background",slug:"background"},{color:"#3B3939",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Dark"},{title:"Sandalwood Oasis",version:2,settings:{color:{palette:{theme:[{color:"#F0EBE3",name:"Primary",slug:"primary"},{color:"#DF9785",name:"Secondary",slug:"secondary"},{color:"#ffffff",name:"Foreground",slug:"foreground"},{color:"#2a2a16",name:"Background",slug:"background"},{color:"#434323",name:"Tertiary",slug:"tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Dark"},{title:"Slate",version:2,settings:{color:{palette:{theme:[{slug:"primary",color:"#FFFFFF",name:"Primary"},{slug:"secondary",color:"#FFDF6D",name:"Secondary"},{slug:"foreground",color:"#EFF2F9",name:"Foreground"},{slug:"background",color:"#13161E",name:"Background"},{slug:"tertiary",color:"#303036",name:"Tertiary"}]}}},styles:{color:{background:"var(--wp--preset--color--background)",text:"var(--wp--preset--color--foreground)"}},wpcom_category:"Dark"}].map((e=>{var t;return{...e,styles:{...e.styles,blocks:{"core/button":{color:{background:"var(--wp--preset--color--secondary)"},variations:{outline:{border:{color:"var(--wp--preset--color--secondary)"},color:{text:"var(--wp--preset--color--secondary)"}}}},"core/heading":{color:{text:"var(--wp--preset--color--foreground)"},elements:{link:{color:{text:"var(--wp--preset--color--foreground)"}}}},"core/post-date":{color:{text:"var(--wp--preset--color--foreground)"}},"core/post-title":{color:{text:"var(--wp--preset--color--foreground)"},elements:{link:{":hover":{color:{text:"var(--wp--preset--color--primary)"}},color:{text:"var(--wp--preset--color--foreground)"}}}},"core/pullquote":{border:{color:"var(--wp--preset--color--foreground)",style:"solid",width:"1px 0"}},"core/quote":{border:{color:"var(--wp--preset--color--foreground)",style:"solid",width:"0 0 0 5px"}},"core/separator":{color:{text:"var(--wp--preset--color--foreground)"}},"core/site-title":{elements:{link:{":hover":{color:{text:"var(--wp--preset--color--foreground)"}},color:{text:"var(--wp--preset--color--foreground)"}}}},...e.styles.blocks},elements:{button:{":active":{color:{background:"var(--wp--preset--color--foreground)",text:"var(--wp--preset--color--background)"}},":focus":{color:{background:"var(--wp--preset--color--foreground)",text:"var(--wp--preset--color--background)"},outline:{color:"var(--wp--preset--color--primary)",offset:"2px",style:"dotted",width:"1px"}},":hover":{color:{background:"var(--wp--preset--color--secondary)",text:"var(--wp--preset--color--background)"}},":visited":{color:{text:null!==(t=e.styles.elements)&&void 0!==t&&t.button?e.styles.elements.button.color:"var(--wp--preset--color--background)"}},color:{background:"var(--wp--preset--color--primary)",text:"var(--wp--preset--color--background)"}},link:{":hover":{color:{text:"var(--wp--preset--color--primary)"},typography:{textDecoration:"none"}},color:{text:"var(--wp--preset--color--foreground)"}},...e.styles.elements}}}}));var Se=o(4981),be=o(52175);const ve=(0,s.createContext)({logoBlockIds:[],setLogoBlockIds:()=>{}}),Ce=()=>{const{logoBlockIds:e}=(0,s.useContext)(ve),{attributes:t,isAttributesLoading:o}=(0,d.useSelect)((t=>{const o=t(be.store).getBlocksByClientId(e),r=!o.length||null===o[0];return r?{attributes:{},isAttributesLoading:r}:{attributes:o[0].attributes,isAttributesLoading:r}}),[e]);return{attributes:t,isAttributesLoading:o}},Qe=()=>{const{blockPatterns:e,isLoading:t}=(0,d.useSelect)((e=>({blockPatterns:e(l.store).getBlockPatterns(),isLoading:!e(l.store).hasFinishedResolution("getBlockPatterns")})),[]);return{blockPatterns:e,isLoading:t}},Ue=e=>{const{blockPatterns:t,isLoading:o}=Qe(),{attributes:r,isAttributesLoading:n}=Ce(),[i,a]=(0,s.useState)(r.width);(0,s.useEffect)((()=>{n||a(r.width)}),[n,r.width,i]);const l=(0,s.useMemo)((()=>(t||[]).filter((t=>{var o;return null===(o=t.categories)||void 0===o?void 0:o.includes(e)}))),[t,e]);return{isLoading:o,patterns:(0,s.useMemo)((()=>l.map((e=>{const t=Q(e.content,i);return{...e,content:t,blocks:(0,Se.parse)(t,{__unstableSkipMigrationLogs:!0})}}))),[l,i])}},Fe={template1:{blocks:["woocommerce-blocks/header-centered-menu","woocommerce-blocks/hero-product-split","woocommerce-blocks/product-collection-5-columns","woocommerce-blocks/hero-product-3-split","woocommerce-blocks/product-collection-3-columns","woocommerce-blocks/testimonials-3-columns","woocommerce-blocks/featured-category-triple","woocommerce-blocks/social-follow-us-in-social-media","woocommerce-blocks/footer-with-3-menus"],metadata:{businessType:["e-commerce","large-business"],contentFocus:["featured products"],audience:["general"],design:["contemporary"],features:["fullwidth-image-banner","testimonials","social-media","search"],complexity:"high"}},template2:{blocks:["woocommerce-blocks/header-essential","woocommerce-blocks/hero-product-split","woocommerce-blocks/product-collection-4-columns","woocommerce-blocks/hero-product-chessboard","woocommerce-blocks/product-collection-5-columns","woocommerce-blocks/testimonials-3-columns","woocommerce-blocks/footer-large"],metadata:{businessType:["e-commerce","subscription","large-business"],contentFocus:["catalog"],audience:["general"],design:["contemporary"],features:["small-banner","testimonials","newsletter"],complexity:"high"}},template3:{blocks:["woocommerce-blocks/header-centered-menu","woocommerce-blocks/hero-product-split","woocommerce-blocks/product-collection-featured-products-5-columns","woocommerce-blocks/featured-category-triple","woocommerce-blocks/product-query-product-gallery","woocommerce-blocks/footer-with-3-menus"],metadata:{businessType:["subscription","large-business"],contentFocus:["catalog","call-to-action"],audience:["general"],design:["contemporary"],features:["small-banner","social-media"],complexity:"high"}}},Ye=(e,t)=>e.map((e=>{const o=t[e];return o&&o.content?{...o,blocks:(0,Se.parse)(o.content,{__unstableSkipMigrationLogs:!0})}:null})).filter((e=>null!==e)),Pe=e=>e.reduce(((e,t)=>(e[t.name]=t,e)),{}),{escalate:Be}=xe,Ge={browserPopstateHandler:()=>e=>{const t=()=>{e({type:"EXTERNAL_URL_UPDATE"})};return window.addEventListener("popstate",t),()=>{window.removeEventListener("popstate",t)}},queryAiEndpoint:(0,c.C)({id:"query-ai-endpoint",predictableActionArguments:!0,initial:"init",context:{prompt:"",queryId:"",version:"",responseValidation:()=>!0,retryCount:0,validatedResponse:{}},states:{init:{always:"querying",entry:["setRetryCount"]},querying:{invoke:{src:"getCompletion",onDone:{target:"success",actions:["handleAiResponse"]},onError:{target:"error"}}},error:{always:[{cond:e=>e.retryCount>=3,target:"querying",actions:[Be((()=>({data:"Max retries exceeded"})))]},{target:"querying",actions:(0,F.f0)({retryCount:e=>e.retryCount+1})}]},success:{type:"final",data:e=>({result:"success",response:e.validatedResponse})}}},{actions:{handleAiResponse:(0,F.f0)({validatedResponse:(e,t)=>t.data}),setRetryCount:(0,F.f0)({retryCount:0})},services:{getCompletion:async e=>{let{queryId:t,prompt:o,version:r,responseValidation:n,retryCount:i,abortSignal:a=AbortSignal.timeout(1e4)}=e;const{token:s}=await async function(){var e,t;const o=localStorage.getItem(Ae);let r;if(o)try{r=JSON.parse(o)}catch(e){throw fe("Error parsing token",e),he("Error parsing cached token","token_parse_error")}if(r&&(null==r?void 0:r.expire)>Date.now())return fe("Using cached token"),r;const n=null===(e=window.JP_CONNECTION_INITIAL_STATE)||void 0===e?void 0:e.apiNonce,i=null===(t=window.JP_CONNECTION_INITIAL_STATE)||void 0===t?void 0:t.siteSuffix;try{const e={token:(await J()({path:"/jetpack/v4/jetpack-ai-jwt?_cacheBuster="+Date.now(),credentials:"same-origin",headers:{"X-WP-Nonce":n},method:"POST"})).token,blogId:i,expire:Date.now()+12e4};return fe("Storing new token"),localStorage.setItem(Ae,JSON.stringify(e)),e}catch(e){throw he("Error fetching new token","token_fetch_error")}}();let l,c;try{const e=new URL("https://public-api.wordpress.com/wpcom/v2/text-completion");e.searchParams.append("feature","woo_cys"),l=await J()({url:e.toString(),method:"POST",data:{token:s,prompt:o,_fields:"completion"},signal:a})}catch(e){throw(0,L.recordEvent)("customize_your_store_ai_completion_api_error",{query_id:t,version:r,retry_count:i,error_type:"api_request_error"}),e}try{c=JSON.parse(l.completion)}catch{throw(0,L.recordEvent)("customize_your_store_ai_completion_response_error",{query_id:t,version:r,retry_count:i,error_type:"json_parse_error",response:l.completion}),new Error(`Error validating Jetpack AI text completions response for ${t}`)}try{const e=n(c);return(0,L.recordEvent)("customize_your_store_ai_completion_success",{query_id:t,version:r,retry_count:i}),e}catch(e){throw(0,L.recordEvent)("customize_your_store_ai_completion_response_error",{query_id:t,version:r,retry_count:i,error_type:"valid_json_invalid_values",response:l.completion}),e}}}}),assembleSite:async e=>{try{await(async e=>{let{colorPaletteName:t=Oe[0].title,fontPairingName:o=Le[0].title}=e;const r=Oe.find((e=>e.title===t)),n=Le.find((e=>e.title===o)),{invalidateResolutionForStoreSelector:i}=(0,d.dispatch)(l.store);i("__experimentalGetCurrentGlobalStylesId");const a=await(0,d.resolveSelect)(l.store).__experimentalGetCurrentGlobalStylesId(),{saveEntityRecord:s}=(0,d.dispatch)(l.store);await s("root","globalStyles",{id:a,styles:(0,_e.X)((null==r?void 0:r.styles)||{},(null==n?void 0:n.styles)||{}),settings:(0,_e.X)((null==r?void 0:r.settings)||{},(null==n?void 0:n.settings)||{})},{throwOnError:!0})})({colorPaletteName:e.aiSuggestions.defaultColorPalette.default,fontPairingName:e.aiSuggestions.fontPairing}),(0,L.recordEvent)("customize_your_store_ai_update_global_styles_success")}catch(e){throw console.error(e),(0,L.recordEvent)("customize_your_store_ai_update_global_styles_response_error",{error:e instanceof Error?e.message:"unknown"}),e}try{await(async e=>{let{homepageTemplateId:t}=e;const{invalidateResolutionForStoreSelector:o}=(0,d.dispatch)(l.store);o("getBlockPatterns"),o("__experimentalGetTemplateForLink");const r=await(0,d.resolveSelect)(l.store).getBlockPatterns(),n=Pe(r);let i=[...Ye(Fe[t].blocks,n)].filter(Boolean).map((e=>e.content)).join("\n\n");i=Q(i);const a=await(0,d.resolveSelect)(l.store).__experimentalGetTemplateForLink("/"),{saveEntityRecord:s}=(0,d.dispatch)(l.store);await s("postType",a.type,{id:a.id,content:i},{throwOnError:!0})})({homepageTemplateId:e.aiSuggestions.homepageTemplate}),(0,L.recordEvent)("customize_your_store_ai_update_template_success")}catch(e){throw console.error(e),(0,L.recordEvent)("customize_your_store_ai_update_template_response_error",{error:e instanceof Error?e.message:"unknown"}),e}},updateStorePatterns:async e=>{try{await(0,d.dispatch)(m.OPTIONS_STORE_NAME).updateOptions({woocommerce_blocks_allow_ai_connection:!0});const{images:t}=await J()({path:"/wc/private/ai/images",method:"POST",data:{business_description:e.businessInfoDescription.descriptionText}}),[o]=await Promise.all([J()({path:"/wc/private/ai/products",method:"POST",data:{business_description:e.businessInfoDescription.descriptionText,images:t}}),J()({path:"/wc/private/ai/patterns",method:"POST",data:{business_description:e.businessInfoDescription.descriptionText,images:t}})]),r=o.product_content.map(((e,t)=>J()({path:"/wc/private/ai/product",method:"POST",data:{products_information:e,index:t}})));if(await Promise.all([...r,J()({path:"/wc/private/ai/business-description",method:"POST",data:{business_description:e.businessInfoDescription.descriptionText}})]),!o.ai_content_generated)throw new Error((o.additional_errors,JSON.stringify(o.additional_errors)))}catch(e){throw(0,L.recordEvent)("customize_your_store_update_store_pattern_api_error",{error:e instanceof Error?e.message:"unknown"}),e}},saveAiResponseToOption:e=>(0,d.dispatch)(m.OPTIONS_STORE_NAME).updateOptions({woocommerce_customize_store_ai_suggestions:{...e.aiSuggestions,lookAndFeel:e.lookAndFeel.choice}}),installAndActivateTheme:async()=>{const e="twentytwentythree";try{await J()({path:`/wc-admin/onboarding/themes/install?theme=${e}`,method:"POST"}),await J()({path:`/wc-admin/onboarding/themes/activate?theme=${e}&theme_switch_via_cys_ai_loader=1`,method:"POST"})}catch(t){throw(0,L.recordEvent)("customize_your_store_ai_install_and_activate_theme_error",{theme:e,error:t instanceof Error?t.message:"unknown"}),t}}};var Re=o(80834);const Ze=[{name:"Ancient Bronze",primary:"#11163d",secondary:"#8C8369",foreground:"#11163d",background:"#ffffff",lookAndFeel:["Contemporary","Classic"]},{name:"Arctic Dawn",primary:"#243156",secondary:"#DE5853",foreground:"#243156",background:"#ffffff",lookAndFeel:["Contemporary"]},{name:"Bronze Serenity",primary:"#1e4b4b",secondary:"#9e7047",foreground:"#1e4b4b",background:"#ffffff",lookAndFeel:["Classic"]},{name:"Purple Twilight",primary:"#301834",secondary:"#6a5eb7",foreground:"#090909",background:"#fefbff",lookAndFeel:["Bold"]},{name:"Candy Store",primary:"#293852",secondary:"#f1bea7",foreground:"#293852",background:"#ffffff",lookAndFeel:["Classic"]},{name:"Midnight Citrus",primary:"#1B1736",secondary:"#7E76A3",foreground:"#1B1736",background:"#ffffff",lookAndFeel:["Bold","Contemporary"]},{name:"Crimson Tide",primary:"#A02040",secondary:"#234B57",foreground:"#871C37",background:"#ffffff",lookAndFeel:["Bold"]},{name:"Raspberry Chocolate",primary:"#42332e",secondary:"#d64d68",foreground:"#241d1a",background:"#eeeae6",lookAndFeel:["Contemporary","Classic"]},{name:"Gumtree Sunset",primary:"#476C77",secondary:"#EFB071",foreground:"#476C77",background:"#edf4f4",lookAndFeel:["Classic"]},{name:"Fuchsia",primary:"#b7127f",secondary:"#18020C",foreground:"#b7127f",background:"#f7edf6",lookAndFeel:["Bold"]},{name:"Cinder",primary:"#c14420",secondary:"#2F2D2D",foreground:"#863119",background:"#f1f2f2",lookAndFeel:["Contemporary","Classic"]},{name:"Canary",primary:"#0F0F05",secondary:"#353535",foreground:"#0F0F05",background:"#FCFF9B",lookAndFeel:["Bold"]},{name:"Blue Lagoon",primary:"#004DE5",secondary:"#0496FF",foreground:"#0036A3",background:"#FEFDF8",lookAndFeel:["Bold","Contemporary"]},{name:"Vibrant Berry",primary:"#7C1D6F",secondary:"#C62FB2",foreground:"#7C1D6F",background:"#FFEED6",lookAndFeel:["Classic","Bold"]},{name:"Aquamarine Night",primary:"#deffef",secondary:"#56fbb9",foreground:"#ffffff",background:"#091C48",lookAndFeel:["Bold"]},{name:"Evergreen Twilight",primary:"#ffffff",secondary:"#8EE978",foreground:"#ffffff",background:"#181818",lookAndFeel:["Contemporary","Classic"]},{name:"Cinnamon Latte",primary:"#D9CAB3",secondary:"#BC8034",foreground:"#FFFFFF",background:"#3C3F4D",lookAndFeel:["Contemporary","Classic"]},{name:"Lightning",primary:"#ebffd2",secondary:"#fefefe",foreground:"#ebffd2",background:"#0e1fb5",lookAndFeel:["Bold"]},{name:"Lilac Nightshade",primary:"#f5d6ff",secondary:"#C48DDA",foreground:"#ffffff",background:"#000000",lookAndFeel:["Contemporary","Classic"]},{name:"Charcoal",primary:"#dbdbdb",secondary:"#efefef",foreground:"#dbdbdb",background:"#1e1e1e",lookAndFeel:["Contemporary","Classic"]},{name:"Rustic Rosewood",primary:"#F4F4F2",secondary:"#EE797C",foreground:"#ffffff",background:"#1A1A1A",lookAndFeel:["Contemporary","Classic"]},{name:"Sandalwood Oasis",primary:"#F0EBE3",secondary:"#DF9785",foreground:"#ffffff",background:"#2a2a16",lookAndFeel:["Contemporary","Classic"]},{name:"Slate",primary:"#FFFFFF",secondary:"#FFDF6D",foreground:"#EFF2F9",background:"#13161E",lookAndFeel:["Contemporary","Classic"]}],We=Ze.map((e=>e.name)),He=/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,Ve=Re.z.string().refine((e=>We.includes(e)),{message:"Color palette not part of allowed list"}),Je=(Re.z.object({name:Ve,primary:Re.z.string().regex(He,{message:"Invalid primary color"}),secondary:Re.z.string().regex(He,{message:"Invalid secondary color"}),foreground:Re.z.string().regex(He,{message:"Invalid foreground color"}),background:Re.z.string().regex(He,{message:"Invalid background color"}),lookAndFeel:Re.z.array(Re.z.enum(["Contemporary","Classic","Bold"]))}),{queryId:"default_color_palette",version:"2023-10-12",prompt:(e,t,o)=>`\n You are a WordPress theme expert designing a WooCommerce site. Analyse the following store description, merchant's chosen look and tone, and determine the most appropriate color scheme, along with 8 best alternatives.\n\t\t\tDo not use any palette names that are not part of the color choices provided below.\n\t\t\tRespond in the JSON form: "{ "default": "palette name", "bestColors": [ "palette name 1", "palette name 2", "palette name 3", "palette name 4", "palette name 5", "palette name 6", "palette name 7", "palette name 8" ] }"\n\t\t\t\n Chosen look and tone: ${t} look, ${o} tone.\n Business description: ${e}\n\n Colors schemes to choose from: \n ${JSON.stringify(t?Ze.filter((e=>e.lookAndFeel.includes(t))):Ze)}\n `,responseValidation:Re.z.object({default:Ve,bestColors:Re.z.array(Ve).length(8)}).refine((e=>{const t=[e.default,...e.bestColors];return new Set(t).size===t.length}),{message:"Color palette names must be unique"}).parse}),Xe=[{pair_name:"Inter + Inter",fonts:{Inter:"A highly legible sans-serif, optimized for UI design."},settings:"Inter is used for buttons and general typography."},{pair_name:"Bodoni Moda + Overpass",fonts:{"Bodoni Moda":"A modern serif font with high contrast between thick and thin lines, commonly used for headings.",Overpass:"A clean, modern sans-serif, originally inspired by Highway Gothic. Good for text and UI elements."},settings:"Overpass is used for buttons and general typography, while Bodoni Moda is specified for headings and some core blocks like site title and post navigation link."},{pair_name:"Commissioner + Crimson Pro",fonts:{Commissioner:"A low-contrast, geometric sans-serif, designed for legibility and readability in long texts.","Crimson Pro":"A serif typeface designed for readability and long-form text."},settings:"Commissioner dominates elements like buttons, headings, and core blocks, while Crimson Pro is set for general typography."},{pair_name:"Libre Baskerville + DM Sans",fonts:{"Libre Baskerville":"A serif typeface with a classic feel, good for long reading and often used for body text in books.","DM Sans":"A clean, geometric sans-serif, often used for UI and short text."},settings:"Libre Baskerville is used for headings and core blocks, whereas DM Sans is used for buttons and general typography."},{pair_name:"Libre Franklin + EB Garamond",fonts:{"Libre Franklin":"A sans-serif that offers readability, suitable for both text and display.","EB Garamond":"A revival of the classical 'Garamond' typefaces, suitable for long-form text."},settings:"Libre Franklin is predominantly used for elements like buttons, headings, and core blocks. EB Garamond is set for general typography."},{pair_name:"Montserrat + Arvo",fonts:{Montserrat:"A geometric sans-serif, popular for its modern clean lines.",Arvo:"A slab-serif font with a more traditional feel, suitable for print and screen."},settings:"Montserrat is used for buttons, headings, and core blocks. Arvo is used for general typography."},{pair_name:"Playfair Display + Fira Sans",fonts:{"Playfair Display":"A high-contrast serif designed for headings and offers a modern take on older serif fonts.","Fira Sans":"A sans-serif designed for readability at small sizes, making it suitable for both UI and text."},settings:"Playfair Display is used in italics for headings and core blocks, while Fira Sans is used for buttons and general typography."},{pair_name:"Rubik + Inter",fonts:{Rubik:"A sans-serif with slightly rounded corners, designed for a softer, more modern look.",Inter:"A highly legible sans-serif, optimized for UI design."},settings:"Rubik is applied for headings and core blocks. Inter is used for buttons and general typography."},{pair_name:"Space Mono + Roboto",fonts:{"Space Mono":"A monospace typeface with a futuristic vibe.",Roboto:"A neo-grotesque sans-serif, known for its flexibility and modern design."},settings:"Space Mono is used for headings, while Roboto takes care of buttons and general typography."}].map((e=>e.pair_name)),Ke=(Re.z.object({pair_name:Re.z.string().refine((e=>Xe.includes(e)),{message:"Font choice not part of allowed list"})}).parse,[{slug:"woocommerce-blocks/header-essential",label:"Essential Header"},{slug:"woocommerce-blocks/header-centered-menu",label:"Centered Menu with search Header"},{slug:"woocommerce-blocks/header-minimal",label:"Minimal Header"},{slug:"woocommerce-blocks/header-large",label:"Large Header"}]).map((e=>e.slug)),qe=(Re.z.object({slug:Re.z.string().refine((e=>Ke.includes(e)),{message:"Header not part of allowed list"})}).parse,[{slug:"woocommerce-blocks/footer-simple-menu",label:"Footer with Simple Menu"},{slug:"woocommerce-blocks/footer-with-3-menus",label:"Footer with 3 Menus"},{slug:"woocommerce-blocks/footer-large",label:"Large Footer"}]).map((e=>e.slug)),$e=(Re.z.object({slug:Re.z.string().refine((e=>qe.includes(e)),{message:"Footer not part of allowed list"})}).parse,Object.keys(Fe)),et=(Re.z.object({homepage_template:Re.z.string().refine((e=>$e.includes(e)),{message:"Template not part of allowed list"})}).parse,(0,c.C)({id:"designWithAi",predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},invoke:{src:"browserPopstateHandler"},on:{EXTERNAL_URL_UPDATE:{target:"navigate"},AI_WIZARD_CLOSED_BEFORE_COMPLETION:{actions:[(0,F.lj)(((e,t)=>t)),"recordTracksStepClosed"]}},context:{startLoadingTime:null,businessInfoDescription:{descriptionText:""},lookAndFeel:{choice:""},toneOfVoice:{choice:""},aiSuggestions:{defaultColorPalette:{default:"Ancient Bronze"},fontPairing:"Rubik + Inter",homepageTemplate:"template1"},apiCallLoader:{hasErrors:!1}},initial:"navigate",states:{navigate:{always:[{target:"businessInfoDescription",cond:{type:"hasStepInUrl",step:"business-info-description"}},{target:"lookAndFeel",cond:{type:"hasStepInUrl",step:"look-and-feel"}},{target:"toneOfVoice",cond:{type:"hasStepInUrl",step:"tone-of-voice"}},{target:"apiCallLoader",cond:{type:"hasStepInUrl",step:"api-call-loader"}},{target:"businessInfoDescription"}]},businessInfoDescription:{id:"businessInfoDescription",initial:"preBusinessInfoDescription",states:{preBusinessInfoDescription:{always:{target:"businessInfoDescription"}},businessInfoDescription:{meta:{component:e=>{let{sendEvent:t,context:o}=e;const[r,n]=(0,s.useState)(o.businessInfoDescription.descriptionText),[i,a]=(0,s.useState)(!1);return(0,s.createElement)("div",null,(0,s.createElement)(y.ProgressBar,{percent:20,color:"var(--wp-admin-theme-color)",bgcolor:"transparent"}),(0,s.createElement)(ee,{onClick:()=>{t({type:"AI_WIZARD_CLOSED_BEFORE_COMPLETION",payload:{step:"business-info-description"}})}}),(0,s.createElement)("div",{className:"woocommerce-cys-design-with-ai woocommerce-cys-layout"},(0,s.createElement)("div",{className:"woocommerce-cys-page"},(0,s.createElement)("h1",null,(0,D.__)("Tell us a bit more about your business","woocommerce")),(0,s.createElement)(T.TextareaControl,{onChange:e=>{n(e)},value:r}),(0,s.createElement)("div",{className:"woocommerce-cys-design-with-ai-guide"},(0,s.createElement)("p",null,(0,D.__)("The more detail you provide, the better our AI tool can do at creating your content.","woocommerce")),(0,s.createElement)("p",null,(0,D.__)("Try to include:","woocommerce")),(0,s.createElement)("ul",null,(0,s.createElement)("li",null,(0,D.__)("What you want to sell","woocommerce")),(0,s.createElement)("li",null,(0,D.__)("How many products you plan on displaying","woocommerce")),(0,s.createElement)("li",null,(0,D.__)("What makes your business unique","woocommerce")),(0,s.createElement)("li",null,(0,D.__)("Who your target audience is","woocommerce")))),(0,s.createElement)(T.Button,{variant:"primary",onClick:()=>{a(!0),t({type:"BUSINESS_INFO_DESCRIPTION_COMPLETE",payload:r})},disabled:0===r.length||i},i?(0,s.createElement)(T.Spinner,null):(0,D.__)("Continue","woocommerce")))))}},entry:[{type:"recordTracksStepViewed",step:"business_info_description"}],on:{BUSINESS_INFO_DESCRIPTION_COMPLETE:{actions:["assignBusinessInfoDescription","spawnSaveDescriptionToOption",{type:"recordTracksStepCompleted",step:"business_info_description"}],target:"postBusinessInfoDescription"}}},postBusinessInfoDescription:{always:{target:"#lookAndFeel"}}}},lookAndFeel:{id:"lookAndFeel",initial:"preLookAndFeel",states:{preLookAndFeel:{always:{target:"lookAndFeel"}},lookAndFeel:{meta:{component:e=>{let{sendEvent:t,context:o}=e;const r=[{title:(0,D.__)("Contemporary","woocommerce"),key:"Contemporary",subtitle:(0,D.__)("Clean lines, neutral colors, sleek and modern.","woocommerce")},{title:(0,D.__)("Classic","woocommerce"),key:"Classic",subtitle:(0,D.__)("Elegant and timeless with a nostalgic touch.","woocommerce")},{title:(0,D.__)("Bold","woocommerce"),key:"Bold",subtitle:(0,D.__)("Vibrant with eye-catching colors and visuals.","woocommerce")}],[n,i]=(0,s.useState)(""===o.lookAndFeel.choice?r[0].key:o.lookAndFeel.choice);return(0,s.createElement)("div",null,(0,s.createElement)(y.ProgressBar,{percent:60,color:"var(--wp-admin-theme-color)",bgcolor:"transparent"}),(0,s.createElement)(ee,{onClick:()=>{t({type:"AI_WIZARD_CLOSED_BEFORE_COMPLETION",payload:{step:"look-and-feel"}})}}),(0,s.createElement)("div",{className:"woocommerce-cys-design-with-ai-look-and-feel woocommerce-cys-layout"},(0,s.createElement)("div",{className:"woocommerce-cys-page"},(0,s.createElement)("h1",null,(0,D.__)("How would you like your store to look?","woocommerce")),(0,s.createElement)("div",{className:"choices"},r.map((e=>{let{title:t,subtitle:o,key:r}=e;return(0,s.createElement)(te,{key:r,name:"user-profile-choice",title:t,subtitle:o,selected:n===r,value:r,onChange:e=>{i(e)}})}))),(0,s.createElement)(T.Button,{variant:"primary",onClick:()=>{o.lookAndFeel.aiRecommended&&o.lookAndFeel.aiRecommended!==n&&(0,L.recordEvent)("customize_your_store_ai_wizard_changed_ai_option",{step:"look-and-feel",ai_recommended:o.lookAndFeel.aiRecommended,user_choice:n}),t({type:"LOOK_AND_FEEL_COMPLETE",payload:n})}},(0,D.__)("Continue","woocommerce")))))}},entry:[{type:"updateQueryStep",step:"look-and-feel"},{type:"recordTracksStepViewed",step:"look_and_feel"}],on:{LOOK_AND_FEEL_COMPLETE:{actions:[{type:"recordTracksStepCompleted",step:"look_and_feel"},"assignLookAndFeel"],target:"postLookAndFeel"}}},postLookAndFeel:{always:{target:"#toneOfVoice"}}}},toneOfVoice:{id:"toneOfVoice",initial:"preToneOfVoice",states:{preToneOfVoice:{always:{target:"toneOfVoice"}},toneOfVoice:{meta:{component:e=>{let{sendEvent:t,context:o}=e;const r=[{title:(0,D.__)("Informal","woocommerce"),key:"Informal",subtitle:(0,D.__)("Relaxed and friendly, like a conversation with a friend.","woocommerce")},{title:(0,D.__)("Neutral","woocommerce"),key:"Neutral",subtitle:(0,D.__)("Impartial tone with casual expressions and no slang.","woocommerce")},{title:(0,D.__)("Formal","woocommerce"),key:"Formal",subtitle:(0,D.__)("Direct yet respectful, serious and professional.","woocommerce")}],[n,i]=(0,s.useState)(""===o.toneOfVoice.choice?r[0].key:o.toneOfVoice.choice),a=()=>{o.toneOfVoice.aiRecommended&&o.toneOfVoice.aiRecommended!==n&&(0,L.recordEvent)("customize_your_store_ai_wizard_changed_ai_option",{step:"tone-of-voice",ai_recommended:o.toneOfVoice.aiRecommended,user_choice:n}),t({type:"TONE_OF_VOICE_COMPLETE",payload:n})};return(0,s.createElement)("div",null,(0,s.createElement)(y.ProgressBar,{percent:80,color:"var(--wp-admin-theme-color)",bgcolor:"transparent"}),(0,s.createElement)(ee,{onClick:()=>{t({type:"AI_WIZARD_CLOSED_BEFORE_COMPLETION",payload:{step:"tone-of-voice"}})}}),(0,s.createElement)("div",{className:"woocommerce-cys-design-with-ai-tone-of-voice woocommerce-cys-layout"},(0,s.createElement)("div",{className:"woocommerce-cys-page"},(0,s.createElement)("h1",null,(0,D.__)("Which writing style do you prefer?","woocommerce")),o.apiCallLoader.hasErrors&&(0,s.createElement)(T.Notice,{className:"woocommerce-cys-design-with-ai__error-notice",isDismissible:!1,status:"error"},(0,s.createInterpolateElement)((0,D.__)("Oops! We encountered a problem while generating your store. ","woocommerce"),{retryButton:(0,s.createElement)(T.Button,{onClick:a,variant:"tertiary"},(0,D.__)("Please try again","woocommerce"))})),(0,s.createElement)("div",{className:"choices"},r.map((e=>{let{title:t,subtitle:o,key:r}=e;return(0,s.createElement)(te,{key:r,name:"user-profile-choice",title:t,subtitle:o,selected:n===r,value:r,onChange:e=>{i(e)}})}))),(0,s.createElement)(T.Button,{variant:"primary",onClick:a},(0,D.__)("Continue","woocommerce")))))}},entry:[{type:"updateQueryStep",step:"tone-of-voice"},{type:"recordTracksStepViewed",step:"tone_of_voice"}],on:{TONE_OF_VOICE_COMPLETE:{actions:["assignToneOfVoice",{type:"recordTracksStepCompleted",step:"tone_of_voice"}],target:"postToneOfVoice"}}},postToneOfVoice:{always:{target:"#apiCallLoader"}}}},apiCallLoader:{id:"apiCallLoader",initial:"preApiCallLoader",states:{preApiCallLoader:{always:{target:"apiCallLoader"}},apiCallLoader:{meta:{component:()=>{const[e,t]=(0,s.useState)(5);(0,s.useEffect)((()=>{const e=e=>{const t=new Image;t.src=e,t.onload=()=>{}};e(ae),e(ce)}),[]);const o=ue(Me.slice(0,-1));return(0,s.createElement)(oe.Loader,null,(0,s.createElement)(oe.Loader.Sequence,{interval:4e4/(o.length-1),shouldLoop:!1,onChange:e=>{setTimeout((()=>{t(o[e].progress)}),0)}},o.map(((e,t)=>(0,s.createElement)(oe.Loader.Layout,{key:t},(0,s.createElement)(oe.Loader.Illustration,null,e.image),(0,s.createElement)(oe.Loader.Title,null,e.title))))),(0,s.createElement)(oe.Loader.ProgressBar,{className:"smooth-transition",progress:e||0}))}},entry:[{type:"updateQueryStep",step:"api-call-loader"},"assignStartLoadingTime"],type:"parallel",states:{chooseColorPairing:{initial:"pending",states:{pending:{invoke:{src:"queryAiEndpoint",data:e=>({...Je,prompt:Je.prompt(e.businessInfoDescription.descriptionText,e.lookAndFeel.choice,e.toneOfVoice.choice)}),onDone:{actions:["assignDefaultColorPalette"],target:"success"},onError:{target:"success"}}},success:{type:"final"}}},chooseFontPairing:{initial:"pending",states:{pending:{entry:["assignFontPairing"],always:{target:"success"}},success:{type:"final"}}},updateStorePatterns:{initial:"pending",states:{pending:{invoke:{src:"updateStorePatterns",onDone:{target:"success"},onError:{actions:["assignAPICallLoaderError"],target:"#toneOfVoice"}}},success:{type:"final"}}},installAndActivateTheme:{initial:"pending",states:{pending:{invoke:{src:"installAndActivateTheme",onDone:{target:"success"},onError:{actions:["assignAPICallLoaderError"],target:"#toneOfVoice"}}},success:{type:"final"}}}},onDone:"postApiCallLoader"},postApiCallLoader:{type:"parallel",states:{assembleSite:{initial:"pending",states:{pending:{invoke:{src:"assembleSite",onDone:{target:"done"},onError:{actions:["assignAPICallLoaderError"],target:"#toneOfVoice"}}},done:{type:"final"}}},saveAiResponse:{initial:"pending",states:{pending:{invoke:{src:"saveAiResponseToOption",onDone:{target:"done"},onError:{target:"failed"}}},done:{type:"final"},failed:{type:"final"}}}},onDone:{target:"#designWithAi.showAssembleHub"}}}},showAssembleHub:{meta:{component:()=>{const e=ue(Me.slice(-2)),[t,o]=(0,s.useState)(e[0].progress);return(0,s.createElement)(oe.Loader,null,(0,s.createElement)(oe.Loader.Sequence,{interval:1e4/(e.length-1),shouldLoop:!1,onChange:t=>{setTimeout((()=>{o(e[t].progress)}),0)}},e.map(((e,t)=>(0,s.createElement)(oe.Loader.Layout,{key:t},(0,s.createElement)(oe.Loader.Illustration,null,e.image),(0,s.createElement)(oe.Loader.Title,null,e.title))))),(0,s.createElement)(oe.Loader.ProgressBar,{className:"smooth-transition",progress:t||0}))}},entry:["redirectToAssemblerHub"],type:"final"}}},{actions:we,services:Ge,guards:{hasStepInUrl:(e,t,o)=>{let{cond:r}=o;const{path:n=""}=(0,g.getQuery)();return n.split("/")[3]===r.step}}}));var tt=o(1718);const ot=e=>{let{parentMachine:t}=e;const[o,r,n]=(0,M.e)(et,{devTools:!1,parent:t}),i=(0,u.v)(n,(e=>{var t;return(0,tt.r)(null!==(t=null==e?void 0:e.meta)&&void 0!==t?t:void 0)})),[a,l]=(0,s.useState)(null);(0,s.useEffect)((()=>{null!=i&&i.component&&l((()=>null==i?void 0:i.component))}),[a,null==i?void 0:i.component]);const c=o.value instanceof Object?Object.keys(o.value)[0]:o.value;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:`woocommerce-design-with-ai__container woocommerce-design-with-ai-wizard__step-${c}`},a?(0,s.createElement)(a,{sendEvent:r,context:o.context}):(0,s.createElement)("div",null)))};var rt=o(97800),nt=o(86802),it=o(37557),at=o(24705),st=o(55815),lt=o(12238),ct=o(83357),Mt=o(58141),ut=o(92694),gt=o(17547),mt=o(43302),dt=o(9059),yt=o(9480),Nt=o(76989),pt=o(14168),It=o(40592),Dt=o(56530),Et=o(92819);const Tt=e=>{let{fontFamilies:t,onLoad:o,preload:r=!1}=e;const n=(0,s.useMemo)((()=>new URLSearchParams([...t.map((e=>{let{fontFamily:t}=e;return["family",`${t}:ital,wght@0,400;0,700;1,400;1,700`]})),["display","swap"]])),[t]);return n.getAll("family").length?(0,s.createElement)(s.Fragment,null,r?(0,s.createElement)("link",{rel:"preconnect",href:"https://fonts.wp.com"}):null,(0,s.createElement)("link",{rel:r?"preload":"stylesheet",type:"text/css",as:r?"style":void 0,href:`https://fonts-api.wp.com/css2?${n}`,onLoad:o,onError:o})):null},jt=()=>{const e=Le.map((e=>{var t,o,r;return null==e||null===(t=e.settings)||void 0===t||null===(o=t.typography)||void 0===o||null===(r=o.fontFamilies)||void 0===r?void 0:r.theme})).map((e=>[...e.map((e=>({...e,name:e.fontFamily})))]));return(0,s.createElement)(s.Fragment,null,e.map((e=>(0,s.createElement)(Tt,{fontFamilies:e,key:e.map((e=>e.slug)).join("-"),preload:!0}))))},{Provider:zt}=T.Disabled.Context;let wt;const{useGlobalSetting:kt}=(0,it.U)(be.privateApis),ht=2e3;function ft(e){let{viewportWidth:t,containerWidth:o,settings:r,additionalStyles:n,onClickNavigationItem:i,isNavigable:a=!1,isScrollable:l=!0,autoScale:c=!0,setLogoBlockContext:M=!1,CustomIframeComponent:u=be.__unstableIframe}=e;const[g,m]=(0,s.useState)(null),{setLogoBlockIds:d}=(0,s.useContext)(ve),[y]=kt("typography.fontFamilies.theme"),N=y.filter((e=>{let{slug:t}=e;return"system-font"!==t}));t||(t=o);const p=(0,s.useMemo)((()=>!l&&r.styles?[...r.styles,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"}]:r.styles),[r.styles,l]),I=o/t,D=g?o/(g*I):0;wt=wt||(0,k.pure)(be.BlockList);return(0,s.createElement)(zt,{value:!0},(0,s.createElement)("div",{className:"block-editor-block-preview__content",style:c?{transform:`scale(${I})`,aspectRatio:D,maxHeight:null!==g&&g>ht?ht*I:void 0}:{}},(0,s.createElement)(u,{"aria-hidden":!0,scrolling:l?"yes":"no",tabIndex:-1,readonly:!a,style:c?{position:"absolute",width:t,height:g,pointerEvents:"none",maxHeight:ht}:{},contentRef:(0,k.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%";const o=(e=>{let t,o;const r=e=>{e.stopImmediatePropagation()},n=e=>{e.preventDefault(),i(e)},s=()=>{e.removeEventListener("mousemove",r,!1),t&&t.forEach((e=>{e.removeEventListener("click",n)})),o&&o.forEach((e=>{e.removeEventListener("click",n)}))};e.addEventListener("mousemove",r,!0);const l=new window.MutationObserver((()=>{if(c){const t=e.querySelector(".is-root-container");m(t?t.clientHeight:null)}a&&(e.querySelectorAll('.block-editor-rich-text__editable[contenteditable="true"]').forEach((e=>{e.removeAttribute("contenteditable")})),e.querySelectorAll('*[inert="true"]').forEach((e=>{e.removeAttribute("inert")})),s(),t=e.querySelectorAll(".wp-block-navigation__container"),t.forEach((e=>{e.addEventListener("click",n,!0)})),o=e.querySelectorAll(".wp-block-site-title a"),o.forEach((e=>{e.addEventListener("click",n,!0)}))),M&&(()=>{const t=e.querySelectorAll(".wp-block-site-logo"),o=Array.from(t).map((e=>e.getAttribute("data-block"))).filter(Boolean);d(o)})()}));return l.observe(e,{attributes:!0,characterData:!1,subtree:!0,childList:!0}),()=>{l.disconnect(),s(),M&&d([])}})(e);return()=>{o(),m(null)}}),[a])},(0,s.createElement)(be.__unstableEditorStyles,{styles:p}),(0,s.createElement)("style",null,`\n\t\t\t\t\t\t.block-editor-block-list__block::before,\n\t\t\t\t\t\t.is-selected::after,\n\t\t\t\t\t\t.is-hovered::after,\n\t\t\t\t\t\t.block-list-appender {\n\t\t\t\t\t\t\tdisplay: none !important;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.block-editor-block-list__block.is-selected {\n\t\t\t\t\t\t\tbox-shadow: none !important;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.block-editor-rich-text__editable {\n\t\t\t\t\t\t\tpointer-events: none !important;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.wp-block-site-title .block-editor-rich-text__editable {\n\t\t\t\t\t\t\tpointer-events: all !important;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.wp-block-navigation-item .wp-block-navigation-item__content,\n\t\t\t\t\t\t.wp-block-navigation .wp-block-pages-list__item__link {\n\t\t\t\t\t\t\tpointer-events: all !important;\n\t\t\t\t\t\t\tcursor: pointer !important;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t${n}\n\t\t\t\t\t`),(0,s.createElement)(wt,{renderAppender:!1}),(0,s.createElement)(jt,null),(0,s.createElement)(Tt,{fontFamilies:N,onLoad:Et.noop}))))}const At=e=>{const[t,{width:o}]=(0,k.useResizeObserver)();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,s.createElement)("div",{className:"auto-block-preview__container"},!!o&&(0,s.createElement)(ft,(0,j.Z)({},e,{containerWidth:o}))))},xt=(0,s.memo)((e=>{let{blocks:t,settings:o,useSubRegistry:r=!0,onChange:n,...i}=e;const a=(0,s.useMemo)((()=>Array.isArray(t)?t:[t]),[t]);return(0,s.createElement)(be.BlockEditorProvider,{value:a,settings:o,onChange:n,useSubRegistry:r},(0,s.createElement)(At,(0,j.Z)({settings:o},i)))})),_t=()=>{const{templateType:e}=(0,d.useSelect)((e=>{const{getEditedPostType:t}=(0,it.U)(e(ct.h));return{templateType:t()}}),[]),[t,o,r]=(0,l.useEntityBlockEditor)("postType",e);return[t,o,r]},Lt=(0,s.createContext)({highlightedBlockIndex:-1,setHighlightedBlockIndex:e=>{},resetHighlightedBlockIndex:()=>{}}),Ot=e=>{let{children:t}=e;const[o,r]=(0,s.useState)(-1);return(0,s.createElement)(Lt.Provider,{value:{highlightedBlockIndex:o,setHighlightedBlockIndex:r,resetHighlightedBlockIndex:()=>{r(-1)}}},t)};function St(e){var t,o,r,n;let{contentRef:i,children:a,tabIndex:l=0,scale:c=1,frameSize:M=0,expand:u=!1,readonly:g,forwardedRef:m,loadStyles:y=!0,loadScripts:N=!1,...p}=e;const[I,E]=(0,s.useState)(),{resolvedAssets:z}=(0,d.useSelect)((e=>({resolvedAssets:e(be.store).getSettings().__unstableResolvedAssets})),[]),{styles:h="",scripts:f=""}=z,[A,{height:x}]=(0,k.useResizeObserver)(),_=(0,k.useRefEffect)((e=>{e._load=()=>{E(e.contentDocument)}}),[]),L=(0,k.useDisabled)({isDisabled:!g}),O=(0,k.useMergeRefs)([i,L]),S=`\n\n\t
\n\t\t