@kitbag/router 0.7.1 → 0.7.2

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,7 +1,7 @@
1
1
  var Ce = Object.defineProperty;
2
2
  var Oe = (t, e, n) => e in t ? Ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var C = (t, e, n) => (Oe(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- import { inject as gt, computed as H, toValue as St, toRefs as _e, reactive as te, watch as qe, onUnmounted as ee, defineComponent as st, openBlock as ne, createElementBlock as We, normalizeClass as Me, renderSlot as re, normalizeProps as oe, guardReactiveProps as De, unref as ct, h as ut, resolveComponent as Te, provide as Ie, mergeProps as Fe, createBlock as Je, resolveDynamicComponent as Qe, createCommentVNode as Ke, ref as Ge, markRaw as it } from "vue";
4
+ import { inject as gt, computed as H, toValue as St, toRefs as _e, reactive as ee, watch as qe, onUnmounted as ne, defineComponent as st, openBlock as re, createElementBlock as We, normalizeClass as De, renderSlot as oe, normalizeProps as ae, guardReactiveProps as Me, unref as ct, h as ut, resolveComponent as Te, provide as Ie, mergeProps as Fe, createBlock as Je, resolveDynamicComponent as Qe, createCommentVNode as Ge, ref as Ke, markRaw as it } from "vue";
5
5
  class ze extends Error {
6
6
  /**
7
7
  * Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
@@ -11,7 +11,7 @@ class ze extends Error {
11
11
  super(`Invalid Param "${e}": Router does not support multiple params by the same name. All param names must be unique.`);
12
12
  }
13
13
  }
14
- class At extends Error {
14
+ class kt extends Error {
15
15
  constructor() {
16
16
  super("Router not installed");
17
17
  }
@@ -27,11 +27,11 @@ class Ye extends Error {
27
27
  super(`useRoute called with incorrect route. Given ${e}, expected ${n}`);
28
28
  }
29
29
  }
30
- const ae = Symbol();
30
+ const se = Symbol();
31
31
  function Bt() {
32
- const t = gt(ae);
32
+ const t = gt(se);
33
33
  if (!t)
34
- throw new At();
34
+ throw new kt();
35
35
  return t;
36
36
  }
37
37
  class Y extends Error {
@@ -58,16 +58,13 @@ function Xe(t, e = {}, n = {}) {
58
58
  replace: (f) => r.replace(c.value, {}, { ...s.value, ...f })
59
59
  };
60
60
  }
61
- const se = Symbol();
61
+ const ce = Symbol();
62
62
  function Ze() {
63
- const t = gt(se);
63
+ const t = gt(ce);
64
64
  if (!t)
65
- throw new At();
65
+ throw new kt();
66
66
  return t;
67
67
  }
68
- function ce(t, e) {
69
- return [t, e].filter((n) => !!n).join(".");
70
- }
71
68
  const ue = Symbol("isRouterRouteSymbol");
72
69
  function tn(t) {
73
70
  return typeof t == "object" && t !== null && ue in t;
@@ -79,70 +76,63 @@ function en(t, e) {
79
76
  ...t.params,
80
77
  ...p
81
78
  };
82
- return e(t.key, b, f);
79
+ return e(t.name, b, f);
83
80
  }
84
81
  const d = {
85
82
  ...t.params,
86
83
  [p]: f
87
84
  };
88
- return e(t.key, d, E);
85
+ return e(t.name, d, E);
89
86
  }
90
- const { matched: r, matches: o, key: a, query: s, params: c, state: u } = _e(t), l = te({
87
+ const { matched: r, matches: o, name: a, query: s, params: c, state: u } = _e(t), l = ee({
91
88
  matched: r,
92
89
  matches: o,
93
90
  state: u,
94
91
  query: s,
95
92
  params: c,
96
- key: a,
93
+ name: a,
97
94
  update: n,
98
95
  [ue]: !0
99
96
  });
100
97
  return new Proxy(l, {
101
98
  get: (p, f, E) => f === "params" ? new Proxy(t.params, {
102
- set(d, b, k) {
103
- return n(b, k), !0;
99
+ set(d, b, x) {
100
+ return n(b, x), !0;
104
101
  }
105
102
  }) : f === "state" ? new Proxy(t.state, {
106
- set(d, b, k) {
107
- return n({}, { state: { ...t.state, [b]: k } }), !0;
103
+ set(d, b, x) {
104
+ return n({}, { state: { ...t.state, [b]: x } }), !0;
108
105
  }
109
106
  }) : Reflect.get(p, f, E)
110
107
  });
111
108
  }
109
+ function Lt(t) {
110
+ return t === void 0 ? "" : t;
111
+ }
112
112
  function nn(t, e, { exact: n } = {}) {
113
113
  if (!tn(t))
114
114
  return !1;
115
115
  if (e === void 0)
116
116
  return !0;
117
- const r = rn(t);
117
+ const r = t.matches.map((o) => Lt(o.name));
118
118
  if (n) {
119
119
  const o = r.at(-1);
120
120
  return e === o;
121
121
  }
122
122
  return r.includes(e);
123
123
  }
124
- function rn(t) {
125
- return t.matches.map((n) => n.name).reduce((n, r) => {
126
- const o = n.pop(), a = r ? [ce(o, r)] : [];
127
- return o ? [
128
- ...n,
129
- o,
130
- ...a
131
- ] : a;
132
- }, []);
133
- }
134
- function on(t, e) {
124
+ function rn(t, e) {
135
125
  const n = Bt();
136
126
  function r() {
137
127
  if (!t)
138
128
  return;
139
129
  if (!nn(n.route, t, e))
140
- throw new Ye(t, n.route.key);
130
+ throw new Ye(t, n.route.name);
141
131
  }
142
132
  return qe(n.route, r, { immediate: !0, deep: !0 }), n.route;
143
133
  }
144
134
  const ie = Symbol();
145
- function Lt() {
135
+ function Nt() {
146
136
  return gt(ie, 0);
147
137
  }
148
138
  class ft {
@@ -155,7 +145,7 @@ class ft {
155
145
  C(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
156
146
  }
157
147
  }
158
- class qt extends Error {
148
+ class Wt extends Error {
159
149
  }
160
150
  class nt extends Error {
161
151
  constructor(n) {
@@ -174,23 +164,26 @@ class bt extends Error {
174
164
  function z(t) {
175
165
  return Array.isArray(t) ? t : [t];
176
166
  }
177
- function an(t, e) {
167
+ function fe(t, e) {
168
+ return t.filter((n) => e === n).length;
169
+ }
170
+ function on(t, e) {
178
171
  const n = new ft();
179
172
  return t.matches.forEach((r, o) => {
180
- r.onBeforeRouteEnter && Ut(t, e, o) && z(r.onBeforeRouteEnter).forEach((a) => n.onBeforeRouteEnter.add(a)), r.onBeforeRouteUpdate && Nt(t, e, o) && z(r.onBeforeRouteUpdate).forEach((a) => n.onBeforeRouteUpdate.add(a));
173
+ r.onBeforeRouteEnter && Ut(t, e, o) && z(r.onBeforeRouteEnter).forEach((a) => n.onBeforeRouteEnter.add(a)), r.onBeforeRouteUpdate && Ht(t, e, o) && z(r.onBeforeRouteUpdate).forEach((a) => n.onBeforeRouteUpdate.add(a));
181
174
  }), e.matches.forEach((r, o) => {
182
175
  r.onBeforeRouteLeave && $t(t, e, o) && z(r.onBeforeRouteLeave).forEach((a) => n.onBeforeRouteLeave.add(a));
183
176
  }), n;
184
177
  }
185
- function sn(t, e) {
178
+ function an(t, e) {
186
179
  const n = new ft();
187
180
  return t.matches.forEach((r, o) => {
188
- r.onAfterRouteEnter && Ut(t, e, o) && z(r.onAfterRouteEnter).forEach((a) => n.onAfterRouteEnter.add(a)), r.onAfterRouteUpdate && Nt(t, e, o) && z(r.onAfterRouteUpdate).forEach((a) => n.onAfterRouteUpdate.add(a));
181
+ r.onAfterRouteEnter && Ut(t, e, o) && z(r.onAfterRouteEnter).forEach((a) => n.onAfterRouteEnter.add(a)), r.onAfterRouteUpdate && Ht(t, e, o) && z(r.onAfterRouteUpdate).forEach((a) => n.onAfterRouteUpdate.add(a));
189
182
  }), e.matches.forEach((r, o) => {
190
183
  r.onAfterRouteLeave && $t(t, e, o) && z(r.onAfterRouteLeave).forEach((a) => n.onAfterRouteLeave.add(a));
191
184
  }), n;
192
185
  }
193
- function cn() {
186
+ function sn() {
194
187
  const t = (s) => {
195
188
  throw new bt(s);
196
189
  }, e = (...s) => {
@@ -203,10 +196,10 @@ function cn() {
203
196
  const l = c, p = u ?? {};
204
197
  throw new nt([s, l, { ...p, replace: !0 }]);
205
198
  }, r = () => {
206
- throw new qt();
199
+ throw new Wt();
207
200
  };
208
201
  async function o({ to: s, from: c, hooks: u }) {
209
- const { global: l, component: p } = u, f = an(s, c), E = [
202
+ const { global: l, component: p } = u, f = on(s, c), E = [
210
203
  ...l.onBeforeRouteEnter,
211
204
  ...f.onBeforeRouteEnter,
212
205
  ...l.onBeforeRouteUpdate,
@@ -236,7 +229,7 @@ function cn() {
236
229
  status: "REJECT",
237
230
  type: d.type
238
231
  };
239
- if (d instanceof qt)
232
+ if (d instanceof Wt)
240
233
  return {
241
234
  status: "ABORT"
242
235
  };
@@ -247,7 +240,7 @@ function cn() {
247
240
  };
248
241
  }
249
242
  async function a({ to: s, from: c, hooks: u }) {
250
- const { global: l, component: p } = u, f = sn(s, c), E = [
243
+ const { global: l, component: p } = u, f = an(s, c), E = [
251
244
  ...p.onAfterRouteLeave,
252
245
  ...f.onAfterRouteLeave,
253
246
  ...l.onAfterRouteLeave,
@@ -294,15 +287,15 @@ const Ut = (t, e, n) => {
294
287
  }, $t = (t, e, n) => {
295
288
  const r = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
296
289
  return r.length < n || r[n] !== o[n];
297
- }, Nt = (t, e, n) => t.matches[n] === (e == null ? void 0 : e.matches[n]);
298
- function Wt(t) {
290
+ }, Ht = (t, e, n) => t.matches[n] === (e == null ? void 0 : e.matches[n]);
291
+ function Dt(t) {
299
292
  switch (t) {
300
293
  case "onBeforeRouteEnter":
301
294
  case "onAfterRouteEnter":
302
295
  return Ut;
303
296
  case "onBeforeRouteUpdate":
304
297
  case "onAfterRouteUpdate":
305
- return Nt;
298
+ return Ht;
306
299
  case "onBeforeRouteLeave":
307
300
  case "onAfterRouteLeave":
308
301
  return $t;
@@ -310,29 +303,29 @@ function Wt(t) {
310
303
  throw new Error(`Switch is not exhaustive for lifecycle: ${t}`);
311
304
  }
312
305
  }
313
- class un {
306
+ class cn {
314
307
  constructor() {
315
308
  C(this, "global", new ft());
316
309
  C(this, "component", new ft());
317
310
  }
318
311
  addBeforeRouteHook({ lifecycle: e, timing: n, depth: r, hook: o }) {
319
- const a = Wt(e), s = this[n][e], c = (u, l) => {
312
+ const a = Dt(e), s = this[n][e], c = (u, l) => {
320
313
  if (a(u, l.from, r))
321
314
  return o(u, l);
322
315
  };
323
316
  return s.add(c), () => s.delete(c);
324
317
  }
325
318
  addAfterRouteHook({ lifecycle: e, timing: n, depth: r, hook: o }) {
326
- const a = Wt(e), s = this[n][e], c = (u, l) => {
319
+ const a = Dt(e), s = this[n][e], c = (u, l) => {
327
320
  if (a(u, l.from, r))
328
321
  return o(u, l);
329
322
  };
330
323
  return s.add(c), () => s.delete(c);
331
324
  }
332
325
  }
333
- const fe = Symbol();
334
- function fn() {
335
- const t = new un();
326
+ const le = Symbol();
327
+ function un() {
328
+ const t = new cn();
336
329
  return {
337
330
  onBeforeRouteEnter: (c) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
338
331
  onBeforeRouteUpdate: (c) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
@@ -343,25 +336,25 @@ function fn() {
343
336
  hooks: t
344
337
  };
345
338
  }
346
- function le() {
347
- const t = gt(fe);
339
+ function he() {
340
+ const t = gt(le);
348
341
  if (!t)
349
- throw new At();
342
+ throw new kt();
350
343
  return t;
351
344
  }
352
- function he(t) {
345
+ function pe(t) {
353
346
  return (e) => {
354
- const n = Lt(), o = le().addBeforeRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
355
- return ee(o), o;
347
+ const n = Nt(), o = he().addBeforeRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
348
+ return ne(o), o;
356
349
  };
357
350
  }
358
- function Ht(t) {
351
+ function Vt(t) {
359
352
  return (e) => {
360
- const n = Lt(), o = le().addAfterRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
361
- return ee(o), o;
353
+ const n = Nt(), o = he().addAfterRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
354
+ return ne(o), o;
362
355
  };
363
356
  }
364
- const Pr = he("onBeforeRouteUpdate"), Sr = he("onBeforeRouteLeave"), br = Ht("onAfterRouteEnter"), kr = Ht("onAfterRouteUpdate"), xr = Ht("onAfterRouteLeave"), ln = ["href"], hn = /* @__PURE__ */ st({
357
+ const Pr = pe("onBeforeRouteUpdate"), Sr = pe("onBeforeRouteLeave"), br = Vt("onAfterRouteEnter"), xr = Vt("onAfterRouteUpdate"), Ar = Vt("onAfterRouteLeave"), fn = ["href"], ln = /* @__PURE__ */ st({
365
358
  __name: "routerLink",
366
359
  props: {
367
360
  to: { type: [String, Function] },
@@ -380,26 +373,26 @@ const Pr = he("onBeforeRouteUpdate"), Sr = he("onBeforeRouteLeave"), br = Ht("on
380
373
  function p(f) {
381
374
  f.preventDefault(), n.push(a.value, o.value);
382
375
  }
383
- return (f, E) => (ne(), We("a", {
376
+ return (f, E) => (re(), We("a", {
384
377
  href: r.value,
385
- class: Me(["router-link", u.value]),
378
+ class: De(["router-link", u.value]),
386
379
  onClick: p
387
380
  }, [
388
- re(f.$slots, "default", oe(De({ resolved: r.value, isMatch: ct(s), isExactMatch: ct(c), isExternal: l.value })))
389
- ], 10, ln));
381
+ oe(f.$slots, "default", ae(Me({ resolved: r.value, isMatch: ct(s), isExactMatch: ct(c), isExternal: l.value })))
382
+ ], 10, fn));
390
383
  }
391
384
  });
392
- function pn(t, e) {
385
+ function hn(t, e) {
393
386
  return st({
394
387
  name: "PropsWrapper",
395
388
  expose: [],
396
389
  setup() {
397
390
  const n = e();
398
- return "then" in n ? () => ut(dn(t, n)) : () => ut(t, n);
391
+ return "then" in n ? () => ut(pn(t, n)) : () => ut(t, n);
399
392
  }
400
393
  });
401
394
  }
402
- function dn(t, e) {
395
+ function pn(t, e) {
403
396
  return st({
404
397
  name: "AsyncPropsWrapper",
405
398
  expose: [],
@@ -409,32 +402,29 @@ function dn(t, e) {
409
402
  }
410
403
  });
411
404
  }
412
- class mn extends Error {
405
+ class dn extends Error {
413
406
  constructor(e) {
414
407
  super(`Child property on meta for ${e} conflicts with the parent meta.`);
415
408
  }
416
409
  }
417
- function gn(t, e) {
418
- return yn(t, e), { ...t, ...e };
410
+ function mn(t, e) {
411
+ return gn(t, e), { ...t, ...e };
419
412
  }
420
- function yn(t, e) {
413
+ function gn(t, e) {
421
414
  const n = Object.keys(t).find((r) => r in e && typeof e[r] != typeof t[r]);
422
415
  if (n)
423
- throw new mn(n);
416
+ throw new dn(n);
424
417
  }
425
418
  function tt(...t) {
426
- const e = t.flatMap((n) => Array.isArray(n) ? n : Object.keys(n).map(vn));
419
+ const e = t.flatMap((n) => Array.isArray(n) ? n : Object.keys(n).map(Rn));
427
420
  for (const n of e)
428
- if (Rn(e, n) > 1)
421
+ if (fe(e, n) > 1)
429
422
  throw new ze(n);
430
423
  }
431
- function Rn(t, e) {
432
- return t.filter((n) => e === n).length;
433
- }
434
- function vn(t) {
424
+ function Rn(t) {
435
425
  return t.startsWith("?") ? t.slice(1) : t;
436
426
  }
437
- function wn(t, e) {
427
+ function yn(t, e) {
438
428
  tt(t.params, e.params);
439
429
  const n = `${t.path}${e.path}`;
440
430
  return {
@@ -443,62 +433,61 @@ function wn(t, e) {
443
433
  toString: () => n
444
434
  };
445
435
  }
446
- function Vt(t) {
436
+ function jt(t) {
447
437
  return typeof t == "object" && t !== null && !Array.isArray(t);
448
438
  }
449
- function En(t) {
439
+ function vn(t) {
450
440
  return t.every((e) => Array.isArray(e));
451
441
  }
452
- function yt(t) {
442
+ function Rt(t) {
453
443
  return typeof t == "string" && t.length > 0;
454
444
  }
455
- function Pn(t, e) {
445
+ function wn(t, e) {
456
446
  tt(t.params, e.params);
457
- const n = [t.query, e.query].filter(yt).join("&");
447
+ const n = [t.query, e.query].filter(Rt).join("&");
458
448
  return {
459
449
  query: n,
460
450
  params: { ...t.params, ...e.params },
461
451
  toString: () => n
462
452
  };
463
453
  }
464
- function Sn(t, e) {
454
+ function En(t, e) {
465
455
  return tt(t, e), { ...t, ...e };
466
456
  }
467
- function bn(t) {
457
+ function Pn(t) {
468
458
  return "host" in t && !!t.host;
469
459
  }
470
- function pe(t) {
460
+ function de(t) {
471
461
  return "parent" in t && !!t.parent;
472
462
  }
473
463
  function Mt(t) {
474
464
  return "component" in t && !!t.component;
475
465
  }
476
- function Dt(t) {
466
+ function Tt(t) {
477
467
  return "components" in t && !!t.components;
478
468
  }
479
- function kn(t) {
469
+ function Sn(t) {
480
470
  return "state" in t && !!t.state;
481
471
  }
482
- function de(t, e) {
472
+ function me(t, e) {
483
473
  return {
484
474
  ...e,
485
- key: ce(t.key, e.key),
486
- path: wn(t.path, e.path),
487
- query: Pn(t.query, e.query),
488
- meta: gn(t.meta, e.meta),
489
- state: Sn(t.state, e.state),
475
+ path: yn(t.path, e.path),
476
+ query: wn(t.query, e.query),
477
+ meta: mn(t.meta, e.meta),
478
+ state: En(t.state, e.state),
490
479
  matches: [...t.matches, e.matched],
491
480
  host: t.host,
492
481
  depth: t.depth + 1
493
482
  };
494
483
  }
495
- const xn = /* @__PURE__ */ st({
484
+ const bn = /* @__PURE__ */ st({
496
485
  __name: "routerView",
497
486
  props: {
498
487
  name: {}
499
488
  },
500
489
  setup(t) {
501
- const { name: e = "default" } = t, n = on(), r = Ze(), o = Lt(), a = Te("RouterView", !0);
490
+ const { name: e = "default" } = t, n = rn(), r = Ze(), o = Nt(), a = Te("RouterView", !0);
502
491
  Ie(ie, o + 1);
503
492
  const s = H(() => {
504
493
  if (r.value)
@@ -507,55 +496,55 @@ const xn = /* @__PURE__ */ st({
507
496
  if (!f)
508
497
  return null;
509
498
  const E = c(f), d = l(f);
510
- return E ? d ? pn(E, () => d(n.params)) : E : null;
499
+ return E ? d ? hn(E, () => d(n.params)) : E : null;
511
500
  });
512
501
  function c(f) {
513
502
  return u(f)[e];
514
503
  }
515
504
  function u(f) {
516
- return Dt(f) ? f.components : Mt(f) ? { default: f.component } : typeof a == "string" ? {} : { default: a };
505
+ return Tt(f) ? f.components : Mt(f) ? { default: f.component } : typeof a == "string" ? {} : { default: a };
517
506
  }
518
507
  function l(f) {
519
508
  return p(f)[e];
520
509
  }
521
510
  function p(f) {
522
- return Dt(f) ? f.props ?? {} : Mt(f) ? { default: f.props } : {};
511
+ return Tt(f) ? f.props ?? {} : Mt(f) ? { default: f.props } : {};
523
512
  }
524
- return (f, E) => s.value ? re(f.$slots, "default", oe(Fe({ key: 0 }, { route: ct(n), component: s.value, rejection: ct(r) })), () => [
525
- (ne(), Je(Qe(s.value)))
526
- ]) : Ke("", !0);
513
+ return (f, E) => s.value ? oe(f.$slots, "default", ae(Fe({ key: 0 }, { route: ct(n), component: s.value, rejection: ct(r) })), () => [
514
+ (re(), Je(Qe(s.value)))
515
+ ]) : Ge("", !0);
527
516
  }
528
- }), M = "[", I = "]";
529
- function An(t) {
517
+ }), D = "[", I = "]";
518
+ function xn(t) {
530
519
  return t !== String && t !== Boolean && t !== Number && t !== Date;
531
520
  }
532
- function Bn(t) {
533
- return typeof t == "function" && An(t);
521
+ function An(t) {
522
+ return typeof t == "function" && xn(t);
534
523
  }
535
- function Rt(t) {
524
+ function yt(t) {
536
525
  return typeof t == "object" && "get" in t && typeof t.get == "function" && "set" in t && typeof t.set == "function";
537
526
  }
538
- function Ln(t) {
539
- return Rt(t) && t.defaultValue !== void 0;
527
+ function kn(t) {
528
+ return yt(t) && t.defaultValue !== void 0;
540
529
  }
541
- function Ar(t, e) {
530
+ function kr(t, e) {
542
531
  return Nn(t, e);
543
532
  }
544
- function Un(t, e) {
533
+ function Bn(t, e) {
545
534
  return t[e] ?? String;
546
535
  }
547
536
  const V = {
548
537
  invalid: (t) => {
549
538
  throw new Y(t);
550
539
  }
551
- }, $n = {
540
+ }, Ln = {
552
541
  get: (t) => t,
553
542
  set: (t, { invalid: e }) => {
554
543
  if (typeof t != "string")
555
544
  throw e();
556
545
  return t;
557
546
  }
558
- }, me = {
547
+ }, ge = {
559
548
  get: (t, { invalid: e }) => {
560
549
  if (t === "true")
561
550
  return !0;
@@ -568,7 +557,7 @@ const V = {
568
557
  throw e();
569
558
  return t.toString();
570
559
  }
571
- }, ge = {
560
+ }, Re = {
572
561
  get: (t, { invalid: e }) => {
573
562
  const n = Number(t);
574
563
  if (isNaN(n))
@@ -592,7 +581,7 @@ const V = {
592
581
  throw e();
593
582
  return t.toISOString();
594
583
  }
595
- }, Re = {
584
+ }, ve = {
596
585
  get: (t, { invalid: e }) => {
597
586
  try {
598
587
  return JSON.parse(t);
@@ -609,26 +598,26 @@ const V = {
609
598
  }
610
599
  };
611
600
  function rt(t, e, n = !1) {
612
- if (t === void 0 || !yt(t)) {
613
- if (Ln(e))
601
+ if (t === void 0 || !Rt(t)) {
602
+ if (kn(e))
614
603
  return e.defaultValue;
615
604
  if (n)
616
605
  return;
617
606
  throw new Y();
618
607
  }
619
608
  if (e === String)
620
- return $n.get(t, V);
609
+ return Ln.get(t, V);
621
610
  if (e === Boolean)
622
- return me.get(t, V);
623
- if (e === Number)
624
611
  return ge.get(t, V);
612
+ if (e === Number)
613
+ return Re.get(t, V);
625
614
  if (e === Date)
626
615
  return ye.get(t, V);
627
616
  if (e === JSON)
628
- return Re.get(t, V);
629
- if (Bn(e))
617
+ return ve.get(t, V);
618
+ if (An(e))
630
619
  return e(t, V);
631
- if (Rt(e))
620
+ if (yt(e))
632
621
  return e.get(t, V);
633
622
  if (e instanceof RegExp) {
634
623
  if (e.test(t))
@@ -644,14 +633,14 @@ function ot(t, e, n = !1) {
644
633
  throw new Y();
645
634
  }
646
635
  if (e === Boolean)
647
- return me.set(t, V);
648
- if (e === Number)
649
636
  return ge.set(t, V);
637
+ if (e === Number)
638
+ return Re.set(t, V);
650
639
  if (e === Date)
651
640
  return ye.set(t, V);
652
641
  if (e === JSON)
653
- return Re.set(t, V);
654
- if (Rt(e))
642
+ return ve.set(t, V);
643
+ if (yt(e))
655
644
  return e.set(t, V);
656
645
  try {
657
646
  return t.toString();
@@ -660,7 +649,7 @@ function ot(t, e, n = !1) {
660
649
  }
661
650
  }
662
651
  function Nn(t, e) {
663
- return Rt(t) ? { ...t, defaultValue: e ?? t.defaultValue } : {
652
+ return yt(t) ? { ...t, defaultValue: e ?? t.defaultValue } : {
664
653
  get: (n) => rt(n, t),
665
654
  set: (n) => ot(n, t),
666
655
  defaultValue: e
@@ -676,10 +665,10 @@ function T() {
676
665
  return t;
677
666
  }, T.apply(this, arguments);
678
667
  }
679
- var U;
668
+ var N;
680
669
  (function(t) {
681
670
  t.Pop = "POP", t.Push = "PUSH", t.Replace = "REPLACE";
682
- })(U || (U = {}));
671
+ })(N || (N = {}));
683
672
  var X = process.env.NODE_ENV !== "production" ? function(t) {
684
673
  return Object.freeze(t);
685
674
  } : function(t) {
@@ -694,8 +683,8 @@ function J(t, e) {
694
683
  }
695
684
  }
696
685
  }
697
- var lt = "beforeunload", Hn = "hashchange", ve = "popstate";
698
- function Tt(t) {
686
+ var lt = "beforeunload", Un = "hashchange", we = "popstate";
687
+ function It(t) {
699
688
  t === void 0 && (t = {});
700
689
  var e = t, n = e.window, r = n === void 0 ? document.defaultView : n, o = r.history;
701
690
  function a() {
@@ -713,7 +702,7 @@ function Tt(t) {
713
702
  if (s)
714
703
  d.call(s), s = null;
715
704
  else {
716
- var m = U.Pop, i = a(), h = i[0], v = i[1];
705
+ var m = N.Pop, i = a(), h = i[0], v = i[1];
717
706
  if (d.length)
718
707
  if (h != null) {
719
708
  var w = p - h;
@@ -736,15 +725,15 @@ function Tt(t) {
736
725
  O(m);
737
726
  }
738
727
  }
739
- r.addEventListener(ve, c);
740
- var u = U.Pop, l = a(), p = l[0], f = l[1], E = Z(), d = Z();
728
+ r.addEventListener(we, c);
729
+ var u = N.Pop, l = a(), p = l[0], f = l[1], E = Z(), d = Z();
741
730
  p == null && (p = 0, o.replaceState(T({}, o.state, {
742
731
  idx: p
743
732
  }), ""));
744
733
  function b(m) {
745
734
  return typeof m == "string" ? m : Q(m);
746
735
  }
747
- function k(m, i) {
736
+ function x(m, i) {
748
737
  return i === void 0 && (i = null), X(T({
749
738
  pathname: f.pathname,
750
739
  hash: "",
@@ -754,14 +743,14 @@ function Tt(t) {
754
743
  key: pt()
755
744
  }));
756
745
  }
757
- function $(m, i) {
746
+ function U(m, i) {
758
747
  return [{
759
748
  usr: m.state,
760
749
  key: m.key,
761
750
  idx: i
762
751
  }, b(m)];
763
752
  }
764
- function N(m, i, h) {
753
+ function $(m, i, h) {
765
754
  return !d.length || (d.call({
766
755
  action: m,
767
756
  location: i,
@@ -777,12 +766,12 @@ function Tt(t) {
777
766
  });
778
767
  }
779
768
  function g(m, i) {
780
- var h = U.Push, v = k(m, i);
769
+ var h = N.Push, v = x(m, i);
781
770
  function w() {
782
771
  g(m, i);
783
772
  }
784
- if (N(h, v, w)) {
785
- var x = $(v, p + 1), B = x[0], L = x[1];
773
+ if ($(h, v, w)) {
774
+ var A = U(v, p + 1), B = A[0], L = A[1];
786
775
  try {
787
776
  o.pushState(B, "", L);
788
777
  } catch {
@@ -791,13 +780,13 @@ function Tt(t) {
791
780
  O(h);
792
781
  }
793
782
  }
794
- function y(m, i) {
795
- var h = U.Replace, v = k(m, i);
783
+ function R(m, i) {
784
+ var h = N.Replace, v = x(m, i);
796
785
  function w() {
797
- y(m, i);
786
+ R(m, i);
798
787
  }
799
- if (N(h, v, w)) {
800
- var x = $(v, p), B = x[0], L = x[1];
788
+ if ($(h, v, w)) {
789
+ var A = U(v, p), B = A[0], L = A[1];
801
790
  o.replaceState(B, "", L), O(h);
802
791
  }
803
792
  }
@@ -813,7 +802,7 @@ function Tt(t) {
813
802
  },
814
803
  createHref: b,
815
804
  push: g,
816
- replace: y,
805
+ replace: R,
817
806
  go: P,
818
807
  back: function() {
819
808
  P(-1);
@@ -833,14 +822,14 @@ function Tt(t) {
833
822
  };
834
823
  return S;
835
824
  }
836
- function Vn(t) {
825
+ function $n(t) {
837
826
  t === void 0 && (t = {});
838
827
  var e = t, n = e.window, r = n === void 0 ? document.defaultView : n, o = r.history;
839
828
  function a() {
840
- var i = at(r.location.hash.substr(1)), h = i.pathname, v = h === void 0 ? "/" : h, w = i.search, x = w === void 0 ? "" : w, B = i.hash, L = B === void 0 ? "" : B, j = o.state || {};
829
+ var i = at(r.location.hash.substr(1)), h = i.pathname, v = h === void 0 ? "/" : h, w = i.search, A = w === void 0 ? "" : w, B = i.hash, L = B === void 0 ? "" : B, j = o.state || {};
841
830
  return [j.idx, X({
842
831
  pathname: v,
843
- search: x,
832
+ search: A,
844
833
  hash: L,
845
834
  state: j.usr || null,
846
835
  key: j.key || "default"
@@ -851,17 +840,17 @@ function Vn(t) {
851
840
  if (s)
852
841
  d.call(s), s = null;
853
842
  else {
854
- var i = U.Pop, h = a(), v = h[0], w = h[1];
843
+ var i = N.Pop, h = a(), v = h[0], w = h[1];
855
844
  if (d.length)
856
845
  if (v != null) {
857
- var x = p - v;
858
- x && (s = {
846
+ var A = p - v;
847
+ A && (s = {
859
848
  action: i,
860
849
  location: w,
861
850
  retry: function() {
862
- S(x * -1);
851
+ S(A * -1);
863
852
  }
864
- }, S(x));
853
+ }, S(A));
865
854
  } else
866
855
  process.env.NODE_ENV !== "production" && J(
867
856
  !1,
@@ -874,11 +863,11 @@ function Vn(t) {
874
863
  g(i);
875
864
  }
876
865
  }
877
- r.addEventListener(ve, c), r.addEventListener(Hn, function() {
866
+ r.addEventListener(we, c), r.addEventListener(Un, function() {
878
867
  var i = a(), h = i[1];
879
868
  Q(h) !== Q(f) && c();
880
869
  });
881
- var u = U.Pop, l = a(), p = l[0], f = l[1], E = Z(), d = Z();
870
+ var u = N.Pop, l = a(), p = l[0], f = l[1], E = Z(), d = Z();
882
871
  p == null && (p = 0, o.replaceState(T({}, o.state, {
883
872
  idx: p
884
873
  }), ""));
@@ -890,10 +879,10 @@ function Vn(t) {
890
879
  }
891
880
  return h;
892
881
  }
893
- function k(i) {
882
+ function x(i) {
894
883
  return b() + "#" + (typeof i == "string" ? i : Q(i));
895
884
  }
896
- function $(i, h) {
885
+ function U(i, h) {
897
886
  return h === void 0 && (h = null), X(T({
898
887
  pathname: f.pathname,
899
888
  hash: "",
@@ -903,12 +892,12 @@ function Vn(t) {
903
892
  key: pt()
904
893
  }));
905
894
  }
906
- function N(i, h) {
895
+ function $(i, h) {
907
896
  return [{
908
897
  usr: i.state,
909
898
  key: i.key,
910
899
  idx: h
911
- }, k(i)];
900
+ }, x(i)];
912
901
  }
913
902
  function O(i, h, v) {
914
903
  return !d.length || (d.call({
@@ -925,13 +914,13 @@ function Vn(t) {
925
914
  location: f
926
915
  });
927
916
  }
928
- function y(i, h) {
929
- var v = U.Push, w = $(i, h);
930
- function x() {
931
- y(i, h);
917
+ function R(i, h) {
918
+ var v = N.Push, w = U(i, h);
919
+ function A() {
920
+ R(i, h);
932
921
  }
933
- if (process.env.NODE_ENV !== "production" && J(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(i) + ")"), O(v, w, x)) {
934
- var B = N(w, p + 1), L = B[0], j = B[1];
922
+ if (process.env.NODE_ENV !== "production" && J(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(i) + ")"), O(v, w, A)) {
923
+ var B = $(w, p + 1), L = B[0], j = B[1];
935
924
  try {
936
925
  o.pushState(L, "", j);
937
926
  } catch {
@@ -941,12 +930,12 @@ function Vn(t) {
941
930
  }
942
931
  }
943
932
  function P(i, h) {
944
- var v = U.Replace, w = $(i, h);
945
- function x() {
933
+ var v = N.Replace, w = U(i, h);
934
+ function A() {
946
935
  P(i, h);
947
936
  }
948
- if (process.env.NODE_ENV !== "production" && J(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(i) + ")"), O(v, w, x)) {
949
- var B = N(w, p), L = B[0], j = B[1];
937
+ if (process.env.NODE_ENV !== "production" && J(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(i) + ")"), O(v, w, A)) {
938
+ var B = $(w, p), L = B[0], j = B[1];
950
939
  o.replaceState(L, "", j), g(v);
951
940
  }
952
941
  }
@@ -960,8 +949,8 @@ function Vn(t) {
960
949
  get location() {
961
950
  return f;
962
951
  },
963
- createHref: k,
964
- push: y,
952
+ createHref: x,
953
+ push: R,
965
954
  replace: P,
966
955
  go: S,
967
956
  back: function() {
@@ -982,64 +971,64 @@ function Vn(t) {
982
971
  };
983
972
  return m;
984
973
  }
985
- function It(t) {
974
+ function Ft(t) {
986
975
  t === void 0 && (t = {});
987
976
  var e = t, n = e.initialEntries, r = n === void 0 ? ["/"] : n, o = e.initialIndex, a = r.map(function(g) {
988
- var y = X(T({
977
+ var R = X(T({
989
978
  pathname: "/",
990
979
  search: "",
991
980
  hash: "",
992
981
  state: null,
993
982
  key: pt()
994
983
  }, typeof g == "string" ? at(g) : g));
995
- return process.env.NODE_ENV !== "production" && J(y.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(g) + ")"), y;
996
- }), s = Ft(o ?? a.length - 1, 0, a.length - 1), c = U.Pop, u = a[s], l = Z(), p = Z();
984
+ return process.env.NODE_ENV !== "production" && J(R.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(g) + ")"), R;
985
+ }), s = Jt(o ?? a.length - 1, 0, a.length - 1), c = N.Pop, u = a[s], l = Z(), p = Z();
997
986
  function f(g) {
998
987
  return typeof g == "string" ? g : Q(g);
999
988
  }
1000
- function E(g, y) {
1001
- return y === void 0 && (y = null), X(T({
989
+ function E(g, R) {
990
+ return R === void 0 && (R = null), X(T({
1002
991
  pathname: u.pathname,
1003
992
  search: "",
1004
993
  hash: ""
1005
994
  }, typeof g == "string" ? at(g) : g, {
1006
- state: y,
995
+ state: R,
1007
996
  key: pt()
1008
997
  }));
1009
998
  }
1010
- function d(g, y, P) {
999
+ function d(g, R, P) {
1011
1000
  return !p.length || (p.call({
1012
1001
  action: g,
1013
- location: y,
1002
+ location: R,
1014
1003
  retry: P
1015
1004
  }), !1);
1016
1005
  }
1017
- function b(g, y) {
1018
- c = g, u = y, l.call({
1006
+ function b(g, R) {
1007
+ c = g, u = R, l.call({
1019
1008
  action: c,
1020
1009
  location: u
1021
1010
  });
1022
1011
  }
1023
- function k(g, y) {
1024
- var P = U.Push, S = E(g, y);
1012
+ function x(g, R) {
1013
+ var P = N.Push, S = E(g, R);
1025
1014
  function m() {
1026
- k(g, y);
1015
+ x(g, R);
1027
1016
  }
1028
1017
  process.env.NODE_ENV !== "production" && J(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(g) + ")"), d(P, S, m) && (s += 1, a.splice(s, a.length, S), b(P, S));
1029
1018
  }
1030
- function $(g, y) {
1031
- var P = U.Replace, S = E(g, y);
1019
+ function U(g, R) {
1020
+ var P = N.Replace, S = E(g, R);
1032
1021
  function m() {
1033
- $(g, y);
1022
+ U(g, R);
1034
1023
  }
1035
1024
  process.env.NODE_ENV !== "production" && J(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(g) + ")"), d(P, S, m) && (a[s] = S, b(P, S));
1036
1025
  }
1037
- function N(g) {
1038
- var y = Ft(s + g, 0, a.length - 1), P = U.Pop, S = a[y];
1026
+ function $(g) {
1027
+ var R = Jt(s + g, 0, a.length - 1), P = N.Pop, S = a[R];
1039
1028
  function m() {
1040
- N(g);
1029
+ $(g);
1041
1030
  }
1042
- d(P, S, m) && (s = y, b(P, S));
1031
+ d(P, S, m) && (s = R, b(P, S));
1043
1032
  }
1044
1033
  var O = {
1045
1034
  get index() {
@@ -1052,25 +1041,25 @@ function It(t) {
1052
1041
  return u;
1053
1042
  },
1054
1043
  createHref: f,
1055
- push: k,
1056
- replace: $,
1057
- go: N,
1044
+ push: x,
1045
+ replace: U,
1046
+ go: $,
1058
1047
  back: function() {
1059
- N(-1);
1048
+ $(-1);
1060
1049
  },
1061
1050
  forward: function() {
1062
- N(1);
1051
+ $(1);
1063
1052
  },
1064
- listen: function(y) {
1065
- return l.push(y);
1053
+ listen: function(R) {
1054
+ return l.push(R);
1066
1055
  },
1067
- block: function(y) {
1068
- return p.push(y);
1056
+ block: function(R) {
1057
+ return p.push(R);
1069
1058
  }
1070
1059
  };
1071
1060
  return O;
1072
1061
  }
1073
- function Ft(t, e, n) {
1062
+ function Jt(t, e, n) {
1074
1063
  return Math.min(Math.max(t, e), n);
1075
1064
  }
1076
1065
  function ht(t) {
@@ -1113,8 +1102,8 @@ function at(t) {
1113
1102
  }
1114
1103
  return e;
1115
1104
  }
1116
- function jn(t, e) {
1117
- const n = te({ ...t }), r = (s) => {
1105
+ function Hn(t, e) {
1106
+ const n = ee({ ...t }), r = (s) => {
1118
1107
  Object.assign(n, { ...s });
1119
1108
  }, o = n, a = en(o, e);
1120
1109
  return {
@@ -1123,10 +1112,10 @@ function jn(t, e) {
1123
1112
  updateRoute: r
1124
1113
  };
1125
1114
  }
1126
- function K(t) {
1127
- return !t.startsWith("http") ? On(t) : Cn(t);
1115
+ function G(t) {
1116
+ return !t.startsWith("http") ? jn(t) : Vn(t);
1128
1117
  }
1129
- function Cn(t) {
1118
+ function Vn(t) {
1130
1119
  const { protocol: e, host: n, pathname: r, search: o, searchParams: a, hash: s } = new URL(t, t);
1131
1120
  return {
1132
1121
  protocol: e,
@@ -1137,7 +1126,7 @@ function Cn(t) {
1137
1126
  hash: s
1138
1127
  };
1139
1128
  }
1140
- function On(t) {
1129
+ function jn(t) {
1141
1130
  const { pathname: e, search: n, searchParams: r, hash: o } = new URL(t, "https://localhost");
1142
1131
  return {
1143
1132
  pathname: e,
@@ -1146,17 +1135,17 @@ function On(t) {
1146
1135
  hash: o
1147
1136
  };
1148
1137
  }
1149
- function _n(t) {
1138
+ function Cn(t) {
1150
1139
  return (e) => {
1151
- const { host: n } = K(e);
1140
+ const { host: n } = G(e);
1152
1141
  return !(n === void 0 || n === t);
1153
1142
  };
1154
1143
  }
1155
- function we() {
1144
+ function Ee() {
1156
1145
  return typeof window < "u" && typeof window.document < "u";
1157
1146
  }
1158
- function qn({ mode: t, listener: e }) {
1159
- const n = Wn(t), r = (u, l) => {
1147
+ function On({ mode: t, listener: e }) {
1148
+ const n = _n(t), r = (u, l) => {
1160
1149
  if (l != null && l.replace)
1161
1150
  return n.replace(u, l.state);
1162
1151
  n.push(u, l == null ? void 0 : l.state);
@@ -1177,43 +1166,43 @@ function qn({ mode: t, listener: e }) {
1177
1166
  }
1178
1167
  };
1179
1168
  }
1180
- function Wn(t = "auto") {
1169
+ function _n(t = "auto") {
1181
1170
  switch (t) {
1182
1171
  case "auto":
1183
- return we() ? Tt() : It();
1172
+ return Ee() ? It() : Ft();
1184
1173
  case "browser":
1185
- return Tt();
1186
- case "memory":
1187
1174
  return It();
1175
+ case "memory":
1176
+ return Ft();
1188
1177
  case "hash":
1189
- return Vn();
1178
+ return $n();
1190
1179
  default:
1191
1180
  const e = t;
1192
1181
  throw new Error(`Switch is not exhaustive for mode: ${e}`);
1193
1182
  }
1194
1183
  }
1195
- function Mn(t) {
1184
+ function qn(t) {
1196
1185
  return st(() => () => ut("h1", t), {
1197
1186
  name: t,
1198
1187
  props: []
1199
1188
  });
1200
1189
  }
1201
- function Ee(t) {
1190
+ function Pe(t) {
1202
1191
  const e = new URLSearchParams(t);
1203
1192
  return {
1204
1193
  get: (n) => e.get(n),
1205
1194
  getAll: (n) => e.getAll(n)
1206
1195
  };
1207
1196
  }
1208
- const Jt = Symbol();
1209
- function Dn({
1197
+ const Qt = Symbol();
1198
+ function Wn({
1210
1199
  rejections: t
1211
1200
  }) {
1212
1201
  const e = (s) => {
1213
1202
  const c = {
1214
1203
  ...t
1215
1204
  };
1216
- return it(c[s] ?? Mn(s));
1205
+ return it(c[s] ?? qn(s));
1217
1206
  }, n = (s) => {
1218
1207
  const c = it(e(s)), u = {
1219
1208
  name: s,
@@ -1224,20 +1213,20 @@ function Dn({
1224
1213
  return {
1225
1214
  matched: u,
1226
1215
  matches: [u],
1227
- key: s,
1228
- query: Ee(""),
1216
+ name: s,
1217
+ query: Pe(""),
1229
1218
  params: {},
1230
1219
  state: {},
1231
- [Jt]: !0
1220
+ [Qt]: !0
1232
1221
  };
1233
- }, r = (s) => Jt in s, o = (s) => {
1222
+ }, r = (s) => Qt in s, o = (s) => {
1234
1223
  if (!s) {
1235
1224
  a.value = null;
1236
1225
  return;
1237
1226
  }
1238
1227
  const c = e(s);
1239
1228
  a.value = { type: s, component: c };
1240
- }, a = Ge(null);
1229
+ }, a = Ke(null);
1241
1230
  return {
1242
1231
  setRejection: o,
1243
1232
  rejection: a,
@@ -1245,95 +1234,95 @@ function Dn({
1245
1234
  isRejectionRoute: r
1246
1235
  };
1247
1236
  }
1248
- class Tn extends Error {
1237
+ class Dn extends Error {
1249
1238
  constructor(e) {
1250
1239
  super(`Route not found: "${e}"`);
1251
1240
  }
1252
1241
  }
1253
- function jt(t) {
1242
+ function Ct(t) {
1254
1243
  return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1255
1244
  }
1256
- function In(t, e) {
1245
+ function Mn(t, e) {
1257
1246
  const n = Array.from(t.matchAll(e));
1258
1247
  if (n.length === 0)
1259
1248
  return [t];
1260
1249
  let r = 0;
1261
1250
  const o = n.reduce((s, c) => {
1262
- const u = jt(t.slice(r, c.index));
1251
+ const u = Ct(t.slice(r, c.index));
1263
1252
  u.length && s.push(u);
1264
1253
  const [l] = c;
1265
1254
  return s.push(l), r = c.index + l.length, s;
1266
1255
  }, []), a = t.slice(r);
1267
1256
  return a && o.push(a), o;
1268
1257
  }
1269
- function Fn(t) {
1270
- const e = Pe(t.path.toString());
1258
+ function Tn(t) {
1259
+ const e = Se(t.path.toString());
1271
1260
  return new RegExp(`^${e}$`, "i");
1272
1261
  }
1273
- function Jn(t) {
1262
+ function In(t) {
1274
1263
  const e = new URLSearchParams(t.query.toString());
1275
- return Array.from(e.entries()).filter(([, n]) => !xt(n)).map(([n, r]) => {
1276
- const o = Pe(r);
1277
- return new RegExp(`${jt(n)}=${o}(&|$)`, "i");
1264
+ return Array.from(e.entries()).filter(([, n]) => !At(n)).map(([n, r]) => {
1265
+ const o = Se(r);
1266
+ return new RegExp(`${Ct(n)}=${o}(&|$)`, "i");
1278
1267
  });
1279
1268
  }
1280
- function Pe(t) {
1281
- return In(t, new RegExp(Qn, "g")).map((e) => e.startsWith(M) ? Se(e) : jt(e)).join("");
1282
- }
1283
1269
  function Se(t) {
1270
+ return Mn(t, new RegExp(Fn, "g")).map((e) => e.startsWith(D) ? be(e) : Ct(e)).join("");
1271
+ }
1272
+ function be(t) {
1284
1273
  return [
1285
- Kn,
1286
- Gn
1274
+ Jn,
1275
+ Qn
1287
1276
  ].reduce((e, n) => n(e), t);
1288
1277
  }
1289
- const Qn = `\\${M}\\??([\\w-_]+)\\${I}`, Ct = `\\${M}\\?([\\w-_]+)\\${I}`, be = `\\${M}([\\w-_]+)\\${I}`;
1290
- function Kn(t) {
1291
- return t.replace(new RegExp(Ct, "g"), ".*");
1278
+ const Fn = `\\${D}\\??([\\w-_]+)\\${I}`, Ot = `\\${D}\\?([\\w-_]+)\\${I}`, xe = `\\${D}([\\w-_]+)\\${I}`;
1279
+ function Jn(t) {
1280
+ return t.replace(new RegExp(Ot, "g"), ".*");
1292
1281
  }
1293
- function xt(t) {
1294
- return new RegExp(Ct, "g").test(t);
1282
+ function At(t) {
1283
+ return new RegExp(Ot, "g").test(t);
1295
1284
  }
1296
- function Gn(t) {
1297
- return t.replace(new RegExp(be, "g"), ".+");
1285
+ function Qn(t) {
1286
+ return t.replace(new RegExp(xe, "g"), ".+");
1298
1287
  }
1299
1288
  function vt(t) {
1300
- const [e] = dt(t, new RegExp(Ct, "g")), [n] = dt(t, new RegExp(be, "g"));
1289
+ const [e] = dt(t, new RegExp(Ot, "g")), [n] = dt(t, new RegExp(xe, "g"));
1301
1290
  return e ?? n;
1302
1291
  }
1303
1292
  function dt(t, e) {
1304
- return Array.from(t.matchAll(e)).flatMap(([, ...r]) => r.map((o) => yt(o) ? o : ""));
1293
+ return Array.from(t.matchAll(e)).flatMap(([, ...r]) => r.map((o) => Rt(o) ? o : ""));
1305
1294
  }
1306
- function ke(t, e, n) {
1307
- const r = Ae(e, n), [o] = dt(t, r);
1295
+ function Ae(t, e, n) {
1296
+ const r = Be(e, n), [o] = dt(t, r);
1308
1297
  return o;
1309
1298
  }
1310
- function xe(t, e) {
1299
+ function ke(t, e) {
1311
1300
  if (!e)
1312
1301
  return t;
1313
- const { name: n, param: r, value: o } = e, a = Ae(t, n);
1302
+ const { name: n, param: r, value: o } = e, a = Be(t, n);
1314
1303
  return dt(t, a).reduce((c, u) => u === void 0 ? c : c.replace(u, () => ot(o, r, n.startsWith("?"))), t);
1315
1304
  }
1316
- function Ae(t, e) {
1305
+ function Be(t, e) {
1317
1306
  const n = [
1318
- zn,
1319
- Yn,
1320
- Se
1307
+ Gn,
1308
+ Kn,
1309
+ be
1321
1310
  ].reduce((r, o) => o(r, e), t);
1322
1311
  return new RegExp(n, "g");
1323
1312
  }
1324
- function zn(t, e) {
1313
+ function Gn(t, e) {
1325
1314
  if (!e.startsWith("?"))
1326
1315
  return t;
1327
- const n = new RegExp(`\\${M}\\${e}\\${I}`, "g");
1316
+ const n = new RegExp(`\\${D}\\${e}\\${I}`, "g");
1328
1317
  return t.replace(n, "(.*)");
1329
1318
  }
1330
- function Yn(t, e) {
1319
+ function Kn(t, e) {
1331
1320
  if (e.startsWith("?"))
1332
1321
  return t;
1333
- const n = new RegExp(`\\${M}${e}\\${I}`, "g");
1322
+ const n = new RegExp(`\\${D}${e}\\${I}`, "g");
1334
1323
  return t.replace(n, "(.+)");
1335
1324
  }
1336
- function Be(t, ...e) {
1325
+ function Le(t, ...e) {
1337
1326
  return e.reduce((n, r) => {
1338
1327
  if (!r)
1339
1328
  return n;
@@ -1341,25 +1330,25 @@ function Be(t, ...e) {
1341
1330
  return Object.keys(o).length === 0 ? n : n.includes("?") ? `${n}&${o}` : `${n}?${o}`;
1342
1331
  }, t);
1343
1332
  }
1344
- function Xn(t, e = {}) {
1345
- const { params: n = {}, query: r } = e, o = Zn(t.host, n), a = tr(t.path, n), s = er(t.query, n);
1346
- return Be(`${o}${a}`, s, r);
1333
+ function zn(t, e = {}) {
1334
+ const { params: n = {}, query: r } = e, o = Yn(t.host, n), a = Xn(t.path, n), s = Zn(t.query, n);
1335
+ return Le(`${o}${a}`, s, r);
1347
1336
  }
1348
- function Zn(t, e) {
1337
+ function Yn(t, e) {
1349
1338
  const n = t.toString();
1350
1339
  return Object.entries(t.params).reduce((r, [o, a]) => {
1351
- const s = vt(`${M}${o}${I}`);
1352
- return s ? xe(r, { name: o, param: a, value: e[s] }) : r;
1340
+ const s = vt(`${D}${o}${I}`);
1341
+ return s ? ke(r, { name: o, param: a, value: e[s] }) : r;
1353
1342
  }, n);
1354
1343
  }
1355
- function tr(t, e) {
1344
+ function Xn(t, e) {
1356
1345
  const n = t.toString();
1357
1346
  return Object.entries(t.params).reduce((r, [o, a]) => {
1358
- const s = vt(`${M}${o}${I}`);
1359
- return s ? xe(r, { name: o, param: a, value: e[s] }) : r;
1347
+ const s = vt(`${D}${o}${I}`);
1348
+ return s ? ke(r, { name: o, param: a, value: e[s] }) : r;
1360
1349
  }, n);
1361
1350
  }
1362
- function er(t, e) {
1351
+ function Zn(t, e) {
1363
1352
  const n = t.toString();
1364
1353
  if (!n)
1365
1354
  return {};
@@ -1368,58 +1357,58 @@ function er(t, e) {
1368
1357
  const c = vt(s);
1369
1358
  if (!c)
1370
1359
  return { ...o, [a]: s };
1371
- const l = ot(e[c], t.params[c], xt(s)), p = e[c] === void 0 && l === "";
1372
- return xt(s) && p ? o : { ...o, [a]: l };
1360
+ const l = ot(e[c], t.params[c], At(s)), p = e[c] === void 0 && l === "";
1361
+ return At(s) && p ? o : { ...o, [a]: l };
1373
1362
  }, {});
1374
1363
  }
1375
- function nr(t) {
1364
+ function tr(t) {
1376
1365
  return (e, n, r) => {
1377
1366
  if (F(e))
1378
- return Be(e, (n ?? {}).query);
1379
- const o = n ?? {}, a = r ?? {}, s = t.find((u) => u.key === e);
1367
+ return Le(e, (n ?? {}).query);
1368
+ const o = n ?? {}, a = r ?? {}, s = t.find((u) => u.name === e);
1380
1369
  if (!s)
1381
- throw new Tn(String(e));
1382
- return Xn(s, {
1370
+ throw new Dn(String(e));
1371
+ return zn(s, {
1383
1372
  params: o,
1384
1373
  query: a.query
1385
1374
  });
1386
1375
  };
1387
1376
  }
1388
- class rr extends Error {
1377
+ class er extends Error {
1389
1378
  constructor() {
1390
1379
  super("initialUrl must be set if window.location is unavailable");
1391
1380
  }
1392
1381
  }
1393
- function or(t) {
1382
+ function nr(t) {
1394
1383
  if (t)
1395
1384
  return t;
1396
- if (we())
1385
+ if (Ee())
1397
1386
  return window.location.toString();
1398
- throw new rr();
1387
+ throw new er();
1399
1388
  }
1400
- const ar = (t, e) => {
1389
+ const rr = (t, e) => {
1401
1390
  try {
1402
- Le(t, e);
1391
+ Ne(t, e);
1403
1392
  } catch {
1404
1393
  return !1;
1405
1394
  }
1406
1395
  return !0;
1407
- }, Le = (t, e) => {
1408
- const { pathname: n, search: r } = K(e);
1396
+ }, Ne = (t, e) => {
1397
+ const { pathname: n, search: r } = G(e);
1409
1398
  return {
1410
- ...sr(t.path, n),
1411
- ...cr(t.query, r)
1399
+ ...or(t.path, n),
1400
+ ...ar(t.query, r)
1412
1401
  };
1413
1402
  };
1414
- function sr(t, e) {
1403
+ function or(t, e) {
1415
1404
  const n = {}, r = decodeURIComponent(e);
1416
1405
  for (const [o, a] of Object.entries(t.params)) {
1417
- const s = o.startsWith("?"), c = s ? o.slice(1) : o, u = ke(r, t.toString(), o), l = rt(u, a, s);
1406
+ const s = o.startsWith("?"), c = s ? o.slice(1) : o, u = Ae(r, t.toString(), o), l = rt(u, a, s);
1418
1407
  n[c] = l;
1419
1408
  }
1420
1409
  return n;
1421
1410
  }
1422
- function cr(t, e) {
1411
+ function ar(t, e) {
1423
1412
  const n = {}, r = new URLSearchParams(e);
1424
1413
  for (const [o, a] of Object.entries(t.params)) {
1425
1414
  const s = o.startsWith("?"), c = s ? o.slice(1) : o, u = r.get(c) ?? void 0, l = rt(u, a, s);
@@ -1427,22 +1416,22 @@ function cr(t, e) {
1427
1416
  }
1428
1417
  return n;
1429
1418
  }
1430
- const ur = (t) => "name" in t.matched && !!t.matched.name, ir = (t, e) => {
1431
- const { pathname: n } = K(e);
1432
- return Fn(t).test(n);
1433
- }, fr = (t, e) => {
1434
- const { search: n } = K(e);
1435
- return Jn(t).every((o) => o.test(n));
1419
+ const sr = (t) => "name" in t.matched && !!t.matched.name, cr = (t, e) => {
1420
+ const { pathname: n } = G(e);
1421
+ return Tn(t).test(n);
1422
+ }, ur = (t, e) => {
1423
+ const { search: n } = G(e);
1424
+ return In(t).every((o) => o.test(n));
1436
1425
  };
1437
- function lr(t) {
1438
- const { searchParams: e, pathname: n } = K(t), r = -1, o = 1;
1426
+ function ir(t) {
1427
+ const { searchParams: e, pathname: n } = G(t), r = -1, o = 1;
1439
1428
  return (a, s) => {
1440
- const c = Kt(a, e), u = Qt(a, n), l = Kt(s, e), p = Qt(s, n);
1429
+ const c = Kt(a, e), u = Gt(a, n), l = Kt(s, e), p = Gt(s, n);
1441
1430
  return a.depth > s.depth ? r : a.depth < s.depth ? o : c + u > l + p ? r : c + u < l + p ? o : 0;
1442
1431
  };
1443
1432
  }
1444
- function Qt(t, e) {
1445
- const n = Object.keys(t.path.params).filter((o) => o.startsWith("?")).map((o) => o), r = n.filter((o) => ke(e, t.path.toString(), o) === void 0);
1433
+ function Gt(t, e) {
1434
+ const n = Object.keys(t.path.params).filter((o) => o.startsWith("?")).map((o) => o), r = n.filter((o) => Ae(e, t.path.toString(), o) === void 0);
1446
1435
  return n.length - r.length;
1447
1436
  }
1448
1437
  function Kt(t, e) {
@@ -1453,7 +1442,7 @@ function Ue(t) {
1453
1442
  return !!t && typeof t == "object";
1454
1443
  }
1455
1444
  const mt = !0;
1456
- function hr(t, e, n) {
1445
+ function fr(t, e, n) {
1457
1446
  if (Ue(t) && e in t) {
1458
1447
  const r = t[e];
1459
1448
  if (typeof r == "string")
@@ -1461,125 +1450,139 @@ function hr(t, e, n) {
1461
1450
  }
1462
1451
  return rt(void 0, n, mt);
1463
1452
  }
1464
- function pr(t, e) {
1453
+ function lr(t, e) {
1465
1454
  const n = {};
1466
1455
  for (const [r, o] of Object.entries(t)) {
1467
- const a = hr(e, r, o);
1456
+ const a = fr(e, r, o);
1468
1457
  n[r] = a;
1469
1458
  }
1470
1459
  return n;
1471
1460
  }
1472
- function dr(t, e, n) {
1461
+ function hr(t, e, n) {
1473
1462
  if (Ue(t) && e in t) {
1474
1463
  const r = t[e];
1475
1464
  return ot(r, n, mt);
1476
1465
  }
1477
1466
  return ot(void 0, n, mt);
1478
1467
  }
1479
- const Gt = (t, e) => {
1468
+ const zt = (t, e) => {
1480
1469
  const n = {};
1481
1470
  for (const [r, o] of Object.entries(t)) {
1482
- const a = dr(e, r, o);
1471
+ const a = hr(e, r, o);
1483
1472
  n[r] = a;
1484
1473
  }
1485
1474
  return n;
1486
- }, mr = [
1475
+ }, pr = [
1476
+ sr,
1477
+ cr,
1487
1478
  ur,
1488
- ir,
1489
- fr,
1490
- ar
1479
+ rr
1491
1480
  ];
1492
- function kt(t, e, n) {
1493
- const r = lr(e), o = t.filter((c) => mr.every((u) => u(c, e))).sort(r);
1481
+ function xt(t, e, n) {
1482
+ const r = ir(e), o = t.filter((c) => pr.every((u) => u(c, e))).sort(r);
1494
1483
  if (o.length === 0)
1495
1484
  return;
1496
- const [a] = o, { search: s } = K(e);
1485
+ const [a] = o, { search: s } = G(e);
1497
1486
  return {
1498
1487
  matched: a.matched,
1499
1488
  matches: a.matches,
1500
- key: a.key,
1501
- query: Ee(s),
1502
- params: Le(a, e),
1503
- state: pr(a.state, n)
1489
+ name: a.name,
1490
+ query: Pe(s),
1491
+ params: Ne(a, e),
1492
+ state: lr(a.state, n)
1504
1493
  };
1505
1494
  }
1506
- function Ot(t, e) {
1507
- const n = new RegExp(`\\${M}(\\??[\\w-_]+)\\${I}`, "g");
1495
+ function _t(t, e) {
1496
+ const n = new RegExp(`\\${D}(\\??[\\w-_]+)\\${I}`, "g");
1508
1497
  return Array.from(t.matchAll(n)).reduce((o, [a, s]) => {
1509
1498
  const c = vt(a);
1510
1499
  if (!c)
1511
1500
  return o;
1512
- const u = Un(e, c);
1501
+ const u = Bn(e, c);
1513
1502
  return tt([c], o), o[s] = u, o;
1514
1503
  }, {});
1515
1504
  }
1516
1505
  function $e(t, e) {
1517
1506
  return {
1518
1507
  host: t,
1519
- params: Ot(t, e),
1508
+ params: _t(t, e),
1520
1509
  toString: () => t
1521
1510
  };
1522
1511
  }
1523
- function Ne(t) {
1524
- return t === void 0 ? "" : t;
1525
- }
1526
- function zt(t, e) {
1512
+ function Yt(t, e) {
1527
1513
  return {
1528
1514
  path: t,
1529
- params: Ot(t, e),
1515
+ params: _t(t, e),
1530
1516
  toString: () => t
1531
1517
  };
1532
1518
  }
1533
- function gr(t) {
1534
- return Vt(t) && typeof t.path == "string";
1519
+ function dr(t) {
1520
+ return jt(t) && typeof t.path == "string";
1535
1521
  }
1536
1522
  function He(t) {
1537
- return t === void 0 ? zt("", {}) : gr(t) ? t : zt(t, {});
1523
+ return t === void 0 ? Yt("", {}) : dr(t) ? t : Yt(t, {});
1538
1524
  }
1539
- function Yt(t, e) {
1525
+ function Xt(t, e) {
1540
1526
  return {
1541
1527
  query: t,
1542
- params: Ot(t, e),
1528
+ params: _t(t, e),
1543
1529
  toString: () => t
1544
1530
  };
1545
1531
  }
1546
- function yr(t) {
1547
- return Vt(t) && typeof t.query == "string";
1532
+ function mr(t) {
1533
+ return jt(t) && typeof t.query == "string";
1548
1534
  }
1549
1535
  function Ve(t) {
1550
- return t === void 0 ? Yt("", {}) : yr(t) ? t : Yt(t, {});
1536
+ return t === void 0 ? Xt("", {}) : mr(t) ? t : Xt(t, {});
1551
1537
  }
1552
- function Xt(t) {
1553
- const e = Ne(t.name), n = He(t.path), r = Ve(t.query), o = t.meta ?? {}, a = kn(t) ? t.state : {}, s = it({ meta: {}, state: {}, ...t }), c = {
1538
+ function Zt(t) {
1539
+ const e = Lt(t.name), n = He(t.path), r = Ve(t.query), o = t.meta ?? {}, a = Sn(t) ? t.state : {}, s = it({ meta: {}, state: {}, ...t }), c = {
1554
1540
  matched: s,
1555
1541
  matches: [s],
1556
- key: e,
1542
+ name: e,
1557
1543
  path: n,
1558
1544
  query: r,
1559
1545
  meta: o,
1560
1546
  state: a,
1561
1547
  depth: 1,
1562
1548
  host: $e("", {})
1563
- }, u = pe(t) ? de(t.parent, c) : c;
1549
+ }, u = de(t) ? me(t.parent, c) : c;
1564
1550
  return tt(u.path.params, u.query.params), u;
1565
1551
  }
1566
- function Rr(t, e) {
1567
- if (!yt(e))
1552
+ function gr(t, e) {
1553
+ if (!Rt(e))
1568
1554
  return t;
1569
- const n = Xt({ path: e });
1570
- return t.map((r) => Xt({
1555
+ const n = Zt({ path: e });
1556
+ return t.map((r) => Zt({
1571
1557
  parent: n,
1572
1558
  ...r
1573
1559
  }));
1574
1560
  }
1561
+ class Rr extends Error {
1562
+ /**
1563
+ * Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
1564
+ * @param name - The name of the name that was duplicated.
1565
+ */
1566
+ constructor(e) {
1567
+ super(`Invalid Name "${e}": Router does not support multiple routes with the same name. All name names must be unique.`);
1568
+ }
1569
+ }
1570
+ function yr(t) {
1571
+ const e = t.map(({ name: n }) => n);
1572
+ for (const n of e)
1573
+ if (fe(e, n) > 1)
1574
+ throw new Rr(n);
1575
+ }
1575
1576
  function Br(t, e = {}) {
1576
- const n = En(t) ? t.flat() : t, r = Rr(n, e.base), o = nr(r), a = qn({
1577
+ const n = vn(t) ? t.flat() : t, r = gr(n, e.base);
1578
+ yr(r);
1579
+ const o = tr(r), a = On({
1577
1580
  mode: e.historyMode,
1578
- listener: ({ location: R }) => {
1579
- const A = Q(R);
1580
- k(A, { state: R.state });
1581
+ listener: ({ location: y }) => {
1582
+ const k = Q(y);
1583
+ x(k, { state: y.state });
1581
1584
  }
1582
- }), { runBeforeRouteHooks: s, runAfterRouteHooks: c } = cn(), {
1585
+ }), { runBeforeRouteHooks: s, runAfterRouteHooks: c } = sn(), {
1583
1586
  hooks: u,
1584
1587
  onBeforeRouteEnter: l,
1585
1588
  onAfterRouteUpdate: p,
@@ -1587,77 +1590,77 @@ function Br(t, e = {}) {
1587
1590
  onAfterRouteEnter: E,
1588
1591
  onBeforeRouteUpdate: d,
1589
1592
  onAfterRouteLeave: b
1590
- } = fn();
1591
- async function k(R, A = {}) {
1592
- if (a.stopListening(), L(R))
1593
- return a.update(R, A);
1594
- const _ = kt(r, R, A.state) ?? S("NotFound"), q = { ...i }, G = await s({ to: _, from: q, hooks: u });
1595
- switch (G.status) {
1593
+ } = un();
1594
+ async function x(y, k = {}) {
1595
+ if (a.stopListening(), L(y))
1596
+ return a.update(y, k);
1597
+ const _ = xt(r, y, k.state) ?? S("NotFound"), q = { ...i }, K = await s({ to: _, from: q, hooks: u });
1598
+ switch (K.status) {
1596
1599
  case "ABORT":
1597
1600
  return;
1598
1601
  case "PUSH":
1599
- a.update(R, A), await $(...G.to);
1602
+ a.update(y, k), await U(...K.to);
1600
1603
  return;
1601
1604
  case "REJECT":
1602
- a.update(R, A), y(G.type), v(_);
1605
+ a.update(y, k), R(K.type), v(_);
1603
1606
  break;
1604
1607
  case "SUCCESS":
1605
- a.update(R, A), y(null), v(_);
1608
+ a.update(y, k), R(null), v(_);
1606
1609
  break;
1607
1610
  default:
1608
- throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(G)}`);
1611
+ throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(K)}`);
1609
1612
  }
1610
- const D = await c({ to: _, from: q, hooks: u });
1611
- switch (D.status) {
1613
+ const M = await c({ to: _, from: q, hooks: u });
1614
+ switch (M.status) {
1612
1615
  case "PUSH":
1613
- await $(...D.to);
1616
+ await U(...M.to);
1614
1617
  break;
1615
1618
  case "REJECT":
1616
- y(D.type);
1619
+ R(M.type);
1617
1620
  break;
1618
1621
  case "SUCCESS":
1619
1622
  break;
1620
1623
  default:
1621
- const W = D;
1624
+ const W = M;
1622
1625
  throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(W)}`);
1623
1626
  }
1624
1627
  a.startListening();
1625
1628
  }
1626
- const $ = (R, A, _) => {
1627
- if (F(R)) {
1628
- const et = { ...A }, Pt = o(R, et);
1629
- return k(Pt, et);
1629
+ const U = (y, k, _) => {
1630
+ if (F(y)) {
1631
+ const et = { ...k }, Pt = o(y, et);
1632
+ return x(Pt, et);
1630
1633
  }
1631
- const q = { ..._ }, D = o(R, A ?? {}, q), W = wt(R), Et = Gt((W == null ? void 0 : W.state) ?? {}, q.state);
1632
- return k(D, { ...q, state: Et });
1633
- }, N = (R, A, _) => {
1634
- if (F(R)) {
1635
- const et = { ...A, replace: !0 }, Pt = o(R, et);
1636
- return k(Pt, et);
1634
+ const q = { ..._ }, M = o(y, k ?? {}, q), W = wt(y), Et = zt((W == null ? void 0 : W.state) ?? {}, q.state);
1635
+ return x(M, { ...q, state: Et });
1636
+ }, $ = (y, k, _) => {
1637
+ if (F(y)) {
1638
+ const et = { ...k, replace: !0 }, Pt = o(y, et);
1639
+ return x(Pt, et);
1637
1640
  }
1638
- const q = { ..._, replace: !0 }, D = o(R, A ?? {}, q), W = wt(R), Et = Gt((W == null ? void 0 : W.state) ?? {}, q.state);
1639
- return k(D, { ...q, state: Et });
1640
- }, O = (R) => y(R), g = (R, A = {}) => {
1641
- if (!F(R)) {
1642
- const _ = o(R, A);
1643
- return kt(r, _);
1641
+ const q = { ..._, replace: !0 }, M = o(y, k ?? {}, q), W = wt(y), Et = zt((W == null ? void 0 : W.state) ?? {}, q.state);
1642
+ return x(M, { ...q, state: Et });
1643
+ }, O = (y) => R(y), g = (y, k = {}) => {
1644
+ if (!F(y)) {
1645
+ const _ = o(y, k);
1646
+ return xt(r, _);
1644
1647
  }
1645
- if (!L(R))
1646
- return kt(r, R);
1647
- }, { setRejection: y, rejection: P, getRejectionRoute: S } = Dn(e), m = S("NotFound"), { currentRoute: i, routerRoute: h, updateRoute: v } = jn(m, $);
1648
+ if (!L(y))
1649
+ return xt(r, y);
1650
+ }, { setRejection: R, rejection: P, getRejectionRoute: S } = Wn(e), m = S("NotFound"), { currentRoute: i, routerRoute: h, updateRoute: v } = Hn(m, U);
1648
1651
  a.startListening();
1649
- const w = or(e.initialUrl), x = a.location.state, { host: B } = K(w), L = _n(B), j = k(w, { replace: !0, state: x });
1650
- function wt(R) {
1651
- return r.find((A) => A.key === R);
1652
+ const w = nr(e.initialUrl), A = a.location.state, { host: B } = G(w), L = Cn(B), j = x(w, { replace: !0, state: A });
1653
+ function wt(y) {
1654
+ return r.find((k) => k.name === y);
1652
1655
  }
1653
- function je(R) {
1654
- R.component("RouterView", xn), R.component("RouterLink", hn), R.provide(se, P), R.provide(fe, u), R.provide(ae, _t);
1656
+ function je(y) {
1657
+ y.component("RouterView", bn), y.component("RouterLink", ln), y.provide(ce, P), y.provide(le, u), y.provide(se, qt);
1655
1658
  }
1656
- const _t = {
1659
+ const qt = {
1657
1660
  route: h,
1658
1661
  resolve: o,
1659
- push: $,
1660
- replace: N,
1662
+ push: U,
1663
+ replace: $,
1661
1664
  reject: O,
1662
1665
  find: g,
1663
1666
  refresh: a.refresh,
@@ -1674,53 +1677,53 @@ function Br(t, e = {}) {
1674
1677
  onBeforeRouteUpdate: d,
1675
1678
  onAfterRouteLeave: b
1676
1679
  };
1677
- return _t;
1680
+ return qt;
1678
1681
  }
1679
1682
  function vr(t) {
1680
- return Vt(t) && typeof t.host == "string";
1683
+ return jt(t) && typeof t.host == "string";
1681
1684
  }
1682
- function Zt(t) {
1685
+ function te(t) {
1683
1686
  return vr(t) ? t : $e(t, {});
1684
1687
  }
1685
1688
  function Lr(t) {
1686
- const e = Ne(t.name), n = He(t.path), r = Ve(t.query), o = t.meta ?? {}, a = bn(t) ? Zt(t.host) : Zt(""), s = it({ meta: {}, state: {}, ...t }), c = {
1689
+ const e = Lt(t.name), n = He(t.path), r = Ve(t.query), o = t.meta ?? {}, a = Pn(t) ? te(t.host) : te(""), s = it({ meta: {}, state: {}, ...t }), c = {
1687
1690
  matched: s,
1688
1691
  matches: [s],
1689
- key: e,
1692
+ name: e,
1690
1693
  host: a,
1691
1694
  path: n,
1692
1695
  query: r,
1693
1696
  meta: o,
1694
1697
  depth: 1,
1695
1698
  state: {}
1696
- }, u = pe(t) ? de(t.parent, c) : c;
1699
+ }, u = de(t) ? me(t.parent, c) : c;
1697
1700
  return tt(u.path.params, u.query.params, u.host.params), u;
1698
1701
  }
1699
1702
  export {
1700
1703
  ze as DuplicateParamsError,
1701
- hn as RouterLink,
1702
- At as RouterNotInstalledError,
1703
- xn as RouterView,
1704
+ ln as RouterLink,
1705
+ kt as RouterNotInstalledError,
1706
+ bn as RouterView,
1704
1707
  Ye as UseRouteInvalidError,
1705
- pn as component,
1708
+ hn as component,
1706
1709
  Lr as createExternalRoute,
1707
1710
  Nn as createParam,
1708
- Xt as createRoute,
1711
+ Zt as createRoute,
1709
1712
  Br as createRouter,
1710
- Ln as isParamWithDefault,
1713
+ kn as isParamWithDefault,
1711
1714
  nn as isRoute,
1712
1715
  br as onAfterRouteEnter,
1713
- kr as onAfterRouteLeave,
1714
- xr as onAfterRouteUpdate,
1716
+ xr as onAfterRouteLeave,
1717
+ Ar as onAfterRouteUpdate,
1715
1718
  Pr as onBeforeRouteLeave,
1716
1719
  Sr as onBeforeRouteUpdate,
1717
- zt as path,
1718
- Yt as query,
1719
- ae as routerInjectionKey,
1720
- se as routerRejectionKey,
1720
+ Yt as path,
1721
+ Xt as query,
1722
+ se as routerInjectionKey,
1723
+ ce as routerRejectionKey,
1721
1724
  Xe as useLink,
1722
1725
  Ze as useRejection,
1723
- on as useRoute,
1726
+ rn as useRoute,
1724
1727
  Bt as useRouter,
1725
- Ar as withDefault
1728
+ kr as withDefault
1726
1729
  };