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