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