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