@wix/interact 2.0.0-rc.7 → 2.0.0

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.
@@ -73,7 +73,7 @@ class le {
73
73
  return this.animations[0]?.playState;
74
74
  }
75
75
  }
76
- const Qe = (e) => e, Be = (e) => 1 - Math.cos(e * Math.PI / 2), Xe = (e) => Math.sin(e * Math.PI / 2), Ue = (e) => -(Math.cos(Math.PI * e) - 1) / 2, Je = (e) => e ** 2, Ze = (e) => 1 - (1 - e) ** 2, et = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, tt = (e) => e ** 3, nt = (e) => 1 - (1 - e) ** 3, st = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, it = (e) => e ** 4, rt = (e) => 1 - (1 - e) ** 4, ot = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, ct = (e) => e ** 5, at = (e) => 1 - (1 - e) ** 5, ft = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, lt = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), ut = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), dt = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, ht = (e) => 1 - Math.sqrt(1 - e ** 2), mt = (e) => Math.sqrt(1 - (e - 1) ** 2), pt = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, gt = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, vt = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, yt = (e, t = 1.70158 * 1.525) => e < 0.5 ? (2 * e) ** 2 * ((t + 1) * 2 * e - t) / 2 : ((2 * e - 2) ** 2 * ((t + 1) * (e * 2 - 2) + t) + 2) / 2, wt = {
76
+ const Qe = (e) => e, Be = (e) => 1 - Math.cos(e * Math.PI / 2), Xe = (e) => Math.sin(e * Math.PI / 2), Ue = (e) => -(Math.cos(Math.PI * e) - 1) / 2, Je = (e) => e ** 2, Ze = (e) => 1 - (1 - e) ** 2, et = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, tt = (e) => e ** 3, nt = (e) => 1 - (1 - e) ** 3, st = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, it = (e) => e ** 4, rt = (e) => 1 - (1 - e) ** 4, ot = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, at = (e) => e ** 5, ct = (e) => 1 - (1 - e) ** 5, ft = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, lt = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), ut = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), dt = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, ht = (e) => 1 - Math.sqrt(1 - e ** 2), mt = (e) => Math.sqrt(1 - (e - 1) ** 2), pt = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, gt = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, vt = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, yt = (e, t = 1.70158 * 1.525) => e < 0.5 ? (2 * e) ** 2 * ((t + 1) * 2 * e - t) / 2 : ((2 * e - 2) ** 2 * ((t + 1) * (e * 2 - 2) + t) + 2) / 2, wt = {
77
77
  linear: Qe,
78
78
  sineIn: Be,
79
79
  sineOut: Xe,
@@ -87,8 +87,8 @@ const Qe = (e) => e, Be = (e) => 1 - Math.cos(e * Math.PI / 2), Xe = (e) => Math
87
87
  quartIn: it,
88
88
  quartOut: rt,
89
89
  quartInOut: ot,
90
- quintIn: ct,
91
- quintOut: at,
90
+ quintIn: at,
91
+ quintOut: ct,
92
92
  quintInOut: ft,
93
93
  expoIn: lt,
94
94
  expoOut: ut,
@@ -150,7 +150,7 @@ class St {
150
150
  ...s,
151
151
  composite: "add"
152
152
  }), { timeline: o } = r;
153
- this._animation = new Animation(i, o), this._tickCbId = null, this.progress = null, this.customEffect = (c) => t(i.target, c), this._finishHandler = (c) => {
153
+ this._animation = new Animation(i, o), this._tickCbId = null, this.progress = null, this.customEffect = (a) => t(i.target, a), this._finishHandler = (a) => {
154
154
  this.effect.target?.getAnimations().find((f) => f === this._animation) || this.cancel();
155
155
  }, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
156
156
  }
