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