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