@kitbag/router 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/kitbag-router.d.ts +44 -19
- package/dist/kitbag-router.js +523 -503
- package/dist/kitbag-router.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/kitbag-router.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var we = (t, e, n) => e in t ?
|
|
3
|
-
var
|
|
4
|
-
import { inject as st, computed as
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var we = (t, e, n) => e in t ? ve(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var $ = (t, e, n) => (we(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { inject as st, computed as H, toValue as lt, readonly as ct, watch as Ee, onUnmounted as Ot, defineComponent as it, openBlock as _t, createElementBlock as be, normalizeClass as Pe, renderSlot as qt, normalizeProps as Dt, guardReactiveProps as Mt, unref as Z, provide as Se, defineAsyncComponent as ke, createBlock as xe, resolveDynamicComponent as Ae, h as Tt, reactive as Le, ref as Ue, markRaw as pt } from "vue";
|
|
5
5
|
class ut extends Error {
|
|
6
6
|
/**
|
|
7
7
|
* Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
|
|
@@ -11,7 +11,7 @@ class ut extends Error {
|
|
|
11
11
|
super(`Invalid Param "${e}": Router does not support multiple params by the same name. All param names must be unique.`);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
class
|
|
14
|
+
class mt extends Error {
|
|
15
15
|
constructor() {
|
|
16
16
|
super("Router not installed");
|
|
17
17
|
}
|
|
@@ -27,45 +27,45 @@ class Be extends Error {
|
|
|
27
27
|
super(`useRoute called with incorrect route. Given ${e}, expected ${n}`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
function
|
|
32
|
-
const t = st(
|
|
30
|
+
const Wt = Symbol();
|
|
31
|
+
function Rt() {
|
|
32
|
+
const t = st(Wt);
|
|
33
33
|
if (!t)
|
|
34
|
-
throw new
|
|
34
|
+
throw new mt();
|
|
35
35
|
return t;
|
|
36
36
|
}
|
|
37
|
-
class
|
|
37
|
+
class F extends Error {
|
|
38
38
|
}
|
|
39
39
|
function I(t) {
|
|
40
40
|
return typeof t != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(t);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const r =
|
|
42
|
+
function He(t, e = {}, n = {}) {
|
|
43
|
+
const r = Rt(), o = H(() => lt(t)), a = H(() => lt(e)), s = H(() => lt(n)), c = H(() => {
|
|
44
44
|
if (I(o.value))
|
|
45
45
|
return o.value;
|
|
46
46
|
try {
|
|
47
47
|
return r.resolve(o.value, a.value, s.value);
|
|
48
|
-
} catch (
|
|
49
|
-
throw
|
|
48
|
+
} catch (d) {
|
|
49
|
+
throw d instanceof F && console.error(`Failed to resolve route "${o.value.toString()}" in RouterLink.`, d), d;
|
|
50
50
|
}
|
|
51
|
-
}), u =
|
|
51
|
+
}), u = H(() => r.find(c.value, s.value)), f = H(() => !!u.value && r.route.matches.includes(ct(u.value.matched))), R = H(() => !!u.value && r.route.matched === u.value.matched);
|
|
52
52
|
return {
|
|
53
53
|
route: u,
|
|
54
54
|
href: c,
|
|
55
|
-
isMatch:
|
|
55
|
+
isMatch: f,
|
|
56
56
|
isExactMatch: R,
|
|
57
|
-
push: (
|
|
58
|
-
replace: (
|
|
57
|
+
push: (d) => r.push(c.value, {}, { ...s.value, ...d }),
|
|
58
|
+
replace: (d) => r.replace(c.value, {}, { ...s.value, ...d })
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
function
|
|
63
|
-
const t = st(
|
|
61
|
+
const Ft = Symbol();
|
|
62
|
+
function Ne() {
|
|
63
|
+
const t = st(Ft);
|
|
64
64
|
if (!t)
|
|
65
|
-
throw new
|
|
65
|
+
throw new mt();
|
|
66
66
|
return t;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function It(t, e) {
|
|
69
69
|
return [t, e].filter((n) => !!n).join(".");
|
|
70
70
|
}
|
|
71
71
|
const tt = Symbol("isRouterRouteSymbol");
|
|
@@ -96,7 +96,7 @@ function je(t, e) {
|
|
|
96
96
|
}) : Reflect.get(r, o, a)
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Ve(t, e, { exact: n } = {}) {
|
|
100
100
|
if (!$e(t))
|
|
101
101
|
return !1;
|
|
102
102
|
if (e === void 0)
|
|
@@ -110,7 +110,7 @@ function Ne(t, e, { exact: n } = {}) {
|
|
|
110
110
|
}
|
|
111
111
|
function Ce(t) {
|
|
112
112
|
return t.matches.map((n) => n.name).reduce((n, r) => {
|
|
113
|
-
const o = n.pop(), a = r ? [
|
|
113
|
+
const o = n.pop(), a = r ? [It(o, r)] : [];
|
|
114
114
|
return o ? [
|
|
115
115
|
...n,
|
|
116
116
|
o,
|
|
@@ -119,88 +119,88 @@ function Ce(t) {
|
|
|
119
119
|
}, []);
|
|
120
120
|
}
|
|
121
121
|
function Oe(t, { exact: e } = {}) {
|
|
122
|
-
const n =
|
|
122
|
+
const n = Rt();
|
|
123
123
|
function r() {
|
|
124
124
|
if (!t)
|
|
125
125
|
return;
|
|
126
|
-
if (!
|
|
126
|
+
if (!Ve(n.route, t, { exact: e }))
|
|
127
127
|
throw new Be(t, n.route.key);
|
|
128
128
|
}
|
|
129
|
-
return
|
|
129
|
+
return Ee(n.route, r, { immediate: !0, deep: !0 }), n.route;
|
|
130
130
|
}
|
|
131
|
-
const
|
|
132
|
-
function
|
|
133
|
-
return st(
|
|
131
|
+
const Jt = Symbol();
|
|
132
|
+
function gt() {
|
|
133
|
+
return st(Jt, 0);
|
|
134
134
|
}
|
|
135
135
|
class et {
|
|
136
136
|
constructor() {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
137
|
+
$(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
138
|
+
$(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
139
|
+
$(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
|
|
140
|
+
$(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
|
|
141
|
+
$(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
|
|
142
|
+
$(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
class
|
|
145
|
+
class Ut extends Error {
|
|
146
146
|
}
|
|
147
|
-
class
|
|
147
|
+
class G extends Error {
|
|
148
148
|
constructor(n) {
|
|
149
149
|
super("Error occurred during a router push operation.");
|
|
150
|
-
|
|
150
|
+
$(this, "to");
|
|
151
151
|
this.to = n;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
class
|
|
154
|
+
class ht extends Error {
|
|
155
155
|
constructor(n) {
|
|
156
156
|
super(`Routing action rejected: ${n}`);
|
|
157
|
-
|
|
157
|
+
$(this, "type");
|
|
158
158
|
this.type = n;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function W(t) {
|
|
162
162
|
return Array.isArray(t) ? t : [t];
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function _e(t, e) {
|
|
165
165
|
const n = new et();
|
|
166
166
|
return t.matches.forEach((r, o) => {
|
|
167
|
-
r.onBeforeRouteEnter &&
|
|
167
|
+
r.onBeforeRouteEnter && yt(t, e, o) && W(r.onBeforeRouteEnter).forEach((a) => n.onBeforeRouteEnter.add(a)), r.onBeforeRouteUpdate && wt(t, e, o) && W(r.onBeforeRouteUpdate).forEach((a) => n.onBeforeRouteUpdate.add(a));
|
|
168
168
|
}), e.matches.forEach((r, o) => {
|
|
169
|
-
r.onBeforeRouteLeave &&
|
|
169
|
+
r.onBeforeRouteLeave && vt(t, e, o) && W(r.onBeforeRouteLeave).forEach((a) => n.onBeforeRouteLeave.add(a));
|
|
170
170
|
}), n;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function qe(t, e) {
|
|
173
173
|
const n = new et();
|
|
174
174
|
return t.matches.forEach((r, o) => {
|
|
175
|
-
r.onAfterRouteEnter &&
|
|
175
|
+
r.onAfterRouteEnter && yt(t, e, o) && W(r.onAfterRouteEnter).forEach((a) => n.onAfterRouteEnter.add(a)), r.onAfterRouteUpdate && wt(t, e, o) && W(r.onAfterRouteUpdate).forEach((a) => n.onAfterRouteUpdate.add(a));
|
|
176
176
|
}), e.matches.forEach((r, o) => {
|
|
177
|
-
r.onAfterRouteLeave &&
|
|
177
|
+
r.onAfterRouteLeave && vt(t, e, o) && W(r.onAfterRouteLeave).forEach((a) => n.onAfterRouteLeave.add(a));
|
|
178
178
|
}), n;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function De() {
|
|
181
181
|
const t = (s) => {
|
|
182
|
-
throw new
|
|
182
|
+
throw new ht(s);
|
|
183
183
|
}, e = (...s) => {
|
|
184
|
-
throw new
|
|
184
|
+
throw new G(s);
|
|
185
185
|
}, n = (s, c, u) => {
|
|
186
186
|
if (I(s)) {
|
|
187
|
-
const
|
|
188
|
-
throw new
|
|
187
|
+
const d = c ?? {};
|
|
188
|
+
throw new G([s, { ...d, replace: !0 }]);
|
|
189
189
|
}
|
|
190
|
-
const
|
|
191
|
-
throw new
|
|
190
|
+
const f = c, R = u ?? {};
|
|
191
|
+
throw new G([s, f, { ...R, replace: !0 }]);
|
|
192
192
|
}, r = () => {
|
|
193
|
-
throw new
|
|
193
|
+
throw new Ut();
|
|
194
194
|
};
|
|
195
195
|
async function o({ to: s, from: c, hooks: u }) {
|
|
196
|
-
const { global:
|
|
197
|
-
...
|
|
198
|
-
...
|
|
199
|
-
...
|
|
200
|
-
...
|
|
196
|
+
const { global: f, component: R } = u, d = _e(s, c), A = [
|
|
197
|
+
...f.onBeforeRouteEnter,
|
|
198
|
+
...d.onBeforeRouteEnter,
|
|
199
|
+
...f.onBeforeRouteUpdate,
|
|
200
|
+
...d.onBeforeRouteUpdate,
|
|
201
201
|
...R.onBeforeRouteUpdate,
|
|
202
|
-
...
|
|
203
|
-
...
|
|
202
|
+
...f.onBeforeRouteLeave,
|
|
203
|
+
...d.onBeforeRouteLeave,
|
|
204
204
|
...R.onBeforeRouteLeave
|
|
205
205
|
];
|
|
206
206
|
try {
|
|
@@ -213,17 +213,17 @@ function qe() {
|
|
|
213
213
|
}));
|
|
214
214
|
await Promise.all(p);
|
|
215
215
|
} catch (p) {
|
|
216
|
-
if (p instanceof
|
|
216
|
+
if (p instanceof G)
|
|
217
217
|
return {
|
|
218
218
|
status: "PUSH",
|
|
219
219
|
to: p.to
|
|
220
220
|
};
|
|
221
|
-
if (p instanceof
|
|
221
|
+
if (p instanceof ht)
|
|
222
222
|
return {
|
|
223
223
|
status: "REJECT",
|
|
224
224
|
type: p.type
|
|
225
225
|
};
|
|
226
|
-
if (p instanceof
|
|
226
|
+
if (p instanceof Ut)
|
|
227
227
|
return {
|
|
228
228
|
status: "ABORT"
|
|
229
229
|
};
|
|
@@ -234,16 +234,16 @@ function qe() {
|
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
236
|
async function a({ to: s, from: c, hooks: u }) {
|
|
237
|
-
const { global:
|
|
237
|
+
const { global: f, component: R } = u, d = qe(s, c), A = [
|
|
238
238
|
...R.onAfterRouteLeave,
|
|
239
|
-
...
|
|
240
|
-
...
|
|
239
|
+
...d.onAfterRouteLeave,
|
|
240
|
+
...f.onAfterRouteLeave,
|
|
241
241
|
...R.onAfterRouteUpdate,
|
|
242
|
-
...
|
|
243
|
-
...
|
|
242
|
+
...d.onAfterRouteUpdate,
|
|
243
|
+
...f.onAfterRouteUpdate,
|
|
244
244
|
...R.onAfterRouteEnter,
|
|
245
|
-
...
|
|
246
|
-
...
|
|
245
|
+
...d.onAfterRouteEnter,
|
|
246
|
+
...f.onAfterRouteEnter
|
|
247
247
|
];
|
|
248
248
|
try {
|
|
249
249
|
const p = A.map((S) => S(s, {
|
|
@@ -254,12 +254,12 @@ function qe() {
|
|
|
254
254
|
}));
|
|
255
255
|
await Promise.all(p);
|
|
256
256
|
} catch (p) {
|
|
257
|
-
if (p instanceof
|
|
257
|
+
if (p instanceof G)
|
|
258
258
|
return {
|
|
259
259
|
status: "PUSH",
|
|
260
260
|
to: p.to
|
|
261
261
|
};
|
|
262
|
-
if (p instanceof
|
|
262
|
+
if (p instanceof ht)
|
|
263
263
|
return {
|
|
264
264
|
status: "REJECT",
|
|
265
265
|
type: p.type
|
|
@@ -275,51 +275,51 @@ function qe() {
|
|
|
275
275
|
runAfterRouteHooks: a
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
|
-
const
|
|
278
|
+
const yt = (t, e, n) => {
|
|
279
279
|
const r = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
280
280
|
return r.length < n || r[n] !== o[n];
|
|
281
|
-
},
|
|
281
|
+
}, vt = (t, e, n) => {
|
|
282
282
|
const r = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
283
283
|
return r.length < n || r[n] !== o[n];
|
|
284
284
|
}, wt = (t, e, n) => t.matches[n] === (e == null ? void 0 : e.matches[n]);
|
|
285
|
-
function
|
|
285
|
+
function Bt(t) {
|
|
286
286
|
switch (t) {
|
|
287
287
|
case "onBeforeRouteEnter":
|
|
288
288
|
case "onAfterRouteEnter":
|
|
289
|
-
return
|
|
289
|
+
return yt;
|
|
290
290
|
case "onBeforeRouteUpdate":
|
|
291
291
|
case "onAfterRouteUpdate":
|
|
292
292
|
return wt;
|
|
293
293
|
case "onBeforeRouteLeave":
|
|
294
294
|
case "onAfterRouteLeave":
|
|
295
|
-
return
|
|
295
|
+
return vt;
|
|
296
296
|
default:
|
|
297
297
|
throw new Error(`Switch is not exhaustive for lifecycle: ${t}`);
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
-
class
|
|
300
|
+
class Me {
|
|
301
301
|
constructor() {
|
|
302
|
-
|
|
303
|
-
|
|
302
|
+
$(this, "global", new et());
|
|
303
|
+
$(this, "component", new et());
|
|
304
304
|
}
|
|
305
305
|
addBeforeRouteHook({ lifecycle: e, timing: n, depth: r, hook: o }) {
|
|
306
|
-
const a =
|
|
307
|
-
if (a(u,
|
|
308
|
-
return o(u,
|
|
306
|
+
const a = Bt(e), s = this[n][e], c = (u, f) => {
|
|
307
|
+
if (a(u, f.from, r))
|
|
308
|
+
return o(u, f);
|
|
309
309
|
};
|
|
310
310
|
return s.add(c), () => s.delete(c);
|
|
311
311
|
}
|
|
312
312
|
addAfterRouteHook({ lifecycle: e, timing: n, depth: r, hook: o }) {
|
|
313
|
-
const a =
|
|
314
|
-
if (a(u,
|
|
315
|
-
return o(u,
|
|
313
|
+
const a = Bt(e), s = this[n][e], c = (u, f) => {
|
|
314
|
+
if (a(u, f.from, r))
|
|
315
|
+
return o(u, f);
|
|
316
316
|
};
|
|
317
317
|
return s.add(c), () => s.delete(c);
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
-
const
|
|
321
|
-
function
|
|
322
|
-
const t = new
|
|
320
|
+
const Kt = Symbol();
|
|
321
|
+
function Te() {
|
|
322
|
+
const t = new Me();
|
|
323
323
|
return {
|
|
324
324
|
onBeforeRouteEnter: (c) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
|
|
325
325
|
onBeforeRouteUpdate: (c) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
|
|
@@ -330,25 +330,25 @@ function Me() {
|
|
|
330
330
|
hooks: t
|
|
331
331
|
};
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
const t = st(
|
|
333
|
+
function Qt() {
|
|
334
|
+
const t = st(Kt);
|
|
335
335
|
if (!t)
|
|
336
|
-
throw new
|
|
336
|
+
throw new mt();
|
|
337
337
|
return t;
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function Gt(t) {
|
|
340
340
|
return (e) => {
|
|
341
|
-
const n =
|
|
342
|
-
return
|
|
341
|
+
const n = gt(), o = Qt().addBeforeRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
|
|
342
|
+
return Ot(o), o;
|
|
343
343
|
};
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function Et(t) {
|
|
346
346
|
return (e) => {
|
|
347
|
-
const n =
|
|
348
|
-
return
|
|
347
|
+
const n = gt(), o = Qt().addAfterRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
|
|
348
|
+
return Ot(o), o;
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
|
-
const
|
|
351
|
+
const In = Gt("onBeforeRouteUpdate"), Jn = Gt("onBeforeRouteLeave"), Kn = Et("onAfterRouteEnter"), Qn = Et("onAfterRouteUpdate"), Gn = Et("onAfterRouteLeave"), We = ["href"], Fe = /* @__PURE__ */ it({
|
|
352
352
|
__name: "routerLink",
|
|
353
353
|
props: {
|
|
354
354
|
to: { type: [String, Function] },
|
|
@@ -356,72 +356,72 @@ const Fn = Kt("onBeforeRouteUpdate"), In = Kt("onBeforeRouteLeave"), Jn = vt("on
|
|
|
356
356
|
replace: { type: Boolean }
|
|
357
357
|
},
|
|
358
358
|
setup(t) {
|
|
359
|
-
const e = t, n =
|
|
360
|
-
const { to:
|
|
359
|
+
const e = t, n = Rt(), r = H(() => I(e.to) ? e.to : e.to(n.resolve)), o = H(() => {
|
|
360
|
+
const { to: d, ...A } = e;
|
|
361
361
|
return A;
|
|
362
|
-
}), { href: a, isMatch: s, isExactMatch: c } =
|
|
362
|
+
}), { href: a, isMatch: s, isExactMatch: c } = He(r), u = H(() => ({
|
|
363
363
|
"router-link--match": s.value,
|
|
364
364
|
"router-link--exact-match": c.value
|
|
365
|
-
})),
|
|
366
|
-
const { host:
|
|
367
|
-
return
|
|
365
|
+
})), f = H(() => {
|
|
366
|
+
const { host: d } = new URL(r.value, window.location.origin);
|
|
367
|
+
return d !== window.location.host;
|
|
368
368
|
});
|
|
369
|
-
function R(
|
|
370
|
-
|
|
369
|
+
function R(d) {
|
|
370
|
+
d.preventDefault(), n.push(a.value, o.value);
|
|
371
371
|
}
|
|
372
|
-
return (
|
|
372
|
+
return (d, A) => (_t(), be("a", {
|
|
373
373
|
href: r.value,
|
|
374
|
-
class:
|
|
374
|
+
class: Pe(["router-link", u.value]),
|
|
375
375
|
onClick: R
|
|
376
376
|
}, [
|
|
377
|
-
|
|
378
|
-
], 10,
|
|
377
|
+
qt(d.$slots, "default", Dt(Mt({ resolved: r.value, isMatch: Z(s), isExactMatch: Z(c), isExternal: f.value })))
|
|
378
|
+
], 10, We));
|
|
379
379
|
}
|
|
380
380
|
});
|
|
381
|
-
function
|
|
381
|
+
function zt(t) {
|
|
382
382
|
return "children" in t;
|
|
383
383
|
}
|
|
384
384
|
function Ie(t) {
|
|
385
|
-
return
|
|
385
|
+
return zt(t) && !("component" in t) && !("components" in t);
|
|
386
386
|
}
|
|
387
387
|
function Je(t) {
|
|
388
388
|
return typeof t == "object" && t !== null && "component" in t;
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function Ke(t) {
|
|
391
391
|
return typeof t == "object" && t !== null && "components" in t;
|
|
392
392
|
}
|
|
393
|
-
const
|
|
393
|
+
const Yt = /* @__PURE__ */ it({
|
|
394
394
|
__name: "routerView",
|
|
395
395
|
props: {
|
|
396
396
|
name: {}
|
|
397
397
|
},
|
|
398
398
|
setup(t) {
|
|
399
|
-
const { name: e = "default" } = t, n = Oe(), r =
|
|
400
|
-
|
|
401
|
-
const a =
|
|
399
|
+
const { name: e = "default" } = t, n = Oe(), r = Ne(), o = gt();
|
|
400
|
+
Se(Jt, o + 1);
|
|
401
|
+
const a = H(() => {
|
|
402
402
|
if (r.value)
|
|
403
403
|
return r.value.component;
|
|
404
404
|
const c = n.matches.at(o);
|
|
405
405
|
if (!c)
|
|
406
406
|
return null;
|
|
407
|
-
const
|
|
408
|
-
return
|
|
407
|
+
const f = s(c)[e];
|
|
408
|
+
return f ? typeof f == "function" ? ke(f) : f : null;
|
|
409
409
|
});
|
|
410
410
|
function s(c) {
|
|
411
|
-
return
|
|
411
|
+
return Ke(c) ? c.components : Je(c) ? { default: c.component } : {};
|
|
412
412
|
}
|
|
413
|
-
return (c, u) =>
|
|
414
|
-
(
|
|
413
|
+
return (c, u) => qt(c.$slots, "default", Dt(Mt({ route: Z(n), component: a.value, rejection: Z(r) })), () => [
|
|
414
|
+
(_t(), xe(Ae(a.value)))
|
|
415
415
|
]);
|
|
416
416
|
}
|
|
417
417
|
});
|
|
418
|
-
function
|
|
418
|
+
function zn(t, e) {
|
|
419
419
|
return it({
|
|
420
420
|
name: "PropsWrapper",
|
|
421
421
|
expose: [],
|
|
422
422
|
async setup() {
|
|
423
423
|
const n = await e();
|
|
424
|
-
return () =>
|
|
424
|
+
return () => Tt(t, n);
|
|
425
425
|
}
|
|
426
426
|
});
|
|
427
427
|
}
|
|
@@ -453,18 +453,18 @@ function D(t, e) {
|
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
var nt = "beforeunload",
|
|
457
|
-
function
|
|
456
|
+
var nt = "beforeunload", Qe = "hashchange", Xt = "popstate";
|
|
457
|
+
function Ht(t) {
|
|
458
458
|
t === void 0 && (t = {});
|
|
459
459
|
var e = t, n = e.window, r = n === void 0 ? document.defaultView : n, o = r.history;
|
|
460
460
|
function a() {
|
|
461
|
-
var h = r.location, i = h.pathname,
|
|
462
|
-
return [
|
|
461
|
+
var h = r.location, i = h.pathname, l = h.search, v = h.hash, w = o.state || {};
|
|
462
|
+
return [w.idx, J({
|
|
463
463
|
pathname: i,
|
|
464
|
-
search:
|
|
465
|
-
hash:
|
|
466
|
-
state:
|
|
467
|
-
key:
|
|
464
|
+
search: l,
|
|
465
|
+
hash: v,
|
|
466
|
+
state: w.usr || null,
|
|
467
|
+
key: w.key || "default"
|
|
468
468
|
})];
|
|
469
469
|
}
|
|
470
470
|
var s = null;
|
|
@@ -472,17 +472,17 @@ function Bt(t) {
|
|
|
472
472
|
if (s)
|
|
473
473
|
p.call(s), s = null;
|
|
474
474
|
else {
|
|
475
|
-
var h = L.Pop, i = a(),
|
|
475
|
+
var h = L.Pop, i = a(), l = i[0], v = i[1];
|
|
476
476
|
if (p.length)
|
|
477
|
-
if (
|
|
478
|
-
var
|
|
479
|
-
|
|
477
|
+
if (l != null) {
|
|
478
|
+
var w = R - l;
|
|
479
|
+
w && (s = {
|
|
480
480
|
action: h,
|
|
481
|
-
location:
|
|
481
|
+
location: v,
|
|
482
482
|
retry: function() {
|
|
483
|
-
E(
|
|
483
|
+
E(w * -1);
|
|
484
484
|
}
|
|
485
|
-
}, E(
|
|
485
|
+
}, E(w));
|
|
486
486
|
} else
|
|
487
487
|
process.env.NODE_ENV !== "production" && D(
|
|
488
488
|
!1,
|
|
@@ -492,20 +492,20 @@ function Bt(t) {
|
|
|
492
492
|
"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."
|
|
493
493
|
);
|
|
494
494
|
else
|
|
495
|
-
|
|
495
|
+
U(h);
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
r.addEventListener(
|
|
499
|
-
var u = L.Pop,
|
|
498
|
+
r.addEventListener(Xt, c);
|
|
499
|
+
var u = L.Pop, f = a(), R = f[0], d = f[1], A = K(), p = K();
|
|
500
500
|
R == null && (R = 0, o.replaceState(_({}, o.state, {
|
|
501
501
|
idx: R
|
|
502
502
|
}), ""));
|
|
503
503
|
function S(h) {
|
|
504
504
|
return typeof h == "string" ? h : M(h);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function j(h, i) {
|
|
507
507
|
return i === void 0 && (i = null), J(_({
|
|
508
|
-
pathname:
|
|
508
|
+
pathname: d.pathname,
|
|
509
509
|
hash: "",
|
|
510
510
|
search: ""
|
|
511
511
|
}, typeof h == "string" ? z(h) : h, {
|
|
@@ -513,51 +513,51 @@ function Bt(t) {
|
|
|
513
513
|
key: ot()
|
|
514
514
|
}));
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function V(h, i) {
|
|
517
517
|
return [{
|
|
518
518
|
usr: h.state,
|
|
519
519
|
key: h.key,
|
|
520
520
|
idx: i
|
|
521
521
|
}, S(h)];
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function B(h, i, l) {
|
|
524
524
|
return !p.length || (p.call({
|
|
525
525
|
action: h,
|
|
526
526
|
location: i,
|
|
527
|
-
retry:
|
|
527
|
+
retry: l
|
|
528
528
|
}), !1);
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function U(h) {
|
|
531
531
|
u = h;
|
|
532
532
|
var i = a();
|
|
533
|
-
R = i[0],
|
|
533
|
+
R = i[0], d = i[1], A.call({
|
|
534
534
|
action: u,
|
|
535
|
-
location:
|
|
535
|
+
location: d
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
|
-
function
|
|
539
|
-
var
|
|
540
|
-
function
|
|
541
|
-
|
|
538
|
+
function m(h, i) {
|
|
539
|
+
var l = L.Push, v = j(h, i);
|
|
540
|
+
function w() {
|
|
541
|
+
m(h, i);
|
|
542
542
|
}
|
|
543
|
-
if (
|
|
544
|
-
var k =
|
|
543
|
+
if (B(l, v, w)) {
|
|
544
|
+
var k = V(v, R + 1), g = k[0], P = k[1];
|
|
545
545
|
try {
|
|
546
546
|
o.pushState(g, "", P);
|
|
547
547
|
} catch {
|
|
548
548
|
r.location.assign(P);
|
|
549
549
|
}
|
|
550
|
-
|
|
550
|
+
U(l);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
function y(h, i) {
|
|
554
|
-
var
|
|
555
|
-
function
|
|
554
|
+
var l = L.Replace, v = j(h, i);
|
|
555
|
+
function w() {
|
|
556
556
|
y(h, i);
|
|
557
557
|
}
|
|
558
|
-
if (
|
|
559
|
-
var k =
|
|
560
|
-
o.replaceState(g, "", P),
|
|
558
|
+
if (B(l, v, w)) {
|
|
559
|
+
var k = V(v, R), g = k[0], P = k[1];
|
|
560
|
+
o.replaceState(g, "", P), U(l);
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
563
|
function E(h) {
|
|
@@ -568,10 +568,10 @@ function Bt(t) {
|
|
|
568
568
|
return u;
|
|
569
569
|
},
|
|
570
570
|
get location() {
|
|
571
|
-
return
|
|
571
|
+
return d;
|
|
572
572
|
},
|
|
573
573
|
createHref: S,
|
|
574
|
-
push:
|
|
574
|
+
push: m,
|
|
575
575
|
replace: y,
|
|
576
576
|
go: E,
|
|
577
577
|
back: function() {
|
|
@@ -584,21 +584,21 @@ function Bt(t) {
|
|
|
584
584
|
return A.push(i);
|
|
585
585
|
},
|
|
586
586
|
block: function(i) {
|
|
587
|
-
var
|
|
587
|
+
var l = p.push(i);
|
|
588
588
|
return p.length === 1 && r.addEventListener(nt, rt), function() {
|
|
589
|
-
|
|
589
|
+
l(), p.length || r.removeEventListener(nt, rt);
|
|
590
590
|
};
|
|
591
591
|
}
|
|
592
592
|
};
|
|
593
593
|
return b;
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function Ge(t) {
|
|
596
596
|
t === void 0 && (t = {});
|
|
597
597
|
var e = t, n = e.window, r = n === void 0 ? document.defaultView : n, o = r.history;
|
|
598
598
|
function a() {
|
|
599
|
-
var i = z(r.location.hash.substr(1)),
|
|
599
|
+
var i = z(r.location.hash.substr(1)), l = i.pathname, v = l === void 0 ? "/" : l, w = i.search, k = w === void 0 ? "" : w, g = i.hash, P = g === void 0 ? "" : g, x = o.state || {};
|
|
600
600
|
return [x.idx, J({
|
|
601
|
-
pathname:
|
|
601
|
+
pathname: v,
|
|
602
602
|
search: k,
|
|
603
603
|
hash: P,
|
|
604
604
|
state: x.usr || null,
|
|
@@ -610,13 +610,13 @@ function Qe(t) {
|
|
|
610
610
|
if (s)
|
|
611
611
|
p.call(s), s = null;
|
|
612
612
|
else {
|
|
613
|
-
var i = L.Pop,
|
|
613
|
+
var i = L.Pop, l = a(), v = l[0], w = l[1];
|
|
614
614
|
if (p.length)
|
|
615
|
-
if (
|
|
616
|
-
var k = R -
|
|
615
|
+
if (v != null) {
|
|
616
|
+
var k = R - v;
|
|
617
617
|
k && (s = {
|
|
618
618
|
action: i,
|
|
619
|
-
location:
|
|
619
|
+
location: w,
|
|
620
620
|
retry: function() {
|
|
621
621
|
b(k * -1);
|
|
622
622
|
}
|
|
@@ -630,83 +630,83 @@ function Qe(t) {
|
|
|
630
630
|
"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."
|
|
631
631
|
);
|
|
632
632
|
else
|
|
633
|
-
|
|
633
|
+
m(i);
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
r.addEventListener(
|
|
637
|
-
var i = a(),
|
|
638
|
-
M(
|
|
636
|
+
r.addEventListener(Xt, c), r.addEventListener(Qe, function() {
|
|
637
|
+
var i = a(), l = i[1];
|
|
638
|
+
M(l) !== M(d) && c();
|
|
639
639
|
});
|
|
640
|
-
var u = L.Pop,
|
|
640
|
+
var u = L.Pop, f = a(), R = f[0], d = f[1], A = K(), p = K();
|
|
641
641
|
R == null && (R = 0, o.replaceState(_({}, o.state, {
|
|
642
642
|
idx: R
|
|
643
643
|
}), ""));
|
|
644
644
|
function S() {
|
|
645
|
-
var i = document.querySelector("base"),
|
|
645
|
+
var i = document.querySelector("base"), l = "";
|
|
646
646
|
if (i && i.getAttribute("href")) {
|
|
647
|
-
var
|
|
648
|
-
|
|
647
|
+
var v = r.location.href, w = v.indexOf("#");
|
|
648
|
+
l = w === -1 ? v : v.slice(0, w);
|
|
649
649
|
}
|
|
650
|
-
return
|
|
650
|
+
return l;
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function j(i) {
|
|
653
653
|
return S() + "#" + (typeof i == "string" ? i : M(i));
|
|
654
654
|
}
|
|
655
|
-
function
|
|
656
|
-
return
|
|
657
|
-
pathname:
|
|
655
|
+
function V(i, l) {
|
|
656
|
+
return l === void 0 && (l = null), J(_({
|
|
657
|
+
pathname: d.pathname,
|
|
658
658
|
hash: "",
|
|
659
659
|
search: ""
|
|
660
660
|
}, typeof i == "string" ? z(i) : i, {
|
|
661
|
-
state:
|
|
661
|
+
state: l,
|
|
662
662
|
key: ot()
|
|
663
663
|
}));
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function B(i, l) {
|
|
666
666
|
return [{
|
|
667
667
|
usr: i.state,
|
|
668
668
|
key: i.key,
|
|
669
|
-
idx:
|
|
670
|
-
},
|
|
669
|
+
idx: l
|
|
670
|
+
}, j(i)];
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function U(i, l, v) {
|
|
673
673
|
return !p.length || (p.call({
|
|
674
674
|
action: i,
|
|
675
|
-
location:
|
|
676
|
-
retry:
|
|
675
|
+
location: l,
|
|
676
|
+
retry: v
|
|
677
677
|
}), !1);
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function m(i) {
|
|
680
680
|
u = i;
|
|
681
|
-
var
|
|
682
|
-
R =
|
|
681
|
+
var l = a();
|
|
682
|
+
R = l[0], d = l[1], A.call({
|
|
683
683
|
action: u,
|
|
684
|
-
location:
|
|
684
|
+
location: d
|
|
685
685
|
});
|
|
686
686
|
}
|
|
687
|
-
function y(i,
|
|
688
|
-
var
|
|
687
|
+
function y(i, l) {
|
|
688
|
+
var v = L.Push, w = V(i, l);
|
|
689
689
|
function k() {
|
|
690
|
-
y(i,
|
|
690
|
+
y(i, l);
|
|
691
691
|
}
|
|
692
|
-
if (process.env.NODE_ENV !== "production" && D(
|
|
693
|
-
var g =
|
|
692
|
+
if (process.env.NODE_ENV !== "production" && D(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(i) + ")"), U(v, w, k)) {
|
|
693
|
+
var g = B(w, R + 1), P = g[0], x = g[1];
|
|
694
694
|
try {
|
|
695
695
|
o.pushState(P, "", x);
|
|
696
696
|
} catch {
|
|
697
697
|
r.location.assign(x);
|
|
698
698
|
}
|
|
699
|
-
|
|
699
|
+
m(v);
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
|
-
function E(i,
|
|
703
|
-
var
|
|
702
|
+
function E(i, l) {
|
|
703
|
+
var v = L.Replace, w = V(i, l);
|
|
704
704
|
function k() {
|
|
705
|
-
E(i,
|
|
705
|
+
E(i, l);
|
|
706
706
|
}
|
|
707
|
-
if (process.env.NODE_ENV !== "production" && D(
|
|
708
|
-
var g =
|
|
709
|
-
o.replaceState(P, "", x),
|
|
707
|
+
if (process.env.NODE_ENV !== "production" && D(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(i) + ")"), U(v, w, k)) {
|
|
708
|
+
var g = B(w, R), P = g[0], x = g[1];
|
|
709
|
+
o.replaceState(P, "", x), m(v);
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
712
|
function b(i) {
|
|
@@ -717,9 +717,9 @@ function Qe(t) {
|
|
|
717
717
|
return u;
|
|
718
718
|
},
|
|
719
719
|
get location() {
|
|
720
|
-
return
|
|
720
|
+
return d;
|
|
721
721
|
},
|
|
722
|
-
createHref:
|
|
722
|
+
createHref: j,
|
|
723
723
|
push: y,
|
|
724
724
|
replace: E,
|
|
725
725
|
go: b,
|
|
@@ -729,78 +729,78 @@ function Qe(t) {
|
|
|
729
729
|
forward: function() {
|
|
730
730
|
b(1);
|
|
731
731
|
},
|
|
732
|
-
listen: function(
|
|
733
|
-
return A.push(
|
|
732
|
+
listen: function(l) {
|
|
733
|
+
return A.push(l);
|
|
734
734
|
},
|
|
735
|
-
block: function(
|
|
736
|
-
var
|
|
735
|
+
block: function(l) {
|
|
736
|
+
var v = p.push(l);
|
|
737
737
|
return p.length === 1 && r.addEventListener(nt, rt), function() {
|
|
738
|
-
|
|
738
|
+
v(), p.length || r.removeEventListener(nt, rt);
|
|
739
739
|
};
|
|
740
740
|
}
|
|
741
741
|
};
|
|
742
742
|
return h;
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function Nt(t) {
|
|
745
745
|
t === void 0 && (t = {});
|
|
746
|
-
var e = t, n = e.initialEntries, r = n === void 0 ? ["/"] : n, o = e.initialIndex, a = r.map(function(
|
|
746
|
+
var e = t, n = e.initialEntries, r = n === void 0 ? ["/"] : n, o = e.initialIndex, a = r.map(function(m) {
|
|
747
747
|
var y = J(_({
|
|
748
748
|
pathname: "/",
|
|
749
749
|
search: "",
|
|
750
750
|
hash: "",
|
|
751
751
|
state: null,
|
|
752
752
|
key: ot()
|
|
753
|
-
}, typeof
|
|
754
|
-
return process.env.NODE_ENV !== "production" && D(y.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(
|
|
755
|
-
}), s =
|
|
756
|
-
function m
|
|
757
|
-
return typeof
|
|
753
|
+
}, typeof m == "string" ? z(m) : m));
|
|
754
|
+
return process.env.NODE_ENV !== "production" && D(y.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(m) + ")"), y;
|
|
755
|
+
}), s = $t(o ?? a.length - 1, 0, a.length - 1), c = L.Pop, u = a[s], f = K(), R = K();
|
|
756
|
+
function d(m) {
|
|
757
|
+
return typeof m == "string" ? m : M(m);
|
|
758
758
|
}
|
|
759
|
-
function A(
|
|
759
|
+
function A(m, y) {
|
|
760
760
|
return y === void 0 && (y = null), J(_({
|
|
761
761
|
pathname: u.pathname,
|
|
762
762
|
search: "",
|
|
763
763
|
hash: ""
|
|
764
|
-
}, typeof
|
|
764
|
+
}, typeof m == "string" ? z(m) : m, {
|
|
765
765
|
state: y,
|
|
766
766
|
key: ot()
|
|
767
767
|
}));
|
|
768
768
|
}
|
|
769
|
-
function p(
|
|
769
|
+
function p(m, y, E) {
|
|
770
770
|
return !R.length || (R.call({
|
|
771
|
-
action:
|
|
771
|
+
action: m,
|
|
772
772
|
location: y,
|
|
773
773
|
retry: E
|
|
774
774
|
}), !1);
|
|
775
775
|
}
|
|
776
|
-
function S(
|
|
777
|
-
c =
|
|
776
|
+
function S(m, y) {
|
|
777
|
+
c = m, u = y, f.call({
|
|
778
778
|
action: c,
|
|
779
779
|
location: u
|
|
780
780
|
});
|
|
781
781
|
}
|
|
782
|
-
function
|
|
783
|
-
var E = L.Push, b = A(
|
|
782
|
+
function j(m, y) {
|
|
783
|
+
var E = L.Push, b = A(m, y);
|
|
784
784
|
function h() {
|
|
785
|
-
|
|
785
|
+
j(m, y);
|
|
786
786
|
}
|
|
787
|
-
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(
|
|
787
|
+
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(m) + ")"), p(E, b, h) && (s += 1, a.splice(s, a.length, b), S(E, b));
|
|
788
788
|
}
|
|
789
|
-
function
|
|
790
|
-
var E = L.Replace, b = A(
|
|
789
|
+
function V(m, y) {
|
|
790
|
+
var E = L.Replace, b = A(m, y);
|
|
791
791
|
function h() {
|
|
792
|
-
|
|
792
|
+
V(m, y);
|
|
793
793
|
}
|
|
794
|
-
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(
|
|
794
|
+
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(m) + ")"), p(E, b, h) && (a[s] = b, S(E, b));
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
var y =
|
|
796
|
+
function B(m) {
|
|
797
|
+
var y = $t(s + m, 0, a.length - 1), E = L.Pop, b = a[y];
|
|
798
798
|
function h() {
|
|
799
|
-
|
|
799
|
+
B(m);
|
|
800
800
|
}
|
|
801
801
|
p(E, b, h) && (s = y, S(E, b));
|
|
802
802
|
}
|
|
803
|
-
var
|
|
803
|
+
var U = {
|
|
804
804
|
get index() {
|
|
805
805
|
return s;
|
|
806
806
|
},
|
|
@@ -810,32 +810,32 @@ function Ut(t) {
|
|
|
810
810
|
get location() {
|
|
811
811
|
return u;
|
|
812
812
|
},
|
|
813
|
-
createHref:
|
|
814
|
-
push:
|
|
815
|
-
replace:
|
|
816
|
-
go:
|
|
813
|
+
createHref: d,
|
|
814
|
+
push: j,
|
|
815
|
+
replace: V,
|
|
816
|
+
go: B,
|
|
817
817
|
back: function() {
|
|
818
|
-
|
|
818
|
+
B(-1);
|
|
819
819
|
},
|
|
820
820
|
forward: function() {
|
|
821
|
-
|
|
821
|
+
B(1);
|
|
822
822
|
},
|
|
823
823
|
listen: function(y) {
|
|
824
|
-
return
|
|
824
|
+
return f.push(y);
|
|
825
825
|
},
|
|
826
826
|
block: function(y) {
|
|
827
827
|
return R.push(y);
|
|
828
828
|
}
|
|
829
829
|
};
|
|
830
|
-
return
|
|
830
|
+
return U;
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function $t(t, e, n) {
|
|
833
833
|
return Math.min(Math.max(t, e), n);
|
|
834
834
|
}
|
|
835
835
|
function rt(t) {
|
|
836
836
|
t.preventDefault(), t.returnValue = "";
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function K() {
|
|
839
839
|
var t = [];
|
|
840
840
|
return {
|
|
841
841
|
get length() {
|
|
@@ -872,8 +872,8 @@ function z(t) {
|
|
|
872
872
|
}
|
|
873
873
|
return e;
|
|
874
874
|
}
|
|
875
|
-
function
|
|
876
|
-
const n =
|
|
875
|
+
function ze(t, e) {
|
|
876
|
+
const n = Le({ ...t }), r = (s) => {
|
|
877
877
|
Object.assign(n, { ...s });
|
|
878
878
|
}, o = ct(n), a = je(o, e);
|
|
879
879
|
return {
|
|
@@ -882,58 +882,69 @@ function Ge(t, e) {
|
|
|
882
882
|
updateRoute: r
|
|
883
883
|
};
|
|
884
884
|
}
|
|
885
|
-
class
|
|
885
|
+
class Ye extends Error {
|
|
886
886
|
constructor(e) {
|
|
887
887
|
super(`Route disabled: "${e}"`);
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
|
-
class
|
|
890
|
+
class Xe extends Error {
|
|
891
891
|
constructor(e) {
|
|
892
892
|
super(`Route not found: "${e}"`);
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
|
-
const
|
|
896
|
-
function
|
|
895
|
+
const Q = "[", Y = "]";
|
|
896
|
+
function Ze(t) {
|
|
897
897
|
return t !== String && t !== Boolean && t !== Number && t !== Date;
|
|
898
898
|
}
|
|
899
|
-
function
|
|
900
|
-
return typeof t == "function" &&
|
|
899
|
+
function tn(t) {
|
|
900
|
+
return typeof t == "function" && Ze(t);
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function ft(t) {
|
|
903
903
|
return typeof t == "object" && "get" in t && typeof t.get == "function" && "set" in t && typeof t.set == "function";
|
|
904
904
|
}
|
|
905
|
-
function Et(t) {
|
|
906
|
-
return typeof t == "string" && t.length > 0;
|
|
907
|
-
}
|
|
908
|
-
function tn(t, e) {
|
|
909
|
-
return t[e] ?? String;
|
|
910
|
-
}
|
|
911
|
-
const Xt = Symbol();
|
|
912
905
|
function Zt(t) {
|
|
913
|
-
return
|
|
906
|
+
return ft(t) ? t : {
|
|
907
|
+
get: (e) => St(e, t),
|
|
908
|
+
set: (e) => kt(e, t)
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
const te = Symbol();
|
|
912
|
+
function bt(t) {
|
|
913
|
+
return te in t;
|
|
914
914
|
}
|
|
915
915
|
function en(t) {
|
|
916
916
|
return {
|
|
917
|
-
[
|
|
918
|
-
|
|
919
|
-
if (Et(e))
|
|
920
|
-
return bt(e, t);
|
|
921
|
-
},
|
|
922
|
-
set: (e) => e === void 0 ? "" : Pt(e, t)
|
|
917
|
+
[te]: !0,
|
|
918
|
+
...Zt(t)
|
|
923
919
|
};
|
|
924
920
|
}
|
|
925
|
-
|
|
921
|
+
function nn(t) {
|
|
922
|
+
return ft(t) && t.defaultValue !== void 0;
|
|
923
|
+
}
|
|
924
|
+
function Yn(t, e) {
|
|
925
|
+
return {
|
|
926
|
+
defaultValue: e,
|
|
927
|
+
...Zt(t)
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
function Pt(t) {
|
|
931
|
+
return typeof t == "string" && t.length > 0;
|
|
932
|
+
}
|
|
933
|
+
function rn(t, e) {
|
|
934
|
+
return t[e] ?? String;
|
|
935
|
+
}
|
|
936
|
+
const N = {
|
|
926
937
|
invalid: (t) => {
|
|
927
|
-
throw new
|
|
938
|
+
throw new F(t);
|
|
928
939
|
}
|
|
929
|
-
},
|
|
940
|
+
}, on = {
|
|
930
941
|
get: (t) => t,
|
|
931
942
|
set: (t, { invalid: e }) => {
|
|
932
943
|
if (typeof t != "string")
|
|
933
944
|
throw e();
|
|
934
945
|
return t;
|
|
935
946
|
}
|
|
936
|
-
},
|
|
947
|
+
}, ee = {
|
|
937
948
|
get: (t, { invalid: e }) => {
|
|
938
949
|
if (t === "true")
|
|
939
950
|
return !0;
|
|
@@ -946,7 +957,7 @@ const U = {
|
|
|
946
957
|
throw e();
|
|
947
958
|
return t.toString();
|
|
948
959
|
}
|
|
949
|
-
},
|
|
960
|
+
}, ne = {
|
|
950
961
|
get: (t, { invalid: e }) => {
|
|
951
962
|
const n = Number(t);
|
|
952
963
|
if (isNaN(n))
|
|
@@ -958,7 +969,7 @@ const U = {
|
|
|
958
969
|
throw e();
|
|
959
970
|
return t.toString();
|
|
960
971
|
}
|
|
961
|
-
},
|
|
972
|
+
}, re = {
|
|
962
973
|
get: (t, { invalid: e }) => {
|
|
963
974
|
const n = new Date(t);
|
|
964
975
|
if (isNaN(n.getTime()))
|
|
@@ -970,7 +981,7 @@ const U = {
|
|
|
970
981
|
throw e();
|
|
971
982
|
return t.toISOString();
|
|
972
983
|
}
|
|
973
|
-
},
|
|
984
|
+
}, oe = {
|
|
974
985
|
get: (t, { invalid: e }) => {
|
|
975
986
|
try {
|
|
976
987
|
return JSON.parse(t);
|
|
@@ -986,108 +997,115 @@ const U = {
|
|
|
986
997
|
}
|
|
987
998
|
}
|
|
988
999
|
};
|
|
989
|
-
function
|
|
990
|
-
if (t === void 0) {
|
|
991
|
-
if (
|
|
992
|
-
return e.
|
|
993
|
-
|
|
1000
|
+
function St(t, e) {
|
|
1001
|
+
if (t === void 0 || !Pt(t)) {
|
|
1002
|
+
if (nn(e))
|
|
1003
|
+
return e.defaultValue;
|
|
1004
|
+
if (bt(e))
|
|
1005
|
+
return;
|
|
1006
|
+
throw new F();
|
|
994
1007
|
}
|
|
995
1008
|
if (e === String)
|
|
996
|
-
return
|
|
1009
|
+
return on.get(t, N);
|
|
997
1010
|
if (e === Boolean)
|
|
998
|
-
return
|
|
1011
|
+
return ee.get(t, N);
|
|
999
1012
|
if (e === Number)
|
|
1000
|
-
return
|
|
1013
|
+
return ne.get(t, N);
|
|
1001
1014
|
if (e === Date)
|
|
1002
|
-
return
|
|
1015
|
+
return re.get(t, N);
|
|
1003
1016
|
if (e === JSON)
|
|
1004
|
-
return
|
|
1005
|
-
if (
|
|
1006
|
-
return e(t,
|
|
1007
|
-
if (
|
|
1008
|
-
return e.get(t,
|
|
1017
|
+
return oe.get(t, N);
|
|
1018
|
+
if (tn(e))
|
|
1019
|
+
return e(t, N);
|
|
1020
|
+
if (ft(e))
|
|
1021
|
+
return e.get(t, N);
|
|
1009
1022
|
if (e instanceof RegExp) {
|
|
1010
1023
|
if (e.test(t))
|
|
1011
1024
|
return t;
|
|
1012
|
-
throw new
|
|
1025
|
+
throw new F();
|
|
1013
1026
|
}
|
|
1014
1027
|
return t;
|
|
1015
1028
|
}
|
|
1016
|
-
function
|
|
1029
|
+
function kt(t, e) {
|
|
1030
|
+
if (t === void 0) {
|
|
1031
|
+
if (bt(e))
|
|
1032
|
+
return "";
|
|
1033
|
+
throw new F();
|
|
1034
|
+
}
|
|
1017
1035
|
if (e === Boolean)
|
|
1018
|
-
return
|
|
1036
|
+
return ee.set(t, N);
|
|
1019
1037
|
if (e === Number)
|
|
1020
|
-
return
|
|
1038
|
+
return ne.set(t, N);
|
|
1021
1039
|
if (e === Date)
|
|
1022
|
-
return
|
|
1040
|
+
return re.set(t, N);
|
|
1023
1041
|
if (e === JSON)
|
|
1024
|
-
return
|
|
1025
|
-
if (
|
|
1026
|
-
return e.set(t,
|
|
1042
|
+
return oe.set(t, N);
|
|
1043
|
+
if (ft(e))
|
|
1044
|
+
return e.set(t, N);
|
|
1027
1045
|
try {
|
|
1028
1046
|
return t.toString();
|
|
1029
1047
|
} catch {
|
|
1030
|
-
throw new
|
|
1048
|
+
throw new F();
|
|
1031
1049
|
}
|
|
1032
1050
|
}
|
|
1033
|
-
function
|
|
1034
|
-
const e =
|
|
1051
|
+
function an(t) {
|
|
1052
|
+
const e = xt(t.path.toString());
|
|
1035
1053
|
return new RegExp(`^${e}$`, "i");
|
|
1036
1054
|
}
|
|
1037
|
-
function
|
|
1055
|
+
function sn(t) {
|
|
1038
1056
|
const e = new URLSearchParams(t.query.toString());
|
|
1039
|
-
return Array.from(e.entries()).filter(([, n]) => !
|
|
1057
|
+
return Array.from(e.entries()).filter(([, n]) => !se(n)).map(([n, r]) => new RegExp(`${n}=${xt(r)}(&|$)`, "i"));
|
|
1040
1058
|
}
|
|
1041
|
-
function
|
|
1059
|
+
function xt(t) {
|
|
1042
1060
|
return [
|
|
1043
|
-
|
|
1044
|
-
|
|
1061
|
+
cn,
|
|
1062
|
+
un
|
|
1045
1063
|
].reduce((e, n) => n(e), t);
|
|
1046
1064
|
}
|
|
1047
|
-
const
|
|
1048
|
-
function
|
|
1049
|
-
return t.replace(new RegExp(
|
|
1065
|
+
const At = `\\${Q}\\?([\\w-_]+)\\${Y}`, ae = `\\${Q}([\\w-_]+)\\${Y}`;
|
|
1066
|
+
function cn(t) {
|
|
1067
|
+
return t.replace(new RegExp(At, "g"), ".*");
|
|
1050
1068
|
}
|
|
1051
|
-
function
|
|
1052
|
-
return new RegExp(
|
|
1069
|
+
function se(t) {
|
|
1070
|
+
return new RegExp(At, "g").test(t);
|
|
1053
1071
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return t.replace(new RegExp(
|
|
1072
|
+
function un(t) {
|
|
1073
|
+
return t.replace(new RegExp(ae, "g"), ".+");
|
|
1056
1074
|
}
|
|
1057
|
-
function
|
|
1058
|
-
const [e] = at(t, new RegExp(
|
|
1075
|
+
function fn(t) {
|
|
1076
|
+
const [e] = at(t, new RegExp(At, "g")), [n] = at(t, new RegExp(ae, "g"));
|
|
1059
1077
|
return e ?? n;
|
|
1060
1078
|
}
|
|
1061
1079
|
function at(t, e) {
|
|
1062
|
-
return Array.from(t.matchAll(e)).flatMap(([, ...r]) => r.map((o) =>
|
|
1080
|
+
return Array.from(t.matchAll(e)).flatMap(([, ...r]) => r.map((o) => Pt(o) ? o : ""));
|
|
1063
1081
|
}
|
|
1064
|
-
function
|
|
1065
|
-
const r =
|
|
1082
|
+
function ce(t, e, n) {
|
|
1083
|
+
const r = ie(e, n), [o] = at(t, r);
|
|
1066
1084
|
return o;
|
|
1067
1085
|
}
|
|
1068
|
-
function
|
|
1086
|
+
function ln(t, e) {
|
|
1069
1087
|
if (!e)
|
|
1070
1088
|
return t;
|
|
1071
|
-
const { name: n, param: r, value: o } = e, a =
|
|
1072
|
-
return at(t, a).reduce((c, u) => u === void 0 ? c : c.replace(u, () =>
|
|
1089
|
+
const { name: n, param: r, value: o } = e, a = ie(t, n);
|
|
1090
|
+
return at(t, a).reduce((c, u) => u === void 0 ? c : c.replace(u, () => kt(o, r)), t);
|
|
1073
1091
|
}
|
|
1074
|
-
function
|
|
1092
|
+
function ie(t, e) {
|
|
1075
1093
|
const n = [
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1094
|
+
hn,
|
|
1095
|
+
pn,
|
|
1096
|
+
xt
|
|
1079
1097
|
].reduce((r, o) => o(r, e), t);
|
|
1080
1098
|
return new RegExp(n, "g");
|
|
1081
1099
|
}
|
|
1082
|
-
function
|
|
1083
|
-
const n = new RegExp(`(\\${
|
|
1100
|
+
function hn(t, e) {
|
|
1101
|
+
const n = new RegExp(`(\\${Q}\\?${e})\\${Y}`, "g");
|
|
1084
1102
|
return t.replace(n, "(.*)");
|
|
1085
1103
|
}
|
|
1086
|
-
function
|
|
1087
|
-
const n = new RegExp(`(\\${
|
|
1104
|
+
function pn(t, e) {
|
|
1105
|
+
const n = new RegExp(`(\\${Q}${e})\\${Y}`, "g");
|
|
1088
1106
|
return t.replace(n, "(.+)");
|
|
1089
1107
|
}
|
|
1090
|
-
function
|
|
1108
|
+
function ue(t, ...e) {
|
|
1091
1109
|
return e.reduce((n, r) => {
|
|
1092
1110
|
if (!r)
|
|
1093
1111
|
return n;
|
|
@@ -1095,44 +1113,44 @@ function ie(t, ...e) {
|
|
|
1095
1113
|
return Object.keys(o).length === 0 ? n : n.includes("?") ? `${n}&${o}` : `${n}?${o}`;
|
|
1096
1114
|
}, t);
|
|
1097
1115
|
}
|
|
1098
|
-
function
|
|
1099
|
-
const { params: n = {}, query: r } = e, o = { ...t.path.params, ...t.query.params }, a = t.path.toString(), s = t.query.toString(), c =
|
|
1100
|
-
return
|
|
1116
|
+
function dn(t, e = {}) {
|
|
1117
|
+
const { params: n = {}, query: r } = e, o = { ...t.path.params, ...t.query.params }, a = t.path.toString(), s = t.query.toString(), c = mn(a, o, n), u = Rn(s, o, n);
|
|
1118
|
+
return ue(c, u, r);
|
|
1101
1119
|
}
|
|
1102
|
-
function
|
|
1103
|
-
return t.length ? Object.entries(e).reduce((r, [o, a]) =>
|
|
1120
|
+
function mn(t, e, n) {
|
|
1121
|
+
return t.length ? Object.entries(e).reduce((r, [o, a]) => ln(r, { name: o, param: a, value: n[o] }), t) : t;
|
|
1104
1122
|
}
|
|
1105
|
-
function
|
|
1123
|
+
function Rn(t, e, n) {
|
|
1106
1124
|
if (!t.length)
|
|
1107
1125
|
return {};
|
|
1108
1126
|
const r = new URLSearchParams(t);
|
|
1109
1127
|
return Array.from(r.entries()).reduce((o, [a, s]) => {
|
|
1110
|
-
const c =
|
|
1128
|
+
const c = fn(s);
|
|
1111
1129
|
if (!c)
|
|
1112
1130
|
return { ...o, [a]: s };
|
|
1113
|
-
const
|
|
1114
|
-
return
|
|
1131
|
+
const f = kt(n[c], e[c]), R = n[c] === void 0 && f === "";
|
|
1132
|
+
return se(s) && R ? o : { ...o, [a]: f };
|
|
1115
1133
|
}, {});
|
|
1116
1134
|
}
|
|
1117
|
-
function
|
|
1135
|
+
function fe(t) {
|
|
1118
1136
|
return (e, n, r) => {
|
|
1119
1137
|
if (I(e))
|
|
1120
|
-
return
|
|
1138
|
+
return ue(e, (n ?? {}).query);
|
|
1121
1139
|
const o = n ?? {}, a = r ?? {}, s = t.find((u) => u.key === e);
|
|
1122
1140
|
if (!s)
|
|
1123
|
-
throw new
|
|
1141
|
+
throw new Xe(String(e));
|
|
1124
1142
|
if (s.matched.disabled)
|
|
1125
|
-
throw new
|
|
1126
|
-
return
|
|
1143
|
+
throw new Ye(String(e));
|
|
1144
|
+
return dn(s, {
|
|
1127
1145
|
params: o,
|
|
1128
1146
|
query: a.query
|
|
1129
1147
|
});
|
|
1130
1148
|
};
|
|
1131
1149
|
}
|
|
1132
1150
|
function T(t) {
|
|
1133
|
-
return !t.startsWith("http") ?
|
|
1151
|
+
return !t.startsWith("http") ? yn(t) : gn(t);
|
|
1134
1152
|
}
|
|
1135
|
-
function
|
|
1153
|
+
function gn(t) {
|
|
1136
1154
|
const { protocol: e, host: n, pathname: r, search: o, searchParams: a, hash: s } = new URL(t, t);
|
|
1137
1155
|
return {
|
|
1138
1156
|
protocol: e,
|
|
@@ -1143,7 +1161,7 @@ function mn(t) {
|
|
|
1143
1161
|
hash: s
|
|
1144
1162
|
};
|
|
1145
1163
|
}
|
|
1146
|
-
function
|
|
1164
|
+
function yn(t) {
|
|
1147
1165
|
const { pathname: e, search: n, searchParams: r, hash: o } = new URL(t, "https://localhost");
|
|
1148
1166
|
return {
|
|
1149
1167
|
pathname: e,
|
|
@@ -1152,80 +1170,80 @@ function Rn(t) {
|
|
|
1152
1170
|
hash: o
|
|
1153
1171
|
};
|
|
1154
1172
|
}
|
|
1155
|
-
function
|
|
1173
|
+
function le(t) {
|
|
1156
1174
|
const e = new URLSearchParams(t);
|
|
1157
1175
|
return {
|
|
1158
1176
|
get: (n) => e.get(n),
|
|
1159
1177
|
getAll: (n) => e.getAll(n)
|
|
1160
1178
|
};
|
|
1161
1179
|
}
|
|
1162
|
-
const
|
|
1180
|
+
const vn = (t, e) => {
|
|
1163
1181
|
try {
|
|
1164
|
-
|
|
1182
|
+
he(t, e);
|
|
1165
1183
|
} catch {
|
|
1166
1184
|
return !1;
|
|
1167
1185
|
}
|
|
1168
1186
|
return !0;
|
|
1169
|
-
},
|
|
1187
|
+
}, he = (t, e) => {
|
|
1170
1188
|
const { pathname: n, search: r } = T(e);
|
|
1171
1189
|
return {
|
|
1172
|
-
...
|
|
1173
|
-
...
|
|
1190
|
+
...wn(t.path, n),
|
|
1191
|
+
...En(t.query, r)
|
|
1174
1192
|
};
|
|
1175
1193
|
};
|
|
1176
|
-
function
|
|
1194
|
+
function wn(t, e) {
|
|
1177
1195
|
const n = {}, r = decodeURIComponent(e);
|
|
1178
1196
|
for (const [o, a] of Object.entries(t.params)) {
|
|
1179
|
-
const s =
|
|
1197
|
+
const s = ce(r, t.toString(), o), c = St(s, a);
|
|
1180
1198
|
n[o] = c;
|
|
1181
1199
|
}
|
|
1182
1200
|
return n;
|
|
1183
1201
|
}
|
|
1184
|
-
function
|
|
1202
|
+
function En(t, e) {
|
|
1185
1203
|
const n = {}, r = new URLSearchParams(e);
|
|
1186
1204
|
for (const [o, a] of Object.entries(t.params)) {
|
|
1187
|
-
const s = r.get(o) ?? void 0, c =
|
|
1205
|
+
const s = r.get(o) ?? void 0, c = St(s, a);
|
|
1188
1206
|
n[o] = c;
|
|
1189
1207
|
}
|
|
1190
1208
|
return n;
|
|
1191
1209
|
}
|
|
1192
|
-
const
|
|
1210
|
+
const bn = (t) => "name" in t.matched && !!t.matched.name, Pn = (t, e) => {
|
|
1193
1211
|
const { host: n } = T(e), { host: r } = T(t.path.toString());
|
|
1194
1212
|
return n === r;
|
|
1195
|
-
},
|
|
1213
|
+
}, Sn = (t, e) => {
|
|
1196
1214
|
const { pathname: n } = T(e);
|
|
1197
|
-
return
|
|
1198
|
-
},
|
|
1215
|
+
return an(t).test(n);
|
|
1216
|
+
}, kn = (t, e) => {
|
|
1199
1217
|
const { search: n } = T(e);
|
|
1200
|
-
return
|
|
1218
|
+
return sn(t).every((o) => o.test(n));
|
|
1201
1219
|
};
|
|
1202
|
-
function
|
|
1220
|
+
function xn(t) {
|
|
1203
1221
|
const { searchParams: e, pathname: n } = T(t), r = -1, o = 1;
|
|
1204
1222
|
return (a, s) => {
|
|
1205
|
-
const c =
|
|
1206
|
-
return c + u >
|
|
1223
|
+
const c = Vt(a, e), u = jt(a, n), f = Vt(s, e), R = jt(s, n);
|
|
1224
|
+
return c + u > f + R ? r : c + u < f + R ? o : a.depth > s.depth ? r : a.depth < s.depth ? o : 0;
|
|
1207
1225
|
};
|
|
1208
1226
|
}
|
|
1209
|
-
function
|
|
1210
|
-
const n = Object.entries(t.path.params).filter(([, o]) =>
|
|
1227
|
+
function jt(t, e) {
|
|
1228
|
+
const n = Object.entries(t.path.params).filter(([, o]) => bt(o)).map(([o]) => o), r = n.filter((o) => ce(e, t.path.toString(), o) === void 0);
|
|
1211
1229
|
return n.length - r.length;
|
|
1212
1230
|
}
|
|
1213
|
-
function
|
|
1231
|
+
function Vt(t, e) {
|
|
1214
1232
|
const n = new URLSearchParams(t.query.toString()), r = Array.from(n.keys()), o = r.filter((a) => !e.has(a));
|
|
1215
1233
|
return r.length - o.length;
|
|
1216
1234
|
}
|
|
1217
|
-
const
|
|
1218
|
-
vn,
|
|
1219
|
-
En,
|
|
1235
|
+
const An = [
|
|
1220
1236
|
bn,
|
|
1221
1237
|
Pn,
|
|
1222
|
-
|
|
1238
|
+
Sn,
|
|
1239
|
+
kn,
|
|
1240
|
+
vn
|
|
1223
1241
|
];
|
|
1224
|
-
function
|
|
1225
|
-
const n =
|
|
1242
|
+
function pe(t, e) {
|
|
1243
|
+
const n = xn(e), r = t.filter((u) => An.every((f) => f(u, e))).sort(n);
|
|
1226
1244
|
if (r.length === 0)
|
|
1227
1245
|
return;
|
|
1228
|
-
const [o] = r, { search: a } = T(e), s =
|
|
1246
|
+
const [o] = r, { search: a } = T(e), s = le(a), c = he(o, e);
|
|
1229
1247
|
return ct({
|
|
1230
1248
|
matched: o.matched,
|
|
1231
1249
|
matches: o.matches,
|
|
@@ -1234,18 +1252,18 @@ function he(t, e) {
|
|
|
1234
1252
|
params: c
|
|
1235
1253
|
});
|
|
1236
1254
|
}
|
|
1237
|
-
function
|
|
1255
|
+
function Ln(t) {
|
|
1238
1256
|
return (e, n = {}) => {
|
|
1239
|
-
const o =
|
|
1240
|
-
return
|
|
1257
|
+
const o = fe(t)(e, n);
|
|
1258
|
+
return pe(t, o);
|
|
1241
1259
|
};
|
|
1242
1260
|
}
|
|
1243
|
-
function
|
|
1261
|
+
function de() {
|
|
1244
1262
|
return typeof window < "u" && typeof window.document < "u";
|
|
1245
1263
|
}
|
|
1246
|
-
function
|
|
1247
|
-
const n =
|
|
1248
|
-
if (
|
|
1264
|
+
function Un({ mode: t, listener: e }) {
|
|
1265
|
+
const n = Bn(t), r = (u, f) => {
|
|
1266
|
+
if (f != null && f.replace)
|
|
1249
1267
|
return n.replace(u);
|
|
1250
1268
|
n.push(u);
|
|
1251
1269
|
}, o = () => {
|
|
@@ -1265,38 +1283,38 @@ function An({ mode: t, listener: e }) {
|
|
|
1265
1283
|
}
|
|
1266
1284
|
};
|
|
1267
1285
|
}
|
|
1268
|
-
function
|
|
1286
|
+
function Bn(t = "auto") {
|
|
1269
1287
|
switch (t) {
|
|
1270
1288
|
case "auto":
|
|
1271
|
-
return
|
|
1289
|
+
return de() ? Ht() : Nt();
|
|
1272
1290
|
case "browser":
|
|
1273
|
-
return
|
|
1291
|
+
return Ht();
|
|
1274
1292
|
case "memory":
|
|
1275
|
-
return
|
|
1293
|
+
return Nt();
|
|
1276
1294
|
case "hash":
|
|
1277
|
-
return
|
|
1295
|
+
return Ge();
|
|
1278
1296
|
default:
|
|
1279
1297
|
const e = t;
|
|
1280
1298
|
throw new Error(`Switch is not exhaustive for mode: ${e}`);
|
|
1281
1299
|
}
|
|
1282
1300
|
}
|
|
1283
|
-
function
|
|
1284
|
-
return it(() => () =>
|
|
1301
|
+
function Hn(t) {
|
|
1302
|
+
return it(() => () => Tt("h1", t), {
|
|
1285
1303
|
name: t,
|
|
1286
1304
|
props: []
|
|
1287
1305
|
});
|
|
1288
1306
|
}
|
|
1289
|
-
const
|
|
1290
|
-
function
|
|
1307
|
+
const Ct = Symbol();
|
|
1308
|
+
function Nn({
|
|
1291
1309
|
rejections: t
|
|
1292
1310
|
}) {
|
|
1293
1311
|
const e = (s) => {
|
|
1294
1312
|
const c = {
|
|
1295
1313
|
...t
|
|
1296
1314
|
};
|
|
1297
|
-
return
|
|
1315
|
+
return pt(c[s] ?? Hn(s));
|
|
1298
1316
|
}, n = (s) => {
|
|
1299
|
-
const c =
|
|
1317
|
+
const c = pt(e(s)), u = {
|
|
1300
1318
|
name: s,
|
|
1301
1319
|
path: "",
|
|
1302
1320
|
component: c,
|
|
@@ -1306,18 +1324,18 @@ function Un({
|
|
|
1306
1324
|
matched: u,
|
|
1307
1325
|
matches: [u],
|
|
1308
1326
|
key: s,
|
|
1309
|
-
query:
|
|
1327
|
+
query: le(""),
|
|
1310
1328
|
params: {},
|
|
1311
|
-
[
|
|
1329
|
+
[Ct]: !0
|
|
1312
1330
|
});
|
|
1313
|
-
}, r = (s) => s[
|
|
1331
|
+
}, r = (s) => s[Ct] === !0, o = (s) => {
|
|
1314
1332
|
if (!s) {
|
|
1315
1333
|
a.value = null;
|
|
1316
1334
|
return;
|
|
1317
1335
|
}
|
|
1318
1336
|
const c = e(s);
|
|
1319
1337
|
a.value = { type: s, component: c };
|
|
1320
|
-
}, a =
|
|
1338
|
+
}, a = Ue(null);
|
|
1321
1339
|
return {
|
|
1322
1340
|
setRejection: o,
|
|
1323
1341
|
rejection: a,
|
|
@@ -1325,37 +1343,37 @@ function Un({
|
|
|
1325
1343
|
isRejectionRoute: r
|
|
1326
1344
|
};
|
|
1327
1345
|
}
|
|
1328
|
-
class
|
|
1346
|
+
class $n extends Error {
|
|
1329
1347
|
constructor() {
|
|
1330
1348
|
super("initialUrl must be set if window.location is unavailable");
|
|
1331
1349
|
}
|
|
1332
1350
|
}
|
|
1333
|
-
function
|
|
1351
|
+
function jn(t) {
|
|
1334
1352
|
if (t)
|
|
1335
1353
|
return t;
|
|
1336
|
-
if (
|
|
1354
|
+
if (de())
|
|
1337
1355
|
return window.location.toString();
|
|
1338
|
-
throw new
|
|
1356
|
+
throw new $n();
|
|
1339
1357
|
}
|
|
1340
|
-
function
|
|
1341
|
-
const n =
|
|
1358
|
+
function Xn(t, e = {}) {
|
|
1359
|
+
const n = fe(t), r = Un({
|
|
1342
1360
|
mode: e.historyMode,
|
|
1343
1361
|
listener: () => {
|
|
1344
1362
|
const g = M(location);
|
|
1345
1363
|
p(g);
|
|
1346
1364
|
}
|
|
1347
|
-
}), { runBeforeRouteHooks: o, runAfterRouteHooks: a } =
|
|
1365
|
+
}), { runBeforeRouteHooks: o, runAfterRouteHooks: a } = De(), {
|
|
1348
1366
|
hooks: s,
|
|
1349
1367
|
onBeforeRouteEnter: c,
|
|
1350
1368
|
onAfterRouteUpdate: u,
|
|
1351
|
-
onBeforeRouteLeave:
|
|
1369
|
+
onBeforeRouteLeave: f,
|
|
1352
1370
|
onAfterRouteEnter: R,
|
|
1353
|
-
onBeforeRouteUpdate:
|
|
1371
|
+
onBeforeRouteUpdate: d,
|
|
1354
1372
|
onAfterRouteLeave: A
|
|
1355
|
-
} =
|
|
1373
|
+
} = Te();
|
|
1356
1374
|
async function p(g, { replace: P } = {}) {
|
|
1357
1375
|
r.stopListening();
|
|
1358
|
-
const x =
|
|
1376
|
+
const x = pe(t, g) ?? y("NotFound"), C = { ...b }, q = await o({ to: x, from: C, hooks: s });
|
|
1359
1377
|
switch (q.status) {
|
|
1360
1378
|
case "ABORT":
|
|
1361
1379
|
return;
|
|
@@ -1363,89 +1381,89 @@ function Gn(t, e = {}) {
|
|
|
1363
1381
|
r.update(g, { replace: P }), await S(...q.to);
|
|
1364
1382
|
return;
|
|
1365
1383
|
case "REJECT":
|
|
1366
|
-
r.update(g, { replace: P }),
|
|
1384
|
+
r.update(g, { replace: P }), U(q.type), i(x);
|
|
1367
1385
|
break;
|
|
1368
1386
|
case "SUCCESS":
|
|
1369
|
-
r.update(g, { replace: P }),
|
|
1387
|
+
r.update(g, { replace: P }), U(null), i(x);
|
|
1370
1388
|
break;
|
|
1371
1389
|
default:
|
|
1372
1390
|
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(q)}`);
|
|
1373
1391
|
}
|
|
1374
|
-
const
|
|
1375
|
-
switch (
|
|
1392
|
+
const O = await a({ to: x, from: C, hooks: s });
|
|
1393
|
+
switch (O.status) {
|
|
1376
1394
|
case "PUSH":
|
|
1377
|
-
await S(...
|
|
1395
|
+
await S(...O.to);
|
|
1378
1396
|
break;
|
|
1379
1397
|
case "REJECT":
|
|
1380
|
-
|
|
1398
|
+
U(O.type);
|
|
1381
1399
|
break;
|
|
1382
1400
|
case "SUCCESS":
|
|
1383
1401
|
break;
|
|
1384
1402
|
default:
|
|
1385
|
-
const X =
|
|
1403
|
+
const X = O;
|
|
1386
1404
|
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(X)}`);
|
|
1387
1405
|
}
|
|
1388
1406
|
r.startListening();
|
|
1389
1407
|
}
|
|
1390
1408
|
const S = (g, P, x) => {
|
|
1391
1409
|
if (I(g)) {
|
|
1392
|
-
const X = { ...P },
|
|
1393
|
-
return p(
|
|
1410
|
+
const X = { ...P }, ye = n(g, X);
|
|
1411
|
+
return p(ye, { replace: X.replace });
|
|
1394
1412
|
}
|
|
1395
|
-
const
|
|
1396
|
-
return p(
|
|
1397
|
-
},
|
|
1413
|
+
const C = { ...x }, O = n(g, P ?? {}, C);
|
|
1414
|
+
return p(O, { replace: C.replace });
|
|
1415
|
+
}, j = (g, P, x) => {
|
|
1398
1416
|
if (I(g)) {
|
|
1399
|
-
const
|
|
1400
|
-
return S(g,
|
|
1417
|
+
const O = { ...P, replace: !0 };
|
|
1418
|
+
return S(g, O);
|
|
1401
1419
|
}
|
|
1402
|
-
const
|
|
1403
|
-
return S(g,
|
|
1404
|
-
},
|
|
1420
|
+
const C = P ?? {}, q = { ...x, replace: !0 };
|
|
1421
|
+
return S(g, C, q);
|
|
1422
|
+
}, V = (g) => U(g), B = Ln(t), { setRejection: U, rejection: m, getRejectionRoute: y } = Nn(e), E = y("NotFound"), { currentRoute: b, routerRoute: h, updateRoute: i } = ze(E, S);
|
|
1405
1423
|
r.startListening();
|
|
1406
|
-
const
|
|
1407
|
-
function
|
|
1408
|
-
g.component("RouterView",
|
|
1424
|
+
const l = jn(e.initialUrl), v = p(l, { replace: !0 });
|
|
1425
|
+
function w(g) {
|
|
1426
|
+
g.component("RouterView", Yt), g.component("RouterLink", Fe), g.provide(Wt, k), g.provide(Ft, m), g.provide(Kt, s);
|
|
1409
1427
|
}
|
|
1410
1428
|
const k = {
|
|
1411
1429
|
route: h,
|
|
1412
1430
|
resolve: n,
|
|
1413
1431
|
push: S,
|
|
1414
|
-
replace:
|
|
1415
|
-
reject:
|
|
1416
|
-
find:
|
|
1432
|
+
replace: j,
|
|
1433
|
+
reject: V,
|
|
1434
|
+
find: B,
|
|
1417
1435
|
refresh: r.refresh,
|
|
1418
1436
|
forward: r.forward,
|
|
1419
1437
|
back: r.back,
|
|
1420
1438
|
go: r.go,
|
|
1421
|
-
install:
|
|
1422
|
-
initialized:
|
|
1439
|
+
install: w,
|
|
1440
|
+
initialized: v,
|
|
1423
1441
|
onBeforeRouteEnter: c,
|
|
1424
1442
|
onAfterRouteUpdate: u,
|
|
1425
|
-
onBeforeRouteLeave:
|
|
1443
|
+
onBeforeRouteLeave: f,
|
|
1426
1444
|
onAfterRouteEnter: R,
|
|
1427
|
-
onBeforeRouteUpdate:
|
|
1445
|
+
onBeforeRouteUpdate: d,
|
|
1428
1446
|
onAfterRouteLeave: A
|
|
1429
1447
|
};
|
|
1430
1448
|
return k;
|
|
1431
1449
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const n = new RegExp(`\\${
|
|
1450
|
+
function me(t, e) {
|
|
1451
|
+
const n = new RegExp(`\\${Q}\\??([\\w-_]+)\\${Y}`, "g");
|
|
1434
1452
|
return Array.from(t.matchAll(n)).reduce((o, [a, s]) => {
|
|
1435
|
-
const c = a.startsWith(`${
|
|
1453
|
+
const c = a.startsWith(`${Q}?`), u = rn(e, s);
|
|
1436
1454
|
if (s in o)
|
|
1437
1455
|
throw new ut(s);
|
|
1438
1456
|
return o[s] = c ? en(u) : u, o;
|
|
1439
1457
|
}, {});
|
|
1440
1458
|
}
|
|
1441
|
-
function
|
|
1459
|
+
function Re(t, e) {
|
|
1442
1460
|
return {
|
|
1443
1461
|
path: t,
|
|
1444
|
-
params:
|
|
1462
|
+
params: me(t, e),
|
|
1445
1463
|
toString: () => t
|
|
1446
1464
|
};
|
|
1447
1465
|
}
|
|
1448
|
-
function
|
|
1466
|
+
function Lt(t, e) {
|
|
1449
1467
|
const n = Object.keys(t), r = Object.keys(e), o = n.find((a) => r.includes(a));
|
|
1450
1468
|
return o ? {
|
|
1451
1469
|
key: o,
|
|
@@ -1455,61 +1473,61 @@ function xt(t, e) {
|
|
|
1455
1473
|
hasDuplicates: !1
|
|
1456
1474
|
};
|
|
1457
1475
|
}
|
|
1458
|
-
function
|
|
1459
|
-
const { hasDuplicates: n, key: r } =
|
|
1476
|
+
function Vn(t, e) {
|
|
1477
|
+
const { hasDuplicates: n, key: r } = Lt(t.params, e.params);
|
|
1460
1478
|
if (n)
|
|
1461
1479
|
throw new ut(r);
|
|
1462
|
-
return
|
|
1480
|
+
return Re(`${t.path}${e.path}`, { ...t.params, ...e.params });
|
|
1463
1481
|
}
|
|
1464
|
-
function
|
|
1482
|
+
function dt(t, e) {
|
|
1465
1483
|
return {
|
|
1466
1484
|
query: t,
|
|
1467
|
-
params:
|
|
1485
|
+
params: me(t, e),
|
|
1468
1486
|
toString: () => t
|
|
1469
1487
|
};
|
|
1470
1488
|
}
|
|
1471
|
-
function
|
|
1472
|
-
const { hasDuplicates: n, key: r } =
|
|
1489
|
+
function Cn(t, e) {
|
|
1490
|
+
const { hasDuplicates: n, key: r } = Lt(t.params, e.params);
|
|
1473
1491
|
if (n)
|
|
1474
1492
|
throw new ut(r);
|
|
1475
|
-
const o = [t.query, e.query].filter(
|
|
1476
|
-
return
|
|
1493
|
+
const o = [t.query, e.query].filter(Pt).join("&");
|
|
1494
|
+
return dt(o, { ...t.params, ...e.params });
|
|
1477
1495
|
}
|
|
1478
|
-
function
|
|
1496
|
+
function ge(t) {
|
|
1479
1497
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1480
1498
|
}
|
|
1481
|
-
function Cn(t) {
|
|
1482
|
-
return Re(t) && typeof t.path == "string";
|
|
1483
|
-
}
|
|
1484
1499
|
function On(t) {
|
|
1485
|
-
return
|
|
1486
|
-
}
|
|
1487
|
-
function Vn(t) {
|
|
1488
|
-
return Re(t) && typeof t.query == "string";
|
|
1500
|
+
return ge(t) && typeof t.path == "string";
|
|
1489
1501
|
}
|
|
1490
1502
|
function _n(t) {
|
|
1491
|
-
return
|
|
1503
|
+
return On(t) ? t : Re(t, {});
|
|
1504
|
+
}
|
|
1505
|
+
function qn(t) {
|
|
1506
|
+
return ge(t) && typeof t.query == "string";
|
|
1492
1507
|
}
|
|
1493
|
-
function
|
|
1508
|
+
function Dn(t) {
|
|
1509
|
+
return t === void 0 ? dt("", {}) : qn(t) ? t : dt(t, {});
|
|
1510
|
+
}
|
|
1511
|
+
function Zn(t) {
|
|
1494
1512
|
const e = t.reduce((n, r) => {
|
|
1495
|
-
const o =
|
|
1496
|
-
return
|
|
1513
|
+
const o = Mn(r);
|
|
1514
|
+
return zt(r) && n.push(...r.children.map((a) => ({
|
|
1497
1515
|
...a,
|
|
1498
|
-
key:
|
|
1499
|
-
path:
|
|
1500
|
-
query:
|
|
1516
|
+
key: It(o.key, a.key),
|
|
1517
|
+
path: Vn(o.path, a.path),
|
|
1518
|
+
query: Cn(o.query, a.query),
|
|
1501
1519
|
matches: [o.matched, ...a.matches],
|
|
1502
1520
|
depth: a.depth + 1
|
|
1503
1521
|
}))), n.push(o), n;
|
|
1504
1522
|
}, []);
|
|
1505
1523
|
return e.forEach(({ path: n, query: r }) => {
|
|
1506
|
-
const { hasDuplicates: o, key: a } =
|
|
1524
|
+
const { hasDuplicates: o, key: a } = Lt(n.params, r.params);
|
|
1507
1525
|
if (o)
|
|
1508
1526
|
throw new ut(a);
|
|
1509
1527
|
}), e;
|
|
1510
1528
|
}
|
|
1511
|
-
function
|
|
1512
|
-
const e =
|
|
1529
|
+
function Mn(t) {
|
|
1530
|
+
const e = Tn(t), n = _n(t.path), r = Dn(t.query), o = pt({ meta: {}, ...e });
|
|
1513
1531
|
return {
|
|
1514
1532
|
matched: o,
|
|
1515
1533
|
matches: [o],
|
|
@@ -1520,38 +1538,40 @@ function qn(t) {
|
|
|
1520
1538
|
disabled: t.disabled ?? !1
|
|
1521
1539
|
};
|
|
1522
1540
|
}
|
|
1523
|
-
function
|
|
1524
|
-
return Ie(t) ? { ...t, component:
|
|
1541
|
+
function Tn(t) {
|
|
1542
|
+
return Ie(t) ? { ...t, component: Yt } : t;
|
|
1525
1543
|
}
|
|
1526
1544
|
export {
|
|
1527
1545
|
ut as DuplicateParamsError,
|
|
1528
1546
|
Fe as RouterLink,
|
|
1529
|
-
|
|
1530
|
-
|
|
1547
|
+
mt as RouterNotInstalledError,
|
|
1548
|
+
Yt as RouterView,
|
|
1531
1549
|
Be as UseRouteInvalidError,
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1550
|
+
zn as component,
|
|
1551
|
+
Xn as createRouter,
|
|
1552
|
+
Zn as createRoutes,
|
|
1553
|
+
ft as isParamGetSet,
|
|
1554
|
+
tn as isParamGetter,
|
|
1555
|
+
nn as isParamWithDefault,
|
|
1556
|
+
zt as isParentRoute,
|
|
1538
1557
|
Ie as isParentRouteWithoutComponent,
|
|
1539
|
-
|
|
1558
|
+
Ve as isRoute,
|
|
1540
1559
|
Je as isRouteWithComponent,
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1560
|
+
Ke as isRouteWithComponents,
|
|
1561
|
+
Kn as onAfterRouteEnter,
|
|
1562
|
+
Qn as onAfterRouteLeave,
|
|
1563
|
+
Gn as onAfterRouteUpdate,
|
|
1564
|
+
In as onBeforeRouteLeave,
|
|
1565
|
+
Jn as onBeforeRouteUpdate,
|
|
1547
1566
|
Y as paramEnd,
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1567
|
+
Q as paramStart,
|
|
1568
|
+
Re as path,
|
|
1569
|
+
dt as query,
|
|
1570
|
+
Wt as routerInjectionKey,
|
|
1571
|
+
Ft as routerRejectionKey,
|
|
1572
|
+
He as useLink,
|
|
1573
|
+
Ne as useRejection,
|
|
1555
1574
|
Oe as useRoute,
|
|
1556
|
-
|
|
1575
|
+
Rt as useRouter,
|
|
1576
|
+
Yn as withDefault
|
|
1557
1577
|
};
|