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