File manager - Edit - /home/matthif/www/wp-content/plugins/gutenberg/build-module/interactivity-router/index.min.js
Back
import*as e from"@wordpress/interactivity";var t={317:e=>{e.exports=import("@wordpress/a11y")}},o={};function n(e){var a=o[e];if(void 0!==a)return a.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var a={};n.d(a,{o:()=>$,w:()=>U});const i=(g={getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store},u={},n.d(u,g),u),r=/url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g,s=(e,t)=>{try{return new URL(e,t).toString()}catch(t){return e}},l=(e,t)=>e.replace(r,((e,o="",n,a)=>`url(${o}${s(n||a,t)}${o})`)),c=new Map,d=async(e,t)=>(c.has(e)||c.set(e,t()),c.get(e));var g,u,h;const{directivePrefix:w,getRegionRootFragment:p,initialVdom:f,toVdom:m,render:y,parseServerData:v,populateServerData:S,batch:b}=(0,i.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),P=null!==(h=(0,i.getConfig)("core/router").navigationMode)&&void 0!==h?h:"regionBased",x=new Map,A=e=>{const t=new URL(e,window.location.href);return t.pathname+t.search},L=(e,{vdom:t,baseUrl:o}={})=>{const n={body:void 0},a=((e,t=(e.location||window.location).href)=>[...e.querySelectorAll("style,link[rel=stylesheet]")].map((e=>"LINK"===e.nodeName?(async({id:e,href:t,sheet:o},n)=>{const a=e||t,i=s(t,n);return d(a,o?()=>{const e=new CSSStyleSheet;for(const{cssText:t}of o.cssRules)e.insertRule(l(t,i));return Promise.resolve(e)}:async()=>{const e=await fetch(t),o=await e.text(),n=new CSSStyleSheet;return await n.replace(l(o,i)),n})})(e,t):(async({textContent:e})=>d(e,(async()=>{const t=new CSSStyleSheet;return await t.replace(e),t})))(e))))(e,o),i=[...e.querySelectorAll("script[type=module][src]")].map((e=>e.src));if("fullPage"===P&&(n.body=t?t.get(document.body):m(e.body)),"regionBased"===P){const o=`data-${w}-router-region`;e.querySelectorAll(`[${o}]`).forEach((e=>{const a=e.getAttribute(o);n[a]=t?.has(e)?t.get(e):m(e)}))}const r=e.querySelector("title")?.innerText,c=v(e);return{regions:n,styles:a,scriptModules:i,title:r,initialData:c}},D=async e=>{await Promise.all([...e.styles,...e.scriptModules.map((e=>import(e)))]);const t=await Promise.all(e.styles);if(window.document.querySelectorAll("style,link[rel=stylesheet]").forEach((e=>e.remove())),window.document.adoptedStyleSheets=t,"fullPage"===P){const t=p(document.body);b((()=>{S(e.initialData),y(e.regions.body,t)}))}if("regionBased"===P){const t=`data-${w}-router-region`;b((()=>{S(e.initialData),document.querySelectorAll(`[${t}]`).forEach((o=>{const n=o.getAttribute(t),a=p(o);y(e.regions[n],a)}))}))}e.title&&(document.title=e.title)},C=e=>(window.location.assign(e),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const e=A(window.location.href),t=x.has(e)&&await x.get(e);t?(await D(t),U.url=window.location.href):window.location.reload()})),x.set(A(window.location.href),Promise.resolve(L(document,{vdom:f,baseUrl:window.location.href})));const R=e=>e&&e instanceof window.HTMLAnchorElement&&e.href&&(!e.target||"_self"===e.target)&&e.origin===window.location.origin&&!e.pathname.startsWith("/wp-admin")&&!e.pathname.startsWith("/wp-login.php")&&!e.getAttribute("href").startsWith("#")&&!new URL(e.href).searchParams.has("_wpnonce"),E=e=>e&&0===e.button&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.defaultPrevented;let q="",M=!1;const N={loading:"Loading page, please wait.",loaded:"Page Loaded."},{state:U,actions:$}=(0,i.store)("core/router",{state:{url:window.location.href,navigation:{isLoading:!1,hasStarted:!1,hasFinished:!1}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();o&&(yield C(e));const n=A(e),{navigation:a}=U,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:l=1e4}=t;q=e,$.prefetch(n,t);const c=new Promise((e=>setTimeout(e,l))),d=setTimeout((()=>{q===e&&(a.isLoading=!0,r&&(a.hasStarted=!0,a.hasFinished=!1),s&&k("loading"))}),400),g=yield Promise.race([x.get(n),c]);if(clearTimeout(d),q===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yield D(g),window.history[t.replace?"replaceState":"pushState"]({},"",e),U.url=e,a.isLoading=!1,r&&(a.hasStarted=!1,a.hasFinished=!0),s&&k("loaded");const{hash:o}=new URL(e,window.location.href);o&&document.querySelector(o)?.scrollIntoView()}else yield C(e)},prefetch(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();if(o)return;const n=A(e);!t.force&&x.has(n)||x.set(n,(async(e,{html:t})=>{try{if(!t){const o=await window.fetch(e);if(200!==o.status)return!1;t=await o.text()}const o=(new window.DOMParser).parseFromString(t,"text/html");return L(o,{baseUrl:e})}catch(e){return!1}})(n,{html:t.html}))}}});function k(e){if(!M){M=!0;const e=document.getElementById("wp-script-module-data-@wordpress/interactivity-router")?.textContent;if(e)try{const t=JSON.parse(e);"string"==typeof t?.i18n?.loading&&(N.loading=t.i18n.loading),"string"==typeof t?.i18n?.loaded&&(N.loaded=t.i18n.loaded)}catch{}else U.navigation.texts?.loading&&(N.loading=U.navigation.texts.loading),U.navigation.texts?.loaded&&(N.loaded=U.navigation.texts.loaded)}const t=N[e];Promise.resolve().then(n.bind(n,317)).then((({speak:e})=>e(t)),(()=>{}))}"fullPage"===P&&(document.addEventListener("click",(function(e){const t=e.target.closest("a");R(t)&&E(e)&&(e.preventDefault(),$.navigate(t.href))}),!0),document.addEventListener("mouseenter",(function(e){if("A"===e.target?.nodeName){const t=e.target.closest("a");R(t)&&E(e)&&$.prefetch(t.href)}}),!0));var T=a.o,F=a.w;export{T as actions,F as state}; //# sourceMappingURL=index.min.js.map
| ver. 1.4 |
Github
|
.
| PHP 5.4.45 | Generation time: 0 |
proxy
|
phpinfo
|
Settings