@kitbag/router 0.12.0 → 0.13.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,43 +1,43 @@
1
- var rn = Object.defineProperty;
2
- var on = (e, t, n) => t in e ? rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var _ = (e, t, n) => on(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { defineComponent as ie, h as ge, ref as lt, inject as fe, toRefs as an, computed as N, reactive as $e, markRaw as ve, defineAsyncComponent as sn, watch as ht, toValue as me, toRef as cn, onUnmounted as pt, openBlock as dt, createElementBlock as un, normalizeClass as fn, renderSlot as mt, normalizeProps as gt, guardReactiveProps as ln, unref as ae, resolveComponent as hn, provide as pn, mergeProps as dn, createBlock as mn, resolveDynamicComponent as gn, createCommentVNode as vn } from "vue";
5
- class Ae extends Error {
1
+ var sn = Object.defineProperty;
2
+ var cn = (e, t, n) => t in e ? sn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var _ = (e, t, n) => cn(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { defineComponent as le, h as ve, ref as qe, inject as re, toRefs as un, computed as N, reactive as Ue, markRaw as ye, defineAsyncComponent as fn, onMounted as ln, onBeforeUnmount as hn, watch as je, toValue as se, toRef as pn, onUnmounted as gt, openBlock as vt, createElementBlock as dn, normalizeClass as mn, renderSlot as yt, normalizeProps as Rt, guardReactiveProps as gn, unref as ce, resolveComponent as vn, provide as yn, mergeProps as Rn, createBlock as wn, resolveDynamicComponent as Pn, createCommentVNode as En } from "vue";
5
+ class he extends Error {
6
6
  constructor() {
7
7
  super("Router not installed");
8
8
  }
9
9
  }
10
- function le(e) {
10
+ function pe(e) {
11
11
  return typeof e == "object" && e !== null && !Array.isArray(e);
12
12
  }
13
- function yn(e) {
13
+ function bn(e) {
14
14
  return e.every((t) => Array.isArray(t));
15
15
  }
16
- function he(e) {
16
+ function de(e) {
17
17
  return typeof e == "string" && e.length > 0;
18
18
  }
19
- function ye(e) {
19
+ function Re(e) {
20
20
  return {
21
- value: he(e) ? e.replace(/^#*/, "") : void 0
21
+ value: de(e) ? e.replace(/^#*/, "") : void 0
22
22
  };
23
23
  }
24
- function Rn(e, t) {
25
- return ye(`${e.value ?? ""}${t.value ?? ""}`);
24
+ function Sn(e, t) {
25
+ return Re(`${e.value ?? ""}${t.value ?? ""}`);
26
26
  }
27
- class wn extends Error {
27
+ class kn extends Error {
28
28
  constructor(t) {
29
29
  super(`Child property on meta for ${t} conflicts with the parent meta.`);
30
30
  }
31
31
  }
32
- function Pn(e, t) {
33
- return En(e, t), { ...e, ...t };
32
+ function An(e, t) {
33
+ return xn(e, t), { ...e, ...t };
34
34
  }
35
- function En(e, t) {
35
+ function xn(e, t) {
36
36
  const n = Object.keys(e).find((r) => r in t && typeof t[r] != typeof e[r]);
37
37
  if (n)
38
- throw new wn(n);
38
+ throw new kn(n);
39
39
  }
40
- class bn extends Error {
40
+ class Un extends Error {
41
41
  /**
42
42
  * Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
43
43
  * @param paramName - The name of the parameter that was duplicated.
@@ -49,120 +49,120 @@ class bn extends Error {
49
49
  function Y(e) {
50
50
  return Array.isArray(e) ? e : [e];
51
51
  }
52
- function vt(e, t) {
52
+ function wt(e, t) {
53
53
  return e.filter((n) => t === n).length;
54
54
  }
55
- function re(...e) {
56
- const t = e.flatMap((n) => Array.isArray(n) ? n : Object.keys(n).map(Sn));
55
+ function oe(...e) {
56
+ const t = e.flatMap((n) => Array.isArray(n) ? n : Object.keys(n).map(Bn));
57
57
  for (const n of t)
58
- if (vt(t, n) > 1)
59
- throw new bn(n);
58
+ if (wt(t, n) > 1)
59
+ throw new Un(n);
60
60
  }
61
- function Sn(e) {
61
+ function Bn(e) {
62
62
  return e.startsWith("?") ? e.slice(1) : e;
63
63
  }
64
- function xn(e, t) {
65
- return re(e.params, t.params), {
64
+ function Ln(e, t) {
65
+ return oe(e.params, t.params), {
66
66
  value: `${e.value}${t.value}`,
67
67
  params: { ...e.params, ...t.params }
68
68
  };
69
69
  }
70
- function kn(e, t) {
71
- return re(e.params, t.params), {
72
- value: [e.value, t.value].filter(he).join("&"),
70
+ function Cn(e, t) {
71
+ return oe(e.params, t.params), {
72
+ value: [e.value, t.value].filter(de).join("&"),
73
73
  params: { ...e.params, ...t.params }
74
74
  };
75
75
  }
76
- function An(e, t) {
77
- return re(e, t), { ...e, ...t };
76
+ function Nn(e, t) {
77
+ return oe(e, t), { ...e, ...t };
78
78
  }
79
- function Un(e) {
79
+ function Hn(e) {
80
80
  return "host" in e && !!e.host;
81
81
  }
82
- function yt(e) {
82
+ function Pt(e) {
83
83
  return "parent" in e && !!e.parent;
84
84
  }
85
- function Ve(e) {
85
+ function _e(e) {
86
86
  return "component" in e && !!e.component;
87
87
  }
88
- function qe(e) {
88
+ function Me(e) {
89
89
  return "components" in e && !!e.components;
90
90
  }
91
- function Cn(e) {
91
+ function jn(e) {
92
92
  return "state" in e && !!e.state;
93
93
  }
94
- function Rt(e, t) {
94
+ function Et(e, t) {
95
95
  return {
96
96
  ...t,
97
- path: xn(e.path, t.path),
98
- query: kn(e.query, t.query),
99
- meta: Pn(e.meta, t.meta),
100
- state: An(e.state, t.state),
101
- hash: Rn(e.hash, t.hash),
97
+ path: Ln(e.path, t.path),
98
+ query: Cn(e.query, t.query),
99
+ meta: An(e.meta, t.meta),
100
+ state: Nn(e.state, t.state),
101
+ hash: Sn(e.hash, t.hash),
102
102
  matches: [...e.matches, t.matched],
103
103
  host: e.host,
104
104
  depth: e.depth + 1
105
105
  };
106
106
  }
107
- function wt() {
107
+ function Te() {
108
108
  return typeof window < "u" && typeof window.document < "u";
109
109
  }
110
- function Pt(e) {
110
+ function bt(e) {
111
111
  return typeof e == "object" && e !== null && "then" in e;
112
112
  }
113
- function Ln(e, t) {
114
- return ie({
113
+ function Vn(e, t) {
114
+ return le({
115
115
  name: "PropsWrapper",
116
116
  expose: [],
117
117
  setup() {
118
118
  const n = t();
119
- return () => n instanceof Error ? "" : Pt(n) ? ge(Bn(e, n)) : ge(e, n);
119
+ return () => n instanceof Error ? "" : bt(n) ? ve($n(e, n)) : ve(e, n);
120
120
  }
121
121
  });
122
122
  }
123
- function Bn(e, t) {
124
- return ie({
123
+ function $n(e, t) {
124
+ return le({
125
125
  name: "AsyncPropsWrapper",
126
126
  expose: [],
127
127
  setup() {
128
- const n = lt();
129
- return (async () => n.value = await t)(), () => n.value instanceof Error ? "" : n.value ? ge(e, n.value) : "";
128
+ const n = qe();
129
+ return (async () => n.value = await t)(), () => n.value instanceof Error ? "" : n.value ? ve(e, n.value) : "";
130
130
  }
131
131
  });
132
132
  }
133
133
  class Z extends Error {
134
134
  }
135
- const I = "[", G = "]";
136
- function Nn(e) {
135
+ const W = "[", G = "]";
136
+ function On(e) {
137
137
  return e !== String && e !== Boolean && e !== Number && e !== Date;
138
138
  }
139
- function Hn(e) {
140
- return typeof e == "function" && Nn(e);
139
+ function qn(e) {
140
+ return typeof e == "function" && On(e);
141
141
  }
142
- function Ue(e) {
142
+ function Be(e) {
143
143
  return typeof e == "object" && "get" in e && typeof e.get == "function" && "set" in e && typeof e.set == "function";
144
144
  }
145
- function jn(e) {
146
- return Ue(e) && e.defaultValue !== void 0;
145
+ function _n(e) {
146
+ return Be(e) && e.defaultValue !== void 0;
147
147
  }
148
- function eo(e, t) {
149
- return qn(e, t);
148
+ function uo(e, t) {
149
+ return Dn(e, t);
150
150
  }
151
- function $n(e, t) {
151
+ function Mn(e, t) {
152
152
  return e[t] ?? String;
153
153
  }
154
- const q = {
154
+ const O = {
155
155
  invalid: (e) => {
156
156
  throw new Z(e);
157
157
  }
158
- }, Vn = {
158
+ }, Tn = {
159
159
  get: (e) => e,
160
160
  set: (e, { invalid: t }) => {
161
161
  if (typeof e != "string")
162
162
  throw t();
163
163
  return e;
164
164
  }
165
- }, Et = {
165
+ }, St = {
166
166
  get: (e, { invalid: t }) => {
167
167
  if (e === "true")
168
168
  return !0;
@@ -175,7 +175,7 @@ const q = {
175
175
  throw t();
176
176
  return e.toString();
177
177
  }
178
- }, bt = {
178
+ }, kt = {
179
179
  get: (e, { invalid: t }) => {
180
180
  const n = Number(e);
181
181
  if (isNaN(n))
@@ -187,7 +187,7 @@ const q = {
187
187
  throw t();
188
188
  return e.toString();
189
189
  }
190
- }, St = {
190
+ }, At = {
191
191
  get: (e, { invalid: t }) => {
192
192
  const n = new Date(e);
193
193
  if (isNaN(n.getTime()))
@@ -215,28 +215,28 @@ const q = {
215
215
  }
216
216
  }
217
217
  };
218
- function se(e, t, n = !1) {
219
- if (e === void 0 || !he(e)) {
220
- if (jn(t))
218
+ function ue(e, t, n = !1) {
219
+ if (e === void 0 || !de(e)) {
220
+ if (_n(t))
221
221
  return t.defaultValue;
222
222
  if (n)
223
223
  return;
224
224
  throw new Z();
225
225
  }
226
226
  if (t === String)
227
- return Vn.get(e, q);
227
+ return Tn.get(e, O);
228
228
  if (t === Boolean)
229
- return Et.get(e, q);
229
+ return St.get(e, O);
230
230
  if (t === Number)
231
- return bt.get(e, q);
231
+ return kt.get(e, O);
232
232
  if (t === Date)
233
- return St.get(e, q);
233
+ return At.get(e, O);
234
234
  if (t === JSON)
235
- return xt.get(e, q);
236
- if (Hn(t))
237
- return t(e, q);
238
- if (Ue(t))
239
- return t.get(e, q);
235
+ return xt.get(e, O);
236
+ if (qn(t))
237
+ return t(e, O);
238
+ if (Be(t))
239
+ return t.get(e, O);
240
240
  if (t instanceof RegExp) {
241
241
  if (t.test(e))
242
242
  return e;
@@ -244,32 +244,32 @@ function se(e, t, n = !1) {
244
244
  }
245
245
  return e;
246
246
  }
247
- function ce(e, t, n = !1) {
247
+ function ie(e, t, n = !1) {
248
248
  if (e === void 0) {
249
249
  if (n)
250
250
  return "";
251
251
  throw new Z();
252
252
  }
253
253
  if (t === Boolean)
254
- return Et.set(e, q);
254
+ return St.set(e, O);
255
255
  if (t === Number)
256
- return bt.set(e, q);
256
+ return kt.set(e, O);
257
257
  if (t === Date)
258
- return St.set(e, q);
258
+ return At.set(e, O);
259
259
  if (t === JSON)
260
- return xt.set(e, q);
261
- if (Ue(t))
262
- return t.set(e, q);
260
+ return xt.set(e, O);
261
+ if (Be(t))
262
+ return t.set(e, O);
263
263
  try {
264
264
  return e.toString();
265
265
  } catch {
266
266
  throw new Z();
267
267
  }
268
268
  }
269
- function qn(e, t) {
270
- return Ue(e) ? { ...e, defaultValue: t ?? e.defaultValue } : {
271
- get: (n) => se(n, e),
272
- set: (n) => ce(n, e),
269
+ function Dn(e, t) {
270
+ return Be(e) ? { ...e, defaultValue: t ?? e.defaultValue } : {
271
+ get: (n) => ue(n, e),
272
+ set: (n) => ie(n, e),
273
273
  defaultValue: t
274
274
  };
275
275
  }
@@ -301,36 +301,36 @@ function K(e, t) {
301
301
  }
302
302
  }
303
303
  }
304
- var Re = "beforeunload", On = "hashchange", kt = "popstate";
305
- function et(e) {
304
+ var we = "beforeunload", Wn = "hashchange", Ut = "popstate";
305
+ function at(e) {
306
306
  e === void 0 && (e = {});
307
307
  var t = e, n = t.window, r = n === void 0 ? document.defaultView : n, o = r.history;
308
308
  function a() {
309
- var m = r.location, l = m.pathname, d = m.search, b = m.hash, S = o.state || {};
310
- return [S.idx, ee({
309
+ var m = r.location, l = m.pathname, d = m.search, E = m.hash, b = o.state || {};
310
+ return [b.idx, ee({
311
311
  pathname: l,
312
312
  search: d,
313
- hash: b,
314
- state: S.usr || null,
315
- key: S.key || "default"
313
+ hash: E,
314
+ state: b.usr || null,
315
+ key: b.key || "default"
316
316
  })];
317
317
  }
318
318
  var s = null;
319
- function u() {
319
+ function c() {
320
320
  if (s)
321
321
  p.call(s), s = null;
322
322
  else {
323
- var m = H.Pop, l = a(), d = l[0], b = l[1];
323
+ var m = H.Pop, l = a(), d = l[0], E = l[1];
324
324
  if (p.length)
325
325
  if (d != null) {
326
- var S = f - d;
327
- S && (s = {
326
+ var b = f - d;
327
+ b && (s = {
328
328
  action: m,
329
- location: b,
329
+ location: E,
330
330
  retry: function() {
331
- A(S * -1);
331
+ A(b * -1);
332
332
  }
333
- }, A(S));
333
+ }, A(b));
334
334
  } else
335
335
  process.env.NODE_ENV !== "production" && K(
336
336
  !1,
@@ -340,25 +340,25 @@ function et(e) {
340
340
  "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."
341
341
  );
342
342
  else
343
- L(m);
343
+ B(m);
344
344
  }
345
345
  }
346
- r.addEventListener(kt, u);
347
- var i = H.Pop, c = a(), f = c[0], h = c[1], P = te(), p = te();
346
+ r.addEventListener(Ut, c);
347
+ var i = H.Pop, u = a(), f = u[0], h = u[1], v = te(), p = te();
348
348
  f == null && (f = 0, o.replaceState(Q({}, o.state, {
349
349
  idx: f
350
350
  }), ""));
351
351
  function k(m) {
352
352
  return typeof m == "string" ? m : z(m);
353
353
  }
354
- function g(m, l) {
354
+ function R(m, l) {
355
355
  return l === void 0 && (l = null), ee(Q({
356
356
  pathname: h.pathname,
357
357
  hash: "",
358
358
  search: ""
359
- }, typeof m == "string" ? ue(m) : m, {
359
+ }, typeof m == "string" ? fe(m) : m, {
360
360
  state: l,
361
- key: Pe()
361
+ key: Ee()
362
362
  }));
363
363
  }
364
364
  function y(m, l) {
@@ -368,44 +368,44 @@ function et(e) {
368
368
  idx: l
369
369
  }, k(m)];
370
370
  }
371
- function E(m, l, d) {
371
+ function S(m, l, d) {
372
372
  return !p.length || (p.call({
373
373
  action: m,
374
374
  location: l,
375
375
  retry: d
376
376
  }), !1);
377
377
  }
378
- function L(m) {
378
+ function B(m) {
379
379
  i = m;
380
380
  var l = a();
381
- f = l[0], h = l[1], P.call({
381
+ f = l[0], h = l[1], v.call({
382
382
  action: i,
383
383
  location: h
384
384
  });
385
385
  }
386
- function v(m, l) {
387
- var d = H.Push, b = g(m, l);
388
- function S() {
389
- v(m, l);
386
+ function g(m, l) {
387
+ var d = H.Push, E = R(m, l);
388
+ function b() {
389
+ g(m, l);
390
390
  }
391
- if (E(d, b, S)) {
392
- var U = y(b, f + 1), B = U[0], j = U[1];
391
+ if (S(d, E, b)) {
392
+ var U = y(E, f + 1), C = U[0], j = U[1];
393
393
  try {
394
- o.pushState(B, "", j);
394
+ o.pushState(C, "", j);
395
395
  } catch {
396
396
  r.location.assign(j);
397
397
  }
398
- L(d);
398
+ B(d);
399
399
  }
400
400
  }
401
- function w(m, l) {
402
- var d = H.Replace, b = g(m, l);
403
- function S() {
404
- w(m, l);
401
+ function P(m, l) {
402
+ var d = H.Replace, E = R(m, l);
403
+ function b() {
404
+ P(m, l);
405
405
  }
406
- if (E(d, b, S)) {
407
- var U = y(b, f), B = U[0], j = U[1];
408
- o.replaceState(B, "", j), L(d);
406
+ if (S(d, E, b)) {
407
+ var U = y(E, f), C = U[0], j = U[1];
408
+ o.replaceState(C, "", j), B(d);
409
409
  }
410
410
  }
411
411
  function A(m) {
@@ -419,8 +419,8 @@ function et(e) {
419
419
  return h;
420
420
  },
421
421
  createHref: k,
422
- push: v,
423
- replace: w,
422
+ push: g,
423
+ replace: P,
424
424
  go: A,
425
425
  back: function() {
426
426
  A(-1);
@@ -429,42 +429,42 @@ function et(e) {
429
429
  A(1);
430
430
  },
431
431
  listen: function(l) {
432
- return P.push(l);
432
+ return v.push(l);
433
433
  },
434
434
  block: function(l) {
435
435
  var d = p.push(l);
436
- return p.length === 1 && r.addEventListener(Re, we), function() {
437
- d(), p.length || r.removeEventListener(Re, we);
436
+ return p.length === 1 && r.addEventListener(we, Pe), function() {
437
+ d(), p.length || r.removeEventListener(we, Pe);
438
438
  };
439
439
  }
440
440
  };
441
441
  return x;
442
442
  }
443
- function _n(e) {
443
+ function In(e) {
444
444
  e === void 0 && (e = {});
445
445
  var t = e, n = t.window, r = n === void 0 ? document.defaultView : n, o = r.history;
446
446
  function a() {
447
- var l = ue(r.location.hash.substr(1)), d = l.pathname, b = d === void 0 ? "/" : d, S = l.search, U = S === void 0 ? "" : S, B = l.hash, j = B === void 0 ? "" : B, O = o.state || {};
448
- return [O.idx, ee({
449
- pathname: b,
447
+ var l = fe(r.location.hash.substr(1)), d = l.pathname, E = d === void 0 ? "/" : d, b = l.search, U = b === void 0 ? "" : b, C = l.hash, j = C === void 0 ? "" : C, q = o.state || {};
448
+ return [q.idx, ee({
449
+ pathname: E,
450
450
  search: U,
451
451
  hash: j,
452
- state: O.usr || null,
453
- key: O.key || "default"
452
+ state: q.usr || null,
453
+ key: q.key || "default"
454
454
  })];
455
455
  }
456
456
  var s = null;
457
- function u() {
457
+ function c() {
458
458
  if (s)
459
459
  p.call(s), s = null;
460
460
  else {
461
- var l = H.Pop, d = a(), b = d[0], S = d[1];
461
+ var l = H.Pop, d = a(), E = d[0], b = d[1];
462
462
  if (p.length)
463
- if (b != null) {
464
- var U = f - b;
463
+ if (E != null) {
464
+ var U = f - E;
465
465
  U && (s = {
466
466
  action: l,
467
- location: S,
467
+ location: b,
468
468
  retry: function() {
469
469
  x(U * -1);
470
470
  }
@@ -478,26 +478,26 @@ function _n(e) {
478
478
  "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."
479
479
  );
480
480
  else
481
- v(l);
481
+ g(l);
482
482
  }
483
483
  }
484
- r.addEventListener(kt, u), r.addEventListener(On, function() {
484
+ r.addEventListener(Ut, c), r.addEventListener(Wn, function() {
485
485
  var l = a(), d = l[1];
486
- z(d) !== z(h) && u();
486
+ z(d) !== z(h) && c();
487
487
  });
488
- var i = H.Pop, c = a(), f = c[0], h = c[1], P = te(), p = te();
488
+ var i = H.Pop, u = a(), f = u[0], h = u[1], v = te(), p = te();
489
489
  f == null && (f = 0, o.replaceState(Q({}, o.state, {
490
490
  idx: f
491
491
  }), ""));
492
492
  function k() {
493
493
  var l = document.querySelector("base"), d = "";
494
494
  if (l && l.getAttribute("href")) {
495
- var b = r.location.href, S = b.indexOf("#");
496
- d = S === -1 ? b : b.slice(0, S);
495
+ var E = r.location.href, b = E.indexOf("#");
496
+ d = b === -1 ? E : E.slice(0, b);
497
497
  }
498
498
  return d;
499
499
  }
500
- function g(l) {
500
+ function R(l) {
501
501
  return k() + "#" + (typeof l == "string" ? l : z(l));
502
502
  }
503
503
  function y(l, d) {
@@ -505,56 +505,56 @@ function _n(e) {
505
505
  pathname: h.pathname,
506
506
  hash: "",
507
507
  search: ""
508
- }, typeof l == "string" ? ue(l) : l, {
508
+ }, typeof l == "string" ? fe(l) : l, {
509
509
  state: d,
510
- key: Pe()
510
+ key: Ee()
511
511
  }));
512
512
  }
513
- function E(l, d) {
513
+ function S(l, d) {
514
514
  return [{
515
515
  usr: l.state,
516
516
  key: l.key,
517
517
  idx: d
518
- }, g(l)];
518
+ }, R(l)];
519
519
  }
520
- function L(l, d, b) {
520
+ function B(l, d, E) {
521
521
  return !p.length || (p.call({
522
522
  action: l,
523
523
  location: d,
524
- retry: b
524
+ retry: E
525
525
  }), !1);
526
526
  }
527
- function v(l) {
527
+ function g(l) {
528
528
  i = l;
529
529
  var d = a();
530
- f = d[0], h = d[1], P.call({
530
+ f = d[0], h = d[1], v.call({
531
531
  action: i,
532
532
  location: h
533
533
  });
534
534
  }
535
- function w(l, d) {
536
- var b = H.Push, S = y(l, d);
535
+ function P(l, d) {
536
+ var E = H.Push, b = y(l, d);
537
537
  function U() {
538
- w(l, d);
538
+ P(l, d);
539
539
  }
540
- if (process.env.NODE_ENV !== "production" && K(S.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(l) + ")"), L(b, S, U)) {
541
- var B = E(S, f + 1), j = B[0], O = B[1];
540
+ if (process.env.NODE_ENV !== "production" && K(b.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(l) + ")"), B(E, b, U)) {
541
+ var C = S(b, f + 1), j = C[0], q = C[1];
542
542
  try {
543
- o.pushState(j, "", O);
543
+ o.pushState(j, "", q);
544
544
  } catch {
545
- r.location.assign(O);
545
+ r.location.assign(q);
546
546
  }
547
- v(b);
547
+ g(E);
548
548
  }
549
549
  }
550
550
  function A(l, d) {
551
- var b = H.Replace, S = y(l, d);
551
+ var E = H.Replace, b = y(l, d);
552
552
  function U() {
553
553
  A(l, d);
554
554
  }
555
- if (process.env.NODE_ENV !== "production" && K(S.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(l) + ")"), L(b, S, U)) {
556
- var B = E(S, f), j = B[0], O = B[1];
557
- o.replaceState(j, "", O), v(b);
555
+ if (process.env.NODE_ENV !== "production" && K(b.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(l) + ")"), B(E, b, U)) {
556
+ var C = S(b, f), j = C[0], q = C[1];
557
+ o.replaceState(j, "", q), g(E);
558
558
  }
559
559
  }
560
560
  function x(l) {
@@ -567,8 +567,8 @@ function _n(e) {
567
567
  get location() {
568
568
  return h;
569
569
  },
570
- createHref: g,
571
- push: w,
570
+ createHref: R,
571
+ push: P,
572
572
  replace: A,
573
573
  go: x,
574
574
  back: function() {
@@ -578,109 +578,109 @@ function _n(e) {
578
578
  x(1);
579
579
  },
580
580
  listen: function(d) {
581
- return P.push(d);
581
+ return v.push(d);
582
582
  },
583
583
  block: function(d) {
584
- var b = p.push(d);
585
- return p.length === 1 && r.addEventListener(Re, we), function() {
586
- b(), p.length || r.removeEventListener(Re, we);
584
+ var E = p.push(d);
585
+ return p.length === 1 && r.addEventListener(we, Pe), function() {
586
+ E(), p.length || r.removeEventListener(we, Pe);
587
587
  };
588
588
  }
589
589
  };
590
590
  return m;
591
591
  }
592
- function tt(e) {
592
+ function st(e) {
593
593
  e === void 0 && (e = {});
594
- var t = e, n = t.initialEntries, r = n === void 0 ? ["/"] : n, o = t.initialIndex, a = r.map(function(v) {
595
- var w = ee(Q({
594
+ var t = e, n = t.initialEntries, r = n === void 0 ? ["/"] : n, o = t.initialIndex, a = r.map(function(g) {
595
+ var P = ee(Q({
596
596
  pathname: "/",
597
597
  search: "",
598
598
  hash: "",
599
599
  state: null,
600
- key: Pe()
601
- }, typeof v == "string" ? ue(v) : v));
602
- return process.env.NODE_ENV !== "production" && K(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(v) + ")"), w;
603
- }), s = nt(o ?? a.length - 1, 0, a.length - 1), u = H.Pop, i = a[s], c = te(), f = te();
604
- function h(v) {
605
- return typeof v == "string" ? v : z(v);
606
- }
607
- function P(v, w) {
608
- return w === void 0 && (w = null), ee(Q({
600
+ key: Ee()
601
+ }, typeof g == "string" ? fe(g) : g));
602
+ return process.env.NODE_ENV !== "production" && K(P.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(g) + ")"), P;
603
+ }), s = ct(o ?? a.length - 1, 0, a.length - 1), c = H.Pop, i = a[s], u = te(), f = te();
604
+ function h(g) {
605
+ return typeof g == "string" ? g : z(g);
606
+ }
607
+ function v(g, P) {
608
+ return P === void 0 && (P = null), ee(Q({
609
609
  pathname: i.pathname,
610
610
  search: "",
611
611
  hash: ""
612
- }, typeof v == "string" ? ue(v) : v, {
613
- state: w,
614
- key: Pe()
612
+ }, typeof g == "string" ? fe(g) : g, {
613
+ state: P,
614
+ key: Ee()
615
615
  }));
616
616
  }
617
- function p(v, w, A) {
617
+ function p(g, P, A) {
618
618
  return !f.length || (f.call({
619
- action: v,
620
- location: w,
619
+ action: g,
620
+ location: P,
621
621
  retry: A
622
622
  }), !1);
623
623
  }
624
- function k(v, w) {
625
- u = v, i = w, c.call({
626
- action: u,
624
+ function k(g, P) {
625
+ c = g, i = P, u.call({
626
+ action: c,
627
627
  location: i
628
628
  });
629
629
  }
630
- function g(v, w) {
631
- var A = H.Push, x = P(v, w);
630
+ function R(g, P) {
631
+ var A = H.Push, x = v(g, P);
632
632
  function m() {
633
- g(v, w);
633
+ R(g, P);
634
634
  }
635
- process.env.NODE_ENV !== "production" && K(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(v) + ")"), p(A, x, m) && (s += 1, a.splice(s, a.length, x), k(A, x));
635
+ process.env.NODE_ENV !== "production" && K(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(g) + ")"), p(A, x, m) && (s += 1, a.splice(s, a.length, x), k(A, x));
636
636
  }
637
- function y(v, w) {
638
- var A = H.Replace, x = P(v, w);
637
+ function y(g, P) {
638
+ var A = H.Replace, x = v(g, P);
639
639
  function m() {
640
- y(v, w);
640
+ y(g, P);
641
641
  }
642
- process.env.NODE_ENV !== "production" && K(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(v) + ")"), p(A, x, m) && (a[s] = x, k(A, x));
642
+ process.env.NODE_ENV !== "production" && K(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(g) + ")"), p(A, x, m) && (a[s] = x, k(A, x));
643
643
  }
644
- function E(v) {
645
- var w = nt(s + v, 0, a.length - 1), A = H.Pop, x = a[w];
644
+ function S(g) {
645
+ var P = ct(s + g, 0, a.length - 1), A = H.Pop, x = a[P];
646
646
  function m() {
647
- E(v);
647
+ S(g);
648
648
  }
649
- p(A, x, m) && (s = w, k(A, x));
649
+ p(A, x, m) && (s = P, k(A, x));
650
650
  }
651
- var L = {
651
+ var B = {
652
652
  get index() {
653
653
  return s;
654
654
  },
655
655
  get action() {
656
- return u;
656
+ return c;
657
657
  },
658
658
  get location() {
659
659
  return i;
660
660
  },
661
661
  createHref: h,
662
- push: g,
662
+ push: R,
663
663
  replace: y,
664
- go: E,
664
+ go: S,
665
665
  back: function() {
666
- E(-1);
666
+ S(-1);
667
667
  },
668
668
  forward: function() {
669
- E(1);
669
+ S(1);
670
670
  },
671
- listen: function(w) {
672
- return c.push(w);
671
+ listen: function(P) {
672
+ return u.push(P);
673
673
  },
674
- block: function(w) {
675
- return f.push(w);
674
+ block: function(P) {
675
+ return f.push(P);
676
676
  }
677
677
  };
678
- return L;
678
+ return B;
679
679
  }
680
- function nt(e, t, n) {
680
+ function ct(e, t, n) {
681
681
  return Math.min(Math.max(e, t), n);
682
682
  }
683
- function we(e) {
683
+ function Pe(e) {
684
684
  e.preventDefault(), e.returnValue = "";
685
685
  }
686
686
  function te() {
@@ -703,14 +703,14 @@ function te() {
703
703
  }
704
704
  };
705
705
  }
706
- function Pe() {
706
+ function Ee() {
707
707
  return Math.random().toString(36).substr(2, 8);
708
708
  }
709
709
  function z(e) {
710
710
  var t = e.pathname, n = t === void 0 ? "/" : t, r = e.search, o = r === void 0 ? "" : r, a = e.hash, s = a === void 0 ? "" : a;
711
711
  return o && o !== "?" && (n += o.charAt(0) === "?" ? o : "?" + o), s && s !== "#" && (n += s.charAt(0) === "#" ? s : "#" + s), n;
712
712
  }
713
- function ue(e) {
713
+ function fe(e) {
714
714
  var t = {};
715
715
  if (e) {
716
716
  var n = e.indexOf("#");
@@ -720,7 +720,7 @@ function ue(e) {
720
720
  }
721
721
  return t;
722
722
  }
723
- class Dn extends Error {
723
+ class Fn extends Error {
724
724
  /**
725
725
  * Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
726
726
  * This detailed error message aids in quickly identifying and resolving mismatches in route usage.
@@ -731,63 +731,63 @@ class Dn extends Error {
731
731
  super(`useRoute called with incorrect route. Given ${t}, expected ${n}`);
732
732
  }
733
733
  }
734
- const At = Symbol();
735
- function Wn() {
736
- const e = fe(At);
734
+ const Bt = Symbol();
735
+ function Jn() {
736
+ const e = re(Bt);
737
737
  if (!e)
738
- throw new Ae();
738
+ throw new he();
739
739
  return e;
740
740
  }
741
- const Ut = Symbol();
742
- function Oe() {
743
- const e = fe(Ut);
741
+ const Lt = Symbol();
742
+ function De() {
743
+ const e = re(Lt);
744
744
  if (!e)
745
- throw new Ae();
745
+ throw new he();
746
746
  return e;
747
747
  }
748
748
  const Ct = Symbol("isRouterRouteSymbol");
749
- function Mn(e) {
749
+ function Qn(e) {
750
750
  return typeof e == "object" && e !== null && Ct in e;
751
751
  }
752
- function In(e, t) {
753
- function n(g, y, E) {
754
- if (typeof g == "object") {
755
- const v = {
752
+ function Gn(e, t) {
753
+ function n(R, y, S) {
754
+ if (typeof R == "object") {
755
+ const g = {
756
756
  ...e.params,
757
- ...g
757
+ ...R
758
758
  };
759
- return t(e.name, v, y);
759
+ return t(e.name, g, y);
760
760
  }
761
- const L = {
761
+ const B = {
762
762
  ...e.params,
763
- [g]: y
763
+ [R]: y
764
764
  };
765
- return t(e.name, L, E);
765
+ return t(e.name, B, S);
766
766
  }
767
- const r = (...g) => {
767
+ const r = (...R) => {
768
768
  const y = new URLSearchParams(e.query.toString());
769
- y.set(...g), n({}, { query: y });
770
- }, o = (...g) => {
769
+ y.set(...R), n({}, { query: y });
770
+ }, o = (...R) => {
771
771
  const y = new URLSearchParams(e.query.toString());
772
- y.append(...g), n({}, { query: y });
773
- }, a = (...g) => {
772
+ y.append(...R), n({}, { query: y });
773
+ }, a = (...R) => {
774
774
  const y = new URLSearchParams(e.query.toString());
775
- y.delete(...g), n({}, { query: y });
776
- }, { id: s, matched: u, matches: i, name: c, hash: f } = an(e), h = N({
775
+ y.delete(...R), n({}, { query: y });
776
+ }, { id: s, matched: c, matches: i, name: u, hash: f } = un(e), h = N({
777
777
  get() {
778
778
  return new Proxy(e.params, {
779
- set(g, y, E) {
780
- return n(y, E), !0;
779
+ set(R, y, S) {
780
+ return n(y, S), !0;
781
781
  }
782
782
  });
783
783
  },
784
- set(g) {
785
- n(g);
784
+ set(R) {
785
+ n(R);
786
786
  }
787
- }), P = N({
787
+ }), v = N({
788
788
  get() {
789
789
  return new Proxy(e.query, {
790
- get(g, y, E) {
790
+ get(R, y, S) {
791
791
  switch (y) {
792
792
  case "append":
793
793
  return o;
@@ -796,57 +796,57 @@ function In(e, t) {
796
796
  case "delete":
797
797
  return a;
798
798
  default:
799
- return Reflect.get(g, y, E);
799
+ return Reflect.get(R, y, S);
800
800
  }
801
801
  }
802
802
  });
803
803
  },
804
- set(g) {
805
- n({}, { query: g });
804
+ set(R) {
805
+ n({}, { query: R });
806
806
  }
807
807
  }), p = N({
808
808
  get() {
809
809
  return new Proxy(e.state, {
810
- set(g, y, E) {
811
- return n({}, { state: { ...e.state, [y]: E } }), !0;
810
+ set(R, y, S) {
811
+ return n({}, { state: { ...e.state, [y]: S } }), !0;
812
812
  }
813
813
  });
814
814
  },
815
- set(g) {
816
- n({}, { state: g });
815
+ set(R) {
816
+ n({}, { state: R });
817
817
  }
818
818
  });
819
- return $e({
819
+ return Ue({
820
820
  id: s,
821
- matched: u,
821
+ matched: c,
822
822
  matches: i,
823
823
  state: p,
824
- query: P,
824
+ query: v,
825
825
  hash: f,
826
826
  params: h,
827
- name: c,
827
+ name: u,
828
828
  update: n,
829
829
  [Ct]: !0
830
830
  });
831
831
  }
832
- const Lt = Symbol();
833
- function Tn(e, t) {
834
- const n = $e({ ...e }), r = (s) => {
832
+ const Nt = Symbol();
833
+ function Kn(e, t) {
834
+ const n = Ue({ ...e }), r = (s) => {
835
835
  Object.assign(n, {
836
- [Lt]: !1,
836
+ [Nt]: !1,
837
837
  ...s
838
838
  });
839
- }, o = n, a = In(o, t);
839
+ }, o = n, a = Gn(o, t);
840
840
  return {
841
841
  currentRoute: o,
842
842
  routerRoute: a,
843
843
  updateRoute: r
844
844
  };
845
845
  }
846
- function W(e) {
847
- return !e.startsWith("http") ? Jn(e) : Fn(e);
846
+ function T(e) {
847
+ return !e.startsWith("http") ? Yn(e) : zn(e);
848
848
  }
849
- function Fn(e) {
849
+ function zn(e) {
850
850
  const { protocol: t, host: n, pathname: r, search: o, searchParams: a, hash: s } = new URL(e, e);
851
851
  return {
852
852
  protocol: t,
@@ -857,7 +857,7 @@ function Fn(e) {
857
857
  hash: s
858
858
  };
859
859
  }
860
- function Jn(e) {
860
+ function Yn(e) {
861
861
  const { pathname: t, search: n, searchParams: r, hash: o } = new URL(e, "https://localhost");
862
862
  return {
863
863
  pathname: t,
@@ -866,19 +866,19 @@ function Jn(e) {
866
866
  hash: o
867
867
  };
868
868
  }
869
- function Qn(e) {
869
+ function Xn(e) {
870
870
  return (t) => {
871
- const { host: n } = W(t);
871
+ const { host: n } = T(t);
872
872
  return !(n === void 0 || n === e);
873
873
  };
874
874
  }
875
- function Gn({ mode: e, listener: t }) {
876
- const n = Kn(e), r = (i, c) => {
877
- if (c != null && c.replace) {
878
- n.replace(i, c.state);
875
+ function Zn({ mode: e, listener: t }) {
876
+ const n = er(e), r = (i, u) => {
877
+ if (u != null && u.replace) {
878
+ n.replace(i, u.state);
879
879
  return;
880
880
  }
881
- n.push(i, c == null ? void 0 : c.state);
881
+ n.push(i, u == null ? void 0 : u.state);
882
882
  }, o = () => {
883
883
  const i = z(n.location);
884
884
  n.replace(i);
@@ -896,22 +896,22 @@ function Gn({ mode: e, listener: t }) {
896
896
  }
897
897
  };
898
898
  }
899
- function Kn(e = "auto") {
899
+ function er(e = "auto") {
900
900
  switch (e) {
901
901
  case "auto":
902
- return wt() ? et() : tt();
902
+ return Te() ? at() : st();
903
903
  case "browser":
904
- return et();
904
+ return at();
905
905
  case "memory":
906
- return tt();
906
+ return st();
907
907
  case "hash":
908
- return _n();
908
+ return In();
909
909
  default:
910
910
  const t = e;
911
911
  throw new Error(`Switch is not exhaustive for mode: ${t}`);
912
912
  }
913
913
  }
914
- class Ee {
914
+ class be {
915
915
  constructor() {
916
916
  _(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
917
917
  _(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
@@ -921,7 +921,7 @@ class Ee {
921
921
  _(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
922
922
  }
923
923
  }
924
- class Bt extends Error {
924
+ class Ht extends Error {
925
925
  constructor() {
926
926
  super("Uncaught CallbackContextAbortError");
927
927
  _(this, "response");
@@ -935,67 +935,67 @@ class X extends Error {
935
935
  this.response = { status: "PUSH", to: n };
936
936
  }
937
937
  }
938
- class be extends Error {
938
+ class Se extends Error {
939
939
  constructor(n) {
940
940
  super("Uncaught CallbackContextRejectionError");
941
941
  _(this, "response");
942
942
  this.response = { status: "REJECT", type: n };
943
943
  }
944
944
  }
945
- function zn(e, t) {
946
- const n = new Ee();
945
+ function tr(e, t) {
946
+ const n = new be();
947
947
  return e.matches.forEach((r, o) => {
948
- r.onBeforeRouteEnter && _e(e, t, o) && Y(r.onBeforeRouteEnter).forEach((a) => n.onBeforeRouteEnter.add(a)), r.onBeforeRouteUpdate && We(e, t, o) && Y(r.onBeforeRouteUpdate).forEach((a) => n.onBeforeRouteUpdate.add(a));
948
+ r.onBeforeRouteEnter && We(e, t, o) && Y(r.onBeforeRouteEnter).forEach((a) => n.onBeforeRouteEnter.add(a)), r.onBeforeRouteUpdate && Fe(e, t, o) && Y(r.onBeforeRouteUpdate).forEach((a) => n.onBeforeRouteUpdate.add(a));
949
949
  }), t.matches.forEach((r, o) => {
950
- r.onBeforeRouteLeave && De(e, t, o) && Y(r.onBeforeRouteLeave).forEach((a) => n.onBeforeRouteLeave.add(a));
950
+ r.onBeforeRouteLeave && Ie(e, t, o) && Y(r.onBeforeRouteLeave).forEach((a) => n.onBeforeRouteLeave.add(a));
951
951
  }), n;
952
952
  }
953
- function Yn(e, t) {
954
- const n = new Ee();
953
+ function nr(e, t) {
954
+ const n = new be();
955
955
  return e.matches.forEach((r, o) => {
956
- r.onAfterRouteEnter && _e(e, t, o) && Y(r.onAfterRouteEnter).forEach((a) => n.onAfterRouteEnter.add(a)), r.onAfterRouteUpdate && We(e, t, o) && Y(r.onAfterRouteUpdate).forEach((a) => n.onAfterRouteUpdate.add(a));
956
+ r.onAfterRouteEnter && We(e, t, o) && Y(r.onAfterRouteEnter).forEach((a) => n.onAfterRouteEnter.add(a)), r.onAfterRouteUpdate && Fe(e, t, o) && Y(r.onAfterRouteUpdate).forEach((a) => n.onAfterRouteUpdate.add(a));
957
957
  }), t.matches.forEach((r, o) => {
958
- r.onAfterRouteLeave && De(e, t, o) && Y(r.onAfterRouteLeave).forEach((a) => n.onAfterRouteLeave.add(a));
958
+ r.onAfterRouteLeave && Ie(e, t, o) && Y(r.onAfterRouteLeave).forEach((a) => n.onAfterRouteLeave.add(a));
959
959
  }), n;
960
960
  }
961
- function D(e) {
961
+ function M(e) {
962
962
  return typeof e != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(e);
963
963
  }
964
- function Xn(e) {
965
- return D(e) ? e : `/${e}`;
964
+ function rr(e) {
965
+ return M(e) ? e : `/${e}`;
966
966
  }
967
- function Nt() {
967
+ function jt() {
968
968
  return { reject: (o) => {
969
- throw new be(o);
969
+ throw new Se(o);
970
970
  }, push: (...o) => {
971
971
  throw new X(o);
972
972
  }, replace: (o, a, s) => {
973
- if (D(o)) {
974
- const c = a ?? {};
975
- throw new X([o, { ...c, replace: !0 }]);
973
+ if (M(o)) {
974
+ const u = a ?? {};
975
+ throw new X([o, { ...u, replace: !0 }]);
976
976
  }
977
- const u = a, i = s ?? {};
978
- throw new X([o, u, { ...i, replace: !0 }]);
977
+ const c = a, i = s ?? {};
978
+ throw new X([o, c, { ...i, replace: !0 }]);
979
979
  }, abort: () => {
980
- throw new Bt();
980
+ throw new Ht();
981
981
  } };
982
982
  }
983
- function Zn() {
984
- const { reject: e, push: t, replace: n, abort: r } = Nt();
985
- async function o({ to: s, from: u, hooks: i }) {
986
- const { global: c, component: f } = i, h = zn(s, u), P = [
987
- ...c.onBeforeRouteEnter,
983
+ function or() {
984
+ const { reject: e, push: t, replace: n, abort: r } = jt();
985
+ async function o({ to: s, from: c, hooks: i }) {
986
+ const { global: u, component: f } = i, h = tr(s, c), v = [
987
+ ...u.onBeforeRouteEnter,
988
988
  ...h.onBeforeRouteEnter,
989
- ...c.onBeforeRouteUpdate,
989
+ ...u.onBeforeRouteUpdate,
990
990
  ...h.onBeforeRouteUpdate,
991
991
  ...f.onBeforeRouteUpdate,
992
- ...c.onBeforeRouteLeave,
992
+ ...u.onBeforeRouteLeave,
993
993
  ...h.onBeforeRouteLeave,
994
994
  ...f.onBeforeRouteLeave
995
995
  ];
996
996
  try {
997
- const p = P.map((k) => k(s, {
998
- from: u,
997
+ const p = v.map((k) => k(s, {
998
+ from: c,
999
999
  reject: e,
1000
1000
  push: t,
1001
1001
  replace: n,
@@ -1003,7 +1003,7 @@ function Zn() {
1003
1003
  }));
1004
1004
  await Promise.all(p);
1005
1005
  } catch (p) {
1006
- if (p instanceof X || p instanceof be || p instanceof Bt)
1006
+ if (p instanceof X || p instanceof Se || p instanceof Ht)
1007
1007
  return p.response;
1008
1008
  throw p;
1009
1009
  }
@@ -1011,28 +1011,28 @@ function Zn() {
1011
1011
  status: "SUCCESS"
1012
1012
  };
1013
1013
  }
1014
- async function a({ to: s, from: u, hooks: i }) {
1015
- const { global: c, component: f } = i, h = Yn(s, u), P = [
1014
+ async function a({ to: s, from: c, hooks: i }) {
1015
+ const { global: u, component: f } = i, h = nr(s, c), v = [
1016
1016
  ...f.onAfterRouteLeave,
1017
1017
  ...h.onAfterRouteLeave,
1018
- ...c.onAfterRouteLeave,
1018
+ ...u.onAfterRouteLeave,
1019
1019
  ...f.onAfterRouteUpdate,
1020
1020
  ...h.onAfterRouteUpdate,
1021
- ...c.onAfterRouteUpdate,
1021
+ ...u.onAfterRouteUpdate,
1022
1022
  ...f.onAfterRouteEnter,
1023
1023
  ...h.onAfterRouteEnter,
1024
- ...c.onAfterRouteEnter
1024
+ ...u.onAfterRouteEnter
1025
1025
  ];
1026
1026
  try {
1027
- const p = P.map((k) => k(s, {
1028
- from: u,
1027
+ const p = v.map((k) => k(s, {
1028
+ from: c,
1029
1029
  reject: e,
1030
1030
  push: t,
1031
1031
  replace: n
1032
1032
  }));
1033
1033
  await Promise.all(p);
1034
1034
  } catch (p) {
1035
- if (p instanceof X || p instanceof be)
1035
+ if (p instanceof X || p instanceof Se)
1036
1036
  return p.response;
1037
1037
  throw p;
1038
1038
  }
@@ -1045,74 +1045,74 @@ function Zn() {
1045
1045
  runAfterRouteHooks: a
1046
1046
  };
1047
1047
  }
1048
- const _e = (e, t, n) => {
1048
+ const We = (e, t, n) => {
1049
1049
  var a;
1050
1050
  const r = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
1051
1051
  return r.length < n || r[n].id !== ((a = o[n]) == null ? void 0 : a.id);
1052
- }, De = (e, t, n) => {
1052
+ }, Ie = (e, t, n) => {
1053
1053
  var a;
1054
1054
  const r = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
1055
1055
  return r.length < n || r[n].id !== ((a = o[n]) == null ? void 0 : a.id);
1056
- }, We = (e, t, n) => {
1056
+ }, Fe = (e, t, n) => {
1057
1057
  var r;
1058
1058
  return e.matches[n].id === ((r = t == null ? void 0 : t.matches[n]) == null ? void 0 : r.id);
1059
1059
  };
1060
- function rt(e) {
1060
+ function ut(e) {
1061
1061
  switch (e) {
1062
1062
  case "onBeforeRouteEnter":
1063
1063
  case "onAfterRouteEnter":
1064
- return _e;
1064
+ return We;
1065
1065
  case "onBeforeRouteUpdate":
1066
1066
  case "onAfterRouteUpdate":
1067
- return We;
1067
+ return Fe;
1068
1068
  case "onBeforeRouteLeave":
1069
1069
  case "onAfterRouteLeave":
1070
- return De;
1070
+ return Ie;
1071
1071
  default:
1072
1072
  throw new Error(`Switch is not exhaustive for lifecycle: ${e}`);
1073
1073
  }
1074
1074
  }
1075
- function er() {
1075
+ function ar() {
1076
1076
  const e = {
1077
- global: new Ee(),
1078
- component: new Ee()
1077
+ global: new be(),
1078
+ component: new be()
1079
1079
  };
1080
1080
  function t({ lifecycle: r, timing: o, depth: a, hook: s }) {
1081
- const u = rt(r), i = e[o][r], c = (f, h) => {
1082
- if (u(f, h.from, a))
1081
+ const c = ut(r), i = e[o][r], u = (f, h) => {
1082
+ if (c(f, h.from, a))
1083
1083
  return s(f, h);
1084
1084
  };
1085
- return i.add(c), () => i.delete(c);
1085
+ return i.add(u), () => i.delete(u);
1086
1086
  }
1087
1087
  function n({ lifecycle: r, timing: o, depth: a, hook: s }) {
1088
- const u = rt(r), i = e[o][r], c = (f, h) => {
1089
- if (u(f, h.from, a))
1088
+ const c = ut(r), i = e[o][r], u = (f, h) => {
1089
+ if (c(f, h.from, a))
1090
1090
  return s(f, h);
1091
1091
  };
1092
- return i.add(c), () => i.delete(c);
1092
+ return i.add(u), () => i.delete(u);
1093
1093
  }
1094
1094
  return { ...e, addBeforeRouteHook: t, addAfterRouteHook: n };
1095
1095
  }
1096
- const Ht = Symbol();
1097
- function tr() {
1098
- const e = er();
1096
+ const Vt = Symbol();
1097
+ function sr() {
1098
+ const e = ar();
1099
1099
  return {
1100
- onBeforeRouteEnter: (u) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: u, timing: "global", depth: 0 }),
1101
- onBeforeRouteUpdate: (u) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: u, timing: "global", depth: 0 }),
1102
- onBeforeRouteLeave: (u) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteLeave", hook: u, timing: "global", depth: 0 }),
1103
- onAfterRouteEnter: (u) => e.addAfterRouteHook({ lifecycle: "onAfterRouteEnter", hook: u, timing: "global", depth: 0 }),
1104
- onAfterRouteUpdate: (u) => e.addAfterRouteHook({ lifecycle: "onAfterRouteUpdate", hook: u, timing: "global", depth: 0 }),
1105
- onAfterRouteLeave: (u) => e.addAfterRouteHook({ lifecycle: "onAfterRouteLeave", hook: u, timing: "global", depth: 0 }),
1100
+ onBeforeRouteEnter: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
1101
+ onBeforeRouteUpdate: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
1102
+ onBeforeRouteLeave: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteLeave", hook: c, timing: "global", depth: 0 }),
1103
+ onAfterRouteEnter: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteEnter", hook: c, timing: "global", depth: 0 }),
1104
+ onAfterRouteUpdate: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteUpdate", hook: c, timing: "global", depth: 0 }),
1105
+ onAfterRouteLeave: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteLeave", hook: c, timing: "global", depth: 0 }),
1106
1106
  hooks: e
1107
1107
  };
1108
1108
  }
1109
- function nr(e) {
1110
- return ie(() => () => ge("h1", e), {
1109
+ function cr(e) {
1110
+ return le(() => () => ve("h1", e), {
1111
1111
  name: e,
1112
1112
  props: []
1113
1113
  });
1114
1114
  }
1115
- function jt(e) {
1115
+ function $t(e) {
1116
1116
  const t = new URLSearchParams(e);
1117
1117
  return {
1118
1118
  get: (...n) => t.get(...n),
@@ -1136,35 +1136,35 @@ function jt(e) {
1136
1136
  has: (...n) => t.has(...n)
1137
1137
  };
1138
1138
  }
1139
- function $t() {
1139
+ function Ot() {
1140
1140
  let e = 0;
1141
1141
  return () => (++e).toString();
1142
1142
  }
1143
- const Me = $t();
1144
- function rr({
1143
+ const Je = Ot();
1144
+ function ur({
1145
1145
  rejections: e
1146
1146
  }) {
1147
1147
  const t = (a) => {
1148
1148
  const s = {
1149
1149
  ...e
1150
1150
  };
1151
- return ve(s[a] ?? nr(a));
1151
+ return ye(s[a] ?? cr(a));
1152
1152
  }, n = (a) => {
1153
- const s = ve(t(a)), u = {
1154
- id: Me(),
1153
+ const s = ye(t(a)), c = {
1154
+ id: Je(),
1155
1155
  component: s,
1156
1156
  meta: {},
1157
1157
  state: {}
1158
1158
  };
1159
1159
  return {
1160
- id: u.id,
1161
- matched: u,
1162
- matches: [u],
1160
+ id: c.id,
1161
+ matched: c,
1162
+ matches: [c],
1163
1163
  name: a,
1164
- query: jt(""),
1164
+ query: $t(""),
1165
1165
  params: {},
1166
1166
  state: {},
1167
- [Lt]: !0
1167
+ [Nt]: !0
1168
1168
  };
1169
1169
  }, r = (a) => {
1170
1170
  if (!a) {
@@ -1173,311 +1173,311 @@ function rr({
1173
1173
  }
1174
1174
  const s = t(a);
1175
1175
  o.value = { type: a, component: s };
1176
- }, o = lt(null);
1176
+ }, o = qe(null);
1177
1177
  return {
1178
1178
  setRejection: r,
1179
1179
  rejection: o,
1180
1180
  getRejectionRoute: n
1181
1181
  };
1182
1182
  }
1183
- class or extends Error {
1183
+ class ir extends Error {
1184
1184
  constructor(t) {
1185
1185
  super(`Route not found: "${t}"`);
1186
1186
  }
1187
1187
  }
1188
- function Ie(e) {
1188
+ function Qe(e) {
1189
1189
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1190
1190
  }
1191
- function ar(e, t) {
1191
+ function fr(e, t) {
1192
1192
  const n = Array.from(e.matchAll(t));
1193
1193
  if (n.length === 0)
1194
1194
  return [e];
1195
1195
  let r = 0;
1196
- const o = n.reduce((s, u) => {
1197
- const i = Ie(e.slice(r, u.index));
1196
+ const o = n.reduce((s, c) => {
1197
+ const i = Qe(e.slice(r, c.index));
1198
1198
  i.length && s.push(i);
1199
- const [c] = u;
1200
- return s.push(c), r = u.index + c.length, s;
1199
+ const [u] = c;
1200
+ return s.push(u), r = c.index + u.length, s;
1201
1201
  }, []), a = e.slice(r);
1202
1202
  return a && o.push(a), o;
1203
1203
  }
1204
- function sr(e) {
1205
- const t = Vt(e.path.value);
1204
+ function lr(e) {
1205
+ const t = qt(e.path.value);
1206
1206
  return new RegExp(`^${t}$`, "i");
1207
1207
  }
1208
- function cr(e) {
1208
+ function hr(e) {
1209
1209
  const t = new URLSearchParams(e.query.value);
1210
- return Array.from(t.entries()).filter(([, n]) => !Ne(n)).map(([n, r]) => {
1211
- const o = Vt(r);
1212
- return new RegExp(`${Ie(n)}=${o}(&|$)`, "i");
1210
+ return Array.from(t.entries()).filter(([, n]) => !Ve(n)).map(([n, r]) => {
1211
+ const o = qt(r);
1212
+ return new RegExp(`${Qe(n)}=${o}(&|$)`, "i");
1213
1213
  });
1214
1214
  }
1215
- function Vt(e) {
1216
- return ar(e, new RegExp(ur, "g")).map((t) => t.startsWith(I) ? qt(t) : Ie(t)).join("");
1217
- }
1218
1215
  function qt(e) {
1216
+ return fr(e, new RegExp(pr, "g")).map((t) => t.startsWith(W) ? _t(t) : Qe(t)).join("");
1217
+ }
1218
+ function _t(e) {
1219
1219
  return [
1220
- ir,
1221
- fr
1220
+ dr,
1221
+ mr
1222
1222
  ].reduce((t, n) => n(t), e);
1223
1223
  }
1224
- const ur = `\\${I}\\??([\\w-_]+)\\${G}`, Te = `\\${I}\\?([\\w-_]+)\\${G}`, Ot = `\\${I}([\\w-_]+)\\${G}`;
1225
- function ir(e) {
1226
- return e.replace(new RegExp(Te, "g"), ".*");
1224
+ const pr = `\\${W}\\??([\\w-_]+)\\${G}`, Ge = `\\${W}\\?([\\w-_]+)\\${G}`, Mt = `\\${W}([\\w-_]+)\\${G}`;
1225
+ function dr(e) {
1226
+ return e.replace(new RegExp(Ge, "g"), ".*");
1227
1227
  }
1228
- function Ne(e) {
1229
- return new RegExp(Te, "g").test(e);
1228
+ function Ve(e) {
1229
+ return new RegExp(Ge, "g").test(e);
1230
1230
  }
1231
- function fr(e) {
1232
- return e.replace(new RegExp(Ot, "g"), ".+");
1231
+ function mr(e) {
1232
+ return e.replace(new RegExp(Mt, "g"), ".+");
1233
1233
  }
1234
- function Ce(e) {
1235
- const [t] = Se(e, new RegExp(Te, "g")), [n] = Se(e, new RegExp(Ot, "g"));
1234
+ function Le(e) {
1235
+ const [t] = ke(e, new RegExp(Ge, "g")), [n] = ke(e, new RegExp(Mt, "g"));
1236
1236
  return t ?? n;
1237
1237
  }
1238
- function Se(e, t) {
1239
- return Array.from(e.matchAll(t)).flatMap(([, ...r]) => r.map((o) => he(o) ? o : ""));
1238
+ function ke(e, t) {
1239
+ return Array.from(e.matchAll(t)).flatMap(([, ...r]) => r.map((o) => de(o) ? o : ""));
1240
1240
  }
1241
- function _t(e, t, n) {
1242
- const r = Wt(t, n), [o] = Se(e, r);
1241
+ function Tt(e, t, n) {
1242
+ const r = Wt(t, n), [o] = ke(e, r);
1243
1243
  return o;
1244
1244
  }
1245
1245
  function Dt(e, t) {
1246
1246
  if (!t)
1247
1247
  return e;
1248
1248
  const { name: n, param: r, value: o } = t, a = Wt(e, n);
1249
- return Se(e, a).reduce((u, i) => i === void 0 ? u : u.replace(i, () => ce(o, r, n.startsWith("?"))), e);
1249
+ return ke(e, a).reduce((c, i) => i === void 0 ? c : c.replace(i, () => ie(o, r, n.startsWith("?"))), e);
1250
1250
  }
1251
1251
  function Wt(e, t) {
1252
1252
  const n = [
1253
- lr,
1254
- hr,
1255
- qt
1253
+ gr,
1254
+ vr,
1255
+ _t
1256
1256
  ].reduce((r, o) => o(r, t), e);
1257
1257
  return new RegExp(n, "g");
1258
1258
  }
1259
- function lr(e, t) {
1259
+ function gr(e, t) {
1260
1260
  if (!t.startsWith("?"))
1261
1261
  return e;
1262
- const n = new RegExp(`\\${I}\\${t}\\${G}`, "g");
1262
+ const n = new RegExp(`\\${W}\\${t}\\${G}`, "g");
1263
1263
  return e.replace(n, "(.*)");
1264
1264
  }
1265
- function hr(e, t) {
1265
+ function vr(e, t) {
1266
1266
  if (t.startsWith("?"))
1267
1267
  return e;
1268
- const n = new RegExp(`\\${I}${t}\\${G}`, "g");
1268
+ const n = new RegExp(`\\${W}${t}\\${G}`, "g");
1269
1269
  return e.replace(n, "(.+)");
1270
1270
  }
1271
- function Mt({ protocol: e, host: t, pathname: n, search: r, searchParams: o, hash: a }) {
1271
+ function It({ protocol: e, host: t, pathname: n, search: r, searchParams: o, hash: a }) {
1272
1272
  const s = new URL("https://localhost");
1273
1273
  e && (s.protocol = e), t && (s.host = t), n && (s.pathname = n), o ? s.search = o.toString() : r && (s.search = r), a && (s.hash = a);
1274
- const u = s.toString().replace(/^https:\/\/localhost\/*/, "/");
1275
- return Xn(u);
1274
+ const c = s.toString().replace(/^https:\/\/localhost\/*/, "/");
1275
+ return rr(c);
1276
1276
  }
1277
- function pr(e, t) {
1277
+ function yr(e, t) {
1278
1278
  const n = new URLSearchParams(e), r = new URLSearchParams(t);
1279
1279
  for (const [o, a] of r.entries())
1280
1280
  n.append(o, a);
1281
1281
  return n;
1282
1282
  }
1283
- function dr(e, t = {}) {
1284
- const { params: n = {}, query: r } = t, o = vr(e.query, n), a = pr(o, r), s = gr(e.path, n), u = ye(e.hash.value ?? t.hash).value, i = mr(e.host, n), { protocol: c, host: f } = W(i);
1285
- return Mt({ protocol: c, host: f, pathname: s, searchParams: a, hash: u });
1283
+ function Rr(e, t = {}) {
1284
+ const { params: n = {}, query: r } = t, o = Er(e.query, n), a = yr(o, r), s = Pr(e.path, n), c = Re(e.hash.value ?? t.hash).value, i = wr(e.host, n), { protocol: u, host: f } = T(i);
1285
+ return It({ protocol: u, host: f, pathname: s, searchParams: a, hash: c });
1286
1286
  }
1287
- function mr(e, t) {
1287
+ function wr(e, t) {
1288
1288
  const n = e.value && !e.value.startsWith("http") ? `https://${e.value}` : e.value;
1289
1289
  return Object.entries(e.params).reduce((r, [o, a]) => {
1290
- const s = Ce(`${I}${o}${G}`);
1290
+ const s = Le(`${W}${o}${G}`);
1291
1291
  return s ? Dt(r, { name: o, param: a, value: t[s] }) : r;
1292
1292
  }, n);
1293
1293
  }
1294
- function gr(e, t) {
1294
+ function Pr(e, t) {
1295
1295
  return Object.entries(e.params).reduce((n, [r, o]) => {
1296
- const a = Ce(`${I}${r}${G}`);
1296
+ const a = Le(`${W}${r}${G}`);
1297
1297
  return a ? Dt(n, { name: r, param: o, value: t[a] }) : n;
1298
1298
  }, e.value);
1299
1299
  }
1300
- function vr(e, t) {
1300
+ function Er(e, t) {
1301
1301
  const n = new URLSearchParams(e.value);
1302
1302
  if (!e.value)
1303
1303
  return n;
1304
1304
  for (const [r, o] of n.entries()) {
1305
- const a = Ce(o);
1305
+ const a = Le(o);
1306
1306
  if (!a)
1307
1307
  continue;
1308
- const u = ce(t[a], e.params[a], Ne(o)), i = t[a] === void 0 && u === "";
1309
- Ne(o) && i ? n.delete(r, o) : n.set(r, u);
1308
+ const c = ie(t[a], e.params[a], Ve(o)), i = t[a] === void 0 && c === "";
1309
+ Ve(o) && i ? n.delete(r, o) : n.set(r, c);
1310
1310
  }
1311
1311
  return n;
1312
1312
  }
1313
- function yr(e) {
1313
+ function br(e) {
1314
1314
  return (t, n, r) => {
1315
- if (D(t)) {
1316
- const i = n ?? {}, { searchParams: c, ...f } = W(t);
1317
- return Object.entries(i.query ?? {}).forEach(([h, P]) => {
1318
- c.append(h, P);
1319
- }), Mt({ ...f, searchParams: c });
1315
+ if (M(t)) {
1316
+ const i = n ?? {}, { searchParams: u, ...f } = T(t);
1317
+ return Object.entries(i.query ?? {}).forEach(([h, v]) => {
1318
+ u.append(h, v);
1319
+ }), It({ ...f, searchParams: u });
1320
1320
  }
1321
1321
  const o = n ?? {}, a = r ?? {}, s = e.find((i) => i.name === t);
1322
1322
  if (!s)
1323
- throw new or(String(t));
1324
- return dr(s, {
1323
+ throw new ir(String(t));
1324
+ return Rr(s, {
1325
1325
  params: o,
1326
1326
  query: a.query,
1327
1327
  hash: a.hash
1328
1328
  });
1329
1329
  };
1330
1330
  }
1331
- class Rr extends Error {
1331
+ class Sr extends Error {
1332
1332
  constructor() {
1333
1333
  super("initialUrl must be set if window.location is unavailable");
1334
1334
  }
1335
1335
  }
1336
- function wr(e) {
1336
+ function kr(e) {
1337
1337
  if (e)
1338
1338
  return e;
1339
- if (wt())
1339
+ if (Te())
1340
1340
  return window.location.toString();
1341
- throw new Rr();
1341
+ throw new Sr();
1342
1342
  }
1343
- const Pr = (e, t) => {
1343
+ const Ar = (e, t) => {
1344
1344
  try {
1345
- It(e, t);
1345
+ Ft(e, t);
1346
1346
  } catch {
1347
1347
  return !1;
1348
1348
  }
1349
1349
  return !0;
1350
- }, It = (e, t) => {
1351
- const { pathname: n, search: r } = W(t);
1350
+ }, Ft = (e, t) => {
1351
+ const { pathname: n, search: r } = T(t);
1352
1352
  return {
1353
- ...Er(e.path, n),
1354
- ...br(e.query, r)
1353
+ ...xr(e.path, n),
1354
+ ...Ur(e.query, r)
1355
1355
  };
1356
1356
  };
1357
- function Er(e, t) {
1357
+ function xr(e, t) {
1358
1358
  const n = {}, r = decodeURIComponent(t);
1359
1359
  for (const [o, a] of Object.entries(e.params)) {
1360
- const s = o.startsWith("?"), u = s ? o.slice(1) : o, i = _t(r, e.value, o), c = se(i, a, s);
1361
- n[u] = c;
1360
+ const s = o.startsWith("?"), c = s ? o.slice(1) : o, i = Tt(r, e.value, o), u = ue(i, a, s);
1361
+ n[c] = u;
1362
1362
  }
1363
1363
  return n;
1364
1364
  }
1365
- function br(e, t) {
1365
+ function Ur(e, t) {
1366
1366
  const n = {}, r = new URLSearchParams(t);
1367
1367
  for (const [o, a] of Object.entries(e.params)) {
1368
- const s = o.startsWith("?"), u = s ? o.slice(1) : o, i = r.get(u) ?? void 0, c = se(i, a, s);
1369
- n[u] = c;
1368
+ const s = o.startsWith("?"), c = s ? o.slice(1) : o, i = r.get(c) ?? void 0, u = ue(i, a, s);
1369
+ n[c] = u;
1370
1370
  }
1371
1371
  return n;
1372
1372
  }
1373
- const Sr = (e) => "name" in e.matched && !!e.matched.name, xr = (e, t) => {
1374
- const { pathname: n } = W(t);
1375
- return sr(e).test(n);
1376
- }, kr = (e, t) => {
1377
- const { search: n } = W(t);
1378
- return cr(e).every((o) => o.test(n));
1379
- }, He = (e, t) => {
1380
- const { hash: n } = W(t), { value: r } = e.hash;
1373
+ const Br = (e) => "name" in e.matched && !!e.matched.name, Lr = (e, t) => {
1374
+ const { pathname: n } = T(t);
1375
+ return lr(e).test(n);
1376
+ }, Cr = (e, t) => {
1377
+ const { search: n } = T(t);
1378
+ return hr(e).every((o) => o.test(n));
1379
+ }, $e = (e, t) => {
1380
+ const { hash: n } = T(t), { value: r } = e.hash;
1381
1381
  return r === void 0 || `#${r.toLowerCase()}` === n.toLowerCase();
1382
1382
  };
1383
- function Ar(e) {
1384
- const { searchParams: t, pathname: n } = W(e), r = -1, o = 1;
1383
+ function Nr(e) {
1384
+ const { searchParams: t, pathname: n } = T(e), r = -1, o = 1;
1385
1385
  return (a, s) => {
1386
- const u = at(a, t), i = ot(a, n), c = at(s, t), f = ot(s, n);
1387
- return a.depth > s.depth ? r : a.depth < s.depth ? o : u + i > c + f ? r : u + i < c + f ? o : He(a, e) ? r : He(s, e) ? o : 0;
1386
+ const c = ft(a, t), i = it(a, n), u = ft(s, t), f = it(s, n);
1387
+ return a.depth > s.depth ? r : a.depth < s.depth ? o : c + i > u + f ? r : c + i < u + f ? o : $e(a, e) ? r : $e(s, e) ? o : 0;
1388
1388
  };
1389
1389
  }
1390
- function ot(e, t) {
1391
- const n = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), r = n.filter((o) => _t(t, e.path.value, o) === void 0);
1390
+ function it(e, t) {
1391
+ const n = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), r = n.filter((o) => Tt(t, e.path.value, o) === void 0);
1392
1392
  return n.length - r.length;
1393
1393
  }
1394
- function at(e, t) {
1394
+ function ft(e, t) {
1395
1395
  const n = new URLSearchParams(e.query.value), r = Array.from(n.keys()), o = r.filter((a) => !t.has(a));
1396
1396
  return r.length - o.length;
1397
1397
  }
1398
- function Tt(e) {
1398
+ function Jt(e) {
1399
1399
  return !!e && typeof e == "object";
1400
1400
  }
1401
- const xe = !0;
1402
- function Ur(e, t, n) {
1403
- if (Tt(e) && t in e) {
1401
+ const Ae = !0;
1402
+ function Hr(e, t, n) {
1403
+ if (Jt(e) && t in e) {
1404
1404
  const r = e[t];
1405
1405
  if (typeof r == "string")
1406
- return se(r, n, xe);
1406
+ return ue(r, n, Ae);
1407
1407
  }
1408
- return se(void 0, n, xe);
1408
+ return ue(void 0, n, Ae);
1409
1409
  }
1410
- function Cr(e, t) {
1410
+ function jr(e, t) {
1411
1411
  const n = {};
1412
1412
  for (const [r, o] of Object.entries(e)) {
1413
- const a = Ur(t, r, o);
1413
+ const a = Hr(t, r, o);
1414
1414
  n[r] = a;
1415
1415
  }
1416
1416
  return n;
1417
1417
  }
1418
- function Lr(e, t, n) {
1419
- if (Tt(e) && t in e) {
1418
+ function Vr(e, t, n) {
1419
+ if (Jt(e) && t in e) {
1420
1420
  const r = e[t];
1421
- return ce(r, n, xe);
1421
+ return ie(r, n, Ae);
1422
1422
  }
1423
- return ce(void 0, n, xe);
1423
+ return ie(void 0, n, Ae);
1424
1424
  }
1425
- const st = (e, t) => {
1425
+ const lt = (e, t) => {
1426
1426
  const n = {};
1427
1427
  for (const [r, o] of Object.entries(e)) {
1428
- const a = Lr(t, r, o);
1428
+ const a = Vr(t, r, o);
1429
1429
  n[r] = a;
1430
1430
  }
1431
1431
  return n;
1432
- }, Br = [
1433
- Sr,
1434
- xr,
1435
- kr,
1436
- He,
1437
- Pr
1432
+ }, $r = [
1433
+ Br,
1434
+ Lr,
1435
+ Cr,
1436
+ $e,
1437
+ Ar
1438
1438
  ];
1439
- function Le(e, t, n) {
1440
- const r = Ar(t), o = e.filter((i) => Br.every((c) => c(i, t))).sort(r);
1439
+ function Ne(e, t, n) {
1440
+ const r = Nr(t), o = e.filter((i) => $r.every((u) => u(i, t))).sort(r);
1441
1441
  if (o.length === 0)
1442
1442
  return;
1443
- const [a] = o, { search: s, hash: u } = W(t);
1443
+ const [a] = o, { search: s, hash: c } = T(t);
1444
1444
  return {
1445
1445
  id: a.id,
1446
1446
  matched: a.matched,
1447
1447
  matches: a.matches,
1448
1448
  name: a.name,
1449
- query: jt(s),
1450
- params: It(a, t),
1451
- state: Cr(a.state, n),
1452
- hash: u
1449
+ query: $t(s),
1450
+ params: Ft(a, t),
1451
+ state: jr(a.state, n),
1452
+ hash: c
1453
1453
  };
1454
1454
  }
1455
- function Fe(e, t) {
1456
- const n = new RegExp(`\\${I}(\\??[\\w-_]+)\\${G}`, "g");
1455
+ function Ke(e, t) {
1456
+ const n = new RegExp(`\\${W}(\\??[\\w-_]+)\\${G}`, "g");
1457
1457
  return Array.from(e.matchAll(n)).reduce((o, [a, s]) => {
1458
- const u = Ce(a);
1459
- if (!u)
1458
+ const c = Le(a);
1459
+ if (!c)
1460
1460
  return o;
1461
- const i = $n(t, u);
1462
- return re([u], o), o[s] = i, o;
1461
+ const i = Mn(t, c);
1462
+ return oe([c], o), o[s] = i, o;
1463
1463
  }, {});
1464
1464
  }
1465
- function je(e, t) {
1465
+ function Oe(e, t) {
1466
1466
  return {
1467
1467
  value: e,
1468
- params: Fe(e, t)
1468
+ params: Ke(e, t)
1469
1469
  };
1470
1470
  }
1471
- function Nr(e, t) {
1472
- return he(t) ? e.map((n) => {
1471
+ function Or(e, t) {
1472
+ return de(t) ? e.map((n) => {
1473
1473
  const r = `${t}${n.path.value}`;
1474
1474
  return {
1475
1475
  ...n,
1476
- path: je(r, n.path.params)
1476
+ path: Oe(r, n.path.params)
1477
1477
  };
1478
1478
  }) : e;
1479
1479
  }
1480
- class Hr extends Error {
1480
+ class qr extends Error {
1481
1481
  /**
1482
1482
  * Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
1483
1483
  * @param name - The name of the name that was duplicated.
@@ -1486,184 +1486,213 @@ class Hr extends Error {
1486
1486
  super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`);
1487
1487
  }
1488
1488
  }
1489
- function jr(e) {
1489
+ function _r(e) {
1490
1490
  const t = e.map(({ name: n }) => n);
1491
1491
  for (const n of t)
1492
- if (vt(t, n) > 1)
1493
- throw new Hr(n);
1492
+ if (wt(t, n) > 1)
1493
+ throw new qr(n);
1494
+ }
1495
+ function Mr() {
1496
+ const e = Ue(/* @__PURE__ */ new Map()), t = Te() ? s() : null, n = (c) => {
1497
+ e.set(c, !1), t == null || t.observe(c);
1498
+ }, r = (c) => {
1499
+ e.delete(c), t == null || t.unobserve(c);
1500
+ }, o = () => {
1501
+ t == null || t.disconnect();
1502
+ }, a = (c) => e.get(c) ?? !1;
1503
+ function s() {
1504
+ return new IntersectionObserver((c) => {
1505
+ c.forEach((i) => {
1506
+ e.set(i.target, i.isIntersecting);
1507
+ });
1508
+ });
1509
+ }
1510
+ return {
1511
+ observe: n,
1512
+ unobserve: r,
1513
+ disconnect: o,
1514
+ isElementVisible: a
1515
+ };
1494
1516
  }
1495
- function to(e, t) {
1496
- const n = yn(e) ? e.flat() : e, r = Nr(n, t == null ? void 0 : t.base);
1497
- jr(r);
1498
- const o = $t(), a = Wr(), s = yr(r), u = Gn({
1517
+ const Qt = Symbol("visibilityObserver");
1518
+ function Tr() {
1519
+ const e = re(Qt);
1520
+ if (!e)
1521
+ throw new he();
1522
+ return e;
1523
+ }
1524
+ function io(e, t) {
1525
+ const n = bn(e) ? e.flat() : e, r = Or(n, t == null ? void 0 : t.base);
1526
+ _r(r);
1527
+ const o = Ot(), a = Kr(), s = Mr(), c = br(r), i = Zn({
1499
1528
  mode: t == null ? void 0 : t.historyMode,
1500
- listener: ({ location: R }) => {
1501
- const C = z(R);
1502
- E(C, { state: R.state });
1529
+ listener: ({ location: w }) => {
1530
+ const L = z(w);
1531
+ B(L, { state: w.state });
1503
1532
  }
1504
- }), { runBeforeRouteHooks: i, runAfterRouteHooks: c } = Zn(), {
1505
- hooks: f,
1506
- onBeforeRouteEnter: h,
1507
- onAfterRouteUpdate: P,
1508
- onBeforeRouteLeave: p,
1509
- onAfterRouteEnter: k,
1510
- onBeforeRouteUpdate: g,
1511
- onAfterRouteLeave: y
1512
- } = tr();
1513
- async function E(R, C = {}) {
1514
- const T = o();
1515
- if (u.stopListening(), pe(R)) {
1516
- u.update(R, C);
1533
+ }), { runBeforeRouteHooks: u, runAfterRouteHooks: f } = or(), {
1534
+ hooks: h,
1535
+ onBeforeRouteEnter: v,
1536
+ onAfterRouteUpdate: p,
1537
+ onBeforeRouteLeave: k,
1538
+ onAfterRouteEnter: R,
1539
+ onBeforeRouteUpdate: y,
1540
+ onAfterRouteLeave: S
1541
+ } = sr();
1542
+ async function B(w, L = {}) {
1543
+ const I = o();
1544
+ if (i.stopListening(), Ce(w)) {
1545
+ i.update(w, L);
1517
1546
  return;
1518
1547
  }
1519
- const $ = Le(r, R, C.state) ?? l("NotFound"), de = { ...b }, F = await i({ to: $, from: de, hooks: f });
1548
+ const V = Ne(r, w, L.state) ?? d("NotFound"), me = { ...b }, F = await u({ to: V, from: me, hooks: h });
1520
1549
  switch (F.status) {
1521
1550
  // On abort do nothing
1522
1551
  case "ABORT":
1523
1552
  return;
1524
1553
  // On push update the history, and push new route, and return
1525
1554
  case "PUSH":
1526
- u.update(R, C), await L(...F.to);
1555
+ i.update(w, L), await g(...F.to);
1527
1556
  return;
1528
1557
  // On reject update the history, the route, and set the rejection type
1529
1558
  case "REJECT":
1530
- u.update(R, C), x(F.type);
1559
+ i.update(w, L), m(F.type);
1531
1560
  break;
1532
1561
  // On success update history, set the route, and clear the rejection
1533
1562
  case "SUCCESS":
1534
- u.update(R, C), x(null);
1563
+ i.update(w, L), m(null);
1535
1564
  break;
1536
1565
  default:
1537
1566
  throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(F)}`);
1538
1567
  }
1539
- const M = T;
1540
- a.setProps($).then((V) => {
1541
- if (M === T)
1542
- switch (V.status) {
1568
+ const D = I;
1569
+ a.setProps(V).then(($) => {
1570
+ if (D === I)
1571
+ switch ($.status) {
1543
1572
  case "SUCCESS":
1544
1573
  break;
1545
1574
  case "PUSH":
1546
- L(...V.to);
1575
+ g(...$.to);
1547
1576
  break;
1548
1577
  case "REJECT":
1549
- x(V.type);
1578
+ m($.type);
1550
1579
  break;
1551
1580
  default:
1552
- const oe = V;
1553
- throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(oe)}`);
1581
+ const ae = $;
1582
+ throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(ae)}`);
1554
1583
  }
1555
- }), U($);
1556
- const J = await c({ to: $, from: de, hooks: f });
1584
+ }), C(V);
1585
+ const J = await f({ to: V, from: me, hooks: h });
1557
1586
  switch (J.status) {
1558
1587
  case "PUSH":
1559
- await L(...J.to);
1588
+ await g(...J.to);
1560
1589
  break;
1561
1590
  case "REJECT":
1562
- x(J.type);
1591
+ m(J.type);
1563
1592
  break;
1564
1593
  case "SUCCESS":
1565
1594
  break;
1566
1595
  default:
1567
- const V = J;
1568
- throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(V)}`);
1596
+ const $ = J;
1597
+ throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify($)}`);
1569
1598
  }
1570
- u.startListening();
1599
+ i.startListening();
1571
1600
  }
1572
- const L = (R, C, T) => {
1573
- if (D(R)) {
1574
- const V = { ...C }, oe = s(R, V);
1575
- return E(oe, V);
1601
+ const g = (w, L, I) => {
1602
+ if (M(w)) {
1603
+ const $ = { ...L }, ae = c(w, $);
1604
+ return B(ae, $);
1576
1605
  }
1577
- const $ = { ...T }, F = s(R, C ?? {}, $), M = Xe(R), J = st((M == null ? void 0 : M.state) ?? {}, $.state);
1578
- return E(F, { ...$, state: J });
1579
- }, v = (R, C, T) => {
1580
- if (D(R)) {
1581
- const V = { ...C, replace: !0 }, oe = s(R, V);
1582
- return E(oe, V);
1606
+ const V = { ...I }, F = c(w, L ?? {}, V), D = rt(w), J = lt((D == null ? void 0 : D.state) ?? {}, V.state);
1607
+ return B(F, { ...V, state: J });
1608
+ }, P = (w, L, I) => {
1609
+ if (M(w)) {
1610
+ const $ = { ...L, replace: !0 }, ae = c(w, $);
1611
+ return B(ae, $);
1583
1612
  }
1584
- const $ = { ...T, replace: !0 }, F = s(R, C ?? {}, $), M = Xe(R), J = st((M == null ? void 0 : M.state) ?? {}, $.state);
1585
- return E(F, { ...$, state: J });
1586
- }, w = (R) => {
1587
- x(R);
1588
- }, A = (R, C = {}) => {
1589
- if (!D(R)) {
1590
- const T = s(R, C);
1591
- return Le(r, T);
1613
+ const V = { ...I, replace: !0 }, F = c(w, L ?? {}, V), D = rt(w), J = lt((D == null ? void 0 : D.state) ?? {}, V.state);
1614
+ return B(F, { ...V, state: J });
1615
+ }, A = (w) => {
1616
+ m(w);
1617
+ }, x = (w, L = {}) => {
1618
+ if (!M(w)) {
1619
+ const I = c(w, L);
1620
+ return Ne(r, I);
1592
1621
  }
1593
- if (!pe(R))
1594
- return Le(r, R);
1595
- }, { setRejection: x, rejection: m, getRejectionRoute: l } = rr(t ?? {}), d = l("NotFound"), { currentRoute: b, routerRoute: S, updateRoute: U } = Tn(d, L);
1596
- u.startListening();
1597
- const B = wr(t == null ? void 0 : t.initialUrl), j = u.location.state, { host: O } = W(B), pe = Qn(O);
1598
- let ze = !1;
1599
- async function Ye() {
1600
- ze || (await E(B, { replace: !0, state: j }), ze = !0);
1601
- }
1602
- function Xe(R) {
1603
- return r.find((C) => C.name === R);
1604
- }
1605
- function nn(R) {
1606
- R.component("RouterView", zr), R.component("RouterLink", Kr), R.provide(At, m), R.provide(Ht, f), R.provide(Yt, a), R.provide(Ut, Ze), Ye();
1607
- }
1608
- const Ze = {
1609
- route: S,
1610
- resolve: s,
1611
- push: L,
1612
- replace: v,
1613
- reject: w,
1614
- find: A,
1615
- refresh: u.refresh,
1616
- forward: u.forward,
1617
- back: u.back,
1618
- go: u.go,
1619
- install: nn,
1620
- isExternal: pe,
1621
- onBeforeRouteEnter: h,
1622
- onAfterRouteUpdate: P,
1623
- onBeforeRouteLeave: p,
1624
- onAfterRouteEnter: k,
1625
- onBeforeRouteUpdate: g,
1626
- onAfterRouteLeave: y,
1622
+ if (!Ce(w))
1623
+ return Ne(r, w);
1624
+ }, { setRejection: m, rejection: l, getRejectionRoute: d } = ur(t ?? {}), E = d("NotFound"), { currentRoute: b, routerRoute: U, updateRoute: C } = Kn(E, g);
1625
+ i.startListening();
1626
+ const j = kr(t == null ? void 0 : t.initialUrl), q = i.location.state, { host: et } = T(j), Ce = Xn(et);
1627
+ let tt = !1;
1628
+ async function nt() {
1629
+ tt || (await B(j, { replace: !0, state: q }), tt = !0);
1630
+ }
1631
+ function rt(w) {
1632
+ return r.find((L) => L.name === w);
1633
+ }
1634
+ function an(w) {
1635
+ w.component("RouterView", oo), w.component("RouterLink", ro), w.provide(Bt, l), w.provide(Vt, h), w.provide(en, a), w.provide(Qt, s), w.provide(Lt, ot), nt();
1636
+ }
1637
+ const ot = {
1638
+ route: U,
1639
+ resolve: c,
1640
+ push: g,
1641
+ replace: P,
1642
+ reject: A,
1643
+ find: x,
1644
+ refresh: i.refresh,
1645
+ forward: i.forward,
1646
+ back: i.back,
1647
+ go: i.go,
1648
+ install: an,
1649
+ isExternal: Ce,
1650
+ onBeforeRouteEnter: v,
1651
+ onAfterRouteUpdate: p,
1652
+ onBeforeRouteLeave: k,
1653
+ onAfterRouteEnter: R,
1654
+ onBeforeRouteUpdate: y,
1655
+ onAfterRouteLeave: S,
1627
1656
  prefetch: t == null ? void 0 : t.prefetch,
1628
- start: Ye
1657
+ start: nt
1629
1658
  };
1630
- return Ze;
1659
+ return ot;
1631
1660
  }
1632
- function ct(e, t) {
1661
+ function ht(e, t) {
1633
1662
  return {
1634
1663
  value: e,
1635
- params: Fe(e, t)
1664
+ params: Ke(e, t)
1636
1665
  };
1637
1666
  }
1638
- function Ft(e, t) {
1667
+ function Gt(e, t) {
1639
1668
  return {
1640
1669
  value: e,
1641
- params: Fe(e, t)
1670
+ params: Ke(e, t)
1642
1671
  };
1643
1672
  }
1644
- function $r(e) {
1645
- return le(e) && typeof e.hash == "string";
1673
+ function Dr(e) {
1674
+ return pe(e) && typeof e.hash == "string";
1646
1675
  }
1647
- function Jt(e) {
1648
- return e === void 0 ? ye() : $r(e) ? e : ye(e);
1676
+ function Kt(e) {
1677
+ return e === void 0 ? Re() : Dr(e) ? e : Re(e);
1649
1678
  }
1650
- function Je(e) {
1679
+ function ze(e) {
1651
1680
  return e === void 0 ? "" : e;
1652
1681
  }
1653
- function Vr(e) {
1654
- return le(e) && typeof e.value == "string";
1682
+ function Wr(e) {
1683
+ return pe(e) && typeof e.value == "string";
1655
1684
  }
1656
- function Qt(e) {
1657
- return e === void 0 ? je("", {}) : Vr(e) ? e : je(e, {});
1685
+ function zt(e) {
1686
+ return e === void 0 ? Oe("", {}) : Wr(e) ? e : Oe(e, {});
1658
1687
  }
1659
- function qr(e) {
1660
- return le(e) && typeof e.value == "string";
1688
+ function Ir(e) {
1689
+ return pe(e) && typeof e.value == "string";
1661
1690
  }
1662
- function Gt(e) {
1663
- return e === void 0 ? ct("", {}) : qr(e) ? e : ct(e, {});
1691
+ function Yt(e) {
1692
+ return e === void 0 ? ht("", {}) : Ir(e) ? e : ht(e, {});
1664
1693
  }
1665
1694
  function ne(e) {
1666
- const t = Me(), n = Je(e.name), r = Qt(e.path), o = Gt(e.query), a = Jt(e.hash), s = e.meta ?? {}, u = Cn(e) ? e.state : {}, i = ve({ id: t, meta: {}, state: {}, ...e }), c = {
1695
+ const t = Je(), n = ze(e.name), r = zt(e.path), o = Yt(e.query), a = Kt(e.hash), s = e.meta ?? {}, c = jn(e) ? e.state : {}, i = ye({ id: t, meta: {}, state: {}, ...e }), u = {
1667
1696
  id: t,
1668
1697
  matched: i,
1669
1698
  matches: [i],
@@ -1672,112 +1701,122 @@ function ne(e) {
1672
1701
  query: o,
1673
1702
  hash: a,
1674
1703
  meta: s,
1675
- state: u,
1704
+ state: c,
1676
1705
  depth: 1,
1677
- host: Ft("", {}),
1706
+ host: Gt("", {}),
1678
1707
  prefetch: e.prefetch
1679
- }, f = yt(e) ? Rt(e.parent, c) : c;
1680
- return re(f.path.params, f.query.params), f;
1708
+ }, f = Pt(e) ? Et(e.parent, u) : u;
1709
+ return oe(f.path.params, f.query.params), f;
1681
1710
  }
1682
- const ke = { template: "<div>This is component</div>" }, Qe = ne({
1711
+ const xe = { template: "<div>This is component</div>" }, Ye = ne({
1683
1712
  name: "parentA",
1684
1713
  path: "/parentA/[paramA]"
1685
- }), Kt = ne({
1686
- parent: Qe,
1714
+ }), Xt = ne({
1715
+ parent: Ye,
1687
1716
  name: "parentA.childA",
1688
1717
  path: "/[?paramB]"
1689
- }), Or = ne({
1690
- parent: Qe,
1718
+ }), Fr = ne({
1719
+ parent: Ye,
1691
1720
  name: "parentA.childB",
1692
1721
  path: "/[paramD]",
1693
- component: ke
1694
- }), _r = ne({
1695
- parent: Kt,
1722
+ component: xe
1723
+ }), Jr = ne({
1724
+ parent: Xt,
1696
1725
  name: "parentA.childA.grandChildA",
1697
1726
  path: "/[paramC]",
1698
- component: ke
1727
+ component: xe
1699
1728
  });
1700
1729
  ne({
1701
1730
  name: "parentB",
1702
1731
  path: "/parentB",
1703
- component: ke
1732
+ component: xe
1704
1733
  }), ne({
1705
1734
  name: "parentC",
1706
1735
  path: "/",
1707
- component: ke
1736
+ component: xe
1708
1737
  });
1709
- const Dr = {
1738
+ const Qr = "eager", Gr = {
1710
1739
  components: !0,
1711
1740
  props: !1
1712
1741
  };
1713
- function zt({ routerPrefetch: e, routePrefetch: t, linkPrefetch: n }, r) {
1714
- return Be(n, r) ?? Be(t, r) ?? Be(e, r) ?? Dr[r];
1715
- }
1716
- function Be(e, t) {
1717
- return le(e) ? e[t] : e;
1718
- }
1719
- function ut(e) {
1742
+ function ge(e) {
1743
+ return ["eager", "lazy"].includes(e);
1744
+ }
1745
+ function Zt({ routerPrefetch: e, routePrefetch: t, linkPrefetch: n }, r) {
1746
+ const o = He(n, r), a = He(t, r), s = He(e, r), c = [
1747
+ o,
1748
+ a,
1749
+ s,
1750
+ Gr[r],
1751
+ Qr
1752
+ ].reduce((i, u) => ge(i) ? i : i === !0 && ge(u) ? u : i === !0 && !ge(u) ? i : i === void 0 ? u : i, void 0);
1753
+ return ge(c) ? c : !1;
1754
+ }
1755
+ function He(e, t) {
1756
+ return pe(e) ? e[t] : e;
1757
+ }
1758
+ function pt(e) {
1720
1759
  try {
1721
1760
  const t = e();
1722
- return Pt(t) ? t.catch((n) => n) : t;
1761
+ return bt(t) ? t.catch((n) => n) : t;
1723
1762
  } catch (t) {
1724
1763
  return t;
1725
1764
  }
1726
1765
  }
1727
- const Yt = Symbol();
1728
- function Wr() {
1729
- const e = $e(/* @__PURE__ */ new Map()), t = Nt(), n = (c, f) => c.matches.filter((h) => zt({ ...f, routePrefetch: h.prefetch }, "props")).flatMap((h) => u(h)).reduce((h, { id: P, name: p, props: k }) => {
1730
- if (!k)
1731
- return h;
1732
- const g = s(P, p, c), y = ut(() => k(c.params, t));
1733
- return h[g] = y, h;
1734
- }, {}), r = (c) => {
1735
- Object.entries(c).forEach(([f, h]) => {
1766
+ const en = Symbol();
1767
+ function Kr() {
1768
+ const e = Ue(/* @__PURE__ */ new Map()), t = jt(), n = (u, f, h) => f.matches.filter((v) => Zt({ ...h, routePrefetch: v.prefetch }, "props") === u).flatMap((v) => c(v)).reduce((v, { id: p, name: k, props: R }) => {
1769
+ if (!R)
1770
+ return v;
1771
+ const y = s(p, k, f), S = pt(() => R(f, t));
1772
+ return v[y] = S, v;
1773
+ }, {}), r = (u) => {
1774
+ Object.entries(u).forEach(([f, h]) => {
1736
1775
  e.set(f, h);
1737
1776
  });
1738
- }, o = async (c) => {
1739
- const f = c.matches.flatMap(u), h = [], P = [];
1740
- for (const { id: p, name: k, props: g } of f) {
1741
- if (!g)
1777
+ }, o = async (u) => {
1778
+ const f = u.matches.flatMap(c), h = [], v = [];
1779
+ for (const { id: p, name: k, props: R } of f) {
1780
+ if (!R)
1742
1781
  continue;
1743
- const y = s(p, k, c);
1782
+ const y = s(p, k, u);
1744
1783
  if (h.push(y), !e.has(y)) {
1745
- const E = ut(() => g(c.params, t));
1746
- e.set(y, E);
1784
+ const S = pt(() => R(u, t));
1785
+ e.set(y, S);
1747
1786
  }
1748
- P.push((async () => {
1749
- const E = await e.get(y);
1750
- if (E instanceof Error)
1751
- throw E;
1787
+ v.push((async () => {
1788
+ const S = await e.get(y);
1789
+ if (S instanceof Error)
1790
+ throw S;
1752
1791
  })());
1753
1792
  }
1754
1793
  i(h);
1755
1794
  try {
1756
- return await Promise.all(P), { status: "SUCCESS" };
1795
+ return await Promise.all(v), { status: "SUCCESS" };
1757
1796
  } catch (p) {
1758
- if (p instanceof X || p instanceof be)
1797
+ if (p instanceof X || p instanceof Se)
1759
1798
  return p.response;
1760
1799
  throw p;
1761
1800
  }
1762
- }, a = (c, f, h) => {
1763
- const P = s(c, f, h);
1764
- return e.get(P);
1801
+ }, a = (u, f, h) => {
1802
+ const v = s(u, f, h);
1803
+ return e.get(v);
1765
1804
  };
1766
- function s(c, f, h) {
1767
- return [c, f, h.id, JSON.stringify(h.params)].join("-");
1805
+ function s(u, f, h) {
1806
+ return [u, f, h.id, JSON.stringify(h.params)].join("-");
1768
1807
  }
1769
- function u(c) {
1770
- return qe(c) ? Object.entries(c.props ?? {}).map(([f, h]) => ({ id: c.id, name: f, props: h })) : Ve(c) ? [
1808
+ function c(u) {
1809
+ return Me(u) ? Object.entries(u.props ?? {}).map(([f, h]) => ({ id: u.id, name: f, props: h })) : _e(u) ? [
1771
1810
  {
1772
- id: c.id,
1811
+ id: u.id,
1773
1812
  name: "default",
1774
- props: c.props
1813
+ props: u.props
1775
1814
  }
1776
1815
  ] : [];
1777
1816
  }
1778
- function i(c) {
1817
+ function i(u) {
1779
1818
  for (const f in e.keys())
1780
- c.includes(f) || e.delete(f);
1819
+ u.includes(f) || e.delete(f);
1781
1820
  }
1782
1821
  return {
1783
1822
  getPrefetchProps: n,
@@ -1786,214 +1825,232 @@ function Wr() {
1786
1825
  setProps: o
1787
1826
  };
1788
1827
  }
1789
- function Xt() {
1790
- const e = fe(Yt);
1828
+ function tn() {
1829
+ const e = re(en);
1791
1830
  if (!e)
1792
- throw new Ae();
1831
+ throw new he();
1793
1832
  return e;
1794
1833
  }
1795
- const Mr = sn(() => new Promise((e) => {
1834
+ const zr = fn(() => new Promise((e) => {
1796
1835
  e({ default: { template: "foo" } });
1797
1836
  }));
1798
- function it(e) {
1799
- return e.name === Mr.name && "setup" in e;
1837
+ function dt(e) {
1838
+ return e.name === zr.name && "setup" in e;
1800
1839
  }
1801
- function Ir(e) {
1802
- let t = {};
1803
- const { getPrefetchProps: n, setPrefetchProps: r } = Xt();
1804
- return ht(() => me(e), ({ route: a, ...s }) => {
1805
- a && (Tr(a, s), t = n(a, s));
1806
- }, { immediate: !0 }), {
1807
- commit: () => {
1808
- r(t);
1840
+ function Yr(e) {
1841
+ const t = /* @__PURE__ */ new Map(), n = qe(), { getPrefetchProps: r, setPrefetchProps: o } = tn(), { observe: a, unobserve: s, isElementVisible: c } = Tr(), i = () => {
1842
+ const f = Array.from(t.values()).reduce((h, v) => (Object.assign(h, v), h), {});
1843
+ o(f);
1844
+ };
1845
+ ln(() => {
1846
+ if (!n.value) {
1847
+ console.warn("The usePrefetching composition will not work correctly if the element ref is not bound.");
1848
+ return;
1809
1849
  }
1850
+ a(n.value);
1851
+ }), hn(() => {
1852
+ n.value && s(n.value);
1853
+ }), je(() => se(e), ({ route: f, ...h }) => {
1854
+ t.clear(), f && u("eager", f, h);
1855
+ }, { immediate: !0 }), je(() => !!(n.value && c(n.value)), (f) => {
1856
+ const { route: h, ...v } = se(e);
1857
+ !h || !f || u("lazy", h, v);
1858
+ }, { immediate: !0 });
1859
+ function u(f, h, v) {
1860
+ Xr(f, h, v), t.has(f) || t.set(f, r(f, h, v));
1861
+ }
1862
+ return {
1863
+ element: n,
1864
+ commit: i
1810
1865
  };
1811
1866
  }
1812
- function Tr(e, { routerPrefetch: t, linkPrefetch: n }) {
1813
- e.matches.forEach((r) => {
1814
- zt({
1815
- routePrefetch: r.prefetch,
1816
- routerPrefetch: t,
1817
- linkPrefetch: n
1818
- }, "components") && (Ve(r) && it(r.component) && r.component.setup(), qe(r) && Object.values(r.components).forEach((a) => {
1819
- it(a) && a.setup();
1867
+ function Xr(e, t, n) {
1868
+ t.matches.forEach((r) => {
1869
+ Zt({
1870
+ ...n,
1871
+ routePrefetch: r.prefetch
1872
+ }, "components") === e && (_e(r) && dt(r.component) && r.component.setup(), Me(r) && Object.values(r.components).forEach((a) => {
1873
+ dt(a) && a.setup();
1820
1874
  }));
1821
1875
  });
1822
1876
  }
1823
- function Fr(e, t = {}, n = {}) {
1824
- const r = Oe(), o = cn(e), a = N(() => D(o.value) ? {} : me(t)), s = N(() => D(o.value) ? me(t) : me(n)), u = N(() => {
1825
- if (D(o.value))
1877
+ function Zr(e, t = {}, n = {}) {
1878
+ const r = De(), o = pn(e), a = N(() => M(o.value) ? {} : se(t)), s = N(() => M(o.value) ? se(t) : se(n)), c = N(() => {
1879
+ if (M(o.value))
1826
1880
  return o.value;
1827
1881
  try {
1828
1882
  return r.resolve(o.value, a.value, s.value);
1829
- } catch (g) {
1830
- throw g instanceof Z && console.error(`Failed to resolve route "${o.value.toString()}" in RouterLink.`, g), g;
1883
+ } catch (y) {
1884
+ throw y instanceof Z && console.error(`Failed to resolve route "${o.value.toString()}" in RouterLink.`, y), y;
1831
1885
  }
1832
- }), i = N(() => r.find(u.value, s.value)), c = N(() => !!i.value && r.route.matches.includes(i.value.matched)), f = N(() => !!i.value && r.route.matched === i.value.matched), h = N(() => r.isExternal(u.value)), { commit: P } = Ir(() => ({
1886
+ }), i = N(() => r.find(c.value, s.value)), u = N(() => !!i.value && r.route.matches.includes(i.value.matched)), f = N(() => !!i.value && r.route.matched === i.value.matched), h = N(() => r.isExternal(c.value)), { element: v, commit: p } = Yr(() => ({
1833
1887
  route: i.value,
1834
1888
  routerPrefetch: r.prefetch,
1835
1889
  linkPrefetch: s.value.prefetch
1836
- })), p = (g) => (P(), r.push(u.value, { ...s.value, ...g }));
1890
+ })), k = (y) => (p(), r.push(c.value, { ...s.value, ...y }));
1837
1891
  return {
1892
+ element: v,
1838
1893
  route: i,
1839
- href: u,
1840
- isMatch: c,
1894
+ href: c,
1895
+ isMatch: u,
1841
1896
  isExactMatch: f,
1842
1897
  isExternal: h,
1843
- push: p,
1844
- replace: (g) => p(g)
1898
+ push: k,
1899
+ replace: (y) => k(y)
1845
1900
  };
1846
1901
  }
1847
- function Jr(e, t, { exact: n } = {}) {
1848
- if (!Mn(e))
1902
+ function eo(e, t, { exact: n } = {}) {
1903
+ if (!Qn(e))
1849
1904
  return !1;
1850
1905
  if (t === void 0)
1851
1906
  return !0;
1852
- const r = e.matches.map((o) => Je(o.name));
1907
+ const r = e.matches.map((o) => ze(o.name));
1853
1908
  if (n) {
1854
1909
  const o = r.at(-1);
1855
1910
  return t === o;
1856
1911
  }
1857
1912
  return r.includes(t);
1858
1913
  }
1859
- function Qr(e, t) {
1860
- const n = Oe();
1914
+ function to(e, t) {
1915
+ const n = De();
1861
1916
  function r() {
1862
1917
  if (!e)
1863
1918
  return;
1864
- if (!Jr(n.route, e, t))
1865
- throw new Dn(e, n.route.name);
1919
+ if (!eo(n.route, e, t))
1920
+ throw new Fn(e, n.route.name);
1866
1921
  }
1867
- return ht(n.route, r, { immediate: !0, deep: !0 }), n.route;
1922
+ return je(n.route, r, { immediate: !0, deep: !0 }), n.route;
1868
1923
  }
1869
- const Zt = Symbol();
1870
- function Ge() {
1871
- return fe(Zt, 0);
1924
+ const nn = Symbol();
1925
+ function Xe() {
1926
+ return re(nn, 0);
1872
1927
  }
1873
- function en() {
1874
- const e = fe(Ht);
1928
+ function rn() {
1929
+ const e = re(Vt);
1875
1930
  if (!e)
1876
- throw new Ae();
1931
+ throw new he();
1877
1932
  return e;
1878
1933
  }
1879
- function tn(e) {
1934
+ function on(e) {
1880
1935
  return (t) => {
1881
- const n = Ge(), o = en().addBeforeRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
1882
- return pt(o), o;
1936
+ const n = Xe(), o = rn().addBeforeRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
1937
+ return gt(o), o;
1883
1938
  };
1884
1939
  }
1885
- function Ke(e) {
1940
+ function Ze(e) {
1886
1941
  return (t) => {
1887
- const n = Ge(), o = en().addAfterRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
1888
- return pt(o), o;
1942
+ const n = Xe(), o = rn().addAfterRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
1943
+ return gt(o), o;
1889
1944
  };
1890
1945
  }
1891
- const no = tn("onBeforeRouteUpdate"), ro = tn("onBeforeRouteLeave"), oo = Ke("onAfterRouteEnter"), ao = Ke("onAfterRouteUpdate"), so = Ke("onAfterRouteLeave"), Gr = ["href"], Kr = /* @__PURE__ */ ie({
1946
+ const fo = on("onBeforeRouteUpdate"), lo = on("onBeforeRouteLeave"), ho = Ze("onAfterRouteEnter"), po = Ze("onAfterRouteUpdate"), mo = Ze("onAfterRouteLeave"), no = ["href"], ro = /* @__PURE__ */ le({
1892
1947
  __name: "routerLink",
1893
1948
  props: {
1894
1949
  to: {},
1895
- prefetch: { type: [Boolean, Object], default: void 0 },
1950
+ prefetch: { type: [Boolean, String, Object], default: void 0 },
1896
1951
  query: {},
1897
1952
  hash: {},
1898
1953
  replace: { type: Boolean },
1899
1954
  state: {}
1900
1955
  },
1901
1956
  setup(e) {
1902
- const t = e, n = Oe(), r = N(() => D(t.to) ? t.to : t.to(n.resolve)), o = N(() => {
1903
- const { to: h, ...P } = t;
1904
- return P;
1905
- }), { isMatch: a, isExactMatch: s, isExternal: u, push: i } = Fr(r, o), c = N(() => ({
1906
- "router-link--match": a.value,
1907
- "router-link--exact-match": s.value
1957
+ const t = e, n = De(), r = N(() => M(t.to) ? t.to : t.to(n.resolve)), o = N(() => {
1958
+ const { to: v, ...p } = t;
1959
+ return p;
1960
+ }), { element: a, isMatch: s, isExactMatch: c, isExternal: i, push: u } = Zr(r, o), f = N(() => ({
1961
+ "router-link--match": s.value,
1962
+ "router-link--exact-match": c.value
1908
1963
  }));
1909
- function f(h) {
1910
- h.preventDefault(), i();
1964
+ function h(v) {
1965
+ v.preventDefault(), u();
1911
1966
  }
1912
- return (h, P) => (dt(), un("a", {
1967
+ return (v, p) => (vt(), dn("a", {
1968
+ ref_key: "element",
1969
+ ref: a,
1913
1970
  href: r.value,
1914
- class: fn(["router-link", c.value]),
1915
- onClick: f
1971
+ class: mn(["router-link", f.value]),
1972
+ onClick: h
1916
1973
  }, [
1917
- mt(h.$slots, "default", gt(ln({ resolved: r.value, isMatch: ae(a), isExactMatch: ae(s), isExternal: ae(u) })))
1918
- ], 10, Gr));
1974
+ yt(v.$slots, "default", Rt(gn({ resolved: r.value, isMatch: ce(s), isExactMatch: ce(c), isExternal: ce(i) })))
1975
+ ], 10, no));
1919
1976
  }
1920
- }), zr = /* @__PURE__ */ ie({
1977
+ }), oo = /* @__PURE__ */ le({
1921
1978
  __name: "routerView",
1922
1979
  props: {
1923
1980
  name: { default: "default" }
1924
1981
  },
1925
1982
  setup(e) {
1926
- const t = Qr(), n = Wn(), r = Ge(), { getProps: o } = Xt(), a = hn("RouterView", !0);
1927
- pn(Zt, r + 1);
1983
+ const t = to(), n = Jn(), r = Xe(), { getProps: o } = tn(), a = vn("RouterView", !0);
1984
+ yn(nn, r + 1);
1928
1985
  const s = N(() => {
1929
1986
  if (n.value)
1930
1987
  return n.value.component;
1931
- const c = t.matches.at(r);
1932
- if (!c)
1988
+ const u = t.matches.at(r);
1989
+ if (!u)
1933
1990
  return null;
1934
- const f = u(c), h = o(c.id, e.name, t);
1935
- return f ? h ? Ln(f, () => h) : f : null;
1991
+ const f = c(u), h = o(u.id, e.name, t);
1992
+ return f ? h ? Vn(f, () => h) : f : null;
1936
1993
  });
1937
- function u(c) {
1938
- return i(c)[e.name];
1994
+ function c(u) {
1995
+ return i(u)[e.name];
1939
1996
  }
1940
- function i(c) {
1941
- return qe(c) ? c.components : Ve(c) ? { default: c.component } : typeof a == "string" ? {} : { default: a };
1997
+ function i(u) {
1998
+ return Me(u) ? u.components : _e(u) ? { default: u.component } : typeof a == "string" ? {} : { default: a };
1942
1999
  }
1943
- return (c, f) => s.value ? mt(c.$slots, "default", gt(dn({ key: 0 }, { route: ae(t), component: s.value, rejection: ae(n) })), () => [
1944
- (dt(), mn(gn(s.value)))
1945
- ]) : vn("", !0);
2000
+ return (u, f) => s.value ? yt(u.$slots, "default", Rt(Rn({ key: 0 }, { route: ce(t), component: s.value, rejection: ce(n) })), () => [
2001
+ (vt(), wn(Pn(s.value)))
2002
+ ]) : En("", !0);
1946
2003
  }
1947
2004
  });
1948
- function Yr(e) {
1949
- return le(e) && typeof e.value == "string";
2005
+ function ao(e) {
2006
+ return pe(e) && typeof e.value == "string";
1950
2007
  }
1951
- function ft(e) {
1952
- return Yr(e) ? e : Ft(e, {});
2008
+ function mt(e) {
2009
+ return ao(e) ? e : Gt(e, {});
1953
2010
  }
1954
- function co(e) {
1955
- const t = Me(), n = Je(e.name), r = Qt(e.path), o = Gt(e.query), a = Jt(e.hash), s = e.meta ?? {}, u = Un(e) ? ft(e.host) : ft(""), i = ve({ id: t, meta: {}, state: {}, ...e }), c = {
2011
+ function go(e) {
2012
+ const t = Je(), n = ze(e.name), r = zt(e.path), o = Yt(e.query), a = Kt(e.hash), s = e.meta ?? {}, c = Hn(e) ? mt(e.host) : mt(""), i = ye({ id: t, meta: {}, state: {}, ...e }), u = {
1956
2013
  id: t,
1957
2014
  matched: i,
1958
2015
  matches: [i],
1959
2016
  name: n,
1960
- host: u,
2017
+ host: c,
1961
2018
  path: r,
1962
2019
  query: o,
1963
2020
  hash: a,
1964
2021
  meta: s,
1965
2022
  depth: 1,
1966
2023
  state: {}
1967
- }, f = yt(e) ? Rt(e.parent, c) : c;
1968
- return re(f.path.params, f.query.params, f.host.params), f;
2024
+ }, f = Pt(e) ? Et(e.parent, u) : u;
2025
+ return oe(f.path.params, f.query.params, f.host.params), f;
1969
2026
  }
1970
2027
  export {
1971
- bn as DuplicateParamsError,
1972
- Kr as RouterLink,
1973
- Ae as RouterNotInstalledError,
1974
- zr as RouterView,
1975
- Dn as UseRouteInvalidError,
1976
- Xn as asUrl,
1977
- Ln as component,
1978
- co as createExternalRoute,
1979
- qn as createParam,
2028
+ Un as DuplicateParamsError,
2029
+ ro as RouterLink,
2030
+ he as RouterNotInstalledError,
2031
+ oo as RouterView,
2032
+ Fn as UseRouteInvalidError,
2033
+ rr as asUrl,
2034
+ Vn as component,
2035
+ go as createExternalRoute,
2036
+ Dn as createParam,
1980
2037
  ne as createRoute,
1981
- to as createRouter,
1982
- jn as isParamWithDefault,
1983
- Jr as isRoute,
1984
- D as isUrl,
1985
- oo as onAfterRouteEnter,
1986
- ao as onAfterRouteLeave,
1987
- so as onAfterRouteUpdate,
1988
- no as onBeforeRouteLeave,
1989
- ro as onBeforeRouteUpdate,
1990
- je as path,
1991
- ct as query,
1992
- Ut as routerInjectionKey,
1993
- At as routerRejectionKey,
1994
- Fr as useLink,
1995
- Wn as useRejection,
1996
- Qr as useRoute,
1997
- Oe as useRouter,
1998
- eo as withDefault
2038
+ io as createRouter,
2039
+ _n as isParamWithDefault,
2040
+ eo as isRoute,
2041
+ M as isUrl,
2042
+ ho as onAfterRouteEnter,
2043
+ po as onAfterRouteLeave,
2044
+ mo as onAfterRouteUpdate,
2045
+ fo as onBeforeRouteLeave,
2046
+ lo as onBeforeRouteUpdate,
2047
+ Oe as path,
2048
+ ht as query,
2049
+ Lt as routerInjectionKey,
2050
+ Bt as routerRejectionKey,
2051
+ Zr as useLink,
2052
+ Jn as useRejection,
2053
+ to as useRoute,
2054
+ De as useRouter,
2055
+ uo as withDefault
1999
2056
  };