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