@tanstack/react-router 0.0.1-beta.83 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/build/cjs/CatchBoundary.js +128 -0
- package/build/cjs/CatchBoundary.js.map +1 -0
- package/build/cjs/Matches.js +233 -0
- package/build/cjs/Matches.js.map +1 -0
- package/build/cjs/RouterProvider.js +170 -0
- package/build/cjs/RouterProvider.js.map +1 -0
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +2 -4
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/build/cjs/_virtual/with-selector.development.js +16 -0
- package/build/cjs/_virtual/with-selector.development.js.map +1 -0
- package/build/cjs/_virtual/with-selector.js +16 -0
- package/build/cjs/_virtual/with-selector.js.map +1 -0
- package/build/cjs/_virtual/with-selector.production.min.js +16 -0
- package/build/cjs/_virtual/with-selector.production.min.js.map +1 -0
- package/build/cjs/awaited.js +43 -0
- package/build/cjs/awaited.js.map +1 -0
- package/build/cjs/build/esm/index.js +79 -0
- package/build/cjs/build/esm/index.js.map +1 -0
- package/build/cjs/defer.js +37 -0
- package/build/cjs/defer.js.map +1 -0
- package/build/cjs/fileRoute.js +27 -0
- package/build/cjs/fileRoute.js.map +1 -0
- package/build/cjs/index.js +113 -451
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/lazyRouteComponent.js +54 -0
- package/build/cjs/lazyRouteComponent.js.map +1 -0
- package/build/cjs/link.js +223 -0
- package/build/cjs/link.js.map +1 -0
- package/build/cjs/node_modules/.pnpm/@tanstack_react-store@0.2.1_react-dom@18.2.0_react@18.2.0/node_modules/@tanstack/react-store/build/modern/index.js +47 -0
- package/build/cjs/node_modules/.pnpm/@tanstack_react-store@0.2.1_react-dom@18.2.0_react@18.2.0/node_modules/@tanstack/react-store/build/modern/index.js.map +1 -0
- package/build/cjs/node_modules/.pnpm/@tanstack_store@0.1.3/node_modules/@tanstack/store/build/modern/index.js +70 -0
- package/build/cjs/node_modules/.pnpm/@tanstack_store@0.1.3/node_modules/@tanstack/store/build/modern/index.js.map +1 -0
- package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +188 -0
- package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -0
- package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +39 -0
- package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js.map +1 -0
- package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/shim/with-selector.js +26 -0
- package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/shim/with-selector.js.map +1 -0
- package/build/cjs/packages/react-router/src/CatchBoundary.js +123 -0
- package/build/cjs/packages/react-router/src/CatchBoundary.js.map +1 -0
- package/build/cjs/packages/react-router/src/Matches.js +235 -0
- package/build/cjs/packages/react-router/src/Matches.js.map +1 -0
- package/build/cjs/packages/react-router/src/RouterProvider.js +144 -0
- package/build/cjs/packages/react-router/src/RouterProvider.js.map +1 -0
- package/build/cjs/packages/react-router/src/awaited.js +43 -0
- package/build/cjs/packages/react-router/src/awaited.js.map +1 -0
- package/build/cjs/packages/react-router/src/defer.js +37 -0
- package/build/cjs/packages/react-router/src/defer.js.map +1 -0
- package/build/cjs/packages/react-router/src/fileRoute.js +27 -0
- package/build/cjs/packages/react-router/src/fileRoute.js.map +1 -0
- package/build/cjs/packages/react-router/src/index.js +61 -0
- package/build/cjs/packages/react-router/src/index.js.map +1 -0
- package/build/cjs/packages/react-router/src/lazyRouteComponent.js +54 -0
- package/build/cjs/packages/react-router/src/lazyRouteComponent.js.map +1 -0
- package/build/cjs/packages/react-router/src/link.js +148 -0
- package/build/cjs/packages/react-router/src/link.js.map +1 -0
- package/build/cjs/packages/react-router/src/path.js +209 -0
- package/build/cjs/packages/react-router/src/path.js.map +1 -0
- package/build/cjs/packages/react-router/src/qss.js +63 -0
- package/build/cjs/packages/react-router/src/qss.js.map +1 -0
- package/build/cjs/packages/react-router/src/react.js +634 -0
- package/build/cjs/packages/react-router/src/react.js.map +1 -0
- package/build/cjs/packages/react-router/src/redirects.js +25 -0
- package/build/cjs/packages/react-router/src/redirects.js.map +1 -0
- package/build/cjs/packages/react-router/src/route.js +134 -0
- package/build/cjs/packages/react-router/src/route.js.map +1 -0
- package/build/cjs/packages/react-router/src/router.js +1111 -0
- package/build/cjs/packages/react-router/src/router.js.map +1 -0
- package/build/cjs/packages/react-router/src/scroll-restoration.js +53 -0
- package/build/cjs/packages/react-router/src/scroll-restoration.js.map +1 -0
- package/build/cjs/packages/react-router/src/searchParams.js +81 -0
- package/build/cjs/packages/react-router/src/searchParams.js.map +1 -0
- package/build/cjs/packages/react-router/src/useBlocker.js +61 -0
- package/build/cjs/packages/react-router/src/useBlocker.js.map +1 -0
- package/build/cjs/packages/react-router/src/useNavigate.js +75 -0
- package/build/cjs/packages/react-router/src/useNavigate.js.map +1 -0
- package/build/cjs/packages/react-router/src/useParams.js +26 -0
- package/build/cjs/packages/react-router/src/useParams.js.map +1 -0
- package/build/cjs/packages/react-router/src/useSearch.js +25 -0
- package/build/cjs/packages/react-router/src/useSearch.js.map +1 -0
- package/build/cjs/packages/react-router/src/utils.js +239 -0
- package/build/cjs/packages/react-router/src/utils.js.map +1 -0
- package/build/cjs/path.js +214 -0
- package/build/cjs/path.js.map +1 -0
- package/build/cjs/qss.js +63 -0
- package/build/cjs/qss.js.map +1 -0
- package/build/cjs/react/CatchBoundary.js +123 -0
- package/build/cjs/react/CatchBoundary.js.map +1 -0
- package/build/cjs/react/awaited.js +43 -0
- package/build/cjs/react/awaited.js.map +1 -0
- package/build/cjs/react/defer.js +37 -0
- package/build/cjs/react/defer.js.map +1 -0
- package/build/cjs/react.js +650 -0
- package/build/cjs/react.js.map +1 -0
- package/build/cjs/redirects.js +28 -0
- package/build/cjs/redirects.js.map +1 -0
- package/build/cjs/route.js +191 -0
- package/build/cjs/route.js.map +1 -0
- package/build/cjs/router.js +1085 -0
- package/build/cjs/router.js.map +1 -0
- package/build/cjs/routerConfig.js +209 -0
- package/build/cjs/routerConfig.js.map +1 -0
- package/build/cjs/scroll-restoration.js +202 -0
- package/build/cjs/scroll-restoration.js.map +1 -0
- package/build/cjs/searchParams.js +81 -0
- package/build/cjs/searchParams.js.map +1 -0
- package/build/cjs/src/CatchBoundary.js +126 -0
- package/build/cjs/src/CatchBoundary.js.map +1 -0
- package/build/cjs/src/Matches.js +235 -0
- package/build/cjs/src/Matches.js.map +1 -0
- package/build/cjs/src/RouterProvider.js +1051 -0
- package/build/cjs/src/RouterProvider.js.map +1 -0
- package/build/cjs/src/awaited.js +45 -0
- package/build/cjs/src/awaited.js.map +1 -0
- package/build/cjs/src/defer.js +39 -0
- package/build/cjs/src/defer.js.map +1 -0
- package/build/cjs/src/fileRoute.js +29 -0
- package/build/cjs/src/fileRoute.js.map +1 -0
- package/build/cjs/src/index.js +134 -0
- package/build/cjs/src/index.js.map +1 -0
- package/build/cjs/src/lazyRouteComponent.js +57 -0
- package/build/cjs/src/lazyRouteComponent.js.map +1 -0
- package/build/cjs/src/link.js +151 -0
- package/build/cjs/src/link.js.map +1 -0
- package/build/cjs/src/path.js +211 -0
- package/build/cjs/src/path.js.map +1 -0
- package/build/cjs/src/qss.js +65 -0
- package/build/cjs/src/qss.js.map +1 -0
- package/build/cjs/src/redirects.js +27 -0
- package/build/cjs/src/redirects.js.map +1 -0
- package/build/cjs/src/route.js +139 -0
- package/build/cjs/src/route.js.map +1 -0
- package/build/cjs/src/router.js +203 -0
- package/build/cjs/src/router.js.map +1 -0
- package/build/cjs/src/scroll-restoration.js +186 -0
- package/build/cjs/src/scroll-restoration.js.map +1 -0
- package/build/cjs/src/searchParams.js +83 -0
- package/build/cjs/src/searchParams.js.map +1 -0
- package/build/cjs/src/useBlocker.js +64 -0
- package/build/cjs/src/useBlocker.js.map +1 -0
- package/build/cjs/src/useNavigate.js +78 -0
- package/build/cjs/src/useNavigate.js.map +1 -0
- package/build/cjs/src/useParams.js +28 -0
- package/build/cjs/src/useParams.js.map +1 -0
- package/build/cjs/src/useSearch.js +27 -0
- package/build/cjs/src/useSearch.js.map +1 -0
- package/build/cjs/src/utils.js +230 -0
- package/build/cjs/src/utils.js.map +1 -0
- package/build/cjs/useBlocker.js +55 -0
- package/build/cjs/useBlocker.js.map +1 -0
- package/build/cjs/useNavigate.js +86 -0
- package/build/cjs/useNavigate.js.map +1 -0
- package/build/cjs/useParams.js +26 -0
- package/build/cjs/useParams.js.map +1 -0
- package/build/cjs/useSearch.js +25 -0
- package/build/cjs/useSearch.js.map +1 -0
- package/build/cjs/useStore.js +99 -0
- package/build/cjs/useStore.js.map +1 -0
- package/build/cjs/utils.js +241 -0
- package/build/cjs/utils.js.map +1 -0
- package/build/esm/index.js +2581 -337
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +3494 -2700
- package/build/stats-react.json +1134 -87
- package/build/types/CatchBoundary.d.ts +36 -0
- package/build/types/Matches.d.ts +64 -0
- package/build/types/RouteMatch.d.ts +23 -0
- package/build/types/RouterProvider.d.ts +35 -0
- package/build/types/awaited.d.ts +9 -0
- package/build/types/defer.d.ts +19 -0
- package/build/types/fileRoute.d.ts +38 -0
- package/build/types/history.d.ts +7 -0
- package/build/types/index.d.ts +911 -88
- package/build/types/injectHtml.d.ts +0 -0
- package/build/types/lazyRouteComponent.d.ts +2 -0
- package/build/types/link.d.ts +93 -0
- package/build/types/location.d.ts +12 -0
- package/build/types/path.d.ts +17 -0
- package/build/types/qss.d.ts +2 -0
- package/build/types/react/CatchBoundary.d.ts +33 -0
- package/build/types/react/awaited.d.ts +9 -0
- package/build/types/react/defer.d.ts +19 -0
- package/build/types/react.d.ts +141 -0
- package/build/types/redirects.d.ts +11 -0
- package/build/types/route.d.ts +283 -0
- package/build/types/routeInfo.d.ts +31 -0
- package/build/types/router.d.ts +186 -0
- package/build/types/scroll-restoration.d.ts +18 -0
- package/build/types/searchParams.d.ts +7 -0
- package/build/types/useBlocker.d.ts +9 -0
- package/build/types/useNavigate.d.ts +19 -0
- package/build/types/useParams.d.ts +7 -0
- package/build/types/useSearch.d.ts +7 -0
- package/build/types/useStore.d.ts +12 -0
- package/build/types/utils.d.ts +69 -0
- package/build/umd/index.development.js +2829 -1796
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +4 -24
- package/build/umd/index.production.js.map +1 -1
- package/package.json +9 -7
- package/src/CatchBoundary.tsx +101 -0
- package/src/Matches.tsx +423 -0
- package/src/RouterProvider.tsx +252 -0
- package/src/awaited.tsx +40 -0
- package/src/defer.ts +55 -0
- package/src/fileRoute.ts +152 -0
- package/src/history.ts +8 -0
- package/src/index.tsx +28 -747
- package/src/lazyRouteComponent.tsx +33 -0
- package/src/link.tsx +603 -0
- package/src/location.ts +13 -0
- package/src/path.ts +261 -0
- package/src/qss.ts +53 -0
- package/src/redirects.ts +39 -0
- package/src/route.ts +882 -0
- package/src/routeInfo.ts +84 -0
- package/src/router.ts +1671 -0
- package/src/scroll-restoration.tsx +230 -0
- package/src/searchParams.ts +79 -0
- package/src/useBlocker.tsx +27 -0
- package/src/useNavigate.tsx +111 -0
- package/src/useParams.tsx +25 -0
- package/src/useSearch.tsx +25 -0
- package/src/utils.ts +360 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router
|
|
2
|
+
* @tanstack/react-router/src/index.tsx
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) TanStack
|
|
5
5
|
*
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("use-sync-external-store/shim
|
|
11
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("use-sync-external-store/shim")):"function"==typeof define&&define.amd?define(["exports","react","use-sync-external-store/shim"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ReactRouter={},t.React,t.require$$1)}(this,(function(t,e,o){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,n.get?n:{enumerable:!0,get:function(){return t[o]}})}})),e.default=t,Object.freeze(e)}var r=n(e);
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* @tanstack/history/src/index.ts
|
|
14
14
|
*
|
|
15
15
|
* Copyright (c) TanStack
|
|
16
16
|
*
|
|
@@ -18,25 +18,5 @@
|
|
|
18
18
|
* LICENSE.md file in the root directory of this source tree.
|
|
19
19
|
*
|
|
20
20
|
* @license MIT
|
|
21
|
-
*/class c{listeners=new Set;batching=!1;queue=[];constructor(t,e){this.state=t,this.options=e}subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}};setState=t=>{const e=this.state;this.state=this.options?.updateFn?this.options.updateFn(e)(t):t(e),this.state!==e&&(this.options?.onUpdate?.(this.state,e),this.queue.push((()=>{this.listeners.forEach((t=>t(this.state,e)))})),this.#t())};#t=()=>{this.batching||(this.queue.forEach((t=>t())),this.queue=[])};batch=t=>{this.batching=!0,t(),this.batching=!1,this.#t()}}function h(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let o=0;o<r.length;o++)if(!Object.prototype.hasOwnProperty.call(e,r[o])||!Object.is(t[r[o]],e[r[o]]))return!1;return!0}
|
|
22
|
-
/**
|
|
23
|
-
* router
|
|
24
|
-
*
|
|
25
|
-
* Copyright (c) TanStack
|
|
26
|
-
*
|
|
27
|
-
* This source code is licensed under the MIT license found in the
|
|
28
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
29
|
-
*
|
|
30
|
-
* @license MIT
|
|
31
|
-
*/const u="popstate",l="beforeunload",d=t=>(t.preventDefault(),t.returnValue=""),p=()=>{removeEventListener(l,d,{capture:!0})};function f(t){let e=t.getLocation(),r=()=>{},o=new Set,a=[],s=[];const n=()=>{if(a.length)a[0]?.(n,(()=>{a=[],p()}));else{for(;s.length;)s.shift()?.();c()}},i=t=>{s.push(t),n()},c=()=>{e=t.getLocation(),o.forEach((t=>t()))};return{get location(){return e},listen:e=>(0===o.size&&(r=t.listener(c)),o.add(e),()=>{o.delete(e),0===o.size&&r()}),push:(e,r)=>{i((()=>{t.pushState(e,r)}))},replace:(e,r)=>{i((()=>{t.replaceState(e,r)}))},go:e=>{i((()=>{t.go(e)}))},back:()=>{i((()=>{t.back()}))},forward:()=>{i((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(a.push(t),1===a.length&&addEventListener(l,d,{capture:!0}),()=>{a=a.filter((e=>e!==t)),a.length||p()})}}function m(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.hash}${window.location.search}`),r=t?.createHref??(t=>t);return f({getLocation:()=>g(e(),history.state),listener:t=>(window.addEventListener(u,t),()=>{window.removeEventListener(u,t)}),pushState:(t,e)=>{window.history.pushState({...e,key:v()},"",r(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:v()},"",r(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t)})}function y(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1,o={};return f({getLocation:()=>g(e[r],o),listener:()=>()=>{},pushState:(t,a)=>{o={...a,key:v()},e.push(t),r++},replaceState:(t,a)=>{o={...a,key:v()},e[r]=t},back:()=>{r--},forward:()=>{r=Math.min(r+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function g(t,e){let r=t.indexOf("#"),o=t.indexOf("?");return{href:t,pathname:t.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:t.length),hash:r>-1?t.substring(r,o):"",search:o>-1?t.substring(o):"",state:e}}function v(){return(Math.random()+1).toString(36).substring(7)}function w(t){return t[t.length-1]}function b(t,e){return"function"==typeof t?t(e):t}function S(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function _(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||L(t)&&L(r)){const e=o?t.length:Object.keys(t).length,a=o?r:Object.keys(r),s=a.length,n=o?[]:{};let i=0;for(let e=0;e<s;e++){const s=o?e:a[e];n[s]=_(t[s],r[s]),n[s]===t[s]&&i++}return e===s&&i===e?t:n}return r}function L(t){if(!E(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!E(r)&&!!r.hasOwnProperty("isPrototypeOf")}function E(t){return"[object Object]"===Object.prototype.toString.call(t)}function P(t,e){return t===e||typeof t==typeof e&&(L(t)&&L(e)?!Object.keys(e).some((r=>!P(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>P(t,e[r])))))}function x(t){return R(t.filter(Boolean).join("/"))}function R(t){return t.replace(/\/{2,}/g,"/")}function C(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function M(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function k(t){return M(C(t))}function O(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=j(e);const a=j(r);a.forEach(((t,e)=>{if("/"===t.value)e?e===a.length-1&&o.push(t):o=[t];else if(".."===t.value)o.length>1&&"/"===w(o)?.value&&o.pop(),o.pop();else{if("."===t.value)return;o.push(t)}}));return R(x([t,...o.map((t=>t.value))]))}function j(t){if(!t)return[];const e=[];if("/"===(t=R(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const r=t.split("/").filter(Boolean);return e.push(...r.map((t=>"$"===t||"*"===t?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function A(t,e,r){return x(j(t).map((t=>["$","*"].includes(t.value)&&!r?"":"param"===t.type?e[t.value.substring(1)]??"":t.value)))}function I(t,e,r){const o=$(t,e,r);if(!r.to||o)return o??{}}function $(t,e,r){if(!e.startsWith(t))return;const o=j(e="/"!=t?e.substring(t.length):e),a=j(`${r.to??"$"}`);"/"===w(o)?.value&&o.pop();const s={};return(()=>{for(let t=0;t<Math.max(o.length,a.length);t++){const e=o[t],n=a[t],i=t===a.length-1,c=t===o.length-1;if(n){if("wildcard"===n.type)return!!e?.value&&(s["*"]=x(o.slice(t).map((t=>t.value))),!0);if("pathname"===n.type){if("/"===n.value&&!e?.value)return!0;if(e)if(r.caseSensitive){if(n.value!==e.value)return!1}else if(n.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===n.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(s[n.value.substring(1)]=e.value)}}if(i&&!c)return!!r.fuzzy}return!0})()?s:void 0}function T(t,e){var r,o,a,s="";for(r in t)if(void 0!==(a=t[r]))if(Array.isArray(a))for(o=0;o<a.length;o++)s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(a[o]);else s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(a);return(e||"")+s}function D(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function N(t){for(var e,r,o={},a=t.split("&");e=a.shift();)void 0!==o[r=(e=e.split("=")).shift()]?o[r]=[].concat(o[r],D(e.shift())):o[r]=D(e.shift());return o}const H="__root__";class B{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute}init=t=>{this.originalIndex=t.originalIndex,this.router=t.router;const e=this.options,r=!e?.path&&!e?.id;this.parentRoute=this.options?.getParentRoute?.(),r?this.path=H:n(this.parentRoute);let o=r?H:e.path;o&&"/"!==o&&(o=k(o));const a=e?.id||o;let s=r?H:x([this.parentRoute.id===H?"":this.parentRoute.id,a]);o===H&&(o="/"),s!==H&&(s=x(["/",s]));const i=s===H?"/":M(x([this.parentRoute.fullPath,o]));this.path=o,this.id=s,this.fullPath=i};addChildren=t=>(this.children=t,this)}class F extends B{constructor(t){super(t)}static withRouterContext=()=>t=>new F(t)}const U=q(JSON.parse),z=W(JSON.stringify);function q(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=N(e);for(let e in r){const o=r[e];if("string"==typeof o)try{r[e]=t(o)}catch(t){}}return r}}function W(t){return e=>{(e={...e})&&Object.keys(e).forEach((r=>{const o=e[r];if(void 0===o||void 0===o)delete e[r];else if(o&&"object"==typeof o&&null!==o)try{e[r]=t(o)}catch(t){}}));const r=T(e).toString();return r?`?${r}`:""}}const K=async({router:t,routeMatch:e})=>{const r=t.buildNext({to:".",search:t=>({...t??{},__data:{matchId:e.id}})}),o=await fetch(r.href,{method:"GET",signal:e.abortController.signal});if(o.ok)return o.json();throw new Error("Failed to fetch match data")};class V{#e;startedLoadingAt=Date.now();resolveNavigation=()=>{};constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??z,parseSearch:t?.parseSearch??U,fetchServerDataFn:t?.fetchServerDataFn??K},this.__store=new c(G(),{onUpdate:t=>{this.state=t}}),this.state=this.__store.state,this.basepath="",this.update(t),this.options.Router?.(this);const e=this.buildNext({hash:!0,fromCurrent:!0,search:!0,state:!0});this.state.latestLocation.href!==e.href&&this.#r({...e,replace:!0})}reset=()=>{this.__store.setState((t=>Object.assign(t,G())))};mount=()=>(J||this.state.currentMatches.length||this.safeLoad(),()=>{});update=t=>{if(Object.assign(this.options,t),!this.history||this.options.history&&this.options.history!==this.history){this.#e&&this.#e(),this.history=this.options.history??(J?y():m());const t=this.#o();this.__store.setState((e=>({...e,latestLocation:t,currentLocation:t}))),this.#e=this.history.listen((()=>{this.safeLoad({next:this.#o(this.state.latestLocation)})}))}const{basepath:e,routeTree:r}=this.options;return this.basepath=`/${k(e??"")??""}`,r&&(this.routesById={},this.routeTree=this.#a(r)),this};buildNext=t=>{const e=this.#s(t),r=this.matchRoutes(e.pathname);return this.#s({...t,__matches:r})};cancelMatches=()=>{[...this.state.currentMatches,...this.state.pendingMatches||[]].forEach((t=>{t.cancel()}))};safeLoad=t=>{this.load(t).catch((t=>{console.warn(t),n(!1)}))};load=async t=>{let e=Date.now();const r=e;let o;if(this.startedLoadingAt=r,this.cancelMatches(),this.__store.batch((()=>{t?.next&&this.__store.setState((e=>({...e,latestLocation:t.next}))),o=this.matchRoutes(this.state.latestLocation.pathname,{strictParseParams:!0}),this.__store.setState((t=>({...t,status:"pending",pendingMatches:o,pendingLocation:this.state.latestLocation})))})),await this.loadMatches(o,this.state.pendingLocation),this.startedLoadingAt!==r)return this.navigationPromise;const a=this.state.currentMatches,s=[],n=[];a.forEach((t=>{o.find((e=>e.id===t.id))?n.push(t):s.push(t)}));const i=o.filter((t=>!a.find((e=>e.id===t.id))));e=Date.now(),s.forEach((t=>{t.__onExit?.({params:t.params,search:t.state.routeSearch}),"error"===t.state.status&&this.__store.setState((t=>({...t,status:"idle",error:void 0})))})),n.forEach((t=>{t.route.options.onTransition?.({params:t.params,search:t.state.routeSearch})})),i.forEach((t=>{t.__onExit=t.route.options.onLoaded?.({params:t.params,search:t.state.search})}));const c=this.state.currentLocation;this.__store.setState((t=>({...t,status:"idle",currentLocation:this.state.latestLocation,currentMatches:o,pendingLocation:void 0,pendingMatches:void 0}))),o.forEach((t=>{t.__commit()})),c.href!==this.state.currentLocation.href&&this.options.onRouteChange?.(),this.resolveNavigation()};getRoute=t=>{const e=this.routesById[t];return n(e),e};loadRoute=async(t=this.state.latestLocation)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,{strictParseParams:!0});return await this.loadMatches(r,e),r};preloadRoute=async(t=this.state.latestLocation)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,{strictParseParams:!0});return await this.loadMatches(r,e,{preload:!0}),r};matchRoutes=(t,e)=>{const r=[];if(!this.routeTree)return r;const o=[...this.state.currentMatches,...this.state.pendingMatches??[]],a=async s=>{let n=w(r)?.params??{};const i=this.options.filterRoutes?.(s)??s;let c=[];const h=(r,o)=>(o.some((o=>{const a=o.children;if(!o.path&&a?.length)return h([...c,o],a);const s=!("/"===o.path&&!a?.length),i=I(this.basepath,t,{to:o.fullPath,fuzzy:s,caseSensitive:o.options.caseSensitive??this.options.caseSensitive});if(i){let t;try{t=o.options.parseParams?.(i)??i}catch(t){if(e?.strictParseParams)throw t}n={...n,...t}}return i&&(c=[...r,o]),!!c.length})),!!c.length);if(h([],i),!c.length)return;c.forEach((t=>{const e=A(t.path,n),a=A(t.id,n,!0),s=o.find((t=>t.id===a))||new Y(this,t,{id:a,params:n,pathname:x([this.basepath,e])});r.push(s)}));const u=w(c).children;u?.length&&a(u)};return a([this.routeTree]),r};loadMatches=async(t,e,r)=>{let o;try{await Promise.all(t.map((async(t,e)=>{try{await(t.route.options.beforeLoad?.({router:this,match:t}))}catch(r){if(Q(r))throw r;o=o??e;const a=t.route.options.onBeforeLoadError??t.route.options.onError;try{a?.(r)}catch(e){if(Q(e))throw e;return void t.__store.setState((t=>({...t,error:e,status:"error",updatedAt:Date.now()})))}t.__store.setState((t=>({...t,error:r,status:"error",updatedAt:Date.now()})))}})))}catch(t){if(Q(t))return void(r?.preload||this.navigate(t));throw t}const a=t.slice(0,o),s=a.map((async(t,o)=>{const s=a[o-1];t.__load({preload:r?.preload,location:e,parentMatch:s}),await t.__loadPromise,s&&await s.__loadPromise}));await Promise.all(s)};reload=()=>{this.navigate({fromCurrent:!0,replace:!0,search:!0})};resolvePath=(t,e)=>O(this.basepath,t,R(e));navigate=async({from:t,to:e="",search:r,hash:o,replace:a,params:s})=>{const i=String(e),c=void 0===t?t:String(t);let h;try{new URL(`${i}`),h=!0}catch(t){}return n(!h),this.#r({from:c,to:i,search:r,hash:o,replace:a,params:s})};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePath(t.from??"",t.to):void 0};const r=this.buildNext(t),o=e?.pending?this.state.pendingLocation:this.state.currentLocation;if(!o)return!1;const a=I(this.basepath,o.pathname,{...e,to:r.pathname});return!!a&&(e?.includeSearch??1?!!P(o.search,r.search)&&a:a)};buildLink=({from:t,to:e=".",search:r,params:o,hash:a,target:s,replace:n,activeOptions:i,preload:c,preloadDelay:h,disabled:u})=>{try{return new URL(`${e}`),{type:"external",href:e}}catch(t){}const l={from:t,to:e,search:r,params:o,hash:a,replace:n},d=this.buildNext(l);c=c??this.options.defaultPreload;const p=h??this.options.defaultPreloadDelay??0,f=this.state.currentLocation.pathname.split("/"),m=d.pathname.split("/").every(((t,e)=>t===f[e])),y=i?.exact?this.state.currentLocation.pathname===d.pathname:m,g=!i?.includeHash||this.state.currentLocation.hash===d.hash,v=!(i?.includeSearch??1)||P(this.state.currentLocation.search,d.search);return{type:"internal",next:d,handleFocus:t=>{c&&this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},handleClick:t=>{u||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||s&&"_self"!==s||0!==t.button||(t.preventDefault(),this.#r(l))},handleEnter:t=>{const e=t.target||{};if(c){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))}),p)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},handleTouchStart:t=>{this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},isActive:y&&g&&v,disabled:u}};dehydrate=()=>({state:{...S(this.state,["latestLocation","currentLocation","status","lastUpdated"]),currentMatches:this.state.currentMatches.map((t=>({id:t.id,state:{status:t.state.status}})))}});hydrate=t=>{this.__store.setState((e=>{const r=this.matchRoutes(t.state.latestLocation.pathname,{strictParseParams:!0});return r.forEach(((e,r)=>{const o=t.state.currentMatches[r];n(o&&o.id===e.id),e.__store.setState((t=>({...t,...o.state})))})),{...e,...t.state,currentMatches:r}}))};#a=t=>{const e=(t,r)=>{t.forEach(((t,r)=>{t.init({originalIndex:r,router:this});n(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t;const o=t.children;o?.length&&(e(o),t.children=o.map(((t,e)=>{const r=j(C(R(t.path??"/")));for(;r.length>1&&"/"===r[0]?.value;)r.shift();let o=0;return r.forEach(((t,e)=>{let r=1;for(;e--;)r*=.001;"pathname"===t.type&&"/"!==t.value?o+=1*r:"param"===t.type?o+=2*r:"wildcard"===t.type&&(o+=3*r)})),{child:t,parsed:r,index:e,score:o}})).sort(((t,e)=>t.score!==e.score?t.score-e.score:t.index-e.index)).map((t=>t.child)))}))};e([t]);const r=(t,e)=>{t.forEach((t=>{t.isRoot?n(!e):n(!e||t.parentRoute===e,(t.path,t.parentRoute?.id,e?.id)),t.children&&r(t.children,t)}))};return r([t],void 0),t};#o=t=>{let{pathname:e,search:r,hash:o,state:a}=this.history.location;const s=this.options.parseSearch(r);return{pathname:e,searchStr:r,search:_(t?.search,s),hash:o.split("#").reverse()[0]??"",href:`${e}${r}${o}`,state:a,key:a?.key||"__init__"}};#s=(t={})=>{t.fromCurrent=t.fromCurrent??""===t.to;const e=t.fromCurrent?this.state.latestLocation.pathname:t.from??this.state.latestLocation.pathname;let r=O(this.basepath??"/",e,`${t.to??""}`);const o={...w(this.matchRoutes(this.state.latestLocation.pathname,{strictParseParams:!0}))?.params};let a=!0===(t.params??!0)?o:b(t.params,o);a&&t.__matches?.map((t=>t.route.options.stringifyParams)).filter(Boolean).forEach((t=>{a={...a,...t(a)}})),r=A(r,a??{});const s=t.__matches?.map((t=>t.route.options.preSearchFilters??[])).flat().filter(Boolean)??[],n=t.__matches?.map((t=>t.route.options.postSearchFilters??[])).flat().filter(Boolean)??[],i=s?.length?s?.reduce(((t,e)=>e(t)),this.state.latestLocation.search):this.state.latestLocation.search,c=!0===t.search?i:t.search?b(t.search,i)??{}:s?.length?i:{},h=n?.length?n.reduce(((t,e)=>e(t)),c):c,u=_(this.state.latestLocation.search,h),l=this.options.stringifySearch(u);let d=!0===t.hash?this.state.latestLocation.hash:b(t.hash,this.state.latestLocation.hash);d=d?`#${d}`:"";return{pathname:r,search:u,searchStr:l,state:!0===t.state?this.state.latestLocation.state:b(t.state,this.state.latestLocation.state),hash:d,href:this.history.createHref(`${r}${l}${d}`),key:t.key}};#r=async t=>{const e=this.buildNext(t),r=""+Date.now()+Math.random();this.navigateTimeout&&clearTimeout(this.navigateTimeout);let o="replace";t.replace||(o="push");this.state.latestLocation.href===e.href&&!e.key&&(o="replace");const a=`${e.pathname}${e.searchStr}${e.hash?`${e.hash}`:""}`;return this.history["push"===o?"push":"replace"](a,{id:r,...e.state}),this.navigationPromise=new Promise((t=>{const e=this.resolveNavigation;this.resolveNavigation=()=>{e(),t()}}))}}const J="undefined"==typeof window||!window.document.createElement;function G(){return{status:"idle",latestLocation:null,currentLocation:null,currentMatches:[],lastUpdated:Date.now()}}function Q(t){return!!t?.isRedirect}const X=["component","errorComponent","pendingComponent"];class Y{abortController=new AbortController;constructor(t,e,r){Object.assign(this,{route:e,router:t,id:r.id,pathname:r.pathname,params:r.params,__store:new c({updatedAt:0,routeSearch:{},search:{},status:"idle"},{onUpdate:t=>{this.state=t}})}),this.state=this.__store.state,X.map((async t=>{const e=this.route.options[t];"function"!=typeof this[t]&&(this[t]=e)})),"idle"!==this.state.status||this.#n()||this.__store.setState((t=>({...t,status:"success"})))}#n=()=>!(!this.route.options.onLoad&&!X.some((t=>this.route.options[t]?.preload)));__commit=()=>{const{routeSearch:t,search:e,context:r,routeContext:o}=this.#i({location:this.router.state.currentLocation});this.context=r,this.routeContext=o,this.__store.setState((r=>({...r,routeSearch:_(r.routeSearch,t),search:_(r.search,e)})))};cancel=()=>{this.abortController?.abort()};#c=t=>{const e=this.parentMatch?this.parentMatch.#c(t):{search:t.location.search,routeSearch:t.location.search};try{const t=("object"==typeof this.route.options.validateSearch?this.route.options.validateSearch.parse:this.route.options.validateSearch)?.(e.search)??{};return{routeSearch:t,search:{...e.search,...t}}}catch(t){if(Q(t))throw t;(this.route.options.onValidateSearchError??this.route.options.onError)?.(t);const e=new Error("Invalid search params found",{cause:t});throw e.code="INVALID_SEARCH_PARAMS",e}};#i=t=>{const{search:e,routeSearch:r}=this.#c(t);try{const t=this.route.options.getContext?.({parentContext:this.parentMatch?.routeContext??{},context:this.parentMatch?.context??this.router?.options.context??{},params:this.params,search:e})||{};return{routeSearch:r,search:e,context:{...this.parentMatch?.context??this.router?.options.context,...t},routeContext:t}}catch(t){throw this.route.options.onError?.(t),t}};__load=async t=>{let e;this.parentMatch=t.parentMatch;try{e=this.#i(t)}catch(e){return Q(e)?void(t?.preload||this.router.navigate(e)):void this.__store.setState((t=>({...t,status:"error",error:e})))}const{routeSearch:r,search:o,context:a,routeContext:s}=e;if("pending"!==this.state.status)return this.__loadPromise=Promise.resolve().then((async()=>{const e=""+Date.now()+Math.random();this.#h=e;const n=()=>e!==this.#h?this.__loadPromise:void 0;let i;"idle"===this.state.status&&this.__store.setState((t=>({...t,status:"pending"})));const c=(async()=>{await Promise.all(X.map((async t=>{const e=this.route.options[t];this[t]?.preload&&(this[t]=await this.router.options.loadComponent(e))})))})(),h=Promise.resolve().then((()=>{if(this.route.options.onLoad)return this.route.options.onLoad({params:this.params,routeSearch:r,search:o,signal:this.abortController.signal,preload:!!t?.preload,routeContext:s,context:a})}));try{if(await Promise.all([c,h]),i=n())return await i;this.__store.setState((t=>({...t,error:void 0,status:"success",updatedAt:Date.now()})))}catch(e){if(Q(e))return void(t?.preload||this.router.navigate(e));const r=this.route.options.onLoadError??this.route.options.onError;try{r?.(e)}catch(e){return Q(e)?void(t?.preload||this.router.navigate(e)):void this.__store.setState((t=>({...t,error:e,status:"error",updatedAt:Date.now()})))}this.__store.setState((t=>({...t,error:e,status:"error",updatedAt:Date.now()})))}finally{delete this.__loadPromise}})),this.__loadPromise};#h=""}
|
|
32
|
-
/**
|
|
33
|
-
* react-store
|
|
34
|
-
*
|
|
35
|
-
* Copyright (c) TanStack
|
|
36
|
-
*
|
|
37
|
-
* This source code is licensed under the MIT license found in the
|
|
38
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
39
|
-
*
|
|
40
|
-
* @license MIT
|
|
41
|
-
*/function Z(t,e=(t=>t),o){return r.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,o?h:void 0)}function tt(t){const e=at(),{type:r,children:o,target:s,activeProps:n=(()=>({className:"active"})),inactiveProps:i=(()=>({})),activeOptions:c,disabled:h,hash:u,search:l,params:d,to:p=".",preload:f,preloadDelay:m,replace:y,style:g,className:v,onClick:w,onFocus:S,onMouseEnter:_,onMouseLeave:L,onTouchStart:E,...P}=t,x=e.buildLink(t);if("external"===x.type){const{href:t}=x;return{href:t}}const{handleClick:R,handleFocus:C,handleEnter:M,handleLeave:k,handleTouchStart:O,isActive:j,next:A}=x,I=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},$=j?b(n,{})??{}:{},T=j?{}:b(i,{})??{};return{...$,...T,...P,href:h?void 0:A.href,onClick:I([w,t=>{a.startTransition?a.startTransition((()=>{R(t)})):R(t)}]),onFocus:I([S,C]),onMouseEnter:I([_,M]),onMouseLeave:I([L,k]),onTouchStart:I([E,O]),target:s,style:{...g,...$.style,...T.style},className:[v,$.className,T.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":j?"active":void 0}}const et=a.forwardRef(((t,e)=>{const r=tt(t);return a.createElement("a",s({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const rt=a.createContext(null),ot=a.createContext(null);function at(){const t=a.useContext(ot);return Z(t.router.__store),t.router}function st(t,e){const r=at();return Z(r.__store,t,e),r}function nt(){return a.useContext(rt)}function it(t){const e=at(),r=nt()[0],o=t?.from?e.state.currentMatches.find((e=>e.route.id===t?.from)):r;return n(o,t?.from&&t.from),(t?.strict??1)&&n(r.route.id==o?.route.id,(o?.route.id,r.route.id,o?.route.id,o?.route.id)),Z(o.__store,(e=>t?.track?.(o)??o),t?.shallow),o}function ct(){const t=at();return a.useCallback((e=>{const{pending:r,caseSensitive:o,...a}=e;return t.matchRoute(a,{pending:r,caseSensitive:o})}),[])}function ht(){const t=nt().slice(1),e=t[0];return e?a.createElement(ut,{matches:t,match:e}):null}function ut({matches:t,match:e}){const r=at();Z(e.__store,(t=>[t.status,t.error]),!0);const o=a.useCallback((()=>null),[]),s=e.pendingComponent??r.options.defaultPendingComponent??o,n=e.errorComponent??r.options.defaultErrorComponent,i=e.route.options.wrapInSuspense??1?a.Suspense:dt,c=n?pt:dt;return a.createElement(rt.Provider,{value:t},a.createElement(i,{fallback:a.createElement(s,null)},a.createElement(c,{key:e.route.id,errorComponent:n,onCatch:()=>{e.id}},a.createElement(lt,{match:e}))))}function lt(t){const e=at();if("error"===t.match.state.status)throw t.match.state.error;if("success"===t.match.state.status)return a.createElement(t.match.component??e.options.defaultComponent??ht);if("pending"===t.match.state.status)throw t.match.__loadPromise;n(!1)}function dt(t){return a.createElement(a.Fragment,null,t.children)}class pt extends a.Component{state={error:!1,info:void 0};componentDidCatch(t,e){this.props.onCatch(t,e),console.error(t),this.setState({error:t,info:e})}render(){return a.createElement(ft,s({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function ft(t){const[e,r]=a.useState(t.errorState),o=at(),s=t.errorComponent??mt,n=a.useRef("");return a.useEffect((()=>{e&&o.state.currentLocation.key!==n.current&&r({}),n.current=o.state.currentLocation.key}),[e,o.state.currentLocation.key]),a.useEffect((()=>{t.errorState.error&&r(t.errorState)}),[t.errorState.error]),t.errorState.error&&e.error?a.createElement(s,e):t.children}function mt({error:t}){return a.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},a.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),a.createElement("div",{style:{height:".5rem"}}),a.createElement("div",null,a.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red",overflow:"auto"}},t.message?a.createElement("code",null,t.message):null)))}function yt(t,e=!0){const r=st();a.useEffect((()=>{if(!e)return;let o=r.history.block(((e,r)=>{window.confirm(t)?(o(),e()):r()}));return o}))}t.Block=function({message:t,condition:e,children:r}){return yt(t,e),r??null},t.ErrorComponent=mt,t.Link=et,t.MatchRoute=function(t){const e=ct()(t);return e?"function"==typeof t.children?t.children(e):e?t.children:null:null},t.Navigate=function(t){const e=at();return a.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=ht,t.ReactRouter=class extends V{constructor(t){super({...t,loadComponent:async t=>(t.preload&&await t.preload(),t)})}},t.RootRoute=F,t.Route=B,t.RouteMatch=Y,t.Router=V,t.RouterProvider=function({router:t,...e}){t.update(e);const r=Z(t.__store,(t=>t.currentMatches));return a.useEffect(t.mount,[t]),a.createElement(ot.Provider,{value:{router:t}},a.createElement(rt.Provider,{value:[void 0,...r]},a.createElement(pt,{errorComponent:mt,onCatch:()=>{}},a.createElement(ht,null))))},t.cleanPath=R,t.createBrowserHistory=m,t.createHashHistory=function(){return m({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=y,t.decode=N,t.defaultFetchServerDataFn=K,t.defaultParseSearch=U,t.defaultStringifySearch=z,t.encode=T,t.functionalUpdate=b,t.interpolatePath=A,t.invariant=n,t.isPlainObject=L,t.isRedirect=Q,t.joinPaths=x,t.last=w,t.lazy=function(t){const e=a.lazy(t);return e.preload=async()=>{await t()},e},t.matchByPath=$,t.matchPathname=I,t.matchesContext=rt,t.parsePathname=j,t.parseSearchWith=q,t.partialDeepEqual=P,t.pick=S,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=_,t.resolvePath=O,t.rootRouteId=H,t.routerContext=ot,t.stringifySearchWith=W,t.trimPath=k,t.trimPathLeft=C,t.trimPathRight=M,t.useBlocker=yt,t.useLinkProps=tt,t.useMatch=it,t.useMatchRoute=ct,t.useMatches=nt,t.useNavigate=function(t){const e=at();return a.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=function(t){const e=at();return Z(e.__store,(e=>{const r=w(e.currentMatches)?.params;return t?.track?.(r)??r}),!0),w(e.state.currentMatches)?.params},t.useRoute=function(t){const e=at().getRoute(t);return n(e),e},t.useRouter=st,t.useRouterContext=at,t.useSearch=function(t){const{track:e,...r}=t,o=it(r);return Z(o.__store,(e=>t?.track?.(e.search)??e.search),!0),o.state.search},t.useStore=Z,t.warning=i,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
21
|
+
*/const s="pushstate",a="popstate",i="beforeunload",c=t=>(t.preventDefault(),t.returnValue=""),l=()=>{removeEventListener(i,c,{capture:!0})};function u(t){let e=t.getLocation(),o=new Set,n=[];const r=()=>{e=t.getLocation(),o.forEach((t=>t()))},s=async e=>{if("undefined"!=typeof document&&n.length)for(let e of n){if(!await e())return void t.onBlocked?.(r)}e()};return{get location(){return e},subscribe:t=>(o.add(t),()=>{o.delete(t)}),push:(e,o)=>{o=h(o),s((()=>{t.pushState(e,o,r)}))},replace:(e,o)=>{o=h(o),s((()=>{t.replaceState(e,o,r)}))},go:e=>{s((()=>{t.go(e)}))},back:()=>{s((()=>{t.back()}))},forward:()=>{s((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(n.push(t),1===n.length&&addEventListener(i,c,{capture:!0}),()=>{n=n.filter((e=>e!==t)),n.length||l()}),flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:r}}function h(t){return t||(t={}),{...t,key:m()}}function d(t){const e=t?.window??("undefined"!=typeof document?window:void 0),o=t?.createHref??(t=>t),n=t?.parseLocation??(()=>p(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));let r,i=n();let c,l,h=!0;const d=()=>{h=!1,(()=>{c&&(e.history[c.isPush?"pushState":"replaceState"](c.state,"",c.href),c=void 0,l=void 0,r=void 0)})(),h=!0},f=(t,e,n,s)=>{const a=o(e);l||(r=i),i=p(e,n),c={href:a,state:n,isPush:c?.isPush||"push"===t},s(),l||(l=Promise.resolve().then((()=>d())))},m=()=>{i=n(),v.notify()};var y=e.history.pushState,g=e.history.replaceState;const v=u({getLocation:()=>i,pushState:(t,e,o)=>f("push",t,e,o),replaceState:(t,e,o)=>f("replace",t,e,o),back:()=>e.history.back(),forward:()=>e.history.forward(),go:t=>e.history.go(t),createHref:t=>o(t),flush:d,destroy:()=>{e.history.pushState=y,e.history.replaceState=g,e.removeEventListener(s,m),e.removeEventListener(a,m)},onBlocked:t=>{r&&i!==r&&(i=r,t())}});return e.addEventListener(s,m),e.addEventListener(a,m),e.history.pushState=function(){let t=y.apply(e.history,arguments);return h&&v.notify(),t},e.history.replaceState=function(){let t=g.apply(e.history,arguments);return h&&v.notify(),t},v}function f(t={initialEntries:["/"]}){const e=t.initialEntries;let o=t.initialIndex??e.length-1,n={key:m()};return u({getLocation:()=>p(e[o],n),pushState:(t,r)=>{n=r,e.push(t),o++},replaceState:(t,r)=>{n=r,e[o]=t},back:()=>{o--},forward:()=>{o=Math.min(o+1,e.length-1)},go:t=>{o=Math.min(Math.max(o+t,0),e.length-1)},createHref:t=>t})}function p(t,e){let o=t.indexOf("#"),n=t.indexOf("?");return{href:t,pathname:t.substring(0,o>0?n>0?Math.min(o,n):o:n>0?n:t.length),hash:o>-1?t.substring(o):"",search:n>-1?t.slice(n,-1===o?void 0:o):"",state:e||{}}}function m(){return(Math.random()+1).toString(36).substring(7)}var y="Invariant failed";function g(t,e){if(!t)throw new Error(y)}var v,w={exports:{}},_={};w.exports=function(){if(v)return _;v=1;var t=e,n=o,r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=n.useSyncExternalStore,a=t.useRef,i=t.useEffect,c=t.useMemo,l=t.useDebugValue;return _.useSyncExternalStoreWithSelector=function(t,e,o,n,u){var h=a(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;h=c((function(){function t(t){if(!i){if(i=!0,s=t,t=n(t),void 0!==u&&d.hasValue){var e=d.value;if(u(e,t))return a=e}return a=t}if(e=a,r(s,t))return e;var o=n(t);return void 0!==u&&u(e,o)?e:(s=t,a=o)}var s,a,i=!1,c=void 0===o?null:o;return[function(){return t(e())},null===c?void 0:function(){return t(c())}]}),[e,o,n,u]);var f=s(t,h[0],h[1]);return i((function(){d.hasValue=!0,d.value=f}),[f]),l(f),f},_}();var b=w.exports,S=class{constructor(t,e){this.listeners=new Set,this._batching=!1,this._flushing=0,this._nextPriority=null,this.subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}},this.setState=(t,e)=>{const o=this.state;this.state=this.options?.updateFn?this.options.updateFn(o)(t):t(o);const n=e?.priority??this.options?.defaultPriority??"high";null===this._nextPriority||"high"===this._nextPriority?this._nextPriority=n:this._nextPriority=this.options?.defaultPriority??"high",this.options?.onUpdate?.({priority:this._nextPriority}),this._flush()},this._flush=()=>{if(this._batching)return;const t=++this._flushing;this.listeners.forEach((e=>{this._flushing===t&&e({priority:this._nextPriority??"high"})}))},this.batch=t=>{if(this._batching)return t();this._batching=!0,t(),this._batching=!1,this._flush()},this.state=t,this.options=e}};function R(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!1;for(let n=0;n<o.length;n++)if(!Object.prototype.hasOwnProperty.call(e,o[n])||!Object.is(t[o[n]],e[o[n]]))return!1;return!0}function E(t){const e=t.errorComponent??P;return r.createElement(L,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:o})=>o?r.createElement(e,{error:o}):t.children})}class L extends r.Component{state={error:null};static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t,e){e.error&&e.resetKey!==this.state.resetKey&&this.setState({error:null})}componentDidCatch(t){console.error(t),this.props.onCatch?.(t)}render(){return this.props.children(this.state)}}function P({error:t}){const[e,o]=r.useState(!1);return r.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:".5rem"}},r.createElement("strong",{style:{fontSize:"1rem"}},"Something went wrong!"),r.createElement("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>o((t=>!t))},e?"Hide Error":"Show Error")),r.createElement("div",{style:{height:".25rem"}}),e?r.createElement("div",null,r.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"}},t.message?r.createElement("code",null,t.message):null)):null)}const x="undefined"==typeof document;function C(t){return t[t.length-1]}function T(t,e){return"function"==typeof t?t(e):t}function M(t,e){return e.reduce(((e,o)=>(e[o]=t[o],e)),{})}function O(t,e){if(t===e)return t;const o=e,n=Array.isArray(t)&&Array.isArray(o);if(n||k(t)&&k(o)){const e=n?t.length:Object.keys(t).length,r=n?o:Object.keys(o),s=r.length,a=n?[]:{};let i=0;for(let e=0;e<s;e++){const s=n?e:r[e];a[s]=O(t[s],o[s]),a[s]===t[s]&&i++}return e===s&&i===e?t:a}return o}function k(t){if(!I(t))return!1;const e=t.constructor;if(void 0===e)return!0;const o=e.prototype;return!!I(o)&&!!o.hasOwnProperty("isPrototypeOf")}function I(t){return"[object Object]"===Object.prototype.toString.call(t)}function D(t,e,o=!1){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(k(t)&&k(e)){const n=Object.keys(t),r=Object.keys(e);return!(!o&&n.length!==r.length)&&!r.some((n=>!(n in t)||!D(t[n],e[n],o)))}return!(!Array.isArray(t)||!Array.isArray(e))&&!t.some(((t,n)=>!D(t,e[n],o)))}const j="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function $(t){return t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}const B=r.createContext(void 0);function A(){const t=Q(),e=G({select:t=>U(t)[0]?.id});return r.createElement(B.Provider,{value:e},r.createElement(E,{getResetKey:()=>t.state.resolvedLocation.state?.key,errorComponent:P,onCatch:()=>{}},e?r.createElement(H,{matchId:e}):null))}function N(t){return r.createElement(r.Fragment,null,t.children)}function H({matchId:t}){const e=Q(),o=G({select:e=>U(e).find((e=>e.id===t))?.routeId});g(o);const n=e.routesById[o],s=n.options.pendingComponent??e.options.defaultPendingComponent,a=s?r.createElement(s,null):null,i=n.options.errorComponent??e.options.defaultErrorComponent??P,c=n.options.wrapInSuspense??s??n.options.component?.preload??n.options.pendingComponent?.preload??n.options.errorComponent?.preload?r.Suspense:N,l=i?E:N;return r.createElement(B.Provider,{value:t},r.createElement(c,{fallback:a},r.createElement(l,{getResetKey:()=>e.state.resolvedLocation.state?.key,errorComponent:i,onCatch:()=>{}},r.createElement(F,{matchId:t,pendingElement:a}))))}function F({matchId:t,pendingElement:e}){const o=Q(),n=G({select:e=>U(e).find((e=>e.id===t))?.routeId}),s=o.routesById[n],a=G({select:e=>M(U(e).find((e=>e.id===t)),["status","error","showPending","loadPromise"])});if("error"===a.status)throw a.error;if("pending"===a.status){if(a.showPending)return e;throw a.loadPromise}if("success"===a.status){let t=s.options.component??o.options.defaultComponent;return t?r.createElement(t,null):r.createElement(K,null)}g(!1)}const K=r.memo((function(){const t=r.useContext(B),e=G({select:e=>{const o=U(e),n=o.findIndex((e=>e.id===t));return o[n+1]?.id}});return e?r.createElement(H,{matchId:e}):null}));function W(){G({select:t=>[t.location,t.resolvedLocation]});const{matchRoute:t}=Q();return r.useCallback((e=>{const{pending:o,caseSensitive:n,...r}=e;return t(r,{pending:o,caseSensitive:n})}),[])}function U(t){return t.pendingMatches?.some((t=>t.showPending))?t.pendingMatches:t.matches}function z(t){const e=Q(),o=r.useContext(B),n=U(e.state).find((t=>t.id===o))?.routeId,s=(()=>{const n=U(e.state);return(t?.from?n.find((e=>e.routeId===t?.from)):n.find((t=>t.id===o))).routeId})();(t?.strict??1)&&g(n==s);return G({select:e=>{const n=U(e).find((t=>t.id===o));return g(n,t?.from&&t.from),t?.select?t.select(n):n}})}function Y(t){return G({select:e=>{let o=U(e);return t?.select?t.select(o):o}})}function J(t){return z({...t,select:e=>"function"==typeof t.select?t.select(e?.loaderDeps):e?.loaderDeps})}function X(t){return z({...t,select:e=>"function"==typeof t.select?t.select(e?.loaderData):e?.loaderData})}function q(){const t=Q(),e=G({select:t=>M(t,["isLoading","location","resolvedLocation","isTransitioning"])}),[o,n]=r.useTransition();t.startReactTransition=n,r.useEffect((()=>{o&&t.__store.setState((t=>({...t,isTransitioning:o})))}),[o]);const s=()=>{var o;o=()=>{try{t.load()}catch(t){console.error(t)}},e.isTransitioning?o():n((()=>o()))};return j((()=>{const o=t.history.subscribe((()=>{t.latestLocation=t.parseLocation(t.latestLocation),e.location!==t.latestLocation&&s()})),n=t.buildLocation({search:!0,params:!0,hash:!0,state:!0});return e.location.href!==n.href&&t.commitLocation({...n,replace:!0}),()=>{o()}}),[t.history]),j((()=>{if(e.isTransitioning&&!o&&!e.isLoading&&e.resolvedLocation!==e.location){if(t.emit({type:"onResolved",fromLocation:e.resolvedLocation,toLocation:e.location,pathChanged:e.location.href!==e.resolvedLocation?.href}),document.querySelector&&""!==e.location.hash){const t=document.getElementById(e.location.hash);t&&t.scrollIntoView()}t.__store.setState((t=>({...t,isTransitioning:!1,resolvedLocation:t.location})))}}),[e.isTransitioning,o,e.isLoading,e.resolvedLocation,e.location]),j((()=>{window.__TSR_DEHYDRATED__||s()}),[]),null}function V(t,e){return[...t.cachedMatches,...t.pendingMatches??[],...t.matches].find((t=>t.id===e))}function G(t){return function(t,e=(t=>t)){return b.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,R)}(Q().__store,t?.select)}function Q(){const e="undefined"!=typeof document&&window.__TSR_ROUTER_CONTEXT__||t.routerContext;return r.useContext(e)}function Z(t){return"object"==typeof t&&null!==t&&!(t instanceof Promise)&&!t.then&&"__deferredState"in t}function tt({promise:t}){const e=Q();let o=t.__deferredState;const n=`__TSR__DEFERRED__${o.uid}`;if(Z(t)&&(o=e.hydrateData(n),(t=Promise.resolve(o.data)).__deferredState=o),"pending"===o.status)throw new Promise((t=>setTimeout(t,1))).then((()=>t));if("error"===o.status)throw o.error;return e.dehydrateData(n,o),[o.data]}function et(t){return ot(t.filter(Boolean).join("/"))}function ot(t){return t.replace(/\/{2,}/g,"/")}function nt(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function rt(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function st(t){return rt(nt(t))}function at(t,e,o){e=e.replace(new RegExp(`^${t}`),"/"),o=o.replace(new RegExp(`^${t}`),"/");let n=it(e);const r=it(o);r.forEach(((t,e)=>{if("/"===t.value)e?e===r.length-1&&n.push(t):n=[t];else if(".."===t.value)n.length>1&&"/"===C(n)?.value&&n.pop(),n.pop();else{if("."===t.value)return;n.push(t)}}));return ot(et([t,...n.map((t=>t.value))]))}function it(t){if(!t)return[];const e=[];if("/"===(t=ot(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const o=t.split("/").filter(Boolean);return e.push(...o.map((t=>"$"===t||"*"===t?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function ct(t,e,o=!1){return et(it(t).map((t=>{if("wildcard"===t.type){const n=e[t.value];return o?`${t.value}${n??""}`:n}return"param"===t.type?e[t.value.substring(1)]??"undefined":t.value})))}function lt(t,e,o){const n=ht(t,e,o);if(!o.to||n)return n??{}}function ut(t,e){return"/"!=t?e.substring(t.length):e}function ht(t,e,o){e=ut(t,e);const n=`${o.to??"$"}`,r=it(e),s=it(n);e.startsWith("/")||r.unshift({type:"pathname",value:"/"}),n.startsWith("/")||s.unshift({type:"pathname",value:"/"});const a={};return(()=>{for(let t=0;t<Math.max(r.length,s.length);t++){const e=r[t],n=s[t],i=t>=r.length-1,c=t>=s.length-1;if(n){if("wildcard"===n.type)return!!e?.value&&(a["*"]=et(r.slice(t).map((t=>t.value))),!0);if("pathname"===n.type){if("/"===n.value&&!e?.value)return!0;if(e)if(o.caseSensitive){if(n.value!==e.value)return!1}else if(n.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===n.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(a[n.value.substring(1)]=e.value)}}if(!i&&c)return a["**"]=et(r.slice(t+1).map((t=>t.value))),!!o.fuzzy&&"/"!==n?.value}return!0})()?a:void 0}function dt(t){return G({select:e=>{const o=C(e.matches)?.params;return t?.select?t.select(o):o}})}function ft(t){return z({...t,select:e=>t?.select?t.select(e.search):e.search})}t.routerContext=r.createContext(null),"undefined"!=typeof document&&(window.__TSR_ROUTER_CONTEXT__?t.routerContext=window.__TSR_ROUTER_CONTEXT__:window.__TSR_ROUTER_CONTEXT__=t.routerContext);const pt="__root__";class mt{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute,g(!(t?.id&&t?.path)),this.$$typeof=Symbol.for("react.memo")}init=t=>{this.originalIndex=t.originalIndex;const e=this.options,o=!e?.path&&!e?.id;this.parentRoute=this.options?.getParentRoute?.(),o?this.path=pt:g(this.parentRoute);let n=o?pt:e.path;n&&"/"!==n&&(n=st(n));const r=e?.id||n;let s=o?pt:et([this.parentRoute.id===pt?"":this.parentRoute.id,r]);n===pt&&(n="/"),s!==pt&&(s=et(["/",s]));const a=s===pt?"/":et([this.parentRoute.fullPath,n]);this.path=n,this.id=s,this.fullPath=a,this.to=a};addChildren=t=>(this.children=t,this);update=t=>(Object.assign(this.options,t),this);useMatch=t=>z({...t,from:this.id});useRouteContext=t=>z({...t,from:this.id,select:e=>t?.select?t.select(e.context):e.context});useSearch=t=>ft({...t,from:this.id});useParams=t=>dt({...t,from:this.id});useLoaderDeps=t=>J({...t,from:this.id});useLoaderData=t=>X({...t,from:this.id})}class yt extends mt{constructor(t){super(t)}}function gt(){return gt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},gt.apply(this,arguments)}const vt="Error preloading route! ☝️";function wt(t){const e=Q(),o=z({strict:!1,select:t=>t.pathname}),{children:n,target:r,activeProps:s=(()=>({className:"active"})),inactiveProps:a=(()=>({})),activeOptions:i,disabled:c,hash:l,search:u,params:h,to:d,state:f,mask:p,preload:m,preloadDelay:y,replace:g,startTransition:v,resetScroll:w,style:_,className:b,onClick:S,onFocus:R,onMouseEnter:E,onMouseLeave:L,onTouchStart:P,...x}=t,C={from:t.to?o:void 0,...t};let M="internal";try{new URL(`${d}`),M="external"}catch{}if("external"===M)return{href:d};const O=e.buildLocation(C),k=m??e.options.defaultPreload,I=y??e.options.defaultPreloadDelay??0,j=G({select:t=>{const e=t.location.pathname.split("/"),o=O.pathname.split("/").every(((t,o)=>t===e[o])),n=i?.exact?t.location.pathname===O.pathname:o,r=!i?.includeHash||t.location.hash===O.hash,s=!(i?.includeSearch??1)||D(t.location.search,O.search,!i?.exact);return n&&r&&s}}),$=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},B=j?T(s,{})??{}:{},A=j?{}:T(a,{})??{};return{...B,...A,...x,href:c?void 0:O.maskedLocation?O.maskedLocation.href:O.href,onClick:$([S,t=>{c||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||r&&"_self"!==r||0!==t.button||(t.preventDefault(),e.commitLocation({...O,replace:g,resetScroll:w,startTransition:v}))}]),onFocus:$([R,t=>{k&&e.preloadRoute(C).catch((t=>{console.warn(t),console.warn(vt)}))}]),onMouseEnter:$([E,t=>{const o=t.target||{};if(k){if(o.preloadTimeout)return;o.preloadTimeout=setTimeout((()=>{o.preloadTimeout=null,e.preloadRoute(C).catch((t=>{console.warn(t),console.warn(vt)}))}),I)}}]),onMouseLeave:$([L,t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)}]),onTouchStart:$([P,t=>{k&&e.preloadRoute(C).catch((t=>{console.warn(t),console.warn(vt)}))}]),target:r,style:{..._,...B.style,...A.style},className:[b,B.className,A.className].filter(Boolean).join(" ")||void 0,...c?{role:"link","aria-disabled":!0}:void 0,"data-status":j?"active":void 0}}const _t=r.forwardRef(((t,e)=>{const o=wt(t);return r.createElement("a",gt({ref:e},o,{children:"function"==typeof t.children?t.children({isActive:"active"===o["data-status"]}):t.children}))}));function bt(t,e){var o,n,r,s="";for(o in t)if(void 0!==(r=t[o]))if(Array.isArray(r))for(n=0;n<r.length;n++)s&&(s+="&"),s+=encodeURIComponent(o)+"="+encodeURIComponent(r[n]);else s&&(s+="&"),s+=encodeURIComponent(o)+"="+encodeURIComponent(r);return(e||"")+s}function St(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0&&+e+""===e?+e:e))}function Rt(t){for(var e,o,n={},r=t.split("&");e=r.shift();)void 0!==n[o=(e=e.split("=")).shift()]?n[o]=[].concat(n[o],St(e.shift())):n[o]=St(e.shift());return n}function Et(t){return!!t?.isRedirect}const Lt=xt(JSON.parse),Pt=Ct(JSON.stringify,JSON.parse);function xt(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let o=Rt(e);for(let e in o){const n=o[e];if("string"==typeof n)try{o[e]=t(n)}catch(t){}}return o}}function Ct(t,e){return o=>{(o={...o})&&Object.keys(o).forEach((n=>{const r=o[n];void 0===r||void 0===r?delete o[n]:o[n]=function(o){if("object"==typeof o&&null!==o)try{return t(o)}catch(t){}else if("string"==typeof o&&"function"==typeof e)try{return e(o),t(o)}catch(t){}return o}(r)}));const n=bt(o).toString();return n?`?${n}`:""}}const Tt=["component","errorComponent","pendingComponent"];class Mt extends Error{}class Ot extends Error{}function kt(t){return{isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:{...t},location:t,matches:[],pendingMatches:[],cachedMatches:[],lastUpdated:Date.now()}}const It="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,Dt="window",jt="___";let $t=new WeakSet;let Bt="undefined"!=typeof window&&window.sessionStorage?(()=>{const t="tsr-scroll-restoration-v2";return{state:JSON.parse(window.sessionStorage.getItem(t)||"null")||{cached:{},next:{}},set:e=>{Bt.state=T(e,Bt.state),window.sessionStorage.setItem(t,JSON.stringify(Bt.state))}}})():void 0;const At=t=>t.state.key;function Nt(t){const e=Q();It((()=>{const o=t?.getKey||At,{history:n}=window;n.scrollRestoration&&(n.scrollRestoration="manual");const r=t=>{if($t.has(t.target))return;$t.add(t.target);let e="";if(t.target===document||t.target===window)e=Dt;else{const o=t.target.getAttribute("data-scroll-restoration-id");e=o?`[data-scroll-restoration-id="${o}"]`:Ht(t.target)}Bt.state.next[e]||Bt.set((t=>({...t,next:{...t.next,[e]:{scrollX:NaN,scrollY:NaN}}})))};"undefined"!=typeof document&&document.addEventListener("scroll",r,!0);const s=e.subscribe("onBeforeLoad",(t=>{if(t.pathChanged){const e=o(t.fromLocation);for(const t in Bt.state.next){const o=Bt.state.next[t];if(t===Dt)o.scrollX=window.scrollX||0,o.scrollY=window.scrollY||0;else if(t){const e=document.querySelector(t);o.scrollX=e?.scrollLeft||0,o.scrollY=e?.scrollTop||0}Bt.set((n=>{const r={...n.next};return delete r[t],{...n,next:r,cached:{...n.cached,[[e,t].join(jt)]:o}}}))}}})),a=e.subscribe("onResolved",(o=>{if(o.pathChanged){if(!e.resetNextScroll)return;e.resetNextScroll=!0;const n=(t?.getKey||At)(o.toLocation);let r=!1;for(const t in Bt.state.cached){const e=Bt.state.cached[t],[o,s]=t.split(jt);if(o===n)if(s===Dt)r=!0,window.scrollTo(e.scrollX,e.scrollY);else if(s){const t=document.querySelector(s);t&&(t.scrollLeft=e.scrollX,t.scrollTop=e.scrollY)}}r||window.scrollTo(0,0),Bt.set((t=>({...t,next:{}}))),$t=new WeakSet}}));return()=>{document.removeEventListener("scroll",r),s(),a()}}),[])}function Ht(t){let e,o=[];for(;e=t.parentNode;)o.unshift(`${t.tagName}:nth-child(${[].indexOf.call(e.children,t)+1})`),t=e;return`${o.join(" > ")}`.toLowerCase()}function Ft(t,e=!0){const{history:o}=Q();r.useEffect((()=>{if(e)return o.block(t)}))}t.Await=function(t){const e=tt(t);return t.children(...e)},t.Block=function({blocker:t,condition:e,children:o}){return Ft(t,e),o??null},t.CatchBoundary=E,t.CatchBoundaryImpl=L,t.ErrorComponent=P,t.FileRoute=class{constructor(t){this.path=t}createRoute=t=>{const e=new mt(t);return e.isRoot=!1,e}},t.Link=_t,t.Match=H,t.MatchRoute=function(t){const e=W()(t);return"function"==typeof t.children?t.children(e):e?t.children:null},t.Matches=A,t.Navigate=function(t){const{navigate:e}=Q(),o=z({strict:!1});return r.useEffect((()=>{e({from:t.to?o.pathname:void 0,...t})}),[]),null},t.NotFoundRoute=class extends mt{constructor(t){super({...t,id:"404"})}},t.Outlet=K,t.PathParamError=Ot,t.RootRoute=yt,t.Route=mt,t.RouteApi=class{constructor({id:t}){this.id=t}useMatch=t=>z({...t,from:this.id});useRouteContext=t=>z({...t,from:this.id,select:e=>t?.select?t.select(e.context):e.context});useSearch=t=>ft({...t,from:this.id});useParams=t=>dt({...t,from:this.id});useLoaderDeps=t=>J({...t,from:this.id});useLoaderData=t=>X({...t,from:this.id})},t.Router=class{tempLocationKey=`${Math.round(1e7*Math.random())}`;resetNextScroll=!0;navigateTimeout=null;latestLoadPromise=Promise.resolve();subscribers=new Set;injectedHtml=[];constructor(t){this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,stringifySearch:t?.stringifySearch??Pt,parseSearch:t?.parseSearch??Lt})}startReactTransition=t=>t();update=t=>{this.options={...this.options,...t},this.basepath=`/${st(t.basepath??"")??""}`,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history??("undefined"!=typeof document?d():f()),this.latestLocation=this.parseLocation()),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),this.__store||(this.__store=new S(kt(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,status:this.state.isTransitioning||this.state.isLoading?"pending":"idle"}}}))};get state(){return this.__store.state}buildRouteTree=()=>{this.routesById={},this.routesByPath={};const t=this.options.notFoundRoute;t&&(t.init({originalIndex:99999999999}),this.routesById[t.id]=t);const e=t=>{t.forEach(((t,o)=>{t.init({originalIndex:o});if(g(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=rt(t.fullPath);this.routesByPath[e]&&!t.fullPath.endsWith("/")||(this.routesByPath[e]=t)}const n=t.children;n?.length&&e(n)}))};e([this.routeTree]);const o=[];Object.values(this.routesById).forEach(((t,e)=>{if(t.isRoot||!t.path)return;const n=nt(t.fullPath),r=it(n);for(;r.length>1&&"/"===r[0]?.value;)r.shift();const s=r.map((t=>"/"===t.value?.75:"param"===t.type?.5:"wildcard"===t.type?.25:1));o.push({child:t,trimmed:n,parsed:r,index:e,scores:s})})),this.flatRoutes=o.sort(((t,e)=>{const o=Math.min(t.scores.length,e.scores.length);for(let n=0;n<o;n++)if(t.scores[n]!==e.scores[n])return e.scores[n]-t.scores[n];if(t.scores.length!==e.scores.length)return e.scores.length-t.scores.length;for(let n=0;n<o;n++)if(t.parsed[n].value!==e.parsed[n].value)return t.parsed[n].value>e.parsed[n].value?1:-1;return t.index-e.index})).map(((t,e)=>(t.child.rank=e,t.child)))};subscribe=(t,e)=>{const o={eventType:t,fn:e};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}};emit=t=>{this.subscribers.forEach((e=>{e.eventType===t.type&&e.fn(t)}))};checkLatest=t=>this.latestLoadPromise!==t?this.latestLoadPromise:void 0;parseLocation=t=>{const e=({pathname:e,search:o,hash:n,state:r})=>{const s=this.options.parseSearch(o);return{pathname:e,searchStr:o,search:O(t?.search,s),hash:n.split("#").reverse()[0]??"",href:`${e}${o}${n}`,state:O(t?.state,r)}},o=e(this.history.location);let{__tempLocation:n,__tempKey:r}=o.state;if(n&&(!r||r===this.tempLocationKey)){const t=e(n);return t.state.key=o.state.key,delete t.state.__tempLocation,{...t,maskedLocation:o}}return o};resolvePathWithBase=(t,e)=>at(this.basepath,t,ot(e));get looseRoutesById(){return this.routesById}matchRoutes=(t,e,o)=>{let n={},r=this.flatRoutes.find((e=>{const o=lt(this.basepath,rt(t),{to:e.fullPath,caseSensitive:e.options.caseSensitive??this.options.caseSensitive,fuzzy:!0});return!!o&&(n=o,!0)})),s=r||this.routesById.__root__,a=[s];for((r?"/"!==r.path&&n["**"]:rt(t))&&this.options.notFoundRoute&&a.push(this.options.notFoundRoute);s?.parentRoute;)s=s.parentRoute,s&&a.unshift(s);const i=a.map((t=>{let e;if(t.options.parseParams)try{const e=t.options.parseParams(n);Object.assign(n,e)}catch(t){if(e=new Ot(t.message,{cause:t}),o?.throwOnError)throw e;return e}})),c=[];return a.forEach(((t,r)=>{const s=c[r-1],[a,l]=(()=>{const n=s?.search??e;try{const e="object"==typeof t.options.validateSearch?t.options.validateSearch.parse:t.options.validateSearch;let o=e?.(n)??{};return[{...n,...o},void 0]}catch(t){const e=new Mt(t.message,{cause:t});if(o?.throwOnError)throw e;return[n,e]}})(),u=t.options.loaderDeps?.({search:a})??"",h=u?JSON.stringify(u):"",d=ct(t.fullPath,n),f=ct(t.id,n,!0)+h,p=V(this.state,f),m=this.state.matches.find((t=>t.id===f))?"stay":"enter",y=!(!t.options.loader&&!Tt.some((e=>t.options[e]?.preload))),g=p?{...p,cause:m}:{id:f,routeId:t.id,params:n,pathname:et([this.basepath,d]),updatedAt:Date.now(),search:{},searchError:void 0,status:y?"pending":"success",showPending:!1,isFetching:!1,error:void 0,paramsError:i[r],loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchCount:0,cause:m,loaderDeps:u,invalid:!1,preload:!1};g.search=O(g.search,a),g.searchError=l,c.push(g)})),c};cancelMatch=t=>{V(this.state,t)?.abortController?.abort()};cancelMatches=()=>{this.state.pendingMatches?.forEach((t=>{this.cancelMatch(t.id)}))};buildLocation=t=>{const e=(t={},e)=>{const o=this.latestLocation,n=(this.state.pendingMatches||this.state.matches).at(-1)?.search||o.search,r=t.from??o.pathname;let s=this.resolvePathWithBase(r,`${t.to??""}`);const a=this.matchRoutes(r,n),i=e?.filter((t=>a?.find((e=>e.routeId===t.routeId)))),c={...C(a)?.params};let l=!0===(t.params??!0)?c:T(t.params,c);l&&e?.map((t=>this.looseRoutesById[t.routeId].options.stringifyParams)).filter(Boolean).forEach((t=>{l={...l,...t(l)}})),s=ct(s,l??{});const u=i?.map((t=>this.looseRoutesById[t.routeId].options.preSearchFilters??[])).flat().filter(Boolean)??[],h=i?.map((t=>this.looseRoutesById[t.routeId].options.postSearchFilters??[])).flat().filter(Boolean)??[],d=u?.length?u?.reduce(((t,e)=>e(t)),n):n,f=!0===t.search?d:t.search?T(t.search,d)??{}:u?.length?d:{},p=O(n,h?.length?h.reduce(((t,e)=>e(t)),f):f),m=this.options.stringifySearch(p),y=!0===t.hash?o.hash:t.hash?T(t.hash,o.hash):o.hash,g=y?`#${y}`:"";let v=!0===t.state?o.state:t.state?T(t.state,o.state):o.state;return v=O(o.state,v),{pathname:s,search:p,searchStr:m,state:v,hash:y,href:`${s}${m}${g}`,unmaskOnReload:t.unmaskOnReload}},o=(t={},o)=>{let n=e(t),r=o?e(o):void 0;if(!r){let t={},s=this.options.routeMasks?.find((e=>{const o=lt(this.basepath,n.pathname,{to:e.from,caseSensitive:!1,fuzzy:!1});return!!o&&(t=o,!0)}));s&&(s={...s,from:ct(s.from,t)},r=e(o=s))}const s=this.matchRoutes(n.pathname,n.search),a=r?this.matchRoutes(r.pathname,r.search):void 0,i=r?e(o,a):void 0,c=e(t,s);return i&&(c.maskedLocation=i),c};return t.mask?o(t,{...M(t,["from"]),...t.mask}):o(t)};commitLocation=async({startTransition:t,...e})=>{this.navigateTimeout&&clearTimeout(this.navigateTimeout);if(!(this.latestLocation.href===e.href)||!e.replace){let{maskedLocation:o,...n}=e;o&&(n={...o,state:{...o.state,__tempKey:void 0,__tempLocation:{...n,search:n.searchStr,state:{...n.state,__tempKey:void 0,__tempLocation:void 0,key:void 0}}}},(n.unmaskOnReload??this.options.unmaskOnReload)&&(n.state.__tempKey=this.tempLocationKey));const r=()=>{this.history[e.replace?"replace":"push"](n.href,n.state)};t??1?this.startReactTransition(r):r()}return this.resetNextScroll=e.resetScroll??!0,this.latestLoadPromise};buildAndCommitLocation=({replace:t,resetScroll:e,startTransition:o,...n}={})=>{const r=this.buildLocation(n);return this.commitLocation({...r,startTransition:o,replace:t,resetScroll:e})};navigate=({from:t,to:e="",...o})=>{const n=String(e),r=void 0===t?t:String(t);let s;try{new URL(`${n}`),s=!0}catch(t){}return g(!s),this.buildAndCommitLocation({...o,from:r,to:n})};loadMatches=async({checkLatest:t,matches:e,preload:o})=>{let n,r;const s=t=>{const e=this.state.pendingMatches?.find((e=>e.id===t.id)),o=this.state.matches.find((e=>e.id===t.id)),n=e?"pendingMatches":o?"matches":"cachedMatches";this.__store.setState((e=>({...e,[n]:e[n]?.map((e=>e.id===t.id?t:e))})))};try{for(let[t,n]of e.entries()){const s=e[t-1],a=this.looseRoutesById[n.routeId],i=new AbortController,c=(o,s)=>{if(o.routerCode=s,r=r??t,Et(o))throw o;try{a.options.onError?.(o)}catch(t){if(o=t,Et(t))throw t}e[t]=n={...n,error:o,status:"error",updatedAt:Date.now(),abortController:new AbortController}};try{n.paramsError&&c(n.paramsError,"PARSE_PARAMS"),n.searchError&&c(n.searchError,"VALIDATE_SEARCH");const r=s?.context??this.options.context??{},l=await(a.options.beforeLoad?.({search:n.search,abortController:i,params:n.params,preload:!!o,context:r,location:this.state.location,navigate:t=>this.navigate({...t,from:n.pathname}),buildLocation:this.buildLocation,cause:o?"preload":n.cause}))??{};if(Et(l))throw l;const u={...r,...l};e[t]=n={...n,routeContext:O(n.routeContext,l),context:O(n.context,u),abortController:i}}catch(t){c(t,"BEFORE_LOAD");break}}}catch(t){if(Et(t))return o||this.navigate(t),e;throw t}const a=e.slice(0,r),i=[];return a.forEach(((r,a)=>{i.push(new Promise((async c=>{const l=i[a-1],u=this.looseRoutesById[r.routeId],h=t=>!!Et(t)&&(o||this.navigate(t),!0);let d;e[a]=r={...r,showPending:!1};let f=!1;const p=u.options.pendingMs??this.options.defaultPendingMs,m=u.options.pendingMinMs??this.options.defaultPendingMinMs,y=!o&&p&&(u.options.pendingComponent??this.options.defaultPendingComponent),g={params:r.params,deps:r.loaderDeps,preload:!!o,parentMatchPromise:l,abortController:r.abortController,context:r.context,location:this.state.location,navigate:t=>this.navigate({...t,from:r.pathname}),cause:o?"preload":r.cause},v=async()=>{if(r.isFetching)d=V(this.state,r.id)?.loadPromise;else{r.fetchCount&&"success"===r.status&&c(),e[a]=r={...r,isFetching:!0,fetchCount:r.fetchCount+1};const t=Promise.all(Tt.map((async t=>{const e=u.options[t];e?.preload&&await e.preload()}))),o=u.options.loader?.(g);d=Promise.all([t,o]).then((t=>t[1]))}e[a]=r={...r,loadPromise:d},s(r);try{const o=await d;if(n=t())return await n;if(Et(o)&&h(o))return;if(f&&m&&await new Promise((t=>setTimeout(t,m))),n=t())return await n;e[a]=r={...r,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:o,loadPromise:void 0}}catch(o){if(n=t())return await n;if(h(o))return;try{u.options.onError?.(o)}catch(t){if(o=t,h(t))return}e[a]=r={...r,error:o,status:"error",isFetching:!1}}s(r)},w=Date.now()-r.updatedAt;let _,b=o?u.options.preloadStaleTime??this.options.defaultPreloadStaleTime??3e4:u.options.staleTime??this.options.defaultStaleTime??0;const S=u.options.shouldReload;_="function"==typeof S?S(g):S,e[a]=r={...r,preload:!!o&&!this.state.matches.find((t=>t.id===r.id))},"success"!==r.status?(y&&new Promise((t=>setTimeout(t,p))).then((async()=>{if(n=t())return n;f=!0,e[a]=r={...r,showPending:!0},s(r),c()})),await v()):(r.invalid||(_??w>b))&&v(),c()})))})),await Promise.all(i),e};invalidate=()=>{const t=t=>({...t,invalid:!0});this.__store.setState((e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)}))),this.load()};load=async()=>{const t=new Promise((async(e,o)=>{const n=this.latestLocation,r=this.state.resolvedLocation,s=r.href!==n.href;let a,i;this.cancelMatches(),this.emit({type:"onBeforeLoad",fromLocation:r,toLocation:n,pathChanged:s});const c=this.state.matches;this.__store.batch((()=>{this.cleanCache(),i=this.matchRoutes(n.pathname,n.search,{debug:!0}),this.__store.setState((t=>({...t,isLoading:!0,location:n,pendingMatches:i,cachedMatches:t.cachedMatches.filter((t=>!i.find((e=>e.id===t.id))))})))}));try{try{await this.loadMatches({matches:i,checkLatest:()=>this.checkLatest(t)})}catch(t){}if(a=this.checkLatest(t))return a;const o=c.filter((t=>!i.find((e=>e.id===t.id)))),l=i.filter((t=>!c.find((e=>e.id===t.id)))),u=c.filter((t=>i.find((e=>e.id===t.id))));this.__store.batch((()=>{this.__store.setState((t=>({...t,isLoading:!1,matches:t.pendingMatches,pendingMatches:void 0,cachedMatches:[...t.cachedMatches,...o.filter((t=>"error"!==t.status))]}))),this.cleanCache()})),[[o,"onLeave"],[l,"onEnter"],[u,"onStay"]].forEach((([t,e])=>{t.forEach((t=>{this.looseRoutesById[t.routeId].options[e]?.(t)}))})),this.emit({type:"onLoad",fromLocation:r,toLocation:n,pathChanged:s}),e()}catch(e){if(a=this.checkLatest(t))return a;o(e)}}));return this.latestLoadPromise=t,this.latestLoadPromise};cleanCache=()=>{this.__store.setState((t=>({...t,cachedMatches:t.cachedMatches.filter((t=>{const e=this.looseRoutesById[t.routeId];if(!e.options.loader)return!1;const o=(t.preload?e.options.preloadGcTime??this.options.defaultPreloadGcTime:e.options.gcTime??this.options.defaultGcTime)??3e5;return"error"!==t.status&&Date.now()-t.updatedAt<o}))})))};preloadRoute=async(t=this.state.location)=>{let e=this.buildLocation(t),o=this.matchRoutes(e.pathname,e.search,{throwOnError:!0});const n=Object.fromEntries([...this.state.matches,...this.state.pendingMatches??[],...this.state.cachedMatches]?.map((t=>[t.id,!0])));return this.__store.batch((()=>{o.forEach((t=>{n[t.id]||this.__store.setState((e=>({...e,cachedMatches:[...e.cachedMatches,t]})))}))})),o=await this.loadMatches({matches:o,preload:!0,checkLatest:()=>{}}),o};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0};const o=this.buildLocation(t);if(e?.pending&&"pending"!==this.state.status)return!1;const n=e?.pending?this.latestLocation:this.state.resolvedLocation;if(!n)return!1;const r=lt(this.basepath,n.pathname,{...e,to:o.pathname});return!!r&&(r&&(e?.includeSearch??1)?!!D(n.search,o.search,!0)&&r:r)};injectHtml=async t=>{this.injectedHtml.push(t)};dehydrateData=(t,e)=>{if("undefined"==typeof document){const o="string"==typeof t?t:JSON.stringify(t);return this.injectHtml((async()=>{const t=`__TSR_DEHYDRATED__${o}`,n="function"==typeof e?await e():e;return`<script id='${t}' suppressHydrationWarning>window["__TSR_DEHYDRATED__${$(o)}"] = ${JSON.stringify(n)}\n ;(() => {\n var el = document.getElementById('${t}')\n el.parentElement.removeChild(el)\n })()\n <\/script>`})),()=>this.hydrateData(t)}return()=>{}};hydrateData=t=>{if("undefined"!=typeof document){const e="string"==typeof t?t:JSON.stringify(t);return window[`__TSR_DEHYDRATED__${e}`]}};dehydrate=()=>({state:{dehydratedMatches:this.state.matches.map((t=>M(t,["id","status","updatedAt","loaderData"])))}});hydrate=async t=>{let e=t;"undefined"!=typeof document&&(e=window.__TSR_DEHYDRATED__),g(e);const o=e;this.dehydratedData=o.payload,this.options.hydrate?.(o.payload);const n=o.router.state;let r=this.matchRoutes(this.state.location.pathname,this.state.location.search).map((t=>{const e=n.dehydratedMatches.find((e=>e.id===t.id));return g(e,t.id),e?{...t,...e}:t}));this.__store.setState((t=>({...t,matches:r})))}},t.RouterProvider=function({router:e,...o}){e.update({...e.options,...o,context:{...e.options.context,...o?.context}});const n=e.options.InnerWrap?r.createElement(e.options.InnerWrap,null,r.createElement(A,null)):r.createElement(A,null),s=r.createElement(t.routerContext.Provider,{value:e},n,r.createElement(q,null));return e.options.Wrap?r.createElement(e.options.Wrap,null,s):s},t.ScrollRestoration=function(t){return Nt(t),null},t.SearchParamError=Mt,t.cleanPath=ot,t.componentTypes=Tt,t.createBrowserHistory=d,t.createHashHistory=function(t){const e=t?.window??("undefined"!=typeof document?window:void 0);return d({window:e,parseLocation:()=>p(e.location.hash.split("#").slice(1).join("#")??"/",e.history.state),createHref:t=>`${e.location.pathname}${e.location.search}#${t}`})},t.createHistory=u,t.createMemoryHistory=f,t.createRouteMask=function(t){return t},t.decode=Rt,t.deepEqual=D,t.defaultParseSearch=Lt,t.defaultStringifySearch=Pt,t.defer=function(t){const e=t;if(!e.__deferredState){e.__deferredState={uid:Math.random().toString(36).slice(2),status:"pending"};const t=e.__deferredState;e.then((e=>{t.status="success",t.data=e})).catch((e=>{t.status="error",t.error=e}))}return e},t.encode=bt,t.escapeJSON=$,t.functionalUpdate=T,t.getInitialRouterState=kt,t.getRouteMatch=V,t.interpolatePath=ct,t.invariant=g,t.isDehydratedDeferred=Z,t.isPlainObject=k,t.isRedirect=Et,t.isServer=x,t.joinPaths=et,t.last=C,t.lazyFn=function(t,e){return async(...o)=>(await t())[e||"default"](...o)},t.lazyRouteComponent=function(t,e){let o;const n=()=>(o||(o=t()),o),s=r.lazy((async()=>({default:(await n())[e??"default"]})));return s.preload=n,s},t.matchByPath=ht,t.matchContext=B,t.matchPathname=lt,t.parsePathname=it,t.parseSearchWith=xt,t.pick=M,t.redirect=function(t){if(t.isRedirect=!0,t.throw)throw t;return t},t.removeBasepath=ut,t.replaceEqualDeep=O,t.resolvePath=at,t.rootRouteId=pt,t.rootRouteWithContext=function(){return t=>new yt(t)},t.shallow=function(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!1;for(let n=0;n<o.length;n++)if(!Object.prototype.hasOwnProperty.call(e,o[n])||!Object.is(t[o[n]],e[o[n]]))return!1;return!0},t.stringifySearchWith=Ct,t.trimPath=st,t.trimPathLeft=nt,t.trimPathRight=rt,t.useAwaited=tt,t.useBlocker=Ft,t.useElementScrollRestoration=function(t){const e=Q(),o=t?.getKey||At;let n="";if(t.id)n=`[data-scroll-restoration-id="${t.id}"]`;else{const e=t.getElement?.();if(!e)return;n=Ht(e)}const r=[o(e.latestLocation),n].join(jt);return Bt.state.cached[r]},t.useLayoutEffect=j,t.useLinkProps=wt,t.useLoaderData=X,t.useLoaderDeps=J,t.useMatch=z,t.useMatchRoute=W,t.useMatches=Y,t.useNavigate=function(t){const{navigate:e}=Q(),o=z({strict:!1,select:t=>t.pathname});return r.useCallback((n=>e({from:n?.to?o:void 0,...t,...n})),[])},t.useParams=dt,t.useParentMatches=function(t){const e=r.useContext(B);return Y({select:o=>(o=o.slice(o.findIndex((t=>t.id===e))),t?.select?t.select(o):o)})},t.useRouteContext=function(t){return z({...t,select:e=>t?.select?t.select(e.context):e.context})},t.useRouter=Q,t.useRouterState=G,t.useScrollRestoration=Nt,t.useSearch=ft,t.useStableCallback=function(t){const e=r.useRef(t);return e.current=t,r.useRef(((...t)=>e.current(...t))).current},t.warning=function(t,e){}}));
|
|
42
22
|
//# sourceMappingURL=index.production.js.map
|