zudoku 0.1.1-dev.50 → 0.1.1-dev.51
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/config/config.d.ts +19 -2
- package/dist/config/validators/auth.d.ts +2 -0
- package/dist/config/validators/auth.js +2 -0
- package/dist/config/validators/auth.js.map +1 -0
- package/dist/config/validators/validate.d.ts +2 -0
- package/dist/config/validators/validate.js +4 -0
- package/dist/config/validators/validate.js.map +1 -0
- package/dist/lib/authentication/Callback.d.ts +4 -0
- package/dist/lib/authentication/Callback.js +20 -0
- package/dist/lib/authentication/Callback.js.map +1 -0
- package/dist/lib/authentication/auth0.d.ts +5 -0
- package/dist/lib/authentication/auth0.js +9 -0
- package/dist/lib/authentication/auth0.js.map +1 -0
- package/dist/lib/authentication/authentication.d.ts +7 -10
- package/dist/lib/authentication/clerk.d.ts +3 -4
- package/dist/lib/authentication/clerk.js +13 -6
- package/dist/lib/authentication/clerk.js.map +1 -1
- package/dist/lib/authentication/openid.d.ts +5 -11
- package/dist/lib/authentication/openid.js +90 -73
- package/dist/lib/authentication/openid.js.map +1 -1
- package/dist/lib/components/DevPortal.d.ts +2 -2
- package/dist/lib/components/DevPortal.js +5 -1
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/Layout.js +1 -4
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +4 -7
- package/dist/lib/core/DevPortalContext.js +6 -6
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +1 -6
- package/dist/lib/plugins/api-key/index.js +6 -3
- package/dist/lib/plugins/api-key/index.js.map +1 -1
- package/dist/vite/config.js +2 -0
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-auth.js +1 -1
- package/dist/vite/plugin-auth.js.map +1 -1
- package/lib/DevPortalProvider-yBHPOS9_.js +4559 -0
- package/lib/Spinner-Daa7xsri.js +7329 -0
- package/lib/loglevel-D-4S8up4.js +152 -0
- package/lib/zudoku.auth-auth0.js +829 -0
- package/lib/zudoku.auth-clerk.js +21 -12
- package/lib/zudoku.components.js +180 -174
- package/lib/zudoku.plugins.js +5702 -5846
- package/package.json +4 -1
- package/src/lib/authentication/Callback.tsx +31 -0
- package/src/lib/authentication/auth0.tsx +18 -0
- package/src/lib/authentication/authentication.ts +7 -14
- package/src/lib/authentication/{clerk.ts → clerk.tsx} +17 -9
- package/src/lib/authentication/openid.tsx +206 -0
- package/src/lib/components/DevPortal.tsx +10 -3
- package/src/lib/components/Layout.tsx +1 -5
- package/src/lib/core/DevPortalContext.ts +10 -13
- package/src/lib/core/plugins.ts +4 -4
- package/src/lib/plugins/api-key/index.tsx +9 -3
- package/dist/lib/core/types/combine.d.ts +0 -4
- package/dist/lib/core/types/combine.js +0 -2
- package/dist/lib/core/types/combine.js.map +0 -1
- package/lib/Spinner-9_-7nYgL.js +0 -11855
- package/src/lib/authentication/openid.ts +0 -194
- package/src/lib/core/types/combine.ts +0 -16
|
@@ -0,0 +1,4559 @@
|
|
|
1
|
+
var vn = (e) => {
|
|
2
|
+
throw TypeError(e);
|
|
3
|
+
};
|
|
4
|
+
var Nr = (e, t, r) => t.has(e) || vn("Cannot " + r);
|
|
5
|
+
var E = (e, t, r) => (Nr(e, t, "read from private field"), r ? r.call(e) : t.get(e)), H = (e, t, r) => t.has(e) ? vn("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), I = (e, t, r, n) => (Nr(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r), Y = (e, t, r) => (Nr(e, t, "access private method"), r);
|
|
6
|
+
import * as D from "react";
|
|
7
|
+
import $n, { createContext as Ea, useContext as Ra } from "react";
|
|
8
|
+
var fo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
9
|
+
function ho(e) {
|
|
10
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
11
|
+
}
|
|
12
|
+
function po(e) {
|
|
13
|
+
if (e.__esModule) return e;
|
|
14
|
+
var t = e.default;
|
|
15
|
+
if (typeof t == "function") {
|
|
16
|
+
var r = function n() {
|
|
17
|
+
return this instanceof n ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
|
|
18
|
+
};
|
|
19
|
+
r.prototype = t.prototype;
|
|
20
|
+
} else r = {};
|
|
21
|
+
return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(n) {
|
|
22
|
+
var a = Object.getOwnPropertyDescriptor(e, n);
|
|
23
|
+
Object.defineProperty(r, n, a.get ? a : {
|
|
24
|
+
enumerable: !0,
|
|
25
|
+
get: function() {
|
|
26
|
+
return e[n];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}), r;
|
|
30
|
+
}
|
|
31
|
+
var Ir = { exports: {} }, Wt = {};
|
|
32
|
+
/**
|
|
33
|
+
* @license React
|
|
34
|
+
* react-jsx-runtime.production.min.js
|
|
35
|
+
*
|
|
36
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the MIT license found in the
|
|
39
|
+
* LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/
|
|
41
|
+
var mn;
|
|
42
|
+
function wa() {
|
|
43
|
+
if (mn) return Wt;
|
|
44
|
+
mn = 1;
|
|
45
|
+
var e = $n, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, a = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
46
|
+
function o(f, c, y) {
|
|
47
|
+
var m, l = {}, v = null, O = null;
|
|
48
|
+
y !== void 0 && (v = "" + y), c.key !== void 0 && (v = "" + c.key), c.ref !== void 0 && (O = c.ref);
|
|
49
|
+
for (m in c) n.call(c, m) && !u.hasOwnProperty(m) && (l[m] = c[m]);
|
|
50
|
+
if (f && f.defaultProps) for (m in c = f.defaultProps, c) l[m] === void 0 && (l[m] = c[m]);
|
|
51
|
+
return { $$typeof: t, type: f, key: v, ref: O, props: l, _owner: a.current };
|
|
52
|
+
}
|
|
53
|
+
return Wt.Fragment = r, Wt.jsx = o, Wt.jsxs = o, Wt;
|
|
54
|
+
}
|
|
55
|
+
var zt = {};
|
|
56
|
+
/**
|
|
57
|
+
* @license React
|
|
58
|
+
* react-jsx-runtime.development.js
|
|
59
|
+
*
|
|
60
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the MIT license found in the
|
|
63
|
+
* LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/
|
|
65
|
+
var yn;
|
|
66
|
+
function Sa() {
|
|
67
|
+
return yn || (yn = 1, process.env.NODE_ENV !== "production" && function() {
|
|
68
|
+
var e = $n, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), f = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), F = Symbol.iterator, C = "@@iterator";
|
|
69
|
+
function L(i) {
|
|
70
|
+
if (i === null || typeof i != "object")
|
|
71
|
+
return null;
|
|
72
|
+
var h = F && i[F] || i[C];
|
|
73
|
+
return typeof h == "function" ? h : null;
|
|
74
|
+
}
|
|
75
|
+
var _ = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
76
|
+
function P(i) {
|
|
77
|
+
{
|
|
78
|
+
for (var h = arguments.length, R = new Array(h > 1 ? h - 1 : 0), w = 1; w < h; w++)
|
|
79
|
+
R[w - 1] = arguments[w];
|
|
80
|
+
$("error", i, R);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function $(i, h, R) {
|
|
84
|
+
{
|
|
85
|
+
var w = _.ReactDebugCurrentFrame, S = w.getStackAddendum();
|
|
86
|
+
S !== "" && (h += "%s", R = R.concat([S]));
|
|
87
|
+
var j = R.map(function(T) {
|
|
88
|
+
return String(T);
|
|
89
|
+
});
|
|
90
|
+
j.unshift("Warning: " + h), Function.prototype.apply.call(console[i], console, j);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
var G = !1, re = !1, b = !1, oe = !1, q = !1, W;
|
|
94
|
+
W = Symbol.for("react.module.reference");
|
|
95
|
+
function ce(i) {
|
|
96
|
+
return !!(typeof i == "string" || typeof i == "function" || i === n || i === u || q || i === a || i === y || i === m || oe || i === O || G || re || b || typeof i == "object" && i !== null && (i.$$typeof === v || i.$$typeof === l || i.$$typeof === o || i.$$typeof === f || i.$$typeof === c || // This needs to include all possible module reference object
|
|
97
|
+
// types supported by any Flight configuration anywhere since
|
|
98
|
+
// we don't know which Flight build this will end up being used
|
|
99
|
+
// with.
|
|
100
|
+
i.$$typeof === W || i.getModuleId !== void 0));
|
|
101
|
+
}
|
|
102
|
+
function se(i, h, R) {
|
|
103
|
+
var w = i.displayName;
|
|
104
|
+
if (w)
|
|
105
|
+
return w;
|
|
106
|
+
var S = h.displayName || h.name || "";
|
|
107
|
+
return S !== "" ? R + "(" + S + ")" : R;
|
|
108
|
+
}
|
|
109
|
+
function ge(i) {
|
|
110
|
+
return i.displayName || "Context";
|
|
111
|
+
}
|
|
112
|
+
function ne(i) {
|
|
113
|
+
if (i == null)
|
|
114
|
+
return null;
|
|
115
|
+
if (typeof i.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
|
|
116
|
+
return i.displayName || i.name || null;
|
|
117
|
+
if (typeof i == "string")
|
|
118
|
+
return i;
|
|
119
|
+
switch (i) {
|
|
120
|
+
case n:
|
|
121
|
+
return "Fragment";
|
|
122
|
+
case r:
|
|
123
|
+
return "Portal";
|
|
124
|
+
case u:
|
|
125
|
+
return "Profiler";
|
|
126
|
+
case a:
|
|
127
|
+
return "StrictMode";
|
|
128
|
+
case y:
|
|
129
|
+
return "Suspense";
|
|
130
|
+
case m:
|
|
131
|
+
return "SuspenseList";
|
|
132
|
+
}
|
|
133
|
+
if (typeof i == "object")
|
|
134
|
+
switch (i.$$typeof) {
|
|
135
|
+
case f:
|
|
136
|
+
var h = i;
|
|
137
|
+
return ge(h) + ".Consumer";
|
|
138
|
+
case o:
|
|
139
|
+
var R = i;
|
|
140
|
+
return ge(R._context) + ".Provider";
|
|
141
|
+
case c:
|
|
142
|
+
return se(i, i.render, "ForwardRef");
|
|
143
|
+
case l:
|
|
144
|
+
var w = i.displayName || null;
|
|
145
|
+
return w !== null ? w : ne(i.type) || "Memo";
|
|
146
|
+
case v: {
|
|
147
|
+
var S = i, j = S._payload, T = S._init;
|
|
148
|
+
try {
|
|
149
|
+
return ne(T(j));
|
|
150
|
+
} catch {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
var X = Object.assign, we = 0, it, Z, ot, He, Ie, Se, ke;
|
|
158
|
+
function Ke() {
|
|
159
|
+
}
|
|
160
|
+
Ke.__reactDisabledLog = !0;
|
|
161
|
+
function Pe() {
|
|
162
|
+
{
|
|
163
|
+
if (we === 0) {
|
|
164
|
+
it = console.log, Z = console.info, ot = console.warn, He = console.error, Ie = console.group, Se = console.groupCollapsed, ke = console.groupEnd;
|
|
165
|
+
var i = {
|
|
166
|
+
configurable: !0,
|
|
167
|
+
enumerable: !0,
|
|
168
|
+
value: Ke,
|
|
169
|
+
writable: !0
|
|
170
|
+
};
|
|
171
|
+
Object.defineProperties(console, {
|
|
172
|
+
info: i,
|
|
173
|
+
log: i,
|
|
174
|
+
warn: i,
|
|
175
|
+
error: i,
|
|
176
|
+
group: i,
|
|
177
|
+
groupCollapsed: i,
|
|
178
|
+
groupEnd: i
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
we++;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function Be() {
|
|
185
|
+
{
|
|
186
|
+
if (we--, we === 0) {
|
|
187
|
+
var i = {
|
|
188
|
+
configurable: !0,
|
|
189
|
+
enumerable: !0,
|
|
190
|
+
writable: !0
|
|
191
|
+
};
|
|
192
|
+
Object.defineProperties(console, {
|
|
193
|
+
log: X({}, i, {
|
|
194
|
+
value: it
|
|
195
|
+
}),
|
|
196
|
+
info: X({}, i, {
|
|
197
|
+
value: Z
|
|
198
|
+
}),
|
|
199
|
+
warn: X({}, i, {
|
|
200
|
+
value: ot
|
|
201
|
+
}),
|
|
202
|
+
error: X({}, i, {
|
|
203
|
+
value: He
|
|
204
|
+
}),
|
|
205
|
+
group: X({}, i, {
|
|
206
|
+
value: Ie
|
|
207
|
+
}),
|
|
208
|
+
groupCollapsed: X({}, i, {
|
|
209
|
+
value: Se
|
|
210
|
+
}),
|
|
211
|
+
groupEnd: X({}, i, {
|
|
212
|
+
value: ke
|
|
213
|
+
})
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
we < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
var Oe = _.ReactCurrentDispatcher, Ut;
|
|
220
|
+
function qe(i, h, R) {
|
|
221
|
+
{
|
|
222
|
+
if (Ut === void 0)
|
|
223
|
+
try {
|
|
224
|
+
throw Error();
|
|
225
|
+
} catch (S) {
|
|
226
|
+
var w = S.stack.trim().match(/\n( *(at )?)/);
|
|
227
|
+
Ut = w && w[1] || "";
|
|
228
|
+
}
|
|
229
|
+
return `
|
|
230
|
+
` + Ut + i;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
var At = !1, Et;
|
|
234
|
+
{
|
|
235
|
+
var Dr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
236
|
+
Et = new Dr();
|
|
237
|
+
}
|
|
238
|
+
function le(i, h) {
|
|
239
|
+
if (!i || At)
|
|
240
|
+
return "";
|
|
241
|
+
{
|
|
242
|
+
var R = Et.get(i);
|
|
243
|
+
if (R !== void 0)
|
|
244
|
+
return R;
|
|
245
|
+
}
|
|
246
|
+
var w;
|
|
247
|
+
At = !0;
|
|
248
|
+
var S = Error.prepareStackTrace;
|
|
249
|
+
Error.prepareStackTrace = void 0;
|
|
250
|
+
var j;
|
|
251
|
+
j = Oe.current, Oe.current = null, Pe();
|
|
252
|
+
try {
|
|
253
|
+
if (h) {
|
|
254
|
+
var T = function() {
|
|
255
|
+
throw Error();
|
|
256
|
+
};
|
|
257
|
+
if (Object.defineProperty(T.prototype, "props", {
|
|
258
|
+
set: function() {
|
|
259
|
+
throw Error();
|
|
260
|
+
}
|
|
261
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
262
|
+
try {
|
|
263
|
+
Reflect.construct(T, []);
|
|
264
|
+
} catch (ae) {
|
|
265
|
+
w = ae;
|
|
266
|
+
}
|
|
267
|
+
Reflect.construct(i, [], T);
|
|
268
|
+
} else {
|
|
269
|
+
try {
|
|
270
|
+
T.call();
|
|
271
|
+
} catch (ae) {
|
|
272
|
+
w = ae;
|
|
273
|
+
}
|
|
274
|
+
i.call(T.prototype);
|
|
275
|
+
}
|
|
276
|
+
} else {
|
|
277
|
+
try {
|
|
278
|
+
throw Error();
|
|
279
|
+
} catch (ae) {
|
|
280
|
+
w = ae;
|
|
281
|
+
}
|
|
282
|
+
i();
|
|
283
|
+
}
|
|
284
|
+
} catch (ae) {
|
|
285
|
+
if (ae && w && typeof ae.stack == "string") {
|
|
286
|
+
for (var M = ae.stack.split(`
|
|
287
|
+
`), A = w.stack.split(`
|
|
288
|
+
`), B = M.length - 1, k = A.length - 1; B >= 1 && k >= 0 && M[B] !== A[k]; )
|
|
289
|
+
k--;
|
|
290
|
+
for (; B >= 1 && k >= 0; B--, k--)
|
|
291
|
+
if (M[B] !== A[k]) {
|
|
292
|
+
if (B !== 1 || k !== 1)
|
|
293
|
+
do
|
|
294
|
+
if (B--, k--, k < 0 || M[B] !== A[k]) {
|
|
295
|
+
var ue = `
|
|
296
|
+
` + M[B].replace(" at new ", " at ");
|
|
297
|
+
return i.displayName && ue.includes("<anonymous>") && (ue = ue.replace("<anonymous>", i.displayName)), typeof i == "function" && Et.set(i, ue), ue;
|
|
298
|
+
}
|
|
299
|
+
while (B >= 1 && k >= 0);
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
} finally {
|
|
304
|
+
At = !1, Oe.current = j, Be(), Error.prepareStackTrace = S;
|
|
305
|
+
}
|
|
306
|
+
var he = i ? i.displayName || i.name : "", me = he ? qe(he) : "";
|
|
307
|
+
return typeof i == "function" && Et.set(i, me), me;
|
|
308
|
+
}
|
|
309
|
+
function Ye(i, h, R) {
|
|
310
|
+
return le(i, !1);
|
|
311
|
+
}
|
|
312
|
+
function ar(i) {
|
|
313
|
+
var h = i.prototype;
|
|
314
|
+
return !!(h && h.isReactComponent);
|
|
315
|
+
}
|
|
316
|
+
function Rt(i, h, R) {
|
|
317
|
+
if (i == null)
|
|
318
|
+
return "";
|
|
319
|
+
if (typeof i == "function")
|
|
320
|
+
return le(i, ar(i));
|
|
321
|
+
if (typeof i == "string")
|
|
322
|
+
return qe(i);
|
|
323
|
+
switch (i) {
|
|
324
|
+
case y:
|
|
325
|
+
return qe("Suspense");
|
|
326
|
+
case m:
|
|
327
|
+
return qe("SuspenseList");
|
|
328
|
+
}
|
|
329
|
+
if (typeof i == "object")
|
|
330
|
+
switch (i.$$typeof) {
|
|
331
|
+
case c:
|
|
332
|
+
return Ye(i.render);
|
|
333
|
+
case l:
|
|
334
|
+
return Rt(i.type, h, R);
|
|
335
|
+
case v: {
|
|
336
|
+
var w = i, S = w._payload, j = w._init;
|
|
337
|
+
try {
|
|
338
|
+
return Rt(j(S), h, R);
|
|
339
|
+
} catch {
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return "";
|
|
344
|
+
}
|
|
345
|
+
var be = Object.prototype.hasOwnProperty, ir = {}, or = _.ReactDebugCurrentFrame;
|
|
346
|
+
function st(i) {
|
|
347
|
+
if (i) {
|
|
348
|
+
var h = i._owner, R = Rt(i.type, i._source, h ? h.type : null);
|
|
349
|
+
or.setExtraStackFrame(R);
|
|
350
|
+
} else
|
|
351
|
+
or.setExtraStackFrame(null);
|
|
352
|
+
}
|
|
353
|
+
function xr(i, h, R, w, S) {
|
|
354
|
+
{
|
|
355
|
+
var j = Function.call.bind(be);
|
|
356
|
+
for (var T in i)
|
|
357
|
+
if (j(i, T)) {
|
|
358
|
+
var M = void 0;
|
|
359
|
+
try {
|
|
360
|
+
if (typeof i[T] != "function") {
|
|
361
|
+
var A = Error((w || "React class") + ": " + R + " type `" + T + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[T] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
362
|
+
throw A.name = "Invariant Violation", A;
|
|
363
|
+
}
|
|
364
|
+
M = i[T](h, T, w, R, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
365
|
+
} catch (B) {
|
|
366
|
+
M = B;
|
|
367
|
+
}
|
|
368
|
+
M && !(M instanceof Error) && (st(S), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", w || "React class", R, T, typeof M), st(null)), M instanceof Error && !(M.message in ir) && (ir[M.message] = !0, st(S), P("Failed %s type: %s", R, M.message), st(null));
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
var Pr = Array.isArray;
|
|
373
|
+
function It(i) {
|
|
374
|
+
return Pr(i);
|
|
375
|
+
}
|
|
376
|
+
function Or(i) {
|
|
377
|
+
{
|
|
378
|
+
var h = typeof Symbol == "function" && Symbol.toStringTag, R = h && i[Symbol.toStringTag] || i.constructor.name || "Object";
|
|
379
|
+
return R;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
function lt(i) {
|
|
383
|
+
try {
|
|
384
|
+
return Qe(i), !1;
|
|
385
|
+
} catch {
|
|
386
|
+
return !0;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function Qe(i) {
|
|
390
|
+
return "" + i;
|
|
391
|
+
}
|
|
392
|
+
function kt(i) {
|
|
393
|
+
if (lt(i))
|
|
394
|
+
return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Or(i)), Qe(i);
|
|
395
|
+
}
|
|
396
|
+
var Ve = _.ReactCurrentOwner, Me = {
|
|
397
|
+
key: !0,
|
|
398
|
+
ref: !0,
|
|
399
|
+
__self: !0,
|
|
400
|
+
__source: !0
|
|
401
|
+
}, Ce, Bt, Je;
|
|
402
|
+
Je = {};
|
|
403
|
+
function _r(i) {
|
|
404
|
+
if (be.call(i, "ref")) {
|
|
405
|
+
var h = Object.getOwnPropertyDescriptor(i, "ref").get;
|
|
406
|
+
if (h && h.isReactWarning)
|
|
407
|
+
return !1;
|
|
408
|
+
}
|
|
409
|
+
return i.ref !== void 0;
|
|
410
|
+
}
|
|
411
|
+
function Ne(i) {
|
|
412
|
+
if (be.call(i, "key")) {
|
|
413
|
+
var h = Object.getOwnPropertyDescriptor(i, "key").get;
|
|
414
|
+
if (h && h.isReactWarning)
|
|
415
|
+
return !1;
|
|
416
|
+
}
|
|
417
|
+
return i.key !== void 0;
|
|
418
|
+
}
|
|
419
|
+
function sr(i, h) {
|
|
420
|
+
if (typeof i.ref == "string" && Ve.current && h && Ve.current.stateNode !== h) {
|
|
421
|
+
var R = ne(Ve.current.type);
|
|
422
|
+
Je[R] || (P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', ne(Ve.current.type), i.ref), Je[R] = !0);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
function lr(i, h) {
|
|
426
|
+
{
|
|
427
|
+
var R = function() {
|
|
428
|
+
Ce || (Ce = !0, P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
|
|
429
|
+
};
|
|
430
|
+
R.isReactWarning = !0, Object.defineProperty(i, "key", {
|
|
431
|
+
get: R,
|
|
432
|
+
configurable: !0
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
function ur(i, h) {
|
|
437
|
+
{
|
|
438
|
+
var R = function() {
|
|
439
|
+
Bt || (Bt = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
|
|
440
|
+
};
|
|
441
|
+
R.isReactWarning = !0, Object.defineProperty(i, "ref", {
|
|
442
|
+
get: R,
|
|
443
|
+
configurable: !0
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
var Fr = function(i, h, R, w, S, j, T) {
|
|
448
|
+
var M = {
|
|
449
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
450
|
+
$$typeof: t,
|
|
451
|
+
// Built-in properties that belong on the element
|
|
452
|
+
type: i,
|
|
453
|
+
key: h,
|
|
454
|
+
ref: R,
|
|
455
|
+
props: T,
|
|
456
|
+
// Record the component responsible for creating this element.
|
|
457
|
+
_owner: j
|
|
458
|
+
};
|
|
459
|
+
return M._store = {}, Object.defineProperty(M._store, "validated", {
|
|
460
|
+
configurable: !1,
|
|
461
|
+
enumerable: !1,
|
|
462
|
+
writable: !0,
|
|
463
|
+
value: !1
|
|
464
|
+
}), Object.defineProperty(M, "_self", {
|
|
465
|
+
configurable: !1,
|
|
466
|
+
enumerable: !1,
|
|
467
|
+
writable: !1,
|
|
468
|
+
value: w
|
|
469
|
+
}), Object.defineProperty(M, "_source", {
|
|
470
|
+
configurable: !1,
|
|
471
|
+
enumerable: !1,
|
|
472
|
+
writable: !1,
|
|
473
|
+
value: S
|
|
474
|
+
}), Object.freeze && (Object.freeze(M.props), Object.freeze(M)), M;
|
|
475
|
+
};
|
|
476
|
+
function cr(i, h, R, w, S) {
|
|
477
|
+
{
|
|
478
|
+
var j, T = {}, M = null, A = null;
|
|
479
|
+
R !== void 0 && (kt(R), M = "" + R), Ne(h) && (kt(h.key), M = "" + h.key), _r(h) && (A = h.ref, sr(h, S));
|
|
480
|
+
for (j in h)
|
|
481
|
+
be.call(h, j) && !Me.hasOwnProperty(j) && (T[j] = h[j]);
|
|
482
|
+
if (i && i.defaultProps) {
|
|
483
|
+
var B = i.defaultProps;
|
|
484
|
+
for (j in B)
|
|
485
|
+
T[j] === void 0 && (T[j] = B[j]);
|
|
486
|
+
}
|
|
487
|
+
if (M || A) {
|
|
488
|
+
var k = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
|
489
|
+
M && lr(T, k), A && ur(T, k);
|
|
490
|
+
}
|
|
491
|
+
return Fr(i, M, A, S, w, Ve.current, T);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
var Ge = _.ReactCurrentOwner, Vt = _.ReactDebugCurrentFrame;
|
|
495
|
+
function Le(i) {
|
|
496
|
+
if (i) {
|
|
497
|
+
var h = i._owner, R = Rt(i.type, i._source, h ? h.type : null);
|
|
498
|
+
Vt.setExtraStackFrame(R);
|
|
499
|
+
} else
|
|
500
|
+
Vt.setExtraStackFrame(null);
|
|
501
|
+
}
|
|
502
|
+
var Xe;
|
|
503
|
+
Xe = !1;
|
|
504
|
+
function ut(i) {
|
|
505
|
+
return typeof i == "object" && i !== null && i.$$typeof === t;
|
|
506
|
+
}
|
|
507
|
+
function dr() {
|
|
508
|
+
{
|
|
509
|
+
if (Ge.current) {
|
|
510
|
+
var i = ne(Ge.current.type);
|
|
511
|
+
if (i)
|
|
512
|
+
return `
|
|
513
|
+
|
|
514
|
+
Check the render method of \`` + i + "`.";
|
|
515
|
+
}
|
|
516
|
+
return "";
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
function fr(i) {
|
|
520
|
+
return "";
|
|
521
|
+
}
|
|
522
|
+
var hr = {};
|
|
523
|
+
function pr(i) {
|
|
524
|
+
{
|
|
525
|
+
var h = dr();
|
|
526
|
+
if (!h) {
|
|
527
|
+
var R = typeof i == "string" ? i : i.displayName || i.name;
|
|
528
|
+
R && (h = `
|
|
529
|
+
|
|
530
|
+
Check the top-level render call using <` + R + ">.");
|
|
531
|
+
}
|
|
532
|
+
return h;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function wt(i, h) {
|
|
536
|
+
{
|
|
537
|
+
if (!i._store || i._store.validated || i.key != null)
|
|
538
|
+
return;
|
|
539
|
+
i._store.validated = !0;
|
|
540
|
+
var R = pr(h);
|
|
541
|
+
if (hr[R])
|
|
542
|
+
return;
|
|
543
|
+
hr[R] = !0;
|
|
544
|
+
var w = "";
|
|
545
|
+
i && i._owner && i._owner !== Ge.current && (w = " It was passed a child from " + ne(i._owner.type) + "."), Le(i), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', R, w), Le(null);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
function ct(i, h) {
|
|
549
|
+
{
|
|
550
|
+
if (typeof i != "object")
|
|
551
|
+
return;
|
|
552
|
+
if (It(i))
|
|
553
|
+
for (var R = 0; R < i.length; R++) {
|
|
554
|
+
var w = i[R];
|
|
555
|
+
ut(w) && wt(w, h);
|
|
556
|
+
}
|
|
557
|
+
else if (ut(i))
|
|
558
|
+
i._store && (i._store.validated = !0);
|
|
559
|
+
else if (i) {
|
|
560
|
+
var S = L(i);
|
|
561
|
+
if (typeof S == "function" && S !== i.entries)
|
|
562
|
+
for (var j = S.call(i), T; !(T = j.next()).done; )
|
|
563
|
+
ut(T.value) && wt(T.value, h);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
function Tr(i) {
|
|
568
|
+
{
|
|
569
|
+
var h = i.type;
|
|
570
|
+
if (h == null || typeof h == "string")
|
|
571
|
+
return;
|
|
572
|
+
var R;
|
|
573
|
+
if (typeof h == "function")
|
|
574
|
+
R = h.propTypes;
|
|
575
|
+
else if (typeof h == "object" && (h.$$typeof === c || // Note: Memo only checks outer props here.
|
|
576
|
+
// Inner props are checked in the reconciler.
|
|
577
|
+
h.$$typeof === l))
|
|
578
|
+
R = h.propTypes;
|
|
579
|
+
else
|
|
580
|
+
return;
|
|
581
|
+
if (R) {
|
|
582
|
+
var w = ne(h);
|
|
583
|
+
xr(R, i.props, "prop", w, i);
|
|
584
|
+
} else if (h.PropTypes !== void 0 && !Xe) {
|
|
585
|
+
Xe = !0;
|
|
586
|
+
var S = ne(h);
|
|
587
|
+
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", S || "Unknown");
|
|
588
|
+
}
|
|
589
|
+
typeof h.getDefaultProps == "function" && !h.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
function Mr(i) {
|
|
593
|
+
{
|
|
594
|
+
for (var h = Object.keys(i.props), R = 0; R < h.length; R++) {
|
|
595
|
+
var w = h[R];
|
|
596
|
+
if (w !== "children" && w !== "key") {
|
|
597
|
+
Le(i), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", w), Le(null);
|
|
598
|
+
break;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
i.ref !== null && (Le(i), P("Invalid attribute `ref` supplied to `React.Fragment`."), Le(null));
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
var s = {};
|
|
605
|
+
function d(i, h, R, w, S, j) {
|
|
606
|
+
{
|
|
607
|
+
var T = ce(i);
|
|
608
|
+
if (!T) {
|
|
609
|
+
var M = "";
|
|
610
|
+
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (M += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
611
|
+
var A = fr();
|
|
612
|
+
A ? M += A : M += dr();
|
|
613
|
+
var B;
|
|
614
|
+
i === null ? B = "null" : It(i) ? B = "array" : i !== void 0 && i.$$typeof === t ? (B = "<" + (ne(i.type) || "Unknown") + " />", M = " Did you accidentally export a JSX literal instead of a component?") : B = typeof i, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", B, M);
|
|
615
|
+
}
|
|
616
|
+
var k = cr(i, h, R, S, j);
|
|
617
|
+
if (k == null)
|
|
618
|
+
return k;
|
|
619
|
+
if (T) {
|
|
620
|
+
var ue = h.children;
|
|
621
|
+
if (ue !== void 0)
|
|
622
|
+
if (w)
|
|
623
|
+
if (It(ue)) {
|
|
624
|
+
for (var he = 0; he < ue.length; he++)
|
|
625
|
+
ct(ue[he], i);
|
|
626
|
+
Object.freeze && Object.freeze(ue);
|
|
627
|
+
} else
|
|
628
|
+
P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
629
|
+
else
|
|
630
|
+
ct(ue, i);
|
|
631
|
+
}
|
|
632
|
+
if (be.call(h, "key")) {
|
|
633
|
+
var me = ne(i), ae = Object.keys(h).filter(function(St) {
|
|
634
|
+
return St !== "key";
|
|
635
|
+
}), je = ae.length > 0 ? "{key: someKey, " + ae.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
636
|
+
if (!s[me + je]) {
|
|
637
|
+
var De = ae.length > 0 ? "{" + ae.join(": ..., ") + ": ...}" : "{}";
|
|
638
|
+
P(`A props object containing a "key" prop is being spread into JSX:
|
|
639
|
+
let props = %s;
|
|
640
|
+
<%s {...props} />
|
|
641
|
+
React keys must be passed directly to JSX without using spread:
|
|
642
|
+
let props = %s;
|
|
643
|
+
<%s key={someKey} {...props} />`, je, me, De, me), s[me + je] = !0;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return i === n ? Mr(k) : Tr(k), k;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
function p(i, h, R) {
|
|
650
|
+
return d(i, h, R, !0);
|
|
651
|
+
}
|
|
652
|
+
function g(i, h, R) {
|
|
653
|
+
return d(i, h, R, !1);
|
|
654
|
+
}
|
|
655
|
+
var x = g, N = p;
|
|
656
|
+
zt.Fragment = n, zt.jsx = x, zt.jsxs = N;
|
|
657
|
+
}()), zt;
|
|
658
|
+
}
|
|
659
|
+
process.env.NODE_ENV === "production" ? Ir.exports = wa() : Ir.exports = Sa();
|
|
660
|
+
var Ca = Ir.exports, nn = class {
|
|
661
|
+
constructor() {
|
|
662
|
+
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
663
|
+
}
|
|
664
|
+
subscribe(e) {
|
|
665
|
+
return this.listeners.add(e), this.onSubscribe(), () => {
|
|
666
|
+
this.listeners.delete(e), this.onUnsubscribe();
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
hasListeners() {
|
|
670
|
+
return this.listeners.size > 0;
|
|
671
|
+
}
|
|
672
|
+
onSubscribe() {
|
|
673
|
+
}
|
|
674
|
+
onUnsubscribe() {
|
|
675
|
+
}
|
|
676
|
+
}, Lt = typeof window > "u" || "Deno" in globalThis;
|
|
677
|
+
function kr() {
|
|
678
|
+
}
|
|
679
|
+
function vo(e, t) {
|
|
680
|
+
return typeof e == "function" ? e(t) : e;
|
|
681
|
+
}
|
|
682
|
+
function Br(e) {
|
|
683
|
+
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
684
|
+
}
|
|
685
|
+
function Hn(e, t) {
|
|
686
|
+
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
687
|
+
}
|
|
688
|
+
function yr(e, t) {
|
|
689
|
+
return typeof e == "function" ? e(t) : e;
|
|
690
|
+
}
|
|
691
|
+
function Te(e, t) {
|
|
692
|
+
return typeof e == "function" ? e(t) : e;
|
|
693
|
+
}
|
|
694
|
+
function mo(e, t) {
|
|
695
|
+
const {
|
|
696
|
+
type: r = "all",
|
|
697
|
+
exact: n,
|
|
698
|
+
fetchStatus: a,
|
|
699
|
+
predicate: u,
|
|
700
|
+
queryKey: o,
|
|
701
|
+
stale: f
|
|
702
|
+
} = e;
|
|
703
|
+
if (o) {
|
|
704
|
+
if (n) {
|
|
705
|
+
if (t.queryHash !== Da(o, t.options))
|
|
706
|
+
return !1;
|
|
707
|
+
} else if (!an(t.queryKey, o))
|
|
708
|
+
return !1;
|
|
709
|
+
}
|
|
710
|
+
if (r !== "all") {
|
|
711
|
+
const c = t.isActive();
|
|
712
|
+
if (r === "active" && !c || r === "inactive" && c)
|
|
713
|
+
return !1;
|
|
714
|
+
}
|
|
715
|
+
return !(typeof f == "boolean" && t.isStale() !== f || a && a !== t.state.fetchStatus || u && !u(t));
|
|
716
|
+
}
|
|
717
|
+
function yo(e, t) {
|
|
718
|
+
const { exact: r, status: n, predicate: a, mutationKey: u } = e;
|
|
719
|
+
if (u) {
|
|
720
|
+
if (!t.options.mutationKey)
|
|
721
|
+
return !1;
|
|
722
|
+
if (r) {
|
|
723
|
+
if (Vr(t.options.mutationKey) !== Vr(u))
|
|
724
|
+
return !1;
|
|
725
|
+
} else if (!an(t.options.mutationKey, u))
|
|
726
|
+
return !1;
|
|
727
|
+
}
|
|
728
|
+
return !(n && t.state.status !== n || a && !a(t));
|
|
729
|
+
}
|
|
730
|
+
function Da(e, t) {
|
|
731
|
+
return ((t == null ? void 0 : t.queryKeyHashFn) || Vr)(e);
|
|
732
|
+
}
|
|
733
|
+
function Vr(e) {
|
|
734
|
+
return JSON.stringify(
|
|
735
|
+
e,
|
|
736
|
+
(t, r) => zr(r) ? Object.keys(r).sort().reduce((n, a) => (n[a] = r[a], n), {}) : r
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
function an(e, t) {
|
|
740
|
+
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((r) => !an(e[r], t[r])) : !1;
|
|
741
|
+
}
|
|
742
|
+
function Kn(e, t) {
|
|
743
|
+
if (e === t)
|
|
744
|
+
return e;
|
|
745
|
+
const r = gn(e) && gn(t);
|
|
746
|
+
if (r || zr(e) && zr(t)) {
|
|
747
|
+
const n = r ? e : Object.keys(e), a = n.length, u = r ? t : Object.keys(t), o = u.length, f = r ? [] : {};
|
|
748
|
+
let c = 0;
|
|
749
|
+
for (let y = 0; y < o; y++) {
|
|
750
|
+
const m = r ? y : u[y];
|
|
751
|
+
(!r && n.includes(m) || r) && e[m] === void 0 && t[m] === void 0 ? (f[m] = void 0, c++) : (f[m] = Kn(e[m], t[m]), f[m] === e[m] && e[m] !== void 0 && c++);
|
|
752
|
+
}
|
|
753
|
+
return a === o && c === a ? e : f;
|
|
754
|
+
}
|
|
755
|
+
return t;
|
|
756
|
+
}
|
|
757
|
+
function Wr(e, t) {
|
|
758
|
+
if (!t || Object.keys(e).length !== Object.keys(t).length)
|
|
759
|
+
return !1;
|
|
760
|
+
for (const r in e)
|
|
761
|
+
if (e[r] !== t[r])
|
|
762
|
+
return !1;
|
|
763
|
+
return !0;
|
|
764
|
+
}
|
|
765
|
+
function gn(e) {
|
|
766
|
+
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
767
|
+
}
|
|
768
|
+
function zr(e) {
|
|
769
|
+
if (!bn(e))
|
|
770
|
+
return !1;
|
|
771
|
+
const t = e.constructor;
|
|
772
|
+
if (t === void 0)
|
|
773
|
+
return !0;
|
|
774
|
+
const r = t.prototype;
|
|
775
|
+
return !(!bn(r) || !r.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
776
|
+
}
|
|
777
|
+
function bn(e) {
|
|
778
|
+
return Object.prototype.toString.call(e) === "[object Object]";
|
|
779
|
+
}
|
|
780
|
+
function xa(e) {
|
|
781
|
+
return new Promise((t) => {
|
|
782
|
+
setTimeout(t, e);
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
function $r(e, t, r) {
|
|
786
|
+
return typeof r.structuralSharing == "function" ? r.structuralSharing(e, t) : r.structuralSharing !== !1 ? Kn(e, t) : t;
|
|
787
|
+
}
|
|
788
|
+
function go(e, t, r = 0) {
|
|
789
|
+
const n = [...e, t];
|
|
790
|
+
return r && n.length > r ? n.slice(1) : n;
|
|
791
|
+
}
|
|
792
|
+
function bo(e, t, r = 0) {
|
|
793
|
+
const n = [t, ...e];
|
|
794
|
+
return r && n.length > r ? n.slice(0, -1) : n;
|
|
795
|
+
}
|
|
796
|
+
var Hr = Symbol(), Pa = (e, t) => (process.env.NODE_ENV !== "production" && e.queryFn === Hr && console.error(
|
|
797
|
+
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
|
|
798
|
+
), !e.queryFn && (t != null && t.initialPromise) ? () => t.initialPromise : !e.queryFn || e.queryFn === Hr ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn), pt, et, Dt, kn, Oa = (kn = class extends nn {
|
|
799
|
+
constructor() {
|
|
800
|
+
super();
|
|
801
|
+
H(this, pt);
|
|
802
|
+
H(this, et);
|
|
803
|
+
H(this, Dt);
|
|
804
|
+
I(this, Dt, (t) => {
|
|
805
|
+
if (!Lt && window.addEventListener) {
|
|
806
|
+
const r = () => t();
|
|
807
|
+
return window.addEventListener("visibilitychange", r, !1), () => {
|
|
808
|
+
window.removeEventListener("visibilitychange", r);
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
onSubscribe() {
|
|
814
|
+
E(this, et) || this.setEventListener(E(this, Dt));
|
|
815
|
+
}
|
|
816
|
+
onUnsubscribe() {
|
|
817
|
+
var t;
|
|
818
|
+
this.hasListeners() || ((t = E(this, et)) == null || t.call(this), I(this, et, void 0));
|
|
819
|
+
}
|
|
820
|
+
setEventListener(t) {
|
|
821
|
+
var r;
|
|
822
|
+
I(this, Dt, t), (r = E(this, et)) == null || r.call(this), I(this, et, t((n) => {
|
|
823
|
+
typeof n == "boolean" ? this.setFocused(n) : this.onFocus();
|
|
824
|
+
}));
|
|
825
|
+
}
|
|
826
|
+
setFocused(t) {
|
|
827
|
+
E(this, pt) !== t && (I(this, pt, t), this.onFocus());
|
|
828
|
+
}
|
|
829
|
+
onFocus() {
|
|
830
|
+
const t = this.isFocused();
|
|
831
|
+
this.listeners.forEach((r) => {
|
|
832
|
+
r(t);
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
isFocused() {
|
|
836
|
+
var t;
|
|
837
|
+
return typeof E(this, pt) == "boolean" ? E(this, pt) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
|
|
838
|
+
}
|
|
839
|
+
}, pt = new WeakMap(), et = new WeakMap(), Dt = new WeakMap(), kn), qn = new Oa(), xt, tt, Pt, Bn, _a = (Bn = class extends nn {
|
|
840
|
+
constructor() {
|
|
841
|
+
super();
|
|
842
|
+
H(this, xt, !0);
|
|
843
|
+
H(this, tt);
|
|
844
|
+
H(this, Pt);
|
|
845
|
+
I(this, Pt, (t) => {
|
|
846
|
+
if (!Lt && window.addEventListener) {
|
|
847
|
+
const r = () => t(!0), n = () => t(!1);
|
|
848
|
+
return window.addEventListener("online", r, !1), window.addEventListener("offline", n, !1), () => {
|
|
849
|
+
window.removeEventListener("online", r), window.removeEventListener("offline", n);
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
onSubscribe() {
|
|
855
|
+
E(this, tt) || this.setEventListener(E(this, Pt));
|
|
856
|
+
}
|
|
857
|
+
onUnsubscribe() {
|
|
858
|
+
var t;
|
|
859
|
+
this.hasListeners() || ((t = E(this, tt)) == null || t.call(this), I(this, tt, void 0));
|
|
860
|
+
}
|
|
861
|
+
setEventListener(t) {
|
|
862
|
+
var r;
|
|
863
|
+
I(this, Pt, t), (r = E(this, tt)) == null || r.call(this), I(this, tt, t(this.setOnline.bind(this)));
|
|
864
|
+
}
|
|
865
|
+
setOnline(t) {
|
|
866
|
+
E(this, xt) !== t && (I(this, xt, t), this.listeners.forEach((n) => {
|
|
867
|
+
n(t);
|
|
868
|
+
}));
|
|
869
|
+
}
|
|
870
|
+
isOnline() {
|
|
871
|
+
return E(this, xt);
|
|
872
|
+
}
|
|
873
|
+
}, xt = new WeakMap(), tt = new WeakMap(), Pt = new WeakMap(), Bn), Yn = new _a();
|
|
874
|
+
function Fa(e) {
|
|
875
|
+
return Math.min(1e3 * 2 ** e, 3e4);
|
|
876
|
+
}
|
|
877
|
+
function Qn(e) {
|
|
878
|
+
return (e ?? "online") === "online" ? Yn.isOnline() : !0;
|
|
879
|
+
}
|
|
880
|
+
var Jn = class {
|
|
881
|
+
constructor(e) {
|
|
882
|
+
this.revert = e == null ? void 0 : e.revert, this.silent = e == null ? void 0 : e.silent;
|
|
883
|
+
}
|
|
884
|
+
};
|
|
885
|
+
function Lr(e) {
|
|
886
|
+
return e instanceof Jn;
|
|
887
|
+
}
|
|
888
|
+
function Ta(e) {
|
|
889
|
+
let t = !1, r = 0, n = !1, a, u, o;
|
|
890
|
+
const f = new Promise((_, P) => {
|
|
891
|
+
u = _, o = P;
|
|
892
|
+
}), c = (_) => {
|
|
893
|
+
var P;
|
|
894
|
+
n || (F(new Jn(_)), (P = e.abort) == null || P.call(e));
|
|
895
|
+
}, y = () => {
|
|
896
|
+
t = !0;
|
|
897
|
+
}, m = () => {
|
|
898
|
+
t = !1;
|
|
899
|
+
}, l = () => qn.isFocused() && (e.networkMode === "always" || Yn.isOnline()) && e.canRun(), v = () => Qn(e.networkMode) && e.canRun(), O = (_) => {
|
|
900
|
+
var P;
|
|
901
|
+
n || (n = !0, (P = e.onSuccess) == null || P.call(e, _), a == null || a(), u(_));
|
|
902
|
+
}, F = (_) => {
|
|
903
|
+
var P;
|
|
904
|
+
n || (n = !0, (P = e.onError) == null || P.call(e, _), a == null || a(), o(_));
|
|
905
|
+
}, C = () => new Promise((_) => {
|
|
906
|
+
var P;
|
|
907
|
+
a = ($) => {
|
|
908
|
+
(n || l()) && _($);
|
|
909
|
+
}, (P = e.onPause) == null || P.call(e);
|
|
910
|
+
}).then(() => {
|
|
911
|
+
var _;
|
|
912
|
+
a = void 0, n || (_ = e.onContinue) == null || _.call(e);
|
|
913
|
+
}), L = () => {
|
|
914
|
+
if (n)
|
|
915
|
+
return;
|
|
916
|
+
let _;
|
|
917
|
+
const P = r === 0 ? e.initialPromise : void 0;
|
|
918
|
+
try {
|
|
919
|
+
_ = P ?? e.fn();
|
|
920
|
+
} catch ($) {
|
|
921
|
+
_ = Promise.reject($);
|
|
922
|
+
}
|
|
923
|
+
Promise.resolve(_).then(O).catch(($) => {
|
|
924
|
+
var q;
|
|
925
|
+
if (n)
|
|
926
|
+
return;
|
|
927
|
+
const G = e.retry ?? (Lt ? 0 : 3), re = e.retryDelay ?? Fa, b = typeof re == "function" ? re(r, $) : re, oe = G === !0 || typeof G == "number" && r < G || typeof G == "function" && G(r, $);
|
|
928
|
+
if (t || !oe) {
|
|
929
|
+
F($);
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
r++, (q = e.onFail) == null || q.call(e, r, $), xa(b).then(() => l() ? void 0 : C()).then(() => {
|
|
933
|
+
t ? F($) : L();
|
|
934
|
+
});
|
|
935
|
+
});
|
|
936
|
+
};
|
|
937
|
+
return {
|
|
938
|
+
promise: f,
|
|
939
|
+
cancel: c,
|
|
940
|
+
continue: () => (a == null || a(), f),
|
|
941
|
+
cancelRetry: y,
|
|
942
|
+
continueRetry: m,
|
|
943
|
+
canStart: v,
|
|
944
|
+
start: () => (v() ? L() : C().then(L), f)
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
function Ma() {
|
|
948
|
+
let e = [], t = 0, r = (v) => {
|
|
949
|
+
v();
|
|
950
|
+
}, n = (v) => {
|
|
951
|
+
v();
|
|
952
|
+
}, a = (v) => setTimeout(v, 0);
|
|
953
|
+
const u = (v) => {
|
|
954
|
+
a = v;
|
|
955
|
+
}, o = (v) => {
|
|
956
|
+
let O;
|
|
957
|
+
t++;
|
|
958
|
+
try {
|
|
959
|
+
O = v();
|
|
960
|
+
} finally {
|
|
961
|
+
t--, t || y();
|
|
962
|
+
}
|
|
963
|
+
return O;
|
|
964
|
+
}, f = (v) => {
|
|
965
|
+
t ? e.push(v) : a(() => {
|
|
966
|
+
r(v);
|
|
967
|
+
});
|
|
968
|
+
}, c = (v) => (...O) => {
|
|
969
|
+
f(() => {
|
|
970
|
+
v(...O);
|
|
971
|
+
});
|
|
972
|
+
}, y = () => {
|
|
973
|
+
const v = e;
|
|
974
|
+
e = [], v.length && a(() => {
|
|
975
|
+
n(() => {
|
|
976
|
+
v.forEach((O) => {
|
|
977
|
+
r(O);
|
|
978
|
+
});
|
|
979
|
+
});
|
|
980
|
+
});
|
|
981
|
+
};
|
|
982
|
+
return {
|
|
983
|
+
batch: o,
|
|
984
|
+
batchCalls: c,
|
|
985
|
+
schedule: f,
|
|
986
|
+
setNotifyFunction: (v) => {
|
|
987
|
+
r = v;
|
|
988
|
+
},
|
|
989
|
+
setBatchNotifyFunction: (v) => {
|
|
990
|
+
n = v;
|
|
991
|
+
},
|
|
992
|
+
setScheduler: u
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
var on = Ma(), vt, Vn, Na = (Vn = class {
|
|
996
|
+
constructor() {
|
|
997
|
+
H(this, vt);
|
|
998
|
+
}
|
|
999
|
+
destroy() {
|
|
1000
|
+
this.clearGcTimeout();
|
|
1001
|
+
}
|
|
1002
|
+
scheduleGc() {
|
|
1003
|
+
this.clearGcTimeout(), Br(this.gcTime) && I(this, vt, setTimeout(() => {
|
|
1004
|
+
this.optionalRemove();
|
|
1005
|
+
}, this.gcTime));
|
|
1006
|
+
}
|
|
1007
|
+
updateGcTime(e) {
|
|
1008
|
+
this.gcTime = Math.max(
|
|
1009
|
+
this.gcTime || 0,
|
|
1010
|
+
e ?? (Lt ? 1 / 0 : 5 * 60 * 1e3)
|
|
1011
|
+
);
|
|
1012
|
+
}
|
|
1013
|
+
clearGcTimeout() {
|
|
1014
|
+
E(this, vt) && (clearTimeout(E(this, vt)), I(this, vt, void 0));
|
|
1015
|
+
}
|
|
1016
|
+
}, vt = new WeakMap(), Vn), Ot, _t, xe, de, Xt, mt, _e, ze, Wn, Eo = (Wn = class extends Na {
|
|
1017
|
+
constructor(t) {
|
|
1018
|
+
super();
|
|
1019
|
+
H(this, _e);
|
|
1020
|
+
H(this, Ot);
|
|
1021
|
+
H(this, _t);
|
|
1022
|
+
H(this, xe);
|
|
1023
|
+
H(this, de);
|
|
1024
|
+
H(this, Xt);
|
|
1025
|
+
H(this, mt);
|
|
1026
|
+
I(this, mt, !1), I(this, Xt, t.defaultOptions), this.setOptions(t.options), this.observers = [], I(this, xe, t.cache), this.queryKey = t.queryKey, this.queryHash = t.queryHash, I(this, Ot, t.state || La(this.options)), this.state = E(this, Ot), this.scheduleGc();
|
|
1027
|
+
}
|
|
1028
|
+
get meta() {
|
|
1029
|
+
return this.options.meta;
|
|
1030
|
+
}
|
|
1031
|
+
get promise() {
|
|
1032
|
+
var t;
|
|
1033
|
+
return (t = E(this, de)) == null ? void 0 : t.promise;
|
|
1034
|
+
}
|
|
1035
|
+
setOptions(t) {
|
|
1036
|
+
this.options = { ...E(this, Xt), ...t }, this.updateGcTime(this.options.gcTime);
|
|
1037
|
+
}
|
|
1038
|
+
optionalRemove() {
|
|
1039
|
+
!this.observers.length && this.state.fetchStatus === "idle" && E(this, xe).remove(this);
|
|
1040
|
+
}
|
|
1041
|
+
setData(t, r) {
|
|
1042
|
+
const n = $r(this.state.data, t, this.options);
|
|
1043
|
+
return Y(this, _e, ze).call(this, {
|
|
1044
|
+
data: n,
|
|
1045
|
+
type: "success",
|
|
1046
|
+
dataUpdatedAt: r == null ? void 0 : r.updatedAt,
|
|
1047
|
+
manual: r == null ? void 0 : r.manual
|
|
1048
|
+
}), n;
|
|
1049
|
+
}
|
|
1050
|
+
setState(t, r) {
|
|
1051
|
+
Y(this, _e, ze).call(this, { type: "setState", state: t, setStateOptions: r });
|
|
1052
|
+
}
|
|
1053
|
+
cancel(t) {
|
|
1054
|
+
var n, a;
|
|
1055
|
+
const r = (n = E(this, de)) == null ? void 0 : n.promise;
|
|
1056
|
+
return (a = E(this, de)) == null || a.cancel(t), r ? r.then(kr).catch(kr) : Promise.resolve();
|
|
1057
|
+
}
|
|
1058
|
+
destroy() {
|
|
1059
|
+
super.destroy(), this.cancel({ silent: !0 });
|
|
1060
|
+
}
|
|
1061
|
+
reset() {
|
|
1062
|
+
this.destroy(), this.setState(E(this, Ot));
|
|
1063
|
+
}
|
|
1064
|
+
isActive() {
|
|
1065
|
+
return this.observers.some(
|
|
1066
|
+
(t) => Te(t.options.enabled, this) !== !1
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
isDisabled() {
|
|
1070
|
+
return this.getObserversCount() > 0 && !this.isActive();
|
|
1071
|
+
}
|
|
1072
|
+
isStale() {
|
|
1073
|
+
return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
|
|
1074
|
+
(t) => t.getCurrentResult().isStale
|
|
1075
|
+
) : this.state.data === void 0;
|
|
1076
|
+
}
|
|
1077
|
+
isStaleByTime(t = 0) {
|
|
1078
|
+
return this.state.isInvalidated || this.state.data === void 0 || !Hn(this.state.dataUpdatedAt, t);
|
|
1079
|
+
}
|
|
1080
|
+
onFocus() {
|
|
1081
|
+
var r;
|
|
1082
|
+
const t = this.observers.find((n) => n.shouldFetchOnWindowFocus());
|
|
1083
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (r = E(this, de)) == null || r.continue();
|
|
1084
|
+
}
|
|
1085
|
+
onOnline() {
|
|
1086
|
+
var r;
|
|
1087
|
+
const t = this.observers.find((n) => n.shouldFetchOnReconnect());
|
|
1088
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (r = E(this, de)) == null || r.continue();
|
|
1089
|
+
}
|
|
1090
|
+
addObserver(t) {
|
|
1091
|
+
this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), E(this, xe).notify({ type: "observerAdded", query: this, observer: t }));
|
|
1092
|
+
}
|
|
1093
|
+
removeObserver(t) {
|
|
1094
|
+
this.observers.includes(t) && (this.observers = this.observers.filter((r) => r !== t), this.observers.length || (E(this, de) && (E(this, mt) ? E(this, de).cancel({ revert: !0 }) : E(this, de).cancelRetry()), this.scheduleGc()), E(this, xe).notify({ type: "observerRemoved", query: this, observer: t }));
|
|
1095
|
+
}
|
|
1096
|
+
getObserversCount() {
|
|
1097
|
+
return this.observers.length;
|
|
1098
|
+
}
|
|
1099
|
+
invalidate() {
|
|
1100
|
+
this.state.isInvalidated || Y(this, _e, ze).call(this, { type: "invalidate" });
|
|
1101
|
+
}
|
|
1102
|
+
fetch(t, r) {
|
|
1103
|
+
var c, y, m;
|
|
1104
|
+
if (this.state.fetchStatus !== "idle") {
|
|
1105
|
+
if (this.state.data !== void 0 && (r != null && r.cancelRefetch))
|
|
1106
|
+
this.cancel({ silent: !0 });
|
|
1107
|
+
else if (E(this, de))
|
|
1108
|
+
return E(this, de).continueRetry(), E(this, de).promise;
|
|
1109
|
+
}
|
|
1110
|
+
if (t && this.setOptions(t), !this.options.queryFn) {
|
|
1111
|
+
const l = this.observers.find((v) => v.options.queryFn);
|
|
1112
|
+
l && this.setOptions(l.options);
|
|
1113
|
+
}
|
|
1114
|
+
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
1115
|
+
"As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
|
|
1116
|
+
));
|
|
1117
|
+
const n = new AbortController(), a = (l) => {
|
|
1118
|
+
Object.defineProperty(l, "signal", {
|
|
1119
|
+
enumerable: !0,
|
|
1120
|
+
get: () => (I(this, mt, !0), n.signal)
|
|
1121
|
+
});
|
|
1122
|
+
}, u = () => {
|
|
1123
|
+
const l = Pa(this.options, r), v = {
|
|
1124
|
+
queryKey: this.queryKey,
|
|
1125
|
+
meta: this.meta
|
|
1126
|
+
};
|
|
1127
|
+
return a(v), I(this, mt, !1), this.options.persister ? this.options.persister(
|
|
1128
|
+
l,
|
|
1129
|
+
v,
|
|
1130
|
+
this
|
|
1131
|
+
) : l(v);
|
|
1132
|
+
}, o = {
|
|
1133
|
+
fetchOptions: r,
|
|
1134
|
+
options: this.options,
|
|
1135
|
+
queryKey: this.queryKey,
|
|
1136
|
+
state: this.state,
|
|
1137
|
+
fetchFn: u
|
|
1138
|
+
};
|
|
1139
|
+
a(o), (c = this.options.behavior) == null || c.onFetch(
|
|
1140
|
+
o,
|
|
1141
|
+
this
|
|
1142
|
+
), I(this, _t, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((y = o.fetchOptions) == null ? void 0 : y.meta)) && Y(this, _e, ze).call(this, { type: "fetch", meta: (m = o.fetchOptions) == null ? void 0 : m.meta });
|
|
1143
|
+
const f = (l) => {
|
|
1144
|
+
var v, O, F, C;
|
|
1145
|
+
Lr(l) && l.silent || Y(this, _e, ze).call(this, {
|
|
1146
|
+
type: "error",
|
|
1147
|
+
error: l
|
|
1148
|
+
}), Lr(l) || ((O = (v = E(this, xe).config).onError) == null || O.call(
|
|
1149
|
+
v,
|
|
1150
|
+
l,
|
|
1151
|
+
this
|
|
1152
|
+
), (C = (F = E(this, xe).config).onSettled) == null || C.call(
|
|
1153
|
+
F,
|
|
1154
|
+
this.state.data,
|
|
1155
|
+
l,
|
|
1156
|
+
this
|
|
1157
|
+
)), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
1158
|
+
};
|
|
1159
|
+
return I(this, de, Ta({
|
|
1160
|
+
initialPromise: r == null ? void 0 : r.initialPromise,
|
|
1161
|
+
fn: o.fetchFn,
|
|
1162
|
+
abort: n.abort.bind(n),
|
|
1163
|
+
onSuccess: (l) => {
|
|
1164
|
+
var v, O, F, C;
|
|
1165
|
+
if (l === void 0) {
|
|
1166
|
+
process.env.NODE_ENV !== "production" && console.error(
|
|
1167
|
+
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
1168
|
+
), f(new Error(`${this.queryHash} data is undefined`));
|
|
1169
|
+
return;
|
|
1170
|
+
}
|
|
1171
|
+
this.setData(l), (O = (v = E(this, xe).config).onSuccess) == null || O.call(v, l, this), (C = (F = E(this, xe).config).onSettled) == null || C.call(
|
|
1172
|
+
F,
|
|
1173
|
+
l,
|
|
1174
|
+
this.state.error,
|
|
1175
|
+
this
|
|
1176
|
+
), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
1177
|
+
},
|
|
1178
|
+
onError: f,
|
|
1179
|
+
onFail: (l, v) => {
|
|
1180
|
+
Y(this, _e, ze).call(this, { type: "failed", failureCount: l, error: v });
|
|
1181
|
+
},
|
|
1182
|
+
onPause: () => {
|
|
1183
|
+
Y(this, _e, ze).call(this, { type: "pause" });
|
|
1184
|
+
},
|
|
1185
|
+
onContinue: () => {
|
|
1186
|
+
Y(this, _e, ze).call(this, { type: "continue" });
|
|
1187
|
+
},
|
|
1188
|
+
retry: o.options.retry,
|
|
1189
|
+
retryDelay: o.options.retryDelay,
|
|
1190
|
+
networkMode: o.options.networkMode,
|
|
1191
|
+
canRun: () => !0
|
|
1192
|
+
})), E(this, de).start();
|
|
1193
|
+
}
|
|
1194
|
+
}, Ot = new WeakMap(), _t = new WeakMap(), xe = new WeakMap(), de = new WeakMap(), Xt = new WeakMap(), mt = new WeakMap(), _e = new WeakSet(), ze = function(t) {
|
|
1195
|
+
const r = (n) => {
|
|
1196
|
+
switch (t.type) {
|
|
1197
|
+
case "failed":
|
|
1198
|
+
return {
|
|
1199
|
+
...n,
|
|
1200
|
+
fetchFailureCount: t.failureCount,
|
|
1201
|
+
fetchFailureReason: t.error
|
|
1202
|
+
};
|
|
1203
|
+
case "pause":
|
|
1204
|
+
return {
|
|
1205
|
+
...n,
|
|
1206
|
+
fetchStatus: "paused"
|
|
1207
|
+
};
|
|
1208
|
+
case "continue":
|
|
1209
|
+
return {
|
|
1210
|
+
...n,
|
|
1211
|
+
fetchStatus: "fetching"
|
|
1212
|
+
};
|
|
1213
|
+
case "fetch":
|
|
1214
|
+
return {
|
|
1215
|
+
...n,
|
|
1216
|
+
...Gn(n.data, this.options),
|
|
1217
|
+
fetchMeta: t.meta ?? null
|
|
1218
|
+
};
|
|
1219
|
+
case "success":
|
|
1220
|
+
return {
|
|
1221
|
+
...n,
|
|
1222
|
+
data: t.data,
|
|
1223
|
+
dataUpdateCount: n.dataUpdateCount + 1,
|
|
1224
|
+
dataUpdatedAt: t.dataUpdatedAt ?? Date.now(),
|
|
1225
|
+
error: null,
|
|
1226
|
+
isInvalidated: !1,
|
|
1227
|
+
status: "success",
|
|
1228
|
+
...!t.manual && {
|
|
1229
|
+
fetchStatus: "idle",
|
|
1230
|
+
fetchFailureCount: 0,
|
|
1231
|
+
fetchFailureReason: null
|
|
1232
|
+
}
|
|
1233
|
+
};
|
|
1234
|
+
case "error":
|
|
1235
|
+
const a = t.error;
|
|
1236
|
+
return Lr(a) && a.revert && E(this, _t) ? { ...E(this, _t), fetchStatus: "idle" } : {
|
|
1237
|
+
...n,
|
|
1238
|
+
error: a,
|
|
1239
|
+
errorUpdateCount: n.errorUpdateCount + 1,
|
|
1240
|
+
errorUpdatedAt: Date.now(),
|
|
1241
|
+
fetchFailureCount: n.fetchFailureCount + 1,
|
|
1242
|
+
fetchFailureReason: a,
|
|
1243
|
+
fetchStatus: "idle",
|
|
1244
|
+
status: "error"
|
|
1245
|
+
};
|
|
1246
|
+
case "invalidate":
|
|
1247
|
+
return {
|
|
1248
|
+
...n,
|
|
1249
|
+
isInvalidated: !0
|
|
1250
|
+
};
|
|
1251
|
+
case "setState":
|
|
1252
|
+
return {
|
|
1253
|
+
...n,
|
|
1254
|
+
...t.state
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
};
|
|
1258
|
+
this.state = r(this.state), on.batch(() => {
|
|
1259
|
+
this.observers.forEach((n) => {
|
|
1260
|
+
n.onQueryUpdate();
|
|
1261
|
+
}), E(this, xe).notify({ query: this, type: "updated", action: t });
|
|
1262
|
+
});
|
|
1263
|
+
}, Wn);
|
|
1264
|
+
function Gn(e, t) {
|
|
1265
|
+
return {
|
|
1266
|
+
fetchFailureCount: 0,
|
|
1267
|
+
fetchFailureReason: null,
|
|
1268
|
+
fetchStatus: Qn(t.networkMode) ? "fetching" : "paused",
|
|
1269
|
+
...e === void 0 && {
|
|
1270
|
+
error: null,
|
|
1271
|
+
status: "pending"
|
|
1272
|
+
}
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
function La(e) {
|
|
1276
|
+
const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, r = t !== void 0, n = r ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
1277
|
+
return {
|
|
1278
|
+
data: t,
|
|
1279
|
+
dataUpdateCount: 0,
|
|
1280
|
+
dataUpdatedAt: r ? n ?? Date.now() : 0,
|
|
1281
|
+
error: null,
|
|
1282
|
+
errorUpdateCount: 0,
|
|
1283
|
+
errorUpdatedAt: 0,
|
|
1284
|
+
fetchFailureCount: 0,
|
|
1285
|
+
fetchFailureReason: null,
|
|
1286
|
+
fetchMeta: null,
|
|
1287
|
+
isInvalidated: !1,
|
|
1288
|
+
status: r ? "success" : "pending",
|
|
1289
|
+
fetchStatus: "idle"
|
|
1290
|
+
};
|
|
1291
|
+
}
|
|
1292
|
+
var ye, z, Zt, pe, yt, Ft, Ue, er, Tt, Mt, gt, bt, rt, Nt, K, Kt, Kr, qr, Yr, Qr, Jr, Gr, Xr, Xn, zn, ja = (zn = class extends nn {
|
|
1293
|
+
constructor(t, r) {
|
|
1294
|
+
super();
|
|
1295
|
+
H(this, K);
|
|
1296
|
+
H(this, ye);
|
|
1297
|
+
H(this, z);
|
|
1298
|
+
H(this, Zt);
|
|
1299
|
+
H(this, pe);
|
|
1300
|
+
H(this, yt);
|
|
1301
|
+
H(this, Ft);
|
|
1302
|
+
H(this, Ue);
|
|
1303
|
+
H(this, er);
|
|
1304
|
+
H(this, Tt);
|
|
1305
|
+
// This property keeps track of the last query with defined data.
|
|
1306
|
+
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
1307
|
+
H(this, Mt);
|
|
1308
|
+
H(this, gt);
|
|
1309
|
+
H(this, bt);
|
|
1310
|
+
H(this, rt);
|
|
1311
|
+
H(this, Nt, /* @__PURE__ */ new Set());
|
|
1312
|
+
this.options = r, I(this, ye, t), I(this, Ue, null), this.bindMethods(), this.setOptions(r);
|
|
1313
|
+
}
|
|
1314
|
+
bindMethods() {
|
|
1315
|
+
this.refetch = this.refetch.bind(this);
|
|
1316
|
+
}
|
|
1317
|
+
onSubscribe() {
|
|
1318
|
+
this.listeners.size === 1 && (E(this, z).addObserver(this), En(E(this, z), this.options) ? Y(this, K, Kt).call(this) : this.updateResult(), Y(this, K, Qr).call(this));
|
|
1319
|
+
}
|
|
1320
|
+
onUnsubscribe() {
|
|
1321
|
+
this.hasListeners() || this.destroy();
|
|
1322
|
+
}
|
|
1323
|
+
shouldFetchOnReconnect() {
|
|
1324
|
+
return Zr(
|
|
1325
|
+
E(this, z),
|
|
1326
|
+
this.options,
|
|
1327
|
+
this.options.refetchOnReconnect
|
|
1328
|
+
);
|
|
1329
|
+
}
|
|
1330
|
+
shouldFetchOnWindowFocus() {
|
|
1331
|
+
return Zr(
|
|
1332
|
+
E(this, z),
|
|
1333
|
+
this.options,
|
|
1334
|
+
this.options.refetchOnWindowFocus
|
|
1335
|
+
);
|
|
1336
|
+
}
|
|
1337
|
+
destroy() {
|
|
1338
|
+
this.listeners = /* @__PURE__ */ new Set(), Y(this, K, Jr).call(this), Y(this, K, Gr).call(this), E(this, z).removeObserver(this);
|
|
1339
|
+
}
|
|
1340
|
+
setOptions(t, r) {
|
|
1341
|
+
const n = this.options, a = E(this, z);
|
|
1342
|
+
if (this.options = E(this, ye).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof Te(this.options.enabled, E(this, z)) != "boolean")
|
|
1343
|
+
throw new Error(
|
|
1344
|
+
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
1345
|
+
);
|
|
1346
|
+
Y(this, K, Xr).call(this), E(this, z).setOptions(this.options), n._defaulted && !Wr(this.options, n) && E(this, ye).getQueryCache().notify({
|
|
1347
|
+
type: "observerOptionsUpdated",
|
|
1348
|
+
query: E(this, z),
|
|
1349
|
+
observer: this
|
|
1350
|
+
});
|
|
1351
|
+
const u = this.hasListeners();
|
|
1352
|
+
u && Rn(
|
|
1353
|
+
E(this, z),
|
|
1354
|
+
a,
|
|
1355
|
+
this.options,
|
|
1356
|
+
n
|
|
1357
|
+
) && Y(this, K, Kt).call(this), this.updateResult(r), u && (E(this, z) !== a || Te(this.options.enabled, E(this, z)) !== Te(n.enabled, E(this, z)) || yr(this.options.staleTime, E(this, z)) !== yr(n.staleTime, E(this, z))) && Y(this, K, Kr).call(this);
|
|
1358
|
+
const o = Y(this, K, qr).call(this);
|
|
1359
|
+
u && (E(this, z) !== a || Te(this.options.enabled, E(this, z)) !== Te(n.enabled, E(this, z)) || o !== E(this, rt)) && Y(this, K, Yr).call(this, o);
|
|
1360
|
+
}
|
|
1361
|
+
getOptimisticResult(t) {
|
|
1362
|
+
const r = E(this, ye).getQueryCache().build(E(this, ye), t), n = this.createResult(r, t);
|
|
1363
|
+
return Aa(this, n) && (I(this, pe, n), I(this, Ft, this.options), I(this, yt, E(this, z).state)), n;
|
|
1364
|
+
}
|
|
1365
|
+
getCurrentResult() {
|
|
1366
|
+
return E(this, pe);
|
|
1367
|
+
}
|
|
1368
|
+
trackResult(t, r) {
|
|
1369
|
+
const n = {};
|
|
1370
|
+
return Object.keys(t).forEach((a) => {
|
|
1371
|
+
Object.defineProperty(n, a, {
|
|
1372
|
+
configurable: !1,
|
|
1373
|
+
enumerable: !0,
|
|
1374
|
+
get: () => (this.trackProp(a), r == null || r(a), t[a])
|
|
1375
|
+
});
|
|
1376
|
+
}), n;
|
|
1377
|
+
}
|
|
1378
|
+
trackProp(t) {
|
|
1379
|
+
E(this, Nt).add(t);
|
|
1380
|
+
}
|
|
1381
|
+
getCurrentQuery() {
|
|
1382
|
+
return E(this, z);
|
|
1383
|
+
}
|
|
1384
|
+
refetch({ ...t } = {}) {
|
|
1385
|
+
return this.fetch({
|
|
1386
|
+
...t
|
|
1387
|
+
});
|
|
1388
|
+
}
|
|
1389
|
+
fetchOptimistic(t) {
|
|
1390
|
+
const r = E(this, ye).defaultQueryOptions(t), n = E(this, ye).getQueryCache().build(E(this, ye), r);
|
|
1391
|
+
return n.isFetchingOptimistic = !0, n.fetch().then(() => this.createResult(n, r));
|
|
1392
|
+
}
|
|
1393
|
+
fetch(t) {
|
|
1394
|
+
return Y(this, K, Kt).call(this, {
|
|
1395
|
+
...t,
|
|
1396
|
+
cancelRefetch: t.cancelRefetch ?? !0
|
|
1397
|
+
}).then(() => (this.updateResult(), E(this, pe)));
|
|
1398
|
+
}
|
|
1399
|
+
createResult(t, r) {
|
|
1400
|
+
var oe;
|
|
1401
|
+
const n = E(this, z), a = this.options, u = E(this, pe), o = E(this, yt), f = E(this, Ft), y = t !== n ? t.state : E(this, Zt), { state: m } = t;
|
|
1402
|
+
let l = { ...m }, v = !1, O;
|
|
1403
|
+
if (r._optimisticResults) {
|
|
1404
|
+
const q = this.hasListeners(), W = !q && En(t, r), ce = q && Rn(t, n, r, a);
|
|
1405
|
+
(W || ce) && (l = {
|
|
1406
|
+
...l,
|
|
1407
|
+
...Gn(m.data, t.options)
|
|
1408
|
+
}), r._optimisticResults === "isRestoring" && (l.fetchStatus = "idle");
|
|
1409
|
+
}
|
|
1410
|
+
let { error: F, errorUpdatedAt: C, status: L } = l;
|
|
1411
|
+
if (r.select && l.data !== void 0)
|
|
1412
|
+
if (u && l.data === (o == null ? void 0 : o.data) && r.select === E(this, er))
|
|
1413
|
+
O = E(this, Tt);
|
|
1414
|
+
else
|
|
1415
|
+
try {
|
|
1416
|
+
I(this, er, r.select), O = r.select(l.data), O = $r(u == null ? void 0 : u.data, O, r), I(this, Tt, O), I(this, Ue, null);
|
|
1417
|
+
} catch (q) {
|
|
1418
|
+
I(this, Ue, q);
|
|
1419
|
+
}
|
|
1420
|
+
else
|
|
1421
|
+
O = l.data;
|
|
1422
|
+
if (r.placeholderData !== void 0 && O === void 0 && L === "pending") {
|
|
1423
|
+
let q;
|
|
1424
|
+
if (u != null && u.isPlaceholderData && r.placeholderData === (f == null ? void 0 : f.placeholderData))
|
|
1425
|
+
q = u.data;
|
|
1426
|
+
else if (q = typeof r.placeholderData == "function" ? r.placeholderData(
|
|
1427
|
+
(oe = E(this, Mt)) == null ? void 0 : oe.state.data,
|
|
1428
|
+
E(this, Mt)
|
|
1429
|
+
) : r.placeholderData, r.select && q !== void 0)
|
|
1430
|
+
try {
|
|
1431
|
+
q = r.select(q), I(this, Ue, null);
|
|
1432
|
+
} catch (W) {
|
|
1433
|
+
I(this, Ue, W);
|
|
1434
|
+
}
|
|
1435
|
+
q !== void 0 && (L = "success", O = $r(
|
|
1436
|
+
u == null ? void 0 : u.data,
|
|
1437
|
+
q,
|
|
1438
|
+
r
|
|
1439
|
+
), v = !0);
|
|
1440
|
+
}
|
|
1441
|
+
E(this, Ue) && (F = E(this, Ue), O = E(this, Tt), C = Date.now(), L = "error");
|
|
1442
|
+
const _ = l.fetchStatus === "fetching", P = L === "pending", $ = L === "error", G = P && _, re = O !== void 0;
|
|
1443
|
+
return {
|
|
1444
|
+
status: L,
|
|
1445
|
+
fetchStatus: l.fetchStatus,
|
|
1446
|
+
isPending: P,
|
|
1447
|
+
isSuccess: L === "success",
|
|
1448
|
+
isError: $,
|
|
1449
|
+
isInitialLoading: G,
|
|
1450
|
+
isLoading: G,
|
|
1451
|
+
data: O,
|
|
1452
|
+
dataUpdatedAt: l.dataUpdatedAt,
|
|
1453
|
+
error: F,
|
|
1454
|
+
errorUpdatedAt: C,
|
|
1455
|
+
failureCount: l.fetchFailureCount,
|
|
1456
|
+
failureReason: l.fetchFailureReason,
|
|
1457
|
+
errorUpdateCount: l.errorUpdateCount,
|
|
1458
|
+
isFetched: l.dataUpdateCount > 0 || l.errorUpdateCount > 0,
|
|
1459
|
+
isFetchedAfterMount: l.dataUpdateCount > y.dataUpdateCount || l.errorUpdateCount > y.errorUpdateCount,
|
|
1460
|
+
isFetching: _,
|
|
1461
|
+
isRefetching: _ && !P,
|
|
1462
|
+
isLoadingError: $ && !re,
|
|
1463
|
+
isPaused: l.fetchStatus === "paused",
|
|
1464
|
+
isPlaceholderData: v,
|
|
1465
|
+
isRefetchError: $ && re,
|
|
1466
|
+
isStale: sn(t, r),
|
|
1467
|
+
refetch: this.refetch
|
|
1468
|
+
};
|
|
1469
|
+
}
|
|
1470
|
+
updateResult(t) {
|
|
1471
|
+
const r = E(this, pe), n = this.createResult(E(this, z), this.options);
|
|
1472
|
+
if (I(this, yt, E(this, z).state), I(this, Ft, this.options), E(this, yt).data !== void 0 && I(this, Mt, E(this, z)), Wr(n, r))
|
|
1473
|
+
return;
|
|
1474
|
+
I(this, pe, n);
|
|
1475
|
+
const a = {}, u = () => {
|
|
1476
|
+
if (!r)
|
|
1477
|
+
return !0;
|
|
1478
|
+
const { notifyOnChangeProps: o } = this.options, f = typeof o == "function" ? o() : o;
|
|
1479
|
+
if (f === "all" || !f && !E(this, Nt).size)
|
|
1480
|
+
return !0;
|
|
1481
|
+
const c = new Set(
|
|
1482
|
+
f ?? E(this, Nt)
|
|
1483
|
+
);
|
|
1484
|
+
return this.options.throwOnError && c.add("error"), Object.keys(E(this, pe)).some((y) => {
|
|
1485
|
+
const m = y;
|
|
1486
|
+
return E(this, pe)[m] !== r[m] && c.has(m);
|
|
1487
|
+
});
|
|
1488
|
+
};
|
|
1489
|
+
(t == null ? void 0 : t.listeners) !== !1 && u() && (a.listeners = !0), Y(this, K, Xn).call(this, { ...a, ...t });
|
|
1490
|
+
}
|
|
1491
|
+
onQueryUpdate() {
|
|
1492
|
+
this.updateResult(), this.hasListeners() && Y(this, K, Qr).call(this);
|
|
1493
|
+
}
|
|
1494
|
+
}, ye = new WeakMap(), z = new WeakMap(), Zt = new WeakMap(), pe = new WeakMap(), yt = new WeakMap(), Ft = new WeakMap(), Ue = new WeakMap(), er = new WeakMap(), Tt = new WeakMap(), Mt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), rt = new WeakMap(), Nt = new WeakMap(), K = new WeakSet(), Kt = function(t) {
|
|
1495
|
+
Y(this, K, Xr).call(this);
|
|
1496
|
+
let r = E(this, z).fetch(
|
|
1497
|
+
this.options,
|
|
1498
|
+
t
|
|
1499
|
+
);
|
|
1500
|
+
return t != null && t.throwOnError || (r = r.catch(kr)), r;
|
|
1501
|
+
}, Kr = function() {
|
|
1502
|
+
Y(this, K, Jr).call(this);
|
|
1503
|
+
const t = yr(
|
|
1504
|
+
this.options.staleTime,
|
|
1505
|
+
E(this, z)
|
|
1506
|
+
);
|
|
1507
|
+
if (Lt || E(this, pe).isStale || !Br(t))
|
|
1508
|
+
return;
|
|
1509
|
+
const n = Hn(E(this, pe).dataUpdatedAt, t) + 1;
|
|
1510
|
+
I(this, gt, setTimeout(() => {
|
|
1511
|
+
E(this, pe).isStale || this.updateResult();
|
|
1512
|
+
}, n));
|
|
1513
|
+
}, qr = function() {
|
|
1514
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(E(this, z)) : this.options.refetchInterval) ?? !1;
|
|
1515
|
+
}, Yr = function(t) {
|
|
1516
|
+
Y(this, K, Gr).call(this), I(this, rt, t), !(Lt || Te(this.options.enabled, E(this, z)) === !1 || !Br(E(this, rt)) || E(this, rt) === 0) && I(this, bt, setInterval(() => {
|
|
1517
|
+
(this.options.refetchIntervalInBackground || qn.isFocused()) && Y(this, K, Kt).call(this);
|
|
1518
|
+
}, E(this, rt)));
|
|
1519
|
+
}, Qr = function() {
|
|
1520
|
+
Y(this, K, Kr).call(this), Y(this, K, Yr).call(this, Y(this, K, qr).call(this));
|
|
1521
|
+
}, Jr = function() {
|
|
1522
|
+
E(this, gt) && (clearTimeout(E(this, gt)), I(this, gt, void 0));
|
|
1523
|
+
}, Gr = function() {
|
|
1524
|
+
E(this, bt) && (clearInterval(E(this, bt)), I(this, bt, void 0));
|
|
1525
|
+
}, Xr = function() {
|
|
1526
|
+
const t = E(this, ye).getQueryCache().build(E(this, ye), this.options);
|
|
1527
|
+
if (t === E(this, z))
|
|
1528
|
+
return;
|
|
1529
|
+
const r = E(this, z);
|
|
1530
|
+
I(this, z, t), I(this, Zt, t.state), this.hasListeners() && (r == null || r.removeObserver(this), t.addObserver(this));
|
|
1531
|
+
}, Xn = function(t) {
|
|
1532
|
+
on.batch(() => {
|
|
1533
|
+
t.listeners && this.listeners.forEach((r) => {
|
|
1534
|
+
r(E(this, pe));
|
|
1535
|
+
}), E(this, ye).getQueryCache().notify({
|
|
1536
|
+
query: E(this, z),
|
|
1537
|
+
type: "observerResultsUpdated"
|
|
1538
|
+
});
|
|
1539
|
+
});
|
|
1540
|
+
}, zn);
|
|
1541
|
+
function Ua(e, t) {
|
|
1542
|
+
return Te(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
1543
|
+
}
|
|
1544
|
+
function En(e, t) {
|
|
1545
|
+
return Ua(e, t) || e.state.data !== void 0 && Zr(e, t, t.refetchOnMount);
|
|
1546
|
+
}
|
|
1547
|
+
function Zr(e, t, r) {
|
|
1548
|
+
if (Te(t.enabled, e) !== !1) {
|
|
1549
|
+
const n = typeof r == "function" ? r(e) : r;
|
|
1550
|
+
return n === "always" || n !== !1 && sn(e, t);
|
|
1551
|
+
}
|
|
1552
|
+
return !1;
|
|
1553
|
+
}
|
|
1554
|
+
function Rn(e, t, r, n) {
|
|
1555
|
+
return (e !== t || Te(n.enabled, e) === !1) && (!r.suspense || e.state.status !== "error") && sn(e, r);
|
|
1556
|
+
}
|
|
1557
|
+
function sn(e, t) {
|
|
1558
|
+
return Te(t.enabled, e) !== !1 && e.isStaleByTime(yr(t.staleTime, e));
|
|
1559
|
+
}
|
|
1560
|
+
function Aa(e, t) {
|
|
1561
|
+
return !Wr(e.getCurrentResult(), t);
|
|
1562
|
+
}
|
|
1563
|
+
var Zn = D.createContext(
|
|
1564
|
+
void 0
|
|
1565
|
+
), Ia = (e) => {
|
|
1566
|
+
const t = D.useContext(Zn);
|
|
1567
|
+
if (!t)
|
|
1568
|
+
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1569
|
+
return t;
|
|
1570
|
+
}, Ro = ({
|
|
1571
|
+
client: e,
|
|
1572
|
+
children: t
|
|
1573
|
+
}) => (D.useEffect(() => (e.mount(), () => {
|
|
1574
|
+
e.unmount();
|
|
1575
|
+
}), [e]), /* @__PURE__ */ Ca.jsx(Zn.Provider, { value: e, children: t })), ea = D.createContext(!1), ka = () => D.useContext(ea);
|
|
1576
|
+
ea.Provider;
|
|
1577
|
+
function Ba() {
|
|
1578
|
+
let e = !1;
|
|
1579
|
+
return {
|
|
1580
|
+
clearReset: () => {
|
|
1581
|
+
e = !1;
|
|
1582
|
+
},
|
|
1583
|
+
reset: () => {
|
|
1584
|
+
e = !0;
|
|
1585
|
+
},
|
|
1586
|
+
isReset: () => e
|
|
1587
|
+
};
|
|
1588
|
+
}
|
|
1589
|
+
var Va = D.createContext(Ba()), Wa = () => D.useContext(Va);
|
|
1590
|
+
function za(e, t) {
|
|
1591
|
+
return typeof e == "function" ? e(...t) : !!e;
|
|
1592
|
+
}
|
|
1593
|
+
function wo() {
|
|
1594
|
+
}
|
|
1595
|
+
var $a = (e, t) => {
|
|
1596
|
+
(e.suspense || e.throwOnError) && (t.isReset() || (e.retryOnMount = !1));
|
|
1597
|
+
}, Ha = (e) => {
|
|
1598
|
+
D.useEffect(() => {
|
|
1599
|
+
e.clearReset();
|
|
1600
|
+
}, [e]);
|
|
1601
|
+
}, Ka = ({
|
|
1602
|
+
result: e,
|
|
1603
|
+
errorResetBoundary: t,
|
|
1604
|
+
throwOnError: r,
|
|
1605
|
+
query: n
|
|
1606
|
+
}) => e.isError && !t.isReset() && !e.isFetching && n && za(r, [e.error, n]), qa = (e, t) => t.state.data === void 0, Ya = (e) => {
|
|
1607
|
+
e.suspense && typeof e.staleTime != "number" && (e.staleTime = 1e3);
|
|
1608
|
+
}, Qa = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, Ja = (e, t, r) => t.fetchOptimistic(e).catch(() => {
|
|
1609
|
+
r.clearReset();
|
|
1610
|
+
});
|
|
1611
|
+
function Ga(e, t, r) {
|
|
1612
|
+
var y, m, l, v;
|
|
1613
|
+
if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
|
|
1614
|
+
throw new Error(
|
|
1615
|
+
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
1616
|
+
);
|
|
1617
|
+
const n = Ia(), a = ka(), u = Wa(), o = n.defaultQueryOptions(e);
|
|
1618
|
+
(m = (y = n.getDefaultOptions().queries) == null ? void 0 : y._experimental_beforeQuery) == null || m.call(
|
|
1619
|
+
y,
|
|
1620
|
+
o
|
|
1621
|
+
), o._optimisticResults = a ? "isRestoring" : "optimistic", Ya(o), $a(o, u), Ha(u);
|
|
1622
|
+
const [f] = D.useState(
|
|
1623
|
+
() => new t(
|
|
1624
|
+
n,
|
|
1625
|
+
o
|
|
1626
|
+
)
|
|
1627
|
+
), c = f.getOptimisticResult(o);
|
|
1628
|
+
if (D.useSyncExternalStore(
|
|
1629
|
+
D.useCallback(
|
|
1630
|
+
(O) => {
|
|
1631
|
+
const F = a ? () => {
|
|
1632
|
+
} : f.subscribe(on.batchCalls(O));
|
|
1633
|
+
return f.updateResult(), F;
|
|
1634
|
+
},
|
|
1635
|
+
[f, a]
|
|
1636
|
+
),
|
|
1637
|
+
() => f.getCurrentResult(),
|
|
1638
|
+
() => f.getCurrentResult()
|
|
1639
|
+
), D.useEffect(() => {
|
|
1640
|
+
f.setOptions(o, { listeners: !1 });
|
|
1641
|
+
}, [o, f]), Qa(o, c))
|
|
1642
|
+
throw Ja(o, f, u);
|
|
1643
|
+
if (Ka({
|
|
1644
|
+
result: c,
|
|
1645
|
+
errorResetBoundary: u,
|
|
1646
|
+
throwOnError: o.throwOnError,
|
|
1647
|
+
query: n.getQueryCache().get(o.queryHash)
|
|
1648
|
+
}))
|
|
1649
|
+
throw c.error;
|
|
1650
|
+
return (v = (l = n.getDefaultOptions().queries) == null ? void 0 : l._experimental_afterQuery) == null || v.call(
|
|
1651
|
+
l,
|
|
1652
|
+
o,
|
|
1653
|
+
c
|
|
1654
|
+
), o.notifyOnChangeProps ? c : f.trackResult(c);
|
|
1655
|
+
}
|
|
1656
|
+
function ta(e, t) {
|
|
1657
|
+
return process.env.NODE_ENV !== "production" && e.queryFn === Hr && console.error("skipToken is not allowed for useSuspenseQuery"), Ga(
|
|
1658
|
+
{
|
|
1659
|
+
...e,
|
|
1660
|
+
enabled: !0,
|
|
1661
|
+
suspense: !0,
|
|
1662
|
+
throwOnError: qa,
|
|
1663
|
+
placeholderData: void 0
|
|
1664
|
+
},
|
|
1665
|
+
ja
|
|
1666
|
+
);
|
|
1667
|
+
}
|
|
1668
|
+
/**
|
|
1669
|
+
* @remix-run/router v1.17.1
|
|
1670
|
+
*
|
|
1671
|
+
* Copyright (c) Remix Software Inc.
|
|
1672
|
+
*
|
|
1673
|
+
* This source code is licensed under the MIT license found in the
|
|
1674
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
1675
|
+
*
|
|
1676
|
+
* @license MIT
|
|
1677
|
+
*/
|
|
1678
|
+
function ee() {
|
|
1679
|
+
return ee = Object.assign ? Object.assign.bind() : function(e) {
|
|
1680
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1681
|
+
var r = arguments[t];
|
|
1682
|
+
for (var n in r)
|
|
1683
|
+
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
1684
|
+
}
|
|
1685
|
+
return e;
|
|
1686
|
+
}, ee.apply(this, arguments);
|
|
1687
|
+
}
|
|
1688
|
+
var ie;
|
|
1689
|
+
(function(e) {
|
|
1690
|
+
e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE";
|
|
1691
|
+
})(ie || (ie = {}));
|
|
1692
|
+
const wn = "popstate";
|
|
1693
|
+
function So(e) {
|
|
1694
|
+
e === void 0 && (e = {});
|
|
1695
|
+
function t(n, a) {
|
|
1696
|
+
let {
|
|
1697
|
+
pathname: u,
|
|
1698
|
+
search: o,
|
|
1699
|
+
hash: f
|
|
1700
|
+
} = n.location;
|
|
1701
|
+
return Qt(
|
|
1702
|
+
"",
|
|
1703
|
+
{
|
|
1704
|
+
pathname: u,
|
|
1705
|
+
search: o,
|
|
1706
|
+
hash: f
|
|
1707
|
+
},
|
|
1708
|
+
// state defaults to `null` because `window.history.state` does
|
|
1709
|
+
a.state && a.state.usr || null,
|
|
1710
|
+
a.state && a.state.key || "default"
|
|
1711
|
+
);
|
|
1712
|
+
}
|
|
1713
|
+
function r(n, a) {
|
|
1714
|
+
return typeof a == "string" ? a : tr(a);
|
|
1715
|
+
}
|
|
1716
|
+
return Za(t, r, null, e);
|
|
1717
|
+
}
|
|
1718
|
+
function U(e, t) {
|
|
1719
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
1720
|
+
throw new Error(t);
|
|
1721
|
+
}
|
|
1722
|
+
function fe(e, t) {
|
|
1723
|
+
if (!e) {
|
|
1724
|
+
typeof console < "u" && console.warn(t);
|
|
1725
|
+
try {
|
|
1726
|
+
throw new Error(t);
|
|
1727
|
+
} catch {
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
function Xa() {
|
|
1732
|
+
return Math.random().toString(36).substr(2, 8);
|
|
1733
|
+
}
|
|
1734
|
+
function Sn(e, t) {
|
|
1735
|
+
return {
|
|
1736
|
+
usr: e.state,
|
|
1737
|
+
key: e.key,
|
|
1738
|
+
idx: t
|
|
1739
|
+
};
|
|
1740
|
+
}
|
|
1741
|
+
function Qt(e, t, r, n) {
|
|
1742
|
+
return r === void 0 && (r = null), ee({
|
|
1743
|
+
pathname: typeof e == "string" ? e : e.pathname,
|
|
1744
|
+
search: "",
|
|
1745
|
+
hash: ""
|
|
1746
|
+
}, typeof t == "string" ? nt(t) : t, {
|
|
1747
|
+
state: r,
|
|
1748
|
+
// TODO: This could be cleaned up. push/replace should probably just take
|
|
1749
|
+
// full Locations now and avoid the need to run through this flow at all
|
|
1750
|
+
// But that's a pretty big refactor to the current test suite so going to
|
|
1751
|
+
// keep as is for the time being and just let any incoming keys take precedence
|
|
1752
|
+
key: t && t.key || n || Xa()
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1755
|
+
function tr(e) {
|
|
1756
|
+
let {
|
|
1757
|
+
pathname: t = "/",
|
|
1758
|
+
search: r = "",
|
|
1759
|
+
hash: n = ""
|
|
1760
|
+
} = e;
|
|
1761
|
+
return r && r !== "?" && (t += r.charAt(0) === "?" ? r : "?" + r), n && n !== "#" && (t += n.charAt(0) === "#" ? n : "#" + n), t;
|
|
1762
|
+
}
|
|
1763
|
+
function nt(e) {
|
|
1764
|
+
let t = {};
|
|
1765
|
+
if (e) {
|
|
1766
|
+
let r = e.indexOf("#");
|
|
1767
|
+
r >= 0 && (t.hash = e.substr(r), e = e.substr(0, r));
|
|
1768
|
+
let n = e.indexOf("?");
|
|
1769
|
+
n >= 0 && (t.search = e.substr(n), e = e.substr(0, n)), e && (t.pathname = e);
|
|
1770
|
+
}
|
|
1771
|
+
return t;
|
|
1772
|
+
}
|
|
1773
|
+
function Za(e, t, r, n) {
|
|
1774
|
+
n === void 0 && (n = {});
|
|
1775
|
+
let {
|
|
1776
|
+
window: a = document.defaultView,
|
|
1777
|
+
v5Compat: u = !1
|
|
1778
|
+
} = n, o = a.history, f = ie.Pop, c = null, y = m();
|
|
1779
|
+
y == null && (y = 0, o.replaceState(ee({}, o.state, {
|
|
1780
|
+
idx: y
|
|
1781
|
+
}), ""));
|
|
1782
|
+
function m() {
|
|
1783
|
+
return (o.state || {
|
|
1784
|
+
idx: null
|
|
1785
|
+
}).idx;
|
|
1786
|
+
}
|
|
1787
|
+
function l() {
|
|
1788
|
+
f = ie.Pop;
|
|
1789
|
+
let L = m(), _ = L == null ? null : L - y;
|
|
1790
|
+
y = L, c && c({
|
|
1791
|
+
action: f,
|
|
1792
|
+
location: C.location,
|
|
1793
|
+
delta: _
|
|
1794
|
+
});
|
|
1795
|
+
}
|
|
1796
|
+
function v(L, _) {
|
|
1797
|
+
f = ie.Push;
|
|
1798
|
+
let P = Qt(C.location, L, _);
|
|
1799
|
+
y = m() + 1;
|
|
1800
|
+
let $ = Sn(P, y), G = C.createHref(P);
|
|
1801
|
+
try {
|
|
1802
|
+
o.pushState($, "", G);
|
|
1803
|
+
} catch (re) {
|
|
1804
|
+
if (re instanceof DOMException && re.name === "DataCloneError")
|
|
1805
|
+
throw re;
|
|
1806
|
+
a.location.assign(G);
|
|
1807
|
+
}
|
|
1808
|
+
u && c && c({
|
|
1809
|
+
action: f,
|
|
1810
|
+
location: C.location,
|
|
1811
|
+
delta: 1
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
function O(L, _) {
|
|
1815
|
+
f = ie.Replace;
|
|
1816
|
+
let P = Qt(C.location, L, _);
|
|
1817
|
+
y = m();
|
|
1818
|
+
let $ = Sn(P, y), G = C.createHref(P);
|
|
1819
|
+
o.replaceState($, "", G), u && c && c({
|
|
1820
|
+
action: f,
|
|
1821
|
+
location: C.location,
|
|
1822
|
+
delta: 0
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
function F(L) {
|
|
1826
|
+
let _ = a.location.origin !== "null" ? a.location.origin : a.location.href, P = typeof L == "string" ? L : tr(L);
|
|
1827
|
+
return P = P.replace(/ $/, "%20"), U(_, "No window.location.(origin|href) available to create URL for href: " + P), new URL(P, _);
|
|
1828
|
+
}
|
|
1829
|
+
let C = {
|
|
1830
|
+
get action() {
|
|
1831
|
+
return f;
|
|
1832
|
+
},
|
|
1833
|
+
get location() {
|
|
1834
|
+
return e(a, o);
|
|
1835
|
+
},
|
|
1836
|
+
listen(L) {
|
|
1837
|
+
if (c)
|
|
1838
|
+
throw new Error("A history only accepts one active listener");
|
|
1839
|
+
return a.addEventListener(wn, l), c = L, () => {
|
|
1840
|
+
a.removeEventListener(wn, l), c = null;
|
|
1841
|
+
};
|
|
1842
|
+
},
|
|
1843
|
+
createHref(L) {
|
|
1844
|
+
return t(a, L);
|
|
1845
|
+
},
|
|
1846
|
+
createURL: F,
|
|
1847
|
+
encodeLocation(L) {
|
|
1848
|
+
let _ = F(L);
|
|
1849
|
+
return {
|
|
1850
|
+
pathname: _.pathname,
|
|
1851
|
+
search: _.search,
|
|
1852
|
+
hash: _.hash
|
|
1853
|
+
};
|
|
1854
|
+
},
|
|
1855
|
+
push: v,
|
|
1856
|
+
replace: O,
|
|
1857
|
+
go(L) {
|
|
1858
|
+
return o.go(L);
|
|
1859
|
+
}
|
|
1860
|
+
};
|
|
1861
|
+
return C;
|
|
1862
|
+
}
|
|
1863
|
+
var J;
|
|
1864
|
+
(function(e) {
|
|
1865
|
+
e.data = "data", e.deferred = "deferred", e.redirect = "redirect", e.error = "error";
|
|
1866
|
+
})(J || (J = {}));
|
|
1867
|
+
const ei = /* @__PURE__ */ new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]);
|
|
1868
|
+
function ti(e) {
|
|
1869
|
+
return e.index === !0;
|
|
1870
|
+
}
|
|
1871
|
+
function Jt(e, t, r, n) {
|
|
1872
|
+
return r === void 0 && (r = []), n === void 0 && (n = {}), e.map((a, u) => {
|
|
1873
|
+
let o = [...r, String(u)], f = typeof a.id == "string" ? a.id : o.join("-");
|
|
1874
|
+
if (U(a.index !== !0 || !a.children, "Cannot specify children on an index route"), U(!n[f], 'Found a route id collision on id "' + f + `". Route id's must be globally unique within Data Router usages`), ti(a)) {
|
|
1875
|
+
let c = ee({}, a, t(a), {
|
|
1876
|
+
id: f
|
|
1877
|
+
});
|
|
1878
|
+
return n[f] = c, c;
|
|
1879
|
+
} else {
|
|
1880
|
+
let c = ee({}, a, t(a), {
|
|
1881
|
+
id: f,
|
|
1882
|
+
children: void 0
|
|
1883
|
+
});
|
|
1884
|
+
return n[f] = c, a.children && (c.children = Jt(a.children, t, o, n)), c;
|
|
1885
|
+
}
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
function dt(e, t, r) {
|
|
1889
|
+
return r === void 0 && (r = "/"), gr(e, t, r, !1);
|
|
1890
|
+
}
|
|
1891
|
+
function gr(e, t, r, n) {
|
|
1892
|
+
let a = typeof t == "string" ? nt(t) : t, u = rr(a.pathname || "/", r);
|
|
1893
|
+
if (u == null)
|
|
1894
|
+
return null;
|
|
1895
|
+
let o = ra(e);
|
|
1896
|
+
ni(o);
|
|
1897
|
+
let f = null;
|
|
1898
|
+
for (let c = 0; f == null && c < o.length; ++c) {
|
|
1899
|
+
let y = pi(u);
|
|
1900
|
+
f = fi(o[c], y, n);
|
|
1901
|
+
}
|
|
1902
|
+
return f;
|
|
1903
|
+
}
|
|
1904
|
+
function ri(e, t) {
|
|
1905
|
+
let {
|
|
1906
|
+
route: r,
|
|
1907
|
+
pathname: n,
|
|
1908
|
+
params: a
|
|
1909
|
+
} = e;
|
|
1910
|
+
return {
|
|
1911
|
+
id: r.id,
|
|
1912
|
+
pathname: n,
|
|
1913
|
+
params: a,
|
|
1914
|
+
data: t[r.id],
|
|
1915
|
+
handle: r.handle
|
|
1916
|
+
};
|
|
1917
|
+
}
|
|
1918
|
+
function ra(e, t, r, n) {
|
|
1919
|
+
t === void 0 && (t = []), r === void 0 && (r = []), n === void 0 && (n = "");
|
|
1920
|
+
let a = (u, o, f) => {
|
|
1921
|
+
let c = {
|
|
1922
|
+
relativePath: f === void 0 ? u.path || "" : f,
|
|
1923
|
+
caseSensitive: u.caseSensitive === !0,
|
|
1924
|
+
childrenIndex: o,
|
|
1925
|
+
route: u
|
|
1926
|
+
};
|
|
1927
|
+
c.relativePath.startsWith("/") && (U(c.relativePath.startsWith(n), 'Absolute route path "' + c.relativePath + '" nested under path ' + ('"' + n + '" is not valid. An absolute child route path ') + "must start with the combined path of all its parent routes."), c.relativePath = c.relativePath.slice(n.length));
|
|
1928
|
+
let y = $e([n, c.relativePath]), m = r.concat(c);
|
|
1929
|
+
u.children && u.children.length > 0 && (U(
|
|
1930
|
+
// Our types know better, but runtime JS may not!
|
|
1931
|
+
// @ts-expect-error
|
|
1932
|
+
u.index !== !0,
|
|
1933
|
+
"Index routes must not have child routes. Please remove " + ('all child routes from route path "' + y + '".')
|
|
1934
|
+
), ra(u.children, t, m, y)), !(u.path == null && !u.index) && t.push({
|
|
1935
|
+
path: y,
|
|
1936
|
+
score: ci(y, u.index),
|
|
1937
|
+
routesMeta: m
|
|
1938
|
+
});
|
|
1939
|
+
};
|
|
1940
|
+
return e.forEach((u, o) => {
|
|
1941
|
+
var f;
|
|
1942
|
+
if (u.path === "" || !((f = u.path) != null && f.includes("?")))
|
|
1943
|
+
a(u, o);
|
|
1944
|
+
else
|
|
1945
|
+
for (let c of na(u.path))
|
|
1946
|
+
a(u, o, c);
|
|
1947
|
+
}), t;
|
|
1948
|
+
}
|
|
1949
|
+
function na(e) {
|
|
1950
|
+
let t = e.split("/");
|
|
1951
|
+
if (t.length === 0) return [];
|
|
1952
|
+
let [r, ...n] = t, a = r.endsWith("?"), u = r.replace(/\?$/, "");
|
|
1953
|
+
if (n.length === 0)
|
|
1954
|
+
return a ? [u, ""] : [u];
|
|
1955
|
+
let o = na(n.join("/")), f = [];
|
|
1956
|
+
return f.push(...o.map((c) => c === "" ? u : [u, c].join("/"))), a && f.push(...o), f.map((c) => e.startsWith("/") && c === "" ? "/" : c);
|
|
1957
|
+
}
|
|
1958
|
+
function ni(e) {
|
|
1959
|
+
e.sort((t, r) => t.score !== r.score ? r.score - t.score : di(t.routesMeta.map((n) => n.childrenIndex), r.routesMeta.map((n) => n.childrenIndex)));
|
|
1960
|
+
}
|
|
1961
|
+
const ai = /^:[\w-]+$/, ii = 3, oi = 2, si = 1, li = 10, ui = -2, Cn = (e) => e === "*";
|
|
1962
|
+
function ci(e, t) {
|
|
1963
|
+
let r = e.split("/"), n = r.length;
|
|
1964
|
+
return r.some(Cn) && (n += ui), t && (n += oi), r.filter((a) => !Cn(a)).reduce((a, u) => a + (ai.test(u) ? ii : u === "" ? si : li), n);
|
|
1965
|
+
}
|
|
1966
|
+
function di(e, t) {
|
|
1967
|
+
return e.length === t.length && e.slice(0, -1).every((n, a) => n === t[a]) ? (
|
|
1968
|
+
// If two routes are siblings, we should try to match the earlier sibling
|
|
1969
|
+
// first. This allows people to have fine-grained control over the matching
|
|
1970
|
+
// behavior by simply putting routes with identical paths in the order they
|
|
1971
|
+
// want them tried.
|
|
1972
|
+
e[e.length - 1] - t[t.length - 1]
|
|
1973
|
+
) : (
|
|
1974
|
+
// Otherwise, it doesn't really make sense to rank non-siblings by index,
|
|
1975
|
+
// so they sort equally.
|
|
1976
|
+
0
|
|
1977
|
+
);
|
|
1978
|
+
}
|
|
1979
|
+
function fi(e, t, r) {
|
|
1980
|
+
r === void 0 && (r = !1);
|
|
1981
|
+
let {
|
|
1982
|
+
routesMeta: n
|
|
1983
|
+
} = e, a = {}, u = "/", o = [];
|
|
1984
|
+
for (let f = 0; f < n.length; ++f) {
|
|
1985
|
+
let c = n[f], y = f === n.length - 1, m = u === "/" ? t : t.slice(u.length) || "/", l = en({
|
|
1986
|
+
path: c.relativePath,
|
|
1987
|
+
caseSensitive: c.caseSensitive,
|
|
1988
|
+
end: y
|
|
1989
|
+
}, m), v = c.route;
|
|
1990
|
+
if (!l && y && r && !n[n.length - 1].route.index && (l = en({
|
|
1991
|
+
path: c.relativePath,
|
|
1992
|
+
caseSensitive: c.caseSensitive,
|
|
1993
|
+
end: !1
|
|
1994
|
+
}, m)), !l)
|
|
1995
|
+
return null;
|
|
1996
|
+
Object.assign(a, l.params), o.push({
|
|
1997
|
+
// TODO: Can this as be avoided?
|
|
1998
|
+
params: a,
|
|
1999
|
+
pathname: $e([u, l.pathname]),
|
|
2000
|
+
pathnameBase: yi($e([u, l.pathnameBase])),
|
|
2001
|
+
route: v
|
|
2002
|
+
}), l.pathnameBase !== "/" && (u = $e([u, l.pathnameBase]));
|
|
2003
|
+
}
|
|
2004
|
+
return o;
|
|
2005
|
+
}
|
|
2006
|
+
function en(e, t) {
|
|
2007
|
+
typeof e == "string" && (e = {
|
|
2008
|
+
path: e,
|
|
2009
|
+
caseSensitive: !1,
|
|
2010
|
+
end: !0
|
|
2011
|
+
});
|
|
2012
|
+
let [r, n] = hi(e.path, e.caseSensitive, e.end), a = t.match(r);
|
|
2013
|
+
if (!a) return null;
|
|
2014
|
+
let u = a[0], o = u.replace(/(.)\/+$/, "$1"), f = a.slice(1);
|
|
2015
|
+
return {
|
|
2016
|
+
params: n.reduce((y, m, l) => {
|
|
2017
|
+
let {
|
|
2018
|
+
paramName: v,
|
|
2019
|
+
isOptional: O
|
|
2020
|
+
} = m;
|
|
2021
|
+
if (v === "*") {
|
|
2022
|
+
let C = f[l] || "";
|
|
2023
|
+
o = u.slice(0, u.length - C.length).replace(/(.)\/+$/, "$1");
|
|
2024
|
+
}
|
|
2025
|
+
const F = f[l];
|
|
2026
|
+
return O && !F ? y[v] = void 0 : y[v] = (F || "").replace(/%2F/g, "/"), y;
|
|
2027
|
+
}, {}),
|
|
2028
|
+
pathname: u,
|
|
2029
|
+
pathnameBase: o,
|
|
2030
|
+
pattern: e
|
|
2031
|
+
};
|
|
2032
|
+
}
|
|
2033
|
+
function hi(e, t, r) {
|
|
2034
|
+
t === void 0 && (t = !1), r === void 0 && (r = !0), fe(e === "*" || !e.endsWith("*") || e.endsWith("/*"), '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(/\*$/, "/*") + '".'));
|
|
2035
|
+
let n = [], a = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (o, f, c) => (n.push({
|
|
2036
|
+
paramName: f,
|
|
2037
|
+
isOptional: c != null
|
|
2038
|
+
}), c ? "/?([^\\/]+)?" : "/([^\\/]+)"));
|
|
2039
|
+
return e.endsWith("*") ? (n.push({
|
|
2040
|
+
paramName: "*"
|
|
2041
|
+
}), a += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : r ? a += "\\/*$" : e !== "" && e !== "/" && (a += "(?:(?=\\/|$))"), [new RegExp(a, t ? void 0 : "i"), n];
|
|
2042
|
+
}
|
|
2043
|
+
function pi(e) {
|
|
2044
|
+
try {
|
|
2045
|
+
return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
|
|
2046
|
+
} catch (t) {
|
|
2047
|
+
return fe(!1, 'The URL path "' + e + '" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent ' + ("encoding (" + t + ").")), e;
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
function rr(e, t) {
|
|
2051
|
+
if (t === "/") return e;
|
|
2052
|
+
if (!e.toLowerCase().startsWith(t.toLowerCase()))
|
|
2053
|
+
return null;
|
|
2054
|
+
let r = t.endsWith("/") ? t.length - 1 : t.length, n = e.charAt(r);
|
|
2055
|
+
return n && n !== "/" ? null : e.slice(r) || "/";
|
|
2056
|
+
}
|
|
2057
|
+
function vi(e, t) {
|
|
2058
|
+
t === void 0 && (t = "/");
|
|
2059
|
+
let {
|
|
2060
|
+
pathname: r,
|
|
2061
|
+
search: n = "",
|
|
2062
|
+
hash: a = ""
|
|
2063
|
+
} = typeof e == "string" ? nt(e) : e;
|
|
2064
|
+
return {
|
|
2065
|
+
pathname: r ? r.startsWith("/") ? r : mi(r, t) : t,
|
|
2066
|
+
search: gi(n),
|
|
2067
|
+
hash: bi(a)
|
|
2068
|
+
};
|
|
2069
|
+
}
|
|
2070
|
+
function mi(e, t) {
|
|
2071
|
+
let r = t.replace(/\/+$/, "").split("/");
|
|
2072
|
+
return e.split("/").forEach((a) => {
|
|
2073
|
+
a === ".." ? r.length > 1 && r.pop() : a !== "." && r.push(a);
|
|
2074
|
+
}), r.length > 1 ? r.join("/") : "/";
|
|
2075
|
+
}
|
|
2076
|
+
function jr(e, t, r, n) {
|
|
2077
|
+
return "Cannot include a '" + e + "' character in a manually specified " + ("`to." + t + "` field [" + JSON.stringify(n) + "]. Please separate it out to the ") + ("`to." + r + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
|
|
2078
|
+
}
|
|
2079
|
+
function aa(e) {
|
|
2080
|
+
return e.filter((t, r) => r === 0 || t.route.path && t.route.path.length > 0);
|
|
2081
|
+
}
|
|
2082
|
+
function Er(e, t) {
|
|
2083
|
+
let r = aa(e);
|
|
2084
|
+
return t ? r.map((n, a) => a === r.length - 1 ? n.pathname : n.pathnameBase) : r.map((n) => n.pathnameBase);
|
|
2085
|
+
}
|
|
2086
|
+
function Rr(e, t, r, n) {
|
|
2087
|
+
n === void 0 && (n = !1);
|
|
2088
|
+
let a;
|
|
2089
|
+
typeof e == "string" ? a = nt(e) : (a = ee({}, e), U(!a.pathname || !a.pathname.includes("?"), jr("?", "pathname", "search", a)), U(!a.pathname || !a.pathname.includes("#"), jr("#", "pathname", "hash", a)), U(!a.search || !a.search.includes("#"), jr("#", "search", "hash", a)));
|
|
2090
|
+
let u = e === "" || a.pathname === "", o = u ? "/" : a.pathname, f;
|
|
2091
|
+
if (o == null)
|
|
2092
|
+
f = r;
|
|
2093
|
+
else {
|
|
2094
|
+
let l = t.length - 1;
|
|
2095
|
+
if (!n && o.startsWith("..")) {
|
|
2096
|
+
let v = o.split("/");
|
|
2097
|
+
for (; v[0] === ".."; )
|
|
2098
|
+
v.shift(), l -= 1;
|
|
2099
|
+
a.pathname = v.join("/");
|
|
2100
|
+
}
|
|
2101
|
+
f = l >= 0 ? t[l] : "/";
|
|
2102
|
+
}
|
|
2103
|
+
let c = vi(a, f), y = o && o !== "/" && o.endsWith("/"), m = (u || o === ".") && r.endsWith("/");
|
|
2104
|
+
return !c.pathname.endsWith("/") && (y || m) && (c.pathname += "/"), c;
|
|
2105
|
+
}
|
|
2106
|
+
const $e = (e) => e.join("/").replace(/\/\/+/g, "/"), yi = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), gi = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, bi = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
|
|
2107
|
+
class ia {
|
|
2108
|
+
constructor(t, r, n, a) {
|
|
2109
|
+
a === void 0 && (a = !1), this.status = t, this.statusText = r || "", this.internal = a, n instanceof Error ? (this.data = n.toString(), this.error = n) : this.data = n;
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
function wr(e) {
|
|
2113
|
+
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
2114
|
+
}
|
|
2115
|
+
const oa = ["post", "put", "patch", "delete"], Ei = new Set(oa), Ri = ["get", ...oa], wi = new Set(Ri), Si = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]), Ci = /* @__PURE__ */ new Set([307, 308]), Ur = {
|
|
2116
|
+
state: "idle",
|
|
2117
|
+
location: void 0,
|
|
2118
|
+
formMethod: void 0,
|
|
2119
|
+
formAction: void 0,
|
|
2120
|
+
formEncType: void 0,
|
|
2121
|
+
formData: void 0,
|
|
2122
|
+
json: void 0,
|
|
2123
|
+
text: void 0
|
|
2124
|
+
}, Di = {
|
|
2125
|
+
state: "idle",
|
|
2126
|
+
data: void 0,
|
|
2127
|
+
formMethod: void 0,
|
|
2128
|
+
formAction: void 0,
|
|
2129
|
+
formEncType: void 0,
|
|
2130
|
+
formData: void 0,
|
|
2131
|
+
json: void 0,
|
|
2132
|
+
text: void 0
|
|
2133
|
+
}, $t = {
|
|
2134
|
+
state: "unblocked",
|
|
2135
|
+
proceed: void 0,
|
|
2136
|
+
reset: void 0,
|
|
2137
|
+
location: void 0
|
|
2138
|
+
}, ln = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, xi = (e) => ({
|
|
2139
|
+
hasErrorBoundary: !!e.hasErrorBoundary
|
|
2140
|
+
}), sa = "remix-router-transitions";
|
|
2141
|
+
function Co(e) {
|
|
2142
|
+
const t = e.window ? e.window : typeof window < "u" ? window : void 0, r = typeof t < "u" && typeof t.document < "u" && typeof t.document.createElement < "u", n = !r;
|
|
2143
|
+
U(e.routes.length > 0, "You must provide a non-empty routes array to createRouter");
|
|
2144
|
+
let a;
|
|
2145
|
+
if (e.mapRouteProperties)
|
|
2146
|
+
a = e.mapRouteProperties;
|
|
2147
|
+
else if (e.detectErrorBoundary) {
|
|
2148
|
+
let s = e.detectErrorBoundary;
|
|
2149
|
+
a = (d) => ({
|
|
2150
|
+
hasErrorBoundary: s(d)
|
|
2151
|
+
});
|
|
2152
|
+
} else
|
|
2153
|
+
a = xi;
|
|
2154
|
+
let u = {}, o = Jt(e.routes, a, void 0, u), f, c = e.basename || "/", y = e.unstable_dataStrategy || Ti, m = e.unstable_patchRoutesOnMiss, l = ee({
|
|
2155
|
+
v7_fetcherPersist: !1,
|
|
2156
|
+
v7_normalizeFormMethod: !1,
|
|
2157
|
+
v7_partialHydration: !1,
|
|
2158
|
+
v7_prependBasename: !1,
|
|
2159
|
+
v7_relativeSplatPath: !1,
|
|
2160
|
+
unstable_skipActionErrorRevalidation: !1
|
|
2161
|
+
}, e.future), v = null, O = /* @__PURE__ */ new Set(), F = null, C = null, L = null, _ = e.hydrationData != null, P = dt(o, e.history.location, c), $ = null;
|
|
2162
|
+
if (P == null && !m) {
|
|
2163
|
+
let s = ve(404, {
|
|
2164
|
+
pathname: e.history.location.pathname
|
|
2165
|
+
}), {
|
|
2166
|
+
matches: d,
|
|
2167
|
+
route: p
|
|
2168
|
+
} = Ln(o);
|
|
2169
|
+
P = d, $ = {
|
|
2170
|
+
[p.id]: s
|
|
2171
|
+
};
|
|
2172
|
+
}
|
|
2173
|
+
P && m && wt(P, o, e.history.location.pathname).active && (P = null);
|
|
2174
|
+
let G;
|
|
2175
|
+
if (!P)
|
|
2176
|
+
G = !1, P = [];
|
|
2177
|
+
else if (P.some((s) => s.route.lazy))
|
|
2178
|
+
G = !1;
|
|
2179
|
+
else if (!P.some((s) => s.route.loader))
|
|
2180
|
+
G = !0;
|
|
2181
|
+
else if (l.v7_partialHydration) {
|
|
2182
|
+
let s = e.hydrationData ? e.hydrationData.loaderData : null, d = e.hydrationData ? e.hydrationData.errors : null, p = (g) => g.route.loader ? typeof g.route.loader == "function" && g.route.loader.hydrate === !0 ? !1 : s && s[g.route.id] !== void 0 || d && d[g.route.id] !== void 0 : !0;
|
|
2183
|
+
if (d) {
|
|
2184
|
+
let g = P.findIndex((x) => d[x.route.id] !== void 0);
|
|
2185
|
+
G = P.slice(0, g + 1).every(p);
|
|
2186
|
+
} else
|
|
2187
|
+
G = P.every(p);
|
|
2188
|
+
} else
|
|
2189
|
+
G = e.hydrationData != null;
|
|
2190
|
+
let re, b = {
|
|
2191
|
+
historyAction: e.history.action,
|
|
2192
|
+
location: e.history.location,
|
|
2193
|
+
matches: P,
|
|
2194
|
+
initialized: G,
|
|
2195
|
+
navigation: Ur,
|
|
2196
|
+
// Don't restore on initial updateState() if we were SSR'd
|
|
2197
|
+
restoreScrollPosition: e.hydrationData != null ? !1 : null,
|
|
2198
|
+
preventScrollReset: !1,
|
|
2199
|
+
revalidation: "idle",
|
|
2200
|
+
loaderData: e.hydrationData && e.hydrationData.loaderData || {},
|
|
2201
|
+
actionData: e.hydrationData && e.hydrationData.actionData || null,
|
|
2202
|
+
errors: e.hydrationData && e.hydrationData.errors || $,
|
|
2203
|
+
fetchers: /* @__PURE__ */ new Map(),
|
|
2204
|
+
blockers: /* @__PURE__ */ new Map()
|
|
2205
|
+
}, oe = ie.Pop, q = !1, W, ce = !1, se = /* @__PURE__ */ new Map(), ge = null, ne = !1, X = !1, we = [], it = [], Z = /* @__PURE__ */ new Map(), ot = 0, He = -1, Ie = /* @__PURE__ */ new Map(), Se = /* @__PURE__ */ new Set(), ke = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ new Map(), Pe = /* @__PURE__ */ new Set(), Be = /* @__PURE__ */ new Map(), Oe = /* @__PURE__ */ new Map(), Ut = /* @__PURE__ */ new Map(), qe = !1;
|
|
2206
|
+
function At() {
|
|
2207
|
+
if (v = e.history.listen((s) => {
|
|
2208
|
+
let {
|
|
2209
|
+
action: d,
|
|
2210
|
+
location: p,
|
|
2211
|
+
delta: g
|
|
2212
|
+
} = s;
|
|
2213
|
+
if (qe) {
|
|
2214
|
+
qe = !1;
|
|
2215
|
+
return;
|
|
2216
|
+
}
|
|
2217
|
+
fe(Oe.size === 0 || g != null, "You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");
|
|
2218
|
+
let x = Vt({
|
|
2219
|
+
currentLocation: b.location,
|
|
2220
|
+
nextLocation: p,
|
|
2221
|
+
historyAction: d
|
|
2222
|
+
});
|
|
2223
|
+
if (x && g != null) {
|
|
2224
|
+
qe = !0, e.history.go(g * -1), Ge(x, {
|
|
2225
|
+
state: "blocked",
|
|
2226
|
+
location: p,
|
|
2227
|
+
proceed() {
|
|
2228
|
+
Ge(x, {
|
|
2229
|
+
state: "proceeding",
|
|
2230
|
+
proceed: void 0,
|
|
2231
|
+
reset: void 0,
|
|
2232
|
+
location: p
|
|
2233
|
+
}), e.history.go(g);
|
|
2234
|
+
},
|
|
2235
|
+
reset() {
|
|
2236
|
+
let N = new Map(b.blockers);
|
|
2237
|
+
N.set(x, $t), le({
|
|
2238
|
+
blockers: N
|
|
2239
|
+
});
|
|
2240
|
+
}
|
|
2241
|
+
});
|
|
2242
|
+
return;
|
|
2243
|
+
}
|
|
2244
|
+
return be(d, p);
|
|
2245
|
+
}), r) {
|
|
2246
|
+
$i(t, se);
|
|
2247
|
+
let s = () => Hi(t, se);
|
|
2248
|
+
t.addEventListener("pagehide", s), ge = () => t.removeEventListener("pagehide", s);
|
|
2249
|
+
}
|
|
2250
|
+
return b.initialized || be(ie.Pop, b.location, {
|
|
2251
|
+
initialHydration: !0
|
|
2252
|
+
}), re;
|
|
2253
|
+
}
|
|
2254
|
+
function Et() {
|
|
2255
|
+
v && v(), ge && ge(), O.clear(), W && W.abort(), b.fetchers.forEach((s, d) => Je(d)), b.blockers.forEach((s, d) => cr(d));
|
|
2256
|
+
}
|
|
2257
|
+
function Dr(s) {
|
|
2258
|
+
return O.add(s), () => O.delete(s);
|
|
2259
|
+
}
|
|
2260
|
+
function le(s, d) {
|
|
2261
|
+
d === void 0 && (d = {}), b = ee({}, b, s);
|
|
2262
|
+
let p = [], g = [];
|
|
2263
|
+
l.v7_fetcherPersist && b.fetchers.forEach((x, N) => {
|
|
2264
|
+
x.state === "idle" && (Pe.has(N) ? g.push(N) : p.push(N));
|
|
2265
|
+
}), [...O].forEach((x) => x(b, {
|
|
2266
|
+
deletedFetchers: g,
|
|
2267
|
+
unstable_viewTransitionOpts: d.viewTransitionOpts,
|
|
2268
|
+
unstable_flushSync: d.flushSync === !0
|
|
2269
|
+
})), l.v7_fetcherPersist && (p.forEach((x) => b.fetchers.delete(x)), g.forEach((x) => Je(x)));
|
|
2270
|
+
}
|
|
2271
|
+
function Ye(s, d, p) {
|
|
2272
|
+
var g, x;
|
|
2273
|
+
let {
|
|
2274
|
+
flushSync: N
|
|
2275
|
+
} = p === void 0 ? {} : p, i = b.actionData != null && b.navigation.formMethod != null && Fe(b.navigation.formMethod) && b.navigation.state === "loading" && ((g = s.state) == null ? void 0 : g._isRedirect) !== !0, h;
|
|
2276
|
+
d.actionData ? Object.keys(d.actionData).length > 0 ? h = d.actionData : h = null : i ? h = b.actionData : h = null;
|
|
2277
|
+
let R = d.loaderData ? Mn(b.loaderData, d.loaderData, d.matches || [], d.errors) : b.loaderData, w = b.blockers;
|
|
2278
|
+
w.size > 0 && (w = new Map(w), w.forEach((T, M) => w.set(M, $t)));
|
|
2279
|
+
let S = q === !0 || b.navigation.formMethod != null && Fe(b.navigation.formMethod) && ((x = s.state) == null ? void 0 : x._isRedirect) !== !0;
|
|
2280
|
+
f && (o = f, f = void 0), ne || oe === ie.Pop || (oe === ie.Push ? e.history.push(s, s.state) : oe === ie.Replace && e.history.replace(s, s.state));
|
|
2281
|
+
let j;
|
|
2282
|
+
if (oe === ie.Pop) {
|
|
2283
|
+
let T = se.get(b.location.pathname);
|
|
2284
|
+
T && T.has(s.pathname) ? j = {
|
|
2285
|
+
currentLocation: b.location,
|
|
2286
|
+
nextLocation: s
|
|
2287
|
+
} : se.has(s.pathname) && (j = {
|
|
2288
|
+
currentLocation: s,
|
|
2289
|
+
nextLocation: b.location
|
|
2290
|
+
});
|
|
2291
|
+
} else if (ce) {
|
|
2292
|
+
let T = se.get(b.location.pathname);
|
|
2293
|
+
T ? T.add(s.pathname) : (T = /* @__PURE__ */ new Set([s.pathname]), se.set(b.location.pathname, T)), j = {
|
|
2294
|
+
currentLocation: b.location,
|
|
2295
|
+
nextLocation: s
|
|
2296
|
+
};
|
|
2297
|
+
}
|
|
2298
|
+
le(ee({}, d, {
|
|
2299
|
+
actionData: h,
|
|
2300
|
+
loaderData: R,
|
|
2301
|
+
historyAction: oe,
|
|
2302
|
+
location: s,
|
|
2303
|
+
initialized: !0,
|
|
2304
|
+
navigation: Ur,
|
|
2305
|
+
revalidation: "idle",
|
|
2306
|
+
restoreScrollPosition: pr(s, d.matches || b.matches),
|
|
2307
|
+
preventScrollReset: S,
|
|
2308
|
+
blockers: w
|
|
2309
|
+
}), {
|
|
2310
|
+
viewTransitionOpts: j,
|
|
2311
|
+
flushSync: N === !0
|
|
2312
|
+
}), oe = ie.Pop, q = !1, ce = !1, ne = !1, X = !1, we = [], it = [];
|
|
2313
|
+
}
|
|
2314
|
+
async function ar(s, d) {
|
|
2315
|
+
if (typeof s == "number") {
|
|
2316
|
+
e.history.go(s);
|
|
2317
|
+
return;
|
|
2318
|
+
}
|
|
2319
|
+
let p = tn(b.location, b.matches, c, l.v7_prependBasename, s, l.v7_relativeSplatPath, d == null ? void 0 : d.fromRouteId, d == null ? void 0 : d.relative), {
|
|
2320
|
+
path: g,
|
|
2321
|
+
submission: x,
|
|
2322
|
+
error: N
|
|
2323
|
+
} = Dn(l.v7_normalizeFormMethod, !1, p, d), i = b.location, h = Qt(b.location, g, d && d.state);
|
|
2324
|
+
h = ee({}, h, e.history.encodeLocation(h));
|
|
2325
|
+
let R = d && d.replace != null ? d.replace : void 0, w = ie.Push;
|
|
2326
|
+
R === !0 ? w = ie.Replace : R === !1 || x != null && Fe(x.formMethod) && x.formAction === b.location.pathname + b.location.search && (w = ie.Replace);
|
|
2327
|
+
let S = d && "preventScrollReset" in d ? d.preventScrollReset === !0 : void 0, j = (d && d.unstable_flushSync) === !0, T = Vt({
|
|
2328
|
+
currentLocation: i,
|
|
2329
|
+
nextLocation: h,
|
|
2330
|
+
historyAction: w
|
|
2331
|
+
});
|
|
2332
|
+
if (T) {
|
|
2333
|
+
Ge(T, {
|
|
2334
|
+
state: "blocked",
|
|
2335
|
+
location: h,
|
|
2336
|
+
proceed() {
|
|
2337
|
+
Ge(T, {
|
|
2338
|
+
state: "proceeding",
|
|
2339
|
+
proceed: void 0,
|
|
2340
|
+
reset: void 0,
|
|
2341
|
+
location: h
|
|
2342
|
+
}), ar(s, d);
|
|
2343
|
+
},
|
|
2344
|
+
reset() {
|
|
2345
|
+
let M = new Map(b.blockers);
|
|
2346
|
+
M.set(T, $t), le({
|
|
2347
|
+
blockers: M
|
|
2348
|
+
});
|
|
2349
|
+
}
|
|
2350
|
+
});
|
|
2351
|
+
return;
|
|
2352
|
+
}
|
|
2353
|
+
return await be(w, h, {
|
|
2354
|
+
submission: x,
|
|
2355
|
+
// Send through the formData serialization error if we have one so we can
|
|
2356
|
+
// render at the right error boundary after we match routes
|
|
2357
|
+
pendingError: N,
|
|
2358
|
+
preventScrollReset: S,
|
|
2359
|
+
replace: d && d.replace,
|
|
2360
|
+
enableViewTransition: d && d.unstable_viewTransition,
|
|
2361
|
+
flushSync: j
|
|
2362
|
+
});
|
|
2363
|
+
}
|
|
2364
|
+
function Rt() {
|
|
2365
|
+
if (Ve(), le({
|
|
2366
|
+
revalidation: "loading"
|
|
2367
|
+
}), b.navigation.state !== "submitting") {
|
|
2368
|
+
if (b.navigation.state === "idle") {
|
|
2369
|
+
be(b.historyAction, b.location, {
|
|
2370
|
+
startUninterruptedRevalidation: !0
|
|
2371
|
+
});
|
|
2372
|
+
return;
|
|
2373
|
+
}
|
|
2374
|
+
be(oe || b.historyAction, b.navigation.location, {
|
|
2375
|
+
overrideNavigation: b.navigation
|
|
2376
|
+
});
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
async function be(s, d, p) {
|
|
2380
|
+
W && W.abort(), W = null, oe = s, ne = (p && p.startUninterruptedRevalidation) === !0, hr(b.location, b.matches), q = (p && p.preventScrollReset) === !0, ce = (p && p.enableViewTransition) === !0;
|
|
2381
|
+
let g = f || o, x = p && p.overrideNavigation, N = dt(g, d, c), i = (p && p.flushSync) === !0, h = wt(N, g, d.pathname);
|
|
2382
|
+
if (h.active && h.matches && (N = h.matches), !N) {
|
|
2383
|
+
let {
|
|
2384
|
+
error: A,
|
|
2385
|
+
notFoundMatches: B,
|
|
2386
|
+
route: k
|
|
2387
|
+
} = Le(d.pathname);
|
|
2388
|
+
Ye(d, {
|
|
2389
|
+
matches: B,
|
|
2390
|
+
loaderData: {},
|
|
2391
|
+
errors: {
|
|
2392
|
+
[k.id]: A
|
|
2393
|
+
}
|
|
2394
|
+
}, {
|
|
2395
|
+
flushSync: i
|
|
2396
|
+
});
|
|
2397
|
+
return;
|
|
2398
|
+
}
|
|
2399
|
+
if (b.initialized && !X && Ai(b.location, d) && !(p && p.submission && Fe(p.submission.formMethod))) {
|
|
2400
|
+
Ye(d, {
|
|
2401
|
+
matches: N
|
|
2402
|
+
}, {
|
|
2403
|
+
flushSync: i
|
|
2404
|
+
});
|
|
2405
|
+
return;
|
|
2406
|
+
}
|
|
2407
|
+
W = new AbortController();
|
|
2408
|
+
let R = Ct(e.history, d, W.signal, p && p.submission), w;
|
|
2409
|
+
if (p && p.pendingError)
|
|
2410
|
+
w = [Yt(N).route.id, {
|
|
2411
|
+
type: J.error,
|
|
2412
|
+
error: p.pendingError
|
|
2413
|
+
}];
|
|
2414
|
+
else if (p && p.submission && Fe(p.submission.formMethod)) {
|
|
2415
|
+
let A = await ir(R, d, p.submission, N, h.active, {
|
|
2416
|
+
replace: p.replace,
|
|
2417
|
+
flushSync: i
|
|
2418
|
+
});
|
|
2419
|
+
if (A.shortCircuited)
|
|
2420
|
+
return;
|
|
2421
|
+
if (A.pendingActionResult) {
|
|
2422
|
+
let [B, k] = A.pendingActionResult;
|
|
2423
|
+
if (Re(k) && wr(k.error) && k.error.status === 404) {
|
|
2424
|
+
W = null, Ye(d, {
|
|
2425
|
+
matches: A.matches,
|
|
2426
|
+
loaderData: {},
|
|
2427
|
+
errors: {
|
|
2428
|
+
[B]: k.error
|
|
2429
|
+
}
|
|
2430
|
+
});
|
|
2431
|
+
return;
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
N = A.matches || N, w = A.pendingActionResult, x = Ar(d, p.submission), i = !1, h.active = !1, R = Ct(e.history, R.url, R.signal);
|
|
2435
|
+
}
|
|
2436
|
+
let {
|
|
2437
|
+
shortCircuited: S,
|
|
2438
|
+
matches: j,
|
|
2439
|
+
loaderData: T,
|
|
2440
|
+
errors: M
|
|
2441
|
+
} = await or(R, d, N, h.active, x, p && p.submission, p && p.fetcherSubmission, p && p.replace, p && p.initialHydration === !0, i, w);
|
|
2442
|
+
S || (W = null, Ye(d, ee({
|
|
2443
|
+
matches: j || N
|
|
2444
|
+
}, Nn(w), {
|
|
2445
|
+
loaderData: T,
|
|
2446
|
+
errors: M
|
|
2447
|
+
})));
|
|
2448
|
+
}
|
|
2449
|
+
async function ir(s, d, p, g, x, N) {
|
|
2450
|
+
N === void 0 && (N = {}), Ve();
|
|
2451
|
+
let i = Wi(d, p);
|
|
2452
|
+
if (le({
|
|
2453
|
+
navigation: i
|
|
2454
|
+
}, {
|
|
2455
|
+
flushSync: N.flushSync === !0
|
|
2456
|
+
}), x) {
|
|
2457
|
+
let w = await ct(g, d.pathname, s.signal);
|
|
2458
|
+
if (w.type === "aborted")
|
|
2459
|
+
return {
|
|
2460
|
+
shortCircuited: !0
|
|
2461
|
+
};
|
|
2462
|
+
if (w.type === "error") {
|
|
2463
|
+
let {
|
|
2464
|
+
error: S,
|
|
2465
|
+
notFoundMatches: j,
|
|
2466
|
+
route: T
|
|
2467
|
+
} = Xe(d.pathname, w);
|
|
2468
|
+
return {
|
|
2469
|
+
matches: j,
|
|
2470
|
+
pendingActionResult: [T.id, {
|
|
2471
|
+
type: J.error,
|
|
2472
|
+
error: S
|
|
2473
|
+
}]
|
|
2474
|
+
};
|
|
2475
|
+
} else if (w.matches)
|
|
2476
|
+
g = w.matches;
|
|
2477
|
+
else {
|
|
2478
|
+
let {
|
|
2479
|
+
notFoundMatches: S,
|
|
2480
|
+
error: j,
|
|
2481
|
+
route: T
|
|
2482
|
+
} = Le(d.pathname);
|
|
2483
|
+
return {
|
|
2484
|
+
matches: S,
|
|
2485
|
+
pendingActionResult: [T.id, {
|
|
2486
|
+
type: J.error,
|
|
2487
|
+
error: j
|
|
2488
|
+
}]
|
|
2489
|
+
};
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
let h, R = qt(g, d);
|
|
2493
|
+
if (!R.route.action && !R.route.lazy)
|
|
2494
|
+
h = {
|
|
2495
|
+
type: J.error,
|
|
2496
|
+
error: ve(405, {
|
|
2497
|
+
method: s.method,
|
|
2498
|
+
pathname: d.pathname,
|
|
2499
|
+
routeId: R.route.id
|
|
2500
|
+
})
|
|
2501
|
+
};
|
|
2502
|
+
else if (h = (await Qe("action", s, [R], g))[0], s.signal.aborted)
|
|
2503
|
+
return {
|
|
2504
|
+
shortCircuited: !0
|
|
2505
|
+
};
|
|
2506
|
+
if (ht(h)) {
|
|
2507
|
+
let w;
|
|
2508
|
+
return N && N.replace != null ? w = N.replace : w = _n(h.response.headers.get("Location"), new URL(s.url), c) === b.location.pathname + b.location.search, await lt(s, h, {
|
|
2509
|
+
submission: p,
|
|
2510
|
+
replace: w
|
|
2511
|
+
}), {
|
|
2512
|
+
shortCircuited: !0
|
|
2513
|
+
};
|
|
2514
|
+
}
|
|
2515
|
+
if (ft(h))
|
|
2516
|
+
throw ve(400, {
|
|
2517
|
+
type: "defer-action"
|
|
2518
|
+
});
|
|
2519
|
+
if (Re(h)) {
|
|
2520
|
+
let w = Yt(g, R.route.id);
|
|
2521
|
+
return (N && N.replace) !== !0 && (oe = ie.Push), {
|
|
2522
|
+
matches: g,
|
|
2523
|
+
pendingActionResult: [w.route.id, h]
|
|
2524
|
+
};
|
|
2525
|
+
}
|
|
2526
|
+
return {
|
|
2527
|
+
matches: g,
|
|
2528
|
+
pendingActionResult: [R.route.id, h]
|
|
2529
|
+
};
|
|
2530
|
+
}
|
|
2531
|
+
async function or(s, d, p, g, x, N, i, h, R, w, S) {
|
|
2532
|
+
let j = x || Ar(d, N), T = N || i || An(j), M = !ne && (!l.v7_partialHydration || !R);
|
|
2533
|
+
if (g) {
|
|
2534
|
+
if (M) {
|
|
2535
|
+
let te = st(S);
|
|
2536
|
+
le(ee({
|
|
2537
|
+
navigation: j
|
|
2538
|
+
}, te !== void 0 ? {
|
|
2539
|
+
actionData: te
|
|
2540
|
+
} : {}), {
|
|
2541
|
+
flushSync: w
|
|
2542
|
+
});
|
|
2543
|
+
}
|
|
2544
|
+
let V = await ct(p, d.pathname, s.signal);
|
|
2545
|
+
if (V.type === "aborted")
|
|
2546
|
+
return {
|
|
2547
|
+
shortCircuited: !0
|
|
2548
|
+
};
|
|
2549
|
+
if (V.type === "error") {
|
|
2550
|
+
let {
|
|
2551
|
+
error: te,
|
|
2552
|
+
notFoundMatches: Ee,
|
|
2553
|
+
route: Q
|
|
2554
|
+
} = Xe(d.pathname, V);
|
|
2555
|
+
return {
|
|
2556
|
+
matches: Ee,
|
|
2557
|
+
loaderData: {},
|
|
2558
|
+
errors: {
|
|
2559
|
+
[Q.id]: te
|
|
2560
|
+
}
|
|
2561
|
+
};
|
|
2562
|
+
} else if (V.matches)
|
|
2563
|
+
p = V.matches;
|
|
2564
|
+
else {
|
|
2565
|
+
let {
|
|
2566
|
+
error: te,
|
|
2567
|
+
notFoundMatches: Ee,
|
|
2568
|
+
route: Q
|
|
2569
|
+
} = Le(d.pathname);
|
|
2570
|
+
return {
|
|
2571
|
+
matches: Ee,
|
|
2572
|
+
loaderData: {},
|
|
2573
|
+
errors: {
|
|
2574
|
+
[Q.id]: te
|
|
2575
|
+
}
|
|
2576
|
+
};
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
let A = f || o, [B, k] = xn(e.history, b, p, T, d, l.v7_partialHydration && R === !0, l.unstable_skipActionErrorRevalidation, X, we, it, Pe, ke, Se, A, c, S);
|
|
2580
|
+
if (ut((V) => !(p && p.some((te) => te.route.id === V)) || B && B.some((te) => te.route.id === V)), He = ++ot, B.length === 0 && k.length === 0) {
|
|
2581
|
+
let V = lr();
|
|
2582
|
+
return Ye(d, ee({
|
|
2583
|
+
matches: p,
|
|
2584
|
+
loaderData: {},
|
|
2585
|
+
// Commit pending error if we're short circuiting
|
|
2586
|
+
errors: S && Re(S[1]) ? {
|
|
2587
|
+
[S[0]]: S[1].error
|
|
2588
|
+
} : null
|
|
2589
|
+
}, Nn(S), V ? {
|
|
2590
|
+
fetchers: new Map(b.fetchers)
|
|
2591
|
+
} : {}), {
|
|
2592
|
+
flushSync: w
|
|
2593
|
+
}), {
|
|
2594
|
+
shortCircuited: !0
|
|
2595
|
+
};
|
|
2596
|
+
}
|
|
2597
|
+
if (M) {
|
|
2598
|
+
let V = {};
|
|
2599
|
+
if (!g) {
|
|
2600
|
+
V.navigation = j;
|
|
2601
|
+
let te = st(S);
|
|
2602
|
+
te !== void 0 && (V.actionData = te);
|
|
2603
|
+
}
|
|
2604
|
+
k.length > 0 && (V.fetchers = xr(k)), le(V, {
|
|
2605
|
+
flushSync: w
|
|
2606
|
+
});
|
|
2607
|
+
}
|
|
2608
|
+
k.forEach((V) => {
|
|
2609
|
+
Z.has(V.key) && Ne(V.key), V.controller && Z.set(V.key, V.controller);
|
|
2610
|
+
});
|
|
2611
|
+
let ue = () => k.forEach((V) => Ne(V.key));
|
|
2612
|
+
W && W.signal.addEventListener("abort", ue);
|
|
2613
|
+
let {
|
|
2614
|
+
loaderResults: he,
|
|
2615
|
+
fetcherResults: me
|
|
2616
|
+
} = await kt(b.matches, p, B, k, s);
|
|
2617
|
+
if (s.signal.aborted)
|
|
2618
|
+
return {
|
|
2619
|
+
shortCircuited: !0
|
|
2620
|
+
};
|
|
2621
|
+
W && W.signal.removeEventListener("abort", ue), k.forEach((V) => Z.delete(V.key));
|
|
2622
|
+
let ae = jn([...he, ...me]);
|
|
2623
|
+
if (ae) {
|
|
2624
|
+
if (ae.idx >= B.length) {
|
|
2625
|
+
let V = k[ae.idx - B.length].key;
|
|
2626
|
+
Se.add(V);
|
|
2627
|
+
}
|
|
2628
|
+
return await lt(s, ae.result, {
|
|
2629
|
+
replace: h
|
|
2630
|
+
}), {
|
|
2631
|
+
shortCircuited: !0
|
|
2632
|
+
};
|
|
2633
|
+
}
|
|
2634
|
+
let {
|
|
2635
|
+
loaderData: je,
|
|
2636
|
+
errors: De
|
|
2637
|
+
} = Tn(b, p, B, he, S, k, me, Be);
|
|
2638
|
+
Be.forEach((V, te) => {
|
|
2639
|
+
V.subscribe((Ee) => {
|
|
2640
|
+
(Ee || V.done) && Be.delete(te);
|
|
2641
|
+
});
|
|
2642
|
+
}), l.v7_partialHydration && R && b.errors && Object.entries(b.errors).filter((V) => {
|
|
2643
|
+
let [te] = V;
|
|
2644
|
+
return !B.some((Ee) => Ee.route.id === te);
|
|
2645
|
+
}).forEach((V) => {
|
|
2646
|
+
let [te, Ee] = V;
|
|
2647
|
+
De = Object.assign(De || {}, {
|
|
2648
|
+
[te]: Ee
|
|
2649
|
+
});
|
|
2650
|
+
});
|
|
2651
|
+
let St = lr(), vr = ur(He), mr = St || vr || k.length > 0;
|
|
2652
|
+
return ee({
|
|
2653
|
+
matches: p,
|
|
2654
|
+
loaderData: je,
|
|
2655
|
+
errors: De
|
|
2656
|
+
}, mr ? {
|
|
2657
|
+
fetchers: new Map(b.fetchers)
|
|
2658
|
+
} : {});
|
|
2659
|
+
}
|
|
2660
|
+
function st(s) {
|
|
2661
|
+
if (s && !Re(s[1]))
|
|
2662
|
+
return {
|
|
2663
|
+
[s[0]]: s[1].data
|
|
2664
|
+
};
|
|
2665
|
+
if (b.actionData)
|
|
2666
|
+
return Object.keys(b.actionData).length === 0 ? null : b.actionData;
|
|
2667
|
+
}
|
|
2668
|
+
function xr(s) {
|
|
2669
|
+
return s.forEach((d) => {
|
|
2670
|
+
let p = b.fetchers.get(d.key), g = Ht(void 0, p ? p.data : void 0);
|
|
2671
|
+
b.fetchers.set(d.key, g);
|
|
2672
|
+
}), new Map(b.fetchers);
|
|
2673
|
+
}
|
|
2674
|
+
function Pr(s, d, p, g) {
|
|
2675
|
+
if (n)
|
|
2676
|
+
throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");
|
|
2677
|
+
Z.has(s) && Ne(s);
|
|
2678
|
+
let x = (g && g.unstable_flushSync) === !0, N = f || o, i = tn(b.location, b.matches, c, l.v7_prependBasename, p, l.v7_relativeSplatPath, d, g == null ? void 0 : g.relative), h = dt(N, i, c), R = wt(h, N, i);
|
|
2679
|
+
if (R.active && R.matches && (h = R.matches), !h) {
|
|
2680
|
+
Ce(s, d, ve(404, {
|
|
2681
|
+
pathname: i
|
|
2682
|
+
}), {
|
|
2683
|
+
flushSync: x
|
|
2684
|
+
});
|
|
2685
|
+
return;
|
|
2686
|
+
}
|
|
2687
|
+
let {
|
|
2688
|
+
path: w,
|
|
2689
|
+
submission: S,
|
|
2690
|
+
error: j
|
|
2691
|
+
} = Dn(l.v7_normalizeFormMethod, !0, i, g);
|
|
2692
|
+
if (j) {
|
|
2693
|
+
Ce(s, d, j, {
|
|
2694
|
+
flushSync: x
|
|
2695
|
+
});
|
|
2696
|
+
return;
|
|
2697
|
+
}
|
|
2698
|
+
let T = qt(h, w);
|
|
2699
|
+
if (q = (g && g.preventScrollReset) === !0, S && Fe(S.formMethod)) {
|
|
2700
|
+
It(s, d, w, T, h, R.active, x, S);
|
|
2701
|
+
return;
|
|
2702
|
+
}
|
|
2703
|
+
ke.set(s, {
|
|
2704
|
+
routeId: d,
|
|
2705
|
+
path: w
|
|
2706
|
+
}), Or(s, d, w, T, h, R.active, x, S);
|
|
2707
|
+
}
|
|
2708
|
+
async function It(s, d, p, g, x, N, i, h) {
|
|
2709
|
+
Ve(), ke.delete(s);
|
|
2710
|
+
function R(Q) {
|
|
2711
|
+
if (!Q.route.action && !Q.route.lazy) {
|
|
2712
|
+
let We = ve(405, {
|
|
2713
|
+
method: h.formMethod,
|
|
2714
|
+
pathname: p,
|
|
2715
|
+
routeId: d
|
|
2716
|
+
});
|
|
2717
|
+
return Ce(s, d, We, {
|
|
2718
|
+
flushSync: i
|
|
2719
|
+
}), !0;
|
|
2720
|
+
}
|
|
2721
|
+
return !1;
|
|
2722
|
+
}
|
|
2723
|
+
if (!N && R(g))
|
|
2724
|
+
return;
|
|
2725
|
+
let w = b.fetchers.get(s);
|
|
2726
|
+
Me(s, zi(h, w), {
|
|
2727
|
+
flushSync: i
|
|
2728
|
+
});
|
|
2729
|
+
let S = new AbortController(), j = Ct(e.history, p, S.signal, h);
|
|
2730
|
+
if (N) {
|
|
2731
|
+
let Q = await ct(x, p, j.signal);
|
|
2732
|
+
if (Q.type === "aborted")
|
|
2733
|
+
return;
|
|
2734
|
+
if (Q.type === "error") {
|
|
2735
|
+
let {
|
|
2736
|
+
error: We
|
|
2737
|
+
} = Xe(p, Q);
|
|
2738
|
+
Ce(s, d, We, {
|
|
2739
|
+
flushSync: i
|
|
2740
|
+
});
|
|
2741
|
+
return;
|
|
2742
|
+
} else if (Q.matches) {
|
|
2743
|
+
if (x = Q.matches, g = qt(x, p), R(g))
|
|
2744
|
+
return;
|
|
2745
|
+
} else {
|
|
2746
|
+
Ce(s, d, ve(404, {
|
|
2747
|
+
pathname: p
|
|
2748
|
+
}), {
|
|
2749
|
+
flushSync: i
|
|
2750
|
+
});
|
|
2751
|
+
return;
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
Z.set(s, S);
|
|
2755
|
+
let T = ot, A = (await Qe("action", j, [g], x))[0];
|
|
2756
|
+
if (j.signal.aborted) {
|
|
2757
|
+
Z.get(s) === S && Z.delete(s);
|
|
2758
|
+
return;
|
|
2759
|
+
}
|
|
2760
|
+
if (l.v7_fetcherPersist && Pe.has(s)) {
|
|
2761
|
+
if (ht(A) || Re(A)) {
|
|
2762
|
+
Me(s, Ze(void 0));
|
|
2763
|
+
return;
|
|
2764
|
+
}
|
|
2765
|
+
} else {
|
|
2766
|
+
if (ht(A))
|
|
2767
|
+
if (Z.delete(s), He > T) {
|
|
2768
|
+
Me(s, Ze(void 0));
|
|
2769
|
+
return;
|
|
2770
|
+
} else
|
|
2771
|
+
return Se.add(s), Me(s, Ht(h)), lt(j, A, {
|
|
2772
|
+
fetcherSubmission: h
|
|
2773
|
+
});
|
|
2774
|
+
if (Re(A)) {
|
|
2775
|
+
Ce(s, d, A.error);
|
|
2776
|
+
return;
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
if (ft(A))
|
|
2780
|
+
throw ve(400, {
|
|
2781
|
+
type: "defer-action"
|
|
2782
|
+
});
|
|
2783
|
+
let B = b.navigation.location || b.location, k = Ct(e.history, B, S.signal), ue = f || o, he = b.navigation.state !== "idle" ? dt(ue, b.navigation.location, c) : b.matches;
|
|
2784
|
+
U(he, "Didn't find any matches after fetcher action");
|
|
2785
|
+
let me = ++ot;
|
|
2786
|
+
Ie.set(s, me);
|
|
2787
|
+
let ae = Ht(h, A.data);
|
|
2788
|
+
b.fetchers.set(s, ae);
|
|
2789
|
+
let [je, De] = xn(e.history, b, he, h, B, !1, l.unstable_skipActionErrorRevalidation, X, we, it, Pe, ke, Se, ue, c, [g.route.id, A]);
|
|
2790
|
+
De.filter((Q) => Q.key !== s).forEach((Q) => {
|
|
2791
|
+
let We = Q.key, pn = b.fetchers.get(We), ba = Ht(void 0, pn ? pn.data : void 0);
|
|
2792
|
+
b.fetchers.set(We, ba), Z.has(We) && Ne(We), Q.controller && Z.set(We, Q.controller);
|
|
2793
|
+
}), le({
|
|
2794
|
+
fetchers: new Map(b.fetchers)
|
|
2795
|
+
});
|
|
2796
|
+
let St = () => De.forEach((Q) => Ne(Q.key));
|
|
2797
|
+
S.signal.addEventListener("abort", St);
|
|
2798
|
+
let {
|
|
2799
|
+
loaderResults: vr,
|
|
2800
|
+
fetcherResults: mr
|
|
2801
|
+
} = await kt(b.matches, he, je, De, k);
|
|
2802
|
+
if (S.signal.aborted)
|
|
2803
|
+
return;
|
|
2804
|
+
S.signal.removeEventListener("abort", St), Ie.delete(s), Z.delete(s), De.forEach((Q) => Z.delete(Q.key));
|
|
2805
|
+
let V = jn([...vr, ...mr]);
|
|
2806
|
+
if (V) {
|
|
2807
|
+
if (V.idx >= je.length) {
|
|
2808
|
+
let Q = De[V.idx - je.length].key;
|
|
2809
|
+
Se.add(Q);
|
|
2810
|
+
}
|
|
2811
|
+
return lt(k, V.result);
|
|
2812
|
+
}
|
|
2813
|
+
let {
|
|
2814
|
+
loaderData: te,
|
|
2815
|
+
errors: Ee
|
|
2816
|
+
} = Tn(b, b.matches, je, vr, void 0, De, mr, Be);
|
|
2817
|
+
if (b.fetchers.has(s)) {
|
|
2818
|
+
let Q = Ze(A.data);
|
|
2819
|
+
b.fetchers.set(s, Q);
|
|
2820
|
+
}
|
|
2821
|
+
ur(me), b.navigation.state === "loading" && me > He ? (U(oe, "Expected pending action"), W && W.abort(), Ye(b.navigation.location, {
|
|
2822
|
+
matches: he,
|
|
2823
|
+
loaderData: te,
|
|
2824
|
+
errors: Ee,
|
|
2825
|
+
fetchers: new Map(b.fetchers)
|
|
2826
|
+
})) : (le({
|
|
2827
|
+
errors: Ee,
|
|
2828
|
+
loaderData: Mn(b.loaderData, te, he, Ee),
|
|
2829
|
+
fetchers: new Map(b.fetchers)
|
|
2830
|
+
}), X = !1);
|
|
2831
|
+
}
|
|
2832
|
+
async function Or(s, d, p, g, x, N, i, h) {
|
|
2833
|
+
let R = b.fetchers.get(s);
|
|
2834
|
+
Me(s, Ht(h, R ? R.data : void 0), {
|
|
2835
|
+
flushSync: i
|
|
2836
|
+
});
|
|
2837
|
+
let w = new AbortController(), S = Ct(e.history, p, w.signal);
|
|
2838
|
+
if (N) {
|
|
2839
|
+
let A = await ct(x, p, S.signal);
|
|
2840
|
+
if (A.type === "aborted")
|
|
2841
|
+
return;
|
|
2842
|
+
if (A.type === "error") {
|
|
2843
|
+
let {
|
|
2844
|
+
error: B
|
|
2845
|
+
} = Xe(p, A);
|
|
2846
|
+
Ce(s, d, B, {
|
|
2847
|
+
flushSync: i
|
|
2848
|
+
});
|
|
2849
|
+
return;
|
|
2850
|
+
} else if (A.matches)
|
|
2851
|
+
x = A.matches, g = qt(x, p);
|
|
2852
|
+
else {
|
|
2853
|
+
Ce(s, d, ve(404, {
|
|
2854
|
+
pathname: p
|
|
2855
|
+
}), {
|
|
2856
|
+
flushSync: i
|
|
2857
|
+
});
|
|
2858
|
+
return;
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
Z.set(s, w);
|
|
2862
|
+
let j = ot, M = (await Qe("loader", S, [g], x))[0];
|
|
2863
|
+
if (ft(M) && (M = await fa(M, S.signal, !0) || M), Z.get(s) === w && Z.delete(s), !S.signal.aborted) {
|
|
2864
|
+
if (Pe.has(s)) {
|
|
2865
|
+
Me(s, Ze(void 0));
|
|
2866
|
+
return;
|
|
2867
|
+
}
|
|
2868
|
+
if (ht(M))
|
|
2869
|
+
if (He > j) {
|
|
2870
|
+
Me(s, Ze(void 0));
|
|
2871
|
+
return;
|
|
2872
|
+
} else {
|
|
2873
|
+
Se.add(s), await lt(S, M);
|
|
2874
|
+
return;
|
|
2875
|
+
}
|
|
2876
|
+
if (Re(M)) {
|
|
2877
|
+
Ce(s, d, M.error);
|
|
2878
|
+
return;
|
|
2879
|
+
}
|
|
2880
|
+
U(!ft(M), "Unhandled fetcher deferred data"), Me(s, Ze(M.data));
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
async function lt(s, d, p) {
|
|
2884
|
+
let {
|
|
2885
|
+
submission: g,
|
|
2886
|
+
fetcherSubmission: x,
|
|
2887
|
+
replace: N
|
|
2888
|
+
} = p === void 0 ? {} : p;
|
|
2889
|
+
d.response.headers.has("X-Remix-Revalidate") && (X = !0);
|
|
2890
|
+
let i = d.response.headers.get("Location");
|
|
2891
|
+
U(i, "Expected a Location header on the redirect Response"), i = _n(i, new URL(s.url), c);
|
|
2892
|
+
let h = Qt(b.location, i, {
|
|
2893
|
+
_isRedirect: !0
|
|
2894
|
+
});
|
|
2895
|
+
if (r) {
|
|
2896
|
+
let M = !1;
|
|
2897
|
+
if (d.response.headers.has("X-Remix-Reload-Document"))
|
|
2898
|
+
M = !0;
|
|
2899
|
+
else if (ln.test(i)) {
|
|
2900
|
+
const A = e.history.createURL(i);
|
|
2901
|
+
M = // Hard reload if it's an absolute URL to a new origin
|
|
2902
|
+
A.origin !== t.location.origin || // Hard reload if it's an absolute URL that does not match our basename
|
|
2903
|
+
rr(A.pathname, c) == null;
|
|
2904
|
+
}
|
|
2905
|
+
if (M) {
|
|
2906
|
+
N ? t.location.replace(i) : t.location.assign(i);
|
|
2907
|
+
return;
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
W = null;
|
|
2911
|
+
let R = N === !0 ? ie.Replace : ie.Push, {
|
|
2912
|
+
formMethod: w,
|
|
2913
|
+
formAction: S,
|
|
2914
|
+
formEncType: j
|
|
2915
|
+
} = b.navigation;
|
|
2916
|
+
!g && !x && w && S && j && (g = An(b.navigation));
|
|
2917
|
+
let T = g || x;
|
|
2918
|
+
if (Ci.has(d.response.status) && T && Fe(T.formMethod))
|
|
2919
|
+
await be(R, h, {
|
|
2920
|
+
submission: ee({}, T, {
|
|
2921
|
+
formAction: i
|
|
2922
|
+
}),
|
|
2923
|
+
// Preserve this flag across redirects
|
|
2924
|
+
preventScrollReset: q
|
|
2925
|
+
});
|
|
2926
|
+
else {
|
|
2927
|
+
let M = Ar(h, g);
|
|
2928
|
+
await be(R, h, {
|
|
2929
|
+
overrideNavigation: M,
|
|
2930
|
+
// Send fetcher submissions through for shouldRevalidate
|
|
2931
|
+
fetcherSubmission: x,
|
|
2932
|
+
// Preserve this flag across redirects
|
|
2933
|
+
preventScrollReset: q
|
|
2934
|
+
});
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
async function Qe(s, d, p, g) {
|
|
2938
|
+
try {
|
|
2939
|
+
let x = await Mi(y, s, d, p, g, u, a);
|
|
2940
|
+
return await Promise.all(x.map((N, i) => {
|
|
2941
|
+
if (ki(N)) {
|
|
2942
|
+
let h = N.result;
|
|
2943
|
+
return {
|
|
2944
|
+
type: J.redirect,
|
|
2945
|
+
response: ji(h, d, p[i].route.id, g, c, l.v7_relativeSplatPath)
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2948
|
+
return Li(N);
|
|
2949
|
+
}));
|
|
2950
|
+
} catch (x) {
|
|
2951
|
+
return p.map(() => ({
|
|
2952
|
+
type: J.error,
|
|
2953
|
+
error: x
|
|
2954
|
+
}));
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
async function kt(s, d, p, g, x) {
|
|
2958
|
+
let [N, ...i] = await Promise.all([p.length ? Qe("loader", x, p, d) : [], ...g.map((h) => {
|
|
2959
|
+
if (h.matches && h.match && h.controller) {
|
|
2960
|
+
let R = Ct(e.history, h.path, h.controller.signal);
|
|
2961
|
+
return Qe("loader", R, [h.match], h.matches).then((w) => w[0]);
|
|
2962
|
+
} else
|
|
2963
|
+
return Promise.resolve({
|
|
2964
|
+
type: J.error,
|
|
2965
|
+
error: ve(404, {
|
|
2966
|
+
pathname: h.path
|
|
2967
|
+
})
|
|
2968
|
+
});
|
|
2969
|
+
})]);
|
|
2970
|
+
return await Promise.all([Un(s, p, N, N.map(() => x.signal), !1, b.loaderData), Un(s, g.map((h) => h.match), i, g.map((h) => h.controller ? h.controller.signal : null), !0)]), {
|
|
2971
|
+
loaderResults: N,
|
|
2972
|
+
fetcherResults: i
|
|
2973
|
+
};
|
|
2974
|
+
}
|
|
2975
|
+
function Ve() {
|
|
2976
|
+
X = !0, we.push(...ut()), ke.forEach((s, d) => {
|
|
2977
|
+
Z.has(d) && (it.push(d), Ne(d));
|
|
2978
|
+
});
|
|
2979
|
+
}
|
|
2980
|
+
function Me(s, d, p) {
|
|
2981
|
+
p === void 0 && (p = {}), b.fetchers.set(s, d), le({
|
|
2982
|
+
fetchers: new Map(b.fetchers)
|
|
2983
|
+
}, {
|
|
2984
|
+
flushSync: (p && p.flushSync) === !0
|
|
2985
|
+
});
|
|
2986
|
+
}
|
|
2987
|
+
function Ce(s, d, p, g) {
|
|
2988
|
+
g === void 0 && (g = {});
|
|
2989
|
+
let x = Yt(b.matches, d);
|
|
2990
|
+
Je(s), le({
|
|
2991
|
+
errors: {
|
|
2992
|
+
[x.route.id]: p
|
|
2993
|
+
},
|
|
2994
|
+
fetchers: new Map(b.fetchers)
|
|
2995
|
+
}, {
|
|
2996
|
+
flushSync: (g && g.flushSync) === !0
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
function Bt(s) {
|
|
3000
|
+
return l.v7_fetcherPersist && (Ke.set(s, (Ke.get(s) || 0) + 1), Pe.has(s) && Pe.delete(s)), b.fetchers.get(s) || Di;
|
|
3001
|
+
}
|
|
3002
|
+
function Je(s) {
|
|
3003
|
+
let d = b.fetchers.get(s);
|
|
3004
|
+
Z.has(s) && !(d && d.state === "loading" && Ie.has(s)) && Ne(s), ke.delete(s), Ie.delete(s), Se.delete(s), Pe.delete(s), b.fetchers.delete(s);
|
|
3005
|
+
}
|
|
3006
|
+
function _r(s) {
|
|
3007
|
+
if (l.v7_fetcherPersist) {
|
|
3008
|
+
let d = (Ke.get(s) || 0) - 1;
|
|
3009
|
+
d <= 0 ? (Ke.delete(s), Pe.add(s)) : Ke.set(s, d);
|
|
3010
|
+
} else
|
|
3011
|
+
Je(s);
|
|
3012
|
+
le({
|
|
3013
|
+
fetchers: new Map(b.fetchers)
|
|
3014
|
+
});
|
|
3015
|
+
}
|
|
3016
|
+
function Ne(s) {
|
|
3017
|
+
let d = Z.get(s);
|
|
3018
|
+
U(d, "Expected fetch controller: " + s), d.abort(), Z.delete(s);
|
|
3019
|
+
}
|
|
3020
|
+
function sr(s) {
|
|
3021
|
+
for (let d of s) {
|
|
3022
|
+
let p = Bt(d), g = Ze(p.data);
|
|
3023
|
+
b.fetchers.set(d, g);
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
function lr() {
|
|
3027
|
+
let s = [], d = !1;
|
|
3028
|
+
for (let p of Se) {
|
|
3029
|
+
let g = b.fetchers.get(p);
|
|
3030
|
+
U(g, "Expected fetcher: " + p), g.state === "loading" && (Se.delete(p), s.push(p), d = !0);
|
|
3031
|
+
}
|
|
3032
|
+
return sr(s), d;
|
|
3033
|
+
}
|
|
3034
|
+
function ur(s) {
|
|
3035
|
+
let d = [];
|
|
3036
|
+
for (let [p, g] of Ie)
|
|
3037
|
+
if (g < s) {
|
|
3038
|
+
let x = b.fetchers.get(p);
|
|
3039
|
+
U(x, "Expected fetcher: " + p), x.state === "loading" && (Ne(p), Ie.delete(p), d.push(p));
|
|
3040
|
+
}
|
|
3041
|
+
return sr(d), d.length > 0;
|
|
3042
|
+
}
|
|
3043
|
+
function Fr(s, d) {
|
|
3044
|
+
let p = b.blockers.get(s) || $t;
|
|
3045
|
+
return Oe.get(s) !== d && Oe.set(s, d), p;
|
|
3046
|
+
}
|
|
3047
|
+
function cr(s) {
|
|
3048
|
+
b.blockers.delete(s), Oe.delete(s);
|
|
3049
|
+
}
|
|
3050
|
+
function Ge(s, d) {
|
|
3051
|
+
let p = b.blockers.get(s) || $t;
|
|
3052
|
+
U(p.state === "unblocked" && d.state === "blocked" || p.state === "blocked" && d.state === "blocked" || p.state === "blocked" && d.state === "proceeding" || p.state === "blocked" && d.state === "unblocked" || p.state === "proceeding" && d.state === "unblocked", "Invalid blocker state transition: " + p.state + " -> " + d.state);
|
|
3053
|
+
let g = new Map(b.blockers);
|
|
3054
|
+
g.set(s, d), le({
|
|
3055
|
+
blockers: g
|
|
3056
|
+
});
|
|
3057
|
+
}
|
|
3058
|
+
function Vt(s) {
|
|
3059
|
+
let {
|
|
3060
|
+
currentLocation: d,
|
|
3061
|
+
nextLocation: p,
|
|
3062
|
+
historyAction: g
|
|
3063
|
+
} = s;
|
|
3064
|
+
if (Oe.size === 0)
|
|
3065
|
+
return;
|
|
3066
|
+
Oe.size > 1 && fe(!1, "A router only supports one blocker at a time");
|
|
3067
|
+
let x = Array.from(Oe.entries()), [N, i] = x[x.length - 1], h = b.blockers.get(N);
|
|
3068
|
+
if (!(h && h.state === "proceeding") && i({
|
|
3069
|
+
currentLocation: d,
|
|
3070
|
+
nextLocation: p,
|
|
3071
|
+
historyAction: g
|
|
3072
|
+
}))
|
|
3073
|
+
return N;
|
|
3074
|
+
}
|
|
3075
|
+
function Le(s) {
|
|
3076
|
+
let d = ve(404, {
|
|
3077
|
+
pathname: s
|
|
3078
|
+
}), p = f || o, {
|
|
3079
|
+
matches: g,
|
|
3080
|
+
route: x
|
|
3081
|
+
} = Ln(p);
|
|
3082
|
+
return ut(), {
|
|
3083
|
+
notFoundMatches: g,
|
|
3084
|
+
route: x,
|
|
3085
|
+
error: d
|
|
3086
|
+
};
|
|
3087
|
+
}
|
|
3088
|
+
function Xe(s, d) {
|
|
3089
|
+
let p = d.partialMatches, g = p[p.length - 1].route, x = ve(400, {
|
|
3090
|
+
type: "route-discovery",
|
|
3091
|
+
routeId: g.id,
|
|
3092
|
+
pathname: s,
|
|
3093
|
+
message: d.error != null && "message" in d.error ? d.error : String(d.error)
|
|
3094
|
+
});
|
|
3095
|
+
return {
|
|
3096
|
+
notFoundMatches: p,
|
|
3097
|
+
route: g,
|
|
3098
|
+
error: x
|
|
3099
|
+
};
|
|
3100
|
+
}
|
|
3101
|
+
function ut(s) {
|
|
3102
|
+
let d = [];
|
|
3103
|
+
return Be.forEach((p, g) => {
|
|
3104
|
+
(!s || s(g)) && (p.cancel(), d.push(g), Be.delete(g));
|
|
3105
|
+
}), d;
|
|
3106
|
+
}
|
|
3107
|
+
function dr(s, d, p) {
|
|
3108
|
+
if (F = s, L = d, C = p || null, !_ && b.navigation === Ur) {
|
|
3109
|
+
_ = !0;
|
|
3110
|
+
let g = pr(b.location, b.matches);
|
|
3111
|
+
g != null && le({
|
|
3112
|
+
restoreScrollPosition: g
|
|
3113
|
+
});
|
|
3114
|
+
}
|
|
3115
|
+
return () => {
|
|
3116
|
+
F = null, L = null, C = null;
|
|
3117
|
+
};
|
|
3118
|
+
}
|
|
3119
|
+
function fr(s, d) {
|
|
3120
|
+
return C && C(s, d.map((g) => ri(g, b.loaderData))) || s.key;
|
|
3121
|
+
}
|
|
3122
|
+
function hr(s, d) {
|
|
3123
|
+
if (F && L) {
|
|
3124
|
+
let p = fr(s, d);
|
|
3125
|
+
F[p] = L();
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
function pr(s, d) {
|
|
3129
|
+
if (F) {
|
|
3130
|
+
let p = fr(s, d), g = F[p];
|
|
3131
|
+
if (typeof g == "number")
|
|
3132
|
+
return g;
|
|
3133
|
+
}
|
|
3134
|
+
return null;
|
|
3135
|
+
}
|
|
3136
|
+
function wt(s, d, p) {
|
|
3137
|
+
if (m)
|
|
3138
|
+
if (s) {
|
|
3139
|
+
let g = s[s.length - 1].route;
|
|
3140
|
+
if (g.path && (g.path === "*" || g.path.endsWith("/*")))
|
|
3141
|
+
return {
|
|
3142
|
+
active: !0,
|
|
3143
|
+
matches: gr(d, p, c, !0)
|
|
3144
|
+
};
|
|
3145
|
+
} else
|
|
3146
|
+
return {
|
|
3147
|
+
active: !0,
|
|
3148
|
+
matches: gr(d, p, c, !0) || []
|
|
3149
|
+
};
|
|
3150
|
+
return {
|
|
3151
|
+
active: !1,
|
|
3152
|
+
matches: null
|
|
3153
|
+
};
|
|
3154
|
+
}
|
|
3155
|
+
async function ct(s, d, p) {
|
|
3156
|
+
let g = s, x = g.length > 0 ? g[g.length - 1].route : null;
|
|
3157
|
+
for (; ; ) {
|
|
3158
|
+
let N = f == null, i = f || o;
|
|
3159
|
+
try {
|
|
3160
|
+
await Fi(m, d, g, i, u, a, Ut, p);
|
|
3161
|
+
} catch (S) {
|
|
3162
|
+
return {
|
|
3163
|
+
type: "error",
|
|
3164
|
+
error: S,
|
|
3165
|
+
partialMatches: g
|
|
3166
|
+
};
|
|
3167
|
+
} finally {
|
|
3168
|
+
N && (o = [...o]);
|
|
3169
|
+
}
|
|
3170
|
+
if (p.aborted)
|
|
3171
|
+
return {
|
|
3172
|
+
type: "aborted"
|
|
3173
|
+
};
|
|
3174
|
+
let h = dt(i, d, c), R = !1;
|
|
3175
|
+
if (h) {
|
|
3176
|
+
let S = h[h.length - 1].route;
|
|
3177
|
+
if (S.index)
|
|
3178
|
+
return {
|
|
3179
|
+
type: "success",
|
|
3180
|
+
matches: h
|
|
3181
|
+
};
|
|
3182
|
+
if (S.path && S.path.length > 0)
|
|
3183
|
+
if (S.path === "*")
|
|
3184
|
+
R = !0;
|
|
3185
|
+
else
|
|
3186
|
+
return {
|
|
3187
|
+
type: "success",
|
|
3188
|
+
matches: h
|
|
3189
|
+
};
|
|
3190
|
+
}
|
|
3191
|
+
let w = gr(i, d, c, !0);
|
|
3192
|
+
if (!w || g.map((S) => S.route.id).join("-") === w.map((S) => S.route.id).join("-"))
|
|
3193
|
+
return {
|
|
3194
|
+
type: "success",
|
|
3195
|
+
matches: R ? h : null
|
|
3196
|
+
};
|
|
3197
|
+
if (g = w, x = g[g.length - 1].route, x.path === "*")
|
|
3198
|
+
return {
|
|
3199
|
+
type: "success",
|
|
3200
|
+
matches: g
|
|
3201
|
+
};
|
|
3202
|
+
}
|
|
3203
|
+
}
|
|
3204
|
+
function Tr(s) {
|
|
3205
|
+
u = {}, f = Jt(s, a, void 0, u);
|
|
3206
|
+
}
|
|
3207
|
+
function Mr(s, d) {
|
|
3208
|
+
let p = f == null;
|
|
3209
|
+
ua(s, d, f || o, u, a), p && (o = [...o], le({}));
|
|
3210
|
+
}
|
|
3211
|
+
return re = {
|
|
3212
|
+
get basename() {
|
|
3213
|
+
return c;
|
|
3214
|
+
},
|
|
3215
|
+
get future() {
|
|
3216
|
+
return l;
|
|
3217
|
+
},
|
|
3218
|
+
get state() {
|
|
3219
|
+
return b;
|
|
3220
|
+
},
|
|
3221
|
+
get routes() {
|
|
3222
|
+
return o;
|
|
3223
|
+
},
|
|
3224
|
+
get window() {
|
|
3225
|
+
return t;
|
|
3226
|
+
},
|
|
3227
|
+
initialize: At,
|
|
3228
|
+
subscribe: Dr,
|
|
3229
|
+
enableScrollRestoration: dr,
|
|
3230
|
+
navigate: ar,
|
|
3231
|
+
fetch: Pr,
|
|
3232
|
+
revalidate: Rt,
|
|
3233
|
+
// Passthrough to history-aware createHref used by useHref so we get proper
|
|
3234
|
+
// hash-aware URLs in DOM paths
|
|
3235
|
+
createHref: (s) => e.history.createHref(s),
|
|
3236
|
+
encodeLocation: (s) => e.history.encodeLocation(s),
|
|
3237
|
+
getFetcher: Bt,
|
|
3238
|
+
deleteFetcher: _r,
|
|
3239
|
+
dispose: Et,
|
|
3240
|
+
getBlocker: Fr,
|
|
3241
|
+
deleteBlocker: cr,
|
|
3242
|
+
patchRoutes: Mr,
|
|
3243
|
+
_internalFetchControllers: Z,
|
|
3244
|
+
_internalActiveDeferreds: Be,
|
|
3245
|
+
// TODO: Remove setRoutes, it's temporary to avoid dealing with
|
|
3246
|
+
// updating the tree while validating the update algorithm.
|
|
3247
|
+
_internalSetRoutes: Tr
|
|
3248
|
+
}, re;
|
|
3249
|
+
}
|
|
3250
|
+
function Pi(e) {
|
|
3251
|
+
return e != null && ("formData" in e && e.formData != null || "body" in e && e.body !== void 0);
|
|
3252
|
+
}
|
|
3253
|
+
function tn(e, t, r, n, a, u, o, f) {
|
|
3254
|
+
let c, y;
|
|
3255
|
+
if (o) {
|
|
3256
|
+
c = [];
|
|
3257
|
+
for (let l of t)
|
|
3258
|
+
if (c.push(l), l.route.id === o) {
|
|
3259
|
+
y = l;
|
|
3260
|
+
break;
|
|
3261
|
+
}
|
|
3262
|
+
} else
|
|
3263
|
+
c = t, y = t[t.length - 1];
|
|
3264
|
+
let m = Rr(a || ".", Er(c, u), rr(e.pathname, r) || e.pathname, f === "path");
|
|
3265
|
+
return a == null && (m.search = e.search, m.hash = e.hash), (a == null || a === "" || a === ".") && y && y.route.index && !un(m.search) && (m.search = m.search ? m.search.replace(/^\?/, "?index&") : "?index"), n && r !== "/" && (m.pathname = m.pathname === "/" ? r : $e([r, m.pathname])), tr(m);
|
|
3266
|
+
}
|
|
3267
|
+
function Dn(e, t, r, n) {
|
|
3268
|
+
if (!n || !Pi(n))
|
|
3269
|
+
return {
|
|
3270
|
+
path: r
|
|
3271
|
+
};
|
|
3272
|
+
if (n.formMethod && !Vi(n.formMethod))
|
|
3273
|
+
return {
|
|
3274
|
+
path: r,
|
|
3275
|
+
error: ve(405, {
|
|
3276
|
+
method: n.formMethod
|
|
3277
|
+
})
|
|
3278
|
+
};
|
|
3279
|
+
let a = () => ({
|
|
3280
|
+
path: r,
|
|
3281
|
+
error: ve(400, {
|
|
3282
|
+
type: "invalid-body"
|
|
3283
|
+
})
|
|
3284
|
+
}), u = n.formMethod || "get", o = e ? u.toUpperCase() : u.toLowerCase(), f = ca(r);
|
|
3285
|
+
if (n.body !== void 0) {
|
|
3286
|
+
if (n.formEncType === "text/plain") {
|
|
3287
|
+
if (!Fe(o))
|
|
3288
|
+
return a();
|
|
3289
|
+
let v = typeof n.body == "string" ? n.body : n.body instanceof FormData || n.body instanceof URLSearchParams ? (
|
|
3290
|
+
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data
|
|
3291
|
+
Array.from(n.body.entries()).reduce((O, F) => {
|
|
3292
|
+
let [C, L] = F;
|
|
3293
|
+
return "" + O + C + "=" + L + `
|
|
3294
|
+
`;
|
|
3295
|
+
}, "")
|
|
3296
|
+
) : String(n.body);
|
|
3297
|
+
return {
|
|
3298
|
+
path: r,
|
|
3299
|
+
submission: {
|
|
3300
|
+
formMethod: o,
|
|
3301
|
+
formAction: f,
|
|
3302
|
+
formEncType: n.formEncType,
|
|
3303
|
+
formData: void 0,
|
|
3304
|
+
json: void 0,
|
|
3305
|
+
text: v
|
|
3306
|
+
}
|
|
3307
|
+
};
|
|
3308
|
+
} else if (n.formEncType === "application/json") {
|
|
3309
|
+
if (!Fe(o))
|
|
3310
|
+
return a();
|
|
3311
|
+
try {
|
|
3312
|
+
let v = typeof n.body == "string" ? JSON.parse(n.body) : n.body;
|
|
3313
|
+
return {
|
|
3314
|
+
path: r,
|
|
3315
|
+
submission: {
|
|
3316
|
+
formMethod: o,
|
|
3317
|
+
formAction: f,
|
|
3318
|
+
formEncType: n.formEncType,
|
|
3319
|
+
formData: void 0,
|
|
3320
|
+
json: v,
|
|
3321
|
+
text: void 0
|
|
3322
|
+
}
|
|
3323
|
+
};
|
|
3324
|
+
} catch {
|
|
3325
|
+
return a();
|
|
3326
|
+
}
|
|
3327
|
+
}
|
|
3328
|
+
}
|
|
3329
|
+
U(typeof FormData == "function", "FormData is not available in this environment");
|
|
3330
|
+
let c, y;
|
|
3331
|
+
if (n.formData)
|
|
3332
|
+
c = rn(n.formData), y = n.formData;
|
|
3333
|
+
else if (n.body instanceof FormData)
|
|
3334
|
+
c = rn(n.body), y = n.body;
|
|
3335
|
+
else if (n.body instanceof URLSearchParams)
|
|
3336
|
+
c = n.body, y = Fn(c);
|
|
3337
|
+
else if (n.body == null)
|
|
3338
|
+
c = new URLSearchParams(), y = new FormData();
|
|
3339
|
+
else
|
|
3340
|
+
try {
|
|
3341
|
+
c = new URLSearchParams(n.body), y = Fn(c);
|
|
3342
|
+
} catch {
|
|
3343
|
+
return a();
|
|
3344
|
+
}
|
|
3345
|
+
let m = {
|
|
3346
|
+
formMethod: o,
|
|
3347
|
+
formAction: f,
|
|
3348
|
+
formEncType: n && n.formEncType || "application/x-www-form-urlencoded",
|
|
3349
|
+
formData: y,
|
|
3350
|
+
json: void 0,
|
|
3351
|
+
text: void 0
|
|
3352
|
+
};
|
|
3353
|
+
if (Fe(m.formMethod))
|
|
3354
|
+
return {
|
|
3355
|
+
path: r,
|
|
3356
|
+
submission: m
|
|
3357
|
+
};
|
|
3358
|
+
let l = nt(r);
|
|
3359
|
+
return t && l.search && un(l.search) && c.append("index", ""), l.search = "?" + c, {
|
|
3360
|
+
path: tr(l),
|
|
3361
|
+
submission: m
|
|
3362
|
+
};
|
|
3363
|
+
}
|
|
3364
|
+
function Oi(e, t) {
|
|
3365
|
+
let r = e;
|
|
3366
|
+
if (t) {
|
|
3367
|
+
let n = e.findIndex((a) => a.route.id === t);
|
|
3368
|
+
n >= 0 && (r = e.slice(0, n));
|
|
3369
|
+
}
|
|
3370
|
+
return r;
|
|
3371
|
+
}
|
|
3372
|
+
function xn(e, t, r, n, a, u, o, f, c, y, m, l, v, O, F, C) {
|
|
3373
|
+
let L = C ? Re(C[1]) ? C[1].error : C[1].data : void 0, _ = e.createURL(t.location), P = e.createURL(a), $ = C && Re(C[1]) ? C[0] : void 0, G = $ ? Oi(r, $) : r, re = C ? C[1].statusCode : void 0, b = o && re && re >= 400, oe = G.filter((W, ce) => {
|
|
3374
|
+
let {
|
|
3375
|
+
route: se
|
|
3376
|
+
} = W;
|
|
3377
|
+
if (se.lazy)
|
|
3378
|
+
return !0;
|
|
3379
|
+
if (se.loader == null)
|
|
3380
|
+
return !1;
|
|
3381
|
+
if (u)
|
|
3382
|
+
return typeof se.loader != "function" || se.loader.hydrate ? !0 : t.loaderData[se.id] === void 0 && // Don't re-run if the loader ran and threw an error
|
|
3383
|
+
(!t.errors || t.errors[se.id] === void 0);
|
|
3384
|
+
if (_i(t.loaderData, t.matches[ce], W) || c.some((X) => X === W.route.id))
|
|
3385
|
+
return !0;
|
|
3386
|
+
let ge = t.matches[ce], ne = W;
|
|
3387
|
+
return Pn(W, ee({
|
|
3388
|
+
currentUrl: _,
|
|
3389
|
+
currentParams: ge.params,
|
|
3390
|
+
nextUrl: P,
|
|
3391
|
+
nextParams: ne.params
|
|
3392
|
+
}, n, {
|
|
3393
|
+
actionResult: L,
|
|
3394
|
+
unstable_actionStatus: re,
|
|
3395
|
+
defaultShouldRevalidate: b ? !1 : (
|
|
3396
|
+
// Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate
|
|
3397
|
+
f || _.pathname + _.search === P.pathname + P.search || // Search params affect all loaders
|
|
3398
|
+
_.search !== P.search || la(ge, ne)
|
|
3399
|
+
)
|
|
3400
|
+
}));
|
|
3401
|
+
}), q = [];
|
|
3402
|
+
return l.forEach((W, ce) => {
|
|
3403
|
+
if (u || !r.some((we) => we.route.id === W.routeId) || m.has(ce))
|
|
3404
|
+
return;
|
|
3405
|
+
let se = dt(O, W.path, F);
|
|
3406
|
+
if (!se) {
|
|
3407
|
+
q.push({
|
|
3408
|
+
key: ce,
|
|
3409
|
+
routeId: W.routeId,
|
|
3410
|
+
path: W.path,
|
|
3411
|
+
matches: null,
|
|
3412
|
+
match: null,
|
|
3413
|
+
controller: null
|
|
3414
|
+
});
|
|
3415
|
+
return;
|
|
3416
|
+
}
|
|
3417
|
+
let ge = t.fetchers.get(ce), ne = qt(se, W.path), X = !1;
|
|
3418
|
+
v.has(ce) ? X = !1 : y.includes(ce) ? X = !0 : ge && ge.state !== "idle" && ge.data === void 0 ? X = f : X = Pn(ne, ee({
|
|
3419
|
+
currentUrl: _,
|
|
3420
|
+
currentParams: t.matches[t.matches.length - 1].params,
|
|
3421
|
+
nextUrl: P,
|
|
3422
|
+
nextParams: r[r.length - 1].params
|
|
3423
|
+
}, n, {
|
|
3424
|
+
actionResult: L,
|
|
3425
|
+
unstable_actionStatus: re,
|
|
3426
|
+
defaultShouldRevalidate: b ? !1 : f
|
|
3427
|
+
})), X && q.push({
|
|
3428
|
+
key: ce,
|
|
3429
|
+
routeId: W.routeId,
|
|
3430
|
+
path: W.path,
|
|
3431
|
+
matches: se,
|
|
3432
|
+
match: ne,
|
|
3433
|
+
controller: new AbortController()
|
|
3434
|
+
});
|
|
3435
|
+
}), [oe, q];
|
|
3436
|
+
}
|
|
3437
|
+
function _i(e, t, r) {
|
|
3438
|
+
let n = (
|
|
3439
|
+
// [a] -> [a, b]
|
|
3440
|
+
!t || // [a, b] -> [a, c]
|
|
3441
|
+
r.route.id !== t.route.id
|
|
3442
|
+
), a = e[r.route.id] === void 0;
|
|
3443
|
+
return n || a;
|
|
3444
|
+
}
|
|
3445
|
+
function la(e, t) {
|
|
3446
|
+
let r = e.route.path;
|
|
3447
|
+
return (
|
|
3448
|
+
// param change for this match, /users/123 -> /users/456
|
|
3449
|
+
e.pathname !== t.pathname || // splat param changed, which is not present in match.path
|
|
3450
|
+
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
3451
|
+
r != null && r.endsWith("*") && e.params["*"] !== t.params["*"]
|
|
3452
|
+
);
|
|
3453
|
+
}
|
|
3454
|
+
function Pn(e, t) {
|
|
3455
|
+
if (e.route.shouldRevalidate) {
|
|
3456
|
+
let r = e.route.shouldRevalidate(t);
|
|
3457
|
+
if (typeof r == "boolean")
|
|
3458
|
+
return r;
|
|
3459
|
+
}
|
|
3460
|
+
return t.defaultShouldRevalidate;
|
|
3461
|
+
}
|
|
3462
|
+
async function Fi(e, t, r, n, a, u, o, f) {
|
|
3463
|
+
let c = [t, ...r.map((y) => y.route.id)].join("-");
|
|
3464
|
+
try {
|
|
3465
|
+
let y = o.get(c);
|
|
3466
|
+
y || (y = e({
|
|
3467
|
+
path: t,
|
|
3468
|
+
matches: r,
|
|
3469
|
+
patch: (m, l) => {
|
|
3470
|
+
f.aborted || ua(m, l, n, a, u);
|
|
3471
|
+
}
|
|
3472
|
+
}), o.set(c, y)), y && Ii(y) && await y;
|
|
3473
|
+
} finally {
|
|
3474
|
+
o.delete(c);
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3477
|
+
function ua(e, t, r, n, a) {
|
|
3478
|
+
if (e) {
|
|
3479
|
+
var u;
|
|
3480
|
+
let o = n[e];
|
|
3481
|
+
U(o, "No route found to patch children into: routeId = " + e);
|
|
3482
|
+
let f = Jt(t, a, [e, "patch", String(((u = o.children) == null ? void 0 : u.length) || "0")], n);
|
|
3483
|
+
o.children ? o.children.push(...f) : o.children = f;
|
|
3484
|
+
} else {
|
|
3485
|
+
let o = Jt(t, a, ["patch", String(r.length || "0")], n);
|
|
3486
|
+
r.push(...o);
|
|
3487
|
+
}
|
|
3488
|
+
}
|
|
3489
|
+
async function On(e, t, r) {
|
|
3490
|
+
if (!e.lazy)
|
|
3491
|
+
return;
|
|
3492
|
+
let n = await e.lazy();
|
|
3493
|
+
if (!e.lazy)
|
|
3494
|
+
return;
|
|
3495
|
+
let a = r[e.id];
|
|
3496
|
+
U(a, "No route found in manifest");
|
|
3497
|
+
let u = {};
|
|
3498
|
+
for (let o in n) {
|
|
3499
|
+
let c = a[o] !== void 0 && // This property isn't static since it should always be updated based
|
|
3500
|
+
// on the route updates
|
|
3501
|
+
o !== "hasErrorBoundary";
|
|
3502
|
+
fe(!c, 'Route "' + a.id + '" has a static property "' + o + '" defined but its lazy function is also returning a value for this property. ' + ('The lazy route property "' + o + '" will be ignored.')), !c && !ei.has(o) && (u[o] = n[o]);
|
|
3503
|
+
}
|
|
3504
|
+
Object.assign(a, u), Object.assign(a, ee({}, t(a), {
|
|
3505
|
+
lazy: void 0
|
|
3506
|
+
}));
|
|
3507
|
+
}
|
|
3508
|
+
function Ti(e) {
|
|
3509
|
+
return Promise.all(e.matches.map((t) => t.resolve()));
|
|
3510
|
+
}
|
|
3511
|
+
async function Mi(e, t, r, n, a, u, o, f) {
|
|
3512
|
+
let c = n.reduce((l, v) => l.add(v.route.id), /* @__PURE__ */ new Set()), y = /* @__PURE__ */ new Set(), m = await e({
|
|
3513
|
+
matches: a.map((l) => {
|
|
3514
|
+
let v = c.has(l.route.id);
|
|
3515
|
+
return ee({}, l, {
|
|
3516
|
+
shouldLoad: v,
|
|
3517
|
+
resolve: (F) => (y.add(l.route.id), v ? Ni(t, r, l, u, o, F, f) : Promise.resolve({
|
|
3518
|
+
type: J.data,
|
|
3519
|
+
result: void 0
|
|
3520
|
+
}))
|
|
3521
|
+
});
|
|
3522
|
+
}),
|
|
3523
|
+
request: r,
|
|
3524
|
+
params: a[0].params,
|
|
3525
|
+
context: f
|
|
3526
|
+
});
|
|
3527
|
+
return a.forEach((l) => U(y.has(l.route.id), '`match.resolve()` was not called for route id "' + l.route.id + '". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')), m.filter((l, v) => c.has(a[v].route.id));
|
|
3528
|
+
}
|
|
3529
|
+
async function Ni(e, t, r, n, a, u, o) {
|
|
3530
|
+
let f, c, y = (m) => {
|
|
3531
|
+
let l, v = new Promise((C, L) => l = L);
|
|
3532
|
+
c = () => l(), t.signal.addEventListener("abort", c);
|
|
3533
|
+
let O = (C) => typeof m != "function" ? Promise.reject(new Error("You cannot call the handler for a route which defines a boolean " + ('"' + e + '" [routeId: ' + r.route.id + "]"))) : m({
|
|
3534
|
+
request: t,
|
|
3535
|
+
params: r.params,
|
|
3536
|
+
context: o
|
|
3537
|
+
}, ...C !== void 0 ? [C] : []), F;
|
|
3538
|
+
return u ? F = u((C) => O(C)) : F = (async () => {
|
|
3539
|
+
try {
|
|
3540
|
+
return {
|
|
3541
|
+
type: "data",
|
|
3542
|
+
result: await O()
|
|
3543
|
+
};
|
|
3544
|
+
} catch (C) {
|
|
3545
|
+
return {
|
|
3546
|
+
type: "error",
|
|
3547
|
+
result: C
|
|
3548
|
+
};
|
|
3549
|
+
}
|
|
3550
|
+
})(), Promise.race([F, v]);
|
|
3551
|
+
};
|
|
3552
|
+
try {
|
|
3553
|
+
let m = r.route[e];
|
|
3554
|
+
if (r.route.lazy)
|
|
3555
|
+
if (m) {
|
|
3556
|
+
let l, [v] = await Promise.all([
|
|
3557
|
+
// If the handler throws, don't let it immediately bubble out,
|
|
3558
|
+
// since we need to let the lazy() execution finish so we know if this
|
|
3559
|
+
// route has a boundary that can handle the error
|
|
3560
|
+
y(m).catch((O) => {
|
|
3561
|
+
l = O;
|
|
3562
|
+
}),
|
|
3563
|
+
On(r.route, a, n)
|
|
3564
|
+
]);
|
|
3565
|
+
if (l !== void 0)
|
|
3566
|
+
throw l;
|
|
3567
|
+
f = v;
|
|
3568
|
+
} else if (await On(r.route, a, n), m = r.route[e], m)
|
|
3569
|
+
f = await y(m);
|
|
3570
|
+
else if (e === "action") {
|
|
3571
|
+
let l = new URL(t.url), v = l.pathname + l.search;
|
|
3572
|
+
throw ve(405, {
|
|
3573
|
+
method: t.method,
|
|
3574
|
+
pathname: v,
|
|
3575
|
+
routeId: r.route.id
|
|
3576
|
+
});
|
|
3577
|
+
} else
|
|
3578
|
+
return {
|
|
3579
|
+
type: J.data,
|
|
3580
|
+
result: void 0
|
|
3581
|
+
};
|
|
3582
|
+
else if (m)
|
|
3583
|
+
f = await y(m);
|
|
3584
|
+
else {
|
|
3585
|
+
let l = new URL(t.url), v = l.pathname + l.search;
|
|
3586
|
+
throw ve(404, {
|
|
3587
|
+
pathname: v
|
|
3588
|
+
});
|
|
3589
|
+
}
|
|
3590
|
+
U(f.result !== void 0, "You defined " + (e === "action" ? "an action" : "a loader") + " for route " + ('"' + r.route.id + "\" but didn't return anything from your `" + e + "` ") + "function. Please return a value or `null`.");
|
|
3591
|
+
} catch (m) {
|
|
3592
|
+
return {
|
|
3593
|
+
type: J.error,
|
|
3594
|
+
result: m
|
|
3595
|
+
};
|
|
3596
|
+
} finally {
|
|
3597
|
+
c && t.signal.removeEventListener("abort", c);
|
|
3598
|
+
}
|
|
3599
|
+
return f;
|
|
3600
|
+
}
|
|
3601
|
+
async function Li(e) {
|
|
3602
|
+
let {
|
|
3603
|
+
result: t,
|
|
3604
|
+
type: r,
|
|
3605
|
+
status: n
|
|
3606
|
+
} = e;
|
|
3607
|
+
if (da(t)) {
|
|
3608
|
+
let o;
|
|
3609
|
+
try {
|
|
3610
|
+
let f = t.headers.get("Content-Type");
|
|
3611
|
+
f && /\bapplication\/json\b/.test(f) ? t.body == null ? o = null : o = await t.json() : o = await t.text();
|
|
3612
|
+
} catch (f) {
|
|
3613
|
+
return {
|
|
3614
|
+
type: J.error,
|
|
3615
|
+
error: f
|
|
3616
|
+
};
|
|
3617
|
+
}
|
|
3618
|
+
return r === J.error ? {
|
|
3619
|
+
type: J.error,
|
|
3620
|
+
error: new ia(t.status, t.statusText, o),
|
|
3621
|
+
statusCode: t.status,
|
|
3622
|
+
headers: t.headers
|
|
3623
|
+
} : {
|
|
3624
|
+
type: J.data,
|
|
3625
|
+
data: o,
|
|
3626
|
+
statusCode: t.status,
|
|
3627
|
+
headers: t.headers
|
|
3628
|
+
};
|
|
3629
|
+
}
|
|
3630
|
+
if (r === J.error)
|
|
3631
|
+
return {
|
|
3632
|
+
type: J.error,
|
|
3633
|
+
error: t,
|
|
3634
|
+
statusCode: wr(t) ? t.status : n
|
|
3635
|
+
};
|
|
3636
|
+
if (Bi(t)) {
|
|
3637
|
+
var a, u;
|
|
3638
|
+
return {
|
|
3639
|
+
type: J.deferred,
|
|
3640
|
+
deferredData: t,
|
|
3641
|
+
statusCode: (a = t.init) == null ? void 0 : a.status,
|
|
3642
|
+
headers: ((u = t.init) == null ? void 0 : u.headers) && new Headers(t.init.headers)
|
|
3643
|
+
};
|
|
3644
|
+
}
|
|
3645
|
+
return {
|
|
3646
|
+
type: J.data,
|
|
3647
|
+
data: t,
|
|
3648
|
+
statusCode: n
|
|
3649
|
+
};
|
|
3650
|
+
}
|
|
3651
|
+
function ji(e, t, r, n, a, u) {
|
|
3652
|
+
let o = e.headers.get("Location");
|
|
3653
|
+
if (U(o, "Redirects returned/thrown from loaders/actions must have a Location header"), !ln.test(o)) {
|
|
3654
|
+
let f = n.slice(0, n.findIndex((c) => c.route.id === r) + 1);
|
|
3655
|
+
o = tn(new URL(t.url), f, a, !0, o, u), e.headers.set("Location", o);
|
|
3656
|
+
}
|
|
3657
|
+
return e;
|
|
3658
|
+
}
|
|
3659
|
+
function _n(e, t, r) {
|
|
3660
|
+
if (ln.test(e)) {
|
|
3661
|
+
let n = e, a = n.startsWith("//") ? new URL(t.protocol + n) : new URL(n), u = rr(a.pathname, r) != null;
|
|
3662
|
+
if (a.origin === t.origin && u)
|
|
3663
|
+
return a.pathname + a.search + a.hash;
|
|
3664
|
+
}
|
|
3665
|
+
return e;
|
|
3666
|
+
}
|
|
3667
|
+
function Ct(e, t, r, n) {
|
|
3668
|
+
let a = e.createURL(ca(t)).toString(), u = {
|
|
3669
|
+
signal: r
|
|
3670
|
+
};
|
|
3671
|
+
if (n && Fe(n.formMethod)) {
|
|
3672
|
+
let {
|
|
3673
|
+
formMethod: o,
|
|
3674
|
+
formEncType: f
|
|
3675
|
+
} = n;
|
|
3676
|
+
u.method = o.toUpperCase(), f === "application/json" ? (u.headers = new Headers({
|
|
3677
|
+
"Content-Type": f
|
|
3678
|
+
}), u.body = JSON.stringify(n.json)) : f === "text/plain" ? u.body = n.text : f === "application/x-www-form-urlencoded" && n.formData ? u.body = rn(n.formData) : u.body = n.formData;
|
|
3679
|
+
}
|
|
3680
|
+
return new Request(a, u);
|
|
3681
|
+
}
|
|
3682
|
+
function rn(e) {
|
|
3683
|
+
let t = new URLSearchParams();
|
|
3684
|
+
for (let [r, n] of e.entries())
|
|
3685
|
+
t.append(r, typeof n == "string" ? n : n.name);
|
|
3686
|
+
return t;
|
|
3687
|
+
}
|
|
3688
|
+
function Fn(e) {
|
|
3689
|
+
let t = new FormData();
|
|
3690
|
+
for (let [r, n] of e.entries())
|
|
3691
|
+
t.append(r, n);
|
|
3692
|
+
return t;
|
|
3693
|
+
}
|
|
3694
|
+
function Ui(e, t, r, n, a, u) {
|
|
3695
|
+
let o = {}, f = null, c, y = !1, m = {}, l = n && Re(n[1]) ? n[1].error : void 0;
|
|
3696
|
+
return r.forEach((v, O) => {
|
|
3697
|
+
let F = t[O].route.id;
|
|
3698
|
+
if (U(!ht(v), "Cannot handle redirect results in processLoaderData"), Re(v)) {
|
|
3699
|
+
let C = v.error;
|
|
3700
|
+
l !== void 0 && (C = l, l = void 0), f = f || {};
|
|
3701
|
+
{
|
|
3702
|
+
let L = Yt(e, F);
|
|
3703
|
+
f[L.route.id] == null && (f[L.route.id] = C);
|
|
3704
|
+
}
|
|
3705
|
+
o[F] = void 0, y || (y = !0, c = wr(v.error) ? v.error.status : 500), v.headers && (m[F] = v.headers);
|
|
3706
|
+
} else
|
|
3707
|
+
ft(v) ? (a.set(F, v.deferredData), o[F] = v.deferredData.data, v.statusCode != null && v.statusCode !== 200 && !y && (c = v.statusCode), v.headers && (m[F] = v.headers)) : (o[F] = v.data, v.statusCode && v.statusCode !== 200 && !y && (c = v.statusCode), v.headers && (m[F] = v.headers));
|
|
3708
|
+
}), l !== void 0 && n && (f = {
|
|
3709
|
+
[n[0]]: l
|
|
3710
|
+
}, o[n[0]] = void 0), {
|
|
3711
|
+
loaderData: o,
|
|
3712
|
+
errors: f,
|
|
3713
|
+
statusCode: c || 200,
|
|
3714
|
+
loaderHeaders: m
|
|
3715
|
+
};
|
|
3716
|
+
}
|
|
3717
|
+
function Tn(e, t, r, n, a, u, o, f) {
|
|
3718
|
+
let {
|
|
3719
|
+
loaderData: c,
|
|
3720
|
+
errors: y
|
|
3721
|
+
} = Ui(t, r, n, a, f);
|
|
3722
|
+
for (let m = 0; m < u.length; m++) {
|
|
3723
|
+
let {
|
|
3724
|
+
key: l,
|
|
3725
|
+
match: v,
|
|
3726
|
+
controller: O
|
|
3727
|
+
} = u[m];
|
|
3728
|
+
U(o !== void 0 && o[m] !== void 0, "Did not find corresponding fetcher result");
|
|
3729
|
+
let F = o[m];
|
|
3730
|
+
if (!(O && O.signal.aborted))
|
|
3731
|
+
if (Re(F)) {
|
|
3732
|
+
let C = Yt(e.matches, v == null ? void 0 : v.route.id);
|
|
3733
|
+
y && y[C.route.id] || (y = ee({}, y, {
|
|
3734
|
+
[C.route.id]: F.error
|
|
3735
|
+
})), e.fetchers.delete(l);
|
|
3736
|
+
} else if (ht(F))
|
|
3737
|
+
U(!1, "Unhandled fetcher revalidation redirect");
|
|
3738
|
+
else if (ft(F))
|
|
3739
|
+
U(!1, "Unhandled fetcher deferred data");
|
|
3740
|
+
else {
|
|
3741
|
+
let C = Ze(F.data);
|
|
3742
|
+
e.fetchers.set(l, C);
|
|
3743
|
+
}
|
|
3744
|
+
}
|
|
3745
|
+
return {
|
|
3746
|
+
loaderData: c,
|
|
3747
|
+
errors: y
|
|
3748
|
+
};
|
|
3749
|
+
}
|
|
3750
|
+
function Mn(e, t, r, n) {
|
|
3751
|
+
let a = ee({}, t);
|
|
3752
|
+
for (let u of r) {
|
|
3753
|
+
let o = u.route.id;
|
|
3754
|
+
if (t.hasOwnProperty(o) ? t[o] !== void 0 && (a[o] = t[o]) : e[o] !== void 0 && u.route.loader && (a[o] = e[o]), n && n.hasOwnProperty(o))
|
|
3755
|
+
break;
|
|
3756
|
+
}
|
|
3757
|
+
return a;
|
|
3758
|
+
}
|
|
3759
|
+
function Nn(e) {
|
|
3760
|
+
return e ? Re(e[1]) ? {
|
|
3761
|
+
// Clear out prior actionData on errors
|
|
3762
|
+
actionData: {}
|
|
3763
|
+
} : {
|
|
3764
|
+
actionData: {
|
|
3765
|
+
[e[0]]: e[1].data
|
|
3766
|
+
}
|
|
3767
|
+
} : {};
|
|
3768
|
+
}
|
|
3769
|
+
function Yt(e, t) {
|
|
3770
|
+
return (t ? e.slice(0, e.findIndex((n) => n.route.id === t) + 1) : [...e]).reverse().find((n) => n.route.hasErrorBoundary === !0) || e[0];
|
|
3771
|
+
}
|
|
3772
|
+
function Ln(e) {
|
|
3773
|
+
let t = e.length === 1 ? e[0] : e.find((r) => r.index || !r.path || r.path === "/") || {
|
|
3774
|
+
id: "__shim-error-route__"
|
|
3775
|
+
};
|
|
3776
|
+
return {
|
|
3777
|
+
matches: [{
|
|
3778
|
+
params: {},
|
|
3779
|
+
pathname: "",
|
|
3780
|
+
pathnameBase: "",
|
|
3781
|
+
route: t
|
|
3782
|
+
}],
|
|
3783
|
+
route: t
|
|
3784
|
+
};
|
|
3785
|
+
}
|
|
3786
|
+
function ve(e, t) {
|
|
3787
|
+
let {
|
|
3788
|
+
pathname: r,
|
|
3789
|
+
routeId: n,
|
|
3790
|
+
method: a,
|
|
3791
|
+
type: u,
|
|
3792
|
+
message: o
|
|
3793
|
+
} = t === void 0 ? {} : t, f = "Unknown Server Error", c = "Unknown @remix-run/router error";
|
|
3794
|
+
return e === 400 ? (f = "Bad Request", u === "route-discovery" ? c = 'Unable to match URL "' + r + '" - the `children()` function for ' + ("route `" + n + "` threw the following error:\n" + o) : a && r && n ? c = "You made a " + a + ' request to "' + r + '" but ' + ('did not provide a `loader` for route "' + n + '", ') + "so there is no way to handle the request." : u === "defer-action" ? c = "defer() is not supported in actions" : u === "invalid-body" && (c = "Unable to encode submission body")) : e === 403 ? (f = "Forbidden", c = 'Route "' + n + '" does not match URL "' + r + '"') : e === 404 ? (f = "Not Found", c = 'No route matches URL "' + r + '"') : e === 405 && (f = "Method Not Allowed", a && r && n ? c = "You made a " + a.toUpperCase() + ' request to "' + r + '" but ' + ('did not provide an `action` for route "' + n + '", ') + "so there is no way to handle the request." : a && (c = 'Invalid request method "' + a.toUpperCase() + '"')), new ia(e || 500, f, new Error(c), !0);
|
|
3795
|
+
}
|
|
3796
|
+
function jn(e) {
|
|
3797
|
+
for (let t = e.length - 1; t >= 0; t--) {
|
|
3798
|
+
let r = e[t];
|
|
3799
|
+
if (ht(r))
|
|
3800
|
+
return {
|
|
3801
|
+
result: r,
|
|
3802
|
+
idx: t
|
|
3803
|
+
};
|
|
3804
|
+
}
|
|
3805
|
+
}
|
|
3806
|
+
function ca(e) {
|
|
3807
|
+
let t = typeof e == "string" ? nt(e) : e;
|
|
3808
|
+
return tr(ee({}, t, {
|
|
3809
|
+
hash: ""
|
|
3810
|
+
}));
|
|
3811
|
+
}
|
|
3812
|
+
function Ai(e, t) {
|
|
3813
|
+
return e.pathname !== t.pathname || e.search !== t.search ? !1 : e.hash === "" ? t.hash !== "" : e.hash === t.hash ? !0 : t.hash !== "";
|
|
3814
|
+
}
|
|
3815
|
+
function Ii(e) {
|
|
3816
|
+
return typeof e == "object" && e != null && "then" in e;
|
|
3817
|
+
}
|
|
3818
|
+
function ki(e) {
|
|
3819
|
+
return da(e.result) && Si.has(e.result.status);
|
|
3820
|
+
}
|
|
3821
|
+
function ft(e) {
|
|
3822
|
+
return e.type === J.deferred;
|
|
3823
|
+
}
|
|
3824
|
+
function Re(e) {
|
|
3825
|
+
return e.type === J.error;
|
|
3826
|
+
}
|
|
3827
|
+
function ht(e) {
|
|
3828
|
+
return (e && e.type) === J.redirect;
|
|
3829
|
+
}
|
|
3830
|
+
function Bi(e) {
|
|
3831
|
+
let t = e;
|
|
3832
|
+
return t && typeof t == "object" && typeof t.data == "object" && typeof t.subscribe == "function" && typeof t.cancel == "function" && typeof t.resolveData == "function";
|
|
3833
|
+
}
|
|
3834
|
+
function da(e) {
|
|
3835
|
+
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.headers == "object" && typeof e.body < "u";
|
|
3836
|
+
}
|
|
3837
|
+
function Vi(e) {
|
|
3838
|
+
return wi.has(e.toLowerCase());
|
|
3839
|
+
}
|
|
3840
|
+
function Fe(e) {
|
|
3841
|
+
return Ei.has(e.toLowerCase());
|
|
3842
|
+
}
|
|
3843
|
+
async function Un(e, t, r, n, a, u) {
|
|
3844
|
+
for (let o = 0; o < r.length; o++) {
|
|
3845
|
+
let f = r[o], c = t[o];
|
|
3846
|
+
if (!c)
|
|
3847
|
+
continue;
|
|
3848
|
+
let y = e.find((l) => l.route.id === c.route.id), m = y != null && !la(y, c) && (u && u[c.route.id]) !== void 0;
|
|
3849
|
+
if (ft(f) && (a || m)) {
|
|
3850
|
+
let l = n[o];
|
|
3851
|
+
U(l, "Expected an AbortSignal for revalidating fetcher deferred result"), await fa(f, l, a).then((v) => {
|
|
3852
|
+
v && (r[o] = v || r[o]);
|
|
3853
|
+
});
|
|
3854
|
+
}
|
|
3855
|
+
}
|
|
3856
|
+
}
|
|
3857
|
+
async function fa(e, t, r) {
|
|
3858
|
+
if (r === void 0 && (r = !1), !await e.deferredData.resolveData(t)) {
|
|
3859
|
+
if (r)
|
|
3860
|
+
try {
|
|
3861
|
+
return {
|
|
3862
|
+
type: J.data,
|
|
3863
|
+
data: e.deferredData.unwrappedData
|
|
3864
|
+
};
|
|
3865
|
+
} catch (a) {
|
|
3866
|
+
return {
|
|
3867
|
+
type: J.error,
|
|
3868
|
+
error: a
|
|
3869
|
+
};
|
|
3870
|
+
}
|
|
3871
|
+
return {
|
|
3872
|
+
type: J.data,
|
|
3873
|
+
data: e.deferredData.data
|
|
3874
|
+
};
|
|
3875
|
+
}
|
|
3876
|
+
}
|
|
3877
|
+
function un(e) {
|
|
3878
|
+
return new URLSearchParams(e).getAll("index").some((t) => t === "");
|
|
3879
|
+
}
|
|
3880
|
+
function qt(e, t) {
|
|
3881
|
+
let r = typeof t == "string" ? nt(t).search : t.search;
|
|
3882
|
+
if (e[e.length - 1].route.index && un(r || ""))
|
|
3883
|
+
return e[e.length - 1];
|
|
3884
|
+
let n = aa(e);
|
|
3885
|
+
return n[n.length - 1];
|
|
3886
|
+
}
|
|
3887
|
+
function An(e) {
|
|
3888
|
+
let {
|
|
3889
|
+
formMethod: t,
|
|
3890
|
+
formAction: r,
|
|
3891
|
+
formEncType: n,
|
|
3892
|
+
text: a,
|
|
3893
|
+
formData: u,
|
|
3894
|
+
json: o
|
|
3895
|
+
} = e;
|
|
3896
|
+
if (!(!t || !r || !n)) {
|
|
3897
|
+
if (a != null)
|
|
3898
|
+
return {
|
|
3899
|
+
formMethod: t,
|
|
3900
|
+
formAction: r,
|
|
3901
|
+
formEncType: n,
|
|
3902
|
+
formData: void 0,
|
|
3903
|
+
json: void 0,
|
|
3904
|
+
text: a
|
|
3905
|
+
};
|
|
3906
|
+
if (u != null)
|
|
3907
|
+
return {
|
|
3908
|
+
formMethod: t,
|
|
3909
|
+
formAction: r,
|
|
3910
|
+
formEncType: n,
|
|
3911
|
+
formData: u,
|
|
3912
|
+
json: void 0,
|
|
3913
|
+
text: void 0
|
|
3914
|
+
};
|
|
3915
|
+
if (o !== void 0)
|
|
3916
|
+
return {
|
|
3917
|
+
formMethod: t,
|
|
3918
|
+
formAction: r,
|
|
3919
|
+
formEncType: n,
|
|
3920
|
+
formData: void 0,
|
|
3921
|
+
json: o,
|
|
3922
|
+
text: void 0
|
|
3923
|
+
};
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
function Ar(e, t) {
|
|
3927
|
+
return t ? {
|
|
3928
|
+
state: "loading",
|
|
3929
|
+
location: e,
|
|
3930
|
+
formMethod: t.formMethod,
|
|
3931
|
+
formAction: t.formAction,
|
|
3932
|
+
formEncType: t.formEncType,
|
|
3933
|
+
formData: t.formData,
|
|
3934
|
+
json: t.json,
|
|
3935
|
+
text: t.text
|
|
3936
|
+
} : {
|
|
3937
|
+
state: "loading",
|
|
3938
|
+
location: e,
|
|
3939
|
+
formMethod: void 0,
|
|
3940
|
+
formAction: void 0,
|
|
3941
|
+
formEncType: void 0,
|
|
3942
|
+
formData: void 0,
|
|
3943
|
+
json: void 0,
|
|
3944
|
+
text: void 0
|
|
3945
|
+
};
|
|
3946
|
+
}
|
|
3947
|
+
function Wi(e, t) {
|
|
3948
|
+
return {
|
|
3949
|
+
state: "submitting",
|
|
3950
|
+
location: e,
|
|
3951
|
+
formMethod: t.formMethod,
|
|
3952
|
+
formAction: t.formAction,
|
|
3953
|
+
formEncType: t.formEncType,
|
|
3954
|
+
formData: t.formData,
|
|
3955
|
+
json: t.json,
|
|
3956
|
+
text: t.text
|
|
3957
|
+
};
|
|
3958
|
+
}
|
|
3959
|
+
function Ht(e, t) {
|
|
3960
|
+
return e ? {
|
|
3961
|
+
state: "loading",
|
|
3962
|
+
formMethod: e.formMethod,
|
|
3963
|
+
formAction: e.formAction,
|
|
3964
|
+
formEncType: e.formEncType,
|
|
3965
|
+
formData: e.formData,
|
|
3966
|
+
json: e.json,
|
|
3967
|
+
text: e.text,
|
|
3968
|
+
data: t
|
|
3969
|
+
} : {
|
|
3970
|
+
state: "loading",
|
|
3971
|
+
formMethod: void 0,
|
|
3972
|
+
formAction: void 0,
|
|
3973
|
+
formEncType: void 0,
|
|
3974
|
+
formData: void 0,
|
|
3975
|
+
json: void 0,
|
|
3976
|
+
text: void 0,
|
|
3977
|
+
data: t
|
|
3978
|
+
};
|
|
3979
|
+
}
|
|
3980
|
+
function zi(e, t) {
|
|
3981
|
+
return {
|
|
3982
|
+
state: "submitting",
|
|
3983
|
+
formMethod: e.formMethod,
|
|
3984
|
+
formAction: e.formAction,
|
|
3985
|
+
formEncType: e.formEncType,
|
|
3986
|
+
formData: e.formData,
|
|
3987
|
+
json: e.json,
|
|
3988
|
+
text: e.text,
|
|
3989
|
+
data: t ? t.data : void 0
|
|
3990
|
+
};
|
|
3991
|
+
}
|
|
3992
|
+
function Ze(e) {
|
|
3993
|
+
return {
|
|
3994
|
+
state: "idle",
|
|
3995
|
+
formMethod: void 0,
|
|
3996
|
+
formAction: void 0,
|
|
3997
|
+
formEncType: void 0,
|
|
3998
|
+
formData: void 0,
|
|
3999
|
+
json: void 0,
|
|
4000
|
+
text: void 0,
|
|
4001
|
+
data: e
|
|
4002
|
+
};
|
|
4003
|
+
}
|
|
4004
|
+
function $i(e, t) {
|
|
4005
|
+
try {
|
|
4006
|
+
let r = e.sessionStorage.getItem(sa);
|
|
4007
|
+
if (r) {
|
|
4008
|
+
let n = JSON.parse(r);
|
|
4009
|
+
for (let [a, u] of Object.entries(n || {}))
|
|
4010
|
+
u && Array.isArray(u) && t.set(a, new Set(u || []));
|
|
4011
|
+
}
|
|
4012
|
+
} catch {
|
|
4013
|
+
}
|
|
4014
|
+
}
|
|
4015
|
+
function Hi(e, t) {
|
|
4016
|
+
if (t.size > 0) {
|
|
4017
|
+
let r = {};
|
|
4018
|
+
for (let [n, a] of t)
|
|
4019
|
+
r[n] = [...a];
|
|
4020
|
+
try {
|
|
4021
|
+
e.sessionStorage.setItem(sa, JSON.stringify(r));
|
|
4022
|
+
} catch (n) {
|
|
4023
|
+
fe(!1, "Failed to save applied view transitions in sessionStorage (" + n + ").");
|
|
4024
|
+
}
|
|
4025
|
+
}
|
|
4026
|
+
}
|
|
4027
|
+
/**
|
|
4028
|
+
* React Router v6.24.1
|
|
4029
|
+
*
|
|
4030
|
+
* Copyright (c) Remix Software Inc.
|
|
4031
|
+
*
|
|
4032
|
+
* This source code is licensed under the MIT license found in the
|
|
4033
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
4034
|
+
*
|
|
4035
|
+
* @license MIT
|
|
4036
|
+
*/
|
|
4037
|
+
function br() {
|
|
4038
|
+
return br = Object.assign ? Object.assign.bind() : function(e) {
|
|
4039
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
4040
|
+
var r = arguments[t];
|
|
4041
|
+
for (var n in r)
|
|
4042
|
+
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
4043
|
+
}
|
|
4044
|
+
return e;
|
|
4045
|
+
}, br.apply(this, arguments);
|
|
4046
|
+
}
|
|
4047
|
+
const Sr = /* @__PURE__ */ D.createContext(null);
|
|
4048
|
+
process.env.NODE_ENV !== "production" && (Sr.displayName = "DataRouter");
|
|
4049
|
+
const ha = /* @__PURE__ */ D.createContext(null);
|
|
4050
|
+
process.env.NODE_ENV !== "production" && (ha.displayName = "DataRouterState");
|
|
4051
|
+
const Ki = /* @__PURE__ */ D.createContext(null);
|
|
4052
|
+
process.env.NODE_ENV !== "production" && (Ki.displayName = "Await");
|
|
4053
|
+
const at = /* @__PURE__ */ D.createContext(null);
|
|
4054
|
+
process.env.NODE_ENV !== "production" && (at.displayName = "Navigation");
|
|
4055
|
+
const Cr = /* @__PURE__ */ D.createContext(null);
|
|
4056
|
+
process.env.NODE_ENV !== "production" && (Cr.displayName = "Location");
|
|
4057
|
+
const Ae = /* @__PURE__ */ D.createContext({
|
|
4058
|
+
outlet: null,
|
|
4059
|
+
matches: [],
|
|
4060
|
+
isDataRoute: !1
|
|
4061
|
+
});
|
|
4062
|
+
process.env.NODE_ENV !== "production" && (Ae.displayName = "Route");
|
|
4063
|
+
const cn = /* @__PURE__ */ D.createContext(null);
|
|
4064
|
+
process.env.NODE_ENV !== "production" && (cn.displayName = "RouteError");
|
|
4065
|
+
function Do(e, t) {
|
|
4066
|
+
let {
|
|
4067
|
+
relative: r
|
|
4068
|
+
} = t === void 0 ? {} : t;
|
|
4069
|
+
jt() || (process.env.NODE_ENV !== "production" ? U(
|
|
4070
|
+
!1,
|
|
4071
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
4072
|
+
// router loaded. We can help them understand how to avoid that.
|
|
4073
|
+
"useHref() may be used only in the context of a <Router> component."
|
|
4074
|
+
) : U(!1));
|
|
4075
|
+
let {
|
|
4076
|
+
basename: n,
|
|
4077
|
+
navigator: a
|
|
4078
|
+
} = D.useContext(at), {
|
|
4079
|
+
hash: u,
|
|
4080
|
+
pathname: o,
|
|
4081
|
+
search: f
|
|
4082
|
+
} = Gi(e, {
|
|
4083
|
+
relative: r
|
|
4084
|
+
}), c = o;
|
|
4085
|
+
return n !== "/" && (c = o === "/" ? n : $e([n, o])), a.createHref({
|
|
4086
|
+
pathname: c,
|
|
4087
|
+
search: f,
|
|
4088
|
+
hash: u
|
|
4089
|
+
});
|
|
4090
|
+
}
|
|
4091
|
+
function jt() {
|
|
4092
|
+
return D.useContext(Cr) != null;
|
|
4093
|
+
}
|
|
4094
|
+
function nr() {
|
|
4095
|
+
return jt() || (process.env.NODE_ENV !== "production" ? U(
|
|
4096
|
+
!1,
|
|
4097
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
4098
|
+
// router loaded. We can help them understand how to avoid that.
|
|
4099
|
+
"useLocation() may be used only in the context of a <Router> component."
|
|
4100
|
+
) : U(!1)), D.useContext(Cr).location;
|
|
4101
|
+
}
|
|
4102
|
+
const pa = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
4103
|
+
function va(e) {
|
|
4104
|
+
D.useContext(at).static || D.useLayoutEffect(e);
|
|
4105
|
+
}
|
|
4106
|
+
function qi() {
|
|
4107
|
+
let {
|
|
4108
|
+
isDataRoute: e
|
|
4109
|
+
} = D.useContext(Ae);
|
|
4110
|
+
return e ? so() : Yi();
|
|
4111
|
+
}
|
|
4112
|
+
function Yi() {
|
|
4113
|
+
jt() || (process.env.NODE_ENV !== "production" ? U(
|
|
4114
|
+
!1,
|
|
4115
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
4116
|
+
// router loaded. We can help them understand how to avoid that.
|
|
4117
|
+
"useNavigate() may be used only in the context of a <Router> component."
|
|
4118
|
+
) : U(!1));
|
|
4119
|
+
let e = D.useContext(Sr), {
|
|
4120
|
+
basename: t,
|
|
4121
|
+
future: r,
|
|
4122
|
+
navigator: n
|
|
4123
|
+
} = D.useContext(at), {
|
|
4124
|
+
matches: a
|
|
4125
|
+
} = D.useContext(Ae), {
|
|
4126
|
+
pathname: u
|
|
4127
|
+
} = nr(), o = JSON.stringify(Er(a, r.v7_relativeSplatPath)), f = D.useRef(!1);
|
|
4128
|
+
return va(() => {
|
|
4129
|
+
f.current = !0;
|
|
4130
|
+
}), D.useCallback(function(y, m) {
|
|
4131
|
+
if (m === void 0 && (m = {}), process.env.NODE_ENV !== "production" && fe(f.current, pa), !f.current) return;
|
|
4132
|
+
if (typeof y == "number") {
|
|
4133
|
+
n.go(y);
|
|
4134
|
+
return;
|
|
4135
|
+
}
|
|
4136
|
+
let l = Rr(y, JSON.parse(o), u, m.relative === "path");
|
|
4137
|
+
e == null && t !== "/" && (l.pathname = l.pathname === "/" ? t : $e([t, l.pathname])), (m.replace ? n.replace : n.push)(l, m.state, m);
|
|
4138
|
+
}, [t, n, o, u, e]);
|
|
4139
|
+
}
|
|
4140
|
+
const Qi = /* @__PURE__ */ D.createContext(null);
|
|
4141
|
+
function Ji(e) {
|
|
4142
|
+
let t = D.useContext(Ae).outlet;
|
|
4143
|
+
return t && /* @__PURE__ */ D.createElement(Qi.Provider, {
|
|
4144
|
+
value: e
|
|
4145
|
+
}, t);
|
|
4146
|
+
}
|
|
4147
|
+
function Gi(e, t) {
|
|
4148
|
+
let {
|
|
4149
|
+
relative: r
|
|
4150
|
+
} = t === void 0 ? {} : t, {
|
|
4151
|
+
future: n
|
|
4152
|
+
} = D.useContext(at), {
|
|
4153
|
+
matches: a
|
|
4154
|
+
} = D.useContext(Ae), {
|
|
4155
|
+
pathname: u
|
|
4156
|
+
} = nr(), o = JSON.stringify(Er(a, n.v7_relativeSplatPath));
|
|
4157
|
+
return D.useMemo(() => Rr(e, JSON.parse(o), u, r === "path"), [e, o, u, r]);
|
|
4158
|
+
}
|
|
4159
|
+
function xo(e, t, r, n) {
|
|
4160
|
+
jt() || (process.env.NODE_ENV !== "production" ? U(
|
|
4161
|
+
!1,
|
|
4162
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
4163
|
+
// router loaded. We can help them understand how to avoid that.
|
|
4164
|
+
"useRoutes() may be used only in the context of a <Router> component."
|
|
4165
|
+
) : U(!1));
|
|
4166
|
+
let {
|
|
4167
|
+
navigator: a
|
|
4168
|
+
} = D.useContext(at), {
|
|
4169
|
+
matches: u
|
|
4170
|
+
} = D.useContext(Ae), o = u[u.length - 1], f = o ? o.params : {}, c = o ? o.pathname : "/", y = o ? o.pathnameBase : "/", m = o && o.route;
|
|
4171
|
+
if (process.env.NODE_ENV !== "production") {
|
|
4172
|
+
let _ = m && m.path || "";
|
|
4173
|
+
ya(c, !m || _.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ('"' + c + '" (under <Route path="' + _ + '">) 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.
|
|
4174
|
+
|
|
4175
|
+
` + ('Please change the parent <Route path="' + _ + '"> to <Route ') + ('path="' + (_ === "/" ? "*" : _ + "/*") + '">.'));
|
|
4176
|
+
}
|
|
4177
|
+
let l = nr(), v;
|
|
4178
|
+
v = l;
|
|
4179
|
+
let O = v.pathname || "/", F = O;
|
|
4180
|
+
if (y !== "/") {
|
|
4181
|
+
let _ = y.replace(/^\//, "").split("/");
|
|
4182
|
+
F = "/" + O.replace(/^\//, "").split("/").slice(_.length).join("/");
|
|
4183
|
+
}
|
|
4184
|
+
let C = dt(e, {
|
|
4185
|
+
pathname: F
|
|
4186
|
+
});
|
|
4187
|
+
return process.env.NODE_ENV !== "production" && (process.env.NODE_ENV !== "production" && fe(m || C != null, 'No routes matched location "' + v.pathname + v.search + v.hash + '" '), process.env.NODE_ENV !== "production" && fe(C == null || C[C.length - 1].route.element !== void 0 || C[C.length - 1].route.Component !== void 0 || C[C.length - 1].route.lazy !== void 0, 'Matched leaf route at location "' + v.pathname + v.search + v.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.')), ro(C && C.map((_) => Object.assign({}, _, {
|
|
4188
|
+
params: Object.assign({}, f, _.params),
|
|
4189
|
+
pathname: $e([
|
|
4190
|
+
y,
|
|
4191
|
+
// Re-encode pathnames that were decoded inside matchRoutes
|
|
4192
|
+
a.encodeLocation ? a.encodeLocation(_.pathname).pathname : _.pathname
|
|
4193
|
+
]),
|
|
4194
|
+
pathnameBase: _.pathnameBase === "/" ? y : $e([
|
|
4195
|
+
y,
|
|
4196
|
+
// Re-encode pathnames that were decoded inside matchRoutes
|
|
4197
|
+
a.encodeLocation ? a.encodeLocation(_.pathnameBase).pathname : _.pathnameBase
|
|
4198
|
+
])
|
|
4199
|
+
})), u, r, n);
|
|
4200
|
+
}
|
|
4201
|
+
function Xi() {
|
|
4202
|
+
let e = oo(), t = wr(e) ? e.status + " " + e.statusText : e instanceof Error ? e.message : JSON.stringify(e), r = e instanceof Error ? e.stack : null, n = "rgba(200,200,200, 0.5)", a = {
|
|
4203
|
+
padding: "0.5rem",
|
|
4204
|
+
backgroundColor: n
|
|
4205
|
+
}, u = {
|
|
4206
|
+
padding: "2px 4px",
|
|
4207
|
+
backgroundColor: n
|
|
4208
|
+
}, o = null;
|
|
4209
|
+
return process.env.NODE_ENV !== "production" && (console.error("Error handled by React Router default ErrorBoundary:", e), o = /* @__PURE__ */ D.createElement(D.Fragment, null, /* @__PURE__ */ D.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ D.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ D.createElement("code", {
|
|
4210
|
+
style: u
|
|
4211
|
+
}, "ErrorBoundary"), " or", " ", /* @__PURE__ */ D.createElement("code", {
|
|
4212
|
+
style: u
|
|
4213
|
+
}, "errorElement"), " prop on your route."))), /* @__PURE__ */ D.createElement(D.Fragment, null, /* @__PURE__ */ D.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ D.createElement("h3", {
|
|
4214
|
+
style: {
|
|
4215
|
+
fontStyle: "italic"
|
|
4216
|
+
}
|
|
4217
|
+
}, t), r ? /* @__PURE__ */ D.createElement("pre", {
|
|
4218
|
+
style: a
|
|
4219
|
+
}, r) : null, o);
|
|
4220
|
+
}
|
|
4221
|
+
const Zi = /* @__PURE__ */ D.createElement(Xi, null);
|
|
4222
|
+
class eo extends D.Component {
|
|
4223
|
+
constructor(t) {
|
|
4224
|
+
super(t), this.state = {
|
|
4225
|
+
location: t.location,
|
|
4226
|
+
revalidation: t.revalidation,
|
|
4227
|
+
error: t.error
|
|
4228
|
+
};
|
|
4229
|
+
}
|
|
4230
|
+
static getDerivedStateFromError(t) {
|
|
4231
|
+
return {
|
|
4232
|
+
error: t
|
|
4233
|
+
};
|
|
4234
|
+
}
|
|
4235
|
+
static getDerivedStateFromProps(t, r) {
|
|
4236
|
+
return r.location !== t.location || r.revalidation !== "idle" && t.revalidation === "idle" ? {
|
|
4237
|
+
error: t.error,
|
|
4238
|
+
location: t.location,
|
|
4239
|
+
revalidation: t.revalidation
|
|
4240
|
+
} : {
|
|
4241
|
+
error: t.error !== void 0 ? t.error : r.error,
|
|
4242
|
+
location: r.location,
|
|
4243
|
+
revalidation: t.revalidation || r.revalidation
|
|
4244
|
+
};
|
|
4245
|
+
}
|
|
4246
|
+
componentDidCatch(t, r) {
|
|
4247
|
+
console.error("React Router caught the following error during render", t, r);
|
|
4248
|
+
}
|
|
4249
|
+
render() {
|
|
4250
|
+
return this.state.error !== void 0 ? /* @__PURE__ */ D.createElement(Ae.Provider, {
|
|
4251
|
+
value: this.props.routeContext
|
|
4252
|
+
}, /* @__PURE__ */ D.createElement(cn.Provider, {
|
|
4253
|
+
value: this.state.error,
|
|
4254
|
+
children: this.props.component
|
|
4255
|
+
})) : this.props.children;
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
function to(e) {
|
|
4259
|
+
let {
|
|
4260
|
+
routeContext: t,
|
|
4261
|
+
match: r,
|
|
4262
|
+
children: n
|
|
4263
|
+
} = e, a = D.useContext(Sr);
|
|
4264
|
+
return a && a.static && a.staticContext && (r.route.errorElement || r.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = r.route.id), /* @__PURE__ */ D.createElement(Ae.Provider, {
|
|
4265
|
+
value: t
|
|
4266
|
+
}, n);
|
|
4267
|
+
}
|
|
4268
|
+
function ro(e, t, r, n) {
|
|
4269
|
+
var a;
|
|
4270
|
+
if (t === void 0 && (t = []), r === void 0 && (r = null), n === void 0 && (n = null), e == null) {
|
|
4271
|
+
var u;
|
|
4272
|
+
if ((u = r) != null && u.errors)
|
|
4273
|
+
e = r.matches;
|
|
4274
|
+
else
|
|
4275
|
+
return null;
|
|
4276
|
+
}
|
|
4277
|
+
let o = e, f = (a = r) == null ? void 0 : a.errors;
|
|
4278
|
+
if (f != null) {
|
|
4279
|
+
let m = o.findIndex((l) => l.route.id && (f == null ? void 0 : f[l.route.id]) !== void 0);
|
|
4280
|
+
m >= 0 || (process.env.NODE_ENV !== "production" ? U(!1, "Could not find a matching route for errors on route IDs: " + Object.keys(f).join(",")) : U(!1)), o = o.slice(0, Math.min(o.length, m + 1));
|
|
4281
|
+
}
|
|
4282
|
+
let c = !1, y = -1;
|
|
4283
|
+
if (r && n && n.v7_partialHydration)
|
|
4284
|
+
for (let m = 0; m < o.length; m++) {
|
|
4285
|
+
let l = o[m];
|
|
4286
|
+
if ((l.route.HydrateFallback || l.route.hydrateFallbackElement) && (y = m), l.route.id) {
|
|
4287
|
+
let {
|
|
4288
|
+
loaderData: v,
|
|
4289
|
+
errors: O
|
|
4290
|
+
} = r, F = l.route.loader && v[l.route.id] === void 0 && (!O || O[l.route.id] === void 0);
|
|
4291
|
+
if (l.route.lazy || F) {
|
|
4292
|
+
c = !0, y >= 0 ? o = o.slice(0, y + 1) : o = [o[0]];
|
|
4293
|
+
break;
|
|
4294
|
+
}
|
|
4295
|
+
}
|
|
4296
|
+
}
|
|
4297
|
+
return o.reduceRight((m, l, v) => {
|
|
4298
|
+
let O, F = !1, C = null, L = null;
|
|
4299
|
+
r && (O = f && l.route.id ? f[l.route.id] : void 0, C = l.route.errorElement || Zi, c && (y < 0 && v === 0 ? (ya("route-fallback", !1, "No `HydrateFallback` element provided to render during initial hydration"), F = !0, L = null) : y === v && (F = !0, L = l.route.hydrateFallbackElement || null)));
|
|
4300
|
+
let _ = t.concat(o.slice(0, v + 1)), P = () => {
|
|
4301
|
+
let $;
|
|
4302
|
+
return O ? $ = C : F ? $ = L : l.route.Component ? $ = /* @__PURE__ */ D.createElement(l.route.Component, null) : l.route.element ? $ = l.route.element : $ = m, /* @__PURE__ */ D.createElement(to, {
|
|
4303
|
+
match: l,
|
|
4304
|
+
routeContext: {
|
|
4305
|
+
outlet: m,
|
|
4306
|
+
matches: _,
|
|
4307
|
+
isDataRoute: r != null
|
|
4308
|
+
},
|
|
4309
|
+
children: $
|
|
4310
|
+
});
|
|
4311
|
+
};
|
|
4312
|
+
return r && (l.route.ErrorBoundary || l.route.errorElement || v === 0) ? /* @__PURE__ */ D.createElement(eo, {
|
|
4313
|
+
location: r.location,
|
|
4314
|
+
revalidation: r.revalidation,
|
|
4315
|
+
component: C,
|
|
4316
|
+
error: O,
|
|
4317
|
+
children: P(),
|
|
4318
|
+
routeContext: {
|
|
4319
|
+
outlet: null,
|
|
4320
|
+
matches: _,
|
|
4321
|
+
isDataRoute: !0
|
|
4322
|
+
}
|
|
4323
|
+
}) : P();
|
|
4324
|
+
}, null);
|
|
4325
|
+
}
|
|
4326
|
+
var ma = /* @__PURE__ */ function(e) {
|
|
4327
|
+
return e.UseBlocker = "useBlocker", e.UseRevalidator = "useRevalidator", e.UseNavigateStable = "useNavigate", e;
|
|
4328
|
+
}(ma || {}), Gt = /* @__PURE__ */ function(e) {
|
|
4329
|
+
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;
|
|
4330
|
+
}(Gt || {});
|
|
4331
|
+
function dn(e) {
|
|
4332
|
+
return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
4333
|
+
}
|
|
4334
|
+
function no(e) {
|
|
4335
|
+
let t = D.useContext(Sr);
|
|
4336
|
+
return t || (process.env.NODE_ENV !== "production" ? U(!1, dn(e)) : U(!1)), t;
|
|
4337
|
+
}
|
|
4338
|
+
function ao(e) {
|
|
4339
|
+
let t = D.useContext(ha);
|
|
4340
|
+
return t || (process.env.NODE_ENV !== "production" ? U(!1, dn(e)) : U(!1)), t;
|
|
4341
|
+
}
|
|
4342
|
+
function io(e) {
|
|
4343
|
+
let t = D.useContext(Ae);
|
|
4344
|
+
return t || (process.env.NODE_ENV !== "production" ? U(!1, dn(e)) : U(!1)), t;
|
|
4345
|
+
}
|
|
4346
|
+
function fn(e) {
|
|
4347
|
+
let t = io(e), r = t.matches[t.matches.length - 1];
|
|
4348
|
+
return r.route.id || (process.env.NODE_ENV !== "production" ? U(!1, e + ' can only be used on routes that contain a unique "id"') : U(!1)), r.route.id;
|
|
4349
|
+
}
|
|
4350
|
+
function Po() {
|
|
4351
|
+
return fn(Gt.UseRouteId);
|
|
4352
|
+
}
|
|
4353
|
+
function oo() {
|
|
4354
|
+
var e;
|
|
4355
|
+
let t = D.useContext(cn), r = ao(Gt.UseRouteError), n = fn(Gt.UseRouteError);
|
|
4356
|
+
return t !== void 0 ? t : (e = r.errors) == null ? void 0 : e[n];
|
|
4357
|
+
}
|
|
4358
|
+
function so() {
|
|
4359
|
+
let {
|
|
4360
|
+
router: e
|
|
4361
|
+
} = no(ma.UseNavigateStable), t = fn(Gt.UseNavigateStable), r = D.useRef(!1);
|
|
4362
|
+
return va(() => {
|
|
4363
|
+
r.current = !0;
|
|
4364
|
+
}), D.useCallback(function(a, u) {
|
|
4365
|
+
u === void 0 && (u = {}), process.env.NODE_ENV !== "production" && fe(r.current, pa), r.current && (typeof a == "number" ? e.navigate(a) : e.navigate(a, br({
|
|
4366
|
+
fromRouteId: t
|
|
4367
|
+
}, u)));
|
|
4368
|
+
}, [e, t]);
|
|
4369
|
+
}
|
|
4370
|
+
const In = {};
|
|
4371
|
+
function ya(e, t, r) {
|
|
4372
|
+
!t && !In[e] && (In[e] = !0, process.env.NODE_ENV !== "production" && fe(!1, r));
|
|
4373
|
+
}
|
|
4374
|
+
function Oo(e) {
|
|
4375
|
+
let {
|
|
4376
|
+
to: t,
|
|
4377
|
+
replace: r,
|
|
4378
|
+
state: n,
|
|
4379
|
+
relative: a
|
|
4380
|
+
} = e;
|
|
4381
|
+
jt() || (process.env.NODE_ENV !== "production" ? U(
|
|
4382
|
+
!1,
|
|
4383
|
+
// TODO: This error is probably because they somehow have 2 versions of
|
|
4384
|
+
// the router loaded. We can help them understand how to avoid that.
|
|
4385
|
+
"<Navigate> may be used only in the context of a <Router> component."
|
|
4386
|
+
) : U(!1));
|
|
4387
|
+
let {
|
|
4388
|
+
future: u,
|
|
4389
|
+
static: o
|
|
4390
|
+
} = D.useContext(at);
|
|
4391
|
+
process.env.NODE_ENV !== "production" && fe(!o, "<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.");
|
|
4392
|
+
let {
|
|
4393
|
+
matches: f
|
|
4394
|
+
} = D.useContext(Ae), {
|
|
4395
|
+
pathname: c
|
|
4396
|
+
} = nr(), y = qi(), m = Rr(t, Er(f, u.v7_relativeSplatPath), c, a === "path"), l = JSON.stringify(m);
|
|
4397
|
+
return D.useEffect(() => y(JSON.parse(l), {
|
|
4398
|
+
replace: r,
|
|
4399
|
+
state: n,
|
|
4400
|
+
relative: a
|
|
4401
|
+
}), [y, l, a, r, n]), null;
|
|
4402
|
+
}
|
|
4403
|
+
function _o(e) {
|
|
4404
|
+
return Ji(e.context);
|
|
4405
|
+
}
|
|
4406
|
+
function Fo(e) {
|
|
4407
|
+
let {
|
|
4408
|
+
basename: t = "/",
|
|
4409
|
+
children: r = null,
|
|
4410
|
+
location: n,
|
|
4411
|
+
navigationType: a = ie.Pop,
|
|
4412
|
+
navigator: u,
|
|
4413
|
+
static: o = !1,
|
|
4414
|
+
future: f
|
|
4415
|
+
} = e;
|
|
4416
|
+
jt() && (process.env.NODE_ENV !== "production" ? U(!1, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : U(!1));
|
|
4417
|
+
let c = t.replace(/^\/*/, "/"), y = D.useMemo(() => ({
|
|
4418
|
+
basename: c,
|
|
4419
|
+
navigator: u,
|
|
4420
|
+
static: o,
|
|
4421
|
+
future: br({
|
|
4422
|
+
v7_relativeSplatPath: !1
|
|
4423
|
+
}, f)
|
|
4424
|
+
}), [c, f, u, o]);
|
|
4425
|
+
typeof n == "string" && (n = nt(n));
|
|
4426
|
+
let {
|
|
4427
|
+
pathname: m = "/",
|
|
4428
|
+
search: l = "",
|
|
4429
|
+
hash: v = "",
|
|
4430
|
+
state: O = null,
|
|
4431
|
+
key: F = "default"
|
|
4432
|
+
} = n, C = D.useMemo(() => {
|
|
4433
|
+
let L = rr(m, c);
|
|
4434
|
+
return L == null ? null : {
|
|
4435
|
+
location: {
|
|
4436
|
+
pathname: L,
|
|
4437
|
+
search: l,
|
|
4438
|
+
hash: v,
|
|
4439
|
+
state: O,
|
|
4440
|
+
key: F
|
|
4441
|
+
},
|
|
4442
|
+
navigationType: a
|
|
4443
|
+
};
|
|
4444
|
+
}, [c, m, l, v, O, F, a]);
|
|
4445
|
+
return process.env.NODE_ENV !== "production" && fe(C != null, '<Router basename="' + c + '"> is not able to match the URL ' + ('"' + m + l + v + '" because it does not start with the ') + "basename, so the <Router> won't render anything."), C == null ? null : /* @__PURE__ */ D.createElement(at.Provider, {
|
|
4446
|
+
value: y
|
|
4447
|
+
}, /* @__PURE__ */ D.createElement(Cr.Provider, {
|
|
4448
|
+
children: r,
|
|
4449
|
+
value: C
|
|
4450
|
+
}));
|
|
4451
|
+
}
|
|
4452
|
+
new Promise(() => {
|
|
4453
|
+
});
|
|
4454
|
+
function To(e) {
|
|
4455
|
+
let t = {
|
|
4456
|
+
// Note: this check also occurs in createRoutesFromChildren so update
|
|
4457
|
+
// there if you change this -- please and thank you!
|
|
4458
|
+
hasErrorBoundary: e.ErrorBoundary != null || e.errorElement != null
|
|
4459
|
+
};
|
|
4460
|
+
return e.Component && (process.env.NODE_ENV !== "production" && e.element && process.env.NODE_ENV !== "production" && fe(!1, "You should not include both `Component` and `element` on your route - `Component` will be used."), Object.assign(t, {
|
|
4461
|
+
element: /* @__PURE__ */ D.createElement(e.Component),
|
|
4462
|
+
Component: void 0
|
|
4463
|
+
})), e.HydrateFallback && (process.env.NODE_ENV !== "production" && e.hydrateFallbackElement && process.env.NODE_ENV !== "production" && fe(!1, "You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."), Object.assign(t, {
|
|
4464
|
+
hydrateFallbackElement: /* @__PURE__ */ D.createElement(e.HydrateFallback),
|
|
4465
|
+
HydrateFallback: void 0
|
|
4466
|
+
})), e.ErrorBoundary && (process.env.NODE_ENV !== "production" && e.errorElement && process.env.NODE_ENV !== "production" && fe(!1, "You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."), Object.assign(t, {
|
|
4467
|
+
errorElement: /* @__PURE__ */ D.createElement(e.ErrorBoundary),
|
|
4468
|
+
ErrorBoundary: void 0
|
|
4469
|
+
})), t;
|
|
4470
|
+
}
|
|
4471
|
+
const ga = Ea(
|
|
4472
|
+
void 0
|
|
4473
|
+
), Mo = ga.Provider, hn = () => {
|
|
4474
|
+
const e = Ra(ga);
|
|
4475
|
+
if (!e)
|
|
4476
|
+
throw new Error("useDevPortal must be used within a DevPortalProvider.");
|
|
4477
|
+
return e;
|
|
4478
|
+
}, No = () => {
|
|
4479
|
+
const { getApiIdentities: e } = hn();
|
|
4480
|
+
return ta({
|
|
4481
|
+
queryFn: e,
|
|
4482
|
+
queryKey: ["api-identities"]
|
|
4483
|
+
});
|
|
4484
|
+
}, lo = () => {
|
|
4485
|
+
const { navigation: e } = hn(), t = nr();
|
|
4486
|
+
return e.find(
|
|
4487
|
+
(r) => en({ path: r.path, end: !1 }, t.pathname)
|
|
4488
|
+
);
|
|
4489
|
+
}, Lo = () => {
|
|
4490
|
+
const { getNavigation: e } = hn(), t = lo(), r = (t == null ? void 0 : t.path) ?? "";
|
|
4491
|
+
return ta({
|
|
4492
|
+
queryFn: async () => ({
|
|
4493
|
+
items: [...(t == null ? void 0 : t.categories) ?? [], ...await e(r)],
|
|
4494
|
+
currentTopNavItem: t
|
|
4495
|
+
}),
|
|
4496
|
+
queryKey: ["navigation", r]
|
|
4497
|
+
});
|
|
4498
|
+
};
|
|
4499
|
+
export {
|
|
4500
|
+
So as $,
|
|
4501
|
+
wo as A,
|
|
4502
|
+
za as B,
|
|
4503
|
+
qi as C,
|
|
4504
|
+
Mo as D,
|
|
4505
|
+
ta as E,
|
|
4506
|
+
fo as F,
|
|
4507
|
+
po as G,
|
|
4508
|
+
No as H,
|
|
4509
|
+
en as I,
|
|
4510
|
+
Ta as J,
|
|
4511
|
+
at as K,
|
|
4512
|
+
rr as L,
|
|
4513
|
+
fe as M,
|
|
4514
|
+
Oo as N,
|
|
4515
|
+
_o as O,
|
|
4516
|
+
Do as P,
|
|
4517
|
+
Eo as Q,
|
|
4518
|
+
Na as R,
|
|
4519
|
+
nn as S,
|
|
4520
|
+
Gi as T,
|
|
4521
|
+
tr as U,
|
|
4522
|
+
ha as V,
|
|
4523
|
+
Po as W,
|
|
4524
|
+
Ae as X,
|
|
4525
|
+
U as Y,
|
|
4526
|
+
$e as Z,
|
|
4527
|
+
Co as _,
|
|
4528
|
+
yo as a,
|
|
4529
|
+
To as a0,
|
|
4530
|
+
ia as a1,
|
|
4531
|
+
Sr as a2,
|
|
4532
|
+
Fo as a3,
|
|
4533
|
+
xo as a4,
|
|
4534
|
+
kr as b,
|
|
4535
|
+
bo as c,
|
|
4536
|
+
go as d,
|
|
4537
|
+
Pa as e,
|
|
4538
|
+
qn as f,
|
|
4539
|
+
vo as g,
|
|
4540
|
+
Da as h,
|
|
4541
|
+
Vr as i,
|
|
4542
|
+
ho as j,
|
|
4543
|
+
Ca as k,
|
|
4544
|
+
nr as l,
|
|
4545
|
+
mo as m,
|
|
4546
|
+
on as n,
|
|
4547
|
+
Yn as o,
|
|
4548
|
+
an as p,
|
|
4549
|
+
lo as q,
|
|
4550
|
+
yr as r,
|
|
4551
|
+
Hr as s,
|
|
4552
|
+
Lo as t,
|
|
4553
|
+
hn as u,
|
|
4554
|
+
Ro as v,
|
|
4555
|
+
Ga as w,
|
|
4556
|
+
ja as x,
|
|
4557
|
+
Wr as y,
|
|
4558
|
+
Ia as z
|
|
4559
|
+
};
|