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