2 lines
22 KiB
JavaScript
2 lines
22 KiB
JavaScript
var Fe=Object.defineProperty;var Je=(n,e,t)=>e in n?Fe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ue=(n,e,t)=>(Je(n,typeof e!="symbol"?e+"":e,t),t);import{_ as M}from"./chunks/preload-helper-aa6bc0ce.js";import{S as Ge,i as He,s as Me,a as We,e as C,c as xe,b as G,g as re,t as B,d as ae,f as z,h as K,j as Xe,o as me,k as Ye,l as Qe,m as Ze,n as de,p as N,q as et,r as tt,u as nt,v as W,w as ye,x,y as X,z as De}from"./chunks/index-9ccab77c.js";import{g as Te,f as Ne,s as J,a as _e,i as rt}from"./chunks/singletons-42cd780d.js";import{s as at}from"./chunks/paths-6cd3a76e.js";class te{constructor(e,t){ue(this,"name","HttpError");ue(this,"stack");this.status=e,this.message=t!=null?t:`Error: ${e}`}toString(){return this.message}}class Ve{constructor(e,t){this.status=e,this.location=t}}function st(n,e){return n==="/"||e==="ignore"?n:e==="never"?n.endsWith("/")?n.slice(0,-1):n:e==="always"&&!n.endsWith("/")?n+"/":n}function ot(n){for(const e in n)n[e]=n[e].replace(/%23/g,"#").replace(/%3[Bb]/g,";").replace(/%2[Cc]/g,",").replace(/%2[Ff]/g,"/").replace(/%3[Ff]/g,"?").replace(/%3[Aa]/g,":").replace(/%40/g,"@").replace(/%26/g,"&").replace(/%3[Dd]/g,"=").replace(/%2[Bb]/g,"+").replace(/%24/g,"$");return n}const it=["href","pathname","search","searchParams","toString","toJSON"];function lt(n,e){const t=new URL(n);for(const o of it){let i=t[o];Object.defineProperty(t,o,{get(){return e(),i},enumerable:!0,configurable:!0})}return t[Symbol.for("nodejs.util.inspect.custom")]=(o,i,u)=>u(n,i),ct(t),t}function ct(n){Object.defineProperty(n,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}function ft(n){let e=5381,t=n.length;if(typeof n=="string")for(;t;)e=e*33^n.charCodeAt(--t);else for(;t;)e=e*33^n[--t];return(e>>>0).toString(36)}const be=window.fetch;window.fetch=(n,e)=>{if((n instanceof Request?n.method:(e==null?void 0:e.method)||"GET")!=="GET"){const o=new URL(n instanceof Request?n.url:n.toString(),document.baseURI).href;ne.delete(o)}return be(n,e)};const ne=new Map;function ut(n,e,t){let i=`script[data-sveltekit-fetched][data-url=${JSON.stringify(typeof n=="string"?n:n.url)}]`;t&&typeof t.body=="string"&&(i+=`[data-hash="${ft(t.body)}"]`);const u=document.querySelector(i);if(u!=null&&u.textContent){const{body:a,...l}=JSON.parse(u.textContent),g=u.getAttribute("data-ttl");return g&&ne.set(e,{body:a,init:l,ttl:1e3*Number(g)}),Promise.resolve(new Response(a,l))}return be(n,t)}function dt(n,e){const t=ne.get(n);if(t){if(performance.now()<t.ttl)return new Response(t.body,t.init);ne.delete(n)}return be(n,e)}const pt=/^(\.\.\.)?(\w+)(?:=(\w+))?$/;function ht(n){const e=[],t=[];let o=!0;if(/\]\[/.test(n))throw new Error(`Invalid route ${n} \u2014 parameters must be separated`);if(qe("[",n)!==qe("]",n))throw new Error(`Invalid route ${n} \u2014 brackets are unbalanced`);return{pattern:n===""?/^\/$/:new RegExp(`^${n.split(/(?:\/|$)/).filter(mt).map((u,a,l)=>{const g=decodeURIComponent(u),p=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(g);if(p)return e.push(p[1]),t.push(p[2]),"(?:/(.*))?";const b=a===l.length-1;return g&&"/"+g.split(/\[(.+?)\]/).map((S,R)=>{if(R%2){const F=pt.exec(S);if(!F)throw new Error(`Invalid param: ${S}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,O,T,V]=F;return e.push(T),t.push(V),O?"(.*?)":"([^/]+?)"}return b&&S.includes(".")&&(o=!1),S.normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}${o?"/?":""}$`),names:e,types:t}}function mt(n){return!/^\([^)]+\)$/.test(n)}function _t(n,e,t,o){const i={};for(let u=0;u<e.length;u+=1){const a=e[u],l=t[u],g=n[u+1]||"";if(l){const p=o[l];if(!p)throw new Error(`Missing "${l}" param matcher`);if(!p(g))return}i[a]=g}return i}function qe(n,e){let t=0;for(let o=0;o<e.length;o+=1)e[o]===n&&(t+=1);return t}function gt(n,e,t,o){const i=new Set(e);return Object.entries(t).map(([l,[g,p,b]])=>{const{pattern:S,names:R,types:F}=ht(l),O={id:l,exec:T=>{const V=S.exec(T);if(V)return _t(V,R,F,o)},errors:[1,...b||[]].map(T=>n[T]),layouts:[0,...p||[]].map(a),leaf:u(g)};return O.errors.length=O.layouts.length=Math.max(O.errors.length,O.layouts.length),O});function u(l){const g=l<0;return g&&(l=~l),[g,n[l]]}function a(l){return l===void 0?l:[i.has(l),n[l]]}}function wt(n,e){return new te(n,e)}function yt(n){let e,t,o;var i=n[0][0];function u(a){return{props:{data:a[1],errors:a[3]}}}return i&&(e=new i(u(n))),{c(){e&&W(e.$$.fragment),t=C()},l(a){e&&ye(e.$$.fragment,a),t=C()},m(a,l){e&&x(e,a,l),G(a,t,l),o=!0},p(a,l){const g={};if(l&2&&(g.data=a[1]),l&8&&(g.errors=a[3]),i!==(i=a[0][0])){if(e){re();const p=e;B(p.$$.fragment,1,0,()=>{X(p,1)}),ae()}i?(e=new i(u(a)),W(e.$$.fragment),z(e.$$.fragment,1),x(e,t.parentNode,t)):e=null}else i&&e.$set(g)},i(a){o||(e&&z(e.$$.fragment,a),o=!0)},o(a){e&&B(e.$$.fragment,a),o=!1},d(a){a&&K(t),e&&X(e,a)}}}function bt(n){let e,t,o;var i=n[0][0];function u(a){return{props:{data:a[1],errors:a[3],$$slots:{default:[vt]},$$scope:{ctx:a}}}}return i&&(e=new i(u(n))),{c(){e&&W(e.$$.fragment),t=C()},l(a){e&&ye(e.$$.fragment,a),t=C()},m(a,l){e&&x(e,a,l),G(a,t,l),o=!0},p(a,l){const g={};if(l&2&&(g.data=a[1]),l&8&&(g.errors=a[3]),l&525&&(g.$$scope={dirty:l,ctx:a}),i!==(i=a[0][0])){if(e){re();const p=e;B(p.$$.fragment,1,0,()=>{X(p,1)}),ae()}i?(e=new i(u(a)),W(e.$$.fragment),z(e.$$.fragment,1),x(e,t.parentNode,t)):e=null}else i&&e.$set(g)},i(a){o||(e&&z(e.$$.fragment,a),o=!0)},o(a){e&&B(e.$$.fragment,a),o=!1},d(a){a&&K(t),e&&X(e,a)}}}function vt(n){let e,t,o;var i=n[0][1];function u(a){return{props:{data:a[2],errors:a[3]}}}return i&&(e=new i(u(n))),{c(){e&&W(e.$$.fragment),t=C()},l(a){e&&ye(e.$$.fragment,a),t=C()},m(a,l){e&&x(e,a,l),G(a,t,l),o=!0},p(a,l){const g={};if(l&4&&(g.data=a[2]),l&8&&(g.errors=a[3]),i!==(i=a[0][1])){if(e){re();const p=e;B(p.$$.fragment,1,0,()=>{X(p,1)}),ae()}i?(e=new i(u(a)),W(e.$$.fragment),z(e.$$.fragment,1),x(e,t.parentNode,t)):e=null}else i&&e.$set(g)},i(a){o||(e&&z(e.$$.fragment,a),o=!0)},o(a){e&&B(e.$$.fragment,a),o=!1},d(a){a&&K(t),e&&X(e,a)}}}function Ce(n){let e,t=n[5]&&Be(n);return{c(){e=Ye("div"),t&&t.c(),this.h()},l(o){e=Qe(o,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var i=Ze(e);t&&t.l(i),i.forEach(K),this.h()},h(){de(e,"id","svelte-announcer"),de(e,"aria-live","assertive"),de(e,"aria-atomic","true"),N(e,"position","absolute"),N(e,"left","0"),N(e,"top","0"),N(e,"clip","rect(0 0 0 0)"),N(e,"clip-path","inset(50%)"),N(e,"overflow","hidden"),N(e,"white-space","nowrap"),N(e,"width","1px"),N(e,"height","1px")},m(o,i){G(o,e,i),t&&t.m(e,null)},p(o,i){o[5]?t?t.p(o,i):(t=Be(o),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(o){o&&K(e),t&&t.d()}}}function Be(n){let e;return{c(){e=et(n[6])},l(t){e=tt(t,n[6])},m(t,o){G(t,e,o)},p(t,o){o&64&&nt(e,t[6])},d(t){t&&K(e)}}}function kt(n){let e,t,o,i,u;const a=[bt,yt],l=[];function g(b,S){return b[0][1]?0:1}e=g(n),t=l[e]=a[e](n);let p=n[4]&&Ce(n);return{c(){t.c(),o=We(),p&&p.c(),i=C()},l(b){t.l(b),o=xe(b),p&&p.l(b),i=C()},m(b,S){l[e].m(b,S),G(b,o,S),p&&p.m(b,S),G(b,i,S),u=!0},p(b,[S]){let R=e;e=g(b),e===R?l[e].p(b,S):(re(),B(l[R],1,1,()=>{l[R]=null}),ae(),t=l[e],t?t.p(b,S):(t=l[e]=a[e](b),t.c()),z(t,1),t.m(o.parentNode,o)),b[4]?p?p.p(b,S):(p=Ce(b),p.c(),p.m(i.parentNode,i)):p&&(p.d(1),p=null)},i(b){u||(z(t),u=!0)},o(b){B(t),u=!1},d(b){l[e].d(b),b&&K(o),p&&p.d(b),b&&K(i)}}}function Et(n,e,t){let{stores:o}=e,{page:i}=e,{components:u}=e,{data_0:a=null}=e,{data_1:l=null}=e,{errors:g}=e;Xe(o.page.notify);let p=!1,b=!1,S=null;return me(()=>{const R=o.page.subscribe(()=>{p&&(t(5,b=!0),t(6,S=document.title||"untitled page"))});return t(4,p=!0),R}),n.$$set=R=>{"stores"in R&&t(7,o=R.stores),"page"in R&&t(8,i=R.page),"components"in R&&t(0,u=R.components),"data_0"in R&&t(1,a=R.data_0),"data_1"in R&&t(2,l=R.data_1),"errors"in R&&t(3,g=R.errors)},n.$$.update=()=>{n.$$.dirty&384&&o.page.set(i)},[u,a,l,g,p,b,S,o,i]}class Rt extends Ge{constructor(e){super(),He(this,e,Et,kt,Me,{stores:7,page:8,components:0,data_0:1,data_1:2,errors:3})}}const St={},se=[()=>M(()=>import("./chunks/0-042a909a.js"),["chunks/0-042a909a.js","chunks/_layout-fd68092a.js","components/pages/_layout.svelte-02aad86d.js","assets/_layout-45beedef.css","chunks/index-9ccab77c.js","chunks/paths-6cd3a76e.js","chunks/state-5021f75d.js","chunks/preload-helper-aa6bc0ce.js","chunks/theme-59471227.js"],import.meta.url),()=>M(()=>import("./chunks/1-368fa540.js"),["chunks/1-368fa540.js","components/error.svelte-0088604d.js","chunks/index-9ccab77c.js","chunks/singletons-42cd780d.js","chunks/paths-6cd3a76e.js"],import.meta.url),()=>M(()=>import("./chunks/2-c321b7f6.js"),["chunks/2-c321b7f6.js","components/pages/_page.svelte-c53df8eb.js","chunks/index-9ccab77c.js","chunks/singletons-42cd780d.js","chunks/paths-6cd3a76e.js"],import.meta.url),()=>M(()=>import("./chunks/3-72873184.js"),["chunks/3-72873184.js","components/pages/edit/_page.svelte-a1d1f40e.js","assets/_page-826332b8.css","chunks/index-9ccab77c.js","chunks/state-5021f75d.js","chunks/preload-helper-aa6bc0ce.js","chunks/theme-59471227.js","chunks/view-c43c86f9.js","assets/view-0c536ccf.css","chunks/paths-6cd3a76e.js"],import.meta.url),()=>M(()=>import("./chunks/4-a9c36397.js"),["chunks/4-a9c36397.js","components/pages/view/_page.svelte-761295f3.js","chunks/index-9ccab77c.js","chunks/view-c43c86f9.js","assets/view-0c536ccf.css","chunks/state-5021f75d.js","chunks/preload-helper-aa6bc0ce.js"],import.meta.url)],Lt=[],$t={"":[2],edit:[3],view:[4]},Pt="/__data.js",Ke="sveltekit:scroll",q="sveltekit:index",pe=gt(se,Lt,$t,St),ge=se[0],we=se[1];ge();we();let Q={};try{Q=JSON.parse(sessionStorage[Ke])}catch{}function he(n){Q[n]=_e()}function Ot({target:n,base:e,trailing_slash:t}){var je;const o=[],i={id:null,promise:null},u={before_navigate:[],after_navigate:[]};let a={branch:[],error:null,session_id:0,url:null},l=!1,g=!0,p=!1,b=1,S=null,R=!1,F,O=(je=history.state)==null?void 0:je[q];O||(O=Date.now(),history.replaceState({...history.state,[q]:O},"",location.href));const T=Q[O];T&&(history.scrollRestoration="manual",scrollTo(T.x,T.y));let V=!1,H,ve;function ke(){return S||(S=Promise.resolve().then(async()=>{await Se(new URL(location.href),[]),S=null,R=!1})),S}async function Ee(r,{noscroll:c=!1,replaceState:d=!1,keepfocus:s=!1,state:f={}},v){return typeof r=="string"&&(r=new URL(r,Te(document))),le({url:r,scroll:c?_e():null,keepfocus:s,redirect_chain:v,details:{state:f,replaceState:d},accepted:()=>{},blocked:()=>{}})}async function Re(r){const c=Oe(r);if(!c)throw new Error("Attempted to prefetch a URL that does not belong to this app");return i.promise=Pe(c),i.id=c.id,i.promise}async function Se(r,c,d,s){var E,k;const f=Oe(r),v=ve={};let w=f&&await Pe(f);if(!w&&r.origin===location.origin&&r.pathname===location.pathname&&(w=await ee({status:404,error:new Error(`Not found: ${r.pathname}`),url:r,routeId:null})),!w)return await Y(r),!1;if(r=(f==null?void 0:f.url)||r,ve!==v)return!1;if(o.length=0,w.type==="redirect")if(c.length>10||c.includes(r.pathname))w=await ee({status:500,error:new Error("Redirect loop"),url:r,routeId:null});else return Ee(new URL(w.location,r).href,{},[...c,r.pathname]),!1;else((k=(E=w.props)==null?void 0:E.page)==null?void 0:k.status)>=400&&await J.updated.check()&&await Y(r);if(p=!0,d&&d.details){const{details:m}=d,y=m.replaceState?0:1;m.state[q]=O+=y,history[m.replaceState?"replaceState":"pushState"](m.state,"",r)}if(l?(a=w.state,w.props.page&&(w.props.page.url=r),F.$set(w.props)):Le(w),d){const{scroll:m,keepfocus:y}=d;if(!y){const P=document.body,U=P.getAttribute("tabindex");P.tabIndex=-1,P.focus({preventScroll:!0}),setTimeout(()=>{var $;($=getSelection())==null||$.removeAllRanges()}),U!==null?P.setAttribute("tabindex",U):P.removeAttribute("tabindex")}if(await De(),g){const P=r.hash&&document.getElementById(r.hash.slice(1));m?scrollTo(m.x,m.y):P?P.scrollIntoView():scrollTo(0,0)}}else await De();i.promise=null,i.id=null,g=!0,w.props.page&&(H=w.props.page),s&&s(),p=!1}function Le(r){a=r.state;const c=document.querySelector("style[data-sveltekit]");c&&c.remove(),H=r.props.page,F=new Rt({target:n,props:{...r.props,stores:J},hydrate:!0});const d={from:null,to:new URL(location.href)};u.after_navigate.forEach(s=>s(d)),l=!0}async function Z({url:r,params:c,branch:d,status:s,error:f,routeId:v,validation_errors:w}){var U;const E=d.filter(Boolean),k={type:"loaded",state:{url:r,params:c,branch:d,error:f,session_id:b},props:{components:E.map($=>$.node.component),errors:w}};let m={},y=!H;for(let $=0;$<E.length;$+=1){const j=E[$];m={...m,...j.data},(y||!a.branch.some(h=>h===j))&&(k.props[`data_${$}`]=m,y=y||Object.keys((U=j.data)!=null?U:{}).length>0)}if(y||(y=Object.keys(H.data).length!==Object.keys(m).length),!a.url||r.href!==a.url.href||a.error!==f||y){k.props.page={error:f,params:c,routeId:v,status:s,url:r,data:y?m:H.data};const $=(j,h)=>{Object.defineProperty(k.props.page,j,{get:()=>{throw new Error(`$page.${j} has been replaced by $page.url.${h}`)}})};$("origin","origin"),$("path","pathname"),$("query","searchParams")}return k}async function oe({loader:r,parent:c,url:d,params:s,routeId:f,server_data_node:v}){var m,y,P,U,$;let w=null;const E={dependencies:new Set,params:new Set,parent:!1,url:!1},k=await r();if((m=k.shared)!=null&&m.load){let j=function(..._){for(const L of _){const{href:I}=new URL(L,d);E.dependencies.add(I)}};const h={};for(const _ in s)Object.defineProperty(h,_,{get(){return E.params.add(_),s[_]},enumerable:!0});const A={routeId:f,params:h,data:(y=v==null?void 0:v.data)!=null?y:null,url:lt(d,()=>{E.url=!0}),async fetch(_,L){let I;typeof _=="string"?I=_:(I=_.url,L={body:_.method==="GET"||_.method==="HEAD"?void 0:await _.blob(),cache:_.cache,credentials:_.credentials,headers:_.headers,integrity:_.integrity,keepalive:_.keepalive,method:_.method,mode:_.mode,redirect:_.redirect,referrer:_.referrer,referrerPolicy:_.referrerPolicy,signal:_.signal,...L});const D=new URL(I,d).href;return j(D),l?dt(D,L):ut(I,D,L)},setHeaders:()=>{},depends:j,parent(){return E.parent=!0,c()}};Object.defineProperties(A,{props:{get(){throw new Error("@migration task: Replace `props` with `data` stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1},session:{get(){throw new Error("session is no longer available. See https://github.com/sveltejs/kit/discussions/5883")},enumerable:!1},stuff:{get(){throw new Error("@migration task: Remove stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1}}),w=(P=await k.shared.load.call(null,A))!=null?P:null}return{node:k,loader:r,server:v,shared:(U=k.shared)!=null&&U.load?{type:"data",data:w,uses:E}:null,data:($=w!=null?w:v==null?void 0:v.data)!=null?$:null}}function $e(r,c,d){if(R)return!0;if(!d)return!1;if(d.parent&&c||r.url&&d.url)return!0;for(const s of r.params)if(d.params.has(s))return!0;for(const s of d.dependencies)if(o.some(f=>f(new URL(s))))return!0;return!1}function ie(r,c){var d,s;return(r==null?void 0:r.type)==="data"?{type:"data",data:r.data,uses:{dependencies:new Set((d=r.uses.dependencies)!=null?d:[]),params:new Set((s=r.uses.params)!=null?s:[]),parent:!!r.uses.parent,url:!!r.uses.url}}:(r==null?void 0:r.type)==="skip"&&c!=null?c:null}async function Pe({id:r,url:c,params:d,route:s}){if(i.id===r&&i.promise)return i.promise;const{errors:f,layouts:v,leaf:w}=s,E=a.url&&{url:r!==a.url.pathname+a.url.search,params:Object.keys(d).filter(h=>a.params[h]!==d[h])},k=[...v,w];f.forEach(h=>h==null?void 0:h().catch(()=>{})),k.forEach(h=>h==null?void 0:h[1]().catch(()=>{}));let m=null;const y=k.reduce((h,A,_)=>{var D;const L=a.branch[_],I=!!(A!=null&&A[0])&&((L==null?void 0:L.loader)!==A[1]||$e(E,h.some(Boolean),(D=L.server)==null?void 0:D.uses));return h.push(I),h},[]);if(y.some(Boolean)){try{m=await ze(c,y)}catch(h){return ee({status:500,error:h,url:c,routeId:s.id})}if(m.type==="redirect")return m}const P=m==null?void 0:m.nodes;let U=!1;const $=k.map(async(h,A)=>{var ce,Ae;if(!h)return;const _=a.branch[A],L=(ce=P==null?void 0:P[A])!=null?ce:null;if((!L||L.type==="skip")&&h[1]===(_==null?void 0:_.loader)&&!$e(E,U,(Ae=_.shared)==null?void 0:Ae.uses))return _;if(U=!0,(L==null?void 0:L.type)==="error")throw L.httperror?wt(L.httperror.status,L.httperror.message):L.error;return oe({loader:h[1],url:c,params:d,routeId:s.id,parent:async()=>{var Ie;const Ue={};for(let fe=0;fe<A;fe+=1)Object.assign(Ue,(Ie=await $[fe])==null?void 0:Ie.data);return Ue},server_data_node:ie(L,_==null?void 0:_.server)})});for(const h of $)h.catch(()=>{});const j=[];for(let h=0;h<k.length;h+=1)if(k[h])try{j.push(await $[h])}catch(A){const _=A;if(_ instanceof Ve)return{type:"redirect",location:_.location};const L=A instanceof te?A.status:500;for(;h--;)if(f[h]){let I,D=h;for(;!j[D];)D-=1;try{return I={node:await f[h](),loader:f[h],data:{},server:null,shared:null},await Z({url:c,params:d,branch:j.slice(0,D+1).concat(I),status:L,error:_,routeId:s.id})}catch{continue}}await Y(c);return}else j.push(void 0);return await Z({url:c,params:d,branch:j,status:200,error:null,routeId:s.id})}async function ee({status:r,error:c,url:d,routeId:s}){var m;const f={},v=await ge();let w=null;if(v.server)try{const y=await ze(d,[!0]);if(y.type!=="data"||y.nodes[0]&&y.nodes[0].type!=="data")throw 0;w=(m=y.nodes[0])!=null?m:null}catch{await Y(d);return}const E=await oe({loader:ge,url:d,params:f,routeId:s,parent:()=>Promise.resolve({}),server_data_node:ie(w)}),k={node:await we(),loader:we,shared:null,server:null,data:null};return await Z({url:d,params:f,branch:[E,k],status:r,error:c,routeId:s})}function Oe(r){if(r.origin!==location.origin||!r.pathname.startsWith(e))return;const c=decodeURI(r.pathname.slice(e.length)||"/");for(const d of pe){const s=d.exec(c);if(s){const f=new URL(r.origin+st(r.pathname,t)+r.search+r.hash);return{id:f.pathname+f.search,route:d,params:ot(s),url:f}}}}async function le({url:r,scroll:c,keepfocus:d,redirect_chain:s,details:f,accepted:v,blocked:w}){const E=a.url;let k=!1;const m={from:E,to:r,cancel:()=>k=!0};if(u.before_navigate.forEach(y=>y(m)),k){w();return}he(O),v(),l&&J.navigating.set({from:a.url,to:r}),await Se(r,s,{scroll:c,keepfocus:d,details:f},()=>{const y={from:E,to:r};u.after_navigate.forEach(P=>P(y)),J.navigating.set(null)})}function Y(r){return location.href=r.href,new Promise(()=>{})}return{after_navigate:r=>{me(()=>(u.after_navigate.push(r),()=>{const c=u.after_navigate.indexOf(r);u.after_navigate.splice(c,1)}))},before_navigate:r=>{me(()=>(u.before_navigate.push(r),()=>{const c=u.before_navigate.indexOf(r);u.before_navigate.splice(c,1)}))},disable_scroll_handling:()=>{(p||!l)&&(g=!1)},goto:(r,c={})=>Ee(r,c,[]),invalidate:r=>{if(r===void 0)throw new Error("`invalidate()` (with no arguments) has been replaced by `invalidateAll()`");if(typeof r=="function")o.push(r);else{const{href:c}=new URL(r,location.href);o.push(d=>d.href===c)}return ke()},invalidateAll:()=>(R=!0,ke()),prefetch:async r=>{const c=new URL(r,Te(document));await Re(c)},prefetch_routes:async r=>{const d=(r?pe.filter(s=>r.some(f=>s.exec(f))):pe).map(s=>Promise.all([...s.layouts,s.leaf].map(f=>f==null?void 0:f[1]())));await Promise.all(d)},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",s=>{let f=!1;const v={from:a.url,to:null,cancel:()=>f=!0};u.before_navigate.forEach(w=>w(v)),f?(s.preventDefault(),s.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){he(O);try{sessionStorage[Ke]=JSON.stringify(Q)}catch{}}});const r=s=>{const{url:f,options:v}=Ne(s);f&&v.prefetch===""&&Re(f)};let c;const d=s=>{clearTimeout(c),c=setTimeout(()=>{var f;(f=s.target)==null||f.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",r),addEventListener("mousemove",d),addEventListener("sveltekit:trigger_prefetch",r),addEventListener("click",s=>{if(s.button||s.which!==1||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||s.defaultPrevented)return;const{a:f,url:v,options:w}=Ne(s);if(!f||!v)return;const E=f instanceof SVGAElement;if(!E&&!(v.protocol==="https:"||v.protocol==="http:"))return;const k=(f.getAttribute("rel")||"").split(/\s+/);if(f.hasAttribute("download")||k.includes("external")||w.reload===""||(E?f.target.baseVal:f.target))return;const[m,y]=v.href.split("#");if(y!==void 0&&m===location.href.split("#")[0]){V=!0,he(O),J.page.set({...H,url:v}),J.page.notify();return}le({url:v,scroll:w.noscroll===""?_e():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:v.href===location.href},accepted:()=>s.preventDefault(),blocked:()=>s.preventDefault()})}),addEventListener("popstate",s=>{if(s.state){if(s.state[q]===O)return;le({url:new URL(location.href),scroll:Q[s.state[q]],keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{O=s.state[q]},blocked:()=>{const f=O-s.state[q];history.go(f)}})}}),addEventListener("hashchange",()=>{V&&(V=!1,history.replaceState({...history.state,[q]:++O},"",location.href))});for(const s of document.querySelectorAll("link"))s.rel==="icon"&&(s.href=s.href);addEventListener("pageshow",s=>{s.persisted&&J.navigating.set(null)})},_hydrate:async({status:r,error:c,node_ids:d,params:s,routeId:f,data:v,errors:w})=>{const E=new URL(location.href);let k;try{const m=d.map(async(y,P)=>{const U=v[P];return oe({loader:se[y],url:E,params:s,routeId:f,parent:async()=>{const $={};for(let j=0;j<P;j+=1)Object.assign($,(await m[j]).data);return $},server_data_node:ie(U)})});k=await Z({url:E,params:s,branch:await Promise.all(m),status:r,error:c!=null&&c.__is_http_error?new te(c.status,c.message):c,validation_errors:w,routeId:f})}catch(m){const y=m;if(y instanceof Ve){await Y(new URL(m.location,location.href));return}k=await ee({status:y instanceof te?y.status:500,error:y,url:E,routeId:f})}Le(k)}}}let jt=1;async function ze(n,e){const t=new URL(n);t.pathname=n.pathname.replace(/\/$/,"")+Pt,t.searchParams.set("__invalid",e.map(i=>i?"y":"n").join("")),t.searchParams.set("__id",String(jt++)),await M(()=>import(t.href),[],import.meta.url);const o=window.__sveltekit_data;return delete window.__sveltekit_data,o}async function Nt({env:n,hydrate:e,paths:t,target:o,trailing_slash:i}){at(t);const u=Ot({target:o,base:t.base,trailing_slash:i});rt({client:u}),e?await u._hydrate(e):u.goto(location.href,{replaceState:!0}),u._start_router()}export{Nt as start};
|