@react-motion-router/core 2.0.0-beta.sha-112968d → 2.0.0-beta.sha-c19f37e

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.
package/build/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { jsx as T, jsxs as te, Fragment as ge } from "react/jsx-runtime";
2
- import Ht, { createContext as gt, Component as at, createRef as q, lazy as ve, cloneElement as ee, Suspense as xt, isValidElement as ne, Children as Gt, useContext as ft, useDebugValue as ye, useSyncExternalStore as ie, useRef as se, useEffect as re, useCallback as we } from "react";
1
+ import { jsx as T, jsxs as ee, Fragment as ye } from "react/jsx-runtime";
2
+ import Lt, { createContext as gt, Component as at, createRef as z, Suspense as xt, isValidElement as ne, cloneElement as ie, lazy as we, Children as Xt, useContext as ft, useDebugValue as Ee, useSyncExternalStore as re, useRef as Ft, useEffect as se, useCallback as be } from "react";
3
3
  const ae = gt(null);
4
- class Qe extends at {
5
- ref = q();
4
+ class Je extends at {
5
+ ref = z();
6
6
  static contextType = ae;
7
7
  componentDidMount() {
8
8
  this.scene.addNode(this);
@@ -55,211 +55,29 @@ class Qe extends at {
55
55
  );
56
56
  }
57
57
  }
58
- const tn = 2147483647, en = 100, nn = 0, sn = 0, rn = 1, Ee = -1, O = 0, J = 1, an = 0;
59
- function Lt(s, t) {
60
- s.endsWith("*") || (s += "**");
61
- const e = window.location.origin, n = new URLPattern(s, e).exec(t, e);
62
- if (!n)
63
- return null;
64
- const a = Object.keys(n.pathname.groups).filter((o) => !isNaN(Number(o))).map((o) => n.pathname.groups[o]).filter((o) => o !== void 0).at(Ee) ?? "";
65
- return new URL(
66
- t.replace(a, ""),
67
- window.location.origin
68
- );
69
- }
70
- function Xt(s, t, e = `${window.location.origin}/`, n = !0) {
71
- n || (s = s.toLowerCase(), t = t.toLowerCase());
72
- const i = Lt(e, t)?.href;
73
- if (!i)
74
- return null;
75
- const a = new URLPattern({
76
- baseURL: i,
77
- pathname: s
78
- }).exec({ pathname: t, baseURL: i }), o = a?.pathname.groups ?? {};
79
- return a ? {
80
- params: o,
81
- caseSensitive: n
82
- } : null;
83
- }
84
- function be(s, t = window) {
85
- return new Promise((e) => {
86
- queueMicrotask(() => e(
87
- t.dispatchEvent(s)
88
- ));
89
- });
90
- }
91
- function on(s) {
92
- const t = ve(s);
93
- return t.load = async () => (t.module ??= await s(), t.module), t;
94
- }
95
- function ln() {
96
- return !!window.navigation;
97
- }
98
- function cn() {
99
- return !!globalThis.URLPattern;
100
- }
101
- async function hn() {
102
- const { URLPattern: s } = await import("urlpattern-polyfill");
103
- globalThis.URLPattern = s;
104
- }
105
- async function un() {
106
- const { applyPolyfill: s } = await import("@virtualstate/navigation");
107
- s({
108
- history: !0,
109
- interceptEvents: !0,
110
- patch: !0,
111
- persist: !0,
112
- persistState: !0
113
- });
114
- }
115
- async function Te(s) {
116
- const t = [];
117
- for (const e of s)
118
- t.push(await e);
119
- return t;
120
- }
121
- function Se(s) {
122
- return s.replace(/-([a-z])/g, (t) => t[1].toUpperCase());
123
- }
124
- function dn(s, t) {
125
- return ee(s, t);
126
- }
127
- function Re(s, t) {
128
- const e = { ...s };
129
- for (const n of t)
130
- delete e[n];
131
- return e;
132
- }
133
- class ke extends Event {
134
- constructor() {
135
- super("transition-start");
136
- }
137
- }
138
- class xe extends Event {
139
- constructor() {
140
- super("transition-cancel");
141
- }
142
- }
143
- class Ce extends Event {
144
- constructor() {
145
- super("transition-end");
146
- }
147
- }
148
- class fn extends Event {
149
- constructor() {
150
- super("motion-progress-start");
151
- }
152
- }
153
- class pn extends Event {
154
- constructor() {
155
- super("motion-progress-end");
156
- }
157
- }
158
- class Le extends Event {
159
- #t = "load";
160
- #e = !1;
161
- #c = !0;
162
- #h = !1;
163
- #u = null;
164
- #d = null;
165
- #a;
166
- #i;
167
- #o = new AbortController();
168
- #l = !1;
169
- #n = [];
170
- #s = null;
171
- hasUAVisualTransition = !1;
172
- constructor() {
173
- super("navigate", { cancelable: !1, bubbles: !1, composed: !1 });
174
- const t = window.navigation.currentEntry;
175
- if (!t)
176
- throw new Error("Current entry is null");
177
- this.#a = {
178
- getState() {
179
- return t.getState();
180
- },
181
- url: t.url ?? new URL(window.location.href).href,
182
- key: t.key,
183
- index: t.index,
184
- id: t.id,
185
- sameDocument: !0
186
- }, this.#i = this.#o.signal, window.navigation.addEventListener(
187
- "navigate",
188
- this.#r,
189
- { signal: this.#i }
190
- );
191
- }
192
- #r = (t) => {
193
- t !== this ? this.#o.abort() : this.#n.length || window.navigation.removeEventListener("navigate", this.#r);
194
- };
195
- intercept(t) {
196
- if (this.#l)
197
- throw new DOMException("Failed to execute 'intercept' on 'NavigateEvent': intercept() may only be called while the navigate event is being dispatched.");
198
- let e = null;
199
- this.#s || (this.#s = {
200
- finished: new Promise((i) => e = i),
201
- from: window.navigation.currentEntry,
202
- navigationType: "load"
203
- });
204
- const n = t?.handler?.();
205
- n && this.#n.push(n), this.#n.length === J && Te(this.#n).then(() => {
206
- this.#l = !0, window.removeEventListener("navigate", this.#r), e?.();
207
- });
208
- }
209
- scroll() {
210
- throw new Error("Method not implemented.");
211
- }
212
- get transition() {
213
- return this.#s;
214
- }
215
- get navigationType() {
216
- return this.#t;
217
- }
218
- get userInitiated() {
219
- return this.#e;
220
- }
221
- get canIntercept() {
222
- return this.#c;
223
- }
224
- get hashChange() {
225
- return this.#h;
226
- }
227
- get formData() {
228
- return this.#u;
229
- }
230
- get downloadRequest() {
231
- return this.#d;
232
- }
233
- get destination() {
234
- return this.#a;
235
- }
236
- get signal() {
237
- return this.#i;
238
- }
239
- }
240
- const Ft = gt(null);
241
- class Me extends at {
242
- ref = q();
243
- static contextType = Ft;
58
+ const Kt = gt(null), Qe = 2147483647, tn = 100, en = 0, nn = 0, rn = 1, oe = -1, O = 0, J = 1, sn = 0;
59
+ class Te extends at {
60
+ ref = z();
61
+ static contextType = Kt;
244
62
  index = O;
245
63
  exiting = !1;
246
64
  state = {
247
65
  zIndex: "unset"
248
66
  };
249
- onAnimationEnd = () => {
67
+ onroutertransitionend() {
250
68
  this.ref.current && (this.ref.current.style.willChange = "auto", this.ref.current.style.pointerEvents = "auto");
251
- };
252
- onAnimationStart = () => {
69
+ }
70
+ onroutertransitionstart() {
253
71
  this.ref.current && (this.ref.current.style.willChange = "transform, opacity", this.ref.current.style.pointerEvents = "none");
254
- };
72
+ }
255
73
  componentDidMount() {
256
- this.props.navigation.addEventListener("transition-start", this.onAnimationStart), this.props.navigation.addEventListener("transition-end", this.onAnimationEnd), this.props.navigation.addEventListener("transition-cancel", this.onAnimationEnd);
74
+ this.props.navigation.addEventListener("routertransitionstart", this), this.props.navigation.addEventListener("routertransitionend", this), this.props.navigation.addEventListener("routertransitioncancel", this);
257
75
  }
258
76
  componentWillUnmount() {
259
- this.props.navigation.removeEventListener("transition-start", this.onAnimationStart), this.props.navigation.removeEventListener("transition-end", this.onAnimationEnd), this.props.navigation.removeEventListener("transition-cancel", this.onAnimationEnd);
77
+ this.props.navigation.removeEventListener("routertransitionstart", this), this.props.navigation.removeEventListener("routertransitionend", this), this.props.navigation.removeEventListener("routertransitioncancel", this);
260
78
  }
261
79
  get animationEffect() {
262
- const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: i } = this.context, { timeline: a, playbackRate: o } = e, { index: l, exiting: f, ref: d } = this, m = this.context.screens.map((S) => S.current?.name);
80
+ const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: r } = this.context, { timeline: a, playbackRate: o } = e, { index: l, exiting: f, ref: d } = this, m = this.context.screens.map((S) => S.current?.name);
263
81
  return t?.({
264
82
  ref: d.current,
265
83
  index: l,
@@ -268,7 +86,7 @@ class Me extends at {
268
86
  timeline: a,
269
87
  direction: n,
270
88
  playbackRate: o,
271
- hasUAVisualTransition: i
89
+ hasUAVisualTransition: r
272
90
  }) ?? null;
273
91
  }
274
92
  setZIndex(t) {
@@ -295,8 +113,8 @@ class Me extends at {
295
113
  );
296
114
  }
297
115
  }
