Socket
Socket
Sign inDemoInstall

@tanstack/react-router

Package Overview
Dependencies
Maintainers
1
Versions
581
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/react-router - npm Package Compare versions

Comparing version 0.0.1-beta.36 to 0.0.1-beta.37

1

build/cjs/index.js

@@ -203,3 +203,2 @@ /**

useRouterSubscription(router);
routerCore.invariant(routeId !== routerCore.rootRouteId, "\"" + routerCore.rootRouteId + "\" cannot be used with useMatch! Did you mean to useRoute(\"" + routerCore.rootRouteId + "\")?");
const nearestMatch = useNearestMatch();

@@ -206,0 +205,0 @@ const match = router.state.currentMatches.find(d => d.routeId === routeId);

@@ -206,3 +206,2 @@ /**

useRouterSubscription(router);
invariant(routeId !== rootRouteId, "\"" + rootRouteId + "\" cannot be used with useMatch! Did you mean to useRoute(\"" + rootRouteId + "\")?");
const nearestMatch = useNearestMatch();

@@ -209,0 +208,0 @@ const match = router.state.currentMatches.find(d => d.routeId === routeId);

96

build/stats-react.json

@@ -10,3 +10,3 @@ {

{
"uid": "3603-73",
"uid": "b631-73",
"name": "\u0000rollupPluginBabelHelpers.js"

@@ -19,11 +19,11 @@ },

"name": "@babel+runtime@7.20.6/node_modules/@babel/runtime/helpers/esm/extends.js",
"uid": "3603-75"
"uid": "b631-75"
},
{
"name": "history@5.3.0/node_modules/history/index.js",
"uid": "3603-77"
"uid": "b631-77"
},
{
"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"uid": "3603-79"
"uid": "b631-79"
}

@@ -37,7 +37,7 @@ ]

"name": "router-core/build/esm/index.js",
"uid": "3603-81"
"uid": "b631-81"
},
{
"name": "react-router/src/index.tsx",
"uid": "3603-83"
"uid": "b631-83"
}

@@ -52,44 +52,44 @@ ]

"nodeParts": {
"3603-73": {
"b631-73": {
"renderedLength": 793,
"gzipLength": 363,
"brotliLength": 0,
"mainUid": "3603-72"
"mainUid": "b631-72"
},
"3603-75": {
"b631-75": {
"renderedLength": 435,
"gzipLength": 241,
"brotliLength": 0,
"mainUid": "3603-74"
"mainUid": "b631-74"
},
"3603-77": {
"b631-77": {
"renderedLength": 20630,
"gzipLength": 3800,
"brotliLength": 0,
"mainUid": "3603-76"
"mainUid": "b631-76"
},
"3603-79": {
"b631-79": {
"renderedLength": 181,
"gzipLength": 129,
"brotliLength": 0,
"mainUid": "3603-78"
"mainUid": "b631-78"
},
"3603-81": {
"b631-81": {
"renderedLength": 55587,
"gzipLength": 12436,
"brotliLength": 0,
"mainUid": "3603-80"
"mainUid": "b631-80"
},
"3603-83": {
"renderedLength": 14205,
"gzipLength": 3538,
"b631-83": {
"renderedLength": 14157,
"gzipLength": 3525,
"brotliLength": 0,
"mainUid": "3603-82"
"mainUid": "b631-82"
}
},
"nodeMetas": {
"3603-72": {
"b631-72": {
"id": "\u0000rollupPluginBabelHelpers.js",
"moduleParts": {
"index.production.js": "3603-73"
"index.production.js": "b631-73"
},

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

{
"uid": "3603-82"
"uid": "b631-82"
}
]
},
"3603-74": {
"b631-74": {
"id": "/node_modules/.pnpm/@babel+runtime@7.20.6/node_modules/@babel/runtime/helpers/esm/extends.js",
"moduleParts": {
"index.production.js": "3603-75"
"index.production.js": "b631-75"
},

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

{
"uid": "3603-76"
"uid": "b631-76"
}
]
},
"3603-76": {
"b631-76": {
"id": "/node_modules/.pnpm/history@5.3.0/node_modules/history/index.js",
"moduleParts": {
"index.production.js": "3603-77"
"index.production.js": "b631-77"
},
"imported": [
{
"uid": "3603-74"
"uid": "b631-74"
}

@@ -129,10 +129,10 @@ ],

{
"uid": "3603-80"
"uid": "b631-80"
}
]
},
"3603-78": {
"b631-78": {
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"moduleParts": {
"index.production.js": "3603-79"
"index.production.js": "b631-79"
},

@@ -142,17 +142,17 @@ "imported": [],

{
"uid": "3603-80"
"uid": "b631-80"
}
]
},
"3603-80": {
"b631-80": {
"id": "/packages/router-core/build/esm/index.js",
"moduleParts": {
"index.production.js": "3603-81"
"index.production.js": "b631-81"
},
"imported": [
{
"uid": "3603-76"
"uid": "b631-76"
},
{
"uid": "3603-78"
"uid": "b631-78"
}

@@ -162,23 +162,23 @@ ],

{
"uid": "3603-82"
"uid": "b631-82"
}
]
},
"3603-82": {
"b631-82": {
"id": "/packages/react-router/src/index.tsx",
"moduleParts": {
"index.production.js": "3603-83"
"index.production.js": "b631-83"
},
"imported": [
{
"uid": "3603-72"
"uid": "b631-72"
},
{
"uid": "3603-84"
"uid": "b631-84"
},
{
"uid": "3603-85"
"uid": "b631-85"
},
{
"uid": "3603-80"
"uid": "b631-80"
}

@@ -189,3 +189,3 @@ ],

},
"3603-84": {
"b631-84": {
"id": "react",

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

{
"uid": "3603-82"
"uid": "b631-82"
}

@@ -202,3 +202,3 @@ ],

},
"3603-85": {
"b631-85": {
"id": "use-sync-external-store/shim",

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

{
"uid": "3603-82"
"uid": "b631-82"
}

@@ -212,0 +212,0 @@ ],

@@ -21,3 +21,3 @@ /**

* @license MIT
*/function _(t,e){if(t===e)return t;const a=Array.isArray(t)&&Array.isArray(e);if(a||L(t)&&L(e)){const n=a?t.length:Object.keys(t).length,r=a?e:Object.keys(e),o=r.length,s=a?[]:{};let i=0;for(let n=0;n<o;n++){const o=a?n:r[n];s[o]=_(t[o],e[o]),s[o]===t[o]&&i++}return n===o&&i===n?t:s}return e}function L(t){if(!P(t))return!1;const e=t.constructor;if(void 0===e)return!0;const a=e.prototype;return!!P(a)&&!!a.hasOwnProperty("isPrototypeOf")}function P(t){return"[object Object]"===Object.prototype.toString.call(t)}function w(t){return t[t.length-1]}function E(t,e){if(t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}return!0}function M(t,e){return"function"==typeof t?t(e):t}function x(t,e){return e.reduce(((e,a)=>(e[a]=t[a],e)),{})}function R(t){return S(t.filter(Boolean).join("/"))}function S(t){return t.replace(/\/{2,}/g,"/")}function I(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function A(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function C(t){return A(I(t))}function k(t,e,a){e=e.replace(new RegExp("^"+t),"/"),a=a.replace(new RegExp("^"+t),"/");let n=O(e);const r=O(a);r.forEach(((t,e)=>{if("/"===t.value)e?e===r.length-1&&n.push(t):n=[t];else if(".."===t.value){var a;n.length>1&&"/"===(null==(a=w(n))?void 0:a.value)&&n.pop(),n.pop()}else{if("."===t.value)return;n.push(t)}}));return S(R([t,...n.map((t=>t.value))]))}function O(t){if(!t)return[];const e=[];if("/"===(t=S(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const a=t.split("/").filter(Boolean);return e.push(...a.map((t=>t.startsWith("*")?{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 D(t,e,a){return R(O(t).map((t=>{return"*"!==t.value||a?"param"===t.type?null!=(n=e[t.value.substring(1)])?n:"":t.value:"";var n})))}function j(t,e,a){const n=F(t,e,a);if(!a.to||n)return null!=n?n:{}}function F(t,e,a){var n;if(!e.startsWith(t))return;const r=O(e="/"!=t?e.substring(t.length):e),o=O(""+(null!=(n=a.to)?n:"*")),s={};return(()=>{for(let t=0;t<Math.max(r.length,o.length);t++){const e=r[t],n=o[t],i=t===o.length-1,c=t===r.length-1;if(n){if("wildcard"===n.type)return!(null==e||!e.value)&&(s["*"]=R(r.slice(t).map((t=>t.value))),!0);if("pathname"===n.type){if("/"===n.value&&(null==e||!e.value))return!0;if(e)if(a.caseSensitive){if(n.value!==e.value)return!1}else if(n.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===n.type){if("/"===(null==e?void 0:e.value))return!1;"$"!==e.value.charAt(0)&&(s[n.value.substring(1)]=e.value)}}if(i&&!c)return!!a.fuzzy}return!0})()?s:void 0}function T(t,e){var a,n,r,o="";for(a in t)if(void 0!==(r=t[a]))if(Array.isArray(r))for(n=0;n<r.length;n++)o&&(o+="&"),o+=encodeURIComponent(a)+"="+encodeURIComponent(r[n]);else o&&(o+="&"),o+=encodeURIComponent(a)+"="+encodeURIComponent(r);return(e||"")+o}function N(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function B(t){for(var e,a,n={},r=t.split("&");e=r.shift();)void 0!==n[a=(e=e.split("=")).shift()]?n[a]=[].concat(n[a],N(e.shift())):n[a]=N(e.shift());return n}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},U.apply(this,arguments)}function H(t,e,a,n){const{id:r,routeId:o,path:s,fullPath:i}=t,c=n.state.actions[r]||(n.state.actions[r]={submissions:[],submit:async(t,e)=>{var a;if(!u)return;const r=null==(a=null==e?void 0:e.invalidate)||a;null!=e&&e.multi||(c.submissions=c.submissions.filter((t=>t.isMulti)));const o={submittedAt:Date.now(),status:"pending",submission:t,isMulti:!(null==e||!e.multi)};c.current=o,c.latest=o,c.submissions.push(o),n.notify();try{const e=await(null==u.options.action?void 0:u.options.action(t));return o.data=e,r&&(n.invalidateRoute({to:".",fromCurrent:!0}),await n.reload()),o.status="success",e}catch(t){console.error(t),o.error=t,o.status="error"}finally{n.notify()}}},n.state.actions[r]),l=n.state.loaders[r]||(n.state.loaders[r]={pending:[],fetch:async t=>{if(!u)return;const e={loadedAt:Date.now(),loaderContext:t};l.current=e,l.latest=e,l.pending.push(e),n.notify();try{return await(null==u.options.loader?void 0:u.options.loader(t))}finally{l.pending=l.pending.filter((t=>t!==e)),n.notify()}}},n.state.loaders[r]);let u={routeInfo:void 0,routeId:r,routeRouteId:o,routePath:s,fullPath:i,options:e,router:n,childRoutes:void 0,parentRoute:a,action:c,loader:l,buildLink:t=>n.buildLink(U({},t,{from:i})),navigate:t=>n.navigate(U({},t,{from:i})),matchRoute:(t,e)=>n.matchRoute(U({},t,{from:i}),e)};return null==n.options.createRoute||n.options.createRoute({router:n,route:u}),u}const z="__root__",G=["component","errorComponent","pendingComponent"];function W(t,e,a){const n=U({},e,a,{router:t,routeSearch:{},search:{},childMatches:[],status:"idle",routeLoaderData:{},loaderData:{},isFetching:!1,isInvalid:!1,invalidAt:1/0,getIsInvalid:()=>{const t=Date.now();return n.isInvalid||n.invalidAt<t},__:{abortController:new AbortController,latestId:"",resolve:()=>{},notify:()=>{n.__.resolve(),n.router.notify()},validate:()=>{var e,a;const r=null!=(e=null==(a=n.parentMatch)?void 0:a.search)?e:t.state.currentLocation.search;try{var o;const t=n.routeSearch,e="object"==typeof n.options.validateSearch?n.options.validateSearch.parse:n.options.validateSearch;let a=_(t,null!=(o=null==e?void 0:e(r))?o:{});t!==a&&(n.isInvalid=!0),n.routeSearch=a,n.search=_(r,U({},r,a)),G.map((async t=>{const e=n.options[t];"function"!=typeof n.__[t]&&(n.__[t]=e)}))}catch(t){console.error(t);const e=new Error("Invalid search params found",{cause:t});return e.code="INVALID_SEARCH_PARAMS",n.status="error",void(n.error=e)}}},cancel:()=>{var t;null==(t=n.__.abortController)||t.abort()},invalidate:()=>{n.isInvalid=!0},hasLoaders:()=>!(!e.options.loader&&!G.some((t=>{var a;return null==(a=e.options[t])?void 0:a.preload}))),load:async e=>{const a=Date.now(),r=null!=e&&e.preload?Math.max(null==e?void 0:e.maxAge,null==e?void 0:e.gcMaxAge):0;if(null!=e&&e.preload&&r>0){if(t.state.currentMatches.find((t=>t.matchId===n.matchId)))return;t.matchCache[n.matchId]={gc:a+e.gcMaxAge,match:n}}if("success"===n.status&&n.getIsInvalid()||"error"===n.status||"idle"===n.status){const t=null!=e&&e.preload?null==e?void 0:e.maxAge:void 0;await n.fetch({maxAge:t})}},fetch:async e=>{const a=""+Date.now()+Math.random();n.__.latestId=a;const r=async()=>{if(a!==n.__.latestId)return new Promise((()=>{}))};"idle"===n.status&&(n.status="loading"),n.isInvalid=!1,n.__.loadPromise=new Promise((async a=>{n.isFetching=!0,n.__.resolve=a,n.__.componentsPromise=(async()=>{await Promise.all(G.map((async e=>{var a;const r=n.options[e];null!=(a=n.__[e])&&a.preload&&(n.__[e]=await t.options.loadComponent(r))})))})(),n.__.dataPromise=Promise.resolve().then((async()=>{try{var a,o,s;if(n.options.loader){const e=await t.loadMatchData(n);await r(),n.routeLoaderData=_(n.routeLoaderData,e)}return n.error=void 0,n.status="success",n.updatedAt=Date.now(),n.invalidAt=n.updatedAt+(null!=(a=null!=(o=null!=(s=null==e?void 0:e.maxAge)?s:n.options.loaderMaxAge)?o:t.options.defaultLoaderMaxAge)?a:0),n.routeLoaderData}catch(t){throw await r(),n.error=t,n.status="error",n.updatedAt=Date.now(),t}}));const o=async()=>{await r(),n.isFetching=!1,delete n.__.loadPromise,n.__.notify()};try{await Promise.all([n.__.componentsPromise,n.__.dataPromise.catch((()=>{}))]),o()}catch(t){o()}})),await n.__.loadPromise,await r()}});return n.hasLoaders()||(n.status="success"),n}const q=V(JSON.parse),K=$(JSON.stringify);function V(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let a=B(e);for(let e in a){const n=a[e];if("string"==typeof n)try{a[e]=t(n)}catch(t){}}return a}}function $(t){return e=>{(e=U({},e))&&Object.keys(e).forEach((a=>{const n=e[a];if(void 0===n||void 0===n)delete e[a];else if(n&&"object"==typeof n&&null!==n)try{e[a]=t(n)}catch(t){}}));const a=T(e).toString();return a?"?"+a:""}}var J;const X="undefined"==typeof window||!(null!=(J=window.document)&&J.createElement);function Q(){return{status:"idle",latestLocation:null,currentLocation:null,currentMatches:[],actions:{},loaders:{},lastUpdated:Date.now(),isFetching:!1,isPreloading:!1}}function Y(t){var e,a;const n=(null==t?void 0:t.history)||(X?d():h()),r=U({defaultLoaderGcMaxAge:3e5,defaultLoaderMaxAge:0,defaultPreloadMaxAge:2e3,defaultPreloadDelay:50,context:void 0},t,{stringifySearch:null!=(e=null==t?void 0:t.stringifySearch)?e:K,parseSearch:null!=(a=null==t?void 0:t.parseSearch)?a:q});let o={types:void 0,history:n,options:r,listeners:[],basepath:"",routeTree:void 0,routesById:{},resolveNavigation:()=>{},matchCache:{},state:Q(),reset:()=>{o.state=Q(),o.notify()},startedLoadingAt:Date.now(),subscribe:t=>(o.listeners.push(t),()=>{o.listeners=o.listeners.filter((e=>e!==t))}),getRoute:t=>o.routesById[t],notify:()=>{const t="loading"===o.state.status||o.state.currentMatches.some((t=>t.isFetching)),e=Object.values(o.matchCache).some((t=>t.match.isFetching&&!o.state.currentMatches.find((e=>e.matchId===t.match.matchId))));o.state.isFetching===t&&o.state.isPreloading===e||(o.state=U({},o.state,{isFetching:t,isPreloading:e})),Z(o.state.currentMatches),o.listeners.forEach((t=>t(o)))},dehydrate:()=>({state:U({},x(o.state,["latestLocation","currentLocation","status","lastUpdated"]),{currentMatches:o.state.currentMatches.map((t=>x(t,["matchId","status","routeLoaderData","loaderData","isInvalid","invalidAt"])))}),context:o.options.context}),hydrate:t=>{o.state.latestLocation=t.state.latestLocation,o.state.currentLocation=t.state.currentLocation,o.options.context=t.context;const e=o.matchRoutes(o.state.latestLocation.pathname,{strictParseParams:!0});e.forEach(((e,a)=>{const n=t.state.currentMatches[a];b(n),Object.assign(e,n)})),e.forEach((t=>t.__.validate())),o.state=U({},o.state,t,{currentMatches:e})},mount:()=>{o.state.currentMatches.length||o.load();const t=o.history.listen((t=>{o.load(o.__.parseLocation(t.location,o.state.latestLocation))}));return!X&&window.addEventListener&&(window.addEventListener("visibilitychange",o.onFocus,!1),window.addEventListener("focus",o.onFocus,!1)),()=>{t(),!X&&window.removeEventListener&&(window.removeEventListener("visibilitychange",o.onFocus),window.removeEventListener("focus",o.onFocus))}},onFocus:()=>{o.load()},update:t=>{var e;const a=(null==t?void 0:t.history)!==o.history;o.state.latestLocation&&!a||(null!=t&&t.history&&(o.history=t.history),o.state.latestLocation=o.__.parseLocation(o.history.location),o.state.currentLocation=o.state.latestLocation),Object.assign(o.options,t);const{basepath:n,routeConfig:r}=o.options;return o.basepath="/"+(null!=(e=C(null!=n?n:""))?e:""),r&&(o.routesById={},o.routeTree=o.__.buildRouteTree(r)),o},cancelMatches:()=>{var t;[...o.state.currentMatches,...null!=(t=o.state.pendingMatches)?t:[]].forEach((t=>{t.cancel()}))},load:async t=>{const e=Math.random();o.startedLoadingAt=e,t&&(o.state.latestLocation=t),o.cancelMatches();const a=o.matchRoutes(o.state.latestLocation.pathname,{strictParseParams:!0});"undefined"!=typeof document?o.state=U({},o.state,{status:"loading",pendingMatches:a,pendingLocation:o.state.latestLocation}):o.state=U({},o.state,{status:"loading",currentMatches:a,currentLocation:o.state.latestLocation}),o.notify();try{await o.loadMatches(a)}catch(t){console.log(t),b(!1)}if(o.startedLoadingAt!==e)return o.navigationPromise;const n=o.state.currentMatches,r=[],s=[];n.forEach((t=>{a.find((e=>e.matchId===t.matchId))?s.push(t):r.push(t)}));const i=a.filter((t=>!n.find((e=>e.matchId===t.matchId)))),c=Date.now();r.forEach((t=>{var e,a,n,r;null==t.__.onExit||t.__.onExit({params:t.params,search:t.routeSearch}),"error"!==t.status||t.isFetching||(t.status="idle",t.error=void 0);const s=Math.max(null!=(e=null!=(a=t.options.loaderGcMaxAge)?a:o.options.defaultLoaderGcMaxAge)?e:0,null!=(n=null!=(r=t.options.loaderMaxAge)?r:o.options.defaultLoaderMaxAge)?n:0);s>0&&(o.matchCache[t.matchId]={gc:s==1/0?Number.MAX_SAFE_INTEGER:c+s,match:t})})),s.forEach((t=>{null==t.options.onTransition||t.options.onTransition({params:t.params,search:t.routeSearch})})),i.forEach((t=>{t.__.onExit=null==t.options.onLoaded?void 0:t.options.onLoaded({params:t.params,search:t.search}),delete o.matchCache[t.matchId]})),o.startedLoadingAt===e&&(a.forEach((t=>{t.action&&(t.action.current=void 0,t.action.submissions=[])})),o.state=U({},o.state,{status:"idle",currentLocation:o.state.latestLocation,currentMatches:a,pendingLocation:void 0,pendingMatches:void 0}),o.notify(),o.resolveNavigation())},cleanMatchCache:()=>{const t=Date.now();Object.keys(o.matchCache).forEach((e=>{const a=o.matchCache[e];"loading"!==a.match.status&&(a.gc>0&&a.gc>t||delete o.matchCache[e])}))},loadRoute:async function(t){void 0===t&&(t=o.state.latestLocation);const e=o.buildNext(t),a=o.matchRoutes(e.pathname,{strictParseParams:!0});return await o.loadMatches(a),a},preloadRoute:async function(t,e){var a,n,r,s,i,c;void 0===t&&(t=o.state.latestLocation);const l=o.buildNext(t),u=o.matchRoutes(l.pathname,{strictParseParams:!0});return await o.loadMatches(u,{preload:!0,maxAge:null!=(a=null!=(n=null!=(r=e.maxAge)?r:o.options.defaultPreloadMaxAge)?n:o.options.defaultLoaderMaxAge)?a:0,gcMaxAge:null!=(s=null!=(i=null!=(c=e.gcMaxAge)?c:o.options.defaultPreloadGcMaxAge)?i:o.options.defaultLoaderGcMaxAge)?s:0}),u},matchRoutes:(t,e)=>{var a;o.cleanMatchCache();const n=[];if(!o.routeTree)return n;const r=[...o.state.currentMatches,...null!=(a=o.state.pendingMatches)?a:[]],s=async a=>{var i,c,l;const u=w(n);let h=null!=(i=null==u?void 0:u.params)?i:{};const d=null!=(c=null==o.options.filterRoutes?void 0:o.options.filterRoutes(a))?c:a;let f=[];const p=(a,n)=>(n.some((n=>{var r,s,i;if(!n.routePath&&null!=(r=n.childRoutes)&&r.length)return p([...f,n],n.childRoutes);const c=!!("/"!==n.routePath||null!=(s=n.childRoutes)&&s.length),l=j(o.basepath,t,{to:n.fullPath,fuzzy:c,caseSensitive:null!=(i=n.options.caseSensitive)?i:o.options.caseSensitive});if(l){let t;try{var u;t=null!=(u=null==n.options.parseParams?void 0:n.options.parseParams(l))?u:l}catch(t){if(null!=e&&e.strictParseParams)throw t}h=U({},h,t)}return l&&(f=[...a,n]),!!f.length})),!!f.length);if(p([],d),!f.length)return;f.forEach((t=>{var e;const a=D(t.routePath,h),s=D(t.routeId,h,!0),i=r.find((t=>t.matchId===s))||(null==(e=o.matchCache[s])?void 0:e.match)||W(o,t,{parentMatch:u,matchId:s,params:h,pathname:R([o.basepath,a])});n.push(i)}));const m=w(f);null!=(l=m.childRoutes)&&l.length&&s(m.childRoutes)};return s([o.routeTree]),Z(n),n},loadMatches:async(t,e)=>{t.forEach((async t=>{t.__.validate()})),await Promise.all(t.map((async t=>{try{await(null==t.options.beforeLoad?void 0:t.options.beforeLoad({router:o,match:t}))}catch(a){throw null!=e&&e.preload||null==t.options.onLoadError||t.options.onLoadError(a),a}})));const a=t.map((async t=>{var a;const n=t.search;null!=(a=n.__data)&&a.matchId&&n.__data.matchId!==t.matchId||(t.load(e),"success"!==t.status&&t.__.loadPromise&&await t.__.loadPromise)}));o.notify(),await Promise.all(a)},loadMatchData:async t=>{var e;if(X||!o.options.useServerData)return null!=(e=await(null==t.options.loader?void 0:t.options.loader({params:t.params,search:t.routeSearch,signal:t.__.abortController.signal})))?e:{};{const e=o.buildNext({to:".",search:e=>U({},null!=e?e:{},{__data:{matchId:t.matchId}})}),a=await fetch(e.href,{method:"GET"});if(a.ok)return a.json();throw new Error("Failed to fetch match data")}},invalidateRoute:t=>{var e;const a=o.buildNext(t),n=o.matchRoutes(a.pathname).map((t=>t.matchId));[...o.state.currentMatches,...null!=(e=o.state.pendingMatches)?e:[]].forEach((t=>{n.includes(t.matchId)&&t.invalidate()}))},reload:()=>o.__.navigate({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(t,e)=>k(o.basepath,t,S(e)),matchRoute:(t,e)=>{var a;t=U({},t,{to:t.to?o.resolvePath(null!=(a=t.from)?a:"",t.to):void 0});const n=o.buildNext(t);return null!=e&&e.pending?!!o.state.pendingLocation&&!!j(o.basepath,o.state.pendingLocation.pathname,U({},e,{to:n.pathname})):!!j(o.basepath,o.state.currentLocation.pathname,U({},e,{to:n.pathname}))},navigate:async t=>{let{from:e,to:a=".",search:n,hash:r,replace:s,params:i}=t;const c=String(a),l=String(e);let u;try{new URL(""+c),u=!0}catch(t){}return b(!u),o.__.navigate({from:l,to:c,search:n,hash:r,replace:s,params:i})},buildLink:t=>{var e,a;let{from:n,to:r=".",search:s,params:i,hash:c,target:l,replace:u,activeOptions:h,preload:d,preloadMaxAge:f,preloadGcMaxAge:p,preloadDelay:m,disabled:v}=t;try{return new URL(""+r),{type:"external",href:r}}catch(t){}const g={from:n,to:r,search:s,params:i,hash:c,replace:u},y=o.buildNext(g);d=null!=(e=d)?e:o.options.defaultPreload;const b=null!=(a=null!=m?m:o.options.defaultPreloadDelay)?a:0,_=o.state.currentLocation.pathname===y.pathname,L=o.state.currentLocation.pathname.split("/"),P=y.pathname.split("/").every(((t,e)=>t===L[e])),w=o.state.currentLocation.hash===y.hash,E=null!=h&&h.exact?_:P,M=null==h||!h.includeHash||w;return{type:"internal",next:y,handleFocus:t=>{d&&o.preloadRoute(g,{maxAge:f,gcMaxAge:p}).catch((t=>{console.log(t),console.warn("Error preloading route! ☝️")}))},handleClick:t=>{v||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||l&&"_self"!==l||0!==t.button||(t.preventDefault(),!_||s||c||o.invalidateRoute(g),o.__.navigate(g))},handleEnter:t=>{const e=t.target||{};if(d){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,o.preloadRoute(g,{maxAge:f,gcMaxAge:p}).catch((t=>{console.log(t),console.warn("Error preloading route! ☝️")}))}),b)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},isActive:E&&M,disabled:v}},buildNext:t=>{const e=o.__.buildLocation(t),a=o.matchRoutes(e.pathname),n=a.map((t=>{var e;return null!=(e=t.options.preSearchFilters)?e:[]})).flat().filter(Boolean),r=a.map((t=>{var e;return null!=(e=t.options.postSearchFilters)?e:[]})).flat().filter(Boolean);return o.__.buildLocation(U({},t,{__preSearchFilters:n,__postSearchFilters:r}))},__:{buildRouteTree:t=>{const e=(t,a)=>t.map((t=>{const n=H(t,t.options,a,o);if(o.routesById[n.routeId])throw new Error;o.routesById[n.routeId]=n;const r=t.children;return n.childRoutes=null!=r&&r.length?e(r,n):void 0,n}));return e([t])[0]},parseLocation:(t,e)=>{var a;const n=o.options.parseSearch(t.search);return{pathname:t.pathname,searchStr:t.search,search:_(null==e?void 0:e.search,n),hash:null!=(a=t.hash.split("#").reverse()[0])?a:"",href:""+t.pathname+t.search+t.hash,state:t.state,key:t.key}},navigate:t=>{const e=o.buildNext(t);return o.__.commitLocation(e,t.replace)},buildLocation:function(t){var e,a,n,r,s,i,c,l,u;void 0===t&&(t={});const h=t.fromCurrent?o.state.latestLocation.pathname:null!=(e=t.from)?e:o.state.latestLocation.pathname;let d=k(null!=(a=o.basepath)?a:"/",h,""+(null!=(n=t.to)?n:"."));const f=o.matchRoutes(o.state.latestLocation.pathname,{strictParseParams:!0}),p=o.matchRoutes(d),m=U({},null==(r=w(f))?void 0:r.params);let v=!0===(null==(s=t.params)||s)?m:M(t.params,m);v&&p.map((t=>t.options.stringifyParams)).filter(Boolean).forEach((t=>{Object.assign({},v,t(v))})),d=D(d,null!=v?v:{});const g=null!=(i=t.__preSearchFilters)&&i.length?t.__preSearchFilters.reduce(((t,e)=>e(t)),o.state.latestLocation.search):o.state.latestLocation.search,y=!0===t.search?g:t.search?null!=(c=M(t.search,g))?c:{}:null!=(l=t.__preSearchFilters)&&l.length?g:{},b=null!=(u=t.__postSearchFilters)&&u.length?t.__postSearchFilters.reduce(((t,e)=>e(t)),y):y,L=_(o.state.latestLocation.search,b),P=o.options.stringifySearch(L);let E=!0===t.hash?o.state.latestLocation.hash:M(t.hash,o.state.latestLocation.hash);return E=E?"#"+E:"",{pathname:d,search:L,searchStr:P,state:o.state.latestLocation.state,hash:E,href:""+d+P+E,key:t.key}},commitLocation:(t,e)=>{const a=""+Date.now()+Math.random();o.navigateTimeout&&clearTimeout(o.navigateTimeout);let r="replace";e||(r="push");return o.__.parseLocation(n.location).href===t.href&&!t.key&&(r="replace"),"replace"===r?n.replace({pathname:t.pathname,hash:t.hash,search:t.searchStr},U({id:a},t.state)):n.push({pathname:t.pathname,hash:t.hash,search:t.searchStr},{id:a}),o.navigationPromise=new Promise((t=>{const e=o.resolveNavigation;o.resolveNavigation=()=>{e(),t(),delete o.navigationPromise}})),o.navigationPromise}}};return o.update(t),null==o.options.createRouter||o.options.createRouter(o),o}function Z(t){t.forEach(((e,a)=>{const n=t[a-1];n&&(e.loaderData=_(e.loaderData,U({},n.loaderData,e.routeLoaderData)))}))}const tt=["type","children","target","activeProps","inactiveProps","activeOptions","disabled","hash","search","params","to","preload","preloadDelay","preloadMaxAge","replace","style","className","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd"],et=["pending","caseSensitive","children"],at=["router"];const nt=o.createContext(null),rt=o.createContext(null);function ot(t){return o.createElement(nt.Provider,t)}const st=t=>{a.useSyncExternalStore((e=>t.subscribe((()=>e()))),(()=>t.state),(()=>t.state))};function it(){const t=o.useContext(rt);return E(!t,"useRouter must be used inside a <Router> component!"),st(t.router),t.router}function ct(){return o.useContext(nt)}function lt(){const t=ct()[0];return b(t),t}function ut(){var t,e,a;const n=it(),r=ct().slice(1),s=r[0],i=o.useCallback((()=>null),[]);if(!s)return null;const c=null!=(t=null!=(e=s.__.pendingComponent)?e:n.options.defaultPendingComponent)?t:i,l=null!=(a=s.__.errorComponent)?a:n.options.defaultErrorComponent;return o.createElement(ot,{value:r},o.createElement(o.Suspense,{fallback:o.createElement(c,null)},o.createElement(ht,{key:s.routeId,errorComponent:l,match:s},(()=>{if("error"===s.status)throw s.error;var t,e;if("success"===s.status)return o.createElement(null!=(t=null!=(e=s.__.component)?e:n.options.defaultComponent)?t:ut);throw s.__.loadPromise})())))}class ht extends o.Component{constructor(){super(...arguments),this.state={error:!1,info:void 0}}componentDidCatch(t,e){console.error("Error in route match: "+this.props.match.matchId),console.error(t),this.setState({error:t,info:e})}render(){return o.createElement(dt,s({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function dt(t){var e;const[a,n]=o.useState(t.errorState),r=it(),s=null!=(e=t.errorComponent)?e:ft;return o.useEffect((()=>{if(a){let t=r.state.currentLocation.key;return r.subscribe((()=>{r.state.currentLocation.key!==t&&(t=r.state.currentLocation.key,n({}))}))}}),[a]),o.useEffect((()=>{t.errorState.error&&n(t.errorState),t.reset()}),[t.errorState.error]),a.error?o.createElement(s,a):t.children}function ft(t){let{error:e}=t;return o.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},o.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),o.createElement("div",{style:{height:".5rem"}}),o.createElement("div",null,o.createElement("pre",null,e.message?o.createElement("code",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red"}},e.message):null)))}function pt(t,e){const a=it();o.useEffect((()=>{if(!e)return;let n=a.history.block((e=>{window.confirm(t)?(n(),e.retry()):a.state.currentLocation.pathname=window.location.pathname}));return n}),[e,t])}t.DefaultErrorBoundary=ft,t.Link=function(t){const e=it();return o.createElement(e.Link,t)},t.MatchRoute=function(t){const e=it();return o.createElement(e.MatchRoute,t)},t.MatchesProvider=ot,t.Outlet=ut,t.Prompt=function(t){let{message:e,when:a,children:n}=t;return pt(e,null==a||a),null!=n?n:null},t.RouterProvider=function(t){let{router:e}=t,a=i(t,at);return e.update(a),st(e),o.useEffect((()=>e.mount()),[e]),o.createElement(o.Fragment,null,o.createElement(rt.Provider,{value:{router:e}},o.createElement(ot,{value:[void 0,...e.state.currentMatches]},o.createElement(ut,null))))},t.cleanPath=S,t.createBrowserHistory=h,t.createHashHistory=function(t){void 0===t&&(t={});var e=t.window,a=void 0===e?document.defaultView:e,n=a.history;function o(){var t=y(a.location.hash.substr(1)),e=t.pathname,r=void 0===e?"/":e,o=t.search,s=void 0===o?"":o,i=t.hash,c=void 0===i?"":i,l=n.state||{};return[l.idx,{pathname:r,search:s,hash:c,state:l.usr||null,key:l.key||"default"}]}var s=null;function i(){if(s)L.call(s),s=null;else{var t=r.Pop,e=o(),a=e[0],n=e[1];if(L.length){if(null!=a){var i=f-a;i&&(s={action:t,location:n,retry:function(){R(-1*i)}},R(i))}}else x(t)}}a.addEventListener(u,i),a.addEventListener("hashchange",(function(){g(o()[1])!==g(b)&&i()}));var h=r.Pop,d=o(),f=d[0],b=d[1],_=m(),L=m();function P(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var n=a.location.href,r=n.indexOf("#");e=-1===r?n:n.slice(0,r)}return e}()+"#"+("string"==typeof t?t:g(t))}function w(t,e){return void 0===e&&(e=null),c({pathname:b.pathname,hash:"",search:""},"string"==typeof t?y(t):t,{state:e,key:v()})}function E(t,e){return[{usr:t.state,key:t.key,idx:e},P(t)]}function M(t,e,a){return!L.length||(L.call({action:t,location:e,retry:a}),!1)}function x(t){h=t;var e=o();f=e[0],b=e[1],_.call({action:h,location:b})}function R(t){n.go(t)}null==f&&(f=0,n.replaceState(c({},n.state,{idx:f}),""));var S={get action(){return h},get location(){return b},createHref:P,push:function t(e,o){var s=r.Push,i=w(e,o);if(M(s,i,(function(){t(e,o)}))){var c=E(i,f+1),l=c[0],u=c[1];try{n.pushState(l,"",u)}catch(t){a.location.assign(u)}x(s)}},replace:function t(e,a){var o=r.Replace,s=w(e,a);if(M(o,s,(function(){t(e,a)}))){var i=E(s,f),c=i[0],l=i[1];n.replaceState(c,"",l),x(o)}},go:R,back:function(){R(-1)},forward:function(){R(1)},listen:function(t){return _.push(t)},block:function(t){var e=L.push(t);return 1===L.length&&a.addEventListener(l,p),function(){e(),L.length||a.removeEventListener(l,p)}}};return S},t.createMemoryHistory=d,t.createReactRouter=function(t){const e=(t,e)=>({useRoute:function(a){void 0===a&&(a=".");const n=e.resolvePath(t.routeId,a),r=e.getRoute(n);return st(e),b(r),r},linkProps:e=>{var a,n;const{target:r,activeProps:c=(()=>({className:"active"})),inactiveProps:l=(()=>({})),disabled:u,style:h,className:d,onClick:f,onFocus:p,onMouseEnter:m,onMouseLeave:v}=e,g=i(e,tt),y=t.buildLink(e);if("external"===y.type){const{href:t}=y;return{href:t}}const{handleClick:b,handleFocus:_,handleEnter:L,handleLeave:P,isActive:w,next:E}=y,x=t=>e=>{e.persist&&e.persist(),t.forEach((t=>{e.defaultPrevented||t&&t(e)}))},R=w&&null!=(a=M(c,{}))?a:{},S=w?{}:null!=(n=M(l,{}))?n:{};return s({},R,S,g,{href:u?void 0:E.href,onClick:x([t=>{o.startTransition?o.startTransition((()=>{b(t)})):b(t)},f]),onFocus:x([_,p]),onMouseEnter:x([L,m]),onMouseLeave:x([P,v]),target:r,style:s({},h,R.style,S.style),className:[d,R.className,S.className].filter(Boolean).join(" ")||void 0},u?{role:"link","aria-disabled":!0}:void 0,{"data-status":w?"active":void 0})},Link:o.forwardRef(((a,n)=>{const r=t.linkProps(a);return st(e),o.createElement("a",s({ref:n},r,{children:"function"==typeof a.children?a.children({isActive:"active"===r["data-status"]}):a.children}))})),MatchRoute:e=>{const{pending:a,caseSensitive:n}=e,r=i(e,et),o=t.matchRoute(r,{pending:a,caseSensitive:n});return o?"function"==typeof e.children?e.children(o):e.children:null}}),a=Y(s({},t,{createRouter:t=>{const a={useState:()=>(st(t),t.state),useMatch:(e,a)=>{var n;st(t),b(e!==z);const r=lt(),o=t.state.currentMatches.find((t=>t.routeId===e));return(null==(n=null==a?void 0:a.strict)||n)&&(b(o),b(r.routeId==(null==o?void 0:o.routeId),(null==o||o.routeId,r.routeId,null==o||o.routeId,null==o||o.routeId))),o}},n=e(t.getRoute(z),t);Object.assign(t,a,n)},createRoute:t=>{let{router:a,route:n}=t;const r=e(n,a);Object.assign(n,r)},loadComponent:async t=>(t.preload&&"undefined"!=typeof document&&t.preload(),t)}));return a},t.createRoute=H,t.createRouteConfig=function t(e,a,n,r,o){void 0===e&&(e={}),void 0===n&&(n=!0),n&&(e.path=z),r===z&&(r="");let s=n?z:e.path;s&&"/"!==s&&(s=C(s));const i=s||e.id;let c=R([r,i]);s===z&&(s="/"),c!==z&&(c=R(["/",c]));const l=c===z?"/":A(R([o,s]));return{id:c,routeId:i,path:s,fullPath:l,options:e,children:a,addChildren:a=>t(e,a,!1,r,o),createRoute:e=>t(e,void 0,!1,c,l),generate:()=>{b(!1)}}},t.createRouteMatch=W,t.createRouter=Y,t.decode=B,t.defaultParseSearch=q,t.defaultStringifySearch=K,t.encode=T,t.functionalUpdate=M,t.interpolatePath=D,t.invariant=b,t.joinPaths=R,t.last=w,t.lazy=function(t){const e=o.lazy(t);let a,n;const r=o.forwardRef(((t,a)=>{const r=o.useRef(n||e);return o.createElement(r.current,s({},a?{ref:a}:{},t))}));return r.preload=()=>(a||(a=t().then((t=>(n=t.default,n)))),a),r},t.linkProps=function(t){return it().linkProps(t)},t.matchByPath=F,t.matchPathname=j,t.matchesContext=nt,t.parsePathname=O,t.parseSearchWith=V,t.pick=x,t.replaceEqualDeep=_,t.resolvePath=k,t.rootRouteId=z,t.routerContext=rt,t.stringifySearchWith=$,t.trimPath=C,t.trimPathLeft=I,t.trimPathRight=A,t.useMatch=function(t,e){return it().useMatch(t,e)},t.useMatches=ct,t.useNearestMatch=lt,t.usePrompt=pt,t.useRoute=function(t){return it().useRoute(t)},t.useRouter=it,t.useSearch=function(t){return it().state.currentLocation.search},t.warning=E,Object.defineProperty(t,"__esModule",{value:!0})}));
*/function _(t,e){if(t===e)return t;const a=Array.isArray(t)&&Array.isArray(e);if(a||L(t)&&L(e)){const n=a?t.length:Object.keys(t).length,r=a?e:Object.keys(e),o=r.length,s=a?[]:{};let i=0;for(let n=0;n<o;n++){const o=a?n:r[n];s[o]=_(t[o],e[o]),s[o]===t[o]&&i++}return n===o&&i===n?t:s}return e}function L(t){if(!P(t))return!1;const e=t.constructor;if(void 0===e)return!0;const a=e.prototype;return!!P(a)&&!!a.hasOwnProperty("isPrototypeOf")}function P(t){return"[object Object]"===Object.prototype.toString.call(t)}function w(t){return t[t.length-1]}function E(t,e){if(t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}return!0}function M(t,e){return"function"==typeof t?t(e):t}function x(t,e){return e.reduce(((e,a)=>(e[a]=t[a],e)),{})}function R(t){return S(t.filter(Boolean).join("/"))}function S(t){return t.replace(/\/{2,}/g,"/")}function I(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function A(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function C(t){return A(I(t))}function k(t,e,a){e=e.replace(new RegExp("^"+t),"/"),a=a.replace(new RegExp("^"+t),"/");let n=O(e);const r=O(a);r.forEach(((t,e)=>{if("/"===t.value)e?e===r.length-1&&n.push(t):n=[t];else if(".."===t.value){var a;n.length>1&&"/"===(null==(a=w(n))?void 0:a.value)&&n.pop(),n.pop()}else{if("."===t.value)return;n.push(t)}}));return S(R([t,...n.map((t=>t.value))]))}function O(t){if(!t)return[];const e=[];if("/"===(t=S(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const a=t.split("/").filter(Boolean);return e.push(...a.map((t=>t.startsWith("*")?{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 D(t,e,a){return R(O(t).map((t=>{return"*"!==t.value||a?"param"===t.type?null!=(n=e[t.value.substring(1)])?n:"":t.value:"";var n})))}function j(t,e,a){const n=F(t,e,a);if(!a.to||n)return null!=n?n:{}}function F(t,e,a){var n;if(!e.startsWith(t))return;const r=O(e="/"!=t?e.substring(t.length):e),o=O(""+(null!=(n=a.to)?n:"*")),s={};return(()=>{for(let t=0;t<Math.max(r.length,o.length);t++){const e=r[t],n=o[t],i=t===o.length-1,c=t===r.length-1;if(n){if("wildcard"===n.type)return!(null==e||!e.value)&&(s["*"]=R(r.slice(t).map((t=>t.value))),!0);if("pathname"===n.type){if("/"===n.value&&(null==e||!e.value))return!0;if(e)if(a.caseSensitive){if(n.value!==e.value)return!1}else if(n.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===n.type){if("/"===(null==e?void 0:e.value))return!1;"$"!==e.value.charAt(0)&&(s[n.value.substring(1)]=e.value)}}if(i&&!c)return!!a.fuzzy}return!0})()?s:void 0}function T(t,e){var a,n,r,o="";for(a in t)if(void 0!==(r=t[a]))if(Array.isArray(r))for(n=0;n<r.length;n++)o&&(o+="&"),o+=encodeURIComponent(a)+"="+encodeURIComponent(r[n]);else o&&(o+="&"),o+=encodeURIComponent(a)+"="+encodeURIComponent(r);return(e||"")+o}function N(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function B(t){for(var e,a,n={},r=t.split("&");e=r.shift();)void 0!==n[a=(e=e.split("=")).shift()]?n[a]=[].concat(n[a],N(e.shift())):n[a]=N(e.shift());return n}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},U.apply(this,arguments)}function H(t,e,a,n){const{id:r,routeId:o,path:s,fullPath:i}=t,c=n.state.actions[r]||(n.state.actions[r]={submissions:[],submit:async(t,e)=>{var a;if(!u)return;const r=null==(a=null==e?void 0:e.invalidate)||a;null!=e&&e.multi||(c.submissions=c.submissions.filter((t=>t.isMulti)));const o={submittedAt:Date.now(),status:"pending",submission:t,isMulti:!(null==e||!e.multi)};c.current=o,c.latest=o,c.submissions.push(o),n.notify();try{const e=await(null==u.options.action?void 0:u.options.action(t));return o.data=e,r&&(n.invalidateRoute({to:".",fromCurrent:!0}),await n.reload()),o.status="success",e}catch(t){console.error(t),o.error=t,o.status="error"}finally{n.notify()}}},n.state.actions[r]),l=n.state.loaders[r]||(n.state.loaders[r]={pending:[],fetch:async t=>{if(!u)return;const e={loadedAt:Date.now(),loaderContext:t};l.current=e,l.latest=e,l.pending.push(e),n.notify();try{return await(null==u.options.loader?void 0:u.options.loader(t))}finally{l.pending=l.pending.filter((t=>t!==e)),n.notify()}}},n.state.loaders[r]);let u={routeInfo:void 0,routeId:r,routeRouteId:o,routePath:s,fullPath:i,options:e,router:n,childRoutes:void 0,parentRoute:a,action:c,loader:l,buildLink:t=>n.buildLink(U({},t,{from:i})),navigate:t=>n.navigate(U({},t,{from:i})),matchRoute:(t,e)=>n.matchRoute(U({},t,{from:i}),e)};return null==n.options.createRoute||n.options.createRoute({router:n,route:u}),u}const z="__root__",G=["component","errorComponent","pendingComponent"];function W(t,e,a){const n=U({},e,a,{router:t,routeSearch:{},search:{},childMatches:[],status:"idle",routeLoaderData:{},loaderData:{},isFetching:!1,isInvalid:!1,invalidAt:1/0,getIsInvalid:()=>{const t=Date.now();return n.isInvalid||n.invalidAt<t},__:{abortController:new AbortController,latestId:"",resolve:()=>{},notify:()=>{n.__.resolve(),n.router.notify()},validate:()=>{var e,a;const r=null!=(e=null==(a=n.parentMatch)?void 0:a.search)?e:t.state.currentLocation.search;try{var o;const t=n.routeSearch,e="object"==typeof n.options.validateSearch?n.options.validateSearch.parse:n.options.validateSearch;let a=_(t,null!=(o=null==e?void 0:e(r))?o:{});t!==a&&(n.isInvalid=!0),n.routeSearch=a,n.search=_(r,U({},r,a)),G.map((async t=>{const e=n.options[t];"function"!=typeof n.__[t]&&(n.__[t]=e)}))}catch(t){console.error(t);const e=new Error("Invalid search params found",{cause:t});return e.code="INVALID_SEARCH_PARAMS",n.status="error",void(n.error=e)}}},cancel:()=>{var t;null==(t=n.__.abortController)||t.abort()},invalidate:()=>{n.isInvalid=!0},hasLoaders:()=>!(!e.options.loader&&!G.some((t=>{var a;return null==(a=e.options[t])?void 0:a.preload}))),load:async e=>{const a=Date.now(),r=null!=e&&e.preload?Math.max(null==e?void 0:e.maxAge,null==e?void 0:e.gcMaxAge):0;if(null!=e&&e.preload&&r>0){if(t.state.currentMatches.find((t=>t.matchId===n.matchId)))return;t.matchCache[n.matchId]={gc:a+e.gcMaxAge,match:n}}if("success"===n.status&&n.getIsInvalid()||"error"===n.status||"idle"===n.status){const t=null!=e&&e.preload?null==e?void 0:e.maxAge:void 0;await n.fetch({maxAge:t})}},fetch:async e=>{const a=""+Date.now()+Math.random();n.__.latestId=a;const r=async()=>{if(a!==n.__.latestId)return new Promise((()=>{}))};"idle"===n.status&&(n.status="loading"),n.isInvalid=!1,n.__.loadPromise=new Promise((async a=>{n.isFetching=!0,n.__.resolve=a,n.__.componentsPromise=(async()=>{await Promise.all(G.map((async e=>{var a;const r=n.options[e];null!=(a=n.__[e])&&a.preload&&(n.__[e]=await t.options.loadComponent(r))})))})(),n.__.dataPromise=Promise.resolve().then((async()=>{try{var a,o,s;if(n.options.loader){const e=await t.loadMatchData(n);await r(),n.routeLoaderData=_(n.routeLoaderData,e)}return n.error=void 0,n.status="success",n.updatedAt=Date.now(),n.invalidAt=n.updatedAt+(null!=(a=null!=(o=null!=(s=null==e?void 0:e.maxAge)?s:n.options.loaderMaxAge)?o:t.options.defaultLoaderMaxAge)?a:0),n.routeLoaderData}catch(t){throw await r(),n.error=t,n.status="error",n.updatedAt=Date.now(),t}}));const o=async()=>{await r(),n.isFetching=!1,delete n.__.loadPromise,n.__.notify()};try{await Promise.all([n.__.componentsPromise,n.__.dataPromise.catch((()=>{}))]),o()}catch(t){o()}})),await n.__.loadPromise,await r()}});return n.hasLoaders()||(n.status="success"),n}const q=V(JSON.parse),K=$(JSON.stringify);function V(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let a=B(e);for(let e in a){const n=a[e];if("string"==typeof n)try{a[e]=t(n)}catch(t){}}return a}}function $(t){return e=>{(e=U({},e))&&Object.keys(e).forEach((a=>{const n=e[a];if(void 0===n||void 0===n)delete e[a];else if(n&&"object"==typeof n&&null!==n)try{e[a]=t(n)}catch(t){}}));const a=T(e).toString();return a?"?"+a:""}}var J;const X="undefined"==typeof window||!(null!=(J=window.document)&&J.createElement);function Q(){return{status:"idle",latestLocation:null,currentLocation:null,currentMatches:[],actions:{},loaders:{},lastUpdated:Date.now(),isFetching:!1,isPreloading:!1}}function Y(t){var e,a;const n=(null==t?void 0:t.history)||(X?d():h()),r=U({defaultLoaderGcMaxAge:3e5,defaultLoaderMaxAge:0,defaultPreloadMaxAge:2e3,defaultPreloadDelay:50,context:void 0},t,{stringifySearch:null!=(e=null==t?void 0:t.stringifySearch)?e:K,parseSearch:null!=(a=null==t?void 0:t.parseSearch)?a:q});let o={types:void 0,history:n,options:r,listeners:[],basepath:"",routeTree:void 0,routesById:{},resolveNavigation:()=>{},matchCache:{},state:Q(),reset:()=>{o.state=Q(),o.notify()},startedLoadingAt:Date.now(),subscribe:t=>(o.listeners.push(t),()=>{o.listeners=o.listeners.filter((e=>e!==t))}),getRoute:t=>o.routesById[t],notify:()=>{const t="loading"===o.state.status||o.state.currentMatches.some((t=>t.isFetching)),e=Object.values(o.matchCache).some((t=>t.match.isFetching&&!o.state.currentMatches.find((e=>e.matchId===t.match.matchId))));o.state.isFetching===t&&o.state.isPreloading===e||(o.state=U({},o.state,{isFetching:t,isPreloading:e})),Z(o.state.currentMatches),o.listeners.forEach((t=>t(o)))},dehydrate:()=>({state:U({},x(o.state,["latestLocation","currentLocation","status","lastUpdated"]),{currentMatches:o.state.currentMatches.map((t=>x(t,["matchId","status","routeLoaderData","loaderData","isInvalid","invalidAt"])))}),context:o.options.context}),hydrate:t=>{o.state.latestLocation=t.state.latestLocation,o.state.currentLocation=t.state.currentLocation,o.options.context=t.context;const e=o.matchRoutes(o.state.latestLocation.pathname,{strictParseParams:!0});e.forEach(((e,a)=>{const n=t.state.currentMatches[a];b(n),Object.assign(e,n)})),e.forEach((t=>t.__.validate())),o.state=U({},o.state,t,{currentMatches:e})},mount:()=>{o.state.currentMatches.length||o.load();const t=o.history.listen((t=>{o.load(o.__.parseLocation(t.location,o.state.latestLocation))}));return!X&&window.addEventListener&&(window.addEventListener("visibilitychange",o.onFocus,!1),window.addEventListener("focus",o.onFocus,!1)),()=>{t(),!X&&window.removeEventListener&&(window.removeEventListener("visibilitychange",o.onFocus),window.removeEventListener("focus",o.onFocus))}},onFocus:()=>{o.load()},update:t=>{var e;const a=(null==t?void 0:t.history)!==o.history;o.state.latestLocation&&!a||(null!=t&&t.history&&(o.history=t.history),o.state.latestLocation=o.__.parseLocation(o.history.location),o.state.currentLocation=o.state.latestLocation),Object.assign(o.options,t);const{basepath:n,routeConfig:r}=o.options;return o.basepath="/"+(null!=(e=C(null!=n?n:""))?e:""),r&&(o.routesById={},o.routeTree=o.__.buildRouteTree(r)),o},cancelMatches:()=>{var t;[...o.state.currentMatches,...null!=(t=o.state.pendingMatches)?t:[]].forEach((t=>{t.cancel()}))},load:async t=>{const e=Math.random();o.startedLoadingAt=e,t&&(o.state.latestLocation=t),o.cancelMatches();const a=o.matchRoutes(o.state.latestLocation.pathname,{strictParseParams:!0});"undefined"!=typeof document?o.state=U({},o.state,{status:"loading",pendingMatches:a,pendingLocation:o.state.latestLocation}):o.state=U({},o.state,{status:"loading",currentMatches:a,currentLocation:o.state.latestLocation}),o.notify();try{await o.loadMatches(a)}catch(t){console.log(t),b(!1)}if(o.startedLoadingAt!==e)return o.navigationPromise;const n=o.state.currentMatches,r=[],s=[];n.forEach((t=>{a.find((e=>e.matchId===t.matchId))?s.push(t):r.push(t)}));const i=a.filter((t=>!n.find((e=>e.matchId===t.matchId)))),c=Date.now();r.forEach((t=>{var e,a,n,r;null==t.__.onExit||t.__.onExit({params:t.params,search:t.routeSearch}),"error"!==t.status||t.isFetching||(t.status="idle",t.error=void 0);const s=Math.max(null!=(e=null!=(a=t.options.loaderGcMaxAge)?a:o.options.defaultLoaderGcMaxAge)?e:0,null!=(n=null!=(r=t.options.loaderMaxAge)?r:o.options.defaultLoaderMaxAge)?n:0);s>0&&(o.matchCache[t.matchId]={gc:s==1/0?Number.MAX_SAFE_INTEGER:c+s,match:t})})),s.forEach((t=>{null==t.options.onTransition||t.options.onTransition({params:t.params,search:t.routeSearch})})),i.forEach((t=>{t.__.onExit=null==t.options.onLoaded?void 0:t.options.onLoaded({params:t.params,search:t.search}),delete o.matchCache[t.matchId]})),o.startedLoadingAt===e&&(a.forEach((t=>{t.action&&(t.action.current=void 0,t.action.submissions=[])})),o.state=U({},o.state,{status:"idle",currentLocation:o.state.latestLocation,currentMatches:a,pendingLocation:void 0,pendingMatches:void 0}),o.notify(),o.resolveNavigation())},cleanMatchCache:()=>{const t=Date.now();Object.keys(o.matchCache).forEach((e=>{const a=o.matchCache[e];"loading"!==a.match.status&&(a.gc>0&&a.gc>t||delete o.matchCache[e])}))},loadRoute:async function(t){void 0===t&&(t=o.state.latestLocation);const e=o.buildNext(t),a=o.matchRoutes(e.pathname,{strictParseParams:!0});return await o.loadMatches(a),a},preloadRoute:async function(t,e){var a,n,r,s,i,c;void 0===t&&(t=o.state.latestLocation);const l=o.buildNext(t),u=o.matchRoutes(l.pathname,{strictParseParams:!0});return await o.loadMatches(u,{preload:!0,maxAge:null!=(a=null!=(n=null!=(r=e.maxAge)?r:o.options.defaultPreloadMaxAge)?n:o.options.defaultLoaderMaxAge)?a:0,gcMaxAge:null!=(s=null!=(i=null!=(c=e.gcMaxAge)?c:o.options.defaultPreloadGcMaxAge)?i:o.options.defaultLoaderGcMaxAge)?s:0}),u},matchRoutes:(t,e)=>{var a;o.cleanMatchCache();const n=[];if(!o.routeTree)return n;const r=[...o.state.currentMatches,...null!=(a=o.state.pendingMatches)?a:[]],s=async a=>{var i,c,l;const u=w(n);let h=null!=(i=null==u?void 0:u.params)?i:{};const d=null!=(c=null==o.options.filterRoutes?void 0:o.options.filterRoutes(a))?c:a;let f=[];const p=(a,n)=>(n.some((n=>{var r,s,i;if(!n.routePath&&null!=(r=n.childRoutes)&&r.length)return p([...f,n],n.childRoutes);const c=!!("/"!==n.routePath||null!=(s=n.childRoutes)&&s.length),l=j(o.basepath,t,{to:n.fullPath,fuzzy:c,caseSensitive:null!=(i=n.options.caseSensitive)?i:o.options.caseSensitive});if(l){let t;try{var u;t=null!=(u=null==n.options.parseParams?void 0:n.options.parseParams(l))?u:l}catch(t){if(null!=e&&e.strictParseParams)throw t}h=U({},h,t)}return l&&(f=[...a,n]),!!f.length})),!!f.length);if(p([],d),!f.length)return;f.forEach((t=>{var e;const a=D(t.routePath,h),s=D(t.routeId,h,!0),i=r.find((t=>t.matchId===s))||(null==(e=o.matchCache[s])?void 0:e.match)||W(o,t,{parentMatch:u,matchId:s,params:h,pathname:R([o.basepath,a])});n.push(i)}));const m=w(f);null!=(l=m.childRoutes)&&l.length&&s(m.childRoutes)};return s([o.routeTree]),Z(n),n},loadMatches:async(t,e)=>{t.forEach((async t=>{t.__.validate()})),await Promise.all(t.map((async t=>{try{await(null==t.options.beforeLoad?void 0:t.options.beforeLoad({router:o,match:t}))}catch(a){throw null!=e&&e.preload||null==t.options.onLoadError||t.options.onLoadError(a),a}})));const a=t.map((async t=>{var a;const n=t.search;null!=(a=n.__data)&&a.matchId&&n.__data.matchId!==t.matchId||(t.load(e),"success"!==t.status&&t.__.loadPromise&&await t.__.loadPromise)}));o.notify(),await Promise.all(a)},loadMatchData:async t=>{var e;if(X||!o.options.useServerData)return null!=(e=await(null==t.options.loader?void 0:t.options.loader({params:t.params,search:t.routeSearch,signal:t.__.abortController.signal})))?e:{};{const e=o.buildNext({to:".",search:e=>U({},null!=e?e:{},{__data:{matchId:t.matchId}})}),a=await fetch(e.href,{method:"GET"});if(a.ok)return a.json();throw new Error("Failed to fetch match data")}},invalidateRoute:t=>{var e;const a=o.buildNext(t),n=o.matchRoutes(a.pathname).map((t=>t.matchId));[...o.state.currentMatches,...null!=(e=o.state.pendingMatches)?e:[]].forEach((t=>{n.includes(t.matchId)&&t.invalidate()}))},reload:()=>o.__.navigate({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(t,e)=>k(o.basepath,t,S(e)),matchRoute:(t,e)=>{var a;t=U({},t,{to:t.to?o.resolvePath(null!=(a=t.from)?a:"",t.to):void 0});const n=o.buildNext(t);return null!=e&&e.pending?!!o.state.pendingLocation&&!!j(o.basepath,o.state.pendingLocation.pathname,U({},e,{to:n.pathname})):!!j(o.basepath,o.state.currentLocation.pathname,U({},e,{to:n.pathname}))},navigate:async t=>{let{from:e,to:a=".",search:n,hash:r,replace:s,params:i}=t;const c=String(a),l=String(e);let u;try{new URL(""+c),u=!0}catch(t){}return b(!u),o.__.navigate({from:l,to:c,search:n,hash:r,replace:s,params:i})},buildLink:t=>{var e,a;let{from:n,to:r=".",search:s,params:i,hash:c,target:l,replace:u,activeOptions:h,preload:d,preloadMaxAge:f,preloadGcMaxAge:p,preloadDelay:m,disabled:v}=t;try{return new URL(""+r),{type:"external",href:r}}catch(t){}const g={from:n,to:r,search:s,params:i,hash:c,replace:u},y=o.buildNext(g);d=null!=(e=d)?e:o.options.defaultPreload;const b=null!=(a=null!=m?m:o.options.defaultPreloadDelay)?a:0,_=o.state.currentLocation.pathname===y.pathname,L=o.state.currentLocation.pathname.split("/"),P=y.pathname.split("/").every(((t,e)=>t===L[e])),w=o.state.currentLocation.hash===y.hash,E=null!=h&&h.exact?_:P,M=null==h||!h.includeHash||w;return{type:"internal",next:y,handleFocus:t=>{d&&o.preloadRoute(g,{maxAge:f,gcMaxAge:p}).catch((t=>{console.log(t),console.warn("Error preloading route! ☝️")}))},handleClick:t=>{v||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||l&&"_self"!==l||0!==t.button||(t.preventDefault(),!_||s||c||o.invalidateRoute(g),o.__.navigate(g))},handleEnter:t=>{const e=t.target||{};if(d){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,o.preloadRoute(g,{maxAge:f,gcMaxAge:p}).catch((t=>{console.log(t),console.warn("Error preloading route! ☝️")}))}),b)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},isActive:E&&M,disabled:v}},buildNext:t=>{const e=o.__.buildLocation(t),a=o.matchRoutes(e.pathname),n=a.map((t=>{var e;return null!=(e=t.options.preSearchFilters)?e:[]})).flat().filter(Boolean),r=a.map((t=>{var e;return null!=(e=t.options.postSearchFilters)?e:[]})).flat().filter(Boolean);return o.__.buildLocation(U({},t,{__preSearchFilters:n,__postSearchFilters:r}))},__:{buildRouteTree:t=>{const e=(t,a)=>t.map((t=>{const n=H(t,t.options,a,o);if(o.routesById[n.routeId])throw new Error;o.routesById[n.routeId]=n;const r=t.children;return n.childRoutes=null!=r&&r.length?e(r,n):void 0,n}));return e([t])[0]},parseLocation:(t,e)=>{var a;const n=o.options.parseSearch(t.search);return{pathname:t.pathname,searchStr:t.search,search:_(null==e?void 0:e.search,n),hash:null!=(a=t.hash.split("#").reverse()[0])?a:"",href:""+t.pathname+t.search+t.hash,state:t.state,key:t.key}},navigate:t=>{const e=o.buildNext(t);return o.__.commitLocation(e,t.replace)},buildLocation:function(t){var e,a,n,r,s,i,c,l,u;void 0===t&&(t={});const h=t.fromCurrent?o.state.latestLocation.pathname:null!=(e=t.from)?e:o.state.latestLocation.pathname;let d=k(null!=(a=o.basepath)?a:"/",h,""+(null!=(n=t.to)?n:"."));const f=o.matchRoutes(o.state.latestLocation.pathname,{strictParseParams:!0}),p=o.matchRoutes(d),m=U({},null==(r=w(f))?void 0:r.params);let v=!0===(null==(s=t.params)||s)?m:M(t.params,m);v&&p.map((t=>t.options.stringifyParams)).filter(Boolean).forEach((t=>{Object.assign({},v,t(v))})),d=D(d,null!=v?v:{});const g=null!=(i=t.__preSearchFilters)&&i.length?t.__preSearchFilters.reduce(((t,e)=>e(t)),o.state.latestLocation.search):o.state.latestLocation.search,y=!0===t.search?g:t.search?null!=(c=M(t.search,g))?c:{}:null!=(l=t.__preSearchFilters)&&l.length?g:{},b=null!=(u=t.__postSearchFilters)&&u.length?t.__postSearchFilters.reduce(((t,e)=>e(t)),y):y,L=_(o.state.latestLocation.search,b),P=o.options.stringifySearch(L);let E=!0===t.hash?o.state.latestLocation.hash:M(t.hash,o.state.latestLocation.hash);return E=E?"#"+E:"",{pathname:d,search:L,searchStr:P,state:o.state.latestLocation.state,hash:E,href:""+d+P+E,key:t.key}},commitLocation:(t,e)=>{const a=""+Date.now()+Math.random();o.navigateTimeout&&clearTimeout(o.navigateTimeout);let r="replace";e||(r="push");return o.__.parseLocation(n.location).href===t.href&&!t.key&&(r="replace"),"replace"===r?n.replace({pathname:t.pathname,hash:t.hash,search:t.searchStr},U({id:a},t.state)):n.push({pathname:t.pathname,hash:t.hash,search:t.searchStr},{id:a}),o.navigationPromise=new Promise((t=>{const e=o.resolveNavigation;o.resolveNavigation=()=>{e(),t(),delete o.navigationPromise}})),o.navigationPromise}}};return o.update(t),null==o.options.createRouter||o.options.createRouter(o),o}function Z(t){t.forEach(((e,a)=>{const n=t[a-1];n&&(e.loaderData=_(e.loaderData,U({},n.loaderData,e.routeLoaderData)))}))}const tt=["type","children","target","activeProps","inactiveProps","activeOptions","disabled","hash","search","params","to","preload","preloadDelay","preloadMaxAge","replace","style","className","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd"],et=["pending","caseSensitive","children"],at=["router"];const nt=o.createContext(null),rt=o.createContext(null);function ot(t){return o.createElement(nt.Provider,t)}const st=t=>{a.useSyncExternalStore((e=>t.subscribe((()=>e()))),(()=>t.state),(()=>t.state))};function it(){const t=o.useContext(rt);return E(!t,"useRouter must be used inside a <Router> component!"),st(t.router),t.router}function ct(){return o.useContext(nt)}function lt(){const t=ct()[0];return b(t),t}function ut(){var t,e,a;const n=it(),r=ct().slice(1),s=r[0],i=o.useCallback((()=>null),[]);if(!s)return null;const c=null!=(t=null!=(e=s.__.pendingComponent)?e:n.options.defaultPendingComponent)?t:i,l=null!=(a=s.__.errorComponent)?a:n.options.defaultErrorComponent;return o.createElement(ot,{value:r},o.createElement(o.Suspense,{fallback:o.createElement(c,null)},o.createElement(ht,{key:s.routeId,errorComponent:l,match:s},(()=>{if("error"===s.status)throw s.error;var t,e;if("success"===s.status)return o.createElement(null!=(t=null!=(e=s.__.component)?e:n.options.defaultComponent)?t:ut);throw s.__.loadPromise})())))}class ht extends o.Component{constructor(){super(...arguments),this.state={error:!1,info:void 0}}componentDidCatch(t,e){console.error("Error in route match: "+this.props.match.matchId),console.error(t),this.setState({error:t,info:e})}render(){return o.createElement(dt,s({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function dt(t){var e;const[a,n]=o.useState(t.errorState),r=it(),s=null!=(e=t.errorComponent)?e:ft;return o.useEffect((()=>{if(a){let t=r.state.currentLocation.key;return r.subscribe((()=>{r.state.currentLocation.key!==t&&(t=r.state.currentLocation.key,n({}))}))}}),[a]),o.useEffect((()=>{t.errorState.error&&n(t.errorState),t.reset()}),[t.errorState.error]),a.error?o.createElement(s,a):t.children}function ft(t){let{error:e}=t;return o.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},o.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),o.createElement("div",{style:{height:".5rem"}}),o.createElement("div",null,o.createElement("pre",null,e.message?o.createElement("code",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red"}},e.message):null)))}function pt(t,e){const a=it();o.useEffect((()=>{if(!e)return;let n=a.history.block((e=>{window.confirm(t)?(n(),e.retry()):a.state.currentLocation.pathname=window.location.pathname}));return n}),[e,t])}t.DefaultErrorBoundary=ft,t.Link=function(t){const e=it();return o.createElement(e.Link,t)},t.MatchRoute=function(t){const e=it();return o.createElement(e.MatchRoute,t)},t.MatchesProvider=ot,t.Outlet=ut,t.Prompt=function(t){let{message:e,when:a,children:n}=t;return pt(e,null==a||a),null!=n?n:null},t.RouterProvider=function(t){let{router:e}=t,a=i(t,at);return e.update(a),st(e),o.useEffect((()=>e.mount()),[e]),o.createElement(o.Fragment,null,o.createElement(rt.Provider,{value:{router:e}},o.createElement(ot,{value:[void 0,...e.state.currentMatches]},o.createElement(ut,null))))},t.cleanPath=S,t.createBrowserHistory=h,t.createHashHistory=function(t){void 0===t&&(t={});var e=t.window,a=void 0===e?document.defaultView:e,n=a.history;function o(){var t=y(a.location.hash.substr(1)),e=t.pathname,r=void 0===e?"/":e,o=t.search,s=void 0===o?"":o,i=t.hash,c=void 0===i?"":i,l=n.state||{};return[l.idx,{pathname:r,search:s,hash:c,state:l.usr||null,key:l.key||"default"}]}var s=null;function i(){if(s)L.call(s),s=null;else{var t=r.Pop,e=o(),a=e[0],n=e[1];if(L.length){if(null!=a){var i=f-a;i&&(s={action:t,location:n,retry:function(){R(-1*i)}},R(i))}}else x(t)}}a.addEventListener(u,i),a.addEventListener("hashchange",(function(){g(o()[1])!==g(b)&&i()}));var h=r.Pop,d=o(),f=d[0],b=d[1],_=m(),L=m();function P(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var n=a.location.href,r=n.indexOf("#");e=-1===r?n:n.slice(0,r)}return e}()+"#"+("string"==typeof t?t:g(t))}function w(t,e){return void 0===e&&(e=null),c({pathname:b.pathname,hash:"",search:""},"string"==typeof t?y(t):t,{state:e,key:v()})}function E(t,e){return[{usr:t.state,key:t.key,idx:e},P(t)]}function M(t,e,a){return!L.length||(L.call({action:t,location:e,retry:a}),!1)}function x(t){h=t;var e=o();f=e[0],b=e[1],_.call({action:h,location:b})}function R(t){n.go(t)}null==f&&(f=0,n.replaceState(c({},n.state,{idx:f}),""));var S={get action(){return h},get location(){return b},createHref:P,push:function t(e,o){var s=r.Push,i=w(e,o);if(M(s,i,(function(){t(e,o)}))){var c=E(i,f+1),l=c[0],u=c[1];try{n.pushState(l,"",u)}catch(t){a.location.assign(u)}x(s)}},replace:function t(e,a){var o=r.Replace,s=w(e,a);if(M(o,s,(function(){t(e,a)}))){var i=E(s,f),c=i[0],l=i[1];n.replaceState(c,"",l),x(o)}},go:R,back:function(){R(-1)},forward:function(){R(1)},listen:function(t){return _.push(t)},block:function(t){var e=L.push(t);return 1===L.length&&a.addEventListener(l,p),function(){e(),L.length||a.removeEventListener(l,p)}}};return S},t.createMemoryHistory=d,t.createReactRouter=function(t){const e=(t,e)=>({useRoute:function(a){void 0===a&&(a=".");const n=e.resolvePath(t.routeId,a),r=e.getRoute(n);return st(e),b(r),r},linkProps:e=>{var a,n;const{target:r,activeProps:c=(()=>({className:"active"})),inactiveProps:l=(()=>({})),disabled:u,style:h,className:d,onClick:f,onFocus:p,onMouseEnter:m,onMouseLeave:v}=e,g=i(e,tt),y=t.buildLink(e);if("external"===y.type){const{href:t}=y;return{href:t}}const{handleClick:b,handleFocus:_,handleEnter:L,handleLeave:P,isActive:w,next:E}=y,x=t=>e=>{e.persist&&e.persist(),t.forEach((t=>{e.defaultPrevented||t&&t(e)}))},R=w&&null!=(a=M(c,{}))?a:{},S=w?{}:null!=(n=M(l,{}))?n:{};return s({},R,S,g,{href:u?void 0:E.href,onClick:x([t=>{o.startTransition?o.startTransition((()=>{b(t)})):b(t)},f]),onFocus:x([_,p]),onMouseEnter:x([L,m]),onMouseLeave:x([P,v]),target:r,style:s({},h,R.style,S.style),className:[d,R.className,S.className].filter(Boolean).join(" ")||void 0},u?{role:"link","aria-disabled":!0}:void 0,{"data-status":w?"active":void 0})},Link:o.forwardRef(((a,n)=>{const r=t.linkProps(a);return st(e),o.createElement("a",s({ref:n},r,{children:"function"==typeof a.children?a.children({isActive:"active"===r["data-status"]}):a.children}))})),MatchRoute:e=>{const{pending:a,caseSensitive:n}=e,r=i(e,et),o=t.matchRoute(r,{pending:a,caseSensitive:n});return o?"function"==typeof e.children?e.children(o):e.children:null}}),a=Y(s({},t,{createRouter:t=>{const a={useState:()=>(st(t),t.state),useMatch:(e,a)=>{var n;st(t);const r=lt(),o=t.state.currentMatches.find((t=>t.routeId===e));return(null==(n=null==a?void 0:a.strict)||n)&&(b(o),b(r.routeId==(null==o?void 0:o.routeId),(null==o||o.routeId,r.routeId,null==o||o.routeId,null==o||o.routeId))),o}},n=e(t.getRoute(z),t);Object.assign(t,a,n)},createRoute:t=>{let{router:a,route:n}=t;const r=e(n,a);Object.assign(n,r)},loadComponent:async t=>(t.preload&&"undefined"!=typeof document&&t.preload(),t)}));return a},t.createRoute=H,t.createRouteConfig=function t(e,a,n,r,o){void 0===e&&(e={}),void 0===n&&(n=!0),n&&(e.path=z),r===z&&(r="");let s=n?z:e.path;s&&"/"!==s&&(s=C(s));const i=s||e.id;let c=R([r,i]);s===z&&(s="/"),c!==z&&(c=R(["/",c]));const l=c===z?"/":A(R([o,s]));return{id:c,routeId:i,path:s,fullPath:l,options:e,children:a,addChildren:a=>t(e,a,!1,r,o),createRoute:e=>t(e,void 0,!1,c,l),generate:()=>{b(!1)}}},t.createRouteMatch=W,t.createRouter=Y,t.decode=B,t.defaultParseSearch=q,t.defaultStringifySearch=K,t.encode=T,t.functionalUpdate=M,t.interpolatePath=D,t.invariant=b,t.joinPaths=R,t.last=w,t.lazy=function(t){const e=o.lazy(t);let a,n;const r=o.forwardRef(((t,a)=>{const r=o.useRef(n||e);return o.createElement(r.current,s({},a?{ref:a}:{},t))}));return r.preload=()=>(a||(a=t().then((t=>(n=t.default,n)))),a),r},t.linkProps=function(t){return it().linkProps(t)},t.matchByPath=F,t.matchPathname=j,t.matchesContext=nt,t.parsePathname=O,t.parseSearchWith=V,t.pick=x,t.replaceEqualDeep=_,t.resolvePath=k,t.rootRouteId=z,t.routerContext=rt,t.stringifySearchWith=$,t.trimPath=C,t.trimPathLeft=I,t.trimPathRight=A,t.useMatch=function(t,e){return it().useMatch(t,e)},t.useMatches=ct,t.useNearestMatch=lt,t.usePrompt=pt,t.useRoute=function(t){return it().useRoute(t)},t.useRouter=it,t.useSearch=function(t){return it().state.currentLocation.search},t.warning=E,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map
{
"name": "@tanstack/react-router",
"author": "Tanner Linsley",
"version": "0.0.1-beta.36",
"version": "0.0.1-beta.37",
"license": "MIT",

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

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

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