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