@wix/interact 2.5.25 → 2.7.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.
Files changed (36) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/react.js +1 -1
  4. package/dist/cjs/web.js +1 -1
  5. package/dist/es/index.js +1 -1
  6. package/dist/es/react.js +2 -2
  7. package/dist/es/web.js +2 -2
  8. package/dist/{index-1AmVTHDV.mjs → index-76zNBcNy.mjs} +1232 -1156
  9. package/dist/index-76zNBcNy.mjs.map +1 -0
  10. package/dist/index-BMJFenGC.js +29 -0
  11. package/dist/index-BMJFenGC.js.map +1 -0
  12. package/dist/tsconfig.build.tsbuildinfo +1 -1
  13. package/dist/types/core/Interact.d.ts +14 -2
  14. package/dist/types/core/Interact.d.ts.map +1 -1
  15. package/dist/types/core/InteractionController.d.ts +1 -0
  16. package/dist/types/core/InteractionController.d.ts.map +1 -1
  17. package/dist/types/core/add.d.ts.map +1 -1
  18. package/dist/types/core/resolvers.d.ts.map +1 -1
  19. package/dist/types/handlers/pointerMove.d.ts.map +1 -1
  20. package/dist/types/types/controller.d.ts +5 -0
  21. package/dist/types/types/controller.d.ts.map +1 -1
  22. package/dist/types/types/external.d.ts +1 -1
  23. package/dist/types/types/external.d.ts.map +1 -1
  24. package/dist/types/types/plugins.d.ts +10 -0
  25. package/dist/types/types/plugins.d.ts.map +1 -1
  26. package/docs/api/interact-class.md +28 -2
  27. package/docs/api/types.md +12 -0
  28. package/docs/guides/effects-and-animations.md +1 -1
  29. package/docs/guides/plugins.md +36 -1
  30. package/package.json +2 -2
  31. package/rules/full-lean.md +8 -6
  32. package/rules/plugins.md +19 -1
  33. package/rules/pointermove.md +3 -3
  34. package/dist/index-1AmVTHDV.mjs.map +0 -1
  35. package/dist/index-D-S2Tzk9.js +0 -29
  36. package/dist/index-D-S2Tzk9.js.map +0 -1
@@ -1,23 +1,23 @@
1
- function Ut(e) {
1
+ function Xt(e) {
2
2
  return [...e.matchAll(/\[([^\]]+)]/g)].map(([t, n]) => n);
3
3
  }
4
- function q(e, t) {
5
- const n = Ut(t);
4
+ function k(e, t) {
5
+ const n = Xt(t);
6
6
  let s = 0;
7
7
  return n.length ? e.replace(/\[]/g, () => {
8
8
  const i = n[s++];
9
9
  return i !== void 0 ? `[${i}]` : "[]";
10
10
  }) : e;
11
11
  }
12
- function Qt(e, t) {
13
- return e.trigger === "viewEnter" && t.triggerType === "once" && W(e) === W(t);
12
+ function Zt(e, t) {
13
+ return e.trigger === "viewEnter" && t.triggerType === "once" && V(e) === V(t);
14
14
  }
15
- function W(e) {
15
+ function V(e) {
16
16
  const { key: t, listContainer: n, listItemSelector: s, selector: i } = e;
17
17
  return `${t}\0${n || ""}\0${s || ""}\0${i || ""}`;
18
18
  }
19
- const at = "$";
20
- class ne {
19
+ const He = "$";
20
+ class se {
21
21
  animations;
22
22
  options;
23
23
  ready;
@@ -121,64 +121,64 @@ class ne {
121
121
  });
122
122
  }
123
123
  }
124
- const ct = (e) => e, Xt = (e) => 1 - Math.cos(e * Math.PI / 2), Zt = (e) => Math.sin(e * Math.PI / 2), Jt = (e) => -(Math.cos(Math.PI * e) - 1) / 2, en = (e) => e ** 2, tn = (e) => 1 - (1 - e) ** 2, nn = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, sn = (e) => e ** 3, on = (e) => 1 - (1 - e) ** 3, rn = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, an = (e) => e ** 4, cn = (e) => 1 - (1 - e) ** 4, ln = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, un = (e) => e ** 5, fn = (e) => 1 - (1 - e) ** 5, dn = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, hn = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), mn = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), pn = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, gn = (e) => 1 - Math.sqrt(1 - e ** 2), vn = (e) => Math.sqrt(1 - (e - 1) ** 2), yn = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, En = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, wn = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, $n = (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, We = {
125
- linear: ct,
126
- sineIn: Xt,
127
- sineOut: Zt,
128
- sineInOut: Jt,
129
- quadIn: en,
130
- quadOut: tn,
131
- quadInOut: nn,
132
- cubicIn: sn,
133
- cubicOut: on,
134
- cubicInOut: rn,
135
- quartIn: an,
136
- quartOut: cn,
137
- quartInOut: ln,
138
- quintIn: un,
139
- quintOut: fn,
140
- quintInOut: dn,
141
- expoIn: hn,
142
- expoOut: mn,
143
- expoInOut: pn,
144
- circIn: gn,
145
- circOut: vn,
146
- circInOut: yn,
147
- backIn: En,
148
- backOut: wn,
149
- backInOut: $n
150
- }, V = (e, t, n, s, i) => {
151
- const o = 3 * t, r = 3 * (s - 2 * t), c = 1 - 3 * s + 3 * t, l = 3 * n, u = 3 * (i - 2 * n), a = 1 - 3 * i + 3 * n;
152
- let f;
124
+ const ut = (e) => e, Jt = (e) => 1 - Math.cos(e * Math.PI / 2), en = (e) => Math.sin(e * Math.PI / 2), tn = (e) => -(Math.cos(Math.PI * e) - 1) / 2, nn = (e) => e ** 2, sn = (e) => 1 - (1 - e) ** 2, on = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, rn = (e) => e ** 3, an = (e) => 1 - (1 - e) ** 3, cn = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, ln = (e) => e ** 4, fn = (e) => 1 - (1 - e) ** 4, un = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, dn = (e) => e ** 5, hn = (e) => 1 - (1 - e) ** 5, mn = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, pn = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), gn = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), vn = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, yn = (e) => 1 - Math.sqrt(1 - e ** 2), En = (e) => Math.sqrt(1 - (e - 1) ** 2), wn = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, $n = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, bn = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, Sn = (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, Ye = {
125
+ linear: ut,
126
+ sineIn: Jt,
127
+ sineOut: en,
128
+ sineInOut: tn,
129
+ quadIn: nn,
130
+ quadOut: sn,
131
+ quadInOut: on,
132
+ cubicIn: rn,
133
+ cubicOut: an,
134
+ cubicInOut: cn,
135
+ quartIn: ln,
136
+ quartOut: fn,
137
+ quartInOut: un,
138
+ quintIn: dn,
139
+ quintOut: hn,
140
+ quintInOut: mn,
141
+ expoIn: pn,
142
+ expoOut: gn,
143
+ expoInOut: vn,
144
+ circIn: yn,
145
+ circOut: En,
146
+ circInOut: wn,
147
+ backIn: $n,
148
+ backOut: bn,
149
+ backInOut: Sn
150
+ }, Y = (e, t, n, s, i) => {
151
+ const o = 3 * t, r = 3 * (s - 2 * t), c = 1 - 3 * s + 3 * t, l = 3 * n, f = 3 * (i - 2 * n), a = 1 - 3 * i + 3 * n;
152
+ let u;
153
153
  if (c === 0)
154
- f = r === 0 ? `(${e} / ${o})` : `((sqrt(max(0, ${o * o} + ${4 * r} * ${e})) - ${o}) / ${2 * r})`;
154
+ u = r === 0 ? `(${e} / ${o})` : `((sqrt(max(0, ${o * o} + ${4 * r} * ${e})) - ${o}) / ${2 * r})`;
155
155
  else {
156
- const d = r / (3 * c), h = 2 * Math.pow(r, 3) - 9 * o * r * c, m = 54 * Math.pow(c, 3), p = (3 * c * o - r * r) / (9 * c * c), g = `((${h} - ${27 * c * c} * ${e}) / ${m})`;
157
- if (p < 0) {
158
- const y = 2 * Math.sqrt(-p);
159
- let E = 0;
160
- for (const w of [0, 1, 2])
156
+ const d = r / (3 * c), h = 2 * Math.pow(r, 3) - 9 * o * r * c, p = 54 * Math.pow(c, 3), m = (3 * c * o - r * r) / (9 * c * c), g = `((${h} - ${27 * c * c} * ${e}) / ${p})`;
157
+ if (m < 0) {
158
+ const E = 2 * Math.sqrt(-m);
159
+ let y = 0;
160
+ for (const $ of [0, 1, 2])
161
161
  [0, 0.25, 0.5, 0.75, 1].every((S) => {
162
162
  const I = Math.min(
163
- Math.max(2 * (h - 27 * c * c * S) / (m * p * y), -1),
163
+ Math.max(2 * (h - 27 * c * c * S) / (p * m * E), -1),
164
164
  1
165
- ), O = y * Math.cos((Math.acos(I) - w * 2 * Math.PI) / 3) - d;
165
+ ), O = E * Math.cos((Math.acos(I) - $ * 2 * Math.PI) / 3) - d;
166
166
  return O >= -1e-6 && O <= 1.000001;
167
- }) && (E = w);
168
- const v = `(acos(clamp(-1, ${2 / (p * y)} * ${g}, 1)) - ${360 * E}deg) / 3`;
169
- f = `(${y} * cos(${v}) - ${d})`;
167
+ }) && (y = $);
168
+ const v = `(acos(clamp(-1, ${2 / (m * E)} * ${g}, 1)) - ${360 * y}deg) / 3`;
169
+ u = `(${E} * cos(${v}) - ${d})`;
170
170
  } else {
171
- const y = `sqrt(pow(${g}, 2) + ${Math.pow(p, 3)})`;
172
- f = `(pow(${y} - ${g}, 1 / 3) - pow(${y} + ${g}, 1 / 3) - ${d})`;
171
+ const E = `sqrt(pow(${g}, 2) + ${Math.pow(m, 3)})`;
172
+ u = `(pow(${E} - ${g}, 1 / 3) - pow(${E} + ${g}, 1 / 3) - ${d})`;
173
173
  }
174
174
  }
175
- return `(${a} * pow(${f}, 3) + ${u} * pow(${f}, 2) + ${l} * ${f})`;
176
- }, Ve = {
175
+ return `(${a} * pow(${u}, 3) + ${f} * pow(${u}, 2) + ${l} * ${u})`;
176
+ }, Be = {
177
177
  linear: (e) => e,
178
- ease: (e) => V(e, 0.25, 0.1, 0.25, 1),
179
- easeIn: (e) => V(e, 0.42, 0, 1, 1),
180
- easeOut: (e) => V(e, 0, 0, 0.58, 1),
181
- easeInOut: (e) => V(e, 0.42, 0, 0.58, 1),
178
+ ease: (e) => Y(e, 0.25, 0.1, 0.25, 1),
179
+ easeIn: (e) => Y(e, 0.42, 0, 1, 1),
180
+ easeOut: (e) => Y(e, 0, 0, 0.58, 1),
181
+ easeInOut: (e) => Y(e, 0.42, 0, 0.58, 1),
182
182
  sineIn: (e) => `(1 - cos(${e} * 90deg))`,
183
183
  sineOut: (e) => `(sin(${e} * 90deg))`,
184
184
  sineInOut: (e) => `((1 - cos(${e} * 180deg)) / 2)`,
@@ -203,7 +203,7 @@ const ct = (e) => e, Xt = (e) => 1 - Math.cos(e * Math.PI / 2), Zt = (e) => Math
203
203
  backIn: (e) => `(2.70158 * pow(${e}, 3) - 1.70158 * ${e} * ${e})`,
204
204
  backOut: (e) => `(1 + 2.70158 * pow(${e} - 1, 3) + 1.70158 * (${e} - 1) * (${e} - 1))`,
205
205
  backInOut: (e) => `((round(${e}) * (2 + (2 * ${e} - 2) * (2 * ${e} - 2) * (2.5949095 + 3.5949095 * (2 * ${e} - 2))) + (1 - round(${e})) * 4 * ${e} * ${e} * (3.5949095 * 2 * ${e} - 2.5949095)) / 2)`
206
- }, Ke = {
206
+ }, Ue = {
207
207
  linear: "linear",
208
208
  ease: "ease",
209
209
  easeIn: "ease-in",
@@ -234,68 +234,68 @@ const ct = (e) => e, Xt = (e) => 1 - Math.cos(e * Math.PI / 2), Zt = (e) => Math
234
234
  backOut: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
235
235
  backInOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
236
236
  };
