@wix/interact 2.0.4 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/react.js +1 -1
- package/dist/cjs/web.js +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/react.js +2 -2
- package/dist/es/web.js +2 -2
- package/dist/{index-BZL18ynN.mjs → index-BtEG0cjF.mjs} +603 -562
- package/dist/index-BtEG0cjF.mjs.map +1 -0
- package/dist/index-ErMKtmX2.js +18 -0
- package/dist/index-ErMKtmX2.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/core/Interact.d.ts +3 -0
- package/dist/types/core/Interact.d.ts.map +1 -1
- package/dist/types/core/remove.d.ts.map +1 -1
- package/dist/types/handlers/eventTrigger.d.ts.map +1 -1
- package/docs/api/types.md +114 -0
- package/docs/examples/README.md +10 -1
- package/docs/examples/list-patterns.md +148 -0
- package/docs/guides/README.md +5 -0
- package/docs/guides/sequences.md +421 -0
- package/package.json +2 -2
- package/rules/click.md +112 -1
- package/rules/full-lean.md +67 -3
- package/rules/hover.md +74 -0
- package/rules/integration.md +70 -1
- package/rules/viewenter.md +93 -163
- package/dist/index-BZL18ynN.mjs.map +0 -1
- package/dist/index-IaOsZpFD.js +0 -18
- package/dist/index-IaOsZpFD.js.map +0 -1
|
@@ -5,11 +5,11 @@ function C(e, t) {
|
|
|
5
5
|
const n = st(t);
|
|
6
6
|
let s = 0;
|
|
7
7
|
return n.length ? e.replace(/\[]/g, () => {
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
const r = n[s++];
|
|
9
|
+
return r !== void 0 ? `[${r}]` : "[]";
|
|
10
10
|
}) : e;
|
|
11
11
|
}
|
|
12
|
-
class
|
|
12
|
+
class G {
|
|
13
13
|
animations;
|
|
14
14
|
options;
|
|
15
15
|
ready;
|
|
@@ -38,7 +38,7 @@ class N {
|
|
|
38
38
|
}
|
|
39
39
|
progress(t) {
|
|
40
40
|
for (const n of this.animations) {
|
|
41
|
-
const { delay: s, duration:
|
|
41
|
+
const { delay: s, duration: r, iterations: i } = n.effect.getTiming(), o = (Number.isFinite(r) ? r : 0) * (Number.isFinite(i) ? i : 1);
|
|
42
42
|
n.currentTime = ((s || 0) + o) * t;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -57,8 +57,8 @@ class N {
|
|
|
57
57
|
if (n && !this.isCSS) {
|
|
58
58
|
const s = n.effect?.target;
|
|
59
59
|
if (s) {
|
|
60
|
-
const
|
|
61
|
-
s.dispatchEvent(
|
|
60
|
+
const r = new Event("animationend");
|
|
61
|
+
s.dispatchEvent(r);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
t();
|
|
@@ -74,16 +74,16 @@ class N {
|
|
|
74
74
|
}
|
|
75
75
|
getTimingOptions() {
|
|
76
76
|
return this.animations.map((t) => {
|
|
77
|
-
const n = t.effect?.getTiming(), s = n?.delay ?? 0,
|
|
77
|
+
const n = t.effect?.getTiming(), s = n?.delay ?? 0, r = Number(n?.duration) || 0, i = n?.iterations ?? 1;
|
|
78
78
|
return {
|
|
79
79
|
delay: s,
|
|
80
|
-
duration:
|
|
81
|
-
iterations:
|
|
80
|
+
duration: r,
|
|
81
|
+
iterations: i
|
|
82
82
|
};
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
const Re = (e) => e, it = (e) => 1 - Math.cos(e * Math.PI / 2), rt = (e) => Math.sin(e * Math.PI / 2), ot = (e) => -(Math.cos(Math.PI * e) - 1) / 2, ct = (e) => e ** 2, at = (e) => 1 - (1 - e) ** 2, ft = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, lt = (e) => e ** 3, ut = (e) => 1 - (1 - e) ** 3, dt = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, ht = (e) => e ** 4, mt = (e) => 1 - (1 - e) ** 4, pt = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, gt = (e) => e ** 5, vt = (e) => 1 - (1 - e) ** 5, yt = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, Et = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), wt = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), bt = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, St = (e) => 1 - Math.sqrt(1 - e ** 2), It = (e) => Math.sqrt(1 - (e - 1) ** 2), Tt = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, Ot = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, Ct = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2,
|
|
86
|
+
const Re = (e) => e, it = (e) => 1 - Math.cos(e * Math.PI / 2), rt = (e) => Math.sin(e * Math.PI / 2), ot = (e) => -(Math.cos(Math.PI * e) - 1) / 2, ct = (e) => e ** 2, at = (e) => 1 - (1 - e) ** 2, ft = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, lt = (e) => e ** 3, ut = (e) => 1 - (1 - e) ** 3, dt = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, ht = (e) => e ** 4, mt = (e) => 1 - (1 - e) ** 4, pt = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, gt = (e) => e ** 5, vt = (e) => 1 - (1 - e) ** 5, yt = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, Et = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), wt = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), bt = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, St = (e) => 1 - Math.sqrt(1 - e ** 2), It = (e) => Math.sqrt(1 - (e - 1) ** 2), Tt = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, Ot = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, Ct = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, kt = (e, t = 1.70158 * 1.525) => e < 0.5 ? (2 * e) ** 2 * ((t + 1) * 2 * e - t) / 2 : ((2 * e - 2) ** 2 * ((t + 1) * (e * 2 - 2) + t) + 2) / 2, we = {
|
|
87
87
|
linear: Re,
|
|
88
88
|
sineIn: it,
|
|
89
89
|
sineOut: rt,
|
|
@@ -108,7 +108,7 @@ const Re = (e) => e, it = (e) => 1 - Math.cos(e * Math.PI / 2), rt = (e) => Math
|
|
|
108
108
|
circInOut: Tt,
|
|
109
109
|
backIn: Ot,
|
|
110
110
|
backOut: Ct,
|
|
111
|
-
backInOut:
|
|
111
|
+
backInOut: kt
|
|
112
112
|
}, be = {
|
|
113
113
|
linear: "linear",
|
|
114
114
|
ease: "ease",
|
|
@@ -140,22 +140,22 @@ const Re = (e) => e, it = (e) => 1 - Math.cos(e * Math.PI / 2), rt = (e) => Math
|
|
|
140
140
|
backOut: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
141
141
|
backInOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
|
|
142
142
|
};
|
|
143
|
-
function
|
|
143
|
+
function qt(e) {
|
|
144
144
|
return e === "percentage" ? "%" : e || "px";
|
|
145
145
|
}
|
|
146
146
|
function B(e) {
|
|
147
147
|
return e ? be[e] || e : be.linear;
|
|
148
148
|
}
|
|
149
149
|
function At(e, t, n, s) {
|
|
150
|
-
const
|
|
150
|
+
const r = 3 * e, i = 3 * (n - e) - r, o = 1 - r - i, c = 3 * t, u = 3 * (s - t) - c, f = 1 - c - u, a = (d) => ((o * d + i) * d + r) * d, l = (d) => ((f * d + u) * d + c) * d, m = (d) => (3 * o * d + 2 * i) * d + r;
|
|
151
151
|
function g(d) {
|
|
152
152
|
let h = d;
|
|
153
153
|
for (let v = 0; v < 8; v++) {
|
|
154
|
-
const
|
|
155
|
-
if (Math.abs(
|
|
154
|
+
const w = a(h) - d;
|
|
155
|
+
if (Math.abs(w) < 1e-7) return h;
|
|
156
156
|
const b = m(h);
|
|
157
157
|
if (Math.abs(b) < 1e-6) break;
|
|
158
|
-
h -=
|
|
158
|
+
h -= w / b;
|
|
159
159
|
}
|
|
160
160
|
let p = 0, y = 1;
|
|
161
161
|
for (h = (p + y) / 2; y - p > 1e-7; ) {
|
|
@@ -167,16 +167,16 @@ function At(e, t, n, s) {
|
|
|
167
167
|
}
|
|
168
168
|
return (d) => d <= 0 ? 0 : d >= 1 ? 1 : l(g(d));
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function _t(e) {
|
|
171
171
|
const t = e.match(
|
|
172
172
|
/^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/
|
|
173
173
|
);
|
|
174
174
|
if (!t) return;
|
|
175
|
-
const n = parseFloat(t[1]), s = parseFloat(t[2]),
|
|
176
|
-
if (![n, s,
|
|
177
|
-
return At(n, s,
|
|
175
|
+
const n = parseFloat(t[1]), s = parseFloat(t[2]), r = parseFloat(t[3]), i = parseFloat(t[4]);
|
|
176
|
+
if (![n, s, r, i].some(isNaN))
|
|
177
|
+
return At(n, s, r, i);
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function xt(e) {
|
|
180
180
|
const t = e.match(/^linear\((.+)\)$/);
|
|
181
181
|
if (!t) return;
|
|
182
182
|
const n = t[1].split(",").map((o) => o.trim()).filter(Boolean);
|
|
@@ -196,52 +196,52 @@ function qt(e) {
|
|
|
196
196
|
}
|
|
197
197
|
if (s.length === 0) return;
|
|
198
198
|
s[0].pos === null && (s[0].pos = 0), s[s.length - 1].pos === null && (s[s.length - 1].pos = 1);
|
|
199
|
-
let
|
|
200
|
-
for (;
|
|
201
|
-
if (s[
|
|
202
|
-
const o =
|
|
203
|
-
let c =
|
|
199
|
+
let r = 0;
|
|
200
|
+
for (; r < s.length; )
|
|
201
|
+
if (s[r].pos === null) {
|
|
202
|
+
const o = r - 1;
|
|
203
|
+
let c = r;
|
|
204
204
|
for (; c < s.length && s[c].pos === null; ) c++;
|
|
205
205
|
const u = s[o].pos, f = s[c].pos, a = c - o;
|
|
206
206
|
for (let l = o + 1; l < c; l++)
|
|
207
207
|
s[l].pos = u + (f - u) * (l - o) / a;
|
|
208
|
-
|
|
208
|
+
r = c + 1;
|
|
209
209
|
} else
|
|
210
|
-
|
|
210
|
+
r++;
|
|
211
211
|
for (let o = 1; o < s.length; o++)
|
|
212
212
|
s[o].pos < s[o - 1].pos && (s[o].pos = s[o - 1].pos);
|
|
213
|
-
const
|
|
213
|
+
const i = s;
|
|
214
214
|
return (o) => {
|
|
215
|
-
if (o <=
|
|
216
|
-
const c =
|
|
215
|
+
if (o <= i[0].pos) return i[0].output;
|
|
216
|
+
const c = i[i.length - 1];
|
|
217
217
|
if (o >= c.pos) return c.output;
|
|
218
|
-
let u = 0, f =
|
|
218
|
+
let u = 0, f = i.length - 1;
|
|
219
219
|
for (; u < f - 1; ) {
|
|
220
220
|
const m = u + f >>> 1;
|
|
221
|
-
|
|
221
|
+
i[m].pos <= o ? u = m : f = m;
|
|
222
222
|
}
|
|
223
|
-
const a =
|
|
223
|
+
const a = i[u], l = i[f];
|
|
224
224
|
return l.pos === a.pos ? l.output : a.output + (l.output - a.output) * (o - a.pos) / (l.pos - a.pos);
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
function ze(e) {
|
|
228
228
|
if (!e) return;
|
|
229
229
|
const t = we[e];
|
|
230
|
-
return t || (
|
|
230
|
+
return t || (_t(e) ?? xt(e) ?? we.linear);
|
|
231
231
|
}
|
|
232
|
-
class
|
|
232
|
+
class Mt extends G {
|
|
233
233
|
animationGroups;
|
|
234
234
|
delay;
|
|
235
235
|
offset;
|
|
236
236
|
offsetEasing;
|
|
237
237
|
timingOptions;
|
|
238
238
|
constructor(t, n = {}) {
|
|
239
|
-
const s = t.flatMap((
|
|
240
|
-
super(s), this.animationGroups = t, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : ze(n.offsetEasing) ?? Re, this.timingOptions = this.animationGroups.map((
|
|
241
|
-
delay:
|
|
239
|
+
const s = t.flatMap((r) => [...r.animations]);
|
|
240
|
+
super(s), this.animationGroups = t, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : ze(n.offsetEasing) ?? Re, this.timingOptions = this.animationGroups.map((r) => r.getTimingOptions().map(({ delay: i, duration: o, iterations: c }) => ({
|
|
241
|
+
delay: i,
|
|
242
242
|
duration: Number.isFinite(o) ? o : 0,
|
|
243
243
|
iterations: Number.isFinite(c) ? c : 1
|
|
244
|
-
}))), this.applyOffsets(), this.ready = Promise.all(t.map((
|
|
244
|
+
}))), this.applyOffsets(), this.ready = Promise.all(t.map((r) => r.ready)).then(() => {
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
247
|
/**
|
|
@@ -255,16 +255,17 @@ class Lt extends N {
|
|
|
255
255
|
const n = t - 1;
|
|
256
256
|
return Array.from(
|
|
257
257
|
{ length: t },
|
|
258
|
-
(s,
|
|
258
|
+
(s, r) => this.offsetEasing(r / n) * n * this.offset | 0
|
|
259
259
|
);
|
|
260
260
|
}
|
|
261
261
|
applyOffsets() {
|
|
262
|
+
if (this.animationGroups.length === 0 || this.animations.length === 0) return;
|
|
262
263
|
const t = this.calculateOffsets(), n = this.getSequenceActiveDuration(t);
|
|
263
|
-
this.animationGroups.forEach((s,
|
|
264
|
-
s.animations.forEach((
|
|
265
|
-
const c =
|
|
264
|
+
this.animationGroups.forEach((s, r) => {
|
|
265
|
+
s.animations.forEach((i, o) => {
|
|
266
|
+
const c = i.effect;
|
|
266
267
|
if (!c) return;
|
|
267
|
-
const { delay: u, duration: f, iterations: a } = this.timingOptions[
|
|
268
|
+
const { delay: u, duration: f, iterations: a } = this.timingOptions[r][o], l = u + t[r], m = n - (l + f * a);
|
|
268
269
|
c.updateTiming({ delay: l + this.delay, endDelay: m });
|
|
269
270
|
});
|
|
270
271
|
});
|
|
@@ -272,12 +273,12 @@ class Lt extends N {
|
|
|
272
273
|
getSequenceActiveDuration(t) {
|
|
273
274
|
const n = [];
|
|
274
275
|
for (let s = 0; s < this.timingOptions.length; s++) {
|
|
275
|
-
const
|
|
276
|
-
if (!o) return
|
|
276
|
+
const r = this.timingOptions[s].reduce((i, o) => {
|
|
277
|
+
if (!o) return i;
|
|
277
278
|
const { delay: c, duration: u, iterations: f } = o;
|
|
278
|
-
return Math.max(
|
|
279
|
+
return Math.max(i, c + u * f);
|
|
279
280
|
}, 0);
|
|
280
|
-
n.push(t[s] +
|
|
281
|
+
n.push(t[s] + r);
|
|
281
282
|
}
|
|
282
283
|
return Math.max(...n);
|
|
283
284
|
}
|
|
@@ -288,16 +289,31 @@ class Lt extends N {
|
|
|
288
289
|
*/
|
|
289
290
|
addGroups(t) {
|
|
290
291
|
if (t.length === 0) return;
|
|
291
|
-
const n = [...t].sort((s,
|
|
292
|
-
for (const { index: s, group:
|
|
293
|
-
const
|
|
294
|
-
this.animationGroups.splice(
|
|
295
|
-
const o = [...
|
|
292
|
+
const n = [...t].sort((s, r) => r.index - s.index);
|
|
293
|
+
for (const { index: s, group: r } of n) {
|
|
294
|
+
const i = Math.min(s, this.animationGroups.length);
|
|
295
|
+
this.animationGroups.splice(i, 0, r), this.timingOptions.splice(i, 0, r.getTimingOptions());
|
|
296
|
+
const o = [...r.animations], c = this.animationGroups.slice(0, i).reduce((u, f) => u + f.animations.length, 0);
|
|
296
297
|
this.animations.splice(c, 0, ...o);
|
|
297
298
|
}
|
|
298
299
|
this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((s) => s.ready)).then(() => {
|
|
299
300
|
});
|
|
300
301
|
}
|
|
302
|
+
/**
|
|
303
|
+
* Removes AnimationGroups that match the predicate, then recalculates
|
|
304
|
+
* stagger offsets for remaining groups. Cancelled animations in removed
|
|
305
|
+
* groups are returned.
|
|
306
|
+
*/
|
|
307
|
+
removeGroups(t) {
|
|
308
|
+
const n = [], s = [], r = [];
|
|
309
|
+
for (let i = 0; i < this.animationGroups.length; i++)
|
|
310
|
+
t(this.animationGroups[i]) ? n.push(this.animationGroups[i]) : (s.push(this.animationGroups[i]), r.push(this.timingOptions[i]));
|
|
311
|
+
if (n.length === 0) return n;
|
|
312
|
+
for (const i of n)
|
|
313
|
+
i.cancel();
|
|
314
|
+
return this.animationGroups = s, this.timingOptions = r, this.animations = s.flatMap((i) => [...i.animations]), this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((i) => i.ready)).then(() => {
|
|
315
|
+
}), n;
|
|
316
|
+
}
|
|
301
317
|
async onFinish(t) {
|
|
302
318
|
try {
|
|
303
319
|
await Promise.all(this.animationGroups.map((n) => n.finished)), t();
|
|
@@ -306,18 +322,18 @@ class Lt extends N {
|
|
|
306
322
|
}
|
|
307
323
|
}
|
|
308
324
|
}
|
|
309
|
-
class
|
|
325
|
+
class Lt {
|
|
310
326
|
_animation;
|
|
311
327
|
customEffect;
|
|
312
328
|
progress;
|
|
313
329
|
_tickCbId;
|
|
314
330
|
_finishHandler;
|
|
315
|
-
constructor(t, n, s,
|
|
316
|
-
const
|
|
331
|
+
constructor(t, n, s, r) {
|
|
332
|
+
const i = new KeyframeEffect(n, [], {
|
|
317
333
|
...s,
|
|
318
334
|
composite: "add"
|
|
319
|
-
}), { timeline: o } =
|
|
320
|
-
this._animation = new Animation(
|
|
335
|
+
}), { timeline: o } = r;
|
|
336
|
+
this._animation = new Animation(i, o), this._tickCbId = null, this.progress = null, this.customEffect = (c) => t(i.target, c), this._finishHandler = (c) => {
|
|
321
337
|
this.effect.target?.getAnimations().find((u) => u === this._animation) || this.cancel();
|
|
322
338
|
}, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
|
|
323
339
|
}
|
|
@@ -446,23 +462,23 @@ class Mt {
|
|
|
446
462
|
return this._animation.dispatchEvent(t);
|
|
447
463
|
}
|
|
448
464
|
}
|
|
449
|
-
function
|
|
465
|
+
function Pt(e) {
|
|
450
466
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
451
467
|
}
|
|
452
468
|
var K = { exports: {} }, Se = K.exports, Ie;
|
|
453
|
-
function
|
|
469
|
+
function $t() {
|
|
454
470
|
return Ie || (Ie = 1, (function(e) {
|
|
455
471
|
(function(t) {
|
|
456
472
|
var n = function() {
|
|
457
473
|
}, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(a) {
|
|
458
474
|
return setTimeout(a, 16);
|
|
459
475
|
};
|
|
460
|
-
function
|
|
476
|
+
function r() {
|
|
461
477
|
var a = this;
|
|
462
478
|
a.reads = [], a.writes = [], a.raf = s.bind(t);
|
|
463
479
|
}
|
|
464
|
-
|
|
465
|
-
constructor:
|
|
480
|
+
r.prototype = {
|
|
481
|
+
constructor: r,
|
|
466
482
|
/**
|
|
467
483
|
* We run this inside a try catch
|
|
468
484
|
* so that if any jobs error, we
|
|
@@ -484,7 +500,7 @@ function Pt() {
|
|
|
484
500
|
*/
|
|
485
501
|
measure: function(a, l) {
|
|
486
502
|
var m = l ? a.bind(l) : a;
|
|
487
|
-
return this.reads.push(m),
|
|
503
|
+
return this.reads.push(m), i(this), m;
|
|
488
504
|
},
|
|
489
505
|
/**
|
|
490
506
|
* Adds a job to the
|
|
@@ -497,7 +513,7 @@ function Pt() {
|
|
|
497
513
|
*/
|
|
498
514
|
mutate: function(a, l) {
|
|
499
515
|
var m = l ? a.bind(l) : a;
|
|
500
|
-
return this.writes.push(m),
|
|
516
|
+
return this.writes.push(m), i(this), m;
|
|
501
517
|
},
|
|
502
518
|
/**
|
|
503
519
|
* Clears a scheduled 'read' or 'write' task.
|
|
@@ -553,7 +569,7 @@ function Pt() {
|
|
|
553
569
|
// when tasks throw
|
|
554
570
|
catch: null
|
|
555
571
|
};
|
|
556
|
-
function
|
|
572
|
+
function i(a) {
|
|
557
573
|
a.scheduled || (a.scheduled = !0, a.raf(o.bind(null, a)));
|
|
558
574
|
}
|
|
559
575
|
function o(a) {
|
|
@@ -563,7 +579,7 @@ function Pt() {
|
|
|
563
579
|
} catch (d) {
|
|
564
580
|
g = d;
|
|
565
581
|
}
|
|
566
|
-
if (a.scheduled = !1, (m.length || l.length) &&
|
|
582
|
+
if (a.scheduled = !1, (m.length || l.length) && i(a), g)
|
|
567
583
|
if (n("task errored", g.message), a.catch) a.catch(g);
|
|
568
584
|
else throw g;
|
|
569
585
|
}
|
|
@@ -575,13 +591,13 @@ function Pt() {
|
|
|
575
591
|
for (var m in l)
|
|
576
592
|
l.hasOwnProperty(m) && (a[m] = l[m]);
|
|
577
593
|
}
|
|
578
|
-
var f = t.fastdom = t.fastdom || new
|
|
594
|
+
var f = t.fastdom = t.fastdom || new r();
|
|
579
595
|
e.exports = f;
|
|
580
596
|
})(typeof window < "u" ? window : typeof Se < "u" ? Se : globalThis);
|
|
581
597
|
})(K)), K.exports;
|
|
582
598
|
}
|
|
583
|
-
var Ft =
|
|
584
|
-
const
|
|
599
|
+
var Ft = $t();
|
|
600
|
+
const T = /* @__PURE__ */ Pt(Ft), fe = {};
|
|
585
601
|
function Rt(e) {
|
|
586
602
|
Object.assign(fe, e);
|
|
587
603
|
}
|
|
@@ -590,33 +606,33 @@ function zt(e) {
|
|
|
590
606
|
`${e} not found in registry. Please make sure to import and register the preset.`
|
|
591
607
|
), null);
|
|
592
608
|
}
|
|
593
|
-
function
|
|
609
|
+
function M(e, t) {
|
|
594
610
|
return e ? document.getElementById(e) : null;
|
|
595
611
|
}
|
|
596
612
|
function Ht(e, t) {
|
|
597
613
|
return e?.matches(`[data-motion-part~="${t}"]`) ? e : e?.querySelector(`[data-motion-part~="${t}"]`);
|
|
598
614
|
}
|
|
599
|
-
function
|
|
615
|
+
function Gt(e) {
|
|
600
616
|
const t = e.alternate ? "alternate" : "";
|
|
601
617
|
return e.reversed ? `${t ? `${t}-` : ""}reverse` : t || "normal";
|
|
602
618
|
}
|
|
603
619
|
function re(e) {
|
|
604
|
-
return `${e.value}${
|
|
620
|
+
return `${e.value}${qt(e.unit)}`;
|
|
605
621
|
}
|
|
606
622
|
function Te(e, t, n) {
|
|
607
623
|
return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${re(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${re(e.offset)} + ${t})` : re(e.offset)}`;
|
|
608
624
|
}
|
|
609
|
-
function
|
|
625
|
+
function Nt(e) {
|
|
610
626
|
return {
|
|
611
627
|
start: Te(e.startOffset, e.startOffsetAdd),
|
|
612
628
|
end: Te(e.endOffset, e.endOffsetAdd, !0)
|
|
613
629
|
};
|
|
614
630
|
}
|
|
615
631
|
function He(e) {
|
|
616
|
-
return (t) =>
|
|
632
|
+
return (t) => T.measure(() => t(e));
|
|
617
633
|
}
|
|
618
|
-
function
|
|
619
|
-
return (t) =>
|
|
634
|
+
function Ge(e) {
|
|
635
|
+
return (t) => T.mutate(() => t(e));
|
|
620
636
|
}
|
|
621
637
|
function Z(e) {
|
|
622
638
|
if (e.namedEffect) {
|
|
@@ -624,51 +640,51 @@ function Z(e) {
|
|
|
624
640
|
return typeof t == "string" ? zt(t) : null;
|
|
625
641
|
} else if (e.keyframeEffect) {
|
|
626
642
|
const t = (s) => {
|
|
627
|
-
const { name:
|
|
628
|
-
return [{ ...s, name:
|
|
643
|
+
const { name: r, keyframes: i } = s.keyframeEffect;
|
|
644
|
+
return [{ ...s, name: r, keyframes: i }];
|
|
629
645
|
};
|
|
630
646
|
return { web: t, style: t, getNames: (s) => {
|
|
631
|
-
const { effectId:
|
|
647
|
+
const { effectId: r } = s, { name: i } = s.keyframeEffect, o = i || r;
|
|
632
648
|
return o ? [o] : [];
|
|
633
649
|
} };
|
|
634
650
|
} else if (e.customEffect)
|
|
635
651
|
return (t) => [{ ...t, keyframes: [] }];
|
|
636
652
|
return null;
|
|
637
653
|
}
|
|
638
|
-
function
|
|
639
|
-
return e.map((s,
|
|
640
|
-
const
|
|
654
|
+
function Dt(e, t, n) {
|
|
655
|
+
return e.map((s, r) => {
|
|
656
|
+
const i = {
|
|
641
657
|
fill: s.fill,
|
|
642
658
|
easing: B(s.easing),
|
|
643
659
|
iterations: s.iterations === 0 ? 1 / 0 : s.iterations || 1,
|
|
644
660
|
composite: s.composite,
|
|
645
|
-
direction:
|
|
661
|
+
direction: Gt(s)
|
|
646
662
|
};
|
|
647
|
-
return
|
|
663
|
+
return Ne(t) ? (i.duration = s.duration, i.delay = s.delay || 0) : window.ViewTimeline && t?.trigger === "view-progress" ? i.duration = "auto" : (i.duration = 99.99, i.delay = 0.01), {
|
|
648
664
|
effect: s,
|
|
649
|
-
options:
|
|
650
|
-
id: n && `${n}-${
|
|
665
|
+
options: i,
|
|
666
|
+
id: n && `${n}-${r + 1}`,
|
|
651
667
|
part: s.part
|
|
652
668
|
};
|
|
653
669
|
});
|
|
654
670
|
}
|
|
655
|
-
function
|
|
671
|
+
function Ne(e) {
|
|
656
672
|
return !e || e.trigger !== "pointer-move" && e.trigger !== "view-progress";
|
|
657
673
|
}
|
|
658
|
-
function Oe(e, t, n, s,
|
|
674
|
+
function Oe(e, t, n, s, r) {
|
|
659
675
|
if (e) {
|
|
660
|
-
if (
|
|
676
|
+
if (Ne(s) && (t.duration = t.duration || 1, r?.reducedMotion))
|
|
661
677
|
if (t.iterations === 1 || t.iterations == null)
|
|
662
678
|
t = { ...t, duration: 1 };
|
|
663
679
|
else
|
|
664
680
|
return [];
|
|
665
|
-
let
|
|
666
|
-
return n instanceof HTMLElement && (
|
|
681
|
+
let i;
|
|
682
|
+
return n instanceof HTMLElement && (i = { measure: He(n), mutate: Ge(n) }), e.web ? e.web(t, i, r) : e(t, i, r);
|
|
667
683
|
}
|
|
668
684
|
return [];
|
|
669
685
|
}
|
|
670
|
-
function ve(e, t, n, s,
|
|
671
|
-
const
|
|
686
|
+
function ve(e, t, n, s, r) {
|
|
687
|
+
const i = e instanceof HTMLElement ? e : M(e);
|
|
672
688
|
if (n?.trigger === "pointer-move" && !t.keyframeEffect) {
|
|
673
689
|
let m = t;
|
|
674
690
|
t.customEffect && (m = {
|
|
@@ -680,33 +696,33 @@ function ve(e, t, n, s, i) {
|
|
|
680
696
|
), d = Oe(
|
|
681
697
|
g,
|
|
682
698
|
t,
|
|
683
|
-
|
|
699
|
+
i,
|
|
684
700
|
n,
|
|
685
701
|
s
|
|
686
702
|
);
|
|
687
|
-
return typeof d != "function" ? null : d(
|
|
703
|
+
return typeof d != "function" ? null : d(i);
|
|
688
704
|
}
|
|
689
705
|
const o = Z(t), c = Oe(
|
|
690
706
|
o,
|
|
691
707
|
t,
|
|
692
|
-
|
|
708
|
+
i,
|
|
693
709
|
n,
|
|
694
710
|
s
|
|
695
711
|
);
|
|
696
712
|
if (!c || c.length === 0)
|
|
697
713
|
return null;
|
|
698
|
-
const u =
|
|
714
|
+
const u = Dt(c, n, t.effectId);
|
|
699
715
|
let f;
|
|
700
716
|
const a = n?.trigger === "view-progress";
|
|
701
717
|
a && window.ViewTimeline && (f = new ViewTimeline({
|
|
702
|
-
subject: n.element ||
|
|
718
|
+
subject: n.element || M(n.componentId)
|
|
703
719
|
}));
|
|
704
720
|
const l = u.map(({ effect: m, options: g, id: d, part: h }) => {
|
|
705
|
-
const p = h ? Ht(
|
|
706
|
-
|
|
721
|
+
const p = h ? Ht(i, h) : i, y = new KeyframeEffect(p || null, [], g);
|
|
722
|
+
T.mutate(() => {
|
|
707
723
|
"timing" in m && y.updateTiming(m.timing), y.setKeyframes(m.keyframes);
|
|
708
724
|
});
|
|
709
|
-
const v = a && f ? { timeline: f } : {},
|
|
725
|
+
const v = a && f ? { timeline: f } : {}, w = typeof m.customEffect == "function" ? new Lt(
|
|
710
726
|
m.customEffect,
|
|
711
727
|
p || null,
|
|
712
728
|
g,
|
|
@@ -714,72 +730,72 @@ function ve(e, t, n, s, i) {
|
|
|
714
730
|
) : new Animation(y, v.timeline);
|
|
715
731
|
if (a)
|
|
716
732
|
if (f)
|
|
717
|
-
|
|
718
|
-
const { start: b, end: S } =
|
|
719
|
-
|
|
733
|
+
T.mutate(() => {
|
|
734
|
+
const { start: b, end: S } = Nt(m);
|
|
735
|
+
w.rangeStart = b, w.rangeEnd = S, w.play();
|
|
720
736
|
});
|
|
721
737
|
else {
|
|
722
738
|
const { startOffset: b, endOffset: S } = t;
|
|
723
|
-
|
|
724
|
-
const
|
|
725
|
-
Object.assign(
|
|
739
|
+
T.mutate(() => {
|
|
740
|
+
const I = m.startOffset || b, $ = m.endOffset || S;
|
|
741
|
+
Object.assign(w, {
|
|
726
742
|
start: {
|
|
727
|
-
name:
|
|
728
|
-
offset:
|
|
743
|
+
name: I.name,
|
|
744
|
+
offset: I.offset?.value,
|
|
729
745
|
add: m.startOffsetAdd
|
|
730
746
|
},
|
|
731
747
|
end: {
|
|
732
|
-
name:
|
|
733
|
-
offset:
|
|
748
|
+
name: $.name,
|
|
749
|
+
offset: $.offset?.value,
|
|
734
750
|
add: m.endOffsetAdd
|
|
735
751
|
}
|
|
736
752
|
});
|
|
737
753
|
});
|
|
738
754
|
}
|
|
739
|
-
return d && (
|
|
755
|
+
return d && (w.id = d), w;
|
|
740
756
|
});
|
|
741
|
-
return new
|
|
757
|
+
return new G(l, {
|
|
742
758
|
...t,
|
|
743
759
|
trigger: { ...n || {} },
|
|
744
760
|
// make sure the group is ready after all animation targets are measured and mutated
|
|
745
|
-
measured: new Promise((m) =>
|
|
761
|
+
measured: new Promise((m) => T.mutate(m))
|
|
746
762
|
});
|
|
747
763
|
}
|
|
748
764
|
function Vt(e, t, n) {
|
|
749
|
-
const s = Z(t),
|
|
750
|
-
if (s && s.prepare &&
|
|
751
|
-
const
|
|
752
|
-
s.prepare(t,
|
|
765
|
+
const s = Z(t), r = e instanceof HTMLElement ? e : M(e);
|
|
766
|
+
if (s && s.prepare && r) {
|
|
767
|
+
const i = { measure: He(r), mutate: Ge(r) };
|
|
768
|
+
s.prepare(t, i);
|
|
753
769
|
}
|
|
754
|
-
n &&
|
|
770
|
+
n && T.mutate(n);
|
|
755
771
|
}
|
|
756
|
-
function
|
|
772
|
+
function Wt(e, t) {
|
|
757
773
|
const n = Z(t);
|
|
758
774
|
if (!n)
|
|
759
775
|
return null;
|
|
760
776
|
if (!n.style)
|
|
761
|
-
return t.effectId && e ?
|
|
762
|
-
const s = n.getNames(t),
|
|
777
|
+
return t.effectId && e ? jt(e, t.effectId) : null;
|
|
778
|
+
const s = n.getNames(t), i = (typeof e == "string" ? M(e) : e)?.getAnimations(), o = i?.map((u) => u.animationName) || [], c = [];
|
|
763
779
|
return s.forEach((u) => {
|
|
764
780
|
o.includes(u) && c.push(
|
|
765
|
-
|
|
781
|
+
i?.find((f) => f.animationName === u)
|
|
766
782
|
);
|
|
767
|
-
}), c?.length ? new
|
|
783
|
+
}), c?.length ? new G(c) : null;
|
|
768
784
|
}
|
|
769
|
-
function
|
|
770
|
-
const s = (typeof e == "string" ?
|
|
771
|
-
const
|
|
772
|
-
return
|
|
785
|
+
function jt(e, t) {
|
|
786
|
+
const s = (typeof e == "string" ? M(e) : e)?.getAnimations().filter((r) => {
|
|
787
|
+
const i = r.id || r.animationName;
|
|
788
|
+
return i ? i.startsWith(t) : !0;
|
|
773
789
|
});
|
|
774
|
-
return s?.length ? new
|
|
790
|
+
return s?.length ? new G(s) : null;
|
|
775
791
|
}
|
|
776
|
-
function
|
|
777
|
-
const { disabled:
|
|
792
|
+
function De(e, t, n, s = {}) {
|
|
793
|
+
const { disabled: r, allowActiveEvent: i, ...o } = s, c = ve(e, t, n, o);
|
|
778
794
|
if (!c)
|
|
779
795
|
return null;
|
|
780
796
|
let u = {};
|
|
781
797
|
if (n.trigger === "view-progress" && !window.ViewTimeline) {
|
|
782
|
-
const f = n.element ||
|
|
798
|
+
const f = n.element || M(n.componentId), { ready: a } = c;
|
|
783
799
|
return c.animations.map((l) => ({
|
|
784
800
|
/* we use getters for start and end in order to access the animation's start and end
|
|
785
801
|
only when initializing the scrub scene rather than immediately */
|
|
@@ -798,7 +814,7 @@ function Ge(e, t, n, s = {}) {
|
|
|
798
814
|
const { activeDuration: d } = l.effect.getComputedTiming(), { delay: h } = l.effect.getTiming();
|
|
799
815
|
l.currentTime = ((h || 0) + (d || 0)) * g;
|
|
800
816
|
},
|
|
801
|
-
disabled:
|
|
817
|
+
disabled: r,
|
|
802
818
|
destroy() {
|
|
803
819
|
l.cancel();
|
|
804
820
|
}
|
|
@@ -819,7 +835,7 @@ function Ge(e, t, n, s = {}) {
|
|
|
819
835
|
const v = g === "x" ? y.x : y.y;
|
|
820
836
|
this._currentProgress = v, d.progress(v);
|
|
821
837
|
},
|
|
822
|
-
disabled:
|
|
838
|
+
disabled: r ?? !1,
|
|
823
839
|
destroy() {
|
|
824
840
|
d.cancel();
|
|
825
841
|
}
|
|
@@ -827,7 +843,7 @@ function Ge(e, t, n, s = {}) {
|
|
|
827
843
|
}
|
|
828
844
|
u = {
|
|
829
845
|
centeredToTarget: a,
|
|
830
|
-
allowActiveEvent:
|
|
846
|
+
allowActiveEvent: i
|
|
831
847
|
}, t.customEffect && l && (u.transitionDuration = l, u.transitionEasing = ze(m)), u.target = c.target;
|
|
832
848
|
}
|
|
833
849
|
return {
|
|
@@ -845,45 +861,45 @@ function Ge(e, t, n, s = {}) {
|
|
|
845
861
|
} : a
|
|
846
862
|
);
|
|
847
863
|
},
|
|
848
|
-
disabled:
|
|
864
|
+
disabled: r,
|
|
849
865
|
destroy() {
|
|
850
866
|
c.cancel();
|
|
851
867
|
}
|
|
852
868
|
};
|
|
853
869
|
}
|
|
854
870
|
function ne(e, t, n, s = !1) {
|
|
855
|
-
const
|
|
856
|
-
return
|
|
857
|
-
Vt(e, t,
|
|
858
|
-
}),
|
|
871
|
+
const r = Wt(e, t);
|
|
872
|
+
return r ? (r.ready = new Promise((i) => {
|
|
873
|
+
Vt(e, t, i);
|
|
874
|
+
}), r) : ve(e, t, n, { reducedMotion: s });
|
|
859
875
|
}
|
|
860
876
|
function Yt(e) {
|
|
861
877
|
return e === null ? [null] : typeof e == "string" ? Array.from(document.querySelectorAll(e)) : Array.isArray(e) ? e : [e];
|
|
862
878
|
}
|
|
863
879
|
function Ve(e, t) {
|
|
864
880
|
const n = [];
|
|
865
|
-
for (const { target: s, options:
|
|
866
|
-
const
|
|
867
|
-
for (const o of
|
|
881
|
+
for (const { target: s, options: r } of e) {
|
|
882
|
+
const i = Yt(s);
|
|
883
|
+
for (const o of i) {
|
|
868
884
|
const c = ne(
|
|
869
885
|
o,
|
|
870
|
-
|
|
886
|
+
r,
|
|
871
887
|
void 0,
|
|
872
888
|
t?.reducedMotion
|
|
873
889
|
);
|
|
874
|
-
c instanceof
|
|
890
|
+
c instanceof G && n.push(c);
|
|
875
891
|
}
|
|
876
892
|
}
|
|
877
893
|
return n;
|
|
878
894
|
}
|
|
879
895
|
function Bt(e, t, n) {
|
|
880
896
|
const s = Ve(t, n);
|
|
881
|
-
return new
|
|
897
|
+
return new Mt(s, e);
|
|
882
898
|
}
|
|
883
899
|
function Q(e, t) {
|
|
884
900
|
return t.includes("&") ? t.replace(/&/g, e) : `${e}${t}`;
|
|
885
901
|
}
|
|
886
|
-
function
|
|
902
|
+
function _() {
|
|
887
903
|
return "wi-12343210".replace(
|
|
888
904
|
/\d/g,
|
|
889
905
|
(e) => String.fromCharCode(
|
|
@@ -897,8 +913,8 @@ function Kt({
|
|
|
897
913
|
effectId: t,
|
|
898
914
|
transition: n,
|
|
899
915
|
properties: s,
|
|
900
|
-
childSelector:
|
|
901
|
-
selectorCondition:
|
|
916
|
+
childSelector: r = "> :first-child",
|
|
917
|
+
selectorCondition: i
|
|
902
918
|
}) {
|
|
903
919
|
let o = [];
|
|
904
920
|
if (n?.styleProperties) {
|
|
@@ -917,7 +933,7 @@ function Kt({
|
|
|
917
933
|
o = s?.filter((d) => d.duration).map(
|
|
918
934
|
(d) => `${d.name} ${d.duration}ms ${B(d.easing) || "ease"}${d.delay ? ` ${d.delay}ms` : ""}`
|
|
919
935
|
) || [];
|
|
920
|
-
const c = s?.map((d) => `${d.name}: ${d.value};`) || [], u = e.replace(/"/g, "'"), f = `:is(:state(${t}), :--${t}) ${
|
|
936
|
+
const c = s?.map((d) => `${d.name}: ${d.value};`) || [], u = e.replace(/"/g, "'"), f = `:is(:state(${t}), :--${t}) ${r}`, a = `[data-interact-effect~="${t}"] ${r}`, l = i ? Q(f, i) : f, m = i ? Q(a, i) : a, g = [
|
|
921
937
|
`${l},
|
|
922
938
|
${m} {
|
|
923
939
|
${c.join(`
|
|
@@ -925,49 +941,49 @@ function Kt({
|
|
|
925
941
|
}`
|
|
926
942
|
];
|
|
927
943
|
if (o.length) {
|
|
928
|
-
const d = `[data-interact-key="${u}"] ${
|
|
944
|
+
const d = `[data-interact-key="${u}"] ${r}`, h = i ? Q(d, i) : d;
|
|
929
945
|
g.push(`@media (prefers-reduced-motion: no-preference) { ${h} {
|
|
930
946
|
transition: ${o.join(", ")};
|
|
931
947
|
} }`);
|
|
932
948
|
}
|
|
933
949
|
return g;
|
|
934
950
|
}
|
|
935
|
-
function
|
|
936
|
-
const n = (e || []).filter((
|
|
951
|
+
function k(e, t) {
|
|
952
|
+
const n = (e || []).filter((i) => t[i]?.type === "media" && t[i].predicate).map((i) => t[i].predicate).join(") and ("), s = n && `(${n})`;
|
|
937
953
|
return s && window.matchMedia(s);
|
|
938
954
|
}
|
|
939
|
-
function
|
|
955
|
+
function L(e, t) {
|
|
940
956
|
for (const n of e || []) {
|
|
941
957
|
const s = t[n];
|
|
942
958
|
if (s?.type === "selector" && s.predicate)
|
|
943
959
|
return s.predicate;
|
|
944
960
|
}
|
|
945
961
|
}
|
|
946
|
-
const
|
|
962
|
+
const D = {
|
|
947
963
|
rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
|
|
948
964
|
rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
|
|
949
965
|
};
|
|
950
966
|
function Qt(e, t) {
|
|
951
|
-
const n = e?.name ??
|
|
967
|
+
const n = e?.name ?? D.rangeStart.name, s = t?.name ?? e?.name ?? D.rangeEnd.name, r = {
|
|
952
968
|
name: n,
|
|
953
|
-
offset: e?.offset ||
|
|
954
|
-
},
|
|
969
|
+
offset: e?.offset || D.rangeStart.offset
|
|
970
|
+
}, i = {
|
|
955
971
|
name: s,
|
|
956
|
-
offset: t?.offset ||
|
|
972
|
+
offset: t?.offset || D.rangeEnd.offset
|
|
957
973
|
};
|
|
958
|
-
return { startOffset:
|
|
974
|
+
return { startOffset: r, endOffset: i };
|
|
959
975
|
}
|
|
960
|
-
function
|
|
976
|
+
function P(e) {
|
|
961
977
|
if ("keyframeEffect" in e && !e.keyframeEffect.name && "effectId" in e && (e.keyframeEffect.name = e.effectId), "duration" in e)
|
|
962
978
|
return {
|
|
963
979
|
id: "",
|
|
964
980
|
...e
|
|
965
981
|
};
|
|
966
|
-
const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset:
|
|
982
|
+
const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: r, endOffset: i } = Qt(t, n);
|
|
967
983
|
return {
|
|
968
984
|
id: "",
|
|
969
|
-
startOffset:
|
|
970
|
-
endOffset:
|
|
985
|
+
startOffset: r,
|
|
986
|
+
endOffset: i,
|
|
971
987
|
...s
|
|
972
988
|
};
|
|
973
989
|
}
|
|
@@ -975,11 +991,11 @@ function O(e, t, n) {
|
|
|
975
991
|
let s = e.get(t);
|
|
976
992
|
s || (s = /* @__PURE__ */ new Set(), e.set(t, s)), s.add(n);
|
|
977
993
|
}
|
|
978
|
-
function
|
|
994
|
+
function N(e, t) {
|
|
979
995
|
e.get(t)?.forEach((s) => {
|
|
980
|
-
const { source:
|
|
996
|
+
const { source: r, target: i, cleanup: o } = s;
|
|
981
997
|
o();
|
|
982
|
-
const c =
|
|
998
|
+
const c = r === t ? i : r;
|
|
983
999
|
e.get(c)?.delete(s);
|
|
984
1000
|
}), e.delete(t);
|
|
985
1001
|
}
|
|
@@ -992,20 +1008,20 @@ const Xt = {
|
|
|
992
1008
|
rootMargin: "0px",
|
|
993
1009
|
threshold: [0]
|
|
994
1010
|
}, z = {}, ee = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakSet(), U = /* @__PURE__ */ new WeakMap();
|
|
995
|
-
let
|
|
1011
|
+
let We = {}, F = null;
|
|
996
1012
|
function Jt(e) {
|
|
997
|
-
|
|
1013
|
+
We = e;
|
|
998
1014
|
}
|
|
999
|
-
function
|
|
1000
|
-
ee.get(e)?.forEach(({ source: s, handler:
|
|
1001
|
-
s === e &&
|
|
1015
|
+
function je(e, t) {
|
|
1016
|
+
ee.get(e)?.forEach(({ source: s, handler: r }) => {
|
|
1017
|
+
s === e && r(t);
|
|
1002
1018
|
});
|
|
1003
1019
|
}
|
|
1004
1020
|
function Ce() {
|
|
1005
1021
|
return F || (F = new IntersectionObserver((e) => {
|
|
1006
1022
|
e.forEach((t) => {
|
|
1007
1023
|
const n = t.target;
|
|
1008
|
-
t.isIntersecting ||
|
|
1024
|
+
t.isIntersecting || je(n, !1);
|
|
1009
1025
|
});
|
|
1010
1026
|
}, Ut), F);
|
|
1011
1027
|
}
|
|
@@ -1017,17 +1033,17 @@ function Ye(e, t = !1) {
|
|
|
1017
1033
|
root: null,
|
|
1018
1034
|
rootMargin: e.inset ? `${e.inset} 0px ${e.inset}` : "0px",
|
|
1019
1035
|
threshold: e.threshold
|
|
1020
|
-
},
|
|
1021
|
-
|
|
1036
|
+
}, r = new IntersectionObserver((i) => {
|
|
1037
|
+
i.forEach((o) => {
|
|
1022
1038
|
const c = o.target, u = !X.has(c);
|
|
1023
1039
|
if (u && (X.add(c), e.useSafeViewEnter && !o.isIntersecting)) {
|
|
1024
|
-
|
|
1040
|
+
T.measure(() => {
|
|
1025
1041
|
const a = o.boundingClientRect.height, l = o.rootBounds?.height;
|
|
1026
1042
|
if (!l)
|
|
1027
1043
|
return;
|
|
1028
1044
|
const m = Array.isArray(e.threshold) ? Math.min(...e.threshold) : e.threshold;
|
|
1029
|
-
m && a * m > l &&
|
|
1030
|
-
|
|
1045
|
+
m && a * m > l && T.mutate(() => {
|
|
1046
|
+
r.unobserve(c);
|
|
1031
1047
|
const d = Ye(e, !0);
|
|
1032
1048
|
U.set(c, d), d.observe(c);
|
|
1033
1049
|
});
|
|
@@ -1035,17 +1051,17 @@ function Ye(e, t = !1) {
|
|
|
1035
1051
|
return;
|
|
1036
1052
|
}
|
|
1037
1053
|
const f = e.type || "once";
|
|
1038
|
-
(o.isIntersecting || f === "alternate" && !u) && (
|
|
1054
|
+
(o.isIntersecting || f === "alternate" && !u) && (je(c, o.isIntersecting), f === "once" && (r.unobserve(o.target), X.delete(c)));
|
|
1039
1055
|
});
|
|
1040
1056
|
}, s);
|
|
1041
|
-
return z[n] =
|
|
1057
|
+
return z[n] = r, r;
|
|
1042
1058
|
}
|
|
1043
|
-
function Zt(e, t, n, s = {}, { reducedMotion:
|
|
1044
|
-
const c = { ...
|
|
1059
|
+
function Zt(e, t, n, s = {}, { reducedMotion: r, selectorCondition: i, animation: o } = {}) {
|
|
1060
|
+
const c = { ...We, ...s }, u = c.type || "once", f = o || ne(
|
|
1045
1061
|
t,
|
|
1046
|
-
|
|
1062
|
+
P(n),
|
|
1047
1063
|
void 0,
|
|
1048
|
-
|
|
1064
|
+
r
|
|
1049
1065
|
);
|
|
1050
1066
|
if (!f)
|
|
1051
1067
|
return;
|
|
@@ -1053,17 +1069,17 @@ function Zt(e, t, n, s = {}, { reducedMotion: i, selectorCondition: r, animation
|
|
|
1053
1069
|
u !== "once" && f.persist?.();
|
|
1054
1070
|
let l = !0;
|
|
1055
1071
|
const d = { source: e, target: t, handler: (h) => {
|
|
1056
|
-
|
|
1072
|
+
i && !t.matches(i) || (u === "once" ? h && f.play(() => {
|
|
1057
1073
|
const p = () => {
|
|
1058
1074
|
t.dataset.interactEnter = "start";
|
|
1059
1075
|
};
|
|
1060
|
-
f.isCSS ? (
|
|
1076
|
+
f.isCSS ? (T.mutate(() => {
|
|
1061
1077
|
requestAnimationFrame(p);
|
|
1062
1078
|
}), f.onFinish(() => {
|
|
1063
|
-
|
|
1079
|
+
T.mutate(() => {
|
|
1064
1080
|
t.dataset.interactEnter = "done";
|
|
1065
1081
|
});
|
|
1066
|
-
})) :
|
|
1082
|
+
})) : T.mutate(p);
|
|
1067
1083
|
}) : u === "alternate" ? l && h ? (l = !1, f.play()) : l || f.reverse() : u === "repeat" ? h ? (f.progress(0), f.play()) : (f.pause(), f.progress(0)) : u === "state" && (h ? f.play() : f.pause()));
|
|
1068
1084
|
}, cleanup: () => {
|
|
1069
1085
|
(U.get(e) || a).unobserve(e), (u === "repeat" || u === "state") && Ce().unobserve(e), f.cancel(), X.delete(e), U.delete(e);
|
|
@@ -1071,12 +1087,12 @@ function Zt(e, t, n, s = {}, { reducedMotion: i, selectorCondition: r, animation
|
|
|
1071
1087
|
O(ee, e, d), O(ee, t, d), U.set(e, a), a.observe(e), (u === "repeat" || u === "state") && Ce().observe(e);
|
|
1072
1088
|
}
|
|
1073
1089
|
function en(e) {
|
|
1074
|
-
|
|
1090
|
+
N(ee, e);
|
|
1075
1091
|
}
|
|
1076
1092
|
function tn() {
|
|
1077
1093
|
F = null, Object.keys(z).forEach((e) => delete z[e]);
|
|
1078
1094
|
}
|
|
1079
|
-
const
|
|
1095
|
+
const ke = {
|
|
1080
1096
|
add: Zt,
|
|
1081
1097
|
remove: en,
|
|
1082
1098
|
setOptions: Jt,
|
|
@@ -1086,15 +1102,15 @@ function Be(e, t) {
|
|
|
1086
1102
|
return Object.assign(Object.create(t), e);
|
|
1087
1103
|
}
|
|
1088
1104
|
function nn(e, t, n, s) {
|
|
1089
|
-
let
|
|
1105
|
+
let r = e * (1 - n) + t * n;
|
|
1090
1106
|
if (s) {
|
|
1091
|
-
const
|
|
1092
|
-
Math.abs(
|
|
1093
|
-
const o = t -
|
|
1107
|
+
const i = r - e;
|
|
1108
|
+
Math.abs(i) < s && (r = e + s * Math.sign(i));
|
|
1109
|
+
const o = t - r;
|
|
1094
1110
|
if (Math.abs(o) < s)
|
|
1095
1111
|
return t;
|
|
1096
1112
|
}
|
|
1097
|
-
return
|
|
1113
|
+
return r;
|
|
1098
1114
|
}
|
|
1099
1115
|
function sn(e) {
|
|
1100
1116
|
let t = !1;
|
|
@@ -1104,7 +1120,7 @@ function sn(e) {
|
|
|
1104
1120
|
}));
|
|
1105
1121
|
};
|
|
1106
1122
|
}
|
|
1107
|
-
function
|
|
1123
|
+
function qe(e, t) {
|
|
1108
1124
|
let n = 0;
|
|
1109
1125
|
return function() {
|
|
1110
1126
|
n && window.clearTimeout(n), n = window.setTimeout(() => {
|
|
@@ -1120,30 +1136,30 @@ function te(e, t) {
|
|
|
1120
1136
|
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) ? rn(e, t) : parseInt(e) || 0 : 0;
|
|
1121
1137
|
}
|
|
1122
1138
|
function A(e, t, n) {
|
|
1123
|
-
const { name: s, offset:
|
|
1139
|
+
const { name: s, offset: r = 0 } = e, { start: i, end: o } = n, c = o - i, u = r / 100;
|
|
1124
1140
|
let f, a;
|
|
1125
|
-
return s === "entry" ? (f =
|
|
1141
|
+
return s === "entry" ? (f = i - t, a = Math.min(t, c)) : s === "entry-crossing" ? (f = i - t, a = c) : s === "contain" ? (f = Math.min(o - t, i), a = Math.abs(t - c)) : s === "exit" ? (f = Math.max(i, o - t), a = Math.min(t, c)) : s === "exit-crossing" ? (f = i, a = c) : s === "cover" && (f = i - t, a = c + t), f + u * a | 0;
|
|
1126
1142
|
}
|
|
1127
|
-
function oe(e, t, n, s,
|
|
1128
|
-
let
|
|
1143
|
+
function oe(e, t, n, s, r) {
|
|
1144
|
+
let i = 0;
|
|
1129
1145
|
const o = { start: t, end: n };
|
|
1130
1146
|
return e.forEach((c, u) => {
|
|
1131
|
-
|
|
1147
|
+
i += c.offset;
|
|
1132
1148
|
const f = c.sticky;
|
|
1133
1149
|
if (f) {
|
|
1134
1150
|
if ("end" in f && e[u - 1]?.element) {
|
|
1135
|
-
const m = ((
|
|
1151
|
+
const m = ((r ? c.element.offsetWidth : c.element.offsetHeight) || 0) + f.end - s, g = i + m - c.offset, d = g < o.start, h = !d && g <= n;
|
|
1136
1152
|
let p = 0;
|
|
1137
1153
|
(d || h) && (p = c.offset, o.end += p), d && (o.start += p);
|
|
1138
1154
|
}
|
|
1139
1155
|
if ("start" in f) {
|
|
1140
|
-
const a =
|
|
1156
|
+
const a = i - f.start, l = a < o.start, m = !l && a <= o.end;
|
|
1141
1157
|
let g = 0;
|
|
1142
1158
|
const d = e[u - 1]?.element;
|
|
1143
1159
|
if (d) {
|
|
1144
1160
|
if (l || m) {
|
|
1145
|
-
const h = (
|
|
1146
|
-
g = h - (p + y),
|
|
1161
|
+
const h = (r ? d.offsetWidth : d.offsetHeight) || 0, p = c.offset, y = (r ? c.element.offsetWidth : c.element.offsetHeight) || 0;
|
|
1162
|
+
g = h - (p + y), i += g, o.end += g;
|
|
1147
1163
|
}
|
|
1148
1164
|
l && (o.start += g);
|
|
1149
1165
|
}
|
|
@@ -1151,22 +1167,22 @@ function oe(e, t, n, s, i) {
|
|
|
1151
1167
|
}
|
|
1152
1168
|
}), o;
|
|
1153
1169
|
}
|
|
1154
|
-
function on(e, t, n, s,
|
|
1170
|
+
function on(e, t, n, s, r, i) {
|
|
1155
1171
|
const { start: o, end: c, duration: u } = e;
|
|
1156
1172
|
let f = o, a = c, l = e.startRange, m = e.endRange, g;
|
|
1157
1173
|
if (typeof u == "string") {
|
|
1158
1174
|
l = { name: u, offset: 0 }, m = { name: u, offset: 100 }, f = A(l, n, t), a = A(m, n, t), g = a - f;
|
|
1159
|
-
const d = oe(
|
|
1175
|
+
const d = oe(i, f, a, n, s);
|
|
1160
1176
|
f = d.start, a = d.end;
|
|
1161
1177
|
} else {
|
|
1162
1178
|
if (l || o?.name) {
|
|
1163
1179
|
l = l || o;
|
|
1164
|
-
const d = te(l.add,
|
|
1180
|
+
const d = te(l.add, r), h = A({ ...l, offset: 0 }, n, t), p = A({ ...l, offset: 100 }, n, t), y = oe(i, h, p, n, s);
|
|
1165
1181
|
f = y.start + l.offset / 100 * (y.end - y.start) + d;
|
|
1166
1182
|
}
|
|
1167
1183
|
if (m || c?.name) {
|
|
1168
1184
|
m = m || c;
|
|
1169
|
-
const d = te(m.add,
|
|
1185
|
+
const d = te(m.add, r), h = A({ ...m, offset: 0 }, n, t), p = A({ ...m, offset: 100 }, n, t), y = oe(i, h, p, n, s);
|
|
1170
1186
|
a = y.start + m.offset / 100 * (y.end - y.start) + d;
|
|
1171
1187
|
} else typeof u == "number" && (a = f + u);
|
|
1172
1188
|
}
|
|
@@ -1191,12 +1207,12 @@ function un(e, t, n) {
|
|
|
1191
1207
|
}
|
|
1192
1208
|
function dn(e, t) {
|
|
1193
1209
|
let n;
|
|
1194
|
-
const s = fn(e, t),
|
|
1195
|
-
return (
|
|
1210
|
+
const s = fn(e, t), r = ln(e, t), i = !isNaN(s), o = !isNaN(r);
|
|
1211
|
+
return (i || o) && (n = {}, i && (n.start = s), o && (n.end = r)), n;
|
|
1196
1212
|
}
|
|
1197
|
-
function V(e, t, n, s,
|
|
1198
|
-
const
|
|
1199
|
-
let c = (s ?
|
|
1213
|
+
function V(e, t, n, s, r) {
|
|
1214
|
+
const i = e[0].viewSource, o = [];
|
|
1215
|
+
let c = (s ? i.offsetWidth : i.offsetHeight) || 0, u = 0, f = i;
|
|
1200
1216
|
for (; f; ) {
|
|
1201
1217
|
const l = window.getComputedStyle(f), m = cn(l), g = m ? dn(l, s) : void 0, d = un(f, s, m);
|
|
1202
1218
|
if ((!g || !("end" in g)) && (u += d), o.push({ element: f, offset: d, sticky: g }), f = f.offsetParent, an(l, f, t))
|
|
@@ -1212,7 +1228,7 @@ function V(e, t, n, s, i) {
|
|
|
1212
1228
|
{ start: u, end: u + c },
|
|
1213
1229
|
n,
|
|
1214
1230
|
s,
|
|
1215
|
-
|
|
1231
|
+
r,
|
|
1216
1232
|
o
|
|
1217
1233
|
)
|
|
1218
1234
|
}));
|
|
@@ -1226,10 +1242,10 @@ const Ae = 100, hn = {
|
|
|
1226
1242
|
observeContentResize: !1
|
|
1227
1243
|
};
|
|
1228
1244
|
function mn(e, t, n, s) {
|
|
1229
|
-
let
|
|
1230
|
-
return e >= t && e <= n ?
|
|
1245
|
+
let r = 0;
|
|
1246
|
+
return e >= t && e <= n ? r = s ? (e - t) / s : 1 : e > n && (r = 1), r;
|
|
1231
1247
|
}
|
|
1232
|
-
function
|
|
1248
|
+
function _e(e, t) {
|
|
1233
1249
|
return e === window ? t ? window.document.documentElement.clientWidth : window.document.documentElement.clientHeight : t ? e.clientWidth : e.clientHeight;
|
|
1234
1250
|
}
|
|
1235
1251
|
function pn() {
|
|
@@ -1239,8 +1255,8 @@ function pn() {
|
|
|
1239
1255
|
};
|
|
1240
1256
|
}
|
|
1241
1257
|
function gn(e) {
|
|
1242
|
-
const t = Be(e, hn), n = t.root, s = t.horizontal,
|
|
1243
|
-
let
|
|
1258
|
+
const t = Be(e, hn), n = t.root, s = t.horizontal, r = /* @__PURE__ */ new WeakMap();
|
|
1259
|
+
let i = _e(n, s), o, c, u, f, a;
|
|
1244
1260
|
const l = [], m = pn();
|
|
1245
1261
|
if (t.scenes = Object.values(
|
|
1246
1262
|
// TODO(ameerf): find a polyfill and use groupBy instead of following reduce
|
|
@@ -1251,7 +1267,7 @@ function gn(e) {
|
|
|
1251
1267
|
},
|
|
1252
1268
|
{}
|
|
1253
1269
|
)
|
|
1254
|
-
).flatMap((h) => (h.every((p) => p.viewSource && (typeof p.duration == "string" || p.start?.name)) ? (h = V(h, n,
|
|
1270
|
+
).flatMap((h) => (h.every((p) => p.viewSource && (typeof p.duration == "string" || p.start?.name)) ? (h = V(h, n, i, s, m), (t.observeSourcesResize || t.observeContentResize) && l.push(h)) : h.forEach((p) => {
|
|
1255
1271
|
p.end == null && (p.end = p.start + p.duration), p.duration == null && (p.duration = p.end - p.start);
|
|
1256
1272
|
}), h)), t.scenes.forEach((h, p) => {
|
|
1257
1273
|
h.index = p;
|
|
@@ -1259,29 +1275,29 @@ function gn(e) {
|
|
|
1259
1275
|
const h = /* @__PURE__ */ new Map();
|
|
1260
1276
|
window.ResizeObserver && (u = new window.ResizeObserver(function(p) {
|
|
1261
1277
|
p.forEach((y) => {
|
|
1262
|
-
const v = h.get(y.target),
|
|
1263
|
-
|
|
1264
|
-
t.scenes[b.index] =
|
|
1265
|
-
}), l.splice(l.indexOf(v), 1,
|
|
1278
|
+
const v = h.get(y.target), w = V(v, n, i, s, m);
|
|
1279
|
+
w.forEach((b, S) => {
|
|
1280
|
+
t.scenes[b.index] = w[S];
|
|
1281
|
+
}), l.splice(l.indexOf(v), 1, w);
|
|
1266
1282
|
});
|
|
1267
1283
|
}), l.forEach((p) => {
|
|
1268
1284
|
u.observe(p[0].viewSource, { box: "border-box" }), h.set(p[0].viewSource, p);
|
|
1269
|
-
}), t.observeContentResize && t.contentRoot && new window.ResizeObserver(
|
|
1285
|
+
}), t.observeContentResize && t.contentRoot && new window.ResizeObserver(qe(() => {
|
|
1270
1286
|
const y = l.map((v) => {
|
|
1271
|
-
const
|
|
1272
|
-
return
|
|
1273
|
-
t.scenes[b.index] =
|
|
1274
|
-
}),
|
|
1287
|
+
const w = V(v, n, i, s, m);
|
|
1288
|
+
return w.forEach((b, S) => {
|
|
1289
|
+
t.scenes[b.index] = w[S];
|
|
1290
|
+
}), w;
|
|
1275
1291
|
});
|
|
1276
1292
|
l.length = 0, l.push(...y), l.forEach((v) => {
|
|
1277
1293
|
h.set(v[0].viewSource, v);
|
|
1278
1294
|
});
|
|
1279
|
-
}, Ae)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (f =
|
|
1280
|
-
|
|
1295
|
+
}, Ae)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (f = qe(function() {
|
|
1296
|
+
i = _e(n, s);
|
|
1281
1297
|
const p = l.map((y) => {
|
|
1282
|
-
const v = V(y, n,
|
|
1283
|
-
return v.forEach((
|
|
1284
|
-
t.scenes[
|
|
1298
|
+
const v = V(y, n, i, s, m);
|
|
1299
|
+
return v.forEach((w, b) => {
|
|
1300
|
+
t.scenes[w.index] = v[b];
|
|
1285
1301
|
}), v;
|
|
1286
1302
|
});
|
|
1287
1303
|
l.length = 0, l.push(...p), l.forEach((y) => {
|
|
@@ -1291,7 +1307,7 @@ function gn(e) {
|
|
|
1291
1307
|
}
|
|
1292
1308
|
t.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(h) {
|
|
1293
1309
|
h.forEach((p) => {
|
|
1294
|
-
(
|
|
1310
|
+
(r.get(p.target) || []).forEach((y) => {
|
|
1295
1311
|
y.disabled = !p.isIntersecting;
|
|
1296
1312
|
});
|
|
1297
1313
|
});
|
|
@@ -1301,8 +1317,8 @@ function gn(e) {
|
|
|
1301
1317
|
threshold: 0
|
|
1302
1318
|
}), t.scenes.forEach((h) => {
|
|
1303
1319
|
if (h.viewSource) {
|
|
1304
|
-
let p =
|
|
1305
|
-
p || (p = [],
|
|
1320
|
+
let p = r.get(h.viewSource);
|
|
1321
|
+
p || (p = [], r.set(h.viewSource, p), c.observe(h.viewSource)), p.push(h);
|
|
1306
1322
|
}
|
|
1307
1323
|
}));
|
|
1308
1324
|
function g({ p: h, vp: p }) {
|
|
@@ -1311,8 +1327,8 @@ function gn(e) {
|
|
|
1311
1327
|
if (h !== o) {
|
|
1312
1328
|
for (let v of t.scenes)
|
|
1313
1329
|
if (!v.disabled) {
|
|
1314
|
-
const { start:
|
|
1315
|
-
v.effect(v,
|
|
1330
|
+
const { start: w, end: b, duration: S } = v, I = mn(h, w, b, S);
|
|
1331
|
+
v.effect(v, I, y);
|
|
1316
1332
|
}
|
|
1317
1333
|
o = h;
|
|
1318
1334
|
}
|
|
@@ -1371,8 +1387,8 @@ class yn {
|
|
|
1371
1387
|
* @param {number} [scrollPosition.y]
|
|
1372
1388
|
*/
|
|
1373
1389
|
resetProgress(t = {}) {
|
|
1374
|
-
const n = this.config.root, s = t.x || t.x === 0 ? t.x : n.scrollX || n.scrollLeft || 0,
|
|
1375
|
-
this.progress.p =
|
|
1390
|
+
const n = this.config.root, s = t.x || t.x === 0 ? t.x : n.scrollX || n.scrollLeft || 0, r = t.y || t.y === 0 ? t.y : n.scrollY || n.scrollTop || 0, i = this.config.horizontal ? s : r;
|
|
1391
|
+
this.progress.p = i, this.progress.prevP = i, this.progress.vp = 0, this.config.transitionActive && (this.currentProgress.p = i, this.currentProgress.prevP = i, this.currentProgress.vp = 0), t && this.config.root.scrollTo(s, r);
|
|
1376
1392
|
}
|
|
1377
1393
|
/**
|
|
1378
1394
|
* Handle animation frame work.
|
|
@@ -1384,8 +1400,8 @@ class yn {
|
|
|
1384
1400
|
n && this.lerp();
|
|
1385
1401
|
const s = n ? this.currentProgress : this.progress;
|
|
1386
1402
|
if (this.config.velocityActive) {
|
|
1387
|
-
const
|
|
1388
|
-
s.vp = Math.min(this.config.velocityMax, Math.abs(
|
|
1403
|
+
const r = s.p - s.prevP, i = r < 0 ? -1 : 1;
|
|
1404
|
+
s.vp = Math.min(this.config.velocityMax, Math.abs(r)) / this.config.velocityMax * i;
|
|
1389
1405
|
}
|
|
1390
1406
|
this.effect.tick(s), n && s.p !== this.progress.p && (t && this._lerpFrameId && window.cancelAnimationFrame(this._lerpFrameId), this._lerpFrameId = window.requestAnimationFrame(() => this.tick())), s.prevP = s.p;
|
|
1391
1407
|
}
|
|
@@ -1431,23 +1447,23 @@ let Ke = () => ({});
|
|
|
1431
1447
|
function En(e) {
|
|
1432
1448
|
Ke = e;
|
|
1433
1449
|
}
|
|
1434
|
-
function wn(e, t, n, s, { reducedMotion:
|
|
1435
|
-
if (
|
|
1450
|
+
function wn(e, t, n, s, { reducedMotion: r }) {
|
|
1451
|
+
if (r)
|
|
1436
1452
|
return;
|
|
1437
|
-
const
|
|
1453
|
+
const i = {
|
|
1438
1454
|
trigger: "view-progress",
|
|
1439
1455
|
element: e
|
|
1440
|
-
}, o =
|
|
1456
|
+
}, o = P(n);
|
|
1441
1457
|
let c;
|
|
1442
1458
|
if ("ViewTimeline" in window) {
|
|
1443
|
-
const f = ve(t, o,
|
|
1459
|
+
const f = ve(t, o, i);
|
|
1444
1460
|
f && (f.play(), c = () => {
|
|
1445
1461
|
f.ready.then(() => {
|
|
1446
1462
|
f.cancel();
|
|
1447
1463
|
});
|
|
1448
1464
|
});
|
|
1449
1465
|
} else {
|
|
1450
|
-
const f =
|
|
1466
|
+
const f = De(t, o, i);
|
|
1451
1467
|
if (f) {
|
|
1452
1468
|
const a = Array.isArray(f) ? f : [f], l = new yn({
|
|
1453
1469
|
viewSource: e,
|
|
@@ -1472,17 +1488,17 @@ function wn(e, t, n, s, { reducedMotion: i }) {
|
|
|
1472
1488
|
O(le, e, u), O(le, t, u);
|
|
1473
1489
|
}
|
|
1474
1490
|
function bn(e) {
|
|
1475
|
-
|
|
1491
|
+
N(le, e);
|
|
1476
1492
|
}
|
|
1477
1493
|
const Sn = {
|
|
1478
1494
|
add: wn,
|
|
1479
1495
|
remove: bn,
|
|
1480
1496
|
registerOptionsGetter: En
|
|
1481
1497
|
};
|
|
1482
|
-
function
|
|
1498
|
+
function xe(e, t, n) {
|
|
1483
1499
|
return Math.min(Math.max(e, n), t);
|
|
1484
1500
|
}
|
|
1485
|
-
function
|
|
1501
|
+
function Me(e) {
|
|
1486
1502
|
let t = !1;
|
|
1487
1503
|
return function() {
|
|
1488
1504
|
if (!t)
|
|
@@ -1521,7 +1537,7 @@ function On() {
|
|
|
1521
1537
|
return new Promise((e) => {
|
|
1522
1538
|
const t = window.scrollY;
|
|
1523
1539
|
let n = !1, s;
|
|
1524
|
-
function
|
|
1540
|
+
function r() {
|
|
1525
1541
|
document.body.addEventListener("pointerdown", (c) => {
|
|
1526
1542
|
s === void 0 ? s = c.offsetY : n = c.offsetY === s;
|
|
1527
1543
|
}, { once: !0 });
|
|
@@ -1530,10 +1546,10 @@ function On() {
|
|
|
1530
1546
|
});
|
|
1531
1547
|
document.body.dispatchEvent(o);
|
|
1532
1548
|
}
|
|
1533
|
-
function
|
|
1534
|
-
window.scrollY !== t && (window.removeEventListener("scroll",
|
|
1549
|
+
function i() {
|
|
1550
|
+
window.scrollY !== t && (window.removeEventListener("scroll", i), r(), e(n));
|
|
1535
1551
|
}
|
|
1536
|
-
|
|
1552
|
+
r(), window.addEventListener("scroll", i), window.scrollY > 0 && window.scrollBy(0, -1);
|
|
1537
1553
|
});
|
|
1538
1554
|
}
|
|
1539
1555
|
function Cn(e) {
|
|
@@ -1541,9 +1557,9 @@ function Cn(e) {
|
|
|
1541
1557
|
e.fixRequired = t, t && (window.addEventListener("scroll", e.scrollHandler), e.scrollHandler());
|
|
1542
1558
|
});
|
|
1543
1559
|
}
|
|
1544
|
-
let
|
|
1560
|
+
let W = 0;
|
|
1545
1561
|
const J = /* @__PURE__ */ new Set();
|
|
1546
|
-
function
|
|
1562
|
+
function kn() {
|
|
1547
1563
|
const e = (n) => {
|
|
1548
1564
|
for (let s of n.changedTouches)
|
|
1549
1565
|
J.add(s.identifier);
|
|
@@ -1555,41 +1571,41 @@ function _n() {
|
|
|
1555
1571
|
J.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
|
|
1556
1572
|
};
|
|
1557
1573
|
}
|
|
1558
|
-
function
|
|
1574
|
+
function qn(e, t) {
|
|
1559
1575
|
if ("onscrollend" in window)
|
|
1560
1576
|
return e.addEventListener("scrollend", t), function() {
|
|
1561
1577
|
e.removeEventListener("scrollend", t);
|
|
1562
1578
|
};
|
|
1563
1579
|
let n = 0, s;
|
|
1564
|
-
|
|
1565
|
-
function i
|
|
1580
|
+
W || (s = kn()), W += 1;
|
|
1581
|
+
function r(i) {
|
|
1566
1582
|
clearTimeout(n), n = setTimeout(() => {
|
|
1567
|
-
J.size ? setTimeout(
|
|
1583
|
+
J.size ? setTimeout(r, 100) : (t(i), n = 0);
|
|
1568
1584
|
}, 100);
|
|
1569
1585
|
}
|
|
1570
|
-
return e.addEventListener("scroll",
|
|
1571
|
-
e.removeEventListener("scroll",
|
|
1586
|
+
return e.addEventListener("scroll", r), function() {
|
|
1587
|
+
e.removeEventListener("scroll", r), W -= 1, W || s();
|
|
1572
1588
|
};
|
|
1573
1589
|
}
|
|
1574
1590
|
function An(e, t, n) {
|
|
1575
1591
|
return {
|
|
1576
1592
|
x(s) {
|
|
1577
|
-
const
|
|
1593
|
+
const r = e.left - n.x + e.width / 2, i = r >= t.width / 2, o = (i ? r : t.width - r) * 2, c = i ? 0 : r - o / 2;
|
|
1578
1594
|
return (s - c) / o;
|
|
1579
1595
|
},
|
|
1580
1596
|
y(s) {
|
|
1581
|
-
const
|
|
1597
|
+
const r = e.top - n.y + e.height / 2, i = r >= t.height / 2, o = (i ? r : t.height - r) * 2, c = i ? 0 : r - o / 2;
|
|
1582
1598
|
return (s - c) / o;
|
|
1583
1599
|
}
|
|
1584
1600
|
};
|
|
1585
1601
|
}
|
|
1586
|
-
function
|
|
1602
|
+
function _n(e, t) {
|
|
1587
1603
|
this.x = window.scrollX, this.y = window.scrollY, requestAnimationFrame(() => e && e(t));
|
|
1588
1604
|
}
|
|
1589
|
-
function
|
|
1605
|
+
function xn(e) {
|
|
1590
1606
|
e.rect.width = window.document.documentElement.clientWidth, e.rect.height = window.document.documentElement.clientHeight;
|
|
1591
1607
|
}
|
|
1592
|
-
function
|
|
1608
|
+
function Mn(e) {
|
|
1593
1609
|
const t = new ResizeObserver((n) => {
|
|
1594
1610
|
n.forEach((s) => {
|
|
1595
1611
|
e.rect.width = s.borderBoxSize[0].inlineSize, e.rect.height = s.borderBoxSize[0].blockSize;
|
|
@@ -1597,38 +1613,38 @@ function Ln(e) {
|
|
|
1597
1613
|
});
|
|
1598
1614
|
return t.observe(e.root, { box: "border-box" }), t;
|
|
1599
1615
|
}
|
|
1600
|
-
function
|
|
1601
|
-
let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s,
|
|
1616
|
+
function Ln(e) {
|
|
1617
|
+
let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, r, i, o, c;
|
|
1602
1618
|
const u = { x: 0, y: 0 };
|
|
1603
1619
|
e.scenes.forEach((a) => {
|
|
1604
|
-
a.target && a.centeredToTarget && (a.transform = An(In(a.target), e.rect, u), t = !0), e.root ?
|
|
1620
|
+
a.target && a.centeredToTarget && (a.transform = An(In(a.target), e.rect, u), t = !0), e.root ? r = Mn(e) : (i = xn.bind(null, e), window.addEventListener("resize", i));
|
|
1605
1621
|
}), s = function(a) {
|
|
1606
1622
|
for (let l of e.scenes)
|
|
1607
1623
|
if (!l.disabled) {
|
|
1608
|
-
const m = l.transform?.x(a.x) || a.x / e.rect.width, g = l.transform?.y(a.y) || a.y / e.rect.height, d = +
|
|
1624
|
+
const m = l.transform?.x(a.x) || a.x / e.rect.width, g = l.transform?.y(a.y) || a.y / e.rect.height, d = +xe(0, 1, m).toPrecision(4), h = +xe(0, 1, g).toPrecision(4), p = { x: a.vx, y: a.vy };
|
|
1609
1625
|
e.allowActiveEvent && (a.active = m <= 1 && g <= 1 && m >= 0 && g >= 0), l.effect(l, { x: d, y: h }, p, a.active);
|
|
1610
1626
|
}
|
|
1611
1627
|
Object.assign(n, a);
|
|
1612
|
-
}, t && (o =
|
|
1628
|
+
}, t && (o = _n.bind(u, s, n), c = qn(document, o));
|
|
1613
1629
|
function f() {
|
|
1614
|
-
e.scenes.forEach((a) => a.destroy?.()), c?.(),
|
|
1630
|
+
e.scenes.forEach((a) => a.destroy?.()), c?.(), r ? (r.disconnect(), r = null) : (window.removeEventListener("resize", i), i = null), s = null, n = null;
|
|
1615
1631
|
}
|
|
1616
1632
|
return {
|
|
1617
1633
|
tick: s,
|
|
1618
1634
|
destroy: f
|
|
1619
1635
|
};
|
|
1620
1636
|
}
|
|
1621
|
-
const
|
|
1622
|
-
let
|
|
1623
|
-
function
|
|
1624
|
-
|
|
1637
|
+
const Pn = 1e3 / 60 * 3;
|
|
1638
|
+
let j;
|
|
1639
|
+
function $n() {
|
|
1640
|
+
x.x = window.scrollX, x.y = window.scrollY;
|
|
1625
1641
|
}
|
|
1626
|
-
const
|
|
1642
|
+
const x = { x: 0, y: 0, scrollHandler: $n, fixRequired: void 0 };
|
|
1627
1643
|
class Fn {
|
|
1628
1644
|
constructor(t = {}) {
|
|
1629
1645
|
this.config = { ...t }, this.effect = null, this._nextTick = null, this._nextTransitionTick = null, this._startTime = 0;
|
|
1630
1646
|
let n;
|
|
1631
|
-
this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() :
|
|
1647
|
+
this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : Me(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : Me(() => {
|
|
1632
1648
|
this.tick();
|
|
1633
1649
|
}), this.config.rect = this.config.root ? {
|
|
1634
1650
|
width: this.config.root.offsetWidth,
|
|
@@ -1642,28 +1658,28 @@ class Fn {
|
|
|
1642
1658
|
vx: 0,
|
|
1643
1659
|
vy: 0
|
|
1644
1660
|
}, this.previousProgress = { ...this.progress }, this.currentProgress = null;
|
|
1645
|
-
const s = (
|
|
1646
|
-
const
|
|
1647
|
-
this.progress.vx =
|
|
1661
|
+
const s = (r) => {
|
|
1662
|
+
const i = this.config.root ? r.offsetX : r.x, o = this.config.root ? r.offsetY : r.y;
|
|
1663
|
+
this.progress.vx = i - this.progress.x, this.progress.vy = o - this.progress.y, this.progress.x = i, this.progress.y = o, this._nextTick = n();
|
|
1648
1664
|
};
|
|
1649
1665
|
if (this._pointerLeave = () => {
|
|
1650
1666
|
this.progress.active = !1, this.progress.vx = 0, this.progress.vy = 0, this._nextTick = n();
|
|
1651
1667
|
}, this._pointerEnter = () => {
|
|
1652
1668
|
this.progress.active = !0, this._nextTick = n();
|
|
1653
1669
|
}, this.config.root) {
|
|
1654
|
-
|
|
1655
|
-
const
|
|
1656
|
-
typeof
|
|
1657
|
-
if (
|
|
1670
|
+
j = typeof j == "boolean" ? j : Tn();
|
|
1671
|
+
const r = j ? window.devicePixelRatio : 1;
|
|
1672
|
+
typeof x.fixRequired > "u" && Cn(x), this._measure = (i) => {
|
|
1673
|
+
if (i.target !== this.config.root) {
|
|
1658
1674
|
const o = new PointerEvent("pointermove", {
|
|
1659
1675
|
bubbles: !0,
|
|
1660
1676
|
cancelable: !0,
|
|
1661
|
-
clientX:
|
|
1662
|
-
clientY:
|
|
1677
|
+
clientX: i.x * r + x.x,
|
|
1678
|
+
clientY: i.y * r + x.y
|
|
1663
1679
|
});
|
|
1664
|
-
|
|
1680
|
+
i.stopPropagation(), this.config.root.dispatchEvent(o);
|
|
1665
1681
|
} else
|
|
1666
|
-
s(
|
|
1682
|
+
s(i);
|
|
1667
1683
|
};
|
|
1668
1684
|
} else
|
|
1669
1685
|
this._measure = s;
|
|
@@ -1693,12 +1709,12 @@ class Fn {
|
|
|
1693
1709
|
*/
|
|
1694
1710
|
transition() {
|
|
1695
1711
|
const t = this.config.transitionDuration, n = this.config.transitionEasing || ((o) => o), s = performance.now();
|
|
1696
|
-
let
|
|
1697
|
-
const
|
|
1712
|
+
let r = !1;
|
|
1713
|
+
const i = (o) => {
|
|
1698
1714
|
const c = (o - this._startTime) / t, u = n(Math.min(1, c));
|
|
1699
|
-
|
|
1715
|
+
r && (this.progress.vx = 0, this.progress.vy = 0, r = !1), this.currentProgress = Object.entries(this.progress).reduce((f, [a, l]) => (a === "active" ? f[a] = l : f[a] = this.previousProgress[a] + (l - this.previousProgress[a]) * u, f), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(i), r = o - this._startTime > Pn), this.effect.tick(this.currentProgress);
|
|
1700
1716
|
};
|
|
1701
|
-
return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s,
|
|
1717
|
+
return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, i(s)) : this._startTime = s, this._nextTransitionTick;
|
|
1702
1718
|
}
|
|
1703
1719
|
/**
|
|
1704
1720
|
* Stop the event and effect, and remove all DOM side effects.
|
|
@@ -1725,7 +1741,7 @@ class Fn {
|
|
|
1725
1741
|
* Reset registered effect.
|
|
1726
1742
|
*/
|
|
1727
1743
|
setupEffect() {
|
|
1728
|
-
this.removeEffect(), this.effect =
|
|
1744
|
+
this.removeEffect(), this.effect = Ln(this.config);
|
|
1729
1745
|
}
|
|
1730
1746
|
/**
|
|
1731
1747
|
* Remove registered effect.
|
|
@@ -1739,14 +1755,14 @@ let Qe = () => ({});
|
|
|
1739
1755
|
function Rn(e) {
|
|
1740
1756
|
Qe = e;
|
|
1741
1757
|
}
|
|
1742
|
-
function zn(e, t, n, s = {}, { reducedMotion:
|
|
1743
|
-
if (
|
|
1758
|
+
function zn(e, t, n, s = {}, { reducedMotion: r }) {
|
|
1759
|
+
if (r)
|
|
1744
1760
|
return;
|
|
1745
|
-
const
|
|
1761
|
+
const i = {
|
|
1746
1762
|
trigger: "pointer-move",
|
|
1747
1763
|
element: e,
|
|
1748
1764
|
axis: s.axis ?? "y"
|
|
1749
|
-
}, o =
|
|
1765
|
+
}, o = De(t, P(n), i);
|
|
1750
1766
|
if (o) {
|
|
1751
1767
|
const c = Array.isArray(o) ? o : [o], u = new Fn({
|
|
1752
1768
|
root: s.hitArea === "self" ? e : void 0,
|
|
@@ -1763,40 +1779,40 @@ function zn(e, t, n, s = {}, { reducedMotion: i }) {
|
|
|
1763
1779
|
}
|
|
1764
1780
|
}
|
|
1765
1781
|
function Hn(e) {
|
|
1766
|
-
|
|
1782
|
+
N(ue, e);
|
|
1767
1783
|
}
|
|
1768
|
-
const
|
|
1784
|
+
const Gn = {
|
|
1769
1785
|
add: zn,
|
|
1770
1786
|
remove: Hn,
|
|
1771
1787
|
registerOptionsGetter: Rn
|
|
1772
1788
|
}, de = /* @__PURE__ */ new WeakMap();
|
|
1773
|
-
function
|
|
1789
|
+
function Nn(e, t, n, s, { reducedMotion: r, selectorCondition: i, animation: o }) {
|
|
1774
1790
|
const c = o || ne(
|
|
1775
1791
|
t,
|
|
1776
|
-
|
|
1792
|
+
P(n),
|
|
1777
1793
|
void 0,
|
|
1778
|
-
|
|
1794
|
+
r
|
|
1779
1795
|
);
|
|
1780
1796
|
if (!c)
|
|
1781
1797
|
return;
|
|
1782
1798
|
const u = () => {
|
|
1783
|
-
|
|
1799
|
+
i && !t.matches(i) || c.play();
|
|
1784
1800
|
}, a = { source: e, target: t, cleanup: () => {
|
|
1785
1801
|
c.cancel(), e.removeEventListener("animationend", u);
|
|
1786
1802
|
} };
|
|
1787
1803
|
O(de, e, a), O(de, t, a), e.addEventListener("animationend", u);
|
|
1788
1804
|
}
|
|
1789
|
-
function
|
|
1790
|
-
|
|
1805
|
+
function Dn(e) {
|
|
1806
|
+
N(de, e);
|
|
1791
1807
|
}
|
|
1792
1808
|
const Vn = {
|
|
1793
|
-
add:
|
|
1794
|
-
remove:
|
|
1809
|
+
add: Nn,
|
|
1810
|
+
remove: Dn
|
|
1795
1811
|
};
|
|
1796
|
-
function
|
|
1812
|
+
function Wn(e, t, n, s = !1, r, i, o) {
|
|
1797
1813
|
const c = o || ne(
|
|
1798
1814
|
e,
|
|
1799
|
-
|
|
1815
|
+
P(t),
|
|
1800
1816
|
void 0,
|
|
1801
1817
|
s
|
|
1802
1818
|
);
|
|
@@ -1805,37 +1821,37 @@ function jn(e, t, n, s = !1, i, r, o) {
|
|
|
1805
1821
|
let u = !0;
|
|
1806
1822
|
const f = n.type || "alternate";
|
|
1807
1823
|
return (a) => {
|
|
1808
|
-
if (
|
|
1809
|
-
const l = !
|
|
1824
|
+
if (r && !e.matches(r)) return;
|
|
1825
|
+
const l = !i, m = i?.enter?.includes(a.type), g = i?.leave?.includes(a.type);
|
|
1810
1826
|
if (m || l) {
|
|
1811
1827
|
f === "alternate" || f === "state" ? u ? (u = !1, c.play()) : f === "alternate" ? c.reverse() : f === "state" && (c.playState === "running" ? c.pause() : c.playState !== "finished" && c.play()) : (c.progress(0), delete e.dataset.interactEnter, c.isCSS && c.onFinish(() => {
|
|
1812
|
-
|
|
1828
|
+
T.mutate(() => {
|
|
1813
1829
|
e.dataset.interactEnter = "done";
|
|
1814
1830
|
});
|
|
1815
1831
|
}), c.play());
|
|
1816
1832
|
return;
|
|
1817
1833
|
}
|
|
1818
|
-
g && (f === "alternate" ? c.reverse() : f === "repeat" ? (c.cancel(),
|
|
1834
|
+
g && (f === "alternate" ? c.reverse() : f === "repeat" ? (c.cancel(), T.mutate(() => {
|
|
1819
1835
|
delete e.dataset.interactEnter;
|
|
1820
1836
|
})) : f === "state" && c.playState === "running" && c.pause());
|
|
1821
1837
|
};
|
|
1822
1838
|
}
|
|
1823
|
-
function
|
|
1839
|
+
function jn(e, t, {
|
|
1824
1840
|
effectId: n,
|
|
1825
1841
|
listContainer: s,
|
|
1826
|
-
listItemSelector:
|
|
1827
|
-
},
|
|
1828
|
-
const u = !!s, f =
|
|
1842
|
+
listItemSelector: r
|
|
1843
|
+
}, i, o, c) {
|
|
1844
|
+
const u = !!s, f = i.method || "toggle", a = f === "toggle";
|
|
1829
1845
|
return (l) => {
|
|
1830
1846
|
if (o && !e.matches(o)) return;
|
|
1831
1847
|
const m = u ? e.closest(
|
|
1832
|
-
`${s} > ${
|
|
1848
|
+
`${s} > ${r || ""}:has(:scope)`
|
|
1833
1849
|
) : void 0, g = !c, d = c?.enter?.includes(l.type), h = c?.leave?.includes(l.type);
|
|
1834
1850
|
g ? t.toggleEffect(n, f, m) : (d && t.toggleEffect(n, a ? "add" : f, m), h && a && t.toggleEffect(n, "remove", m));
|
|
1835
1851
|
};
|
|
1836
1852
|
}
|
|
1837
1853
|
const he = /* @__PURE__ */ new WeakMap();
|
|
1838
|
-
function
|
|
1854
|
+
function Le(e, t) {
|
|
1839
1855
|
return (n) => {
|
|
1840
1856
|
const s = n;
|
|
1841
1857
|
e.contains(s.relatedTarget) || t(s);
|
|
@@ -1854,14 +1870,14 @@ function Bn(e) {
|
|
|
1854
1870
|
};
|
|
1855
1871
|
}
|
|
1856
1872
|
const Kn = {
|
|
1857
|
-
focusin: (e, t) =>
|
|
1858
|
-
focusout: (e, t) =>
|
|
1873
|
+
focusin: (e, t) => Le(e, t),
|
|
1874
|
+
focusout: (e, t) => Le(e, t),
|
|
1859
1875
|
click: (e, t) => Yn(t),
|
|
1860
1876
|
keydown: (e, t) => Bn(t)
|
|
1861
1877
|
};
|
|
1862
1878
|
function Qn(e, t, n) {
|
|
1863
1879
|
const s = Kn[e];
|
|
1864
|
-
return s ? s(t, n) : (
|
|
1880
|
+
return s ? s(t, n) : (r) => n(r);
|
|
1865
1881
|
}
|
|
1866
1882
|
function Xn(e) {
|
|
1867
1883
|
return typeof e == "object" && !Array.isArray(e) && ("enter" in e || "leave" in e);
|
|
@@ -1884,56 +1900,58 @@ function Zn(e) {
|
|
|
1884
1900
|
return Jn(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
|
|
1885
1901
|
}
|
|
1886
1902
|
function es(e, t, n, s, {
|
|
1887
|
-
reducedMotion:
|
|
1888
|
-
targetController:
|
|
1903
|
+
reducedMotion: r,
|
|
1904
|
+
targetController: i,
|
|
1889
1905
|
selectorCondition: o,
|
|
1890
1906
|
animation: c
|
|
1891
1907
|
}) {
|
|
1892
1908
|
const u = Un(s.eventConfig), f = n.transition || n.transitionProperties, a = Zn(u);
|
|
1893
1909
|
let l, m = !1;
|
|
1894
|
-
if (f ? l =
|
|
1910
|
+
if (f ? l = jn(
|
|
1895
1911
|
t,
|
|
1896
|
-
|
|
1912
|
+
i,
|
|
1897
1913
|
n,
|
|
1898
1914
|
s,
|
|
1899
1915
|
o,
|
|
1900
1916
|
a
|
|
1901
|
-
) : (l =
|
|
1917
|
+
) : (l = Wn(
|
|
1902
1918
|
t,
|
|
1903
1919
|
n,
|
|
1904
1920
|
s,
|
|
1905
|
-
|
|
1921
|
+
r,
|
|
1906
1922
|
o,
|
|
1907
1923
|
a,
|
|
1908
1924
|
c
|
|
1909
1925
|
), m = s.type === "once"), !l)
|
|
1910
1926
|
return;
|
|
1911
1927
|
const g = l, d = new AbortController();
|
|
1912
|
-
function h(v,
|
|
1913
|
-
const S = Qn(
|
|
1914
|
-
v.addEventListener(
|
|
1928
|
+
function h(v, w, b) {
|
|
1929
|
+
const S = Qn(w, e, g);
|
|
1930
|
+
v.addEventListener(w, S, { ...b, signal: d.signal });
|
|
1915
1931
|
}
|
|
1916
1932
|
const y = { source: e, target: t, cleanup: () => {
|
|
1917
1933
|
d.abort();
|
|
1918
1934
|
} };
|
|
1919
1935
|
if (O(he, e, y), O(he, t, y), a) {
|
|
1920
|
-
const v = u.enter,
|
|
1921
|
-
v.forEach((
|
|
1922
|
-
|
|
1923
|
-
})
|
|
1924
|
-
|
|
1925
|
-
|
|
1936
|
+
const v = u.enter, w = u.leave;
|
|
1937
|
+
v.forEach((I) => {
|
|
1938
|
+
I === "focusin" && (e.tabIndex = 0), h(e, I, { passive: !0, once: m });
|
|
1939
|
+
});
|
|
1940
|
+
const b = !s.method || s.method === "toggle";
|
|
1941
|
+
(f ? b : s.type !== "once") && w.forEach((I) => {
|
|
1942
|
+
if (I === "focusout") {
|
|
1943
|
+
h(e, I, { once: m });
|
|
1926
1944
|
return;
|
|
1927
1945
|
}
|
|
1928
|
-
h(e,
|
|
1946
|
+
h(e, I, { passive: !0 });
|
|
1929
1947
|
});
|
|
1930
1948
|
} else
|
|
1931
|
-
(u.toggle ?? []).forEach((
|
|
1932
|
-
h(e,
|
|
1949
|
+
(u.toggle ?? []).forEach((w) => {
|
|
1950
|
+
h(e, w, { once: m, passive: w !== "keydown" });
|
|
1933
1951
|
});
|
|
1934
1952
|
}
|
|
1935
1953
|
function ts(e) {
|
|
1936
|
-
|
|
1954
|
+
N(he, e);
|
|
1937
1955
|
}
|
|
1938
1956
|
const R = {
|
|
1939
1957
|
add: es,
|
|
@@ -1946,19 +1964,19 @@ const R = {
|
|
|
1946
1964
|
enter: ["mouseenter", "focusin"],
|
|
1947
1965
|
leave: ["mouseleave", "focusout"]
|
|
1948
1966
|
}
|
|
1949
|
-
},
|
|
1967
|
+
}, Pe = {
|
|
1950
1968
|
click: me.activate,
|
|
1951
1969
|
hover: me.interest
|
|
1952
1970
|
};
|
|
1953
1971
|
function Y(e) {
|
|
1954
1972
|
const t = me[e];
|
|
1955
|
-
return (n, s,
|
|
1956
|
-
const c = o?.allowA11yTriggers && e in
|
|
1957
|
-
R.add(n, s,
|
|
1973
|
+
return (n, s, r, i, o) => {
|
|
1974
|
+
const c = o?.allowA11yTriggers && e in Pe ? Pe[e] : t;
|
|
1975
|
+
R.add(n, s, r, { ...i, eventConfig: c }, o ?? {});
|
|
1958
1976
|
};
|
|
1959
1977
|
}
|
|
1960
|
-
const
|
|
1961
|
-
viewEnter:
|
|
1978
|
+
const q = {
|
|
1979
|
+
viewEnter: ke,
|
|
1962
1980
|
hover: {
|
|
1963
1981
|
add: Y("hover"),
|
|
1964
1982
|
remove: R.remove
|
|
@@ -1967,10 +1985,10 @@ const k = {
|
|
|
1967
1985
|
add: Y("click"),
|
|
1968
1986
|
remove: R.remove
|
|
1969
1987
|
},
|
|
1970
|
-
pageVisible:
|
|
1988
|
+
pageVisible: ke,
|
|
1971
1989
|
animationEnd: Vn,
|
|
1972
1990
|
viewProgress: Sn,
|
|
1973
|
-
pointerMove:
|
|
1991
|
+
pointerMove: Gn,
|
|
1974
1992
|
activate: {
|
|
1975
1993
|
add: Y("activate"),
|
|
1976
1994
|
remove: R.remove
|
|
@@ -1983,7 +2001,7 @@ const k = {
|
|
|
1983
2001
|
function ns(e) {
|
|
1984
2002
|
return e.replace(/\[([-\w]+)]/g, "[]");
|
|
1985
2003
|
}
|
|
1986
|
-
class
|
|
2004
|
+
class E {
|
|
1987
2005
|
static defineInteractElement;
|
|
1988
2006
|
dataCache;
|
|
1989
2007
|
addedInteractions;
|
|
@@ -1995,19 +2013,20 @@ class w {
|
|
|
1995
2013
|
static instances = [];
|
|
1996
2014
|
static controllerCache = /* @__PURE__ */ new Map();
|
|
1997
2015
|
static sequenceCache = /* @__PURE__ */ new Map();
|
|
2016
|
+
static elementSequenceMap = /* @__PURE__ */ new WeakMap();
|
|
1998
2017
|
constructor() {
|
|
1999
2018
|
this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, this.addedInteractions = {}, this.mediaQueryListeners = /* @__PURE__ */ new Map(), this.listInteractionsCache = {}, this.controllers = /* @__PURE__ */ new Set();
|
|
2000
2019
|
}
|
|
2001
2020
|
init(t, n) {
|
|
2002
2021
|
if (typeof window > "u" || !window.customElements)
|
|
2003
2022
|
return;
|
|
2004
|
-
const s = n?.useCutsomElement ?? !!
|
|
2023
|
+
const s = n?.useCutsomElement ?? !!E.defineInteractElement;
|
|
2005
2024
|
this.dataCache = is(t, s);
|
|
2006
|
-
const
|
|
2007
|
-
s &&
|
|
2008
|
-
|
|
2009
|
-
}) :
|
|
2010
|
-
(
|
|
2025
|
+
const r = E.defineInteractElement?.();
|
|
2026
|
+
s && r === !1 ? document.querySelectorAll("interact-element").forEach((i) => {
|
|
2027
|
+
i.connect();
|
|
2028
|
+
}) : E.controllerCache.forEach(
|
|
2029
|
+
(i, o) => i.connect(o)
|
|
2011
2030
|
);
|
|
2012
2031
|
}
|
|
2013
2032
|
destroy() {
|
|
@@ -2015,14 +2034,14 @@ class w {
|
|
|
2015
2034
|
t.disconnect();
|
|
2016
2035
|
for (const [, t] of this.mediaQueryListeners.entries())
|
|
2017
2036
|
t.mql.removeEventListener("change", t.handler);
|
|
2018
|
-
this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} },
|
|
2037
|
+
this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, E.instances.splice(E.instances.indexOf(this), 1);
|
|
2019
2038
|
}
|
|
2020
2039
|
setController(t, n) {
|
|
2021
|
-
this.controllers.add(n),
|
|
2040
|
+
this.controllers.add(n), E.setController(t, n);
|
|
2022
2041
|
}
|
|
2023
2042
|
deleteController(t, n = !1) {
|
|
2024
|
-
const s =
|
|
2025
|
-
this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s),
|
|
2043
|
+
const s = E.controllerCache.get(t);
|
|
2044
|
+
this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s), E.deleteController(t));
|
|
2026
2045
|
}
|
|
2027
2046
|
has(t) {
|
|
2028
2047
|
return !!this.get(t);
|
|
@@ -2036,66 +2055,87 @@ class w {
|
|
|
2036
2055
|
s.key === t && (s.mql.removeEventListener("change", s.handler), this.mediaQueryListeners.delete(n));
|
|
2037
2056
|
}
|
|
2038
2057
|
clearInteractionStateForKey(t) {
|
|
2039
|
-
(this.get(t)?.interactionIds || []).forEach((
|
|
2040
|
-
const
|
|
2041
|
-
delete this.addedInteractions[
|
|
2058
|
+
(this.get(t)?.interactionIds || []).forEach((r) => {
|
|
2059
|
+
const i = C(r, t);
|
|
2060
|
+
delete this.addedInteractions[i];
|
|
2042
2061
|
});
|
|
2043
2062
|
const s = `${t}::seq::`;
|
|
2044
|
-
for (const
|
|
2045
|
-
|
|
2063
|
+
for (const r of E.sequenceCache.keys())
|
|
2064
|
+
r.startsWith(s) && (E.sequenceCache.delete(r), delete this.addedInteractions[r]);
|
|
2046
2065
|
}
|
|
2047
|
-
setupMediaQueryListener(t, n, s,
|
|
2048
|
-
this.mediaQueryListeners.has(t) || (n.addEventListener("change",
|
|
2066
|
+
setupMediaQueryListener(t, n, s, r) {
|
|
2067
|
+
this.mediaQueryListeners.has(t) || (n.addEventListener("change", r), this.mediaQueryListeners.set(t, {
|
|
2049
2068
|
mql: n,
|
|
2050
|
-
handler:
|
|
2069
|
+
handler: r,
|
|
2051
2070
|
key: s
|
|
2052
2071
|
}));
|
|
2053
2072
|
}
|
|
2054
2073
|
static create(t, n) {
|
|
2055
|
-
const s = new
|
|
2056
|
-
return
|
|
2074
|
+
const s = new E();
|
|
2075
|
+
return E.instances.push(s), s.init(t, n), s;
|
|
2057
2076
|
}
|
|
2058
2077
|
static destroy() {
|
|
2059
|
-
|
|
2078
|
+
E.controllerCache.forEach((t) => {
|
|
2060
2079
|
t.disconnect();
|
|
2061
|
-
}),
|
|
2080
|
+
}), E.instances.length = 0, E.controllerCache.clear(), E.sequenceCache.clear(), E.elementSequenceMap = /* @__PURE__ */ new WeakMap();
|
|
2062
2081
|
}
|
|
2063
2082
|
static setup(t) {
|
|
2064
|
-
t.scrollOptionsGetter &&
|
|
2083
|
+
t.scrollOptionsGetter && q.viewProgress.registerOptionsGetter?.(
|
|
2065
2084
|
t.scrollOptionsGetter
|
|
2066
|
-
), t.pointerOptionsGetter &&
|
|
2085
|
+
), t.pointerOptionsGetter && q.pointerMove.registerOptionsGetter?.(
|
|
2067
2086
|
t.pointerOptionsGetter
|
|
2068
|
-
), t.viewEnter &&
|
|
2087
|
+
), t.viewEnter && q.viewEnter.setOptions(
|
|
2069
2088
|
t.viewEnter
|
|
2070
|
-
), t.allowA11yTriggers !== void 0 && (
|
|
2089
|
+
), t.allowA11yTriggers !== void 0 && (E.allowA11yTriggers = t.allowA11yTriggers);
|
|
2071
2090
|
}
|
|
2072
2091
|
static getInstance(t) {
|
|
2073
|
-
return
|
|
2092
|
+
return E.instances.find((n) => n.has(t));
|
|
2074
2093
|
}
|
|
2075
2094
|
static getController(t) {
|
|
2076
|
-
return t ?
|
|
2095
|
+
return t ? E.controllerCache.get(t) : void 0;
|
|
2077
2096
|
}
|
|
2078
2097
|
static setController(t, n) {
|
|
2079
|
-
|
|
2098
|
+
E.controllerCache.set(t, n);
|
|
2080
2099
|
}
|
|
2081
2100
|
static deleteController(t) {
|
|
2082
|
-
|
|
2101
|
+
E.controllerCache.delete(t);
|
|
2083
2102
|
}
|
|
2084
2103
|
static registerEffects = Rt;
|
|
2085
|
-
static getSequence(t, n, s,
|
|
2086
|
-
const
|
|
2087
|
-
if (
|
|
2088
|
-
const o = Bt(n, s,
|
|
2089
|
-
return
|
|
2090
|
-
}
|
|
2091
|
-
static addToSequence(t, n, s,
|
|
2092
|
-
const
|
|
2093
|
-
if (!
|
|
2094
|
-
const c = Ve(n,
|
|
2095
|
-
index: s[f] ??
|
|
2104
|
+
static getSequence(t, n, s, r) {
|
|
2105
|
+
const i = E.sequenceCache.get(t);
|
|
2106
|
+
if (i) return i;
|
|
2107
|
+
const o = Bt(n, s, r);
|
|
2108
|
+
return E.sequenceCache.set(t, o), E._registerSequenceElements(s, o), o;
|
|
2109
|
+
}
|
|
2110
|
+
static addToSequence(t, n, s, r) {
|
|
2111
|
+
const i = E.sequenceCache.get(t);
|
|
2112
|
+
if (!i) return !1;
|
|
2113
|
+
const c = Ve(n, r).map((u, f) => ({
|
|
2114
|
+
index: s[f] ?? i.animationGroups.length,
|
|
2096
2115
|
group: u
|
|
2097
2116
|
}));
|
|
2098
|
-
return
|
|
2117
|
+
return i.addGroups(c), E._registerSequenceElements(n, i), !0;
|
|
2118
|
+
}
|
|
2119
|
+
static _registerSequenceElements(t, n) {
|
|
2120
|
+
for (const { target: s } of t) {
|
|
2121
|
+
const r = Array.isArray(s) ? s : s instanceof HTMLElement ? [s] : [];
|
|
2122
|
+
for (const i of r) {
|
|
2123
|
+
let o = E.elementSequenceMap.get(i);
|
|
2124
|
+
o || (o = /* @__PURE__ */ new Set(), E.elementSequenceMap.set(i, o)), o.add(n);
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
static removeFromSequences(t) {
|
|
2129
|
+
for (const n of t) {
|
|
2130
|
+
const s = E.elementSequenceMap.get(n);
|
|
2131
|
+
if (s) {
|
|
2132
|
+
for (const r of s)
|
|
2133
|
+
r.removeGroups(
|
|
2134
|
+
(i) => i.animations.some((o) => o.effect?.target === n)
|
|
2135
|
+
);
|
|
2136
|
+
E.elementSequenceMap.delete(n);
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2099
2139
|
}
|
|
2100
2140
|
}
|
|
2101
2141
|
let ss = 0;
|
|
@@ -2105,13 +2145,13 @@ function H(e, {
|
|
|
2105
2145
|
useFirstChild: s = !1
|
|
2106
2146
|
} = {}) {
|
|
2107
2147
|
if (e.listContainer) {
|
|
2108
|
-
const
|
|
2109
|
-
return e.selector ? `${e.listContainer}${
|
|
2148
|
+
const r = `${n && e.listItemSelector ? ` > ${e.listItemSelector}` : ""}`;
|
|
2149
|
+
return e.selector ? `${e.listContainer}${r} ${e.selector}` : `${e.listContainer}${r || " > *"}`;
|
|
2110
2150
|
} else if (e.selector)
|
|
2111
2151
|
return e.selector;
|
|
2112
2152
|
return s ? t ? "> :first-child" : ":scope > :first-child" : "";
|
|
2113
2153
|
}
|
|
2114
|
-
function
|
|
2154
|
+
function $e(e) {
|
|
2115
2155
|
return "sequenceId" in e && !("effects" in e);
|
|
2116
2156
|
}
|
|
2117
2157
|
function ce(e, t) {
|
|
@@ -2125,58 +2165,58 @@ function ce(e, t) {
|
|
|
2125
2165
|
}
|
|
2126
2166
|
function is(e, t = !1) {
|
|
2127
2167
|
const n = e.conditions || {}, s = {};
|
|
2128
|
-
return e.interactions?.forEach((
|
|
2129
|
-
const
|
|
2130
|
-
if (!
|
|
2168
|
+
return e.interactions?.forEach((r) => {
|
|
2169
|
+
const i = r.key, o = ++ss, { effects: c, sequences: u, ...f } = r;
|
|
2170
|
+
if (!i) {
|
|
2131
2171
|
console.error(`Interaction ${o} is missing a key for source element.`);
|
|
2132
2172
|
return;
|
|
2133
2173
|
}
|
|
2134
|
-
ce(s,
|
|
2174
|
+
ce(s, i);
|
|
2135
2175
|
const a = c ? Array.from(c) : [];
|
|
2136
2176
|
a.reverse();
|
|
2137
2177
|
const l = u?.map((d) => {
|
|
2138
|
-
if (
|
|
2178
|
+
if ($e(d)) {
|
|
2139
2179
|
const p = e.sequences?.[d.sequenceId];
|
|
2140
2180
|
return p ? { ...p, ...d } : (console.warn(`Interact: Sequence "${d.sequenceId}" not found in config`), d);
|
|
2141
2181
|
}
|
|
2142
2182
|
const h = d;
|
|
2143
|
-
return h.sequenceId || (h.sequenceId =
|
|
2183
|
+
return h.sequenceId || (h.sequenceId = _()), h;
|
|
2144
2184
|
}), m = {
|
|
2145
2185
|
...f,
|
|
2146
2186
|
effects: a.length > 0 ? a : void 0,
|
|
2147
2187
|
sequences: l
|
|
2148
2188
|
};
|
|
2149
|
-
s[
|
|
2189
|
+
s[i].triggers.push(m), s[i].selectors.add(
|
|
2150
2190
|
H(m, { useFirstChild: t })
|
|
2151
2191
|
);
|
|
2152
2192
|
const g = m.listContainer;
|
|
2153
2193
|
a.forEach((d) => {
|
|
2154
2194
|
let h = d.key;
|
|
2155
2195
|
if (!h && d.effectId) {
|
|
2156
|
-
const
|
|
2157
|
-
|
|
2196
|
+
const w = e.effects[d.effectId];
|
|
2197
|
+
w && (h = w.key);
|
|
2158
2198
|
}
|
|
2159
|
-
d.effectId || (d.effectId =
|
|
2199
|
+
d.effectId || (d.effectId = _()), h = h || i, d.key = h;
|
|
2160
2200
|
const p = d.effectId;
|
|
2161
|
-
if (g && d.listContainer && (h !==
|
|
2201
|
+
if (g && d.listContainer && (h !== i || d.listContainer !== g))
|
|
2162
2202
|
return;
|
|
2163
|
-
const y = `${
|
|
2164
|
-
if (d.interactionId = y, s[
|
|
2203
|
+
const y = `${i}::${h}::${p}::${o}`;
|
|
2204
|
+
if (d.interactionId = y, s[i].interactionIds.add(y), h === i)
|
|
2165
2205
|
return;
|
|
2166
2206
|
const v = ce(s, h);
|
|
2167
2207
|
v.effects[y] || (v.effects[y] = [], v.interactionIds.add(y)), v.effects[y].push({ ...f, effect: d }), v.selectors.add(H(d, { useFirstChild: t }));
|
|
2168
2208
|
}), l?.forEach((d) => {
|
|
2169
|
-
if (!d ||
|
|
2170
|
-
const h = d, p = h.sequenceId ||
|
|
2209
|
+
if (!d || $e(d)) return;
|
|
2210
|
+
const h = d, p = h.sequenceId || _(), y = h.effects;
|
|
2171
2211
|
for (const v of y) {
|
|
2172
|
-
v.effectId || (v.effectId =
|
|
2173
|
-
let
|
|
2174
|
-
if (!
|
|
2212
|
+
v.effectId || (v.effectId = _());
|
|
2213
|
+
let w = v.key;
|
|
2214
|
+
if (!w && v.effectId) {
|
|
2175
2215
|
const b = e.effects[v.effectId];
|
|
2176
|
-
b && (
|
|
2216
|
+
b && (w = b.key);
|
|
2177
2217
|
}
|
|
2178
|
-
if (
|
|
2179
|
-
const b = ce(s,
|
|
2218
|
+
if (w = w || i, w !== i) {
|
|
2219
|
+
const b = ce(s, w), S = `${w}::seq::${p}::${o}`;
|
|
2180
2220
|
b.sequences[S] || (b.sequences[S] = [], b.interactionIds.add(S)), b.sequences[S].push({
|
|
2181
2221
|
...f,
|
|
2182
2222
|
sequence: h
|
|
@@ -2207,16 +2247,16 @@ function pe(e, t, n) {
|
|
|
2207
2247
|
function ge(e, t) {
|
|
2208
2248
|
return t.map((n) => e.selector ? n.querySelector(e.selector) : n).filter(Boolean);
|
|
2209
2249
|
}
|
|
2210
|
-
function Xe(e, t, n, s,
|
|
2250
|
+
function Xe(e, t, n, s, r, i, o, c) {
|
|
2211
2251
|
return [
|
|
2212
2252
|
o ? ge(e, o) : pe(e, n, s),
|
|
2213
|
-
c ? ge(t, c) : pe(t,
|
|
2253
|
+
c ? ge(t, c) : pe(t, r, i)
|
|
2214
2254
|
];
|
|
2215
2255
|
}
|
|
2216
|
-
function Ue(e, t, n, s,
|
|
2217
|
-
const c = Array.isArray(s), u = Array.isArray(
|
|
2256
|
+
function Ue(e, t, n, s, r, i, o) {
|
|
2257
|
+
const c = Array.isArray(s), u = Array.isArray(r);
|
|
2218
2258
|
c ? s.forEach((f, a) => {
|
|
2219
|
-
const l = u ?
|
|
2259
|
+
const l = u ? r[a] : r;
|
|
2220
2260
|
l && Fe(
|
|
2221
2261
|
e,
|
|
2222
2262
|
f,
|
|
@@ -2224,10 +2264,10 @@ function Ue(e, t, n, s, i, r, o) {
|
|
|
2224
2264
|
l,
|
|
2225
2265
|
n,
|
|
2226
2266
|
t.params,
|
|
2227
|
-
|
|
2267
|
+
i,
|
|
2228
2268
|
o
|
|
2229
2269
|
);
|
|
2230
|
-
}) : (u ?
|
|
2270
|
+
}) : (u ? r : [r]).forEach((a) => {
|
|
2231
2271
|
Fe(
|
|
2232
2272
|
e,
|
|
2233
2273
|
s,
|
|
@@ -2235,30 +2275,30 @@ function Ue(e, t, n, s, i, r, o) {
|
|
|
2235
2275
|
a,
|
|
2236
2276
|
n,
|
|
2237
2277
|
t.params,
|
|
2238
|
-
|
|
2278
|
+
i,
|
|
2239
2279
|
o
|
|
2240
2280
|
);
|
|
2241
2281
|
});
|
|
2242
2282
|
}
|
|
2243
|
-
function Je(e, t, n, s,
|
|
2244
|
-
const
|
|
2283
|
+
function Je(e, t, n, s, r) {
|
|
2284
|
+
const i = {}, o = [];
|
|
2245
2285
|
(s.effects || []).forEach((c) => {
|
|
2246
2286
|
const u = c.effectId, f = {
|
|
2247
2287
|
...n.dataCache.effects[u] || {},
|
|
2248
2288
|
...c,
|
|
2249
2289
|
effectId: u
|
|
2250
2290
|
}, a = f.key, l = C(c.interactionId, e);
|
|
2251
|
-
if (
|
|
2291
|
+
if (i[l] || n.addedInteractions[l] && !r)
|
|
2252
2292
|
return;
|
|
2253
|
-
const m =
|
|
2293
|
+
const m = k(f.conditions || [], n.dataCache.conditions);
|
|
2254
2294
|
if (m && n.setupMediaQueryListener(l, m, e, () => {
|
|
2255
2295
|
t.update();
|
|
2256
2296
|
}), !m || m.matches) {
|
|
2257
|
-
|
|
2297
|
+
i[l] = !0;
|
|
2258
2298
|
const g = a && C(a, e);
|
|
2259
2299
|
let d;
|
|
2260
2300
|
if (g) {
|
|
2261
|
-
if (d =
|
|
2301
|
+
if (d = E.getController(g), !d)
|
|
2262
2302
|
return;
|
|
2263
2303
|
f.listContainer && d.watchChildList(f.listContainer);
|
|
2264
2304
|
} else
|
|
@@ -2270,12 +2310,12 @@ function Je(e, t, n, s, i) {
|
|
|
2270
2310
|
t.useFirstChild,
|
|
2271
2311
|
d.element,
|
|
2272
2312
|
d.useFirstChild,
|
|
2273
|
-
|
|
2313
|
+
r
|
|
2274
2314
|
);
|
|
2275
2315
|
if (!h || !p)
|
|
2276
2316
|
return;
|
|
2277
2317
|
n.addedInteractions[l] = !0;
|
|
2278
|
-
const y = g || s.key, v =
|
|
2318
|
+
const y = g || s.key, v = L(
|
|
2279
2319
|
f.conditions || [],
|
|
2280
2320
|
n.dataCache.conditions
|
|
2281
2321
|
);
|
|
@@ -2291,73 +2331,73 @@ function Je(e, t, n, s, i) {
|
|
|
2291
2331
|
}
|
|
2292
2332
|
}), o.reverse().forEach((c) => {
|
|
2293
2333
|
Ue(...c);
|
|
2294
|
-
}), os(e, t, n, s,
|
|
2334
|
+
}), os(e, t, n, s, r);
|
|
2295
2335
|
}
|
|
2296
2336
|
function rs(e) {
|
|
2297
2337
|
return "sequenceId" in e && !("effects" in e);
|
|
2298
2338
|
}
|
|
2299
|
-
function Ze(e, t, n, s,
|
|
2300
|
-
const c =
|
|
2301
|
-
if (c &&
|
|
2339
|
+
function Ze(e, t, n, s, r, i, o) {
|
|
2340
|
+
const c = k(e.conditions || [], r.dataCache.conditions);
|
|
2341
|
+
if (c && r.setupMediaQueryListener(t, c, i.updateKey, i.onUpdate), c && !c.matches) return null;
|
|
2302
2342
|
const u = e.effects || [], f = [];
|
|
2303
2343
|
let a = !1;
|
|
2304
2344
|
for (const l of u) {
|
|
2305
2345
|
const m = l.effectId, d = {
|
|
2306
|
-
...m ?
|
|
2346
|
+
...m ? r.dataCache.effects[m] || {} : {},
|
|
2307
2347
|
...l
|
|
2308
|
-
}, h =
|
|
2348
|
+
}, h = k(d.conditions || [], r.dataCache.conditions);
|
|
2309
2349
|
if (h) {
|
|
2310
|
-
const
|
|
2311
|
-
|
|
2312
|
-
|
|
2350
|
+
const I = `${t}::${m || "eff"}`;
|
|
2351
|
+
r.setupMediaQueryListener(
|
|
2352
|
+
I,
|
|
2313
2353
|
h,
|
|
2314
|
-
|
|
2315
|
-
|
|
2354
|
+
i.updateKey,
|
|
2355
|
+
i.onUpdate
|
|
2316
2356
|
);
|
|
2317
2357
|
}
|
|
2318
2358
|
if (h && !h.matches) continue;
|
|
2319
2359
|
const p = d.key, y = p && C(p, n);
|
|
2320
2360
|
let v;
|
|
2321
2361
|
if (y) {
|
|
2322
|
-
if (v =
|
|
2362
|
+
if (v = E.getController(y), !v) return null;
|
|
2323
2363
|
} else
|
|
2324
2364
|
v = s;
|
|
2325
|
-
const
|
|
2365
|
+
const w = y || n;
|
|
2326
2366
|
let b;
|
|
2327
|
-
if (o &&
|
|
2367
|
+
if (o && w === o.controllerKey && d.listContainer === o.listContainer ? (b = ge(d, o.elements), b.length > 0 && (a = !0)) : b = pe(
|
|
2328
2368
|
d,
|
|
2329
2369
|
v.element,
|
|
2330
2370
|
v.useFirstChild
|
|
2331
2371
|
), !b || Array.isArray(b) && b.length === 0) return null;
|
|
2332
|
-
const S =
|
|
2372
|
+
const S = P(d);
|
|
2333
2373
|
f.push({ target: b, options: S });
|
|
2334
2374
|
}
|
|
2335
2375
|
return o && !a ? null : f.length > 0 ? f : null;
|
|
2336
2376
|
}
|
|
2337
2377
|
function et(e, t, n) {
|
|
2338
|
-
const
|
|
2339
|
-
if (!
|
|
2340
|
-
const o = Array.from(
|
|
2378
|
+
const i = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
|
|
2379
|
+
if (!i) return n.map((c, u) => u);
|
|
2380
|
+
const o = Array.from(i.children);
|
|
2341
2381
|
return n.map((c) => {
|
|
2342
2382
|
const u = o.indexOf(c);
|
|
2343
2383
|
return u >= 0 ? u : o.length;
|
|
2344
2384
|
});
|
|
2345
2385
|
}
|
|
2346
|
-
function os(e, t, n, s,
|
|
2347
|
-
s.sequences?.forEach((
|
|
2386
|
+
function os(e, t, n, s, r) {
|
|
2387
|
+
s.sequences?.forEach((i) => {
|
|
2348
2388
|
let o;
|
|
2349
|
-
if (rs(
|
|
2350
|
-
const g = n.dataCache.sequences[
|
|
2389
|
+
if (rs(i)) {
|
|
2390
|
+
const g = n.dataCache.sequences[i.sequenceId];
|
|
2351
2391
|
if (!g) {
|
|
2352
|
-
console.warn(`Interact: Sequence "${
|
|
2392
|
+
console.warn(`Interact: Sequence "${i.sequenceId}" not found in cache`);
|
|
2353
2393
|
return;
|
|
2354
2394
|
}
|
|
2355
|
-
o = { ...g, ...
|
|
2395
|
+
o = { ...g, ...i };
|
|
2356
2396
|
} else
|
|
2357
|
-
o =
|
|
2358
|
-
const c = o.sequenceId ||
|
|
2359
|
-
if (n.addedInteractions[u] && !
|
|
2360
|
-
const f =
|
|
2397
|
+
o = i;
|
|
2398
|
+
const c = o.sequenceId || _(), u = C(`${e}::seq::${c}`, e);
|
|
2399
|
+
if (n.addedInteractions[u] && !r) return;
|
|
2400
|
+
const f = r && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: r } : void 0, a = Ze(
|
|
2361
2401
|
o,
|
|
2362
2402
|
u,
|
|
2363
2403
|
e,
|
|
@@ -2367,54 +2407,54 @@ function os(e, t, n, s, i) {
|
|
|
2367
2407
|
f
|
|
2368
2408
|
);
|
|
2369
2409
|
if (!a) return;
|
|
2370
|
-
if (
|
|
2410
|
+
if (r && n.addedInteractions[u]) {
|
|
2371
2411
|
const g = et(
|
|
2372
2412
|
t,
|
|
2373
2413
|
s.listContainer,
|
|
2374
|
-
|
|
2414
|
+
r
|
|
2375
2415
|
);
|
|
2376
|
-
|
|
2377
|
-
reducedMotion:
|
|
2416
|
+
E.addToSequence(u, a, g, {
|
|
2417
|
+
reducedMotion: E.forceReducedMotion
|
|
2378
2418
|
});
|
|
2379
2419
|
return;
|
|
2380
2420
|
}
|
|
2381
|
-
const l =
|
|
2382
|
-
reducedMotion:
|
|
2421
|
+
const l = E.getSequence(u, o, a, {
|
|
2422
|
+
reducedMotion: E.forceReducedMotion
|
|
2383
2423
|
});
|
|
2384
2424
|
n.addedInteractions[u] = !0;
|
|
2385
|
-
const m =
|
|
2425
|
+
const m = L(
|
|
2386
2426
|
s.conditions || [],
|
|
2387
2427
|
n.dataCache.conditions
|
|
2388
2428
|
);
|
|
2389
|
-
|
|
2429
|
+
q[s.trigger]?.add(
|
|
2390
2430
|
t.element,
|
|
2391
2431
|
t.element,
|
|
2392
2432
|
{},
|
|
2393
2433
|
s.params || {},
|
|
2394
2434
|
{
|
|
2395
|
-
reducedMotion:
|
|
2435
|
+
reducedMotion: E.forceReducedMotion,
|
|
2396
2436
|
selectorCondition: m,
|
|
2397
2437
|
animation: l,
|
|
2398
|
-
allowA11yTriggers:
|
|
2438
|
+
allowA11yTriggers: E.allowA11yTriggers
|
|
2399
2439
|
}
|
|
2400
2440
|
);
|
|
2401
2441
|
});
|
|
2402
2442
|
}
|
|
2403
|
-
function cs(e, t, n, s,
|
|
2404
|
-
const
|
|
2405
|
-
Object.keys(
|
|
2406
|
-
|
|
2407
|
-
const l =
|
|
2443
|
+
function cs(e, t, n, s, r) {
|
|
2444
|
+
const i = n.get(e)?.sequences || {};
|
|
2445
|
+
Object.keys(i).forEach((c) => {
|
|
2446
|
+
i[c].some(({ sequence: f, ...a }) => {
|
|
2447
|
+
const l = k(
|
|
2408
2448
|
a.conditions || [],
|
|
2409
2449
|
n.dataCache.conditions
|
|
2410
2450
|
);
|
|
2411
2451
|
if (l && !l.matches)
|
|
2412
2452
|
return !1;
|
|
2413
|
-
const m = a.key && C(a.key, e), g =
|
|
2453
|
+
const m = a.key && C(a.key, e), g = E.getController(m);
|
|
2414
2454
|
if (!g)
|
|
2415
2455
|
return !0;
|
|
2416
|
-
const d = f.sequenceId ||
|
|
2417
|
-
if (n.addedInteractions[h] && !
|
|
2456
|
+
const d = f.sequenceId || _(), h = C(`${m}::seq::${d}`, m);
|
|
2457
|
+
if (n.addedInteractions[h] && !r)
|
|
2418
2458
|
return !0;
|
|
2419
2459
|
const y = Ze(
|
|
2420
2460
|
f,
|
|
@@ -2423,46 +2463,46 @@ function cs(e, t, n, s, i) {
|
|
|
2423
2463
|
g,
|
|
2424
2464
|
n,
|
|
2425
2465
|
{ updateKey: e, onUpdate: () => t.update() },
|
|
2426
|
-
|
|
2466
|
+
r && s ? { controllerKey: e, listContainer: s, elements: r } : void 0
|
|
2427
2467
|
);
|
|
2428
2468
|
if (!y) return !0;
|
|
2429
|
-
if (
|
|
2430
|
-
const b = et(t, s,
|
|
2431
|
-
return
|
|
2432
|
-
reducedMotion:
|
|
2469
|
+
if (r && n.addedInteractions[h]) {
|
|
2470
|
+
const b = et(t, s, r);
|
|
2471
|
+
return E.addToSequence(h, y, b, {
|
|
2472
|
+
reducedMotion: E.forceReducedMotion
|
|
2433
2473
|
}), !0;
|
|
2434
2474
|
}
|
|
2435
|
-
const v =
|
|
2436
|
-
reducedMotion:
|
|
2475
|
+
const v = E.getSequence(h, f, y, {
|
|
2476
|
+
reducedMotion: E.forceReducedMotion
|
|
2437
2477
|
});
|
|
2438
2478
|
n.addedInteractions[h] = !0;
|
|
2439
|
-
const
|
|
2479
|
+
const w = L(
|
|
2440
2480
|
a.conditions || [],
|
|
2441
2481
|
n.dataCache.conditions
|
|
2442
2482
|
);
|
|
2443
|
-
return
|
|
2483
|
+
return q[a.trigger]?.add(
|
|
2444
2484
|
g.element,
|
|
2445
2485
|
g.element,
|
|
2446
2486
|
{},
|
|
2447
2487
|
a.params || {},
|
|
2448
2488
|
{
|
|
2449
|
-
reducedMotion:
|
|
2450
|
-
selectorCondition:
|
|
2489
|
+
reducedMotion: E.forceReducedMotion,
|
|
2490
|
+
selectorCondition: w,
|
|
2451
2491
|
animation: v,
|
|
2452
|
-
allowA11yTriggers:
|
|
2492
|
+
allowA11yTriggers: E.allowA11yTriggers
|
|
2453
2493
|
}
|
|
2454
2494
|
), !0;
|
|
2455
2495
|
});
|
|
2456
2496
|
});
|
|
2457
2497
|
}
|
|
2458
|
-
function tt(e, t, n, s,
|
|
2459
|
-
const
|
|
2498
|
+
function tt(e, t, n, s, r) {
|
|
2499
|
+
const i = n.get(e), o = i?.effects || {}, c = Object.keys(o), u = [];
|
|
2460
2500
|
c.forEach((a) => {
|
|
2461
2501
|
const l = C(a, e);
|
|
2462
|
-
if (n.addedInteractions[l] && !
|
|
2502
|
+
if (n.addedInteractions[l] && !r)
|
|
2463
2503
|
return;
|
|
2464
2504
|
o[a].some(({ effect: g, ...d }) => {
|
|
2465
|
-
const h =
|
|
2505
|
+
const h = k(
|
|
2466
2506
|
d.conditions || [],
|
|
2467
2507
|
n.dataCache.conditions
|
|
2468
2508
|
);
|
|
@@ -2475,15 +2515,15 @@ function tt(e, t, n, s, i) {
|
|
|
2475
2515
|
};
|
|
2476
2516
|
if (s && y.listContainer !== s)
|
|
2477
2517
|
return !1;
|
|
2478
|
-
const v =
|
|
2518
|
+
const v = k(y.conditions || [], n.dataCache.conditions);
|
|
2479
2519
|
if (v && n.setupMediaQueryListener(l, v, e, () => {
|
|
2480
2520
|
t.update();
|
|
2481
2521
|
}), !v || v.matches) {
|
|
2482
|
-
const
|
|
2522
|
+
const w = d.key && C(d.key, e), b = E.getController(w);
|
|
2483
2523
|
if (!b)
|
|
2484
2524
|
return !0;
|
|
2485
2525
|
y.listContainer && t.watchChildList(y.listContainer);
|
|
2486
|
-
const [S,
|
|
2526
|
+
const [S, I] = Xe(
|
|
2487
2527
|
d,
|
|
2488
2528
|
y,
|
|
2489
2529
|
b.element,
|
|
@@ -2491,12 +2531,12 @@ function tt(e, t, n, s, i) {
|
|
|
2491
2531
|
t.element,
|
|
2492
2532
|
t.useFirstChild,
|
|
2493
2533
|
void 0,
|
|
2494
|
-
|
|
2534
|
+
r
|
|
2495
2535
|
);
|
|
2496
|
-
if (!S || !
|
|
2536
|
+
if (!S || !I)
|
|
2497
2537
|
return !0;
|
|
2498
2538
|
n.addedInteractions[l] = !0;
|
|
2499
|
-
const
|
|
2539
|
+
const $ = L(
|
|
2500
2540
|
y.conditions || [],
|
|
2501
2541
|
n.dataCache.conditions
|
|
2502
2542
|
);
|
|
@@ -2505,8 +2545,8 @@ function tt(e, t, n, s, i) {
|
|
|
2505
2545
|
d,
|
|
2506
2546
|
y,
|
|
2507
2547
|
S,
|
|
2508
|
-
|
|
2509
|
-
|
|
2548
|
+
I,
|
|
2549
|
+
$,
|
|
2510
2550
|
t.useFirstChild
|
|
2511
2551
|
]), !0;
|
|
2512
2552
|
}
|
|
@@ -2514,43 +2554,43 @@ function tt(e, t, n, s, i) {
|
|
|
2514
2554
|
});
|
|
2515
2555
|
}), u.reverse().forEach((a) => {
|
|
2516
2556
|
Ue(...a);
|
|
2517
|
-
}), cs(e, t, n, s,
|
|
2518
|
-
const f = Object.keys(
|
|
2557
|
+
}), cs(e, t, n, s, r);
|
|
2558
|
+
const f = Object.keys(i?.sequences || {}).length > 0;
|
|
2519
2559
|
return c.length > 0 || f;
|
|
2520
2560
|
}
|
|
2521
|
-
function Fe(e, t, n, s,
|
|
2561
|
+
function Fe(e, t, n, s, r, i, o, c) {
|
|
2522
2562
|
let u;
|
|
2523
|
-
if (
|
|
2563
|
+
if (r.transition || r.transitionProperties) {
|
|
2524
2564
|
const f = {
|
|
2525
2565
|
key: e,
|
|
2526
|
-
effectId:
|
|
2527
|
-
transition:
|
|
2528
|
-
properties:
|
|
2529
|
-
childSelector: H(
|
|
2566
|
+
effectId: r.effectId,
|
|
2567
|
+
transition: r.transition,
|
|
2568
|
+
properties: r.transitionProperties,
|
|
2569
|
+
childSelector: H(r, {
|
|
2530
2570
|
asCombinator: !0,
|
|
2531
2571
|
addItemFilter: !0,
|
|
2532
2572
|
useFirstChild: c
|
|
2533
2573
|
}),
|
|
2534
2574
|
selectorCondition: o
|
|
2535
2575
|
};
|
|
2536
|
-
if (u =
|
|
2576
|
+
if (u = E.getController(e), !u)
|
|
2537
2577
|
return;
|
|
2538
2578
|
u.renderStyle(Kt(f));
|
|
2539
2579
|
}
|
|
2540
|
-
|
|
2541
|
-
reducedMotion:
|
|
2580
|
+
q[n]?.add(t, s, r, i, {
|
|
2581
|
+
reducedMotion: E.forceReducedMotion,
|
|
2542
2582
|
targetController: u,
|
|
2543
2583
|
selectorCondition: o,
|
|
2544
|
-
allowA11yTriggers:
|
|
2584
|
+
allowA11yTriggers: E.allowA11yTriggers
|
|
2545
2585
|
});
|
|
2546
2586
|
}
|
|
2547
2587
|
function as(e) {
|
|
2548
|
-
const t = e.key, n =
|
|
2588
|
+
const t = e.key, n = E.getInstance(t);
|
|
2549
2589
|
if (!n)
|
|
2550
|
-
return console.warn(`No instance found for key: ${t}`),
|
|
2551
|
-
const { triggers: s = [] } = n?.get(t) || {},
|
|
2590
|
+
return console.warn(`No instance found for key: ${t}`), E.setController(t, e), !1;
|
|
2591
|
+
const { triggers: s = [] } = n?.get(t) || {}, r = s.length > 0;
|
|
2552
2592
|
n.setController(t, e), s.forEach((o, c) => {
|
|
2553
|
-
const u =
|
|
2593
|
+
const u = k(o.conditions, n.dataCache.conditions);
|
|
2554
2594
|
if (u) {
|
|
2555
2595
|
const f = `${t}::trigger::${c}`;
|
|
2556
2596
|
n.setupMediaQueryListener(f, u, t, () => {
|
|
@@ -2559,40 +2599,41 @@ function as(e) {
|
|
|
2559
2599
|
}
|
|
2560
2600
|
(!u || u.matches) && (o.listContainer && e.watchChildList(o.listContainer), Je(t, e, n, o));
|
|
2561
2601
|
});
|
|
2562
|
-
let
|
|
2563
|
-
return n && (
|
|
2602
|
+
let i = !1;
|
|
2603
|
+
return n && (i = tt(t, e, n)), r || i;
|
|
2564
2604
|
}
|
|
2565
2605
|
function fs(e, t, n) {
|
|
2566
|
-
const s = e.key,
|
|
2567
|
-
if (
|
|
2568
|
-
const { triggers:
|
|
2569
|
-
|
|
2606
|
+
const s = e.key, r = E.getInstance(s);
|
|
2607
|
+
if (r) {
|
|
2608
|
+
const { triggers: i = [] } = r?.get(s) || {};
|
|
2609
|
+
i.forEach((o, c) => {
|
|
2570
2610
|
if (o.listContainer !== t)
|
|
2571
2611
|
return;
|
|
2572
|
-
const u =
|
|
2612
|
+
const u = k(o.conditions, r.dataCache.conditions);
|
|
2573
2613
|
if (u) {
|
|
2574
2614
|
const f = `${s}::listTrigger::${t}::${c}`;
|
|
2575
|
-
|
|
2615
|
+
r.setupMediaQueryListener(f, u, s, () => {
|
|
2576
2616
|
e.update();
|
|
2577
2617
|
});
|
|
2578
2618
|
}
|
|
2579
|
-
(!u || u.matches) && Je(s, e,
|
|
2580
|
-
}), tt(s, e,
|
|
2619
|
+
(!u || u.matches) && Je(s, e, r, o, n);
|
|
2620
|
+
}), tt(s, e, r, t, n);
|
|
2581
2621
|
}
|
|
2582
2622
|
}
|
|
2583
2623
|
function ls(e, t = !1) {
|
|
2584
|
-
const n = e.key, s =
|
|
2624
|
+
const n = e.key, s = E.getInstance(n);
|
|
2585
2625
|
if (!s)
|
|
2586
2626
|
return;
|
|
2587
|
-
const
|
|
2588
|
-
let
|
|
2589
|
-
|
|
2627
|
+
const r = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
|
|
2628
|
+
let i;
|
|
2629
|
+
r ? (i = [...e.element.querySelectorAll(r)], e.useFirstChild || i.push(e.element)) : i = [e.element], nt(i), s.deleteController(n, t);
|
|
2590
2630
|
}
|
|
2591
2631
|
function nt(e) {
|
|
2592
|
-
const t = Object.values(
|
|
2632
|
+
const t = Object.values(q);
|
|
2593
2633
|
for (const n of e)
|
|
2594
2634
|
for (const s of t)
|
|
2595
2635
|
s.remove(n);
|
|
2636
|
+
E.removeFromSequences(e);
|
|
2596
2637
|
}
|
|
2597
2638
|
const ae = "interactEffect";
|
|
2598
2639
|
class us {
|
|
@@ -2636,22 +2677,22 @@ class us {
|
|
|
2636
2677
|
for (const s of t)
|
|
2637
2678
|
try {
|
|
2638
2679
|
this.sheet.insertRule(s, n), n++;
|
|
2639
|
-
} catch (
|
|
2640
|
-
console.error(
|
|
2680
|
+
} catch (r) {
|
|
2681
|
+
console.error(r);
|
|
2641
2682
|
}
|
|
2642
2683
|
}
|
|
2643
2684
|
}
|
|
2644
|
-
toggleEffect(t, n, s,
|
|
2685
|
+
toggleEffect(t, n, s, r) {
|
|
2645
2686
|
if (s === null)
|
|
2646
2687
|
return;
|
|
2647
|
-
if (!
|
|
2688
|
+
if (!r && this.element.toggleEffect) {
|
|
2648
2689
|
this.element.toggleEffect(t, n, s);
|
|
2649
2690
|
return;
|
|
2650
2691
|
}
|
|
2651
|
-
const
|
|
2692
|
+
const i = new Set(
|
|
2652
2693
|
this.element.dataset[ae]?.split(" ") || []
|
|
2653
2694
|
);
|
|
2654
|
-
n === "toggle" ?
|
|
2695
|
+
n === "toggle" ? i.has(t) ? i.delete(t) : i.add(t) : n === "add" ? i.add(t) : n === "remove" ? i.delete(t) : n === "clear" && i.clear(), (s || this.element).dataset[ae] = Array.from(i).join(" ");
|
|
2655
2696
|
}
|
|
2656
2697
|
getActiveEffects() {
|
|
2657
2698
|
const n = (this.element.dataset[ae] || "").trim();
|
|
@@ -2665,34 +2706,34 @@ class us {
|
|
|
2665
2706
|
}
|
|
2666
2707
|
}
|
|
2667
2708
|
_childListChangeHandler(t, n) {
|
|
2668
|
-
const s = this.key || this.element.dataset.interactKey,
|
|
2709
|
+
const s = this.key || this.element.dataset.interactKey, r = [], i = [];
|
|
2669
2710
|
n.forEach((o) => {
|
|
2670
2711
|
o.removedNodes.forEach((c) => {
|
|
2671
|
-
c instanceof HTMLElement && i.push(c);
|
|
2672
|
-
}), o.addedNodes.forEach((c) => {
|
|
2673
2712
|
c instanceof HTMLElement && r.push(c);
|
|
2713
|
+
}), o.addedNodes.forEach((c) => {
|
|
2714
|
+
c instanceof HTMLElement && i.push(c);
|
|
2674
2715
|
});
|
|
2675
|
-
}), nt(
|
|
2716
|
+
}), nt(r), s && fs(this, t, i);
|
|
2676
2717
|
}
|
|
2677
2718
|
}
|
|
2678
2719
|
function gs(e, t) {
|
|
2679
2720
|
new us(e, t).connect();
|
|
2680
2721
|
}
|
|
2681
2722
|
function vs(e) {
|
|
2682
|
-
const t =
|
|
2723
|
+
const t = E.getController(e);
|
|
2683
2724
|
t && t.disconnect({ removeFromCache: !0 });
|
|
2684
2725
|
}
|
|
2685
2726
|
const ds = (e, t, n, s) => {
|
|
2686
|
-
let
|
|
2727
|
+
let i = `[data-interact-key="${e.replace(/"/g, "'")}"]`;
|
|
2687
2728
|
const o = H(t, { asCombinator: !0, useFirstChild: s });
|
|
2688
|
-
return o && (
|
|
2729
|
+
return o && (i = `${i} ${o}`), n && (i = Q(i, n)), i;
|
|
2689
2730
|
};
|
|
2690
2731
|
function ys(e, t = !1) {
|
|
2691
2732
|
const n = [], s = /* @__PURE__ */ new Set();
|
|
2692
2733
|
return e.interactions.forEach(
|
|
2693
2734
|
({
|
|
2694
|
-
key:
|
|
2695
|
-
selector:
|
|
2735
|
+
key: r,
|
|
2736
|
+
selector: i,
|
|
2696
2737
|
listContainer: o,
|
|
2697
2738
|
listItemSelector: c,
|
|
2698
2739
|
trigger: u,
|
|
@@ -2706,21 +2747,21 @@ function ys(e, t = !1) {
|
|
|
2706
2747
|
const p = h?.effectId && e.effects[h.effectId] || h, {
|
|
2707
2748
|
key: y,
|
|
2708
2749
|
selector: v,
|
|
2709
|
-
listContainer:
|
|
2750
|
+
listContainer: w,
|
|
2710
2751
|
listItemSelector: b,
|
|
2711
2752
|
conditions: S
|
|
2712
2753
|
} = p;
|
|
2713
|
-
if (!(!y || y ===
|
|
2714
|
-
const ye = e.conditions || {}, Ee =
|
|
2754
|
+
if (!(!y || y === r) || !(!v && !i || v === i) || !(!w && !o || w === o) || !(!b && !c || b === c)) return;
|
|
2755
|
+
const ye = e.conditions || {}, Ee = L(
|
|
2715
2756
|
S,
|
|
2716
2757
|
ye
|
|
2717
|
-
), se =
|
|
2758
|
+
), se = L(
|
|
2718
2759
|
l,
|
|
2719
2760
|
ye
|
|
2720
2761
|
);
|
|
2721
2762
|
if (!(!Ee && !se || Ee === se)) return;
|
|
2722
2763
|
const ie = ds(
|
|
2723
|
-
|
|
2764
|
+
r,
|
|
2724
2765
|
p,
|
|
2725
2766
|
se,
|
|
2726
2767
|
t
|
|
@@ -2742,9 +2783,9 @@ function ys(e, t = !1) {
|
|
|
2742
2783
|
}
|
|
2743
2784
|
export {
|
|
2744
2785
|
us as I,
|
|
2745
|
-
|
|
2786
|
+
E as a,
|
|
2746
2787
|
gs as b,
|
|
2747
2788
|
ys as g,
|
|
2748
2789
|
vs as r
|
|
2749
2790
|
};
|
|
2750
|
-
//# sourceMappingURL=index-
|
|
2791
|
+
//# sourceMappingURL=index-BtEG0cjF.mjs.map
|