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