import*asefrom"@wordpress/interactivity";vart={d:(e,o)=>{for(variino)t.o(o,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},o={};t.d(o,{o:()=>P,w:()=>x});consti=(e=>{varo={};returnt.d(o,e),o})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store});varn;const{directivePrefix:a,getRegionRootFragment:r,initialVdom:s,toVdom:d,render:l,parseServerData:c,populateServerData:g,batch:w}=(0,i.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,i.getConfig)("core/router").navigationMode)&&void0!==n?n:"regionBased",h=newMap,m=(newMap,e=>{constt=newURL(e,window.location.href);returnt.pathname+t.search}),p=async(e,{vdom:t}={})=>{consto={body:void0};if("regionBased"===u){consti=`data-${a}-router-region`;e.querySelectorAll(`[${i}]`).forEach((e=>{constn=e.getAttribute(i);o[n]=t?.has(e)?t.get(e):d(e)}))}consti=e.querySelector("title")?.innerText,n=c(e);return{regions:o,head:undefined,title:i,initialData:n}},f=e=>{w((()=>{if("regionBased"===u){g(e.initialData);constt=`data-${a}-router-region`;document.querySelectorAll(`[${t}]`).forEach((o=>{consti=o.getAttribute(t),n=r(o);l(e.regions[i],n)}))}e.title&&(document.title=e.title)}))},v=e=>(window.location.assign(e),newPromise((()=>{})));window.addEventListener("popstate",(async()=>{conste=m(window.location.href),t=h.has(e)&&awaith.get(e);t?(f(t),x.url=window.location.href):window.location.reload()})),h.set(m(window.location.href),Promise.resolve(p(document,{vdom:s})));lety="",S=!1;constb={loading:"Loading page, please wait.",loaded:"Page Loaded."},{state:x,actions:P}=(0,i.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,message:""}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();o&&(yieldv(e));constn=m(e),{navigation:a}=x,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:d=1e4}=t;y=e,P.prefetch(n,t);constl=newPromise((e=>setTimeout(e,d))),c=setTimeout((()=>{y===e&&(r&&(a.hasStarted=!0,a.hasFinished=!1),s&&A("loading"))}),400),g=yieldPromise.race([h.get(n),l]);if(clearTimeout(c),y===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yieldf(g),window.history[t.replace?"replaceState":"pushState"]({},"",e),x.url=e,r&&(a.hasStarted=!1,a.hasFinished=!0),s&&A("loaded");const{hash:o}=newURL(e,window.location.href);o&&document.querySelector(o)?.scrollIntoView()}elseyieldv(e)},prefetch(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();if(o)return;constn=m(e);!t.force&&h.has(n)||h.set(n,(async(e,{html:t})=>{try{if(!t){consto=awaitwindow.fetch(e);if(200!==o.status)return!1;t=awaito.text()}consto=(newwindow.DOMParser).parseFromString(t,"text/html");returnp(o)}catch(e){return!1}})(n,{html:t.html}))}}});functionA(e){if(!S){S=!0;conste=document.getElementById("wp-script-module-data-@wordpress/interactivity-router")?.textContent;if(e)try{constt=JSON.parse(e);"string"==typeoft?.i18n?.loading&&(b.loading=t.i18n.loading),"string"==typeoft?.i18n?.loaded&&(b.loaded=t.i18n.loaded)}catch{}elsex.navigation.texts?.loading&&(b.loading=x.navigation.texts.loading),x.navigation.texts?.loaded&&(b.loaded=x.navigation.texts.loaded)}constt=b[e];x.navigation.message=t+(x.navigation.message===t?"":"")}varD=o.o,C=o.w;export{Dasactions,Casstate};