@react-motion-router/core 2.0.0-beta.sha-0daf7c7 → 2.0.0-beta.sha-b7e17f2

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,9 +1,9 @@
1
1
  import { jsx as T, jsxs as Gt, Fragment as oe } from "react/jsx-runtime";
2
- import { createContext as nt, Component as it, createRef as K, lazy as le, cloneElement as Xt, Suspense as Et, isValidElement as Ut, Children as jt, useContext as yt, useDebugValue as ce } from "react";
3
- const Ht = nt(null);
4
- class Fe extends it {
2
+ import { createContext as it, Component as st, createRef as K, lazy as le, cloneElement as Ht, Suspense as Tt, isValidElement as Xt, Children as jt, useContext as vt, useDebugValue as ce } from "react";
3
+ const Zt = it(null);
4
+ class Be extends st {
5
5
  ref = K();
6
- static contextType = Ht;
6
+ static contextType = Zt;
7
7
  componentDidMount() {
8
8
  this.scene.addNode(this);
9
9
  }
@@ -63,7 +63,7 @@ function bt(s, t) {
63
63
  const a = Object.keys(n.pathname.groups).filter((o) => !isNaN(Number(o))).map((o) => n.pathname.groups[o]).filter((o) => o !== void 0).at(-1) ?? "";
64
64
  return new URL(t.replace(a, ""), window.location.origin);
65
65
  }
66
- function Zt(s, t, e = `${window.location.origin}/`, n = !0) {
66
+ function Yt(s, t, e = `${window.location.origin}/`, n = !0) {
67
67
  n || (s = s.toLowerCase(), t = t.toLowerCase());
68
68
  const r = bt(e, t)?.href;
69
69
  if (!r)
@@ -73,8 +73,8 @@ function Zt(s, t, e = `${window.location.origin}/`, n = !0) {
73
73
  params: o
74
74
  } : null;
75
75
  }
76
- function Be(s, t, e = window.location.origin) {
77
- return s.some(({ pattern: n, caseSensitive: r }) => Zt(n, t, e, r));
76
+ function Ke(s, t, e = window.location.origin) {
77
+ return s.some(({ pattern: n, caseSensitive: r }) => Yt(n, t, e, r));
78
78
  }
79
79
  function he(s, t = window) {
80
80
  return new Promise((e) => {
@@ -83,17 +83,17 @@ function he(s, t = window) {
83
83
  ));
84
84
  });
85
85
  }
86
- function Ke(s) {
86
+ function qe(s) {
87
87
  const t = le(s);
88
88
  return t.load = async () => (t.module ??= await s(), t.module), t;
89
89
  }
90
- function qe() {
90
+ function ze() {
91
91
  return !!window.navigation;
92
92
  }
93
- function ze() {
93
+ function Ge() {
94
94
  return !!globalThis.URLPattern;
95
95
  }
96
- async function Ge() {
96
+ async function He() {
97
97
  const { URLPattern: s } = await import(
98
98
  /*webpackIgnore: true*/
99
99
  "urlpattern-polyfill"
@@ -122,8 +122,8 @@ async function ue(s) {
122
122
  function de(s) {
123
123
  return s.replace(/-([a-z])/g, (t) => t[1].toUpperCase());
124
124
  }
125
- function He(s, t) {
126
- return Xt(s, t);
125
+ function Ze(s, t) {
126
+ return Ht(s, t);
127
127
  }
128
128
  class pe extends Event {
129
129
  constructor() {
@@ -140,7 +140,7 @@ class me extends Event {
140
140
  super("transition-end");
141
141
  }
142
142
  }
143
- class Ze extends Event {
143
+ class Ye extends Event {
144
144
  constructor() {
145
145
  super("motion-progress-start");
146
146
  }
@@ -151,7 +151,7 @@ class ge extends Event {
151
151
  super("motion-progress"), this.progress = t;
152
152
  }
153
153
  }
154
- class Ye extends Event {
154
+ class _e extends Event {
155
155
  constructor() {
156
156
  super("motion-progress-end");
157
157
  }
@@ -234,10 +234,10 @@ class ye extends Event {
234
234
  return this.#i;
235
235
  }
236
236
  }
237
- const Yt = nt(null);
238
- class ve extends it {
237
+ const _t = it(null);
238
+ class ve extends st {
239
239
  ref = K();
240
- static contextType = Yt;
240
+ static contextType = _t;
241
241
  index = 0;
242
242
  exiting = !1;
243
243
  state = {
@@ -256,9 +256,9 @@ class ve extends it {
256
256
  this.props.navigation.removeEventListener("transition-start", this.onAnimationStart), this.props.navigation.removeEventListener("transition-end", this.onAnimationEnd), this.props.navigation.removeEventListener("transition-cancel", this.onAnimationEnd);
257
257
  }
258
258
  get animationEffect() {
259
- const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: r } = this.context, { timeline: a, playbackRate: o } = e, { index: c, exiting: g, ref: p } = this;
259
+ const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: r } = this.context, { timeline: a, playbackRate: o } = e, { index: c, exiting: g, ref: f } = this;
260
260
  return t?.({
261
- ref: p.current,
261
+ ref: f.current,
262
262
  index: c,
263
263
  exiting: g,
264
264
  timeline: a,
@@ -291,7 +291,7 @@ class ve extends it {
291
291
  );
292
292
  }
293
293
  }
294
- const _t = nt(null), vt = nt(null), Jt = nt(null);
294
+ const Jt = it(null), wt = it(null), Qt = it(null);
295
295
  class we {
296
296
  id;
297
297
  nodes = /* @__PURE__ */ new Map();
@@ -327,12 +327,12 @@ class we {
327
327
  return !this.nodes.size;
328
328
  }
329
329
  }
330
- class Ee extends it {
330
+ class Ee extends st {
331
331
  sharedElementScene;
332
332
  #t = K();
333
333
  ref = K();
334
334
  nestedRouterData;
335
- static contextType = vt;
335
+ static contextType = wt;
336
336
  state = {
337
337
  focused: !1,
338
338
  config: {},
@@ -352,7 +352,7 @@ class Ee extends it {
352
352
  return this.state.focused;
353
353
  }
354
354
  get name() {
355
- return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") : te(this.props.component) ? this.props.component.module?.default.name.toLowerCase() : this.props.component.name.toLowerCase();
355
+ return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") : F(this.props.component) ? this.props.component.module?.default.name.toLowerCase() : this.props.component.name.toLowerCase();
356
356
  }
357
357
  blur() {
358
358
  return new Promise((t) => this.setState({ focused: !1 }, t));
@@ -361,15 +361,16 @@ class Ee extends it {
361
361
  return new Promise((t) => this.setState({ focused: !0 }, t));
362
362
  }
363
363
  async load(t) {
364
- let e = this.props.component, n;
365
- "load" in e ? n = await e.load() : n = { default: e };
366
- const r = this.context.navigation, a = this.routeProp;
367
- return await this.props.config?.onLoad?.({ navigation: r, route: a, signal: t }), n;
364
+ let e = this.props.component, n = this.props.config?.header?.component, r = this.props.config?.footer?.component, a;
365
+ F(e) ? a = await e.load() : a = { default: e }, F(n) && await n.load(), F(r) && await r.load();
366
+ const o = this.context.navigation, c = this.routeProp, g = !1;
367
+ return await this.props.config?.onLoad?.({ navigation: o, route: c, signal: t, preloading: g }), a;
368
368
  }
369
369
  async onExited(t) {
370
370
  await this.routeProp.config.onExited?.({
371
371
  route: this.routeProp,
372
372
  navigation: this.context.navigation,
373
+ preloading: !1,
373
374
  signal: t
374
375
  });
375
376
  }
@@ -377,6 +378,7 @@ class Ee extends it {
377
378
  await this.routeProp.config.onExit?.({
378
379
  route: this.routeProp,
379
380
  navigation: this.context.navigation,
381
+ preloading: !1,
380
382
  signal: t
381
383
  });
382
384
  }
@@ -384,6 +386,7 @@ class Ee extends it {
384
386
  await this.routeProp.config.onEnter?.({
385
387
  route: this.routeProp,
386
388
  navigation: this.context.navigation,
389
+ preloading: !1,
387
390
  signal: t
388
391
  });
389
392
  }
@@ -391,6 +394,7 @@ class Ee extends it {
391
394
  await this.routeProp.config.onEntered?.({
392
395
  route: this.routeProp,
393
396
  navigation: this.context.navigation,
397
+ preloading: !1,
394
398
  signal: t
395
399
  });
396
400
  }
@@ -424,10 +428,10 @@ class Ee extends it {
424
428
  flexDirection: "column",
425
429
  pointerEvents: "inherit"
426
430
  },
427
- children: /* @__PURE__ */ T(Ht.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ T(Jt.Provider, { value: e, children: /* @__PURE__ */ Gt(_t.Provider, { value: this.nestedRouterData, children: [
428
- /* @__PURE__ */ T(Et, { fallback: /* @__PURE__ */ T(H, { component: e.config.header?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(H, { component: r, route: e, navigation: t }) }),
429
- /* @__PURE__ */ T(Et, { fallback: /* @__PURE__ */ T(H, { component: this.props.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(H, { component: n, route: e, navigation: t }) }),
430
- /* @__PURE__ */ T(Et, { fallback: /* @__PURE__ */ T(H, { component: e.config.footer?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(H, { component: a, route: e, navigation: t }) })
431
+ children: /* @__PURE__ */ T(Zt.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ T(Qt.Provider, { value: e, children: /* @__PURE__ */ Gt(Jt.Provider, { value: this.nestedRouterData, children: [
432
+ /* @__PURE__ */ T(Tt, { fallback: /* @__PURE__ */ T(Z, { component: e.config.header?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(Z, { component: r, route: e, navigation: t }) }),
433
+ /* @__PURE__ */ T(Tt, { fallback: /* @__PURE__ */ T(Z, { component: this.props.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(Z, { component: n, route: e, navigation: t }) }),
434
+ /* @__PURE__ */ T(Tt, { fallback: /* @__PURE__ */ T(Z, { component: e.config.footer?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(Z, { component: a, route: e, navigation: t }) })
431
435
  ] }) }) })
432
436
  }
433
437
  )
@@ -435,41 +439,41 @@ class Ee extends it {
435
439
  );
436
440
  }
437
441
  }
438
- function H({ component: s, route: t, navigation: e }) {
439
- te(s) && s.module?.default && (s = s.module.default);
442
+ function Z({ component: s, route: t, navigation: e }) {
443
+ F(s) && s.module?.default && (s = s.module.default);
440
444
  const n = s ?? null;
441
- return typeof n == "function" || Qt(n) ? /* @__PURE__ */ T(
445
+ return typeof n == "function" || te(n) ? /* @__PURE__ */ T(
442
446
  n,
443
447
  {
444
448
  navigation: e,
445
449
  route: t
446
450
  }
447
- ) : Ut(n) ? Xt(n, {
451
+ ) : Xt(n) ? Ht(n, {
448
452
  navigation: e,
449
453
  route: t
450
454
  }) : /* @__PURE__ */ T(oe, { children: n });
451
455
  }
452
- function _e(s) {
453
- return Ut(s) ? Object.getPrototypeOf(s.type) === Ee : !1;
456
+ function Te(s) {
457
+ return Xt(s) ? Object.getPrototypeOf(s.type) === Ee : !1;
454
458
  }
455
- function Qt(s) {
459
+ function te(s) {
456
460
  return typeof s == "object" && s !== null && s.$$typeof === Symbol.for("react.lazy");
457
461
  }
458
- function te(s) {
459
- return Qt(s) && "load" in s;
462
+ function F(s) {
463
+ return te(s) && "load" in s;
460
464
  }
461
465
  function be(s) {
462
466
  return "style" in s && s.style instanceof CSSStyleDeclaration;
463
467
  }
464
- var Te = Object.defineProperty, Se = (s, t, e) => t in s ? Te(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, j = (s, t, e) => (Se(s, typeof t != "symbol" ? t + "" : t, e), e), Wt = (s, t, e) => {
468
+ var Se = Object.defineProperty, Re = (s, t, e) => t in s ? Se(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, j = (s, t, e) => (Re(s, typeof t != "symbol" ? t + "" : t, e), e), Wt = (s, t, e) => {
465
469
  if (!t.has(s))
466
470
  throw TypeError("Cannot " + e);
467
471
  }, i = (s, t, e) => (Wt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), m = (s, t, e) => {
468
472
  if (t.has(s))
469
473
  throw TypeError("Cannot add the same private member more than once");
470
474
  t instanceof WeakSet ? t.add(s) : t.set(s, e);
471
- }, l = (s, t, e, n) => (Wt(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), f = (s, t, e) => (Wt(s, t, "access private method"), e);
472
- const ht = {
475
+ }, l = (s, t, e, n) => (Wt(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), p = (s, t, e) => (Wt(s, t, "access private method"), e);
476
+ const ut = {
473
477
  delay: 0,
474
478
  direction: "normal",
475
479
  duration: "auto",
@@ -478,19 +482,19 @@ const ht = {
478
482
  fill: "auto",
479
483
  iterationStart: 0,
480
484
  iterations: 1
481
- }, It = 1e3, Re = window.Animation, ut = window.KeyframeEffect;
485
+ }, It = 1e3, ke = window.Animation, dt = window.KeyframeEffect;
482
486
  function Ft(s) {
483
487
  return Array.isArray(s);
484
488
  }
485
- function X(s) {
489
+ function H(s) {
486
490
  return typeof s == "object" && s === null;
487
491
  }
488
492
  function h(s, t) {
489
- return X(s) || typeof s == "number" ? s : (t || ([t] = Object.keys(s.type())), s.to(t).value);
493
+ return H(s) || typeof s == "number" ? s : (t || ([t] = Object.keys(s.type())), s.to(t).value);
490
494
  }
491
- function ke(s, t = ht) {
495
+ function xe(s, t = ut) {
492
496
  let { duration: e = "auto", iterations: n = 1, playbackRate: r = 1 } = t;
493
- if (X(s))
497
+ if (H(s))
494
498
  return s;
495
499
  if (typeof s == "number" || s.type().percent === void 0)
496
500
  throw new DOMException(
@@ -504,14 +508,14 @@ function ke(s, t = ht) {
504
508
  else if (typeof e == "string")
505
509
  throw new TypeError("Unknown effect duration keyword.");
506
510
  const { delay: a = 0, endDelay: o = 0 } = t, c = e / n * n / Math.abs(r), g = a + c + o;
507
- return st(
511
+ return rt(
508
512
  s.to("percent").value,
509
513
  [0, 100],
510
514
  [0, g]
511
515
  );
512
516
  }
513
- function wt(s) {
514
- if (X(s) || typeof s == "number")
517
+ function Et(s) {
518
+ if (H(s) || typeof s == "number")
515
519
  return s;
516
520
  if (s.type().time !== void 0)
517
521
  throw new DOMException(
@@ -524,31 +528,31 @@ function Bt(s, t) {
524
528
  const e = t.length - 1, n = Math.floor(s * e), r = t[n], a = t[Math.min(n + 1, e)], o = s * e - n;
525
529
  return r + o * (a - r);
526
530
  }
527
- function xe(s, t, e) {
531
+ function Ce(s, t, e) {
528
532
  let n = 0, r = 0;
529
533
  for (const [a, o] of Object.entries(s)) {
530
- const { min: c, max: g } = t, p = e[a] ?? 1, w = (o - c[a]) / (g[a] - c[a]) * p;
531
- n += w, r += p;
534
+ const { min: c, max: g } = t, f = e[a] ?? 1, w = (o - c[a]) / (g[a] - c[a]) * f;
535
+ n += w, r += f;
532
536
  }
533
537
  return n / r;
534
538
  }
535
- function st(s, t, e, n = {}) {
539
+ function rt(s, t, e, n = {}) {
536
540
  let r;
537
541
  if (typeof s == "number" && Ft(t)) {
538
542
  const o = { x: t[0] }, c = { x: t[1] };
539
543
  t = { min: o, max: c }, s = { x: s };
540
544
  } else
541
545
  throw new TypeError("Input and input range must have the same dimensions.");
542
- if (r = xe(s, t, n), r = Ce(r, 0, 1), Ft(e))
546
+ if (r = Ce(s, t, n), r = Me(r, 0, 1), Ft(e))
543
547
  return Bt(r, e);
544
548
  const a = {};
545
549
  for (const o of Object.keys(e.min)) {
546
- const c = e.min[o], g = e.max[o], p = [c, g];
547
- a[o] = Bt(r, p);
550
+ const c = e.min[o], g = e.max[o], f = [c, g];
551
+ a[o] = Bt(r, f);
548
552
  }
549
553
  return a;
550
554
  }
551
- function Ce(s, t, e) {
555
+ function Me(s, t, e) {
552
556
  return s < t ? t : e && s > e ? e : s;
553
557
  }
554
558
  function $t(s) {
@@ -568,13 +572,13 @@ function $t(s) {
568
572
  t = t.to("ms").value;
569
573
  else if (typeof t == "string")
570
574
  throw TypeError("Unknown effect duration keyword.");
571
- const p = t / e, w = p * e / Math.abs(n), S = r + w + a;
572
- t = new CSSUnitValue(p / S * 100, "percent");
573
- const E = CSS.percent(t.to("percent").value * e / Math.abs(n));
575
+ const f = t / e, w = f * e / Math.abs(n), k = r + w + a;
576
+ t = new CSSUnitValue(f / k * 100, "percent");
577
+ const b = CSS.percent(t.to("percent").value * e / Math.abs(n));
574
578
  return o !== null && (c = h(o, "percent") / g.value), {
575
579
  ...s,
576
580
  progress: c,
577
- activeDuration: E,
581
+ activeDuration: b,
578
582
  duration: t,
579
583
  iterations: e,
580
584
  delay: r,
@@ -589,7 +593,7 @@ function ee(s, t) {
589
593
  const o = Math.max(Math.min(a, r), 0), c = Math.max(Math.min(a + e, r), 0);
590
594
  return n < o || t === "backwards" && n === o ? "before" : n > c || t === "forwards" && n === c ? "after" : "active";
591
595
  }
592
- function Me(s, t) {
596
+ function Le(s, t) {
593
597
  let { localTime: e = null, delay: n = 0, activeDuration: r = 0, fill: a } = s;
594
598
  if (r = h(r), e = h(e), e == null || e === void 0)
595
599
  return null;
@@ -604,38 +608,38 @@ function Me(s, t) {
604
608
  return null;
605
609
  }
606
610
  }
607
- function Le(s, t, e) {
611
+ function Pe(s, t, e) {
608
612
  const { duration: n = 0, iterations: r = 1, iterationStart: a = 0 } = s;
609
613
  if (typeof n != "number")
610
614
  throw new TypeError("Duration cannot be unresolved");
611
615
  let o = 0;
612
- return n === 0 ? t === "before" ? o = 0 : o = r : o = e / wt(n), o + a;
616
+ return n === 0 ? t === "before" ? o = 0 : o = r : o = e / Et(n), o + a;
613
617
  }
614
- function Pe(s, t, e, n) {
618
+ function De(s, t, e, n) {
615
619
  const { iterations: r = 1, iterationStart: a = 0, activeDuration: o = 0 } = s;
616
- if (X(e))
620
+ if (H(e))
617
621
  return null;
618
622
  let c = 0;
619
623
  return e === 1 / 0 && (c = a % 1), c === 0 && (t === "active" || t === "after") && o === n && r !== 0 && (c = 1), c;
620
624
  }
621
625
  function ne(s, t) {
622
- const { iterations: e = 1 } = s, n = Me(s, t);
623
- if (X(n))
626
+ const { iterations: e = 1 } = s, n = Le(s, t);
627
+ if (H(n))
624
628
  return null;
625
629
  if (t === "after" && e === 1 / 0)
626
630
  return 1 / 0;
627
- const r = Le(s, t, n);
628
- return Pe(s, t, r, n) === 1 ? Math.floor(r) - 1 : Math.floor(r);
631
+ const r = Pe(s, t, n);
632
+ return De(s, t, r, n) === 1 ? Math.floor(r) - 1 : Math.floor(r);
629
633
  }
630
- class De extends Event {
634
+ class Ae extends Event {
631
635
  constructor(t) {
632
636
  super("update", { bubbles: !1, cancelable: !1, composed: !1 }), j(this, "currentTime"), this.currentTime = t;
633
637
  }
634
638
  }
635
- var N, Z;
636
- class b extends EventTarget {
639
+ var N, Y;
640
+ class E extends EventTarget {
637
641
  constructor(t = { type: "swipe", axis: "x", rangeStart: 0, rangeEnd: window.screen.availWidth, source: document.body }) {
638
- super(), m(this, N, void 0), m(this, Z, void 0), t.source.addEventListener(t.type, this.onGesture.bind(this)), l(this, Z, CSS.percent(0)), l(this, N, t);
642
+ super(), m(this, N, void 0), m(this, Y, void 0), t.source.addEventListener(t.type, this.onGesture.bind(this)), l(this, Y, CSS.percent(0)), l(this, N, t);
639
643
  }
640
644
  onGesture(t) {
641
645
  const e = i(this, N).source.getBoundingClientRect();
@@ -647,7 +651,7 @@ class b extends EventTarget {
647
651
  switch (i(this, N).type) {
648
652
  case "swipe": {
649
653
  const { rangeStart: a, rangeEnd: o } = i(this, N), c = i(this, N).axis;
650
- n = st(
654
+ n = rt(
651
655
  r[c],
652
656
  [h(a, "px"), h(o, "px")],
653
657
  [0, 100]
@@ -656,7 +660,7 @@ class b extends EventTarget {
656
660
  }
657
661
  case "pan": {
658
662
  const { rangeStart: a, rangeEnd: o } = i(this, N), { x: c, y: g } = r;
659
- n = st(
663
+ n = rt(
660
664
  { x: c, y: g },
661
665
  {
662
666
  min: { x: h(a.x, "px"), y: h(a.y, "px") },
@@ -669,7 +673,7 @@ class b extends EventTarget {
669
673
  }
670
674
  case "pinch": {
671
675
  const { rangeStart: a, rangeEnd: o } = i(this, N), { scale: c } = t;
672
- n = st(
676
+ n = rt(
673
677
  c,
674
678
  [h(a, ""), h(o, "")],
675
679
  // figure out which unit
@@ -679,14 +683,14 @@ class b extends EventTarget {
679
683
  }
680
684
  case "rotate": {
681
685
  const { rangeStart: a, rangeEnd: o } = i(this, N), { rotation: c } = t;
682
- n = st(
686
+ n = rt(
683
687
  c,
684
688
  [h(a, "deg"), h(o, "deg")],
685
689
  [0, 100]
686
690
  );
687
691
  }
688
692
  }
689
- l(this, Z, CSS.percent(n)), this.dispatchEvent(new De(i(this, Z)));
693
+ l(this, Y, CSS.percent(n)), this.dispatchEvent(new Ae(i(this, Y)));
690
694
  }
691
695
  addEventListener(t, e, n) {
692
696
  super.addEventListener(t, e, n);
@@ -695,26 +699,26 @@ class b extends EventTarget {
695
699
  super.removeEventListener(t, e, n);
696
700
  }
697
701
  get currentTime() {
698
- return i(this, Z);
702
+ return i(this, Y);
699
703
  }
700
704
  get phase() {
701
705
  return "active";
702
706
  }
703
707
  }
704
- N = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap();
708
+ N = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap();
705
709
  const A = /* @__PURE__ */ new WeakMap();
706
- var rt;
707
- class dt extends ut {
710
+ var at;
711
+ class pt extends dt {
708
712
  constructor(t, e = null) {
709
- super(t), m(this, rt, null), l(this, rt, e);
713
+ super(t), m(this, at, null), l(this, at, e);
710
714
  }
711
715
  get parent() {
712
- return i(this, rt);
716
+ return i(this, at);
713
717
  }
714
718
  getTiming() {
715
719
  var t;
716
720
  const e = super.getTiming();
717
- if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof b) {
721
+ if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof E) {
718
722
  if (e.duration === 1 / 0)
719
723
  throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
720
724
  if (e.iterations === 1 / 0)
@@ -725,7 +729,7 @@ class dt extends ut {
725
729
  getComputedTiming() {
726
730
  var t;
727
731
  const e = super.getComputedTiming();
728
- if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof b) {
732
+ if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof E) {
729
733
  if (e.duration === 1 / 0)
730
734
  throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
731
735
  if (e.iterations === 1 / 0)
@@ -742,12 +746,12 @@ class dt extends ut {
742
746
  duration: n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration,
743
747
  ...t
744
748
  };
745
- let r = i(this, rt);
749
+ let r = i(this, at);
746
750
  for (; r; ) {
747
751
  const a = r.getTiming();
748
752
  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;
749
753
  }
750
- if (((e = A.get(this)) == null ? void 0 : e.timeline) instanceof b) {
754
+ if (((e = A.get(this)) == null ? void 0 : e.timeline) instanceof E) {
751
755
  if (t?.duration === 1 / 0)
752
756
  throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
753
757
  if (t != null && t.iterations)
@@ -756,14 +760,14 @@ class dt extends ut {
756
760
  return super.updateTiming(t);
757
761
  }
758
762
  }
759
- rt = /* @__PURE__ */ new WeakMap();
760
- var U, Y;
761
- const Ae = class pt {
763
+ at = /* @__PURE__ */ new WeakMap();
764
+ var U, _;
765
+ const Ne = class ft {
762
766
  constructor(t) {
763
- m(this, U, []), m(this, Y, null), l(this, U, t.map((e) => (e instanceof pt ? l(e, Y, this) : e instanceof ut && (e = new dt(e, this)), e)));
767
+ m(this, U, []), m(this, _, null), l(this, U, t.map((e) => (e instanceof ft ? l(e, _, this) : e instanceof dt && (e = new pt(e, this)), e)));
764
768
  }
765
769
  get parent() {
766
- return i(this, Y);
770
+ return i(this, _);
767
771
  }
768
772
  get children() {
769
773
  const t = i(this, U);
@@ -785,18 +789,18 @@ const Ae = class pt {
785
789
  }
786
790
  append(...t) {
787
791
  t.forEach((e) => {
788
- i(this, U).includes(e) || (e instanceof pt ? l(e, Y, this) : e instanceof ut && (e = new dt(e, this)), i(this, U).push(e));
792
+ i(this, U).includes(e) || (e instanceof ft ? l(e, _, this) : e instanceof dt && (e = new pt(e, this)), i(this, U).push(e));
789
793
  });
790
794
  }
791
795
  prepend(...t) {
792
796
  t.forEach((e) => {
793
- i(this, U).includes(e) || (e instanceof pt ? l(e, Y, this) : e instanceof ut && (e = new dt(e, this)), i(this, U).unshift(e));
797
+ i(this, U).includes(e) || (e instanceof ft ? l(e, _, this) : e instanceof dt && (e = new pt(e, this)), i(this, U).unshift(e));
794
798
  });
795
799
  }
796
800
  };
797
- U = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap();
798
- let Ot = Ae;
799
- class et {
801
+ U = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap();
802
+ let Ot = Ne;
803
+ class nt {
800
804
  constructor() {
801
805
  j(this, "promise"), j(this, "state"), j(this, "nativeResolve"), j(this, "nativeReject"), this.state = "pending", this.nativeResolve = this.nativeReject = null, this.promise = new Promise((t, e) => {
802
806
  this.nativeResolve = t, this.nativeReject = e;
@@ -812,11 +816,11 @@ class et {
812
816
  }), (e = this.nativeReject) == null || e.call(this, t);
813
817
  }
814
818
  }
815
- var _, Tt, ie;
816
- class Ne extends Ot {
817
- constructor(t, e = ht) {
818
- super(t), m(this, Tt), m(this, _, void 0), l(this, _, {
819
- ...ht,
819
+ var J, St, ie;
820
+ class Ue extends Ot {
821
+ constructor(t, e = ut) {
822
+ super(t), m(this, St), m(this, J, void 0), l(this, J, {
823
+ ...ut,
820
824
  ...e
821
825
  });
822
826
  }
@@ -827,7 +831,7 @@ class Ne extends Ot {
827
831
  super.append(...t), t.forEach((e) => e.updateTiming());
828
832
  }
829
833
  getTiming() {
830
- return i(this, _);
834
+ return i(this, J);
831
835
  }
832
836
  getComputedTiming() {
833
837
  var t, e;
@@ -843,15 +847,15 @@ class Ne extends Ot {
843
847
  } = M.getComputedTiming();
844
848
  r.activeDuration = r.activeDuration ? h(r.activeDuration, "ms") + h(Vt, "ms") : Vt, n.duration = n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration, L = L instanceof CSSNumericValue ? L.to("ms").value : L, typeof L != "string" && (n.duration === "auto" ? n.duration = h(L, "ms") : typeof n.duration != "string" && (n.duration = n.duration ? n.duration + L : L));
845
849
  }
846
- const { timeline: g, startTime: p, currentTime: w } = A.get(this) ?? {}, S = g instanceof b ? "percent" : "ms";
847
- let { duration: E = 0, iterations: F = 1 } = r;
848
- if (E === "auto" && (E = 0), typeof E == "string")
850
+ const { timeline: g, startTime: f, currentTime: w } = A.get(this) ?? {}, k = g instanceof E ? "percent" : "ms";
851
+ let { duration: b = 0, iterations: X = 1 } = r;
852
+ if (b === "auto" && (b = 0), typeof b == "string")
849
853
  throw new TypeError("Unknown effect duration keyword.");
850
- return r.duration = E, r.activeDuration = wt(E) * F, r.startTime = p ?? void 0, r.localTime = w, r.currentIteration = ne(r, ee(r, i(this, Tt, ie))), g instanceof b ? $t(r) : (g instanceof DocumentTimeline && (r.progress = w && h(w, S) / h(c, S)), r);
854
+ return r.duration = b, r.activeDuration = Et(b) * X, r.startTime = f ?? void 0, r.localTime = w, r.currentIteration = ne(r, ee(r, i(this, St, ie))), g instanceof E ? $t(r) : (g instanceof DocumentTimeline && (r.progress = w && h(w, k) / h(c, k)), r);
851
855
  }
852
856
  updateTiming(t) {
853
- l(this, _, {
854
- ...i(this, _),
857
+ l(this, J, {
858
+ ...i(this, J),
855
859
  ...t
856
860
  });
857
861
  for (let e = 0; e < this.children.length; e++) {
@@ -860,19 +864,19 @@ class Ne extends Ot {
860
864
  }
861
865
  }
862
866
  }
863
- _ = /* @__PURE__ */ new WeakMap(), Tt = /* @__PURE__ */ new WeakSet(), ie = function() {
867
+ J = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), ie = function() {
864
868
  const { playbackRate: s = 1 } = A.get(this) ?? {};
865
869
  return s < 0 ? "backwards" : "forwards";
866
870
  };
867
- var d, x, ct, v, R, P, u, y, k, z, O, at, W, ft, St, J, ot, q, Q, Rt, Kt, kt, qt, xt, zt, B, G, lt, mt, Ct, I, V, D, $, gt, Mt, Lt;
871
+ var d, x, ht, v, S, P, u, y, R, z, O, ot, W, mt, Rt, Q, lt, q, tt, kt, Kt, xt, qt, Ct, zt, B, G, ct, gt, Mt, I, V, D, $, yt, Lt, Pt;
868
872
  const se = class extends EventTarget {
869
873
  constructor(t, e) {
870
- super(), m(this, ft), m(this, J), m(this, q), m(this, Rt), m(this, kt), m(this, xt), m(this, B), m(this, mt), m(this, I), m(this, D), j(this, "id", ""), j(this, "oncancel", null), j(this, "onfinish", null), j(this, "onremove", null), m(this, d, void 0), m(this, x, void 0), m(this, ct, "active"), m(this, v, {
874
+ super(), m(this, mt), m(this, Q), m(this, q), m(this, kt), m(this, xt), m(this, Ct), m(this, B), m(this, gt), m(this, I), m(this, D), j(this, "id", ""), j(this, "oncancel", null), j(this, "onfinish", null), j(this, "onremove", null), m(this, d, void 0), m(this, x, void 0), m(this, ht, "active"), m(this, v, {
871
875
  task: null,
872
876
  playbackRate: null
873
- }), m(this, R, new et()), m(this, P, new et()), m(this, u, null), m(this, y, null), m(this, k, []), m(this, z, null), m(this, O, !1), m(this, at, 0), m(this, W, 1), m(this, lt, () => {
874
- f(this, B, G).call(this);
875
- }), m(this, gt, () => {
877
+ }), m(this, S, new nt()), m(this, P, new nt()), m(this, u, null), m(this, y, null), m(this, R, []), m(this, z, null), m(this, O, !1), m(this, ot, 0), m(this, W, 1), m(this, ct, () => {
878
+ p(this, B, G).call(this);
879
+ }), m(this, yt, () => {
876
880
  var n;
877
881
  if (i(this, P).state !== "pending" || this.playState !== "finished")
878
882
  return;
@@ -892,7 +896,7 @@ const se = class extends EventTarget {
892
896
  var c;
893
897
  this.dispatchEvent(o), (c = this.onfinish) == null || c.call(this, o);
894
898
  });
895
- }), m(this, Mt, () => {
899
+ }), m(this, Lt, () => {
896
900
  var n, r;
897
901
  const a = this.currentTime, o = (n = this.timeline) == null ? void 0 : n.currentTime, c = new AnimationPlaybackEvent(
898
902
  "cancel",
@@ -906,11 +910,11 @@ const se = class extends EventTarget {
906
910
  }
907
911
  );
908
912
  this.dispatchEvent(c), (r = this.oncancel) == null || r.call(this, c);
909
- }), m(this, Lt, () => {
913
+ }), m(this, Pt, () => {
910
914
  var n;
911
915
  const r = new Event("remove");
912
916
  this.dispatchEvent(r), (n = this.onremove) == null || n.call(this, r);
913
- }), i(this, R).resolve(this), l(this, x, t ?? null), l(this, d, e ?? document.timeline), i(this, x) && A.set(i(this, x), this), f(this, mt, Ct).call(this), e instanceof b && e.addEventListener("update", i(this, lt));
917
+ }), i(this, S).resolve(this), l(this, x, t ?? null), l(this, d, e ?? document.timeline), i(this, x) && A.set(i(this, x), this), p(this, gt, Mt).call(this), e instanceof E && e.addEventListener("update", i(this, ct));
914
918
  }
915
919
  reverse() {
916
920
  var t;
@@ -929,56 +933,56 @@ const se = class extends EventTarget {
929
933
  play() {
930
934
  const t = this.playState === "paused" && this.pending;
931
935
  let e = this.currentTime;
932
- (i(this, v).playbackRate ?? this.playbackRate) === 0 && e === null && l(this, y, 0), e === null && l(this, O, !0), (this.playState === "finished" || t) && (l(this, u, null), l(this, y, null), l(this, O, !0)), i(this, y) && l(this, u, null), i(this, v).task && (i(this, v).task = null), !(i(this, u) !== null && i(this, y) === null && !t && i(this, v).playbackRate === null) && (f(this, B, G).call(this), f(this, J, ot).call(this), i(this, v).task = "play", f(this, I, V).call(this, !1));
936
+ (i(this, v).playbackRate ?? this.playbackRate) === 0 && e === null && l(this, y, 0), e === null && l(this, O, !0), (this.playState === "finished" || t) && (l(this, u, null), l(this, y, null), l(this, O, !0)), i(this, y) && l(this, u, null), i(this, v).task && (i(this, v).task = null), !(i(this, u) !== null && i(this, y) === null && !t && i(this, v).playbackRate === null) && (p(this, B, G).call(this), p(this, Q, lt).call(this), i(this, v).task = "play", p(this, I, V).call(this, !1));
933
937
  }
934
938
  pause() {
935
- this.playState !== "paused" && (this.currentTime === null && l(this, O, !0), i(this, v).task && (i(this, v).task = null), f(this, J, ot).call(this), i(this, v).task = "pause");
939
+ this.playState !== "paused" && (this.currentTime === null && l(this, O, !0), i(this, v).task && (i(this, v).task = null), p(this, Q, lt).call(this), i(this, v).task = "pause");
936
940
  }
937
941
  persist() {
938
- i(this, k).forEach((t) => t.persist()), l(this, ct, "persisted");
942
+ i(this, R).forEach((t) => t.persist()), l(this, ht, "persisted");
939
943
  }
940
944
  finish() {
941
945
  var t;
942
946
  const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n = i(this, v).playbackRate ?? i(this, W);
943
947
  if (n === 0 || n > 0 && e === 1 / 0)
944
948
  throw new DOMException("InvalidStateError");
945
- f(this, D, $).call(this);
949
+ p(this, D, $).call(this);
946
950
  let r;
947
- if (n > 0 ? r = e : r = 0, f(this, ft, St).call(this, r), this.startTime === null && i(this, d) !== null && i(this, d).currentTime !== null && r !== null) {
948
- const a = i(this, d) instanceof b ? "percent" : "ms";
951
+ if (n > 0 ? r = e : r = 0, p(this, mt, Rt).call(this, r), this.startTime === null && i(this, d) !== null && i(this, d).currentTime !== null && r !== null) {
952
+ const a = i(this, d) instanceof E ? "percent" : "ms";
949
953
  r = h(r, a);
950
954
  const o = h(i(this, d).currentTime, a);
951
955
  l(this, u, o - r / n);
952
956
  }
953
- i(this, v).task === "pause" && i(this, u) !== null && (l(this, y, null), f(this, q, Q).call(this), i(this, R).resolve(this)), i(this, v).task === "play" && i(this, u) !== null && (f(this, q, Q).call(this), i(this, R).resolve(this)), f(this, I, V).call(this, !0), i(this, k).forEach((a) => a.finish());
957
+ i(this, v).task === "pause" && i(this, u) !== null && (l(this, y, null), p(this, q, tt).call(this), i(this, S).resolve(this)), i(this, v).task === "play" && i(this, u) !== null && (p(this, q, tt).call(this), i(this, S).resolve(this)), p(this, I, V).call(this, !0), i(this, R).forEach((a) => a.finish());
954
958
  }
955
959
  commitStyles() {
956
- i(this, k).forEach((t) => {
957
- t.effect instanceof dt && (t.effect.target === null || t.effect.pseudoElement !== null) || t.commitStyles();
960
+ i(this, R).forEach((t) => {
961
+ t.effect instanceof pt && (t.effect.target === null || t.effect.pseudoElement !== null) || t.commitStyles();
958
962
  });
959
963
  }
960
964
  cancel() {
961
- this.playState !== "idle" && (f(this, D, $).call(this), i(this, R).reject(new DOMException("The user aborted a request", "AbortError")), f(this, q, Q).call(this), l(this, R, new et()), i(this, P).state === "pending" && i(this, P).reject(new DOMException("The user aborted a request", "AbortError")), l(this, P, new et()), i(this, k).forEach((t) => t.cancel())), l(this, u, null), l(this, y, null);
965
+ this.playState !== "idle" && (p(this, D, $).call(this), i(this, S).reject(new DOMException("The user aborted a request", "AbortError")), p(this, q, tt).call(this), l(this, S, new nt()), i(this, P).state === "pending" && i(this, P).reject(new DOMException("The user aborted a request", "AbortError")), l(this, P, new nt()), i(this, R).forEach((t) => t.cancel())), l(this, u, null), l(this, y, null);
962
966
  }
963
967
  updatePlaybackRate(t) {
964
968
  var e;
965
969
  i(this, v).playbackRate = t;
966
970
  const n = this.playState;
967
- if (i(this, R).state !== "pending")
971
+ if (i(this, S).state !== "pending")
968
972
  switch (n) {
969
973
  case "idle":
970
974
  case "paused":
971
- f(this, D, $).call(this);
975
+ p(this, D, $).call(this);
972
976
  break;
973
977
  case "finished": {
974
- const r = i(this, d) instanceof b ? "percent" : "ms", a = ((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null;
978
+ const r = i(this, d) instanceof E ? "percent" : "ms", a = ((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null;
975
979
  if (t === 0)
976
980
  l(this, u, h(a, r));
977
981
  else if (a !== null) {
978
982
  let o = null;
979
983
  o = (h(a, r) - (i(this, u) ?? 0)) * this.playbackRate, i(this, u) !== null && o !== null && l(this, u, (h(a, r) - o) / t);
980
984
  }
981
- f(this, D, $).call(this), f(this, I, V).call(this, !1), f(this, B, G).call(this);
985
+ p(this, D, $).call(this), p(this, I, V).call(this, !1), p(this, B, G).call(this);
982
986
  break;
983
987
  }
984
988
  default:
@@ -992,42 +996,42 @@ const se = class extends EventTarget {
992
996
  super.removeEventListener(t, e, n);
993
997
  }
994
998
  set playbackRate(t) {
995
- l(this, W, t), i(this, k).forEach((e) => {
999
+ l(this, W, t), i(this, R).forEach((e) => {
996
1000
  e.playbackRate *= t;
997
1001
  });
998
1002
  }
999
1003
  set startTime(t) {
1000
- l(this, u, h(t)), i(this, k).forEach((e) => e.startTime = t);
1004
+ l(this, u, h(t)), i(this, R).forEach((e) => e.startTime = t);
1001
1005
  }
1002
1006
  set currentTime(t) {
1003
1007
  var e;
1004
- const n = i(this, d) instanceof b ? "percent" : "ms", r = h(((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null, n);
1005
- if (X(t) && !X(r))
1008
+ const n = i(this, d) instanceof E ? "percent" : "ms", r = h(((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null, n);
1009
+ if (H(t) && !H(r))
1006
1010
  throw new TypeError("currentTime may not be changed from resolved to unresolved.");
1007
- l(this, O, !1), i(this, y) !== null || i(this, u) === null || r === null || this.playbackRate === 0 ? l(this, y, h(t, n)) : l(this, u, r - h(t, n) / this.playbackRate), (i(this, d) === null || r === null) && l(this, u, null), l(this, z, null), f(this, ft, St).call(this, t), i(this, v).task === "pause" && (l(this, y, h(t, n)), f(this, D, $).call(this), l(this, u, null), f(this, q, Q).call(this), i(this, R).resolve(this)), f(this, I, V).call(this, !0);
1011
+ l(this, O, !1), i(this, y) !== null || i(this, u) === null || r === null || this.playbackRate === 0 ? l(this, y, h(t, n)) : l(this, u, r - h(t, n) / this.playbackRate), (i(this, d) === null || r === null) && l(this, u, null), l(this, z, null), p(this, mt, Rt).call(this, t), i(this, v).task === "pause" && (l(this, y, h(t, n)), p(this, D, $).call(this), l(this, u, null), p(this, q, tt).call(this), i(this, S).resolve(this)), p(this, I, V).call(this, !0);
1008
1012
  }
1009
1013
  set timeline(t) {
1010
1014
  var e, n;
1011
1015
  const r = this.timeline;
1012
1016
  if (r === t)
1013
1017
  return;
1014
- i(this, d) instanceof b && i(this, d).removeEventListener("update", i(this, lt));
1015
- const a = this.playState, o = r instanceof b ? "percent" : "ms", c = h(this.currentTime, o), { progress: g = null, endTime: p = 0 } = ((e = i(this, x)) == null ? void 0 : e.getComputedTiming()) ?? {}, w = h(p, o), S = r instanceof b, E = t instanceof b, F = t instanceof DocumentTimeline, C = this.pending;
1016
- if (E)
1017
- l(this, d, t), t.addEventListener("update", i(this, lt)), f(this, D, $).call(this), l(this, O, !0), l(this, u, null), l(this, y, null), (a === "running" || a === "finished") && ((!i(this, R) || i(this, R).state === "resolved") && f(this, J, ot).call(this), i(this, v).task = "play", i(this, k).forEach((M) => M.pause())), a === "paused" && g !== null && l(this, y, g * w), C && ((!i(this, R) || i(this, R).state === "resolved") && f(this, J, ot).call(this), a === "paused" ? i(this, v).task = "pause" : i(this, v).task = "play"), i(this, u) !== null && l(this, y, null), f(this, I, V).call(this, !1);
1018
- else if (F) {
1019
- if (l(this, d, t), S) {
1018
+ i(this, d) instanceof E && i(this, d).removeEventListener("update", i(this, ct));
1019
+ const a = this.playState, o = r instanceof E ? "percent" : "ms", c = h(this.currentTime, o), { progress: g = null, endTime: f = 0 } = ((e = i(this, x)) == null ? void 0 : e.getComputedTiming()) ?? {}, w = h(f, o), k = r instanceof E, b = t instanceof E, X = t instanceof DocumentTimeline, C = this.pending;
1020
+ if (b)
1021
+ l(this, d, t), t.addEventListener("update", i(this, ct)), p(this, D, $).call(this), l(this, O, !0), l(this, u, null), l(this, y, null), (a === "running" || a === "finished") && ((!i(this, S) || i(this, S).state === "resolved") && p(this, Q, lt).call(this), i(this, v).task = "play", i(this, R).forEach((M) => M.pause())), a === "paused" && g !== null && l(this, y, g * w), C && ((!i(this, S) || i(this, S).state === "resolved") && p(this, Q, lt).call(this), a === "paused" ? i(this, v).task = "pause" : i(this, v).task = "play"), i(this, u) !== null && l(this, y, null), p(this, I, V).call(this, !1);
1022
+ else if (X) {
1023
+ if (l(this, d, t), k) {
1020
1024
  if (c !== null && g !== null) {
1021
1025
  const { endTime: M = 0 } = ((n = i(this, x)) == null ? void 0 : n.getComputedTiming()) ?? {}, L = h(M, "ms");
1022
1026
  this.currentTime = g * L;
1023
1027
  }
1024
1028
  switch (a) {
1025
1029
  case "paused":
1026
- i(this, k).forEach((M) => M.pause());
1030
+ i(this, R).forEach((M) => M.pause());
1027
1031
  break;
1028
1032
  case "running":
1029
1033
  case "finished":
1030
- i(this, k).forEach((M) => M.play());
1034
+ i(this, R).forEach((M) => M.play());
1031
1035
  }
1032
1036
  }
1033
1037
  } else
@@ -1035,15 +1039,15 @@ const se = class extends EventTarget {
1035
1039
  }
1036
1040
  set effect(t) {
1037
1041
  if (t !== i(this, x)) {
1038
- if (this.pending && f(this, q, Q).call(this), i(this, x) && A.delete(i(this, x)), t) {
1042
+ if (this.pending && p(this, q, tt).call(this), i(this, x) && A.delete(i(this, x)), t) {
1039
1043
  const e = A.get(t);
1040
1044
  e && (e.effect = null), A.set(t, this);
1041
1045
  }
1042
- l(this, x, t), f(this, mt, Ct).call(this), f(this, I, V).call(this, !1);
1046
+ l(this, x, t), p(this, gt, Mt).call(this), p(this, I, V).call(this, !1);
1043
1047
  }
1044
1048
  }
1045
1049
  get ready() {
1046
- return i(this, R).promise;
1050
+ return i(this, S).promise;
1047
1051
  }
1048
1052
  get finished() {
1049
1053
  return i(this, P).promise;
@@ -1051,17 +1055,17 @@ const se = class extends EventTarget {
1051
1055
  get playState() {
1052
1056
  var t;
1053
1057
  let { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {};
1054
- const n = i(this, d) instanceof b ? "percent" : "ms", r = h(this.startTime, n), a = h(this.currentTime, n);
1058
+ const n = i(this, d) instanceof E ? "percent" : "ms", r = h(this.startTime, n), a = h(this.currentTime, n);
1055
1059
  return e = h(e, n), a === null && r === null && i(this, v).task === null ? "idle" : i(this, v).task === "pause" || r === null && i(this, v).task !== "play" ? "paused" : a !== null && (i(this, W) > 0 && a >= e || i(this, W) < 0 && a <= 0) ? "finished" : "running";
1056
1060
  }
1057
1061
  get playbackRate() {
1058
1062
  return i(this, W);
1059
1063
  }
1060
1064
  get replaceState() {
1061
- return i(this, ct);
1065
+ return i(this, ht);
1062
1066
  }
1063
1067
  get pending() {
1064
- return i(this, R).state === "pending";
1068
+ return i(this, S).state === "pending";
1065
1069
  }
1066
1070
  get currentTime() {
1067
1071
  var t;
@@ -1069,12 +1073,12 @@ const se = class extends EventTarget {
1069
1073
  if (i(this, y)) {
1070
1074
  if (typeof e == "number")
1071
1075
  return i(this, y);
1072
- const a = i(this, d) instanceof b ? "percent" : "ms";
1076
+ const a = i(this, d) instanceof E ? "percent" : "ms";
1073
1077
  return new CSSUnitValue(i(this, y), a);
1074
1078
  }
1075
1079
  if (e === null || i(this, u) === null)
1076
1080
  return null;
1077
- const n = i(this, d) instanceof b ? "percent" : "ms";
1081
+ const n = i(this, d) instanceof E ? "percent" : "ms";
1078
1082
  let r = (h(e, n) - i(this, u)) * this.playbackRate;
1079
1083
  return r === -0 && (r = 0), typeof e == "number" ? r : new CSSUnitValue(r, n);
1080
1084
  }
@@ -1084,7 +1088,7 @@ const se = class extends EventTarget {
1084
1088
  return null;
1085
1089
  if (typeof (((t = this.timeline) == null ? void 0 : t.currentTime) ?? null) == "number")
1086
1090
  return i(this, u);
1087
- const e = i(this, d) instanceof b ? "percent" : "ms";
1091
+ const e = i(this, d) instanceof E ? "percent" : "ms";
1088
1092
  return new CSSUnitValue(i(this, u), e);
1089
1093
  }
1090
1094
  get timeline() {
@@ -1094,44 +1098,44 @@ const se = class extends EventTarget {
1094
1098
  return i(this, x);
1095
1099
  }
1096
1100
  };
1097
- d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakSet(), St = function(s) {
1101
+ d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakSet(), Rt = function(s) {
1098
1102
  var t;
1099
1103
  const e = h(((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null);
1100
1104
  if (s === null && e !== null)
1101
1105
  throw new TypeError();
1102
- s === null || e === null || (s = h(s), l(this, O, !1), i(this, y) !== null || i(this, u) === null || i(this, d) instanceof b && i(this, d).phase === "inactive" || i(this, W) === 0 ? l(this, y, s) : l(this, u, e - s / i(this, W)), i(this, d) instanceof b && i(this, d).phase === "inactive" && l(this, u, null), l(this, z, null));
1103
- }, J = /* @__PURE__ */ new WeakSet(), ot = function() {
1104
- i(this, R).state !== "pending" && l(this, R, new et()), cancelAnimationFrame(i(this, at)), l(this, at, requestAnimationFrame(() => {
1106
+ s === null || e === null || (s = h(s), l(this, O, !1), i(this, y) !== null || i(this, u) === null || i(this, d) instanceof E && i(this, d).phase === "inactive" || i(this, W) === 0 ? l(this, y, s) : l(this, u, e - s / i(this, W)), i(this, d) instanceof E && i(this, d).phase === "inactive" && l(this, u, null), l(this, z, null));
1107
+ }, Q = /* @__PURE__ */ new WeakSet(), lt = function() {
1108
+ i(this, S).state !== "pending" && l(this, S, new nt()), cancelAnimationFrame(i(this, ot)), l(this, ot, requestAnimationFrame(() => {
1105
1109
  var s;
1106
- (((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null) !== null && (f(this, xt, zt).call(this), i(this, v).task === "play" && (i(this, u) !== null || i(this, y) !== null) ? f(this, Rt, Kt).call(this) : i(this, v).task === "pause" && f(this, kt, qt).call(this), Promise.all(i(this, k).map((t) => t.finished)).then(i(this, gt)), Promise.all(i(this, k).map((t) => new Promise((e) => t.onremove = e))).then(i(this, Lt)), Promise.all(i(this, k).map((t) => new Promise((e) => t.oncancel = e))).then(i(this, Mt)).then(() => l(this, ct, "removed")));
1110
+ (((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null) !== null && (p(this, Ct, zt).call(this), i(this, v).task === "play" && (i(this, u) !== null || i(this, y) !== null) ? p(this, kt, Kt).call(this) : i(this, v).task === "pause" && p(this, xt, qt).call(this), Promise.all(i(this, R).map((t) => t.finished)).then(i(this, yt)), Promise.all(i(this, R).map((t) => new Promise((e) => t.onremove = e))).then(i(this, Pt)), Promise.all(i(this, R).map((t) => new Promise((e) => t.oncancel = e))).then(i(this, Lt)).then(() => l(this, ht, "removed")));
1107
1111
  }));
1108
- }, q = /* @__PURE__ */ new WeakSet(), Q = function() {
1109
- cancelAnimationFrame(i(this, at)), i(this, v).task = null;
1110
- }, Rt = /* @__PURE__ */ new WeakSet(), Kt = function() {
1112
+ }, q = /* @__PURE__ */ new WeakSet(), tt = function() {
1113
+ cancelAnimationFrame(i(this, ot)), i(this, v).task = null;
1114
+ }, kt = /* @__PURE__ */ new WeakSet(), Kt = function() {
1111
1115
  var s;
1112
1116
  const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
1113
1117
  if (t === null)
1114
1118
  return;
1115
- const e = i(this, d) instanceof b ? "percent" : "ms";
1119
+ const e = i(this, d) instanceof E ? "percent" : "ms";
1116
1120
  if (i(this, y) !== null)
1117
- f(this, D, $).call(this), this.playbackRate === 0 ? l(this, u, h(t, e)) : (l(this, u, h(t, e) - i(this, y) / this.playbackRate), l(this, y, null));
1121
+ p(this, D, $).call(this), this.playbackRate === 0 ? l(this, u, h(t, e)) : (l(this, u, h(t, e) - i(this, y) / this.playbackRate), l(this, y, null));
1118
1122
  else if (i(this, u) !== null && i(this, v).playbackRate !== null) {
1119
1123
  const n = (h(t, e) - i(this, u)) * this.playbackRate;
1120
- f(this, D, $).call(this);
1124
+ p(this, D, $).call(this);
1121
1125
  const r = this.playbackRate;
1122
1126
  r === 0 ? (l(this, y, null), l(this, u, h(t, e))) : l(this, u, h(t, e) - n / r);
1123
1127
  }
1124
- i(this, R).state === "pending" && i(this, R).resolve(this), f(this, I, V).call(this, !1), f(this, B, G).call(this), i(this, v).task = null, this.timeline instanceof DocumentTimeline && i(this, k).forEach((n) => n.play());
1125
- }, kt = /* @__PURE__ */ new WeakSet(), qt = function() {
1128
+ i(this, S).state === "pending" && i(this, S).resolve(this), p(this, I, V).call(this, !1), p(this, B, G).call(this), i(this, v).task = null, this.timeline instanceof DocumentTimeline && i(this, R).forEach((n) => n.play());
1129
+ }, xt = /* @__PURE__ */ new WeakSet(), qt = function() {
1126
1130
  var s;
1127
1131
  const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
1128
1132
  if (t === null)
1129
1133
  return;
1130
- const e = i(this, d) instanceof b ? "percent" : "ms", n = t;
1131
- i(this, u) !== null && i(this, y) === null && l(this, y, (h(n, e) - i(this, u)) * this.playbackRate), f(this, D, $).call(this), l(this, u, null), i(this, R).resolve(this), f(this, I, V).call(this, !1), f(this, B, G).call(this), i(this, v).task = null, i(this, k).forEach((r) => r.pause());
1132
- }, xt = /* @__PURE__ */ new WeakSet(), zt = function() {
1134
+ const e = i(this, d) instanceof E ? "percent" : "ms", n = t;
1135
+ i(this, u) !== null && i(this, y) === null && l(this, y, (h(n, e) - i(this, u)) * this.playbackRate), p(this, D, $).call(this), l(this, u, null), i(this, S).resolve(this), p(this, I, V).call(this, !1), p(this, B, G).call(this), i(this, v).task = null, i(this, R).forEach((r) => r.pause());
1136
+ }, Ct = /* @__PURE__ */ new WeakSet(), zt = function() {
1133
1137
  if (i(this, O) && !(!i(this, d) || !i(this, d).currentTime) && !(this.playState === "idle" || this.playState === "paused" && i(this, y) !== null)) {
1134
- if (i(this, d) instanceof b) {
1138
+ if (i(this, d) instanceof E) {
1135
1139
  const s = i(this, v).playbackRate ?? this.playbackRate;
1136
1140
  l(this, u, s >= 0 ? 0 : 100);
1137
1141
  } else
@@ -1143,7 +1147,7 @@ d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ct = /* @_
1143
1147
  const t = ((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null;
1144
1148
  if (t === null)
1145
1149
  return;
1146
- const e = i(this, x), n = i(this, d) instanceof b ? ke(t, e?.getTiming()) : wt(t);
1150
+ const e = i(this, x), n = i(this, d) instanceof E ? xe(t, e?.getTiming()) : Et(t);
1147
1151
  let r = null;
1148
1152
  if (i(this, u) !== null) {
1149
1153
  const a = h(t, "percent") === (this.playbackRate < 0 ? 0 : 100) ? this.playbackRate < 0 ? 1e-3 : -1e-3 : 0;
@@ -1152,52 +1156,52 @@ d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ct = /* @_
1152
1156
  r = i(this, y);
1153
1157
  else
1154
1158
  return;
1155
- i(this, k).forEach((a) => a.currentTime = r);
1156
- }, lt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakSet(), Ct = function() {
1159
+ i(this, R).forEach((a) => a.currentTime = r);
1160
+ }, ct = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakSet(), Mt = function() {
1157
1161
  var s;
1158
1162
  let t = i(this, x);
1159
1163
  const e = [];
1160
1164
  if (t instanceof Ot)
1161
1165
  for (let n = 0; n < t.children.length; n++) {
1162
1166
  const r = new se(t.children.item(n));
1163
- if (t instanceof Ne && n > 0) {
1167
+ if (t instanceof Ue && n > 0) {
1164
1168
  const { endTime: a = null } = ((s = e[n - 1].effect) == null ? void 0 : s.getComputedTiming()) ?? {};
1165
1169
  r.startTime = h(a, "ms");
1166
1170
  }
1167
1171
  e.push(r);
1168
1172
  }
1169
1173
  else {
1170
- const n = i(this, d) instanceof b ? document.timeline : i(this, d);
1171
- e.push(new Re(t, n));
1174
+ const n = i(this, d) instanceof E ? document.timeline : i(this, d);
1175
+ e.push(new ke(t, n));
1172
1176
  }
1173
- l(this, k, e);
1177
+ l(this, R, e);
1174
1178
  }, I = /* @__PURE__ */ new WeakSet(), V = function(s) {
1175
1179
  var t, e;
1176
- const n = ((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null, r = i(this, d) instanceof b ? "percent" : "ms";
1180
+ const n = ((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null, r = i(this, d) instanceof E ? "percent" : "ms";
1177
1181
  let a = h(this.currentTime, r);
1178
1182
  if (a && i(this, u) !== null && !this.pending) {
1179
- let { delay: o = 0, endDelay: c = 0, iterations: g = 1, duration: p = "auto" } = ((e = i(this, x)) == null ? void 0 : e.getTiming()) ?? {};
1183
+ let { delay: o = 0, endDelay: c = 0, iterations: g = 1, duration: f = "auto" } = ((e = i(this, x)) == null ? void 0 : e.getTiming()) ?? {};
1180
1184
  const w = i(this, v).playbackRate ?? this.playbackRate;
1181
- if (p === "auto")
1182
- p = i(this, d) instanceof b ? It : 0;
1183
- else if (p instanceof CSSNumericValue)
1184
- p = p.to("ms").value;
1185
- else if (typeof p == "string")
1185
+ if (f === "auto")
1186
+ f = i(this, d) instanceof E ? It : 0;
1187
+ else if (f instanceof CSSNumericValue)
1188
+ f = f.to("ms").value;
1189
+ else if (typeof f == "string")
1186
1190
  throw new TypeError("Unknown effect duration keyword.");
1187
- const S = o + p * g + c;
1188
- let E = h(i(this, z), r);
1189
- w > 0 && a >= S && i(this, z) !== null ? ((E === null || E < S) && (E = S), l(this, y, s ? a : E)) : w < 0 && a <= 0 ? ((E === null || E > 0) && (E = 0), l(this, y, s ? a : E)) : w !== 0 && (s && i(this, y) !== null && (n !== null ? l(this, u, h(n, r) - i(this, y) / w) : l(this, u, null)), l(this, y, null));
1191
+ const k = o + f * g + c;
1192
+ let b = h(i(this, z), r);
1193
+ w > 0 && a >= k && i(this, z) !== null ? ((b === null || b < k) && (b = k), l(this, y, s ? a : b)) : w < 0 && a <= 0 ? ((b === null || b > 0) && (b = 0), l(this, y, s ? a : b)) : w !== 0 && (s && i(this, y) !== null && (n !== null ? l(this, u, h(n, r) - i(this, y) / w) : l(this, u, null)), l(this, y, null));
1190
1194
  }
1191
- f(this, B, G).call(this), l(this, z, this.currentTime), this.playState === "finished" ? i(this, P).state === "pending" && i(this, gt).call(this) : i(this, P).state === "resolved" && l(this, P, new et());
1195
+ p(this, B, G).call(this), l(this, z, this.currentTime), this.playState === "finished" ? i(this, P).state === "pending" && i(this, yt).call(this) : i(this, P).state === "resolved" && l(this, P, new nt());
1192
1196
  }, D = /* @__PURE__ */ new WeakSet(), $ = function() {
1193
1197
  i(this, v).playbackRate && (this.playbackRate = i(this, v).playbackRate), i(this, v).playbackRate = null;
1194
- }, gt = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap();
1195
- let Ue = se;
1196
- var tt, Pt, re;
1197
- class Dt extends Ot {
1198
- constructor(t, e = ht) {
1199
- super(t), m(this, Pt), m(this, tt, void 0), l(this, tt, {
1200
- ...ht,
1198
+ }, yt = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap();
1199
+ let We = se;
1200
+ var et, Dt, re;
1201
+ class At extends Ot {
1202
+ constructor(t, e = ut) {
1203
+ super(t), m(this, Dt), m(this, et, void 0), l(this, et, {
1204
+ ...ut,
1201
1205
  ...e
1202
1206
  }), t.forEach((n) => n.updateTiming());
1203
1207
  }
@@ -1208,32 +1212,32 @@ class Dt extends Ot {
1208
1212
  super.append(...t), t.forEach((e) => e.updateTiming());
1209
1213
  }
1210
1214
  getTiming() {
1211
- return i(this, tt);
1215
+ return i(this, et);
1212
1216
  }
1213
1217
  getComputedTiming() {
1214
1218
  const t = this.getTiming(), e = { ...t };
1215
1219
  for (let w = 0; w < this.children.length; w++) {
1216
- const S = this.children.item(w);
1217
- if (!S)
1220
+ const k = this.children.item(w);
1221
+ if (!k)
1218
1222
  continue;
1219
1223
  let {
1220
- delay: E = 0,
1221
- endDelay: F = 0,
1224
+ delay: b = 0,
1225
+ endDelay: X = 0,
1222
1226
  duration: C = "auto",
1223
1227
  activeDuration: M = 0,
1224
1228
  endTime: L = 0
1225
- } = S.getComputedTiming();
1226
- t.delay = t.delay ? Math.min(t.delay, E) : E, t.endDelay = t.endDelay ? Math.max(t.endDelay, F) : F, e.endTime = e.endTime ? Math.max(h(e.endTime, "ms"), h(L, "ms")) : L, e.activeDuration = e.activeDuration ? Math.max(h(e.activeDuration, "ms"), h(M, "ms")) : M, 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));
1229
+ } = k.getComputedTiming();
1230
+ t.delay = t.delay ? Math.min(t.delay, b) : b, t.endDelay = t.endDelay ? Math.max(t.endDelay, X) : X, e.endTime = e.endTime ? Math.max(h(e.endTime, "ms"), h(L, "ms")) : L, e.activeDuration = e.activeDuration ? Math.max(h(e.activeDuration, "ms"), h(M, "ms")) : M, 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));
1227
1231
  }
1228
- const { timeline: n, startTime: r, currentTime: a } = A.get(this) ?? {}, o = n instanceof b ? "percent" : "ms";
1229
- let { duration: c = 0, iterations: g = 1, endTime: p = 0 } = e;
1232
+ const { timeline: n, startTime: r, currentTime: a } = A.get(this) ?? {}, o = n instanceof E ? "percent" : "ms";
1233
+ let { duration: c = 0, iterations: g = 1, endTime: f = 0 } = e;
1230
1234
  if (c === "auto" && (c = 0), typeof c == "string")
1231
1235
  throw new TypeError("Unknown effect duration keyword.");
1232
- return e.duration = c, e.activeDuration = wt(c) * g, e.startTime = r ?? void 0, e.localTime = a, e.currentIteration = ne(e, ee(e, i(this, Pt, re))), n instanceof b ? $t(e) : (n instanceof DocumentTimeline && (e.progress = a && h(a, o) / h(p, o)), e);
1236
+ return e.duration = c, e.activeDuration = Et(c) * g, e.startTime = r ?? void 0, e.localTime = a, e.currentIteration = ne(e, ee(e, i(this, Dt, re))), n instanceof E ? $t(e) : (n instanceof DocumentTimeline && (e.progress = a && h(a, o) / h(f, o)), e);
1233
1237
  }
1234
1238
  updateTiming(t) {
1235
- l(this, tt, {
1236
- ...i(this, tt),
1239
+ l(this, et, {
1240
+ ...i(this, et),
1237
1241
  ...t
1238
1242
  });
1239
1243
  for (let e = 0; e < this.children.length; e++) {
@@ -1242,11 +1246,11 @@ class Dt extends Ot {
1242
1246
  }
1243
1247
  }
1244
1248
  }
1245
- tt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakSet(), re = function() {
1249
+ et = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakSet(), re = function() {
1246
1250
  const { playbackRate: s = 1 } = A.get(this) ?? {};
1247
1251
  return s < 0 ? "backwards" : "forwards";
1248
1252
  };
1249
- class We extends it {
1253
+ class Ie extends st {
1250
1254
  ref = K();
1251
1255
  #t = null;
1252
1256
  #e = null;
@@ -1380,7 +1384,7 @@ class We extends it {
1380
1384
  break;
1381
1385
  }
1382
1386
  }
1383
- return new Dt(n);
1387
+ return new At(n);
1384
1388
  }
1385
1389
  get animationEffect() {
1386
1390
  const t = this.outgoingScreen?.current?.sharedElementScene, e = this.incomingScreen?.current?.sharedElementScene;
@@ -1392,20 +1396,20 @@ class We extends it {
1392
1396
  const o = a.getBoundingClientRect(), c = t.nodes.get(r);
1393
1397
  if (!c?.canTransition || !a.canTransition)
1394
1398
  continue;
1395
- const g = c.getBoundingClientRect(), p = a.clone(), w = c.clone();
1396
- if (!w || !p)
1399
+ const g = c.getBoundingClientRect(), f = a.clone(), w = c.clone();
1400
+ if (!w || !f)
1397
1401
  continue;
1398
- const S = Array.from(/* @__PURE__ */ new Set([...c.styles, ...a.styles]));
1399
- a.transitionType !== "morph" ? (w.id = `${r}-start`, w.style.position = "absolute", w.style.gridArea = "1 / 1", w.style.margin = "0", this.copyStyles(c.ref.current?.firstElementChild, w, S), this.copyStyles(a.ref.current?.firstElementChild, p, S), w.style.width = `${g.width}px`, w.style.height = `${g.height}px`, p.style.width = `${o.width}px`, p.style.height = `${o.height}px`, this.ref.current?.prepend(w)) : (this.copyStyles(c.ref.current?.firstElementChild, p, S), p.style.width = `${g.width}px`, p.style.height = `${g.height}px`), p.id = `${r}${a.transitionType === "morph" ? "" : "-end"}`, p.style.position = "absolute", p.style.gridArea = "1 / 1", p.style.margin = "0", this.ref.current?.prepend(p), c.hide(), a.hide();
1400
- const E = async () => {
1401
- this.props.direction === "forwards" ? a.unhide() : c.unhide(), p.remove(), w.remove();
1402
+ const k = Array.from(/* @__PURE__ */ new Set([...c.styles, ...a.styles]));
1403
+ a.transitionType !== "morph" ? (w.id = `${r}-start`, w.style.position = "absolute", w.style.gridArea = "1 / 1", w.style.margin = "0", this.copyStyles(c.ref.current?.firstElementChild, w, k), this.copyStyles(a.ref.current?.firstElementChild, f, k), w.style.width = `${g.width}px`, w.style.height = `${g.height}px`, f.style.width = `${o.width}px`, f.style.height = `${o.height}px`, this.ref.current?.prepend(w)) : (this.copyStyles(c.ref.current?.firstElementChild, f, k), f.style.width = `${g.width}px`, f.style.height = `${g.height}px`), f.id = `${r}${a.transitionType === "morph" ? "" : "-end"}`, f.style.position = "absolute", f.style.gridArea = "1 / 1", f.style.margin = "0", this.ref.current?.prepend(f), c.hide(), a.hide();
1404
+ const b = async () => {
1405
+ this.props.direction === "forwards" ? a.unhide() : c.unhide(), f.remove(), w.remove();
1402
1406
  };
1403
- 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("transition-end", b, { once: !0 }), this.props.navigation.addEventListener("transition-cancel", b, { once: !0 }), n.push(this.getAnimationEffect(
1404
1408
  { instance: c, clone: w, rect: g },
1405
- { instance: a, clone: p, rect: o }
1409
+ { instance: a, clone: f, rect: o }
1406
1410
  ));
1407
1411
  }
1408
- return new Dt(n);
1412
+ return new At(n);
1409
1413
  }
1410
1414
  render() {
1411
1415
  return /* @__PURE__ */ T("dialog", { className: "shared-element-layer", ref: this.ref, style: {
@@ -1424,10 +1428,10 @@ class We extends it {
1424
1428
  ` }) });
1425
1429
  }
1426
1430
  }
1427
- const ae = nt(0);
1428
- class Ie extends it {
1431
+ const ae = it(0);
1432
+ class $e extends st {
1429
1433
  sharedElementTransitionLayer = K();
1430
- animation = new Ue();
1434
+ animation = new We();
1431
1435
  #t = "normal";
1432
1436
  #e = new Array();
1433
1437
  state = {
@@ -1466,7 +1470,7 @@ class Ie extends it {
1466
1470
  return this.props.hasUAVisualTransition;
1467
1471
  }
1468
1472
  transition() {
1469
- const t = new Dt(
1473
+ const t = new At(
1470
1474
  this.screens.map((r) => r.current?.transitionProvider?.current?.animationEffect ?? null).filter((r) => r !== null)
1471
1475
  ), e = this.sharedElementTransitionLayer.current?.animationEffect, n = t.getComputedTiming().duration;
1472
1476
  return e && (e.updateTiming({
@@ -1478,9 +1482,9 @@ class Ie extends it {
1478
1482
  }), this.animation;
1479
1483
  }
1480
1484
  render() {
1481
- return /* @__PURE__ */ Gt(Yt.Provider, { value: this, children: [
1485
+ return /* @__PURE__ */ Gt(_t.Provider, { value: this, children: [
1482
1486
  /* @__PURE__ */ T(
1483
- We,
1487
+ Ie,
1484
1488
  {
1485
1489
  ref: this.sharedElementTransitionLayer,
1486
1490
  navigation: this.props.navigation,
@@ -1505,7 +1509,7 @@ class Ie extends it {
1505
1509
  ] });
1506
1510
  }
1507
1511
  }
1508
- class At extends it {
1512
+ class Nt extends st {
1509
1513
  ref = K();
1510
1514
  screenTransitionLayer = K();
1511
1515
  parent = null;
@@ -1514,9 +1518,9 @@ class At extends it {
1514
1518
  hasUAVisualTransition = !1;
1515
1519
  parentScreen = null;
1516
1520
  static rootRouterRef = null;
1517
- static contextType = _t;
1521
+ static contextType = Jt;
1518
1522
  constructor(t, e) {
1519
- super(t), this.parentScreen = e?.parentScreen ?? null, this.parent = e?.parentRouter ?? null, this.parent && (this.parent.child = this), this.isRoot && (At.rootRouterRef = new WeakRef(this));
1523
+ super(t), this.parentScreen = e?.parentScreen ?? null, this.parent = e?.parentRouter ?? null, this.parent && (this.parent.child = this), this.isRoot && (Nt.rootRouterRef = new WeakRef(this));
1520
1524
  }
1521
1525
  componentDidMount() {
1522
1526
  this.isRoot && window.navigation.addEventListener("navigate", this.handleNavigationDispatch), this.loadDispatched || (window.navigation.dispatchEvent(new ye()), this.loadDispatched = !0);
@@ -1534,7 +1538,7 @@ class At extends it {
1534
1538
  yield t, t = t.child;
1535
1539
  }
1536
1540
  getRouterById(t, e) {
1537
- const n = e ?? At.rootRouterRef?.deref();
1541
+ const n = e ?? Nt.rootRouterRef?.deref();
1538
1542
  return n.id === t ? n ?? null : n?.child ? this.getRouterById(t, n.child) : null;
1539
1543
  }
1540
1544
  dispatchEvent(t) {
@@ -1547,28 +1551,27 @@ class At extends it {
1547
1551
  removeEventListener(t, e, n) {
1548
1552
  return this.ref.current?.removeEventListener(t, e, n);
1549
1553
  }
1550
- preloadRoute(t) {
1551
- return new Promise((e, n) => {
1552
- let r = !1;
1553
- const a = this.props.children;
1554
- jt.forEach(a, (o) => {
1555
- if (r || !Ut(o))
1556
- return;
1557
- const { path: c, caseSensitive: g } = o.props, p = this.baseURLPattern.pathname;
1558
- if (!Zt(c, t, p, g))
1559
- return;
1560
- r = !0;
1561
- const S = o.props.config;
1562
- queueMicrotask(async () => {
1563
- const E = [];
1564
- "load" in o.props.component && E.push(o.props.component.load()), S?.header?.component && "load" in S?.header?.component && E.push(S?.header?.component.load()), S?.footer?.component && "load" in S?.footer?.component && E.push(S?.footer?.component.load());
1565
- try {
1566
- await Promise.all(E), e(r);
1567
- } catch (F) {
1568
- n(F);
1569
- }
1570
- });
1571
- }), r || e(!1);
1554
+ screenChildFromPathname(t) {
1555
+ for (const e of jt.toArray(this.props.children)) {
1556
+ if (!Te(e))
1557
+ continue;
1558
+ const n = Yt(
1559
+ e.props.path,
1560
+ t,
1561
+ this.baseURLPattern.pathname,
1562
+ e.props.caseSensitive
1563
+ );
1564
+ if (n)
1565
+ return {
1566
+ child: e,
1567
+ matchInfo: n
1568
+ };
1569
+ }
1570
+ return null;
1571
+ }
1572
+ preloadScreen(t) {
1573
+ const e = t.props.config, n = [];
1574
+ return F(t.props.component) && n.push(t.props.component.load()), F(e?.header?.component) && n.push(e?.header?.component.load()), F(e?.footer?.component) && n.push(e?.footer?.component.load()), Promise.all(n).then(() => {
1572
1575
  });
1573
1576
  }
1574
1577
  get id() {
@@ -1619,8 +1622,8 @@ class At extends it {
1619
1622
  className: "react-motion-router",
1620
1623
  style: { width: "100%", height: "100%" },
1621
1624
  ref: this.ref,
1622
- children: /* @__PURE__ */ T(vt.Provider, { value: this, children: /* @__PURE__ */ T(
1623
- Ie,
1625
+ children: /* @__PURE__ */ T(wt.Provider, { value: this, children: /* @__PURE__ */ T(
1626
+ $e,
1624
1627
  {
1625
1628
  ref: this.screenTransitionLayer,
1626
1629
  navigation: this.navigation,
@@ -1632,7 +1635,7 @@ class At extends it {
1632
1635
  );
1633
1636
  }
1634
1637
  }
1635
- class $e {
1638
+ class Oe {
1636
1639
  #t = /* @__PURE__ */ new Map();
1637
1640
  mutationObserver;
1638
1641
  constructor() {
@@ -1714,12 +1717,12 @@ class $e {
1714
1717
  n.setAttribute(...r), e ? n.setAttribute("content", e) : n.removeAttribute("content"), n.parentElement || document.head.appendChild(n);
1715
1718
  }
1716
1719
  }
1717
- class Nt {
1720
+ class Ut {
1718
1721
  static rootNavigatorRef = null;
1719
- metaData = new $e();
1722
+ metaData = new Oe();
1720
1723
  constructor() {
1721
- const t = Nt.rootNavigatorRef?.deref();
1722
- (!t || !t.isInDocument) && (Nt.rootNavigatorRef = new WeakRef(this));
1724
+ const t = Ut.rootNavigatorRef?.deref();
1725
+ (!t || !t.isInDocument) && (Ut.rootNavigatorRef = new WeakRef(this));
1723
1726
  }
1724
1727
  addEventListener(t, e, n) {
1725
1728
  return this.router.addEventListener(t, e, n), () => this.router.removeEventListener(t, e, n);
@@ -1745,34 +1748,30 @@ class Nt {
1745
1748
  getNavigatorById(t) {
1746
1749
  return this.router.getRouterById(t)?.navigation ?? null;
1747
1750
  }
1748
- preloadRoute(t) {
1749
- const { pathname: e } = new URL(t, this.baseURL);
1750
- return this.router.preloadRoute(e);
1751
- }
1752
1751
  get isInDocument() {
1753
1752
  return !!document.getElementById(`${this.routerId}`);
1754
1753
  }
1755
1754
  }
1756
1755
  function Qe() {
1757
- const s = yt(vt);
1756
+ const s = vt(wt);
1758
1757
  if (s)
1759
1758
  return s.navigation;
1760
1759
  throw new Error("Router is null. You may be trying to call useNavigation outside a Router.");
1761
1760
  }
1762
1761
  function tn() {
1763
- return yt(vt);
1762
+ return vt(wt);
1764
1763
  }
1765
1764
  function en() {
1766
- return ce("Motion"), yt(ae);
1765
+ return ce("Motion"), vt(ae);
1767
1766
  }
1768
- function Oe() {
1769
- const s = yt(Jt);
1767
+ function Ve() {
1768
+ const s = vt(Qt);
1770
1769
  if (s)
1771
1770
  return s;
1772
1771
  throw new Error("Router is null. You may be trying to call useRoute outside a Router.");
1773
1772
  }
1774
1773
  function nn(s, t) {
1775
- const e = Oe();
1774
+ const e = Ve();
1776
1775
  t = t instanceof Function ? t() : t;
1777
1776
  const n = (r) => {
1778
1777
  r instanceof Function && (r = r(e.params[s] ?? t)), e.setParams({ [s]: r });
@@ -1788,38 +1787,38 @@ export {
1788
1787
  on as MIN_NORM_PROGRESS,
1789
1788
  an as MIN_PROGRESS,
1790
1789
  ae as MotionContext,
1791
- Ye as MotionProgressEndEvent,
1790
+ _e as MotionProgressEndEvent,
1792
1791
  ge as MotionProgressEvent,
1793
- Ze as MotionProgressStartEvent,
1794
- Nt as NavigationBase,
1795
- _t as NestedRouterContext,
1792
+ Ye as MotionProgressStartEvent,
1793
+ Ut as NavigationBase,
1794
+ Jt as NestedRouterContext,
1796
1795
  ue as PromiseAllDynamic,
1797
- At as RouterBase,
1798
- vt as RouterContext,
1796
+ Nt as RouterBase,
1797
+ wt as RouterContext,
1799
1798
  Ee as ScreenBase,
1800
- Fe as SharedElement,
1799
+ Be as SharedElement,
1801
1800
  fe as TransitionCancelEvent,
1802
1801
  me as TransitionEndEvent,
1803
1802
  pe as TransitionStartEvent,
1804
- He as cloneAndInject,
1803
+ Ze as cloneAndInject,
1805
1804
  he as dispatchEvent,
1806
- Be as includesRoute,
1807
- te as isLazyExoticComponent,
1808
- Qt as isNativeLazyExoticComponent,
1809
- qe as isNavigationSupported,
1805
+ Ke as includesRoute,
1806
+ F as isLazyExoticComponent,
1807
+ te as isNativeLazyExoticComponent,
1808
+ ze as isNavigationSupported,
1810
1809
  be as isStylableElement,
1811
- ze as isURLPatternSupported,
1812
- _e as isValidScreenChild,
1813
- Ke as lazy,
1814
- Zt as matchRoute,
1810
+ Ge as isURLPatternSupported,
1811
+ Te as isValidScreenChild,
1812
+ qe as lazy,
1813
+ Yt as matchRoute,
1815
1814
  Xe as polyfillNavigation,
1816
- Ge as polyfillURLPattern,
1815
+ He as polyfillURLPattern,
1817
1816
  bt as resolveBaseURLFromPattern,
1818
1817
  de as toCamelCase,
1819
1818
  en as useMotion,
1820
1819
  Qe as useNavigationBase,
1821
1820
  nn as useParamsBase,
1822
- Oe as useRouteBase,
1821
+ Ve as useRouteBase,
1823
1822
  tn as useRouterBase
1824
1823
  };
1825
1824
  //# sourceMappingURL=index.js.map