@kitbag/router 0.13.2 → 0.13.4

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