var re=Object.defineProperty,ne=Object.defineProperties;var ie=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var M=(n,e,t)=>e in n?re(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,A=(n,e)=>{for(var t in e||(e={}))J.call(e,t)&&M(n,t,e[t]);if(B)for(var t of B(e))G.call(e,t)&&M(n,t,e[t]);return n},Y=(n,e)=>ne(n,ie(e));var X=(n,e)=>{var t={};for(var r in n)J.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&B)for(var r of B(n))e.indexOf(r)<0&&G.call(n,r)&&(t[r]=n[r]);return t};import{S as ae,i as oe,s as le,e as ce,c as fe,a as ue,d as y,b as K,f as k,t as he,g as de,h as _e,j as pe,k as m,l as me,m as T,n as g,o as j,p as w,q as ge,r as we,u as be,v as E,w as O,x as R,y as C,z as I,A as L,B as V,C as W}from"./chunks/vendor-92f01141.js";function ve(n){let e,t,r;const l=[n[1]||{}];var i=n[0][0];function a(s){let o={};for(let c=0;c{L(f,1)}),j()}i?(e=new i(a()),E(e.$$.fragment),w(e.$$.fragment,1),R(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&L(e,s)}}}function ye(n){let e,t,r;const l=[n[1]||{}];var i=n[0][0];function a(s){let o={$$slots:{default:[Re]},$$scope:{ctx:s}};for(let c=0;c{L(f,1)}),j()}i?(e=new i(a(s)),E(e.$$.fragment),w(e.$$.fragment,1),R(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&L(e,s)}}}function $e(n){let e,t,r;const l=[n[2]||{}];var i=n[0][1];function a(s){let o={};for(let c=0;c{L(f,1)}),j()}i?(e=new i(a()),E(e.$$.fragment),w(e.$$.fragment,1),R(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&L(e,s)}}}function ke(n){let e,t,r;const l=[n[2]||{}];var i=n[0][1];function a(s){let o={$$slots:{default:[Ee]},$$scope:{ctx:s}};for(let c=0;c{L(f,1)}),j()}i?(e=new i(a(s)),E(e.$$.fragment),w(e.$$.fragment,1),R(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&L(e,s)}}}function Ee(n){let e,t,r;const l=[n[3]||{}];var i=n[0][2];function a(s){let o={};for(let c=0;c{L(f,1)}),j()}i?(e=new i(a()),E(e.$$.fragment),w(e.$$.fragment,1),R(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&L(e,s)}}}function Re(n){let e,t,r,l;const i=[ke,$e],a=[];function s(o,c){return o[0][2]?0:1}return e=s(n),t=a[e]=i[e](n),{c(){t.c(),r=m()},l(o){t.l(o),r=m()},m(o,c){a[e].m(o,c),k(o,r,c),l=!0},p(o,c){let f=e;e=s(o),e===f?a[e].p(o,c):(T(),g(a[f],1,1,()=>{a[f]=null}),j(),t=a[e],t?t.p(o,c):(t=a[e]=i[e](o),t.c()),w(t,1),t.m(r.parentNode,r))},i(o){l||(w(t),l=!0)},o(o){g(t),l=!1},d(o){a[e].d(o),o&&y(r)}}}function F(n){let e,t=n[5]&&H(n);return{c(){e=ce("div"),t&&t.c(),this.h()},l(r){e=fe(r,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,class:!0});var l=ue(e);t&&t.l(l),l.forEach(y),this.h()},h(){K(e,"id","svelte-announcer"),K(e,"aria-live","assertive"),K(e,"aria-atomic","true"),K(e,"class","svelte-1j55zn5")},m(r,l){k(r,e,l),t&&t.m(e,null)},p(r,l){r[5]?t?t.p(r,l):(t=H(r),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(r){r&&y(e),t&&t.d()}}}function H(n){let e;return{c(){e=he(n[6])},l(t){e=de(t,n[6])},m(t,r){k(t,e,r)},p(t,r){r&64&&_e(e,t[6])},d(t){t&&y(e)}}}function Le(n){let e,t,r,l,i;const a=[ye,ve],s=[];function o(f,h){return f[0][1]?0:1}e=o(n),t=s[e]=a[e](n);let c=n[4]&&F(n);return{c(){t.c(),r=pe(),c&&c.c(),l=m()},l(f){t.l(f),r=me(f),c&&c.l(f),l=m()},m(f,h){s[e].m(f,h),k(f,r,h),c&&c.m(f,h),k(f,l,h),i=!0},p(f,[h]){let u=e;e=o(f),e===u?s[e].p(f,h):(T(),g(s[u],1,1,()=>{s[u]=null}),j(),t=s[e],t?t.p(f,h):(t=s[e]=a[e](f),t.c()),w(t,1),t.m(r.parentNode,r)),f[4]?c?c.p(f,h):(c=F(f),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null)},i(f){i||(w(t),i=!0)},o(f){g(t),i=!1},d(f){s[e].d(f),f&&y(r),c&&c.d(f),f&&y(l)}}}function Se(n,e,t){let{stores:r}=e,{page:l}=e,{components:i}=e,{props_0:a=null}=e,{props_1:s=null}=e,{props_2:o=null}=e;ge("__svelte__",r),we(r.page.notify);let c=!1,f=!1,h=null;return be(()=>{const u=r.page.subscribe(()=>{c&&(t(5,f=!0),t(6,h=document.title||"untitled page"))});return t(4,c=!0),u}),n.$$set=u=>{"stores"in u&&t(7,r=u.stores),"page"in u&&t(8,l=u.page),"components"in u&&t(0,i=u.components),"props_0"in u&&t(1,a=u.props_0),"props_1"in u&&t(2,s=u.props_1),"props_2"in u&&t(3,o=u.props_2)},n.$$.update=()=>{n.$$.dirty&384&&r.page.set(l)},[i,a,s,o,c,f,h,r,l]}class Ue extends ae{constructor(e){super();oe(this,e,Se,Le,le,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}const Ae="modulepreload",Q={},Pe="/_app/",D=function(e,t){return!t||t.length===0?e():Promise.all(t.map(r=>{if(r=`${Pe}${r}`,r in Q)return;Q[r]=!0;const l=r.endsWith(".css"),i=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${i}`))return;const a=document.createElement("link");if(a.rel=l?"stylesheet":Ae,l||(a.as="script",a.crossOrigin=""),a.href=r,document.head.appendChild(a),l)return new Promise((s,o)=>{a.addEventListener("load",s),a.addEventListener("error",o)})})).then(()=>e())},$=[()=>D(()=>import("./pages/__layout.svelte-cb26f3b2.js"),["pages/__layout.svelte-cb26f3b2.js","assets/pages/__layout.svelte-a7861b78.css","chunks/vendor-92f01141.js"]),()=>D(()=>import("./error.svelte-b65a9f21.js"),["error.svelte-b65a9f21.js","chunks/vendor-92f01141.js"]),()=>D(()=>import("./pages/index.svelte-f4f814c9.js"),["pages/index.svelte-f4f814c9.js","assets/pages/index.svelte-c63fe1c6.css","chunks/vendor-92f01141.js"]),()=>D(()=>import("./pages/about.svelte-2d51dc8e.js"),["pages/about.svelte-2d51dc8e.js","assets/pages/about.svelte-bf4528fa.css","chunks/vendor-92f01141.js"]),()=>D(()=>import("./pages/todos/index.svelte-7b9fa284.js"),["pages/todos/index.svelte-7b9fa284.js","assets/pages/todos/index.svelte-784042c1.css","chunks/vendor-92f01141.js"])],Te=[[/^\/$/,[$[0],$[2]],[$[1]]],[/^\/about\/?$/,[$[0],$[3]],[$[1]]],,[/^\/todos\/?$/,[$[0],$[4]],[$[1]]]],je=[$[0](),$[1]()];function Ne(n){let e=n.baseURI;if(!e){const t=n.getElementsByTagName("base");e=t.length?t[0].href:n.URL}return e}let Z="";function Oe(n){Z=n.base,n.assets}function z(){return{x:pageXOffset,y:pageYOffset}}function x(n){return n.composedPath().find(t=>t instanceof Node&&t.nodeName.toUpperCase()==="A")}function ee(n){return n instanceof SVGAElement?new URL(n.href.baseVal,document.baseURI):new URL(n.href)}class Ce{constructor({base:e,routes:t,trailing_slash:r,renderer:l}){this.base=e,this.routes=t,this.trailing_slash=r,this.navigating=0,this.renderer=l,l.router=this,this.enabled=!0,document.body.setAttribute("tabindex","-1"),history.replaceState(history.state||{},"",location.href)}init_listeners(){"scrollRestoration"in history&&(history.scrollRestoration="manual"),addEventListener("beforeunload",()=>{history.scrollRestoration="auto"}),addEventListener("load",()=>{history.scrollRestoration="manual"});let e;addEventListener("scroll",()=>{clearTimeout(e),e=setTimeout(()=>{const i=Y(A({},history.state||{}),{"sveltekit:scroll":z()});history.replaceState(i,document.title,window.location.href)},200)});const t=i=>{const a=x(i);a&&a.href&&a.hasAttribute("sveltekit:prefetch")&&this.prefetch(ee(a))};let r;const l=i=>{clearTimeout(r),r=setTimeout(()=>{var a;(a=i.target)==null||a.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",t),addEventListener("mousemove",l),addEventListener("sveltekit:trigger_prefetch",t),addEventListener("click",i=>{if(!this.enabled||i.button||i.which!==1||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey||i.defaultPrevented)return;const a=x(i);if(!a||!a.href)return;const s=ee(a);if(s.toString()===location.href){location.hash||i.preventDefault();return}const c=(a.getAttribute("rel")||"").split(/\s+/);if(a.hasAttribute("download")||c&&c.includes("external")||(a instanceof SVGAElement?a.target.baseVal:a.target)||!this.owns(s))return;if(s.href.split("#")[0]===location.href.split("#")[0]){setTimeout(()=>history.pushState({},"",s.href));return}history.pushState({},"",s.href);const f=a.hasAttribute("sveltekit:noscroll");this._navigate(s,f?z():null,!1,[],s.hash),i.preventDefault()}),addEventListener("popstate",i=>{if(i.state&&this.enabled){const a=new URL(location.href);this._navigate(a,i.state["sveltekit:scroll"],!1,[])}})}owns(e){return e.origin===location.origin&&e.pathname.startsWith(this.base)}parse(e){if(this.owns(e)){const t=decodeURI(e.pathname.slice(this.base.length)||"/");return{id:e.pathname+e.search,routes:this.routes.filter(([r])=>r.test(t)),url:e,path:t}}}async goto(e,{noscroll:t=!1,replaceState:r=!1,keepfocus:l=!1,state:i={}}={},a){const s=new URL(e,Ne(document));return this.enabled&&this.owns(s)?(history[r?"replaceState":"pushState"](i,"",e),this._navigate(s,t?z():null,l,a,s.hash)):(location.href=s.href,new Promise(()=>{}))}enable(){this.enabled=!0}disable(){this.enabled=!1}async prefetch(e){const t=this.parse(e);if(!t)throw new Error("Attempted to prefetch a URL that does not belong to this app");return this.renderer.load(t)}async _navigate(e,t,r,l,i){const a=this.parse(e);if(!a)throw new Error("Attempted to navigate to a URL that does not belong to this app");this.navigating||dispatchEvent(new CustomEvent("sveltekit:navigation-start")),this.navigating++;let{pathname:s}=e;this.trailing_slash==="never"?s!=="/"&&s.endsWith("/")&&(s=s.slice(0,-1)):this.trailing_slash==="always"&&!e.pathname.split("/").pop().includes(".")&&!s.endsWith("/")&&(s+="/"),a.url=new URL(e.origin+s+e.search+e.hash),history.replaceState({},"",a.url),await this.renderer.handle_navigation(a,l,!1,{hash:i,scroll:t,keepfocus:r}),this.navigating--,this.navigating||dispatchEvent(new CustomEvent("sveltekit:navigation-end"))}}function te(n){return n instanceof Error||n&&n.name&&n.message?n:new Error(JSON.stringify(n))}function Ie(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)}function Ve(n){const e=n.status&&n.status>=400&&n.status<=599&&!n.redirect;if(n.error||e){const t=n.status;if(!n.error&&e)return{status:t||500,error:new Error};const r=typeof n.error=="string"?new Error(n.error):n.error;return r instanceof Error?!t||t<400||t>599?(console.warn('"error" returned from load() without a valid status code \u2014 defaulting to 500'),{status:500,error:r}):{status:t,error:r}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof r}"`)}}if(n.redirect){if(!n.status||Math.floor(n.status/100)!==3)return{status:500,error:new Error('"redirect" property returned from load() must be accompanied by a 3xx status code')};if(typeof n.redirect!="string")return{status:500,error:new Error('"redirect" property returned from load() must be a string')}}if(n.context)throw new Error('You are returning "context" from a load function. "context" was renamed to "stuff", please adjust your code accordingly.');return n}function se(n){const e=W(n);let t=!0;function r(){t=!0,e.update(a=>a)}function l(a){t=!1,e.set(a)}function i(a){let s;return e.subscribe(o=>{(s===void 0||t&&o!==s)&&a(s=o)})}return{notify:r,set:l,subscribe:i}}function De(n,e){const t=typeof n=="string"?n:n.url;let r=`script[data-type="svelte-data"][data-url=${JSON.stringify(t)}]`;e&&typeof e.body=="string"&&(r+=`[data-body="${Ie(e.body)}"]`);const l=document.querySelector(r);if(l&&l.textContent){const i=JSON.parse(l.textContent),{body:a}=i,s=X(i,["body"]);return Promise.resolve(new Response(a,s))}return fetch(n,e)}class qe{constructor({Root:e,fallback:t,target:r,session:l}){this.Root=e,this.fallback=t,this.router,this.target=r,this.started=!1,this.session_id=1,this.invalid=new Set,this.invalidating=null,this.autoscroll=!0,this.updating=!1,this.current={url:null,session_id:0,branch:[]},this.cache=new Map,this.loading={id:null,promise:null},this.stores={url:se({}),page:se({}),navigating:W(null),session:W(l)},this.$session=null,this.root=null;let i=!1;this.stores.session.subscribe(async a=>{if(this.$session=a,!i||!this.router)return;this.session_id+=1;const s=this.router.parse(new URL(location.href));s&&this.update(s,[],!0)}),i=!0}disable_scroll_handling(){(this.updating||!this.started)&&(this.autoscroll=!1)}async start({status:e,error:t,nodes:r,url:l,params:i}){const a=[];let s={},o,c;try{for(let f=0;f10||t.includes(e.url.pathname))a=await this._load_error({status:500,error:new Error("Redirect loop"),url:e.url});else{this.router?this.router.goto(a.redirect,{replaceState:!0},[...t,e.url.pathname]):location.href=new URL(a.redirect,location.href).href;return}if(this.updating=!0,this.started?(this.current=a.state,this.root.$set(a.props),this.stores.navigating.set(null)):this._init(a),l){const{hash:c,scroll:f,keepfocus:h}=l;if(h||((o=getSelection())==null||o.removeAllRanges(),document.body.focus()),await 0,this.autoscroll){const u=c&&document.getElementById(c.slice(1));f?scrollTo(f.x,f.y):u?u.scrollIntoView():scrollTo(0,0)}}else await 0;if(this.loading.promise=null,this.loading.id=null,this.autoscroll=!0,this.updating=!1,!this.router)return;const s=a.state.branch[a.state.branch.length-1];s&&s.module.router===!1?this.router.disable():this.router.enable()}load(e){return this.loading.promise=this._get_navigation_result(e,!1),this.loading.id=e.id,this.loading.promise}invalidate(e){return this.invalid.add(e),this.invalidating||(this.invalidating=Promise.resolve().then(async()=>{const t=this.router&&this.router.parse(new URL(location.href));t&&await this.update(t,[],!0),this.invalidating=null})),this.invalidating}_init(e){this.current=e.state;const t=document.querySelector("style[data-svelte]");t&&t.remove(),this.root=new this.Root({target:this.target,props:A({stores:this.stores},e.props),hydrate:!0}),this.started=!0}async _get_navigation_result(e,t){if(this.loading.id===e.id&&this.loading.promise)return this.loading.promise;for(let r=0;ro()),i+=1;else break}const a=await this._load({route:l,info:e},t);if(a)return a}return await this._load_error({status:404,error:new Error(`Not found: ${e.url.pathname}`),url:e.url})}async _get_navigation_result_from_branch({url:e,params:t,branch:r,status:l,error:i}){const a=r.filter(Boolean),s=a.find(h=>h.loaded&&h.loaded.redirect),o={redirect:s&&s.loaded?s.loaded.redirect:void 0,state:{url:e,params:t,branch:r,session_id:this.session_id},props:{components:a.map(h=>h.module.default)}};for(let h=0;h{Object.defineProperty(o.props.page,u,{get:()=>{throw new Error(`$page.${u} has been replaced by $page.url.${p}`)}})};h("origin","origin"),h("path","pathname"),h("query","searchParams")}const c=a[a.length-1],f=c.loaded&&c.loaded.maxage;if(f){const h=e.pathname+e.search;let u=!1;const p=()=>{this.cache.get(h)===o&&this.cache.delete(h),S(),clearTimeout(P)},P=setTimeout(p,f*1e3),S=this.stores.session.subscribe(()=>{u&&p()});u=!0,this.cache.set(h,o)}return o}async _load_node({status:e,error:t,module:r,url:l,params:i,stuff:a}){const s={module:r,uses:{params:new Set,url:!1,session:!1,stuff:!1,dependencies:[]},loaded:null,stuff:a},o={};for(const f in i)Object.defineProperty(o,f,{get(){return s.uses.params.add(f),i[f]},enumerable:!0});const c=this.$session;if(r.load){const{started:f}=this,h={params:o,get url(){return s.uses.url=!0,l},get session(){return s.uses.session=!0,c},get stuff(){return s.uses.stuff=!0,A({},a)},fetch(p,P){const S=typeof p=="string"?p:p.url,{href:U}=new URL(S,l);return s.uses.dependencies.push(U),f?fetch(p,P):De(p,P)}};t&&(h.status=e,h.error=t);const u=await r.load.call(null,h);if(!u)return;s.loaded=Ve(u),s.loaded.stuff&&(s.stuff=s.loaded.stuff)}return s}async _load({route:e,info:{url:t,path:r}},l){const i=t.pathname+t.search;if(!l){const d=this.cache.get(i);if(d)return d}const[a,s,o,c]=e,f=c?c(a.exec(r)):{},h=this.current.url&&{url:i!==this.current.url.pathname+this.current.url.search,params:Object.keys(f).filter(d=>this.current.params[d]!==f[d]),session:this.session_id!==this.current.session_id};let u=[],p={},P=!1,S=200,U;s.forEach(d=>d());e:for(let d=0;dv.uses.params.has(N))||h.session&&v.uses.session||v.uses.dependencies.some(N=>this.invalid.has(N))||P&&v.uses.stuff){_=await this._load_node({module:b,url:t,params:f,stuff:p});const N=d===s.length-1;if(_&&_.loaded){if(_.loaded.error&&(S=_.loaded.status,U=_.loaded.error),_.loaded.redirect)return{redirect:_.loaded.redirect,props:{},state:this.current};_.loaded.stuff&&(P=!0)}else if(N&&b.load)return}else _=v}catch(b){S=500,U=te(b)}if(U){for(;d--;)if(o[d]){let b,v,q=d;for(;!(v=u[q]);)q-=1;try{if(b=await this._load_node({status:S,error:U,module:await o[d](),url:t,params:f,stuff:v.stuff}),b&&b.loaded&&b.loaded.error)continue;u=u.slice(0,q+1).concat(b);break e}catch{continue}}return await this._load_error({status:S,error:U,url:t})}else _&&_.loaded&&_.loaded.stuff&&(p=A(A({},p),_.loaded.stuff)),u.push(_)}return await this._get_navigation_result_from_branch({url:t,params:f,branch:u,status:S,error:U})}async _load_error({status:e,error:t,url:r}){const l={},i=await this._load_node({module:await this.fallback[0],url:r,params:l,stuff:{}}),a=[i,await this._load_node({status:e,error:t,module:await this.fallback[1],url:r,params:l,stuff:i&&i.loaded&&i.loaded.stuff||{}})];return await this._get_navigation_result_from_branch({url:r,params:l,branch:a,status:e,error:t})}}async function We({paths:n,target:e,session:t,route:r,spa:l,trailing_slash:i,hydrate:a}){const s=new qe({Root:Ue,fallback:je,target:e,session:t}),o=r?new Ce({base:n.base,routes:Te,trailing_slash:i,renderer:s}):null;Oe(n),a&&await s.start(a),o&&(l&&o.goto(location.href,{replaceState:!0},[]),o.init_listeners()),dispatchEvent(new CustomEvent("sveltekit:start"))}export{We as start};