@kitbag/router 0.13.1 → 0.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  var sn = Object.defineProperty;
2
2
  var cn = (e, t, n) => t in e ? sn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
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";
4
+ import { inject as re, toRefs as un, computed as N, reactive as Ue, defineComponent as le, h as ve, ref as qe, markRaw as ye, defineAsyncComponent as fn, onMounted as ln, onBeforeUnmount as hn, watch as je, toValue as se, toRef as pn, onUnmounted as mt, openBlock as gt, createElementBlock as dn, normalizeClass as mn, renderSlot as vt, normalizeProps as yt, 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
5
  class he extends Error {
6
6
  constructor() {
7
7
  super("Router not installed");
@@ -49,13 +49,13 @@ class Un extends Error {
49
49
  function Y(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
55
  function oe(...e) {
56
56
  const t = e.flatMap((n) => Array.isArray(n) ? n : Object.keys(n).map(Bn));
57
57
  for (const n of t)
58
- if (wt(t, n) > 1)
58
+ if (Rt(t, n) > 1)
59
59
  throw new Un(n);
60
60
  }
61
61
  function Bn(e) {
@@ -79,7 +79,7 @@ function Nn(e, t) {
79
79
  function Hn(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) {
@@ -91,7 +91,7 @@ function Me(e) {
91
91
  function jn(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
97
  path: Ln(e.path, t.path),
@@ -107,62 +107,39 @@ 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
- });
122
- }
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
110
  class Z extends Error {
134
111
  }
135
112
  const W = "[", G = "]";
136
- function On(e) {
113
+ function Vn(e) {
137
114
  return e !== String && e !== Boolean && e !== Number && e !== Date;
138
115
  }
139
- function qn(e) {
140
- return typeof e == "function" && On(e);
116
+ function $n(e) {
117
+ return typeof e == "function" && Vn(e);
141
118
  }
142
119
  function Be(e) {
143
120
  return typeof e == "object" && "get" in e && typeof e.get == "function" && "set" in e && typeof e.set == "function";
144
121
  }
145
- function _n(e) {
122
+ function On(e) {
146
123
  return Be(e) && e.defaultValue !== void 0;
147
124
  }
148
125
  function uo(e, t) {
149
- return Dn(e, t);
126
+ return Mn(e, t);
150
127
  }
151
- function Mn(e, t) {
128
+ function qn(e, t) {
152
129
  return e[t] ?? String;
153
130
  }
154
131
  const O = {
155
132
  invalid: (e) => {
156
133
  throw new Z(e);
157
134
  }
158
- }, Tn = {
135
+ }, _n = {
159
136
  get: (e) => e,
160
137
  set: (e, { invalid: t }) => {
161
138
  if (typeof e != "string")
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);
@@ -217,23 +194,23 @@ const O = {
217
194
  };
218
195
  function ue(e, t, n = !1) {
219
196
  if (e === void 0 || !de(e)) {
220
- if (_n(t))
197
+ if (On(t))
221
198
  return t.defaultValue;
222
199
  if (n)
223
200
  return;
224
201
  throw new Z();
225
202
  }
226
203
  if (t === String)
227
- return Tn.get(e, O);
204
+ return _n.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);
236
- if (qn(t))
212
+ return kt.get(e, O);
213
+ if ($n(t))
237
214
  return t(e, O);
238
215
  if (Be(t))
239
216
  return t.get(e, O);
@@ -251,13 +228,13 @@ function ie(e, t, n = !1) {
251
228
  throw new Z();
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 {
@@ -266,7 +243,7 @@ function ie(e, t, n = !1) {
266
243
  throw new Z();
267
244
  }
268
245
  }
269
- function Dn(e, t) {
246
+ function Mn(e, t) {
270
247
  return Be(e) ? { ...e, defaultValue: t ?? e.defaultValue } : {
271
248
  get: (n) => ue(n, e),
272
249
  set: (n) => ie(n, 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", Tn = "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 v = r.location, h = v.pathname, g = v.search, b = v.hash, S = o.state || {};
287
+ return [S.idx, ee({
288
+ pathname: h,
289
+ search: g,
290
+ hash: b,
291
+ state: S.usr || null,
292
+ key: S.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 v = 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 S = f - g;
304
+ S && (s = {
305
+ action: v,
306
+ location: b,
330
307
  retry: function() {
331
- A(b * -1);
308
+ x(S * -1);
332
309
  }
333
- }, A(b));
310
+ }, x(S));
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(v);
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 = te(), p = te();
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(v) {
329
+ return typeof v == "string" ? v : z(v);
353
330
  }
354
- function R(m, l) {
355
- return l === void 0 && (l = null), ee(Q({
356
- pathname: h.pathname,
331
+ function y(v, h) {
332
+ return h === void 0 && (h = null), ee(Q({
333
+ pathname: l.pathname,
357
334
  hash: "",
358
335
  search: ""
359
- }, typeof m == "string" ? fe(m) : m, {
360
- state: l,
336
+ }, typeof v == "string" ? fe(v) : v, {
337
+ state: h,
361
338
  key: Ee()
362
339
  }));
363
340
  }
364
- function y(m, l) {
341
+ function R(v, h) {
365
342
  return [{
366
- usr: m.state,
367
- key: m.key,
368
- idx: l
369
- }, k(m)];
343
+ usr: v.state,
344
+ key: v.key,
345
+ idx: h
346
+ }, P(v)];
370
347
  }
371
- function S(m, l, d) {
348
+ function k(v, h, g) {
372
349
  return !p.length || (p.call({
373
- action: m,
374
- location: l,
375
- retry: d
350
+ action: v,
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(v) {
356
+ u = v;
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(v, h) {
364
+ var g = H.Push, b = y(v, h);
365
+ function S() {
366
+ d(v, h);
390
367
  }
391
- if (S(d, E, b)) {
392
- var U = y(E, f + 1), C = U[0], j = U[1];
368
+ if (k(g, b, S)) {
369
+ var B = R(b, f + 1), C = B[0], j = B[1];
393
370
  try {
394
371
  o.pushState(C, "", 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(v, h) {
379
+ var g = H.Replace, b = y(v, h);
380
+ function S() {
381
+ E(v, 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 (k(g, b, S)) {
384
+ var B = R(b, f), C = B[0], j = B[1];
385
+ o.replaceState(C, "", j), A(g);
409
386
  }
410
387
  }
411
- function A(m) {
412
- o.go(m);
388
+ function x(v) {
389
+ o.go(v);
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
- function In(e) {
420
+ function Dn(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 || {};
424
+ var h = fe(r.location.hash.substr(1)), g = h.pathname, b = g === void 0 ? "/" : g, S = h.search, B = S === void 0 ? "" : S, C = h.hash, j = C === void 0 ? "" : C, q = o.state || {};
448
425
  return [q.idx, ee({
449
- pathname: E,
450
- search: U,
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], S = 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: S,
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(Tn, 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 = te(), p = te();
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, S = b.indexOf("#");
473
+ g = S === -1 ? b : b.slice(0, S);
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 y(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 R(h, g) {
481
+ return g === void 0 && (g = null), ee(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" ? fe(h) : h, {
486
+ state: g,
510
487
  key: Ee()
511
488
  }));
512
489
  }
513
- function S(l, d) {
490
+ function k(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
+ }, y(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, S = R(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(S.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(h) + ")"), A(b, S, B)) {
518
+ var C = k(S, f + 1), j = C[0], q = C[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, S = R(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(S.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(h) + ")"), A(b, S, B)) {
533
+ var C = k(S, f), j = C[0], q = C[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 v = {
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
- createHref: R,
571
- push: P,
572
- replace: A,
573
- go: x,
547
+ createHref: y,
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 v;
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 = ee(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" ? fe(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 = te(), f = te();
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), ee(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" ? fe(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 y(d, E) {
608
+ var x = H.Push, U = m(d, E);
609
+ function v() {
610
+ y(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, v) && (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 R(d, E) {
615
+ var x = H.Replace, U = m(d, E);
616
+ function v() {
617
+ R(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, v) && (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 k(d) {
622
+ var E = st(s + d, 0, a.length - 1), x = H.Pop, U = a[E];
623
+ function v() {
624
+ k(d);
648
625
  }
649
- p(A, x, m) && (s = P, k(A, x));
626
+ p(x, U, v) && (s = E, P(x, U));
650
627
  }
651
- var B = {
628
+ var A = {
652
629
  get index() {
653
630
  return s;
654
631
  },
@@ -656,28 +633,28 @@ function st(e) {
656
633
  return c;
657
634
  },
658
635
  get location() {
659
- return i;
636
+ return u;
660
637
  },
661
- createHref: h,
662
- push: R,
663
- replace: y,
664
- go: S,
638
+ createHref: l,
639
+ push: y,
640
+ replace: R,
641
+ go: k,
665
642
  back: function() {
666
- S(-1);
643
+ k(-1);
667
644
  },
668
645
  forward: function() {
669
- S(1);
646
+ k(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) {
@@ -720,7 +697,7 @@ function fe(e) {
720
697
  }
721
698
  return t;
722
699
  }
723
- class Fn extends Error {
700
+ class Wn extends Error {
724
701
  /**
725
702
  * Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
726
703
  * This detailed error message aids in quickly identifying and resolving mismatches in route usage.
@@ -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();
735
- function Jn() {
736
- const e = re(Bt);
711
+ const xt = Symbol();
712
+ function In() {
713
+ const e = re(xt);
737
714
  if (!e)
738
715
  throw new he();
739
716
  return e;
740
717
  }
741
- const Lt = Symbol();
718
+ const Ut = Symbol();
742
719
  function De() {
743
- const e = re(Lt);
720
+ const e = re(Ut);
744
721
  if (!e)
745
722
  throw new he();
746
723
  return e;
747
724
  }
748
- const Ct = Symbol("isRouterRouteSymbol");
749
- function Qn(e) {
750
- return typeof e == "object" && e !== null && Ct in e;
725
+ const Bt = Symbol("isRouterRouteSymbol");
726
+ function Fn(e) {
727
+ return typeof e == "object" && e !== null && Bt in e;
751
728
  }
752
- function Gn(e, t) {
753
- function n(R, y, S) {
754
- if (typeof R == "object") {
755
- const g = {
729
+ function Jn(e, t) {
730
+ function n(y, R, k) {
731
+ if (typeof y == "object") {
732
+ const d = {
756
733
  ...e.params,
757
- ...R
734
+ ...y
758
735
  };
759
- return t(e.name, g, y);
736
+ return t(e.name, d, R);
760
737
  }
761
- const B = {
738
+ const A = {
762
739
  ...e.params,
763
- [R]: y
740
+ [y]: R
764
741
  };
765
- return t(e.name, B, S);
766
- }
767
- const r = (...R) => {
768
- const y = new URLSearchParams(e.query.toString());
769
- y.set(...R), n({}, { query: y });
770
- }, o = (...R) => {
771
- const y = new URLSearchParams(e.query.toString());
772
- y.append(...R), n({}, { query: y });
773
- }, 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({
742
+ return t(e.name, A, k);
743
+ }
744
+ const r = (...y) => {
745
+ const R = new URLSearchParams(e.query.toString());
746
+ R.set(...y), n({}, { query: R });
747
+ }, o = (...y) => {
748
+ const R = new URLSearchParams(e.query.toString());
749
+ R.append(...y), n({}, { query: R });
750
+ }, a = (...y) => {
751
+ const R = new URLSearchParams(e.query.toString());
752
+ R.delete(...y), n({}, { query: R });
753
+ }, { id: s, matched: c, matches: u, name: i, hash: f } = un(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(y, R, k) {
757
+ return n(R, k), !0;
781
758
  }
782
759
  });
783
760
  },
784
- set(R) {
785
- n(R);
761
+ set(y) {
762
+ n(y);
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(y, R, k) {
768
+ switch (R) {
792
769
  case "append":
793
770
  return o;
794
771
  case "set":
@@ -796,47 +773,47 @@ 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(y, R, k);
800
777
  }
801
778
  }
802
779
  });
803
780
  },
804
- set(R) {
805
- n({}, { query: R });
781
+ set(y) {
782
+ n({}, { query: y });
806
783
  }
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(y, R, k) {
788
+ return n({}, { state: { ...e.state, [R]: k } }), !0;
812
789
  }
813
790
  });
814
791
  },
815
- set(R) {
816
- n({}, { state: R });
792
+ set(y) {
793
+ n({}, { state: y });
817
794
  }
818
795
  });
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();
833
- function Kn(e, t) {
809
+ const Lt = Symbol();
810
+ function Qn(e, t) {
834
811
  const n = Ue({ ...e }), r = (s) => {
835
812
  Object.assign(n, {
836
- [Nt]: !1,
813
+ [Lt]: !1,
837
814
  ...s
838
815
  });
839
- }, o = n, a = Gn(o, t);
816
+ }, o = n, a = Jn(o, t);
840
817
  return {
841
818
  currentRoute: o,
842
819
  routerRoute: a,
@@ -844,9 +821,9 @@ function Kn(e, t) {
844
821
  };
845
822
  }
846
823
  function T(e) {
847
- return !e.startsWith("http") ? Yn(e) : zn(e);
824
+ return !e.startsWith("http") ? Kn(e) : Gn(e);
848
825
  }
849
- function zn(e) {
826
+ function Gn(e) {
850
827
  const { protocol: t, host: n, pathname: r, search: o, searchParams: a, hash: s } = new URL(e, e);
851
828
  return {
852
829
  protocol: t,
@@ -857,7 +834,7 @@ function zn(e) {
857
834
  hash: s
858
835
  };
859
836
  }
860
- function Yn(e) {
837
+ function Kn(e) {
861
838
  const { pathname: t, search: n, searchParams: r, hash: o } = new URL(e, "https://localhost");
862
839
  return {
863
840
  pathname: t,
@@ -866,22 +843,22 @@ function Yn(e) {
866
843
  hash: o
867
844
  };
868
845
  }
869
- function Xn(e) {
846
+ function zn(e) {
870
847
  return (t) => {
871
848
  const { host: n } = T(t);
872
849
  return !(n === void 0 || n === e);
873
850
  };
874
851
  }
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);
852
+ function Yn({ mode: e, listener: t }) {
853
+ const n = Xn(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 {
@@ -896,16 +873,16 @@ function Zn({ mode: e, listener: t }) {
896
873
  }
897
874
  };
898
875
  }
899
- function er(e = "auto") {
876
+ function Xn(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
- return In();
885
+ return Dn();
909
886
  default:
910
887
  const t = e;
911
888
  throw new Error(`Switch is not exhaustive for mode: ${t}`);
@@ -921,7 +898,7 @@ class be {
921
898
  _(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
922
899
  }
923
900
  }
924
- class Ht extends Error {
901
+ class Ct extends Error {
925
902
  constructor() {
926
903
  super("Uncaught CallbackContextAbortError");
927
904
  _(this, "response");
@@ -942,7 +919,7 @@ class Se extends Error {
942
919
  this.response = { status: "REJECT", type: n };
943
920
  }
944
921
  }
945
- function tr(e, t) {
922
+ function Zn(e, t) {
946
923
  const n = new be();
947
924
  return e.matches.forEach((r, o) => {
948
925
  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));
@@ -950,7 +927,7 @@ function tr(e, t) {
950
927
  r.onBeforeRouteLeave && Ie(e, t, o) && Y(r.onBeforeRouteLeave).forEach((a) => n.onBeforeRouteLeave.add(a));
951
928
  }), n;
952
929
  }
953
- function nr(e, t) {
930
+ function er(e, t) {
954
931
  const n = new be();
955
932
  return e.matches.forEach((r, o) => {
956
933
  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));
@@ -961,40 +938,40 @@ function nr(e, t) {
961
938
  function M(e) {
962
939
  return typeof e != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(e);
963
940
  }
964
- function rr(e) {
941
+ function tr(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
948
  throw new X(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 X([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 X([o, c, { ...u, replace: !0 }]);
979
956
  }, abort: () => {
980
- throw new Ht();
957
+ throw new Ct();
981
958
  } };
982
959
  }
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
- ...h.onBeforeRouteEnter,
989
- ...u.onBeforeRouteUpdate,
990
- ...h.onBeforeRouteUpdate,
960
+ function nr() {
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 = Zn(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 X || p instanceof Se || p instanceof Ct)
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 = er(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,
@@ -1057,7 +1034,7 @@ 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":
@@ -1072,30 +1049,30 @@ function ut(e) {
1072
1049
  throw new Error(`Switch is not exhaustive for lifecycle: ${e}`);
1073
1050
  }
1074
1051
  }
1075
- function ar() {
1052
+ function rr() {
1076
1053
  const e = {
1077
1054
  global: new be(),
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();
1097
- function sr() {
1098
- const e = ar();
1073
+ const Ht = Symbol();
1074
+ function or() {
1075
+ const e = rr();
1099
1076
  return {
1100
1077
  onBeforeRouteEnter: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
1101
1078
  onBeforeRouteUpdate: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
@@ -1106,13 +1083,13 @@ function sr() {
1106
1083
  hooks: e
1107
1084
  };
1108
1085
  }
1109
- function cr(e) {
1086
+ function ar(e) {
1110
1087
  return le(() => () => ve("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,19 +1113,19 @@ 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();
1144
- function ur({
1120
+ const Je = Vt();
1121
+ function sr({
1145
1122
  rejections: e
1146
1123
  }) {
1147
1124
  const t = (a) => {
1148
1125
  const s = {
1149
1126
  ...e
1150
1127
  };
1151
- return ye(s[a] ?? cr(a));
1128
+ return ye(s[a] ?? ar(a));
1152
1129
  }, n = (a) => {
1153
1130
  const s = ye(t(a)), c = {
1154
1131
  id: Je(),
@@ -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
+ [Lt]: !0
1168
1145
  };
1169
1146
  }, r = (a) => {
1170
1147
  if (!a) {
@@ -1180,7 +1157,7 @@ function ur({
1180
1157
  getRejectionRoute: n
1181
1158
  };
1182
1159
  }
1183
- class ir extends Error {
1160
+ class cr extends Error {
1184
1161
  constructor(t) {
1185
1162
  super(`Route not found: "${t}"`);
1186
1163
  }
@@ -1188,256 +1165,256 @@ class ir extends Error {
1188
1165
  function Qe(e) {
1189
1166
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1190
1167
  }
1191
- function fr(e, t) {
1168
+ function ur(e, t) {
1192
1169
  const n = Array.from(e.matchAll(t));
1193
1170
  if (n.length === 0)
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
- function lr(e) {
1205
- const t = qt(e.path.value);
1181
+ function ir(e) {
1182
+ const t = $t(e.path.value);
1206
1183
  return new RegExp(`^${t}$`, "i");
1207
1184
  }
1208
- function hr(e) {
1185
+ function fr(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 ur(e, new RegExp(lr, "g")).map((t) => t.startsWith(W) ? Ot(t) : Qe(t)).join("");
1217
1194
  }
1218
- function _t(e) {
1195
+ function Ot(e) {
1219
1196
  return [
1220
- dr,
1221
- mr
1197
+ hr,
1198
+ pr
1222
1199
  ].reduce((t, n) => n(t), e);
1223
1200
  }
1224
- const pr = `\\${W}\\??([\\w-_]+)\\${G}`, Ge = `\\${W}\\?([\\w-_]+)\\${G}`, Mt = `\\${W}([\\w-_]+)\\${G}`;
1225
- function dr(e) {
1201
+ const lr = `\\${W}\\??([\\w-_]+)\\${G}`, Ge = `\\${W}\\?([\\w-_]+)\\${G}`, qt = `\\${W}([\\w-_]+)\\${G}`;
1202
+ function hr(e) {
1226
1203
  return e.replace(new RegExp(Ge, "g"), ".*");
1227
1204
  }
1228
1205
  function Ve(e) {
1229
1206
  return new RegExp(Ge, "g").test(e);
1230
1207
  }
1231
- function mr(e) {
1232
- return e.replace(new RegExp(Mt, "g"), ".+");
1208
+ function pr(e) {
1209
+ return e.replace(new RegExp(qt, "g"), ".+");
1233
1210
  }
1234
1211
  function Le(e) {
1235
- const [t] = ke(e, new RegExp(Ge, "g")), [n] = ke(e, new RegExp(Mt, "g"));
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
1216
  return Array.from(e.matchAll(t)).flatMap(([, ...r]) => r.map((o) => de(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, () => ie(o, r, n.startsWith("?"))), e);
1250
1227
  }
1251
- function Wt(e, t) {
1228
+ function Tt(e, t) {
1252
1229
  const n = [
1253
- gr,
1254
- vr,
1255
- _t
1230
+ dr,
1231
+ mr,
1232
+ Ot
1256
1233
  ].reduce((r, o) => o(r, t), e);
1257
1234
  return new RegExp(n, "g");
1258
1235
  }
1259
- function gr(e, t) {
1236
+ function dr(e, t) {
1260
1237
  if (!t.startsWith("?"))
1261
1238
  return e;
1262
1239
  const n = new RegExp(`\\${W}\\${t}\\${G}`, "g");
1263
1240
  return e.replace(n, "(.*)");
1264
1241
  }
1265
- function vr(e, t) {
1242
+ function mr(e, t) {
1266
1243
  if (t.startsWith("?"))
1267
1244
  return e;
1268
1245
  const n = new RegExp(`\\${W}${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 Dt({ 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
- return rr(c);
1252
+ return tr(c);
1276
1253
  }
1277
- function yr(e, t) {
1254
+ function gr(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
- 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 });
1260
+ function vr(e, t = {}) {
1261
+ const { params: n = {}, query: r } = t, o = wr(e.query, n), a = gr(o, r), s = Rr(e.path, n), c = Re(e.hash.value ?? t.hash).value, u = yr(e.host, n), { protocol: i, host: f } = T(u);
1262
+ return Dt({ protocol: i, host: f, pathname: s, searchParams: a, hash: c });
1286
1263
  }
1287
- function wr(e, t) {
1264
+ function yr(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
1267
  const s = Le(`${W}${o}${G}`);
1291
- return s ? Dt(r, { name: o, param: a, value: t[s] }) : r;
1268
+ return s ? Mt(r, { name: o, param: a, value: t[s] }) : r;
1292
1269
  }, n);
1293
1270
  }
1294
- function Pr(e, t) {
1271
+ function Rr(e, t) {
1295
1272
  return Object.entries(e.params).reduce((n, [r, o]) => {
1296
1273
  const a = Le(`${W}${r}${G}`);
1297
- return a ? Dt(n, { name: r, param: o, value: t[a] }) : n;
1274
+ return a ? Mt(n, { name: r, param: o, value: t[a] }) : n;
1298
1275
  }, e.value);
1299
1276
  }
1300
- function Er(e, t) {
1277
+ function wr(e, t) {
1301
1278
  const n = new URLSearchParams(e.value);
1302
1279
  if (!e.value)
1303
1280
  return n;
1304
- for (const [r, o] of n.entries()) {
1281
+ for (const [r, o] of Array.from(n.entries())) {
1305
1282
  const a = Le(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 = ie(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
- function br(e) {
1290
+ function Pr(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
+ }), Dt({ ...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
- throw new ir(String(t));
1324
- return Rr(s, {
1300
+ throw new cr(String(t));
1301
+ return vr(s, {
1325
1302
  params: o,
1326
1303
  query: a.query,
1327
1304
  hash: a.hash
1328
1305
  });
1329
1306
  };
1330
1307
  }
1331
- class Sr extends Error {
1308
+ class Er extends Error {
1332
1309
  constructor() {
1333
1310
  super("initialUrl must be set if window.location is unavailable");
1334
1311
  }
1335
1312
  }
1336
- function kr(e) {
1313
+ function br(e) {
1337
1314
  if (e)
1338
1315
  return e;
1339
1316
  if (Te())
1340
1317
  return window.location.toString();
1341
- throw new Sr();
1318
+ throw new Er();
1342
1319
  }
1343
- const Ar = (e, t) => {
1320
+ const Sr = (e, t) => {
1344
1321
  try {
1345
- Ft(e, t);
1322
+ Wt(e, t);
1346
1323
  } catch {
1347
1324
  return !1;
1348
1325
  }
1349
1326
  return !0;
1350
- }, Ft = (e, t) => {
1327
+ }, Wt = (e, t) => {
1351
1328
  const { pathname: n, search: r } = T(t);
1352
1329
  return {
1353
- ...xr(e.path, n),
1354
- ...Ur(e.query, r)
1330
+ ...kr(e.path, n),
1331
+ ...Ar(e.query, r)
1355
1332
  };
1356
1333
  };
1357
- function xr(e, t) {
1334
+ function kr(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 = ue(u, a, s);
1338
+ n[c] = i;
1362
1339
  }
1363
1340
  return n;
1364
1341
  }
1365
- function Ur(e, t) {
1342
+ function Ar(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 = ue(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 xr = (e) => "name" in e.matched && !!e.matched.name, Ur = (e, t) => {
1374
1351
  const { pathname: n } = T(t);
1375
- return lr(e).test(n);
1376
- }, Cr = (e, t) => {
1352
+ return ir(e).test(n);
1353
+ }, Br = (e, t) => {
1377
1354
  const { search: n } = T(t);
1378
- return hr(e).every((o) => o.test(n));
1355
+ return fr(e).every((o) => o.test(n));
1379
1356
  }, $e = (e, t) => {
1380
1357
  const { hash: n } = T(t), { value: r } = e.hash;
1381
1358
  return r === void 0 || `#${r.toLowerCase()}` === n.toLowerCase();
1382
1359
  };
1383
- function Nr(e) {
1360
+ function Lr(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
- function Hr(e, t, n) {
1403
- if (Jt(e) && t in e) {
1379
+ function Cr(e, t, n) {
1380
+ if (It(e) && t in e) {
1404
1381
  const r = e[t];
1405
1382
  if (typeof r == "string")
1406
1383
  return ue(r, n, Ae);
1407
1384
  }
1408
1385
  return ue(void 0, n, Ae);
1409
1386
  }
1410
- function jr(e, t) {
1387
+ function Nr(e, t) {
1411
1388
  const n = {};
1412
1389
  for (const [r, o] of Object.entries(e)) {
1413
- const a = Hr(t, r, o);
1390
+ const a = Cr(t, r, o);
1414
1391
  n[r] = a;
1415
1392
  }
1416
1393
  return n;
1417
1394
  }
1418
- function Vr(e, t, n) {
1419
- if (Jt(e) && t in e) {
1395
+ function Hr(e, t, n) {
1396
+ if (It(e) && t in e) {
1420
1397
  const r = e[t];
1421
1398
  return ie(r, n, Ae);
1422
1399
  }
1423
1400
  return ie(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
- const a = Vr(t, r, o);
1405
+ const a = Hr(t, r, o);
1429
1406
  n[r] = a;
1430
1407
  }
1431
1408
  return n;
1432
- }, $r = [
1409
+ }, jr = [
1410
+ xr,
1411
+ Ur,
1433
1412
  Br,
1434
- Lr,
1435
- Cr,
1436
1413
  $e,
1437
- Ar
1414
+ Sr
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 = Lr(t), o = e.filter((u) => jr.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,9 +1423,9 @@ 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),
1451
- state: jr(a.state, n),
1426
+ query: jt(s),
1427
+ params: Wt(a, t),
1428
+ state: Nr(a.state, n),
1452
1429
  hash: c
1453
1430
  };
1454
1431
  }
@@ -1458,8 +1435,8 @@ function Ke(e, t) {
1458
1435
  const c = Le(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 = qn(t, c);
1439
+ return oe([c], o), o[s] = u, o;
1463
1440
  }, {});
1464
1441
  }
1465
1442
  function Oe(e, t) {
@@ -1468,7 +1445,7 @@ function Oe(e, t) {
1468
1445
  params: Ke(e, t)
1469
1446
  };
1470
1447
  }
1471
- function Or(e, t) {
1448
+ function Vr(e, t) {
1472
1449
  return de(t) ? e.map((n) => {
1473
1450
  const r = `${t}${n.path.value}`;
1474
1451
  return {
@@ -1477,7 +1454,7 @@ function Or(e, t) {
1477
1454
  };
1478
1455
  }) : e;
1479
1456
  }
1480
- class qr extends Error {
1457
+ class $r extends Error {
1481
1458
  /**
1482
1459
  * Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
1483
1460
  * @param name - The name of the name that was duplicated.
@@ -1486,13 +1463,13 @@ class qr extends Error {
1486
1463
  super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`);
1487
1464
  }
1488
1465
  }
1489
- function _r(e) {
1466
+ function Or(e) {
1490
1467
  const t = e.map(({ name: n }) => n);
1491
1468
  for (const n of t)
1492
- if (wt(t, n) > 1)
1493
- throw new qr(n);
1469
+ if (Rt(t, n) > 1)
1470
+ throw new $r(n);
1494
1471
  }
1495
- function Mr() {
1472
+ function qr() {
1496
1473
  const e = Ue(/* @__PURE__ */ new Map()), t = Te() ? s() : null, n = (c) => {
1497
1474
  e.set(c, !1), t == null || t.observe(c);
1498
1475
  }, r = (c) => {
@@ -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,49 +1491,53 @@ function Mr() {
1514
1491
  isElementVisible: a
1515
1492
  };
1516
1493
  }
1517
- const Qt = Symbol("visibilityObserver");
1518
- function Tr() {
1519
- const e = re(Qt);
1494
+ const Ft = Symbol("visibilityObserver");
1495
+ function _r() {
1496
+ const e = re(Ft);
1520
1497
  if (!e)
1521
1498
  throw new he();
1522
1499
  return e;
1523
1500
  }
1524
1501
  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({
1502
+ const n = bn(e) ? e.flat() : e, r = Vr(n, t == null ? void 0 : t.base);
1503
+ Or(r);
1504
+ const o = Vt(), a = Qr(), s = qr(), c = Pr(r), u = Yn({
1528
1505
  mode: t == null ? void 0 : t.historyMode,
1529
1506
  listener: ({ location: w }) => {
1530
1507
  const L = z(w);
1531
- B(L, { state: w.state, replace: !0 });
1508
+ A(L, { state: w.state, replace: !0 });
1532
1509
  }
1533
- }), { runBeforeRouteHooks: u, runAfterRouteHooks: f } = or(), {
1534
- hooks: h,
1535
- onBeforeRouteEnter: v,
1510
+ }), { runBeforeRouteHooks: i, runAfterRouteHooks: f } = nr(), {
1511
+ hooks: l,
1512
+ onBeforeRouteEnter: m,
1536
1513
  onAfterRouteUpdate: p,
1537
- onBeforeRouteLeave: k,
1538
- onAfterRouteEnter: R,
1539
- onBeforeRouteUpdate: y,
1540
- onAfterRouteLeave: S
1541
- } = sr();
1542
- async function B(w, L = {}) {
1514
+ onBeforeRouteLeave: P,
1515
+ onAfterRouteEnter: y,
1516
+ onBeforeRouteUpdate: R,
1517
+ onAfterRouteLeave: k
1518
+ } = or();
1519
+ async function A(w, L = {}) {
1543
1520
  const I = o();
1544
- if (i.stopListening(), Ce(w)) {
1545
- i.update(w, L);
1521
+ if (u.stopListening(), Ce(w)) {
1522
+ u.update(w, L);
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, L.state) ?? g("NotFound"), me = { ...S }, F = await i({ to: V, from: me, 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, L), 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, L), v(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, L), v(null);
1560
1541
  break;
1561
1542
  default:
1562
1543
  throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(F)}`);
@@ -1568,23 +1549,23 @@ function io(e, t) {
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
+ v($.type);
1575
1556
  break;
1576
1557
  default:
1577
1558
  const ae = $;
1578
1559
  throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(ae)}`);
1579
1560
  }
1580
1561
  }), C(V);
1581
- const J = await f({ to: V, from: me, hooks: h });
1562
+ const J = await f({ to: V, from: me, 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
+ v(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, L, I) => {
1598
1579
  if (M(w)) {
1599
1580
  const $ = { ...L }, ae = c(w, $);
1600
- return B(ae, $);
1581
+ return A(ae, $);
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, L ?? {}, V), D = nt(w), J = ft((D == null ? void 0 : D.state) ?? {}, V.state);
1584
+ return A(F, { ...V, state: J });
1585
+ }, E = (w, L, I) => {
1605
1586
  if (M(w)) {
1606
1587
  const $ = { ...L, replace: !0 }, ae = c(w, $);
1607
- return B(ae, $);
1588
+ return A(ae, $);
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, L ?? {}, V), D = nt(w), J = ft((D == null ? void 0 : D.state) ?? {}, V.state);
1591
+ return A(F, { ...V, state: J });
1592
+ }, x = (w) => {
1593
+ v(w);
1594
+ }, U = (w, L = {}) => {
1614
1595
  if (!M(w)) {
1615
1596
  const I = c(w, L);
1616
1597
  return Ne(r, I);
1617
1598
  }
1618
1599
  if (!Ce(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);
1626
- }
1627
- function rt(w) {
1601
+ }, { setRejection: v, rejection: h, getRejectionRoute: g } = sr(t ?? {}), b = g("NotFound"), { currentRoute: S, routerRoute: B, updateRoute: C } = Qn(b, d);
1602
+ u.startListening();
1603
+ const j = br(t == null ? void 0 : t.initialUrl), q = u.location.state, { host: Ze } = T(j), Ce = zn(Ze);
1604
+ let et = !1;
1605
+ async function tt() {
1606
+ et || (await A(j, { replace: !0, state: q }), et = !0);
1607
+ }
1608
+ function nt(w) {
1628
1609
  return r.find((L) => L.name === w);
1629
1610
  }
1630
1611
  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();
1612
+ w.component("RouterView", oo), w.component("RouterLink", to), 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,
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,
1644
1625
  install: an,
1645
1626
  isExternal: Ce,
1646
- onBeforeRouteEnter: v,
1627
+ onBeforeRouteEnter: m,
1647
1628
  onAfterRouteUpdate: p,
1648
- onBeforeRouteLeave: k,
1649
- onAfterRouteEnter: R,
1650
- onBeforeRouteUpdate: y,
1651
- onAfterRouteLeave: S,
1629
+ onBeforeRouteLeave: P,
1630
+ onAfterRouteEnter: y,
1631
+ onBeforeRouteUpdate: R,
1632
+ onAfterRouteLeave: k,
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) {
1650
+ function Mr(e) {
1670
1651
  return pe(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() : Mr(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) {
1659
+ function Tr(e) {
1679
1660
  return pe(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("", {}) : Tr(e) ? e : Oe(e, {});
1683
1664
  }
1684
- function Ir(e) {
1665
+ function Dr(e) {
1685
1666
  return pe(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("", {}) : Dr(e) ? e : lt(e, {});
1689
1670
  }
1690
1671
  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 = {
1672
+ const t = Je(), n = Gt(e.name), r = Kt(e.path), o = zt(e.query), a = Qt(e.hash), s = e.meta ?? {}, c = jn(e) ? e.state : {}, u = ye({ 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,25 +1680,25 @@ 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;
1685
+ }, f = wt(e) ? Pt(e.parent, i) : i;
1705
1686
  return oe(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 = ne({
1708
1689
  name: "parentA",
1709
1690
  path: "/parentA/[paramA]"
1710
- }), Xt = ne({
1711
- parent: Ye,
1691
+ }), Yt = ne({
1692
+ parent: ze,
1712
1693
  name: "parentA.childA",
1713
1694
  path: "/[?paramB]"
1714
- }), Fr = ne({
1715
- parent: Ye,
1695
+ }), Wr = ne({
1696
+ parent: ze,
1716
1697
  name: "parentA.childB",
1717
1698
  path: "/[paramD]",
1718
1699
  component: xe
1719
- }), Jr = ne({
1720
- parent: Xt,
1700
+ }), Ir = ne({
1701
+ parent: Yt,
1721
1702
  name: "parentA.childA.grandChildA",
1722
1703
  path: "/[paramC]",
1723
1704
  component: xe
@@ -1731,94 +1712,105 @@ ne({
1731
1712
  path: "/",
1732
1713
  component: xe
1733
1714
  });
1734
- const Qr = "eager", Gr = {
1715
+ const Fr = "lazy", Jr = {
1735
1716
  components: !0,
1736
1717
  props: !1
1737
1718
  };
1738
1719
  function ge(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
- Gr[r],
1747
- 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);
1727
+ Jr[r],
1728
+ Fr
1729
+ ].reduce((u, i) => ge(u) ? u : u === !0 && ge(i) ? i : u === !0 && !ge(i) ? u : u === void 0 ? i : u, void 0);
1749
1730
  return ge(c) ? c : !1;
1750
1731
  }
1751
1732
  function He(e, t) {
1752
1733
  return pe(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
- 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);
1747
+ function Qr() {
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: y, name: R, props: k }) => {
1749
+ if (!k)
1750
+ return P;
1751
+ const A = u(y, R, m), d = ht(() => k(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: y, name: R, props: k } of m) {
1764
+ if (!k)
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(y, R, l);
1767
+ if (p.push(A), !e.has(A)) {
1768
+ const d = ht(() => k(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 (y) {
1785
+ if (y instanceof X || y instanceof Se)
1786
+ return y.response;
1787
+ throw y;
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() {
@@ -1827,15 +1819,15 @@ function tn() {
1827
1819
  throw new he();
1828
1820
  return e;
1829
1821
  }
1830
- const zr = fn(() => new Promise((e) => {
1822
+ const Gr = fn(() => new Promise((e) => {
1831
1823
  e({ default: { template: "foo" } });
1832
1824
  }));
1833
- function dt(e) {
1834
- return e.name === zr.name && "setup" in e;
1825
+ function pt(e) {
1826
+ return e.name === Gr.name && "setup" in e;
1835
1827
  }
1836
- 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), {});
1828
+ function Kr(e) {
1829
+ const t = /* @__PURE__ */ new Map(), n = qe(), { getPrefetchProps: r, setPrefetchProps: o } = tn(), { observe: a, unobserve: s, isElementVisible: c } = _r(), u = () => {
1830
+ const f = Array.from(t.values()).reduce((l, m) => (Object.assign(l, m), l), {});
1839
1831
  o(f);
1840
1832
  };
1841
1833
  ln(() => {
@@ -1846,100 +1838,91 @@ function Yr(e) {
1846
1838
  a(n.value);
1847
1839
  }), hn(() => {
1848
1840
  n.value && s(n.value);
1849
- }), je(() => se(e), ({ route: f, ...h }) => {
1850
- t.clear(), f && u("eager", f, h);
1841
+ }), je(() => se(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 } = se(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
+ zr(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
- function Xr(e, t, n) {
1855
+ function zr(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
  }
1873
- function Zr(e, t = {}, n = {}) {
1865
+ function Yr(e, t = {}, n = {}) {
1874
1866
  const r = De(), o = pn(e), a = N(() => M(o.value) ? {} : se(t)), s = N(() => M(o.value) ? se(t) : se(n)), c = N(() => {
1875
1867
  if (M(o.value))
1876
1868
  return o.value;
1877
1869
  try {
1878
1870
  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;
1871
+ } catch (R) {
1872
+ throw R instanceof Z && console.error(`Failed to resolve route "${o.value.toString()}" in RouterLink.`, R), R;
1881
1873
  }
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,
1874
+ }), u = N(() => r.find(c.value, s.value)), i = N(() => !!u.value && r.route.matches.includes(u.value.matched)), f = N(() => !!u.value && r.route.matched === u.value.matched), l = N(() => r.isExternal(c.value)), { element: m, commit: p } = Kr(() => ({
1875
+ route: u.value,
1884
1876
  routerPrefetch: r.prefetch,
1885
1877
  linkPrefetch: s.value.prefetch
1886
- })), k = (y) => (p(), r.push(c.value, { ...s.value, ...y }));
1878
+ })), P = (R) => (p(), r.push(c.value, { ...s.value, ...R }));
1887
1879
  return {
1888
- element: v,
1889
- route: i,
1880
+ element: m,
1881
+ route: u,
1890
1882
  href: c,
1891
- isMatch: u,
1883
+ isMatch: i,
1892
1884
  isExactMatch: f,
1893
- isExternal: h,
1894
- push: k,
1895
- replace: (y) => k(y)
1885
+ isExternal: l,
1886
+ push: P,
1887
+ replace: (R) => P(R)
1896
1888
  };
1897
1889
  }
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);
1890
+ function Xr(e, t, { exact: n } = {}) {
1891
+ return Fn(e) ? t === void 0 ? !0 : n ? e.matched.name === t : e.matches.map((r) => r.name).includes(t) : !1;
1909
1892
  }
1910
- function to(e, t) {
1893
+ function Zr(e, t) {
1911
1894
  const n = De();
1912
1895
  function r() {
1913
1896
  if (!e)
1914
1897
  return;
1915
- if (!eo(n.route, e, t))
1916
- throw new Fn(e, n.route.name);
1898
+ if (!Xr(n.route, e, t))
1899
+ throw new Wn(e, n.route.name);
1917
1900
  }
1918
1901
  return je(n.route, r, { immediate: !0, deep: !0 }), n.route;
1919
1902
  }
1920
1903
  const nn = Symbol();
1921
- function Xe() {
1904
+ function Ye() {
1922
1905
  return re(nn, 0);
1923
1906
  }
1924
1907
  function rn() {
1925
- const e = re(Vt);
1908
+ const e = re(Ht);
1926
1909
  if (!e)
1927
1910
  throw new he();
1928
1911
  return e;
1929
1912
  }
1930
1913
  function on(e) {
1931
1914
  return (t) => {
1932
- const n = Xe(), o = rn().addBeforeRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
1933
- return gt(o), o;
1915
+ const n = Ye(), o = rn().addBeforeRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
1916
+ return mt(o), o;
1934
1917
  };
1935
1918
  }
1936
- function Ze(e) {
1919
+ function Xe(e) {
1937
1920
  return (t) => {
1938
- const n = Xe(), o = rn().addAfterRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
1939
- return gt(o), o;
1921
+ const n = Ye(), o = rn().addAfterRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
1922
+ return mt(o), o;
1940
1923
  };
1941
1924
  }
1942
- const fo = on("onBeforeRouteUpdate"), lo = on("onBeforeRouteLeave"), ho = Ze("onAfterRouteEnter"), po = Ze("onAfterRouteUpdate"), mo = Ze("onAfterRouteLeave"), no = ["href"], ro = /* @__PURE__ */ le({
1925
+ const fo = on("onBeforeRouteUpdate"), lo = on("onBeforeRouteLeave"), ho = Xe("onAfterRouteEnter"), po = Xe("onAfterRouteUpdate"), mo = Xe("onAfterRouteLeave"), eo = ["href"], to = /* @__PURE__ */ le({
1943
1926
  __name: "routerLink",
1944
1927
  props: {
1945
1928
  to: {},
@@ -1951,64 +1934,85 @@ const fo = on("onBeforeRouteUpdate"), lo = on("onBeforeRouteLeave"), ho = Ze("on
1951
1934
  },
1952
1935
  setup(e) {
1953
1936
  const t = e, n = De(), r = N(() => M(t.to) ? t.to : t.to(n.resolve)), o = N(() => {
1954
- const { to: v, ...p } = t;
1937
+ const { to: m, ...p } = t;
1955
1938
  return p;
1956
- }), { element: a, isMatch: s, isExactMatch: c, isExternal: i, push: u } = Zr(r, o), f = N(() => ({
1939
+ }), { element: a, isMatch: s, isExactMatch: c, isExternal: u, push: i } = Yr(r, o), f = N(() => ({
1957
1940
  "router-link--match": s.value,
1958
1941
  "router-link--exact-match": c.value
1959
1942
  }));
1960
- function h(v) {
1961
- v.preventDefault(), u();
1943
+ function l(m) {
1944
+ m.preventDefault(), i();
1962
1945
  }
1963
- return (v, p) => (vt(), dn("a", {
1946
+ return (m, p) => (gt(), dn("a", {
1964
1947
  ref_key: "element",
1965
1948
  ref: a,
1966
1949
  href: r.value,
1967
1950
  class: mn(["router-link", f.value]),
1968
- onClick: h
1951
+ onClick: l
1969
1952
  }, [
1970
- yt(v.$slots, "default", Rt(gn({ resolved: r.value, isMatch: ce(s), isExactMatch: ce(c), isExternal: ce(i) })))
1971
- ], 10, no));
1953
+ vt(m.$slots, "default", yt(gn({ resolved: r.value, isMatch: ce(s), isExactMatch: ce(c), isExternal: ce(u) })))
1954
+ ], 10, eo));
1972
1955
  }
1973
- }), oo = /* @__PURE__ */ le({
1956
+ });
1957
+ function no(e, t) {
1958
+ return le({
1959
+ name: "PropsWrapper",
1960
+ expose: [],
1961
+ setup() {
1962
+ const n = t();
1963
+ return () => n instanceof Error ? "" : Zt(n) ? ve(ro(e, n)) : ve(e, n);
1964
+ }
1965
+ });
1966
+ }
1967
+ function ro(e, t) {
1968
+ return le({
1969
+ name: "AsyncPropsWrapper",
1970
+ expose: [],
1971
+ setup() {
1972
+ const n = qe();
1973
+ return (async () => n.value = await t)(), () => n.value instanceof Error ? "" : n.value ? ve(e, n.value) : "";
1974
+ }
1975
+ });
1976
+ }
1977
+ const oo = /* @__PURE__ */ le({
1974
1978
  __name: "routerView",
1975
1979
  props: {
1976
1980
  name: { default: "default" }
1977
1981
  },
1978
1982
  setup(e) {
1979
- const t = to(), n = Jn(), r = Xe(), { getProps: o } = tn(), a = vn("RouterView", !0);
1983
+ const t = Zr(), n = In(), r = Ye(), { getProps: o } = tn(), a = vn("RouterView", !0);
1980
1984
  yn(nn, r + 1);
1981
1985
  const s = N(() => {
1982
1986
  if (n.value)
1983
1987
  return n.value.component;
1984
- const u = t.matches.at(r);
1985
- if (!u)
1988
+ const i = t.matches.at(r);
1989
+ if (!i)
1986
1990
  return null;
1987
- const f = c(u), h = o(u.id, e.name, t);
1988
- return f ? h ? Vn(f, () => h) : f : null;
1991
+ const f = c(i), l = o(i.id, e.name, t);
1992
+ return f ? l ? no(f, () => l) : f : null;
1989
1993
  });
1990
- function c(u) {
1991
- return i(u)[e.name];
1994
+ function c(i) {
1995
+ return u(i)[e.name];
1992
1996
  }
1993
- function i(u) {
1994
- return Me(u) ? u.components : _e(u) ? { default: u.component } : typeof a == "string" ? {} : { default: a };
1997
+ function u(i) {
1998
+ return Me(i) ? i.components : _e(i) ? { default: i.component } : typeof a == "string" ? {} : { default: a };
1995
1999
  }
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)))
2000
+ return (i, f) => s.value ? vt(i.$slots, "default", yt(Rn({ key: 0 }, { route: ce(t), component: s.value, rejection: ce(n) })), () => [
2001
+ (gt(), wn(Pn(s.value)))
1998
2002
  ]) : En("", !0);
1999
2003
  }
2000
2004
  });
2001
2005
  function ao(e) {
2002
2006
  return pe(e) && typeof e.value == "string";
2003
2007
  }
2004
- function mt(e) {
2005
- return ao(e) ? e : Gt(e, {});
2008
+ function dt(e) {
2009
+ return ao(e) ? e : Jt(e, {});
2006
2010
  }
2007
2011
  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 = {
2012
+ const t = Je(), n = Gt(e.name), r = Kt(e.path), o = zt(e.query), a = Qt(e.hash), s = e.meta ?? {}, c = Hn(e) ? dt(e.host) : dt(""), u = ye({ id: t, meta: {}, state: {}, ...e }), i = {
2009
2013
  id: t,
2010
- matched: i,
2011
- matches: [i],
2014
+ matched: u,
2015
+ matches: [u],
2012
2016
  name: n,
2013
2017
  host: c,
2014
2018
  path: r,
@@ -2017,23 +2021,22 @@ function go(e) {
2017
2021
  meta: s,
2018
2022
  depth: 1,
2019
2023
  state: {}
2020
- }, f = Pt(e) ? Et(e.parent, u) : u;
2024
+ }, f = wt(e) ? Pt(e.parent, i) : i;
2021
2025
  return oe(f.path.params, f.query.params, f.host.params), f;
2022
2026
  }
2023
2027
  export {
2024
2028
  Un as DuplicateParamsError,
2025
- ro as RouterLink,
2029
+ kn as MetaPropertyConflict,
2030
+ to as RouterLink,
2026
2031
  he as RouterNotInstalledError,
2027
2032
  oo as RouterView,
2028
- Fn as UseRouteInvalidError,
2029
- rr as asUrl,
2030
- Vn as component,
2033
+ Wn as UseRouteInvalidError,
2034
+ tr as asUrl,
2031
2035
  go as createExternalRoute,
2032
- Dn as createParam,
2036
+ Mn as createParam,
2033
2037
  ne as createRoute,
2034
2038
  io as createRouter,
2035
- _n as isParamWithDefault,
2036
- eo as isRoute,
2039
+ Xr as isRoute,
2037
2040
  M as isUrl,
2038
2041
  ho as onAfterRouteEnter,
2039
2042
  po as onAfterRouteLeave,
@@ -2041,12 +2044,9 @@ export {
2041
2044
  fo as onBeforeRouteLeave,
2042
2045
  lo as onBeforeRouteUpdate,
2043
2046
  Oe as path,
2044
- ht as query,
2045
- Lt as routerInjectionKey,
2046
- Bt as routerRejectionKey,
2047
- Zr as useLink,
2048
- Jn as useRejection,
2049
- to as useRoute,
2047
+ lt as query,
2048
+ Yr as useLink,
2049
+ Zr as useRoute,
2050
2050
  De as useRouter,
2051
2051
  uo as withDefault
2052
2052
  };