@@ -287,12 +287,12 @@ function Ot() {
287
287
  return ge || (ge = 1, (function(e) {
288
288
  (function(t) {
289
289
  var n = function() {
290
- }, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(a) {
291
- return setTimeout(a, 16);
290
+ }, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(c) {
291
+ return setTimeout(c, 16);
292
292
  };
293
293
  function r() {
294
- var a = this;
295
- a.reads = [], a.writes = [], a.raf = s.bind(t);
294
+ var c = this;
295
+ c.reads = [], c.writes = [], c.raf = s.bind(t);
296
296
  }
297
297
  r.prototype = {
298
298
  constructor: r,
@@ -304,8 +304,8 @@ function Ot() {
304
304
  *
305
305
  * @param {Array} tasks
306
306
  */
307
- runTasks: function(a) {
308
- for (var u; u = a.shift(); ) u();
307
+ runTasks: function(c) {
308
+ for (var u; u = c.shift(); ) u();
309
309
  },
310
310
  /**
311
311
  * Adds a job to the read batch and
@@ -315,8 +315,8 @@ function Ot() {
315
315
  * @param {Object} ctx the context to be bound to `fn` (optional).
316
316
  * @public
317
317
  */
318
- measure: function(a, u) {
319
- var d = u ? a.bind(u) : a;
318
+ measure: function(c, u) {
319
+ var d = u ? c.bind(u) : c;
320
320
  return this.reads.push(d), i(this), d;
321
321
  },
322
322
  /**
@@ -328,8 +328,8 @@ function Ot() {
328
328
  * @param {Object} ctx the context to be bound to `fn` (optional).
329
329
  * @public
330
330
  */
331
- mutate: function(a, u) {
332
- var d = u ? a.bind(u) : a;
331
+ mutate: function(c, u) {
332
+ var d = u ? c.bind(u) : c;
333
333
  return this.writes.push(d), i(this), d;
334
334
  },
335
335
  /**
@@ -339,8 +339,8 @@ function Ot() {
339
339
  * @return {Boolean} success
340
340
  * @public
341
341
  */
342
- clear: function(a) {
343
- return c(this.reads, a) || c(this.writes, a);
342
+ clear: function(c) {
343
+ return a(this.reads, c) || a(this.writes, c);
344
344
  },
345
345
  /**
346
346
  * Extend this FastDom with some
@@ -376,37 +376,37 @@ function Ot() {
376
376
  * @param {Object} props properties to mixin
377
377
  * @return {FastDom}
378
378
  */
379
- extend: function(a) {
380
- if (typeof a != "object") throw new Error("expected object");
379
+ extend: function(c) {
380
+ if (typeof c != "object") throw new Error("expected object");
381
381
  var u = Object.create(this);
382
- return f(u, a), u.fastdom = this, u.initialize && u.initialize(), u;
382
+ return f(u, c), u.fastdom = this, u.initialize && u.initialize(), u;
383
383
  },
384
384
  // override this with a function
385
385
  // to prevent Errors in console
386
386
  // when tasks throw
387
387
  catch: null
388
388
  };
389
- function i(a) {
390
- a.scheduled || (a.scheduled = !0, a.raf(o.bind(null, a)));
389
+ function i(c) {
390
+ c.scheduled || (c.scheduled = !0, c.raf(o.bind(null, c)));
391
391
  }
392
- function o(a) {
393
- var u = a.writes, d = a.reads, g;
392
+ function o(c) {
393
+ var u = c.writes, d = c.reads, g;
394
394
  try {
395
- n("flushing reads", d.length), a.runTasks(d), n("flushing writes", u.length), a.runTasks(u);
395
+ n("flushing reads", d.length), c.runTasks(d), n("flushing writes", u.length), c.runTasks(u);
396
396
  } catch (h) {
397
397
  g = h;
398
398
  }
399
- if (a.scheduled = !1, (d.length || u.length) && i(a), g)
400
- if (n("task errored", g.message), a.catch) a.catch(g);
399
+ if (c.scheduled = !1, (d.length || u.length) && i(c), g)
400
+ if (n("task errored", g.message), c.catch) c.catch(g);
401
401
  else throw g;
402
402
  }
403
- function c(a, u) {
404
- var d = a.indexOf(u);
405
- return !!~d && !!a.splice(d, 1);
403
+ function a(c, u) {
404
+ var d = c.indexOf(u);
405
+ return !!~d && !!c.splice(d, 1);
406
406
  }
407
- function f(a, u) {
407
+ function f(c, u) {
408
408
  for (var d in u)
409
- u.hasOwnProperty(d) && (a[d] = u[d]);
409
+ u.hasOwnProperty(d) && (c[d] = u[d]);
410
410
  }
411
411
  var l = t.fastdom = t.fastdom || new r();
412
412
  e.exports = l;
@@ -434,10 +434,10 @@ function Lt(e) {
434
434
  return e.reversed ? `${t ? `${t}-` : ""}reverse` : t || "normal";
435
435
  }
436
436
  function te(e) {
437
- return `${e.value}${Et(e.type)}`;
437
+ return `${e.value}${Et(e.unit)}`;
438
438
  }
439
439
  function ve(e, t, n) {
440
- return `${e.name || "cover"} ${n && e.offset.type !== "percentage" ? `calc(100% + ${te(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${te(e.offset)} + ${t})` : te(e.offset)}`;
440
+ return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${te(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${te(e.offset)} + ${t})` : te(e.offset)}`;
441
441
  }
442
442
  function Ct(e) {
443
443
  return {
@@ -519,19 +519,19 @@ function ue(e, t, n, s, r) {
519
519
  );
520
520
  return typeof h != "function" ? null : h(i);
521
521
  }
522
- const o = Y(t), c = ye(
522
+ const o = Y(t), a = ye(
523
523
  o,
524
524
  t,
525
525
  i,
526
526
  n,
527
527
  s
528
528
  );
529
- if (!c || c.length === 0)
529
+ if (!a || a.length === 0)
530
530
  return null;
531
- const f = At(c, n, t.effectId);
531
+ const f = At(a, n, t.effectId);
532
532
  let l;
533
- const a = n?.trigger === "view-progress";
534
- a && window.ViewTimeline && (l = new ViewTimeline({
533
+ const c = n?.trigger === "view-progress";
534
+ c && window.ViewTimeline && (l = new ViewTimeline({
535
535
  subject: n.element || T(n.componentId)
536
536
  }));
537
537
  const u = f.map(({ effect: d, options: g, id: h, part: m }) => {
@@ -539,13 +539,13 @@ function ue(e, t, n, s, r) {
539
539
  S.mutate(() => {
540
540
  "timing" in d && v.updateTiming(d.timing), v.setKeyframes(d.keyframes);
541
541
  });
542
- const y = a && l ? { timeline: l } : {}, E = typeof d.customEffect == "function" ? new St(
542
+ const y = c && l ? { timeline: l } : {}, E = typeof d.customEffect == "function" ? new St(
543
543
  d.customEffect,
544
544
  p || null,
545
545
  g,
546
546
  y
547
547
  ) : new Animation(v, y.timeline);
548
- if (a)
548
+ if (c)
549
549
  if (l)
550
550
  S.mutate(() => {
551
551
  const { start: b, end: O } = Ct(d);
@@ -592,12 +592,12 @@ function $t(e, t) {
592
592
  return null;
593
593
  if (!n.style)
594
594
  return t.effectId && e ? Rt(e, t.effectId) : null;
595
- const s = n.getNames(t), i = (typeof e == "string" ? T(e) : e)?.getAnimations(), o = i?.map((f) => f.animationName) || [], c = [];
595
+ const s = n.getNames(t), i = (typeof e == "string" ? T(e) : e)?.getAnimations(), o = i?.map((f) => f.animationName) || [], a = [];
596
596
  return s.forEach((f) => {
597
- o.includes(f) && c.push(
597
+ o.includes(f) && a.push(
598
598
  i?.find((l) => l.animationName === f)
599
599
  );
600
- }), c?.length ? new le(c) : null;
600
+ }), a?.length ? new le(a) : null;
601
601
  }
602
602
  function Rt(e, t) {
603
603
  const s = (typeof e == "string" ? T(e) : e)?.getAnimations().filter((r) => {
@@ -607,13 +607,13 @@ function Rt(e, t) {
607
607
  return s?.length ? new le(s) : null;
608
608
  }
609
609
  function Me(e, t, n, s = {}) {
610
- const { disabled: r, allowActiveEvent: i, ...o } = s, c = ue(e, t, n, o);
611
- if (!c)
610
+ const { disabled: r, allowActiveEvent: i, ...o } = s, a = ue(e, t, n, o);
611
+ if (!a)
612
612
  return null;
613
613
  let f = {};
614
614
  if (n.trigger === "view-progress" && !window.ViewTimeline) {
615
- const l = n.element || T(n.componentId), { ready: a } = c;
616
- return c.animations.map((u) => ({
615
+ const l = n.element || T(n.componentId), { ready: c } = a;
616
+ return a.animations.map((u) => ({
617
617
  /* we use getters for start and end in order to access the animation's start and end
618
618
  only when initializing the scrub scene rather than immediately */
619
619
  get start() {
@@ -623,9 +623,9 @@ function Me(e, t, n, s = {}) {
623
623
  return u.end;
624
624
  },
625
625
  viewSource: l,
626
- ready: a,
626
+ ready: c,
627
627
  getProgress() {
628
- return c.getProgress();
628
+ return a.getProgress();
629
629
  },
630
630
  effect(d, g) {
631
631
  const { activeDuration: h } = u.effect.getComputedTiming(), { delay: m } = u.effect.getTiming();
@@ -637,12 +637,12 @@ function Me(e, t, n, s = {}) {
637
637
  }
638
638
  }));
639
639
  } else if (n.trigger === "pointer-move") {
640
- const l = t, { centeredToTarget: a, transitionDuration: u, transitionEasing: d } = l, g = n.axis;
640
+ const l = t, { centeredToTarget: c, transitionDuration: u, transitionEasing: d } = l, g = n.axis;
641
641
  if (l.keyframeEffect) {
642
- const h = c;
642
+ const h = a;
643
643
  return h.animations?.length === 0 ? null : {
644
644
  target: void 0,
645
- centeredToTarget: a,
645
+ centeredToTarget: c,
646
646
  ready: h.ready,
647
647
  _currentProgress: 0,
648
648
  getProgress() {
@@ -659,28 +659,28 @@ function Me(e, t, n, s = {}) {
659
659
  };
660
660
  }
661
661
  f = {
662
- centeredToTarget: a,
662
+ centeredToTarget: c,
663
663
  allowActiveEvent: i
664
- }, t.customEffect && u && (f.transitionDuration = u, f.transitionEasing = bt(d)), f.target = c.target;
664
+ }, t.customEffect && u && (f.transitionDuration = u, f.transitionEasing = bt(d)), f.target = a.target;
665
665
  }
666
666
  return {
667
667
  ...f,
668
668
  getProgress() {
669
- return c.getProgress();
669
+ return a.getProgress();
670
670
  },
671
- effect(l, a, u, d) {
672
- c.progress(
671
+ effect(l, c, u, d) {
672
+ a.progress(
673
673
  u ? {
674
674
  // @ts-expect-error spread error on p
675
- ...a,
675
+ ...c,
676
676
  v: u,
677
677
  active: d
678
- } : a
678
+ } : c
679
679
  );
680
680
  },
681
681
  disabled: r,
682
682
  destroy() {
683
- c.cancel();
683
+ a.cancel();
684
684
  }
685
685
  };
686
686
  }
@@ -727,10 +727,10 @@ function Ft({
727
727
  o = s?.filter((h) => h.duration).map(
728
728
  (h) => `${h.name} ${h.duration}ms ${z(h.easing) || "ease"}${h.delay ? ` ${h.delay}ms` : ""}`
729
729
  ) || [];
730
- const c = s?.map((h) => `${h.name}: ${h.value};`) || [], f = e.replace(/"/g, "'"), l = `:is(:state(${t}), :--${t}) ${r}`, a = `[data-interact-effect~="${t}"] ${r}`, u = i ? N(l, i) : l, d = i ? N(a, i) : a, g = [
730
+ const a = s?.map((h) => `${h.name}: ${h.value};`) || [], f = e.replace(/"/g, "'"), l = `:is(:state(${t}), :--${t}) ${r}`, c = `[data-interact-effect~="${t}"] ${r}`, u = i ? N(l, i) : l, d = i ? N(c, i) : c, g = [
731
731
  `${u},
732
732
  ${d} {
733
- ${c.join(`
733
+ ${a.join(`
734
734
  `)}
735
735
  }`
736
736
  ];
@@ -754,8 +754,8 @@ function K(e, t) {
754
754
  }
755
755
  }
756
756
  const M = {
757
- rangeStart: { name: "cover", offset: { value: 0, type: "percentage" } },
758
- rangeEnd: { name: "cover", offset: { value: 100, type: "percentage" } }
757
+ rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
758
+ rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
759
759
  };
760
760
  function Ht(e, t) {
761
761
  const n = e?.name ?? M.rangeStart.name, s = t?.name ?? e?.name ?? M.rangeEnd.name, r = {
@@ -789,8 +789,8 @@ function L(e, t) {
789
789
  e.get(t)?.forEach((s) => {
790
790
  const { source: r, target: i, cleanup: o } = s;
791
791
  o();
792
- const c = r === t ? i : r;
793
- e.get(c)?.delete(s);
792
+ const a = r === t ? i : r;
793
+ e.get(a)?.delete(s);
794
794
  }), e.delete(t);
795
795
  }
796
796
  const qt = {
@@ -829,29 +829,29 @@ function qe(e, t = !1) {
829
829
  threshold: e.threshold
830
830
  }, r = new IntersectionObserver((i) => {
831
831
  i.forEach((o) => {
832
- const c = o.target, f = !V.has(c);
833
- if (f && (V.add(c), e.useSafeViewEnter && !o.isIntersecting)) {
832
+ const a = o.target, f = !V.has(a);
833
+ if (f && (V.add(a), e.useSafeViewEnter && !o.isIntersecting)) {
834
834
  S.measure(() => {
835
- const a = o.boundingClientRect.height, u = o.rootBounds?.height;
835
+ const c = o.boundingClientRect.height, u = o.rootBounds?.height;
836
836
  if (!u)
837
837
  return;
838
838
  const d = Array.isArray(e.threshold) ? Math.min(...e.threshold) : e.threshold;
839
- d && a * d > u && S.mutate(() => {
840
- r.unobserve(c);
839
+ d && c * d > u && S.mutate(() => {
840
+ r.unobserve(a);
841
841
  const h = qe(e, !0);
842
- W.set(c, h), h.observe(c);
842
+ W.set(a, h), h.observe(a);
843
843
  });
844
844
  });
845
845
  return;
846
846
  }
847
847
  const l = e.type || "once";
848
- (o.isIntersecting || l === "alternate" && !f) && (He(c, o.isIntersecting), l === "once" && (r.unobserve(o.target), V.delete(c)));
848
+ (o.isIntersecting || l === "alternate" && !f) && (He(a, o.isIntersecting), l === "once" && (r.unobserve(o.target), V.delete(a)));
849
849
  });
850
850
  }, s);
851
851
  return P[n] = r, r;
852
852
  }
853
853
  function Nt(e, t, n, s = {}, { reducedMotion: r, selectorCondition: i } = {}) {
854
- const o = { ...Fe, ...s }, c = o.type || "once", f = X(
854
+ const o = { ...Fe, ...s }, a = o.type || "once", f = X(
855
855
  t,
856
856
  x(n),
857
857
  void 0,
@@ -860,21 +860,25 @@ function Nt(e, t, n, s = {}, { reducedMotion: r, selectorCondition: i } = {}) {
860
860
  if (!f)
861
861
  return;
862
862
  const l = qe(o);
863
- c !== "once" && f.persist?.();
864
- let a = !0;
863
+ a !== "once" && f.persist?.();
864
+ let c = !0;
865
865
  const g = { source: e, target: t, handler: (h) => {
866
- i && !t.matches(i) || (c === "once" ? h && f.play(() => {
866
+ i && !t.matches(i) || (a === "once" ? h && f.play(() => {
867
867
  const m = () => {
868
- t.dataset.interactEnter = "done";
868
+ t.dataset.interactEnter = "start";
869
869
  };
870
- f.isCSS ? S.mutate(() => {
870
+ f.isCSS ? (S.mutate(() => {
871
871
  requestAnimationFrame(m);
872
- }) : S.mutate(m);
873
- }) : c === "alternate" ? a && h ? (a = !1, f.play()) : a || f.reverse() : c === "repeat" ? h ? (f.progress(0), f.play()) : (f.pause(), f.progress(0)) : c === "state" && (h ? f.play() : f.pause()));
872
+ }), f.onFinish(() => {
873
+ S.mutate(() => {
874
+ t.dataset.interactEnter = "done";
875
+ });
876
+ })) : S.mutate(m);
877
+ }) : a === "alternate" ? c && h ? (c = !1, f.play()) : c || f.reverse() : a === "repeat" ? h ? (f.progress(0), f.play()) : (f.pause(), f.progress(0)) : a === "state" && (h ? f.play() : f.pause()));
874
878
  }, cleanup: () => {
875
- (W.get(e) || l).unobserve(e), (c === "repeat" || c === "state") && we().unobserve(e), f.cancel(), V.delete(e), W.delete(e);
879
+ (W.get(e) || l).unobserve(e), (a === "repeat" || a === "state") && we().unobserve(e), f.cancel(), V.delete(e), W.delete(e);
876
880
  } };
877
- I(G, e, g), I(G, t, g), W.set(e, l), l.observe(e), (c === "repeat" || c === "state") && we().observe(e);
881
+ I(G, e, g), I(G, t, g), W.set(e, l), l.observe(e), (a === "repeat" || a === "state") && we().observe(e);
878
882
  }
879
883
  function Vt(e) {
880
884
  L(G, e);
@@ -926,29 +930,29 @@ function Q(e, t) {
926
930
  return e ? /^-?\d+px$/.test(e) ? parseInt(e) : /^-?\d+[lsd]?vh$/.test(e) ? parseInt(e) * t.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(e) ? parseInt(e) * t.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(e) ? Kt(e, t) : parseInt(e) || 0 : 0;
927
931
  }
928
932
  function _(e, t, n) {
929
- const { name: s, offset: r = 0 } = e, { start: i, end: o } = n, c = o - i, f = r / 100;
930
- let l, a;
931
- return s === "entry" ? (l = i - t, a = Math.min(t, c)) : s === "entry-crossing" ? (l = i - t, a = c) : s === "contain" ? (l = Math.min(o - t, i), a = Math.abs(t - c)) : s === "exit" ? (l = Math.max(i, o - t), a = Math.min(t, c)) : s === "exit-crossing" ? (l = i, a = c) : s === "cover" && (l = i - t, a = c + t), l + f * a | 0;
933
+ const { name: s, offset: r = 0 } = e, { start: i, end: o } = n, a = o - i, f = r / 100;
934
+ let l, c;
935
+ return s === "entry" ? (l = i - t, c = Math.min(t, a)) : s === "entry-crossing" ? (l = i - t, c = a) : s === "contain" ? (l = Math.min(o - t, i), c = Math.abs(t - a)) : s === "exit" ? (l = Math.max(i, o - t), c = Math.min(t, a)) : s === "exit-crossing" ? (l = i, c = a) : s === "cover" && (l = i - t, c = a + t), l + f * c | 0;
932
936
  }
933
937
  function ne(e, t, n, s, r) {
934
938
  let i = 0;
935
939
  const o = { start: t, end: n };
936
- return e.forEach((c, f) => {
937
- i += c.offset;
938
- const l = c.sticky;
940
+ return e.forEach((a, f) => {
941
+ i += a.offset;
942
+ const l = a.sticky;
939
943
  if (l) {
940
944
  if ("end" in l && e[f - 1]?.element) {
941
- const d = ((r ? c.element.offsetWidth : c.element.offsetHeight) || 0) + l.end - s, g = i + d - c.offset, h = g < o.start, m = !h && g <= n;
945
+ const d = ((r ? a.element.offsetWidth : a.element.offsetHeight) || 0) + l.end - s, g = i + d - a.offset, h = g < o.start, m = !h && g <= n;
942
946
  let p = 0;
943
- (h || m) && (p = c.offset, o.end += p), h && (o.start += p);
947
+ (h || m) && (p = a.offset, o.end += p), h && (o.start += p);
944
948
  }
945
949
  if ("start" in l) {
946
- const a = i - l.start, u = a < o.start, d = !u && a <= o.end;
950
+ const c = i - l.start, u = c < o.start, d = !u && c <= o.end;
947
951
  let g = 0;
948
952
  const h = e[f - 1]?.element;
949
953
  if (h) {
950
954
  if (u || d) {
951
- const m = (r ? h.offsetWidth : h.offsetHeight) || 0, p = c.offset, v = (r ? c.element.offsetWidth : c.element.offsetHeight) || 0;
955
+ const m = (r ? h.offsetWidth : h.offsetHeight) || 0, p = a.offset, v = (r ? a.element.offsetWidth : a.element.offsetHeight) || 0;
952
956
  g = m - (p + v), i += g, o.end += g;
953
957
  }
954
958
  u && (o.start += g);
@@ -958,25 +962,25 @@ function ne(e, t, n, s, r) {
958
962
  }), o;
959
963
  }
960
964
  function Gt(e, t, n, s, r, i) {
961
- const { start: o, end: c, duration: f } = e;
962
- let l = o, a = c, u = e.startRange, d = e.endRange, g;
965
+ const { start: o, end: a, duration: f } = e;
966
+ let l = o, c = a, u = e.startRange, d = e.endRange, g;
963
967
  if (typeof f == "string") {
964
- u = { name: f, offset: 0 }, d = { name: f, offset: 100 }, l = _(u, n, t), a = _(d, n, t), g = a - l;
965
- const h = ne(i, l, a, n, s);
966
- l = h.start, a = h.end;
968
+ u = { name: f, offset: 0 }, d = { name: f, offset: 100 }, l = _(u, n, t), c = _(d, n, t), g = c - l;
969
+ const h = ne(i, l, c, n, s);
970
+ l = h.start, c = h.end;
967
971
  } else {
968
972
  if (u || o?.name) {
969
973
  u = u || o;
970
974
  const h = Q(u.add, r), m = _({ ...u, offset: 0 }, n, t), p = _({ ...u, offset: 100 }, n, t), v = ne(i, m, p, n, s);
971
975
  l = v.start + u.offset / 100 * (v.end - v.start) + h;
972
976
  }
973
- if (d || c?.name) {
974
- d = d || c;
977
+ if (d || a?.name) {
978
+ d = d || a;
975
979
  const h = Q(d.add, r), m = _({ ...d, offset: 0 }, n, t), p = _({ ...d, offset: 100 }, n, t), v = ne(i, m, p, n, s);
976
- a = v.start + d.offset / 100 * (v.end - v.start) + h;
977
- } else typeof f == "number" && (a = l + f);
980
+ c = v.start + d.offset / 100 * (v.end - v.start) + h;
981
+ } else typeof f == "number" && (c = l + f);
978
982
  }
979
- return !g && !f && (g = a - l), { ...e, start: l, end: a, startRange: u, endRange: d, duration: g || f };
983
+ return !g && !f && (g = c - l), { ...e, start: l, end: c, startRange: u, endRange: d, duration: g || f };
980
984
  }
981
985
  function Qt(e) {
982
986
  return e.position === "sticky";
@@ -1002,7 +1006,7 @@ function Zt(e, t) {
1002
1006
  }
1003
1007
  function F(e, t, n, s, r) {
1004
1008
  const i = e[0].viewSource, o = [];
1005
- let c = (s ? i.offsetWidth : i.offsetHeight) || 0, f = 0, l = i;
1009
+ let a = (s ? i.offsetWidth : i.offsetHeight) || 0, f = 0, l = i;
1006
1010
  for (; l; ) {
1007
1011
  const u = window.getComputedStyle(l), d = Qt(u), g = d ? Zt(u, s) : void 0, h = Jt(l, s, d);
1008
1012
  if ((!g || !("end" in g)) && (f += h), o.push({ element: l, offset: h, sticky: g }), l = l.offsetParent, Bt(u, l, t))
@@ -1015,7 +1019,7 @@ function F(e, t, n, s, r) {
1015
1019
  return o.reverse(), e.map((u) => ({
1016
1020
  ...Gt(
1017
1021
  u,
1018
- { start: f, end: f + c },
1022
+ { start: f, end: f + a },
1019
1023
  n,
1020
1024
  s,
1021
1025
  r,
@@ -1046,7 +1050,7 @@ function nn() {
1046
1050
  }
1047
1051
  function sn(e) {
1048
1052
  const t = ze(e, en), n = t.root, s = t.horizontal, r = /* @__PURE__ */ new WeakMap();
1049
- let i = Ie(n, s), o, c, f, l, a;
1053
+ let i = Ie(n, s), o, a, f, l, c;
1050
1054
  const u = [], d = nn();
1051
1055
  if (t.scenes = Object.values(
1052
1056
  // TODO(ameerf): find a polyfill and use groupBy instead of following reduce
@@ -1093,9 +1097,9 @@ function sn(e) {
1093
1097
  u.length = 0, u.push(...p), u.forEach((v) => {
1094
1098
  m.set(v[0].viewSource, v);
1095
1099
  });
1096
- }, Se), n === window ? window.addEventListener("resize", l) : window.ResizeObserver && (a = new window.ResizeObserver(l), a.observe(n, { box: "border-box" })));
1100
+ }, Se), n === window ? window.addEventListener("resize", l) : window.ResizeObserver && (c = new window.ResizeObserver(l), c.observe(n, { box: "border-box" })));
1097
1101
  }
1098
- t.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(m) {
1102
+ t.observeViewportEntry && window.IntersectionObserver && (a = new window.IntersectionObserver(function(m) {
1099
1103
  m.forEach((p) => {
1100
1104
  (r.get(p.target) || []).forEach((v) => {
1101
1105
  v.disabled = !p.isIntersecting;
@@ -1108,7 +1112,7 @@ function sn(e) {
1108
1112
  }), t.scenes.forEach((m) => {
1109
1113
  if (m.viewSource) {
1110
1114
  let p = r.get(m.viewSource);
1111
- p || (p = [], r.set(m.viewSource, p), c.observe(m.viewSource)), p.push(m);
1115
+ p || (p = [], r.set(m.viewSource, p), a.observe(m.viewSource)), p.push(m);
1112
1116
  }
1113
1117
  }));
1114
1118
  function g({ p: m, vp: p }) {
@@ -1124,7 +1128,7 @@ function sn(e) {
1124
1128
  }
1125
1129
  }
1126
1130
  function h() {
1127
- t.scenes.forEach((m) => m.destroy?.()), c && (c.disconnect(), c = null), f && (f.disconnect(), f = null), l && (a ? (a.disconnect(), a = null) : window.removeEventListener("resize", l));
1131
+ t.scenes.forEach((m) => m.destroy?.()), a && (a.disconnect(), a = null), f && (f.disconnect(), f = null), l && (c ? (c.disconnect(), c = null) : window.removeEventListener("resize", l));
1128
1132
  }
1129
1133
  return {
1130
1134
  tick: g,
@@ -1234,20 +1238,20 @@ class on {
1234
1238
  }
1235
1239
  const re = /* @__PURE__ */ new WeakMap();
1236
1240
  let De = () => ({});
1237
- function cn(e) {
1241
+ function an(e) {
1238
1242
  De = e;
1239
1243
  }
1240
- function an(e, t, n, s, { reducedMotion: r }) {
1244
+ function cn(e, t, n, s, { reducedMotion: r }) {
1241
1245
  if (r)
1242
1246
  return;
1243
1247
  const i = {
1244
1248
  trigger: "view-progress",
1245
1249
  element: e
1246
1250
  }, o = x(n);
1247
- let c;
1251
+ let a;
1248
1252
  if ("ViewTimeline" in window) {
1249
1253
  const l = ue(t, o, i);
1250
- l && (l.play(), c = () => {
1254
+ l && (l.play(), a = () => {
1251
1255
  l.ready.then(() => {
1252
1256
  l.cancel();
1253
1257
  });
@@ -1255,35 +1259,35 @@ function an(e, t, n, s, { reducedMotion: r }) {
1255
1259
  } else {
1256
1260
  const l = Me(t, o, i);
1257
1261
  if (l) {
1258
- const a = Array.isArray(l) ? l : [l], u = new on({
1262
+ const c = Array.isArray(l) ? l : [l], u = new on({
1259
1263
  viewSource: e,
1260
- scenes: a,
1264
+ scenes: c,
1261
1265
  observeViewportEntry: !1,
1262
1266
  observeViewportResize: !1,
1263
1267
  observeSourcesResize: !0,
1264
1268
  root: document.body,
1265
1269
  ...De()
1266
1270
  });
1267
- c = () => {
1271
+ a = () => {
1268
1272
  u.destroy();
1269
- }, Promise.all(a.map((d) => d.ready || Promise.resolve())).then(
1273
+ }, Promise.all(c.map((d) => d.ready || Promise.resolve())).then(
1270
1274
  () => {
1271
1275
  u.start();
1272
1276
  }
1273
1277
  );
1274
1278
  }
1275
1279
  }
1276
- if (!c) return;
1277
- const f = { source: e, target: t, cleanup: c };
1280
+ if (!a) return;
1281
+ const f = { source: e, target: t, cleanup: a };
1278
1282
  I(re, e, f), I(re, t, f);
1279
1283
  }
1280
1284
  function fn(e) {
1281
1285
  L(re, e);
1282
1286
  }
1283
1287
  const ln = {
1284
- add: an,
1288
+ add: cn,
1285
1289
  remove: fn,
1286
- registerOptionsGetter: cn
1290
+ registerOptionsGetter: an
1287
1291
  }, oe = /* @__PURE__ */ new WeakMap();
1288
1292
  function un(e, t, n, s = !1, r) {
1289
1293
  const i = X(
@@ -1295,9 +1299,9 @@ function un(e, t, n, s = !1, r) {
1295
1299
  if (!i)
1296
1300
  return null;
1297
1301
  const o = n.type || "alternate";
1298
- let c = !0;
1302
+ let a = !0;
1299
1303
  return (f) => {
1300
- r && !e.matches(r) || (f.type === "mouseenter" || f.type === "focusin" ? o === "alternate" ? c ? (c = !1, i.play()) : i.reverse() : o === "state" ? i.playState !== "finished" && i.play() : (i.progress(0), i.isCSS && i.onFinish(() => {
1304
+ r && !e.matches(r) || (f.type === "mouseenter" || f.type === "focusin" ? o === "alternate" ? a ? (a = !1, i.play()) : i.reverse() : o === "state" ? i.playState !== "finished" && i.play() : (i.progress(0), i.isCSS && i.onFinish(() => {
1301
1305
  S.mutate(() => {
1302
1306
  e.dataset.motionEnter = "done";
1303
1307
  });
@@ -1311,20 +1315,20 @@ function dn(e, t, {
1311
1315
  listContainer: s,
1312
1316
  listItemSelector: r
1313
1317
  }, i, o) {
1314
- const c = i.method || "toggle", f = c === "toggle", l = !!s;
1315
- return (a) => {
1318
+ const a = i.method || "toggle", f = a === "toggle", l = !!s;
1319
+ return (c) => {
1316
1320
  if (o && !e.matches(o)) return;
1317
1321
  let u;
1318
1322
  if (l && (u = e.closest(
1319
1323
  `${s} > ${r || ""}:has(:scope)`
1320
- )), a.type === "mouseenter" || a.type === "focusin") {
1321
- const d = f ? "add" : c;
1324
+ )), c.type === "mouseenter" || c.type === "focusin") {
1325
+ const d = f ? "add" : a;
1322
1326
  t.toggleEffect(n, d, u);
1323
- } else (a.type === "mouseleave" || a.type === "focusout") && f && t.toggleEffect(n, "remove", u);
1327
+ } else (c.type === "mouseleave" || c.type === "focusout") && f && t.toggleEffect(n, "remove", u);
1324
1328
  };
1325
1329
  }
1326
- function hn(e, t, n, s = {}, { reducedMotion: r, targetController: i, selectorCondition: o, allowA11yTriggers: c }) {
1327
- let f, l = !1, a = !1;
1330
+ function hn(e, t, n, s = {}, { reducedMotion: r, targetController: i, selectorCondition: o, allowA11yTriggers: a }) {
1331
+ let f, l = !1, c = !1;
1328
1332
  if (n.transition || n.transitionProperties ? (f = dn(
1329
1333
  t,
1330
1334
  i,
@@ -1337,16 +1341,16 @@ function hn(e, t, n, s = {}, { reducedMotion: r, targetController: i, selectorCo
1337
1341
  s,
1338
1342
  r,
1339
1343
  o
1340
- ), a = s.type === "once"), !f)
1344
+ ), c = s.type === "once"), !f)
1341
1345
  return;
1342
1346
  const u = (p) => {
1343
1347
  e.contains(p.relatedTarget) || f(p);
1344
1348
  }, d = (p) => {
1345
1349
  e.contains(p.relatedTarget) || f(p);
1346
1350
  }, h = { source: e, target: t, cleanup: () => {
1347
- e.removeEventListener("mouseenter", f), e.removeEventListener("mouseleave", f), c && (e.removeEventListener("focusin", u), e.removeEventListener("focusout", d));
1351
+ e.removeEventListener("mouseenter", f), e.removeEventListener("mouseleave", f), a && (e.removeEventListener("focusin", u), e.removeEventListener("focusout", d));
1348
1352
  } };
1349
- I(oe, e, h), I(oe, t, h), c && (e.tabIndex = 0, e.addEventListener("focusin", u, { once: a })), e.addEventListener("mouseenter", f, { passive: !0, once: a }), (l ? (s.method || "toggle") === "toggle" : s.type !== "once") && (e.addEventListener("mouseleave", f, { passive: !0 }), c && e.addEventListener("focusout", d, { once: a }));
1353
+ I(oe, e, h), I(oe, t, h), a && (e.tabIndex = 0, e.addEventListener("focusin", u, { once: c })), e.addEventListener("mouseenter", f, { passive: !0, once: c }), (l ? (s.method || "toggle") === "toggle" : s.type !== "once") && (e.addEventListener("mouseleave", f, { passive: !0 }), a && e.addEventListener("focusout", d, { once: c }));
1350
1354
  }
1351
1355
  function mn(e) {
1352
1356
  L(oe, e);
@@ -1354,7 +1358,7 @@ function mn(e) {
1354
1358
  const Oe = {
1355
1359
  add: hn,
1356
1360
  remove: mn
1357
- }, ce = /* @__PURE__ */ new WeakMap();
1361
+ }, ae = /* @__PURE__ */ new WeakMap();
1358
1362
  function pn(e, t, n, s = !1, r) {
1359
1363
  const i = X(
1360
1364
  e,
@@ -1365,9 +1369,9 @@ function pn(e, t, n, s = !1, r) {
1365
1369
  if (!i)
1366
1370
  return null;
1367
1371
  let o = !0;
1368
- const c = n.type || "alternate";
1372
+ const a = n.type || "alternate";
1369
1373
  return (f) => {
1370
- r && !e.matches(r) || (c === "alternate" ? o ? (o = !1, i.play()) : i.reverse() : c === "state" ? o ? (o = !1, i.play()) : i.playState === "running" ? i.pause() : i.playState !== "finished" && i.play() : (i.progress(0), i.isCSS && i.onFinish(() => {
1374
+ r && !e.matches(r) || (a === "alternate" ? o ? (o = !1, i.play()) : i.reverse() : a === "state" ? o ? (o = !1, i.play()) : i.playState === "running" ? i.pause() : i.playState !== "finished" && i.play() : (i.progress(0), i.isCSS && i.onFinish(() => {
1371
1375
  S.mutate(() => {
1372
1376
  e.dataset.interactEnter = "done";
1373
1377
  });
@@ -1379,16 +1383,16 @@ function gn(e, t, {
1379
1383
  listContainer: s,
1380
1384
  listItemSelector: r
1381
1385
  }, i, o) {
1382
- const c = !!s;
1386
+ const a = !!s;
1383
1387
  return (f) => {
1384
1388
  if (o && !e.matches(o)) return;
1385
1389
  let l;
1386
- c && (l = e.closest(
1390
+ a && (l = e.closest(
1387
1391
  `${s} > ${r || ""}:has(:scope)`
1388
1392
  )), t.toggleEffect(n, i.method || "toggle", l);
1389
1393
  };
1390
1394
  }
1391
- function vn(e, t, n, s = {}, { reducedMotion: r, targetController: i, selectorCondition: o, allowA11yTriggers: c }) {
1395
+ function vn(e, t, n, s = {}, { reducedMotion: r, targetController: i, selectorCondition: o, allowA11yTriggers: a }) {
1392
1396
  let f, l = !1;
1393
1397
  if (n.transition || n.transitionProperties ? f = gn(
1394
1398
  t,
@@ -1404,17 +1408,17 @@ function vn(e, t, n, s = {}, { reducedMotion: r, targetController: i, selectorCo
1404
1408
  o
1405
1409
  ), l = s.type === "once"), !f)
1406
1410
  return;
1407
- const a = (h) => {
1411
+ const c = (h) => {
1408
1412
  h.pointerType && f(h);
1409
1413
  }, u = (h) => {
1410
1414
  h.code === "Space" ? (h.preventDefault(), f(h)) : h.code === "Enter" && f(h);
1411
1415
  }, g = { source: e, target: t, cleanup: () => {
1412
- e.removeEventListener("click", a), c && e.removeEventListener("keydown", u);
1416
+ e.removeEventListener("click", c), a && e.removeEventListener("keydown", u);
1413
1417
  } };
1414
- I(ce, e, g), I(ce, t, g), e.addEventListener("click", a, { passive: !0, once: l }), c && (e.tabIndex = 0, e.addEventListener("keydown", u, { once: l }));
1418
+ I(ae, e, g), I(ae, t, g), e.addEventListener("click", c, { passive: !0, once: l }), a && (e.tabIndex = 0, e.addEventListener("keydown", u, { once: l }));
1415
1419
  }
1416
1420
  function yn(e) {
1417
- L(ce, e);
1421
+ L(ae, e);
1418
1422
  }
1419
1423
  const _e = {
1420
1424
  add: vn,
@@ -1463,8 +1467,8 @@ function bn() {
1463
1467
  const t = window.scrollY;
1464
1468
  let n = !1, s;
1465
1469
  function r() {
1466
- document.body.addEventListener("pointerdown", (c) => {
1467
- s === void 0 ? s = c.offsetY : n = c.offsetY === s;
1470
+ document.body.addEventListener("pointerdown", (a) => {
1471
+ s === void 0 ? s = a.offsetY : n = a.offsetY === s;
1468
1472
  }, { once: !0 });
1469
1473
  const o = new PointerEvent("pointerdown", {
1470
1474
  clientY: 500
@@ -1515,12 +1519,12 @@ function On(e, t) {
1515
1519
  function _n(e, t, n) {
1516
1520
  return {
1517
1521
  x(s) {
1518
- const r = e.left - n.x + e.width / 2, i = r >= t.width / 2, o = (i ? r : t.width - r) * 2, c = i ? 0 : r - o / 2;
1519
- return (s - c) / o;
1522
+ const r = e.left - n.x + e.width / 2, i = r >= t.width / 2, o = (i ? r : t.width - r) * 2, a = i ? 0 : r - o / 2;
1523
+ return (s - a) / o;
1520
1524
  },
1521
1525
  y(s) {
1522
- const r = e.top - n.y + e.height / 2, i = r >= t.height / 2, o = (i ? r : t.height - r) * 2, c = i ? 0 : r - o / 2;
1523
- return (s - c) / o;
1526
+ const r = e.top - n.y + e.height / 2, i = r >= t.height / 2, o = (i ? r : t.height - r) * 2, a = i ? 0 : r - o / 2;
1527
+ return (s - a) / o;
1524
1528
  }
1525
1529
  };
1526
1530
  }
@@ -1539,20 +1543,20 @@ function xn(e) {
1539
1543
  return t.observe(e.root, { box: "border-box" }), t;
1540
1544
  }
1541
1545
  function Ln(e) {
1542
- let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, r, i, o, c;
1546
+ let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, r, i, o, a;
1543
1547
  const f = { x: 0, y: 0 };
1544
- e.scenes.forEach((a) => {
1545
- a.target && a.centeredToTarget && (a.transform = _n(wn(a.target), e.rect, f), t = !0), e.root ? r = xn(e) : (i = Tn.bind(null, e), window.addEventListener("resize", i));
1546
- }), s = function(a) {
1548
+ e.scenes.forEach((c) => {
1549
+ c.target && c.centeredToTarget && (c.transform = _n(wn(c.target), e.rect, f), t = !0), e.root ? r = xn(e) : (i = Tn.bind(null, e), window.addEventListener("resize", i));
1550
+ }), s = function(c) {
1547
1551
  for (let u of e.scenes)
1548
1552
  if (!u.disabled) {
1549
- const d = u.transform?.x(a.x) || a.x / e.rect.width, g = u.transform?.y(a.y) || a.y / e.rect.height, h = +ke(0, 1, d).toPrecision(4), m = +ke(0, 1, g).toPrecision(4), p = { x: a.vx, y: a.vy };
1550
- e.allowActiveEvent && (a.active = d <= 1 && g <= 1 && d >= 0 && g >= 0), u.effect(u, { x: h, y: m }, p, a.active);
1553
+ const d = u.transform?.x(c.x) || c.x / e.rect.width, g = u.transform?.y(c.y) || c.y / e.rect.height, h = +ke(0, 1, d).toPrecision(4), m = +ke(0, 1, g).toPrecision(4), p = { x: c.vx, y: c.vy };
1554
+ e.allowActiveEvent && (c.active = d <= 1 && g <= 1 && d >= 0 && g >= 0), u.effect(u, { x: h, y: m }, p, c.active);
1551
1555
  }
1552
- Object.assign(n, a);
1553
- }, t && (o = kn.bind(f, s, n), c = On(document, o));
1556
+ Object.assign(n, c);
1557
+ }, t && (o = kn.bind(f, s, n), a = On(document, o));
1554
1558
  function l() {
1555
- e.scenes.forEach((a) => a.destroy?.()), c?.(), r ? (r.disconnect(), r = null) : (window.removeEventListener("resize", i), i = null), s = null, n = null;
1559
+ e.scenes.forEach((c) => c.destroy?.()), a?.(), r ? (r.disconnect(), r = null) : (window.removeEventListener("resize", i), i = null), s = null, n = null;
1556
1560
  }
1557
1561
  return {
1558
1562
  tick: s,
@@ -1636,8 +1640,8 @@ class Pn {
1636
1640
  const t = this.config.transitionDuration, n = this.config.transitionEasing || ((o) => o), s = performance.now();
1637
1641
  let r = !1;
1638
1642
  const i = (o) => {
1639
- const c = (o - this._startTime) / t, f = n(Math.min(1, c));
1640
- r && (this.progress.vx = 0, this.progress.vy = 0, r = !1), this.currentProgress = Object.entries(this.progress).reduce((l, [a, u]) => (a === "active" ? l[a] = u : l[a] = this.previousProgress[a] + (u - this.previousProgress[a]) * f, l), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(i), r = o - this._startTime > Cn), this.effect.tick(this.currentProgress);
1643
+ const a = (o - this._startTime) / t, f = n(Math.min(1, a));
1644
+ r && (this.progress.vx = 0, this.progress.vy = 0, r = !1), this.currentProgress = Object.entries(this.progress).reduce((l, [c, u]) => (c === "active" ? l[c] = u : l[c] = this.previousProgress[c] + (u - this.previousProgress[c]) * f, l), this.currentProgress || {}), a < 1 && (this._nextTransitionTick = requestAnimationFrame(i), r = o - this._startTime > Cn), this.effect.tick(this.currentProgress);
1641
1645
  };
1642
1646
  return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, i(s)) : this._startTime = s, this._nextTransitionTick;
1643
1647
  }
@@ -1675,7 +1679,7 @@ class Pn {
1675
1679
  this.effect && this.effect.destroy(), this.effect = null;
1676
1680
  }
1677
1681
  }
1678
- const ae = /* @__PURE__ */ new WeakMap();
1682
+ const ce = /* @__PURE__ */ new WeakMap();
1679
1683
  let Ne = () => ({});
1680
1684
  function $n(e) {
1681
1685
  Ne = e;
@@ -1689,22 +1693,22 @@ function Rn(e, t, n, s = {}, { reducedMotion: r }) {
1689
1693
  axis: s.axis ?? "y"
1690
1694
  }, o = Me(t, x(n), i);
1691
1695
  if (o) {
1692
- const c = Array.isArray(o) ? o : [o], f = new Pn({
1696
+ const a = Array.isArray(o) ? o : [o], f = new Pn({
1693
1697
  root: s.hitArea === "self" ? e : void 0,
1694
- scenes: c,
1698
+ scenes: a,
1695
1699
  ...Ne()
1696
- }), a = { source: e, target: t, cleanup: () => {
1700
+ }), c = { source: e, target: t, cleanup: () => {
1697
1701
  f.destroy();
1698
1702
  } };
1699
- I(ae, e, a), I(ae, t, a), Promise.all(
1700
- c.map((u) => u.ready || Promise.resolve())
1703
+ I(ce, e, c), I(ce, t, c), Promise.all(
1704
+ a.map((u) => u.ready || Promise.resolve())
1701
1705
  ).then(() => {
1702
1706
  f.start();
1703
1707
  });
1704
1708
  }
1705
1709
  }
1706
1710
  function Mn(e) {
1707
- L(ae, e);
1711
+ L(ce, e);
1708
1712
  }
1709
1713
  const Fn = {
1710
1714
  add: Rn,
@@ -1720,12 +1724,12 @@ function Hn(e, t, n, s, { reducedMotion: r, selectorCondition: i }) {
1720
1724
  );
1721
1725
  if (!o)
1722
1726
  return;
1723
- const c = () => {
1727
+ const a = () => {
1724
1728
  i && !t.matches(i) || o.play();
1725
1729
  }, l = { source: e, target: t, cleanup: () => {
1726
- o.cancel(), e.removeEventListener("animationend", c);
1730
+ o.cancel(), e.removeEventListener("animationend", a);
1727
1731
  } };
1728
- I(fe, e, l), I(fe, t, l), e.addEventListener("animationend", c);
1732
+ I(fe, e, l), I(fe, t, l), e.addEventListener("animationend", a);
1729
1733
  }
1730
1734
  function qn(e) {
1731
1735
  L(fe, e);
@@ -1869,7 +1873,7 @@ function B(e, {
1869
1873
  function Vn(e, t = !1) {
1870
1874
  const n = e.conditions || {}, s = {};
1871
1875
  return e.interactions?.forEach((r) => {
1872
- const i = r.key, o = ++Nn, { effects: c, ...f } = r;
1876
+ const i = r.key, o = ++Nn, { effects: a, ...f } = r;
1873
1877
  if (!i) {
1874
1878
  console.error(`Interaction ${o} is missing a key for source element.`);
1875
1879
  return;
@@ -1880,13 +1884,13 @@ function Vn(e, t = !1) {
1880
1884
  interactionIds: /* @__PURE__ */ new Set(),
1881
1885
  selectors: /* @__PURE__ */ new Set()
1882
1886
  });
1883
- const l = Array.from(c);
1887
+ const l = Array.from(a);
1884
1888
  l.reverse();
1885
- const a = { ...f, effects: l };
1886
- s[i].triggers.push(a), s[i].selectors.add(
1887
- B(a, { useFirstChild: t })
1889
+ const c = { ...f, effects: l };
1890
+ s[i].triggers.push(c), s[i].selectors.add(
1891
+ B(c, { useFirstChild: t })
1888
1892
  );
1889
- const u = a.listContainer;
1893
+ const u = c.listContainer;
1890
1894
  l.forEach((d) => {
1891
1895
  let g = d.key;
1892
1896
  if (!g && d.effectId) {
@@ -1919,26 +1923,26 @@ function Le(e, t, n) {
1919
1923
  return s ? e.selector ? Array.from(s.querySelectorAll(e.selector)) : Array.from(s.children) : (console.warn(`Interact: No container found for list container "${e.listContainer}"`), []);
1920
1924
  }
1921
1925
  if (e.selector) {
1922
- const s = t.querySelector(e.selector);
1923
- if (s)
1924
- return s;
1925
- console.warn(`Interact: No element found for selector "${e.selector}"`);
1926
+ const s = t.querySelectorAll(e.selector);
1927
+ if (s.length > 0)
1928
+ return Array.from(s);
1929
+ console.warn(`Interact: No elements found for selector "${e.selector}"`);
1926
1930
  }
1927
1931
  return n ? t.firstElementChild : t;
1928
1932
  }
1929
1933
  function Ce(e, t) {
1930
1934
  return t.map((n) => e.selector ? n.querySelector(e.selector) : n).filter(Boolean);
1931
1935
  }
1932
- function Ve(e, t, n, s, r, i, o, c) {
1936
+ function Ve(e, t, n, s, r, i, o, a) {
1933
1937
  return [
1934
1938
  o ? Ce(e, o) : Le(e, n, s),
1935
- c ? Ce(t, c) : Le(t, r, i)
1939
+ a ? Ce(t, a) : Le(t, r, i)
1936
1940
  ];
1937
1941
  }
1938
1942
  function We(e, t, n, s, r, i, o) {
1939
- const c = Array.isArray(s), f = Array.isArray(r);
1940
- c ? s.forEach((l, a) => {
1941
- const u = f ? r[a] : r;
1943
+ const a = Array.isArray(s), f = Array.isArray(r);
1944
+ a ? s.forEach((l, c) => {
1945
+ const u = f ? r[c] : r;
1942
1946
  u && Ae(
1943
1947
  e,
1944
1948
  l,
@@ -1949,12 +1953,12 @@ function We(e, t, n, s, r, i, o) {
1949
1953
  i,
1950
1954
  o
1951
1955
  );
1952
- }) : (f ? r : [r]).forEach((a) => {
1956
+ }) : (f ? r : [r]).forEach((c) => {
1953
1957
  Ae(
1954
1958
  e,
1955
1959
  s,
1956
1960
  t.trigger,
1957
- a,
1961
+ c,
1958
1962
  n,
1959
1963
  t.params,
1960
1964
  i,
@@ -1964,12 +1968,12 @@ function We(e, t, n, s, r, i, o) {
1964
1968
  }
1965
1969
  function je(e, t, n, s, r) {
1966
1970
  const i = {}, o = [];
1967
- s.effects.forEach((c) => {
1968
- const f = c.effectId, l = {
1971
+ s.effects.forEach((a) => {
1972
+ const f = a.effectId, l = {
1969
1973
  ...n.dataCache.effects[f] || {},
1970
- ...c,
1974
+ ...a,
1971
1975
  effectId: f
1972
- }, a = l.key, u = R(c.interactionId, e);
1976
+ }, c = l.key, u = R(a.interactionId, e);
1973
1977
  if (i[u] || n.addedInteractions[u] && !r)
1974
1978
  return;
1975
1979
  const d = U(l.conditions || [], n.dataCache.conditions);
@@ -1977,7 +1981,7 @@ function je(e, t, n, s, r) {
1977
1981
  t.update();
1978
1982
  }), !d || d.matches) {
1979
1983
  i[u] = !0;
1980
- const g = a && R(a, e);
1984
+ const g = c && R(c, e);
1981
1985
  let h;
1982
1986
  if (g) {
1983
1987
  if (h = w.getController(g), !h)
@@ -2011,12 +2015,12 @@ function je(e, t, n, s, r) {
2011
2015
  h.useFirstChild
2012
2016
  ]);
2013
2017
  }
2014
- }), o.reverse().forEach((c) => {
2015
- We(...c);
2018
+ }), o.reverse().forEach((a) => {
2019
+ We(...a);
2016
2020
  });
2017
2021
  }
2018
2022
  function Ye(e, t, n, s, r) {
2019
- const i = n.get(e)?.effects || {}, o = Object.keys(i), c = [];
2023
+ const i = n.get(e)?.effects || {}, o = Object.keys(i), a = [];
2020
2024
  return o.forEach((f) => {
2021
2025
  const l = R(f, e);
2022
2026
  if (n.addedInteractions[l] && !r)
@@ -2054,7 +2058,7 @@ function Ye(e, t, n, s, r) {
2054
2058
  h.conditions || [],
2055
2059
  n.dataCache.conditions
2056
2060
  );
2057
- return c.push([
2061
+ return a.push([
2058
2062
  e,
2059
2063
  d,
2060
2064
  h,
@@ -2066,11 +2070,11 @@ function Ye(e, t, n, s, r) {
2066
2070
  }
2067
2071
  return !1;
2068
2072
  });
2069
- }), c.reverse().forEach((f) => {
2073
+ }), a.reverse().forEach((f) => {
2070
2074
  We(...f);
2071
2075
  }), o.length > 0;
2072
2076
  }
2073
- function Ae(e, t, n, s, r, i, o, c) {
2077
+ function Ae(e, t, n, s, r, i, o, a) {
2074
2078
  let f;
2075
2079
  if (r.transition || r.transitionProperties) {
2076
2080
  const l = {
@@ -2081,7 +2085,7 @@ function Ae(e, t, n, s, r, i, o, c) {
2081
2085
  childSelector: B(r, {
2082
2086
  asCombinator: !0,
2083
2087
  addItemFilter: !0,
2084
- useFirstChild: c
2088
+ useFirstChild: a
2085
2089
  }),
2086
2090
  selectorCondition: o
2087
2091
  };
@@ -2101,10 +2105,10 @@ function Wn(e) {
2101
2105
  if (!n)
2102
2106
  return console.warn(`No instance found for key: ${t}`), w.setController(t, e), !1;
2103
2107
  const { triggers: s = [] } = n?.get(t) || {}, r = s.length > 0;
2104
- n.setController(t, e), s.forEach((o, c) => {
2108
+ n.setController(t, e), s.forEach((o, a) => {
2105
2109
  const f = U(o.conditions, n.dataCache.conditions);
2106
2110
  if (f) {
2107
- const l = `${t}::trigger::${c}`;
2111
+ const l = `${t}::trigger::${a}`;
2108
2112
  n.setupMediaQueryListener(l, f, t, () => {
2109
2113
  e.update();
2110
2114
  });
@@ -2118,12 +2122,12 @@ function jn(e, t, n) {
2118
2122
  const s = e.key, r = w.getInstance(s);
2119
2123
  if (r) {
2120
2124
  const { triggers: i = [] } = r?.get(s) || {};
2121
- i.forEach((o, c) => {
2125
+ i.forEach((o, a) => {
2122
2126
  if (o.listContainer !== t)
2123
2127
  return;
2124
2128
  const f = U(o.conditions, r.dataCache.conditions);
2125
2129
  if (f) {
2126
- const l = `${s}::listTrigger::${t}::${c}`;
2130
+ const l = `${s}::listTrigger::${t}::${a}`;
2127
2131
  r.setupMediaQueryListener(l, f, s, () => {
2128
2132
  e.update();
2129
2133
  });
@@ -2219,10 +2223,10 @@ class Kn {
2219
2223
  _childListChangeHandler(t, n) {
2220
2224
  const s = this.key || this.element.dataset.interactKey, r = [], i = [];
2221
2225
  n.forEach((o) => {
2222
- o.removedNodes.forEach((c) => {
2223
- c instanceof HTMLElement && r.push(c);
2224
- }), o.addedNodes.forEach((c) => {
2225
- c instanceof HTMLElement && i.push(c);
2226
+ o.removedNodes.forEach((a) => {
2227
+ a instanceof HTMLElement && r.push(a);
2228
+ }), o.addedNodes.forEach((a) => {
2229
+ a instanceof HTMLElement && i.push(a);
2226
2230
  });
2227
2231
  }), Ke(r), s && jn(this, t, i);
2228
2232
  }
@@ -2246,15 +2250,15 @@ function Zn(e, t = !1) {
2246
2250
  key: r,
2247
2251
  selector: i,
2248
2252
  listContainer: o,
2249
- listItemSelector: c,
2253
+ listItemSelector: a,
2250
2254
  trigger: f,
2251
2255
  params: l,
2252
- effects: a,
2256
+ effects: c,
2253
2257
  conditions: u
2254
2258
  }) => {
2255
2259
  if (f === "viewEnter") {
2256
2260
  const g = l;
2257
- (!g?.type || g.type === "once") && a.forEach((m) => {
2261
+ (!g?.type || g.type === "once") && c.forEach((m) => {
2258
2262
  const p = m?.effectId && e.effects[m.effectId] || m, {
2259
2263
  key: v,
2260
2264
  selector: y,
@@ -2262,7 +2266,7 @@ function Zn(e, t = !1) {
2262
2266
  listItemSelector: b,
2263
2267
  conditions: O
2264
2268
  } = p;
2265
- if (!(!v || v === r) || !(!y && !i || y === i) || !(!E && !o || E === o) || !(!b && !c || b === c)) return;
2269
+ if (!(!v || v === r) || !(!y && !i || y === i) || !(!E && !o || E === o) || !(!b && !a || b === a)) return;
2266
2270
  const de = e.conditions || {}, he = K(
2267
2271
  O,
2268
2272
  de
@@ -2278,7 +2282,7 @@ function Zn(e, t = !1) {
2278
2282
  t
2279
2283
  );
2280
2284
  s.has(ee) || (s.add(ee), n.push(`@media (prefers-reduced-motion: no-preference) {
2281
- ${ee}:not([data-interact-enter="done"]) {
2285
+ ${ee}:not([data-interact-enter]) {
2282
2286
  visibility: hidden;
2283
2287
  transform: none;
2284
2288
  translate: none;
@@ -2299,4 +2303,4 @@ export {
2299
2303
  Zn as g,
2300
2304
  Jn as r
2301
2305
  };
2302
- //# sourceMappingURL=index-DdSF9eaW.mjs.map
2306
+ //# sourceMappingURL=index-wDdpOvzw.mjs.map