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