@coffre/ui 0.1.18 → 0.2.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/README.md +23 -3
- package/dist/{server/_coffre/assets/affordances-CKANXDTG.js → chunks/affordances-DAvsVz7u.js} +12 -7
- package/dist/chunks/affordances-DAvsVz7u.js.map +1 -0
- package/dist/chunks/directory-CSjWWUQ1.js +370 -0
- package/dist/chunks/directory-CSjWWUQ1.js.map +1 -0
- package/dist/{server/_coffre/assets/grants-DdKT11Ny.js → chunks/grants-saMQagmG.js} +41 -39
- package/dist/chunks/grants-saMQagmG.js.map +1 -0
- package/dist/chunks/icons-D-PfAfnH.js +203 -0
- package/dist/chunks/icons-D-PfAfnH.js.map +1 -0
- package/dist/chunks/mounted-jJmqqV_n.js +17 -0
- package/dist/chunks/mounted-jJmqqV_n.js.map +1 -0
- package/dist/{server/_coffre/assets/offboarding-CRz-K82H.js → chunks/offboarding-C6l30DZR.js} +70 -69
- package/dist/chunks/offboarding-C6l30DZR.js.map +1 -0
- package/dist/chunks/page-C5HcNqf2.js +190 -0
- package/dist/chunks/page-C5HcNqf2.js.map +1 -0
- package/dist/chunks/page-route-Drfw7lmn.js +20 -0
- package/dist/chunks/page-route-Drfw7lmn.js.map +1 -0
- package/dist/{server/_coffre/assets/principal-page-C-EFwJQw.js → chunks/principal-page-D_91OA0l.js} +105 -103
- package/dist/chunks/principal-page-D_91OA0l.js.map +1 -0
- package/dist/{server/_coffre/assets → chunks}/project-environments-lEzFHUt4.js +2 -0
- package/dist/chunks/project-environments-lEzFHUt4.js.map +1 -0
- package/dist/chunks/queries-CQ81o4so.js +376 -0
- package/dist/chunks/queries-CQ81o4so.js.map +1 -0
- package/dist/{server/_coffre/assets/row-state-C2P57xT1.js → chunks/row-state-0PsrEzOL.js} +22 -21
- package/dist/chunks/row-state-0PsrEzOL.js.map +1 -0
- package/dist/{server/_coffre/assets → chunks}/signin-errors-BEFlVDbQ.js +2 -0
- package/dist/chunks/signin-errors-BEFlVDbQ.js.map +1 -0
- package/dist/chunks/theme-B2vQolVR.js +86 -0
- package/dist/chunks/theme-B2vQolVR.js.map +1 -0
- package/dist/chunks/ui-DixXLQvQ.js +405 -0
- package/dist/chunks/ui-DixXLQvQ.js.map +1 -0
- package/dist/{server/_coffre/assets/use-action-B-xpvVRO.js → chunks/use-action-CWsg_YWU.js} +8 -6
- package/dist/chunks/use-action-CWsg_YWU.js.map +1 -0
- package/dist/{server/_coffre/assets/use-change-C8BCf3oU.js → chunks/use-change-c6CeLRin.js} +10 -474
- package/dist/chunks/use-change-c6CeLRin.js.map +1 -0
- package/dist/chunks/use-shell-jxd7Tzd-.js +26 -0
- package/dist/chunks/use-shell-jxd7Tzd-.js.map +1 -0
- package/dist/{server/_coffre/assets → chunks}/validation-BQtqPe2V.js +2 -0
- package/dist/chunks/validation-BQtqPe2V.js.map +1 -0
- package/dist/index.d.ts +386 -18
- package/dist/index.js +1147 -0
- package/dist/index.js.map +1 -0
- package/dist/pages/account.d.ts +9 -0
- package/dist/pages/account.js +334 -0
- package/dist/pages/account.js.map +1 -0
- package/dist/pages/audit.d.ts +3 -0
- package/dist/{server/_coffre/assets/audit-qB9G2AQJ.js → pages/audit.js} +102 -100
- package/dist/pages/audit.js.map +1 -0
- package/dist/pages/device-login.d.ts +9 -0
- package/dist/pages/device-login.js +211 -0
- package/dist/pages/device-login.js.map +1 -0
- package/dist/pages/environment.d.ts +3 -0
- package/dist/{server/_coffre/assets/projects._project._environment-C6uybzeU.js → pages/environment.js} +323 -469
- package/dist/pages/environment.js.map +1 -0
- package/dist/pages/login.d.ts +10 -0
- package/dist/pages/login.js +104 -0
- package/dist/pages/login.js.map +1 -0
- package/dist/pages/project.d.ts +2 -0
- package/dist/{server/_coffre/assets/projects._project.index-3CXwkyTh.js → pages/project.js} +223 -225
- package/dist/pages/project.js.map +1 -0
- package/dist/pages/projects.d.ts +3 -0
- package/dist/{server/_coffre/assets/projects.index-iSoBpRFz.js → pages/projects.js} +83 -81
- package/dist/pages/projects.js.map +1 -0
- package/dist/pages/settings.d.ts +3 -0
- package/dist/{server/_coffre/assets/settings-BDQTF5XW.js → pages/settings.js} +20 -18
- package/dist/pages/settings.js.map +1 -0
- package/dist/pages/token.d.ts +3 -0
- package/dist/{server/_coffre/assets/tokens._token-CrBMpcbN.js → pages/token.js} +195 -265
- package/dist/pages/token.js.map +1 -0
- package/dist/pages/tokens.d.ts +3 -0
- package/dist/pages/tokens.js +39 -0
- package/dist/pages/tokens.js.map +1 -0
- package/dist/pages/unregistered.d.ts +8 -0
- package/dist/pages/unregistered.js +54 -0
- package/dist/pages/unregistered.js.map +1 -0
- package/dist/pages/user.d.ts +3 -0
- package/dist/pages/user.js +16 -0
- package/dist/pages/user.js.map +1 -0
- package/dist/pages/users.d.ts +3 -0
- package/dist/pages/users.js +39 -0
- package/dist/pages/users.js.map +1 -0
- package/dist/project-BqIy8gYR.d.ts +5 -0
- package/dist/vite.d.ts +16 -0
- package/dist/vite.js +52 -0
- package/package.json +36 -21
- package/src/assets/icon.svg +1 -0
- package/src/components/affordances.ts +10 -4
- package/src/components/command-palette.tsx +229 -203
- package/src/components/directory.tsx +34 -38
- package/src/components/principal.tsx +7 -3
- package/src/components/shell.tsx +89 -127
- package/src/components/theme.tsx +14 -81
- package/src/components/ui.tsx +97 -68
- package/src/index.ts +29 -0
- package/src/layout.tsx +113 -0
- package/src/lib/coffre.ts +8 -4
- package/src/lib/mounted.ts +13 -0
- package/src/lib/page-context.ts +31 -0
- package/src/lib/page-route.ts +22 -0
- package/src/lib/preferences.tsx +46 -0
- package/src/options.ts +240 -0
- package/src/{routes → pages}/account.tsx +7 -24
- package/src/{routes → pages}/audit.tsx +5 -16
- package/src/{routes/auth.device.tsx → pages/device-login.tsx} +8 -21
- package/src/{routes/projects.$project.$environment.tsx → pages/environment.tsx} +43 -52
- package/src/{routes → pages}/login.tsx +5 -16
- package/src/{routes/projects.$project.index.tsx → pages/project.tsx} +38 -50
- package/src/{routes/projects.index.tsx → pages/projects.tsx} +2 -7
- package/src/{routes → pages}/settings.tsx +3 -10
- package/src/{routes/tokens.$token.tsx → pages/token.tsx} +6 -7
- package/src/{routes/tokens.index.tsx → pages/tokens.tsx} +3 -8
- package/src/{routes → pages}/unregistered.tsx +1 -6
- package/src/pages/user.tsx +10 -0
- package/src/{routes/users.index.tsx → pages/users.tsx} +3 -8
- package/src/register.ts +55 -0
- package/src/router.tsx +31 -62
- package/src/styles/globals.css +104 -46
- package/src/vite.ts +78 -0
- package/dist/client/.assetsignore +0 -2
- package/dist/client/_coffre/assets/account-BoLGAxbD.js +0 -2
- package/dist/client/_coffre/assets/account-CnnuRTDB.js +0 -1
- package/dist/client/_coffre/assets/affordances-CEafRJcN.js +0 -1
- package/dist/client/_coffre/assets/audit-CHSvKLWX.js +0 -1
- package/dist/client/_coffre/assets/audit-Cn4hmS4u.js +0 -2
- package/dist/client/_coffre/assets/auth.device-Co5vrpaA.js +0 -2
- package/dist/client/_coffre/assets/auth.device-DAlqWacc.js +0 -1
- package/dist/client/_coffre/assets/directory-H8Eh3MnS.js +0 -1
- package/dist/client/_coffre/assets/dist-Braunv_x.js +0 -1
- package/dist/client/_coffre/assets/globals-CpMrgkV6.css +0 -1
- package/dist/client/_coffre/assets/grants-DPDxJXU1.js +0 -1
- package/dist/client/_coffre/assets/icons-Dc_-t0lp.js +0 -1
- package/dist/client/_coffre/assets/index-sUCIXRgJ.js +0 -12
- package/dist/client/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/client/_coffre/assets/link-DBINMwm6.js +0 -1
- package/dist/client/_coffre/assets/login-BZFYfL1Y.js +0 -1
- package/dist/client/_coffre/assets/login-CYCKWTOD.js +0 -2
- package/dist/client/_coffre/assets/offboarding-Bwpftp3g.js +0 -1
- package/dist/client/_coffre/assets/page-C_hnzdaR.js +0 -1
- package/dist/client/_coffre/assets/preload-helper-CLkO85Nq.js +0 -1
- package/dist/client/_coffre/assets/principal-page-DLho8TSJ.js +0 -1
- package/dist/client/_coffre/assets/project-environments-CfIH5kFM.js +0 -1
- package/dist/client/_coffre/assets/projects._project._environment-DHRRvQw0.js +0 -3
- package/dist/client/_coffre/assets/projects._project._environment-TLI-RjBZ.js +0 -2
- package/dist/client/_coffre/assets/projects._project.index-BO-8FZIY.js +0 -2
- package/dist/client/_coffre/assets/projects._project.index-DGl921dP.js +0 -1
- package/dist/client/_coffre/assets/projects.index-BDn7Bhoo.js +0 -1
- package/dist/client/_coffre/assets/row-state-DJ-KLamZ.js +0 -1
- package/dist/client/_coffre/assets/settings-q9G1QvR_.js +0 -1
- package/dist/client/_coffre/assets/signin-errors-CroZWZgm.js +0 -1
- package/dist/client/_coffre/assets/suspense-O8sP0mEC.js +0 -1
- package/dist/client/_coffre/assets/tokens._token-B_qczpT9.js +0 -2
- package/dist/client/_coffre/assets/tokens._token-T-sqwMbz.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-CcXSZnAG.js +0 -1
- package/dist/client/_coffre/assets/ui-BXP2IqrW.js +0 -46
- package/dist/client/_coffre/assets/unregistered-D2JXJ90x.js +0 -1
- package/dist/client/_coffre/assets/use-action-BpzKWhgg.js +0 -1
- package/dist/client/_coffre/assets/use-change-CKj3Inq9.js +0 -1
- package/dist/client/_coffre/assets/use-shell-W0SusPkz.js +0 -1
- package/dist/client/_coffre/assets/useQuery-B-lxFSES.js +0 -1
- package/dist/client/_coffre/assets/useSuspenseQuery-BZ-nzHST.js +0 -1
- package/dist/client/_coffre/assets/users._user-Bb3BGYHl.js +0 -1
- package/dist/client/_coffre/assets/users._user-DXmvKrzE.js +0 -2
- package/dist/client/_coffre/assets/users.index-BvzP3qwW.js +0 -1
- package/dist/client/_coffre/assets/validation-9Cl_XS-l.js +0 -1
- package/dist/server/.vite/manifest.json +0 -668
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-GsKnGGRy.js +0 -162
- package/dist/server/_coffre/assets/account-CV-a2IU2.js +0 -329
- package/dist/server/_coffre/assets/account-hk6wcIXU.js +0 -162
- package/dist/server/_coffre/assets/async-local-storage-C10uQtMM.js +0 -3108
- package/dist/server/_coffre/assets/audit-C1_Ej6YB.js +0 -31
- package/dist/server/_coffre/assets/auth.device-6JRrWbSV.js +0 -210
- package/dist/server/_coffre/assets/auth.device-CLoAxC2T.js +0 -29
- package/dist/server/_coffre/assets/directory-B-_rqsPx.js +0 -371
- package/dist/server/_coffre/assets/dist-CnnV3t2g.js +0 -908
- package/dist/server/_coffre/assets/empty-plugin-adapters-Cq4--YW-.js +0 -5
- package/dist/server/_coffre/assets/globals-CpMrgkV6.css +0 -1
- package/dist/server/_coffre/assets/icons-DOFT-eWB.js +0 -1704
- package/dist/server/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/server/_coffre/assets/lazyRouteComponent-CqBNCGuZ.js +0 -480
- package/dist/server/_coffre/assets/link-42ZWdjzZ.js +0 -422
- package/dist/server/_coffre/assets/login-DRKUKkaW.js +0 -22
- package/dist/server/_coffre/assets/login-DnwxVl4Y.js +0 -102
- package/dist/server/_coffre/assets/matchContext-qLfYbC6_.js +0 -56
- package/dist/server/_coffre/assets/page-D6n45dcK.js +0 -3561
- package/dist/server/_coffre/assets/projects._project._environment-CS8DdSMY.js +0 -48
- package/dist/server/_coffre/assets/projects._project.index-BGfcNpj0.js +0 -23
- package/dist/server/_coffre/assets/react-dom-bBoJXlK2.js +0 -1718
- package/dist/server/_coffre/assets/router-9BTgJhWG.js +0 -2322
- package/dist/server/_coffre/assets/start-DR3rN0St.js +0 -4
- package/dist/server/_coffre/assets/suspense-C-2QfDd2.js +0 -602
- package/dist/server/_coffre/assets/tokens._token-rY86Cjgp.js +0 -10
- package/dist/server/_coffre/assets/tokens.index-Bq5qDW9q.js +0 -37
- package/dist/server/_coffre/assets/ui-Cc0CGMtr.js +0 -14881
- package/dist/server/_coffre/assets/unregistered-D9ZKLOPJ.js +0 -53
- package/dist/server/_coffre/assets/use-shell-DwOzEi87.js +0 -462
- package/dist/server/_coffre/assets/useQuery-CTe86qFq.js +0 -8
- package/dist/server/_coffre/assets/useRouter-CaUSUNsw.js +0 -473
- package/dist/server/_coffre/assets/useSuspenseQuery-CSoHzrMb.js +0 -117
- package/dist/server/_coffre/assets/users._user-BmLKYeo_.js +0 -10
- package/dist/server/_coffre/assets/users._user-BmiHwQx3.js +0 -14
- package/dist/server/_coffre/assets/users.index-BiEax90r.js +0 -37
- package/dist/server/index.js +0 -13911
- package/src/assets/favicon-32.png +0 -0
- package/src/components/agentation.tsx +0 -34
- package/src/entry.ts +0 -19
- package/src/routeTree.gen.ts +0 -367
- package/src/routes/__root.tsx +0 -169
- package/src/routes/access.tsx +0 -11
- package/src/routes/index.tsx +0 -15
- package/src/routes/users.$user.tsx +0 -13
- package/src/types.ts +0 -21
|
@@ -1,1718 +0,0 @@
|
|
|
1
|
-
import { a as __commonJSMin, i as require_react, r as require_jsx_runtime, s as __toESM } from "./useRouter-CaUSUNsw.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/utils.js
|
|
3
|
-
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
4
|
-
/**
|
|
5
|
-
* React.use if available (React 19+), undefined otherwise.
|
|
6
|
-
* Use dynamic lookup to avoid Webpack compilation errors with React 18.
|
|
7
|
-
*/
|
|
8
|
-
var reactUse = import_react.use;
|
|
9
|
-
var useLayoutEffect = typeof window !== "undefined" ? import_react.useLayoutEffect : import_react.useEffect;
|
|
10
|
-
/**
|
|
11
|
-
* Taken from https://www.developerway.com/posts/implementing-advanced-use-previous-hook#part3
|
|
12
|
-
*/
|
|
13
|
-
function usePrevious(value) {
|
|
14
|
-
const ref = import_react.useRef({
|
|
15
|
-
value,
|
|
16
|
-
prev: null
|
|
17
|
-
});
|
|
18
|
-
const current = ref.current.value;
|
|
19
|
-
if (value !== current) ref.current = {
|
|
20
|
-
value,
|
|
21
|
-
prev: current
|
|
22
|
-
};
|
|
23
|
-
return ref.current.prev;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* React hook to wrap `IntersectionObserver`.
|
|
27
|
-
*
|
|
28
|
-
* This hook will create an `IntersectionObserver` and observe the ref passed to it.
|
|
29
|
-
*
|
|
30
|
-
* When the intersection changes, the callback will be called with the `IntersectionObserverEntry`.
|
|
31
|
-
*
|
|
32
|
-
* @param ref - The ref to observe
|
|
33
|
-
* @param intersectionObserverOptions - The options to pass to the IntersectionObserver
|
|
34
|
-
* @param options - The options to pass to the hook
|
|
35
|
-
* @param callback - The callback to call when the intersection changes
|
|
36
|
-
* @returns The IntersectionObserver instance
|
|
37
|
-
* @example
|
|
38
|
-
* ```tsx
|
|
39
|
-
* const MyComponent = () => {
|
|
40
|
-
* const ref = React.useRef<HTMLDivElement>(null)
|
|
41
|
-
* useIntersectionObserver(
|
|
42
|
-
* ref,
|
|
43
|
-
* (entry) => { doSomething(entry) },
|
|
44
|
-
* { rootMargin: '10px' },
|
|
45
|
-
* { disabled: false }
|
|
46
|
-
* )
|
|
47
|
-
* return <div ref={ref} />
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, options = {}) {
|
|
51
|
-
import_react.useEffect(() => {
|
|
52
|
-
if (!ref.current || options.disabled || typeof IntersectionObserver !== "function") return;
|
|
53
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
54
|
-
callback(entry);
|
|
55
|
-
}, intersectionObserverOptions);
|
|
56
|
-
observer.observe(ref.current);
|
|
57
|
-
return () => {
|
|
58
|
-
observer.disconnect();
|
|
59
|
-
};
|
|
60
|
-
}, [
|
|
61
|
-
callback,
|
|
62
|
-
intersectionObserverOptions,
|
|
63
|
-
options.disabled,
|
|
64
|
-
ref
|
|
65
|
-
]);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* React hook to take a `React.ForwardedRef` and returns a `ref` that can be used on a DOM element.
|
|
69
|
-
*
|
|
70
|
-
* @param ref - The forwarded ref
|
|
71
|
-
* @returns The inner ref returned by `useRef`
|
|
72
|
-
* @example
|
|
73
|
-
* ```tsx
|
|
74
|
-
* const MyComponent = React.forwardRef((props, ref) => {
|
|
75
|
-
* const innerRef = useForwardedRef(ref)
|
|
76
|
-
* return <div ref={innerRef} />
|
|
77
|
-
* })
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
function useForwardedRef(ref) {
|
|
81
|
-
const innerRef = import_react.useRef(null);
|
|
82
|
-
import_react.useImperativeHandle(ref, () => innerRef.current, []);
|
|
83
|
-
return innerRef;
|
|
84
|
-
}
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.15/node_modules/@tanstack/router-core/dist/esm/utils.js
|
|
87
|
-
/**
|
|
88
|
-
* Return the last element of an array.
|
|
89
|
-
* Intended for non-empty arrays used within router internals.
|
|
90
|
-
*/
|
|
91
|
-
function last(arr) {
|
|
92
|
-
return arr[arr.length - 1];
|
|
93
|
-
}
|
|
94
|
-
function isFunction(d) {
|
|
95
|
-
return typeof d === "function";
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Apply a value-or-updater to a previous value.
|
|
99
|
-
* Accepts either a literal value or a function of the previous value.
|
|
100
|
-
*/
|
|
101
|
-
function functionalUpdate(updater, previous) {
|
|
102
|
-
if (isFunction(updater)) return updater(previous);
|
|
103
|
-
return updater;
|
|
104
|
-
}
|
|
105
|
-
var hasOwn = Object.prototype.hasOwnProperty;
|
|
106
|
-
function hasKeys(obj) {
|
|
107
|
-
for (const key in obj) if (hasOwn.call(obj, key)) return true;
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
var createNull = () => Object.create(null);
|
|
111
|
-
var nullReplaceEqualDeep = (prev, next) => replaceEqualDeep(prev, next, createNull);
|
|
112
|
-
/**
|
|
113
|
-
* This function returns `prev` if `_next` is deeply equal.
|
|
114
|
-
* If not, it will replace any deeply equal children of `b` with those of `a`.
|
|
115
|
-
* This can be used for structural sharing between immutable JSON values for example.
|
|
116
|
-
* Do not use this with signals
|
|
117
|
-
*/
|
|
118
|
-
function replaceEqualDeep(prev, _next, _makeObj = () => ({}), _depth = 0) {
|
|
119
|
-
return _next;
|
|
120
|
-
}
|
|
121
|
-
function isPlainObject(o) {
|
|
122
|
-
if (!hasObjectPrototype(o)) return false;
|
|
123
|
-
const ctor = o.constructor;
|
|
124
|
-
if (typeof ctor === "undefined") return true;
|
|
125
|
-
const prot = ctor.prototype;
|
|
126
|
-
if (!hasObjectPrototype(prot)) return false;
|
|
127
|
-
if (!prot.hasOwnProperty("isPrototypeOf")) return false;
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
function hasObjectPrototype(o) {
|
|
131
|
-
return Object.prototype.toString.call(o) === "[object Object]";
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Perform a deep equality check with options for partial comparison and
|
|
135
|
-
* ignoring `undefined` values. Optimized for router state comparisons.
|
|
136
|
-
*/
|
|
137
|
-
function deepEqual(a, b, opts) {
|
|
138
|
-
if (a === b) return true;
|
|
139
|
-
if (typeof a !== typeof b) return false;
|
|
140
|
-
if (Array.isArray(a) && Array.isArray(b)) {
|
|
141
|
-
if (a.length !== b.length) return false;
|
|
142
|
-
for (let i = 0, l = a.length; i < l; i++) if (!deepEqual(a[i], b[i], opts)) return false;
|
|
143
|
-
return true;
|
|
144
|
-
}
|
|
145
|
-
if (isPlainObject(a) && isPlainObject(b)) {
|
|
146
|
-
const ignoreUndefined = opts?.ignoreUndefined ?? true;
|
|
147
|
-
if (opts?.partial) {
|
|
148
|
-
for (const k in b) if (!ignoreUndefined || b[k] !== void 0) {
|
|
149
|
-
if (!deepEqual(a[k], b[k], opts)) return false;
|
|
150
|
-
}
|
|
151
|
-
return true;
|
|
152
|
-
}
|
|
153
|
-
let aCount = 0;
|
|
154
|
-
if (!ignoreUndefined) aCount = Object.keys(a).length;
|
|
155
|
-
else for (const k in a) if (a[k] !== void 0) aCount++;
|
|
156
|
-
let bCount = 0;
|
|
157
|
-
for (const k in b) if (!ignoreUndefined || b[k] !== void 0) {
|
|
158
|
-
bCount++;
|
|
159
|
-
if (bCount > aCount || !deepEqual(a[k], b[k], opts)) return false;
|
|
160
|
-
}
|
|
161
|
-
return aCount === bCount;
|
|
162
|
-
}
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Create a promise with exposed resolve/reject and status fields.
|
|
167
|
-
* Useful for coordinating async router lifecycle operations.
|
|
168
|
-
*/
|
|
169
|
-
function createControlledPromise(onResolve) {
|
|
170
|
-
let resolveLoadPromise;
|
|
171
|
-
let rejectLoadPromise;
|
|
172
|
-
const controlledPromise = new Promise((resolve, reject) => {
|
|
173
|
-
resolveLoadPromise = resolve;
|
|
174
|
-
rejectLoadPromise = reject;
|
|
175
|
-
});
|
|
176
|
-
controlledPromise.status = "pending";
|
|
177
|
-
controlledPromise.resolve = (value) => {
|
|
178
|
-
controlledPromise.status = "resolved";
|
|
179
|
-
controlledPromise.value = value;
|
|
180
|
-
resolveLoadPromise(value);
|
|
181
|
-
onResolve?.(value);
|
|
182
|
-
};
|
|
183
|
-
controlledPromise.reject = (e) => {
|
|
184
|
-
controlledPromise.status = "rejected";
|
|
185
|
-
rejectLoadPromise(e);
|
|
186
|
-
};
|
|
187
|
-
return controlledPromise;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Heuristically detect dynamic import "module not found" errors
|
|
191
|
-
* across major browsers for lazy route component handling.
|
|
192
|
-
*/
|
|
193
|
-
function isModuleNotFoundError(error) {
|
|
194
|
-
if (typeof error?.message !== "string") return false;
|
|
195
|
-
return error.message.startsWith("Failed to fetch dynamically imported module") || error.message.startsWith("error loading dynamically imported module") || error.message.startsWith("Importing a module script failed");
|
|
196
|
-
}
|
|
197
|
-
function isPromise(value) {
|
|
198
|
-
return Boolean(value && typeof value === "object" && typeof value.then === "function");
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Re-encode characters that are unsafe in URL paths.
|
|
202
|
-
* Includes ASCII control characters (0x00-0x1F, 0x7F) and a subset of the
|
|
203
|
-
* WHATWG URL "path percent-encode set" (", <, >, `, {, }).
|
|
204
|
-
*
|
|
205
|
-
* Space (0x20) is intentionally excluded — decodeURI decodes %20 to space
|
|
206
|
-
* and the router stores decoded spaces in location.pathname. The existing
|
|
207
|
-
* encodePathLikeUrl already handles re-encoding spaces for outgoing URLs.
|
|
208
|
-
*
|
|
209
|
-
* These characters are decoded by decodeURI but must remain percent-encoded
|
|
210
|
-
* in paths to match how upstream layers (CDNs, edge middleware, browsers)
|
|
211
|
-
* interpret the URL, preventing infinite redirect loops and path mismatches.
|
|
212
|
-
*/
|
|
213
|
-
var PATH_UNSAFE_RE = /[\x00-\x1f\x7f"<>`{}]/g;
|
|
214
|
-
function sanitizePathSegment(segment) {
|
|
215
|
-
return segment.replace(PATH_UNSAFE_RE, (ch) => "%" + ch.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0"));
|
|
216
|
-
}
|
|
217
|
-
function decodeSegment(segment) {
|
|
218
|
-
let decoded;
|
|
219
|
-
try {
|
|
220
|
-
decoded = decodeURI(segment);
|
|
221
|
-
} catch {
|
|
222
|
-
decoded = segment.replaceAll(/%[0-9A-F]{2}/gi, (match) => {
|
|
223
|
-
try {
|
|
224
|
-
return decodeURI(match);
|
|
225
|
-
} catch {
|
|
226
|
-
return match;
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
return sanitizePathSegment(decoded);
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Default list of URL protocols to allow in links, redirects, and navigation.
|
|
234
|
-
* Any absolute URL protocol not in this list is treated as dangerous by default.
|
|
235
|
-
*/
|
|
236
|
-
var DEFAULT_PROTOCOL_ALLOWLIST = [
|
|
237
|
-
"http:",
|
|
238
|
-
"https:",
|
|
239
|
-
"mailto:",
|
|
240
|
-
"tel:"
|
|
241
|
-
];
|
|
242
|
-
/**
|
|
243
|
-
* Check if a URL string uses a protocol that is not in the allowlist.
|
|
244
|
-
* Returns true for blocked protocols like javascript:, blob:, data:, etc.
|
|
245
|
-
*
|
|
246
|
-
* The URL constructor correctly normalizes:
|
|
247
|
-
* - Mixed case (JavaScript: → javascript:)
|
|
248
|
-
* - Whitespace/control characters (java\nscript: → javascript:)
|
|
249
|
-
* - Leading whitespace
|
|
250
|
-
*
|
|
251
|
-
* For relative URLs (no protocol), returns false (safe).
|
|
252
|
-
*
|
|
253
|
-
* @param url - The URL string to check
|
|
254
|
-
* @param allowlist - Set of protocols to allow
|
|
255
|
-
* @returns true if the URL uses a protocol that is not allowed
|
|
256
|
-
*/
|
|
257
|
-
function isDangerousProtocol(url, allowlist) {
|
|
258
|
-
if (!url) return false;
|
|
259
|
-
try {
|
|
260
|
-
const parsed = new URL(url);
|
|
261
|
-
return !allowlist.has(parsed.protocol);
|
|
262
|
-
} catch {
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
var HTML_ESCAPE_LOOKUP = {
|
|
267
|
-
"&": "\\u0026",
|
|
268
|
-
">": "\\u003e",
|
|
269
|
-
"<": "\\u003c",
|
|
270
|
-
"\u2028": "\\u2028",
|
|
271
|
-
"\u2029": "\\u2029"
|
|
272
|
-
};
|
|
273
|
-
var HTML_ESCAPE_REGEX = /[&><\u2028\u2029]/g;
|
|
274
|
-
/**
|
|
275
|
-
* Escape HTML special characters in a string to prevent XSS attacks
|
|
276
|
-
* when embedding strings in script tags during SSR.
|
|
277
|
-
*
|
|
278
|
-
* This is essential for preventing XSS vulnerabilities when user-controlled
|
|
279
|
-
* content is embedded in inline scripts.
|
|
280
|
-
*/
|
|
281
|
-
function escapeHtml(str) {
|
|
282
|
-
return str.replace(HTML_ESCAPE_REGEX, (match) => HTML_ESCAPE_LOOKUP[match]);
|
|
283
|
-
}
|
|
284
|
-
function decodePath(path) {
|
|
285
|
-
if (!path) return {
|
|
286
|
-
path,
|
|
287
|
-
handledProtocolRelativeURL: false
|
|
288
|
-
};
|
|
289
|
-
if (!/[%\\\x00-\x1f\x7f]/.test(path) && !path.startsWith("//")) return {
|
|
290
|
-
path,
|
|
291
|
-
handledProtocolRelativeURL: false
|
|
292
|
-
};
|
|
293
|
-
const re = /%25|%5C/gi;
|
|
294
|
-
let cursor = 0;
|
|
295
|
-
let result = "";
|
|
296
|
-
let match;
|
|
297
|
-
while (null !== (match = re.exec(path))) {
|
|
298
|
-
result += decodeSegment(path.slice(cursor, match.index)) + match[0];
|
|
299
|
-
cursor = re.lastIndex;
|
|
300
|
-
}
|
|
301
|
-
result = result + decodeSegment(cursor ? path.slice(cursor) : path);
|
|
302
|
-
let handledProtocolRelativeURL = false;
|
|
303
|
-
if (result.startsWith("//")) {
|
|
304
|
-
handledProtocolRelativeURL = true;
|
|
305
|
-
result = "/" + result.replace(/^\/+/, "");
|
|
306
|
-
}
|
|
307
|
-
return {
|
|
308
|
-
path: result,
|
|
309
|
-
handledProtocolRelativeURL
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Encodes a path the same way `new URL()` would, but without the overhead of full URL parsing.
|
|
314
|
-
*
|
|
315
|
-
* This function encodes:
|
|
316
|
-
* - Whitespace characters (spaces → %20, tabs → %09, etc.)
|
|
317
|
-
* - Non-ASCII/Unicode characters (emojis, accented characters, etc.)
|
|
318
|
-
*
|
|
319
|
-
* It preserves:
|
|
320
|
-
* - Already percent-encoded sequences (won't double-encode %2F, %25, etc.)
|
|
321
|
-
* - ASCII special characters valid in URL paths (@, $, &, +, etc.)
|
|
322
|
-
* - Forward slashes as path separators
|
|
323
|
-
*
|
|
324
|
-
* Used to generate proper href values for SSR without constructing URL objects.
|
|
325
|
-
*
|
|
326
|
-
* @example
|
|
327
|
-
* encodePathLikeUrl('/path/file name.pdf') // '/path/file%20name.pdf'
|
|
328
|
-
* encodePathLikeUrl('/path/日本語') // '/path/%E6%97%A5%E6%9C%AC%E8%AA%9E'
|
|
329
|
-
* encodePathLikeUrl('/path/already%20encoded') // '/path/already%20encoded' (preserved)
|
|
330
|
-
*/
|
|
331
|
-
function encodePathLikeUrl(path) {
|
|
332
|
-
if (!/\s|[^\u0000-\u007F]/.test(path)) return path;
|
|
333
|
-
return path.replace(/\s|[^\u0000-\u007F]/gu, encodeURIComponent);
|
|
334
|
-
}
|
|
335
|
-
function arraysEqual(a, b) {
|
|
336
|
-
if (a === b) return true;
|
|
337
|
-
if (a.length !== b.length) return false;
|
|
338
|
-
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
|
|
339
|
-
return true;
|
|
340
|
-
}
|
|
341
|
-
//#endregion
|
|
342
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.15/node_modules/@tanstack/router-core/dist/esm/invariant.js
|
|
343
|
-
function invariant() {
|
|
344
|
-
throw new Error("Invariant failed");
|
|
345
|
-
}
|
|
346
|
-
//#endregion
|
|
347
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.15/node_modules/@tanstack/router-core/dist/esm/lru-cache.js
|
|
348
|
-
function createLRUCache(max) {
|
|
349
|
-
const cache = /* @__PURE__ */ new Map();
|
|
350
|
-
let oldest;
|
|
351
|
-
let newest;
|
|
352
|
-
const touch = (entry) => {
|
|
353
|
-
if (!entry.next) return;
|
|
354
|
-
if (!entry.prev) {
|
|
355
|
-
entry.next.prev = void 0;
|
|
356
|
-
oldest = entry.next;
|
|
357
|
-
entry.next = void 0;
|
|
358
|
-
if (newest) {
|
|
359
|
-
entry.prev = newest;
|
|
360
|
-
newest.next = entry;
|
|
361
|
-
}
|
|
362
|
-
} else {
|
|
363
|
-
entry.prev.next = entry.next;
|
|
364
|
-
entry.next.prev = entry.prev;
|
|
365
|
-
entry.next = void 0;
|
|
366
|
-
if (newest) {
|
|
367
|
-
newest.next = entry;
|
|
368
|
-
entry.prev = newest;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
newest = entry;
|
|
372
|
-
};
|
|
373
|
-
return {
|
|
374
|
-
get(key) {
|
|
375
|
-
const entry = cache.get(key);
|
|
376
|
-
if (!entry) return void 0;
|
|
377
|
-
touch(entry);
|
|
378
|
-
return entry.value;
|
|
379
|
-
},
|
|
380
|
-
set(key, value) {
|
|
381
|
-
if (cache.size >= max && oldest) {
|
|
382
|
-
const toDelete = oldest;
|
|
383
|
-
cache.delete(toDelete.key);
|
|
384
|
-
if (toDelete.next) {
|
|
385
|
-
oldest = toDelete.next;
|
|
386
|
-
toDelete.next.prev = void 0;
|
|
387
|
-
}
|
|
388
|
-
if (toDelete === newest) newest = void 0;
|
|
389
|
-
}
|
|
390
|
-
const existing = cache.get(key);
|
|
391
|
-
if (existing) {
|
|
392
|
-
existing.value = value;
|
|
393
|
-
touch(existing);
|
|
394
|
-
} else {
|
|
395
|
-
const entry = {
|
|
396
|
-
key,
|
|
397
|
-
value,
|
|
398
|
-
prev: newest
|
|
399
|
-
};
|
|
400
|
-
if (newest) newest.next = entry;
|
|
401
|
-
newest = entry;
|
|
402
|
-
if (!oldest) oldest = entry;
|
|
403
|
-
cache.set(key, entry);
|
|
404
|
-
}
|
|
405
|
-
},
|
|
406
|
-
clear() {
|
|
407
|
-
cache.clear();
|
|
408
|
-
oldest = void 0;
|
|
409
|
-
newest = void 0;
|
|
410
|
-
}
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
//#endregion
|
|
414
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.15/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js
|
|
415
|
-
var SEGMENT_TYPE_INDEX = 4;
|
|
416
|
-
var SEGMENT_TYPE_PATHLESS = 5;
|
|
417
|
-
function getOpenAndCloseBraces(part) {
|
|
418
|
-
const openBrace = part.indexOf("{");
|
|
419
|
-
if (openBrace === -1) return null;
|
|
420
|
-
const closeBrace = part.indexOf("}", openBrace);
|
|
421
|
-
if (closeBrace === -1) return null;
|
|
422
|
-
if (openBrace + 1 >= part.length) return null;
|
|
423
|
-
return [openBrace, closeBrace];
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Populates the `output` array with the parsed representation of the given `segment` string.
|
|
427
|
-
*
|
|
428
|
-
* Usage:
|
|
429
|
-
* ```ts
|
|
430
|
-
* let output
|
|
431
|
-
* let cursor = 0
|
|
432
|
-
* while (cursor < path.length) {
|
|
433
|
-
* output = parseSegment(path, cursor, output)
|
|
434
|
-
* const end = output[5]
|
|
435
|
-
* cursor = end + 1
|
|
436
|
-
* ```
|
|
437
|
-
*
|
|
438
|
-
* `output` is stored outside to avoid allocations during repeated calls. It doesn't need to be typed
|
|
439
|
-
* or initialized, it will be done automatically.
|
|
440
|
-
*/
|
|
441
|
-
function parseSegment(path, start, output = /* @__PURE__ */ new Uint16Array(6)) {
|
|
442
|
-
const next = path.indexOf("/", start);
|
|
443
|
-
const end = next === -1 ? path.length : next;
|
|
444
|
-
const part = path.substring(start, end);
|
|
445
|
-
if (!part || !part.includes("$")) {
|
|
446
|
-
output[0] = 0;
|
|
447
|
-
output[1] = start;
|
|
448
|
-
output[2] = start;
|
|
449
|
-
output[3] = end;
|
|
450
|
-
output[4] = end;
|
|
451
|
-
output[5] = end;
|
|
452
|
-
return output;
|
|
453
|
-
}
|
|
454
|
-
if (part === "$") {
|
|
455
|
-
const total = path.length;
|
|
456
|
-
output[0] = 2;
|
|
457
|
-
output[1] = start;
|
|
458
|
-
output[2] = start;
|
|
459
|
-
output[3] = total;
|
|
460
|
-
output[4] = total;
|
|
461
|
-
output[5] = total;
|
|
462
|
-
return output;
|
|
463
|
-
}
|
|
464
|
-
if (part.charCodeAt(0) === 36) {
|
|
465
|
-
output[0] = 1;
|
|
466
|
-
output[1] = start;
|
|
467
|
-
output[2] = start + 1;
|
|
468
|
-
output[3] = end;
|
|
469
|
-
output[4] = end;
|
|
470
|
-
output[5] = end;
|
|
471
|
-
return output;
|
|
472
|
-
}
|
|
473
|
-
const braces = getOpenAndCloseBraces(part);
|
|
474
|
-
if (braces) {
|
|
475
|
-
const [openBrace, closeBrace] = braces;
|
|
476
|
-
const firstChar = part.charCodeAt(openBrace + 1);
|
|
477
|
-
if (firstChar === 45) {
|
|
478
|
-
if (openBrace + 2 < part.length && part.charCodeAt(openBrace + 2) === 36) {
|
|
479
|
-
const paramStart = openBrace + 3;
|
|
480
|
-
const paramEnd = closeBrace;
|
|
481
|
-
if (paramStart < paramEnd) {
|
|
482
|
-
output[0] = 3;
|
|
483
|
-
output[1] = start + openBrace;
|
|
484
|
-
output[2] = start + paramStart;
|
|
485
|
-
output[3] = start + paramEnd;
|
|
486
|
-
output[4] = start + closeBrace + 1;
|
|
487
|
-
output[5] = end;
|
|
488
|
-
return output;
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
} else if (firstChar === 36) {
|
|
492
|
-
const dollarPos = openBrace + 1;
|
|
493
|
-
const afterDollar = openBrace + 2;
|
|
494
|
-
if (afterDollar === closeBrace) {
|
|
495
|
-
output[0] = 2;
|
|
496
|
-
output[1] = start + openBrace;
|
|
497
|
-
output[2] = start + dollarPos;
|
|
498
|
-
output[3] = start + afterDollar;
|
|
499
|
-
output[4] = start + closeBrace + 1;
|
|
500
|
-
output[5] = path.length;
|
|
501
|
-
return output;
|
|
502
|
-
}
|
|
503
|
-
output[0] = 1;
|
|
504
|
-
output[1] = start + openBrace;
|
|
505
|
-
output[2] = start + afterDollar;
|
|
506
|
-
output[3] = start + closeBrace;
|
|
507
|
-
output[4] = start + closeBrace + 1;
|
|
508
|
-
output[5] = end;
|
|
509
|
-
return output;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
output[0] = 0;
|
|
513
|
-
output[1] = start;
|
|
514
|
-
output[2] = start;
|
|
515
|
-
output[3] = end;
|
|
516
|
-
output[4] = end;
|
|
517
|
-
output[5] = end;
|
|
518
|
-
return output;
|
|
519
|
-
}
|
|
520
|
-
/**
|
|
521
|
-
* Recursively parses the segments of the given route tree and populates a segment trie.
|
|
522
|
-
*
|
|
523
|
-
* @param data A reusable Uint16Array for parsing segments. (non important, we're just avoiding allocations)
|
|
524
|
-
* @param route The current route to parse.
|
|
525
|
-
* @param start The starting index for parsing within the route's full path.
|
|
526
|
-
* @param node The current segment node in the trie to populate.
|
|
527
|
-
* @param onRoute Callback invoked for each route processed.
|
|
528
|
-
*/
|
|
529
|
-
function parseSegments(defaultCaseSensitive, data, route, start, node, depth, onRoute) {
|
|
530
|
-
onRoute?.(route);
|
|
531
|
-
let cursor = start;
|
|
532
|
-
{
|
|
533
|
-
const path = route.fullPath ?? route.from;
|
|
534
|
-
const length = path.length;
|
|
535
|
-
const caseSensitive = route.options?.caseSensitive ?? defaultCaseSensitive;
|
|
536
|
-
const parseParams = route.options?.params?.parse ?? route.options?.parseParams;
|
|
537
|
-
while (cursor < length) {
|
|
538
|
-
const segment = parseSegment(path, cursor, data);
|
|
539
|
-
let nextNode;
|
|
540
|
-
const start = cursor;
|
|
541
|
-
const end = segment[5];
|
|
542
|
-
cursor = end + 1;
|
|
543
|
-
depth++;
|
|
544
|
-
switch (segment[0]) {
|
|
545
|
-
case 0: {
|
|
546
|
-
const value = path.substring(segment[2], segment[3]);
|
|
547
|
-
if (caseSensitive) {
|
|
548
|
-
const existingNode = node.static?.get(value);
|
|
549
|
-
if (existingNode) nextNode = existingNode;
|
|
550
|
-
else {
|
|
551
|
-
node.static ??= /* @__PURE__ */ new Map();
|
|
552
|
-
const next = createStaticNode(route.fullPath ?? route.from);
|
|
553
|
-
next.parent = node;
|
|
554
|
-
next.depth = depth;
|
|
555
|
-
nextNode = next;
|
|
556
|
-
node.static.set(value, next);
|
|
557
|
-
}
|
|
558
|
-
} else {
|
|
559
|
-
const name = value.toLowerCase();
|
|
560
|
-
const existingNode = node.staticInsensitive?.get(name);
|
|
561
|
-
if (existingNode) nextNode = existingNode;
|
|
562
|
-
else {
|
|
563
|
-
node.staticInsensitive ??= /* @__PURE__ */ new Map();
|
|
564
|
-
const next = createStaticNode(route.fullPath ?? route.from);
|
|
565
|
-
next.parent = node;
|
|
566
|
-
next.depth = depth;
|
|
567
|
-
nextNode = next;
|
|
568
|
-
node.staticInsensitive.set(name, next);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
break;
|
|
572
|
-
}
|
|
573
|
-
case 1: {
|
|
574
|
-
const prefix_raw = path.substring(start, segment[1]);
|
|
575
|
-
const suffix_raw = path.substring(segment[4], end);
|
|
576
|
-
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
|
|
577
|
-
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
|
|
578
|
-
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
|
|
579
|
-
const existingNode = !parseParams && node.dynamic?.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);
|
|
580
|
-
if (existingNode) nextNode = existingNode;
|
|
581
|
-
else {
|
|
582
|
-
const next = createDynamicNode(1, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
|
|
583
|
-
nextNode = next;
|
|
584
|
-
next.depth = depth;
|
|
585
|
-
next.parent = node;
|
|
586
|
-
node.dynamic ??= [];
|
|
587
|
-
node.dynamic.push(next);
|
|
588
|
-
}
|
|
589
|
-
break;
|
|
590
|
-
}
|
|
591
|
-
case 3: {
|
|
592
|
-
const prefix_raw = path.substring(start, segment[1]);
|
|
593
|
-
const suffix_raw = path.substring(segment[4], end);
|
|
594
|
-
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
|
|
595
|
-
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
|
|
596
|
-
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
|
|
597
|
-
const existingNode = !parseParams && node.optional?.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);
|
|
598
|
-
if (existingNode) nextNode = existingNode;
|
|
599
|
-
else {
|
|
600
|
-
const next = createDynamicNode(3, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
|
|
601
|
-
nextNode = next;
|
|
602
|
-
next.parent = node;
|
|
603
|
-
next.depth = depth;
|
|
604
|
-
node.optional ??= [];
|
|
605
|
-
node.optional.push(next);
|
|
606
|
-
}
|
|
607
|
-
break;
|
|
608
|
-
}
|
|
609
|
-
case 2: {
|
|
610
|
-
const prefix_raw = path.substring(start, segment[1]);
|
|
611
|
-
const suffix_raw = path.substring(segment[4], end);
|
|
612
|
-
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
|
|
613
|
-
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
|
|
614
|
-
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
|
|
615
|
-
const next = createDynamicNode(2, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
|
|
616
|
-
nextNode = next;
|
|
617
|
-
next.parent = node;
|
|
618
|
-
next.depth = depth;
|
|
619
|
-
node.wildcard ??= [];
|
|
620
|
-
node.wildcard.push(next);
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
node = nextNode;
|
|
624
|
-
}
|
|
625
|
-
if (parseParams && route.children && !route.isRoot && route.id && route.id.charCodeAt(route.id.lastIndexOf("/") + 1) === 95) {
|
|
626
|
-
const pathlessNode = createStaticNode(route.fullPath ?? route.from);
|
|
627
|
-
pathlessNode.kind = SEGMENT_TYPE_PATHLESS;
|
|
628
|
-
pathlessNode.parent = node;
|
|
629
|
-
depth++;
|
|
630
|
-
pathlessNode.depth = depth;
|
|
631
|
-
node.pathless ??= [];
|
|
632
|
-
node.pathless.push(pathlessNode);
|
|
633
|
-
node = pathlessNode;
|
|
634
|
-
}
|
|
635
|
-
const isLeaf = (route.path || !route.children) && !route.isRoot;
|
|
636
|
-
if (isLeaf && path.endsWith("/")) {
|
|
637
|
-
const indexNode = createStaticNode(route.fullPath ?? route.from);
|
|
638
|
-
indexNode.kind = SEGMENT_TYPE_INDEX;
|
|
639
|
-
indexNode.parent = node;
|
|
640
|
-
depth++;
|
|
641
|
-
indexNode.depth = depth;
|
|
642
|
-
node.index = indexNode;
|
|
643
|
-
node = indexNode;
|
|
644
|
-
}
|
|
645
|
-
node.parse = parseParams ?? null;
|
|
646
|
-
node.priority = route.options?.params?.priority ?? 0;
|
|
647
|
-
if (isLeaf && !node.route) {
|
|
648
|
-
node.route = route;
|
|
649
|
-
node.fullPath = route.fullPath ?? route.from;
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
if (route.children) for (const child of route.children) parseSegments(defaultCaseSensitive, data, child, cursor, node, depth, onRoute);
|
|
653
|
-
}
|
|
654
|
-
function sortDynamic(a, b) {
|
|
655
|
-
if (a.parse && !b.parse) return -1;
|
|
656
|
-
if (!a.parse && b.parse) return 1;
|
|
657
|
-
if (a.parse && b.parse && (a.priority || b.priority)) return b.priority - a.priority;
|
|
658
|
-
if (a.prefix && b.prefix && a.prefix !== b.prefix) {
|
|
659
|
-
if (a.prefix.startsWith(b.prefix)) return -1;
|
|
660
|
-
if (b.prefix.startsWith(a.prefix)) return 1;
|
|
661
|
-
}
|
|
662
|
-
if (a.suffix && b.suffix && a.suffix !== b.suffix) {
|
|
663
|
-
if (a.suffix.endsWith(b.suffix)) return -1;
|
|
664
|
-
if (b.suffix.endsWith(a.suffix)) return 1;
|
|
665
|
-
}
|
|
666
|
-
if (a.prefix && !b.prefix) return -1;
|
|
667
|
-
if (!a.prefix && b.prefix) return 1;
|
|
668
|
-
if (a.suffix && !b.suffix) return -1;
|
|
669
|
-
if (!a.suffix && b.suffix) return 1;
|
|
670
|
-
if (a.caseSensitive && !b.caseSensitive) return -1;
|
|
671
|
-
if (!a.caseSensitive && b.caseSensitive) return 1;
|
|
672
|
-
return 0;
|
|
673
|
-
}
|
|
674
|
-
function sortTreeNodes(node) {
|
|
675
|
-
if (node.pathless) for (const child of node.pathless) sortTreeNodes(child);
|
|
676
|
-
if (node.static) for (const child of node.static.values()) sortTreeNodes(child);
|
|
677
|
-
if (node.staticInsensitive) for (const child of node.staticInsensitive.values()) sortTreeNodes(child);
|
|
678
|
-
if (node.dynamic?.length) {
|
|
679
|
-
node.dynamic.sort(sortDynamic);
|
|
680
|
-
for (const child of node.dynamic) sortTreeNodes(child);
|
|
681
|
-
}
|
|
682
|
-
if (node.optional?.length) {
|
|
683
|
-
node.optional.sort(sortDynamic);
|
|
684
|
-
for (const child of node.optional) sortTreeNodes(child);
|
|
685
|
-
}
|
|
686
|
-
if (node.wildcard?.length) {
|
|
687
|
-
node.wildcard.sort(sortDynamic);
|
|
688
|
-
for (const child of node.wildcard) sortTreeNodes(child);
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
function createStaticNode(fullPath) {
|
|
692
|
-
return {
|
|
693
|
-
kind: 0,
|
|
694
|
-
depth: 0,
|
|
695
|
-
pathless: null,
|
|
696
|
-
index: null,
|
|
697
|
-
static: null,
|
|
698
|
-
staticInsensitive: null,
|
|
699
|
-
dynamic: null,
|
|
700
|
-
optional: null,
|
|
701
|
-
wildcard: null,
|
|
702
|
-
route: null,
|
|
703
|
-
fullPath,
|
|
704
|
-
parent: null,
|
|
705
|
-
parse: null,
|
|
706
|
-
priority: 0
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* Keys must be declared in the same order as in `SegmentNode` type,
|
|
711
|
-
* to ensure they are represented as the same object class in the engine.
|
|
712
|
-
*/
|
|
713
|
-
function createDynamicNode(kind, fullPath, caseSensitive, prefix, suffix) {
|
|
714
|
-
return {
|
|
715
|
-
kind,
|
|
716
|
-
depth: 0,
|
|
717
|
-
pathless: null,
|
|
718
|
-
index: null,
|
|
719
|
-
static: null,
|
|
720
|
-
staticInsensitive: null,
|
|
721
|
-
dynamic: null,
|
|
722
|
-
optional: null,
|
|
723
|
-
wildcard: null,
|
|
724
|
-
route: null,
|
|
725
|
-
fullPath,
|
|
726
|
-
parent: null,
|
|
727
|
-
parse: null,
|
|
728
|
-
priority: 0,
|
|
729
|
-
caseSensitive,
|
|
730
|
-
prefix,
|
|
731
|
-
suffix
|
|
732
|
-
};
|
|
733
|
-
}
|
|
734
|
-
function processRouteMasks(routeList, processedTree) {
|
|
735
|
-
const segmentTree = createStaticNode("/");
|
|
736
|
-
const data = /* @__PURE__ */ new Uint16Array(6);
|
|
737
|
-
for (const route of routeList) parseSegments(false, data, route, 1, segmentTree, 0);
|
|
738
|
-
sortTreeNodes(segmentTree);
|
|
739
|
-
processedTree.masksTree = segmentTree;
|
|
740
|
-
processedTree.flatCache = createLRUCache(1e3);
|
|
741
|
-
}
|
|
742
|
-
/**
|
|
743
|
-
* Take an arbitrary list of routes, create a tree from them (if it hasn't been created already), and match a path against it.
|
|
744
|
-
*/
|
|
745
|
-
function findFlatMatch(path, processedTree) {
|
|
746
|
-
path ||= "/";
|
|
747
|
-
const cached = processedTree.flatCache.get(path);
|
|
748
|
-
if (cached) return cached;
|
|
749
|
-
const result = findMatch(path, processedTree.masksTree);
|
|
750
|
-
processedTree.flatCache.set(path, result);
|
|
751
|
-
return result;
|
|
752
|
-
}
|
|
753
|
-
/**
|
|
754
|
-
* @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree
|
|
755
|
-
*/
|
|
756
|
-
function findSingleMatch(from, caseSensitive, fuzzy, path, processedTree) {
|
|
757
|
-
from ||= "/";
|
|
758
|
-
path ||= "/";
|
|
759
|
-
const key = caseSensitive ? `case\0${from}` : from;
|
|
760
|
-
let tree = processedTree.singleCache.get(key);
|
|
761
|
-
if (!tree) {
|
|
762
|
-
tree = createStaticNode("/");
|
|
763
|
-
parseSegments(caseSensitive, /* @__PURE__ */ new Uint16Array(6), { from }, 1, tree, 0);
|
|
764
|
-
processedTree.singleCache.set(key, tree);
|
|
765
|
-
}
|
|
766
|
-
return findMatch(path, tree, fuzzy);
|
|
767
|
-
}
|
|
768
|
-
function findRouteMatch(path, processedTree, fuzzy = false) {
|
|
769
|
-
const key = fuzzy ? path : `nofuzz\0${path}`;
|
|
770
|
-
const cached = processedTree.matchCache.get(key);
|
|
771
|
-
if (cached !== void 0) return cached;
|
|
772
|
-
path ||= "/";
|
|
773
|
-
let result;
|
|
774
|
-
try {
|
|
775
|
-
result = findMatch(path, processedTree.segmentTree, fuzzy);
|
|
776
|
-
} catch (err) {
|
|
777
|
-
if (err instanceof URIError) result = null;
|
|
778
|
-
else throw err;
|
|
779
|
-
}
|
|
780
|
-
if (result) result.branch = buildRouteBranch(result.route);
|
|
781
|
-
processedTree.matchCache.set(key, result);
|
|
782
|
-
return result;
|
|
783
|
-
}
|
|
784
|
-
/** Trim trailing slashes (except preserving root '/'). */
|
|
785
|
-
function trimPathRight$1(path) {
|
|
786
|
-
return path === "/" ? path : path.replace(/\/{1,}$/, "");
|
|
787
|
-
}
|
|
788
|
-
/**
|
|
789
|
-
* Processes a route tree into a segment trie for efficient path matching.
|
|
790
|
-
* Also builds lookup maps for routes by ID and by trimmed full path.
|
|
791
|
-
*/
|
|
792
|
-
function processRouteTree(routeTree, caseSensitive = false, initRoute) {
|
|
793
|
-
const segmentTree = createStaticNode(routeTree.fullPath);
|
|
794
|
-
const data = /* @__PURE__ */ new Uint16Array(6);
|
|
795
|
-
const routesById = {};
|
|
796
|
-
const routesByPath = {};
|
|
797
|
-
let index = 0;
|
|
798
|
-
parseSegments(caseSensitive, data, routeTree, 1, segmentTree, 0, (route) => {
|
|
799
|
-
initRoute?.(route, index);
|
|
800
|
-
if (route.id in routesById) invariant();
|
|
801
|
-
routesById[route.id] = route;
|
|
802
|
-
if (index !== 0 && route.path) {
|
|
803
|
-
const trimmedFullPath = trimPathRight$1(route.fullPath);
|
|
804
|
-
if (!routesByPath[trimmedFullPath] || route.fullPath.endsWith("/")) routesByPath[trimmedFullPath] = route;
|
|
805
|
-
}
|
|
806
|
-
index++;
|
|
807
|
-
});
|
|
808
|
-
sortTreeNodes(segmentTree);
|
|
809
|
-
return {
|
|
810
|
-
processedTree: {
|
|
811
|
-
segmentTree,
|
|
812
|
-
singleCache: createLRUCache(1e3),
|
|
813
|
-
matchCache: createLRUCache(1e3),
|
|
814
|
-
flatCache: null,
|
|
815
|
-
masksTree: null
|
|
816
|
-
},
|
|
817
|
-
routesById,
|
|
818
|
-
routesByPath
|
|
819
|
-
};
|
|
820
|
-
}
|
|
821
|
-
function findMatch(path, segmentTree, fuzzy = false) {
|
|
822
|
-
const parts = path.split("/");
|
|
823
|
-
const leaf = getNodeMatch(path, parts, segmentTree, fuzzy);
|
|
824
|
-
if (!leaf) return null;
|
|
825
|
-
const [rawParams] = extractParams(path, parts, leaf);
|
|
826
|
-
return {
|
|
827
|
-
route: leaf.node.route,
|
|
828
|
-
rawParams
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
/**
|
|
832
|
-
* This function is "resumable":
|
|
833
|
-
* - the `leaf` input can contain `extract` and `rawParams` properties from a previous `extractParams` call
|
|
834
|
-
* - the returned `state` can be passed back as `extract` in a future call to continue extracting params from where we left off
|
|
835
|
-
*
|
|
836
|
-
* Inputs are *not* mutated.
|
|
837
|
-
*/
|
|
838
|
-
function extractParams(path, parts, leaf) {
|
|
839
|
-
const list = buildBranch(leaf.node);
|
|
840
|
-
let nodeParts = null;
|
|
841
|
-
const rawParams = Object.create(null);
|
|
842
|
-
/** which segment of the path we're currently processing */
|
|
843
|
-
let partIndex = leaf.extract?.part ?? 0;
|
|
844
|
-
/** which node of the route tree branch we're currently processing */
|
|
845
|
-
let nodeIndex = leaf.extract?.node ?? 0;
|
|
846
|
-
/** index of the 1st character of the segment we're processing in the path string */
|
|
847
|
-
let pathIndex = leaf.extract?.path ?? 0;
|
|
848
|
-
/** which fullPath segment we're currently processing */
|
|
849
|
-
let segmentCount = leaf.extract?.segment ?? 0;
|
|
850
|
-
for (; nodeIndex < list.length; partIndex++, nodeIndex++, pathIndex++, segmentCount++) {
|
|
851
|
-
const node = list[nodeIndex];
|
|
852
|
-
if (node.kind === SEGMENT_TYPE_INDEX) break;
|
|
853
|
-
if (node.kind === SEGMENT_TYPE_PATHLESS) {
|
|
854
|
-
segmentCount--;
|
|
855
|
-
partIndex--;
|
|
856
|
-
pathIndex--;
|
|
857
|
-
continue;
|
|
858
|
-
}
|
|
859
|
-
const part = parts[partIndex];
|
|
860
|
-
const currentPathIndex = pathIndex;
|
|
861
|
-
if (part) pathIndex += part.length;
|
|
862
|
-
if (node.kind === 1) {
|
|
863
|
-
nodeParts ??= leaf.node.fullPath.split("/");
|
|
864
|
-
const nodePart = nodeParts[segmentCount];
|
|
865
|
-
const preLength = node.prefix?.length ?? 0;
|
|
866
|
-
if (nodePart.charCodeAt(preLength) === 123) {
|
|
867
|
-
const sufLength = node.suffix?.length ?? 0;
|
|
868
|
-
const name = nodePart.substring(preLength + 2, nodePart.length - sufLength - 1);
|
|
869
|
-
const value = part.substring(preLength, part.length - sufLength);
|
|
870
|
-
rawParams[name] = decodeURIComponent(value);
|
|
871
|
-
} else {
|
|
872
|
-
const name = nodePart.substring(1);
|
|
873
|
-
rawParams[name] = decodeURIComponent(part);
|
|
874
|
-
}
|
|
875
|
-
} else if (node.kind === 3) {
|
|
876
|
-
if (leaf.skipped & 1 << nodeIndex) {
|
|
877
|
-
partIndex--;
|
|
878
|
-
pathIndex = currentPathIndex - 1;
|
|
879
|
-
continue;
|
|
880
|
-
}
|
|
881
|
-
nodeParts ??= leaf.node.fullPath.split("/");
|
|
882
|
-
const nodePart = nodeParts[segmentCount];
|
|
883
|
-
const preLength = node.prefix?.length ?? 0;
|
|
884
|
-
const sufLength = node.suffix?.length ?? 0;
|
|
885
|
-
const name = nodePart.substring(preLength + 3, nodePart.length - sufLength - 1);
|
|
886
|
-
const value = node.suffix || node.prefix ? part.substring(preLength, part.length - sufLength) : part;
|
|
887
|
-
if (value) rawParams[name] = decodeURIComponent(value);
|
|
888
|
-
} else if (node.kind === 2) {
|
|
889
|
-
const n = node;
|
|
890
|
-
const value = path.substring(currentPathIndex + (n.prefix?.length ?? 0), path.length - (n.suffix?.length ?? 0));
|
|
891
|
-
const splat = decodeURIComponent(value);
|
|
892
|
-
rawParams["*"] = splat;
|
|
893
|
-
rawParams._splat = splat;
|
|
894
|
-
break;
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
if (leaf.rawParams) Object.assign(rawParams, leaf.rawParams);
|
|
898
|
-
return [rawParams, {
|
|
899
|
-
part: partIndex,
|
|
900
|
-
node: nodeIndex,
|
|
901
|
-
path: pathIndex,
|
|
902
|
-
segment: segmentCount
|
|
903
|
-
}];
|
|
904
|
-
}
|
|
905
|
-
function buildRouteBranch(route) {
|
|
906
|
-
const list = [route];
|
|
907
|
-
while (route.parentRoute) {
|
|
908
|
-
route = route.parentRoute;
|
|
909
|
-
list.push(route);
|
|
910
|
-
}
|
|
911
|
-
list.reverse();
|
|
912
|
-
return list;
|
|
913
|
-
}
|
|
914
|
-
function buildBranch(node) {
|
|
915
|
-
const list = Array(node.depth + 1);
|
|
916
|
-
do {
|
|
917
|
-
list[node.depth] = node;
|
|
918
|
-
node = node.parent;
|
|
919
|
-
} while (node);
|
|
920
|
-
return list;
|
|
921
|
-
}
|
|
922
|
-
function getNodeMatch(path, parts, segmentTree, fuzzy) {
|
|
923
|
-
if (path === "/" && segmentTree.index) return {
|
|
924
|
-
node: segmentTree.index,
|
|
925
|
-
skipped: 0
|
|
926
|
-
};
|
|
927
|
-
const trailingSlash = !last(parts);
|
|
928
|
-
const pathIsIndex = trailingSlash && path !== "/";
|
|
929
|
-
const partsLength = parts.length - (trailingSlash ? 1 : 0);
|
|
930
|
-
const stack = [{
|
|
931
|
-
node: segmentTree,
|
|
932
|
-
index: 1,
|
|
933
|
-
skipped: 0,
|
|
934
|
-
depth: 1,
|
|
935
|
-
statics: 0,
|
|
936
|
-
dynamics: 0,
|
|
937
|
-
optionals: 0
|
|
938
|
-
}];
|
|
939
|
-
let bestFuzzy = null;
|
|
940
|
-
let bestMatch = null;
|
|
941
|
-
while (stack.length) {
|
|
942
|
-
const frame = stack.pop();
|
|
943
|
-
const { node, index, skipped, depth, statics, dynamics, optionals } = frame;
|
|
944
|
-
let { extract, rawParams } = frame;
|
|
945
|
-
if (node.kind === 2 && node.route && !isFrameMoreSpecific(bestMatch, frame)) continue;
|
|
946
|
-
if (node.parse) {
|
|
947
|
-
if (!validateParseParams(path, parts, frame)) continue;
|
|
948
|
-
rawParams = frame.rawParams;
|
|
949
|
-
extract = frame.extract;
|
|
950
|
-
}
|
|
951
|
-
if (fuzzy && node.route && node.kind !== SEGMENT_TYPE_INDEX && isFrameMoreSpecific(bestFuzzy, frame)) bestFuzzy = frame;
|
|
952
|
-
const isBeyondPath = index === partsLength;
|
|
953
|
-
if (isBeyondPath) {
|
|
954
|
-
if (node.route && (!pathIsIndex || node.kind === SEGMENT_TYPE_INDEX || node.kind === 2) && isFrameMoreSpecific(bestMatch, frame)) bestMatch = frame;
|
|
955
|
-
if (!node.optional && !node.wildcard && !node.index && !node.pathless) continue;
|
|
956
|
-
}
|
|
957
|
-
const part = isBeyondPath ? void 0 : parts[index];
|
|
958
|
-
let lowerPart;
|
|
959
|
-
if (isBeyondPath && node.index) {
|
|
960
|
-
const indexFrame = {
|
|
961
|
-
node: node.index,
|
|
962
|
-
index,
|
|
963
|
-
skipped,
|
|
964
|
-
depth: depth + 1,
|
|
965
|
-
statics,
|
|
966
|
-
dynamics,
|
|
967
|
-
optionals,
|
|
968
|
-
extract,
|
|
969
|
-
rawParams
|
|
970
|
-
};
|
|
971
|
-
let indexValid = true;
|
|
972
|
-
if (node.index.parse) {
|
|
973
|
-
if (!validateParseParams(path, parts, indexFrame)) indexValid = false;
|
|
974
|
-
}
|
|
975
|
-
if (indexValid) {
|
|
976
|
-
if (!dynamics && !optionals && !skipped && isPerfectStaticMatch(statics, partsLength)) return indexFrame;
|
|
977
|
-
if (isFrameMoreSpecific(bestMatch, indexFrame)) bestMatch = indexFrame;
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
if (node.wildcard) for (let i = node.wildcard.length - 1; i >= 0; i--) {
|
|
981
|
-
const segment = node.wildcard[i];
|
|
982
|
-
const { prefix, suffix } = segment;
|
|
983
|
-
if (prefix) {
|
|
984
|
-
if (isBeyondPath) continue;
|
|
985
|
-
if (!(segment.caseSensitive ? part : lowerPart ??= part.toLowerCase()).startsWith(prefix)) continue;
|
|
986
|
-
}
|
|
987
|
-
if (suffix) {
|
|
988
|
-
if (isBeyondPath) continue;
|
|
989
|
-
const end = parts.slice(index).join("/").slice(-suffix.length);
|
|
990
|
-
if ((segment.caseSensitive ? end : end.toLowerCase()) !== suffix) continue;
|
|
991
|
-
}
|
|
992
|
-
stack.push({
|
|
993
|
-
node: segment,
|
|
994
|
-
index: partsLength,
|
|
995
|
-
skipped,
|
|
996
|
-
depth: depth + 1,
|
|
997
|
-
statics,
|
|
998
|
-
dynamics,
|
|
999
|
-
optionals,
|
|
1000
|
-
extract,
|
|
1001
|
-
rawParams
|
|
1002
|
-
});
|
|
1003
|
-
}
|
|
1004
|
-
if (node.optional) {
|
|
1005
|
-
const nextSkipped = skipped | 1 << depth;
|
|
1006
|
-
const nextDepth = depth + 1;
|
|
1007
|
-
for (let i = node.optional.length - 1; i >= 0; i--) {
|
|
1008
|
-
const segment = node.optional[i];
|
|
1009
|
-
stack.push({
|
|
1010
|
-
node: segment,
|
|
1011
|
-
index,
|
|
1012
|
-
skipped: nextSkipped,
|
|
1013
|
-
depth: nextDepth,
|
|
1014
|
-
statics,
|
|
1015
|
-
dynamics,
|
|
1016
|
-
optionals,
|
|
1017
|
-
extract,
|
|
1018
|
-
rawParams
|
|
1019
|
-
});
|
|
1020
|
-
}
|
|
1021
|
-
if (!isBeyondPath) for (let i = node.optional.length - 1; i >= 0; i--) {
|
|
1022
|
-
const segment = node.optional[i];
|
|
1023
|
-
const { prefix, suffix } = segment;
|
|
1024
|
-
if (prefix || suffix) {
|
|
1025
|
-
const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();
|
|
1026
|
-
if (prefix && !casePart.startsWith(prefix)) continue;
|
|
1027
|
-
if (suffix && !casePart.endsWith(suffix)) continue;
|
|
1028
|
-
}
|
|
1029
|
-
stack.push({
|
|
1030
|
-
node: segment,
|
|
1031
|
-
index: index + 1,
|
|
1032
|
-
skipped,
|
|
1033
|
-
depth: nextDepth,
|
|
1034
|
-
statics,
|
|
1035
|
-
dynamics,
|
|
1036
|
-
optionals: optionals + segmentScore(partsLength, index),
|
|
1037
|
-
extract,
|
|
1038
|
-
rawParams
|
|
1039
|
-
});
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
if (!isBeyondPath && node.dynamic && part) for (let i = node.dynamic.length - 1; i >= 0; i--) {
|
|
1043
|
-
const segment = node.dynamic[i];
|
|
1044
|
-
const { prefix, suffix } = segment;
|
|
1045
|
-
if (prefix || suffix) {
|
|
1046
|
-
const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();
|
|
1047
|
-
if (prefix && !casePart.startsWith(prefix)) continue;
|
|
1048
|
-
if (suffix && !casePart.endsWith(suffix)) continue;
|
|
1049
|
-
}
|
|
1050
|
-
stack.push({
|
|
1051
|
-
node: segment,
|
|
1052
|
-
index: index + 1,
|
|
1053
|
-
skipped,
|
|
1054
|
-
depth: depth + 1,
|
|
1055
|
-
statics,
|
|
1056
|
-
dynamics: dynamics + segmentScore(partsLength, index),
|
|
1057
|
-
optionals,
|
|
1058
|
-
extract,
|
|
1059
|
-
rawParams
|
|
1060
|
-
});
|
|
1061
|
-
}
|
|
1062
|
-
if (!isBeyondPath && node.staticInsensitive) {
|
|
1063
|
-
const match = node.staticInsensitive.get(lowerPart ??= part.toLowerCase());
|
|
1064
|
-
if (match) stack.push({
|
|
1065
|
-
node: match,
|
|
1066
|
-
index: index + 1,
|
|
1067
|
-
skipped,
|
|
1068
|
-
depth: depth + 1,
|
|
1069
|
-
statics: statics + segmentScore(partsLength, index),
|
|
1070
|
-
dynamics,
|
|
1071
|
-
optionals,
|
|
1072
|
-
extract,
|
|
1073
|
-
rawParams
|
|
1074
|
-
});
|
|
1075
|
-
}
|
|
1076
|
-
if (!isBeyondPath && node.static) {
|
|
1077
|
-
const match = node.static.get(part);
|
|
1078
|
-
if (match) stack.push({
|
|
1079
|
-
node: match,
|
|
1080
|
-
index: index + 1,
|
|
1081
|
-
skipped,
|
|
1082
|
-
depth: depth + 1,
|
|
1083
|
-
statics: statics + segmentScore(partsLength, index),
|
|
1084
|
-
dynamics,
|
|
1085
|
-
optionals,
|
|
1086
|
-
extract,
|
|
1087
|
-
rawParams
|
|
1088
|
-
});
|
|
1089
|
-
}
|
|
1090
|
-
if (node.pathless) {
|
|
1091
|
-
const nextDepth = depth + 1;
|
|
1092
|
-
for (let i = node.pathless.length - 1; i >= 0; i--) {
|
|
1093
|
-
const segment = node.pathless[i];
|
|
1094
|
-
stack.push({
|
|
1095
|
-
node: segment,
|
|
1096
|
-
index,
|
|
1097
|
-
skipped,
|
|
1098
|
-
depth: nextDepth,
|
|
1099
|
-
statics,
|
|
1100
|
-
dynamics,
|
|
1101
|
-
optionals,
|
|
1102
|
-
extract,
|
|
1103
|
-
rawParams
|
|
1104
|
-
});
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
if (bestMatch) return bestMatch;
|
|
1109
|
-
if (fuzzy && bestFuzzy) {
|
|
1110
|
-
let sliceIndex = bestFuzzy.index;
|
|
1111
|
-
for (let i = 0; i < bestFuzzy.index; i++) sliceIndex += parts[i].length;
|
|
1112
|
-
const splat = sliceIndex === path.length ? "/" : path.slice(sliceIndex);
|
|
1113
|
-
bestFuzzy.rawParams ??= Object.create(null);
|
|
1114
|
-
bestFuzzy.rawParams["**"] = decodeURIComponent(splat);
|
|
1115
|
-
return bestFuzzy;
|
|
1116
|
-
}
|
|
1117
|
-
return null;
|
|
1118
|
-
}
|
|
1119
|
-
function segmentScore(partsLength, index) {
|
|
1120
|
-
return 2 ** (partsLength - index - 1);
|
|
1121
|
-
}
|
|
1122
|
-
function isPerfectStaticMatch(statics, partsLength) {
|
|
1123
|
-
return statics === 2 ** (partsLength - 1) - 1;
|
|
1124
|
-
}
|
|
1125
|
-
function validateParseParams(path, parts, frame) {
|
|
1126
|
-
let rawParams;
|
|
1127
|
-
let state;
|
|
1128
|
-
try {
|
|
1129
|
-
[rawParams, state] = extractParams(path, parts, frame);
|
|
1130
|
-
} catch {
|
|
1131
|
-
return null;
|
|
1132
|
-
}
|
|
1133
|
-
frame.rawParams = rawParams;
|
|
1134
|
-
frame.extract = state;
|
|
1135
|
-
if (!frame.node.parse) return true;
|
|
1136
|
-
try {
|
|
1137
|
-
if (frame.node.parse(rawParams) === false) return null;
|
|
1138
|
-
} catch {}
|
|
1139
|
-
return true;
|
|
1140
|
-
}
|
|
1141
|
-
function isFrameMoreSpecific(prev, next) {
|
|
1142
|
-
if (!prev) return true;
|
|
1143
|
-
return next.statics > prev.statics || next.statics === prev.statics && (next.dynamics > prev.dynamics || next.dynamics === prev.dynamics && (next.optionals > prev.optionals || next.optionals === prev.optionals && ((next.node.kind === SEGMENT_TYPE_INDEX) > (prev.node.kind === SEGMENT_TYPE_INDEX) || next.node.kind === SEGMENT_TYPE_INDEX === (prev.node.kind === SEGMENT_TYPE_INDEX) && next.depth > prev.depth)));
|
|
1144
|
-
}
|
|
1145
|
-
//#endregion
|
|
1146
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.15/node_modules/@tanstack/router-core/dist/esm/path.js
|
|
1147
|
-
/** Join path segments, cleaning duplicate slashes between parts. */
|
|
1148
|
-
function joinPaths(paths) {
|
|
1149
|
-
return cleanPath(paths.filter((val) => {
|
|
1150
|
-
return val !== void 0;
|
|
1151
|
-
}).join("/"));
|
|
1152
|
-
}
|
|
1153
|
-
/** Remove repeated slashes from a path string. */
|
|
1154
|
-
function cleanPath(path) {
|
|
1155
|
-
return path.replace(/\/{2,}/g, "/");
|
|
1156
|
-
}
|
|
1157
|
-
/** Trim leading slashes (except preserving root '/'). */
|
|
1158
|
-
function trimPathLeft(path) {
|
|
1159
|
-
return path === "/" ? path : path.replace(/^\/{1,}/, "");
|
|
1160
|
-
}
|
|
1161
|
-
/** Trim trailing slashes (except preserving root '/'). */
|
|
1162
|
-
function trimPathRight(path) {
|
|
1163
|
-
const len = path.length;
|
|
1164
|
-
return len > 1 && path[len - 1] === "/" ? path.replace(/\/{1,}$/, "") : path;
|
|
1165
|
-
}
|
|
1166
|
-
/** Trim both leading and trailing slashes. */
|
|
1167
|
-
function trimPath(path) {
|
|
1168
|
-
return trimPathRight(trimPathLeft(path));
|
|
1169
|
-
}
|
|
1170
|
-
/** Remove a trailing slash from value when appropriate for comparisons. */
|
|
1171
|
-
function removeTrailingSlash(value, basepath) {
|
|
1172
|
-
if (value?.endsWith("/") && value !== "/" && value !== `${basepath}/`) return value.slice(0, -1);
|
|
1173
|
-
return value;
|
|
1174
|
-
}
|
|
1175
|
-
/**
|
|
1176
|
-
* Compare two pathnames for exact equality after normalizing trailing slashes
|
|
1177
|
-
* relative to the provided `basepath`.
|
|
1178
|
-
*/
|
|
1179
|
-
function exactPathTest(pathName1, pathName2, basepath) {
|
|
1180
|
-
return removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath);
|
|
1181
|
-
}
|
|
1182
|
-
/**
|
|
1183
|
-
* Resolve a destination path against a base, honoring trailing-slash policy
|
|
1184
|
-
* and supporting relative segments (`.`/`..`) and absolute `to` values.
|
|
1185
|
-
*/
|
|
1186
|
-
function resolvePath({ base, to, trailingSlash = "never", cache }) {
|
|
1187
|
-
const isAbsolute = to.startsWith("/");
|
|
1188
|
-
const isBase = !isAbsolute && to === ".";
|
|
1189
|
-
let key;
|
|
1190
|
-
if (cache) {
|
|
1191
|
-
key = isAbsolute ? to : isBase ? base : base + "\0" + to;
|
|
1192
|
-
const cached = cache.get(key);
|
|
1193
|
-
if (cached) return cached;
|
|
1194
|
-
}
|
|
1195
|
-
let baseSegments;
|
|
1196
|
-
if (isBase) baseSegments = base.split("/");
|
|
1197
|
-
else if (isAbsolute) baseSegments = to.split("/");
|
|
1198
|
-
else {
|
|
1199
|
-
baseSegments = base.split("/");
|
|
1200
|
-
while (baseSegments.length > 1 && last(baseSegments) === "") baseSegments.pop();
|
|
1201
|
-
const toSegments = to.split("/");
|
|
1202
|
-
for (let index = 0, length = toSegments.length; index < length; index++) {
|
|
1203
|
-
const value = toSegments[index];
|
|
1204
|
-
if (value === "") {
|
|
1205
|
-
if (!index) baseSegments = [value];
|
|
1206
|
-
else if (index === length - 1) baseSegments.push(value);
|
|
1207
|
-
} else if (value === "..") baseSegments.pop();
|
|
1208
|
-
else if (value === ".") {} else baseSegments.push(value);
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
if (baseSegments.length > 1) {
|
|
1212
|
-
if (last(baseSegments) === "") {
|
|
1213
|
-
if (trailingSlash === "never") baseSegments.pop();
|
|
1214
|
-
} else if (trailingSlash === "always") baseSegments.push("");
|
|
1215
|
-
}
|
|
1216
|
-
const result = cleanPath(baseSegments.join("/")) || "/";
|
|
1217
|
-
if (key && cache) cache.set(key, result);
|
|
1218
|
-
return result;
|
|
1219
|
-
}
|
|
1220
|
-
/**
|
|
1221
|
-
* Create a pre-compiled decode config from allowed characters.
|
|
1222
|
-
* This should be called once at router initialization.
|
|
1223
|
-
*/
|
|
1224
|
-
function compileDecodeCharMap(pathParamsAllowedCharacters) {
|
|
1225
|
-
const charMap = new Map(pathParamsAllowedCharacters.map((char) => [encodeURIComponent(char), char]));
|
|
1226
|
-
const pattern = Array.from(charMap.keys()).map((key) => key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
1227
|
-
const regex = new RegExp(pattern, "g");
|
|
1228
|
-
return (encoded) => encoded.replace(regex, (match) => charMap.get(match) ?? match);
|
|
1229
|
-
}
|
|
1230
|
-
function encodeParam(key, params, decoder) {
|
|
1231
|
-
const value = params[key];
|
|
1232
|
-
if (typeof value !== "string") return value;
|
|
1233
|
-
if (key === "_splat") {
|
|
1234
|
-
if (/^[a-zA-Z0-9\-._~!/]*$/.test(value)) return value;
|
|
1235
|
-
return value.split("/").map((segment) => encodePathParam(segment, decoder)).join("/");
|
|
1236
|
-
} else return encodePathParam(value, decoder);
|
|
1237
|
-
}
|
|
1238
|
-
/**
|
|
1239
|
-
* Interpolate params and wildcards into a route path template.
|
|
1240
|
-
*
|
|
1241
|
-
* - Encodes params safely (configurable allowed characters)
|
|
1242
|
-
* - Supports `{-$optional}` segments, `{prefix{$id}suffix}` and `{$}` wildcards
|
|
1243
|
-
*/
|
|
1244
|
-
function interpolatePath({ path, params, decoder, ...rest }) {
|
|
1245
|
-
let isMissingParams = false;
|
|
1246
|
-
const usedParams = Object.create(null);
|
|
1247
|
-
if (!path || path === "/") return {
|
|
1248
|
-
interpolatedPath: "/",
|
|
1249
|
-
usedParams,
|
|
1250
|
-
isMissingParams
|
|
1251
|
-
};
|
|
1252
|
-
if (!path.includes("$")) return {
|
|
1253
|
-
interpolatedPath: path,
|
|
1254
|
-
usedParams,
|
|
1255
|
-
isMissingParams
|
|
1256
|
-
};
|
|
1257
|
-
if (path.indexOf("{") === -1) {
|
|
1258
|
-
const length = path.length;
|
|
1259
|
-
let cursor = 0;
|
|
1260
|
-
let joined = "";
|
|
1261
|
-
while (cursor < length) {
|
|
1262
|
-
while (cursor < length && path.charCodeAt(cursor) === 47) cursor++;
|
|
1263
|
-
if (cursor >= length) break;
|
|
1264
|
-
const start = cursor;
|
|
1265
|
-
let end = path.indexOf("/", cursor);
|
|
1266
|
-
if (end === -1) end = length;
|
|
1267
|
-
cursor = end;
|
|
1268
|
-
const part = path.substring(start, end);
|
|
1269
|
-
if (!part) continue;
|
|
1270
|
-
if (part.charCodeAt(0) === 36) if (part.length === 1) {
|
|
1271
|
-
const splat = params._splat;
|
|
1272
|
-
usedParams._splat = splat;
|
|
1273
|
-
usedParams["*"] = splat;
|
|
1274
|
-
if (!splat) {
|
|
1275
|
-
isMissingParams = true;
|
|
1276
|
-
continue;
|
|
1277
|
-
}
|
|
1278
|
-
const value = encodeParam("_splat", params, decoder);
|
|
1279
|
-
joined += "/" + value;
|
|
1280
|
-
} else {
|
|
1281
|
-
const key = part.substring(1);
|
|
1282
|
-
if (!isMissingParams && !(key in params)) isMissingParams = true;
|
|
1283
|
-
usedParams[key] = params[key];
|
|
1284
|
-
const value = encodeParam(key, params, decoder) ?? "undefined";
|
|
1285
|
-
joined += "/" + value;
|
|
1286
|
-
}
|
|
1287
|
-
else joined += "/" + part;
|
|
1288
|
-
}
|
|
1289
|
-
if (path.endsWith("/")) joined += "/";
|
|
1290
|
-
return {
|
|
1291
|
-
usedParams,
|
|
1292
|
-
interpolatedPath: joined || "/",
|
|
1293
|
-
isMissingParams
|
|
1294
|
-
};
|
|
1295
|
-
}
|
|
1296
|
-
const length = path.length;
|
|
1297
|
-
let cursor = 0;
|
|
1298
|
-
let segment;
|
|
1299
|
-
let joined = "";
|
|
1300
|
-
while (cursor < length) {
|
|
1301
|
-
const start = cursor;
|
|
1302
|
-
segment = parseSegment(path, start, segment);
|
|
1303
|
-
const end = segment[5];
|
|
1304
|
-
cursor = end + 1;
|
|
1305
|
-
if (start === end) continue;
|
|
1306
|
-
const kind = segment[0];
|
|
1307
|
-
if (kind === 0) {
|
|
1308
|
-
joined += "/" + path.substring(start, end);
|
|
1309
|
-
continue;
|
|
1310
|
-
}
|
|
1311
|
-
if (kind === 2) {
|
|
1312
|
-
const splat = params._splat;
|
|
1313
|
-
usedParams._splat = splat;
|
|
1314
|
-
usedParams["*"] = splat;
|
|
1315
|
-
const prefix = path.substring(start, segment[1]);
|
|
1316
|
-
const suffix = path.substring(segment[4], end);
|
|
1317
|
-
if (!splat) {
|
|
1318
|
-
isMissingParams = true;
|
|
1319
|
-
if (prefix || suffix) joined += "/" + prefix + suffix;
|
|
1320
|
-
continue;
|
|
1321
|
-
}
|
|
1322
|
-
const value = encodeParam("_splat", params, decoder);
|
|
1323
|
-
joined += "/" + prefix + value + suffix;
|
|
1324
|
-
continue;
|
|
1325
|
-
}
|
|
1326
|
-
if (kind === 1) {
|
|
1327
|
-
const key = path.substring(segment[2], segment[3]);
|
|
1328
|
-
if (!isMissingParams && !(key in params)) isMissingParams = true;
|
|
1329
|
-
usedParams[key] = params[key];
|
|
1330
|
-
const prefix = path.substring(start, segment[1]);
|
|
1331
|
-
const suffix = path.substring(segment[4], end);
|
|
1332
|
-
const value = encodeParam(key, params, decoder) ?? "undefined";
|
|
1333
|
-
joined += "/" + prefix + value + suffix;
|
|
1334
|
-
continue;
|
|
1335
|
-
}
|
|
1336
|
-
if (kind === 3) {
|
|
1337
|
-
const key = path.substring(segment[2], segment[3]);
|
|
1338
|
-
const valueRaw = params[key];
|
|
1339
|
-
if (valueRaw == null) continue;
|
|
1340
|
-
usedParams[key] = valueRaw;
|
|
1341
|
-
const prefix = path.substring(start, segment[1]);
|
|
1342
|
-
const suffix = path.substring(segment[4], end);
|
|
1343
|
-
const value = encodeParam(key, params, decoder) ?? "";
|
|
1344
|
-
joined += "/" + prefix + value + suffix;
|
|
1345
|
-
continue;
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
if (path.endsWith("/")) joined += "/";
|
|
1349
|
-
return {
|
|
1350
|
-
usedParams,
|
|
1351
|
-
interpolatedPath: joined || "/",
|
|
1352
|
-
isMissingParams
|
|
1353
|
-
};
|
|
1354
|
-
}
|
|
1355
|
-
function encodePathParam(value, decoder) {
|
|
1356
|
-
const encoded = encodeURIComponent(value);
|
|
1357
|
-
return decoder?.(encoded) ?? encoded;
|
|
1358
|
-
}
|
|
1359
|
-
//#endregion
|
|
1360
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/ClientOnly.js
|
|
1361
|
-
var import_jsx_runtime = require_jsx_runtime();
|
|
1362
|
-
/**
|
|
1363
|
-
* Render the children only after the JS has loaded client-side. Use an optional
|
|
1364
|
-
* fallback component if the JS is not yet loaded.
|
|
1365
|
-
*
|
|
1366
|
-
* @example
|
|
1367
|
-
* Render a Chart component if JS loads, renders a simple FakeChart
|
|
1368
|
-
* component server-side or if there is no JS. The FakeChart can have only the
|
|
1369
|
-
* UI without the behavior or be a loading spinner or skeleton.
|
|
1370
|
-
*
|
|
1371
|
-
* ```tsx
|
|
1372
|
-
* return (
|
|
1373
|
-
* <ClientOnly fallback={<FakeChart />}>
|
|
1374
|
-
* <Chart />
|
|
1375
|
-
* </ClientOnly>
|
|
1376
|
-
* )
|
|
1377
|
-
* ```
|
|
1378
|
-
*/
|
|
1379
|
-
function ClientOnly({ children, fallback = null }) {
|
|
1380
|
-
return useHydrated() ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: fallback });
|
|
1381
|
-
}
|
|
1382
|
-
/**
|
|
1383
|
-
* Return a boolean indicating if the JS has been hydrated already.
|
|
1384
|
-
* When doing Server-Side Rendering, the result will always be false.
|
|
1385
|
-
* When doing Client-Side Rendering, the result will always be false on the
|
|
1386
|
-
* first render and true from then on. Even if a new component renders it will
|
|
1387
|
-
* always start with true.
|
|
1388
|
-
*
|
|
1389
|
-
* @example
|
|
1390
|
-
* ```tsx
|
|
1391
|
-
* // Disable a button that needs JS to work.
|
|
1392
|
-
* let hydrated = useHydrated()
|
|
1393
|
-
* return (
|
|
1394
|
-
* <button type="button" disabled={!hydrated} onClick={doSomethingCustom}>
|
|
1395
|
-
* Click me
|
|
1396
|
-
* </button>
|
|
1397
|
-
* )
|
|
1398
|
-
* ```
|
|
1399
|
-
* @returns True if the JS has been hydrated already, false otherwise.
|
|
1400
|
-
*/
|
|
1401
|
-
function useHydrated() {
|
|
1402
|
-
return import_react.useSyncExternalStore(subscribe, () => true, () => false);
|
|
1403
|
-
}
|
|
1404
|
-
function subscribe() {
|
|
1405
|
-
return () => {};
|
|
1406
|
-
}
|
|
1407
|
-
//#endregion
|
|
1408
|
-
//#region ../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.7/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
|
|
1409
|
-
/**
|
|
1410
|
-
* @license React
|
|
1411
|
-
* use-sync-external-store-shim.production.js
|
|
1412
|
-
*
|
|
1413
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1414
|
-
*
|
|
1415
|
-
* This source code is licensed under the MIT license found in the
|
|
1416
|
-
* LICENSE file in the root directory of this source tree.
|
|
1417
|
-
*/
|
|
1418
|
-
var require_use_sync_external_store_shim_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1419
|
-
var React = require_react();
|
|
1420
|
-
function is(x, y) {
|
|
1421
|
-
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
1422
|
-
}
|
|
1423
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is;
|
|
1424
|
-
var useState = React.useState;
|
|
1425
|
-
var useEffect = React.useEffect;
|
|
1426
|
-
var useLayoutEffect = React.useLayoutEffect;
|
|
1427
|
-
var useDebugValue = React.useDebugValue;
|
|
1428
|
-
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
1429
|
-
var value = getSnapshot(), _useState = useState({ inst: {
|
|
1430
|
-
value,
|
|
1431
|
-
getSnapshot
|
|
1432
|
-
} }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
1433
|
-
useLayoutEffect(function() {
|
|
1434
|
-
inst.value = value;
|
|
1435
|
-
inst.getSnapshot = getSnapshot;
|
|
1436
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1437
|
-
}, [
|
|
1438
|
-
subscribe,
|
|
1439
|
-
value,
|
|
1440
|
-
getSnapshot
|
|
1441
|
-
]);
|
|
1442
|
-
useEffect(function() {
|
|
1443
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1444
|
-
return subscribe(function() {
|
|
1445
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1446
|
-
});
|
|
1447
|
-
}, [subscribe]);
|
|
1448
|
-
useDebugValue(value);
|
|
1449
|
-
return value;
|
|
1450
|
-
}
|
|
1451
|
-
function checkIfSnapshotChanged(inst) {
|
|
1452
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
1453
|
-
inst = inst.value;
|
|
1454
|
-
try {
|
|
1455
|
-
var nextValue = latestGetSnapshot();
|
|
1456
|
-
return !objectIs(inst, nextValue);
|
|
1457
|
-
} catch (error) {
|
|
1458
|
-
return !0;
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
1462
|
-
return getSnapshot();
|
|
1463
|
-
}
|
|
1464
|
-
var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
1465
|
-
exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
1466
|
-
}));
|
|
1467
|
-
//#endregion
|
|
1468
|
-
//#region ../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.7/node_modules/use-sync-external-store/shim/index.js
|
|
1469
|
-
var require_shim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1470
|
-
module.exports = require_use_sync_external_store_shim_production();
|
|
1471
|
-
}));
|
|
1472
|
-
//#endregion
|
|
1473
|
-
//#region ../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.7/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js
|
|
1474
|
-
/**
|
|
1475
|
-
* @license React
|
|
1476
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
1477
|
-
*
|
|
1478
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1479
|
-
*
|
|
1480
|
-
* This source code is licensed under the MIT license found in the
|
|
1481
|
-
* LICENSE file in the root directory of this source tree.
|
|
1482
|
-
*/
|
|
1483
|
-
var require_with_selector_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1484
|
-
var React = require_react();
|
|
1485
|
-
var shim = require_shim();
|
|
1486
|
-
function is(x, y) {
|
|
1487
|
-
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
1488
|
-
}
|
|
1489
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is;
|
|
1490
|
-
var useSyncExternalStore = shim.useSyncExternalStore;
|
|
1491
|
-
var useRef = React.useRef;
|
|
1492
|
-
var useEffect = React.useEffect;
|
|
1493
|
-
var useMemo = React.useMemo;
|
|
1494
|
-
var useDebugValue = React.useDebugValue;
|
|
1495
|
-
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
1496
|
-
var instRef = useRef(null);
|
|
1497
|
-
if (null === instRef.current) {
|
|
1498
|
-
var inst = {
|
|
1499
|
-
hasValue: !1,
|
|
1500
|
-
value: null
|
|
1501
|
-
};
|
|
1502
|
-
instRef.current = inst;
|
|
1503
|
-
} else inst = instRef.current;
|
|
1504
|
-
instRef = useMemo(function() {
|
|
1505
|
-
function memoizedSelector(nextSnapshot) {
|
|
1506
|
-
if (!hasMemo) {
|
|
1507
|
-
hasMemo = !0;
|
|
1508
|
-
memoizedSnapshot = nextSnapshot;
|
|
1509
|
-
nextSnapshot = selector(nextSnapshot);
|
|
1510
|
-
if (void 0 !== isEqual && inst.hasValue) {
|
|
1511
|
-
var currentSelection = inst.value;
|
|
1512
|
-
if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
|
|
1513
|
-
}
|
|
1514
|
-
return memoizedSelection = nextSnapshot;
|
|
1515
|
-
}
|
|
1516
|
-
currentSelection = memoizedSelection;
|
|
1517
|
-
if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
|
|
1518
|
-
var nextSelection = selector(nextSnapshot);
|
|
1519
|
-
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
|
|
1520
|
-
memoizedSnapshot = nextSnapshot;
|
|
1521
|
-
return memoizedSelection = nextSelection;
|
|
1522
|
-
}
|
|
1523
|
-
var hasMemo = !1, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
1524
|
-
return [function() {
|
|
1525
|
-
return memoizedSelector(getSnapshot());
|
|
1526
|
-
}, null === maybeGetServerSnapshot ? void 0 : function() {
|
|
1527
|
-
return memoizedSelector(maybeGetServerSnapshot());
|
|
1528
|
-
}];
|
|
1529
|
-
}, [
|
|
1530
|
-
getSnapshot,
|
|
1531
|
-
getServerSnapshot,
|
|
1532
|
-
selector,
|
|
1533
|
-
isEqual
|
|
1534
|
-
]);
|
|
1535
|
-
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
1536
|
-
useEffect(function() {
|
|
1537
|
-
inst.hasValue = !0;
|
|
1538
|
-
inst.value = value;
|
|
1539
|
-
}, [value]);
|
|
1540
|
-
useDebugValue(value);
|
|
1541
|
-
return value;
|
|
1542
|
-
};
|
|
1543
|
-
}));
|
|
1544
|
-
//#endregion
|
|
1545
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-store@0.9.3_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-store/dist/esm/useStore.js
|
|
1546
|
-
var import_with_selector = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1547
|
-
module.exports = require_with_selector_production();
|
|
1548
|
-
})))();
|
|
1549
|
-
function defaultCompare(a, b) {
|
|
1550
|
-
return a === b;
|
|
1551
|
-
}
|
|
1552
|
-
function useStore(atom, selector, compare = defaultCompare) {
|
|
1553
|
-
const subscribe = (0, import_react.useCallback)((handleStoreChange) => {
|
|
1554
|
-
if (!atom) return () => {};
|
|
1555
|
-
const { unsubscribe } = atom.subscribe(handleStoreChange);
|
|
1556
|
-
return unsubscribe;
|
|
1557
|
-
}, [atom]);
|
|
1558
|
-
const boundGetSnapshot = (0, import_react.useCallback)(() => atom?.get(), [atom]);
|
|
1559
|
-
return (0, import_with_selector.useSyncExternalStoreWithSelector)(subscribe, boundGetSnapshot, boundGetSnapshot, selector, compare);
|
|
1560
|
-
}
|
|
1561
|
-
//#endregion
|
|
1562
|
-
//#region ../../node_modules/.pnpm/react-dom@19.2.7_react@19.2.7/node_modules/react-dom/cjs/react-dom.production.js
|
|
1563
|
-
/**
|
|
1564
|
-
* @license React
|
|
1565
|
-
* react-dom.production.js
|
|
1566
|
-
*
|
|
1567
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1568
|
-
*
|
|
1569
|
-
* This source code is licensed under the MIT license found in the
|
|
1570
|
-
* LICENSE file in the root directory of this source tree.
|
|
1571
|
-
*/
|
|
1572
|
-
var require_react_dom_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1573
|
-
var React = require_react();
|
|
1574
|
-
function formatProdErrorMessage(code) {
|
|
1575
|
-
var url = "https://react.dev/errors/" + code;
|
|
1576
|
-
if (1 < arguments.length) {
|
|
1577
|
-
url += "?args[]=" + encodeURIComponent(arguments[1]);
|
|
1578
|
-
for (var i = 2; i < arguments.length; i++) url += "&args[]=" + encodeURIComponent(arguments[i]);
|
|
1579
|
-
}
|
|
1580
|
-
return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
|
|
1581
|
-
}
|
|
1582
|
-
function noop() {}
|
|
1583
|
-
var Internals = {
|
|
1584
|
-
d: {
|
|
1585
|
-
f: noop,
|
|
1586
|
-
r: function() {
|
|
1587
|
-
throw Error(formatProdErrorMessage(522));
|
|
1588
|
-
},
|
|
1589
|
-
D: noop,
|
|
1590
|
-
C: noop,
|
|
1591
|
-
L: noop,
|
|
1592
|
-
m: noop,
|
|
1593
|
-
X: noop,
|
|
1594
|
-
S: noop,
|
|
1595
|
-
M: noop
|
|
1596
|
-
},
|
|
1597
|
-
p: 0,
|
|
1598
|
-
findDOMNode: null
|
|
1599
|
-
};
|
|
1600
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
1601
|
-
function createPortal$1(children, containerInfo, implementation) {
|
|
1602
|
-
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
1603
|
-
return {
|
|
1604
|
-
$$typeof: REACT_PORTAL_TYPE,
|
|
1605
|
-
key: null == key ? null : "" + key,
|
|
1606
|
-
children,
|
|
1607
|
-
containerInfo,
|
|
1608
|
-
implementation
|
|
1609
|
-
};
|
|
1610
|
-
}
|
|
1611
|
-
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
1612
|
-
function getCrossOriginStringAs(as, input) {
|
|
1613
|
-
if ("font" === as) return "";
|
|
1614
|
-
if ("string" === typeof input) return "use-credentials" === input ? input : "";
|
|
1615
|
-
}
|
|
1616
|
-
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
|
1617
|
-
exports.createPortal = function(children, container) {
|
|
1618
|
-
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
|
1619
|
-
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType) throw Error(formatProdErrorMessage(299));
|
|
1620
|
-
return createPortal$1(children, container, null, key);
|
|
1621
|
-
};
|
|
1622
|
-
exports.flushSync = function(fn) {
|
|
1623
|
-
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
|
1624
|
-
try {
|
|
1625
|
-
if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
|
|
1626
|
-
} finally {
|
|
1627
|
-
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
|
|
1628
|
-
}
|
|
1629
|
-
};
|
|
1630
|
-
exports.preconnect = function(href, options) {
|
|
1631
|
-
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
|
1632
|
-
};
|
|
1633
|
-
exports.prefetchDNS = function(href) {
|
|
1634
|
-
"string" === typeof href && Internals.d.D(href);
|
|
1635
|
-
};
|
|
1636
|
-
exports.preinit = function(href, options) {
|
|
1637
|
-
if ("string" === typeof href && options && "string" === typeof options.as) {
|
|
1638
|
-
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
|
1639
|
-
"style" === as ? Internals.d.S(href, "string" === typeof options.precedence ? options.precedence : void 0, {
|
|
1640
|
-
crossOrigin,
|
|
1641
|
-
integrity,
|
|
1642
|
-
fetchPriority
|
|
1643
|
-
}) : "script" === as && Internals.d.X(href, {
|
|
1644
|
-
crossOrigin,
|
|
1645
|
-
integrity,
|
|
1646
|
-
fetchPriority,
|
|
1647
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
1648
|
-
});
|
|
1649
|
-
}
|
|
1650
|
-
};
|
|
1651
|
-
exports.preinitModule = function(href, options) {
|
|
1652
|
-
if ("string" === typeof href) if ("object" === typeof options && null !== options) {
|
|
1653
|
-
if (null == options.as || "script" === options.as) {
|
|
1654
|
-
var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
|
|
1655
|
-
Internals.d.M(href, {
|
|
1656
|
-
crossOrigin,
|
|
1657
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
1658
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
1659
|
-
});
|
|
1660
|
-
}
|
|
1661
|
-
} else options ?? Internals.d.M(href);
|
|
1662
|
-
};
|
|
1663
|
-
exports.preload = function(href, options) {
|
|
1664
|
-
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
|
1665
|
-
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
|
|
1666
|
-
Internals.d.L(href, as, {
|
|
1667
|
-
crossOrigin,
|
|
1668
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
1669
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
|
1670
|
-
type: "string" === typeof options.type ? options.type : void 0,
|
|
1671
|
-
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
|
1672
|
-
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
|
1673
|
-
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
|
1674
|
-
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
|
1675
|
-
media: "string" === typeof options.media ? options.media : void 0
|
|
1676
|
-
});
|
|
1677
|
-
}
|
|
1678
|
-
};
|
|
1679
|
-
exports.preloadModule = function(href, options) {
|
|
1680
|
-
if ("string" === typeof href) if (options) {
|
|
1681
|
-
var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
|
|
1682
|
-
Internals.d.m(href, {
|
|
1683
|
-
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
|
1684
|
-
crossOrigin,
|
|
1685
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
|
1686
|
-
});
|
|
1687
|
-
} else Internals.d.m(href);
|
|
1688
|
-
};
|
|
1689
|
-
exports.requestFormReset = function(form) {
|
|
1690
|
-
Internals.d.r(form);
|
|
1691
|
-
};
|
|
1692
|
-
exports.unstable_batchedUpdates = function(fn, a) {
|
|
1693
|
-
return fn(a);
|
|
1694
|
-
};
|
|
1695
|
-
exports.useFormState = function(action, initialState, permalink) {
|
|
1696
|
-
return ReactSharedInternals.H.useFormState(action, initialState, permalink);
|
|
1697
|
-
};
|
|
1698
|
-
exports.useFormStatus = function() {
|
|
1699
|
-
return ReactSharedInternals.H.useHostTransitionStatus();
|
|
1700
|
-
};
|
|
1701
|
-
exports.version = "19.2.7";
|
|
1702
|
-
}));
|
|
1703
|
-
//#endregion
|
|
1704
|
-
//#region ../../node_modules/.pnpm/react-dom@19.2.7_react@19.2.7/node_modules/react-dom/index.js
|
|
1705
|
-
var require_react_dom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1706
|
-
function checkDCE() {
|
|
1707
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") return;
|
|
1708
|
-
try {
|
|
1709
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
|
1710
|
-
} catch (err) {
|
|
1711
|
-
console.error(err);
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
checkDCE();
|
|
1715
|
-
module.exports = require_react_dom_production();
|
|
1716
|
-
}));
|
|
1717
|
-
//#endregion
|
|
1718
|
-
export { functionalUpdate as A, useIntersectionObserver as B, DEFAULT_PROTOCOL_ALLOWLIST as C, deepEqual as D, decodePath as E, last as F, usePrevious as H, nullReplaceEqualDeep as I, replaceEqualDeep as L, isDangerousProtocol as M, isModuleNotFoundError as N, encodePathLikeUrl as O, isPromise as P, reactUse as R, invariant as S, createControlledPromise as T, useLayoutEffect as V, findRouteMatch as _, cleanPath as a, processRouteTree as b, interpolatePath as c, resolvePath as d, trimPath as f, findFlatMatch as g, buildRouteBranch as h, useHydrated as i, hasKeys as j, escapeHtml as k, joinPaths as l, trimPathRight as m, useStore as n, compileDecodeCharMap as o, trimPathLeft as p, ClientOnly as r, exactPathTest as s, require_react_dom as t, removeTrailingSlash as u, findSingleMatch as v, arraysEqual as w, createLRUCache as x, processRouteMasks as y, useForwardedRef as z };
|