import*asefrom"@wordpress/interactivity";vart={d:(e,i)=>{for(varoini)t.o(i,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:i[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},i={};t.d(i,{o:()=>x,w:()=>b});consto=(e=>{vari={};returnt.d(i,e),i})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store});varn;const{directivePrefix:a,getRegionRootFragment:r,initialVdom:s,toVdom:c,render:l,parseInitialData:d,populateInitialData:g,batch:w}=(0,o.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),u=null!==(n=(0,o.getConfig)("core/router").navigationMode)&&void0!==n?n:"regionBased",h=newMap,m=(newMap,e=>{constt=newURL(e,window.location);returnt.pathname+t.search}),p=async(e,{vdom:t}={})=>{consti={};if("regionBased"===u){consto=`data-${a}-router-region`;e.querySelectorAll(`[${o}]`).forEach((e=>{constn=e.getAttribute(o);i[n]=t?.has(e)?t.get(e):c(e)}))}consto=e.querySelector("title")?.innerText,n=d(e);return{regions:i,head:undefined,title:o,initialData:n}},f=e=>{w((()=>{if("regionBased"===u){g(e.initialData);constt=`data-${a}-router-region`;document.querySelectorAll(`[${t}]`).forEach((i=>{consto=i.getAttribute(t),n=r(i);l(e.regions[o],n)}))}e.title&&(document.title=e.title)}))},v=e=>(window.location.assign(e),newPromise((()=>{})));window.addEventListener("popstate",(async()=>{conste=m(window.location),t=h.has(e)&&awaith.get(e);t?(f(t),b.url=window.location.href):window.location.reload()})),h.set(m(window.location),Promise.resolve(p(document,{vdom:s})));lety="";const{state:b,actions:x}=(0,o.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,texts:{}}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:i}=(0,o.getConfig)();i&&(yieldv(e));constn=m(e),{navigation:a}=b,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:c=1e4}=t;y=e,x.prefetch(n,t);constl=newPromise((e=>setTimeout(e,c))),d=setTimeout((()=>{y===e&&(r&&(a.hasStarted=!0,a.hasFinished=!1),s&&(a.message=a.texts.loading))}),400),g=yieldPromise.race([h.get(n),l]);if(clearTimeout(d),y===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yieldf(g),window.history[t.replace?"replaceState":"pushState"]({},"",e),b.url=e,r&&(a.hasStarted=!1,a.hasFinished=!0),s&&(a.message=a.texts.loaded+(a.message===a.texts.loaded?"":""));const{hash:i}=newURL(e,window.location);i&&document.querySelector(i)?.scrollIntoView()}elseyieldv(e)},prefetch(e,t={}){const{clientNavigationDisabled:i}=(0,o.getConfig)();if(i)return;constn=m(e);!t.force&&h.has(n)||h.set(n,(async(e,{html:t})=>{try{if(!t){consti=awaitwindow.fetch(e);if(200!==i.status)return!1;t=awaiti.text()}consti=(newwindow.DOMParser).parseFromString(t,"text/html");returnp(i)}catch(e){return!1}})(n,t))}}});varA=i.o,P=i.w;export{Aasactions,Passtate};