zudoku 0.7.2-dev.13 → 0.7.2-dev.2
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/cli/dev/handler.js +0 -5
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/lib/util/fetchTimeout.d.ts +1 -0
- package/dist/lib/util/fetchTimeout.js +14 -0
- package/dist/lib/util/fetchTimeout.js.map +1 -0
- package/dist/vite/config.d.ts +2 -2
- package/dist/vite/config.js +20 -21
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +4 -1
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.js +4 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/esbuild-yaml.d.ts +2 -0
- package/dist/vite/esbuild-yaml.js +50 -0
- package/dist/vite/esbuild-yaml.js.map +1 -0
- package/dist/vite/plugin-vercel.d.ts +3 -0
- package/dist/vite/plugin-vercel.js +8 -0
- package/dist/vite/plugin-vercel.js.map +1 -0
- package/dist/vite/plugin-yaml.d.ts +3 -0
- package/dist/vite/plugin-yaml.js +24 -0
- package/dist/vite/plugin-yaml.js.map +1 -0
- package/dist/vite/sitemap.d.ts +19 -0
- package/dist/vite/sitemap.js +36 -0
- package/dist/vite/sitemap.js.map +1 -0
- package/lib/AuthenticationPlugin-BMjOjKqE.js +54 -0
- package/lib/{AuthenticationPlugin-Bx9FK124.js.map → AuthenticationPlugin-BMjOjKqE.js.map} +1 -1
- package/lib/CategoryHeading-BE8e6QdS.js +9 -0
- package/lib/{CategoryHeading-XnFqN2lJ.js.map → CategoryHeading-BE8e6QdS.js.map} +1 -1
- package/lib/DeveloperHint-Bl9gIdNI.js +12 -0
- package/lib/{DeveloperHint-FBb2uXJe.js.map → DeveloperHint-Bl9gIdNI.js.map} +1 -1
- package/lib/ErrorPage-CPR1XVKW.js +12 -0
- package/lib/{ErrorPage-knunPbKI.js.map → ErrorPage-CPR1XVKW.js.map} +1 -1
- package/lib/Input-BBlyeDuG.js +2192 -0
- package/lib/{Input-BEDZAKw0.js.map → Input-BBlyeDuG.js.map} +1 -1
- package/lib/{Markdown-B4aR03g6.js → Markdown-CCNihH_N.js} +2641 -2650
- package/lib/{Markdown-B4aR03g6.js.map → Markdown-CCNihH_N.js.map} +1 -1
- package/lib/MdxPage-BavkYqzi.js +140 -0
- package/lib/{MdxPage-BZyQsH8Z.js.map → MdxPage-BavkYqzi.js.map} +1 -1
- package/lib/OperationList-C6Ps2keZ.js +460 -0
- package/lib/{OperationList-2NeWEM0u.js.map → OperationList-C6Ps2keZ.js.map} +1 -1
- package/lib/Route-xRJ9mJgH.js +13 -0
- package/lib/{Route-BZPewmrN.js.map → Route-xRJ9mJgH.js.map} +1 -1
- package/lib/{SidebarBadge-COz0hgfa.js → SidebarBadge-2JcxswKF.js} +41 -41
- package/lib/{SidebarBadge-COz0hgfa.js.map → SidebarBadge-2JcxswKF.js.map} +1 -1
- package/lib/SlotletProvider-CuB3Ts8r.js +213 -0
- package/lib/{SlotletProvider-DJMaOUDs.js.map → SlotletProvider-CuB3Ts8r.js.map} +1 -1
- package/lib/Spinner-BlxzaFFF.js +6 -0
- package/lib/Spinner-BlxzaFFF.js.map +1 -0
- package/lib/{ZudokuContext-cr-pTRY1.js → ZudokuContext-JoyeA9dT.js} +65 -66
- package/lib/{ZudokuContext-cr-pTRY1.js.map → ZudokuContext-JoyeA9dT.js.map} +1 -1
- package/lib/{index-Dv2KZuEw.js → index-BF4cn28H.js} +1804 -1991
- package/lib/{index-Dv2KZuEw.js.map → index-BF4cn28H.js.map} +1 -1
- package/lib/{index-Zezcv0xb.js → index-BLvMkqjO.js} +5 -5
- package/lib/{index-Zezcv0xb.js.map → index-BLvMkqjO.js.map} +1 -1
- package/lib/{index-1EDgIO6b.js → index-G1-TGLO1.js} +4 -4
- package/lib/{index-1EDgIO6b.js.map → index-G1-TGLO1.js.map} +1 -1
- package/lib/jsx-runtime-lNnQYwFN.js +2403 -0
- package/lib/jsx-runtime-lNnQYwFN.js.map +1 -0
- package/lib/{utils-ByIc_KIM.js → utils-B8R4grFM.js} +97 -98
- package/lib/{utils-ByIc_KIM.js.map → utils-B8R4grFM.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +16 -21
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +32 -37
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +485 -505
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1531 -1659
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +150 -214
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-page.js +5 -6
- package/lib/zudoku.plugin-custom-page.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +12 -13
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +7 -8
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +20 -21
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/package.json +2 -2
- package/lib/AuthenticationPlugin-Bx9FK124.js +0 -55
- package/lib/CategoryHeading-XnFqN2lJ.js +0 -10
- package/lib/DeveloperHint-FBb2uXJe.js +0 -16
- package/lib/ErrorPage-knunPbKI.js +0 -18
- package/lib/Input-BEDZAKw0.js +0 -2198
- package/lib/MdxPage-BZyQsH8Z.js +0 -172
- package/lib/OperationList-2NeWEM0u.js +0 -560
- package/lib/Route-BZPewmrN.js +0 -14
- package/lib/SlotletProvider-DJMaOUDs.js +0 -238
- package/lib/Spinner-3cQDBVGr.js +0 -7
- package/lib/Spinner-3cQDBVGr.js.map +0 -1
- package/lib/index-BG0g4WW0.js +0 -1771
- package/lib/index-BG0g4WW0.js.map +0 -1
- package/lib/jsx-runtime-B6kdoens.js +0 -635
- package/lib/jsx-runtime-B6kdoens.js.map +0 -1
package/lib/index-BG0g4WW0.js
DELETED
|
@@ -1,1771 +0,0 @@
|
|
|
1
|
-
import * as r from "react";
|
|
2
|
-
import * as At from "react-dom";
|
|
3
|
-
import { i as m, j as G, g as Re, w, a as Ne, m as _e, A as de, p as fe, s as T, b as we, c as X, d as Mt, e as Bt, I as jt, f as qe, h as Se, k as Ce, l as Q, n as Ge, o as Xe, q as Qe, r as Ze, t as et, u as tt, v as nt, x as rt, E as ot, y as Ht } from "./router-D2p7Olpn.js";
|
|
4
|
-
/**
|
|
5
|
-
* React Router v6.25.1
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Remix Software Inc.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
11
|
-
*
|
|
12
|
-
* @license MIT
|
|
13
|
-
*/
|
|
14
|
-
function I() {
|
|
15
|
-
return I = Object.assign ? Object.assign.bind() : function(e) {
|
|
16
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
17
|
-
var n = arguments[t];
|
|
18
|
-
for (var o in n)
|
|
19
|
-
Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]);
|
|
20
|
-
}
|
|
21
|
-
return e;
|
|
22
|
-
}, I.apply(this, arguments);
|
|
23
|
-
}
|
|
24
|
-
const U = /* @__PURE__ */ r.createContext(null);
|
|
25
|
-
process.env.NODE_ENV !== "production" && (U.displayName = "DataRouter");
|
|
26
|
-
const M = /* @__PURE__ */ r.createContext(null);
|
|
27
|
-
process.env.NODE_ENV !== "production" && (M.displayName = "DataRouterState");
|
|
28
|
-
const Z = /* @__PURE__ */ r.createContext(null);
|
|
29
|
-
process.env.NODE_ENV !== "production" && (Z.displayName = "Await");
|
|
30
|
-
const S = /* @__PURE__ */ r.createContext(null);
|
|
31
|
-
process.env.NODE_ENV !== "production" && (S.displayName = "Navigation");
|
|
32
|
-
const B = /* @__PURE__ */ r.createContext(null);
|
|
33
|
-
process.env.NODE_ENV !== "production" && (B.displayName = "Location");
|
|
34
|
-
const C = /* @__PURE__ */ r.createContext({
|
|
35
|
-
outlet: null,
|
|
36
|
-
matches: [],
|
|
37
|
-
isDataRoute: !1
|
|
38
|
-
});
|
|
39
|
-
process.env.NODE_ENV !== "production" && (C.displayName = "Route");
|
|
40
|
-
const xe = /* @__PURE__ */ r.createContext(null);
|
|
41
|
-
process.env.NODE_ENV !== "production" && (xe.displayName = "RouteError");
|
|
42
|
-
function De(e, t) {
|
|
43
|
-
let {
|
|
44
|
-
relative: n
|
|
45
|
-
} = t === void 0 ? {} : t;
|
|
46
|
-
V() || (process.env.NODE_ENV !== "production" ? m(
|
|
47
|
-
!1,
|
|
48
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
49
|
-
// router loaded. We can help them understand how to avoid that.
|
|
50
|
-
"useHref() may be used only in the context of a <Router> component."
|
|
51
|
-
) : m(!1));
|
|
52
|
-
let {
|
|
53
|
-
basename: o,
|
|
54
|
-
navigator: a
|
|
55
|
-
} = r.useContext(S), {
|
|
56
|
-
hash: s,
|
|
57
|
-
pathname: i,
|
|
58
|
-
search: u
|
|
59
|
-
} = Y(e, {
|
|
60
|
-
relative: n
|
|
61
|
-
}), d = i;
|
|
62
|
-
return o !== "/" && (d = i === "/" ? o : G([o, i])), a.createHref({
|
|
63
|
-
pathname: d,
|
|
64
|
-
search: u,
|
|
65
|
-
hash: s
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function V() {
|
|
69
|
-
return r.useContext(B) != null;
|
|
70
|
-
}
|
|
71
|
-
function L() {
|
|
72
|
-
return V() || (process.env.NODE_ENV !== "production" ? m(
|
|
73
|
-
!1,
|
|
74
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
75
|
-
// router loaded. We can help them understand how to avoid that.
|
|
76
|
-
"useLocation() may be used only in the context of a <Router> component."
|
|
77
|
-
) : m(!1)), r.useContext(B).location;
|
|
78
|
-
}
|
|
79
|
-
function at() {
|
|
80
|
-
return r.useContext(B).navigationType;
|
|
81
|
-
}
|
|
82
|
-
function it(e) {
|
|
83
|
-
V() || (process.env.NODE_ENV !== "production" ? m(
|
|
84
|
-
!1,
|
|
85
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
86
|
-
// router loaded. We can help them understand how to avoid that.
|
|
87
|
-
"useMatch() may be used only in the context of a <Router> component."
|
|
88
|
-
) : m(!1));
|
|
89
|
-
let {
|
|
90
|
-
pathname: t
|
|
91
|
-
} = L();
|
|
92
|
-
return r.useMemo(() => X(e, Mt(t)), [t, e]);
|
|
93
|
-
}
|
|
94
|
-
const st = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
95
|
-
function lt(e) {
|
|
96
|
-
r.useContext(S).static || r.useLayoutEffect(e);
|
|
97
|
-
}
|
|
98
|
-
function te() {
|
|
99
|
-
let {
|
|
100
|
-
isDataRoute: e
|
|
101
|
-
} = r.useContext(C);
|
|
102
|
-
return e ? Gt() : Kt();
|
|
103
|
-
}
|
|
104
|
-
function Kt() {
|
|
105
|
-
V() || (process.env.NODE_ENV !== "production" ? m(
|
|
106
|
-
!1,
|
|
107
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
108
|
-
// router loaded. We can help them understand how to avoid that.
|
|
109
|
-
"useNavigate() may be used only in the context of a <Router> component."
|
|
110
|
-
) : m(!1));
|
|
111
|
-
let e = r.useContext(U), {
|
|
112
|
-
basename: t,
|
|
113
|
-
future: n,
|
|
114
|
-
navigator: o
|
|
115
|
-
} = r.useContext(S), {
|
|
116
|
-
matches: a
|
|
117
|
-
} = r.useContext(C), {
|
|
118
|
-
pathname: s
|
|
119
|
-
} = L(), i = JSON.stringify(Re(a, n.v7_relativeSplatPath)), u = r.useRef(!1);
|
|
120
|
-
return lt(() => {
|
|
121
|
-
u.current = !0;
|
|
122
|
-
}), r.useCallback(function(l, c) {
|
|
123
|
-
if (c === void 0 && (c = {}), process.env.NODE_ENV !== "production" && w(u.current, st), !u.current) return;
|
|
124
|
-
if (typeof l == "number") {
|
|
125
|
-
o.go(l);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
let f = Ne(l, JSON.parse(i), s, c.relative === "path");
|
|
129
|
-
e == null && t !== "/" && (f.pathname = f.pathname === "/" ? t : G([t, f.pathname])), (c.replace ? o.replace : o.push)(f, c.state, c);
|
|
130
|
-
}, [t, o, i, s, e]);
|
|
131
|
-
}
|
|
132
|
-
const ut = /* @__PURE__ */ r.createContext(null);
|
|
133
|
-
function ct() {
|
|
134
|
-
return r.useContext(ut);
|
|
135
|
-
}
|
|
136
|
-
function Oe(e) {
|
|
137
|
-
let t = r.useContext(C).outlet;
|
|
138
|
-
return t && /* @__PURE__ */ r.createElement(ut.Provider, {
|
|
139
|
-
value: e
|
|
140
|
-
}, t);
|
|
141
|
-
}
|
|
142
|
-
function dt() {
|
|
143
|
-
let {
|
|
144
|
-
matches: e
|
|
145
|
-
} = r.useContext(C), t = e[e.length - 1];
|
|
146
|
-
return t ? t.params : {};
|
|
147
|
-
}
|
|
148
|
-
function Y(e, t) {
|
|
149
|
-
let {
|
|
150
|
-
relative: n
|
|
151
|
-
} = t === void 0 ? {} : t, {
|
|
152
|
-
future: o
|
|
153
|
-
} = r.useContext(S), {
|
|
154
|
-
matches: a
|
|
155
|
-
} = r.useContext(C), {
|
|
156
|
-
pathname: s
|
|
157
|
-
} = L(), i = JSON.stringify(Re(a, o.v7_relativeSplatPath));
|
|
158
|
-
return r.useMemo(() => Ne(e, JSON.parse(i), s, n === "path"), [e, i, s, n]);
|
|
159
|
-
}
|
|
160
|
-
function Pe(e, t) {
|
|
161
|
-
return pe(e, t);
|
|
162
|
-
}
|
|
163
|
-
function pe(e, t, n, o) {
|
|
164
|
-
V() || (process.env.NODE_ENV !== "production" ? m(
|
|
165
|
-
!1,
|
|
166
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
167
|
-
// router loaded. We can help them understand how to avoid that.
|
|
168
|
-
"useRoutes() may be used only in the context of a <Router> component."
|
|
169
|
-
) : m(!1));
|
|
170
|
-
let {
|
|
171
|
-
navigator: a
|
|
172
|
-
} = r.useContext(S), {
|
|
173
|
-
matches: s
|
|
174
|
-
} = r.useContext(C), i = s[s.length - 1], u = i ? i.params : {}, d = i ? i.pathname : "/", l = i ? i.pathnameBase : "/", c = i && i.route;
|
|
175
|
-
if (process.env.NODE_ENV !== "production") {
|
|
176
|
-
let h = c && c.path || "";
|
|
177
|
-
yt(d, !c || h.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ('"' + d + '" (under <Route path="' + h + '">) 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.
|
|
178
|
-
|
|
179
|
-
` + ('Please change the parent <Route path="' + h + '"> to <Route ') + ('path="' + (h === "/" ? "*" : h + "/*") + '">.'));
|
|
180
|
-
}
|
|
181
|
-
let f = L(), p;
|
|
182
|
-
if (t) {
|
|
183
|
-
var v;
|
|
184
|
-
let h = typeof t == "string" ? fe(t) : t;
|
|
185
|
-
l === "/" || (v = h.pathname) != null && v.startsWith(l) || (process.env.NODE_ENV !== "production" ? m(!1, "When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was " + ('matched by all parent routes. The current pathname base is "' + l + '" ') + ('but pathname "' + h.pathname + '" was given in the `location` prop.')) : m(!1)), p = h;
|
|
186
|
-
} else
|
|
187
|
-
p = f;
|
|
188
|
-
let g = p.pathname || "/", b = g;
|
|
189
|
-
if (l !== "/") {
|
|
190
|
-
let h = l.replace(/^\//, "").split("/");
|
|
191
|
-
b = "/" + g.replace(/^\//, "").split("/").slice(h.length).join("/");
|
|
192
|
-
}
|
|
193
|
-
let y = _e(e, {
|
|
194
|
-
pathname: b
|
|
195
|
-
});
|
|
196
|
-
process.env.NODE_ENV !== "production" && (process.env.NODE_ENV !== "production" && w(c || y != null, 'No routes matched location "' + p.pathname + p.search + p.hash + '" '), process.env.NODE_ENV !== "production" && w(y == null || y[y.length - 1].route.element !== void 0 || y[y.length - 1].route.Component !== void 0 || y[y.length - 1].route.lazy !== void 0, 'Matched leaf route at location "' + p.pathname + p.search + p.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.'));
|
|
197
|
-
let _ = ft(y && y.map((h) => Object.assign({}, h, {
|
|
198
|
-
params: Object.assign({}, u, h.params),
|
|
199
|
-
pathname: G([
|
|
200
|
-
l,
|
|
201
|
-
// Re-encode pathnames that were decoded inside matchRoutes
|
|
202
|
-
a.encodeLocation ? a.encodeLocation(h.pathname).pathname : h.pathname
|
|
203
|
-
]),
|
|
204
|
-
pathnameBase: h.pathnameBase === "/" ? l : G([
|
|
205
|
-
l,
|
|
206
|
-
// Re-encode pathnames that were decoded inside matchRoutes
|
|
207
|
-
a.encodeLocation ? a.encodeLocation(h.pathnameBase).pathname : h.pathnameBase
|
|
208
|
-
])
|
|
209
|
-
})), s, n, o);
|
|
210
|
-
return t && _ ? /* @__PURE__ */ r.createElement(B.Provider, {
|
|
211
|
-
value: {
|
|
212
|
-
location: I({
|
|
213
|
-
pathname: "/",
|
|
214
|
-
search: "",
|
|
215
|
-
hash: "",
|
|
216
|
-
state: null,
|
|
217
|
-
key: "default"
|
|
218
|
-
}, p),
|
|
219
|
-
navigationType: de.Pop
|
|
220
|
-
}
|
|
221
|
-
}, _) : _;
|
|
222
|
-
}
|
|
223
|
-
function zt() {
|
|
224
|
-
let e = ke(), t = we(e) ? e.status + " " + e.statusText : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null, o = "rgba(200,200,200, 0.5)", a = {
|
|
225
|
-
padding: "0.5rem",
|
|
226
|
-
backgroundColor: o
|
|
227
|
-
}, s = {
|
|
228
|
-
padding: "2px 4px",
|
|
229
|
-
backgroundColor: o
|
|
230
|
-
}, i = null;
|
|
231
|
-
return process.env.NODE_ENV !== "production" && (console.error("Error handled by React Router default ErrorBoundary:", e), i = /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ r.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ r.createElement("code", {
|
|
232
|
-
style: s
|
|
233
|
-
}, "ErrorBoundary"), " or", " ", /* @__PURE__ */ r.createElement("code", {
|
|
234
|
-
style: s
|
|
235
|
-
}, "errorElement"), " prop on your route."))), /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ r.createElement("h3", {
|
|
236
|
-
style: {
|
|
237
|
-
fontStyle: "italic"
|
|
238
|
-
}
|
|
239
|
-
}, t), n ? /* @__PURE__ */ r.createElement("pre", {
|
|
240
|
-
style: a
|
|
241
|
-
}, n) : null, i);
|
|
242
|
-
}
|
|
243
|
-
const Wt = /* @__PURE__ */ r.createElement(zt, null);
|
|
244
|
-
class Yt extends r.Component {
|
|
245
|
-
constructor(t) {
|
|
246
|
-
super(t), this.state = {
|
|
247
|
-
location: t.location,
|
|
248
|
-
revalidation: t.revalidation,
|
|
249
|
-
error: t.error
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
static getDerivedStateFromError(t) {
|
|
253
|
-
return {
|
|
254
|
-
error: t
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
static getDerivedStateFromProps(t, n) {
|
|
258
|
-
return n.location !== t.location || n.revalidation !== "idle" && t.revalidation === "idle" ? {
|
|
259
|
-
error: t.error,
|
|
260
|
-
location: t.location,
|
|
261
|
-
revalidation: t.revalidation
|
|
262
|
-
} : {
|
|
263
|
-
error: t.error !== void 0 ? t.error : n.error,
|
|
264
|
-
location: n.location,
|
|
265
|
-
revalidation: t.revalidation || n.revalidation
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
componentDidCatch(t, n) {
|
|
269
|
-
console.error("React Router caught the following error during render", t, n);
|
|
270
|
-
}
|
|
271
|
-
render() {
|
|
272
|
-
return this.state.error !== void 0 ? /* @__PURE__ */ r.createElement(C.Provider, {
|
|
273
|
-
value: this.props.routeContext
|
|
274
|
-
}, /* @__PURE__ */ r.createElement(xe.Provider, {
|
|
275
|
-
value: this.state.error,
|
|
276
|
-
children: this.props.component
|
|
277
|
-
})) : this.props.children;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
function $t(e) {
|
|
281
|
-
let {
|
|
282
|
-
routeContext: t,
|
|
283
|
-
match: n,
|
|
284
|
-
children: o
|
|
285
|
-
} = e, a = r.useContext(U);
|
|
286
|
-
return a && a.static && a.staticContext && (n.route.errorElement || n.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = n.route.id), /* @__PURE__ */ r.createElement(C.Provider, {
|
|
287
|
-
value: t
|
|
288
|
-
}, o);
|
|
289
|
-
}
|
|
290
|
-
function ft(e, t, n, o) {
|
|
291
|
-
var a;
|
|
292
|
-
if (t === void 0 && (t = []), n === void 0 && (n = null), o === void 0 && (o = null), e == null) {
|
|
293
|
-
var s;
|
|
294
|
-
if ((s = n) != null && s.errors)
|
|
295
|
-
e = n.matches;
|
|
296
|
-
else
|
|
297
|
-
return null;
|
|
298
|
-
}
|
|
299
|
-
let i = e, u = (a = n) == null ? void 0 : a.errors;
|
|
300
|
-
if (u != null) {
|
|
301
|
-
let c = i.findIndex((f) => f.route.id && (u == null ? void 0 : u[f.route.id]) !== void 0);
|
|
302
|
-
c >= 0 || (process.env.NODE_ENV !== "production" ? m(!1, "Could not find a matching route for errors on route IDs: " + Object.keys(u).join(",")) : m(!1)), i = i.slice(0, Math.min(i.length, c + 1));
|
|
303
|
-
}
|
|
304
|
-
let d = !1, l = -1;
|
|
305
|
-
if (n && o && o.v7_partialHydration)
|
|
306
|
-
for (let c = 0; c < i.length; c++) {
|
|
307
|
-
let f = i[c];
|
|
308
|
-
if ((f.route.HydrateFallback || f.route.hydrateFallbackElement) && (l = c), f.route.id) {
|
|
309
|
-
let {
|
|
310
|
-
loaderData: p,
|
|
311
|
-
errors: v
|
|
312
|
-
} = n, g = f.route.loader && p[f.route.id] === void 0 && (!v || v[f.route.id] === void 0);
|
|
313
|
-
if (f.route.lazy || g) {
|
|
314
|
-
d = !0, l >= 0 ? i = i.slice(0, l + 1) : i = [i[0]];
|
|
315
|
-
break;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return i.reduceRight((c, f, p) => {
|
|
320
|
-
let v, g = !1, b = null, y = null;
|
|
321
|
-
n && (v = u && f.route.id ? u[f.route.id] : void 0, b = f.route.errorElement || Wt, d && (l < 0 && p === 0 ? (yt("route-fallback", !1, "No `HydrateFallback` element provided to render during initial hydration"), g = !0, y = null) : l === p && (g = !0, y = f.route.hydrateFallbackElement || null)));
|
|
322
|
-
let _ = t.concat(i.slice(0, p + 1)), h = () => {
|
|
323
|
-
let E;
|
|
324
|
-
return v ? E = b : g ? E = y : f.route.Component ? E = /* @__PURE__ */ r.createElement(f.route.Component, null) : f.route.element ? E = f.route.element : E = c, /* @__PURE__ */ r.createElement($t, {
|
|
325
|
-
match: f,
|
|
326
|
-
routeContext: {
|
|
327
|
-
outlet: c,
|
|
328
|
-
matches: _,
|
|
329
|
-
isDataRoute: n != null
|
|
330
|
-
},
|
|
331
|
-
children: E
|
|
332
|
-
});
|
|
333
|
-
};
|
|
334
|
-
return n && (f.route.ErrorBoundary || f.route.errorElement || p === 0) ? /* @__PURE__ */ r.createElement(Yt, {
|
|
335
|
-
location: n.location,
|
|
336
|
-
revalidation: n.revalidation,
|
|
337
|
-
component: b,
|
|
338
|
-
error: v,
|
|
339
|
-
children: h(),
|
|
340
|
-
routeContext: {
|
|
341
|
-
outlet: null,
|
|
342
|
-
matches: _,
|
|
343
|
-
isDataRoute: !0
|
|
344
|
-
}
|
|
345
|
-
}) : h();
|
|
346
|
-
}, null);
|
|
347
|
-
}
|
|
348
|
-
var he = /* @__PURE__ */ function(e) {
|
|
349
|
-
return e.UseBlocker = "useBlocker", e.UseRevalidator = "useRevalidator", e.UseNavigateStable = "useNavigate", e;
|
|
350
|
-
}(he || {}), O = /* @__PURE__ */ function(e) {
|
|
351
|
-
return e.UseBlocker = "useBlocker", e.UseLoaderData = "useLoaderData", e.UseActionData = "useActionData", e.UseRouteError = "useRouteError", e.UseNavigation = "useNavigation", e.UseRouteLoaderData = "useRouteLoaderData", e.UseMatches = "useMatches", e.UseRevalidator = "useRevalidator", e.UseNavigateStable = "useNavigate", e.UseRouteId = "useRouteId", e;
|
|
352
|
-
}(O || {});
|
|
353
|
-
function Le(e) {
|
|
354
|
-
return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
355
|
-
}
|
|
356
|
-
function Te(e) {
|
|
357
|
-
let t = r.useContext(U);
|
|
358
|
-
return t || (process.env.NODE_ENV !== "production" ? m(!1, Le(e)) : m(!1)), t;
|
|
359
|
-
}
|
|
360
|
-
function j(e) {
|
|
361
|
-
let t = r.useContext(M);
|
|
362
|
-
return t || (process.env.NODE_ENV !== "production" ? m(!1, Le(e)) : m(!1)), t;
|
|
363
|
-
}
|
|
364
|
-
function Jt(e) {
|
|
365
|
-
let t = r.useContext(C);
|
|
366
|
-
return t || (process.env.NODE_ENV !== "production" ? m(!1, Le(e)) : m(!1)), t;
|
|
367
|
-
}
|
|
368
|
-
function ne(e) {
|
|
369
|
-
let t = Jt(e), n = t.matches[t.matches.length - 1];
|
|
370
|
-
return n.route.id || (process.env.NODE_ENV !== "production" ? m(!1, e + ' can only be used on routes that contain a unique "id"') : m(!1)), n.route.id;
|
|
371
|
-
}
|
|
372
|
-
function Fe() {
|
|
373
|
-
return ne(O.UseRouteId);
|
|
374
|
-
}
|
|
375
|
-
function Ue() {
|
|
376
|
-
return j(O.UseNavigation).navigation;
|
|
377
|
-
}
|
|
378
|
-
function pt() {
|
|
379
|
-
let e = Te(he.UseRevalidator), t = j(O.UseRevalidator);
|
|
380
|
-
return r.useMemo(() => ({
|
|
381
|
-
revalidate: e.router.revalidate,
|
|
382
|
-
state: t.revalidation
|
|
383
|
-
}), [e.router.revalidate, t.revalidation]);
|
|
384
|
-
}
|
|
385
|
-
function Ve() {
|
|
386
|
-
let {
|
|
387
|
-
matches: e,
|
|
388
|
-
loaderData: t
|
|
389
|
-
} = j(O.UseMatches);
|
|
390
|
-
return r.useMemo(() => e.map((n) => Bt(n, t)), [e, t]);
|
|
391
|
-
}
|
|
392
|
-
function ht() {
|
|
393
|
-
let e = j(O.UseLoaderData), t = ne(O.UseLoaderData);
|
|
394
|
-
if (e.errors && e.errors[t] != null) {
|
|
395
|
-
console.error("You cannot `useLoaderData` in an errorElement (routeId: " + t + ")");
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
return e.loaderData[t];
|
|
399
|
-
}
|
|
400
|
-
function mt(e) {
|
|
401
|
-
return j(O.UseRouteLoaderData).loaderData[e];
|
|
402
|
-
}
|
|
403
|
-
function vt() {
|
|
404
|
-
let e = j(O.UseActionData), t = ne(O.UseLoaderData);
|
|
405
|
-
return e.actionData ? e.actionData[t] : void 0;
|
|
406
|
-
}
|
|
407
|
-
function ke() {
|
|
408
|
-
var e;
|
|
409
|
-
let t = r.useContext(xe), n = j(O.UseRouteError), o = ne(O.UseRouteError);
|
|
410
|
-
return t !== void 0 ? t : (e = n.errors) == null ? void 0 : e[o];
|
|
411
|
-
}
|
|
412
|
-
function Ie() {
|
|
413
|
-
let e = r.useContext(Z);
|
|
414
|
-
return e == null ? void 0 : e._data;
|
|
415
|
-
}
|
|
416
|
-
function Et() {
|
|
417
|
-
let e = r.useContext(Z);
|
|
418
|
-
return e == null ? void 0 : e._error;
|
|
419
|
-
}
|
|
420
|
-
let qt = 0;
|
|
421
|
-
function Ae(e) {
|
|
422
|
-
let {
|
|
423
|
-
router: t,
|
|
424
|
-
basename: n
|
|
425
|
-
} = Te(he.UseBlocker), o = j(O.UseBlocker), [a, s] = r.useState(""), i = r.useCallback((u) => {
|
|
426
|
-
if (typeof e != "function")
|
|
427
|
-
return !!e;
|
|
428
|
-
if (n === "/")
|
|
429
|
-
return e(u);
|
|
430
|
-
let {
|
|
431
|
-
currentLocation: d,
|
|
432
|
-
nextLocation: l,
|
|
433
|
-
historyAction: c
|
|
434
|
-
} = u;
|
|
435
|
-
return e({
|
|
436
|
-
currentLocation: I({}, d, {
|
|
437
|
-
pathname: T(d.pathname, n) || d.pathname
|
|
438
|
-
}),
|
|
439
|
-
nextLocation: I({}, l, {
|
|
440
|
-
pathname: T(l.pathname, n) || l.pathname
|
|
441
|
-
}),
|
|
442
|
-
historyAction: c
|
|
443
|
-
});
|
|
444
|
-
}, [n, e]);
|
|
445
|
-
return r.useEffect(() => {
|
|
446
|
-
let u = String(++qt);
|
|
447
|
-
return s(u), () => t.deleteBlocker(u);
|
|
448
|
-
}, [t]), r.useEffect(() => {
|
|
449
|
-
a !== "" && t.getBlocker(a, i);
|
|
450
|
-
}, [t, a, i]), a && o.blockers.has(a) ? o.blockers.get(a) : jt;
|
|
451
|
-
}
|
|
452
|
-
function Gt() {
|
|
453
|
-
let {
|
|
454
|
-
router: e
|
|
455
|
-
} = Te(he.UseNavigateStable), t = ne(O.UseNavigateStable), n = r.useRef(!1);
|
|
456
|
-
return lt(() => {
|
|
457
|
-
n.current = !0;
|
|
458
|
-
}), r.useCallback(function(a, s) {
|
|
459
|
-
s === void 0 && (s = {}), process.env.NODE_ENV !== "production" && w(n.current, st), n.current && (typeof a == "number" ? e.navigate(a) : e.navigate(a, I({
|
|
460
|
-
fromRouteId: t
|
|
461
|
-
}, s)));
|
|
462
|
-
}, [e, t]);
|
|
463
|
-
}
|
|
464
|
-
const We = {};
|
|
465
|
-
function yt(e, t, n) {
|
|
466
|
-
!t && !We[e] && (We[e] = !0, process.env.NODE_ENV !== "production" && w(!1, n));
|
|
467
|
-
}
|
|
468
|
-
const Xt = "startTransition", ue = r[Xt];
|
|
469
|
-
function Qt(e) {
|
|
470
|
-
let {
|
|
471
|
-
fallbackElement: t,
|
|
472
|
-
router: n,
|
|
473
|
-
future: o
|
|
474
|
-
} = e, [a, s] = r.useState(n.state), {
|
|
475
|
-
v7_startTransition: i
|
|
476
|
-
} = o || {}, u = r.useCallback((f) => {
|
|
477
|
-
i && ue ? ue(() => s(f)) : s(f);
|
|
478
|
-
}, [s, i]);
|
|
479
|
-
r.useLayoutEffect(() => n.subscribe(u), [n, u]), r.useEffect(() => {
|
|
480
|
-
process.env.NODE_ENV !== "production" && w(t == null || !n.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead");
|
|
481
|
-
}, []);
|
|
482
|
-
let d = r.useMemo(() => ({
|
|
483
|
-
createHref: n.createHref,
|
|
484
|
-
encodeLocation: n.encodeLocation,
|
|
485
|
-
go: (f) => n.navigate(f),
|
|
486
|
-
push: (f, p, v) => n.navigate(f, {
|
|
487
|
-
state: p,
|
|
488
|
-
preventScrollReset: v == null ? void 0 : v.preventScrollReset
|
|
489
|
-
}),
|
|
490
|
-
replace: (f, p, v) => n.navigate(f, {
|
|
491
|
-
replace: !0,
|
|
492
|
-
state: p,
|
|
493
|
-
preventScrollReset: v == null ? void 0 : v.preventScrollReset
|
|
494
|
-
})
|
|
495
|
-
}), [n]), l = n.basename || "/", c = r.useMemo(() => ({
|
|
496
|
-
router: n,
|
|
497
|
-
navigator: d,
|
|
498
|
-
static: !1,
|
|
499
|
-
basename: l
|
|
500
|
-
}), [n, d, l]);
|
|
501
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(U.Provider, {
|
|
502
|
-
value: c
|
|
503
|
-
}, /* @__PURE__ */ r.createElement(M.Provider, {
|
|
504
|
-
value: a
|
|
505
|
-
}, /* @__PURE__ */ r.createElement(H, {
|
|
506
|
-
basename: l,
|
|
507
|
-
location: a.location,
|
|
508
|
-
navigationType: a.historyAction,
|
|
509
|
-
navigator: d,
|
|
510
|
-
future: {
|
|
511
|
-
v7_relativeSplatPath: n.future.v7_relativeSplatPath
|
|
512
|
-
}
|
|
513
|
-
}, a.initialized || n.future.v7_partialHydration ? /* @__PURE__ */ r.createElement(Zt, {
|
|
514
|
-
routes: n.routes,
|
|
515
|
-
future: n.future,
|
|
516
|
-
state: a
|
|
517
|
-
}) : t))), null);
|
|
518
|
-
}
|
|
519
|
-
function Zt(e) {
|
|
520
|
-
let {
|
|
521
|
-
routes: t,
|
|
522
|
-
future: n,
|
|
523
|
-
state: o
|
|
524
|
-
} = e;
|
|
525
|
-
return pe(t, void 0, o, n);
|
|
526
|
-
}
|
|
527
|
-
function gt(e) {
|
|
528
|
-
let {
|
|
529
|
-
basename: t,
|
|
530
|
-
children: n,
|
|
531
|
-
initialEntries: o,
|
|
532
|
-
initialIndex: a,
|
|
533
|
-
future: s
|
|
534
|
-
} = e, i = r.useRef();
|
|
535
|
-
i.current == null && (i.current = qe({
|
|
536
|
-
initialEntries: o,
|
|
537
|
-
initialIndex: a,
|
|
538
|
-
v5Compat: !0
|
|
539
|
-
}));
|
|
540
|
-
let u = i.current, [d, l] = r.useState({
|
|
541
|
-
action: u.action,
|
|
542
|
-
location: u.location
|
|
543
|
-
}), {
|
|
544
|
-
v7_startTransition: c
|
|
545
|
-
} = s || {}, f = r.useCallback((p) => {
|
|
546
|
-
c && ue ? ue(() => l(p)) : l(p);
|
|
547
|
-
}, [l, c]);
|
|
548
|
-
return r.useLayoutEffect(() => u.listen(f), [u, f]), /* @__PURE__ */ r.createElement(H, {
|
|
549
|
-
basename: t,
|
|
550
|
-
children: n,
|
|
551
|
-
location: d.location,
|
|
552
|
-
navigationType: d.action,
|
|
553
|
-
navigator: u,
|
|
554
|
-
future: s
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
function bt(e) {
|
|
558
|
-
let {
|
|
559
|
-
to: t,
|
|
560
|
-
replace: n,
|
|
561
|
-
state: o,
|
|
562
|
-
relative: a
|
|
563
|
-
} = e;
|
|
564
|
-
V() || (process.env.NODE_ENV !== "production" ? m(
|
|
565
|
-
!1,
|
|
566
|
-
// TODO: This error is probably because they somehow have 2 versions of
|
|
567
|
-
// the router loaded. We can help them understand how to avoid that.
|
|
568
|
-
"<Navigate> may be used only in the context of a <Router> component."
|
|
569
|
-
) : m(!1));
|
|
570
|
-
let {
|
|
571
|
-
future: s,
|
|
572
|
-
static: i
|
|
573
|
-
} = r.useContext(S);
|
|
574
|
-
process.env.NODE_ENV !== "production" && w(!i, "<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");
|
|
575
|
-
let {
|
|
576
|
-
matches: u
|
|
577
|
-
} = r.useContext(C), {
|
|
578
|
-
pathname: d
|
|
579
|
-
} = L(), l = te(), c = Ne(t, Re(u, s.v7_relativeSplatPath), d, a === "path"), f = JSON.stringify(c);
|
|
580
|
-
return r.useEffect(() => l(JSON.parse(f), {
|
|
581
|
-
replace: n,
|
|
582
|
-
state: o,
|
|
583
|
-
relative: a
|
|
584
|
-
}), [l, f, a, n, o]), null;
|
|
585
|
-
}
|
|
586
|
-
function Rt(e) {
|
|
587
|
-
return Oe(e.context);
|
|
588
|
-
}
|
|
589
|
-
function Me(e) {
|
|
590
|
-
process.env.NODE_ENV !== "production" ? m(!1, "A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.") : m(!1);
|
|
591
|
-
}
|
|
592
|
-
function H(e) {
|
|
593
|
-
let {
|
|
594
|
-
basename: t = "/",
|
|
595
|
-
children: n = null,
|
|
596
|
-
location: o,
|
|
597
|
-
navigationType: a = de.Pop,
|
|
598
|
-
navigator: s,
|
|
599
|
-
static: i = !1,
|
|
600
|
-
future: u
|
|
601
|
-
} = e;
|
|
602
|
-
V() && (process.env.NODE_ENV !== "production" ? m(!1, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : m(!1));
|
|
603
|
-
let d = t.replace(/^\/*/, "/"), l = r.useMemo(() => ({
|
|
604
|
-
basename: d,
|
|
605
|
-
navigator: s,
|
|
606
|
-
static: i,
|
|
607
|
-
future: I({
|
|
608
|
-
v7_relativeSplatPath: !1
|
|
609
|
-
}, u)
|
|
610
|
-
}), [d, u, s, i]);
|
|
611
|
-
typeof o == "string" && (o = fe(o));
|
|
612
|
-
let {
|
|
613
|
-
pathname: c = "/",
|
|
614
|
-
search: f = "",
|
|
615
|
-
hash: p = "",
|
|
616
|
-
state: v = null,
|
|
617
|
-
key: g = "default"
|
|
618
|
-
} = o, b = r.useMemo(() => {
|
|
619
|
-
let y = T(c, d);
|
|
620
|
-
return y == null ? null : {
|
|
621
|
-
location: {
|
|
622
|
-
pathname: y,
|
|
623
|
-
search: f,
|
|
624
|
-
hash: p,
|
|
625
|
-
state: v,
|
|
626
|
-
key: g
|
|
627
|
-
},
|
|
628
|
-
navigationType: a
|
|
629
|
-
};
|
|
630
|
-
}, [d, c, f, p, v, g, a]);
|
|
631
|
-
return process.env.NODE_ENV !== "production" && w(b != null, '<Router basename="' + d + '"> is not able to match the URL ' + ('"' + c + f + p + '" because it does not start with the ') + "basename, so the <Router> won't render anything."), b == null ? null : /* @__PURE__ */ r.createElement(S.Provider, {
|
|
632
|
-
value: l
|
|
633
|
-
}, /* @__PURE__ */ r.createElement(B.Provider, {
|
|
634
|
-
children: n,
|
|
635
|
-
value: b
|
|
636
|
-
}));
|
|
637
|
-
}
|
|
638
|
-
function Nt(e) {
|
|
639
|
-
let {
|
|
640
|
-
children: t,
|
|
641
|
-
location: n
|
|
642
|
-
} = e;
|
|
643
|
-
return Pe(W(t), n);
|
|
644
|
-
}
|
|
645
|
-
function _t(e) {
|
|
646
|
-
let {
|
|
647
|
-
children: t,
|
|
648
|
-
errorElement: n,
|
|
649
|
-
resolve: o
|
|
650
|
-
} = e;
|
|
651
|
-
return /* @__PURE__ */ r.createElement(tn, {
|
|
652
|
-
resolve: o,
|
|
653
|
-
errorElement: n
|
|
654
|
-
}, /* @__PURE__ */ r.createElement(nn, null, t));
|
|
655
|
-
}
|
|
656
|
-
var P = /* @__PURE__ */ function(e) {
|
|
657
|
-
return e[e.pending = 0] = "pending", e[e.success = 1] = "success", e[e.error = 2] = "error", e;
|
|
658
|
-
}(P || {});
|
|
659
|
-
const en = new Promise(() => {
|
|
660
|
-
});
|
|
661
|
-
class tn extends r.Component {
|
|
662
|
-
constructor(t) {
|
|
663
|
-
super(t), this.state = {
|
|
664
|
-
error: null
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
static getDerivedStateFromError(t) {
|
|
668
|
-
return {
|
|
669
|
-
error: t
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
componentDidCatch(t, n) {
|
|
673
|
-
console.error("<Await> caught the following error during render", t, n);
|
|
674
|
-
}
|
|
675
|
-
render() {
|
|
676
|
-
let {
|
|
677
|
-
children: t,
|
|
678
|
-
errorElement: n,
|
|
679
|
-
resolve: o
|
|
680
|
-
} = this.props, a = null, s = P.pending;
|
|
681
|
-
if (!(o instanceof Promise))
|
|
682
|
-
s = P.success, a = Promise.resolve(), Object.defineProperty(a, "_tracked", {
|
|
683
|
-
get: () => !0
|
|
684
|
-
}), Object.defineProperty(a, "_data", {
|
|
685
|
-
get: () => o
|
|
686
|
-
});
|
|
687
|
-
else if (this.state.error) {
|
|
688
|
-
s = P.error;
|
|
689
|
-
let i = this.state.error;
|
|
690
|
-
a = Promise.reject().catch(() => {
|
|
691
|
-
}), Object.defineProperty(a, "_tracked", {
|
|
692
|
-
get: () => !0
|
|
693
|
-
}), Object.defineProperty(a, "_error", {
|
|
694
|
-
get: () => i
|
|
695
|
-
});
|
|
696
|
-
} else o._tracked ? (a = o, s = "_error" in a ? P.error : "_data" in a ? P.success : P.pending) : (s = P.pending, Object.defineProperty(o, "_tracked", {
|
|
697
|
-
get: () => !0
|
|
698
|
-
}), a = o.then((i) => Object.defineProperty(o, "_data", {
|
|
699
|
-
get: () => i
|
|
700
|
-
}), (i) => Object.defineProperty(o, "_error", {
|
|
701
|
-
get: () => i
|
|
702
|
-
})));
|
|
703
|
-
if (s === P.error && a._error instanceof Se)
|
|
704
|
-
throw en;
|
|
705
|
-
if (s === P.error && !n)
|
|
706
|
-
throw a._error;
|
|
707
|
-
if (s === P.error)
|
|
708
|
-
return /* @__PURE__ */ r.createElement(Z.Provider, {
|
|
709
|
-
value: a,
|
|
710
|
-
children: n
|
|
711
|
-
});
|
|
712
|
-
if (s === P.success)
|
|
713
|
-
return /* @__PURE__ */ r.createElement(Z.Provider, {
|
|
714
|
-
value: a,
|
|
715
|
-
children: t
|
|
716
|
-
});
|
|
717
|
-
throw a;
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
function nn(e) {
|
|
721
|
-
let {
|
|
722
|
-
children: t
|
|
723
|
-
} = e, n = Ie(), o = typeof t == "function" ? t(n) : t;
|
|
724
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, o);
|
|
725
|
-
}
|
|
726
|
-
function W(e, t) {
|
|
727
|
-
t === void 0 && (t = []);
|
|
728
|
-
let n = [];
|
|
729
|
-
return r.Children.forEach(e, (o, a) => {
|
|
730
|
-
if (!/* @__PURE__ */ r.isValidElement(o))
|
|
731
|
-
return;
|
|
732
|
-
let s = [...t, a];
|
|
733
|
-
if (o.type === r.Fragment) {
|
|
734
|
-
n.push.apply(n, W(o.props.children, s));
|
|
735
|
-
return;
|
|
736
|
-
}
|
|
737
|
-
o.type !== Me && (process.env.NODE_ENV !== "production" ? m(!1, "[" + (typeof o.type == "string" ? o.type : o.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : m(!1)), !o.props.index || !o.props.children || (process.env.NODE_ENV !== "production" ? m(!1, "An index route cannot have child routes.") : m(!1));
|
|
738
|
-
let i = {
|
|
739
|
-
id: o.props.id || s.join("-"),
|
|
740
|
-
caseSensitive: o.props.caseSensitive,
|
|
741
|
-
element: o.props.element,
|
|
742
|
-
Component: o.props.Component,
|
|
743
|
-
index: o.props.index,
|
|
744
|
-
path: o.props.path,
|
|
745
|
-
loader: o.props.loader,
|
|
746
|
-
action: o.props.action,
|
|
747
|
-
errorElement: o.props.errorElement,
|
|
748
|
-
ErrorBoundary: o.props.ErrorBoundary,
|
|
749
|
-
hasErrorBoundary: o.props.ErrorBoundary != null || o.props.errorElement != null,
|
|
750
|
-
shouldRevalidate: o.props.shouldRevalidate,
|
|
751
|
-
handle: o.props.handle,
|
|
752
|
-
lazy: o.props.lazy
|
|
753
|
-
};
|
|
754
|
-
o.props.children && (i.children = W(o.props.children, s)), n.push(i);
|
|
755
|
-
}), n;
|
|
756
|
-
}
|
|
757
|
-
function wt(e) {
|
|
758
|
-
return ft(e);
|
|
759
|
-
}
|
|
760
|
-
function me(e) {
|
|
761
|
-
let t = {
|
|
762
|
-
// Note: this check also occurs in createRoutesFromChildren so update
|
|
763
|
-
// there if you change this -- please and thank you!
|
|
764
|
-
hasErrorBoundary: e.ErrorBoundary != null || e.errorElement != null
|
|
765
|
-
};
|
|
766
|
-
return e.Component && (process.env.NODE_ENV !== "production" && e.element && process.env.NODE_ENV !== "production" && w(!1, "You should not include both `Component` and `element` on your route - `Component` will be used."), Object.assign(t, {
|
|
767
|
-
element: /* @__PURE__ */ r.createElement(e.Component),
|
|
768
|
-
Component: void 0
|
|
769
|
-
})), e.HydrateFallback && (process.env.NODE_ENV !== "production" && e.hydrateFallbackElement && process.env.NODE_ENV !== "production" && w(!1, "You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."), Object.assign(t, {
|
|
770
|
-
hydrateFallbackElement: /* @__PURE__ */ r.createElement(e.HydrateFallback),
|
|
771
|
-
HydrateFallback: void 0
|
|
772
|
-
})), e.ErrorBoundary && (process.env.NODE_ENV !== "production" && e.errorElement && process.env.NODE_ENV !== "production" && w(!1, "You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."), Object.assign(t, {
|
|
773
|
-
errorElement: /* @__PURE__ */ r.createElement(e.ErrorBoundary),
|
|
774
|
-
ErrorBoundary: void 0
|
|
775
|
-
})), t;
|
|
776
|
-
}
|
|
777
|
-
function St(e, t) {
|
|
778
|
-
return Ce({
|
|
779
|
-
basename: t == null ? void 0 : t.basename,
|
|
780
|
-
future: I({}, t == null ? void 0 : t.future, {
|
|
781
|
-
v7_prependBasename: !0
|
|
782
|
-
}),
|
|
783
|
-
history: qe({
|
|
784
|
-
initialEntries: t == null ? void 0 : t.initialEntries,
|
|
785
|
-
initialIndex: t == null ? void 0 : t.initialIndex
|
|
786
|
-
}),
|
|
787
|
-
hydrationData: t == null ? void 0 : t.hydrationData,
|
|
788
|
-
routes: e,
|
|
789
|
-
mapRouteProperties: me,
|
|
790
|
-
unstable_dataStrategy: t == null ? void 0 : t.unstable_dataStrategy,
|
|
791
|
-
unstable_patchRoutesOnMiss: t == null ? void 0 : t.unstable_patchRoutesOnMiss
|
|
792
|
-
}).initialize();
|
|
793
|
-
}
|
|
794
|
-
const jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
795
|
-
__proto__: null,
|
|
796
|
-
AbortedDeferredError: Se,
|
|
797
|
-
Await: _t,
|
|
798
|
-
MemoryRouter: gt,
|
|
799
|
-
Navigate: bt,
|
|
800
|
-
get NavigationType() {
|
|
801
|
-
return de;
|
|
802
|
-
},
|
|
803
|
-
Outlet: Rt,
|
|
804
|
-
Route: Me,
|
|
805
|
-
Router: H,
|
|
806
|
-
RouterProvider: Qt,
|
|
807
|
-
Routes: Nt,
|
|
808
|
-
UNSAFE_DataRouterContext: U,
|
|
809
|
-
UNSAFE_DataRouterStateContext: M,
|
|
810
|
-
UNSAFE_LocationContext: B,
|
|
811
|
-
UNSAFE_NavigationContext: S,
|
|
812
|
-
UNSAFE_RouteContext: C,
|
|
813
|
-
UNSAFE_mapRouteProperties: me,
|
|
814
|
-
UNSAFE_useRouteId: Fe,
|
|
815
|
-
UNSAFE_useRoutesImpl: pe,
|
|
816
|
-
createMemoryRouter: St,
|
|
817
|
-
createPath: Q,
|
|
818
|
-
createRoutesFromChildren: W,
|
|
819
|
-
createRoutesFromElements: W,
|
|
820
|
-
defer: Ge,
|
|
821
|
-
generatePath: Xe,
|
|
822
|
-
isRouteErrorResponse: we,
|
|
823
|
-
json: Qe,
|
|
824
|
-
matchPath: X,
|
|
825
|
-
matchRoutes: _e,
|
|
826
|
-
parsePath: fe,
|
|
827
|
-
redirect: Ze,
|
|
828
|
-
redirectDocument: et,
|
|
829
|
-
renderMatches: wt,
|
|
830
|
-
resolvePath: tt,
|
|
831
|
-
useActionData: vt,
|
|
832
|
-
useAsyncError: Et,
|
|
833
|
-
useAsyncValue: Ie,
|
|
834
|
-
useBlocker: Ae,
|
|
835
|
-
useHref: De,
|
|
836
|
-
useInRouterContext: V,
|
|
837
|
-
useLoaderData: ht,
|
|
838
|
-
useLocation: L,
|
|
839
|
-
useMatch: it,
|
|
840
|
-
useMatches: Ve,
|
|
841
|
-
useNavigate: te,
|
|
842
|
-
useNavigation: Ue,
|
|
843
|
-
useNavigationType: at,
|
|
844
|
-
useOutlet: Oe,
|
|
845
|
-
useOutletContext: ct,
|
|
846
|
-
useParams: dt,
|
|
847
|
-
useResolvedPath: Y,
|
|
848
|
-
useRevalidator: pt,
|
|
849
|
-
useRouteError: ke,
|
|
850
|
-
useRouteLoaderData: mt,
|
|
851
|
-
useRoutes: Pe
|
|
852
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
853
|
-
/**
|
|
854
|
-
* React Router DOM v6.25.1
|
|
855
|
-
*
|
|
856
|
-
* Copyright (c) Remix Software Inc.
|
|
857
|
-
*
|
|
858
|
-
* This source code is licensed under the MIT license found in the
|
|
859
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
860
|
-
*
|
|
861
|
-
* @license MIT
|
|
862
|
-
*/
|
|
863
|
-
function D() {
|
|
864
|
-
return D = Object.assign ? Object.assign.bind() : function(e) {
|
|
865
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
866
|
-
var n = arguments[t];
|
|
867
|
-
for (var o in n)
|
|
868
|
-
Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]);
|
|
869
|
-
}
|
|
870
|
-
return e;
|
|
871
|
-
}, D.apply(this, arguments);
|
|
872
|
-
}
|
|
873
|
-
function Be(e, t) {
|
|
874
|
-
if (e == null) return {};
|
|
875
|
-
var n = {}, o = Object.keys(e), a, s;
|
|
876
|
-
for (s = 0; s < o.length; s++)
|
|
877
|
-
a = o[s], !(t.indexOf(a) >= 0) && (n[a] = e[a]);
|
|
878
|
-
return n;
|
|
879
|
-
}
|
|
880
|
-
const se = "get", le = "application/x-www-form-urlencoded";
|
|
881
|
-
function ve(e) {
|
|
882
|
-
return e != null && typeof e.tagName == "string";
|
|
883
|
-
}
|
|
884
|
-
function rn(e) {
|
|
885
|
-
return ve(e) && e.tagName.toLowerCase() === "button";
|
|
886
|
-
}
|
|
887
|
-
function on(e) {
|
|
888
|
-
return ve(e) && e.tagName.toLowerCase() === "form";
|
|
889
|
-
}
|
|
890
|
-
function an(e) {
|
|
891
|
-
return ve(e) && e.tagName.toLowerCase() === "input";
|
|
892
|
-
}
|
|
893
|
-
function sn(e) {
|
|
894
|
-
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
895
|
-
}
|
|
896
|
-
function ln(e, t) {
|
|
897
|
-
return e.button === 0 && // Ignore everything but left clicks
|
|
898
|
-
(!t || t === "_self") && // Let browser handle "target=_blank" etc.
|
|
899
|
-
!sn(e);
|
|
900
|
-
}
|
|
901
|
-
function ce(e) {
|
|
902
|
-
return e === void 0 && (e = ""), new URLSearchParams(typeof e == "string" || Array.isArray(e) || e instanceof URLSearchParams ? e : Object.keys(e).reduce((t, n) => {
|
|
903
|
-
let o = e[n];
|
|
904
|
-
return t.concat(Array.isArray(o) ? o.map((a) => [n, a]) : [[n, o]]);
|
|
905
|
-
}, []));
|
|
906
|
-
}
|
|
907
|
-
function un(e, t) {
|
|
908
|
-
let n = ce(e);
|
|
909
|
-
return t && t.forEach((o, a) => {
|
|
910
|
-
n.has(a) || t.getAll(a).forEach((s) => {
|
|
911
|
-
n.append(a, s);
|
|
912
|
-
});
|
|
913
|
-
}), n;
|
|
914
|
-
}
|
|
915
|
-
let ae = null;
|
|
916
|
-
function cn() {
|
|
917
|
-
if (ae === null)
|
|
918
|
-
try {
|
|
919
|
-
new FormData(
|
|
920
|
-
document.createElement("form"),
|
|
921
|
-
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
922
|
-
0
|
|
923
|
-
), ae = !1;
|
|
924
|
-
} catch {
|
|
925
|
-
ae = !0;
|
|
926
|
-
}
|
|
927
|
-
return ae;
|
|
928
|
-
}
|
|
929
|
-
const dn = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
|
|
930
|
-
function be(e) {
|
|
931
|
-
return e != null && !dn.has(e) ? (process.env.NODE_ENV !== "production" && w(!1, '"' + e + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + le + '"')), null) : e;
|
|
932
|
-
}
|
|
933
|
-
function fn(e, t) {
|
|
934
|
-
let n, o, a, s, i;
|
|
935
|
-
if (on(e)) {
|
|
936
|
-
let u = e.getAttribute("action");
|
|
937
|
-
o = u ? T(u, t) : null, n = e.getAttribute("method") || se, a = be(e.getAttribute("enctype")) || le, s = new FormData(e);
|
|
938
|
-
} else if (rn(e) || an(e) && (e.type === "submit" || e.type === "image")) {
|
|
939
|
-
let u = e.form;
|
|
940
|
-
if (u == null)
|
|
941
|
-
throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
|
|
942
|
-
let d = e.getAttribute("formaction") || u.getAttribute("action");
|
|
943
|
-
if (o = d ? T(d, t) : null, n = e.getAttribute("formmethod") || u.getAttribute("method") || se, a = be(e.getAttribute("formenctype")) || be(u.getAttribute("enctype")) || le, s = new FormData(u, e), !cn()) {
|
|
944
|
-
let {
|
|
945
|
-
name: l,
|
|
946
|
-
type: c,
|
|
947
|
-
value: f
|
|
948
|
-
} = e;
|
|
949
|
-
if (c === "image") {
|
|
950
|
-
let p = l ? l + "." : "";
|
|
951
|
-
s.append(p + "x", "0"), s.append(p + "y", "0");
|
|
952
|
-
} else l && s.append(l, f);
|
|
953
|
-
}
|
|
954
|
-
} else {
|
|
955
|
-
if (ve(e))
|
|
956
|
-
throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
|
|
957
|
-
n = se, o = null, a = le, i = e;
|
|
958
|
-
}
|
|
959
|
-
return s && a === "text/plain" && (i = s, s = void 0), {
|
|
960
|
-
action: o,
|
|
961
|
-
method: n.toLowerCase(),
|
|
962
|
-
encType: a,
|
|
963
|
-
formData: s,
|
|
964
|
-
body: i
|
|
965
|
-
};
|
|
966
|
-
}
|
|
967
|
-
const pn = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"], hn = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"], mn = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"], vn = "6";
|
|
968
|
-
try {
|
|
969
|
-
window.__reactRouterVersion = vn;
|
|
970
|
-
} catch {
|
|
971
|
-
}
|
|
972
|
-
function En(e, t) {
|
|
973
|
-
return Ce({
|
|
974
|
-
basename: t == null ? void 0 : t.basename,
|
|
975
|
-
future: D({}, t == null ? void 0 : t.future, {
|
|
976
|
-
v7_prependBasename: !0
|
|
977
|
-
}),
|
|
978
|
-
history: nt({
|
|
979
|
-
window: t == null ? void 0 : t.window
|
|
980
|
-
}),
|
|
981
|
-
hydrationData: (t == null ? void 0 : t.hydrationData) || Ct(),
|
|
982
|
-
routes: e,
|
|
983
|
-
mapRouteProperties: me,
|
|
984
|
-
unstable_dataStrategy: t == null ? void 0 : t.unstable_dataStrategy,
|
|
985
|
-
unstable_patchRoutesOnMiss: t == null ? void 0 : t.unstable_patchRoutesOnMiss,
|
|
986
|
-
window: t == null ? void 0 : t.window
|
|
987
|
-
}).initialize();
|
|
988
|
-
}
|
|
989
|
-
function yn(e, t) {
|
|
990
|
-
return Ce({
|
|
991
|
-
basename: t == null ? void 0 : t.basename,
|
|
992
|
-
future: D({}, t == null ? void 0 : t.future, {
|
|
993
|
-
v7_prependBasename: !0
|
|
994
|
-
}),
|
|
995
|
-
history: rt({
|
|
996
|
-
window: t == null ? void 0 : t.window
|
|
997
|
-
}),
|
|
998
|
-
hydrationData: (t == null ? void 0 : t.hydrationData) || Ct(),
|
|
999
|
-
routes: e,
|
|
1000
|
-
mapRouteProperties: me,
|
|
1001
|
-
unstable_dataStrategy: t == null ? void 0 : t.unstable_dataStrategy,
|
|
1002
|
-
unstable_patchRoutesOnMiss: t == null ? void 0 : t.unstable_patchRoutesOnMiss,
|
|
1003
|
-
window: t == null ? void 0 : t.window
|
|
1004
|
-
}).initialize();
|
|
1005
|
-
}
|
|
1006
|
-
function Ct() {
|
|
1007
|
-
var e;
|
|
1008
|
-
let t = (e = window) == null ? void 0 : e.__staticRouterHydrationData;
|
|
1009
|
-
return t && t.errors && (t = D({}, t, {
|
|
1010
|
-
errors: gn(t.errors)
|
|
1011
|
-
})), t;
|
|
1012
|
-
}
|
|
1013
|
-
function gn(e) {
|
|
1014
|
-
if (!e) return null;
|
|
1015
|
-
let t = Object.entries(e), n = {};
|
|
1016
|
-
for (let [o, a] of t)
|
|
1017
|
-
if (a && a.__type === "RouteErrorResponse")
|
|
1018
|
-
n[o] = new ot(a.status, a.statusText, a.data, a.internal === !0);
|
|
1019
|
-
else if (a && a.__type === "Error") {
|
|
1020
|
-
if (a.__subType) {
|
|
1021
|
-
let s = window[a.__subType];
|
|
1022
|
-
if (typeof s == "function")
|
|
1023
|
-
try {
|
|
1024
|
-
let i = new s(a.message);
|
|
1025
|
-
i.stack = "", n[o] = i;
|
|
1026
|
-
} catch {
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
if (n[o] == null) {
|
|
1030
|
-
let s = new Error(a.message);
|
|
1031
|
-
s.stack = "", n[o] = s;
|
|
1032
|
-
}
|
|
1033
|
-
} else
|
|
1034
|
-
n[o] = a;
|
|
1035
|
-
return n;
|
|
1036
|
-
}
|
|
1037
|
-
const Ee = /* @__PURE__ */ r.createContext({
|
|
1038
|
-
isTransitioning: !1
|
|
1039
|
-
});
|
|
1040
|
-
process.env.NODE_ENV !== "production" && (Ee.displayName = "ViewTransition");
|
|
1041
|
-
const ye = /* @__PURE__ */ r.createContext(/* @__PURE__ */ new Map());
|
|
1042
|
-
process.env.NODE_ENV !== "production" && (ye.displayName = "Fetchers");
|
|
1043
|
-
const bn = "startTransition", A = r[bn], Rn = "flushSync", Ye = At[Rn], Nn = "useId", $e = r[Nn];
|
|
1044
|
-
function _n(e) {
|
|
1045
|
-
A ? A(e) : e();
|
|
1046
|
-
}
|
|
1047
|
-
function q(e) {
|
|
1048
|
-
Ye ? Ye(e) : e();
|
|
1049
|
-
}
|
|
1050
|
-
class wn {
|
|
1051
|
-
constructor() {
|
|
1052
|
-
this.status = "pending", this.promise = new Promise((t, n) => {
|
|
1053
|
-
this.resolve = (o) => {
|
|
1054
|
-
this.status === "pending" && (this.status = "resolved", t(o));
|
|
1055
|
-
}, this.reject = (o) => {
|
|
1056
|
-
this.status === "pending" && (this.status = "rejected", n(o));
|
|
1057
|
-
};
|
|
1058
|
-
});
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
function Sn(e) {
|
|
1062
|
-
let {
|
|
1063
|
-
fallbackElement: t,
|
|
1064
|
-
router: n,
|
|
1065
|
-
future: o
|
|
1066
|
-
} = e, [a, s] = r.useState(n.state), [i, u] = r.useState(), [d, l] = r.useState({
|
|
1067
|
-
isTransitioning: !1
|
|
1068
|
-
}), [c, f] = r.useState(), [p, v] = r.useState(), [g, b] = r.useState(), y = r.useRef(/* @__PURE__ */ new Map()), {
|
|
1069
|
-
v7_startTransition: _
|
|
1070
|
-
} = o || {}, h = r.useCallback((N) => {
|
|
1071
|
-
_ ? _n(N) : N();
|
|
1072
|
-
}, [_]), E = r.useCallback((N, F) => {
|
|
1073
|
-
let {
|
|
1074
|
-
deletedFetchers: x,
|
|
1075
|
-
unstable_flushSync: oe,
|
|
1076
|
-
unstable_viewTransitionOpts: K
|
|
1077
|
-
} = F;
|
|
1078
|
-
x.forEach((z) => y.current.delete(z)), N.fetchers.forEach((z, It) => {
|
|
1079
|
-
z.data !== void 0 && y.current.set(It, z.data);
|
|
1080
|
-
});
|
|
1081
|
-
let kt = n.window == null || n.window.document == null || typeof n.window.document.startViewTransition != "function";
|
|
1082
|
-
if (!K || kt) {
|
|
1083
|
-
oe ? q(() => s(N)) : h(() => s(N));
|
|
1084
|
-
return;
|
|
1085
|
-
}
|
|
1086
|
-
if (oe) {
|
|
1087
|
-
q(() => {
|
|
1088
|
-
p && (c && c.resolve(), p.skipTransition()), l({
|
|
1089
|
-
isTransitioning: !0,
|
|
1090
|
-
flushSync: !0,
|
|
1091
|
-
currentLocation: K.currentLocation,
|
|
1092
|
-
nextLocation: K.nextLocation
|
|
1093
|
-
});
|
|
1094
|
-
});
|
|
1095
|
-
let z = n.window.document.startViewTransition(() => {
|
|
1096
|
-
q(() => s(N));
|
|
1097
|
-
});
|
|
1098
|
-
z.finished.finally(() => {
|
|
1099
|
-
q(() => {
|
|
1100
|
-
f(void 0), v(void 0), u(void 0), l({
|
|
1101
|
-
isTransitioning: !1
|
|
1102
|
-
});
|
|
1103
|
-
});
|
|
1104
|
-
}), q(() => v(z));
|
|
1105
|
-
return;
|
|
1106
|
-
}
|
|
1107
|
-
p ? (c && c.resolve(), p.skipTransition(), b({
|
|
1108
|
-
state: N,
|
|
1109
|
-
currentLocation: K.currentLocation,
|
|
1110
|
-
nextLocation: K.nextLocation
|
|
1111
|
-
})) : (u(N), l({
|
|
1112
|
-
isTransitioning: !0,
|
|
1113
|
-
flushSync: !1,
|
|
1114
|
-
currentLocation: K.currentLocation,
|
|
1115
|
-
nextLocation: K.nextLocation
|
|
1116
|
-
}));
|
|
1117
|
-
}, [n.window, p, c, y, h]);
|
|
1118
|
-
r.useLayoutEffect(() => n.subscribe(E), [n, E]), r.useEffect(() => {
|
|
1119
|
-
d.isTransitioning && !d.flushSync && f(new wn());
|
|
1120
|
-
}, [d]), r.useEffect(() => {
|
|
1121
|
-
if (c && i && n.window) {
|
|
1122
|
-
let N = i, F = c.promise, x = n.window.document.startViewTransition(async () => {
|
|
1123
|
-
h(() => s(N)), await F;
|
|
1124
|
-
});
|
|
1125
|
-
x.finished.finally(() => {
|
|
1126
|
-
f(void 0), v(void 0), u(void 0), l({
|
|
1127
|
-
isTransitioning: !1
|
|
1128
|
-
});
|
|
1129
|
-
}), v(x);
|
|
1130
|
-
}
|
|
1131
|
-
}, [h, i, c, n.window]), r.useEffect(() => {
|
|
1132
|
-
c && i && a.location.key === i.location.key && c.resolve();
|
|
1133
|
-
}, [c, p, a.location, i]), r.useEffect(() => {
|
|
1134
|
-
!d.isTransitioning && g && (u(g.state), l({
|
|
1135
|
-
isTransitioning: !0,
|
|
1136
|
-
flushSync: !1,
|
|
1137
|
-
currentLocation: g.currentLocation,
|
|
1138
|
-
nextLocation: g.nextLocation
|
|
1139
|
-
}), b(void 0));
|
|
1140
|
-
}, [d.isTransitioning, g]), r.useEffect(() => {
|
|
1141
|
-
process.env.NODE_ENV !== "production" && w(t == null || !n.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead");
|
|
1142
|
-
}, []);
|
|
1143
|
-
let R = r.useMemo(() => ({
|
|
1144
|
-
createHref: n.createHref,
|
|
1145
|
-
encodeLocation: n.encodeLocation,
|
|
1146
|
-
go: (N) => n.navigate(N),
|
|
1147
|
-
push: (N, F, x) => n.navigate(N, {
|
|
1148
|
-
state: F,
|
|
1149
|
-
preventScrollReset: x == null ? void 0 : x.preventScrollReset
|
|
1150
|
-
}),
|
|
1151
|
-
replace: (N, F, x) => n.navigate(N, {
|
|
1152
|
-
replace: !0,
|
|
1153
|
-
state: F,
|
|
1154
|
-
preventScrollReset: x == null ? void 0 : x.preventScrollReset
|
|
1155
|
-
})
|
|
1156
|
-
}), [n]), k = n.basename || "/", J = r.useMemo(() => ({
|
|
1157
|
-
router: n,
|
|
1158
|
-
navigator: R,
|
|
1159
|
-
static: !1,
|
|
1160
|
-
basename: k
|
|
1161
|
-
}), [n, R, k]), re = r.useMemo(() => ({
|
|
1162
|
-
v7_relativeSplatPath: n.future.v7_relativeSplatPath
|
|
1163
|
-
}), [n.future.v7_relativeSplatPath]);
|
|
1164
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(U.Provider, {
|
|
1165
|
-
value: J
|
|
1166
|
-
}, /* @__PURE__ */ r.createElement(M.Provider, {
|
|
1167
|
-
value: a
|
|
1168
|
-
}, /* @__PURE__ */ r.createElement(ye.Provider, {
|
|
1169
|
-
value: y.current
|
|
1170
|
-
}, /* @__PURE__ */ r.createElement(Ee.Provider, {
|
|
1171
|
-
value: d
|
|
1172
|
-
}, /* @__PURE__ */ r.createElement(H, {
|
|
1173
|
-
basename: k,
|
|
1174
|
-
location: a.location,
|
|
1175
|
-
navigationType: a.historyAction,
|
|
1176
|
-
navigator: R,
|
|
1177
|
-
future: re
|
|
1178
|
-
}, a.initialized || n.future.v7_partialHydration ? /* @__PURE__ */ r.createElement(Cn, {
|
|
1179
|
-
routes: n.routes,
|
|
1180
|
-
future: n.future,
|
|
1181
|
-
state: a
|
|
1182
|
-
}) : t))))), null);
|
|
1183
|
-
}
|
|
1184
|
-
const Cn = /* @__PURE__ */ r.memo(xn);
|
|
1185
|
-
function xn(e) {
|
|
1186
|
-
let {
|
|
1187
|
-
routes: t,
|
|
1188
|
-
future: n,
|
|
1189
|
-
state: o
|
|
1190
|
-
} = e;
|
|
1191
|
-
return pe(t, void 0, o, n);
|
|
1192
|
-
}
|
|
1193
|
-
function Dn(e) {
|
|
1194
|
-
let {
|
|
1195
|
-
basename: t,
|
|
1196
|
-
children: n,
|
|
1197
|
-
future: o,
|
|
1198
|
-
window: a
|
|
1199
|
-
} = e, s = r.useRef();
|
|
1200
|
-
s.current == null && (s.current = nt({
|
|
1201
|
-
window: a,
|
|
1202
|
-
v5Compat: !0
|
|
1203
|
-
}));
|
|
1204
|
-
let i = s.current, [u, d] = r.useState({
|
|
1205
|
-
action: i.action,
|
|
1206
|
-
location: i.location
|
|
1207
|
-
}), {
|
|
1208
|
-
v7_startTransition: l
|
|
1209
|
-
} = o || {}, c = r.useCallback((f) => {
|
|
1210
|
-
l && A ? A(() => d(f)) : d(f);
|
|
1211
|
-
}, [d, l]);
|
|
1212
|
-
return r.useLayoutEffect(() => i.listen(c), [i, c]), /* @__PURE__ */ r.createElement(H, {
|
|
1213
|
-
basename: t,
|
|
1214
|
-
children: n,
|
|
1215
|
-
location: u.location,
|
|
1216
|
-
navigationType: u.action,
|
|
1217
|
-
navigator: i,
|
|
1218
|
-
future: o
|
|
1219
|
-
});
|
|
1220
|
-
}
|
|
1221
|
-
function On(e) {
|
|
1222
|
-
let {
|
|
1223
|
-
basename: t,
|
|
1224
|
-
children: n,
|
|
1225
|
-
future: o,
|
|
1226
|
-
window: a
|
|
1227
|
-
} = e, s = r.useRef();
|
|
1228
|
-
s.current == null && (s.current = rt({
|
|
1229
|
-
window: a,
|
|
1230
|
-
v5Compat: !0
|
|
1231
|
-
}));
|
|
1232
|
-
let i = s.current, [u, d] = r.useState({
|
|
1233
|
-
action: i.action,
|
|
1234
|
-
location: i.location
|
|
1235
|
-
}), {
|
|
1236
|
-
v7_startTransition: l
|
|
1237
|
-
} = o || {}, c = r.useCallback((f) => {
|
|
1238
|
-
l && A ? A(() => d(f)) : d(f);
|
|
1239
|
-
}, [d, l]);
|
|
1240
|
-
return r.useLayoutEffect(() => i.listen(c), [i, c]), /* @__PURE__ */ r.createElement(H, {
|
|
1241
|
-
basename: t,
|
|
1242
|
-
children: n,
|
|
1243
|
-
location: u.location,
|
|
1244
|
-
navigationType: u.action,
|
|
1245
|
-
navigator: i,
|
|
1246
|
-
future: o
|
|
1247
|
-
});
|
|
1248
|
-
}
|
|
1249
|
-
function xt(e) {
|
|
1250
|
-
let {
|
|
1251
|
-
basename: t,
|
|
1252
|
-
children: n,
|
|
1253
|
-
future: o,
|
|
1254
|
-
history: a
|
|
1255
|
-
} = e, [s, i] = r.useState({
|
|
1256
|
-
action: a.action,
|
|
1257
|
-
location: a.location
|
|
1258
|
-
}), {
|
|
1259
|
-
v7_startTransition: u
|
|
1260
|
-
} = o || {}, d = r.useCallback((l) => {
|
|
1261
|
-
u && A ? A(() => i(l)) : i(l);
|
|
1262
|
-
}, [i, u]);
|
|
1263
|
-
return r.useLayoutEffect(() => a.listen(d), [a, d]), /* @__PURE__ */ r.createElement(H, {
|
|
1264
|
-
basename: t,
|
|
1265
|
-
children: n,
|
|
1266
|
-
location: s.location,
|
|
1267
|
-
navigationType: s.action,
|
|
1268
|
-
navigator: a,
|
|
1269
|
-
future: o
|
|
1270
|
-
});
|
|
1271
|
-
}
|
|
1272
|
-
process.env.NODE_ENV !== "production" && (xt.displayName = "unstable_HistoryRouter");
|
|
1273
|
-
const Pn = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", Ln = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, je = /* @__PURE__ */ r.forwardRef(function(t, n) {
|
|
1274
|
-
let {
|
|
1275
|
-
onClick: o,
|
|
1276
|
-
relative: a,
|
|
1277
|
-
reloadDocument: s,
|
|
1278
|
-
replace: i,
|
|
1279
|
-
state: u,
|
|
1280
|
-
target: d,
|
|
1281
|
-
to: l,
|
|
1282
|
-
preventScrollReset: c,
|
|
1283
|
-
unstable_viewTransition: f
|
|
1284
|
-
} = t, p = Be(t, pn), {
|
|
1285
|
-
basename: v
|
|
1286
|
-
} = r.useContext(S), g, b = !1;
|
|
1287
|
-
if (typeof l == "string" && Ln.test(l) && (g = l, Pn))
|
|
1288
|
-
try {
|
|
1289
|
-
let E = new URL(window.location.href), R = l.startsWith("//") ? new URL(E.protocol + l) : new URL(l), k = T(R.pathname, v);
|
|
1290
|
-
R.origin === E.origin && k != null ? l = k + R.search + R.hash : b = !0;
|
|
1291
|
-
} catch {
|
|
1292
|
-
process.env.NODE_ENV !== "production" && w(!1, '<Link to="' + l + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.');
|
|
1293
|
-
}
|
|
1294
|
-
let y = De(l, {
|
|
1295
|
-
relative: a
|
|
1296
|
-
}), _ = Lt(l, {
|
|
1297
|
-
replace: i,
|
|
1298
|
-
state: u,
|
|
1299
|
-
target: d,
|
|
1300
|
-
preventScrollReset: c,
|
|
1301
|
-
relative: a,
|
|
1302
|
-
unstable_viewTransition: f
|
|
1303
|
-
});
|
|
1304
|
-
function h(E) {
|
|
1305
|
-
o && o(E), E.defaultPrevented || _(E);
|
|
1306
|
-
}
|
|
1307
|
-
return (
|
|
1308
|
-
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1309
|
-
/* @__PURE__ */ r.createElement("a", D({}, p, {
|
|
1310
|
-
href: g || y,
|
|
1311
|
-
onClick: b || s ? o : h,
|
|
1312
|
-
ref: n,
|
|
1313
|
-
target: d
|
|
1314
|
-
}))
|
|
1315
|
-
);
|
|
1316
|
-
});
|
|
1317
|
-
process.env.NODE_ENV !== "production" && (je.displayName = "Link");
|
|
1318
|
-
const Dt = /* @__PURE__ */ r.forwardRef(function(t, n) {
|
|
1319
|
-
let {
|
|
1320
|
-
"aria-current": o = "page",
|
|
1321
|
-
caseSensitive: a = !1,
|
|
1322
|
-
className: s = "",
|
|
1323
|
-
end: i = !1,
|
|
1324
|
-
style: u,
|
|
1325
|
-
to: d,
|
|
1326
|
-
unstable_viewTransition: l,
|
|
1327
|
-
children: c
|
|
1328
|
-
} = t, f = Be(t, hn), p = Y(d, {
|
|
1329
|
-
relative: f.relative
|
|
1330
|
-
}), v = L(), g = r.useContext(M), {
|
|
1331
|
-
navigator: b,
|
|
1332
|
-
basename: y
|
|
1333
|
-
} = r.useContext(S), _ = g != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1334
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1335
|
-
Vt(p) && l === !0, h = b.encodeLocation ? b.encodeLocation(p).pathname : p.pathname, E = v.pathname, R = g && g.navigation && g.navigation.location ? g.navigation.location.pathname : null;
|
|
1336
|
-
a || (E = E.toLowerCase(), R = R ? R.toLowerCase() : null, h = h.toLowerCase()), R && y && (R = T(R, y) || R);
|
|
1337
|
-
const k = h !== "/" && h.endsWith("/") ? h.length - 1 : h.length;
|
|
1338
|
-
let J = E === h || !i && E.startsWith(h) && E.charAt(k) === "/", re = R != null && (R === h || !i && R.startsWith(h) && R.charAt(h.length) === "/"), N = {
|
|
1339
|
-
isActive: J,
|
|
1340
|
-
isPending: re,
|
|
1341
|
-
isTransitioning: _
|
|
1342
|
-
}, F = J ? o : void 0, x;
|
|
1343
|
-
typeof s == "function" ? x = s(N) : x = [s, J ? "active" : null, re ? "pending" : null, _ ? "transitioning" : null].filter(Boolean).join(" ");
|
|
1344
|
-
let oe = typeof u == "function" ? u(N) : u;
|
|
1345
|
-
return /* @__PURE__ */ r.createElement(je, D({}, f, {
|
|
1346
|
-
"aria-current": F,
|
|
1347
|
-
className: x,
|
|
1348
|
-
ref: n,
|
|
1349
|
-
style: oe,
|
|
1350
|
-
to: d,
|
|
1351
|
-
unstable_viewTransition: l
|
|
1352
|
-
}), typeof c == "function" ? c(N) : c);
|
|
1353
|
-
});
|
|
1354
|
-
process.env.NODE_ENV !== "production" && (Dt.displayName = "NavLink");
|
|
1355
|
-
const He = /* @__PURE__ */ r.forwardRef((e, t) => {
|
|
1356
|
-
let {
|
|
1357
|
-
fetcherKey: n,
|
|
1358
|
-
navigate: o,
|
|
1359
|
-
reloadDocument: a,
|
|
1360
|
-
replace: s,
|
|
1361
|
-
state: i,
|
|
1362
|
-
method: u = se,
|
|
1363
|
-
action: d,
|
|
1364
|
-
onSubmit: l,
|
|
1365
|
-
relative: c,
|
|
1366
|
-
preventScrollReset: f,
|
|
1367
|
-
unstable_viewTransition: p
|
|
1368
|
-
} = e, v = Be(e, mn), g = ze(), b = Ft(d, {
|
|
1369
|
-
relative: c
|
|
1370
|
-
}), y = u.toLowerCase() === "get" ? "get" : "post", _ = (h) => {
|
|
1371
|
-
if (l && l(h), h.defaultPrevented) return;
|
|
1372
|
-
h.preventDefault();
|
|
1373
|
-
let E = h.nativeEvent.submitter, R = (E == null ? void 0 : E.getAttribute("formmethod")) || u;
|
|
1374
|
-
g(E || h.currentTarget, {
|
|
1375
|
-
fetcherKey: n,
|
|
1376
|
-
method: R,
|
|
1377
|
-
navigate: o,
|
|
1378
|
-
replace: s,
|
|
1379
|
-
state: i,
|
|
1380
|
-
relative: c,
|
|
1381
|
-
preventScrollReset: f,
|
|
1382
|
-
unstable_viewTransition: p
|
|
1383
|
-
});
|
|
1384
|
-
};
|
|
1385
|
-
return /* @__PURE__ */ r.createElement("form", D({
|
|
1386
|
-
ref: t,
|
|
1387
|
-
method: y,
|
|
1388
|
-
action: b,
|
|
1389
|
-
onSubmit: a ? l : _
|
|
1390
|
-
}, v));
|
|
1391
|
-
});
|
|
1392
|
-
process.env.NODE_ENV !== "production" && (He.displayName = "Form");
|
|
1393
|
-
function Ot(e) {
|
|
1394
|
-
let {
|
|
1395
|
-
getKey: t,
|
|
1396
|
-
storageKey: n
|
|
1397
|
-
} = e;
|
|
1398
|
-
return Ut({
|
|
1399
|
-
getKey: t,
|
|
1400
|
-
storageKey: n
|
|
1401
|
-
}), null;
|
|
1402
|
-
}
|
|
1403
|
-
process.env.NODE_ENV !== "production" && (Ot.displayName = "ScrollRestoration");
|
|
1404
|
-
var $;
|
|
1405
|
-
(function(e) {
|
|
1406
|
-
e.UseScrollRestoration = "useScrollRestoration", e.UseSubmit = "useSubmit", e.UseSubmitFetcher = "useSubmitFetcher", e.UseFetcher = "useFetcher", e.useViewTransitionState = "useViewTransitionState";
|
|
1407
|
-
})($ || ($ = {}));
|
|
1408
|
-
var ee;
|
|
1409
|
-
(function(e) {
|
|
1410
|
-
e.UseFetcher = "useFetcher", e.UseFetchers = "useFetchers", e.UseScrollRestoration = "useScrollRestoration";
|
|
1411
|
-
})(ee || (ee = {}));
|
|
1412
|
-
function Pt(e) {
|
|
1413
|
-
return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
1414
|
-
}
|
|
1415
|
-
function ge(e) {
|
|
1416
|
-
let t = r.useContext(U);
|
|
1417
|
-
return t || (process.env.NODE_ENV !== "production" ? m(!1, Pt(e)) : m(!1)), t;
|
|
1418
|
-
}
|
|
1419
|
-
function Ke(e) {
|
|
1420
|
-
let t = r.useContext(M);
|
|
1421
|
-
return t || (process.env.NODE_ENV !== "production" ? m(!1, Pt(e)) : m(!1)), t;
|
|
1422
|
-
}
|
|
1423
|
-
function Lt(e, t) {
|
|
1424
|
-
let {
|
|
1425
|
-
target: n,
|
|
1426
|
-
replace: o,
|
|
1427
|
-
state: a,
|
|
1428
|
-
preventScrollReset: s,
|
|
1429
|
-
relative: i,
|
|
1430
|
-
unstable_viewTransition: u
|
|
1431
|
-
} = t === void 0 ? {} : t, d = te(), l = L(), c = Y(e, {
|
|
1432
|
-
relative: i
|
|
1433
|
-
});
|
|
1434
|
-
return r.useCallback((f) => {
|
|
1435
|
-
if (ln(f, n)) {
|
|
1436
|
-
f.preventDefault();
|
|
1437
|
-
let p = o !== void 0 ? o : Q(l) === Q(c);
|
|
1438
|
-
d(e, {
|
|
1439
|
-
replace: p,
|
|
1440
|
-
state: a,
|
|
1441
|
-
preventScrollReset: s,
|
|
1442
|
-
relative: i,
|
|
1443
|
-
unstable_viewTransition: u
|
|
1444
|
-
});
|
|
1445
|
-
}
|
|
1446
|
-
}, [l, d, c, o, a, n, e, s, i, u]);
|
|
1447
|
-
}
|
|
1448
|
-
function Tn(e) {
|
|
1449
|
-
process.env.NODE_ENV !== "production" && w(typeof URLSearchParams < "u", "You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");
|
|
1450
|
-
let t = r.useRef(ce(e)), n = r.useRef(!1), o = L(), a = r.useMemo(() => (
|
|
1451
|
-
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
1452
|
-
// Once we call that we want those to take precedence, otherwise you can't
|
|
1453
|
-
// remove a param with setSearchParams({}) if it has an initial value
|
|
1454
|
-
un(o.search, n.current ? null : t.current)
|
|
1455
|
-
), [o.search]), s = te(), i = r.useCallback((u, d) => {
|
|
1456
|
-
const l = ce(typeof u == "function" ? u(a) : u);
|
|
1457
|
-
n.current = !0, s("?" + l, d);
|
|
1458
|
-
}, [s, a]);
|
|
1459
|
-
return [a, i];
|
|
1460
|
-
}
|
|
1461
|
-
function Fn() {
|
|
1462
|
-
if (typeof document > "u")
|
|
1463
|
-
throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
|
|
1464
|
-
}
|
|
1465
|
-
let Un = 0, Tt = () => "__" + String(++Un) + "__";
|
|
1466
|
-
function ze() {
|
|
1467
|
-
let {
|
|
1468
|
-
router: e
|
|
1469
|
-
} = ge($.UseSubmit), {
|
|
1470
|
-
basename: t
|
|
1471
|
-
} = r.useContext(S), n = Fe();
|
|
1472
|
-
return r.useCallback(function(o, a) {
|
|
1473
|
-
a === void 0 && (a = {}), Fn();
|
|
1474
|
-
let {
|
|
1475
|
-
action: s,
|
|
1476
|
-
method: i,
|
|
1477
|
-
encType: u,
|
|
1478
|
-
formData: d,
|
|
1479
|
-
body: l
|
|
1480
|
-
} = fn(o, t);
|
|
1481
|
-
if (a.navigate === !1) {
|
|
1482
|
-
let c = a.fetcherKey || Tt();
|
|
1483
|
-
e.fetch(c, n, a.action || s, {
|
|
1484
|
-
preventScrollReset: a.preventScrollReset,
|
|
1485
|
-
formData: d,
|
|
1486
|
-
body: l,
|
|
1487
|
-
formMethod: a.method || i,
|
|
1488
|
-
formEncType: a.encType || u,
|
|
1489
|
-
unstable_flushSync: a.unstable_flushSync
|
|
1490
|
-
});
|
|
1491
|
-
} else
|
|
1492
|
-
e.navigate(a.action || s, {
|
|
1493
|
-
preventScrollReset: a.preventScrollReset,
|
|
1494
|
-
formData: d,
|
|
1495
|
-
body: l,
|
|
1496
|
-
formMethod: a.method || i,
|
|
1497
|
-
formEncType: a.encType || u,
|
|
1498
|
-
replace: a.replace,
|
|
1499
|
-
state: a.state,
|
|
1500
|
-
fromRouteId: n,
|
|
1501
|
-
unstable_flushSync: a.unstable_flushSync,
|
|
1502
|
-
unstable_viewTransition: a.unstable_viewTransition
|
|
1503
|
-
});
|
|
1504
|
-
}, [e, t, n]);
|
|
1505
|
-
}
|
|
1506
|
-
function Ft(e, t) {
|
|
1507
|
-
let {
|
|
1508
|
-
relative: n
|
|
1509
|
-
} = t === void 0 ? {} : t, {
|
|
1510
|
-
basename: o
|
|
1511
|
-
} = r.useContext(S), a = r.useContext(C);
|
|
1512
|
-
a || (process.env.NODE_ENV !== "production" ? m(!1, "useFormAction must be used inside a RouteContext") : m(!1));
|
|
1513
|
-
let [s] = a.matches.slice(-1), i = D({}, Y(e || ".", {
|
|
1514
|
-
relative: n
|
|
1515
|
-
})), u = L();
|
|
1516
|
-
if (e == null) {
|
|
1517
|
-
i.search = u.search;
|
|
1518
|
-
let d = new URLSearchParams(i.search);
|
|
1519
|
-
d.has("index") && d.get("index") === "" && (d.delete("index"), i.search = d.toString() ? "?" + d.toString() : "");
|
|
1520
|
-
}
|
|
1521
|
-
return (!e || e === ".") && s.route.index && (i.search = i.search ? i.search.replace(/^\?/, "?index&") : "?index"), o !== "/" && (i.pathname = i.pathname === "/" ? o : G([o, i.pathname])), Q(i);
|
|
1522
|
-
}
|
|
1523
|
-
function Vn(e) {
|
|
1524
|
-
var t;
|
|
1525
|
-
let {
|
|
1526
|
-
key: n
|
|
1527
|
-
} = e === void 0 ? {} : e, {
|
|
1528
|
-
router: o
|
|
1529
|
-
} = ge($.UseFetcher), a = Ke(ee.UseFetcher), s = r.useContext(ye), i = r.useContext(C), u = (t = i.matches[i.matches.length - 1]) == null ? void 0 : t.route.id;
|
|
1530
|
-
s || (process.env.NODE_ENV !== "production" ? m(!1, "useFetcher must be used inside a FetchersContext") : m(!1)), i || (process.env.NODE_ENV !== "production" ? m(!1, "useFetcher must be used inside a RouteContext") : m(!1)), u == null && (process.env.NODE_ENV !== "production" ? m(!1, 'useFetcher can only be used on routes that contain a unique "id"') : m(!1));
|
|
1531
|
-
let d = $e ? $e() : "", [l, c] = r.useState(n || d);
|
|
1532
|
-
n && n !== l ? c(n) : l || c(Tt()), r.useEffect(() => (o.getFetcher(l), () => {
|
|
1533
|
-
o.deleteFetcher(l);
|
|
1534
|
-
}), [o, l]);
|
|
1535
|
-
let f = r.useCallback((h, E) => {
|
|
1536
|
-
u || (process.env.NODE_ENV !== "production" ? m(!1, "No routeId available for fetcher.load()") : m(!1)), o.fetch(l, u, h, E);
|
|
1537
|
-
}, [l, u, o]), p = ze(), v = r.useCallback((h, E) => {
|
|
1538
|
-
p(h, D({}, E, {
|
|
1539
|
-
navigate: !1,
|
|
1540
|
-
fetcherKey: l
|
|
1541
|
-
}));
|
|
1542
|
-
}, [l, p]), g = r.useMemo(() => {
|
|
1543
|
-
let h = /* @__PURE__ */ r.forwardRef((E, R) => /* @__PURE__ */ r.createElement(He, D({}, E, {
|
|
1544
|
-
navigate: !1,
|
|
1545
|
-
fetcherKey: l,
|
|
1546
|
-
ref: R
|
|
1547
|
-
})));
|
|
1548
|
-
return process.env.NODE_ENV !== "production" && (h.displayName = "fetcher.Form"), h;
|
|
1549
|
-
}, [l]), b = a.fetchers.get(l) || Ht, y = s.get(l);
|
|
1550
|
-
return r.useMemo(() => D({
|
|
1551
|
-
Form: g,
|
|
1552
|
-
submit: v,
|
|
1553
|
-
load: f
|
|
1554
|
-
}, b, {
|
|
1555
|
-
data: y
|
|
1556
|
-
}), [g, v, f, b, y]);
|
|
1557
|
-
}
|
|
1558
|
-
function kn() {
|
|
1559
|
-
let e = Ke(ee.UseFetchers);
|
|
1560
|
-
return Array.from(e.fetchers.entries()).map((t) => {
|
|
1561
|
-
let [n, o] = t;
|
|
1562
|
-
return D({}, o, {
|
|
1563
|
-
key: n
|
|
1564
|
-
});
|
|
1565
|
-
});
|
|
1566
|
-
}
|
|
1567
|
-
const Je = "react-router-scroll-positions";
|
|
1568
|
-
let ie = {};
|
|
1569
|
-
function Ut(e) {
|
|
1570
|
-
let {
|
|
1571
|
-
getKey: t,
|
|
1572
|
-
storageKey: n
|
|
1573
|
-
} = e === void 0 ? {} : e, {
|
|
1574
|
-
router: o
|
|
1575
|
-
} = ge($.UseScrollRestoration), {
|
|
1576
|
-
restoreScrollPosition: a,
|
|
1577
|
-
preventScrollReset: s
|
|
1578
|
-
} = Ke(ee.UseScrollRestoration), {
|
|
1579
|
-
basename: i
|
|
1580
|
-
} = r.useContext(S), u = L(), d = Ve(), l = Ue();
|
|
1581
|
-
r.useEffect(() => (window.history.scrollRestoration = "manual", () => {
|
|
1582
|
-
window.history.scrollRestoration = "auto";
|
|
1583
|
-
}), []), An(r.useCallback(() => {
|
|
1584
|
-
if (l.state === "idle") {
|
|
1585
|
-
let c = (t ? t(u, d) : null) || u.key;
|
|
1586
|
-
ie[c] = window.scrollY;
|
|
1587
|
-
}
|
|
1588
|
-
try {
|
|
1589
|
-
sessionStorage.setItem(n || Je, JSON.stringify(ie));
|
|
1590
|
-
} catch (c) {
|
|
1591
|
-
process.env.NODE_ENV !== "production" && w(!1, "Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (" + c + ").");
|
|
1592
|
-
}
|
|
1593
|
-
window.history.scrollRestoration = "auto";
|
|
1594
|
-
}, [n, t, l.state, u, d])), typeof document < "u" && (r.useLayoutEffect(() => {
|
|
1595
|
-
try {
|
|
1596
|
-
let c = sessionStorage.getItem(n || Je);
|
|
1597
|
-
c && (ie = JSON.parse(c));
|
|
1598
|
-
} catch {
|
|
1599
|
-
}
|
|
1600
|
-
}, [n]), r.useLayoutEffect(() => {
|
|
1601
|
-
let c = t && i !== "/" ? (p, v) => t(
|
|
1602
|
-
// Strip the basename to match useLocation()
|
|
1603
|
-
D({}, p, {
|
|
1604
|
-
pathname: T(p.pathname, i) || p.pathname
|
|
1605
|
-
}),
|
|
1606
|
-
v
|
|
1607
|
-
) : t, f = o == null ? void 0 : o.enableScrollRestoration(ie, () => window.scrollY, c);
|
|
1608
|
-
return () => f && f();
|
|
1609
|
-
}, [o, i, t]), r.useLayoutEffect(() => {
|
|
1610
|
-
if (a !== !1) {
|
|
1611
|
-
if (typeof a == "number") {
|
|
1612
|
-
window.scrollTo(0, a);
|
|
1613
|
-
return;
|
|
1614
|
-
}
|
|
1615
|
-
if (u.hash) {
|
|
1616
|
-
let c = document.getElementById(decodeURIComponent(u.hash.slice(1)));
|
|
1617
|
-
if (c) {
|
|
1618
|
-
c.scrollIntoView();
|
|
1619
|
-
return;
|
|
1620
|
-
}
|
|
1621
|
-
}
|
|
1622
|
-
s !== !0 && window.scrollTo(0, 0);
|
|
1623
|
-
}
|
|
1624
|
-
}, [u, a, s]));
|
|
1625
|
-
}
|
|
1626
|
-
function In(e, t) {
|
|
1627
|
-
let {
|
|
1628
|
-
capture: n
|
|
1629
|
-
} = t || {};
|
|
1630
|
-
r.useEffect(() => {
|
|
1631
|
-
let o = n != null ? {
|
|
1632
|
-
capture: n
|
|
1633
|
-
} : void 0;
|
|
1634
|
-
return window.addEventListener("beforeunload", e, o), () => {
|
|
1635
|
-
window.removeEventListener("beforeunload", e, o);
|
|
1636
|
-
};
|
|
1637
|
-
}, [e, n]);
|
|
1638
|
-
}
|
|
1639
|
-
function An(e, t) {
|
|
1640
|
-
let {
|
|
1641
|
-
capture: n
|
|
1642
|
-
} = {};
|
|
1643
|
-
r.useEffect(() => {
|
|
1644
|
-
let o = n != null ? {
|
|
1645
|
-
capture: n
|
|
1646
|
-
} : void 0;
|
|
1647
|
-
return window.addEventListener("pagehide", e, o), () => {
|
|
1648
|
-
window.removeEventListener("pagehide", e, o);
|
|
1649
|
-
};
|
|
1650
|
-
}, [e, n]);
|
|
1651
|
-
}
|
|
1652
|
-
function Mn(e) {
|
|
1653
|
-
let {
|
|
1654
|
-
when: t,
|
|
1655
|
-
message: n
|
|
1656
|
-
} = e, o = Ae(t);
|
|
1657
|
-
r.useEffect(() => {
|
|
1658
|
-
o.state === "blocked" && (window.confirm(n) ? setTimeout(o.proceed, 0) : o.reset());
|
|
1659
|
-
}, [o, n]), r.useEffect(() => {
|
|
1660
|
-
o.state === "blocked" && !t && o.reset();
|
|
1661
|
-
}, [o, t]);
|
|
1662
|
-
}
|
|
1663
|
-
function Vt(e, t) {
|
|
1664
|
-
t === void 0 && (t = {});
|
|
1665
|
-
let n = r.useContext(Ee);
|
|
1666
|
-
n == null && (process.env.NODE_ENV !== "production" ? m(!1, "`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : m(!1));
|
|
1667
|
-
let {
|
|
1668
|
-
basename: o
|
|
1669
|
-
} = ge($.useViewTransitionState), a = Y(e, {
|
|
1670
|
-
relative: t.relative
|
|
1671
|
-
});
|
|
1672
|
-
if (!n.isTransitioning)
|
|
1673
|
-
return !1;
|
|
1674
|
-
let s = T(n.currentLocation.pathname, o) || n.currentLocation.pathname, i = T(n.nextLocation.pathname, o) || n.nextLocation.pathname;
|
|
1675
|
-
return X(a.pathname, i) != null || X(a.pathname, s) != null;
|
|
1676
|
-
}
|
|
1677
|
-
const Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1678
|
-
__proto__: null,
|
|
1679
|
-
AbortedDeferredError: Se,
|
|
1680
|
-
Await: _t,
|
|
1681
|
-
BrowserRouter: Dn,
|
|
1682
|
-
Form: He,
|
|
1683
|
-
HashRouter: On,
|
|
1684
|
-
Link: je,
|
|
1685
|
-
MemoryRouter: gt,
|
|
1686
|
-
NavLink: Dt,
|
|
1687
|
-
Navigate: bt,
|
|
1688
|
-
get NavigationType() {
|
|
1689
|
-
return de;
|
|
1690
|
-
},
|
|
1691
|
-
Outlet: Rt,
|
|
1692
|
-
Route: Me,
|
|
1693
|
-
Router: H,
|
|
1694
|
-
RouterProvider: Sn,
|
|
1695
|
-
Routes: Nt,
|
|
1696
|
-
ScrollRestoration: Ot,
|
|
1697
|
-
UNSAFE_DataRouterContext: U,
|
|
1698
|
-
UNSAFE_DataRouterStateContext: M,
|
|
1699
|
-
UNSAFE_ErrorResponseImpl: ot,
|
|
1700
|
-
UNSAFE_FetchersContext: ye,
|
|
1701
|
-
UNSAFE_LocationContext: B,
|
|
1702
|
-
UNSAFE_NavigationContext: S,
|
|
1703
|
-
UNSAFE_RouteContext: C,
|
|
1704
|
-
UNSAFE_ViewTransitionContext: Ee,
|
|
1705
|
-
UNSAFE_useRouteId: Fe,
|
|
1706
|
-
UNSAFE_useScrollRestoration: Ut,
|
|
1707
|
-
createBrowserRouter: En,
|
|
1708
|
-
createHashRouter: yn,
|
|
1709
|
-
createMemoryRouter: St,
|
|
1710
|
-
createPath: Q,
|
|
1711
|
-
createRoutesFromChildren: W,
|
|
1712
|
-
createRoutesFromElements: W,
|
|
1713
|
-
createSearchParams: ce,
|
|
1714
|
-
defer: Ge,
|
|
1715
|
-
generatePath: Xe,
|
|
1716
|
-
isRouteErrorResponse: we,
|
|
1717
|
-
json: Qe,
|
|
1718
|
-
matchPath: X,
|
|
1719
|
-
matchRoutes: _e,
|
|
1720
|
-
parsePath: fe,
|
|
1721
|
-
redirect: Ze,
|
|
1722
|
-
redirectDocument: et,
|
|
1723
|
-
renderMatches: wt,
|
|
1724
|
-
resolvePath: tt,
|
|
1725
|
-
unstable_HistoryRouter: xt,
|
|
1726
|
-
unstable_usePrompt: Mn,
|
|
1727
|
-
unstable_useViewTransitionState: Vt,
|
|
1728
|
-
useActionData: vt,
|
|
1729
|
-
useAsyncError: Et,
|
|
1730
|
-
useAsyncValue: Ie,
|
|
1731
|
-
useBeforeUnload: In,
|
|
1732
|
-
useBlocker: Ae,
|
|
1733
|
-
useFetcher: Vn,
|
|
1734
|
-
useFetchers: kn,
|
|
1735
|
-
useFormAction: Ft,
|
|
1736
|
-
useHref: De,
|
|
1737
|
-
useInRouterContext: V,
|
|
1738
|
-
useLinkClickHandler: Lt,
|
|
1739
|
-
useLoaderData: ht,
|
|
1740
|
-
useLocation: L,
|
|
1741
|
-
useMatch: it,
|
|
1742
|
-
useMatches: Ve,
|
|
1743
|
-
useNavigate: te,
|
|
1744
|
-
useNavigation: Ue,
|
|
1745
|
-
useNavigationType: at,
|
|
1746
|
-
useOutlet: Oe,
|
|
1747
|
-
useOutletContext: ct,
|
|
1748
|
-
useParams: dt,
|
|
1749
|
-
useResolvedPath: Y,
|
|
1750
|
-
useRevalidator: pt,
|
|
1751
|
-
useRouteError: ke,
|
|
1752
|
-
useRouteLoaderData: mt,
|
|
1753
|
-
useRoutes: Pe,
|
|
1754
|
-
useSearchParams: Tn,
|
|
1755
|
-
useSubmit: ze
|
|
1756
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1757
|
-
export {
|
|
1758
|
-
je as L,
|
|
1759
|
-
Dt as N,
|
|
1760
|
-
Rt as O,
|
|
1761
|
-
Sn as R,
|
|
1762
|
-
te as a,
|
|
1763
|
-
L as b,
|
|
1764
|
-
dt as c,
|
|
1765
|
-
ke as d,
|
|
1766
|
-
jn as e,
|
|
1767
|
-
Hn as f,
|
|
1768
|
-
Ue as g,
|
|
1769
|
-
Tn as u
|
|
1770
|
-
};
|
|
1771
|
-
//# sourceMappingURL=index-BG0g4WW0.js.map
|