@kitbag/router 0.18.2 → 0.20.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/dist/kitbag-router.d.ts +24 -9
- package/dist/kitbag-router.js +1659 -1505
- package/dist/kitbag-router.umd.cjs +3 -3
- package/package.json +12 -11
package/dist/kitbag-router.js
CHANGED
|
@@ -1,957 +1,1104 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var T = (
|
|
4
|
-
import { inject as
|
|
5
|
-
function M(
|
|
6
|
-
return typeof
|
|
1
|
+
var Cr = Object.defineProperty;
|
|
2
|
+
var Vr = (t, e, r) => e in t ? Cr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var T = (t, e, r) => Vr(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { inject as st, markRaw as Nt, reactive as Ht, defineAsyncComponent as Zr, watch as rt, onUnmounted as _t, computed as O, ref as qt, toValue as H, toRefs as Or, defineComponent as Rt, createElementBlock as jr, openBlock as Ze, normalizeClass as $r, renderSlot as Oe, normalizeProps as je, guardReactiveProps as Hr, unref as vt, h as pt, getCurrentInstance as _r, provide as qr, createCommentVNode as Ir, mergeProps as Jr, createBlock as Dr, resolveDynamicComponent as Fr } from "vue";
|
|
5
|
+
function M(t) {
|
|
6
|
+
return typeof t != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return M(
|
|
8
|
+
function $e(t) {
|
|
9
|
+
return M(t) ? t : `/${t}`;
|
|
10
10
|
}
|
|
11
|
-
class
|
|
11
|
+
class Tr extends Error {
|
|
12
12
|
/**
|
|
13
13
|
* Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
|
|
14
14
|
* @param paramName - The name of the parameter that was duplicated.
|
|
15
15
|
*/
|
|
16
|
-
constructor(
|
|
17
|
-
super(`Invalid Param "${
|
|
16
|
+
constructor(e) {
|
|
17
|
+
super(`Invalid Param "${e}": Router does not support multiple params by the same name. All param names must be unique.`);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
class
|
|
21
|
-
constructor(
|
|
22
|
-
super(`Child property on meta for ${
|
|
20
|
+
class Mr extends Error {
|
|
21
|
+
constructor(e) {
|
|
22
|
+
super(`Child property on meta for ${e} conflicts with the parent meta.`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
class
|
|
25
|
+
class wt extends Error {
|
|
26
26
|
constructor() {
|
|
27
27
|
super("Router not installed");
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
class
|
|
30
|
+
class Wr extends Error {
|
|
31
31
|
/**
|
|
32
32
|
* Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
|
|
33
33
|
* This detailed error message aids in quickly identifying and resolving mismatches in route usage.
|
|
34
34
|
* @param routeName - The route name that was incorrectly used.
|
|
35
35
|
* @param actualRouteName - The expected route name that should have been used.
|
|
36
36
|
*/
|
|
37
|
-
constructor(
|
|
38
|
-
super(`useRoute called with incorrect route. Given ${
|
|
37
|
+
constructor(e, r) {
|
|
38
|
+
super(`useRoute called with incorrect route. Given ${e}, expected ${r}`);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
45
|
-
throw new
|
|
46
|
-
return
|
|
41
|
+
const He = Symbol();
|
|
42
|
+
function ee() {
|
|
43
|
+
const t = st(He);
|
|
44
|
+
if (!t)
|
|
45
|
+
throw new wt();
|
|
46
|
+
return t;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
return Array.isArray(
|
|
48
|
+
function dt(t) {
|
|
49
|
+
return Array.isArray(t) ? t : [t];
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
51
|
+
function _e(t, e) {
|
|
52
|
+
return t.filter((r) => e === r).length;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
const
|
|
56
|
-
for (const r of
|
|
57
|
-
if (
|
|
58
|
-
throw new
|
|
54
|
+
function Et(...t) {
|
|
55
|
+
const e = t.flatMap((r) => Array.isArray(r) ? r : Object.keys(r));
|
|
56
|
+
for (const r of e)
|
|
57
|
+
if (_e(e, r) > 1)
|
|
58
|
+
throw new Tr(r);
|
|
59
59
|
}
|
|
60
|
-
class
|
|
60
|
+
class z extends Error {
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
function
|
|
64
|
-
return
|
|
62
|
+
const St = "[", It = "]";
|
|
63
|
+
function Gr(t) {
|
|
64
|
+
return t !== String && t !== Boolean && t !== Number && t !== Date;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return typeof
|
|
66
|
+
function zr(t) {
|
|
67
|
+
return typeof t == "function" && Gr(t);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return typeof
|
|
69
|
+
function Jt(t) {
|
|
70
|
+
return typeof t == "object" && "get" in t && typeof t.get == "function" && "set" in t && typeof t.set == "function";
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return typeof
|
|
72
|
+
function qe(t) {
|
|
73
|
+
return typeof t == "string" || typeof t == "number" || typeof t == "boolean";
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return
|
|
77
|
-
get: (r) =>
|
|
78
|
-
set: (r) =>
|
|
79
|
-
defaultValue:
|
|
75
|
+
function Qr(t, e) {
|
|
76
|
+
return Jt(t) ? { ...t, defaultValue: e ?? t.defaultValue } : {
|
|
77
|
+
get: (r) => nt(r, t),
|
|
78
|
+
set: (r) => ot(r, t),
|
|
79
|
+
defaultValue: e
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
return
|
|
82
|
+
function Kr(t) {
|
|
83
|
+
return Jt(t) && t.defaultValue !== void 0;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
85
|
+
function jo(t, e) {
|
|
86
|
+
return Qr(t, e);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
return typeof
|
|
88
|
+
function Lt(t) {
|
|
89
|
+
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return typeof
|
|
91
|
+
function W(t) {
|
|
92
|
+
return typeof t == "string" && t.length > 0;
|
|
93
93
|
}
|
|
94
|
-
let
|
|
95
|
-
async function
|
|
94
|
+
let E = null;
|
|
95
|
+
async function Yr() {
|
|
96
96
|
const {
|
|
97
|
-
ZodSchema:
|
|
98
|
-
ZodString:
|
|
97
|
+
ZodSchema: t,
|
|
98
|
+
ZodString: e,
|
|
99
99
|
ZodBoolean: r,
|
|
100
100
|
ZodDate: n,
|
|
101
101
|
ZodNumber: o,
|
|
102
102
|
ZodLiteral: a,
|
|
103
103
|
ZodObject: s,
|
|
104
|
-
ZodEnum:
|
|
105
|
-
ZodNativeEnum:
|
|
106
|
-
ZodArray:
|
|
107
|
-
ZodTuple:
|
|
108
|
-
ZodUnion:
|
|
104
|
+
ZodEnum: l,
|
|
105
|
+
ZodNativeEnum: d,
|
|
106
|
+
ZodArray: i,
|
|
107
|
+
ZodTuple: m,
|
|
108
|
+
ZodUnion: b,
|
|
109
109
|
ZodDiscriminatedUnion: U,
|
|
110
|
-
ZodRecord:
|
|
111
|
-
ZodMap:
|
|
112
|
-
ZodSet:
|
|
113
|
-
ZodIntersection:
|
|
114
|
-
ZodPromise:
|
|
115
|
-
ZodFunction:
|
|
110
|
+
ZodRecord: P,
|
|
111
|
+
ZodMap: w,
|
|
112
|
+
ZodSet: y,
|
|
113
|
+
ZodIntersection: p,
|
|
114
|
+
ZodPromise: R,
|
|
115
|
+
ZodFunction: f
|
|
116
116
|
} = await import("zod");
|
|
117
117
|
return {
|
|
118
|
-
ZodSchema:
|
|
119
|
-
ZodString:
|
|
118
|
+
ZodSchema: t,
|
|
119
|
+
ZodString: e,
|
|
120
120
|
ZodBoolean: r,
|
|
121
121
|
ZodDate: n,
|
|
122
122
|
ZodNumber: o,
|
|
123
123
|
ZodLiteral: a,
|
|
124
124
|
ZodObject: s,
|
|
125
|
-
ZodEnum:
|
|
126
|
-
ZodNativeEnum:
|
|
127
|
-
ZodArray:
|
|
128
|
-
ZodTuple:
|
|
129
|
-
ZodUnion:
|
|
125
|
+
ZodEnum: l,
|
|
126
|
+
ZodNativeEnum: d,
|
|
127
|
+
ZodArray: i,
|
|
128
|
+
ZodTuple: m,
|
|
129
|
+
ZodUnion: b,
|
|
130
130
|
ZodDiscriminatedUnion: U,
|
|
131
|
-
ZodRecord:
|
|
132
|
-
ZodMap:
|
|
133
|
-
ZodSet:
|
|
134
|
-
ZodIntersection:
|
|
135
|
-
ZodPromise:
|
|
136
|
-
ZodFunction:
|
|
131
|
+
ZodRecord: P,
|
|
132
|
+
ZodMap: w,
|
|
133
|
+
ZodSet: y,
|
|
134
|
+
ZodIntersection: p,
|
|
135
|
+
ZodPromise: R,
|
|
136
|
+
ZodFunction: f
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
return Object.values(
|
|
139
|
+
function Xr(t) {
|
|
140
|
+
return Object.values(t).some((e) => Object.values(e.host.params).some((r) => Wt(r)) || Object.values(e.path.params).some((r) => Wt(r)) || Object.values(e.query.params).some((r) => Wt(r)));
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
return typeof
|
|
142
|
+
function Wt(t) {
|
|
143
|
+
return typeof t == "object" && "parse" in t && typeof t.parse == "function";
|
|
144
144
|
}
|
|
145
|
-
async function
|
|
145
|
+
async function tn() {
|
|
146
146
|
try {
|
|
147
|
-
|
|
147
|
+
E = await Yr();
|
|
148
148
|
} catch {
|
|
149
149
|
throw new Error("Failed to initialize Zod");
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
152
|
+
function Ie(t) {
|
|
153
|
+
return E ? t instanceof E.ZodSchema : !1;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Je(t) {
|
|
156
156
|
return {
|
|
157
|
-
get: (
|
|
157
|
+
get: (e, { invalid: r }) => {
|
|
158
158
|
try {
|
|
159
|
-
return
|
|
159
|
+
return Qt(e, t);
|
|
160
160
|
} catch {
|
|
161
161
|
throw r();
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
|
-
set: (
|
|
164
|
+
set: (e, { invalid: r }) => {
|
|
165
165
|
try {
|
|
166
|
-
return
|
|
166
|
+
return Kt(e, t);
|
|
167
167
|
} catch {
|
|
168
168
|
throw r();
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
-
const
|
|
174
|
-
function
|
|
175
|
-
if (typeof
|
|
176
|
-
const r = new Date(
|
|
177
|
-
return isNaN(r.getTime()) ?
|
|
173
|
+
const en = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
174
|
+
function it(t, e) {
|
|
175
|
+
if (typeof e == "string" && en.test(e)) {
|
|
176
|
+
const r = new Date(e);
|
|
177
|
+
return isNaN(r.getTime()) ? e : r;
|
|
178
178
|
}
|
|
179
|
-
return
|
|
179
|
+
return e;
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
for (const
|
|
181
|
+
function ft(t) {
|
|
182
|
+
for (const e of t)
|
|
183
183
|
try {
|
|
184
|
-
return
|
|
184
|
+
return e();
|
|
185
185
|
} catch {
|
|
186
186
|
continue;
|
|
187
187
|
}
|
|
188
188
|
throw new Error("All functions failed");
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
return
|
|
190
|
+
function Ut(t, e) {
|
|
191
|
+
return E != null && E.ZodString && t instanceof E.ZodString ? 1 : E != null && E.ZodString && e instanceof E.ZodString ? -1 : 0;
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
if (!
|
|
193
|
+
function Qt(t, e) {
|
|
194
|
+
if (!E)
|
|
195
195
|
throw new Error("Zod is not initialized");
|
|
196
|
-
if (
|
|
197
|
-
return
|
|
198
|
-
if (
|
|
199
|
-
return
|
|
200
|
-
if (
|
|
201
|
-
return
|
|
202
|
-
if (
|
|
203
|
-
return
|
|
204
|
-
if (
|
|
205
|
-
return
|
|
206
|
-
() =>
|
|
207
|
-
() =>
|
|
208
|
-
() =>
|
|
196
|
+
if (e instanceof E.ZodString)
|
|
197
|
+
return e.parse(t);
|
|
198
|
+
if (e instanceof E.ZodBoolean)
|
|
199
|
+
return e.parse(!!t);
|
|
200
|
+
if (e instanceof E.ZodDate)
|
|
201
|
+
return e.parse(new Date(t));
|
|
202
|
+
if (e instanceof E.ZodNumber)
|
|
203
|
+
return e.parse(Number(t));
|
|
204
|
+
if (e instanceof E.ZodLiteral)
|
|
205
|
+
return ft([
|
|
206
|
+
() => e.parse(Number(t)),
|
|
207
|
+
() => e.parse(!!t),
|
|
208
|
+
() => e.parse(t)
|
|
209
209
|
]);
|
|
210
|
-
if (
|
|
211
|
-
return
|
|
212
|
-
if (
|
|
213
|
-
return
|
|
214
|
-
if (
|
|
215
|
-
return
|
|
216
|
-
() =>
|
|
217
|
-
() =>
|
|
210
|
+
if (e instanceof E.ZodObject)
|
|
211
|
+
return e.parse(JSON.parse(t, it));
|
|
212
|
+
if (e instanceof E.ZodEnum)
|
|
213
|
+
return e.parse(t);
|
|
214
|
+
if (e instanceof E.ZodNativeEnum)
|
|
215
|
+
return ft([
|
|
216
|
+
() => e.parse(Number(t)),
|
|
217
|
+
() => e.parse(t)
|
|
218
218
|
]);
|
|
219
|
-
if (
|
|
220
|
-
return
|
|
221
|
-
if (
|
|
222
|
-
const r = Array.from(
|
|
223
|
-
return
|
|
224
|
-
}
|
|
225
|
-
if (
|
|
226
|
-
const r = Array.from(
|
|
227
|
-
return
|
|
228
|
-
}
|
|
229
|
-
if (
|
|
230
|
-
return
|
|
231
|
-
if (
|
|
232
|
-
return
|
|
233
|
-
if (
|
|
234
|
-
return
|
|
235
|
-
if (
|
|
219
|
+
if (e instanceof E.ZodArray || e instanceof E.ZodTuple)
|
|
220
|
+
return e.parse(JSON.parse(t, it));
|
|
221
|
+
if (e instanceof E.ZodUnion) {
|
|
222
|
+
const r = Array.from(e._def.options).sort(Ut).map((n) => () => Qt(t, n));
|
|
223
|
+
return ft(r);
|
|
224
|
+
}
|
|
225
|
+
if (e instanceof E.ZodDiscriminatedUnion) {
|
|
226
|
+
const r = Array.from(e.options).sort(Ut).map((n) => () => Qt(t, n));
|
|
227
|
+
return ft(r);
|
|
228
|
+
}
|
|
229
|
+
if (e instanceof E.ZodRecord)
|
|
230
|
+
return e.parse(JSON.parse(t, it));
|
|
231
|
+
if (e instanceof E.ZodMap)
|
|
232
|
+
return e.parse(new Map(JSON.parse(t, it)));
|
|
233
|
+
if (e instanceof E.ZodSet)
|
|
234
|
+
return e.parse(new Set(JSON.parse(t, it)));
|
|
235
|
+
if (e instanceof E.ZodIntersection)
|
|
236
236
|
throw new Error("Intersection schemas are not supported");
|
|
237
|
-
if (
|
|
237
|
+
if (e instanceof E.ZodPromise)
|
|
238
238
|
throw new Error("Promise schemas are not supported");
|
|
239
|
-
if (
|
|
239
|
+
if (e instanceof E.ZodFunction)
|
|
240
240
|
throw new Error("Function schemas are not supported");
|
|
241
|
-
return
|
|
241
|
+
return e.parse(t);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
if (!
|
|
243
|
+
function Kt(t, e) {
|
|
244
|
+
if (!E)
|
|
245
245
|
throw new Error("Zod is not initialized");
|
|
246
|
-
if (
|
|
247
|
-
return
|
|
248
|
-
if (
|
|
249
|
-
return
|
|
250
|
-
if (
|
|
251
|
-
return
|
|
252
|
-
if (
|
|
253
|
-
return
|
|
254
|
-
if (
|
|
255
|
-
return
|
|
256
|
-
if (
|
|
257
|
-
return JSON.stringify(
|
|
258
|
-
if (
|
|
259
|
-
return
|
|
260
|
-
if (
|
|
261
|
-
return
|
|
262
|
-
if (
|
|
263
|
-
return JSON.stringify(
|
|
264
|
-
if (
|
|
265
|
-
const r = Array.from(
|
|
266
|
-
return
|
|
267
|
-
}
|
|
268
|
-
if (
|
|
269
|
-
const r = Array.from(
|
|
270
|
-
return
|
|
271
|
-
}
|
|
272
|
-
if (
|
|
273
|
-
return JSON.stringify(
|
|
274
|
-
if (
|
|
275
|
-
const r =
|
|
246
|
+
if (e instanceof E.ZodString)
|
|
247
|
+
return e.parse(t);
|
|
248
|
+
if (e instanceof E.ZodBoolean)
|
|
249
|
+
return e.parse(t).toString();
|
|
250
|
+
if (e instanceof E.ZodDate)
|
|
251
|
+
return e.parse(t).toISOString();
|
|
252
|
+
if (e instanceof E.ZodNumber)
|
|
253
|
+
return e.parse(Number(t)).toString();
|
|
254
|
+
if (e instanceof E.ZodLiteral)
|
|
255
|
+
return e.parse(t).toString();
|
|
256
|
+
if (e instanceof E.ZodObject)
|
|
257
|
+
return JSON.stringify(e.parse(t));
|
|
258
|
+
if (e instanceof E.ZodEnum)
|
|
259
|
+
return e.parse(t);
|
|
260
|
+
if (e instanceof E.ZodNativeEnum)
|
|
261
|
+
return e.parse(t).toString();
|
|
262
|
+
if (e instanceof E.ZodArray || e instanceof E.ZodTuple)
|
|
263
|
+
return JSON.stringify(e.parse(t));
|
|
264
|
+
if (e instanceof E.ZodUnion) {
|
|
265
|
+
const r = Array.from(e._def.options).sort(Ut).map((n) => () => Kt(t, n));
|
|
266
|
+
return ft(r);
|
|
267
|
+
}
|
|
268
|
+
if (e instanceof E.ZodDiscriminatedUnion) {
|
|
269
|
+
const r = Array.from(e.options).sort(Ut).map((n) => () => Kt(t, n));
|
|
270
|
+
return ft(r);
|
|
271
|
+
}
|
|
272
|
+
if (e instanceof E.ZodRecord)
|
|
273
|
+
return JSON.stringify(e.parse(t));
|
|
274
|
+
if (e instanceof E.ZodMap) {
|
|
275
|
+
const r = e.parse(t);
|
|
276
276
|
return JSON.stringify(Array.from(r.entries()));
|
|
277
277
|
}
|
|
278
|
-
if (
|
|
279
|
-
const r =
|
|
278
|
+
if (e instanceof E.ZodSet) {
|
|
279
|
+
const r = e.parse(t);
|
|
280
280
|
return JSON.stringify(Array.from(r.values()));
|
|
281
281
|
}
|
|
282
|
-
if (
|
|
282
|
+
if (e instanceof E.ZodIntersection)
|
|
283
283
|
throw new Error("Intersection schemas are not supported");
|
|
284
|
-
if (
|
|
284
|
+
if (e instanceof E.ZodPromise)
|
|
285
285
|
throw new Error("Promise schemas are not supported");
|
|
286
|
-
if (
|
|
286
|
+
if (e instanceof E.ZodFunction)
|
|
287
287
|
throw new Error("Function schemas are not supported");
|
|
288
|
-
return JSON.stringify(
|
|
288
|
+
return JSON.stringify(e.parse(t));
|
|
289
|
+
}
|
|
290
|
+
function re(t) {
|
|
291
|
+
return typeof t == "object" && t !== null && "then" in t;
|
|
292
|
+
}
|
|
293
|
+
function L(t, e) {
|
|
294
|
+
const r = t["~standard"].validate(e);
|
|
295
|
+
if (re(r))
|
|
296
|
+
throw new Error("Promise schemas are not supported");
|
|
297
|
+
if (r.issues)
|
|
298
|
+
throw new Error("Validation failed");
|
|
299
|
+
return r.value;
|
|
289
300
|
}
|
|
290
|
-
function
|
|
291
|
-
return
|
|
301
|
+
function rn(t) {
|
|
302
|
+
return Lt(t) && "type" in t && typeof t.type == "string" && "~standard" in t && Lt(t["~standard"]) && "vendor" in t["~standard"] && t["~standard"].vendor === "valibot";
|
|
303
|
+
}
|
|
304
|
+
function De(t) {
|
|
305
|
+
return rn(t);
|
|
306
|
+
}
|
|
307
|
+
function Fe(t) {
|
|
308
|
+
return {
|
|
309
|
+
get: (e, { invalid: r }) => {
|
|
310
|
+
try {
|
|
311
|
+
return Yt(e, t);
|
|
312
|
+
} catch {
|
|
313
|
+
throw r();
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
set: (e, { invalid: r }) => {
|
|
317
|
+
try {
|
|
318
|
+
return Xt(e, t);
|
|
319
|
+
} catch {
|
|
320
|
+
throw r();
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
};
|
|
292
324
|
}
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
|
|
325
|
+
const nn = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
326
|
+
function ct(t, e) {
|
|
327
|
+
if (typeof e == "string" && nn.test(e)) {
|
|
328
|
+
const r = new Date(e);
|
|
329
|
+
return isNaN(r.getTime()) ? e : r;
|
|
296
330
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
331
|
+
return e;
|
|
332
|
+
}
|
|
333
|
+
function lt(t) {
|
|
334
|
+
for (const e of t)
|
|
335
|
+
try {
|
|
336
|
+
return e();
|
|
337
|
+
} catch {
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
throw new Error("All functions failed");
|
|
341
|
+
}
|
|
342
|
+
function Bt(t, e) {
|
|
343
|
+
return t.type === "string" ? 1 : e.type === "string" ? -1 : 0;
|
|
344
|
+
}
|
|
345
|
+
function Yt(t, e) {
|
|
346
|
+
if (e.type === "boolean")
|
|
347
|
+
return L(e, !!t);
|
|
348
|
+
if (e.type === "date")
|
|
349
|
+
return L(e, new Date(t));
|
|
350
|
+
if (e.type === "number")
|
|
351
|
+
return L(e, Number(t));
|
|
352
|
+
if (e.type === "literal")
|
|
353
|
+
return lt([
|
|
354
|
+
() => L(e, Number(t)),
|
|
355
|
+
() => L(e, !!t),
|
|
356
|
+
() => L(e, t)
|
|
357
|
+
]);
|
|
358
|
+
if (e.type === "object")
|
|
359
|
+
return L(e, JSON.parse(t, ct));
|
|
360
|
+
if (e.type === "enum")
|
|
361
|
+
return lt([
|
|
362
|
+
() => L(e, Number(t)),
|
|
363
|
+
() => L(e, !!t),
|
|
364
|
+
() => L(e, t)
|
|
365
|
+
]);
|
|
366
|
+
if (e.type === "array" || e.type === "tuple")
|
|
367
|
+
return L(e, JSON.parse(t, ct));
|
|
368
|
+
if (e.type === "union" && "options" in e) {
|
|
369
|
+
const r = e.options.sort(Bt).map((n) => () => Yt(t, n));
|
|
370
|
+
return lt(r);
|
|
371
|
+
}
|
|
372
|
+
if (e.type === "variant" && "options" in e) {
|
|
373
|
+
const r = e.options.sort(Bt).map((n) => () => Yt(t, n));
|
|
374
|
+
return lt(r);
|
|
375
|
+
}
|
|
376
|
+
if (e.type === "record")
|
|
377
|
+
return L(e, JSON.parse(t, ct));
|
|
378
|
+
if (e.type === "map")
|
|
379
|
+
return L(e, new Map(JSON.parse(t, ct)));
|
|
380
|
+
if (e.type === "set")
|
|
381
|
+
return L(e, new Set(JSON.parse(t, ct)));
|
|
382
|
+
if (e.type === "intersection")
|
|
383
|
+
throw new Error("Intersection schemas are not supported");
|
|
384
|
+
if (e.type === "promise")
|
|
385
|
+
throw new Error("Promise schemas are not supported");
|
|
386
|
+
if (e.type === "function")
|
|
387
|
+
throw new Error("Function schemas are not supported");
|
|
388
|
+
return L(e, t);
|
|
389
|
+
}
|
|
390
|
+
function Xt(t, e) {
|
|
391
|
+
if (e.type === "string" || e.type === "boolean")
|
|
392
|
+
return L(e, t).toString();
|
|
393
|
+
if (e.type === "date")
|
|
394
|
+
return L(e, t).toISOString();
|
|
395
|
+
if (e.type === "number")
|
|
396
|
+
return L(e, Number(t)).toString();
|
|
397
|
+
if (e.type === "literal")
|
|
398
|
+
return L(e, t).toString();
|
|
399
|
+
if (e.type === "object")
|
|
400
|
+
return JSON.stringify(L(e, t));
|
|
401
|
+
if (e.type === "enum" || e.type === "nativeEnum")
|
|
402
|
+
return L(e, t).toString();
|
|
403
|
+
if (e.type === "array" || e.type === "tuple")
|
|
404
|
+
return JSON.stringify(L(e, t));
|
|
405
|
+
if (e.type === "union" && "options" in e) {
|
|
406
|
+
const r = e.options.sort(Bt).map((n) => () => Xt(t, n));
|
|
407
|
+
return lt(r);
|
|
408
|
+
}
|
|
409
|
+
if (e.type === "variant" && "options" in e) {
|
|
410
|
+
const r = e.options.sort(Bt).map((n) => () => Xt(t, n));
|
|
411
|
+
return lt(r);
|
|
412
|
+
}
|
|
413
|
+
if (e.type === "record")
|
|
414
|
+
return JSON.stringify(L(e, t));
|
|
415
|
+
if (e.type === "map") {
|
|
416
|
+
const r = L(e, t);
|
|
417
|
+
return JSON.stringify(Array.from(r.entries()));
|
|
303
418
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
419
|
+
if (e.type === "set") {
|
|
420
|
+
const r = L(e, t);
|
|
421
|
+
return JSON.stringify(Array.from(r.values()));
|
|
422
|
+
}
|
|
423
|
+
if (e.type === "intersection")
|
|
424
|
+
throw new Error("Intersection schemas are not supported");
|
|
425
|
+
if (e.type === "promise")
|
|
426
|
+
throw new Error("Promise schemas are not supported");
|
|
427
|
+
if (e.type === "function")
|
|
428
|
+
throw new Error("Function schemas are not supported");
|
|
429
|
+
return JSON.stringify(L(e, t));
|
|
430
|
+
}
|
|
431
|
+
function on(t, e) {
|
|
432
|
+
return t[e] ?? String;
|
|
433
|
+
}
|
|
434
|
+
const C = {
|
|
435
|
+
invalid: (t) => {
|
|
436
|
+
throw new z(t);
|
|
437
|
+
}
|
|
438
|
+
}, Te = {
|
|
439
|
+
get: (t) => t,
|
|
440
|
+
set: (t, { invalid: e }) => {
|
|
441
|
+
if (typeof t != "string")
|
|
442
|
+
throw e();
|
|
443
|
+
return t;
|
|
444
|
+
}
|
|
445
|
+
}, ne = {
|
|
446
|
+
get: (t, { invalid: e }) => {
|
|
447
|
+
if (t === "true")
|
|
307
448
|
return !0;
|
|
308
|
-
if (
|
|
449
|
+
if (t === "false")
|
|
309
450
|
return !1;
|
|
310
|
-
throw
|
|
451
|
+
throw e();
|
|
311
452
|
},
|
|
312
|
-
set: (
|
|
313
|
-
if (typeof
|
|
314
|
-
throw
|
|
315
|
-
return
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
get: (
|
|
319
|
-
const r = Number(
|
|
453
|
+
set: (t, { invalid: e }) => {
|
|
454
|
+
if (typeof t != "boolean")
|
|
455
|
+
throw e();
|
|
456
|
+
return t.toString();
|
|
457
|
+
}
|
|
458
|
+
}, oe = {
|
|
459
|
+
get: (t, { invalid: e }) => {
|
|
460
|
+
const r = Number(t);
|
|
320
461
|
if (isNaN(r))
|
|
321
|
-
throw
|
|
462
|
+
throw e();
|
|
322
463
|
return r;
|
|
323
464
|
},
|
|
324
|
-
set: (
|
|
325
|
-
if (typeof
|
|
326
|
-
throw
|
|
327
|
-
return
|
|
465
|
+
set: (t, { invalid: e }) => {
|
|
466
|
+
if (typeof t != "number")
|
|
467
|
+
throw e();
|
|
468
|
+
return t.toString();
|
|
328
469
|
}
|
|
329
|
-
},
|
|
330
|
-
get: (
|
|
331
|
-
const r = new Date(
|
|
470
|
+
}, Me = {
|
|
471
|
+
get: (t, { invalid: e }) => {
|
|
472
|
+
const r = new Date(t);
|
|
332
473
|
if (isNaN(r.getTime()))
|
|
333
|
-
throw
|
|
474
|
+
throw e();
|
|
334
475
|
return r;
|
|
335
476
|
},
|
|
336
|
-
set: (
|
|
337
|
-
if (typeof
|
|
338
|
-
throw
|
|
339
|
-
return
|
|
477
|
+
set: (t, { invalid: e }) => {
|
|
478
|
+
if (typeof t != "object" || !(t instanceof Date))
|
|
479
|
+
throw e();
|
|
480
|
+
return t.toISOString();
|
|
340
481
|
}
|
|
341
|
-
},
|
|
342
|
-
get: (
|
|
482
|
+
}, We = {
|
|
483
|
+
get: (t, { invalid: e }) => {
|
|
343
484
|
try {
|
|
344
|
-
return JSON.parse(
|
|
485
|
+
return JSON.parse(t);
|
|
345
486
|
} catch {
|
|
346
|
-
throw
|
|
487
|
+
throw e();
|
|
347
488
|
}
|
|
348
489
|
},
|
|
349
|
-
set: (
|
|
490
|
+
set: (t, { invalid: e }) => {
|
|
350
491
|
try {
|
|
351
|
-
return JSON.stringify(
|
|
492
|
+
return JSON.stringify(t);
|
|
352
493
|
} catch {
|
|
353
|
-
throw
|
|
494
|
+
throw e();
|
|
354
495
|
}
|
|
355
496
|
}
|
|
356
497
|
};
|
|
357
|
-
function
|
|
358
|
-
switch (typeof
|
|
498
|
+
function an(t, e) {
|
|
499
|
+
switch (typeof e) {
|
|
359
500
|
case "string":
|
|
360
|
-
return
|
|
501
|
+
return Te.get(t, C) === e;
|
|
361
502
|
case "number":
|
|
362
|
-
return
|
|
503
|
+
return oe.get(t, C) === e;
|
|
363
504
|
case "boolean":
|
|
364
|
-
return
|
|
505
|
+
return ne.get(t, C) === e;
|
|
365
506
|
default:
|
|
366
507
|
return !1;
|
|
367
508
|
}
|
|
368
509
|
}
|
|
369
|
-
function
|
|
370
|
-
if (
|
|
371
|
-
if (
|
|
372
|
-
return
|
|
510
|
+
function nt(t, e, r = !1) {
|
|
511
|
+
if (t === void 0 || !W(t)) {
|
|
512
|
+
if (Kr(e))
|
|
513
|
+
return e.defaultValue;
|
|
373
514
|
if (r)
|
|
374
515
|
return;
|
|
375
|
-
throw new
|
|
376
|
-
}
|
|
377
|
-
if (
|
|
378
|
-
return
|
|
379
|
-
if (
|
|
380
|
-
return
|
|
381
|
-
if (
|
|
382
|
-
return
|
|
383
|
-
if (
|
|
384
|
-
return
|
|
385
|
-
if (
|
|
386
|
-
return
|
|
387
|
-
if (
|
|
388
|
-
return t
|
|
389
|
-
if (
|
|
390
|
-
return
|
|
391
|
-
if (
|
|
392
|
-
if (
|
|
393
|
-
return e;
|
|
394
|
-
throw new G();
|
|
395
|
-
}
|
|
396
|
-
if (Vt(t)) {
|
|
397
|
-
if (Qr(e, t))
|
|
516
|
+
throw new z();
|
|
517
|
+
}
|
|
518
|
+
if (e === String)
|
|
519
|
+
return Te.get(t, C);
|
|
520
|
+
if (e === Boolean)
|
|
521
|
+
return ne.get(t, C);
|
|
522
|
+
if (e === Number)
|
|
523
|
+
return oe.get(t, C);
|
|
524
|
+
if (e === Date)
|
|
525
|
+
return Me.get(t, C);
|
|
526
|
+
if (e === JSON)
|
|
527
|
+
return We.get(t, C);
|
|
528
|
+
if (zr(e))
|
|
529
|
+
return e(t, C);
|
|
530
|
+
if (Jt(e))
|
|
531
|
+
return e.get(t, C);
|
|
532
|
+
if (e instanceof RegExp) {
|
|
533
|
+
if (e.test(t))
|
|
398
534
|
return t;
|
|
399
|
-
throw new
|
|
535
|
+
throw new z();
|
|
536
|
+
}
|
|
537
|
+
if (qe(e)) {
|
|
538
|
+
if (an(t, e))
|
|
539
|
+
return e;
|
|
540
|
+
throw new z();
|
|
400
541
|
}
|
|
401
|
-
return
|
|
542
|
+
return Ie(e) ? Je(e).get(t, C) : De(e) ? Fe(e).get(t, C) : t;
|
|
402
543
|
}
|
|
403
|
-
function
|
|
544
|
+
function sn(t, e, r = !1) {
|
|
404
545
|
try {
|
|
405
|
-
return
|
|
546
|
+
return nt(t, e, r);
|
|
406
547
|
} catch (n) {
|
|
407
|
-
if (n instanceof
|
|
548
|
+
if (n instanceof z)
|
|
408
549
|
return;
|
|
409
550
|
throw n;
|
|
410
551
|
}
|
|
411
552
|
}
|
|
412
|
-
function
|
|
553
|
+
function cn(t, e, r = !1) {
|
|
413
554
|
try {
|
|
414
|
-
return
|
|
555
|
+
return ot(t, e, r);
|
|
415
556
|
} catch (n) {
|
|
416
|
-
if (n instanceof
|
|
557
|
+
if (n instanceof z)
|
|
417
558
|
return;
|
|
418
559
|
throw n;
|
|
419
560
|
}
|
|
420
561
|
}
|
|
421
|
-
function
|
|
422
|
-
if (
|
|
562
|
+
function ot(t, e, r = !1) {
|
|
563
|
+
if (t === void 0) {
|
|
423
564
|
if (r)
|
|
424
565
|
return "";
|
|
425
|
-
throw new
|
|
426
|
-
}
|
|
427
|
-
if (
|
|
428
|
-
return
|
|
429
|
-
if (
|
|
430
|
-
return
|
|
431
|
-
if (
|
|
432
|
-
return
|
|
433
|
-
if (
|
|
434
|
-
return
|
|
435
|
-
if (
|
|
436
|
-
return
|
|
437
|
-
if (
|
|
438
|
-
if (
|
|
439
|
-
throw new
|
|
440
|
-
return
|
|
441
|
-
}
|
|
442
|
-
if (
|
|
443
|
-
return
|
|
566
|
+
throw new z();
|
|
567
|
+
}
|
|
568
|
+
if (e === Boolean)
|
|
569
|
+
return ne.set(t, C);
|
|
570
|
+
if (e === Number)
|
|
571
|
+
return oe.set(t, C);
|
|
572
|
+
if (e === Date)
|
|
573
|
+
return Me.set(t, C);
|
|
574
|
+
if (e === JSON)
|
|
575
|
+
return We.set(t, C);
|
|
576
|
+
if (Jt(e))
|
|
577
|
+
return e.set(t, C);
|
|
578
|
+
if (qe(e)) {
|
|
579
|
+
if (e !== t)
|
|
580
|
+
throw new z();
|
|
581
|
+
return t.toString();
|
|
582
|
+
}
|
|
583
|
+
if (Ie(e))
|
|
584
|
+
return Je(e).set(t, C);
|
|
585
|
+
if (De(e))
|
|
586
|
+
return Fe(e).set(t, C);
|
|
444
587
|
try {
|
|
445
|
-
return
|
|
588
|
+
return t.toString();
|
|
446
589
|
} catch {
|
|
447
|
-
throw new
|
|
590
|
+
throw new z();
|
|
448
591
|
}
|
|
449
592
|
}
|
|
450
|
-
function
|
|
451
|
-
return
|
|
593
|
+
function ae(t) {
|
|
594
|
+
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
452
595
|
}
|
|
453
|
-
function
|
|
454
|
-
const r = Array.from(
|
|
596
|
+
function un(t, e) {
|
|
597
|
+
const r = Array.from(t.matchAll(e));
|
|
455
598
|
if (r.length === 0)
|
|
456
|
-
return [
|
|
599
|
+
return [t];
|
|
457
600
|
let n = 0;
|
|
458
|
-
const o = r.reduce((s,
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
const [
|
|
462
|
-
return s.push(
|
|
463
|
-
}, []), a =
|
|
601
|
+
const o = r.reduce((s, l) => {
|
|
602
|
+
const d = ae(t.slice(n, l.index));
|
|
603
|
+
d.length && s.push(d);
|
|
604
|
+
const [i] = l;
|
|
605
|
+
return s.push(i), n = l.index + i.length, s;
|
|
606
|
+
}, []), a = t.slice(n);
|
|
464
607
|
return a && o.push(a), o;
|
|
465
608
|
}
|
|
466
|
-
function
|
|
467
|
-
const
|
|
468
|
-
return new RegExp(`^${
|
|
609
|
+
function fn(t) {
|
|
610
|
+
const e = Ge(t.path.value);
|
|
611
|
+
return new RegExp(`^${e}$`, "i");
|
|
469
612
|
}
|
|
470
|
-
function
|
|
471
|
-
const
|
|
472
|
-
return Array.from(
|
|
473
|
-
const o =
|
|
474
|
-
return new RegExp(`${
|
|
613
|
+
function ln(t) {
|
|
614
|
+
const e = new URLSearchParams(t.query.value);
|
|
615
|
+
return Array.from(e.entries()).filter(([, r]) => !ie(r)).map(([r, n]) => {
|
|
616
|
+
const o = Ge(n);
|
|
617
|
+
return new RegExp(`${ae(r)}=${o}(&|$)`, "i");
|
|
475
618
|
});
|
|
476
619
|
}
|
|
477
|
-
function
|
|
478
|
-
return
|
|
620
|
+
function Ge(t) {
|
|
621
|
+
return un(t, new RegExp(Dt, "g")).map((e) => e.startsWith(St) ? ze(e) : ae(e)).join("");
|
|
479
622
|
}
|
|
480
|
-
function
|
|
481
|
-
return
|
|
623
|
+
function ze(t) {
|
|
624
|
+
return t.replace(new RegExp(Dt, "g"), ".+");
|
|
482
625
|
}
|
|
483
|
-
function
|
|
484
|
-
const r =
|
|
485
|
-
return
|
|
626
|
+
function pn(t, e) {
|
|
627
|
+
const r = Qe(e);
|
|
628
|
+
return t.replace(r, "(.*)");
|
|
486
629
|
}
|
|
487
|
-
function
|
|
488
|
-
return
|
|
630
|
+
function se(t, e) {
|
|
631
|
+
return hn(e).test(t.value);
|
|
489
632
|
}
|
|
490
|
-
function
|
|
491
|
-
return new RegExp(
|
|
633
|
+
function ie(t) {
|
|
634
|
+
return new RegExp(dn, "g").test(t);
|
|
492
635
|
}
|
|
493
|
-
const
|
|
494
|
-
function
|
|
495
|
-
const [
|
|
496
|
-
return
|
|
636
|
+
const Dt = `\\${St}\\??([\\w-_]+)\\${It}`, dn = `\\${St}\\?([\\w-_]+)\\${It}`;
|
|
637
|
+
function ce(t) {
|
|
638
|
+
const [e] = Ke(t, new RegExp(Dt, "g"));
|
|
639
|
+
return e;
|
|
497
640
|
}
|
|
498
|
-
function
|
|
499
|
-
return new RegExp(`\\${
|
|
641
|
+
function Qe(t) {
|
|
642
|
+
return new RegExp(`\\${St}\\??${t}\\${It}`, "g");
|
|
500
643
|
}
|
|
501
|
-
function
|
|
502
|
-
return new RegExp(`\\${
|
|
644
|
+
function hn(t) {
|
|
645
|
+
return new RegExp(`\\${St}\\?${t}\\${It}`, "g");
|
|
503
646
|
}
|
|
504
|
-
function
|
|
505
|
-
return Array.from(
|
|
647
|
+
function Ke(t, e) {
|
|
648
|
+
return Array.from(t.matchAll(e)).flatMap(([, ...n]) => n.map((o) => W(o) ? o : ""));
|
|
506
649
|
}
|
|
507
|
-
function
|
|
508
|
-
return
|
|
509
|
-
const s =
|
|
650
|
+
function yn(t = "", e = {}) {
|
|
651
|
+
return W(t) ? Array.from(t.matchAll(new RegExp(Dt, "g"))).reduce((n, [o, a]) => {
|
|
652
|
+
const s = ce(o);
|
|
510
653
|
if (!s)
|
|
511
654
|
return n;
|
|
512
|
-
const
|
|
513
|
-
return
|
|
655
|
+
const l = on(e, s);
|
|
656
|
+
return Et([s], n), n[a] = l, n;
|
|
514
657
|
}, {}) : {};
|
|
515
658
|
}
|
|
516
|
-
function
|
|
517
|
-
return
|
|
659
|
+
function mn(t) {
|
|
660
|
+
return Lt(t) && typeof t.value == "string";
|
|
518
661
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
662
|
+
function X(t) {
|
|
663
|
+
return t === void 0 ? Q() : mn(t) ? t : Q(t, {});
|
|
521
664
|
}
|
|
522
|
-
function
|
|
665
|
+
function Q(t, e) {
|
|
523
666
|
return {
|
|
524
|
-
value:
|
|
525
|
-
params:
|
|
667
|
+
value: t ?? "",
|
|
668
|
+
params: yn(t, e)
|
|
526
669
|
};
|
|
527
670
|
}
|
|
528
|
-
function
|
|
529
|
-
|
|
530
|
-
const r = `${
|
|
531
|
-
return
|
|
671
|
+
function Ye(t, e) {
|
|
672
|
+
Et(t.params, e.params);
|
|
673
|
+
const r = `${t.value}${e.value}`;
|
|
674
|
+
return Q(r, { ...t.params, ...e.params });
|
|
532
675
|
}
|
|
533
|
-
function
|
|
534
|
-
return
|
|
676
|
+
function gn(t, e) {
|
|
677
|
+
return Ye(t, e);
|
|
535
678
|
}
|
|
536
|
-
function
|
|
537
|
-
return
|
|
679
|
+
function Rn(t, e) {
|
|
680
|
+
return wn(t, e), { ...t, ...e };
|
|
538
681
|
}
|
|
539
|
-
function
|
|
540
|
-
const r = Object.keys(
|
|
682
|
+
function wn(t, e) {
|
|
683
|
+
const r = Object.keys(t).find((n) => n in e && typeof e[n] != typeof t[n]);
|
|
541
684
|
if (r)
|
|
542
|
-
throw new
|
|
685
|
+
throw new Mr(r);
|
|
543
686
|
}
|
|
544
|
-
function
|
|
545
|
-
|
|
546
|
-
const r = [
|
|
547
|
-
return
|
|
687
|
+
function En(t, e) {
|
|
688
|
+
Et(t.params, e.params);
|
|
689
|
+
const r = [t.value, e.value].filter(W).join("&");
|
|
690
|
+
return Q(r, { ...t.params, ...e.params });
|
|
548
691
|
}
|
|
549
|
-
function
|
|
550
|
-
return
|
|
692
|
+
function vn(t, e) {
|
|
693
|
+
return Et(t, e), { ...t, ...e };
|
|
551
694
|
}
|
|
552
|
-
function
|
|
553
|
-
return "parent" in
|
|
695
|
+
function Xe(t) {
|
|
696
|
+
return "parent" in t && !!t.parent;
|
|
554
697
|
}
|
|
555
|
-
function
|
|
556
|
-
return "component" in
|
|
698
|
+
function tr(t) {
|
|
699
|
+
return "component" in t && !!t.component;
|
|
557
700
|
}
|
|
558
|
-
function
|
|
559
|
-
return "props" in
|
|
701
|
+
function we(t) {
|
|
702
|
+
return "props" in t && typeof t.props == "function";
|
|
560
703
|
}
|
|
561
|
-
function
|
|
562
|
-
return "components" in
|
|
704
|
+
function er(t) {
|
|
705
|
+
return "components" in t && !!t.components;
|
|
563
706
|
}
|
|
564
|
-
function
|
|
565
|
-
return "props" in
|
|
707
|
+
function Ee(t) {
|
|
708
|
+
return "props" in t && typeof t.props == "object";
|
|
566
709
|
}
|
|
567
|
-
function
|
|
710
|
+
function rr(t, e) {
|
|
568
711
|
return {
|
|
569
|
-
...
|
|
570
|
-
path:
|
|
571
|
-
query:
|
|
572
|
-
meta:
|
|
573
|
-
state:
|
|
574
|
-
hash:
|
|
575
|
-
matches: [...
|
|
576
|
-
host:
|
|
577
|
-
depth:
|
|
712
|
+
...e,
|
|
713
|
+
path: Ye(t.path, e.path),
|
|
714
|
+
query: En(t.query, e.query),
|
|
715
|
+
meta: Rn(t.meta, e.meta),
|
|
716
|
+
state: vn(t.state, e.state),
|
|
717
|
+
hash: gn(t.hash, e.hash),
|
|
718
|
+
matches: [...t.matches, e.matched],
|
|
719
|
+
host: t.host,
|
|
720
|
+
depth: t.depth + 1
|
|
578
721
|
};
|
|
579
722
|
}
|
|
580
|
-
function
|
|
723
|
+
function ue() {
|
|
581
724
|
return typeof window < "u" && typeof window.document < "u";
|
|
582
725
|
}
|
|
583
|
-
function
|
|
584
|
-
const
|
|
726
|
+
function fe(t) {
|
|
727
|
+
const e = new URLSearchParams(t);
|
|
585
728
|
return {
|
|
586
|
-
get: (...r) =>
|
|
587
|
-
getAll: (...r) =>
|
|
729
|
+
get: (...r) => e.get(...r),
|
|
730
|
+
getAll: (...r) => e.getAll(...r),
|
|
588
731
|
set: (...r) => {
|
|
589
|
-
|
|
732
|
+
e.set(...r);
|
|
590
733
|
},
|
|
591
734
|
append: (...r) => {
|
|
592
|
-
|
|
735
|
+
e.append(...r);
|
|
593
736
|
},
|
|
594
737
|
delete: (...r) => {
|
|
595
|
-
|
|
738
|
+
e.delete(...r);
|
|
596
739
|
},
|
|
597
|
-
toString: (...r) =>
|
|
740
|
+
toString: (...r) => e.toString(...r),
|
|
598
741
|
forEach: (...r) => {
|
|
599
|
-
|
|
742
|
+
e.forEach(...r);
|
|
600
743
|
},
|
|
601
|
-
entries: (...r) =>
|
|
602
|
-
keys: (...r) =>
|
|
603
|
-
values: (...r) =>
|
|
604
|
-
has: (...r) =>
|
|
605
|
-
size:
|
|
744
|
+
entries: (...r) => e.entries(...r),
|
|
745
|
+
keys: (...r) => e.keys(...r),
|
|
746
|
+
values: (...r) => e.values(...r),
|
|
747
|
+
has: (...r) => e.has(...r),
|
|
748
|
+
size: e.size,
|
|
606
749
|
sort: () => {
|
|
607
|
-
|
|
750
|
+
e.sort();
|
|
608
751
|
},
|
|
609
|
-
[Symbol.iterator]: () =>
|
|
752
|
+
[Symbol.iterator]: () => e[Symbol.iterator]()
|
|
610
753
|
};
|
|
611
754
|
}
|
|
612
|
-
function
|
|
613
|
-
let
|
|
614
|
-
return () => (++
|
|
755
|
+
function le() {
|
|
756
|
+
let t = 0;
|
|
757
|
+
return () => (++t).toString();
|
|
615
758
|
}
|
|
616
|
-
const
|
|
617
|
-
function
|
|
618
|
-
return
|
|
759
|
+
const bn = le()();
|
|
760
|
+
function Sn(t) {
|
|
761
|
+
return t === bn;
|
|
619
762
|
}
|
|
620
|
-
const
|
|
621
|
-
function
|
|
622
|
-
return
|
|
763
|
+
const pe = le();
|
|
764
|
+
function nr(t) {
|
|
765
|
+
return t === void 0 ? "" : t;
|
|
623
766
|
}
|
|
624
|
-
function
|
|
625
|
-
const r =
|
|
767
|
+
function yt(t, e) {
|
|
768
|
+
const r = pe(), n = nr(t.name), o = X(t.path), a = X(t.query), s = X(t.hash), l = t.meta ?? {}, d = t.state ?? {}, i = Nt({ id: r, meta: l, state: d, ...t, props: e }), m = {
|
|
626
769
|
id: r,
|
|
627
|
-
matched:
|
|
628
|
-
matches: [
|
|
770
|
+
matched: i,
|
|
771
|
+
matches: [i],
|
|
629
772
|
name: n,
|
|
630
773
|
path: o,
|
|
631
774
|
query: a,
|
|
632
775
|
hash: s,
|
|
633
|
-
meta:
|
|
634
|
-
state:
|
|
776
|
+
meta: l,
|
|
777
|
+
state: d,
|
|
635
778
|
depth: 1,
|
|
636
|
-
host:
|
|
637
|
-
prefetch:
|
|
638
|
-
},
|
|
639
|
-
return
|
|
779
|
+
host: Q(),
|
|
780
|
+
prefetch: t.prefetch
|
|
781
|
+
}, b = Xe(t) ? rr(t.parent, m) : m;
|
|
782
|
+
return Et(b.path.params, b.query.params, b.hash.params), b;
|
|
640
783
|
}
|
|
641
|
-
const
|
|
784
|
+
const Ct = { template: "<div>This is component</div>" }, de = yt({
|
|
642
785
|
name: "parentA",
|
|
643
786
|
path: "/parentA/[paramA]"
|
|
644
|
-
}),
|
|
645
|
-
parent:
|
|
787
|
+
}), or = yt({
|
|
788
|
+
parent: de,
|
|
646
789
|
name: "parentA.childA",
|
|
647
790
|
path: "/childA/[?paramB]"
|
|
648
|
-
}),
|
|
649
|
-
parent:
|
|
791
|
+
}), Pn = yt({
|
|
792
|
+
parent: de,
|
|
650
793
|
name: "parentA.childB",
|
|
651
794
|
path: "/childB/[paramD]",
|
|
652
|
-
component:
|
|
653
|
-
}),
|
|
654
|
-
parent:
|
|
795
|
+
component: Ct
|
|
796
|
+
}), An = yt({
|
|
797
|
+
parent: or,
|
|
655
798
|
name: "parentA.childA.grandChildA",
|
|
656
799
|
path: "/[paramC]",
|
|
657
|
-
component:
|
|
800
|
+
component: Ct
|
|
658
801
|
});
|
|
659
|
-
|
|
802
|
+
yt({
|
|
660
803
|
name: "parentB",
|
|
661
804
|
path: "/parentB",
|
|
662
|
-
component:
|
|
663
|
-
}),
|
|
805
|
+
component: Ct
|
|
806
|
+
}), yt({
|
|
664
807
|
name: "parentC",
|
|
665
808
|
path: "/",
|
|
666
|
-
component:
|
|
809
|
+
component: Ct
|
|
667
810
|
});
|
|
668
|
-
const
|
|
811
|
+
const kn = "lazy", xn = {
|
|
669
812
|
components: !0,
|
|
670
813
|
props: !1
|
|
671
814
|
};
|
|
672
|
-
function
|
|
673
|
-
return ["eager", "lazy", "intent"].includes(
|
|
815
|
+
function xt(t) {
|
|
816
|
+
return ["eager", "lazy", "intent"].includes(t);
|
|
674
817
|
}
|
|
675
|
-
function
|
|
676
|
-
const o =
|
|
818
|
+
function ar({ routerPrefetch: t, routePrefetch: e, linkPrefetch: r }, n) {
|
|
819
|
+
const o = Gt(r, n), a = Gt(e, n), s = Gt(t, n), l = [
|
|
677
820
|
o,
|
|
678
821
|
a,
|
|
679
822
|
s,
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
].reduce((
|
|
683
|
-
return
|
|
823
|
+
xn[n],
|
|
824
|
+
kn
|
|
825
|
+
].reduce((d, i) => xt(d) ? d : d === !0 && xt(i) ? i : d === !0 && !xt(i) ? d : d === void 0 ? i : d, void 0);
|
|
826
|
+
return xt(l) ? l : !1;
|
|
684
827
|
}
|
|
685
|
-
function
|
|
686
|
-
return
|
|
828
|
+
function Gt(t, e) {
|
|
829
|
+
return Lt(t) ? t[e] : t;
|
|
687
830
|
}
|
|
688
|
-
class
|
|
831
|
+
class sr extends Error {
|
|
689
832
|
constructor() {
|
|
690
833
|
super("Uncaught CallbackContextAbortError");
|
|
691
834
|
T(this, "response");
|
|
692
835
|
this.response = { status: "ABORT" };
|
|
693
836
|
}
|
|
694
837
|
}
|
|
695
|
-
class
|
|
838
|
+
class ht extends Error {
|
|
696
839
|
constructor(r) {
|
|
697
840
|
super("Uncaught CallbackContextPushError");
|
|
698
841
|
T(this, "response");
|
|
699
842
|
this.response = { status: "PUSH", to: r };
|
|
700
843
|
}
|
|
701
844
|
}
|
|
702
|
-
class
|
|
845
|
+
class Vt extends Error {
|
|
703
846
|
constructor(r) {
|
|
704
847
|
super("Uncaught CallbackContextRejectionError");
|
|
705
848
|
T(this, "response");
|
|
706
849
|
this.response = { status: "REJECT", type: r };
|
|
707
850
|
}
|
|
708
851
|
}
|
|
709
|
-
function
|
|
852
|
+
function ir() {
|
|
710
853
|
return { reject: (o) => {
|
|
711
|
-
throw new
|
|
854
|
+
throw new Vt(o);
|
|
712
855
|
}, push: (...o) => {
|
|
713
|
-
throw new
|
|
856
|
+
throw new ht(o);
|
|
714
857
|
}, replace: (o, a, s) => {
|
|
715
858
|
if (M(o)) {
|
|
716
|
-
const
|
|
717
|
-
throw new
|
|
859
|
+
const i = a ?? {};
|
|
860
|
+
throw new ht([o, { ...i, replace: !0 }]);
|
|
718
861
|
}
|
|
719
|
-
const
|
|
720
|
-
throw new
|
|
862
|
+
const l = a, d = s ?? {};
|
|
863
|
+
throw new ht([o, l, { ...d, replace: !0 }]);
|
|
721
864
|
}, abort: () => {
|
|
722
|
-
throw new
|
|
865
|
+
throw new sr();
|
|
723
866
|
} };
|
|
724
867
|
}
|
|
725
|
-
function
|
|
726
|
-
return typeof e == "object" && e !== null && "then" in e;
|
|
727
|
-
}
|
|
728
|
-
function We(e, t) {
|
|
729
|
-
return t ? t.runWithContext(e) : e();
|
|
730
|
-
}
|
|
731
|
-
function dt(e, t) {
|
|
868
|
+
function ve(t) {
|
|
732
869
|
try {
|
|
733
|
-
const
|
|
734
|
-
return
|
|
735
|
-
} catch (
|
|
736
|
-
return
|
|
870
|
+
const e = t();
|
|
871
|
+
return re(e) ? e.catch((r) => r) : e;
|
|
872
|
+
} catch (e) {
|
|
873
|
+
return e;
|
|
737
874
|
}
|
|
738
875
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
876
|
+
function cr() {
|
|
877
|
+
let t = null;
|
|
878
|
+
function e(n) {
|
|
879
|
+
t = n;
|
|
880
|
+
}
|
|
881
|
+
function r(n) {
|
|
882
|
+
return t ? t.runWithContext(n) : n();
|
|
883
|
+
}
|
|
884
|
+
return {
|
|
885
|
+
setVueApp: e,
|
|
886
|
+
runWithContext: r
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
const ur = Symbol();
|
|
890
|
+
function Nn() {
|
|
891
|
+
const { setVueApp: t, runWithContext: e } = cr(), r = Ht(/* @__PURE__ */ new Map()), { push: n, replace: o, reject: a } = ir(), s = (y, p, R) => p.matches.filter((f) => ar({ ...R, routePrefetch: f.prefetch }, "props") === y).flatMap((f) => P(f)).reduce((f, { id: c, name: v, props: k }) => {
|
|
892
|
+
if (!k)
|
|
893
|
+
return f;
|
|
894
|
+
const A = U(c, v, p), g = e(() => ve(() => k(p, {
|
|
895
|
+
push: n,
|
|
896
|
+
replace: o,
|
|
897
|
+
reject: a,
|
|
898
|
+
parent: m(p, !0)
|
|
899
|
+
})));
|
|
900
|
+
return f[A] = g, f;
|
|
901
|
+
}, {}), l = (y) => {
|
|
902
|
+
Object.entries(y).forEach(([p, R]) => {
|
|
903
|
+
r.set(p, R);
|
|
755
904
|
});
|
|
756
|
-
},
|
|
757
|
-
const
|
|
758
|
-
for (const { id:
|
|
759
|
-
if (!
|
|
905
|
+
}, d = async (y) => {
|
|
906
|
+
const p = y.matches.flatMap(P), R = [], f = [];
|
|
907
|
+
for (const { id: c, name: v, props: k } of p) {
|
|
908
|
+
if (!k)
|
|
760
909
|
continue;
|
|
761
|
-
const A = U(
|
|
762
|
-
if (
|
|
763
|
-
const
|
|
764
|
-
push:
|
|
765
|
-
replace:
|
|
766
|
-
reject:
|
|
767
|
-
parent:
|
|
768
|
-
})
|
|
769
|
-
|
|
910
|
+
const A = U(c, v, y);
|
|
911
|
+
if (R.push(A), !r.has(A)) {
|
|
912
|
+
const g = e(() => ve(() => k(y, {
|
|
913
|
+
push: n,
|
|
914
|
+
replace: o,
|
|
915
|
+
reject: a,
|
|
916
|
+
parent: m(y)
|
|
917
|
+
})));
|
|
918
|
+
r.set(A, g);
|
|
770
919
|
}
|
|
771
|
-
|
|
772
|
-
const
|
|
773
|
-
if (
|
|
774
|
-
throw
|
|
920
|
+
f.push((async () => {
|
|
921
|
+
const g = await r.get(A);
|
|
922
|
+
if (g instanceof Error)
|
|
923
|
+
throw g;
|
|
775
924
|
})());
|
|
776
925
|
}
|
|
777
|
-
|
|
926
|
+
w(R);
|
|
778
927
|
try {
|
|
779
|
-
return await Promise.all(
|
|
780
|
-
} catch (
|
|
781
|
-
if (
|
|
782
|
-
return
|
|
783
|
-
throw
|
|
928
|
+
return await Promise.all(f), { status: "SUCCESS" };
|
|
929
|
+
} catch (c) {
|
|
930
|
+
if (c instanceof ht || c instanceof Vt)
|
|
931
|
+
return c.response;
|
|
932
|
+
throw c;
|
|
784
933
|
}
|
|
785
|
-
},
|
|
786
|
-
const
|
|
787
|
-
return
|
|
788
|
-
}, h = (d) => {
|
|
789
|
-
e = d;
|
|
934
|
+
}, i = (y, p, R) => {
|
|
935
|
+
const f = U(y, p, R);
|
|
936
|
+
return r.get(f);
|
|
790
937
|
};
|
|
791
|
-
function
|
|
792
|
-
const
|
|
793
|
-
if (
|
|
794
|
-
return
|
|
795
|
-
name:
|
|
938
|
+
function m(y, p = !1) {
|
|
939
|
+
const R = y.matches.at(-2);
|
|
940
|
+
if (R)
|
|
941
|
+
return we(R) ? {
|
|
942
|
+
name: R.name ?? "",
|
|
796
943
|
get props() {
|
|
797
|
-
return
|
|
944
|
+
return b(R, "default", y, p);
|
|
798
945
|
}
|
|
799
|
-
} :
|
|
800
|
-
name:
|
|
946
|
+
} : Ee(R) ? {
|
|
947
|
+
name: R.name ?? "",
|
|
801
948
|
props: new Proxy({}, {
|
|
802
|
-
get(
|
|
803
|
-
return typeof
|
|
949
|
+
get(f, c) {
|
|
950
|
+
return typeof c != "string" ? Reflect.get(f, c) : b(R, c, y, p);
|
|
804
951
|
}
|
|
805
952
|
})
|
|
806
953
|
} : {
|
|
807
|
-
name:
|
|
954
|
+
name: R.name ?? "",
|
|
808
955
|
props: void 0
|
|
809
956
|
};
|
|
810
957
|
}
|
|
811
|
-
function
|
|
812
|
-
const
|
|
813
|
-
if (
|
|
814
|
-
const
|
|
958
|
+
function b(y, p, R, f = !1) {
|
|
959
|
+
const c = i(y.id, p, R);
|
|
960
|
+
if (f && !c) {
|
|
961
|
+
const v = y.name ?? "unknown", k = R.name || "unknown";
|
|
815
962
|
console.warn(`
|
|
816
|
-
Unable to access parent props "${
|
|
963
|
+
Unable to access parent props "${p}" from route "${v}" while prefetching props for route "${k}".
|
|
817
964
|
This may occur if the parent route's props were not also prefetched.
|
|
818
965
|
`);
|
|
819
966
|
}
|
|
820
|
-
return
|
|
967
|
+
return c;
|
|
821
968
|
}
|
|
822
|
-
function U(
|
|
823
|
-
return [
|
|
969
|
+
function U(y, p, R) {
|
|
970
|
+
return [y, p, R.id, JSON.stringify(R.params)].join("-");
|
|
824
971
|
}
|
|
825
|
-
function
|
|
826
|
-
return
|
|
972
|
+
function P(y) {
|
|
973
|
+
return we(y) ? [
|
|
827
974
|
{
|
|
828
|
-
id:
|
|
975
|
+
id: y.id,
|
|
829
976
|
name: "default",
|
|
830
|
-
props:
|
|
977
|
+
props: y.props
|
|
831
978
|
}
|
|
832
|
-
] :
|
|
979
|
+
] : Ee(y) ? Object.entries(y.props).map(([p, R]) => ({ id: y.id, name: p, props: R })) : [];
|
|
833
980
|
}
|
|
834
|
-
function
|
|
835
|
-
for (const
|
|
836
|
-
|
|
981
|
+
function w(y) {
|
|
982
|
+
for (const p of r.keys())
|
|
983
|
+
y.includes(p) || r.delete(p);
|
|
837
984
|
}
|
|
838
985
|
return {
|
|
839
|
-
getPrefetchProps:
|
|
840
|
-
setPrefetchProps:
|
|
841
|
-
getProps:
|
|
842
|
-
setProps:
|
|
843
|
-
setVueApp:
|
|
986
|
+
getPrefetchProps: s,
|
|
987
|
+
setPrefetchProps: l,
|
|
988
|
+
getProps: i,
|
|
989
|
+
setProps: d,
|
|
990
|
+
setVueApp: t
|
|
844
991
|
};
|
|
845
992
|
}
|
|
846
|
-
function
|
|
847
|
-
const
|
|
848
|
-
if (!
|
|
849
|
-
throw new
|
|
850
|
-
return
|
|
993
|
+
function fr() {
|
|
994
|
+
const t = st(ur);
|
|
995
|
+
if (!t)
|
|
996
|
+
throw new wt();
|
|
997
|
+
return t;
|
|
851
998
|
}
|
|
852
|
-
const
|
|
853
|
-
|
|
999
|
+
const Ln = Zr(() => new Promise((t) => {
|
|
1000
|
+
t({ default: { template: "foo" } });
|
|
854
1001
|
}));
|
|
855
|
-
function
|
|
856
|
-
return
|
|
1002
|
+
function be(t) {
|
|
1003
|
+
return t.name === Ln.name && "__asyncLoader" in t;
|
|
857
1004
|
}
|
|
858
|
-
const
|
|
859
|
-
function
|
|
860
|
-
const
|
|
861
|
-
if (!
|
|
862
|
-
throw new
|
|
863
|
-
return
|
|
864
|
-
n &&
|
|
865
|
-
}, { immediate: !0 }),
|
|
866
|
-
|
|
1005
|
+
const lr = Symbol("visibilityObserver");
|
|
1006
|
+
function Un(t) {
|
|
1007
|
+
const e = st(lr);
|
|
1008
|
+
if (!e)
|
|
1009
|
+
throw new wt();
|
|
1010
|
+
return rt(t, (n, o) => {
|
|
1011
|
+
n && e.observe(n), o && e.unobserve(o);
|
|
1012
|
+
}, { immediate: !0 }), _t(() => {
|
|
1013
|
+
t.value && e.unobserve(t.value);
|
|
867
1014
|
}), {
|
|
868
|
-
isElementVisible:
|
|
1015
|
+
isElementVisible: O(() => t.value ? e.isElementVisible(t.value) : !1)
|
|
869
1016
|
};
|
|
870
1017
|
}
|
|
871
|
-
function
|
|
872
|
-
|
|
873
|
-
n && n.addEventListener(
|
|
874
|
-
}, { immediate: !0 }),
|
|
875
|
-
|
|
1018
|
+
function Se(t, e, r) {
|
|
1019
|
+
rt(t, (n, o) => {
|
|
1020
|
+
n && n.addEventListener(e, r), o && o.removeEventListener(e, r);
|
|
1021
|
+
}, { immediate: !0 }), _t(() => {
|
|
1022
|
+
t.value && t.value.removeEventListener(e, r);
|
|
876
1023
|
});
|
|
877
1024
|
}
|
|
878
|
-
function
|
|
879
|
-
const
|
|
880
|
-
const
|
|
881
|
-
o(
|
|
1025
|
+
function Bn(t) {
|
|
1026
|
+
const e = /* @__PURE__ */ new Map(), r = qt(), { getPrefetchProps: n, setPrefetchProps: o } = fr(), { isElementVisible: a } = Un(r), s = () => {
|
|
1027
|
+
const i = Array.from(e.values()).reduce((m, b) => (Object.assign(m, b), m), {});
|
|
1028
|
+
o(i);
|
|
882
1029
|
};
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}, { immediate: !0 }),
|
|
886
|
-
const { route:
|
|
887
|
-
!
|
|
888
|
-
}, { immediate: !0 }),
|
|
889
|
-
function
|
|
890
|
-
const { route:
|
|
891
|
-
|
|
892
|
-
}
|
|
893
|
-
function
|
|
894
|
-
|
|
1030
|
+
rt(() => H(t), ({ route: i, ...m }) => {
|
|
1031
|
+
e.clear(), i && d("eager", i, m);
|
|
1032
|
+
}, { immediate: !0 }), rt(a, (i) => {
|
|
1033
|
+
const { route: m, ...b } = H(t);
|
|
1034
|
+
!m || !i || d("lazy", m, b);
|
|
1035
|
+
}, { immediate: !0 }), Se(r, "focusin", l), Se(r, "mouseover", l);
|
|
1036
|
+
function l() {
|
|
1037
|
+
const { route: i, ...m } = H(t);
|
|
1038
|
+
i && d("intent", i, m);
|
|
1039
|
+
}
|
|
1040
|
+
function d(i, m, b) {
|
|
1041
|
+
Cn(i, m, b), e.has(i) || e.set(i, n(i, m, b));
|
|
895
1042
|
}
|
|
896
1043
|
return {
|
|
897
1044
|
element: r,
|
|
898
1045
|
commit: s
|
|
899
1046
|
};
|
|
900
1047
|
}
|
|
901
|
-
function
|
|
902
|
-
|
|
903
|
-
|
|
1048
|
+
function Cn(t, e, r) {
|
|
1049
|
+
e.matches.forEach((n) => {
|
|
1050
|
+
ar({
|
|
904
1051
|
...r,
|
|
905
1052
|
routePrefetch: n.prefetch
|
|
906
|
-
}, "components") ===
|
|
907
|
-
|
|
1053
|
+
}, "components") === t && (tr(n) && be(n.component) && n.component.__asyncLoader(), er(n) && Object.values(n.components).forEach((a) => {
|
|
1054
|
+
be(a) && a.__asyncLoader();
|
|
908
1055
|
}));
|
|
909
1056
|
});
|
|
910
1057
|
}
|
|
911
|
-
const
|
|
912
|
-
function
|
|
913
|
-
return typeof
|
|
1058
|
+
const pr = Symbol("isRouterRouteSymbol");
|
|
1059
|
+
function Vn(t) {
|
|
1060
|
+
return typeof t == "object" && t !== null && pr in t;
|
|
914
1061
|
}
|
|
915
|
-
function
|
|
916
|
-
function r(
|
|
917
|
-
if (typeof
|
|
918
|
-
const
|
|
919
|
-
...
|
|
920
|
-
...
|
|
1062
|
+
function Zn(t, e) {
|
|
1063
|
+
function r(p, R, f) {
|
|
1064
|
+
if (typeof p == "object") {
|
|
1065
|
+
const v = {
|
|
1066
|
+
...t.params,
|
|
1067
|
+
...p
|
|
921
1068
|
};
|
|
922
|
-
return t
|
|
1069
|
+
return e(t.name, v, R);
|
|
923
1070
|
}
|
|
924
|
-
const
|
|
925
|
-
...
|
|
926
|
-
[
|
|
1071
|
+
const c = {
|
|
1072
|
+
...t.params,
|
|
1073
|
+
[p]: R
|
|
927
1074
|
};
|
|
928
|
-
return t
|
|
929
|
-
}
|
|
930
|
-
const n = (...
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
}, o = (...
|
|
934
|
-
const
|
|
935
|
-
|
|
936
|
-
}, a = (...
|
|
937
|
-
const
|
|
938
|
-
|
|
939
|
-
}, { id: s, matched:
|
|
1075
|
+
return e(t.name, c, f);
|
|
1076
|
+
}
|
|
1077
|
+
const n = (...p) => {
|
|
1078
|
+
const R = new URLSearchParams(t.query);
|
|
1079
|
+
R.set(...p), r({}, { query: R });
|
|
1080
|
+
}, o = (...p) => {
|
|
1081
|
+
const R = new URLSearchParams(t.query);
|
|
1082
|
+
R.append(...p), r({}, { query: R });
|
|
1083
|
+
}, a = (...p) => {
|
|
1084
|
+
const R = new URLSearchParams(t.query);
|
|
1085
|
+
R.delete(...p), r({}, { query: R });
|
|
1086
|
+
}, { id: s, matched: l, matches: d, name: i, hash: m, href: b } = Or(t), U = O({
|
|
940
1087
|
get() {
|
|
941
|
-
return new Proxy(
|
|
942
|
-
set(
|
|
943
|
-
return r(
|
|
1088
|
+
return new Proxy(t.params, {
|
|
1089
|
+
set(p, R, f) {
|
|
1090
|
+
return r(R, f), !0;
|
|
944
1091
|
}
|
|
945
1092
|
});
|
|
946
1093
|
},
|
|
947
|
-
set(
|
|
948
|
-
r(
|
|
1094
|
+
set(p) {
|
|
1095
|
+
r(p);
|
|
949
1096
|
}
|
|
950
|
-
}),
|
|
1097
|
+
}), P = O({
|
|
951
1098
|
get() {
|
|
952
|
-
return new Proxy(
|
|
953
|
-
get(
|
|
954
|
-
switch (
|
|
1099
|
+
return new Proxy(t.query, {
|
|
1100
|
+
get(p, R, f) {
|
|
1101
|
+
switch (R) {
|
|
955
1102
|
case "append":
|
|
956
1103
|
return o;
|
|
957
1104
|
case "set":
|
|
@@ -959,98 +1106,98 @@ function An(e, t) {
|
|
|
959
1106
|
case "delete":
|
|
960
1107
|
return a;
|
|
961
1108
|
default:
|
|
962
|
-
return Reflect.get(
|
|
1109
|
+
return Reflect.get(p, R, f);
|
|
963
1110
|
}
|
|
964
1111
|
}
|
|
965
1112
|
});
|
|
966
1113
|
},
|
|
967
|
-
set(
|
|
968
|
-
r({}, { query:
|
|
1114
|
+
set(p) {
|
|
1115
|
+
r({}, { query: p });
|
|
969
1116
|
}
|
|
970
|
-
}),
|
|
1117
|
+
}), w = O({
|
|
971
1118
|
get() {
|
|
972
|
-
return new Proxy(
|
|
973
|
-
set(
|
|
974
|
-
return r({}, { state: { ...
|
|
1119
|
+
return new Proxy(t.state, {
|
|
1120
|
+
set(p, R, f) {
|
|
1121
|
+
return r({}, { state: { ...t.state, [R]: f } }), !0;
|
|
975
1122
|
}
|
|
976
1123
|
});
|
|
977
1124
|
},
|
|
978
|
-
set(
|
|
979
|
-
r({}, { state:
|
|
1125
|
+
set(p) {
|
|
1126
|
+
r({}, { state: p });
|
|
980
1127
|
}
|
|
981
1128
|
});
|
|
982
|
-
return
|
|
1129
|
+
return Ht({
|
|
983
1130
|
id: s,
|
|
984
|
-
matched:
|
|
985
|
-
matches:
|
|
986
|
-
state:
|
|
987
|
-
query:
|
|
988
|
-
hash:
|
|
1131
|
+
matched: l,
|
|
1132
|
+
matches: d,
|
|
1133
|
+
state: w,
|
|
1134
|
+
query: P,
|
|
1135
|
+
hash: m,
|
|
989
1136
|
params: U,
|
|
990
|
-
name:
|
|
991
|
-
href:
|
|
1137
|
+
name: i,
|
|
1138
|
+
href: b,
|
|
992
1139
|
update: r,
|
|
993
|
-
[
|
|
1140
|
+
[pr]: !0
|
|
994
1141
|
});
|
|
995
1142
|
}
|
|
996
|
-
function
|
|
997
|
-
return
|
|
1143
|
+
function dr(t, e, { exact: r } = {}) {
|
|
1144
|
+
return Vn(t) ? e === void 0 ? !0 : r ? t.matched.name === e : t.matches.map((n) => n.name).includes(e) : !1;
|
|
998
1145
|
}
|
|
999
|
-
function
|
|
1000
|
-
const
|
|
1001
|
-
for (const r of
|
|
1146
|
+
function he(...t) {
|
|
1147
|
+
const e = new URLSearchParams();
|
|
1148
|
+
for (const r of t) {
|
|
1002
1149
|
const n = new URLSearchParams(r);
|
|
1003
1150
|
for (const [o, a] of n.entries())
|
|
1004
|
-
|
|
1151
|
+
e.append(o, a);
|
|
1005
1152
|
}
|
|
1006
|
-
return
|
|
1153
|
+
return e;
|
|
1007
1154
|
}
|
|
1008
|
-
function
|
|
1009
|
-
const n =
|
|
1010
|
-
const
|
|
1011
|
-
return typeof
|
|
1012
|
-
}), a =
|
|
1155
|
+
function On(t, e = {}, r = {}) {
|
|
1156
|
+
const n = ee(), o = O(() => {
|
|
1157
|
+
const w = H(t);
|
|
1158
|
+
return typeof w != "string" ? w : M(w) ? n.find(w, H(r)) : n.resolve(w, H(e), H(r));
|
|
1159
|
+
}), a = O(() => {
|
|
1013
1160
|
if (o.value)
|
|
1014
1161
|
return o.value.href;
|
|
1015
|
-
const
|
|
1016
|
-
if (M(
|
|
1017
|
-
return
|
|
1162
|
+
const w = H(t);
|
|
1163
|
+
if (M(w))
|
|
1164
|
+
return w;
|
|
1018
1165
|
console.error(new Error("Failed to resolve route in RouterLink."));
|
|
1019
|
-
}), s =
|
|
1020
|
-
var
|
|
1021
|
-
return
|
|
1022
|
-
})),
|
|
1023
|
-
var
|
|
1024
|
-
return n.route.id === ((
|
|
1025
|
-
}),
|
|
1026
|
-
const
|
|
1027
|
-
return typeof
|
|
1028
|
-
}), { element:
|
|
1166
|
+
}), s = O(() => dr(n.route) && n.route.matches.some((w) => {
|
|
1167
|
+
var y;
|
|
1168
|
+
return w.id === ((y = o.value) == null ? void 0 : y.id);
|
|
1169
|
+
})), l = O(() => {
|
|
1170
|
+
var w;
|
|
1171
|
+
return n.route.id === ((w = o.value) == null ? void 0 : w.id);
|
|
1172
|
+
}), d = O(() => !!a.value && n.isExternal(a.value)), i = O(() => {
|
|
1173
|
+
const w = H(t);
|
|
1174
|
+
return typeof w != "string" || M(w) ? H(e) : H(r);
|
|
1175
|
+
}), { element: m, commit: b } = Bn(() => ({
|
|
1029
1176
|
route: o.value,
|
|
1030
1177
|
routerPrefetch: n.prefetch,
|
|
1031
|
-
linkPrefetch:
|
|
1032
|
-
})), U = (
|
|
1033
|
-
|
|
1034
|
-
const
|
|
1035
|
-
replace: (
|
|
1036
|
-
query:
|
|
1037
|
-
hash: (
|
|
1038
|
-
state: { ...
|
|
1039
|
-
},
|
|
1040
|
-
return M(
|
|
1178
|
+
linkPrefetch: i.value.prefetch
|
|
1179
|
+
})), U = (w) => {
|
|
1180
|
+
b();
|
|
1181
|
+
const y = {
|
|
1182
|
+
replace: (w == null ? void 0 : w.replace) ?? i.value.replace,
|
|
1183
|
+
query: he(i.value.query, w == null ? void 0 : w.query),
|
|
1184
|
+
hash: (w == null ? void 0 : w.hash) ?? i.value.hash,
|
|
1185
|
+
state: { ...i.value.state, ...w == null ? void 0 : w.state }
|
|
1186
|
+
}, p = H(t);
|
|
1187
|
+
return M(p) || typeof p == "object" ? n.push(p, y) : n.push(p, H(e), y);
|
|
1041
1188
|
};
|
|
1042
1189
|
return {
|
|
1043
|
-
element:
|
|
1190
|
+
element: m,
|
|
1044
1191
|
route: o,
|
|
1045
1192
|
href: a,
|
|
1046
1193
|
isMatch: s,
|
|
1047
|
-
isExactMatch:
|
|
1048
|
-
isExternal:
|
|
1194
|
+
isExactMatch: l,
|
|
1195
|
+
isExternal: d,
|
|
1049
1196
|
push: U,
|
|
1050
|
-
replace: (
|
|
1197
|
+
replace: (w) => U({ ...w, replace: !0 })
|
|
1051
1198
|
};
|
|
1052
1199
|
}
|
|
1053
|
-
const
|
|
1200
|
+
const jn = ["href"], $n = /* @__PURE__ */ Rt({
|
|
1054
1201
|
__name: "routerLink",
|
|
1055
1202
|
props: {
|
|
1056
1203
|
to: {},
|
|
@@ -1060,136 +1207,136 @@ const xn = ["href"], Un = /* @__PURE__ */ me({
|
|
|
1060
1207
|
replace: { type: Boolean },
|
|
1061
1208
|
state: {}
|
|
1062
1209
|
},
|
|
1063
|
-
setup(
|
|
1064
|
-
const
|
|
1065
|
-
const { to:
|
|
1066
|
-
return
|
|
1067
|
-
}), { element: s, isMatch:
|
|
1068
|
-
"router-link--match":
|
|
1069
|
-
"router-link--exact-match":
|
|
1210
|
+
setup(t) {
|
|
1211
|
+
const e = t, r = ee(), n = O(() => U(e.to)), o = O(() => P(e.to)), a = O(() => {
|
|
1212
|
+
const { to: y, ...p } = e;
|
|
1213
|
+
return p;
|
|
1214
|
+
}), { element: s, isMatch: l, isExactMatch: d, isExternal: i, push: m } = On(() => typeof e.to == "function" ? e.to(r.resolve) : e.to, a), b = O(() => ({
|
|
1215
|
+
"router-link--match": l.value,
|
|
1216
|
+
"router-link--exact-match": d.value
|
|
1070
1217
|
}));
|
|
1071
|
-
function U(
|
|
1072
|
-
if (typeof
|
|
1073
|
-
const
|
|
1074
|
-
return U(
|
|
1218
|
+
function U(y) {
|
|
1219
|
+
if (typeof y == "function") {
|
|
1220
|
+
const p = y(r.resolve);
|
|
1221
|
+
return U(p);
|
|
1075
1222
|
}
|
|
1076
|
-
return M(
|
|
1223
|
+
return M(y) ? r.find(y) : y;
|
|
1077
1224
|
}
|
|
1078
|
-
function
|
|
1079
|
-
if (typeof
|
|
1080
|
-
const
|
|
1081
|
-
return
|
|
1225
|
+
function P(y) {
|
|
1226
|
+
if (typeof y == "function") {
|
|
1227
|
+
const p = y(r.resolve);
|
|
1228
|
+
return P(p);
|
|
1082
1229
|
}
|
|
1083
|
-
return M(
|
|
1230
|
+
return M(y) ? y : y == null ? void 0 : y.href;
|
|
1084
1231
|
}
|
|
1085
|
-
function
|
|
1086
|
-
|
|
1232
|
+
function w(y) {
|
|
1233
|
+
y.preventDefault(), m();
|
|
1087
1234
|
}
|
|
1088
|
-
return (
|
|
1235
|
+
return (y, p) => (Ze(), jr("a", {
|
|
1089
1236
|
ref_key: "element",
|
|
1090
1237
|
ref: s,
|
|
1091
1238
|
href: o.value,
|
|
1092
|
-
class:
|
|
1093
|
-
onClick:
|
|
1239
|
+
class: $r(["router-link", b.value]),
|
|
1240
|
+
onClick: w
|
|
1094
1241
|
}, [
|
|
1095
|
-
|
|
1096
|
-
], 10,
|
|
1242
|
+
Oe(y.$slots, "default", je(Hr({ route: n.value, isMatch: vt(l), isExactMatch: vt(d), isExternal: vt(i) })))
|
|
1243
|
+
], 10, jn));
|
|
1097
1244
|
}
|
|
1098
|
-
}),
|
|
1099
|
-
function
|
|
1100
|
-
const
|
|
1101
|
-
if (!
|
|
1102
|
-
throw new
|
|
1103
|
-
return
|
|
1245
|
+
}), hr = Symbol();
|
|
1246
|
+
function Hn() {
|
|
1247
|
+
const t = st(hr);
|
|
1248
|
+
if (!t)
|
|
1249
|
+
throw new wt();
|
|
1250
|
+
return t;
|
|
1104
1251
|
}
|
|
1105
|
-
function
|
|
1106
|
-
const r =
|
|
1252
|
+
function yr(t, e) {
|
|
1253
|
+
const r = ee();
|
|
1107
1254
|
function n() {
|
|
1108
|
-
if (!
|
|
1255
|
+
if (!t)
|
|
1109
1256
|
return;
|
|
1110
|
-
if (!
|
|
1111
|
-
throw new
|
|
1257
|
+
if (!dr(r.route, t, e))
|
|
1258
|
+
throw new Wr(t, r.route.name);
|
|
1112
1259
|
}
|
|
1113
|
-
return
|
|
1260
|
+
return rt(r.route, n, { immediate: !0, deep: !0 }), r.route;
|
|
1114
1261
|
}
|
|
1115
|
-
const
|
|
1116
|
-
function
|
|
1117
|
-
return
|
|
1262
|
+
const mr = Symbol();
|
|
1263
|
+
function ye() {
|
|
1264
|
+
return st(mr, 0);
|
|
1118
1265
|
}
|
|
1119
|
-
function
|
|
1120
|
-
return
|
|
1266
|
+
function _n(t, e, r) {
|
|
1267
|
+
return Rt({
|
|
1121
1268
|
name: "PropsWrapper",
|
|
1122
1269
|
expose: [],
|
|
1123
1270
|
setup() {
|
|
1124
|
-
const n =
|
|
1271
|
+
const n = _r(), o = fr(), a = yr();
|
|
1125
1272
|
return () => {
|
|
1126
|
-
const s = o.getProps(
|
|
1127
|
-
return s instanceof Error ? "" :
|
|
1273
|
+
const s = o.getProps(t.id, e, a);
|
|
1274
|
+
return s instanceof Error ? "" : re(s) ? n != null && n.suspense ? pt(In, { component: r, props: s }) : pt(qn, { component: r, props: s }) : pt(r, s);
|
|
1128
1275
|
};
|
|
1129
1276
|
}
|
|
1130
1277
|
});
|
|
1131
1278
|
}
|
|
1132
|
-
const
|
|
1133
|
-
const
|
|
1134
|
-
return
|
|
1135
|
-
|
|
1136
|
-
}, { immediate: !0, deep: !0 }), () =>
|
|
1279
|
+
const qn = Rt((t) => {
|
|
1280
|
+
const e = qt();
|
|
1281
|
+
return rt(() => t.props, async (r) => {
|
|
1282
|
+
e.value = await r;
|
|
1283
|
+
}, { immediate: !0, deep: !0 }), () => e.value instanceof Error ? "" : e.value ? pt(t.component, e.value) : "";
|
|
1137
1284
|
}, {
|
|
1138
1285
|
props: ["component", "props"]
|
|
1139
|
-
}),
|
|
1140
|
-
const
|
|
1141
|
-
return
|
|
1142
|
-
|
|
1143
|
-
}, { deep: !0 }), () =>
|
|
1286
|
+
}), In = Rt(async (t) => {
|
|
1287
|
+
const e = qt();
|
|
1288
|
+
return e.value = await t.props, rt(() => e.value, async (r) => {
|
|
1289
|
+
e.value = await r;
|
|
1290
|
+
}, { deep: !0 }), () => e.value instanceof Error ? "" : e.value ? pt(t.component, e.value) : "";
|
|
1144
1291
|
}, {
|
|
1145
1292
|
props: ["component", "props"]
|
|
1146
|
-
}),
|
|
1147
|
-
function
|
|
1148
|
-
const
|
|
1293
|
+
}), gr = Symbol();
|
|
1294
|
+
function Jn() {
|
|
1295
|
+
const t = /* @__PURE__ */ new Map();
|
|
1149
1296
|
return {
|
|
1150
1297
|
getRouteComponents: (r) => {
|
|
1151
|
-
const n =
|
|
1298
|
+
const n = t.get(r.id);
|
|
1152
1299
|
if (n)
|
|
1153
1300
|
return n;
|
|
1154
|
-
const o =
|
|
1155
|
-
return
|
|
1301
|
+
const o = Dn(r);
|
|
1302
|
+
return t.set(r.id, o), o;
|
|
1156
1303
|
}
|
|
1157
1304
|
};
|
|
1158
1305
|
}
|
|
1159
|
-
function
|
|
1160
|
-
return
|
|
1306
|
+
function Dn(t) {
|
|
1307
|
+
return er(t) ? Pe(t, t.components) : tr(t) ? Pe(t, { default: t.component }) : { default: Rr };
|
|
1161
1308
|
}
|
|
1162
|
-
function
|
|
1309
|
+
function Pe(t, e) {
|
|
1163
1310
|
return Object.fromEntries(
|
|
1164
|
-
Object.entries(
|
|
1311
|
+
Object.entries(e).map(([r, n]) => [r, _n(t, r, n)])
|
|
1165
1312
|
);
|
|
1166
1313
|
}
|
|
1167
|
-
function
|
|
1168
|
-
const
|
|
1169
|
-
if (!
|
|
1170
|
-
throw new
|
|
1171
|
-
return
|
|
1314
|
+
function Fn() {
|
|
1315
|
+
const t = st(gr);
|
|
1316
|
+
if (!t)
|
|
1317
|
+
throw new wt();
|
|
1318
|
+
return t;
|
|
1172
1319
|
}
|
|
1173
|
-
const
|
|
1320
|
+
const Rr = /* @__PURE__ */ Rt({
|
|
1174
1321
|
__name: "routerView",
|
|
1175
1322
|
props: {
|
|
1176
1323
|
name: { default: "default" }
|
|
1177
1324
|
},
|
|
1178
|
-
setup(
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1181
|
-
const a =
|
|
1325
|
+
setup(t) {
|
|
1326
|
+
const e = yr(), r = Hn(), n = ye(), { getRouteComponents: o } = Fn();
|
|
1327
|
+
qr(mr, n + 1);
|
|
1328
|
+
const a = O(() => {
|
|
1182
1329
|
if (r.value)
|
|
1183
1330
|
return r.value.component;
|
|
1184
|
-
const s =
|
|
1185
|
-
return s ? o(s)[
|
|
1331
|
+
const s = e.matches.at(n);
|
|
1332
|
+
return s ? o(s)[t.name] : null;
|
|
1186
1333
|
});
|
|
1187
|
-
return (s,
|
|
1188
|
-
(
|
|
1189
|
-
]) :
|
|
1334
|
+
return (s, l) => a.value ? Oe(s.$slots, "default", je(Jr({ key: 0 }, { route: vt(e), component: a.value, rejection: vt(r) })), () => [
|
|
1335
|
+
(Ze(), Dr(Fr(a.value)))
|
|
1336
|
+
]) : Ir("", !0);
|
|
1190
1337
|
}
|
|
1191
1338
|
});
|
|
1192
|
-
class
|
|
1339
|
+
class at {
|
|
1193
1340
|
constructor() {
|
|
1194
1341
|
T(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
1195
1342
|
T(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
@@ -1199,235 +1346,236 @@ class oe {
|
|
|
1199
1346
|
T(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
1200
1347
|
}
|
|
1201
1348
|
}
|
|
1202
|
-
const
|
|
1349
|
+
const Pt = (t, e, r) => {
|
|
1203
1350
|
var a, s;
|
|
1204
|
-
const n =
|
|
1351
|
+
const n = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
1205
1352
|
return ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
|
|
1206
|
-
},
|
|
1353
|
+
}, At = (t, e, r) => {
|
|
1207
1354
|
var a, s;
|
|
1208
|
-
const n =
|
|
1355
|
+
const n = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
1209
1356
|
return ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
|
|
1210
|
-
},
|
|
1357
|
+
}, kt = (t, e, r) => {
|
|
1211
1358
|
var n, o;
|
|
1212
|
-
return ((n =
|
|
1359
|
+
return ((n = t.matches.at(r)) == null ? void 0 : n.id) === ((o = e == null ? void 0 : e.matches.at(r)) == null ? void 0 : o.id);
|
|
1213
1360
|
};
|
|
1214
|
-
function
|
|
1215
|
-
switch (
|
|
1361
|
+
function Ae(t) {
|
|
1362
|
+
switch (t) {
|
|
1216
1363
|
case "onBeforeRouteEnter":
|
|
1217
1364
|
case "onAfterRouteEnter":
|
|
1218
|
-
return
|
|
1365
|
+
return Pt;
|
|
1219
1366
|
case "onBeforeRouteUpdate":
|
|
1220
1367
|
case "onAfterRouteUpdate":
|
|
1221
|
-
return
|
|
1368
|
+
return kt;
|
|
1222
1369
|
case "onBeforeRouteLeave":
|
|
1223
1370
|
case "onAfterRouteLeave":
|
|
1224
|
-
return
|
|
1371
|
+
return At;
|
|
1225
1372
|
default:
|
|
1226
|
-
throw new Error(`Switch is not exhaustive for lifecycle: ${
|
|
1373
|
+
throw new Error(`Switch is not exhaustive for lifecycle: ${t}`);
|
|
1227
1374
|
}
|
|
1228
1375
|
}
|
|
1229
|
-
function
|
|
1230
|
-
const r = new
|
|
1231
|
-
return
|
|
1232
|
-
n.onBeforeRouteEnter &&
|
|
1233
|
-
}),
|
|
1234
|
-
n.onBeforeRouteLeave &&
|
|
1376
|
+
function Tn(t, e) {
|
|
1377
|
+
const r = new at();
|
|
1378
|
+
return t.matches.forEach((n, o) => {
|
|
1379
|
+
n.onBeforeRouteEnter && Pt(t, e, o) && dt(n.onBeforeRouteEnter).forEach((a) => r.onBeforeRouteEnter.add(a)), n.onBeforeRouteUpdate && kt(t, e, o) && dt(n.onBeforeRouteUpdate).forEach((a) => r.onBeforeRouteUpdate.add(a));
|
|
1380
|
+
}), e == null || e.matches.forEach((n, o) => {
|
|
1381
|
+
n.onBeforeRouteLeave && At(t, e, o) && dt(n.onBeforeRouteLeave).forEach((a) => r.onBeforeRouteLeave.add(a));
|
|
1235
1382
|
}), r;
|
|
1236
1383
|
}
|
|
1237
|
-
function
|
|
1238
|
-
const r = new
|
|
1239
|
-
return
|
|
1240
|
-
n.onAfterRouteEnter &&
|
|
1241
|
-
}),
|
|
1242
|
-
n.onAfterRouteLeave &&
|
|
1384
|
+
function Mn(t, e) {
|
|
1385
|
+
const r = new at();
|
|
1386
|
+
return t.matches.forEach((n, o) => {
|
|
1387
|
+
n.onAfterRouteEnter && Pt(t, e, o) && dt(n.onAfterRouteEnter).forEach((a) => r.onAfterRouteEnter.add(a)), n.onAfterRouteUpdate && kt(t, e, o) && dt(n.onAfterRouteUpdate).forEach((a) => r.onAfterRouteUpdate.add(a));
|
|
1388
|
+
}), e == null || e.matches.forEach((n, o) => {
|
|
1389
|
+
n.onAfterRouteLeave && At(t, e, o) && dt(n.onAfterRouteLeave).forEach((a) => r.onAfterRouteLeave.add(a));
|
|
1243
1390
|
}), r;
|
|
1244
1391
|
}
|
|
1245
|
-
function
|
|
1246
|
-
const n = new
|
|
1247
|
-
return
|
|
1248
|
-
|
|
1249
|
-
}),
|
|
1250
|
-
|
|
1392
|
+
function Wn(t, e, r) {
|
|
1393
|
+
const n = new at();
|
|
1394
|
+
return t.matches.forEach((o, a) => {
|
|
1395
|
+
Pt(t, e, a) && r.onBeforeRouteEnter.forEach((s) => n.onBeforeRouteEnter.add(s)), kt(t, e, a) && r.onBeforeRouteUpdate.forEach((s) => n.onBeforeRouteUpdate.add(s));
|
|
1396
|
+
}), e == null || e.matches.forEach((o, a) => {
|
|
1397
|
+
At(t, e, a) && r.onBeforeRouteLeave.forEach((s) => n.onBeforeRouteLeave.add(s));
|
|
1251
1398
|
}), n;
|
|
1252
1399
|
}
|
|
1253
|
-
function
|
|
1254
|
-
const n = new
|
|
1255
|
-
return
|
|
1256
|
-
|
|
1257
|
-
}),
|
|
1258
|
-
|
|
1400
|
+
function Gn(t, e, r) {
|
|
1401
|
+
const n = new at();
|
|
1402
|
+
return t.matches.forEach((o, a) => {
|
|
1403
|
+
Pt(t, e, a) && r.onAfterRouteEnter.forEach((s) => n.onAfterRouteEnter.add(s)), kt(t, e, a) && r.onAfterRouteUpdate.forEach((s) => n.onAfterRouteUpdate.add(s));
|
|
1404
|
+
}), e == null || e.matches.forEach((o, a) => {
|
|
1405
|
+
At(t, e, a) && r.onAfterRouteLeave.forEach((s) => n.onAfterRouteLeave.add(s));
|
|
1259
1406
|
}), n;
|
|
1260
1407
|
}
|
|
1261
|
-
const
|
|
1262
|
-
function
|
|
1263
|
-
const e = {
|
|
1264
|
-
global: new
|
|
1265
|
-
component: new
|
|
1266
|
-
}, { reject:
|
|
1267
|
-
async function
|
|
1268
|
-
const { global:
|
|
1408
|
+
const wr = Symbol();
|
|
1409
|
+
function zn() {
|
|
1410
|
+
const { setVueApp: t, runWithContext: e } = cr(), r = {
|
|
1411
|
+
global: new at(),
|
|
1412
|
+
component: new at()
|
|
1413
|
+
}, { reject: n, push: o, replace: a, abort: s } = ir(), l = (f) => (r.global.onBeforeRouteEnter.add(f), () => r.global.onBeforeRouteEnter.delete(f)), d = (f) => (r.global.onBeforeRouteUpdate.add(f), () => r.global.onBeforeRouteUpdate.delete(f)), i = (f) => (r.global.onBeforeRouteLeave.add(f), () => r.global.onBeforeRouteLeave.delete(f)), m = (f) => (r.global.onAfterRouteEnter.add(f), () => r.global.onAfterRouteEnter.delete(f)), b = (f) => (r.global.onAfterRouteUpdate.add(f), () => r.global.onAfterRouteUpdate.delete(f)), U = (f) => (r.global.onAfterRouteLeave.add(f), () => r.global.onAfterRouteLeave.delete(f));
|
|
1414
|
+
async function P({ to: f, from: c }) {
|
|
1415
|
+
const { global: v, component: k } = r, A = Tn(f, c), g = Wn(f, c, v), u = [
|
|
1416
|
+
...g.onBeforeRouteEnter,
|
|
1269
1417
|
...A.onBeforeRouteEnter,
|
|
1270
|
-
...
|
|
1418
|
+
...g.onBeforeRouteUpdate,
|
|
1271
1419
|
...A.onBeforeRouteUpdate,
|
|
1272
|
-
...
|
|
1273
|
-
...
|
|
1420
|
+
...k.onBeforeRouteUpdate,
|
|
1421
|
+
...g.onBeforeRouteLeave,
|
|
1274
1422
|
...A.onBeforeRouteLeave,
|
|
1275
|
-
...
|
|
1276
|
-
...R.onBeforeRouteLeave
|
|
1423
|
+
...k.onBeforeRouteLeave
|
|
1277
1424
|
];
|
|
1278
1425
|
try {
|
|
1279
|
-
const
|
|
1280
|
-
from:
|
|
1281
|
-
reject:
|
|
1282
|
-
push:
|
|
1283
|
-
replace:
|
|
1284
|
-
abort:
|
|
1285
|
-
})
|
|
1286
|
-
await Promise.all(
|
|
1287
|
-
} catch (
|
|
1288
|
-
if (
|
|
1289
|
-
return
|
|
1290
|
-
throw
|
|
1426
|
+
const h = u.map((x) => e(() => x(f, {
|
|
1427
|
+
from: c,
|
|
1428
|
+
reject: n,
|
|
1429
|
+
push: o,
|
|
1430
|
+
replace: a,
|
|
1431
|
+
abort: s
|
|
1432
|
+
})));
|
|
1433
|
+
await Promise.all(h);
|
|
1434
|
+
} catch (h) {
|
|
1435
|
+
if (h instanceof ht || h instanceof Vt || h instanceof sr)
|
|
1436
|
+
return h.response;
|
|
1437
|
+
throw h;
|
|
1291
1438
|
}
|
|
1292
1439
|
return {
|
|
1293
1440
|
status: "SUCCESS"
|
|
1294
1441
|
};
|
|
1295
1442
|
}
|
|
1296
|
-
async function
|
|
1297
|
-
const { global:
|
|
1298
|
-
...
|
|
1299
|
-
...P.onAfterRouteLeave,
|
|
1443
|
+
async function w({ to: f, from: c }) {
|
|
1444
|
+
const { global: v, component: k } = r, A = Mn(f, c), g = Gn(f, c, v), u = [
|
|
1445
|
+
...k.onAfterRouteLeave,
|
|
1300
1446
|
...A.onAfterRouteLeave,
|
|
1301
|
-
...
|
|
1302
|
-
...
|
|
1447
|
+
...g.onAfterRouteLeave,
|
|
1448
|
+
...k.onAfterRouteUpdate,
|
|
1303
1449
|
...A.onAfterRouteUpdate,
|
|
1304
|
-
...
|
|
1305
|
-
...
|
|
1306
|
-
...A.onAfterRouteEnter
|
|
1450
|
+
...g.onAfterRouteUpdate,
|
|
1451
|
+
...k.onAfterRouteEnter,
|
|
1452
|
+
...A.onAfterRouteEnter,
|
|
1453
|
+
...g.onAfterRouteEnter
|
|
1307
1454
|
];
|
|
1308
1455
|
try {
|
|
1309
|
-
const
|
|
1310
|
-
from:
|
|
1311
|
-
reject:
|
|
1312
|
-
push:
|
|
1313
|
-
replace:
|
|
1314
|
-
})
|
|
1315
|
-
await Promise.all(
|
|
1316
|
-
} catch (
|
|
1317
|
-
if (
|
|
1318
|
-
return
|
|
1319
|
-
throw
|
|
1456
|
+
const h = u.map((x) => e(() => x(f, {
|
|
1457
|
+
from: c,
|
|
1458
|
+
reject: n,
|
|
1459
|
+
push: o,
|
|
1460
|
+
replace: a
|
|
1461
|
+
})));
|
|
1462
|
+
await Promise.all(h);
|
|
1463
|
+
} catch (h) {
|
|
1464
|
+
if (h instanceof ht || h instanceof Vt)
|
|
1465
|
+
return h.response;
|
|
1466
|
+
throw h;
|
|
1320
1467
|
}
|
|
1321
1468
|
return {
|
|
1322
1469
|
status: "SUCCESS"
|
|
1323
1470
|
};
|
|
1324
1471
|
}
|
|
1325
1472
|
return {
|
|
1326
|
-
runBeforeRouteHooks:
|
|
1327
|
-
runAfterRouteHooks:
|
|
1328
|
-
addComponentBeforeRouteHook: ({ lifecycle:
|
|
1329
|
-
const
|
|
1330
|
-
if (
|
|
1331
|
-
return
|
|
1473
|
+
runBeforeRouteHooks: P,
|
|
1474
|
+
runAfterRouteHooks: w,
|
|
1475
|
+
addComponentBeforeRouteHook: ({ lifecycle: f, depth: c, hook: v }) => {
|
|
1476
|
+
const k = Ae(f), A = r.component[f], g = (u, h) => {
|
|
1477
|
+
if (k(u, h.from, c))
|
|
1478
|
+
return v(u, h);
|
|
1332
1479
|
};
|
|
1333
|
-
return
|
|
1480
|
+
return A.add(g), () => A.delete(g);
|
|
1334
1481
|
},
|
|
1335
|
-
addComponentAfterRouteHook: ({ lifecycle:
|
|
1336
|
-
const
|
|
1337
|
-
if (
|
|
1338
|
-
return
|
|
1482
|
+
addComponentAfterRouteHook: ({ lifecycle: f, depth: c, hook: v }) => {
|
|
1483
|
+
const k = Ae(f), A = r.component[f], g = (u, h) => {
|
|
1484
|
+
if (k(u, h.from, c))
|
|
1485
|
+
return v(u, h);
|
|
1339
1486
|
};
|
|
1340
|
-
return
|
|
1487
|
+
return A.add(g), () => A.delete(g);
|
|
1341
1488
|
},
|
|
1342
|
-
addGlobalRouteHooks: (
|
|
1343
|
-
|
|
1489
|
+
addGlobalRouteHooks: (f) => {
|
|
1490
|
+
f.onBeforeRouteEnter.forEach((c) => l(c)), f.onBeforeRouteUpdate.forEach((c) => d(c)), f.onBeforeRouteLeave.forEach((c) => i(c)), f.onAfterRouteEnter.forEach((c) => m(c)), f.onAfterRouteUpdate.forEach((c) => b(c)), f.onAfterRouteLeave.forEach((c) => U(c));
|
|
1344
1491
|
},
|
|
1345
|
-
onBeforeRouteEnter:
|
|
1346
|
-
onBeforeRouteUpdate:
|
|
1347
|
-
onBeforeRouteLeave:
|
|
1348
|
-
onAfterRouteEnter:
|
|
1349
|
-
onAfterRouteUpdate:
|
|
1350
|
-
onAfterRouteLeave:
|
|
1492
|
+
onBeforeRouteEnter: l,
|
|
1493
|
+
onBeforeRouteUpdate: d,
|
|
1494
|
+
onBeforeRouteLeave: i,
|
|
1495
|
+
onAfterRouteEnter: m,
|
|
1496
|
+
onAfterRouteUpdate: b,
|
|
1497
|
+
onAfterRouteLeave: U,
|
|
1498
|
+
setVueApp: t
|
|
1351
1499
|
};
|
|
1352
1500
|
}
|
|
1353
|
-
function
|
|
1354
|
-
const
|
|
1355
|
-
if (!
|
|
1356
|
-
throw new
|
|
1357
|
-
return
|
|
1501
|
+
function Er() {
|
|
1502
|
+
const t = st(wr);
|
|
1503
|
+
if (!t)
|
|
1504
|
+
throw new wt();
|
|
1505
|
+
return t;
|
|
1358
1506
|
}
|
|
1359
|
-
function
|
|
1360
|
-
return (
|
|
1361
|
-
const r =
|
|
1362
|
-
return
|
|
1507
|
+
function vr(t) {
|
|
1508
|
+
return (e) => {
|
|
1509
|
+
const r = ye(), o = Er().addComponentBeforeRouteHook({ lifecycle: t, hook: e, depth: r - 1 });
|
|
1510
|
+
return _t(o), o;
|
|
1363
1511
|
};
|
|
1364
1512
|
}
|
|
1365
|
-
function
|
|
1366
|
-
return (
|
|
1367
|
-
const r =
|
|
1368
|
-
return
|
|
1513
|
+
function br(t) {
|
|
1514
|
+
return (e) => {
|
|
1515
|
+
const r = ye(), o = Er().addComponentAfterRouteHook({ lifecycle: t, hook: e, depth: r - 1 });
|
|
1516
|
+
return _t(o), o;
|
|
1369
1517
|
};
|
|
1370
1518
|
}
|
|
1371
|
-
const
|
|
1372
|
-
function
|
|
1373
|
-
return
|
|
1374
|
-
for (var
|
|
1375
|
-
var r = arguments[
|
|
1376
|
-
for (var n in r) ({}).hasOwnProperty.call(r, n) && (
|
|
1519
|
+
const $o = vr("onBeforeRouteLeave"), Ho = vr("onBeforeRouteUpdate"), _o = br("onAfterRouteLeave"), qo = br("onAfterRouteUpdate");
|
|
1520
|
+
function Y() {
|
|
1521
|
+
return Y = Object.assign ? Object.assign.bind() : function(t) {
|
|
1522
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
1523
|
+
var r = arguments[e];
|
|
1524
|
+
for (var n in r) ({}).hasOwnProperty.call(r, n) && (t[n] = r[n]);
|
|
1377
1525
|
}
|
|
1378
|
-
return
|
|
1379
|
-
},
|
|
1526
|
+
return t;
|
|
1527
|
+
}, Y.apply(null, arguments);
|
|
1380
1528
|
}
|
|
1381
1529
|
var j;
|
|
1382
|
-
(function(
|
|
1383
|
-
|
|
1530
|
+
(function(t) {
|
|
1531
|
+
t.Pop = "POP", t.Push = "PUSH", t.Replace = "REPLACE";
|
|
1384
1532
|
})(j || (j = {}));
|
|
1385
|
-
var
|
|
1386
|
-
return Object.freeze(
|
|
1387
|
-
} : function(
|
|
1388
|
-
return
|
|
1533
|
+
var mt = process.env.NODE_ENV !== "production" ? function(t) {
|
|
1534
|
+
return Object.freeze(t);
|
|
1535
|
+
} : function(t) {
|
|
1536
|
+
return t;
|
|
1389
1537
|
};
|
|
1390
|
-
function
|
|
1391
|
-
if (!
|
|
1392
|
-
typeof console < "u" && console.warn(
|
|
1538
|
+
function tt(t, e) {
|
|
1539
|
+
if (!t) {
|
|
1540
|
+
typeof console < "u" && console.warn(e);
|
|
1393
1541
|
try {
|
|
1394
|
-
throw new Error(
|
|
1542
|
+
throw new Error(e);
|
|
1395
1543
|
} catch {
|
|
1396
1544
|
}
|
|
1397
1545
|
}
|
|
1398
1546
|
}
|
|
1399
|
-
var
|
|
1400
|
-
function
|
|
1401
|
-
|
|
1402
|
-
var
|
|
1547
|
+
var Zt = "beforeunload", Qn = "hashchange", Sr = "popstate";
|
|
1548
|
+
function ke(t) {
|
|
1549
|
+
t === void 0 && (t = {});
|
|
1550
|
+
var e = t, r = e.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
1403
1551
|
function a() {
|
|
1404
|
-
var
|
|
1405
|
-
return [
|
|
1406
|
-
pathname:
|
|
1407
|
-
search:
|
|
1552
|
+
var g = n.location, u = g.pathname, h = g.search, x = g.hash, N = o.state || {};
|
|
1553
|
+
return [N.idx, mt({
|
|
1554
|
+
pathname: u,
|
|
1555
|
+
search: h,
|
|
1408
1556
|
hash: x,
|
|
1409
|
-
state:
|
|
1410
|
-
key:
|
|
1557
|
+
state: N.usr || null,
|
|
1558
|
+
key: N.key || "default"
|
|
1411
1559
|
})];
|
|
1412
1560
|
}
|
|
1413
1561
|
var s = null;
|
|
1414
|
-
function
|
|
1562
|
+
function l() {
|
|
1415
1563
|
if (s)
|
|
1416
|
-
|
|
1564
|
+
P.call(s), s = null;
|
|
1417
1565
|
else {
|
|
1418
|
-
var
|
|
1419
|
-
if (
|
|
1420
|
-
if (
|
|
1421
|
-
var
|
|
1422
|
-
|
|
1423
|
-
action:
|
|
1566
|
+
var g = j.Pop, u = a(), h = u[0], x = u[1];
|
|
1567
|
+
if (P.length)
|
|
1568
|
+
if (h != null) {
|
|
1569
|
+
var N = m - h;
|
|
1570
|
+
N && (s = {
|
|
1571
|
+
action: g,
|
|
1424
1572
|
location: x,
|
|
1425
1573
|
retry: function() {
|
|
1426
|
-
|
|
1574
|
+
k(N * -1);
|
|
1427
1575
|
}
|
|
1428
|
-
},
|
|
1576
|
+
}, k(N));
|
|
1429
1577
|
} else
|
|
1430
|
-
process.env.NODE_ENV !== "production" &&
|
|
1578
|
+
process.env.NODE_ENV !== "production" && tt(
|
|
1431
1579
|
!1,
|
|
1432
1580
|
// TODO: Write up a doc that explains our blocking strategy in
|
|
1433
1581
|
// detail and link to it here so people can understand better what
|
|
@@ -1435,137 +1583,137 @@ function wt(e) {
|
|
|
1435
1583
|
"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."
|
|
1436
1584
|
);
|
|
1437
1585
|
else
|
|
1438
|
-
|
|
1586
|
+
f(g);
|
|
1439
1587
|
}
|
|
1440
1588
|
}
|
|
1441
|
-
n.addEventListener(
|
|
1442
|
-
var
|
|
1443
|
-
|
|
1444
|
-
idx:
|
|
1589
|
+
n.addEventListener(Sr, l);
|
|
1590
|
+
var d = j.Pop, i = a(), m = i[0], b = i[1], U = gt(), P = gt();
|
|
1591
|
+
m == null && (m = 0, o.replaceState(Y({}, o.state, {
|
|
1592
|
+
idx: m
|
|
1445
1593
|
}), ""));
|
|
1446
|
-
function g
|
|
1447
|
-
return typeof
|
|
1594
|
+
function w(g) {
|
|
1595
|
+
return typeof g == "string" ? g : et(g);
|
|
1448
1596
|
}
|
|
1449
|
-
function
|
|
1450
|
-
return
|
|
1451
|
-
pathname:
|
|
1597
|
+
function y(g, u) {
|
|
1598
|
+
return u === void 0 && (u = null), mt(Y({
|
|
1599
|
+
pathname: b.pathname,
|
|
1452
1600
|
hash: "",
|
|
1453
1601
|
search: ""
|
|
1454
|
-
}, typeof
|
|
1455
|
-
state:
|
|
1456
|
-
key:
|
|
1602
|
+
}, typeof g == "string" ? bt(g) : g, {
|
|
1603
|
+
state: u,
|
|
1604
|
+
key: jt()
|
|
1457
1605
|
}));
|
|
1458
1606
|
}
|
|
1459
|
-
function
|
|
1607
|
+
function p(g, u) {
|
|
1460
1608
|
return [{
|
|
1461
|
-
usr:
|
|
1462
|
-
key:
|
|
1463
|
-
idx:
|
|
1464
|
-
}, g
|
|
1465
|
-
}
|
|
1466
|
-
function
|
|
1467
|
-
return !
|
|
1468
|
-
action:
|
|
1469
|
-
location:
|
|
1470
|
-
retry:
|
|
1609
|
+
usr: g.state,
|
|
1610
|
+
key: g.key,
|
|
1611
|
+
idx: u
|
|
1612
|
+
}, w(g)];
|
|
1613
|
+
}
|
|
1614
|
+
function R(g, u, h) {
|
|
1615
|
+
return !P.length || (P.call({
|
|
1616
|
+
action: g,
|
|
1617
|
+
location: u,
|
|
1618
|
+
retry: h
|
|
1471
1619
|
}), !1);
|
|
1472
1620
|
}
|
|
1473
|
-
function
|
|
1474
|
-
|
|
1475
|
-
var
|
|
1476
|
-
|
|
1477
|
-
action:
|
|
1478
|
-
location:
|
|
1621
|
+
function f(g) {
|
|
1622
|
+
d = g;
|
|
1623
|
+
var u = a();
|
|
1624
|
+
m = u[0], b = u[1], U.call({
|
|
1625
|
+
action: d,
|
|
1626
|
+
location: b
|
|
1479
1627
|
});
|
|
1480
1628
|
}
|
|
1481
|
-
function
|
|
1482
|
-
var
|
|
1483
|
-
function
|
|
1484
|
-
|
|
1629
|
+
function c(g, u) {
|
|
1630
|
+
var h = j.Push, x = y(g, u);
|
|
1631
|
+
function N() {
|
|
1632
|
+
c(g, u);
|
|
1485
1633
|
}
|
|
1486
|
-
if (
|
|
1487
|
-
var
|
|
1634
|
+
if (R(h, x, N)) {
|
|
1635
|
+
var V = p(x, m + 1), Z = V[0], $ = V[1];
|
|
1488
1636
|
try {
|
|
1489
|
-
o.pushState(
|
|
1637
|
+
o.pushState(Z, "", $);
|
|
1490
1638
|
} catch {
|
|
1491
1639
|
n.location.assign($);
|
|
1492
1640
|
}
|
|
1493
|
-
|
|
1641
|
+
f(h);
|
|
1494
1642
|
}
|
|
1495
1643
|
}
|
|
1496
|
-
function
|
|
1497
|
-
var
|
|
1498
|
-
function
|
|
1499
|
-
|
|
1644
|
+
function v(g, u) {
|
|
1645
|
+
var h = j.Replace, x = y(g, u);
|
|
1646
|
+
function N() {
|
|
1647
|
+
v(g, u);
|
|
1500
1648
|
}
|
|
1501
|
-
if (
|
|
1502
|
-
var
|
|
1503
|
-
o.replaceState(
|
|
1649
|
+
if (R(h, x, N)) {
|
|
1650
|
+
var V = p(x, m), Z = V[0], $ = V[1];
|
|
1651
|
+
o.replaceState(Z, "", $), f(h);
|
|
1504
1652
|
}
|
|
1505
1653
|
}
|
|
1506
|
-
function
|
|
1507
|
-
o.go(
|
|
1654
|
+
function k(g) {
|
|
1655
|
+
o.go(g);
|
|
1508
1656
|
}
|
|
1509
1657
|
var A = {
|
|
1510
1658
|
get action() {
|
|
1511
|
-
return
|
|
1659
|
+
return d;
|
|
1512
1660
|
},
|
|
1513
1661
|
get location() {
|
|
1514
|
-
return
|
|
1662
|
+
return b;
|
|
1515
1663
|
},
|
|
1516
|
-
createHref:
|
|
1517
|
-
push:
|
|
1518
|
-
replace:
|
|
1519
|
-
go:
|
|
1664
|
+
createHref: w,
|
|
1665
|
+
push: c,
|
|
1666
|
+
replace: v,
|
|
1667
|
+
go: k,
|
|
1520
1668
|
back: function() {
|
|
1521
|
-
|
|
1669
|
+
k(-1);
|
|
1522
1670
|
},
|
|
1523
1671
|
forward: function() {
|
|
1524
|
-
|
|
1672
|
+
k(1);
|
|
1525
1673
|
},
|
|
1526
|
-
listen: function(
|
|
1527
|
-
return U.push(
|
|
1674
|
+
listen: function(u) {
|
|
1675
|
+
return U.push(u);
|
|
1528
1676
|
},
|
|
1529
|
-
block: function(
|
|
1530
|
-
var
|
|
1531
|
-
return
|
|
1532
|
-
|
|
1677
|
+
block: function(u) {
|
|
1678
|
+
var h = P.push(u);
|
|
1679
|
+
return P.length === 1 && n.addEventListener(Zt, Ot), function() {
|
|
1680
|
+
h(), P.length || n.removeEventListener(Zt, Ot);
|
|
1533
1681
|
};
|
|
1534
1682
|
}
|
|
1535
1683
|
};
|
|
1536
1684
|
return A;
|
|
1537
1685
|
}
|
|
1538
|
-
function
|
|
1539
|
-
|
|
1540
|
-
var
|
|
1686
|
+
function Kn(t) {
|
|
1687
|
+
t === void 0 && (t = {});
|
|
1688
|
+
var e = t, r = e.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
1541
1689
|
function a() {
|
|
1542
|
-
var
|
|
1543
|
-
return [
|
|
1690
|
+
var u = bt(n.location.hash.substr(1)), h = u.pathname, x = h === void 0 ? "/" : h, N = u.search, V = N === void 0 ? "" : N, Z = u.hash, $ = Z === void 0 ? "" : Z, I = o.state || {};
|
|
1691
|
+
return [I.idx, mt({
|
|
1544
1692
|
pathname: x,
|
|
1545
|
-
search:
|
|
1693
|
+
search: V,
|
|
1546
1694
|
hash: $,
|
|
1547
|
-
state:
|
|
1548
|
-
key:
|
|
1695
|
+
state: I.usr || null,
|
|
1696
|
+
key: I.key || "default"
|
|
1549
1697
|
})];
|
|
1550
1698
|
}
|
|
1551
1699
|
var s = null;
|
|
1552
|
-
function
|
|
1700
|
+
function l() {
|
|
1553
1701
|
if (s)
|
|
1554
|
-
|
|
1702
|
+
P.call(s), s = null;
|
|
1555
1703
|
else {
|
|
1556
|
-
var
|
|
1557
|
-
if (
|
|
1704
|
+
var u = j.Pop, h = a(), x = h[0], N = h[1];
|
|
1705
|
+
if (P.length)
|
|
1558
1706
|
if (x != null) {
|
|
1559
|
-
var
|
|
1560
|
-
|
|
1561
|
-
action:
|
|
1562
|
-
location:
|
|
1707
|
+
var V = m - x;
|
|
1708
|
+
V && (s = {
|
|
1709
|
+
action: u,
|
|
1710
|
+
location: N,
|
|
1563
1711
|
retry: function() {
|
|
1564
|
-
A(
|
|
1712
|
+
A(V * -1);
|
|
1565
1713
|
}
|
|
1566
|
-
}, A(
|
|
1714
|
+
}, A(V));
|
|
1567
1715
|
} else
|
|
1568
|
-
process.env.NODE_ENV !== "production" &&
|
|
1716
|
+
process.env.NODE_ENV !== "production" && tt(
|
|
1569
1717
|
!1,
|
|
1570
1718
|
// TODO: Write up a doc that explains our blocking strategy in
|
|
1571
1719
|
// detail and link to it here so people can understand better
|
|
@@ -1573,98 +1721,98 @@ function Dn(e) {
|
|
|
1573
1721
|
"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."
|
|
1574
1722
|
);
|
|
1575
1723
|
else
|
|
1576
|
-
|
|
1724
|
+
c(u);
|
|
1577
1725
|
}
|
|
1578
1726
|
}
|
|
1579
|
-
n.addEventListener(
|
|
1580
|
-
var
|
|
1581
|
-
|
|
1727
|
+
n.addEventListener(Sr, l), n.addEventListener(Qn, function() {
|
|
1728
|
+
var u = a(), h = u[1];
|
|
1729
|
+
et(h) !== et(b) && l();
|
|
1582
1730
|
});
|
|
1583
|
-
var
|
|
1584
|
-
|
|
1585
|
-
idx:
|
|
1731
|
+
var d = j.Pop, i = a(), m = i[0], b = i[1], U = gt(), P = gt();
|
|
1732
|
+
m == null && (m = 0, o.replaceState(Y({}, o.state, {
|
|
1733
|
+
idx: m
|
|
1586
1734
|
}), ""));
|
|
1587
|
-
function
|
|
1588
|
-
var
|
|
1589
|
-
if (
|
|
1590
|
-
var x = n.location.href,
|
|
1591
|
-
|
|
1735
|
+
function w() {
|
|
1736
|
+
var u = document.querySelector("base"), h = "";
|
|
1737
|
+
if (u && u.getAttribute("href")) {
|
|
1738
|
+
var x = n.location.href, N = x.indexOf("#");
|
|
1739
|
+
h = N === -1 ? x : x.slice(0, N);
|
|
1592
1740
|
}
|
|
1593
|
-
return
|
|
1741
|
+
return h;
|
|
1594
1742
|
}
|
|
1595
|
-
function
|
|
1596
|
-
return
|
|
1743
|
+
function y(u) {
|
|
1744
|
+
return w() + "#" + (typeof u == "string" ? u : et(u));
|
|
1597
1745
|
}
|
|
1598
|
-
function
|
|
1599
|
-
return
|
|
1600
|
-
pathname:
|
|
1746
|
+
function p(u, h) {
|
|
1747
|
+
return h === void 0 && (h = null), mt(Y({
|
|
1748
|
+
pathname: b.pathname,
|
|
1601
1749
|
hash: "",
|
|
1602
1750
|
search: ""
|
|
1603
|
-
}, typeof
|
|
1604
|
-
state:
|
|
1605
|
-
key:
|
|
1751
|
+
}, typeof u == "string" ? bt(u) : u, {
|
|
1752
|
+
state: h,
|
|
1753
|
+
key: jt()
|
|
1606
1754
|
}));
|
|
1607
1755
|
}
|
|
1608
|
-
function u
|
|
1756
|
+
function R(u, h) {
|
|
1609
1757
|
return [{
|
|
1610
|
-
usr:
|
|
1611
|
-
key:
|
|
1612
|
-
idx:
|
|
1613
|
-
},
|
|
1614
|
-
}
|
|
1615
|
-
function
|
|
1616
|
-
return !
|
|
1617
|
-
action:
|
|
1618
|
-
location:
|
|
1758
|
+
usr: u.state,
|
|
1759
|
+
key: u.key,
|
|
1760
|
+
idx: h
|
|
1761
|
+
}, y(u)];
|
|
1762
|
+
}
|
|
1763
|
+
function f(u, h, x) {
|
|
1764
|
+
return !P.length || (P.call({
|
|
1765
|
+
action: u,
|
|
1766
|
+
location: h,
|
|
1619
1767
|
retry: x
|
|
1620
1768
|
}), !1);
|
|
1621
1769
|
}
|
|
1622
|
-
function
|
|
1623
|
-
|
|
1624
|
-
var
|
|
1625
|
-
|
|
1626
|
-
action:
|
|
1627
|
-
location:
|
|
1770
|
+
function c(u) {
|
|
1771
|
+
d = u;
|
|
1772
|
+
var h = a();
|
|
1773
|
+
m = h[0], b = h[1], U.call({
|
|
1774
|
+
action: d,
|
|
1775
|
+
location: b
|
|
1628
1776
|
});
|
|
1629
1777
|
}
|
|
1630
|
-
function
|
|
1631
|
-
var x = j.Push,
|
|
1632
|
-
function
|
|
1633
|
-
|
|
1778
|
+
function v(u, h) {
|
|
1779
|
+
var x = j.Push, N = p(u, h);
|
|
1780
|
+
function V() {
|
|
1781
|
+
v(u, h);
|
|
1634
1782
|
}
|
|
1635
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
1636
|
-
var
|
|
1783
|
+
if (process.env.NODE_ENV !== "production" && tt(N.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(u) + ")"), f(x, N, V)) {
|
|
1784
|
+
var Z = R(N, m + 1), $ = Z[0], I = Z[1];
|
|
1637
1785
|
try {
|
|
1638
|
-
o.pushState($, "",
|
|
1786
|
+
o.pushState($, "", I);
|
|
1639
1787
|
} catch {
|
|
1640
|
-
n.location.assign(
|
|
1788
|
+
n.location.assign(I);
|
|
1641
1789
|
}
|
|
1642
|
-
|
|
1790
|
+
c(x);
|
|
1643
1791
|
}
|
|
1644
1792
|
}
|
|
1645
|
-
function
|
|
1646
|
-
var x = j.Replace,
|
|
1647
|
-
function
|
|
1648
|
-
|
|
1793
|
+
function k(u, h) {
|
|
1794
|
+
var x = j.Replace, N = p(u, h);
|
|
1795
|
+
function V() {
|
|
1796
|
+
k(u, h);
|
|
1649
1797
|
}
|
|
1650
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
1651
|
-
var
|
|
1652
|
-
o.replaceState($, "",
|
|
1798
|
+
if (process.env.NODE_ENV !== "production" && tt(N.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(u) + ")"), f(x, N, V)) {
|
|
1799
|
+
var Z = R(N, m), $ = Z[0], I = Z[1];
|
|
1800
|
+
o.replaceState($, "", I), c(x);
|
|
1653
1801
|
}
|
|
1654
1802
|
}
|
|
1655
|
-
function A(
|
|
1656
|
-
o.go(
|
|
1803
|
+
function A(u) {
|
|
1804
|
+
o.go(u);
|
|
1657
1805
|
}
|
|
1658
|
-
var
|
|
1806
|
+
var g = {
|
|
1659
1807
|
get action() {
|
|
1660
|
-
return
|
|
1808
|
+
return d;
|
|
1661
1809
|
},
|
|
1662
1810
|
get location() {
|
|
1663
|
-
return
|
|
1811
|
+
return b;
|
|
1664
1812
|
},
|
|
1665
|
-
createHref:
|
|
1666
|
-
push:
|
|
1667
|
-
replace:
|
|
1813
|
+
createHref: y,
|
|
1814
|
+
push: v,
|
|
1815
|
+
replace: k,
|
|
1668
1816
|
go: A,
|
|
1669
1817
|
back: function() {
|
|
1670
1818
|
A(-1);
|
|
@@ -1672,170 +1820,170 @@ function Dn(e) {
|
|
|
1672
1820
|
forward: function() {
|
|
1673
1821
|
A(1);
|
|
1674
1822
|
},
|
|
1675
|
-
listen: function(
|
|
1676
|
-
return U.push(
|
|
1823
|
+
listen: function(h) {
|
|
1824
|
+
return U.push(h);
|
|
1677
1825
|
},
|
|
1678
|
-
block: function(
|
|
1679
|
-
var x =
|
|
1680
|
-
return
|
|
1681
|
-
x(),
|
|
1826
|
+
block: function(h) {
|
|
1827
|
+
var x = P.push(h);
|
|
1828
|
+
return P.length === 1 && n.addEventListener(Zt, Ot), function() {
|
|
1829
|
+
x(), P.length || n.removeEventListener(Zt, Ot);
|
|
1682
1830
|
};
|
|
1683
1831
|
}
|
|
1684
1832
|
};
|
|
1685
|
-
return
|
|
1833
|
+
return g;
|
|
1686
1834
|
}
|
|
1687
|
-
function
|
|
1688
|
-
|
|
1689
|
-
var
|
|
1690
|
-
var
|
|
1835
|
+
function xe(t) {
|
|
1836
|
+
t === void 0 && (t = {});
|
|
1837
|
+
var e = t, r = e.initialEntries, n = r === void 0 ? ["/"] : r, o = e.initialIndex, a = n.map(function(c) {
|
|
1838
|
+
var v = mt(Y({
|
|
1691
1839
|
pathname: "/",
|
|
1692
1840
|
search: "",
|
|
1693
1841
|
hash: "",
|
|
1694
1842
|
state: null,
|
|
1695
|
-
key:
|
|
1696
|
-
}, typeof
|
|
1697
|
-
return process.env.NODE_ENV !== "production" &&
|
|
1698
|
-
}), s =
|
|
1699
|
-
function
|
|
1700
|
-
return typeof
|
|
1701
|
-
}
|
|
1702
|
-
function U(
|
|
1703
|
-
return
|
|
1704
|
-
pathname:
|
|
1843
|
+
key: jt()
|
|
1844
|
+
}, typeof c == "string" ? bt(c) : c));
|
|
1845
|
+
return process.env.NODE_ENV !== "production" && tt(v.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(c) + ")"), v;
|
|
1846
|
+
}), s = Ne(o ?? a.length - 1, 0, a.length - 1), l = j.Pop, d = a[s], i = gt(), m = gt();
|
|
1847
|
+
function b(c) {
|
|
1848
|
+
return typeof c == "string" ? c : et(c);
|
|
1849
|
+
}
|
|
1850
|
+
function U(c, v) {
|
|
1851
|
+
return v === void 0 && (v = null), mt(Y({
|
|
1852
|
+
pathname: d.pathname,
|
|
1705
1853
|
search: "",
|
|
1706
1854
|
hash: ""
|
|
1707
|
-
}, typeof
|
|
1708
|
-
state:
|
|
1709
|
-
key:
|
|
1855
|
+
}, typeof c == "string" ? bt(c) : c, {
|
|
1856
|
+
state: v,
|
|
1857
|
+
key: jt()
|
|
1710
1858
|
}));
|
|
1711
1859
|
}
|
|
1712
|
-
function
|
|
1713
|
-
return !
|
|
1714
|
-
action:
|
|
1715
|
-
location:
|
|
1716
|
-
retry:
|
|
1860
|
+
function P(c, v, k) {
|
|
1861
|
+
return !m.length || (m.call({
|
|
1862
|
+
action: c,
|
|
1863
|
+
location: v,
|
|
1864
|
+
retry: k
|
|
1717
1865
|
}), !1);
|
|
1718
1866
|
}
|
|
1719
|
-
function
|
|
1720
|
-
|
|
1721
|
-
action:
|
|
1722
|
-
location:
|
|
1867
|
+
function w(c, v) {
|
|
1868
|
+
l = c, d = v, i.call({
|
|
1869
|
+
action: l,
|
|
1870
|
+
location: d
|
|
1723
1871
|
});
|
|
1724
1872
|
}
|
|
1725
|
-
function
|
|
1726
|
-
var
|
|
1727
|
-
function
|
|
1728
|
-
|
|
1873
|
+
function y(c, v) {
|
|
1874
|
+
var k = j.Push, A = U(c, v);
|
|
1875
|
+
function g() {
|
|
1876
|
+
y(c, v);
|
|
1729
1877
|
}
|
|
1730
|
-
process.env.NODE_ENV !== "production" &&
|
|
1878
|
+
process.env.NODE_ENV !== "production" && tt(d.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(c) + ")"), P(k, A, g) && (s += 1, a.splice(s, a.length, A), w(k, A));
|
|
1731
1879
|
}
|
|
1732
|
-
function c
|
|
1733
|
-
var
|
|
1734
|
-
function
|
|
1735
|
-
c
|
|
1880
|
+
function p(c, v) {
|
|
1881
|
+
var k = j.Replace, A = U(c, v);
|
|
1882
|
+
function g() {
|
|
1883
|
+
p(c, v);
|
|
1736
1884
|
}
|
|
1737
|
-
process.env.NODE_ENV !== "production" &&
|
|
1885
|
+
process.env.NODE_ENV !== "production" && tt(d.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(c) + ")"), P(k, A, g) && (a[s] = A, w(k, A));
|
|
1738
1886
|
}
|
|
1739
|
-
function
|
|
1740
|
-
var
|
|
1741
|
-
function
|
|
1742
|
-
|
|
1887
|
+
function R(c) {
|
|
1888
|
+
var v = Ne(s + c, 0, a.length - 1), k = j.Pop, A = a[v];
|
|
1889
|
+
function g() {
|
|
1890
|
+
R(c);
|
|
1743
1891
|
}
|
|
1744
|
-
k
|
|
1892
|
+
P(k, A, g) && (s = v, w(k, A));
|
|
1745
1893
|
}
|
|
1746
|
-
var
|
|
1894
|
+
var f = {
|
|
1747
1895
|
get index() {
|
|
1748
1896
|
return s;
|
|
1749
1897
|
},
|
|
1750
1898
|
get action() {
|
|
1751
|
-
return
|
|
1899
|
+
return l;
|
|
1752
1900
|
},
|
|
1753
1901
|
get location() {
|
|
1754
|
-
return
|
|
1902
|
+
return d;
|
|
1755
1903
|
},
|
|
1756
|
-
createHref:
|
|
1757
|
-
push:
|
|
1758
|
-
replace:
|
|
1759
|
-
go:
|
|
1904
|
+
createHref: b,
|
|
1905
|
+
push: y,
|
|
1906
|
+
replace: p,
|
|
1907
|
+
go: R,
|
|
1760
1908
|
back: function() {
|
|
1761
|
-
|
|
1909
|
+
R(-1);
|
|
1762
1910
|
},
|
|
1763
1911
|
forward: function() {
|
|
1764
|
-
|
|
1912
|
+
R(1);
|
|
1765
1913
|
},
|
|
1766
|
-
listen: function(
|
|
1767
|
-
return
|
|
1914
|
+
listen: function(v) {
|
|
1915
|
+
return i.push(v);
|
|
1768
1916
|
},
|
|
1769
|
-
block: function(
|
|
1770
|
-
return
|
|
1917
|
+
block: function(v) {
|
|
1918
|
+
return m.push(v);
|
|
1771
1919
|
}
|
|
1772
1920
|
};
|
|
1773
|
-
return
|
|
1921
|
+
return f;
|
|
1774
1922
|
}
|
|
1775
|
-
function
|
|
1776
|
-
return Math.min(Math.max(
|
|
1923
|
+
function Ne(t, e, r) {
|
|
1924
|
+
return Math.min(Math.max(t, e), r);
|
|
1777
1925
|
}
|
|
1778
|
-
function
|
|
1779
|
-
|
|
1926
|
+
function Ot(t) {
|
|
1927
|
+
t.preventDefault(), t.returnValue = "";
|
|
1780
1928
|
}
|
|
1781
|
-
function
|
|
1782
|
-
var
|
|
1929
|
+
function gt() {
|
|
1930
|
+
var t = [];
|
|
1783
1931
|
return {
|
|
1784
1932
|
get length() {
|
|
1785
|
-
return
|
|
1933
|
+
return t.length;
|
|
1786
1934
|
},
|
|
1787
1935
|
push: function(r) {
|
|
1788
|
-
return
|
|
1789
|
-
|
|
1936
|
+
return t.push(r), function() {
|
|
1937
|
+
t = t.filter(function(n) {
|
|
1790
1938
|
return n !== r;
|
|
1791
1939
|
});
|
|
1792
1940
|
};
|
|
1793
1941
|
},
|
|
1794
1942
|
call: function(r) {
|
|
1795
|
-
|
|
1943
|
+
t.forEach(function(n) {
|
|
1796
1944
|
return n && n(r);
|
|
1797
1945
|
});
|
|
1798
1946
|
}
|
|
1799
1947
|
};
|
|
1800
1948
|
}
|
|
1801
|
-
function
|
|
1949
|
+
function jt() {
|
|
1802
1950
|
return Math.random().toString(36).substr(2, 8);
|
|
1803
1951
|
}
|
|
1804
|
-
function
|
|
1805
|
-
var
|
|
1952
|
+
function et(t) {
|
|
1953
|
+
var e = t.pathname, r = e === void 0 ? "/" : e, n = t.search, o = n === void 0 ? "" : n, a = t.hash, s = a === void 0 ? "" : a;
|
|
1806
1954
|
return o && o !== "?" && (r += o.charAt(0) === "?" ? o : "?" + o), s && s !== "#" && (r += s.charAt(0) === "#" ? s : "#" + s), r;
|
|
1807
1955
|
}
|
|
1808
|
-
function
|
|
1809
|
-
var
|
|
1810
|
-
if (
|
|
1811
|
-
var r =
|
|
1812
|
-
r >= 0 && (
|
|
1813
|
-
var n =
|
|
1814
|
-
n >= 0 && (
|
|
1956
|
+
function bt(t) {
|
|
1957
|
+
var e = {};
|
|
1958
|
+
if (t) {
|
|
1959
|
+
var r = t.indexOf("#");
|
|
1960
|
+
r >= 0 && (e.hash = t.substr(r), t = t.substr(0, r));
|
|
1961
|
+
var n = t.indexOf("?");
|
|
1962
|
+
n >= 0 && (e.search = t.substr(n), t = t.substr(0, n)), t && (e.pathname = t);
|
|
1815
1963
|
}
|
|
1816
|
-
return
|
|
1964
|
+
return e;
|
|
1817
1965
|
}
|
|
1818
|
-
const
|
|
1819
|
-
function
|
|
1820
|
-
const r =
|
|
1966
|
+
const Pr = Symbol();
|
|
1967
|
+
function Yn(t, e) {
|
|
1968
|
+
const r = Ht({ ...t }), n = (s) => {
|
|
1821
1969
|
Object.assign(r, {
|
|
1822
|
-
[
|
|
1970
|
+
[Pr]: !1,
|
|
1823
1971
|
...s
|
|
1824
1972
|
});
|
|
1825
|
-
}, o = r, a =
|
|
1973
|
+
}, o = r, a = Zn(o, e);
|
|
1826
1974
|
return {
|
|
1827
1975
|
currentRoute: o,
|
|
1828
1976
|
routerRoute: a,
|
|
1829
1977
|
updateRoute: n
|
|
1830
1978
|
};
|
|
1831
1979
|
}
|
|
1832
|
-
function q(
|
|
1833
|
-
return !
|
|
1980
|
+
function q(t) {
|
|
1981
|
+
return !t.startsWith("http") ? to(t) : Xn(t);
|
|
1834
1982
|
}
|
|
1835
|
-
function
|
|
1836
|
-
const { protocol:
|
|
1983
|
+
function Xn(t) {
|
|
1984
|
+
const { protocol: e, host: r, pathname: n, search: o, searchParams: a, hash: s } = new URL(t, t);
|
|
1837
1985
|
return {
|
|
1838
|
-
protocol:
|
|
1986
|
+
protocol: e,
|
|
1839
1987
|
host: r,
|
|
1840
1988
|
pathname: n,
|
|
1841
1989
|
search: o,
|
|
@@ -1843,31 +1991,31 @@ function Tn(e) {
|
|
|
1843
1991
|
hash: s
|
|
1844
1992
|
};
|
|
1845
1993
|
}
|
|
1846
|
-
function
|
|
1847
|
-
const { pathname:
|
|
1994
|
+
function to(t) {
|
|
1995
|
+
const { pathname: e, search: r, searchParams: n, hash: o } = new URL(t, "https://localhost");
|
|
1848
1996
|
return {
|
|
1849
|
-
pathname:
|
|
1997
|
+
pathname: e,
|
|
1850
1998
|
search: r,
|
|
1851
1999
|
searchParams: n,
|
|
1852
2000
|
hash: o
|
|
1853
2001
|
};
|
|
1854
2002
|
}
|
|
1855
|
-
function
|
|
1856
|
-
return (
|
|
1857
|
-
const { host: r } = q(
|
|
1858
|
-
return !(r === void 0 || r ===
|
|
2003
|
+
function eo(t) {
|
|
2004
|
+
return (e) => {
|
|
2005
|
+
const { host: r } = q(e);
|
|
2006
|
+
return !(r === void 0 || r === t);
|
|
1859
2007
|
};
|
|
1860
2008
|
}
|
|
1861
|
-
function
|
|
1862
|
-
const r =
|
|
1863
|
-
if (
|
|
1864
|
-
r.replace(
|
|
2009
|
+
function ro({ mode: t, listener: e }) {
|
|
2010
|
+
const r = no(t), n = (d, i) => {
|
|
2011
|
+
if (i != null && i.replace) {
|
|
2012
|
+
r.replace(d, i.state);
|
|
1865
2013
|
return;
|
|
1866
2014
|
}
|
|
1867
|
-
r.push(
|
|
2015
|
+
r.push(d, i == null ? void 0 : i.state);
|
|
1868
2016
|
}, o = () => {
|
|
1869
|
-
const
|
|
1870
|
-
r.replace(
|
|
2017
|
+
const d = et(r.location);
|
|
2018
|
+
r.replace(d);
|
|
1871
2019
|
};
|
|
1872
2020
|
let a;
|
|
1873
2021
|
return {
|
|
@@ -1875,126 +2023,126 @@ function Wn({ mode: e, listener: t }) {
|
|
|
1875
2023
|
update: n,
|
|
1876
2024
|
refresh: o,
|
|
1877
2025
|
startListening: () => {
|
|
1878
|
-
a == null || a(), a = r.listen(
|
|
2026
|
+
a == null || a(), a = r.listen(e);
|
|
1879
2027
|
},
|
|
1880
2028
|
stopListening: () => {
|
|
1881
2029
|
a == null || a();
|
|
1882
2030
|
}
|
|
1883
2031
|
};
|
|
1884
2032
|
}
|
|
1885
|
-
function
|
|
1886
|
-
switch (
|
|
2033
|
+
function no(t = "auto") {
|
|
2034
|
+
switch (t) {
|
|
1887
2035
|
case "auto":
|
|
1888
|
-
return
|
|
2036
|
+
return ue() ? ke() : xe();
|
|
1889
2037
|
case "browser":
|
|
1890
|
-
return
|
|
2038
|
+
return ke();
|
|
1891
2039
|
case "memory":
|
|
1892
|
-
return
|
|
2040
|
+
return xe();
|
|
1893
2041
|
case "hash":
|
|
1894
|
-
return
|
|
2042
|
+
return Kn();
|
|
1895
2043
|
default:
|
|
1896
|
-
const
|
|
1897
|
-
throw new Error(`Switch is not exhaustive for mode: ${
|
|
2044
|
+
const e = t;
|
|
2045
|
+
throw new Error(`Switch is not exhaustive for mode: ${e}`);
|
|
1898
2046
|
}
|
|
1899
2047
|
}
|
|
1900
|
-
function
|
|
1901
|
-
return
|
|
1902
|
-
name:
|
|
2048
|
+
function oo(t) {
|
|
2049
|
+
return Rt(() => () => pt("h1", t), {
|
|
2050
|
+
name: t,
|
|
1903
2051
|
props: []
|
|
1904
2052
|
});
|
|
1905
2053
|
}
|
|
1906
|
-
function
|
|
1907
|
-
const
|
|
1908
|
-
const s =
|
|
1909
|
-
id:
|
|
2054
|
+
function ao(t) {
|
|
2055
|
+
const e = (a) => Nt(t[a] ?? oo(a)), r = (a) => {
|
|
2056
|
+
const s = Nt(e(a)), l = {
|
|
2057
|
+
id: pe(),
|
|
1910
2058
|
component: s,
|
|
1911
2059
|
meta: {},
|
|
1912
2060
|
state: {}
|
|
1913
2061
|
};
|
|
1914
2062
|
return {
|
|
1915
|
-
id:
|
|
1916
|
-
matched:
|
|
1917
|
-
matches: [
|
|
2063
|
+
id: l.id,
|
|
2064
|
+
matched: l,
|
|
2065
|
+
matches: [l],
|
|
1918
2066
|
name: a,
|
|
1919
|
-
query:
|
|
2067
|
+
query: fe(""),
|
|
1920
2068
|
params: {},
|
|
1921
2069
|
state: {},
|
|
1922
2070
|
href: "/",
|
|
1923
2071
|
hash: "",
|
|
1924
|
-
[
|
|
2072
|
+
[Pr]: !0
|
|
1925
2073
|
};
|
|
1926
2074
|
}, n = (a) => {
|
|
1927
2075
|
if (!a) {
|
|
1928
2076
|
o.value = null;
|
|
1929
2077
|
return;
|
|
1930
2078
|
}
|
|
1931
|
-
const s =
|
|
2079
|
+
const s = e(a);
|
|
1932
2080
|
o.value = { type: a, component: s };
|
|
1933
|
-
}, o =
|
|
2081
|
+
}, o = qt(null);
|
|
1934
2082
|
return {
|
|
1935
2083
|
setRejection: n,
|
|
1936
2084
|
rejection: o,
|
|
1937
2085
|
getRejectionRoute: r
|
|
1938
2086
|
};
|
|
1939
2087
|
}
|
|
1940
|
-
class
|
|
2088
|
+
class so extends Error {
|
|
1941
2089
|
constructor() {
|
|
1942
2090
|
super("initialUrl must be set if window.location is unavailable");
|
|
1943
2091
|
}
|
|
1944
2092
|
}
|
|
1945
|
-
function
|
|
1946
|
-
if (
|
|
1947
|
-
return
|
|
1948
|
-
if (
|
|
2093
|
+
function io(t) {
|
|
2094
|
+
if (t)
|
|
2095
|
+
return t;
|
|
2096
|
+
if (ue())
|
|
1949
2097
|
return window.location.toString();
|
|
1950
|
-
throw new
|
|
2098
|
+
throw new so();
|
|
1951
2099
|
}
|
|
1952
|
-
function
|
|
1953
|
-
return !!
|
|
2100
|
+
function Ar(t) {
|
|
2101
|
+
return !!t && typeof t == "object";
|
|
1954
2102
|
}
|
|
1955
|
-
const
|
|
1956
|
-
function
|
|
1957
|
-
if (
|
|
1958
|
-
const n = e
|
|
1959
|
-
return typeof n == "string" ?
|
|
2103
|
+
const $t = !0;
|
|
2104
|
+
function co(t, e, r) {
|
|
2105
|
+
if (Ar(t) && e in t) {
|
|
2106
|
+
const n = t[e];
|
|
2107
|
+
return typeof n == "string" ? nt(n, r, $t) : n;
|
|
1960
2108
|
}
|
|
1961
|
-
return
|
|
2109
|
+
return nt(void 0, r, $t);
|
|
1962
2110
|
}
|
|
1963
|
-
function
|
|
2111
|
+
function kr(t, e) {
|
|
1964
2112
|
const r = {};
|
|
1965
|
-
for (const [n, o] of Object.entries(
|
|
1966
|
-
const a =
|
|
2113
|
+
for (const [n, o] of Object.entries(t)) {
|
|
2114
|
+
const a = co(e, n, o);
|
|
1967
2115
|
r[n] = a;
|
|
1968
2116
|
}
|
|
1969
2117
|
return r;
|
|
1970
2118
|
}
|
|
1971
|
-
function
|
|
1972
|
-
if (
|
|
1973
|
-
const n = e
|
|
1974
|
-
return
|
|
2119
|
+
function uo(t, e, r) {
|
|
2120
|
+
if (Ar(t) && e in t) {
|
|
2121
|
+
const n = t[e];
|
|
2122
|
+
return ot(n, r, $t);
|
|
1975
2123
|
}
|
|
1976
|
-
return
|
|
2124
|
+
return ot(void 0, r, $t);
|
|
1977
2125
|
}
|
|
1978
|
-
const
|
|
2126
|
+
const Le = (t, e) => {
|
|
1979
2127
|
const r = {};
|
|
1980
|
-
for (const [n, o] of Object.entries(
|
|
1981
|
-
const a =
|
|
2128
|
+
for (const [n, o] of Object.entries(t)) {
|
|
2129
|
+
const a = uo(e, n, o);
|
|
1982
2130
|
r[n] = a;
|
|
1983
2131
|
}
|
|
1984
2132
|
return r;
|
|
1985
2133
|
};
|
|
1986
|
-
function
|
|
1987
|
-
const
|
|
1988
|
-
|
|
1989
|
-
}, n = (
|
|
1990
|
-
|
|
2134
|
+
function fo() {
|
|
2135
|
+
const t = Ht(/* @__PURE__ */ new Map()), e = ue() ? s() : null, r = (l) => {
|
|
2136
|
+
t.set(l, !1), e == null || e.observe(l);
|
|
2137
|
+
}, n = (l) => {
|
|
2138
|
+
t.delete(l), e == null || e.unobserve(l);
|
|
1991
2139
|
}, o = () => {
|
|
1992
|
-
|
|
1993
|
-
}, a = (
|
|
2140
|
+
e == null || e.disconnect();
|
|
2141
|
+
}, a = (l) => t.get(l) ?? !1;
|
|
1994
2142
|
function s() {
|
|
1995
|
-
return new IntersectionObserver((
|
|
1996
|
-
|
|
1997
|
-
|
|
2143
|
+
return new IntersectionObserver((l) => {
|
|
2144
|
+
l.forEach((d) => {
|
|
2145
|
+
t.set(d.target, d.isIntersecting);
|
|
1998
2146
|
});
|
|
1999
2147
|
});
|
|
2000
2148
|
}
|
|
@@ -2005,270 +2153,269 @@ function to() {
|
|
|
2005
2153
|
isElementVisible: a
|
|
2006
2154
|
};
|
|
2007
2155
|
}
|
|
2008
|
-
class
|
|
2009
|
-
constructor(
|
|
2010
|
-
super(`Route not found: "${
|
|
2156
|
+
class lo extends Error {
|
|
2157
|
+
constructor(e) {
|
|
2158
|
+
super(`Route not found: "${e}"`);
|
|
2011
2159
|
}
|
|
2012
2160
|
}
|
|
2013
|
-
function
|
|
2014
|
-
const n =
|
|
2161
|
+
function xr(t, e, r) {
|
|
2162
|
+
const n = pn(e.value, r), o = ze(n), [a] = Ke(t, new RegExp(o, "g"));
|
|
2015
2163
|
return a;
|
|
2016
2164
|
}
|
|
2017
|
-
function
|
|
2018
|
-
const o =
|
|
2019
|
-
return
|
|
2165
|
+
function Nr(t, e, r, n) {
|
|
2166
|
+
const o = se(e, r), a = ot(n, e.params[r], o);
|
|
2167
|
+
return t.replace(Qe(r), a);
|
|
2020
2168
|
}
|
|
2021
|
-
function
|
|
2169
|
+
function Lr({ protocol: t, host: e, pathname: r, search: n, searchParams: o, hash: a }) {
|
|
2022
2170
|
const s = new URL("https://localhost");
|
|
2023
|
-
|
|
2024
|
-
const
|
|
2025
|
-
return
|
|
2171
|
+
t && (s.protocol = t), e && (s.host = e), r && (s.pathname = r), o ? s.search = new URLSearchParams(o).toString() : n && (s.search = n), a && (s.hash = a);
|
|
2172
|
+
const l = s.toString().replace(/^https:\/\/localhost\/*/, "/");
|
|
2173
|
+
return $e(l);
|
|
2026
2174
|
}
|
|
2027
|
-
function
|
|
2028
|
-
const { params: r = {}, query: n } =
|
|
2029
|
-
return
|
|
2175
|
+
function po(t, e = {}) {
|
|
2176
|
+
const { params: r = {}, query: n } = e, o = yo(t.query, r), a = he(o, n), s = Ue(t.path, r), l = t.hash.value ? Ue(t.hash, r) : e.hash, d = ho(t.host, r), { protocol: i, host: m } = q(d);
|
|
2177
|
+
return Lr({ protocol: i, host: m, pathname: s, searchParams: a, hash: l });
|
|
2030
2178
|
}
|
|
2031
|
-
function
|
|
2032
|
-
const r =
|
|
2033
|
-
return Object.keys(
|
|
2179
|
+
function ho(t, e) {
|
|
2180
|
+
const r = t.value && !t.value.startsWith("http") ? `https://${t.value}` : t.value;
|
|
2181
|
+
return Object.keys(t.params).reduce((n, o) => Nr(n, t, o, e[o]), r);
|
|
2034
2182
|
}
|
|
2035
|
-
function
|
|
2036
|
-
return Object.keys(
|
|
2183
|
+
function Ue(t, e) {
|
|
2184
|
+
return Object.keys(t.params).reduce((r, n) => Nr(r, t, n, e[n]), t.value);
|
|
2037
2185
|
}
|
|
2038
|
-
function
|
|
2039
|
-
const r = new URLSearchParams(
|
|
2040
|
-
if (!
|
|
2186
|
+
function yo(t, e) {
|
|
2187
|
+
const r = new URLSearchParams(t.value);
|
|
2188
|
+
if (!t.value)
|
|
2041
2189
|
return r;
|
|
2042
2190
|
for (const [n, o] of Array.from(r.entries())) {
|
|
2043
|
-
const a =
|
|
2191
|
+
const a = ce(o);
|
|
2044
2192
|
if (!a)
|
|
2045
2193
|
continue;
|
|
2046
|
-
const
|
|
2047
|
-
|
|
2194
|
+
const l = ie(o), d = ot(e[a], t.params[a], l), i = e[a] === void 0 && d === "";
|
|
2195
|
+
l && i ? r.delete(n, o) : r.set(n, d);
|
|
2048
2196
|
}
|
|
2049
2197
|
return r;
|
|
2050
2198
|
}
|
|
2051
|
-
const
|
|
2199
|
+
const mo = (t, e) => {
|
|
2052
2200
|
try {
|
|
2053
|
-
|
|
2201
|
+
me(t, e);
|
|
2054
2202
|
} catch {
|
|
2055
2203
|
return !1;
|
|
2056
2204
|
}
|
|
2057
2205
|
return !0;
|
|
2058
|
-
},
|
|
2059
|
-
const { protocol: r, host: n, pathname: o, search: a, hash: s } = q(
|
|
2206
|
+
}, me = (t, e) => {
|
|
2207
|
+
const { protocol: r, host: n, pathname: o, search: a, hash: s } = q(e);
|
|
2060
2208
|
return {
|
|
2061
|
-
...
|
|
2062
|
-
...
|
|
2063
|
-
...
|
|
2064
|
-
...
|
|
2209
|
+
...zt(t.host, `${r}//${n}`),
|
|
2210
|
+
...zt(t.path, o),
|
|
2211
|
+
...go(t.query, a),
|
|
2212
|
+
...zt(t.hash, s)
|
|
2065
2213
|
};
|
|
2066
2214
|
};
|
|
2067
|
-
function
|
|
2068
|
-
const r = {}, n = decodeURIComponent(
|
|
2069
|
-
for (const [o, a] of Object.entries(
|
|
2070
|
-
const s =
|
|
2071
|
-
r[o] =
|
|
2215
|
+
function zt(t, e) {
|
|
2216
|
+
const r = {}, n = decodeURIComponent(e);
|
|
2217
|
+
for (const [o, a] of Object.entries(t.params)) {
|
|
2218
|
+
const s = xr(n, t, o), l = se(t, o), d = nt(s, a, l);
|
|
2219
|
+
r[o] = d;
|
|
2072
2220
|
}
|
|
2073
2221
|
return r;
|
|
2074
2222
|
}
|
|
2075
|
-
function
|
|
2076
|
-
const r = {}, n = new URLSearchParams(
|
|
2223
|
+
function go(t, e) {
|
|
2224
|
+
const r = {}, n = new URLSearchParams(t.value), o = new URLSearchParams(e);
|
|
2077
2225
|
for (const [a, s] of Array.from(n.entries())) {
|
|
2078
|
-
const
|
|
2079
|
-
if (!
|
|
2226
|
+
const l = ce(s);
|
|
2227
|
+
if (!l)
|
|
2080
2228
|
continue;
|
|
2081
|
-
const
|
|
2082
|
-
r[
|
|
2229
|
+
const i = ie(s), m = o.get(a) ?? void 0, b = nt(m, t.params[l], i);
|
|
2230
|
+
r[l] = b;
|
|
2083
2231
|
}
|
|
2084
2232
|
return r;
|
|
2085
2233
|
}
|
|
2086
|
-
function
|
|
2087
|
-
const n =
|
|
2088
|
-
params:
|
|
2234
|
+
function Ro(t, e = {}, r = {}) {
|
|
2235
|
+
const n = po(t, {
|
|
2236
|
+
params: e,
|
|
2089
2237
|
query: r.query,
|
|
2090
2238
|
hash: r.hash
|
|
2091
2239
|
}), { search: o, hash: a } = q(n);
|
|
2092
2240
|
return {
|
|
2093
|
-
id:
|
|
2094
|
-
matched:
|
|
2095
|
-
matches:
|
|
2096
|
-
name:
|
|
2097
|
-
query:
|
|
2098
|
-
params:
|
|
2099
|
-
state:
|
|
2241
|
+
id: t.id,
|
|
2242
|
+
matched: t.matched,
|
|
2243
|
+
matches: t.matches,
|
|
2244
|
+
name: t.name,
|
|
2245
|
+
query: fe(o),
|
|
2246
|
+
params: me(t, n),
|
|
2247
|
+
state: kr(t.state, r.state),
|
|
2100
2248
|
hash: a,
|
|
2101
2249
|
href: n
|
|
2102
2250
|
};
|
|
2103
2251
|
}
|
|
2104
|
-
const
|
|
2105
|
-
const { pathname: r } = q(
|
|
2106
|
-
return
|
|
2107
|
-
},
|
|
2108
|
-
const { search: r } = q(
|
|
2109
|
-
return
|
|
2110
|
-
},
|
|
2111
|
-
const { hash: r } = q(
|
|
2112
|
-
return
|
|
2252
|
+
const wo = (t) => "name" in t.matched && !!t.matched.name, Eo = (t, e) => {
|
|
2253
|
+
const { pathname: r } = q(e);
|
|
2254
|
+
return fn(t).test(r);
|
|
2255
|
+
}, vo = (t, e) => {
|
|
2256
|
+
const { search: r } = q(e);
|
|
2257
|
+
return ln(t).every((o) => o.test(r));
|
|
2258
|
+
}, te = (t, e) => {
|
|
2259
|
+
const { hash: r } = q(e), { value: n } = t.hash;
|
|
2260
|
+
return W(n) ? `#${n.replace(/^#*/, "")}`.toLowerCase() === r.toLowerCase() : !0;
|
|
2113
2261
|
};
|
|
2114
|
-
function
|
|
2115
|
-
const { searchParams:
|
|
2262
|
+
function bo(t) {
|
|
2263
|
+
const { searchParams: e, pathname: r } = q(t), n = -1, o = 1;
|
|
2116
2264
|
return (a, s) => {
|
|
2117
|
-
const
|
|
2118
|
-
return a.depth > s.depth ? n : a.depth < s.depth ? o :
|
|
2265
|
+
const l = Ce(a, e), d = Be(a, r), i = Ce(s, e), m = Be(s, r);
|
|
2266
|
+
return a.depth > s.depth ? n : a.depth < s.depth ? o : l + d > i + m ? n : l + d < i + m ? o : te(a, t) ? n : te(s, t) ? o : 0;
|
|
2119
2267
|
};
|
|
2120
2268
|
}
|
|
2121
|
-
function
|
|
2122
|
-
const r = Object.keys(
|
|
2269
|
+
function Be(t, e) {
|
|
2270
|
+
const r = Object.keys(t.path.params).filter((o) => se(t.path, o)).map((o) => o), n = r.filter((o) => xr(e, t.path, o) === void 0);
|
|
2123
2271
|
return r.length - n.length;
|
|
2124
2272
|
}
|
|
2125
|
-
function
|
|
2126
|
-
const r = new URLSearchParams(
|
|
2273
|
+
function Ce(t, e) {
|
|
2274
|
+
const r = new URLSearchParams(e), n = new URLSearchParams(t.query.value), o = Array.from(n.keys()), a = o.filter((s) => !r.has(s));
|
|
2127
2275
|
return o.length - a.length;
|
|
2128
2276
|
}
|
|
2129
|
-
const
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2277
|
+
const So = [
|
|
2278
|
+
wo,
|
|
2279
|
+
Eo,
|
|
2280
|
+
vo,
|
|
2281
|
+
te,
|
|
2282
|
+
mo
|
|
2135
2283
|
];
|
|
2136
|
-
function
|
|
2137
|
-
const r =
|
|
2138
|
-
return
|
|
2284
|
+
function Po(t, e) {
|
|
2285
|
+
const r = bo(e);
|
|
2286
|
+
return t.filter((n) => So.every((o) => o(n, e))).sort(r);
|
|
2139
2287
|
}
|
|
2140
|
-
function
|
|
2141
|
-
const n =
|
|
2288
|
+
function Ao(t, e, r) {
|
|
2289
|
+
const n = Po(t, e);
|
|
2142
2290
|
if (!n.length)
|
|
2143
2291
|
return;
|
|
2144
|
-
const [o] = n, { searchParams: a, hash: s } = q(
|
|
2292
|
+
const [o] = n, { searchParams: a, hash: s } = q(e);
|
|
2145
2293
|
return {
|
|
2146
2294
|
id: o.id,
|
|
2147
2295
|
matched: o.matched,
|
|
2148
2296
|
matches: o.matches,
|
|
2149
2297
|
name: o.name,
|
|
2150
|
-
query:
|
|
2151
|
-
params:
|
|
2152
|
-
state:
|
|
2298
|
+
query: fe(a),
|
|
2299
|
+
params: me(o, e),
|
|
2300
|
+
state: kr(o.state, r),
|
|
2153
2301
|
hash: s,
|
|
2154
|
-
href:
|
|
2302
|
+
href: $e(e)
|
|
2155
2303
|
};
|
|
2156
2304
|
}
|
|
2157
|
-
function
|
|
2158
|
-
const r = typeof
|
|
2159
|
-
return
|
|
2160
|
-
protocol:
|
|
2161
|
-
host:
|
|
2162
|
-
pathname:
|
|
2163
|
-
searchParams:
|
|
2164
|
-
hash:
|
|
2305
|
+
function Ve(t, e) {
|
|
2306
|
+
const r = typeof t == "string" ? q(t) : t, n = typeof e == "string" ? q(e) : e, o = r.searchParams ?? new URLSearchParams(r.search), a = n.searchParams ?? new URLSearchParams(n.search);
|
|
2307
|
+
return Lr({
|
|
2308
|
+
protocol: W(n.protocol) ? n.protocol : r.protocol,
|
|
2309
|
+
host: W(n.host) ? n.host : r.host,
|
|
2310
|
+
pathname: W(n.pathname) ? n.pathname : r.pathname,
|
|
2311
|
+
searchParams: he(a, o),
|
|
2312
|
+
hash: W(n.hash) ? n.hash : r.hash
|
|
2165
2313
|
});
|
|
2166
2314
|
}
|
|
2167
|
-
function
|
|
2168
|
-
return
|
|
2169
|
-
const n = `${
|
|
2315
|
+
function ko(t, e) {
|
|
2316
|
+
return W(e) ? t.map((r) => {
|
|
2317
|
+
const n = `${e}${r.path.value}`;
|
|
2170
2318
|
return {
|
|
2171
2319
|
...r,
|
|
2172
|
-
path:
|
|
2320
|
+
path: Q(n, r.path.params)
|
|
2173
2321
|
};
|
|
2174
|
-
}) :
|
|
2322
|
+
}) : t;
|
|
2175
2323
|
}
|
|
2176
|
-
class
|
|
2324
|
+
class xo extends Error {
|
|
2177
2325
|
/**
|
|
2178
2326
|
* Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
|
|
2179
2327
|
* @param name - The name of the name that was duplicated.
|
|
2180
2328
|
*/
|
|
2181
|
-
constructor(
|
|
2182
|
-
super(`Invalid Name "${
|
|
2329
|
+
constructor(e) {
|
|
2330
|
+
super(`Invalid Name "${e}": Router does not support multiple routes with the same name. All name names must be unique.`);
|
|
2183
2331
|
}
|
|
2184
2332
|
}
|
|
2185
|
-
function
|
|
2186
|
-
const
|
|
2187
|
-
for (const r of
|
|
2188
|
-
if (
|
|
2189
|
-
throw new
|
|
2333
|
+
function No(t) {
|
|
2334
|
+
const e = t.map(({ name: r }) => r);
|
|
2335
|
+
for (const r of e)
|
|
2336
|
+
if (_e(e, r) > 1)
|
|
2337
|
+
throw new xo(r);
|
|
2190
2338
|
}
|
|
2191
|
-
function
|
|
2339
|
+
function Lo(t, e = [], r) {
|
|
2192
2340
|
const n = [
|
|
2193
|
-
...
|
|
2194
|
-
...
|
|
2341
|
+
...t,
|
|
2342
|
+
...e.map((o) => o.routes)
|
|
2195
2343
|
].flat();
|
|
2196
|
-
return
|
|
2344
|
+
return No(n), ko(n, r);
|
|
2197
2345
|
}
|
|
2198
|
-
function
|
|
2199
|
-
const r = new
|
|
2200
|
-
return
|
|
2346
|
+
function Uo(t = {}, e = []) {
|
|
2347
|
+
const r = new at();
|
|
2348
|
+
return ut("onBeforeRouteEnter", t, e).forEach((n) => r.onBeforeRouteEnter.add(n)), ut("onBeforeRouteUpdate", t, e).forEach((n) => r.onBeforeRouteUpdate.add(n)), ut("onBeforeRouteLeave", t, e).forEach((n) => r.onBeforeRouteLeave.add(n)), ut("onAfterRouteEnter", t, e).forEach((n) => r.onAfterRouteEnter.add(n)), ut("onAfterRouteUpdate", t, e).forEach((n) => r.onAfterRouteUpdate.add(n)), ut("onAfterRouteLeave", t, e).forEach((n) => r.onAfterRouteLeave.add(n)), r;
|
|
2201
2349
|
}
|
|
2202
|
-
function
|
|
2350
|
+
function ut(t, e, r) {
|
|
2203
2351
|
return [
|
|
2204
|
-
t
|
|
2205
|
-
...r.map((o) => o[
|
|
2352
|
+
e[t],
|
|
2353
|
+
...r.map((o) => o[t])
|
|
2206
2354
|
].flat().filter((o) => o !== void 0);
|
|
2207
2355
|
}
|
|
2208
|
-
function
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
a
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
U(B, { state: E.state, replace: !0 });
|
|
2356
|
+
function Io(t, e, r = []) {
|
|
2357
|
+
const n = Lo(t, r, e == null ? void 0 : e.base), o = zn();
|
|
2358
|
+
o.addGlobalRouteHooks(Uo(e, r));
|
|
2359
|
+
const a = le(), s = Nn(), l = Jn(), d = fo(), i = ro({
|
|
2360
|
+
mode: e == null ? void 0 : e.historyMode,
|
|
2361
|
+
listener: ({ location: S }) => {
|
|
2362
|
+
const B = et(S);
|
|
2363
|
+
b(B, { state: S.state, replace: !0 });
|
|
2217
2364
|
}
|
|
2218
2365
|
});
|
|
2219
|
-
function S
|
|
2220
|
-
return
|
|
2366
|
+
function m(S, B = {}) {
|
|
2367
|
+
return Ao(n, S, B.state);
|
|
2221
2368
|
}
|
|
2222
|
-
async function
|
|
2223
|
-
const
|
|
2224
|
-
if (
|
|
2225
|
-
|
|
2369
|
+
async function b(S, B = {}) {
|
|
2370
|
+
const G = a();
|
|
2371
|
+
if (i.stopListening(), x(S)) {
|
|
2372
|
+
i.update(S, B);
|
|
2226
2373
|
return;
|
|
2227
2374
|
}
|
|
2228
|
-
const
|
|
2229
|
-
switch (
|
|
2375
|
+
const J = m(S, B) ?? f("NotFound"), _ = ge(G), K = await o.runBeforeRouteHooks({ to: J, from: _ });
|
|
2376
|
+
switch (K.status) {
|
|
2230
2377
|
// On abort do nothing
|
|
2231
2378
|
case "ABORT":
|
|
2232
2379
|
return;
|
|
2233
2380
|
// On push update the history, and push new route, and return
|
|
2234
2381
|
case "PUSH":
|
|
2235
|
-
|
|
2382
|
+
i.update(S, B), await P(...K.to);
|
|
2236
2383
|
return;
|
|
2237
2384
|
// On reject update the history, the route, and set the rejection type
|
|
2238
2385
|
case "REJECT":
|
|
2239
|
-
|
|
2386
|
+
i.update(S, B), p(K.type);
|
|
2240
2387
|
break;
|
|
2241
2388
|
// On success update history, set the route, and clear the rejection
|
|
2242
2389
|
case "SUCCESS":
|
|
2243
|
-
|
|
2390
|
+
i.update(S, B), p(null);
|
|
2244
2391
|
break;
|
|
2245
2392
|
default:
|
|
2246
|
-
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(
|
|
2393
|
+
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(K)}`);
|
|
2247
2394
|
}
|
|
2248
|
-
const
|
|
2249
|
-
|
|
2250
|
-
if (
|
|
2395
|
+
const Ft = G;
|
|
2396
|
+
s.setProps(J).then((D) => {
|
|
2397
|
+
if (Ft === G)
|
|
2251
2398
|
switch (D.status) {
|
|
2252
2399
|
case "SUCCESS":
|
|
2253
2400
|
break;
|
|
2254
2401
|
case "PUSH":
|
|
2255
|
-
|
|
2402
|
+
P(...D.to);
|
|
2256
2403
|
break;
|
|
2257
2404
|
case "REJECT":
|
|
2258
|
-
|
|
2405
|
+
p(D.type);
|
|
2259
2406
|
break;
|
|
2260
2407
|
default:
|
|
2261
|
-
const
|
|
2262
|
-
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(
|
|
2408
|
+
const Tt = D;
|
|
2409
|
+
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(Tt)}`);
|
|
2263
2410
|
}
|
|
2264
|
-
}),
|
|
2265
|
-
const F = await
|
|
2411
|
+
}), A(J);
|
|
2412
|
+
const F = await o.runAfterRouteHooks({ to: J, from: _ });
|
|
2266
2413
|
switch (F.status) {
|
|
2267
2414
|
case "PUSH":
|
|
2268
|
-
await
|
|
2415
|
+
await P(...F.to);
|
|
2269
2416
|
break;
|
|
2270
2417
|
case "REJECT":
|
|
2271
|
-
|
|
2418
|
+
p(F.type);
|
|
2272
2419
|
break;
|
|
2273
2420
|
case "SUCCESS":
|
|
2274
2421
|
break;
|
|
@@ -2276,186 +2423,193 @@ function Bo(e, t, r = []) {
|
|
|
2276
2423
|
const D = F;
|
|
2277
2424
|
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(D)}`);
|
|
2278
2425
|
}
|
|
2279
|
-
|
|
2280
|
-
}
|
|
2281
|
-
const
|
|
2282
|
-
const
|
|
2283
|
-
if (!
|
|
2284
|
-
throw new
|
|
2285
|
-
return
|
|
2286
|
-
},
|
|
2287
|
-
if (M(
|
|
2288
|
-
const F = { ...B }, D =
|
|
2426
|
+
i.startListening();
|
|
2427
|
+
}
|
|
2428
|
+
const U = (S, B = {}, G = {}) => {
|
|
2429
|
+
const J = n.find((_) => _.name === S);
|
|
2430
|
+
if (!J)
|
|
2431
|
+
throw new lo(String(S));
|
|
2432
|
+
return Ro(J, B, G);
|
|
2433
|
+
}, P = (S, B, G) => {
|
|
2434
|
+
if (M(S)) {
|
|
2435
|
+
const F = { ...B }, D = Ve(S, {
|
|
2289
2436
|
searchParams: F.query,
|
|
2290
2437
|
hash: F.hash
|
|
2291
2438
|
});
|
|
2292
|
-
return
|
|
2439
|
+
return b(D, F);
|
|
2293
2440
|
}
|
|
2294
|
-
if (typeof
|
|
2295
|
-
const { replace: F, ...D } = { ...
|
|
2296
|
-
return
|
|
2441
|
+
if (typeof S == "string") {
|
|
2442
|
+
const { replace: F, ...D } = { ...G }, Tt = { ...B }, Mt = U(S, Tt, D), Br = Le({ ...Mt.matched.state }, { ...Mt.state, ...D.state });
|
|
2443
|
+
return b(Mt.href, { replace: F, state: Br });
|
|
2297
2444
|
}
|
|
2298
|
-
const { replace:
|
|
2445
|
+
const { replace: J, ..._ } = { ...B }, K = Le({ ...S.matched.state }, { ...S.state, ..._.state }), Ft = Ve(S.href, {
|
|
2299
2446
|
searchParams: _.query,
|
|
2300
2447
|
hash: _.hash
|
|
2301
2448
|
});
|
|
2302
|
-
return
|
|
2303
|
-
},
|
|
2304
|
-
if (M(
|
|
2449
|
+
return b(Ft, { replace: J, state: K });
|
|
2450
|
+
}, w = (S, B, G) => {
|
|
2451
|
+
if (M(S)) {
|
|
2305
2452
|
const _ = { ...B, replace: !0 };
|
|
2306
|
-
return
|
|
2453
|
+
return P(S, _);
|
|
2307
2454
|
}
|
|
2308
|
-
if (typeof
|
|
2309
|
-
const _ = { ...
|
|
2310
|
-
return
|
|
2455
|
+
if (typeof S == "string") {
|
|
2456
|
+
const _ = { ...G, replace: !0 }, K = { ...B };
|
|
2457
|
+
return P(S, K, _);
|
|
2311
2458
|
}
|
|
2312
|
-
const
|
|
2313
|
-
return
|
|
2314
|
-
},
|
|
2315
|
-
|
|
2316
|
-
}, { setRejection:
|
|
2317
|
-
...r.reduce((
|
|
2318
|
-
...
|
|
2319
|
-
}),
|
|
2320
|
-
let
|
|
2321
|
-
const { promise: V, resolve:
|
|
2322
|
-
async function
|
|
2323
|
-
if (
|
|
2459
|
+
const J = { ...B, replace: !0 };
|
|
2460
|
+
return P(S, J);
|
|
2461
|
+
}, y = (S) => {
|
|
2462
|
+
p(S);
|
|
2463
|
+
}, { setRejection: p, rejection: R, getRejectionRoute: f } = ao({
|
|
2464
|
+
...r.reduce((S, B) => ({ ...S, ...B.rejections }), {}),
|
|
2465
|
+
...e == null ? void 0 : e.rejections
|
|
2466
|
+
}), c = f("NotFound"), { currentRoute: v, routerRoute: k, updateRoute: A } = Yn(c, P), g = io(e == null ? void 0 : e.initialUrl), u = i.location.state, { host: h } = q(g), x = eo(h);
|
|
2467
|
+
let N = !1;
|
|
2468
|
+
const { promise: V, resolve: Z } = Promise.withResolvers();
|
|
2469
|
+
async function $() {
|
|
2470
|
+
if (N)
|
|
2324
2471
|
return V;
|
|
2325
|
-
|
|
2326
|
-
}
|
|
2327
|
-
function
|
|
2328
|
-
|
|
2329
|
-
}
|
|
2330
|
-
function
|
|
2331
|
-
return
|
|
2332
|
-
}
|
|
2333
|
-
function
|
|
2334
|
-
|
|
2335
|
-
}
|
|
2336
|
-
const
|
|
2337
|
-
route:
|
|
2338
|
-
resolve:
|
|
2339
|
-
find:
|
|
2340
|
-
push:
|
|
2341
|
-
replace:
|
|
2342
|
-
reject:
|
|
2343
|
-
refresh:
|
|
2344
|
-
forward:
|
|
2345
|
-
back:
|
|
2346
|
-
go:
|
|
2347
|
-
install:
|
|
2348
|
-
isExternal:
|
|
2349
|
-
onBeforeRouteEnter:
|
|
2350
|
-
onBeforeRouteUpdate:
|
|
2351
|
-
onBeforeRouteLeave:
|
|
2352
|
-
onAfterRouteEnter:
|
|
2353
|
-
onAfterRouteUpdate:
|
|
2354
|
-
onAfterRouteLeave:
|
|
2355
|
-
prefetch:
|
|
2356
|
-
start:
|
|
2357
|
-
stop:
|
|
2472
|
+
Xr(n) && await tn(), N = !0, await b(g, { replace: !0, state: u }), i.startListening(), Z();
|
|
2473
|
+
}
|
|
2474
|
+
function I() {
|
|
2475
|
+
i.stopListening();
|
|
2476
|
+
}
|
|
2477
|
+
function ge(S) {
|
|
2478
|
+
return Sn(S) ? null : { ...v };
|
|
2479
|
+
}
|
|
2480
|
+
function Ur(S) {
|
|
2481
|
+
o.setVueApp(S), s.setVueApp(S), S.component("RouterView", Rr), S.component("RouterLink", $n), S.provide(hr, R), S.provide(wr, o), S.provide(ur, s), S.provide(gr, l), S.provide(lr, d), S.provide(He, Re), $();
|
|
2482
|
+
}
|
|
2483
|
+
const Re = {
|
|
2484
|
+
route: k,
|
|
2485
|
+
resolve: U,
|
|
2486
|
+
find: m,
|
|
2487
|
+
push: P,
|
|
2488
|
+
replace: w,
|
|
2489
|
+
reject: y,
|
|
2490
|
+
refresh: i.refresh,
|
|
2491
|
+
forward: i.forward,
|
|
2492
|
+
back: i.back,
|
|
2493
|
+
go: i.go,
|
|
2494
|
+
install: Ur,
|
|
2495
|
+
isExternal: x,
|
|
2496
|
+
onBeforeRouteEnter: o.onBeforeRouteEnter,
|
|
2497
|
+
onBeforeRouteUpdate: o.onBeforeRouteUpdate,
|
|
2498
|
+
onBeforeRouteLeave: o.onBeforeRouteLeave,
|
|
2499
|
+
onAfterRouteEnter: o.onAfterRouteEnter,
|
|
2500
|
+
onAfterRouteUpdate: o.onAfterRouteUpdate,
|
|
2501
|
+
onAfterRouteLeave: o.onAfterRouteLeave,
|
|
2502
|
+
prefetch: e == null ? void 0 : e.prefetch,
|
|
2503
|
+
start: $,
|
|
2504
|
+
stop: I
|
|
2358
2505
|
};
|
|
2359
|
-
return
|
|
2506
|
+
return Re;
|
|
2360
2507
|
}
|
|
2361
|
-
function
|
|
2508
|
+
function Jo(t) {
|
|
2362
2509
|
return {
|
|
2363
|
-
routes:
|
|
2364
|
-
rejections:
|
|
2365
|
-
...
|
|
2510
|
+
routes: t.routes ?? [],
|
|
2511
|
+
rejections: t.rejections ?? {},
|
|
2512
|
+
...t
|
|
2366
2513
|
};
|
|
2367
2514
|
}
|
|
2368
|
-
function
|
|
2515
|
+
function Bo(t) {
|
|
2369
2516
|
return {
|
|
2370
|
-
get: (
|
|
2371
|
-
for (const n of
|
|
2372
|
-
const o =
|
|
2517
|
+
get: (e, { invalid: r }) => {
|
|
2518
|
+
for (const n of t) {
|
|
2519
|
+
const o = sn(e, n);
|
|
2373
2520
|
if (o !== void 0)
|
|
2374
2521
|
return o;
|
|
2375
2522
|
}
|
|
2376
|
-
throw r(`Value ${
|
|
2523
|
+
throw r(`Value ${e} does not satisfy any of the possible values`);
|
|
2377
2524
|
},
|
|
2378
|
-
set: (
|
|
2379
|
-
for (const n of
|
|
2380
|
-
const o =
|
|
2525
|
+
set: (e, { invalid: r }) => {
|
|
2526
|
+
for (const n of t) {
|
|
2527
|
+
const o = cn(e, n);
|
|
2381
2528
|
if (o !== void 0)
|
|
2382
2529
|
return o;
|
|
2383
2530
|
}
|
|
2384
|
-
throw r(`Value ${
|
|
2531
|
+
throw r(`Value ${e} does not satisfy any of the possible values`);
|
|
2385
2532
|
}
|
|
2386
2533
|
};
|
|
2387
2534
|
}
|
|
2388
|
-
|
|
2389
|
-
|
|
2535
|
+
const Co = {
|
|
2536
|
+
separator: ","
|
|
2537
|
+
};
|
|
2538
|
+
function Do(t, e = {}) {
|
|
2539
|
+
const { separator: r } = { ...Co, ...e }, n = Bo(t);
|
|
2390
2540
|
return {
|
|
2391
|
-
get: (
|
|
2392
|
-
set: (
|
|
2393
|
-
if (!Array.isArray(
|
|
2394
|
-
throw
|
|
2395
|
-
return
|
|
2541
|
+
get: (o, a) => o.split(r).map((s) => n.get(s, a)),
|
|
2542
|
+
set: (o, a) => {
|
|
2543
|
+
if (!Array.isArray(o))
|
|
2544
|
+
throw a.invalid("Expected an array");
|
|
2545
|
+
return o.map((s) => n.set(s, a)).join(r);
|
|
2396
2546
|
}
|
|
2397
2547
|
};
|
|
2398
2548
|
}
|
|
2399
|
-
|
|
2549
|
+
const Vo = {
|
|
2550
|
+
separator: ","
|
|
2551
|
+
};
|
|
2552
|
+
function Fo(t, e = {}) {
|
|
2553
|
+
const { separator: r } = { ...Vo, ...e };
|
|
2400
2554
|
return {
|
|
2401
|
-
get: (
|
|
2402
|
-
const
|
|
2403
|
-
return
|
|
2555
|
+
get: (n) => {
|
|
2556
|
+
const o = n.split(r);
|
|
2557
|
+
return t.map((a, s) => nt(o.at(s), a));
|
|
2404
2558
|
},
|
|
2405
|
-
set: (
|
|
2406
|
-
if (!Array.isArray(
|
|
2407
|
-
throw
|
|
2408
|
-
if (
|
|
2409
|
-
throw
|
|
2410
|
-
return
|
|
2559
|
+
set: (n, { invalid: o }) => {
|
|
2560
|
+
if (!Array.isArray(n))
|
|
2561
|
+
throw o("Expected a tuple");
|
|
2562
|
+
if (n.length !== t.length)
|
|
2563
|
+
throw o(`Expected tuple with ${t.length} values but received ${n.length} values`);
|
|
2564
|
+
return t.map((a, s) => ot(n.at(s), a)).join(r);
|
|
2411
2565
|
}
|
|
2412
2566
|
};
|
|
2413
2567
|
}
|
|
2414
|
-
const
|
|
2415
|
-
function
|
|
2416
|
-
const
|
|
2417
|
-
id:
|
|
2418
|
-
matched:
|
|
2419
|
-
matches: [
|
|
2568
|
+
const To = Q, Mo = Q, Wo = Q;
|
|
2569
|
+
function Go(t) {
|
|
2570
|
+
const e = pe(), r = nr(t.name), n = X(t.path), o = X(t.query), a = X(t.hash), s = t.meta ?? {}, l = X(t.host), d = Nt({ id: e, meta: {}, state: {}, ...t }), i = {
|
|
2571
|
+
id: e,
|
|
2572
|
+
matched: d,
|
|
2573
|
+
matches: [d],
|
|
2420
2574
|
name: r,
|
|
2421
|
-
host:
|
|
2575
|
+
host: l,
|
|
2422
2576
|
path: n,
|
|
2423
2577
|
query: o,
|
|
2424
2578
|
hash: a,
|
|
2425
2579
|
meta: s,
|
|
2426
2580
|
depth: 1,
|
|
2427
2581
|
state: {}
|
|
2428
|
-
},
|
|
2429
|
-
return
|
|
2582
|
+
}, m = Xe(t) ? rr(t.parent, i) : i;
|
|
2583
|
+
return Et(m.path.params, m.query.params, m.host.params, m.hash.params), m;
|
|
2430
2584
|
}
|
|
2431
2585
|
export {
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2586
|
+
Tr as DuplicateParamsError,
|
|
2587
|
+
Mr as MetaPropertyConflict,
|
|
2588
|
+
$n as RouterLink,
|
|
2589
|
+
wt as RouterNotInstalledError,
|
|
2590
|
+
Rr as RouterView,
|
|
2591
|
+
Wr as UseRouteInvalidError,
|
|
2592
|
+
Do as arrayOf,
|
|
2593
|
+
$e as asUrl,
|
|
2594
|
+
Go as createExternalRoute,
|
|
2595
|
+
Qr as createParam,
|
|
2596
|
+
yt as createRoute,
|
|
2597
|
+
Io as createRouter,
|
|
2598
|
+
Jo as createRouterPlugin,
|
|
2599
|
+
Mo as host,
|
|
2600
|
+
dr as isRoute,
|
|
2447
2601
|
M as isUrl,
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2602
|
+
_o as onAfterRouteLeave,
|
|
2603
|
+
qo as onAfterRouteUpdate,
|
|
2604
|
+
$o as onBeforeRouteLeave,
|
|
2605
|
+
Ho as onBeforeRouteUpdate,
|
|
2606
|
+
To as path,
|
|
2607
|
+
Wo as query,
|
|
2608
|
+
Fo as tupleOf,
|
|
2609
|
+
Bo as unionOf,
|
|
2610
|
+
On as useLink,
|
|
2611
|
+
yr as useRoute,
|
|
2612
|
+
ee as useRouter,
|
|
2613
|
+
jo as withDefault,
|
|
2614
|
+
Q as withParams
|
|
2461
2615
|
};
|