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