@kitbag/router 0.17.2 → 0.17.4

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