237
- function bn(e) {
237
+ function In(e) {
238
238
  return e === "percentage" ? "%" : e || "px";
239
239
  }
240
- const Sn = /^(webkit|moz|ms|o)(?=[A-Z])/, In = Object.assign(/* @__PURE__ */ Object.create(null), {
240
+ const Tn = /^(webkit|moz|ms|o)(?=[A-Z])/, Cn = Object.assign(/* @__PURE__ */ Object.create(null), {
241
241
  float: "cssFloat",
242
242
  "animation-timing-function": "easing",
243
243
  "animation-composition": "composite"
244
244
  });
245
- function ge(e) {
246
- return e.startsWith("--") ? e : (Sn.test(e) ? `-${e}` : e).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`);
245
+ function ve(e) {
246
+ return e.startsWith("--") ? e : (Tn.test(e) ? `-${e}` : e).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`);
247
247
  }
248
- function Tn(e) {
248
+ function On(e) {
249
249
  return e.startsWith("--") || !e.includes("-") ? e : e.replace(/^-/, "").replace(/-([a-z])/g, (t, n) => n.toUpperCase());
250
250
  }
251
- function lt(e) {
252
- return In[e] || Tn(e);
251
+ function dt(e) {
252
+ return Cn[e] || On(e);
253
253
  }
254
- function Cn(e) {
254
+ function _n(e) {
255
255
  for (const t in e)
256
- if (Object.hasOwn(e, t) && lt(t) !== t)
256
+ if (Object.hasOwn(e, t) && dt(t) !== t)
257
257
  return !0;
258
258
  return !1;
259
259
  }
260
- function ut(e) {
260
+ function ht(e) {
261
261
  if (!Array.isArray(e))
262
262
  return e;
263
263
  let t;
264
264
  return e.forEach((n, s) => {
265
- if (!n || typeof n != "object" || !Cn(n))
265
+ if (!n || typeof n != "object" || !_n(n))
266
266
  return;
267
267
  t ??= e.slice();
268
268
  const i = {};
269
269
  for (const o in n)
270
- Object.hasOwn(n, o) && (i[lt(o)] = n[o]);
270
+ Object.hasOwn(n, o) && (i[dt(o)] = n[o]);
271
271
  t[s] = i;
272
272
  }), t || e;
273
273
  }
274
- function de(e) {
275
- return e ? Ke[e] || e : Ke.linear;
276
- }
277
- function On(e, t, n, s) {
278
- const i = 3 * e, o = 3 * (n - e) - i, r = 1 - i - o, c = 3 * t, l = 3 * (s - t) - c, u = 1 - c - l, a = (m) => ((r * m + o) * m + i) * m, f = (m) => ((u * m + l) * m + c) * m, d = (m) => (3 * r * m + 2 * o) * m + i;
279
- function h(m) {
280
- let p = m;
281
- for (let E = 0; E < 8; E++) {
282
- const v = a(p) - m;
283
- if (Math.abs(v) < 1e-7) return p;
284
- const w = d(p);
285
- if (Math.abs(w) < 1e-6) break;
286
- p -= v / w;
274
+ function he(e) {
275
+ return e ? Ue[e] || e : Ue.linear;
276
+ }
277
+ function An(e, t, n, s) {
278
+ const i = 3 * e, o = 3 * (n - e) - i, r = 1 - i - o, c = 3 * t, l = 3 * (s - t) - c, f = 1 - c - l, a = (p) => ((r * p + o) * p + i) * p, u = (p) => ((f * p + l) * p + c) * p, d = (p) => (3 * r * p + 2 * o) * p + i;
279
+ function h(p) {
280
+ let m = p;
281
+ for (let y = 0; y < 8; y++) {
282
+ const v = a(m) - p;
283
+ if (Math.abs(v) < 1e-7) return m;
284
+ const $ = d(m);
285
+ if (Math.abs($) < 1e-6) break;
286
+ m -= v / $;
287
287
  }
288
- let g = 0, y = 1;
289
- for (p = (g + y) / 2; y - g > 1e-7; ) {
290
- const E = a(p);
291
- if (Math.abs(E - m) < 1e-7) return p;
292
- m > E ? g = p : y = p, p = (g + y) / 2;
288
+ let g = 0, E = 1;
289
+ for (m = (g + E) / 2; E - g > 1e-7; ) {
290
+ const y = a(m);
291
+ if (Math.abs(y - p) < 1e-7) return m;
292
+ p > y ? g = m : E = m, m = (g + E) / 2;
293
293
  }
294
- return p;
294
+ return m;
295
295
  }
296
- return (m) => m <= 0 ? 0 : m >= 1 ? 1 : f(h(m));
296
+ return (p) => p <= 0 ? 0 : p >= 1 ? 1 : u(h(p));
297
297
  }
298
- function ft(e) {
298
+ function mt(e) {
299
299
  const t = e.match(
300
300
  /^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/
301
301
  );
@@ -304,17 +304,17 @@ function ft(e) {
304
304
  if (![n, s, i, o].some(isNaN))
305
305
  return [n, s, i, o];
306
306
  }
307
- function _n(e) {
308
- const t = ft(e);
307
+ function Mn(e) {
308
+ const t = mt(e);
309
309
  if (!(!t || t.some(isNaN)))
310
- return On(...t);
310
+ return An(...t);
311
311
  }
312
- function An(e) {
313
- const t = ft(e);
312
+ function kn(e) {
313
+ const t = mt(e);
314
314
  if (!(!t || t.some(isNaN)))
315
- return (n) => V(n, ...t);
315
+ return (n) => Y(n, ...t);
316
316
  }
317
- function dt(e) {
317
+ function pt(e) {
318
318
  const t = e.match(/^linear\((.+)\)$/);
319
319
  if (!t) return;
320
320
  const n = t[1].split(",").map((o) => o.trim()).filter(Boolean);
@@ -324,9 +324,9 @@ function dt(e) {
324
324
  const r = o.split(/\s+/), c = parseFloat(r[0]);
325
325
  if (isNaN(c)) return;
326
326
  const l = [];
327
- for (let u = 1; u < r.length; u++)
328
- if (r[u].endsWith("%")) {
329
- const a = parseFloat(r[u]) / 100;
327
+ for (let f = 1; f < r.length; f++)
328
+ if (r[f].endsWith("%")) {
329
+ const a = parseFloat(r[f]) / 100;
330
330
  if (isNaN(a)) return;
331
331
  l.push(a);
332
332
  }
@@ -340,9 +340,9 @@ function dt(e) {
340
340
  const o = i - 1;
341
341
  let r = i;
342
342
  for (; r < s.length && s[r].pos === null; ) r++;
343
- const c = s[o].pos, l = s[r].pos, u = r - o;
343
+ const c = s[o].pos, l = s[r].pos, f = r - o;
344
344
  for (let a = o + 1; a < r; a++)
345
- s[a].pos = c + (l - c) * (a - o) / u;
345
+ s[a].pos = c + (l - c) * (a - o) / f;
346
346
  i = r + 1;
347
347
  } else
348
348
  i++;
@@ -350,8 +350,8 @@ function dt(e) {
350
350
  s[o].pos < s[o - 1].pos && (s[o].pos = s[o - 1].pos);
351
351
  return s;
352
352
  }
353
- function Mn(e) {
354
- const t = dt(e);
353
+ function qn(e) {
354
+ const t = pt(e);
355
355
  if (t)
356
356
  return (n) => {
357
357
  if (n <= t[0].pos) return t[0].output;
@@ -366,8 +366,8 @@ function Mn(e) {
366
366
  return c.pos === r.pos ? c.output : r.output + (c.output - r.output) * (n - r.pos) / (c.pos - r.pos);
367
367
  };
368
368
  }
369
- function kn(e) {
370
- const t = dt(e);
369
+ function Pn(e) {
370
+ const t = pt(e);
371
371
  if (t)
372
372
  return (n) => {
373
373
  const s = [`${t[0].output}`];
@@ -383,17 +383,17 @@ function kn(e) {
383
383
  return `(${s.join(" + ")})`;
384
384
  };
385
385
  }
386
- function ht(e) {
386
+ function Ge(e) {
387
387
  if (!e) return;
388
- const t = We[e];
389
- return t || (_n(e) ?? Mn(e) ?? We.linear);
388
+ const t = Ye[e];
389
+ return t || (Mn(e) ?? qn(e) ?? Ye.linear);
390
390
  }
391
- function qn(e) {
391
+ function Ln(e) {
392
392
  if (!e) return;
393
- const t = Ve[e];
394
- return t || (An(e) ?? kn(e) ?? Ve.linear);
393
+ const t = Be[e];
394
+ return t || (kn(e) ?? Pn(e) ?? Be.linear);
395
395
  }
396
- class Pn extends ne {
396
+ class Fn extends se {
397
397
  animationGroups;
398
398
  delay;
399
399
  offset;
@@ -402,7 +402,7 @@ class Pn extends ne {
402
402
  timingOptions;
403
403
  constructor(t, n = {}) {
404
404
  const s = t.flatMap((i) => [...i.animations]);
405
- super(s), this.animationGroups = t, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.sequenceId = n.sequenceId, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : ht(n.offsetEasing) ?? ct, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: o, duration: r, iterations: c }) => ({
405
+ super(s), this.animationGroups = t, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.sequenceId = n.sequenceId, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : Ge(n.offsetEasing) ?? ut, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: o, duration: r, iterations: c }) => ({
406
406
  delay: o,
407
407
  duration: Number.isFinite(r) ? r : 0,
408
408
  iterations: Number.isFinite(c) ? c : 1
@@ -430,10 +430,10 @@ class Pn extends ne {
430
430
  i.animations.forEach((r, c) => {
431
431
  const l = r.effect;
432
432
  if (!l) return;
433
- const { delay: u, duration: a, iterations: f } = this.timingOptions[o][c], d = u + t[o], h = n - (d + a * f);
433
+ const { delay: f, duration: a, iterations: u } = this.timingOptions[o][c], d = f + t[o], h = n - (d + a * u);
434
434
  if (i.isCSS && this.sequenceId) {
435
- const { target: m } = l;
436
- m instanceof HTMLElement && (m.style.setProperty(`--motion-${this.sequenceId}-index`, `${o}`), m.style.setProperty(`--motion-${this.sequenceId}-last`, `${s}`)), l.updateTiming({ endDelay: h });
435
+ const { target: p } = l;
436
+ p instanceof HTMLElement && (p.style.setProperty(`--motion-${this.sequenceId}-index`, `${o}`), p.style.setProperty(`--motion-${this.sequenceId}-last`, `${s}`)), l.updateTiming({ endDelay: h });
437
437
  } else
438
438
  l.updateTiming({ delay: d + this.delay, endDelay: h });
439
439
  });
@@ -444,8 +444,8 @@ class Pn extends ne {
444
444
  for (let s = 0; s < this.timingOptions.length; s++) {
445
445
  const i = this.timingOptions[s].reduce((o, r) => {
446
446
  if (!r) return o;
447
- const { delay: c, duration: l, iterations: u } = r;
448
- return Math.max(o, c + l * u);
447
+ const { delay: c, duration: l, iterations: f } = r;
448
+ return Math.max(o, c + l * f);
449
449
  }, 0);
450
450
  n.push(t[s] + i);
451
451
  }
@@ -462,7 +462,7 @@ class Pn extends ne {
462
462
  for (const { index: s, group: i } of n) {
463
463
  const o = Math.min(s, this.animationGroups.length);
464
464
  this.animationGroups.splice(o, 0, i), this.timingOptions.splice(o, 0, i.getTimingOptions());
465
- const r = [...i.animations], c = this.animationGroups.slice(0, o).reduce((l, u) => l + u.animations.length, 0);
465
+ const r = [...i.animations], c = this.animationGroups.slice(0, o).reduce((l, f) => l + f.animations.length, 0);
466
466
  this.animations.splice(c, 0, ...r);
467
467
  }
468
468
  this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((s) => s.ready)).then(() => {
@@ -491,7 +491,7 @@ class Pn extends ne {
491
491
  }
492
492
  }
493
493
  }
494
- class Ln {
494
+ class Rn {
495
495
  _animation;
496
496
  customEffect;
497
497
  progress;
@@ -631,12 +631,12 @@ class Ln {
631
631
  return this._animation.dispatchEvent(t);
632
632
  }
633
633
  }
634
- function Fn(e) {
634
+ function xn(e) {
635
635
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
636
636
  }
637
- var he = { exports: {} }, Ye = he.exports, Be;
638
- function Rn() {
639
- return Be || (Be = 1, (function(e) {
637
+ var me = { exports: {} }, Qe = me.exports, Xe;
638
+ function Nn() {
639
+ return Xe || (Xe = 1, (function(e) {
640
640
  (function(t) {
641
641
  var n = function() {
642
642
  }, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(a) {
@@ -657,7 +657,7 @@ function Rn() {
657
657
  * @param {Array} tasks
658
658
  */
659
659
  runTasks: function(a) {
660
- for (var f; f = a.shift(); ) f();
660
+ for (var u; u = a.shift(); ) u();
661
661
  },
662
662
  /**
663
663
  * Adds a job to the read batch and
@@ -667,8 +667,8 @@ function Rn() {
667
667
  * @param {Object} ctx the context to be bound to `fn` (optional).
668
668
  * @public
669
669
  */
670
- measure: function(a, f) {
671
- var d = f ? a.bind(f) : a;
670
+ measure: function(a, u) {
671
+ var d = u ? a.bind(u) : a;
672
672
  return this.reads.push(d), o(this), d;
673
673
  },
674
674
  /**
@@ -680,8 +680,8 @@ function Rn() {
680
680
  * @param {Object} ctx the context to be bound to `fn` (optional).
681
681
  * @public
682
682
  */
683
- mutate: function(a, f) {
684
- var d = f ? a.bind(f) : a;
683
+ mutate: function(a, u) {
684
+ var d = u ? a.bind(u) : a;
685
685
  return this.writes.push(d), o(this), d;
686
686
  },
687
687
  /**
@@ -730,8 +730,8 @@ function Rn() {
730
730
  */
731
731
  extend: function(a) {
732
732
  if (typeof a != "object") throw new Error("expected object");
733
- var f = Object.create(this);
734
- return l(f, a), f.fastdom = this, f.initialize && f.initialize(), f;
733
+ var u = Object.create(this);
734
+ return l(u, a), u.fastdom = this, u.initialize && u.initialize(), u;
735
735
  },
736
736
  // override this with a function
737
737
  // to prevent Errors in console
@@ -742,75 +742,75 @@ function Rn() {
742
742
  a.scheduled || (a.scheduled = !0, a.raf(r.bind(null, a)));
743
743
  }
744
744
  function r(a) {
745
- var f = a.writes, d = a.reads, h;
745
+ var u = a.writes, d = a.reads, h;
746
746
  try {
747
- n("flushing reads", d.length), a.runTasks(d), n("flushing writes", f.length), a.runTasks(f);
748
- } catch (m) {
749
- h = m;
747
+ n("flushing reads", d.length), a.runTasks(d), n("flushing writes", u.length), a.runTasks(u);
748
+ } catch (p) {
749
+ h = p;
750
750
  }
751
- if (a.scheduled = !1, (d.length || f.length) && o(a), h)
751
+ if (a.scheduled = !1, (d.length || u.length) && o(a), h)
752
752
  if (n("task errored", h.message), a.catch) a.catch(h);
753
753
  else throw h;
754
754
  }
755
- function c(a, f) {
756
- var d = a.indexOf(f);
755
+ function c(a, u) {
756
+ var d = a.indexOf(u);
757
757
  return !!~d && !!a.splice(d, 1);
758
758
  }
759
- function l(a, f) {
760
- for (var d in f)
761
- f.hasOwnProperty(d) && (a[d] = f[d]);
759
+ function l(a, u) {
760
+ for (var d in u)
761
+ u.hasOwnProperty(d) && (a[d] = u[d]);
762
762
  }
763
- var u = t.fastdom = t.fastdom || new i();
764
- e.exports = u;
765
- })(typeof window < "u" ? window : typeof Ye < "u" ? Ye : globalThis);
766
- })(he)), he.exports;
767
- }
768
- var xn = Rn();
769
- const A = /* @__PURE__ */ Fn(xn), Me = {};
770
- function Nn(e) {
771
- Object.assign(Me, e);
772
- }
773
- function He(e, t = !0) {
774
- return e in Me ? Me[e] : (t && console.warn(
763
+ var f = t.fastdom = t.fastdom || new i();
764
+ e.exports = f;
765
+ })(typeof window < "u" ? window : typeof Qe < "u" ? Qe : globalThis);
766
+ })(me)), me.exports;
767
+ }
768
+ var jn = Nn();
769
+ const A = /* @__PURE__ */ xn(jn), ke = {};
770
+ function Dn(e) {
771
+ Object.assign(ke, e);
772
+ }
773
+ function We(e, t = !0) {
774
+ return e in ke ? ke[e] : (t && console.warn(
775
775
  `${e} not found in registry. Please make sure to import and register the preset.`
776
776
  ), null);
777
777
  }
778
- function Z(e, t) {
778
+ function K(e, t) {
779
779
  return e ? (t || document).getElementById(e) : null;
780
780
  }
781
- function mt(e, t) {
781
+ function gt(e, t) {
782
782
  return e?.matches(`[data-motion-part~="${t}"]`) ? e : e?.querySelector(`[data-motion-part~="${t}"]`);
783
783
  }
784
- function pt(e, t) {
785
- const n = typeof e == "string" ? Z(e) : e;
786
- return t?.length ? t.map((s) => mt(n, s)).filter(Boolean) : n ? [n] : [];
784
+ function vt(e, t) {
785
+ const n = typeof e == "string" ? K(e) : e;
786
+ return t?.length ? t.map((s) => gt(n, s)).filter(Boolean) : n ? [n] : [];
787
787
  }
788
- function jn(e) {
788
+ function zn(e) {
789
789
  const t = e.alternate ? "alternate" : "";
790
790
  return e.reversed ? `${t ? `${t}-` : ""}reverse` : t || "normal";
791
791
  }
792
- function Ce(e) {
793
- return `${e.value}${bn(e.unit)}`;
792
+ function Oe(e) {
793
+ return `${e.value}${In(e.unit)}`;
794
794
  }
795
- function Ue(e, t, n) {
796
- return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${Ce(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${Ce(e.offset)} + ${t})` : Ce(e.offset)}`;
795
+ function Ze(e, t, n) {
796
+ return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${Oe(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${Oe(e.offset)} + ${t})` : Oe(e.offset)}`;
797
797
  }
798
- function gt(e) {
798
+ function yt(e) {
799
799
  return {
800
- start: Ue(e.startOffset, e.startOffsetAdd),
801
- end: Ue(e.endOffset, e.endOffsetAdd, !0)
800
+ start: Ze(e.startOffset, e.startOffsetAdd),
801
+ end: Ze(e.endOffset, e.endOffsetAdd, !0)
802
802
  };
803
803
  }
804
- function vt(e) {
804
+ function Et(e) {
805
805
  return (t) => A.measure(() => t(e));
806
806
  }
807
- function yt(e) {
807
+ function wt(e) {
808
808
  return (t) => A.mutate(() => t(e));
809
809
  }
810
- function J(e) {
810
+ function ee(e) {
811
811
  if (e.namedEffect) {
812
812
  const t = e.namedEffect.type;
813
- return typeof t == "string" ? He(t) : null;
813
+ return typeof t == "string" ? We(t) : null;
814
814
  } else if (e.keyframeEffect) {
815
815
  const t = (s) => {
816
816
  const { name: i, keyframes: o } = s.keyframeEffect;
@@ -824,16 +824,16 @@ function J(e) {
824
824
  return (t) => [{ ...t, keyframes: [] }];
825
825
  return null;
826
826
  }
827
- function Et(e, t, n, s) {
827
+ function $t(e, t, n, s) {
828
828
  return e.map((i, o) => {
829
829
  const r = {
830
830
  fill: i.fill,
831
- easing: de(i.easing),
831
+ easing: he(i.easing),
832
832
  iterations: i.iterations === 0 ? 1 / 0 : i.iterations || 1,
833
833
  composite: i.composite,
834
- direction: jn(i)
834
+ direction: zn(i)
835
835
  };
836
- return De(t) ? (r.duration = i.duration, r.delay = i.delay || 0) : t?.trigger === "view-progress" && (s || window.ViewTimeline) ? r.duration = "auto" : (r.duration = 99.99, r.delay = 0.01), {
836
+ return Ve(t) ? (r.duration = i.duration, r.delay = i.delay || 0) : t?.trigger === "view-progress" && (s || window.ViewTimeline) ? r.duration = "auto" : (r.duration = 99.99, r.delay = 0.01), {
837
837
  // pass the preset's object as is - its keyframes and ranges may be getters
838
838
  // that must only be read after its measure() callbacks ran
839
839
  effect: i,
@@ -843,41 +843,41 @@ function Et(e, t, n, s) {
843
843
  };
844
844
  });
845
845
  }
846
- function De(e) {
846
+ function Ve(e) {
847
847
  return !e || e.trigger !== "pointer-move" && e.trigger !== "view-progress";
848
848
  }
849
- function Qe(e, t, n, s, i) {
849
+ function Je(e, t, n, s, i) {
850
850
  if (e) {
851
- if (De(s) && (t.duration = t.duration || 1, i?.reducedMotion))
851
+ if (Ve(s) && (t.duration = t.duration || 1, i?.reducedMotion))
852
852
  if (t.iterations === 1 || t.iterations == null)
853
853
  t = { ...t, duration: 1 };
854
854
  else
855
855
  return [];
856
856
  let o;
857
- return n instanceof HTMLElement && (o = { measure: vt(n), mutate: yt(n) }), e.web ? e.web(t, o, i) : e(t, o, i);
857
+ return n instanceof HTMLElement && (o = { measure: Et(n), mutate: wt(n) }), e.web ? e.web(t, o, i) : e(t, o, i);
858
858
  }
859
859
  return [];
860
860
  }
861
- function wt(e, t, n, s, i) {
862
- const o = typeof e == "string" ? Z(e, i) : e;
861
+ function bt(e, t, n, s, i) {
862
+ const o = typeof e == "string" ? K(e, i) : e;
863
863
  if (n?.trigger === "pointer-move" && !t.keyframeEffect) {
864
864
  let d = t;
865
865
  t.customEffect && (d = {
866
866
  ...t,
867
867
  namedEffect: { id: "", type: "CustomMouse" }
868
868
  });
869
- const h = J(
869
+ const h = ee(
870
870
  d
871
- ), m = Qe(
871
+ ), p = Je(
872
872
  h,
873
873
  t,
874
874
  o,
875
875
  n,
876
876
  s
877
877
  );
878
- return typeof m != "function" ? null : m(o);
878
+ return typeof p != "function" ? null : p(o);
879
879
  }
880
- const r = J(t), c = Qe(
880
+ const r = ee(t), c = Je(
881
881
  r,
882
882
  t,
883
883
  o,
@@ -886,33 +886,33 @@ function wt(e, t, n, s, i) {
886
886
  );
887
887
  if (!c || c.length === 0)
888
888
  return null;
889
- const l = Et(c, n, t.effectId);
890
- let u;
889
+ const l = $t(c, n, t.effectId);
890
+ let f;
891
891
  const a = n?.trigger === "view-progress";
892
- a && window.ViewTimeline && (u = new ViewTimeline({
893
- subject: n.element || Z(n.componentId)
892
+ a && window.ViewTimeline && (f = new ViewTimeline({
893
+ subject: n.element || K(n.componentId)
894
894
  }));
895
- const f = l.map(({ effect: d, options: h, id: m, part: p }) => {
896
- const g = p ? mt(o, p) : o, y = new KeyframeEffect(g || null, [], h);
895
+ const u = l.map(({ effect: d, options: h, id: p, part: m }) => {
896
+ const g = m ? gt(o, m) : o, E = new KeyframeEffect(g || null, [], h);
897
897
  A.mutate(() => {
898
- "timing" in d && y.updateTiming(d.timing), y.setKeyframes(ut(d.keyframes));
898
+ "timing" in d && E.updateTiming(d.timing), E.setKeyframes(ht(d.keyframes));
899
899
  });
900
- const E = a && u ? { timeline: u } : {}, v = typeof d.customEffect == "function" ? new Ln(
900
+ const y = a && f ? { timeline: f } : {}, v = typeof d.customEffect == "function" ? new Rn(
901
901
  d.customEffect,
902
902
  g || null,
903
903
  h,
904
- E
905
- ) : new Animation(y, E.timeline);
904
+ y
905
+ ) : new Animation(E, y.timeline);
906
906
  if (a)
907
- if (u)
907
+ if (f)
908
908
  A.mutate(() => {
909
- const { start: w, end: b } = gt(d);
910
- v.rangeStart = w, v.rangeEnd = b, v.play();
909
+ const { start: $, end: b } = yt(d);
910
+ v.rangeStart = $, v.rangeEnd = b, v.play();
911
911
  });
912
912
  else {
913
- const { startOffset: w, endOffset: b } = t;
913
+ const { startOffset: $, endOffset: b } = t;
914
914
  A.mutate(() => {
915
- const S = d.startOffset || w, I = d.endOffset || b;
915
+ const S = d.startOffset || $, I = d.endOffset || b;
916
916
  Object.assign(v, {
917
917
  start: {
918
918
  name: S.name,
@@ -927,149 +927,149 @@ function wt(e, t, n, s, i) {
927
927
  });
928
928
  });
929
929
  }
930
- return m && (v.id = m), v;
930
+ return p && (v.id = p), v;
931
931
  });
932
- return new ne(f, {
932
+ return u.length > 1 && u.forEach((d) => d.persist?.()), new se(u, {
933
933
  ...t,
934
934
  trigger: { ...n || {} },
935
935
  // make sure the group is ready after all animation targets are measured and mutated
936
936
  measured: new Promise((d) => A.mutate(d))
937
937
  });
938
938
  }
939
- function zn(e, t, n) {
940
- const { duration: s, delay: i, iterations: o = 1, fill: r, easing: c = "linear", direction: l } = e.options, u = e.effect.name, a = s === "auto", { sequenceId: f, delay: d, offset: h, offsetEasing: m = "linear" } = n || {};
941
- let p = `${i ?? 0}ms`;
942
- if (f && typeof m == "string") {
943
- const g = qn(m);
939
+ function Hn(e, t, n) {
940
+ const { duration: s, delay: i, iterations: o = 1, fill: r, easing: c = "linear", direction: l } = e.options, f = e.effect.name, a = s === "auto", { sequenceId: u, delay: d, offset: h, offsetEasing: p = "linear" } = n || {};
941
+ let m = `${i ?? 0}ms`;
942
+ if (u && typeof p == "string") {
943
+ const g = Ln(p);
944
944
  if (g) {
945
- const y = (i ?? 0) + (d ?? 0);
945
+ const E = (i ?? 0) + (d ?? 0);
946
946
  if (h) {
947
- const E = g(
948
- `(var(--motion-${f}-index, 0) / var(--motion-${f}-last, 1))`
947
+ const y = g(
948
+ `(var(--motion-${u}-index, 0) / var(--motion-${u}-last, 1))`
949
949
  );
950
- p = `calc(${`(${y} + ${E} * ${h} * var(--motion-${f}-last, 1))`} * 1ms)`;
950
+ m = `calc(${`(${E} + ${y} * ${h} * var(--motion-${u}-last, 1))`} * 1ms)`;
951
951
  } else
952
- p = `${y}ms`;
952
+ m = `${E}ms`;
953
953
  }
954
954
  }
955
- return `${u} ${a ? "auto" : `${s}ms`}${a ? " " : ` ${p} `}${c}${r && r !== "none" ? ` ${r}` : ""} ${!o || o === 1 / 0 ? "infinite" : o}${l === "normal" ? "" : ` ${l}`} ${t ? "" : "paused"}`;
955
+ return `${f} ${a ? "auto" : `${s}ms`}${a ? " " : ` ${m} `}${c}${r && r !== "none" ? ` ${r}` : ""} ${!o || o === 1 / 0 ? "infinite" : o}${l === "normal" ? "" : ` ${l}`} ${t ? "" : "paused"}`;
956
956
  }
957
- function Hn(e, t, n) {
958
- return e?.style ? (De(n) && (t.duration = t.duration || 1), e.style(t)) : [];
957
+ function Gn(e, t, n) {
958
+ return e?.style ? (Ve(n) && (t.duration = t.duration || 1), e.style(t)) : [];
959
959
  }
960
- function Dn(e, t, n, s) {
961
- const i = J(t), o = Hn(i, t), r = Et(o, n, t.effectId, !0), c = n?.trigger === "view-progress";
962
- return r.map((l, u) => {
963
- const { start: a, end: f } = c ? gt(l.effect) : {};
960
+ function Wn(e, t, n, s) {
961
+ const i = ee(t), o = Gn(i, t), r = $t(o, n, t.effectId, !0), c = n?.trigger === "view-progress";
962
+ return r.map((l, f) => {
963
+ const { start: a, end: u } = c ? yt(l.effect) : {};
964
964
  return {
965
965
  part: l.part,
966
- animation: zn(l, c, s),
966
+ animation: Hn(l, c, s),
967
967
  composition: l.options.composite,
968
968
  custom: l.effect.custom,
969
969
  name: l.effect.name,
970
- keyframes: ut(l.effect.keyframes),
971
- id: l.id && `${l.id}-${u + 1}`,
970
+ keyframes: ht(l.effect.keyframes),
971
+ id: l.id && `${l.id}-${f + 1}`,
972
972
  animationTimeline: c ? `--${n?.id}` : "",
973
- animationRange: a || f ? `${a} ${f}` : ""
973
+ animationRange: a || u ? `${a} ${u}` : ""
974
974
  };
975
975
  });
976
976
  }
977
- function Gn(e, t, n) {
978
- const s = J(t), i = e instanceof HTMLElement ? e : Z(e);
977
+ function Vn(e, t, n) {
978
+ const s = ee(t), i = e instanceof HTMLElement ? e : K(e);
979
979
  if (s && s.prepare && i) {
980
- const o = { measure: vt(i), mutate: yt(i) };
980
+ const o = { measure: Et(i), mutate: wt(i) };
981
981
  s.prepare(t, o);
982
982
  }
983
983
  n && A.mutate(n);
984
984
  }
985
- function $t(e, t) {
986
- const n = J(t);
985
+ function St(e, t) {
986
+ const n = ee(t);
987
987
  if (!n)
988
988
  return null;
989
989
  if (!n.style)
990
- return t.effectId && e ? Wn(e, t.effectId, n.parts) : null;
991
- const s = n.getNames(t), o = pt(e, n.parts)?.flatMap((l) => l.getAnimations()), r = o?.map((l) => l.animationName) || [], c = [];
990
+ return t.effectId && e ? Kn(e, t.effectId, n.parts) : null;
991
+ const s = n.getNames(t), o = vt(e, n.parts)?.flatMap((l) => l.getAnimations()), r = o?.map((l) => l.animationName) || [], c = [];
992
992
  return s.forEach((l) => {
993
993
  r.includes(l) && c.push(
994
- o?.find((u) => u.animationName === l)
994
+ o?.find((f) => f.animationName === l)
995
995
  );
996
- }), c?.length ? new ne(c) : null;
996
+ }), c?.length ? new se(c) : null;
997
997
  }
998
- function Wn(e, t, n) {
999
- const i = pt(e, n)?.flatMap((o) => o.getAnimations()).filter((o) => {
998
+ function Kn(e, t, n) {
999
+ const i = vt(e, n)?.flatMap((o) => o.getAnimations()).filter((o) => {
1000
1000
  const r = o.id || o.animationName;
1001
1001
  return r ? r.startsWith(t) : !0;
1002
1002
  });
1003
- return i?.length ? new ne(i) : null;
1003
+ return i?.length ? new se(i) : null;
1004
1004
  }
1005
- function bt(e, t, n, s = {}) {
1006
- const { disabled: i, allowActiveEvent: o, ...r } = s, c = wt(e, t, n, r);
1005
+ function It(e, t, n, s = {}) {
1006
+ const { disabled: i, allowActiveEvent: o, ...r } = s, c = bt(e, t, n, r);
1007
1007
  if (!c)
1008
1008
  return null;
1009
1009
  let l = {};
1010
1010
  if (n.trigger === "view-progress" && !window.ViewTimeline) {
1011
- const u = n.element || Z(n.componentId), { ready: a } = c;
1012
- return c.animations.map((f) => ({
1011
+ const f = n.element || K(n.componentId), { ready: a } = c;
1012
+ return c.animations.map((u) => ({
1013
1013
  /* we use getters for start and end in order to access the animation's start and end
1014
1014
  only when initializing the scrub scene rather than immediately */
1015
1015
  get start() {
1016
- return f.start;
1016
+ return u.start;
1017
1017
  },
1018
1018
  get end() {
1019
- return f.end;
1019
+ return u.end;
1020
1020
  },
1021
- viewSource: u,
1021
+ viewSource: f,
1022
1022
  ready: a,
1023
1023
  getProgress() {
1024
1024
  return c.getProgress();
1025
1025
  },
1026
1026
  effect(d, h) {
1027
- const { activeDuration: m } = f.effect.getComputedTiming(), { delay: p } = f.effect.getTiming();
1028
- f.currentTime = ((p || 0) + (m || 0)) * h;
1027
+ const { activeDuration: p } = u.effect.getComputedTiming(), { delay: m } = u.effect.getTiming();
1028
+ u.currentTime = ((m || 0) + (p || 0)) * h;
1029
1029
  },
1030
1030
  disabled: i,
1031
1031
  destroy() {
1032
- f.cancel();
1032
+ u.cancel();
1033
1033
  }
1034
1034
  }));
1035
1035
  } else if (n.trigger === "pointer-move") {
1036
- const u = t, { centeredToTarget: a, transitionDuration: f, transitionEasing: d } = u, h = n.axis;
1037
- if (u.keyframeEffect) {
1038
- const m = c;
1039
- return m.animations?.length === 0 ? null : {
1040
- target: void 0,
1036
+ const f = t, { centeredToTarget: a, transitionDuration: u, transitionEasing: d } = f, h = n.axis;
1037
+ if (f.keyframeEffect) {
1038
+ const p = c;
1039
+ return p.animations?.length === 0 ? null : {
1040
+ target: (typeof e == "string" ? K(e) : e) ?? void 0,
1041
1041
  centeredToTarget: a,
1042
- ready: m.ready,
1042
+ ready: p.ready,
1043
1043
  _currentProgress: 0,
1044
1044
  getProgress() {
1045
1045
  return this._currentProgress;
1046
1046
  },
1047
- effect(g, y) {
1048
- const E = h === "x" ? y.x : y.y;
1049
- this._currentProgress = E, m.progress(E);
1047
+ effect(g, E) {
1048
+ const y = h === "x" ? E.x : E.y;
1049
+ this._currentProgress = y, p.progress(y);
1050
1050
  },
1051
1051
  disabled: i ?? !1,
1052
1052
  destroy() {
1053
- m.cancel();
1053
+ p.cancel();
1054
1054
  }
1055
1055
  };
1056
1056
  }
1057
1057
  l = {
1058
1058
  centeredToTarget: a,
1059
1059
  allowActiveEvent: o
1060
- }, t.customEffect && f && (l.transitionDuration = f, l.transitionEasing = ht(d)), l.target = c.target;
1060
+ }, t.customEffect && u && (l.transitionDuration = u, l.transitionEasing = Ge(d)), l.target = c.target;
1061
1061
  }
1062
1062
  return {
1063
1063
  ...l,
1064
1064
  getProgress() {
1065
1065
  return c.getProgress();
1066
1066
  },
1067
- effect(u, a, f, d) {
1067
+ effect(f, a, u, d) {
1068
1068
  c.progress(
1069
- f ? {
1069
+ u ? {
1070
1070
  // @ts-expect-error spread error on p
1071
1071
  ...a,
1072
- v: f,
1072
+ v: u,
1073
1073
  active: d
1074
1074
  } : a
1075
1075
  );
@@ -1080,48 +1080,48 @@ function bt(e, t, n, s = {}) {
1080
1080
  }
1081
1081
  };
1082
1082
  }
1083
- function se(e, t, n, s = !1) {
1084
- const i = $t(e, t);
1083
+ function ie(e, t, n, s = !1) {
1084
+ const i = St(e, t);
1085
1085
  return i ? (i.ready = new Promise((o) => {
1086
- Gn(e, t, o);
1087
- }), i) : wt(e, t, n, { reducedMotion: s });
1086
+ Vn(e, t, o);
1087
+ }), i) : bt(e, t, n, { reducedMotion: s });
1088
1088
  }
1089
- function Vn(e) {
1089
+ function Yn(e) {
1090
1090
  return e === null ? [null] : typeof e == "string" ? Array.from(document.querySelectorAll(e)) : Array.isArray(e) ? e : [e];
1091
1091
  }
1092
- function St(e, t) {
1092
+ function Tt(e, t) {
1093
1093
  const n = [];
1094
1094
  for (const { target: s, options: i } of e) {
1095
- const o = Vn(s);
1095
+ const o = Yn(s);
1096
1096
  for (const r of o) {
1097
- const c = se(
1097
+ const c = ie(
1098
1098
  r,
1099
1099
  i,
1100
1100
  void 0,
1101
1101
  t?.reducedMotion
1102
1102
  );
1103
- c instanceof ne && n.push(c);
1103
+ c instanceof se && n.push(c);
1104
1104
  }
1105
1105
  }
1106
1106
  return n;
1107
1107
  }
1108
- function Kn(e, t, n) {
1109
- const s = St(t, n);
1110
- return new Pn(s, e);
1108
+ function Bn(e, t, n) {
1109
+ const s = Tt(t, n);
1110
+ return new Fn(s, e);
1111
1111
  }
1112
- function Yn(e, t = 2) {
1112
+ function Un(e, t = 2) {
1113
1113
  return parseFloat(e.toFixed(t));
1114
1114
  }
1115
- function Bn(e) {
1115
+ function Qn(e) {
1116
1116
  return /\[]/g.test(e);
1117
1117
  }
1118
- function Un(e) {
1118
+ function Xn(e) {
1119
1119
  return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
1120
1120
  }
1121
- function me(e, t) {
1121
+ function pe(e, t) {
1122
1122
  return t.includes("&") ? t.replace(/&/g, e) : `${e}${t}`;
1123
1123
  }
1124
- function ee() {
1124
+ function te() {
1125
1125
  return "wi-12343210".replace(
1126
1126
  /\d/g,
1127
1127
  (e) => String.fromCharCode(
@@ -1130,34 +1130,34 @@ function ee() {
1130
1130
  // 97 for "a"
1131
1131
  );
1132
1132
  }
1133
- function It(e) {
1133
+ function Ct(e) {
1134
1134
  const { transition: t, transitionProperties: n } = e;
1135
1135
  return (t?.styleProperties || n || []).map((i) => ({
1136
1136
  ...i,
1137
- name: ge(i.name)
1137
+ name: ve(i.name)
1138
1138
  }));
1139
1139
  }
1140
- function Tt(e) {
1140
+ function Ot(e) {
1141
1141
  let { transition: t, transitionProperties: n } = e, s = [];
1142
1142
  if (t?.styleProperties) {
1143
1143
  const { duration: i, easing: o, delay: r } = t;
1144
1144
  i && (t.styleProperties.some(
1145
1145
  (l) => l.name.startsWith("--")
1146
1146
  ) ? s = [
1147
- `all ${i}ms ${de(o || "ease")}${r ? ` ${r}ms` : ""}`,
1147
+ `all ${i}ms ${he(o || "ease")}${r ? ` ${r}ms` : ""}`,
1148
1148
  "visibility 0s"
1149
1149
  ] : s = t.styleProperties.map(
1150
- (l) => `${ge(l.name)} ${i}ms ${de(
1150
+ (l) => `${ve(l.name)} ${i}ms ${he(
1151
1151
  o || "ease"
1152
1152
  )}${r ? ` ${r}ms` : ""}`
1153
1153
  ));
1154
1154
  } else
1155
1155
  s = n?.filter((i) => i.duration).map(
1156
- (i) => `${ge(i.name)} ${i.duration}ms ${de(i.easing) || "ease"}${i.delay ? ` ${i.delay}ms` : ""}`
1156
+ (i) => `${ve(i.name)} ${i.duration}ms ${he(i.easing) || "ease"}${i.delay ? ` ${i.delay}ms` : ""}`
1157
1157
  ) || [];
1158
1158
  return s;
1159
1159
  }
1160
- function Qn({
1160
+ function Zn({
1161
1161
  key: e,
1162
1162
  effectId: t,
1163
1163
  transition: n,
@@ -1165,38 +1165,38 @@ function Qn({
1165
1165
  childSelector: i = "> :first-child",
1166
1166
  selectorCondition: o
1167
1167
  }) {
1168
- const r = Tt({
1168
+ const r = Ot({
1169
1169
  transition: n,
1170
1170
  transitionProperties: s
1171
- }), c = It({ transition: n, transitionProperties: s }).map(
1172
- (m) => `${m.name}: ${m.value};`
1173
- ), l = e.replace(/"/g, "'"), u = `:is(:state(${t}), :--${t}) ${i}`, a = `[data-interact-effect~="${t}"] ${i}`, f = o ? me(u, o) : u, d = o ? me(a, o) : a, h = [
1174
- `${f},
1171
+ }), c = Ct({ transition: n, transitionProperties: s }).map(
1172
+ (p) => `${p.name}: ${p.value};`
1173
+ ), l = e.replace(/"/g, "'"), f = `:is(:state(${t}), :--${t}) ${i}`, a = `[data-interact-effect~="${t}"] ${i}`, u = o ? pe(f, o) : f, d = o ? pe(a, o) : a, h = [
1174
+ `${u},
1175
1175
  ${d} {
1176
1176
  ${c.join(`
1177
1177
  `)}
1178
1178
  }`
1179
1179
  ];
1180
1180
  if (r.length) {
1181
- const m = `[data-interact-key="${l}"] ${i}`, p = o ? me(m, o) : m;
1182
- h.push(`@media (prefers-reduced-motion: no-preference) { ${p} {
1181
+ const p = `[data-interact-key="${l}"] ${i}`, m = o ? pe(p, o) : p;
1182
+ h.push(`@media (prefers-reduced-motion: no-preference) { ${m} {
1183
1183
  transition: ${r.join(", ")};
1184
1184
  } }`);
1185
1185
  }
1186
1186
  return h;
1187
1187
  }
1188
- function ie(e, t, n) {
1188
+ function oe(e, t, n) {
1189
1189
  const s = (e || []).filter((i) => t[i]?.type === n && t[i].predicate).map((i) => t[i].predicate).join(") and (");
1190
1190
  return s && `(${s})`;
1191
1191
  }
1192
- function F(e, t) {
1193
- const n = ie(e, t, "media");
1192
+ function P(e, t) {
1193
+ const n = oe(e, t, "media");
1194
1194
  return n && window.matchMedia(n);
1195
1195
  }
1196
1196
  function R(e, t) {
1197
1197
  return (e || []).filter((n) => t[n]?.type === "selector" && t[n].predicate).map((n) => `:is(${t[n].predicate})`).join("");
1198
1198
  }
1199
- const Ct = /* @__PURE__ */ new Map([
1199
+ const _t = /* @__PURE__ */ new Map([
1200
1200
  ["viewEnter", "once"],
1201
1201
  ["animationEnd", "once"],
1202
1202
  ["hover", "alternate"],
@@ -1204,78 +1204,93 @@ const Ct = /* @__PURE__ */ new Map([
1204
1204
  ["activate", "alternate"],
1205
1205
  ["interest", "alternate"]
1206
1206
  ]);
1207
- function Ot(e, t, n, s) {
1208
- const { effects: i = {}, conditions: o = {} } = n, { key: r, trigger: c } = t, l = c === "pointerMove";
1209
- e.effectId || (e.effectId = s || ee());
1210
- const { effectId: u } = e, a = { ...i[u] || {}, ...e };
1211
- let { key: f, conditions: d, triggerType: h } = a;
1212
- if (!f) {
1207
+ function At(e, t, n, s) {
1208
+ const { effects: i = {}, conditions: o = {} } = n, { key: r, trigger: c, conditions: l = [] } = t, f = c === "pointerMove";
1209
+ e.effectId || (e.effectId = s || te());
1210
+ const { effectId: a } = e, u = { ...i[a] || {}, ...e };
1211
+ let { key: d, conditions: h, triggerType: p } = u;
1212
+ if (!d) {
1213
1213
  if (!r)
1214
1214
  return null;
1215
- f = r;
1215
+ d = r;
1216
1216
  }
1217
- if (Bn(f))
1217
+ if (Qn(d))
1218
1218
  return null;
1219
- d = [
1220
- ...new Set((d || []).filter((b) => o[b]))
1221
- ], h || (h = Ct.get(c));
1222
- const { namedEffect: m, customEffect: p, keyframeEffect: g, transition: y, transitionProperties: E, ...v } = {
1223
- ...a,
1224
- key: f,
1225
- conditions: d,
1226
- effectId: u,
1227
- triggerType: h
1228
- }, w = Qt(t, v);
1229
- if (m)
1230
- return l || !m.type ? null : { namedEffect: m, initial: w, ...v };
1231
- if (g) {
1232
- if (!g.name) {
1233
- const b = u && !(i[u] && "keyframeEffect" in e);
1234
- g.name = b ? u : ee();
1219
+ const m = l.filter(
1220
+ (I) => o[I].type === "media"
1221
+ );
1222
+ h = [
1223
+ ...new Set(
1224
+ [...h || [], ...m].filter(
1225
+ (I) => o[I]
1226
+ )
1227
+ )
1228
+ ], p || (p = _t.get(c));
1229
+ const { namedEffect: g, customEffect: E, keyframeEffect: y, transition: v, transitionProperties: $, ...b } = {
1230
+ ...u,
1231
+ key: d,
1232
+ conditions: h,
1233
+ effectId: a,
1234
+ triggerType: p
1235
+ }, S = Zt(t, b);
1236
+ if (g)
1237
+ return f || !g.type ? null : { namedEffect: g, initial: S, ...b };
1238
+ if (y) {
1239
+ if (!y.name) {
1240
+ const I = a && !(i[a] && "keyframeEffect" in e);
1241
+ y.name = I ? a : te();
1235
1242
  }
1236
- return { keyframeEffect: g, initial: w, ...v };
1237
- } else return p ? l ? null : { initial: w, ...v } : y ? { transition: y, initial: w, ...v } : E ? { transitionProperties: E, initial: w, ...v } : { initial: w, ...v };
1243
+ return { keyframeEffect: y, initial: S, ...b };
1244
+ } else return E ? f ? null : { initial: S, ...b } : v ? { transition: v, initial: S, ...b } : $ ? { transitionProperties: $, initial: S, ...b } : { initial: S, ...b };
1238
1245
  }
1239
- function Xn(e, t, n, s, i) {
1240
- const { sequences: o = {}, conditions: r = {} } = n;
1241
- e.sequenceId || (e.sequenceId = s || ee());
1242
- const { sequenceId: c } = e, l = { ...o[c] || {}, ...e };
1246
+ function Jn(e, t, n, s, i) {
1247
+ const { sequences: o = {}, conditions: r = {} } = n, { trigger: c, conditions: l = [] } = t;
1248
+ e.sequenceId || (e.sequenceId = s || te());
1249
+ const { sequenceId: f } = e, a = { ...o[f] || {}, ...e };
1243
1250
  let {
1244
1251
  effects: u,
1245
- conditions: a,
1246
- triggerType: f,
1247
- delay: d = 0,
1248
- offset: h = 0,
1249
- offsetEasing: m = "linear"
1250
- } = l;
1251
- if (typeof m == "function" || !u)
1252
+ conditions: d,
1253
+ triggerType: h,
1254
+ delay: p = 0,
1255
+ offset: m = 0,
1256
+ offsetEasing: g = "linear"
1257
+ } = a;
1258
+ if (typeof g == "function" || !u)
1252
1259
  return null;
1253
- f || (f = Ct.get(t.trigger)), a = [
1254
- ...new Set((a || []).filter((y) => r[y]))
1260
+ h || (h = _t.get(c));
1261
+ const E = l.filter(
1262
+ ($) => r[$].type === "media"
1263
+ );
1264
+ d = [
1265
+ ...new Set(
1266
+ [...d || [], ...E].filter(
1267
+ ($) => r[$]
1268
+ )
1269
+ )
1255
1270
  ];
1256
- const g = u.map((y, E) => {
1257
- const v = Ot(
1258
- { ...y, triggerType: f, conditions: [...y.conditions || [], ...a] },
1271
+ const v = u.map(($, b) => {
1272
+ const S = At(
1273
+ { ...$, triggerType: h, conditions: [...$.conditions || [], ...d] },
1259
1274
  t,
1260
1275
  n,
1261
- `${c}-eff-${E}`
1276
+ `${f}-eff-${b}`
1262
1277
  );
1263
- return v && Object.assign(v, { slotKey: i?.(E) });
1264
- }).filter((y) => y !== null);
1265
- return g.length ? {
1266
- sequenceId: c,
1267
- triggerType: f,
1268
- conditions: a,
1269
- delay: d,
1270
- offset: h,
1271
- offsetEasing: m,
1272
- effects: g
1278
+ return S && Object.assign(S, { slotKey: i?.(b) });
1279
+ }).filter(($) => $ !== null);
1280
+ return v.length ? {
1281
+ sequenceId: f,
1282
+ triggerType: h,
1283
+ conditions: d,
1284
+ delay: p,
1285
+ offset: m,
1286
+ offsetEasing: g,
1287
+ effects: v
1273
1288
  } : null;
1274
1289
  }
1275
- function Zn(e) {
1276
- return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" : ge(e);
1290
+ function es(e) {
1291
+ return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" : ve(e);
1277
1292
  }
1278
- function Jn(e) {
1293
+ function ts(e) {
1279
1294
  if (!e.length)
1280
1295
  return [];
1281
1296
  const t = e.map((i) => ({ ...i }));
@@ -1297,58 +1312,58 @@ function Jn(e) {
1297
1312
  }
1298
1313
  return t;
1299
1314
  }
1300
- function es(e, t) {
1301
- const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${Zn(s)}: ${i};`).join(`
1315
+ function ns(e, t) {
1316
+ const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${es(s)}: ${i};`).join(`
1302
1317
  `);
1303
1318
  return `${t}% {
1304
1319
  ${n}
1305
1320
  }`;
1306
1321
  }
1307
- function ts(e, t) {
1308
- const n = Jn(t);
1322
+ function ss(e, t) {
1323
+ const n = ts(t);
1309
1324
  if (!n.length)
1310
1325
  return "";
1311
1326
  let s = n.map((i) => {
1312
- const o = i.offset, r = Yn(o * 100);
1313
- return es(i, r);
1327
+ const o = i.offset, r = Un(o * 100);
1328
+ return ns(i, r);
1314
1329
  }).join(`
1315
1330
  `);
1316
1331
  return `@keyframes ${e} {
1317
1332
  ${s}
1318
1333
  }`;
1319
1334
  }
1320
- function ns(e) {
1335
+ function is(e) {
1321
1336
  const { key: t, childSelector: n, declarations: s, media: i, states: o, selectorCondition: r, selectorSuffix: c } = e;
1322
1337
  if (!s.length)
1323
1338
  return "";
1324
1339
  let l = `[data-interact-key="${t}"]`;
1325
1340
  if (o && o.length) {
1326
- const f = o.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
1327
- l = `${l}:is(${f})`;
1341
+ const u = o.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
1342
+ l = `${l}:is(${u})`;
1328
1343
  }
1329
- n && (l = `${l} ${n}`), c && (l = `${l}${c}`), r && (l = me(l, r));
1330
- const u = s.map(({ name: f, value: d, important: h }) => `${f}: ${d}${h ? " !important" : ""};`).join(`
1344
+ n && (l = `${l} ${n}`), c && (l = `${l}${c}`), r && (l = pe(l, r));
1345
+ const f = s.map(({ name: u, value: d, important: h }) => `${u}: ${d}${h ? " !important" : ""};`).join(`
1331
1346
  `), a = `${l} {
1332
- ${u}
1347
+ ${f}
1333
1348
  }`;
1334
1349
  return i ? `@media ${i} {
1335
1350
  ${a}
1336
1351
  }` : a;
1337
1352
  }
1338
- const ke = [
1353
+ const qe = [
1339
1354
  "animation",
1340
1355
  "animation-composition",
1341
1356
  "animation-timeline",
1342
1357
  "animation-range"
1343
- ], be = [
1344
- ...ke,
1358
+ ], Se = [
1359
+ ...qe,
1345
1360
  "transition",
1346
1361
  "view-timeline"
1347
- ], Ge = ["animation", "transition", "timeline"];
1348
- function L(e) {
1362
+ ], Ke = ["animation", "transition", "timeline"];
1363
+ function F(e) {
1349
1364
  return e === "transition" ? "transition" : e === "view-timeline" ? "timeline" : "animation";
1350
1365
  }
1351
- const K = {
1366
+ const B = {
1352
1367
  transition: "_",
1353
1368
  animation: "none",
1354
1369
  "animation-composition": "replace",
@@ -1356,23 +1371,23 @@ const K = {
1356
1371
  "animation-range": "normal",
1357
1372
  "view-timeline": "none"
1358
1373
  };
1359
- function _t(e) {
1374
+ function Mt(e) {
1360
1375
  return e.replace(new RegExp("(?<!(^|-))([aeiou]|tion)", "g"), "");
1361
1376
  }
1362
1377
  function j(e, t, n = !1, s) {
1363
1378
  const i = s === void 0 ? "" : `-c${s}`;
1364
- return `--${_t(e)}${i}${n ? "-slot" : ""}-${t}`;
1379
+ return `--${Mt(e)}${i}${n ? "-slot" : ""}-${t}`;
1365
1380
  }
1366
- function te(e, t) {
1367
- return `--${_t(e)}-c${t}`;
1381
+ function ne(e, t) {
1382
+ return `--${Mt(e)}-c${t}`;
1368
1383
  }
1369
- function ss(e, t) {
1384
+ function os(e, t) {
1370
1385
  return Array.from(
1371
1386
  { length: t + 1 },
1372
- (n, s) => `var(${te(e, s)})`
1387
+ (n, s) => `var(${ne(e, s)})`
1373
1388
  ).join(", ");
1374
1389
  }
1375
- function is(e, t, n, s, i = 0, o) {
1390
+ function rs(e, t, n, s, i = 0, o) {
1376
1391
  const r = {
1377
1392
  animation: e,
1378
1393
  transition: t,
@@ -1381,70 +1396,70 @@ function is(e, t, n, s, i = 0, o) {
1381
1396
  animation: n,
1382
1397
  transition: s,
1383
1398
  timeline: 0
1384
- }, l = (u, a) => `@property ${a} { syntax: "*"; inherits: false; initial-value: ${K[u]}; }`;
1385
- return be.flatMap((u) => [
1399
+ }, l = (f, a) => `@property ${a} { syntax: "*"; inherits: false; initial-value: ${B[f]}; }`;
1400
+ return Se.flatMap((f) => [
1386
1401
  ...Array.from(
1387
- { length: r[L(u)] },
1388
- (a, f) => l(u, j(u, f, !1, o))
1402
+ { length: r[F(f)] },
1403
+ (a, u) => l(f, j(f, u, !1, o))
1389
1404
  ),
1390
1405
  ...Array.from(
1391
- { length: c[L(u)] },
1392
- (a, f) => l(u, j(u, f, !0, o))
1406
+ { length: c[F(f)] },
1407
+ (a, u) => l(f, j(f, u, !0, o))
1393
1408
  ),
1394
1409
  // registers the lists of the configs before it too, for elements they don't target
1395
1410
  ...Array.from(
1396
- { length: o !== void 0 && r[L(u)] ? o + 1 : 0 },
1397
- (a, f) => l(u, te(u, f))
1411
+ { length: o !== void 0 && r[F(f)] ? o + 1 : 0 },
1412
+ (a, u) => l(f, ne(f, u))
1398
1413
  )
1399
1414
  ]);
1400
1415
  }
1401
- function os(e, t, n, s) {
1402
- const i = be.filter(
1403
- (c) => e[L(c)].slotsInSequence > 0
1416
+ function as(e, t, n, s) {
1417
+ const i = Se.filter(
1418
+ (c) => e[F(c)].slotsInSequence > 0
1404
1419
  );
1405
1420
  if (i.length === 0)
1406
1421
  return null;
1407
1422
  const o = i.map((c) => {
1408
- const { listIndex: l, slotCursor: u, slotsInSequence: a } = e[L(c)];
1423
+ const { listIndex: l, slotCursor: f, slotsInSequence: a } = e[F(c)];
1409
1424
  return {
1410
1425
  name: j(c, l, !1, s),
1411
1426
  value: Array.from(
1412
1427
  { length: a },
1413
- (f, d) => `var(${j(c, u + d, !0, s)})`
1428
+ (u, d) => `var(${j(c, f + d, !0, s)})`
1414
1429
  ).join(", ")
1415
1430
  };
1416
1431
  }), r = { key: e.key, childSelector: e.childSelector, declarations: o };
1417
- return t && (r.media = ie(t, n || {}, "media"), r.selectorCondition = R(t, n || {})), r;
1432
+ return t && (r.media = oe(t, n || {}, "media"), r.selectorCondition = R(t, n || {})), r;
1418
1433
  }
1419
- function rs(e, t, n, s = 0, i) {
1434
+ function cs(e, t, n, s = 0, i) {
1420
1435
  if (e.length === 0)
1421
1436
  return "";
1422
1437
  const o = {
1423
1438
  animation: t,
1424
1439
  transition: n,
1425
1440
  timeline: s
1426
- }, r = be.filter((u) => o[L(u)] > 0);
1441
+ }, r = Se.filter((f) => o[F(f)] > 0);
1427
1442
  if (r.length === 0)
1428
1443
  return "";
1429
- const c = r.flatMap((u) => {
1444
+ const c = r.flatMap((f) => {
1430
1445
  const a = Array.from(
1431
- { length: o[L(u)] },
1446
+ { length: o[F(f)] },
1432
1447
  // TODO: maybe add `-intrct` to names? --anm-0 or --trns-0 could collide with user-defined names
1433
- (f, d) => `var(${j(u, d, !1, i)})`
1448
+ (u, d) => `var(${j(f, d, !1, i)})`
1434
1449
  ).join(", ");
1435
- return i === void 0 ? [{ name: u, value: a }] : [
1436
- { name: te(u, i), value: a },
1437
- { name: u, value: ss(u, i) }
1450
+ return i === void 0 ? [{ name: f, value: a }] : [
1451
+ { name: ne(f, i), value: a },
1452
+ { name: f, value: os(f, i) }
1438
1453
  ];
1439
1454
  });
1440
1455
  return `${e.map(
1441
- ({ key: u, childSelector: a }) => `[data-interact-key="${u}"]${a ? ` ${a}` : ""}`
1456
+ ({ key: f, childSelector: a }) => `[data-interact-key="${f}"]${a ? ` ${a}` : ""}`
1442
1457
  ).join(", ")} {
1443
- ${c.map(({ name: u, value: a }) => ` ${u}: ${a};`).join(`
1458
+ ${c.map(({ name: f, value: a }) => ` ${f}: ${a};`).join(`
1444
1459
  `)}
1445
1460
  }`;
1446
1461
  }
1447
- function as(e, t) {
1462
+ function ls(e, t) {
1448
1463
  if (e.length === 0)
1449
1464
  return "";
1450
1465
  if (t === void 0)
@@ -1453,24 +1468,24 @@ function as(e, t) {
1453
1468
  }`;
1454
1469
  const n = Array.from(
1455
1470
  { length: t + 1 },
1456
- (s, i) => `var(${te("timeline-scope", i)}, --_)`
1471
+ (s, i) => `var(${ne("timeline-scope", i)}, --_)`
1457
1472
  ).join(", ");
1458
1473
  return `:root {
1459
- ${te("timeline-scope", t)}: ${e.join(", ")};
1474
+ ${ne("timeline-scope", t)}: ${e.join(", ")};
1460
1475
  timeline-scope: ${n};
1461
1476
  }`;
1462
1477
  }
1463
- const ae = {
1478
+ const ce = {
1464
1479
  rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
1465
1480
  rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
1466
1481
  };
1467
- function cs(e, t) {
1468
- const n = e?.name ?? ae.rangeStart.name, s = t?.name ?? e?.name ?? ae.rangeEnd.name, i = {
1482
+ function fs(e, t) {
1483
+ const n = e?.name ?? ce.rangeStart.name, s = t?.name ?? e?.name ?? ce.rangeEnd.name, i = {
1469
1484
  name: n,
1470
- offset: e?.offset || ae.rangeStart.offset
1485
+ offset: e?.offset || ce.rangeStart.offset
1471
1486
  }, o = {
1472
1487
  name: s,
1473
- offset: t?.offset || ae.rangeEnd.offset
1488
+ offset: t?.offset || ce.rangeEnd.offset
1474
1489
  };
1475
1490
  return { startOffset: i, endOffset: o };
1476
1491
  }
@@ -1480,7 +1495,7 @@ function x(e) {
1480
1495
  id: "",
1481
1496
  ...e
1482
1497
  };
1483
- const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } = cs(t, n);
1498
+ const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } = fs(t, n);
1484
1499
  return {
1485
1500
  id: "",
1486
1501
  startOffset: i,
@@ -1488,11 +1503,11 @@ function x(e) {
1488
1503
  ...s
1489
1504
  };
1490
1505
  }
1491
- function k(e, t, n) {
1506
+ function q(e, t, n) {
1492
1507
  let s = e.get(t);
1493
1508
  s || (s = /* @__PURE__ */ new Set(), e.set(t, s)), s.add(n);
1494
1509
  }
1495
- function oe(e, t) {
1510
+ function re(e, t) {
1496
1511
  e.get(t)?.forEach((s) => {
1497
1512
  const { source: i, target: o, cleanup: r } = s;
1498
1513
  r();
@@ -1500,15 +1515,15 @@ function oe(e, t) {
1500
1515
  e.get(c)?.delete(s);
1501
1516
  }), e.delete(t);
1502
1517
  }
1503
- const ls = [
1518
+ const us = [
1504
1519
  { name: "visibility", value: "hidden" },
1505
1520
  { name: "clip-path", value: "none", important: !0 },
1506
1521
  { name: "transform", value: "none", important: !0 },
1507
1522
  { name: "translate", value: "none", important: !0 },
1508
1523
  { name: "scale", value: "none", important: !0 },
1509
1524
  { name: "rotate", value: "none", important: !0 }
1510
- ], qe = { animation: !1, transition: !1, timeline: !1 };
1511
- function At(e, t) {
1525
+ ], Pe = { animation: !1, transition: !1, timeline: !1 };
1526
+ function kt(e, t) {
1512
1527
  const n = () => ({
1513
1528
  listIndex: 0,
1514
1529
  slotCursor: 0,
@@ -1527,10 +1542,10 @@ function At(e, t) {
1527
1542
  keyframeEntries: /* @__PURE__ */ new Map()
1528
1543
  };
1529
1544
  }
1530
- function Mt(e, t, n) {
1545
+ function qt(e, t, n) {
1531
1546
  return Object.fromEntries(
1532
- be.map((s) => {
1533
- const i = L(s), { listIndex: o, slotCursor: r, slotsInSequence: c } = e[i];
1547
+ Se.map((s) => {
1548
+ const i = F(s), { listIndex: o, slotCursor: r, slotsInSequence: c } = e[i];
1534
1549
  return [
1535
1550
  s,
1536
1551
  t[i] ? j(s, r + c, !0, n) : j(s, o, !1, n)
@@ -1538,22 +1553,22 @@ function Mt(e, t, n) {
1538
1553
  })
1539
1554
  );
1540
1555
  }
1541
- function Pe(e, t, n) {
1542
- Ge.forEach((s) => {
1556
+ function Le(e, t, n) {
1557
+ Ke.forEach((s) => {
1543
1558
  t[s] && (e[s].touched = !0, n[s] && (e[s].slotsInSequence += 1));
1544
1559
  });
1545
1560
  }
1546
- function kt(e) {
1561
+ function Pt(e) {
1547
1562
  const { namedEffect: t, keyframeEffect: n, transition: s, transitionProperties: i } = e;
1548
1563
  return t || n ? "animation" : s || i ? "transition" : null;
1549
1564
  }
1550
- function us(e) {
1565
+ function ds(e) {
1551
1566
  const t = /* @__PURE__ */ new Map();
1552
1567
  return e.effects.forEach((n) => {
1553
- const s = kt(n);
1568
+ const s = Pt(n);
1554
1569
  if (!s)
1555
1570
  return;
1556
- const i = W(n), o = t.get(i) || { animation: 0, transition: 0, timeline: 0 };
1571
+ const i = V(n), o = t.get(i) || { animation: 0, transition: 0, timeline: 0 };
1557
1572
  o[s] += 1, t.set(i, o);
1558
1573
  }), new Map(
1559
1574
  [...t].map(([n, { animation: s, transition: i }]) => [
@@ -1562,47 +1577,47 @@ function us(e) {
1562
1577
  ])
1563
1578
  );
1564
1579
  }
1565
- function fs(e) {
1566
- Ge.forEach((t) => {
1580
+ function hs(e) {
1581
+ Ke.forEach((t) => {
1567
1582
  const n = e[t];
1568
1583
  n.slotsInInteraction = Math.max(n.slotsInInteraction, n.slotsInSequence), n.slotsInSequence = 0;
1569
1584
  });
1570
1585
  }
1571
- function ds(e) {
1572
- Ge.forEach((t) => {
1586
+ function ms(e) {
1587
+ Ke.forEach((t) => {
1573
1588
  const n = e[t];
1574
1589
  n.listIndex += n.touched ? 1 : 0, n.slotCursor += n.slotsInInteraction, n.slotsInInteraction = 0, n.touched = !1;
1575
1590
  });
1576
1591
  }
1577
- const hs = {
1592
+ const ps = {
1578
1593
  animation: "animation",
1579
1594
  "animation-composition": "composition",
1580
1595
  "animation-timeline": "animationTimeline",
1581
1596
  "animation-range": "animationRange"
1582
1597
  };
1583
- function ms(e, t, n, s) {
1584
- const { key: i, conditions: o } = t, r = ie(o, e.configConditions, "media"), c = R(o, e.configConditions), l = G(t, {
1598
+ function gs(e, t, n, s) {
1599
+ const { key: i, conditions: o } = t, r = oe(o, e.configConditions, "media"), c = R(o, e.configConditions), l = W(t, {
1585
1600
  asCombinator: !0,
1586
1601
  useFirstChild: e.useFirstChild,
1587
1602
  addItemFilter: !0
1588
- }), u = W(t), a = e.targetsMap.get(u) || At(i, l), f = Mt(a, qe, e.configIndex)["view-timeline"];
1589
- return Pe(a, { animation: !1, transition: !1, timeline: !0 }, qe), e.targetsMap.set(u, a), s.add(u), {
1603
+ }), f = V(t), a = e.targetsMap.get(f) || kt(i, l), u = qt(a, Pe, e.configIndex)["view-timeline"];
1604
+ return Le(a, { animation: !1, transition: !1, timeline: !0 }, Pe), e.targetsMap.set(f, a), s.add(f), {
1590
1605
  key: i,
1591
1606
  media: r,
1592
1607
  selectorCondition: c,
1593
1608
  childSelector: l,
1594
1609
  declarations: [
1595
1610
  {
1596
- name: f,
1611
+ name: u,
1597
1612
  value: `--${n}`
1598
1613
  }
1599
1614
  ]
1600
1615
  };
1601
1616
  }
1602
- function qt(e, t, n, s, i) {
1617
+ function Lt(e, t, n, s, i) {
1603
1618
  const o = [];
1604
1619
  for (const r of Object.keys(i)) {
1605
- const c = `${at}${r}`;
1620
+ const c = `${He}${r}`;
1606
1621
  c in t && o.push(
1607
1622
  ...i[r](t[c], {
1608
1623
  key: n,
@@ -1613,29 +1628,29 @@ function qt(e, t, n, s, i) {
1613
1628
  }
1614
1629
  return o;
1615
1630
  }
1616
- function ps(e, t, n, s, i, o) {
1617
- const { assigned: r, childSelector: c, partSelectors: l } = n, u = { animation: !1, transition: !1, timeline: !1 }, {
1631
+ function vs(e, t, n, s, i, o) {
1632
+ const { assigned: r, childSelector: c, partSelectors: l } = n, f = { animation: !1, transition: !1, timeline: !1 }, {
1618
1633
  key: a,
1619
- effectId: f,
1634
+ effectId: u,
1620
1635
  conditions: d,
1621
1636
  namedEffect: h,
1622
- keyframeEffect: m,
1623
- transition: p,
1637
+ keyframeEffect: p,
1638
+ transition: m,
1624
1639
  transitionProperties: g,
1625
- initial: y
1626
- } = t, E = ie(d, e.configConditions, "media"), v = R(d, e.configConditions), w = [
1640
+ initial: E
1641
+ } = t, y = oe(d, e.configConditions, "media"), v = R(d, e.configConditions), $ = [
1627
1642
  {
1628
1643
  key: a,
1629
- media: E,
1644
+ media: y,
1630
1645
  selectorCondition: v,
1631
1646
  childSelector: c,
1632
1647
  declarations: []
1633
1648
  }
1634
1649
  ];
1635
1650
  let b = [];
1636
- const { declarations: S } = w[0];
1637
- if (e.plugins && w.push(...qt("effect", t, a, E, e.plugins)), h || m) {
1638
- const I = x(t), O = Dn(null, I, s, o).filter(
1651
+ const { declarations: S } = $[0];
1652
+ if (e.plugins && $.push(...Lt("effect", t, a, y, e.plugins)), h || p) {
1653
+ const I = x(t), O = Wn(null, I, s, o).filter(
1639
1654
  (T) => T.name
1640
1655
  ), M = O.length ? {} : { "": [] };
1641
1656
  O.forEach((T) => {
@@ -1649,66 +1664,66 @@ function ps(e, t, n, s, i, o) {
1649
1664
  ({ custom: T }) => Object.entries(T || {}).filter(([C, _]) => _ !== void 0).map(([C, _]) => ({ name: C, value: _ }))
1650
1665
  )
1651
1666
  ), Object.entries(M).forEach(([T, C]) => {
1652
- const _ = ke.map((P) => ({
1653
- _listPropertyName: P,
1654
- name: i[P],
1655
- value: C.map((Ie) => {
1656
- const Te = hs[P];
1657
- return Ie[Te] || K[P];
1667
+ const _ = qe.map((L) => ({
1668
+ _listPropertyName: L,
1669
+ name: i[L],
1670
+ value: C.map((Te) => {
1671
+ const Ce = ps[L];
1672
+ return Te[Ce] || B[L];
1658
1673
  }).join(", ")
1659
1674
  })).filter(
1660
- ({ _listPropertyName: P, name: Ie, value: Te }) => Te !== K[P] || r.has(Ie)
1675
+ ({ _listPropertyName: L, name: Te, value: Ce }) => Ce !== B[L] || r.has(Te)
1661
1676
  );
1662
- _.forEach(({ name: P }) => r.add(P)), u.animation = u.animation || _.length > 0;
1663
- const re = T ? `[data-motion-part~="${T}"]` : c;
1664
- T && _.length && l.add(re), y ? (w.push({
1677
+ _.forEach(({ name: L }) => r.add(L)), f.animation = f.animation || _.length > 0;
1678
+ const ae = T ? `[data-motion-part~="${T}"]` : c;
1679
+ T && _.length && l.add(ae), E ? ($.push({
1665
1680
  key: a,
1666
- media: E,
1681
+ media: y,
1667
1682
  selectorCondition: v,
1668
- childSelector: re,
1669
- declarations: ls,
1683
+ childSelector: ae,
1684
+ declarations: us,
1670
1685
  selectorSuffix: ":not([data-interact-enter])"
1671
- }), w.push({
1686
+ }), $.push({
1672
1687
  key: a,
1673
- media: E,
1688
+ media: y,
1674
1689
  selectorCondition: v,
1675
- childSelector: re,
1690
+ childSelector: ae,
1676
1691
  declarations: _,
1677
1692
  selectorSuffix: ':not([data-interact-enter="done"])'
1678
- })) : T ? w.push({
1693
+ })) : T ? $.push({
1679
1694
  key: a,
1680
- media: E,
1695
+ media: y,
1681
1696
  selectorCondition: v,
1682
- childSelector: re,
1697
+ childSelector: ae,
1683
1698
  declarations: _
1684
1699
  }) : S.push(..._);
1685
1700
  });
1686
- } else if (p || g) {
1687
- const I = It(t), O = Tt(t);
1701
+ } else if (m || g) {
1702
+ const I = Ct(t), O = Ot(t);
1688
1703
  (O.length || r.has(i.transition)) && (S.push({
1689
1704
  name: i.transition,
1690
- value: O.join(", ") || K.transition
1691
- }), r.add(i.transition), u.transition = !0), w.push({
1705
+ value: O.join(", ") || B.transition
1706
+ }), r.add(i.transition), f.transition = !0), $.push({
1692
1707
  key: a,
1693
- media: E,
1708
+ media: y,
1694
1709
  selectorCondition: v,
1695
1710
  childSelector: c,
1696
- states: [f],
1711
+ states: [u],
1697
1712
  declarations: I
1698
1713
  });
1699
1714
  } else
1700
1715
  S.push(
1701
- ...ke.filter(
1716
+ ...qe.filter(
1702
1717
  (I) => r.has(i[I])
1703
1718
  ).map((I) => ({
1704
1719
  name: i[I],
1705
- value: K[I]
1720
+ value: B[I]
1706
1721
  }))
1707
1722
  );
1708
- return { rules: w.filter((I) => I.declarations.length), keyframes: b, wrote: u };
1723
+ return { rules: $.filter((I) => I.declarations.length), keyframes: b, wrote: f };
1709
1724
  }
1710
- function gs(e, t, n) {
1711
- const s = t.namedEffect && He(t.namedEffect.type, !1);
1725
+ function ys(e, t, n) {
1726
+ const s = t.namedEffect && We(t.namedEffect.type, !1);
1712
1727
  if (!s?.getNames)
1713
1728
  return;
1714
1729
  const i = (r) => s.getNames({ ...t, suffix: r });
@@ -1717,281 +1732,281 @@ function gs(e, t, n) {
1717
1732
  const o = e.keyframeEntries.get(n) || [];
1718
1733
  e.keyframeEntries.set(n, [...o, { slotKey: t.slotKey, getNames: i }]);
1719
1734
  }
1720
- function Pt(e, t, n, s, i, o) {
1721
- const r = W(t), c = e.targetsMap.get(r) || At(
1735
+ function Ft(e, t, n, s, i, o) {
1736
+ const r = V(t), c = e.targetsMap.get(r) || kt(
1722
1737
  t.key,
1723
- G(t, {
1738
+ W(t, {
1724
1739
  asCombinator: !0,
1725
1740
  useFirstChild: e.useFirstChild,
1726
1741
  addItemFilter: !0
1727
1742
  })
1728
1743
  );
1729
1744
  s.add(r);
1730
- const l = o?.get(r) || qe, u = Mt(c, l, e.configIndex);
1745
+ const l = o?.get(r) || Pe, f = qt(c, l, e.configIndex);
1731
1746
  if (e.collectSlots) {
1732
- gs(c, t, u.animation);
1733
- const h = kt(t);
1734
- return Pe(
1747
+ ys(c, t, f.animation);
1748
+ const h = Pt(t);
1749
+ return Le(
1735
1750
  c,
1736
1751
  { animation: h === "animation", transition: h === "transition", timeline: !1 },
1737
1752
  l
1738
1753
  ), e.targetsMap.set(r, c), [];
1739
1754
  }
1740
1755
  t.namedEffect && (t.suffix = e.keyframeSlots.get(t.slotKey));
1741
- const { rules: a, keyframes: f, wrote: d } = ps(
1756
+ const { rules: a, keyframes: u, wrote: d } = vs(
1742
1757
  e,
1743
1758
  t,
1744
1759
  c,
1745
1760
  n,
1746
- u,
1761
+ f,
1747
1762
  i
1748
1763
  );
1749
- return f.forEach(({ name: h, keyframes: m }) => e.keyframesMap.set(h, m)), Pe(c, d, l), e.targetsMap.set(r, c), a;
1764
+ return u.forEach(({ name: h, keyframes: p }) => e.keyframesMap.set(h, p)), Le(c, d, l), e.targetsMap.set(r, c), a;
1750
1765
  }
1751
- function vs(e, t, n, s) {
1752
- const i = [], o = /* @__PURE__ */ new Set(), r = us(t);
1766
+ function Es(e, t, n, s) {
1767
+ const i = [], o = /* @__PURE__ */ new Set(), r = ds(t);
1753
1768
  i.push(
1754
1769
  ...t.effects.flatMap(
1755
- (l) => Pt(e, l, n, o, t, r)
1770
+ (l) => Ft(e, l, n, o, t, r)
1756
1771
  )
1757
1772
  );
1758
1773
  const { conditions: c } = t;
1759
1774
  return o.forEach((l) => {
1760
1775
  s.add(l);
1761
- const u = e.targetsMap.get(l), a = os(u, c, e.configConditions, e.configIndex);
1762
- a && (a.declarations.forEach(({ name: f }) => u.assigned.add(f)), i.push(a)), fs(u);
1776
+ const f = e.targetsMap.get(l), a = as(f, c, e.configConditions, e.configIndex);
1777
+ a && (a.declarations.forEach(({ name: u }) => f.assigned.add(u)), i.push(a)), hs(f);
1763
1778
  }), i;
1764
1779
  }
1765
- function ys(e, t, n) {
1766
- const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t, c = e.plugins ? qt(
1780
+ function ws(e, t, n) {
1781
+ const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t, c = e.plugins ? Lt(
1767
1782
  "interaction",
1768
1783
  t,
1769
1784
  s,
1770
- ie(i, e.configConditions, "media"),
1785
+ oe(i, e.configConditions, "media"),
1771
1786
  e.plugins
1772
- ) : [], { trigger: l } = t, u = {
1773
- trigger: Un(l),
1774
- id: Q("trigger", [n], e.configIndex)
1787
+ ) : [], { trigger: l } = t, f = {
1788
+ trigger: Xn(l),
1789
+ id: Z("trigger", [n], e.configIndex)
1775
1790
  }, a = /* @__PURE__ */ new Set();
1776
- l === "viewProgress" && c.push(ms(e, t, u.id, a));
1777
- const f = o.map((h, m) => {
1778
- const p = Ot(
1791
+ l === "viewProgress" && c.push(gs(e, t, f.id, a));
1792
+ const u = o.map((h, p) => {
1793
+ const m = At(
1779
1794
  h,
1780
1795
  t,
1781
1796
  e.config,
1782
- Q("eff", [n, m], e.configIndex)
1797
+ Z("eff", [n, p], e.configIndex)
1783
1798
  );
1784
- return p && Object.assign(p, { slotKey: ve(n, m) });
1799
+ return m && Object.assign(m, { slotKey: ye(n, p) });
1785
1800
  }).filter((h) => h !== null);
1786
1801
  c.push(
1787
- ...f.flatMap((h) => Pt(e, h, u, a))
1802
+ ...u.flatMap((h) => Ft(e, h, f, a))
1788
1803
  );
1789
1804
  const d = r.map(
1790
- (h, m) => Xn(
1805
+ (h, p) => Jn(
1791
1806
  h,
1792
1807
  t,
1793
1808
  e.config,
1794
- Q("seq", [n, m], e.configIndex),
1795
- (p) => ve(n, p, m)
1809
+ Z("seq", [n, p], e.configIndex),
1810
+ (m) => ye(n, m, p)
1796
1811
  )
1797
1812
  ).filter((h) => h !== null);
1798
1813
  return c.push(
1799
1814
  ...d.flatMap(
1800
- (h) => vs(e, h, u, a)
1815
+ (h) => Es(e, h, f, a)
1801
1816
  )
1802
- ), l === "viewProgress" && a.size > 1 && e.scopedTimelines.push(`--${u.id}`), a.forEach((h) => ds(e.targetsMap.get(h))), c;
1817
+ ), l === "viewProgress" && a.size > 1 && e.scopedTimelines.push(`--${f.id}`), a.forEach((h) => ms(e.targetsMap.get(h))), c;
1803
1818
  }
1804
- function Es(e = {}) {
1819
+ function $s(e = {}) {
1805
1820
  return typeof e == "boolean" ? { useFirstChild: e } : e;
1806
1821
  }
1807
- function Lt(e, t) {
1822
+ function Rt(e, t) {
1808
1823
  const { useFirstChild: n = !0, plugins: s, configIndex: i, collectSlots: o = !1 } = t, r = {
1809
1824
  config: e,
1810
1825
  configConditions: e.conditions || {},
1811
1826
  targetsMap: /* @__PURE__ */ new Map(),
1812
1827
  keyframesMap: /* @__PURE__ */ new Map(),
1813
- keyframeSlots: o ? /* @__PURE__ */ new Map() : Ft(e, i),
1828
+ keyframeSlots: o ? /* @__PURE__ */ new Map() : xt(e, i),
1814
1829
  scopedTimelines: [],
1815
1830
  collectSlots: o,
1816
1831
  useFirstChild: n,
1817
1832
  plugins: s,
1818
1833
  configIndex: i
1819
1834
  }, c = e.interactions.flatMap(
1820
- (l, u) => ys(r, l, u)
1835
+ (l, f) => ws(r, l, f)
1821
1836
  );
1822
1837
  return { ctx: r, cssRules: c };
1823
1838
  }
1824
- function Q(e, t, n) {
1839
+ function Z(e, t, n) {
1825
1840
  return [e, ...n === void 0 ? [] : [`c${n}`], ...t].join("-");
1826
1841
  }
1827
- function ve(e, t, n) {
1842
+ function ye(e, t, n) {
1828
1843
  return [e, n, t].filter((s) => s !== void 0).join(":");
1829
1844
  }
1830
- function Ft(e, t) {
1831
- const { ctx: n } = Lt(e, { configIndex: t, collectSlots: !0 }), s = /* @__PURE__ */ new Map(), i = (o) => o ? `-${o}` : void 0;
1845
+ function xt(e, t) {
1846
+ const { ctx: n } = Rt(e, { configIndex: t, collectSlots: !0 }), s = /* @__PURE__ */ new Map(), i = (o) => o ? `-${o}` : void 0;
1832
1847
  return n.targetsMap.forEach(({ keyframeEntries: o }) => {
1833
1848
  const r = /* @__PURE__ */ new Set();
1834
1849
  o.forEach((c) => {
1835
- const l = (f) => c.flatMap(({ getNames: d }) => d(i(f)));
1836
- let u = 0, a = l(u);
1837
- for (; a.some((f) => r.has(f)); )
1838
- a = l(++u);
1839
- a.forEach((f) => r.add(f)), u && c.forEach(({ slotKey: f }) => s.set(f, i(u)));
1850
+ const l = (u) => c.flatMap(({ getNames: d }) => d(i(u)));
1851
+ let f = 0, a = l(f);
1852
+ for (; a.some((u) => r.has(u)); )
1853
+ a = l(++f);
1854
+ a.forEach((u) => r.add(u)), f && c.forEach(({ slotKey: u }) => s.set(u, i(f)));
1840
1855
  });
1841
1856
  }), s;
1842
1857
  }
1843
- function ws(e, t) {
1844
- const { ctx: n, cssRules: s } = Lt(e, Es(t)), i = [...n.targetsMap.values()], o = Math.max(0, ...i.map(({ animation: h }) => h.listIndex)), r = Math.max(0, ...i.map(({ transition: h }) => h.listIndex)), c = Math.max(0, ...i.map(({ timeline: h }) => h.listIndex)), l = rs(
1858
+ function bs(e, t) {
1859
+ const { ctx: n, cssRules: s } = Rt(e, $s(t)), i = [...n.targetsMap.values()], o = Math.max(0, ...i.map(({ animation: h }) => h.listIndex)), r = Math.max(0, ...i.map(({ transition: h }) => h.listIndex)), c = Math.max(0, ...i.map(({ timeline: h }) => h.listIndex)), l = cs(
1845
1860
  i.flatMap((h) => [
1846
1861
  h,
1847
- ...[...h.partSelectors].map((m) => ({ key: h.key, childSelector: m }))
1862
+ ...[...h.partSelectors].map((p) => ({ key: h.key, childSelector: p }))
1848
1863
  ]),
1849
1864
  o,
1850
1865
  r,
1851
1866
  c,
1852
1867
  n.configIndex
1853
- ), u = Math.max(0, ...i.map(({ animation: h }) => h.slotCursor)), a = Math.max(
1868
+ ), f = Math.max(0, ...i.map(({ animation: h }) => h.slotCursor)), a = Math.max(
1854
1869
  0,
1855
1870
  ...i.map(({ transition: h }) => h.slotCursor)
1856
- ), f = is(
1871
+ ), u = rs(
1857
1872
  o,
1858
1873
  r,
1859
- u,
1874
+ f,
1860
1875
  a,
1861
1876
  c,
1862
1877
  n.configIndex
1863
- ), d = as(n.scopedTimelines, n.configIndex);
1864
- return { keyframes: n.keyframesMap, atProperty: f, cssRules: s, listsRule: l, timelineScopeRule: d };
1878
+ ), d = ls(n.scopedTimelines, n.configIndex);
1879
+ return { keyframes: n.keyframesMap, atProperty: u, cssRules: s, listsRule: l, timelineScopeRule: d };
1865
1880
  }
1866
- function zi(e, t) {
1867
- const { cssRules: n, keyframes: s, atProperty: i, listsRule: o, timelineScopeRule: r } = ws(
1881
+ function Hi(e, t) {
1882
+ const { cssRules: n, keyframes: s, atProperty: i, listsRule: o, timelineScopeRule: r } = bs(
1868
1883
  e,
1869
1884
  t
1870
1885
  );
1871
1886
  return [
1872
1887
  ...i,
1873
- ...[...s.entries()].map(([l, u]) => ts(l, u)),
1874
- ...n.map(ns),
1888
+ ...[...s.entries()].map(([l, f]) => ss(l, f)),
1889
+ ...n.map(is),
1875
1890
  o,
1876
1891
  r
1877
1892
  ].filter((l) => l).join(`
1878
1893
  `);
1879
1894
  }
1880
- const $s = {
1895
+ const Ss = {
1881
1896
  root: null,
1882
1897
  rootMargin: "0px 0px -10% 0px",
1883
1898
  threshold: [0]
1884
- }, bs = {
1899
+ }, Is = {
1885
1900
  root: null,
1886
1901
  rootMargin: "0px",
1887
1902
  threshold: [0]
1888
- }, Ss = 0.2;
1889
- function Is(e) {
1903
+ }, Ts = 0.2;
1904
+ function Cs(e) {
1890
1905
  const t = e.trim().split(/\s+/), n = t[0], s = t.length > 1 ? t[1] : t[0], i = (o) => o.startsWith("-") ? o.slice(1) : parseFloat(o) ? `-${o}` : o;
1891
1906
  return `${i(n)} 0px ${i(s)}`;
1892
1907
  }
1893
- const X = {}, N = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakSet(), Y = /* @__PURE__ */ new WeakMap();
1894
- let Rt = {}, B = null;
1895
- function Ts(e) {
1896
- Rt = e;
1908
+ const J = {}, N = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakSet(), U = /* @__PURE__ */ new WeakMap();
1909
+ let Nt = {}, Q = null;
1910
+ function Os(e) {
1911
+ Nt = e;
1897
1912
  }
1898
- function xt(e, t, n) {
1913
+ function jt(e, t, n) {
1899
1914
  N.get(e)?.forEach(({ source: i, handler: o }) => {
1900
1915
  i === e && o(t, n);
1901
1916
  });
1902
1917
  }
1903
- function Xe() {
1904
- return B || (B = new IntersectionObserver((e) => {
1918
+ function et() {
1919
+ return Q || (Q = new IntersectionObserver((e) => {
1905
1920
  e.forEach((t) => {
1906
1921
  const n = t.target;
1907
- t.isIntersecting || xt(n, !1, !0);
1922
+ t.isIntersecting || jt(n, !1, !0);
1908
1923
  });
1909
- }, bs), B);
1924
+ }, Is), Q);
1910
1925
  }
1911
- function Nt(e, t = !1) {
1926
+ function Dt(e, t = !1) {
1912
1927
  const n = JSON.stringify({ ...e, isSafeMode: t });
1913
- if (X[n])
1914
- return X[n];
1915
- const s = e.threshold ?? Ss, i = t ? $s : {
1928
+ if (J[n])
1929
+ return J[n];
1930
+ const s = e.threshold ?? Ts, i = t ? Ss : {
1916
1931
  root: null,
1917
- rootMargin: e.inset ? Is(e.inset) : "0px",
1932
+ rootMargin: e.inset ? Cs(e.inset) : "0px",
1918
1933
  threshold: s
1919
1934
  }, o = new IntersectionObserver((r) => {
1920
1935
  r.forEach((c) => {
1921
- const l = c.target, u = !ye.has(l);
1922
- if (u && (ye.add(l), e.useSafeViewEnter && !c.isIntersecting)) {
1936
+ const l = c.target, f = !Ee.has(l);
1937
+ if (f && (Ee.add(l), e.useSafeViewEnter && !c.isIntersecting)) {
1923
1938
  A.measure(() => {
1924
- const a = c.boundingClientRect.height, f = c.rootBounds?.height;
1925
- if (!f)
1939
+ const a = c.boundingClientRect.height, u = c.rootBounds?.height;
1940
+ if (!u)
1926
1941
  return;
1927
1942
  const d = Array.isArray(e.threshold) ? Math.min(...e.threshold) : e.threshold;
1928
- d && a * d > f && A.mutate(() => {
1943
+ d && a * d > u && A.mutate(() => {
1929
1944
  o.unobserve(l);
1930
- const m = Nt(e, !0);
1931
- Y.set(l, m), m.observe(l);
1945
+ const p = Dt(e, !0);
1946
+ U.set(l, p), p.observe(l);
1932
1947
  });
1933
1948
  });
1934
1949
  return;
1935
1950
  }
1936
- (c.isIntersecting || !u) && xt(l, c.isIntersecting);
1951
+ (c.isIntersecting || !f) && jt(l, c.isIntersecting);
1937
1952
  });
1938
1953
  }, i);
1939
- return X[n] = o, o;
1954
+ return J[n] = o, o;
1940
1955
  }
1941
- function Cs(e, t, n, s = {}, { reducedMotion: i, selectorCondition: o, animation: r } = {}) {
1942
- const c = { ...Rt, ...s }, l = n.triggerType || "once", u = r || se(
1956
+ function _s(e, t, n, s = {}, { reducedMotion: i, selectorCondition: o, animation: r } = {}) {
1957
+ const c = { ...Nt, ...s }, l = n.triggerType || "once", f = r || ie(
1943
1958
  t,
1944
1959
  x(n),
1945
1960
  void 0,
1946
1961
  i
1947
1962
  );
1948
- if (!u)
1963
+ if (!f)
1949
1964
  return;
1950
- const a = Nt(c);
1951
- l !== "once" && u.persist?.();
1952
- let f = !0, d = !1, h;
1953
- h = { source: e, target: t, handler: (g, y) => {
1965
+ const a = Dt(c);
1966
+ l !== "once" && f.persist?.();
1967
+ let u = !0, d = !1, h;
1968
+ h = { source: e, target: t, handler: (g, E) => {
1954
1969
  if (!(o && !t.matches(o)))
1955
1970
  if (l === "once") {
1956
1971
  if (g && !d) {
1957
1972
  d = !0;
1958
- const E = N.get(e);
1959
- (!E || E.size === 0 || E.size === 1 && E.has(h)) && ((Y.get(e) || a).unobserve(e), ye.delete(e)), u.onFinish(() => {
1973
+ const y = N.get(e);
1974
+ (!y || y.size === 0 || y.size === 1 && y.has(h)) && ((U.get(e) || a).unobserve(e), Ee.delete(e)), f.onFinish(() => {
1960
1975
  N.get(e)?.delete(h), N.get(t)?.delete(h);
1961
- }), u.play(() => {
1976
+ }), f.play(() => {
1962
1977
  const v = () => {
1963
1978
  t.dataset.interactEnter = "start";
1964
- }, w = () => {
1979
+ }, $ = () => {
1965
1980
  A.mutate(() => {
1966
1981
  t.dataset.interactEnter = "done";
1967
1982
  });
1968
1983
  };
1969
- u.isCSS ? (A.mutate(() => {
1984
+ f.isCSS ? (A.mutate(() => {
1970
1985
  requestAnimationFrame(v);
1971
- }), u.onFinish(w), u.onAbort(w)) : (A.mutate(v), u.onFinish(w));
1986
+ }), f.onFinish($), f.onAbort($)) : (A.mutate(v), f.onFinish($));
1972
1987
  });
1973
1988
  }
1974
- } else l === "alternate" ? f && g ? (f = !1, u.play()) : f || u.reverse() : l === "repeat" ? g ? (u.progress(0), u.play()) : y && (u.pause(), u.progress(0)) : l === "state" && (g ? u.play() : y && u.pause());
1989
+ } else l === "alternate" ? u && g ? (u = !1, f.play()) : u || f.reverse() : l === "repeat" ? g ? (f.progress(0), f.play()) : E && (f.pause(), f.progress(0)) : l === "state" && (g ? f.play() : E && f.pause());
1975
1990
  }, cleanup: () => {
1976
- (Y.get(e) || a).unobserve(e), (l === "repeat" || l === "state") && Xe().unobserve(e), u.cancel(), ye.delete(e), Y.delete(e);
1977
- } }, k(N, e, h), k(N, t, h), Y.set(e, a), a.observe(e), (l === "repeat" || l === "state") && Xe().observe(e);
1991
+ (U.get(e) || a).unobserve(e), (l === "repeat" || l === "state") && et().unobserve(e), f.cancel(), Ee.delete(e), U.delete(e);
1992
+ } }, q(N, e, h), q(N, t, h), U.set(e, a), a.observe(e), (l === "repeat" || l === "state") && et().observe(e);
1978
1993
  }
1979
- function Os(e) {
1980
- oe(N, e);
1994
+ function As(e) {
1995
+ re(N, e);
1981
1996
  }
1982
- function _s() {
1983
- B = null, Object.keys(X).forEach((e) => delete X[e]);
1997
+ function Ms() {
1998
+ Q = null, Object.keys(J).forEach((e) => delete J[e]);
1984
1999
  }
1985
- const As = {
1986
- add: Cs,
1987
- remove: Os,
1988
- setOptions: Ts,
1989
- reset: _s
2000
+ const ks = {
2001
+ add: _s,
2002
+ remove: As,
2003
+ setOptions: Os,
2004
+ reset: Ms
1990
2005
  };
1991
- function jt(e, t) {
2006
+ function zt(e, t) {
1992
2007
  return Object.assign(Object.create(t), e);
1993
2008
  }
1994
- function Ms(e, t, n, s) {
2009
+ function qs(e, t, n, s) {
1995
2010
  let i = e * (1 - n) + t * n;
1996
2011
  if (s) {
1997
2012
  const o = i - e;
@@ -2002,7 +2017,7 @@ function Ms(e, t, n, s) {
2002
2017
  }
2003
2018
  return i;
2004
2019
  }
2005
- function ks(e) {
2020
+ function Ps(e) {
2006
2021
  let t = !1;
2007
2022
  return function() {
2008
2023
  t || (t = !0, window.requestAnimationFrame(() => {
@@ -2010,7 +2025,7 @@ function ks(e) {
2010
2025
  }));
2011
2026
  };
2012
2027
  }
2013
- function Ze(e, t) {
2028
+ function tt(e, t) {
2014
2029
  let n = 0;
2015
2030
  return function() {
2016
2031
  n && window.clearTimeout(n), n = window.setTimeout(() => {
@@ -2018,103 +2033,103 @@ function Ze(e, t) {
2018
2033
  }, t);
2019
2034
  };
2020
2035
  }
2021
- function qs(e, t) {
2036
+ function Ls(e, t) {
2022
2037
  const n = e.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);
2023
- return Ee(n[1], t) + Ee(n[6], t);
2038
+ return we(n[1], t) + we(n[6], t);
2024
2039
  }
2025
- function Ee(e, t) {
2026
- 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) ? qs(e, t) : parseInt(e) || 0 : 0;
2040
+ function we(e, t) {
2041
+ 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) ? Ls(e, t) : parseInt(e) || 0 : 0;
2027
2042
  }
2028
2043
  function z(e, t, n) {
2029
2044
  const { name: s, offset: i = 0 } = e, { start: o, end: r } = n, c = r - o, l = i / 100;
2030
- let u, a;
2031
- return s === "entry" ? (u = o - t, a = Math.min(t, c)) : s === "entry-crossing" ? (u = o - t, a = c) : s === "contain" ? (u = Math.min(r - t, o), a = Math.abs(t - c)) : s === "exit" ? (u = Math.max(o, r - t), a = Math.min(t, c)) : s === "exit-crossing" ? (u = o, a = c) : s === "cover" && (u = o - t, a = c + t), u + l * a | 0;
2045
+ let f, a;
2046
+ return s === "entry" ? (f = o - t, a = Math.min(t, c)) : s === "entry-crossing" ? (f = o - t, a = c) : s === "contain" ? (f = Math.min(r - t, o), a = Math.abs(t - c)) : s === "exit" ? (f = Math.max(o, r - t), a = Math.min(t, c)) : s === "exit-crossing" ? (f = o, a = c) : s === "cover" && (f = o - t, a = c + t), f + l * a | 0;
2032
2047
  }
2033
- function Oe(e, t, n, s, i) {
2048
+ function _e(e, t, n, s, i) {
2034
2049
  let o = 0;
2035
2050
  const r = { start: t, end: n };
2036
2051
  return e.forEach((c, l) => {
2037
2052
  o += c.offset;
2038
- const u = c.sticky;
2039
- if (u) {
2040
- if ("end" in u && e[l - 1]?.element) {
2041
- const d = ((i ? c.element.offsetWidth : c.element.offsetHeight) || 0) + u.end - s, h = o + d - c.offset, m = h < r.start, p = !m && h <= n;
2053
+ const f = c.sticky;
2054
+ if (f) {
2055
+ if ("end" in f && e[l - 1]?.element) {
2056
+ const d = ((i ? c.element.offsetWidth : c.element.offsetHeight) || 0) + f.end - s, h = o + d - c.offset, p = h < r.start, m = !p && h <= n;
2042
2057
  let g = 0;
2043
- (m || p) && (g = c.offset, r.end += g), m && (r.start += g);
2058
+ (p || m) && (g = c.offset, r.end += g), p && (r.start += g);
2044
2059
  }
2045
- if ("start" in u) {
2046
- const a = o - u.start, f = a < r.start, d = !f && a <= r.end;
2060
+ if ("start" in f) {
2061
+ const a = o - f.start, u = a < r.start, d = !u && a <= r.end;
2047
2062
  let h = 0;
2048
- const m = e[l - 1]?.element;
2049
- if (m) {
2050
- if (f || d) {
2051
- const p = (i ? m.offsetWidth : m.offsetHeight) || 0, g = c.offset, y = (i ? c.element.offsetWidth : c.element.offsetHeight) || 0;
2052
- h = p - (g + y), o += h, r.end += h;
2063
+ const p = e[l - 1]?.element;
2064
+ if (p) {
2065
+ if (u || d) {
2066
+ const m = (i ? p.offsetWidth : p.offsetHeight) || 0, g = c.offset, E = (i ? c.element.offsetWidth : c.element.offsetHeight) || 0;
2067
+ h = m - (g + E), o += h, r.end += h;
2053
2068
  }
2054
- f && (r.start += h);
2069
+ u && (r.start += h);
2055
2070
  }
2056
2071
  }
2057
2072
  }
2058
2073
  }), r;
2059
2074
  }
2060
- function Ps(e, t, n, s, i, o) {
2075
+ function Fs(e, t, n, s, i, o) {
2061
2076
  const { start: r, end: c, duration: l } = e;
2062
- let u = r, a = c, f = e.startRange, d = e.endRange, h;
2077
+ let f = r, a = c, u = e.startRange, d = e.endRange, h;
2063
2078
  if (typeof l == "string") {
2064
- f = { name: l, offset: 0 }, d = { name: l, offset: 100 }, u = z(f, n, t), a = z(d, n, t), h = a - u;
2065
- const m = Oe(o, u, a, n, s);
2066
- u = m.start, a = m.end;
2079
+ u = { name: l, offset: 0 }, d = { name: l, offset: 100 }, f = z(u, n, t), a = z(d, n, t), h = a - f;
2080
+ const p = _e(o, f, a, n, s);
2081
+ f = p.start, a = p.end;
2067
2082
  } else {
2068
- if (f || r?.name) {
2069
- f = f || r;
2070
- const m = Ee(f.add, i), p = z({ ...f, offset: 0 }, n, t), g = z({ ...f, offset: 100 }, n, t), y = Oe(o, p, g, n, s);
2071
- u = y.start + f.offset / 100 * (y.end - y.start) + m;
2083
+ if (u || r?.name) {
2084
+ u = u || r;
2085
+ const p = we(u.add, i), m = z({ ...u, offset: 0 }, n, t), g = z({ ...u, offset: 100 }, n, t), E = _e(o, m, g, n, s);
2086
+ f = E.start + u.offset / 100 * (E.end - E.start) + p;
2072
2087
  }
2073
2088
  if (d || c?.name) {
2074
2089
  d = d || c;
2075
- const m = Ee(d.add, i), p = z({ ...d, offset: 0 }, n, t), g = z({ ...d, offset: 100 }, n, t), y = Oe(o, p, g, n, s);
2076
- a = y.start + d.offset / 100 * (y.end - y.start) + m;
2077
- } else typeof l == "number" && (a = u + l);
2090
+ const p = we(d.add, i), m = z({ ...d, offset: 0 }, n, t), g = z({ ...d, offset: 100 }, n, t), E = _e(o, m, g, n, s);
2091
+ a = E.start + d.offset / 100 * (E.end - E.start) + p;
2092
+ } else typeof l == "number" && (a = f + l);
2078
2093
  }
2079
- return !h && !l && (h = a - u), { ...e, start: u, end: a, startRange: f, endRange: d, duration: h || l };
2094
+ return !h && !l && (h = a - f), { ...e, start: f, end: a, startRange: u, endRange: d, duration: h || l };
2080
2095
  }
2081
- function Ls(e) {
2096
+ function Rs(e) {
2082
2097
  return e.position === "sticky";
2083
2098
  }
2084
- function Fs(e, t, n) {
2099
+ function xs(e, t, n) {
2085
2100
  return e.position === "fixed" && (!t || t === window.document.body || t === n);
2086
2101
  }
2087
- function Rs(e, t) {
2102
+ function Ns(e, t) {
2088
2103
  return parseInt(t ? e.left : e.top);
2089
2104
  }
2090
- function xs(e, t) {
2105
+ function js(e, t) {
2091
2106
  return parseInt(t ? e.right : e.bottom);
2092
2107
  }
2093
- function Ns(e, t, n) {
2108
+ function Ds(e, t, n) {
2094
2109
  n && (e.style.position = "static");
2095
2110
  const s = (t ? e.offsetLeft : e.offsetTop) || 0;
2096
2111
  return n && (e.style.position = null), s;
2097
2112
  }
2098
- function js(e, t) {
2113
+ function zs(e, t) {
2099
2114
  let n;
2100
- const s = Rs(e, t), i = xs(e, t), o = !isNaN(s), r = !isNaN(i);
2115
+ const s = Ns(e, t), i = js(e, t), o = !isNaN(s), r = !isNaN(i);
2101
2116
  return (o || r) && (n = {}, o && (n.start = s), r && (n.end = i)), n;
2102
2117
  }
2103
- function ce(e, t, n, s, i) {
2118
+ function le(e, t, n, s, i) {
2104
2119
  const o = e[0].viewSource, r = [];
2105
- let c = (s ? o.offsetWidth : o.offsetHeight) || 0, l = 0, u = o;
2106
- for (; u; ) {
2107
- const f = window.getComputedStyle(u), d = Ls(f), h = d ? js(f, s) : void 0, m = Ns(u, s, d);
2108
- if ((!h || !("end" in h)) && (l += m), r.push({ element: u, offset: m, sticky: h }), u = u.offsetParent, Fs(f, u, t))
2120
+ let c = (s ? o.offsetWidth : o.offsetHeight) || 0, l = 0, f = o;
2121
+ for (; f; ) {
2122
+ const u = window.getComputedStyle(f), d = Rs(u), h = d ? zs(u, s) : void 0, p = Ds(f, s, d);
2123
+ if ((!h || !("end" in h)) && (l += p), r.push({ element: f, offset: p, sticky: h }), f = f.offsetParent, xs(u, f, t))
2109
2124
  break;
2110
- if (u === t) {
2111
- r.push({ element: u, offset: 0 });
2125
+ if (f === t) {
2126
+ r.push({ element: f, offset: 0 });
2112
2127
  break;
2113
2128
  }
2114
2129
  }
2115
- return r.reverse(), e.map((f) => ({
2116
- ...Ps(
2117
- f,
2130
+ return r.reverse(), e.map((u) => ({
2131
+ ...Fs(
2132
+ u,
2118
2133
  { start: l, end: l + c },
2119
2134
  n,
2120
2135
  s,
@@ -2123,7 +2138,7 @@ function ce(e, t, n, s, i) {
2123
2138
  )
2124
2139
  }));
2125
2140
  }
2126
- const Je = 100, zs = {
2141
+ const nt = 100, Hs = {
2127
2142
  horizontal: !1,
2128
2143
  observeViewportEntry: !0,
2129
2144
  viewportRootMargin: "7% 7%",
@@ -2131,116 +2146,116 @@ const Je = 100, zs = {
2131
2146
  observeSourcesResize: !1,
2132
2147
  observeContentResize: !1
2133
2148
  };
2134
- function Hs(e, t, n, s) {
2149
+ function Gs(e, t, n, s) {
2135
2150
  let i = 0;
2136
2151
  return e >= t && e <= n ? i = s ? (e - t) / s : 1 : e > n && (i = 1), i;
2137
2152
  }
2138
- function et(e, t) {
2153
+ function st(e, t) {
2139
2154
  return e === window ? t ? window.document.documentElement.clientWidth : window.document.documentElement.clientHeight : t ? e.clientWidth : e.clientHeight;
2140
2155
  }
2141
- function Ds() {
2156
+ function Ws() {
2142
2157
  return {
2143
2158
  viewportWidth: window.document.documentElement.clientWidth,
2144
2159
  viewportHeight: window.document.documentElement.clientHeight
2145
2160
  };
2146
2161
  }
2147
- function Gs(e) {
2148
- const t = jt(e, zs), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
2149
- let o = et(n, s), r, c, l, u, a;
2150
- const f = [], d = Ds();
2162
+ function Vs(e) {
2163
+ const t = zt(e, Hs), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
2164
+ let o = st(n, s), r, c, l, f, a;
2165
+ const u = [], d = Ws();
2151
2166
  if (t.scenes = Object.values(
2152
2167
  // TODO(ameerf): find a polyfill and use groupBy instead of following reduce
2153
2168
  e.scenes.reduce(
2154
- (p, g, y) => {
2155
- const E = g.groupId ? `group-${g.groupId}` : String(y);
2156
- return p[E] ? p[E].push(g) : p[E] = [g], p;
2169
+ (m, g, E) => {
2170
+ const y = g.groupId ? `group-${g.groupId}` : String(E);
2171
+ return m[y] ? m[y].push(g) : m[y] = [g], m;
2157
2172
  },
2158
2173
  {}
2159
2174
  )
2160
- ).flatMap((p) => (p.every((g) => g.viewSource && (typeof g.duration == "string" || g.start?.name)) ? (p = ce(p, n, o, s, d), (t.observeSourcesResize || t.observeContentResize) && f.push(p)) : p.forEach((g) => {
2175
+ ).flatMap((m) => (m.every((g) => g.viewSource && (typeof g.duration == "string" || g.start?.name)) ? (m = le(m, n, o, s, d), (t.observeSourcesResize || t.observeContentResize) && u.push(m)) : m.forEach((g) => {
2161
2176
  g.end == null && (g.end = g.start + g.duration), g.duration == null && (g.duration = g.end - g.start);
2162
- }), p)), t.scenes.forEach((p, g) => {
2163
- p.index = g;
2164
- }), f.length) {
2165
- const p = /* @__PURE__ */ new Map();
2177
+ }), m)), t.scenes.forEach((m, g) => {
2178
+ m.index = g;
2179
+ }), u.length) {
2180
+ const m = /* @__PURE__ */ new Map();
2166
2181
  window.ResizeObserver && (l = new window.ResizeObserver(function(g) {
2167
- g.forEach((y) => {
2168
- const E = p.get(y.target), v = ce(E, n, o, s, d);
2169
- v.forEach((w, b) => {
2170
- t.scenes[w.index] = v[b];
2171
- }), f.splice(f.indexOf(E), 1, v);
2182
+ g.forEach((E) => {
2183
+ const y = m.get(E.target), v = le(y, n, o, s, d);
2184
+ v.forEach(($, b) => {
2185
+ t.scenes[$.index] = v[b];
2186
+ }), u.splice(u.indexOf(y), 1, v);
2172
2187
  });
2173
- }), f.forEach((g) => {
2174
- l.observe(g[0].viewSource, { box: "border-box" }), p.set(g[0].viewSource, g);
2175
- }), t.observeContentResize && t.contentRoot && new window.ResizeObserver(Ze(() => {
2176
- const y = f.map((E) => {
2177
- const v = ce(E, n, o, s, d);
2178
- return v.forEach((w, b) => {
2179
- t.scenes[w.index] = v[b];
2188
+ }), u.forEach((g) => {
2189
+ l.observe(g[0].viewSource, { box: "border-box" }), m.set(g[0].viewSource, g);
2190
+ }), t.observeContentResize && t.contentRoot && new window.ResizeObserver(tt(() => {
2191
+ const E = u.map((y) => {
2192
+ const v = le(y, n, o, s, d);
2193
+ return v.forEach(($, b) => {
2194
+ t.scenes[$.index] = v[b];
2180
2195
  }), v;
2181
2196
  });
2182
- f.length = 0, f.push(...y), f.forEach((E) => {
2183
- p.set(E[0].viewSource, E);
2197
+ u.length = 0, u.push(...E), u.forEach((y) => {
2198
+ m.set(y[0].viewSource, y);
2184
2199
  });
2185
- }, Je)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (u = Ze(function() {
2186
- o = et(n, s);
2187
- const g = f.map((y) => {
2188
- const E = ce(y, n, o, s, d);
2189
- return E.forEach((v, w) => {
2190
- t.scenes[v.index] = E[w];
2191
- }), E;
2200
+ }, nt)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (f = tt(function() {
2201
+ o = st(n, s);
2202
+ const g = u.map((E) => {
2203
+ const y = le(E, n, o, s, d);
2204
+ return y.forEach((v, $) => {
2205
+ t.scenes[v.index] = y[$];
2206
+ }), y;
2192
2207
  });
2193
- f.length = 0, f.push(...g), f.forEach((y) => {
2194
- p.set(y[0].viewSource, y);
2208
+ u.length = 0, u.push(...g), u.forEach((E) => {
2209
+ m.set(E[0].viewSource, E);
2195
2210
  });
2196
- }, Je), n === window ? window.addEventListener("resize", u) : window.ResizeObserver && (a = new window.ResizeObserver(u), a.observe(n, { box: "border-box" })));
2211
+ }, nt), n === window ? window.addEventListener("resize", f) : window.ResizeObserver && (a = new window.ResizeObserver(f), a.observe(n, { box: "border-box" })));
2197
2212
  }
2198
- t.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(p) {
2199
- p.forEach((g) => {
2200
- (i.get(g.target) || []).forEach((y) => {
2201
- y.disabled = !g.isIntersecting;
2213
+ t.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(m) {
2214
+ m.forEach((g) => {
2215
+ (i.get(g.target) || []).forEach((E) => {
2216
+ E.disabled = !g.isIntersecting;
2202
2217
  });
2203
2218
  });
2204
2219
  }, {
2205
2220
  root: n === window ? window.document : n,
2206
2221
  rootMargin: t.viewportRootMargin,
2207
2222
  threshold: 0
2208
- }), t.scenes.forEach((p) => {
2209
- if (p.viewSource) {
2210
- let g = i.get(p.viewSource);
2211
- g || (g = [], i.set(p.viewSource, g), c.observe(p.viewSource)), g.push(p);
2223
+ }), t.scenes.forEach((m) => {
2224
+ if (m.viewSource) {
2225
+ let g = i.get(m.viewSource);
2226
+ g || (g = [], i.set(m.viewSource, g), c.observe(m.viewSource)), g.push(m);
2212
2227
  }
2213
2228
  }));
2214
- function h({ p, vp: g }) {
2215
- p = +p.toFixed(1);
2216
- const y = +g.toFixed(4);
2217
- if (p !== r) {
2218
- for (let E of t.scenes)
2219
- if (!E.disabled) {
2220
- const { start: v, end: w, duration: b } = E, S = Hs(p, v, w, b);
2221
- E.effect(E, S, y);
2229
+ function h({ p: m, vp: g }) {
2230
+ m = +m.toFixed(1);
2231
+ const E = +g.toFixed(4);
2232
+ if (m !== r) {
2233
+ for (let y of t.scenes)
2234
+ if (!y.disabled) {
2235
+ const { start: v, end: $, duration: b } = y, S = Gs(m, v, $, b);
2236
+ y.effect(y, S, E);
2222
2237
  }
2223
- r = p;
2238
+ r = m;
2224
2239
  }
2225
2240
  }
2226
- function m() {
2227
- t.scenes.forEach((p) => p.destroy?.()), c && (c.disconnect(), c = null), l && (l.disconnect(), l = null), u && (a ? (a.disconnect(), a = null) : window.removeEventListener("resize", u));
2241
+ function p() {
2242
+ t.scenes.forEach((m) => m.destroy?.()), c && (c.disconnect(), c = null), l && (l.disconnect(), l = null), f && (a ? (a.disconnect(), a = null) : window.removeEventListener("resize", f));
2228
2243
  }
2229
2244
  return {
2230
2245
  tick: h,
2231
- destroy: m
2246
+ destroy: p
2232
2247
  };
2233
2248
  }
2234
- const Ws = {
2249
+ const Ks = {
2235
2250
  transitionActive: !1,
2236
2251
  transitionFriction: 0.9,
2237
2252
  transitionEpsilon: 1,
2238
2253
  velocityActive: !1,
2239
2254
  velocityMax: 1
2240
2255
  };
2241
- class Vs {
2256
+ class Ys {
2242
2257
  constructor(t = {}) {
2243
- this.config = jt(t, Ws), this.progress = {
2258
+ this.config = zt(t, Ks), this.progress = {
2244
2259
  p: 0,
2245
2260
  prevP: 0,
2246
2261
  vp: 0
@@ -2253,7 +2268,7 @@ class Vs {
2253
2268
  this.config.root = n ? window : this.config.root, this.config.contentRoot = this.config.contentRoot || (n ? window.document.body : this.config.root.firstElementChild), this.config.resetProgress = this.config.resetProgress || this.resetProgress.bind(this), this._measure = this.config.measure || (() => {
2254
2269
  const s = this.config.root;
2255
2270
  this.progress.p = this.config.horizontal ? s.scrollX || s.scrollLeft || 0 : s.scrollY || s.scrollTop || 0;
2256
- }), this._trigger = ks(() => {
2271
+ }), this._trigger = Ps(() => {
2257
2272
  this._measure?.(), this.tick(!0);
2258
2273
  });
2259
2274
  }
@@ -2299,7 +2314,7 @@ class Vs {
2299
2314
  * Calculate current progress.
2300
2315
  */
2301
2316
  lerp() {
2302
- this.currentProgress.p = Ms(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
2317
+ this.currentProgress.p = qs(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
2303
2318
  }
2304
2319
  /**
2305
2320
  * Stop the event and effect, and remove all DOM side-effects.
@@ -2323,7 +2338,7 @@ class Vs {
2323
2338
  * Reset registered effect.
2324
2339
  */
2325
2340
  setupEffect() {
2326
- this.removeEffect(), this.effect = Gs(this.config);
2341
+ this.removeEffect(), this.effect = Vs(this.config);
2327
2342
  }
2328
2343
  /**
2329
2344
  * Remove registered effect.
@@ -2332,12 +2347,12 @@ class Vs {
2332
2347
  this.effect && this.effect.destroy(), this.effect = null;
2333
2348
  }
2334
2349
  }
2335
- const Le = /* @__PURE__ */ new WeakMap();
2336
- let zt = () => ({});
2337
- function Ks(e) {
2338
- zt = e;
2350
+ const Fe = /* @__PURE__ */ new WeakMap();
2351
+ let Ht = () => ({});
2352
+ function Bs(e) {
2353
+ Ht = e;
2339
2354
  }
2340
- function Ys(e, t, n, s, { reducedMotion: i, selectorCondition: o }) {
2355
+ function Us(e, t, n, s, { reducedMotion: i, selectorCondition: o }) {
2341
2356
  if (i || o && !t.matches(o)) return;
2342
2357
  const r = {
2343
2358
  trigger: "view-progress",
@@ -2345,7 +2360,7 @@ function Ys(e, t, n, s, { reducedMotion: i, selectorCondition: o }) {
2345
2360
  }, c = x(n);
2346
2361
  let l;
2347
2362
  if ("ViewTimeline" in window) {
2348
- const a = se(
2363
+ const a = ie(
2349
2364
  t,
2350
2365
  c,
2351
2366
  r
@@ -2356,20 +2371,20 @@ function Ys(e, t, n, s, { reducedMotion: i, selectorCondition: o }) {
2356
2371
  });
2357
2372
  });
2358
2373
  } else {
2359
- const a = bt(t, c, r);
2374
+ const a = It(t, c, r);
2360
2375
  if (a) {
2361
- const f = Array.isArray(a) ? a : [a], d = new Vs({
2376
+ const u = Array.isArray(a) ? a : [a], d = new Ys({
2362
2377
  viewSource: e,
2363
- scenes: f,
2378
+ scenes: u,
2364
2379
  observeViewportEntry: !1,
2365
2380
  observeViewportResize: !1,
2366
2381
  observeSourcesResize: !0,
2367
2382
  root: document.body,
2368
- ...zt()
2383
+ ...Ht()
2369
2384
  });
2370
2385
  l = () => {
2371
2386
  d.destroy();
2372
- }, Promise.all(f.map((h) => h.ready || Promise.resolve())).then(
2387
+ }, Promise.all(u.map((h) => h.ready || Promise.resolve())).then(
2373
2388
  () => {
2374
2389
  d.start();
2375
2390
  }
@@ -2377,21 +2392,21 @@ function Ys(e, t, n, s, { reducedMotion: i, selectorCondition: o }) {
2377
2392
  }
2378
2393
  }
2379
2394
  if (!l) return;
2380
- const u = { source: e, target: t, cleanup: l };
2381
- k(Le, e, u), k(Le, t, u);
2395
+ const f = { source: e, target: t, cleanup: l };
2396
+ q(Fe, e, f), q(Fe, t, f);
2382
2397
  }
2383
- function Bs(e) {
2384
- oe(Le, e);
2398
+ function Qs(e) {
2399
+ re(Fe, e);
2385
2400
  }
2386
- const Us = {
2387
- add: Ys,
2388
- remove: Bs,
2389
- registerOptionsGetter: Ks
2401
+ const Xs = {
2402
+ add: Us,
2403
+ remove: Qs,
2404
+ registerOptionsGetter: Bs
2390
2405
  };
2391
- function tt(e, t, n) {
2406
+ function it(e, t, n) {
2392
2407
  return Math.min(Math.max(e, n), t);
2393
2408
  }
2394
- function nt(e) {
2409
+ function ot(e) {
2395
2410
  let t = !1;
2396
2411
  return function() {
2397
2412
  if (!t)
@@ -2400,7 +2415,7 @@ function nt(e) {
2400
2415
  });
2401
2416
  };
2402
2417
  }
2403
- function Qs(e) {
2418
+ function Zs(e) {
2404
2419
  let t = e, n = 0, s = 0;
2405
2420
  if (t.offsetParent)
2406
2421
  do
@@ -2413,7 +2428,7 @@ function Qs(e) {
2413
2428
  height: e.offsetHeight
2414
2429
  };
2415
2430
  }
2416
- function Xs() {
2431
+ function Js() {
2417
2432
  const e = window.devicePixelRatio;
2418
2433
  let t = !1;
2419
2434
  if (e === 1)
@@ -2426,7 +2441,7 @@ function Xs() {
2426
2441
  });
2427
2442
  return document.body.dispatchEvent(n), t;
2428
2443
  }
2429
- function Zs() {
2444
+ function ei() {
2430
2445
  return new Promise((e) => {
2431
2446
  const t = window.scrollY;
2432
2447
  let n = !1, s;
@@ -2445,42 +2460,42 @@ function Zs() {
2445
2460
  i(), window.addEventListener("scroll", o), window.scrollY > 0 && window.scrollBy(0, -1);
2446
2461
  });
2447
2462
  }
2448
- function Js(e) {
2449
- Zs().then((t) => {
2463
+ function ti(e) {
2464
+ ei().then((t) => {
2450
2465
  e.fixRequired = t, t && (window.addEventListener("scroll", e.scrollHandler), e.scrollHandler());
2451
2466
  });
2452
2467
  }
2453
- let le = 0;
2454
- const pe = /* @__PURE__ */ new Set();
2455
- function ei() {
2468
+ let fe = 0;
2469
+ const ge = /* @__PURE__ */ new Set();
2470
+ function ni() {
2456
2471
  const e = (n) => {
2457
2472
  for (let s of n.changedTouches)
2458
- pe.add(s.identifier);
2473
+ ge.add(s.identifier);
2459
2474
  }, t = (n) => {
2460
2475
  for (let s of n.changedTouches)
2461
- pe.delete(s.identifier);
2476
+ ge.delete(s.identifier);
2462
2477
  };
2463
2478
  return document.addEventListener("touchstart", e, { passive: !0 }), document.addEventListener("touchend", t, { passive: !0 }), function() {
2464
- pe.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
2479
+ ge.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
2465
2480
  };
2466
2481
  }
2467
- function ti(e, t) {
2482
+ function si(e, t) {
2468
2483
  if ("onscrollend" in window)
2469
2484
  return e.addEventListener("scrollend", t), function() {
2470
2485
  e.removeEventListener("scrollend", t);
2471
2486
  };
2472
2487
  let n = 0, s;
2473
- le || (s = ei()), le += 1;
2488
+ fe || (s = ni()), fe += 1;
2474
2489
  function i(o) {
2475
2490
  clearTimeout(n), n = setTimeout(() => {
2476
- pe.size ? setTimeout(i, 100) : (t(o), n = 0);
2491
+ ge.size ? setTimeout(i, 100) : (t(o), n = 0);
2477
2492
  }, 100);
2478
2493
  }
2479
2494
  return e.addEventListener("scroll", i), function() {
2480
- e.removeEventListener("scroll", i), le -= 1, le || s();
2495
+ e.removeEventListener("scroll", i), fe -= 1, fe || s();
2481
2496
  };
2482
2497
  }
2483
- function ni(e, t, n) {
2498
+ function ii(e, t, n) {
2484
2499
  return {
2485
2500
  x(s) {
2486
2501
  const i = e.left - n.x + e.width / 2, o = i >= t.width / 2, r = (o ? i : t.width - i) * 2, c = o ? 0 : i - r / 2;
@@ -2492,13 +2507,13 @@ function ni(e, t, n) {
2492
2507
  }
2493
2508
  };
2494
2509
  }
2495
- function si(e, t) {
2510
+ function oi(e, t) {
2496
2511
  this.x = window.scrollX, this.y = window.scrollY, requestAnimationFrame(() => e && e(t));
2497
2512
  }
2498
- function ii(e) {
2513
+ function ri(e) {
2499
2514
  e.rect.width = window.document.documentElement.clientWidth, e.rect.height = window.document.documentElement.clientHeight;
2500
2515
  }
2501
- function oi(e) {
2516
+ function ai(e) {
2502
2517
  const t = new ResizeObserver((n) => {
2503
2518
  n.forEach((s) => {
2504
2519
  e.rect.width = s.borderBoxSize[0].inlineSize, e.rect.height = s.borderBoxSize[0].blockSize;
@@ -2506,38 +2521,38 @@ function oi(e) {
2506
2521
  });
2507
2522
  return t.observe(e.root, { box: "border-box" }), t;
2508
2523
  }
2509
- function ri(e) {
2524
+ function ci(e) {
2510
2525
  let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, i, o, r, c;
2511
2526
  const l = { x: 0, y: 0 };
2512
2527
  e.scenes.forEach((a) => {
2513
- a.target && a.centeredToTarget && (a.transform = ni(Qs(a.target), e.rect, l), t = !0), e.root ? i = oi(e) : (o = ii.bind(null, e), window.addEventListener("resize", o));
2528
+ a.target && a.centeredToTarget && (a.transform = ii(Zs(a.target), e.rect, l), t = !0), e.root ? i = ai(e) : (o = ri.bind(null, e), window.addEventListener("resize", o));
2514
2529
  }), s = function(a) {
2515
- for (let f of e.scenes)
2516
- if (!f.disabled) {
2517
- const d = f.transform?.x(a.x) || a.x / e.rect.width, h = f.transform?.y(a.y) || a.y / e.rect.height, m = +tt(0, 1, d).toPrecision(4), p = +tt(0, 1, h).toPrecision(4), g = { x: a.vx, y: a.vy };
2518
- e.allowActiveEvent && (a.active = d <= 1 && h <= 1 && d >= 0 && h >= 0), f.effect(f, { x: m, y: p }, g, a.active);
2530
+ for (let u of e.scenes)
2531
+ if (!u.disabled) {
2532
+ const d = u.transform?.x(a.x) || a.x / e.rect.width, h = u.transform?.y(a.y) || a.y / e.rect.height, p = +it(0, 1, d).toPrecision(4), m = +it(0, 1, h).toPrecision(4), g = { x: a.vx, y: a.vy };
2533
+ e.allowActiveEvent && (a.active = d <= 1 && h <= 1 && d >= 0 && h >= 0), u.effect(u, { x: p, y: m }, g, a.active);
2519
2534
  }
2520
2535
  Object.assign(n, a);
2521
- }, t && (r = si.bind(l, s, n), c = ti(document, r));
2522
- function u() {
2536
+ }, t && (r = oi.bind(l, s, n), c = si(document, r));
2537
+ function f() {
2523
2538
  e.scenes.forEach((a) => a.destroy?.()), c?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", o), o = null), s = null, n = null;
2524
2539
  }
2525
2540
  return {
2526
2541
  tick: s,
2527
- destroy: u
2542
+ destroy: f
2528
2543
  };
2529
2544
  }
2530
- const ai = 1e3 / 60 * 3;
2545
+ const li = 1e3 / 60 * 3;
2531
2546
  let ue;
2532
- function ci() {
2547
+ function fi() {
2533
2548
  H.x = window.scrollX, H.y = window.scrollY;
2534
2549
  }
2535
- const H = { x: 0, y: 0, scrollHandler: ci, fixRequired: void 0 };
2536
- class li {
2550
+ const H = { x: 0, y: 0, scrollHandler: fi, fixRequired: void 0 };
2551
+ class ui {
2537
2552
  constructor(t = {}) {
2538
2553
  this.config = { ...t }, this.effect = null, this._nextTick = null, this._nextTransitionTick = null, this._startTime = 0;
2539
2554
  let n;
2540
- this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : nt(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : nt(() => {
2555
+ this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : ot(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : ot(() => {
2541
2556
  this.tick();
2542
2557
  }), this.config.rect = this.config.root ? {
2543
2558
  width: this.config.root.offsetWidth,
@@ -2560,9 +2575,9 @@ class li {
2560
2575
  }, this._pointerEnter = () => {
2561
2576
  this.progress.active = !0, this._nextTick = n();
2562
2577
  }, this.config.root) {
2563
- ue = typeof ue == "boolean" ? ue : Xs();
2578
+ ue = typeof ue == "boolean" ? ue : Js();
2564
2579
  const i = ue ? window.devicePixelRatio : 1;
2565
- typeof H.fixRequired > "u" && Js(H), this._measure = (o) => {
2580
+ typeof H.fixRequired > "u" && ti(H), this._measure = (o) => {
2566
2581
  if (o.target !== this.config.root) {
2567
2582
  const r = new PointerEvent("pointermove", {
2568
2583
  bubbles: !0,
@@ -2605,7 +2620,7 @@ class li {
2605
2620
  let i = !1;
2606
2621
  const o = (r) => {
2607
2622
  const c = (r - this._startTime) / t, l = n(Math.min(1, c));
2608
- i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((u, [a, f]) => (a === "active" ? u[a] = f : u[a] = this.previousProgress[a] + (f - this.previousProgress[a]) * l, u), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(o), i = r - this._startTime > ai), this.effect.tick(this.currentProgress);
2623
+ i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((f, [a, u]) => (a === "active" ? f[a] = u : f[a] = this.previousProgress[a] + (u - this.previousProgress[a]) * l, f), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(o), i = r - this._startTime > li), this.effect.tick(this.currentProgress);
2609
2624
  };
2610
2625
  return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, o(s)) : this._startTime = s, this._nextTransitionTick;
2611
2626
  }
@@ -2634,7 +2649,7 @@ class li {
2634
2649
  * Reset registered effect.
2635
2650
  */
2636
2651
  setupEffect() {
2637
- this.removeEffect(), this.effect = ri(this.config);
2652
+ this.removeEffect(), this.effect = ci(this.config);
2638
2653
  }
2639
2654
  /**
2640
2655
  * Remove registered effect.
@@ -2643,48 +2658,55 @@ class li {
2643
2658
  this.effect && this.effect.destroy(), this.effect = null;
2644
2659
  }
2645
2660
  }
2646
- const Fe = /* @__PURE__ */ new WeakMap();
2647
- let Ht = () => ({});
2648
- function ui(e) {
2649
- Ht = e;
2661
+ const Re = /* @__PURE__ */ new WeakMap();
2662
+ let Gt = () => ({});
2663
+ function di(e) {
2664
+ Gt = e;
2650
2665
  }
2651
- function fi(e, t, n, s = {}, { reducedMotion: i, selectorCondition: o }) {
2666
+ function hi(e) {
2667
+ return !("keyframeEffect" in e || "customEffect" in e) || !e.transitionDuration ? {} : {
2668
+ transitionDuration: e.transitionDuration,
2669
+ transitionEasing: Ge(e.transitionEasing)
2670
+ };
2671
+ }
2672
+ function mi(e, t, n, s = {}, { reducedMotion: i, selectorCondition: o }) {
2652
2673
  if (i || o && !t.matches(o)) return;
2653
2674
  const r = {
2654
2675
  trigger: "pointer-move",
2655
2676
  element: e,
2656
2677
  axis: s.axis ?? "y"
2657
- }, c = bt(t, x(n), r);
2678
+ }, c = It(t, x(n), r);
2658
2679
  if (c) {
2659
- const l = Array.isArray(c) ? c : [c], u = new li({
2680
+ const l = Array.isArray(c) ? c : [c], f = new ui({
2660
2681
  root: s.hitArea === "self" ? e : void 0,
2661
2682
  scenes: l,
2662
- ...Ht()
2663
- }), f = { source: e, target: t, cleanup: () => {
2664
- u.destroy();
2683
+ ...Gt(),
2684
+ ...hi(n)
2685
+ }), u = { source: e, target: t, cleanup: () => {
2686
+ f.destroy();
2665
2687
  } };
2666
- k(Fe, e, f), k(Fe, t, f), Promise.all(
2688
+ q(Re, e, u), q(Re, t, u), Promise.all(
2667
2689
  l.map((d) => d.ready || Promise.resolve())
2668
2690
  ).then(() => {
2669
- u.start();
2691
+ f.start();
2670
2692
  });
2671
2693
  }
2672
2694
  }
2673
- function di(e) {
2674
- oe(Fe, e);
2675
- }
2676
- const hi = {
2677
- add: fi,
2678
- remove: di,
2679
- registerOptionsGetter: ui
2680
- }, Re = /* @__PURE__ */ new WeakMap();
2681
- function mi(e, t, n, s, {
2695
+ function pi(e) {
2696
+ re(Re, e);
2697
+ }
2698
+ const gi = {
2699
+ add: mi,
2700
+ remove: pi,
2701
+ registerOptionsGetter: di
2702
+ }, xe = /* @__PURE__ */ new WeakMap();
2703
+ function vi(e, t, n, s, {
2682
2704
  reducedMotion: i,
2683
2705
  selectorCondition: o,
2684
2706
  animation: r,
2685
2707
  sourceAnimationOptions: c
2686
2708
  }) {
2687
- const l = r || se(
2709
+ const l = r || ie(
2688
2710
  t,
2689
2711
  x(n),
2690
2712
  void 0,
@@ -2692,30 +2714,30 @@ function mi(e, t, n, s, {
2692
2714
  );
2693
2715
  if (!l)
2694
2716
  return;
2695
- const { effectId: u } = s, a = (h) => {
2717
+ const { effectId: f } = s, a = (h) => {
2696
2718
  if (o && !t.matches(o)) return;
2697
- const m = h.animationName, p = h.detail?.effectId, g = c ? $t(e, c) : null;
2719
+ const p = h.animationName, m = h.detail?.effectId, g = c ? St(e, c) : null;
2698
2720
  if (g) {
2699
- if (g.playState === "running" || m && !g.hasAnimationName(m))
2721
+ if (g.playState === "running" || p && !g.hasAnimationName(p))
2700
2722
  return;
2701
- if (p && p !== u && !g.hasAnimationId(p))
2723
+ if (m && m !== f && !g.hasAnimationId(m))
2702
2724
  return;
2703
2725
  }
2704
2726
  l.play();
2705
2727
  }, d = { source: e, target: t, cleanup: () => {
2706
2728
  l.cancel(), e.removeEventListener("animationend", a);
2707
2729
  } };
2708
- k(Re, e, d), k(Re, t, d), e.addEventListener("animationend", a);
2730
+ q(xe, e, d), q(xe, t, d), e.addEventListener("animationend", a);
2709
2731
  }
2710
- function pi(e) {
2711
- oe(Re, e);
2732
+ function yi(e) {
2733
+ re(xe, e);
2712
2734
  }
2713
- const gi = {
2714
- add: mi,
2715
- remove: pi
2735
+ const Ei = {
2736
+ add: vi,
2737
+ remove: yi
2716
2738
  };
2717
- function vi(e, t, n = !1, s, i, o) {
2718
- const r = o || se(
2739
+ function wi(e, t, n = !1, s, i, o) {
2740
+ const r = o || ie(
2719
2741
  e,
2720
2742
  x(t),
2721
2743
  void 0,
@@ -2725,10 +2747,10 @@ function vi(e, t, n = !1, s, i, o) {
2725
2747
  return null;
2726
2748
  let c = !0;
2727
2749
  const l = t.triggerType || "alternate";
2728
- return (u) => {
2750
+ return (f) => {
2729
2751
  if (s && !e.matches(s)) return;
2730
- const a = !i, f = i?.enter?.includes(u.type), d = i?.leave?.includes(u.type);
2731
- if (f || a) {
2752
+ const a = !i, u = i?.enter?.includes(f.type), d = i?.leave?.includes(f.type);
2753
+ if (u || a) {
2732
2754
  if (l === "alternate" || l === "state")
2733
2755
  c ? (c = !1, r.play()) : l === "alternate" ? r.reverse() : l === "state" && (r.playState === "running" ? r.pause() : r.playState !== "finished" && r.play());
2734
2756
  else {
@@ -2749,126 +2771,126 @@ function vi(e, t, n = !1, s, i, o) {
2749
2771
  })) : l === "state" && r.playState === "running" && r.pause());
2750
2772
  };
2751
2773
  }
2752
- function yi(e, t, {
2774
+ function $i(e, t, {
2753
2775
  effectId: n,
2754
2776
  listContainer: s,
2755
2777
  listItemSelector: i,
2756
2778
  stateAction: o
2757
2779
  }, r, c) {
2758
- const l = !!s, u = o ?? "toggle", a = u === "toggle";
2759
- return (f) => {
2780
+ const l = !!s, f = o ?? "toggle", a = f === "toggle";
2781
+ return (u) => {
2760
2782
  if (r && !e.matches(r)) return;
2761
2783
  const d = l ? e.closest(
2762
2784
  `${s} > ${i || ""}:has(:scope)`
2763
- ) : void 0, h = !c, m = c?.enter?.includes(f.type), p = c?.leave?.includes(f.type);
2764
- h ? t.toggleEffect(n, u, d) : (m && t.toggleEffect(n, a ? "add" : u, d), p && a && t.toggleEffect(n, "remove", d));
2785
+ ) : void 0, h = !c, p = c?.enter?.includes(u.type), m = c?.leave?.includes(u.type);
2786
+ h ? t.toggleEffect(n, f, d) : (p && t.toggleEffect(n, a ? "add" : f, d), m && a && t.toggleEffect(n, "remove", d));
2765
2787
  };
2766
2788
  }
2767
- const xe = /* @__PURE__ */ new WeakMap();
2768
- function st(e, t) {
2789
+ const Ne = /* @__PURE__ */ new WeakMap();
2790
+ function rt(e, t) {
2769
2791
  return (n) => {
2770
2792
  const s = n;
2771
2793
  e.contains(s.relatedTarget) || t(s);
2772
2794
  };
2773
2795
  }
2774
- function Ei(e) {
2796
+ function bi(e) {
2775
2797
  return (t) => {
2776
2798
  const n = t;
2777
2799
  (n.pointerType || n.detail > 0) && e(n);
2778
2800
  };
2779
2801
  }
2780
- function wi(e) {
2802
+ function Si(e) {
2781
2803
  return (t) => {
2782
2804
  const n = t;
2783
2805
  n.code === "Space" ? (n.preventDefault(), e(n)) : n.code === "Enter" && e(n);
2784
2806
  };
2785
2807
  }
2786
- const $i = {
2787
- focusin: (e, t) => st(e, t),
2788
- focusout: (e, t) => st(e, t),
2789
- click: (e, t) => Ei(t),
2790
- keydown: (e, t) => wi(t)
2808
+ const Ii = {
2809
+ focusin: (e, t) => rt(e, t),
2810
+ focusout: (e, t) => rt(e, t),
2811
+ click: (e, t) => bi(t),
2812
+ keydown: (e, t) => Si(t)
2791
2813
  };
2792
- function bi(e, t, n) {
2793
- const s = $i[e];
2814
+ function Ti(e, t, n) {
2815
+ const s = Ii[e];
2794
2816
  return s ? s(t, n) : (i) => n(i);
2795
2817
  }
2796
- function Si(e) {
2818
+ function Ci(e) {
2797
2819
  return typeof e == "object" && !Array.isArray(e) && ("enter" in e || "leave" in e);
2798
2820
  }
2799
- function Ii(e) {
2821
+ function Oi(e) {
2800
2822
  if (typeof e == "string")
2801
2823
  return { toggle: [e] };
2802
2824
  if (Array.isArray(e))
2803
2825
  return { toggle: [...e] };
2804
- if (Si(e)) {
2826
+ if (Ci(e)) {
2805
2827
  const t = e.enter ? [...e.enter] : [], n = e.leave ? [...e.leave] : [];
2806
2828
  return { enter: t, leave: n };
2807
2829
  }
2808
2830
  return {};
2809
2831
  }
2810
- function Ti(e) {
2832
+ function _i(e) {
2811
2833
  return !!(e.enter?.length || e.leave?.length);
2812
2834
  }
2813
- function Ci(e) {
2814
- return Ti(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
2835
+ function Ai(e) {
2836
+ return _i(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
2815
2837
  }
2816
- function Oi(e, t, n, s, {
2838
+ function Mi(e, t, n, s, {
2817
2839
  reducedMotion: i,
2818
2840
  targetController: o,
2819
2841
  selectorCondition: r,
2820
2842
  animation: c
2821
2843
  }) {
2822
- const l = Ii(s.eventConfig), u = n.transition || n.transitionProperties, a = Ci(l);
2823
- let f, d = !1;
2824
- if (u ? f = yi(
2844
+ const l = Oi(s.eventConfig), f = n.transition || n.transitionProperties, a = Ai(l);
2845
+ let u, d = !1;
2846
+ if (f ? u = $i(
2825
2847
  t,
2826
2848
  o,
2827
2849
  n,
2828
2850
  r,
2829
2851
  a
2830
- ) : (f = vi(
2852
+ ) : (u = wi(
2831
2853
  t,
2832
2854
  n,
2833
2855
  i,
2834
2856
  r,
2835
2857
  a,
2836
2858
  c
2837
- ), d = n.triggerType === "once"), !f)
2859
+ ), d = n.triggerType === "once"), !u)
2838
2860
  return;
2839
- const h = f, m = new AbortController();
2840
- function p(E, v, w) {
2841
- const b = bi(v, e, h);
2842
- E.addEventListener(v, b, { ...w, signal: m.signal });
2861
+ const h = u, p = new AbortController();
2862
+ function m(y, v, $) {
2863
+ const b = Ti(v, e, h);
2864
+ y.addEventListener(v, b, { ...$, signal: p.signal });
2843
2865
  }
2844
- const y = { source: e, target: t, cleanup: () => {
2845
- m.abort();
2866
+ const E = { source: e, target: t, cleanup: () => {
2867
+ p.abort();
2846
2868
  } };
2847
- if (k(xe, e, y), k(xe, t, y), a) {
2848
- const E = l.enter, v = l.leave;
2849
- E.forEach((S) => {
2850
- S === "focusin" && (e.tabIndex = 0), p(e, S, { passive: !0, once: d });
2869
+ if (q(Ne, e, E), q(Ne, t, E), a) {
2870
+ const y = l.enter, v = l.leave;
2871
+ y.forEach((S) => {
2872
+ S === "focusin" && (e.tabIndex = 0), m(e, S, { passive: !0, once: d });
2851
2873
  });
2852
- const w = !n.stateAction || n.stateAction === "toggle";
2853
- (u ? w : n.triggerType !== "once") && v.forEach((S) => {
2874
+ const $ = !n.stateAction || n.stateAction === "toggle";
2875
+ (f ? $ : n.triggerType !== "once") && v.forEach((S) => {
2854
2876
  if (S === "focusout") {
2855
- p(e, S, { once: d });
2877
+ m(e, S, { once: d });
2856
2878
  return;
2857
2879
  }
2858
- p(e, S, { passive: !0 });
2880
+ m(e, S, { passive: !0 });
2859
2881
  });
2860
2882
  } else
2861
2883
  (l.toggle ?? []).forEach((v) => {
2862
- p(e, v, { once: d, passive: v !== "keydown" });
2884
+ m(e, v, { once: d, passive: v !== "keydown" });
2863
2885
  });
2864
2886
  }
2865
- function _i(e) {
2866
- oe(xe, e);
2887
+ function ki(e) {
2888
+ re(Ne, e);
2867
2889
  }
2868
- const U = {
2869
- add: Oi,
2870
- remove: _i
2871
- }, Ne = {
2890
+ const X = {
2891
+ add: Mi,
2892
+ remove: ki
2893
+ }, je = {
2872
2894
  click: ["click"],
2873
2895
  activate: ["click", "keydown"],
2874
2896
  hover: { enter: ["mouseenter"], leave: ["mouseleave"] },
@@ -2876,43 +2898,43 @@ const U = {
2876
2898
  enter: ["mouseenter", "focusin"],
2877
2899
  leave: ["mouseleave", "focusout"]
2878
2900
  }
2879
- }, it = {
2880
- click: Ne.activate,
2881
- hover: Ne.interest
2901
+ }, at = {
2902
+ click: je.activate,
2903
+ hover: je.interest
2882
2904
  };
2883
- function fe(e) {
2884
- const t = Ne[e];
2905
+ function de(e) {
2906
+ const t = je[e];
2885
2907
  return (n, s, i, o, r) => {
2886
- const c = r?.allowA11yTriggers && e in it ? it[e] : t;
2887
- U.add(n, s, i, { eventConfig: c }, r ?? {});
2908
+ const c = r?.allowA11yTriggers && e in at ? at[e] : t;
2909
+ X.add(n, s, i, { eventConfig: c }, r ?? {});
2888
2910
  };
2889
2911
  }
2890
- const D = {
2891
- viewEnter: As,
2912
+ const G = {
2913
+ viewEnter: ks,
2892
2914
  hover: {
2893
- add: fe("hover"),
2894
- remove: U.remove
2915
+ add: de("hover"),
2916
+ remove: X.remove
2895
2917
  },
2896
2918
  click: {
2897
- add: fe("click"),
2898
- remove: U.remove
2919
+ add: de("click"),
2920
+ remove: X.remove
2899
2921
  },
2900
- animationEnd: gi,
2901
- viewProgress: Us,
2902
- pointerMove: hi,
2922
+ animationEnd: Ei,
2923
+ viewProgress: Xs,
2924
+ pointerMove: gi,
2903
2925
  activate: {
2904
- add: fe("activate"),
2905
- remove: U.remove
2926
+ add: de("activate"),
2927
+ remove: X.remove
2906
2928
  },
2907
2929
  interest: {
2908
- add: fe("interest"),
2909
- remove: U.remove
2930
+ add: de("interest"),
2931
+ remove: X.remove
2910
2932
  }
2911
2933
  };
2912
- function Ai(e) {
2934
+ function qi(e) {
2913
2935
  return e.replace(/\[[^\]]+]/g, "[]");
2914
2936
  }
2915
- class $ {
2937
+ class w {
2916
2938
  static defineInteractElement;
2917
2939
  dataCache;
2918
2940
  addedInteractions;
@@ -2926,18 +2948,21 @@ class $ {
2926
2948
  static sequenceCache = /* @__PURE__ */ new Map();
2927
2949
  static elementSequenceMap = /* @__PURE__ */ new WeakMap();
2928
2950
  static plugins = /* @__PURE__ */ new Map();
2951
+ static pluginDefers = /* @__PURE__ */ new Map();
2952
+ /** Released defer names: `name` (every key) or `name::key` (a single key). */
2953
+ static _released = /* @__PURE__ */ new Set();
2929
2954
  constructor() {
2930
2955
  this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, this.addedInteractions = {}, this.mediaQueryListeners = /* @__PURE__ */ new Map(), this.listInteractionsCache = {}, this.controllers = /* @__PURE__ */ new Set();
2931
2956
  }
2932
2957
  init(t, n) {
2933
2958
  if (typeof window > "u" || !window.customElements)
2934
2959
  return;
2935
- const s = n?.useCustomElement ?? !!$.defineInteractElement;
2936
- this.dataCache = qi(t, s, n?.configIndex);
2937
- const i = $.defineInteractElement?.();
2960
+ const s = n?.useCustomElement ?? !!w.defineInteractElement;
2961
+ this.dataCache = Fi(t, s, n?.configIndex);
2962
+ const i = w.defineInteractElement?.();
2938
2963
  s && i === !1 ? document.querySelectorAll("interact-element").forEach((o) => {
2939
2964
  o.connect();
2940
- }) : $.controllerCache.forEach(
2965
+ }) : w.controllerCache.forEach(
2941
2966
  (o, r) => o.connect(r)
2942
2967
  );
2943
2968
  }
@@ -2946,20 +2971,20 @@ class $ {
2946
2971
  n.disconnect({ removeFromCache: t });
2947
2972
  for (const [, n] of this.mediaQueryListeners.entries())
2948
2973
  n.mql.removeEventListener("change", n.handler);
2949
- this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, $.instances.splice($.instances.indexOf(this), 1);
2974
+ this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, w.instances.splice(w.instances.indexOf(this), 1);
2950
2975
  }
2951
2976
  setController(t, n) {
2952
- this.controllers.add(n), $.setController(t, n);
2977
+ this.controllers.add(n), w.setController(t, n);
2953
2978
  }
2954
2979
  deleteController(t, n = !1) {
2955
- const s = $.controllerCache.get(t);
2956
- this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s), $.deleteController(t));
2980
+ const s = w.controllerCache.get(t);
2981
+ this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s), w.deleteController(t));
2957
2982
  }
2958
2983
  has(t) {
2959
2984
  return !!this.get(t);
2960
2985
  }
2961
2986
  get(t) {
2962
- const n = Ai(t);
2987
+ const n = qi(t);
2963
2988
  return this.dataCache.interactions[n];
2964
2989
  }
2965
2990
  clearMediaQueryListenersForKey(t) {
@@ -2968,12 +2993,12 @@ class $ {
2968
2993
  }
2969
2994
  clearInteractionStateForKey(t) {
2970
2995
  (this.get(t)?.interactionIds || []).forEach((i) => {
2971
- const o = q(i, t);
2996
+ const o = k(i, t);
2972
2997
  delete this.addedInteractions[o];
2973
2998
  });
2974
2999
  const s = `${t}::seq::`;
2975
- for (const i of $.sequenceCache.keys())
2976
- i.startsWith(s) && ($.sequenceCache.delete(i), delete this.addedInteractions[i]);
3000
+ for (const i of w.sequenceCache.keys())
3001
+ i.startsWith(s) && (w.sequenceCache.delete(i), delete this.addedInteractions[i]);
2977
3002
  }
2978
3003
  setupMediaQueryListener(t, n, s, i) {
2979
3004
  this.mediaQueryListeners.has(t) || (n.addEventListener("change", i), this.mediaQueryListeners.set(t, {
@@ -2983,92 +3008,110 @@ class $ {
2983
3008
  }));
2984
3009
  }
2985
3010
  static create(t, n) {
2986
- const s = new $();
2987
- return $.instances.push(s), s.init(t, n), s;
3011
+ const s = new w();
3012
+ return w.instances.push(s), s.init(t, n), s;
2988
3013
  }
2989
3014
  static destroy() {
2990
- $.controllerCache.forEach((t) => {
3015
+ w.controllerCache.forEach((t) => {
2991
3016
  t.disconnect();
2992
- }), $.instances.length = 0, $.controllerCache.clear(), $.sequenceCache.clear(), $.elementSequenceMap = /* @__PURE__ */ new WeakMap();
3017
+ }), w.instances.length = 0, w.controllerCache.clear(), w.sequenceCache.clear(), w.elementSequenceMap = /* @__PURE__ */ new WeakMap(), w._released.clear();
2993
3018
  }
2994
3019
  static setup(t) {
2995
- t.scrollOptionsGetter && D.viewProgress.registerOptionsGetter?.(
3020
+ t.scrollOptionsGetter && G.viewProgress.registerOptionsGetter?.(
2996
3021
  t.scrollOptionsGetter
2997
- ), t.pointerOptionsGetter && D.pointerMove.registerOptionsGetter?.(
3022
+ ), t.pointerOptionsGetter && G.pointerMove.registerOptionsGetter?.(
2998
3023
  t.pointerOptionsGetter
2999
- ), t.viewEnter && D.viewEnter.setOptions(
3024
+ ), t.viewEnter && G.viewEnter.setOptions(
3000
3025
  t.viewEnter
3001
- ), t.allowA11yTriggers !== void 0 && ($.allowA11yTriggers = t.allowA11yTriggers);
3026
+ ), t.allowA11yTriggers !== void 0 && (w.allowA11yTriggers = t.allowA11yTriggers);
3002
3027
  }
3003
3028
  static getInstance(t) {
3004
- const n = $.instances.find((s) => s.has(t));
3029
+ const n = w.instances.find((s) => s.has(t));
3005
3030
  return n || console.warn(`Interact: Instance for key "${t}" not found`), n;
3006
3031
  }
3007
3032
  static getController(t) {
3008
- const n = t ? $.controllerCache.get(t) : void 0;
3033
+ const n = t ? w.controllerCache.get(t) : void 0;
3009
3034
  return n || console.warn(`Interact: Controller for key "${t}" not found`), n;
3010
3035
  }
3011
3036
  static setController(t, n) {
3012
- $.controllerCache.set(t, n);
3037
+ w.controllerCache.set(t, n);
3013
3038
  }
3014
3039
  static deleteController(t) {
3015
- $.controllerCache.delete(t);
3040
+ w.controllerCache.delete(t);
3016
3041
  }
3017
- static registerEffects = Nn;
3018
- static getRegisteredEffect = He;
3042
+ static registerEffects = Dn;
3043
+ static getRegisteredEffect = We;
3019
3044
  /**
3020
3045
  * Registers a plugin under a name. When the config carries a plugin field (e.g. `$splitText`) with a matching key
3021
3046
  * (on an interaction or effect), Interact invokes the plugin with the field's value and a
3022
3047
  * context. Interact is agnostic to what the plugin does — see the `InteractPlugin` type.
3048
+ *
3049
+ * With `options.defer`, the plugin — and every interaction, effect, or sequence carrying its
3050
+ * field — is deferred until each named event is released via `Interact.ready()`.
3023
3051
  */
3024
- static use(t, n) {
3025
- $.plugins.set(t, n);
3052
+ static use(t, n, s) {
3053
+ w.plugins.set(t, n);
3054
+ const i = s?.defer;
3055
+ i && i.length ? w.pluginDefers.set(t, Array.isArray(i) ? i : [i]) : w.pluginDefers.delete(t);
3056
+ }
3057
+ /**
3058
+ * Releases a defer name — for every key, or only for `key` — and applies everything that was
3059
+ * deferred on it (see the `defer` option of `Interact.use()`).
3060
+ */
3061
+ static ready(t, n) {
3062
+ w._released.add(n ? `${t}::${n}` : t), n ? w.controllerCache.get(n)?.resume() : w.controllerCache.forEach((s) => s.resume());
3063
+ }
3064
+ static _isPluginReleased(t, n) {
3065
+ const s = w.pluginDefers.get(t);
3066
+ return s ? s.every(
3067
+ (i) => w._released.has(i) || w._released.has(`${i}::${n}`)
3068
+ ) : !0;
3026
3069
  }
3027
3070
  static getPlugin(t) {
3028
- return $.plugins.get(t);
3071
+ return w.plugins.get(t);
3029
3072
  }
3030
3073
  static getPluginsNames() {
3031
- return new Set($.plugins.keys());
3074
+ return new Set(w.plugins.keys());
3032
3075
  }
3033
3076
  static getSequence(t, n, s, i) {
3034
- const o = $.sequenceCache.get(t);
3077
+ const o = w.sequenceCache.get(t);
3035
3078
  if (o) return o;
3036
- const r = Kn(n, s, i);
3037
- return $.sequenceCache.set(t, r), $._registerSequenceElements(s, r), r;
3079
+ const r = Bn(n, s, i);
3080
+ return w.sequenceCache.set(t, r), w._registerSequenceElements(s, r), r;
3038
3081
  }
3039
3082
  static addToSequence(t, n, s, i) {
3040
- const o = $.sequenceCache.get(t);
3083
+ const o = w.sequenceCache.get(t);
3041
3084
  if (!o) return !1;
3042
- const c = St(n, i).map((l, u) => ({
3043
- index: s[u] ?? o.animationGroups.length,
3085
+ const c = Tt(n, i).map((l, f) => ({
3086
+ index: s[f] ?? o.animationGroups.length,
3044
3087
  group: l
3045
3088
  }));
3046
- return o.addGroups(c), $._registerSequenceElements(n, o), !0;
3089
+ return o.addGroups(c), w._registerSequenceElements(n, o), !0;
3047
3090
  }
3048
3091
  static _registerSequenceElements(t, n) {
3049
3092
  for (const { target: s } of t) {
3050
3093
  const i = Array.isArray(s) ? s : s instanceof HTMLElement ? [s] : [];
3051
3094
  for (const o of i) {
3052
- let r = $.elementSequenceMap.get(o);
3053
- r || (r = /* @__PURE__ */ new Set(), $.elementSequenceMap.set(o, r)), r.add(n);
3095
+ let r = w.elementSequenceMap.get(o);
3096
+ r || (r = /* @__PURE__ */ new Set(), w.elementSequenceMap.set(o, r)), r.add(n);
3054
3097
  }
3055
3098
  }
3056
3099
  }
3057
3100
  static removeFromSequences(t) {
3058
3101
  for (const n of t) {
3059
- const s = $.elementSequenceMap.get(n);
3102
+ const s = w.elementSequenceMap.get(n);
3060
3103
  if (s) {
3061
3104
  for (const i of s)
3062
3105
  i.removeGroups(
3063
3106
  (o) => o.animations.some((r) => r.effect?.target === n)
3064
3107
  );
3065
- $.elementSequenceMap.delete(n);
3108
+ w.elementSequenceMap.delete(n);
3066
3109
  }
3067
3110
  }
3068
3111
  }
3069
3112
  }
3070
- let Mi = 0;
3071
- function G(e, {
3113
+ let Pi = 0;
3114
+ function W(e, {
3072
3115
  asCombinator: t = !1,
3073
3116
  addItemFilter: n = !1,
3074
3117
  useFirstChild: s = !1
@@ -3080,10 +3123,10 @@ function G(e, {
3080
3123
  return e.selector;
3081
3124
  return s ? t ? "> :first-child" : ":scope > :first-child" : "";
3082
3125
  }
3083
- function ot(e) {
3126
+ function ct(e) {
3084
3127
  return "sequenceId" in e && !("effects" in e);
3085
3128
  }
3086
- function _e(e, t) {
3129
+ function Ae(e, t) {
3087
3130
  return e[t] || (e[t] = {
3088
3131
  triggers: [],
3089
3132
  effects: {},
@@ -3092,7 +3135,7 @@ function _e(e, t) {
3092
3135
  selectors: /* @__PURE__ */ new Set()
3093
3136
  }), e[t];
3094
3137
  }
3095
- function ki(e, t, n) {
3138
+ function Li(e, t, n) {
3096
3139
  const { effects: s = [] } = e;
3097
3140
  return s.some((i, o) => n.has(t(o))) ? {
3098
3141
  ...e,
@@ -3102,60 +3145,60 @@ function ki(e, t, n) {
3102
3145
  })
3103
3146
  } : e;
3104
3147
  }
3105
- function qi(e, t = !1, n) {
3106
- const { effects: s = {}, sequences: i = {}, conditions: o = {} } = e, r = {}, c = e.interactions ? Ft(e, n) : /* @__PURE__ */ new Map();
3107
- return e.interactions?.forEach((l, u) => {
3108
- const a = l.key, f = ++Mi, { effects: d, sequences: h, ...m } = l;
3148
+ function Fi(e, t = !1, n) {
3149
+ const { effects: s = {}, sequences: i = {}, conditions: o = {} } = e, r = {}, c = e.interactions ? xt(e, n) : /* @__PURE__ */ new Map();
3150
+ return e.interactions?.forEach((l, f) => {
3151
+ const a = l.key, u = ++Pi, { effects: d, sequences: h, ...p } = l;
3109
3152
  if (!a) {
3110
- console.error(`Interaction ${f} is missing a key for source element.`);
3153
+ console.error(`Interaction ${u} is missing a key for source element.`);
3111
3154
  return;
3112
3155
  }
3113
- _e(r, a);
3114
- const p = d ? Array.from(d) : [];
3115
- p.reverse();
3116
- const g = h?.map((v, w) => {
3117
- if (ot(v)) {
3156
+ Ae(r, a);
3157
+ const m = d ? Array.from(d) : [];
3158
+ m.reverse();
3159
+ const g = h?.map((v, $) => {
3160
+ if (ct(v)) {
3118
3161
  const S = i[v.sequenceId];
3119
3162
  return S ? { ...S, ...v } : (console.warn(`Interact: Sequence "${v.sequenceId}" not found in config`), v);
3120
3163
  }
3121
3164
  const b = v;
3122
- return b.sequenceId || (b.sequenceId = Q("seq", [u, w], n)), b;
3123
- }), y = {
3124
- ...m,
3125
- effects: p.length > 0 ? p : void 0,
3165
+ return b.sequenceId || (b.sequenceId = Z("seq", [f, $], n)), b;
3166
+ }), E = {
3167
+ ...p,
3168
+ effects: m.length > 0 ? m : void 0,
3126
3169
  sequences: g?.map(
3127
- (v, w) => ki(
3170
+ (v, $) => Li(
3128
3171
  v,
3129
- (b) => ve(u, b, w),
3172
+ (b) => ye(f, b, $),
3130
3173
  c
3131
3174
  )
3132
3175
  )
3133
3176
  };
3134
- r[a].triggers.push(y), r[a].selectors.add(
3135
- G(y, { useFirstChild: t })
3177
+ r[a].triggers.push(E), r[a].selectors.add(
3178
+ W(E, { useFirstChild: t })
3136
3179
  );
3137
- const E = y.listContainer;
3138
- p.forEach((v, w) => {
3180
+ const y = E.listContainer;
3181
+ m.forEach((v, $) => {
3139
3182
  const b = v.effectId ? s[v.effectId] : void 0;
3140
3183
  let S = v.key || b?.key;
3141
- const I = p.length - 1 - w;
3142
- v.effectId || (v.effectId = Q(
3184
+ const I = m.length - 1 - $;
3185
+ v.effectId || (v.effectId = Z(
3143
3186
  "eff",
3144
- [u, I],
3187
+ [f, I],
3145
3188
  n
3146
3189
  ));
3147
- const O = c.get(ve(u, I));
3148
- if (O && (v.suffix = O), S = S || a, v.key = S, E && v.listContainer && (S !== a || v.listContainer !== E))
3190
+ const O = c.get(ye(f, I));
3191
+ if (O && (v.suffix = O), S = S || a, v.key = S, y && v.listContainer && (S !== a || v.listContainer !== y))
3149
3192
  return;
3150
- const M = W({ ...b, ...v, key: S }), T = `${a}::${M}::${f}`;
3193
+ const M = V({ ...b, ...v, key: S }), T = `${a}::${M}::${u}`;
3151
3194
  if (v.interactionId = T, r[a].interactionIds.add(T), S === a)
3152
3195
  return;
3153
- const C = _e(r, S);
3154
- C.effects[T] || (C.effects[T] = [], C.interactionIds.add(T)), C.effects[T].push({ ...m, effect: v }), C.selectors.add(G(v, { useFirstChild: t }));
3196
+ const C = Ae(r, S);
3197
+ C.effects[T] || (C.effects[T] = [], C.interactionIds.add(T)), C.effects[T].push({ ...p, effect: v }), C.selectors.add(W(v, { useFirstChild: t }));
3155
3198
  }), g?.forEach((v) => {
3156
- if (!v || ot(v)) return;
3157
- const w = v, b = w.sequenceId;
3158
- w.effects.forEach((I, O) => {
3199
+ if (!v || ct(v)) return;
3200
+ const $ = v, b = $.sequenceId;
3201
+ $.effects.forEach((I, O) => {
3159
3202
  I.effectId || (I.effectId = `eff-${b}-${O}`);
3160
3203
  let M = I.key;
3161
3204
  if (!M && I.effectId) {
@@ -3163,12 +3206,12 @@ function qi(e, t = !1, n) {
3163
3206
  C && (M = C.key);
3164
3207
  }
3165
3208
  M = M || a;
3166
- const T = G(I, { useFirstChild: t });
3209
+ const T = W(I, { useFirstChild: t });
3167
3210
  if (T && r[a].selectors.add(T), M !== a) {
3168
- const C = _e(r, M), _ = `${M}::seq::${b}::${f}`;
3211
+ const C = Ae(r, M), _ = `${M}::seq::${b}::${u}`;
3169
3212
  C.sequences[_] || (C.sequences[_] = [], C.interactionIds.add(_)), C.sequences[_].push({
3170
- ...m,
3171
- sequence: w
3213
+ ...p,
3214
+ sequence: $
3172
3215
  }), C.selectors.add(T);
3173
3216
  }
3174
3217
  });
@@ -3180,10 +3223,10 @@ function qi(e, t = !1, n) {
3180
3223
  interactions: r
3181
3224
  };
3182
3225
  }
3183
- function Se(e, t, n, s, i) {
3184
- const o = $.getPluginsNames();
3226
+ function Ie(e, t, n, s, i) {
3227
+ const o = w.getPluginsNames();
3185
3228
  for (const r of o) {
3186
- const c = `${at}${r}`;
3229
+ const c = `${He}${r}`;
3187
3230
  if (!(c in n))
3188
3231
  continue;
3189
3232
  const l = n[c];
@@ -3192,11 +3235,17 @@ function Se(e, t, n, s, i) {
3192
3235
  continue;
3193
3236
  e._appliedPlugins.add(l);
3194
3237
  }
3195
- const a = $.getPlugin(r)(l, { root: t, key: s, scope: i, config: n });
3238
+ const a = w.getPlugin(r)(l, { root: t, key: s, scope: i, config: n });
3196
3239
  typeof a == "function" && e._pluginCleanups.push(a);
3197
3240
  }
3198
3241
  }
3199
- function we(e, t, n) {
3242
+ function D(e, t) {
3243
+ for (const n of w.getPluginsNames())
3244
+ if (`${He}${n}` in t && !w._isPluginReleased(n, e))
3245
+ return !0;
3246
+ return !1;
3247
+ }
3248
+ function $e(e, t, n) {
3200
3249
  if (e.listContainer) {
3201
3250
  const s = t.querySelector(e.listContainer);
3202
3251
  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}"`), []);
@@ -3209,20 +3258,20 @@ function we(e, t, n) {
3209
3258
  }
3210
3259
  return n ? t.firstElementChild : t;
3211
3260
  }
3212
- function $e(e, t) {
3261
+ function be(e, t) {
3213
3262
  return t.map((n) => e.selector ? n.querySelector(e.selector) : n).filter(Boolean);
3214
3263
  }
3215
- function Dt(e, t, n, s, i, o, r, c) {
3264
+ function Wt(e, t, n, s, i, o, r, c) {
3216
3265
  return [
3217
- r ? $e(e, r) : we(e, n, s),
3218
- c ? $e(t, c) : we(t, i, o)
3266
+ r ? be(e, r) : $e(e, n, s),
3267
+ c ? be(t, c) : $e(t, i, o)
3219
3268
  ];
3220
3269
  }
3221
- function Gt(e, t, n, s, i, o, r, c) {
3222
- const l = Array.isArray(s), u = Array.isArray(i);
3223
- l ? s.forEach((a, f) => {
3224
- const d = u ? i[f] : i;
3225
- d && rt(
3270
+ function Vt(e, t, n, s, i, o, r, c) {
3271
+ const l = Array.isArray(s), f = Array.isArray(i);
3272
+ l ? s.forEach((a, u) => {
3273
+ const d = f ? i[u] : i;
3274
+ d && lt(
3226
3275
  e,
3227
3276
  a,
3228
3277
  t.trigger,
@@ -3233,12 +3282,12 @@ function Gt(e, t, n, s, i, o, r, c) {
3233
3282
  r,
3234
3283
  c
3235
3284
  );
3236
- }) : (u ? i : [i]).forEach((f) => {
3237
- rt(
3285
+ }) : (f ? i : [i]).forEach((u) => {
3286
+ lt(
3238
3287
  e,
3239
3288
  s,
3240
3289
  t.trigger,
3241
- f,
3290
+ u,
3242
3291
  n,
3243
3292
  t.params,
3244
3293
  o,
@@ -3247,136 +3296,146 @@ function Gt(e, t, n, s, i, o, r, c) {
3247
3296
  );
3248
3297
  });
3249
3298
  }
3250
- function Wt(e, t, n, s, i) {
3299
+ function Kt(e, t, n, s, i) {
3251
3300
  const o = {}, r = [];
3252
3301
  (s.effects || []).forEach((c, l) => {
3253
- const u = c.effectId, a = {
3254
- ...n.dataCache.effects[u] || {},
3302
+ const f = c.effectId, a = {
3303
+ ...n.dataCache.effects[f] || {},
3255
3304
  ...c,
3256
- effectId: u
3257
- }, f = a.key, d = q(c.interactionId, e);
3305
+ effectId: f
3306
+ }, u = a.key, d = k(c.interactionId, e);
3258
3307
  if (o[d] || n.addedInteractions[d] && !i)
3259
3308
  return;
3260
- const h = F(a.conditions || [], n.dataCache.conditions);
3309
+ const h = P(a.conditions || [], n.dataCache.conditions);
3261
3310
  if (h && n.setupMediaQueryListener(`${d}::${l}`, h, e, () => {
3262
3311
  t.update();
3263
3312
  }), !h || h.matches) {
3264
3313
  o[d] = !0;
3265
- const m = f && q(f, e);
3266
- let p;
3267
- if (m) {
3268
- if (p = $.getController(m), !p)
3314
+ const p = u && k(u, e);
3315
+ let m;
3316
+ if (p) {
3317
+ if (m = w.getController(p), !m)
3269
3318
  return;
3270
- a.listContainer && p.watchChildList(a.listContainer);
3319
+ a.listContainer && m.watchChildList(a.listContainer);
3271
3320
  } else
3272
- p = t;
3273
- Se(
3274
- p,
3275
- p.element,
3321
+ m = t;
3322
+ if (D(p || s.key, a))
3323
+ return;
3324
+ Ie(
3325
+ m,
3326
+ m.element,
3276
3327
  a,
3277
- m || s.key,
3328
+ p || s.key,
3278
3329
  "effect"
3279
3330
  );
3280
- const [g, y] = Dt(
3331
+ const [g, E] = Wt(
3281
3332
  s,
3282
3333
  a,
3283
3334
  t.element,
3284
3335
  t.useFirstChild,
3285
- p.element,
3286
- p.useFirstChild,
3336
+ m.element,
3337
+ m.useFirstChild,
3287
3338
  i
3288
3339
  );
3289
- if (!g || !y)
3340
+ if (!g || !E)
3290
3341
  return;
3291
3342
  n.addedInteractions[d] = !0;
3292
- const E = m || s.key, v = R(
3343
+ const y = p || s.key, v = R(
3293
3344
  a.conditions || [],
3294
3345
  n.dataCache.conditions
3295
3346
  );
3296
3347
  r.push([
3297
- E,
3348
+ y,
3298
3349
  s,
3299
3350
  a,
3300
3351
  g,
3301
- y,
3352
+ E,
3302
3353
  v,
3303
- p.useFirstChild,
3354
+ m.useFirstChild,
3304
3355
  e
3305
3356
  ]);
3306
3357
  }
3307
3358
  }), r.reverse().forEach((c) => {
3308
- Gt(...c);
3309
- }), Li(e, t, n, s, i);
3359
+ Vt(...c);
3360
+ }), xi(e, t, n, s, i);
3310
3361
  }
3311
- function Pi(e) {
3362
+ function Ri(e) {
3312
3363
  return "sequenceId" in e && !("effects" in e);
3313
3364
  }
3314
- function Vt(e, t, n, s, i, o, r) {
3315
- const c = F(e.conditions || [], i.dataCache.conditions);
3365
+ function Yt(e, t, n, s, i, o, r) {
3366
+ const c = P(e.conditions || [], i.dataCache.conditions);
3316
3367
  if (c && i.setupMediaQueryListener(t, c, o.updateKey, o.onUpdate), c && !c.matches) return null;
3317
- const l = e.effects || [], u = [];
3318
- let a = !1;
3319
- for (const f of l) {
3320
- const d = f.effectId, m = {
3321
- ...d ? i.dataCache.effects[d] || {} : {},
3322
- ...f
3323
- }, p = F(m.conditions || [], i.dataCache.conditions);
3324
- if (p) {
3325
- const S = `${t}::${d || "eff"}`;
3368
+ const l = e.effects || [], f = (h) => {
3369
+ const p = h.effectId;
3370
+ return { ...p ? i.dataCache.effects[p] || {} : {}, ...h };
3371
+ };
3372
+ if (l.some((h) => {
3373
+ const p = f(h), m = P(p.conditions || [], i.dataCache.conditions);
3374
+ if (m && !m.matches) return !1;
3375
+ const g = p.key && k(p.key, n);
3376
+ return D(g || n, p);
3377
+ }))
3378
+ return null;
3379
+ const u = [];
3380
+ let d = !1;
3381
+ for (const h of l) {
3382
+ const p = h.effectId, m = f(h), g = P(m.conditions || [], i.dataCache.conditions);
3383
+ if (g) {
3384
+ const I = `${t}::${p || "eff"}`;
3326
3385
  i.setupMediaQueryListener(
3327
- S,
3328
- p,
3386
+ I,
3387
+ g,
3329
3388
  o.updateKey,
3330
3389
  o.onUpdate
3331
3390
  );
3332
3391
  }
3333
- if (p && !p.matches) continue;
3334
- const g = m.key, y = g && q(g, n);
3335
- let E;
3392
+ if (g && !g.matches) continue;
3393
+ const E = m.key, y = E && k(E, n);
3394
+ let v;
3336
3395
  if (y) {
3337
- if (E = $.getController(y), !E) return null;
3396
+ if (v = w.getController(y), !v) return null;
3338
3397
  } else
3339
- E = s;
3340
- const v = y || n;
3341
- Se(
3342
- E,
3343
- E.element,
3344
- m,
3398
+ v = s;
3399
+ const $ = y || n;
3400
+ Ie(
3345
3401
  v,
3402
+ v.element,
3403
+ m,
3404
+ $,
3346
3405
  "effect"
3347
3406
  );
3348
- let w;
3349
- if (r && v === r.controllerKey && m.listContainer === r.listContainer ? (w = $e(m, r.elements), w.length > 0 && (a = !0)) : w = we(
3407
+ let b;
3408
+ if (r && $ === r.controllerKey && m.listContainer === r.listContainer ? (b = be(m, r.elements), b.length > 0 && (d = !0)) : b = $e(
3350
3409
  m,
3351
- E.element,
3352
- E.useFirstChild
3353
- ), !w || Array.isArray(w) && w.length === 0) return null;
3354
- const b = x(m);
3355
- u.push({ target: w, options: b });
3410
+ v.element,
3411
+ v.useFirstChild
3412
+ ), !b || Array.isArray(b) && b.length === 0) return null;
3413
+ const S = x(m);
3414
+ u.push({ target: b, options: S });
3356
3415
  }
3357
- return r && !a ? null : u.length > 0 ? u : null;
3416
+ return r && !d ? null : u.length > 0 ? u : null;
3358
3417
  }
3359
- function je(e, t, n) {
3360
- const s = n ? $e(e, n) : we(e, t.element, t.useFirstChild);
3418
+ function De(e, t, n) {
3419
+ const s = n ? be(e, n) : $e(e, t.element, t.useFirstChild);
3361
3420
  return Array.isArray(s) && s.length === 0 ? null : s;
3362
3421
  }
3363
3422
  function ze(e, t, n, s, i) {
3364
3423
  (Array.isArray(n) ? n : [n]).forEach((r) => {
3365
- D[e.trigger]?.add(
3424
+ G[e.trigger]?.add(
3366
3425
  r,
3367
3426
  r,
3368
3427
  { triggerType: t.triggerType },
3369
3428
  e.params || {},
3370
3429
  {
3371
- reducedMotion: $.forceReducedMotion,
3430
+ reducedMotion: w.forceReducedMotion,
3372
3431
  selectorCondition: i,
3373
3432
  animation: s,
3374
- allowA11yTriggers: $.allowA11yTriggers
3433
+ allowA11yTriggers: w.allowA11yTriggers
3375
3434
  }
3376
3435
  );
3377
3436
  });
3378
3437
  }
3379
- function Kt(e, t, n) {
3438
+ function Bt(e, t, n) {
3380
3439
  const o = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
3381
3440
  if (!o) return n.map((c, l) => l);
3382
3441
  const r = Array.from(o.children);
@@ -3385,159 +3444,165 @@ function Kt(e, t, n) {
3385
3444
  return l >= 0 ? l : r.length;
3386
3445
  });
3387
3446
  }
3388
- function Li(e, t, n, s, i) {
3447
+ function xi(e, t, n, s, i) {
3389
3448
  s.sequences?.forEach((o) => {
3390
3449
  let r;
3391
- if (Pi(o)) {
3392
- const m = n.dataCache.sequences[o.sequenceId];
3393
- if (!m) {
3450
+ if (Ri(o)) {
3451
+ const p = n.dataCache.sequences[o.sequenceId];
3452
+ if (!p) {
3394
3453
  console.warn(`Interact: Sequence "${o.sequenceId}" not found in cache`);
3395
3454
  return;
3396
3455
  }
3397
- r = { ...m, ...o };
3456
+ r = { ...p, ...o };
3398
3457
  } else
3399
3458
  r = o;
3400
- const c = r.sequenceId || ee(), l = q(`${e}::seq::${c}`, e);
3459
+ const c = r.sequenceId || te(), l = k(`${e}::seq::${c}`, e);
3401
3460
  if (n.addedInteractions[l] && !i) return;
3402
- const u = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0, a = Vt(
3461
+ const f = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0, a = Yt(
3403
3462
  r,
3404
3463
  l,
3405
3464
  e,
3406
3465
  t,
3407
3466
  n,
3408
- { updateKey: e, onUpdate: () => t.update() },
3409
- u
3467
+ {
3468
+ updateKey: e,
3469
+ onUpdate: () => t.update()
3470
+ },
3471
+ f
3410
3472
  );
3411
3473
  if (!a) return;
3412
3474
  if (i && n.addedInteractions[l]) {
3413
- const m = Kt(
3475
+ const p = Bt(
3414
3476
  t,
3415
3477
  s.listContainer,
3416
3478
  i
3417
3479
  );
3418
- $.addToSequence(l, a, m, {
3419
- reducedMotion: $.forceReducedMotion
3480
+ w.addToSequence(l, a, p, {
3481
+ reducedMotion: w.forceReducedMotion
3420
3482
  });
3421
- const p = $.getSequence(l, r, a, {
3422
- reducedMotion: $.forceReducedMotion
3483
+ const m = w.getSequence(l, r, a, {
3484
+ reducedMotion: w.forceReducedMotion
3423
3485
  }), g = R(
3424
3486
  s.conditions || [],
3425
3487
  n.dataCache.conditions
3426
- ), y = je(s, t, i);
3427
- y && ze(
3488
+ ), E = De(s, t, i);
3489
+ E && ze(
3428
3490
  s,
3429
3491
  r,
3430
- y,
3431
- p,
3492
+ E,
3493
+ m,
3432
3494
  g
3433
3495
  );
3434
3496
  return;
3435
3497
  }
3436
- const f = $.getSequence(l, r, a, {
3437
- reducedMotion: $.forceReducedMotion
3498
+ const u = w.getSequence(l, r, a, {
3499
+ reducedMotion: w.forceReducedMotion
3438
3500
  }), d = R(
3439
3501
  s.conditions || [],
3440
3502
  n.dataCache.conditions
3441
- ), h = je(s, t, i);
3503
+ ), h = De(s, t, i);
3442
3504
  h && (n.addedInteractions[l] = !0, ze(
3443
3505
  s,
3444
3506
  r,
3445
3507
  h,
3446
- f,
3508
+ u,
3447
3509
  d
3448
3510
  ));
3449
3511
  });
3450
3512
  }
3451
- function Fi(e, t, n, s, i) {
3513
+ function Ni(e, t, n, s, i) {
3452
3514
  const o = n.get(e)?.sequences || {};
3453
3515
  Object.keys(o).forEach((c) => {
3454
- o[c].some(({ sequence: u, ...a }) => {
3455
- const f = F(
3516
+ o[c].some(({ sequence: f, ...a }) => {
3517
+ const u = P(
3456
3518
  a.conditions || [],
3457
3519
  n.dataCache.conditions
3458
3520
  );
3459
- if (f && !f.matches)
3521
+ if (u && !u.matches)
3460
3522
  return !1;
3461
- const d = a.key && q(a.key, e), h = $.getController(d);
3523
+ const d = a.key && k(a.key, e), h = w.getController(d);
3462
3524
  if (!h)
3463
3525
  return !0;
3464
- const m = u.sequenceId || ee(), p = q(`${d}::seq::${m}`, d);
3465
- if (n.addedInteractions[p] && !i)
3526
+ const p = f.sequenceId || te(), m = k(`${d}::seq::${p}`, d);
3527
+ if (n.addedInteractions[m] && !i || D(d, a))
3466
3528
  return !0;
3467
- const y = Vt(
3468
- u,
3469
- p,
3529
+ const E = Yt(
3530
+ f,
3531
+ m,
3470
3532
  d,
3471
3533
  h,
3472
3534
  n,
3473
- { updateKey: e, onUpdate: () => t.update() },
3535
+ {
3536
+ updateKey: e,
3537
+ onUpdate: () => t.update()
3538
+ },
3474
3539
  i && s ? { controllerKey: e, listContainer: s, elements: i } : void 0
3475
3540
  );
3476
- if (!y) return !0;
3477
- if (i && n.addedInteractions[p]) {
3478
- const b = Kt(t, s, i);
3479
- return $.addToSequence(p, y, b, {
3480
- reducedMotion: $.forceReducedMotion
3541
+ if (!E) return !0;
3542
+ if (i && n.addedInteractions[m]) {
3543
+ const b = Bt(t, s, i);
3544
+ return w.addToSequence(m, E, b, {
3545
+ reducedMotion: w.forceReducedMotion
3481
3546
  }), !0;
3482
3547
  }
3483
- const E = $.getSequence(p, u, y, {
3484
- reducedMotion: $.forceReducedMotion
3548
+ const y = w.getSequence(m, f, E, {
3549
+ reducedMotion: w.forceReducedMotion
3485
3550
  }), v = R(
3486
3551
  a.conditions || [],
3487
3552
  n.dataCache.conditions
3488
- ), w = je(a, h);
3489
- return w && (n.addedInteractions[p] = !0, ze(
3553
+ ), $ = De(a, h);
3554
+ return $ && (n.addedInteractions[m] = !0, ze(
3490
3555
  a,
3491
- u,
3492
- w,
3493
- E,
3556
+ f,
3557
+ $,
3558
+ y,
3494
3559
  v
3495
3560
  )), !0;
3496
3561
  });
3497
3562
  });
3498
3563
  }
3499
- function Yt(e, t, n, s, i) {
3564
+ function Ut(e, t, n, s, i) {
3500
3565
  const o = n.get(e), r = o?.effects || {}, c = Object.keys(r), l = [];
3501
3566
  c.forEach((a) => {
3502
- const f = q(a, e);
3503
- if (n.addedInteractions[f] && !i)
3567
+ const u = k(a, e);
3568
+ if (n.addedInteractions[u] && !i)
3504
3569
  return;
3505
- r[a].some(({ effect: h, ...m }, p) => {
3506
- const g = F(
3507
- m.conditions || [],
3570
+ r[a].some(({ effect: h, ...p }, m) => {
3571
+ const g = P(
3572
+ p.conditions || [],
3508
3573
  n.dataCache.conditions
3509
3574
  );
3510
3575
  if (g && !g.matches)
3511
3576
  return !1;
3512
- const y = h.effectId, E = {
3513
- ...n.dataCache.effects[y] || {},
3577
+ const E = h.effectId, y = {
3578
+ ...n.dataCache.effects[E] || {},
3514
3579
  ...h,
3515
- effectId: y
3580
+ effectId: E
3516
3581
  };
3517
- if (s && E.listContainer !== s)
3582
+ if (s && y.listContainer !== s)
3518
3583
  return !1;
3519
- const v = F(E.conditions || [], n.dataCache.conditions);
3584
+ const v = P(y.conditions || [], n.dataCache.conditions);
3520
3585
  if (v && n.setupMediaQueryListener(
3521
- `${f}::${p}`,
3586
+ `${u}::${m}`,
3522
3587
  v,
3523
3588
  e,
3524
3589
  () => {
3525
3590
  t.update();
3526
3591
  }
3527
3592
  ), !v || v.matches) {
3528
- const w = m.key && q(m.key, e), b = $.getController(w);
3529
- if (!b)
3593
+ const $ = p.key && k(p.key, e), b = w.getController($);
3594
+ if (!b || D($, p) || D(e, y))
3530
3595
  return !0;
3531
- Se(
3596
+ Ie(
3532
3597
  t,
3533
3598
  t.element,
3534
- E,
3599
+ y,
3535
3600
  e,
3536
3601
  "effect"
3537
- ), E.listContainer && t.watchChildList(E.listContainer);
3538
- const [S, I] = Dt(
3539
- m,
3540
- E,
3602
+ ), y.listContainer && t.watchChildList(y.listContainer);
3603
+ const [S, I] = Wt(
3604
+ p,
3605
+ y,
3541
3606
  b.element,
3542
3607
  b.useFirstChild,
3543
3608
  t.element,
@@ -3547,115 +3612,123 @@ function Yt(e, t, n, s, i) {
3547
3612
  );
3548
3613
  if (!S || !I)
3549
3614
  return !0;
3550
- n.addedInteractions[f] = !0;
3615
+ n.addedInteractions[u] = !0;
3551
3616
  const O = R(
3552
- E.conditions || [],
3617
+ y.conditions || [],
3553
3618
  n.dataCache.conditions
3554
3619
  );
3555
3620
  return l.push([
3556
3621
  e,
3557
- m,
3558
- E,
3622
+ p,
3623
+ y,
3559
3624
  S,
3560
3625
  I,
3561
3626
  O,
3562
3627
  t.useFirstChild,
3563
- w || void 0
3628
+ $ || void 0
3564
3629
  ]), !0;
3565
3630
  }
3566
3631
  return !1;
3567
3632
  });
3568
3633
  }), l.reverse().forEach((a) => {
3569
- Gt(...a);
3570
- }), Fi(e, t, n, s, i);
3571
- const u = Object.keys(o?.sequences || {}).length > 0;
3572
- return c.length > 0 || u;
3634
+ Vt(...a);
3635
+ }), Ni(e, t, n, s, i);
3636
+ const f = Object.keys(o?.sequences || {}).length > 0;
3637
+ return c.length > 0 || f;
3573
3638
  }
3574
- function rt(e, t, n, s, i, o, r, c, l) {
3575
- let u;
3639
+ function lt(e, t, n, s, i, o, r, c, l) {
3640
+ let f;
3576
3641
  if (i.transition || i.transitionProperties) {
3577
- const f = {
3642
+ const u = {
3578
3643
  key: e,
3579
3644
  effectId: i.effectId,
3580
3645
  transition: i.transition,
3581
3646
  transitionProperties: i.transitionProperties,
3582
- childSelector: G(i, {
3647
+ childSelector: W(i, {
3583
3648
  asCombinator: !0,
3584
3649
  addItemFilter: !0,
3585
3650
  useFirstChild: c
3586
3651
  }),
3587
3652
  selectorCondition: r
3588
3653
  };
3589
- if (u = $.getController(e), !u)
3654
+ if (f = w.getController(e), !f)
3590
3655
  return;
3591
- u.renderStyle(Qn(f));
3656
+ f.renderStyle(Zn(u));
3592
3657
  }
3593
3658
  let a;
3594
3659
  if (n === "animationEnd") {
3595
- const f = o.effectId, h = (l ? $.getInstance(l) : void 0)?.dataCache.effects[f];
3660
+ const u = o.effectId, h = (l ? w.getInstance(l) : void 0)?.dataCache.effects[u];
3596
3661
  h && (a = x(h));
3597
3662
  }
3598
- D[n]?.add(t, s, i, o, {
3599
- reducedMotion: $.forceReducedMotion,
3600
- targetController: u,
3663
+ G[n]?.add(t, s, i, o, {
3664
+ reducedMotion: w.forceReducedMotion,
3665
+ targetController: f,
3601
3666
  selectorCondition: r,
3602
- allowA11yTriggers: $.allowA11yTriggers,
3667
+ allowA11yTriggers: w.allowA11yTriggers,
3603
3668
  sourceAnimationOptions: a
3604
3669
  });
3605
3670
  }
3606
- function Ri(e) {
3607
- const t = e.key, n = $.getInstance(t);
3671
+ function ft(e) {
3672
+ const t = e.key, n = w.getInstance(t);
3608
3673
  if (!n)
3609
- return console.warn(`No instance found for key: ${t}`), $.setController(t, e), !1;
3674
+ return console.warn(`No instance found for key: ${t}`), w.setController(t, e), !1;
3610
3675
  const { triggers: s = [] } = n?.get(t) || {}, i = s.length > 0;
3611
3676
  n.setController(t, e), s.forEach((r, c) => {
3612
- const l = F(r.conditions, n.dataCache.conditions);
3677
+ const l = P(r.conditions, n.dataCache.conditions);
3613
3678
  if (l) {
3614
- const u = `${t}::trigger::${c}`;
3615
- n.setupMediaQueryListener(u, l, t, () => {
3679
+ const f = `${t}::trigger::${c}`;
3680
+ n.setupMediaQueryListener(f, l, t, () => {
3616
3681
  e.update();
3617
3682
  });
3618
3683
  }
3619
- (!l || l.matches) && (Se(e, e.element, r, t, "interaction"), r.listContainer && e.watchChildList(r.listContainer), Wt(t, e, n, r));
3684
+ if (!l || l.matches) {
3685
+ if (D(t, r))
3686
+ return;
3687
+ Ie(e, e.element, r, t, "interaction"), r.listContainer && e.watchChildList(r.listContainer), Kt(t, e, n, r);
3688
+ }
3620
3689
  });
3621
3690
  let o = !1;
3622
- return n && (o = Yt(t, e, n)), i || o;
3691
+ return n && (o = Ut(t, e, n)), i || o;
3623
3692
  }
3624
- function xi(e, t, n) {
3625
- const s = e.key, i = $.getInstance(s);
3693
+ function ji(e, t, n) {
3694
+ const s = e.key, i = w.getInstance(s);
3626
3695
  if (i) {
3627
3696
  const { triggers: o = [] } = i?.get(s) || {};
3628
3697
  o.forEach((r, c) => {
3629
3698
  if (r.listContainer !== t)
3630
3699
  return;
3631
- const l = F(r.conditions, i.dataCache.conditions);
3700
+ const l = P(r.conditions, i.dataCache.conditions);
3632
3701
  if (l) {
3633
- const u = `${s}::listTrigger::${t}::${c}`;
3634
- i.setupMediaQueryListener(u, l, s, () => {
3702
+ const f = `${s}::listTrigger::${t}::${c}`;
3703
+ i.setupMediaQueryListener(f, l, s, () => {
3635
3704
  e.update();
3636
3705
  });
3637
3706
  }
3638
- (!l || l.matches) && Wt(s, e, i, r, n);
3639
- }), Yt(s, e, i, t, n);
3707
+ if (!l || l.matches) {
3708
+ if (D(s, r))
3709
+ return;
3710
+ Kt(s, e, i, r, n);
3711
+ }
3712
+ }), Ut(s, e, i, t, n);
3640
3713
  }
3641
3714
  }
3642
- function Ni(e, t = !1) {
3643
- const n = e.key, s = $.getInstance(n);
3715
+ function Di(e, t = !1) {
3716
+ const n = e.key, s = w.getInstance(n);
3644
3717
  if (!s)
3645
3718
  return;
3646
3719
  const i = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
3647
3720
  let o;
3648
- i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element], Bt(o), s.deleteController(n, t);
3721
+ i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element], Qt(o), s.deleteController(n, t);
3649
3722
  }
3650
- function Bt(e) {
3651
- const t = Object.values(D);
3723
+ function Qt(e) {
3724
+ const t = Object.values(G);
3652
3725
  for (const n of e)
3653
3726
  for (const s of t)
3654
3727
  s.remove(n);
3655
- $.removeFromSequences(e);
3728
+ w.removeFromSequences(e);
3656
3729
  }
3657
- const Ae = "interactEffect";
3658
- class ji {
3730
+ const Me = "interactEffect";
3731
+ class zi {
3659
3732
  element;
3660
3733
  key;
3661
3734
  connected;
@@ -3677,10 +3750,10 @@ class ji {
3677
3750
  }
3678
3751
  n !== t && (n && console.warn(
3679
3752
  `Interact: Key mismatch between element ${n} and parameter ${t}, updating element key`
3680
- ), this.element.dataset.interactKey = t), this.key = t, this.connected = Ri(this);
3753
+ ), this.element.dataset.interactKey = t), this.key = t, this.connected = ft(this);
3681
3754
  }
3682
3755
  disconnect({ removeFromCache: t = !1 } = {}) {
3683
- if ((this.key || this.element.dataset.interactKey) && Ni(this, t), this._pluginCleanups.length) {
3756
+ if ((this.key || this.element.dataset.interactKey) && Di(this, t), this._pluginCleanups.length) {
3684
3757
  for (const s of this._pluginCleanups)
3685
3758
  try {
3686
3759
  s();
@@ -3700,6 +3773,9 @@ class ji {
3700
3773
  update() {
3701
3774
  this.disconnect(), this.connect();
3702
3775
  }
3776
+ resume() {
3777
+ this.connected && ft(this);
3778
+ }
3703
3779
  renderStyle(t) {
3704
3780
  const n = this.element?.getRootNode(), s = n.host ? n : document;
3705
3781
  if (!this.sheet)
@@ -3723,12 +3799,12 @@ class ji {
3723
3799
  return;
3724
3800
  }
3725
3801
  const o = new Set(
3726
- this.element.dataset[Ae]?.split(" ") || []
3802
+ this.element.dataset[Me]?.split(" ") || []
3727
3803
  );
3728
- n === "toggle" ? o.has(t) ? o.delete(t) : o.add(t) : n === "add" ? o.add(t) : n === "remove" ? o.delete(t) : n === "clear" && o.clear(), (s || this.element).dataset[Ae] = Array.from(o).join(" ");
3804
+ n === "toggle" ? o.has(t) ? o.delete(t) : o.add(t) : n === "add" ? o.add(t) : n === "remove" ? o.delete(t) : n === "clear" && o.clear(), (s || this.element).dataset[Me] = Array.from(o).join(" ");
3729
3805
  }
3730
3806
  getActiveEffects() {
3731
- const n = (this.element.dataset[Ae] || "").trim();
3807
+ const n = (this.element.dataset[Me] || "").trim();
3732
3808
  return n ? n.split(/\s+/) : [];
3733
3809
  }
3734
3810
  watchChildList(t) {
@@ -3746,21 +3822,21 @@ class ji {
3746
3822
  }), r.addedNodes.forEach((c) => {
3747
3823
  c instanceof HTMLElement && o.push(c);
3748
3824
  });
3749
- }), Bt(i), s && xi(this, t, o);
3825
+ }), Qt(i), s && ji(this, t, o);
3750
3826
  }
3751
3827
  }
3752
- function Hi(e, t) {
3753
- new ji(e, t).connect();
3828
+ function Gi(e, t) {
3829
+ new zi(e, t).connect();
3754
3830
  }
3755
- function Di(e) {
3756
- const t = $.getController(e);
3831
+ function Wi(e) {
3832
+ const t = w.getController(e);
3757
3833
  t && t.disconnect({ removeFromCache: !0 });
3758
3834
  }
3759
3835
  export {
3760
- ji as I,
3761
- $ as a,
3762
- Hi as b,
3763
- zi as g,
3764
- Di as r
3836
+ zi as I,
3837
+ w as a,
3838
+ Gi as b,
3839
+ Hi as g,
3840
+ Wi as r
3765
3841
  };
3766
- //# sourceMappingURL=index-1AmVTHDV.mjs.map
3842
+ //# sourceMappingURL=index-76zNBcNy.mjs.map