@luna-park/plugin-motion 1.0.5 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2639 @@
1
+ import { defineComponent as e, h as t, reactive as n, ref as r, watchEffect as i } from "vue";
2
+ //#region node_modules/.pnpm/animejs@4.5.0/node_modules/animejs/dist/modules/core/consts.js
3
+ var a = typeof window < "u", o = a ? window : null, s = a ? document : null, c = {
4
+ OBJECT: 0,
5
+ ATTRIBUTE: 1,
6
+ CSS: 2,
7
+ TRANSFORM: 3,
8
+ CSS_VAR: 4
9
+ }, l = {
10
+ NUMBER: 0,
11
+ UNIT: 1,
12
+ COLOR: 2,
13
+ COMPLEX: 3
14
+ }, u = {
15
+ NONE: 0,
16
+ AUTO: 1,
17
+ FORCE: 2
18
+ }, d = {
19
+ replace: 0,
20
+ none: 1,
21
+ blend: 2
22
+ }, f = Symbol(), p = Symbol(), m = Symbol(), h = Symbol(), g = Symbol(), _ = 1e-11, v = 0xe8d4a51000, y = 1e3, b = [], x = /*#__PURE__*/ (() => {
23
+ let e = /* @__PURE__ */ new Map();
24
+ return e.set("x", "translateX"), e.set("y", "translateY"), e.set("z", "translateZ"), e;
25
+ })(), S = [
26
+ "perspective",
27
+ "translateX",
28
+ "translateY",
29
+ "translateZ",
30
+ "rotate",
31
+ "rotateX",
32
+ "rotateY",
33
+ "rotateZ",
34
+ "scale",
35
+ "scaleX",
36
+ "scaleY",
37
+ "scaleZ",
38
+ "skew",
39
+ "skewX",
40
+ "skewY"
41
+ ], C = /*#__PURE__*/ S.reduce((e, t) => ({
42
+ ...e,
43
+ [t]: t + "("
44
+ }), {}), w = () => {}, T = (e) => e, E = /\)\s*[-.\d]/, D = /(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i, O = /rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i, ee = /rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i, k = /hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i, te = /hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i, ne = /[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi, A = /^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i, j = /([a-z])([A-Z])/g, M = /(\*=|\+=|-=)/, N = /var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/, P = {
45
+ id: null,
46
+ keyframes: null,
47
+ playbackEase: null,
48
+ playbackRate: 1,
49
+ frameRate: 240,
50
+ loop: 0,
51
+ reversed: !1,
52
+ alternate: !1,
53
+ autoplay: !0,
54
+ persist: !1,
55
+ duration: y,
56
+ delay: 0,
57
+ loopDelay: 0,
58
+ ease: "out(2)",
59
+ composition: d.replace,
60
+ modifier: T,
61
+ onBegin: w,
62
+ onBeforeUpdate: w,
63
+ onUpdate: w,
64
+ onLoop: w,
65
+ onPause: w,
66
+ onComplete: w,
67
+ onRender: w
68
+ }, F = {
69
+ current: null,
70
+ root: s
71
+ }, I = {
72
+ defaults: P,
73
+ precision: 4,
74
+ timeScale: 1,
75
+ tickThreshold: 200,
76
+ editor: null
77
+ }, re = {
78
+ version: "4.5.0",
79
+ engine: null
80
+ };
81
+ a && (o.AnimeJS ||= [], o.AnimeJS.push(re));
82
+ //#endregion
83
+ //#region node_modules/.pnpm/animejs@4.5.0/node_modules/animejs/dist/modules/core/helpers.js
84
+ var ie = (e) => e.replace(j, "$1-$2").toLowerCase(), L = (e, t) => e.indexOf(t) === 0, ae = Date.now, oe = Array.isArray, se = (e) => e && e.constructor === Object, R = (e) => typeof e == "number" && !isNaN(e), z = (e) => typeof e == "string", B = (e) => typeof e == "function", V = (e) => e === void 0, ce = (e) => V(e) || e === null, le = (e) => a && e instanceof SVGElement, ue = (e) => D.test(e), de = (e) => L(e, "rgb"), fe = (e) => L(e, "hsl"), H = (e) => ue(e) || (de(e) || fe(e)) && (e[e.length - 1] === ")" || !E.test(e)), pe = (e) => !I.defaults.hasOwnProperty(e), me = [
85
+ "opacity",
86
+ "rotate",
87
+ "overflow",
88
+ "color"
89
+ ], he = (e, t) => {
90
+ if (me.includes(t)) return !1;
91
+ if (e.getAttribute(t) || t in e) {
92
+ if (t === "scale") {
93
+ let t = e.parentNode;
94
+ return t && t.tagName === "filter";
95
+ }
96
+ return !0;
97
+ }
98
+ }, ge = (e) => z(e) ? parseFloat(e) : e, _e = Math.pow, ve = Math.sqrt, U = Math.sin, ye = Math.cos, be = Math.abs, xe = Math.floor, Se = Math.asin, Ce = Math.PI, we = Math.round, W = (e, t, n) => e < t ? t : e > n ? n : e, G = (e, t) => {
99
+ if (t < 0) return e;
100
+ if (!t) return we(e);
101
+ let n = 10 ** t;
102
+ return we(e * n) / n;
103
+ }, Te = (e, t, n) => n === 1 ? t : n === 0 ? e : e + (t - e) * n, Ee = (e) => e === Infinity ? v : e === -Infinity ? -v : e, De = (e) => e <= 1e-11 ? _ : Ee(G(e, 11)), K = (e) => oe(e) ? [...e] : e, Oe = (e, t) => {
104
+ let n = { ...e };
105
+ for (let r in t) {
106
+ let i = e[r];
107
+ n[r] = V(i) ? t[r] : i;
108
+ }
109
+ return n;
110
+ }, q = (e, t, n, r = "_prev", i = "_next") => {
111
+ let a = e._head, o = i;
112
+ for (n && (a = e._tail, o = r); a;) {
113
+ let e = a[o];
114
+ t(a), a = e;
115
+ }
116
+ }, ke = (e, t, n = "_prev", r = "_next") => {
117
+ let i = t[n], a = t[r];
118
+ i ? i[r] = a : e._head = a, a ? a[n] = i : e._tail = i, t[n] = null, t[r] = null;
119
+ }, Ae = (e, t, n, r = "_prev", i = "_next") => {
120
+ let a = e._tail;
121
+ for (; a && n && n(a, t);) a = a[r];
122
+ let o = a ? a[i] : e._head;
123
+ a ? a[i] = t : e._head = t, o ? o[r] = t : e._tail = t, t[r] = a, t[i] = o;
124
+ }, je = (e, t, n) => {
125
+ let r = e.style.transform;
126
+ if (r) {
127
+ let i = e[h], a = 0, o = r.length, s;
128
+ for (; a < o;) {
129
+ for (; a < o && r.charCodeAt(a) === 32;) a++;
130
+ if (a >= o) break;
131
+ let e = a;
132
+ for (; a < o && r.charCodeAt(a) !== 40;) a++;
133
+ if (a >= o) break;
134
+ let t = r.substring(e, a), n = 1, c = a + 1, l = -1, u = -1;
135
+ for (a++; a < o && n > 0;) {
136
+ let e = r.charCodeAt(a);
137
+ e === 40 ? n++ : e === 41 ? n-- : e === 44 && n === 1 && (l === -1 ? l = a : u === -1 && (u = a)), a++;
138
+ }
139
+ let d = a - 1;
140
+ t === "translate" || t === "translate3d" ? (l === -1 ? i.translateX = r.substring(c, d).trim() : (i.translateX = r.substring(c, l).trim(), u === -1 ? i.translateY = r.substring(l + 1, d).trim() : (i.translateY = r.substring(l + 1, u).trim(), i.translateZ = r.substring(u + 1, d).trim())), s = r.substring(c, d)) : t === "scale" || t === "scale3d" ? l === -1 ? i.scale = r.substring(c, d).trim() : (i.scaleX = r.substring(c, l).trim(), u === -1 ? i.scaleY = r.substring(l + 1, d).trim() : (i.scaleY = r.substring(l + 1, u).trim(), i.scaleZ = r.substring(u + 1, d).trim())) : i[t] = r.substring(c, d);
141
+ }
142
+ if (t === "translate3d" && s) return n && (n[t] = s), s;
143
+ let c = i[t];
144
+ if (!V(c)) return n && (n[t] = c), c;
145
+ }
146
+ return t === "translate3d" ? "0px, 0px, 0px" : t === "rotate3d" ? "0, 0, 0, 0deg" : L(t, "scale") ? "1" : L(t, "rotate") || L(t, "skew") ? "0deg" : "0px";
147
+ }, Me = (e) => {
148
+ let t = "";
149
+ for (let n = 0, r = S.length; n < r; n++) {
150
+ let r = S[n], i = e[r];
151
+ if (i !== void 0) {
152
+ if (r === "translateX") {
153
+ let r = e.translateY;
154
+ if (r !== void 0) {
155
+ let a = e.translateZ;
156
+ a === void 0 ? (t += `translate(${i},${r}) `, n += 1) : (t += `translate3d(${i},${r},${a}) `, n += 2);
157
+ continue;
158
+ }
159
+ }
160
+ if (r === "scaleX" && e.scale === void 0) {
161
+ let r = e.scaleY;
162
+ if (r !== void 0) {
163
+ let a = e.scaleZ;
164
+ a === void 0 ? (t += `scale(${i},${r}) `, n += 1) : (t += `scale3d(${i},${r},${a}) `, n += 2);
165
+ continue;
166
+ }
167
+ }
168
+ t += `${C[r]}${i}) `;
169
+ }
170
+ r === "rotateZ" && e.rotate3d !== void 0 && (t += `rotate3d(${e.rotate3d}) `);
171
+ }
172
+ return e.matrix !== void 0 && (t += `matrix(${e.matrix}) `), e.matrix3d !== void 0 && (t += `matrix3d(${e.matrix3d}) `), t;
173
+ }, Ne = [];
174
+ function Pe(e, t) {
175
+ if (!e) return null;
176
+ let n = Ne.length;
177
+ outer: for (let r = 0; r < n; r++) {
178
+ let n = Ne[r];
179
+ if (n.detect && !n.detect(e)) continue;
180
+ let i = n.targetAdapters;
181
+ for (let n = 0, r = i.length; n < r; n++) {
182
+ let r = i[n];
183
+ if (r.detect(e)) {
184
+ let n = r.props[t];
185
+ if (n && (!n.gate || n.gate(e))) return n;
186
+ break outer;
187
+ }
188
+ }
189
+ }
190
+ for (let r = 0; r < n; r++) {
191
+ let n = Ne[r];
192
+ if (n.detect && !n.detect(e)) continue;
193
+ let i = n.propertyResolvers;
194
+ for (let n = 0, r = i.length; n < r; n++) {
195
+ let r = i[n](e, t);
196
+ if (r) return r;
197
+ }
198
+ }
199
+ return null;
200
+ }
201
+ //#endregion
202
+ //#region node_modules/.pnpm/animejs@4.5.0/node_modules/animejs/dist/modules/core/colors.js
203
+ var Fe = (e) => {
204
+ let t = O.exec(e) || ee.exec(e), n = V(t[4]) ? 1 : +t[4];
205
+ return [
206
+ +t[1],
207
+ +t[2],
208
+ +t[3],
209
+ n
210
+ ];
211
+ }, Ie = (e) => {
212
+ let t = e.length, n = t === 4 || t === 5;
213
+ return [
214
+ +("0x" + e[1] + e[n ? 1 : 2]),
215
+ +("0x" + e[n ? 2 : 3] + e[n ? 2 : 4]),
216
+ +("0x" + e[n ? 3 : 5] + e[n ? 3 : 6]),
217
+ t === 5 || t === 9 ? +(("0x" + e[n ? 4 : 7] + e[n ? 4 : 8]) / 255).toFixed(3) : 1
218
+ ];
219
+ }, Le = (e, t, n) => (n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e), Re = (e) => {
220
+ let t = k.exec(e) || te.exec(e), n = t[1] / 360, r = t[2] / 100, i = t[3] / 100, a = V(t[4]) ? 1 : +t[4], o, s, c;
221
+ if (r === 0) o = s = c = i;
222
+ else {
223
+ let e = i < .5 ? i * (1 + r) : i + r - i * r, t = 2 * i - e;
224
+ o = G(Le(t, e, n + 1 / 3) * 255, 0), s = G(Le(t, e, n) * 255, 0), c = G(Le(t, e, n - 1 / 3) * 255, 0);
225
+ }
226
+ return [
227
+ o,
228
+ s,
229
+ c,
230
+ a
231
+ ];
232
+ }, ze = (e) => de(e) ? Fe(e) : ue(e) ? Ie(e) : fe(e) ? Re(e) : [
233
+ 0,
234
+ 0,
235
+ 0,
236
+ 1
237
+ ], J = (e, t) => V(e) ? t : e, Be = (e, t) => {
238
+ let n = e.match(N), r = t[p] ? t : document.documentElement, i = getComputedStyle(r)?.getPropertyValue(n[1]);
239
+ return (!i || i.trim() === "") && n[2] && (i = n[2].trim()), i || 0;
240
+ }, Ve = (e, t, n, r, i, a) => {
241
+ if (B(e)) {
242
+ if (!i) {
243
+ let i = e(t, n, r, a);
244
+ return isNaN(+i) ? i || 0 : +i;
245
+ }
246
+ let o = () => {
247
+ let i = e(t, n, r, a);
248
+ return isNaN(+i) ? i || 0 : +i;
249
+ };
250
+ return i.func = o, o();
251
+ }
252
+ if (z(e) && L(e, "var(")) {
253
+ if (!i) return Be(e, t);
254
+ let n = () => Be(e, t);
255
+ return i.func = n, n();
256
+ }
257
+ return e;
258
+ }, He = (e, t) => e[p] ? e[m] && he(e, t) ? c.ATTRIBUTE : S.includes(t) || x.get(t) ? c.TRANSFORM : L(t, "--") ? c.CSS_VAR : t in e.style ? c.CSS : t in e ? c.OBJECT : c.ATTRIBUTE : c.OBJECT, Ue = (e, t, n) => {
259
+ let r = e.style[t];
260
+ r && n && (n[t] = r);
261
+ let i = r || getComputedStyle(e[g] || e).getPropertyValue(t);
262
+ return i === "auto" ? "0" : i;
263
+ }, We = (e, t, n, r) => {
264
+ let i = V(n) ? He(e, t) : n, a = Pe(e, t);
265
+ if (a) {
266
+ let n = a.get(e);
267
+ return n && r && (r[t] = n), n ?? 0;
268
+ }
269
+ if (i === c.OBJECT) {
270
+ let n = e[t];
271
+ return n && r && (r[t] = n), n || 0;
272
+ }
273
+ if (i === c.ATTRIBUTE) {
274
+ let n = e.getAttribute(t);
275
+ return n && r && (r[t] = n), n;
276
+ }
277
+ return i === c.TRANSFORM ? je(e, t, r) : i === c.CSS_VAR ? Ue(e, t, r).trimStart() : Ue(e, t, r);
278
+ }, Ge = (e, t, n) => n === "-" ? e - t : n === "+" ? e + t : e * t, Ke = () => ({
279
+ t: l.NUMBER,
280
+ n: 0,
281
+ u: null,
282
+ o: null,
283
+ d: null,
284
+ s: null
285
+ }), Y = (e, t) => {
286
+ if (t.t = l.NUMBER, t.n = 0, t.u = null, t.o = null, t.d = null, t.s = null, !e) return t;
287
+ let n = +e;
288
+ if (!isNaN(n)) return t.n = n, t;
289
+ let r = e;
290
+ r[1] === "=" && (t.o = r[0], r = r.slice(2));
291
+ let i = !r.includes(" ") && A.exec(r);
292
+ if (i) return t.t = l.UNIT, t.n = +i[1], t.u = i[2], t;
293
+ if (t.o) return t.n = +r, t;
294
+ if (H(r)) return t.t = l.COLOR, t.d = ze(r), t;
295
+ {
296
+ let e = r.match(ne);
297
+ return t.t = l.COMPLEX, t.d = e ? e.map(Number) : [], t.s = r.split(ne) || [], t;
298
+ }
299
+ }, qe = (e, t) => (t.t = e._valueType, t.n = e._toNumber, t.u = e._unit, t.o = null, t.d = K(e._toNumbers), t.s = K(e._strings), t), X = Ke(), Je = (e, t, n) => {
300
+ let r = e._modifier, i = e._fromNumbers, a = e._toNumbers, o = e._strings, s = o[0];
301
+ for (let c = 0, l = a.length; c < l; c++) {
302
+ let l = r(G(Te(i[c], a[c], t), n)), u = o[c + 1];
303
+ s += `${u ? l + u : l}`, e._numbers[c] = l;
304
+ }
305
+ return s;
306
+ }, Ye = (e, t, n, r, i) => {
307
+ let a = e.parent, o = e.duration, s = e.completed, f = e.iterationDuration, p = e.iterationCount, m = e._currentIteration, g = e._loopDelay, v = e._reversed, y = e._alternate, b = e._hasChildren, x = e._delay, S = e._currentTime, C = x + f, w = t - x, T = W(S, -x, o), E = W(w, -x, o), D = w - S, O = E > 0, ee = E >= o, k = o <= _, te = i === u.FORCE, ne = 0, A = w, j = 0;
308
+ if (p > 1) {
309
+ let t = f + (ee ? 0 : g), n = ~~(E / t);
310
+ e._currentIteration = W(n, 0, p), ee && e._currentIteration--, ne = e._currentIteration % 2, A = E - n * t || 0;
311
+ }
312
+ let M = v ^ (y && ne), N = e._ease, P = ee ? M ? 0 : o : M ? f - A : A;
313
+ N && (P = f * N(P / f) || 0);
314
+ let F = (a ? a.backwards : w < S) ? !M : !!M;
315
+ if (e._currentTime = w, e._iterationTime = P, e.backwards = F, O && !e.began ? (e.began = !0, !n && (!a || !F && a.began) && e.onBegin(e)) : w <= 0 && (e.began = !1), !n && !b && O && e._currentIteration !== m && e.onLoop(e), te || i === u.AUTO && (t >= (a && x > 0 ? 0 : x) && t <= C || t <= x && T > x || t >= C && T !== o) || P >= C && T !== o || P <= x && T > 0 && !ee || t <= T && T === o && s || ee && !s && k) {
316
+ if (O && (e.computeDeltaTime(T), n || e.onBeforeUpdate(e)), !b) {
317
+ let t = te || (F ? D * -1 : D) >= I.tickThreshold, i = G(e._offset + (a ? a._offset : 0) + x + P, 12), o = e._head, s, u, f, p, m = 0;
318
+ for (; o;) {
319
+ let e = o._composition, n = o._currentTime, a = o._changeDuration, g = o._absoluteStartTime + o._changeDuration, _ = o._nextRep, v = o._prevRep, y = e !== d.none, b = v ? v._absoluteStartTime + v._changeDuration : 0, x = v && v.parent !== o.parent, S = !_ || _._isOverridden ? g : _.parent === o.parent ? g + _._delay : _._absoluteStartTime < _._absoluteUpdateStartTime ? _._absoluteStartTime : _._absoluteUpdateStartTime;
320
+ if ((t || (n !== a || i <= S || v && !x && (!_ || _.parent !== o.parent)) && (n !== 0 || i >= o._absoluteStartTime || x && !o._hasFromValue && !v._isOverridden && i >= b || _ && !_._isOverridden && _.parent === o.parent && _._currentTime !== 0 && P < _._startTime)) && (!v || x || P >= o._startTime) && (!y || !o._isOverridden && (!o._isOverlapped || i <= g) && (!_ || _._isOverridden || i <= S) && (!v || v._isOverridden || (x ? i >= o._absoluteStartTime || !o._hasFromValue && i >= b : i >= b + o._delay)))) {
321
+ let t = o._currentTime = W(P - o._startTime, 0, a), n = o._ease(t / o._updateDuration), i = o._modifier, g = o._valueType, _ = o._tweenType, v = _ === c.OBJECT, b = g === l.NUMBER, x = b && v || n === 0 || n === 1 ? -1 : I.precision, S, C;
322
+ if (b) S = C = i(G(Te(o._fromNumber, o._toNumber, n), x));
323
+ else if (g === l.UNIT) C = i(G(Te(o._fromNumber, o._toNumber, n), x)), S = `${C}${o._unit}`;
324
+ else if (g === l.COLOR) {
325
+ let e = o._numbers, t = o._fromNumbers, a = o._toNumbers, s = 1 - n, c = t[0], l = t[1], u = t[2], d = a[0], f = a[1], p = a[2];
326
+ e[0] = i(Math.sqrt(c * c * s + d * d * n)), e[1] = i(Math.sqrt(l * l * s + f * f * n)), e[2] = i(Math.sqrt(u * u * s + p * p * n)), e[3] = i(Te(t[3], a[3], n)), (!o._setter || r) && (S = `rgba(${G(e[0], 0)},${G(e[1], 0)},${G(e[2], 0)},${e[3]})`);
327
+ } else g === l.COMPLEX && (S = Je(o, n, x));
328
+ if (y && (o._number = C), !r && e !== d.blend) {
329
+ let e = o.property;
330
+ s = o.target, o._setter ? o._setter(s, C, o) : v ? s[e] = S : _ === c.ATTRIBUTE ? s.setAttribute(e, S) : (u = s.style, _ === c.TRANSFORM ? (s !== f && (f = s, p = s[h]), p[e] = S, m = 1) : _ === c.CSS ? u[e] = S : _ === c.CSS_VAR && u.setProperty(e, S)), O && (j = 1);
331
+ } else o._value = S;
332
+ } else n && v && !x && P < o._startTime && (o._currentTime = 0);
333
+ m && o._renderTransforms && (u.transform = Me(p), m = 0), o = o._next;
334
+ }
335
+ !n && j && e.onRender(e);
336
+ }
337
+ !n && O && e.onUpdate(e);
338
+ }
339
+ return a && k ? !n && (a.began && !F && w > 0 && !s || F && w <= 1e-11 && s) && (e.onComplete(e), e.completed = !F) : O && ee ? p === Infinity ? e._startTime += e.duration : e._currentIteration >= p - 1 && (e.paused = !0, !s && !b && (e.completed = !0, !n && (!a || !F && a.began) && (e.onComplete(e), e._resolve(e)))) : e.completed = !1, j;
340
+ }, Xe = (e, t, n, r, i) => {
341
+ let a = e._currentIteration;
342
+ if (Ye(e, t, n, r, i), e._hasChildren) {
343
+ let o = e, s = o.backwards, c = r ? t : o._iterationTime, l = ae(), d = 0, f = !0;
344
+ if (!r && o._currentIteration !== a) {
345
+ let e = o.iterationDuration;
346
+ q(o, (t) => {
347
+ if (!s) !t.completed && !t.backwards && t._currentTime < t.iterationDuration && Ye(t, e, n, 1, u.FORCE), t.began = !1, t.completed = !1;
348
+ else {
349
+ let r = t.duration, i = t._offset + t._delay, a = i + r;
350
+ !n && r <= 1e-11 && (!i || a === e) && t.onComplete(t);
351
+ }
352
+ }), n || o.onLoop(o);
353
+ }
354
+ q(o, (e) => {
355
+ let t = G((c - e._offset) * e._speed, 12);
356
+ if (s && t > e._delay + e.duration) return;
357
+ let a = e._fps < o._fps ? e.requestTick(l) : i;
358
+ d += Ye(e, t, n, r, a), !e.completed && f && (f = !1);
359
+ }, s), !n && d && o.onRender(o), (f || s) && o._currentTime >= o.duration && (o.paused = !0, o.completed || (o.completed = !0, n || (o.onComplete(o), o._resolve(o))));
360
+ }
361
+ }, Ze = {}, Qe = (e, t, n) => {
362
+ if (n === c.TRANSFORM) return x.get(e) || e;
363
+ if (n === c.CSS || n === c.ATTRIBUTE && le(t) && e in t.style) {
364
+ let t = Ze[e];
365
+ if (t) return t;
366
+ {
367
+ let t = e && ie(e);
368
+ return Ze[e] = t, t;
369
+ }
370
+ }
371
+ return e;
372
+ }, $e = (e, t = !1) => {
373
+ if (e._hasChildren) q(e, (e) => $e(e, t), !0);
374
+ else {
375
+ let n = e;
376
+ n.pause(), q(n, (e) => {
377
+ let r = e.property, i = e.target, a = e._tweenType, o = e._inlineValue, s = ce(o) || o === "";
378
+ if (e._setter) {
379
+ if (!t && !s) {
380
+ if (Y(o, X), X.d) {
381
+ let t = X.d, n = e._numbers;
382
+ for (let e = 0, r = t.length; e < r; e++) n[e] = t[e];
383
+ } else e._number = X.n;
384
+ e._setter(e.target, e._number, e);
385
+ }
386
+ } else if (a === c.OBJECT) !t && !s && (i[r] = o);
387
+ else if (i[p]) {
388
+ if (a === c.ATTRIBUTE) t || (s ? i.removeAttribute(r) : i.setAttribute(r, o));
389
+ else {
390
+ let t = i.style;
391
+ if (a === c.TRANSFORM) {
392
+ let n = i[h];
393
+ s ? delete n[r] : n[r] = o, e._renderTransforms && (Object.keys(n).length ? t.transform = Me(n) : t.removeProperty("transform"));
394
+ } else s ? t.removeProperty(ie(r)) : t[r] = o;
395
+ }
396
+ }
397
+ i[p] && n._tail === e && n.targets.forEach((e) => {
398
+ e.getAttribute && e.getAttribute("style") === "" && e.removeAttribute("style");
399
+ });
400
+ });
401
+ }
402
+ return e;
403
+ }, et = class {
404
+ constructor(e = 0) {
405
+ this.deltaTime = 0, this._currentTime = e, this._lastTickTime = e, this._startTime = e, this._lastTime = e, this._frameDuration = y / 240, this._fps = 240, this._speed = 1, this._hasChildren = !1, this._head = null, this._tail = null;
406
+ }
407
+ get fps() {
408
+ return this._fps;
409
+ }
410
+ set fps(e) {
411
+ let t = +e, n = t < 1e-11 ? _ : t, r = y / n;
412
+ n > P.frameRate && (P.frameRate = n), this._fps = n, this._frameDuration = r;
413
+ }
414
+ get speed() {
415
+ return this._speed;
416
+ }
417
+ set speed(e) {
418
+ let t = +e;
419
+ this._speed = t < 1e-11 ? _ : t;
420
+ }
421
+ requestTick(e) {
422
+ let t = this._frameDuration, n = e - this._lastTickTime, r = t * .25;
423
+ return n + (r < 4 ? r : 4) < t ? u.NONE : (this._lastTickTime = n >= t ? e - n % t : e, u.AUTO);
424
+ }
425
+ computeDeltaTime(e) {
426
+ let t = e - this._lastTime;
427
+ return this.deltaTime = t, this._lastTime = e, t;
428
+ }
429
+ }, tt = {
430
+ animation: null,
431
+ update: w
432
+ }, nt = (e) => {
433
+ let t = tt.animation;
434
+ return t || (t = {
435
+ duration: _,
436
+ computeDeltaTime: w,
437
+ _offset: 0,
438
+ _delay: 0,
439
+ _head: null,
440
+ _tail: null
441
+ }, tt.animation = t, tt.update = () => {
442
+ e.forEach((e) => {
443
+ for (let t in e) {
444
+ let n = e[t], r = n._head;
445
+ if (r) {
446
+ let e = r._valueType, t = e === l.COMPLEX || e === l.COLOR ? K(r._fromNumbers) : null, i = r._fromNumber, a = n._tail;
447
+ for (; a && a !== r;) {
448
+ if (t) for (let e = 0, n = a._numbers.length; e < n; e++) t[e] += a._numbers[e];
449
+ else i += a._number;
450
+ a = a._prevAdd;
451
+ }
452
+ r._toNumber = i, r._toNumbers = t;
453
+ }
454
+ }
455
+ }), Ye(t, 1, 1, 0, u.FORCE);
456
+ }), t;
457
+ }, rt = a ? requestAnimationFrame : setImmediate, it = a ? cancelAnimationFrame : clearImmediate, at = class extends et {
458
+ constructor(e) {
459
+ super(e), this.useDefaultMainLoop = !0, this.pauseOnDocumentHidden = !0, this.defaults = P, this.paused = !0, this.reqId = 0;
460
+ }
461
+ update() {
462
+ let e = this._currentTime = ae();
463
+ if (this.requestTick(e)) {
464
+ this.computeDeltaTime(e);
465
+ let t = this._speed, n = this._fps, r = this._head;
466
+ for (; r;) {
467
+ let i = r._next;
468
+ r.paused ? (ke(this, r), this._hasChildren = !!this._tail, r._running = !1, r.completed && !r._cancelled && r.cancel()) : Xe(r, (e - r._startTime) * r._speed * t, 0, 0, r._fps < n ? r.requestTick(e) : u.AUTO), r = i;
469
+ }
470
+ tt.update();
471
+ }
472
+ }
473
+ wake() {
474
+ return this.useDefaultMainLoop && !this.reqId && (this.requestTick(ae()), this.reqId = rt(ot)), this;
475
+ }
476
+ pause() {
477
+ if (this.reqId) return this.paused = !0, st();
478
+ }
479
+ resume() {
480
+ if (this.paused) return this.paused = !1, q(this, (e) => e.resetTime()), this.wake();
481
+ }
482
+ get speed() {
483
+ return this._speed * (I.timeScale === 1 ? 1 : y);
484
+ }
485
+ set speed(e) {
486
+ let t = e * I.timeScale;
487
+ this._speed !== t && (this._speed = t, q(this, (e) => e.speed = e._speed));
488
+ }
489
+ get timeUnit() {
490
+ return I.timeScale === 1 ? "ms" : "s";
491
+ }
492
+ set timeUnit(e) {
493
+ let t = .001, n = e === "s", r = n ? t : 1;
494
+ if (I.timeScale !== r) {
495
+ I.timeScale = r, I.tickThreshold = 200 * r;
496
+ let e = n ? t : y;
497
+ this.defaults.duration *= e, this._speed *= e;
498
+ }
499
+ }
500
+ get precision() {
501
+ return I.precision;
502
+ }
503
+ set precision(e) {
504
+ I.precision = e;
505
+ }
506
+ }, Z = /*#__PURE__*/ (() => {
507
+ let e = new at(ae());
508
+ return a && (re.engine = e, s.addEventListener("visibilitychange", () => {
509
+ e.pauseOnDocumentHidden && (s.hidden ? e.pause() : e.resume());
510
+ })), e;
511
+ })(), ot = () => {
512
+ Z._head ? (Z.reqId = rt(ot), Z.update()) : Z.reqId = 0;
513
+ }, st = () => (it(Z.reqId), Z.reqId = 0, Z), ct = {
514
+ _rep: /* @__PURE__ */ new WeakMap(),
515
+ _add: /* @__PURE__ */ new Map()
516
+ }, lt = (e, t, n = "_rep") => {
517
+ let r = ct[n], i = r.get(e);
518
+ return i || (i = {}, r.set(e, i)), i[t] ? i[t] : i[t] = {
519
+ _head: null,
520
+ _tail: null
521
+ };
522
+ }, ut = (e, t) => e._isOverridden || e._absoluteStartTime > t._absoluteStartTime, dt = (e) => {
523
+ e._isOverlapped = 1, e._isOverridden = 1, e._changeDuration = _, e._currentTime = _;
524
+ }, ft = (e, t) => {
525
+ let n = e._composition;
526
+ if (n === d.replace) {
527
+ let n = e._absoluteStartTime;
528
+ Ae(t, e, ut, "_prevRep", "_nextRep");
529
+ let r = e._prevRep;
530
+ if (r) {
531
+ let t = r.parent, i = r._absoluteEndTime;
532
+ if (e.parent.id !== t.id && t.iterationCount > 1 && i + (t.duration - t.iterationDuration) > n) {
533
+ dt(r);
534
+ let e = r._prevRep;
535
+ for (; e && e.parent.id === t.id;) dt(e), e = e._prevRep;
536
+ }
537
+ let a = e._absoluteUpdateStartTime;
538
+ if (i > a) {
539
+ let e = r._startTime, t = G(a - (i - (e + r._updateDuration)) - e, 12);
540
+ r._changeDuration = t, r._currentTime = t, r._isOverlapped = 1, t < 1e-11 && dt(r);
541
+ }
542
+ let o = e.parent.parent;
543
+ if (!o || o !== t.parent) {
544
+ let e = !0;
545
+ if (q(t, (t) => {
546
+ t._isOverlapped || (e = !1);
547
+ }), e) {
548
+ let e = t.parent;
549
+ if (e) {
550
+ let n = !0;
551
+ q(e, (e) => {
552
+ e !== t && q(e, (e) => {
553
+ e._isOverlapped || (n = !1);
554
+ });
555
+ }), n && e.cancel();
556
+ } else t.cancel();
557
+ }
558
+ }
559
+ }
560
+ } else if (n === d.blend) {
561
+ let t = lt(e.target, e.property, "_add"), n = nt(ct._add), r = t._head;
562
+ r || (r = { ...e }, r._composition = d.replace, r._updateDuration = _, r._startTime = 0, r._numbers = K(e._fromNumbers), r._number = 0, r._next = null, r._prev = null, Ae(t, r), Ae(n, r));
563
+ let i = e._toNumber;
564
+ if (e._fromNumber = r._fromNumber - i, e._toNumber = 0, e._numbers = K(e._fromNumbers), e._number = 0, r._fromNumber = i, e._toNumbers.length) {
565
+ let t = K(e._toNumbers);
566
+ t.forEach((t, n) => {
567
+ e._fromNumbers[n] = r._fromNumbers[n] - t, e._toNumbers[n] = 0;
568
+ }), r._fromNumbers = t;
569
+ }
570
+ Ae(t, e, null, "_prevAdd", "_nextAdd");
571
+ }
572
+ return e;
573
+ }, pt = (e) => {
574
+ let t = e._composition;
575
+ if (t !== d.none) {
576
+ let n = e.target, r = e.property, i = ct._rep.get(n)[r];
577
+ if (ke(i, e, "_prevRep", "_nextRep"), t === d.blend) {
578
+ let t = ct._add, i = t.get(n);
579
+ if (!i) return;
580
+ let a = i[r], o = tt.animation;
581
+ ke(a, e, "_prevAdd", "_nextAdd");
582
+ let s = a._head;
583
+ if (s && s === a._tail) {
584
+ ke(a, s, "_prevAdd", "_nextAdd"), ke(o, s);
585
+ let e = !0;
586
+ for (let t in i) if (i[t]._head) {
587
+ e = !1;
588
+ break;
589
+ }
590
+ e && t.delete(n);
591
+ }
592
+ }
593
+ }
594
+ return e;
595
+ }, mt = (e) => (e.paused = !0, e.began = !1, e.completed = !1, e), ht = (e) => e._cancelled ? (e._hasChildren ? q(e, ht) : q(e, (e) => {
596
+ e._composition !== d.none && ft(e, lt(e.target, e.property));
597
+ }), e._cancelled = 0, e) : e, gt = 0, _t = (e, t) => e._priority > t._priority, vt = class extends et {
598
+ constructor(e = {}, t = null, n = 0) {
599
+ super(0), ++gt;
600
+ let { id: r, delay: i, duration: a, reversed: o, alternate: s, loop: c, loopDelay: l, autoplay: u, frameRate: d, playbackRate: f, priority: p, onComplete: m, onLoop: h, onPause: g, onBegin: _, onBeforeUpdate: v, onUpdate: y } = e;
601
+ F.current && F.current.register(this);
602
+ let b = t ? 0 : Z._lastTickTime, x = t ? t.defaults : I.defaults, S = B(i) || V(i) ? x.delay : +i, C = B(a) || V(a) ? Infinity : +a, T = J(c, x.loop), E = J(l, x.loopDelay), D = T === !0 || T === Infinity || T < 0 ? Infinity : T + 1, O = 0;
603
+ t ? O = n : (Z.reqId || Z.requestTick(ae()), O = (Z._lastTickTime - Z._startTime) * I.timeScale), this.id = V(r) ? gt : r, this.parent = t, this.duration = Ee((C + E) * D - E) || 1e-11, this.backwards = !1, this.paused = !0, this.began = !1, this.completed = !1, this.onBegin = _ || x.onBegin, this.onBeforeUpdate = v || x.onBeforeUpdate, this.onUpdate = y || x.onUpdate, this.onLoop = h || x.onLoop, this.onPause = g || x.onPause, this.onComplete = m || x.onComplete, this.iterationDuration = C, this.iterationCount = D, this._autoplay = !t && J(u, x.autoplay), this._offset = O, this._delay = S, this._loopDelay = E, this._iterationTime = 0, this._currentIteration = 0, this._resolve = w, this._running = !1, this._reversed = +J(o, x.reversed), this._reverse = this._reversed, this._cancelled = 0, this._alternate = J(s, x.alternate), this._prev = null, this._next = null, this._lastTickTime = b, this._startTime = b, this._lastTime = b, this._fps = J(d, x.frameRate), this._speed = J(f, x.playbackRate), this._priority = +J(p, 1);
604
+ }
605
+ get cancelled() {
606
+ return !!this._cancelled;
607
+ }
608
+ set cancelled(e) {
609
+ e ? this.cancel() : this.reset(!0).play();
610
+ }
611
+ get currentTime() {
612
+ return W(G(this._currentTime, I.precision), -this._delay, this.duration);
613
+ }
614
+ set currentTime(e) {
615
+ let t = this.paused;
616
+ this.pause().seek(+e), t || this.resume();
617
+ }
618
+ get iterationCurrentTime() {
619
+ return W(G(this._iterationTime, I.precision), 0, this.iterationDuration);
620
+ }
621
+ set iterationCurrentTime(e) {
622
+ this.currentTime = this.iterationDuration * this._currentIteration + e;
623
+ }
624
+ get progress() {
625
+ return W(G(this._currentTime / this.duration, 10), 0, 1);
626
+ }
627
+ set progress(e) {
628
+ this.currentTime = this.duration * e;
629
+ }
630
+ get iterationProgress() {
631
+ return W(G(this._iterationTime / this.iterationDuration, 10), 0, 1);
632
+ }
633
+ set iterationProgress(e) {
634
+ let t = this.iterationDuration;
635
+ this.currentTime = t * this._currentIteration + t * e;
636
+ }
637
+ get currentIteration() {
638
+ return this._currentIteration;
639
+ }
640
+ set currentIteration(e) {
641
+ this.currentTime = this.iterationDuration * W(+e, 0, this.iterationCount - 1);
642
+ }
643
+ get reversed() {
644
+ return !!this._reversed;
645
+ }
646
+ set reversed(e) {
647
+ e ? this.reverse() : this.play();
648
+ }
649
+ get speed() {
650
+ return super.speed;
651
+ }
652
+ set speed(e) {
653
+ super.speed = e, this.resetTime();
654
+ }
655
+ reset(e = !1) {
656
+ return ht(this), this._reversed && !this._reverse && (this.reversed = !1), this._iterationTime = this.iterationDuration, Xe(this, 0, 1, ~~e, u.FORCE), mt(this), this._hasChildren && q(this, mt), this;
657
+ }
658
+ init(e = !1) {
659
+ this.fps = this._fps, this.speed = this._speed, !e && this._hasChildren && Xe(this, this.duration, 1, ~~e, u.FORCE), this.reset(e);
660
+ let t = this._autoplay;
661
+ return t === !0 ? this.resume() : t && !V(t.linked) && t.link(this), this;
662
+ }
663
+ resetTime() {
664
+ let e = 1 / (this._speed * Z._speed);
665
+ return this._startTime = ae() - (this._currentTime + this._delay) * e, this;
666
+ }
667
+ pause() {
668
+ return this.paused ? this : (this.paused = !0, this.onPause(this), this);
669
+ }
670
+ resume() {
671
+ return this.paused ? (this.paused = !1, this.duration <= 1e-11 && !this._hasChildren ? Xe(this, _, 0, 0, u.FORCE) : (this._running ||= (Ae(Z, this, _t), Z._hasChildren = !0, !0), this.resetTime(), this._startTime -= 12, Z.wake()), this) : this;
672
+ }
673
+ restart() {
674
+ return this.reset().resume();
675
+ }
676
+ seek(e, t = 0, n = 0) {
677
+ ht(this), this.completed = !1;
678
+ let r = this.paused;
679
+ return this.paused = !0, Xe(this, e + this._delay, ~~t, ~~n, u.AUTO), r ? this : this.resume();
680
+ }
681
+ alternate() {
682
+ let e = this._reversed, t = this.iterationCount, n = this.iterationDuration, r = t === Infinity ? xe(v / n) : t;
683
+ return this._reversed = +(this._alternate && !(r % 2) ? e : !e), t === Infinity ? this.iterationProgress = this._reversed ? 1 - this.iterationProgress : this.iterationProgress : this.seek(n * r - this._currentTime), this.resetTime(), this;
684
+ }
685
+ play() {
686
+ return this._reversed && this.alternate(), this.resume();
687
+ }
688
+ reverse() {
689
+ return this._reversed || this.alternate(), this.resume();
690
+ }
691
+ cancel() {
692
+ return this._hasChildren ? q(this, (e) => e.cancel(), !0) : q(this, pt), this._cancelled = 1, this.pause();
693
+ }
694
+ stretch(e) {
695
+ let t = this.duration, n = De(e);
696
+ if (t === n) return this;
697
+ let r = e / t, i = e <= _;
698
+ return this.duration = i ? _ : n, this.iterationDuration = i ? _ : De(this.iterationDuration * r), this._offset *= r, this._delay *= r, this._loopDelay *= r, this;
699
+ }
700
+ revert() {
701
+ Xe(this, 0, 1, 0, u.AUTO);
702
+ let e = this._autoplay;
703
+ return e && e.linked && e.linked === this && e.revert(), this.cancel();
704
+ }
705
+ complete(e = 0) {
706
+ return this.seek(this.duration, e).cancel();
707
+ }
708
+ then(e = w) {
709
+ let t = this.then, n = () => {
710
+ this.then = null, e(this), this.then = t, this._resolve = w;
711
+ };
712
+ return new Promise((e) => (this._resolve = () => e(n()), this.completed && this._resolve(), this));
713
+ }
714
+ };
715
+ //#endregion
716
+ //#region node_modules/.pnpm/animejs@4.5.0/node_modules/animejs/dist/modules/core/targets.js
717
+ function yt(e) {
718
+ let t = z(e) ? F.root.querySelectorAll(e) : e;
719
+ if (t instanceof NodeList || t instanceof HTMLCollection) return t;
720
+ }
721
+ function bt(e) {
722
+ if (ce(e)) return [];
723
+ if (!a) return oe(e) && e.flat(Infinity) || [e];
724
+ if (oe(e)) {
725
+ let t = e.flat(Infinity), n = [];
726
+ for (let e = 0, r = t.length; e < r; e++) {
727
+ let r = t[e];
728
+ if (!ce(r)) {
729
+ let e = yt(r);
730
+ if (e) for (let t = 0, r = e.length; t < r; t++) {
731
+ let r = e[t];
732
+ if (!ce(r)) {
733
+ let e = !1;
734
+ for (let t = 0, i = n.length; t < i; t++) if (n[t] === r) {
735
+ e = !0;
736
+ break;
737
+ }
738
+ e || n.push(r);
739
+ }
740
+ }
741
+ else {
742
+ let e = !1;
743
+ for (let t = 0, i = n.length; t < i; t++) if (n[t] === r) {
744
+ e = !0;
745
+ break;
746
+ }
747
+ e || n.push(r);
748
+ }
749
+ }
750
+ }
751
+ return n;
752
+ }
753
+ let t = yt(e);
754
+ return t ? Array.from(t) : [e];
755
+ }
756
+ function xt(e) {
757
+ let t = bt(e), n = t.length;
758
+ for (let e = 0; e < n; e++) {
759
+ let n = t[e];
760
+ if (!n[f]) {
761
+ n[f] = !0;
762
+ let e = le(n);
763
+ (n.nodeType || e) && (n[p] = !0, n[m] = e, n[h] = {});
764
+ }
765
+ }
766
+ return t;
767
+ }
768
+ //#endregion
769
+ //#region node_modules/.pnpm/animejs@4.5.0/node_modules/animejs/dist/modules/core/units.js
770
+ var St = {
771
+ deg: 1,
772
+ rad: 180 / Ce,
773
+ turn: 360
774
+ }, Ct = {}, wt = (e, t, n, r = !1) => {
775
+ let i = t.u, a = t.n;
776
+ if (t.t === l.UNIT && i === n) return t;
777
+ let o = a + i + n, c = Ct[o];
778
+ if (!V(c) && !r) t.n = c;
779
+ else {
780
+ let r;
781
+ if (i in St) r = a * St[i] / St[n];
782
+ else {
783
+ let t = e.cloneNode(), o = e.parentNode, c = o && o !== s ? o : s.body;
784
+ c.appendChild(t);
785
+ let l = t.style;
786
+ l.width = 100 + i;
787
+ let u = t.offsetWidth || 100;
788
+ l.width = 100 + n;
789
+ let d = u / (t.offsetWidth || 100);
790
+ c.removeChild(t), r = d * a;
791
+ }
792
+ t.n = r, Ct[o] = r;
793
+ }
794
+ return t.t, l.UNIT, t.u = n, t;
795
+ }, Tt = (e) => e, Et = (e = 1.68) => (t) => _e(t, +e), Dt = {
796
+ in: (e) => (t) => e(t),
797
+ out: (e) => (t) => 1 - e(1 - t),
798
+ inOut: (e) => (t) => t < .5 ? e(t * 2) / 2 : 1 - e(t * -2 + 2) / 2,
799
+ outIn: (e) => (t) => t < .5 ? (1 - e(1 - t * 2)) / 2 : (e(t * 2 - 1) + 1) / 2
800
+ }, Ot = Ce / 2, kt = Ce * 2, At = {
801
+ "": Et,
802
+ Quad: Et(2),
803
+ Cubic: Et(3),
804
+ Quart: Et(4),
805
+ Quint: Et(5),
806
+ Sine: (e) => 1 - ye(e * Ot),
807
+ Circ: (e) => 1 - ve(1 - e * e),
808
+ Expo: (e) => e ? _e(2, 10 * e - 10) : 0,
809
+ Bounce: (e) => {
810
+ let t, n = 4;
811
+ for (; e < ((t = _e(2, --n)) - 1) / 11;);
812
+ return 1 / _e(4, 3 - n) - 7.5625 * _e((t * 3 - 2) / 22 - e, 2);
813
+ },
814
+ Back: (e = 1.7) => (t) => (+e + 1) * t * t * t - +e * t * t,
815
+ Elastic: (e = 1, t = .3) => {
816
+ let n = W(+e, 1, 10), r = W(+t, _, 2), i = r / kt * Se(1 / n), a = kt / r;
817
+ return (e) => e === 0 || e === 1 ? e : -n * _e(2, -10 * (1 - e)) * U((1 - e - i) * a);
818
+ }
819
+ }, jt = /*#__PURE__ */ (() => {
820
+ let e = {
821
+ linear: Tt,
822
+ none: Tt
823
+ };
824
+ for (let t in Dt) for (let n in At) {
825
+ let r = At[n], i = Dt[t];
826
+ e[t + n] = n === "" || n === "Back" || n === "Elastic" ? (e, t) => i(r(e, t)) : i(r);
827
+ }
828
+ return e;
829
+ })(), Mt = {
830
+ linear: Tt,
831
+ none: Tt
832
+ }, Nt = (e) => {
833
+ if (Mt[e]) return Mt[e];
834
+ if (e.indexOf("(") <= -1) {
835
+ let t = Dt[e] || e.includes("Back") || e.includes("Elastic") ? jt[e]() : jt[e];
836
+ return t ? Mt[e] = t : Tt;
837
+ }
838
+ {
839
+ let t = e.slice(0, -1).split("("), n = jt[t[0]];
840
+ return n ? Mt[e] = n(...t[1].split(",")) : Tt;
841
+ }
842
+ }, Pt = [
843
+ "steps(",
844
+ "irregular(",
845
+ "linear(",
846
+ "cubicBezier("
847
+ ], Ft = (e) => {
848
+ if (z(e)) {
849
+ for (let t = 0, n = Pt.length; t < n; t++) if (L(e, Pt[t])) return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``), Tt;
850
+ }
851
+ return B(e) ? e : z(e) ? Nt(e) : Tt;
852
+ }, Q = Ke(), $ = Ke(), It = {}, Lt = { func: null }, Rt = { func: null }, zt = [null], Bt = [null, null], Vt = { to: null }, Ht = 0, Ut = 0, Wt, Gt, Kt = (e, t) => {
853
+ let n = {};
854
+ if (oe(e)) {
855
+ let t = [].concat(...e.map((e) => Object.keys(e))).filter(pe);
856
+ for (let r = 0, i = t.length; r < i; r++) {
857
+ let i = t[r];
858
+ n[i] = e.map((e) => {
859
+ let t = {};
860
+ for (let n in e) {
861
+ let r = e[n];
862
+ pe(n) ? n === i && (t.to = r) : t[n] = r;
863
+ }
864
+ return t;
865
+ });
866
+ }
867
+ } else {
868
+ let r = J(t.duration, I.defaults.duration);
869
+ Object.keys(e).map((t) => ({
870
+ o: parseFloat(t) / 100,
871
+ p: e[t]
872
+ })).sort((e, t) => e.o - t.o).forEach((e) => {
873
+ let t = e.o, i = e.p;
874
+ for (let e in i) if (pe(e)) {
875
+ let a = n[e];
876
+ a ||= n[e] = [];
877
+ let o = t * r, s = a.length, c = a[s - 1], l = { to: i[e] }, u = 0;
878
+ for (let e = 0; e < s; e++) u += a[e].duration;
879
+ s === 1 && (l.from = c.to), i.ease && (l.ease = i.ease), l.duration = o - (s ? u : 0), a.push(l);
880
+ }
881
+ return e;
882
+ });
883
+ for (let e in n) {
884
+ let t = n[e], r;
885
+ for (let e = 0, n = t.length; e < n; e++) {
886
+ let n = t[e], i = n.ease;
887
+ n.ease = r || void 0, r = i;
888
+ }
889
+ t[0].duration || t.shift();
890
+ }
891
+ }
892
+ return n;
893
+ }, qt = class extends vt {
894
+ constructor(e, t, n, r, i = !1, a = 0, o) {
895
+ super(t, n, r), this._head, this._tail, ++Ut;
896
+ let s = xt(e), u = s.length, f = t.keyframes, p = f ? Oe(Kt(f, t), t) : t, { id: m, delay: h, duration: g, ease: v, playbackEase: y, modifier: x, composition: S, onRender: C } = p, w = n ? n.defaults : I.defaults, T = J(v, w.ease), E = J(y, w.playbackEase), D = E ? Ft(E) : null, O = !V(T.ease), ee = O ? T.ease : J(v, D ? "linear" : w.ease), k = O ? T.settlingDuration : J(g, w.duration), te = J(h, w.delay), ne = x || w.modifier, A = V(S) && u >= 1e3 ? d.none : V(S) ? w.composition : S, j = this._offset + (n ? n._offset : 0);
897
+ O && (T.parent = this);
898
+ let M = NaN, N = NaN, P = 0, F = 0;
899
+ for (let e = 0; e < u; e++) {
900
+ let t = s[e], r = a || e, u = o || s, f = NaN, m = NaN;
901
+ for (let e in p) if (pe(e)) {
902
+ let a = He(t, e), o = Pe(t, e), s = Qe(e, t, a), h = p[e], g = oe(h);
903
+ if (i && !g && (Bt[0] = h, Bt[1] = h, h = Bt), g) {
904
+ let e = h.length, t = !se(h[0]);
905
+ e === 2 && t ? (Vt.to = h, zt[0] = Vt, Wt = zt) : e > 2 && t ? (Wt = [], h.forEach((e, t) => {
906
+ t ? t === 1 ? (Bt[1] = e, Wt.push(Bt)) : Wt.push(e) : Bt[0] = e;
907
+ })) : Wt = h;
908
+ } else zt[0] = h, Wt = zt;
909
+ let _ = null, v = null, y = NaN, x = 0, S = 0;
910
+ for (let e = Wt.length; S < e; S++) {
911
+ let i = Wt[S];
912
+ se(i) ? Gt = i : (Vt.to = i, Gt = Vt), Lt.func = null, Rt.func = null;
913
+ let c = Ve(J(Gt.composition, A), t, r, u, null, null), f = R(c) ? c : d[c];
914
+ !_ && f !== d.none && (_ = lt(t, s));
915
+ let p = _ ? _._tail : null, m = n && p && p.parent.parent === n ? p : v, h = Ve(Gt.to, t, r, u, Lt, m), g;
916
+ se(h) && !V(h.to) ? (Gt = h, g = h.to) : g = h;
917
+ let C = Ve(Gt.from, t, r, u, Rt, m), w = Gt.ease || ee, T = Ve(w, t, r, u, null, m), E = B(T) || z(T) ? T : w, D = !V(E) && !V(E.ease), O = D ? E.ease : E, M = D ? E.settlingDuration : Ve(J(Gt.duration, e > 1 ? Ve(k, t, r, u, null, m) / e : k), t, r, u, null, m), N = Ve(J(Gt.delay, S ? 0 : te), t, r, u, null, m), I = Gt.modifier || ne, re = !V(C), ie = !V(g), L = oe(g), ae = L || re && ie, le = v ? x : 0, ue = v ? x + N : N, de = G(j + ue, 12), fe = G(j + le, 12);
918
+ !F && (re || L) && (F = 1);
919
+ let H = v;
920
+ if (f !== d.none) {
921
+ let e = _._head;
922
+ for (; e && e._absoluteStartTime <= de;) if (e._isOverridden || (H = e), e = e._nextRep, e && e._absoluteStartTime >= de) for (; e;) dt(e), e = e._nextRep;
923
+ }
924
+ if (ae) {
925
+ Y(L ? Ve(g[0], t, r, u, Rt, m) : C, Q), Y(L ? Ve(g[1], t, r, u, Lt, m) : g, $);
926
+ let e = We(t, s, a, It);
927
+ Q.t === l.NUMBER && (H ? H._valueType === l.UNIT && (Q.t = l.UNIT, Q.u = H._unit) : (Y(e, X), X.t === l.UNIT && (Q.t = l.UNIT, Q.u = X.u)));
928
+ } else ie ? Y(g, $) : v ? qe(v, $) : Y(n && H && H.parent.parent === n ? H._value : We(t, s, a, It), $), re ? Y(C, Q) : v ? qe(v, Q) : Y(n && H && H.parent.parent === n ? H._value : We(t, s, a, It), Q);
929
+ if (Q.o && (Q.n = Ge(H ? H._toNumber : Y(We(t, s, a, It), X).n, Q.n, Q.o)), $.o && ($.n = Ge(Q.n, $.n, $.o)), Q.t !== $.t) {
930
+ if (Q.t === l.COMPLEX || $.t === l.COMPLEX) {
931
+ let e = Q.t === l.COMPLEX ? Q : $, t = Q.t === l.COMPLEX ? $ : Q;
932
+ t.t = l.COMPLEX, t.s = K(e.s), t.d = e.d.map(() => t.n);
933
+ } else if (Q.t === l.UNIT || $.t === l.UNIT) {
934
+ let e = Q.t === l.UNIT ? Q : $, t = Q.t === l.UNIT ? $ : Q;
935
+ t.t = l.UNIT, t.u = e.u;
936
+ } else if (Q.t === l.COLOR || $.t === l.COLOR) {
937
+ let e = Q.t === l.COLOR ? Q : $, t = Q.t === l.COLOR ? $ : Q;
938
+ t.t = l.COLOR, t.d = e.d.map(() => 0);
939
+ }
940
+ }
941
+ if (Q.u !== $.u) {
942
+ let e = $.u ? Q : $;
943
+ e = wt(t, e, $.u ? $.u : Q.u, !1);
944
+ }
945
+ if ($.d && Q.d && $.d.length !== Q.d.length) {
946
+ let e = Q.d.length > $.d.length ? Q : $, t = e === Q ? $ : Q;
947
+ t.d = e.d.map((e, n) => V(t.d[n]) ? 0 : t.d[n]), t.s = K(e.s);
948
+ }
949
+ let pe = G(+M || 1e-11, 12), me = It[s];
950
+ ce(me) || (It[s] = null);
951
+ let he = o ? o.set : null;
952
+ x = G(ue + pe, 12);
953
+ let ge = Q.d, _e = $.d, ve = $.s, U = {
954
+ parent: this,
955
+ id: Ht++,
956
+ property: s,
957
+ target: t,
958
+ _value: null,
959
+ _toFunc: Lt.func,
960
+ _fromFunc: Rt.func,
961
+ _ease: Ft(O),
962
+ _fromNumbers: ge ? K(ge) : b,
963
+ _toNumbers: _e ? K(_e) : b,
964
+ _strings: ve ? K(ve) : b,
965
+ _fromNumber: Q.n,
966
+ _toNumber: $.n,
967
+ _numbers: ge ? K(ge) : b,
968
+ _number: Q.n,
969
+ _unit: $.u,
970
+ _modifier: I,
971
+ _currentTime: 0,
972
+ _startTime: ue,
973
+ _delay: +N,
974
+ _updateDuration: pe,
975
+ _changeDuration: pe,
976
+ _absoluteStartTime: de,
977
+ _absoluteUpdateStartTime: fe,
978
+ _absoluteEndTime: G(j + x, 12),
979
+ _hasFromValue: re || L ? 1 : 0,
980
+ _tweenType: a,
981
+ _setter: he,
982
+ _valueType: $.t,
983
+ _composition: f,
984
+ _isOverlapped: 0,
985
+ _isOverridden: 0,
986
+ _renderTransforms: 0,
987
+ _inlineValue: me,
988
+ _prevRep: null,
989
+ _nextRep: null,
990
+ _prevAdd: null,
991
+ _nextAdd: null,
992
+ _prev: null,
993
+ _next: null
994
+ };
995
+ f !== d.none && ft(U, _);
996
+ let ye = U._valueType;
997
+ if (ye === l.COMPLEX) U._value = Je(U, 1, -1);
998
+ else if (ye === l.UNIT) U._value = `${I(U._toNumber)}${U._unit}`;
999
+ else if (ye === l.COLOR) {
1000
+ let e = $.d;
1001
+ U._value = `rgba(${G(e[0], 0)},${G(e[1], 0)},${G(e[2], 0)},${e[3]})`;
1002
+ } else U._value = I(U._toNumber);
1003
+ isNaN(y) && (y = U._startTime), v = U, P++, Ae(this, U);
1004
+ }
1005
+ (isNaN(N) || y < N) && (N = y), (isNaN(M) || x > M) && (M = x), a === c.TRANSFORM && (f = P - S, m = P);
1006
+ }
1007
+ if (!isNaN(f)) {
1008
+ let e = 0;
1009
+ q(this, (t) => {
1010
+ e >= f && e < m && (t._renderTransforms = 1, t._composition === d.blend && q(tt.animation, (e) => {
1011
+ e.id === t.id && (e._renderTransforms = 1);
1012
+ })), e++;
1013
+ });
1014
+ }
1015
+ }
1016
+ u || console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."), N ? (q(this, (e) => {
1017
+ e._startTime - e._delay || (e._delay -= N), e._startTime -= N;
1018
+ }), M -= N) : N = 0, M || (M = _, this.iterationCount = 0), this.targets = s, this.id = V(m) ? Ut : m, this.duration = M === 1e-11 ? _ : Ee((M + this._loopDelay) * this.iterationCount - this._loopDelay) || 1e-11, this.onRender = C || w.onRender, this._ease = D, this._delay = N, this.iterationDuration = M, !this._autoplay && F && this.onRender(this);
1019
+ }
1020
+ stretch(e) {
1021
+ let t = this.duration;
1022
+ if (t === De(e)) return this;
1023
+ let n = e / t;
1024
+ return q(this, (e) => {
1025
+ e._updateDuration = De(e._updateDuration * n), e._changeDuration = De(e._changeDuration * n), e._currentTime *= n, e._delay *= n, e._startTime *= n, e._absoluteStartTime *= n, e._absoluteUpdateStartTime *= n, e._absoluteEndTime *= n;
1026
+ }), super.stretch(e);
1027
+ }
1028
+ refresh() {
1029
+ return q(this, (e) => {
1030
+ let t = e._toFunc, n = e._fromFunc;
1031
+ (t || n) && (n ? (Y(n(), Q), Q.u !== e._unit && e.target[p] && wt(e.target, Q, e._unit, !0), e._fromNumbers = K(Q.d), e._fromNumber = Q.n) : t && (Y(We(e.target, e.property, e._tweenType), X), e._fromNumbers = K(X.d), e._fromNumber = X.n), t && (Y(t(), $), e._toNumbers = K($.d), e._strings = K($.s), e._toNumber = $.o ? Ge(e._fromNumber, $.n, $.o) : $.n));
1032
+ }), this.duration === 1e-11 && this.restart(), this;
1033
+ }
1034
+ revert() {
1035
+ return super.revert(), $e(this);
1036
+ }
1037
+ then(e) {
1038
+ return super.then(e);
1039
+ }
1040
+ }, Jt = (e, t) => I.editor ? I.editor.addAnimation(e, t) : new qt(e, t, null, 0, !1).init(), Yt = (e, t) => {
1041
+ if (L(t, "<")) {
1042
+ let n = t[1] === "<", r = e._tail, i = r ? r._offset + r._delay : 0;
1043
+ return n ? i : i + r.duration;
1044
+ }
1045
+ }, Xt = (e, t) => {
1046
+ let n = e.iterationDuration;
1047
+ if (n === 1e-11 && (n = 0), V(t)) return n;
1048
+ if (R(+t)) return +t;
1049
+ let r = t, i = e ? e.labels : null, a = !ce(i), o = Yt(e, r), s = !V(o), c = M.exec(r);
1050
+ if (c) {
1051
+ let e = c[0], t = r.split(e), l = a && t[0] ? i[t[0]] : n;
1052
+ return Ge(s ? o : a ? l : n, +t[1], e[0]);
1053
+ }
1054
+ return s ? o : a ? V(i[r]) ? n : i[r] : n;
1055
+ };
1056
+ //#endregion
1057
+ //#region node_modules/.pnpm/animejs@4.5.0/node_modules/animejs/dist/modules/utils/target.js
1058
+ function Zt(e, t, n) {
1059
+ let r = xt(e);
1060
+ if (!r.length) return;
1061
+ let [i] = r, a = We(i, Qe(t, i, He(i, t)));
1062
+ if (V(n)) return a;
1063
+ if (Y(a, X), X.t === l.NUMBER || X.t === l.UNIT) {
1064
+ if (n === !1) return X.n;
1065
+ {
1066
+ let e = wt(i, X, n, !1);
1067
+ return `${G(e.n, I.precision)}${e.u}`;
1068
+ }
1069
+ }
1070
+ }
1071
+ var Qt = (e, t) => {
1072
+ if (!V(t)) return I.editor && I.editor.addSet ? I.editor.addSet(e, t) : (t.duration = _, t.composition = J(t.composition, d.none), new qt(e, t, null, 0, !0).resume());
1073
+ }, $t = (e = w) => new vt({
1074
+ duration: 1 * I.timeScale,
1075
+ onComplete: e
1076
+ }, null, 0).resume(), en = (e) => {
1077
+ let t;
1078
+ return ((...n) => {
1079
+ let r, i, a, o, s;
1080
+ t && (r = t.currentIteration, i = t.iterationProgress, a = t.reversed, o = t._alternate, s = t._startTime, t.revert());
1081
+ let c = e(...n);
1082
+ return c && !B(c) && c.revert && (t = c), V(i) || (t.currentIteration = r, t.iterationProgress = (o && r % 2 ? !a : a) ? 1 - i : i, t._startTime = s), c || w;
1083
+ });
1084
+ }, tn = () => {
1085
+ let e = s.createElement("div");
1086
+ s.body.appendChild(e), e.style.height = "100lvh";
1087
+ let t = e.offsetHeight;
1088
+ return s.body.removeChild(e), t;
1089
+ }, nn = (e, t) => e && B(e) ? e(t) : e, rn = /* @__PURE__ */ new Map(), an = class {
1090
+ constructor(e) {
1091
+ this.element = e, this.useWin = this.element === s.body, this.winWidth = 0, this.winHeight = 0, this.width = 0, this.height = 0, this.left = 0, this.top = 0, this.scale = 1, this.zIndex = 0, this.scrollX = 0, this.scrollY = 0, this.prevScrollX = 0, this.prevScrollY = 0, this.scrollWidth = 0, this.scrollHeight = 0, this.velocity = 0, this.backwardX = !1, this.backwardY = !1, this.scrollTicker = new vt({
1092
+ autoplay: !1,
1093
+ onBegin: () => this.dataTimer.resume(),
1094
+ onUpdate: () => {
1095
+ let e = this.backwardX || this.backwardY;
1096
+ q(this, (e) => e.handleScroll(), e);
1097
+ },
1098
+ onComplete: () => this.dataTimer.pause()
1099
+ }).init(), this.dataTimer = new vt({
1100
+ autoplay: !1,
1101
+ frameRate: 30,
1102
+ onUpdate: (e) => {
1103
+ let t = e.deltaTime, n = this.prevScrollX, r = this.prevScrollY, i = this.scrollX, a = this.scrollY, o = n - i, s = r - a;
1104
+ this.prevScrollX = i, this.prevScrollY = a, o && (this.backwardX = n > i), s && (this.backwardY = r > a), this.velocity = G(t > 0 ? Math.sqrt(o * o + s * s) / t : 0, 5);
1105
+ }
1106
+ }).init(), this.resizeTicker = new vt({
1107
+ autoplay: !1,
1108
+ duration: 250 * I.timeScale,
1109
+ onComplete: () => {
1110
+ this.updateWindowBounds(), this.refreshScrollObservers(), this.handleScroll();
1111
+ }
1112
+ }).init(), this.wakeTicker = new vt({
1113
+ autoplay: !1,
1114
+ duration: 500 * I.timeScale,
1115
+ onBegin: () => {
1116
+ this.scrollTicker.resume();
1117
+ },
1118
+ onComplete: () => {
1119
+ this.scrollTicker.pause();
1120
+ }
1121
+ }).init(), this._head = null, this._tail = null, this.updateScrollCoords(), this.updateWindowBounds(), this.updateBounds(), this.refreshScrollObservers(), this.handleScroll(), this.resizeObserver = new ResizeObserver(() => this.resizeTicker.restart()), this.resizeObserver.observe(this.element), (this.useWin ? o : this.element).addEventListener("scroll", this, !1);
1122
+ }
1123
+ updateScrollCoords() {
1124
+ let e = this.useWin, t = this.element;
1125
+ this.scrollX = G(e ? o.scrollX : t.scrollLeft, 0), this.scrollY = G(e ? o.scrollY : t.scrollTop, 0);
1126
+ }
1127
+ updateWindowBounds() {
1128
+ this.winWidth = o.innerWidth, this.winHeight = tn();
1129
+ }
1130
+ updateBounds() {
1131
+ let e = getComputedStyle(this.element), t = this.element;
1132
+ this.scrollWidth = t.scrollWidth + parseFloat(e.marginLeft) + parseFloat(e.marginRight), this.scrollHeight = t.scrollHeight + parseFloat(e.marginTop) + parseFloat(e.marginBottom), this.updateWindowBounds();
1133
+ let n, r;
1134
+ if (this.useWin) n = this.winWidth, r = this.winHeight;
1135
+ else {
1136
+ let e = t.getBoundingClientRect();
1137
+ n = t.clientWidth, r = t.clientHeight, this.top = e.top, this.left = e.left, this.scale = e.width ? n / e.width : e.height ? r / e.height : 1;
1138
+ }
1139
+ this.width = n, this.height = r;
1140
+ }
1141
+ refreshScrollObservers() {
1142
+ q(this, (e) => {
1143
+ e.ready && e._debug && e.removeDebug();
1144
+ }), this.updateBounds(), q(this, (e) => {
1145
+ e.ready && (e.refresh(), e.onResize(e), e._debug && e.debug());
1146
+ });
1147
+ }
1148
+ refresh() {
1149
+ this.updateWindowBounds(), this.updateBounds(), this.refreshScrollObservers(), this.handleScroll();
1150
+ }
1151
+ handleScroll() {
1152
+ this.updateScrollCoords(), this.wakeTicker.restart();
1153
+ }
1154
+ handleEvent(e) {
1155
+ e.type === "scroll" && this.handleScroll();
1156
+ }
1157
+ revert() {
1158
+ this.scrollTicker.cancel(), this.dataTimer.cancel(), this.resizeTicker.cancel(), this.wakeTicker.cancel(), this.resizeObserver.disconnect(), (this.useWin ? o : this.element).removeEventListener("scroll", this), rn.delete(this.element);
1159
+ }
1160
+ }, on = (e) => {
1161
+ let t = e && bt(e)[0] || s.body, n = rn.get(t);
1162
+ return n || (n = new an(t), rn.set(t, n)), n;
1163
+ }, sn = (e, t, n, r, i) => {
1164
+ let a = t === "min", o = t === "max", { n: s, u: c } = Y(t === "top" || t === "left" || t === "start" || a ? 0 : t === "bottom" || t === "right" || t === "end" || o ? "100%" : t === "center" ? "50%" : t, X), l = s;
1165
+ return c === "%" ? l = s / 100 * n : c && (l = wt(e, X, "px", !0).n), o && r < 0 && (l += r), a && i > 0 && (l += i), l;
1166
+ }, cn = (e, t, n, r, i) => {
1167
+ let a;
1168
+ if (z(t)) {
1169
+ let o = M.exec(t);
1170
+ if (o) {
1171
+ let s = o[0], c = s[0], l = t.split(s), u = l[0] === "min", d = l[0] === "max", f = sn(e, l[0], n, r, i), p = sn(e, l[1], n, r, i);
1172
+ if (u) {
1173
+ let t = Ge(sn(e, "min", n), p, c);
1174
+ a = t < f ? f : t;
1175
+ } else if (d) {
1176
+ let t = Ge(sn(e, "max", n), p, c);
1177
+ a = t > f ? f : t;
1178
+ } else a = Ge(f, p, c);
1179
+ } else a = sn(e, t, n, r, i);
1180
+ } else a = t;
1181
+ return G(a, 0);
1182
+ }, ln = (e) => {
1183
+ let t, n = e.targets;
1184
+ for (let e = 0, r = n.length; e < r; e++) {
1185
+ let r = n[e];
1186
+ if (r[p]) {
1187
+ t = r;
1188
+ break;
1189
+ }
1190
+ }
1191
+ return t;
1192
+ }, un = 0, dn = [
1193
+ "#FF4B4B",
1194
+ "#FF971B",
1195
+ "#FFC730",
1196
+ "#F9F640",
1197
+ "#7AFF5A",
1198
+ "#18FF74",
1199
+ "#17E09B",
1200
+ "#3CFFEC",
1201
+ "#05DBE9",
1202
+ "#33B3F1",
1203
+ "#638CF9",
1204
+ "#C563FE",
1205
+ "#FF4FCF",
1206
+ "#F93F8A"
1207
+ ], fn = class {
1208
+ constructor(e = {}) {
1209
+ F.current && F.current.register(this);
1210
+ let t = J(e.sync, "play pause"), n = t ? Ft(t) : null, r = t && (t === "linear" || t === Tt), i = t && !(n === Tt && !r), a = t && (R(t) || t === !0 || r), o = t && z(t) && !i && !a, c = o ? t.split(" ").map((e) => () => {
1211
+ let t = this.linked;
1212
+ return t && t[e] ? t[e]() : null;
1213
+ }) : null, l = o && c.length > 2;
1214
+ this.index = un++, this.id = V(e.id) ? this.index : e.id, this.container = on(e.container), this.target = null, this.linked = null, this.repeat = null, this.horizontal = null, this.enter = null, this.leave = null, this.sync = i || a || !!c, this.syncEase = i ? n : null, this.syncSmooth = a ? t === !0 || r ? 1 : t : null, this.onSyncEnter = c && !l && c[0] ? c[0] : w, this.onSyncLeave = c && !l && c[1] ? c[1] : w, this.onSyncEnterForward = c && l && c[0] ? c[0] : w, this.onSyncLeaveForward = c && l && c[1] ? c[1] : w, this.onSyncEnterBackward = c && l && c[2] ? c[2] : w, this.onSyncLeaveBackward = c && l && c[3] ? c[3] : w, this.onEnter = e.onEnter || w, this.onLeave = e.onLeave || w, this.onEnterForward = e.onEnterForward || w, this.onLeaveForward = e.onLeaveForward || w, this.onEnterBackward = e.onEnterBackward || w, this.onLeaveBackward = e.onLeaveBackward || w, this.onUpdate = e.onUpdate || w, this.onResize = e.onResize || w, this.onSyncComplete = e.onSyncComplete || w, this.reverted = !1, this.ready = !1, this.completed = !1, this.began = !1, this.isInView = !1, this.forceEnter = !1, this.hasEntered = !1, this.offset = 0, this.offsetStart = 0, this.offsetEnd = 0, this.distance = 0, this.prevProgress = 0, this.thresholds = [
1215
+ "start",
1216
+ "end",
1217
+ "end",
1218
+ "start"
1219
+ ], this.coords = [
1220
+ 0,
1221
+ 0,
1222
+ 0,
1223
+ 0
1224
+ ], this.debugStyles = null, this.$debug = null, this._params = e, this._debug = J(e.debug, !1), this._next = null, this._prev = null, Ae(this.container, this), $t(() => {
1225
+ if (!this.reverted) {
1226
+ if (!this.target) {
1227
+ let t = bt(e.target)[0];
1228
+ this.target = t || s.body, this.refresh();
1229
+ }
1230
+ this._debug && this.debug();
1231
+ }
1232
+ });
1233
+ }
1234
+ link(e) {
1235
+ if (e && (e.pause(), this.linked = e, !V(e) && !V(e.persist) && (e.persist = !0), !this._params.target)) {
1236
+ let t;
1237
+ V(e.targets) ? q(e, (e) => {
1238
+ e.targets && !t && (t = ln(e));
1239
+ }) : t = ln(e), this.target = t || s.body, this.refresh();
1240
+ }
1241
+ return this;
1242
+ }
1243
+ get velocity() {
1244
+ return this.container.velocity;
1245
+ }
1246
+ get backward() {
1247
+ return this.horizontal ? this.container.backwardX : this.container.backwardY;
1248
+ }
1249
+ get scroll() {
1250
+ return this.horizontal ? this.container.scrollX : this.container.scrollY;
1251
+ }
1252
+ get progress() {
1253
+ let e = (this.scroll - this.offsetStart) / this.distance;
1254
+ return e === Infinity || isNaN(e) ? 0 : G(W(e, 0, 1), 6);
1255
+ }
1256
+ refresh() {
1257
+ this.ready = !0, this.reverted = !1;
1258
+ let e = this._params;
1259
+ return this.repeat = J(nn(e.repeat, this), !0), this.horizontal = J(nn(e.axis, this), "y") === "x", this.enter = J(nn(e.enter, this), "end start"), this.leave = J(nn(e.leave, this), "start end"), this.updateBounds(), this.handleScroll(), this;
1260
+ }
1261
+ removeDebug() {
1262
+ return this.$debug &&= (this.$debug.parentNode.removeChild(this.$debug), null), this.debugStyles && (this.debugStyles.revert(), this.$debug = null), this;
1263
+ }
1264
+ debug() {
1265
+ this.removeDebug();
1266
+ let e = this.container, t = this.horizontal, n = e.element.querySelector(":scope > .animejs-onscroll-debug"), r = s.createElement("div"), i = s.createElement("div"), a = s.createElement("div"), o = dn[this.index % dn.length], c = e.useWin, l = c ? e.winWidth : e.width, u = c ? e.winHeight : e.height, d = e.scrollWidth, f = e.scrollHeight, p = this.container.width > 360 ? 320 : 260, m = t ? 0 : 10, h = t ? 10 : 0, g = t ? 24 : p / 2, _ = t ? g : 15, v = t ? 60 : g, y = t ? v : _, b = t ? "repeat-x" : "repeat-y", x = (e) => t ? "0px " + e + "px" : e + "px 2px", S = (e) => `linear-gradient(${t ? 90 : 0}deg, ${e} 2px, transparent 1px)`, C = (e, t, n, r, i) => `position:${e};left:${t}px;top:${n}px;width:${r}px;height:${i}px;`;
1267
+ r.style.cssText = `${C("absolute", m, h, t ? d : p, t ? p : f)}
1268
+ pointer-events: none;
1269
+ z-index: ${this.container.zIndex++};
1270
+ display: flex;
1271
+ flex-direction: ${t ? "column" : "row"};
1272
+ filter: drop-shadow(0px 1px 0px rgba(0,0,0,.75));
1273
+ `, i.style.cssText = `${C("sticky", 0, 0, t ? l : g, t ? g : u)}`, n || (i.style.cssText += `background:
1274
+ ${S("#FFFF")}${x(g - 10)} / 100px 100px ${b},
1275
+ ${S("#FFF8")}${x(g - 10)} / 10px 10px ${b};
1276
+ `), a.style.cssText = `${C("relative", 0, 0, t ? d : g, t ? g : f)}`, n || (a.style.cssText += `background:
1277
+ ${S("#FFFF")}${x(0)} / ${t ? "100px 10px" : "10px 100px"} ${b},
1278
+ ${S("#FFF8")}${x(0)} / ${t ? "10px 0px" : "0px 10px"} ${b};
1279
+ `);
1280
+ let w = [" enter: ", " leave: "];
1281
+ this.coords.forEach((e, n) => {
1282
+ let r = n > 1, c = (r ? 0 : this.offset) + e, m = n % 2, h = c < y, g = c > (r ? t ? l : u : t ? d : f) - y, b = (r ? m && !h : !m && !h) || g, x = s.createElement("div"), S = s.createElement("div"), T = t ? b ? "right" : "left" : b ? "bottom" : "top", E = b ? (t ? v : _) + (r ? t ? -1 : g ? 0 : -2 : t ? -1 : -2) : +!!t;
1283
+ S.innerHTML = `${this.id}${w[m]}${this.thresholds[n]}`, x.style.cssText = `${C("absolute", 0, 0, v, _)}
1284
+ display: flex;
1285
+ flex-direction: ${t ? "column" : "row"};
1286
+ justify-content: flex-${r ? "start" : "end"};
1287
+ align-items: flex-${b ? "end" : "start"};
1288
+ border-${T}: 2px solid ${o};
1289
+ `, S.style.cssText = `
1290
+ overflow: hidden;
1291
+ max-width: ${p / 2 - 10}px;
1292
+ height: ${_};
1293
+ margin-${t ? b ? "right" : "left" : b ? "bottom" : "top"}: -2px;
1294
+ padding: 1px;
1295
+ font-family: ui-monospace, monospace;
1296
+ font-size: 10px;
1297
+ letter-spacing: -.025em;
1298
+ line-height: 9px;
1299
+ font-weight: 600;
1300
+ text-align: ${t && b || !t && !r ? "right" : "left"};
1301
+ white-space: pre;
1302
+ text-overflow: ellipsis;
1303
+ color: ${m ? o : "rgba(0,0,0,.75)"};
1304
+ background-color: ${m ? "rgba(0,0,0,.65)" : o};
1305
+ border: 2px solid ${m ? o : "transparent"};
1306
+ border-${t ? b ? "top-left" : "top-right" : b ? "top-left" : "bottom-left"}-radius: 5px;
1307
+ border-${t ? b ? "bottom-left" : "bottom-right" : b ? "top-right" : "bottom-right"}-radius: 5px;
1308
+ `, x.appendChild(S);
1309
+ let D = c - E + +!!t;
1310
+ x.style[t ? "left" : "top"] = `${D}px`, (r ? i : a).appendChild(x);
1311
+ }), r.appendChild(i), r.appendChild(a), e.element.appendChild(r), n || r.classList.add("animejs-onscroll-debug"), this.$debug = r, Zt(e.element, "position") === "static" && (this.debugStyles = Qt(e.element, { position: "relative " }));
1312
+ }
1313
+ updateBounds() {
1314
+ this._debug && this.removeDebug();
1315
+ let e, t = this.target, n = this.container, r = this.horizontal, i = this.linked, a, o = t;
1316
+ for (i && (a = i.currentTime, i.seek(0, !0)); o && o !== n.element && o !== s.body;) {
1317
+ let t = Zt(o, "position") === "sticky" && Qt(o, { position: "static" });
1318
+ o = o.parentElement, t && (e ||= [], e.push(t));
1319
+ }
1320
+ let c = t.getBoundingClientRect(), l = n.scale, u = (r ? c.left + n.scrollX - n.left : c.top + n.scrollY - n.top) * l, d = (r ? c.width : c.height) * l, f = r ? n.width : n.height, p = (r ? n.scrollWidth : n.scrollHeight) - f, m = this.enter, h = this.leave, g = "start", _ = "end", v = "end", y = "start";
1321
+ if (z(m)) {
1322
+ let e = m.split(" ");
1323
+ v = e[0], g = e.length > 1 ? e[1] : g;
1324
+ } else if (se(m)) {
1325
+ let e = m;
1326
+ V(e.container) || (v = e.container), V(e.target) || (g = e.target);
1327
+ } else R(m) && (v = m);
1328
+ if (z(h)) {
1329
+ let e = h.split(" ");
1330
+ y = e[0], _ = e.length > 1 ? e[1] : _;
1331
+ } else if (se(h)) {
1332
+ let e = h;
1333
+ V(e.container) || (y = e.container), V(e.target) || (_ = e.target);
1334
+ } else R(h) && (y = h);
1335
+ let b = cn(t, g, d), x = cn(t, _, d), S = b + u - f, C = x + u - p, w = cn(t, v, f, S, C), T = cn(t, y, f, S, C), E = b + u - w, D = x + u - T, O = D - E;
1336
+ this.offset = u, this.offsetStart = E, this.offsetEnd = D, this.distance = O <= 0 ? 0 : O, this.thresholds = [
1337
+ g,
1338
+ _,
1339
+ v,
1340
+ y
1341
+ ], this.coords = [
1342
+ b,
1343
+ x,
1344
+ w,
1345
+ T
1346
+ ], e && e.forEach((e) => e.revert()), i && i.seek(a, !0), this._debug && this.debug();
1347
+ }
1348
+ handleScroll() {
1349
+ if (!this.ready) return;
1350
+ let e = this.linked, t = this.sync, n = this.syncEase, r = this.syncSmooth, i = e && (n || r), a = this.horizontal, o = this.container, s = this.scroll, c = s <= this.offsetStart, l = s >= this.offsetEnd, u = !c && !l, d = s === this.offsetStart || s === this.offsetEnd, f = !this.hasEntered && d, p = this._debug && this.$debug, m = !1, h = !1, g = this.progress;
1351
+ if (c && this.began && (this.began = !1), g > 0 && !this.began && (this.began = !0), i) {
1352
+ let t = e.progress;
1353
+ if (r && R(r)) {
1354
+ if (r < 1) {
1355
+ let e = t < g && g === 1 ? 1e-4 : t > g && !g ? -1e-4 : 0;
1356
+ g = G(Te(t, g, Te(.01, .2, r)) + e, 6);
1357
+ }
1358
+ } else n && (g = n(g));
1359
+ m = g !== this.prevProgress, h = t === 1, m && !h && r && t && o.wakeTicker.restart();
1360
+ }
1361
+ if (p) {
1362
+ let e = a ? o.scrollY : o.scrollX;
1363
+ p.style[a ? "top" : "left"] = e + 10 + "px";
1364
+ }
1365
+ (u && !this.isInView || f && !this.forceEnter && !this.hasEntered) && (u && (this.isInView = !0), !this.forceEnter || !this.hasEntered ? (p && u && (p.style.zIndex = `${this.container.zIndex++}`), this.onSyncEnter(this), this.onEnter(this), this.backward ? (this.onSyncEnterBackward(this), this.onEnterBackward(this)) : (this.onSyncEnterForward(this), this.onEnterForward(this)), this.hasEntered = !0, f && (this.forceEnter = !0)) : u && (this.forceEnter = !1)), (u || !u && this.isInView) && (m = !0), m && (i && e.seek(e.duration * g), this.onUpdate(this)), !u && this.isInView && (this.isInView = !1, this.onSyncLeave(this), this.onLeave(this), this.backward ? (this.onSyncLeaveBackward(this), this.onLeaveBackward(this)) : (this.onSyncLeaveForward(this), this.onLeaveForward(this)), t && !r && (h = !0)), g >= 1 && this.began && !this.completed && (t && h || !t) && (t && this.onSyncComplete(this), this.completed = !0, (!this.repeat && !e || !this.repeat && e && e.completed) && this.revert()), g < 1 && this.completed && (this.completed = !1), this.prevProgress = g;
1366
+ }
1367
+ revert() {
1368
+ if (this.reverted) return;
1369
+ let e = this.container;
1370
+ return ke(e, this), e._head || e.revert(), this._debug && this.removeDebug(), this.reverted = !0, this.ready = !1, this;
1371
+ }
1372
+ }, pn = (e = {}) => new fn(e), mn = (e = 0, t = 1, n = 0) => {
1373
+ let r = 10 ** n;
1374
+ return Math.floor((Math.random() * (t - e + 1 / r) + e) * r) / r;
1375
+ }, hn = 0, gn = (e, t = 0, n = 1, r = 0) => {
1376
+ let i = e === void 0 ? hn++ : e;
1377
+ return (e = t, a = n, o = r) => {
1378
+ i += 1831565813, i = Math.imul(i ^ i >>> 15, i | 1), i ^= i + Math.imul(i ^ i >>> 7, i | 61);
1379
+ let s = 10 ** o;
1380
+ return Math.floor((((i ^ i >>> 14) >>> 0) / 4294967296 * (a - e + 1 / s) + e) * s) / s;
1381
+ };
1382
+ }, _n = (e, t = mn) => {
1383
+ let n = e.length, r, i;
1384
+ for (; n;) i = t(0, --n), r = e[n], e[n] = e[i], e[i] = r;
1385
+ return e;
1386
+ }, vn = (e, t = {}) => {
1387
+ let n = [], r = 0, i, a = null, o = t.from, s = t.reversed, c = t.ease, l = !V(c), u = l && !V(c.ease) ? c.ease : l ? Ft(c) : null, d = t.grid, f = d === !0, p = t.axis, m = t.total, h = V(o) || o === 0 || o === "first", g = o === "center", _ = o === "last", v = o === "random", y = oe(o), b = oe(e), x = t.use, S = ge(b ? e[0] : e), C = b ? ge(e[1]) : 0, w = A.exec((b ? e[1] : e) + ""), T = t.start || 0 + (b ? S : 0), E = t.seed, D = !V(E) && E !== !1 ? gn(E === !0 ? 0 : E) : mn, O = t.jitter, ee = !V(O), k = oe(O), te = k ? O[0] : O || 0, ne = k ? O[1] : O || 0, j = h ? 0 : R(o) ? o : 0;
1388
+ return (e, c, l, h, E) => {
1389
+ let [O] = xt(e), k = V(m) ? l.length : m, A = V(x) ? !1 : B(x) ? x(O, c, k) : We(O, x), M = R(A) || z(A) && R(+A) ? +A : c, N = M >= 0 && M < k ? M : c;
1390
+ if (g && (j = (k - 1) / 2), _ && (j = k - 1), !n.length) {
1391
+ if (f) {
1392
+ let e = !0, t = !1, r = Infinity, i = Infinity, a = Infinity, s = -Infinity, c = -Infinity, u = -Infinity, d = [], f = [], m = [];
1393
+ for (let n = 0; n < k; n++) {
1394
+ let o = l[n], p = 0, h = 0, g = 0, _ = !1;
1395
+ if (o && B(o.getBoundingClientRect)) {
1396
+ let e = o.getBoundingClientRect();
1397
+ p = e.left + e.width / 2, h = e.top + e.height / 2, _ = !0;
1398
+ } else {
1399
+ let e = o;
1400
+ e && R(e.x) && R(e.y) && (p = e.x, h = e.y, R(e.z) && (g = e.z, t = !0), _ = !0);
1401
+ }
1402
+ if (!_) {
1403
+ e = !1;
1404
+ break;
1405
+ }
1406
+ d.push(p), f.push(h), m.push(g), p < r && (r = p), h < i && (i = h), g < a && (a = g), p > s && (s = p), h > c && (c = h), g > u && (u = g);
1407
+ }
1408
+ if (e) {
1409
+ let e = d[0], l = f[0], h = m[0];
1410
+ y ? (e = r + o[0] * (s - r), l = i + o[1] * (c - i), h = t ? a + (o.length >= 3 ? o[2] : .5) * (u - a) : 0) : g ? (e = (r + s) / 2, l = (i + c) / 2, h = (a + u) / 2) : _ ? (e = d[k - 1], l = f[k - 1], h = m[k - 1]) : R(o) && (e = d[o], l = f[o], h = m[o]);
1411
+ for (let r = 0; r < k; r++) {
1412
+ let i = e - d[r], a = l - f[r], o = h - m[r], s = ve(i * i + a * a + (t ? o * o : 0));
1413
+ p === "x" && (s = -i), p === "y" && (s = -a), p === "z" && (s = -o), n.push(s);
1414
+ }
1415
+ let v = Infinity;
1416
+ for (let e = 0; e < k; e++) {
1417
+ let t = be(n[e]);
1418
+ t > 0 && t < v && (v = t);
1419
+ }
1420
+ if (v > 0 && v < Infinity) for (let e = 0; e < k; e++) n[e] = n[e] / v;
1421
+ } else for (let e = 0; e < k; e++) n.push(be(j - e));
1422
+ } else for (let e = 0; e < k; e++) if (!d) n.push(be(j - e));
1423
+ else {
1424
+ let t = d.length, r = d[0] * d[1], i, a, s;
1425
+ y ? (i = o[0] * (d[0] - 1), a = o[1] * (d[1] - 1), s = t === 3 ? (o.length >= 3 ? o[2] : .5) * (d[2] - 1) : 0) : g ? (i = (d[0] - 1) / 2, a = (d[1] - 1) / 2, s = t === 3 ? (d[2] - 1) / 2 : 0) : (i = j % d[0], a = xe(j / d[0]) % d[1], s = t === 3 ? xe(j / r) : 0);
1426
+ let c = e % d[0], l = xe(e / d[0]) % d[1], u = t === 3 ? xe(e / r) : 0, f = i - c, m = a - l, h = s - u, _ = ve(f * f + m * m + (t === 3 ? h * h : 0));
1427
+ p === "x" && (_ = -f), p === "y" && (_ = -m), p === "z" && (_ = -h), n.push(_);
1428
+ }
1429
+ r = n[0];
1430
+ for (let e = 1; e < k; e++) n[e] > r && (r = n[e]);
1431
+ if (u || s) for (let e = 0; e < k; e++) {
1432
+ let t = n[e];
1433
+ u && (t = u(t / r) * r), s && (t = p ? -t : be(r - t)), n[e] = t;
1434
+ }
1435
+ if (ee) {
1436
+ a = Array(k);
1437
+ for (let e = 0; e < k; e++) a[e] = D(-1, 1, 4);
1438
+ }
1439
+ v && (n = _n(n, D));
1440
+ }
1441
+ let P = b ? (C - S) / r : S;
1442
+ V(i) && (i = E ? Xt(E, V(t.start) ? E.iterationDuration : T) : T);
1443
+ let F = i + (P * G(n[N], 2) || 0);
1444
+ if (ee) {
1445
+ let e = r ? n[N] / r : 0, t = te + (ne - te) * e;
1446
+ F += a[N] * t;
1447
+ }
1448
+ return t.modifier && (F = t.modifier(F)), w && (F = `${F}${w[2]}`), F;
1449
+ };
1450
+ }, yn = typeof Intl < "u" && Intl.Segmenter, bn = /\{value\}/g, xn = /\{i\}/g, Sn = /(\s+)/, Cn = /^\s+$/, wn = "line", Tn = "word", En = "char", Dn = "data-line", On = null, kn = null, An = null, jn = (e) => e.isWordLike || e.segment === " " || R(+e.segment), Mn = (e) => e.setAttribute("aria-hidden", "true"), Nn = (e, t) => [...e.querySelectorAll(`[data-${t}]:not([data-${t}] [data-${t}])`)], Pn = {
1451
+ line: "#00D672",
1452
+ word: "#FF4B4B",
1453
+ char: "#5A87FF"
1454
+ }, Fn = (e) => {
1455
+ if (!e.childElementCount && !e.textContent.trim()) {
1456
+ let t = e.parentElement;
1457
+ e.remove(), t && Fn(t);
1458
+ }
1459
+ }, In = (e, t, n) => {
1460
+ let r = e.getAttribute(Dn);
1461
+ if (r !== null && +r !== t || e.tagName === "BR") {
1462
+ n.add(e);
1463
+ let t = e.previousSibling, r = e.nextSibling;
1464
+ t && t.nodeType === 3 && Cn.test(t.textContent) && n.add(t), r && r.nodeType === 3 && Cn.test(r.textContent) && n.add(r);
1465
+ }
1466
+ let i = e.childElementCount;
1467
+ for (; i--;) In(e.children[i], t, n);
1468
+ return n;
1469
+ }, Ln = (e, t = {}) => {
1470
+ let n = "";
1471
+ t ||= {};
1472
+ let r = z(t.class) ? ` class="${t.class}"` : "", i = J(t.clone, !1), a = J(t.wrap, !1), o = a ? a === !0 ? "clip" : a : i ? "clip" : !1;
1473
+ if (a && (n += `<span${o ? ` style="overflow:${o};"` : ""}>`), n += `<span${r}${i ? " style=\"position:relative;\"" : ""} data-${e}="{i}">`, i) {
1474
+ let e = i === "left" ? "-100%" : i === "right" ? "100%" : "0", t = i === "top" ? "-100%" : i === "bottom" ? "100%" : "0";
1475
+ n += "<span>{value}</span>", n += `<span inert style="position:absolute;top:${t};left:${e};white-space:nowrap;">{value}</span>`;
1476
+ } else n += "{value}";
1477
+ return n += "</span>", a && (n += "</span>"), n;
1478
+ }, Rn = (e, t, n, r, i, a, o, s, c) => {
1479
+ let l = i === wn, u = i === En, d = `_${i}_`, f = B(e) ? e(n) : e, p = l ? "block" : "inline-block";
1480
+ An.innerHTML = f.replace(bn, `<i class="${d}"></i>`).replace(xn, `${u ? c : l ? o : s}`);
1481
+ let m = An.content, h = m.firstElementChild, g = m.querySelector(`[data-${i}]`) || h, _ = m.querySelectorAll(`i.${d}`), v = _.length;
1482
+ if (v) {
1483
+ h.style.display = p, g.style.display = p, g.setAttribute(Dn, `${o}`), l || (g.setAttribute("data-word", `${s}`), u && g.setAttribute("data-char", `${c}`));
1484
+ let e = v;
1485
+ for (; e--;) {
1486
+ let t = _[e], r = t.parentElement;
1487
+ r.style.display = p, l ? r.innerHTML = n.innerHTML : r.replaceChild(n.cloneNode(!0), t);
1488
+ }
1489
+ t.push(g), r.appendChild(m);
1490
+ } else console.warn("The expression \"{value}\" is missing from the provided template.");
1491
+ return a && (h.style.outline = `1px dotted ${Pn[i]}`), h;
1492
+ }, zn = class {
1493
+ constructor(e, t = {}) {
1494
+ On ||= yn ? new yn([], { granularity: Tn }) : { segment: (e) => {
1495
+ let t = [], n = e.split(Sn);
1496
+ for (let e = 0, r = n.length; e < r; e++) {
1497
+ let r = n[e];
1498
+ t.push({
1499
+ segment: r,
1500
+ isWordLike: !Cn.test(r)
1501
+ });
1502
+ }
1503
+ return t;
1504
+ } }, kn ||= yn ? new yn([], { granularity: "grapheme" }) : { segment: (e) => [...e].map((e) => ({ segment: e })) }, !An && a && (An = s.createElement("template")), F.current && F.current.register(this);
1505
+ let { words: n, chars: r, lines: i, accessible: o, includeSpaces: c, debug: l } = t, u = (e = oe(e) ? e[0] : e) && e.nodeType ? e : (yt(e) || [])[0], d = i === !0 ? {} : i, f = n === !0 || V(n) ? {} : n, p = r === !0 ? {} : r;
1506
+ this.debug = J(l, !1), this.includeSpaces = J(c, !1), this.accessible = J(o, !0), this.linesOnly = d && !f && !p, this.lineTemplate = se(d) ? Ln(wn, d) : d, this.wordTemplate = se(f) || this.linesOnly ? Ln(Tn, f) : f, this.charTemplate = se(p) ? Ln(En, p) : p, this.$target = u, this.html = u && u.innerHTML, this.lines = [], this.words = [], this.chars = [], this.effects = [], this.effectsCleanups = [], this.cache = null, this.ready = !1, this.width = 0, this.resizeTimeout = null;
1507
+ let m = () => this.html && (d || f || p) && this.split();
1508
+ this.resizeObserver = new ResizeObserver(() => {
1509
+ clearTimeout(this.resizeTimeout), this.resizeTimeout = setTimeout(() => {
1510
+ let e = u.offsetWidth;
1511
+ e !== this.width && (this.width = e, m());
1512
+ }, 150);
1513
+ }), this.lineTemplate && !this.ready ? s.fonts.ready.then(m) : m(), u ? this.resizeObserver.observe(u) : console.warn("No Text Splitter target found.");
1514
+ }
1515
+ addEffect(e) {
1516
+ if (!B(e)) return console.warn("Effect must return a function."), this;
1517
+ let t = en(e);
1518
+ return this.effects.push(t), this.ready && (this.effectsCleanups[this.effects.length - 1] = t(this)), this;
1519
+ }
1520
+ revert() {
1521
+ return clearTimeout(this.resizeTimeout), this.lines.length = this.words.length = this.chars.length = 0, this.resizeObserver.disconnect(), this.effectsCleanups.forEach((e) => B(e) ? e(this) : e.revert && e.revert()), this.$target.innerHTML = this.html, this;
1522
+ }
1523
+ splitNode(e) {
1524
+ let t = this.wordTemplate, n = this.charTemplate, r = this.includeSpaces, i = this.debug, a = e.nodeType;
1525
+ if (a === 3) {
1526
+ let a = e.nodeValue;
1527
+ if (a.trim()) {
1528
+ let o = [], c = this.words, l = this.chars, u = On.segment(a), d = s.createDocumentFragment(), f = null;
1529
+ for (let e of u) {
1530
+ let t = e.segment, n = jn(e);
1531
+ if (!f || n && f && jn(f)) o.push(t);
1532
+ else {
1533
+ let e = o.length - 1, n = o[e];
1534
+ !Sn.test(n) && !Sn.test(t) ? o[e] += t : o.push(t);
1535
+ }
1536
+ f = e;
1537
+ }
1538
+ for (let e = 0, a = o.length; e < a; e++) {
1539
+ let a = o[e];
1540
+ if (a.trim()) {
1541
+ let u = o[e + 1], f = r && u && !u.trim(), p = a, m = n ? kn.segment(p) : null, h = n ? s.createDocumentFragment() : s.createTextNode(f ? a + "\xA0" : a);
1542
+ if (n) {
1543
+ let e = [...m];
1544
+ for (let t = 0, r = e.length; t < r; t++) {
1545
+ let a = e[t], o = t === r - 1 && f ? a.segment + "\xA0" : a.segment;
1546
+ Rn(n, l, s.createTextNode(o), h, En, i, -1, c.length, l.length);
1547
+ }
1548
+ }
1549
+ t ? Rn(t, c, h, d, Tn, i, -1, c.length, l.length) : n ? d.appendChild(h) : d.appendChild(s.createTextNode(a)), f && e++;
1550
+ } else {
1551
+ if (e && r) continue;
1552
+ d.appendChild(s.createTextNode(a));
1553
+ }
1554
+ }
1555
+ e.parentNode.replaceChild(d, e);
1556
+ }
1557
+ } else if (a === 1) {
1558
+ let t = [...e.childNodes];
1559
+ for (let e = 0, n = t.length; e < n; e++) this.splitNode(t[e]);
1560
+ }
1561
+ }
1562
+ split(e = !1) {
1563
+ let t = this.$target, n = !!this.cache && !e, r = this.lineTemplate, i = this.wordTemplate, a = this.charTemplate, o = s.fonts.status !== "loading", c = r && o;
1564
+ this.ready = !r || o, (c || e) && this.effectsCleanups.forEach((e) => B(e) && e(this)), n || (e && (t.innerHTML = this.html, this.words.length = this.chars.length = 0), this.splitNode(t), this.cache = t.innerHTML), c && (n && (t.innerHTML = this.cache), this.lines.length = 0, i && (this.words = Nn(t, Tn))), a && (c || i) && (this.chars = Nn(t, En));
1565
+ let l = this.words.length ? this.words : this.chars, u, d = 0;
1566
+ for (let e = 0, t = l.length; e < t; e++) {
1567
+ let t = l[e], { top: n, height: r } = t.getBoundingClientRect();
1568
+ !V(u) && n - u > r * .5 && d++, t.setAttribute(Dn, `${d}`);
1569
+ let i = t.querySelectorAll(`[${Dn}]`), a = i.length;
1570
+ for (; a--;) i[a].setAttribute(Dn, `${d}`);
1571
+ u = n;
1572
+ }
1573
+ if (c) {
1574
+ let e = s.createDocumentFragment(), n = /* @__PURE__ */ new Set(), o = [];
1575
+ for (let e = 0; e < d + 1; e++) {
1576
+ let r = t.cloneNode(!0);
1577
+ In(r, e, /* @__PURE__ */ new Set()).forEach((e) => {
1578
+ let t = e.parentNode;
1579
+ t && (e.nodeType === 1 && n.add(t), t.removeChild(e));
1580
+ }), o.push(r);
1581
+ }
1582
+ n.forEach(Fn);
1583
+ for (let t = 0, n = o.length; t < n; t++) Rn(r, this.lines, o[t], e, wn, this.debug, t);
1584
+ t.innerHTML = "", t.appendChild(e), i && (this.words = Nn(t, Tn)), a && (this.chars = Nn(t, En));
1585
+ }
1586
+ if (this.linesOnly) {
1587
+ let e = this.words, t = e.length;
1588
+ for (; t--;) {
1589
+ let n = e[t];
1590
+ n.replaceWith(n.textContent);
1591
+ }
1592
+ e.length = 0;
1593
+ }
1594
+ if (this.accessible && (c || !n)) {
1595
+ let e = s.createElement("span");
1596
+ e.style.cssText = "position:absolute;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;", e.innerHTML = this.html, t.insertBefore(e, t.firstChild), this.lines.forEach(Mn), this.words.forEach(Mn), this.chars.forEach(Mn);
1597
+ }
1598
+ return this.width = t.offsetWidth, (c || e) && this.effects.forEach((e, t) => this.effectsCleanups[t] = e(this)), this;
1599
+ }
1600
+ refresh() {
1601
+ this.split(!0);
1602
+ }
1603
+ }, Bn = (e, t) => new zn(e, t), Vn = "1.3.26";
1604
+ function Hn(e, t, n) {
1605
+ return Math.max(e, Math.min(t, n));
1606
+ }
1607
+ function Un(e, t, n) {
1608
+ return (1 - n) * e + n * t;
1609
+ }
1610
+ function Wn(e, t, n, r) {
1611
+ return Un(e, t, 1 - Math.exp(-n * r));
1612
+ }
1613
+ function Gn(e, t) {
1614
+ return (e % t + t) % t;
1615
+ }
1616
+ var Kn = class {
1617
+ isRunning = !1;
1618
+ value = 0;
1619
+ from = 0;
1620
+ to = 0;
1621
+ currentTime = 0;
1622
+ lerp;
1623
+ duration;
1624
+ easing;
1625
+ onUpdate;
1626
+ advance(e) {
1627
+ if (!this.isRunning) return;
1628
+ let t = !1;
1629
+ if (this.duration && this.easing) {
1630
+ this.currentTime += e;
1631
+ let n = Hn(0, this.currentTime / this.duration, 1);
1632
+ t = n >= 1;
1633
+ let r = t ? 1 : this.easing(n);
1634
+ this.value = this.from + (this.to - this.from) * r;
1635
+ } else this.lerp ? (this.value = Wn(this.value, this.to, this.lerp * 60, e), Math.round(this.value) === Math.round(this.to) && (this.value = this.to, t = !0)) : (this.value = this.to, t = !0);
1636
+ t && this.stop(), this.onUpdate?.(this.value, t);
1637
+ }
1638
+ stop() {
1639
+ this.isRunning = !1;
1640
+ }
1641
+ fromTo(e, t, { lerp: n, duration: r, easing: i, onStart: a, onUpdate: o }) {
1642
+ this.from = this.value = e, this.to = t, this.lerp = n, this.duration = r, this.easing = i, this.currentTime = 0, this.isRunning = !0, a?.(), this.onUpdate = o;
1643
+ }
1644
+ };
1645
+ function qn(e, t) {
1646
+ let n;
1647
+ return function(...r) {
1648
+ clearTimeout(n), n = setTimeout(() => {
1649
+ n = void 0, e.apply(this, r);
1650
+ }, t);
1651
+ };
1652
+ }
1653
+ var Jn = class {
1654
+ width = 0;
1655
+ height = 0;
1656
+ scrollHeight = 0;
1657
+ scrollWidth = 0;
1658
+ debouncedResize;
1659
+ wrapperResizeObserver;
1660
+ contentResizeObserver;
1661
+ constructor(e, t, { autoResize: n = !0, debounce: r = 250 } = {}) {
1662
+ this.wrapper = e, this.content = t, n && (this.debouncedResize = qn(this.resize, r), this.wrapper instanceof Window ? window.addEventListener("resize", this.debouncedResize) : (this.wrapperResizeObserver = new ResizeObserver(this.debouncedResize), this.wrapperResizeObserver.observe(this.wrapper)), this.contentResizeObserver = new ResizeObserver(this.debouncedResize), this.contentResizeObserver.observe(this.content)), this.resize();
1663
+ }
1664
+ destroy() {
1665
+ this.wrapperResizeObserver?.disconnect(), this.contentResizeObserver?.disconnect(), this.wrapper === window && this.debouncedResize && window.removeEventListener("resize", this.debouncedResize);
1666
+ }
1667
+ resize = () => {
1668
+ this.onWrapperResize(), this.onContentResize();
1669
+ };
1670
+ onWrapperResize = () => {
1671
+ this.wrapper instanceof Window ? (this.width = window.innerWidth, this.height = window.innerHeight) : (this.width = this.wrapper.clientWidth, this.height = this.wrapper.clientHeight);
1672
+ };
1673
+ onContentResize = () => {
1674
+ this.wrapper instanceof Window ? (this.scrollHeight = this.content.scrollHeight, this.scrollWidth = this.content.scrollWidth) : (this.scrollHeight = this.wrapper.scrollHeight, this.scrollWidth = this.wrapper.scrollWidth);
1675
+ };
1676
+ get limit() {
1677
+ return {
1678
+ x: this.scrollWidth - this.width,
1679
+ y: this.scrollHeight - this.height
1680
+ };
1681
+ }
1682
+ }, Yn = class {
1683
+ events = {};
1684
+ emit(e, ...t) {
1685
+ let n = this.events[e] || [];
1686
+ for (let e = 0, r = n.length; e < r; e++) n[e]?.(...t);
1687
+ }
1688
+ on(e, t) {
1689
+ return this.events[e] ? this.events[e].push(t) : this.events[e] = [t], () => {
1690
+ this.events[e] = this.events[e]?.filter((e) => t !== e);
1691
+ };
1692
+ }
1693
+ off(e, t) {
1694
+ this.events[e] = this.events[e]?.filter((e) => t !== e);
1695
+ }
1696
+ destroy() {
1697
+ this.events = {};
1698
+ }
1699
+ }, Xn = 100 / 6, Zn = { passive: !1 };
1700
+ function Qn(e, t) {
1701
+ return e === 1 ? Xn : e === 2 ? t : 1;
1702
+ }
1703
+ var $n = class {
1704
+ touchStart = {
1705
+ x: 0,
1706
+ y: 0
1707
+ };
1708
+ lastDelta = {
1709
+ x: 0,
1710
+ y: 0
1711
+ };
1712
+ window = {
1713
+ width: 0,
1714
+ height: 0
1715
+ };
1716
+ emitter = new Yn();
1717
+ constructor(e, t = {
1718
+ wheelMultiplier: 1,
1719
+ touchMultiplier: 1
1720
+ }) {
1721
+ this.element = e, this.options = t, window.addEventListener("resize", this.onWindowResize), this.onWindowResize(), this.element.addEventListener("wheel", this.onWheel, Zn), this.element.addEventListener("touchstart", this.onTouchStart, Zn), this.element.addEventListener("touchmove", this.onTouchMove, Zn), this.element.addEventListener("touchend", this.onTouchEnd, Zn);
1722
+ }
1723
+ on(e, t) {
1724
+ return this.emitter.on(e, t);
1725
+ }
1726
+ destroy() {
1727
+ this.emitter.destroy(), window.removeEventListener("resize", this.onWindowResize), this.element.removeEventListener("wheel", this.onWheel, Zn), this.element.removeEventListener("touchstart", this.onTouchStart, Zn), this.element.removeEventListener("touchmove", this.onTouchMove, Zn), this.element.removeEventListener("touchend", this.onTouchEnd, Zn);
1728
+ }
1729
+ onTouchStart = (e) => {
1730
+ let { clientX: t, clientY: n } = e.targetTouches ? e.targetTouches[0] : e;
1731
+ this.touchStart.x = t, this.touchStart.y = n, this.lastDelta = {
1732
+ x: 0,
1733
+ y: 0
1734
+ }, this.emitter.emit("scroll", {
1735
+ deltaX: 0,
1736
+ deltaY: 0,
1737
+ event: e
1738
+ });
1739
+ };
1740
+ onTouchMove = (e) => {
1741
+ let { clientX: t, clientY: n } = e.targetTouches ? e.targetTouches[0] : e, r = -(t - this.touchStart.x) * this.options.touchMultiplier, i = -(n - this.touchStart.y) * this.options.touchMultiplier;
1742
+ this.touchStart.x = t, this.touchStart.y = n, this.lastDelta = {
1743
+ x: r,
1744
+ y: i
1745
+ }, this.emitter.emit("scroll", {
1746
+ deltaX: r,
1747
+ deltaY: i,
1748
+ event: e
1749
+ });
1750
+ };
1751
+ onTouchEnd = (e) => {
1752
+ this.emitter.emit("scroll", {
1753
+ deltaX: this.lastDelta.x,
1754
+ deltaY: this.lastDelta.y,
1755
+ event: e
1756
+ });
1757
+ };
1758
+ onWheel = (e) => {
1759
+ let { deltaX: t, deltaY: n, deltaMode: r } = e, i = Qn(r, this.window.width), a = Qn(r, this.window.height);
1760
+ t *= i, n *= a, t *= this.options.wheelMultiplier, n *= this.options.wheelMultiplier, this.emitter.emit("scroll", {
1761
+ deltaX: t,
1762
+ deltaY: n,
1763
+ event: e
1764
+ });
1765
+ };
1766
+ onWindowResize = () => {
1767
+ this.window = {
1768
+ width: window.innerWidth,
1769
+ height: window.innerHeight
1770
+ };
1771
+ };
1772
+ }, er = (e) => Math.min(1, 1.001 - 2 ** (-10 * e)), tr = class {
1773
+ _isScrolling = !1;
1774
+ _isStopped = !1;
1775
+ _isLocked = !1;
1776
+ _preventNextNativeScrollEvent = !1;
1777
+ _resetVelocityTimeout = null;
1778
+ _rafId = null;
1779
+ _isDraggingSelection = !1;
1780
+ reducedMotionMediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
1781
+ isTouching;
1782
+ isIos;
1783
+ time = 0;
1784
+ userData = {};
1785
+ lastVelocity = 0;
1786
+ velocity = 0;
1787
+ direction = 0;
1788
+ options;
1789
+ targetScroll;
1790
+ animatedScroll;
1791
+ animate = new Kn();
1792
+ emitter = new Yn();
1793
+ dimensions;
1794
+ virtualScroll;
1795
+ constructor({ wrapper: e = window, content: t = document.documentElement, eventsTarget: n = e, smoothWheel: r = !0, syncTouch: i = !1, syncTouchLerp: a = .075, touchInertiaExponent: o = 1.7, duration: s, easing: c, lerp: l = .1, infinite: u = !1, orientation: d = "vertical", gestureOrientation: f = d === "horizontal" ? "both" : "vertical", touchMultiplier: p = 1, wheelMultiplier: m = 1, autoResize: h = !0, prevent: g, virtualScroll: _, overscroll: v = !0, autoRaf: y = !1, anchors: b = !1, autoToggle: x = !1, allowNestedScroll: S = !1, __experimental__naiveDimensions: C = !1, naiveDimensions: w = C, stopInertiaOnNavigate: T = !1, respectReducedMotion: E = !0 } = {}) {
1796
+ window.lenisVersion = Vn, window.lenis || (window.lenis = {}), window.lenis.version = Vn, d === "horizontal" && (window.lenis.horizontal = !0), i === !0 && (window.lenis.touch = !0), this.isIos = /(iPad|iPhone|iPod)/g.test(navigator.userAgent), (!e || e === document.documentElement) && (e = window), typeof s == "number" && typeof c != "function" ? c = er : typeof c == "function" && typeof s != "number" && (s = 1), this.options = {
1797
+ wrapper: e,
1798
+ content: t,
1799
+ eventsTarget: n,
1800
+ smoothWheel: r,
1801
+ syncTouch: i,
1802
+ syncTouchLerp: a,
1803
+ touchInertiaExponent: o,
1804
+ duration: s,
1805
+ easing: c,
1806
+ lerp: l,
1807
+ infinite: u,
1808
+ gestureOrientation: f,
1809
+ orientation: d,
1810
+ touchMultiplier: p,
1811
+ wheelMultiplier: m,
1812
+ autoResize: h,
1813
+ prevent: g,
1814
+ virtualScroll: _,
1815
+ overscroll: v,
1816
+ autoRaf: y,
1817
+ anchors: b,
1818
+ autoToggle: x,
1819
+ allowNestedScroll: S,
1820
+ naiveDimensions: w,
1821
+ stopInertiaOnNavigate: T,
1822
+ respectReducedMotion: E
1823
+ }, this.dimensions = new Jn(e, t, { autoResize: h }), this.updateClassName(), this.targetScroll = this.animatedScroll = this.actualScroll, this.options.wrapper.addEventListener("scroll", this.onNativeScroll), this.options.wrapper.addEventListener("scrollend", this.onScrollEnd, { capture: !0 }), (this.options.anchors || this.options.stopInertiaOnNavigate) && this.options.wrapper.addEventListener("click", this.onClick), this.options.wrapper.addEventListener("pointerdown", this.onPointerDown), this.virtualScroll = new $n(n, {
1824
+ touchMultiplier: p,
1825
+ wheelMultiplier: m
1826
+ }), this.virtualScroll.on("scroll", this.onVirtualScroll), this.options.autoToggle && (this.checkOverflow(), this.rootElement.addEventListener("transitionend", this.onTransitionEnd)), this.options.autoRaf && (this._rafId = requestAnimationFrame(this.raf));
1827
+ }
1828
+ destroy() {
1829
+ this.emitter.destroy(), this.options.wrapper.removeEventListener("scroll", this.onNativeScroll), this.options.wrapper.removeEventListener("scrollend", this.onScrollEnd, { capture: !0 }), this.options.wrapper.removeEventListener("pointerdown", this.onPointerDown), (this.options.anchors || this.options.stopInertiaOnNavigate) && this.options.wrapper.removeEventListener("click", this.onClick), this.virtualScroll.destroy(), this.dimensions.destroy(), this.cleanUpClassName(), this._rafId && cancelAnimationFrame(this._rafId);
1830
+ }
1831
+ on(e, t) {
1832
+ return this.emitter.on(e, t);
1833
+ }
1834
+ off(e, t) {
1835
+ return this.emitter.off(e, t);
1836
+ }
1837
+ onScrollEnd = (e) => {
1838
+ e instanceof CustomEvent || (this.isScrolling === "smooth" || this.isScrolling === !1) && e.stopPropagation();
1839
+ };
1840
+ dispatchScrollendEvent = () => {
1841
+ this.options.wrapper.dispatchEvent(new CustomEvent("scrollend", {
1842
+ bubbles: this.options.wrapper === window,
1843
+ detail: { lenisScrollEnd: !0 }
1844
+ }));
1845
+ };
1846
+ get overflow() {
1847
+ let e = this.isHorizontal ? "overflow-x" : "overflow-y";
1848
+ return getComputedStyle(this.rootElement)[e];
1849
+ }
1850
+ checkOverflow() {
1851
+ ["hidden", "clip"].includes(this.overflow) ? this.internalStop() : this.internalStart();
1852
+ }
1853
+ onTransitionEnd = (e) => {
1854
+ e.propertyName?.includes("overflow") && e.target === this.rootElement && this.checkOverflow();
1855
+ };
1856
+ setScroll(e) {
1857
+ this.isHorizontal ? this.options.wrapper.scrollTo({
1858
+ left: e,
1859
+ behavior: "instant"
1860
+ }) : this.options.wrapper.scrollTo({
1861
+ top: e,
1862
+ behavior: "instant"
1863
+ });
1864
+ }
1865
+ onClick = (e) => {
1866
+ let t = e.composedPath().filter((e) => e instanceof HTMLAnchorElement && e.href).map((e) => new URL(e.href)), n = new URL(window.location.href);
1867
+ if (this.options.anchors) {
1868
+ let e = t.find((e) => n.host === e.host && n.pathname === e.pathname && e.hash);
1869
+ if (e) {
1870
+ let t = typeof this.options.anchors == "object" && this.options.anchors ? this.options.anchors : void 0, n = decodeURIComponent(e.hash);
1871
+ this.scrollTo(n, t);
1872
+ return;
1873
+ }
1874
+ }
1875
+ if (this.options.stopInertiaOnNavigate && t.some((e) => n.host === e.host && n.pathname !== e.pathname)) {
1876
+ this.reset();
1877
+ return;
1878
+ }
1879
+ };
1880
+ onPointerDown = (e) => {
1881
+ e.button === 1 && this.reset();
1882
+ };
1883
+ isTouchOnSelectionHandle(e) {
1884
+ let t = window.getSelection();
1885
+ if (!t || t.isCollapsed || t.rangeCount === 0) return !1;
1886
+ let n = e.targetTouches[0] ?? e.changedTouches[0];
1887
+ if (!n) return !1;
1888
+ let r = t.getRangeAt(0).getClientRects();
1889
+ if (r.length === 0) return !1;
1890
+ let i = r[0], a = r[r.length - 1], o = Math.hypot(n.clientX - i.left, n.clientY - i.top) <= 40, s = Math.hypot(n.clientX - a.right, n.clientY - a.bottom) <= 40;
1891
+ return o || s;
1892
+ }
1893
+ onVirtualScroll = (e) => {
1894
+ if (typeof this.options.virtualScroll == "function" && this.options.virtualScroll(e) === !1) return;
1895
+ let { deltaX: t, deltaY: n, event: r } = e;
1896
+ if (this.emitter.emit("virtual-scroll", {
1897
+ deltaX: t,
1898
+ deltaY: n,
1899
+ event: r
1900
+ }), r.ctrlKey || r.lenisStopPropagation) return;
1901
+ let i = r.type.includes("touch"), a = r.type.includes("wheel");
1902
+ if (i && this.isIos && (r.type === "touchstart" && (this._isDraggingSelection = this.isTouchOnSelectionHandle(r)), this._isDraggingSelection)) {
1903
+ r.type === "touchend" && (this._isDraggingSelection = !1);
1904
+ return;
1905
+ }
1906
+ this.isTouching = r.type === "touchstart" || r.type === "touchmove";
1907
+ let o = t === 0 && n === 0;
1908
+ if (this.options.syncTouch && i && r.type === "touchstart" && o && !this.isStopped && !this.isLocked) {
1909
+ this.reset();
1910
+ return;
1911
+ }
1912
+ let s = this.options.gestureOrientation === "vertical" && n === 0 || this.options.gestureOrientation === "horizontal" && t === 0;
1913
+ if (o || s) return;
1914
+ let c = r.composedPath();
1915
+ c = c.slice(0, c.indexOf(this.rootElement));
1916
+ let l = this.options.prevent, u = Math.abs(t) >= Math.abs(n) ? "horizontal" : "vertical";
1917
+ if (c.find((e) => e instanceof HTMLElement && (typeof l == "function" && l?.(e) || e.hasAttribute?.("data-lenis-prevent") || u === "vertical" && e.hasAttribute?.("data-lenis-prevent-vertical") || u === "horizontal" && e.hasAttribute?.("data-lenis-prevent-horizontal") || i && e.hasAttribute?.("data-lenis-prevent-touch") || a && e.hasAttribute?.("data-lenis-prevent-wheel") || this.options.allowNestedScroll && this.hasNestedScroll(e, {
1918
+ deltaX: t,
1919
+ deltaY: n
1920
+ })))) return;
1921
+ if (this.isStopped || this.isLocked) {
1922
+ r.cancelable && r.preventDefault();
1923
+ return;
1924
+ }
1925
+ if (!(this.options.syncTouch && i || this.options.smoothWheel && a)) {
1926
+ this.isScrolling = "native", this.animate.stop(), r.lenisStopPropagation = !0;
1927
+ return;
1928
+ }
1929
+ let d = n;
1930
+ this.options.gestureOrientation === "both" ? d = Math.abs(n) > Math.abs(t) ? n : t : this.options.gestureOrientation === "horizontal" && (d = t), (!this.options.overscroll || this.options.infinite || this.options.wrapper !== window && this.limit > 0 && (this.animatedScroll > 0 && this.animatedScroll < this.limit || this.animatedScroll === 0 && n > 0 || this.animatedScroll === this.limit && n < 0)) && (r.lenisStopPropagation = !0), r.cancelable && r.preventDefault();
1931
+ let f = i && this.options.syncTouch, p = i && r.type === "touchend";
1932
+ p && (d = Math.sign(d) * Math.abs(this.velocity) ** this.options.touchInertiaExponent), this.scrollTo(this.targetScroll + d, {
1933
+ programmatic: !1,
1934
+ ...f ? { lerp: p ? this.options.syncTouchLerp : 1 } : {
1935
+ lerp: this.options.lerp,
1936
+ duration: this.options.duration,
1937
+ easing: this.options.easing
1938
+ }
1939
+ });
1940
+ };
1941
+ resize() {
1942
+ this.dimensions.resize(), this.animatedScroll = this.targetScroll = this.actualScroll, this.emit();
1943
+ }
1944
+ emit() {
1945
+ this.emitter.emit("scroll", this);
1946
+ }
1947
+ onNativeScroll = () => {
1948
+ if (this._resetVelocityTimeout !== null && (clearTimeout(this._resetVelocityTimeout), this._resetVelocityTimeout = null), this._preventNextNativeScrollEvent) {
1949
+ this._preventNextNativeScrollEvent = !1;
1950
+ return;
1951
+ }
1952
+ if (this.isScrolling === !1 || this.isScrolling === "native") {
1953
+ let e = this.animatedScroll;
1954
+ this.animatedScroll = this.targetScroll = this.actualScroll, this.lastVelocity = this.velocity, this.velocity = this.animatedScroll - e, this.direction = Math.sign(this.animatedScroll - e), this.isStopped || (this.isScrolling = "native"), this.emit(), this.velocity !== 0 && (this._resetVelocityTimeout = setTimeout(() => {
1955
+ this.lastVelocity = this.velocity, this.velocity = 0, this.isScrolling = !1, this.emit();
1956
+ }, 400));
1957
+ }
1958
+ };
1959
+ reset() {
1960
+ this.isLocked = !1, this.isScrolling = !1, this.animatedScroll = this.targetScroll = this.actualScroll, this.lastVelocity = this.velocity = 0, this.animate.stop();
1961
+ }
1962
+ start() {
1963
+ if (this.isStopped) {
1964
+ if (this.options.autoToggle) {
1965
+ this.rootElement.style.removeProperty("overflow");
1966
+ return;
1967
+ }
1968
+ this.internalStart();
1969
+ }
1970
+ }
1971
+ internalStart() {
1972
+ this.isStopped && (this.reset(), this.isStopped = !1, this.emit());
1973
+ }
1974
+ stop() {
1975
+ if (!this.isStopped) {
1976
+ if (this.options.autoToggle) {
1977
+ this.rootElement.style.setProperty("overflow", "clip");
1978
+ return;
1979
+ }
1980
+ this.internalStop();
1981
+ }
1982
+ }
1983
+ internalStop() {
1984
+ this.isStopped || (this.reset(), this.isStopped = !0, this.emit());
1985
+ }
1986
+ raf = (e) => {
1987
+ let t = e - (this.time || e);
1988
+ this.time = e, this.animate.advance(t * .001), this.options.autoRaf && (this._rafId = requestAnimationFrame(this.raf));
1989
+ };
1990
+ scrollTo(e, { offset: t = 0, immediate: n = !1, lock: r = !1, programmatic: i = !0, lerp: a = i ? this.options.lerp : void 0, duration: o = i ? this.options.duration : void 0, easing: s = i ? this.options.easing : void 0, onStart: c, onComplete: l, force: u = !1, userData: d } = {}) {
1991
+ if (this.prefersReducedMotion && (i ? n = !0 : (a = 1, o = void 0, s = void 0)), (this.isStopped || this.isLocked) && !u) return;
1992
+ let f = e, p = t;
1993
+ if (typeof f == "string" && [
1994
+ "top",
1995
+ "left",
1996
+ "start",
1997
+ "#"
1998
+ ].includes(f)) f = 0;
1999
+ else if (typeof f == "string" && [
2000
+ "bottom",
2001
+ "right",
2002
+ "end"
2003
+ ].includes(f)) f = this.limit;
2004
+ else {
2005
+ let e = null;
2006
+ if (typeof f == "string" ? (e = f.startsWith("#") ? document.getElementById(f.slice(1)) : document.querySelector(f), e || (f === "#top" ? f = 0 : console.warn("Lenis: Target not found", f))) : f instanceof HTMLElement && f?.nodeType && (e = f), e) {
2007
+ if (this.options.wrapper !== window) {
2008
+ let e = this.rootElement.getBoundingClientRect();
2009
+ p -= this.isHorizontal ? e.left : e.top;
2010
+ }
2011
+ let t = e.getBoundingClientRect(), n = getComputedStyle(e), r = this.isHorizontal ? Number.parseFloat(n.scrollMarginLeft) : Number.parseFloat(n.scrollMarginTop), i = getComputedStyle(this.rootElement), a = this.isHorizontal ? Number.parseFloat(i.scrollPaddingLeft) : Number.parseFloat(i.scrollPaddingTop);
2012
+ f = (this.isHorizontal ? t.left : t.top) + this.animatedScroll - (Number.isNaN(r) ? 0 : r) - (Number.isNaN(a) ? 0 : a);
2013
+ }
2014
+ }
2015
+ if (typeof f == "number") {
2016
+ if (f += p, this.options.infinite) {
2017
+ if (i) {
2018
+ this.targetScroll = this.animatedScroll = this.scroll;
2019
+ let e = f - this.animatedScroll;
2020
+ e > this.limit / 2 ? f -= this.limit : e < -this.limit / 2 && (f += this.limit);
2021
+ }
2022
+ } else f = Hn(0, f, this.limit);
2023
+ if (f === this.targetScroll) {
2024
+ c?.(this), l?.(this);
2025
+ return;
2026
+ }
2027
+ if (this.userData = d ?? {}, n) {
2028
+ this.animatedScroll = this.targetScroll = f, this.setScroll(this.scroll), this.reset(), this.preventNextNativeScrollEvent(), this.emit(), l?.(this), this.userData = {}, requestAnimationFrame(() => {
2029
+ this.dispatchScrollendEvent();
2030
+ });
2031
+ return;
2032
+ }
2033
+ i || (this.targetScroll = f), typeof o == "number" && typeof s != "function" ? s = er : typeof s == "function" && typeof o != "number" && (o = 1), this.animate.fromTo(this.animatedScroll, f, {
2034
+ duration: o,
2035
+ easing: s,
2036
+ lerp: a,
2037
+ onStart: () => {
2038
+ r && (this.isLocked = !0), this.isScrolling = "smooth", c?.(this);
2039
+ },
2040
+ onUpdate: (e, t) => {
2041
+ this.isScrolling = "smooth", this.lastVelocity = this.velocity, this.velocity = e - this.animatedScroll, this.direction = Math.sign(this.velocity), this.animatedScroll = e, this.setScroll(this.scroll), i && (this.targetScroll = e), t || this.emit(), t && (this.reset(), this.emit(), l?.(this), this.userData = {}, requestAnimationFrame(() => {
2042
+ this.dispatchScrollendEvent();
2043
+ }), this.preventNextNativeScrollEvent());
2044
+ }
2045
+ });
2046
+ }
2047
+ }
2048
+ preventNextNativeScrollEvent() {
2049
+ this._preventNextNativeScrollEvent = !0, requestAnimationFrame(() => {
2050
+ this._preventNextNativeScrollEvent = !1;
2051
+ });
2052
+ }
2053
+ hasNestedScroll(e, { deltaX: t, deltaY: n }) {
2054
+ let r = Date.now();
2055
+ e._lenis ||= {};
2056
+ let i = e._lenis, a, o, s, c, l, u, d, f, p, m;
2057
+ if (r - (i.time ?? 0) > 2e3) {
2058
+ i.time = Date.now();
2059
+ let t = window.getComputedStyle(e);
2060
+ if (i.computedStyle = t, a = [
2061
+ "auto",
2062
+ "overlay",
2063
+ "scroll"
2064
+ ].includes(t.overflowX), o = [
2065
+ "auto",
2066
+ "overlay",
2067
+ "scroll"
2068
+ ].includes(t.overflowY), l = ["auto"].includes(t.overscrollBehaviorX), u = ["auto"].includes(t.overscrollBehaviorY), i.hasOverflowX = a, i.hasOverflowY = o, !(a || o)) return !1;
2069
+ d = e.scrollWidth, f = e.scrollHeight, p = e.clientWidth, m = e.clientHeight, s = d > p, c = f > m, i.isScrollableX = s, i.isScrollableY = c, i.scrollWidth = d, i.scrollHeight = f, i.clientWidth = p, i.clientHeight = m, i.hasOverscrollBehaviorX = l, i.hasOverscrollBehaviorY = u;
2070
+ } else s = i.isScrollableX, c = i.isScrollableY, a = i.hasOverflowX, o = i.hasOverflowY, d = i.scrollWidth, f = i.scrollHeight, p = i.clientWidth, m = i.clientHeight, l = i.hasOverscrollBehaviorX, u = i.hasOverscrollBehaviorY;
2071
+ if (!(a && s || o && c)) return !1;
2072
+ let h = Math.abs(t) >= Math.abs(n) ? "horizontal" : "vertical", g, _, v, y, b, x;
2073
+ if (h === "horizontal") g = Math.round(e.scrollLeft), _ = d - p, v = t, y = a, b = s, x = l;
2074
+ else if (h === "vertical") g = Math.round(e.scrollTop), _ = f - m, v = n, y = o, b = c, x = u;
2075
+ else return !1;
2076
+ return !x && (g >= _ || g <= 0) || (v > 0 ? g < _ : g > 0) && y && b;
2077
+ }
2078
+ get rootElement() {
2079
+ return this.options.wrapper === window ? document.documentElement : this.options.wrapper;
2080
+ }
2081
+ get limit() {
2082
+ return this.options.naiveDimensions ? this.isHorizontal ? this.rootElement.scrollWidth - this.rootElement.clientWidth : this.rootElement.scrollHeight - this.rootElement.clientHeight : this.dimensions.limit[this.isHorizontal ? "x" : "y"];
2083
+ }
2084
+ get isHorizontal() {
2085
+ return this.options.orientation === "horizontal";
2086
+ }
2087
+ get actualScroll() {
2088
+ let e = this.options.wrapper;
2089
+ return this.isHorizontal ? e.scrollX ?? e.scrollLeft : e.scrollY ?? e.scrollTop;
2090
+ }
2091
+ get scroll() {
2092
+ return this.options.infinite ? Gn(this.animatedScroll, this.limit) : this.animatedScroll;
2093
+ }
2094
+ get progress() {
2095
+ return this.limit === 0 ? 1 : this.scroll / this.limit;
2096
+ }
2097
+ get isScrolling() {
2098
+ return this._isScrolling;
2099
+ }
2100
+ set isScrolling(e) {
2101
+ this._isScrolling !== e && (this._isScrolling = e, this.updateClassName());
2102
+ }
2103
+ get isStopped() {
2104
+ return this._isStopped;
2105
+ }
2106
+ set isStopped(e) {
2107
+ this._isStopped !== e && (this._isStopped = e, this.updateClassName());
2108
+ }
2109
+ get isLocked() {
2110
+ return this._isLocked;
2111
+ }
2112
+ set isLocked(e) {
2113
+ this._isLocked !== e && (this._isLocked = e, this.updateClassName());
2114
+ }
2115
+ get isSmooth() {
2116
+ return this.isScrolling === "smooth";
2117
+ }
2118
+ get prefersReducedMotion() {
2119
+ return this.options.respectReducedMotion && this.reducedMotionMediaQuery.matches;
2120
+ }
2121
+ get className() {
2122
+ let e = "lenis";
2123
+ return this.options.autoToggle && (e += " lenis-autoToggle"), this.isStopped && (e += " lenis-stopped"), this.isLocked && (e += " lenis-locked"), this.isScrolling && (e += " lenis-scrolling"), this.isScrolling === "smooth" && (e += " lenis-smooth"), e;
2124
+ }
2125
+ updateClassName() {
2126
+ this.cleanUpClassName(), this.className.split(" ").forEach((e) => {
2127
+ this.rootElement.classList.add(e);
2128
+ });
2129
+ }
2130
+ cleanUpClassName() {
2131
+ for (let e of Array.from(this.rootElement.classList)) (e === "lenis" || e.startsWith("lenis-")) && this.rootElement.classList.remove(e);
2132
+ }
2133
+ }, nr = [
2134
+ "linear",
2135
+ "outQuad",
2136
+ "outCubic",
2137
+ "outExpo",
2138
+ "inOutSine",
2139
+ "outBack",
2140
+ "outElastic",
2141
+ "outBounce"
2142
+ ], rr = n({
2143
+ duration: 600,
2144
+ ease: "outExpo",
2145
+ reducedMotion: "reduce",
2146
+ smoothScroll: !1,
2147
+ smoothScrollLerp: .1
2148
+ });
2149
+ function ir(e) {
2150
+ Object.assign(rr, e);
2151
+ }
2152
+ var ar = {
2153
+ fade: {
2154
+ category: "enter",
2155
+ from: { opacity: 0 }
2156
+ },
2157
+ "slide-up": {
2158
+ category: "enter",
2159
+ from: {
2160
+ opacity: 0,
2161
+ y: 32
2162
+ }
2163
+ },
2164
+ "slide-down": {
2165
+ category: "enter",
2166
+ from: {
2167
+ opacity: 0,
2168
+ y: -32
2169
+ }
2170
+ },
2171
+ "slide-left": {
2172
+ category: "enter",
2173
+ from: {
2174
+ opacity: 0,
2175
+ x: 32
2176
+ }
2177
+ },
2178
+ "slide-right": {
2179
+ category: "enter",
2180
+ from: {
2181
+ opacity: 0,
2182
+ x: -32
2183
+ }
2184
+ },
2185
+ zoom: {
2186
+ category: "enter",
2187
+ from: {
2188
+ opacity: 0,
2189
+ scale: .8
2190
+ }
2191
+ },
2192
+ blur: {
2193
+ category: "enter",
2194
+ from: {
2195
+ blur: 8,
2196
+ opacity: 0
2197
+ }
2198
+ },
2199
+ count: {
2200
+ category: "enter",
2201
+ count: !0,
2202
+ duration: 1600
2203
+ },
2204
+ grow: {
2205
+ category: "emphasis",
2206
+ to: { scale: 1.05 }
2207
+ },
2208
+ shrink: {
2209
+ category: "emphasis",
2210
+ to: { scale: .95 }
2211
+ },
2212
+ lift: {
2213
+ category: "emphasis",
2214
+ to: { y: -6 }
2215
+ },
2216
+ tilt: {
2217
+ category: "emphasis",
2218
+ to: { rotate: 3 }
2219
+ },
2220
+ pulse: {
2221
+ alternate: !0,
2222
+ category: "ambient",
2223
+ ease: "inOutSine",
2224
+ loop: !0,
2225
+ params: { scale: 1.06 }
2226
+ },
2227
+ float: {
2228
+ alternate: !0,
2229
+ category: "ambient",
2230
+ ease: "inOutSine",
2231
+ loop: !0,
2232
+ params: { translateY: -8 }
2233
+ },
2234
+ spin: {
2235
+ category: "ambient",
2236
+ ease: "linear",
2237
+ loop: !0,
2238
+ params: { rotate: 360 }
2239
+ },
2240
+ shake: {
2241
+ category: "ambient",
2242
+ ease: "linear",
2243
+ loop: !0,
2244
+ params: { translateX: [
2245
+ 0,
2246
+ -6,
2247
+ 6,
2248
+ -6,
2249
+ 6,
2250
+ 0
2251
+ ] }
2252
+ },
2253
+ blink: {
2254
+ alternate: !0,
2255
+ category: "ambient",
2256
+ ease: "inOutSine",
2257
+ loop: !0,
2258
+ params: { opacity: .4 }
2259
+ },
2260
+ wiggle: {
2261
+ alternate: !0,
2262
+ category: "ambient",
2263
+ ease: "inOutSine",
2264
+ loop: !0,
2265
+ params: { rotate: {
2266
+ from: -3,
2267
+ to: 3
2268
+ } }
2269
+ }
2270
+ }, or = {
2271
+ blur: 0,
2272
+ opacity: 1,
2273
+ rotate: 0,
2274
+ scale: 1,
2275
+ x: 0,
2276
+ y: 0
2277
+ }, sr = {
2278
+ center: .5,
2279
+ top: 0
2280
+ }, cr = 4, lr = /* @__PURE__ */ new WeakMap(), ur = /* @__PURE__ */ new WeakMap();
2281
+ function dr({ from: e, to: t }, n) {
2282
+ let r = {};
2283
+ for (let i of Object.keys(or)) {
2284
+ let a = e?.[i] ?? or[i], o = t?.[i] ?? or[i];
2285
+ if (a === o) continue;
2286
+ let s = o + (o - a) * cr, c = n ? [
2287
+ a,
2288
+ o,
2289
+ i === "blur" || i === "scale" ? Math.max(0, s) : s
2290
+ ] : [a, o];
2291
+ switch (i) {
2292
+ case "blur":
2293
+ r.filter = c.map((e) => `blur(${e}px)`);
2294
+ break;
2295
+ case "x":
2296
+ r.translateX = c;
2297
+ break;
2298
+ case "y":
2299
+ r.translateY = c;
2300
+ break;
2301
+ default: r[i] = c;
2302
+ }
2303
+ }
2304
+ return r;
2305
+ }
2306
+ function fr(e) {
2307
+ return e.preset === "custom" ? {
2308
+ category: "enter",
2309
+ from: e.from,
2310
+ to: e.to
2311
+ } : ar[e.preset];
2312
+ }
2313
+ function pr({ options: e, preset: t, trigger: n }) {
2314
+ return n === "scroll" && e.scrollMode === "continue" && !t.params && !t.count;
2315
+ }
2316
+ function mr() {
2317
+ return rr.reducedMotion === "reduce" && typeof matchMedia < "u" && matchMedia("(prefers-reduced-motion: reduce)").matches;
2318
+ }
2319
+ function hr(e) {
2320
+ let { state: t, ...n } = e;
2321
+ return JSON.stringify(n);
2322
+ }
2323
+ function gr({ options: e, preset: t, reduced: n }) {
2324
+ return n ? !1 : e.loop === void 0 ? t.loop ?? !1 : e.loop < 0 || e.loop;
2325
+ }
2326
+ function _r({ options: e, reduced: t }) {
2327
+ return t ? void 0 : e.stagger ?? (e.split ? 30 : void 0);
2328
+ }
2329
+ function vr(e, t = e.options.delay ?? 0) {
2330
+ if (e.reduced) return 0;
2331
+ let n = _r(e);
2332
+ return n === void 0 ? t : vn(n, {
2333
+ from: e.options.staggerFrom ?? "first",
2334
+ start: t
2335
+ });
2336
+ }
2337
+ function yr(e, t, n, r = e.options.delay ?? 0) {
2338
+ if (e.reduced) return 0;
2339
+ let i = _r(e) ?? 0;
2340
+ switch (e.options.staggerFrom) {
2341
+ case "last": return r + (n - 1 - t) * i;
2342
+ case "center": return r + Math.abs(t - (n - 1) / 2) * i;
2343
+ case "random": return r + Math.random() * (n - 1) * i;
2344
+ default: return r + t * i;
2345
+ }
2346
+ }
2347
+ function br(e) {
2348
+ let t = e.closest("[data-scroll-root]");
2349
+ if (t) return t;
2350
+ for (let t = e.parentElement; t; t = t.parentElement) if (/auto|scroll|overlay/.test(getComputedStyle(t).overflowY) && t.scrollHeight > t.clientHeight) return t;
2351
+ }
2352
+ function xr(e) {
2353
+ return Math.min(1, Math.max(0, e));
2354
+ }
2355
+ function Sr(e, t, n) {
2356
+ let { options: r } = e, i = t.container.height, a = t.distance || 1, o = Math.max(a - i, 0), s = sr[r.scrollAnchor ?? "top"], c = xr((r.scrollTarget ?? 50) / 100), l = (e, t) => (i + e * o - t * i) / a, u = l(s, 1), d = l(s, c), f = Math.max(d - u, 1e-4);
2357
+ if (r.scrollMode === "hold") {
2358
+ let e = l(s, Math.max(c, 1 - c)), t = l(1 - s, Math.min(c, 1 - c)), r = l(1 - s, 0);
2359
+ return n < e ? xr((n - u) / Math.max(e - u, 1e-4)) : n <= t ? 1 : xr((r - n) / Math.max(r - t, 1e-4));
2360
+ }
2361
+ return pr(e) ? n < d ? .5 * xr((n - u) / f) : .5 + .5 * Math.min(1, (n - d) / f / cr) : xr((n - u) / f);
2362
+ }
2363
+ function Cr(e) {
2364
+ let t = br(e.element), n = pn({
2365
+ container: t,
2366
+ enter: "end start",
2367
+ leave: "start end",
2368
+ sync: (t) => Sr(e, n, t),
2369
+ target: e.element
2370
+ });
2371
+ return wr(e, n, t), n;
2372
+ }
2373
+ function wr({ controller: e, element: t }, n, r) {
2374
+ let i = new ResizeObserver(() => n.container.refresh());
2375
+ i.observe(t), [...(r ?? document.body).children].forEach((e) => i.observe(e)), e.cleanups.push(() => i.disconnect());
2376
+ }
2377
+ function Tr(e) {
2378
+ switch (e.trigger) {
2379
+ case "mount": return !0;
2380
+ case "visible": return e.controller.revealed;
2381
+ case "scroll": return Cr(e);
2382
+ default: return !1;
2383
+ }
2384
+ }
2385
+ function Er(e) {
2386
+ let t = new IntersectionObserver((n) => {
2387
+ n.some((e) => e.isIntersecting) && (t.disconnect(), e.controller.revealed = !0, Yr(e.controller));
2388
+ });
2389
+ t.observe(e.element), e.controller.cleanups.push(() => t.disconnect());
2390
+ }
2391
+ var Dr = /-?\d[\d,]*(\.\d+)?/;
2392
+ function Or(e, t) {
2393
+ let n = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);
2394
+ for (let e = n.nextNode(); e; e = n.nextNode()) {
2395
+ let n = e, r = Dr.exec(n.data);
2396
+ if (r) return {
2397
+ decimals: r[1] ? r[1].length - 1 : 0,
2398
+ from: t,
2399
+ grouping: r[0].includes(","),
2400
+ node: n,
2401
+ original: n.data,
2402
+ prefix: n.data.slice(0, r.index),
2403
+ rendered: n.data,
2404
+ suffix: n.data.slice(r.index + r[0].length),
2405
+ to: Number(r[0].replaceAll(",", "")),
2406
+ value: t
2407
+ };
2408
+ }
2409
+ }
2410
+ function kr(e) {
2411
+ let t = e.value.toLocaleString("en-US", {
2412
+ maximumFractionDigits: e.decimals,
2413
+ minimumFractionDigits: e.decimals,
2414
+ useGrouping: e.grouping
2415
+ });
2416
+ e.rendered = e.prefix + t + e.suffix, e.node.data = e.rendered;
2417
+ }
2418
+ function Ar(e) {
2419
+ e.node.data === e.rendered && (e.node.data = e.original);
2420
+ }
2421
+ function jr({ controller: e, options: t }, n) {
2422
+ let r = (Array.isArray(n) ? n : [n]).map((e) => Or(e, t.countFrom ?? 0)).filter((e) => !!e);
2423
+ return e.cleanups.push(() => r.forEach(Ar)), r;
2424
+ }
2425
+ function Mr(e, t) {
2426
+ return Jt(e, {
2427
+ ...t,
2428
+ onUpdate: () => e.forEach(kr),
2429
+ value: {
2430
+ from: (t, n) => e[n].from,
2431
+ to: (t, n) => e[n].to
2432
+ }
2433
+ });
2434
+ }
2435
+ function Nr(e) {
2436
+ return e instanceof HTMLElement && ![
2437
+ "LINK",
2438
+ "META",
2439
+ "SCRIPT",
2440
+ "STYLE",
2441
+ "TEMPLATE"
2442
+ ].includes(e.tagName);
2443
+ }
2444
+ function Pr(e) {
2445
+ return [...e.children].filter(Nr);
2446
+ }
2447
+ function Fr(e) {
2448
+ return e.sort((e, t) => e.element.compareDocumentPosition(t.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
2449
+ }
2450
+ function Ir({ controller: e, element: t }) {
2451
+ return lr.get(t) === e;
2452
+ }
2453
+ function Lr({ controller: e }, t) {
2454
+ for (let n of Array.isArray(t) ? t : [t]) {
2455
+ if (getComputedStyle(n).display !== "inline") continue;
2456
+ let t = n.style.display;
2457
+ n.style.display = "inline-block", e.cleanups.push(() => {
2458
+ n.style.display = t;
2459
+ });
2460
+ }
2461
+ }
2462
+ function Rr(e, t, n, r = Tr(e)) {
2463
+ let { controller: i, options: a, preset: o, reduced: s } = e, c = pr(e), l = o.count ? jr(e, t) : [];
2464
+ o.count || Lr(e, t);
2465
+ let u = {
2466
+ alternate: a.alternate ?? o.alternate ?? !1,
2467
+ autoplay: r,
2468
+ delay: n,
2469
+ duration: s ? 0 : a.duration ?? o.duration ?? rr.duration,
2470
+ ease: a.ease ?? (c ? "linear" : o.ease ?? rr.ease),
2471
+ loop: gr(e)
2472
+ }, d = o.count ? Mr(l, u) : Jt(t, {
2473
+ ...o.params ?? dr(o, c),
2474
+ ...u
2475
+ });
2476
+ return l.forEach(kr), e.trigger === "visible" && !r && d.seek(0), i.animations.push(d), d;
2477
+ }
2478
+ function zr({ controller: e, element: t }, n) {
2479
+ let r = new MutationObserver((e) => {
2480
+ let t = e.flatMap((e) => [...e.addedNodes]).filter(Nr);
2481
+ (t.length || e.some((e) => [...e.removedNodes].some(Nr))) && n(t);
2482
+ });
2483
+ r.observe(t, { childList: !0 }), e.cleanups.push(() => r.disconnect());
2484
+ }
2485
+ function Br(e) {
2486
+ Rr(e, Pr(e.element), vr(e)), zr(e, (t) => {
2487
+ t.length && Rr(e, t, vr(e, 0));
2488
+ }), Qr(e);
2489
+ }
2490
+ function Vr(e) {
2491
+ let t = new Map(e.map((e) => [e.element, e])), n = new IntersectionObserver((e) => {
2492
+ let r = Fr(e.filter((e) => e.isIntersecting).map((e) => t.get(e.target)).filter((e) => !!e && Ir(e)));
2493
+ r.forEach((e, t) => {
2494
+ n.unobserve(e.element);
2495
+ let i = setTimeout(() => Yr(e.controller), yr(e, t, r.length, 0));
2496
+ e.controller.cleanups.push(() => clearTimeout(i));
2497
+ });
2498
+ });
2499
+ for (let t of e) Rr(t, t.element, t.options.delay ?? 0, !1), n.observe(t.element), t.controller.cleanups.push(() => n.unobserve(t.element));
2500
+ }
2501
+ var Hr = /* @__PURE__ */ new WeakMap(), Ur = 0, Wr = /* @__PURE__ */ new Map();
2502
+ function Gr(e) {
2503
+ return e ? (Hr.has(e) || Hr.set(e, Ur++), String(Hr.get(e))) : "none";
2504
+ }
2505
+ function Kr(e) {
2506
+ Wr.size || queueMicrotask(qr);
2507
+ let t = `${Gr(e.element.parentElement)}/${e.controller.key}`;
2508
+ Wr.set(t, [...Wr.get(t) ?? [], e]);
2509
+ }
2510
+ function qr() {
2511
+ let e = [...Wr.values()];
2512
+ Wr = /* @__PURE__ */ new Map();
2513
+ for (let t of e) {
2514
+ let e = Fr(t.filter(Ir));
2515
+ e.length === 1 ? Br(e[0]) : e[0]?.trigger === "visible" ? Vr(e) : e.forEach((t, n) => Rr(t, t.element, yr(t, n, e.length)));
2516
+ }
2517
+ }
2518
+ function Jr({ controller: e, element: t }, n, r) {
2519
+ for (let i of n) t.addEventListener(i, r), e.cleanups.push(() => t.removeEventListener(i, r));
2520
+ }
2521
+ function Yr(e) {
2522
+ e.animations.forEach((e) => e.play());
2523
+ }
2524
+ function Xr(e) {
2525
+ e.animations.forEach((t) => e.looping ? t.pause().seek(0) : t.reverse());
2526
+ }
2527
+ function Zr(e, t, n) {
2528
+ if (e.state !== t) {
2529
+ if (e.state = t, n && !e.looping) {
2530
+ e.animations.forEach((e) => e.seek(t ? e.duration : 0));
2531
+ return;
2532
+ }
2533
+ t ? Yr(e) : Xr(e);
2534
+ }
2535
+ }
2536
+ function Qr(e) {
2537
+ let { controller: t, options: n, trigger: r } = e;
2538
+ switch (r) {
2539
+ case "hover":
2540
+ Jr(e, ["pointerenter"], () => Yr(t)), Jr(e, ["pointerleave"], () => Xr(t));
2541
+ break;
2542
+ case "press":
2543
+ Jr(e, ["pointerdown"], () => Yr(t)), Jr(e, [
2544
+ "pointerup",
2545
+ "pointerleave",
2546
+ "pointercancel"
2547
+ ], () => Xr(t));
2548
+ break;
2549
+ case "focus":
2550
+ Jr(e, ["focusin"], () => Yr(t)), Jr(e, ["focusout"], () => Xr(t));
2551
+ break;
2552
+ case "state":
2553
+ Zr(t, !!n.state, !0);
2554
+ return;
2555
+ case "visible":
2556
+ Er(e);
2557
+ return;
2558
+ default: return;
2559
+ }
2560
+ t.animations.forEach((e) => e.seek(0));
2561
+ }
2562
+ function $r(e, t) {
2563
+ ei(e);
2564
+ let n = {
2565
+ animations: [],
2566
+ cleanups: [],
2567
+ key: hr(t),
2568
+ looping: !1,
2569
+ revealed: !1
2570
+ };
2571
+ lr.set(e, n);
2572
+ let r = fr(t), i = mr();
2573
+ if (!r || i && (r.loop || t.trigger === "scroll")) return;
2574
+ let a = {
2575
+ controller: n,
2576
+ element: e,
2577
+ options: t,
2578
+ preset: r,
2579
+ reduced: i,
2580
+ trigger: i && t.trigger === "visible" ? "mount" : t.trigger
2581
+ };
2582
+ if (n.looping = gr(a) === !0, t.split && !r.count) n.splitter = Bn(e, { [t.split]: !0 }), Rr(a, n.splitter[t.split], vr(a));
2583
+ else if (t.stagger === void 0) Rr(a, e, vr(a));
2584
+ else if (a.trigger === "mount" || a.trigger === "visible") {
2585
+ Kr(a);
2586
+ return;
2587
+ } else Rr(a, Pr(e), vr(a)), zr(a, () => $r(e, t));
2588
+ Qr(a);
2589
+ }
2590
+ function ei(e) {
2591
+ let t = lr.get(e);
2592
+ t && (t.cleanups.forEach((e) => e()), t.animations.forEach((e) => e.revert()), t.splitter?.revert(), lr.delete(e));
2593
+ }
2594
+ function ti(e) {
2595
+ for (let t of e) {
2596
+ let e = ur.get(t);
2597
+ e && $r(t, e);
2598
+ }
2599
+ }
2600
+ var ni = {
2601
+ mounted(e, { value: t }) {
2602
+ ur.set(e, t), $r(e, t);
2603
+ },
2604
+ updated(e, { value: t }) {
2605
+ ur.set(e, t);
2606
+ let n = lr.get(e);
2607
+ if (!n || n.key !== hr(t)) {
2608
+ $r(e, t);
2609
+ return;
2610
+ }
2611
+ t.trigger === "state" && Zr(n, !!t.state, !1);
2612
+ },
2613
+ unmounted(e) {
2614
+ ur.delete(e), ei(e);
2615
+ }
2616
+ };
2617
+ function ri(n) {
2618
+ return e((e, { slots: a }) => {
2619
+ let o = r();
2620
+ return i((t) => {
2621
+ if (!o.value || !rr.smoothScroll || mr()) return;
2622
+ let r = n ? o.value.closest("[data-scroll-root]") ?? void 0 : br(o.value);
2623
+ if (n && !r) return;
2624
+ let i = new tr({
2625
+ autoRaf: !0,
2626
+ content: r ? o.value : void 0,
2627
+ lerp: e.lerp ?? rr.smoothScrollLerp,
2628
+ wrapper: r
2629
+ });
2630
+ t(() => i.destroy());
2631
+ }, { flush: "post" }), () => t("div", { ref: o }, a.default?.());
2632
+ }, {
2633
+ name: "MotionScroll",
2634
+ props: { lerp: Number }
2635
+ });
2636
+ }
2637
+ var ii = ri(!1);
2638
+ //#endregion
2639
+ export { rr as a, ni as c, ri as i, jt as l, ir as n, ar as o, nr as r, ti as s, ii as t };