@kitbag/router 0.12.0 → 0.13.1
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 +26 -19
- package/dist/kitbag-router.js +846 -793
- package/dist/kitbag-router.umd.cjs +1 -1
- package/package.json +5 -5
package/dist/kitbag-router.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var _ = (e, t, n) =>
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
class
|
|
1
|
+
var sn = Object.defineProperty;
|
|
2
|
+
var cn = (e, t, n) => t in e ? sn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var _ = (e, t, n) => cn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { defineComponent as le, h as ve, ref as qe, inject as re, toRefs as un, computed as N, reactive as Ue, markRaw as ye, defineAsyncComponent as fn, onMounted as ln, onBeforeUnmount as hn, watch as je, toValue as se, toRef as pn, onUnmounted as gt, openBlock as vt, createElementBlock as dn, normalizeClass as mn, renderSlot as yt, normalizeProps as Rt, guardReactiveProps as gn, unref as ce, resolveComponent as vn, provide as yn, mergeProps as Rn, createBlock as wn, resolveDynamicComponent as Pn, createCommentVNode as En } from "vue";
|
|
5
|
+
class he extends Error {
|
|
6
6
|
constructor() {
|
|
7
7
|
super("Router not installed");
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function pe(e) {
|
|
11
11
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function bn(e) {
|
|
14
14
|
return e.every((t) => Array.isArray(t));
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function de(e) {
|
|
17
17
|
return typeof e == "string" && e.length > 0;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Re(e) {
|
|
20
20
|
return {
|
|
21
|
-
value:
|
|
21
|
+
value: de(e) ? e.replace(/^#*/, "") : void 0
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
24
|
+
function Sn(e, t) {
|
|
25
|
+
return Re(`${e.value ?? ""}${t.value ?? ""}`);
|
|
26
26
|
}
|
|
27
|
-
class
|
|
27
|
+
class kn extends Error {
|
|
28
28
|
constructor(t) {
|
|
29
29
|
super(`Child property on meta for ${t} conflicts with the parent meta.`);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function An(e, t) {
|
|
33
|
+
return xn(e, t), { ...e, ...t };
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function xn(e, t) {
|
|
36
36
|
const n = Object.keys(e).find((r) => r in t && typeof t[r] != typeof e[r]);
|
|
37
37
|
if (n)
|
|
38
|
-
throw new
|
|
38
|
+
throw new kn(n);
|
|
39
39
|
}
|
|
40
|
-
class
|
|
40
|
+
class Un extends Error {
|
|
41
41
|
/**
|
|
42
42
|
* Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
|
|
43
43
|
* @param paramName - The name of the parameter that was duplicated.
|
|
@@ -49,120 +49,120 @@ class bn extends Error {
|
|
|
49
49
|
function Y(e) {
|
|
50
50
|
return Array.isArray(e) ? e : [e];
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function wt(e, t) {
|
|
53
53
|
return e.filter((n) => t === n).length;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const t = e.flatMap((n) => Array.isArray(n) ? n : Object.keys(n).map(
|
|
55
|
+
function oe(...e) {
|
|
56
|
+
const t = e.flatMap((n) => Array.isArray(n) ? n : Object.keys(n).map(Bn));
|
|
57
57
|
for (const n of t)
|
|
58
|
-
if (
|
|
59
|
-
throw new
|
|
58
|
+
if (wt(t, n) > 1)
|
|
59
|
+
throw new Un(n);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Bn(e) {
|
|
62
62
|
return e.startsWith("?") ? e.slice(1) : e;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
return
|
|
64
|
+
function Ln(e, t) {
|
|
65
|
+
return oe(e.params, t.params), {
|
|
66
66
|
value: `${e.value}${t.value}`,
|
|
67
67
|
params: { ...e.params, ...t.params }
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
72
|
-
value: [e.value, t.value].filter(
|
|
70
|
+
function Cn(e, t) {
|
|
71
|
+
return oe(e.params, t.params), {
|
|
72
|
+
value: [e.value, t.value].filter(de).join("&"),
|
|
73
73
|
params: { ...e.params, ...t.params }
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
return
|
|
76
|
+
function Nn(e, t) {
|
|
77
|
+
return oe(e, t), { ...e, ...t };
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Hn(e) {
|
|
80
80
|
return "host" in e && !!e.host;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Pt(e) {
|
|
83
83
|
return "parent" in e && !!e.parent;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function _e(e) {
|
|
86
86
|
return "component" in e && !!e.component;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Me(e) {
|
|
89
89
|
return "components" in e && !!e.components;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function jn(e) {
|
|
92
92
|
return "state" in e && !!e.state;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function Et(e, t) {
|
|
95
95
|
return {
|
|
96
96
|
...t,
|
|
97
|
-
path:
|
|
98
|
-
query:
|
|
99
|
-
meta:
|
|
100
|
-
state:
|
|
101
|
-
hash:
|
|
97
|
+
path: Ln(e.path, t.path),
|
|
98
|
+
query: Cn(e.query, t.query),
|
|
99
|
+
meta: An(e.meta, t.meta),
|
|
100
|
+
state: Nn(e.state, t.state),
|
|
101
|
+
hash: Sn(e.hash, t.hash),
|
|
102
102
|
matches: [...e.matches, t.matched],
|
|
103
103
|
host: e.host,
|
|
104
104
|
depth: e.depth + 1
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function Te() {
|
|
108
108
|
return typeof window < "u" && typeof window.document < "u";
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function bt(e) {
|
|
111
111
|
return typeof e == "object" && e !== null && "then" in e;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
113
|
+
function Vn(e, t) {
|
|
114
|
+
return le({
|
|
115
115
|
name: "PropsWrapper",
|
|
116
116
|
expose: [],
|
|
117
117
|
setup() {
|
|
118
118
|
const n = t();
|
|
119
|
-
return () => n instanceof Error ? "" :
|
|
119
|
+
return () => n instanceof Error ? "" : bt(n) ? ve($n(e, n)) : ve(e, n);
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
return
|
|
123
|
+
function $n(e, t) {
|
|
124
|
+
return le({
|
|
125
125
|
name: "AsyncPropsWrapper",
|
|
126
126
|
expose: [],
|
|
127
127
|
setup() {
|
|
128
|
-
const n =
|
|
129
|
-
return (async () => n.value = await t)(), () => n.value instanceof Error ? "" : n.value ?
|
|
128
|
+
const n = qe();
|
|
129
|
+
return (async () => n.value = await t)(), () => n.value instanceof Error ? "" : n.value ? ve(e, n.value) : "";
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
class Z extends Error {
|
|
134
134
|
}
|
|
135
|
-
const
|
|
136
|
-
function
|
|
135
|
+
const W = "[", G = "]";
|
|
136
|
+
function On(e) {
|
|
137
137
|
return e !== String && e !== Boolean && e !== Number && e !== Date;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
return typeof e == "function" &&
|
|
139
|
+
function qn(e) {
|
|
140
|
+
return typeof e == "function" && On(e);
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Be(e) {
|
|
143
143
|
return typeof e == "object" && "get" in e && typeof e.get == "function" && "set" in e && typeof e.set == "function";
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
return
|
|
145
|
+
function _n(e) {
|
|
146
|
+
return Be(e) && e.defaultValue !== void 0;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
return
|
|
148
|
+
function uo(e, t) {
|
|
149
|
+
return Dn(e, t);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function Mn(e, t) {
|
|
152
152
|
return e[t] ?? String;
|
|
153
153
|
}
|
|
154
|
-
const
|
|
154
|
+
const O = {
|
|
155
155
|
invalid: (e) => {
|
|
156
156
|
throw new Z(e);
|
|
157
157
|
}
|
|
158
|
-
},
|
|
158
|
+
}, Tn = {
|
|
159
159
|
get: (e) => e,
|
|
160
160
|
set: (e, { invalid: t }) => {
|
|
161
161
|
if (typeof e != "string")
|
|
162
162
|
throw t();
|
|
163
163
|
return e;
|
|
164
164
|
}
|
|
165
|
-
},
|
|
165
|
+
}, St = {
|
|
166
166
|
get: (e, { invalid: t }) => {
|
|
167
167
|
if (e === "true")
|
|
168
168
|
return !0;
|
|
@@ -175,7 +175,7 @@ const q = {
|
|
|
175
175
|
throw t();
|
|
176
176
|
return e.toString();
|
|
177
177
|
}
|
|
178
|
-
},
|
|
178
|
+
}, kt = {
|
|
179
179
|
get: (e, { invalid: t }) => {
|
|
180
180
|
const n = Number(e);
|
|
181
181
|
if (isNaN(n))
|
|
@@ -187,7 +187,7 @@ const q = {
|
|
|
187
187
|
throw t();
|
|
188
188
|
return e.toString();
|
|
189
189
|
}
|
|
190
|
-
},
|
|
190
|
+
}, At = {
|
|
191
191
|
get: (e, { invalid: t }) => {
|
|
192
192
|
const n = new Date(e);
|
|
193
193
|
if (isNaN(n.getTime()))
|
|
@@ -215,28 +215,28 @@ const q = {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
|
-
function
|
|
219
|
-
if (e === void 0 || !
|
|
220
|
-
if (
|
|
218
|
+
function ue(e, t, n = !1) {
|
|
219
|
+
if (e === void 0 || !de(e)) {
|
|
220
|
+
if (_n(t))
|
|
221
221
|
return t.defaultValue;
|
|
222
222
|
if (n)
|
|
223
223
|
return;
|
|
224
224
|
throw new Z();
|
|
225
225
|
}
|
|
226
226
|
if (t === String)
|
|
227
|
-
return
|
|
227
|
+
return Tn.get(e, O);
|
|
228
228
|
if (t === Boolean)
|
|
229
|
-
return
|
|
229
|
+
return St.get(e, O);
|
|
230
230
|
if (t === Number)
|
|
231
|
-
return
|
|
231
|
+
return kt.get(e, O);
|
|
232
232
|
if (t === Date)
|
|
233
|
-
return
|
|
233
|
+
return At.get(e, O);
|
|
234
234
|
if (t === JSON)
|
|
235
|
-
return xt.get(e,
|
|
236
|
-
if (
|
|
237
|
-
return t(e,
|
|
238
|
-
if (
|
|
239
|
-
return t.get(e,
|
|
235
|
+
return xt.get(e, O);
|
|
236
|
+
if (qn(t))
|
|
237
|
+
return t(e, O);
|
|
238
|
+
if (Be(t))
|
|
239
|
+
return t.get(e, O);
|
|
240
240
|
if (t instanceof RegExp) {
|
|
241
241
|
if (t.test(e))
|
|
242
242
|
return e;
|
|
@@ -244,32 +244,32 @@ function se(e, t, n = !1) {
|
|
|
244
244
|
}
|
|
245
245
|
return e;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function ie(e, t, n = !1) {
|
|
248
248
|
if (e === void 0) {
|
|
249
249
|
if (n)
|
|
250
250
|
return "";
|
|
251
251
|
throw new Z();
|
|
252
252
|
}
|
|
253
253
|
if (t === Boolean)
|
|
254
|
-
return
|
|
254
|
+
return St.set(e, O);
|
|
255
255
|
if (t === Number)
|
|
256
|
-
return
|
|
256
|
+
return kt.set(e, O);
|
|
257
257
|
if (t === Date)
|
|
258
|
-
return
|
|
258
|
+
return At.set(e, O);
|
|
259
259
|
if (t === JSON)
|
|
260
|
-
return xt.set(e,
|
|
261
|
-
if (
|
|
262
|
-
return t.set(e,
|
|
260
|
+
return xt.set(e, O);
|
|
261
|
+
if (Be(t))
|
|
262
|
+
return t.set(e, O);
|
|
263
263
|
try {
|
|
264
264
|
return e.toString();
|
|
265
265
|
} catch {
|
|
266
266
|
throw new Z();
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
return
|
|
271
|
-
get: (n) =>
|
|
272
|
-
set: (n) =>
|
|
269
|
+
function Dn(e, t) {
|
|
270
|
+
return Be(e) ? { ...e, defaultValue: t ?? e.defaultValue } : {
|
|
271
|
+
get: (n) => ue(n, e),
|
|
272
|
+
set: (n) => ie(n, e),
|
|
273
273
|
defaultValue: t
|
|
274
274
|
};
|
|
275
275
|
}
|
|
@@ -301,36 +301,36 @@ function K(e, t) {
|
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
var
|
|
305
|
-
function
|
|
304
|
+
var we = "beforeunload", Wn = "hashchange", Ut = "popstate";
|
|
305
|
+
function at(e) {
|
|
306
306
|
e === void 0 && (e = {});
|
|
307
307
|
var t = e, n = t.window, r = n === void 0 ? document.defaultView : n, o = r.history;
|
|
308
308
|
function a() {
|
|
309
|
-
var m = r.location, l = m.pathname, d = m.search,
|
|
310
|
-
return [
|
|
309
|
+
var m = r.location, l = m.pathname, d = m.search, E = m.hash, b = o.state || {};
|
|
310
|
+
return [b.idx, ee({
|
|
311
311
|
pathname: l,
|
|
312
312
|
search: d,
|
|
313
|
-
hash:
|
|
314
|
-
state:
|
|
315
|
-
key:
|
|
313
|
+
hash: E,
|
|
314
|
+
state: b.usr || null,
|
|
315
|
+
key: b.key || "default"
|
|
316
316
|
})];
|
|
317
317
|
}
|
|
318
318
|
var s = null;
|
|
319
|
-
function
|
|
319
|
+
function c() {
|
|
320
320
|
if (s)
|
|
321
321
|
p.call(s), s = null;
|
|
322
322
|
else {
|
|
323
|
-
var m = H.Pop, l = a(), d = l[0],
|
|
323
|
+
var m = H.Pop, l = a(), d = l[0], E = l[1];
|
|
324
324
|
if (p.length)
|
|
325
325
|
if (d != null) {
|
|
326
|
-
var
|
|
327
|
-
|
|
326
|
+
var b = f - d;
|
|
327
|
+
b && (s = {
|
|
328
328
|
action: m,
|
|
329
|
-
location:
|
|
329
|
+
location: E,
|
|
330
330
|
retry: function() {
|
|
331
|
-
A(
|
|
331
|
+
A(b * -1);
|
|
332
332
|
}
|
|
333
|
-
}, A(
|
|
333
|
+
}, A(b));
|
|
334
334
|
} else
|
|
335
335
|
process.env.NODE_ENV !== "production" && K(
|
|
336
336
|
!1,
|
|
@@ -340,25 +340,25 @@ function et(e) {
|
|
|
340
340
|
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
|
|
341
341
|
);
|
|
342
342
|
else
|
|
343
|
-
|
|
343
|
+
B(m);
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
r.addEventListener(
|
|
347
|
-
var i = H.Pop,
|
|
346
|
+
r.addEventListener(Ut, c);
|
|
347
|
+
var i = H.Pop, u = a(), f = u[0], h = u[1], v = te(), p = te();
|
|
348
348
|
f == null && (f = 0, o.replaceState(Q({}, o.state, {
|
|
349
349
|
idx: f
|
|
350
350
|
}), ""));
|
|
351
351
|
function k(m) {
|
|
352
352
|
return typeof m == "string" ? m : z(m);
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function R(m, l) {
|
|
355
355
|
return l === void 0 && (l = null), ee(Q({
|
|
356
356
|
pathname: h.pathname,
|
|
357
357
|
hash: "",
|
|
358
358
|
search: ""
|
|
359
|
-
}, typeof m == "string" ?
|
|
359
|
+
}, typeof m == "string" ? fe(m) : m, {
|
|
360
360
|
state: l,
|
|
361
|
-
key:
|
|
361
|
+
key: Ee()
|
|
362
362
|
}));
|
|
363
363
|
}
|
|
364
364
|
function y(m, l) {
|
|
@@ -368,44 +368,44 @@ function et(e) {
|
|
|
368
368
|
idx: l
|
|
369
369
|
}, k(m)];
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function S(m, l, d) {
|
|
372
372
|
return !p.length || (p.call({
|
|
373
373
|
action: m,
|
|
374
374
|
location: l,
|
|
375
375
|
retry: d
|
|
376
376
|
}), !1);
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function B(m) {
|
|
379
379
|
i = m;
|
|
380
380
|
var l = a();
|
|
381
|
-
f = l[0], h = l[1],
|
|
381
|
+
f = l[0], h = l[1], v.call({
|
|
382
382
|
action: i,
|
|
383
383
|
location: h
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
var d = H.Push,
|
|
388
|
-
function
|
|
389
|
-
|
|
386
|
+
function g(m, l) {
|
|
387
|
+
var d = H.Push, E = R(m, l);
|
|
388
|
+
function b() {
|
|
389
|
+
g(m, l);
|
|
390
390
|
}
|
|
391
|
-
if (
|
|
392
|
-
var U = y(
|
|
391
|
+
if (S(d, E, b)) {
|
|
392
|
+
var U = y(E, f + 1), C = U[0], j = U[1];
|
|
393
393
|
try {
|
|
394
|
-
o.pushState(
|
|
394
|
+
o.pushState(C, "", j);
|
|
395
395
|
} catch {
|
|
396
396
|
r.location.assign(j);
|
|
397
397
|
}
|
|
398
|
-
|
|
398
|
+
B(d);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
var d = H.Replace,
|
|
403
|
-
function
|
|
404
|
-
|
|
401
|
+
function P(m, l) {
|
|
402
|
+
var d = H.Replace, E = R(m, l);
|
|
403
|
+
function b() {
|
|
404
|
+
P(m, l);
|
|
405
405
|
}
|
|
406
|
-
if (
|
|
407
|
-
var U = y(
|
|
408
|
-
o.replaceState(
|
|
406
|
+
if (S(d, E, b)) {
|
|
407
|
+
var U = y(E, f), C = U[0], j = U[1];
|
|
408
|
+
o.replaceState(C, "", j), B(d);
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
function A(m) {
|
|
@@ -419,8 +419,8 @@ function et(e) {
|
|
|
419
419
|
return h;
|
|
420
420
|
},
|
|
421
421
|
createHref: k,
|
|
422
|
-
push:
|
|
423
|
-
replace:
|
|
422
|
+
push: g,
|
|
423
|
+
replace: P,
|
|
424
424
|
go: A,
|
|
425
425
|
back: function() {
|
|
426
426
|
A(-1);
|
|
@@ -429,42 +429,42 @@ function et(e) {
|
|
|
429
429
|
A(1);
|
|
430
430
|
},
|
|
431
431
|
listen: function(l) {
|
|
432
|
-
return
|
|
432
|
+
return v.push(l);
|
|
433
433
|
},
|
|
434
434
|
block: function(l) {
|
|
435
435
|
var d = p.push(l);
|
|
436
|
-
return p.length === 1 && r.addEventListener(
|
|
437
|
-
d(), p.length || r.removeEventListener(
|
|
436
|
+
return p.length === 1 && r.addEventListener(we, Pe), function() {
|
|
437
|
+
d(), p.length || r.removeEventListener(we, Pe);
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
440
|
};
|
|
441
441
|
return x;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function In(e) {
|
|
444
444
|
e === void 0 && (e = {});
|
|
445
445
|
var t = e, n = t.window, r = n === void 0 ? document.defaultView : n, o = r.history;
|
|
446
446
|
function a() {
|
|
447
|
-
var l =
|
|
448
|
-
return [
|
|
449
|
-
pathname:
|
|
447
|
+
var l = fe(r.location.hash.substr(1)), d = l.pathname, E = d === void 0 ? "/" : d, b = l.search, U = b === void 0 ? "" : b, C = l.hash, j = C === void 0 ? "" : C, q = o.state || {};
|
|
448
|
+
return [q.idx, ee({
|
|
449
|
+
pathname: E,
|
|
450
450
|
search: U,
|
|
451
451
|
hash: j,
|
|
452
|
-
state:
|
|
453
|
-
key:
|
|
452
|
+
state: q.usr || null,
|
|
453
|
+
key: q.key || "default"
|
|
454
454
|
})];
|
|
455
455
|
}
|
|
456
456
|
var s = null;
|
|
457
|
-
function
|
|
457
|
+
function c() {
|
|
458
458
|
if (s)
|
|
459
459
|
p.call(s), s = null;
|
|
460
460
|
else {
|
|
461
|
-
var l = H.Pop, d = a(),
|
|
461
|
+
var l = H.Pop, d = a(), E = d[0], b = d[1];
|
|
462
462
|
if (p.length)
|
|
463
|
-
if (
|
|
464
|
-
var U = f -
|
|
463
|
+
if (E != null) {
|
|
464
|
+
var U = f - E;
|
|
465
465
|
U && (s = {
|
|
466
466
|
action: l,
|
|
467
|
-
location:
|
|
467
|
+
location: b,
|
|
468
468
|
retry: function() {
|
|
469
469
|
x(U * -1);
|
|
470
470
|
}
|
|
@@ -478,26 +478,26 @@ function _n(e) {
|
|
|
478
478
|
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
|
|
479
479
|
);
|
|
480
480
|
else
|
|
481
|
-
|
|
481
|
+
g(l);
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
r.addEventListener(
|
|
484
|
+
r.addEventListener(Ut, c), r.addEventListener(Wn, function() {
|
|
485
485
|
var l = a(), d = l[1];
|
|
486
|
-
z(d) !== z(h) &&
|
|
486
|
+
z(d) !== z(h) && c();
|
|
487
487
|
});
|
|
488
|
-
var i = H.Pop,
|
|
488
|
+
var i = H.Pop, u = a(), f = u[0], h = u[1], v = te(), p = te();
|
|
489
489
|
f == null && (f = 0, o.replaceState(Q({}, o.state, {
|
|
490
490
|
idx: f
|
|
491
491
|
}), ""));
|
|
492
492
|
function k() {
|
|
493
493
|
var l = document.querySelector("base"), d = "";
|
|
494
494
|
if (l && l.getAttribute("href")) {
|
|
495
|
-
var
|
|
496
|
-
d =
|
|
495
|
+
var E = r.location.href, b = E.indexOf("#");
|
|
496
|
+
d = b === -1 ? E : E.slice(0, b);
|
|
497
497
|
}
|
|
498
498
|
return d;
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function R(l) {
|
|
501
501
|
return k() + "#" + (typeof l == "string" ? l : z(l));
|
|
502
502
|
}
|
|
503
503
|
function y(l, d) {
|
|
@@ -505,56 +505,56 @@ function _n(e) {
|
|
|
505
505
|
pathname: h.pathname,
|
|
506
506
|
hash: "",
|
|
507
507
|
search: ""
|
|
508
|
-
}, typeof l == "string" ?
|
|
508
|
+
}, typeof l == "string" ? fe(l) : l, {
|
|
509
509
|
state: d,
|
|
510
|
-
key:
|
|
510
|
+
key: Ee()
|
|
511
511
|
}));
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function S(l, d) {
|
|
514
514
|
return [{
|
|
515
515
|
usr: l.state,
|
|
516
516
|
key: l.key,
|
|
517
517
|
idx: d
|
|
518
|
-
},
|
|
518
|
+
}, R(l)];
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function B(l, d, E) {
|
|
521
521
|
return !p.length || (p.call({
|
|
522
522
|
action: l,
|
|
523
523
|
location: d,
|
|
524
|
-
retry:
|
|
524
|
+
retry: E
|
|
525
525
|
}), !1);
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function g(l) {
|
|
528
528
|
i = l;
|
|
529
529
|
var d = a();
|
|
530
|
-
f = d[0], h = d[1],
|
|
530
|
+
f = d[0], h = d[1], v.call({
|
|
531
531
|
action: i,
|
|
532
532
|
location: h
|
|
533
533
|
});
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
var
|
|
535
|
+
function P(l, d) {
|
|
536
|
+
var E = H.Push, b = y(l, d);
|
|
537
537
|
function U() {
|
|
538
|
-
|
|
538
|
+
P(l, d);
|
|
539
539
|
}
|
|
540
|
-
if (process.env.NODE_ENV !== "production" && K(
|
|
541
|
-
var
|
|
540
|
+
if (process.env.NODE_ENV !== "production" && K(b.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(l) + ")"), B(E, b, U)) {
|
|
541
|
+
var C = S(b, f + 1), j = C[0], q = C[1];
|
|
542
542
|
try {
|
|
543
|
-
o.pushState(j, "",
|
|
543
|
+
o.pushState(j, "", q);
|
|
544
544
|
} catch {
|
|
545
|
-
r.location.assign(
|
|
545
|
+
r.location.assign(q);
|
|
546
546
|
}
|
|
547
|
-
|
|
547
|
+
g(E);
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
function A(l, d) {
|
|
551
|
-
var
|
|
551
|
+
var E = H.Replace, b = y(l, d);
|
|
552
552
|
function U() {
|
|
553
553
|
A(l, d);
|
|
554
554
|
}
|
|
555
|
-
if (process.env.NODE_ENV !== "production" && K(
|
|
556
|
-
var
|
|
557
|
-
o.replaceState(j, "",
|
|
555
|
+
if (process.env.NODE_ENV !== "production" && K(b.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(l) + ")"), B(E, b, U)) {
|
|
556
|
+
var C = S(b, f), j = C[0], q = C[1];
|
|
557
|
+
o.replaceState(j, "", q), g(E);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
function x(l) {
|
|
@@ -567,8 +567,8 @@ function _n(e) {
|
|
|
567
567
|
get location() {
|
|
568
568
|
return h;
|
|
569
569
|
},
|
|
570
|
-
createHref:
|
|
571
|
-
push:
|
|
570
|
+
createHref: R,
|
|
571
|
+
push: P,
|
|
572
572
|
replace: A,
|
|
573
573
|
go: x,
|
|
574
574
|
back: function() {
|
|
@@ -578,109 +578,109 @@ function _n(e) {
|
|
|
578
578
|
x(1);
|
|
579
579
|
},
|
|
580
580
|
listen: function(d) {
|
|
581
|
-
return
|
|
581
|
+
return v.push(d);
|
|
582
582
|
},
|
|
583
583
|
block: function(d) {
|
|
584
|
-
var
|
|
585
|
-
return p.length === 1 && r.addEventListener(
|
|
586
|
-
|
|
584
|
+
var E = p.push(d);
|
|
585
|
+
return p.length === 1 && r.addEventListener(we, Pe), function() {
|
|
586
|
+
E(), p.length || r.removeEventListener(we, Pe);
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
589
|
};
|
|
590
590
|
return m;
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function st(e) {
|
|
593
593
|
e === void 0 && (e = {});
|
|
594
|
-
var t = e, n = t.initialEntries, r = n === void 0 ? ["/"] : n, o = t.initialIndex, a = r.map(function(
|
|
595
|
-
var
|
|
594
|
+
var t = e, n = t.initialEntries, r = n === void 0 ? ["/"] : n, o = t.initialIndex, a = r.map(function(g) {
|
|
595
|
+
var P = ee(Q({
|
|
596
596
|
pathname: "/",
|
|
597
597
|
search: "",
|
|
598
598
|
hash: "",
|
|
599
599
|
state: null,
|
|
600
|
-
key:
|
|
601
|
-
}, typeof
|
|
602
|
-
return process.env.NODE_ENV !== "production" && K(
|
|
603
|
-
}), s =
|
|
604
|
-
function h(
|
|
605
|
-
return typeof
|
|
606
|
-
}
|
|
607
|
-
function
|
|
608
|
-
return
|
|
600
|
+
key: Ee()
|
|
601
|
+
}, typeof g == "string" ? fe(g) : g));
|
|
602
|
+
return process.env.NODE_ENV !== "production" && K(P.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(g) + ")"), P;
|
|
603
|
+
}), s = ct(o ?? a.length - 1, 0, a.length - 1), c = H.Pop, i = a[s], u = te(), f = te();
|
|
604
|
+
function h(g) {
|
|
605
|
+
return typeof g == "string" ? g : z(g);
|
|
606
|
+
}
|
|
607
|
+
function v(g, P) {
|
|
608
|
+
return P === void 0 && (P = null), ee(Q({
|
|
609
609
|
pathname: i.pathname,
|
|
610
610
|
search: "",
|
|
611
611
|
hash: ""
|
|
612
|
-
}, typeof
|
|
613
|
-
state:
|
|
614
|
-
key:
|
|
612
|
+
}, typeof g == "string" ? fe(g) : g, {
|
|
613
|
+
state: P,
|
|
614
|
+
key: Ee()
|
|
615
615
|
}));
|
|
616
616
|
}
|
|
617
|
-
function p(
|
|
617
|
+
function p(g, P, A) {
|
|
618
618
|
return !f.length || (f.call({
|
|
619
|
-
action:
|
|
620
|
-
location:
|
|
619
|
+
action: g,
|
|
620
|
+
location: P,
|
|
621
621
|
retry: A
|
|
622
622
|
}), !1);
|
|
623
623
|
}
|
|
624
|
-
function k(
|
|
625
|
-
|
|
626
|
-
action:
|
|
624
|
+
function k(g, P) {
|
|
625
|
+
c = g, i = P, u.call({
|
|
626
|
+
action: c,
|
|
627
627
|
location: i
|
|
628
628
|
});
|
|
629
629
|
}
|
|
630
|
-
function g
|
|
631
|
-
var A = H.Push, x =
|
|
630
|
+
function R(g, P) {
|
|
631
|
+
var A = H.Push, x = v(g, P);
|
|
632
632
|
function m() {
|
|
633
|
-
g
|
|
633
|
+
R(g, P);
|
|
634
634
|
}
|
|
635
|
-
process.env.NODE_ENV !== "production" && K(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(
|
|
635
|
+
process.env.NODE_ENV !== "production" && K(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(g) + ")"), p(A, x, m) && (s += 1, a.splice(s, a.length, x), k(A, x));
|
|
636
636
|
}
|
|
637
|
-
function y(
|
|
638
|
-
var A = H.Replace, x =
|
|
637
|
+
function y(g, P) {
|
|
638
|
+
var A = H.Replace, x = v(g, P);
|
|
639
639
|
function m() {
|
|
640
|
-
y(
|
|
640
|
+
y(g, P);
|
|
641
641
|
}
|
|
642
|
-
process.env.NODE_ENV !== "production" && K(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(
|
|
642
|
+
process.env.NODE_ENV !== "production" && K(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(g) + ")"), p(A, x, m) && (a[s] = x, k(A, x));
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
var
|
|
644
|
+
function S(g) {
|
|
645
|
+
var P = ct(s + g, 0, a.length - 1), A = H.Pop, x = a[P];
|
|
646
646
|
function m() {
|
|
647
|
-
|
|
647
|
+
S(g);
|
|
648
648
|
}
|
|
649
|
-
p(A, x, m) && (s =
|
|
649
|
+
p(A, x, m) && (s = P, k(A, x));
|
|
650
650
|
}
|
|
651
|
-
var
|
|
651
|
+
var B = {
|
|
652
652
|
get index() {
|
|
653
653
|
return s;
|
|
654
654
|
},
|
|
655
655
|
get action() {
|
|
656
|
-
return
|
|
656
|
+
return c;
|
|
657
657
|
},
|
|
658
658
|
get location() {
|
|
659
659
|
return i;
|
|
660
660
|
},
|
|
661
661
|
createHref: h,
|
|
662
|
-
push:
|
|
662
|
+
push: R,
|
|
663
663
|
replace: y,
|
|
664
|
-
go:
|
|
664
|
+
go: S,
|
|
665
665
|
back: function() {
|
|
666
|
-
|
|
666
|
+
S(-1);
|
|
667
667
|
},
|
|
668
668
|
forward: function() {
|
|
669
|
-
|
|
669
|
+
S(1);
|
|
670
670
|
},
|
|
671
|
-
listen: function(
|
|
672
|
-
return
|
|
671
|
+
listen: function(P) {
|
|
672
|
+
return u.push(P);
|
|
673
673
|
},
|
|
674
|
-
block: function(
|
|
675
|
-
return f.push(
|
|
674
|
+
block: function(P) {
|
|
675
|
+
return f.push(P);
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
|
-
return
|
|
678
|
+
return B;
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function ct(e, t, n) {
|
|
681
681
|
return Math.min(Math.max(e, t), n);
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function Pe(e) {
|
|
684
684
|
e.preventDefault(), e.returnValue = "";
|
|
685
685
|
}
|
|
686
686
|
function te() {
|
|
@@ -703,14 +703,14 @@ function te() {
|
|
|
703
703
|
}
|
|
704
704
|
};
|
|
705
705
|
}
|
|
706
|
-
function
|
|
706
|
+
function Ee() {
|
|
707
707
|
return Math.random().toString(36).substr(2, 8);
|
|
708
708
|
}
|
|
709
709
|
function z(e) {
|
|
710
710
|
var t = e.pathname, n = t === void 0 ? "/" : t, r = e.search, o = r === void 0 ? "" : r, a = e.hash, s = a === void 0 ? "" : a;
|
|
711
711
|
return o && o !== "?" && (n += o.charAt(0) === "?" ? o : "?" + o), s && s !== "#" && (n += s.charAt(0) === "#" ? s : "#" + s), n;
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function fe(e) {
|
|
714
714
|
var t = {};
|
|
715
715
|
if (e) {
|
|
716
716
|
var n = e.indexOf("#");
|
|
@@ -720,7 +720,7 @@ function ue(e) {
|
|
|
720
720
|
}
|
|
721
721
|
return t;
|
|
722
722
|
}
|
|
723
|
-
class
|
|
723
|
+
class Fn extends Error {
|
|
724
724
|
/**
|
|
725
725
|
* Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
|
|
726
726
|
* This detailed error message aids in quickly identifying and resolving mismatches in route usage.
|
|
@@ -731,63 +731,63 @@ class Dn extends Error {
|
|
|
731
731
|
super(`useRoute called with incorrect route. Given ${t}, expected ${n}`);
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
const
|
|
735
|
-
function
|
|
736
|
-
const e =
|
|
734
|
+
const Bt = Symbol();
|
|
735
|
+
function Jn() {
|
|
736
|
+
const e = re(Bt);
|
|
737
737
|
if (!e)
|
|
738
|
-
throw new
|
|
738
|
+
throw new he();
|
|
739
739
|
return e;
|
|
740
740
|
}
|
|
741
|
-
const
|
|
742
|
-
function
|
|
743
|
-
const e =
|
|
741
|
+
const Lt = Symbol();
|
|
742
|
+
function De() {
|
|
743
|
+
const e = re(Lt);
|
|
744
744
|
if (!e)
|
|
745
|
-
throw new
|
|
745
|
+
throw new he();
|
|
746
746
|
return e;
|
|
747
747
|
}
|
|
748
748
|
const Ct = Symbol("isRouterRouteSymbol");
|
|
749
|
-
function
|
|
749
|
+
function Qn(e) {
|
|
750
750
|
return typeof e == "object" && e !== null && Ct in e;
|
|
751
751
|
}
|
|
752
|
-
function
|
|
753
|
-
function n(
|
|
754
|
-
if (typeof
|
|
755
|
-
const
|
|
752
|
+
function Gn(e, t) {
|
|
753
|
+
function n(R, y, S) {
|
|
754
|
+
if (typeof R == "object") {
|
|
755
|
+
const g = {
|
|
756
756
|
...e.params,
|
|
757
|
-
...
|
|
757
|
+
...R
|
|
758
758
|
};
|
|
759
|
-
return t(e.name,
|
|
759
|
+
return t(e.name, g, y);
|
|
760
760
|
}
|
|
761
|
-
const
|
|
761
|
+
const B = {
|
|
762
762
|
...e.params,
|
|
763
|
-
[
|
|
763
|
+
[R]: y
|
|
764
764
|
};
|
|
765
|
-
return t(e.name,
|
|
765
|
+
return t(e.name, B, S);
|
|
766
766
|
}
|
|
767
|
-
const r = (...
|
|
767
|
+
const r = (...R) => {
|
|
768
768
|
const y = new URLSearchParams(e.query.toString());
|
|
769
|
-
y.set(...
|
|
770
|
-
}, o = (...
|
|
769
|
+
y.set(...R), n({}, { query: y });
|
|
770
|
+
}, o = (...R) => {
|
|
771
771
|
const y = new URLSearchParams(e.query.toString());
|
|
772
|
-
y.append(...
|
|
773
|
-
}, a = (...
|
|
772
|
+
y.append(...R), n({}, { query: y });
|
|
773
|
+
}, a = (...R) => {
|
|
774
774
|
const y = new URLSearchParams(e.query.toString());
|
|
775
|
-
y.delete(...
|
|
776
|
-
}, { id: s, matched:
|
|
775
|
+
y.delete(...R), n({}, { query: y });
|
|
776
|
+
}, { id: s, matched: c, matches: i, name: u, hash: f } = un(e), h = N({
|
|
777
777
|
get() {
|
|
778
778
|
return new Proxy(e.params, {
|
|
779
|
-
set(
|
|
780
|
-
return n(y,
|
|
779
|
+
set(R, y, S) {
|
|
780
|
+
return n(y, S), !0;
|
|
781
781
|
}
|
|
782
782
|
});
|
|
783
783
|
},
|
|
784
|
-
set(
|
|
785
|
-
n(
|
|
784
|
+
set(R) {
|
|
785
|
+
n(R);
|
|
786
786
|
}
|
|
787
|
-
}),
|
|
787
|
+
}), v = N({
|
|
788
788
|
get() {
|
|
789
789
|
return new Proxy(e.query, {
|
|
790
|
-
get(
|
|
790
|
+
get(R, y, S) {
|
|
791
791
|
switch (y) {
|
|
792
792
|
case "append":
|
|
793
793
|
return o;
|
|
@@ -796,57 +796,57 @@ function In(e, t) {
|
|
|
796
796
|
case "delete":
|
|
797
797
|
return a;
|
|
798
798
|
default:
|
|
799
|
-
return Reflect.get(
|
|
799
|
+
return Reflect.get(R, y, S);
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
});
|
|
803
803
|
},
|
|
804
|
-
set(
|
|
805
|
-
n({}, { query:
|
|
804
|
+
set(R) {
|
|
805
|
+
n({}, { query: R });
|
|
806
806
|
}
|
|
807
807
|
}), p = N({
|
|
808
808
|
get() {
|
|
809
809
|
return new Proxy(e.state, {
|
|
810
|
-
set(
|
|
811
|
-
return n({}, { state: { ...e.state, [y]:
|
|
810
|
+
set(R, y, S) {
|
|
811
|
+
return n({}, { state: { ...e.state, [y]: S } }), !0;
|
|
812
812
|
}
|
|
813
813
|
});
|
|
814
814
|
},
|
|
815
|
-
set(
|
|
816
|
-
n({}, { state:
|
|
815
|
+
set(R) {
|
|
816
|
+
n({}, { state: R });
|
|
817
817
|
}
|
|
818
818
|
});
|
|
819
|
-
return
|
|
819
|
+
return Ue({
|
|
820
820
|
id: s,
|
|
821
|
-
matched:
|
|
821
|
+
matched: c,
|
|
822
822
|
matches: i,
|
|
823
823
|
state: p,
|
|
824
|
-
query:
|
|
824
|
+
query: v,
|
|
825
825
|
hash: f,
|
|
826
826
|
params: h,
|
|
827
|
-
name:
|
|
827
|
+
name: u,
|
|
828
828
|
update: n,
|
|
829
829
|
[Ct]: !0
|
|
830
830
|
});
|
|
831
831
|
}
|
|
832
|
-
const
|
|
833
|
-
function
|
|
834
|
-
const n =
|
|
832
|
+
const Nt = Symbol();
|
|
833
|
+
function Kn(e, t) {
|
|
834
|
+
const n = Ue({ ...e }), r = (s) => {
|
|
835
835
|
Object.assign(n, {
|
|
836
|
-
[
|
|
836
|
+
[Nt]: !1,
|
|
837
837
|
...s
|
|
838
838
|
});
|
|
839
|
-
}, o = n, a =
|
|
839
|
+
}, o = n, a = Gn(o, t);
|
|
840
840
|
return {
|
|
841
841
|
currentRoute: o,
|
|
842
842
|
routerRoute: a,
|
|
843
843
|
updateRoute: r
|
|
844
844
|
};
|
|
845
845
|
}
|
|
846
|
-
function
|
|
847
|
-
return !e.startsWith("http") ?
|
|
846
|
+
function T(e) {
|
|
847
|
+
return !e.startsWith("http") ? Yn(e) : zn(e);
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function zn(e) {
|
|
850
850
|
const { protocol: t, host: n, pathname: r, search: o, searchParams: a, hash: s } = new URL(e, e);
|
|
851
851
|
return {
|
|
852
852
|
protocol: t,
|
|
@@ -857,7 +857,7 @@ function Fn(e) {
|
|
|
857
857
|
hash: s
|
|
858
858
|
};
|
|
859
859
|
}
|
|
860
|
-
function
|
|
860
|
+
function Yn(e) {
|
|
861
861
|
const { pathname: t, search: n, searchParams: r, hash: o } = new URL(e, "https://localhost");
|
|
862
862
|
return {
|
|
863
863
|
pathname: t,
|
|
@@ -866,19 +866,19 @@ function Jn(e) {
|
|
|
866
866
|
hash: o
|
|
867
867
|
};
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function Xn(e) {
|
|
870
870
|
return (t) => {
|
|
871
|
-
const { host: n } =
|
|
871
|
+
const { host: n } = T(t);
|
|
872
872
|
return !(n === void 0 || n === e);
|
|
873
873
|
};
|
|
874
874
|
}
|
|
875
|
-
function
|
|
876
|
-
const n =
|
|
877
|
-
if (
|
|
878
|
-
n.replace(i,
|
|
875
|
+
function Zn({ mode: e, listener: t }) {
|
|
876
|
+
const n = er(e), r = (i, u) => {
|
|
877
|
+
if (u != null && u.replace) {
|
|
878
|
+
n.replace(i, u.state);
|
|
879
879
|
return;
|
|
880
880
|
}
|
|
881
|
-
n.push(i,
|
|
881
|
+
n.push(i, u == null ? void 0 : u.state);
|
|
882
882
|
}, o = () => {
|
|
883
883
|
const i = z(n.location);
|
|
884
884
|
n.replace(i);
|
|
@@ -896,22 +896,22 @@ function Gn({ mode: e, listener: t }) {
|
|
|
896
896
|
}
|
|
897
897
|
};
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function er(e = "auto") {
|
|
900
900
|
switch (e) {
|
|
901
901
|
case "auto":
|
|
902
|
-
return
|
|
902
|
+
return Te() ? at() : st();
|
|
903
903
|
case "browser":
|
|
904
|
-
return
|
|
904
|
+
return at();
|
|
905
905
|
case "memory":
|
|
906
|
-
return
|
|
906
|
+
return st();
|
|
907
907
|
case "hash":
|
|
908
|
-
return
|
|
908
|
+
return In();
|
|
909
909
|
default:
|
|
910
910
|
const t = e;
|
|
911
911
|
throw new Error(`Switch is not exhaustive for mode: ${t}`);
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
|
-
class
|
|
914
|
+
class be {
|
|
915
915
|
constructor() {
|
|
916
916
|
_(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
917
917
|
_(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
@@ -921,7 +921,7 @@ class Ee {
|
|
|
921
921
|
_(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
922
922
|
}
|
|
923
923
|
}
|
|
924
|
-
class
|
|
924
|
+
class Ht extends Error {
|
|
925
925
|
constructor() {
|
|
926
926
|
super("Uncaught CallbackContextAbortError");
|
|
927
927
|
_(this, "response");
|
|
@@ -935,67 +935,67 @@ class X extends Error {
|
|
|
935
935
|
this.response = { status: "PUSH", to: n };
|
|
936
936
|
}
|
|
937
937
|
}
|
|
938
|
-
class
|
|
938
|
+
class Se extends Error {
|
|
939
939
|
constructor(n) {
|
|
940
940
|
super("Uncaught CallbackContextRejectionError");
|
|
941
941
|
_(this, "response");
|
|
942
942
|
this.response = { status: "REJECT", type: n };
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
function
|
|
946
|
-
const n = new
|
|
945
|
+
function tr(e, t) {
|
|
946
|
+
const n = new be();
|
|
947
947
|
return e.matches.forEach((r, o) => {
|
|
948
|
-
r.onBeforeRouteEnter &&
|
|
948
|
+
r.onBeforeRouteEnter && We(e, t, o) && Y(r.onBeforeRouteEnter).forEach((a) => n.onBeforeRouteEnter.add(a)), r.onBeforeRouteUpdate && Fe(e, t, o) && Y(r.onBeforeRouteUpdate).forEach((a) => n.onBeforeRouteUpdate.add(a));
|
|
949
949
|
}), t.matches.forEach((r, o) => {
|
|
950
|
-
r.onBeforeRouteLeave &&
|
|
950
|
+
r.onBeforeRouteLeave && Ie(e, t, o) && Y(r.onBeforeRouteLeave).forEach((a) => n.onBeforeRouteLeave.add(a));
|
|
951
951
|
}), n;
|
|
952
952
|
}
|
|
953
|
-
function
|
|
954
|
-
const n = new
|
|
953
|
+
function nr(e, t) {
|
|
954
|
+
const n = new be();
|
|
955
955
|
return e.matches.forEach((r, o) => {
|
|
956
|
-
r.onAfterRouteEnter &&
|
|
956
|
+
r.onAfterRouteEnter && We(e, t, o) && Y(r.onAfterRouteEnter).forEach((a) => n.onAfterRouteEnter.add(a)), r.onAfterRouteUpdate && Fe(e, t, o) && Y(r.onAfterRouteUpdate).forEach((a) => n.onAfterRouteUpdate.add(a));
|
|
957
957
|
}), t.matches.forEach((r, o) => {
|
|
958
|
-
r.onAfterRouteLeave &&
|
|
958
|
+
r.onAfterRouteLeave && Ie(e, t, o) && Y(r.onAfterRouteLeave).forEach((a) => n.onAfterRouteLeave.add(a));
|
|
959
959
|
}), n;
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function M(e) {
|
|
962
962
|
return typeof e != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(e);
|
|
963
963
|
}
|
|
964
|
-
function
|
|
965
|
-
return
|
|
964
|
+
function rr(e) {
|
|
965
|
+
return M(e) ? e : `/${e}`;
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function jt() {
|
|
968
968
|
return { reject: (o) => {
|
|
969
|
-
throw new
|
|
969
|
+
throw new Se(o);
|
|
970
970
|
}, push: (...o) => {
|
|
971
971
|
throw new X(o);
|
|
972
972
|
}, replace: (o, a, s) => {
|
|
973
|
-
if (
|
|
974
|
-
const
|
|
975
|
-
throw new X([o, { ...
|
|
973
|
+
if (M(o)) {
|
|
974
|
+
const u = a ?? {};
|
|
975
|
+
throw new X([o, { ...u, replace: !0 }]);
|
|
976
976
|
}
|
|
977
|
-
const
|
|
978
|
-
throw new X([o,
|
|
977
|
+
const c = a, i = s ?? {};
|
|
978
|
+
throw new X([o, c, { ...i, replace: !0 }]);
|
|
979
979
|
}, abort: () => {
|
|
980
|
-
throw new
|
|
980
|
+
throw new Ht();
|
|
981
981
|
} };
|
|
982
982
|
}
|
|
983
|
-
function
|
|
984
|
-
const { reject: e, push: t, replace: n, abort: r } =
|
|
985
|
-
async function o({ to: s, from:
|
|
986
|
-
const { global:
|
|
987
|
-
...
|
|
983
|
+
function or() {
|
|
984
|
+
const { reject: e, push: t, replace: n, abort: r } = jt();
|
|
985
|
+
async function o({ to: s, from: c, hooks: i }) {
|
|
986
|
+
const { global: u, component: f } = i, h = tr(s, c), v = [
|
|
987
|
+
...u.onBeforeRouteEnter,
|
|
988
988
|
...h.onBeforeRouteEnter,
|
|
989
|
-
...
|
|
989
|
+
...u.onBeforeRouteUpdate,
|
|
990
990
|
...h.onBeforeRouteUpdate,
|
|
991
991
|
...f.onBeforeRouteUpdate,
|
|
992
|
-
...
|
|
992
|
+
...u.onBeforeRouteLeave,
|
|
993
993
|
...h.onBeforeRouteLeave,
|
|
994
994
|
...f.onBeforeRouteLeave
|
|
995
995
|
];
|
|
996
996
|
try {
|
|
997
|
-
const p =
|
|
998
|
-
from:
|
|
997
|
+
const p = v.map((k) => k(s, {
|
|
998
|
+
from: c,
|
|
999
999
|
reject: e,
|
|
1000
1000
|
push: t,
|
|
1001
1001
|
replace: n,
|
|
@@ -1003,7 +1003,7 @@ function Zn() {
|
|
|
1003
1003
|
}));
|
|
1004
1004
|
await Promise.all(p);
|
|
1005
1005
|
} catch (p) {
|
|
1006
|
-
if (p instanceof X || p instanceof
|
|
1006
|
+
if (p instanceof X || p instanceof Se || p instanceof Ht)
|
|
1007
1007
|
return p.response;
|
|
1008
1008
|
throw p;
|
|
1009
1009
|
}
|
|
@@ -1011,28 +1011,28 @@ function Zn() {
|
|
|
1011
1011
|
status: "SUCCESS"
|
|
1012
1012
|
};
|
|
1013
1013
|
}
|
|
1014
|
-
async function a({ to: s, from:
|
|
1015
|
-
const { global:
|
|
1014
|
+
async function a({ to: s, from: c, hooks: i }) {
|
|
1015
|
+
const { global: u, component: f } = i, h = nr(s, c), v = [
|
|
1016
1016
|
...f.onAfterRouteLeave,
|
|
1017
1017
|
...h.onAfterRouteLeave,
|
|
1018
|
-
...
|
|
1018
|
+
...u.onAfterRouteLeave,
|
|
1019
1019
|
...f.onAfterRouteUpdate,
|
|
1020
1020
|
...h.onAfterRouteUpdate,
|
|
1021
|
-
...
|
|
1021
|
+
...u.onAfterRouteUpdate,
|
|
1022
1022
|
...f.onAfterRouteEnter,
|
|
1023
1023
|
...h.onAfterRouteEnter,
|
|
1024
|
-
...
|
|
1024
|
+
...u.onAfterRouteEnter
|
|
1025
1025
|
];
|
|
1026
1026
|
try {
|
|
1027
|
-
const p =
|
|
1028
|
-
from:
|
|
1027
|
+
const p = v.map((k) => k(s, {
|
|
1028
|
+
from: c,
|
|
1029
1029
|
reject: e,
|
|
1030
1030
|
push: t,
|
|
1031
1031
|
replace: n
|
|
1032
1032
|
}));
|
|
1033
1033
|
await Promise.all(p);
|
|
1034
1034
|
} catch (p) {
|
|
1035
|
-
if (p instanceof X || p instanceof
|
|
1035
|
+
if (p instanceof X || p instanceof Se)
|
|
1036
1036
|
return p.response;
|
|
1037
1037
|
throw p;
|
|
1038
1038
|
}
|
|
@@ -1045,74 +1045,74 @@ function Zn() {
|
|
|
1045
1045
|
runAfterRouteHooks: a
|
|
1046
1046
|
};
|
|
1047
1047
|
}
|
|
1048
|
-
const
|
|
1048
|
+
const We = (e, t, n) => {
|
|
1049
1049
|
var a;
|
|
1050
1050
|
const r = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
1051
1051
|
return r.length < n || r[n].id !== ((a = o[n]) == null ? void 0 : a.id);
|
|
1052
|
-
},
|
|
1052
|
+
}, Ie = (e, t, n) => {
|
|
1053
1053
|
var a;
|
|
1054
1054
|
const r = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
1055
1055
|
return r.length < n || r[n].id !== ((a = o[n]) == null ? void 0 : a.id);
|
|
1056
|
-
},
|
|
1056
|
+
}, Fe = (e, t, n) => {
|
|
1057
1057
|
var r;
|
|
1058
1058
|
return e.matches[n].id === ((r = t == null ? void 0 : t.matches[n]) == null ? void 0 : r.id);
|
|
1059
1059
|
};
|
|
1060
|
-
function
|
|
1060
|
+
function ut(e) {
|
|
1061
1061
|
switch (e) {
|
|
1062
1062
|
case "onBeforeRouteEnter":
|
|
1063
1063
|
case "onAfterRouteEnter":
|
|
1064
|
-
return
|
|
1064
|
+
return We;
|
|
1065
1065
|
case "onBeforeRouteUpdate":
|
|
1066
1066
|
case "onAfterRouteUpdate":
|
|
1067
|
-
return
|
|
1067
|
+
return Fe;
|
|
1068
1068
|
case "onBeforeRouteLeave":
|
|
1069
1069
|
case "onAfterRouteLeave":
|
|
1070
|
-
return
|
|
1070
|
+
return Ie;
|
|
1071
1071
|
default:
|
|
1072
1072
|
throw new Error(`Switch is not exhaustive for lifecycle: ${e}`);
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
|
-
function
|
|
1075
|
+
function ar() {
|
|
1076
1076
|
const e = {
|
|
1077
|
-
global: new
|
|
1078
|
-
component: new
|
|
1077
|
+
global: new be(),
|
|
1078
|
+
component: new be()
|
|
1079
1079
|
};
|
|
1080
1080
|
function t({ lifecycle: r, timing: o, depth: a, hook: s }) {
|
|
1081
|
-
const
|
|
1082
|
-
if (
|
|
1081
|
+
const c = ut(r), i = e[o][r], u = (f, h) => {
|
|
1082
|
+
if (c(f, h.from, a))
|
|
1083
1083
|
return s(f, h);
|
|
1084
1084
|
};
|
|
1085
|
-
return i.add(
|
|
1085
|
+
return i.add(u), () => i.delete(u);
|
|
1086
1086
|
}
|
|
1087
1087
|
function n({ lifecycle: r, timing: o, depth: a, hook: s }) {
|
|
1088
|
-
const
|
|
1089
|
-
if (
|
|
1088
|
+
const c = ut(r), i = e[o][r], u = (f, h) => {
|
|
1089
|
+
if (c(f, h.from, a))
|
|
1090
1090
|
return s(f, h);
|
|
1091
1091
|
};
|
|
1092
|
-
return i.add(
|
|
1092
|
+
return i.add(u), () => i.delete(u);
|
|
1093
1093
|
}
|
|
1094
1094
|
return { ...e, addBeforeRouteHook: t, addAfterRouteHook: n };
|
|
1095
1095
|
}
|
|
1096
|
-
const
|
|
1097
|
-
function
|
|
1098
|
-
const e =
|
|
1096
|
+
const Vt = Symbol();
|
|
1097
|
+
function sr() {
|
|
1098
|
+
const e = ar();
|
|
1099
1099
|
return {
|
|
1100
|
-
onBeforeRouteEnter: (
|
|
1101
|
-
onBeforeRouteUpdate: (
|
|
1102
|
-
onBeforeRouteLeave: (
|
|
1103
|
-
onAfterRouteEnter: (
|
|
1104
|
-
onAfterRouteUpdate: (
|
|
1105
|
-
onAfterRouteLeave: (
|
|
1100
|
+
onBeforeRouteEnter: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
|
|
1101
|
+
onBeforeRouteUpdate: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
|
|
1102
|
+
onBeforeRouteLeave: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteLeave", hook: c, timing: "global", depth: 0 }),
|
|
1103
|
+
onAfterRouteEnter: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteEnter", hook: c, timing: "global", depth: 0 }),
|
|
1104
|
+
onAfterRouteUpdate: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteUpdate", hook: c, timing: "global", depth: 0 }),
|
|
1105
|
+
onAfterRouteLeave: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteLeave", hook: c, timing: "global", depth: 0 }),
|
|
1106
1106
|
hooks: e
|
|
1107
1107
|
};
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1110
|
-
return
|
|
1109
|
+
function cr(e) {
|
|
1110
|
+
return le(() => () => ve("h1", e), {
|
|
1111
1111
|
name: e,
|
|
1112
1112
|
props: []
|
|
1113
1113
|
});
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function $t(e) {
|
|
1116
1116
|
const t = new URLSearchParams(e);
|
|
1117
1117
|
return {
|
|
1118
1118
|
get: (...n) => t.get(...n),
|
|
@@ -1136,35 +1136,35 @@ function jt(e) {
|
|
|
1136
1136
|
has: (...n) => t.has(...n)
|
|
1137
1137
|
};
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1139
|
+
function Ot() {
|
|
1140
1140
|
let e = 0;
|
|
1141
1141
|
return () => (++e).toString();
|
|
1142
1142
|
}
|
|
1143
|
-
const
|
|
1144
|
-
function
|
|
1143
|
+
const Je = Ot();
|
|
1144
|
+
function ur({
|
|
1145
1145
|
rejections: e
|
|
1146
1146
|
}) {
|
|
1147
1147
|
const t = (a) => {
|
|
1148
1148
|
const s = {
|
|
1149
1149
|
...e
|
|
1150
1150
|
};
|
|
1151
|
-
return
|
|
1151
|
+
return ye(s[a] ?? cr(a));
|
|
1152
1152
|
}, n = (a) => {
|
|
1153
|
-
const s =
|
|
1154
|
-
id:
|
|
1153
|
+
const s = ye(t(a)), c = {
|
|
1154
|
+
id: Je(),
|
|
1155
1155
|
component: s,
|
|
1156
1156
|
meta: {},
|
|
1157
1157
|
state: {}
|
|
1158
1158
|
};
|
|
1159
1159
|
return {
|
|
1160
|
-
id:
|
|
1161
|
-
matched:
|
|
1162
|
-
matches: [
|
|
1160
|
+
id: c.id,
|
|
1161
|
+
matched: c,
|
|
1162
|
+
matches: [c],
|
|
1163
1163
|
name: a,
|
|
1164
|
-
query:
|
|
1164
|
+
query: $t(""),
|
|
1165
1165
|
params: {},
|
|
1166
1166
|
state: {},
|
|
1167
|
-
[
|
|
1167
|
+
[Nt]: !0
|
|
1168
1168
|
};
|
|
1169
1169
|
}, r = (a) => {
|
|
1170
1170
|
if (!a) {
|
|
@@ -1173,311 +1173,311 @@ function rr({
|
|
|
1173
1173
|
}
|
|
1174
1174
|
const s = t(a);
|
|
1175
1175
|
o.value = { type: a, component: s };
|
|
1176
|
-
}, o =
|
|
1176
|
+
}, o = qe(null);
|
|
1177
1177
|
return {
|
|
1178
1178
|
setRejection: r,
|
|
1179
1179
|
rejection: o,
|
|
1180
1180
|
getRejectionRoute: n
|
|
1181
1181
|
};
|
|
1182
1182
|
}
|
|
1183
|
-
class
|
|
1183
|
+
class ir extends Error {
|
|
1184
1184
|
constructor(t) {
|
|
1185
1185
|
super(`Route not found: "${t}"`);
|
|
1186
1186
|
}
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1188
|
+
function Qe(e) {
|
|
1189
1189
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function fr(e, t) {
|
|
1192
1192
|
const n = Array.from(e.matchAll(t));
|
|
1193
1193
|
if (n.length === 0)
|
|
1194
1194
|
return [e];
|
|
1195
1195
|
let r = 0;
|
|
1196
|
-
const o = n.reduce((s,
|
|
1197
|
-
const i =
|
|
1196
|
+
const o = n.reduce((s, c) => {
|
|
1197
|
+
const i = Qe(e.slice(r, c.index));
|
|
1198
1198
|
i.length && s.push(i);
|
|
1199
|
-
const [
|
|
1200
|
-
return s.push(
|
|
1199
|
+
const [u] = c;
|
|
1200
|
+
return s.push(u), r = c.index + u.length, s;
|
|
1201
1201
|
}, []), a = e.slice(r);
|
|
1202
1202
|
return a && o.push(a), o;
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1205
|
-
const t =
|
|
1204
|
+
function lr(e) {
|
|
1205
|
+
const t = qt(e.path.value);
|
|
1206
1206
|
return new RegExp(`^${t}$`, "i");
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1208
|
+
function hr(e) {
|
|
1209
1209
|
const t = new URLSearchParams(e.query.value);
|
|
1210
|
-
return Array.from(t.entries()).filter(([, n]) => !
|
|
1211
|
-
const o =
|
|
1212
|
-
return new RegExp(`${
|
|
1210
|
+
return Array.from(t.entries()).filter(([, n]) => !Ve(n)).map(([n, r]) => {
|
|
1211
|
+
const o = qt(r);
|
|
1212
|
+
return new RegExp(`${Qe(n)}=${o}(&|$)`, "i");
|
|
1213
1213
|
});
|
|
1214
1214
|
}
|
|
1215
|
-
function Vt(e) {
|
|
1216
|
-
return ar(e, new RegExp(ur, "g")).map((t) => t.startsWith(I) ? qt(t) : Ie(t)).join("");
|
|
1217
|
-
}
|
|
1218
1215
|
function qt(e) {
|
|
1216
|
+
return fr(e, new RegExp(pr, "g")).map((t) => t.startsWith(W) ? _t(t) : Qe(t)).join("");
|
|
1217
|
+
}
|
|
1218
|
+
function _t(e) {
|
|
1219
1219
|
return [
|
|
1220
|
-
|
|
1221
|
-
|
|
1220
|
+
dr,
|
|
1221
|
+
mr
|
|
1222
1222
|
].reduce((t, n) => n(t), e);
|
|
1223
1223
|
}
|
|
1224
|
-
const
|
|
1225
|
-
function
|
|
1226
|
-
return e.replace(new RegExp(
|
|
1224
|
+
const pr = `\\${W}\\??([\\w-_]+)\\${G}`, Ge = `\\${W}\\?([\\w-_]+)\\${G}`, Mt = `\\${W}([\\w-_]+)\\${G}`;
|
|
1225
|
+
function dr(e) {
|
|
1226
|
+
return e.replace(new RegExp(Ge, "g"), ".*");
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1229
|
-
return new RegExp(
|
|
1228
|
+
function Ve(e) {
|
|
1229
|
+
return new RegExp(Ge, "g").test(e);
|
|
1230
1230
|
}
|
|
1231
|
-
function
|
|
1232
|
-
return e.replace(new RegExp(
|
|
1231
|
+
function mr(e) {
|
|
1232
|
+
return e.replace(new RegExp(Mt, "g"), ".+");
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1235
|
-
const [t] =
|
|
1234
|
+
function Le(e) {
|
|
1235
|
+
const [t] = ke(e, new RegExp(Ge, "g")), [n] = ke(e, new RegExp(Mt, "g"));
|
|
1236
1236
|
return t ?? n;
|
|
1237
1237
|
}
|
|
1238
|
-
function
|
|
1239
|
-
return Array.from(e.matchAll(t)).flatMap(([, ...r]) => r.map((o) =>
|
|
1238
|
+
function ke(e, t) {
|
|
1239
|
+
return Array.from(e.matchAll(t)).flatMap(([, ...r]) => r.map((o) => de(o) ? o : ""));
|
|
1240
1240
|
}
|
|
1241
|
-
function
|
|
1242
|
-
const r = Wt(t, n), [o] =
|
|
1241
|
+
function Tt(e, t, n) {
|
|
1242
|
+
const r = Wt(t, n), [o] = ke(e, r);
|
|
1243
1243
|
return o;
|
|
1244
1244
|
}
|
|
1245
1245
|
function Dt(e, t) {
|
|
1246
1246
|
if (!t)
|
|
1247
1247
|
return e;
|
|
1248
1248
|
const { name: n, param: r, value: o } = t, a = Wt(e, n);
|
|
1249
|
-
return
|
|
1249
|
+
return ke(e, a).reduce((c, i) => i === void 0 ? c : c.replace(i, () => ie(o, r, n.startsWith("?"))), e);
|
|
1250
1250
|
}
|
|
1251
1251
|
function Wt(e, t) {
|
|
1252
1252
|
const n = [
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1253
|
+
gr,
|
|
1254
|
+
vr,
|
|
1255
|
+
_t
|
|
1256
1256
|
].reduce((r, o) => o(r, t), e);
|
|
1257
1257
|
return new RegExp(n, "g");
|
|
1258
1258
|
}
|
|
1259
|
-
function
|
|
1259
|
+
function gr(e, t) {
|
|
1260
1260
|
if (!t.startsWith("?"))
|
|
1261
1261
|
return e;
|
|
1262
|
-
const n = new RegExp(`\\${
|
|
1262
|
+
const n = new RegExp(`\\${W}\\${t}\\${G}`, "g");
|
|
1263
1263
|
return e.replace(n, "(.*)");
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1265
|
+
function vr(e, t) {
|
|
1266
1266
|
if (t.startsWith("?"))
|
|
1267
1267
|
return e;
|
|
1268
|
-
const n = new RegExp(`\\${
|
|
1268
|
+
const n = new RegExp(`\\${W}${t}\\${G}`, "g");
|
|
1269
1269
|
return e.replace(n, "(.+)");
|
|
1270
1270
|
}
|
|
1271
|
-
function
|
|
1271
|
+
function It({ protocol: e, host: t, pathname: n, search: r, searchParams: o, hash: a }) {
|
|
1272
1272
|
const s = new URL("https://localhost");
|
|
1273
1273
|
e && (s.protocol = e), t && (s.host = t), n && (s.pathname = n), o ? s.search = o.toString() : r && (s.search = r), a && (s.hash = a);
|
|
1274
|
-
const
|
|
1275
|
-
return
|
|
1274
|
+
const c = s.toString().replace(/^https:\/\/localhost\/*/, "/");
|
|
1275
|
+
return rr(c);
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1277
|
+
function yr(e, t) {
|
|
1278
1278
|
const n = new URLSearchParams(e), r = new URLSearchParams(t);
|
|
1279
1279
|
for (const [o, a] of r.entries())
|
|
1280
1280
|
n.append(o, a);
|
|
1281
1281
|
return n;
|
|
1282
1282
|
}
|
|
1283
|
-
function
|
|
1284
|
-
const { params: n = {}, query: r } = t, o =
|
|
1285
|
-
return
|
|
1283
|
+
function Rr(e, t = {}) {
|
|
1284
|
+
const { params: n = {}, query: r } = t, o = Er(e.query, n), a = yr(o, r), s = Pr(e.path, n), c = Re(e.hash.value ?? t.hash).value, i = wr(e.host, n), { protocol: u, host: f } = T(i);
|
|
1285
|
+
return It({ protocol: u, host: f, pathname: s, searchParams: a, hash: c });
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1287
|
+
function wr(e, t) {
|
|
1288
1288
|
const n = e.value && !e.value.startsWith("http") ? `https://${e.value}` : e.value;
|
|
1289
1289
|
return Object.entries(e.params).reduce((r, [o, a]) => {
|
|
1290
|
-
const s =
|
|
1290
|
+
const s = Le(`${W}${o}${G}`);
|
|
1291
1291
|
return s ? Dt(r, { name: o, param: a, value: t[s] }) : r;
|
|
1292
1292
|
}, n);
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function Pr(e, t) {
|
|
1295
1295
|
return Object.entries(e.params).reduce((n, [r, o]) => {
|
|
1296
|
-
const a =
|
|
1296
|
+
const a = Le(`${W}${r}${G}`);
|
|
1297
1297
|
return a ? Dt(n, { name: r, param: o, value: t[a] }) : n;
|
|
1298
1298
|
}, e.value);
|
|
1299
1299
|
}
|
|
1300
|
-
function
|
|
1300
|
+
function Er(e, t) {
|
|
1301
1301
|
const n = new URLSearchParams(e.value);
|
|
1302
1302
|
if (!e.value)
|
|
1303
1303
|
return n;
|
|
1304
1304
|
for (const [r, o] of n.entries()) {
|
|
1305
|
-
const a =
|
|
1305
|
+
const a = Le(o);
|
|
1306
1306
|
if (!a)
|
|
1307
1307
|
continue;
|
|
1308
|
-
const
|
|
1309
|
-
|
|
1308
|
+
const c = ie(t[a], e.params[a], Ve(o)), i = t[a] === void 0 && c === "";
|
|
1309
|
+
Ve(o) && i ? n.delete(r, o) : n.set(r, c);
|
|
1310
1310
|
}
|
|
1311
1311
|
return n;
|
|
1312
1312
|
}
|
|
1313
|
-
function
|
|
1313
|
+
function br(e) {
|
|
1314
1314
|
return (t, n, r) => {
|
|
1315
|
-
if (
|
|
1316
|
-
const i = n ?? {}, { searchParams:
|
|
1317
|
-
return Object.entries(i.query ?? {}).forEach(([h,
|
|
1318
|
-
|
|
1319
|
-
}),
|
|
1315
|
+
if (M(t)) {
|
|
1316
|
+
const i = n ?? {}, { searchParams: u, ...f } = T(t);
|
|
1317
|
+
return Object.entries(i.query ?? {}).forEach(([h, v]) => {
|
|
1318
|
+
u.append(h, v);
|
|
1319
|
+
}), It({ ...f, searchParams: u });
|
|
1320
1320
|
}
|
|
1321
1321
|
const o = n ?? {}, a = r ?? {}, s = e.find((i) => i.name === t);
|
|
1322
1322
|
if (!s)
|
|
1323
|
-
throw new
|
|
1324
|
-
return
|
|
1323
|
+
throw new ir(String(t));
|
|
1324
|
+
return Rr(s, {
|
|
1325
1325
|
params: o,
|
|
1326
1326
|
query: a.query,
|
|
1327
1327
|
hash: a.hash
|
|
1328
1328
|
});
|
|
1329
1329
|
};
|
|
1330
1330
|
}
|
|
1331
|
-
class
|
|
1331
|
+
class Sr extends Error {
|
|
1332
1332
|
constructor() {
|
|
1333
1333
|
super("initialUrl must be set if window.location is unavailable");
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1336
|
+
function kr(e) {
|
|
1337
1337
|
if (e)
|
|
1338
1338
|
return e;
|
|
1339
|
-
if (
|
|
1339
|
+
if (Te())
|
|
1340
1340
|
return window.location.toString();
|
|
1341
|
-
throw new
|
|
1341
|
+
throw new Sr();
|
|
1342
1342
|
}
|
|
1343
|
-
const
|
|
1343
|
+
const Ar = (e, t) => {
|
|
1344
1344
|
try {
|
|
1345
|
-
|
|
1345
|
+
Ft(e, t);
|
|
1346
1346
|
} catch {
|
|
1347
1347
|
return !1;
|
|
1348
1348
|
}
|
|
1349
1349
|
return !0;
|
|
1350
|
-
},
|
|
1351
|
-
const { pathname: n, search: r } =
|
|
1350
|
+
}, Ft = (e, t) => {
|
|
1351
|
+
const { pathname: n, search: r } = T(t);
|
|
1352
1352
|
return {
|
|
1353
|
-
...
|
|
1354
|
-
...
|
|
1353
|
+
...xr(e.path, n),
|
|
1354
|
+
...Ur(e.query, r)
|
|
1355
1355
|
};
|
|
1356
1356
|
};
|
|
1357
|
-
function
|
|
1357
|
+
function xr(e, t) {
|
|
1358
1358
|
const n = {}, r = decodeURIComponent(t);
|
|
1359
1359
|
for (const [o, a] of Object.entries(e.params)) {
|
|
1360
|
-
const s = o.startsWith("?"),
|
|
1361
|
-
n[
|
|
1360
|
+
const s = o.startsWith("?"), c = s ? o.slice(1) : o, i = Tt(r, e.value, o), u = ue(i, a, s);
|
|
1361
|
+
n[c] = u;
|
|
1362
1362
|
}
|
|
1363
1363
|
return n;
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1365
|
+
function Ur(e, t) {
|
|
1366
1366
|
const n = {}, r = new URLSearchParams(t);
|
|
1367
1367
|
for (const [o, a] of Object.entries(e.params)) {
|
|
1368
|
-
const s = o.startsWith("?"),
|
|
1369
|
-
n[
|
|
1368
|
+
const s = o.startsWith("?"), c = s ? o.slice(1) : o, i = r.get(c) ?? void 0, u = ue(i, a, s);
|
|
1369
|
+
n[c] = u;
|
|
1370
1370
|
}
|
|
1371
1371
|
return n;
|
|
1372
1372
|
}
|
|
1373
|
-
const
|
|
1374
|
-
const { pathname: n } =
|
|
1375
|
-
return
|
|
1376
|
-
},
|
|
1377
|
-
const { search: n } =
|
|
1378
|
-
return
|
|
1379
|
-
},
|
|
1380
|
-
const { hash: n } =
|
|
1373
|
+
const Br = (e) => "name" in e.matched && !!e.matched.name, Lr = (e, t) => {
|
|
1374
|
+
const { pathname: n } = T(t);
|
|
1375
|
+
return lr(e).test(n);
|
|
1376
|
+
}, Cr = (e, t) => {
|
|
1377
|
+
const { search: n } = T(t);
|
|
1378
|
+
return hr(e).every((o) => o.test(n));
|
|
1379
|
+
}, $e = (e, t) => {
|
|
1380
|
+
const { hash: n } = T(t), { value: r } = e.hash;
|
|
1381
1381
|
return r === void 0 || `#${r.toLowerCase()}` === n.toLowerCase();
|
|
1382
1382
|
};
|
|
1383
|
-
function
|
|
1384
|
-
const { searchParams: t, pathname: n } =
|
|
1383
|
+
function Nr(e) {
|
|
1384
|
+
const { searchParams: t, pathname: n } = T(e), r = -1, o = 1;
|
|
1385
1385
|
return (a, s) => {
|
|
1386
|
-
const
|
|
1387
|
-
return a.depth > s.depth ? r : a.depth < s.depth ? o :
|
|
1386
|
+
const c = ft(a, t), i = it(a, n), u = ft(s, t), f = it(s, n);
|
|
1387
|
+
return a.depth > s.depth ? r : a.depth < s.depth ? o : c + i > u + f ? r : c + i < u + f ? o : $e(a, e) ? r : $e(s, e) ? o : 0;
|
|
1388
1388
|
};
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1391
|
-
const n = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), r = n.filter((o) =>
|
|
1390
|
+
function it(e, t) {
|
|
1391
|
+
const n = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), r = n.filter((o) => Tt(t, e.path.value, o) === void 0);
|
|
1392
1392
|
return n.length - r.length;
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1394
|
+
function ft(e, t) {
|
|
1395
1395
|
const n = new URLSearchParams(e.query.value), r = Array.from(n.keys()), o = r.filter((a) => !t.has(a));
|
|
1396
1396
|
return r.length - o.length;
|
|
1397
1397
|
}
|
|
1398
|
-
function
|
|
1398
|
+
function Jt(e) {
|
|
1399
1399
|
return !!e && typeof e == "object";
|
|
1400
1400
|
}
|
|
1401
|
-
const
|
|
1402
|
-
function
|
|
1403
|
-
if (
|
|
1401
|
+
const Ae = !0;
|
|
1402
|
+
function Hr(e, t, n) {
|
|
1403
|
+
if (Jt(e) && t in e) {
|
|
1404
1404
|
const r = e[t];
|
|
1405
1405
|
if (typeof r == "string")
|
|
1406
|
-
return
|
|
1406
|
+
return ue(r, n, Ae);
|
|
1407
1407
|
}
|
|
1408
|
-
return
|
|
1408
|
+
return ue(void 0, n, Ae);
|
|
1409
1409
|
}
|
|
1410
|
-
function
|
|
1410
|
+
function jr(e, t) {
|
|
1411
1411
|
const n = {};
|
|
1412
1412
|
for (const [r, o] of Object.entries(e)) {
|
|
1413
|
-
const a =
|
|
1413
|
+
const a = Hr(t, r, o);
|
|
1414
1414
|
n[r] = a;
|
|
1415
1415
|
}
|
|
1416
1416
|
return n;
|
|
1417
1417
|
}
|
|
1418
|
-
function
|
|
1419
|
-
if (
|
|
1418
|
+
function Vr(e, t, n) {
|
|
1419
|
+
if (Jt(e) && t in e) {
|
|
1420
1420
|
const r = e[t];
|
|
1421
|
-
return
|
|
1421
|
+
return ie(r, n, Ae);
|
|
1422
1422
|
}
|
|
1423
|
-
return
|
|
1423
|
+
return ie(void 0, n, Ae);
|
|
1424
1424
|
}
|
|
1425
|
-
const
|
|
1425
|
+
const lt = (e, t) => {
|
|
1426
1426
|
const n = {};
|
|
1427
1427
|
for (const [r, o] of Object.entries(e)) {
|
|
1428
|
-
const a =
|
|
1428
|
+
const a = Vr(t, r, o);
|
|
1429
1429
|
n[r] = a;
|
|
1430
1430
|
}
|
|
1431
1431
|
return n;
|
|
1432
|
-
},
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1432
|
+
}, $r = [
|
|
1433
|
+
Br,
|
|
1434
|
+
Lr,
|
|
1435
|
+
Cr,
|
|
1436
|
+
$e,
|
|
1437
|
+
Ar
|
|
1438
1438
|
];
|
|
1439
|
-
function
|
|
1440
|
-
const r =
|
|
1439
|
+
function Ne(e, t, n) {
|
|
1440
|
+
const r = Nr(t), o = e.filter((i) => $r.every((u) => u(i, t))).sort(r);
|
|
1441
1441
|
if (o.length === 0)
|
|
1442
1442
|
return;
|
|
1443
|
-
const [a] = o, { search: s, hash:
|
|
1443
|
+
const [a] = o, { search: s, hash: c } = T(t);
|
|
1444
1444
|
return {
|
|
1445
1445
|
id: a.id,
|
|
1446
1446
|
matched: a.matched,
|
|
1447
1447
|
matches: a.matches,
|
|
1448
1448
|
name: a.name,
|
|
1449
|
-
query:
|
|
1450
|
-
params:
|
|
1451
|
-
state:
|
|
1452
|
-
hash:
|
|
1449
|
+
query: $t(s),
|
|
1450
|
+
params: Ft(a, t),
|
|
1451
|
+
state: jr(a.state, n),
|
|
1452
|
+
hash: c
|
|
1453
1453
|
};
|
|
1454
1454
|
}
|
|
1455
|
-
function
|
|
1456
|
-
const n = new RegExp(`\\${
|
|
1455
|
+
function Ke(e, t) {
|
|
1456
|
+
const n = new RegExp(`\\${W}(\\??[\\w-_]+)\\${G}`, "g");
|
|
1457
1457
|
return Array.from(e.matchAll(n)).reduce((o, [a, s]) => {
|
|
1458
|
-
const
|
|
1459
|
-
if (!
|
|
1458
|
+
const c = Le(a);
|
|
1459
|
+
if (!c)
|
|
1460
1460
|
return o;
|
|
1461
|
-
const i =
|
|
1462
|
-
return
|
|
1461
|
+
const i = Mn(t, c);
|
|
1462
|
+
return oe([c], o), o[s] = i, o;
|
|
1463
1463
|
}, {});
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1465
|
+
function Oe(e, t) {
|
|
1466
1466
|
return {
|
|
1467
1467
|
value: e,
|
|
1468
|
-
params:
|
|
1468
|
+
params: Ke(e, t)
|
|
1469
1469
|
};
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1472
|
-
return
|
|
1471
|
+
function Or(e, t) {
|
|
1472
|
+
return de(t) ? e.map((n) => {
|
|
1473
1473
|
const r = `${t}${n.path.value}`;
|
|
1474
1474
|
return {
|
|
1475
1475
|
...n,
|
|
1476
|
-
path:
|
|
1476
|
+
path: Oe(r, n.path.params)
|
|
1477
1477
|
};
|
|
1478
1478
|
}) : e;
|
|
1479
1479
|
}
|
|
1480
|
-
class
|
|
1480
|
+
class qr extends Error {
|
|
1481
1481
|
/**
|
|
1482
1482
|
* Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
|
|
1483
1483
|
* @param name - The name of the name that was duplicated.
|
|
@@ -1486,184 +1486,209 @@ class Hr extends Error {
|
|
|
1486
1486
|
super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`);
|
|
1487
1487
|
}
|
|
1488
1488
|
}
|
|
1489
|
-
function
|
|
1489
|
+
function _r(e) {
|
|
1490
1490
|
const t = e.map(({ name: n }) => n);
|
|
1491
1491
|
for (const n of t)
|
|
1492
|
-
if (
|
|
1493
|
-
throw new
|
|
1492
|
+
if (wt(t, n) > 1)
|
|
1493
|
+
throw new qr(n);
|
|
1494
|
+
}
|
|
1495
|
+
function Mr() {
|
|
1496
|
+
const e = Ue(/* @__PURE__ */ new Map()), t = Te() ? s() : null, n = (c) => {
|
|
1497
|
+
e.set(c, !1), t == null || t.observe(c);
|
|
1498
|
+
}, r = (c) => {
|
|
1499
|
+
e.delete(c), t == null || t.unobserve(c);
|
|
1500
|
+
}, o = () => {
|
|
1501
|
+
t == null || t.disconnect();
|
|
1502
|
+
}, a = (c) => e.get(c) ?? !1;
|
|
1503
|
+
function s() {
|
|
1504
|
+
return new IntersectionObserver((c) => {
|
|
1505
|
+
c.forEach((i) => {
|
|
1506
|
+
e.set(i.target, i.isIntersecting);
|
|
1507
|
+
});
|
|
1508
|
+
});
|
|
1509
|
+
}
|
|
1510
|
+
return {
|
|
1511
|
+
observe: n,
|
|
1512
|
+
unobserve: r,
|
|
1513
|
+
disconnect: o,
|
|
1514
|
+
isElementVisible: a
|
|
1515
|
+
};
|
|
1494
1516
|
}
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1517
|
+
const Qt = Symbol("visibilityObserver");
|
|
1518
|
+
function Tr() {
|
|
1519
|
+
const e = re(Qt);
|
|
1520
|
+
if (!e)
|
|
1521
|
+
throw new he();
|
|
1522
|
+
return e;
|
|
1523
|
+
}
|
|
1524
|
+
function io(e, t) {
|
|
1525
|
+
const n = bn(e) ? e.flat() : e, r = Or(n, t == null ? void 0 : t.base);
|
|
1526
|
+
_r(r);
|
|
1527
|
+
const o = Ot(), a = Kr(), s = Mr(), c = br(r), i = Zn({
|
|
1499
1528
|
mode: t == null ? void 0 : t.historyMode,
|
|
1500
|
-
listener: ({ location:
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1529
|
+
listener: ({ location: w }) => {
|
|
1530
|
+
const L = z(w);
|
|
1531
|
+
B(L, { state: w.state, replace: !0 });
|
|
1503
1532
|
}
|
|
1504
|
-
}), { runBeforeRouteHooks:
|
|
1505
|
-
hooks:
|
|
1506
|
-
onBeforeRouteEnter:
|
|
1507
|
-
onAfterRouteUpdate:
|
|
1508
|
-
onBeforeRouteLeave:
|
|
1509
|
-
onAfterRouteEnter:
|
|
1510
|
-
onBeforeRouteUpdate:
|
|
1511
|
-
onAfterRouteLeave:
|
|
1512
|
-
} =
|
|
1513
|
-
async function
|
|
1514
|
-
const
|
|
1515
|
-
if (
|
|
1516
|
-
|
|
1533
|
+
}), { runBeforeRouteHooks: u, runAfterRouteHooks: f } = or(), {
|
|
1534
|
+
hooks: h,
|
|
1535
|
+
onBeforeRouteEnter: v,
|
|
1536
|
+
onAfterRouteUpdate: p,
|
|
1537
|
+
onBeforeRouteLeave: k,
|
|
1538
|
+
onAfterRouteEnter: R,
|
|
1539
|
+
onBeforeRouteUpdate: y,
|
|
1540
|
+
onAfterRouteLeave: S
|
|
1541
|
+
} = sr();
|
|
1542
|
+
async function B(w, L = {}) {
|
|
1543
|
+
const I = o();
|
|
1544
|
+
if (i.stopListening(), Ce(w)) {
|
|
1545
|
+
i.update(w, L);
|
|
1517
1546
|
return;
|
|
1518
1547
|
}
|
|
1519
|
-
const
|
|
1548
|
+
const V = Ne(r, w, L.state) ?? d("NotFound"), me = { ...b }, F = await u({ to: V, from: me, hooks: h });
|
|
1520
1549
|
switch (F.status) {
|
|
1521
|
-
// On abort do nothing
|
|
1522
1550
|
case "ABORT":
|
|
1523
1551
|
return;
|
|
1524
|
-
// On push update the history, and push new route, and return
|
|
1525
1552
|
case "PUSH":
|
|
1526
|
-
|
|
1553
|
+
i.update(w, L), await g(...F.to);
|
|
1527
1554
|
return;
|
|
1528
|
-
// On reject update the history, the route, and set the rejection type
|
|
1529
1555
|
case "REJECT":
|
|
1530
|
-
|
|
1556
|
+
i.update(w, L), m(F.type);
|
|
1531
1557
|
break;
|
|
1532
|
-
// On success update history, set the route, and clear the rejection
|
|
1533
1558
|
case "SUCCESS":
|
|
1534
|
-
|
|
1559
|
+
i.update(w, L), m(null);
|
|
1535
1560
|
break;
|
|
1536
1561
|
default:
|
|
1537
1562
|
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(F)}`);
|
|
1538
1563
|
}
|
|
1539
|
-
const
|
|
1540
|
-
a.setProps(
|
|
1541
|
-
if (
|
|
1542
|
-
switch (
|
|
1564
|
+
const D = I;
|
|
1565
|
+
a.setProps(V).then(($) => {
|
|
1566
|
+
if (D === I)
|
|
1567
|
+
switch ($.status) {
|
|
1543
1568
|
case "SUCCESS":
|
|
1544
1569
|
break;
|
|
1545
1570
|
case "PUSH":
|
|
1546
|
-
|
|
1571
|
+
g(...$.to);
|
|
1547
1572
|
break;
|
|
1548
1573
|
case "REJECT":
|
|
1549
|
-
|
|
1574
|
+
m($.type);
|
|
1550
1575
|
break;
|
|
1551
1576
|
default:
|
|
1552
|
-
const
|
|
1553
|
-
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(
|
|
1577
|
+
const ae = $;
|
|
1578
|
+
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(ae)}`);
|
|
1554
1579
|
}
|
|
1555
|
-
}),
|
|
1556
|
-
const J = await
|
|
1580
|
+
}), C(V);
|
|
1581
|
+
const J = await f({ to: V, from: me, hooks: h });
|
|
1557
1582
|
switch (J.status) {
|
|
1558
1583
|
case "PUSH":
|
|
1559
|
-
await
|
|
1584
|
+
await g(...J.to);
|
|
1560
1585
|
break;
|
|
1561
1586
|
case "REJECT":
|
|
1562
|
-
|
|
1587
|
+
m(J.type);
|
|
1563
1588
|
break;
|
|
1564
1589
|
case "SUCCESS":
|
|
1565
1590
|
break;
|
|
1566
1591
|
default:
|
|
1567
|
-
const
|
|
1568
|
-
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(
|
|
1592
|
+
const $ = J;
|
|
1593
|
+
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify($)}`);
|
|
1569
1594
|
}
|
|
1570
|
-
|
|
1595
|
+
i.startListening();
|
|
1571
1596
|
}
|
|
1572
|
-
const
|
|
1573
|
-
if (
|
|
1574
|
-
const
|
|
1575
|
-
return
|
|
1597
|
+
const g = (w, L, I) => {
|
|
1598
|
+
if (M(w)) {
|
|
1599
|
+
const $ = { ...L }, ae = c(w, $);
|
|
1600
|
+
return B(ae, $);
|
|
1576
1601
|
}
|
|
1577
|
-
const
|
|
1578
|
-
return
|
|
1579
|
-
},
|
|
1580
|
-
if (
|
|
1581
|
-
const
|
|
1582
|
-
return
|
|
1602
|
+
const V = { ...I }, F = c(w, L ?? {}, V), D = rt(w), J = lt((D == null ? void 0 : D.state) ?? {}, V.state);
|
|
1603
|
+
return B(F, { ...V, state: J });
|
|
1604
|
+
}, P = (w, L, I) => {
|
|
1605
|
+
if (M(w)) {
|
|
1606
|
+
const $ = { ...L, replace: !0 }, ae = c(w, $);
|
|
1607
|
+
return B(ae, $);
|
|
1583
1608
|
}
|
|
1584
|
-
const
|
|
1585
|
-
return
|
|
1586
|
-
},
|
|
1587
|
-
|
|
1588
|
-
},
|
|
1589
|
-
if (!
|
|
1590
|
-
const
|
|
1591
|
-
return
|
|
1609
|
+
const V = { ...I, replace: !0 }, F = c(w, L ?? {}, V), D = rt(w), J = lt((D == null ? void 0 : D.state) ?? {}, V.state);
|
|
1610
|
+
return B(F, { ...V, state: J });
|
|
1611
|
+
}, A = (w) => {
|
|
1612
|
+
m(w);
|
|
1613
|
+
}, x = (w, L = {}) => {
|
|
1614
|
+
if (!M(w)) {
|
|
1615
|
+
const I = c(w, L);
|
|
1616
|
+
return Ne(r, I);
|
|
1592
1617
|
}
|
|
1593
|
-
if (!
|
|
1594
|
-
return
|
|
1595
|
-
}, { setRejection:
|
|
1596
|
-
|
|
1597
|
-
const
|
|
1598
|
-
let
|
|
1599
|
-
async function
|
|
1600
|
-
|
|
1601
|
-
}
|
|
1602
|
-
function
|
|
1603
|
-
return r.find((
|
|
1604
|
-
}
|
|
1605
|
-
function
|
|
1606
|
-
|
|
1607
|
-
}
|
|
1608
|
-
const
|
|
1609
|
-
route:
|
|
1610
|
-
resolve:
|
|
1611
|
-
push:
|
|
1612
|
-
replace:
|
|
1613
|
-
reject:
|
|
1614
|
-
find:
|
|
1615
|
-
refresh:
|
|
1616
|
-
forward:
|
|
1617
|
-
back:
|
|
1618
|
-
go:
|
|
1619
|
-
install:
|
|
1620
|
-
isExternal:
|
|
1621
|
-
onBeforeRouteEnter:
|
|
1622
|
-
onAfterRouteUpdate:
|
|
1623
|
-
onBeforeRouteLeave:
|
|
1624
|
-
onAfterRouteEnter:
|
|
1625
|
-
onBeforeRouteUpdate:
|
|
1626
|
-
onAfterRouteLeave:
|
|
1618
|
+
if (!Ce(w))
|
|
1619
|
+
return Ne(r, w);
|
|
1620
|
+
}, { setRejection: m, rejection: l, getRejectionRoute: d } = ur(t ?? {}), E = d("NotFound"), { currentRoute: b, routerRoute: U, updateRoute: C } = Kn(E, g);
|
|
1621
|
+
i.startListening();
|
|
1622
|
+
const j = kr(t == null ? void 0 : t.initialUrl), q = i.location.state, { host: et } = T(j), Ce = Xn(et);
|
|
1623
|
+
let tt = !1;
|
|
1624
|
+
async function nt() {
|
|
1625
|
+
tt || (await B(j, { replace: !0, state: q }), tt = !0);
|
|
1626
|
+
}
|
|
1627
|
+
function rt(w) {
|
|
1628
|
+
return r.find((L) => L.name === w);
|
|
1629
|
+
}
|
|
1630
|
+
function an(w) {
|
|
1631
|
+
w.component("RouterView", oo), w.component("RouterLink", ro), w.provide(Bt, l), w.provide(Vt, h), w.provide(en, a), w.provide(Qt, s), w.provide(Lt, ot), nt();
|
|
1632
|
+
}
|
|
1633
|
+
const ot = {
|
|
1634
|
+
route: U,
|
|
1635
|
+
resolve: c,
|
|
1636
|
+
push: g,
|
|
1637
|
+
replace: P,
|
|
1638
|
+
reject: A,
|
|
1639
|
+
find: x,
|
|
1640
|
+
refresh: i.refresh,
|
|
1641
|
+
forward: i.forward,
|
|
1642
|
+
back: i.back,
|
|
1643
|
+
go: i.go,
|
|
1644
|
+
install: an,
|
|
1645
|
+
isExternal: Ce,
|
|
1646
|
+
onBeforeRouteEnter: v,
|
|
1647
|
+
onAfterRouteUpdate: p,
|
|
1648
|
+
onBeforeRouteLeave: k,
|
|
1649
|
+
onAfterRouteEnter: R,
|
|
1650
|
+
onBeforeRouteUpdate: y,
|
|
1651
|
+
onAfterRouteLeave: S,
|
|
1627
1652
|
prefetch: t == null ? void 0 : t.prefetch,
|
|
1628
|
-
start:
|
|
1653
|
+
start: nt
|
|
1629
1654
|
};
|
|
1630
|
-
return
|
|
1655
|
+
return ot;
|
|
1631
1656
|
}
|
|
1632
|
-
function
|
|
1657
|
+
function ht(e, t) {
|
|
1633
1658
|
return {
|
|
1634
1659
|
value: e,
|
|
1635
|
-
params:
|
|
1660
|
+
params: Ke(e, t)
|
|
1636
1661
|
};
|
|
1637
1662
|
}
|
|
1638
|
-
function
|
|
1663
|
+
function Gt(e, t) {
|
|
1639
1664
|
return {
|
|
1640
1665
|
value: e,
|
|
1641
|
-
params:
|
|
1666
|
+
params: Ke(e, t)
|
|
1642
1667
|
};
|
|
1643
1668
|
}
|
|
1644
|
-
function
|
|
1645
|
-
return
|
|
1669
|
+
function Dr(e) {
|
|
1670
|
+
return pe(e) && typeof e.hash == "string";
|
|
1646
1671
|
}
|
|
1647
|
-
function
|
|
1648
|
-
return e === void 0 ?
|
|
1672
|
+
function Kt(e) {
|
|
1673
|
+
return e === void 0 ? Re() : Dr(e) ? e : Re(e);
|
|
1649
1674
|
}
|
|
1650
|
-
function
|
|
1675
|
+
function ze(e) {
|
|
1651
1676
|
return e === void 0 ? "" : e;
|
|
1652
1677
|
}
|
|
1653
|
-
function
|
|
1654
|
-
return
|
|
1678
|
+
function Wr(e) {
|
|
1679
|
+
return pe(e) && typeof e.value == "string";
|
|
1655
1680
|
}
|
|
1656
|
-
function
|
|
1657
|
-
return e === void 0 ?
|
|
1681
|
+
function zt(e) {
|
|
1682
|
+
return e === void 0 ? Oe("", {}) : Wr(e) ? e : Oe(e, {});
|
|
1658
1683
|
}
|
|
1659
|
-
function
|
|
1660
|
-
return
|
|
1684
|
+
function Ir(e) {
|
|
1685
|
+
return pe(e) && typeof e.value == "string";
|
|
1661
1686
|
}
|
|
1662
|
-
function
|
|
1663
|
-
return e === void 0 ?
|
|
1687
|
+
function Yt(e) {
|
|
1688
|
+
return e === void 0 ? ht("", {}) : Ir(e) ? e : ht(e, {});
|
|
1664
1689
|
}
|
|
1665
1690
|
function ne(e) {
|
|
1666
|
-
const t =
|
|
1691
|
+
const t = Je(), n = ze(e.name), r = zt(e.path), o = Yt(e.query), a = Kt(e.hash), s = e.meta ?? {}, c = jn(e) ? e.state : {}, i = ye({ id: t, meta: {}, state: {}, ...e }), u = {
|
|
1667
1692
|
id: t,
|
|
1668
1693
|
matched: i,
|
|
1669
1694
|
matches: [i],
|
|
@@ -1672,112 +1697,122 @@ function ne(e) {
|
|
|
1672
1697
|
query: o,
|
|
1673
1698
|
hash: a,
|
|
1674
1699
|
meta: s,
|
|
1675
|
-
state:
|
|
1700
|
+
state: c,
|
|
1676
1701
|
depth: 1,
|
|
1677
|
-
host:
|
|
1702
|
+
host: Gt("", {}),
|
|
1678
1703
|
prefetch: e.prefetch
|
|
1679
|
-
}, f =
|
|
1680
|
-
return
|
|
1704
|
+
}, f = Pt(e) ? Et(e.parent, u) : u;
|
|
1705
|
+
return oe(f.path.params, f.query.params), f;
|
|
1681
1706
|
}
|
|
1682
|
-
const
|
|
1707
|
+
const xe = { template: "<div>This is component</div>" }, Ye = ne({
|
|
1683
1708
|
name: "parentA",
|
|
1684
1709
|
path: "/parentA/[paramA]"
|
|
1685
|
-
}),
|
|
1686
|
-
parent:
|
|
1710
|
+
}), Xt = ne({
|
|
1711
|
+
parent: Ye,
|
|
1687
1712
|
name: "parentA.childA",
|
|
1688
1713
|
path: "/[?paramB]"
|
|
1689
|
-
}),
|
|
1690
|
-
parent:
|
|
1714
|
+
}), Fr = ne({
|
|
1715
|
+
parent: Ye,
|
|
1691
1716
|
name: "parentA.childB",
|
|
1692
1717
|
path: "/[paramD]",
|
|
1693
|
-
component:
|
|
1694
|
-
}),
|
|
1695
|
-
parent:
|
|
1718
|
+
component: xe
|
|
1719
|
+
}), Jr = ne({
|
|
1720
|
+
parent: Xt,
|
|
1696
1721
|
name: "parentA.childA.grandChildA",
|
|
1697
1722
|
path: "/[paramC]",
|
|
1698
|
-
component:
|
|
1723
|
+
component: xe
|
|
1699
1724
|
});
|
|
1700
1725
|
ne({
|
|
1701
1726
|
name: "parentB",
|
|
1702
1727
|
path: "/parentB",
|
|
1703
|
-
component:
|
|
1728
|
+
component: xe
|
|
1704
1729
|
}), ne({
|
|
1705
1730
|
name: "parentC",
|
|
1706
1731
|
path: "/",
|
|
1707
|
-
component:
|
|
1732
|
+
component: xe
|
|
1708
1733
|
});
|
|
1709
|
-
const
|
|
1734
|
+
const Qr = "eager", Gr = {
|
|
1710
1735
|
components: !0,
|
|
1711
1736
|
props: !1
|
|
1712
1737
|
};
|
|
1713
|
-
function
|
|
1714
|
-
return
|
|
1715
|
-
}
|
|
1716
|
-
function
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1738
|
+
function ge(e) {
|
|
1739
|
+
return ["eager", "lazy"].includes(e);
|
|
1740
|
+
}
|
|
1741
|
+
function Zt({ routerPrefetch: e, routePrefetch: t, linkPrefetch: n }, r) {
|
|
1742
|
+
const o = He(n, r), a = He(t, r), s = He(e, r), c = [
|
|
1743
|
+
o,
|
|
1744
|
+
a,
|
|
1745
|
+
s,
|
|
1746
|
+
Gr[r],
|
|
1747
|
+
Qr
|
|
1748
|
+
].reduce((i, u) => ge(i) ? i : i === !0 && ge(u) ? u : i === !0 && !ge(u) ? i : i === void 0 ? u : i, void 0);
|
|
1749
|
+
return ge(c) ? c : !1;
|
|
1750
|
+
}
|
|
1751
|
+
function He(e, t) {
|
|
1752
|
+
return pe(e) ? e[t] : e;
|
|
1753
|
+
}
|
|
1754
|
+
function pt(e) {
|
|
1720
1755
|
try {
|
|
1721
1756
|
const t = e();
|
|
1722
|
-
return
|
|
1757
|
+
return bt(t) ? t.catch((n) => n) : t;
|
|
1723
1758
|
} catch (t) {
|
|
1724
1759
|
return t;
|
|
1725
1760
|
}
|
|
1726
1761
|
}
|
|
1727
|
-
const
|
|
1728
|
-
function
|
|
1729
|
-
const e =
|
|
1730
|
-
if (!
|
|
1731
|
-
return
|
|
1732
|
-
const
|
|
1733
|
-
return
|
|
1734
|
-
}, {}), r = (
|
|
1735
|
-
Object.entries(
|
|
1762
|
+
const en = Symbol();
|
|
1763
|
+
function Kr() {
|
|
1764
|
+
const e = Ue(/* @__PURE__ */ new Map()), t = jt(), n = (u, f, h) => f.matches.filter((v) => Zt({ ...h, routePrefetch: v.prefetch }, "props") === u).flatMap((v) => c(v)).reduce((v, { id: p, name: k, props: R }) => {
|
|
1765
|
+
if (!R)
|
|
1766
|
+
return v;
|
|
1767
|
+
const y = s(p, k, f), S = pt(() => R(f, t));
|
|
1768
|
+
return v[y] = S, v;
|
|
1769
|
+
}, {}), r = (u) => {
|
|
1770
|
+
Object.entries(u).forEach(([f, h]) => {
|
|
1736
1771
|
e.set(f, h);
|
|
1737
1772
|
});
|
|
1738
|
-
}, o = async (
|
|
1739
|
-
const f =
|
|
1740
|
-
for (const { id: p, name: k, props:
|
|
1741
|
-
if (!
|
|
1773
|
+
}, o = async (u) => {
|
|
1774
|
+
const f = u.matches.flatMap(c), h = [], v = [];
|
|
1775
|
+
for (const { id: p, name: k, props: R } of f) {
|
|
1776
|
+
if (!R)
|
|
1742
1777
|
continue;
|
|
1743
|
-
const y = s(p, k,
|
|
1778
|
+
const y = s(p, k, u);
|
|
1744
1779
|
if (h.push(y), !e.has(y)) {
|
|
1745
|
-
const
|
|
1746
|
-
e.set(y,
|
|
1780
|
+
const S = pt(() => R(u, t));
|
|
1781
|
+
e.set(y, S);
|
|
1747
1782
|
}
|
|
1748
|
-
|
|
1749
|
-
const
|
|
1750
|
-
if (
|
|
1751
|
-
throw
|
|
1783
|
+
v.push((async () => {
|
|
1784
|
+
const S = await e.get(y);
|
|
1785
|
+
if (S instanceof Error)
|
|
1786
|
+
throw S;
|
|
1752
1787
|
})());
|
|
1753
1788
|
}
|
|
1754
1789
|
i(h);
|
|
1755
1790
|
try {
|
|
1756
|
-
return await Promise.all(
|
|
1791
|
+
return await Promise.all(v), { status: "SUCCESS" };
|
|
1757
1792
|
} catch (p) {
|
|
1758
|
-
if (p instanceof X || p instanceof
|
|
1793
|
+
if (p instanceof X || p instanceof Se)
|
|
1759
1794
|
return p.response;
|
|
1760
1795
|
throw p;
|
|
1761
1796
|
}
|
|
1762
|
-
}, a = (
|
|
1763
|
-
const
|
|
1764
|
-
return e.get(
|
|
1797
|
+
}, a = (u, f, h) => {
|
|
1798
|
+
const v = s(u, f, h);
|
|
1799
|
+
return e.get(v);
|
|
1765
1800
|
};
|
|
1766
|
-
function s(
|
|
1767
|
-
return [
|
|
1801
|
+
function s(u, f, h) {
|
|
1802
|
+
return [u, f, h.id, JSON.stringify(h.params)].join("-");
|
|
1768
1803
|
}
|
|
1769
|
-
function u
|
|
1770
|
-
return
|
|
1804
|
+
function c(u) {
|
|
1805
|
+
return Me(u) ? Object.entries(u.props ?? {}).map(([f, h]) => ({ id: u.id, name: f, props: h })) : _e(u) ? [
|
|
1771
1806
|
{
|
|
1772
|
-
id:
|
|
1807
|
+
id: u.id,
|
|
1773
1808
|
name: "default",
|
|
1774
|
-
props:
|
|
1809
|
+
props: u.props
|
|
1775
1810
|
}
|
|
1776
1811
|
] : [];
|
|
1777
1812
|
}
|
|
1778
|
-
function i(
|
|
1813
|
+
function i(u) {
|
|
1779
1814
|
for (const f in e.keys())
|
|
1780
|
-
|
|
1815
|
+
u.includes(f) || e.delete(f);
|
|
1781
1816
|
}
|
|
1782
1817
|
return {
|
|
1783
1818
|
getPrefetchProps: n,
|
|
@@ -1786,214 +1821,232 @@ function Wr() {
|
|
|
1786
1821
|
setProps: o
|
|
1787
1822
|
};
|
|
1788
1823
|
}
|
|
1789
|
-
function
|
|
1790
|
-
const e =
|
|
1824
|
+
function tn() {
|
|
1825
|
+
const e = re(en);
|
|
1791
1826
|
if (!e)
|
|
1792
|
-
throw new
|
|
1827
|
+
throw new he();
|
|
1793
1828
|
return e;
|
|
1794
1829
|
}
|
|
1795
|
-
const
|
|
1830
|
+
const zr = fn(() => new Promise((e) => {
|
|
1796
1831
|
e({ default: { template: "foo" } });
|
|
1797
1832
|
}));
|
|
1798
|
-
function
|
|
1799
|
-
return e.name ===
|
|
1833
|
+
function dt(e) {
|
|
1834
|
+
return e.name === zr.name && "setup" in e;
|
|
1800
1835
|
}
|
|
1801
|
-
function
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1836
|
+
function Yr(e) {
|
|
1837
|
+
const t = /* @__PURE__ */ new Map(), n = qe(), { getPrefetchProps: r, setPrefetchProps: o } = tn(), { observe: a, unobserve: s, isElementVisible: c } = Tr(), i = () => {
|
|
1838
|
+
const f = Array.from(t.values()).reduce((h, v) => (Object.assign(h, v), h), {});
|
|
1839
|
+
o(f);
|
|
1840
|
+
};
|
|
1841
|
+
ln(() => {
|
|
1842
|
+
if (!n.value) {
|
|
1843
|
+
console.warn("The usePrefetching composition will not work correctly if the element ref is not bound.");
|
|
1844
|
+
return;
|
|
1809
1845
|
}
|
|
1846
|
+
a(n.value);
|
|
1847
|
+
}), hn(() => {
|
|
1848
|
+
n.value && s(n.value);
|
|
1849
|
+
}), je(() => se(e), ({ route: f, ...h }) => {
|
|
1850
|
+
t.clear(), f && u("eager", f, h);
|
|
1851
|
+
}, { immediate: !0 }), je(() => !!(n.value && c(n.value)), (f) => {
|
|
1852
|
+
const { route: h, ...v } = se(e);
|
|
1853
|
+
!h || !f || u("lazy", h, v);
|
|
1854
|
+
}, { immediate: !0 });
|
|
1855
|
+
function u(f, h, v) {
|
|
1856
|
+
Xr(f, h, v), t.has(f) || t.set(f, r(f, h, v));
|
|
1857
|
+
}
|
|
1858
|
+
return {
|
|
1859
|
+
element: n,
|
|
1860
|
+
commit: i
|
|
1810
1861
|
};
|
|
1811
1862
|
}
|
|
1812
|
-
function
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
it(a) && a.setup();
|
|
1863
|
+
function Xr(e, t, n) {
|
|
1864
|
+
t.matches.forEach((r) => {
|
|
1865
|
+
Zt({
|
|
1866
|
+
...n,
|
|
1867
|
+
routePrefetch: r.prefetch
|
|
1868
|
+
}, "components") === e && (_e(r) && dt(r.component) && r.component.setup(), Me(r) && Object.values(r.components).forEach((a) => {
|
|
1869
|
+
dt(a) && a.setup();
|
|
1820
1870
|
}));
|
|
1821
1871
|
});
|
|
1822
1872
|
}
|
|
1823
|
-
function
|
|
1824
|
-
const r =
|
|
1825
|
-
if (
|
|
1873
|
+
function Zr(e, t = {}, n = {}) {
|
|
1874
|
+
const r = De(), o = pn(e), a = N(() => M(o.value) ? {} : se(t)), s = N(() => M(o.value) ? se(t) : se(n)), c = N(() => {
|
|
1875
|
+
if (M(o.value))
|
|
1826
1876
|
return o.value;
|
|
1827
1877
|
try {
|
|
1828
1878
|
return r.resolve(o.value, a.value, s.value);
|
|
1829
|
-
} catch (
|
|
1830
|
-
throw
|
|
1879
|
+
} catch (y) {
|
|
1880
|
+
throw y instanceof Z && console.error(`Failed to resolve route "${o.value.toString()}" in RouterLink.`, y), y;
|
|
1831
1881
|
}
|
|
1832
|
-
}), i = N(() => r.find(
|
|
1882
|
+
}), i = N(() => r.find(c.value, s.value)), u = N(() => !!i.value && r.route.matches.includes(i.value.matched)), f = N(() => !!i.value && r.route.matched === i.value.matched), h = N(() => r.isExternal(c.value)), { element: v, commit: p } = Yr(() => ({
|
|
1833
1883
|
route: i.value,
|
|
1834
1884
|
routerPrefetch: r.prefetch,
|
|
1835
1885
|
linkPrefetch: s.value.prefetch
|
|
1836
|
-
})),
|
|
1886
|
+
})), k = (y) => (p(), r.push(c.value, { ...s.value, ...y }));
|
|
1837
1887
|
return {
|
|
1888
|
+
element: v,
|
|
1838
1889
|
route: i,
|
|
1839
|
-
href:
|
|
1840
|
-
isMatch:
|
|
1890
|
+
href: c,
|
|
1891
|
+
isMatch: u,
|
|
1841
1892
|
isExactMatch: f,
|
|
1842
1893
|
isExternal: h,
|
|
1843
|
-
push:
|
|
1844
|
-
replace: (
|
|
1894
|
+
push: k,
|
|
1895
|
+
replace: (y) => k(y)
|
|
1845
1896
|
};
|
|
1846
1897
|
}
|
|
1847
|
-
function
|
|
1848
|
-
if (!
|
|
1898
|
+
function eo(e, t, { exact: n } = {}) {
|
|
1899
|
+
if (!Qn(e))
|
|
1849
1900
|
return !1;
|
|
1850
1901
|
if (t === void 0)
|
|
1851
1902
|
return !0;
|
|
1852
|
-
const r = e.matches.map((o) =>
|
|
1903
|
+
const r = e.matches.map((o) => ze(o.name));
|
|
1853
1904
|
if (n) {
|
|
1854
1905
|
const o = r.at(-1);
|
|
1855
1906
|
return t === o;
|
|
1856
1907
|
}
|
|
1857
1908
|
return r.includes(t);
|
|
1858
1909
|
}
|
|
1859
|
-
function
|
|
1860
|
-
const n =
|
|
1910
|
+
function to(e, t) {
|
|
1911
|
+
const n = De();
|
|
1861
1912
|
function r() {
|
|
1862
1913
|
if (!e)
|
|
1863
1914
|
return;
|
|
1864
|
-
if (!
|
|
1865
|
-
throw new
|
|
1915
|
+
if (!eo(n.route, e, t))
|
|
1916
|
+
throw new Fn(e, n.route.name);
|
|
1866
1917
|
}
|
|
1867
|
-
return
|
|
1918
|
+
return je(n.route, r, { immediate: !0, deep: !0 }), n.route;
|
|
1868
1919
|
}
|
|
1869
|
-
const
|
|
1870
|
-
function
|
|
1871
|
-
return
|
|
1920
|
+
const nn = Symbol();
|
|
1921
|
+
function Xe() {
|
|
1922
|
+
return re(nn, 0);
|
|
1872
1923
|
}
|
|
1873
|
-
function
|
|
1874
|
-
const e =
|
|
1924
|
+
function rn() {
|
|
1925
|
+
const e = re(Vt);
|
|
1875
1926
|
if (!e)
|
|
1876
|
-
throw new
|
|
1927
|
+
throw new he();
|
|
1877
1928
|
return e;
|
|
1878
1929
|
}
|
|
1879
|
-
function
|
|
1930
|
+
function on(e) {
|
|
1880
1931
|
return (t) => {
|
|
1881
|
-
const n =
|
|
1882
|
-
return
|
|
1932
|
+
const n = Xe(), o = rn().addBeforeRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
|
|
1933
|
+
return gt(o), o;
|
|
1883
1934
|
};
|
|
1884
1935
|
}
|
|
1885
|
-
function
|
|
1936
|
+
function Ze(e) {
|
|
1886
1937
|
return (t) => {
|
|
1887
|
-
const n =
|
|
1888
|
-
return
|
|
1938
|
+
const n = Xe(), o = rn().addAfterRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
|
|
1939
|
+
return gt(o), o;
|
|
1889
1940
|
};
|
|
1890
1941
|
}
|
|
1891
|
-
const
|
|
1942
|
+
const fo = on("onBeforeRouteUpdate"), lo = on("onBeforeRouteLeave"), ho = Ze("onAfterRouteEnter"), po = Ze("onAfterRouteUpdate"), mo = Ze("onAfterRouteLeave"), no = ["href"], ro = /* @__PURE__ */ le({
|
|
1892
1943
|
__name: "routerLink",
|
|
1893
1944
|
props: {
|
|
1894
1945
|
to: {},
|
|
1895
|
-
prefetch: { type: [Boolean, Object], default: void 0 },
|
|
1946
|
+
prefetch: { type: [Boolean, String, Object], default: void 0 },
|
|
1896
1947
|
query: {},
|
|
1897
1948
|
hash: {},
|
|
1898
1949
|
replace: { type: Boolean },
|
|
1899
1950
|
state: {}
|
|
1900
1951
|
},
|
|
1901
1952
|
setup(e) {
|
|
1902
|
-
const t = e, n =
|
|
1903
|
-
const { to:
|
|
1904
|
-
return
|
|
1905
|
-
}), {
|
|
1906
|
-
"router-link--match":
|
|
1907
|
-
"router-link--exact-match":
|
|
1953
|
+
const t = e, n = De(), r = N(() => M(t.to) ? t.to : t.to(n.resolve)), o = N(() => {
|
|
1954
|
+
const { to: v, ...p } = t;
|
|
1955
|
+
return p;
|
|
1956
|
+
}), { element: a, isMatch: s, isExactMatch: c, isExternal: i, push: u } = Zr(r, o), f = N(() => ({
|
|
1957
|
+
"router-link--match": s.value,
|
|
1958
|
+
"router-link--exact-match": c.value
|
|
1908
1959
|
}));
|
|
1909
|
-
function
|
|
1910
|
-
|
|
1960
|
+
function h(v) {
|
|
1961
|
+
v.preventDefault(), u();
|
|
1911
1962
|
}
|
|
1912
|
-
return (
|
|
1963
|
+
return (v, p) => (vt(), dn("a", {
|
|
1964
|
+
ref_key: "element",
|
|
1965
|
+
ref: a,
|
|
1913
1966
|
href: r.value,
|
|
1914
|
-
class:
|
|
1915
|
-
onClick:
|
|
1967
|
+
class: mn(["router-link", f.value]),
|
|
1968
|
+
onClick: h
|
|
1916
1969
|
}, [
|
|
1917
|
-
|
|
1918
|
-
], 10,
|
|
1970
|
+
yt(v.$slots, "default", Rt(gn({ resolved: r.value, isMatch: ce(s), isExactMatch: ce(c), isExternal: ce(i) })))
|
|
1971
|
+
], 10, no));
|
|
1919
1972
|
}
|
|
1920
|
-
}),
|
|
1973
|
+
}), oo = /* @__PURE__ */ le({
|
|
1921
1974
|
__name: "routerView",
|
|
1922
1975
|
props: {
|
|
1923
1976
|
name: { default: "default" }
|
|
1924
1977
|
},
|
|
1925
1978
|
setup(e) {
|
|
1926
|
-
const t =
|
|
1927
|
-
|
|
1979
|
+
const t = to(), n = Jn(), r = Xe(), { getProps: o } = tn(), a = vn("RouterView", !0);
|
|
1980
|
+
yn(nn, r + 1);
|
|
1928
1981
|
const s = N(() => {
|
|
1929
1982
|
if (n.value)
|
|
1930
1983
|
return n.value.component;
|
|
1931
|
-
const
|
|
1932
|
-
if (!
|
|
1984
|
+
const u = t.matches.at(r);
|
|
1985
|
+
if (!u)
|
|
1933
1986
|
return null;
|
|
1934
|
-
const f = u
|
|
1935
|
-
return f ? h ?
|
|
1987
|
+
const f = c(u), h = o(u.id, e.name, t);
|
|
1988
|
+
return f ? h ? Vn(f, () => h) : f : null;
|
|
1936
1989
|
});
|
|
1937
|
-
function u
|
|
1938
|
-
return i(
|
|
1990
|
+
function c(u) {
|
|
1991
|
+
return i(u)[e.name];
|
|
1939
1992
|
}
|
|
1940
|
-
function i(
|
|
1941
|
-
return
|
|
1993
|
+
function i(u) {
|
|
1994
|
+
return Me(u) ? u.components : _e(u) ? { default: u.component } : typeof a == "string" ? {} : { default: a };
|
|
1942
1995
|
}
|
|
1943
|
-
return (
|
|
1944
|
-
(
|
|
1945
|
-
]) :
|
|
1996
|
+
return (u, f) => s.value ? yt(u.$slots, "default", Rt(Rn({ key: 0 }, { route: ce(t), component: s.value, rejection: ce(n) })), () => [
|
|
1997
|
+
(vt(), wn(Pn(s.value)))
|
|
1998
|
+
]) : En("", !0);
|
|
1946
1999
|
}
|
|
1947
2000
|
});
|
|
1948
|
-
function
|
|
1949
|
-
return
|
|
2001
|
+
function ao(e) {
|
|
2002
|
+
return pe(e) && typeof e.value == "string";
|
|
1950
2003
|
}
|
|
1951
|
-
function
|
|
1952
|
-
return
|
|
2004
|
+
function mt(e) {
|
|
2005
|
+
return ao(e) ? e : Gt(e, {});
|
|
1953
2006
|
}
|
|
1954
|
-
function
|
|
1955
|
-
const t =
|
|
2007
|
+
function go(e) {
|
|
2008
|
+
const t = Je(), n = ze(e.name), r = zt(e.path), o = Yt(e.query), a = Kt(e.hash), s = e.meta ?? {}, c = Hn(e) ? mt(e.host) : mt(""), i = ye({ id: t, meta: {}, state: {}, ...e }), u = {
|
|
1956
2009
|
id: t,
|
|
1957
2010
|
matched: i,
|
|
1958
2011
|
matches: [i],
|
|
1959
2012
|
name: n,
|
|
1960
|
-
host:
|
|
2013
|
+
host: c,
|
|
1961
2014
|
path: r,
|
|
1962
2015
|
query: o,
|
|
1963
2016
|
hash: a,
|
|
1964
2017
|
meta: s,
|
|
1965
2018
|
depth: 1,
|
|
1966
2019
|
state: {}
|
|
1967
|
-
}, f =
|
|
1968
|
-
return
|
|
2020
|
+
}, f = Pt(e) ? Et(e.parent, u) : u;
|
|
2021
|
+
return oe(f.path.params, f.query.params, f.host.params), f;
|
|
1969
2022
|
}
|
|
1970
2023
|
export {
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
2024
|
+
Un as DuplicateParamsError,
|
|
2025
|
+
ro as RouterLink,
|
|
2026
|
+
he as RouterNotInstalledError,
|
|
2027
|
+
oo as RouterView,
|
|
2028
|
+
Fn as UseRouteInvalidError,
|
|
2029
|
+
rr as asUrl,
|
|
2030
|
+
Vn as component,
|
|
2031
|
+
go as createExternalRoute,
|
|
2032
|
+
Dn as createParam,
|
|
1980
2033
|
ne as createRoute,
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
2034
|
+
io as createRouter,
|
|
2035
|
+
_n as isParamWithDefault,
|
|
2036
|
+
eo as isRoute,
|
|
2037
|
+
M as isUrl,
|
|
2038
|
+
ho as onAfterRouteEnter,
|
|
2039
|
+
po as onAfterRouteLeave,
|
|
2040
|
+
mo as onAfterRouteUpdate,
|
|
2041
|
+
fo as onBeforeRouteLeave,
|
|
2042
|
+
lo as onBeforeRouteUpdate,
|
|
2043
|
+
Oe as path,
|
|
2044
|
+
ht as query,
|
|
2045
|
+
Lt as routerInjectionKey,
|
|
2046
|
+
Bt as routerRejectionKey,
|
|
2047
|
+
Zr as useLink,
|
|
2048
|
+
Jn as useRejection,
|
|
2049
|
+
to as useRoute,
|
|
2050
|
+
De as useRouter,
|
|
2051
|
+
uo as withDefault
|
|
1999
2052
|
};
|