Socket
Socket
Sign inDemoInstall

@tanstack/router-core

Package Overview
Dependencies
Maintainers
1
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.16 to 0.0.1-beta.19

59

build/cjs/packages/router-core/src/routeMatch.js

@@ -124,7 +124,15 @@ /**

fetch: async opts => {
const id = '' + Date.now() + Math.random();
routeMatch.__.latestId = id; // If the match was in an error state, set it
const loadId = '' + Date.now() + Math.random();
routeMatch.__.latestId = loadId;
const checkLatest = async () => {
if (loadId !== routeMatch.__.latestId) {
// warning(true, 'Data loader is out of date!')
return new Promise(() => {});
}
}; // If the match was in an error state, set it
// to a loading state again. Otherwise, keep it
// as loading or resolved
if (routeMatch.status === 'idle') {

@@ -161,15 +169,4 @@ routeMatch.status = 'loading';

if (routeMatch.options.loader) {
var _routeMatch$parentMat3;
const data = await routeMatch.options.loader({
parentLoaderPromise: (_routeMatch$parentMat3 = routeMatch.parentMatch) == null ? void 0 : _routeMatch$parentMat3.__.dataPromise,
params: routeMatch.params,
search: routeMatch.routeSearch,
signal: routeMatch.__.abortController.signal
});
if (id !== routeMatch.__.latestId) {
return routeMatch.__.loadPromise;
}
const data = await router.loadMatchData(routeMatch);
await checkLatest();
routeMatch.routeLoaderData = utils.replaceEqualDeep(routeMatch.routeLoaderData, data);

@@ -184,5 +181,3 @@ }

} catch (err) {
if (id !== routeMatch.__.latestId) {
return routeMatch.__.loadPromise;
}
await checkLatest();

@@ -200,25 +195,19 @@ if (process.env.NODE_ENV !== 'production') {

try {
await Promise.all([routeMatch.__.componentsPromise, routeMatch.__.dataPromise.catch(() => {})]);
if (id !== routeMatch.__.latestId) {
return routeMatch.__.loadPromise;
}
} finally {
if (id !== routeMatch.__.latestId) {
return routeMatch.__.loadPromise;
}
const after = async () => {
await checkLatest();
routeMatch.isFetching = false;
delete routeMatch.__.loadPromise;
routeMatch.__.notify();
};
try {
await Promise.all([routeMatch.__.componentsPromise, routeMatch.__.dataPromise.catch(() => {})]);
after();
} catch (_unused) {
after();
}
});
await routeMatch.__.loadPromise;
if (id !== routeMatch.__.latestId) {
return routeMatch.__.loadPromise;
}
delete routeMatch.__.loadPromise;
await checkLatest();
}

@@ -225,0 +214,0 @@ });

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

let router = {
types: undefined,
// public api
history,

@@ -68,3 +70,2 @@ options: originalOptions,

location: undefined,
allRouteInfo: undefined,
//

@@ -452,3 +453,8 @@ navigationPromise: Promise.resolve(),

match.load(loaderOpts);
const search = match.search;
if (search.__data && search.__data.matchId !== match.matchId) {
return;
}
if (match.__.loadPromise) {

@@ -462,2 +468,33 @@ // Wait for the first sign of activity from the match

},
loadMatchData: async routeMatch => {
if (isServer || !router.options.useServerData) {
var _await$routeMatch$opt;
return (_await$routeMatch$opt = await (routeMatch.options.loader == null ? void 0 : routeMatch.options.loader({
// parentLoaderPromise: routeMatch.parentMatch?.__.dataPromise,
params: routeMatch.params,
search: routeMatch.routeSearch,
signal: routeMatch.__.abortController.signal
}))) != null ? _await$routeMatch$opt : {};
} else {
const next = router.buildNext({
to: '.',
search: d => _rollupPluginBabelHelpers["extends"]({}, d != null ? d : {}, {
__data: {
matchId: routeMatch.matchId
}
})
});
const res = await fetch(next.href, {
method: 'GET' // signal: routeMatch.__.abortController.signal,
});
if (res.ok) {
return res.json();
}
throw new Error('Failed to fetch match data');
}
},
invalidateRoute: opts => {

@@ -464,0 +501,0 @@ var _router$state$pending5, _router$state$pending6;

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

"name": "@babel/runtime/helpers/esm/extends.js",
"uid": "36b9-30"
"uid": "5c4d-30"
},
{
"name": "history/index.js",
"uid": "36b9-32"
"uid": "5c4d-32"
},
{
"name": "tiny-invariant/dist/esm/tiny-invariant.js",
"uid": "36b9-34"
"uid": "5c4d-34"
}

@@ -31,35 +31,35 @@ ]

{
"uid": "36b9-36",
"uid": "5c4d-36",
"name": "utils.ts"
},
{
"uid": "36b9-38",
"uid": "5c4d-38",
"name": "path.ts"
},
{
"uid": "36b9-40",
"uid": "5c4d-40",
"name": "qss.ts"
},
{
"uid": "36b9-44",
"uid": "5c4d-44",
"name": "route.ts"
},
{
"uid": "36b9-46",
"uid": "5c4d-46",
"name": "routeConfig.ts"
},
{
"uid": "36b9-48",
"uid": "5c4d-48",
"name": "routeMatch.ts"
},
{
"uid": "36b9-50",
"uid": "5c4d-50",
"name": "searchParams.ts"
},
{
"uid": "36b9-52",
"uid": "5c4d-52",
"name": "router.ts"
},
{
"uid": "36b9-54",
"uid": "5c4d-54",
"name": "index.ts"

@@ -70,3 +70,3 @@ }

{
"uid": "36b9-42",
"uid": "5c4d-42",
"name": "\u0000rollupPluginBabelHelpers.js"

@@ -80,86 +80,86 @@ }

"nodeParts": {
"36b9-30": {
"5c4d-30": {
"renderedLength": 437,
"gzipLength": 243,
"brotliLength": 0,
"mainUid": "36b9-29"
"mainUid": "5c4d-29"
},
"36b9-32": {
"5c4d-32": {
"renderedLength": 20630,
"gzipLength": 3800,
"brotliLength": 0,
"mainUid": "36b9-31"
"mainUid": "5c4d-31"
},
"36b9-34": {
"5c4d-34": {
"renderedLength": 181,
"gzipLength": 129,
"brotliLength": 0,
"mainUid": "36b9-33"
"mainUid": "5c4d-33"
},
"36b9-36": {
"5c4d-36": {
"renderedLength": 2469,
"gzipLength": 983,
"brotliLength": 0,
"mainUid": "36b9-35"
"mainUid": "5c4d-35"
},
"36b9-38": {
"5c4d-38": {
"renderedLength": 5496,
"gzipLength": 1394,
"brotliLength": 0,
"mainUid": "36b9-37"
"mainUid": "5c4d-37"
},
"36b9-40": {
"5c4d-40": {
"renderedLength": 1320,
"gzipLength": 560,
"brotliLength": 0,
"mainUid": "36b9-39"
"mainUid": "5c4d-39"
},
"36b9-42": {
"5c4d-42": {
"renderedLength": 431,
"gzipLength": 240,
"brotliLength": 0,
"mainUid": "36b9-41"
"mainUid": "5c4d-41"
},
"36b9-44": {
"5c4d-44": {
"renderedLength": 3560,
"gzipLength": 932,
"brotliLength": 0,
"mainUid": "36b9-43"
"mainUid": "5c4d-43"
},
"36b9-46": {
"5c4d-46": {
"renderedLength": 1416,
"gzipLength": 490,
"brotliLength": 0,
"mainUid": "36b9-45"
"mainUid": "5c4d-45"
},
"36b9-48": {
"renderedLength": 7881,
"gzipLength": 1992,
"5c4d-48": {
"renderedLength": 7418,
"gzipLength": 1993,
"brotliLength": 0,
"mainUid": "36b9-47"
"mainUid": "5c4d-47"
},
"36b9-50": {
"5c4d-50": {
"renderedLength": 1262,
"gzipLength": 479,
"brotliLength": 0,
"mainUid": "36b9-49"
"mainUid": "5c4d-49"
},
"36b9-52": {
"renderedLength": 29075,
"gzipLength": 6488,
"5c4d-52": {
"renderedLength": 30298,
"gzipLength": 6781,
"brotliLength": 0,
"mainUid": "36b9-51"
"mainUid": "5c4d-51"
},
"36b9-54": {
"5c4d-54": {
"renderedLength": 0,
"gzipLength": 0,
"brotliLength": 0,
"mainUid": "36b9-53"
"mainUid": "5c4d-53"
}
},
"nodeMetas": {
"36b9-29": {
"5c4d-29": {
"id": "/node_modules/@babel/runtime/helpers/esm/extends.js",
"moduleParts": {
"index.production.js": "36b9-30"
"index.production.js": "5c4d-30"
},

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

{
"uid": "36b9-31"
"uid": "5c4d-31"
}
]
},
"36b9-31": {
"5c4d-31": {
"id": "/node_modules/history/index.js",
"moduleParts": {
"index.production.js": "36b9-32"
"index.production.js": "5c4d-32"
},
"imported": [
{
"uid": "36b9-29"
"uid": "5c4d-29"
}

@@ -186,13 +186,13 @@ ],

{
"uid": "36b9-53"
"uid": "5c4d-53"
},
{
"uid": "36b9-51"
"uid": "5c4d-51"
}
]
},
"36b9-33": {
"5c4d-33": {
"id": "/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"moduleParts": {
"index.production.js": "36b9-34"
"index.production.js": "5c4d-34"
},

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

{
"uid": "36b9-53"
"uid": "5c4d-53"
},
{
"uid": "36b9-51"
"uid": "5c4d-51"
}
]
},
"36b9-35": {
"5c4d-35": {
"id": "/packages/router-core/src/utils.ts",
"moduleParts": {
"index.production.js": "36b9-36"
"index.production.js": "5c4d-36"
},

@@ -218,23 +218,23 @@ "imported": [],

{
"uid": "36b9-53"
"uid": "5c4d-53"
},
{
"uid": "36b9-37"
"uid": "5c4d-37"
},
{
"uid": "36b9-47"
"uid": "5c4d-47"
},
{
"uid": "36b9-51"
"uid": "5c4d-51"
}
]
},
"36b9-37": {
"5c4d-37": {
"id": "/packages/router-core/src/path.ts",
"moduleParts": {
"index.production.js": "36b9-38"
"index.production.js": "5c4d-38"
},
"imported": [
{
"uid": "36b9-35"
"uid": "5c4d-35"
}

@@ -244,16 +244,16 @@ ],

{
"uid": "36b9-53"
"uid": "5c4d-53"
},
{
"uid": "36b9-45"
"uid": "5c4d-45"
},
{
"uid": "36b9-51"
"uid": "5c4d-51"
}
]
},
"36b9-39": {
"5c4d-39": {
"id": "/packages/router-core/src/qss.ts",
"moduleParts": {
"index.production.js": "36b9-40"
"index.production.js": "5c4d-40"
},

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

{
"uid": "36b9-53"
"uid": "5c4d-53"
},
{
"uid": "36b9-49"
"uid": "5c4d-49"
}
]
},
"36b9-41": {
"5c4d-41": {
"id": "\u0000rollupPluginBabelHelpers.js",
"moduleParts": {
"index.production.js": "36b9-42"
"index.production.js": "5c4d-42"
},

@@ -279,23 +279,23 @@ "imported": [],

{
"uid": "36b9-43"
"uid": "5c4d-43"
},
{
"uid": "36b9-47"
"uid": "5c4d-47"
},
{
"uid": "36b9-51"
"uid": "5c4d-51"
},
{
"uid": "36b9-49"
"uid": "5c4d-49"
}
]
},
"36b9-43": {
"5c4d-43": {
"id": "/packages/router-core/src/route.ts",
"moduleParts": {
"index.production.js": "36b9-44"
"index.production.js": "5c4d-44"
},
"imported": [
{
"uid": "36b9-41"
"uid": "5c4d-41"
}

@@ -305,17 +305,17 @@ ],

{
"uid": "36b9-53"
"uid": "5c4d-53"
},
{
"uid": "36b9-51"
"uid": "5c4d-51"
}
]
},
"36b9-45": {
"5c4d-45": {
"id": "/packages/router-core/src/routeConfig.ts",
"moduleParts": {
"index.production.js": "36b9-46"
"index.production.js": "5c4d-46"
},
"imported": [
{
"uid": "36b9-37"
"uid": "5c4d-37"
}

@@ -325,17 +325,17 @@ ],

{
"uid": "36b9-53"
"uid": "5c4d-53"
}
]
},
"36b9-47": {
"5c4d-47": {
"id": "/packages/router-core/src/routeMatch.ts",
"moduleParts": {
"index.production.js": "36b9-48"
"index.production.js": "5c4d-48"
},
"imported": [
{
"uid": "36b9-41"
"uid": "5c4d-41"
},
{
"uid": "36b9-35"
"uid": "5c4d-35"
}

@@ -345,20 +345,20 @@ ],

{
"uid": "36b9-53"
"uid": "5c4d-53"
},
{
"uid": "36b9-51"
"uid": "5c4d-51"
}
]
},
"36b9-49": {
"5c4d-49": {
"id": "/packages/router-core/src/searchParams.ts",
"moduleParts": {
"index.production.js": "36b9-50"
"index.production.js": "5c4d-50"
},
"imported": [
{
"uid": "36b9-41"
"uid": "5c4d-41"
},
{
"uid": "36b9-39"
"uid": "5c4d-39"
}

@@ -368,38 +368,38 @@ ],

{
"uid": "36b9-53"
"uid": "5c4d-53"
},
{
"uid": "36b9-51"
"uid": "5c4d-51"
}
]
},
"36b9-51": {
"5c4d-51": {
"id": "/packages/router-core/src/router.ts",
"moduleParts": {
"index.production.js": "36b9-52"
"index.production.js": "5c4d-52"
},
"imported": [
{
"uid": "36b9-41"
"uid": "5c4d-41"
},
{
"uid": "36b9-31"
"uid": "5c4d-31"
},
{
"uid": "36b9-33"
"uid": "5c4d-33"
},
{
"uid": "36b9-37"
"uid": "5c4d-37"
},
{
"uid": "36b9-43"
"uid": "5c4d-43"
},
{
"uid": "36b9-47"
"uid": "5c4d-47"
},
{
"uid": "36b9-49"
"uid": "5c4d-49"
},
{
"uid": "36b9-35"
"uid": "5c4d-35"
}

@@ -409,50 +409,50 @@ ],

{
"uid": "36b9-53"
"uid": "5c4d-53"
}
]
},
"36b9-53": {
"5c4d-53": {
"id": "/packages/router-core/src/index.ts",
"moduleParts": {
"index.production.js": "36b9-54"
"index.production.js": "5c4d-54"
},
"imported": [
{
"uid": "36b9-31"
"uid": "5c4d-31"
},
{
"uid": "36b9-33"
"uid": "5c4d-33"
},
{
"uid": "36b9-55"
"uid": "5c4d-55"
},
{
"uid": "36b9-56"
"uid": "5c4d-56"
},
{
"uid": "36b9-37"
"uid": "5c4d-37"
},
{
"uid": "36b9-39"
"uid": "5c4d-39"
},
{
"uid": "36b9-43"
"uid": "5c4d-43"
},
{
"uid": "36b9-45"
"uid": "5c4d-45"
},
{
"uid": "36b9-57"
"uid": "5c4d-57"
},
{
"uid": "36b9-47"
"uid": "5c4d-47"
},
{
"uid": "36b9-51"
"uid": "5c4d-51"
},
{
"uid": "36b9-49"
"uid": "5c4d-49"
},
{
"uid": "36b9-35"
"uid": "5c4d-35"
}

@@ -463,3 +463,3 @@ ],

},
"36b9-55": {
"5c4d-55": {
"id": "/packages/router-core/src/frameworks.ts",

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

{
"uid": "36b9-53"
"uid": "5c4d-53"
}
]
},
"36b9-56": {
"5c4d-56": {
"id": "/packages/router-core/src/link.ts",

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

{
"uid": "36b9-53"
"uid": "5c4d-53"
}
]
},
"36b9-57": {
"5c4d-57": {
"id": "/packages/router-core/src/routeInfo.ts",

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

{
"uid": "36b9-53"
"uid": "5c4d-53"
}

@@ -495,0 +495,0 @@ ]

@@ -17,3 +17,3 @@ /**

}
declare type GetFrameworkGeneric<U> = U extends keyof FrameworkGenerics ? FrameworkGenerics[U] : any;
type GetFrameworkGeneric<U> = U extends keyof FrameworkGenerics ? FrameworkGenerics[U] : any;

@@ -77,30 +77,30 @@ interface RouteMatch<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo> extends Route<TAllRouteInfo, TRouteInfo> {

declare type NoInfer<T> = [T][T extends any ? 0 : never];
declare type IsAny<T, Y, N> = 1 extends 0 & T ? Y : N;
declare type IsAnyBoolean<T> = 1 extends 0 & T ? true : false;
declare type IsKnown<T, Y, N> = unknown extends T ? N : Y;
declare type PickAsRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
declare type PickAsPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
declare type PickUnsafe<T, K> = K extends keyof T ? Pick<T, K> : never;
declare type PickExtra<T, K> = Expand<{
type NoInfer<T> = [T][T extends any ? 0 : never];
type IsAny<T, Y, N> = 1 extends 0 & T ? Y : N;
type IsAnyBoolean<T> = 1 extends 0 & T ? true : false;
type IsKnown<T, Y, N> = unknown extends T ? N : Y;
type PickAsRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
type PickAsPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
type PickUnsafe<T, K> = K extends keyof T ? Pick<T, K> : never;
type PickExtra<T, K> = Expand<{
[TKey in keyof K as string extends TKey ? never : TKey extends keyof T ? never : TKey]: K[TKey];
}>;
declare type PickRequired<T> = {
type PickRequired<T> = {
[K in keyof T as undefined extends T[K] ? never : K]: T[K];
};
declare type Expand<T> = T extends object ? T extends infer O ? {
type Expand<T> = T extends object ? T extends infer O ? {
[K in keyof O]: O[K];
} : never : T;
declare type Values<O> = O[ValueKeys<O>];
declare type ValueKeys<O> = Extract<keyof O, PropertyKey>;
declare type DeepAwaited<T> = T extends Promise<infer A> ? DeepAwaited<A> : T extends Record<infer A, Promise<infer B>> ? {
type Values<O> = O[ValueKeys<O>];
type ValueKeys<O> = Extract<keyof O, PropertyKey>;
type DeepAwaited<T> = T extends Promise<infer A> ? DeepAwaited<A> : T extends Record<infer A, Promise<infer B>> ? {
[K in A]: DeepAwaited<B>;
} : T;
declare type PathParamMask<TRoutePath extends string> = TRoutePath extends `${infer L}/:${infer C}/${infer R}` ? PathParamMask<`${L}/${string}/${R}`> : TRoutePath extends `${infer L}/:${infer C}` ? PathParamMask<`${L}/${string}`> : TRoutePath;
declare type Timeout = ReturnType<typeof setTimeout>;
declare type Updater<TPrevious, TResult = TPrevious> = TResult | ((prev?: TPrevious) => TResult);
declare type PickExtract<T, U> = {
type PathParamMask<TRoutePath extends string> = TRoutePath extends `${infer L}/:${infer C}/${infer R}` ? PathParamMask<`${L}/${string}/${R}`> : TRoutePath extends `${infer L}/:${infer C}` ? PathParamMask<`${L}/${string}`> : TRoutePath;
type Timeout = ReturnType<typeof setTimeout>;
type Updater<TPrevious, TResult = TPrevious> = TResult | ((prev?: TPrevious) => TResult);
type PickExtract<T, U> = {
[K in keyof T as T[K] extends U ? K : never]: T[K];
};
declare type PickExclude<T, U> = {
type PickExclude<T, U> = {
[K in keyof T as T[K] extends U ? never : K]: T[K];

@@ -136,5 +136,5 @@ };

}
declare type SearchSerializer = (searchObj: Record<string, any>) => string;
declare type SearchParser = (searchStr: string) => Record<string, any>;
declare type FilterRoutesFn = <TRoute extends Route<any, RouteInfo>>(routeConfigs: TRoute[]) => TRoute[];
type SearchSerializer = (searchObj: Record<string, any>) => string;
type SearchParser = (searchStr: string) => Record<string, any>;
type FilterRoutesFn = <TRoute extends Route<any, RouteInfo>>(routeConfigs: TRoute[]) => TRoute[];
interface RouterOptions<TRouteConfig extends AnyRouteConfig> {

@@ -149,3 +149,2 @@ history?: BrowserHistory | MemoryHistory | HashHistory;

defaultPreloadDelay?: number;
useErrorBoundary?: boolean;
defaultComponent?: GetFrameworkGeneric<'Component'>;

@@ -159,2 +158,3 @@ defaultErrorComponent?: GetFrameworkGeneric<'Component'>;

basepath?: string;
useServerData?: boolean;
createRouter?: (router: Router<any, any>) => void;

@@ -203,5 +203,5 @@ createRoute?: (opts: {

}
interface LoaderState<TFullSearchSchema = unknown, TAllParams = unknown> {
interface LoaderState<TFullSearchSchema extends AnySearchSchema = {}, TAllParams extends AnyPathParams = {}> {
loadedAt: number;
loaderContext: LoaderContext<TFullSearchSchema, TAllParams>;
loaderContext: LoaderContext<AnyLoaderData, TFullSearchSchema, TAllParams>;
}

@@ -223,4 +223,4 @@ interface RouterState {

}
declare type Listener = (router: Router<any, any>) => void;
declare type ListenerFn = () => void;
type Listener = (router: Router<any, any>) => void;
type ListenerFn = () => void;
interface BuildNextOptions {

@@ -238,3 +238,3 @@ to?: string | number | null;

}
declare type MatchCacheEntry = {
type MatchCacheEntry = {
gc: number;

@@ -260,6 +260,9 @@ match: RouteMatch;

interface Router<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>> {
types: {
RouteConfig: TRouteConfig;
AllRouteInfo: TAllRouteInfo;
};
history: BrowserHistory | MemoryHistory | HashHistory;
options: PickAsRequired<RouterOptions<TRouteConfig>, 'stringifySearch' | 'parseSearch'>;
basepath: string;
allRouteInfo: TAllRouteInfo;
listeners: Listener[];

@@ -304,2 +307,3 @@ location: Location;

}) => Promise<void>;
loadMatchData: (routeMatch: RouteMatch<any, any>) => Promise<Record<string, unknown>>;
invalidateRoute: (opts: MatchLocation) => void;

@@ -362,13 +366,17 @@ reload: () => Promise<void>;

}
declare type ParseRouteConfig<TRouteConfig = AnyRouteConfig> = TRouteConfig extends AnyRouteConfig ? RouteConfigRoute<TRouteConfig> | ParseRouteChildren<TRouteConfig> : never;
declare type ParseRouteChildren<TRouteConfig> = TRouteConfig extends AnyRouteConfigWithChildren<infer TChildren> ? unknown extends TChildren ? never : TChildren extends AnyRouteConfig[] ? Values<{
type ParseRouteConfig<TRouteConfig = AnyRouteConfig> = TRouteConfig extends AnyRouteConfig ? RouteConfigRoute<TRouteConfig> | ParseRouteChildren<TRouteConfig> : never;
type ParseRouteChildren<TRouteConfig> = TRouteConfig extends AnyRouteConfigWithChildren<infer TChildren> ? unknown extends TChildren ? never : TChildren extends AnyRouteConfig[] ? Values<{
[TId in TChildren[number]['id']]: ParseRouteChild<TChildren[number], TId>;
}> : never : never;
declare type ParseRouteChild<TRouteConfig, TId> = TRouteConfig & {
type ParseRouteChild<TRouteConfig, TId> = TRouteConfig & {
id: TId;
} extends AnyRouteConfig ? ParseRouteConfig<TRouteConfig> : never;
declare type RouteConfigRoute<TRouteConfig> = TRouteConfig extends RouteConfig<infer TId, infer TRouteId, infer TPath, infer TFullPath, infer TParentLoaderData, infer TRouteLoaderData, infer TLoaderData, infer TActionPayload, infer TActionResponse, infer TParentSearchSchema, infer TSearchSchema, infer TFullSearchSchema, infer TParentParams, infer TParams, infer TAllParams, any> ? string extends TRouteId ? never : RouteInfo<TId, TRouteId, TPath, TFullPath, TParentLoaderData, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams> : never;
type RouteConfigRoute<TRouteConfig> = TRouteConfig extends RouteConfig<infer TId, infer TRouteId, infer TPath, infer TFullPath, infer TParentLoaderData, infer TRouteLoaderData, infer TLoaderData, infer TActionPayload, infer TActionResponse, infer TParentSearchSchema, infer TSearchSchema, infer TFullSearchSchema, infer TParentParams, infer TParams, infer TAllParams, any> ? string extends TRouteId ? never : RouteInfo<TId, TRouteId, TPath, TFullPath, TParentLoaderData, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams> : never;
interface RoutesInfoInner<TRouteConfig extends AnyRouteConfig, TRouteInfo extends RouteInfo<string, string, any, any, any, any, any, any, any, any, any, any, any, any, any> = RouteInfo, TRouteInfoById = {
'/': TRouteInfo;
} & {
[TInfo in TRouteInfo as TInfo['id']]: TInfo;
}, TRouteInfoByFullPath = {
'/': TRouteInfo;
} & {
[TInfo in TRouteInfo as TInfo['fullPath'] extends RootRouteId ? never : string extends TInfo['fullPath'] ? never : TInfo['fullPath']]: TInfo;

@@ -402,28 +410,28 @@ }> {

}
declare type RoutesById<TAllRouteInfo extends AnyAllRouteInfo> = {
type RoutesById<TAllRouteInfo extends AnyAllRouteInfo> = {
[K in keyof TAllRouteInfo['routeInfoById']]: Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][K]>;
};
declare type RouteInfoById<TAllRouteInfo extends AnyAllRouteInfo, TId> = TId extends keyof TAllRouteInfo['routeInfoById'] ? IsAny<TAllRouteInfo['routeInfoById'][TId]['id'], RouteInfo, TAllRouteInfo['routeInfoById'][TId]> : never;
declare type RouteInfoByPath<TAllRouteInfo extends AnyAllRouteInfo, TPath> = TPath extends keyof TAllRouteInfo['routeInfoByFullPath'] ? IsAny<TAllRouteInfo['routeInfoByFullPath'][TPath]['id'], RouteInfo, TAllRouteInfo['routeInfoByFullPath'][TPath]> : never;
type RouteInfoById<TAllRouteInfo extends AnyAllRouteInfo, TId> = TId extends keyof TAllRouteInfo['routeInfoById'] ? IsAny<TAllRouteInfo['routeInfoById'][TId]['id'], RouteInfo, TAllRouteInfo['routeInfoById'][TId]> : never;
type RouteInfoByPath<TAllRouteInfo extends AnyAllRouteInfo, TPath> = TPath extends keyof TAllRouteInfo['routeInfoByFullPath'] ? IsAny<TAllRouteInfo['routeInfoByFullPath'][TPath]['id'], RouteInfo, TAllRouteInfo['routeInfoByFullPath'][TPath]> : never;
declare const rootRouteId: "__root__";
declare type RootRouteId = typeof rootRouteId;
declare type AnyLoaderData = {};
declare type AnyPathParams = {};
declare type AnySearchSchema = {};
type RootRouteId = typeof rootRouteId;
type AnyLoaderData = {};
type AnyPathParams = {};
type AnySearchSchema = {};
interface RouteMeta {
}
declare type SearchSchemaValidator<TReturn, TParentSchema> = SearchSchemaValidatorObj<TReturn, TParentSchema> | SearchSchemaValidatorFn<TReturn, TParentSchema>;
declare type SearchSchemaValidatorObj<TReturn, TParentSchema> = {
type SearchSchemaValidator<TReturn, TParentSchema> = SearchSchemaValidatorObj<TReturn, TParentSchema> | SearchSchemaValidatorFn<TReturn, TParentSchema>;
type SearchSchemaValidatorObj<TReturn, TParentSchema> = {
parse?: SearchSchemaValidatorFn<TReturn, TParentSchema>;
};
declare type SearchSchemaValidatorFn<TReturn, TParentSchema> = (searchObj: Record<string, unknown>) => {} extends TParentSchema ? TReturn : keyof TReturn extends keyof TParentSchema ? {
type SearchSchemaValidatorFn<TReturn, TParentSchema> = (searchObj: Record<string, unknown>) => {} extends TParentSchema ? TReturn : keyof TReturn extends keyof TParentSchema ? {
error: 'Top level search params cannot be redefined by child routes!';
keys: keyof TReturn & keyof TParentSchema;
} : TReturn;
declare type DefinedPathParamWarning = 'Path params cannot be redefined by child routes!';
declare type ParentParams<TParentParams> = AnyPathParams extends TParentParams ? {} : {
type DefinedPathParamWarning = 'Path params cannot be redefined by child routes!';
type ParentParams<TParentParams> = AnyPathParams extends TParentParams ? {} : {
[Key in keyof TParentParams]?: DefinedPathParamWarning;
};
declare type LoaderFn<TParentRouteLoaderData extends AnyLoaderData = {}, TRouteLoaderData extends AnyLoaderData = {}, TFullSearchSchema extends AnySearchSchema = {}, TAllParams extends AnyPathParams = {}> = (loaderContext: LoaderContext<TParentRouteLoaderData, TFullSearchSchema, TAllParams>) => Promise<TRouteLoaderData>;
type LoaderFn<TParentRouteLoaderData extends AnyLoaderData = {}, TRouteLoaderData extends AnyLoaderData = {}, TFullSearchSchema extends AnySearchSchema = {}, TAllParams extends AnyPathParams = {}> = (loaderContext: LoaderContext<TParentRouteLoaderData, TFullSearchSchema, TAllParams>) => Promise<TRouteLoaderData>;
interface LoaderContext<TParentRouteLoaderData extends AnyLoaderData = {}, TFullSearchSchema extends AnySearchSchema = {}, TAllParams extends AnyPathParams = {}> {

@@ -433,7 +441,6 @@ params: TAllParams;

signal?: AbortSignal;
parentLoaderPromise?: Promise<TParentRouteLoaderData>;
}
declare type ActionFn<TActionPayload = unknown, TActionResponse = unknown> = (submission: TActionPayload) => TActionResponse | Promise<TActionResponse>;
declare type UnloaderFn<TPath extends string> = (routeMatch: RouteMatch<any, RouteInfo<string, TPath>>) => void;
declare type RouteOptions<TRouteId extends string = string, TPath extends string = string, TParentRouteLoaderData extends AnyLoaderData = {}, TRouteLoaderData extends AnyLoaderData = {}, TLoaderData extends AnyLoaderData = {}, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = TSearchSchema, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}> = ({
type ActionFn<TActionPayload = unknown, TActionResponse = unknown> = (submission: TActionPayload) => TActionResponse | Promise<TActionResponse>;
type UnloaderFn<TPath extends string> = (routeMatch: RouteMatch<any, RouteInfo<string, TPath>>) => void;
type RouteOptions<TRouteId extends string = string, TPath extends string = string, TParentRouteLoaderData extends AnyLoaderData = {}, TRouteLoaderData extends AnyLoaderData = {}, TLoaderData extends AnyLoaderData = {}, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = TSearchSchema, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}> = ({
path: TPath;

@@ -454,3 +461,2 @@ } | {

action?: ActionFn<TActionPayload, TActionResponse>;
useErrorBoundary?: boolean;
onMatch?: (matchContext: {

@@ -475,3 +481,3 @@ params: TAllParams;

}) & (PickUnsafe<TParentParams, ParsePathParams<TPath>> extends never ? {} : 'Cannot redefined path params in child routes!');
declare type SearchFilter<T, U = T> = (prev: T) => U;
type SearchFilter<T, U = T> = (prev: T) => U;
interface RouteConfig<TId extends string = string, TRouteId extends string = string, TPath extends string = string, TFullPath extends string = string, TParentRouteLoaderData extends AnyLoaderData = AnyLoaderData, TRouteLoaderData extends AnyLoaderData = AnyLoaderData, TLoaderData extends AnyLoaderData = AnyLoaderData, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}, TKnownChildren = unknown> {

@@ -494,7 +500,7 @@ id: TId;

}
declare type CreateRouteConfigFn<TIsRoot extends boolean = false, TParentId extends string = string, TParentPath extends string = string, TParentRouteLoaderData extends AnyLoaderData = {}, TParentLoaderData extends AnyLoaderData = {}, TParentSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}> = <TRouteId extends string, TPath extends string, TRouteLoaderData extends AnyLoaderData, TActionPayload, TActionResponse, TSearchSchema extends AnySearchSchema = AnySearchSchema, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams extends TParams ? Record<ParsePathParams<TPath>, string> : NoInfer<TParams> = AnyPathParams extends TParams ? Record<ParsePathParams<TPath>, string> : NoInfer<TParams>, TKnownChildren extends RouteConfig[] = RouteConfig[], TResolvedId extends string = string extends TRouteId ? string extends TPath ? string : TPath : TRouteId>(options?: TIsRoot extends true ? Omit<RouteOptions<TRouteId, TPath, TParentRouteLoaderData, TRouteLoaderData, Expand<TParentLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>>, 'path'> & {
type CreateRouteConfigFn<TIsRoot extends boolean = false, TParentId extends string = string, TParentPath extends string = string, TParentRouteLoaderData extends AnyLoaderData = {}, TParentLoaderData extends AnyLoaderData = {}, TParentSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}> = <TRouteId extends string, TPath extends string, TRouteLoaderData extends AnyLoaderData, TActionPayload, TActionResponse, TSearchSchema extends AnySearchSchema = AnySearchSchema, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams extends TParams ? Record<ParsePathParams<TPath>, string> : NoInfer<TParams> = AnyPathParams extends TParams ? Record<ParsePathParams<TPath>, string> : NoInfer<TParams>, TKnownChildren extends RouteConfig[] = RouteConfig[], TResolvedId extends string = string extends TRouteId ? string extends TPath ? string : TPath : TRouteId>(options?: TIsRoot extends true ? Omit<RouteOptions<TRouteId, TPath, TParentRouteLoaderData, TRouteLoaderData, Expand<TParentLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>>, 'path'> & {
path?: never;
} : RouteOptions<TRouteId, TPath, TParentRouteLoaderData, TRouteLoaderData, Expand<TParentLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>>, children?: TKnownChildren, isRoot?: boolean, parentId?: string, parentPath?: string) => RouteConfig<RoutePrefix<TParentId, TResolvedId>, TResolvedId, TPath, string extends TPath ? '' : RoutePath<RoutePrefix<TParentPath, TPath>>, TParentRouteLoaderData, TRouteLoaderData, Expand<TParentLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>, TKnownChildren>;
declare type RoutePath<T extends string> = T extends RootRouteId ? '/' : TrimPathRight<`${T}`>;
declare type RoutePrefix<TPrefix extends string, TId extends string> = string extends TId ? RootRouteId : TId extends string ? `${TPrefix}/${TId}` extends '/' ? '/' : `/${TrimPathLeft<`${TrimPathRight<TPrefix>}/${TrimPath<TId>}`>}` : never;
type RoutePath<T extends string> = T extends RootRouteId ? '/' : TrimPathRight<`${T}`>;
type RoutePrefix<TPrefix extends string, TId extends string> = string extends TId ? RootRouteId : TId extends string ? `${TPrefix}/${TId}` extends '/' ? '/' : `/${TrimPathLeft<`${TrimPathRight<TPrefix>}/${TrimPath<TId>}`>}` : never;
interface AnyRouteConfig extends RouteConfig<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any> {

@@ -504,8 +510,8 @@ }

}
declare type TrimPath<T extends string> = '' extends T ? '' : TrimPathRight<TrimPathLeft<T>>;
declare type TrimPathLeft<T extends string> = T extends `${RootRouteId}/${infer U}` ? TrimPathLeft<U> : T extends `/${infer U}` ? TrimPathLeft<U> : T;
declare type TrimPathRight<T extends string> = T extends '/' ? '/' : T extends `${infer U}/` ? TrimPathRight<U> : T;
type TrimPath<T extends string> = '' extends T ? '' : TrimPathRight<TrimPathLeft<T>>;
type TrimPathLeft<T extends string> = T extends `${RootRouteId}/${infer U}` ? TrimPathLeft<U> : T extends `/${infer U}` ? TrimPathLeft<U> : T;
type TrimPathRight<T extends string> = T extends '/' ? '/' : T extends `${infer U}/` ? TrimPathRight<U> : T;
declare const createRouteConfig: CreateRouteConfigFn<true>;
declare type LinkInfo = {
type LinkInfo = {
type: 'external';

@@ -523,8 +529,8 @@ href: string;

};
declare type StartsWith<A, B> = A extends `${B extends string ? B : never}${infer _}` ? true : false;
declare type CleanPath<T extends string> = T extends `${infer L}//${infer R}` ? CleanPath<`${CleanPath<L>}/${CleanPath<R>}`> : T extends `${infer L}//` ? `${CleanPath<L>}/` : T extends `//${infer L}` ? `/${CleanPath<L>}` : T;
declare type Split<S, TIncludeTrailingSlash = true> = S extends unknown ? string extends S ? string[] : S extends string ? CleanPath<S> extends '' ? [] : TIncludeTrailingSlash extends true ? CleanPath<S> extends `${infer T}/` ? [...Split<T>, '/'] : CleanPath<S> extends `/${infer U}` ? Split<U> : CleanPath<S> extends `${infer T}/${infer U}` ? [...Split<T>, ...Split<U>] : [S] : CleanPath<S> extends `${infer T}/${infer U}` ? [...Split<T>, ...Split<U>] : S extends string ? [S] : never : never : never;
declare type ParsePathParams<T extends string> = Split<T>[number] extends infer U ? U extends `:${infer V}` ? V : never : never;
declare type Join<T> = T extends [] ? '' : T extends [infer L extends string] ? L : T extends [infer L extends string, ...infer Tail extends [...string[]]] ? CleanPath<`${L}/${Join<Tail>}`> : never;
declare type RelativeToPathAutoComplete<AllPaths extends string, TFrom extends string, TTo extends string, SplitPaths extends string[] = Split<AllPaths, false>> = TTo extends `..${infer _}` ? SplitPaths extends [
type StartsWith<A, B> = A extends `${B extends string ? B : never}${infer _}` ? true : false;
type CleanPath<T extends string> = T extends `${infer L}//${infer R}` ? CleanPath<`${CleanPath<L>}/${CleanPath<R>}`> : T extends `${infer L}//` ? `${CleanPath<L>}/` : T extends `//${infer L}` ? `/${CleanPath<L>}` : T;
type Split<S, TIncludeTrailingSlash = true> = S extends unknown ? string extends S ? string[] : S extends string ? CleanPath<S> extends '' ? [] : TIncludeTrailingSlash extends true ? CleanPath<S> extends `${infer T}/` ? [...Split<T>, '/'] : CleanPath<S> extends `/${infer U}` ? Split<U> : CleanPath<S> extends `${infer T}/${infer U}` ? [...Split<T>, ...Split<U>] : [S] : CleanPath<S> extends `${infer T}/${infer U}` ? [...Split<T>, ...Split<U>] : S extends string ? [S] : never : never : never;
type ParsePathParams<T extends string> = Split<T>[number] extends infer U ? U extends `:${infer V}` ? V : never : never;
type Join<T> = T extends [] ? '' : T extends [infer L extends string] ? L : T extends [infer L extends string, ...infer Tail extends [...string[]]] ? CleanPath<`${L}/${Join<Tail>}`> : never;
type RelativeToPathAutoComplete<AllPaths extends string, TFrom extends string, TTo extends string, SplitPaths extends string[] = Split<AllPaths, false>> = TTo extends `..${infer _}` ? SplitPaths extends [
...Split<ResolveRelativePath<TFrom, TTo>, false>,

@@ -540,6 +546,6 @@ ...infer TToRest

] ? `${TTo}${Join<RestPath>}` : never : './' | '../' | AllPaths;
declare type NavigateOptionsAbsolute<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = ToOptions<TAllRouteInfo, TFrom, TTo> & {
type NavigateOptionsAbsolute<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = ToOptions<TAllRouteInfo, TFrom, TTo> & {
replace?: boolean;
};
declare type ToOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.', TResolvedTo = ResolveRelativePath<TFrom, NoInfer<TTo>>> = {
type ToOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.', TResolvedTo = ResolveRelativePath<TFrom, NoInfer<TTo>>> = {
to?: ToPathOption<TAllRouteInfo, TFrom, TTo>;

@@ -550,3 +556,3 @@ hash?: Updater<string>;

} & CheckPath<TAllRouteInfo, NoInfer<TResolvedTo>, {}> & SearchParamOptions<TAllRouteInfo, TFrom, TResolvedTo> & PathParamOptions<TAllRouteInfo, TFrom, TResolvedTo>;
declare type SearchParamOptions<TAllRouteInfo extends AnyAllRouteInfo, TFrom, TTo, TFromSchema = RouteInfoByPath<TAllRouteInfo, TFrom>['fullSearchSchema'], TToSchema = RouteInfoByPath<TAllRouteInfo, TTo>['fullSearchSchema']> = StartsWith<TFrom, TTo> extends true ? {
type SearchParamOptions<TAllRouteInfo extends AnyAllRouteInfo, TFrom, TTo, TFromSchema = RouteInfoByPath<TAllRouteInfo, TFrom>['fullSearchSchema'], TToSchema = RouteInfoByPath<TAllRouteInfo, TTo>['fullSearchSchema']> = StartsWith<TFrom, TTo> extends true ? {
search?: SearchReducer<TFromSchema, TToSchema>;

@@ -558,6 +564,6 @@ } : keyof PickRequired<TToSchema> extends never ? {

};
declare type SearchReducer<TFrom, TTo> = {
type SearchReducer<TFrom, TTo> = {
[TKey in keyof TTo]: TTo[TKey];
} | ((current: TFrom) => TTo);
declare type PathParamOptions<TAllRouteInfo extends AnyAllRouteInfo, TFrom, TTo, TFromParams = RouteInfoByPath<TAllRouteInfo, TFrom>['allParams'], TToParams = RouteInfoByPath<TAllRouteInfo, TTo>['allParams']> = StartsWith<TFrom, TTo> extends true ? {
type PathParamOptions<TAllRouteInfo extends AnyAllRouteInfo, TFrom, TTo, TFromParams = RouteInfoByPath<TAllRouteInfo, TFrom>['allParams'], TToParams = RouteInfoByPath<TAllRouteInfo, TTo>['allParams']> = StartsWith<TFrom, TTo> extends true ? {
params?: ParamsReducer<TFromParams, TToParams>;

@@ -569,5 +575,5 @@ } : AnyPathParams extends TToParams ? {

};
declare type ParamsReducer<TFrom, TTo> = TTo | ((current: TFrom) => TTo);
declare type ToPathOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['routePaths'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
declare type ToIdOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['routeIds'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
type ParamsReducer<TFrom, TTo> = TTo | ((current: TFrom) => TTo);
type ToPathOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['routePaths'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
type ToIdOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['routeIds'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
interface ActiveOptions {

@@ -577,3 +583,3 @@ exact?: boolean;

}
declare type LinkOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = NavigateOptionsAbsolute<TAllRouteInfo, TFrom, TTo> & {
type LinkOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = NavigateOptionsAbsolute<TAllRouteInfo, TFrom, TTo> & {
target?: HTMLAnchorElement['target'];

@@ -587,18 +593,18 @@ activeOptions?: ActiveOptions;

};
declare type CheckRelativePath<TAllRouteInfo extends AnyAllRouteInfo, TFrom, TTo> = TTo extends string ? TFrom extends string ? ResolveRelativePath<TFrom, TTo> extends TAllRouteInfo['routePaths'] ? {} : {
type CheckRelativePath<TAllRouteInfo extends AnyAllRouteInfo, TFrom, TTo> = TTo extends string ? TFrom extends string ? ResolveRelativePath<TFrom, TTo> extends TAllRouteInfo['routePaths'] ? {} : {
Error: `${TFrom} + ${TTo} resolves to ${ResolveRelativePath<TFrom, TTo>}, which is not a valid route path.`;
'Valid Route Paths': TAllRouteInfo['routePaths'];
} : {} : {};
declare type CheckPath<TAllRouteInfo extends AnyAllRouteInfo, TPath, TPass> = Exclude<TPath, TAllRouteInfo['routePaths']> extends never ? TPass : CheckPathError<TAllRouteInfo, Exclude<TPath, TAllRouteInfo['routePaths']>>;
declare type CheckPathError<TAllRouteInfo extends AnyAllRouteInfo, TInvalids> = Expand<{
type CheckPath<TAllRouteInfo extends AnyAllRouteInfo, TPath, TPass> = Exclude<TPath, TAllRouteInfo['routePaths']> extends never ? TPass : CheckPathError<TAllRouteInfo, Exclude<TPath, TAllRouteInfo['routePaths']>>;
type CheckPathError<TAllRouteInfo extends AnyAllRouteInfo, TInvalids> = Expand<{
Error: `${TInvalids extends string ? TInvalids : never} is not a valid route path.`;
'Valid Route Paths': TAllRouteInfo['routePaths'];
}>;
declare type CheckId<TAllRouteInfo extends AnyAllRouteInfo, TPath, TPass> = Exclude<TPath, TAllRouteInfo['routeIds']> extends never ? TPass : CheckIdError<TAllRouteInfo, Exclude<TPath, TAllRouteInfo['routeIds']>>;
declare type CheckIdError<TAllRouteInfo extends AnyAllRouteInfo, TInvalids> = Expand<{
type CheckId<TAllRouteInfo extends AnyAllRouteInfo, TPath, TPass> = Exclude<TPath, TAllRouteInfo['routeIds']> extends never ? TPass : CheckIdError<TAllRouteInfo, Exclude<TPath, TAllRouteInfo['routeIds']>>;
type CheckIdError<TAllRouteInfo extends AnyAllRouteInfo, TInvalids> = Expand<{
Error: `${TInvalids extends string ? TInvalids : never} is not a valid route ID.`;
'Valid Route IDs': TAllRouteInfo['routeIds'];
}>;
declare type ResolveRelativePath<TFrom, TTo = '.'> = TFrom extends string ? TTo extends string ? TTo extends '.' ? TFrom : TTo extends `./` ? Join<[TFrom, '/']> : TTo extends `./${infer TRest}` ? ResolveRelativePath<TFrom, TRest> : TTo extends `/${infer TRest}` ? TTo : Split<TTo> extends ['..', ...infer ToRest] ? Split<TFrom> extends [...infer FromRest, infer FromTail] ? ToRest extends ['/'] ? Join<[...FromRest, '/']> : ResolveRelativePath<Join<FromRest>, Join<ToRest>> : never : Split<TTo> extends ['.', ...infer ToRest] ? ToRest extends ['/'] ? Join<[TFrom, '/']> : ResolveRelativePath<TFrom, Join<ToRest>> : CleanPath<Join<['/', ...Split<TFrom>, ...Split<TTo>]>> : never : never;
declare type ValidFromPath<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo> = undefined | (string extends TAllRouteInfo['routePaths'] ? string : TAllRouteInfo['routePaths']);
type ResolveRelativePath<TFrom, TTo = '.'> = TFrom extends string ? TTo extends string ? TTo extends '.' ? TFrom : TTo extends `./` ? Join<[TFrom, '/']> : TTo extends `./${infer TRest}` ? ResolveRelativePath<TFrom, TRest> : TTo extends `/${infer TRest}` ? TTo : Split<TTo> extends ['..', ...infer ToRest] ? Split<TFrom> extends [...infer FromRest, infer FromTail] ? ToRest extends ['/'] ? Join<[...FromRest, '/']> : ResolveRelativePath<Join<FromRest>, Join<ToRest>> : never : Split<TTo> extends ['.', ...infer ToRest] ? ToRest extends ['/'] ? Join<[TFrom, '/']> : ResolveRelativePath<TFrom, Join<ToRest>> : CleanPath<Join<['/', ...Split<TFrom>, ...Split<TTo>]>> : never : never;
type ValidFromPath<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo> = undefined | (string extends TAllRouteInfo['routePaths'] ? string : TAllRouteInfo['routePaths']);

@@ -605,0 +611,0 @@ interface Segment {

@@ -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(){return e=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},e.apply(this,arguments)}var a;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(a||(a={}));var n="beforeunload",o="popstate";function r(t){void 0===t&&(t={});var r=t.window,i=void 0===r?document.defaultView:r,s=i.history;function f(){var t=i.location,e=t.pathname,a=t.search,n=t.hash,o=s.state||{};return[o.idx,{pathname:e,search:a,hash:n,state:o.usr||null,key:o.key||"default"}]}var p=null;i.addEventListener(o,(function(){if(p)P.call(p),p=null;else{var t=a.Pop,e=f(),n=e[0],o=e[1];if(P.length){if(null!=n){var r=g-n;r&&(p={action:t,location:o,retry:function(){I(-1*r)}},I(r))}}else A(t)}}));var m=a.Pop,v=f(),g=v[0],y=v[1],_=c(),P=c();function b(t){return"string"==typeof t?t:h(t)}function w(t,a){return void 0===a&&(a=null),e({pathname:y.pathname,hash:"",search:""},"string"==typeof t?d(t):t,{state:a,key:u()})}function x(t,e){return[{usr:t.state,key:t.key,idx:e},b(t)]}function R(t,e,a){return!P.length||(P.call({action:t,location:e,retry:a}),!1)}function A(t){m=t;var e=f();g=e[0],y=e[1],_.call({action:m,location:y})}function I(t){s.go(t)}null==g&&(g=0,s.replaceState(e({},s.state,{idx:g}),""));var S={get action(){return m},get location(){return y},createHref:b,push:function t(e,n){var o=a.Push,r=w(e,n);if(R(o,r,(function(){t(e,n)}))){var l=x(r,g+1),c=l[0],u=l[1];try{s.pushState(c,"",u)}catch(t){i.location.assign(u)}A(o)}},replace:function t(e,n){var o=a.Replace,r=w(e,n);if(R(o,r,(function(){t(e,n)}))){var i=x(r,g),l=i[0],c=i[1];s.replaceState(l,"",c),A(o)}},go:I,back:function(){I(-1)},forward:function(){I(1)},listen:function(t){return _.push(t)},block:function(t){var e=P.push(t);return 1===P.length&&i.addEventListener(n,l),function(){e(),P.length||i.removeEventListener(n,l)}}};return S}function i(t){void 0===t&&(t={});var n=t,o=n.initialEntries,r=void 0===o?["/"]:o,i=n.initialIndex,l=r.map((function(t){return e({pathname:"/",search:"",hash:"",state:null,key:u()},"string"==typeof t?d(t):t)})),f=s(null==i?l.length-1:i,0,l.length-1),p=a.Pop,m=l[f],v=c(),g=c();function y(t,a){return void 0===a&&(a=null),e({pathname:m.pathname,search:"",hash:""},"string"==typeof t?d(t):t,{state:a,key:u()})}function _(t,e,a){return!g.length||(g.call({action:t,location:e,retry:a}),!1)}function P(t,e){p=t,m=e,v.call({action:p,location:m})}function b(t){var e=s(f+t,0,l.length-1),n=a.Pop,o=l[e];_(n,o,(function(){b(t)}))&&(f=e,P(n,o))}var w={get index(){return f},get action(){return p},get location(){return m},createHref:function(t){return"string"==typeof t?t:h(t)},push:function t(e,n){var o=a.Push,r=y(e,n);_(o,r,(function(){t(e,n)}))&&(f+=1,l.splice(f,l.length,r),P(o,r))},replace:function t(e,n){var o=a.Replace,r=y(e,n);_(o,r,(function(){t(e,n)}))&&(l[f]=r,P(o,r))},go:b,back:function(){b(-1)},forward:function(){b(1)},listen:function(t){return v.push(t)},block:function(t){return g.push(t)}};return w}function s(t,e,a){return Math.min(Math.max(t,e),a)}function l(t){t.preventDefault(),t.returnValue=""}function c(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter((function(t){return t!==e}))}},call:function(e){t.forEach((function(t){return t&&t(e)}))}}}function u(){return Math.random().toString(36).substr(2,8)}function h(t){var e=t.pathname,a=void 0===e?"/":e,n=t.search,o=void 0===n?"":n,r=t.hash,i=void 0===r?"":r;return o&&"?"!==o&&(a+="?"===o.charAt(0)?o:"?"+o),i&&"#"!==i&&(a+="#"===i.charAt(0)?i:"#"+i),a}function d(t){var e={};if(t){var a=t.indexOf("#");a>=0&&(e.hash=t.substr(a),t=t.substr(0,a));var n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function f(t,e){if(!t)throw new Error("Invariant failed")}function p(t,e){if(t===e)return t;const a=Array.isArray(t)&&Array.isArray(e);if(a||m(t)&&m(e)){const n=a?t.length:Object.keys(t).length,o=a?e:Object.keys(e),r=o.length,i=a?[]:{};let s=0;for(let n=0;n<r;n++){const r=a?n:o[n];i[r]=p(t[r],e[r]),i[r]===t[r]&&s++}return n===r&&s===n?t:i}return e}function m(t){if(!v(t))return!1;const e=t.constructor;if(void 0===e)return!0;const a=e.prototype;return!!v(a)&&!!a.hasOwnProperty("isPrototypeOf")}function v(t){return"[object Object]"===Object.prototype.toString.call(t)}function g(t){return t[t.length-1]}function y(t,e){return"function"==typeof t?t(e):t}function _(t,e){return e.reduce(((e,a)=>(e[a]=t[a],e)),{})}function P(t){return b(t.filter(Boolean).join("/"))}function b(t){return t.replace(/\/{2,}/g,"/")}function w(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function x(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function R(t){return x(w(t))}function A(t,e,a){e=e.replace(new RegExp("^"+t),"/"),a=a.replace(new RegExp("^"+t),"/");let n=I(e);const o=I(a);o.forEach(((t,e)=>{if("/"===t.value)e?e===o.length-1&&n.push(t):n=[t];else if(".."===t.value){var a;n.length>1&&"/"===(null==(a=g(n))?void 0:a.value)&&n.pop(),n.pop()}else{if("."===t.value)return;n.push(t)}}));return b(P([t,...n.map((t=>t.value))]))}function I(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 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 S(t,e,a){return P(I(t).map((t=>{return"*"!==t.value||a?"param"===t.type?null!=(n=e[t.value.substring(1)])?n:"":t.value:"";var n})))}function L(t,e){const a=M(t,e);if(!e.to||a)return null!=a?a:{}}function M(t,e){var a;const n=I(t),o=I(""+(null!=(a=e.to)?a:"*")),r={};return(()=>{for(let t=0;t<Math.max(n.length,o.length);t++){const a=n[t],i=o[t],s=t===o.length-1,l=t===n.length-1;if(i){if("wildcard"===i.type)return!(null==a||!a.value)&&(r["*"]=P(n.slice(t).map((t=>t.value))),!0);if("pathname"===i.type){if("/"===i.value&&(null==a||!a.value))return!0;if(a)if(e.caseSensitive){if(i.value!==a.value)return!1}else if(i.value.toLowerCase()!==a.value.toLowerCase())return!1}if(!a)return!1;if("param"===i.type){if("/"===(null==a?void 0:a.value))return!1;a.value.startsWith(":")||(r[i.value.substring(1)]=a.value)}}if(s&&!l)return!!e.fuzzy}return!0})()?r:void 0}function E(t,e){var a,n,o,r="";for(a in t)if(void 0!==(o=t[a]))if(Array.isArray(o))for(n=0;n<o.length;n++)r&&(r+="&"),r+=encodeURIComponent(a)+"="+encodeURIComponent(o[n]);else r&&(r+="&"),r+=encodeURIComponent(a)+"="+encodeURIComponent(o);return(e||"")+r}function C(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function k(t){for(var e,a,n={},o=t.split("&");e=o.shift();)void 0!==n[a=(e=e.split("=")).shift()]?n[a]=[].concat(n[a],C(e.shift())):n[a]=C(e.shift());return n}function D(){return D=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},D.apply(this,arguments)}function O(t,e,a,n){const{id:o,routeId:r,path:i,fullPath:s}=t,l=n.state.actions[o]||(n.state.actions[o]={submissions:[],submit:async(t,e)=>{var a;if(!u)return;const o=null==(a=null==e?void 0:e.invalidate)||a;null!=e&&e.multi||(l.submissions=l.submissions.filter((t=>t.isMulti)));const r={submittedAt:Date.now(),status:"pending",submission:t,isMulti:!(null==e||!e.multi)};l.current=r,l.latest=r,l.submissions.push(r),n.notify();try{const e=await(null==u.options.action?void 0:u.options.action(t));return r.data=e,o&&(n.invalidateRoute({to:".",fromCurrent:!0}),await n.reload()),r.status="success",e}catch(t){console.error(t),r.error=t,r.status="error"}finally{n.notify()}}},n.state.actions[o]),c=n.state.loaders[o]||(n.state.loaders[o]={pending:[],fetch:async t=>{if(!u)return;const e={loadedAt:Date.now(),loaderContext:t};c.current=e,c.latest=e,c.pending.push(e),n.notify();try{return await(null==u.options.loader?void 0:u.options.loader(t))}finally{c.pending=c.pending.filter((t=>t!==e)),n.notify()}}},n.state.loaders[o]);let u={routeId:o,routeRouteId:r,routePath:i,fullPath:s,options:e,router:n,childRoutes:void 0,parentRoute:a,action:l,loader:c,buildLink:t=>n.buildLink(D({},t,{from:s})),navigate:t=>n.navigate(D({},t,{from:s})),matchRoute:(t,e)=>n.matchRoute(D({},t,{from:s}),e)};return null==n.options.createRoute||n.options.createRoute({router:n,route:u}),u}const F="__root__",j=["component","errorComponent","pendingComponent"];function T(t,e,a){const n=D({},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 o=null!=(e=null==(a=n.parentMatch)?void 0:a.search)?e:t.location.search;try{var r;const t=n.routeSearch,e="object"==typeof n.options.validateSearch?n.options.validateSearch.parse:n.options.validateSearch;let a=p(t,null!=(r=null==e?void 0:e(o))?r:{});t!==a&&(n.isInvalid=!0),n.routeSearch=a,n.search=p(o,D({},o,a)),j.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&&!j.some((t=>{var a;return null==(a=e.options[t])?void 0:a.preload}))),load:async e=>{const a=Date.now(),o=null!=e&&e.preload?Math.max(null==e?void 0:e.maxAge,null==e?void 0:e.gcMaxAge):0;if(null!=e&&e.preload&&o>0){if(t.state.matches.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();if(n.__.latestId=a,"idle"===n.status&&(n.status="loading"),n.isInvalid=!1,n.__.loadPromise=new Promise((async o=>{n.isFetching=!0,n.__.resolve=o,n.__.componentsPromise=(async()=>{await Promise.all(j.map((async e=>{var a;const o=n.options[e];null!=(a=n.__[e])&&a.preload&&(n.__[e]=await t.options.loadComponent(o))})))})(),n.__.dataPromise=Promise.resolve().then((async()=>{try{var o,r,i;if(n.options.loader){var s;const t=await n.options.loader({parentLoaderPromise:null==(s=n.parentMatch)?void 0:s.__.dataPromise,params:n.params,search:n.routeSearch,signal:n.__.abortController.signal});if(a!==n.__.latestId)return n.__.loadPromise;n.routeLoaderData=p(n.routeLoaderData,t)}return n.error=void 0,n.status="success",n.updatedAt=Date.now(),n.invalidAt=n.updatedAt+(null!=(o=null!=(r=null!=(i=null==e?void 0:e.maxAge)?i:n.options.loaderMaxAge)?r:t.options.defaultLoaderMaxAge)?o:0),n.routeLoaderData}catch(t){if(a!==n.__.latestId)return n.__.loadPromise;throw n.error=t,n.status="error",n.updatedAt=Date.now(),t}}));try{if(await Promise.all([n.__.componentsPromise,n.__.dataPromise.catch((()=>{}))]),a!==n.__.latestId)return n.__.loadPromise}finally{if(a!==n.__.latestId)return n.__.loadPromise;n.isFetching=!1,n.__.notify()}})),await n.__.loadPromise,a!==n.__.latestId)return n.__.loadPromise;delete n.__.loadPromise}});return n.hasLoaders()||(n.status="success"),n}const N=U(JSON.parse),B=H(JSON.stringify);function U(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let a=k(e);for(let e in a){const n=a[e];if("string"==typeof n)try{a[e]=t(n)}catch(t){}}return a}}function H(t){return e=>{(e=D({},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=E(e).toString();return a?"?"+a:""}}var G;const z="undefined"==typeof window||!(null!=(G=window.document)&&G.createElement);function K(){return{status:"idle",location:null,matches:[],actions:{},loaders:{},lastUpdated:Date.now(),isFetching:!1,isPreloading:!1}}function V(t){t.forEach(((e,a)=>{const n=t[a-1];n&&(e.loaderData=p(e.loaderData,D({},n.loaderData,e.routeLoaderData)))}))}t.cleanPath=b,t.createBrowserHistory=r,t.createHashHistory=function(t){void 0===t&&(t={});var r=t.window,i=void 0===r?document.defaultView:r,s=i.history;function f(){var t=d(i.location.hash.substr(1)),e=t.pathname,a=void 0===e?"/":e,n=t.search,o=void 0===n?"":n,r=t.hash,l=void 0===r?"":r,c=s.state||{};return[c.idx,{pathname:a,search:o,hash:l,state:c.usr||null,key:c.key||"default"}]}var p=null;function m(){if(p)b.call(p),p=null;else{var t=a.Pop,e=f(),n=e[0],o=e[1];if(b.length){if(null!=n){var r=y-n;r&&(p={action:t,location:o,retry:function(){S(-1*r)}},S(r))}}else I(t)}}i.addEventListener(o,m),i.addEventListener("hashchange",(function(){h(f()[1])!==h(_)&&m()}));var v=a.Pop,g=f(),y=g[0],_=g[1],P=c(),b=c();function w(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var a=i.location.href,n=a.indexOf("#");e=-1===n?a:a.slice(0,n)}return e}()+"#"+("string"==typeof t?t:h(t))}function x(t,a){return void 0===a&&(a=null),e({pathname:_.pathname,hash:"",search:""},"string"==typeof t?d(t):t,{state:a,key:u()})}function R(t,e){return[{usr:t.state,key:t.key,idx:e},w(t)]}function A(t,e,a){return!b.length||(b.call({action:t,location:e,retry:a}),!1)}function I(t){v=t;var e=f();y=e[0],_=e[1],P.call({action:v,location:_})}function S(t){s.go(t)}null==y&&(y=0,s.replaceState(e({},s.state,{idx:y}),""));var L={get action(){return v},get location(){return _},createHref:w,push:function t(e,n){var o=a.Push,r=x(e,n);if(A(o,r,(function(){t(e,n)}))){var l=R(r,y+1),c=l[0],u=l[1];try{s.pushState(c,"",u)}catch(t){i.location.assign(u)}I(o)}},replace:function t(e,n){var o=a.Replace,r=x(e,n);if(A(o,r,(function(){t(e,n)}))){var i=R(r,y),l=i[0],c=i[1];s.replaceState(l,"",c),I(o)}},go:S,back:function(){S(-1)},forward:function(){S(1)},listen:function(t){return P.push(t)},block:function(t){var e=b.push(t);return 1===b.length&&i.addEventListener(n,l),function(){e(),b.length||i.removeEventListener(n,l)}}};return L},t.createMemoryHistory=i,t.createRoute=O,t.createRouteConfig=function t(e,a,n,o,r){void 0===e&&(e={}),void 0===n&&(n=!0),n&&(e.path=F),o===F&&(o="");let i=n?F:e.path;i&&"/"!==i&&(i=R(i));const s=i||e.id;let l=P([o,s]);i===F&&(i="/"),l!==F&&(l=P(["/",l]));const c=l===F?"/":x(P([r,i]));return{id:l,routeId:s,path:i,fullPath:c,options:e,children:a,createChildren:a=>t(e,a((e=>t(e,void 0,!1,l,c))),!1,o,r),addChildren:a=>t(e,a,!1,o,r),createRoute:e=>t(e,void 0,!1,l,c)}},t.createRouteMatch=T,t.createRouter=function(t){var e,a;const n=(null==t?void 0:t.history)||(z?i():r()),o=D({defaultLoaderGcMaxAge:3e5,defaultLoaderMaxAge:0,defaultPreloadMaxAge:2e3,defaultPreloadDelay:50},t,{stringifySearch:null!=(e=null==t?void 0:t.stringifySearch)?e:B,parseSearch:null!=(a=null==t?void 0:t.parseSearch)?a:N});let s={history:n,options:o,listeners:[],basepath:"",routeTree:void 0,routesById:{},location:void 0,allRouteInfo:void 0,navigationPromise:Promise.resolve(),resolveNavigation:()=>{},matchCache:{},state:K(),reset:()=>{s.state=K(),s.notify()},startedLoadingAt:Date.now(),subscribe:t=>(s.listeners.push(t),()=>{s.listeners=s.listeners.filter((e=>e!==t))}),getRoute:t=>s.routesById[t],notify:()=>{const t="loading"===s.state.status||s.state.matches.some((t=>t.isFetching)),e=Object.values(s.matchCache).some((t=>t.match.isFetching&&!s.state.matches.find((e=>e.matchId===t.match.matchId))));s.state.isFetching===t&&s.state.isPreloading===e||(s.state=D({},s.state,{isFetching:t,isPreloading:e})),V(s.state.matches),s.listeners.forEach((t=>t(s)))},dehydrateState:()=>D({},_(s.state,["status","location","lastUpdated"]),{matches:s.state.matches.map((t=>_(t,["matchId","status","routeLoaderData","loaderData","isInvalid","invalidAt"])))}),hydrateState:t=>{const e=s.matchRoutes(s.location.pathname,{strictParseParams:!0});e.forEach(((e,a)=>{const n=t.matches[a];f(n),Object.assign(e,n)})),e.forEach((t=>t.__.validate())),s.state=D({},s.state,t,{matches:e})},mount:()=>{const t=s.__.buildLocation({to:".",search:!0,hash:!0});t.href!==s.location.href&&s.__.commitLocation(t,!0),s.state.matches.length||s.load();const e=s.history.listen((t=>{s.load(s.__.parseLocation(t.location,s.location))}));return!z&&window.addEventListener&&(window.addEventListener("visibilitychange",s.onFocus,!1),window.addEventListener("focus",s.onFocus,!1)),()=>{e(),!z&&window.removeEventListener&&(window.removeEventListener("visibilitychange",s.onFocus),window.removeEventListener("focus",s.onFocus))}},onFocus:()=>{s.load()},update:t=>{const e=(null==t?void 0:t.history)!==s.history;s.location&&!e||(null!=t&&t.history&&(s.history=t.history),s.location=s.__.parseLocation(s.history.location),s.state.location=s.location),Object.assign(s.options,t);const{basepath:a,routeConfig:n}=s.options;return s.basepath=b("/"+(null!=a?a:"")),n&&(s.routesById={},s.routeTree=s.__.buildRouteTree(n)),s},cancelMatches:()=>{var t,e;[...s.state.matches,...null!=(t=null==(e=s.state.pending)?void 0:e.matches)?t:[]].forEach((t=>{t.cancel()}))},load:async t=>{const e=Math.random();s.startedLoadingAt=e,t&&(s.location=t),s.cancelMatches();const a=s.matchRoutes(s.location.pathname,{strictParseParams:!0});if("undefined"!=typeof document?s.state=D({},s.state,{pending:{matches:a,location:s.location},status:"loading"}):s.state=D({},s.state,{matches:a,location:s.location,status:"loading"}),s.notify(),await s.loadMatches(a),s.startedLoadingAt!==e)return s.navigationPromise;const n=s.state.matches,o=[],r=[];n.forEach((t=>{a.find((e=>e.matchId===t.matchId))?r.push(t):o.push(t)}));const i=a.filter((t=>!n.find((e=>e.matchId===t.matchId)))),l=Date.now();o.forEach((t=>{var e,a,n,o;null==t.__.onExit||t.__.onExit({params:t.params,search:t.routeSearch}),"error"!==t.status||t.isFetching||(t.status="idle",t.error=void 0);const r=Math.max(null!=(e=null!=(a=t.options.loaderGcMaxAge)?a:s.options.defaultLoaderGcMaxAge)?e:0,null!=(n=null!=(o=t.options.loaderMaxAge)?o:s.options.defaultLoaderMaxAge)?n:0);r>0&&(s.matchCache[t.matchId]={gc:r==1/0?Number.MAX_SAFE_INTEGER:l+r,match:t})})),r.forEach((t=>{null==t.options.onTransition||t.options.onTransition({params:t.params,search:t.routeSearch})})),i.forEach((t=>{t.__.onExit=null==t.options.onMatch?void 0:t.options.onMatch({params:t.params,search:t.search}),delete s.matchCache[t.matchId]})),s.startedLoadingAt===e&&(a.forEach((t=>{t.action&&(t.action.current=void 0,t.action.submissions=[])})),s.state=D({},s.state,{location:s.location,matches:a,pending:void 0,status:"idle"}),s.notify(),s.resolveNavigation())},cleanMatchCache:()=>{const t=Date.now();Object.keys(s.matchCache).forEach((e=>{const a=s.matchCache[e];"loading"!==a.match.status&&(a.gc>0&&a.gc>t||delete s.matchCache[e])}))},loadRoute:async function(t){void 0===t&&(t=s.location);const e=s.buildNext(t),a=s.matchRoutes(e.pathname,{strictParseParams:!0});return await s.loadMatches(a),a},preloadRoute:async function(t,e){var a,n,o,r,i,l;void 0===t&&(t=s.location);const c=s.buildNext(t),u=s.matchRoutes(c.pathname,{strictParseParams:!0});return await s.loadMatches(u,{preload:!0,maxAge:null!=(a=null!=(n=null!=(o=e.maxAge)?o:s.options.defaultPreloadMaxAge)?n:s.options.defaultLoaderMaxAge)?a:0,gcMaxAge:null!=(r=null!=(i=null!=(l=e.gcMaxAge)?l:s.options.defaultPreloadGcMaxAge)?i:s.options.defaultLoaderGcMaxAge)?r:0}),u},matchRoutes:(t,e)=>{var a,n;s.cleanMatchCache();const o=[];if(!s.routeTree)return o;const r=[...s.state.matches,...null!=(a=null==(n=s.state.pending)?void 0:n.matches)?a:[]],i=async a=>{var n,l,c;const u=g(o);let h=null!=(n=null==u?void 0:u.params)?n:{};const d=null!=(l=null==s.options.filterRoutes?void 0:s.options.filterRoutes(a))?l:a;let f=[];const p=(a,n)=>(n.some((n=>{var o,r,i;if(!n.routePath&&null!=(o=n.childRoutes)&&o.length)return p([...f,n],n.childRoutes);const l=!!("/"!==n.routePath||null!=(r=n.childRoutes)&&r.length),c=L(t,{to:n.fullPath,fuzzy:l,caseSensitive:null!=(i=n.options.caseSensitive)?i:s.options.caseSensitive});if(c){let t;try{var u;t=null!=(u=null==n.options.parseParams?void 0:n.options.parseParams(c))?u:c}catch(t){if(null!=e&&e.strictParseParams)throw t}h=D({},h,t)}return c&&(f=[...a,n]),!!f.length})),!!f.length);if(p([],d),!f.length)return;f.forEach((e=>{var a;const n=S(e.routePath,h),i=S(e.routeId,h,!0),l=r.find((t=>t.matchId===i))||(null==(a=s.matchCache[i])?void 0:a.match)||T(s,e,{parentMatch:u,matchId:i,params:h,pathname:P([t,n])});o.push(l)}));const m=g(f);null!=(c=m.childRoutes)&&c.length&&i(m.childRoutes)};return i([s.routeTree]),V(o),o},loadMatches:async(t,e)=>{const a=t.map((async t=>{t.__.validate(),t.load(e),t.__.loadPromise&&await t.__.loadPromise}));s.notify(),await Promise.all(a)},invalidateRoute:t=>{var e,a;const n=s.buildNext(t),o=s.matchRoutes(n.pathname).map((t=>t.matchId));[...s.state.matches,...null!=(e=null==(a=s.state.pending)?void 0:a.matches)?e:[]].forEach((t=>{o.includes(t.matchId)&&t.invalidate()}))},reload:()=>s.__.navigate({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(t,e)=>A(s.basepath,t,b(e)),matchRoute:(t,e)=>{var a;t=D({},t,{to:t.to?s.resolvePath(null!=(a=t.from)?a:"",t.to):void 0});const n=s.buildNext(t);var o;return null!=e&&e.pending?!(null==(o=s.state.pending)||!o.location)&&!!L(s.state.pending.location.pathname,D({},e,{to:n.pathname})):!!L(s.state.location.pathname,D({},e,{to:n.pathname}))},navigate:async t=>{let{from:e,to:a=".",search:n,hash:o,replace:r,params:i}=t;const l=String(a),c=String(e);let u;try{new URL(""+l),u=!0}catch(t){}return f(!u),s.__.navigate({from:c,to:l,search:n,hash:o,replace:r,params:i})},buildLink:t=>{var e,a;let{from:n,to:o=".",search:r,params:i,hash:l,target:c,replace:u,activeOptions:h,preload:d,preloadMaxAge:f,preloadGcMaxAge:p,preloadDelay:m,disabled:v}=t;try{return new URL(""+o),{type:"external",href:o}}catch(t){}const g={from:n,to:o,search:r,params:i,hash:l,replace:u},y=s.buildNext(g);d=null!=(e=d)?e:s.options.defaultPreload;const _=null!=(a=null!=m?m:s.options.defaultPreloadDelay)?a:0,P=s.state.location.pathname===y.pathname,b=s.state.location.pathname.split("/"),w=y.pathname.split("/").every(((t,e)=>t===b[e])),x=s.state.location.hash===y.hash,R=null!=h&&h.exact?P:w,A=null==h||!h.includeHash||x;return{type:"internal",next:y,handleFocus:t=>{d&&s.preloadRoute(g,{maxAge:f,gcMaxAge:p})},handleClick:t=>{v||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||c&&"_self"!==c||0!==t.button||(t.preventDefault(),!P||r||l||s.invalidateRoute(g),s.__.navigate(g))},handleEnter:t=>{const e=t.target||{};if(d){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,s.preloadRoute(g,{maxAge:f,gcMaxAge:p})}),_)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},isActive:R&&A,disabled:v}},buildNext:t=>{const e=s.__.buildLocation(t),a=s.matchRoutes(e.pathname),n=a.map((t=>{var e;return null!=(e=t.options.preSearchFilters)?e:[]})).flat().filter(Boolean),o=a.map((t=>{var e;return null!=(e=t.options.postSearchFilters)?e:[]})).flat().filter(Boolean);return s.__.buildLocation(D({},t,{__preSearchFilters:n,__postSearchFilters:o}))},__:{buildRouteTree:t=>{const e=(t,a)=>t.map((t=>{const n=O(t,t.options,a,s);if(s.routesById[n.routeId])throw new Error;s.routesById[n.routeId]=n;const o=t.children;return n.childRoutes=null!=o&&o.length?e(o,n):void 0,n}));return e([t])[0]},parseLocation:(t,e)=>{var a;const n=s.options.parseSearch(t.search);return{pathname:t.pathname,searchStr:t.search,search:p(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=s.buildNext(t);return s.__.commitLocation(e,t.replace)},buildLocation:function(t){var e,a,n,o,r,i,l,c,u;void 0===t&&(t={});const h=t.fromCurrent?s.location.pathname:null!=(e=t.from)?e:s.location.pathname;let d=A(null!=(a=s.basepath)?a:"/",h,""+(null!=(n=t.to)?n:"."));const f=s.matchRoutes(s.location.pathname,{strictParseParams:!0}),m=s.matchRoutes(d),v=D({},null==(o=g(f))?void 0:o.params);let _=!0===(null==(r=t.params)||r)?v:y(t.params,v);_&&m.map((t=>t.options.stringifyParams)).filter(Boolean).forEach((t=>{Object.assign({},_,t(_))})),d=S(d,null!=_?_:{});const P=null!=(i=t.__preSearchFilters)&&i.length?t.__preSearchFilters.reduce(((t,e)=>e(t)),s.location.search):s.location.search,b=!0===t.search?P:t.search?null!=(l=y(t.search,P))?l:{}:null!=(c=t.__preSearchFilters)&&c.length?P:{},w=null!=(u=t.__postSearchFilters)&&u.length?t.__postSearchFilters.reduce(((t,e)=>e(t)),b):b,x=p(s.location.search,w),R=s.options.stringifySearch(x);let I=!0===t.hash?s.location.hash:y(t.hash,s.location.hash);return I=I?"#"+I:"",{pathname:d,search:x,searchStr:R,state:s.location.state,hash:I,href:""+d+R+I,key:t.key}},commitLocation:(t,e)=>{const a=""+Date.now()+Math.random();s.navigateTimeout&&clearTimeout(s.navigateTimeout);let o="replace";e||(o="push");return s.__.parseLocation(n.location).href===t.href&&!t.key&&(o="replace"),"replace"===o?n.replace({pathname:t.pathname,hash:t.hash,search:t.searchStr},D({id:a},t.state)):n.push({pathname:t.pathname,hash:t.hash,search:t.searchStr},{id:a}),s.navigationPromise=new Promise((t=>{const e=s.resolveNavigation;s.resolveNavigation=()=>{e(),t()}})),s.navigationPromise}}};return s.update(t),null==s.options.createRouter||s.options.createRouter(s),s},t.decode=k,t.defaultParseSearch=N,t.defaultStringifySearch=B,t.encode=E,t.functionalUpdate=y,t.interpolatePath=S,t.invariant=f,t.joinPaths=P,t.last=g,t.matchByPath=M,t.matchPathname=L,t.parsePathname=I,t.parseSearchWith=U,t.pick=_,t.replaceEqualDeep=p,t.resolvePath=A,t.rootRouteId=F,t.stringifySearchWith=H,t.trimPath=R,t.trimPathLeft=w,t.trimPathRight=x,t.warning=function(t,e){if(t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}return!0},Object.defineProperty(t,"__esModule",{value:!0})}));
!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(){return e=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},e.apply(this,arguments)}var a;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(a||(a={}));var n="beforeunload",o="popstate";function r(t){void 0===t&&(t={});var r=t.window,i=void 0===r?document.defaultView:r,s=i.history;function p(){var t=i.location,e=t.pathname,a=t.search,n=t.hash,o=s.state||{};return[o.idx,{pathname:e,search:a,hash:n,state:o.usr||null,key:o.key||"default"}]}var f=null;i.addEventListener(o,(function(){if(f)b.call(f),f=null;else{var t=a.Pop,e=p(),n=e[0],o=e[1];if(b.length){if(null!=n){var r=g-n;r&&(f={action:t,location:o,retry:function(){S(-1*r)}},S(r))}}else R(t)}}));var m=a.Pop,v=p(),g=v[0],y=v[1],_=c(),b=c();function P(t){return"string"==typeof t?t:h(t)}function w(t,a){return void 0===a&&(a=null),e({pathname:y.pathname,hash:"",search:""},"string"==typeof t?d(t):t,{state:a,key:u()})}function x(t,e){return[{usr:t.state,key:t.key,idx:e},P(t)]}function A(t,e,a){return!b.length||(b.call({action:t,location:e,retry:a}),!1)}function R(t){m=t;var e=p();g=e[0],y=e[1],_.call({action:m,location:y})}function S(t){s.go(t)}null==g&&(g=0,s.replaceState(e({},s.state,{idx:g}),""));var I={get action(){return m},get location(){return y},createHref:P,push:function t(e,n){var o=a.Push,r=w(e,n);if(A(o,r,(function(){t(e,n)}))){var l=x(r,g+1),c=l[0],u=l[1];try{s.pushState(c,"",u)}catch(t){i.location.assign(u)}R(o)}},replace:function t(e,n){var o=a.Replace,r=w(e,n);if(A(o,r,(function(){t(e,n)}))){var i=x(r,g),l=i[0],c=i[1];s.replaceState(l,"",c),R(o)}},go:S,back:function(){S(-1)},forward:function(){S(1)},listen:function(t){return _.push(t)},block:function(t){var e=b.push(t);return 1===b.length&&i.addEventListener(n,l),function(){e(),b.length||i.removeEventListener(n,l)}}};return I}function i(t){void 0===t&&(t={});var n=t,o=n.initialEntries,r=void 0===o?["/"]:o,i=n.initialIndex,l=r.map((function(t){return e({pathname:"/",search:"",hash:"",state:null,key:u()},"string"==typeof t?d(t):t)})),p=s(null==i?l.length-1:i,0,l.length-1),f=a.Pop,m=l[p],v=c(),g=c();function y(t,a){return void 0===a&&(a=null),e({pathname:m.pathname,search:"",hash:""},"string"==typeof t?d(t):t,{state:a,key:u()})}function _(t,e,a){return!g.length||(g.call({action:t,location:e,retry:a}),!1)}function b(t,e){f=t,m=e,v.call({action:f,location:m})}function P(t){var e=s(p+t,0,l.length-1),n=a.Pop,o=l[e];_(n,o,(function(){P(t)}))&&(p=e,b(n,o))}var w={get index(){return p},get action(){return f},get location(){return m},createHref:function(t){return"string"==typeof t?t:h(t)},push:function t(e,n){var o=a.Push,r=y(e,n);_(o,r,(function(){t(e,n)}))&&(p+=1,l.splice(p,l.length,r),b(o,r))},replace:function t(e,n){var o=a.Replace,r=y(e,n);_(o,r,(function(){t(e,n)}))&&(l[p]=r,b(o,r))},go:P,back:function(){P(-1)},forward:function(){P(1)},listen:function(t){return v.push(t)},block:function(t){return g.push(t)}};return w}function s(t,e,a){return Math.min(Math.max(t,e),a)}function l(t){t.preventDefault(),t.returnValue=""}function c(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter((function(t){return t!==e}))}},call:function(e){t.forEach((function(t){return t&&t(e)}))}}}function u(){return Math.random().toString(36).substr(2,8)}function h(t){var e=t.pathname,a=void 0===e?"/":e,n=t.search,o=void 0===n?"":n,r=t.hash,i=void 0===r?"":r;return o&&"?"!==o&&(a+="?"===o.charAt(0)?o:"?"+o),i&&"#"!==i&&(a+="#"===i.charAt(0)?i:"#"+i),a}function d(t){var e={};if(t){var a=t.indexOf("#");a>=0&&(e.hash=t.substr(a),t=t.substr(0,a));var n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function p(t,e){if(!t)throw new Error("Invariant failed")}function f(t,e){if(t===e)return t;const a=Array.isArray(t)&&Array.isArray(e);if(a||m(t)&&m(e)){const n=a?t.length:Object.keys(t).length,o=a?e:Object.keys(e),r=o.length,i=a?[]:{};let s=0;for(let n=0;n<r;n++){const r=a?n:o[n];i[r]=f(t[r],e[r]),i[r]===t[r]&&s++}return n===r&&s===n?t:i}return e}function m(t){if(!v(t))return!1;const e=t.constructor;if(void 0===e)return!0;const a=e.prototype;return!!v(a)&&!!a.hasOwnProperty("isPrototypeOf")}function v(t){return"[object Object]"===Object.prototype.toString.call(t)}function g(t){return t[t.length-1]}function y(t,e){return"function"==typeof t?t(e):t}function _(t,e){return e.reduce(((e,a)=>(e[a]=t[a],e)),{})}function b(t){return P(t.filter(Boolean).join("/"))}function P(t){return t.replace(/\/{2,}/g,"/")}function w(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function x(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function A(t){return x(w(t))}function R(t,e,a){e=e.replace(new RegExp("^"+t),"/"),a=a.replace(new RegExp("^"+t),"/");let n=S(e);const o=S(a);o.forEach(((t,e)=>{if("/"===t.value)e?e===o.length-1&&n.push(t):n=[t];else if(".."===t.value){var a;n.length>1&&"/"===(null==(a=g(n))?void 0:a.value)&&n.pop(),n.pop()}else{if("."===t.value)return;n.push(t)}}));return P(b([t,...n.map((t=>t.value))]))}function S(t){if(!t)return[];const e=[];if("/"===(t=P(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 I(t,e,a){return b(S(t).map((t=>{return"*"!==t.value||a?"param"===t.type?null!=(n=e[t.value.substring(1)])?n:"":t.value:"";var n})))}function L(t,e){const a=M(t,e);if(!e.to||a)return null!=a?a:{}}function M(t,e){var a;const n=S(t),o=S(""+(null!=(a=e.to)?a:"*")),r={};return(()=>{for(let t=0;t<Math.max(n.length,o.length);t++){const a=n[t],i=o[t],s=t===o.length-1,l=t===n.length-1;if(i){if("wildcard"===i.type)return!(null==a||!a.value)&&(r["*"]=b(n.slice(t).map((t=>t.value))),!0);if("pathname"===i.type){if("/"===i.value&&(null==a||!a.value))return!0;if(a)if(e.caseSensitive){if(i.value!==a.value)return!1}else if(i.value.toLowerCase()!==a.value.toLowerCase())return!1}if(!a)return!1;if("param"===i.type){if("/"===(null==a?void 0:a.value))return!1;a.value.startsWith(":")||(r[i.value.substring(1)]=a.value)}}if(s&&!l)return!!e.fuzzy}return!0})()?r:void 0}function E(t,e){var a,n,o,r="";for(a in t)if(void 0!==(o=t[a]))if(Array.isArray(o))for(n=0;n<o.length;n++)r&&(r+="&"),r+=encodeURIComponent(a)+"="+encodeURIComponent(o[n]);else r&&(r+="&"),r+=encodeURIComponent(a)+"="+encodeURIComponent(o);return(e||"")+r}function C(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function k(t){for(var e,a,n={},o=t.split("&");e=o.shift();)void 0!==n[a=(e=e.split("=")).shift()]?n[a]=[].concat(n[a],C(e.shift())):n[a]=C(e.shift());return n}function D(){return D=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},D.apply(this,arguments)}function O(t,e,a,n){const{id:o,routeId:r,path:i,fullPath:s}=t,l=n.state.actions[o]||(n.state.actions[o]={submissions:[],submit:async(t,e)=>{var a;if(!u)return;const o=null==(a=null==e?void 0:e.invalidate)||a;null!=e&&e.multi||(l.submissions=l.submissions.filter((t=>t.isMulti)));const r={submittedAt:Date.now(),status:"pending",submission:t,isMulti:!(null==e||!e.multi)};l.current=r,l.latest=r,l.submissions.push(r),n.notify();try{const e=await(null==u.options.action?void 0:u.options.action(t));return r.data=e,o&&(n.invalidateRoute({to:".",fromCurrent:!0}),await n.reload()),r.status="success",e}catch(t){console.error(t),r.error=t,r.status="error"}finally{n.notify()}}},n.state.actions[o]),c=n.state.loaders[o]||(n.state.loaders[o]={pending:[],fetch:async t=>{if(!u)return;const e={loadedAt:Date.now(),loaderContext:t};c.current=e,c.latest=e,c.pending.push(e),n.notify();try{return await(null==u.options.loader?void 0:u.options.loader(t))}finally{c.pending=c.pending.filter((t=>t!==e)),n.notify()}}},n.state.loaders[o]);let u={routeId:o,routeRouteId:r,routePath:i,fullPath:s,options:e,router:n,childRoutes:void 0,parentRoute:a,action:l,loader:c,buildLink:t=>n.buildLink(D({},t,{from:s})),navigate:t=>n.navigate(D({},t,{from:s})),matchRoute:(t,e)=>n.matchRoute(D({},t,{from:s}),e)};return null==n.options.createRoute||n.options.createRoute({router:n,route:u}),u}const F="__root__",j=["component","errorComponent","pendingComponent"];function T(t,e,a){const n=D({},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 o=null!=(e=null==(a=n.parentMatch)?void 0:a.search)?e:t.location.search;try{var r;const t=n.routeSearch,e="object"==typeof n.options.validateSearch?n.options.validateSearch.parse:n.options.validateSearch;let a=f(t,null!=(r=null==e?void 0:e(o))?r:{});t!==a&&(n.isInvalid=!0),n.routeSearch=a,n.search=f(o,D({},o,a)),j.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&&!j.some((t=>{var a;return null==(a=e.options[t])?void 0:a.preload}))),load:async e=>{const a=Date.now(),o=null!=e&&e.preload?Math.max(null==e?void 0:e.maxAge,null==e?void 0:e.gcMaxAge):0;if(null!=e&&e.preload&&o>0){if(t.state.matches.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 o=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(j.map((async e=>{var a;const o=n.options[e];null!=(a=n.__[e])&&a.preload&&(n.__[e]=await t.options.loadComponent(o))})))})(),n.__.dataPromise=Promise.resolve().then((async()=>{try{var a,r,i;if(n.options.loader){const e=await t.loadMatchData(n);await o(),n.routeLoaderData=f(n.routeLoaderData,e)}return n.error=void 0,n.status="success",n.updatedAt=Date.now(),n.invalidAt=n.updatedAt+(null!=(a=null!=(r=null!=(i=null==e?void 0:e.maxAge)?i:n.options.loaderMaxAge)?r:t.options.defaultLoaderMaxAge)?a:0),n.routeLoaderData}catch(t){throw await o(),n.error=t,n.status="error",n.updatedAt=Date.now(),t}}));const r=async()=>{await o(),n.isFetching=!1,delete n.__.loadPromise,n.__.notify()};try{await Promise.all([n.__.componentsPromise,n.__.dataPromise.catch((()=>{}))]),r()}catch(t){r()}})),await n.__.loadPromise,await o()}});return n.hasLoaders()||(n.status="success"),n}const N=U(JSON.parse),B=H(JSON.stringify);function U(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let a=k(e);for(let e in a){const n=a[e];if("string"==typeof n)try{a[e]=t(n)}catch(t){}}return a}}function H(t){return e=>{(e=D({},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=E(e).toString();return a?"?"+a:""}}var G;const z="undefined"==typeof window||!(null!=(G=window.document)&&G.createElement);function K(){return{status:"idle",location:null,matches:[],actions:{},loaders:{},lastUpdated:Date.now(),isFetching:!1,isPreloading:!1}}function V(t){t.forEach(((e,a)=>{const n=t[a-1];n&&(e.loaderData=f(e.loaderData,D({},n.loaderData,e.routeLoaderData)))}))}t.cleanPath=P,t.createBrowserHistory=r,t.createHashHistory=function(t){void 0===t&&(t={});var r=t.window,i=void 0===r?document.defaultView:r,s=i.history;function p(){var t=d(i.location.hash.substr(1)),e=t.pathname,a=void 0===e?"/":e,n=t.search,o=void 0===n?"":n,r=t.hash,l=void 0===r?"":r,c=s.state||{};return[c.idx,{pathname:a,search:o,hash:l,state:c.usr||null,key:c.key||"default"}]}var f=null;function m(){if(f)P.call(f),f=null;else{var t=a.Pop,e=p(),n=e[0],o=e[1];if(P.length){if(null!=n){var r=y-n;r&&(f={action:t,location:o,retry:function(){I(-1*r)}},I(r))}}else S(t)}}i.addEventListener(o,m),i.addEventListener("hashchange",(function(){h(p()[1])!==h(_)&&m()}));var v=a.Pop,g=p(),y=g[0],_=g[1],b=c(),P=c();function w(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var a=i.location.href,n=a.indexOf("#");e=-1===n?a:a.slice(0,n)}return e}()+"#"+("string"==typeof t?t:h(t))}function x(t,a){return void 0===a&&(a=null),e({pathname:_.pathname,hash:"",search:""},"string"==typeof t?d(t):t,{state:a,key:u()})}function A(t,e){return[{usr:t.state,key:t.key,idx:e},w(t)]}function R(t,e,a){return!P.length||(P.call({action:t,location:e,retry:a}),!1)}function S(t){v=t;var e=p();y=e[0],_=e[1],b.call({action:v,location:_})}function I(t){s.go(t)}null==y&&(y=0,s.replaceState(e({},s.state,{idx:y}),""));var L={get action(){return v},get location(){return _},createHref:w,push:function t(e,n){var o=a.Push,r=x(e,n);if(R(o,r,(function(){t(e,n)}))){var l=A(r,y+1),c=l[0],u=l[1];try{s.pushState(c,"",u)}catch(t){i.location.assign(u)}S(o)}},replace:function t(e,n){var o=a.Replace,r=x(e,n);if(R(o,r,(function(){t(e,n)}))){var i=A(r,y),l=i[0],c=i[1];s.replaceState(l,"",c),S(o)}},go:I,back:function(){I(-1)},forward:function(){I(1)},listen:function(t){return b.push(t)},block:function(t){var e=P.push(t);return 1===P.length&&i.addEventListener(n,l),function(){e(),P.length||i.removeEventListener(n,l)}}};return L},t.createMemoryHistory=i,t.createRoute=O,t.createRouteConfig=function t(e,a,n,o,r){void 0===e&&(e={}),void 0===n&&(n=!0),n&&(e.path=F),o===F&&(o="");let i=n?F:e.path;i&&"/"!==i&&(i=A(i));const s=i||e.id;let l=b([o,s]);i===F&&(i="/"),l!==F&&(l=b(["/",l]));const c=l===F?"/":x(b([r,i]));return{id:l,routeId:s,path:i,fullPath:c,options:e,children:a,createChildren:a=>t(e,a((e=>t(e,void 0,!1,l,c))),!1,o,r),addChildren:a=>t(e,a,!1,o,r),createRoute:e=>t(e,void 0,!1,l,c)}},t.createRouteMatch=T,t.createRouter=function(t){var e,a;const n=(null==t?void 0:t.history)||(z?i():r()),o=D({defaultLoaderGcMaxAge:3e5,defaultLoaderMaxAge:0,defaultPreloadMaxAge:2e3,defaultPreloadDelay:50},t,{stringifySearch:null!=(e=null==t?void 0:t.stringifySearch)?e:B,parseSearch:null!=(a=null==t?void 0:t.parseSearch)?a:N});let s={types:void 0,history:n,options:o,listeners:[],basepath:"",routeTree:void 0,routesById:{},location:void 0,navigationPromise:Promise.resolve(),resolveNavigation:()=>{},matchCache:{},state:K(),reset:()=>{s.state=K(),s.notify()},startedLoadingAt:Date.now(),subscribe:t=>(s.listeners.push(t),()=>{s.listeners=s.listeners.filter((e=>e!==t))}),getRoute:t=>s.routesById[t],notify:()=>{const t="loading"===s.state.status||s.state.matches.some((t=>t.isFetching)),e=Object.values(s.matchCache).some((t=>t.match.isFetching&&!s.state.matches.find((e=>e.matchId===t.match.matchId))));s.state.isFetching===t&&s.state.isPreloading===e||(s.state=D({},s.state,{isFetching:t,isPreloading:e})),V(s.state.matches),s.listeners.forEach((t=>t(s)))},dehydrateState:()=>D({},_(s.state,["status","location","lastUpdated"]),{matches:s.state.matches.map((t=>_(t,["matchId","status","routeLoaderData","loaderData","isInvalid","invalidAt"])))}),hydrateState:t=>{const e=s.matchRoutes(s.location.pathname,{strictParseParams:!0});e.forEach(((e,a)=>{const n=t.matches[a];p(n),Object.assign(e,n)})),e.forEach((t=>t.__.validate())),s.state=D({},s.state,t,{matches:e})},mount:()=>{const t=s.__.buildLocation({to:".",search:!0,hash:!0});t.href!==s.location.href&&s.__.commitLocation(t,!0),s.state.matches.length||s.load();const e=s.history.listen((t=>{s.load(s.__.parseLocation(t.location,s.location))}));return!z&&window.addEventListener&&(window.addEventListener("visibilitychange",s.onFocus,!1),window.addEventListener("focus",s.onFocus,!1)),()=>{e(),!z&&window.removeEventListener&&(window.removeEventListener("visibilitychange",s.onFocus),window.removeEventListener("focus",s.onFocus))}},onFocus:()=>{s.load()},update:t=>{const e=(null==t?void 0:t.history)!==s.history;s.location&&!e||(null!=t&&t.history&&(s.history=t.history),s.location=s.__.parseLocation(s.history.location),s.state.location=s.location),Object.assign(s.options,t);const{basepath:a,routeConfig:n}=s.options;return s.basepath=P("/"+(null!=a?a:"")),n&&(s.routesById={},s.routeTree=s.__.buildRouteTree(n)),s},cancelMatches:()=>{var t,e;[...s.state.matches,...null!=(t=null==(e=s.state.pending)?void 0:e.matches)?t:[]].forEach((t=>{t.cancel()}))},load:async t=>{const e=Math.random();s.startedLoadingAt=e,t&&(s.location=t),s.cancelMatches();const a=s.matchRoutes(s.location.pathname,{strictParseParams:!0});if("undefined"!=typeof document?s.state=D({},s.state,{pending:{matches:a,location:s.location},status:"loading"}):s.state=D({},s.state,{matches:a,location:s.location,status:"loading"}),s.notify(),await s.loadMatches(a),s.startedLoadingAt!==e)return s.navigationPromise;const n=s.state.matches,o=[],r=[];n.forEach((t=>{a.find((e=>e.matchId===t.matchId))?r.push(t):o.push(t)}));const i=a.filter((t=>!n.find((e=>e.matchId===t.matchId)))),l=Date.now();o.forEach((t=>{var e,a,n,o;null==t.__.onExit||t.__.onExit({params:t.params,search:t.routeSearch}),"error"!==t.status||t.isFetching||(t.status="idle",t.error=void 0);const r=Math.max(null!=(e=null!=(a=t.options.loaderGcMaxAge)?a:s.options.defaultLoaderGcMaxAge)?e:0,null!=(n=null!=(o=t.options.loaderMaxAge)?o:s.options.defaultLoaderMaxAge)?n:0);r>0&&(s.matchCache[t.matchId]={gc:r==1/0?Number.MAX_SAFE_INTEGER:l+r,match:t})})),r.forEach((t=>{null==t.options.onTransition||t.options.onTransition({params:t.params,search:t.routeSearch})})),i.forEach((t=>{t.__.onExit=null==t.options.onMatch?void 0:t.options.onMatch({params:t.params,search:t.search}),delete s.matchCache[t.matchId]})),s.startedLoadingAt===e&&(a.forEach((t=>{t.action&&(t.action.current=void 0,t.action.submissions=[])})),s.state=D({},s.state,{location:s.location,matches:a,pending:void 0,status:"idle"}),s.notify(),s.resolveNavigation())},cleanMatchCache:()=>{const t=Date.now();Object.keys(s.matchCache).forEach((e=>{const a=s.matchCache[e];"loading"!==a.match.status&&(a.gc>0&&a.gc>t||delete s.matchCache[e])}))},loadRoute:async function(t){void 0===t&&(t=s.location);const e=s.buildNext(t),a=s.matchRoutes(e.pathname,{strictParseParams:!0});return await s.loadMatches(a),a},preloadRoute:async function(t,e){var a,n,o,r,i,l;void 0===t&&(t=s.location);const c=s.buildNext(t),u=s.matchRoutes(c.pathname,{strictParseParams:!0});return await s.loadMatches(u,{preload:!0,maxAge:null!=(a=null!=(n=null!=(o=e.maxAge)?o:s.options.defaultPreloadMaxAge)?n:s.options.defaultLoaderMaxAge)?a:0,gcMaxAge:null!=(r=null!=(i=null!=(l=e.gcMaxAge)?l:s.options.defaultPreloadGcMaxAge)?i:s.options.defaultLoaderGcMaxAge)?r:0}),u},matchRoutes:(t,e)=>{var a,n;s.cleanMatchCache();const o=[];if(!s.routeTree)return o;const r=[...s.state.matches,...null!=(a=null==(n=s.state.pending)?void 0:n.matches)?a:[]],i=async a=>{var n,l,c;const u=g(o);let h=null!=(n=null==u?void 0:u.params)?n:{};const d=null!=(l=null==s.options.filterRoutes?void 0:s.options.filterRoutes(a))?l:a;let p=[];const f=(a,n)=>(n.some((n=>{var o,r,i;if(!n.routePath&&null!=(o=n.childRoutes)&&o.length)return f([...p,n],n.childRoutes);const l=!!("/"!==n.routePath||null!=(r=n.childRoutes)&&r.length),c=L(t,{to:n.fullPath,fuzzy:l,caseSensitive:null!=(i=n.options.caseSensitive)?i:s.options.caseSensitive});if(c){let t;try{var u;t=null!=(u=null==n.options.parseParams?void 0:n.options.parseParams(c))?u:c}catch(t){if(null!=e&&e.strictParseParams)throw t}h=D({},h,t)}return c&&(p=[...a,n]),!!p.length})),!!p.length);if(f([],d),!p.length)return;p.forEach((e=>{var a;const n=I(e.routePath,h),i=I(e.routeId,h,!0),l=r.find((t=>t.matchId===i))||(null==(a=s.matchCache[i])?void 0:a.match)||T(s,e,{parentMatch:u,matchId:i,params:h,pathname:b([t,n])});o.push(l)}));const m=g(p);null!=(c=m.childRoutes)&&c.length&&i(m.childRoutes)};return i([s.routeTree]),V(o),o},loadMatches:async(t,e)=>{const a=t.map((async t=>{t.__.validate(),t.load(e);const a=t.search;a.__data&&a.__data.matchId!==t.matchId||t.__.loadPromise&&await t.__.loadPromise}));s.notify(),await Promise.all(a)},loadMatchData:async t=>{var e;if(z||!s.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=s.buildNext({to:".",search:e=>D({},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,a;const n=s.buildNext(t),o=s.matchRoutes(n.pathname).map((t=>t.matchId));[...s.state.matches,...null!=(e=null==(a=s.state.pending)?void 0:a.matches)?e:[]].forEach((t=>{o.includes(t.matchId)&&t.invalidate()}))},reload:()=>s.__.navigate({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(t,e)=>R(s.basepath,t,P(e)),matchRoute:(t,e)=>{var a;t=D({},t,{to:t.to?s.resolvePath(null!=(a=t.from)?a:"",t.to):void 0});const n=s.buildNext(t);var o;return null!=e&&e.pending?!(null==(o=s.state.pending)||!o.location)&&!!L(s.state.pending.location.pathname,D({},e,{to:n.pathname})):!!L(s.state.location.pathname,D({},e,{to:n.pathname}))},navigate:async t=>{let{from:e,to:a=".",search:n,hash:o,replace:r,params:i}=t;const l=String(a),c=String(e);let u;try{new URL(""+l),u=!0}catch(t){}return p(!u),s.__.navigate({from:c,to:l,search:n,hash:o,replace:r,params:i})},buildLink:t=>{var e,a;let{from:n,to:o=".",search:r,params:i,hash:l,target:c,replace:u,activeOptions:h,preload:d,preloadMaxAge:p,preloadGcMaxAge:f,preloadDelay:m,disabled:v}=t;try{return new URL(""+o),{type:"external",href:o}}catch(t){}const g={from:n,to:o,search:r,params:i,hash:l,replace:u},y=s.buildNext(g);d=null!=(e=d)?e:s.options.defaultPreload;const _=null!=(a=null!=m?m:s.options.defaultPreloadDelay)?a:0,b=s.state.location.pathname===y.pathname,P=s.state.location.pathname.split("/"),w=y.pathname.split("/").every(((t,e)=>t===P[e])),x=s.state.location.hash===y.hash,A=null!=h&&h.exact?b:w,R=null==h||!h.includeHash||x;return{type:"internal",next:y,handleFocus:t=>{d&&s.preloadRoute(g,{maxAge:p,gcMaxAge:f})},handleClick:t=>{v||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||c&&"_self"!==c||0!==t.button||(t.preventDefault(),!b||r||l||s.invalidateRoute(g),s.__.navigate(g))},handleEnter:t=>{const e=t.target||{};if(d){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,s.preloadRoute(g,{maxAge:p,gcMaxAge:f})}),_)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},isActive:A&&R,disabled:v}},buildNext:t=>{const e=s.__.buildLocation(t),a=s.matchRoutes(e.pathname),n=a.map((t=>{var e;return null!=(e=t.options.preSearchFilters)?e:[]})).flat().filter(Boolean),o=a.map((t=>{var e;return null!=(e=t.options.postSearchFilters)?e:[]})).flat().filter(Boolean);return s.__.buildLocation(D({},t,{__preSearchFilters:n,__postSearchFilters:o}))},__:{buildRouteTree:t=>{const e=(t,a)=>t.map((t=>{const n=O(t,t.options,a,s);if(s.routesById[n.routeId])throw new Error;s.routesById[n.routeId]=n;const o=t.children;return n.childRoutes=null!=o&&o.length?e(o,n):void 0,n}));return e([t])[0]},parseLocation:(t,e)=>{var a;const n=s.options.parseSearch(t.search);return{pathname:t.pathname,searchStr:t.search,search:f(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=s.buildNext(t);return s.__.commitLocation(e,t.replace)},buildLocation:function(t){var e,a,n,o,r,i,l,c,u;void 0===t&&(t={});const h=t.fromCurrent?s.location.pathname:null!=(e=t.from)?e:s.location.pathname;let d=R(null!=(a=s.basepath)?a:"/",h,""+(null!=(n=t.to)?n:"."));const p=s.matchRoutes(s.location.pathname,{strictParseParams:!0}),m=s.matchRoutes(d),v=D({},null==(o=g(p))?void 0:o.params);let _=!0===(null==(r=t.params)||r)?v:y(t.params,v);_&&m.map((t=>t.options.stringifyParams)).filter(Boolean).forEach((t=>{Object.assign({},_,t(_))})),d=I(d,null!=_?_:{});const b=null!=(i=t.__preSearchFilters)&&i.length?t.__preSearchFilters.reduce(((t,e)=>e(t)),s.location.search):s.location.search,P=!0===t.search?b:t.search?null!=(l=y(t.search,b))?l:{}:null!=(c=t.__preSearchFilters)&&c.length?b:{},w=null!=(u=t.__postSearchFilters)&&u.length?t.__postSearchFilters.reduce(((t,e)=>e(t)),P):P,x=f(s.location.search,w),A=s.options.stringifySearch(x);let S=!0===t.hash?s.location.hash:y(t.hash,s.location.hash);return S=S?"#"+S:"",{pathname:d,search:x,searchStr:A,state:s.location.state,hash:S,href:""+d+A+S,key:t.key}},commitLocation:(t,e)=>{const a=""+Date.now()+Math.random();s.navigateTimeout&&clearTimeout(s.navigateTimeout);let o="replace";e||(o="push");return s.__.parseLocation(n.location).href===t.href&&!t.key&&(o="replace"),"replace"===o?n.replace({pathname:t.pathname,hash:t.hash,search:t.searchStr},D({id:a},t.state)):n.push({pathname:t.pathname,hash:t.hash,search:t.searchStr},{id:a}),s.navigationPromise=new Promise((t=>{const e=s.resolveNavigation;s.resolveNavigation=()=>{e(),t()}})),s.navigationPromise}}};return s.update(t),null==s.options.createRouter||s.options.createRouter(s),s},t.decode=k,t.defaultParseSearch=N,t.defaultStringifySearch=B,t.encode=E,t.functionalUpdate=y,t.interpolatePath=I,t.invariant=p,t.joinPaths=b,t.last=g,t.matchByPath=M,t.matchPathname=L,t.parsePathname=S,t.parseSearchWith=U,t.pick=_,t.replaceEqualDeep=f,t.resolvePath=R,t.rootRouteId=F,t.stringifySearchWith=H,t.trimPath=A,t.trimPathLeft=w,t.trimPathRight=x,t.warning=function(t,e){if(t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}return!0},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map
{
"name": "@tanstack/router-core",
"author": "Tanner Linsley",
"version": "0.0.1-beta.16",
"version": "0.0.1-beta.19",
"license": "MIT",

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

@@ -73,3 +73,3 @@ import { GetFrameworkGeneric } from './frameworks'

signal?: AbortSignal
parentLoaderPromise?: Promise<TParentRouteLoaderData>
// parentLoaderPromise?: Promise<TParentRouteLoaderData>
}

@@ -142,5 +142,2 @@

action?: ActionFn<TActionPayload, TActionResponse>
// Set this to true to rethrow errors up the component tree to either the nearest error boundary or
// route with error component, whichever comes first.
useErrorBoundary?: boolean
// This function is called

@@ -147,0 +144,0 @@ // when moving from an inactive state to an active one. Likewise, when moving from

@@ -119,6 +119,6 @@ import { ParsePathParams } from './link'

> = RouteInfo,
TRouteInfoById = {
TRouteInfoById = { '/': TRouteInfo } & {
[TInfo in TRouteInfo as TInfo['id']]: TInfo
},
TRouteInfoByFullPath = {
TRouteInfoByFullPath = { '/': TRouteInfo } & {
[TInfo in TRouteInfo as TInfo['fullPath'] extends RootRouteId

@@ -125,0 +125,0 @@ ? never

@@ -9,4 +9,4 @@ import { GetFrameworkGeneric } from './frameworks'

} from './routeInfo'
import { ActionState, Router } from './router'
import { replaceEqualDeep, Timeout } from './utils'
import { Router } from './router'
import { replaceEqualDeep, warning } from './utils'

@@ -205,4 +205,10 @@ export interface RouteMatch<

fetch: async (opts) => {
const id = '' + Date.now() + Math.random()
routeMatch.__.latestId = id
const loadId = '' + Date.now() + Math.random()
routeMatch.__.latestId = loadId
const checkLatest = async () => {
if (loadId !== routeMatch.__.latestId) {
// warning(true, 'Data loader is out of date!')
return new Promise(() => {})
}
}

@@ -245,11 +251,4 @@ // If the match was in an error state, set it

if (routeMatch.options.loader) {
const data = await routeMatch.options.loader({
parentLoaderPromise: routeMatch.parentMatch?.__.dataPromise,
params: routeMatch.params,
search: routeMatch.routeSearch,
signal: routeMatch.__.abortController.signal,
})
if (id !== routeMatch.__.latestId) {
return routeMatch.__.loadPromise
}
const data = await router.loadMatchData(routeMatch)
await checkLatest()

@@ -274,5 +273,3 @@ routeMatch.routeLoaderData = replaceEqualDeep(

} catch (err) {
if (id !== routeMatch.__.latestId) {
return routeMatch.__.loadPromise
}
await checkLatest()

@@ -291,2 +288,9 @@ if (process.env.NODE_ENV !== 'production') {

const after = async () => {
await checkLatest()
routeMatch.isFetching = false
delete routeMatch.__.loadPromise
routeMatch.__.notify()
}
try {

@@ -297,11 +301,5 @@ await Promise.all([

])
if (id !== routeMatch.__.latestId) {
return routeMatch.__.loadPromise
}
} finally {
if (id !== routeMatch.__.latestId) {
return routeMatch.__.loadPromise
}
routeMatch.isFetching = false
routeMatch.__.notify()
after()
} catch {
after()
}

@@ -311,8 +309,3 @@ })

await routeMatch.__.loadPromise
if (id !== routeMatch.__.latestId) {
return routeMatch.__.loadPromise
}
delete routeMatch.__.loadPromise
await checkLatest()
},

@@ -319,0 +312,0 @@ }

@@ -9,3 +9,2 @@ import {

} from 'history'
import React from 'react'
import invariant from 'tiny-invariant'

@@ -95,3 +94,2 @@ import { GetFrameworkGeneric } from './frameworks'

defaultPreloadDelay?: number
useErrorBoundary?: boolean
defaultComponent?: GetFrameworkGeneric<'Component'>

@@ -105,2 +103,3 @@ defaultErrorComponent?: GetFrameworkGeneric<'Component'>

basepath?: string
useServerData?: boolean
createRouter?: (router: Router<any, any>) => void

@@ -172,7 +171,7 @@ createRoute?: (opts: { route: AnyRoute; router: Router<any, any> }) => void

export interface LoaderState<
TFullSearchSchema = unknown,
TAllParams = unknown,
TFullSearchSchema extends AnySearchSchema = {},
TAllParams extends AnyPathParams = {},
> {
loadedAt: number
loaderContext: LoaderContext<TFullSearchSchema, TAllParams>
loaderContext: LoaderContext<AnyLoaderData, TFullSearchSchema, TAllParams>
}

@@ -256,2 +255,9 @@

> {
types: {
// Super secret internal stuff
RouteConfig: TRouteConfig
AllRouteInfo: TAllRouteInfo
}
// Public API
history: BrowserHistory | MemoryHistory | HashHistory

@@ -265,3 +271,2 @@ options: PickAsRequired<

// Internal:
allRouteInfo: TAllRouteInfo
listeners: Listener[]

@@ -309,2 +314,5 @@ location: Location

) => Promise<void>
loadMatchData: (
routeMatch: RouteMatch<any, any>,
) => Promise<Record<string, unknown>>
invalidateRoute: (opts: MatchLocation) => void

@@ -390,2 +398,5 @@ reload: () => Promise<void>

let router: Router<TRouteConfig, TAllRouteInfo> = {
types: undefined!,
// public api
history,

@@ -399,3 +410,2 @@ options: originalOptions,

location: undefined!,
allRouteInfo: undefined!,
//

@@ -853,2 +863,8 @@ navigationPromise: Promise.resolve(),

const search = match.search as { __data?: any }
if (search.__data && search.__data.matchId !== match.matchId) {
return
}
if (match.__.loadPromise) {

@@ -865,2 +881,36 @@ // Wait for the first sign of activity from the match

loadMatchData: async (routeMatch) => {
if (isServer || !router.options.useServerData) {
return (
(await routeMatch.options.loader?.({
// parentLoaderPromise: routeMatch.parentMatch?.__.dataPromise,
params: routeMatch.params,
search: routeMatch.routeSearch,
signal: routeMatch.__.abortController.signal,
})) ?? {}
)
} else {
const next = router.buildNext({
to: '.',
search: (d: any) => ({
...(d ?? {}),
__data: {
matchId: routeMatch.matchId,
},
}),
})
const res = await fetch(next.href, {
method: 'GET',
// signal: routeMatch.__.abortController.signal,
})
if (res.ok) {
return res.json()
}
throw new Error('Failed to fetch match data')
}
},
invalidateRoute: (opts: MatchLocation) => {

@@ -867,0 +917,0 @@ const next = router.buildNext(opts)

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 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