@kitbag/router 0.20.11 → 0.21.0

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