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