@kitbag/router 0.14.0 → 0.14.1

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