@algorisys/tinyfly 0.64.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -15
- package/lib/browser/tinyfly.iife.js +21 -2
- package/lib/browser/tinyfly.js +1331 -1122
- package/lib/browser/tinyfly.umd.js +21 -2
- package/lib/cli/tools.js +20 -3
- package/lib/embed/tinyfly-embed.iife.js +6 -3
- package/lib/embed/tinyfly-embed.js +444 -414
- package/lib/engine/tinyfly-engine.js +69 -55
- package/lib/engine/tinyfly-engine.umd.cjs +2 -2
- package/lib/player/tinyfly-player.es.js +86 -72
- package/lib/player/tinyfly-player.iife.js +2 -2
- package/lib/player/tinyfly-player.umd.js +2 -2
- package/lib/types/browser/index.d.ts +10 -0
- package/lib/types/embed/auto-mount.d.ts +7 -0
- package/lib/types/embed/controls.d.ts +5 -0
- package/lib/types/embed/mount.d.ts +2 -1
- package/lib/types/engine/core/timeline.d.ts +7 -2
- package/lib/types/player/player.d.ts +2 -1
- package/package.json +1 -1
package/lib/browser/tinyfly.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Hi(i) {
|
|
2
2
|
return typeof i == "object" && i !== null && i.type === "cubic-bezier";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function Et(i) {
|
|
5
5
|
return typeof i == "object" && i !== null && i.type !== "cubic-bezier";
|
|
6
6
|
}
|
|
7
7
|
const _t = 1;
|
|
8
|
-
function
|
|
8
|
+
function fe(i) {
|
|
9
9
|
return i.property === "text" && "textConfig" in i;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function Z(i) {
|
|
12
12
|
return i.kind === "inertia" && "inertia" in i;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Q(i) {
|
|
15
15
|
return i.kind === "spring" && "spring" in i;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function ai(i) {
|
|
18
18
|
return i.property === "motionPath" && "motionPathConfig" in i;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function ao(i) {
|
|
21
21
|
return typeof i == "object" && i !== null && "x" in i && "y" in i && "angle" in i;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Gi(i) {
|
|
24
24
|
return "keyframes" in i;
|
|
25
25
|
}
|
|
26
|
-
class
|
|
26
|
+
class co {
|
|
27
27
|
_currentTime = 0;
|
|
28
28
|
_isRunning = !1;
|
|
29
29
|
onTick = null;
|
|
@@ -49,7 +49,7 @@ class Gr {
|
|
|
49
49
|
this._currentTime = t;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
class
|
|
52
|
+
class lo {
|
|
53
53
|
_currentTime = 0;
|
|
54
54
|
_isRunning = !1;
|
|
55
55
|
_lastFrameTime = null;
|
|
@@ -96,7 +96,7 @@ class Zr {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function ci(i, t, e = "start") {
|
|
100
100
|
if (t <= 1) return 0;
|
|
101
101
|
if (typeof e == "number") {
|
|
102
102
|
const s = Math.max(0, Math.min(t - 1, e));
|
|
@@ -113,36 +113,36 @@ function ni(i, t, e = "start") {
|
|
|
113
113
|
return i;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function li(i, t = "start") {
|
|
117
117
|
if (i <= 1) return 0;
|
|
118
118
|
let e = 0;
|
|
119
119
|
for (let s = 0; s < i; s++)
|
|
120
|
-
e = Math.max(e,
|
|
120
|
+
e = Math.max(e, ci(s, i, t));
|
|
121
121
|
return e;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function de(i, t, e) {
|
|
124
124
|
if (e.offsets) return e.offsets[i] ?? 0;
|
|
125
|
-
const s = e.from ?? "start", n =
|
|
125
|
+
const s = e.from ?? "start", n = ci(i, t, s);
|
|
126
126
|
if (e.amount !== void 0) {
|
|
127
|
-
const r =
|
|
127
|
+
const r = li(t, s);
|
|
128
128
|
return r === 0 ? 0 : e.amount * n / r;
|
|
129
129
|
}
|
|
130
130
|
return e.each !== void 0 ? e.each * n : 0;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
return Array.from({ length: i }, (e, s) =>
|
|
132
|
+
function ie(i, t) {
|
|
133
|
+
return Array.from({ length: i }, (e, s) => de(s, i, t));
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
return i <= 1 ? 0 : Math.max(...
|
|
135
|
+
function Dt(i, t) {
|
|
136
|
+
return i <= 1 ? 0 : Math.max(...ie(i, t));
|
|
137
137
|
}
|
|
138
|
-
const
|
|
138
|
+
const dt = 1, hi = 6e4, Tt = hi / dt, N = {
|
|
139
139
|
stiffness: 180,
|
|
140
140
|
damping: 12,
|
|
141
141
|
mass: 1,
|
|
142
142
|
velocity: 0,
|
|
143
143
|
restDelta: 0.01,
|
|
144
144
|
restSpeed: 0.1
|
|
145
|
-
},
|
|
145
|
+
}, Yt = {
|
|
146
146
|
gentle: { stiffness: 120, damping: 18, mass: 1 },
|
|
147
147
|
default: { stiffness: 180, damping: 12, mass: 1 },
|
|
148
148
|
snappy: { stiffness: 280, damping: 20, mass: 1 },
|
|
@@ -150,7 +150,7 @@ const ft = 1, oi = 6e4, Tt = oi / ft, O = {
|
|
|
150
150
|
wobbly: { stiffness: 180, damping: 5, mass: 1 },
|
|
151
151
|
stiff: { stiffness: 400, damping: 30, mass: 1 }
|
|
152
152
|
};
|
|
153
|
-
class
|
|
153
|
+
class Ot {
|
|
154
154
|
from;
|
|
155
155
|
to;
|
|
156
156
|
stiffness;
|
|
@@ -175,7 +175,7 @@ class Lt {
|
|
|
175
175
|
/** Once at rest we stop simulating; every later time returns `to`. */
|
|
176
176
|
settledStep = null;
|
|
177
177
|
constructor(t) {
|
|
178
|
-
this.from = t.from, this.to = t.to, this.stiffness = t.stiffness ??
|
|
178
|
+
this.from = t.from, this.to = t.to, this.stiffness = t.stiffness ?? N.stiffness, this.damping = t.damping ?? N.damping, this.mass = t.mass ?? N.mass, this.restDelta = t.restDelta ?? N.restDelta, this.restSpeed = t.restSpeed ?? N.restSpeed, this.distance = Math.abs(this.to - this.from) || 1, this.samples = [this.from], this.velocity = t.velocity ?? N.velocity, this.isAtRest(this.from) && (this.settledStep = 0);
|
|
179
179
|
}
|
|
180
180
|
/**
|
|
181
181
|
* Whether a position/velocity pair counts as settled.
|
|
@@ -193,10 +193,10 @@ class Lt {
|
|
|
193
193
|
*/
|
|
194
194
|
valueAt(t) {
|
|
195
195
|
if (t <= 0) return this.from;
|
|
196
|
-
const e = Math.floor(t /
|
|
196
|
+
const e = Math.floor(t / dt);
|
|
197
197
|
if (this.simulateTo(e + 1), this.settledStep !== null && e >= this.settledStep)
|
|
198
198
|
return this.to;
|
|
199
|
-
const s = this.samples[Math.min(e, this.samples.length - 1)], n = this.samples[Math.min(e + 1, this.samples.length - 1)], r = t /
|
|
199
|
+
const s = this.samples[Math.min(e, this.samples.length - 1)], n = this.samples[Math.min(e + 1, this.samples.length - 1)], r = t / dt - e;
|
|
200
200
|
return s + (n - s) * r;
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
@@ -204,12 +204,12 @@ class Lt {
|
|
|
204
204
|
* of a spring track. Runs the simulation to completion once.
|
|
205
205
|
*/
|
|
206
206
|
settleTime() {
|
|
207
|
-
return this.simulateTo(Tt + 1), this.settledStep !== null ? this.settledStep *
|
|
207
|
+
return this.simulateTo(Tt + 1), this.settledStep !== null ? this.settledStep * dt : hi;
|
|
208
208
|
}
|
|
209
209
|
/** Advance the cached simulation until it holds at least `steps` samples. */
|
|
210
210
|
simulateTo(t) {
|
|
211
211
|
if (this.settledStep !== null) return;
|
|
212
|
-
const e = Math.min(t, Tt + 1), s =
|
|
212
|
+
const e = Math.min(t, Tt + 1), s = dt / 1e3;
|
|
213
213
|
for (; this.samples.length < e; ) {
|
|
214
214
|
const n = this.samples[this.samples.length - 1], r = n - this.to, o = -this.stiffness * r, a = -this.damping * this.velocity, c = (o + a) / this.mass;
|
|
215
215
|
this.velocity += c * s;
|
|
@@ -222,29 +222,29 @@ class Lt {
|
|
|
222
222
|
this.samples.length > Tt && (this.settledStep = Tt);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
return new
|
|
225
|
+
function ho(i, t) {
|
|
226
|
+
return new Ot(i).valueAt(t);
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
return new
|
|
228
|
+
function Ki(i) {
|
|
229
|
+
return new Ot(i).settleTime();
|
|
230
230
|
}
|
|
231
|
-
function
|
|
232
|
-
const t = i.stiffness ??
|
|
231
|
+
function uo(i) {
|
|
232
|
+
const t = i.stiffness ?? N.stiffness, e = i.damping ?? N.damping, s = i.mass ?? N.mass;
|
|
233
233
|
return e < 2 * Math.sqrt(t * s);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
const t = i.stiffness ??
|
|
235
|
+
function fo(i) {
|
|
236
|
+
const t = i.stiffness ?? N.stiffness, e = i.mass ?? N.mass;
|
|
237
237
|
return 2 * Math.sqrt(t * e);
|
|
238
238
|
}
|
|
239
|
-
const
|
|
240
|
-
function
|
|
241
|
-
const t = i.friction ??
|
|
242
|
-
return t > 0 ? t :
|
|
239
|
+
const we = 4, Zi = 2e-3, Qi = 1e-4, Ji = 6e4;
|
|
240
|
+
function Bt(i) {
|
|
241
|
+
const t = i.friction ?? we;
|
|
242
|
+
return t > 0 ? t : we;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
return i.from + i.velocity /
|
|
244
|
+
function Ct(i) {
|
|
245
|
+
return i.from + i.velocity / Bt(i);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function ts(i, t) {
|
|
248
248
|
if (t === void 0) return i;
|
|
249
249
|
if (typeof t == "number")
|
|
250
250
|
return t > 0 ? Math.round(i / t) * t : i;
|
|
@@ -254,59 +254,59 @@ function Ki(i, t) {
|
|
|
254
254
|
Math.abs(s - i) < Math.abs(e - i) && (e = s);
|
|
255
255
|
return e;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
let t =
|
|
257
|
+
function yt(i) {
|
|
258
|
+
let t = ts(Ct(i), i.end);
|
|
259
259
|
return i.min !== void 0 && (t = Math.max(i.min, t)), i.max !== void 0 && (t = Math.min(i.max, t)), t;
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
const t = Math.abs(
|
|
261
|
+
function bt(i) {
|
|
262
|
+
const t = Math.abs(yt(i) - i.from);
|
|
263
263
|
if (t === 0) return 0;
|
|
264
|
-
const e = i.restDelta ?? Math.max(
|
|
264
|
+
const e = i.restDelta ?? Math.max(Qi, t * Zi);
|
|
265
265
|
if (e >= t) return 0;
|
|
266
|
-
const s = Math.log(t / e) /
|
|
267
|
-
return Math.min(
|
|
266
|
+
const s = Math.log(t / e) / Bt(i);
|
|
267
|
+
return Math.min(Ji, s * 1e3);
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function se(i, t) {
|
|
270
270
|
if (t <= 0) return i.from;
|
|
271
|
-
const e =
|
|
272
|
-
if (t >=
|
|
273
|
-
const s =
|
|
271
|
+
const e = yt(i);
|
|
272
|
+
if (t >= bt(i)) return e;
|
|
273
|
+
const s = Bt(i);
|
|
274
274
|
return i.from + (e - i.from) * (1 - Math.exp(-s * t / 1e3));
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const e =
|
|
278
|
-
return t >=
|
|
279
|
-
}
|
|
280
|
-
const
|
|
281
|
-
linear:
|
|
282
|
-
"ease-in":
|
|
283
|
-
"ease-out":
|
|
284
|
-
"ease-in-out":
|
|
285
|
-
"ease-in-quad":
|
|
286
|
-
"ease-out-quad":
|
|
287
|
-
"ease-in-out-quad":
|
|
288
|
-
"ease-in-cubic":
|
|
289
|
-
"ease-out-cubic":
|
|
290
|
-
"ease-in-out-cubic":
|
|
276
|
+
function po(i, t) {
|
|
277
|
+
const e = Bt(i), s = yt(i);
|
|
278
|
+
return t >= bt(i) ? 0 : (s - i.from) * e * Math.exp(-e * Math.max(0, t) / 1e3);
|
|
279
|
+
}
|
|
280
|
+
const ne = (i) => i, es = (i) => i * i, is = (i) => 1 - (1 - i) * (1 - i), ss = (i) => i < 0.5 ? 2 * i * i : 1 - Math.pow(-2 * i + 2, 2) / 2, ui = (i) => i * i * i, fi = (i) => 1 - Math.pow(1 - i, 3), Nt = (i) => i < 0.5 ? 4 * i * i * i : 1 - Math.pow(-2 * i + 2, 3) / 2, ns = ui, rs = fi, os = Nt, as = {
|
|
281
|
+
linear: ne,
|
|
282
|
+
"ease-in": ns,
|
|
283
|
+
"ease-out": rs,
|
|
284
|
+
"ease-in-out": os,
|
|
285
|
+
"ease-in-quad": es,
|
|
286
|
+
"ease-out-quad": is,
|
|
287
|
+
"ease-in-out-quad": ss,
|
|
288
|
+
"ease-in-cubic": ui,
|
|
289
|
+
"ease-out-cubic": fi,
|
|
290
|
+
"ease-in-out-cubic": Nt
|
|
291
291
|
};
|
|
292
|
-
function
|
|
292
|
+
function cs(i) {
|
|
293
293
|
const [t, e, s, n] = i, r = 3 * t, o = 3 * (s - t) - r, a = 1 - r - o, c = 3 * e, l = 3 * (n - e) - c, h = 1 - c - l, f = (p) => ((a * p + o) * p + r) * p, u = (p) => ((h * p + l) * p + c) * p, d = (p) => (3 * a * p + 2 * o) * p + r, m = (p) => {
|
|
294
294
|
let g = p;
|
|
295
|
-
for (let
|
|
296
|
-
const
|
|
297
|
-
if (Math.abs(
|
|
295
|
+
for (let v = 0; v < 8; v++) {
|
|
296
|
+
const T = f(g) - p;
|
|
297
|
+
if (Math.abs(T) < 1e-7)
|
|
298
298
|
return g;
|
|
299
|
-
const
|
|
300
|
-
if (Math.abs(
|
|
299
|
+
const w = d(g);
|
|
300
|
+
if (Math.abs(w) < 1e-7)
|
|
301
301
|
break;
|
|
302
|
-
g -=
|
|
302
|
+
g -= T / w;
|
|
303
303
|
}
|
|
304
304
|
let y = 0, b = 1;
|
|
305
305
|
for (g = p; y < b; ) {
|
|
306
|
-
const
|
|
307
|
-
if (Math.abs(
|
|
306
|
+
const v = f(g);
|
|
307
|
+
if (Math.abs(v - p) < 1e-7)
|
|
308
308
|
return g;
|
|
309
|
-
p >
|
|
309
|
+
p > v ? y = g : b = g, g = (y + b) / 2;
|
|
310
310
|
}
|
|
311
311
|
return g;
|
|
312
312
|
};
|
|
@@ -317,16 +317,16 @@ function rs(i) {
|
|
|
317
317
|
return u(g);
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function Vt(i, t = "out") {
|
|
321
321
|
if (t === "out") return i;
|
|
322
322
|
const e = (s) => 1 - i(1 - s);
|
|
323
323
|
return t === "in" ? e : (s) => s < 0.5 ? e(s * 2) / 2 : i(s * 2 - 1) / 2 + 0.5;
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function ls(i = 1, t = 0.3) {
|
|
326
326
|
const e = Math.max(1, i), s = t / (2 * Math.PI) * Math.asin(1 / e);
|
|
327
327
|
return (n) => n <= 0 ? 0 : n >= 1 ? 1 : e * Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / t) + 1;
|
|
328
328
|
}
|
|
329
|
-
const
|
|
329
|
+
const hs = (i) => {
|
|
330
330
|
if (i <= 0) return 0;
|
|
331
331
|
if (i >= 1) return 1;
|
|
332
332
|
if (i < 1 / 2.75) return 7.5625 * i * i;
|
|
@@ -341,7 +341,7 @@ const as = (i) => {
|
|
|
341
341
|
const s = i - 2.625 / 2.75;
|
|
342
342
|
return 7.5625 * s * s + 0.984375;
|
|
343
343
|
};
|
|
344
|
-
function
|
|
344
|
+
function us(i = 1.70158) {
|
|
345
345
|
return (t) => {
|
|
346
346
|
if (t <= 0) return 0;
|
|
347
347
|
if (t >= 1) return 1;
|
|
@@ -349,7 +349,7 @@ function cs(i = 1.70158) {
|
|
|
349
349
|
return e * e * ((i + 1) * e + i) + 1;
|
|
350
350
|
};
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function fs(i, t = "end") {
|
|
353
353
|
const e = Math.max(1, Math.floor(i));
|
|
354
354
|
return (s) => {
|
|
355
355
|
if (s >= 1) return 1;
|
|
@@ -367,22 +367,22 @@ function ls(i, t = "end") {
|
|
|
367
367
|
}
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function ds(i) {
|
|
371
371
|
switch (i.type) {
|
|
372
372
|
case "steps":
|
|
373
|
-
return
|
|
373
|
+
return fs(i.count, i.position);
|
|
374
374
|
case "elastic":
|
|
375
|
-
return
|
|
375
|
+
return Vt(ls(i.amplitude, i.period), i.mode);
|
|
376
376
|
case "bounce":
|
|
377
|
-
return
|
|
377
|
+
return Vt(hs, i.mode);
|
|
378
378
|
case "back":
|
|
379
|
-
return
|
|
379
|
+
return Vt(us(i.overshoot), i.mode);
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
function W(i) {
|
|
383
|
-
return i === void 0 ?
|
|
383
|
+
return i === void 0 ? ne : Hi(i) ? cs(i.points) : Et(i) ? ds(i) : as[i] ?? ne;
|
|
384
384
|
}
|
|
385
|
-
const
|
|
385
|
+
const Te = 32, ps = 256, tt = /* @__PURE__ */ new Map(), ms = /[MmLlHhVvCcSsQqTtAaZz]/, gs = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, ys = {
|
|
386
386
|
M: 2,
|
|
387
387
|
L: 2,
|
|
388
388
|
H: 1,
|
|
@@ -394,7 +394,7 @@ const be = 32, us = 256, Q = /* @__PURE__ */ new Map(), fs = /[MmLlHhVvCcSsQqTtA
|
|
|
394
394
|
A: 7,
|
|
395
395
|
Z: 0
|
|
396
396
|
};
|
|
397
|
-
function
|
|
397
|
+
function bs(i) {
|
|
398
398
|
const t = [];
|
|
399
399
|
let e = 0, s = null;
|
|
400
400
|
const n = () => {
|
|
@@ -402,7 +402,7 @@ function ms(i) {
|
|
|
402
402
|
};
|
|
403
403
|
for (; e < i.length && (n(), !(e >= i.length)); ) {
|
|
404
404
|
const r = i[e];
|
|
405
|
-
if (
|
|
405
|
+
if (ms.test(r)) {
|
|
406
406
|
s = { type: r, args: [] }, t.push(s), e++;
|
|
407
407
|
continue;
|
|
408
408
|
}
|
|
@@ -413,49 +413,49 @@ function ms(i) {
|
|
|
413
413
|
s.args.push(r === "1" ? 1 : 0), e++;
|
|
414
414
|
continue;
|
|
415
415
|
}
|
|
416
|
-
const c =
|
|
416
|
+
const c = gs.exec(i.slice(e));
|
|
417
417
|
if (!c) break;
|
|
418
418
|
s.args.push(parseFloat(c[0])), e += c[0].length;
|
|
419
419
|
}
|
|
420
420
|
return t;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function vs(i, t, e, s, n, r, o, a, c) {
|
|
423
423
|
if (i === a && t === c) return [];
|
|
424
424
|
let l = Math.abs(e), h = Math.abs(s);
|
|
425
425
|
if (l === 0 || h === 0) return [[i, t, a, c, a, c]];
|
|
426
426
|
const f = n * Math.PI / 180, u = Math.cos(f), d = Math.sin(f), m = (i - a) / 2, p = (t - c) / 2, g = u * m + d * p, y = -d * m + u * p, b = g * g / (l * l) + y * y / (h * h);
|
|
427
427
|
if (b > 1) {
|
|
428
|
-
const
|
|
429
|
-
l *=
|
|
430
|
-
}
|
|
431
|
-
const
|
|
432
|
-
const
|
|
433
|
-
return
|
|
434
|
-
},
|
|
435
|
-
let
|
|
436
|
-
!o &&
|
|
437
|
-
const
|
|
438
|
-
const
|
|
439
|
-
return [u *
|
|
440
|
-
},
|
|
441
|
-
const
|
|
442
|
-
return [u *
|
|
443
|
-
},
|
|
444
|
-
for (let
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
return
|
|
449
|
-
}
|
|
450
|
-
function
|
|
428
|
+
const I = Math.sqrt(b);
|
|
429
|
+
l *= I, h *= I;
|
|
430
|
+
}
|
|
431
|
+
const v = r === o ? -1 : 1, T = l * l * h * h - l * l * y * y - h * h * g * g, w = l * l * y * y + h * h * g * g, x = v * Math.sqrt(Math.max(0, T / w)), S = x * l * y / h, _ = -x * h * g / l, L = u * S - d * _ + (i + a) / 2, A = d * S + u * _ + (t + c) / 2, M = (I, D, O, J) => {
|
|
432
|
+
const Xt = I * O + D * J, wt = Math.sqrt((I * I + D * D) * (O * O + J * J)), at = Math.acos(Math.max(-1, Math.min(1, Xt / wt)));
|
|
433
|
+
return I * J - D * O < 0 ? -at : at;
|
|
434
|
+
}, E = M(1, 0, (g - S) / l, (y - _) / h);
|
|
435
|
+
let k = M((g - S) / l, (y - _) / h, (-g - S) / l, (-y - _) / h);
|
|
436
|
+
!o && k > 0 && (k -= 2 * Math.PI), o && k < 0 && (k += 2 * Math.PI);
|
|
437
|
+
const P = Math.max(1, Math.ceil(Math.abs(k) / (Math.PI / 2))), C = k / P, $ = 4 / 3 * Math.tan(C / 4), R = (I) => {
|
|
438
|
+
const D = l * Math.cos(I), O = h * Math.sin(I);
|
|
439
|
+
return [u * D - d * O + L, d * D + u * O + A];
|
|
440
|
+
}, j = (I) => {
|
|
441
|
+
const D = -l * Math.sin(I), O = h * Math.cos(I);
|
|
442
|
+
return [u * D - d * O, d * D + u * O];
|
|
443
|
+
}, H = [];
|
|
444
|
+
for (let I = 0; I < P; I++) {
|
|
445
|
+
const D = E + I * C, O = D + C, [J, Xt] = R(D), [wt, at] = I === P - 1 ? [a, c] : R(O), [Wi, ji] = j(D), [Ui, zi] = j(O);
|
|
446
|
+
H.push([J + $ * Wi, Xt + $ * ji, wt - $ * Ui, at - $ * zi, wt, at]);
|
|
447
|
+
}
|
|
448
|
+
return H;
|
|
449
|
+
}
|
|
450
|
+
function z(i, t, e, s, n) {
|
|
451
451
|
const r = 1 - n;
|
|
452
452
|
return r * r * r * i + 3 * r * r * n * t + 3 * r * n * n * e + n * n * n * s;
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function xe(i, t, e, s, n) {
|
|
455
455
|
const r = 1 - n;
|
|
456
456
|
return 3 * r * r * (t - i) + 6 * r * n * (e - t) + 3 * n * n * (s - e);
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function ct(i, t, e, s) {
|
|
459
459
|
return {
|
|
460
460
|
subpath: 0,
|
|
461
461
|
type: "L",
|
|
@@ -467,11 +467,11 @@ function at(i, t, e, s) {
|
|
|
467
467
|
length: Math.hypot(e - i, s - t)
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function xt(i, t, e) {
|
|
471
471
|
const [s, n, r, o, a, c] = e, l = [0];
|
|
472
472
|
let h = i, f = t, u = 0;
|
|
473
|
-
for (let d = 1; d <=
|
|
474
|
-
const m = d /
|
|
473
|
+
for (let d = 1; d <= Te; d++) {
|
|
474
|
+
const m = d / Te, p = z(i, s, r, a, m), g = z(t, n, o, c, m);
|
|
475
475
|
u += Math.hypot(p - h, g - f), l.push(u), h = p, f = g;
|
|
476
476
|
}
|
|
477
477
|
return {
|
|
@@ -486,73 +486,73 @@ function kt(i, t, e) {
|
|
|
486
486
|
lengths: l
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
const t =
|
|
489
|
+
function nt(i) {
|
|
490
|
+
const t = tt.get(i);
|
|
491
491
|
if (t) return t;
|
|
492
492
|
const e = [];
|
|
493
493
|
let s = 0, n = 0, r = 0, o = 0, a = null, c = null, l = -1;
|
|
494
494
|
const h = /* @__PURE__ */ new Set(), f = (p) => {
|
|
495
495
|
l < 0 && (l = 0), p.subpath = l, e.push(p);
|
|
496
496
|
};
|
|
497
|
-
for (const { type: p, args: g } of
|
|
498
|
-
const y = p.toUpperCase(), b = p !== y,
|
|
497
|
+
for (const { type: p, args: g } of bs(i)) {
|
|
498
|
+
const y = p.toUpperCase(), b = p !== y, v = ys[y];
|
|
499
499
|
if (y === "Z") {
|
|
500
|
-
(s !== r || n !== o) && f(
|
|
500
|
+
(s !== r || n !== o) && f(ct(s, n, r, o)), l >= 0 && h.add(l), s = r, n = o, a = c = null;
|
|
501
501
|
continue;
|
|
502
502
|
}
|
|
503
|
-
for (let
|
|
504
|
-
const
|
|
505
|
-
let _ = null,
|
|
503
|
+
for (let T = 0; T + v <= g.length; T += v) {
|
|
504
|
+
const w = g.slice(T, T + v), x = b ? s : 0, S = b ? n : 0;
|
|
505
|
+
let _ = null, L = null;
|
|
506
506
|
switch (y) {
|
|
507
507
|
case "M":
|
|
508
|
-
|
|
508
|
+
T === 0 ? (s = w[0] + x, n = w[1] + S, r = s, o = n, (l < 0 || e[e.length - 1]?.subpath === l) && l++) : (f(ct(s, n, w[0] + x, w[1] + S)), s = w[0] + x, n = w[1] + S);
|
|
509
509
|
break;
|
|
510
510
|
case "L":
|
|
511
|
-
f(
|
|
511
|
+
f(ct(s, n, w[0] + x, w[1] + S)), s = w[0] + x, n = w[1] + S;
|
|
512
512
|
break;
|
|
513
513
|
case "H":
|
|
514
|
-
f(
|
|
514
|
+
f(ct(s, n, w[0] + x, n)), s = w[0] + x;
|
|
515
515
|
break;
|
|
516
516
|
case "V":
|
|
517
|
-
f(
|
|
517
|
+
f(ct(s, n, s, w[0] + S)), n = w[0] + S;
|
|
518
518
|
break;
|
|
519
519
|
case "C": {
|
|
520
|
-
const
|
|
521
|
-
f(
|
|
520
|
+
const A = [w[0] + x, w[1] + S, w[2] + x, w[3] + S, w[4] + x, w[5] + S];
|
|
521
|
+
f(xt(s, n, A)), _ = [A[2], A[3]], s = A[4], n = A[5];
|
|
522
522
|
break;
|
|
523
523
|
}
|
|
524
524
|
case "S": {
|
|
525
|
-
const [
|
|
526
|
-
f(
|
|
525
|
+
const [A, M] = a ? [2 * s - a[0], 2 * n - a[1]] : [s, n], E = [A, M, w[0] + x, w[1] + S, w[2] + x, w[3] + S];
|
|
526
|
+
f(xt(s, n, E)), _ = [E[2], E[3]], s = E[4], n = E[5];
|
|
527
527
|
break;
|
|
528
528
|
}
|
|
529
529
|
case "Q":
|
|
530
530
|
case "T": {
|
|
531
|
-
let
|
|
532
|
-
y === "Q" ? (
|
|
533
|
-
const
|
|
531
|
+
let A = s, M = n;
|
|
532
|
+
y === "Q" ? (A = w[0] + x, M = w[1] + S) : c && (A = 2 * s - c[0], M = 2 * n - c[1]);
|
|
533
|
+
const E = y === "Q" ? w[2] + x : w[0] + x, k = y === "Q" ? w[3] + S : w[1] + S;
|
|
534
534
|
f(
|
|
535
|
-
|
|
536
|
-
s + 2 / 3 * (
|
|
537
|
-
n + 2 / 3 * (
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
535
|
+
xt(s, n, [
|
|
536
|
+
s + 2 / 3 * (A - s),
|
|
537
|
+
n + 2 / 3 * (M - n),
|
|
538
|
+
E + 2 / 3 * (A - E),
|
|
539
|
+
k + 2 / 3 * (M - k),
|
|
540
|
+
E,
|
|
541
|
+
k
|
|
542
542
|
])
|
|
543
|
-
),
|
|
543
|
+
), L = [A, M], s = E, n = k;
|
|
544
544
|
break;
|
|
545
545
|
}
|
|
546
546
|
case "A": {
|
|
547
|
-
const
|
|
548
|
-
let
|
|
549
|
-
for (const
|
|
550
|
-
f(
|
|
551
|
-
s =
|
|
547
|
+
const A = w[5] + x, M = w[6] + S;
|
|
548
|
+
let E = s, k = n;
|
|
549
|
+
for (const P of vs(s, n, w[0], w[1], w[2], w[3], w[4], A, M))
|
|
550
|
+
f(xt(E, k, P)), E = P[4], k = P[5];
|
|
551
|
+
s = A, n = M;
|
|
552
552
|
break;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
a = _, c =
|
|
555
|
+
a = _, c = L;
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
const u = e.reduce((p, g) => p + g.length, 0), d = [];
|
|
@@ -560,13 +560,13 @@ function it(i) {
|
|
|
560
560
|
const g = e[p].subpath;
|
|
561
561
|
let y = p, b = 0;
|
|
562
562
|
for (; y < e.length && e[y].subpath === g; ) b += e[y++].length;
|
|
563
|
-
const
|
|
564
|
-
d.push({ start: p, end: y, length: b, closed:
|
|
563
|
+
const v = e[p], T = e[y - 1], w = h.has(g) || Math.abs(T.endX - v.startX) < 1e-9 && Math.abs(T.endY - v.startY) < 1e-9;
|
|
564
|
+
d.push({ start: p, end: y, length: b, closed: w }), p = y;
|
|
565
565
|
}
|
|
566
566
|
const m = { segments: e, totalLength: u, subpaths: d };
|
|
567
|
-
return
|
|
567
|
+
return tt.size >= ps && tt.delete(tt.keys().next().value), tt.set(i, m), m;
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function ws(i, t) {
|
|
570
570
|
const e = i.lengths;
|
|
571
571
|
if (t <= 0) return 0;
|
|
572
572
|
if (t >= i.length) return 1;
|
|
@@ -578,7 +578,7 @@ function ys(i, t) {
|
|
|
578
578
|
const r = e[n] - e[s], o = r > 0 ? (t - e[s]) / r : 0;
|
|
579
579
|
return (s + o) / (e.length - 1);
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function Ts(i, t) {
|
|
582
582
|
if (i.type === "L") {
|
|
583
583
|
const f = i.length > 0 ? Math.max(0, Math.min(1, t / i.length)) : 0;
|
|
584
584
|
return {
|
|
@@ -587,44 +587,44 @@ function bs(i, t) {
|
|
|
587
587
|
angle: Math.atan2(i.endY - i.startY, i.endX - i.startX) * 180 / Math.PI
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
|
-
const [e, s, n, r, o, a] = i.points, c =
|
|
591
|
-
let l =
|
|
590
|
+
const [e, s, n, r, o, a] = i.points, c = ws(i, t);
|
|
591
|
+
let l = xe(i.startX, e, n, o, c), h = xe(i.startY, s, r, a, c);
|
|
592
592
|
if (Math.hypot(l, h) < 1e-9) {
|
|
593
|
-
const f = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), u =
|
|
593
|
+
const f = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), u = z(i.startX, e, n, o, f), d = z(i.startY, s, r, a, f), m = z(i.startX, e, n, o, c), p = z(i.startY, s, r, a, c);
|
|
594
594
|
l = c < 0.5 ? u - m : m - u, h = c < 0.5 ? d - p : p - d;
|
|
595
595
|
}
|
|
596
596
|
return {
|
|
597
|
-
x:
|
|
598
|
-
y:
|
|
597
|
+
x: z(i.startX, e, n, o, c),
|
|
598
|
+
y: z(i.startY, s, r, a, c),
|
|
599
599
|
angle: Math.atan2(h, l) * 180 / Math.PI
|
|
600
600
|
};
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function di(i, t, e = 0, s = i.length) {
|
|
603
603
|
if (s <= e) return { x: 0, y: 0, angle: 0 };
|
|
604
604
|
let n = 0;
|
|
605
605
|
for (let r = e; r < s; r++) {
|
|
606
606
|
const o = i[r];
|
|
607
607
|
if (n + o.length >= t || r === s - 1)
|
|
608
|
-
return
|
|
608
|
+
return Ts(o, t - n);
|
|
609
609
|
n += o.length;
|
|
610
610
|
}
|
|
611
611
|
return { x: 0, y: 0, angle: 0 };
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
const { segments: e, totalLength: s } =
|
|
615
|
-
return
|
|
613
|
+
function xs(i, t) {
|
|
614
|
+
const { segments: e, totalLength: s } = nt(i);
|
|
615
|
+
return di(e, Math.max(0, Math.min(1, t)) * s);
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
|
|
617
|
+
function mo() {
|
|
618
|
+
tt.clear();
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
620
|
+
function go(i) {
|
|
621
|
+
return nt(i).totalLength;
|
|
622
622
|
}
|
|
623
|
-
const
|
|
624
|
-
let
|
|
625
|
-
const
|
|
626
|
-
function
|
|
627
|
-
const { segments: e, subpaths: s, totalLength: n } =
|
|
623
|
+
const ks = 24, Ss = 320, Ms = 2.5, lt = 72, yo = 64, As = 0.2, Ps = 128, pt = /* @__PURE__ */ new Map();
|
|
624
|
+
let At = 0, U;
|
|
625
|
+
const ke = (i) => Math.round(i * 100) / 100;
|
|
626
|
+
function Se(i, t) {
|
|
627
|
+
const { segments: e, subpaths: s, totalLength: n } = nt(i);
|
|
628
628
|
if (e.length === 0) return [];
|
|
629
629
|
if (t) {
|
|
630
630
|
const r = s.every((o) => o.closed);
|
|
@@ -632,34 +632,34 @@ function Te(i, t) {
|
|
|
632
632
|
}
|
|
633
633
|
return s.filter((r) => r.length > 0).map((r) => ({ segments: e, start: r.start, end: r.end, length: r.length, closed: r.closed }));
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
const e = i.closed ? (t % 1 + 1) % 1 : Math.max(0, Math.min(1, t)), s =
|
|
635
|
+
function re(i, t) {
|
|
636
|
+
const e = i.closed ? (t % 1 + 1) % 1 : Math.max(0, Math.min(1, t)), s = di(i.segments, e * i.length, i.start, i.end);
|
|
637
637
|
return [s.x, s.y];
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function Me(i) {
|
|
640
640
|
const t = [];
|
|
641
641
|
let e = 0;
|
|
642
642
|
for (let s = i.start; s < i.end; s++)
|
|
643
643
|
e += i.segments[s].length, i.length > 0 && t.push(e / i.length);
|
|
644
644
|
return t;
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function Ae(i, t) {
|
|
647
647
|
const e = [];
|
|
648
648
|
for (let s = 0; s < t; s++)
|
|
649
|
-
e.push(
|
|
649
|
+
e.push(re(i, i.closed ? s / t : s / (t - 1)));
|
|
650
650
|
return e;
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function Pe(i) {
|
|
653
653
|
let t = 0, e = 0;
|
|
654
654
|
for (const [s, n] of i)
|
|
655
655
|
t += s, e += n;
|
|
656
656
|
return t /= i.length, e /= i.length, i.map(([s, n]) => [s - t, n - e]);
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function Es(i, t, e) {
|
|
659
659
|
const s = i.closed && t.closed;
|
|
660
660
|
if (e !== void 0)
|
|
661
|
-
return { offset: s ? Math.abs(e) %
|
|
662
|
-
const n =
|
|
661
|
+
return { offset: s ? Math.abs(e) % lt / lt : 0, reversed: e < 0 };
|
|
662
|
+
const n = Pe(Ae(i, lt)), r = Pe(Ae(t, lt)), o = lt;
|
|
663
663
|
let a = { offset: 0, reversed: !1 }, c = 1 / 0;
|
|
664
664
|
for (const l of [!1, !0]) {
|
|
665
665
|
const h = s ? o : 1;
|
|
@@ -674,28 +674,28 @@ function Ms(i, t, e) {
|
|
|
674
674
|
}
|
|
675
675
|
return a;
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function _s(i, t, e) {
|
|
678
678
|
return e ? ((t.reversed ? t.offset - i : i + t.offset) % 1 + 1) % 1 : t.reversed ? 1 - i : i;
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function Cs(i, t, e) {
|
|
681
681
|
return e ? ((t.reversed ? t.offset - i : i - t.offset) % 1 + 1) % 1 : t.reversed ? 1 - i : i;
|
|
682
682
|
}
|
|
683
|
-
function
|
|
684
|
-
const s = i.closed && t.closed, n =
|
|
685
|
-
|
|
686
|
-
Math.min(
|
|
683
|
+
function Rs(i, t, e) {
|
|
684
|
+
const s = i.closed && t.closed, n = Es(i, t, e.shapeIndex), r = Math.max(
|
|
685
|
+
ks,
|
|
686
|
+
Math.min(Ss, Math.ceil(Math.max(i.length, t.length) / Ms))
|
|
687
687
|
), o = /* @__PURE__ */ new Set(), a = (f) => o.add(Math.round(f * 1e7) / 1e7);
|
|
688
688
|
for (let f = 0; f <= r; f++) a(f / r);
|
|
689
|
-
for (const f of
|
|
690
|
-
for (const f of
|
|
689
|
+
for (const f of Me(i)) a(f);
|
|
690
|
+
for (const f of Me(t)) a(Cs(f, n, s));
|
|
691
691
|
let c = [...o].sort((f, u) => f - u);
|
|
692
692
|
s && (c = c.filter((f) => f < 1));
|
|
693
693
|
const l = [], h = [];
|
|
694
694
|
for (const f of c)
|
|
695
|
-
l.push(...
|
|
696
|
-
return
|
|
695
|
+
l.push(...re(i, f)), h.push(...re(t, _s(f, n, s)));
|
|
696
|
+
return Is({ from: l, to: h, closed: s });
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Is(i) {
|
|
699
699
|
const t = i.from.length / 2;
|
|
700
700
|
if (t <= 3) return i;
|
|
701
701
|
const e = new Uint8Array(t);
|
|
@@ -703,9 +703,9 @@ function Es(i) {
|
|
|
703
703
|
const s = [[0, t - 1]];
|
|
704
704
|
for (; s.length > 0; ) {
|
|
705
705
|
const [o, a] = s.pop();
|
|
706
|
-
let c = -1, l =
|
|
706
|
+
let c = -1, l = As;
|
|
707
707
|
for (let h = o + 1; h < a; h++) {
|
|
708
|
-
const f = Math.max(
|
|
708
|
+
const f = Math.max(Ee(i.from, o, a, h), Ee(i.to, o, a, h));
|
|
709
709
|
f > l && (l = f, c = h);
|
|
710
710
|
}
|
|
711
711
|
c !== -1 && (e[c] = 1, s.push([o, c], [c, a]));
|
|
@@ -715,118 +715,118 @@ function Es(i) {
|
|
|
715
715
|
e[o] && (n.push(i.from[o * 2], i.from[o * 2 + 1]), r.push(i.to[o * 2], i.to[o * 2 + 1]));
|
|
716
716
|
return { from: n, to: r, closed: i.closed };
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function Ee(i, t, e, s) {
|
|
719
719
|
const n = i[t * 2], r = i[t * 2 + 1], o = i[e * 2] - n, a = i[e * 2 + 1] - r, c = i[s * 2] - n, l = i[s * 2 + 1] - r, h = o * o + a * a, f = h === 0 ? 0 : Math.max(0, Math.min(1, (c * o + l * a) / h));
|
|
720
720
|
return Math.hypot(c - f * o, l - f * a);
|
|
721
721
|
}
|
|
722
|
-
function
|
|
722
|
+
function $s(i, t, e) {
|
|
723
723
|
const s = e.shapeIndex;
|
|
724
|
-
if (
|
|
725
|
-
const r =
|
|
724
|
+
if (U && U.from === i && U.to === t && U.shapeIndex === s) return U.plan;
|
|
725
|
+
const r = pt.get(String(s ?? "auto"))?.get(i)?.get(t);
|
|
726
726
|
if (r)
|
|
727
|
-
return
|
|
728
|
-
const o =
|
|
729
|
-
pairs: a.map((d, m) =>
|
|
727
|
+
return U = { from: i, to: t, shapeIndex: s, plan: r }, r;
|
|
728
|
+
const o = nt(i).subpaths.filter((d) => d.length > 0).length === nt(t).subpaths.filter((d) => d.length > 0).length, a = Se(i, !o), c = Se(t, !o), l = {
|
|
729
|
+
pairs: a.map((d, m) => Rs(d, c[m], e))
|
|
730
730
|
};
|
|
731
|
-
|
|
732
|
-
const h = String(s ?? "auto"), f =
|
|
733
|
-
|
|
731
|
+
At >= Ps && (pt.clear(), At = 0);
|
|
732
|
+
const h = String(s ?? "auto"), f = pt.get(h) ?? /* @__PURE__ */ new Map();
|
|
733
|
+
pt.set(h, f);
|
|
734
734
|
const u = f.get(i) ?? /* @__PURE__ */ new Map();
|
|
735
|
-
return f.set(i, u), u.set(t, l),
|
|
735
|
+
return f.set(i, u), u.set(t, l), At++, U = { from: i, to: t, shapeIndex: s, plan: l }, l;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function Fs(i, t, e, s = {}) {
|
|
738
738
|
if (!i) return t;
|
|
739
739
|
if (!t) return i;
|
|
740
740
|
const n = Math.max(0, Math.min(1, e));
|
|
741
741
|
if (n === 0) return i;
|
|
742
742
|
if (n === 1) return t;
|
|
743
|
-
const r =
|
|
743
|
+
const r = $s(i, t, s);
|
|
744
744
|
if (r.pairs.length === 0) return n < 0.5 ? i : t;
|
|
745
745
|
let o = "";
|
|
746
746
|
for (const a of r.pairs) {
|
|
747
747
|
for (let c = 0; c < a.from.length; c += 2) {
|
|
748
|
-
const l =
|
|
748
|
+
const l = ke(a.from[c] + (a.to[c] - a.from[c]) * n), h = ke(a.from[c + 1] + (a.to[c + 1] - a.from[c + 1]) * n);
|
|
749
749
|
o += `${c === 0 ? o ? " M" : "M" : " L"}${l} ${h}`;
|
|
750
750
|
}
|
|
751
751
|
a.closed && (o += " Z");
|
|
752
752
|
}
|
|
753
753
|
return o;
|
|
754
754
|
}
|
|
755
|
-
function
|
|
756
|
-
|
|
755
|
+
function bo() {
|
|
756
|
+
pt.clear(), At = 0, U = void 0;
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function vt(i) {
|
|
759
759
|
return /^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(i);
|
|
760
760
|
}
|
|
761
|
-
const
|
|
762
|
-
function
|
|
763
|
-
const t =
|
|
761
|
+
const Y = (i, t, e) => i + (t - i) * e, pi = 512, Wt = /* @__PURE__ */ new Map(), jt = /* @__PURE__ */ new Map();
|
|
762
|
+
function _e(i) {
|
|
763
|
+
const t = Wt.get(i);
|
|
764
764
|
if (t) return t;
|
|
765
765
|
const e = i.replace("#", ""), s = [
|
|
766
766
|
parseInt(e.slice(0, 2), 16),
|
|
767
767
|
parseInt(e.slice(2, 4), 16),
|
|
768
768
|
parseInt(e.slice(4, 6), 16)
|
|
769
769
|
];
|
|
770
|
-
return
|
|
770
|
+
return Wt.size < pi && Wt.set(i, s), s;
|
|
771
771
|
}
|
|
772
|
-
const
|
|
773
|
-
function
|
|
774
|
-
return `#${
|
|
772
|
+
const Ce = (i) => i.charCodeAt(0) === 35, Re = (i) => i.startsWith("rgb"), Ie = (i) => i.startsWith("rgba"), Ls = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, Ut = (i) => Math.round(i).toString(16).padStart(2, "0");
|
|
773
|
+
function Ds(i, t, e) {
|
|
774
|
+
return `#${Ut(i)}${Ut(t)}${Ut(e)}`;
|
|
775
775
|
}
|
|
776
|
-
function
|
|
777
|
-
const t =
|
|
776
|
+
function $e(i) {
|
|
777
|
+
const t = jt.get(i);
|
|
778
778
|
if (t) return t;
|
|
779
|
-
const e = i.match(
|
|
779
|
+
const e = i.match(Ls);
|
|
780
780
|
if (!e)
|
|
781
781
|
throw new Error(`Invalid rgb color: ${i}`);
|
|
782
782
|
const s = parseInt(e[1], 10), n = parseInt(e[2], 10), r = parseInt(e[3], 10), o = e[4] !== void 0 ? [s, n, r, parseFloat(e[4])] : [s, n, r];
|
|
783
|
-
return
|
|
783
|
+
return jt.size < pi && jt.set(i, o), o;
|
|
784
784
|
}
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
787
|
-
const [s, n, r] =
|
|
788
|
-
return
|
|
785
|
+
const Os = (i, t, e) => {
|
|
786
|
+
if (Ce(i) && Ce(t)) {
|
|
787
|
+
const [s, n, r] = _e(i), [o, a, c] = _e(t), l = Y(s, o, e), h = Y(n, a, e), f = Y(r, c, e);
|
|
788
|
+
return Ds(l, h, f);
|
|
789
789
|
}
|
|
790
|
-
if ((
|
|
791
|
-
const s =
|
|
790
|
+
if ((Re(i) || Ie(i)) && (Re(t) || Ie(t))) {
|
|
791
|
+
const s = $e(i), n = $e(t), r = Math.round(Y(s[0], n[0], e)), o = Math.round(Y(s[1], n[1], e)), a = Math.round(Y(s[2], n[2], e));
|
|
792
792
|
if (s.length === 4 || n.length === 4) {
|
|
793
|
-
const c = s[3] ?? 1, l = n[3] ?? 1, h =
|
|
793
|
+
const c = s[3] ?? 1, l = n[3] ?? 1, h = Y(c, l, e);
|
|
794
794
|
return `rgba(${r}, ${o}, ${a}, ${h})`;
|
|
795
795
|
}
|
|
796
796
|
return `rgb(${r}, ${o}, ${a})`;
|
|
797
797
|
}
|
|
798
798
|
return e < 1 ? i : t;
|
|
799
|
-
},
|
|
799
|
+
}, Bs = (i, t, e) => {
|
|
800
800
|
const s = Math.min(i.length, t.length), n = [];
|
|
801
801
|
for (let r = 0; r < s; r++)
|
|
802
|
-
n.push(
|
|
802
|
+
n.push(Y(i[r], t[r], e));
|
|
803
803
|
return n;
|
|
804
|
-
},
|
|
805
|
-
function
|
|
806
|
-
return typeof i == "number" ?
|
|
804
|
+
}, Fe = (i, t, e) => e < 1 ? i : t, Ns = (i, t, e) => Fs(i, t, e);
|
|
805
|
+
function Rt(i) {
|
|
806
|
+
return typeof i == "number" ? Y : Array.isArray(i) ? Bs : typeof i == "string" ? i.startsWith("#") || i.startsWith("rgb") ? Os : vt(i) ? Ns : Fe : Fe;
|
|
807
807
|
}
|
|
808
|
-
const
|
|
809
|
-
function
|
|
810
|
-
if (!
|
|
808
|
+
const mi = 1e3 / 60;
|
|
809
|
+
function gi(i, t = {}) {
|
|
810
|
+
if (!Q(i))
|
|
811
811
|
throw new Error(`bakeSpringTrack: track "${i.id}" is not a spring track`);
|
|
812
|
-
const e = new
|
|
813
|
-
return
|
|
812
|
+
const e = new Ot(i.spring);
|
|
813
|
+
return bi(i, (s) => e.valueAt(s), e.settleTime(), i.spring.from, i.spring.to, t);
|
|
814
814
|
}
|
|
815
|
-
function
|
|
816
|
-
if (!
|
|
815
|
+
function yi(i, t = {}) {
|
|
816
|
+
if (!Z(i))
|
|
817
817
|
throw new Error(`bakeInertiaTrack: track "${i.id}" is not an inertia track`);
|
|
818
818
|
const e = i.inertia;
|
|
819
|
-
return
|
|
819
|
+
return bi(
|
|
820
820
|
i,
|
|
821
|
-
(s) =>
|
|
822
|
-
|
|
821
|
+
(s) => se(e, s),
|
|
822
|
+
bt(e),
|
|
823
823
|
e.from,
|
|
824
|
-
|
|
824
|
+
yt(e),
|
|
825
825
|
t
|
|
826
826
|
);
|
|
827
827
|
}
|
|
828
|
-
function
|
|
829
|
-
const o = r.intervalMs ??
|
|
828
|
+
function bi(i, t, e, s, n, r) {
|
|
829
|
+
const o = r.intervalMs ?? mi, a = r.tolerance ?? 0.01, c = i.delay ?? 0, l = [];
|
|
830
830
|
for (let f = 0; f <= e; f += o)
|
|
831
831
|
l.push({ time: f + c, value: t(f), easing: "linear" });
|
|
832
832
|
const h = l[l.length - 1];
|
|
@@ -834,13 +834,13 @@ function pi(i, t, e, s, n, r) {
|
|
|
834
834
|
id: i.id,
|
|
835
835
|
target: i.target,
|
|
836
836
|
property: i.property,
|
|
837
|
-
keyframes: a > 0 ?
|
|
837
|
+
keyframes: a > 0 ? Xs(l, a) : l,
|
|
838
838
|
...i.targets && { targets: [...i.targets] },
|
|
839
839
|
...i.stagger && { stagger: { ...i.stagger } }
|
|
840
840
|
};
|
|
841
841
|
}
|
|
842
|
-
function
|
|
843
|
-
const n = s.intervalMs ??
|
|
842
|
+
function vi(i, t, e, s = {}) {
|
|
843
|
+
const n = s.intervalMs ?? mi, r = typeof e == "function" ? e : W(e), o = Rt(i.value), a = t.time - i.time;
|
|
844
844
|
if (a <= 0) return [t];
|
|
845
845
|
const c = [];
|
|
846
846
|
for (let h = n; h < a; h += n) {
|
|
@@ -854,26 +854,26 @@ function mi(i, t, e, s = {}) {
|
|
|
854
854
|
const l = r(1);
|
|
855
855
|
return c.push({ ...t, ...l !== 1 && { value: o(i.value, t.value, l) }, easing: "linear" }), c;
|
|
856
856
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
857
|
+
function vo(i, t) {
|
|
858
|
+
return Q(i) ? gi(i, t) : Z(i) ? yi(i, t) : i;
|
|
859
859
|
}
|
|
860
|
-
function
|
|
860
|
+
function qs(i, t = {}) {
|
|
861
861
|
const e = i.keyframes;
|
|
862
|
-
if (!e.some((n) =>
|
|
862
|
+
if (!e.some((n) => Et(n.easing))) return i;
|
|
863
863
|
const s = e.length > 0 ? [e[0]] : [];
|
|
864
864
|
for (let n = 1; n < e.length; n++) {
|
|
865
865
|
const r = e[n];
|
|
866
|
-
|
|
866
|
+
Et(r.easing) ? s.push(...vi(e[n - 1], r, r.easing, t)) : s.push(r);
|
|
867
867
|
}
|
|
868
868
|
return { ...i, keyframes: s };
|
|
869
869
|
}
|
|
870
|
-
function
|
|
871
|
-
return i.filter(
|
|
872
|
-
i.filter(
|
|
873
|
-
i.filter(
|
|
870
|
+
function wo(i, t) {
|
|
871
|
+
return i.filter(Gi).map((e) => qs(e, t)).concat(
|
|
872
|
+
i.filter(Q).map((e) => gi(e, t)),
|
|
873
|
+
i.filter(Z).map((e) => yi(e, t))
|
|
874
874
|
);
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function Xs(i, t) {
|
|
877
877
|
if (i.length <= 2) return i;
|
|
878
878
|
const e = [i[0]];
|
|
879
879
|
for (let s = 1; s < i.length - 1; s++) {
|
|
@@ -884,25 +884,25 @@ function Bs(i, t) {
|
|
|
884
884
|
}
|
|
885
885
|
return e.push(i[i.length - 1]), e;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
887
|
+
function oe(i) {
|
|
888
888
|
const t = [...i.keyframes].sort((e, s) => e.time - s.time);
|
|
889
889
|
return {
|
|
890
890
|
...i,
|
|
891
891
|
keyframes: t
|
|
892
892
|
};
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function G(i) {
|
|
895
895
|
return i.targets && i.targets.length > 0 ? i.targets : [i.target];
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function rt(i, t, e, s) {
|
|
898
898
|
const n = e ?? 0;
|
|
899
|
-
return !s || t <= 1 ? n : n +
|
|
899
|
+
return !s || t <= 1 ? n : n + de(i, t, s);
|
|
900
900
|
}
|
|
901
|
-
class
|
|
901
|
+
class zt {
|
|
902
902
|
track;
|
|
903
903
|
targets;
|
|
904
904
|
constructor(t) {
|
|
905
|
-
this.track = t, this.targets =
|
|
905
|
+
this.track = t, this.targets = G(t);
|
|
906
906
|
}
|
|
907
907
|
/**
|
|
908
908
|
* Get the interpolated value at a specific time.
|
|
@@ -911,7 +911,7 @@ class jt {
|
|
|
911
911
|
* that need every target should use `getTargetValues`.
|
|
912
912
|
*/
|
|
913
913
|
getValueAtTime(t) {
|
|
914
|
-
return this.valueForOffset(t -
|
|
914
|
+
return this.valueForOffset(t - rt(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
915
915
|
}
|
|
916
916
|
/**
|
|
917
917
|
* Every target's value at a specific time, in target order.
|
|
@@ -922,7 +922,7 @@ class jt {
|
|
|
922
922
|
getTargetValues(t) {
|
|
923
923
|
const e = this.targets.length, s = [];
|
|
924
924
|
for (let n = 0; n < e; n++) {
|
|
925
|
-
const r =
|
|
925
|
+
const r = rt(n, e, this.track.delay, this.track.stagger), o = this.valueForOffset(t - r);
|
|
926
926
|
o !== void 0 && s.push({ target: this.targets[n], value: o, start: r + this.track.keyframes[0].time });
|
|
927
927
|
}
|
|
928
928
|
return s;
|
|
@@ -935,7 +935,7 @@ class jt {
|
|
|
935
935
|
const { keyframes: t } = this.track;
|
|
936
936
|
if (t.length === 0)
|
|
937
937
|
return 0;
|
|
938
|
-
const e = t[t.length - 1].time, s = this.track.stagger ?
|
|
938
|
+
const e = t[t.length - 1].time, s = this.track.stagger ? Dt(this.targets.length, this.track.stagger) : 0;
|
|
939
939
|
return e + (this.track.delay ?? 0) + s + (this.track.endDelay ?? 0);
|
|
940
940
|
}
|
|
941
941
|
/**
|
|
@@ -959,7 +959,7 @@ class jt {
|
|
|
959
959
|
if (s.time === t)
|
|
960
960
|
return s.value;
|
|
961
961
|
const r = n.time - s.time, o = (t - s.time) / r, c = W(n.easing)(o);
|
|
962
|
-
return
|
|
962
|
+
return Rt(s.value)(s.value, n.value, c);
|
|
963
963
|
}
|
|
964
964
|
/**
|
|
965
965
|
* Find the keyframes surrounding a given time.
|
|
@@ -972,62 +972,62 @@ class jt {
|
|
|
972
972
|
return { from: null, to: null };
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
|
-
class
|
|
975
|
+
class Ys {
|
|
976
976
|
track;
|
|
977
977
|
targets;
|
|
978
978
|
sampler;
|
|
979
979
|
constructor(t) {
|
|
980
|
-
this.track = t, this.targets =
|
|
980
|
+
this.track = t, this.targets = G(t), this.sampler = new Ot(t.spring);
|
|
981
981
|
}
|
|
982
982
|
getValueAtTime(t) {
|
|
983
|
-
return this.sampler.valueAt(t -
|
|
983
|
+
return this.sampler.valueAt(t - rt(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
984
984
|
}
|
|
985
985
|
getTargetValues(t) {
|
|
986
986
|
const e = this.targets.length, s = [];
|
|
987
987
|
for (let n = 0; n < e; n++) {
|
|
988
|
-
const r =
|
|
988
|
+
const r = rt(n, e, this.track.delay, this.track.stagger);
|
|
989
989
|
s.push({ target: this.targets[n], value: this.sampler.valueAt(t - r), start: r });
|
|
990
990
|
}
|
|
991
991
|
return s;
|
|
992
992
|
}
|
|
993
993
|
/** Settle time plus delay and the widest stagger offset. */
|
|
994
994
|
getDuration() {
|
|
995
|
-
const t = this.track.stagger ?
|
|
995
|
+
const t = this.track.stagger ? Dt(this.targets.length, this.track.stagger) : 0;
|
|
996
996
|
return this.sampler.settleTime() + (this.track.delay ?? 0) + t;
|
|
997
997
|
}
|
|
998
998
|
getTrack() {
|
|
999
999
|
return this.track;
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
|
-
class
|
|
1002
|
+
class Vs {
|
|
1003
1003
|
track;
|
|
1004
1004
|
targets;
|
|
1005
1005
|
duration;
|
|
1006
1006
|
constructor(t) {
|
|
1007
|
-
this.track = t, this.targets =
|
|
1007
|
+
this.track = t, this.targets = G(t), this.duration = bt(t.inertia);
|
|
1008
1008
|
}
|
|
1009
1009
|
getValueAtTime(t) {
|
|
1010
|
-
return
|
|
1010
|
+
return se(this.track.inertia, t - rt(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
1011
1011
|
}
|
|
1012
1012
|
getTargetValues(t) {
|
|
1013
1013
|
const e = this.targets.length, s = [];
|
|
1014
1014
|
for (let n = 0; n < e; n++) {
|
|
1015
|
-
const r =
|
|
1016
|
-
s.push({ target: this.targets[n], value:
|
|
1015
|
+
const r = rt(n, e, this.track.delay, this.track.stagger);
|
|
1016
|
+
s.push({ target: this.targets[n], value: se(this.track.inertia, t - r), start: r });
|
|
1017
1017
|
}
|
|
1018
1018
|
return s;
|
|
1019
1019
|
}
|
|
1020
1020
|
/** Settle time plus delay and the widest stagger offset. */
|
|
1021
1021
|
getDuration() {
|
|
1022
|
-
const t = this.track.stagger ?
|
|
1022
|
+
const t = this.track.stagger ? Dt(this.targets.length, this.track.stagger) : 0;
|
|
1023
1023
|
return this.duration + (this.track.delay ?? 0) + t;
|
|
1024
1024
|
}
|
|
1025
1025
|
getTrack() {
|
|
1026
1026
|
return this.track;
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1030
|
-
const e = { ...
|
|
1029
|
+
function wi(i, t) {
|
|
1030
|
+
const e = { ...xs(i.pathData, t) };
|
|
1031
1031
|
if (i.matrix) {
|
|
1032
1032
|
const [s, n, r, o, a, c] = i.matrix, { x: l, y: h } = e;
|
|
1033
1033
|
e.x = s * l + r * h + a, e.y = n * l + o * h + c;
|
|
@@ -1036,25 +1036,25 @@ function gi(i, t) {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
return i.autoRotate && i.rotateOffset && (e.angle += i.rotateOffset), e;
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function To(i, t, e, s) {
|
|
1040
1040
|
const n = t + (e - t) * s;
|
|
1041
|
-
return
|
|
1041
|
+
return wi(i, n);
|
|
1042
1042
|
}
|
|
1043
|
-
const
|
|
1043
|
+
const Ht = {
|
|
1044
1044
|
upperCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
1045
1045
|
lowerCase: "abcdefghijklmnopqrstuvwxyz",
|
|
1046
1046
|
upperAndLowerCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
1047
1047
|
numbers: "0123456789"
|
|
1048
|
-
},
|
|
1049
|
-
function
|
|
1050
|
-
const t =
|
|
1051
|
-
return e.length > 0 ? e : Array.from(
|
|
1048
|
+
}, Ws = 20;
|
|
1049
|
+
function js(i) {
|
|
1050
|
+
const t = Ht[i ?? "upperCase"] ?? i ?? Ht.upperCase, e = Array.from(t);
|
|
1051
|
+
return e.length > 0 ? e : Array.from(Ht.upperCase);
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function Us(i, t, e) {
|
|
1054
1054
|
let s = (i | 0) ^ Math.imul(t + 1, 2654435761) ^ Math.imul(e + 1, 2246822507);
|
|
1055
1055
|
return s = Math.imul(s ^ s >>> 16, 2146121005), s = Math.imul(s ^ s >>> 15, 2221713035), (s ^ s >>> 16) >>> 0;
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function zs(i, t, e = 0) {
|
|
1058
1058
|
const s = i.from ?? "", n = i.to, r = Math.max(0, Math.min(1, t));
|
|
1059
1059
|
if (r <= 0) return s;
|
|
1060
1060
|
if (r >= 1) return n;
|
|
@@ -1063,20 +1063,19 @@ function Ws(i, t, e = 0) {
|
|
|
1063
1063
|
const b = Math.round(r * Math.max(o.length, a.length));
|
|
1064
1064
|
return c ? o.slice(0, Math.max(0, o.length - b)).join("") + a.slice(Math.max(0, a.length - b)).join("") : a.slice(0, b).join("") + o.slice(b).join("");
|
|
1065
1065
|
}
|
|
1066
|
-
const l = Math.max(0, Math.min(0.999, i.revealDelay ?? 0)), h = Math.max(0, (r - l) / (1 - l)), f = Math.floor(h * a.length), u = i.tweenLength === !1 ? a.length : Math.round(o.length + (a.length - o.length) * r), d =
|
|
1066
|
+
const l = Math.max(0, Math.min(0.999, i.revealDelay ?? 0)), h = Math.max(0, (r - l) / (1 - l)), f = Math.floor(h * a.length), u = i.tweenLength === !1 ? a.length : Math.round(o.length + (a.length - o.length) * r), d = js(i.chars), m = i.refreshRate ?? Ws, p = m > 0 ? Math.floor(e * m / 1e3) : 0, g = i.seed ?? 1;
|
|
1067
1067
|
let y = "";
|
|
1068
1068
|
for (let b = 0; b < u; b++) {
|
|
1069
|
-
const
|
|
1070
|
-
|
|
1071
|
-
` ? y +=
|
|
1069
|
+
const v = c ? b >= u - f : b < f, T = c ? a[a.length - (u - b)] : a[b];
|
|
1070
|
+
v && T !== void 0 || T === " " || T === `
|
|
1071
|
+
` ? y += T : y += d[Us(g, b, p) % d.length];
|
|
1072
1072
|
}
|
|
1073
1073
|
return y;
|
|
1074
1074
|
}
|
|
1075
|
-
class
|
|
1075
|
+
class Ti {
|
|
1076
1076
|
id;
|
|
1077
1077
|
name;
|
|
1078
|
-
|
|
1079
|
-
captions;
|
|
1078
|
+
_captions;
|
|
1080
1079
|
_tracks = [];
|
|
1081
1080
|
_trackPlayers = /* @__PURE__ */ new Map();
|
|
1082
1081
|
_motionPathTracks = /* @__PURE__ */ new Map();
|
|
@@ -1098,7 +1097,7 @@ class yi {
|
|
|
1098
1097
|
onUpdate = null;
|
|
1099
1098
|
onComplete = null;
|
|
1100
1099
|
constructor(t) {
|
|
1101
|
-
if (this.id = t.id, this.name = t.name, this.
|
|
1100
|
+
if (this.id = t.id, this.name = t.name, this._captions = t.captions, this._config = t.config ?? {}, this._explicitDuration = t.config?.duration, t.tracks)
|
|
1102
1101
|
for (const e of t.tracks)
|
|
1103
1102
|
this.addTrack(e);
|
|
1104
1103
|
}
|
|
@@ -1272,12 +1271,12 @@ class yi {
|
|
|
1272
1271
|
a || (a = /* @__PURE__ */ new Map(), t.set(s, a));
|
|
1273
1272
|
const c = this._textTracks.get(e);
|
|
1274
1273
|
if (c && typeof r == "number") {
|
|
1275
|
-
a.set("text",
|
|
1274
|
+
a.set("text", zs(c.textConfig, r, Math.max(0, o)));
|
|
1276
1275
|
return;
|
|
1277
1276
|
}
|
|
1278
1277
|
const l = this._motionPathTracks.get(e);
|
|
1279
1278
|
if (l && typeof r == "number") {
|
|
1280
|
-
const h =
|
|
1279
|
+
const h = wi(l.motionPathConfig, r);
|
|
1281
1280
|
a.set("motionPathX", h.x), a.set("motionPathY", h.y), l.motionPathConfig.autoRotate && a.set("motionPathRotate", h.angle);
|
|
1282
1281
|
} else
|
|
1283
1282
|
a.set(n, r);
|
|
@@ -1289,7 +1288,7 @@ class yi {
|
|
|
1289
1288
|
const t = /* @__PURE__ */ new Set();
|
|
1290
1289
|
this._sharedWrites = !1;
|
|
1291
1290
|
t: for (const e of this._tracks)
|
|
1292
|
-
for (const s of
|
|
1291
|
+
for (const s of G(e)) {
|
|
1293
1292
|
const n = `${s}\0${e.property}`;
|
|
1294
1293
|
if (t.has(n)) {
|
|
1295
1294
|
this._sharedWrites = !0;
|
|
@@ -1304,17 +1303,17 @@ class yi {
|
|
|
1304
1303
|
* Add a track to the timeline.
|
|
1305
1304
|
*/
|
|
1306
1305
|
addTrack(t) {
|
|
1307
|
-
if (this._tracks.push(t), this._sharedWrites = null,
|
|
1308
|
-
this._trackPlayers.set(t.id, new
|
|
1306
|
+
if (this._tracks.push(t), this._sharedWrites = null, Z(t)) {
|
|
1307
|
+
this._trackPlayers.set(t.id, new Vs(t));
|
|
1309
1308
|
return;
|
|
1310
1309
|
}
|
|
1311
|
-
if (
|
|
1312
|
-
this._trackPlayers.set(t.id, new
|
|
1310
|
+
if (Q(t)) {
|
|
1311
|
+
this._trackPlayers.set(t.id, new Ys(t)), this._springTracks.set(t.id, t);
|
|
1313
1312
|
return;
|
|
1314
1313
|
}
|
|
1315
|
-
if (
|
|
1316
|
-
this._trackPlayers.set(t.id, new
|
|
1317
|
-
else if (
|
|
1314
|
+
if (fe(t))
|
|
1315
|
+
this._trackPlayers.set(t.id, new zt(t)), this._textTracks.set(t.id, t);
|
|
1316
|
+
else if (ai(t)) {
|
|
1318
1317
|
const e = {
|
|
1319
1318
|
id: t.id,
|
|
1320
1319
|
target: t.target,
|
|
@@ -1325,9 +1324,9 @@ class yi {
|
|
|
1325
1324
|
targets: t.targets,
|
|
1326
1325
|
stagger: t.stagger
|
|
1327
1326
|
};
|
|
1328
|
-
this._trackPlayers.set(t.id, new
|
|
1327
|
+
this._trackPlayers.set(t.id, new zt(e)), this._motionPathTracks.set(t.id, t);
|
|
1329
1328
|
} else
|
|
1330
|
-
this._trackPlayers.set(t.id, new
|
|
1329
|
+
this._trackPlayers.set(t.id, new zt(t));
|
|
1331
1330
|
}
|
|
1332
1331
|
/**
|
|
1333
1332
|
* Replace a track with a new version, keeping its place in the track order
|
|
@@ -1378,7 +1377,7 @@ class yi {
|
|
|
1378
1377
|
const e = this._trackPlayers.get(t);
|
|
1379
1378
|
if (!e) return;
|
|
1380
1379
|
const s = e.getTrack(), n = s.delay ?? 0;
|
|
1381
|
-
if (
|
|
1380
|
+
if (Q(s) || Z(s))
|
|
1382
1381
|
return { from: n, to: e.getDuration() };
|
|
1383
1382
|
const r = s.keyframes;
|
|
1384
1383
|
if (!(!r || r.length === 0))
|
|
@@ -1400,7 +1399,7 @@ class yi {
|
|
|
1400
1399
|
for (let r = 0; r < e; r++) {
|
|
1401
1400
|
const o = this._tracks[r];
|
|
1402
1401
|
if (o.property !== s.property) continue;
|
|
1403
|
-
const a =
|
|
1402
|
+
const a = G(o).filter((f) => G(s).includes(f));
|
|
1404
1403
|
if (a.length === 0) continue;
|
|
1405
1404
|
const c = this.getTrackSpan(o.id);
|
|
1406
1405
|
if (!c || !(c.from <= n.to && n.from <= c.to)) continue;
|
|
@@ -1417,7 +1416,7 @@ class yi {
|
|
|
1417
1416
|
return t;
|
|
1418
1417
|
}
|
|
1419
1418
|
_matches(t, e) {
|
|
1420
|
-
if (e.id !== void 0 && t.id !== e.id || e.property !== void 0 && t.property !== e.property || e.target !== void 0 && !
|
|
1419
|
+
if (e.id !== void 0 && t.id !== e.id || e.property !== void 0 && t.property !== e.property || e.target !== void 0 && !G(t).includes(e.target)) return !1;
|
|
1421
1420
|
if (e.timeRange) {
|
|
1422
1421
|
const s = this.getTrackSpan(t.id);
|
|
1423
1422
|
if (!s || s.to < e.timeRange.from || s.from > e.timeRange.to) return !1;
|
|
@@ -1445,6 +1444,21 @@ class yi {
|
|
|
1445
1444
|
get markers() {
|
|
1446
1445
|
return [...this._config.markers ?? []].sort((t, e) => t.time - e.time);
|
|
1447
1446
|
}
|
|
1447
|
+
/** Replace the markers (kept in time order); an empty list removes them. */
|
|
1448
|
+
setMarkers(t) {
|
|
1449
|
+
const e = t && t.length > 0 ? [...t].sort((n, r) => n.time - r.time).map((n) => ({ ...n })) : void 0, s = { ...this._config };
|
|
1450
|
+
e ? s.markers = e : delete s.markers, this._config = s;
|
|
1451
|
+
}
|
|
1452
|
+
/** Caption text per language, per marker id */
|
|
1453
|
+
get captions() {
|
|
1454
|
+
return this._captions;
|
|
1455
|
+
}
|
|
1456
|
+
/** Replace the captions; languages with no captions are dropped. */
|
|
1457
|
+
setCaptions(t) {
|
|
1458
|
+
const e = {};
|
|
1459
|
+
for (const [s, n] of Object.entries(t ?? {})) e[s] = { ...n };
|
|
1460
|
+
this._captions = Object.keys(e).length > 0 ? e : void 0;
|
|
1461
|
+
}
|
|
1448
1462
|
/** Start the between-iterations pause, if the timeline configures one. */
|
|
1449
1463
|
_armRepeatDelay() {
|
|
1450
1464
|
this._repeatDelayRemaining = this._config.repeatDelay ?? 0;
|
|
@@ -1472,72 +1486,72 @@ class yi {
|
|
|
1472
1486
|
return this._config.alternate && (t === -1 || this._loopIteration < t) ? (this._loopIteration++, this._armRepeatDelay(), this._direction = "forward", this._repeatDelayRemaining === 0) : (this._playbackState = "idle", this.onComplete?.(), !1);
|
|
1473
1487
|
}
|
|
1474
1488
|
}
|
|
1475
|
-
const
|
|
1476
|
-
function
|
|
1489
|
+
const Hs = 100;
|
|
1490
|
+
function xi(i, t, e, s) {
|
|
1477
1491
|
const n = [], r = [], { duration: o, alternate: a } = s, c = (d, m, p, g) => {
|
|
1478
1492
|
r.push([d, m]);
|
|
1479
1493
|
const y = [];
|
|
1480
|
-
i.forEach((b,
|
|
1481
|
-
(p === "forward" ? (g ? b >= d : b > d) && b <= m : (g ? b <= d : b < d) && b >= m) && y.push(
|
|
1482
|
-
}), y.sort((b,
|
|
1494
|
+
i.forEach((b, v) => {
|
|
1495
|
+
(p === "forward" ? (g ? b >= d : b > d) && b <= m : (g ? b <= d : b < d) && b >= m) && y.push(v);
|
|
1496
|
+
}), y.sort((b, v) => (p === "forward" ? i[b] - i[v] : i[v] - i[b]) || b - v);
|
|
1483
1497
|
for (const b of y) n.push({ kind: "event", index: b, direction: p });
|
|
1484
1498
|
};
|
|
1485
1499
|
let l = t.time, h = t.direction, f = t.fresh === !0;
|
|
1486
|
-
const u = Math.min(
|
|
1500
|
+
const u = Math.min(Hs, Math.max(0, e.iteration - t.iteration));
|
|
1487
1501
|
for (let d = 0; d < u; d++) {
|
|
1488
1502
|
const m = h === "forward" ? o : 0;
|
|
1489
1503
|
c(l, m, h, f), n.push({ kind: "repeat" }), a ? (h = h === "forward" ? "reverse" : "forward", l = m, f = !1) : (l = h === "forward" ? 0 : o, f = !0);
|
|
1490
1504
|
}
|
|
1491
1505
|
return u > 0 && s.holding && !a ? { crossings: n, passes: r } : (c(l, e.time, h, f), { crossings: n, passes: r });
|
|
1492
1506
|
}
|
|
1493
|
-
function
|
|
1494
|
-
return
|
|
1507
|
+
function Gs(i) {
|
|
1508
|
+
return Z(i) ? {
|
|
1495
1509
|
id: i.id,
|
|
1496
1510
|
target: i.target,
|
|
1497
1511
|
property: i.property,
|
|
1498
1512
|
kind: "inertia",
|
|
1499
|
-
inertia:
|
|
1500
|
-
...
|
|
1501
|
-
} :
|
|
1513
|
+
inertia: ki(i.inertia),
|
|
1514
|
+
...X(i)
|
|
1515
|
+
} : Q(i) ? {
|
|
1502
1516
|
id: i.id,
|
|
1503
1517
|
target: i.target,
|
|
1504
1518
|
property: i.property,
|
|
1505
1519
|
kind: "spring",
|
|
1506
1520
|
spring: { ...i.spring },
|
|
1507
|
-
...
|
|
1508
|
-
} :
|
|
1521
|
+
...X(i)
|
|
1522
|
+
} : fe(i) ? {
|
|
1509
1523
|
id: i.id,
|
|
1510
1524
|
target: i.target,
|
|
1511
1525
|
property: "text",
|
|
1512
1526
|
textConfig: { ...i.textConfig },
|
|
1513
|
-
keyframes: i.keyframes.map(
|
|
1514
|
-
...
|
|
1515
|
-
} :
|
|
1527
|
+
keyframes: i.keyframes.map(Gt),
|
|
1528
|
+
...X(i)
|
|
1529
|
+
} : ai(i) ? {
|
|
1516
1530
|
id: i.id,
|
|
1517
1531
|
target: i.target,
|
|
1518
1532
|
property: "motionPath",
|
|
1519
1533
|
motionPathConfig: { ...i.motionPathConfig },
|
|
1520
|
-
keyframes: i.keyframes.map(
|
|
1521
|
-
...
|
|
1534
|
+
keyframes: i.keyframes.map(Gt),
|
|
1535
|
+
...X(i)
|
|
1522
1536
|
} : {
|
|
1523
1537
|
id: i.id,
|
|
1524
1538
|
target: i.target,
|
|
1525
1539
|
property: i.property,
|
|
1526
|
-
keyframes: i.keyframes.map(
|
|
1527
|
-
...
|
|
1540
|
+
keyframes: i.keyframes.map(Gt),
|
|
1541
|
+
...X(i)
|
|
1528
1542
|
};
|
|
1529
1543
|
}
|
|
1530
|
-
function
|
|
1544
|
+
function ki(i) {
|
|
1531
1545
|
return { ...i, ...Array.isArray(i.end) && { end: [...i.end] } };
|
|
1532
1546
|
}
|
|
1533
|
-
function
|
|
1547
|
+
function Gt(i) {
|
|
1534
1548
|
return {
|
|
1535
1549
|
time: i.time,
|
|
1536
1550
|
value: i.value,
|
|
1537
1551
|
...i.easing && { easing: i.easing }
|
|
1538
1552
|
};
|
|
1539
1553
|
}
|
|
1540
|
-
function
|
|
1554
|
+
function X(i) {
|
|
1541
1555
|
const t = i.endDelay;
|
|
1542
1556
|
return {
|
|
1543
1557
|
...i.delay !== void 0 && { delay: i.delay },
|
|
@@ -1546,19 +1560,19 @@ function N(i) {
|
|
|
1546
1560
|
...i.stagger !== void 0 && { stagger: { ...i.stagger } }
|
|
1547
1561
|
};
|
|
1548
1562
|
}
|
|
1549
|
-
function
|
|
1550
|
-
if (
|
|
1563
|
+
function Ks(i) {
|
|
1564
|
+
if (Z(i)) {
|
|
1551
1565
|
const t = i;
|
|
1552
1566
|
return {
|
|
1553
1567
|
id: t.id,
|
|
1554
1568
|
target: t.target,
|
|
1555
1569
|
property: t.property,
|
|
1556
1570
|
kind: "inertia",
|
|
1557
|
-
inertia:
|
|
1558
|
-
...
|
|
1571
|
+
inertia: ki(t.inertia),
|
|
1572
|
+
...X(t)
|
|
1559
1573
|
};
|
|
1560
1574
|
}
|
|
1561
|
-
if (
|
|
1575
|
+
if (Q(i)) {
|
|
1562
1576
|
const t = i;
|
|
1563
1577
|
return {
|
|
1564
1578
|
id: t.id,
|
|
@@ -1566,10 +1580,10 @@ function zs(i) {
|
|
|
1566
1580
|
property: t.property,
|
|
1567
1581
|
kind: "spring",
|
|
1568
1582
|
spring: { ...t.spring },
|
|
1569
|
-
...
|
|
1583
|
+
...X(t)
|
|
1570
1584
|
};
|
|
1571
1585
|
}
|
|
1572
|
-
if (
|
|
1586
|
+
if (fe(i)) {
|
|
1573
1587
|
const t = i;
|
|
1574
1588
|
return {
|
|
1575
1589
|
id: t.id,
|
|
@@ -1577,7 +1591,7 @@ function zs(i) {
|
|
|
1577
1591
|
property: "text",
|
|
1578
1592
|
textConfig: { ...t.textConfig },
|
|
1579
1593
|
keyframes: [...t.keyframes].sort((e, s) => e.time - s.time),
|
|
1580
|
-
...
|
|
1594
|
+
...X(t)
|
|
1581
1595
|
};
|
|
1582
1596
|
}
|
|
1583
1597
|
if (i.property === "motionPath" && "motionPathConfig" in i) {
|
|
@@ -1588,18 +1602,18 @@ function zs(i) {
|
|
|
1588
1602
|
property: "motionPath",
|
|
1589
1603
|
motionPathConfig: { ...t.motionPathConfig },
|
|
1590
1604
|
keyframes: e,
|
|
1591
|
-
...
|
|
1605
|
+
...X(t)
|
|
1592
1606
|
};
|
|
1593
1607
|
}
|
|
1594
|
-
return
|
|
1608
|
+
return oe({
|
|
1595
1609
|
id: i.id,
|
|
1596
1610
|
target: i.target,
|
|
1597
1611
|
property: i.property,
|
|
1598
1612
|
keyframes: i.keyframes,
|
|
1599
|
-
...
|
|
1613
|
+
...X(i)
|
|
1600
1614
|
});
|
|
1601
1615
|
}
|
|
1602
|
-
function
|
|
1616
|
+
function Zs(i) {
|
|
1603
1617
|
const t = i._config.markers;
|
|
1604
1618
|
return {
|
|
1605
1619
|
formatVersion: _t,
|
|
@@ -1613,38 +1627,38 @@ function Hs(i) {
|
|
|
1613
1627
|
repeatDelay: i._config.repeatDelay,
|
|
1614
1628
|
...t && { markers: t.map((e) => ({ ...e })) }
|
|
1615
1629
|
},
|
|
1616
|
-
tracks: i.tracks.map(
|
|
1617
|
-
...i.captions && { captions: i.captions }
|
|
1630
|
+
tracks: i.tracks.map(Gs),
|
|
1631
|
+
...i.captions && { captions: JSON.parse(JSON.stringify(i.captions)) }
|
|
1618
1632
|
};
|
|
1619
1633
|
}
|
|
1620
|
-
function
|
|
1634
|
+
function mt(i) {
|
|
1621
1635
|
const t = i.formatVersion ?? 1;
|
|
1622
1636
|
if (t > _t)
|
|
1623
1637
|
throw new Error(
|
|
1624
1638
|
`tinyfly: this animation uses format version ${t}, but this tinyfly reads up to version ${_t}. Update tinyfly to play it.`
|
|
1625
1639
|
);
|
|
1626
|
-
return new
|
|
1640
|
+
return new Ti({
|
|
1627
1641
|
id: i.id,
|
|
1628
1642
|
name: i.name,
|
|
1629
1643
|
config: i.config,
|
|
1630
|
-
tracks: i.tracks.map(
|
|
1644
|
+
tracks: i.tracks.map(Ks),
|
|
1631
1645
|
captions: i.captions
|
|
1632
1646
|
});
|
|
1633
1647
|
}
|
|
1634
|
-
function
|
|
1635
|
-
return JSON.stringify(
|
|
1648
|
+
function xo(i) {
|
|
1649
|
+
return JSON.stringify(Zs(i));
|
|
1636
1650
|
}
|
|
1637
|
-
function
|
|
1651
|
+
function ko(i) {
|
|
1638
1652
|
const t = JSON.parse(i);
|
|
1639
|
-
return
|
|
1653
|
+
return mt(t);
|
|
1640
1654
|
}
|
|
1641
|
-
function
|
|
1655
|
+
function So(i) {
|
|
1642
1656
|
let t = 2166136261;
|
|
1643
1657
|
for (let e = 0; e < i.length; e++)
|
|
1644
1658
|
t ^= i.charCodeAt(e), t = Math.imul(t, 16777619);
|
|
1645
1659
|
return t >>> 0;
|
|
1646
1660
|
}
|
|
1647
|
-
function
|
|
1661
|
+
function Qs(i) {
|
|
1648
1662
|
let t = i >>> 0 || 2654435769;
|
|
1649
1663
|
return {
|
|
1650
1664
|
seed: i >>> 0,
|
|
@@ -1653,25 +1667,25 @@ function Gs(i) {
|
|
|
1653
1667
|
}
|
|
1654
1668
|
};
|
|
1655
1669
|
}
|
|
1656
|
-
function
|
|
1670
|
+
function Si(i, t, e) {
|
|
1657
1671
|
return t + i.next() * (e - t);
|
|
1658
1672
|
}
|
|
1659
|
-
function
|
|
1660
|
-
if (s <= 0) return
|
|
1673
|
+
function Js(i, t, e, s) {
|
|
1674
|
+
if (s <= 0) return Si(i, t, e);
|
|
1661
1675
|
const n = Math.floor((e - t) / s), r = Math.round(i.next() * n);
|
|
1662
1676
|
return t + r * s;
|
|
1663
1677
|
}
|
|
1664
|
-
function
|
|
1678
|
+
function Mo(i, t) {
|
|
1665
1679
|
if (t.length !== 0)
|
|
1666
1680
|
return t[Math.floor(i.next() * t.length)];
|
|
1667
1681
|
}
|
|
1668
|
-
const
|
|
1669
|
-
function
|
|
1670
|
-
return typeof i != "string" ? !1 :
|
|
1682
|
+
const Mi = /^([+\-*/])=\s*(-?[\d.]+)$/, Ai = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
|
|
1683
|
+
function Ao(i) {
|
|
1684
|
+
return typeof i != "string" ? !1 : Mi.test(i.trim()) || Ai.test(i.trim());
|
|
1671
1685
|
}
|
|
1672
|
-
function
|
|
1686
|
+
function Pi(i, t = {}) {
|
|
1673
1687
|
if (typeof i != "string") return i;
|
|
1674
|
-
const e = i.trim(), s =
|
|
1688
|
+
const e = i.trim(), s = Mi.exec(e);
|
|
1675
1689
|
if (s) {
|
|
1676
1690
|
const [, r, o] = s, a = t.base ?? 0, c = Number.parseFloat(o);
|
|
1677
1691
|
switch (r) {
|
|
@@ -1685,66 +1699,66 @@ function Si(i, t = {}) {
|
|
|
1685
1699
|
return c === 0 ? a : a / c;
|
|
1686
1700
|
}
|
|
1687
1701
|
}
|
|
1688
|
-
const n =
|
|
1702
|
+
const n = Ai.exec(e);
|
|
1689
1703
|
if (n) {
|
|
1690
1704
|
if (!t.random)
|
|
1691
1705
|
throw new Error(
|
|
1692
1706
|
`resolveValue: "${e}" needs a random source — pass one via context.random`
|
|
1693
1707
|
);
|
|
1694
1708
|
const r = Number.parseFloat(n[1]), o = Number.parseFloat(n[2]), a = n[3] !== void 0 ? Number.parseFloat(n[3]) : void 0;
|
|
1695
|
-
return a !== void 0 ?
|
|
1709
|
+
return a !== void 0 ? Js(t.random, r, o, a) : Si(t.random, r, o);
|
|
1696
1710
|
}
|
|
1697
1711
|
return i;
|
|
1698
1712
|
}
|
|
1699
|
-
function
|
|
1713
|
+
function tn(i, t = 0, e) {
|
|
1700
1714
|
const s = [];
|
|
1701
1715
|
let n = t;
|
|
1702
1716
|
for (const r of i) {
|
|
1703
|
-
const o =
|
|
1717
|
+
const o = Pi(r, { base: n, random: e });
|
|
1704
1718
|
s.push(o), typeof o == "number" && (n = o);
|
|
1705
1719
|
}
|
|
1706
1720
|
return s;
|
|
1707
1721
|
}
|
|
1708
|
-
class
|
|
1722
|
+
class Po {
|
|
1709
1723
|
random;
|
|
1710
1724
|
constructor(t) {
|
|
1711
|
-
this.random =
|
|
1725
|
+
this.random = Qs(t);
|
|
1712
1726
|
}
|
|
1713
1727
|
/** The seed, to be stored alongside the timeline so this can be reproduced. */
|
|
1714
1728
|
get seed() {
|
|
1715
1729
|
return this.random.seed;
|
|
1716
1730
|
}
|
|
1717
1731
|
resolve(t, e = 0) {
|
|
1718
|
-
return
|
|
1732
|
+
return Pi(t, { base: e, random: this.random });
|
|
1719
1733
|
}
|
|
1720
1734
|
resolveSequence(t, e = 0) {
|
|
1721
|
-
return
|
|
1735
|
+
return tn(t, e, this.random);
|
|
1722
1736
|
}
|
|
1723
1737
|
}
|
|
1724
|
-
const
|
|
1725
|
-
function
|
|
1738
|
+
const en = 600;
|
|
1739
|
+
function sn(i) {
|
|
1726
1740
|
if (Array.isArray(i)) {
|
|
1727
1741
|
const [u, d, m, p] = i;
|
|
1728
|
-
return { fn:
|
|
1742
|
+
return { fn: Le(u, d, m, p), bezier: [u, d, m, p] };
|
|
1729
1743
|
}
|
|
1730
|
-
const { segments: t } =
|
|
1744
|
+
const { segments: t } = nt(i);
|
|
1731
1745
|
if (t.length === 0) throw new Error(`customEase: no curve in "${i}"`);
|
|
1732
1746
|
const e = t[0].startX, s = t[0].startY, n = t[t.length - 1], r = n.endX - e, o = n.endY - s;
|
|
1733
1747
|
if (r === 0 || o === 0) throw new Error(`customEase: "${i}" must move along both axes`);
|
|
1734
1748
|
const a = (u) => (u - e) / r, c = (u) => (u - s) / o;
|
|
1735
1749
|
if (t.length === 1 && n.type === "C") {
|
|
1736
1750
|
const [u, d, m, p] = n.points, g = [a(u), c(d), a(m), c(p)];
|
|
1737
|
-
return { fn:
|
|
1751
|
+
return { fn: Le(...g), bezier: g };
|
|
1738
1752
|
}
|
|
1739
|
-
const l = [], h = [], f = Math.max(8, Math.ceil(
|
|
1753
|
+
const l = [], h = [], f = Math.max(8, Math.ceil(en / t.length));
|
|
1740
1754
|
for (const u of t)
|
|
1741
1755
|
for (let d = l.length === 0 ? 0 : 1; d <= f; d++) {
|
|
1742
|
-
const [m, p] =
|
|
1756
|
+
const [m, p] = on(u, d / f);
|
|
1743
1757
|
l.push(a(m)), h.push(c(p));
|
|
1744
1758
|
}
|
|
1745
|
-
return { fn:
|
|
1759
|
+
return { fn: an(l, h) };
|
|
1746
1760
|
}
|
|
1747
|
-
function
|
|
1761
|
+
function nn(i = {}) {
|
|
1748
1762
|
const e = 0.1 + Math.max(0, Math.min(1, i.strength ?? 0.7)) * 0.7, s = [1];
|
|
1749
1763
|
for (let r = e; r > 2e-3; r *= e) s.push(2 * Math.sqrt(r));
|
|
1750
1764
|
const n = s.reduce((r, o) => r + o, 0);
|
|
@@ -1763,11 +1777,11 @@ function tn(i = {}) {
|
|
|
1763
1777
|
return 1;
|
|
1764
1778
|
};
|
|
1765
1779
|
}
|
|
1766
|
-
function
|
|
1780
|
+
function rn(i = {}) {
|
|
1767
1781
|
const t = Math.max(1, i.wiggles ?? 10), e = i.type ?? "easeOut", s = (n) => e === "uniform" ? 1 : e === "easeInOut" ? Math.sin(Math.PI * n) : (1 - n) ** 2;
|
|
1768
1782
|
return (n) => n <= 0 || n >= 1 ? 0 : Math.sin(n * t * Math.PI * 2) * s(n);
|
|
1769
1783
|
}
|
|
1770
|
-
function
|
|
1784
|
+
function on(i, t) {
|
|
1771
1785
|
if (i.type === "L") {
|
|
1772
1786
|
const [l, h] = i.points;
|
|
1773
1787
|
return [i.startX + (l - i.startX) * t, i.startY + (h - i.startY) * t];
|
|
@@ -1778,7 +1792,7 @@ function sn(i, t) {
|
|
|
1778
1792
|
c * c * c * i.startY + 3 * c * c * t * s + 3 * c * t * t * r + t * t * t * a
|
|
1779
1793
|
];
|
|
1780
1794
|
}
|
|
1781
|
-
function
|
|
1795
|
+
function an(i, t) {
|
|
1782
1796
|
return (e) => {
|
|
1783
1797
|
if (e <= i[0]) return t[0];
|
|
1784
1798
|
if (e >= i[i.length - 1]) return t[t.length - 1];
|
|
@@ -1791,7 +1805,7 @@ function nn(i, t) {
|
|
|
1791
1805
|
return r === 0 ? t[n] : t[s] + (e - i[s]) / r * (t[n] - t[s]);
|
|
1792
1806
|
};
|
|
1793
1807
|
}
|
|
1794
|
-
function
|
|
1808
|
+
function Le(i, t, e, s) {
|
|
1795
1809
|
const n = (o, a, c) => 3 * (1 - o) * (1 - o) * o * a + 3 * (1 - o) * o * o * c + o * o * o, r = (o, a, c) => 3 * (1 - o) * (1 - o) * a + 6 * (1 - o) * o * (c - a) + 3 * o * o * (1 - c);
|
|
1796
1810
|
return (o) => {
|
|
1797
1811
|
if (o <= 0) return 0;
|
|
@@ -1810,53 +1824,53 @@ function Ie(i, t, e, s) {
|
|
|
1810
1824
|
return n(a, t, s);
|
|
1811
1825
|
};
|
|
1812
1826
|
}
|
|
1813
|
-
const
|
|
1814
|
-
function
|
|
1827
|
+
const q = (i) => Math.round(i * 1e3) / 1e3;
|
|
1828
|
+
function cn(i, t = {}) {
|
|
1815
1829
|
if (i.length === 0) return "";
|
|
1816
1830
|
const e = t.curviness ?? 1, s = t.closed ?? !1, n = i.length;
|
|
1817
|
-
let r = `M${
|
|
1831
|
+
let r = `M${q(i[0].x)} ${q(i[0].y)}`;
|
|
1818
1832
|
if (n === 1) return r;
|
|
1819
1833
|
const o = (c) => s ? i[(c % n + n) % n] : i[Math.max(0, Math.min(n - 1, c))], a = s ? n : n - 1;
|
|
1820
1834
|
for (let c = 0; c < a; c++) {
|
|
1821
1835
|
const l = o(c - 1), h = o(c), f = o(c + 1), u = o(c + 2);
|
|
1822
1836
|
if (e === 0) {
|
|
1823
|
-
r += ` L${
|
|
1837
|
+
r += ` L${q(f.x)} ${q(f.y)}`;
|
|
1824
1838
|
continue;
|
|
1825
1839
|
}
|
|
1826
1840
|
const d = e / 6, m = h.x + (f.x - l.x) * d, p = h.y + (f.y - l.y) * d, g = f.x - (u.x - h.x) * d, y = f.y - (u.y - h.y) * d;
|
|
1827
|
-
r += ` C${
|
|
1841
|
+
r += ` C${q(m)} ${q(p)} ${q(g)} ${q(y)} ${q(f.x)} ${q(f.y)}`;
|
|
1828
1842
|
}
|
|
1829
1843
|
return s ? `${r} Z` : r;
|
|
1830
1844
|
}
|
|
1831
|
-
const
|
|
1845
|
+
const F = (i, t = 0) => {
|
|
1832
1846
|
const e = parseFloat(i ?? "");
|
|
1833
1847
|
return Number.isFinite(e) ? e : t;
|
|
1834
1848
|
};
|
|
1835
|
-
function
|
|
1849
|
+
function ln(i) {
|
|
1836
1850
|
const t = (i ?? "").trim().split(/[\s,]+/).filter(Boolean).map(Number), e = [];
|
|
1837
1851
|
for (let s = 0; s + 1 < t.length; s += 2) e.push({ x: t[s], y: t[s + 1] });
|
|
1838
1852
|
return e;
|
|
1839
1853
|
}
|
|
1840
|
-
function
|
|
1854
|
+
function pe(i) {
|
|
1841
1855
|
const t = i.attributes;
|
|
1842
1856
|
switch (i.tag.toLowerCase()) {
|
|
1843
1857
|
case "path":
|
|
1844
1858
|
return t.d ?? null;
|
|
1845
1859
|
case "circle":
|
|
1846
1860
|
case "ellipse": {
|
|
1847
|
-
const e =
|
|
1861
|
+
const e = F(t.cx), s = F(t.cy), n = i.tag.toLowerCase() === "circle" ? F(t.r) : F(t.rx), r = i.tag.toLowerCase() === "circle" ? F(t.r) : F(t.ry);
|
|
1848
1862
|
return `M${e + n} ${s} A${n} ${r} 0 1 1 ${e - n} ${s} A${n} ${r} 0 1 1 ${e + n} ${s} Z`;
|
|
1849
1863
|
}
|
|
1850
1864
|
case "rect": {
|
|
1851
|
-
const e =
|
|
1852
|
-
let o = t.rx != null ?
|
|
1865
|
+
const e = F(t.x), s = F(t.y), n = F(t.width), r = F(t.height);
|
|
1866
|
+
let o = t.rx != null ? F(t.rx) : t.ry != null ? F(t.ry) : 0, a = t.ry != null ? F(t.ry) : o;
|
|
1853
1867
|
return o = Math.min(o, n / 2), a = Math.min(a, r / 2), o === 0 || a === 0 ? `M${e} ${s} H${e + n} V${s + r} H${e} Z` : `M${e + o} ${s} H${e + n - o} A${o} ${a} 0 0 1 ${e + n} ${s + a} V${s + r - a} A${o} ${a} 0 0 1 ${e + n - o} ${s + r} H${e + o} A${o} ${a} 0 0 1 ${e} ${s + r - a} V${s + a} A${o} ${a} 0 0 1 ${e + o} ${s} Z`;
|
|
1854
1868
|
}
|
|
1855
1869
|
case "line":
|
|
1856
|
-
return `M${
|
|
1870
|
+
return `M${F(t.x1)} ${F(t.y1)} L${F(t.x2)} ${F(t.y2)}`;
|
|
1857
1871
|
case "polyline":
|
|
1858
1872
|
case "polygon": {
|
|
1859
|
-
const e =
|
|
1873
|
+
const e = ln(t.points);
|
|
1860
1874
|
if (e.length === 0) return null;
|
|
1861
1875
|
const s = e.map((n, r) => `${r === 0 ? "M" : "L"}${n.x} ${n.y}`).join(" ");
|
|
1862
1876
|
return i.tag.toLowerCase() === "polygon" ? `${s} Z` : s;
|
|
@@ -1865,7 +1879,7 @@ function fe(i) {
|
|
|
1865
1879
|
return null;
|
|
1866
1880
|
}
|
|
1867
1881
|
}
|
|
1868
|
-
const
|
|
1882
|
+
const kt = {
|
|
1869
1883
|
"power1.in": [0.55, 0.085, 0.68, 0.53],
|
|
1870
1884
|
"power1.out": [0.25, 0.46, 0.45, 0.94],
|
|
1871
1885
|
"power1.inout": [0.455, 0.03, 0.515, 0.955],
|
|
@@ -1890,7 +1904,7 @@ const St = {
|
|
|
1890
1904
|
"back.in": [0.6, -0.28, 0.735, 0.045],
|
|
1891
1905
|
"back.out": [0.175, 0.885, 0.32, 1.275],
|
|
1892
1906
|
"back.inout": [0.68, -0.55, 0.265, 1.55]
|
|
1893
|
-
},
|
|
1907
|
+
}, De = {
|
|
1894
1908
|
none: "linear",
|
|
1895
1909
|
linear: "linear",
|
|
1896
1910
|
"linear.none": "linear",
|
|
@@ -1902,7 +1916,7 @@ const St = {
|
|
|
1902
1916
|
"power2.out": "ease-out-cubic",
|
|
1903
1917
|
"power2.inout": "ease-in-out-cubic"
|
|
1904
1918
|
};
|
|
1905
|
-
function
|
|
1919
|
+
function hn(i) {
|
|
1906
1920
|
let t = i.trim().toLowerCase();
|
|
1907
1921
|
t = t.replace(/\.ease(in|out|inout)$/, ".$1");
|
|
1908
1922
|
const e = /^([a-z]+\d?)(\(.*\))?$/.exec(t);
|
|
@@ -1910,10 +1924,10 @@ function an(i) {
|
|
|
1910
1924
|
}
|
|
1911
1925
|
W({ type: "bounce", mode: "in" });
|
|
1912
1926
|
W({ type: "bounce", mode: "in-out" });
|
|
1913
|
-
function
|
|
1914
|
-
const t =
|
|
1927
|
+
function It(i) {
|
|
1928
|
+
const t = Ei.get(i.trim().toLowerCase());
|
|
1915
1929
|
if (t) return t;
|
|
1916
|
-
const e =
|
|
1930
|
+
const e = hn(i), s = /^steps\(\s*(\d+)\s*\)$/.exec(e);
|
|
1917
1931
|
if (s) {
|
|
1918
1932
|
const o = { type: "steps", count: Math.max(1, Number.parseInt(s[1], 10)) + 1, position: "none" };
|
|
1919
1933
|
return { easing: o, fn: W(o) };
|
|
@@ -1921,21 +1935,21 @@ function Rt(i) {
|
|
|
1921
1935
|
const n = /^(elastic|bounce|back)\.(in|out|inout)(?:\(([^)]*)\))?$/.exec(e);
|
|
1922
1936
|
if (n) {
|
|
1923
1937
|
const [, r, o, a] = n, c = (a ?? "").split(",").map((f) => Number.parseFloat(f)).filter((f) => Number.isFinite(f)), l = o === "inout" ? "in-out" : o;
|
|
1924
|
-
if (r === "back" && c.length === 0 && e in
|
|
1925
|
-
return { easing: { type: "cubic-bezier", points:
|
|
1938
|
+
if (r === "back" && c.length === 0 && e in kt)
|
|
1939
|
+
return { easing: { type: "cubic-bezier", points: kt[e] } };
|
|
1926
1940
|
const h = r === "elastic" ? { type: "elastic", mode: l, ...c[0] !== void 0 && { amplitude: c[0] }, ...c[1] !== void 0 && { period: c[1] } } : r === "bounce" ? { type: "bounce", mode: l } : { type: "back", mode: l, ...c[0] !== void 0 && { overshoot: c[0] } };
|
|
1927
1941
|
return { easing: h, fn: W(h) };
|
|
1928
1942
|
}
|
|
1929
|
-
return e in
|
|
1943
|
+
return e in De ? { easing: De[e] } : e in kt ? { easing: { type: "cubic-bezier", points: kt[e] } } : { easing: "ease-out" };
|
|
1930
1944
|
}
|
|
1931
|
-
const
|
|
1932
|
-
function
|
|
1933
|
-
return
|
|
1945
|
+
const Ei = /* @__PURE__ */ new Map();
|
|
1946
|
+
function me(i, t) {
|
|
1947
|
+
return Ei.set(
|
|
1934
1948
|
i.trim().toLowerCase(),
|
|
1935
1949
|
t.bezier ? { easing: { type: "cubic-bezier", points: t.bezier }, fn: t.fn } : { fn: t.fn, requiresBaking: "custom" }
|
|
1936
1950
|
), i;
|
|
1937
1951
|
}
|
|
1938
|
-
function
|
|
1952
|
+
function ae(i) {
|
|
1939
1953
|
let t = i >>> 0;
|
|
1940
1954
|
return () => {
|
|
1941
1955
|
t = t + 1831565813 >>> 0;
|
|
@@ -1943,16 +1957,16 @@ function re(i) {
|
|
|
1943
1957
|
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
1944
1958
|
};
|
|
1945
1959
|
}
|
|
1946
|
-
const
|
|
1947
|
-
function
|
|
1948
|
-
return typeof i == "string" &&
|
|
1960
|
+
const _i = /^\s*random\(\s*(\[.*\]|[^)]*)\s*\)\s*$/;
|
|
1961
|
+
function Ci(i) {
|
|
1962
|
+
return typeof i == "string" && _i.test(i);
|
|
1949
1963
|
}
|
|
1950
|
-
function
|
|
1951
|
-
let t =
|
|
1964
|
+
function un(i = 1) {
|
|
1965
|
+
let t = ae(i);
|
|
1952
1966
|
const e = (c, l) => ((...h) => h.length >= c ? l(...h) : (f) => l(...h, f)), s = (c, l, h) => Math.min(Math.max(h, Math.min(c, l)), Math.max(c, l)), n = (c, l, h, f, u) => l === c ? h : h + (u - c) / (l - c) * (f - h), r = (c, l) => {
|
|
1953
1967
|
if (typeof c == "number") return c === 0 ? l : Math.round(l / c) * c;
|
|
1954
|
-
if (Array.isArray(c)) return
|
|
1955
|
-
if ("values" in c) return
|
|
1968
|
+
if (Array.isArray(c)) return Oe(c, l, 1 / 0);
|
|
1969
|
+
if ("values" in c) return Oe(c.values, l, c.radius ?? 1 / 0);
|
|
1956
1970
|
const h = Math.round(l / c.increment) * c.increment;
|
|
1957
1971
|
return Math.abs(h - l) <= (c.radius ?? 1 / 0) ? h : l;
|
|
1958
1972
|
}, o = (c, l, h) => {
|
|
@@ -1967,10 +1981,10 @@ function cn(i = 1) {
|
|
|
1967
1981
|
if (typeof c == "object" && !Array.isArray(c)) {
|
|
1968
1982
|
const f = {};
|
|
1969
1983
|
for (const u of Object.keys(c))
|
|
1970
|
-
f[u] =
|
|
1984
|
+
f[u] = Rt(c[u])(c[u], l[u], h);
|
|
1971
1985
|
return f;
|
|
1972
1986
|
}
|
|
1973
|
-
return
|
|
1987
|
+
return Rt(c)(c, l, h);
|
|
1974
1988
|
}),
|
|
1975
1989
|
wrap: ((c, l, h) => {
|
|
1976
1990
|
if (Array.isArray(c)) {
|
|
@@ -2003,17 +2017,17 @@ function cn(i = 1) {
|
|
|
2003
2017
|
return c;
|
|
2004
2018
|
},
|
|
2005
2019
|
distribute: ({ base: c = 0, amount: l, each: h, from: f = "start", ease: u }) => (d, m, p) => {
|
|
2006
|
-
const g = p.length, b =
|
|
2007
|
-
return c +
|
|
2020
|
+
const g = p.length, b = de(d, g, { ...l !== void 0 ? { amount: l } : { each: h ?? 1 }, from: f }), v = l !== void 0 ? l : (h ?? 1) * li(g, f), T = u && v > 0 ? u(b / v) * v : b;
|
|
2021
|
+
return c + T;
|
|
2008
2022
|
},
|
|
2009
2023
|
pipe: (...c) => (l) => c.reduce((h, f) => f(h), l),
|
|
2010
|
-
splitColor: (c) =>
|
|
2024
|
+
splitColor: (c) => fn(c),
|
|
2011
2025
|
getUnit: (c) => typeof c == "number" ? "" : /^-?[\d.]+(?:e[-+]?\d+)?([a-z%]*)$/i.exec(c.trim())?.[1] ?? "",
|
|
2012
2026
|
seed: (c) => {
|
|
2013
|
-
t =
|
|
2027
|
+
t = ae(c);
|
|
2014
2028
|
},
|
|
2015
2029
|
resolveRandomString: (c) => {
|
|
2016
|
-
const l =
|
|
2030
|
+
const l = _i.exec(c)?.[1] ?? "";
|
|
2017
2031
|
if (l.startsWith("[")) {
|
|
2018
2032
|
const m = l.slice(1, -1).split(",").map((p) => p.trim()).filter(Boolean).map((p) => Number.isFinite(Number(p)) ? Number(p) : p.replace(/^['"]|['"]$/g, ""));
|
|
2019
2033
|
return m[Math.floor(t() * m.length)];
|
|
@@ -2023,7 +2037,7 @@ function cn(i = 1) {
|
|
|
2023
2037
|
}
|
|
2024
2038
|
};
|
|
2025
2039
|
}
|
|
2026
|
-
function
|
|
2040
|
+
function Oe(i, t, e) {
|
|
2027
2041
|
let s = t, n = 1 / 0;
|
|
2028
2042
|
for (const r of i) {
|
|
2029
2043
|
const o = Math.abs(r - t);
|
|
@@ -2031,7 +2045,7 @@ function Fe(i, t, e) {
|
|
|
2031
2045
|
}
|
|
2032
2046
|
return n <= e ? s : t;
|
|
2033
2047
|
}
|
|
2034
|
-
function
|
|
2048
|
+
function fn(i) {
|
|
2035
2049
|
const t = i.trim(), e = /^#([0-9a-f]{3,8})$/i.exec(t)?.[1];
|
|
2036
2050
|
if (e) {
|
|
2037
2051
|
const r = (e.length <= 4 ? [...e].map((o) => o + o).join("") : e).match(/../g).map((o) => Number.parseInt(o, 16));
|
|
@@ -2040,19 +2054,19 @@ function ln(i) {
|
|
|
2040
2054
|
const s = (/rgba?\(([^)]+)\)/i.exec(t)?.[1] ?? "0,0,0").split(/[\s,/]+/).filter(Boolean).map((n) => Number.parseFloat(n));
|
|
2041
2055
|
return s.length >= 4 ? [s[0], s[1], s[2], s[3]] : [s[0] ?? 0, s[1] ?? 0, s[2] ?? 0];
|
|
2042
2056
|
}
|
|
2043
|
-
const
|
|
2044
|
-
function
|
|
2057
|
+
const dn = /^([+-])=\s*(-?[\d.]+)$/, pn = /^([<>])\s*(?:([+-])?=?\s*(-?[\d.]+))?$/;
|
|
2058
|
+
function ht(i, t) {
|
|
2045
2059
|
const e = t.scale ?? 1, s = (l) => Number.parseFloat(l) * e;
|
|
2046
2060
|
if (i === void 0) return t.cursor;
|
|
2047
2061
|
if (typeof i == "number") return i * e;
|
|
2048
2062
|
const n = i.trim();
|
|
2049
2063
|
if (n === "") return t.cursor;
|
|
2050
|
-
const r =
|
|
2064
|
+
const r = dn.exec(n);
|
|
2051
2065
|
if (r) {
|
|
2052
2066
|
const l = s(r[2]);
|
|
2053
2067
|
return t.cursor + (r[1] === "-" ? -l : l);
|
|
2054
2068
|
}
|
|
2055
|
-
const o =
|
|
2069
|
+
const o = pn.exec(n);
|
|
2056
2070
|
if (o) {
|
|
2057
2071
|
const l = o[1] === "<" ? t.previousStart : t.previousEnd;
|
|
2058
2072
|
if (o[3] === void 0) return l;
|
|
@@ -2070,12 +2084,12 @@ function lt(i, t) {
|
|
|
2070
2084
|
const c = t.labels.get(n);
|
|
2071
2085
|
return c !== void 0 ? c : /^-?[\d.]+$/.test(n) ? s(n) : t.cursor;
|
|
2072
2086
|
}
|
|
2073
|
-
function
|
|
2087
|
+
function mn(i) {
|
|
2074
2088
|
if (typeof i != "object" || i === null) return !1;
|
|
2075
2089
|
const t = i;
|
|
2076
2090
|
return t.grid !== void 0 || t.from === "random" || Array.isArray(t.from) || t.ease !== void 0 || t.axis !== void 0;
|
|
2077
2091
|
}
|
|
2078
|
-
function
|
|
2092
|
+
function gn(i, t, e = {}) {
|
|
2079
2093
|
if (i === 0) return [];
|
|
2080
2094
|
const s = t.grid === "auto" ? Math.max(1, Math.min(i, e.columnsFromLayout?.() ?? i)) : Array.isArray(t.grid) ? Math.max(1, t.grid[1]) : i, n = Array.isArray(t.grid) ? Math.max(1, t.grid[0]) : Math.ceil(i / s), r = (m) => ({ x: m % s, y: Math.floor(m / s) }), o = t.from ?? "start", a = Array.isArray(o) ? { x: o[0] * (s - 1), y: o[1] * (n - 1) } : typeof o == "number" ? r(Math.max(0, Math.min(i - 1, o))) : o === "end" ? r(i - 1) : o === "center" || o === "edges" ? { x: (s - 1) / 2, y: (n - 1) / 2 } : { x: 0, y: 0 }, c = (m) => {
|
|
2081
2095
|
const { x: p, y: g } = r(m), y = Math.abs(p - a.x), b = Math.abs(g - a.y);
|
|
@@ -2087,13 +2101,13 @@ function dn(i, t, e = {}) {
|
|
|
2087
2101
|
const m = e.random ?? Math.random;
|
|
2088
2102
|
l = l.map(() => m() * h);
|
|
2089
2103
|
}
|
|
2090
|
-
const f = t.amount !== void 0 ? t.amount : (t.each ?? 0) * h, u = t.ease ?
|
|
2104
|
+
const f = t.amount !== void 0 ? t.amount : (t.each ?? 0) * h, u = t.ease ? It(t.ease) : void 0, d = u ? u.fn ?? W(u.easing) : void 0;
|
|
2091
2105
|
return l.map((m) => {
|
|
2092
2106
|
const p = h === 0 ? 0 : m / h;
|
|
2093
2107
|
return (d ? d(p) : p) * f;
|
|
2094
2108
|
});
|
|
2095
2109
|
}
|
|
2096
|
-
const
|
|
2110
|
+
const ge = /* @__PURE__ */ new Set([
|
|
2097
2111
|
"duration",
|
|
2098
2112
|
"delay",
|
|
2099
2113
|
"ease",
|
|
@@ -2117,24 +2131,24 @@ const pe = /* @__PURE__ */ new Set([
|
|
|
2117
2131
|
"scrollTrigger",
|
|
2118
2132
|
"spring"
|
|
2119
2133
|
]);
|
|
2120
|
-
function
|
|
2134
|
+
function Pt(i) {
|
|
2121
2135
|
const t = {}, e = {};
|
|
2122
2136
|
for (const [s, n] of Object.entries(i))
|
|
2123
|
-
|
|
2137
|
+
ge.has(s) ? t[s] = n : e[s] = n;
|
|
2124
2138
|
return { config: t, properties: e };
|
|
2125
2139
|
}
|
|
2126
|
-
function
|
|
2140
|
+
function $t(i, t) {
|
|
2127
2141
|
return i === void 0 ? t : i * 1e3;
|
|
2128
2142
|
}
|
|
2129
|
-
function
|
|
2143
|
+
function ce(i, t) {
|
|
2130
2144
|
if (i !== void 0)
|
|
2131
|
-
return typeof i == "number" ? { each: i * 1e3 } :
|
|
2145
|
+
return typeof i == "number" ? { each: i * 1e3 } : mn(i) ? { offsets: gn(t?.count ?? 0, i, t ?? {}).map((s) => s * 1e3) } : {
|
|
2132
2146
|
...i.each !== void 0 && { each: i.each * 1e3 },
|
|
2133
2147
|
...i.amount !== void 0 && { amount: i.amount * 1e3 },
|
|
2134
2148
|
...i.from !== void 0 && { from: i.from }
|
|
2135
2149
|
};
|
|
2136
2150
|
}
|
|
2137
|
-
const
|
|
2151
|
+
const yn = {
|
|
2138
2152
|
opacity: 1,
|
|
2139
2153
|
x: 0,
|
|
2140
2154
|
y: 0,
|
|
@@ -2160,17 +2174,17 @@ const pn = {
|
|
|
2160
2174
|
clipBottom: 0,
|
|
2161
2175
|
clipLeft: 0
|
|
2162
2176
|
};
|
|
2163
|
-
function
|
|
2164
|
-
return
|
|
2177
|
+
function Ri(i) {
|
|
2178
|
+
return yn[i];
|
|
2165
2179
|
}
|
|
2166
|
-
function
|
|
2180
|
+
function bn(i) {
|
|
2167
2181
|
const t = typeof i == "string" || Array.isArray(i) ? { path: i } : i;
|
|
2168
2182
|
if (!t || typeof t.path != "string" && !Array.isArray(t.path))
|
|
2169
2183
|
throw new Error("gsap-compat: motionPath needs a path — SVG path data or an array of { x, y } points.");
|
|
2170
2184
|
let e;
|
|
2171
2185
|
if (Array.isArray(t.path))
|
|
2172
|
-
e =
|
|
2173
|
-
else if (
|
|
2186
|
+
e = cn(t.path, { curviness: t.curviness });
|
|
2187
|
+
else if (vt(t.path))
|
|
2174
2188
|
e = t.path;
|
|
2175
2189
|
else
|
|
2176
2190
|
throw new Error(
|
|
@@ -2179,61 +2193,61 @@ function mn(i) {
|
|
|
2179
2193
|
const s = { pathData: e };
|
|
2180
2194
|
return t.autoRotate !== void 0 && t.autoRotate !== !1 && (s.autoRotate = !0, typeof t.autoRotate == "number" && (s.rotateOffset = t.autoRotate)), t.matrix && (s.matrix = t.matrix), { config: s, start: t.start ?? 0, end: t.end ?? 1 };
|
|
2181
2195
|
}
|
|
2182
|
-
function
|
|
2196
|
+
function vn(i) {
|
|
2183
2197
|
const t = typeof i == "string" || Array.isArray(i) ? { path: i } : { ...i };
|
|
2184
2198
|
return { ...t, start: t.end ?? 1, end: t.start ?? 0 };
|
|
2185
2199
|
}
|
|
2186
|
-
function
|
|
2200
|
+
function Ii(i) {
|
|
2187
2201
|
return typeof i == "object" && i !== null && "shape" in i ? i.shape : i;
|
|
2188
2202
|
}
|
|
2189
|
-
function
|
|
2203
|
+
function wn(i) {
|
|
2190
2204
|
if (i.morphSVG === void 0) return i;
|
|
2191
|
-
const { morphSVG: t, ...e } = i, s =
|
|
2192
|
-
if (typeof s != "string" || !
|
|
2205
|
+
const { morphSVG: t, ...e } = i, s = Ii(t);
|
|
2206
|
+
if (typeof s != "string" || !vt(s))
|
|
2193
2207
|
throw new Error(
|
|
2194
2208
|
`gsap-compat: morphSVG "${String(s)}" is not path data. Selectors and elements are resolved by live.to(); timeline() and tf need the path data itself.`
|
|
2195
2209
|
);
|
|
2196
2210
|
return { ...e, d: s };
|
|
2197
2211
|
}
|
|
2198
|
-
function
|
|
2212
|
+
function Tn(i, t) {
|
|
2199
2213
|
if (i === !0) return [0, t];
|
|
2200
2214
|
if (i === !1) return [0, 0];
|
|
2201
|
-
if (typeof i == "number") return [0,
|
|
2215
|
+
if (typeof i == "number") return [0, Be(i, t)];
|
|
2202
2216
|
const e = i.trim().split(/[\s,]+/).filter(Boolean), s = (o) => {
|
|
2203
2217
|
const a = Number.parseFloat(o);
|
|
2204
2218
|
if (Number.isNaN(a)) throw new Error(`gsap-compat: drawSVG "${i}" is not a length or percentage`);
|
|
2205
|
-
return
|
|
2219
|
+
return Be(o.endsWith("%") ? t * a / 100 : a, t);
|
|
2206
2220
|
};
|
|
2207
2221
|
if (e.length === 0) return [0, t];
|
|
2208
2222
|
if (e.length === 1) return [0, s(e[0])];
|
|
2209
2223
|
const n = s(e[0]), r = s(e[1]);
|
|
2210
2224
|
return n <= r ? [n, r] : [r, n];
|
|
2211
2225
|
}
|
|
2212
|
-
function
|
|
2213
|
-
const [e, s] =
|
|
2226
|
+
function xn(i, t) {
|
|
2227
|
+
const [e, s] = Tn(i, t);
|
|
2214
2228
|
return { strokeDasharray: [s - e, t], strokeDashoffset: -e };
|
|
2215
2229
|
}
|
|
2216
|
-
function
|
|
2230
|
+
function kn(i, t) {
|
|
2217
2231
|
if (i.drawSVG === void 0) return i;
|
|
2218
2232
|
const { drawSVG: e, ...s } = i;
|
|
2219
|
-
return { ...s, ...
|
|
2233
|
+
return { ...s, ...xn(e, t) };
|
|
2220
2234
|
}
|
|
2221
|
-
function
|
|
2235
|
+
function Sn(i) {
|
|
2222
2236
|
if (i.drawSVG !== void 0)
|
|
2223
2237
|
throw new Error(
|
|
2224
2238
|
"gsap-compat: drawSVG needs the stroke length from the page. Use live.to(), or animate strokeDasharray / strokeDashoffset directly (see drawSvgProperties)."
|
|
2225
2239
|
);
|
|
2226
2240
|
return i;
|
|
2227
2241
|
}
|
|
2228
|
-
function
|
|
2242
|
+
function Be(i, t) {
|
|
2229
2243
|
return Math.max(0, Math.min(t, i));
|
|
2230
2244
|
}
|
|
2231
|
-
function
|
|
2245
|
+
function Mn(i) {
|
|
2232
2246
|
let t = 2166136261;
|
|
2233
2247
|
for (let e = 0; e < i.length; e++) t = Math.imul(t ^ i.charCodeAt(e), 16777619);
|
|
2234
2248
|
return t >>> 0;
|
|
2235
2249
|
}
|
|
2236
|
-
function
|
|
2250
|
+
function An(i, t, e) {
|
|
2237
2251
|
if (i.scrambleText !== void 0) {
|
|
2238
2252
|
const s = i.scrambleText, n = typeof s == "string" ? { text: s } : s;
|
|
2239
2253
|
if (typeof n?.text != "string")
|
|
@@ -2247,7 +2261,7 @@ function Sn(i, t, e) {
|
|
|
2247
2261
|
...r !== void 0 && { revealDelay: Math.min(r, 0.999) },
|
|
2248
2262
|
...n.tweenLength !== void 0 && { tweenLength: n.tweenLength },
|
|
2249
2263
|
...n.rightToLeft !== void 0 && { rightToLeft: n.rightToLeft },
|
|
2250
|
-
seed: n.seed ??
|
|
2264
|
+
seed: n.seed ?? Mn(`${t}|${n.text}`)
|
|
2251
2265
|
};
|
|
2252
2266
|
}
|
|
2253
2267
|
if (i.text !== void 0) {
|
|
@@ -2261,47 +2275,47 @@ function Sn(i, t, e) {
|
|
|
2261
2275
|
};
|
|
2262
2276
|
}
|
|
2263
2277
|
}
|
|
2264
|
-
function
|
|
2278
|
+
function ye(i) {
|
|
2265
2279
|
return Math.max(0.1, i / 25);
|
|
2266
2280
|
}
|
|
2267
|
-
function
|
|
2281
|
+
function Pn(i, t) {
|
|
2268
2282
|
const e = typeof t == "number" ? { velocity: t } : t;
|
|
2269
2283
|
if (typeof e?.velocity != "number" || !Number.isFinite(e.velocity))
|
|
2270
2284
|
throw new Error("gsap-compat: inertia needs a velocity for each property — a number, or { velocity }.");
|
|
2271
|
-
const s = e.friction ?? (e.resistance !== void 0 ?
|
|
2285
|
+
const s = e.friction ?? (e.resistance !== void 0 ? ye(e.resistance) : void 0), n = {
|
|
2272
2286
|
from: i,
|
|
2273
2287
|
velocity: e.velocity,
|
|
2274
2288
|
...s !== void 0 && { friction: s },
|
|
2275
2289
|
...e.min !== void 0 && { min: e.min },
|
|
2276
2290
|
...e.max !== void 0 && { max: e.max }
|
|
2277
2291
|
};
|
|
2278
|
-
return typeof e.end == "function" ? n.end = [e.end(
|
|
2292
|
+
return typeof e.end == "function" ? n.end = [e.end(Ct(n))] : e.end !== void 0 && (n.end = Array.isArray(e.end) ? [...e.end] : e.end), n;
|
|
2279
2293
|
}
|
|
2280
|
-
function
|
|
2294
|
+
function En(i) {
|
|
2281
2295
|
const t = i === !0 ? {} : typeof i == "string" ? { preset: i } : i;
|
|
2282
|
-
if (t.preset !== void 0 && !(t.preset in
|
|
2296
|
+
if (t.preset !== void 0 && !(t.preset in Yt))
|
|
2283
2297
|
throw new Error(
|
|
2284
|
-
`gsap-compat: unknown spring preset "${t.preset}" — use one of ${Object.keys(
|
|
2298
|
+
`gsap-compat: unknown spring preset "${t.preset}" — use one of ${Object.keys(Yt).join(", ")}`
|
|
2285
2299
|
);
|
|
2286
2300
|
return {
|
|
2287
|
-
...t.preset ?
|
|
2301
|
+
...t.preset ? Yt[t.preset] : {},
|
|
2288
2302
|
...t.stiffness !== void 0 && { stiffness: t.stiffness },
|
|
2289
2303
|
...t.damping !== void 0 && { damping: t.damping },
|
|
2290
2304
|
...t.mass !== void 0 && { mass: t.mass },
|
|
2291
2305
|
...t.restDelta !== void 0 && { restDelta: t.restDelta }
|
|
2292
2306
|
};
|
|
2293
2307
|
}
|
|
2294
|
-
function
|
|
2308
|
+
function _n(i, t) {
|
|
2295
2309
|
if (i === !0 || typeof i == "string") return;
|
|
2296
2310
|
const e = i.velocity;
|
|
2297
2311
|
return typeof e == "number" ? e : e?.[t];
|
|
2298
2312
|
}
|
|
2299
|
-
class
|
|
2313
|
+
class st {
|
|
2300
2314
|
/** The engine timeline. Use it for anything the facade does not cover. */
|
|
2301
2315
|
timeline;
|
|
2302
2316
|
options;
|
|
2303
2317
|
cursor = 0;
|
|
2304
|
-
fallbackRandom =
|
|
2318
|
+
fallbackRandom = ae(1);
|
|
2305
2319
|
previousStart = 0;
|
|
2306
2320
|
previousEnd = 0;
|
|
2307
2321
|
labels = /* @__PURE__ */ new Map();
|
|
@@ -2309,7 +2323,7 @@ class et {
|
|
|
2309
2323
|
/** Last authored value per "target|property", for the resolution chain. */
|
|
2310
2324
|
lastValues = /* @__PURE__ */ new Map();
|
|
2311
2325
|
constructor(t = {}) {
|
|
2312
|
-
this.options = t, this.timeline = new
|
|
2326
|
+
this.options = t, this.timeline = new Ti({
|
|
2313
2327
|
// A timestamped default would make the same script compile to different
|
|
2314
2328
|
// JSON on every run, which breaks the determinism contract. Callers that
|
|
2315
2329
|
// need distinct ids pass one.
|
|
@@ -2326,25 +2340,25 @@ class et {
|
|
|
2326
2340
|
// --- tween creation -----------------------------------------------------
|
|
2327
2341
|
/** Animate to the given values. */
|
|
2328
2342
|
to(t, e, s) {
|
|
2329
|
-
return this.build(t, void 0,
|
|
2343
|
+
return this.build(t, void 0, ut(e), s);
|
|
2330
2344
|
}
|
|
2331
2345
|
/** Animate from the given values to where the property already is. */
|
|
2332
2346
|
from(t, e, s) {
|
|
2333
|
-
const { config: n, properties: r } =
|
|
2347
|
+
const { config: n, properties: r } = Pt(ut(e)), { motionPath: o, text: a, scrambleText: c, ...l } = r, h = this.targetsOf(t)[0], f = { ...n };
|
|
2334
2348
|
for (const m of Object.keys(l))
|
|
2335
2349
|
f[m] = this.resolveStart(h, m);
|
|
2336
|
-
o !== void 0 && (f.motionPath =
|
|
2350
|
+
o !== void 0 && (f.motionPath = vn(o));
|
|
2337
2351
|
const u = {}, d = String(this.resolveStart(h, "text"));
|
|
2338
|
-
return a !== void 0 && (u.text =
|
|
2352
|
+
return a !== void 0 && (u.text = Kt(a), f.text = typeof a == "object" ? { ...a, value: d } : d), c !== void 0 && (u.text = Kt(c), f.scrambleText = typeof c == "object" ? { ...c, text: d } : d), this.build(t, { ...l, ...u }, f, s);
|
|
2339
2353
|
}
|
|
2340
2354
|
/** Animate between two explicit sets of values. */
|
|
2341
2355
|
fromTo(t, e, s, n) {
|
|
2342
|
-
const { properties: r } =
|
|
2343
|
-
return this.build(t, r,
|
|
2356
|
+
const { properties: r } = Pt(ut(e));
|
|
2357
|
+
return this.build(t, r, ut(s), n);
|
|
2344
2358
|
}
|
|
2345
2359
|
/** Set values instantly — a single held keyframe. */
|
|
2346
2360
|
set(t, e, s) {
|
|
2347
|
-
return this.build(t, void 0, { ...
|
|
2361
|
+
return this.build(t, void 0, { ...ut(e), duration: 0 }, s);
|
|
2348
2362
|
}
|
|
2349
2363
|
// --- sequencing ---------------------------------------------------------
|
|
2350
2364
|
/** Start of the tween (after its delay) or call added last, in milliseconds. */
|
|
@@ -2360,16 +2374,16 @@ class et {
|
|
|
2360
2374
|
* no duration would be: `'<'` and `'>'` after it refer to it. Returns its time in ms.
|
|
2361
2375
|
*/
|
|
2362
2376
|
addEvent(t) {
|
|
2363
|
-
const e = Math.max(0,
|
|
2377
|
+
const e = Math.max(0, ht(t, this.context()));
|
|
2364
2378
|
return this.previousStart = e, this.previousEnd = e, this.cursor = Math.max(this.cursor, e), e;
|
|
2365
2379
|
}
|
|
2366
2380
|
/** Resolve a position (seconds, label, relative) to milliseconds without adding anything. */
|
|
2367
2381
|
timeOf(t) {
|
|
2368
|
-
return
|
|
2382
|
+
return ht(t, this.context());
|
|
2369
2383
|
}
|
|
2370
2384
|
/** Name a point in time, for use as a position parameter. */
|
|
2371
2385
|
addLabel(t, e) {
|
|
2372
|
-
return this.labels.set(t,
|
|
2386
|
+
return this.labels.set(t, ht(e, this.context())), this;
|
|
2373
2387
|
}
|
|
2374
2388
|
/** Time of a label, in milliseconds. */
|
|
2375
2389
|
/** Every label's time in milliseconds, in time order. */
|
|
@@ -2387,10 +2401,10 @@ class et {
|
|
|
2387
2401
|
* one flat, serializable track list.
|
|
2388
2402
|
*/
|
|
2389
2403
|
add(t, e) {
|
|
2390
|
-
const s =
|
|
2404
|
+
const s = ht(e, this.context());
|
|
2391
2405
|
for (const r of t.timeline.tracks) {
|
|
2392
2406
|
if (!("keyframes" in r)) continue;
|
|
2393
|
-
const o =
|
|
2407
|
+
const o = oe({
|
|
2394
2408
|
...r,
|
|
2395
2409
|
id: this.nextTrackId(`nested-${r.id}`),
|
|
2396
2410
|
keyframes: r.keyframes.map((a) => ({ ...a, time: a.time + s }))
|
|
@@ -2460,107 +2474,107 @@ class et {
|
|
|
2460
2474
|
* each property's start comes from the resolution chain.
|
|
2461
2475
|
*/
|
|
2462
2476
|
build(t, e, s, n) {
|
|
2463
|
-
const { config: r, properties: o } =
|
|
2477
|
+
const { config: r, properties: o } = Pt(s), { motionPath: a, text: c, scrambleText: l, inertia: h, ...f } = o, u = this.targetsOf(t), d = ht(n, this.context()), m = $t(r.delay, 0), p = $t(r.duration, 500), g = ce(r.stagger, {
|
|
2464
2478
|
count: u.length,
|
|
2465
2479
|
columnsFromLayout: this.options.layoutColumns ? () => this.options.layoutColumns(u) : void 0,
|
|
2466
2480
|
random: this.options.random ?? this.fallbackRandom
|
|
2467
|
-
}), y = this.easingFor(r.ease), b = [],
|
|
2468
|
-
let
|
|
2469
|
-
for (const [
|
|
2470
|
-
const
|
|
2471
|
-
let
|
|
2472
|
-
if (typeof
|
|
2473
|
-
`no usable start value for "${
|
|
2474
|
-
),
|
|
2475
|
-
const
|
|
2476
|
-
...
|
|
2477
|
-
from:
|
|
2478
|
-
to:
|
|
2479
|
-
velocity:
|
|
2480
|
-
},
|
|
2481
|
-
id:
|
|
2481
|
+
}), y = this.easingFor(r.ease), b = [], v = r.spring;
|
|
2482
|
+
let T = 0, w = !1;
|
|
2483
|
+
for (const [M, E] of Object.entries(f)) {
|
|
2484
|
+
const k = E;
|
|
2485
|
+
let P = e?.[M] !== void 0 ? e[M] : this.resolveStart(u[0], M);
|
|
2486
|
+
if (typeof P != typeof k && (this.warn(
|
|
2487
|
+
`no usable start value for "${M}" on "${u[0]}" — it will snap to ${String(k)}. Use fromTo() to animate it.`
|
|
2488
|
+
), P = k), v !== void 0 && typeof P == "number" && typeof k == "number") {
|
|
2489
|
+
const R = {
|
|
2490
|
+
...En(v),
|
|
2491
|
+
from: P,
|
|
2492
|
+
to: k,
|
|
2493
|
+
velocity: _n(v, M) ?? this.options.startVelocity?.(u[0], M) ?? 0
|
|
2494
|
+
}, j = this.nextTrackId(`${u[0]}-${M}-spring`), H = {
|
|
2495
|
+
id: j,
|
|
2482
2496
|
target: u[0],
|
|
2483
2497
|
...u.length > 1 && { targets: u },
|
|
2484
2498
|
...g && u.length > 1 && { stagger: g },
|
|
2485
|
-
property:
|
|
2499
|
+
property: M,
|
|
2486
2500
|
kind: "spring",
|
|
2487
|
-
spring:
|
|
2501
|
+
spring: R,
|
|
2488
2502
|
delay: d + m
|
|
2489
2503
|
};
|
|
2490
|
-
this.timeline.addTrack(
|
|
2491
|
-
for (const
|
|
2504
|
+
this.timeline.addTrack(H), b.push(j), T = Math.max(T, Ki(R));
|
|
2505
|
+
for (const I of u) this.lastValues.set(`${I}|${M}`, k);
|
|
2492
2506
|
continue;
|
|
2493
2507
|
}
|
|
2494
|
-
|
|
2495
|
-
const
|
|
2508
|
+
w = !0;
|
|
2509
|
+
const C = this.keyframesFor(P, k, p, y, r.ease), $ = this.nextTrackId(`${u[0]}-${M}`);
|
|
2496
2510
|
this.timeline.addTrack(
|
|
2497
|
-
|
|
2498
|
-
id:
|
|
2511
|
+
oe({
|
|
2512
|
+
id: $,
|
|
2499
2513
|
target: u[0],
|
|
2500
2514
|
...u.length > 1 && { targets: u },
|
|
2501
2515
|
...g && u.length > 1 && { stagger: g },
|
|
2502
|
-
property:
|
|
2516
|
+
property: M,
|
|
2503
2517
|
delay: d + m,
|
|
2504
|
-
keyframes:
|
|
2518
|
+
keyframes: C
|
|
2505
2519
|
})
|
|
2506
|
-
), b.push(
|
|
2507
|
-
for (const
|
|
2520
|
+
), b.push($);
|
|
2521
|
+
for (const R of u) this.lastValues.set(`${R}|${M}`, k);
|
|
2508
2522
|
}
|
|
2509
|
-
const
|
|
2510
|
-
if (
|
|
2511
|
-
const
|
|
2512
|
-
id:
|
|
2523
|
+
const x = An({ text: c, scrambleText: l }, u[0], p);
|
|
2524
|
+
if (x) {
|
|
2525
|
+
const M = e?.text ?? e?.scrambleText, E = M !== void 0 ? Kt(M) : this.resolveStart(u[0], "text"), k = this.nextTrackId(`${u[0]}-text`), P = {
|
|
2526
|
+
id: k,
|
|
2513
2527
|
target: u[0],
|
|
2514
2528
|
...u.length > 1 && { targets: u },
|
|
2515
2529
|
...g && u.length > 1 && { stagger: g },
|
|
2516
2530
|
property: "text",
|
|
2517
|
-
textConfig: { from: typeof
|
|
2531
|
+
textConfig: { from: typeof E == "string" ? E : String(E ?? ""), ...x },
|
|
2518
2532
|
delay: d + m,
|
|
2519
2533
|
keyframes: this.keyframesFor(0, 1, p, y, r.ease)
|
|
2520
2534
|
};
|
|
2521
|
-
this.timeline.addTrack(
|
|
2522
|
-
for (const
|
|
2535
|
+
this.timeline.addTrack(P), b.push(k);
|
|
2536
|
+
for (const C of u) this.lastValues.set(`${C}|text`, x.to);
|
|
2523
2537
|
}
|
|
2524
2538
|
if (a !== void 0) {
|
|
2525
|
-
const { config:
|
|
2526
|
-
id:
|
|
2539
|
+
const { config: M, start: E, end: k } = bn(a), P = this.nextTrackId(`${u[0]}-motionPath`), C = {
|
|
2540
|
+
id: P,
|
|
2527
2541
|
target: u[0],
|
|
2528
2542
|
...u.length > 1 && { targets: u },
|
|
2529
2543
|
...g && u.length > 1 && { stagger: g },
|
|
2530
2544
|
property: "motionPath",
|
|
2531
|
-
motionPathConfig:
|
|
2545
|
+
motionPathConfig: M,
|
|
2532
2546
|
delay: d + m,
|
|
2533
|
-
keyframes: this.keyframesFor(
|
|
2547
|
+
keyframes: this.keyframesFor(E, k, p, y, r.ease)
|
|
2534
2548
|
};
|
|
2535
|
-
this.timeline.addTrack(
|
|
2549
|
+
this.timeline.addTrack(C), b.push(P);
|
|
2536
2550
|
}
|
|
2537
2551
|
if (h !== void 0)
|
|
2538
|
-
for (const [
|
|
2539
|
-
const
|
|
2540
|
-
if (typeof
|
|
2541
|
-
this.warn(`inertia on "${
|
|
2552
|
+
for (const [M, E] of Object.entries(h)) {
|
|
2553
|
+
const k = this.resolveStart(u[0], M);
|
|
2554
|
+
if (typeof k != "number") {
|
|
2555
|
+
this.warn(`inertia on "${M}" needs a numeric start value; skipped`);
|
|
2542
2556
|
continue;
|
|
2543
2557
|
}
|
|
2544
|
-
const
|
|
2545
|
-
id:
|
|
2558
|
+
const P = Pn(k, E), C = this.nextTrackId(`${u[0]}-${M}-inertia`), $ = {
|
|
2559
|
+
id: C,
|
|
2546
2560
|
target: u[0],
|
|
2547
2561
|
...u.length > 1 && { targets: u },
|
|
2548
2562
|
...g && u.length > 1 && { stagger: g },
|
|
2549
|
-
property:
|
|
2563
|
+
property: M,
|
|
2550
2564
|
kind: "inertia",
|
|
2551
|
-
inertia:
|
|
2565
|
+
inertia: P,
|
|
2552
2566
|
delay: d + m
|
|
2553
2567
|
};
|
|
2554
|
-
this.timeline.addTrack(
|
|
2555
|
-
for (const
|
|
2568
|
+
this.timeline.addTrack($), b.push(C), T = Math.max(T, bt(P));
|
|
2569
|
+
for (const R of u) this.lastValues.set(`${R}|${M}`, yt(P));
|
|
2556
2570
|
}
|
|
2557
|
-
const
|
|
2558
|
-
return this.previousStart = d + m, this.previousEnd =
|
|
2571
|
+
const L = ((h !== void 0 || v !== void 0) && !w && !x && a === void 0 ? T : Math.max(p, T)) + (g && u.length > 1 ? Dt(u.length, g) : 0), A = d + m + L;
|
|
2572
|
+
return this.previousStart = d + m, this.previousEnd = A, this.cursor = Math.max(this.cursor, A), {
|
|
2559
2573
|
trackIds: b,
|
|
2560
2574
|
start: d + m,
|
|
2561
|
-
end:
|
|
2575
|
+
end: A,
|
|
2562
2576
|
kill: () => {
|
|
2563
|
-
for (const
|
|
2577
|
+
for (const M of b) this.timeline.removeTrack(M);
|
|
2564
2578
|
}
|
|
2565
2579
|
};
|
|
2566
2580
|
}
|
|
@@ -2571,10 +2585,10 @@ class et {
|
|
|
2571
2585
|
const o = { time: 0, value: t };
|
|
2572
2586
|
if (s <= 0)
|
|
2573
2587
|
return [{ time: 0, value: e }];
|
|
2574
|
-
const a = typeof r == "string" ?
|
|
2575
|
-
if (a?.requiresBaking === "custom" || this.options.bakeEases &&
|
|
2588
|
+
const a = typeof r == "string" ? It(r) : void 0;
|
|
2589
|
+
if (a?.requiresBaking === "custom" || this.options.bakeEases && Et(n)) {
|
|
2576
2590
|
const l = a?.fn ?? W(n);
|
|
2577
|
-
return [o, ...
|
|
2591
|
+
return [o, ...vi(o, { time: s, value: e }, l, { intervalMs: this.options.bakeIntervalMs })];
|
|
2578
2592
|
}
|
|
2579
2593
|
return [o, { time: s, value: e, ...n && { easing: n } }];
|
|
2580
2594
|
}
|
|
@@ -2591,14 +2605,14 @@ class et {
|
|
|
2591
2605
|
throw new Error(
|
|
2592
2606
|
`gsap-compat: no starting shape for "${t}". Use fromTo({ d: … }, { morphSVG: … }), or live.to(), which reads the element's current shape.`
|
|
2593
2607
|
);
|
|
2594
|
-
const o =
|
|
2608
|
+
const o = Ri(e);
|
|
2595
2609
|
return o !== void 0 ? (this.warn(
|
|
2596
2610
|
`no start value for "${e}" on "${t}" — using the static default ${o}. GSAP would read the live DOM here; tinyfly cannot, so pass an explicit fromTo() or a defaults map.`
|
|
2597
2611
|
), o) : (this.warn(`no start value or default for "${e}" on "${t}" — using 0`), 0);
|
|
2598
2612
|
}
|
|
2599
2613
|
easingFor(t) {
|
|
2600
2614
|
if (t !== void 0) {
|
|
2601
|
-
if (typeof t == "string") return
|
|
2615
|
+
if (typeof t == "string") return It(t).easing;
|
|
2602
2616
|
if (typeof t == "function")
|
|
2603
2617
|
throw new Error(
|
|
2604
2618
|
'gsap-compat: function eases cannot be serialized. Use a named ease, or a cubic-bezier via { type: "cubic-bezier", points: [...] }.'
|
|
@@ -2626,7 +2640,7 @@ class et {
|
|
|
2626
2640
|
this.options.onWarning?.(`gsap-compat: ${t}`);
|
|
2627
2641
|
}
|
|
2628
2642
|
}
|
|
2629
|
-
function
|
|
2643
|
+
function Kt(i) {
|
|
2630
2644
|
if (typeof i == "string") return i;
|
|
2631
2645
|
if (i && typeof i == "object") {
|
|
2632
2646
|
const t = i;
|
|
@@ -2634,13 +2648,13 @@ function Ht(i) {
|
|
|
2634
2648
|
}
|
|
2635
2649
|
return String(i ?? "");
|
|
2636
2650
|
}
|
|
2637
|
-
function
|
|
2638
|
-
return new
|
|
2651
|
+
function Cn(i) {
|
|
2652
|
+
return new st(i);
|
|
2639
2653
|
}
|
|
2640
|
-
function
|
|
2641
|
-
return
|
|
2654
|
+
function ut(i) {
|
|
2655
|
+
return Sn(wn(i));
|
|
2642
2656
|
}
|
|
2643
|
-
const
|
|
2657
|
+
const Rn = /* @__PURE__ */ new Set([
|
|
2644
2658
|
"blur",
|
|
2645
2659
|
"brightness",
|
|
2646
2660
|
"glow",
|
|
@@ -2649,16 +2663,16 @@ const _n = /* @__PURE__ */ new Set([
|
|
|
2649
2663
|
"shadowY",
|
|
2650
2664
|
"shadowBlur",
|
|
2651
2665
|
"shadowColor"
|
|
2652
|
-
]),
|
|
2653
|
-
function
|
|
2666
|
+
]), In = "#ffffff", $n = "rgba(0, 0, 0, 0.5)";
|
|
2667
|
+
function Fn(i) {
|
|
2654
2668
|
const t = [];
|
|
2655
|
-
if (i.blur !== void 0 && t.push(`blur(${Math.max(0, i.blur)}px)`), i.brightness !== void 0 && t.push(`brightness(${Math.max(0, i.brightness)})`), i.glow !== void 0 && t.push(`drop-shadow(0 0 ${Math.max(0, i.glow)}px ${i.glowColor ??
|
|
2669
|
+
if (i.blur !== void 0 && t.push(`blur(${Math.max(0, i.blur)}px)`), i.brightness !== void 0 && t.push(`brightness(${Math.max(0, i.brightness)})`), i.glow !== void 0 && t.push(`drop-shadow(0 0 ${Math.max(0, i.glow)}px ${i.glowColor ?? In})`), i.shadowX !== void 0 || i.shadowY !== void 0 || i.shadowBlur !== void 0) {
|
|
2656
2670
|
const e = i.shadowX ?? 0, s = i.shadowY ?? 0, n = Math.max(0, i.shadowBlur ?? 0);
|
|
2657
|
-
t.push(`drop-shadow(${e}px ${s}px ${n}px ${i.shadowColor ??
|
|
2671
|
+
t.push(`drop-shadow(${e}px ${s}px ${n}px ${i.shadowColor ?? $n})`);
|
|
2658
2672
|
}
|
|
2659
2673
|
return t.length > 0 ? t.join(" ") : null;
|
|
2660
2674
|
}
|
|
2661
|
-
function
|
|
2675
|
+
function Ln(i, t) {
|
|
2662
2676
|
const e = i.childNodes.length === 1 ? i.firstChild : null;
|
|
2663
2677
|
if (e && e.nodeType === 3) {
|
|
2664
2678
|
const s = e;
|
|
@@ -2667,12 +2681,12 @@ function In(i, t) {
|
|
|
2667
2681
|
}
|
|
2668
2682
|
i.textContent !== t && (i.textContent = t);
|
|
2669
2683
|
}
|
|
2670
|
-
function
|
|
2684
|
+
function Dn(i) {
|
|
2671
2685
|
if (!("ownerSVGElement" in i)) return;
|
|
2672
2686
|
const t = i.style;
|
|
2673
2687
|
!t || t.transformBox || (t.transformBox = "fill-box", t.transformOrigin || (t.transformOrigin = "50% 50%"));
|
|
2674
2688
|
}
|
|
2675
|
-
const
|
|
2689
|
+
const Ne = /* @__PURE__ */ new Set([
|
|
2676
2690
|
"width",
|
|
2677
2691
|
"height",
|
|
2678
2692
|
"top",
|
|
@@ -2698,7 +2712,7 @@ const De = /* @__PURE__ */ new Set([
|
|
|
2698
2712
|
"gap",
|
|
2699
2713
|
"rowGap",
|
|
2700
2714
|
"columnGap"
|
|
2701
|
-
]),
|
|
2715
|
+
]), On = /* @__PURE__ */ new Set([
|
|
2702
2716
|
"x",
|
|
2703
2717
|
"y",
|
|
2704
2718
|
"z",
|
|
@@ -2716,14 +2730,14 @@ const De = /* @__PURE__ */ new Set([
|
|
|
2716
2730
|
"motionPathX",
|
|
2717
2731
|
"motionPathY",
|
|
2718
2732
|
"motionPathRotate"
|
|
2719
|
-
]),
|
|
2733
|
+
]), Bn = /* @__PURE__ */ new Set(["originX", "originY"]), Nn = /* @__PURE__ */ new Set(["clipTop", "clipRight", "clipBottom", "clipLeft"]), qn = {
|
|
2720
2734
|
fill: "backgroundColor",
|
|
2721
2735
|
stroke: "borderColor",
|
|
2722
2736
|
strokeWidth: "borderWidth",
|
|
2723
2737
|
color: "color",
|
|
2724
2738
|
backgroundColor: "backgroundColor",
|
|
2725
2739
|
borderColor: "borderColor"
|
|
2726
|
-
},
|
|
2740
|
+
}, qe = {
|
|
2727
2741
|
fill: "fill",
|
|
2728
2742
|
stroke: "stroke",
|
|
2729
2743
|
strokeWidth: "strokeWidth",
|
|
@@ -2731,8 +2745,8 @@ const De = /* @__PURE__ */ new Set([
|
|
|
2731
2745
|
strokeDashoffset: "strokeDashoffset",
|
|
2732
2746
|
fillOpacity: "fillOpacity",
|
|
2733
2747
|
strokeOpacity: "strokeOpacity"
|
|
2734
|
-
},
|
|
2735
|
-
class
|
|
2748
|
+
}, Xn = "http://www.w3.org/2000/svg";
|
|
2749
|
+
class K {
|
|
2736
2750
|
targets = /* @__PURE__ */ new Map();
|
|
2737
2751
|
/**
|
|
2738
2752
|
* Register an HTML element as an animation target.
|
|
@@ -2776,18 +2790,18 @@ class H {
|
|
|
2776
2790
|
const a = e.has("motionPathX"), c = e.has("motionPathY"), l = e.has("motionPathRotate");
|
|
2777
2791
|
for (const [u, d] of e)
|
|
2778
2792
|
if (!(u === "x" && a) && !(u === "y" && c) && !((u === "rotate" || u === "rotateZ") && l)) {
|
|
2779
|
-
if (
|
|
2793
|
+
if (On.has(u)) {
|
|
2780
2794
|
const m = this.buildTransformPart(u, d);
|
|
2781
2795
|
m && s.push(m);
|
|
2782
|
-
} else if (
|
|
2796
|
+
} else if (Bn.has(u))
|
|
2783
2797
|
typeof d == "number" && ((n ??= {})[u] = d);
|
|
2784
|
-
else if (
|
|
2798
|
+
else if (Nn.has(u))
|
|
2785
2799
|
typeof d == "number" && ((r ??= {})[u] = d);
|
|
2786
|
-
else if (
|
|
2800
|
+
else if (Rn.has(u))
|
|
2787
2801
|
(o ??= {})[u] = d;
|
|
2788
2802
|
else if (u !== "perspective") {
|
|
2789
2803
|
if (u !== "shine") if (u === "text" && typeof d == "string")
|
|
2790
|
-
|
|
2804
|
+
Ln(t, d);
|
|
2791
2805
|
else if (u === "d" && typeof d == "string") {
|
|
2792
2806
|
const m = t;
|
|
2793
2807
|
(m.tagName?.toLowerCase() === "path" ? m : m.querySelector?.("path"))?.setAttribute?.("d", d);
|
|
@@ -2798,7 +2812,7 @@ class H {
|
|
|
2798
2812
|
const h = e.get("shine");
|
|
2799
2813
|
typeof h == "number" && this.applyShine(t, h);
|
|
2800
2814
|
const f = e.get("perspective");
|
|
2801
|
-
if (typeof f == "number" && s.unshift(`perspective(${f}px)`), s.length > 0 && (t.style.transform = s.join(" "),
|
|
2815
|
+
if (typeof f == "number" && s.unshift(`perspective(${f}px)`), s.length > 0 && (t.style.transform = s.join(" "), Dn(t)), n) {
|
|
2802
2816
|
const u = n.originX ?? 50, d = n.originY ?? 50;
|
|
2803
2817
|
t.style.transformOrigin = `${u}% ${d}%`;
|
|
2804
2818
|
}
|
|
@@ -2807,7 +2821,7 @@ class H {
|
|
|
2807
2821
|
t.style.clipPath = `inset(${u}% ${d}% ${m}% ${p}%)`;
|
|
2808
2822
|
}
|
|
2809
2823
|
if (o) {
|
|
2810
|
-
const u =
|
|
2824
|
+
const u = Fn(o);
|
|
2811
2825
|
u && (t.style.filter = u);
|
|
2812
2826
|
}
|
|
2813
2827
|
}
|
|
@@ -2867,21 +2881,21 @@ class H {
|
|
|
2867
2881
|
*/
|
|
2868
2882
|
applyStyleProperty(t, e, s) {
|
|
2869
2883
|
let n;
|
|
2870
|
-
if (t.namespaceURI ===
|
|
2884
|
+
if (t.namespaceURI === Xn && e in qe) {
|
|
2871
2885
|
const a = Array.isArray(s) ? s.join(", ") : String(s);
|
|
2872
|
-
t.style[
|
|
2886
|
+
t.style[qe[e]] = a;
|
|
2873
2887
|
return;
|
|
2874
|
-
} else e === "fill" && t.dataset?.elementType === "text" ? n = "color" : n =
|
|
2888
|
+
} else e === "fill" && t.dataset?.elementType === "text" ? n = "color" : n = qn[e] ?? e;
|
|
2875
2889
|
let o;
|
|
2876
|
-
typeof s == "number" ?
|
|
2890
|
+
typeof s == "number" ? Ne.has(e) || Ne.has(n) ? o = `${s}px` : o = String(s) : Array.isArray(s) ? o = s.join(", ") : o = s, t.style[n] = o;
|
|
2877
2891
|
}
|
|
2878
2892
|
}
|
|
2879
|
-
const
|
|
2893
|
+
const Yn = {
|
|
2880
2894
|
request: (i) => requestAnimationFrame(i),
|
|
2881
2895
|
cancel: (i) => cancelAnimationFrame(i)
|
|
2882
2896
|
};
|
|
2883
|
-
class
|
|
2884
|
-
adapter = new
|
|
2897
|
+
class Vn {
|
|
2898
|
+
adapter = new K();
|
|
2885
2899
|
scheduler;
|
|
2886
2900
|
rootOption;
|
|
2887
2901
|
/** Element → engine target name. The engine only ever sees names. */
|
|
@@ -2903,7 +2917,7 @@ class Xn {
|
|
|
2903
2917
|
*/
|
|
2904
2918
|
liveTimelines = /* @__PURE__ */ new Set();
|
|
2905
2919
|
/** GSAP-style utilities, with this stage's seeded random sequence (`live.utils`). */
|
|
2906
|
-
utils =
|
|
2920
|
+
utils = un();
|
|
2907
2921
|
/** Playing timelines, in activation order. */
|
|
2908
2922
|
active = /* @__PURE__ */ new Map();
|
|
2909
2923
|
/** Last applied value per target name and property. */
|
|
@@ -2914,7 +2928,7 @@ class Xn {
|
|
|
2914
2928
|
lastTimestamp = null;
|
|
2915
2929
|
destroyed = !1;
|
|
2916
2930
|
constructor(t = {}) {
|
|
2917
|
-
this.scheduler = t.scheduler ??
|
|
2931
|
+
this.scheduler = t.scheduler ?? Yn, this.rootOption = t.root;
|
|
2918
2932
|
}
|
|
2919
2933
|
// --- targets ------------------------------------------------------------
|
|
2920
2934
|
/**
|
|
@@ -2935,7 +2949,7 @@ class Xn {
|
|
|
2935
2949
|
const e = [];
|
|
2936
2950
|
for (const s of this.targetsOf(t)) {
|
|
2937
2951
|
const n = this.nameFor(s);
|
|
2938
|
-
|
|
2952
|
+
Zt(s) && this.currentCollector?.touch(s, n), e.push(n);
|
|
2939
2953
|
}
|
|
2940
2954
|
return e;
|
|
2941
2955
|
}
|
|
@@ -3110,15 +3124,15 @@ class Xn {
|
|
|
3110
3124
|
targetsOf(t) {
|
|
3111
3125
|
if (typeof t == "string")
|
|
3112
3126
|
return Array.from(this.selectorRoot.querySelectorAll(t));
|
|
3113
|
-
if (
|
|
3114
|
-
if (!
|
|
3127
|
+
if (Zt(t)) return [t];
|
|
3128
|
+
if (!Wn(t)) return [t];
|
|
3115
3129
|
const e = [];
|
|
3116
3130
|
for (const s of Array.from(t))
|
|
3117
3131
|
e.push(...this.targetsOf(s));
|
|
3118
3132
|
return e;
|
|
3119
3133
|
}
|
|
3120
3134
|
nameFor(t) {
|
|
3121
|
-
return
|
|
3135
|
+
return Zt(t) ? this.elementName(t) : this.objectName(t);
|
|
3122
3136
|
}
|
|
3123
3137
|
objectName(t) {
|
|
3124
3138
|
const e = this.objectNames.get(t);
|
|
@@ -3140,15 +3154,15 @@ class Xn {
|
|
|
3140
3154
|
return this.names.set(t, s), this.elements.set(s, t), this.adapter.registerTarget(s, t), s;
|
|
3141
3155
|
}
|
|
3142
3156
|
}
|
|
3143
|
-
function
|
|
3157
|
+
function Zt(i) {
|
|
3144
3158
|
return typeof i == "object" && i !== null && i.nodeType === 1;
|
|
3145
3159
|
}
|
|
3146
|
-
function
|
|
3160
|
+
function Wn(i) {
|
|
3147
3161
|
if (Array.isArray(i)) return !0;
|
|
3148
3162
|
const t = i;
|
|
3149
3163
|
return typeof t.length == "number" && typeof t.item == "function";
|
|
3150
3164
|
}
|
|
3151
|
-
function
|
|
3165
|
+
function Ft(i) {
|
|
3152
3166
|
const t = i.style;
|
|
3153
3167
|
if (!t) return i.getBoundingClientRect();
|
|
3154
3168
|
const e = t.transform;
|
|
@@ -3156,30 +3170,30 @@ function $t(i) {
|
|
|
3156
3170
|
const s = i.getBoundingClientRect();
|
|
3157
3171
|
return t.transform = e, s;
|
|
3158
3172
|
}
|
|
3159
|
-
const
|
|
3160
|
-
function
|
|
3173
|
+
const Xe = (i) => typeof i == "object" && i !== null && i.nodeType === 1;
|
|
3174
|
+
function jn(i) {
|
|
3161
3175
|
const t = {};
|
|
3162
3176
|
for (const e of Array.from(i.attributes)) t[e.name] = e.value;
|
|
3163
3177
|
return t;
|
|
3164
3178
|
}
|
|
3165
|
-
function
|
|
3179
|
+
function Un(i) {
|
|
3166
3180
|
const t = i.getScreenCTM?.();
|
|
3167
3181
|
if (t) return [t.a, t.b, t.c, t.d, t.e, t.f];
|
|
3168
3182
|
const e = i.getBoundingClientRect();
|
|
3169
3183
|
return [1, 0, 0, 1, e.left, e.top];
|
|
3170
3184
|
}
|
|
3171
|
-
function
|
|
3172
|
-
const e = typeof i == "string" || Array.isArray(i) ||
|
|
3173
|
-
const S =
|
|
3174
|
-
return S || t.warn(`gsap-compat: motionPath could not find "${String(
|
|
3185
|
+
function zn(i, t) {
|
|
3186
|
+
const e = typeof i == "string" || Array.isArray(i) || Xe(i) ? { path: i } : i, { align: s, alignOrigin: n, path: r, ...o } = e, a = (x) => {
|
|
3187
|
+
const S = Xe(x) ? x : t.query(x);
|
|
3188
|
+
return S || t.warn(`gsap-compat: motionPath could not find "${String(x)}"`), S;
|
|
3175
3189
|
};
|
|
3176
3190
|
let c = null, l = "";
|
|
3177
|
-
if (Array.isArray(r) || typeof r == "string" &&
|
|
3191
|
+
if (Array.isArray(r) || typeof r == "string" && vt(r))
|
|
3178
3192
|
l = r;
|
|
3179
3193
|
else {
|
|
3180
3194
|
c = a(r);
|
|
3181
|
-
const
|
|
3182
|
-
c && !
|
|
3195
|
+
const x = c && pe({ tag: c.localName, attributes: jn(c) });
|
|
3196
|
+
c && !x && t.warn(`gsap-compat: motionPath element <${c.localName}> has no path geometry`), l = x ?? "";
|
|
3183
3197
|
}
|
|
3184
3198
|
const h = { ...o, path: l };
|
|
3185
3199
|
if (s === void 0 || s === !1) return h;
|
|
@@ -3188,47 +3202,47 @@ function Wn(i, t) {
|
|
|
3188
3202
|
return s === !0 && t.warn("gsap-compat: motionPath align: true needs the path to be an element"), h;
|
|
3189
3203
|
const u = t.targets[0];
|
|
3190
3204
|
if (!u) return h;
|
|
3191
|
-
const [d, m, p, g, y, b] =
|
|
3192
|
-
for (const
|
|
3193
|
-
const S =
|
|
3194
|
-
if (Math.abs(S.left -
|
|
3205
|
+
const [d, m, p, g, y, b] = Un(f), v = Ft(u), [T, w] = n ?? [0.5, 0.5];
|
|
3206
|
+
for (const x of t.targets.slice(1)) {
|
|
3207
|
+
const S = Ft(x);
|
|
3208
|
+
if (Math.abs(S.left - v.left) > 0.5 || Math.abs(S.top - v.top) > 0.5) {
|
|
3195
3209
|
t.warn("gsap-compat: motionPath align measures the first target; the others are laid out elsewhere");
|
|
3196
3210
|
break;
|
|
3197
3211
|
}
|
|
3198
3212
|
}
|
|
3199
|
-
return h.matrix = [d, m, p, g, y -
|
|
3213
|
+
return h.matrix = [d, m, p, g, y - v.left - T * v.width, b - v.top - w * v.height], h;
|
|
3200
3214
|
}
|
|
3201
|
-
const
|
|
3202
|
-
function
|
|
3215
|
+
const $i = (i) => typeof i == "object" && i !== null && i.nodeType === 1;
|
|
3216
|
+
function Fi(i) {
|
|
3203
3217
|
const t = {};
|
|
3204
3218
|
for (const e of Array.from(i.attributes)) t[e.name] = e.value;
|
|
3205
3219
|
return t;
|
|
3206
3220
|
}
|
|
3207
|
-
function
|
|
3221
|
+
function Li(i) {
|
|
3208
3222
|
if (!i) return null;
|
|
3209
|
-
const t =
|
|
3223
|
+
const t = pe({ tag: i.localName, attributes: Fi(i) });
|
|
3210
3224
|
return t || (i.querySelector("path")?.getAttribute("d") ?? null);
|
|
3211
3225
|
}
|
|
3212
|
-
function
|
|
3213
|
-
const s =
|
|
3214
|
-
if (typeof s == "string" &&
|
|
3215
|
-
const n =
|
|
3226
|
+
function Hn(i, t, e) {
|
|
3227
|
+
const s = Ii(i);
|
|
3228
|
+
if (typeof s == "string" && vt(s)) return s;
|
|
3229
|
+
const n = $i(s) ? s : typeof s == "string" ? t(s) : null, r = Li(n);
|
|
3216
3230
|
return r || (e(`gsap-compat: morphSVG could not find a shape for "${String(s)}"`), "");
|
|
3217
3231
|
}
|
|
3218
|
-
const
|
|
3219
|
-
function
|
|
3220
|
-
return (typeof i == "string" ? Array.from(t.querySelectorAll(i)) :
|
|
3232
|
+
const Gn = /* @__PURE__ */ new Set(["cx", "cy", "r", "rx", "ry", "x", "y", "width", "height", "x1", "y1", "x2", "y2", "points"]);
|
|
3233
|
+
function Kn(i, t = document) {
|
|
3234
|
+
return (typeof i == "string" ? Array.from(t.querySelectorAll(i)) : $i(i) ? [i] : Array.from(i)).map((s) => {
|
|
3221
3235
|
if (s.localName === "path") return s;
|
|
3222
|
-
const n =
|
|
3236
|
+
const n = pe({ tag: s.localName, attributes: Fi(s) });
|
|
3223
3237
|
if (!n || !s.parentNode) return s;
|
|
3224
3238
|
const r = s.ownerDocument.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3225
3239
|
for (const o of Array.from(s.attributes))
|
|
3226
|
-
|
|
3240
|
+
Gn.has(o.name) || r.setAttribute(o.name, o.value);
|
|
3227
3241
|
return r.setAttribute("d", n), s.parentNode.replaceChild(r, s), r;
|
|
3228
3242
|
});
|
|
3229
3243
|
}
|
|
3230
|
-
const
|
|
3231
|
-
class
|
|
3244
|
+
const Ye = 0.3;
|
|
3245
|
+
class Zn {
|
|
3232
3246
|
options;
|
|
3233
3247
|
target;
|
|
3234
3248
|
running = !1;
|
|
@@ -3262,7 +3276,7 @@ class Hn {
|
|
|
3262
3276
|
}
|
|
3263
3277
|
// --- gesture lifecycle --------------------------------------------------
|
|
3264
3278
|
begin(t, e, s) {
|
|
3265
|
-
this.dragging = !0, this.passedTolerance = !1, this.startX = t, this.startY = e, this.lastX = t, this.lastY = e, this.velocityX = 0, this.velocityY = 0, this.lastTime =
|
|
3279
|
+
this.dragging = !0, this.passedTolerance = !1, this.startX = t, this.startY = e, this.lastX = t, this.lastY = e, this.velocityX = 0, this.velocityY = 0, this.lastTime = Ve(), this.options.onPress?.(this.stateFrom(0, 0, s));
|
|
3266
3280
|
}
|
|
3267
3281
|
move(t, e, s) {
|
|
3268
3282
|
if (!this.dragging) return;
|
|
@@ -3279,10 +3293,10 @@ class Hn {
|
|
|
3279
3293
|
this.dragging && (this.dragging = !1, this.options.onRelease?.(this.stateFrom(0, 0, t)));
|
|
3280
3294
|
}
|
|
3281
3295
|
updateVelocity(t, e) {
|
|
3282
|
-
const s =
|
|
3296
|
+
const s = Ve(), n = Math.max(1, s - this.lastTime);
|
|
3283
3297
|
this.lastTime = s;
|
|
3284
3298
|
const r = t / n * 1e3, o = e / n * 1e3;
|
|
3285
|
-
this.velocityX += (r - this.velocityX) *
|
|
3299
|
+
this.velocityX += (r - this.velocityX) * Ye, this.velocityY += (o - this.velocityY) * Ye;
|
|
3286
3300
|
}
|
|
3287
3301
|
stateFrom(t, e, s) {
|
|
3288
3302
|
return {
|
|
@@ -3334,10 +3348,10 @@ class Hn {
|
|
|
3334
3348
|
});
|
|
3335
3349
|
};
|
|
3336
3350
|
}
|
|
3337
|
-
function
|
|
3351
|
+
function Ve() {
|
|
3338
3352
|
return typeof performance < "u" ? performance.now() : Date.now();
|
|
3339
3353
|
}
|
|
3340
|
-
function
|
|
3354
|
+
function Qn(i, t, e) {
|
|
3341
3355
|
let s = { delta: 0, line: null }, n = e;
|
|
3342
3356
|
for (const r of i)
|
|
3343
3357
|
for (const o of t) {
|
|
@@ -3346,10 +3360,10 @@ function Gn(i, t, e) {
|
|
|
3346
3360
|
}
|
|
3347
3361
|
return s;
|
|
3348
3362
|
}
|
|
3349
|
-
function
|
|
3363
|
+
function Jn(i, t) {
|
|
3350
3364
|
return t <= 0 ? [] : i.map((e) => Math.round(e / t) * t);
|
|
3351
3365
|
}
|
|
3352
|
-
class
|
|
3366
|
+
class Di {
|
|
3353
3367
|
options;
|
|
3354
3368
|
observer;
|
|
3355
3369
|
x;
|
|
@@ -3361,7 +3375,7 @@ class Ii {
|
|
|
3361
3375
|
snappedX = null;
|
|
3362
3376
|
snappedY = null;
|
|
3363
3377
|
constructor(t) {
|
|
3364
|
-
this.options = t, this.x = t.initialX ?? 0, this.y = t.initialY ?? 0, this.observer = new
|
|
3378
|
+
this.options = t, this.x = t.initialX ?? 0, this.y = t.initialY ?? 0, this.observer = new Zn({
|
|
3365
3379
|
target: t.target,
|
|
3366
3380
|
onPress: (e) => {
|
|
3367
3381
|
const s = t.getPosition?.();
|
|
@@ -3414,7 +3428,7 @@ class Ii {
|
|
|
3414
3428
|
if (e <= 0) return;
|
|
3415
3429
|
const s = this.options.scrubDistance ?? 500;
|
|
3416
3430
|
if (s === 0) return;
|
|
3417
|
-
const n = (this.options.axis ?? "both") === "y" ? this.y : this.x, r =
|
|
3431
|
+
const n = (this.options.axis ?? "both") === "y" ? this.y : this.x, r = tr(n / s);
|
|
3418
3432
|
t.pause(), t.seek(r * e);
|
|
3419
3433
|
}
|
|
3420
3434
|
/**
|
|
@@ -3427,9 +3441,9 @@ class Ii {
|
|
|
3427
3441
|
applyConstraints(t, e) {
|
|
3428
3442
|
let s = t;
|
|
3429
3443
|
const n = [
|
|
3430
|
-
...
|
|
3444
|
+
...Jn([s], this.options.snap ?? 0),
|
|
3431
3445
|
...(e === "x" ? this.options.snapLinesX : this.options.snapLinesY) ?? []
|
|
3432
|
-
], r =
|
|
3446
|
+
], r = Qn([s], n, this.snapThreshold());
|
|
3433
3447
|
s += r.delta, e === "x" ? this.snappedX = r.line : this.snappedY = r.line;
|
|
3434
3448
|
const o = this.options.bounds;
|
|
3435
3449
|
if (o) {
|
|
@@ -3439,16 +3453,16 @@ class Ii {
|
|
|
3439
3453
|
return s;
|
|
3440
3454
|
}
|
|
3441
3455
|
}
|
|
3442
|
-
function
|
|
3456
|
+
function tr(i) {
|
|
3443
3457
|
return i < 0 ? 0 : i > 1 ? 1 : i;
|
|
3444
3458
|
}
|
|
3445
|
-
function
|
|
3446
|
-
const t = new
|
|
3459
|
+
function Eo(i) {
|
|
3460
|
+
const t = new Di(i);
|
|
3447
3461
|
return t.start(), t;
|
|
3448
3462
|
}
|
|
3449
|
-
const
|
|
3450
|
-
function
|
|
3451
|
-
const e =
|
|
3463
|
+
const er = { x: "x", y: "y", "x,y": "both" }, le = (i) => typeof i == "object" && i !== null && i.nodeType === 1;
|
|
3464
|
+
function We(i, t) {
|
|
3465
|
+
const e = Ft(i), s = t.getBoundingClientRect();
|
|
3452
3466
|
return {
|
|
3453
3467
|
minX: s.left - e.left,
|
|
3454
3468
|
maxX: s.right - e.right,
|
|
@@ -3456,35 +3470,35 @@ function Ye(i, t) {
|
|
|
3456
3470
|
maxY: s.bottom - e.bottom
|
|
3457
3471
|
};
|
|
3458
3472
|
}
|
|
3459
|
-
function
|
|
3473
|
+
function je(i) {
|
|
3460
3474
|
return Array.isArray(i) ? [...i] : i;
|
|
3461
3475
|
}
|
|
3462
|
-
function
|
|
3476
|
+
function ir(i, t, e, s = {}) {
|
|
3463
3477
|
const [n] = t.resolveTargets(e), r = n ? t.elementFor(n) : void 0;
|
|
3464
3478
|
if (!n || !r)
|
|
3465
3479
|
throw new Error(`gsap-compat: live.draggable could not find ${String(e)}`);
|
|
3466
|
-
if (s.type === "rotation") return
|
|
3467
|
-
const o =
|
|
3480
|
+
if (s.type === "rotation") return sr(i, t, n, r, s);
|
|
3481
|
+
const o = er[s.type ?? "x,y"], a = () => {
|
|
3468
3482
|
const p = t.appliedValue(n, "x"), g = t.appliedValue(n, "y");
|
|
3469
3483
|
return { x: typeof p == "number" ? p : 0, y: typeof g == "number" ? g : 0 };
|
|
3470
|
-
}, c = typeof s.bounds == "string" ? t.query(s.bounds) :
|
|
3484
|
+
}, c = typeof s.bounds == "string" ? t.query(s.bounds) : le(s.bounds) ? s.bounds : null, h = { bounds: (!c && s.bounds && !le(s.bounds) ? s.bounds : void 0) ?? (c ? We(r, c) : void 0) };
|
|
3471
3485
|
let f = null;
|
|
3472
3486
|
const u = () => {
|
|
3473
3487
|
f?.kill(), f = null;
|
|
3474
3488
|
}, d = (p) => {
|
|
3475
|
-
const g = s.inertia === !0 ? {} : s.inertia, y = g.friction ?? (g.resistance !== void 0 ?
|
|
3476
|
-
let
|
|
3477
|
-
const
|
|
3478
|
-
if (Array.isArray(
|
|
3479
|
-
const _ =
|
|
3480
|
-
let
|
|
3481
|
-
for (const
|
|
3482
|
-
Math.hypot(
|
|
3483
|
-
|
|
3484
|
-
} else typeof
|
|
3489
|
+
const g = s.inertia === !0 ? {} : s.inertia, y = g.friction ?? (g.resistance !== void 0 ? ye(g.resistance) : 4), b = a(), v = h.bounds ?? {};
|
|
3490
|
+
let T, w;
|
|
3491
|
+
const x = g.end;
|
|
3492
|
+
if (Array.isArray(x)) {
|
|
3493
|
+
const _ = Ct({ from: b.x, velocity: o === "y" ? 0 : p.x, friction: y }), L = Ct({ from: b.y, velocity: o === "x" ? 0 : p.y, friction: y });
|
|
3494
|
+
let A = x[0];
|
|
3495
|
+
for (const M of x)
|
|
3496
|
+
Math.hypot(M.x - _, M.y - L) < Math.hypot(A.x - _, A.y - L) && (A = M);
|
|
3497
|
+
A && (T = [A.x], w = [A.y]);
|
|
3498
|
+
} else typeof x == "number" ? (T = x, w = x) : x && (T = je(x.x), w = je(x.y));
|
|
3485
3499
|
const S = {};
|
|
3486
|
-
o !== "y" && (S.x = { velocity: p.x, friction: y, min:
|
|
3487
|
-
}, m = new
|
|
3500
|
+
o !== "y" && (S.x = { velocity: p.x, friction: y, min: v.minX, max: v.maxX, end: T }), o !== "x" && (S.y = { velocity: p.y, friction: y, min: v.minY, max: v.maxY, end: w }), f = i.to(r, { inertia: S, onComplete: () => s.onThrowComplete?.() });
|
|
3501
|
+
}, m = new Di({
|
|
3488
3502
|
target: r,
|
|
3489
3503
|
axis: o,
|
|
3490
3504
|
snap: s.snap,
|
|
@@ -3493,7 +3507,7 @@ function Jn(i, t, e, s = {}) {
|
|
|
3493
3507
|
},
|
|
3494
3508
|
getPosition: a,
|
|
3495
3509
|
onPress: () => {
|
|
3496
|
-
u(), c && (h.bounds =
|
|
3510
|
+
u(), c && (h.bounds = We(r, c)), s.onPress?.();
|
|
3497
3511
|
},
|
|
3498
3512
|
onDrag: (p) => {
|
|
3499
3513
|
t.apply(n, o === "x" ? { x: p.x } : o === "y" ? { y: p.y } : { x: p.x, y: p.y }), s.onDrag?.(p);
|
|
@@ -3517,42 +3531,42 @@ function Jn(i, t, e, s = {}) {
|
|
|
3517
3531
|
}
|
|
3518
3532
|
};
|
|
3519
3533
|
}
|
|
3520
|
-
function
|
|
3521
|
-
const r = typeof n.bounds == "object" && n.bounds !== null && !
|
|
3522
|
-
const
|
|
3523
|
-
return typeof
|
|
3524
|
-
}, a = (
|
|
3534
|
+
function sr(i, t, e, s, n) {
|
|
3535
|
+
const r = typeof n.bounds == "object" && n.bounds !== null && !le(n.bounds) ? n.bounds : {}, o = () => {
|
|
3536
|
+
const v = t.appliedValue(e, "rotate");
|
|
3537
|
+
return typeof v == "number" ? v : 0;
|
|
3538
|
+
}, a = (v) => Math.min(r.maxRotation ?? 1 / 0, Math.max(r.minRotation ?? -1 / 0, v));
|
|
3525
3539
|
let c = null, l = !1, h, f = { x: 0, y: 0 }, u = 0, d = 0, m = [];
|
|
3526
|
-
const p = (
|
|
3540
|
+
const p = (v) => Math.atan2(v.clientY - f.y, v.clientX - f.x) * 180 / Math.PI, g = (v) => {
|
|
3527
3541
|
if (l) return;
|
|
3528
|
-
c?.kill(), c = null, l = !0, h =
|
|
3529
|
-
const
|
|
3530
|
-
f = { x:
|
|
3531
|
-
}, y = (
|
|
3532
|
-
if (!l ||
|
|
3533
|
-
const
|
|
3534
|
-
let
|
|
3535
|
-
|
|
3536
|
-
let
|
|
3537
|
-
n.snap && (
|
|
3542
|
+
c?.kill(), c = null, l = !0, h = v.pointerId, s.setPointerCapture?.(v.pointerId);
|
|
3543
|
+
const T = s.getBoundingClientRect();
|
|
3544
|
+
f = { x: T.left + T.width / 2, y: T.top + T.height / 2 }, u = p(v), d = o(), m = [{ time: performance.now(), rotation: d }], n.onPress?.();
|
|
3545
|
+
}, y = (v) => {
|
|
3546
|
+
if (!l || v.pointerId !== h) return;
|
|
3547
|
+
const T = p(v);
|
|
3548
|
+
let w = T - u;
|
|
3549
|
+
w > 180 && (w -= 360), w < -180 && (w += 360), u = T, d += w;
|
|
3550
|
+
let x = a(d);
|
|
3551
|
+
n.snap && (x = a(Math.round(x / n.snap) * n.snap)), t.apply(e, { rotate: x });
|
|
3538
3552
|
const S = performance.now();
|
|
3539
|
-
for (m.push({ time: S, rotation:
|
|
3553
|
+
for (m.push({ time: S, rotation: x }); m.length > 2 && S - m[0].time > 100; ) m.shift();
|
|
3540
3554
|
const _ = { x: 0, y: 0 };
|
|
3541
3555
|
n.onDrag?.(_);
|
|
3542
|
-
}, b = (
|
|
3543
|
-
if (!l ||
|
|
3556
|
+
}, b = (v) => {
|
|
3557
|
+
if (!l || v.pointerId !== h) return;
|
|
3544
3558
|
l = !1;
|
|
3545
|
-
const
|
|
3559
|
+
const T = m[0], w = m[m.length - 1], x = T && w ? (w.time - T.time) / 1e3 : 0, S = x > 0 ? (w.rotation - T.rotation) / x : 0;
|
|
3546
3560
|
if (n.onRelease?.({ x: S, y: 0 }), !n.inertia) return;
|
|
3547
|
-
const _ = n.inertia === !0 ? {} : n.inertia,
|
|
3561
|
+
const _ = n.inertia === !0 ? {} : n.inertia, L = _.friction ?? (_.resistance !== void 0 ? ye(_.resistance) : 4), A = typeof _.end == "number" || Array.isArray(_.end) ? _.end : void 0;
|
|
3548
3562
|
c = i.to(s, {
|
|
3549
3563
|
inertia: {
|
|
3550
3564
|
rotate: {
|
|
3551
3565
|
velocity: S,
|
|
3552
|
-
friction:
|
|
3566
|
+
friction: L,
|
|
3553
3567
|
min: r.minRotation,
|
|
3554
3568
|
max: r.maxRotation,
|
|
3555
|
-
end: Array.isArray(
|
|
3569
|
+
end: Array.isArray(A) ? A.filter((M) => typeof M == "number") : A
|
|
3556
3570
|
}
|
|
3557
3571
|
},
|
|
3558
3572
|
onComplete: () => n.onThrowComplete?.()
|
|
@@ -3569,28 +3583,28 @@ function tr(i, t, e, s, n) {
|
|
|
3569
3583
|
}
|
|
3570
3584
|
};
|
|
3571
3585
|
}
|
|
3572
|
-
const
|
|
3573
|
-
function
|
|
3586
|
+
const nr = { opacity: 0, scale: 0.6 };
|
|
3587
|
+
function rr(i) {
|
|
3574
3588
|
const t = i.getBoundingClientRect();
|
|
3575
3589
|
return t.width === 0 && t.height === 0 ? null : { cx: t.left + t.width / 2, cy: t.top + t.height / 2, width: t.width, height: t.height };
|
|
3576
3590
|
}
|
|
3577
|
-
function
|
|
3578
|
-
const t =
|
|
3591
|
+
function Ue(i) {
|
|
3592
|
+
const t = Ft(i);
|
|
3579
3593
|
return t.width === 0 && t.height === 0 ? null : { cx: t.left + t.width / 2, cy: t.top + t.height / 2, width: t.width, height: t.height };
|
|
3580
3594
|
}
|
|
3581
|
-
function
|
|
3595
|
+
function he(i, t) {
|
|
3582
3596
|
const s = i.resolveTargets(t).map((o) => i.elementFor(o)).filter((o) => !!o), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
3583
3597
|
for (const o of s) {
|
|
3584
|
-
const a =
|
|
3598
|
+
const a = rr(o);
|
|
3585
3599
|
n.set(o, a);
|
|
3586
|
-
const c =
|
|
3600
|
+
const c = Oi(o);
|
|
3587
3601
|
a && c !== void 0 && !r.has(c) && r.set(c, { element: o, box: a });
|
|
3588
3602
|
}
|
|
3589
3603
|
return { elements: s, boxes: n, ids: r };
|
|
3590
3604
|
}
|
|
3591
|
-
const
|
|
3592
|
-
function
|
|
3593
|
-
const n = s.duration ?? 0.6, r = s.ease ?? "power2.inOut", o = s.stagger ?? 0, a = s.scale !== !1, c = s.enter === void 0 ?
|
|
3605
|
+
const Qt = /* @__PURE__ */ new WeakMap();
|
|
3606
|
+
function ue(i, t, e, s = {}) {
|
|
3607
|
+
const n = s.duration ?? 0.6, r = s.ease ?? "power2.inOut", o = s.stagger ?? 0, a = s.scale !== !1, c = s.enter === void 0 ? nr : s.enter, l = new Set(e.elements);
|
|
3594
3608
|
if (s.targets !== void 0)
|
|
3595
3609
|
for (const d of i.resolveTargets(s.targets)) {
|
|
3596
3610
|
const m = i.elementFor(d);
|
|
@@ -3601,48 +3615,48 @@ function le(i, t, e, s = {}) {
|
|
|
3601
3615
|
), f = t({ onComplete: s.onComplete });
|
|
3602
3616
|
let u = 0;
|
|
3603
3617
|
for (const d of h) {
|
|
3604
|
-
const m =
|
|
3618
|
+
const m = Ue(d);
|
|
3605
3619
|
if (!m) continue;
|
|
3606
3620
|
let p = e.boxes.get(d) ?? null, g;
|
|
3607
|
-
const y =
|
|
3621
|
+
const y = Oi(d), b = !p && y !== void 0 ? e.ids.get(y) : void 0;
|
|
3608
3622
|
b && b.element !== d && (p = b.box, g = b.element);
|
|
3609
|
-
const [
|
|
3610
|
-
|
|
3611
|
-
const
|
|
3623
|
+
const [v] = i.resolveTargets(d);
|
|
3624
|
+
Qt.get(d)?.timeline.removeTracks({ target: v });
|
|
3625
|
+
const T = u * o;
|
|
3612
3626
|
if (!p) {
|
|
3613
3627
|
if (c === !1) continue;
|
|
3614
|
-
f.fromTo(d, { x: 0, y: 0, scaleX: 1, scaleY: 1, ...c }, { ...
|
|
3628
|
+
f.fromTo(d, { x: 0, y: 0, scaleX: 1, scaleY: 1, ...c }, { ...Bi(c), x: 0, y: 0, scaleX: 1, scaleY: 1, duration: n, ease: r, delay: T }, 0), Qt.set(d, f), u++;
|
|
3615
3629
|
continue;
|
|
3616
3630
|
}
|
|
3617
|
-
const
|
|
3618
|
-
if (!(Math.abs(
|
|
3619
|
-
const
|
|
3620
|
-
const
|
|
3621
|
-
return typeof
|
|
3631
|
+
const w = p.cx - m.cx, x = p.cy - m.cy, S = a ? p.width / m.width : 1, _ = a ? p.height / m.height : 1;
|
|
3632
|
+
if (!(Math.abs(w) > 0.5 || Math.abs(x) > 0.5 || Math.abs(S - 1) > 1e-3 || Math.abs(_ - 1) > 1e-3)) {
|
|
3633
|
+
const M = (E, k) => {
|
|
3634
|
+
const P = i.appliedValue(v, E);
|
|
3635
|
+
return typeof P == "number" && Math.abs(P - k) > 1e-6;
|
|
3622
3636
|
};
|
|
3623
|
-
(
|
|
3637
|
+
(M("x", 0) || M("y", 0) || M("scaleX", 1) || M("scaleY", 1)) && f.set(d, { x: 0, y: 0, scaleX: 1, scaleY: 1 }, 0);
|
|
3624
3638
|
continue;
|
|
3625
3639
|
}
|
|
3626
|
-
const
|
|
3640
|
+
const A = s.fade === !0 && g !== void 0;
|
|
3627
3641
|
f.fromTo(
|
|
3628
3642
|
d,
|
|
3629
|
-
{ x:
|
|
3630
|
-
{ x: 0, y: 0, scaleX: 1, scaleY: 1, ...
|
|
3643
|
+
{ x: w, y: x, scaleX: S, scaleY: _, ...A && { opacity: 0 } },
|
|
3644
|
+
{ x: 0, y: 0, scaleX: 1, scaleY: 1, ...A && { opacity: 1 }, duration: n, ease: r, delay: T },
|
|
3631
3645
|
0
|
|
3632
|
-
),
|
|
3646
|
+
), A && g && Ue(g) && f.fromTo(g, { opacity: 1 }, { opacity: 0, duration: n, ease: r, delay: T }, 0), Qt.set(d, f), u++;
|
|
3633
3647
|
}
|
|
3634
3648
|
return f;
|
|
3635
3649
|
}
|
|
3636
|
-
function
|
|
3650
|
+
function Oi(i) {
|
|
3637
3651
|
return i.dataset?.flipId;
|
|
3638
3652
|
}
|
|
3639
|
-
function
|
|
3653
|
+
function Bi(i) {
|
|
3640
3654
|
const t = {};
|
|
3641
3655
|
for (const e of Object.keys(i))
|
|
3642
3656
|
t[e] = e === "opacity" || e.startsWith("scale") ? 1 : 0;
|
|
3643
3657
|
return t;
|
|
3644
3658
|
}
|
|
3645
|
-
function
|
|
3659
|
+
function or(i, t = {}) {
|
|
3646
3660
|
const e = new Set((t.type ?? "chars,words,lines").split(",").map((p) => p.trim())), s = {
|
|
3647
3661
|
chars: t.charsClass ?? "char",
|
|
3648
3662
|
words: t.wordsClass ?? "word",
|
|
@@ -3661,16 +3675,16 @@ function sr(i, t = {}) {
|
|
|
3661
3675
|
}, u = () => {
|
|
3662
3676
|
const p = { chars: [], words: [], lines: [], masks: [] };
|
|
3663
3677
|
for (const { element: g } of r) {
|
|
3664
|
-
const y = (g.textContent ?? "").replace(/\s+/g, " ").trim(), b =
|
|
3678
|
+
const y = (g.textContent ?? "").replace(/\s+/g, " ").trim(), b = ar(g, s.words), v = e.has("chars") ? b.flatMap((x) => cr(x, s.chars)) : [], T = e.has("lines") ? hr(g, b, s.lines) : [];
|
|
3665
3679
|
if (n) {
|
|
3666
3680
|
!g.hasAttribute("aria-label") && y && g.setAttribute("aria-label", y);
|
|
3667
|
-
for (const
|
|
3681
|
+
for (const x of b) x.setAttribute("aria-hidden", "true");
|
|
3668
3682
|
}
|
|
3669
3683
|
if (e.has("words")) p.words.push(...b);
|
|
3670
|
-
else for (const
|
|
3671
|
-
p.chars.push(...
|
|
3672
|
-
const
|
|
3673
|
-
for (const
|
|
3684
|
+
else for (const x of b) x.removeAttribute("class");
|
|
3685
|
+
p.chars.push(...v), p.lines.push(...T);
|
|
3686
|
+
const w = t.mask === "lines" ? T : t.mask === "words" ? b : t.mask === "chars" ? v : [];
|
|
3687
|
+
for (const x of w) p.masks.push(ur(x, `${s[t.mask]}-mask`));
|
|
3674
3688
|
}
|
|
3675
3689
|
o = p;
|
|
3676
3690
|
}, d = {
|
|
@@ -3701,28 +3715,28 @@ function sr(i, t = {}) {
|
|
|
3701
3715
|
const y = () => {
|
|
3702
3716
|
if (g) return;
|
|
3703
3717
|
g = !0;
|
|
3704
|
-
const
|
|
3718
|
+
const v = () => {
|
|
3705
3719
|
g = !1, d.split();
|
|
3706
3720
|
};
|
|
3707
|
-
typeof requestAnimationFrame == "function" ? requestAnimationFrame(
|
|
3721
|
+
typeof requestAnimationFrame == "function" ? requestAnimationFrame(v) : setTimeout(v, 0);
|
|
3708
3722
|
};
|
|
3709
3723
|
if (typeof ResizeObserver == "function") {
|
|
3710
|
-
c = new ResizeObserver((
|
|
3711
|
-
let
|
|
3712
|
-
for (const
|
|
3713
|
-
const
|
|
3714
|
-
p.set(
|
|
3724
|
+
c = new ResizeObserver((v) => {
|
|
3725
|
+
let T = !1;
|
|
3726
|
+
for (const w of v) {
|
|
3727
|
+
const x = Math.round(w.contentRect.width), S = p.get(w.target);
|
|
3728
|
+
p.set(w.target, x), S !== void 0 && S !== x && (T = !0);
|
|
3715
3729
|
}
|
|
3716
|
-
|
|
3730
|
+
T && y();
|
|
3717
3731
|
});
|
|
3718
|
-
for (const
|
|
3732
|
+
for (const v of i) c.observe(v);
|
|
3719
3733
|
}
|
|
3720
3734
|
const b = i[0]?.ownerDocument?.fonts;
|
|
3721
3735
|
b && b.status !== "loaded" && b.ready.then(() => y());
|
|
3722
3736
|
}
|
|
3723
3737
|
return d;
|
|
3724
3738
|
}
|
|
3725
|
-
function
|
|
3739
|
+
function ar(i, t) {
|
|
3726
3740
|
const e = i.ownerDocument, s = [], n = e.createTreeWalker(
|
|
3727
3741
|
i,
|
|
3728
3742
|
4
|
|
@@ -3745,18 +3759,18 @@ function nr(i, t) {
|
|
|
3745
3759
|
}
|
|
3746
3760
|
return s;
|
|
3747
3761
|
}
|
|
3748
|
-
function
|
|
3749
|
-
const e = i.ownerDocument, s =
|
|
3762
|
+
function cr(i, t) {
|
|
3763
|
+
const e = i.ownerDocument, s = lr(i.textContent ?? "").map((n) => {
|
|
3750
3764
|
const r = e.createElement("span");
|
|
3751
3765
|
return r.className = t, r.style.display = "inline-block", r.textContent = n, r;
|
|
3752
3766
|
});
|
|
3753
3767
|
return i.replaceChildren(...s), s;
|
|
3754
3768
|
}
|
|
3755
|
-
function
|
|
3769
|
+
function lr(i) {
|
|
3756
3770
|
const t = Intl.Segmenter;
|
|
3757
3771
|
return t ? Array.from(new t(void 0, { granularity: "grapheme" }).segment(i), (e) => e.segment) : Array.from(i);
|
|
3758
3772
|
}
|
|
3759
|
-
function
|
|
3773
|
+
function hr(i, t, e) {
|
|
3760
3774
|
const s = i.ownerDocument, n = new Map(t.map((m) => [m, m.getBoundingClientRect()])), r = [], o = (m) => {
|
|
3761
3775
|
for (const p of Array.from(m.childNodes))
|
|
3762
3776
|
p.nodeType === 3 || n.has(p) || p.tagName === "BR" ? r.push(p) : o(p);
|
|
@@ -3775,24 +3789,24 @@ function ar(i, t, e) {
|
|
|
3775
3789
|
const p = n.get(m);
|
|
3776
3790
|
if (p && (!c || f || p.top > l + h) && (d(), l = p.top, h = p.height / 2, f = !1), !c) continue;
|
|
3777
3791
|
const g = [];
|
|
3778
|
-
for (let
|
|
3792
|
+
for (let v = m.parentNode; v && v !== i; v = v.parentNode) g.unshift(v);
|
|
3779
3793
|
let y = 0;
|
|
3780
3794
|
for (; y < u.length && y < g.length && u[y].original === g[y]; ) y++;
|
|
3781
3795
|
u.length = y;
|
|
3782
3796
|
let b = y === 0 ? c : u[y - 1].clone;
|
|
3783
|
-
for (const
|
|
3784
|
-
const
|
|
3785
|
-
b.appendChild(
|
|
3797
|
+
for (const v of g.slice(y)) {
|
|
3798
|
+
const T = v.cloneNode(!1);
|
|
3799
|
+
b.appendChild(T), u.push({ original: v, clone: T }), b = T;
|
|
3786
3800
|
}
|
|
3787
3801
|
b.appendChild(m);
|
|
3788
3802
|
}
|
|
3789
3803
|
return i.replaceChildren(...a), a;
|
|
3790
3804
|
}
|
|
3791
|
-
function
|
|
3805
|
+
function ur(i, t) {
|
|
3792
3806
|
const e = i.ownerDocument.createElement("span");
|
|
3793
3807
|
return e.className = t, e.style.display = i.style.display === "block" ? "block" : "inline-block", e.style.overflow = "clip", e.style.paddingBottom = "0.12em", e.style.marginBottom = "-0.12em", i.replaceWith(e), e.appendChild(i), e;
|
|
3794
3808
|
}
|
|
3795
|
-
const
|
|
3809
|
+
const ze = {
|
|
3796
3810
|
top: 0,
|
|
3797
3811
|
left: 0,
|
|
3798
3812
|
start: 0,
|
|
@@ -3803,15 +3817,15 @@ const We = {
|
|
|
3803
3817
|
right: 1,
|
|
3804
3818
|
end: 1
|
|
3805
3819
|
};
|
|
3806
|
-
function
|
|
3820
|
+
function He(i) {
|
|
3807
3821
|
const t = i.trim().toLowerCase();
|
|
3808
|
-
if (t in
|
|
3822
|
+
if (t in ze) return ze[t];
|
|
3809
3823
|
if (t.endsWith("%")) {
|
|
3810
3824
|
const e = Number.parseFloat(t.slice(0, -1));
|
|
3811
3825
|
return Number.isNaN(e) ? void 0 : e / 100;
|
|
3812
3826
|
}
|
|
3813
3827
|
}
|
|
3814
|
-
function
|
|
3828
|
+
function Ni(i) {
|
|
3815
3829
|
if (typeof i == "number")
|
|
3816
3830
|
return { elementFraction: 0, viewportFraction: 0, offsetPx: 0, absolutePx: i };
|
|
3817
3831
|
let t = 0;
|
|
@@ -3823,31 +3837,31 @@ function Li(i) {
|
|
|
3823
3837
|
offsetPx: 0,
|
|
3824
3838
|
absolutePx: Number.parseFloat(s[0]) + t
|
|
3825
3839
|
};
|
|
3826
|
-
const n = s[0] !== void 0 ?
|
|
3840
|
+
const n = s[0] !== void 0 ? He(s[0]) : void 0, r = s[1] !== void 0 ? He(s[1]) : void 0;
|
|
3827
3841
|
return {
|
|
3828
3842
|
elementFraction: n ?? 0,
|
|
3829
3843
|
viewportFraction: r ?? 0,
|
|
3830
3844
|
offsetPx: t
|
|
3831
3845
|
};
|
|
3832
3846
|
}
|
|
3833
|
-
function
|
|
3834
|
-
const s =
|
|
3847
|
+
function gt(i, t, e) {
|
|
3848
|
+
const s = Ni(e), n = s.absolutePx !== void 0 ? i.top + s.absolutePx : i.top + i.height * s.elementFraction, r = t * s.viewportFraction;
|
|
3835
3849
|
return n - r + s.offsetPx;
|
|
3836
3850
|
}
|
|
3837
|
-
function
|
|
3838
|
-
const n =
|
|
3839
|
-
return o <= 0 ? n <= 0 ? 1 : 0 :
|
|
3851
|
+
function _o(i, t, e, s) {
|
|
3852
|
+
const n = gt(i, t, e), o = gt(i, t, s) - n;
|
|
3853
|
+
return o <= 0 ? n <= 0 ? 1 : 0 : qi(-n / o);
|
|
3840
3854
|
}
|
|
3841
|
-
function
|
|
3855
|
+
function qi(i) {
|
|
3842
3856
|
return i < 0 ? 0 : i > 1 ? 1 : i === 0 ? 0 : i;
|
|
3843
3857
|
}
|
|
3844
|
-
function
|
|
3858
|
+
function fr(i, t, e, s) {
|
|
3845
3859
|
if (e <= 0) return t;
|
|
3846
3860
|
const n = 1 - Math.exp(-(s / 1e3) / e);
|
|
3847
3861
|
return i + (t - i) * n;
|
|
3848
3862
|
}
|
|
3849
|
-
function
|
|
3850
|
-
const r = (h) =>
|
|
3863
|
+
function Ge(i, t, e, s, n) {
|
|
3864
|
+
const r = (h) => gt({ top: i + n(h), bottom: i + n(h) + t, height: t }, e, s), o = r(0), a = r(1);
|
|
3851
3865
|
if (Math.sign(o) === Math.sign(a) || o === 0 || a === 0)
|
|
3852
3866
|
return o === 0 ? 0 : a === 0 ? 1 : Math.abs(o) < Math.abs(a) ? 0 : 1;
|
|
3853
3867
|
let c = 0, l = 1;
|
|
@@ -3857,7 +3871,7 @@ function Ue(i, t, e, s, n) {
|
|
|
3857
3871
|
}
|
|
3858
3872
|
return (c + l) / 2;
|
|
3859
3873
|
}
|
|
3860
|
-
class
|
|
3874
|
+
class dr {
|
|
3861
3875
|
timeline;
|
|
3862
3876
|
trigger;
|
|
3863
3877
|
behaviour;
|
|
@@ -3904,11 +3918,11 @@ class hr {
|
|
|
3904
3918
|
this.options.onLeave?.(), this.behaviour === "reset" && this.timeline.stop();
|
|
3905
3919
|
}
|
|
3906
3920
|
}
|
|
3907
|
-
function
|
|
3908
|
-
const t = new
|
|
3921
|
+
function Co(i) {
|
|
3922
|
+
const t = new dr(i);
|
|
3909
3923
|
return t.start(), t;
|
|
3910
3924
|
}
|
|
3911
|
-
class
|
|
3925
|
+
class pr {
|
|
3912
3926
|
element;
|
|
3913
3927
|
spacer;
|
|
3914
3928
|
saved;
|
|
@@ -3937,28 +3951,28 @@ class ur {
|
|
|
3937
3951
|
this.element.style.position = this.saved.position, this.element.style.top = this.saved.top, this.element.style.left = this.saved.left, this.spacer.parentNode && this.spacer.replaceWith(this.element);
|
|
3938
3952
|
}
|
|
3939
3953
|
}
|
|
3940
|
-
const
|
|
3941
|
-
function
|
|
3954
|
+
const mr = 0.15;
|
|
3955
|
+
function gr(i) {
|
|
3942
3956
|
return typeof i == "object" && !Array.isArray(i) ? i : { snapTo: i };
|
|
3943
3957
|
}
|
|
3944
|
-
function
|
|
3945
|
-
const s =
|
|
3946
|
-
if (typeof e == "function") return
|
|
3958
|
+
function yr(i, t, e) {
|
|
3959
|
+
const s = St(i + t * mr);
|
|
3960
|
+
if (typeof e == "function") return St(e(s));
|
|
3947
3961
|
if (typeof e == "number")
|
|
3948
|
-
return e <= 0 ? i :
|
|
3962
|
+
return e <= 0 ? i : St(Math.round(s / e) * e);
|
|
3949
3963
|
if (e.length === 0) return i;
|
|
3950
3964
|
let n = e[0];
|
|
3951
3965
|
for (const r of e)
|
|
3952
3966
|
Math.abs(r - s) < Math.abs(n - s) && (n = r);
|
|
3953
|
-
return
|
|
3967
|
+
return St(n);
|
|
3954
3968
|
}
|
|
3955
|
-
function
|
|
3969
|
+
function br(i, t, e) {
|
|
3956
3970
|
const s = i.duration ?? { min: 0.2, max: 0.8 };
|
|
3957
3971
|
if (typeof s == "number") return s;
|
|
3958
3972
|
const n = Math.min(1, Math.abs(t) / Math.max(1, e));
|
|
3959
3973
|
return s.min + (s.max - s.min) * n;
|
|
3960
3974
|
}
|
|
3961
|
-
class
|
|
3975
|
+
class vr {
|
|
3962
3976
|
rafId = null;
|
|
3963
3977
|
cancelEvents = ["wheel", "touchstart", "pointerdown", "keydown"];
|
|
3964
3978
|
onInterrupt = () => this.cancel();
|
|
@@ -3970,7 +3984,7 @@ class gr {
|
|
|
3970
3984
|
get active() {
|
|
3971
3985
|
return this.rafId !== null;
|
|
3972
3986
|
}
|
|
3973
|
-
animate(t, e, s, n =
|
|
3987
|
+
animate(t, e, s, n = Nt, r) {
|
|
3974
3988
|
if (this.cancel(), typeof requestAnimationFrame > "u" || s <= 0) {
|
|
3975
3989
|
this.write(e), r?.();
|
|
3976
3990
|
return;
|
|
@@ -3991,10 +4005,10 @@ class gr {
|
|
|
3991
4005
|
for (const t of this.cancelEvents) this.eventTarget?.removeEventListener(t, this.onInterrupt);
|
|
3992
4006
|
}
|
|
3993
4007
|
}
|
|
3994
|
-
function
|
|
4008
|
+
function St(i) {
|
|
3995
4009
|
return Math.max(0, Math.min(1, i));
|
|
3996
4010
|
}
|
|
3997
|
-
class
|
|
4011
|
+
class wr {
|
|
3998
4012
|
options;
|
|
3999
4013
|
scroller;
|
|
4000
4014
|
nodes = [];
|
|
@@ -4035,24 +4049,24 @@ class yr {
|
|
|
4035
4049
|
for (const t of this.nodes.splice(0)) t.remove();
|
|
4036
4050
|
}
|
|
4037
4051
|
}
|
|
4038
|
-
const
|
|
4039
|
-
let
|
|
4040
|
-
const
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
for (const i of
|
|
4052
|
+
const Tr = 120, et = [], ot = /* @__PURE__ */ new Set();
|
|
4053
|
+
let Jt = !1;
|
|
4054
|
+
const xr = () => {
|
|
4055
|
+
Jt || ot.size === 0 || (Jt = !0, queueMicrotask(() => {
|
|
4056
|
+
Jt = !1;
|
|
4057
|
+
for (const i of ot) i.afterRefresh();
|
|
4044
4058
|
}));
|
|
4045
|
-
},
|
|
4046
|
-
for (const i of
|
|
4047
|
-
for (const i of
|
|
4048
|
-
for (const i of
|
|
4059
|
+
}, Xi = () => {
|
|
4060
|
+
for (const i of ot) i.beforeRefresh();
|
|
4061
|
+
for (const i of et) i.refresh();
|
|
4062
|
+
for (const i of ot) i.afterRefresh();
|
|
4049
4063
|
};
|
|
4050
|
-
let
|
|
4051
|
-
const
|
|
4052
|
-
const i = window.innerWidth, t = window.innerHeight, e = i ===
|
|
4053
|
-
e && s && n || (
|
|
4064
|
+
let it = { width: 0, height: 0 };
|
|
4065
|
+
const Ke = () => {
|
|
4066
|
+
const i = window.innerWidth, t = window.innerHeight, e = i === it.width && t !== it.height, s = Math.abs(t - it.height) < it.height * 0.25, n = typeof navigator < "u" && (navigator.maxTouchPoints ?? 0) > 0;
|
|
4067
|
+
e && s && n || (it = { width: i, height: t }, Xi());
|
|
4054
4068
|
};
|
|
4055
|
-
class
|
|
4069
|
+
class qt {
|
|
4056
4070
|
timeline;
|
|
4057
4071
|
options;
|
|
4058
4072
|
running = !1;
|
|
@@ -4082,16 +4096,16 @@ class Bt {
|
|
|
4082
4096
|
markers = null;
|
|
4083
4097
|
markerGeometry = null;
|
|
4084
4098
|
constructor(t) {
|
|
4085
|
-
this.timeline = t.timeline, this.options = t, this.snapper = new
|
|
4099
|
+
this.timeline = t.timeline, this.options = t, this.snapper = new vr((e) => this.scrollTo(e), typeof window < "u" ? window : null);
|
|
4086
4100
|
}
|
|
4087
4101
|
start() {
|
|
4088
4102
|
if (this.running) return;
|
|
4089
4103
|
this.running = !0, this.timeline?.pause();
|
|
4090
4104
|
const t = this.options.pin === !0 ? this.options.trigger : this.options.pin || null;
|
|
4091
|
-
t && !this.options.container && (this.pin = new
|
|
4105
|
+
t && !this.options.container && (this.pin = new pr(t, { axis: this.options.horizontal ? "x" : "y", spacing: this.options.pinSpacing !== !1 })), this.options.markers && !this.options.horizontal && typeof document < "u" && (this.markers = new wr(document, this.options.scroller ?? null, this.options.markers)), this.scrollTarget()?.addEventListener("scroll", this.onScroll, { passive: !0 }), et.length === 0 && typeof window < "u" && (it = { width: window.innerWidth, height: window.innerHeight }, window.addEventListener("resize", Ke, { passive: !0 })), et.push(this), this.refresh();
|
|
4092
4106
|
}
|
|
4093
4107
|
stop() {
|
|
4094
|
-
this.running && (this.running = !1, this.scrollTarget()?.removeEventListener("scroll", this.onScroll),
|
|
4108
|
+
this.running && (this.running = !1, this.scrollTarget()?.removeEventListener("scroll", this.onScroll), et.splice(et.indexOf(this), 1), et.length === 0 && typeof window < "u" && window.removeEventListener("resize", Ke), this.stopSmoothing(), this.idleTimer !== null && clearTimeout(this.idleTimer), this.idleTimer = null, this.snapTimer !== null && clearTimeout(this.snapTimer), this.snapTimer = null, this.snapper.cancel());
|
|
4095
4109
|
}
|
|
4096
4110
|
/** Stop, and remove any pin spacer. */
|
|
4097
4111
|
destroy() {
|
|
@@ -4109,11 +4123,11 @@ class Bt {
|
|
|
4109
4123
|
* layout change a resize would not catch (images or fonts loading).
|
|
4110
4124
|
*/
|
|
4111
4125
|
static refreshAll() {
|
|
4112
|
-
|
|
4126
|
+
Xi();
|
|
4113
4127
|
}
|
|
4114
4128
|
/** Be told around every re-measure; returns a function that stops it. */
|
|
4115
4129
|
static onRefresh(t) {
|
|
4116
|
-
return
|
|
4130
|
+
return ot.add(t), () => ot.delete(t);
|
|
4117
4131
|
}
|
|
4118
4132
|
/** Current scroll progress, 0..1. */
|
|
4119
4133
|
get progress() {
|
|
@@ -4139,13 +4153,13 @@ class Bt {
|
|
|
4139
4153
|
this.measureInContainer(this.options.container);
|
|
4140
4154
|
else if (e) {
|
|
4141
4155
|
const s = this.viewportHeight();
|
|
4142
|
-
if (this.startPx = t +
|
|
4156
|
+
if (this.startPx = t + gt(e, s, ft(this.options.start) ?? "top bottom"), this.endPx = this.resolveEnd(e, s, t), this.pin) {
|
|
4143
4157
|
const n = this.relativeRect(this.pin.element.getBoundingClientRect());
|
|
4144
4158
|
this.pin.apply(n.top - (this.startPx - t), this.endPx - this.startPx);
|
|
4145
4159
|
}
|
|
4146
4160
|
this.markerGeometry = this.markers ? this.markersFor(s) : null;
|
|
4147
4161
|
}
|
|
4148
|
-
this.markers && this.markerGeometry && this.markers.place(this.markerGeometry, t), this.lastScroll = null, this.updateFrom(t, !this.measured), this.measured = !0,
|
|
4162
|
+
this.markers && this.markerGeometry && this.markers.place(this.markerGeometry, t), this.lastScroll = null, this.updateFrom(t, !this.measured), this.measured = !0, xr();
|
|
4149
4163
|
}
|
|
4150
4164
|
/** Same as `refresh()`. */
|
|
4151
4165
|
sample() {
|
|
@@ -4163,7 +4177,7 @@ class Bt {
|
|
|
4163
4177
|
updateFrom(t, e) {
|
|
4164
4178
|
this.trackVelocity(t), this.markers && this.markerGeometry && this.markers.follow(this.markerGeometry, t);
|
|
4165
4179
|
const s = this.endPx - this.startPx, n = this.zone;
|
|
4166
|
-
this.targetProgress = s > 0 ?
|
|
4180
|
+
this.targetProgress = s > 0 ? qi((t - this.startPx) / s) : t >= this.startPx ? 1 : 0, this.zone = s > 0 ? t <= this.startPx ? "before" : t >= this.endPx ? "after" : "active" : t >= this.startPx ? "after" : "before", this.fireBoundaryCallbacks(n, this.zone), e || this.smoothing() <= 0 ? (this.displayProgress = this.targetProgress, this.applyProgress()) : (this.emitUpdate(), this.startSmoothing());
|
|
4167
4181
|
}
|
|
4168
4182
|
/** Seconds of smoothing, or 0 for exact tracking. */
|
|
4169
4183
|
smoothing() {
|
|
@@ -4171,12 +4185,12 @@ class Bt {
|
|
|
4171
4185
|
return typeof t == "number" ? Math.max(0, t) : 0;
|
|
4172
4186
|
}
|
|
4173
4187
|
resolveEnd(t, e, s) {
|
|
4174
|
-
const n =
|
|
4188
|
+
const n = ft(this.options.end) ?? "bottom top", r = typeof n == "string" ? n.trim().match(/^\+=\s*(-?[\d.]+)\s*(%|px)?$/) : null;
|
|
4175
4189
|
if (r) {
|
|
4176
4190
|
const o = Number.parseFloat(r[1]);
|
|
4177
4191
|
return this.startPx + (r[2] === "%" ? e * o / 100 : o);
|
|
4178
4192
|
}
|
|
4179
|
-
return s +
|
|
4193
|
+
return s + gt(t, e, n);
|
|
4180
4194
|
}
|
|
4181
4195
|
applyProgress() {
|
|
4182
4196
|
const t = this.timeline?.duration ?? 0;
|
|
@@ -4191,7 +4205,7 @@ class Bt {
|
|
|
4191
4205
|
const e = typeof performance < "u" ? performance.now() : Date.now();
|
|
4192
4206
|
this.lastScroll !== null && e > this.lastScrollTime && t !== this.lastScroll && (this.velocityPxPerSecond = (t - this.lastScroll) / (e - this.lastScrollTime) * 1e3), (this.lastScroll === null || t !== this.lastScroll) && (this.lastScroll = t, this.lastScrollTime = e), !(this.velocityPxPerSecond === 0 || typeof setTimeout > "u") && (this.idleTimer !== null && clearTimeout(this.idleTimer), this.idleTimer = setTimeout(() => {
|
|
4193
4207
|
this.idleTimer = null, this.releaseVelocity = this.velocityPxPerSecond, this.velocityPxPerSecond = 0, this.emitUpdate(), this.scheduleSnap();
|
|
4194
|
-
},
|
|
4208
|
+
}, Tr));
|
|
4195
4209
|
}
|
|
4196
4210
|
/**
|
|
4197
4211
|
* Emit enter/leave callbacks as the scroll position moves between zones. A jump
|
|
@@ -4207,12 +4221,12 @@ class Bt {
|
|
|
4207
4221
|
scheduleSnap() {
|
|
4208
4222
|
const t = this.options.snap;
|
|
4209
4223
|
if (t === void 0 || this.snapper.active) return;
|
|
4210
|
-
const e =
|
|
4224
|
+
const e = gr(t), s = () => {
|
|
4211
4225
|
this.snapTimer = null;
|
|
4212
4226
|
const n = this.endPx - this.startPx, r = this.scrollPosition();
|
|
4213
4227
|
if (!this.running || n <= 0 || r <= this.startPx || r >= this.endPx) return;
|
|
4214
|
-
const o = (r - this.startPx) / n, a = this.startPx +
|
|
4215
|
-
Math.abs(a - r) < 1 || this.snapper.animate(r, a,
|
|
4228
|
+
const o = (r - this.startPx) / n, a = this.startPx + yr(o, this.releaseVelocity / n, e.snapTo) * n;
|
|
4229
|
+
Math.abs(a - r) < 1 || this.snapper.animate(r, a, br(e, a - r, this.viewportHeight()), e.ease);
|
|
4216
4230
|
};
|
|
4217
4231
|
e.delay ? this.snapTimer = setTimeout(s, e.delay * 1e3) : s();
|
|
4218
4232
|
}
|
|
@@ -4228,18 +4242,18 @@ class Bt {
|
|
|
4228
4242
|
measureInContainer(t) {
|
|
4229
4243
|
const e = this.options.trigger;
|
|
4230
4244
|
if (typeof e?.getBoundingClientRect != "function") return;
|
|
4231
|
-
const s = e.getBoundingClientRect(), n = this.options.scroller?.getBoundingClientRect?.().left ?? 0, r = this.options.scroller ? this.options.scroller.clientWidth : typeof window < "u" ? window.innerWidth : 0, o = s.left - n - t.shiftAt(t.progress()), { start: a, end: c } = t.range(), l = (d) => a + d * (c - a), h =
|
|
4245
|
+
const s = e.getBoundingClientRect(), n = this.options.scroller?.getBoundingClientRect?.().left ?? 0, r = this.options.scroller ? this.options.scroller.clientWidth : typeof window < "u" ? window.innerWidth : 0, o = s.left - n - t.shiftAt(t.progress()), { start: a, end: c } = t.range(), l = (d) => a + d * (c - a), h = Ge(o, s.width, r, ft(this.options.start) ?? "left right", t.shiftAt);
|
|
4232
4246
|
this.startPx = l(h);
|
|
4233
|
-
const f =
|
|
4234
|
-
this.endPx = u ? this.startPx + Number.parseFloat(u[1]) : l(
|
|
4247
|
+
const f = ft(this.options.end) ?? "right left", u = typeof f == "string" ? f.trim().match(/^\+=\s*(-?[\d.]+)\s*(px)?$/) : null;
|
|
4248
|
+
this.endPx = u ? this.startPx + Number.parseFloat(u[1]) : l(Ge(o, s.width, r, f, t.shiftAt)), this.markerGeometry = null;
|
|
4235
4249
|
}
|
|
4236
4250
|
/** Where the markers go: the element points on the page, and the viewport lines they meet. */
|
|
4237
4251
|
markersFor(t) {
|
|
4238
4252
|
const e = (r, o) => {
|
|
4239
|
-
const a =
|
|
4253
|
+
const a = ft(r) ?? o;
|
|
4240
4254
|
if (typeof a == "number") return 0;
|
|
4241
4255
|
if (/^\s*\+=/.test(a)) return;
|
|
4242
|
-
const c =
|
|
4256
|
+
const c = Ni(a);
|
|
4243
4257
|
return t * c.viewportFraction - c.offsetPx;
|
|
4244
4258
|
}, s = e(this.options.start, "top bottom") ?? 0, n = e(this.options.end, "bottom top") ?? s;
|
|
4245
4259
|
return {
|
|
@@ -4254,7 +4268,7 @@ class Bt {
|
|
|
4254
4268
|
const t = (e) => {
|
|
4255
4269
|
if (this.rafId = null, !this.running) return;
|
|
4256
4270
|
const s = this.lastFrameTime === null ? 16.67 : e - this.lastFrameTime;
|
|
4257
|
-
this.lastFrameTime = e, this.displayProgress =
|
|
4271
|
+
this.lastFrameTime = e, this.displayProgress = fr(this.displayProgress, this.targetProgress, this.smoothing(), s);
|
|
4258
4272
|
const n = Math.abs(this.targetProgress - this.displayProgress) < 1e-4;
|
|
4259
4273
|
n && (this.displayProgress = this.targetProgress), this.applyProgress(), n ? this.lastFrameTime = null : this.rafId = requestAnimationFrame(t);
|
|
4260
4274
|
};
|
|
@@ -4292,15 +4306,15 @@ class Bt {
|
|
|
4292
4306
|
return t ? e ? t.clientWidth : t.clientHeight : typeof window < "u" ? e ? window.innerWidth : window.innerHeight : 0;
|
|
4293
4307
|
}
|
|
4294
4308
|
}
|
|
4295
|
-
function
|
|
4309
|
+
function ft(i) {
|
|
4296
4310
|
return typeof i == "function" ? i() : i;
|
|
4297
4311
|
}
|
|
4298
|
-
function
|
|
4299
|
-
const t = new
|
|
4312
|
+
function Ro(i) {
|
|
4313
|
+
const t = new qt(i);
|
|
4300
4314
|
return t.start(), t;
|
|
4301
4315
|
}
|
|
4302
|
-
const
|
|
4303
|
-
class
|
|
4316
|
+
const te = /* @__PURE__ */ new Set(), kr = 16, Ze = 0.5, Sr = 2;
|
|
4317
|
+
class Qe {
|
|
4304
4318
|
options;
|
|
4305
4319
|
frames;
|
|
4306
4320
|
running = !1;
|
|
@@ -4330,22 +4344,22 @@ class Ge {
|
|
|
4330
4344
|
if (this.running || typeof window > "u") return this;
|
|
4331
4345
|
this.running = !0, this.reduced = this.options.reducedMotion ?? (typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches), this.current = this.target = this.position();
|
|
4332
4346
|
const t = this.options.scroller ?? window;
|
|
4333
|
-
return t.addEventListener("wheel", this.onWheel, { passive: !1 }), t.addEventListener("scroll", this.onScroll, { passive: !0 }), window.addEventListener("resize", this.onResize, { passive: !0 }), window.addEventListener("load", this.onLoad),
|
|
4347
|
+
return t.addEventListener("wheel", this.onWheel, { passive: !1 }), t.addEventListener("scroll", this.onScroll, { passive: !0 }), window.addEventListener("resize", this.onResize, { passive: !0 }), window.addEventListener("load", this.onLoad), te.add(this), this.stopListening = qt.onRefresh({ beforeRefresh: () => this.rest(), afterRefresh: () => this.refresh() }), this.refresh(), this;
|
|
4334
4348
|
}
|
|
4335
4349
|
/** Re-measure every started smoother, after layout changes a resize would not catch. */
|
|
4336
4350
|
static refreshAll() {
|
|
4337
|
-
for (const t of
|
|
4351
|
+
for (const t of te) t.refresh();
|
|
4338
4352
|
}
|
|
4339
4353
|
stop() {
|
|
4340
4354
|
if (!this.running) return this;
|
|
4341
4355
|
this.running = !1;
|
|
4342
4356
|
const t = this.options.scroller ?? window;
|
|
4343
|
-
return t.removeEventListener("wheel", this.onWheel), t.removeEventListener("scroll", this.onScroll), window.removeEventListener("resize", this.onResize), window.removeEventListener("load", this.onLoad),
|
|
4357
|
+
return t.removeEventListener("wheel", this.onWheel), t.removeEventListener("scroll", this.onScroll), window.removeEventListener("resize", this.onResize), window.removeEventListener("load", this.onLoad), te.delete(this), this.stopListening?.(), this.stopListening = null, this.cancelFrame(), this.journey = null, this;
|
|
4344
4358
|
}
|
|
4345
4359
|
/** Stop, and put every effect element back where it was. */
|
|
4346
4360
|
destroy() {
|
|
4347
4361
|
this.stop();
|
|
4348
|
-
for (const t of this.effects)
|
|
4362
|
+
for (const t of this.effects) ee(t.element, t.saved);
|
|
4349
4363
|
this.effects = [];
|
|
4350
4364
|
}
|
|
4351
4365
|
/** GSAP's name for `destroy()`. */
|
|
@@ -4371,7 +4385,7 @@ class Ge {
|
|
|
4371
4385
|
this.journey = null, this.current = this.target = s, this.write(s), this.applyEffects(0);
|
|
4372
4386
|
return;
|
|
4373
4387
|
}
|
|
4374
|
-
this.target = s, this.journey = { from: this.current, to: s, ms: r * 1e3, ease: e.ease ??
|
|
4388
|
+
this.target = s, this.journey = { from: this.current, to: s, ms: r * 1e3, ease: e.ease ?? Nt, elapsed: 0 }, this.requestFrame();
|
|
4375
4389
|
}
|
|
4376
4390
|
/** Re-measure the scrollable length and every effect element (resizes do this). */
|
|
4377
4391
|
refresh() {
|
|
@@ -4397,18 +4411,18 @@ class Ge {
|
|
|
4397
4411
|
}
|
|
4398
4412
|
/** Put effect elements at their natural place, for measuring. */
|
|
4399
4413
|
rest() {
|
|
4400
|
-
for (const t of this.effects)
|
|
4414
|
+
for (const t of this.effects) ee(t.element, t.saved);
|
|
4401
4415
|
}
|
|
4402
4416
|
// --- input ----------------------------------------------------------------
|
|
4403
4417
|
wheel(t) {
|
|
4404
4418
|
if (this.pausedState || this.reduced || (this.options.smooth ?? 0.8) <= 0 || t.ctrlKey || Math.abs(t.deltaX) > Math.abs(t.deltaY) || this.nestedScrollerTakes(t)) return;
|
|
4405
|
-
const e = t.deltaMode === 1 ?
|
|
4419
|
+
const e = t.deltaMode === 1 ? kr : t.deltaMode === 2 ? this.viewportHeight() : 1, s = t.deltaY * e * (this.options.wheelMultiplier ?? 1), n = this.clamp(this.target + s);
|
|
4406
4420
|
n === this.target && n === this.current || (t.preventDefault(), this.journey = null, this.target = n, this.requestFrame());
|
|
4407
4421
|
}
|
|
4408
4422
|
/** A scroll that this smoother did not write: follow it. */
|
|
4409
4423
|
nativeScroll() {
|
|
4410
4424
|
const t = this.position();
|
|
4411
|
-
this.written !== null && Math.abs(t - this.written) <=
|
|
4425
|
+
this.written !== null && Math.abs(t - this.written) <= Sr || (this.written = null, this.journey = null, this.cancelFrame(), this.current = this.target = t, this.requestFrame());
|
|
4412
4426
|
}
|
|
4413
4427
|
nestedScrollerTakes(t) {
|
|
4414
4428
|
const e = this.options.scroller ?? document.documentElement;
|
|
@@ -4439,7 +4453,7 @@ class Ge {
|
|
|
4439
4453
|
this.current = r.from + (r.to - r.from) * r.ease(o), o >= 1 && (this.journey = null);
|
|
4440
4454
|
} else if (this.current !== this.target) {
|
|
4441
4455
|
const r = (this.options.smooth ?? 0.8) * 1e3 / 3;
|
|
4442
|
-
this.current += (this.target - this.current) * (1 - Math.exp(-e / r)), Math.abs(this.target - this.current) <
|
|
4456
|
+
this.current += (this.target - this.current) * (1 - Math.exp(-e / r)), Math.abs(this.target - this.current) < Ze && (this.current = this.target);
|
|
4443
4457
|
}
|
|
4444
4458
|
this.current !== s && this.write(this.current), this.velocityPxPerSecond = e > 0 ? (this.current - s) * 1e3 / e : 0;
|
|
4445
4459
|
const n = this.applyEffects(e);
|
|
@@ -4453,9 +4467,9 @@ class Ge {
|
|
|
4453
4467
|
let r = 0;
|
|
4454
4468
|
if (n.speed !== void 0 && (r += (s - n.centre) * (1 - n.speed)), n.lag !== void 0) {
|
|
4455
4469
|
const o = n.lag * 1e3 / 3;
|
|
4456
|
-
n.lagged = t === 0 ? s : n.lagged + (s - n.lagged) * (1 - Math.exp(-t / o)), Math.abs(s - n.lagged) <
|
|
4470
|
+
n.lagged = t === 0 ? s : n.lagged + (s - n.lagged) * (1 - Math.exp(-t / o)), Math.abs(s - n.lagged) < Ze ? n.lagged = s : e = !0, r += s - n.lagged;
|
|
4457
4471
|
}
|
|
4458
|
-
|
|
4472
|
+
ee(n.element, r === 0 ? n.saved : `0 ${Mr(r)}px`), n.shift = r;
|
|
4459
4473
|
}
|
|
4460
4474
|
return e;
|
|
4461
4475
|
}
|
|
@@ -4489,13 +4503,13 @@ class Ge {
|
|
|
4489
4503
|
return s.getBoundingClientRect().top - n + this.position() - r;
|
|
4490
4504
|
}
|
|
4491
4505
|
}
|
|
4492
|
-
function
|
|
4506
|
+
function ee(i, t) {
|
|
4493
4507
|
t ? i.style.setProperty("translate", t) : i.style.removeProperty("translate");
|
|
4494
4508
|
}
|
|
4495
|
-
function
|
|
4509
|
+
function Mr(i) {
|
|
4496
4510
|
return Math.round(i * 100) / 100;
|
|
4497
4511
|
}
|
|
4498
|
-
function
|
|
4512
|
+
function Ar(i, t) {
|
|
4499
4513
|
switch (t) {
|
|
4500
4514
|
// Play forward from wherever it is; reverse() flips a reversed timeline and plays.
|
|
4501
4515
|
// Neither restarts an animation that is already at that end.
|
|
@@ -4524,7 +4538,7 @@ function Sr(i, t) {
|
|
|
4524
4538
|
break;
|
|
4525
4539
|
}
|
|
4526
4540
|
}
|
|
4527
|
-
function
|
|
4541
|
+
function be(i, t, e, s, n = () => {
|
|
4528
4542
|
}) {
|
|
4529
4543
|
const r = (d) => typeof d == "string" ? i.query(d) ?? void 0 : d, o = r(t.trigger) ?? s;
|
|
4530
4544
|
if (!o) {
|
|
@@ -4534,9 +4548,9 @@ function ge(i, t, e, s, n = () => {
|
|
|
4534
4548
|
const a = t.scrub === void 0 || t.scrub === !1 ? !1 : t.scrub, c = (t.toggleActions ?? "play none none none").trim().split(/\s+/);
|
|
4535
4549
|
let l = 0, h;
|
|
4536
4550
|
const f = (d, m) => () => {
|
|
4537
|
-
m?.(), e && !a &&
|
|
4538
|
-
}, u = t.containerAnimation ?
|
|
4539
|
-
return h = new
|
|
4551
|
+
m?.(), e && !a && Ar(e, c[d] ?? "none"), t.once && d === 0 && queueMicrotask(() => h.destroy());
|
|
4552
|
+
}, u = t.containerAnimation ? _r(i, t.containerAnimation, o, n) : void 0;
|
|
4553
|
+
return h = new qt({
|
|
4540
4554
|
trigger: o,
|
|
4541
4555
|
start: t.start,
|
|
4542
4556
|
end: t.end,
|
|
@@ -4546,7 +4560,7 @@ function ge(i, t, e, s, n = () => {
|
|
|
4546
4560
|
horizontal: t.horizontal,
|
|
4547
4561
|
pinSpacing: t.pinSpacing,
|
|
4548
4562
|
onRefresh: t.invalidateOnRefresh && e?.invalidate ? () => e.invalidate() : void 0,
|
|
4549
|
-
snap: t.snap === void 0 ? void 0 :
|
|
4563
|
+
snap: t.snap === void 0 ? void 0 : Pr(t.snap, e),
|
|
4550
4564
|
markers: t.markers,
|
|
4551
4565
|
container: u,
|
|
4552
4566
|
onUpdate: (d, m) => {
|
|
@@ -4562,10 +4576,10 @@ function ge(i, t, e, s, n = () => {
|
|
|
4562
4576
|
onLeaveBack: f(3, t.onLeaveBack)
|
|
4563
4577
|
}), e && a === !1 && e.progress(0), h.start(), i.own(h);
|
|
4564
4578
|
}
|
|
4565
|
-
function
|
|
4566
|
-
const e = (n) => n === "labels" ? (r) =>
|
|
4579
|
+
function Pr(i, t) {
|
|
4580
|
+
const e = (n) => n === "labels" ? (r) => Er(r, t?.labelProgresses?.() ?? []) : n;
|
|
4567
4581
|
if (typeof i != "object" || Array.isArray(i)) return e(i);
|
|
4568
|
-
const s = i.ease ?
|
|
4582
|
+
const s = i.ease ? It(i.ease) : void 0;
|
|
4569
4583
|
return {
|
|
4570
4584
|
snapTo: e(i.snapTo),
|
|
4571
4585
|
duration: i.duration,
|
|
@@ -4573,10 +4587,10 @@ function xr(i, t) {
|
|
|
4573
4587
|
ease: s ? s.fn ?? W(s.easing) : void 0
|
|
4574
4588
|
};
|
|
4575
4589
|
}
|
|
4576
|
-
function
|
|
4590
|
+
function Er(i, t) {
|
|
4577
4591
|
return t.reduce((e, s) => Math.abs(s - i) < Math.abs(e - i) ? s : e, t[0] ?? i);
|
|
4578
4592
|
}
|
|
4579
|
-
function
|
|
4593
|
+
function _r(i, t, e, s) {
|
|
4580
4594
|
const n = () => t.timeline.getTracks({ property: "x" }).map((r) => r.target).filter((r) => {
|
|
4581
4595
|
const o = i.elementFor(r);
|
|
4582
4596
|
return !!o && o !== e && o.contains(e);
|
|
@@ -4598,7 +4612,7 @@ function Ar(i, t, e, s) {
|
|
|
4598
4612
|
}
|
|
4599
4613
|
};
|
|
4600
4614
|
}
|
|
4601
|
-
class
|
|
4615
|
+
class Yi {
|
|
4602
4616
|
/** For contexts made by matchMedia: which named queries match */
|
|
4603
4617
|
conditions = {};
|
|
4604
4618
|
scope;
|
|
@@ -4641,7 +4655,7 @@ class Bi {
|
|
|
4641
4655
|
this.revert();
|
|
4642
4656
|
}
|
|
4643
4657
|
}
|
|
4644
|
-
class
|
|
4658
|
+
class Cr {
|
|
4645
4659
|
host;
|
|
4646
4660
|
scope;
|
|
4647
4661
|
entries = [];
|
|
@@ -4681,11 +4695,11 @@ class Pr {
|
|
|
4681
4695
|
for (const [o, a] of t.queries) e[o] = a.matches;
|
|
4682
4696
|
const s = Object.values(e).some(Boolean), n = s ? JSON.stringify(e) : void 0;
|
|
4683
4697
|
if (n === t.key || (t.context?.revert(), t.context = void 0, t.key = n, !s)) return;
|
|
4684
|
-
const r = new
|
|
4698
|
+
const r = new Yi(this.host, this.scope);
|
|
4685
4699
|
r.conditions = e, r.add(() => t.setup(r)), t.context = r;
|
|
4686
4700
|
}
|
|
4687
4701
|
}
|
|
4688
|
-
class
|
|
4702
|
+
class Rr {
|
|
4689
4703
|
frames;
|
|
4690
4704
|
canvas;
|
|
4691
4705
|
context;
|
|
@@ -4759,29 +4773,29 @@ class _r {
|
|
|
4759
4773
|
e.onload = () => s(!0), e.onerror = () => s(!1), e.src = this.options.url(t);
|
|
4760
4774
|
}
|
|
4761
4775
|
}
|
|
4762
|
-
const
|
|
4763
|
-
async function
|
|
4776
|
+
const Ir = { opacity: 0, y: -16 }, $r = { opacity: 0, y: 16 };
|
|
4777
|
+
async function Fr(i, t, e, s) {
|
|
4764
4778
|
const n = t.collector?.scope ?? t.root, r = n.ownerDocument ?? n, o = () => s.shared ? [...n.querySelectorAll(s.shared)] : [];
|
|
4765
4779
|
if (s.native && typeof r.startViewTransition == "function")
|
|
4766
|
-
return
|
|
4780
|
+
return Lr(r, s, o);
|
|
4767
4781
|
const a = s.duration ?? 0.35, c = s.ease ?? "power2.inOut", l = (g) => new Promise((y) => {
|
|
4768
4782
|
g(y) || y();
|
|
4769
|
-
}), h = o(), f = h.length ?
|
|
4783
|
+
}), h = o(), f = h.length ? he(t, h) : void 0, u = s.from !== void 0 ? Je(t, s.from, s.shared) : [];
|
|
4770
4784
|
if (u.length && s.leave !== !1) {
|
|
4771
|
-
const g = s.leave ??
|
|
4785
|
+
const g = s.leave ?? Ir;
|
|
4772
4786
|
await l((y) => i.to(u, { ...g, duration: a, ease: c, onComplete: y }));
|
|
4773
4787
|
}
|
|
4774
4788
|
await s.update();
|
|
4775
|
-
const d = [], m = typeof s.to == "function" ? s.to() : s.to, p = m !== void 0 ?
|
|
4789
|
+
const d = [], m = typeof s.to == "function" ? s.to() : s.to, p = m !== void 0 ? Je(t, m, s.shared) : [];
|
|
4776
4790
|
if (p.length && s.enter !== !1) {
|
|
4777
|
-
const g = s.enter ??
|
|
4778
|
-
d.push(l((y) => i.fromTo(p, g, { ...
|
|
4791
|
+
const g = s.enter ?? $r;
|
|
4792
|
+
d.push(l((y) => i.fromTo(p, g, { ...Bi(g), duration: a, ease: c, onComplete: y })));
|
|
4779
4793
|
}
|
|
4780
4794
|
if (f) {
|
|
4781
4795
|
const g = o().filter((y) => !h.includes(y));
|
|
4782
4796
|
g.length && d.push(
|
|
4783
4797
|
l(
|
|
4784
|
-
(y) =>
|
|
4798
|
+
(y) => ue(t, e, f, {
|
|
4785
4799
|
targets: g,
|
|
4786
4800
|
duration: a * 1.4,
|
|
4787
4801
|
ease: c,
|
|
@@ -4793,11 +4807,11 @@ async function Rr(i, t, e, s) {
|
|
|
4793
4807
|
}
|
|
4794
4808
|
await Promise.all(d);
|
|
4795
4809
|
}
|
|
4796
|
-
function
|
|
4810
|
+
function Je(i, t, e) {
|
|
4797
4811
|
const s = i.resolveTargets(t).map((n) => i.elementFor(n)).filter((n) => !!n);
|
|
4798
4812
|
return e ? s.flatMap((n) => !n.querySelector(e) && !n.matches(e) ? [n] : [...n.children].filter((r) => !r.matches(e) && !r.querySelector(e))) : s;
|
|
4799
4813
|
}
|
|
4800
|
-
async function
|
|
4814
|
+
async function Lr(i, t, e) {
|
|
4801
4815
|
const s = (a, c) => {
|
|
4802
4816
|
const l = a.dataset?.flipId;
|
|
4803
4817
|
l && a.style.setProperty("view-transition-name", c ? `tf-${l.replace(/[^\w-]/g, "-")}` : "");
|
|
@@ -4808,16 +4822,16 @@ async function Ir(i, t, e) {
|
|
|
4808
4822
|
n.forEach((a) => s(a, !1)), await t.update(), r = e(), r.forEach((a) => s(a, !0));
|
|
4809
4823
|
}).finished, r.forEach((a) => s(a, !1));
|
|
4810
4824
|
}
|
|
4811
|
-
const
|
|
4825
|
+
const Dr = {
|
|
4812
4826
|
/** Register a curve from SVG path data or bezier points. Returns the name. */
|
|
4813
|
-
create: (i, t) =>
|
|
4814
|
-
},
|
|
4827
|
+
create: (i, t) => me(i, sn(t))
|
|
4828
|
+
}, Or = {
|
|
4815
4829
|
/** Register a bouncing ease that lands and settles on the end value. Returns the name. */
|
|
4816
|
-
create: (i, t) =>
|
|
4817
|
-
},
|
|
4830
|
+
create: (i, t) => me(i, { fn: nn(t) })
|
|
4831
|
+
}, Br = {
|
|
4818
4832
|
/** Register a wiggle that swings around the start value and returns to it. Returns the name. */
|
|
4819
|
-
create: (i, t) =>
|
|
4820
|
-
},
|
|
4833
|
+
create: (i, t) => me(i, { fn: rn(t) })
|
|
4834
|
+
}, Nr = /* @__PURE__ */ new Set([
|
|
4821
4835
|
"keyframes",
|
|
4822
4836
|
"duration",
|
|
4823
4837
|
"delay",
|
|
@@ -4836,20 +4850,20 @@ const $r = {
|
|
|
4836
4850
|
"onRepeat",
|
|
4837
4851
|
"onReverseComplete",
|
|
4838
4852
|
"scrollTrigger"
|
|
4839
|
-
]),
|
|
4840
|
-
function
|
|
4853
|
+
]), ti = 0.5, qr = "power1.inOut";
|
|
4854
|
+
function Xr(i) {
|
|
4841
4855
|
return i.keyframes !== void 0 && i.keyframes !== null;
|
|
4842
4856
|
}
|
|
4843
|
-
function
|
|
4857
|
+
function Yr(i) {
|
|
4844
4858
|
const t = i.keyframes, e = {};
|
|
4845
|
-
for (const [l, h] of Object.entries(i))
|
|
4859
|
+
for (const [l, h] of Object.entries(i)) Nr.has(l) || (e[l] = h);
|
|
4846
4860
|
if (Array.isArray(t))
|
|
4847
4861
|
return t.map((l) => ({
|
|
4848
4862
|
...e,
|
|
4849
4863
|
...l,
|
|
4850
|
-
duration: l.duration ?? i.duration ??
|
|
4864
|
+
duration: l.duration ?? i.duration ?? ti
|
|
4851
4865
|
}));
|
|
4852
|
-
const s = Object.entries(t), n = i.duration ??
|
|
4866
|
+
const s = Object.entries(t), n = i.duration ?? ti, r = t.easeEach ?? i.easeEach ?? qr;
|
|
4853
4867
|
if (s.length > 0 && s.every(([l]) => /^\s*-?\d+(\.\d+)?\s*%\s*$/.test(l) || l === "easeEach")) {
|
|
4854
4868
|
const l = s.filter(([u]) => u !== "easeEach").map(([u, d]) => ({ at: Number.parseFloat(u) / 100, step: d })).sort((u, d) => u.at - d.at), h = [];
|
|
4855
4869
|
let f = 0;
|
|
@@ -4868,21 +4882,21 @@ function Nr(i) {
|
|
|
4868
4882
|
}
|
|
4869
4883
|
return c;
|
|
4870
4884
|
}
|
|
4871
|
-
function
|
|
4885
|
+
function ei(i, t, e, s = {}) {
|
|
4872
4886
|
const n = t.collector?.scope ?? t.root, r = typeof s.scroller == "string" ? n.querySelector(s.scroller) : s.scroller ?? null, o = {
|
|
4873
4887
|
x: r ? r.scrollLeft : window.scrollX,
|
|
4874
4888
|
y: r ? r.scrollTop : window.scrollY
|
|
4875
4889
|
}, a = {
|
|
4876
4890
|
x: r ? r.scrollWidth - r.clientWidth : document.documentElement.scrollWidth - window.innerWidth,
|
|
4877
4891
|
y: r ? r.scrollHeight - r.clientHeight : document.documentElement.scrollHeight - window.innerHeight
|
|
4878
|
-
}, c = (b,
|
|
4879
|
-
if (
|
|
4880
|
-
if (typeof
|
|
4881
|
-
if (
|
|
4882
|
-
const
|
|
4883
|
-
if (!
|
|
4884
|
-
const
|
|
4885
|
-
return b === "x" ?
|
|
4892
|
+
}, c = (b, v) => {
|
|
4893
|
+
if (v === void 0) return o[b];
|
|
4894
|
+
if (typeof v == "number") return v;
|
|
4895
|
+
if (v === "max") return a[b];
|
|
4896
|
+
const T = typeof v == "string" ? n.querySelector(v) : v;
|
|
4897
|
+
if (!T) return o[b];
|
|
4898
|
+
const w = T.getBoundingClientRect(), x = r?.getBoundingClientRect(), S = (b === "x" ? s.offsetX : s.offsetY) ?? s.offset ?? 0;
|
|
4899
|
+
return b === "x" ? w.left - (x?.left ?? 0) + o.x - S : w.top - (x?.top ?? 0) + o.y - S;
|
|
4886
4900
|
}, l = typeof e == "object" && e !== null && !("nodeType" in e) ? { x: c("x", e.x), y: c("y", e.y) } : { x: o.x, y: c("y", e) }, h = { x: Math.max(0, Math.min(a.x, l.x)), y: Math.max(0, Math.min(a.y, l.y)) }, f = { ...o }, u = () => {
|
|
4887
4901
|
r ? (r.scrollLeft = f.x, r.scrollTop = f.y) : window.scrollTo({ left: f.x, top: f.y, behavior: "instant" });
|
|
4888
4902
|
}, d = ["wheel", "touchstart", "keydown"], m = r ?? window, p = () => {
|
|
@@ -4905,7 +4919,7 @@ function Qe(i, t, e, s = {}) {
|
|
|
4905
4919
|
if (s.autoKill !== !1) for (const b of d) m.addEventListener(b, p, { passive: !0 });
|
|
4906
4920
|
return y;
|
|
4907
4921
|
}
|
|
4908
|
-
function
|
|
4922
|
+
function Vr(i, t, e) {
|
|
4909
4923
|
const s = i.collector?.scope ?? i.root, n = typeof t == "string" ? [...s.querySelectorAll(t)] : "nodeType" in t ? [t] : Array.from(t), { interval: r = 0.1, batchMax: o, onEnter: a, onLeave: c, onEnterBack: l, onLeaveBack: h, ...f } = e, u = { onEnter: a, onLeave: c, onEnterBack: l, onLeaveBack: h }, d = { onEnter: [], onLeave: [], onEnterBack: [], onLeaveBack: [] }, m = {}, p = (y) => {
|
|
4910
4924
|
m[y] !== void 0 && clearTimeout(m[y]), m[y] = void 0;
|
|
4911
4925
|
const b = d[y].splice(0);
|
|
@@ -4917,7 +4931,7 @@ function Xr(i, t, e) {
|
|
|
4917
4931
|
}
|
|
4918
4932
|
};
|
|
4919
4933
|
return n.map(
|
|
4920
|
-
(y) =>
|
|
4934
|
+
(y) => be(i, {
|
|
4921
4935
|
...f,
|
|
4922
4936
|
trigger: y,
|
|
4923
4937
|
onEnter: () => g("onEnter", y),
|
|
@@ -4953,29 +4967,29 @@ class V {
|
|
|
4953
4967
|
/** Set by `reverse()`: arriving at the start is a reverse completion */
|
|
4954
4968
|
backwards = !1;
|
|
4955
4969
|
constructor(t, e = {}) {
|
|
4956
|
-
if (this.stage = t, this.options = e, this.compat = new
|
|
4970
|
+
if (this.stage = t, this.options = e, this.compat = new st({
|
|
4957
4971
|
...e,
|
|
4958
4972
|
startValue: (s, n) => {
|
|
4959
4973
|
const r = t.objectFor(s);
|
|
4960
|
-
if (r) return
|
|
4974
|
+
if (r) return zr(r[n]);
|
|
4961
4975
|
const o = t.appliedValue(s, n);
|
|
4962
4976
|
if (o !== void 0) return o;
|
|
4963
|
-
if (n === "d") return
|
|
4977
|
+
if (n === "d") return Li(t.elementFor(s)) ?? void 0;
|
|
4964
4978
|
if (n === "text") return t.elementFor(s)?.textContent ?? void 0;
|
|
4965
4979
|
if (n === "strokeDasharray" || n === "strokeDashoffset") {
|
|
4966
|
-
const a =
|
|
4980
|
+
const a = ni(t.elementFor(s));
|
|
4967
4981
|
if (a !== void 0) return n === "strokeDasharray" ? [a, a] : 0;
|
|
4968
4982
|
}
|
|
4969
4983
|
},
|
|
4970
4984
|
startVelocity: (s, n) => t.velocityOf(s, n),
|
|
4971
|
-
layoutColumns: (s) =>
|
|
4985
|
+
layoutColumns: (s) => si(s.map((n) => t.elementFor(n))),
|
|
4972
4986
|
random: () => t.utils.random(0, 1)
|
|
4973
4987
|
}), this.compat.timeline.onComplete = () => {
|
|
4974
4988
|
this.finishedThisFrame = !0;
|
|
4975
4989
|
}, t.collector?.track(this), t.liveTimelines.add(this), this.autoplayPending = !e.paused && !e.scrollTrigger, e.scrollTrigger) {
|
|
4976
4990
|
const s = e.scrollTrigger;
|
|
4977
4991
|
queueMicrotask(() => {
|
|
4978
|
-
this.killed || (this.scrollDriver =
|
|
4992
|
+
this.killed || (this.scrollDriver = be(t, s, this, this.firstElement, (n) => e.onWarning?.(n)));
|
|
4979
4993
|
});
|
|
4980
4994
|
}
|
|
4981
4995
|
this.autoplayPending && queueMicrotask(() => {
|
|
@@ -4992,7 +5006,7 @@ class V {
|
|
|
4992
5006
|
}
|
|
4993
5007
|
// --- building -----------------------------------------------------------
|
|
4994
5008
|
to(t, e, s) {
|
|
4995
|
-
return
|
|
5009
|
+
return Xr(e) ? this.record(() => this.keyframed(t, e, s)) : this.record(() => this.tween(t, [e], s, ([n], r, o) => this.compat.to(r, n, o)));
|
|
4996
5010
|
}
|
|
4997
5011
|
from(t, e, s) {
|
|
4998
5012
|
return this.record(() => this.tween(t, [e], s, ([n], r, o) => this.compat.from(r, n, o)));
|
|
@@ -5196,7 +5210,7 @@ class V {
|
|
|
5196
5210
|
/** Fire events and repeats between two playheads. Returns true if a pause stopped it. */
|
|
5197
5211
|
runCrossings(t, e, s) {
|
|
5198
5212
|
if (this.events.length === 0 && this.ranges.length === 0 && !this.options.onRepeat && !this.options.repeatRefresh) return !1;
|
|
5199
|
-
const n = this.events, { crossings: r, passes: o } =
|
|
5213
|
+
const n = this.events, { crossings: r, passes: o } = xi(
|
|
5200
5214
|
n.map((a) => a.time),
|
|
5201
5215
|
t,
|
|
5202
5216
|
e,
|
|
@@ -5249,14 +5263,14 @@ class V {
|
|
|
5249
5263
|
keyframed(t, e, s) {
|
|
5250
5264
|
const n = this.resolve(t);
|
|
5251
5265
|
if (!n) return;
|
|
5252
|
-
const r =
|
|
5266
|
+
const r = Yr(e);
|
|
5253
5267
|
if (r.length === 0) return;
|
|
5254
|
-
const o = n.length > 1 ?
|
|
5268
|
+
const o = n.length > 1 ? ce(e.stagger, this.staggerContext(n)) : void 0, a = n.map((g) => this.targetFor(g)).filter((g) => g !== void 0), c = o ? a.map((g) => [g]) : [a], l = o ? ie(n.length, o).map((g) => g / 1e3) : [0], h = this.compat.timeOf(s) / 1e3 + $t(e.delay, 0) / 1e3;
|
|
5255
5269
|
let f = 1 / 0, u = -1 / 0;
|
|
5256
5270
|
if (c.forEach((g, y) => {
|
|
5257
|
-
r.forEach((b,
|
|
5258
|
-
const
|
|
5259
|
-
this.tween(g, [b],
|
|
5271
|
+
r.forEach((b, v) => {
|
|
5272
|
+
const T = v === 0 ? h + l[y] : ">";
|
|
5273
|
+
this.tween(g, [b], T, ([w], x, S) => this.compat.to(x, w, S)), f = Math.min(f, this.compat.lastStart), u = Math.max(u, this.compat.lastEnd);
|
|
5260
5274
|
});
|
|
5261
5275
|
}), f === 1 / 0) return;
|
|
5262
5276
|
const { onStart: d, onUpdate: m, onComplete: p } = e;
|
|
@@ -5265,20 +5279,20 @@ class V {
|
|
|
5265
5279
|
staggerContext(t) {
|
|
5266
5280
|
return {
|
|
5267
5281
|
count: t.length,
|
|
5268
|
-
columnsFromLayout: () =>
|
|
5282
|
+
columnsFromLayout: () => si(t.map((e) => this.stage.elementFor(e))),
|
|
5269
5283
|
random: () => this.stage.utils.random(0, 1)
|
|
5270
5284
|
};
|
|
5271
5285
|
}
|
|
5272
5286
|
buildTween(t, e, s, n) {
|
|
5273
5287
|
const r = t.map((u) => this.targetFor(u));
|
|
5274
|
-
if (!(t.length > 1 && (e.some(
|
|
5288
|
+
if (!(t.length > 1 && (e.some(Ur) || t.some((u) => this.stage.objectFor(u) !== void 0)))) {
|
|
5275
5289
|
const u = this.targetFor(t[0]);
|
|
5276
|
-
n(e.map((d) => this.prepare(
|
|
5290
|
+
n(e.map((d) => this.prepare(ii(d, 0, u, this.stage.utils, r), t)), t, s);
|
|
5277
5291
|
return;
|
|
5278
5292
|
}
|
|
5279
|
-
const a = e.length - 1, { stagger: c, ...l } = e[a], h =
|
|
5293
|
+
const a = e.length - 1, { stagger: c, ...l } = e[a], h = ce(c, this.staggerContext(t)), f = h ? ie(t.length, h).map((u) => u / 1e3) : t.map(() => 0);
|
|
5280
5294
|
t.forEach((u, d) => {
|
|
5281
|
-
const m = d === 0 ?
|
|
5295
|
+
const m = d === 0 ? $t(l.delay, 0) / 1e3 + f[0] : 0, p = d === 0 ? 0 : f[d] - f[d - 1], g = d === 0 ? s : `<${p < 0 ? "-" : "+"}${Math.abs(p).toFixed(6)}`, b = e.map((v, T) => T === a ? { ...l, delay: m } : v).map((v) => this.prepare(ii(v, d, this.targetFor(u), this.stage.utils, r), [u]));
|
|
5282
5296
|
n(b, [u], g);
|
|
5283
5297
|
});
|
|
5284
5298
|
}
|
|
@@ -5294,7 +5308,7 @@ class V {
|
|
|
5294
5308
|
const s = (o) => this.options.onWarning?.(o), n = (o) => this.stage.query(o);
|
|
5295
5309
|
let r = t;
|
|
5296
5310
|
if (t.motionPath !== void 0) {
|
|
5297
|
-
const o =
|
|
5311
|
+
const o = zn(t.motionPath, {
|
|
5298
5312
|
query: n,
|
|
5299
5313
|
targets: e.map((a) => this.stage.elementFor(a)).filter((a) => !!a),
|
|
5300
5314
|
warn: s
|
|
@@ -5302,32 +5316,32 @@ class V {
|
|
|
5302
5316
|
r = { ...r, motionPath: o };
|
|
5303
5317
|
}
|
|
5304
5318
|
if (t.morphSVG !== void 0) {
|
|
5305
|
-
const o =
|
|
5319
|
+
const o = Hn(t.morphSVG, n, s), { morphSVG: a, ...c } = r;
|
|
5306
5320
|
r = o ? { ...r, morphSVG: o } : c;
|
|
5307
5321
|
}
|
|
5308
5322
|
if (t.drawSVG !== void 0) {
|
|
5309
|
-
const o =
|
|
5323
|
+
const o = ni(this.stage.elementFor(e[0]));
|
|
5310
5324
|
if (o === void 0) {
|
|
5311
5325
|
s("gsap-compat: drawSVG needs an SVG shape with a stroke (path, line, circle…)");
|
|
5312
5326
|
const { drawSVG: a, ...c } = r;
|
|
5313
5327
|
r = c;
|
|
5314
5328
|
} else
|
|
5315
|
-
r =
|
|
5329
|
+
r = kn(r, o);
|
|
5316
5330
|
}
|
|
5317
5331
|
return r;
|
|
5318
5332
|
}
|
|
5319
5333
|
resolve(t) {
|
|
5320
5334
|
const e = this.stage.resolveTargets(t);
|
|
5321
5335
|
if (e.length === 0) {
|
|
5322
|
-
this.options.onWarning?.(`gsap-compat: no elements found for target ${
|
|
5336
|
+
this.options.onWarning?.(`gsap-compat: no elements found for target ${Hr(t)}`);
|
|
5323
5337
|
return;
|
|
5324
5338
|
}
|
|
5325
5339
|
return this.firstElement ??= e.map((s) => this.stage.elementFor(s)).find((s) => s !== void 0), e;
|
|
5326
5340
|
}
|
|
5327
5341
|
}
|
|
5328
|
-
function
|
|
5342
|
+
function Wr(i = new Vn()) {
|
|
5329
5343
|
const t = (r) => {
|
|
5330
|
-
const { config: o } =
|
|
5344
|
+
const { config: o } = Pt(r);
|
|
5331
5345
|
return new V(i, {
|
|
5332
5346
|
repeat: o.repeat,
|
|
5333
5347
|
yoyo: o.yoyo,
|
|
@@ -5352,31 +5366,31 @@ function Yr(i = new Xn()) {
|
|
|
5352
5366
|
const [a] = i.resolveTargets(r);
|
|
5353
5367
|
if (a === void 0) return;
|
|
5354
5368
|
const c = i.objectFor(a);
|
|
5355
|
-
return c ? c[o] : i.appliedValue(a, o) ??
|
|
5369
|
+
return c ? c[o] : i.appliedValue(a, o) ?? Ri(o);
|
|
5356
5370
|
},
|
|
5357
|
-
scrollTrigger: (r) => s(
|
|
5358
|
-
scrollBatch: (r, o) =>
|
|
5359
|
-
scrollTo: (r, o) =>
|
|
5371
|
+
scrollTrigger: (r) => s(be(i, r)),
|
|
5372
|
+
scrollBatch: (r, o) => Vr(i, r, o).map((a) => s(a)),
|
|
5373
|
+
scrollTo: (r, o) => ei(n, i, r, o),
|
|
5360
5374
|
refreshScroll: () => {
|
|
5361
|
-
|
|
5375
|
+
qt.refreshAll(), Qe.refreshAll();
|
|
5362
5376
|
},
|
|
5363
5377
|
smoothScroll: (r = {}) => {
|
|
5364
5378
|
const o = typeof r.scroller == "string" ? (i.collector?.scope ?? i.root).querySelector(r.scroller) : r.scroller;
|
|
5365
|
-
return s(new
|
|
5379
|
+
return s(new Qe({ ...r, scroller: o }).start());
|
|
5366
5380
|
},
|
|
5367
5381
|
context: (r, o) => {
|
|
5368
|
-
const a = new
|
|
5382
|
+
const a = new Yi(i, o);
|
|
5369
5383
|
return r && a.add(() => r(a)), a;
|
|
5370
5384
|
},
|
|
5371
|
-
matchMedia: (r) => new
|
|
5372
|
-
customEase:
|
|
5373
|
-
customBounce:
|
|
5374
|
-
customWiggle:
|
|
5375
|
-
pageTransition: (r) =>
|
|
5385
|
+
matchMedia: (r) => new Cr(i, r),
|
|
5386
|
+
customEase: Dr.create,
|
|
5387
|
+
customBounce: Or.create,
|
|
5388
|
+
customWiggle: Br.create,
|
|
5389
|
+
pageTransition: (r) => Fr(n, i, (o) => new V(i, o), r),
|
|
5376
5390
|
imageSequence: (r, o) => {
|
|
5377
5391
|
const a = typeof r == "string" ? (i.collector?.scope ?? i.root).querySelector(r) : r;
|
|
5378
5392
|
if (!(a instanceof HTMLCanvasElement)) throw new Error(`gsap-compat: imageSequence needs a <canvas>, got ${String(r)}`);
|
|
5379
|
-
return s(new
|
|
5393
|
+
return s(new Rr(a, o));
|
|
5380
5394
|
},
|
|
5381
5395
|
quickTo: (r, o, a = {}) => {
|
|
5382
5396
|
const c = new V(i, { paused: !0 }), [l] = i.resolveTargets(r);
|
|
@@ -5387,7 +5401,7 @@ function Yr(i = new Xn()) {
|
|
|
5387
5401
|
[o]: f,
|
|
5388
5402
|
duration: a.duration ?? 0.4,
|
|
5389
5403
|
ease: a.ease ?? "power3.out",
|
|
5390
|
-
...a.spring !== void 0 && { spring:
|
|
5404
|
+
...a.spring !== void 0 && { spring: jr(a.spring, o, u) }
|
|
5391
5405
|
}), c.timeline.stop(), c.timeline.play(), i.activate(c.timeline);
|
|
5392
5406
|
}, { tween: c, kill: () => c.kill() });
|
|
5393
5407
|
},
|
|
@@ -5396,7 +5410,7 @@ function Yr(i = new Xn()) {
|
|
|
5396
5410
|
to: (r, o) => {
|
|
5397
5411
|
if (o.scrollTo !== void 0) {
|
|
5398
5412
|
const { scrollTo: a, ...c } = o, l = typeof a == "object" && a !== null && !("nodeType" in a) ? a : {}, h = typeof r != "string" && r !== window && r.nodeType === 1;
|
|
5399
|
-
return
|
|
5413
|
+
return ei(n, i, a, {
|
|
5400
5414
|
...c,
|
|
5401
5415
|
offsetX: l.offsetX,
|
|
5402
5416
|
offsetY: l.offsetY,
|
|
@@ -5413,39 +5427,39 @@ function Yr(i = new Xn()) {
|
|
|
5413
5427
|
const a = i.resolveTargets(r), c = typeof o == "string" ? o.split(",").map((l) => l.trim()).filter(Boolean) : o;
|
|
5414
5428
|
for (const l of [...i.liveTimelines]) l.killTweensOf(a, c);
|
|
5415
5429
|
},
|
|
5416
|
-
convertToPath: (r) =>
|
|
5430
|
+
convertToPath: (r) => Kn(r, i.root),
|
|
5417
5431
|
splitText: (r, o) => {
|
|
5418
5432
|
const a = i.collector?.scope ?? i.root, c = typeof r == "string" ? Array.from(a.querySelectorAll(r)) : "nodeType" in r ? [r] : Array.from(r);
|
|
5419
|
-
return s(
|
|
5433
|
+
return s(or(c, o));
|
|
5420
5434
|
},
|
|
5421
|
-
draggable: (r, o) => s(
|
|
5422
|
-
getFlipState: (r) =>
|
|
5423
|
-
flipFrom: (r, o) =>
|
|
5435
|
+
draggable: (r, o) => s(ir(n, i, r, o)),
|
|
5436
|
+
getFlipState: (r) => he(i, r),
|
|
5437
|
+
flipFrom: (r, o) => ue(i, (a) => new V(i, a), r, o),
|
|
5424
5438
|
flip: (r, o, a) => {
|
|
5425
|
-
const c =
|
|
5426
|
-
return o(),
|
|
5439
|
+
const c = he(i, r);
|
|
5440
|
+
return o(), ue(i, (l) => new V(i, l), c, { targets: r, ...a });
|
|
5427
5441
|
}
|
|
5428
5442
|
};
|
|
5429
5443
|
return n;
|
|
5430
5444
|
}
|
|
5431
|
-
const
|
|
5432
|
-
function
|
|
5445
|
+
const B = /* @__PURE__ */ Wr();
|
|
5446
|
+
function jr(i, t, e) {
|
|
5433
5447
|
return i === !0 ? { velocity: { [t]: e } } : typeof i == "string" ? { preset: i, velocity: { [t]: e } } : { ...i, velocity: { [t]: e } };
|
|
5434
5448
|
}
|
|
5435
|
-
function
|
|
5436
|
-
return i.morphSVG !== void 0 || i.drawSVG !== void 0 || i.text !== void 0 || i.scrambleText !== void 0 ||
|
|
5449
|
+
function Ur(i) {
|
|
5450
|
+
return i.morphSVG !== void 0 || i.drawSVG !== void 0 || i.text !== void 0 || i.scrambleText !== void 0 || Vi(i);
|
|
5437
5451
|
}
|
|
5438
|
-
function
|
|
5439
|
-
return Object.entries(i).some(([t, e]) => (typeof e == "function" ||
|
|
5452
|
+
function Vi(i) {
|
|
5453
|
+
return Object.entries(i).some(([t, e]) => (typeof e == "function" || Ci(e)) && !ge.has(t));
|
|
5440
5454
|
}
|
|
5441
|
-
function
|
|
5442
|
-
if (!
|
|
5455
|
+
function ii(i, t, e, s, n) {
|
|
5456
|
+
if (!Vi(i)) return i;
|
|
5443
5457
|
const r = {};
|
|
5444
5458
|
for (const [o, a] of Object.entries(i))
|
|
5445
|
-
|
|
5459
|
+
ge.has(o) ? r[o] = a : typeof a == "function" ? r[o] = a(t, e, n) : Ci(a) ? r[o] = s.resolveRandomString(a) : r[o] = a;
|
|
5446
5460
|
return r;
|
|
5447
5461
|
}
|
|
5448
|
-
function
|
|
5462
|
+
function si(i) {
|
|
5449
5463
|
const t = i.map((s) => s?.getBoundingClientRect().top);
|
|
5450
5464
|
if (t[0] === void 0) return i.length;
|
|
5451
5465
|
let e = 0;
|
|
@@ -5455,18 +5469,18 @@ function ti(i) {
|
|
|
5455
5469
|
}
|
|
5456
5470
|
return Math.max(1, e);
|
|
5457
5471
|
}
|
|
5458
|
-
function
|
|
5472
|
+
function ni(i) {
|
|
5459
5473
|
const t = i;
|
|
5460
5474
|
if (typeof t?.getTotalLength == "function")
|
|
5461
5475
|
return t.getTotalLength();
|
|
5462
5476
|
}
|
|
5463
|
-
function
|
|
5477
|
+
function zr(i) {
|
|
5464
5478
|
if (typeof i == "number" || typeof i == "string" || Array.isArray(i) && i.every((t) => typeof t == "number")) return i;
|
|
5465
5479
|
}
|
|
5466
|
-
function
|
|
5480
|
+
function Hr(i) {
|
|
5467
5481
|
return typeof i == "string" ? `"${i}"` : String(i);
|
|
5468
5482
|
}
|
|
5469
|
-
class
|
|
5483
|
+
class ri {
|
|
5470
5484
|
media;
|
|
5471
5485
|
offset;
|
|
5472
5486
|
driftTolerance;
|
|
@@ -5505,7 +5519,7 @@ class ii {
|
|
|
5505
5519
|
});
|
|
5506
5520
|
}
|
|
5507
5521
|
}
|
|
5508
|
-
function
|
|
5522
|
+
function Gr(i, t, e, s, n) {
|
|
5509
5523
|
const r = e - n;
|
|
5510
5524
|
if (r < 0) {
|
|
5511
5525
|
t.paused || t.pause(), t.currentTime = 0;
|
|
@@ -5513,7 +5527,7 @@ function Ur(i, t, e, s, n) {
|
|
|
5513
5527
|
}
|
|
5514
5528
|
i.update(r, s);
|
|
5515
5529
|
}
|
|
5516
|
-
class
|
|
5530
|
+
class ve {
|
|
5517
5531
|
container;
|
|
5518
5532
|
timeline = null;
|
|
5519
5533
|
adapter;
|
|
@@ -5549,7 +5563,7 @@ class Xi {
|
|
|
5549
5563
|
this.container = s;
|
|
5550
5564
|
} else
|
|
5551
5565
|
this.container = t;
|
|
5552
|
-
this.options = e, this.adapter = new
|
|
5566
|
+
this.options = e, this.adapter = new K();
|
|
5553
5567
|
}
|
|
5554
5568
|
/**
|
|
5555
5569
|
* Load animation from a URL or JSON object.
|
|
@@ -5563,7 +5577,7 @@ class Xi {
|
|
|
5563
5577
|
e = await s.json();
|
|
5564
5578
|
} else
|
|
5565
5579
|
e = t;
|
|
5566
|
-
this.options.speed !== void 0 && (e.config = { ...e.config, speed: this.options.speed }), this.options.loop !== void 0 && (e.config = { ...e.config, loop: this.options.loop }), this.options.alternate !== void 0 && (e.config = { ...e.config, alternate: this.options.alternate }), this.timeline =
|
|
5580
|
+
this.options.speed !== void 0 && (e.config = { ...e.config, speed: this.options.speed }), this.options.loop !== void 0 && (e.config = { ...e.config, loop: this.options.loop }), this.options.alternate !== void 0 && (e.config = { ...e.config, alternate: this.options.alternate }), this.timeline = mt(e), this.markerList = this.timeline.markers, this.lastMarkerId = null, this.options.onComplete && (this.timeline.onComplete = this.options.onComplete), this.options.onUpdate && (this.timeline.onUpdate = this.options.onUpdate), this.autoRegisterTargets(), this.setupSymbolInstances(), this.scanMedia(), this.showInitialFrame(), this.watchReducedMotion(), this.watchVisibility(), this.options.autoplay && !this.reducedMotion && (this.options.playWhenVisible && !this.onScreen ? this.autoplayWhenSeen = !0 : this.play());
|
|
5567
5581
|
}
|
|
5568
5582
|
// --- teaching: frames, markers, reduced motion, visibility -----------------
|
|
5569
5583
|
/**
|
|
@@ -5673,13 +5687,13 @@ class Xi {
|
|
|
5673
5687
|
scanMedia() {
|
|
5674
5688
|
this.mediaTargets = [], this.container.querySelectorAll("[data-tinyfly-media]").forEach((e) => {
|
|
5675
5689
|
const s = e, n = Number(s.getAttribute("data-tinyfly-start") ?? "0") || 0, r = s.getAttribute("data-volume");
|
|
5676
|
-
r !== null && (s.volume = Math.max(0, Math.min(1, Number(r) || 0))), this.mediaTargets.push({ el: s, startTime: n, sync: new
|
|
5690
|
+
r !== null && (s.volume = Math.max(0, Math.min(1, Number(r) || 0))), this.mediaTargets.push({ el: s, startTime: n, sync: new ri(s) });
|
|
5677
5691
|
});
|
|
5678
5692
|
}
|
|
5679
5693
|
/** Sync all discovered media targets to a timeline time. */
|
|
5680
5694
|
syncAllMedia(t, e) {
|
|
5681
5695
|
for (const s of this.mediaTargets)
|
|
5682
|
-
|
|
5696
|
+
Gr(s.sync, s.el, t, e, s.startTime);
|
|
5683
5697
|
}
|
|
5684
5698
|
/**
|
|
5685
5699
|
* Load animation from inline JSON string.
|
|
@@ -5729,11 +5743,11 @@ class Xi {
|
|
|
5729
5743
|
if (!n) return;
|
|
5730
5744
|
const r = e.get(n);
|
|
5731
5745
|
if (!r || !r.timeline.tracks?.length) return;
|
|
5732
|
-
const o = new
|
|
5746
|
+
const o = new K();
|
|
5733
5747
|
s.querySelectorAll("[data-tinyfly]").forEach((a) => {
|
|
5734
5748
|
const c = a.getAttribute("data-tinyfly");
|
|
5735
5749
|
c && o.registerTarget(c, a);
|
|
5736
|
-
}), this.symbolInstances.push({ adapter: o, timeline:
|
|
5750
|
+
}), this.symbolInstances.push({ adapter: o, timeline: mt(r.timeline) });
|
|
5737
5751
|
});
|
|
5738
5752
|
}
|
|
5739
5753
|
/**
|
|
@@ -5743,7 +5757,7 @@ class Xi {
|
|
|
5743
5757
|
* plays. Pass `{ offset }` to start the media at a timeline offset.
|
|
5744
5758
|
*/
|
|
5745
5759
|
attachMedia(t, e) {
|
|
5746
|
-
this.mediaSync = new
|
|
5760
|
+
this.mediaSync = new ri(t, e), this.timeline && (this.mediaSync.setRate(this.timeline.speed), this.mediaSync.update(this.timeline.currentTime, this.isPlaying));
|
|
5747
5761
|
}
|
|
5748
5762
|
/** Detach and pause the currently synced media, if any. */
|
|
5749
5763
|
detachMedia() {
|
|
@@ -5842,7 +5856,7 @@ class Xi {
|
|
|
5842
5856
|
this.playhead = s;
|
|
5843
5857
|
const n = this.markers;
|
|
5844
5858
|
if (n.length === 0) return;
|
|
5845
|
-
const { crossings: r } =
|
|
5859
|
+
const { crossings: r } = xi(
|
|
5846
5860
|
n.map((o) => o.time),
|
|
5847
5861
|
t,
|
|
5848
5862
|
s,
|
|
@@ -5870,14 +5884,203 @@ class Xi {
|
|
|
5870
5884
|
}
|
|
5871
5885
|
}
|
|
5872
5886
|
}
|
|
5873
|
-
async function
|
|
5874
|
-
const s = new
|
|
5887
|
+
async function Io(i, t, e = {}) {
|
|
5888
|
+
const s = new ve(i, { ...e, autoplay: !0 });
|
|
5875
5889
|
return await s.load(t), s;
|
|
5876
5890
|
}
|
|
5877
|
-
function
|
|
5878
|
-
return new
|
|
5891
|
+
function $o(i, t = {}) {
|
|
5892
|
+
return new ve(i, t);
|
|
5893
|
+
}
|
|
5894
|
+
const Kr = {
|
|
5895
|
+
play: "Play",
|
|
5896
|
+
pause: "Pause",
|
|
5897
|
+
prev: "Previous step",
|
|
5898
|
+
next: "Next step",
|
|
5899
|
+
restart: "Restart",
|
|
5900
|
+
scrub: "Position",
|
|
5901
|
+
speed: "Speed",
|
|
5902
|
+
reveal: "Reveal",
|
|
5903
|
+
step: "Step",
|
|
5904
|
+
of: "of",
|
|
5905
|
+
stepFormat: "{index} / {total}"
|
|
5906
|
+
}, oi = "tinyfly-controls-style", Zr = `
|
|
5907
|
+
.tf-ctl { --tf-ctl-fg: #1d1d1f; --tf-ctl-bg: #f4f2ee; --tf-ctl-accent: #c2410c; --tf-ctl-radius: 8px;
|
|
5908
|
+
font: 14px/1.4 var(--tf-ctl-font, system-ui, sans-serif); color: var(--tf-ctl-fg); margin-top: 8px; }
|
|
5909
|
+
.tf-ctl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; border-radius: var(--tf-ctl-radius); background: var(--tf-ctl-bg); }
|
|
5910
|
+
.tf-ctl-btn { min-width: 36px; height: 36px; padding: 0 10px; border: 0; border-radius: calc(var(--tf-ctl-radius) - 2px); background: transparent; color: inherit; font: inherit; cursor: pointer; }
|
|
5911
|
+
.tf-ctl-btn:hover { background: color-mix(in srgb, var(--tf-ctl-fg) 8%, transparent); }
|
|
5912
|
+
.tf-ctl-btn:focus-visible, .tf-ctl-scrub:focus-visible, .tf-ctl-speed:focus-visible { outline: 2px solid var(--tf-ctl-accent); outline-offset: 2px; }
|
|
5913
|
+
.tf-ctl-btn[disabled] { opacity: 0.4; cursor: default; }
|
|
5914
|
+
.tf-ctl-primary { background: var(--tf-ctl-accent); color: #fff; }
|
|
5915
|
+
.tf-ctl-primary:hover { background: var(--tf-ctl-accent); filter: brightness(1.08); }
|
|
5916
|
+
.tf-ctl-scrub { flex: 1 1 120px; min-width: 80px; accent-color: var(--tf-ctl-accent); }
|
|
5917
|
+
.tf-ctl-speed { height: 32px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; }
|
|
5918
|
+
.tf-ctl-step { font-variant-numeric: tabular-nums; opacity: 0.75; padding: 0 4px; }
|
|
5919
|
+
.tf-ctl-caption { margin: 6px 2px 0; min-height: 1.4em; }
|
|
5920
|
+
.tf-ctl-question { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 2px 0; font-weight: 600; }
|
|
5921
|
+
.tf-ctl-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
5922
|
+
/* The hidden attribute only hides through the browser's default stylesheet; any rule
|
|
5923
|
+
above that sets display would override it, so enforce it for everything here. */
|
|
5924
|
+
.tf-ctl [hidden] { display: none !important; }
|
|
5925
|
+
`;
|
|
5926
|
+
function Qr(i) {
|
|
5927
|
+
if (i.getElementById(oi)) return;
|
|
5928
|
+
const t = i.createElement("style");
|
|
5929
|
+
t.id = oi, t.textContent = Zr, i.head.appendChild(t);
|
|
5930
|
+
}
|
|
5931
|
+
function Jr(i, t, e = {}) {
|
|
5932
|
+
const s = t.ownerDocument;
|
|
5933
|
+
Qr(s);
|
|
5934
|
+
const n = { ...Kr, ...e.labels }, r = e.speeds ?? [0.5, 1, 2], o = () => i.markers.length > 0, a = () => i.markers.some((k) => k.label !== void 0 || i.caption(k.id) !== void 0), c = s.createElement("div");
|
|
5935
|
+
c.className = "tf-ctl";
|
|
5936
|
+
const l = s.createElement("div");
|
|
5937
|
+
l.className = "tf-ctl-bar", l.setAttribute("role", "group");
|
|
5938
|
+
const h = (k, P, C, $ = "") => {
|
|
5939
|
+
const R = s.createElement("button");
|
|
5940
|
+
return R.type = "button", R.className = `tf-ctl-btn ${$}`.trim(), R.setAttribute("aria-label", k), R.title = k, R.textContent = P, R.addEventListener("click", C), R;
|
|
5941
|
+
}, f = h(n.restart, "⟲", () => {
|
|
5942
|
+
i.pause(), i.seek(0);
|
|
5943
|
+
}), u = h(n.prev, "◀", () => i.prev()), d = h(n.play, "▶", () => i.isPlaying ? i.pause() : p(), "tf-ctl-primary"), m = h(n.next, "▶|", () => i.next()), p = () => {
|
|
5944
|
+
i.currentTime >= i.duration - 0.5 && i.seek(0), i.play();
|
|
5945
|
+
}, g = s.createElement("input");
|
|
5946
|
+
g.type = "range", g.className = "tf-ctl-scrub", g.min = "0", g.max = "1000", g.step = "1", g.setAttribute("aria-label", n.scrub), g.addEventListener("input", () => {
|
|
5947
|
+
i.pause(), i.seek(Number(g.value) / 1e3 * i.duration);
|
|
5948
|
+
});
|
|
5949
|
+
const y = s.createElement("span");
|
|
5950
|
+
y.className = "tf-ctl-step";
|
|
5951
|
+
const b = s.createElement("select");
|
|
5952
|
+
b.className = "tf-ctl-speed", b.setAttribute("aria-label", n.speed);
|
|
5953
|
+
for (const k of r) {
|
|
5954
|
+
const P = s.createElement("option");
|
|
5955
|
+
P.value = String(k), P.textContent = `${k}×`, k === 1 && (P.selected = !0), b.appendChild(P);
|
|
5956
|
+
}
|
|
5957
|
+
b.addEventListener("change", () => i.setSpeed(Number(b.value))), l.append(f, u, d, m, g, y), r.length > 0 && l.append(b), c.append(l);
|
|
5958
|
+
const v = s.createElement("p");
|
|
5959
|
+
v.className = "tf-ctl-caption", v.setAttribute("aria-live", "polite"), e.captions !== !1 && c.append(v);
|
|
5960
|
+
const T = s.createElement("div");
|
|
5961
|
+
T.className = "tf-ctl-question", T.hidden = !0;
|
|
5962
|
+
const w = s.createElement("span"), x = h(n.reveal, n.reveal, () => i.play(), "tf-ctl-primary");
|
|
5963
|
+
T.append(w, x), c.append(T);
|
|
5964
|
+
const S = e.mount;
|
|
5965
|
+
S ? S.appendChild(c) : t.insertAdjacentElement("afterend", c);
|
|
5966
|
+
const _ = () => {
|
|
5967
|
+
const k = i.isPlaying;
|
|
5968
|
+
d.textContent = k ? "❚❚" : "▶", d.setAttribute("aria-label", k ? n.pause : n.play), d.title = k ? n.pause : n.play;
|
|
5969
|
+
const P = i.duration;
|
|
5970
|
+
s.activeElement !== g && (g.value = String(P > 0 ? Math.round(i.currentTime / P * 1e3) : 0));
|
|
5971
|
+
const C = i.markers;
|
|
5972
|
+
if (u.hidden = m.hidden = y.hidden = C.length === 0, C.length > 0) {
|
|
5973
|
+
const $ = i.currentMarker, R = $ ? C.indexOf($) + 1 : 0;
|
|
5974
|
+
y.textContent = n.stepFormat.replace("{index}", String(R)).replace("{total}", String(C.length)), y.setAttribute("aria-label", `${n.step} ${R} ${n.of} ${C.length}`), u.disabled = i.currentTime <= 0.5, m.disabled = i.currentTime >= P - 0.5;
|
|
5975
|
+
const j = i.caption() ?? "";
|
|
5976
|
+
v.textContent !== j && (v.textContent = j), v.hidden = !a();
|
|
5977
|
+
const H = !k && $?.question !== void 0 && Math.abs(i.currentTime - $.time) < 1;
|
|
5978
|
+
T.hidden = !H, H && w.textContent !== $.question && (w.textContent = $.question);
|
|
5979
|
+
} else
|
|
5980
|
+
T.hidden = !0, v.hidden = !0;
|
|
5981
|
+
}, L = i.subscribe(_);
|
|
5982
|
+
_();
|
|
5983
|
+
const A = e.keyboardScope ?? t;
|
|
5984
|
+
!A.hasAttribute("tabindex") && A.tabIndex < 0 && (A.tabIndex = 0);
|
|
5985
|
+
const M = /* @__PURE__ */ new WeakSet(), E = (k) => {
|
|
5986
|
+
if (M.has(k) || (M.add(k), k.defaultPrevented || k.altKey || k.ctrlKey || k.metaKey)) return;
|
|
5987
|
+
const P = k.target;
|
|
5988
|
+
if (!(P.tagName === "INPUT" || P.tagName === "SELECT") && !(k.key === " " && P.tagName === "BUTTON"))
|
|
5989
|
+
switch (k.key) {
|
|
5990
|
+
case " ":
|
|
5991
|
+
k.preventDefault(), i.isPlaying ? i.pause() : p();
|
|
5992
|
+
break;
|
|
5993
|
+
case "ArrowRight":
|
|
5994
|
+
if (!o()) return;
|
|
5995
|
+
k.preventDefault(), i.next();
|
|
5996
|
+
break;
|
|
5997
|
+
case "ArrowLeft":
|
|
5998
|
+
if (!o()) return;
|
|
5999
|
+
k.preventDefault(), i.prev();
|
|
6000
|
+
break;
|
|
6001
|
+
case "Home":
|
|
6002
|
+
k.preventDefault(), i.pause(), i.seek(0);
|
|
6003
|
+
break;
|
|
6004
|
+
}
|
|
6005
|
+
};
|
|
6006
|
+
return A.addEventListener("keydown", E), c.addEventListener("keydown", E), {
|
|
6007
|
+
element: c,
|
|
6008
|
+
destroy() {
|
|
6009
|
+
L(), A.removeEventListener("keydown", E), c.removeEventListener("keydown", E), c.remove();
|
|
6010
|
+
}
|
|
6011
|
+
};
|
|
5879
6012
|
}
|
|
5880
|
-
|
|
6013
|
+
const Lt = /* @__PURE__ */ new WeakMap();
|
|
6014
|
+
let to = 0;
|
|
6015
|
+
function Mt(i, t, e) {
|
|
6016
|
+
if (i)
|
|
6017
|
+
try {
|
|
6018
|
+
return JSON.parse(i);
|
|
6019
|
+
} catch (s) {
|
|
6020
|
+
console.warn(`tinyfly: invalid ${t} JSON on`, e, s);
|
|
6021
|
+
return;
|
|
6022
|
+
}
|
|
6023
|
+
}
|
|
6024
|
+
async function eo(i, t = {}) {
|
|
6025
|
+
const e = Lt.get(i);
|
|
6026
|
+
if (e) return e;
|
|
6027
|
+
const s = i.querySelector("script[data-tinyfly-timeline]"), n = i.getAttribute("data-src");
|
|
6028
|
+
let r = s ? Mt(s.textContent, "timeline", i) : void 0;
|
|
6029
|
+
const o = io(i.getAttribute("data-markers"));
|
|
6030
|
+
if (!r && n && o) {
|
|
6031
|
+
const f = await fetch(n);
|
|
6032
|
+
f.ok && (r = await f.json());
|
|
6033
|
+
}
|
|
6034
|
+
if (r && o && !r.config.markers?.length && (r.config = { ...r.config, markers: o.map((f, u) => ({ id: `step-${u + 1}`, time: f })) }), !r && !n) {
|
|
6035
|
+
console.warn('tinyfly: embed has no timeline (a <script type="application/json" data-tinyfly-timeline> or data-src)', i);
|
|
6036
|
+
return;
|
|
6037
|
+
}
|
|
6038
|
+
const a = Mt(i.querySelector("script[data-tinyfly-captions]")?.textContent, "captions", i), c = {
|
|
6039
|
+
playWhenVisible: !0,
|
|
6040
|
+
...t.player,
|
|
6041
|
+
...a && { captions: a },
|
|
6042
|
+
...Mt(i.getAttribute("data-options"), "data-options", i)
|
|
6043
|
+
};
|
|
6044
|
+
no(i);
|
|
6045
|
+
const l = new ve(i, c), h = { element: i, player: l };
|
|
6046
|
+
if (Lt.set(i, h), i.setAttribute("data-tinyfly-mounted", ""), await l.load(r ?? n), i.getAttribute("data-controls") !== "false") {
|
|
6047
|
+
const f = Mt(i.getAttribute("data-labels"), "data-labels", i), u = i.querySelector("figcaption");
|
|
6048
|
+
h.controls = Jr(l, i, {
|
|
6049
|
+
...t.controls,
|
|
6050
|
+
labels: { ...t.controls?.labels, ...f },
|
|
6051
|
+
// Inside the figure, before its figcaption, so the caption stays last.
|
|
6052
|
+
mount: void 0
|
|
6053
|
+
}), u ? i.insertBefore(h.controls.element, u) : i.appendChild(h.controls.element);
|
|
6054
|
+
}
|
|
6055
|
+
return h;
|
|
6056
|
+
}
|
|
6057
|
+
function io(i) {
|
|
6058
|
+
if (!i) return;
|
|
6059
|
+
const t = i.split(/[\s,]+/).filter(Boolean).map(Number).filter((e) => Number.isFinite(e) && e >= 0).sort((e, s) => e - s);
|
|
6060
|
+
return t.length > 0 ? t : void 0;
|
|
6061
|
+
}
|
|
6062
|
+
async function so(i = document, t = {}) {
|
|
6063
|
+
const e = Array.from(i.querySelectorAll("[data-tinyfly-embed]"));
|
|
6064
|
+
return (await Promise.all(e.map((n) => eo(n, t)))).filter((n) => n !== void 0);
|
|
6065
|
+
}
|
|
6066
|
+
function Fo(i) {
|
|
6067
|
+
const t = Lt.get(i);
|
|
6068
|
+
t && (t.controls?.destroy(), t.player.destroy(), Lt.delete(i), i.removeAttribute("data-tinyfly-mounted"));
|
|
6069
|
+
}
|
|
6070
|
+
function no(i) {
|
|
6071
|
+
const t = i.querySelector("svg");
|
|
6072
|
+
if (!t || t.hasAttribute("role") || t.hasAttribute("aria-hidden")) return;
|
|
6073
|
+
const e = i.getAttribute("data-alt"), s = i.querySelector("figcaption");
|
|
6074
|
+
t.setAttribute("role", "img"), e ? t.setAttribute("aria-label", e) : s && (s.id ||= `tinyfly-caption-${++to}`, t.setAttribute("aria-labelledby", s.id));
|
|
6075
|
+
}
|
|
6076
|
+
function ro() {
|
|
6077
|
+
if (!(typeof document < "u" ? document.currentScript : null)?.hasAttribute("data-tinyfly-auto")) return;
|
|
6078
|
+
const t = () => {
|
|
6079
|
+
so();
|
|
6080
|
+
};
|
|
6081
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", t, { once: !0 }) : t();
|
|
6082
|
+
}
|
|
6083
|
+
class oo {
|
|
5881
6084
|
container;
|
|
5882
6085
|
containerA;
|
|
5883
6086
|
containerB;
|
|
@@ -5907,7 +6110,7 @@ class zr {
|
|
|
5907
6110
|
this.container = s;
|
|
5908
6111
|
} else
|
|
5909
6112
|
this.container = t;
|
|
5910
|
-
this.options = e, this.container.style.position = "relative", this.container.style.overflow = "hidden", this.containerA = this.createSceneContainer(), this.containerB = this.createSceneContainer(), this.container.appendChild(this.containerA), this.container.appendChild(this.containerB), this.containerB.style.visibility = "hidden", this.adapterA = new
|
|
6113
|
+
this.options = e, this.container.style.position = "relative", this.container.style.overflow = "hidden", this.containerA = this.createSceneContainer(), this.containerB = this.createSceneContainer(), this.container.appendChild(this.containerA), this.container.appendChild(this.containerB), this.containerB.style.visibility = "hidden", this.adapterA = new K(), this.adapterB = new K();
|
|
5911
6114
|
}
|
|
5912
6115
|
/**
|
|
5913
6116
|
* Load a sequence from a URL or inline definition.
|
|
@@ -6027,11 +6230,11 @@ class zr {
|
|
|
6027
6230
|
if (!r) return;
|
|
6028
6231
|
const o = this.symbolDefs.get(r);
|
|
6029
6232
|
if (!o) return;
|
|
6030
|
-
const a = new
|
|
6233
|
+
const a = new K();
|
|
6031
6234
|
n.querySelectorAll("[data-tinyfly]").forEach((c) => {
|
|
6032
6235
|
const l = c.getAttribute("data-tinyfly");
|
|
6033
6236
|
l && a.registerTarget(l, c);
|
|
6034
|
-
}), s.push({ adapter: a, timeline:
|
|
6237
|
+
}), s.push({ adapter: a, timeline: mt(o) });
|
|
6035
6238
|
}), s.length ? this.nestedByAdapter.set(e, s) : this.nestedByAdapter.delete(e);
|
|
6036
6239
|
}
|
|
6037
6240
|
/** Apply the nested symbol states for a slot at a given scene time. */
|
|
@@ -6047,7 +6250,7 @@ class zr {
|
|
|
6047
6250
|
t.innerHTML = "";
|
|
6048
6251
|
}
|
|
6049
6252
|
createTimeline(t) {
|
|
6050
|
-
return t.timeline ?
|
|
6253
|
+
return t.timeline ? mt(t.timeline) : null;
|
|
6051
6254
|
}
|
|
6052
6255
|
onSceneComplete() {
|
|
6053
6256
|
if (this._isDestroyed || !this.sequence) return;
|
|
@@ -6146,13 +6349,13 @@ class zr {
|
|
|
6146
6349
|
this.animationFrameId !== void 0 && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = void 0);
|
|
6147
6350
|
}
|
|
6148
6351
|
}
|
|
6149
|
-
async function
|
|
6150
|
-
const s = new
|
|
6352
|
+
async function Lo(i, t, e = {}) {
|
|
6353
|
+
const s = new oo(i, { ...e, autoplay: !0 });
|
|
6151
6354
|
return await s.load(t), s;
|
|
6152
6355
|
}
|
|
6153
|
-
const
|
|
6154
|
-
function
|
|
6155
|
-
const { timeline: t } = i, e = new
|
|
6356
|
+
const Do = { type: "none", duration: 0 };
|
|
6357
|
+
function Oo(i) {
|
|
6358
|
+
const { timeline: t } = i, e = new K();
|
|
6156
6359
|
for (const [l, h] of Object.entries(i.targets)) {
|
|
6157
6360
|
const f = typeof h == "string" ? document.querySelector(h) : h;
|
|
6158
6361
|
if (!f)
|
|
@@ -6192,181 +6395,187 @@ function So(i) {
|
|
|
6192
6395
|
}
|
|
6193
6396
|
};
|
|
6194
6397
|
}
|
|
6195
|
-
const
|
|
6196
|
-
timeline:
|
|
6398
|
+
const Bo = {
|
|
6399
|
+
timeline: Cn,
|
|
6197
6400
|
to(i, t, e) {
|
|
6198
|
-
const s = new
|
|
6401
|
+
const s = new st(e);
|
|
6199
6402
|
return s.to(i, t), s;
|
|
6200
6403
|
},
|
|
6201
6404
|
from(i, t, e) {
|
|
6202
|
-
const s = new
|
|
6405
|
+
const s = new st(e);
|
|
6203
6406
|
return s.from(i, t), s;
|
|
6204
6407
|
},
|
|
6205
6408
|
fromTo(i, t, e, s) {
|
|
6206
|
-
const n = new
|
|
6409
|
+
const n = new st(s);
|
|
6207
6410
|
return n.fromTo(i, t, e), n;
|
|
6208
6411
|
},
|
|
6209
6412
|
set(i, t, e) {
|
|
6210
|
-
const s = new
|
|
6413
|
+
const s = new st(e);
|
|
6211
6414
|
return s.set(i, t), s;
|
|
6212
6415
|
}
|
|
6213
|
-
},
|
|
6416
|
+
}, No = B.to, qo = B.from, Xo = B.fromTo, Yo = B.set, Vo = B.timeline, Wo = B.ticker, jo = B.splitText, Uo = B.context, zo = B.matchMedia, Ho = B.quickTo, Go = B.imageSequence, Ko = B.pageTransition;
|
|
6417
|
+
ro();
|
|
6214
6418
|
export {
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6419
|
+
lo as Clock,
|
|
6420
|
+
st as CompatTimeline,
|
|
6421
|
+
Or as CustomBounce,
|
|
6422
|
+
Dr as CustomEase,
|
|
6423
|
+
Br as CustomWiggle,
|
|
6424
|
+
mi as DEFAULT_BAKE_INTERVAL_MS,
|
|
6425
|
+
we as DEFAULT_INERTIA_FRICTION,
|
|
6426
|
+
Kr as DEFAULT_LABELS,
|
|
6427
|
+
N as DEFAULT_SPRING,
|
|
6428
|
+
Do as DEFAULT_TRANSITION,
|
|
6429
|
+
Di as Draggable,
|
|
6225
6430
|
_t as FORMAT_VERSION,
|
|
6226
|
-
|
|
6227
|
-
|
|
6431
|
+
Ji as INERTIA_MAX_DURATION_MS,
|
|
6432
|
+
Vs as InertiaTrackPlayer,
|
|
6228
6433
|
V as LiveTimeline,
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6434
|
+
yo as MORPH_SAMPLES,
|
|
6435
|
+
co as ManualClock,
|
|
6436
|
+
ri as MediaSync,
|
|
6437
|
+
Zn as Observer,
|
|
6438
|
+
hi as SPRING_MAX_DURATION_MS,
|
|
6439
|
+
Yt as SPRING_PRESETS,
|
|
6440
|
+
dt as SPRING_STEP_MS,
|
|
6441
|
+
vr as ScrollAnimator,
|
|
6442
|
+
qt as ScrollDriver,
|
|
6443
|
+
wr as ScrollMarkers,
|
|
6444
|
+
pr as ScrollPin,
|
|
6445
|
+
Qe as SmoothScroll,
|
|
6446
|
+
Ot as SpringSampler,
|
|
6447
|
+
Ys as SpringTrackPlayer,
|
|
6448
|
+
Vn as Stage,
|
|
6449
|
+
Ti as Timeline,
|
|
6450
|
+
ve as TinyflyPlayer,
|
|
6451
|
+
oo as TinyflySequencer,
|
|
6452
|
+
zt as TrackPlayer,
|
|
6453
|
+
Po as ValueResolver,
|
|
6454
|
+
dr as VisibilityDriver,
|
|
6455
|
+
us as backOut,
|
|
6456
|
+
vi as bakeEasing,
|
|
6457
|
+
yi as bakeInertiaTrack,
|
|
6458
|
+
gi as bakeSpringTrack,
|
|
6459
|
+
hs as bounceOut,
|
|
6460
|
+
js as charactersFor,
|
|
6461
|
+
qi as clamp01,
|
|
6462
|
+
bo as clearMorphCache,
|
|
6463
|
+
mo as clearPathCache,
|
|
6464
|
+
Ge as containerProgressAt,
|
|
6465
|
+
Uo as context,
|
|
6466
|
+
$o as create,
|
|
6467
|
+
Jr as createControls,
|
|
6468
|
+
cs as createCubicBezier,
|
|
6469
|
+
Wr as createLive,
|
|
6470
|
+
Qs as createRandom,
|
|
6471
|
+
oe as createTrack,
|
|
6472
|
+
fo as criticalDamping,
|
|
6473
|
+
nn as customBounce,
|
|
6474
|
+
sn as customEase,
|
|
6475
|
+
rn as customWiggle,
|
|
6476
|
+
mt as deserializeTimeline,
|
|
6477
|
+
Ks as deserializeTrack,
|
|
6478
|
+
Eo as draggable,
|
|
6479
|
+
ns as easeIn,
|
|
6480
|
+
ui as easeInCubic,
|
|
6481
|
+
os as easeInOut,
|
|
6482
|
+
Nt as easeInOutCubic,
|
|
6483
|
+
ss as easeInOutQuad,
|
|
6484
|
+
es as easeInQuad,
|
|
6485
|
+
rs as easeOut,
|
|
6486
|
+
fi as easeOutCubic,
|
|
6487
|
+
is as easeOutQuad,
|
|
6488
|
+
ls as elasticOut,
|
|
6489
|
+
qs as expandParametricEasings,
|
|
6490
|
+
qo as from,
|
|
6491
|
+
ko as fromJSON,
|
|
6492
|
+
Xo as fromTo,
|
|
6287
6493
|
W as getEasingFunction,
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6494
|
+
Rt as getInterpolator,
|
|
6495
|
+
wi as getMotionPathPoint,
|
|
6496
|
+
go as getPathLength,
|
|
6497
|
+
xs as getPointAtProgress,
|
|
6498
|
+
Jn as gridLinesFor,
|
|
6499
|
+
Gi as hasKeyframes,
|
|
6500
|
+
So as hashSeed,
|
|
6501
|
+
Go as imageSequence,
|
|
6502
|
+
bt as inertiaDuration,
|
|
6503
|
+
yt as inertiaRest,
|
|
6504
|
+
se as inertiaValueAt,
|
|
6505
|
+
po as inertiaVelocityAt,
|
|
6506
|
+
Bs as interpolateArray,
|
|
6507
|
+
Os as interpolateColor,
|
|
6508
|
+
To as interpolateMotionPath,
|
|
6509
|
+
Y as interpolateNumber,
|
|
6510
|
+
Ns as interpolatePathString,
|
|
6511
|
+
Fe as interpolateString,
|
|
6512
|
+
Hi as isCubicBezierEasing,
|
|
6513
|
+
Z as isInertiaTrack,
|
|
6514
|
+
ao as isMotionPathPoint,
|
|
6515
|
+
ai as isMotionPathTrack,
|
|
6516
|
+
Et as isParametricEasing,
|
|
6517
|
+
vt as isPathData,
|
|
6518
|
+
Q as isSpringTrack,
|
|
6519
|
+
fe as isTextTrack,
|
|
6520
|
+
uo as isUnderdamped,
|
|
6521
|
+
Ao as isUnresolved,
|
|
6522
|
+
ne as linear,
|
|
6523
|
+
B as live,
|
|
6524
|
+
It as mapEase,
|
|
6525
|
+
zo as matchMedia,
|
|
6526
|
+
li as maxStaggerDistance,
|
|
6527
|
+
Fs as morphPath,
|
|
6528
|
+
eo as mount,
|
|
6529
|
+
so as mountAll,
|
|
6530
|
+
Ct as naturalRest,
|
|
6531
|
+
Ko as pageTransition,
|
|
6532
|
+
ds as parametricEasing,
|
|
6533
|
+
He as parseEdge,
|
|
6534
|
+
nt as parsePath,
|
|
6535
|
+
Ni as parseTrigger,
|
|
6536
|
+
Io as play,
|
|
6537
|
+
Lo as playSequence,
|
|
6538
|
+
Co as playWhenVisible,
|
|
6539
|
+
xi as playheadCrossings,
|
|
6540
|
+
di as pointAtDistance,
|
|
6541
|
+
cn as pointsToPath,
|
|
6542
|
+
Oo as quickPlay,
|
|
6543
|
+
Ho as quickTo,
|
|
6544
|
+
Si as randomBetween,
|
|
6545
|
+
Mo as randomChoice,
|
|
6546
|
+
Js as randomSnapped,
|
|
6547
|
+
tn as resolveSequence,
|
|
6548
|
+
Pi as resolveValue,
|
|
6549
|
+
_o as scrollProgress,
|
|
6550
|
+
Ro as scrubOnScroll,
|
|
6551
|
+
Zs as serializeTimeline,
|
|
6552
|
+
Gs as serializeTrack,
|
|
6553
|
+
Yo as set,
|
|
6554
|
+
pe as shapeToPathData,
|
|
6555
|
+
Xs as simplifyKeyframes,
|
|
6556
|
+
fr as smoothToward,
|
|
6557
|
+
Qn as snapAxis,
|
|
6558
|
+
gr as snapConfig,
|
|
6559
|
+
br as snapDuration,
|
|
6560
|
+
yr as snapProgress,
|
|
6561
|
+
jo as splitText,
|
|
6562
|
+
Ki as springDuration,
|
|
6563
|
+
ho as springValueAt,
|
|
6564
|
+
ci as staggerDistance,
|
|
6565
|
+
de as staggerOffset,
|
|
6566
|
+
ie as staggerOffsets,
|
|
6567
|
+
Dt as staggerSpan,
|
|
6568
|
+
fs as stepsEasing,
|
|
6569
|
+
Gr as syncMediaElement,
|
|
6570
|
+
zs as textAt,
|
|
6571
|
+
Bo as tf,
|
|
6572
|
+
Wo as ticker,
|
|
6573
|
+
Vo as timeline,
|
|
6574
|
+
No as to,
|
|
6575
|
+
xo as toJSON,
|
|
6576
|
+
vo as toKeyframedTrack,
|
|
6577
|
+
wo as toKeyframedTracks,
|
|
6578
|
+
G as trackTargets,
|
|
6579
|
+
gt as triggerDistance,
|
|
6580
|
+
Fo as unmount
|
|
6372
6581
|
};
|