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