@kitbag/router 0.17.7 → 0.18.0

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