@kitbag/router 0.17.1 → 0.17.3

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