| 1 | (()=>{if("undefined"==typeof navigation)return;let t,e=0,r=new Set,n=null;function a(){navigation.addEventListener("navigate",t=>{if(!t.canIntercept)return;let a,o=history.state;t.intercept({handler:()=>new Promise(t=>{a=t}),scroll:"manual",focusReset:"manual"}),t.signal.addEventListener("abort",()=>{e>0&&(r.forEach(t=>t()),r.clear(),e=0),n=null}),n=()=>{a(),history.replaceState(o,"")}},{once:!0}),navigation.navigate(location.href,{history:"replace"})}function o(){n&&(n(),n=null)}htmx.registerExtension("browser-indicator",{init:e=>{t=e},htmx_before_history_update:()=>{o()},htmx_before_request:(n,o)=>{(function(e){return"true"===t.attributeValue(e,"hx-browser-indicator")||!(!htmx.config.boostBrowserIndicator||!e._htmx?.boosted)})(n)&&(o.ctx._browserIndicator=!0,e++,1===e&&a(),o.ctx.request?.abort&&r.add(o.ctx.request.abort))},htmx_finally_request:(t,n)=>{n.ctx._browserIndicator&&(n.ctx.request?.abort&&r.delete(n.ctx.request.abort),0!==e&&(e--,0===e&&o()))}})})(); |