var Zt=t=>{throw TypeError(t)};var Ce=(t,e,n)=>e.has(t)||Zt("Cannot "+n);var w=(t,e,n)=>(Ce(t,e,"read from private field"),n?n.call(t):e.get(t)),U=(t,e,n)=>e.has(t)?Zt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{b0 as At,b1 as je,j as T,g as I,i as O,E as pt,b2 as te,b3 as Ne}from"./mO2F3zLa.js";import{o as ee}from"./OXvvA7WZ.js";const M=[];function Nt(t,e=At){let n=null;const r=new Set;function a(i){if(je(t,i)&&(t=i,n)){const c=!M.length;for(const l of r)l[1](),M.push(l,t);if(c){for(let l=0;l{r.delete(l),r.size===0&&n&&(n(),n=null)}}return{set:a,update:s,subscribe:o}}class qt{constructor(e,n){this.status=e,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class Dt{constructor(e,n){this.status=e,this.location=n}}class Vt extends Error{constructor(e,n,r){super(r),this.status=e,this.text=n}}new URL("sveltekit-internal://");function qe(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function De(t){return t.split("%25").map(decodeURI).join("%25")}function Ve(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function Lt({href:t}){return t.split("#")[0]}function Be(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)e=e*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;new TextDecoder;function Ke(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&Y.delete(Bt(t)),Me(t,e));const Y=new Map;function ze(t,e){const n=Bt(t,e),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&Y.set(n,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=Ke(a)),Promise.resolve(new Response(a,s))}return window.fetch(t,e)}function Fe(t,e,n){if(Y.size>0){const r=Bt(t,n),a=Y.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return e.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return e.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return Ut(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return Ut(String.fromCharCode(...c.slice(2).split("-").map(_=>parseInt(_,16))));const d=Ge.exec(c),[,u,v,f,h]=d;return e.push({name:f,matcher:h,optional:!!u,rest:!!v,chained:v?l===1&&o[0]==="":!1}),v?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return Ut(c)}).join("")}).join("")}/?$`),params:e}}function Ye(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function He(t){return t.slice(1).split("/").filter(Ye)}function Je(t,e,n){const r={},a=t.slice(1),s=a.filter(i=>i!==void 0);let o=0;for(let i=0;id).join("/"),o=0),l===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](l)){r[c.name]=l;const d=e[i+1],u=a[i+1];d&&!d.rest&&d.optional&&u&&c.chained&&(o=0),!d&&!u&&Object.keys(r).length===s.length&&(o=0);continue}if(c.optional&&c.chained){o++;continue}return}if(!o)return r}function Ut(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Xe({nodes:t,server_loads:e,dictionary:n,matchers:r}){const a=new Set(e);return Object.entries(n).map(([i,[c,l,d]])=>{const{pattern:u,params:v}=We(i),f={id:i,exec:h=>{const _=u.exec(h);if(_)return Je(_,v,r)},errors:[1,...d||[]].map(h=>t[h]),layouts:[0,...l||[]].map(o),leaf:s(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(i){const c=i<0;return c&&(i=~i),[c,t[i]]}function o(i){return i===void 0?i:[a.has(i),t[i]]}}function pe(t,e=JSON.parse){try{return e(sessionStorage[t])}catch{}}function ne(t,e,n=JSON.stringify){const r=n(e);try{sessionStorage[t]=r}catch{}}var le;const L=((le=globalThis.__sveltekit_lh973k)==null?void 0:le.base)??"";var fe;const Qe=((fe=globalThis.__sveltekit_lh973k)==null?void 0:fe.assets)??L??"",Ze="1766779597771",ge="sveltekit:snapshot",me="sveltekit:scroll",_e="sveltekit:states",tn="sveltekit:pageurl",F="sveltekit:history",J="sveltekit:navigation",q={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Kt=location.origin;function we(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function St(){return{x:pageXOffset,y:pageYOffset}}function z(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const ae={...q,"":q.hover};function ye(t){let e=t.assignedSlot??t.parentNode;return(e==null?void 0:e.nodeType)===11&&(e=e.host),e}function ve(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=ye(t)}}function Ot(t,e,n){let r;try{if(r=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const i=location.hash.split("#")[1]||"/";r.hash=`#${i}${r.hash}`}}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,s=!r||!!a||Et(r,e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===Kt&&t.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function gt(t){let e=null,n=null,r=null,a=null,s=null,o=null,i=t;for(;i&&i!==document.documentElement;)r===null&&(r=z(i,"preload-code")),a===null&&(a=z(i,"preload-data")),e===null&&(e=z(i,"keepfocus")),n===null&&(n=z(i,"noscroll")),s===null&&(s=z(i,"reload")),o===null&&(o=z(i,"replacestate")),i=ye(i);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:ae[r??"off"],preload_data:ae[a??"off"],keepfocus:c(e),noscroll:c(n),reload:c(s),replace_state:c(o)}}function re(t){const e=Nt(t);let n=!0;function r(){n=!0,e.update(o=>o)}function a(o){n=!1,e.set(o)}function s(o){let i;return e.subscribe(c=>{(i===void 0||n&&c!==i)&&o(i=c)})}return{notify:r,set:a,subscribe:s}}const be={v:()=>{}};function en(){const{set:t,subscribe:e}=Nt(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Qe}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==Ze;return o&&(t(!0),be.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:r}}function Et(t,e,n){return t.origin!==Kt||!t.pathname.startsWith(e)?!0:n?t.pathname!==location.pathname:!1}function Tn(t){}const ke=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...ke];const nn=new Set([...ke]);[...nn];function an(t){return t.filter(e=>e!=null)}function Mt(t){return t instanceof qt||t instanceof Vt?t.status:500}function rn(t){return t instanceof Vt?t.text:"Internal Error"}let R,X,Tt;const on=ee.toString().includes("$$")||/function \w+\(\) \{\}/.test(ee.toString());var nt,at,rt,ot,st,it,ct,lt,ue,ft,de,ut,he;on?(R={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},X={current:null},Tt={current:!1}):(R=new(ue=class{constructor(){U(this,nt,T({}));U(this,at,T(null));U(this,rt,T(null));U(this,ot,T({}));U(this,st,T({id:null}));U(this,it,T({}));U(this,ct,T(-1));U(this,lt,T(new URL("https://example.com")))}get data(){return I(w(this,nt))}set data(e){O(w(this,nt),e)}get form(){return I(w(this,at))}set form(e){O(w(this,at),e)}get error(){return I(w(this,rt))}set error(e){O(w(this,rt),e)}get params(){return I(w(this,ot))}set params(e){O(w(this,ot),e)}get route(){return I(w(this,st))}set route(e){O(w(this,st),e)}get state(){return I(w(this,it))}set state(e){O(w(this,it),e)}get status(){return I(w(this,ct))}set status(e){O(w(this,ct),e)}get url(){return I(w(this,lt))}set url(e){O(w(this,lt),e)}},nt=new WeakMap,at=new WeakMap,rt=new WeakMap,ot=new WeakMap,st=new WeakMap,it=new WeakMap,ct=new WeakMap,lt=new WeakMap,ue),X=new(de=class{constructor(){U(this,ft,T(null))}get current(){return I(w(this,ft))}set current(e){O(w(this,ft),e)}},ft=new WeakMap,de),Tt=new(he=class{constructor(){U(this,ut,T(!1))}get current(){return I(w(this,ut))}set current(e){O(w(this,ut),e)}},ut=new WeakMap,he),be.v=()=>Tt.current=!0);function Se(t){Object.assign(R,t)}const sn=new Set(["icon","shortcut icon","apple-touch-icon"]),V=pe(me)??{},Q=pe(ge)??{},N={url:re({}),page:re({}),navigating:Nt(null),updated:en()};function zt(t){V[t]=St()}function cn(t,e){let n=t+1;for(;V[n];)delete V[n],n+=1;for(n=e+1;Q[n];)delete Q[n],n+=1}function Z(t,e=!1){return e?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function Ee(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(L||"/");t&&await t.update()}}function oe(){}let Ft,$t,mt,P,Pt,b;const _t=[],wt=[];let y=null;function Ct(){var t;(t=y==null?void 0:y.fork)==null||t.then(e=>e==null?void 0:e.discard()),y=null}const ht=new Map,Re=new Set,ln=new Set,H=new Set;let m={branch:[],error:null,url:null},xe=!1,yt=!1,se=!0,tt=!1,W=!1,Ae=!1,Gt=!1,Wt,S,A,D;const vt=new Set,ie=new Map;async function Pn(t,e,n){var s,o,i,c,l;(s=globalThis.__sveltekit_lh973k)!=null&&s.data&&globalThis.__sveltekit_lh973k.data,document.URL!==location.href&&(location.href=location.href),b=t,await((i=(o=t.hooks).init)==null?void 0:i.call(o)),Ft=Xe(t),P=document.documentElement,Pt=e,$t=t.nodes[0],mt=t.nodes[1],$t(),mt(),S=(c=history.state)==null?void 0:c[F],A=(l=history.state)==null?void 0:l[J],S||(S=A=Date.now(),history.replaceState({...history.state,[F]:S,[J]:A},""));const r=V[S];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Sn(Pt,n)):(await G({type:"enter",url:we(b.hash?xn(new URL(location.href)):location.href),replace_state:!0}),a()),kn()}function fn(){_t.length=0,Gt=!1}function Le(t){wt.some(e=>e==null?void 0:e.snapshot)&&(Q[t]=wt.map(e=>{var n;return(n=e==null?void 0:e.snapshot)==null?void 0:n.capture()}))}function Ue(t){var e;(e=Q[t])==null||e.forEach((n,r)=>{var a,s;(s=(a=wt[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function ce(){zt(S),ne(me,V),Le(A),ne(ge,Q)}async function un(t,e,n,r){let a;e.invalidateAll&&Ct(),await G({type:"goto",url:we(t),keepfocus:e.keepFocus,noscroll:e.noScroll,replace_state:e.replaceState,state:e.state,redirect_count:n,nav_token:r,accept:()=>{e.invalidateAll&&(Gt=!0,a=[...ie.keys()]),e.invalidate&&e.invalidate.forEach(bn)}}),e.invalidateAll&&pt().then(pt).then(()=>{ie.forEach(({resource:s},o)=>{var i;a!=null&&a.includes(o)&&((i=s.refresh)==null||i.call(s))})})}async function dn(t){if(t.id!==(y==null?void 0:y.id)){Ct();const e={};if(vt.add(e),y={id:t.id,token:e,promise:Ie({...t,preload:e}).then(n=>(vt.delete(e),n.type==="loaded"&&n.state.error&&Ct(),n)),fork:null},te){const n=y;n.fork=n.promise.then(r=>{if(n===y&&r.type==="loaded")try{return te(()=>{Wt.$set(r.props),Se(r.props.page)})}catch{}return null})}}return y.promise}async function It(t){var n;const e=(n=await Rt(t,!1))==null?void 0:n.route;e&&await Promise.all([...e.layouts,e.leaf].map(r=>r==null?void 0:r[1]()))}async function Te(t,e,n){var a;m=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(R,t.props.page),Wt=new b.root({target:e,props:{...t.props,stores:N,components:wt},hydrate:n,sync:!1}),await Promise.resolve(),Ue(A),n){const s={from:null,to:{params:m.params,route:{id:((a=m.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};H.forEach(o=>o(s))}yt=!0}function bt({url:t,params:e,branch:n,status:r,error:a,route:s,form:o}){let i="never";if(L&&(t.pathname===L||t.pathname===L+"/"))i="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(i=f.slash);t.pathname=qe(t.pathname,i),t.search=t.search;const c={type:"loaded",state:{url:t,params:e,branch:n,error:a,route:s},props:{constructors:an(n).map(f=>f.node.component),page:Qt(R)}};o!==void 0&&(c.props.form=o);let l={},d=!R,u=0;for(let f=0;fi(new URL(o))))return!0;return!1}function Ht(t,e){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?e??null:null}function gn(t,e){if(!t)return new Set(e.searchParams.keys());const n=new Set([...t.searchParams.keys(),...e.searchParams.keys()]);for(const r of n){const a=t.searchParams.getAll(r),s=e.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&n.delete(r)}return n}function mn({error:t,url:e,route:n,params:r}){return{type:"loaded",state:{error:t,url:e,route:n,params:r,branch:[]},props:{page:Qt(R),constructors:[]}}}async function Ie({id:t,invalidating:e,url:n,params:r,route:a,preload:s}){if((y==null?void 0:y.id)===t)return vt.delete(y.token),y.promise;const{errors:o,layouts:i,leaf:c}=a,l=[...i,c];o.forEach(g=>g==null?void 0:g().catch(()=>{})),l.forEach(g=>g==null?void 0:g[1]().catch(()=>{}));const d=m.url?t!==kt(m.url):!1,u=m.route?a.id!==m.route.id:!1,v=gn(m.url,n);let f=!1;const h=l.map(async(g,p)=>{var C;if(!g)return;const k=m.branch[p];return g[1]===(k==null?void 0:k.loader)&&!pn(f,u,d,v,(C=k.universal)==null?void 0:C.uses,r)?k:(f=!0,Yt({loader:g[1],url:n,params:r,route:a,parent:async()=>{var dt;const $={};for(let B=0;B{});const _=[];for(let g=0;gPromise.resolve({}),server_data_node:Ht(s)}),i={node:await mt(),loader:mt,universal:null,server:null,data:null};return bt({url:n,params:a,branch:[o,i],status:t,error:e,route:null})}catch(o){if(o instanceof Dt)return un(new URL(o.location,location.href),{},0);throw o}}async function wn(t){const e=t.href;if(ht.has(e))return ht.get(e);let n;try{const r=(async()=>{let a=await b.hooks.reroute({url:new URL(t),fetch:async(s,o)=>hn(s,o,t).promise})??t;if(typeof a=="string"){const s=new URL(t);b.hash?s.hash=a:s.pathname=a,a=s}return a})();ht.set(e,r),n=await r}catch{ht.delete(e);return}return n}async function Rt(t,e){if(t&&!Et(t,L,b.hash)){const n=await wn(t);if(!n)return;const r=yn(n);for(const a of Ft){const s=a.exec(r);if(s)return{id:kt(t),invalidating:e,route:a,params:Ve(s),url:t}}}}function yn(t){return De(b.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(L.length))||"/"}function kt(t){return(b.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function Oe({url:t,type:e,intent:n,delta:r,event:a}){let s=!1;const o=Xt(m,n,t,e);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const i={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return tt||Re.forEach(c=>c(i)),s?null:o}async function G({type:t,url:e,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:i=0,nav_token:c={},accept:l=oe,block:d=oe,event:u}){var B;const v=D;D=c;const f=await Rt(e,!1),h=t==="enter"?Xt(m,f,e,t):Oe({url:e,type:t,delta:n==null?void 0:n.delta,intent:f,event:u});if(!h){d(),D===c&&(D=v);return}const _=S,g=A;l(),tt=!0,yt&&h.navigation.type!=="enter"&&N.navigating.set(X.current=h.navigation);let p=f&&await Ie(f);if(!p){if(Et(e,L,b.hash))return await Z(e,s);p=await $e(e,{id:null},await et(new Vt(404,"Not Found",`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404,s)}if(e=(f==null?void 0:f.url)||e,D!==c)return h.reject(new Error("navigation aborted")),!1;if(p.type==="redirect"){if(i<20){await G({type:t,url:new URL(p.location,e),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o,redirect_count:i+1,nav_token:c}),h.fulfil(void 0);return}p=await Jt({status:500,error:await et(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}})}else p.props.page.status>=400&&await N.updated.check()&&(await Ee(),await Z(e,s));if(fn(),zt(_),Le(g),p.props.page.url.pathname!==e.pathname&&(e.pathname=p.props.page.url.pathname),o=n?n.state:o,!n){const E=s?0:1,K={[F]:S+=E,[J]:A+=E,[_e]:o};(s?history.replaceState:history.pushState).call(history,K,"",e),s||cn(S,A)}const k=f&&(y==null?void 0:y.id)===f.id?y.fork:null;y=null,p.props.page.state=o;let x;if(yt){const E=(await Promise.all(Array.from(ln,j=>j(h.navigation)))).filter(j=>typeof j=="function");if(E.length>0){let j=function(){E.forEach(xt=>{H.delete(xt)})};E.push(j),E.forEach(xt=>{H.add(xt)})}m=p.state,p.props.page&&(p.props.page.url=e);const K=k&&await k;K?x=K.commit():(Wt.$set(p.props),Se(p.props.page),x=(B=Ne)==null?void 0:B()),Ae=!0}else await Te(p,Pt,!1);const{activeElement:C}=document;await x,await pt(),await pt();let $=n?n.scroll:a?St():null;if(se){const E=e.hash&&document.getElementById(Pe(e));if($)scrollTo($.x,$.y);else if(E){E.scrollIntoView();const{top:K,left:j}=E.getBoundingClientRect();$={x:pageXOffset+j,y:pageYOffset+K}}else scrollTo(0,0)}const dt=document.activeElement!==C&&document.activeElement!==document.body;!r&&!dt&&Rn(e,$),se=!0,p.props.page&&Object.assign(R,p.props.page),tt=!1,t==="popstate"&&Ue(A),h.fulfil(void 0),H.forEach(E=>E(h.navigation)),N.navigating.set(X.current=null)}async function $e(t,e,n,r,a){return t.origin===Kt&&t.pathname===location.pathname&&!xe?await Jt({status:r,error:n,url:t,route:e}):await Z(t,a)}function vn(){let t,e,n;P.addEventListener("mousemove",i=>{const c=i.target;clearTimeout(t),t=setTimeout(()=>{s(c,q.hover)},20)});function r(i){i.defaultPrevented||s(i.composedPath()[0],q.tap)}P.addEventListener("mousedown",r),P.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(i=>{for(const c of i)c.isIntersecting&&(It(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(i,c){const l=ve(i,P),d=l===e&&c>=n;if(!l||d)return;const{url:u,external:v,download:f}=Ot(l,L,b.hash);if(v||f)return;const h=gt(l),_=u&&kt(m.url)===kt(u);if(!(h.reload||_))if(c<=h.preload_data){e=l,n=q.tap;const g=await Rt(u,!1);if(!g)return;dn(g)}else c<=h.preload_code&&(e=l,n=c,It(u))}function o(){a.disconnect();for(const i of P.querySelectorAll("a")){const{url:c,external:l,download:d}=Ot(i,L,b.hash);if(l||d)continue;const u=gt(i);u.reload||(u.preload_code===q.viewport&&a.observe(i),u.preload_code===q.eager&&It(c))}}H.add(o),o()}function et(t,e){if(t instanceof qt)return t.body;const n=Mt(t),r=rn(t);return b.hooks.handleError({error:t,event:e,status:n,message:r})??{message:r}}function bn(t){if(typeof t=="function")_t.push(t);else{const{href:e}=new URL(t,location.href);_t.push(n=>n.href===e)}}function kn(){var e;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(ce(),!tt){const a=Xt(m,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};Re.forEach(o=>o(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ce()}),(e=navigator.connection)!=null&&e.saveData||vn(),P.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=ve(n.composedPath()[0],P);if(!r)return;const{url:a,external:s,target:o,download:i}=Ot(r,L,b.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const c=gt(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||i)return;const[d,u]=(b.hash?a.hash.replace(/^#/,""):a.href).split("#"),v=d===Lt(location);if(s||c.reload&&(!v||!u)){Oe({url:a,type:"link",event:n})?tt=!0:n.preventDefault();return}if(u!==void 0&&v){const[,f]=m.url.href.split("#");if(f===u){if(n.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=r.ownerDocument.getElementById(decodeURIComponent(u));h&&(h.scrollIntoView(),h.focus())}return}if(W=!0,zt(S),t(a),!c.replace_state)return;W=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await G({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href,event:n})}),P.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(Et(i,L,!1))return;const c=n.target,l=gt(c);if(l.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(c,a);i.search=new URLSearchParams(d).toString(),G({type:"form",url:i,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??i.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!jt){if((r=n.state)!=null&&r[F]){const a=n.state[F];if(D={},a===S)return;const s=V[a],o=n.state[_e]??{},i=new URL(n.state[tn]??location.href),c=n.state[J],l=m.url?Lt(location)===Lt(m.url):!1;if(c===A&&(Ae||l)){o!==R.state&&(R.state=o),t(i),V[S]=St(),s&&scrollTo(s.x,s.y),S=a;return}const u=a-S;await G({type:"popstate",url:i,popped:{state:o,scroll:s,delta:u},accept:()=>{S=a,A=c},block:()=>{history.go(-u)},nav_token:D,event:n})}else if(!W){const a=new URL(location.href);t(a),b.hash&&location.reload()}}}),addEventListener("hashchange",()=>{W&&(W=!1,history.replaceState({...history.state,[F]:++S,[J]:A},"",location.href))});for(const n of document.querySelectorAll("link"))sn.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&N.navigating.set(X.current=null)});function t(n){m.url=R.url=n,N.page.set(Qt(R)),N.page.notify()}}async function Sn(t,{status:e=200,error:n,node_ids:r,params:a,route:s,server_route:o,data:i,form:c}){xe=!0;const l=new URL(location.href);let d;({params:a={},route:s={id:null}}=await Rt(l,!1)||{}),d=Ft.find(({id:f})=>f===s.id);let u,v=!0;try{const f=r.map(async(_,g)=>{const p=i[g];return p!=null&&p.uses&&(p.uses=En(p.uses)),Yt({loader:b.nodes[_],url:l,params:a,route:s,parent:async()=>{const k={};for(let x=0;x{const i=history.state;jt=!0,location.replace(`#${r}`),b.hash&&location.replace(t.hash),history.replaceState(i,"",t.hash),scrollTo(s,o),jt=!1})}else{const s=document.body,o=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),o!==null?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let o=0;o{if(a.rangeCount===s.length){for(let o=0;o{a=d,s=u});return o.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:n&&{params:(e==null?void 0:e.params)??null,route:{id:((l=e==null?void 0:e.route)==null?void 0:l.id)??null},url:n},willUnload:!e,type:r,complete:o},fulfil:a,reject:s}}function Qt(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function xn(t){const e=new URL(t);return e.hash=decodeURIComponent(t.hash),e}function Pe(t){let e;if(b.hash){const[,,n]=t.hash.split("#",3);e=n??""}else e=t.hash.slice(1);return decodeURIComponent(e)}export{Pn as a,Tn as l,R as p,N as s};