// Original FUC Pace engine; the extra source tracks XB's fetch-based page lifecycle. const css=document.createElement('link'); css.rel='stylesheet';css.href=new URL('./native/pace.css',import.meta.url).href; document.head.prepend(css); let source=null,generation=0; window.paceOptions={startOnPageLoad:false,restartOnPushState:false,ajax:false, extraSources:[function PageLoad(){source=this;this.progress=0;}] }; await import('./native/pace.min.js'); export function beginPageProgress(){ const ticket=++generation; window.Pace.restart(); document.getElementById('app')?.setAttribute('aria-busy','true'); return ticket; } export function finishPageProgress(ticket){ if(ticket!==generation)return; if(source)source.progress=100; document.getElementById('app')?.setAttribute('aria-busy','false'); }