298
- const oe = gt(null), vt = gt(null), le = gt(null);
299
- class Pe {
116
+ const le = gt(null), vt = gt(null), ce = gt(null);
117
+ class Se {
300
118
  id;
301
119
  nodes = /* @__PURE__ */ new Map();
302
120
  getScreenRect = () => new DOMRect();
@@ -331,10 +149,10 @@ class Pe {
331
149
  return !this.nodes.size;
332
150
  }
333
151
  }
334
- class De extends at {
152
+ class Re extends at {
335
153
  sharedElementScene;
336
- #t = q();
337
- ref = q();
154
+ #t = z();
155
+ ref = z();
338
156
  nestedRouterData;
339
157
  static contextType = vt;
340
158
  state = {
@@ -344,7 +162,7 @@ class De extends at {
344
162
  elementType: "div"
345
163
  };
346
164
  constructor(t, e) {
347
- super(t), this.sharedElementScene = new Pe(
165
+ super(t), this.sharedElementScene = new Se(
348
166
  `${this.name}-shared-element-scene`
349
167
  ), this.sharedElementScene.getScreenRect = () => this.ref.current?.getBoundingClientRect() || new DOMRect(), this.nestedRouterData = {
350
168
  parentScreen: this,
@@ -361,7 +179,7 @@ class De extends at {
361
179
  return this.state.focused;
362
180
  }
363
181
  get name() {
364
- return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") : j(this.props.component) ? this.props.component.module?.default.name.toLowerCase() : this.props.component.name.toLowerCase();
182
+ return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") : B(this.props.component) ? this.props.component.module?.default.name.toLowerCase() : this.props.component.name.toLowerCase();
365
183
  }
366
184
  blur() {
367
185
  return new Promise((t) => {
@@ -374,9 +192,9 @@ class De extends at {
374
192
  });
375
193
  }
376
194
  async load(t) {
377
- const e = this.props.component, n = this.props.config?.header?.component, i = this.props.config?.footer?.component;
195
+ const e = this.props.component, n = this.props.config?.header?.component, r = this.props.config?.footer?.component;
378
196
  let a;
379
- j(e) ? a = await e.load() : a = { default: e }, j(n) && await n.load(), j(i) && await i.load();
197
+ B(e) ? a = await e.load() : a = { default: e }, B(n) && await n.load(), B(r) && await r.load();
380
198
  const o = this.context.navigation, l = this.routeProp, f = !1;
381
199
  return await this.props.config?.onLoad?.({ navigation: o, route: l, signal: t, preloading: f }), a;
382
200
  }
@@ -419,9 +237,9 @@ class De extends at {
419
237
  return this.#t;
420
238
  }
421
239
  render() {
422
- const t = this.context.navigation, e = this.routeProp, n = this.props.component, i = e.config.header?.component, a = e.config.footer?.component;
240
+ const t = this.context.navigation, e = this.routeProp, n = this.props.component, r = e.config.header?.component, a = e.config.footer?.component;
423
241
  return /* @__PURE__ */ T(
424
- Me,
242
+ Te,
425
243
  {
426
244
  ref: this.#t,
427
245
  renderAs: this.state.elementType,
@@ -442,7 +260,7 @@ class De extends at {
442
260
  flexDirection: "column",
443
261
  pointerEvents: "inherit"
444
262
  },
445
- children: /* @__PURE__ */ T(ae.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ T(le.Provider, { value: e, children: /* @__PURE__ */ te(oe.Provider, { value: this.nestedRouterData, children: [
263
+ children: /* @__PURE__ */ T(ae.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ T(ce.Provider, { value: e, children: /* @__PURE__ */ ee(le.Provider, { value: this.nestedRouterData, children: [
446
264
  /* @__PURE__ */ T(xt, { fallback: /* @__PURE__ */ T(
447
265
  _,
448
266
  {
@@ -453,7 +271,7 @@ class De extends at {
453
271
  ), children: /* @__PURE__ */ T(
454
272
  _,
455
273
  {
456
- component: i,
274
+ component: r,
457
275
  route: e,
458
276
  navigation: t
459
277
  }
@@ -501,40 +319,40 @@ class De extends at {
501
319
  );
502
320
  }
503
321
  }
504
- function _({ component: s, route: t, navigation: e }) {
505
- j(s) && s.module?.default && (s = s.module.default);
506
- const n = s ?? null;
507
- return typeof n == "function" || ce(n) ? /* @__PURE__ */ T(
322
+ function _({ component: i, route: t, navigation: e }) {
323
+ B(i) && i.module?.default && (i = i.module.default);
324
+ const n = i ?? null;
325
+ return typeof n == "function" || he(n) ? /* @__PURE__ */ T(
508
326
  n,
509
327
  {
510
328
  navigation: e,
511
329
  route: t
512
330
  }
513
- ) : ne(n) ? ee(n, {
331
+ ) : ne(n) ? ie(n, {
514
332
  navigation: e,
515
333
  route: t
516
- }) : /* @__PURE__ */ T(ge, { children: n });
334
+ }) : /* @__PURE__ */ T(ye, { children: n });
517
335
  }
518
- function Ne(s) {
519
- return ne(s) ? Object.getPrototypeOf(s.type) === De : !1;
336
+ function ke(i) {
337
+ return ne(i) ? Object.getPrototypeOf(i.type) === Re : !1;
520
338
  }
521
- function ce(s) {
522
- return typeof s == "object" && s !== null && s.$$typeof === Symbol.for("react.lazy");
339
+ function he(i) {
340
+ return typeof i == "object" && i !== null && i.$$typeof === Symbol.for("react.lazy");
523
341
  }
524
- function j(s) {
525
- return ce(s) && "load" in s;
342
+ function B(i) {
343
+ return he(i) && "load" in i;
526
344
  }
527
- function Ae(s) {
528
- return "style" in s && s.style instanceof CSSStyleDeclaration;
345
+ function xe(i) {
346
+ return "style" in i && i.style instanceof CSSStyleDeclaration;
529
347
  }
530
- var Ue = Object.defineProperty, Ie = (s, t, e) => t in s ? Ue(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, K = (s, t, e) => (Ie(s, typeof t != "symbol" ? t + "" : t, e), e), Kt = (s, t, e) => {
531
- if (!t.has(s))
348
+ var Ce = Object.defineProperty, Le = (i, t, e) => t in i ? Ce(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, F = (i, t, e) => (Le(i, typeof t != "symbol" ? t + "" : t, e), e), Bt = (i, t, e) => {
349
+ if (!t.has(i))
532
350
  throw TypeError("Cannot " + e);
533
- }, r = (s, t, e) => (Kt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), v = (s, t, e) => {
534
- if (t.has(s))
351
+ }, s = (i, t, e) => (Bt(i, t, "read from private field"), e ? e.call(i) : t.get(i)), v = (i, t, e) => {
352
+ if (t.has(i))
535
353
  throw TypeError("Cannot add the same private member more than once");
536
- t instanceof WeakSet ? t.add(s) : t.set(s, e);
537
- }, c = (s, t, e, n) => (Kt(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), g = (s, t, e) => (Kt(s, t, "access private method"), e);
354
+ t instanceof WeakSet ? t.add(i) : t.set(i, e);
355
+ }, c = (i, t, e, n) => (Bt(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e), g = (i, t, e) => (Bt(i, t, "access private method"), e);
538
356
  const pt = {
539
357
  delay: 0,
540
358
  direction: "normal",
@@ -544,120 +362,120 @@ const pt = {
544
362
  fill: "auto",
545
363
  iterationStart: 0,
546
364
  iterations: 1
547
- }, jt = 1e3, We = window.Animation, yt = window.KeyframeEffect;
548
- function Yt(s) {
549
- return Array.isArray(s);
365
+ }, qt = 1e3, Me = window.Animation, yt = window.KeyframeEffect;
366
+ function Yt(i) {
367
+ return Array.isArray(i);
550
368
  }
551
- function Y(s) {
552
- return typeof s == "object" && s === null;
369
+ function Y(i) {
370
+ return typeof i == "object" && i === null;
553
371
  }
554
- function h(s, t) {
555
- return Y(s) || typeof s == "number" ? s : (t || ([t] = Object.keys(s.type())), s.to(t).value);
372
+ function h(i, t) {
373
+ return Y(i) || typeof i == "number" ? i : (t || ([t] = Object.keys(i.type())), i.to(t).value);
556
374
  }
557
- function $e(s, t = pt) {
558
- let { duration: e = "auto", iterations: n = 1, playbackRate: i = 1 } = t;
559
- if (Y(s))
560
- return s;
561
- if (typeof s == "number" || s.type().percent === void 0)
375
+ function Pe(i, t = pt) {
376
+ let { duration: e = "auto", iterations: n = 1, playbackRate: r = 1 } = t;
377
+ if (Y(i))
378
+ return i;
379
+ if (typeof i == "number" || i.type().percent === void 0)
562
380
  throw new DOMException(
563
381
  "CSSNumericValue must be a percentage for progress based animations.",
564
382
  "NotSupportedError"
565
383
  );
566
384
  if (e === "auto")
567
- e = jt;
385
+ e = qt;
568
386
  else if (e instanceof CSSNumericValue)
569
387
  e = e.to("ms").value;
570
388
  else if (typeof e == "string")
571
389
  throw new TypeError("Unknown effect duration keyword.");
572
- const { delay: a = 0, endDelay: o = 0 } = t, l = e / n * n / Math.abs(i), f = a + l + o;
390
+ const { delay: a = 0, endDelay: o = 0 } = t, l = e / n * n / Math.abs(r), f = a + l + o;
573
391
  return ot(
574
- s.to("percent").value,
392
+ i.to("percent").value,
575
393
  [0, 100],
576
394
  [0, f]
577
395
  );
578
396
  }
579
- function kt(s) {
580
- if (Y(s) || typeof s == "number")
581
- return s;
582
- if (s.type().time !== void 0)
397
+ function kt(i) {
398
+ if (Y(i) || typeof i == "number")
399
+ return i;
400
+ if (i.type().time !== void 0)
583
401
  throw new DOMException(
584
402
  "CSSNumericValue must be a time value for time based animations.",
585
403
  "NotSupportedError"
586
404
  );
587
- return s.to("ms").value;
405
+ return i.to("ms").value;
588
406
  }
589
- function Zt(s, t) {
590
- const e = t.length - 1, n = Math.floor(s * e), i = t[n], a = t[Math.min(n + 1, e)], o = s * e - n;
591
- return i + o * (a - i);
407
+ function Zt(i, t) {
408
+ const e = t.length - 1, n = Math.floor(i * e), r = t[n], a = t[Math.min(n + 1, e)], o = i * e - n;
409
+ return r + o * (a - r);
592
410
  }
593
- function Oe(s, t, e) {
594
- let n = 0, i = 0;
595
- for (const [a, o] of Object.entries(s)) {
411
+ function De(i, t, e) {
412
+ let n = 0, r = 0;
413
+ for (const [a, o] of Object.entries(i)) {
596
414
  const { min: l, max: f } = t, d = e[a] ?? 1, m = (o - l[a]) / (f[a] - l[a]) * d;
597
- n += m, i += d;
415
+ n += m, r += d;
598
416
  }
599
- return n / i;
417
+ return n / r;
600
418
  }
601
- function ot(s, t, e, n = {}) {
602
- let i;
603
- if (typeof s == "number" && Yt(t)) {
419
+ function ot(i, t, e, n = {}) {
420
+ let r;
421
+ if (typeof i == "number" && Yt(t)) {
604
422
  const o = { x: t[0] }, l = { x: t[1] };
605
- t = { min: o, max: l }, s = { x: s };
423
+ t = { min: o, max: l }, i = { x: i };
606
424
  } else
607
425
  throw new TypeError("Input and input range must have the same dimensions.");
608
- if (i = Oe(s, t, n), i = Ve(i, 0, 1), Yt(e))
609
- return Zt(i, e);
426
+ if (r = De(i, t, n), r = Ne(r, 0, 1), Yt(e))
427
+ return Zt(r, e);
610
428
  const a = {};
611
429
  for (const o of Object.keys(e.min)) {
612
430
  const l = e.min[o], f = e.max[o], d = [l, f];
613
- a[o] = Zt(i, d);
431
+ a[o] = Zt(r, d);
614
432
  }
615
433
  return a;
616
434
  }
617
- function Ve(s, t, e) {
618
- return s < t ? t : e && s > e ? e : s;
435
+ function Ne(i, t, e) {
436
+ return i < t ? t : e && i > e ? e : i;
619
437
  }
620
- function Bt(s) {
438
+ function zt(i) {
621
439
  let {
622
440
  duration: t = "auto",
623
441
  iterations: e = 1,
624
442
  playbackRate: n = 1,
625
- delay: i = 0,
443
+ delay: r = 0,
626
444
  endDelay: a = 0,
627
445
  localTime: o = null,
628
446
  progress: l = null
629
- } = s;
447
+ } = i;
630
448
  const f = new CSSUnitValue(100, "percent");
631
449
  if (t === "auto")
632
- t = jt, i = 0, a = 0;
450
+ t = qt, r = 0, a = 0;
633
451
  else if (t instanceof CSSNumericValue)
634
452
  t = t.to("ms").value;
635
453
  else if (typeof t == "string")
636
454
  throw TypeError("Unknown effect duration keyword.");
637
- const d = t / e, m = d * e / Math.abs(n), S = i + m + a;
455
+ const d = t / e, m = d * e / Math.abs(n), S = r + m + a;
638
456
  t = new CSSUnitValue(d / S * 100, "percent");
639
457
  const E = CSS.percent(t.to("percent").value * e / Math.abs(n));
640
458
  return o !== null && (l = h(o, "percent") / f.value), {
641
- ...s,
459
+ ...i,
642
460
  progress: l,
643
461
  activeDuration: E,
644
462
  duration: t,
645
463
  iterations: e,
646
- delay: i,
464
+ delay: r,
647
465
  endDelay: a,
648
466
  endTime: f
649
467
  };
650
468
  }
651
- function he(s, t) {
652
- let { activeDuration: e = 0, localTime: n = null, endTime: i = 1 / 0, delay: a = 0 } = s;
653
- if (i = h(i), e = h(e), n = h(n), n == null || n === void 0)
469
+ function ue(i, t) {
470
+ let { activeDuration: e = 0, localTime: n = null, endTime: r = 1 / 0, delay: a = 0 } = i;
471
+ if (r = h(r), e = h(e), n = h(n), n == null || n === void 0)
654
472
  return "idle";
655
- const o = Math.max(Math.min(a, i), 0), l = Math.max(Math.min(a + e, i), 0);
473
+ const o = Math.max(Math.min(a, r), 0), l = Math.max(Math.min(a + e, r), 0);
656
474
  return n < o || t === "backwards" && n === o ? "before" : n > l || t === "forwards" && n === l ? "after" : "active";
657
475
  }
658
- function Fe(s, t) {
659
- let { localTime: e = null, delay: n = 0, activeDuration: i = 0, fill: a } = s;
660
- if (i = h(i), e = h(e), e == null || e === void 0)
476
+ function Ue(i, t) {
477
+ let { localTime: e = null, delay: n = 0, activeDuration: r = 0, fill: a } = i;
478
+ if (r = h(r), e = h(e), e == null || e === void 0)
661
479
  return null;
662
480
  switch (t) {
663
481
  case "before":
@@ -665,63 +483,63 @@ function Fe(s, t) {
665
483
  case "active":
666
484
  return e - n;
667
485
  case "after":
668
- return a === "forwards" || a === "both" ? Math.max(Math.min(e - n, i), 0) : null;
486
+ return a === "forwards" || a === "both" ? Math.max(Math.min(e - n, r), 0) : null;
669
487
  default:
670
488
  return null;
671
489
  }
672
490
  }
673
- function Ke(s, t, e) {
674
- const { duration: n = 0, iterations: i = 1, iterationStart: a = 0 } = s;
491
+ function Ae(i, t, e) {
492
+ const { duration: n = 0, iterations: r = 1, iterationStart: a = 0 } = i;
675
493
  if (typeof n != "number")
676
494
  throw new TypeError("Duration cannot be unresolved");
677
495
  let o = 0;
678
- return n === 0 ? t === "before" ? o = 0 : o = i : o = e / kt(n), o + a;
496
+ return n === 0 ? t === "before" ? o = 0 : o = r : o = e / kt(n), o + a;
679
497
  }
680
- function je(s, t, e, n) {
681
- const { iterations: i = 1, iterationStart: a = 0, activeDuration: o = 0 } = s;
498
+ function Ie(i, t, e, n) {
499
+ const { iterations: r = 1, iterationStart: a = 0, activeDuration: o = 0 } = i;
682
500
  if (Y(e))
683
501
  return null;
684
502
  let l = 0;
685
- return e === 1 / 0 && (l = a % 1), l === 0 && (t === "active" || t === "after") && o === n && i !== 0 && (l = 1), l;
503
+ return e === 1 / 0 && (l = a % 1), l === 0 && (t === "active" || t === "after") && o === n && r !== 0 && (l = 1), l;
686
504
  }
687
- function ue(s, t) {
688
- const { iterations: e = 1 } = s, n = Fe(s, t);
505
+ function de(i, t) {
506
+ const { iterations: e = 1 } = i, n = Ue(i, t);
689
507
  if (Y(n))
690
508
  return null;
691
509
  if (t === "after" && e === 1 / 0)
692
510
  return 1 / 0;
693
- const i = Ke(s, t, n);
694
- return je(s, t, i, n) === 1 ? Math.floor(i) - 1 : Math.floor(i);
511
+ const r = Ae(i, t, n);
512
+ return Ie(i, t, r, n) === 1 ? Math.floor(r) - 1 : Math.floor(r);
695
513
  }
696
- class Be extends Event {
514
+ class We extends Event {
697
515
  constructor(t) {
698
- super("update", { bubbles: !1, cancelable: !1, composed: !1 }), K(this, "currentTime"), this.currentTime = t;
516
+ super("update", { bubbles: !1, cancelable: !1, composed: !1 }), F(this, "currentTime"), this.currentTime = t;
699
517
  }
700
518
  }
701
- var A, Q;
519
+ var U, Q;
702
520
  class b extends EventTarget {
703
521
  constructor(t = { type: "swipe", axis: "x", rangeStart: 0, rangeEnd: window.screen.availWidth, source: document.body }) {
704
- super(), v(this, A, void 0), v(this, Q, void 0), t.source.addEventListener(t.type, this.onGesture.bind(this)), c(this, Q, CSS.percent(0)), c(this, A, t);
522
+ super(), v(this, U, void 0), v(this, Q, void 0), t.source.addEventListener(t.type, this.onGesture.bind(this)), c(this, Q, CSS.percent(0)), c(this, U, t);
705
523
  }
706
524
  onGesture(t) {
707
- const e = r(this, A).source.getBoundingClientRect();
525
+ const e = s(this, U).source.getBoundingClientRect();
708
526
  let n = 0;
709
- const i = {
527
+ const r = {
710
528
  x: t.x - e.left,
711
529
  y: t.y - e.top
712
530
  };
713
- switch (r(this, A).type) {
531
+ switch (s(this, U).type) {
714
532
  case "swipe": {
715
- const { rangeStart: a, rangeEnd: o } = r(this, A), l = r(this, A).axis;
533
+ const { rangeStart: a, rangeEnd: o } = s(this, U), l = s(this, U).axis;
716
534
  n = ot(
717
- i[l],
535
+ r[l],
718
536
  [h(a, "px"), h(o, "px")],
719
537
  [0, 100]
720
538
  );
721
539
  break;
722
540
  }
723
541
  case "pan": {
724
- const { rangeStart: a, rangeEnd: o } = r(this, A), { x: l, y: f } = i;
542
+ const { rangeStart: a, rangeEnd: o } = s(this, U), { x: l, y: f } = r;
725
543
  n = ot(
726
544
  { x: l, y: f },
727
545
  {
@@ -734,7 +552,7 @@ class b extends EventTarget {
734
552
  break;
735
553
  }
736
554
  case "pinch": {
737
- const { rangeStart: a, rangeEnd: o } = r(this, A), { scale: l } = t;
555
+ const { rangeStart: a, rangeEnd: o } = s(this, U), { scale: l } = t;
738
556
  n = ot(
739
557
  l,
740
558
  [h(a, ""), h(o, "")],
@@ -744,7 +562,7 @@ class b extends EventTarget {
744
562
  break;
745
563
  }
746
564
  case "rotate": {
747
- const { rangeStart: a, rangeEnd: o } = r(this, A), { rotation: l } = t;
565
+ const { rangeStart: a, rangeEnd: o } = s(this, U), { rotation: l } = t;
748
566
  n = ot(
749
567
  l,
750
568
  [h(a, "deg"), h(o, "deg")],
@@ -752,7 +570,7 @@ class b extends EventTarget {
752
570
  );
753
571
  }
754
572
  }
755
- c(this, Q, CSS.percent(n)), this.dispatchEvent(new Be(r(this, Q)));
573
+ c(this, Q, CSS.percent(n)), this.dispatchEvent(new We(s(this, Q)));
756
574
  }
757
575
  addEventListener(t, e, n) {
758
576
  super.addEventListener(t, e, n);
@@ -761,13 +579,13 @@ class b extends EventTarget {
761
579
  super.removeEventListener(t, e, n);
762
580
  }
763
581
  get currentTime() {
764
- return r(this, Q);
582
+ return s(this, Q);
765
583
  }
766
584
  get phase() {
767
585
  return "active";
768
586
  }
769
587
  }
770
- A = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap();
588
+ U = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap();
771
589
  const N = /* @__PURE__ */ new WeakMap();
772
590
  var lt;
773
591
  class wt extends yt {
@@ -775,7 +593,7 @@ class wt extends yt {
775
593
  super(t), v(this, lt, null), c(this, lt, e);
776
594
  }
777
595
  get parent() {
778
- return r(this, lt);
596
+ return s(this, lt);
779
597
  }
780
598
  getTiming() {
781
599
  var t;
@@ -796,7 +614,7 @@ class wt extends yt {
796
614
  throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
797
615
  if (e.iterations === 1 / 0)
798
616
  throw TypeError("Effect iterations cannot be Infinity for non-monotonic timelines.");
799
- return Bt(e);
617
+ return zt(e);
800
618
  }
801
619
  return e;
802
620
  }
@@ -808,10 +626,10 @@ class wt extends yt {
808
626
  duration: n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration,
809
627
  ...t
810
628
  };
811
- let i = r(this, lt);
812
- for (; i; ) {
813
- const a = i.getTiming();
814
- t != null && t.delay && (t.delay += a.delay ?? 0), t != null && t.endDelay && (t.endDelay += a.endDelay ?? 0), t != null && t.iterationStart && (t.iterationStart += a.iterationStart ?? 0), t != null && t.iterations && (t.iterations *= a.iterations ?? 1), t != null && t.playbackRate && (t.playbackRate *= a.playbackRate ?? 1), a.duration && typeof a.duration != "string" && t?.duration === "auto" && (t.duration = h(a.duration, "ms")), i = i.parent;
629
+ let r = s(this, lt);
630
+ for (; r; ) {
631
+ const a = r.getTiming();
632
+ t != null && t.delay && (t.delay += a.delay ?? 0), t != null && t.endDelay && (t.endDelay += a.endDelay ?? 0), t != null && t.iterationStart && (t.iterationStart += a.iterationStart ?? 0), t != null && t.iterations && (t.iterations *= a.iterations ?? 1), t != null && t.playbackRate && (t.playbackRate *= a.playbackRate ?? 1), a.duration && typeof a.duration != "string" && t?.duration === "auto" && (t.duration = h(a.duration, "ms")), r = r.parent;
815
633
  }
816
634
  if (((e = N.get(this)) == null ? void 0 : e.timeline) instanceof b) {
817
635
  if (t?.duration === 1 / 0)
@@ -823,16 +641,16 @@ class wt extends yt {
823
641
  }
824
642
  }
825
643
  lt = /* @__PURE__ */ new WeakMap();
826
- var U, tt;
827
- const qe = class Et {
644
+ var A, tt;
645
+ const $e = class Et {
828
646
  constructor(t) {
829
- v(this, U, []), v(this, tt, null), c(this, U, t.map((e) => (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), e)));
647
+ v(this, A, []), v(this, tt, null), c(this, A, t.map((e) => (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), e)));
830
648
  }
831
649
  get parent() {
832
- return r(this, tt);
650
+ return s(this, tt);
833
651
  }
834
652
  get children() {
835
- const t = r(this, U);
653
+ const t = s(this, A);
836
654
  return {
837
655
  length: t.length,
838
656
  item(e) {
@@ -841,30 +659,30 @@ const qe = class Et {
841
659
  };
842
660
  }
843
661
  get firstChild() {
844
- return r(this, U).at(0) ?? null;
662
+ return s(this, A).at(0) ?? null;
845
663
  }
846
664
  get lastChild() {
847
- return r(this, U).at(-1) ?? null;
665
+ return s(this, A).at(-1) ?? null;
848
666
  }
849
667
  clone() {
850
668
  return structuredClone(this);
851
669
  }
852
670
  append(...t) {
853
671
  t.forEach((e) => {
854
- r(this, U).includes(e) || (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), r(this, U).push(e));
672
+ s(this, A).includes(e) || (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), s(this, A).push(e));
855
673
  });
856
674
  }
857
675
  prepend(...t) {
858
676
  t.forEach((e) => {
859
- r(this, U).includes(e) || (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), r(this, U).unshift(e));
677
+ s(this, A).includes(e) || (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), s(this, A).unshift(e));
860
678
  });
861
679
  }
862
680
  };
863
- U = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap();
864
- let qt = qe;
865
- class rt {
681
+ A = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap();
682
+ let Ht = $e;
683
+ class st {
866
684
  constructor() {
867
- K(this, "promise"), K(this, "state"), K(this, "nativeResolve"), K(this, "nativeReject"), this.state = "pending", this.nativeResolve = this.nativeReject = null, this.promise = new Promise((t, e) => {
685
+ F(this, "promise"), F(this, "state"), F(this, "nativeResolve"), F(this, "nativeReject"), this.state = "pending", this.nativeResolve = this.nativeReject = null, this.promise = new Promise((t, e) => {
868
686
  this.nativeResolve = t, this.nativeReject = e;
869
687
  });
870
688
  }
@@ -878,8 +696,8 @@ class rt {
878
696
  }), (e = this.nativeReject) == null || e.call(this, t);
879
697
  }
880
698
  }
881
- var et, Mt, de;
882
- class ze extends qt {
699
+ var et, Mt, fe;
700
+ class Oe extends Ht {
883
701
  constructor(t, e = pt) {
884
702
  super(t), v(this, Mt), v(this, et, void 0), c(this, et, {
885
703
  ...pt,
@@ -893,31 +711,31 @@ class ze extends qt {
893
711
  super.append(...t), t.forEach((e) => e.updateTiming());
894
712
  }
895
713
  getTiming() {
896
- return r(this, et);
714
+ return s(this, et);
897
715
  }
898
716
  getComputedTiming() {
899
717
  var t, e;
900
- const n = this.getTiming(), i = { ...n }, { delay: a = 0 } = ((t = this.children.item(0)) == null ? void 0 : t.getComputedTiming()) ?? {}, { endDelay: o = 0, endTime: l = 0 } = ((e = this.children.item(this.children.length - 1)) == null ? void 0 : e.getComputedTiming()) ?? {};
901
- n.delay = n.delay ? n.delay + a : a, n.endDelay = n.endDelay ? n.endDelay + o : o, i.endTime = l;
718
+ const n = this.getTiming(), r = { ...n }, { delay: a = 0 } = ((t = this.children.item(0)) == null ? void 0 : t.getComputedTiming()) ?? {}, { endDelay: o = 0, endTime: l = 0 } = ((e = this.children.item(this.children.length - 1)) == null ? void 0 : e.getComputedTiming()) ?? {};
719
+ n.delay = n.delay ? n.delay + a : a, n.endDelay = n.endDelay ? n.endDelay + o : o, r.endTime = l;
902
720
  for (let C = 0; C < this.children.length; C++) {
903
721
  const L = this.children.item(C);
904
722
  if (!L)
905
723
  continue;
906
724
  let {
907
725
  duration: M = "auto",
908
- activeDuration: zt = 0
726
+ activeDuration: Gt = 0
909
727
  } = L.getComputedTiming();
910
- i.activeDuration = i.activeDuration ? h(i.activeDuration, "ms") + h(zt, "ms") : zt, n.duration = n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration, M = M instanceof CSSNumericValue ? M.to("ms").value : M, typeof M != "string" && (n.duration === "auto" ? n.duration = h(M, "ms") : typeof n.duration != "string" && (n.duration = n.duration ? n.duration + M : M));
728
+ r.activeDuration = r.activeDuration ? h(r.activeDuration, "ms") + h(Gt, "ms") : Gt, n.duration = n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration, M = M instanceof CSSNumericValue ? M.to("ms").value : M, typeof M != "string" && (n.duration === "auto" ? n.duration = h(M, "ms") : typeof n.duration != "string" && (n.duration = n.duration ? n.duration + M : M));
911
729
  }
912
730
  const { timeline: f, startTime: d, currentTime: m } = N.get(this) ?? {}, S = f instanceof b ? "percent" : "ms";
913
- let { duration: E = 0, iterations: Z = 1 } = i;
731
+ let { duration: E = 0, iterations: Z = 1 } = r;
914
732
  if (E === "auto" && (E = 0), typeof E == "string")
915
733
  throw new TypeError("Unknown effect duration keyword.");
916
- return i.duration = E, i.activeDuration = kt(E) * Z, i.startTime = d ?? void 0, i.localTime = m, i.currentIteration = ue(i, he(i, r(this, Mt, de))), f instanceof b ? Bt(i) : (f instanceof DocumentTimeline && (i.progress = m && h(m, S) / h(l, S)), i);
734
+ return r.duration = E, r.activeDuration = kt(E) * Z, r.startTime = d ?? void 0, r.localTime = m, r.currentIteration = de(r, ue(r, s(this, Mt, fe))), f instanceof b ? zt(r) : (f instanceof DocumentTimeline && (r.progress = m && h(m, S) / h(l, S)), r);
917
735
  }
918
736
  updateTiming(t) {
919
737
  c(this, et, {
920
- ...r(this, et),
738
+ ...s(this, et),
921
739
  ...t
922
740
  });
923
741
  for (let e = 0; e < this.children.length; e++) {
@@ -926,28 +744,28 @@ class ze extends qt {
926
744
  }
927
745
  }
928
746
  }
929
- et = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakSet(), de = function() {
930
- const { playbackRate: s = 1 } = N.get(this) ?? {};
931
- return s < 0 ? "backwards" : "forwards";
747
+ et = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakSet(), fe = function() {
748
+ const { playbackRate: i = 1 } = N.get(this) ?? {};
749
+ return i < 0 ? "backwards" : "forwards";
932
750
  };
933
- var p, x, dt, w, R, P, u, y, k, G, V, ct, I, bt, Pt, nt, ht, z, it, Dt, _t, Nt, Jt, At, Qt, B, X, ut, Tt, Ut, W, F, D, $, St, It, Wt;
934
- const fe = class extends EventTarget {
751
+ var p, x, dt, w, R, P, u, y, k, G, V, ct, I, bt, Pt, nt, ht, H, it, Dt, _t, Nt, Jt, Ut, Qt, q, X, ut, Tt, At, W, j, D, $, St, It, Wt;
752
+ const pe = class extends EventTarget {
935
753
  constructor(t, e) {
936
- super(), v(this, bt), v(this, nt), v(this, z), v(this, Dt), v(this, Nt), v(this, At), v(this, B), v(this, Tt), v(this, W), v(this, D), K(this, "id", ""), K(this, "oncancel", null), K(this, "onfinish", null), K(this, "onremove", null), v(this, p, void 0), v(this, x, void 0), v(this, dt, "active"), v(this, w, {
754
+ super(), v(this, bt), v(this, nt), v(this, H), v(this, Dt), v(this, Nt), v(this, Ut), v(this, q), v(this, Tt), v(this, W), v(this, D), F(this, "id", ""), F(this, "oncancel", null), F(this, "onfinish", null), F(this, "onremove", null), v(this, p, void 0), v(this, x, void 0), v(this, dt, "active"), v(this, w, {
937
755
  task: null,
938
756
  playbackRate: null
939
- }), v(this, R, new rt()), v(this, P, new rt()), v(this, u, null), v(this, y, null), v(this, k, []), v(this, G, null), v(this, V, !1), v(this, ct, 0), v(this, I, 1), v(this, ut, () => {
940
- g(this, B, X).call(this);
757
+ }), v(this, R, new st()), v(this, P, new st()), v(this, u, null), v(this, y, null), v(this, k, []), v(this, G, null), v(this, V, !1), v(this, ct, 0), v(this, I, 1), v(this, ut, () => {
758
+ g(this, q, X).call(this);
941
759
  }), v(this, St, () => {
942
760
  var n;
943
- if (r(this, P).state !== "pending" || this.playState !== "finished")
761
+ if (s(this, P).state !== "pending" || this.playState !== "finished")
944
762
  return;
945
- r(this, P).resolve(this);
946
- const i = this.currentTime, a = (n = this.timeline) == null ? void 0 : n.currentTime, o = new AnimationPlaybackEvent(
763
+ s(this, P).resolve(this);
764
+ const r = this.currentTime, a = (n = this.timeline) == null ? void 0 : n.currentTime, o = new AnimationPlaybackEvent(
947
765
  "finish",
948
766
  {
949
767
  get currentTime() {
950
- return i;
768
+ return r;
951
769
  },
952
770
  get timelineTime() {
953
771
  return a;
@@ -959,7 +777,7 @@ const fe = class extends EventTarget {
959
777
  this.dispatchEvent(o), (l = this.onfinish) == null || l.call(this, o);
960
778
  });
961
779
  }), v(this, It, () => {
962
- var n, i;
780
+ var n, r;
963
781
  const a = this.currentTime, o = (n = this.timeline) == null ? void 0 : n.currentTime, l = new AnimationPlaybackEvent(
964
782
  "cancel",
965
783
  {
@@ -971,21 +789,21 @@ const fe = class extends EventTarget {
971
789
  }
972
790
  }
973
791
  );
974
- this.dispatchEvent(l), (i = this.oncancel) == null || i.call(this, l);
792
+ this.dispatchEvent(l), (r = this.oncancel) == null || r.call(this, l);
975
793
  }), v(this, Wt, () => {
976
794
  var n;
977
- const i = new Event("remove");
978
- this.dispatchEvent(i), (n = this.onremove) == null || n.call(this, i);
979
- }), r(this, R).resolve(this), c(this, x, t ?? null), c(this, p, e ?? document.timeline), r(this, x) && N.set(r(this, x), this), g(this, Tt, Ut).call(this), e instanceof b && e.addEventListener("update", r(this, ut));
795
+ const r = new Event("remove");
796
+ this.dispatchEvent(r), (n = this.onremove) == null || n.call(this, r);
797
+ }), s(this, R).resolve(this), c(this, x, t ?? null), c(this, p, e ?? document.timeline), s(this, x) && N.set(s(this, x), this), g(this, Tt, At).call(this), e instanceof b && e.addEventListener("update", s(this, ut));
980
798
  }
981
799
  reverse() {
982
800
  var t;
983
- const { endTime: e = 0 } = ((t = r(this, x)) == null ? void 0 : t.getComputedTiming()) ?? {}, n = r(this, w).playbackRate ?? r(this, I), i = h(this.currentTime), a = e === 1 / 0, o = n !== 0 && (n < 0 || i && i > 0 || !a);
984
- if (!r(this, p) || !o) {
985
- o && (r(this, w).playbackRate = -n);
801
+ const { endTime: e = 0 } = ((t = s(this, x)) == null ? void 0 : t.getComputedTiming()) ?? {}, n = s(this, w).playbackRate ?? s(this, I), r = h(this.currentTime), a = e === 1 / 0, o = n !== 0 && (n < 0 || r && r > 0 || !a);
802
+ if (!s(this, p) || !o) {
803
+ o && (s(this, w).playbackRate = -n);
986
804
  return;
987
805
  }
988
- if (r(this, p).currentTime === null)
806
+ if (s(this, p).currentTime === null)
989
807
  throw new DOMException(
990
808
  "Cannot reverse an animation with no active timeline",
991
809
  "InvalidStateError"
@@ -994,56 +812,56 @@ const fe = class extends EventTarget {
994
812
  }
995
813
  play() {
996
814
  const t = this.playState === "paused" && this.pending, e = this.currentTime;
997
- (r(this, w).playbackRate ?? this.playbackRate) === 0 && e === null && c(this, y, 0), e === null && c(this, V, !0), (this.playState === "finished" || t) && (c(this, u, null), c(this, y, null), c(this, V, !0)), r(this, y) && c(this, u, null), r(this, w).task && (r(this, w).task = null), !(r(this, u) !== null && r(this, y) === null && !t && r(this, w).playbackRate === null) && (g(this, B, X).call(this), g(this, nt, ht).call(this), r(this, w).task = "play", g(this, W, F).call(this, !1));
815
+ (s(this, w).playbackRate ?? this.playbackRate) === 0 && e === null && c(this, y, 0), e === null && c(this, V, !0), (this.playState === "finished" || t) && (c(this, u, null), c(this, y, null), c(this, V, !0)), s(this, y) && c(this, u, null), s(this, w).task && (s(this, w).task = null), !(s(this, u) !== null && s(this, y) === null && !t && s(this, w).playbackRate === null) && (g(this, q, X).call(this), g(this, nt, ht).call(this), s(this, w).task = "play", g(this, W, j).call(this, !1));
998
816
  }
999
817
  pause() {
1000
- this.playState !== "paused" && (this.currentTime === null && c(this, V, !0), r(this, w).task && (r(this, w).task = null), g(this, nt, ht).call(this), r(this, w).task = "pause");
818
+ this.playState !== "paused" && (this.currentTime === null && c(this, V, !0), s(this, w).task && (s(this, w).task = null), g(this, nt, ht).call(this), s(this, w).task = "pause");
1001
819
  }
1002
820
  persist() {
1003
- r(this, k).forEach((t) => t.persist()), c(this, dt, "persisted");
821
+ s(this, k).forEach((t) => t.persist()), c(this, dt, "persisted");
1004
822
  }
1005
823
  finish() {
1006
824
  var t;
1007
- const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n = r(this, w).playbackRate ?? r(this, I);
825
+ const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n = s(this, w).playbackRate ?? s(this, I);
1008
826
  if (n === 0 || n > 0 && e === 1 / 0)
1009
827
  throw new DOMException("InvalidStateError");
1010
828
  g(this, D, $).call(this);
1011
- let i;
1012
- if (n > 0 ? i = e : i = 0, g(this, bt, Pt).call(this, i), this.startTime === null && r(this, p) !== null && r(this, p).currentTime !== null && i !== null) {
1013
- const a = r(this, p) instanceof b ? "percent" : "ms";
1014
- i = h(i, a);
1015
- const o = h(r(this, p).currentTime, a);
1016
- c(this, u, o - i / n);
829
+ let r;
830
+ if (n > 0 ? r = e : r = 0, g(this, bt, Pt).call(this, r), this.startTime === null && s(this, p) !== null && s(this, p).currentTime !== null && r !== null) {
831
+ const a = s(this, p) instanceof b ? "percent" : "ms";
832
+ r = h(r, a);
833
+ const o = h(s(this, p).currentTime, a);
834
+ c(this, u, o - r / n);
1017
835
  }
1018
- r(this, w).task === "pause" && r(this, u) !== null && (c(this, y, null), g(this, z, it).call(this), r(this, R).resolve(this)), r(this, w).task === "play" && r(this, u) !== null && (g(this, z, it).call(this), r(this, R).resolve(this)), g(this, W, F).call(this, !0), r(this, k).forEach((a) => a.finish());
836
+ s(this, w).task === "pause" && s(this, u) !== null && (c(this, y, null), g(this, H, it).call(this), s(this, R).resolve(this)), s(this, w).task === "play" && s(this, u) !== null && (g(this, H, it).call(this), s(this, R).resolve(this)), g(this, W, j).call(this, !0), s(this, k).forEach((a) => a.finish());
1019
837
  }
1020
838
  commitStyles() {
1021
- r(this, k).forEach((t) => {
839
+ s(this, k).forEach((t) => {
1022
840
  t.effect instanceof wt && (t.effect.target === null || t.effect.pseudoElement !== null) || t.commitStyles();
1023
841
  });
1024
842
  }
1025
843
  cancel() {
1026
- this.playState !== "idle" && (g(this, D, $).call(this), r(this, R).reject(new DOMException("The user aborted a request", "AbortError")), g(this, z, it).call(this), c(this, R, new rt()), r(this, P).state === "pending" && r(this, P).reject(new DOMException("The user aborted a request", "AbortError")), c(this, P, new rt()), r(this, k).forEach((t) => t.cancel())), c(this, u, null), c(this, y, null);
844
+ this.playState !== "idle" && (g(this, D, $).call(this), s(this, R).reject(new DOMException("The user aborted a request", "AbortError")), g(this, H, it).call(this), c(this, R, new st()), s(this, P).state === "pending" && s(this, P).reject(new DOMException("The user aborted a request", "AbortError")), c(this, P, new st()), s(this, k).forEach((t) => t.cancel())), c(this, u, null), c(this, y, null);
1027
845
  }
1028
846
  updatePlaybackRate(t) {
1029
847
  var e;
1030
- r(this, w).playbackRate = t;
848
+ s(this, w).playbackRate = t;
1031
849
  const n = this.playState;
1032
- if (r(this, R).state !== "pending")
850
+ if (s(this, R).state !== "pending")
1033
851
  switch (n) {
1034
852
  case "idle":
1035
853
  case "paused":
1036
854
  g(this, D, $).call(this);
1037
855
  break;
1038
856
  case "finished": {
1039
- const i = r(this, p) instanceof b ? "percent" : "ms", a = ((e = r(this, p)) == null ? void 0 : e.currentTime) ?? null;
857
+ const r = s(this, p) instanceof b ? "percent" : "ms", a = ((e = s(this, p)) == null ? void 0 : e.currentTime) ?? null;
1040
858
  if (t === 0)
1041
- c(this, u, h(a, i));
859
+ c(this, u, h(a, r));
1042
860
  else if (a !== null) {
1043
861
  let o = null;
1044
- o = (h(a, i) - (r(this, u) ?? 0)) * this.playbackRate, r(this, u) !== null && o !== null && c(this, u, (h(a, i) - o) / t);
862
+ o = (h(a, r) - (s(this, u) ?? 0)) * this.playbackRate, s(this, u) !== null && o !== null && c(this, u, (h(a, r) - o) / t);
1045
863
  }
1046
- g(this, D, $).call(this), g(this, W, F).call(this, !1), g(this, B, X).call(this);
864
+ g(this, D, $).call(this), g(this, W, j).call(this, !1), g(this, q, X).call(this);
1047
865
  break;
1048
866
  }
1049
867
  default:
@@ -1057,209 +875,209 @@ const fe = class extends EventTarget {
1057
875
  super.removeEventListener(t, e, n);
1058
876
  }
1059
877
  set playbackRate(t) {
1060
- c(this, I, t), r(this, k).forEach((e) => {
878
+ c(this, I, t), s(this, k).forEach((e) => {
1061
879
  e.playbackRate *= t;
1062
880
  });
1063
881
  }
1064
882
  set startTime(t) {
1065
- c(this, u, h(t)), r(this, k).forEach((e) => e.startTime = t);
883
+ c(this, u, h(t)), s(this, k).forEach((e) => e.startTime = t);
1066
884
  }
1067
885
  set currentTime(t) {
1068
886
  var e;
1069
- const n = r(this, p) instanceof b ? "percent" : "ms", i = h(((e = r(this, p)) == null ? void 0 : e.currentTime) ?? null, n);
1070
- if (Y(t) && !Y(i))
887
+ const n = s(this, p) instanceof b ? "percent" : "ms", r = h(((e = s(this, p)) == null ? void 0 : e.currentTime) ?? null, n);
888
+ if (Y(t) && !Y(r))
1071
889
  throw new TypeError("currentTime may not be changed from resolved to unresolved.");
1072
- c(this, V, !1), r(this, y) !== null || r(this, u) === null || i === null || this.playbackRate === 0 ? c(this, y, h(t, n)) : c(this, u, i - h(t, n) / this.playbackRate), (r(this, p) === null || i === null) && c(this, u, null), c(this, G, null), g(this, bt, Pt).call(this, t), r(this, w).task === "pause" && (c(this, y, h(t, n)), g(this, D, $).call(this), c(this, u, null), g(this, z, it).call(this), r(this, R).resolve(this)), g(this, W, F).call(this, !0);
890
+ c(this, V, !1), s(this, y) !== null || s(this, u) === null || r === null || this.playbackRate === 0 ? c(this, y, h(t, n)) : c(this, u, r - h(t, n) / this.playbackRate), (s(this, p) === null || r === null) && c(this, u, null), c(this, G, null), g(this, bt, Pt).call(this, t), s(this, w).task === "pause" && (c(this, y, h(t, n)), g(this, D, $).call(this), c(this, u, null), g(this, H, it).call(this), s(this, R).resolve(this)), g(this, W, j).call(this, !0);
1073
891
  }
1074
892
  set timeline(t) {
1075
893
  var e, n;
1076
- const i = this.timeline;
1077
- if (i === t)
894
+ const r = this.timeline;
895
+ if (r === t)
1078
896
  return;
1079
- r(this, p) instanceof b && r(this, p).removeEventListener("update", r(this, ut));
1080
- const a = this.playState, o = i instanceof b ? "percent" : "ms", l = h(this.currentTime, o), { progress: f = null, endTime: d = 0 } = ((e = r(this, x)) == null ? void 0 : e.getComputedTiming()) ?? {}, m = h(d, o), S = i instanceof b, E = t instanceof b, Z = t instanceof DocumentTimeline, C = this.pending;
897
+ s(this, p) instanceof b && s(this, p).removeEventListener("update", s(this, ut));
898
+ const a = this.playState, o = r instanceof b ? "percent" : "ms", l = h(this.currentTime, o), { progress: f = null, endTime: d = 0 } = ((e = s(this, x)) == null ? void 0 : e.getComputedTiming()) ?? {}, m = h(d, o), S = r instanceof b, E = t instanceof b, Z = t instanceof DocumentTimeline, C = this.pending;
1081
899
  if (E)
1082
- c(this, p, t), t.addEventListener("update", r(this, ut)), g(this, D, $).call(this), c(this, V, !0), c(this, u, null), c(this, y, null), (a === "running" || a === "finished") && ((!r(this, R) || r(this, R).state === "resolved") && g(this, nt, ht).call(this), r(this, w).task = "play", r(this, k).forEach((L) => L.pause())), a === "paused" && f !== null && c(this, y, f * m), C && ((!r(this, R) || r(this, R).state === "resolved") && g(this, nt, ht).call(this), a === "paused" ? r(this, w).task = "pause" : r(this, w).task = "play"), r(this, u) !== null && c(this, y, null), g(this, W, F).call(this, !1);
900
+ c(this, p, t), t.addEventListener("update", s(this, ut)), g(this, D, $).call(this), c(this, V, !0), c(this, u, null), c(this, y, null), (a === "running" || a === "finished") && ((!s(this, R) || s(this, R).state === "resolved") && g(this, nt, ht).call(this), s(this, w).task = "play", s(this, k).forEach((L) => L.pause())), a === "paused" && f !== null && c(this, y, f * m), C && ((!s(this, R) || s(this, R).state === "resolved") && g(this, nt, ht).call(this), a === "paused" ? s(this, w).task = "pause" : s(this, w).task = "play"), s(this, u) !== null && c(this, y, null), g(this, W, j).call(this, !1);
1083
901
  else if (Z) {
1084
902
  if (c(this, p, t), S) {
1085
903
  if (l !== null && f !== null) {
1086
- const { endTime: L = 0 } = ((n = r(this, x)) == null ? void 0 : n.getComputedTiming()) ?? {}, M = h(L, "ms");
904
+ const { endTime: L = 0 } = ((n = s(this, x)) == null ? void 0 : n.getComputedTiming()) ?? {}, M = h(L, "ms");
1087
905
  this.currentTime = f * M;
1088
906
  }
1089
907
  switch (a) {
1090
908
  case "paused":
1091
- r(this, k).forEach((L) => L.pause());
909
+ s(this, k).forEach((L) => L.pause());
1092
910
  break;
1093
911
  case "running":
1094
912
  case "finished":
1095
- r(this, k).forEach((L) => L.play());
913
+ s(this, k).forEach((L) => L.play());
1096
914
  }
1097
915
  }
1098
916
  } else
1099
917
  throw TypeError("Unsupported timeline: " + t);
1100
918
  }
1101
919
  set effect(t) {
1102
- if (t !== r(this, x)) {
1103
- if (this.pending && g(this, z, it).call(this), r(this, x) && N.delete(r(this, x)), t) {
920
+ if (t !== s(this, x)) {
921
+ if (this.pending && g(this, H, it).call(this), s(this, x) && N.delete(s(this, x)), t) {
1104
922
  const e = N.get(t);
1105
923
  e && (e.effect = null), N.set(t, this);
1106
924
  }
1107
- c(this, x, t), g(this, Tt, Ut).call(this), g(this, W, F).call(this, !1);
925
+ c(this, x, t), g(this, Tt, At).call(this), g(this, W, j).call(this, !1);
1108
926
  }
1109
927
  }
1110
928
  get ready() {
1111
- return r(this, R).promise;
929
+ return s(this, R).promise;
1112
930
  }
1113
931
  get finished() {
1114
- return r(this, P).promise;
932
+ return s(this, P).promise;
1115
933
  }
1116
934
  get playState() {
1117
935
  var t;
1118
936
  let { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {};
1119
- const n = r(this, p) instanceof b ? "percent" : "ms", i = h(this.startTime, n), a = h(this.currentTime, n);
1120
- return e = h(e, n), a === null && i === null && r(this, w).task === null ? "idle" : r(this, w).task === "pause" || i === null && r(this, w).task !== "play" ? "paused" : a !== null && (r(this, I) > 0 && a >= e || r(this, I) < 0 && a <= 0) ? "finished" : "running";
937
+ const n = s(this, p) instanceof b ? "percent" : "ms", r = h(this.startTime, n), a = h(this.currentTime, n);
938
+ return e = h(e, n), a === null && r === null && s(this, w).task === null ? "idle" : s(this, w).task === "pause" || r === null && s(this, w).task !== "play" ? "paused" : a !== null && (s(this, I) > 0 && a >= e || s(this, I) < 0 && a <= 0) ? "finished" : "running";
1121
939
  }
1122
940
  get playbackRate() {
1123
- return r(this, I);
941
+ return s(this, I);
1124
942
  }
1125
943
  get replaceState() {
1126
- return r(this, dt);
944
+ return s(this, dt);
1127
945
  }
1128
946
  get pending() {
1129
- return r(this, R).state === "pending";
947
+ return s(this, R).state === "pending";
1130
948
  }
1131
949
  get currentTime() {
1132
950
  var t;
1133
951
  const e = ((t = this.timeline) == null ? void 0 : t.currentTime) ?? null;
1134
- if (r(this, y)) {
952
+ if (s(this, y)) {
1135
953
  if (typeof e == "number")
1136
- return r(this, y);
1137
- const a = r(this, p) instanceof b ? "percent" : "ms";
1138
- return new CSSUnitValue(r(this, y), a);
954
+ return s(this, y);
955
+ const a = s(this, p) instanceof b ? "percent" : "ms";
956
+ return new CSSUnitValue(s(this, y), a);
1139
957
  }
1140
- if (e === null || r(this, u) === null)
958
+ if (e === null || s(this, u) === null)
1141
959
  return null;
1142
- const n = r(this, p) instanceof b ? "percent" : "ms";
1143
- let i = (h(e, n) - r(this, u)) * this.playbackRate;
1144
- return i === -0 && (i = 0), typeof e == "number" ? i : new CSSUnitValue(i, n);
960
+ const n = s(this, p) instanceof b ? "percent" : "ms";
961
+ let r = (h(e, n) - s(this, u)) * this.playbackRate;
962
+ return r === -0 && (r = 0), typeof e == "number" ? r : new CSSUnitValue(r, n);
1145
963
  }
1146
964
  get startTime() {
1147
965
  var t;
1148
- if (r(this, u) === null)
966
+ if (s(this, u) === null)
1149
967
  return null;
1150
968
  if (typeof (((t = this.timeline) == null ? void 0 : t.currentTime) ?? null) == "number")
1151
- return r(this, u);
1152
- const e = r(this, p) instanceof b ? "percent" : "ms";
1153
- return new CSSUnitValue(r(this, u), e);
969
+ return s(this, u);
970
+ const e = s(this, p) instanceof b ? "percent" : "ms";
971
+ return new CSSUnitValue(s(this, u), e);
1154
972
  }
1155
973
  get timeline() {
1156
- return r(this, p);
974
+ return s(this, p);
1157
975
  }
1158
976
  get effect() {
1159
- return r(this, x);
977
+ return s(this, x);
1160
978
  }
1161
979
  };
1162
- p = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakSet(), Pt = function(s) {
980
+ p = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakSet(), Pt = function(i) {
1163
981
  var t;
1164
- const e = h(((t = r(this, p)) == null ? void 0 : t.currentTime) ?? null);
1165
- if (s === null && e !== null)
982
+ const e = h(((t = s(this, p)) == null ? void 0 : t.currentTime) ?? null);
983
+ if (i === null && e !== null)
1166
984
  throw new TypeError();
1167
- s === null || e === null || (s = h(s), c(this, V, !1), r(this, y) !== null || r(this, u) === null || r(this, p) instanceof b && r(this, p).phase === "inactive" || r(this, I) === 0 ? c(this, y, s) : c(this, u, e - s / r(this, I)), r(this, p) instanceof b && r(this, p).phase === "inactive" && c(this, u, null), c(this, G, null));
985
+ i === null || e === null || (i = h(i), c(this, V, !1), s(this, y) !== null || s(this, u) === null || s(this, p) instanceof b && s(this, p).phase === "inactive" || s(this, I) === 0 ? c(this, y, i) : c(this, u, e - i / s(this, I)), s(this, p) instanceof b && s(this, p).phase === "inactive" && c(this, u, null), c(this, G, null));
1168
986
  }, nt = /* @__PURE__ */ new WeakSet(), ht = function() {
1169
- r(this, R).state !== "pending" && c(this, R, new rt()), cancelAnimationFrame(r(this, ct)), c(this, ct, requestAnimationFrame(() => {
1170
- var s;
1171
- (((s = r(this, p)) == null ? void 0 : s.currentTime) ?? null) !== null && (g(this, At, Qt).call(this), r(this, w).task === "play" && (r(this, u) !== null || r(this, y) !== null) ? g(this, Dt, _t).call(this) : r(this, w).task === "pause" && g(this, Nt, Jt).call(this), Promise.all(r(this, k).map((t) => t.finished)).then(r(this, St)), Promise.all(r(this, k).map((t) => new Promise((e) => t.onremove = e))).then(r(this, Wt)), Promise.all(r(this, k).map((t) => new Promise((e) => t.oncancel = e))).then(r(this, It)).then(() => c(this, dt, "removed")));
987
+ s(this, R).state !== "pending" && c(this, R, new st()), cancelAnimationFrame(s(this, ct)), c(this, ct, requestAnimationFrame(() => {
988
+ var i;
989
+ (((i = s(this, p)) == null ? void 0 : i.currentTime) ?? null) !== null && (g(this, Ut, Qt).call(this), s(this, w).task === "play" && (s(this, u) !== null || s(this, y) !== null) ? g(this, Dt, _t).call(this) : s(this, w).task === "pause" && g(this, Nt, Jt).call(this), Promise.all(s(this, k).map((t) => t.finished)).then(s(this, St)), Promise.all(s(this, k).map((t) => new Promise((e) => t.onremove = e))).then(s(this, Wt)), Promise.all(s(this, k).map((t) => new Promise((e) => t.oncancel = e))).then(s(this, It)).then(() => c(this, dt, "removed")));
1172
990
  }));
1173
- }, z = /* @__PURE__ */ new WeakSet(), it = function() {
1174
- cancelAnimationFrame(r(this, ct)), r(this, w).task = null;
991
+ }, H = /* @__PURE__ */ new WeakSet(), it = function() {
992
+ cancelAnimationFrame(s(this, ct)), s(this, w).task = null;
1175
993
  }, Dt = /* @__PURE__ */ new WeakSet(), _t = function() {
1176
- var s;
1177
- const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
994
+ var i;
995
+ const t = ((i = this.timeline) == null ? void 0 : i.currentTime) ?? null;
1178
996
  if (t === null)
1179
997
  return;
1180
- const e = r(this, p) instanceof b ? "percent" : "ms";
1181
- if (r(this, y) !== null)
1182
- g(this, D, $).call(this), this.playbackRate === 0 ? c(this, u, h(t, e)) : (c(this, u, h(t, e) - r(this, y) / this.playbackRate), c(this, y, null));
1183
- else if (r(this, u) !== null && r(this, w).playbackRate !== null) {
1184
- const n = (h(t, e) - r(this, u)) * this.playbackRate;
998
+ const e = s(this, p) instanceof b ? "percent" : "ms";
999
+ if (s(this, y) !== null)
1000
+ g(this, D, $).call(this), this.playbackRate === 0 ? c(this, u, h(t, e)) : (c(this, u, h(t, e) - s(this, y) / this.playbackRate), c(this, y, null));
1001
+ else if (s(this, u) !== null && s(this, w).playbackRate !== null) {
1002
+ const n = (h(t, e) - s(this, u)) * this.playbackRate;
1185
1003
  g(this, D, $).call(this);
1186
- const i = this.playbackRate;
1187
- i === 0 ? (c(this, y, null), c(this, u, h(t, e))) : c(this, u, h(t, e) - n / i);
1004
+ const r = this.playbackRate;
1005
+ r === 0 ? (c(this, y, null), c(this, u, h(t, e))) : c(this, u, h(t, e) - n / r);
1188
1006
  }
1189
- r(this, R).state === "pending" && r(this, R).resolve(this), g(this, W, F).call(this, !1), g(this, B, X).call(this), r(this, w).task = null, this.timeline instanceof DocumentTimeline && r(this, k).forEach((n) => n.play());
1007
+ s(this, R).state === "pending" && s(this, R).resolve(this), g(this, W, j).call(this, !1), g(this, q, X).call(this), s(this, w).task = null, this.timeline instanceof DocumentTimeline && s(this, k).forEach((n) => n.play());
1190
1008
  }, Nt = /* @__PURE__ */ new WeakSet(), Jt = function() {
1191
- var s;
1192
- const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
1009
+ var i;
1010
+ const t = ((i = this.timeline) == null ? void 0 : i.currentTime) ?? null;
1193
1011
  if (t === null)
1194
1012
  return;
1195
- const e = r(this, p) instanceof b ? "percent" : "ms", n = t;
1196
- r(this, u) !== null && r(this, y) === null && c(this, y, (h(n, e) - r(this, u)) * this.playbackRate), g(this, D, $).call(this), c(this, u, null), r(this, R).resolve(this), g(this, W, F).call(this, !1), g(this, B, X).call(this), r(this, w).task = null, r(this, k).forEach((i) => i.pause());
1197
- }, At = /* @__PURE__ */ new WeakSet(), Qt = function() {
1198
- if (r(this, V) && !(!r(this, p) || !r(this, p).currentTime) && !(this.playState === "idle" || this.playState === "paused" && r(this, y) !== null)) {
1199
- if (r(this, p) instanceof b) {
1200
- const s = r(this, w).playbackRate ?? this.playbackRate;
1201
- c(this, u, s >= 0 ? 0 : 100);
1013
+ const e = s(this, p) instanceof b ? "percent" : "ms", n = t;
1014
+ s(this, u) !== null && s(this, y) === null && c(this, y, (h(n, e) - s(this, u)) * this.playbackRate), g(this, D, $).call(this), c(this, u, null), s(this, R).resolve(this), g(this, W, j).call(this, !1), g(this, q, X).call(this), s(this, w).task = null, s(this, k).forEach((r) => r.pause());
1015
+ }, Ut = /* @__PURE__ */ new WeakSet(), Qt = function() {
1016
+ if (s(this, V) && !(!s(this, p) || !s(this, p).currentTime) && !(this.playState === "idle" || this.playState === "paused" && s(this, y) !== null)) {
1017
+ if (s(this, p) instanceof b) {
1018
+ const i = s(this, w).playbackRate ?? this.playbackRate;
1019
+ c(this, u, i >= 0 ? 0 : 100);
1202
1020
  } else
1203
- c(this, u, h(r(this, p).currentTime, "ms"));
1021
+ c(this, u, h(s(this, p).currentTime, "ms"));
1204
1022
  c(this, y, null);
1205
1023
  }
1206
- }, B = /* @__PURE__ */ new WeakSet(), X = function() {
1207
- var s;
1208
- const t = ((s = r(this, p)) == null ? void 0 : s.currentTime) ?? null;
1024
+ }, q = /* @__PURE__ */ new WeakSet(), X = function() {
1025
+ var i;
1026
+ const t = ((i = s(this, p)) == null ? void 0 : i.currentTime) ?? null;
1209
1027
  if (t === null)
1210
1028
  return;
1211
- const e = r(this, x), n = r(this, p) instanceof b ? $e(t, e?.getTiming()) : kt(t);
1212
- let i = null;
1213
- if (r(this, u) !== null) {
1029
+ const e = s(this, x), n = s(this, p) instanceof b ? Pe(t, e?.getTiming()) : kt(t);
1030
+ let r = null;
1031
+ if (s(this, u) !== null) {
1214
1032
  const a = h(t, "percent") === (this.playbackRate < 0 ? 0 : 100) ? this.playbackRate < 0 ? 1e-3 : -1e-3 : 0;
1215
- i = (n - r(this, u)) * this.playbackRate, i += a;
1216
- } else if (r(this, y) !== null)
1217
- i = r(this, y);
1033
+ r = (n - s(this, u)) * this.playbackRate, r += a;
1034
+ } else if (s(this, y) !== null)
1035
+ r = s(this, y);
1218
1036
  else
1219
1037
  return;
1220
- r(this, k).forEach((a) => a.currentTime = i);
1221
- }, ut = /* @__PURE__ */ new WeakMap(), Tt = /* @__PURE__ */ new WeakSet(), Ut = function() {
1222
- var s;
1223
- const t = r(this, x), e = [];
1224
- if (t instanceof qt)
1038
+ s(this, k).forEach((a) => a.currentTime = r);
1039
+ }, ut = /* @__PURE__ */ new WeakMap(), Tt = /* @__PURE__ */ new WeakSet(), At = function() {
1040
+ var i;
1041
+ const t = s(this, x), e = [];
1042
+ if (t instanceof Ht)
1225
1043
  for (let n = 0; n < t.children.length; n++) {
1226
- const i = new fe(t.children.item(n));
1227
- if (t instanceof ze && n > 0) {
1228
- const { endTime: a = null } = ((s = e[n - 1].effect) == null ? void 0 : s.getComputedTiming()) ?? {};
1229
- i.startTime = h(a, "ms");
1044
+ const r = new pe(t.children.item(n));
1045
+ if (t instanceof Oe && n > 0) {
1046
+ const { endTime: a = null } = ((i = e[n - 1].effect) == null ? void 0 : i.getComputedTiming()) ?? {};
1047
+ r.startTime = h(a, "ms");
1230
1048
  }
1231
- e.push(i);
1049
+ e.push(r);
1232
1050
  }
1233
1051
  else {
1234
- const n = r(this, p) instanceof b ? document.timeline : r(this, p);
1235
- e.push(new We(t, n));
1052
+ const n = s(this, p) instanceof b ? document.timeline : s(this, p);
1053
+ e.push(new Me(t, n));
1236
1054
  }
1237
1055
  c(this, k, e);
1238
- }, W = /* @__PURE__ */ new WeakSet(), F = function(s) {
1056
+ }, W = /* @__PURE__ */ new WeakSet(), j = function(i) {
1239
1057
  var t, e;
1240
- const n = ((t = r(this, p)) == null ? void 0 : t.currentTime) ?? null, i = r(this, p) instanceof b ? "percent" : "ms", a = h(this.currentTime, i);
1241
- if (a && r(this, u) !== null && !this.pending) {
1242
- let { delay: o = 0, endDelay: l = 0, iterations: f = 1, duration: d = "auto" } = ((e = r(this, x)) == null ? void 0 : e.getTiming()) ?? {};
1243
- const m = r(this, w).playbackRate ?? this.playbackRate;
1058
+ const n = ((t = s(this, p)) == null ? void 0 : t.currentTime) ?? null, r = s(this, p) instanceof b ? "percent" : "ms", a = h(this.currentTime, r);
1059
+ if (a && s(this, u) !== null && !this.pending) {
1060
+ let { delay: o = 0, endDelay: l = 0, iterations: f = 1, duration: d = "auto" } = ((e = s(this, x)) == null ? void 0 : e.getTiming()) ?? {};
1061
+ const m = s(this, w).playbackRate ?? this.playbackRate;
1244
1062
  if (d === "auto")
1245
- d = r(this, p) instanceof b ? jt : 0;
1063
+ d = s(this, p) instanceof b ? qt : 0;
1246
1064
  else if (d instanceof CSSNumericValue)
1247
1065
  d = d.to("ms").value;
1248
1066
  else if (typeof d == "string")
1249
1067
  throw new TypeError("Unknown effect duration keyword.");
1250
1068
  const S = o + d * f + l;
1251
- let E = h(r(this, G), i);
1252
- m > 0 && a >= S && r(this, G) !== null ? ((E === null || E < S) && (E = S), c(this, y, s ? a : E)) : m < 0 && a <= 0 ? ((E === null || E > 0) && (E = 0), c(this, y, s ? a : E)) : m !== 0 && (s && r(this, y) !== null && (n !== null ? c(this, u, h(n, i) - r(this, y) / m) : c(this, u, null)), c(this, y, null));
1069
+ let E = h(s(this, G), r);
1070
+ m > 0 && a >= S && s(this, G) !== null ? ((E === null || E < S) && (E = S), c(this, y, i ? a : E)) : m < 0 && a <= 0 ? ((E === null || E > 0) && (E = 0), c(this, y, i ? a : E)) : m !== 0 && (i && s(this, y) !== null && (n !== null ? c(this, u, h(n, r) - s(this, y) / m) : c(this, u, null)), c(this, y, null));
1253
1071
  }
1254
- g(this, B, X).call(this), c(this, G, this.currentTime), this.playState === "finished" ? r(this, P).state === "pending" && r(this, St).call(this) : r(this, P).state === "resolved" && c(this, P, new rt());
1072
+ g(this, q, X).call(this), c(this, G, this.currentTime), this.playState === "finished" ? s(this, P).state === "pending" && s(this, St).call(this) : s(this, P).state === "resolved" && c(this, P, new st());
1255
1073
  }, D = /* @__PURE__ */ new WeakSet(), $ = function() {
1256
- r(this, w).playbackRate && (this.playbackRate = r(this, w).playbackRate), r(this, w).playbackRate = null;
1074
+ s(this, w).playbackRate && (this.playbackRate = s(this, w).playbackRate), s(this, w).playbackRate = null;
1257
1075
  }, St = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap();
1258
- let He = fe;
1259
- var st, $t, pe;
1260
- class Ot extends qt {
1076
+ let Ve = pe;
1077
+ var rt, $t, me;
1078
+ class Ot extends Ht {
1261
1079
  constructor(t, e = pt) {
1262
- super(t), v(this, $t), v(this, st, void 0), c(this, st, {
1080
+ super(t), v(this, $t), v(this, rt, void 0), c(this, rt, {
1263
1081
  ...pt,
1264
1082
  ...e
1265
1083
  }), t.forEach((n) => n.updateTiming());
@@ -1271,7 +1089,7 @@ class Ot extends qt {
1271
1089
  super.append(...t), t.forEach((e) => e.updateTiming());
1272
1090
  }
1273
1091
  getTiming() {
1274
- return r(this, st);
1092
+ return s(this, rt);
1275
1093
  }
1276
1094
  getComputedTiming() {
1277
1095
  const t = this.getTiming(), e = { ...t };
@@ -1288,15 +1106,15 @@ class Ot extends qt {
1288
1106
  } = S.getComputedTiming();
1289
1107
  t.delay = t.delay ? Math.min(t.delay, E) : E, t.endDelay = t.endDelay ? Math.max(t.endDelay, Z) : Z, e.endTime = e.endTime ? Math.max(h(e.endTime, "ms"), h(M, "ms")) : M, e.activeDuration = e.activeDuration ? Math.max(h(e.activeDuration, "ms"), h(L, "ms")) : L, t.duration = t.duration instanceof CSSNumericValue ? t.duration.to("ms").value : t.duration, C = C instanceof CSSNumericValue ? C.to("ms").value : C, typeof C != "string" && (t.duration === "auto" ? t.duration = h(C, "ms") : typeof t.duration != "string" && (t.duration = t.duration ? Math.max(t.duration, C) : C));
1290
1108
  }
1291
- const { timeline: n, startTime: i, currentTime: a } = N.get(this) ?? {}, o = n instanceof b ? "percent" : "ms";
1109
+ const { timeline: n, startTime: r, currentTime: a } = N.get(this) ?? {}, o = n instanceof b ? "percent" : "ms";
1292
1110
  let { duration: l = 0, iterations: f = 1, endTime: d = 0 } = e;
1293
1111
  if (l === "auto" && (l = 0), typeof l == "string")
1294
1112
  throw new TypeError("Unknown effect duration keyword.");
1295
- return e.duration = l, e.activeDuration = kt(l) * f, e.startTime = i ?? void 0, e.localTime = a, e.currentIteration = ue(e, he(e, r(this, $t, pe))), n instanceof b ? Bt(e) : (n instanceof DocumentTimeline && (e.progress = a && h(a, o) / h(d, o)), e);
1113
+ return e.duration = l, e.activeDuration = kt(l) * f, e.startTime = r ?? void 0, e.localTime = a, e.currentIteration = de(e, ue(e, s(this, $t, me))), n instanceof b ? zt(e) : (n instanceof DocumentTimeline && (e.progress = a && h(a, o) / h(d, o)), e);
1296
1114
  }
1297
1115
  updateTiming(t) {
1298
- c(this, st, {
1299
- ...r(this, st),
1116
+ c(this, rt, {
1117
+ ...s(this, rt),
1300
1118
  ...t
1301
1119
  });
1302
1120
  for (let e = 0; e < this.children.length; e++) {
@@ -1305,12 +1123,135 @@ class Ot extends qt {
1305
1123
  }
1306
1124
  }
1307
1125
  }
1308
- st = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakSet(), pe = function() {
1309
- const { playbackRate: s = 1 } = N.get(this) ?? {};
1310
- return s < 0 ? "backwards" : "forwards";
1126
+ rt = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakSet(), me = function() {
1127
+ const { playbackRate: i = 1 } = N.get(this) ?? {};
1128
+ return i < 0 ? "backwards" : "forwards";
1311
1129
  };
1312
- class Ge extends at {
1313
- ref = q();
1130
+ function Vt(i, t) {
1131
+ i.endsWith("*") || (i += "**");
1132
+ const e = window.location.origin, n = new URLPattern(i, e).exec(t, e);
1133
+ if (!n)
1134
+ return null;
1135
+ const a = Object.keys(n.pathname.groups).filter((o) => !isNaN(Number(o))).map((o) => n.pathname.groups[o]).filter((o) => o !== void 0).at(oe) ?? "";
1136
+ return new URL(
1137
+ t.replace(a, ""),
1138
+ window.location.origin
1139
+ );
1140
+ }
1141
+ function te(i, t, e = `${window.location.origin}/`, n = !0) {
1142
+ n || (i = i.toLowerCase(), t = t.toLowerCase());
1143
+ const r = Vt(e, t)?.href;
1144
+ if (!r)
1145
+ return null;
1146
+ const a = new URLPattern({
1147
+ baseURL: r,
1148
+ pathname: i
1149
+ }).exec({ pathname: t, baseURL: r }), o = a?.pathname.groups ?? {};
1150
+ return a ? {
1151
+ params: o,
1152
+ caseSensitive: n
1153
+ } : null;
1154
+ }
1155
+ function je(i, t = window) {
1156
+ return new Promise((e) => {
1157
+ queueMicrotask(() => e(
1158
+ t.dispatchEvent(i)
1159
+ ));
1160
+ });
1161
+ }
1162
+ function on(i) {
1163
+ const t = we(i);
1164
+ return t.load = async () => (t.module ??= await i(), t.module), t;
1165
+ }
1166
+ function ln() {
1167
+ return !!window.navigation;
1168
+ }
1169
+ function cn() {
1170
+ return !!globalThis.URLPattern;
1171
+ }
1172
+ async function hn() {
1173
+ const { URLPattern: i } = await import("urlpattern-polyfill");
1174
+ globalThis.URLPattern = i;
1175
+ }
1176
+ async function un() {
1177
+ const { applyPolyfill: i } = await import("@virtualstate/navigation");
1178
+ i({
1179
+ history: !0,
1180
+ interceptEvents: !0,
1181
+ patch: !0,
1182
+ persist: !0,
1183
+ persistState: !0
1184
+ });
1185
+ }
1186
+ async function Fe(i) {
1187
+ const t = [];
1188
+ for (const e of i)
1189
+ t.push(await e);
1190
+ return t;
1191
+ }
1192
+ function Ke(i) {
1193
+ return i.replace(/-([a-z])/g, (t) => t[1].toUpperCase());
1194
+ }
1195
+ function dn(i, t) {
1196
+ return ie(i, t);
1197
+ }
1198
+ function Be(i, t) {
1199
+ const e = { ...i };
1200
+ for (const n of t)
1201
+ delete e[n];
1202
+ return e;
1203
+ }
1204
+ function qe(i) {
1205
+ return Object.create(
1206
+ EventTarget.prototype,
1207
+ {
1208
+ id: {
1209
+ value: i.id,
1210
+ enumerable: !0,
1211
+ writable: !1,
1212
+ configurable: !1
1213
+ },
1214
+ key: {
1215
+ value: i.key,
1216
+ enumerable: !0,
1217
+ writable: !1,
1218
+ configurable: !1
1219
+ },
1220
+ url: {
1221
+ value: i.url,
1222
+ enumerable: !0,
1223
+ writable: !1,
1224
+ configurable: !1
1225
+ },
1226
+ index: {
1227
+ value: i.index,
1228
+ enumerable: !0,
1229
+ writable: !1,
1230
+ configurable: !1
1231
+ },
1232
+ sameDocument: {
1233
+ value: i.sameDocument,
1234
+ enumerable: !0,
1235
+ writable: !1,
1236
+ configurable: !1
1237
+ },
1238
+ getState: {
1239
+ value: () => i.getState(),
1240
+ enumerable: !1,
1241
+ writable: !1,
1242
+ configurable: !1
1243
+ },
1244
+ ondispose: {
1245
+ value: null,
1246
+ enumerable: !0,
1247
+ writable: !0,
1248
+ configurable: !1
1249
+ }
1250
+ }
1251
+ );
1252
+ }
1253
+ class ze extends at {
1254
+ ref = z();
1314
1255
  #t = null;
1315
1256
  #e = null;
1316
1257
  state = {
@@ -1329,24 +1270,24 @@ class Ge extends at {
1329
1270
  return this.#e;
1330
1271
  }
1331
1272
  getKeyframeProperties(t, e) {
1332
- const n = {}, i = window.getComputedStyle(t);
1273
+ const n = {}, r = window.getComputedStyle(t);
1333
1274
  for (const a of e) {
1334
1275
  let o;
1335
- a === "offset" ? o = "cssOffset" : a === "float" ? o = "cssFloat" : o = Se(a), n[o] = i.getPropertyValue(a);
1276
+ a === "offset" ? o = "cssOffset" : a === "float" ? o = "cssFloat" : o = Ke(a), n[o] = r.getPropertyValue(a);
1336
1277
  }
1337
1278
  return n;
1338
1279
  }
1339
1280
  copyStyles(t, e, n) {
1340
- if (!Ae(t))
1281
+ if (!xe(t))
1341
1282
  return;
1342
- const i = window.getComputedStyle(t);
1283
+ const r = window.getComputedStyle(t);
1343
1284
  for (const a of n) {
1344
- const o = i.getPropertyValue(a), l = i.getPropertyPriority(a);
1285
+ const o = r.getPropertyValue(a), l = r.getPropertyPriority(a);
1345
1286
  e.style.setProperty(a, o, l);
1346
1287
  }
1347
1288
  }
1348
1289
  getAnimationEffect(t, e) {
1349
- const n = new Array(), i = {
1290
+ const n = new Array(), r = {
1350
1291
  fill: "both",
1351
1292
  duration: "auto",
1352
1293
  easing: "ease"
@@ -1360,7 +1301,7 @@ class Ge extends at {
1360
1301
  { transform: o, opacity: 1 },
1361
1302
  { transform: l, opacity: 0 }
1362
1303
  ],
1363
- i
1304
+ r
1364
1305
  )
1365
1306
  ), n.push(
1366
1307
  new KeyframeEffect(
@@ -1369,7 +1310,7 @@ class Ge extends at {
1369
1310
  { transform: o },
1370
1311
  { transform: l }
1371
1312
  ],
1372
- i
1313
+ r
1373
1314
  )
1374
1315
  );
1375
1316
  break;
@@ -1382,7 +1323,7 @@ class Ge extends at {
1382
1323
  { opacity: 0, offset: 0.5 },
1383
1324
  { transform: l, opacity: 0 }
1384
1325
  ],
1385
- i
1326
+ r
1386
1327
  )
1387
1328
  ), n.push(
1388
1329
  new KeyframeEffect(
@@ -1392,7 +1333,7 @@ class Ge extends at {
1392
1333
  { opacity: 0, offset: 0.5 },
1393
1334
  { transform: l, opacity: 1 }
1394
1335
  ],
1395
- i
1336
+ r
1396
1337
  )
1397
1338
  );
1398
1339
  break;
@@ -1404,7 +1345,7 @@ class Ge extends at {
1404
1345
  { transform: o, opacity: 1 },
1405
1346
  { transform: l, opacity: 0 }
1406
1347
  ],
1407
- i
1348
+ r
1408
1349
  )
1409
1350
  ), n.push(
1410
1351
  new KeyframeEffect(
@@ -1413,7 +1354,7 @@ class Ge extends at {
1413
1354
  { transform: o },
1414
1355
  { transform: l }
1415
1356
  ],
1416
- i
1357
+ r
1417
1358
  )
1418
1359
  );
1419
1360
  break;
@@ -1437,7 +1378,7 @@ class Ge extends at {
1437
1378
  height: `${e.rect.height}px`
1438
1379
  }
1439
1380
  ],
1440
- i
1381
+ r
1441
1382
  )
1442
1383
  );
1443
1384
  break;
@@ -1451,19 +1392,19 @@ class Ge extends at {
1451
1392
  return null;
1452
1393
  t.previousScene = null, e.previousScene = t;
1453
1394
  const n = new Array();
1454
- for (const [i, a] of Array.from(e.nodes.entries())) {
1455
- const o = a.getBoundingClientRect(), l = t.nodes.get(i);
1395
+ for (const [r, a] of Array.from(e.nodes.entries())) {
1396
+ const o = a.getBoundingClientRect(), l = t.nodes.get(r);
1456
1397
  if (!l?.canTransition || !a.canTransition)
1457
1398
  continue;
1458
1399
  const f = l.getBoundingClientRect(), d = a.clone(), m = l.clone();
1459
1400
  if (!m || !d)
1460
1401
  continue;
1461
1402
  const S = Array.from(/* @__PURE__ */ new Set([...l.styles, ...a.styles]));
1462
- a.transitionType !== "morph" ? (m.id = `${i}-start`, m.style.position = "absolute", m.style.gridArea = "1 / 1", m.style.margin = "0", this.copyStyles(l.ref.current?.firstElementChild, m, S), this.copyStyles(a.ref.current?.firstElementChild, d, S), m.style.width = `${f.width}px`, m.style.height = `${f.height}px`, d.style.width = `${o.width}px`, d.style.height = `${o.height}px`, this.ref.current?.prepend(m)) : (this.copyStyles(l.ref.current?.firstElementChild, d, S), d.style.width = `${f.width}px`, d.style.height = `${f.height}px`), d.id = `${i}${a.transitionType === "morph" ? "" : "-end"}`, d.style.position = "absolute", d.style.gridArea = "1 / 1", d.style.margin = "0", this.ref.current?.prepend(d), l.hide(), a.hide();
1403
+ a.transitionType !== "morph" ? (m.id = `${r}-start`, m.style.position = "absolute", m.style.gridArea = "1 / 1", m.style.margin = "0", this.copyStyles(l.ref.current?.firstElementChild, m, S), this.copyStyles(a.ref.current?.firstElementChild, d, S), m.style.width = `${f.width}px`, m.style.height = `${f.height}px`, d.style.width = `${o.width}px`, d.style.height = `${o.height}px`, this.ref.current?.prepend(m)) : (this.copyStyles(l.ref.current?.firstElementChild, d, S), d.style.width = `${f.width}px`, d.style.height = `${f.height}px`), d.id = `${r}${a.transitionType === "morph" ? "" : "-end"}`, d.style.position = "absolute", d.style.gridArea = "1 / 1", d.style.margin = "0", this.ref.current?.prepend(d), l.hide(), a.hide();
1463
1404
  const E = async () => {
1464
1405
  this.props.direction === "forwards" ? a.unhide() : l.unhide(), d.remove(), m.remove();
1465
1406
  };
1466
- this.props.navigation.addEventListener("transition-end", E, { once: !0 }), this.props.navigation.addEventListener("transition-cancel", E, { once: !0 }), n.push(this.getAnimationEffect(
1407
+ this.props.navigation.addEventListener("routertransitionend", E, { once: !0 }), this.props.navigation.addEventListener("routertransitioncancel", E, { once: !0 }), n.push(this.getAnimationEffect(
1467
1408
  { instance: l, clone: m, rect: f },
1468
1409
  { instance: a, clone: d, rect: o }
1469
1410
  ));
@@ -1487,22 +1428,24 @@ class Ge extends at {
1487
1428
  ` }) });
1488
1429
  }
1489
1430
  }
1490
- class Xe extends at {
1491
- sharedElementTransitionLayer = q();
1492
- animation = new He();
1431
+ class He extends at {
1432
+ sharedElementTransitionLayer = z();
1433
+ animation = new Ve();
1493
1434
  #t = "normal";
1494
1435
  #e = [];
1495
1436
  state = {
1496
1437
  gestureNavigating: !1
1497
1438
  };
1498
1439
  onTransitionCancel() {
1499
- this.props.navigation.dispatchEvent(new xe());
1440
+ this.props.navigation.dispatchEvent(
1441
+ new TransitionEvent("routertransitioncancel")
1442
+ );
1500
1443
  }
1501
1444
  onTransitionStart() {
1502
- this.props.navigation.dispatchEvent(new ke());
1445
+ this.props.navigation.dispatchEvent(new TransitionEvent("routertransitionstart"));
1503
1446
  }
1504
1447
  onTransitionEnd() {
1505
- this.props.navigation.dispatchEvent(new Ce());
1448
+ this.props.navigation.dispatchEvent(new TransitionEvent("routertransitionend"));
1506
1449
  }
1507
1450
  get screens() {
1508
1451
  return this.#e;
@@ -1521,7 +1464,7 @@ class Xe extends at {
1521
1464
  }
1522
1465
  transition() {
1523
1466
  const t = new Ot(
1524
- this.screens.map((i) => i.current?.transitionProvider?.current?.animationEffect ?? null).filter((i) => i !== null)
1467
+ this.screens.map((r) => r.current?.transitionProvider?.current?.animationEffect ?? null).filter((r) => r !== null)
1525
1468
  ), e = this.sharedElementTransitionLayer.current?.animationEffect, n = t.getComputedTiming().duration;
1526
1469
  return e && (e.updateTiming({
1527
1470
  duration: n instanceof CSSNumericValue ? n.to("ms").value : n
@@ -1533,9 +1476,9 @@ class Xe extends at {
1533
1476
  }), this.animation;
1534
1477
  }
1535
1478
  render() {
1536
- return /* @__PURE__ */ te(Ft.Provider, { value: this, children: [
1479
+ return /* @__PURE__ */ ee(Kt.Provider, { value: this, children: [
1537
1480
  /* @__PURE__ */ T(
1538
- Ge,
1481
+ ze,
1539
1482
  {
1540
1483
  ref: this.sharedElementTransitionLayer,
1541
1484
  navigation: this.props.navigation,
@@ -1559,19 +1502,123 @@ class Xe extends at {
1559
1502
  ] });
1560
1503
  }
1561
1504
  }
1505
+ class Ge {
1506
+ promise;
1507
+ state;
1508
+ #t;
1509
+ #e;
1510
+ constructor() {
1511
+ this.state = "pending", this.#t = this.#e = null, this.promise = new Promise((t, e) => {
1512
+ this.#t = t, this.#e = e;
1513
+ });
1514
+ }
1515
+ resolve(t) {
1516
+ this.state = "resolved", this.#t?.(t);
1517
+ }
1518
+ reject(t) {
1519
+ this.state = "rejected", this.promise.catch(() => {
1520
+ }), this.#e?.(t);
1521
+ }
1522
+ }
1523
+ class ge extends Event {
1524
+ #t;
1525
+ #e = !1;
1526
+ #r = !0;
1527
+ #n = !1;
1528
+ #d = null;
1529
+ #f = null;
1530
+ #l;
1531
+ #s;
1532
+ #c = new AbortController();
1533
+ #h = !1;
1534
+ #i = [];
1535
+ #a = null;
1536
+ #u = new Ge();
1537
+ hasUAVisualTransition = !1;
1538
+ constructor(t, e) {
1539
+ super("navigate", { cancelable: !1, bubbles: !1, composed: !1 }), this.#t = t;
1540
+ const {
1541
+ destination: n = window.navigation.currentEntry
1542
+ } = e ?? {};
1543
+ if (!n)
1544
+ throw new Error("Destination is null");
1545
+ this.#l = {
1546
+ getState() {
1547
+ return n.getState();
1548
+ },
1549
+ url: n.url ?? new URL(window.location.href).href,
1550
+ key: n.key,
1551
+ index: n.index,
1552
+ id: n.id,
1553
+ sameDocument: !0
1554
+ }, this.#s = this.#c.signal, window.navigation.addEventListener(
1555
+ "navigate",
1556
+ this.#o,
1557
+ { signal: this.#s }
1558
+ );
1559
+ }
1560
+ #o = (t) => {
1561
+ t !== this ? this.#c.abort() : this.#i.length || window.navigation.removeEventListener("navigate", this.#o);
1562
+ };
1563
+ intercept(t) {
1564
+ if (this.#h)
1565
+ throw new DOMException("Failed to execute 'intercept' on 'NavigateEvent': intercept() may only be called while the navigate event is being dispatched.");
1566
+ const e = t?.handler?.();
1567
+ e && this.#i.push(e), this.#i.length === J && Fe(this.#i).then(() => {
1568
+ this.#h = !0, window.removeEventListener("navigate", this.#o), this.#u.resolve();
1569
+ });
1570
+ }
1571
+ scroll() {
1572
+ throw new Error("Method not implemented.");
1573
+ }
1574
+ get transition() {
1575
+ return this.#a || (this.#a = {
1576
+ finished: this.#u.promise,
1577
+ from: window.navigation.currentEntry,
1578
+ navigationType: this.#t
1579
+ }), this.#a;
1580
+ }
1581
+ get navigationType() {
1582
+ return this.#t;
1583
+ }
1584
+ get userInitiated() {
1585
+ return this.#e;
1586
+ }
1587
+ get canIntercept() {
1588
+ return this.#r;
1589
+ }
1590
+ get hashChange() {
1591
+ return this.#n;
1592
+ }
1593
+ get formData() {
1594
+ return this.#d;
1595
+ }
1596
+ get downloadRequest() {
1597
+ return this.#f;
1598
+ }
1599
+ get destination() {
1600
+ return this.#l;
1601
+ }
1602
+ get signal() {
1603
+ return this.#s;
1604
+ }
1605
+ }
1562
1606
  class Rt extends at {
1563
- ref = q();
1564
- screenTransitionLayer = q();
1607
+ ref = z();
1608
+ screenTransitionLayer = z();
1565
1609
  parent = null;
1566
1610
  #t = null;
1567
1611
  loadDispatched = !1;
1568
1612
  hasUAVisualTransition = !1;
1569
1613
  parentScreen = null;
1570
1614
  static rootRouterRef = null;
1571
- static contextType = oe;
1615
+ static contextType = le;
1572
1616
  constructor(t, e) {
1573
1617
  super(t), this.parentScreen = e?.parentScreen ?? null, this.parent = e?.parentRouter ?? null;
1574
1618
  }
1619
+ static get events() {
1620
+ return Object.getOwnPropertyNames(this.prototype).filter((t) => /^on/.test(t)).map((t) => t.replace("on", ""));
1621
+ }
1575
1622
  componentDidMount() {
1576
1623
  if (this.parent)
1577
1624
  this.parent.child = this;
@@ -1581,48 +1628,62 @@ class Rt extends at {
1581
1628
  throw new Error("It looks like you have two navigators at the same level. Try simplifying your navigation structure by using a nested router instead.");
1582
1629
  Rt.rootRouterRef = new WeakRef(this), window.navigation.addEventListener(
1583
1630
  "navigate",
1584
- this.handleNavigationDispatch
1631
+ this
1585
1632
  );
1586
1633
  }
1587
- this.loadDispatched || (window.navigation.dispatchEvent(new Le()), this.loadDispatched = !0);
1634
+ this.#e(), this.loadDispatched || (window.navigation.dispatchEvent(new ge("load")), this.loadDispatched = !0);
1588
1635
  }
1589
1636
  componentWillUnmount() {
1590
- this.isRoot && window.navigation.removeEventListener(
1637
+ this.#r(), this.isRoot && window.navigation.removeEventListener(
1591
1638
  "navigate",
1592
- this.handleNavigationDispatch
1639
+ this
1593
1640
  );
1594
1641
  }
1595
- handleNavigationDispatch = (t) => {
1596
- const n = [...this.#e()].findLast(
1597
- (i) => i.canIntercept(t)
1642
+ onnavigate(t) {
1643
+ const n = [...this.#n()].findLast(
1644
+ (r) => r.canIntercept(t)
1598
1645
  );
1599
1646
  n && (n.intercept(t), this.hasUAVisualTransition = t.hasUAVisualTransition);
1600
- };
1601
- *#e(t = Rt.rootRouterRef?.deref() ?? null) {
1647
+ }
1648
+ #e() {
1649
+ this.constructor.events.forEach((e) => {
1650
+ this.ref.current?.addEventListener(e, this);
1651
+ });
1652
+ }
1653
+ #r() {
1654
+ this.constructor.events.forEach((e) => {
1655
+ this.ref.current?.removeEventListener(e, this);
1656
+ });
1657
+ }
1658
+ *#n(t = Rt.rootRouterRef?.deref() ?? null) {
1602
1659
  let e = t;
1603
1660
  for (; e; )
1604
1661
  yield e, e = e.child;
1605
1662
  }
1606
1663
  getRouterById(t, e) {
1607
- return [...this.#e(e)].find((i) => i.id === t) ?? null;
1664
+ return [...this.#n(e)].find((r) => r.id === t) ?? null;
1608
1665
  }
1609
1666
  dispatchEvent(t) {
1610
1667
  const e = this.ref.current ?? void 0;
1611
- return be(t, e);
1668
+ return je(t, e);
1612
1669
  }
1613
1670
  addEventListener(t, e, n) {
1614
- const i = this.ref.current;
1615
- return i ? (i.addEventListener(t, e, n), () => i.removeEventListener(t, e, n)) : () => {
1671
+ const r = this.ref.current;
1672
+ return r ? (r.addEventListener(t, e, n), () => r.removeEventListener(t, e, n)) : () => {
1616
1673
  };
1617
1674
  }
1618
1675
  removeEventListener(t, e, n) {
1619
1676
  return this.ref.current?.removeEventListener(t, e, n);
1620
1677
  }
1678
+ handleEvent(t) {
1679
+ const e = `on${t.type}`;
1680
+ this[e]?.(t);
1681
+ }
1621
1682
  screenChildFromPathname(t) {
1622
- for (const e of Gt.toArray(this.props.children)) {
1623
- if (!Ne(e))
1683
+ for (const e of Xt.toArray(this.props.children)) {
1684
+ if (!ke(e))
1624
1685
  continue;
1625
- const n = Xt(
1686
+ const n = te(
1626
1687
  e.props.path,
1627
1688
  t,
1628
1689
  this.baseURLPattern.pathname,
@@ -1638,11 +1699,11 @@ class Rt extends at {
1638
1699
  }
1639
1700
  preloadScreen(t) {
1640
1701
  const e = t.props.config, n = [];
1641
- return j(t.props.component) && n.push(t.props.component.load()), j(e?.header?.component) && n.push(e?.header?.component.load()), j(e?.footer?.component) && n.push(e?.footer?.component.load()), Promise.all(n).then(() => {
1702
+ return B(t.props.component) && n.push(t.props.component.load()), B(e?.header?.component) && n.push(e?.header?.component.load()), B(e?.footer?.component) && n.push(e?.footer?.component.load()), Promise.all(n).then(() => {
1642
1703
  });
1643
1704
  }
1644
1705
  includesRoute(t, e = window.location.origin) {
1645
- return this.pathPatterns.some(({ pattern: n, caseSensitive: i }) => Xt(n, t, e, i));
1706
+ return this.pathPatterns.some(({ pattern: n, caseSensitive: r }) => te(n, t, e, r));
1646
1707
  }
1647
1708
  get id() {
1648
1709
  if (this.props.id)
@@ -1655,19 +1716,19 @@ class Rt extends at {
1655
1716
  }
1656
1717
  get baseURL() {
1657
1718
  const t = this.isRoot ? window.location.pathname : this.parentScreen.resolvedPathname, e = this.baseURLPattern.pathname;
1658
- return Lt(e, t);
1719
+ return Vt(e, t);
1659
1720
  }
1660
1721
  get baseURLPattern() {
1661
1722
  let t = window.location.origin + "/", e = this.props.config?.basePath;
1662
1723
  if (e || (this.isRoot ? e = "/" : e = "."), this.parent && this.parentScreen) {
1663
1724
  const {
1664
1725
  resolvedPathname: n = window.location.pathname,
1665
- path: i
1726
+ path: r
1666
1727
  } = this.parentScreen, a = this.parent.baseURL?.href, o = new URLPattern({
1667
1728
  baseURL: a,
1668
- pathname: i
1729
+ pathname: r
1669
1730
  });
1670
- t = Lt(
1731
+ t = Vt(
1671
1732
  o.pathname,
1672
1733
  n
1673
1734
  ).href;
@@ -1675,7 +1736,7 @@ class Rt extends at {
1675
1736
  return new URLPattern({ baseURL: t, pathname: e });
1676
1737
  }
1677
1738
  get pathPatterns() {
1678
- return Gt.map(this.props.children, (t) => ({
1739
+ return Xt.map(this.props.children, (t) => ({
1679
1740
  pattern: t.props.path,
1680
1741
  caseSensitive: !!t.props.caseSensitive
1681
1742
  }));
@@ -1702,7 +1763,7 @@ class Rt extends at {
1702
1763
  style: { width: "100%", height: "100%" },
1703
1764
  ref: this.ref,
1704
1765
  children: /* @__PURE__ */ T(vt.Provider, { value: this, children: /* @__PURE__ */ T(
1705
- Xe,
1766
+ He,
1706
1767
  {
1707
1768
  id: `${this.id}-transition-layer`,
1708
1769
  ref: this.screenTransitionLayer,
@@ -1715,7 +1776,7 @@ class Rt extends at {
1715
1776
  );
1716
1777
  }
1717
1778
  }
1718
- class Ye {
1779
+ class Xe {
1719
1780
  #t = /* @__PURE__ */ new Map();
1720
1781
  mutationObserver;
1721
1782
  constructor() {
@@ -1739,12 +1800,12 @@ class Ye {
1739
1800
  const e = this.formatMetaKey(t), n = this.#t.get(e);
1740
1801
  if (!n)
1741
1802
  return;
1742
- let i;
1743
- return n.includes(",") && n.includes("=") ? i = n.split(/,\s*/).map((a) => a.split("=")) : i = n, i;
1803
+ let r;
1804
+ return n.includes(",") && n.includes("=") ? r = n.split(/,\s*/).map((a) => a.split("=")) : r = n, r;
1744
1805
  }
1745
1806
  set(t, e) {
1746
- const n = this.formatMetaKey(t), i = this.formatMetaContent(e);
1747
- this.#t.set(n, i), typeof t == "string" && (t = ["name", t]), this.updateMetaElement(t, i);
1807
+ const n = this.formatMetaKey(t), r = this.formatMetaContent(e);
1808
+ this.#t.set(n, r), typeof t == "string" && (t = ["name", t]), this.updateMetaElement(t, r);
1748
1809
  }
1749
1810
  has(t) {
1750
1811
  const e = this.formatMetaKey(t);
@@ -1776,10 +1837,10 @@ class Ye {
1776
1837
  return;
1777
1838
  e.removedNodes.forEach((n) => {
1778
1839
  if (n.nodeName === "META") {
1779
- const i = Array.from(n.attributes).find((l) => l.nodeName !== "content");
1780
- if (!i || !i.value)
1840
+ const r = Array.from(n.attributes).find((l) => l.nodeName !== "content");
1841
+ if (!r || !r.value)
1781
1842
  return;
1782
- const a = [i.nodeName, i.value], o = this.formatMetaKey(a);
1843
+ const a = [r.nodeName, r.value], o = this.formatMetaKey(a);
1783
1844
  this.#t.has(o) && this.#t.delete(o);
1784
1845
  }
1785
1846
  }), e.addedNodes.forEach((n) => {
@@ -1791,7 +1852,7 @@ class Ye {
1791
1852
  const e = Array.from(t.attributes).find((o) => o.nodeName !== "content"), n = Array.from(t.attributes).find((o) => o.nodeName === "content");
1792
1853
  if (!e || !e.value)
1793
1854
  return;
1794
- const i = [e.nodeName, e.value], a = this.formatMetaKey(i);
1855
+ const r = [e.nodeName, e.value], a = this.formatMetaKey(r);
1795
1856
  this.#t.set(a, n?.value);
1796
1857
  }
1797
1858
  formatMetaKey(t) {
@@ -1799,8 +1860,8 @@ class Ye {
1799
1860
  if (typeof t == "string")
1800
1861
  e = `name="${t}"`;
1801
1862
  else {
1802
- const [n, i] = t;
1803
- e = `${n}="${i}"`;
1863
+ const [n, r] = t;
1864
+ e = `${n}="${r}"`;
1804
1865
  }
1805
1866
  return e;
1806
1867
  }
@@ -1811,13 +1872,13 @@ class Ye {
1811
1872
  return typeof t == "string" ? e = t : e = t.map((n) => n.join("=")).join(", "), e;
1812
1873
  }
1813
1874
  updateMetaElement(t, e) {
1814
- const n = document.querySelector(`meta[${this.formatMetaKey(t)}]`) || document.createElement("meta"), [i, a] = t;
1815
- n.setAttribute(i, a), e ? n.setAttribute("content", e) : n.removeAttribute("content"), n.parentElement || document.head.appendChild(n);
1875
+ const n = document.querySelector(`meta[${this.formatMetaKey(t)}]`) || document.createElement("meta"), [r, a] = t;
1876
+ n.setAttribute(r, a), e ? n.setAttribute("content", e) : n.removeAttribute("content"), n.parentElement || document.head.appendChild(n);
1816
1877
  }
1817
1878
  }
1818
- class Vt {
1879
+ class jt {
1819
1880
  static rootNavigatorRef = null;
1820
- metaData = new Ye();
1881
+ metaData = new Xe();
1821
1882
  addEventListener;
1822
1883
  removeEventListener;
1823
1884
  dispatchEvent;
@@ -1827,87 +1888,105 @@ class Vt {
1827
1888
  baseURLPattern;
1828
1889
  getNavigatorById;
1829
1890
  constructor(t) {
1830
- const e = Vt.rootNavigatorRef?.deref();
1831
- (!e || !e.isInDocument) && (Vt.rootNavigatorRef = new WeakRef(this)), this.addEventListener = t.addEventListener, this.removeEventListener = t.removeEventListener, this.dispatchEvent = t.dispatchEvent, this.parent = t.parent, this.routerId = t.routerId, this.baseURL = t.baseURL, this.baseURLPattern = t.baseURLPattern, this.getNavigatorById = t.getNavigatorById;
1891
+ const e = jt.rootNavigatorRef?.deref();
1892
+ (!e || !e.isInDocument) && (jt.rootNavigatorRef = new WeakRef(this)), this.addEventListener = t.addEventListener, this.removeEventListener = t.removeEventListener, this.dispatchEvent = t.dispatchEvent, this.parent = t.parent, this.routerId = t.routerId, this.baseURL = t.baseURL, this.baseURLPattern = t.baseURLPattern, this.getNavigatorById = t.getNavigatorById;
1893
+ }
1894
+ preload(t, e) {
1895
+ const n = new URL(t, this.baseURL).href, r = {
1896
+ getState() {
1897
+ return e;
1898
+ },
1899
+ index: oe,
1900
+ sameDocument: !0,
1901
+ url: n,
1902
+ id: null,
1903
+ key: null
1904
+ }, a = new ge("preload", { destination: r });
1905
+ window.navigation.dispatchEvent(a);
1906
+ const o = qe(r);
1907
+ return {
1908
+ finished: a.transition.finished.then(() => o),
1909
+ committed: Promise.resolve(o)
1910
+ };
1832
1911
  }
1833
1912
  get isInDocument() {
1834
1913
  return !!document.getElementById(`${this.routerId}`);
1835
1914
  }
1836
1915
  }
1837
- function gn() {
1838
- const s = ft(vt);
1839
- if (s)
1840
- return s.navigation;
1916
+ function fn() {
1917
+ const i = ft(vt);
1918
+ if (i)
1919
+ return i.navigation;
1841
1920
  throw new Error("Router is null. You may be trying to call useNavigation outside a Router.");
1842
1921
  }
1843
- function vn() {
1922
+ function pn() {
1844
1923
  return ft(vt);
1845
1924
  }
1846
- function yn() {
1847
- ye("Motion");
1848
- const s = ft(vt), e = ft(Ft).animation, n = 1;
1849
- return ie(
1850
- (i) => {
1925
+ function mn() {
1926
+ Ee("Motion");
1927
+ const i = ft(vt), e = ft(Kt).animation, n = 1;
1928
+ return re(
1929
+ (r) => {
1851
1930
  const a = async () => {
1852
1931
  do
1853
1932
  await new Promise((o) => {
1854
1933
  requestAnimationFrame(o);
1855
- }), i();
1934
+ }), r();
1856
1935
  while (e.playState === "running");
1857
1936
  };
1858
- return s.addEventListener("transition-start", a), () => {
1859
- s.removeEventListener("transition-start", a);
1937
+ return i.addEventListener("routertransitionstart", a), () => {
1938
+ i.removeEventListener("routertransitionstart", a);
1860
1939
  };
1861
1940
  },
1862
1941
  () => {
1863
- const { progress: i } = e?.effect?.getComputedTiming() ?? {};
1864
- return i ?? n;
1942
+ const { progress: r } = e?.effect?.getComputedTiming() ?? {};
1943
+ return r ?? n;
1865
1944
  }
1866
1945
  );
1867
1946
  }
1868
- function Ze() {
1869
- const s = ft(le);
1870
- if (s)
1871
- return s;
1947
+ function Ye() {
1948
+ const i = ft(ce);
1949
+ if (i)
1950
+ return i;
1872
1951
  throw new Error("Router is null. You may be trying to call useRoute outside a Router.");
1873
1952
  }
1874
- function wn(s, t) {
1875
- const e = Ze(), n = t instanceof Function ? t() : t, i = se(e);
1876
- re(() => {
1877
- i.current = e;
1953
+ function gn(i, t) {
1954
+ const e = Ye(), n = t instanceof Function ? t() : t, r = Ft(e);
1955
+ se(() => {
1956
+ r.current = e;
1878
1957
  }, [e]);
1879
- const a = we((l) => {
1880
- const { params: f, setParams: d } = i.current;
1881
- l instanceof Function && (l = l(f[s] ?? n)), d({ [s]: l });
1882
- }, [n, s]);
1883
- return [e.params[s] ?? n, a];
1958
+ const a = be((l) => {
1959
+ const { params: f, setParams: d } = r.current;
1960
+ l instanceof Function && (l = l(f[i] ?? n)), d({ [i]: l });
1961
+ }, [n, i]);
1962
+ return [e.params[i] ?? n, a];
1884
1963
  }
1885
1964
  const mt = "--rerender";
1886
- function En() {
1887
- return ie(
1888
- (s) => (globalThis.addEventListener(
1965
+ function vn() {
1966
+ return re(
1967
+ (i) => (globalThis.addEventListener(
1889
1968
  mt,
1890
- s,
1969
+ i,
1891
1970
  { once: !0 }
1892
1971
  ), () => {
1893
- globalThis.removeEventListener(mt, s);
1972
+ globalThis.removeEventListener(mt, i);
1894
1973
  }),
1895
1974
  () => document.timeline.currentTime
1896
1975
  );
1897
1976
  }
1898
- function bn(s) {
1899
- const t = se(s);
1900
- t.current = s, re(() => {
1977
+ function yn(i) {
1978
+ const t = Ft(i);
1979
+ t.current = i, se(() => {
1901
1980
  const e = t.current;
1902
1981
  return globalThis.addEventListener(mt, e), () => {
1903
1982
  globalThis.removeEventListener(mt, e);
1904
1983
  };
1905
1984
  });
1906
1985
  }
1907
- function Tn() {
1986
+ function wn() {
1908
1987
  globalThis.dispatchEvent(new Event(mt));
1909
1988
  }
1910
- function Sn(s, t) {
1989
+ function En(i, t) {
1911
1990
  return Object.create(EventTarget.prototype, {
1912
1991
  id: {
1913
1992
  value: crypto.randomUUID(),
@@ -1928,7 +2007,7 @@ function Sn(s, t) {
1928
2007
  configurable: !1
1929
2008
  },
1930
2009
  url: {
1931
- value: s,
2010
+ value: i,
1932
2011
  writable: !1,
1933
2012
  enumerable: !0,
1934
2013
  configurable: !1
@@ -1954,60 +2033,60 @@ function Sn(s, t) {
1954
2033
  }
1955
2034
  });
1956
2035
  }
1957
- function Rn() {
2036
+ function bn() {
1958
2037
  if (!window.navigation)
1959
2038
  throw new Error("window.navigation is not available in this environment");
1960
2039
  }
1961
- async function kn() {
1962
- await new Promise((s) => {
2040
+ async function Tn() {
2041
+ await new Promise((i) => {
1963
2042
  window.navigation.addEventListener(
1964
2043
  "navigatesuccess",
1965
- s,
2044
+ i,
1966
2045
  { once: !0 }
1967
2046
  );
1968
2047
  });
1969
2048
  }
1970
- async function Ct(s) {
1971
- await window.navigation.navigate(s).finished;
2049
+ async function Ct(i) {
2050
+ await window.navigation.navigate(i).finished;
1972
2051
  }
1973
- async function xn(s) {
1974
- await window.navigation.traverseTo(s).finished;
2052
+ async function Sn(i) {
2053
+ await window.navigation.traverseTo(i).finished;
1975
2054
  }
1976
- async function Cn() {
1977
- const s = window.navigation.entries()[0];
1978
- await window.navigation.traverseTo(s.key).finished;
2055
+ async function Rn() {
2056
+ const i = window.navigation.entries()[0];
2057
+ await window.navigation.traverseTo(i.key).finished;
1979
2058
  }
1980
- async function Ln() {
2059
+ async function kn() {
1981
2060
  await Ct("/one"), await Ct("/two"), await Ct("/three");
1982
2061
  }
1983
- const me = (s) => {
1984
- s.intercept({
2062
+ const ve = (i) => {
2063
+ i.intercept({
1985
2064
  handler() {
1986
2065
  return Promise.resolve();
1987
2066
  }
1988
2067
  });
1989
2068
  };
1990
- async function Mn() {
1991
- window.navigation.addEventListener("navigate", me);
2069
+ async function xn() {
2070
+ window.navigation.addEventListener("navigate", ve);
1992
2071
  }
1993
- async function Pn() {
1994
- window.navigation.removeEventListener("navigate", me);
2072
+ async function Cn() {
2073
+ window.navigation.removeEventListener("navigate", ve);
1995
2074
  }
1996
- class H extends Ht.Component {
2075
+ class K extends Lt.Component {
1997
2076
  constructor(t) {
1998
2077
  super(t), this.state = {
1999
2078
  href: this.href
2000
2079
  };
2001
2080
  }
2002
- anchorRef = Ht.createRef();
2081
+ anchorRef = Lt.createRef();
2003
2082
  static directionFromRel(t) {
2004
2083
  return t?.split(" ").findLast((e) => e === "next" || e === "prev") ?? "prev";
2005
2084
  }
2006
- static findClosestEntryByHref(t, e, n, i) {
2007
- if (!Array.isArray(n) || i < O || i >= n.length || n.length === J)
2085
+ static findClosestEntryByHref(t, e, n, r) {
2086
+ if (!Array.isArray(n) || r < O || r >= n.length || n.length === J)
2008
2087
  return;
2009
- let a = i - J, o = i + J;
2010
- const l = H.directionFromRel(e);
2088
+ let a = r - J, o = r + J;
2089
+ const l = K.directionFromRel(e);
2011
2090
  for (l === "next" && (a = O), l === "prev" && (o = n.length); a >= O || o < n.length; ) {
2012
2091
  if (a >= O && n[a]?.url === t)
2013
2092
  return n[a];
@@ -2017,7 +2096,7 @@ class H extends Ht.Component {
2017
2096
  }
2018
2097
  }
2019
2098
  static findClosestEntry(t, e, n) {
2020
- switch (H.directionFromRel(t)) {
2099
+ switch (K.directionFromRel(t)) {
2021
2100
  case "prev":
2022
2101
  return e[n - J];
2023
2102
  case "next":
@@ -2035,15 +2114,15 @@ class H extends Ht.Component {
2035
2114
  this.setState({ href: t });
2036
2115
  };
2037
2116
  get href() {
2038
- const { href: t, traverse: e, reload: n, historyEntryKey: i, rel: a } = this.props;
2117
+ const { href: t, traverse: e, reload: n, historyEntryKey: r, rel: a } = this.props;
2039
2118
  if (t === void 0 && e) {
2040
2119
  let o;
2041
- return i ? o = window.navigation?.entries().find((l) => l.key === i) : a && (t ? o = H.findClosestEntryByHref(
2120
+ return r ? o = window.navigation?.entries().find((l) => l.key === r) : a && (t ? o = K.findClosestEntryByHref(
2042
2121
  t,
2043
2122
  a,
2044
2123
  window.navigation.entries(),
2045
2124
  window.navigation.currentEntry?.index ?? O
2046
- ) : o = H.findClosestEntry(
2125
+ ) : o = K.findClosestEntry(
2047
2126
  a,
2048
2127
  window.navigation.entries(),
2049
2128
  window.navigation.currentEntry?.index ?? O
@@ -2052,32 +2131,35 @@ class H extends Ht.Component {
2052
2131
  return ".";
2053
2132
  return t;
2054
2133
  }
2134
+ get search() {
2135
+ return this.props.search ? this.props.search.startsWith("?") ? this.props.search : `?${this.props.search}` : "";
2136
+ }
2055
2137
  handleClick = (t) => {
2056
2138
  if (this.props.onClick?.(t), t.defaultPrevented)
2057
2139
  return;
2058
2140
  t.preventDefault();
2059
2141
  const e = window.navigation, {
2060
2142
  rel: n,
2061
- historyEntryKey: i,
2143
+ historyEntryKey: r,
2062
2144
  reload: a,
2063
2145
  replace: o,
2064
2146
  traverse: l,
2065
2147
  navigateInfo: f,
2066
2148
  navigateState: d
2067
2149
  } = this.props, m = this.anchorRef.current?.href;
2068
- if (i) {
2069
- e.traverseTo(i, { info: f });
2150
+ if (r) {
2151
+ e.traverseTo(r, { info: f });
2070
2152
  return;
2071
2153
  }
2072
2154
  if (l) {
2073
2155
  const S = e.entries();
2074
2156
  let E;
2075
- if (m ? E = H.findClosestEntryByHref(
2157
+ if (m ? E = K.findClosestEntryByHref(
2076
2158
  m,
2077
2159
  n,
2078
2160
  S,
2079
2161
  e.currentEntry?.index ?? O
2080
- ) : E = H.findClosestEntry(
2162
+ ) : E = K.findClosestEntry(
2081
2163
  n,
2082
2164
  S,
2083
2165
  e.currentEntry?.index ?? O
@@ -2100,7 +2182,7 @@ class H extends Ht.Component {
2100
2182
  const {
2101
2183
  rel: t,
2102
2184
  children: e
2103
- } = this.props, { href: n } = this.state, i = Re(this.props, [
2185
+ } = this.props, { href: n } = this.state, { search: r } = this, a = Be(this.props, [
2104
2186
  "historyEntryKey",
2105
2187
  "navigateInfo",
2106
2188
  "navigateState",
@@ -2111,9 +2193,9 @@ class H extends Ht.Component {
2111
2193
  return /* @__PURE__ */ T(
2112
2194
  "a",
2113
2195
  {
2114
- ...i,
2196
+ ...a,
2115
2197
  ref: this.anchorRef,
2116
- href: n ?? void 0,
2198
+ href: n ? `${n}${r}` : void 0,
2117
2199
  rel: t,
2118
2200
  onClick: this.handleClick,
2119
2201
  children: e
@@ -2121,61 +2203,67 @@ class H extends Ht.Component {
2121
2203
  );
2122
2204
  }
2123
2205
  }
2206
+ function Ln({ ref: i, ...t }) {
2207
+ const e = Ft(null);
2208
+ return Lt.useImperativeHandle(
2209
+ i,
2210
+ () => e.current?.anchorRef.current ?? null
2211
+ ), /* @__PURE__ */ T(K, { ref: e, ...t });
2212
+ }
2124
2213
  export {
2125
- H as Anchor,
2126
- an as EMPTY_COLLECTION_LENGTH,
2214
+ Ln as Anchor,
2215
+ K as AnchorBase,
2216
+ sn as EMPTY_COLLECTION_LENGTH,
2127
2217
  O as FIRST_INDEX,
2128
- Ee as LAST_INDEX,
2129
- Le as LoadEvent,
2218
+ oe as LAST_INDEX,
2219
+ ge as LoadEvent,
2130
2220
  rn as MAX_NORM_PROGRESS,
2131
- en as MAX_PROGRESS,
2132
- tn as MAX_Z_INDEX,
2133
- sn as MIN_NORM_PROGRESS,
2134
- nn as MIN_PROGRESS,
2135
- pn as MotionProgressEndEvent,
2136
- fn as MotionProgressStartEvent,
2137
- Vt as NavigationBase,
2138
- oe as NestedRouterContext,
2139
- Te as PromiseAllSequential,
2221
+ tn as MAX_PROGRESS,
2222
+ Qe as MAX_Z_INDEX,
2223
+ nn as MIN_NORM_PROGRESS,
2224
+ en as MIN_PROGRESS,
2225
+ jt as NavigationBase,
2226
+ le as NestedRouterContext,
2227
+ Fe as PromiseAllSequential,
2228
+ Ge as PromiseWrapper,
2229
+ ce as RoutePropContext,
2140
2230
  Rt as RouterBase,
2141
2231
  vt as RouterContext,
2142
2232
  J as SINGLE_ELEMENT_LENGTH,
2143
- De as ScreenBase,
2144
- Qe as SharedElement,
2145
- xe as TransitionCancelEvent,
2146
- Ce as TransitionEndEvent,
2147
- ke as TransitionStartEvent,
2148
- Rn as assertNavigationAvailable,
2233
+ Re as ScreenBase,
2234
+ Je as SharedElement,
2235
+ bn as assertNavigationAvailable,
2149
2236
  dn as cloneAndInject,
2150
- Sn as createHistoryEntry,
2151
- be as dispatchEvent,
2152
- Mn as installInterceptor,
2153
- j as isLazyExoticComponent,
2154
- ce as isNativeLazyExoticComponent,
2237
+ En as createHistoryEntry,
2238
+ je as dispatchEvent,
2239
+ qe as historyEntryFromDestination,
2240
+ xn as installInterceptor,
2241
+ B as isLazyExoticComponent,
2242
+ he as isNativeLazyExoticComponent,
2155
2243
  ln as isNavigationSupported,
2156
- Ae as isStylableElement,
2244
+ xe as isStylableElement,
2157
2245
  cn as isURLPatternSupported,
2158
- Ne as isValidScreenChild,
2246
+ ke as isValidScreenChild,
2159
2247
  on as lazy,
2160
- Xt as matchRoute,
2248
+ te as matchRoute,
2161
2249
  Ct as navTo,
2162
- Re as omit,
2250
+ Be as omit,
2163
2251
  un as polyfillNavigation,
2164
2252
  hn as polyfillURLPattern,
2165
- Lt as resolveBaseURLFromPattern,
2166
- Ln as seedHistory,
2167
- Se as toCamelCase,
2168
- xn as traverseTo,
2169
- Cn as traverseToStart,
2170
- Tn as triggerRerender,
2171
- Pn as uninstallInterceptor,
2172
- yn as useMotion,
2173
- gn as useNavigationBase,
2174
- wn as useParamsBase,
2175
- En as useRerender,
2176
- bn as useRerenderCallback,
2177
- Ze as useRouteBase,
2178
- vn as useRouterBase,
2179
- kn as waitForNavigateSuccess
2253
+ Vt as resolveBaseURLFromPattern,
2254
+ kn as seedHistory,
2255
+ Ke as toCamelCase,
2256
+ Sn as traverseTo,
2257
+ Rn as traverseToStart,
2258
+ wn as triggerRerender,
2259
+ Cn as uninstallInterceptor,
2260
+ mn as useMotion,
2261
+ fn as useNavigationBase,
2262
+ gn as useParamsBase,
2263
+ vn as useRerender,
2264
+ yn as useRerenderCallback,
2265
+ Ye as useRouteBase,
2266
+ pn as useRouterBase,
2267
+ Tn as waitForNavigateSuccess
2180
2268
  };
2181
2269
  //# sourceMappingURL=index.js.map