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