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