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