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