var ce=Object.defineProperty;var le=(t,a,e)=>a in t?ce(t,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[a]=e;var G=(t,a,e)=>le(t,typeof a!="symbol"?a+"":a,e);import{S as fe,K as ue,a7 as he,a8 as de,a9 as pe,T as me,aa as ge,W as _e,x as ye,a6 as we,L as ht}from"./wWjeKwgK.js";import{H as O,N as V,r as Mt,i as yt,c as ve,s as nt,p as L,n as dt,f as Bt,g as pt,a as z,b as lt,S as qt,P as be,d as Pt,e as Ee,m as Se,h as ke,o as Kt,j as Ae,t as Ie,k as Vt,l as M,q as Re,u as Te,v as Ht,w as Le}from"./BgI--a6t.js";import{b as C}from"./CjqRYzcs.js";import{w as Ce}from"./DzEwxqd5.js";class Yt extends fe{constructor(e){if(!e||!e.target&&!e.$$inline)throw new Error("'target' is a required option");super();G(this,"$$prop_def");G(this,"$$events_def");G(this,"$$slot_def")}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}class Pe extends Yt{}const Ue=Object.freeze(Object.defineProperty({__proto__:null,SvelteComponent:Yt,SvelteComponentTyped:Pe,afterUpdate:ue,beforeUpdate:he,createEventDispatcher:de,getAllContexts:pe,getContext:me,hasContext:ge,onDestroy:_e,onMount:ye,setContext:we,tick:ht},Symbol.toStringTag,{value:"Module"}));class rt{constructor(a,e){this.status=a,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${a}`}}toString(){return JSON.stringify(this.body)}}class wt{constructor(a,e){this.status=a,this.location=e}}class vt extends Error{constructor(a,e,r){super(r),this.status=a,this.text=e}}const xe=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function je(t){const a=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${Oe(t).map(r=>{const n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(n)return a.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return a.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return ft(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return ft(String.fromCharCode(...c.slice(2).split("-").map(h=>parseInt(h,16))));const u=xe.exec(c),[,d,w,l,p]=u;return a.push({name:l,matcher:p,optional:!!d,rest:!!w,chained:w?f===1&&i[0]==="":!1}),w?"([^]*?)":d?"([^/]*)?":"([^/]+?)"}return ft(c)}).join("")}).join("")}/?$`),params:a}}function Ne(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function Oe(t){return t.slice(1).split("/").filter(Ne)}function $e(t,a,e){const r={},n=t.slice(1),o=n.filter(s=>s!==void 0);let i=0;for(let s=0;s<a.length;s+=1){const c=a[s];let f=n[s-i];if(c.chained&&c.rest&&i&&(f=n.slice(s-i,s+1).filter(u=>u).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||e[c.matcher](f)){r[c.name]=f;const u=a[s+1],d=n[s+1];u&&!u.rest&&u.optional&&d&&c.chained&&(i=0),!u&&!d&&Object.keys(r).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function ft(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function De({nodes:t,server_loads:a,dictionary:e,matchers:r}){const n=new Set(a);return Object.entries(e).map(([s,[c,f,u]])=>{const{pattern:d,params:w}=je(s),l={id:s,exec:p=>{const h=d.exec(p);if(h)return $e(h,w,r)},errors:[1,...u||[]].map(p=>t[p]),layouts:[0,...f||[]].map(i),leaf:o(c)};return l.errors.length=l.layouts.length=Math.max(l.errors.length,l.layouts.length),l});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[n.has(s),t[s]]}}function Gt(t,a=JSON.parse){try{return a(sessionStorage[t])}catch{}}function Ut(t,a,e=JSON.stringify){const r=e(a);try{sessionStorage[t]=r}catch{}}function Fe(t){const a=Be(t),e=new ArrayBuffer(a.length),r=new DataView(e);for(let n=0;n<e.byteLength;n++)r.setUint8(n,a.charCodeAt(n));return e}const Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Be(t){t.length%4===0&&(t=t.replace(/==?$/,""));let a="",e=0,r=0;for(let n=0;n<t.length;n++)e<<=6,e|=Me.indexOf(t[n]),r+=6,r===24&&(a+=String.fromCharCode((e&16711680)>>16),a+=String.fromCharCode((e&65280)>>8),a+=String.fromCharCode(e&255),e=r=0);return r===12?(e>>=4,a+=String.fromCharCode(e)):r===18&&(e>>=2,a+=String.fromCharCode((e&65280)>>8),a+=String.fromCharCode(e&255)),a}const qe=-1,Ke=-2,Ve=-3,He=-4,Ye=-5,Ge=-6;function We(t,a){if(typeof t=="number")return n(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,r=Array(e.length);function n(o,i=!1){if(o===qe)return;if(o===Ve)return NaN;if(o===He)return 1/0;if(o===Ye)return-1/0;if(o===Ge)return-0;if(i||typeof o!="number")throw new Error("Invalid input");if(o in r)return r[o];const s=e[o];if(!s||typeof s!="object")r[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=a==null?void 0:a[c];if(f)return r[o]=f(n(s[1]));switch(c){case"Date":r[o]=new Date(s[1]);break;case"Set":const u=new Set;r[o]=u;for(let l=1;l<s.length;l+=1)u.add(n(s[l]));break;case"Map":const d=new Map;r[o]=d;for(let l=1;l<s.length;l+=2)d.set(n(s[l]),n(s[l+1]));break;case"RegExp":r[o]=new RegExp(s[1],s[2]);break;case"Object":r[o]=Object(s[1]);break;case"BigInt":r[o]=BigInt(s[1]);break;case"null":const w=Object.create(null);r[o]=w;for(let l=1;l<s.length;l+=2)w[s[l]]=n(s[l+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const l=globalThis[c],p=new l(n(s[1]));r[o]=s[2]!==void 0?p.subarray(s[2],s[3]):p;break}case"ArrayBuffer":{const l=s[1],p=Fe(l);r[o]=p;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const l=c.slice(9);r[o]=Temporal[l].from(s[1]);break}case"URL":{const l=new URL(s[1]);r[o]=l;break}case"URLSearchParams":{const l=new URLSearchParams(s[1]);r[o]=l;break}default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(s.length);r[o]=c;for(let f=0;f<s.length;f+=1){const u=s[f];u!==Ke&&(c[f]=n(u))}}else{const c={};r[o]=c;for(const f in s){if(f==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const u=s[f];c[f]=n(u)}}return r[o]}return n(0)}function ze(t){return t.filter(a=>a!=null)}const Je="x-sveltekit-invalidated",Xe="x-sveltekit-trailing-slash";function J(t){return t instanceof rt||t instanceof vt?t.status:500}function Ze(t){return t instanceof vt?t.text:"Internal Error"}const Qe="/__data.json",ta=".html__data.json";function ea(t){return t.endsWith(".html")?t.replace(/\.html$/,ta):t.replace(/\/$/,"")+Qe}const xt={spanContext(){return aa},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}},aa={traceId:"",spanId:"",traceFlags:0},{tick:na}=Ue,ra=new Set(["icon","shortcut icon","apple-touch-icon"]),N=Gt(Ht)??{},H=Gt(Vt)??{},U={url:Pt({}),page:Pt({}),navigating:Ce(null),updated:ve()};function bt(t){N[t]=nt()}function oa(t,a){let e=t+1;for(;N[e];)delete N[e],e+=1;for(e=a+1;H[e];)delete H[e],e+=1}function F(t,a=!1){return a?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function Wt(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(C||"/");t&&await t.update()}}function jt(){}let Et,mt,X,P,gt,S;const Z=[],Q=[];let R=null;const W=new Map,zt=new Set,sa=new Set,q=new Set;let b={branch:[],error:null,url:null},St=!1,tt=!1,Nt=!0,Y=!1,B=!1,Jt=!1,kt=!1,Xt,A,T,j;const K=new Set,Ot=new Map;async function Aa(t,a,e){var o,i,s,c,f;globalThis.__sveltekit_otryqm.data&&((o=globalThis.__sveltekit_otryqm)==null||o.data),document.URL!==location.href&&(location.href=location.href),S=t,await((s=(i=t.hooks).init)==null?void 0:s.call(i)),Et=De(t),P=document.documentElement,gt=a,mt=t.nodes[0],X=t.nodes[1],mt(),X(),A=(c=history.state)==null?void 0:c[O],T=(f=history.state)==null?void 0:f[V],A||(A=T=Date.now(),history.replaceState({...history.state,[O]:A,[V]:T},""));const r=N[A];function n(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}e?(n(),await _a(gt,e)):(await $({type:"enter",url:Mt(S.hash?wa(new URL(location.href)):location.href),replace_state:!0}),n()),ga()}function ia(){Z.length=0,kt=!1}function Zt(t){Q.some(a=>a==null?void 0:a.snapshot)&&(H[t]=Q.map(a=>{var e;return(e=a==null?void 0:a.snapshot)==null?void 0:e.capture()}))}function Qt(t){var a;(a=H[t])==null||a.forEach((e,r)=>{var n,o;(o=(n=Q[r])==null?void 0:n.snapshot)==null||o.restore(e)})}function $t(){bt(A),Ut(Ht,N),Zt(T),Ut(Vt,H)}async function ca(t,a,e,r){let n;a.invalidateAll&&(R=null),await $({type:"goto",url:Mt(t),keepfocus:a.keepFocus,noscroll:a.noScroll,replace_state:a.replaceState,state:a.state,redirect_count:e,nav_token:r,accept:()=>{a.invalidateAll&&(kt=!0,n=[...Ot.keys()]),a.invalidate&&a.invalidate.forEach(ma)}}),a.invalidateAll&&ht().then(ht).then(()=>{Ot.forEach(({resource:o},i)=>{var s;n!=null&&n.includes(i)&&((s=o.refresh)==null||s.call(o))})})}async function la(t){if(t.id!==(R==null?void 0:R.id)){const a={};K.add(a),R={id:t.id,token:a,promise:ae({...t,preload:a}).then(e=>(K.delete(a),e.type==="loaded"&&e.state.error&&(R=null),e))}}return R.promise}async function ut(t){var e;const a=(e=await st(t,!1))==null?void 0:e.route;a&&await Promise.all([...a.layouts,a.leaf].map(r=>r==null?void 0:r[1]()))}function te(t,a,e){var n;b=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(L,t.props.page),Xt=new S.root({target:a,props:{...t.props,stores:U,components:Q},hydrate:e,sync:!1}),Qt(T),e){const o={from:null,to:{params:b.params,route:{id:((n=b.route)==null?void 0:n.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};q.forEach(i=>i(o))}tt=!0}function et({url:t,params:a,branch:e,status:r,error:n,route:o,form:i}){let s="never";if(C&&(t.pathname===C||t.pathname===C+"/"))s="always";else for(const l of e)(l==null?void 0:l.slash)!==void 0&&(s=l.slash);t.pathname=ke(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:a,branch:e,error:n,route:o},props:{constructors:ze(e).map(l=>l.node.component),page:Tt(L)}};i!==void 0&&(c.props.form=i);let f={},u=!L,d=0;for(let l=0;l<Math.max(e.length,b.branch.length);l+=1){const p=e[l],h=b.branch[l];(p==null?void 0:p.data)!==(h==null?void 0:h.data)&&(u=!0),p&&(f={...f,...p.data},u&&(c.props[`data_${d}`]=f),d+=1)}return(!b.url||t.href!==b.url.href||b.error!==n||i!==void 0&&i!==L.form||u)&&(c.props.page={error:n,params:a,route:{id:(o==null?void 0:o.id)??null},state:{},status:r,url:new URL(t),form:i??null,data:u?f:L.data}),c}async function At({loader:t,parent:a,url:e,params:r,route:n,server_data_node:o}){var u,d,w;let i=null,s=!0;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},f=await t();if((u=f.universal)!=null&&u.load){let l=function(...h){for(const m of h){const{href:g}=new URL(m,e);c.dependencies.add(g)}};const p={tracing:{enabled:!1,root:xt,current:xt},route:new Proxy(n,{get:(h,m)=>(s&&(c.route=!0),h[m])}),params:new Proxy(r,{get:(h,m)=>(s&&c.params.add(m),h[m])}),data:(o==null?void 0:o.data)??null,url:Se(e,()=>{s&&(c.url=!0)},h=>{s&&c.search_params.add(h)},S.hash),async fetch(h,m){h instanceof Request&&(m={body:h.method==="GET"||h.method==="HEAD"?void 0:await h.blob(),cache:h.cache,credentials:h.credentials,headers:[...h.headers].length>0?h==null?void 0: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,...m});const{resolved:g,promise:I}=ee(h,m,e);return s&&l(g.href),I},setHeaders:()=>{},depends:l,parent(){return s&&(c.parent=!0),a()},untrack(h){s=!1;try{return h()}finally{s=!0}}};i=await f.universal.load.call(null,p)??null}return{node:f,loader:t,server:o,universal:(d=f.universal)!=null&&d.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((w=f.universal)==null?void 0:w.trailingSlash)??(o==null?void 0:o.slash)}}function ee(t,a,e){let r=t instanceof Request?t.url:t;const n=new URL(r,e);n.origin===e.origin&&(r=n.href.slice(e.origin.length));const o=tt?Re(r,n.href,a):Te(r,a);return{resolved:n,promise:o}}function Dt(t,a,e,r,n,o){if(kt)return!0;if(!n)return!1;if(n.parent&&t||n.route&&a||n.url&&e)return!0;for(const i of n.search_params)if(r.has(i))return!0;for(const i of n.params)if(o[i]!==b.params[i])return!0;for(const i of n.dependencies)if(Z.some(s=>s(new URL(i))))return!0;return!1}function It(t,a){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?a??null:null}function fa(t,a){if(!t)return new Set(a.searchParams.keys());const e=new Set([...t.searchParams.keys(),...a.searchParams.keys()]);for(const r of e){const n=t.searchParams.getAll(r),o=a.searchParams.getAll(r);n.every(i=>o.includes(i))&&o.every(i=>n.includes(i))&&e.delete(r)}return e}function Ft({error:t,url:a,route:e,params:r}){return{type:"loaded",state:{error:t,url:a,route:e,params:r,branch:[]},props:{page:Tt(L),constructors:[]}}}async function ae({id:t,invalidating:a,url:e,params:r,route:n,preload:o}){if((R==null?void 0:R.id)===t)return K.delete(R.token),R.promise;const{errors:i,layouts:s,leaf:c}=n,f=[...s,c];i.forEach(y=>y==null?void 0:y().catch(()=>{})),f.forEach(y=>y==null?void 0:y[1]().catch(()=>{}));let u=null;const d=b.url?t!==at(b.url):!1,w=b.route?n.id!==b.route.id:!1,l=fa(b.url,e);let p=!1;const h=f.map((y,_)=>{var x;const v=b.branch[_],E=!!(y!=null&&y[0])&&((v==null?void 0:v.loader)!==y[1]||Dt(p,w,d,l,(x=v.server)==null?void 0:x.uses,r));return E&&(p=!0),E});if(h.some(Boolean)){try{u=await oe(e,h)}catch(y){const _=await D(y,{url:e,params:r,route:{id:t}});return K.has(o)?Ft({error:_,url:e,params:r,route:n}):ot({status:J(y),error:_,url:e,route:n})}if(u.type==="redirect")return u}const m=u==null?void 0:u.nodes;let g=!1;const I=f.map(async(y,_)=>{var it;if(!y)return;const v=b.branch[_],E=m==null?void 0:m[_];if((!E||E.type==="skip")&&y[1]===(v==null?void 0:v.loader)&&!Dt(g,w,d,l,(it=v.universal)==null?void 0:it.uses,r))return v;if(g=!0,(E==null?void 0:E.type)==="error")throw E;return At({loader:y[1],url:e,params:r,route:n,parent:async()=>{var Ct;const Lt={};for(let ct=0;ct<_;ct+=1)Object.assign(Lt,(Ct=await I[ct])==null?void 0:Ct.data);return Lt},server_data_node:It(E===void 0&&y[0]?{type:"skip"}:E??null,y[0]?v==null?void 0:v.server:void 0)})});for(const y of I)y.catch(()=>{});const k=[];for(let y=0;y<f.length;y+=1)if(f[y])try{k.push(await I[y])}catch(_){if(_ instanceof wt)return{type:"redirect",location:_.location};if(K.has(o))return Ft({error:await D(_,{params:r,url:e,route:{id:n.id}}),url:e,params:r,route:n});let v=J(_),E;if(m!=null&&m.includes(_))v=_.status??v,E=_.error;else if(_ instanceof rt)E=_.body;else{if(await U.updated.check())return await Wt(),await F(e);E=await D(_,{params:r,url:e,route:{id:n.id}})}const x=await ua(y,k,i);return x?et({url:e,params:r,branch:k.slice(0,x.idx).concat(x.node),status:v,error:E,route:n}):await re(e,{id:n.id},E,v)}else k.push(void 0);return et({url:e,params:r,branch:k,status:200,error:null,route:n,form:a?void 0:null})}async function ua(t,a,e){for(;t--;)if(e[t]){let r=t;for(;!a[r];)r-=1;try{return{idx:r+1,node:{node:await e[t](),loader:e[t],data:{},server:null,universal:null}}}catch{continue}}}async function ot({status:t,error:a,url:e,route:r}){const n={};let o=null;if(S.server_loads[0]===0)try{const s=await oe(e,[!0]);if(s.type!=="data"||s.nodes[0]&&s.nodes[0].type!=="data")throw 0;o=s.nodes[0]??null}catch{(e.origin!==Kt||e.pathname!==location.pathname||St)&&await F(e)}try{const s=await At({loader:mt,url:e,params:n,route:r,parent:()=>Promise.resolve({}),server_data_node:It(o)}),c={node:await X(),loader:X,universal:null,server:null,data:null};return et({url:e,params:n,branch:[s,c],status:t,error:a,route:null})}catch(s){if(s instanceof wt)return ca(new URL(s.location,location.href),{},0);throw s}}async function ha(t){const a=t.href;if(W.has(a))return W.get(a);let e;try{const r=(async()=>{let n=await S.hooks.reroute({url:new URL(t),fetch:async(o,i)=>ee(o,i,t).promise})??t;if(typeof n=="string"){const o=new URL(t);S.hash?o.hash=n:o.pathname=n,n=o}return n})();W.set(a,r),e=await r}catch{W.delete(a);return}return e}async function st(t,a){if(t&&!yt(t,C,S.hash)){const e=await ha(t);if(!e)return;const r=da(e);for(const n of Et){const o=n.exec(r);if(o)return{id:at(t),invalidating:a,route:n,params:Ee(o),url:t}}}}function da(t){return Ae(S.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(C.length))||"/"}function at(t){return(S.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function ne({url:t,type:a,intent:e,delta:r,event:n}){let o=!1;const i=Rt(b,e,t,a);r!==void 0&&(i.navigation.delta=r),n!==void 0&&(i.navigation.event=n);const s={...i.navigation,cancel:()=>{o=!0,i.reject(new Error("navigation cancelled"))}};return Y||zt.forEach(c=>c(s)),o?null:i}async function $({type:t,url:a,popped:e,keepfocus:r,noscroll:n,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=jt,block:u=jt,event:d}){const w=j;j=c;const l=await st(a,!1),p=t==="enter"?Rt(b,l,a,t):ne({url:a,type:t,delta:e==null?void 0:e.delta,intent:l,event:d});if(!p){u(),j===c&&(j=w);return}const h=A,m=T;f(),Y=!0,tt&&p.navigation.type!=="enter"&&U.navigating.set(dt.current=p.navigation);let g=l&&await ae(l);if(!g){if(yt(a,C,S.hash))return await F(a,o);g=await re(a,{id:null},await D(new vt(404,"Not Found",`Not found: ${a.pathname}`),{url:a,params:{},route:{id:null}}),404,o)}if(a=(l==null?void 0:l.url)||a,j!==c)return p.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(s<20){await $({type:t,url:new URL(g.location,a),popped:e,keepfocus:r,noscroll:n,replace_state:o,state:i,redirect_count:s+1,nav_token:c}),p.fulfil(void 0);return}g=await ot({status:500,error:await D(new Error("Redirect loop"),{url:a,params:{},route:{id:null}}),url:a,route:{id:null}})}else g.props.page.status>=400&&await U.updated.check()&&(await Wt(),await F(a,o));if(ia(),bt(h),Zt(m),g.props.page.url.pathname!==a.pathname&&(a.pathname=g.props.page.url.pathname),i=e?e.state:i,!e){const _=o?0:1,v={[O]:A+=_,[V]:T+=_,[qt]:i};(o?history.replaceState:history.pushState).call(history,v,"",a),o||oa(A,T)}if(R=null,g.props.page.state=i,tt){const _=(await Promise.all(Array.from(sa,v=>v(p.navigation)))).filter(v=>typeof v=="function");if(_.length>0){let v=function(){_.forEach(E=>{q.delete(E)})};_.push(v),_.forEach(E=>{q.add(E)})}b=g.state,g.props.page&&(g.props.page.url=a),Xt.$set(g.props),Le(g.props.page),Jt=!0}else te(g,gt,!1);const{activeElement:I}=document;await na();const k=e?e.scroll:n?nt():null;if(Nt){const _=a.hash&&document.getElementById(ie(a));k?scrollTo(k.x,k.y):_?_.scrollIntoView():scrollTo(0,0)}const y=document.activeElement!==I&&document.activeElement!==document.body;!r&&!y&&ya(a),Nt=!0,g.props.page&&Object.assign(L,g.props.page),Y=!1,t==="popstate"&&Qt(T),p.fulfil(void 0),q.forEach(_=>_(p.navigation)),U.navigating.set(dt.current=null)}async function re(t,a,e,r,n){return t.origin===Kt&&t.pathname===location.pathname&&!St?await ot({status:r,error:e,url:t,route:a}):await F(t,n)}function pa(){let t,a,e;P.addEventListener("mousemove",s=>{const c=s.target;clearTimeout(t),t=setTimeout(()=>{o(c,M.hover)},20)});function r(s){s.defaultPrevented||o(s.composedPath()[0],M.tap)}P.addEventListener("mousedown",r),P.addEventListener("touchstart",r,{passive:!0});const n=new IntersectionObserver(s=>{for(const c of s)c.isIntersecting&&(ut(new URL(c.target.href)),n.unobserve(c.target))},{threshold:0});async function o(s,c){const f=Bt(s,P),u=f===a&&c>=e;if(!f||u)return;const{url:d,external:w,download:l}=pt(f,C,S.hash);if(w||l)return;const p=z(f),h=d&&at(b.url)===at(d);if(!(p.reload||h))if(c<=p.preload_data){a=f,e=M.tap;const m=await st(d,!1);if(!m)return;la(m)}else c<=p.preload_code&&(a=f,e=c,ut(d))}function i(){n.disconnect();for(const s of P.querySelectorAll("a")){const{url:c,external:f,download:u}=pt(s,C,S.hash);if(f||u)continue;const d=z(s);d.reload||(d.preload_code===M.viewport&&n.observe(s),d.preload_code===M.eager&&ut(c))}}q.add(i),i()}function D(t,a){if(t instanceof rt)return t.body;const e=J(t),r=Ze(t);return S.hooks.handleError({error:t,event:a,status:e,message:r})??{message:r}}function ma(t){if(typeof t=="function")Z.push(t);else{const{href:a}=new URL(t,location.href);Z.push(e=>e.href===a)}}function ga(){var a;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if($t(),!Y){const n=Rt(b,void 0,null,"leave"),o={...n.navigation,cancel:()=>{r=!0,n.reject(new Error("navigation cancelled"))}};zt.forEach(i=>i(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&$t()}),(a=navigator.connection)!=null&&a.saveData||pa(),P.addEventListener("click",async e=>{if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Bt(e.composedPath()[0],P);if(!r)return;const{url:n,external:o,target:i,download:s}=pt(r,C,S.hash);if(!n)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=z(r);if(!(r instanceof SVGAElement)&&n.protocol!==location.protocol&&!(n.protocol==="https:"||n.protocol==="http:")||s)return;const[u,d]=(S.hash?n.hash.replace(/^#/,""):n.href).split("#"),w=u===lt(location);if(o||c.reload&&(!w||!d)){ne({url:n,type:"link",event:e})?Y=!0:e.preventDefault();return}if(d!==void 0&&w){const[,l]=b.url.href.split("#");if(l===d){if(e.preventDefault(),d===""||d==="top"&&r.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const p=r.ownerDocument.getElementById(decodeURIComponent(d));p&&(p.scrollIntoView(),p.focus())}return}if(B=!0,bt(A),t(n),!c.replace_state)return;B=!1}e.preventDefault(),await new Promise(l=>{requestAnimationFrame(()=>{setTimeout(l,0)}),setTimeout(l,100)}),await $({type:"link",url:n,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??n.href===location.href,event:e})}),P.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if(((n==null?void 0:n.formTarget)||r.target)==="_blank"||((n==null?void 0:n.formMethod)||r.method)!=="get")return;const s=new URL((n==null?void 0:n.hasAttribute("formaction"))&&(n==null?void 0:n.formAction)||r.action);if(yt(s,C,!1))return;const c=e.target,f=z(c);if(f.reload)return;e.preventDefault(),e.stopPropagation();const u=new FormData(c),d=n==null?void 0:n.getAttribute("name");d&&u.append(d,(n==null?void 0:n.getAttribute("value"))??""),s.search=new URLSearchParams(u).toString(),$({type:"form",url:s,keepfocus:f.keepfocus,noscroll:f.noscroll,replace_state:f.replace_state??s.href===location.href,event:e})}),addEventListener("popstate",async e=>{var r;if(!_t){if((r=e.state)!=null&&r[O]){const n=e.state[O];if(j={},n===A)return;const o=N[n],i=e.state[qt]??{},s=new URL(e.state[be]??location.href),c=e.state[V],f=b.url?lt(location)===lt(b.url):!1;if(c===T&&(Jt||f)){i!==L.state&&(L.state=i),t(s),N[A]=nt(),o&&scrollTo(o.x,o.y),A=n;return}const d=n-A;await $({type:"popstate",url:s,popped:{state:i,scroll:o,delta:d},accept:()=>{A=n,T=c},block:()=>{history.go(-d)},nav_token:j,event:e})}else if(!B){const n=new URL(location.href);t(n),S.hash&&location.reload()}}}),addEventListener("hashchange",()=>{B&&(B=!1,history.replaceState({...history.state,[O]:++A,[V]:T},"",location.href))});for(const e of document.querySelectorAll("link"))ra.has(e.rel)&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&U.navigating.set(dt.current=null)});function t(e){b.url=L.url=e,U.page.set(Tt(L)),U.page.notify()}}async function _a(t,{status:a=200,error:e,node_ids:r,params:n,route:o,server_route:i,data:s,form:c}){St=!0;const f=new URL(location.href);let u;({params:n={},route:o={id:null}}=await st(f,!1)||{}),u=Et.find(({id:l})=>l===o.id);let d,w=!0;try{const l=r.map(async(h,m)=>{const g=s[m];return g!=null&&g.uses&&(g.uses=se(g.uses)),At({loader:S.nodes[h],url:f,params:n,route:o,parent:async()=>{const I={};for(let k=0;k<m;k+=1)Object.assign(I,(await l[k]).data);return I},server_data_node:It(g)})}),p=await Promise.all(l);if(u){const h=u.layouts;for(let m=0;m<h.length;m++)h[m]||p.splice(m,0,void 0)}d=et({url:f,params:n,branch:p,status:a,error:e,form:c,route:u??null})}catch(l){if(l instanceof wt){await F(new URL(l.location,location.href));return}d=await ot({status:J(l),error:await D(l,{url:f,params:n,route:o}),url:f,route:o}),t.textContent="",w=!1}d.props.page&&(d.props.page.state={}),te(d,t,w)}async function oe(t,a){var o;const e=new URL(t);e.pathname=ea(t.pathname),t.pathname.endsWith("/")&&e.searchParams.append(Xe,"1"),e.searchParams.append(Je,a.map(i=>i?"1":"0").join(""));const r=window.fetch,n=await r(e.href,{});if(!n.ok){let i;throw(o=n.headers.get("content-type"))!=null&&o.includes("application/json")?i=await n.json():n.status===404?i="Not Found":n.status===500&&(i="Internal Error"),new rt(n.status,i)}return new Promise(async i=>{var d;const s=new Map,c=n.body.getReader();function f(w){return We(w,{...S.decoders,Promise:l=>new Promise((p,h)=>{s.set(l,{fulfil:p,reject:h})})})}let u="";for(;;){const{done:w,value:l}=await c.read();if(w&&!u)break;for(u+=!l&&u?`
`:Ie.decode(l,{stream:!0});;){const p=u.indexOf(`
`);if(p===-1)break;const h=JSON.parse(u.slice(0,p));if(u=u.slice(p+1),h.type==="redirect")return i(h);if(h.type==="data")(d=h.nodes)==null||d.forEach(m=>{(m==null?void 0:m.type)==="data"&&(m.uses=se(m.uses),m.data=f(m.data))}),i(h);else if(h.type==="chunk"){const{id:m,data:g,error:I}=h,k=s.get(m);s.delete(m),I?k.reject(f(I)):k.fulfil(f(g))}}}})}function se(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}let _t=!1;function ya(t){const a=document.querySelector("[autofocus]");if(a)a.focus();else{const e=ie(t);if(e&&document.getElementById(e)){const{x:n,y:o}=nt();setTimeout(()=>{const i=history.state;_t=!0,location.replace(`#${e}`),S.hash&&location.replace(t.hash),history.replaceState(i,"",t.hash),scrollTo(n,o),_t=!1})}else{const n=document.body,o=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),o!==null?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const n=[];for(let o=0;o<r.rangeCount;o+=1)n.push(r.getRangeAt(o));setTimeout(()=>{if(r.rangeCount===n.length){for(let o=0;o<r.rangeCount;o+=1){const i=n[o],s=r.getRangeAt(o);if(i.commonAncestorContainer!==s.commonAncestorContainer||i.startContainer!==s.startContainer||i.endContainer!==s.endContainer||i.startOffset!==s.startOffset||i.endOffset!==s.endOffset)return}r.removeAllRanges()}})}}}function Rt(t,a,e,r){var c,f;let n,o;const i=new Promise((u,d)=>{n=u,o=d});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(a==null?void 0:a.params)??null,route:{id:((f=a==null?void 0:a.route)==null?void 0:f.id)??null},url:e},willUnload:!a,type:r,complete:i},fulfil:n,reject:o}}function Tt(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 wa(t){const a=new URL(t);return a.hash=decodeURIComponent(t.hash),a}function ie(t){let a;if(S.hash){const[,,e]=t.hash.split("#",3);a=e??""}else a=t.hash.slice(1);return decodeURIComponent(a)}export{Aa as a,U as s};
