@wix/interact 2.5.24 → 2.5.25
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/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-1AmVTHDV.mjs} +1265 -1222
- package/dist/index-1AmVTHDV.mjs.map +1 -0
- package/dist/index-D-S2Tzk9.js +29 -0
- package/dist/index-D-S2Tzk9.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/handlers/eventTrigger.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/package.json +1 -1
- package/rules/integration.md +4 -0
- 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 at = "$";
|
|
20
|
+
class ne {
|
|
21
21
|
animations;
|
|
22
22
|
options;
|
|
23
23
|
ready;
|
|
@@ -121,64 +121,64 @@ 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:
|
|
150
|
-
},
|
|
151
|
-
const o = 3 * t, r = 3 * (s - 2 * t),
|
|
124
|
+
const ct = (e) => e, Xt = (e) => 1 - Math.cos(e * Math.PI / 2), Zt = (e) => Math.sin(e * Math.PI / 2), Jt = (e) => -(Math.cos(Math.PI * e) - 1) / 2, en = (e) => e ** 2, tn = (e) => 1 - (1 - e) ** 2, nn = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, sn = (e) => e ** 3, on = (e) => 1 - (1 - e) ** 3, rn = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, an = (e) => e ** 4, cn = (e) => 1 - (1 - e) ** 4, ln = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, un = (e) => e ** 5, fn = (e) => 1 - (1 - e) ** 5, dn = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, hn = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), mn = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), pn = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, gn = (e) => 1 - Math.sqrt(1 - e ** 2), vn = (e) => Math.sqrt(1 - (e - 1) ** 2), yn = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, En = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, wn = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, $n = (e, t = 1.70158 * 1.525) => e < 0.5 ? (2 * e) ** 2 * ((t + 1) * 2 * e - t) / 2 : ((2 * e - 2) ** 2 * ((t + 1) * (e * 2 - 2) + t) + 2) / 2, We = {
|
|
125
|
+
linear: ct,
|
|
126
|
+
sineIn: Xt,
|
|
127
|
+
sineOut: Zt,
|
|
128
|
+
sineInOut: Jt,
|
|
129
|
+
quadIn: en,
|
|
130
|
+
quadOut: tn,
|
|
131
|
+
quadInOut: nn,
|
|
132
|
+
cubicIn: sn,
|
|
133
|
+
cubicOut: on,
|
|
134
|
+
cubicInOut: rn,
|
|
135
|
+
quartIn: an,
|
|
136
|
+
quartOut: cn,
|
|
137
|
+
quartInOut: ln,
|
|
138
|
+
quintIn: un,
|
|
139
|
+
quintOut: fn,
|
|
140
|
+
quintInOut: dn,
|
|
141
|
+
expoIn: hn,
|
|
142
|
+
expoOut: mn,
|
|
143
|
+
expoInOut: pn,
|
|
144
|
+
circIn: gn,
|
|
145
|
+
circOut: vn,
|
|
146
|
+
circInOut: yn,
|
|
147
|
+
backIn: En,
|
|
148
|
+
backOut: wn,
|
|
149
|
+
backInOut: $n
|
|
150
|
+
}, V = (e, t, n, s, i) => {
|
|
151
|
+
const o = 3 * t, r = 3 * (s - 2 * t), c = 1 - 3 * s + 3 * t, l = 3 * n, u = 3 * (i - 2 * n), a = 1 - 3 * i + 3 * n;
|
|
152
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
158
|
const y = 2 * Math.sqrt(-p);
|
|
159
|
-
let
|
|
159
|
+
let E = 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 * y), -1),
|
|
164
164
|
1
|
|
165
|
-
),
|
|
166
|
-
return
|
|
167
|
-
}) && (
|
|
168
|
-
const
|
|
169
|
-
f = `(${y} * cos(${
|
|
165
|
+
), O = y * Math.cos((Math.acos(I) - w * 2 * Math.PI) / 3) - d;
|
|
166
|
+
return O >= -1e-6 && O <= 1.000001;
|
|
167
|
+
}) && (E = w);
|
|
168
|
+
const v = `(acos(clamp(-1, ${2 / (p * y)} * ${g}, 1)) - ${360 * E}deg) / 3`;
|
|
169
|
+
f = `(${y} * cos(${v}) - ${d})`;
|
|
170
170
|
} else {
|
|
171
|
-
const y = `sqrt(pow(${
|
|
172
|
-
f = `(pow(${y} - ${
|
|
171
|
+
const y = `sqrt(pow(${g}, 2) + ${Math.pow(p, 3)})`;
|
|
172
|
+
f = `(pow(${y} - ${g}, 1 / 3) - pow(${y} + ${g}, 1 / 3) - ${d})`;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
return `(${
|
|
176
|
-
},
|
|
175
|
+
return `(${a} * pow(${f}, 3) + ${u} * pow(${f}, 2) + ${l} * ${f})`;
|
|
176
|
+
}, Ve = {
|
|
177
177
|
linear: (e) => e,
|
|
178
|
-
ease: (e) =>
|
|
179
|
-
easeIn: (e) =>
|
|
180
|
-
easeOut: (e) =>
|
|
181
|
-
easeInOut: (e) =>
|
|
178
|
+
ease: (e) => V(e, 0.25, 0.1, 0.25, 1),
|
|
179
|
+
easeIn: (e) => V(e, 0.42, 0, 1, 1),
|
|
180
|
+
easeOut: (e) => V(e, 0, 0, 0.58, 1),
|
|
181
|
+
easeInOut: (e) => V(e, 0.42, 0, 0.58, 1),
|
|
182
182
|
sineIn: (e) => `(1 - cos(${e} * 90deg))`,
|
|
183
183
|
sineOut: (e) => `(sin(${e} * 90deg))`,
|
|
184
184
|
sineInOut: (e) => `((1 - cos(${e} * 180deg)) / 2)`,
|
|
@@ -203,7 +203,7 @@ const 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
|
+
}, Ke = {
|
|
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 lt(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) && lt(t) !== t)
|
|
257
257
|
return !0;
|
|
258
258
|
return !1;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function ut(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[lt(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 ? Ke[e] || e : Ke.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 E = 0; E < 8; E++) {
|
|
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, y = 1;
|
|
289
|
+
for (p = (g + y) / 2; y - g > 1e-7; ) {
|
|
290
|
+
const E = a(p);
|
|
291
|
+
if (Math.abs(E - m) < 1e-7) return p;
|
|
292
|
+
m > E ? g = p : y = p, p = (g + y) / 2;
|
|
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 ft(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 = ft(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 = ft(e);
|
|
314
314
|
if (!(!t || t.some(isNaN)))
|
|
315
|
-
return (n) =>
|
|
315
|
+
return (n) => V(n, ...t);
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function dt(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 = dt(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 = dt(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 ht(e) {
|
|
387
387
|
if (!e) return;
|
|
388
|
-
const t =
|
|
389
|
-
return t || (
|
|
388
|
+
const t = We[e];
|
|
389
|
+
return t || (_n(e) ?? Mn(e) ?? We.linear);
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function qn(e) {
|
|
392
392
|
if (!e) return;
|
|
393
|
-
const t =
|
|
394
|
-
return t || (
|
|
393
|
+
const t = Ve[e];
|
|
394
|
+
return t || (An(e) ?? kn(e) ?? Ve.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 : ht(n.offsetEasing) ?? ct, 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: {} }, Ye = he.exports, Be;
|
|
638
|
+
function Rn() {
|
|
639
|
+
return Be || (Be = 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 Ye < "u" ? Ye : 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 Z(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" ? Z(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 Ue(e, t, n) {
|
|
796
|
+
return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${Ce(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${Ce(e.offset)} + ${t})` : Ce(e.offset)}`;
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function gt(e) {
|
|
799
799
|
return {
|
|
800
|
-
start:
|
|
801
|
-
end:
|
|
800
|
+
start: Ue(e.startOffset, e.startOffsetAdd),
|
|
801
|
+
end: Ue(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 De(t) ? (r.duration = i.duration, r.delay = i.delay || 0) : t?.trigger === "view-progress" && (s || window.ViewTimeline) ? r.duration = "auto" : (r.duration = 99.99, r.delay = 0.01), {
|
|
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 De(e) {
|
|
847
847
|
return !e || e.trigger !== "pointer-move" && e.trigger !== "view-progress";
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function Qe(e, t, n, s, i) {
|
|
850
850
|
if (e) {
|
|
851
|
-
if (
|
|
851
|
+
if (De(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" ? Z(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 = Qe(
|
|
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 = Qe(
|
|
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 || Z(n.componentId)
|
|
894
894
|
}));
|
|
895
|
-
const f =
|
|
896
|
-
const
|
|
897
|
-
|
|
898
|
-
"timing" in d && y.updateTiming(d.timing), y.setKeyframes(
|
|
895
|
+
const f = l.map(({ effect: d, options: h, id: m, part: p }) => {
|
|
896
|
+
const g = p ? mt(o, p) : o, y = new KeyframeEffect(g || null, [], h);
|
|
897
|
+
A.mutate(() => {
|
|
898
|
+
"timing" in d && y.updateTiming(d.timing), y.setKeyframes(ut(d.keyframes));
|
|
899
899
|
});
|
|
900
|
-
const
|
|
900
|
+
const E = 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(y,
|
|
906
|
-
if (
|
|
904
|
+
E
|
|
905
|
+
) : new Animation(y, E.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 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 (
|
|
943
|
+
const g = qn(m);
|
|
944
|
+
if (g) {
|
|
945
945
|
const y = (i ?? 0) + (d ?? 0);
|
|
946
946
|
if (h) {
|
|
947
|
-
const
|
|
947
|
+
const E = g(
|
|
948
948
|
`(var(--motion-${f}-index, 0) / var(--motion-${f}-last, 1))`
|
|
949
949
|
);
|
|
950
|
-
p = `calc(${`(${y} + ${
|
|
950
|
+
p = `calc(${`(${y} + ${E} * ${h} * var(--motion-${f}-last, 1))`} * 1ms)`;
|
|
951
951
|
} else
|
|
952
952
|
p = `${y}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 Hn(e, t, n) {
|
|
958
|
+
return e?.style ? (De(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 Dn(e, t, n, s) {
|
|
961
|
+
const i = J(t), o = Hn(i, t), r = Et(o, n, t.effectId, !0), c = n?.trigger === "view-progress";
|
|
962
|
+
return r.map((l, u) => {
|
|
963
|
+
const { start: a, end: f } = c ? gt(l.effect) : {};
|
|
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: ut(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 : Z(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 || Z(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
1040
|
target: void 0,
|
|
1041
|
-
centeredToTarget:
|
|
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, y) {
|
|
1048
|
+
const E = h === "x" ? y.x : y.y;
|
|
1049
|
+
this._currentProgress = E, m.progress(E);
|
|
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 = ht(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,78 @@ 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: u } = e,
|
|
1211
|
-
let { key: f, conditions: d, triggerType: h } =
|
|
1207
|
+
function Ot(e, t, n, s) {
|
|
1208
|
+
const { effects: i = {}, conditions: o = {} } = n, { key: r, trigger: c } = t, l = c === "pointerMove";
|
|
1209
|
+
e.effectId || (e.effectId = s || ee());
|
|
1210
|
+
const { effectId: u } = e, a = { ...i[u] || {}, ...e };
|
|
1211
|
+
let { key: f, conditions: d, triggerType: h } = a;
|
|
1212
1212
|
if (!f) {
|
|
1213
1213
|
if (!r)
|
|
1214
1214
|
return null;
|
|
1215
1215
|
f = r;
|
|
1216
1216
|
}
|
|
1217
|
-
if (
|
|
1217
|
+
if (Bn(f))
|
|
1218
1218
|
return null;
|
|
1219
1219
|
d = [
|
|
1220
1220
|
...new Set((d || []).filter((b) => o[b]))
|
|
1221
|
-
], h || (h =
|
|
1222
|
-
const { namedEffect: m, customEffect: p, keyframeEffect:
|
|
1223
|
-
...
|
|
1221
|
+
], h || (h = Ct.get(c));
|
|
1222
|
+
const { namedEffect: m, customEffect: p, keyframeEffect: g, transition: y, transitionProperties: E, ...v } = {
|
|
1223
|
+
...a,
|
|
1224
1224
|
key: f,
|
|
1225
1225
|
conditions: d,
|
|
1226
1226
|
effectId: u,
|
|
1227
1227
|
triggerType: h
|
|
1228
|
-
}, w =
|
|
1228
|
+
}, w = Qt(t, v);
|
|
1229
1229
|
if (m)
|
|
1230
|
-
return
|
|
1231
|
-
if (
|
|
1232
|
-
if (!
|
|
1230
|
+
return l || !m.type ? null : { namedEffect: m, initial: w, ...v };
|
|
1231
|
+
if (g) {
|
|
1232
|
+
if (!g.name) {
|
|
1233
1233
|
const b = u && !(i[u] && "keyframeEffect" in e);
|
|
1234
|
-
|
|
1234
|
+
g.name = b ? u : ee();
|
|
1235
1235
|
}
|
|
1236
|
-
return { keyframeEffect:
|
|
1237
|
-
} else return p ?
|
|
1236
|
+
return { keyframeEffect: g, initial: w, ...v };
|
|
1237
|
+
} else return p ? l ? null : { initial: w, ...v } : y ? { transition: y, initial: w, ...v } : E ? { transitionProperties: E, initial: w, ...v } : { initial: w, ...v };
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1239
|
+
function Xn(e, t, n, s, i) {
|
|
1240
1240
|
const { sequences: o = {}, conditions: r = {} } = n;
|
|
1241
|
-
e.sequenceId || (e.sequenceId = s ||
|
|
1242
|
-
const { sequenceId:
|
|
1241
|
+
e.sequenceId || (e.sequenceId = s || ee());
|
|
1242
|
+
const { sequenceId: c } = e, l = { ...o[c] || {}, ...e };
|
|
1243
1243
|
let {
|
|
1244
1244
|
effects: u,
|
|
1245
|
-
conditions:
|
|
1245
|
+
conditions: a,
|
|
1246
1246
|
triggerType: f,
|
|
1247
1247
|
delay: d = 0,
|
|
1248
1248
|
offset: h = 0,
|
|
1249
1249
|
offsetEasing: m = "linear"
|
|
1250
|
-
} =
|
|
1250
|
+
} = l;
|
|
1251
1251
|
if (typeof m == "function" || !u)
|
|
1252
1252
|
return null;
|
|
1253
|
-
f || (f =
|
|
1254
|
-
...new Set((
|
|
1253
|
+
f || (f = Ct.get(t.trigger)), a = [
|
|
1254
|
+
...new Set((a || []).filter((y) => r[y]))
|
|
1255
1255
|
];
|
|
1256
|
-
const
|
|
1257
|
-
const
|
|
1258
|
-
{ ...y, triggerType: f, conditions: [...y.conditions || [], ...
|
|
1256
|
+
const g = u.map((y, E) => {
|
|
1257
|
+
const v = Ot(
|
|
1258
|
+
{ ...y, triggerType: f, conditions: [...y.conditions || [], ...a] },
|
|
1259
1259
|
t,
|
|
1260
1260
|
n,
|
|
1261
|
-
`${
|
|
1261
|
+
`${c}-eff-${E}`
|
|
1262
1262
|
);
|
|
1263
|
-
return
|
|
1263
|
+
return v && Object.assign(v, { slotKey: i?.(E) });
|
|
1264
1264
|
}).filter((y) => y !== null);
|
|
1265
|
-
return
|
|
1266
|
-
sequenceId:
|
|
1265
|
+
return g.length ? {
|
|
1266
|
+
sequenceId: c,
|
|
1267
1267
|
triggerType: f,
|
|
1268
|
-
conditions:
|
|
1268
|
+
conditions: a,
|
|
1269
1269
|
delay: d,
|
|
1270
1270
|
offset: h,
|
|
1271
1271
|
offsetEasing: m,
|
|
1272
|
-
effects:
|
|
1272
|
+
effects: g
|
|
1273
1273
|
} : null;
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1276
|
-
return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" :
|
|
1275
|
+
function Zn(e) {
|
|
1276
|
+
return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" : ge(e);
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1278
|
+
function Jn(e) {
|
|
1279
1279
|
if (!e.length)
|
|
1280
1280
|
return [];
|
|
1281
1281
|
const t = e.map((i) => ({ ...i }));
|
|
@@ -1289,66 +1289,66 @@ function Qn(e) {
|
|
|
1289
1289
|
if (o > 1)
|
|
1290
1290
|
return console.error("Offsets must be in the range [0,1]"), [];
|
|
1291
1291
|
const r = i - n;
|
|
1292
|
-
for (let
|
|
1293
|
-
const
|
|
1294
|
-
t[
|
|
1292
|
+
for (let c = n + 1; c < i; c++) {
|
|
1293
|
+
const l = (c - n) / r;
|
|
1294
|
+
t[c].offset = s + (o - s) * l;
|
|
1295
1295
|
}
|
|
1296
1296
|
n = i, s = o;
|
|
1297
1297
|
}
|
|
1298
1298
|
return t;
|
|
1299
1299
|
}
|
|
1300
|
-
function
|
|
1301
|
-
const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${
|
|
1300
|
+
function es(e, t) {
|
|
1301
|
+
const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${Zn(s)}: ${i};`).join(`
|
|
1302
1302
|
`);
|
|
1303
1303
|
return `${t}% {
|
|
1304
1304
|
${n}
|
|
1305
1305
|
}`;
|
|
1306
1306
|
}
|
|
1307
|
-
function
|
|
1308
|
-
const n =
|
|
1307
|
+
function ts(e, t) {
|
|
1308
|
+
const n = Jn(t);
|
|
1309
1309
|
if (!n.length)
|
|
1310
1310
|
return "";
|
|
1311
1311
|
let s = n.map((i) => {
|
|
1312
|
-
const o = i.offset, r =
|
|
1313
|
-
return
|
|
1312
|
+
const o = i.offset, r = Yn(o * 100);
|
|
1313
|
+
return es(i, r);
|
|
1314
1314
|
}).join(`
|
|
1315
1315
|
`);
|
|
1316
1316
|
return `@keyframes ${e} {
|
|
1317
1317
|
${s}
|
|
1318
1318
|
}`;
|
|
1319
1319
|
}
|
|
1320
|
-
function
|
|
1321
|
-
const { key: t, childSelector: n, declarations: s, media: i, states: o, selectorCondition: r, selectorSuffix:
|
|
1320
|
+
function ns(e) {
|
|
1321
|
+
const { key: t, childSelector: n, declarations: s, media: i, states: o, selectorCondition: r, selectorSuffix: c } = e;
|
|
1322
1322
|
if (!s.length)
|
|
1323
1323
|
return "";
|
|
1324
|
-
let
|
|
1324
|
+
let l = `[data-interact-key="${t}"]`;
|
|
1325
1325
|
if (o && o.length) {
|
|
1326
1326
|
const f = o.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
|
|
1327
|
-
|
|
1327
|
+
l = `${l}:is(${f})`;
|
|
1328
1328
|
}
|
|
1329
|
-
n && (
|
|
1329
|
+
n && (l = `${l} ${n}`), c && (l = `${l}${c}`), r && (l = me(l, r));
|
|
1330
1330
|
const u = s.map(({ name: f, value: d, important: h }) => `${f}: ${d}${h ? " !important" : ""};`).join(`
|
|
1331
|
-
`),
|
|
1331
|
+
`), a = `${l} {
|
|
1332
1332
|
${u}
|
|
1333
1333
|
}`;
|
|
1334
1334
|
return i ? `@media ${i} {
|
|
1335
|
-
${
|
|
1336
|
-
}` :
|
|
1335
|
+
${a}
|
|
1336
|
+
}` : a;
|
|
1337
1337
|
}
|
|
1338
|
-
const
|
|
1338
|
+
const ke = [
|
|
1339
1339
|
"animation",
|
|
1340
1340
|
"animation-composition",
|
|
1341
1341
|
"animation-timeline",
|
|
1342
1342
|
"animation-range"
|
|
1343
|
-
],
|
|
1344
|
-
...
|
|
1343
|
+
], be = [
|
|
1344
|
+
...ke,
|
|
1345
1345
|
"transition",
|
|
1346
1346
|
"view-timeline"
|
|
1347
|
-
],
|
|
1348
|
-
function
|
|
1347
|
+
], Ge = ["animation", "transition", "timeline"];
|
|
1348
|
+
function L(e) {
|
|
1349
1349
|
return e === "transition" ? "transition" : e === "view-timeline" ? "timeline" : "animation";
|
|
1350
1350
|
}
|
|
1351
|
-
const
|
|
1351
|
+
const K = {
|
|
1352
1352
|
transition: "_",
|
|
1353
1353
|
animation: "none",
|
|
1354
1354
|
"animation-composition": "replace",
|
|
@@ -1356,94 +1356,131 @@ const H = {
|
|
|
1356
1356
|
"animation-range": "normal",
|
|
1357
1357
|
"view-timeline": "none"
|
|
1358
1358
|
};
|
|
1359
|
-
function
|
|
1360
|
-
return
|
|
1359
|
+
function _t(e) {
|
|
1360
|
+
return e.replace(new RegExp("(?<!(^|-))([aeiou]|tion)", "g"), "");
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1363
|
-
const
|
|
1362
|
+
function j(e, t, n = !1, s) {
|
|
1363
|
+
const i = s === void 0 ? "" : `-c${s}`;
|
|
1364
|
+
return `--${_t(e)}${i}${n ? "-slot" : ""}-${t}`;
|
|
1365
|
+
}
|
|
1366
|
+
function te(e, t) {
|
|
1367
|
+
return `--${_t(e)}-c${t}`;
|
|
1368
|
+
}
|
|
1369
|
+
function ss(e, t) {
|
|
1370
|
+
return Array.from(
|
|
1371
|
+
{ length: t + 1 },
|
|
1372
|
+
(n, s) => `var(${te(e, s)})`
|
|
1373
|
+
).join(", ");
|
|
1374
|
+
}
|
|
1375
|
+
function is(e, t, n, s, i = 0, o) {
|
|
1376
|
+
const r = {
|
|
1364
1377
|
animation: e,
|
|
1365
1378
|
transition: t,
|
|
1366
1379
|
timeline: i
|
|
1367
|
-
},
|
|
1380
|
+
}, c = {
|
|
1368
1381
|
animation: n,
|
|
1369
1382
|
transition: s,
|
|
1370
1383
|
timeline: 0
|
|
1371
|
-
};
|
|
1372
|
-
return
|
|
1384
|
+
}, l = (u, a) => `@property ${a} { syntax: "*"; inherits: false; initial-value: ${K[u]}; }`;
|
|
1385
|
+
return be.flatMap((u) => [
|
|
1373
1386
|
...Array.from(
|
|
1374
|
-
{ length:
|
|
1375
|
-
(
|
|
1387
|
+
{ length: r[L(u)] },
|
|
1388
|
+
(a, f) => l(u, j(u, f, !1, o))
|
|
1376
1389
|
),
|
|
1377
1390
|
...Array.from(
|
|
1378
|
-
{ length:
|
|
1379
|
-
(
|
|
1391
|
+
{ length: c[L(u)] },
|
|
1392
|
+
(a, f) => l(u, j(u, f, !0, o))
|
|
1393
|
+
),
|
|
1394
|
+
// registers the lists of the configs before it too, for elements they don't target
|
|
1395
|
+
...Array.from(
|
|
1396
|
+
{ length: o !== void 0 && r[L(u)] ? o + 1 : 0 },
|
|
1397
|
+
(a, f) => l(u, te(u, f))
|
|
1380
1398
|
)
|
|
1381
1399
|
]);
|
|
1382
1400
|
}
|
|
1383
|
-
function
|
|
1384
|
-
const
|
|
1385
|
-
(
|
|
1401
|
+
function os(e, t, n, s) {
|
|
1402
|
+
const i = be.filter(
|
|
1403
|
+
(c) => e[L(c)].slotsInSequence > 0
|
|
1386
1404
|
);
|
|
1387
|
-
if (
|
|
1405
|
+
if (i.length === 0)
|
|
1388
1406
|
return null;
|
|
1389
|
-
const
|
|
1390
|
-
const { listIndex:
|
|
1407
|
+
const o = i.map((c) => {
|
|
1408
|
+
const { listIndex: l, slotCursor: u, slotsInSequence: a } = e[L(c)];
|
|
1391
1409
|
return {
|
|
1392
|
-
name: j(
|
|
1410
|
+
name: j(c, l, !1, s),
|
|
1393
1411
|
value: Array.from(
|
|
1394
|
-
{ length:
|
|
1395
|
-
(
|
|
1412
|
+
{ length: a },
|
|
1413
|
+
(f, d) => `var(${j(c, u + d, !0, s)})`
|
|
1396
1414
|
).join(", ")
|
|
1397
1415
|
};
|
|
1398
|
-
}),
|
|
1399
|
-
return t && (
|
|
1416
|
+
}), r = { key: e.key, childSelector: e.childSelector, declarations: o };
|
|
1417
|
+
return t && (r.media = ie(t, n || {}, "media"), r.selectorCondition = R(t, n || {})), r;
|
|
1400
1418
|
}
|
|
1401
|
-
function
|
|
1419
|
+
function rs(e, t, n, s = 0, i) {
|
|
1402
1420
|
if (e.length === 0)
|
|
1403
1421
|
return "";
|
|
1404
|
-
const
|
|
1422
|
+
const o = {
|
|
1405
1423
|
animation: t,
|
|
1406
1424
|
transition: n,
|
|
1407
1425
|
timeline: s
|
|
1408
|
-
},
|
|
1409
|
-
if (
|
|
1426
|
+
}, r = be.filter((u) => o[L(u)] > 0);
|
|
1427
|
+
if (r.length === 0)
|
|
1410
1428
|
return "";
|
|
1411
|
-
const
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
{ length: i[N(c)] },
|
|
1429
|
+
const c = r.flatMap((u) => {
|
|
1430
|
+
const a = Array.from(
|
|
1431
|
+
{ length: o[L(u)] },
|
|
1415
1432
|
// TODO: maybe add `-intrct` to names? --anm-0 or --trns-0 could collide with user-defined names
|
|
1416
|
-
(
|
|
1417
|
-
).join(", ")
|
|
1418
|
-
|
|
1433
|
+
(f, d) => `var(${j(u, d, !1, i)})`
|
|
1434
|
+
).join(", ");
|
|
1435
|
+
return i === void 0 ? [{ name: u, value: a }] : [
|
|
1436
|
+
{ name: te(u, i), value: a },
|
|
1437
|
+
{ name: u, value: ss(u, i) }
|
|
1438
|
+
];
|
|
1439
|
+
});
|
|
1419
1440
|
return `${e.map(
|
|
1420
|
-
({ key:
|
|
1441
|
+
({ key: u, childSelector: a }) => `[data-interact-key="${u}"]${a ? ` ${a}` : ""}`
|
|
1421
1442
|
).join(", ")} {
|
|
1422
|
-
${
|
|
1443
|
+
${c.map(({ name: u, value: a }) => ` ${u}: ${a};`).join(`
|
|
1423
1444
|
`)}
|
|
1424
1445
|
}`;
|
|
1425
1446
|
}
|
|
1426
|
-
|
|
1447
|
+
function as(e, t) {
|
|
1448
|
+
if (e.length === 0)
|
|
1449
|
+
return "";
|
|
1450
|
+
if (t === void 0)
|
|
1451
|
+
return `:root {
|
|
1452
|
+
timeline-scope: ${e.join(", ")};
|
|
1453
|
+
}`;
|
|
1454
|
+
const n = Array.from(
|
|
1455
|
+
{ length: t + 1 },
|
|
1456
|
+
(s, i) => `var(${te("timeline-scope", i)}, --_)`
|
|
1457
|
+
).join(", ");
|
|
1458
|
+
return `:root {
|
|
1459
|
+
${te("timeline-scope", t)}: ${e.join(", ")};
|
|
1460
|
+
timeline-scope: ${n};
|
|
1461
|
+
}`;
|
|
1462
|
+
}
|
|
1463
|
+
const ae = {
|
|
1427
1464
|
rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
|
|
1428
1465
|
rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
|
|
1429
1466
|
};
|
|
1430
|
-
function
|
|
1431
|
-
const n = e?.name ??
|
|
1467
|
+
function cs(e, t) {
|
|
1468
|
+
const n = e?.name ?? ae.rangeStart.name, s = t?.name ?? e?.name ?? ae.rangeEnd.name, i = {
|
|
1432
1469
|
name: n,
|
|
1433
|
-
offset: e?.offset ||
|
|
1470
|
+
offset: e?.offset || ae.rangeStart.offset
|
|
1434
1471
|
}, o = {
|
|
1435
1472
|
name: s,
|
|
1436
|
-
offset: t?.offset ||
|
|
1473
|
+
offset: t?.offset || ae.rangeEnd.offset
|
|
1437
1474
|
};
|
|
1438
1475
|
return { startOffset: i, endOffset: o };
|
|
1439
1476
|
}
|
|
1440
|
-
function
|
|
1477
|
+
function x(e) {
|
|
1441
1478
|
if ("keyframeEffect" in e && !e.keyframeEffect.name && "effectId" in e && (e.keyframeEffect.name = e.effectId), "duration" in e)
|
|
1442
1479
|
return {
|
|
1443
1480
|
id: "",
|
|
1444
1481
|
...e
|
|
1445
1482
|
};
|
|
1446
|
-
const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } =
|
|
1483
|
+
const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } = cs(t, n);
|
|
1447
1484
|
return {
|
|
1448
1485
|
id: "",
|
|
1449
1486
|
startOffset: i,
|
|
@@ -1455,23 +1492,23 @@ function k(e, t, n) {
|
|
|
1455
1492
|
let s = e.get(t);
|
|
1456
1493
|
s || (s = /* @__PURE__ */ new Set(), e.set(t, s)), s.add(n);
|
|
1457
1494
|
}
|
|
1458
|
-
function
|
|
1495
|
+
function oe(e, t) {
|
|
1459
1496
|
e.get(t)?.forEach((s) => {
|
|
1460
1497
|
const { source: i, target: o, cleanup: r } = s;
|
|
1461
1498
|
r();
|
|
1462
|
-
const
|
|
1463
|
-
e.get(
|
|
1499
|
+
const c = i === t ? o : i;
|
|
1500
|
+
e.get(c)?.delete(s);
|
|
1464
1501
|
}), e.delete(t);
|
|
1465
1502
|
}
|
|
1466
|
-
const
|
|
1503
|
+
const ls = [
|
|
1467
1504
|
{ name: "visibility", value: "hidden" },
|
|
1468
1505
|
{ name: "clip-path", value: "none", important: !0 },
|
|
1469
1506
|
{ name: "transform", value: "none", important: !0 },
|
|
1470
1507
|
{ name: "translate", value: "none", important: !0 },
|
|
1471
1508
|
{ name: "scale", value: "none", important: !0 },
|
|
1472
1509
|
{ name: "rotate", value: "none", important: !0 }
|
|
1473
|
-
],
|
|
1474
|
-
function
|
|
1510
|
+
], qe = { animation: !1, transition: !1, timeline: !1 };
|
|
1511
|
+
function At(e, t) {
|
|
1475
1512
|
const n = () => ({
|
|
1476
1513
|
listIndex: 0,
|
|
1477
1514
|
slotCursor: 0,
|
|
@@ -1490,33 +1527,33 @@ function Ct(e, t) {
|
|
|
1490
1527
|
keyframeEntries: /* @__PURE__ */ new Map()
|
|
1491
1528
|
};
|
|
1492
1529
|
}
|
|
1493
|
-
function
|
|
1530
|
+
function Mt(e, t, n) {
|
|
1494
1531
|
return Object.fromEntries(
|
|
1495
|
-
|
|
1496
|
-
const
|
|
1532
|
+
be.map((s) => {
|
|
1533
|
+
const i = L(s), { listIndex: o, slotCursor: r, slotsInSequence: c } = e[i];
|
|
1497
1534
|
return [
|
|
1498
|
-
|
|
1499
|
-
t[
|
|
1535
|
+
s,
|
|
1536
|
+
t[i] ? j(s, r + c, !0, n) : j(s, o, !1, n)
|
|
1500
1537
|
];
|
|
1501
1538
|
})
|
|
1502
1539
|
);
|
|
1503
1540
|
}
|
|
1504
|
-
function
|
|
1505
|
-
|
|
1541
|
+
function Pe(e, t, n) {
|
|
1542
|
+
Ge.forEach((s) => {
|
|
1506
1543
|
t[s] && (e[s].touched = !0, n[s] && (e[s].slotsInSequence += 1));
|
|
1507
1544
|
});
|
|
1508
1545
|
}
|
|
1509
|
-
function
|
|
1546
|
+
function kt(e) {
|
|
1510
1547
|
const { namedEffect: t, keyframeEffect: n, transition: s, transitionProperties: i } = e;
|
|
1511
1548
|
return t || n ? "animation" : s || i ? "transition" : null;
|
|
1512
1549
|
}
|
|
1513
|
-
function
|
|
1550
|
+
function us(e) {
|
|
1514
1551
|
const t = /* @__PURE__ */ new Map();
|
|
1515
1552
|
return e.effects.forEach((n) => {
|
|
1516
|
-
const s =
|
|
1553
|
+
const s = kt(n);
|
|
1517
1554
|
if (!s)
|
|
1518
1555
|
return;
|
|
1519
|
-
const i =
|
|
1556
|
+
const i = W(n), o = t.get(i) || { animation: 0, transition: 0, timeline: 0 };
|
|
1520
1557
|
o[s] += 1, t.set(i, o);
|
|
1521
1558
|
}), new Map(
|
|
1522
1559
|
[...t].map(([n, { animation: s, transition: i }]) => [
|
|
@@ -1525,35 +1562,35 @@ function os(e) {
|
|
|
1525
1562
|
])
|
|
1526
1563
|
);
|
|
1527
1564
|
}
|
|
1528
|
-
function
|
|
1529
|
-
|
|
1565
|
+
function fs(e) {
|
|
1566
|
+
Ge.forEach((t) => {
|
|
1530
1567
|
const n = e[t];
|
|
1531
1568
|
n.slotsInInteraction = Math.max(n.slotsInInteraction, n.slotsInSequence), n.slotsInSequence = 0;
|
|
1532
1569
|
});
|
|
1533
1570
|
}
|
|
1534
|
-
function
|
|
1535
|
-
|
|
1571
|
+
function ds(e) {
|
|
1572
|
+
Ge.forEach((t) => {
|
|
1536
1573
|
const n = e[t];
|
|
1537
1574
|
n.listIndex += n.touched ? 1 : 0, n.slotCursor += n.slotsInInteraction, n.slotsInInteraction = 0, n.touched = !1;
|
|
1538
1575
|
});
|
|
1539
1576
|
}
|
|
1540
|
-
const
|
|
1577
|
+
const hs = {
|
|
1541
1578
|
animation: "animation",
|
|
1542
1579
|
"animation-composition": "composition",
|
|
1543
1580
|
"animation-timeline": "animationTimeline",
|
|
1544
1581
|
"animation-range": "animationRange"
|
|
1545
1582
|
};
|
|
1546
|
-
function
|
|
1547
|
-
const { key: i, conditions: o } = t, r =
|
|
1583
|
+
function ms(e, t, n, s) {
|
|
1584
|
+
const { key: i, conditions: o } = t, r = ie(o, e.configConditions, "media"), c = R(o, e.configConditions), l = G(t, {
|
|
1548
1585
|
asCombinator: !0,
|
|
1549
1586
|
useFirstChild: e.useFirstChild,
|
|
1550
1587
|
addItemFilter: !0
|
|
1551
|
-
}), u =
|
|
1552
|
-
return
|
|
1588
|
+
}), u = W(t), a = e.targetsMap.get(u) || At(i, l), f = Mt(a, qe, e.configIndex)["view-timeline"];
|
|
1589
|
+
return Pe(a, { animation: !1, transition: !1, timeline: !0 }, qe), e.targetsMap.set(u, a), s.add(u), {
|
|
1553
1590
|
key: i,
|
|
1554
1591
|
media: r,
|
|
1555
|
-
selectorCondition:
|
|
1556
|
-
childSelector:
|
|
1592
|
+
selectorCondition: c,
|
|
1593
|
+
childSelector: l,
|
|
1557
1594
|
declarations: [
|
|
1558
1595
|
{
|
|
1559
1596
|
name: f,
|
|
@@ -1562,116 +1599,116 @@ function ls(e, t, n, s) {
|
|
|
1562
1599
|
]
|
|
1563
1600
|
};
|
|
1564
1601
|
}
|
|
1565
|
-
function
|
|
1602
|
+
function qt(e, t, n, s, i) {
|
|
1566
1603
|
const o = [];
|
|
1567
1604
|
for (const r of Object.keys(i)) {
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1570
|
-
...i[r](t[
|
|
1605
|
+
const c = `${at}${r}`;
|
|
1606
|
+
c in t && o.push(
|
|
1607
|
+
...i[r](t[c], {
|
|
1571
1608
|
key: n,
|
|
1572
1609
|
scope: e,
|
|
1573
1610
|
config: t
|
|
1574
|
-
}).map((
|
|
1611
|
+
}).map((l) => ({ ...l, key: n, media: s }))
|
|
1575
1612
|
);
|
|
1576
1613
|
}
|
|
1577
1614
|
return o;
|
|
1578
1615
|
}
|
|
1579
|
-
function
|
|
1580
|
-
const { assigned: r, childSelector:
|
|
1581
|
-
key:
|
|
1616
|
+
function ps(e, t, n, s, i, o) {
|
|
1617
|
+
const { assigned: r, childSelector: c, partSelectors: l } = n, u = { animation: !1, transition: !1, timeline: !1 }, {
|
|
1618
|
+
key: a,
|
|
1582
1619
|
effectId: f,
|
|
1583
1620
|
conditions: d,
|
|
1584
1621
|
namedEffect: h,
|
|
1585
1622
|
keyframeEffect: m,
|
|
1586
1623
|
transition: p,
|
|
1587
|
-
transitionProperties:
|
|
1624
|
+
transitionProperties: g,
|
|
1588
1625
|
initial: y
|
|
1589
|
-
} = t,
|
|
1626
|
+
} = t, E = ie(d, e.configConditions, "media"), v = R(d, e.configConditions), w = [
|
|
1590
1627
|
{
|
|
1591
|
-
key:
|
|
1592
|
-
media:
|
|
1593
|
-
selectorCondition:
|
|
1594
|
-
childSelector:
|
|
1628
|
+
key: a,
|
|
1629
|
+
media: E,
|
|
1630
|
+
selectorCondition: v,
|
|
1631
|
+
childSelector: c,
|
|
1595
1632
|
declarations: []
|
|
1596
1633
|
}
|
|
1597
1634
|
];
|
|
1598
1635
|
let b = [];
|
|
1599
1636
|
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:
|
|
1637
|
+
if (e.plugins && w.push(...qt("effect", t, a, E, e.plugins)), h || m) {
|
|
1638
|
+
const I = x(t), O = Dn(null, I, s, o).filter(
|
|
1639
|
+
(T) => T.name
|
|
1640
|
+
), M = O.length ? {} : { "": [] };
|
|
1641
|
+
O.forEach((T) => {
|
|
1642
|
+
const C = T.part || "";
|
|
1643
|
+
(M[C] ||= []).push(T);
|
|
1644
|
+
}), b = O.map((T) => ({
|
|
1645
|
+
name: T.name,
|
|
1646
|
+
keyframes: T.keyframes
|
|
1610
1647
|
})), S.push(
|
|
1611
|
-
...
|
|
1612
|
-
({ custom:
|
|
1648
|
+
...O.flatMap(
|
|
1649
|
+
({ custom: T }) => Object.entries(T || {}).filter(([C, _]) => _ !== void 0).map(([C, _]) => ({ name: C, value: _ }))
|
|
1613
1650
|
)
|
|
1614
|
-
), Object.entries(
|
|
1615
|
-
const
|
|
1651
|
+
), Object.entries(M).forEach(([T, C]) => {
|
|
1652
|
+
const _ = ke.map((P) => ({
|
|
1616
1653
|
_listPropertyName: P,
|
|
1617
1654
|
name: i[P],
|
|
1618
|
-
value:
|
|
1619
|
-
const
|
|
1620
|
-
return
|
|
1655
|
+
value: C.map((Ie) => {
|
|
1656
|
+
const Te = hs[P];
|
|
1657
|
+
return Ie[Te] || K[P];
|
|
1621
1658
|
}).join(", ")
|
|
1622
1659
|
})).filter(
|
|
1623
|
-
({ _listPropertyName: P, name:
|
|
1660
|
+
({ _listPropertyName: P, name: Ie, value: Te }) => Te !== K[P] || r.has(Ie)
|
|
1624
1661
|
);
|
|
1625
|
-
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1628
|
-
key:
|
|
1629
|
-
media:
|
|
1630
|
-
selectorCondition:
|
|
1631
|
-
childSelector:
|
|
1632
|
-
declarations:
|
|
1662
|
+
_.forEach(({ name: P }) => r.add(P)), u.animation = u.animation || _.length > 0;
|
|
1663
|
+
const re = T ? `[data-motion-part~="${T}"]` : c;
|
|
1664
|
+
T && _.length && l.add(re), y ? (w.push({
|
|
1665
|
+
key: a,
|
|
1666
|
+
media: E,
|
|
1667
|
+
selectorCondition: v,
|
|
1668
|
+
childSelector: re,
|
|
1669
|
+
declarations: ls,
|
|
1633
1670
|
selectorSuffix: ":not([data-interact-enter])"
|
|
1634
1671
|
}), w.push({
|
|
1635
|
-
key:
|
|
1636
|
-
media:
|
|
1637
|
-
selectorCondition:
|
|
1638
|
-
childSelector:
|
|
1639
|
-
declarations:
|
|
1672
|
+
key: a,
|
|
1673
|
+
media: E,
|
|
1674
|
+
selectorCondition: v,
|
|
1675
|
+
childSelector: re,
|
|
1676
|
+
declarations: _,
|
|
1640
1677
|
selectorSuffix: ':not([data-interact-enter="done"])'
|
|
1641
|
-
})) :
|
|
1642
|
-
key:
|
|
1643
|
-
media:
|
|
1644
|
-
selectorCondition:
|
|
1645
|
-
childSelector:
|
|
1646
|
-
declarations:
|
|
1647
|
-
}) : S.push(...
|
|
1678
|
+
})) : T ? w.push({
|
|
1679
|
+
key: a,
|
|
1680
|
+
media: E,
|
|
1681
|
+
selectorCondition: v,
|
|
1682
|
+
childSelector: re,
|
|
1683
|
+
declarations: _
|
|
1684
|
+
}) : S.push(..._);
|
|
1648
1685
|
});
|
|
1649
|
-
} else if (p ||
|
|
1650
|
-
const
|
|
1651
|
-
(
|
|
1686
|
+
} else if (p || g) {
|
|
1687
|
+
const I = It(t), O = Tt(t);
|
|
1688
|
+
(O.length || r.has(i.transition)) && (S.push({
|
|
1652
1689
|
name: i.transition,
|
|
1653
|
-
value:
|
|
1690
|
+
value: O.join(", ") || K.transition
|
|
1654
1691
|
}), r.add(i.transition), u.transition = !0), w.push({
|
|
1655
|
-
key:
|
|
1656
|
-
media:
|
|
1657
|
-
selectorCondition:
|
|
1658
|
-
childSelector:
|
|
1692
|
+
key: a,
|
|
1693
|
+
media: E,
|
|
1694
|
+
selectorCondition: v,
|
|
1695
|
+
childSelector: c,
|
|
1659
1696
|
states: [f],
|
|
1660
|
-
declarations:
|
|
1697
|
+
declarations: I
|
|
1661
1698
|
});
|
|
1662
1699
|
} else
|
|
1663
1700
|
S.push(
|
|
1664
|
-
...
|
|
1665
|
-
(
|
|
1666
|
-
).map((
|
|
1667
|
-
name: i[
|
|
1668
|
-
value:
|
|
1701
|
+
...ke.filter(
|
|
1702
|
+
(I) => r.has(i[I])
|
|
1703
|
+
).map((I) => ({
|
|
1704
|
+
name: i[I],
|
|
1705
|
+
value: K[I]
|
|
1669
1706
|
}))
|
|
1670
1707
|
);
|
|
1671
|
-
return { rules: w.filter((
|
|
1708
|
+
return { rules: w.filter((I) => I.declarations.length), keyframes: b, wrote: u };
|
|
1672
1709
|
}
|
|
1673
|
-
function
|
|
1674
|
-
const s = t.namedEffect &&
|
|
1710
|
+
function gs(e, t, n) {
|
|
1711
|
+
const s = t.namedEffect && He(t.namedEffect.type, !1);
|
|
1675
1712
|
if (!s?.getNames)
|
|
1676
1713
|
return;
|
|
1677
1714
|
const i = (r) => s.getNames({ ...t, suffix: r });
|
|
@@ -1680,283 +1717,281 @@ function fs(e, t, n) {
|
|
|
1680
1717
|
const o = e.keyframeEntries.get(n) || [];
|
|
1681
1718
|
e.keyframeEntries.set(n, [...o, { slotKey: t.slotKey, getNames: i }]);
|
|
1682
1719
|
}
|
|
1683
|
-
function
|
|
1684
|
-
const r =
|
|
1720
|
+
function Pt(e, t, n, s, i, o) {
|
|
1721
|
+
const r = W(t), c = e.targetsMap.get(r) || At(
|
|
1685
1722
|
t.key,
|
|
1686
|
-
|
|
1723
|
+
G(t, {
|
|
1687
1724
|
asCombinator: !0,
|
|
1688
1725
|
useFirstChild: e.useFirstChild,
|
|
1689
1726
|
addItemFilter: !0
|
|
1690
1727
|
})
|
|
1691
1728
|
);
|
|
1692
1729
|
s.add(r);
|
|
1693
|
-
const
|
|
1730
|
+
const l = o?.get(r) || qe, u = Mt(c, l, e.configIndex);
|
|
1694
1731
|
if (e.collectSlots) {
|
|
1695
|
-
|
|
1696
|
-
const h =
|
|
1697
|
-
return
|
|
1698
|
-
|
|
1732
|
+
gs(c, t, u.animation);
|
|
1733
|
+
const h = kt(t);
|
|
1734
|
+
return Pe(
|
|
1735
|
+
c,
|
|
1699
1736
|
{ animation: h === "animation", transition: h === "transition", timeline: !1 },
|
|
1700
|
-
|
|
1701
|
-
), e.targetsMap.set(r,
|
|
1737
|
+
l
|
|
1738
|
+
), e.targetsMap.set(r, c), [];
|
|
1702
1739
|
}
|
|
1703
1740
|
t.namedEffect && (t.suffix = e.keyframeSlots.get(t.slotKey));
|
|
1704
|
-
const { rules:
|
|
1741
|
+
const { rules: a, keyframes: f, wrote: d } = ps(
|
|
1705
1742
|
e,
|
|
1706
1743
|
t,
|
|
1707
|
-
|
|
1744
|
+
c,
|
|
1708
1745
|
n,
|
|
1709
1746
|
u,
|
|
1710
1747
|
i
|
|
1711
1748
|
);
|
|
1712
|
-
return f.forEach(({ name: h, keyframes: m }) => e.keyframesMap.set(h, m)),
|
|
1749
|
+
return f.forEach(({ name: h, keyframes: m }) => e.keyframesMap.set(h, m)), Pe(c, d, l), e.targetsMap.set(r, c), a;
|
|
1713
1750
|
}
|
|
1714
|
-
function
|
|
1715
|
-
const i = [], o = /* @__PURE__ */ new Set(), r =
|
|
1751
|
+
function vs(e, t, n, s) {
|
|
1752
|
+
const i = [], o = /* @__PURE__ */ new Set(), r = us(t);
|
|
1716
1753
|
i.push(
|
|
1717
1754
|
...t.effects.flatMap(
|
|
1718
|
-
(
|
|
1755
|
+
(l) => Pt(e, l, n, o, t, r)
|
|
1719
1756
|
)
|
|
1720
1757
|
);
|
|
1721
|
-
const { conditions:
|
|
1722
|
-
return o.forEach((
|
|
1723
|
-
s.add(
|
|
1724
|
-
const u = e.targetsMap.get(
|
|
1725
|
-
|
|
1758
|
+
const { conditions: c } = t;
|
|
1759
|
+
return o.forEach((l) => {
|
|
1760
|
+
s.add(l);
|
|
1761
|
+
const u = e.targetsMap.get(l), a = os(u, c, e.configConditions, e.configIndex);
|
|
1762
|
+
a && (a.declarations.forEach(({ name: f }) => u.assigned.add(f)), i.push(a)), fs(u);
|
|
1726
1763
|
}), i;
|
|
1727
1764
|
}
|
|
1728
|
-
function
|
|
1729
|
-
const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t,
|
|
1765
|
+
function ys(e, t, n) {
|
|
1766
|
+
const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t, c = e.plugins ? qt(
|
|
1730
1767
|
"interaction",
|
|
1731
1768
|
t,
|
|
1732
1769
|
s,
|
|
1733
|
-
|
|
1770
|
+
ie(i, e.configConditions, "media"),
|
|
1734
1771
|
e.plugins
|
|
1735
|
-
) : [], { trigger:
|
|
1736
|
-
trigger:
|
|
1737
|
-
id:
|
|
1738
|
-
},
|
|
1739
|
-
|
|
1772
|
+
) : [], { trigger: l } = t, u = {
|
|
1773
|
+
trigger: Un(l),
|
|
1774
|
+
id: Q("trigger", [n], e.configIndex)
|
|
1775
|
+
}, a = /* @__PURE__ */ new Set();
|
|
1776
|
+
l === "viewProgress" && c.push(ms(e, t, u.id, a));
|
|
1740
1777
|
const f = o.map((h, m) => {
|
|
1741
|
-
const p =
|
|
1778
|
+
const p = Ot(
|
|
1742
1779
|
h,
|
|
1743
1780
|
t,
|
|
1744
1781
|
e.config,
|
|
1745
|
-
|
|
1782
|
+
Q("eff", [n, m], e.configIndex)
|
|
1746
1783
|
);
|
|
1747
|
-
return p && Object.assign(p, { slotKey:
|
|
1784
|
+
return p && Object.assign(p, { slotKey: ve(n, m) });
|
|
1748
1785
|
}).filter((h) => h !== null);
|
|
1749
|
-
|
|
1750
|
-
...f.flatMap((h) =>
|
|
1786
|
+
c.push(
|
|
1787
|
+
...f.flatMap((h) => Pt(e, h, u, a))
|
|
1751
1788
|
);
|
|
1752
1789
|
const d = r.map(
|
|
1753
|
-
(h, m) =>
|
|
1790
|
+
(h, m) => Xn(
|
|
1754
1791
|
h,
|
|
1755
1792
|
t,
|
|
1756
1793
|
e.config,
|
|
1757
|
-
|
|
1758
|
-
(p) =>
|
|
1794
|
+
Q("seq", [n, m], e.configIndex),
|
|
1795
|
+
(p) => ve(n, p, m)
|
|
1759
1796
|
)
|
|
1760
1797
|
).filter((h) => h !== null);
|
|
1761
|
-
return
|
|
1798
|
+
return c.push(
|
|
1762
1799
|
...d.flatMap(
|
|
1763
|
-
(h) =>
|
|
1800
|
+
(h) => vs(e, h, u, a)
|
|
1764
1801
|
)
|
|
1765
|
-
),
|
|
1802
|
+
), l === "viewProgress" && a.size > 1 && e.scopedTimelines.push(`--${u.id}`), a.forEach((h) => ds(e.targetsMap.get(h))), c;
|
|
1766
1803
|
}
|
|
1767
|
-
function
|
|
1768
|
-
|
|
1769
|
-
return { useFirstChild: t, plugins: n };
|
|
1804
|
+
function Es(e = {}) {
|
|
1805
|
+
return typeof e == "boolean" ? { useFirstChild: e } : e;
|
|
1770
1806
|
}
|
|
1771
|
-
function
|
|
1772
|
-
const { useFirstChild: n = !0, plugins: s,
|
|
1807
|
+
function Lt(e, t) {
|
|
1808
|
+
const { useFirstChild: n = !0, plugins: s, configIndex: i, collectSlots: o = !1 } = t, r = {
|
|
1773
1809
|
config: e,
|
|
1774
1810
|
configConditions: e.conditions || {},
|
|
1775
1811
|
targetsMap: /* @__PURE__ */ new Map(),
|
|
1776
1812
|
keyframesMap: /* @__PURE__ */ new Map(),
|
|
1777
|
-
keyframeSlots:
|
|
1813
|
+
keyframeSlots: o ? /* @__PURE__ */ new Map() : Ft(e, i),
|
|
1778
1814
|
scopedTimelines: [],
|
|
1779
|
-
collectSlots:
|
|
1815
|
+
collectSlots: o,
|
|
1780
1816
|
useFirstChild: n,
|
|
1781
|
-
plugins: s
|
|
1782
|
-
|
|
1783
|
-
|
|
1817
|
+
plugins: s,
|
|
1818
|
+
configIndex: i
|
|
1819
|
+
}, c = e.interactions.flatMap(
|
|
1820
|
+
(l, u) => ys(r, l, u)
|
|
1784
1821
|
);
|
|
1785
|
-
return { ctx:
|
|
1822
|
+
return { ctx: r, cssRules: c };
|
|
1823
|
+
}
|
|
1824
|
+
function Q(e, t, n) {
|
|
1825
|
+
return [e, ...n === void 0 ? [] : [`c${n}`], ...t].join("-");
|
|
1786
1826
|
}
|
|
1787
|
-
function
|
|
1827
|
+
function ve(e, t, n) {
|
|
1788
1828
|
return [e, n, t].filter((s) => s !== void 0).join(":");
|
|
1789
1829
|
}
|
|
1790
|
-
function
|
|
1791
|
-
const { ctx:
|
|
1792
|
-
return
|
|
1793
|
-
const
|
|
1794
|
-
|
|
1795
|
-
const
|
|
1796
|
-
let
|
|
1797
|
-
for (;
|
|
1798
|
-
|
|
1799
|
-
|
|
1830
|
+
function Ft(e, t) {
|
|
1831
|
+
const { ctx: n } = Lt(e, { configIndex: t, collectSlots: !0 }), s = /* @__PURE__ */ new Map(), i = (o) => o ? `-${o}` : void 0;
|
|
1832
|
+
return n.targetsMap.forEach(({ keyframeEntries: o }) => {
|
|
1833
|
+
const r = /* @__PURE__ */ new Set();
|
|
1834
|
+
o.forEach((c) => {
|
|
1835
|
+
const l = (f) => c.flatMap(({ getNames: d }) => d(i(f)));
|
|
1836
|
+
let u = 0, a = l(u);
|
|
1837
|
+
for (; a.some((f) => r.has(f)); )
|
|
1838
|
+
a = l(++u);
|
|
1839
|
+
a.forEach((f) => r.add(f)), u && c.forEach(({ slotKey: f }) => s.set(f, i(u)));
|
|
1800
1840
|
});
|
|
1801
|
-
}),
|
|
1841
|
+
}), s;
|
|
1802
1842
|
}
|
|
1803
|
-
function
|
|
1804
|
-
const { ctx: n, cssRules: s } =
|
|
1843
|
+
function ws(e, t) {
|
|
1844
|
+
const { ctx: n, cssRules: s } = Lt(e, Es(t)), i = [...n.targetsMap.values()], o = Math.max(0, ...i.map(({ animation: h }) => h.listIndex)), r = Math.max(0, ...i.map(({ transition: h }) => h.listIndex)), c = Math.max(0, ...i.map(({ timeline: h }) => h.listIndex)), l = rs(
|
|
1805
1845
|
i.flatMap((h) => [
|
|
1806
1846
|
h,
|
|
1807
1847
|
...[...h.partSelectors].map((m) => ({ key: h.key, childSelector: m }))
|
|
1808
1848
|
]),
|
|
1809
1849
|
o,
|
|
1810
1850
|
r,
|
|
1811
|
-
|
|
1812
|
-
|
|
1851
|
+
c,
|
|
1852
|
+
n.configIndex
|
|
1853
|
+
), u = Math.max(0, ...i.map(({ animation: h }) => h.slotCursor)), a = Math.max(
|
|
1813
1854
|
0,
|
|
1814
1855
|
...i.map(({ transition: h }) => h.slotCursor)
|
|
1815
|
-
), f =
|
|
1856
|
+
), f = is(
|
|
1816
1857
|
o,
|
|
1817
1858
|
r,
|
|
1818
1859
|
u,
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
return { keyframes: n.keyframesMap, atProperty: f, cssRules: s, listsRule: c, timelineScopeRule: d };
|
|
1860
|
+
a,
|
|
1861
|
+
c,
|
|
1862
|
+
n.configIndex
|
|
1863
|
+
), d = as(n.scopedTimelines, n.configIndex);
|
|
1864
|
+
return { keyframes: n.keyframesMap, atProperty: f, cssRules: s, listsRule: l, timelineScopeRule: d };
|
|
1825
1865
|
}
|
|
1826
|
-
function
|
|
1827
|
-
const { cssRules: n, keyframes: s, atProperty: i, listsRule: o, timelineScopeRule: r } =
|
|
1866
|
+
function zi(e, t) {
|
|
1867
|
+
const { cssRules: n, keyframes: s, atProperty: i, listsRule: o, timelineScopeRule: r } = ws(
|
|
1828
1868
|
e,
|
|
1829
1869
|
t
|
|
1830
1870
|
);
|
|
1831
1871
|
return [
|
|
1832
1872
|
...i,
|
|
1833
|
-
...[...s.entries()].map(([
|
|
1834
|
-
...n.map(
|
|
1873
|
+
...[...s.entries()].map(([l, u]) => ts(l, u)),
|
|
1874
|
+
...n.map(ns),
|
|
1835
1875
|
o,
|
|
1836
1876
|
r
|
|
1837
|
-
].filter((
|
|
1877
|
+
].filter((l) => l).join(`
|
|
1838
1878
|
`);
|
|
1839
1879
|
}
|
|
1840
|
-
const
|
|
1880
|
+
const $s = {
|
|
1841
1881
|
root: null,
|
|
1842
1882
|
rootMargin: "0px 0px -10% 0px",
|
|
1843
1883
|
threshold: [0]
|
|
1844
|
-
},
|
|
1884
|
+
}, bs = {
|
|
1845
1885
|
root: null,
|
|
1846
1886
|
rootMargin: "0px",
|
|
1847
1887
|
threshold: [0]
|
|
1848
|
-
},
|
|
1849
|
-
function
|
|
1888
|
+
}, Ss = 0.2;
|
|
1889
|
+
function Is(e) {
|
|
1850
1890
|
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
1891
|
return `${i(n)} 0px ${i(s)}`;
|
|
1852
1892
|
}
|
|
1853
|
-
const
|
|
1854
|
-
let
|
|
1855
|
-
function
|
|
1856
|
-
|
|
1893
|
+
const X = {}, N = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakSet(), Y = /* @__PURE__ */ new WeakMap();
|
|
1894
|
+
let Rt = {}, B = null;
|
|
1895
|
+
function Ts(e) {
|
|
1896
|
+
Rt = e;
|
|
1857
1897
|
}
|
|
1858
|
-
function
|
|
1859
|
-
|
|
1898
|
+
function xt(e, t, n) {
|
|
1899
|
+
N.get(e)?.forEach(({ source: i, handler: o }) => {
|
|
1860
1900
|
i === e && o(t, n);
|
|
1861
1901
|
});
|
|
1862
1902
|
}
|
|
1863
|
-
function
|
|
1903
|
+
function Xe() {
|
|
1864
1904
|
return B || (B = new IntersectionObserver((e) => {
|
|
1865
1905
|
e.forEach((t) => {
|
|
1866
1906
|
const n = t.target;
|
|
1867
|
-
t.isIntersecting ||
|
|
1907
|
+
t.isIntersecting || xt(n, !1, !0);
|
|
1868
1908
|
});
|
|
1869
|
-
},
|
|
1909
|
+
}, bs), B);
|
|
1870
1910
|
}
|
|
1871
|
-
function
|
|
1911
|
+
function Nt(e, t = !1) {
|
|
1872
1912
|
const n = JSON.stringify({ ...e, isSafeMode: t });
|
|
1873
|
-
if (
|
|
1874
|
-
return
|
|
1875
|
-
const s = e.threshold ??
|
|
1913
|
+
if (X[n])
|
|
1914
|
+
return X[n];
|
|
1915
|
+
const s = e.threshold ?? Ss, i = t ? $s : {
|
|
1876
1916
|
root: null,
|
|
1877
|
-
rootMargin: e.inset ?
|
|
1917
|
+
rootMargin: e.inset ? Is(e.inset) : "0px",
|
|
1878
1918
|
threshold: s
|
|
1879
1919
|
}, o = new IntersectionObserver((r) => {
|
|
1880
|
-
r.forEach((
|
|
1881
|
-
const
|
|
1882
|
-
if (u && (
|
|
1883
|
-
|
|
1884
|
-
const
|
|
1920
|
+
r.forEach((c) => {
|
|
1921
|
+
const l = c.target, u = !ye.has(l);
|
|
1922
|
+
if (u && (ye.add(l), e.useSafeViewEnter && !c.isIntersecting)) {
|
|
1923
|
+
A.measure(() => {
|
|
1924
|
+
const a = c.boundingClientRect.height, f = c.rootBounds?.height;
|
|
1885
1925
|
if (!f)
|
|
1886
1926
|
return;
|
|
1887
1927
|
const d = Array.isArray(e.threshold) ? Math.min(...e.threshold) : e.threshold;
|
|
1888
|
-
d &&
|
|
1889
|
-
o.unobserve(
|
|
1890
|
-
const m =
|
|
1891
|
-
Y.set(
|
|
1928
|
+
d && a * d > f && A.mutate(() => {
|
|
1929
|
+
o.unobserve(l);
|
|
1930
|
+
const m = Nt(e, !0);
|
|
1931
|
+
Y.set(l, m), m.observe(l);
|
|
1892
1932
|
});
|
|
1893
1933
|
});
|
|
1894
1934
|
return;
|
|
1895
1935
|
}
|
|
1896
|
-
(
|
|
1936
|
+
(c.isIntersecting || !u) && xt(l, c.isIntersecting);
|
|
1897
1937
|
});
|
|
1898
1938
|
}, i);
|
|
1899
|
-
return
|
|
1939
|
+
return X[n] = o, o;
|
|
1900
1940
|
}
|
|
1901
|
-
function
|
|
1902
|
-
const
|
|
1941
|
+
function Cs(e, t, n, s = {}, { reducedMotion: i, selectorCondition: o, animation: r } = {}) {
|
|
1942
|
+
const c = { ...Rt, ...s }, l = n.triggerType || "once", u = r || se(
|
|
1903
1943
|
t,
|
|
1904
|
-
|
|
1944
|
+
x(n),
|
|
1905
1945
|
void 0,
|
|
1906
1946
|
i
|
|
1907
1947
|
);
|
|
1908
1948
|
if (!u)
|
|
1909
1949
|
return;
|
|
1910
|
-
const
|
|
1911
|
-
|
|
1950
|
+
const a = Nt(c);
|
|
1951
|
+
l !== "once" && u.persist?.();
|
|
1912
1952
|
let f = !0, d = !1, h;
|
|
1913
|
-
h = { source: e, target: t, handler: (
|
|
1953
|
+
h = { source: e, target: t, handler: (g, y) => {
|
|
1914
1954
|
if (!(o && !t.matches(o)))
|
|
1915
|
-
if (
|
|
1916
|
-
if (
|
|
1955
|
+
if (l === "once") {
|
|
1956
|
+
if (g && !d) {
|
|
1917
1957
|
d = !0;
|
|
1918
|
-
const
|
|
1919
|
-
(!
|
|
1920
|
-
|
|
1958
|
+
const E = N.get(e);
|
|
1959
|
+
(!E || E.size === 0 || E.size === 1 && E.has(h)) && ((Y.get(e) || a).unobserve(e), ye.delete(e)), u.onFinish(() => {
|
|
1960
|
+
N.get(e)?.delete(h), N.get(t)?.delete(h);
|
|
1921
1961
|
}), u.play(() => {
|
|
1922
|
-
const
|
|
1962
|
+
const v = () => {
|
|
1923
1963
|
t.dataset.interactEnter = "start";
|
|
1924
|
-
}
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
requestAnimationFrame(E);
|
|
1964
|
+
}, w = () => {
|
|
1965
|
+
A.mutate(() => {
|
|
1966
|
+
t.dataset.interactEnter = "done";
|
|
1928
1967
|
});
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
};
|
|
1934
|
-
u.onFinish(w), u.onAbort(w);
|
|
1935
|
-
} else
|
|
1936
|
-
O.mutate(E);
|
|
1968
|
+
};
|
|
1969
|
+
u.isCSS ? (A.mutate(() => {
|
|
1970
|
+
requestAnimationFrame(v);
|
|
1971
|
+
}), u.onFinish(w), u.onAbort(w)) : (A.mutate(v), u.onFinish(w));
|
|
1937
1972
|
});
|
|
1938
1973
|
}
|
|
1939
|
-
} else
|
|
1974
|
+
} else l === "alternate" ? f && g ? (f = !1, u.play()) : f || u.reverse() : l === "repeat" ? g ? (u.progress(0), u.play()) : y && (u.pause(), u.progress(0)) : l === "state" && (g ? u.play() : y && u.pause());
|
|
1940
1975
|
}, cleanup: () => {
|
|
1941
|
-
(Y.get(e) ||
|
|
1942
|
-
} }, k(
|
|
1976
|
+
(Y.get(e) || a).unobserve(e), (l === "repeat" || l === "state") && Xe().unobserve(e), u.cancel(), ye.delete(e), Y.delete(e);
|
|
1977
|
+
} }, k(N, e, h), k(N, t, h), Y.set(e, a), a.observe(e), (l === "repeat" || l === "state") && Xe().observe(e);
|
|
1943
1978
|
}
|
|
1944
|
-
function
|
|
1945
|
-
|
|
1979
|
+
function Os(e) {
|
|
1980
|
+
oe(N, e);
|
|
1946
1981
|
}
|
|
1947
|
-
function
|
|
1948
|
-
B = null, Object.keys(
|
|
1982
|
+
function _s() {
|
|
1983
|
+
B = null, Object.keys(X).forEach((e) => delete X[e]);
|
|
1949
1984
|
}
|
|
1950
|
-
const
|
|
1951
|
-
add:
|
|
1952
|
-
remove:
|
|
1953
|
-
setOptions:
|
|
1954
|
-
reset:
|
|
1985
|
+
const As = {
|
|
1986
|
+
add: Cs,
|
|
1987
|
+
remove: Os,
|
|
1988
|
+
setOptions: Ts,
|
|
1989
|
+
reset: _s
|
|
1955
1990
|
};
|
|
1956
|
-
function
|
|
1991
|
+
function jt(e, t) {
|
|
1957
1992
|
return Object.assign(Object.create(t), e);
|
|
1958
1993
|
}
|
|
1959
|
-
function
|
|
1994
|
+
function Ms(e, t, n, s) {
|
|
1960
1995
|
let i = e * (1 - n) + t * n;
|
|
1961
1996
|
if (s) {
|
|
1962
1997
|
const o = i - e;
|
|
@@ -1967,7 +2002,7 @@ function Ts(e, t, n, s) {
|
|
|
1967
2002
|
}
|
|
1968
2003
|
return i;
|
|
1969
2004
|
}
|
|
1970
|
-
function
|
|
2005
|
+
function ks(e) {
|
|
1971
2006
|
let t = !1;
|
|
1972
2007
|
return function() {
|
|
1973
2008
|
t || (t = !0, window.requestAnimationFrame(() => {
|
|
@@ -1975,7 +2010,7 @@ function Cs(e) {
|
|
|
1975
2010
|
}));
|
|
1976
2011
|
};
|
|
1977
2012
|
}
|
|
1978
|
-
function
|
|
2013
|
+
function Ze(e, t) {
|
|
1979
2014
|
let n = 0;
|
|
1980
2015
|
return function() {
|
|
1981
2016
|
n && window.clearTimeout(n), n = window.setTimeout(() => {
|
|
@@ -1983,38 +2018,38 @@ function Qe(e, t) {
|
|
|
1983
2018
|
}, t);
|
|
1984
2019
|
};
|
|
1985
2020
|
}
|
|
1986
|
-
function
|
|
2021
|
+
function qs(e, t) {
|
|
1987
2022
|
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
|
|
2023
|
+
return Ee(n[1], t) + Ee(n[6], t);
|
|
1989
2024
|
}
|
|
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) ?
|
|
2025
|
+
function Ee(e, t) {
|
|
2026
|
+
return e ? /^-?\d+px$/.test(e) ? parseInt(e) : /^-?\d+[lsd]?vh$/.test(e) ? parseInt(e) * t.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(e) ? parseInt(e) * t.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(e) ? qs(e, t) : parseInt(e) || 0 : 0;
|
|
1992
2027
|
}
|
|
1993
2028
|
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,
|
|
2029
|
+
const { name: s, offset: i = 0 } = e, { start: o, end: r } = n, c = r - o, l = i / 100;
|
|
2030
|
+
let u, a;
|
|
2031
|
+
return s === "entry" ? (u = o - t, a = Math.min(t, c)) : s === "entry-crossing" ? (u = o - t, a = c) : s === "contain" ? (u = Math.min(r - t, o), a = Math.abs(t - c)) : s === "exit" ? (u = Math.max(o, r - t), a = Math.min(t, c)) : s === "exit-crossing" ? (u = o, a = c) : s === "cover" && (u = o - t, a = c + t), u + l * a | 0;
|
|
1997
2032
|
}
|
|
1998
|
-
function
|
|
2033
|
+
function Oe(e, t, n, s, i) {
|
|
1999
2034
|
let o = 0;
|
|
2000
2035
|
const r = { start: t, end: n };
|
|
2001
|
-
return e.forEach((
|
|
2002
|
-
o +=
|
|
2003
|
-
const u =
|
|
2036
|
+
return e.forEach((c, l) => {
|
|
2037
|
+
o += c.offset;
|
|
2038
|
+
const u = c.sticky;
|
|
2004
2039
|
if (u) {
|
|
2005
|
-
if ("end" in u && e[
|
|
2006
|
-
const d = ((i ?
|
|
2007
|
-
let
|
|
2008
|
-
(m || p) && (
|
|
2040
|
+
if ("end" in u && e[l - 1]?.element) {
|
|
2041
|
+
const d = ((i ? c.element.offsetWidth : c.element.offsetHeight) || 0) + u.end - s, h = o + d - c.offset, m = h < r.start, p = !m && h <= n;
|
|
2042
|
+
let g = 0;
|
|
2043
|
+
(m || p) && (g = c.offset, r.end += g), m && (r.start += g);
|
|
2009
2044
|
}
|
|
2010
2045
|
if ("start" in u) {
|
|
2011
|
-
const
|
|
2046
|
+
const a = o - u.start, f = a < r.start, d = !f && a <= r.end;
|
|
2012
2047
|
let h = 0;
|
|
2013
|
-
const m = e[
|
|
2048
|
+
const m = e[l - 1]?.element;
|
|
2014
2049
|
if (m) {
|
|
2015
2050
|
if (f || d) {
|
|
2016
|
-
const p = (i ? m.offsetWidth : m.offsetHeight) || 0,
|
|
2017
|
-
h = p - (
|
|
2051
|
+
const p = (i ? m.offsetWidth : m.offsetHeight) || 0, g = c.offset, y = (i ? c.element.offsetWidth : c.element.offsetHeight) || 0;
|
|
2052
|
+
h = p - (g + y), o += h, r.end += h;
|
|
2018
2053
|
}
|
|
2019
2054
|
f && (r.start += h);
|
|
2020
2055
|
}
|
|
@@ -2022,55 +2057,55 @@ function Te(e, t, n, s, i) {
|
|
|
2022
2057
|
}
|
|
2023
2058
|
}), r;
|
|
2024
2059
|
}
|
|
2025
|
-
function
|
|
2026
|
-
const { start: r, end:
|
|
2027
|
-
let u = r,
|
|
2028
|
-
if (typeof
|
|
2029
|
-
f = { name:
|
|
2030
|
-
const m =
|
|
2031
|
-
u = m.start,
|
|
2060
|
+
function Ps(e, t, n, s, i, o) {
|
|
2061
|
+
const { start: r, end: c, duration: l } = e;
|
|
2062
|
+
let u = r, a = c, f = e.startRange, d = e.endRange, h;
|
|
2063
|
+
if (typeof l == "string") {
|
|
2064
|
+
f = { name: l, offset: 0 }, d = { name: l, offset: 100 }, u = z(f, n, t), a = z(d, n, t), h = a - u;
|
|
2065
|
+
const m = Oe(o, u, a, n, s);
|
|
2066
|
+
u = m.start, a = m.end;
|
|
2032
2067
|
} else {
|
|
2033
2068
|
if (f || r?.name) {
|
|
2034
2069
|
f = f || r;
|
|
2035
|
-
const m =
|
|
2070
|
+
const m = Ee(f.add, i), p = z({ ...f, offset: 0 }, n, t), g = z({ ...f, offset: 100 }, n, t), y = Oe(o, p, g, n, s);
|
|
2036
2071
|
u = y.start + f.offset / 100 * (y.end - y.start) + m;
|
|
2037
2072
|
}
|
|
2038
|
-
if (d ||
|
|
2039
|
-
d = d ||
|
|
2040
|
-
const m =
|
|
2041
|
-
|
|
2042
|
-
} else typeof
|
|
2073
|
+
if (d || c?.name) {
|
|
2074
|
+
d = d || c;
|
|
2075
|
+
const m = Ee(d.add, i), p = z({ ...d, offset: 0 }, n, t), g = z({ ...d, offset: 100 }, n, t), y = Oe(o, p, g, n, s);
|
|
2076
|
+
a = y.start + d.offset / 100 * (y.end - y.start) + m;
|
|
2077
|
+
} else typeof l == "number" && (a = u + l);
|
|
2043
2078
|
}
|
|
2044
|
-
return !h && !
|
|
2079
|
+
return !h && !l && (h = a - u), { ...e, start: u, end: a, startRange: f, endRange: d, duration: h || l };
|
|
2045
2080
|
}
|
|
2046
|
-
function
|
|
2081
|
+
function Ls(e) {
|
|
2047
2082
|
return e.position === "sticky";
|
|
2048
2083
|
}
|
|
2049
|
-
function
|
|
2084
|
+
function Fs(e, t, n) {
|
|
2050
2085
|
return e.position === "fixed" && (!t || t === window.document.body || t === n);
|
|
2051
2086
|
}
|
|
2052
|
-
function
|
|
2087
|
+
function Rs(e, t) {
|
|
2053
2088
|
return parseInt(t ? e.left : e.top);
|
|
2054
2089
|
}
|
|
2055
|
-
function
|
|
2090
|
+
function xs(e, t) {
|
|
2056
2091
|
return parseInt(t ? e.right : e.bottom);
|
|
2057
2092
|
}
|
|
2058
|
-
function
|
|
2093
|
+
function Ns(e, t, n) {
|
|
2059
2094
|
n && (e.style.position = "static");
|
|
2060
2095
|
const s = (t ? e.offsetLeft : e.offsetTop) || 0;
|
|
2061
2096
|
return n && (e.style.position = null), s;
|
|
2062
2097
|
}
|
|
2063
|
-
function
|
|
2098
|
+
function js(e, t) {
|
|
2064
2099
|
let n;
|
|
2065
|
-
const s =
|
|
2100
|
+
const s = Rs(e, t), i = xs(e, t), o = !isNaN(s), r = !isNaN(i);
|
|
2066
2101
|
return (o || r) && (n = {}, o && (n.start = s), r && (n.end = i)), n;
|
|
2067
2102
|
}
|
|
2068
|
-
function
|
|
2103
|
+
function ce(e, t, n, s, i) {
|
|
2069
2104
|
const o = e[0].viewSource, r = [];
|
|
2070
|
-
let
|
|
2105
|
+
let c = (s ? o.offsetWidth : o.offsetHeight) || 0, l = 0, u = o;
|
|
2071
2106
|
for (; u; ) {
|
|
2072
|
-
const f = window.getComputedStyle(u), d =
|
|
2073
|
-
if ((!h || !("end" in h)) && (
|
|
2107
|
+
const f = window.getComputedStyle(u), d = Ls(f), h = d ? js(f, s) : void 0, m = Ns(u, s, d);
|
|
2108
|
+
if ((!h || !("end" in h)) && (l += m), r.push({ element: u, offset: m, sticky: h }), u = u.offsetParent, Fs(f, u, t))
|
|
2074
2109
|
break;
|
|
2075
2110
|
if (u === t) {
|
|
2076
2111
|
r.push({ element: u, offset: 0 });
|
|
@@ -2078,9 +2113,9 @@ function re(e, t, n, s, i) {
|
|
|
2078
2113
|
}
|
|
2079
2114
|
}
|
|
2080
2115
|
return r.reverse(), e.map((f) => ({
|
|
2081
|
-
...
|
|
2116
|
+
...Ps(
|
|
2082
2117
|
f,
|
|
2083
|
-
{ start:
|
|
2118
|
+
{ start: l, end: l + c },
|
|
2084
2119
|
n,
|
|
2085
2120
|
s,
|
|
2086
2121
|
i,
|
|
@@ -2088,7 +2123,7 @@ function re(e, t, n, s, i) {
|
|
|
2088
2123
|
)
|
|
2089
2124
|
}));
|
|
2090
2125
|
}
|
|
2091
|
-
const
|
|
2126
|
+
const Je = 100, zs = {
|
|
2092
2127
|
horizontal: !1,
|
|
2093
2128
|
observeViewportEntry: !0,
|
|
2094
2129
|
viewportRootMargin: "7% 7%",
|
|
@@ -2096,74 +2131,74 @@ const Xe = 100, xs = {
|
|
|
2096
2131
|
observeSourcesResize: !1,
|
|
2097
2132
|
observeContentResize: !1
|
|
2098
2133
|
};
|
|
2099
|
-
function
|
|
2134
|
+
function Hs(e, t, n, s) {
|
|
2100
2135
|
let i = 0;
|
|
2101
2136
|
return e >= t && e <= n ? i = s ? (e - t) / s : 1 : e > n && (i = 1), i;
|
|
2102
2137
|
}
|
|
2103
|
-
function
|
|
2138
|
+
function et(e, t) {
|
|
2104
2139
|
return e === window ? t ? window.document.documentElement.clientWidth : window.document.documentElement.clientHeight : t ? e.clientWidth : e.clientHeight;
|
|
2105
2140
|
}
|
|
2106
|
-
function
|
|
2141
|
+
function Ds() {
|
|
2107
2142
|
return {
|
|
2108
2143
|
viewportWidth: window.document.documentElement.clientWidth,
|
|
2109
2144
|
viewportHeight: window.document.documentElement.clientHeight
|
|
2110
2145
|
};
|
|
2111
2146
|
}
|
|
2112
|
-
function
|
|
2113
|
-
const t =
|
|
2114
|
-
let o =
|
|
2115
|
-
const f = [], d =
|
|
2147
|
+
function Gs(e) {
|
|
2148
|
+
const t = jt(e, zs), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
|
|
2149
|
+
let o = et(n, s), r, c, l, u, a;
|
|
2150
|
+
const f = [], d = Ds();
|
|
2116
2151
|
if (t.scenes = Object.values(
|
|
2117
2152
|
// TODO(ameerf): find a polyfill and use groupBy instead of following reduce
|
|
2118
2153
|
e.scenes.reduce(
|
|
2119
|
-
(p,
|
|
2120
|
-
const
|
|
2121
|
-
return p[
|
|
2154
|
+
(p, g, y) => {
|
|
2155
|
+
const E = g.groupId ? `group-${g.groupId}` : String(y);
|
|
2156
|
+
return p[E] ? p[E].push(g) : p[E] = [g], p;
|
|
2122
2157
|
},
|
|
2123
2158
|
{}
|
|
2124
2159
|
)
|
|
2125
|
-
).flatMap((p) => (p.every((
|
|
2126
|
-
|
|
2127
|
-
}), p)), t.scenes.forEach((p,
|
|
2128
|
-
p.index =
|
|
2160
|
+
).flatMap((p) => (p.every((g) => g.viewSource && (typeof g.duration == "string" || g.start?.name)) ? (p = ce(p, n, o, s, d), (t.observeSourcesResize || t.observeContentResize) && f.push(p)) : p.forEach((g) => {
|
|
2161
|
+
g.end == null && (g.end = g.start + g.duration), g.duration == null && (g.duration = g.end - g.start);
|
|
2162
|
+
}), p)), t.scenes.forEach((p, g) => {
|
|
2163
|
+
p.index = g;
|
|
2129
2164
|
}), f.length) {
|
|
2130
2165
|
const p = /* @__PURE__ */ new Map();
|
|
2131
|
-
window.ResizeObserver && (
|
|
2132
|
-
|
|
2133
|
-
const
|
|
2134
|
-
|
|
2135
|
-
t.scenes[w.index] =
|
|
2136
|
-
}), f.splice(f.indexOf(
|
|
2166
|
+
window.ResizeObserver && (l = new window.ResizeObserver(function(g) {
|
|
2167
|
+
g.forEach((y) => {
|
|
2168
|
+
const E = p.get(y.target), v = ce(E, n, o, s, d);
|
|
2169
|
+
v.forEach((w, b) => {
|
|
2170
|
+
t.scenes[w.index] = v[b];
|
|
2171
|
+
}), f.splice(f.indexOf(E), 1, v);
|
|
2137
2172
|
});
|
|
2138
|
-
}), f.forEach((
|
|
2139
|
-
|
|
2140
|
-
}), t.observeContentResize && t.contentRoot && new window.ResizeObserver(
|
|
2141
|
-
const y = f.map((
|
|
2142
|
-
const
|
|
2143
|
-
return
|
|
2144
|
-
t.scenes[w.index] =
|
|
2145
|
-
}),
|
|
2173
|
+
}), f.forEach((g) => {
|
|
2174
|
+
l.observe(g[0].viewSource, { box: "border-box" }), p.set(g[0].viewSource, g);
|
|
2175
|
+
}), t.observeContentResize && t.contentRoot && new window.ResizeObserver(Ze(() => {
|
|
2176
|
+
const y = f.map((E) => {
|
|
2177
|
+
const v = ce(E, n, o, s, d);
|
|
2178
|
+
return v.forEach((w, b) => {
|
|
2179
|
+
t.scenes[w.index] = v[b];
|
|
2180
|
+
}), v;
|
|
2146
2181
|
});
|
|
2147
|
-
f.length = 0, f.push(...y), f.forEach((
|
|
2148
|
-
p.set(
|
|
2182
|
+
f.length = 0, f.push(...y), f.forEach((E) => {
|
|
2183
|
+
p.set(E[0].viewSource, E);
|
|
2149
2184
|
});
|
|
2150
|
-
},
|
|
2151
|
-
o =
|
|
2152
|
-
const
|
|
2153
|
-
const
|
|
2154
|
-
return
|
|
2155
|
-
t.scenes[
|
|
2156
|
-
}),
|
|
2185
|
+
}, Je)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (u = Ze(function() {
|
|
2186
|
+
o = et(n, s);
|
|
2187
|
+
const g = f.map((y) => {
|
|
2188
|
+
const E = ce(y, n, o, s, d);
|
|
2189
|
+
return E.forEach((v, w) => {
|
|
2190
|
+
t.scenes[v.index] = E[w];
|
|
2191
|
+
}), E;
|
|
2157
2192
|
});
|
|
2158
|
-
f.length = 0, f.push(...
|
|
2193
|
+
f.length = 0, f.push(...g), f.forEach((y) => {
|
|
2159
2194
|
p.set(y[0].viewSource, y);
|
|
2160
2195
|
});
|
|
2161
|
-
},
|
|
2196
|
+
}, Je), n === window ? window.addEventListener("resize", u) : window.ResizeObserver && (a = new window.ResizeObserver(u), a.observe(n, { box: "border-box" })));
|
|
2162
2197
|
}
|
|
2163
|
-
t.observeViewportEntry && window.IntersectionObserver && (
|
|
2164
|
-
p.forEach((
|
|
2165
|
-
(i.get(
|
|
2166
|
-
y.disabled = !
|
|
2198
|
+
t.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(p) {
|
|
2199
|
+
p.forEach((g) => {
|
|
2200
|
+
(i.get(g.target) || []).forEach((y) => {
|
|
2201
|
+
y.disabled = !g.isIntersecting;
|
|
2167
2202
|
});
|
|
2168
2203
|
});
|
|
2169
2204
|
}, {
|
|
@@ -2172,40 +2207,40 @@ function Ns(e) {
|
|
|
2172
2207
|
threshold: 0
|
|
2173
2208
|
}), t.scenes.forEach((p) => {
|
|
2174
2209
|
if (p.viewSource) {
|
|
2175
|
-
let
|
|
2176
|
-
|
|
2210
|
+
let g = i.get(p.viewSource);
|
|
2211
|
+
g || (g = [], i.set(p.viewSource, g), c.observe(p.viewSource)), g.push(p);
|
|
2177
2212
|
}
|
|
2178
2213
|
}));
|
|
2179
|
-
function h({ p, vp:
|
|
2214
|
+
function h({ p, vp: g }) {
|
|
2180
2215
|
p = +p.toFixed(1);
|
|
2181
|
-
const y = +
|
|
2216
|
+
const y = +g.toFixed(4);
|
|
2182
2217
|
if (p !== r) {
|
|
2183
|
-
for (let
|
|
2184
|
-
if (!
|
|
2185
|
-
const { start:
|
|
2186
|
-
|
|
2218
|
+
for (let E of t.scenes)
|
|
2219
|
+
if (!E.disabled) {
|
|
2220
|
+
const { start: v, end: w, duration: b } = E, S = Hs(p, v, w, b);
|
|
2221
|
+
E.effect(E, S, y);
|
|
2187
2222
|
}
|
|
2188
2223
|
r = p;
|
|
2189
2224
|
}
|
|
2190
2225
|
}
|
|
2191
2226
|
function m() {
|
|
2192
|
-
t.scenes.forEach((p) => p.destroy?.()),
|
|
2227
|
+
t.scenes.forEach((p) => p.destroy?.()), c && (c.disconnect(), c = null), l && (l.disconnect(), l = null), u && (a ? (a.disconnect(), a = null) : window.removeEventListener("resize", u));
|
|
2193
2228
|
}
|
|
2194
2229
|
return {
|
|
2195
2230
|
tick: h,
|
|
2196
2231
|
destroy: m
|
|
2197
2232
|
};
|
|
2198
2233
|
}
|
|
2199
|
-
const
|
|
2234
|
+
const Ws = {
|
|
2200
2235
|
transitionActive: !1,
|
|
2201
2236
|
transitionFriction: 0.9,
|
|
2202
2237
|
transitionEpsilon: 1,
|
|
2203
2238
|
velocityActive: !1,
|
|
2204
2239
|
velocityMax: 1
|
|
2205
2240
|
};
|
|
2206
|
-
class
|
|
2241
|
+
class Vs {
|
|
2207
2242
|
constructor(t = {}) {
|
|
2208
|
-
this.config =
|
|
2243
|
+
this.config = jt(t, Ws), this.progress = {
|
|
2209
2244
|
p: 0,
|
|
2210
2245
|
prevP: 0,
|
|
2211
2246
|
vp: 0
|
|
@@ -2218,7 +2253,7 @@ class zs {
|
|
|
2218
2253
|
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
2254
|
const s = this.config.root;
|
|
2220
2255
|
this.progress.p = this.config.horizontal ? s.scrollX || s.scrollLeft || 0 : s.scrollY || s.scrollTop || 0;
|
|
2221
|
-
}), this._trigger =
|
|
2256
|
+
}), this._trigger = ks(() => {
|
|
2222
2257
|
this._measure?.(), this.tick(!0);
|
|
2223
2258
|
});
|
|
2224
2259
|
}
|
|
@@ -2264,7 +2299,7 @@ class zs {
|
|
|
2264
2299
|
* Calculate current progress.
|
|
2265
2300
|
*/
|
|
2266
2301
|
lerp() {
|
|
2267
|
-
this.currentProgress.p =
|
|
2302
|
+
this.currentProgress.p = Ms(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
|
|
2268
2303
|
}
|
|
2269
2304
|
/**
|
|
2270
2305
|
* Stop the event and effect, and remove all DOM side-effects.
|
|
@@ -2288,7 +2323,7 @@ class zs {
|
|
|
2288
2323
|
* Reset registered effect.
|
|
2289
2324
|
*/
|
|
2290
2325
|
setupEffect() {
|
|
2291
|
-
this.removeEffect(), this.effect =
|
|
2326
|
+
this.removeEffect(), this.effect = Gs(this.config);
|
|
2292
2327
|
}
|
|
2293
2328
|
/**
|
|
2294
2329
|
* Remove registered effect.
|
|
@@ -2297,42 +2332,42 @@ class zs {
|
|
|
2297
2332
|
this.effect && this.effect.destroy(), this.effect = null;
|
|
2298
2333
|
}
|
|
2299
2334
|
}
|
|
2300
|
-
const
|
|
2301
|
-
let
|
|
2302
|
-
function
|
|
2303
|
-
|
|
2335
|
+
const Le = /* @__PURE__ */ new WeakMap();
|
|
2336
|
+
let zt = () => ({});
|
|
2337
|
+
function Ks(e) {
|
|
2338
|
+
zt = e;
|
|
2304
2339
|
}
|
|
2305
|
-
function
|
|
2340
|
+
function Ys(e, t, n, s, { reducedMotion: i, selectorCondition: o }) {
|
|
2306
2341
|
if (i || o && !t.matches(o)) return;
|
|
2307
2342
|
const r = {
|
|
2308
2343
|
trigger: "view-progress",
|
|
2309
2344
|
element: e
|
|
2310
|
-
},
|
|
2311
|
-
let
|
|
2345
|
+
}, c = x(n);
|
|
2346
|
+
let l;
|
|
2312
2347
|
if ("ViewTimeline" in window) {
|
|
2313
|
-
const
|
|
2348
|
+
const a = se(
|
|
2314
2349
|
t,
|
|
2315
|
-
|
|
2350
|
+
c,
|
|
2316
2351
|
r
|
|
2317
2352
|
);
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2353
|
+
a && !a.isCSS && (a.play(), l = () => {
|
|
2354
|
+
a.ready.then(() => {
|
|
2355
|
+
a.cancel();
|
|
2321
2356
|
});
|
|
2322
2357
|
});
|
|
2323
2358
|
} else {
|
|
2324
|
-
const
|
|
2325
|
-
if (
|
|
2326
|
-
const f = Array.isArray(
|
|
2359
|
+
const a = bt(t, c, r);
|
|
2360
|
+
if (a) {
|
|
2361
|
+
const f = Array.isArray(a) ? a : [a], d = new Vs({
|
|
2327
2362
|
viewSource: e,
|
|
2328
2363
|
scenes: f,
|
|
2329
2364
|
observeViewportEntry: !1,
|
|
2330
2365
|
observeViewportResize: !1,
|
|
2331
2366
|
observeSourcesResize: !0,
|
|
2332
2367
|
root: document.body,
|
|
2333
|
-
...
|
|
2368
|
+
...zt()
|
|
2334
2369
|
});
|
|
2335
|
-
|
|
2370
|
+
l = () => {
|
|
2336
2371
|
d.destroy();
|
|
2337
2372
|
}, Promise.all(f.map((h) => h.ready || Promise.resolve())).then(
|
|
2338
2373
|
() => {
|
|
@@ -2341,22 +2376,22 @@ function Ds(e, t, n, s, { reducedMotion: i, selectorCondition: o }) {
|
|
|
2341
2376
|
);
|
|
2342
2377
|
}
|
|
2343
2378
|
}
|
|
2344
|
-
if (!
|
|
2345
|
-
const u = { source: e, target: t, cleanup:
|
|
2346
|
-
k(
|
|
2379
|
+
if (!l) return;
|
|
2380
|
+
const u = { source: e, target: t, cleanup: l };
|
|
2381
|
+
k(Le, e, u), k(Le, t, u);
|
|
2347
2382
|
}
|
|
2348
|
-
function
|
|
2349
|
-
|
|
2383
|
+
function Bs(e) {
|
|
2384
|
+
oe(Le, e);
|
|
2350
2385
|
}
|
|
2351
|
-
const
|
|
2352
|
-
add:
|
|
2353
|
-
remove:
|
|
2354
|
-
registerOptionsGetter:
|
|
2386
|
+
const Us = {
|
|
2387
|
+
add: Ys,
|
|
2388
|
+
remove: Bs,
|
|
2389
|
+
registerOptionsGetter: Ks
|
|
2355
2390
|
};
|
|
2356
|
-
function
|
|
2391
|
+
function tt(e, t, n) {
|
|
2357
2392
|
return Math.min(Math.max(e, n), t);
|
|
2358
2393
|
}
|
|
2359
|
-
function
|
|
2394
|
+
function nt(e) {
|
|
2360
2395
|
let t = !1;
|
|
2361
2396
|
return function() {
|
|
2362
2397
|
if (!t)
|
|
@@ -2365,7 +2400,7 @@ function et(e) {
|
|
|
2365
2400
|
});
|
|
2366
2401
|
};
|
|
2367
2402
|
}
|
|
2368
|
-
function
|
|
2403
|
+
function Qs(e) {
|
|
2369
2404
|
let t = e, n = 0, s = 0;
|
|
2370
2405
|
if (t.offsetParent)
|
|
2371
2406
|
do
|
|
@@ -2378,7 +2413,7 @@ function Vs(e) {
|
|
|
2378
2413
|
height: e.offsetHeight
|
|
2379
2414
|
};
|
|
2380
2415
|
}
|
|
2381
|
-
function
|
|
2416
|
+
function Xs() {
|
|
2382
2417
|
const e = window.devicePixelRatio;
|
|
2383
2418
|
let t = !1;
|
|
2384
2419
|
if (e === 1)
|
|
@@ -2391,13 +2426,13 @@ function Ks() {
|
|
|
2391
2426
|
});
|
|
2392
2427
|
return document.body.dispatchEvent(n), t;
|
|
2393
2428
|
}
|
|
2394
|
-
function
|
|
2429
|
+
function Zs() {
|
|
2395
2430
|
return new Promise((e) => {
|
|
2396
2431
|
const t = window.scrollY;
|
|
2397
2432
|
let n = !1, s;
|
|
2398
2433
|
function i() {
|
|
2399
|
-
document.body.addEventListener("pointerdown", (
|
|
2400
|
-
s === void 0 ? s =
|
|
2434
|
+
document.body.addEventListener("pointerdown", (c) => {
|
|
2435
|
+
s === void 0 ? s = c.offsetY : n = c.offsetY === s;
|
|
2401
2436
|
}, { once: !0 });
|
|
2402
2437
|
const r = new PointerEvent("pointerdown", {
|
|
2403
2438
|
clientY: 500
|
|
@@ -2410,60 +2445,60 @@ function Ys() {
|
|
|
2410
2445
|
i(), window.addEventListener("scroll", o), window.scrollY > 0 && window.scrollBy(0, -1);
|
|
2411
2446
|
});
|
|
2412
2447
|
}
|
|
2413
|
-
function
|
|
2414
|
-
|
|
2448
|
+
function Js(e) {
|
|
2449
|
+
Zs().then((t) => {
|
|
2415
2450
|
e.fixRequired = t, t && (window.addEventListener("scroll", e.scrollHandler), e.scrollHandler());
|
|
2416
2451
|
});
|
|
2417
2452
|
}
|
|
2418
|
-
let
|
|
2419
|
-
const
|
|
2420
|
-
function
|
|
2453
|
+
let le = 0;
|
|
2454
|
+
const pe = /* @__PURE__ */ new Set();
|
|
2455
|
+
function ei() {
|
|
2421
2456
|
const e = (n) => {
|
|
2422
2457
|
for (let s of n.changedTouches)
|
|
2423
|
-
|
|
2458
|
+
pe.add(s.identifier);
|
|
2424
2459
|
}, t = (n) => {
|
|
2425
2460
|
for (let s of n.changedTouches)
|
|
2426
|
-
|
|
2461
|
+
pe.delete(s.identifier);
|
|
2427
2462
|
};
|
|
2428
2463
|
return document.addEventListener("touchstart", e, { passive: !0 }), document.addEventListener("touchend", t, { passive: !0 }), function() {
|
|
2429
|
-
|
|
2464
|
+
pe.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
|
|
2430
2465
|
};
|
|
2431
2466
|
}
|
|
2432
|
-
function
|
|
2467
|
+
function ti(e, t) {
|
|
2433
2468
|
if ("onscrollend" in window)
|
|
2434
2469
|
return e.addEventListener("scrollend", t), function() {
|
|
2435
2470
|
e.removeEventListener("scrollend", t);
|
|
2436
2471
|
};
|
|
2437
2472
|
let n = 0, s;
|
|
2438
|
-
|
|
2473
|
+
le || (s = ei()), le += 1;
|
|
2439
2474
|
function i(o) {
|
|
2440
2475
|
clearTimeout(n), n = setTimeout(() => {
|
|
2441
|
-
|
|
2476
|
+
pe.size ? setTimeout(i, 100) : (t(o), n = 0);
|
|
2442
2477
|
}, 100);
|
|
2443
2478
|
}
|
|
2444
2479
|
return e.addEventListener("scroll", i), function() {
|
|
2445
|
-
e.removeEventListener("scroll", i),
|
|
2480
|
+
e.removeEventListener("scroll", i), le -= 1, le || s();
|
|
2446
2481
|
};
|
|
2447
2482
|
}
|
|
2448
|
-
function
|
|
2483
|
+
function ni(e, t, n) {
|
|
2449
2484
|
return {
|
|
2450
2485
|
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 -
|
|
2486
|
+
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;
|
|
2487
|
+
return (s - c) / r;
|
|
2453
2488
|
},
|
|
2454
2489
|
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 -
|
|
2490
|
+
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;
|
|
2491
|
+
return (s - c) / r;
|
|
2457
2492
|
}
|
|
2458
2493
|
};
|
|
2459
2494
|
}
|
|
2460
|
-
function
|
|
2495
|
+
function si(e, t) {
|
|
2461
2496
|
this.x = window.scrollX, this.y = window.scrollY, requestAnimationFrame(() => e && e(t));
|
|
2462
2497
|
}
|
|
2463
|
-
function
|
|
2498
|
+
function ii(e) {
|
|
2464
2499
|
e.rect.width = window.document.documentElement.clientWidth, e.rect.height = window.document.documentElement.clientHeight;
|
|
2465
2500
|
}
|
|
2466
|
-
function
|
|
2501
|
+
function oi(e) {
|
|
2467
2502
|
const t = new ResizeObserver((n) => {
|
|
2468
2503
|
n.forEach((s) => {
|
|
2469
2504
|
e.rect.width = s.borderBoxSize[0].inlineSize, e.rect.height = s.borderBoxSize[0].blockSize;
|
|
@@ -2471,38 +2506,38 @@ function ei(e) {
|
|
|
2471
2506
|
});
|
|
2472
2507
|
return t.observe(e.root, { box: "border-box" }), t;
|
|
2473
2508
|
}
|
|
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(
|
|
2509
|
+
function ri(e) {
|
|
2510
|
+
let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, i, o, r, c;
|
|
2511
|
+
const l = { x: 0, y: 0 };
|
|
2512
|
+
e.scenes.forEach((a) => {
|
|
2513
|
+
a.target && a.centeredToTarget && (a.transform = ni(Qs(a.target), e.rect, l), t = !0), e.root ? i = oi(e) : (o = ii.bind(null, e), window.addEventListener("resize", o));
|
|
2514
|
+
}), s = function(a) {
|
|
2480
2515
|
for (let f of e.scenes)
|
|
2481
2516
|
if (!f.disabled) {
|
|
2482
|
-
const d = f.transform?.x(
|
|
2483
|
-
e.allowActiveEvent && (
|
|
2517
|
+
const d = f.transform?.x(a.x) || a.x / e.rect.width, h = f.transform?.y(a.y) || a.y / e.rect.height, m = +tt(0, 1, d).toPrecision(4), p = +tt(0, 1, h).toPrecision(4), g = { x: a.vx, y: a.vy };
|
|
2518
|
+
e.allowActiveEvent && (a.active = d <= 1 && h <= 1 && d >= 0 && h >= 0), f.effect(f, { x: m, y: p }, g, a.active);
|
|
2484
2519
|
}
|
|
2485
|
-
Object.assign(n,
|
|
2486
|
-
}, t && (r =
|
|
2520
|
+
Object.assign(n, a);
|
|
2521
|
+
}, t && (r = si.bind(l, s, n), c = ti(document, r));
|
|
2487
2522
|
function u() {
|
|
2488
|
-
e.scenes.forEach((
|
|
2523
|
+
e.scenes.forEach((a) => a.destroy?.()), c?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", o), o = null), s = null, n = null;
|
|
2489
2524
|
}
|
|
2490
2525
|
return {
|
|
2491
2526
|
tick: s,
|
|
2492
2527
|
destroy: u
|
|
2493
2528
|
};
|
|
2494
2529
|
}
|
|
2495
|
-
const
|
|
2496
|
-
let
|
|
2497
|
-
function
|
|
2498
|
-
|
|
2530
|
+
const ai = 1e3 / 60 * 3;
|
|
2531
|
+
let ue;
|
|
2532
|
+
function ci() {
|
|
2533
|
+
H.x = window.scrollX, H.y = window.scrollY;
|
|
2499
2534
|
}
|
|
2500
|
-
const
|
|
2501
|
-
class
|
|
2535
|
+
const H = { x: 0, y: 0, scrollHandler: ci, fixRequired: void 0 };
|
|
2536
|
+
class li {
|
|
2502
2537
|
constructor(t = {}) {
|
|
2503
2538
|
this.config = { ...t }, this.effect = null, this._nextTick = null, this._nextTransitionTick = null, this._startTime = 0;
|
|
2504
2539
|
let n;
|
|
2505
|
-
this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() :
|
|
2540
|
+
this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : nt(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : nt(() => {
|
|
2506
2541
|
this.tick();
|
|
2507
2542
|
}), this.config.rect = this.config.root ? {
|
|
2508
2543
|
width: this.config.root.offsetWidth,
|
|
@@ -2525,15 +2560,15 @@ class ii {
|
|
|
2525
2560
|
}, this._pointerEnter = () => {
|
|
2526
2561
|
this.progress.active = !0, this._nextTick = n();
|
|
2527
2562
|
}, this.config.root) {
|
|
2528
|
-
|
|
2529
|
-
const i =
|
|
2530
|
-
typeof
|
|
2563
|
+
ue = typeof ue == "boolean" ? ue : Xs();
|
|
2564
|
+
const i = ue ? window.devicePixelRatio : 1;
|
|
2565
|
+
typeof H.fixRequired > "u" && Js(H), this._measure = (o) => {
|
|
2531
2566
|
if (o.target !== this.config.root) {
|
|
2532
2567
|
const r = new PointerEvent("pointermove", {
|
|
2533
2568
|
bubbles: !0,
|
|
2534
2569
|
cancelable: !0,
|
|
2535
|
-
clientX: o.x * i +
|
|
2536
|
-
clientY: o.y * i +
|
|
2570
|
+
clientX: o.x * i + H.x,
|
|
2571
|
+
clientY: o.y * i + H.y
|
|
2537
2572
|
});
|
|
2538
2573
|
o.stopPropagation(), this.config.root.dispatchEvent(r);
|
|
2539
2574
|
} else
|
|
@@ -2569,8 +2604,8 @@ class ii {
|
|
|
2569
2604
|
const t = this.config.transitionDuration, n = this.config.transitionEasing || ((r) => r), s = performance.now();
|
|
2570
2605
|
let i = !1;
|
|
2571
2606
|
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, [
|
|
2607
|
+
const c = (r - this._startTime) / t, l = n(Math.min(1, c));
|
|
2608
|
+
i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((u, [a, f]) => (a === "active" ? u[a] = f : u[a] = this.previousProgress[a] + (f - this.previousProgress[a]) * l, u), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(o), i = r - this._startTime > ai), this.effect.tick(this.currentProgress);
|
|
2574
2609
|
};
|
|
2575
2610
|
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
2611
|
}
|
|
@@ -2599,7 +2634,7 @@ class ii {
|
|
|
2599
2634
|
* Reset registered effect.
|
|
2600
2635
|
*/
|
|
2601
2636
|
setupEffect() {
|
|
2602
|
-
this.removeEffect(), this.effect =
|
|
2637
|
+
this.removeEffect(), this.effect = ri(this.config);
|
|
2603
2638
|
}
|
|
2604
2639
|
/**
|
|
2605
2640
|
* Remove registered effect.
|
|
@@ -2608,98 +2643,98 @@ class ii {
|
|
|
2608
2643
|
this.effect && this.effect.destroy(), this.effect = null;
|
|
2609
2644
|
}
|
|
2610
2645
|
}
|
|
2611
|
-
const
|
|
2612
|
-
let
|
|
2613
|
-
function
|
|
2614
|
-
|
|
2646
|
+
const Fe = /* @__PURE__ */ new WeakMap();
|
|
2647
|
+
let Ht = () => ({});
|
|
2648
|
+
function ui(e) {
|
|
2649
|
+
Ht = e;
|
|
2615
2650
|
}
|
|
2616
|
-
function
|
|
2651
|
+
function fi(e, t, n, s = {}, { reducedMotion: i, selectorCondition: o }) {
|
|
2617
2652
|
if (i || o && !t.matches(o)) return;
|
|
2618
2653
|
const r = {
|
|
2619
2654
|
trigger: "pointer-move",
|
|
2620
2655
|
element: e,
|
|
2621
2656
|
axis: s.axis ?? "y"
|
|
2622
|
-
},
|
|
2623
|
-
if (
|
|
2624
|
-
const
|
|
2657
|
+
}, c = bt(t, x(n), r);
|
|
2658
|
+
if (c) {
|
|
2659
|
+
const l = Array.isArray(c) ? c : [c], u = new li({
|
|
2625
2660
|
root: s.hitArea === "self" ? e : void 0,
|
|
2626
|
-
scenes:
|
|
2627
|
-
...
|
|
2661
|
+
scenes: l,
|
|
2662
|
+
...Ht()
|
|
2628
2663
|
}), f = { source: e, target: t, cleanup: () => {
|
|
2629
2664
|
u.destroy();
|
|
2630
2665
|
} };
|
|
2631
|
-
k(
|
|
2632
|
-
|
|
2666
|
+
k(Fe, e, f), k(Fe, t, f), Promise.all(
|
|
2667
|
+
l.map((d) => d.ready || Promise.resolve())
|
|
2633
2668
|
).then(() => {
|
|
2634
2669
|
u.start();
|
|
2635
2670
|
});
|
|
2636
2671
|
}
|
|
2637
2672
|
}
|
|
2638
|
-
function
|
|
2639
|
-
|
|
2673
|
+
function di(e) {
|
|
2674
|
+
oe(Fe, e);
|
|
2640
2675
|
}
|
|
2641
|
-
const
|
|
2642
|
-
add:
|
|
2643
|
-
remove:
|
|
2644
|
-
registerOptionsGetter:
|
|
2645
|
-
},
|
|
2646
|
-
function
|
|
2676
|
+
const hi = {
|
|
2677
|
+
add: fi,
|
|
2678
|
+
remove: di,
|
|
2679
|
+
registerOptionsGetter: ui
|
|
2680
|
+
}, Re = /* @__PURE__ */ new WeakMap();
|
|
2681
|
+
function mi(e, t, n, s, {
|
|
2647
2682
|
reducedMotion: i,
|
|
2648
2683
|
selectorCondition: o,
|
|
2649
2684
|
animation: r,
|
|
2650
|
-
sourceAnimationOptions:
|
|
2685
|
+
sourceAnimationOptions: c
|
|
2651
2686
|
}) {
|
|
2652
|
-
const
|
|
2687
|
+
const l = r || se(
|
|
2653
2688
|
t,
|
|
2654
|
-
|
|
2689
|
+
x(n),
|
|
2655
2690
|
void 0,
|
|
2656
2691
|
i
|
|
2657
2692
|
);
|
|
2658
|
-
if (!
|
|
2693
|
+
if (!l)
|
|
2659
2694
|
return;
|
|
2660
|
-
const { effectId: u } = s,
|
|
2695
|
+
const { effectId: u } = s, a = (h) => {
|
|
2661
2696
|
if (o && !t.matches(o)) return;
|
|
2662
|
-
const m = h.animationName, p = h.detail?.effectId,
|
|
2663
|
-
if (
|
|
2664
|
-
if (
|
|
2697
|
+
const m = h.animationName, p = h.detail?.effectId, g = c ? $t(e, c) : null;
|
|
2698
|
+
if (g) {
|
|
2699
|
+
if (g.playState === "running" || m && !g.hasAnimationName(m))
|
|
2665
2700
|
return;
|
|
2666
|
-
if (p && p !== u && !
|
|
2701
|
+
if (p && p !== u && !g.hasAnimationId(p))
|
|
2667
2702
|
return;
|
|
2668
2703
|
}
|
|
2669
|
-
|
|
2704
|
+
l.play();
|
|
2670
2705
|
}, d = { source: e, target: t, cleanup: () => {
|
|
2671
|
-
|
|
2706
|
+
l.cancel(), e.removeEventListener("animationend", a);
|
|
2672
2707
|
} };
|
|
2673
|
-
k(
|
|
2708
|
+
k(Re, e, d), k(Re, t, d), e.addEventListener("animationend", a);
|
|
2674
2709
|
}
|
|
2675
|
-
function
|
|
2676
|
-
|
|
2710
|
+
function pi(e) {
|
|
2711
|
+
oe(Re, e);
|
|
2677
2712
|
}
|
|
2678
|
-
const
|
|
2679
|
-
add:
|
|
2680
|
-
remove:
|
|
2713
|
+
const gi = {
|
|
2714
|
+
add: mi,
|
|
2715
|
+
remove: pi
|
|
2681
2716
|
};
|
|
2682
|
-
function
|
|
2683
|
-
const r = o ||
|
|
2717
|
+
function vi(e, t, n = !1, s, i, o) {
|
|
2718
|
+
const r = o || se(
|
|
2684
2719
|
e,
|
|
2685
|
-
|
|
2720
|
+
x(t),
|
|
2686
2721
|
void 0,
|
|
2687
2722
|
n
|
|
2688
2723
|
);
|
|
2689
2724
|
if (!r)
|
|
2690
2725
|
return null;
|
|
2691
|
-
let
|
|
2692
|
-
const
|
|
2726
|
+
let c = !0;
|
|
2727
|
+
const l = t.triggerType || "alternate";
|
|
2693
2728
|
return (u) => {
|
|
2694
2729
|
if (s && !e.matches(s)) return;
|
|
2695
|
-
const
|
|
2696
|
-
if (f ||
|
|
2697
|
-
if (
|
|
2698
|
-
|
|
2730
|
+
const a = !i, f = i?.enter?.includes(u.type), d = i?.leave?.includes(u.type);
|
|
2731
|
+
if (f || a) {
|
|
2732
|
+
if (l === "alternate" || l === "state")
|
|
2733
|
+
c ? (c = !1, r.play()) : l === "alternate" ? r.reverse() : l === "state" && (r.playState === "running" ? r.pause() : r.playState !== "finished" && r.play());
|
|
2699
2734
|
else {
|
|
2700
2735
|
if (r.progress(0), delete e.dataset.interactEnter, r.isCSS) {
|
|
2701
2736
|
const h = () => {
|
|
2702
|
-
|
|
2737
|
+
A.mutate(() => {
|
|
2703
2738
|
e.dataset.interactEnter = "done";
|
|
2704
2739
|
});
|
|
2705
2740
|
};
|
|
@@ -2709,113 +2744,113 @@ function di(e, t, n = !1, s, i, o) {
|
|
|
2709
2744
|
}
|
|
2710
2745
|
return;
|
|
2711
2746
|
}
|
|
2712
|
-
d && (
|
|
2747
|
+
d && (l === "alternate" ? r.reverse() : l === "repeat" ? (r.cancel(), A.mutate(() => {
|
|
2713
2748
|
delete e.dataset.interactEnter;
|
|
2714
|
-
})) :
|
|
2749
|
+
})) : l === "state" && r.playState === "running" && r.pause());
|
|
2715
2750
|
};
|
|
2716
2751
|
}
|
|
2717
|
-
function
|
|
2752
|
+
function yi(e, t, {
|
|
2718
2753
|
effectId: n,
|
|
2719
2754
|
listContainer: s,
|
|
2720
2755
|
listItemSelector: i,
|
|
2721
2756
|
stateAction: o
|
|
2722
|
-
}, r,
|
|
2723
|
-
const
|
|
2757
|
+
}, r, c) {
|
|
2758
|
+
const l = !!s, u = o ?? "toggle", a = u === "toggle";
|
|
2724
2759
|
return (f) => {
|
|
2725
2760
|
if (r && !e.matches(r)) return;
|
|
2726
|
-
const d =
|
|
2761
|
+
const d = l ? e.closest(
|
|
2727
2762
|
`${s} > ${i || ""}:has(:scope)`
|
|
2728
|
-
) : void 0, h = !
|
|
2729
|
-
h ? t.toggleEffect(n, u, d) : (m && t.toggleEffect(n,
|
|
2763
|
+
) : void 0, h = !c, m = c?.enter?.includes(f.type), p = c?.leave?.includes(f.type);
|
|
2764
|
+
h ? t.toggleEffect(n, u, d) : (m && t.toggleEffect(n, a ? "add" : u, d), p && a && t.toggleEffect(n, "remove", d));
|
|
2730
2765
|
};
|
|
2731
2766
|
}
|
|
2732
2767
|
const xe = /* @__PURE__ */ new WeakMap();
|
|
2733
|
-
function
|
|
2768
|
+
function st(e, t) {
|
|
2734
2769
|
return (n) => {
|
|
2735
2770
|
const s = n;
|
|
2736
2771
|
e.contains(s.relatedTarget) || t(s);
|
|
2737
2772
|
};
|
|
2738
2773
|
}
|
|
2739
|
-
function
|
|
2774
|
+
function Ei(e) {
|
|
2740
2775
|
return (t) => {
|
|
2741
2776
|
const n = t;
|
|
2742
|
-
n.pointerType && e(n);
|
|
2777
|
+
(n.pointerType || n.detail > 0) && e(n);
|
|
2743
2778
|
};
|
|
2744
2779
|
}
|
|
2745
|
-
function
|
|
2780
|
+
function wi(e) {
|
|
2746
2781
|
return (t) => {
|
|
2747
2782
|
const n = t;
|
|
2748
2783
|
n.code === "Space" ? (n.preventDefault(), e(n)) : n.code === "Enter" && e(n);
|
|
2749
2784
|
};
|
|
2750
2785
|
}
|
|
2751
|
-
const
|
|
2752
|
-
focusin: (e, t) =>
|
|
2753
|
-
focusout: (e, t) =>
|
|
2754
|
-
click: (e, t) =>
|
|
2755
|
-
keydown: (e, t) =>
|
|
2786
|
+
const $i = {
|
|
2787
|
+
focusin: (e, t) => st(e, t),
|
|
2788
|
+
focusout: (e, t) => st(e, t),
|
|
2789
|
+
click: (e, t) => Ei(t),
|
|
2790
|
+
keydown: (e, t) => wi(t)
|
|
2756
2791
|
};
|
|
2757
|
-
function
|
|
2758
|
-
const s =
|
|
2792
|
+
function bi(e, t, n) {
|
|
2793
|
+
const s = $i[e];
|
|
2759
2794
|
return s ? s(t, n) : (i) => n(i);
|
|
2760
2795
|
}
|
|
2761
|
-
function
|
|
2796
|
+
function Si(e) {
|
|
2762
2797
|
return typeof e == "object" && !Array.isArray(e) && ("enter" in e || "leave" in e);
|
|
2763
2798
|
}
|
|
2764
|
-
function
|
|
2799
|
+
function Ii(e) {
|
|
2765
2800
|
if (typeof e == "string")
|
|
2766
2801
|
return { toggle: [e] };
|
|
2767
2802
|
if (Array.isArray(e))
|
|
2768
2803
|
return { toggle: [...e] };
|
|
2769
|
-
if (
|
|
2804
|
+
if (Si(e)) {
|
|
2770
2805
|
const t = e.enter ? [...e.enter] : [], n = e.leave ? [...e.leave] : [];
|
|
2771
2806
|
return { enter: t, leave: n };
|
|
2772
2807
|
}
|
|
2773
2808
|
return {};
|
|
2774
2809
|
}
|
|
2775
|
-
function
|
|
2810
|
+
function Ti(e) {
|
|
2776
2811
|
return !!(e.enter?.length || e.leave?.length);
|
|
2777
2812
|
}
|
|
2778
|
-
function
|
|
2779
|
-
return
|
|
2813
|
+
function Ci(e) {
|
|
2814
|
+
return Ti(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
|
|
2780
2815
|
}
|
|
2781
|
-
function
|
|
2816
|
+
function Oi(e, t, n, s, {
|
|
2782
2817
|
reducedMotion: i,
|
|
2783
2818
|
targetController: o,
|
|
2784
2819
|
selectorCondition: r,
|
|
2785
|
-
animation:
|
|
2820
|
+
animation: c
|
|
2786
2821
|
}) {
|
|
2787
|
-
const
|
|
2822
|
+
const l = Ii(s.eventConfig), u = n.transition || n.transitionProperties, a = Ci(l);
|
|
2788
2823
|
let f, d = !1;
|
|
2789
|
-
if (u ? f =
|
|
2824
|
+
if (u ? f = yi(
|
|
2790
2825
|
t,
|
|
2791
2826
|
o,
|
|
2792
2827
|
n,
|
|
2793
2828
|
r,
|
|
2794
|
-
|
|
2795
|
-
) : (f =
|
|
2829
|
+
a
|
|
2830
|
+
) : (f = vi(
|
|
2796
2831
|
t,
|
|
2797
2832
|
n,
|
|
2798
2833
|
i,
|
|
2799
2834
|
r,
|
|
2800
|
-
|
|
2801
|
-
|
|
2835
|
+
a,
|
|
2836
|
+
c
|
|
2802
2837
|
), d = n.triggerType === "once"), !f)
|
|
2803
2838
|
return;
|
|
2804
2839
|
const h = f, m = new AbortController();
|
|
2805
|
-
function p(
|
|
2806
|
-
const b =
|
|
2807
|
-
|
|
2840
|
+
function p(E, v, w) {
|
|
2841
|
+
const b = bi(v, e, h);
|
|
2842
|
+
E.addEventListener(v, b, { ...w, signal: m.signal });
|
|
2808
2843
|
}
|
|
2809
2844
|
const y = { source: e, target: t, cleanup: () => {
|
|
2810
2845
|
m.abort();
|
|
2811
2846
|
} };
|
|
2812
|
-
if (k(xe, e, y), k(xe, t, y),
|
|
2813
|
-
const
|
|
2814
|
-
|
|
2847
|
+
if (k(xe, e, y), k(xe, t, y), a) {
|
|
2848
|
+
const E = l.enter, v = l.leave;
|
|
2849
|
+
E.forEach((S) => {
|
|
2815
2850
|
S === "focusin" && (e.tabIndex = 0), p(e, S, { passive: !0, once: d });
|
|
2816
2851
|
});
|
|
2817
2852
|
const w = !n.stateAction || n.stateAction === "toggle";
|
|
2818
|
-
(u ? w : n.triggerType !== "once") &&
|
|
2853
|
+
(u ? w : n.triggerType !== "once") && v.forEach((S) => {
|
|
2819
2854
|
if (S === "focusout") {
|
|
2820
2855
|
p(e, S, { once: d });
|
|
2821
2856
|
return;
|
|
@@ -2823,17 +2858,17 @@ function bi(e, t, n, s, {
|
|
|
2823
2858
|
p(e, S, { passive: !0 });
|
|
2824
2859
|
});
|
|
2825
2860
|
} else
|
|
2826
|
-
(
|
|
2827
|
-
p(e,
|
|
2861
|
+
(l.toggle ?? []).forEach((v) => {
|
|
2862
|
+
p(e, v, { once: d, passive: v !== "keydown" });
|
|
2828
2863
|
});
|
|
2829
2864
|
}
|
|
2830
|
-
function
|
|
2831
|
-
|
|
2865
|
+
function _i(e) {
|
|
2866
|
+
oe(xe, e);
|
|
2832
2867
|
}
|
|
2833
2868
|
const U = {
|
|
2834
|
-
add:
|
|
2835
|
-
remove:
|
|
2836
|
-
},
|
|
2869
|
+
add: Oi,
|
|
2870
|
+
remove: _i
|
|
2871
|
+
}, Ne = {
|
|
2837
2872
|
click: ["click"],
|
|
2838
2873
|
activate: ["click", "keydown"],
|
|
2839
2874
|
hover: { enter: ["mouseenter"], leave: ["mouseleave"] },
|
|
@@ -2841,40 +2876,40 @@ const U = {
|
|
|
2841
2876
|
enter: ["mouseenter", "focusin"],
|
|
2842
2877
|
leave: ["mouseleave", "focusout"]
|
|
2843
2878
|
}
|
|
2844
|
-
},
|
|
2845
|
-
click:
|
|
2846
|
-
hover:
|
|
2879
|
+
}, it = {
|
|
2880
|
+
click: Ne.activate,
|
|
2881
|
+
hover: Ne.interest
|
|
2847
2882
|
};
|
|
2848
|
-
function
|
|
2849
|
-
const t =
|
|
2883
|
+
function fe(e) {
|
|
2884
|
+
const t = Ne[e];
|
|
2850
2885
|
return (n, s, i, o, r) => {
|
|
2851
|
-
const
|
|
2852
|
-
U.add(n, s, i, { eventConfig:
|
|
2886
|
+
const c = r?.allowA11yTriggers && e in it ? it[e] : t;
|
|
2887
|
+
U.add(n, s, i, { eventConfig: c }, r ?? {});
|
|
2853
2888
|
};
|
|
2854
2889
|
}
|
|
2855
|
-
const
|
|
2856
|
-
viewEnter:
|
|
2890
|
+
const D = {
|
|
2891
|
+
viewEnter: As,
|
|
2857
2892
|
hover: {
|
|
2858
|
-
add:
|
|
2893
|
+
add: fe("hover"),
|
|
2859
2894
|
remove: U.remove
|
|
2860
2895
|
},
|
|
2861
2896
|
click: {
|
|
2862
|
-
add:
|
|
2897
|
+
add: fe("click"),
|
|
2863
2898
|
remove: U.remove
|
|
2864
2899
|
},
|
|
2865
|
-
animationEnd:
|
|
2866
|
-
viewProgress:
|
|
2867
|
-
pointerMove:
|
|
2900
|
+
animationEnd: gi,
|
|
2901
|
+
viewProgress: Us,
|
|
2902
|
+
pointerMove: hi,
|
|
2868
2903
|
activate: {
|
|
2869
|
-
add:
|
|
2904
|
+
add: fe("activate"),
|
|
2870
2905
|
remove: U.remove
|
|
2871
2906
|
},
|
|
2872
2907
|
interest: {
|
|
2873
|
-
add:
|
|
2908
|
+
add: fe("interest"),
|
|
2874
2909
|
remove: U.remove
|
|
2875
2910
|
}
|
|
2876
2911
|
};
|
|
2877
|
-
function
|
|
2912
|
+
function Ai(e) {
|
|
2878
2913
|
return e.replace(/\[[^\]]+]/g, "[]");
|
|
2879
2914
|
}
|
|
2880
2915
|
class $ {
|
|
@@ -2898,7 +2933,7 @@ class $ {
|
|
|
2898
2933
|
if (typeof window > "u" || !window.customElements)
|
|
2899
2934
|
return;
|
|
2900
2935
|
const s = n?.useCustomElement ?? !!$.defineInteractElement;
|
|
2901
|
-
this.dataCache =
|
|
2936
|
+
this.dataCache = qi(t, s, n?.configIndex);
|
|
2902
2937
|
const i = $.defineInteractElement?.();
|
|
2903
2938
|
s && i === !1 ? document.querySelectorAll("interact-element").forEach((o) => {
|
|
2904
2939
|
o.connect();
|
|
@@ -2924,7 +2959,7 @@ class $ {
|
|
|
2924
2959
|
return !!this.get(t);
|
|
2925
2960
|
}
|
|
2926
2961
|
get(t) {
|
|
2927
|
-
const n =
|
|
2962
|
+
const n = Ai(t);
|
|
2928
2963
|
return this.dataCache.interactions[n];
|
|
2929
2964
|
}
|
|
2930
2965
|
clearMediaQueryListenersForKey(t) {
|
|
@@ -2957,11 +2992,11 @@ class $ {
|
|
|
2957
2992
|
}), $.instances.length = 0, $.controllerCache.clear(), $.sequenceCache.clear(), $.elementSequenceMap = /* @__PURE__ */ new WeakMap();
|
|
2958
2993
|
}
|
|
2959
2994
|
static setup(t) {
|
|
2960
|
-
t.scrollOptionsGetter &&
|
|
2995
|
+
t.scrollOptionsGetter && D.viewProgress.registerOptionsGetter?.(
|
|
2961
2996
|
t.scrollOptionsGetter
|
|
2962
|
-
), t.pointerOptionsGetter &&
|
|
2997
|
+
), t.pointerOptionsGetter && D.pointerMove.registerOptionsGetter?.(
|
|
2963
2998
|
t.pointerOptionsGetter
|
|
2964
|
-
), t.viewEnter &&
|
|
2999
|
+
), t.viewEnter && D.viewEnter.setOptions(
|
|
2965
3000
|
t.viewEnter
|
|
2966
3001
|
), t.allowA11yTriggers !== void 0 && ($.allowA11yTriggers = t.allowA11yTriggers);
|
|
2967
3002
|
}
|
|
@@ -2979,8 +3014,8 @@ class $ {
|
|
|
2979
3014
|
static deleteController(t) {
|
|
2980
3015
|
$.controllerCache.delete(t);
|
|
2981
3016
|
}
|
|
2982
|
-
static registerEffects =
|
|
2983
|
-
static getRegisteredEffect =
|
|
3017
|
+
static registerEffects = Nn;
|
|
3018
|
+
static getRegisteredEffect = He;
|
|
2984
3019
|
/**
|
|
2985
3020
|
* Registers a plugin under a name. When the config carries a plugin field (e.g. `$splitText`) with a matching key
|
|
2986
3021
|
* (on an interaction or effect), Interact invokes the plugin with the field's value and a
|
|
@@ -2998,17 +3033,17 @@ class $ {
|
|
|
2998
3033
|
static getSequence(t, n, s, i) {
|
|
2999
3034
|
const o = $.sequenceCache.get(t);
|
|
3000
3035
|
if (o) return o;
|
|
3001
|
-
const r =
|
|
3036
|
+
const r = Kn(n, s, i);
|
|
3002
3037
|
return $.sequenceCache.set(t, r), $._registerSequenceElements(s, r), r;
|
|
3003
3038
|
}
|
|
3004
3039
|
static addToSequence(t, n, s, i) {
|
|
3005
3040
|
const o = $.sequenceCache.get(t);
|
|
3006
3041
|
if (!o) return !1;
|
|
3007
|
-
const
|
|
3042
|
+
const c = St(n, i).map((l, u) => ({
|
|
3008
3043
|
index: s[u] ?? o.animationGroups.length,
|
|
3009
|
-
group:
|
|
3044
|
+
group: l
|
|
3010
3045
|
}));
|
|
3011
|
-
return o.addGroups(
|
|
3046
|
+
return o.addGroups(c), $._registerSequenceElements(n, o), !0;
|
|
3012
3047
|
}
|
|
3013
3048
|
static _registerSequenceElements(t, n) {
|
|
3014
3049
|
for (const { target: s } of t) {
|
|
@@ -3032,8 +3067,8 @@ class $ {
|
|
|
3032
3067
|
}
|
|
3033
3068
|
}
|
|
3034
3069
|
}
|
|
3035
|
-
let
|
|
3036
|
-
function
|
|
3070
|
+
let Mi = 0;
|
|
3071
|
+
function G(e, {
|
|
3037
3072
|
asCombinator: t = !1,
|
|
3038
3073
|
addItemFilter: n = !1,
|
|
3039
3074
|
useFirstChild: s = !1
|
|
@@ -3045,10 +3080,10 @@ function W(e, {
|
|
|
3045
3080
|
return e.selector;
|
|
3046
3081
|
return s ? t ? "> :first-child" : ":scope > :first-child" : "";
|
|
3047
3082
|
}
|
|
3048
|
-
function
|
|
3083
|
+
function ot(e) {
|
|
3049
3084
|
return "sequenceId" in e && !("effects" in e);
|
|
3050
3085
|
}
|
|
3051
|
-
function
|
|
3086
|
+
function _e(e, t) {
|
|
3052
3087
|
return e[t] || (e[t] = {
|
|
3053
3088
|
triggers: [],
|
|
3054
3089
|
effects: {},
|
|
@@ -3057,7 +3092,7 @@ function Ce(e, t) {
|
|
|
3057
3092
|
selectors: /* @__PURE__ */ new Set()
|
|
3058
3093
|
}), e[t];
|
|
3059
3094
|
}
|
|
3060
|
-
function
|
|
3095
|
+
function ki(e, t, n) {
|
|
3061
3096
|
const { effects: s = [] } = e;
|
|
3062
3097
|
return s.some((i, o) => n.has(t(o))) ? {
|
|
3063
3098
|
...e,
|
|
@@ -3067,93 +3102,101 @@ function Ci(e, t, n) {
|
|
|
3067
3102
|
})
|
|
3068
3103
|
} : e;
|
|
3069
3104
|
}
|
|
3070
|
-
function
|
|
3071
|
-
const { effects:
|
|
3072
|
-
return e.interactions?.forEach((
|
|
3073
|
-
const
|
|
3074
|
-
if (!
|
|
3075
|
-
console.error(`Interaction ${
|
|
3105
|
+
function qi(e, t = !1, n) {
|
|
3106
|
+
const { effects: s = {}, sequences: i = {}, conditions: o = {} } = e, r = {}, c = e.interactions ? Ft(e, n) : /* @__PURE__ */ new Map();
|
|
3107
|
+
return e.interactions?.forEach((l, u) => {
|
|
3108
|
+
const a = l.key, f = ++Mi, { effects: d, sequences: h, ...m } = l;
|
|
3109
|
+
if (!a) {
|
|
3110
|
+
console.error(`Interaction ${f} is missing a key for source element.`);
|
|
3076
3111
|
return;
|
|
3077
3112
|
}
|
|
3078
|
-
|
|
3079
|
-
const
|
|
3080
|
-
|
|
3081
|
-
const
|
|
3082
|
-
if (
|
|
3083
|
-
const
|
|
3084
|
-
return
|
|
3113
|
+
_e(r, a);
|
|
3114
|
+
const p = d ? Array.from(d) : [];
|
|
3115
|
+
p.reverse();
|
|
3116
|
+
const g = h?.map((v, w) => {
|
|
3117
|
+
if (ot(v)) {
|
|
3118
|
+
const S = i[v.sequenceId];
|
|
3119
|
+
return S ? { ...S, ...v } : (console.warn(`Interact: Sequence "${v.sequenceId}" not found in config`), v);
|
|
3085
3120
|
}
|
|
3086
|
-
const
|
|
3087
|
-
return
|
|
3088
|
-
}),
|
|
3089
|
-
...
|
|
3090
|
-
effects:
|
|
3091
|
-
sequences:
|
|
3092
|
-
(
|
|
3121
|
+
const b = v;
|
|
3122
|
+
return b.sequenceId || (b.sequenceId = Q("seq", [u, w], n)), b;
|
|
3123
|
+
}), y = {
|
|
3124
|
+
...m,
|
|
3125
|
+
effects: p.length > 0 ? p : void 0,
|
|
3126
|
+
sequences: g?.map(
|
|
3127
|
+
(v, w) => ki(
|
|
3128
|
+
v,
|
|
3129
|
+
(b) => ve(u, b, w),
|
|
3130
|
+
c
|
|
3131
|
+
)
|
|
3093
3132
|
)
|
|
3094
3133
|
};
|
|
3095
|
-
|
|
3096
|
-
|
|
3134
|
+
r[a].triggers.push(y), r[a].selectors.add(
|
|
3135
|
+
G(y, { useFirstChild: t })
|
|
3097
3136
|
);
|
|
3098
|
-
const
|
|
3099
|
-
|
|
3100
|
-
const
|
|
3101
|
-
let
|
|
3102
|
-
const
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3137
|
+
const E = y.listContainer;
|
|
3138
|
+
p.forEach((v, w) => {
|
|
3139
|
+
const b = v.effectId ? s[v.effectId] : void 0;
|
|
3140
|
+
let S = v.key || b?.key;
|
|
3141
|
+
const I = p.length - 1 - w;
|
|
3142
|
+
v.effectId || (v.effectId = Q(
|
|
3143
|
+
"eff",
|
|
3144
|
+
[u, I],
|
|
3145
|
+
n
|
|
3146
|
+
));
|
|
3147
|
+
const O = c.get(ve(u, I));
|
|
3148
|
+
if (O && (v.suffix = O), S = S || a, v.key = S, E && v.listContainer && (S !== a || v.listContainer !== E))
|
|
3106
3149
|
return;
|
|
3107
|
-
const
|
|
3108
|
-
if (
|
|
3150
|
+
const M = W({ ...b, ...v, key: S }), T = `${a}::${M}::${f}`;
|
|
3151
|
+
if (v.interactionId = T, r[a].interactionIds.add(T), S === a)
|
|
3109
3152
|
return;
|
|
3110
|
-
const
|
|
3111
|
-
|
|
3112
|
-
}),
|
|
3113
|
-
if (!
|
|
3114
|
-
const
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
let
|
|
3118
|
-
if (!
|
|
3119
|
-
const
|
|
3120
|
-
|
|
3153
|
+
const C = _e(r, S);
|
|
3154
|
+
C.effects[T] || (C.effects[T] = [], C.interactionIds.add(T)), C.effects[T].push({ ...m, effect: v }), C.selectors.add(G(v, { useFirstChild: t }));
|
|
3155
|
+
}), g?.forEach((v) => {
|
|
3156
|
+
if (!v || ot(v)) return;
|
|
3157
|
+
const w = v, b = w.sequenceId;
|
|
3158
|
+
w.effects.forEach((I, O) => {
|
|
3159
|
+
I.effectId || (I.effectId = `eff-${b}-${O}`);
|
|
3160
|
+
let M = I.key;
|
|
3161
|
+
if (!M && I.effectId) {
|
|
3162
|
+
const C = s[I.effectId];
|
|
3163
|
+
C && (M = C.key);
|
|
3121
3164
|
}
|
|
3122
|
-
|
|
3123
|
-
const
|
|
3124
|
-
if (
|
|
3125
|
-
const
|
|
3126
|
-
|
|
3127
|
-
...
|
|
3128
|
-
sequence:
|
|
3129
|
-
}),
|
|
3165
|
+
M = M || a;
|
|
3166
|
+
const T = G(I, { useFirstChild: t });
|
|
3167
|
+
if (T && r[a].selectors.add(T), M !== a) {
|
|
3168
|
+
const C = _e(r, M), _ = `${M}::seq::${b}::${f}`;
|
|
3169
|
+
C.sequences[_] || (C.sequences[_] = [], C.interactionIds.add(_)), C.sequences[_].push({
|
|
3170
|
+
...m,
|
|
3171
|
+
sequence: w
|
|
3172
|
+
}), C.selectors.add(T);
|
|
3130
3173
|
}
|
|
3131
3174
|
});
|
|
3132
3175
|
});
|
|
3133
3176
|
}), {
|
|
3134
|
-
effects:
|
|
3135
|
-
sequences:
|
|
3136
|
-
conditions:
|
|
3137
|
-
interactions:
|
|
3177
|
+
effects: s,
|
|
3178
|
+
sequences: i,
|
|
3179
|
+
conditions: o,
|
|
3180
|
+
interactions: r
|
|
3138
3181
|
};
|
|
3139
3182
|
}
|
|
3140
|
-
function
|
|
3183
|
+
function Se(e, t, n, s, i) {
|
|
3141
3184
|
const o = $.getPluginsNames();
|
|
3142
3185
|
for (const r of o) {
|
|
3143
|
-
const
|
|
3144
|
-
if (!(
|
|
3186
|
+
const c = `${at}${r}`;
|
|
3187
|
+
if (!(c in n))
|
|
3145
3188
|
continue;
|
|
3146
|
-
const
|
|
3147
|
-
if (
|
|
3148
|
-
if (e._appliedPlugins.has(
|
|
3189
|
+
const l = n[c];
|
|
3190
|
+
if (l !== null && typeof l == "object") {
|
|
3191
|
+
if (e._appliedPlugins.has(l))
|
|
3149
3192
|
continue;
|
|
3150
|
-
e._appliedPlugins.add(
|
|
3193
|
+
e._appliedPlugins.add(l);
|
|
3151
3194
|
}
|
|
3152
|
-
const
|
|
3153
|
-
typeof
|
|
3195
|
+
const a = $.getPlugin(r)(l, { root: t, key: s, scope: i, config: n });
|
|
3196
|
+
typeof a == "function" && e._pluginCleanups.push(a);
|
|
3154
3197
|
}
|
|
3155
3198
|
}
|
|
3156
|
-
function
|
|
3199
|
+
function we(e, t, n) {
|
|
3157
3200
|
if (e.listContainer) {
|
|
3158
3201
|
const s = t.querySelector(e.listContainer);
|
|
3159
3202
|
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 +3209,32 @@ function ye(e, t, n) {
|
|
|
3166
3209
|
}
|
|
3167
3210
|
return n ? t.firstElementChild : t;
|
|
3168
3211
|
}
|
|
3169
|
-
function
|
|
3212
|
+
function $e(e, t) {
|
|
3170
3213
|
return t.map((n) => e.selector ? n.querySelector(e.selector) : n).filter(Boolean);
|
|
3171
3214
|
}
|
|
3172
|
-
function
|
|
3215
|
+
function Dt(e, t, n, s, i, o, r, c) {
|
|
3173
3216
|
return [
|
|
3174
|
-
r ?
|
|
3175
|
-
|
|
3217
|
+
r ? $e(e, r) : we(e, n, s),
|
|
3218
|
+
c ? $e(t, c) : we(t, i, o)
|
|
3176
3219
|
];
|
|
3177
3220
|
}
|
|
3178
|
-
function
|
|
3179
|
-
const
|
|
3180
|
-
|
|
3221
|
+
function Gt(e, t, n, s, i, o, r, c) {
|
|
3222
|
+
const l = Array.isArray(s), u = Array.isArray(i);
|
|
3223
|
+
l ? s.forEach((a, f) => {
|
|
3181
3224
|
const d = u ? i[f] : i;
|
|
3182
|
-
d &&
|
|
3225
|
+
d && rt(
|
|
3183
3226
|
e,
|
|
3184
|
-
|
|
3227
|
+
a,
|
|
3185
3228
|
t.trigger,
|
|
3186
3229
|
d,
|
|
3187
3230
|
n,
|
|
3188
3231
|
t.params,
|
|
3189
3232
|
o,
|
|
3190
3233
|
r,
|
|
3191
|
-
|
|
3234
|
+
c
|
|
3192
3235
|
);
|
|
3193
3236
|
}) : (u ? i : [i]).forEach((f) => {
|
|
3194
|
-
|
|
3237
|
+
rt(
|
|
3195
3238
|
e,
|
|
3196
3239
|
s,
|
|
3197
3240
|
t.trigger,
|
|
@@ -3200,22 +3243,22 @@ function zt(e, t, n, s, i, o, r, a) {
|
|
|
3200
3243
|
t.params,
|
|
3201
3244
|
o,
|
|
3202
3245
|
r,
|
|
3203
|
-
|
|
3246
|
+
c
|
|
3204
3247
|
);
|
|
3205
3248
|
});
|
|
3206
3249
|
}
|
|
3207
|
-
function
|
|
3250
|
+
function Wt(e, t, n, s, i) {
|
|
3208
3251
|
const o = {}, r = [];
|
|
3209
|
-
(s.effects || []).forEach((
|
|
3210
|
-
const u =
|
|
3252
|
+
(s.effects || []).forEach((c, l) => {
|
|
3253
|
+
const u = c.effectId, a = {
|
|
3211
3254
|
...n.dataCache.effects[u] || {},
|
|
3212
|
-
...
|
|
3255
|
+
...c,
|
|
3213
3256
|
effectId: u
|
|
3214
|
-
}, f =
|
|
3257
|
+
}, f = a.key, d = q(c.interactionId, e);
|
|
3215
3258
|
if (o[d] || n.addedInteractions[d] && !i)
|
|
3216
3259
|
return;
|
|
3217
|
-
const h =
|
|
3218
|
-
if (h && n.setupMediaQueryListener(`${d}::${
|
|
3260
|
+
const h = F(a.conditions || [], n.dataCache.conditions);
|
|
3261
|
+
if (h && n.setupMediaQueryListener(`${d}::${l}`, h, e, () => {
|
|
3219
3262
|
t.update();
|
|
3220
3263
|
}), !h || h.matches) {
|
|
3221
3264
|
o[d] = !0;
|
|
@@ -3224,60 +3267,60 @@ function Ht(e, t, n, s, i) {
|
|
|
3224
3267
|
if (m) {
|
|
3225
3268
|
if (p = $.getController(m), !p)
|
|
3226
3269
|
return;
|
|
3227
|
-
|
|
3270
|
+
a.listContainer && p.watchChildList(a.listContainer);
|
|
3228
3271
|
} else
|
|
3229
3272
|
p = t;
|
|
3230
|
-
|
|
3273
|
+
Se(
|
|
3231
3274
|
p,
|
|
3232
3275
|
p.element,
|
|
3233
|
-
|
|
3276
|
+
a,
|
|
3234
3277
|
m || s.key,
|
|
3235
3278
|
"effect"
|
|
3236
3279
|
);
|
|
3237
|
-
const [
|
|
3280
|
+
const [g, y] = Dt(
|
|
3238
3281
|
s,
|
|
3239
|
-
|
|
3282
|
+
a,
|
|
3240
3283
|
t.element,
|
|
3241
3284
|
t.useFirstChild,
|
|
3242
3285
|
p.element,
|
|
3243
3286
|
p.useFirstChild,
|
|
3244
3287
|
i
|
|
3245
3288
|
);
|
|
3246
|
-
if (!
|
|
3289
|
+
if (!g || !y)
|
|
3247
3290
|
return;
|
|
3248
3291
|
n.addedInteractions[d] = !0;
|
|
3249
|
-
const
|
|
3250
|
-
|
|
3292
|
+
const E = m || s.key, v = R(
|
|
3293
|
+
a.conditions || [],
|
|
3251
3294
|
n.dataCache.conditions
|
|
3252
3295
|
);
|
|
3253
3296
|
r.push([
|
|
3254
|
-
|
|
3297
|
+
E,
|
|
3255
3298
|
s,
|
|
3256
|
-
|
|
3257
|
-
|
|
3299
|
+
a,
|
|
3300
|
+
g,
|
|
3258
3301
|
y,
|
|
3259
|
-
|
|
3302
|
+
v,
|
|
3260
3303
|
p.useFirstChild,
|
|
3261
3304
|
e
|
|
3262
3305
|
]);
|
|
3263
3306
|
}
|
|
3264
|
-
}), r.reverse().forEach((
|
|
3265
|
-
|
|
3266
|
-
}),
|
|
3307
|
+
}), r.reverse().forEach((c) => {
|
|
3308
|
+
Gt(...c);
|
|
3309
|
+
}), Li(e, t, n, s, i);
|
|
3267
3310
|
}
|
|
3268
|
-
function
|
|
3311
|
+
function Pi(e) {
|
|
3269
3312
|
return "sequenceId" in e && !("effects" in e);
|
|
3270
3313
|
}
|
|
3271
|
-
function
|
|
3272
|
-
const
|
|
3273
|
-
if (
|
|
3274
|
-
const
|
|
3275
|
-
let
|
|
3276
|
-
for (const f of
|
|
3314
|
+
function Vt(e, t, n, s, i, o, r) {
|
|
3315
|
+
const c = F(e.conditions || [], i.dataCache.conditions);
|
|
3316
|
+
if (c && i.setupMediaQueryListener(t, c, o.updateKey, o.onUpdate), c && !c.matches) return null;
|
|
3317
|
+
const l = e.effects || [], u = [];
|
|
3318
|
+
let a = !1;
|
|
3319
|
+
for (const f of l) {
|
|
3277
3320
|
const d = f.effectId, m = {
|
|
3278
3321
|
...d ? i.dataCache.effects[d] || {} : {},
|
|
3279
3322
|
...f
|
|
3280
|
-
}, p =
|
|
3323
|
+
}, p = F(m.conditions || [], i.dataCache.conditions);
|
|
3281
3324
|
if (p) {
|
|
3282
3325
|
const S = `${t}::${d || "eff"}`;
|
|
3283
3326
|
i.setupMediaQueryListener(
|
|
@@ -3288,38 +3331,38 @@ function Dt(e, t, n, s, i, o, r) {
|
|
|
3288
3331
|
);
|
|
3289
3332
|
}
|
|
3290
3333
|
if (p && !p.matches) continue;
|
|
3291
|
-
const
|
|
3292
|
-
let
|
|
3334
|
+
const g = m.key, y = g && q(g, n);
|
|
3335
|
+
let E;
|
|
3293
3336
|
if (y) {
|
|
3294
|
-
if (
|
|
3337
|
+
if (E = $.getController(y), !E) return null;
|
|
3295
3338
|
} else
|
|
3296
|
-
|
|
3297
|
-
const
|
|
3298
|
-
|
|
3299
|
-
g,
|
|
3300
|
-
g.element,
|
|
3301
|
-
m,
|
|
3339
|
+
E = s;
|
|
3340
|
+
const v = y || n;
|
|
3341
|
+
Se(
|
|
3302
3342
|
E,
|
|
3343
|
+
E.element,
|
|
3344
|
+
m,
|
|
3345
|
+
v,
|
|
3303
3346
|
"effect"
|
|
3304
3347
|
);
|
|
3305
3348
|
let w;
|
|
3306
|
-
if (r &&
|
|
3349
|
+
if (r && v === r.controllerKey && m.listContainer === r.listContainer ? (w = $e(m, r.elements), w.length > 0 && (a = !0)) : w = we(
|
|
3307
3350
|
m,
|
|
3308
|
-
|
|
3309
|
-
|
|
3351
|
+
E.element,
|
|
3352
|
+
E.useFirstChild
|
|
3310
3353
|
), !w || Array.isArray(w) && w.length === 0) return null;
|
|
3311
|
-
const b =
|
|
3354
|
+
const b = x(m);
|
|
3312
3355
|
u.push({ target: w, options: b });
|
|
3313
3356
|
}
|
|
3314
|
-
return r && !
|
|
3357
|
+
return r && !a ? null : u.length > 0 ? u : null;
|
|
3315
3358
|
}
|
|
3316
|
-
function
|
|
3317
|
-
const s = n ?
|
|
3359
|
+
function je(e, t, n) {
|
|
3360
|
+
const s = n ? $e(e, n) : we(e, t.element, t.useFirstChild);
|
|
3318
3361
|
return Array.isArray(s) && s.length === 0 ? null : s;
|
|
3319
3362
|
}
|
|
3320
|
-
function
|
|
3363
|
+
function ze(e, t, n, s, i) {
|
|
3321
3364
|
(Array.isArray(n) ? n : [n]).forEach((r) => {
|
|
3322
|
-
|
|
3365
|
+
D[e.trigger]?.add(
|
|
3323
3366
|
r,
|
|
3324
3367
|
r,
|
|
3325
3368
|
{ triggerType: t.triggerType },
|
|
@@ -3333,19 +3376,19 @@ function Ne(e, t, n, s, i) {
|
|
|
3333
3376
|
);
|
|
3334
3377
|
});
|
|
3335
3378
|
}
|
|
3336
|
-
function
|
|
3379
|
+
function Kt(e, t, n) {
|
|
3337
3380
|
const o = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
|
|
3338
|
-
if (!o) return n.map((
|
|
3381
|
+
if (!o) return n.map((c, l) => l);
|
|
3339
3382
|
const r = Array.from(o.children);
|
|
3340
|
-
return n.map((
|
|
3341
|
-
const
|
|
3342
|
-
return
|
|
3383
|
+
return n.map((c) => {
|
|
3384
|
+
const l = r.indexOf(c);
|
|
3385
|
+
return l >= 0 ? l : r.length;
|
|
3343
3386
|
});
|
|
3344
3387
|
}
|
|
3345
|
-
function
|
|
3388
|
+
function Li(e, t, n, s, i) {
|
|
3346
3389
|
s.sequences?.forEach((o) => {
|
|
3347
3390
|
let r;
|
|
3348
|
-
if (
|
|
3391
|
+
if (Pi(o)) {
|
|
3349
3392
|
const m = n.dataCache.sequences[o.sequenceId];
|
|
3350
3393
|
if (!m) {
|
|
3351
3394
|
console.warn(`Interact: Sequence "${o.sequenceId}" not found in cache`);
|
|
@@ -3354,49 +3397,49 @@ function Ai(e, t, n, s, i) {
|
|
|
3354
3397
|
r = { ...m, ...o };
|
|
3355
3398
|
} else
|
|
3356
3399
|
r = o;
|
|
3357
|
-
const
|
|
3358
|
-
if (n.addedInteractions[
|
|
3359
|
-
const u = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0,
|
|
3400
|
+
const c = r.sequenceId || ee(), l = q(`${e}::seq::${c}`, e);
|
|
3401
|
+
if (n.addedInteractions[l] && !i) return;
|
|
3402
|
+
const u = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0, a = Vt(
|
|
3360
3403
|
r,
|
|
3361
|
-
|
|
3404
|
+
l,
|
|
3362
3405
|
e,
|
|
3363
3406
|
t,
|
|
3364
3407
|
n,
|
|
3365
3408
|
{ updateKey: e, onUpdate: () => t.update() },
|
|
3366
3409
|
u
|
|
3367
3410
|
);
|
|
3368
|
-
if (!
|
|
3369
|
-
if (i && n.addedInteractions[
|
|
3370
|
-
const m =
|
|
3411
|
+
if (!a) return;
|
|
3412
|
+
if (i && n.addedInteractions[l]) {
|
|
3413
|
+
const m = Kt(
|
|
3371
3414
|
t,
|
|
3372
3415
|
s.listContainer,
|
|
3373
3416
|
i
|
|
3374
3417
|
);
|
|
3375
|
-
$.addToSequence(
|
|
3418
|
+
$.addToSequence(l, a, m, {
|
|
3376
3419
|
reducedMotion: $.forceReducedMotion
|
|
3377
3420
|
});
|
|
3378
|
-
const p = $.getSequence(
|
|
3421
|
+
const p = $.getSequence(l, r, a, {
|
|
3379
3422
|
reducedMotion: $.forceReducedMotion
|
|
3380
|
-
}),
|
|
3423
|
+
}), g = R(
|
|
3381
3424
|
s.conditions || [],
|
|
3382
3425
|
n.dataCache.conditions
|
|
3383
|
-
), y =
|
|
3384
|
-
y &&
|
|
3426
|
+
), y = je(s, t, i);
|
|
3427
|
+
y && ze(
|
|
3385
3428
|
s,
|
|
3386
3429
|
r,
|
|
3387
3430
|
y,
|
|
3388
3431
|
p,
|
|
3389
|
-
|
|
3432
|
+
g
|
|
3390
3433
|
);
|
|
3391
3434
|
return;
|
|
3392
3435
|
}
|
|
3393
|
-
const f = $.getSequence(
|
|
3436
|
+
const f = $.getSequence(l, r, a, {
|
|
3394
3437
|
reducedMotion: $.forceReducedMotion
|
|
3395
|
-
}), d =
|
|
3438
|
+
}), d = R(
|
|
3396
3439
|
s.conditions || [],
|
|
3397
3440
|
n.dataCache.conditions
|
|
3398
|
-
), h =
|
|
3399
|
-
h && (n.addedInteractions[
|
|
3441
|
+
), h = je(s, t, i);
|
|
3442
|
+
h && (n.addedInteractions[l] = !0, ze(
|
|
3400
3443
|
s,
|
|
3401
3444
|
r,
|
|
3402
3445
|
h,
|
|
@@ -3405,23 +3448,23 @@ function Ai(e, t, n, s, i) {
|
|
|
3405
3448
|
));
|
|
3406
3449
|
});
|
|
3407
3450
|
}
|
|
3408
|
-
function
|
|
3451
|
+
function Fi(e, t, n, s, i) {
|
|
3409
3452
|
const o = n.get(e)?.sequences || {};
|
|
3410
|
-
Object.keys(o).forEach((
|
|
3411
|
-
o[
|
|
3412
|
-
const f =
|
|
3413
|
-
|
|
3453
|
+
Object.keys(o).forEach((c) => {
|
|
3454
|
+
o[c].some(({ sequence: u, ...a }) => {
|
|
3455
|
+
const f = F(
|
|
3456
|
+
a.conditions || [],
|
|
3414
3457
|
n.dataCache.conditions
|
|
3415
3458
|
);
|
|
3416
3459
|
if (f && !f.matches)
|
|
3417
3460
|
return !1;
|
|
3418
|
-
const d =
|
|
3461
|
+
const d = a.key && q(a.key, e), h = $.getController(d);
|
|
3419
3462
|
if (!h)
|
|
3420
3463
|
return !0;
|
|
3421
|
-
const m = u.sequenceId ||
|
|
3464
|
+
const m = u.sequenceId || ee(), p = q(`${d}::seq::${m}`, d);
|
|
3422
3465
|
if (n.addedInteractions[p] && !i)
|
|
3423
3466
|
return !0;
|
|
3424
|
-
const y =
|
|
3467
|
+
const y = Vt(
|
|
3425
3468
|
u,
|
|
3426
3469
|
p,
|
|
3427
3470
|
d,
|
|
@@ -3432,69 +3475,69 @@ function Mi(e, t, n, s, i) {
|
|
|
3432
3475
|
);
|
|
3433
3476
|
if (!y) return !0;
|
|
3434
3477
|
if (i && n.addedInteractions[p]) {
|
|
3435
|
-
const b =
|
|
3478
|
+
const b = Kt(t, s, i);
|
|
3436
3479
|
return $.addToSequence(p, y, b, {
|
|
3437
3480
|
reducedMotion: $.forceReducedMotion
|
|
3438
3481
|
}), !0;
|
|
3439
3482
|
}
|
|
3440
|
-
const
|
|
3483
|
+
const E = $.getSequence(p, u, y, {
|
|
3441
3484
|
reducedMotion: $.forceReducedMotion
|
|
3442
|
-
}),
|
|
3443
|
-
|
|
3485
|
+
}), v = R(
|
|
3486
|
+
a.conditions || [],
|
|
3444
3487
|
n.dataCache.conditions
|
|
3445
|
-
), w =
|
|
3446
|
-
return w && (n.addedInteractions[p] = !0,
|
|
3447
|
-
|
|
3488
|
+
), w = je(a, h);
|
|
3489
|
+
return w && (n.addedInteractions[p] = !0, ze(
|
|
3490
|
+
a,
|
|
3448
3491
|
u,
|
|
3449
3492
|
w,
|
|
3450
|
-
|
|
3451
|
-
|
|
3493
|
+
E,
|
|
3494
|
+
v
|
|
3452
3495
|
)), !0;
|
|
3453
3496
|
});
|
|
3454
3497
|
});
|
|
3455
3498
|
}
|
|
3456
|
-
function
|
|
3457
|
-
const o = n.get(e), r = o?.effects || {},
|
|
3458
|
-
|
|
3459
|
-
const f = q(
|
|
3499
|
+
function Yt(e, t, n, s, i) {
|
|
3500
|
+
const o = n.get(e), r = o?.effects || {}, c = Object.keys(r), l = [];
|
|
3501
|
+
c.forEach((a) => {
|
|
3502
|
+
const f = q(a, e);
|
|
3460
3503
|
if (n.addedInteractions[f] && !i)
|
|
3461
3504
|
return;
|
|
3462
|
-
r[
|
|
3463
|
-
const
|
|
3505
|
+
r[a].some(({ effect: h, ...m }, p) => {
|
|
3506
|
+
const g = F(
|
|
3464
3507
|
m.conditions || [],
|
|
3465
3508
|
n.dataCache.conditions
|
|
3466
3509
|
);
|
|
3467
|
-
if (
|
|
3510
|
+
if (g && !g.matches)
|
|
3468
3511
|
return !1;
|
|
3469
|
-
const y = h.effectId,
|
|
3512
|
+
const y = h.effectId, E = {
|
|
3470
3513
|
...n.dataCache.effects[y] || {},
|
|
3471
3514
|
...h,
|
|
3472
3515
|
effectId: y
|
|
3473
3516
|
};
|
|
3474
|
-
if (s &&
|
|
3517
|
+
if (s && E.listContainer !== s)
|
|
3475
3518
|
return !1;
|
|
3476
|
-
const
|
|
3477
|
-
if (
|
|
3519
|
+
const v = F(E.conditions || [], n.dataCache.conditions);
|
|
3520
|
+
if (v && n.setupMediaQueryListener(
|
|
3478
3521
|
`${f}::${p}`,
|
|
3479
|
-
|
|
3522
|
+
v,
|
|
3480
3523
|
e,
|
|
3481
3524
|
() => {
|
|
3482
3525
|
t.update();
|
|
3483
3526
|
}
|
|
3484
|
-
), !
|
|
3527
|
+
), !v || v.matches) {
|
|
3485
3528
|
const w = m.key && q(m.key, e), b = $.getController(w);
|
|
3486
3529
|
if (!b)
|
|
3487
3530
|
return !0;
|
|
3488
|
-
|
|
3531
|
+
Se(
|
|
3489
3532
|
t,
|
|
3490
3533
|
t.element,
|
|
3491
|
-
|
|
3534
|
+
E,
|
|
3492
3535
|
e,
|
|
3493
3536
|
"effect"
|
|
3494
|
-
),
|
|
3495
|
-
const [S,
|
|
3537
|
+
), E.listContainer && t.watchChildList(E.listContainer);
|
|
3538
|
+
const [S, I] = Dt(
|
|
3496
3539
|
m,
|
|
3497
|
-
|
|
3540
|
+
E,
|
|
3498
3541
|
b.element,
|
|
3499
3542
|
b.useFirstChild,
|
|
3500
3543
|
t.element,
|
|
@@ -3502,33 +3545,33 @@ function Wt(e, t, n, s, i) {
|
|
|
3502
3545
|
void 0,
|
|
3503
3546
|
i
|
|
3504
3547
|
);
|
|
3505
|
-
if (!S || !
|
|
3548
|
+
if (!S || !I)
|
|
3506
3549
|
return !0;
|
|
3507
3550
|
n.addedInteractions[f] = !0;
|
|
3508
|
-
const
|
|
3509
|
-
|
|
3551
|
+
const O = R(
|
|
3552
|
+
E.conditions || [],
|
|
3510
3553
|
n.dataCache.conditions
|
|
3511
3554
|
);
|
|
3512
|
-
return
|
|
3555
|
+
return l.push([
|
|
3513
3556
|
e,
|
|
3514
3557
|
m,
|
|
3515
|
-
|
|
3558
|
+
E,
|
|
3516
3559
|
S,
|
|
3517
|
-
|
|
3518
|
-
|
|
3560
|
+
I,
|
|
3561
|
+
O,
|
|
3519
3562
|
t.useFirstChild,
|
|
3520
3563
|
w || void 0
|
|
3521
3564
|
]), !0;
|
|
3522
3565
|
}
|
|
3523
3566
|
return !1;
|
|
3524
3567
|
});
|
|
3525
|
-
}),
|
|
3526
|
-
|
|
3527
|
-
}),
|
|
3568
|
+
}), l.reverse().forEach((a) => {
|
|
3569
|
+
Gt(...a);
|
|
3570
|
+
}), Fi(e, t, n, s, i);
|
|
3528
3571
|
const u = Object.keys(o?.sequences || {}).length > 0;
|
|
3529
|
-
return
|
|
3572
|
+
return c.length > 0 || u;
|
|
3530
3573
|
}
|
|
3531
|
-
function
|
|
3574
|
+
function rt(e, t, n, s, i, o, r, c, l) {
|
|
3532
3575
|
let u;
|
|
3533
3576
|
if (i.transition || i.transitionProperties) {
|
|
3534
3577
|
const f = {
|
|
@@ -3536,83 +3579,83 @@ function it(e, t, n, s, i, o, r, a, c) {
|
|
|
3536
3579
|
effectId: i.effectId,
|
|
3537
3580
|
transition: i.transition,
|
|
3538
3581
|
transitionProperties: i.transitionProperties,
|
|
3539
|
-
childSelector:
|
|
3582
|
+
childSelector: G(i, {
|
|
3540
3583
|
asCombinator: !0,
|
|
3541
3584
|
addItemFilter: !0,
|
|
3542
|
-
useFirstChild:
|
|
3585
|
+
useFirstChild: c
|
|
3543
3586
|
}),
|
|
3544
3587
|
selectorCondition: r
|
|
3545
3588
|
};
|
|
3546
3589
|
if (u = $.getController(e), !u)
|
|
3547
3590
|
return;
|
|
3548
|
-
u.renderStyle(
|
|
3591
|
+
u.renderStyle(Qn(f));
|
|
3549
3592
|
}
|
|
3550
|
-
let
|
|
3593
|
+
let a;
|
|
3551
3594
|
if (n === "animationEnd") {
|
|
3552
|
-
const f = o.effectId, h = (
|
|
3553
|
-
h && (
|
|
3595
|
+
const f = o.effectId, h = (l ? $.getInstance(l) : void 0)?.dataCache.effects[f];
|
|
3596
|
+
h && (a = x(h));
|
|
3554
3597
|
}
|
|
3555
|
-
|
|
3598
|
+
D[n]?.add(t, s, i, o, {
|
|
3556
3599
|
reducedMotion: $.forceReducedMotion,
|
|
3557
3600
|
targetController: u,
|
|
3558
3601
|
selectorCondition: r,
|
|
3559
3602
|
allowA11yTriggers: $.allowA11yTriggers,
|
|
3560
|
-
sourceAnimationOptions:
|
|
3603
|
+
sourceAnimationOptions: a
|
|
3561
3604
|
});
|
|
3562
3605
|
}
|
|
3563
|
-
function
|
|
3606
|
+
function Ri(e) {
|
|
3564
3607
|
const t = e.key, n = $.getInstance(t);
|
|
3565
3608
|
if (!n)
|
|
3566
3609
|
return console.warn(`No instance found for key: ${t}`), $.setController(t, e), !1;
|
|
3567
3610
|
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,
|
|
3611
|
+
n.setController(t, e), s.forEach((r, c) => {
|
|
3612
|
+
const l = F(r.conditions, n.dataCache.conditions);
|
|
3613
|
+
if (l) {
|
|
3614
|
+
const u = `${t}::trigger::${c}`;
|
|
3615
|
+
n.setupMediaQueryListener(u, l, t, () => {
|
|
3573
3616
|
e.update();
|
|
3574
3617
|
});
|
|
3575
3618
|
}
|
|
3576
|
-
(!
|
|
3619
|
+
(!l || l.matches) && (Se(e, e.element, r, t, "interaction"), r.listContainer && e.watchChildList(r.listContainer), Wt(t, e, n, r));
|
|
3577
3620
|
});
|
|
3578
3621
|
let o = !1;
|
|
3579
|
-
return n && (o =
|
|
3622
|
+
return n && (o = Yt(t, e, n)), i || o;
|
|
3580
3623
|
}
|
|
3581
|
-
function
|
|
3624
|
+
function xi(e, t, n) {
|
|
3582
3625
|
const s = e.key, i = $.getInstance(s);
|
|
3583
3626
|
if (i) {
|
|
3584
3627
|
const { triggers: o = [] } = i?.get(s) || {};
|
|
3585
|
-
o.forEach((r,
|
|
3628
|
+
o.forEach((r, c) => {
|
|
3586
3629
|
if (r.listContainer !== t)
|
|
3587
3630
|
return;
|
|
3588
|
-
const
|
|
3589
|
-
if (
|
|
3590
|
-
const u = `${s}::listTrigger::${t}::${
|
|
3591
|
-
i.setupMediaQueryListener(u,
|
|
3631
|
+
const l = F(r.conditions, i.dataCache.conditions);
|
|
3632
|
+
if (l) {
|
|
3633
|
+
const u = `${s}::listTrigger::${t}::${c}`;
|
|
3634
|
+
i.setupMediaQueryListener(u, l, s, () => {
|
|
3592
3635
|
e.update();
|
|
3593
3636
|
});
|
|
3594
3637
|
}
|
|
3595
|
-
(!
|
|
3596
|
-
}),
|
|
3638
|
+
(!l || l.matches) && Wt(s, e, i, r, n);
|
|
3639
|
+
}), Yt(s, e, i, t, n);
|
|
3597
3640
|
}
|
|
3598
3641
|
}
|
|
3599
|
-
function
|
|
3642
|
+
function Ni(e, t = !1) {
|
|
3600
3643
|
const n = e.key, s = $.getInstance(n);
|
|
3601
3644
|
if (!s)
|
|
3602
3645
|
return;
|
|
3603
3646
|
const i = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
|
|
3604
3647
|
let o;
|
|
3605
|
-
i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element],
|
|
3648
|
+
i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element], Bt(o), s.deleteController(n, t);
|
|
3606
3649
|
}
|
|
3607
|
-
function
|
|
3608
|
-
const t = Object.values(
|
|
3650
|
+
function Bt(e) {
|
|
3651
|
+
const t = Object.values(D);
|
|
3609
3652
|
for (const n of e)
|
|
3610
3653
|
for (const s of t)
|
|
3611
3654
|
s.remove(n);
|
|
3612
3655
|
$.removeFromSequences(e);
|
|
3613
3656
|
}
|
|
3614
|
-
const
|
|
3615
|
-
class
|
|
3657
|
+
const Ae = "interactEffect";
|
|
3658
|
+
class ji {
|
|
3616
3659
|
element;
|
|
3617
3660
|
key;
|
|
3618
3661
|
connected;
|
|
@@ -3634,10 +3677,10 @@ class Li {
|
|
|
3634
3677
|
}
|
|
3635
3678
|
n !== t && (n && console.warn(
|
|
3636
3679
|
`Interact: Key mismatch between element ${n} and parameter ${t}, updating element key`
|
|
3637
|
-
), this.element.dataset.interactKey = t), this.key = t, this.connected =
|
|
3680
|
+
), this.element.dataset.interactKey = t), this.key = t, this.connected = Ri(this);
|
|
3638
3681
|
}
|
|
3639
3682
|
disconnect({ removeFromCache: t = !1 } = {}) {
|
|
3640
|
-
if ((this.key || this.element.dataset.interactKey) &&
|
|
3683
|
+
if ((this.key || this.element.dataset.interactKey) && Ni(this, t), this._pluginCleanups.length) {
|
|
3641
3684
|
for (const s of this._pluginCleanups)
|
|
3642
3685
|
try {
|
|
3643
3686
|
s();
|
|
@@ -3680,12 +3723,12 @@ class Li {
|
|
|
3680
3723
|
return;
|
|
3681
3724
|
}
|
|
3682
3725
|
const o = new Set(
|
|
3683
|
-
this.element.dataset[
|
|
3726
|
+
this.element.dataset[Ae]?.split(" ") || []
|
|
3684
3727
|
);
|
|
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[
|
|
3728
|
+
n === "toggle" ? o.has(t) ? o.delete(t) : o.add(t) : n === "add" ? o.add(t) : n === "remove" ? o.delete(t) : n === "clear" && o.clear(), (s || this.element).dataset[Ae] = Array.from(o).join(" ");
|
|
3686
3729
|
}
|
|
3687
3730
|
getActiveEffects() {
|
|
3688
|
-
const n = (this.element.dataset[
|
|
3731
|
+
const n = (this.element.dataset[Ae] || "").trim();
|
|
3689
3732
|
return n ? n.split(/\s+/) : [];
|
|
3690
3733
|
}
|
|
3691
3734
|
watchChildList(t) {
|
|
@@ -3698,26 +3741,26 @@ class Li {
|
|
|
3698
3741
|
_childListChangeHandler(t, n) {
|
|
3699
3742
|
const s = this.key || this.element.dataset.interactKey, i = [], o = [];
|
|
3700
3743
|
n.forEach((r) => {
|
|
3701
|
-
r.removedNodes.forEach((
|
|
3702
|
-
|
|
3703
|
-
}), r.addedNodes.forEach((
|
|
3704
|
-
|
|
3744
|
+
r.removedNodes.forEach((c) => {
|
|
3745
|
+
c instanceof HTMLElement && i.push(c);
|
|
3746
|
+
}), r.addedNodes.forEach((c) => {
|
|
3747
|
+
c instanceof HTMLElement && o.push(c);
|
|
3705
3748
|
});
|
|
3706
|
-
}),
|
|
3749
|
+
}), Bt(i), s && xi(this, t, o);
|
|
3707
3750
|
}
|
|
3708
3751
|
}
|
|
3709
|
-
function
|
|
3710
|
-
new
|
|
3752
|
+
function Hi(e, t) {
|
|
3753
|
+
new ji(e, t).connect();
|
|
3711
3754
|
}
|
|
3712
|
-
function
|
|
3755
|
+
function Di(e) {
|
|
3713
3756
|
const t = $.getController(e);
|
|
3714
3757
|
t && t.disconnect({ removeFromCache: !0 });
|
|
3715
3758
|
}
|
|
3716
3759
|
export {
|
|
3717
|
-
|
|
3760
|
+
ji as I,
|
|
3718
3761
|
$ as a,
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3762
|
+
Hi as b,
|
|
3763
|
+
zi as g,
|
|
3764
|
+
Di as r
|
|
3722
3765
|
};
|
|
3723
|
-
//# sourceMappingURL=index-
|
|
3766
|
+
//# sourceMappingURL=index-1AmVTHDV.mjs.map
|