Socket
Socket
Sign inDemoInstall

@tanstack/router-core

Package Overview
Dependencies
Maintainers
2
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/router-core - npm Package Compare versions

Comparing version 0.0.1-beta.183 to 0.0.1-beta.184

2

build/cjs/searchParams.js

@@ -69,4 +69,2 @@ /**

delete search[key];
} else if (Array.isArray(val)) {
search[key] = val.map(stringifyValue);
} else {

@@ -73,0 +71,0 @@ search[key] = stringifyValue(val);

@@ -697,4 +697,2 @@ /**

delete search[key];
} else if (Array.isArray(val)) {
search[key] = val.map(stringifyValue);
} else {

@@ -701,0 +699,0 @@ search[key] = stringifyValue(val);

248

build/stats-react.json

@@ -14,11 +14,11 @@ {

"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"uid": "d5e5-31"
"uid": "497b-31"
},
{
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"uid": "d5e5-33"
"uid": "497b-33"
},
{
"name": "@tanstack+store@0.0.1/node_modules/@tanstack/store/build/esm/index.js",
"uid": "d5e5-47"
"uid": "497b-47"
}

@@ -31,43 +31,43 @@ ]

{
"uid": "d5e5-35",
"uid": "497b-35",
"name": "history.ts"
},
{
"uid": "d5e5-37",
"uid": "497b-37",
"name": "utils.ts"
},
{
"uid": "d5e5-39",
"uid": "497b-39",
"name": "path.ts"
},
{
"uid": "d5e5-41",
"uid": "497b-41",
"name": "qss.ts"
},
{
"uid": "d5e5-43",
"uid": "497b-43",
"name": "route.ts"
},
{
"uid": "d5e5-45",
"uid": "497b-45",
"name": "fileRoute.ts"
},
{
"uid": "d5e5-49",
"uid": "497b-49",
"name": "searchParams.ts"
},
{
"uid": "d5e5-51",
"uid": "497b-51",
"name": "router.ts"
},
{
"uid": "d5e5-53",
"uid": "497b-53",
"name": "scroll-restoration.ts"
},
{
"uid": "d5e5-55",
"uid": "497b-55",
"name": "defer.ts"
},
{
"uid": "d5e5-57",
"uid": "497b-57",
"name": "index.ts"

@@ -83,92 +83,92 @@ }

"nodeParts": {
"d5e5-31": {
"497b-31": {
"renderedLength": 199,
"gzipLength": 134,
"brotliLength": 0,
"mainUid": "d5e5-30"
"mainUid": "497b-30"
},
"d5e5-33": {
"497b-33": {
"renderedLength": 48,
"gzipLength": 65,
"brotliLength": 0,
"mainUid": "d5e5-32"
"mainUid": "497b-32"
},
"d5e5-35": {
"497b-35": {
"renderedLength": 6455,
"gzipLength": 1542,
"brotliLength": 0,
"mainUid": "d5e5-34"
"mainUid": "497b-34"
},
"d5e5-37": {
"497b-37": {
"renderedLength": 2821,
"gzipLength": 990,
"brotliLength": 0,
"mainUid": "d5e5-36"
"mainUid": "497b-36"
},
"d5e5-39": {
"497b-39": {
"renderedLength": 6028,
"gzipLength": 1423,
"brotliLength": 0,
"mainUid": "d5e5-38"
"mainUid": "497b-38"
},
"d5e5-41": {
"497b-41": {
"renderedLength": 1371,
"gzipLength": 552,
"brotliLength": 0,
"mainUid": "d5e5-40"
"mainUid": "497b-40"
},
"d5e5-43": {
"497b-43": {
"renderedLength": 2536,
"gzipLength": 895,
"brotliLength": 0,
"mainUid": "d5e5-42"
"mainUid": "497b-42"
},
"d5e5-45": {
"497b-45": {
"renderedLength": 223,
"gzipLength": 143,
"brotliLength": 0,
"mainUid": "d5e5-44"
"mainUid": "497b-44"
},
"d5e5-47": {
"497b-47": {
"renderedLength": 1969,
"gzipLength": 653,
"brotliLength": 0,
"mainUid": "d5e5-46"
"mainUid": "497b-46"
},
"d5e5-49": {
"renderedLength": 1924,
"gzipLength": 603,
"497b-49": {
"renderedLength": 1826,
"gzipLength": 579,
"brotliLength": 0,
"mainUid": "d5e5-48"
"mainUid": "497b-48"
},
"d5e5-51": {
"497b-51": {
"renderedLength": 41630,
"gzipLength": 9254,
"brotliLength": 0,
"mainUid": "d5e5-50"
"mainUid": "497b-50"
},
"d5e5-53": {
"497b-53": {
"renderedLength": 4430,
"gzipLength": 1190,
"brotliLength": 0,
"mainUid": "d5e5-52"
"mainUid": "497b-52"
},
"d5e5-55": {
"497b-55": {
"renderedLength": 682,
"gzipLength": 314,
"brotliLength": 0,
"mainUid": "d5e5-54"
"mainUid": "497b-54"
},
"d5e5-57": {
"497b-57": {
"renderedLength": 0,
"gzipLength": 0,
"brotliLength": 0,
"mainUid": "d5e5-56"
"mainUid": "497b-56"
}
},
"nodeMetas": {
"d5e5-30": {
"497b-30": {
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"moduleParts": {
"index.production.js": "d5e5-31"
"index.production.js": "497b-31"
},

@@ -178,16 +178,16 @@ "imported": [],

{
"uid": "d5e5-56"
"uid": "497b-56"
},
{
"uid": "d5e5-42"
"uid": "497b-42"
},
{
"uid": "d5e5-50"
"uid": "497b-50"
}
]
},
"d5e5-32": {
"497b-32": {
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"moduleParts": {
"index.production.js": "d5e5-33"
"index.production.js": "497b-33"
},

@@ -197,10 +197,10 @@ "imported": [],

{
"uid": "d5e5-56"
"uid": "497b-56"
}
]
},
"d5e5-34": {
"497b-34": {
"id": "/packages/router-core/src/history.ts",
"moduleParts": {
"index.production.js": "d5e5-35"
"index.production.js": "497b-35"
},

@@ -210,13 +210,13 @@ "imported": [],

{
"uid": "d5e5-56"
"uid": "497b-56"
},
{
"uid": "d5e5-50"
"uid": "497b-50"
}
]
},
"d5e5-36": {
"497b-36": {
"id": "/packages/router-core/src/utils.ts",
"moduleParts": {
"index.production.js": "d5e5-37"
"index.production.js": "497b-37"
},

@@ -226,20 +226,20 @@ "imported": [],

{
"uid": "d5e5-56"
"uid": "497b-56"
},
{
"uid": "d5e5-38"
"uid": "497b-38"
},
{
"uid": "d5e5-50"
"uid": "497b-50"
}
]
},
"d5e5-38": {
"497b-38": {
"id": "/packages/router-core/src/path.ts",
"moduleParts": {
"index.production.js": "d5e5-39"
"index.production.js": "497b-39"
},
"imported": [
{
"uid": "d5e5-36"
"uid": "497b-36"
}

@@ -249,16 +249,16 @@ ],

{
"uid": "d5e5-56"
"uid": "497b-56"
},
{
"uid": "d5e5-42"
"uid": "497b-42"
},
{
"uid": "d5e5-50"
"uid": "497b-50"
}
]
},
"d5e5-40": {
"497b-40": {
"id": "/packages/router-core/src/qss.ts",
"moduleParts": {
"index.production.js": "d5e5-41"
"index.production.js": "497b-41"
},

@@ -268,20 +268,20 @@ "imported": [],

{
"uid": "d5e5-56"
"uid": "497b-56"
},
{
"uid": "d5e5-48"
"uid": "497b-48"
}
]
},
"d5e5-42": {
"497b-42": {
"id": "/packages/router-core/src/route.ts",
"moduleParts": {
"index.production.js": "d5e5-43"
"index.production.js": "497b-43"
},
"imported": [
{
"uid": "d5e5-30"
"uid": "497b-30"
},
{
"uid": "d5e5-38"
"uid": "497b-38"
}

@@ -291,17 +291,17 @@ ],

{
"uid": "d5e5-56"
"uid": "497b-56"
},
{
"uid": "d5e5-44"
"uid": "497b-44"
}
]
},
"d5e5-44": {
"497b-44": {
"id": "/packages/router-core/src/fileRoute.ts",
"moduleParts": {
"index.production.js": "d5e5-45"
"index.production.js": "497b-45"
},
"imported": [
{
"uid": "d5e5-42"
"uid": "497b-42"
}

@@ -311,10 +311,10 @@ ],

{
"uid": "d5e5-56"
"uid": "497b-56"
}
]
},
"d5e5-46": {
"497b-46": {
"id": "/node_modules/.pnpm/@tanstack+store@0.0.1/node_modules/@tanstack/store/build/esm/index.js",
"moduleParts": {
"index.production.js": "d5e5-47"
"index.production.js": "497b-47"
},

@@ -324,14 +324,14 @@ "imported": [],

{
"uid": "d5e5-50"
"uid": "497b-50"
}
]
},
"d5e5-48": {
"497b-48": {
"id": "/packages/router-core/src/searchParams.ts",
"moduleParts": {
"index.production.js": "d5e5-49"
"index.production.js": "497b-49"
},
"imported": [
{
"uid": "d5e5-40"
"uid": "497b-40"
}

@@ -341,32 +341,32 @@ ],

{
"uid": "d5e5-56"
"uid": "497b-56"
},
{
"uid": "d5e5-50"
"uid": "497b-50"
}
]
},
"d5e5-50": {
"497b-50": {
"id": "/packages/router-core/src/router.ts",
"moduleParts": {
"index.production.js": "d5e5-51"
"index.production.js": "497b-51"
},
"imported": [
{
"uid": "d5e5-46"
"uid": "497b-46"
},
{
"uid": "d5e5-30"
"uid": "497b-30"
},
{
"uid": "d5e5-38"
"uid": "497b-38"
},
{
"uid": "d5e5-48"
"uid": "497b-48"
},
{
"uid": "d5e5-36"
"uid": "497b-36"
},
{
"uid": "d5e5-34"
"uid": "497b-34"
}

@@ -376,10 +376,10 @@ ],

{
"uid": "d5e5-56"
"uid": "497b-56"
}
]
},
"d5e5-52": {
"497b-52": {
"id": "/packages/router-core/src/scroll-restoration.ts",
"moduleParts": {
"index.production.js": "d5e5-53"
"index.production.js": "497b-53"
},

@@ -389,10 +389,10 @@ "imported": [],

{
"uid": "d5e5-56"
"uid": "497b-56"
}
]
},
"d5e5-54": {
"497b-54": {
"id": "/packages/router-core/src/defer.ts",
"moduleParts": {
"index.production.js": "d5e5-55"
"index.production.js": "497b-55"
},

@@ -402,53 +402,53 @@ "imported": [],

{
"uid": "d5e5-56"
"uid": "497b-56"
}
]
},
"d5e5-56": {
"497b-56": {
"id": "/packages/router-core/src/index.ts",
"moduleParts": {
"index.production.js": "d5e5-57"
"index.production.js": "497b-57"
},
"imported": [
{
"uid": "d5e5-30"
"uid": "497b-30"
},
{
"uid": "d5e5-32"
"uid": "497b-32"
},
{
"uid": "d5e5-34"
"uid": "497b-34"
},
{
"uid": "d5e5-58"
"uid": "497b-58"
},
{
"uid": "d5e5-38"
"uid": "497b-38"
},
{
"uid": "d5e5-40"
"uid": "497b-40"
},
{
"uid": "d5e5-42"
"uid": "497b-42"
},
{
"uid": "d5e5-44"
"uid": "497b-44"
},
{
"uid": "d5e5-59"
"uid": "497b-59"
},
{
"uid": "d5e5-50"
"uid": "497b-50"
},
{
"uid": "d5e5-48"
"uid": "497b-48"
},
{
"uid": "d5e5-36"
"uid": "497b-36"
},
{
"uid": "d5e5-52"
"uid": "497b-52"
},
{
"uid": "d5e5-54"
"uid": "497b-54"
}

@@ -459,3 +459,3 @@ ],

},
"d5e5-58": {
"497b-58": {
"id": "/packages/router-core/src/link.ts",

@@ -466,7 +466,7 @@ "moduleParts": {},

{
"uid": "d5e5-56"
"uid": "497b-56"
}
]
},
"d5e5-59": {
"497b-59": {
"id": "/packages/router-core/src/routeInfo.ts",

@@ -477,3 +477,3 @@ "moduleParts": {},

{
"uid": "d5e5-56"
"uid": "497b-56"
}

@@ -480,0 +480,0 @@ ]

@@ -11,3 +11,3 @@ /**

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RouterCore={})}(this,(function(t){"use strict";function e(t,e){if(!t)throw new Error("Invariant failed")}const s="pushstate",r="popstate",o="beforeunload",a=t=>(t.preventDefault(),t.returnValue=""),i=()=>{removeEventListener(o,a,{capture:!0})};function n(t){let e=t.getLocation(),s=()=>{},r=new Set,n=[],c=[];const h=()=>{if(n.length)n[0]?.(h,(()=>{n=[],i()}));else{for(;c.length;)c.shift()?.();t.subscriber||d()}},l=t=>{c.push(t),h()},d=()=>{e=t.getLocation(),r.forEach((t=>t()))};return{get location(){return e},subscribe:e=>(0===r.size&&(s="function"==typeof t.subscriber?t.subscriber(d):()=>{}),r.add(e),()=>{r.delete(e),0===r.size&&s()}),push:(e,s)=>{l((()=>{t.pushState(e,s)}))},replace:(e,s)=>{l((()=>{t.replaceState(e,s)}))},go:e=>{l((()=>{t.go(e)}))},back:()=>{l((()=>{t.back()}))},forward:()=>{l((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(n.push(t),1===n.length&&addEventListener(o,a,{capture:!0}),()=>{n=n.filter((e=>e!==t)),n.length||i()})}}function c(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),o=t?.createHref??(t=>t);return n({getLocation:()=>l(e(),history.state),subscriber:t=>{window.addEventListener(s,t),window.addEventListener(r,t);var e=window.history.pushState;window.history.pushState=function(){let s=e.apply(history,arguments);return t(),s};var o=window.history.replaceState;return window.history.replaceState=function(){let e=o.apply(history,arguments);return t(),e},()=>{window.history.pushState=e,window.history.replaceState=o,window.removeEventListener(s,t),window.removeEventListener(r,t)}},pushState:(t,e)=>{window.history.pushState({...e,key:d()},"",o(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:d()},"",o(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>o(t)})}function h(t={initialEntries:["/"]}){const e=t.initialEntries;let s=t.initialIndex??e.length-1,r={};return n({getLocation:()=>l(e[s],r),subscriber:!1,pushState:(t,o)=>{r={...o,key:d()},e.push(t),s++},replaceState:(t,o)=>{r={...o,key:d()},e[s]=t},back:()=>{s--},forward:()=>{s=Math.min(s+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function l(t,e){let s=t.indexOf("#"),r=t.indexOf("?");return{href:t,pathname:t.substring(0,s>0?r>0?Math.min(s,r):s:r>0?r:t.length),hash:s>-1?t.substring(s):"",search:r>-1?t.slice(r,-1===s?void 0:s):"",state:e}}function d(){return(Math.random()+1).toString(36).substring(7)}function u(t){return t[t.length-1]}function p(t,e){return"function"==typeof t?t(e):t}function f(t,e){return e.reduce(((e,s)=>(e[s]=t[s],e)),{})}function m(t,e){if(t===e)return t;const s=e,r=Array.isArray(t)&&Array.isArray(s);if(r||y(t)&&y(s)){const e=r?t.length:Object.keys(t).length,o=r?s:Object.keys(s),a=o.length,i=r?[]:{};let n=0;for(let e=0;e<a;e++){const a=r?e:o[e];i[a]=m(t[a],s[a]),i[a]===t[a]&&n++}return e===a&&n===e?t:i}return s}function y(t){if(!g(t))return!1;const e=t.constructor;if(void 0===e)return!0;const s=e.prototype;return!!g(s)&&!!s.hasOwnProperty("isPrototypeOf")}function g(t){return"[object Object]"===Object.prototype.toString.call(t)}function w(t,e){return t===e||typeof t==typeof e&&(y(t)&&y(e)?!Object.keys(e).some((s=>!w(t[s],e[s]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,s)=>w(t,e[s])))))}function v(t){return b(t.filter(Boolean).join("/"))}function b(t){return t.replace(/\/{2,}/g,"/")}function _(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function S(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function R(t){return S(_(t))}function I(t,e,s){e=e.replace(new RegExp(`^${t}`),"/"),s=s.replace(new RegExp(`^${t}`),"/");let r=x(e);const o=x(s);o.forEach(((t,e)=>{if("/"===t.value)e?e===o.length-1&&r.push(t):r=[t];else if(".."===t.value)r.length>1&&"/"===u(r)?.value&&r.pop(),r.pop();else{if("."===t.value)return;r.push(t)}}));return b(v([t,...r.map((t=>t.value))]))}function x(t){if(!t)return[];const e=[];if("/"===(t=b(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const s=t.split("/").filter(Boolean);return e.push(...s.map((t=>"$"===t||"*"===t?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function M(t,e,s=!1){return v(x(t).map((t=>{if("wildcard"===t.type){const r=e[t.value];return s?`${t.value}${r??""}`:r}return"param"===t.type?e[t.value.substring(1)]??"":t.value})))}function E(t,e,s){const r=P(t,e,s);if(!s.to||r)return r??{}}function P(t,e,s){e="/"!=t?e.substring(t.length):e;const r=`${s.to??"$"}`,o=x(e),a=x(r);e.startsWith("/")||o.unshift({type:"pathname",value:"/"}),r.startsWith("/")||a.unshift({type:"pathname",value:"/"});const i={};return(()=>{for(let t=0;t<Math.max(o.length,a.length);t++){const e=o[t],r=a[t],n=t>=o.length-1,c=t>=a.length-1;if(r){if("wildcard"===r.type)return!!e?.value&&(i["*"]=v(o.slice(t).map((t=>t.value))),!0);if("pathname"===r.type){if("/"===r.value&&!e?.value)return!0;if(e)if(s.caseSensitive){if(r.value!==e.value)return!1}else if(r.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===r.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(i[r.value.substring(1)]=e.value)}}if(!n&&c)return!!s.fuzzy}return!0})()?i:void 0}function A(t,e){var s,r,o,a="";for(s in t)if(void 0!==(o=t[s]))if(Array.isArray(o))for(r=0;r<o.length;r++)a&&(a+="&"),a+=encodeURIComponent(s)+"="+encodeURIComponent(o[r]);else a&&(a+="&"),a+=encodeURIComponent(s)+"="+encodeURIComponent(o);return(e||"")+a}function L(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0&&+e+""===e?+e:e))}function D(t){for(var e,s,r={},o=t.split("&");e=o.shift();)void 0!==r[s=(e=e.split("=")).shift()]?r[s]=[].concat(r[s],L(e.shift())):r[s]=L(e.shift());return r}const B="__root__";class O{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute,O.__onInit(this)}init=t=>{this.originalIndex=t.originalIndex,this.router=t.router;const s=this.options,r=!s?.path&&!s?.id;this.parentRoute=this.options?.getParentRoute?.(),r?this.path=B:e(this.parentRoute);let o=r?B:s.path;o&&"/"!==o&&(o=R(o));const a=s?.id||o;let i=r?B:v([this.parentRoute.id===B?"":this.parentRoute.id,a]);o===B&&(o="/"),i!==B&&(i=v(["/",i]));const n=i===B?"/":v([this.parentRoute.fullPath,o]);this.path=o,this.id=i,this.fullPath=n,this.to=n};addChildren=t=>(this.children=t,this);update=t=>(Object.assign(this.options,t),this);static __onInit=t=>{}}class $ extends O{constructor(t){super(t)}}
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RouterCore={})}(this,(function(t){"use strict";function e(t,e){if(!t)throw new Error("Invariant failed")}const s="pushstate",r="popstate",o="beforeunload",a=t=>(t.preventDefault(),t.returnValue=""),n=()=>{removeEventListener(o,a,{capture:!0})};function i(t){let e=t.getLocation(),s=()=>{},r=new Set,i=[],c=[];const h=()=>{if(i.length)i[0]?.(h,(()=>{i=[],n()}));else{for(;c.length;)c.shift()?.();t.subscriber||d()}},l=t=>{c.push(t),h()},d=()=>{e=t.getLocation(),r.forEach((t=>t()))};return{get location(){return e},subscribe:e=>(0===r.size&&(s="function"==typeof t.subscriber?t.subscriber(d):()=>{}),r.add(e),()=>{r.delete(e),0===r.size&&s()}),push:(e,s)=>{l((()=>{t.pushState(e,s)}))},replace:(e,s)=>{l((()=>{t.replaceState(e,s)}))},go:e=>{l((()=>{t.go(e)}))},back:()=>{l((()=>{t.back()}))},forward:()=>{l((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(i.push(t),1===i.length&&addEventListener(o,a,{capture:!0}),()=>{i=i.filter((e=>e!==t)),i.length||n()})}}function c(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),o=t?.createHref??(t=>t);return i({getLocation:()=>l(e(),history.state),subscriber:t=>{window.addEventListener(s,t),window.addEventListener(r,t);var e=window.history.pushState;window.history.pushState=function(){let s=e.apply(history,arguments);return t(),s};var o=window.history.replaceState;return window.history.replaceState=function(){let e=o.apply(history,arguments);return t(),e},()=>{window.history.pushState=e,window.history.replaceState=o,window.removeEventListener(s,t),window.removeEventListener(r,t)}},pushState:(t,e)=>{window.history.pushState({...e,key:d()},"",o(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:d()},"",o(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>o(t)})}function h(t={initialEntries:["/"]}){const e=t.initialEntries;let s=t.initialIndex??e.length-1,r={};return i({getLocation:()=>l(e[s],r),subscriber:!1,pushState:(t,o)=>{r={...o,key:d()},e.push(t),s++},replaceState:(t,o)=>{r={...o,key:d()},e[s]=t},back:()=>{s--},forward:()=>{s=Math.min(s+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function l(t,e){let s=t.indexOf("#"),r=t.indexOf("?");return{href:t,pathname:t.substring(0,s>0?r>0?Math.min(s,r):s:r>0?r:t.length),hash:s>-1?t.substring(s):"",search:r>-1?t.slice(r,-1===s?void 0:s):"",state:e}}function d(){return(Math.random()+1).toString(36).substring(7)}function u(t){return t[t.length-1]}function p(t,e){return"function"==typeof t?t(e):t}function f(t,e){return e.reduce(((e,s)=>(e[s]=t[s],e)),{})}function m(t,e){if(t===e)return t;const s=e,r=Array.isArray(t)&&Array.isArray(s);if(r||y(t)&&y(s)){const e=r?t.length:Object.keys(t).length,o=r?s:Object.keys(s),a=o.length,n=r?[]:{};let i=0;for(let e=0;e<a;e++){const a=r?e:o[e];n[a]=m(t[a],s[a]),n[a]===t[a]&&i++}return e===a&&i===e?t:n}return s}function y(t){if(!g(t))return!1;const e=t.constructor;if(void 0===e)return!0;const s=e.prototype;return!!g(s)&&!!s.hasOwnProperty("isPrototypeOf")}function g(t){return"[object Object]"===Object.prototype.toString.call(t)}function w(t,e){return t===e||typeof t==typeof e&&(y(t)&&y(e)?!Object.keys(e).some((s=>!w(t[s],e[s]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,s)=>w(t,e[s])))))}function v(t){return b(t.filter(Boolean).join("/"))}function b(t){return t.replace(/\/{2,}/g,"/")}function _(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function S(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function R(t){return S(_(t))}function I(t,e,s){e=e.replace(new RegExp(`^${t}`),"/"),s=s.replace(new RegExp(`^${t}`),"/");let r=x(e);const o=x(s);o.forEach(((t,e)=>{if("/"===t.value)e?e===o.length-1&&r.push(t):r=[t];else if(".."===t.value)r.length>1&&"/"===u(r)?.value&&r.pop(),r.pop();else{if("."===t.value)return;r.push(t)}}));return b(v([t,...r.map((t=>t.value))]))}function x(t){if(!t)return[];const e=[];if("/"===(t=b(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const s=t.split("/").filter(Boolean);return e.push(...s.map((t=>"$"===t||"*"===t?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function M(t,e,s=!1){return v(x(t).map((t=>{if("wildcard"===t.type){const r=e[t.value];return s?`${t.value}${r??""}`:r}return"param"===t.type?e[t.value.substring(1)]??"":t.value})))}function E(t,e,s){const r=P(t,e,s);if(!s.to||r)return r??{}}function P(t,e,s){e="/"!=t?e.substring(t.length):e;const r=`${s.to??"$"}`,o=x(e),a=x(r);e.startsWith("/")||o.unshift({type:"pathname",value:"/"}),r.startsWith("/")||a.unshift({type:"pathname",value:"/"});const n={};return(()=>{for(let t=0;t<Math.max(o.length,a.length);t++){const e=o[t],r=a[t],i=t>=o.length-1,c=t>=a.length-1;if(r){if("wildcard"===r.type)return!!e?.value&&(n["*"]=v(o.slice(t).map((t=>t.value))),!0);if("pathname"===r.type){if("/"===r.value&&!e?.value)return!0;if(e)if(s.caseSensitive){if(r.value!==e.value)return!1}else if(r.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===r.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(n[r.value.substring(1)]=e.value)}}if(!i&&c)return!!s.fuzzy}return!0})()?n:void 0}function A(t,e){var s,r,o,a="";for(s in t)if(void 0!==(o=t[s]))if(Array.isArray(o))for(r=0;r<o.length;r++)a&&(a+="&"),a+=encodeURIComponent(s)+"="+encodeURIComponent(o[r]);else a&&(a+="&"),a+=encodeURIComponent(s)+"="+encodeURIComponent(o);return(e||"")+a}function L(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0&&+e+""===e?+e:e))}function D(t){for(var e,s,r={},o=t.split("&");e=o.shift();)void 0!==r[s=(e=e.split("=")).shift()]?r[s]=[].concat(r[s],L(e.shift())):r[s]=L(e.shift());return r}const B="__root__";class O{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute,O.__onInit(this)}init=t=>{this.originalIndex=t.originalIndex,this.router=t.router;const s=this.options,r=!s?.path&&!s?.id;this.parentRoute=this.options?.getParentRoute?.(),r?this.path=B:e(this.parentRoute);let o=r?B:s.path;o&&"/"!==o&&(o=R(o));const a=s?.id||o;let n=r?B:v([this.parentRoute.id===B?"":this.parentRoute.id,a]);o===B&&(o="/"),n!==B&&(n=v(["/",n]));const i=n===B?"/":v([this.parentRoute.fullPath,o]);this.path=o,this.id=n,this.fullPath=i,this.to=i};addChildren=t=>(this.children=t,this);update=t=>(Object.assign(this.options,t),this);static __onInit=t=>{}}class $ extends O{constructor(t){super(t)}}
/**

@@ -23,3 +23,3 @@ * @tanstack/store/src/index.ts

*/
class C{listeners=new Set;_batching=!1;_flushing=0;_nextPriority=null;constructor(t,e){this.state=t,this.options=e}subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}};setState=(t,e)=>{const s=this.state;this.state=this.options?.updateFn?this.options.updateFn(s)(t):t(s);const r=e?.priority??this.options?.defaultPriority??"high";null===this._nextPriority||"high"===this._nextPriority?this._nextPriority=r:this._nextPriority=this.options?.defaultPriority??"high",this.options?.onUpdate?.({priority:this._nextPriority}),this._flush()};_flush=()=>{if(this._batching)return;const t=++this._flushing;this.listeners.forEach((e=>{this._flushing===t&&e({priority:this._nextPriority??"high"})}))};batch=t=>{if(this._batching)return t();this._batching=!0,t(),this._batching=!1,this._flush()}}const T=k(JSON.parse),j=H(JSON.stringify,JSON.parse);function k(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let s=D(e);for(let e in s){const r=s[e];if("string"==typeof r)try{s[e]=t(r)}catch(t){}}return s}}function H(t,e){function s(s){if("object"==typeof s&&null!==s)try{return t(s)}catch(t){}else if("string"==typeof s&&"function"==typeof e)try{return e(s),t(s)}catch(t){}return s}return t=>{(t={...t})&&Object.keys(t).forEach((e=>{const r=t[e];void 0===r||void 0===r?delete t[e]:Array.isArray(r)?t[e]=r.map(s):t[e]=s(r)}));const e=A(t).toString();return e?`?${e}`:""}}const N=["component","errorComponent","pendingComponent"],F="visibilitychange",U="focus",Y="Error preloading route! ☝️";const J="undefined"==typeof window||!window.document.createElement;function W(){return{status:"idle",isFetching:!1,resolvedLocation:null,location:null,matchesById:{},matchIds:[],pendingMatchIds:[],matches:[],pendingMatches:[],renderedMatchIds:[],renderedMatches:[],lastUpdated:Date.now()}}function K(t){return!!t?.isRedirect}class X extends Error{}class z extends Error{}function q(t,e){const s=Date.now();return!!t.invalid||(e?.preload?!(t.preloadMaxAge<0)&&t.updatedAt+t.preloadMaxAge<s:!(t.maxAge<0)&&t.updatedAt+t.maxAge<s)}const V="window",G="___";let Q,Z={},tt=!1;const et="undefined"!=typeof window&&window.sessionStorage,st=t=>t.key;t.FileRoute=class{constructor(t){this.path=t}createRoute=t=>{const e=new O(t);return e.isRoot=!1,e}},t.PathParamError=z,t.RootRoute=$,t.Route=O,t.Router=class{#t;resetNextScroll=!1;constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??j,parseSearch:t?.parseSearch??T},this.__store=new C(W(),{onUpdate:()=>{const t=this.state,e=this.__store.state,s=t.matchesById!==e.matchesById;let r,o;if(s||(r=t.matchIds.length!==e.matchIds.length||t.matchIds.some(((t,s)=>t!==e.matchIds[s])),o=t.pendingMatchIds.length!==e.pendingMatchIds.length||t.pendingMatchIds.some(((t,s)=>t!==e.pendingMatchIds[s]))),(s||r)&&(e.matches=e.matchIds.map((t=>e.matchesById[t]))),(s||o)&&(e.pendingMatches=e.pendingMatchIds.map((t=>e.matchesById[t]))),s||r||o){const t=e.pendingMatches.some((t=>!!this.getRoute(t.routeId)?.options.pendingComponent));e.renderedMatchIds=t?e.pendingMatchIds:e.matchIds,e.renderedMatches=e.renderedMatchIds.map((t=>e.matchesById[t]))}e.isFetching=[...e.matches,...e.pendingMatches].some((t=>t.isFetching)),this.state=e},defaultPriority:"low"}),this.state=this.__store.state,this.update(t);const e=this.buildNext({hash:!0,fromCurrent:!0,search:!0,state:!0});this.state.location.href!==e.href&&this.#e({...e,replace:!0})}subscribers=new Set;subscribe=(t,e)=>{const s={eventType:t,fn:e};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}};#s=t=>{this.subscribers.forEach((e=>{e.eventType===t.type&&e.fn(t)}))};reset=()=>{this.__store.setState((t=>Object.assign(t,W())))};mount=()=>("undefined"!=typeof window&&window.addEventListener&&(window.addEventListener(F,this.#r,!1),window.addEventListener(U,this.#r,!1)),this.safeLoad(),()=>{"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener(F,this.#r),window.removeEventListener(U,this.#r))});#r=()=>{(this.options.refetchOnWindowFocus??1)&&this.invalidate()};update=t=>{if(this.options={...this.options,...t,context:{...this.options.context,...t?.context}},!this.history||this.options.history&&this.options.history!==this.history){this.#t&&this.#t(),this.history=this.options.history??(J?h():c());const t=this.#o();this.__store.setState((e=>({...e,resolvedLocation:t,location:t}))),this.#t=this.history.subscribe((()=>{this.safeLoad({next:this.#o(this.state.location)})}))}const{basepath:e,routeTree:s}=this.options;return this.basepath=`/${R(e??"")??""}`,s&&s!==this.routeTree&&this.#a(s),this};buildNext=t=>{const e=this.#i(t),s=this.matchRoutes(e.pathname,e.search);return this.#i({...t,__matches:s})};cancelMatches=()=>{this.state.matches.forEach((t=>{this.cancelMatch(t.id)}))};cancelMatch=t=>{this.getRouteMatch(t)?.abortController?.abort()};safeLoad=async t=>{try{return this.load(t)}catch(t){}};latestLoadPromise=Promise.resolve();load=async t=>{const e=new Promise((async(s,r)=>{const o=this.state.resolvedLocation,a=!(!t?.next||o.href===t.next.href);let i;const n=()=>this.latestLoadPromise!==e?this.latestLoadPromise:void 0;let c;this.#s({type:"onBeforeLoad",from:o,to:t?.next??this.state.location,pathChanged:a}),this.__store.batch((()=>{t?.next&&this.__store.setState((e=>({...e,location:t.next}))),c=this.matchRoutes(this.state.location.pathname,this.state.location.search,{throwOnError:t?.throwOnError,debug:!0}),this.__store.setState((t=>({...t,status:"pending",pendingMatchIds:c.map((t=>t.id)),matchesById:this.#n(t.matchesById,c)})))}));try{try{await this.loadMatches(c)}catch(t){}if(i=n())return i;const t=this.state.matchIds.filter((t=>!this.state.pendingMatchIds.includes(t))),e=this.state.pendingMatchIds.filter((t=>!this.state.matchIds.includes(t))),r=this.state.matchIds.filter((t=>this.state.pendingMatchIds.includes(t)));this.__store.setState((t=>({...t,status:"idle",resolvedLocation:t.location,matchIds:t.pendingMatchIds,pendingMatchIds:[]}))),[[t,"onLeave"],[e,"onEnter"],[r,"onTransition"]].forEach((([t,e])=>{t.forEach((t=>{const s=this.getRouteMatch(t);this.getRoute(s.routeId).options[e]?.(s)}))})),this.#s({type:"onLoad",from:o,to:this.state.location,pathChanged:a}),s()}catch(t){if(i=n())return i;r(t)}}));return this.latestLoadPromise=e,this.latestLoadPromise.then((()=>{this.cleanMatches()})),this.latestLoadPromise};#n=(t,e)=>({...t,...Object.fromEntries(e.map((t=>[t.id,t])))});getRoute=t=>{const s=this.routesById[t];return e(s),s};preloadRoute=async(t=this.state.location)=>{const e=this.buildNext(t),s=this.matchRoutes(e.pathname,e.search,{throwOnError:!0});return this.__store.setState((t=>({...t,matchesById:this.#n(t.matchesById,s)}))),await this.loadMatches(s,{preload:!0,maxAge:t.maxAge}),s};cleanMatches=()=>{const t=Date.now(),e=Object.values(this.state.matchesById).filter((e=>{const s=this.getRoute(e.routeId);return!(this.state.matchIds.includes(e.id)||this.state.pendingMatchIds.includes(e.id)||e.preloadMaxAge>-1&&!(e.updatedAt+e.preloadMaxAge<t)||s.options.gcMaxAge&&!(e.updatedAt+s.options.gcMaxAge<t))})).map((t=>t.id));e.length&&this.__store.setState((t=>{const s={...t.matchesById};return e.forEach((t=>{delete s[t]})),{...t,matchesById:s}}))};matchRoutes=(t,e,s)=>{let r={},o=this.flatRoutes.find((e=>{const s=E(this.basepath,S(t),{to:e.fullPath,caseSensitive:e.options.caseSensitive??this.options.caseSensitive});return!!s&&(r=s,!0)}))||this.routesById.__root__,a=[o];for(;o?.parentRoute;)o=o.parentRoute,o&&a.unshift(o);const i=a.map((t=>{let e;if(t.options.parseParams)try{const e=t.options.parseParams(r);Object.assign(r,e)}catch(t){if(e=new z(t.message,{cause:t}),s?.throwOnError)throw e;return e}})),n=a.map(((t,s)=>{const o=M(t.path,r),a=t.options.key?t.options.key({params:r,search:e})??"":"",n=a?JSON.stringify(a):"",c=M(t.id,r,!0)+n,h=this.getRouteMatch(c);if(h)return{...h};const l=!(!t.options.loader&&!N.some((e=>t.options[e]?.preload)));return{id:c,key:n,routeId:t.id,params:r,pathname:v([this.basepath,o]),updatedAt:Date.now(),maxAge:-1,preloadMaxAge:-1,routeSearch:{},search:{},status:l?"pending":"success",isFetching:!1,invalid:!1,error:void 0,paramsError:i[s],searchError:void 0,loaderData:void 0,loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchedAt:0}}));return n.forEach(((t,r)=>{const o=n[r-1],a=this.getRoute(t.routeId),i=(()=>{const r={search:o?.search??e,routeSearch:o?.routeSearch??e};try{let e=("object"==typeof a.options.validateSearch?a.options.validateSearch.parse:a.options.validateSearch)?.(r.search)??{},s={...r.search,...e};return e=m(t.routeSearch,e),s=m(t.search,s),{routeSearch:e,search:s,searchDidChange:t.routeSearch!==e}}catch(e){if(t.searchError=new X(e.message,{cause:e}),s?.throwOnError)throw t.searchError;return r}})();Object.assign(t,i)})),n};loadMatches=async(t,e)=>{const s=()=>t.map((t=>this.getRouteMatch(t.id)));let r;e?.preload||s().forEach((t=>{this.setRouteMatch(t.id,(e=>({...e,routeSearch:t.routeSearch,search:t.search,routeContext:t.routeContext,context:t.context,error:t.error,paramsError:t.paramsError,searchError:t.searchError,params:t.params,preloadMaxAge:0})))}));try{for(const[t,o]of s().entries()){const a=s()[t-1],i=this.getRoute(o.routeId),n=(e,s)=>{if(e.routerCode=s,r=r??t,K(e))throw e;try{i.options.onError?.(e)}catch(t){if(e=t,K(t))throw t}this.setRouteMatch(o.id,(t=>({...t,error:e,status:"error",updatedAt:Date.now()})))};o.paramsError&&n(o.paramsError,"PARSE_PARAMS"),o.searchError&&n(o.searchError,"VALIDATE_SEARCH");let c=!1;try{const t=await(i.options.beforeLoad?.({...o,preload:!!e?.preload,parentContext:a?.routeContext??{},context:a?.context??this?.options.context??{}}))??{},s={...a?.context??this?.options.context,...t};this.setRouteMatch(o.id,(e=>({...e,context:s,routeContext:t})))}catch(t){n(t,"BEFORE_LOAD"),c=!0}if(c)break}}catch(t){throw e?.preload||this.navigate(t),t}const o=s().slice(0,r),a=[];o.forEach(((t,s)=>{a.push((async()=>{const r=a[s-1],o=this.getRoute(t.routeId);if(t.isFetching||"success"===t.status&&!q(t,{preload:e?.preload}))return this.getRouteMatch(t.id)?.loadPromise;const i=Date.now(),n=()=>{const e=this.getRouteMatch(t.id);return e&&e.fetchedAt!==i?e.loadPromise:void 0},c=t=>!!K(t)&&(e?.preload||this.navigate(t),!0),h=async()=>{let s;try{const a=Promise.all(N.map((async t=>{const e=o.options[t];e?.preload&&await e.preload()}))),i=o.options.loader?.({...t,preload:!!e?.preload,parentMatchPromise:r}),[c,h]=await Promise.all([a,i]);if(s=n())return await s;this.setRouteMatchData(t.id,(()=>h),e)}catch(e){if(s=n())return await s;if(c(e))return;try{o.options.onError?.(e)}catch(t){if(e=t,c(t))return}this.setRouteMatch(t.id,(t=>({...t,error:e,status:"error",isFetching:!1,updatedAt:Date.now()})))}};let l;this.__store.batch((()=>{this.setRouteMatch(t.id,(t=>({...t,isFetching:!0,fetchedAt:i,invalid:!1}))),l=h(),this.setRouteMatch(t.id,(t=>({...t,loadPromise:l})))})),await l})())})),await Promise.all(a)};resolvePath=(t,e)=>I(this.basepath,t,b(e));navigate=async({from:t,to:s="",search:r,hash:o,replace:a,params:i,resetScroll:n})=>{const c=String(s),h=void 0===t?t:String(t);let l;try{new URL(`${c}`),l=!0}catch(t){}return e(!l),this.#e({from:h,to:c,search:r,hash:o,replace:a,params:i,resetScroll:n})};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePath(t.from??"",t.to):void 0};const s=this.buildNext(t);if(e?.pending&&"pending"!==this.state.status)return!1;const r=e?.pending?this.state.location:this.state.resolvedLocation;if(!r)return!1;const o=E(this.basepath,r.pathname,{...e,to:s.pathname});return!!o&&(e?.includeSearch??1?!!w(r.search,s.search)&&o:o)};buildLink=({from:t,to:e=".",search:s,params:r,hash:o,target:a,replace:i,activeOptions:n,preload:c,preloadDelay:h,disabled:l,state:d,resetScroll:u})=>{try{return new URL(`${e}`),{type:"external",href:e}}catch(t){}const p={from:t,to:e,search:s,params:r,hash:o,replace:i,state:d,resetScroll:u},f=this.buildNext(p);c=c??this.options.defaultPreload;const m=h??this.options.defaultPreloadDelay??0,y=this.state.location.pathname.split("/"),g=f.pathname.split("/").every(((t,e)=>t===y[e])),v=n?.exact?this.state.location.pathname===f.pathname:g,b=!n?.includeHash||this.state.location.hash===f.hash,_=!(n?.includeSearch??1)||w(this.state.location.search,f.search);return{type:"internal",next:f,handleFocus:t=>{c&&this.preloadRoute(p).catch((t=>{console.warn(t),console.warn(Y)}))},handleClick:t=>{l||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||a&&"_self"!==a||0!==t.button||(t.preventDefault(),this.#e(p))},handleEnter:t=>{const e=t.target||{};if(c){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,this.preloadRoute(p).catch((t=>{console.warn(t),console.warn(Y)}))}),m)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},handleTouchStart:t=>{this.preloadRoute(p).catch((t=>{console.warn(t),console.warn(Y)}))},isActive:v&&b&&_,disabled:l}};dehydrate=()=>({state:{matchIds:this.state.matchIds,dehydratedMatches:this.state.matches.map((t=>f(t,["fetchedAt","invalid","preloadMaxAge","maxAge","id","loaderData","status","updatedAt"])))}});hydrate=async t=>{let s=t;"undefined"!=typeof document&&(s=window.__TSR_DEHYDRATED__),e(s);const r=s;this.dehydratedData=r.payload,this.options.hydrate?.(r.payload);const o=r.router.state;let a=this.matchRoutes(this.state.location.pathname,this.state.location.search).map((t=>{const s=o.dehydratedMatches.find((e=>e.id===t.id));return e(s,t.id),s?{...t,...s}:t}));this.__store.setState((t=>({...t,matchIds:o.matchIds,matches:a,matchesById:this.#n(t.matchesById,a)})))};injectedHtml=[];injectHtml=async t=>{this.injectedHtml.push(t)};dehydrateData=(t,e)=>{if("undefined"==typeof document){const s="string"==typeof t?t:JSON.stringify(t);return this.injectHtml((async()=>{const t=`__TSR_DEHYDRATED__${s}`,r="function"==typeof e?await e():e;return`<script id='${t}' suppressHydrationWarning>window["__TSR_DEHYDRATED__${o=s,o.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}"] = ${JSON.stringify(r)}\n ;(() => {\n var el = document.getElementById('${t}')\n el.parentElement.removeChild(el)\n })()\n <\/script>`;var o})),()=>this.hydrateData(t)}return()=>{}};hydrateData=t=>{if("undefined"!=typeof document){const e="string"==typeof t?t:JSON.stringify(t);return window[`__TSR_DEHYDRATED__${e}`]}};#a=t=>{this.routeTree=t,this.routesById={},this.routesByPath={},this.flatRoutes=[];const s=t=>{t.forEach(((t,r)=>{t.init({originalIndex:r,router:this});if(e(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=S(t.fullPath);this.routesByPath[e]&&!t.fullPath.endsWith("/")||(this.routesByPath[e]=t)}const o=t.children;o?.length&&s(o)}))};s([t]),this.flatRoutes=Object.values(this.routesByPath).map(((t,e)=>{const s=R(t.fullPath),r=x(s);for(;r.length>1&&"/"===r[0]?.value;)r.shift();const o=r.map((t=>"param"===t.type?.5:"wildcard"===t.type?.25:1));return{child:t,trimmed:s,parsed:r,index:e,score:o}})).sort(((t,e)=>{let s="/"===t.trimmed?1:"/"===e.trimmed?-1:0;if(0!==s)return s;const r=Math.min(t.score.length,e.score.length);if(t.score.length!==e.score.length)return e.score.length-t.score.length;for(let s=0;s<r;s++)if(t.score[s]!==e.score[s])return e.score[s]-t.score[s];for(let s=0;s<r;s++)if(t.parsed[s].value!==e.parsed[s].value)return t.parsed[s].value>e.parsed[s].value?1:-1;return t.trimmed!==e.trimmed?t.trimmed>e.trimmed?1:-1:t.index-e.index})).map(((t,e)=>(t.child.rank=e,t.child)))};#o=t=>{let{pathname:e,search:s,hash:r,state:o}=this.history.location;const a=this.options.parseSearch(s);return{pathname:e,searchStr:s,search:m(t?.search,a),hash:r.split("#").reverse()[0]??"",href:`${e}${s}${r}`,state:o,key:o?.key||"__init__"}};#i=(t={})=>{t.fromCurrent=t.fromCurrent??""===t.to;const e=t.fromCurrent?this.state.location.pathname:t.from??this.state.location.pathname;let s=I(this.basepath??"/",e,`${t.to??""}`);const r={...u(this.matchRoutes(this.state.location.pathname,this.state.location.search))?.params};let o=!0===(t.params??!0)?r:p(t.params,r);o&&t.__matches?.map((t=>this.getRoute(t.routeId).options.stringifyParams)).filter(Boolean).forEach((t=>{o={...o,...t(o)}})),s=M(s,o??{});const a=t.__matches?.map((t=>this.getRoute(t.routeId).options.preSearchFilters??[])).flat().filter(Boolean)??[],i=t.__matches?.map((t=>this.getRoute(t.routeId).options.postSearchFilters??[])).flat().filter(Boolean)??[],n=a?.length?a?.reduce(((t,e)=>e(t)),this.state.location.search):this.state.location.search,c=!0===t.search?n:t.search?p(t.search,n)??{}:a?.length?n:{},h=i?.length?i.reduce(((t,e)=>e(t)),c):c,l=m(this.state.location.search,h),d=this.options.stringifySearch(l),f=!0===t.hash?this.state.location.hash:p(t.hash,this.state.location.hash),y=f?`#${f}`:"";return{pathname:s,search:l,searchStr:d,state:!0===t.state?this.state.location.state:p(t.state,this.state.location.state),hash:f,href:this.history.createHref(`${s}${d}${y}`),key:t.key}};#e=async t=>{const e=this.buildNext(t);this.navigateTimeout&&clearTimeout(this.navigateTimeout);let s="replace";t.replace||(s="push");this.state.location.href===e.href&&!e.key&&(s="replace");const r=`${e.pathname}${e.searchStr}${e.hash?`#${e.hash}`:""}`;return this.history["push"===s?"push":"replace"](r,e.state),this.resetNextScroll=t.resetScroll??!0,this.latestLoadPromise};getRouteMatch=t=>this.state.matchesById[t];setRouteMatch=(t,e)=>{this.__store.setState((s=>s.matchesById[t]?{...s,matchesById:{...s.matchesById,[t]:e(s.matchesById[t])}}:s))};setRouteMatchData=(t,e,s)=>{const r=this.getRouteMatch(t);if(!r)return;const o=this.getRoute(r.routeId),a=s?.updatedAt??Date.now(),i=s?.maxAge??o.options.preloadMaxAge??this.options.defaultPreloadMaxAge??5e3,n=s?.maxAge??o.options.maxAge??this.options.defaultMaxAge??-1;this.setRouteMatch(t,(t=>({...t,error:void 0,status:"success",isFetching:!1,updatedAt:a,loaderData:p(e,t.loaderData),preloadMaxAge:i,maxAge:n})))};invalidate=async t=>{if(t?.matchId){this.setRouteMatch(t.matchId,(t=>({...t,invalid:!0})));const e=this.state.matches.findIndex((e=>e.id===t.matchId)),s=this.state.matches[e+1];if(s)return this.invalidate({matchId:s.id,reload:!1})}else this.__store.batch((()=>{Object.values(this.state.matchesById).forEach((t=>{this.setRouteMatch(t.id,(t=>({...t,invalid:!0})))}))}));if(t?.reload??1)return this.navigate({fromCurrent:!0,replace:!0,search:!0})}},t.RouterContext=class{constructor(){}createRootRoute=t=>new $(t)},t.SearchParamError=X,t.cleanPath=b,t.componentTypes=N,t.createBrowserHistory=c,t.createHashHistory=function(){return c({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=h,t.decode=D,t.defaultParseSearch=T,t.defaultStringifySearch=j,t.defer=function(t){const e=t;if(!e.__deferredState){e.__deferredState={uid:Math.random().toString(36).slice(2),status:"pending"};const t=e.__deferredState;e.then((e=>{t.status="success",t.data=e})).catch((e=>{t.status="error",t.error=e}))}return e},t.encode=A,t.functionalUpdate=p,t.interpolatePath=M,t.invariant=e,t.isDehydratedDeferred=function(t){return"object"==typeof t&&null!==t&&!(t instanceof Promise)&&!t.then&&"__deferredState"in t},t.isMatchInvalid=q,t.isPlainObject=y,t.isRedirect=K,t.joinPaths=v,t.last=u,t.lazyFn=function(t,e){return async(...s)=>(await t())[e||"default"](...s)},t.matchByPath=P,t.matchPathname=E,t.parsePathname=x,t.parseSearchWith=k,t.partialDeepEqual=w,t.pick=f,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=m,t.resolvePath=I,t.restoreScrollPositions=function(t,e){if(tt){if(!t.resetNextScroll)return;tt=!1;const s=(e?.getKey||st)(t.state.location);let r=!1;for(const t in Q.current){const e=Q.current[t],[o,a]=t.split(G);if(o===s)if(a===V)r=!0,window.scrollTo(e.scrollX,e.scrollY);else if(a){const t=document.querySelector(a);t&&(t.scrollLeft=e.scrollX,t.scrollTop=e.scrollY)}}r||window.scrollTo(0,0)}},t.rootRouteId=B,t.stringifySearchWith=H,t.trimPath=R,t.trimPathLeft=_,t.trimPathRight=S,t.warning=function(t,e){},t.watchScrollPositions=function(t,e){const s=e?.getKey||st;et&&(Q||(Q=(()=>{const t="tsr-scroll-restoration-v1",e=JSON.parse(window.sessionStorage.getItem(t)||"{}");return{current:e,set:(s,r)=>{e[s]=r,window.sessionStorage.setItem(t,JSON.stringify(Q))}}})()));const{history:r}=window;r.scrollRestoration&&(r.scrollRestoration="manual");const o=e=>{const r=s(t.state.resolvedLocation);Z[r]||(Z[r]=new WeakSet);const o=Z[r];if(o.has(e.target))return;o.add(e.target);const i=[r,e.target===document||e.target===window?V:a(e.target)].join(G);Q.current[i]||Q.set(i,{scrollX:NaN,scrollY:NaN})},a=t=>{let e,s=[];for(;e=t.parentNode;)s.unshift(`${t.tagName}:nth-child(${[].indexOf.call(e.children,t)+1})`),t=e;return`${s.join(" > ")}`.toLowerCase()};"undefined"!=typeof document&&document.addEventListener("scroll",o,!0);const i=t.subscribe("onBeforeLoad",(t=>{t.pathChanged&&(t=>{const e=s(t);for(const t in Q.current){const s=Q.current[t],[r,o]=t.split(G);if(e===r){if(o===V)s.scrollX=window.scrollX||0,s.scrollY=window.scrollY||0;else if(o){const t=document.querySelector(o);s.scrollX=t?.scrollLeft||0,s.scrollY=t?.scrollTop||0}Q.set(t,s)}}})(t.from)})),n=t.subscribe("onLoad",(t=>{t.pathChanged&&(tt=!0)}));return()=>{document.removeEventListener("scroll",o),i(),n()}},Object.defineProperty(t,"__esModule",{value:!0})}));
class C{listeners=new Set;_batching=!1;_flushing=0;_nextPriority=null;constructor(t,e){this.state=t,this.options=e}subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}};setState=(t,e)=>{const s=this.state;this.state=this.options?.updateFn?this.options.updateFn(s)(t):t(s);const r=e?.priority??this.options?.defaultPriority??"high";null===this._nextPriority||"high"===this._nextPriority?this._nextPriority=r:this._nextPriority=this.options?.defaultPriority??"high",this.options?.onUpdate?.({priority:this._nextPriority}),this._flush()};_flush=()=>{if(this._batching)return;const t=++this._flushing;this.listeners.forEach((e=>{this._flushing===t&&e({priority:this._nextPriority??"high"})}))};batch=t=>{if(this._batching)return t();this._batching=!0,t(),this._batching=!1,this._flush()}}const T=k(JSON.parse),j=H(JSON.stringify,JSON.parse);function k(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let s=D(e);for(let e in s){const r=s[e];if("string"==typeof r)try{s[e]=t(r)}catch(t){}}return s}}function H(t,e){return s=>{(s={...s})&&Object.keys(s).forEach((r=>{const o=s[r];void 0===o||void 0===o?delete s[r]:s[r]=function(s){if("object"==typeof s&&null!==s)try{return t(s)}catch(t){}else if("string"==typeof s&&"function"==typeof e)try{return e(s),t(s)}catch(t){}return s}(o)}));const r=A(s).toString();return r?`?${r}`:""}}const N=["component","errorComponent","pendingComponent"],F="visibilitychange",U="focus",Y="Error preloading route! ☝️";const J="undefined"==typeof window||!window.document.createElement;function W(){return{status:"idle",isFetching:!1,resolvedLocation:null,location:null,matchesById:{},matchIds:[],pendingMatchIds:[],matches:[],pendingMatches:[],renderedMatchIds:[],renderedMatches:[],lastUpdated:Date.now()}}function K(t){return!!t?.isRedirect}class X extends Error{}class z extends Error{}function q(t,e){const s=Date.now();return!!t.invalid||(e?.preload?!(t.preloadMaxAge<0)&&t.updatedAt+t.preloadMaxAge<s:!(t.maxAge<0)&&t.updatedAt+t.maxAge<s)}const V="window",G="___";let Q,Z={},tt=!1;const et="undefined"!=typeof window&&window.sessionStorage,st=t=>t.key;t.FileRoute=class{constructor(t){this.path=t}createRoute=t=>{const e=new O(t);return e.isRoot=!1,e}},t.PathParamError=z,t.RootRoute=$,t.Route=O,t.Router=class{#t;resetNextScroll=!1;constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??j,parseSearch:t?.parseSearch??T},this.__store=new C(W(),{onUpdate:()=>{const t=this.state,e=this.__store.state,s=t.matchesById!==e.matchesById;let r,o;if(s||(r=t.matchIds.length!==e.matchIds.length||t.matchIds.some(((t,s)=>t!==e.matchIds[s])),o=t.pendingMatchIds.length!==e.pendingMatchIds.length||t.pendingMatchIds.some(((t,s)=>t!==e.pendingMatchIds[s]))),(s||r)&&(e.matches=e.matchIds.map((t=>e.matchesById[t]))),(s||o)&&(e.pendingMatches=e.pendingMatchIds.map((t=>e.matchesById[t]))),s||r||o){const t=e.pendingMatches.some((t=>!!this.getRoute(t.routeId)?.options.pendingComponent));e.renderedMatchIds=t?e.pendingMatchIds:e.matchIds,e.renderedMatches=e.renderedMatchIds.map((t=>e.matchesById[t]))}e.isFetching=[...e.matches,...e.pendingMatches].some((t=>t.isFetching)),this.state=e},defaultPriority:"low"}),this.state=this.__store.state,this.update(t);const e=this.buildNext({hash:!0,fromCurrent:!0,search:!0,state:!0});this.state.location.href!==e.href&&this.#e({...e,replace:!0})}subscribers=new Set;subscribe=(t,e)=>{const s={eventType:t,fn:e};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}};#s=t=>{this.subscribers.forEach((e=>{e.eventType===t.type&&e.fn(t)}))};reset=()=>{this.__store.setState((t=>Object.assign(t,W())))};mount=()=>("undefined"!=typeof window&&window.addEventListener&&(window.addEventListener(F,this.#r,!1),window.addEventListener(U,this.#r,!1)),this.safeLoad(),()=>{"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener(F,this.#r),window.removeEventListener(U,this.#r))});#r=()=>{(this.options.refetchOnWindowFocus??1)&&this.invalidate()};update=t=>{if(this.options={...this.options,...t,context:{...this.options.context,...t?.context}},!this.history||this.options.history&&this.options.history!==this.history){this.#t&&this.#t(),this.history=this.options.history??(J?h():c());const t=this.#o();this.__store.setState((e=>({...e,resolvedLocation:t,location:t}))),this.#t=this.history.subscribe((()=>{this.safeLoad({next:this.#o(this.state.location)})}))}const{basepath:e,routeTree:s}=this.options;return this.basepath=`/${R(e??"")??""}`,s&&s!==this.routeTree&&this.#a(s),this};buildNext=t=>{const e=this.#n(t),s=this.matchRoutes(e.pathname,e.search);return this.#n({...t,__matches:s})};cancelMatches=()=>{this.state.matches.forEach((t=>{this.cancelMatch(t.id)}))};cancelMatch=t=>{this.getRouteMatch(t)?.abortController?.abort()};safeLoad=async t=>{try{return this.load(t)}catch(t){}};latestLoadPromise=Promise.resolve();load=async t=>{const e=new Promise((async(s,r)=>{const o=this.state.resolvedLocation,a=!(!t?.next||o.href===t.next.href);let n;const i=()=>this.latestLoadPromise!==e?this.latestLoadPromise:void 0;let c;this.#s({type:"onBeforeLoad",from:o,to:t?.next??this.state.location,pathChanged:a}),this.__store.batch((()=>{t?.next&&this.__store.setState((e=>({...e,location:t.next}))),c=this.matchRoutes(this.state.location.pathname,this.state.location.search,{throwOnError:t?.throwOnError,debug:!0}),this.__store.setState((t=>({...t,status:"pending",pendingMatchIds:c.map((t=>t.id)),matchesById:this.#i(t.matchesById,c)})))}));try{try{await this.loadMatches(c)}catch(t){}if(n=i())return n;const t=this.state.matchIds.filter((t=>!this.state.pendingMatchIds.includes(t))),e=this.state.pendingMatchIds.filter((t=>!this.state.matchIds.includes(t))),r=this.state.matchIds.filter((t=>this.state.pendingMatchIds.includes(t)));this.__store.setState((t=>({...t,status:"idle",resolvedLocation:t.location,matchIds:t.pendingMatchIds,pendingMatchIds:[]}))),[[t,"onLeave"],[e,"onEnter"],[r,"onTransition"]].forEach((([t,e])=>{t.forEach((t=>{const s=this.getRouteMatch(t);this.getRoute(s.routeId).options[e]?.(s)}))})),this.#s({type:"onLoad",from:o,to:this.state.location,pathChanged:a}),s()}catch(t){if(n=i())return n;r(t)}}));return this.latestLoadPromise=e,this.latestLoadPromise.then((()=>{this.cleanMatches()})),this.latestLoadPromise};#i=(t,e)=>({...t,...Object.fromEntries(e.map((t=>[t.id,t])))});getRoute=t=>{const s=this.routesById[t];return e(s),s};preloadRoute=async(t=this.state.location)=>{const e=this.buildNext(t),s=this.matchRoutes(e.pathname,e.search,{throwOnError:!0});return this.__store.setState((t=>({...t,matchesById:this.#i(t.matchesById,s)}))),await this.loadMatches(s,{preload:!0,maxAge:t.maxAge}),s};cleanMatches=()=>{const t=Date.now(),e=Object.values(this.state.matchesById).filter((e=>{const s=this.getRoute(e.routeId);return!(this.state.matchIds.includes(e.id)||this.state.pendingMatchIds.includes(e.id)||e.preloadMaxAge>-1&&!(e.updatedAt+e.preloadMaxAge<t)||s.options.gcMaxAge&&!(e.updatedAt+s.options.gcMaxAge<t))})).map((t=>t.id));e.length&&this.__store.setState((t=>{const s={...t.matchesById};return e.forEach((t=>{delete s[t]})),{...t,matchesById:s}}))};matchRoutes=(t,e,s)=>{let r={},o=this.flatRoutes.find((e=>{const s=E(this.basepath,S(t),{to:e.fullPath,caseSensitive:e.options.caseSensitive??this.options.caseSensitive});return!!s&&(r=s,!0)}))||this.routesById.__root__,a=[o];for(;o?.parentRoute;)o=o.parentRoute,o&&a.unshift(o);const n=a.map((t=>{let e;if(t.options.parseParams)try{const e=t.options.parseParams(r);Object.assign(r,e)}catch(t){if(e=new z(t.message,{cause:t}),s?.throwOnError)throw e;return e}})),i=a.map(((t,s)=>{const o=M(t.path,r),a=t.options.key?t.options.key({params:r,search:e})??"":"",i=a?JSON.stringify(a):"",c=M(t.id,r,!0)+i,h=this.getRouteMatch(c);if(h)return{...h};const l=!(!t.options.loader&&!N.some((e=>t.options[e]?.preload)));return{id:c,key:i,routeId:t.id,params:r,pathname:v([this.basepath,o]),updatedAt:Date.now(),maxAge:-1,preloadMaxAge:-1,routeSearch:{},search:{},status:l?"pending":"success",isFetching:!1,invalid:!1,error:void 0,paramsError:n[s],searchError:void 0,loaderData:void 0,loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchedAt:0}}));return i.forEach(((t,r)=>{const o=i[r-1],a=this.getRoute(t.routeId),n=(()=>{const r={search:o?.search??e,routeSearch:o?.routeSearch??e};try{let e=("object"==typeof a.options.validateSearch?a.options.validateSearch.parse:a.options.validateSearch)?.(r.search)??{},s={...r.search,...e};return e=m(t.routeSearch,e),s=m(t.search,s),{routeSearch:e,search:s,searchDidChange:t.routeSearch!==e}}catch(e){if(t.searchError=new X(e.message,{cause:e}),s?.throwOnError)throw t.searchError;return r}})();Object.assign(t,n)})),i};loadMatches=async(t,e)=>{const s=()=>t.map((t=>this.getRouteMatch(t.id)));let r;e?.preload||s().forEach((t=>{this.setRouteMatch(t.id,(e=>({...e,routeSearch:t.routeSearch,search:t.search,routeContext:t.routeContext,context:t.context,error:t.error,paramsError:t.paramsError,searchError:t.searchError,params:t.params,preloadMaxAge:0})))}));try{for(const[t,o]of s().entries()){const a=s()[t-1],n=this.getRoute(o.routeId),i=(e,s)=>{if(e.routerCode=s,r=r??t,K(e))throw e;try{n.options.onError?.(e)}catch(t){if(e=t,K(t))throw t}this.setRouteMatch(o.id,(t=>({...t,error:e,status:"error",updatedAt:Date.now()})))};o.paramsError&&i(o.paramsError,"PARSE_PARAMS"),o.searchError&&i(o.searchError,"VALIDATE_SEARCH");let c=!1;try{const t=await(n.options.beforeLoad?.({...o,preload:!!e?.preload,parentContext:a?.routeContext??{},context:a?.context??this?.options.context??{}}))??{},s={...a?.context??this?.options.context,...t};this.setRouteMatch(o.id,(e=>({...e,context:s,routeContext:t})))}catch(t){i(t,"BEFORE_LOAD"),c=!0}if(c)break}}catch(t){throw e?.preload||this.navigate(t),t}const o=s().slice(0,r),a=[];o.forEach(((t,s)=>{a.push((async()=>{const r=a[s-1],o=this.getRoute(t.routeId);if(t.isFetching||"success"===t.status&&!q(t,{preload:e?.preload}))return this.getRouteMatch(t.id)?.loadPromise;const n=Date.now(),i=()=>{const e=this.getRouteMatch(t.id);return e&&e.fetchedAt!==n?e.loadPromise:void 0},c=t=>!!K(t)&&(e?.preload||this.navigate(t),!0),h=async()=>{let s;try{const a=Promise.all(N.map((async t=>{const e=o.options[t];e?.preload&&await e.preload()}))),n=o.options.loader?.({...t,preload:!!e?.preload,parentMatchPromise:r}),[c,h]=await Promise.all([a,n]);if(s=i())return await s;this.setRouteMatchData(t.id,(()=>h),e)}catch(e){if(s=i())return await s;if(c(e))return;try{o.options.onError?.(e)}catch(t){if(e=t,c(t))return}this.setRouteMatch(t.id,(t=>({...t,error:e,status:"error",isFetching:!1,updatedAt:Date.now()})))}};let l;this.__store.batch((()=>{this.setRouteMatch(t.id,(t=>({...t,isFetching:!0,fetchedAt:n,invalid:!1}))),l=h(),this.setRouteMatch(t.id,(t=>({...t,loadPromise:l})))})),await l})())})),await Promise.all(a)};resolvePath=(t,e)=>I(this.basepath,t,b(e));navigate=async({from:t,to:s="",search:r,hash:o,replace:a,params:n,resetScroll:i})=>{const c=String(s),h=void 0===t?t:String(t);let l;try{new URL(`${c}`),l=!0}catch(t){}return e(!l),this.#e({from:h,to:c,search:r,hash:o,replace:a,params:n,resetScroll:i})};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePath(t.from??"",t.to):void 0};const s=this.buildNext(t);if(e?.pending&&"pending"!==this.state.status)return!1;const r=e?.pending?this.state.location:this.state.resolvedLocation;if(!r)return!1;const o=E(this.basepath,r.pathname,{...e,to:s.pathname});return!!o&&(e?.includeSearch??1?!!w(r.search,s.search)&&o:o)};buildLink=({from:t,to:e=".",search:s,params:r,hash:o,target:a,replace:n,activeOptions:i,preload:c,preloadDelay:h,disabled:l,state:d,resetScroll:u})=>{try{return new URL(`${e}`),{type:"external",href:e}}catch(t){}const p={from:t,to:e,search:s,params:r,hash:o,replace:n,state:d,resetScroll:u},f=this.buildNext(p);c=c??this.options.defaultPreload;const m=h??this.options.defaultPreloadDelay??0,y=this.state.location.pathname.split("/"),g=f.pathname.split("/").every(((t,e)=>t===y[e])),v=i?.exact?this.state.location.pathname===f.pathname:g,b=!i?.includeHash||this.state.location.hash===f.hash,_=!(i?.includeSearch??1)||w(this.state.location.search,f.search);return{type:"internal",next:f,handleFocus:t=>{c&&this.preloadRoute(p).catch((t=>{console.warn(t),console.warn(Y)}))},handleClick:t=>{l||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||a&&"_self"!==a||0!==t.button||(t.preventDefault(),this.#e(p))},handleEnter:t=>{const e=t.target||{};if(c){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,this.preloadRoute(p).catch((t=>{console.warn(t),console.warn(Y)}))}),m)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},handleTouchStart:t=>{this.preloadRoute(p).catch((t=>{console.warn(t),console.warn(Y)}))},isActive:v&&b&&_,disabled:l}};dehydrate=()=>({state:{matchIds:this.state.matchIds,dehydratedMatches:this.state.matches.map((t=>f(t,["fetchedAt","invalid","preloadMaxAge","maxAge","id","loaderData","status","updatedAt"])))}});hydrate=async t=>{let s=t;"undefined"!=typeof document&&(s=window.__TSR_DEHYDRATED__),e(s);const r=s;this.dehydratedData=r.payload,this.options.hydrate?.(r.payload);const o=r.router.state;let a=this.matchRoutes(this.state.location.pathname,this.state.location.search).map((t=>{const s=o.dehydratedMatches.find((e=>e.id===t.id));return e(s,t.id),s?{...t,...s}:t}));this.__store.setState((t=>({...t,matchIds:o.matchIds,matches:a,matchesById:this.#i(t.matchesById,a)})))};injectedHtml=[];injectHtml=async t=>{this.injectedHtml.push(t)};dehydrateData=(t,e)=>{if("undefined"==typeof document){const s="string"==typeof t?t:JSON.stringify(t);return this.injectHtml((async()=>{const t=`__TSR_DEHYDRATED__${s}`,r="function"==typeof e?await e():e;return`<script id='${t}' suppressHydrationWarning>window["__TSR_DEHYDRATED__${o=s,o.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}"] = ${JSON.stringify(r)}\n ;(() => {\n var el = document.getElementById('${t}')\n el.parentElement.removeChild(el)\n })()\n <\/script>`;var o})),()=>this.hydrateData(t)}return()=>{}};hydrateData=t=>{if("undefined"!=typeof document){const e="string"==typeof t?t:JSON.stringify(t);return window[`__TSR_DEHYDRATED__${e}`]}};#a=t=>{this.routeTree=t,this.routesById={},this.routesByPath={},this.flatRoutes=[];const s=t=>{t.forEach(((t,r)=>{t.init({originalIndex:r,router:this});if(e(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=S(t.fullPath);this.routesByPath[e]&&!t.fullPath.endsWith("/")||(this.routesByPath[e]=t)}const o=t.children;o?.length&&s(o)}))};s([t]),this.flatRoutes=Object.values(this.routesByPath).map(((t,e)=>{const s=R(t.fullPath),r=x(s);for(;r.length>1&&"/"===r[0]?.value;)r.shift();const o=r.map((t=>"param"===t.type?.5:"wildcard"===t.type?.25:1));return{child:t,trimmed:s,parsed:r,index:e,score:o}})).sort(((t,e)=>{let s="/"===t.trimmed?1:"/"===e.trimmed?-1:0;if(0!==s)return s;const r=Math.min(t.score.length,e.score.length);if(t.score.length!==e.score.length)return e.score.length-t.score.length;for(let s=0;s<r;s++)if(t.score[s]!==e.score[s])return e.score[s]-t.score[s];for(let s=0;s<r;s++)if(t.parsed[s].value!==e.parsed[s].value)return t.parsed[s].value>e.parsed[s].value?1:-1;return t.trimmed!==e.trimmed?t.trimmed>e.trimmed?1:-1:t.index-e.index})).map(((t,e)=>(t.child.rank=e,t.child)))};#o=t=>{let{pathname:e,search:s,hash:r,state:o}=this.history.location;const a=this.options.parseSearch(s);return{pathname:e,searchStr:s,search:m(t?.search,a),hash:r.split("#").reverse()[0]??"",href:`${e}${s}${r}`,state:o,key:o?.key||"__init__"}};#n=(t={})=>{t.fromCurrent=t.fromCurrent??""===t.to;const e=t.fromCurrent?this.state.location.pathname:t.from??this.state.location.pathname;let s=I(this.basepath??"/",e,`${t.to??""}`);const r={...u(this.matchRoutes(this.state.location.pathname,this.state.location.search))?.params};let o=!0===(t.params??!0)?r:p(t.params,r);o&&t.__matches?.map((t=>this.getRoute(t.routeId).options.stringifyParams)).filter(Boolean).forEach((t=>{o={...o,...t(o)}})),s=M(s,o??{});const a=t.__matches?.map((t=>this.getRoute(t.routeId).options.preSearchFilters??[])).flat().filter(Boolean)??[],n=t.__matches?.map((t=>this.getRoute(t.routeId).options.postSearchFilters??[])).flat().filter(Boolean)??[],i=a?.length?a?.reduce(((t,e)=>e(t)),this.state.location.search):this.state.location.search,c=!0===t.search?i:t.search?p(t.search,i)??{}:a?.length?i:{},h=n?.length?n.reduce(((t,e)=>e(t)),c):c,l=m(this.state.location.search,h),d=this.options.stringifySearch(l),f=!0===t.hash?this.state.location.hash:p(t.hash,this.state.location.hash),y=f?`#${f}`:"";return{pathname:s,search:l,searchStr:d,state:!0===t.state?this.state.location.state:p(t.state,this.state.location.state),hash:f,href:this.history.createHref(`${s}${d}${y}`),key:t.key}};#e=async t=>{const e=this.buildNext(t);this.navigateTimeout&&clearTimeout(this.navigateTimeout);let s="replace";t.replace||(s="push");this.state.location.href===e.href&&!e.key&&(s="replace");const r=`${e.pathname}${e.searchStr}${e.hash?`#${e.hash}`:""}`;return this.history["push"===s?"push":"replace"](r,e.state),this.resetNextScroll=t.resetScroll??!0,this.latestLoadPromise};getRouteMatch=t=>this.state.matchesById[t];setRouteMatch=(t,e)=>{this.__store.setState((s=>s.matchesById[t]?{...s,matchesById:{...s.matchesById,[t]:e(s.matchesById[t])}}:s))};setRouteMatchData=(t,e,s)=>{const r=this.getRouteMatch(t);if(!r)return;const o=this.getRoute(r.routeId),a=s?.updatedAt??Date.now(),n=s?.maxAge??o.options.preloadMaxAge??this.options.defaultPreloadMaxAge??5e3,i=s?.maxAge??o.options.maxAge??this.options.defaultMaxAge??-1;this.setRouteMatch(t,(t=>({...t,error:void 0,status:"success",isFetching:!1,updatedAt:a,loaderData:p(e,t.loaderData),preloadMaxAge:n,maxAge:i})))};invalidate=async t=>{if(t?.matchId){this.setRouteMatch(t.matchId,(t=>({...t,invalid:!0})));const e=this.state.matches.findIndex((e=>e.id===t.matchId)),s=this.state.matches[e+1];if(s)return this.invalidate({matchId:s.id,reload:!1})}else this.__store.batch((()=>{Object.values(this.state.matchesById).forEach((t=>{this.setRouteMatch(t.id,(t=>({...t,invalid:!0})))}))}));if(t?.reload??1)return this.navigate({fromCurrent:!0,replace:!0,search:!0})}},t.RouterContext=class{constructor(){}createRootRoute=t=>new $(t)},t.SearchParamError=X,t.cleanPath=b,t.componentTypes=N,t.createBrowserHistory=c,t.createHashHistory=function(){return c({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=h,t.decode=D,t.defaultParseSearch=T,t.defaultStringifySearch=j,t.defer=function(t){const e=t;if(!e.__deferredState){e.__deferredState={uid:Math.random().toString(36).slice(2),status:"pending"};const t=e.__deferredState;e.then((e=>{t.status="success",t.data=e})).catch((e=>{t.status="error",t.error=e}))}return e},t.encode=A,t.functionalUpdate=p,t.interpolatePath=M,t.invariant=e,t.isDehydratedDeferred=function(t){return"object"==typeof t&&null!==t&&!(t instanceof Promise)&&!t.then&&"__deferredState"in t},t.isMatchInvalid=q,t.isPlainObject=y,t.isRedirect=K,t.joinPaths=v,t.last=u,t.lazyFn=function(t,e){return async(...s)=>(await t())[e||"default"](...s)},t.matchByPath=P,t.matchPathname=E,t.parsePathname=x,t.parseSearchWith=k,t.partialDeepEqual=w,t.pick=f,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=m,t.resolvePath=I,t.restoreScrollPositions=function(t,e){if(tt){if(!t.resetNextScroll)return;tt=!1;const s=(e?.getKey||st)(t.state.location);let r=!1;for(const t in Q.current){const e=Q.current[t],[o,a]=t.split(G);if(o===s)if(a===V)r=!0,window.scrollTo(e.scrollX,e.scrollY);else if(a){const t=document.querySelector(a);t&&(t.scrollLeft=e.scrollX,t.scrollTop=e.scrollY)}}r||window.scrollTo(0,0)}},t.rootRouteId=B,t.stringifySearchWith=H,t.trimPath=R,t.trimPathLeft=_,t.trimPathRight=S,t.warning=function(t,e){},t.watchScrollPositions=function(t,e){const s=e?.getKey||st;et&&(Q||(Q=(()=>{const t="tsr-scroll-restoration-v1",e=JSON.parse(window.sessionStorage.getItem(t)||"{}");return{current:e,set:(s,r)=>{e[s]=r,window.sessionStorage.setItem(t,JSON.stringify(Q))}}})()));const{history:r}=window;r.scrollRestoration&&(r.scrollRestoration="manual");const o=e=>{const r=s(t.state.resolvedLocation);Z[r]||(Z[r]=new WeakSet);const o=Z[r];if(o.has(e.target))return;o.add(e.target);const n=[r,e.target===document||e.target===window?V:a(e.target)].join(G);Q.current[n]||Q.set(n,{scrollX:NaN,scrollY:NaN})},a=t=>{let e,s=[];for(;e=t.parentNode;)s.unshift(`${t.tagName}:nth-child(${[].indexOf.call(e.children,t)+1})`),t=e;return`${s.join(" > ")}`.toLowerCase()};"undefined"!=typeof document&&document.addEventListener("scroll",o,!0);const n=t.subscribe("onBeforeLoad",(t=>{t.pathChanged&&(t=>{const e=s(t);for(const t in Q.current){const s=Q.current[t],[r,o]=t.split(G);if(e===r){if(o===V)s.scrollX=window.scrollX||0,s.scrollY=window.scrollY||0;else if(o){const t=document.querySelector(o);s.scrollX=t?.scrollLeft||0,s.scrollY=t?.scrollTop||0}Q.set(t,s)}}})(t.from)})),i=t.subscribe("onLoad",(t=>{t.pathChanged&&(tt=!0)}));return()=>{document.removeEventListener("scroll",o),n(),i()}},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map
{
"name": "@tanstack/router-core",
"author": "Tanner Linsley",
"version": "0.0.1-beta.183",
"version": "0.0.1-beta.184",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": "tanstack/router",

@@ -66,4 +66,2 @@ import { decode, encode } from './qss'

delete search[key]
} else if (Array.isArray(val)) {
search[key] = val.map(stringifyValue)
} else {

@@ -70,0 +68,0 @@ search[key] = stringifyValue(val)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc