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