@kitbag/router 0.17.4 → 0.17.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kitbag-router.d.ts +20 -30
- package/dist/kitbag-router.js +355 -344
- package/dist/kitbag-router.umd.cjs +2 -2
- package/package.json +2 -2
package/dist/kitbag-router.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var Pr = Object.defineProperty;
|
|
2
2
|
var Sr = (e, t, r) => t in e ? Pr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var M = (e, t, r) => Sr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { inject as
|
|
4
|
+
import { inject as ce, markRaw as xe, reactive as $e, defineAsyncComponent as Ar, watch as ne, onUnmounted as _e, computed as Z, ref as He, toValue as _, toRefs as kr, defineComponent as ge, openBlock as kt, createElementBlock as xr, normalizeClass as Lr, renderSlot as xt, normalizeProps as Lt, guardReactiveProps as Ur, unref as ve, h as le, getCurrentInstance as Br, provide as Nr, mergeProps as Cr, createBlock as Vr, resolveDynamicComponent as Zr, createCommentVNode as jr } from "vue";
|
|
5
5
|
function T(e) {
|
|
6
6
|
return typeof e != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(e);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function Ut(e) {
|
|
9
9
|
return T(e) ? e : `/${e}`;
|
|
10
10
|
}
|
|
11
11
|
class $r extends Error {
|
|
@@ -38,57 +38,57 @@ class Hr extends Error {
|
|
|
38
38
|
super(`useRoute called with incorrect route. Given ${t}, expected ${r}`);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
function
|
|
43
|
-
const e =
|
|
41
|
+
const Bt = Symbol();
|
|
42
|
+
function Qe() {
|
|
43
|
+
const e = ce(Bt);
|
|
44
44
|
if (!e)
|
|
45
45
|
throw new Re();
|
|
46
46
|
return e;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function he(e) {
|
|
49
49
|
return Array.isArray(e) ? e : [e];
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function Nt(e, t) {
|
|
52
52
|
return e.filter((r) => t === r).length;
|
|
53
53
|
}
|
|
54
54
|
function we(...e) {
|
|
55
|
-
const t = e.flatMap((r) => Array.isArray(r) ? r : Object.keys(r).map(
|
|
55
|
+
const t = e.flatMap((r) => Array.isArray(r) ? r : Object.keys(r).map(Or));
|
|
56
56
|
for (const r of t)
|
|
57
|
-
if (
|
|
57
|
+
if (Nt(t, r) > 1)
|
|
58
58
|
throw new $r(r);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Or(e) {
|
|
61
61
|
return e.startsWith("?") ? e.slice(1) : e;
|
|
62
62
|
}
|
|
63
63
|
class G extends Error {
|
|
64
64
|
}
|
|
65
|
-
const
|
|
66
|
-
function
|
|
65
|
+
const z = "[", X = "]";
|
|
66
|
+
function qr(e) {
|
|
67
67
|
return e !== String && e !== Boolean && e !== Number && e !== Date;
|
|
68
68
|
}
|
|
69
69
|
function Ir(e) {
|
|
70
|
-
return typeof e == "function" &&
|
|
70
|
+
return typeof e == "function" && qr(e);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Oe(e) {
|
|
73
73
|
return typeof e == "object" && "get" in e && typeof e.get == "function" && "set" in e && typeof e.set == "function";
|
|
74
74
|
}
|
|
75
75
|
function Ct(e) {
|
|
76
76
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
77
77
|
}
|
|
78
78
|
function Dr(e, t) {
|
|
79
|
-
return
|
|
80
|
-
get: (r) =>
|
|
81
|
-
set: (r) =>
|
|
79
|
+
return Oe(e) ? { ...e, defaultValue: t ?? e.defaultValue } : {
|
|
80
|
+
get: (r) => oe(r, e),
|
|
81
|
+
set: (r) => ae(r, e),
|
|
82
82
|
defaultValue: t
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
function Fr(e) {
|
|
86
|
-
return
|
|
86
|
+
return Oe(e) && e.defaultValue !== void 0;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function ko(e, t) {
|
|
89
89
|
return Dr(e, t);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Vt(e) {
|
|
92
92
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
93
93
|
}
|
|
94
94
|
function J(e) {
|
|
@@ -140,9 +140,9 @@ async function Mr() {
|
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
function Tr(e) {
|
|
143
|
-
return Object.values(e).some((t) => Object.values(t.host.params).some((r) =>
|
|
143
|
+
return Object.values(e).some((t) => Object.values(t.host.params).some((r) => Fe(r)) || Object.values(t.path.params).some((r) => Fe(r)) || Object.values(t.query.params).some((r) => Fe(r)));
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Fe(e) {
|
|
146
146
|
return typeof e == "object" && "parse" in e && typeof e.parse == "function";
|
|
147
147
|
}
|
|
148
148
|
async function Jr() {
|
|
@@ -152,10 +152,10 @@ async function Jr() {
|
|
|
152
152
|
throw new Error("Failed to initialize Zod");
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Zt(e) {
|
|
156
156
|
return v ? e instanceof v.ZodSchema : !1;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function jt(e) {
|
|
159
159
|
return {
|
|
160
160
|
get: (t, { invalid: r }) => {
|
|
161
161
|
try {
|
|
@@ -174,14 +174,14 @@ function Zt(e) {
|
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
const Wr = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
177
|
-
function
|
|
177
|
+
function ie(e, t) {
|
|
178
178
|
if (typeof t == "string" && Wr.test(t)) {
|
|
179
179
|
const r = new Date(t);
|
|
180
180
|
return isNaN(r.getTime()) ? t : r;
|
|
181
181
|
}
|
|
182
182
|
return t;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function fe(e) {
|
|
185
185
|
for (const t of e)
|
|
186
186
|
try {
|
|
187
187
|
return t();
|
|
@@ -205,36 +205,36 @@ function Je(e, t) {
|
|
|
205
205
|
if (t instanceof v.ZodNumber)
|
|
206
206
|
return t.parse(Number(e));
|
|
207
207
|
if (t instanceof v.ZodLiteral)
|
|
208
|
-
return
|
|
208
|
+
return fe([
|
|
209
209
|
() => t.parse(Number(e)),
|
|
210
210
|
() => t.parse(!!e),
|
|
211
211
|
() => t.parse(e)
|
|
212
212
|
]);
|
|
213
213
|
if (t instanceof v.ZodObject)
|
|
214
|
-
return t.parse(JSON.parse(e,
|
|
214
|
+
return t.parse(JSON.parse(e, ie));
|
|
215
215
|
if (t instanceof v.ZodEnum)
|
|
216
216
|
return t.parse(e);
|
|
217
217
|
if (t instanceof v.ZodNativeEnum)
|
|
218
|
-
return
|
|
218
|
+
return fe([
|
|
219
219
|
() => t.parse(Number(e)),
|
|
220
220
|
() => t.parse(e)
|
|
221
221
|
]);
|
|
222
222
|
if (t instanceof v.ZodArray || t instanceof v.ZodTuple)
|
|
223
|
-
return t.parse(JSON.parse(e,
|
|
223
|
+
return t.parse(JSON.parse(e, ie));
|
|
224
224
|
if (t instanceof v.ZodUnion) {
|
|
225
225
|
const r = Array.from(t._def.options).sort(Le).map((n) => () => Je(e, n));
|
|
226
|
-
return
|
|
226
|
+
return fe(r);
|
|
227
227
|
}
|
|
228
228
|
if (t instanceof v.ZodDiscriminatedUnion) {
|
|
229
229
|
const r = Array.from(t.options).sort(Le).map((n) => () => Je(e, n));
|
|
230
|
-
return
|
|
230
|
+
return fe(r);
|
|
231
231
|
}
|
|
232
232
|
if (t instanceof v.ZodRecord)
|
|
233
|
-
return t.parse(JSON.parse(e,
|
|
233
|
+
return t.parse(JSON.parse(e, ie));
|
|
234
234
|
if (t instanceof v.ZodMap)
|
|
235
|
-
return t.parse(new Map(JSON.parse(e,
|
|
235
|
+
return t.parse(new Map(JSON.parse(e, ie)));
|
|
236
236
|
if (t instanceof v.ZodSet)
|
|
237
|
-
return t.parse(new Set(JSON.parse(e,
|
|
237
|
+
return t.parse(new Set(JSON.parse(e, ie)));
|
|
238
238
|
if (t instanceof v.ZodIntersection)
|
|
239
239
|
throw new Error("Intersection schemas are not supported");
|
|
240
240
|
if (t instanceof v.ZodPromise)
|
|
@@ -266,11 +266,11 @@ function We(e, t) {
|
|
|
266
266
|
return JSON.stringify(t.parse(e));
|
|
267
267
|
if (t instanceof v.ZodUnion) {
|
|
268
268
|
const r = Array.from(t._def.options).sort(Le).map((n) => () => We(e, n));
|
|
269
|
-
return
|
|
269
|
+
return fe(r);
|
|
270
270
|
}
|
|
271
271
|
if (t instanceof v.ZodDiscriminatedUnion) {
|
|
272
272
|
const r = Array.from(t.options).sort(Le).map((n) => () => We(e, n));
|
|
273
|
-
return
|
|
273
|
+
return fe(r);
|
|
274
274
|
}
|
|
275
275
|
if (t instanceof v.ZodRecord)
|
|
276
276
|
return JSON.stringify(t.parse(e));
|
|
@@ -293,18 +293,18 @@ function We(e, t) {
|
|
|
293
293
|
function Gr(e, t) {
|
|
294
294
|
return e[t] ?? String;
|
|
295
295
|
}
|
|
296
|
-
const
|
|
296
|
+
const C = {
|
|
297
297
|
invalid: (e) => {
|
|
298
298
|
throw new G(e);
|
|
299
299
|
}
|
|
300
|
-
},
|
|
300
|
+
}, $t = {
|
|
301
301
|
get: (e) => e,
|
|
302
302
|
set: (e, { invalid: t }) => {
|
|
303
303
|
if (typeof e != "string")
|
|
304
304
|
throw t();
|
|
305
305
|
return e;
|
|
306
306
|
}
|
|
307
|
-
},
|
|
307
|
+
}, ze = {
|
|
308
308
|
get: (e, { invalid: t }) => {
|
|
309
309
|
if (e === "true")
|
|
310
310
|
return !0;
|
|
@@ -329,7 +329,7 @@ const N = {
|
|
|
329
329
|
throw t();
|
|
330
330
|
return e.toString();
|
|
331
331
|
}
|
|
332
|
-
},
|
|
332
|
+
}, _t = {
|
|
333
333
|
get: (e, { invalid: t }) => {
|
|
334
334
|
const r = new Date(e);
|
|
335
335
|
if (isNaN(r.getTime()))
|
|
@@ -341,7 +341,7 @@ const N = {
|
|
|
341
341
|
throw t();
|
|
342
342
|
return e.toISOString();
|
|
343
343
|
}
|
|
344
|
-
},
|
|
344
|
+
}, Ht = {
|
|
345
345
|
get: (e, { invalid: t }) => {
|
|
346
346
|
try {
|
|
347
347
|
return JSON.parse(e);
|
|
@@ -357,19 +357,19 @@ const N = {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
|
-
function
|
|
360
|
+
function Qr(e, t) {
|
|
361
361
|
switch (typeof t) {
|
|
362
362
|
case "string":
|
|
363
|
-
return
|
|
363
|
+
return $t.get(e, C) === t;
|
|
364
364
|
case "number":
|
|
365
|
-
return Ke.get(e,
|
|
365
|
+
return Ke.get(e, C) === t;
|
|
366
366
|
case "boolean":
|
|
367
|
-
return
|
|
367
|
+
return ze.get(e, C) === t;
|
|
368
368
|
default:
|
|
369
369
|
return !1;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function oe(e, t, r = !1) {
|
|
373
373
|
if (e === void 0 || !J(e)) {
|
|
374
374
|
if (Fr(t))
|
|
375
375
|
return t.defaultValue;
|
|
@@ -378,34 +378,34 @@ function de(e, t, r = !1) {
|
|
|
378
378
|
throw new G();
|
|
379
379
|
}
|
|
380
380
|
if (t === String)
|
|
381
|
-
return
|
|
381
|
+
return $t.get(e, C);
|
|
382
382
|
if (t === Boolean)
|
|
383
|
-
return
|
|
383
|
+
return ze.get(e, C);
|
|
384
384
|
if (t === Number)
|
|
385
|
-
return Ke.get(e,
|
|
385
|
+
return Ke.get(e, C);
|
|
386
386
|
if (t === Date)
|
|
387
|
-
return
|
|
387
|
+
return _t.get(e, C);
|
|
388
388
|
if (t === JSON)
|
|
389
|
-
return
|
|
389
|
+
return Ht.get(e, C);
|
|
390
390
|
if (Ir(t))
|
|
391
|
-
return t(e,
|
|
392
|
-
if (
|
|
393
|
-
return t.get(e,
|
|
391
|
+
return t(e, C);
|
|
392
|
+
if (Oe(t))
|
|
393
|
+
return t.get(e, C);
|
|
394
394
|
if (t instanceof RegExp) {
|
|
395
395
|
if (t.test(e))
|
|
396
396
|
return e;
|
|
397
397
|
throw new G();
|
|
398
398
|
}
|
|
399
399
|
if (Ct(t)) {
|
|
400
|
-
if (
|
|
400
|
+
if (Qr(e, t))
|
|
401
401
|
return t;
|
|
402
402
|
throw new G();
|
|
403
403
|
}
|
|
404
|
-
return
|
|
404
|
+
return Zt(t) ? jt(t).get(e, C) : e;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function zr(e, t, r = !1) {
|
|
407
407
|
try {
|
|
408
|
-
return
|
|
408
|
+
return oe(e, t, r);
|
|
409
409
|
} catch (n) {
|
|
410
410
|
if (n instanceof G)
|
|
411
411
|
return;
|
|
@@ -414,36 +414,36 @@ function Qr(e, t, r = !1) {
|
|
|
414
414
|
}
|
|
415
415
|
function Kr(e, t, r = !1) {
|
|
416
416
|
try {
|
|
417
|
-
return
|
|
417
|
+
return ae(e, t, r);
|
|
418
418
|
} catch (n) {
|
|
419
419
|
if (n instanceof G)
|
|
420
420
|
return;
|
|
421
421
|
throw n;
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function ae(e, t, r = !1) {
|
|
425
425
|
if (e === void 0) {
|
|
426
426
|
if (r)
|
|
427
427
|
return "";
|
|
428
428
|
throw new G();
|
|
429
429
|
}
|
|
430
430
|
if (t === Boolean)
|
|
431
|
-
return
|
|
431
|
+
return ze.set(e, C);
|
|
432
432
|
if (t === Number)
|
|
433
|
-
return Ke.set(e,
|
|
433
|
+
return Ke.set(e, C);
|
|
434
434
|
if (t === Date)
|
|
435
|
-
return
|
|
435
|
+
return _t.set(e, C);
|
|
436
436
|
if (t === JSON)
|
|
437
|
-
return
|
|
438
|
-
if (
|
|
439
|
-
return t.set(e,
|
|
437
|
+
return Ht.set(e, C);
|
|
438
|
+
if (Oe(t))
|
|
439
|
+
return t.set(e, C);
|
|
440
440
|
if (Ct(t)) {
|
|
441
441
|
if (t !== e)
|
|
442
442
|
throw new G();
|
|
443
443
|
return e.toString();
|
|
444
444
|
}
|
|
445
|
-
if (
|
|
446
|
-
return
|
|
445
|
+
if (Zt(t))
|
|
446
|
+
return jt(t).set(e, C);
|
|
447
447
|
try {
|
|
448
448
|
return e.toString();
|
|
449
449
|
} catch {
|
|
@@ -467,18 +467,18 @@ function Yr(e, t) {
|
|
|
467
467
|
return a && o.push(a), o;
|
|
468
468
|
}
|
|
469
469
|
function Xr(e) {
|
|
470
|
-
const t =
|
|
470
|
+
const t = Ot(e.path.value);
|
|
471
471
|
return new RegExp(`^${t}$`, "i");
|
|
472
472
|
}
|
|
473
473
|
function en(e) {
|
|
474
474
|
const t = new URLSearchParams(e.query.value);
|
|
475
|
-
return Array.from(t.entries()).filter(([, r]) => !
|
|
476
|
-
const o =
|
|
475
|
+
return Array.from(t.entries()).filter(([, r]) => !et(r)).map(([r, n]) => {
|
|
476
|
+
const o = Ot(n);
|
|
477
477
|
return new RegExp(`${Ye(r)}=${o}(&|$)`, "i");
|
|
478
478
|
});
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
return Yr(e, new RegExp(tn, "g")).map((t) => t.startsWith(
|
|
480
|
+
function Ot(e) {
|
|
481
|
+
return Yr(e, new RegExp(tn, "g")).map((t) => t.startsWith(z) ? qt(t) : Ye(t)).join("");
|
|
482
482
|
}
|
|
483
483
|
function qt(e) {
|
|
484
484
|
return [
|
|
@@ -486,18 +486,18 @@ function qt(e) {
|
|
|
486
486
|
nn
|
|
487
487
|
].reduce((t, r) => r(t), e);
|
|
488
488
|
}
|
|
489
|
-
const tn = `\\${
|
|
489
|
+
const tn = `\\${z}\\??([\\w-_]+)\\${X}`, Xe = `\\${z}\\?([\\w-_]+)\\${X}`, It = `\\${z}([\\w-_]+)\\${X}`;
|
|
490
490
|
function rn(e) {
|
|
491
491
|
return e.replace(new RegExp(Xe, "g"), ".*");
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function et(e) {
|
|
494
494
|
return new RegExp(Xe, "g").test(e);
|
|
495
495
|
}
|
|
496
496
|
function nn(e) {
|
|
497
|
-
return e.replace(new RegExp(
|
|
497
|
+
return e.replace(new RegExp(It, "g"), ".+");
|
|
498
498
|
}
|
|
499
|
-
function
|
|
500
|
-
const [t] = Ue(e, new RegExp(Xe, "g")), [r] = Ue(e, new RegExp(
|
|
499
|
+
function be(e) {
|
|
500
|
+
const [t] = Ue(e, new RegExp(Xe, "g")), [r] = Ue(e, new RegExp(It, "g"));
|
|
501
501
|
return t ?? r;
|
|
502
502
|
}
|
|
503
503
|
function Ue(e, t) {
|
|
@@ -506,9 +506,9 @@ function Ue(e, t) {
|
|
|
506
506
|
function on(e = "", t = {}) {
|
|
507
507
|
if (!J(e))
|
|
508
508
|
return {};
|
|
509
|
-
const r = new RegExp(`\\${
|
|
509
|
+
const r = new RegExp(`\\${z}(\\??[\\w-_]+)\\${X}`, "g");
|
|
510
510
|
return Array.from(e.matchAll(r)).reduce((o, [a, s]) => {
|
|
511
|
-
const u =
|
|
511
|
+
const u = be(a);
|
|
512
512
|
if (!u)
|
|
513
513
|
return o;
|
|
514
514
|
const f = Gr(t, u);
|
|
@@ -516,12 +516,12 @@ function on(e = "", t = {}) {
|
|
|
516
516
|
}, {});
|
|
517
517
|
}
|
|
518
518
|
function an(e) {
|
|
519
|
-
return
|
|
519
|
+
return Vt(e) && typeof e.value == "string";
|
|
520
520
|
}
|
|
521
521
|
function ee(e) {
|
|
522
|
-
return e === void 0 ?
|
|
522
|
+
return e === void 0 ? Q() : an(e) ? e : Q(e, {});
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function Q(e, t) {
|
|
525
525
|
return {
|
|
526
526
|
value: e ?? "",
|
|
527
527
|
params: on(e, t)
|
|
@@ -530,7 +530,7 @@ function z(e, t) {
|
|
|
530
530
|
function Dt(e, t) {
|
|
531
531
|
we(e.params, t.params);
|
|
532
532
|
const r = `${e.value}${t.value}`;
|
|
533
|
-
return
|
|
533
|
+
return Q(r, { ...e.params, ...t.params });
|
|
534
534
|
}
|
|
535
535
|
function sn(e, t) {
|
|
536
536
|
return Dt(e, t);
|
|
@@ -546,7 +546,7 @@ function un(e, t) {
|
|
|
546
546
|
function fn(e, t) {
|
|
547
547
|
we(e.params, t.params);
|
|
548
548
|
const r = [e.value, t.value].filter(J).join("&");
|
|
549
|
-
return
|
|
549
|
+
return Q(r, { ...e.params, ...t.params });
|
|
550
550
|
}
|
|
551
551
|
function ln(e, t) {
|
|
552
552
|
return we(e, t), { ...e, ...t };
|
|
@@ -557,13 +557,13 @@ function Ft(e) {
|
|
|
557
557
|
function Mt(e) {
|
|
558
558
|
return "component" in e && !!e.component;
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function lt(e) {
|
|
561
561
|
return "props" in e && typeof e.props == "function";
|
|
562
562
|
}
|
|
563
563
|
function Tt(e) {
|
|
564
564
|
return "components" in e && !!e.components;
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function ht(e) {
|
|
567
567
|
return "props" in e && typeof e.props == "object";
|
|
568
568
|
}
|
|
569
569
|
function Jt(e, t) {
|
|
@@ -579,10 +579,10 @@ function Jt(e, t) {
|
|
|
579
579
|
depth: e.depth + 1
|
|
580
580
|
};
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function tt() {
|
|
583
583
|
return typeof window < "u" && typeof window.document < "u";
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function rt(e) {
|
|
586
586
|
const t = new URLSearchParams(e);
|
|
587
587
|
return {
|
|
588
588
|
get: (...r) => t.get(...r),
|
|
@@ -611,20 +611,20 @@ function tt(e) {
|
|
|
611
611
|
[Symbol.iterator]: () => t[Symbol.iterator]()
|
|
612
612
|
};
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function nt() {
|
|
615
615
|
let e = 0;
|
|
616
616
|
return () => (++e).toString();
|
|
617
617
|
}
|
|
618
|
-
const hn =
|
|
618
|
+
const hn = nt()();
|
|
619
619
|
function dn(e) {
|
|
620
620
|
return e === hn;
|
|
621
621
|
}
|
|
622
|
-
const
|
|
622
|
+
const ot = nt();
|
|
623
623
|
function Wt(e) {
|
|
624
624
|
return e === void 0 ? "" : e;
|
|
625
625
|
}
|
|
626
626
|
function pe(e, t) {
|
|
627
|
-
const r =
|
|
627
|
+
const r = ot(), n = Wt(e.name), o = ee(e.path), a = ee(e.query), s = ee(e.hash), u = e.meta ?? {}, f = e.state ?? {}, i = xe({ id: r, meta: u, state: f, ...e, props: t }), m = {
|
|
628
628
|
id: r,
|
|
629
629
|
matched: i,
|
|
630
630
|
matches: [i],
|
|
@@ -635,20 +635,20 @@ function pe(e, t) {
|
|
|
635
635
|
meta: u,
|
|
636
636
|
state: f,
|
|
637
637
|
depth: 1,
|
|
638
|
-
host:
|
|
638
|
+
host: Q(),
|
|
639
639
|
prefetch: e.prefetch
|
|
640
640
|
}, b = Ft(e) ? Jt(e.parent, m) : m;
|
|
641
641
|
return we(b.path.params, b.query.params, b.hash.params), b;
|
|
642
642
|
}
|
|
643
|
-
const Be = { template: "<div>This is component</div>" },
|
|
643
|
+
const Be = { template: "<div>This is component</div>" }, at = pe({
|
|
644
644
|
name: "parentA",
|
|
645
645
|
path: "/parentA/[paramA]"
|
|
646
646
|
}), Gt = pe({
|
|
647
|
-
parent:
|
|
647
|
+
parent: at,
|
|
648
648
|
name: "parentA.childA",
|
|
649
649
|
path: "/childA/[?paramB]"
|
|
650
650
|
}), pn = pe({
|
|
651
|
-
parent:
|
|
651
|
+
parent: at,
|
|
652
652
|
name: "parentA.childB",
|
|
653
653
|
path: "/childB/[paramD]",
|
|
654
654
|
component: Be
|
|
@@ -671,37 +671,37 @@ const yn = "lazy", gn = {
|
|
|
671
671
|
components: !0,
|
|
672
672
|
props: !1
|
|
673
673
|
};
|
|
674
|
-
function
|
|
674
|
+
function ke(e) {
|
|
675
675
|
return ["eager", "lazy", "intent"].includes(e);
|
|
676
676
|
}
|
|
677
|
-
function
|
|
678
|
-
const o =
|
|
677
|
+
function Qt({ routerPrefetch: e, routePrefetch: t, linkPrefetch: r }, n) {
|
|
678
|
+
const o = Me(r, n), a = Me(t, n), s = Me(e, n), u = [
|
|
679
679
|
o,
|
|
680
680
|
a,
|
|
681
681
|
s,
|
|
682
682
|
gn[n],
|
|
683
683
|
yn
|
|
684
|
-
].reduce((f, i) =>
|
|
685
|
-
return
|
|
684
|
+
].reduce((f, i) => ke(f) ? f : f === !0 && ke(i) ? i : f === !0 && !ke(i) ? f : f === void 0 ? i : f, void 0);
|
|
685
|
+
return ke(u) ? u : !1;
|
|
686
686
|
}
|
|
687
|
-
function
|
|
688
|
-
return
|
|
687
|
+
function Me(e, t) {
|
|
688
|
+
return Vt(e) ? e[t] : e;
|
|
689
689
|
}
|
|
690
|
-
class
|
|
690
|
+
class zt extends Error {
|
|
691
691
|
constructor() {
|
|
692
692
|
super("Uncaught CallbackContextAbortError");
|
|
693
693
|
M(this, "response");
|
|
694
694
|
this.response = { status: "ABORT" };
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
class
|
|
697
|
+
class de extends Error {
|
|
698
698
|
constructor(r) {
|
|
699
699
|
super("Uncaught CallbackContextPushError");
|
|
700
700
|
M(this, "response");
|
|
701
701
|
this.response = { status: "PUSH", to: r };
|
|
702
702
|
}
|
|
703
703
|
}
|
|
704
|
-
class
|
|
704
|
+
class Ne extends Error {
|
|
705
705
|
constructor(r) {
|
|
706
706
|
super("Uncaught CallbackContextRejectionError");
|
|
707
707
|
M(this, "response");
|
|
@@ -710,24 +710,24 @@ class Ce extends Error {
|
|
|
710
710
|
}
|
|
711
711
|
function Kt() {
|
|
712
712
|
return { reject: (o) => {
|
|
713
|
-
throw new
|
|
713
|
+
throw new Ne(o);
|
|
714
714
|
}, push: (...o) => {
|
|
715
|
-
throw new
|
|
715
|
+
throw new de(o);
|
|
716
716
|
}, replace: (o, a, s) => {
|
|
717
717
|
if (T(o)) {
|
|
718
718
|
const i = a ?? {};
|
|
719
|
-
throw new
|
|
719
|
+
throw new de([o, { ...i, replace: !0 }]);
|
|
720
720
|
}
|
|
721
721
|
const u = a, f = s ?? {};
|
|
722
|
-
throw new
|
|
722
|
+
throw new de([o, u, { ...f, replace: !0 }]);
|
|
723
723
|
}, abort: () => {
|
|
724
|
-
throw new
|
|
724
|
+
throw new zt();
|
|
725
725
|
} };
|
|
726
726
|
}
|
|
727
727
|
function Yt(e) {
|
|
728
728
|
return typeof e == "object" && e !== null && "then" in e;
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function dt(e) {
|
|
731
731
|
try {
|
|
732
732
|
const t = e();
|
|
733
733
|
return Yt(t) ? t.catch((r) => r) : t;
|
|
@@ -737,10 +737,10 @@ function ht(e) {
|
|
|
737
737
|
}
|
|
738
738
|
const Xt = Symbol();
|
|
739
739
|
function Rn() {
|
|
740
|
-
const e = $e(/* @__PURE__ */ new Map()), { push: t, replace: r, reject: n } = Kt(), o = (y, h, g) => h.matches.filter((c) =>
|
|
740
|
+
const e = $e(/* @__PURE__ */ new Map()), { push: t, replace: r, reject: n } = Kt(), o = (y, h, g) => h.matches.filter((c) => Qt({ ...g, routePrefetch: c.prefetch }, "props") === y).flatMap((c) => b(c)).reduce((c, { id: l, name: A, props: R }) => {
|
|
741
741
|
if (!R)
|
|
742
742
|
return c;
|
|
743
|
-
const w = m(l, A, h), S =
|
|
743
|
+
const w = m(l, A, h), S = dt(() => R(h, {
|
|
744
744
|
push: t,
|
|
745
745
|
replace: r,
|
|
746
746
|
reject: n,
|
|
@@ -758,7 +758,7 @@ function Rn() {
|
|
|
758
758
|
continue;
|
|
759
759
|
const w = m(l, A, y);
|
|
760
760
|
if (g.push(w), !e.has(w)) {
|
|
761
|
-
const S =
|
|
761
|
+
const S = dt(() => R(y, {
|
|
762
762
|
push: t,
|
|
763
763
|
replace: r,
|
|
764
764
|
reject: n,
|
|
@@ -776,7 +776,7 @@ function Rn() {
|
|
|
776
776
|
try {
|
|
777
777
|
return await Promise.all(c), { status: "SUCCESS" };
|
|
778
778
|
} catch (l) {
|
|
779
|
-
if (l instanceof
|
|
779
|
+
if (l instanceof de || l instanceof Ne)
|
|
780
780
|
return l.response;
|
|
781
781
|
throw l;
|
|
782
782
|
}
|
|
@@ -787,12 +787,12 @@ function Rn() {
|
|
|
787
787
|
function f(y, h = !1) {
|
|
788
788
|
const g = y.matches.at(-2);
|
|
789
789
|
if (g)
|
|
790
|
-
return
|
|
790
|
+
return lt(g) ? {
|
|
791
791
|
name: g.name ?? "",
|
|
792
792
|
get props() {
|
|
793
793
|
return i(g, "default", y, h);
|
|
794
794
|
}
|
|
795
|
-
} :
|
|
795
|
+
} : ht(g) ? {
|
|
796
796
|
name: g.name ?? "",
|
|
797
797
|
props: new Proxy({}, {
|
|
798
798
|
get(c, l) {
|
|
@@ -819,13 +819,13 @@ function Rn() {
|
|
|
819
819
|
return [y, h, g.id, JSON.stringify(g.params)].join("-");
|
|
820
820
|
}
|
|
821
821
|
function b(y) {
|
|
822
|
-
return
|
|
822
|
+
return lt(y) ? [
|
|
823
823
|
{
|
|
824
824
|
id: y.id,
|
|
825
825
|
name: "default",
|
|
826
826
|
props: y.props
|
|
827
827
|
}
|
|
828
|
-
] :
|
|
828
|
+
] : ht(y) ? Object.entries(y.props).map(([h, g]) => ({ id: y.id, name: h, props: g })) : [];
|
|
829
829
|
}
|
|
830
830
|
function U(y) {
|
|
831
831
|
for (const h of e.keys())
|
|
@@ -839,7 +839,7 @@ function Rn() {
|
|
|
839
839
|
};
|
|
840
840
|
}
|
|
841
841
|
function er() {
|
|
842
|
-
const e =
|
|
842
|
+
const e = ce(Xt);
|
|
843
843
|
if (!e)
|
|
844
844
|
throw new Re();
|
|
845
845
|
return e;
|
|
@@ -847,12 +847,12 @@ function er() {
|
|
|
847
847
|
const wn = Ar(() => new Promise((e) => {
|
|
848
848
|
e({ default: { template: "foo" } });
|
|
849
849
|
}));
|
|
850
|
-
function
|
|
850
|
+
function pt(e) {
|
|
851
851
|
return e.name === wn.name && "__asyncLoader" in e;
|
|
852
852
|
}
|
|
853
853
|
const tr = Symbol("visibilityObserver");
|
|
854
854
|
function vn(e) {
|
|
855
|
-
const t =
|
|
855
|
+
const t = ce(tr);
|
|
856
856
|
if (!t)
|
|
857
857
|
throw new Re();
|
|
858
858
|
return ne(e, (n, o) => {
|
|
@@ -863,7 +863,7 @@ function vn(e) {
|
|
|
863
863
|
isElementVisible: Z(() => e.value ? t.isElementVisible(e.value) : !1)
|
|
864
864
|
};
|
|
865
865
|
}
|
|
866
|
-
function
|
|
866
|
+
function mt(e, t, r) {
|
|
867
867
|
ne(e, (n, o) => {
|
|
868
868
|
n && n.addEventListener(t, r), o && o.removeEventListener(t, r);
|
|
869
869
|
}, { immediate: !0 }), _e(() => {
|
|
@@ -880,7 +880,7 @@ function En(e) {
|
|
|
880
880
|
}, { immediate: !0 }), ne(a, (i) => {
|
|
881
881
|
const { route: m, ...b } = _(e);
|
|
882
882
|
!m || !i || f("lazy", m, b);
|
|
883
|
-
}, { immediate: !0 }),
|
|
883
|
+
}, { immediate: !0 }), mt(r, "focusin", u), mt(r, "mouseover", u);
|
|
884
884
|
function u() {
|
|
885
885
|
const { route: i, ...m } = _(e);
|
|
886
886
|
i && f("intent", i, m);
|
|
@@ -895,11 +895,11 @@ function En(e) {
|
|
|
895
895
|
}
|
|
896
896
|
function bn(e, t, r) {
|
|
897
897
|
t.matches.forEach((n) => {
|
|
898
|
-
|
|
898
|
+
Qt({
|
|
899
899
|
...r,
|
|
900
900
|
routePrefetch: n.prefetch
|
|
901
|
-
}, "components") === e && (Mt(n) &&
|
|
902
|
-
|
|
901
|
+
}, "components") === e && (Mt(n) && pt(n.component) && n.component.__asyncLoader(), Tt(n) && Object.values(n.components).forEach((a) => {
|
|
902
|
+
pt(a) && a.__asyncLoader();
|
|
903
903
|
}));
|
|
904
904
|
});
|
|
905
905
|
}
|
|
@@ -991,7 +991,7 @@ function Sn(e, t) {
|
|
|
991
991
|
function nr(e, t, { exact: r } = {}) {
|
|
992
992
|
return Pn(e) ? t === void 0 ? !0 : r ? e.matched.name === t : e.matches.map((n) => n.name).includes(t) : !1;
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function st(...e) {
|
|
995
995
|
const t = new URLSearchParams();
|
|
996
996
|
for (const r of e) {
|
|
997
997
|
const n = new URLSearchParams(r);
|
|
@@ -1001,7 +1001,7 @@ function at(...e) {
|
|
|
1001
1001
|
return t;
|
|
1002
1002
|
}
|
|
1003
1003
|
function An(e, t = {}, r = {}) {
|
|
1004
|
-
const n =
|
|
1004
|
+
const n = Qe(), o = Z(() => {
|
|
1005
1005
|
const h = _(e);
|
|
1006
1006
|
return typeof h != "string" ? h : T(h) ? n.find(h, _(r)) : n.resolve(h, _(t), _(r));
|
|
1007
1007
|
}), a = Z(() => {
|
|
@@ -1028,7 +1028,7 @@ function An(e, t = {}, r = {}) {
|
|
|
1028
1028
|
b();
|
|
1029
1029
|
const g = {
|
|
1030
1030
|
replace: (h == null ? void 0 : h.replace) ?? i.value.replace,
|
|
1031
|
-
query:
|
|
1031
|
+
query: st(i.value.query, h == null ? void 0 : h.query),
|
|
1032
1032
|
hash: (h == null ? void 0 : h.hash) ?? i.value.hash,
|
|
1033
1033
|
state: { ...i.value.state, ...h == null ? void 0 : h.state }
|
|
1034
1034
|
}, c = _(e);
|
|
@@ -1056,7 +1056,7 @@ const kn = ["href"], xn = /* @__PURE__ */ ge({
|
|
|
1056
1056
|
state: {}
|
|
1057
1057
|
},
|
|
1058
1058
|
setup(e) {
|
|
1059
|
-
const t = e, r =
|
|
1059
|
+
const t = e, r = Qe(), n = Z(() => U(t.to)), o = Z(() => y(t.to)), a = Z(() => {
|
|
1060
1060
|
const { to: g, ...c } = t;
|
|
1061
1061
|
return c;
|
|
1062
1062
|
}), { element: s, isMatch: u, isExactMatch: f, isExternal: i, push: m } = An(() => typeof t.to == "function" ? t.to(r.resolve) : t.to, a), b = Z(() => ({
|
|
@@ -1080,25 +1080,25 @@ const kn = ["href"], xn = /* @__PURE__ */ ge({
|
|
|
1080
1080
|
function h(g) {
|
|
1081
1081
|
g.preventDefault(), m();
|
|
1082
1082
|
}
|
|
1083
|
-
return (g, c) => (
|
|
1083
|
+
return (g, c) => (kt(), xr("a", {
|
|
1084
1084
|
ref_key: "element",
|
|
1085
1085
|
ref: s,
|
|
1086
1086
|
href: o.value,
|
|
1087
1087
|
class: Lr(["router-link", b.value]),
|
|
1088
1088
|
onClick: h
|
|
1089
1089
|
}, [
|
|
1090
|
-
|
|
1090
|
+
xt(g.$slots, "default", Lt(Ur({ route: n.value, isMatch: ve(u), isExactMatch: ve(f), isExternal: ve(i) })))
|
|
1091
1091
|
], 10, kn));
|
|
1092
1092
|
}
|
|
1093
1093
|
}), or = Symbol();
|
|
1094
1094
|
function Ln() {
|
|
1095
|
-
const e =
|
|
1095
|
+
const e = ce(or);
|
|
1096
1096
|
if (!e)
|
|
1097
1097
|
throw new Re();
|
|
1098
1098
|
return e;
|
|
1099
1099
|
}
|
|
1100
1100
|
function ar(e, t) {
|
|
1101
|
-
const r =
|
|
1101
|
+
const r = Qe();
|
|
1102
1102
|
function n() {
|
|
1103
1103
|
if (!e)
|
|
1104
1104
|
return;
|
|
@@ -1108,8 +1108,8 @@ function ar(e, t) {
|
|
|
1108
1108
|
return ne(r.route, n, { immediate: !0, deep: !0 }), r.route;
|
|
1109
1109
|
}
|
|
1110
1110
|
const sr = Symbol();
|
|
1111
|
-
function
|
|
1112
|
-
return
|
|
1111
|
+
function ct() {
|
|
1112
|
+
return ce(sr, 0);
|
|
1113
1113
|
}
|
|
1114
1114
|
function Un(e, t, r) {
|
|
1115
1115
|
return ge({
|
|
@@ -1119,7 +1119,7 @@ function Un(e, t, r) {
|
|
|
1119
1119
|
const n = Br(), o = er(), a = ar();
|
|
1120
1120
|
return () => {
|
|
1121
1121
|
const s = o.getProps(e.id, t, a);
|
|
1122
|
-
return s instanceof Error ? "" : Yt(s) ? n != null && n.suspense ?
|
|
1122
|
+
return s instanceof Error ? "" : Yt(s) ? n != null && n.suspense ? le(Nn, { component: r, props: s }) : le(Bn, { component: r, props: s }) : le(r, s);
|
|
1123
1123
|
};
|
|
1124
1124
|
}
|
|
1125
1125
|
});
|
|
@@ -1128,18 +1128,18 @@ const Bn = ge((e) => {
|
|
|
1128
1128
|
const t = He();
|
|
1129
1129
|
return ne(() => e.props, async (r) => {
|
|
1130
1130
|
t.value = await r;
|
|
1131
|
-
}, { immediate: !0, deep: !0 }), () => t.value instanceof Error ? "" : t.value ?
|
|
1131
|
+
}, { immediate: !0, deep: !0 }), () => t.value instanceof Error ? "" : t.value ? le(e.component, t.value) : "";
|
|
1132
1132
|
}, {
|
|
1133
1133
|
props: ["component", "props"]
|
|
1134
|
-
}),
|
|
1134
|
+
}), Nn = ge(async (e) => {
|
|
1135
1135
|
const t = He();
|
|
1136
1136
|
return t.value = await e.props, ne(() => t.value, async (r) => {
|
|
1137
1137
|
t.value = await r;
|
|
1138
|
-
}, { deep: !0 }), () => t.value instanceof Error ? "" : t.value ?
|
|
1138
|
+
}, { deep: !0 }), () => t.value instanceof Error ? "" : t.value ? le(e.component, t.value) : "";
|
|
1139
1139
|
}, {
|
|
1140
1140
|
props: ["component", "props"]
|
|
1141
1141
|
}), cr = Symbol();
|
|
1142
|
-
function
|
|
1142
|
+
function Cn() {
|
|
1143
1143
|
const e = /* @__PURE__ */ new Map();
|
|
1144
1144
|
return {
|
|
1145
1145
|
getRouteComponents: (r) => {
|
|
@@ -1152,15 +1152,15 @@ function Nn() {
|
|
|
1152
1152
|
};
|
|
1153
1153
|
}
|
|
1154
1154
|
function Vn(e) {
|
|
1155
|
-
return Tt(e) ?
|
|
1155
|
+
return Tt(e) ? yt(e, e.components) : Mt(e) ? yt(e, { default: e.component }) : { default: ir };
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1157
|
+
function yt(e, t) {
|
|
1158
1158
|
return Object.fromEntries(
|
|
1159
1159
|
Object.entries(t).map(([r, n]) => [r, Un(e, r, n)])
|
|
1160
1160
|
);
|
|
1161
1161
|
}
|
|
1162
1162
|
function Zn() {
|
|
1163
|
-
const e =
|
|
1163
|
+
const e = ce(cr);
|
|
1164
1164
|
if (!e)
|
|
1165
1165
|
throw new Re();
|
|
1166
1166
|
return e;
|
|
@@ -1171,20 +1171,20 @@ const ir = /* @__PURE__ */ ge({
|
|
|
1171
1171
|
name: { default: "default" }
|
|
1172
1172
|
},
|
|
1173
1173
|
setup(e) {
|
|
1174
|
-
const t = ar(), r = Ln(), n =
|
|
1175
|
-
|
|
1174
|
+
const t = ar(), r = Ln(), n = ct(), { getRouteComponents: o } = Zn();
|
|
1175
|
+
Nr(sr, n + 1);
|
|
1176
1176
|
const a = Z(() => {
|
|
1177
1177
|
if (r.value)
|
|
1178
1178
|
return r.value.component;
|
|
1179
1179
|
const s = t.matches.at(n);
|
|
1180
1180
|
return s ? o(s)[e.name] : null;
|
|
1181
1181
|
});
|
|
1182
|
-
return (s, u) => a.value ?
|
|
1183
|
-
(
|
|
1182
|
+
return (s, u) => a.value ? xt(s.$slots, "default", Lt(Cr({ key: 0 }, { route: ve(t), component: a.value, rejection: ve(r) })), () => [
|
|
1183
|
+
(kt(), Vr(Zr(a.value)))
|
|
1184
1184
|
]) : jr("", !0);
|
|
1185
1185
|
}
|
|
1186
1186
|
});
|
|
1187
|
-
class
|
|
1187
|
+
class se {
|
|
1188
1188
|
constructor() {
|
|
1189
1189
|
M(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
1190
1190
|
M(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
@@ -1194,70 +1194,70 @@ class ae {
|
|
|
1194
1194
|
M(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
1195
1195
|
}
|
|
1196
1196
|
}
|
|
1197
|
-
const
|
|
1197
|
+
const Pe = (e, t, r) => {
|
|
1198
1198
|
var a, s;
|
|
1199
1199
|
const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
1200
1200
|
return ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
|
|
1201
|
-
},
|
|
1201
|
+
}, Se = (e, t, r) => {
|
|
1202
1202
|
var a, s;
|
|
1203
1203
|
const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
1204
1204
|
return ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
|
|
1205
|
-
},
|
|
1205
|
+
}, Ae = (e, t, r) => {
|
|
1206
1206
|
var n, o;
|
|
1207
1207
|
return ((n = e.matches.at(r)) == null ? void 0 : n.id) === ((o = t == null ? void 0 : t.matches.at(r)) == null ? void 0 : o.id);
|
|
1208
1208
|
};
|
|
1209
|
-
function
|
|
1209
|
+
function gt(e) {
|
|
1210
1210
|
switch (e) {
|
|
1211
1211
|
case "onBeforeRouteEnter":
|
|
1212
1212
|
case "onAfterRouteEnter":
|
|
1213
|
-
return
|
|
1213
|
+
return Pe;
|
|
1214
1214
|
case "onBeforeRouteUpdate":
|
|
1215
1215
|
case "onAfterRouteUpdate":
|
|
1216
|
-
return
|
|
1216
|
+
return Ae;
|
|
1217
1217
|
case "onBeforeRouteLeave":
|
|
1218
1218
|
case "onAfterRouteLeave":
|
|
1219
|
-
return
|
|
1219
|
+
return Se;
|
|
1220
1220
|
default:
|
|
1221
1221
|
throw new Error(`Switch is not exhaustive for lifecycle: ${e}`);
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
1224
|
function jn(e, t) {
|
|
1225
|
-
const r = new
|
|
1225
|
+
const r = new se();
|
|
1226
1226
|
return e.matches.forEach((n, o) => {
|
|
1227
|
-
n.onBeforeRouteEnter &&
|
|
1227
|
+
n.onBeforeRouteEnter && Pe(e, t, o) && he(n.onBeforeRouteEnter).forEach((a) => r.onBeforeRouteEnter.add(a)), n.onBeforeRouteUpdate && Ae(e, t, o) && he(n.onBeforeRouteUpdate).forEach((a) => r.onBeforeRouteUpdate.add(a));
|
|
1228
1228
|
}), t == null || t.matches.forEach((n, o) => {
|
|
1229
|
-
n.onBeforeRouteLeave &&
|
|
1229
|
+
n.onBeforeRouteLeave && Se(e, t, o) && he(n.onBeforeRouteLeave).forEach((a) => r.onBeforeRouteLeave.add(a));
|
|
1230
1230
|
}), r;
|
|
1231
1231
|
}
|
|
1232
1232
|
function $n(e, t) {
|
|
1233
|
-
const r = new
|
|
1233
|
+
const r = new se();
|
|
1234
1234
|
return e.matches.forEach((n, o) => {
|
|
1235
|
-
n.onAfterRouteEnter &&
|
|
1235
|
+
n.onAfterRouteEnter && Pe(e, t, o) && he(n.onAfterRouteEnter).forEach((a) => r.onAfterRouteEnter.add(a)), n.onAfterRouteUpdate && Ae(e, t, o) && he(n.onAfterRouteUpdate).forEach((a) => r.onAfterRouteUpdate.add(a));
|
|
1236
1236
|
}), t == null || t.matches.forEach((n, o) => {
|
|
1237
|
-
n.onAfterRouteLeave &&
|
|
1237
|
+
n.onAfterRouteLeave && Se(e, t, o) && he(n.onAfterRouteLeave).forEach((a) => r.onAfterRouteLeave.add(a));
|
|
1238
1238
|
}), r;
|
|
1239
1239
|
}
|
|
1240
1240
|
function _n(e, t, r) {
|
|
1241
|
-
const n = new
|
|
1241
|
+
const n = new se();
|
|
1242
1242
|
return e.matches.forEach((o, a) => {
|
|
1243
|
-
|
|
1243
|
+
Pe(e, t, a) && r.onBeforeRouteEnter.forEach((s) => n.onBeforeRouteEnter.add(s)), Ae(e, t, a) && r.onBeforeRouteUpdate.forEach((s) => n.onBeforeRouteUpdate.add(s));
|
|
1244
1244
|
}), t == null || t.matches.forEach((o, a) => {
|
|
1245
|
-
|
|
1245
|
+
Se(e, t, a) && r.onBeforeRouteLeave.forEach((s) => n.onBeforeRouteLeave.add(s));
|
|
1246
1246
|
}), n;
|
|
1247
1247
|
}
|
|
1248
1248
|
function Hn(e, t, r) {
|
|
1249
|
-
const n = new
|
|
1249
|
+
const n = new se();
|
|
1250
1250
|
return e.matches.forEach((o, a) => {
|
|
1251
|
-
|
|
1251
|
+
Pe(e, t, a) && r.onAfterRouteEnter.forEach((s) => n.onAfterRouteEnter.add(s)), Ae(e, t, a) && r.onAfterRouteUpdate.forEach((s) => n.onAfterRouteUpdate.add(s));
|
|
1252
1252
|
}), t == null || t.matches.forEach((o, a) => {
|
|
1253
|
-
|
|
1253
|
+
Se(e, t, a) && r.onAfterRouteLeave.forEach((s) => n.onAfterRouteLeave.add(s));
|
|
1254
1254
|
}), n;
|
|
1255
1255
|
}
|
|
1256
1256
|
const ur = Symbol();
|
|
1257
|
-
function
|
|
1257
|
+
function On() {
|
|
1258
1258
|
const e = {
|
|
1259
|
-
global: new
|
|
1260
|
-
component: new
|
|
1259
|
+
global: new se(),
|
|
1260
|
+
component: new se()
|
|
1261
1261
|
}, { reject: t, push: r, replace: n, abort: o } = Kt(), a = (c) => (e.global.onBeforeRouteEnter.add(c), () => e.global.onBeforeRouteEnter.delete(c)), s = (c) => (e.global.onBeforeRouteUpdate.add(c), () => e.global.onBeforeRouteUpdate.delete(c)), u = (c) => (e.global.onBeforeRouteLeave.add(c), () => e.global.onBeforeRouteLeave.delete(c)), f = (c) => (e.global.onAfterRouteEnter.add(c), () => e.global.onAfterRouteEnter.delete(c)), i = (c) => (e.global.onAfterRouteUpdate.add(c), () => e.global.onAfterRouteUpdate.delete(c)), m = (c) => (e.global.onAfterRouteLeave.add(c), () => e.global.onAfterRouteLeave.delete(c));
|
|
1262
1262
|
async function b({ to: c, from: l }) {
|
|
1263
1263
|
const { global: A, component: R } = e, w = jn(c, l), S = _n(c, l, A), x = [
|
|
@@ -1280,7 +1280,7 @@ function qn() {
|
|
|
1280
1280
|
}));
|
|
1281
1281
|
await Promise.all(p);
|
|
1282
1282
|
} catch (p) {
|
|
1283
|
-
if (p instanceof
|
|
1283
|
+
if (p instanceof de || p instanceof Ne || p instanceof zt)
|
|
1284
1284
|
return p.response;
|
|
1285
1285
|
throw p;
|
|
1286
1286
|
}
|
|
@@ -1309,7 +1309,7 @@ function qn() {
|
|
|
1309
1309
|
}));
|
|
1310
1310
|
await Promise.all(p);
|
|
1311
1311
|
} catch (p) {
|
|
1312
|
-
if (p instanceof
|
|
1312
|
+
if (p instanceof de || p instanceof Ne)
|
|
1313
1313
|
return p.response;
|
|
1314
1314
|
throw p;
|
|
1315
1315
|
}
|
|
@@ -1321,14 +1321,14 @@ function qn() {
|
|
|
1321
1321
|
runBeforeRouteHooks: b,
|
|
1322
1322
|
runAfterRouteHooks: U,
|
|
1323
1323
|
addComponentBeforeRouteHook: ({ lifecycle: c, depth: l, hook: A }) => {
|
|
1324
|
-
const R =
|
|
1324
|
+
const R = gt(c), w = e.component[c], S = (x, p) => {
|
|
1325
1325
|
if (R(x, p.from, l))
|
|
1326
1326
|
return A(x, p);
|
|
1327
1327
|
};
|
|
1328
1328
|
return w.add(S), () => w.delete(S);
|
|
1329
1329
|
},
|
|
1330
1330
|
addComponentAfterRouteHook: ({ lifecycle: c, depth: l, hook: A }) => {
|
|
1331
|
-
const R =
|
|
1331
|
+
const R = gt(c), w = e.component[c], S = (x, p) => {
|
|
1332
1332
|
if (R(x, p.from, l))
|
|
1333
1333
|
return A(x, p);
|
|
1334
1334
|
};
|
|
@@ -1346,24 +1346,24 @@ function qn() {
|
|
|
1346
1346
|
};
|
|
1347
1347
|
}
|
|
1348
1348
|
function fr() {
|
|
1349
|
-
const e =
|
|
1349
|
+
const e = ce(ur);
|
|
1350
1350
|
if (!e)
|
|
1351
1351
|
throw new Re();
|
|
1352
1352
|
return e;
|
|
1353
1353
|
}
|
|
1354
1354
|
function lr(e) {
|
|
1355
1355
|
return (t) => {
|
|
1356
|
-
const r =
|
|
1356
|
+
const r = ct(), o = fr().addComponentBeforeRouteHook({ lifecycle: e, hook: t, depth: r - 1 });
|
|
1357
1357
|
return _e(o), o;
|
|
1358
1358
|
};
|
|
1359
1359
|
}
|
|
1360
1360
|
function hr(e) {
|
|
1361
1361
|
return (t) => {
|
|
1362
|
-
const r =
|
|
1362
|
+
const r = ct(), o = fr().addComponentAfterRouteHook({ lifecycle: e, hook: t, depth: r - 1 });
|
|
1363
1363
|
return _e(o), o;
|
|
1364
1364
|
};
|
|
1365
1365
|
}
|
|
1366
|
-
const
|
|
1366
|
+
const xo = lr("onBeforeRouteLeave"), Lo = lr("onBeforeRouteUpdate"), Uo = hr("onAfterRouteLeave"), Bo = hr("onAfterRouteUpdate");
|
|
1367
1367
|
function Y() {
|
|
1368
1368
|
return Y = Object.assign ? Object.assign.bind() : function(e) {
|
|
1369
1369
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -1391,8 +1391,8 @@ function te(e, t) {
|
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
|
-
var
|
|
1395
|
-
function
|
|
1394
|
+
var Ce = "beforeunload", qn = "hashchange", dr = "popstate";
|
|
1395
|
+
function Rt(e) {
|
|
1396
1396
|
e === void 0 && (e = {});
|
|
1397
1397
|
var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
1398
1398
|
function a() {
|
|
@@ -1479,7 +1479,7 @@ function gt(e) {
|
|
|
1479
1479
|
R(p, d);
|
|
1480
1480
|
}
|
|
1481
1481
|
if (l(E, k, L)) {
|
|
1482
|
-
var
|
|
1482
|
+
var N = c(k, m + 1), V = N[0], $ = N[1];
|
|
1483
1483
|
try {
|
|
1484
1484
|
o.pushState(V, "", $);
|
|
1485
1485
|
} catch {
|
|
@@ -1494,7 +1494,7 @@ function gt(e) {
|
|
|
1494
1494
|
w(p, d);
|
|
1495
1495
|
}
|
|
1496
1496
|
if (l(E, k, L)) {
|
|
1497
|
-
var
|
|
1497
|
+
var N = c(k, m), V = N[0], $ = N[1];
|
|
1498
1498
|
o.replaceState(V, "", $), A(E);
|
|
1499
1499
|
}
|
|
1500
1500
|
}
|
|
@@ -1523,8 +1523,8 @@ function gt(e) {
|
|
|
1523
1523
|
},
|
|
1524
1524
|
block: function(d) {
|
|
1525
1525
|
var E = y.push(d);
|
|
1526
|
-
return y.length === 1 && n.addEventListener(
|
|
1527
|
-
E(), y.length || n.removeEventListener(
|
|
1526
|
+
return y.length === 1 && n.addEventListener(Ce, Ve), function() {
|
|
1527
|
+
E(), y.length || n.removeEventListener(Ce, Ve);
|
|
1528
1528
|
};
|
|
1529
1529
|
}
|
|
1530
1530
|
};
|
|
@@ -1534,13 +1534,13 @@ function In(e) {
|
|
|
1534
1534
|
e === void 0 && (e = {});
|
|
1535
1535
|
var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
1536
1536
|
function a() {
|
|
1537
|
-
var d = Ee(n.location.hash.substr(1)), E = d.pathname, k = E === void 0 ? "/" : E, L = d.search,
|
|
1538
|
-
return [
|
|
1537
|
+
var d = Ee(n.location.hash.substr(1)), E = d.pathname, k = E === void 0 ? "/" : E, L = d.search, N = L === void 0 ? "" : L, V = d.hash, $ = V === void 0 ? "" : V, q = o.state || {};
|
|
1538
|
+
return [q.idx, me({
|
|
1539
1539
|
pathname: k,
|
|
1540
|
-
search:
|
|
1540
|
+
search: N,
|
|
1541
1541
|
hash: $,
|
|
1542
|
-
state:
|
|
1543
|
-
key:
|
|
1542
|
+
state: q.usr || null,
|
|
1543
|
+
key: q.key || "default"
|
|
1544
1544
|
})];
|
|
1545
1545
|
}
|
|
1546
1546
|
var s = null;
|
|
@@ -1551,14 +1551,14 @@ function In(e) {
|
|
|
1551
1551
|
var d = j.Pop, E = a(), k = E[0], L = E[1];
|
|
1552
1552
|
if (y.length)
|
|
1553
1553
|
if (k != null) {
|
|
1554
|
-
var
|
|
1555
|
-
|
|
1554
|
+
var N = m - k;
|
|
1555
|
+
N && (s = {
|
|
1556
1556
|
action: d,
|
|
1557
1557
|
location: L,
|
|
1558
1558
|
retry: function() {
|
|
1559
|
-
x(
|
|
1559
|
+
x(N * -1);
|
|
1560
1560
|
}
|
|
1561
|
-
}, x(
|
|
1561
|
+
}, x(N));
|
|
1562
1562
|
} else
|
|
1563
1563
|
process.env.NODE_ENV !== "production" && te(
|
|
1564
1564
|
!1,
|
|
@@ -1571,7 +1571,7 @@ function In(e) {
|
|
|
1571
1571
|
R(d);
|
|
1572
1572
|
}
|
|
1573
1573
|
}
|
|
1574
|
-
n.addEventListener(dr, u), n.addEventListener(
|
|
1574
|
+
n.addEventListener(dr, u), n.addEventListener(qn, function() {
|
|
1575
1575
|
var d = a(), E = d[1];
|
|
1576
1576
|
re(E) !== re(b) && u();
|
|
1577
1577
|
});
|
|
@@ -1624,27 +1624,27 @@ function In(e) {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
function w(d, E) {
|
|
1626
1626
|
var k = j.Push, L = c(d, E);
|
|
1627
|
-
function
|
|
1627
|
+
function N() {
|
|
1628
1628
|
w(d, E);
|
|
1629
1629
|
}
|
|
1630
|
-
if (process.env.NODE_ENV !== "production" && te(L.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(d) + ")"), A(k, L,
|
|
1631
|
-
var V = l(L, m + 1), $ = V[0],
|
|
1630
|
+
if (process.env.NODE_ENV !== "production" && te(L.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(d) + ")"), A(k, L, N)) {
|
|
1631
|
+
var V = l(L, m + 1), $ = V[0], q = V[1];
|
|
1632
1632
|
try {
|
|
1633
|
-
o.pushState($, "",
|
|
1633
|
+
o.pushState($, "", q);
|
|
1634
1634
|
} catch {
|
|
1635
|
-
n.location.assign(
|
|
1635
|
+
n.location.assign(q);
|
|
1636
1636
|
}
|
|
1637
1637
|
R(k);
|
|
1638
1638
|
}
|
|
1639
1639
|
}
|
|
1640
1640
|
function S(d, E) {
|
|
1641
1641
|
var k = j.Replace, L = c(d, E);
|
|
1642
|
-
function
|
|
1642
|
+
function N() {
|
|
1643
1643
|
S(d, E);
|
|
1644
1644
|
}
|
|
1645
|
-
if (process.env.NODE_ENV !== "production" && te(L.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(d) + ")"), A(k, L,
|
|
1646
|
-
var V = l(L, m), $ = V[0],
|
|
1647
|
-
o.replaceState($, "",
|
|
1645
|
+
if (process.env.NODE_ENV !== "production" && te(L.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(d) + ")"), A(k, L, N)) {
|
|
1646
|
+
var V = l(L, m), $ = V[0], q = V[1];
|
|
1647
|
+
o.replaceState($, "", q), R(k);
|
|
1648
1648
|
}
|
|
1649
1649
|
}
|
|
1650
1650
|
function x(d) {
|
|
@@ -1672,14 +1672,14 @@ function In(e) {
|
|
|
1672
1672
|
},
|
|
1673
1673
|
block: function(E) {
|
|
1674
1674
|
var k = y.push(E);
|
|
1675
|
-
return y.length === 1 && n.addEventListener(
|
|
1676
|
-
k(), y.length || n.removeEventListener(
|
|
1675
|
+
return y.length === 1 && n.addEventListener(Ce, Ve), function() {
|
|
1676
|
+
k(), y.length || n.removeEventListener(Ce, Ve);
|
|
1677
1677
|
};
|
|
1678
1678
|
}
|
|
1679
1679
|
};
|
|
1680
1680
|
return p;
|
|
1681
1681
|
}
|
|
1682
|
-
function
|
|
1682
|
+
function wt(e) {
|
|
1683
1683
|
e === void 0 && (e = {});
|
|
1684
1684
|
var t = e, r = t.initialEntries, n = r === void 0 ? ["/"] : r, o = t.initialIndex, a = n.map(function(R) {
|
|
1685
1685
|
var w = me(Y({
|
|
@@ -1690,7 +1690,7 @@ function Rt(e) {
|
|
|
1690
1690
|
key: Ze()
|
|
1691
1691
|
}, typeof R == "string" ? Ee(R) : R));
|
|
1692
1692
|
return process.env.NODE_ENV !== "production" && te(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(R) + ")"), w;
|
|
1693
|
-
}), s =
|
|
1693
|
+
}), s = vt(o ?? a.length - 1, 0, a.length - 1), u = j.Pop, f = a[s], i = ye(), m = ye();
|
|
1694
1694
|
function b(R) {
|
|
1695
1695
|
return typeof R == "string" ? R : re(R);
|
|
1696
1696
|
}
|
|
@@ -1732,7 +1732,7 @@ function Rt(e) {
|
|
|
1732
1732
|
process.env.NODE_ENV !== "production" && te(f.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(R) + ")"), y(S, x, p) && (a[s] = x, h(S, x));
|
|
1733
1733
|
}
|
|
1734
1734
|
function l(R) {
|
|
1735
|
-
var w =
|
|
1735
|
+
var w = vt(s + R, 0, a.length - 1), S = j.Pop, x = a[w];
|
|
1736
1736
|
function p() {
|
|
1737
1737
|
l(R);
|
|
1738
1738
|
}
|
|
@@ -1767,7 +1767,7 @@ function Rt(e) {
|
|
|
1767
1767
|
};
|
|
1768
1768
|
return A;
|
|
1769
1769
|
}
|
|
1770
|
-
function
|
|
1770
|
+
function vt(e, t, r) {
|
|
1771
1771
|
return Math.min(Math.max(e, t), r);
|
|
1772
1772
|
}
|
|
1773
1773
|
function Ve(e) {
|
|
@@ -1824,7 +1824,7 @@ function Dn(e, t) {
|
|
|
1824
1824
|
updateRoute: n
|
|
1825
1825
|
};
|
|
1826
1826
|
}
|
|
1827
|
-
function
|
|
1827
|
+
function O(e) {
|
|
1828
1828
|
return !e.startsWith("http") ? Mn(e) : Fn(e);
|
|
1829
1829
|
}
|
|
1830
1830
|
function Fn(e) {
|
|
@@ -1849,7 +1849,7 @@ function Mn(e) {
|
|
|
1849
1849
|
}
|
|
1850
1850
|
function Tn(e) {
|
|
1851
1851
|
return (t) => {
|
|
1852
|
-
const { host: r } =
|
|
1852
|
+
const { host: r } = O(t);
|
|
1853
1853
|
return !(r === void 0 || r === e);
|
|
1854
1854
|
};
|
|
1855
1855
|
}
|
|
@@ -1880,11 +1880,11 @@ function Jn({ mode: e, listener: t }) {
|
|
|
1880
1880
|
function Wn(e = "auto") {
|
|
1881
1881
|
switch (e) {
|
|
1882
1882
|
case "auto":
|
|
1883
|
-
return
|
|
1883
|
+
return tt() ? Rt() : wt();
|
|
1884
1884
|
case "browser":
|
|
1885
|
-
return gt();
|
|
1886
|
-
case "memory":
|
|
1887
1885
|
return Rt();
|
|
1886
|
+
case "memory":
|
|
1887
|
+
return wt();
|
|
1888
1888
|
case "hash":
|
|
1889
1889
|
return In();
|
|
1890
1890
|
default:
|
|
@@ -1893,15 +1893,15 @@ function Wn(e = "auto") {
|
|
|
1893
1893
|
}
|
|
1894
1894
|
}
|
|
1895
1895
|
function Gn(e) {
|
|
1896
|
-
return ge(() => () =>
|
|
1896
|
+
return ge(() => () => le("h1", e), {
|
|
1897
1897
|
name: e,
|
|
1898
1898
|
props: []
|
|
1899
1899
|
});
|
|
1900
1900
|
}
|
|
1901
|
-
function
|
|
1901
|
+
function Qn(e) {
|
|
1902
1902
|
const t = (a) => xe(e[a] ?? Gn(a)), r = (a) => {
|
|
1903
1903
|
const s = xe(t(a)), u = {
|
|
1904
|
-
id:
|
|
1904
|
+
id: ot(),
|
|
1905
1905
|
component: s,
|
|
1906
1906
|
meta: {},
|
|
1907
1907
|
state: {}
|
|
@@ -1911,7 +1911,7 @@ function zn(e) {
|
|
|
1911
1911
|
matched: u,
|
|
1912
1912
|
matches: [u],
|
|
1913
1913
|
name: a,
|
|
1914
|
-
query:
|
|
1914
|
+
query: rt(""),
|
|
1915
1915
|
params: {},
|
|
1916
1916
|
state: {},
|
|
1917
1917
|
href: "/",
|
|
@@ -1932,7 +1932,7 @@ function zn(e) {
|
|
|
1932
1932
|
getRejectionRoute: r
|
|
1933
1933
|
};
|
|
1934
1934
|
}
|
|
1935
|
-
class
|
|
1935
|
+
class zn extends Error {
|
|
1936
1936
|
constructor() {
|
|
1937
1937
|
super("initialUrl must be set if window.location is unavailable");
|
|
1938
1938
|
}
|
|
@@ -1940,9 +1940,9 @@ class Qn extends Error {
|
|
|
1940
1940
|
function Kn(e) {
|
|
1941
1941
|
if (e)
|
|
1942
1942
|
return e;
|
|
1943
|
-
if (
|
|
1943
|
+
if (tt())
|
|
1944
1944
|
return window.location.toString();
|
|
1945
|
-
throw new
|
|
1945
|
+
throw new zn();
|
|
1946
1946
|
}
|
|
1947
1947
|
function mr(e) {
|
|
1948
1948
|
return !!e && typeof e == "object";
|
|
@@ -1951,9 +1951,9 @@ const je = !0;
|
|
|
1951
1951
|
function Yn(e, t, r) {
|
|
1952
1952
|
if (mr(e) && t in e) {
|
|
1953
1953
|
const n = e[t];
|
|
1954
|
-
return typeof n == "string" ?
|
|
1954
|
+
return typeof n == "string" ? oe(n, r, je) : n;
|
|
1955
1955
|
}
|
|
1956
|
-
return
|
|
1956
|
+
return oe(void 0, r, je);
|
|
1957
1957
|
}
|
|
1958
1958
|
function yr(e, t) {
|
|
1959
1959
|
const r = {};
|
|
@@ -1966,11 +1966,11 @@ function yr(e, t) {
|
|
|
1966
1966
|
function Xn(e, t, r) {
|
|
1967
1967
|
if (mr(e) && t in e) {
|
|
1968
1968
|
const n = e[t];
|
|
1969
|
-
return
|
|
1969
|
+
return ae(n, r, je);
|
|
1970
1970
|
}
|
|
1971
|
-
return
|
|
1971
|
+
return ae(void 0, r, je);
|
|
1972
1972
|
}
|
|
1973
|
-
const
|
|
1973
|
+
const Et = (e, t) => {
|
|
1974
1974
|
const r = {};
|
|
1975
1975
|
for (const [n, o] of Object.entries(e)) {
|
|
1976
1976
|
const a = Xn(t, n, o);
|
|
@@ -1979,7 +1979,7 @@ const vt = (e, t) => {
|
|
|
1979
1979
|
return r;
|
|
1980
1980
|
};
|
|
1981
1981
|
function eo() {
|
|
1982
|
-
const e = $e(/* @__PURE__ */ new Map()), t =
|
|
1982
|
+
const e = $e(/* @__PURE__ */ new Map()), t = tt() ? s() : null, r = (u) => {
|
|
1983
1983
|
e.set(u, !1), t == null || t.observe(u);
|
|
1984
1984
|
}, n = (u) => {
|
|
1985
1985
|
e.delete(u), t == null || t.unobserve(u);
|
|
@@ -2013,7 +2013,7 @@ function Rr(e, t) {
|
|
|
2013
2013
|
if (!t)
|
|
2014
2014
|
return e;
|
|
2015
2015
|
const { name: r, param: n, value: o } = t, a = wr(e, r);
|
|
2016
|
-
return Ue(e, a).reduce((u, f) => f === void 0 ? u : u.replace(f, () =>
|
|
2016
|
+
return Ue(e, a).reduce((u, f) => f === void 0 ? u : u.replace(f, () => ae(o, n, r.startsWith("?"))), e);
|
|
2017
2017
|
}
|
|
2018
2018
|
function wr(e, t) {
|
|
2019
2019
|
const r = [
|
|
@@ -2026,35 +2026,35 @@ function wr(e, t) {
|
|
|
2026
2026
|
function ro(e, t) {
|
|
2027
2027
|
if (!t.startsWith("?"))
|
|
2028
2028
|
return e;
|
|
2029
|
-
const r = new RegExp(`\\${
|
|
2029
|
+
const r = new RegExp(`\\${z}\\${t}\\${X}`, "g");
|
|
2030
2030
|
return e.replace(r, "(.*)");
|
|
2031
2031
|
}
|
|
2032
2032
|
function no(e, t) {
|
|
2033
2033
|
if (t.startsWith("?"))
|
|
2034
2034
|
return e;
|
|
2035
|
-
const r = new RegExp(`\\${
|
|
2035
|
+
const r = new RegExp(`\\${z}${t}\\${X}`, "g");
|
|
2036
2036
|
return e.replace(r, "(.+)");
|
|
2037
2037
|
}
|
|
2038
2038
|
function vr({ protocol: e, host: t, pathname: r, search: n, searchParams: o, hash: a }) {
|
|
2039
2039
|
const s = new URL("https://localhost");
|
|
2040
2040
|
e && (s.protocol = e), t && (s.host = t), r && (s.pathname = r), o ? s.search = new URLSearchParams(o).toString() : n && (s.search = n), a && (s.hash = a);
|
|
2041
2041
|
const u = s.toString().replace(/^https:\/\/localhost\/*/, "/");
|
|
2042
|
-
return
|
|
2042
|
+
return Ut(u);
|
|
2043
2043
|
}
|
|
2044
2044
|
function oo(e, t = {}) {
|
|
2045
|
-
const { params: r = {}, query: n } = t, o = so(e.query, r), a =
|
|
2045
|
+
const { params: r = {}, query: n } = t, o = so(e.query, r), a = st(o, n), s = bt(e.path, r), u = e.hash.value ? bt(e.hash, r) : t.hash, f = ao(e.host, r), { protocol: i, host: m } = O(f);
|
|
2046
2046
|
return vr({ protocol: i, host: m, pathname: s, searchParams: a, hash: u });
|
|
2047
2047
|
}
|
|
2048
2048
|
function ao(e, t) {
|
|
2049
2049
|
const r = e.value && !e.value.startsWith("http") ? `https://${e.value}` : e.value;
|
|
2050
2050
|
return Object.entries(e.params).reduce((n, [o, a]) => {
|
|
2051
|
-
const s =
|
|
2051
|
+
const s = be(`${z}${o}${X}`);
|
|
2052
2052
|
return s ? Rr(n, { name: o, param: a, value: t[s] }) : n;
|
|
2053
2053
|
}, r);
|
|
2054
2054
|
}
|
|
2055
|
-
function
|
|
2055
|
+
function bt(e, t) {
|
|
2056
2056
|
return Object.entries(e.params).reduce((r, [n, o]) => {
|
|
2057
|
-
const a =
|
|
2057
|
+
const a = be(`${z}${n}${X}`);
|
|
2058
2058
|
return a ? Rr(r, { name: n, param: o, value: t[a] }) : r;
|
|
2059
2059
|
}, e.value);
|
|
2060
2060
|
}
|
|
@@ -2063,129 +2063,140 @@ function so(e, t) {
|
|
|
2063
2063
|
if (!e.value)
|
|
2064
2064
|
return r;
|
|
2065
2065
|
for (const [n, o] of Array.from(r.entries())) {
|
|
2066
|
-
const a =
|
|
2066
|
+
const a = be(o);
|
|
2067
2067
|
if (!a)
|
|
2068
2068
|
continue;
|
|
2069
|
-
const u =
|
|
2069
|
+
const u = et(o), f = u ? `?${a}` : a, i = ae(t[a], e.params[f], u), m = t[a] === void 0 && i === "";
|
|
2070
2070
|
u && m ? r.delete(n, o) : r.set(n, i);
|
|
2071
2071
|
}
|
|
2072
2072
|
return r;
|
|
2073
2073
|
}
|
|
2074
2074
|
const co = (e, t) => {
|
|
2075
2075
|
try {
|
|
2076
|
-
|
|
2076
|
+
it(e, t);
|
|
2077
2077
|
} catch {
|
|
2078
2078
|
return !1;
|
|
2079
2079
|
}
|
|
2080
2080
|
return !0;
|
|
2081
|
-
},
|
|
2082
|
-
const { protocol: r, host: n, pathname: o, search: a, hash: s } =
|
|
2081
|
+
}, it = (e, t) => {
|
|
2082
|
+
const { protocol: r, host: n, pathname: o, search: a, hash: s } = O(t);
|
|
2083
2083
|
return {
|
|
2084
|
-
...
|
|
2085
|
-
...
|
|
2086
|
-
...
|
|
2087
|
-
...
|
|
2084
|
+
...Te(e.host, `${r}//${n}`),
|
|
2085
|
+
...Te(e.path, o),
|
|
2086
|
+
...io(e.query, a),
|
|
2087
|
+
...Te(e.hash, s)
|
|
2088
2088
|
};
|
|
2089
2089
|
};
|
|
2090
|
-
function
|
|
2090
|
+
function Te(e, t) {
|
|
2091
2091
|
const r = {}, n = decodeURIComponent(t);
|
|
2092
2092
|
for (const [o, a] of Object.entries(e.params)) {
|
|
2093
|
-
const s = o.startsWith("?"), u = s ? o.slice(1) : o, f = gr(n, e.value, o), i =
|
|
2093
|
+
const s = o.startsWith("?"), u = s ? o.slice(1) : o, f = gr(n, e.value, o), i = oe(f, a, s);
|
|
2094
2094
|
r[u] = i;
|
|
2095
2095
|
}
|
|
2096
2096
|
return r;
|
|
2097
2097
|
}
|
|
2098
|
-
function io(e, t
|
|
2098
|
+
function io(e, t) {
|
|
2099
|
+
const r = {}, n = new URLSearchParams(e.value), o = new URLSearchParams(t);
|
|
2100
|
+
for (const [a, s] of Array.from(n.entries())) {
|
|
2101
|
+
const u = be(s);
|
|
2102
|
+
if (!u)
|
|
2103
|
+
continue;
|
|
2104
|
+
const i = et(s), m = i ? `?${u}` : u, b = o.get(a) ?? void 0, U = oe(b, e.params[m], i);
|
|
2105
|
+
r[u] = U;
|
|
2106
|
+
}
|
|
2107
|
+
return r;
|
|
2108
|
+
}
|
|
2109
|
+
function uo(e, t = {}, r = {}) {
|
|
2099
2110
|
const n = oo(e, {
|
|
2100
2111
|
params: t,
|
|
2101
2112
|
query: r.query,
|
|
2102
2113
|
hash: r.hash
|
|
2103
|
-
}), { search: o, hash: a } =
|
|
2114
|
+
}), { search: o, hash: a } = O(n);
|
|
2104
2115
|
return {
|
|
2105
2116
|
id: e.id,
|
|
2106
2117
|
matched: e.matched,
|
|
2107
2118
|
matches: e.matches,
|
|
2108
2119
|
name: e.name,
|
|
2109
|
-
query:
|
|
2110
|
-
params:
|
|
2120
|
+
query: rt(o),
|
|
2121
|
+
params: it(e, n),
|
|
2111
2122
|
state: yr(e.state, r.state),
|
|
2112
2123
|
hash: a,
|
|
2113
2124
|
href: n
|
|
2114
2125
|
};
|
|
2115
2126
|
}
|
|
2116
|
-
const
|
|
2117
|
-
const { pathname: r } =
|
|
2127
|
+
const fo = (e) => "name" in e.matched && !!e.matched.name, lo = (e, t) => {
|
|
2128
|
+
const { pathname: r } = O(t);
|
|
2118
2129
|
return Xr(e).test(r);
|
|
2119
|
-
},
|
|
2120
|
-
const { search: r } =
|
|
2130
|
+
}, ho = (e, t) => {
|
|
2131
|
+
const { search: r } = O(t);
|
|
2121
2132
|
return en(e).every((o) => o.test(r));
|
|
2122
2133
|
}, Ge = (e, t) => {
|
|
2123
|
-
const { hash: r } =
|
|
2134
|
+
const { hash: r } = O(t), { value: n } = e.hash;
|
|
2124
2135
|
return J(n) ? `#${n.replace(/^#*/, "")}`.toLowerCase() === r.toLowerCase() : !0;
|
|
2125
2136
|
};
|
|
2126
|
-
function
|
|
2127
|
-
const { searchParams: t, pathname: r } =
|
|
2137
|
+
function po(e) {
|
|
2138
|
+
const { searchParams: t, pathname: r } = O(e), n = -1, o = 1;
|
|
2128
2139
|
return (a, s) => {
|
|
2129
|
-
const u =
|
|
2140
|
+
const u = St(a, t), f = Pt(a, r), i = St(s, t), m = Pt(s, r);
|
|
2130
2141
|
return a.depth > s.depth ? n : a.depth < s.depth ? o : u + f > i + m ? n : u + f < i + m ? o : Ge(a, e) ? n : Ge(s, e) ? o : 0;
|
|
2131
2142
|
};
|
|
2132
2143
|
}
|
|
2133
|
-
function
|
|
2144
|
+
function Pt(e, t) {
|
|
2134
2145
|
const r = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), n = r.filter((o) => gr(t, e.path.value, o) === void 0);
|
|
2135
2146
|
return r.length - n.length;
|
|
2136
2147
|
}
|
|
2137
|
-
function
|
|
2148
|
+
function St(e, t) {
|
|
2138
2149
|
const r = new URLSearchParams(t), n = new URLSearchParams(e.query.value), o = Array.from(n.keys()), a = o.filter((s) => !r.has(s));
|
|
2139
2150
|
return o.length - a.length;
|
|
2140
2151
|
}
|
|
2141
|
-
const
|
|
2142
|
-
uo,
|
|
2152
|
+
const mo = [
|
|
2143
2153
|
fo,
|
|
2144
2154
|
lo,
|
|
2155
|
+
ho,
|
|
2145
2156
|
Ge,
|
|
2146
2157
|
co
|
|
2147
2158
|
];
|
|
2148
|
-
function
|
|
2149
|
-
const r =
|
|
2150
|
-
return e.filter((n) =>
|
|
2159
|
+
function yo(e, t) {
|
|
2160
|
+
const r = po(t);
|
|
2161
|
+
return e.filter((n) => mo.every((o) => o(n, t))).sort(r);
|
|
2151
2162
|
}
|
|
2152
|
-
function
|
|
2153
|
-
const n =
|
|
2163
|
+
function go(e, t, r) {
|
|
2164
|
+
const n = yo(e, t);
|
|
2154
2165
|
if (!n.length)
|
|
2155
2166
|
return;
|
|
2156
|
-
const [o] = n, { searchParams: a, hash: s } =
|
|
2167
|
+
const [o] = n, { searchParams: a, hash: s } = O(t);
|
|
2157
2168
|
return {
|
|
2158
2169
|
id: o.id,
|
|
2159
2170
|
matched: o.matched,
|
|
2160
2171
|
matches: o.matches,
|
|
2161
2172
|
name: o.name,
|
|
2162
|
-
query:
|
|
2163
|
-
params:
|
|
2173
|
+
query: rt(a),
|
|
2174
|
+
params: it(o, t),
|
|
2164
2175
|
state: yr(o.state, r),
|
|
2165
2176
|
hash: s,
|
|
2166
|
-
href:
|
|
2177
|
+
href: Ut(t)
|
|
2167
2178
|
};
|
|
2168
2179
|
}
|
|
2169
|
-
function
|
|
2170
|
-
const r = typeof e == "string" ?
|
|
2180
|
+
function At(e, t) {
|
|
2181
|
+
const r = typeof e == "string" ? O(e) : e, n = typeof t == "string" ? O(t) : t, o = r.searchParams ?? new URLSearchParams(r.search), a = n.searchParams ?? new URLSearchParams(n.search);
|
|
2171
2182
|
return vr({
|
|
2172
2183
|
protocol: J(n.protocol) ? n.protocol : r.protocol,
|
|
2173
2184
|
host: J(n.host) ? n.host : r.host,
|
|
2174
2185
|
pathname: J(n.pathname) ? n.pathname : r.pathname,
|
|
2175
|
-
searchParams:
|
|
2186
|
+
searchParams: st(a, o),
|
|
2176
2187
|
hash: J(n.hash) ? n.hash : r.hash
|
|
2177
2188
|
});
|
|
2178
2189
|
}
|
|
2179
|
-
function
|
|
2190
|
+
function Ro(e, t) {
|
|
2180
2191
|
return J(t) ? e.map((r) => {
|
|
2181
|
-
const n = `${t}${r.path}`;
|
|
2192
|
+
const n = `${t}${r.path.value}`;
|
|
2182
2193
|
return {
|
|
2183
2194
|
...r,
|
|
2184
|
-
path:
|
|
2195
|
+
path: Q(n, r.path.params)
|
|
2185
2196
|
};
|
|
2186
2197
|
}) : e;
|
|
2187
2198
|
}
|
|
2188
|
-
class
|
|
2199
|
+
class wo extends Error {
|
|
2189
2200
|
/**
|
|
2190
2201
|
* Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
|
|
2191
2202
|
* @param name - The name of the name that was duplicated.
|
|
@@ -2194,33 +2205,33 @@ class Ro extends Error {
|
|
|
2194
2205
|
super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`);
|
|
2195
2206
|
}
|
|
2196
2207
|
}
|
|
2197
|
-
function
|
|
2208
|
+
function vo(e) {
|
|
2198
2209
|
const t = e.map(({ name: r }) => r);
|
|
2199
2210
|
for (const r of t)
|
|
2200
|
-
if (
|
|
2201
|
-
throw new
|
|
2211
|
+
if (Nt(t, r) > 1)
|
|
2212
|
+
throw new wo(r);
|
|
2202
2213
|
}
|
|
2203
|
-
function
|
|
2214
|
+
function Eo(e, t = [], r) {
|
|
2204
2215
|
const n = [
|
|
2205
2216
|
...e,
|
|
2206
2217
|
...t.map((o) => o.routes)
|
|
2207
2218
|
].flat();
|
|
2208
|
-
return
|
|
2219
|
+
return vo(n), Ro(n, r);
|
|
2209
2220
|
}
|
|
2210
|
-
function
|
|
2211
|
-
const r = new
|
|
2212
|
-
return
|
|
2221
|
+
function bo(e = {}, t = []) {
|
|
2222
|
+
const r = new se();
|
|
2223
|
+
return ue("onBeforeRouteEnter", e, t).forEach((n) => r.onBeforeRouteEnter.add(n)), ue("onBeforeRouteUpdate", e, t).forEach((n) => r.onBeforeRouteUpdate.add(n)), ue("onBeforeRouteLeave", e, t).forEach((n) => r.onBeforeRouteLeave.add(n)), ue("onAfterRouteEnter", e, t).forEach((n) => r.onAfterRouteEnter.add(n)), ue("onAfterRouteUpdate", e, t).forEach((n) => r.onAfterRouteUpdate.add(n)), ue("onAfterRouteLeave", e, t).forEach((n) => r.onAfterRouteLeave.add(n)), r;
|
|
2213
2224
|
}
|
|
2214
|
-
function
|
|
2225
|
+
function ue(e, t, r) {
|
|
2215
2226
|
return [
|
|
2216
2227
|
t[e],
|
|
2217
2228
|
...r.map((o) => o[e])
|
|
2218
2229
|
].flat().filter((o) => o !== void 0);
|
|
2219
2230
|
}
|
|
2220
|
-
function
|
|
2221
|
-
const n =
|
|
2222
|
-
o.addGlobalRouteHooks(
|
|
2223
|
-
const a =
|
|
2231
|
+
function No(e, t, r = []) {
|
|
2232
|
+
const n = Eo(e, r, t == null ? void 0 : t.base), o = On();
|
|
2233
|
+
o.addGlobalRouteHooks(bo(t, r));
|
|
2234
|
+
const a = nt(), s = Rn(), u = Cn(), f = eo(), i = Jn({
|
|
2224
2235
|
mode: t == null ? void 0 : t.historyMode,
|
|
2225
2236
|
listener: ({ location: P }) => {
|
|
2226
2237
|
const B = re(P);
|
|
@@ -2228,7 +2239,7 @@ function Bo(e, t, r = []) {
|
|
|
2228
2239
|
}
|
|
2229
2240
|
});
|
|
2230
2241
|
function m(P, B = {}) {
|
|
2231
|
-
return
|
|
2242
|
+
return go(n, P, B.state);
|
|
2232
2243
|
}
|
|
2233
2244
|
async function b(P, B = {}) {
|
|
2234
2245
|
const W = a();
|
|
@@ -2236,7 +2247,7 @@ function Bo(e, t, r = []) {
|
|
|
2236
2247
|
i.update(P, B);
|
|
2237
2248
|
return;
|
|
2238
2249
|
}
|
|
2239
|
-
const I = m(P, B) ?? A("NotFound"), H =
|
|
2250
|
+
const I = m(P, B) ?? A("NotFound"), H = ut(W), K = await o.runBeforeRouteHooks({ to: I, from: H });
|
|
2240
2251
|
switch (K.status) {
|
|
2241
2252
|
// On abort do nothing
|
|
2242
2253
|
case "ABORT":
|
|
@@ -2256,9 +2267,9 @@ function Bo(e, t, r = []) {
|
|
|
2256
2267
|
default:
|
|
2257
2268
|
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(K)}`);
|
|
2258
2269
|
}
|
|
2259
|
-
const
|
|
2270
|
+
const qe = W;
|
|
2260
2271
|
s.setProps(I).then((D) => {
|
|
2261
|
-
if (
|
|
2272
|
+
if (qe === W)
|
|
2262
2273
|
switch (D.status) {
|
|
2263
2274
|
case "SUCCESS":
|
|
2264
2275
|
break;
|
|
@@ -2269,8 +2280,8 @@ function Bo(e, t, r = []) {
|
|
|
2269
2280
|
c(D.type);
|
|
2270
2281
|
break;
|
|
2271
2282
|
default:
|
|
2272
|
-
const
|
|
2273
|
-
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(
|
|
2283
|
+
const Ie = D;
|
|
2284
|
+
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(Ie)}`);
|
|
2274
2285
|
}
|
|
2275
2286
|
}), x(I);
|
|
2276
2287
|
const F = await o.runAfterRouteHooks({ to: I, from: H });
|
|
@@ -2293,24 +2304,24 @@ function Bo(e, t, r = []) {
|
|
|
2293
2304
|
const I = n.find((H) => H.name === P);
|
|
2294
2305
|
if (!I)
|
|
2295
2306
|
throw new to(String(P));
|
|
2296
|
-
return
|
|
2307
|
+
return uo(I, B, W);
|
|
2297
2308
|
}, y = (P, B, W) => {
|
|
2298
2309
|
if (T(P)) {
|
|
2299
|
-
const F = { ...B }, D =
|
|
2310
|
+
const F = { ...B }, D = At(P, {
|
|
2300
2311
|
searchParams: F.query,
|
|
2301
2312
|
hash: F.hash
|
|
2302
2313
|
});
|
|
2303
2314
|
return b(D, F);
|
|
2304
2315
|
}
|
|
2305
2316
|
if (typeof P == "string") {
|
|
2306
|
-
const { replace: F, ...D } = { ...W },
|
|
2307
|
-
return b(
|
|
2317
|
+
const { replace: F, ...D } = { ...W }, Ie = { ...B }, De = U(P, Ie, D), br = Et({ ...De.matched.state }, { ...De.state, ...D.state });
|
|
2318
|
+
return b(De.href, { replace: F, state: br });
|
|
2308
2319
|
}
|
|
2309
|
-
const { replace: I, ...H } = { ...B }, K =
|
|
2320
|
+
const { replace: I, ...H } = { ...B }, K = Et({ ...P.matched.state }, { ...P.state, ...H.state }), qe = At(P.href, {
|
|
2310
2321
|
searchParams: H.query,
|
|
2311
2322
|
hash: H.hash
|
|
2312
2323
|
});
|
|
2313
|
-
return b(
|
|
2324
|
+
return b(qe, { replace: I, state: K });
|
|
2314
2325
|
}, h = (P, B, W) => {
|
|
2315
2326
|
if (T(P)) {
|
|
2316
2327
|
const H = { ...B, replace: !0 };
|
|
@@ -2324,27 +2335,27 @@ function Bo(e, t, r = []) {
|
|
|
2324
2335
|
return y(P, I);
|
|
2325
2336
|
}, g = (P) => {
|
|
2326
2337
|
c(P);
|
|
2327
|
-
}, { setRejection: c, rejection: l, getRejectionRoute: A } =
|
|
2338
|
+
}, { setRejection: c, rejection: l, getRejectionRoute: A } = Qn({
|
|
2328
2339
|
...r.reduce((P, B) => ({ ...P, ...B.rejections }), {}),
|
|
2329
2340
|
...t == null ? void 0 : t.rejections
|
|
2330
|
-
}), R = A("NotFound"), { currentRoute: w, routerRoute: S, updateRoute: x } = Dn(R, y), p = Kn(t == null ? void 0 : t.initialUrl), d = i.location.state, { host: E } =
|
|
2341
|
+
}), R = A("NotFound"), { currentRoute: w, routerRoute: S, updateRoute: x } = Dn(R, y), p = Kn(t == null ? void 0 : t.initialUrl), d = i.location.state, { host: E } = O(p), k = Tn(E);
|
|
2331
2342
|
let L = !1;
|
|
2332
|
-
const { promise:
|
|
2343
|
+
const { promise: N, resolve: V } = Promise.withResolvers();
|
|
2333
2344
|
async function $() {
|
|
2334
2345
|
if (L)
|
|
2335
|
-
return
|
|
2346
|
+
return N;
|
|
2336
2347
|
Tr(n) && await Jr(), L = !0, await b(p, { replace: !0, state: d }), i.startListening(), V();
|
|
2337
2348
|
}
|
|
2338
|
-
function
|
|
2349
|
+
function q() {
|
|
2339
2350
|
i.stopListening();
|
|
2340
2351
|
}
|
|
2341
|
-
function
|
|
2352
|
+
function ut(P) {
|
|
2342
2353
|
return dn(P) ? null : { ...w };
|
|
2343
2354
|
}
|
|
2344
2355
|
function Er(P) {
|
|
2345
|
-
P.component("RouterView", ir), P.component("RouterLink", xn), P.provide(or, l), P.provide(ur, o), P.provide(Xt, s), P.provide(cr, u), P.provide(tr, f), P.provide(
|
|
2356
|
+
P.component("RouterView", ir), P.component("RouterLink", xn), P.provide(or, l), P.provide(ur, o), P.provide(Xt, s), P.provide(cr, u), P.provide(tr, f), P.provide(Bt, ft), $();
|
|
2346
2357
|
}
|
|
2347
|
-
const
|
|
2358
|
+
const ft = {
|
|
2348
2359
|
route: S,
|
|
2349
2360
|
resolve: U,
|
|
2350
2361
|
find: m,
|
|
@@ -2365,9 +2376,9 @@ function Bo(e, t, r = []) {
|
|
|
2365
2376
|
onAfterRouteLeave: o.onAfterRouteLeave,
|
|
2366
2377
|
prefetch: t == null ? void 0 : t.prefetch,
|
|
2367
2378
|
start: $,
|
|
2368
|
-
stop:
|
|
2379
|
+
stop: q
|
|
2369
2380
|
};
|
|
2370
|
-
return
|
|
2381
|
+
return ft;
|
|
2371
2382
|
}
|
|
2372
2383
|
function Co(e) {
|
|
2373
2384
|
return {
|
|
@@ -2376,11 +2387,11 @@ function Co(e) {
|
|
|
2376
2387
|
...e
|
|
2377
2388
|
};
|
|
2378
2389
|
}
|
|
2379
|
-
function
|
|
2390
|
+
function Po(...e) {
|
|
2380
2391
|
return {
|
|
2381
2392
|
get: (t, { invalid: r }) => {
|
|
2382
2393
|
for (const n of e) {
|
|
2383
|
-
const o =
|
|
2394
|
+
const o = zr(t, n);
|
|
2384
2395
|
if (o !== void 0)
|
|
2385
2396
|
return o;
|
|
2386
2397
|
}
|
|
@@ -2396,8 +2407,8 @@ function bo(...e) {
|
|
|
2396
2407
|
}
|
|
2397
2408
|
};
|
|
2398
2409
|
}
|
|
2399
|
-
function
|
|
2400
|
-
const t =
|
|
2410
|
+
function Vo(...e) {
|
|
2411
|
+
const t = Po(...e);
|
|
2401
2412
|
return {
|
|
2402
2413
|
get: (r, n) => r.split(",").map((o) => t.get(o, n)),
|
|
2403
2414
|
set: (r, n) => {
|
|
@@ -2407,24 +2418,24 @@ function No(...e) {
|
|
|
2407
2418
|
}
|
|
2408
2419
|
};
|
|
2409
2420
|
}
|
|
2410
|
-
function
|
|
2421
|
+
function Zo(...e) {
|
|
2411
2422
|
return {
|
|
2412
2423
|
get: (t) => {
|
|
2413
2424
|
const r = t.split(",");
|
|
2414
|
-
return e.map((n, o) =>
|
|
2425
|
+
return e.map((n, o) => oe(r.at(o), n));
|
|
2415
2426
|
},
|
|
2416
2427
|
set: (t, { invalid: r }) => {
|
|
2417
2428
|
if (!Array.isArray(t))
|
|
2418
2429
|
throw r("Expected a tuple");
|
|
2419
2430
|
if (t.length !== e.length)
|
|
2420
2431
|
throw r(`Expected tuple with ${e.length} values but received ${t.length} values`);
|
|
2421
|
-
return e.map((n, o) =>
|
|
2432
|
+
return e.map((n, o) => ae(t.at(o), n)).join(",");
|
|
2422
2433
|
}
|
|
2423
2434
|
};
|
|
2424
2435
|
}
|
|
2425
|
-
const
|
|
2426
|
-
function
|
|
2427
|
-
const t =
|
|
2436
|
+
const jo = Q, $o = Q, _o = Q;
|
|
2437
|
+
function Ho(e) {
|
|
2438
|
+
const t = ot(), r = Wt(e.name), n = ee(e.path), o = ee(e.query), a = ee(e.hash), s = e.meta ?? {}, u = ee(e.host), f = xe({ id: t, meta: {}, state: {}, ...e }), i = {
|
|
2428
2439
|
id: t,
|
|
2429
2440
|
matched: f,
|
|
2430
2441
|
matches: [f],
|
|
@@ -2446,27 +2457,27 @@ export {
|
|
|
2446
2457
|
Re as RouterNotInstalledError,
|
|
2447
2458
|
ir as RouterView,
|
|
2448
2459
|
Hr as UseRouteInvalidError,
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2460
|
+
Vo as arrayOf,
|
|
2461
|
+
Ut as asUrl,
|
|
2462
|
+
Ho as createExternalRoute,
|
|
2452
2463
|
Dr as createParam,
|
|
2453
2464
|
pe as createRoute,
|
|
2454
|
-
|
|
2465
|
+
No as createRouter,
|
|
2455
2466
|
Co as createRouterPlugin,
|
|
2456
|
-
|
|
2467
|
+
$o as host,
|
|
2457
2468
|
nr as isRoute,
|
|
2458
2469
|
T as isUrl,
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2470
|
+
Uo as onAfterRouteLeave,
|
|
2471
|
+
Bo as onAfterRouteUpdate,
|
|
2472
|
+
xo as onBeforeRouteLeave,
|
|
2473
|
+
Lo as onBeforeRouteUpdate,
|
|
2474
|
+
jo as path,
|
|
2475
|
+
_o as query,
|
|
2476
|
+
Zo as tupleOf,
|
|
2477
|
+
Po as unionOf,
|
|
2467
2478
|
An as useLink,
|
|
2468
2479
|
ar as useRoute,
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2480
|
+
Qe as useRouter,
|
|
2481
|
+
ko as withDefault,
|
|
2482
|
+
Q as withParams
|
|
2472
2483
|
};
|