quirk-ui 0.0.4 → 0.0.6
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/dist/assets/index.css +1 -1
- package/dist/assets/index.css.d.ts +7 -0
- package/dist/assets/index10.css +1 -0
- package/dist/assets/index10.css.d.ts +6 -0
- package/dist/assets/index11.css +1 -0
- package/dist/assets/index11.css.d.ts +7 -0
- package/dist/assets/index12.css +1 -0
- package/dist/assets/index12.css.d.ts +13 -0
- package/dist/assets/index13.css +1 -0
- package/dist/assets/index13.css.d.ts +8 -0
- package/dist/assets/index14.css +1 -0
- package/dist/assets/index14.css.d.ts +13 -0
- package/dist/assets/index15.css +1 -0
- package/dist/assets/index15.css.d.ts +10 -0
- package/dist/assets/index16.css +1 -0
- package/dist/assets/index16.css.d.ts +8 -0
- package/dist/assets/index17.css +1 -0
- package/dist/assets/index17.css.d.ts +11 -0
- package/dist/assets/index18.css +1 -0
- package/dist/assets/index18.css.d.ts +31 -0
- package/dist/assets/index19.css +1 -0
- package/dist/assets/index19.css.d.ts +7 -0
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index2.css.d.ts +9 -0
- package/dist/assets/index20.css +1 -0
- package/dist/assets/index20.css.d.ts +5 -0
- package/dist/assets/index21.css +1 -0
- package/dist/assets/index21.css.d.ts +8 -0
- package/dist/assets/index22.css +1 -0
- package/dist/assets/index22.css.d.ts +6 -0
- package/dist/assets/index23.css +1 -0
- package/dist/assets/index23.css.d.ts +7 -0
- package/dist/assets/index24.css +1 -0
- package/dist/assets/index24.css.d.ts +7 -0
- package/dist/assets/index25.css +1 -0
- package/dist/assets/index25.css.d.ts +9 -0
- package/dist/assets/index26.css +1 -0
- package/dist/assets/index26.css.d.ts +21 -0
- package/dist/assets/index27.css +1 -0
- package/dist/assets/index27.css.d.ts +9 -0
- package/dist/assets/index28.css +1 -0
- package/dist/assets/index28.css.d.ts +12 -0
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index3.css.d.ts +8 -0
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index4.css.d.ts +8 -0
- package/dist/assets/index5.css +1 -0
- package/dist/assets/index5.css.d.ts +21 -0
- package/dist/assets/index6.css +1 -0
- package/dist/assets/index6.css.d.ts +11 -0
- package/dist/assets/index7.css +1 -0
- package/dist/assets/index7.css.d.ts +6 -0
- package/dist/assets/index8.css +1 -0
- package/dist/assets/index8.css.d.ts +10 -0
- package/dist/assets/index9.css +1 -0
- package/dist/assets/index9.css.d.ts +7 -0
- package/dist/components/Box/Box.test.js +20 -0
- package/dist/components/Box/__mocks__/styles.module.css.js +20 -0
- package/dist/components/Box/index.js +89 -0
- package/dist/components/Button/Button.test.js +33 -0
- package/dist/components/Button/__mocks__/styles.module.css.js +9 -0
- package/dist/components/Button/index.js +17 -7
- package/dist/components/ButtonGroup/ButtonGroup.test.js +37 -0
- package/dist/components/ButtonGroup/__mocks__/styles.module.css.js +7 -0
- package/dist/components/ButtonGroup/index.js +26 -0
- package/dist/components/Calendar/Calendar.test.js +40 -0
- package/dist/components/Calendar/index.js +7 -0
- package/dist/components/Checkbox/Checkbox.test.js +37 -0
- package/dist/components/Checkbox/__mocks__/styles.module.css.js +8 -0
- package/dist/components/Checkbox/index.js +45 -0
- package/dist/components/Container/Container.test.js +25 -0
- package/dist/components/Container/__mocks__/styles.module.css.js +11 -0
- package/dist/components/Container/index.js +31 -0
- package/dist/components/DatePicker/DatePicker.test.js +42 -0
- package/dist/components/DatePicker/index.js +56 -0
- package/dist/components/Divider/Divider.test.js +21 -0
- package/dist/components/Divider/__mocks__/styles.module.css.js +8 -0
- package/dist/components/Divider/index.js +19 -0
- package/dist/components/Fieldset/Fieldset.test.js +12 -0
- package/dist/components/Fieldset/index.js +19 -0
- package/dist/components/FileUpload/FileUpload.test.js +33 -0
- package/dist/components/FileUpload/index.js +99 -0
- package/dist/components/FloatingActionButton/FloatingActionButton.test.js +36 -0
- package/dist/components/FloatingActionButton/__mocks__/styles.module.css.js +9 -0
- package/dist/components/FloatingActionButton/index.js +40 -0
- package/dist/components/Form/Form.test.js +20 -0
- package/dist/components/Form/index.js +29 -0
- package/dist/components/Grid/Grid.test.js +59 -0
- package/dist/components/Grid/index.js +32 -0
- package/dist/components/Heading/Heading.test.js +26 -0
- package/dist/components/Heading/__mocks__/styles.module.css.js +11 -0
- package/dist/components/Heading/index.js +20 -7
- package/dist/components/IconButton/IconButton.test.js +48 -0
- package/dist/components/IconButton/__mocks__/styles.module.css.js +12 -0
- package/dist/components/IconButton/index.js +39 -0
- package/dist/components/Input/Input.test.js +13 -0
- package/dist/components/Input/__mocks__/styles.module.css.js +9 -0
- package/dist/components/Input/index.js +45 -6
- package/dist/components/Label/Label.test.js +30 -0
- package/dist/components/Label/__mocks__/styles.module.css.js +16 -0
- package/dist/components/Label/index.js +94 -6
- package/dist/components/Link/Link.test.js +32 -0
- package/dist/components/Link/__mocks__/styles.module.css.js +8 -0
- package/dist/components/Link/index.js +5 -0
- package/dist/components/MultiSelect/MultiSelect.test.js +3144 -0
- package/dist/components/MultiSelect/index.js +45 -0
- package/dist/components/Radio/Radio.test.js +39 -0
- package/dist/components/Radio/__mocks__/styles.module.css.js +8 -0
- package/dist/components/Radio/index.js +37 -0
- package/dist/components/Range/Range.test.js +39 -0
- package/dist/components/Range/index.js +64 -0
- package/dist/components/Select/Select.test.js +48 -0
- package/dist/components/Select/index.js +43 -0
- package/dist/components/Spacer/Spacer.test.js +22 -0
- package/dist/components/Spacer/__mocks__/styles.module.css.js +12 -0
- package/dist/components/Spacer/index.js +29 -0
- package/dist/components/Stack/Stack.test.js +60 -0
- package/dist/components/Stack/__mocks__/styles.module.css.js +21 -0
- package/dist/components/Stack/index.js +65 -0
- package/dist/components/Switch/Switch.test.js +48 -0
- package/dist/components/Switch/index.js +57 -0
- package/dist/components/Table/Table.test.js +31 -0
- package/dist/components/Table/index.js +31 -0
- package/dist/components/Text/Text.test.js +65 -0
- package/dist/components/Text/__mocks__/styles.module.css.js +9 -0
- package/dist/components/Text/index.js +50 -0
- package/dist/components/Textarea/Textarea.test.js +37 -0
- package/dist/components/Textarea/index.js +47 -0
- package/dist/createLucideIcon-C8GTh_Qx.js +89 -0
- package/dist/index-BWTAh3RO.js +57529 -0
- package/dist/index-BtY6pil2.js +1621 -0
- package/dist/index-DhqFdMqD.js +1416 -0
- package/dist/lib/components/Box/Box.test.d.ts +0 -0
- package/dist/lib/components/Box/__mocks__/styles.module.css.d.ts +18 -0
- package/dist/lib/components/Box/index.d.ts +59 -0
- package/dist/lib/components/Button/Button.test.d.ts +0 -0
- package/dist/lib/components/Button/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/Button/index.d.ts +11 -1
- package/dist/lib/components/ButtonGroup/ButtonGroup.test.d.ts +0 -0
- package/dist/lib/components/ButtonGroup/__mocks__/styles.module.css.d.ts +5 -0
- package/dist/lib/components/ButtonGroup/index.d.ts +8 -0
- package/dist/lib/components/Calendar/Calendar.test.d.ts +0 -0
- package/dist/lib/components/Calendar/index.d.ts +6 -0
- package/dist/lib/components/Checkbox/Checkbox.test.d.ts +0 -0
- package/dist/lib/components/Checkbox/__mocks__/styles.module.css.d.ts +6 -0
- package/dist/lib/components/Checkbox/index.d.ts +10 -0
- package/dist/lib/components/Container/Container.test.d.ts +0 -0
- package/dist/lib/components/Container/__mocks__/styles.module.css.d.ts +9 -0
- package/dist/lib/components/Container/index.d.ts +20 -0
- package/dist/lib/components/DatePicker/DatePicker.test.d.ts +0 -0
- package/dist/lib/components/DatePicker/index.d.ts +13 -0
- package/dist/lib/components/Divider/Divider.test.d.ts +0 -0
- package/dist/lib/components/Divider/__mocks__/styles.module.css.d.ts +6 -0
- package/dist/lib/components/Divider/index.d.ts +12 -0
- package/dist/lib/components/Fieldset/Fieldset.test.d.ts +0 -0
- package/dist/lib/components/Fieldset/index.d.ts +7 -0
- package/dist/lib/components/FileUpload/FileUpload.test.d.ts +0 -0
- package/dist/lib/components/FileUpload/index.d.ts +13 -0
- package/dist/lib/components/FloatingActionButton/FloatingActionButton.test.d.ts +0 -0
- package/dist/lib/components/FloatingActionButton/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/FloatingActionButton/index.d.ts +18 -0
- package/dist/lib/components/Form/Form.test.d.ts +0 -0
- package/dist/lib/components/Form/index.d.ts +12 -0
- package/dist/lib/components/Grid/Grid.test.d.ts +0 -0
- package/dist/lib/components/Grid/index.d.ts +11 -0
- package/dist/lib/components/Heading/Heading.test.d.ts +0 -0
- package/dist/lib/components/Heading/__mocks__/styles.module.css.d.ts +9 -0
- package/dist/lib/components/Heading/index.d.ts +291 -1
- package/dist/lib/components/IconButton/IconButton.test.d.ts +0 -0
- package/dist/lib/components/IconButton/__mocks__/styles.module.css.d.ts +10 -0
- package/dist/lib/components/IconButton/index.d.ts +24 -0
- package/dist/lib/components/Input/Input.test.d.ts +0 -0
- package/dist/lib/components/Input/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/Input/index.d.ts +10 -1
- package/dist/lib/components/Label/Label.test.d.ts +0 -0
- package/dist/lib/components/Label/__mocks__/styles.module.css.d.ts +14 -0
- package/dist/lib/components/Label/index.d.ts +29 -1
- package/dist/lib/components/Link/Link.test.d.ts +0 -0
- package/dist/lib/components/Link/__mocks__/styles.module.css.d.ts +6 -0
- package/dist/lib/components/Link/index.d.ts +18 -0
- package/dist/lib/components/MultiSelect/MultiSelect.test.d.ts +0 -0
- package/dist/lib/components/MultiSelect/index.d.ts +17 -0
- package/dist/lib/components/Radio/Radio.test.d.ts +0 -0
- package/dist/lib/components/Radio/__mocks__/styles.module.css.d.ts +6 -0
- package/dist/lib/components/Radio/index.d.ts +12 -0
- package/dist/lib/components/Range/Range.test.d.ts +0 -0
- package/dist/lib/components/Range/index.d.ts +15 -0
- package/dist/lib/components/Select/Select.test.d.ts +0 -0
- package/dist/lib/components/Select/index.d.ts +18 -0
- package/dist/lib/components/Spacer/Spacer.test.d.ts +0 -0
- package/dist/lib/components/Spacer/__mocks__/styles.module.css.d.ts +10 -0
- package/dist/lib/components/Spacer/index.d.ts +20 -0
- package/dist/lib/components/Stack/Stack.test.d.ts +0 -0
- package/dist/lib/components/Stack/__mocks__/styles.module.css.d.ts +19 -0
- package/dist/lib/components/Stack/index.d.ts +42 -0
- package/dist/lib/components/Switch/Switch.test.d.ts +0 -0
- package/dist/lib/components/Switch/index.d.ts +18 -0
- package/dist/lib/components/Table/Table.test.d.ts +0 -0
- package/dist/lib/components/Table/index.d.ts +15 -0
- package/dist/lib/components/Text/Text.test.d.ts +0 -0
- package/dist/lib/components/Text/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/Text/index.d.ts +17 -0
- package/dist/lib/components/Textarea/Textarea.test.d.ts +0 -0
- package/dist/lib/components/Textarea/index.d.ts +13 -0
- package/dist/lib/main.d.ts +26 -1
- package/dist/lib/utils/renderRichText.d.ts +25 -0
- package/dist/magic-string.es-D4UQQyt0.js +859 -0
- package/dist/main.js +54 -6
- package/dist/trash-2-2Rn0a4s6.js +17 -0
- package/dist/utils/renderRichText.js +26 -0
- package/package.json +23 -6
|
@@ -0,0 +1,1621 @@
|
|
|
1
|
+
import { jsx as _, jsxs as Se, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import './assets/index27.css';const Pe = "_link_98em4_1", Le = "_muted_98em4_13", $e = "_underline_98em4_17", Ie = "_icon_98em4_21", N = {
|
|
4
|
+
link: Pe,
|
|
5
|
+
default: "_default_98em4_9",
|
|
6
|
+
muted: Le,
|
|
7
|
+
underline: $e,
|
|
8
|
+
icon: Ie
|
|
9
|
+
};
|
|
10
|
+
var U = {}, le;
|
|
11
|
+
function Te() {
|
|
12
|
+
if (le) return U;
|
|
13
|
+
le = 1, Object.defineProperty(U, "__esModule", { value: !0 }), U.parse = c, U.serialize = o;
|
|
14
|
+
const e = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/, n = /^[\u0021-\u003A\u003C-\u007E]*$/, t = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i, i = /^[\u0020-\u003A\u003D-\u007E]*$/, r = Object.prototype.toString, a = /* @__PURE__ */ (() => {
|
|
15
|
+
const m = function() {
|
|
16
|
+
};
|
|
17
|
+
return m.prototype = /* @__PURE__ */ Object.create(null), m;
|
|
18
|
+
})();
|
|
19
|
+
function c(m, d) {
|
|
20
|
+
const f = new a(), y = m.length;
|
|
21
|
+
if (y < 2)
|
|
22
|
+
return f;
|
|
23
|
+
const x = (d == null ? void 0 : d.decode) || h;
|
|
24
|
+
let g = 0;
|
|
25
|
+
do {
|
|
26
|
+
const v = m.indexOf("=", g);
|
|
27
|
+
if (v === -1)
|
|
28
|
+
break;
|
|
29
|
+
const w = m.indexOf(";", g), E = w === -1 ? y : w;
|
|
30
|
+
if (v > E) {
|
|
31
|
+
g = m.lastIndexOf(";", v - 1) + 1;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const S = u(m, g, v), F = l(m, v, S), I = m.slice(S, F);
|
|
35
|
+
if (f[I] === void 0) {
|
|
36
|
+
let M = u(m, v + 1, E), R = l(m, E, M);
|
|
37
|
+
const T = x(m.slice(M, R));
|
|
38
|
+
f[I] = T;
|
|
39
|
+
}
|
|
40
|
+
g = E + 1;
|
|
41
|
+
} while (g < y);
|
|
42
|
+
return f;
|
|
43
|
+
}
|
|
44
|
+
function u(m, d, f) {
|
|
45
|
+
do {
|
|
46
|
+
const y = m.charCodeAt(d);
|
|
47
|
+
if (y !== 32 && y !== 9)
|
|
48
|
+
return d;
|
|
49
|
+
} while (++d < f);
|
|
50
|
+
return f;
|
|
51
|
+
}
|
|
52
|
+
function l(m, d, f) {
|
|
53
|
+
for (; d > f; ) {
|
|
54
|
+
const y = m.charCodeAt(--d);
|
|
55
|
+
if (y !== 32 && y !== 9)
|
|
56
|
+
return d + 1;
|
|
57
|
+
}
|
|
58
|
+
return f;
|
|
59
|
+
}
|
|
60
|
+
function o(m, d, f) {
|
|
61
|
+
const y = (f == null ? void 0 : f.encode) || encodeURIComponent;
|
|
62
|
+
if (!e.test(m))
|
|
63
|
+
throw new TypeError(`argument name is invalid: ${m}`);
|
|
64
|
+
const x = y(d);
|
|
65
|
+
if (!n.test(x))
|
|
66
|
+
throw new TypeError(`argument val is invalid: ${d}`);
|
|
67
|
+
let g = m + "=" + x;
|
|
68
|
+
if (!f)
|
|
69
|
+
return g;
|
|
70
|
+
if (f.maxAge !== void 0) {
|
|
71
|
+
if (!Number.isInteger(f.maxAge))
|
|
72
|
+
throw new TypeError(`option maxAge is invalid: ${f.maxAge}`);
|
|
73
|
+
g += "; Max-Age=" + f.maxAge;
|
|
74
|
+
}
|
|
75
|
+
if (f.domain) {
|
|
76
|
+
if (!t.test(f.domain))
|
|
77
|
+
throw new TypeError(`option domain is invalid: ${f.domain}`);
|
|
78
|
+
g += "; Domain=" + f.domain;
|
|
79
|
+
}
|
|
80
|
+
if (f.path) {
|
|
81
|
+
if (!i.test(f.path))
|
|
82
|
+
throw new TypeError(`option path is invalid: ${f.path}`);
|
|
83
|
+
g += "; Path=" + f.path;
|
|
84
|
+
}
|
|
85
|
+
if (f.expires) {
|
|
86
|
+
if (!p(f.expires) || !Number.isFinite(f.expires.valueOf()))
|
|
87
|
+
throw new TypeError(`option expires is invalid: ${f.expires}`);
|
|
88
|
+
g += "; Expires=" + f.expires.toUTCString();
|
|
89
|
+
}
|
|
90
|
+
if (f.httpOnly && (g += "; HttpOnly"), f.secure && (g += "; Secure"), f.partitioned && (g += "; Partitioned"), f.priority)
|
|
91
|
+
switch (typeof f.priority == "string" ? f.priority.toLowerCase() : void 0) {
|
|
92
|
+
case "low":
|
|
93
|
+
g += "; Priority=Low";
|
|
94
|
+
break;
|
|
95
|
+
case "medium":
|
|
96
|
+
g += "; Priority=Medium";
|
|
97
|
+
break;
|
|
98
|
+
case "high":
|
|
99
|
+
g += "; Priority=High";
|
|
100
|
+
break;
|
|
101
|
+
default:
|
|
102
|
+
throw new TypeError(`option priority is invalid: ${f.priority}`);
|
|
103
|
+
}
|
|
104
|
+
if (f.sameSite)
|
|
105
|
+
switch (typeof f.sameSite == "string" ? f.sameSite.toLowerCase() : f.sameSite) {
|
|
106
|
+
case !0:
|
|
107
|
+
case "strict":
|
|
108
|
+
g += "; SameSite=Strict";
|
|
109
|
+
break;
|
|
110
|
+
case "lax":
|
|
111
|
+
g += "; SameSite=Lax";
|
|
112
|
+
break;
|
|
113
|
+
case "none":
|
|
114
|
+
g += "; SameSite=None";
|
|
115
|
+
break;
|
|
116
|
+
default:
|
|
117
|
+
throw new TypeError(`option sameSite is invalid: ${f.sameSite}`);
|
|
118
|
+
}
|
|
119
|
+
return g;
|
|
120
|
+
}
|
|
121
|
+
function h(m) {
|
|
122
|
+
if (m.indexOf("%") === -1)
|
|
123
|
+
return m;
|
|
124
|
+
try {
|
|
125
|
+
return decodeURIComponent(m);
|
|
126
|
+
} catch {
|
|
127
|
+
return m;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function p(m) {
|
|
131
|
+
return r.call(m) === "[object Date]";
|
|
132
|
+
}
|
|
133
|
+
return U;
|
|
134
|
+
}
|
|
135
|
+
Te();
|
|
136
|
+
/**
|
|
137
|
+
* react-router v7.5.3
|
|
138
|
+
*
|
|
139
|
+
* Copyright (c) Remix Software Inc.
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the MIT license found in the
|
|
142
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
143
|
+
*
|
|
144
|
+
* @license MIT
|
|
145
|
+
*/
|
|
146
|
+
function Me(e = {}) {
|
|
147
|
+
let { initialEntries: n = ["/"], initialIndex: t, v5Compat: i = !1 } = e, r;
|
|
148
|
+
r = n.map(
|
|
149
|
+
(d, f) => h(
|
|
150
|
+
d,
|
|
151
|
+
typeof d == "string" ? null : d.state,
|
|
152
|
+
f === 0 ? "default" : void 0
|
|
153
|
+
)
|
|
154
|
+
);
|
|
155
|
+
let a = l(
|
|
156
|
+
t ?? r.length - 1
|
|
157
|
+
), c = "POP", u = null;
|
|
158
|
+
function l(d) {
|
|
159
|
+
return Math.min(Math.max(d, 0), r.length - 1);
|
|
160
|
+
}
|
|
161
|
+
function o() {
|
|
162
|
+
return r[a];
|
|
163
|
+
}
|
|
164
|
+
function h(d, f = null, y) {
|
|
165
|
+
let x = De(
|
|
166
|
+
r ? o().pathname : "/",
|
|
167
|
+
d,
|
|
168
|
+
f,
|
|
169
|
+
y
|
|
170
|
+
);
|
|
171
|
+
return b(
|
|
172
|
+
x.pathname.charAt(0) === "/",
|
|
173
|
+
`relative pathnames are not supported in memory history: ${JSON.stringify(
|
|
174
|
+
d
|
|
175
|
+
)}`
|
|
176
|
+
), x;
|
|
177
|
+
}
|
|
178
|
+
function p(d) {
|
|
179
|
+
return typeof d == "string" ? d : J(d);
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
get index() {
|
|
183
|
+
return a;
|
|
184
|
+
},
|
|
185
|
+
get action() {
|
|
186
|
+
return c;
|
|
187
|
+
},
|
|
188
|
+
get location() {
|
|
189
|
+
return o();
|
|
190
|
+
},
|
|
191
|
+
createHref: p,
|
|
192
|
+
createURL(d) {
|
|
193
|
+
return new URL(p(d), "http://localhost");
|
|
194
|
+
},
|
|
195
|
+
encodeLocation(d) {
|
|
196
|
+
let f = typeof d == "string" ? A(d) : d;
|
|
197
|
+
return {
|
|
198
|
+
pathname: f.pathname || "",
|
|
199
|
+
search: f.search || "",
|
|
200
|
+
hash: f.hash || ""
|
|
201
|
+
};
|
|
202
|
+
},
|
|
203
|
+
push(d, f) {
|
|
204
|
+
c = "PUSH";
|
|
205
|
+
let y = h(d, f);
|
|
206
|
+
a += 1, r.splice(a, r.length, y), i && u && u({ action: c, location: y, delta: 1 });
|
|
207
|
+
},
|
|
208
|
+
replace(d, f) {
|
|
209
|
+
c = "REPLACE";
|
|
210
|
+
let y = h(d, f);
|
|
211
|
+
r[a] = y, i && u && u({ action: c, location: y, delta: 0 });
|
|
212
|
+
},
|
|
213
|
+
go(d) {
|
|
214
|
+
c = "POP";
|
|
215
|
+
let f = l(a + d), y = r[f];
|
|
216
|
+
a = f, u && u({ action: c, location: y, delta: d });
|
|
217
|
+
},
|
|
218
|
+
listen(d) {
|
|
219
|
+
return u = d, () => {
|
|
220
|
+
u = null;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function C(e, n) {
|
|
226
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
227
|
+
throw new Error(n);
|
|
228
|
+
}
|
|
229
|
+
function b(e, n) {
|
|
230
|
+
if (!e) {
|
|
231
|
+
typeof console < "u" && console.warn(n);
|
|
232
|
+
try {
|
|
233
|
+
throw new Error(n);
|
|
234
|
+
} catch {
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function Ne() {
|
|
239
|
+
return Math.random().toString(36).substring(2, 10);
|
|
240
|
+
}
|
|
241
|
+
function De(e, n, t = null, i) {
|
|
242
|
+
return {
|
|
243
|
+
pathname: typeof e == "string" ? e : e.pathname,
|
|
244
|
+
search: "",
|
|
245
|
+
hash: "",
|
|
246
|
+
...typeof n == "string" ? A(n) : n,
|
|
247
|
+
state: t,
|
|
248
|
+
// TODO: This could be cleaned up. push/replace should probably just take
|
|
249
|
+
// full Locations now and avoid the need to run through this flow at all
|
|
250
|
+
// But that's a pretty big refactor to the current test suite so going to
|
|
251
|
+
// keep as is for the time being and just let any incoming keys take precedence
|
|
252
|
+
key: n && n.key || i || Ne()
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function J({
|
|
256
|
+
pathname: e = "/",
|
|
257
|
+
search: n = "",
|
|
258
|
+
hash: t = ""
|
|
259
|
+
}) {
|
|
260
|
+
return n && n !== "?" && (e += n.charAt(0) === "?" ? n : "?" + n), t && t !== "#" && (e += t.charAt(0) === "#" ? t : "#" + t), e;
|
|
261
|
+
}
|
|
262
|
+
function A(e) {
|
|
263
|
+
let n = {};
|
|
264
|
+
if (e) {
|
|
265
|
+
let t = e.indexOf("#");
|
|
266
|
+
t >= 0 && (n.hash = e.substring(t), e = e.substring(0, t));
|
|
267
|
+
let i = e.indexOf("?");
|
|
268
|
+
i >= 0 && (n.search = e.substring(i), e = e.substring(0, i)), e && (n.pathname = e);
|
|
269
|
+
}
|
|
270
|
+
return n;
|
|
271
|
+
}
|
|
272
|
+
function ce(e, n, t = "/") {
|
|
273
|
+
return Fe(e, n, t, !1);
|
|
274
|
+
}
|
|
275
|
+
function Fe(e, n, t, i) {
|
|
276
|
+
let r = typeof n == "string" ? A(n) : n, a = L(r.pathname || "/", t);
|
|
277
|
+
if (a == null)
|
|
278
|
+
return null;
|
|
279
|
+
let c = fe(e);
|
|
280
|
+
Ae(c);
|
|
281
|
+
let u = null;
|
|
282
|
+
for (let l = 0; u == null && l < c.length; ++l) {
|
|
283
|
+
let o = Ke(a);
|
|
284
|
+
u = je(
|
|
285
|
+
c[l],
|
|
286
|
+
o,
|
|
287
|
+
i
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
return u;
|
|
291
|
+
}
|
|
292
|
+
function fe(e, n = [], t = [], i = "") {
|
|
293
|
+
let r = (a, c, u) => {
|
|
294
|
+
let l = {
|
|
295
|
+
relativePath: u === void 0 ? a.path || "" : u,
|
|
296
|
+
caseSensitive: a.caseSensitive === !0,
|
|
297
|
+
childrenIndex: c,
|
|
298
|
+
route: a
|
|
299
|
+
};
|
|
300
|
+
l.relativePath.startsWith("/") && (C(
|
|
301
|
+
l.relativePath.startsWith(i),
|
|
302
|
+
`Absolute route path "${l.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
303
|
+
), l.relativePath = l.relativePath.slice(i.length));
|
|
304
|
+
let o = P([i, l.relativePath]), h = t.concat(l);
|
|
305
|
+
a.children && a.children.length > 0 && (C(
|
|
306
|
+
// Our types know better, but runtime JS may not!
|
|
307
|
+
// @ts-expect-error
|
|
308
|
+
a.index !== !0,
|
|
309
|
+
`Index routes must not have child routes. Please remove all child routes from route path "${o}".`
|
|
310
|
+
), fe(a.children, n, h, o)), !(a.path == null && !a.index) && n.push({
|
|
311
|
+
path: o,
|
|
312
|
+
score: ze(o, a.index),
|
|
313
|
+
routesMeta: h
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
return e.forEach((a, c) => {
|
|
317
|
+
var u;
|
|
318
|
+
if (a.path === "" || !((u = a.path) != null && u.includes("?")))
|
|
319
|
+
r(a, c);
|
|
320
|
+
else
|
|
321
|
+
for (let l of de(a.path))
|
|
322
|
+
r(a, c, l);
|
|
323
|
+
}), n;
|
|
324
|
+
}
|
|
325
|
+
function de(e) {
|
|
326
|
+
let n = e.split("/");
|
|
327
|
+
if (n.length === 0) return [];
|
|
328
|
+
let [t, ...i] = n, r = t.endsWith("?"), a = t.replace(/\?$/, "");
|
|
329
|
+
if (i.length === 0)
|
|
330
|
+
return r ? [a, ""] : [a];
|
|
331
|
+
let c = de(i.join("/")), u = [];
|
|
332
|
+
return u.push(
|
|
333
|
+
...c.map(
|
|
334
|
+
(l) => l === "" ? a : [a, l].join("/")
|
|
335
|
+
)
|
|
336
|
+
), r && u.push(...c), u.map(
|
|
337
|
+
(l) => e.startsWith("/") && l === "" ? "/" : l
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
function Ae(e) {
|
|
341
|
+
e.sort(
|
|
342
|
+
(n, t) => n.score !== t.score ? t.score - n.score : Ve(
|
|
343
|
+
n.routesMeta.map((i) => i.childrenIndex),
|
|
344
|
+
t.routesMeta.map((i) => i.childrenIndex)
|
|
345
|
+
)
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
var Oe = /^:[\w-]+$/, _e = 3, Ue = 2, Be = 1, We = 10, He = -2, oe = (e) => e === "*";
|
|
349
|
+
function ze(e, n) {
|
|
350
|
+
let t = e.split("/"), i = t.length;
|
|
351
|
+
return t.some(oe) && (i += He), n && (i += Ue), t.filter((r) => !oe(r)).reduce(
|
|
352
|
+
(r, a) => r + (Oe.test(a) ? _e : a === "" ? Be : We),
|
|
353
|
+
i
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
function Ve(e, n) {
|
|
357
|
+
return e.length === n.length && e.slice(0, -1).every((i, r) => i === n[r]) ? (
|
|
358
|
+
// If two routes are siblings, we should try to match the earlier sibling
|
|
359
|
+
// first. This allows people to have fine-grained control over the matching
|
|
360
|
+
// behavior by simply putting routes with identical paths in the order they
|
|
361
|
+
// want them tried.
|
|
362
|
+
e[e.length - 1] - n[n.length - 1]
|
|
363
|
+
) : (
|
|
364
|
+
// Otherwise, it doesn't really make sense to rank non-siblings by index,
|
|
365
|
+
// so they sort equally.
|
|
366
|
+
0
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
function je(e, n, t = !1) {
|
|
370
|
+
let { routesMeta: i } = e, r = {}, a = "/", c = [];
|
|
371
|
+
for (let u = 0; u < i.length; ++u) {
|
|
372
|
+
let l = i[u], o = u === i.length - 1, h = a === "/" ? n : n.slice(a.length) || "/", p = K(
|
|
373
|
+
{ path: l.relativePath, caseSensitive: l.caseSensitive, end: o },
|
|
374
|
+
h
|
|
375
|
+
), m = l.route;
|
|
376
|
+
if (!p && o && t && !i[i.length - 1].route.index && (p = K(
|
|
377
|
+
{
|
|
378
|
+
path: l.relativePath,
|
|
379
|
+
caseSensitive: l.caseSensitive,
|
|
380
|
+
end: !1
|
|
381
|
+
},
|
|
382
|
+
h
|
|
383
|
+
)), !p)
|
|
384
|
+
return null;
|
|
385
|
+
Object.assign(r, p.params), c.push({
|
|
386
|
+
// TODO: Can this as be avoided?
|
|
387
|
+
params: r,
|
|
388
|
+
pathname: P([a, p.pathname]),
|
|
389
|
+
pathnameBase: Xe(
|
|
390
|
+
P([a, p.pathnameBase])
|
|
391
|
+
),
|
|
392
|
+
route: m
|
|
393
|
+
}), p.pathnameBase !== "/" && (a = P([a, p.pathnameBase]));
|
|
394
|
+
}
|
|
395
|
+
return c;
|
|
396
|
+
}
|
|
397
|
+
function K(e, n) {
|
|
398
|
+
typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
|
|
399
|
+
let [t, i] = Je(
|
|
400
|
+
e.path,
|
|
401
|
+
e.caseSensitive,
|
|
402
|
+
e.end
|
|
403
|
+
), r = n.match(t);
|
|
404
|
+
if (!r) return null;
|
|
405
|
+
let a = r[0], c = a.replace(/(.)\/+$/, "$1"), u = r.slice(1);
|
|
406
|
+
return {
|
|
407
|
+
params: i.reduce(
|
|
408
|
+
(o, { paramName: h, isOptional: p }, m) => {
|
|
409
|
+
if (h === "*") {
|
|
410
|
+
let f = u[m] || "";
|
|
411
|
+
c = a.slice(0, a.length - f.length).replace(/(.)\/+$/, "$1");
|
|
412
|
+
}
|
|
413
|
+
const d = u[m];
|
|
414
|
+
return p && !d ? o[h] = void 0 : o[h] = (d || "").replace(/%2F/g, "/"), o;
|
|
415
|
+
},
|
|
416
|
+
{}
|
|
417
|
+
),
|
|
418
|
+
pathname: a,
|
|
419
|
+
pathnameBase: c,
|
|
420
|
+
pattern: e
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function Je(e, n = !1, t = !0) {
|
|
424
|
+
b(
|
|
425
|
+
e === "*" || !e.endsWith("*") || e.endsWith("/*"),
|
|
426
|
+
`Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
|
|
427
|
+
);
|
|
428
|
+
let i = [], r = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
|
|
429
|
+
/\/:([\w-]+)(\?)?/g,
|
|
430
|
+
(c, u, l) => (i.push({ paramName: u, isOptional: l != null }), l ? "/?([^\\/]+)?" : "/([^\\/]+)")
|
|
431
|
+
);
|
|
432
|
+
return e.endsWith("*") ? (i.push({ paramName: "*" }), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : t ? r += "\\/*$" : e !== "" && e !== "/" && (r += "(?:(?=\\/|$))"), [new RegExp(r, n ? void 0 : "i"), i];
|
|
433
|
+
}
|
|
434
|
+
function Ke(e) {
|
|
435
|
+
try {
|
|
436
|
+
return e.split("/").map((n) => decodeURIComponent(n).replace(/\//g, "%2F")).join("/");
|
|
437
|
+
} catch (n) {
|
|
438
|
+
return b(
|
|
439
|
+
!1,
|
|
440
|
+
`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`
|
|
441
|
+
), e;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
function L(e, n) {
|
|
445
|
+
if (n === "/") return e;
|
|
446
|
+
if (!e.toLowerCase().startsWith(n.toLowerCase()))
|
|
447
|
+
return null;
|
|
448
|
+
let t = n.endsWith("/") ? n.length - 1 : n.length, i = e.charAt(t);
|
|
449
|
+
return i && i !== "/" ? null : e.slice(t) || "/";
|
|
450
|
+
}
|
|
451
|
+
function Ye(e, n = "/") {
|
|
452
|
+
let {
|
|
453
|
+
pathname: t,
|
|
454
|
+
search: i = "",
|
|
455
|
+
hash: r = ""
|
|
456
|
+
} = typeof e == "string" ? A(e) : e;
|
|
457
|
+
return {
|
|
458
|
+
pathname: t ? t.startsWith("/") ? t : qe(t, n) : n,
|
|
459
|
+
search: Qe(i),
|
|
460
|
+
hash: Ze(r)
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
function qe(e, n) {
|
|
464
|
+
let t = n.replace(/\/+$/, "").split("/");
|
|
465
|
+
return e.split("/").forEach((r) => {
|
|
466
|
+
r === ".." ? t.length > 1 && t.pop() : r !== "." && t.push(r);
|
|
467
|
+
}), t.length > 1 ? t.join("/") : "/";
|
|
468
|
+
}
|
|
469
|
+
function X(e, n, t, i) {
|
|
470
|
+
return `Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(
|
|
471
|
+
i
|
|
472
|
+
)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
|
|
473
|
+
}
|
|
474
|
+
function Ge(e) {
|
|
475
|
+
return e.filter(
|
|
476
|
+
(n, t) => t === 0 || n.route.path && n.route.path.length > 0
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
function he(e) {
|
|
480
|
+
let n = Ge(e);
|
|
481
|
+
return n.map(
|
|
482
|
+
(t, i) => i === n.length - 1 ? t.pathname : t.pathnameBase
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
function me(e, n, t, i = !1) {
|
|
486
|
+
let r;
|
|
487
|
+
typeof e == "string" ? r = A(e) : (r = { ...e }, C(
|
|
488
|
+
!r.pathname || !r.pathname.includes("?"),
|
|
489
|
+
X("?", "pathname", "search", r)
|
|
490
|
+
), C(
|
|
491
|
+
!r.pathname || !r.pathname.includes("#"),
|
|
492
|
+
X("#", "pathname", "hash", r)
|
|
493
|
+
), C(
|
|
494
|
+
!r.search || !r.search.includes("#"),
|
|
495
|
+
X("#", "search", "hash", r)
|
|
496
|
+
));
|
|
497
|
+
let a = e === "" || r.pathname === "", c = a ? "/" : r.pathname, u;
|
|
498
|
+
if (c == null)
|
|
499
|
+
u = t;
|
|
500
|
+
else {
|
|
501
|
+
let p = n.length - 1;
|
|
502
|
+
if (!i && c.startsWith("..")) {
|
|
503
|
+
let m = c.split("/");
|
|
504
|
+
for (; m[0] === ".."; )
|
|
505
|
+
m.shift(), p -= 1;
|
|
506
|
+
r.pathname = m.join("/");
|
|
507
|
+
}
|
|
508
|
+
u = p >= 0 ? n[p] : "/";
|
|
509
|
+
}
|
|
510
|
+
let l = Ye(r, u), o = c && c !== "/" && c.endsWith("/"), h = (a || c === ".") && t.endsWith("/");
|
|
511
|
+
return !l.pathname.endsWith("/") && (o || h) && (l.pathname += "/"), l;
|
|
512
|
+
}
|
|
513
|
+
var P = (e) => e.join("/").replace(/\/\/+/g, "/"), Xe = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), Qe = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Ze = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
|
|
514
|
+
function et(e) {
|
|
515
|
+
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
516
|
+
}
|
|
517
|
+
var pe = [
|
|
518
|
+
"POST",
|
|
519
|
+
"PUT",
|
|
520
|
+
"PATCH",
|
|
521
|
+
"DELETE"
|
|
522
|
+
];
|
|
523
|
+
new Set(
|
|
524
|
+
pe
|
|
525
|
+
);
|
|
526
|
+
var tt = [
|
|
527
|
+
"GET",
|
|
528
|
+
...pe
|
|
529
|
+
];
|
|
530
|
+
new Set(tt);
|
|
531
|
+
var O = s.createContext(null);
|
|
532
|
+
O.displayName = "DataRouter";
|
|
533
|
+
var Y = s.createContext(null);
|
|
534
|
+
Y.displayName = "DataRouterState";
|
|
535
|
+
var ge = s.createContext({
|
|
536
|
+
isTransitioning: !1
|
|
537
|
+
});
|
|
538
|
+
ge.displayName = "ViewTransition";
|
|
539
|
+
var nt = s.createContext(
|
|
540
|
+
/* @__PURE__ */ new Map()
|
|
541
|
+
);
|
|
542
|
+
nt.displayName = "Fetchers";
|
|
543
|
+
var rt = s.createContext(null);
|
|
544
|
+
rt.displayName = "Await";
|
|
545
|
+
var k = s.createContext(
|
|
546
|
+
null
|
|
547
|
+
);
|
|
548
|
+
k.displayName = "Navigation";
|
|
549
|
+
var q = s.createContext(
|
|
550
|
+
null
|
|
551
|
+
);
|
|
552
|
+
q.displayName = "Location";
|
|
553
|
+
var $ = s.createContext({
|
|
554
|
+
outlet: null,
|
|
555
|
+
matches: [],
|
|
556
|
+
isDataRoute: !1
|
|
557
|
+
});
|
|
558
|
+
$.displayName = "Route";
|
|
559
|
+
var Z = s.createContext(null);
|
|
560
|
+
Z.displayName = "RouteError";
|
|
561
|
+
function at(e, { relative: n } = {}) {
|
|
562
|
+
C(
|
|
563
|
+
W(),
|
|
564
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
565
|
+
// router loaded. We can help them understand how to avoid that.
|
|
566
|
+
"useHref() may be used only in the context of a <Router> component."
|
|
567
|
+
);
|
|
568
|
+
let { basename: t, navigator: i } = s.useContext(k), { hash: r, pathname: a, search: c } = H(e, { relative: n }), u = a;
|
|
569
|
+
return t !== "/" && (u = a === "/" ? t : P([t, a])), i.createHref({ pathname: u, search: c, hash: r });
|
|
570
|
+
}
|
|
571
|
+
function W() {
|
|
572
|
+
return s.useContext(q) != null;
|
|
573
|
+
}
|
|
574
|
+
function D() {
|
|
575
|
+
return C(
|
|
576
|
+
W(),
|
|
577
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
578
|
+
// router loaded. We can help them understand how to avoid that.
|
|
579
|
+
"useLocation() may be used only in the context of a <Router> component."
|
|
580
|
+
), s.useContext(q).location;
|
|
581
|
+
}
|
|
582
|
+
var ye = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
583
|
+
function ve(e) {
|
|
584
|
+
s.useContext(k).static || s.useLayoutEffect(e);
|
|
585
|
+
}
|
|
586
|
+
function it() {
|
|
587
|
+
let { isDataRoute: e } = s.useContext($);
|
|
588
|
+
return e ? vt() : lt();
|
|
589
|
+
}
|
|
590
|
+
function lt() {
|
|
591
|
+
C(
|
|
592
|
+
W(),
|
|
593
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
594
|
+
// router loaded. We can help them understand how to avoid that.
|
|
595
|
+
"useNavigate() may be used only in the context of a <Router> component."
|
|
596
|
+
);
|
|
597
|
+
let e = s.useContext(O), { basename: n, navigator: t } = s.useContext(k), { matches: i } = s.useContext($), { pathname: r } = D(), a = JSON.stringify(he(i)), c = s.useRef(!1);
|
|
598
|
+
return ve(() => {
|
|
599
|
+
c.current = !0;
|
|
600
|
+
}), s.useCallback(
|
|
601
|
+
(l, o = {}) => {
|
|
602
|
+
if (b(c.current, ye), !c.current) return;
|
|
603
|
+
if (typeof l == "number") {
|
|
604
|
+
t.go(l);
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
let h = me(
|
|
608
|
+
l,
|
|
609
|
+
JSON.parse(a),
|
|
610
|
+
r,
|
|
611
|
+
o.relative === "path"
|
|
612
|
+
);
|
|
613
|
+
e == null && n !== "/" && (h.pathname = h.pathname === "/" ? n : P([n, h.pathname])), (o.replace ? t.replace : t.push)(
|
|
614
|
+
h,
|
|
615
|
+
o.state,
|
|
616
|
+
o
|
|
617
|
+
);
|
|
618
|
+
},
|
|
619
|
+
[
|
|
620
|
+
n,
|
|
621
|
+
t,
|
|
622
|
+
a,
|
|
623
|
+
r,
|
|
624
|
+
e
|
|
625
|
+
]
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
s.createContext(null);
|
|
629
|
+
function H(e, { relative: n } = {}) {
|
|
630
|
+
let { matches: t } = s.useContext($), { pathname: i } = D(), r = JSON.stringify(he(t));
|
|
631
|
+
return s.useMemo(
|
|
632
|
+
() => me(
|
|
633
|
+
e,
|
|
634
|
+
JSON.parse(r),
|
|
635
|
+
i,
|
|
636
|
+
n === "path"
|
|
637
|
+
),
|
|
638
|
+
[e, r, i, n]
|
|
639
|
+
);
|
|
640
|
+
}
|
|
641
|
+
function ot(e, n, t, i) {
|
|
642
|
+
C(
|
|
643
|
+
W(),
|
|
644
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
645
|
+
// router loaded. We can help them understand how to avoid that.
|
|
646
|
+
"useRoutes() may be used only in the context of a <Router> component."
|
|
647
|
+
);
|
|
648
|
+
let { navigator: r, static: a } = s.useContext(k), { matches: c } = s.useContext($), u = c[c.length - 1], l = u ? u.params : {}, o = u ? u.pathname : "/", h = u ? u.pathnameBase : "/", p = u && u.route;
|
|
649
|
+
{
|
|
650
|
+
let v = p && p.path || "";
|
|
651
|
+
xe(
|
|
652
|
+
o,
|
|
653
|
+
!p || v.endsWith("*") || v.endsWith("*?"),
|
|
654
|
+
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
655
|
+
|
|
656
|
+
Please change the parent <Route path="${v}"> to <Route path="${v === "/" ? "*" : `${v}/*`}">.`
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
let m = D(), d;
|
|
660
|
+
d = m;
|
|
661
|
+
let f = d.pathname || "/", y = f;
|
|
662
|
+
if (h !== "/") {
|
|
663
|
+
let v = h.replace(/^\//, "").split("/");
|
|
664
|
+
y = "/" + f.replace(/^\//, "").split("/").slice(v.length).join("/");
|
|
665
|
+
}
|
|
666
|
+
let x = !a && t && t.matches && t.matches.length > 0 ? t.matches : ce(e, { pathname: y });
|
|
667
|
+
return b(
|
|
668
|
+
p || x != null,
|
|
669
|
+
`No routes matched location "${d.pathname}${d.search}${d.hash}" `
|
|
670
|
+
), b(
|
|
671
|
+
x == null || x[x.length - 1].route.element !== void 0 || x[x.length - 1].route.Component !== void 0 || x[x.length - 1].route.lazy !== void 0,
|
|
672
|
+
`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
|
|
673
|
+
), dt(
|
|
674
|
+
x && x.map(
|
|
675
|
+
(v) => Object.assign({}, v, {
|
|
676
|
+
params: Object.assign({}, l, v.params),
|
|
677
|
+
pathname: P([
|
|
678
|
+
h,
|
|
679
|
+
// Re-encode pathnames that were decoded inside matchRoutes
|
|
680
|
+
r.encodeLocation ? r.encodeLocation(v.pathname).pathname : v.pathname
|
|
681
|
+
]),
|
|
682
|
+
pathnameBase: v.pathnameBase === "/" ? h : P([
|
|
683
|
+
h,
|
|
684
|
+
// Re-encode pathnames that were decoded inside matchRoutes
|
|
685
|
+
r.encodeLocation ? r.encodeLocation(v.pathnameBase).pathname : v.pathnameBase
|
|
686
|
+
])
|
|
687
|
+
})
|
|
688
|
+
),
|
|
689
|
+
c,
|
|
690
|
+
t,
|
|
691
|
+
i
|
|
692
|
+
);
|
|
693
|
+
}
|
|
694
|
+
function ut() {
|
|
695
|
+
let e = yt(), n = et(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), t = e instanceof Error ? e.stack : null, i = "rgba(200,200,200, 0.5)", r = { padding: "0.5rem", backgroundColor: i }, a = { padding: "2px 4px", backgroundColor: i }, c = null;
|
|
696
|
+
return console.error(
|
|
697
|
+
"Error handled by React Router default ErrorBoundary:",
|
|
698
|
+
e
|
|
699
|
+
), c = /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ s.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ s.createElement("code", { style: a }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ s.createElement("code", { style: a }, "errorElement"), " prop on your route.")), /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ s.createElement("h3", { style: { fontStyle: "italic" } }, n), t ? /* @__PURE__ */ s.createElement("pre", { style: r }, t) : null, c);
|
|
700
|
+
}
|
|
701
|
+
var st = /* @__PURE__ */ s.createElement(ut, null), ct = class extends s.Component {
|
|
702
|
+
constructor(e) {
|
|
703
|
+
super(e), this.state = {
|
|
704
|
+
location: e.location,
|
|
705
|
+
revalidation: e.revalidation,
|
|
706
|
+
error: e.error
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
static getDerivedStateFromError(e) {
|
|
710
|
+
return { error: e };
|
|
711
|
+
}
|
|
712
|
+
static getDerivedStateFromProps(e, n) {
|
|
713
|
+
return n.location !== e.location || n.revalidation !== "idle" && e.revalidation === "idle" ? {
|
|
714
|
+
error: e.error,
|
|
715
|
+
location: e.location,
|
|
716
|
+
revalidation: e.revalidation
|
|
717
|
+
} : {
|
|
718
|
+
error: e.error !== void 0 ? e.error : n.error,
|
|
719
|
+
location: n.location,
|
|
720
|
+
revalidation: e.revalidation || n.revalidation
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
componentDidCatch(e, n) {
|
|
724
|
+
console.error(
|
|
725
|
+
"React Router caught the following error during render",
|
|
726
|
+
e,
|
|
727
|
+
n
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
render() {
|
|
731
|
+
return this.state.error !== void 0 ? /* @__PURE__ */ s.createElement($.Provider, { value: this.props.routeContext }, /* @__PURE__ */ s.createElement(
|
|
732
|
+
Z.Provider,
|
|
733
|
+
{
|
|
734
|
+
value: this.state.error,
|
|
735
|
+
children: this.props.component
|
|
736
|
+
}
|
|
737
|
+
)) : this.props.children;
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
function ft({ routeContext: e, match: n, children: t }) {
|
|
741
|
+
let i = s.useContext(O);
|
|
742
|
+
return i && i.static && i.staticContext && (n.route.errorElement || n.route.ErrorBoundary) && (i.staticContext._deepestRenderedBoundaryId = n.route.id), /* @__PURE__ */ s.createElement($.Provider, { value: e }, t);
|
|
743
|
+
}
|
|
744
|
+
function dt(e, n = [], t = null, i = null) {
|
|
745
|
+
if (e == null) {
|
|
746
|
+
if (!t)
|
|
747
|
+
return null;
|
|
748
|
+
if (t.errors)
|
|
749
|
+
e = t.matches;
|
|
750
|
+
else if (n.length === 0 && !t.initialized && t.matches.length > 0)
|
|
751
|
+
e = t.matches;
|
|
752
|
+
else
|
|
753
|
+
return null;
|
|
754
|
+
}
|
|
755
|
+
let r = e, a = t == null ? void 0 : t.errors;
|
|
756
|
+
if (a != null) {
|
|
757
|
+
let l = r.findIndex(
|
|
758
|
+
(o) => o.route.id && (a == null ? void 0 : a[o.route.id]) !== void 0
|
|
759
|
+
);
|
|
760
|
+
C(
|
|
761
|
+
l >= 0,
|
|
762
|
+
`Could not find a matching route for errors on route IDs: ${Object.keys(
|
|
763
|
+
a
|
|
764
|
+
).join(",")}`
|
|
765
|
+
), r = r.slice(
|
|
766
|
+
0,
|
|
767
|
+
Math.min(r.length, l + 1)
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
let c = !1, u = -1;
|
|
771
|
+
if (t)
|
|
772
|
+
for (let l = 0; l < r.length; l++) {
|
|
773
|
+
let o = r[l];
|
|
774
|
+
if ((o.route.HydrateFallback || o.route.hydrateFallbackElement) && (u = l), o.route.id) {
|
|
775
|
+
let { loaderData: h, errors: p } = t, m = o.route.loader && !h.hasOwnProperty(o.route.id) && (!p || p[o.route.id] === void 0);
|
|
776
|
+
if (o.route.lazy || m) {
|
|
777
|
+
c = !0, u >= 0 ? r = r.slice(0, u + 1) : r = [r[0]];
|
|
778
|
+
break;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
return r.reduceRight((l, o, h) => {
|
|
783
|
+
let p, m = !1, d = null, f = null;
|
|
784
|
+
t && (p = a && o.route.id ? a[o.route.id] : void 0, d = o.route.errorElement || st, c && (u < 0 && h === 0 ? (xe(
|
|
785
|
+
"route-fallback",
|
|
786
|
+
!1,
|
|
787
|
+
"No `HydrateFallback` element provided to render during initial hydration"
|
|
788
|
+
), m = !0, f = null) : u === h && (m = !0, f = o.route.hydrateFallbackElement || null)));
|
|
789
|
+
let y = n.concat(r.slice(0, h + 1)), x = () => {
|
|
790
|
+
let g;
|
|
791
|
+
return p ? g = d : m ? g = f : o.route.Component ? g = /* @__PURE__ */ s.createElement(o.route.Component, null) : o.route.element ? g = o.route.element : g = l, /* @__PURE__ */ s.createElement(
|
|
792
|
+
ft,
|
|
793
|
+
{
|
|
794
|
+
match: o,
|
|
795
|
+
routeContext: {
|
|
796
|
+
outlet: l,
|
|
797
|
+
matches: y,
|
|
798
|
+
isDataRoute: t != null
|
|
799
|
+
},
|
|
800
|
+
children: g
|
|
801
|
+
}
|
|
802
|
+
);
|
|
803
|
+
};
|
|
804
|
+
return t && (o.route.ErrorBoundary || o.route.errorElement || h === 0) ? /* @__PURE__ */ s.createElement(
|
|
805
|
+
ct,
|
|
806
|
+
{
|
|
807
|
+
location: t.location,
|
|
808
|
+
revalidation: t.revalidation,
|
|
809
|
+
component: d,
|
|
810
|
+
error: p,
|
|
811
|
+
children: x(),
|
|
812
|
+
routeContext: { outlet: null, matches: y, isDataRoute: !0 }
|
|
813
|
+
}
|
|
814
|
+
) : x();
|
|
815
|
+
}, null);
|
|
816
|
+
}
|
|
817
|
+
function ee(e) {
|
|
818
|
+
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
819
|
+
}
|
|
820
|
+
function ht(e) {
|
|
821
|
+
let n = s.useContext(O);
|
|
822
|
+
return C(n, ee(e)), n;
|
|
823
|
+
}
|
|
824
|
+
function mt(e) {
|
|
825
|
+
let n = s.useContext(Y);
|
|
826
|
+
return C(n, ee(e)), n;
|
|
827
|
+
}
|
|
828
|
+
function pt(e) {
|
|
829
|
+
let n = s.useContext($);
|
|
830
|
+
return C(n, ee(e)), n;
|
|
831
|
+
}
|
|
832
|
+
function te(e) {
|
|
833
|
+
let n = pt(e), t = n.matches[n.matches.length - 1];
|
|
834
|
+
return C(
|
|
835
|
+
t.route.id,
|
|
836
|
+
`${e} can only be used on routes that contain a unique "id"`
|
|
837
|
+
), t.route.id;
|
|
838
|
+
}
|
|
839
|
+
function gt() {
|
|
840
|
+
return te(
|
|
841
|
+
"useRouteId"
|
|
842
|
+
/* UseRouteId */
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
function yt() {
|
|
846
|
+
var i;
|
|
847
|
+
let e = s.useContext(Z), n = mt(
|
|
848
|
+
"useRouteError"
|
|
849
|
+
/* UseRouteError */
|
|
850
|
+
), t = te(
|
|
851
|
+
"useRouteError"
|
|
852
|
+
/* UseRouteError */
|
|
853
|
+
);
|
|
854
|
+
return e !== void 0 ? e : (i = n.errors) == null ? void 0 : i[t];
|
|
855
|
+
}
|
|
856
|
+
function vt() {
|
|
857
|
+
let { router: e } = ht(
|
|
858
|
+
"useNavigate"
|
|
859
|
+
/* UseNavigateStable */
|
|
860
|
+
), n = te(
|
|
861
|
+
"useNavigate"
|
|
862
|
+
/* UseNavigateStable */
|
|
863
|
+
), t = s.useRef(!1);
|
|
864
|
+
return ve(() => {
|
|
865
|
+
t.current = !0;
|
|
866
|
+
}), s.useCallback(
|
|
867
|
+
async (r, a = {}) => {
|
|
868
|
+
b(t.current, ye), t.current && (typeof r == "number" ? e.navigate(r) : await e.navigate(r, { fromRouteId: n, ...a }));
|
|
869
|
+
},
|
|
870
|
+
[e, n]
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
var ue = {};
|
|
874
|
+
function xe(e, n, t) {
|
|
875
|
+
!n && !ue[e] && (ue[e] = !0, b(!1, t));
|
|
876
|
+
}
|
|
877
|
+
s.memo(xt);
|
|
878
|
+
function xt({
|
|
879
|
+
routes: e,
|
|
880
|
+
future: n,
|
|
881
|
+
state: t
|
|
882
|
+
}) {
|
|
883
|
+
return ot(e, void 0, t, n);
|
|
884
|
+
}
|
|
885
|
+
function tn({
|
|
886
|
+
basename: e,
|
|
887
|
+
children: n,
|
|
888
|
+
initialEntries: t,
|
|
889
|
+
initialIndex: i
|
|
890
|
+
}) {
|
|
891
|
+
let r = s.useRef();
|
|
892
|
+
r.current == null && (r.current = Me({
|
|
893
|
+
initialEntries: t,
|
|
894
|
+
initialIndex: i,
|
|
895
|
+
v5Compat: !0
|
|
896
|
+
}));
|
|
897
|
+
let a = r.current, [c, u] = s.useState({
|
|
898
|
+
action: a.action,
|
|
899
|
+
location: a.location
|
|
900
|
+
}), l = s.useCallback(
|
|
901
|
+
(o) => {
|
|
902
|
+
s.startTransition(() => u(o));
|
|
903
|
+
},
|
|
904
|
+
[u]
|
|
905
|
+
);
|
|
906
|
+
return s.useLayoutEffect(() => a.listen(l), [a, l]), /* @__PURE__ */ s.createElement(
|
|
907
|
+
wt,
|
|
908
|
+
{
|
|
909
|
+
basename: e,
|
|
910
|
+
children: n,
|
|
911
|
+
location: c.location,
|
|
912
|
+
navigationType: c.action,
|
|
913
|
+
navigator: a
|
|
914
|
+
}
|
|
915
|
+
);
|
|
916
|
+
}
|
|
917
|
+
function wt({
|
|
918
|
+
basename: e = "/",
|
|
919
|
+
children: n = null,
|
|
920
|
+
location: t,
|
|
921
|
+
navigationType: i = "POP",
|
|
922
|
+
navigator: r,
|
|
923
|
+
static: a = !1
|
|
924
|
+
}) {
|
|
925
|
+
C(
|
|
926
|
+
!W(),
|
|
927
|
+
"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."
|
|
928
|
+
);
|
|
929
|
+
let c = e.replace(/^\/*/, "/"), u = s.useMemo(
|
|
930
|
+
() => ({
|
|
931
|
+
basename: c,
|
|
932
|
+
navigator: r,
|
|
933
|
+
static: a,
|
|
934
|
+
future: {}
|
|
935
|
+
}),
|
|
936
|
+
[c, r, a]
|
|
937
|
+
);
|
|
938
|
+
typeof t == "string" && (t = A(t));
|
|
939
|
+
let {
|
|
940
|
+
pathname: l = "/",
|
|
941
|
+
search: o = "",
|
|
942
|
+
hash: h = "",
|
|
943
|
+
state: p = null,
|
|
944
|
+
key: m = "default"
|
|
945
|
+
} = t, d = s.useMemo(() => {
|
|
946
|
+
let f = L(l, c);
|
|
947
|
+
return f == null ? null : {
|
|
948
|
+
location: {
|
|
949
|
+
pathname: f,
|
|
950
|
+
search: o,
|
|
951
|
+
hash: h,
|
|
952
|
+
state: p,
|
|
953
|
+
key: m
|
|
954
|
+
},
|
|
955
|
+
navigationType: i
|
|
956
|
+
};
|
|
957
|
+
}, [c, l, o, h, p, m, i]);
|
|
958
|
+
return b(
|
|
959
|
+
d != null,
|
|
960
|
+
`<Router basename="${c}"> is not able to match the URL "${l}${o}${h}" because it does not start with the basename, so the <Router> won't render anything.`
|
|
961
|
+
), d == null ? null : /* @__PURE__ */ s.createElement(k.Provider, { value: u }, /* @__PURE__ */ s.createElement(q.Provider, { children: n, value: d }));
|
|
962
|
+
}
|
|
963
|
+
var V = "get", j = "application/x-www-form-urlencoded";
|
|
964
|
+
function G(e) {
|
|
965
|
+
return e != null && typeof e.tagName == "string";
|
|
966
|
+
}
|
|
967
|
+
function Ct(e) {
|
|
968
|
+
return G(e) && e.tagName.toLowerCase() === "button";
|
|
969
|
+
}
|
|
970
|
+
function Et(e) {
|
|
971
|
+
return G(e) && e.tagName.toLowerCase() === "form";
|
|
972
|
+
}
|
|
973
|
+
function Rt(e) {
|
|
974
|
+
return G(e) && e.tagName.toLowerCase() === "input";
|
|
975
|
+
}
|
|
976
|
+
function bt(e) {
|
|
977
|
+
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
978
|
+
}
|
|
979
|
+
function St(e, n) {
|
|
980
|
+
return e.button === 0 && // Ignore everything but left clicks
|
|
981
|
+
(!n || n === "_self") && // Let browser handle "target=_blank" etc.
|
|
982
|
+
!bt(e);
|
|
983
|
+
}
|
|
984
|
+
var z = null;
|
|
985
|
+
function kt() {
|
|
986
|
+
if (z === null)
|
|
987
|
+
try {
|
|
988
|
+
new FormData(
|
|
989
|
+
document.createElement("form"),
|
|
990
|
+
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
991
|
+
0
|
|
992
|
+
), z = !1;
|
|
993
|
+
} catch {
|
|
994
|
+
z = !0;
|
|
995
|
+
}
|
|
996
|
+
return z;
|
|
997
|
+
}
|
|
998
|
+
var Pt = /* @__PURE__ */ new Set([
|
|
999
|
+
"application/x-www-form-urlencoded",
|
|
1000
|
+
"multipart/form-data",
|
|
1001
|
+
"text/plain"
|
|
1002
|
+
]);
|
|
1003
|
+
function Q(e) {
|
|
1004
|
+
return e != null && !Pt.has(e) ? (b(
|
|
1005
|
+
!1,
|
|
1006
|
+
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${j}"`
|
|
1007
|
+
), null) : e;
|
|
1008
|
+
}
|
|
1009
|
+
function Lt(e, n) {
|
|
1010
|
+
let t, i, r, a, c;
|
|
1011
|
+
if (Et(e)) {
|
|
1012
|
+
let u = e.getAttribute("action");
|
|
1013
|
+
i = u ? L(u, n) : null, t = e.getAttribute("method") || V, r = Q(e.getAttribute("enctype")) || j, a = new FormData(e);
|
|
1014
|
+
} else if (Ct(e) || Rt(e) && (e.type === "submit" || e.type === "image")) {
|
|
1015
|
+
let u = e.form;
|
|
1016
|
+
if (u == null)
|
|
1017
|
+
throw new Error(
|
|
1018
|
+
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
1019
|
+
);
|
|
1020
|
+
let l = e.getAttribute("formaction") || u.getAttribute("action");
|
|
1021
|
+
if (i = l ? L(l, n) : null, t = e.getAttribute("formmethod") || u.getAttribute("method") || V, r = Q(e.getAttribute("formenctype")) || Q(u.getAttribute("enctype")) || j, a = new FormData(u, e), !kt()) {
|
|
1022
|
+
let { name: o, type: h, value: p } = e;
|
|
1023
|
+
if (h === "image") {
|
|
1024
|
+
let m = o ? `${o}.` : "";
|
|
1025
|
+
a.append(`${m}x`, "0"), a.append(`${m}y`, "0");
|
|
1026
|
+
} else o && a.append(o, p);
|
|
1027
|
+
}
|
|
1028
|
+
} else {
|
|
1029
|
+
if (G(e))
|
|
1030
|
+
throw new Error(
|
|
1031
|
+
'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
|
|
1032
|
+
);
|
|
1033
|
+
t = V, i = null, r = j, c = e;
|
|
1034
|
+
}
|
|
1035
|
+
return a && r === "text/plain" && (c = a, a = void 0), { action: i, method: t.toLowerCase(), encType: r, formData: a, body: c };
|
|
1036
|
+
}
|
|
1037
|
+
function ne(e, n) {
|
|
1038
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
1039
|
+
throw new Error(n);
|
|
1040
|
+
}
|
|
1041
|
+
async function $t(e, n) {
|
|
1042
|
+
if (e.id in n)
|
|
1043
|
+
return n[e.id];
|
|
1044
|
+
try {
|
|
1045
|
+
let t = await import(
|
|
1046
|
+
/* @vite-ignore */
|
|
1047
|
+
/* webpackIgnore: true */
|
|
1048
|
+
e.module
|
|
1049
|
+
);
|
|
1050
|
+
return n[e.id] = t, t;
|
|
1051
|
+
} catch (t) {
|
|
1052
|
+
return console.error(
|
|
1053
|
+
`Error loading route module \`${e.module}\`, reloading page...`
|
|
1054
|
+
), console.error(t), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
function It(e) {
|
|
1059
|
+
return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
|
|
1060
|
+
}
|
|
1061
|
+
async function Tt(e, n, t) {
|
|
1062
|
+
let i = await Promise.all(
|
|
1063
|
+
e.map(async (r) => {
|
|
1064
|
+
let a = n.routes[r.route.id];
|
|
1065
|
+
if (a) {
|
|
1066
|
+
let c = await $t(a, t);
|
|
1067
|
+
return c.links ? c.links() : [];
|
|
1068
|
+
}
|
|
1069
|
+
return [];
|
|
1070
|
+
})
|
|
1071
|
+
);
|
|
1072
|
+
return Ft(
|
|
1073
|
+
i.flat(1).filter(It).filter((r) => r.rel === "stylesheet" || r.rel === "preload").map(
|
|
1074
|
+
(r) => r.rel === "stylesheet" ? { ...r, rel: "prefetch", as: "style" } : { ...r, rel: "prefetch" }
|
|
1075
|
+
)
|
|
1076
|
+
);
|
|
1077
|
+
}
|
|
1078
|
+
function se(e, n, t, i, r, a) {
|
|
1079
|
+
let c = (l, o) => t[o] ? l.route.id !== t[o].route.id : !0, u = (l, o) => {
|
|
1080
|
+
var h;
|
|
1081
|
+
return (
|
|
1082
|
+
// param change, /users/123 -> /users/456
|
|
1083
|
+
t[o].pathname !== l.pathname || // splat param changed, which is not present in match.path
|
|
1084
|
+
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
1085
|
+
((h = t[o].route.path) == null ? void 0 : h.endsWith("*")) && t[o].params["*"] !== l.params["*"]
|
|
1086
|
+
);
|
|
1087
|
+
};
|
|
1088
|
+
return a === "assets" ? n.filter(
|
|
1089
|
+
(l, o) => c(l, o) || u(l, o)
|
|
1090
|
+
) : a === "data" ? n.filter((l, o) => {
|
|
1091
|
+
var p;
|
|
1092
|
+
let h = i.routes[l.route.id];
|
|
1093
|
+
if (!h || !h.hasLoader)
|
|
1094
|
+
return !1;
|
|
1095
|
+
if (c(l, o) || u(l, o))
|
|
1096
|
+
return !0;
|
|
1097
|
+
if (l.route.shouldRevalidate) {
|
|
1098
|
+
let m = l.route.shouldRevalidate({
|
|
1099
|
+
currentUrl: new URL(
|
|
1100
|
+
r.pathname + r.search + r.hash,
|
|
1101
|
+
window.origin
|
|
1102
|
+
),
|
|
1103
|
+
currentParams: ((p = t[0]) == null ? void 0 : p.params) || {},
|
|
1104
|
+
nextUrl: new URL(e, window.origin),
|
|
1105
|
+
nextParams: l.params,
|
|
1106
|
+
defaultShouldRevalidate: !0
|
|
1107
|
+
});
|
|
1108
|
+
if (typeof m == "boolean")
|
|
1109
|
+
return m;
|
|
1110
|
+
}
|
|
1111
|
+
return !0;
|
|
1112
|
+
}) : [];
|
|
1113
|
+
}
|
|
1114
|
+
function Mt(e, n, { includeHydrateFallback: t } = {}) {
|
|
1115
|
+
return Nt(
|
|
1116
|
+
e.map((i) => {
|
|
1117
|
+
let r = n.routes[i.route.id];
|
|
1118
|
+
if (!r) return [];
|
|
1119
|
+
let a = [r.module];
|
|
1120
|
+
return r.clientActionModule && (a = a.concat(r.clientActionModule)), r.clientLoaderModule && (a = a.concat(r.clientLoaderModule)), t && r.hydrateFallbackModule && (a = a.concat(r.hydrateFallbackModule)), r.imports && (a = a.concat(r.imports)), a;
|
|
1121
|
+
}).flat(1)
|
|
1122
|
+
);
|
|
1123
|
+
}
|
|
1124
|
+
function Nt(e) {
|
|
1125
|
+
return [...new Set(e)];
|
|
1126
|
+
}
|
|
1127
|
+
function Dt(e) {
|
|
1128
|
+
let n = {}, t = Object.keys(e).sort();
|
|
1129
|
+
for (let i of t)
|
|
1130
|
+
n[i] = e[i];
|
|
1131
|
+
return n;
|
|
1132
|
+
}
|
|
1133
|
+
function Ft(e, n) {
|
|
1134
|
+
let t = /* @__PURE__ */ new Set();
|
|
1135
|
+
return new Set(n), e.reduce((i, r) => {
|
|
1136
|
+
let a = JSON.stringify(Dt(r));
|
|
1137
|
+
return t.has(a) || (t.add(a), i.push({ key: a, link: r })), i;
|
|
1138
|
+
}, []);
|
|
1139
|
+
}
|
|
1140
|
+
var At = /* @__PURE__ */ new Set([100, 101, 204, 205]);
|
|
1141
|
+
function Ot(e, n) {
|
|
1142
|
+
let t = typeof e == "string" ? new URL(
|
|
1143
|
+
e,
|
|
1144
|
+
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
1145
|
+
// don't assume window is available
|
|
1146
|
+
typeof window > "u" ? "server://singlefetch/" : window.location.origin
|
|
1147
|
+
) : e;
|
|
1148
|
+
return t.pathname === "/" ? t.pathname = "_root.data" : n && L(t.pathname, n) === "/" ? t.pathname = `${n.replace(/\/$/, "")}/_root.data` : t.pathname = `${t.pathname.replace(/\/$/, "")}.data`, t;
|
|
1149
|
+
}
|
|
1150
|
+
function we() {
|
|
1151
|
+
let e = s.useContext(O);
|
|
1152
|
+
return ne(
|
|
1153
|
+
e,
|
|
1154
|
+
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
1155
|
+
), e;
|
|
1156
|
+
}
|
|
1157
|
+
function _t() {
|
|
1158
|
+
let e = s.useContext(Y);
|
|
1159
|
+
return ne(
|
|
1160
|
+
e,
|
|
1161
|
+
"You must render this element inside a <DataRouterStateContext.Provider> element"
|
|
1162
|
+
), e;
|
|
1163
|
+
}
|
|
1164
|
+
var re = s.createContext(void 0);
|
|
1165
|
+
re.displayName = "FrameworkContext";
|
|
1166
|
+
function Ce() {
|
|
1167
|
+
let e = s.useContext(re);
|
|
1168
|
+
return ne(
|
|
1169
|
+
e,
|
|
1170
|
+
"You must render this element inside a <HydratedRouter> element"
|
|
1171
|
+
), e;
|
|
1172
|
+
}
|
|
1173
|
+
function Ut(e, n) {
|
|
1174
|
+
let t = s.useContext(re), [i, r] = s.useState(!1), [a, c] = s.useState(!1), { onFocus: u, onBlur: l, onMouseEnter: o, onMouseLeave: h, onTouchStart: p } = n, m = s.useRef(null);
|
|
1175
|
+
s.useEffect(() => {
|
|
1176
|
+
if (e === "render" && c(!0), e === "viewport") {
|
|
1177
|
+
let y = (g) => {
|
|
1178
|
+
g.forEach((v) => {
|
|
1179
|
+
c(v.isIntersecting);
|
|
1180
|
+
});
|
|
1181
|
+
}, x = new IntersectionObserver(y, { threshold: 0.5 });
|
|
1182
|
+
return m.current && x.observe(m.current), () => {
|
|
1183
|
+
x.disconnect();
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
}, [e]), s.useEffect(() => {
|
|
1187
|
+
if (i) {
|
|
1188
|
+
let y = setTimeout(() => {
|
|
1189
|
+
c(!0);
|
|
1190
|
+
}, 100);
|
|
1191
|
+
return () => {
|
|
1192
|
+
clearTimeout(y);
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
}, [i]);
|
|
1196
|
+
let d = () => {
|
|
1197
|
+
r(!0);
|
|
1198
|
+
}, f = () => {
|
|
1199
|
+
r(!1), c(!1);
|
|
1200
|
+
};
|
|
1201
|
+
return t ? e !== "intent" ? [a, m, {}] : [
|
|
1202
|
+
a,
|
|
1203
|
+
m,
|
|
1204
|
+
{
|
|
1205
|
+
onFocus: B(u, d),
|
|
1206
|
+
onBlur: B(l, f),
|
|
1207
|
+
onMouseEnter: B(o, d),
|
|
1208
|
+
onMouseLeave: B(h, f),
|
|
1209
|
+
onTouchStart: B(p, d)
|
|
1210
|
+
}
|
|
1211
|
+
] : [!1, m, {}];
|
|
1212
|
+
}
|
|
1213
|
+
function B(e, n) {
|
|
1214
|
+
return (t) => {
|
|
1215
|
+
e && e(t), t.defaultPrevented || n(t);
|
|
1216
|
+
};
|
|
1217
|
+
}
|
|
1218
|
+
function Bt({
|
|
1219
|
+
page: e,
|
|
1220
|
+
...n
|
|
1221
|
+
}) {
|
|
1222
|
+
let { router: t } = we(), i = s.useMemo(
|
|
1223
|
+
() => ce(t.routes, e, t.basename),
|
|
1224
|
+
[t.routes, e, t.basename]
|
|
1225
|
+
);
|
|
1226
|
+
return i ? /* @__PURE__ */ s.createElement(Ht, { page: e, matches: i, ...n }) : null;
|
|
1227
|
+
}
|
|
1228
|
+
function Wt(e) {
|
|
1229
|
+
let { manifest: n, routeModules: t } = Ce(), [i, r] = s.useState([]);
|
|
1230
|
+
return s.useEffect(() => {
|
|
1231
|
+
let a = !1;
|
|
1232
|
+
return Tt(e, n, t).then(
|
|
1233
|
+
(c) => {
|
|
1234
|
+
a || r(c);
|
|
1235
|
+
}
|
|
1236
|
+
), () => {
|
|
1237
|
+
a = !0;
|
|
1238
|
+
};
|
|
1239
|
+
}, [e, n, t]), i;
|
|
1240
|
+
}
|
|
1241
|
+
function Ht({
|
|
1242
|
+
page: e,
|
|
1243
|
+
matches: n,
|
|
1244
|
+
...t
|
|
1245
|
+
}) {
|
|
1246
|
+
let i = D(), { manifest: r, routeModules: a } = Ce(), { basename: c } = we(), { loaderData: u, matches: l } = _t(), o = s.useMemo(
|
|
1247
|
+
() => se(
|
|
1248
|
+
e,
|
|
1249
|
+
n,
|
|
1250
|
+
l,
|
|
1251
|
+
r,
|
|
1252
|
+
i,
|
|
1253
|
+
"data"
|
|
1254
|
+
),
|
|
1255
|
+
[e, n, l, r, i]
|
|
1256
|
+
), h = s.useMemo(
|
|
1257
|
+
() => se(
|
|
1258
|
+
e,
|
|
1259
|
+
n,
|
|
1260
|
+
l,
|
|
1261
|
+
r,
|
|
1262
|
+
i,
|
|
1263
|
+
"assets"
|
|
1264
|
+
),
|
|
1265
|
+
[e, n, l, r, i]
|
|
1266
|
+
), p = s.useMemo(() => {
|
|
1267
|
+
if (e === i.pathname + i.search + i.hash)
|
|
1268
|
+
return [];
|
|
1269
|
+
let f = /* @__PURE__ */ new Set(), y = !1;
|
|
1270
|
+
if (n.forEach((g) => {
|
|
1271
|
+
var w;
|
|
1272
|
+
let v = r.routes[g.route.id];
|
|
1273
|
+
!v || !v.hasLoader || (!o.some((E) => E.route.id === g.route.id) && g.route.id in u && ((w = a[g.route.id]) != null && w.shouldRevalidate) || v.hasClientLoader ? y = !0 : f.add(g.route.id));
|
|
1274
|
+
}), f.size === 0)
|
|
1275
|
+
return [];
|
|
1276
|
+
let x = Ot(e, c);
|
|
1277
|
+
return y && f.size > 0 && x.searchParams.set(
|
|
1278
|
+
"_routes",
|
|
1279
|
+
n.filter((g) => f.has(g.route.id)).map((g) => g.route.id).join(",")
|
|
1280
|
+
), [x.pathname + x.search];
|
|
1281
|
+
}, [
|
|
1282
|
+
c,
|
|
1283
|
+
u,
|
|
1284
|
+
i,
|
|
1285
|
+
r,
|
|
1286
|
+
o,
|
|
1287
|
+
n,
|
|
1288
|
+
e,
|
|
1289
|
+
a
|
|
1290
|
+
]), m = s.useMemo(
|
|
1291
|
+
() => Mt(h, r),
|
|
1292
|
+
[h, r]
|
|
1293
|
+
), d = Wt(h);
|
|
1294
|
+
return /* @__PURE__ */ s.createElement(s.Fragment, null, p.map((f) => /* @__PURE__ */ s.createElement("link", { key: f, rel: "prefetch", as: "fetch", href: f, ...t })), m.map((f) => /* @__PURE__ */ s.createElement("link", { key: f, rel: "modulepreload", href: f, ...t })), d.map(({ key: f, link: y }) => (
|
|
1295
|
+
// these don't spread `linkProps` because they are full link descriptors
|
|
1296
|
+
// already with their own props
|
|
1297
|
+
/* @__PURE__ */ s.createElement("link", { key: f, ...y })
|
|
1298
|
+
)));
|
|
1299
|
+
}
|
|
1300
|
+
function zt(...e) {
|
|
1301
|
+
return (n) => {
|
|
1302
|
+
e.forEach((t) => {
|
|
1303
|
+
typeof t == "function" ? t(n) : t != null && (t.current = n);
|
|
1304
|
+
});
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1307
|
+
var Ee = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
1308
|
+
try {
|
|
1309
|
+
Ee && (window.__reactRouterVersion = "7.5.3");
|
|
1310
|
+
} catch {
|
|
1311
|
+
}
|
|
1312
|
+
var Re = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, ae = s.forwardRef(
|
|
1313
|
+
function({
|
|
1314
|
+
onClick: n,
|
|
1315
|
+
discover: t = "render",
|
|
1316
|
+
prefetch: i = "none",
|
|
1317
|
+
relative: r,
|
|
1318
|
+
reloadDocument: a,
|
|
1319
|
+
replace: c,
|
|
1320
|
+
state: u,
|
|
1321
|
+
target: l,
|
|
1322
|
+
to: o,
|
|
1323
|
+
preventScrollReset: h,
|
|
1324
|
+
viewTransition: p,
|
|
1325
|
+
...m
|
|
1326
|
+
}, d) {
|
|
1327
|
+
let { basename: f } = s.useContext(k), y = typeof o == "string" && Re.test(o), x, g = !1;
|
|
1328
|
+
if (typeof o == "string" && y && (x = o, Ee))
|
|
1329
|
+
try {
|
|
1330
|
+
let R = new URL(window.location.href), T = o.startsWith("//") ? new URL(R.protocol + o) : new URL(o), ie = L(T.pathname, f);
|
|
1331
|
+
T.origin === R.origin && ie != null ? o = ie + T.search + T.hash : g = !0;
|
|
1332
|
+
} catch {
|
|
1333
|
+
b(
|
|
1334
|
+
!1,
|
|
1335
|
+
`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
1336
|
+
);
|
|
1337
|
+
}
|
|
1338
|
+
let v = at(o, { relative: r }), [w, E, S] = Ut(
|
|
1339
|
+
i,
|
|
1340
|
+
m
|
|
1341
|
+
), F = Kt(o, {
|
|
1342
|
+
replace: c,
|
|
1343
|
+
state: u,
|
|
1344
|
+
target: l,
|
|
1345
|
+
preventScrollReset: h,
|
|
1346
|
+
relative: r,
|
|
1347
|
+
viewTransition: p
|
|
1348
|
+
});
|
|
1349
|
+
function I(R) {
|
|
1350
|
+
n && n(R), R.defaultPrevented || F(R);
|
|
1351
|
+
}
|
|
1352
|
+
let M = (
|
|
1353
|
+
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1354
|
+
/* @__PURE__ */ s.createElement(
|
|
1355
|
+
"a",
|
|
1356
|
+
{
|
|
1357
|
+
...m,
|
|
1358
|
+
...S,
|
|
1359
|
+
href: x || v,
|
|
1360
|
+
onClick: g || a ? n : I,
|
|
1361
|
+
ref: zt(d, E),
|
|
1362
|
+
target: l,
|
|
1363
|
+
"data-discover": !y && t === "render" ? "true" : void 0
|
|
1364
|
+
}
|
|
1365
|
+
)
|
|
1366
|
+
);
|
|
1367
|
+
return w && !y ? /* @__PURE__ */ s.createElement(s.Fragment, null, M, /* @__PURE__ */ s.createElement(Bt, { page: v })) : M;
|
|
1368
|
+
}
|
|
1369
|
+
);
|
|
1370
|
+
ae.displayName = "Link";
|
|
1371
|
+
var Vt = s.forwardRef(
|
|
1372
|
+
function({
|
|
1373
|
+
"aria-current": n = "page",
|
|
1374
|
+
caseSensitive: t = !1,
|
|
1375
|
+
className: i = "",
|
|
1376
|
+
end: r = !1,
|
|
1377
|
+
style: a,
|
|
1378
|
+
to: c,
|
|
1379
|
+
viewTransition: u,
|
|
1380
|
+
children: l,
|
|
1381
|
+
...o
|
|
1382
|
+
}, h) {
|
|
1383
|
+
let p = H(c, { relative: o.relative }), m = D(), d = s.useContext(Y), { navigator: f, basename: y } = s.useContext(k), x = d != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1384
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1385
|
+
Qt(p) && u === !0, g = f.encodeLocation ? f.encodeLocation(p).pathname : p.pathname, v = m.pathname, w = d && d.navigation && d.navigation.location ? d.navigation.location.pathname : null;
|
|
1386
|
+
t || (v = v.toLowerCase(), w = w ? w.toLowerCase() : null, g = g.toLowerCase()), w && y && (w = L(w, y) || w);
|
|
1387
|
+
const E = g !== "/" && g.endsWith("/") ? g.length - 1 : g.length;
|
|
1388
|
+
let S = v === g || !r && v.startsWith(g) && v.charAt(E) === "/", F = w != null && (w === g || !r && w.startsWith(g) && w.charAt(g.length) === "/"), I = {
|
|
1389
|
+
isActive: S,
|
|
1390
|
+
isPending: F,
|
|
1391
|
+
isTransitioning: x
|
|
1392
|
+
}, M = S ? n : void 0, R;
|
|
1393
|
+
typeof i == "function" ? R = i(I) : R = [
|
|
1394
|
+
i,
|
|
1395
|
+
S ? "active" : null,
|
|
1396
|
+
F ? "pending" : null,
|
|
1397
|
+
x ? "transitioning" : null
|
|
1398
|
+
].filter(Boolean).join(" ");
|
|
1399
|
+
let T = typeof a == "function" ? a(I) : a;
|
|
1400
|
+
return /* @__PURE__ */ s.createElement(
|
|
1401
|
+
ae,
|
|
1402
|
+
{
|
|
1403
|
+
...o,
|
|
1404
|
+
"aria-current": M,
|
|
1405
|
+
className: R,
|
|
1406
|
+
ref: h,
|
|
1407
|
+
style: T,
|
|
1408
|
+
to: c,
|
|
1409
|
+
viewTransition: u
|
|
1410
|
+
},
|
|
1411
|
+
typeof l == "function" ? l(I) : l
|
|
1412
|
+
);
|
|
1413
|
+
}
|
|
1414
|
+
);
|
|
1415
|
+
Vt.displayName = "NavLink";
|
|
1416
|
+
var jt = s.forwardRef(
|
|
1417
|
+
({
|
|
1418
|
+
discover: e = "render",
|
|
1419
|
+
fetcherKey: n,
|
|
1420
|
+
navigate: t,
|
|
1421
|
+
reloadDocument: i,
|
|
1422
|
+
replace: r,
|
|
1423
|
+
state: a,
|
|
1424
|
+
method: c = V,
|
|
1425
|
+
action: u,
|
|
1426
|
+
onSubmit: l,
|
|
1427
|
+
relative: o,
|
|
1428
|
+
preventScrollReset: h,
|
|
1429
|
+
viewTransition: p,
|
|
1430
|
+
...m
|
|
1431
|
+
}, d) => {
|
|
1432
|
+
let f = Gt(), y = Xt(u, { relative: o }), x = c.toLowerCase() === "get" ? "get" : "post", g = typeof u == "string" && Re.test(u), v = (w) => {
|
|
1433
|
+
if (l && l(w), w.defaultPrevented) return;
|
|
1434
|
+
w.preventDefault();
|
|
1435
|
+
let E = w.nativeEvent.submitter, S = (E == null ? void 0 : E.getAttribute("formmethod")) || c;
|
|
1436
|
+
f(E || w.currentTarget, {
|
|
1437
|
+
fetcherKey: n,
|
|
1438
|
+
method: S,
|
|
1439
|
+
navigate: t,
|
|
1440
|
+
replace: r,
|
|
1441
|
+
state: a,
|
|
1442
|
+
relative: o,
|
|
1443
|
+
preventScrollReset: h,
|
|
1444
|
+
viewTransition: p
|
|
1445
|
+
});
|
|
1446
|
+
};
|
|
1447
|
+
return /* @__PURE__ */ s.createElement(
|
|
1448
|
+
"form",
|
|
1449
|
+
{
|
|
1450
|
+
ref: d,
|
|
1451
|
+
method: x,
|
|
1452
|
+
action: y,
|
|
1453
|
+
onSubmit: i ? l : v,
|
|
1454
|
+
...m,
|
|
1455
|
+
"data-discover": !g && e === "render" ? "true" : void 0
|
|
1456
|
+
}
|
|
1457
|
+
);
|
|
1458
|
+
}
|
|
1459
|
+
);
|
|
1460
|
+
jt.displayName = "Form";
|
|
1461
|
+
function Jt(e) {
|
|
1462
|
+
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1463
|
+
}
|
|
1464
|
+
function be(e) {
|
|
1465
|
+
let n = s.useContext(O);
|
|
1466
|
+
return C(n, Jt(e)), n;
|
|
1467
|
+
}
|
|
1468
|
+
function Kt(e, {
|
|
1469
|
+
target: n,
|
|
1470
|
+
replace: t,
|
|
1471
|
+
state: i,
|
|
1472
|
+
preventScrollReset: r,
|
|
1473
|
+
relative: a,
|
|
1474
|
+
viewTransition: c
|
|
1475
|
+
} = {}) {
|
|
1476
|
+
let u = it(), l = D(), o = H(e, { relative: a });
|
|
1477
|
+
return s.useCallback(
|
|
1478
|
+
(h) => {
|
|
1479
|
+
if (St(h, n)) {
|
|
1480
|
+
h.preventDefault();
|
|
1481
|
+
let p = t !== void 0 ? t : J(l) === J(o);
|
|
1482
|
+
u(e, {
|
|
1483
|
+
replace: p,
|
|
1484
|
+
state: i,
|
|
1485
|
+
preventScrollReset: r,
|
|
1486
|
+
relative: a,
|
|
1487
|
+
viewTransition: c
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1490
|
+
},
|
|
1491
|
+
[
|
|
1492
|
+
l,
|
|
1493
|
+
u,
|
|
1494
|
+
o,
|
|
1495
|
+
t,
|
|
1496
|
+
i,
|
|
1497
|
+
n,
|
|
1498
|
+
e,
|
|
1499
|
+
r,
|
|
1500
|
+
a,
|
|
1501
|
+
c
|
|
1502
|
+
]
|
|
1503
|
+
);
|
|
1504
|
+
}
|
|
1505
|
+
var Yt = 0, qt = () => `__${String(++Yt)}__`;
|
|
1506
|
+
function Gt() {
|
|
1507
|
+
let { router: e } = be(
|
|
1508
|
+
"useSubmit"
|
|
1509
|
+
/* UseSubmit */
|
|
1510
|
+
), { basename: n } = s.useContext(k), t = gt();
|
|
1511
|
+
return s.useCallback(
|
|
1512
|
+
async (i, r = {}) => {
|
|
1513
|
+
let { action: a, method: c, encType: u, formData: l, body: o } = Lt(
|
|
1514
|
+
i,
|
|
1515
|
+
n
|
|
1516
|
+
);
|
|
1517
|
+
if (r.navigate === !1) {
|
|
1518
|
+
let h = r.fetcherKey || qt();
|
|
1519
|
+
await e.fetch(h, t, r.action || a, {
|
|
1520
|
+
preventScrollReset: r.preventScrollReset,
|
|
1521
|
+
formData: l,
|
|
1522
|
+
body: o,
|
|
1523
|
+
formMethod: r.method || c,
|
|
1524
|
+
formEncType: r.encType || u,
|
|
1525
|
+
flushSync: r.flushSync
|
|
1526
|
+
});
|
|
1527
|
+
} else
|
|
1528
|
+
await e.navigate(r.action || a, {
|
|
1529
|
+
preventScrollReset: r.preventScrollReset,
|
|
1530
|
+
formData: l,
|
|
1531
|
+
body: o,
|
|
1532
|
+
formMethod: r.method || c,
|
|
1533
|
+
formEncType: r.encType || u,
|
|
1534
|
+
replace: r.replace,
|
|
1535
|
+
state: r.state,
|
|
1536
|
+
fromRouteId: t,
|
|
1537
|
+
flushSync: r.flushSync,
|
|
1538
|
+
viewTransition: r.viewTransition
|
|
1539
|
+
});
|
|
1540
|
+
},
|
|
1541
|
+
[e, n, t]
|
|
1542
|
+
);
|
|
1543
|
+
}
|
|
1544
|
+
function Xt(e, { relative: n } = {}) {
|
|
1545
|
+
let { basename: t } = s.useContext(k), i = s.useContext($);
|
|
1546
|
+
C(i, "useFormAction must be used inside a RouteContext");
|
|
1547
|
+
let [r] = i.matches.slice(-1), a = { ...H(e || ".", { relative: n }) }, c = D();
|
|
1548
|
+
if (e == null) {
|
|
1549
|
+
a.search = c.search;
|
|
1550
|
+
let u = new URLSearchParams(a.search), l = u.getAll("index");
|
|
1551
|
+
if (l.some((h) => h === "")) {
|
|
1552
|
+
u.delete("index"), l.filter((p) => p).forEach((p) => u.append("index", p));
|
|
1553
|
+
let h = u.toString();
|
|
1554
|
+
a.search = h ? `?${h}` : "";
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
return (!e || e === ".") && r.route.index && (a.search = a.search ? a.search.replace(/^\?/, "?index&") : "?index"), t !== "/" && (a.pathname = a.pathname === "/" ? t : P([t, a.pathname])), J(a);
|
|
1558
|
+
}
|
|
1559
|
+
function Qt(e, n = {}) {
|
|
1560
|
+
let t = s.useContext(ge);
|
|
1561
|
+
C(
|
|
1562
|
+
t != null,
|
|
1563
|
+
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1564
|
+
);
|
|
1565
|
+
let { basename: i } = be(
|
|
1566
|
+
"useViewTransitionState"
|
|
1567
|
+
/* useViewTransitionState */
|
|
1568
|
+
), r = H(e, { relative: n.relative });
|
|
1569
|
+
if (!t.isTransitioning)
|
|
1570
|
+
return !1;
|
|
1571
|
+
let a = L(t.currentLocation.pathname, i) || t.currentLocation.pathname, c = L(t.nextLocation.pathname, i) || t.nextLocation.pathname;
|
|
1572
|
+
return K(r.pathname, c) != null || K(r.pathname, a) != null;
|
|
1573
|
+
}
|
|
1574
|
+
new TextEncoder();
|
|
1575
|
+
[
|
|
1576
|
+
...At
|
|
1577
|
+
];
|
|
1578
|
+
const Zt = {
|
|
1579
|
+
default: N.default,
|
|
1580
|
+
muted: N.muted,
|
|
1581
|
+
underline: N.underline
|
|
1582
|
+
};
|
|
1583
|
+
function nn({
|
|
1584
|
+
href: e,
|
|
1585
|
+
variant: n = "default",
|
|
1586
|
+
iconLeft: t,
|
|
1587
|
+
iconRight: i,
|
|
1588
|
+
useRouter: r = !1,
|
|
1589
|
+
className: a,
|
|
1590
|
+
children: c,
|
|
1591
|
+
...u
|
|
1592
|
+
}) {
|
|
1593
|
+
const l = Zt[n ?? "default"], o = /* @__PURE__ */ Se(ke, { children: [
|
|
1594
|
+
t && /* @__PURE__ */ _("span", { className: N.icon, children: t }),
|
|
1595
|
+
/* @__PURE__ */ _("span", { children: c }),
|
|
1596
|
+
i && /* @__PURE__ */ _("span", { className: N.icon, children: i })
|
|
1597
|
+
] }), p = u.target === "_blank" ? "noopener noreferrer" : u.rel;
|
|
1598
|
+
return r ? /* @__PURE__ */ _(
|
|
1599
|
+
ae,
|
|
1600
|
+
{
|
|
1601
|
+
to: e,
|
|
1602
|
+
className: `${a ?? ""} ${N.link} ${l}`,
|
|
1603
|
+
...u,
|
|
1604
|
+
rel: p,
|
|
1605
|
+
children: o
|
|
1606
|
+
}
|
|
1607
|
+
) : /* @__PURE__ */ _(
|
|
1608
|
+
"a",
|
|
1609
|
+
{
|
|
1610
|
+
href: e,
|
|
1611
|
+
className: `${a ?? ""} ${N.link} ${l}`,
|
|
1612
|
+
...u,
|
|
1613
|
+
rel: p,
|
|
1614
|
+
children: o
|
|
1615
|
+
}
|
|
1616
|
+
);
|
|
1617
|
+
}
|
|
1618
|
+
export {
|
|
1619
|
+
nn as L,
|
|
1620
|
+
tn as M
|
|
1621
|
+
};
|