@algorisys/tinyfly 0.81.0 → 0.86.2
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 +12 -5
- package/lib/addons/adapters.js +363 -248
- package/lib/addons/characters.js +1658 -1342
- package/lib/addons/dom-adapter-Cphr2HZn.js +372 -0
- package/lib/addons/gsap-compat.js +197 -187
- package/lib/addons/load-scene-vp14_Jj-.js +324 -0
- package/lib/addons/scene-3d-webgl.js +237 -0
- package/lib/addons/scene-3d.js +306 -0
- package/lib/addons/shading-ByG9UXd0.js +85 -0
- package/lib/browser/tinyfly-scene-3d-webgl.iife.js +114 -0
- package/lib/browser/tinyfly-scene-3d.iife.js +3 -0
- package/lib/browser/tinyfly.iife.js +4 -4
- package/lib/browser/tinyfly.js +3295 -2613
- package/lib/browser/tinyfly.umd.js +4 -4
- package/lib/cli/tools.js +137 -22
- package/lib/embed/tinyfly-embed.iife.js +4 -4
- package/lib/embed/tinyfly-embed.js +921 -833
- package/lib/engine/tinyfly-engine.js +1022 -776
- package/lib/engine/tinyfly-engine.umd.cjs +2 -2
- package/lib/headless/headless.js +264 -7
- package/lib/player/tinyfly-player.es.js +459 -371
- package/lib/player/tinyfly-player.iife.js +2 -2
- package/lib/player/tinyfly-player.umd.js +2 -2
- package/lib/types/adapters/canvas/canvas-adapter.d.ts +36 -0
- package/lib/types/adapters/transform-3d.d.ts +99 -0
- package/lib/types/adapters/webgl/webgl-adapter.d.ts +17 -0
- package/lib/types/characters/character.d.ts +20 -1
- package/lib/types/characters/dance.d.ts +47 -0
- package/lib/types/characters/index.d.ts +3 -1
- package/lib/types/characters/rig/body-plan.d.ts +3 -1
- package/lib/types/characters/rig/skeleton.d.ts +57 -0
- package/lib/types/characters/scene-objects.d.ts +2 -0
- package/lib/types/characters/species/human.d.ts +8 -0
- package/lib/types/compat/gsap/vars.d.ts +8 -0
- package/lib/types/engine/core/bake.d.ts +3 -1
- package/lib/types/engine/index.d.ts +1 -0
- package/lib/types/engine/interpolation/interpolators.d.ts +10 -3
- package/lib/types/engine/math/index.d.ts +11 -0
- package/lib/types/engine/math/mat4.d.ts +37 -0
- package/lib/types/engine/math/quat.d.ts +39 -0
- package/lib/types/engine/math/vec3.d.ts +16 -0
- package/lib/types/engine/types.d.ts +23 -2
- package/lib/types/scene-3d/camera.d.ts +27 -0
- package/lib/types/scene-3d/canvas-2d-renderer.d.ts +21 -0
- package/lib/types/scene-3d/geometry/extrude.d.ts +17 -0
- package/lib/types/scene-3d/geometry/mesh.d.ts +36 -0
- package/lib/types/scene-3d/geometry/primitives.d.ts +16 -0
- package/lib/types/scene-3d/geometry/triangulate.d.ts +24 -0
- package/lib/types/scene-3d/index.d.ts +20 -0
- package/lib/types/scene-3d/load-scene.d.ts +31 -0
- package/lib/types/scene-3d/object-kind.d.ts +54 -0
- package/lib/types/scene-3d/resolve-scene.d.ts +122 -0
- package/lib/types/scene-3d/scene-3d-adapter.d.ts +46 -0
- package/lib/types/scene-3d/scene-types.d.ts +191 -0
- package/lib/types/scene-3d/shading.d.ts +20 -0
- package/lib/types/scene-3d/validate-scene.d.ts +11 -0
- package/lib/types/scene-3d/webgl/gl-data.d.ts +28 -0
- package/lib/types/scene-3d/webgl/index.d.ts +16 -0
- package/lib/types/scene-3d/webgl/shaders.d.ts +29 -0
- package/lib/types/scene-3d/webgl/webgl2-renderer.d.ts +33 -0
- package/package.json +10 -2
- package/lib/addons/dom-adapter-CrNwoomd.js +0 -243
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Ee(t) {
|
|
2
2
|
return typeof t == "object" && t !== null && t.type === "cubic-bezier";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function xt(t) {
|
|
5
5
|
return typeof t == "object" && t !== null && t.type !== "cubic-bezier";
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
function
|
|
7
|
+
const Xt = 2;
|
|
8
|
+
function ne(t) {
|
|
9
|
+
return t.some((e) => e.interpolation !== void 0) ? 2 : 1;
|
|
10
|
+
}
|
|
11
|
+
function $t(t) {
|
|
9
12
|
return t.property === "text" && "textConfig" in t;
|
|
10
13
|
}
|
|
11
14
|
function V(t) {
|
|
12
15
|
return t.kind === "inertia" && "inertia" in t;
|
|
13
16
|
}
|
|
14
|
-
function
|
|
17
|
+
function j(t) {
|
|
15
18
|
return t.kind === "spring" && "spring" in t;
|
|
16
19
|
}
|
|
17
|
-
function
|
|
20
|
+
function re(t) {
|
|
18
21
|
return t.property === "motionPath" && "motionPathConfig" in t;
|
|
19
22
|
}
|
|
20
|
-
function
|
|
23
|
+
function kr(t) {
|
|
21
24
|
return typeof t == "object" && t !== null && "x" in t && "y" in t && "angle" in t;
|
|
22
25
|
}
|
|
23
|
-
function
|
|
26
|
+
function Le(t) {
|
|
24
27
|
return "keyframes" in t;
|
|
25
28
|
}
|
|
26
|
-
class
|
|
29
|
+
class Sr {
|
|
27
30
|
_currentTime = 0;
|
|
28
31
|
_isRunning = !1;
|
|
29
32
|
onTick = null;
|
|
@@ -49,7 +52,7 @@ class Un {
|
|
|
49
52
|
this._currentTime = e;
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
|
-
class
|
|
55
|
+
class Ar {
|
|
53
56
|
_currentTime = 0;
|
|
54
57
|
_isRunning = !1;
|
|
55
58
|
_lastFrameTime = null;
|
|
@@ -96,7 +99,7 @@ class Vn {
|
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
|
-
function
|
|
102
|
+
function se(t, e, n = "start") {
|
|
100
103
|
if (e <= 1) return 0;
|
|
101
104
|
if (typeof n == "number") {
|
|
102
105
|
const r = Math.max(0, Math.min(e - 1, n));
|
|
@@ -113,36 +116,36 @@ function Wt(t, e, n = "start") {
|
|
|
113
116
|
return t;
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
|
-
function
|
|
119
|
+
function Oe(t, e = "start") {
|
|
117
120
|
if (t <= 1) return 0;
|
|
118
121
|
let n = 0;
|
|
119
122
|
for (let r = 0; r < t; r++)
|
|
120
|
-
n = Math.max(n,
|
|
123
|
+
n = Math.max(n, se(r, t, e));
|
|
121
124
|
return n;
|
|
122
125
|
}
|
|
123
|
-
function
|
|
126
|
+
function oe(t, e, n) {
|
|
124
127
|
if (n.offsets) return n.offsets[t] ?? 0;
|
|
125
|
-
const r = n.from ?? "start", s =
|
|
128
|
+
const r = n.from ?? "start", s = se(t, e, r);
|
|
126
129
|
if (n.amount !== void 0) {
|
|
127
|
-
const
|
|
128
|
-
return
|
|
130
|
+
const o = Oe(e, r);
|
|
131
|
+
return o === 0 ? 0 : n.amount * s / o;
|
|
129
132
|
}
|
|
130
133
|
return n.each !== void 0 ? n.each * s : 0;
|
|
131
134
|
}
|
|
132
|
-
function
|
|
133
|
-
return Array.from({ length: t }, (n, r) =>
|
|
135
|
+
function Fe(t, e) {
|
|
136
|
+
return Array.from({ length: t }, (n, r) => oe(r, t, e));
|
|
134
137
|
}
|
|
135
|
-
function
|
|
136
|
-
return t <= 1 ? 0 : Math.max(...
|
|
138
|
+
function Rt(t, e) {
|
|
139
|
+
return t <= 1 ? 0 : Math.max(...Fe(t, e));
|
|
137
140
|
}
|
|
138
|
-
const
|
|
141
|
+
const tt = 1, ie = 6e4, st = ie / tt, L = {
|
|
139
142
|
stiffness: 180,
|
|
140
143
|
damping: 12,
|
|
141
144
|
mass: 1,
|
|
142
145
|
velocity: 0,
|
|
143
146
|
restDelta: 0.01,
|
|
144
147
|
restSpeed: 0.1
|
|
145
|
-
},
|
|
148
|
+
}, wr = {
|
|
146
149
|
gentle: { stiffness: 120, damping: 18, mass: 1 },
|
|
147
150
|
default: { stiffness: 180, damping: 12, mass: 1 },
|
|
148
151
|
snappy: { stiffness: 280, damping: 20, mass: 1 },
|
|
@@ -150,7 +153,7 @@ const Z = 1, Kt = 6e4, nt = Kt / Z, E = {
|
|
|
150
153
|
wobbly: { stiffness: 180, damping: 5, mass: 1 },
|
|
151
154
|
stiff: { stiffness: 400, damping: 30, mass: 1 }
|
|
152
155
|
};
|
|
153
|
-
class
|
|
156
|
+
class ut {
|
|
154
157
|
from;
|
|
155
158
|
to;
|
|
156
159
|
stiffness;
|
|
@@ -175,7 +178,7 @@ class at {
|
|
|
175
178
|
/** Once at rest we stop simulating; every later time returns `to`. */
|
|
176
179
|
settledStep = null;
|
|
177
180
|
constructor(e) {
|
|
178
|
-
this.from = e.from, this.to = e.to, this.stiffness = e.stiffness ??
|
|
181
|
+
this.from = e.from, this.to = e.to, this.stiffness = e.stiffness ?? L.stiffness, this.damping = e.damping ?? L.damping, this.mass = e.mass ?? L.mass, this.restDelta = e.restDelta ?? L.restDelta, this.restSpeed = e.restSpeed ?? L.restSpeed, this.distance = Math.abs(this.to - this.from) || 1, this.samples = [this.from], this.velocity = e.velocity ?? L.velocity, this.isAtRest(this.from) && (this.settledStep = 0);
|
|
179
182
|
}
|
|
180
183
|
/**
|
|
181
184
|
* Whether a position/velocity pair counts as settled.
|
|
@@ -193,25 +196,25 @@ class at {
|
|
|
193
196
|
*/
|
|
194
197
|
valueAt(e) {
|
|
195
198
|
if (e <= 0) return this.from;
|
|
196
|
-
const n = Math.floor(e /
|
|
199
|
+
const n = Math.floor(e / tt);
|
|
197
200
|
if (this.simulateTo(n + 1), this.settledStep !== null && n >= this.settledStep)
|
|
198
201
|
return this.to;
|
|
199
|
-
const r = this.samples[Math.min(n, this.samples.length - 1)], s = this.samples[Math.min(n + 1, this.samples.length - 1)],
|
|
200
|
-
return r + (s - r) *
|
|
202
|
+
const r = this.samples[Math.min(n, this.samples.length - 1)], s = this.samples[Math.min(n + 1, this.samples.length - 1)], o = e / tt - n;
|
|
203
|
+
return r + (s - r) * o;
|
|
201
204
|
}
|
|
202
205
|
/**
|
|
203
206
|
* How long the spring takes to settle, in milliseconds — the natural duration
|
|
204
207
|
* of a spring track. Runs the simulation to completion once.
|
|
205
208
|
*/
|
|
206
209
|
settleTime() {
|
|
207
|
-
return this.simulateTo(
|
|
210
|
+
return this.simulateTo(st + 1), this.settledStep !== null ? this.settledStep * tt : ie;
|
|
208
211
|
}
|
|
209
212
|
/** Advance the cached simulation until it holds at least `steps` samples. */
|
|
210
213
|
simulateTo(e) {
|
|
211
214
|
if (this.settledStep !== null) return;
|
|
212
|
-
const n = Math.min(e,
|
|
215
|
+
const n = Math.min(e, st + 1), r = tt / 1e3;
|
|
213
216
|
for (; this.samples.length < n; ) {
|
|
214
|
-
const s = this.samples[this.samples.length - 1],
|
|
217
|
+
const s = this.samples[this.samples.length - 1], o = s - this.to, i = -this.stiffness * o, a = -this.damping * this.velocity, c = (i + a) / this.mass;
|
|
215
218
|
this.velocity += c * r;
|
|
216
219
|
const u = s + this.velocity * r;
|
|
217
220
|
if (this.samples.push(u), this.isAtRest(u)) {
|
|
@@ -219,32 +222,32 @@ class at {
|
|
|
219
222
|
return;
|
|
220
223
|
}
|
|
221
224
|
}
|
|
222
|
-
this.samples.length >
|
|
225
|
+
this.samples.length > st && (this.settledStep = st);
|
|
223
226
|
}
|
|
224
227
|
}
|
|
225
|
-
function
|
|
226
|
-
return new
|
|
228
|
+
function vr(t, e) {
|
|
229
|
+
return new ut(t).valueAt(e);
|
|
227
230
|
}
|
|
228
|
-
function
|
|
229
|
-
return new
|
|
231
|
+
function Pr(t) {
|
|
232
|
+
return new ut(t).settleTime();
|
|
230
233
|
}
|
|
231
|
-
function
|
|
232
|
-
const e = t.stiffness ??
|
|
234
|
+
function $r(t) {
|
|
235
|
+
const e = t.stiffness ?? L.stiffness, n = t.damping ?? L.damping, r = t.mass ?? L.mass;
|
|
233
236
|
return n < 2 * Math.sqrt(e * r);
|
|
234
237
|
}
|
|
235
|
-
function
|
|
236
|
-
const e = t.stiffness ??
|
|
238
|
+
function Rr(t) {
|
|
239
|
+
const e = t.stiffness ?? L.stiffness, n = t.mass ?? L.mass;
|
|
237
240
|
return 2 * Math.sqrt(e * n);
|
|
238
241
|
}
|
|
239
|
-
const
|
|
240
|
-
function
|
|
241
|
-
const e = t.friction ??
|
|
242
|
-
return e > 0 ? e :
|
|
242
|
+
const zt = 4, Ne = 2e-3, Xe = 1e-4, ze = 6e4;
|
|
243
|
+
function lt(t) {
|
|
244
|
+
const e = t.friction ?? zt;
|
|
245
|
+
return e > 0 ? e : zt;
|
|
243
246
|
}
|
|
244
|
-
function
|
|
245
|
-
return t.from + t.velocity /
|
|
247
|
+
function Ye(t) {
|
|
248
|
+
return t.from + t.velocity / lt(t);
|
|
246
249
|
}
|
|
247
|
-
function
|
|
250
|
+
function Ue(t, e) {
|
|
248
251
|
if (e === void 0) return t;
|
|
249
252
|
if (typeof e == "number")
|
|
250
253
|
return e > 0 ? Math.round(t / e) * e : t;
|
|
@@ -254,79 +257,79 @@ function Ae(t, e) {
|
|
|
254
257
|
Math.abs(r - t) < Math.abs(n - t) && (n = r);
|
|
255
258
|
return n;
|
|
256
259
|
}
|
|
257
|
-
function
|
|
258
|
-
let e =
|
|
260
|
+
function ht(t) {
|
|
261
|
+
let e = Ue(Ye(t), t.end);
|
|
259
262
|
return t.min !== void 0 && (e = Math.max(t.min, e)), t.max !== void 0 && (e = Math.min(t.max, e)), e;
|
|
260
263
|
}
|
|
261
|
-
function
|
|
262
|
-
const e = Math.abs(
|
|
264
|
+
function ft(t) {
|
|
265
|
+
const e = Math.abs(ht(t) - t.from);
|
|
263
266
|
if (e === 0) return 0;
|
|
264
|
-
const n = t.restDelta ?? Math.max(
|
|
267
|
+
const n = t.restDelta ?? Math.max(Xe, e * Ne);
|
|
265
268
|
if (n >= e) return 0;
|
|
266
|
-
const r = Math.log(e / n) /
|
|
267
|
-
return Math.min(
|
|
269
|
+
const r = Math.log(e / n) / lt(t);
|
|
270
|
+
return Math.min(ze, r * 1e3);
|
|
268
271
|
}
|
|
269
|
-
function
|
|
272
|
+
function kt(t, e) {
|
|
270
273
|
if (e <= 0) return t.from;
|
|
271
|
-
const n =
|
|
272
|
-
if (e >=
|
|
273
|
-
const r =
|
|
274
|
+
const n = ht(t);
|
|
275
|
+
if (e >= ft(t)) return n;
|
|
276
|
+
const r = lt(t);
|
|
274
277
|
return t.from + (n - t.from) * (1 - Math.exp(-r * e / 1e3));
|
|
275
278
|
}
|
|
276
|
-
function
|
|
277
|
-
const n =
|
|
278
|
-
return e >=
|
|
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":
|
|
279
|
+
function Dr(t, e) {
|
|
280
|
+
const n = lt(t), r = ht(t);
|
|
281
|
+
return e >= ft(t) ? 0 : (r - t.from) * n * Math.exp(-n * Math.max(0, e) / 1e3);
|
|
282
|
+
}
|
|
283
|
+
const St = (t) => t, Ve = (t) => t * t, je = (t) => 1 - (1 - t) * (1 - t), He = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, ae = (t) => t * t * t, ce = (t) => 1 - Math.pow(1 - t, 3), ue = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, Be = ae, We = ce, Qe = ue, Ge = {
|
|
284
|
+
linear: St,
|
|
285
|
+
"ease-in": Be,
|
|
286
|
+
"ease-out": We,
|
|
287
|
+
"ease-in-out": Qe,
|
|
288
|
+
"ease-in-quad": Ve,
|
|
289
|
+
"ease-out-quad": je,
|
|
290
|
+
"ease-in-out-quad": He,
|
|
291
|
+
"ease-in-cubic": ae,
|
|
292
|
+
"ease-out-cubic": ce,
|
|
293
|
+
"ease-in-out-cubic": ue
|
|
291
294
|
};
|
|
292
|
-
function
|
|
293
|
-
const [e, n, r, s] = t,
|
|
295
|
+
function Ke(t) {
|
|
296
|
+
const [e, n, r, s] = t, o = 3 * e, i = 3 * (r - e) - o, a = 1 - o - i, c = 3 * n, u = 3 * (s - n) - c, l = 1 - c - u, h = (d) => ((a * d + i) * d + o) * d, f = (d) => ((l * d + u) * d + c) * d, p = (d) => (3 * a * d + 2 * i) * d + o, M = (d) => {
|
|
294
297
|
let g = d;
|
|
295
298
|
for (let k = 0; k < 8; k++) {
|
|
296
|
-
const
|
|
297
|
-
if (Math.abs(
|
|
299
|
+
const w = h(g) - d;
|
|
300
|
+
if (Math.abs(w) < 1e-7)
|
|
298
301
|
return g;
|
|
299
|
-
const y =
|
|
302
|
+
const y = p(g);
|
|
300
303
|
if (Math.abs(y) < 1e-7)
|
|
301
304
|
break;
|
|
302
|
-
g -=
|
|
305
|
+
g -= w / y;
|
|
303
306
|
}
|
|
304
|
-
let
|
|
305
|
-
for (g = d;
|
|
307
|
+
let _ = 0, b = 1;
|
|
308
|
+
for (g = d; _ < b; ) {
|
|
306
309
|
const k = h(g);
|
|
307
310
|
if (Math.abs(k - d) < 1e-7)
|
|
308
311
|
return g;
|
|
309
|
-
d > k ?
|
|
312
|
+
d > k ? _ = g : b = g, g = (_ + b) / 2;
|
|
310
313
|
}
|
|
311
314
|
return g;
|
|
312
315
|
};
|
|
313
316
|
return (d) => {
|
|
314
317
|
if (d <= 0) return 0;
|
|
315
318
|
if (d >= 1) return 1;
|
|
316
|
-
const g =
|
|
317
|
-
return
|
|
319
|
+
const g = M(d);
|
|
320
|
+
return f(g);
|
|
318
321
|
};
|
|
319
322
|
}
|
|
320
|
-
function
|
|
323
|
+
function gt(t, e = "out") {
|
|
321
324
|
if (e === "out") return t;
|
|
322
325
|
const n = (r) => 1 - t(1 - r);
|
|
323
326
|
return e === "in" ? n : (r) => r < 0.5 ? n(r * 2) / 2 : t(r * 2 - 1) / 2 + 0.5;
|
|
324
327
|
}
|
|
325
|
-
function
|
|
328
|
+
function Ze(t = 1, e = 0.3) {
|
|
326
329
|
const n = Math.max(1, t), r = e / (2 * Math.PI) * Math.asin(1 / n);
|
|
327
330
|
return (s) => s <= 0 ? 0 : s >= 1 ? 1 : n * Math.pow(2, -10 * s) * Math.sin((s - r) * (2 * Math.PI) / e) + 1;
|
|
328
331
|
}
|
|
329
|
-
const
|
|
332
|
+
const qe = (t) => {
|
|
330
333
|
if (t <= 0) return 0;
|
|
331
334
|
if (t >= 1) return 1;
|
|
332
335
|
if (t < 1 / 2.75) return 7.5625 * t * t;
|
|
@@ -341,7 +344,7 @@ const Fe = (t) => {
|
|
|
341
344
|
const r = t - 2.625 / 2.75;
|
|
342
345
|
return 7.5625 * r * r + 0.984375;
|
|
343
346
|
};
|
|
344
|
-
function
|
|
347
|
+
function Je(t = 1.70158) {
|
|
345
348
|
return (e) => {
|
|
346
349
|
if (e <= 0) return 0;
|
|
347
350
|
if (e >= 1) return 1;
|
|
@@ -349,7 +352,7 @@ function Oe(t = 1.70158) {
|
|
|
349
352
|
return n * n * ((t + 1) * n + t) + 1;
|
|
350
353
|
};
|
|
351
354
|
}
|
|
352
|
-
function
|
|
355
|
+
function tn(t, e = "end") {
|
|
353
356
|
const n = Math.max(1, Math.floor(t));
|
|
354
357
|
return (r) => {
|
|
355
358
|
if (r >= 1) return 1;
|
|
@@ -367,22 +370,22 @@ function Ne(t, e = "end") {
|
|
|
367
370
|
}
|
|
368
371
|
};
|
|
369
372
|
}
|
|
370
|
-
function
|
|
373
|
+
function en(t) {
|
|
371
374
|
switch (t.type) {
|
|
372
375
|
case "steps":
|
|
373
|
-
return
|
|
376
|
+
return tn(t.count, t.position);
|
|
374
377
|
case "elastic":
|
|
375
|
-
return
|
|
378
|
+
return gt(Ze(t.amplitude, t.period), t.mode);
|
|
376
379
|
case "bounce":
|
|
377
|
-
return
|
|
380
|
+
return gt(qe, t.mode);
|
|
378
381
|
case "back":
|
|
379
|
-
return
|
|
382
|
+
return gt(Je(t.overshoot), t.mode);
|
|
380
383
|
}
|
|
381
384
|
}
|
|
382
|
-
function
|
|
383
|
-
return t === void 0 ?
|
|
385
|
+
function le(t) {
|
|
386
|
+
return t === void 0 ? St : Ee(t) ? Ke(t.points) : xt(t) ? en(t) : Ge[t] ?? St;
|
|
384
387
|
}
|
|
385
|
-
const
|
|
388
|
+
const Yt = 32, nn = 256, W = /* @__PURE__ */ new Map(), rn = /[MmLlHhVvCcSsQqTtAaZz]/, sn = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, on = {
|
|
386
389
|
M: 2,
|
|
387
390
|
L: 2,
|
|
388
391
|
H: 1,
|
|
@@ -394,68 +397,68 @@ const Dt = 32, Ye = 256, q = /* @__PURE__ */ new Map(), Ue = /[MmLlHhVvCcSsQqTtA
|
|
|
394
397
|
A: 7,
|
|
395
398
|
Z: 0
|
|
396
399
|
};
|
|
397
|
-
function
|
|
400
|
+
function an(t) {
|
|
398
401
|
const e = [];
|
|
399
402
|
let n = 0, r = null;
|
|
400
403
|
const s = () => {
|
|
401
404
|
for (; n < t.length && /[\s,]/.test(t[n]); ) n++;
|
|
402
405
|
};
|
|
403
406
|
for (; n < t.length && (s(), !(n >= t.length)); ) {
|
|
404
|
-
const
|
|
405
|
-
if (
|
|
406
|
-
r = { type:
|
|
407
|
+
const o = t[n];
|
|
408
|
+
if (rn.test(o)) {
|
|
409
|
+
r = { type: o, args: [] }, e.push(r), n++;
|
|
407
410
|
continue;
|
|
408
411
|
}
|
|
409
412
|
if (!r) break;
|
|
410
|
-
const
|
|
411
|
-
if (
|
|
412
|
-
if (
|
|
413
|
-
r.args.push(
|
|
413
|
+
const i = r.type === "A" || r.type === "a", a = r.args.length % 7;
|
|
414
|
+
if (i && (a === 3 || a === 4)) {
|
|
415
|
+
if (o !== "0" && o !== "1") break;
|
|
416
|
+
r.args.push(o === "1" ? 1 : 0), n++;
|
|
414
417
|
continue;
|
|
415
418
|
}
|
|
416
|
-
const c =
|
|
419
|
+
const c = sn.exec(t.slice(n));
|
|
417
420
|
if (!c) break;
|
|
418
421
|
r.args.push(parseFloat(c[0])), n += c[0].length;
|
|
419
422
|
}
|
|
420
423
|
return e;
|
|
421
424
|
}
|
|
422
|
-
function
|
|
423
|
-
if (t ===
|
|
425
|
+
function cn(t, e, n, r, s, o, i, a, c) {
|
|
426
|
+
if (t === a && e === c) return [];
|
|
424
427
|
let u = Math.abs(n), l = Math.abs(r);
|
|
425
|
-
if (u === 0 || l === 0) return [[t, e,
|
|
426
|
-
const h = s * Math.PI / 180,
|
|
428
|
+
if (u === 0 || l === 0) return [[t, e, a, c, a, c]];
|
|
429
|
+
const h = s * Math.PI / 180, f = Math.cos(h), p = Math.sin(h), M = (t - a) / 2, d = (e - c) / 2, g = f * M + p * d, _ = -p * M + f * d, b = g * g / (u * u) + _ * _ / (l * l);
|
|
427
430
|
if (b > 1) {
|
|
428
|
-
const
|
|
429
|
-
u *=
|
|
430
|
-
}
|
|
431
|
-
const k =
|
|
432
|
-
const
|
|
433
|
-
return
|
|
434
|
-
},
|
|
435
|
-
let $ = x((g -
|
|
436
|
-
!
|
|
437
|
-
const
|
|
438
|
-
const
|
|
439
|
-
return [
|
|
440
|
-
},
|
|
441
|
-
const
|
|
442
|
-
return [
|
|
443
|
-
},
|
|
444
|
-
for (let
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
return
|
|
449
|
-
}
|
|
450
|
-
function
|
|
451
|
-
const
|
|
452
|
-
return
|
|
453
|
-
}
|
|
454
|
-
function
|
|
455
|
-
const
|
|
456
|
-
return 3 *
|
|
457
|
-
}
|
|
458
|
-
function
|
|
431
|
+
const R = Math.sqrt(b);
|
|
432
|
+
u *= R, l *= R;
|
|
433
|
+
}
|
|
434
|
+
const k = o === i ? -1 : 1, w = u * u * l * l - u * u * _ * _ - l * l * g * g, y = u * u * _ * _ + l * l * g * g, v = k * Math.sqrt(Math.max(0, w / y)), A = v * u * _ / l, D = -v * l * g / u, m = f * A - p * D + (t + a) / 2, T = p * A + f * D + (e + c) / 2, x = (R, I, E, H) => {
|
|
435
|
+
const dt = R * E + I * H, rt = Math.sqrt((R * R + I * I) * (E * E + H * H)), Z = Math.acos(Math.max(-1, Math.min(1, dt / rt)));
|
|
436
|
+
return R * H - I * E < 0 ? -Z : Z;
|
|
437
|
+
}, S = x(1, 0, (g - A) / u, (_ - D) / l);
|
|
438
|
+
let $ = x((g - A) / u, (_ - D) / l, (-g - A) / u, (-_ - D) / l);
|
|
439
|
+
!i && $ > 0 && ($ -= 2 * Math.PI), i && $ < 0 && ($ += 2 * Math.PI);
|
|
440
|
+
const P = Math.max(1, Math.ceil(Math.abs($) / (Math.PI / 2))), pt = $ / P, nt = 4 / 3 * Math.tan(pt / 4), Ot = (R) => {
|
|
441
|
+
const I = u * Math.cos(R), E = l * Math.sin(R);
|
|
442
|
+
return [f * I - p * E + m, p * I + f * E + T];
|
|
443
|
+
}, Ft = (R) => {
|
|
444
|
+
const I = -u * Math.sin(R), E = l * Math.cos(R);
|
|
445
|
+
return [f * I - p * E, p * I + f * E];
|
|
446
|
+
}, Nt = [];
|
|
447
|
+
for (let R = 0; R < P; R++) {
|
|
448
|
+
const I = S + R * pt, E = I + pt, [H, dt] = Ot(I), [rt, Z] = R === P - 1 ? [a, c] : Ot(E), [Re, De] = Ft(I), [Ce, Ie] = Ft(E);
|
|
449
|
+
Nt.push([H + nt * Re, dt + nt * De, rt - nt * Ce, Z - nt * Ie, rt, Z]);
|
|
450
|
+
}
|
|
451
|
+
return Nt;
|
|
452
|
+
}
|
|
453
|
+
function z(t, e, n, r, s) {
|
|
454
|
+
const o = 1 - s;
|
|
455
|
+
return o * o * o * t + 3 * o * o * s * e + 3 * o * s * s * n + s * s * s * r;
|
|
456
|
+
}
|
|
457
|
+
function Ut(t, e, n, r, s) {
|
|
458
|
+
const o = 1 - s;
|
|
459
|
+
return 3 * o * o * (e - t) + 6 * o * s * (n - e) + 3 * s * s * (r - n);
|
|
460
|
+
}
|
|
461
|
+
function q(t, e, n, r) {
|
|
459
462
|
return {
|
|
460
463
|
subpath: 0,
|
|
461
464
|
type: "L",
|
|
@@ -467,118 +470,118 @@ function Q(t, e, n, r) {
|
|
|
467
470
|
length: Math.hypot(n - t, r - e)
|
|
468
471
|
};
|
|
469
472
|
}
|
|
470
|
-
function
|
|
471
|
-
const [r, s, i, a,
|
|
472
|
-
let l = t, h = e,
|
|
473
|
-
for (let
|
|
474
|
-
const
|
|
475
|
-
|
|
473
|
+
function ot(t, e, n) {
|
|
474
|
+
const [r, s, o, i, a, c] = n, u = [0];
|
|
475
|
+
let l = t, h = e, f = 0;
|
|
476
|
+
for (let p = 1; p <= Yt; p++) {
|
|
477
|
+
const M = p / Yt, d = z(t, r, o, a, M), g = z(e, s, i, c, M);
|
|
478
|
+
f += Math.hypot(d - l, g - h), u.push(f), l = d, h = g;
|
|
476
479
|
}
|
|
477
480
|
return {
|
|
478
481
|
subpath: 0,
|
|
479
482
|
type: "C",
|
|
480
|
-
points: [r, s, i, a,
|
|
483
|
+
points: [r, s, o, i, a, c],
|
|
481
484
|
startX: t,
|
|
482
485
|
startY: e,
|
|
483
|
-
endX:
|
|
486
|
+
endX: a,
|
|
484
487
|
endY: c,
|
|
485
|
-
length:
|
|
488
|
+
length: f,
|
|
486
489
|
lengths: u
|
|
487
490
|
};
|
|
488
491
|
}
|
|
489
|
-
function
|
|
490
|
-
const e =
|
|
492
|
+
function G(t) {
|
|
493
|
+
const e = W.get(t);
|
|
491
494
|
if (e) return e;
|
|
492
495
|
const n = [];
|
|
493
|
-
let r = 0, s = 0,
|
|
496
|
+
let r = 0, s = 0, o = 0, i = 0, a = null, c = null, u = -1;
|
|
494
497
|
const l = /* @__PURE__ */ new Set(), h = (d) => {
|
|
495
498
|
u < 0 && (u = 0), d.subpath = u, n.push(d);
|
|
496
499
|
};
|
|
497
|
-
for (const { type: d, args: g } of
|
|
498
|
-
const
|
|
499
|
-
if (
|
|
500
|
-
(r !==
|
|
500
|
+
for (const { type: d, args: g } of an(t)) {
|
|
501
|
+
const _ = d.toUpperCase(), b = d !== _, k = on[_];
|
|
502
|
+
if (_ === "Z") {
|
|
503
|
+
(r !== o || s !== i) && h(q(r, s, o, i)), u >= 0 && l.add(u), r = o, s = i, a = c = null;
|
|
501
504
|
continue;
|
|
502
505
|
}
|
|
503
|
-
for (let
|
|
504
|
-
const y = g.slice(
|
|
505
|
-
let
|
|
506
|
-
switch (
|
|
506
|
+
for (let w = 0; w + k <= g.length; w += k) {
|
|
507
|
+
const y = g.slice(w, w + k), v = b ? r : 0, A = b ? s : 0;
|
|
508
|
+
let D = null, m = null;
|
|
509
|
+
switch (_) {
|
|
507
510
|
case "M":
|
|
508
|
-
|
|
511
|
+
w === 0 ? (r = y[0] + v, s = y[1] + A, o = r, i = s, (u < 0 || n[n.length - 1]?.subpath === u) && u++) : (h(q(r, s, y[0] + v, y[1] + A)), r = y[0] + v, s = y[1] + A);
|
|
509
512
|
break;
|
|
510
513
|
case "L":
|
|
511
|
-
h(
|
|
514
|
+
h(q(r, s, y[0] + v, y[1] + A)), r = y[0] + v, s = y[1] + A;
|
|
512
515
|
break;
|
|
513
516
|
case "H":
|
|
514
|
-
h(
|
|
517
|
+
h(q(r, s, y[0] + v, s)), r = y[0] + v;
|
|
515
518
|
break;
|
|
516
519
|
case "V":
|
|
517
|
-
h(
|
|
520
|
+
h(q(r, s, r, y[0] + A)), s = y[0] + A;
|
|
518
521
|
break;
|
|
519
522
|
case "C": {
|
|
520
|
-
const T = [y[0] +
|
|
521
|
-
h(
|
|
523
|
+
const T = [y[0] + v, y[1] + A, y[2] + v, y[3] + A, y[4] + v, y[5] + A];
|
|
524
|
+
h(ot(r, s, T)), D = [T[2], T[3]], r = T[4], s = T[5];
|
|
522
525
|
break;
|
|
523
526
|
}
|
|
524
527
|
case "S": {
|
|
525
|
-
const [T, x] =
|
|
526
|
-
h(
|
|
528
|
+
const [T, x] = a ? [2 * r - a[0], 2 * s - a[1]] : [r, s], S = [T, x, y[0] + v, y[1] + A, y[2] + v, y[3] + A];
|
|
529
|
+
h(ot(r, s, S)), D = [S[2], S[3]], r = S[4], s = S[5];
|
|
527
530
|
break;
|
|
528
531
|
}
|
|
529
532
|
case "Q":
|
|
530
533
|
case "T": {
|
|
531
534
|
let T = r, x = s;
|
|
532
|
-
|
|
533
|
-
const
|
|
535
|
+
_ === "Q" ? (T = y[0] + v, x = y[1] + A) : c && (T = 2 * r - c[0], x = 2 * s - c[1]);
|
|
536
|
+
const S = _ === "Q" ? y[2] + v : y[0] + v, $ = _ === "Q" ? y[3] + A : y[1] + A;
|
|
534
537
|
h(
|
|
535
|
-
|
|
538
|
+
ot(r, s, [
|
|
536
539
|
r + 2 / 3 * (T - r),
|
|
537
540
|
s + 2 / 3 * (x - s),
|
|
538
|
-
|
|
541
|
+
S + 2 / 3 * (T - S),
|
|
539
542
|
$ + 2 / 3 * (x - $),
|
|
540
|
-
|
|
543
|
+
S,
|
|
541
544
|
$
|
|
542
545
|
])
|
|
543
|
-
), m = [T, x], r =
|
|
546
|
+
), m = [T, x], r = S, s = $;
|
|
544
547
|
break;
|
|
545
548
|
}
|
|
546
549
|
case "A": {
|
|
547
|
-
const T = y[5] +
|
|
548
|
-
let
|
|
549
|
-
for (const
|
|
550
|
-
h(
|
|
550
|
+
const T = y[5] + v, x = y[6] + A;
|
|
551
|
+
let S = r, $ = s;
|
|
552
|
+
for (const P of cn(r, s, y[0], y[1], y[2], y[3], y[4], T, x))
|
|
553
|
+
h(ot(S, $, P)), S = P[4], $ = P[5];
|
|
551
554
|
r = T, s = x;
|
|
552
555
|
break;
|
|
553
556
|
}
|
|
554
557
|
}
|
|
555
|
-
|
|
558
|
+
a = D, c = m;
|
|
556
559
|
}
|
|
557
560
|
}
|
|
558
|
-
const
|
|
561
|
+
const f = n.reduce((d, g) => d + g.length, 0), p = [];
|
|
559
562
|
for (let d = 0; d < n.length; ) {
|
|
560
563
|
const g = n[d].subpath;
|
|
561
|
-
let
|
|
562
|
-
for (;
|
|
563
|
-
const k = n[d],
|
|
564
|
-
|
|
564
|
+
let _ = d, b = 0;
|
|
565
|
+
for (; _ < n.length && n[_].subpath === g; ) b += n[_++].length;
|
|
566
|
+
const k = n[d], w = n[_ - 1], y = l.has(g) || Math.abs(w.endX - k.startX) < 1e-9 && Math.abs(w.endY - k.startY) < 1e-9;
|
|
567
|
+
p.push({ start: d, end: _, length: b, closed: y }), d = _;
|
|
565
568
|
}
|
|
566
|
-
const
|
|
567
|
-
return
|
|
569
|
+
const M = { segments: n, totalLength: f, subpaths: p };
|
|
570
|
+
return W.size >= nn && W.delete(W.keys().next().value), W.set(t, M), M;
|
|
568
571
|
}
|
|
569
|
-
function
|
|
572
|
+
function un(t, e) {
|
|
570
573
|
const n = t.lengths;
|
|
571
574
|
if (e <= 0) return 0;
|
|
572
575
|
if (e >= t.length) return 1;
|
|
573
576
|
let r = 0, s = n.length - 1;
|
|
574
577
|
for (; r < s - 1; ) {
|
|
575
|
-
const
|
|
576
|
-
n[
|
|
578
|
+
const a = r + s >> 1;
|
|
579
|
+
n[a] < e ? r = a : s = a;
|
|
577
580
|
}
|
|
578
|
-
const
|
|
579
|
-
return (r +
|
|
581
|
+
const o = n[s] - n[r], i = o > 0 ? (e - n[r]) / o : 0;
|
|
582
|
+
return (r + i) / (n.length - 1);
|
|
580
583
|
}
|
|
581
|
-
function
|
|
584
|
+
function ln(t, e) {
|
|
582
585
|
if (t.type === "L") {
|
|
583
586
|
const h = t.length > 0 ? Math.max(0, Math.min(1, e / t.length)) : 0;
|
|
584
587
|
return {
|
|
@@ -587,304 +590,378 @@ function We(t, e) {
|
|
|
587
590
|
angle: Math.atan2(t.endY - t.startY, t.endX - t.startX) * 180 / Math.PI
|
|
588
591
|
};
|
|
589
592
|
}
|
|
590
|
-
const [n, r, s, i, a
|
|
591
|
-
let u =
|
|
593
|
+
const [n, r, s, o, i, a] = t.points, c = un(t, e);
|
|
594
|
+
let u = Ut(t.startX, n, s, i, c), l = Ut(t.startY, r, o, a, c);
|
|
592
595
|
if (Math.hypot(u, l) < 1e-9) {
|
|
593
|
-
const h = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3),
|
|
594
|
-
u = c < 0.5 ?
|
|
596
|
+
const h = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), f = z(t.startX, n, s, i, h), p = z(t.startY, r, o, a, h), M = z(t.startX, n, s, i, c), d = z(t.startY, r, o, a, c);
|
|
597
|
+
u = c < 0.5 ? f - M : M - f, l = c < 0.5 ? p - d : d - p;
|
|
595
598
|
}
|
|
596
599
|
return {
|
|
597
|
-
x:
|
|
598
|
-
y:
|
|
600
|
+
x: z(t.startX, n, s, i, c),
|
|
601
|
+
y: z(t.startY, r, o, a, c),
|
|
599
602
|
angle: Math.atan2(l, u) * 180 / Math.PI
|
|
600
603
|
};
|
|
601
604
|
}
|
|
602
|
-
function
|
|
605
|
+
function he(t, e, n = 0, r = t.length) {
|
|
603
606
|
if (r <= n) return { x: 0, y: 0, angle: 0 };
|
|
604
607
|
let s = 0;
|
|
605
|
-
for (let
|
|
606
|
-
const
|
|
607
|
-
if (s +
|
|
608
|
-
return
|
|
609
|
-
s +=
|
|
608
|
+
for (let o = n; o < r; o++) {
|
|
609
|
+
const i = t[o];
|
|
610
|
+
if (s + i.length >= e || o === r - 1)
|
|
611
|
+
return ln(i, e - s);
|
|
612
|
+
s += i.length;
|
|
610
613
|
}
|
|
611
614
|
return { x: 0, y: 0, angle: 0 };
|
|
612
615
|
}
|
|
613
|
-
function
|
|
614
|
-
const { segments: n, totalLength: r } =
|
|
615
|
-
return
|
|
616
|
+
function hn(t, e) {
|
|
617
|
+
const { segments: n, totalLength: r } = G(t);
|
|
618
|
+
return he(n, Math.max(0, Math.min(1, e)) * r);
|
|
616
619
|
}
|
|
617
|
-
function
|
|
618
|
-
|
|
620
|
+
function Cr() {
|
|
621
|
+
W.clear();
|
|
619
622
|
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
623
|
+
function Ir(t) {
|
|
624
|
+
return G(t).totalLength;
|
|
622
625
|
}
|
|
623
|
-
const
|
|
624
|
-
let
|
|
625
|
-
const
|
|
626
|
-
function
|
|
627
|
-
const { segments: n, subpaths: r, totalLength: s } =
|
|
626
|
+
const fn = 24, pn = 320, dn = 2.5, J = 72, Er = 64, gn = 0.2, mn = 128, et = /* @__PURE__ */ new Map();
|
|
627
|
+
let it = 0, X;
|
|
628
|
+
const Vt = (t) => Math.round(t * 100) / 100;
|
|
629
|
+
function jt(t, e) {
|
|
630
|
+
const { segments: n, subpaths: r, totalLength: s } = G(t);
|
|
628
631
|
if (n.length === 0) return [];
|
|
629
632
|
if (e) {
|
|
630
|
-
const
|
|
631
|
-
return [{ segments: n, start: 0, end: n.length, length: s, closed:
|
|
633
|
+
const o = r.every((i) => i.closed);
|
|
634
|
+
return [{ segments: n, start: 0, end: n.length, length: s, closed: o }];
|
|
632
635
|
}
|
|
633
|
-
return r.filter((
|
|
636
|
+
return r.filter((o) => o.length > 0).map((o) => ({ segments: n, start: o.start, end: o.end, length: o.length, closed: o.closed }));
|
|
634
637
|
}
|
|
635
|
-
function
|
|
636
|
-
const n = t.closed ? (e % 1 + 1) % 1 : Math.max(0, Math.min(1, e)), r =
|
|
638
|
+
function At(t, e) {
|
|
639
|
+
const n = t.closed ? (e % 1 + 1) % 1 : Math.max(0, Math.min(1, e)), r = he(t.segments, n * t.length, t.start, t.end);
|
|
637
640
|
return [r.x, r.y];
|
|
638
641
|
}
|
|
639
|
-
function
|
|
642
|
+
function Ht(t) {
|
|
640
643
|
const e = [];
|
|
641
644
|
let n = 0;
|
|
642
645
|
for (let r = t.start; r < t.end; r++)
|
|
643
646
|
n += t.segments[r].length, t.length > 0 && e.push(n / t.length);
|
|
644
647
|
return e;
|
|
645
648
|
}
|
|
646
|
-
function
|
|
649
|
+
function Bt(t, e) {
|
|
647
650
|
const n = [];
|
|
648
651
|
for (let r = 0; r < e; r++)
|
|
649
|
-
n.push(
|
|
652
|
+
n.push(At(t, t.closed ? r / e : r / (e - 1)));
|
|
650
653
|
return n;
|
|
651
654
|
}
|
|
652
|
-
function
|
|
655
|
+
function Wt(t) {
|
|
653
656
|
let e = 0, n = 0;
|
|
654
657
|
for (const [r, s] of t)
|
|
655
658
|
e += r, n += s;
|
|
656
659
|
return e /= t.length, n /= t.length, t.map(([r, s]) => [r - e, s - n]);
|
|
657
660
|
}
|
|
658
|
-
function
|
|
661
|
+
function yn(t, e, n) {
|
|
659
662
|
const r = t.closed && e.closed;
|
|
660
663
|
if (n !== void 0)
|
|
661
|
-
return { offset: r ? Math.abs(n) %
|
|
662
|
-
const s =
|
|
663
|
-
let
|
|
664
|
+
return { offset: r ? Math.abs(n) % J / J : 0, reversed: n < 0 };
|
|
665
|
+
const s = Wt(Bt(t, J)), o = Wt(Bt(e, J)), i = J;
|
|
666
|
+
let a = { offset: 0, reversed: !1 }, c = 1 / 0;
|
|
664
667
|
for (const u of [!1, !0]) {
|
|
665
|
-
const l = r ?
|
|
668
|
+
const l = r ? i : 1;
|
|
666
669
|
for (let h = 0; h < l; h++) {
|
|
667
|
-
let
|
|
668
|
-
for (let
|
|
669
|
-
const
|
|
670
|
-
|
|
670
|
+
let f = 0;
|
|
671
|
+
for (let p = 0; p < i && f < c; p++) {
|
|
672
|
+
const M = r ? u ? (h - p + i) % i : (p + h) % i : u ? i - 1 - p : p, d = s[p][0] - o[M][0], g = s[p][1] - o[M][1];
|
|
673
|
+
f += d * d + g * g;
|
|
671
674
|
}
|
|
672
|
-
|
|
675
|
+
f < c && (c = f, a = { offset: r ? h / i : 0, reversed: u });
|
|
673
676
|
}
|
|
674
677
|
}
|
|
675
|
-
return
|
|
678
|
+
return a;
|
|
676
679
|
}
|
|
677
|
-
function
|
|
680
|
+
function Mn(t, e, n) {
|
|
678
681
|
return n ? ((e.reversed ? e.offset - t : t + e.offset) % 1 + 1) % 1 : e.reversed ? 1 - t : t;
|
|
679
682
|
}
|
|
680
|
-
function
|
|
683
|
+
function _n(t, e, n) {
|
|
681
684
|
return n ? ((e.reversed ? e.offset - t : t - e.offset) % 1 + 1) % 1 : e.reversed ? 1 - t : t;
|
|
682
685
|
}
|
|
683
|
-
function
|
|
684
|
-
const r = t.closed && e.closed, s =
|
|
685
|
-
|
|
686
|
-
Math.min(
|
|
687
|
-
),
|
|
688
|
-
for (let h = 0; h <=
|
|
689
|
-
for (const h of
|
|
690
|
-
for (const h of
|
|
691
|
-
let c = [...
|
|
686
|
+
function bn(t, e, n) {
|
|
687
|
+
const r = t.closed && e.closed, s = yn(t, e, n.shapeIndex), o = Math.max(
|
|
688
|
+
fn,
|
|
689
|
+
Math.min(pn, Math.ceil(Math.max(t.length, e.length) / dn))
|
|
690
|
+
), i = /* @__PURE__ */ new Set(), a = (h) => i.add(Math.round(h * 1e7) / 1e7);
|
|
691
|
+
for (let h = 0; h <= o; h++) a(h / o);
|
|
692
|
+
for (const h of Ht(t)) a(h);
|
|
693
|
+
for (const h of Ht(e)) a(_n(h, s, r));
|
|
694
|
+
let c = [...i].sort((h, f) => h - f);
|
|
692
695
|
r && (c = c.filter((h) => h < 1));
|
|
693
696
|
const u = [], l = [];
|
|
694
697
|
for (const h of c)
|
|
695
|
-
u.push(...
|
|
696
|
-
return
|
|
698
|
+
u.push(...At(t, h)), l.push(...At(e, Mn(h, s, r)));
|
|
699
|
+
return Tn({ from: u, to: l, closed: r });
|
|
697
700
|
}
|
|
698
|
-
function
|
|
701
|
+
function Tn(t) {
|
|
699
702
|
const e = t.from.length / 2;
|
|
700
703
|
if (e <= 3) return t;
|
|
701
704
|
const n = new Uint8Array(e);
|
|
702
705
|
n[0] = 1, n[e - 1] = 1;
|
|
703
706
|
const r = [[0, e - 1]];
|
|
704
707
|
for (; r.length > 0; ) {
|
|
705
|
-
const [
|
|
706
|
-
let c = -1, u =
|
|
707
|
-
for (let l =
|
|
708
|
-
const h = Math.max(
|
|
708
|
+
const [i, a] = r.pop();
|
|
709
|
+
let c = -1, u = gn;
|
|
710
|
+
for (let l = i + 1; l < a; l++) {
|
|
711
|
+
const h = Math.max(Qt(t.from, i, a, l), Qt(t.to, i, a, l));
|
|
709
712
|
h > u && (u = h, c = l);
|
|
710
713
|
}
|
|
711
|
-
c !== -1 && (n[c] = 1, r.push([
|
|
714
|
+
c !== -1 && (n[c] = 1, r.push([i, c], [c, a]));
|
|
712
715
|
}
|
|
713
|
-
const s = [],
|
|
714
|
-
for (let
|
|
715
|
-
n[
|
|
716
|
-
return { from: s, to:
|
|
716
|
+
const s = [], o = [];
|
|
717
|
+
for (let i = 0; i < e; i++)
|
|
718
|
+
n[i] && (s.push(t.from[i * 2], t.from[i * 2 + 1]), o.push(t.to[i * 2], t.to[i * 2 + 1]));
|
|
719
|
+
return { from: s, to: o, closed: t.closed };
|
|
717
720
|
}
|
|
718
|
-
function
|
|
719
|
-
const s = t[e * 2],
|
|
720
|
-
return Math.hypot(c - h *
|
|
721
|
+
function Qt(t, e, n, r) {
|
|
722
|
+
const s = t[e * 2], o = t[e * 2 + 1], i = t[n * 2] - s, a = t[n * 2 + 1] - o, c = t[r * 2] - s, u = t[r * 2 + 1] - o, l = i * i + a * a, h = l === 0 ? 0 : Math.max(0, Math.min(1, (c * i + u * a) / l));
|
|
723
|
+
return Math.hypot(c - h * i, u - h * a);
|
|
721
724
|
}
|
|
722
|
-
function
|
|
725
|
+
function xn(t, e, n) {
|
|
723
726
|
const r = n.shapeIndex;
|
|
724
|
-
if (
|
|
725
|
-
const
|
|
726
|
-
if (
|
|
727
|
-
return
|
|
728
|
-
const
|
|
729
|
-
pairs:
|
|
727
|
+
if (X && X.from === t && X.to === e && X.shapeIndex === r) return X.plan;
|
|
728
|
+
const o = et.get(String(r ?? "auto"))?.get(t)?.get(e);
|
|
729
|
+
if (o)
|
|
730
|
+
return X = { from: t, to: e, shapeIndex: r, plan: o }, o;
|
|
731
|
+
const i = G(t).subpaths.filter((p) => p.length > 0).length === G(e).subpaths.filter((p) => p.length > 0).length, a = jt(t, !i), c = jt(e, !i), u = {
|
|
732
|
+
pairs: a.map((p, M) => bn(p, c[M], n))
|
|
730
733
|
};
|
|
731
|
-
|
|
732
|
-
const l = String(r ?? "auto"), h =
|
|
733
|
-
|
|
734
|
-
const
|
|
735
|
-
return h.set(t,
|
|
734
|
+
it >= mn && (et.clear(), it = 0);
|
|
735
|
+
const l = String(r ?? "auto"), h = et.get(l) ?? /* @__PURE__ */ new Map();
|
|
736
|
+
et.set(l, h);
|
|
737
|
+
const f = h.get(t) ?? /* @__PURE__ */ new Map();
|
|
738
|
+
return h.set(t, f), f.set(e, u), it++, X = { from: t, to: e, shapeIndex: r, plan: u }, u;
|
|
736
739
|
}
|
|
737
|
-
function
|
|
740
|
+
function kn(t, e, n, r = {}) {
|
|
738
741
|
if (!t) return e;
|
|
739
742
|
if (!e) return t;
|
|
740
743
|
const s = Math.max(0, Math.min(1, n));
|
|
741
744
|
if (s === 0) return t;
|
|
742
745
|
if (s === 1) return e;
|
|
743
|
-
const
|
|
744
|
-
if (
|
|
745
|
-
let
|
|
746
|
-
for (const
|
|
747
|
-
for (let c = 0; c <
|
|
748
|
-
const u =
|
|
749
|
-
|
|
746
|
+
const o = xn(t, e, r);
|
|
747
|
+
if (o.pairs.length === 0) return s < 0.5 ? t : e;
|
|
748
|
+
let i = "";
|
|
749
|
+
for (const a of o.pairs) {
|
|
750
|
+
for (let c = 0; c < a.from.length; c += 2) {
|
|
751
|
+
const u = Vt(a.from[c] + (a.to[c] - a.from[c]) * s), l = Vt(a.from[c + 1] + (a.to[c + 1] - a.from[c + 1]) * s);
|
|
752
|
+
i += `${c === 0 ? i ? " M" : "M" : " L"}${u} ${l}`;
|
|
750
753
|
}
|
|
751
|
-
|
|
754
|
+
a.closed && (i += " Z");
|
|
752
755
|
}
|
|
753
|
-
return
|
|
756
|
+
return i;
|
|
754
757
|
}
|
|
755
|
-
function
|
|
756
|
-
|
|
758
|
+
function Lr() {
|
|
759
|
+
et.clear(), it = 0, X = void 0;
|
|
757
760
|
}
|
|
758
|
-
function
|
|
761
|
+
function Sn(t) {
|
|
759
762
|
return /^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(t);
|
|
760
763
|
}
|
|
761
|
-
const
|
|
762
|
-
function
|
|
763
|
-
|
|
764
|
+
const Q = Math.PI / 180, An = 0.9995;
|
|
765
|
+
function Dt() {
|
|
766
|
+
return [0, 0, 0, 1];
|
|
767
|
+
}
|
|
768
|
+
function at(t, e) {
|
|
769
|
+
const n = Math.hypot(t[0], t[1], t[2]);
|
|
770
|
+
if (n === 0) return Dt();
|
|
771
|
+
const r = e * Q / 2, s = Math.sin(r) / n;
|
|
772
|
+
return [t[0] * s, t[1] * s, t[2] * s, Math.cos(r)];
|
|
773
|
+
}
|
|
774
|
+
function wn(t, e, n) {
|
|
775
|
+
return wt(wt(at([0, 1, 0], e), at([1, 0, 0], t)), at([0, 0, 1], n));
|
|
776
|
+
}
|
|
777
|
+
function vn(t) {
|
|
778
|
+
const [e, n, r, s] = Y(t), o = 2 * (e * r + n * s), i = 2 * (e * n + r * s), a = 1 - 2 * (e * e + r * r), c = 2 * (n * r - e * s), u = 1 - 2 * (n * n + r * r), l = 2 * (e * r - n * s), h = 1 - 2 * (e * e + n * n), f = Math.asin(Math.max(-1, Math.min(1, -c)));
|
|
779
|
+
return Math.abs(c) < 0.9999999 ? [f / Q, Math.atan2(o, h) / Q, Math.atan2(i, a) / Q] : [f / Q, Math.atan2(-l, u) / Q, 0];
|
|
780
|
+
}
|
|
781
|
+
function wt(t, e) {
|
|
782
|
+
const [n, r, s, o] = t, [i, a, c, u] = e;
|
|
783
|
+
return [
|
|
784
|
+
o * i + n * u + r * c - s * a,
|
|
785
|
+
o * a - n * c + r * u + s * i,
|
|
786
|
+
o * c + n * a - r * i + s * u,
|
|
787
|
+
o * u - n * i - r * a - s * c
|
|
788
|
+
];
|
|
789
|
+
}
|
|
790
|
+
function fe(t, e) {
|
|
791
|
+
return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] + t[3] * e[3];
|
|
792
|
+
}
|
|
793
|
+
function pe(t) {
|
|
794
|
+
return Math.hypot(t[0], t[1], t[2], t[3]);
|
|
795
|
+
}
|
|
796
|
+
function Y(t) {
|
|
797
|
+
const e = pe(t);
|
|
798
|
+
return e === 0 ? Dt() : [t[0] / e, t[1] / e, t[2] / e, t[3] / e];
|
|
799
|
+
}
|
|
800
|
+
function Pn(t) {
|
|
801
|
+
return [-t[0], -t[1], -t[2], t[3]];
|
|
802
|
+
}
|
|
803
|
+
function de(t, e, n) {
|
|
804
|
+
const r = Y(t);
|
|
805
|
+
let s = Y(e), o = fe(r, s);
|
|
806
|
+
if (o < 0 && (s = [-s[0], -s[1], -s[2], -s[3]], o = -o), o > An)
|
|
807
|
+
return Y([
|
|
808
|
+
r[0] + (s[0] - r[0]) * n,
|
|
809
|
+
r[1] + (s[1] - r[1]) * n,
|
|
810
|
+
r[2] + (s[2] - r[2]) * n,
|
|
811
|
+
r[3] + (s[3] - r[3]) * n
|
|
812
|
+
]);
|
|
813
|
+
const i = Math.acos(o), a = Math.sin(i), c = Math.sin((1 - n) * i) / a, u = Math.sin(n * i) / a;
|
|
814
|
+
return Y([
|
|
815
|
+
r[0] * c + s[0] * u,
|
|
816
|
+
r[1] * c + s[1] * u,
|
|
817
|
+
r[2] * c + s[2] * u,
|
|
818
|
+
r[3] * c + s[3] * u
|
|
819
|
+
]);
|
|
820
|
+
}
|
|
821
|
+
function $n(t, e) {
|
|
822
|
+
const [n, r, s, o] = Y(t), i = 2 * (r * e[2] - s * e[1]), a = 2 * (s * e[0] - n * e[2]), c = 2 * (n * e[1] - r * e[0]);
|
|
823
|
+
return [e[0] + o * i + (r * c - s * a), e[1] + o * a + (s * i - n * c), e[2] + o * c + (n * a - r * i)];
|
|
824
|
+
}
|
|
825
|
+
const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
826
|
+
__proto__: null,
|
|
827
|
+
conjugate: Pn,
|
|
828
|
+
dot: fe,
|
|
829
|
+
fromAxisAngle: at,
|
|
830
|
+
fromEuler: wn,
|
|
831
|
+
identity: Dt,
|
|
832
|
+
length: pe,
|
|
833
|
+
multiply: wt,
|
|
834
|
+
normalize: Y,
|
|
835
|
+
rotateVec3: $n,
|
|
836
|
+
slerp: de,
|
|
837
|
+
toEuler: vn
|
|
838
|
+
}, Symbol.toStringTag, { value: "Module" })), N = (t, e, n) => t + (e - t) * n, ge = 512, mt = /* @__PURE__ */ new Map(), yt = /* @__PURE__ */ new Map();
|
|
839
|
+
function Gt(t) {
|
|
840
|
+
const e = mt.get(t);
|
|
764
841
|
if (e) return e;
|
|
765
842
|
const n = t.replace("#", ""), r = [
|
|
766
843
|
parseInt(n.slice(0, 2), 16),
|
|
767
844
|
parseInt(n.slice(2, 4), 16),
|
|
768
845
|
parseInt(n.slice(4, 6), 16)
|
|
769
846
|
];
|
|
770
|
-
return
|
|
847
|
+
return mt.size < ge && mt.set(t, r), r;
|
|
771
848
|
}
|
|
772
|
-
const
|
|
773
|
-
function
|
|
774
|
-
return `#${
|
|
849
|
+
const Kt = (t) => t.charCodeAt(0) === 35, Zt = (t) => t.startsWith("rgb"), qt = (t) => t.startsWith("rgba"), Rn = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, Mt = (t) => Math.round(t).toString(16).padStart(2, "0");
|
|
850
|
+
function Dn(t, e, n) {
|
|
851
|
+
return `#${Mt(t)}${Mt(e)}${Mt(n)}`;
|
|
775
852
|
}
|
|
776
|
-
function
|
|
777
|
-
const e =
|
|
853
|
+
function Jt(t) {
|
|
854
|
+
const e = yt.get(t);
|
|
778
855
|
if (e) return e;
|
|
779
|
-
const n = t.match(
|
|
856
|
+
const n = t.match(Rn);
|
|
780
857
|
if (!n)
|
|
781
858
|
throw new Error(`Invalid rgb color: ${t}`);
|
|
782
|
-
const r = parseInt(n[1], 10), s = parseInt(n[2], 10),
|
|
783
|
-
return
|
|
859
|
+
const r = parseInt(n[1], 10), s = parseInt(n[2], 10), o = parseInt(n[3], 10), i = n[4] !== void 0 ? [r, s, o, parseFloat(n[4])] : [r, s, o];
|
|
860
|
+
return yt.size < ge && yt.set(t, i), i;
|
|
784
861
|
}
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
787
|
-
const [r, s,
|
|
788
|
-
return
|
|
862
|
+
const Cn = (t, e, n) => {
|
|
863
|
+
if (Kt(t) && Kt(e)) {
|
|
864
|
+
const [r, s, o] = Gt(t), [i, a, c] = Gt(e), u = N(r, i, n), l = N(s, a, n), h = N(o, c, n);
|
|
865
|
+
return Dn(u, l, h);
|
|
789
866
|
}
|
|
790
|
-
if ((
|
|
791
|
-
const r =
|
|
867
|
+
if ((Zt(t) || qt(t)) && (Zt(e) || qt(e))) {
|
|
868
|
+
const r = Jt(t), s = Jt(e), o = Math.round(N(r[0], s[0], n)), i = Math.round(N(r[1], s[1], n)), a = Math.round(N(r[2], s[2], n));
|
|
792
869
|
if (r.length === 4 || s.length === 4) {
|
|
793
|
-
const c = r[3] ?? 1, u = s[3] ?? 1, l =
|
|
794
|
-
return `rgba(${
|
|
870
|
+
const c = r[3] ?? 1, u = s[3] ?? 1, l = N(c, u, n);
|
|
871
|
+
return `rgba(${o}, ${i}, ${a}, ${l})`;
|
|
795
872
|
}
|
|
796
|
-
return `rgb(${
|
|
873
|
+
return `rgb(${o}, ${i}, ${a})`;
|
|
797
874
|
}
|
|
798
875
|
return n < 1 ? t : e;
|
|
799
|
-
},
|
|
876
|
+
}, In = (t, e, n) => {
|
|
800
877
|
const r = Math.min(t.length, e.length), s = [];
|
|
801
|
-
for (let
|
|
802
|
-
s.push(
|
|
878
|
+
for (let o = 0; o < r; o++)
|
|
879
|
+
s.push(N(t[o], e[o], n));
|
|
803
880
|
return s;
|
|
804
|
-
},
|
|
805
|
-
function
|
|
806
|
-
return typeof t == "number" ?
|
|
881
|
+
}, En = (t, e, n) => de(t, e, n), te = (t, e, n) => n < 1 ? t : e, Ln = (t, e, n) => kn(t, e, n);
|
|
882
|
+
function me(t, e) {
|
|
883
|
+
return e === "slerp" ? En : typeof t == "number" ? N : Array.isArray(t) ? In : typeof t == "string" ? t.startsWith("#") || t.startsWith("rgb") ? Cn : Sn(t) ? Ln : te : te;
|
|
807
884
|
}
|
|
808
|
-
const
|
|
809
|
-
function
|
|
810
|
-
if (!
|
|
885
|
+
const ye = 1e3 / 60;
|
|
886
|
+
function Me(t, e = {}) {
|
|
887
|
+
if (!j(t))
|
|
811
888
|
throw new Error(`bakeSpringTrack: track "${t.id}" is not a spring track`);
|
|
812
|
-
const n = new
|
|
813
|
-
return
|
|
889
|
+
const n = new ut(t.spring);
|
|
890
|
+
return be(t, (r) => n.valueAt(r), n.settleTime(), t.spring.from, t.spring.to, e);
|
|
814
891
|
}
|
|
815
|
-
function
|
|
892
|
+
function _e(t, e = {}) {
|
|
816
893
|
if (!V(t))
|
|
817
894
|
throw new Error(`bakeInertiaTrack: track "${t.id}" is not an inertia track`);
|
|
818
895
|
const n = t.inertia;
|
|
819
|
-
return
|
|
896
|
+
return be(
|
|
820
897
|
t,
|
|
821
|
-
(r) =>
|
|
822
|
-
|
|
898
|
+
(r) => kt(n, r),
|
|
899
|
+
ft(n),
|
|
823
900
|
n.from,
|
|
824
|
-
|
|
901
|
+
ht(n),
|
|
825
902
|
e
|
|
826
903
|
);
|
|
827
904
|
}
|
|
828
|
-
function
|
|
829
|
-
const
|
|
830
|
-
for (let h = 0; h <= n; h +=
|
|
905
|
+
function be(t, e, n, r, s, o) {
|
|
906
|
+
const i = o.intervalMs ?? ye, a = o.tolerance ?? 0.01, c = t.delay ?? 0, u = [];
|
|
907
|
+
for (let h = 0; h <= n; h += i)
|
|
831
908
|
u.push({ time: h + c, value: e(h), easing: "linear" });
|
|
832
909
|
const l = u[u.length - 1];
|
|
833
910
|
return !l || l.time < n + c ? u.push({ time: n + c, value: s, easing: "linear" }) : l.value = s, c > 0 && u.unshift({ time: 0, value: r, easing: "linear" }), {
|
|
834
911
|
id: t.id,
|
|
835
912
|
target: t.target,
|
|
836
913
|
property: t.property,
|
|
837
|
-
keyframes:
|
|
914
|
+
keyframes: a > 0 ? Nn(u, a) : u,
|
|
838
915
|
...t.targets && { targets: [...t.targets] },
|
|
839
916
|
...t.stagger && { stagger: { ...t.stagger } }
|
|
840
917
|
};
|
|
841
918
|
}
|
|
842
|
-
function
|
|
843
|
-
const s = r.intervalMs ??
|
|
844
|
-
if (
|
|
919
|
+
function On(t, e, n, r = {}) {
|
|
920
|
+
const s = r.intervalMs ?? ye, o = typeof n == "function" ? n : le(n), i = me(t.value, r.interpolation), a = e.time - t.time;
|
|
921
|
+
if (a <= 0) return [e];
|
|
845
922
|
const c = [];
|
|
846
|
-
for (let l = s; l <
|
|
847
|
-
const h = l /
|
|
923
|
+
for (let l = s; l < a; l += s) {
|
|
924
|
+
const h = l / a;
|
|
848
925
|
c.push({
|
|
849
926
|
time: t.time + l,
|
|
850
|
-
value:
|
|
927
|
+
value: i(t.value, e.value, o(h)),
|
|
851
928
|
easing: "linear"
|
|
852
929
|
});
|
|
853
930
|
}
|
|
854
|
-
const u =
|
|
855
|
-
return c.push({ ...e, ...u !== 1 && { value:
|
|
931
|
+
const u = o(1);
|
|
932
|
+
return c.push({ ...e, ...u !== 1 && { value: i(t.value, e.value, u) }, easing: "linear" }), c;
|
|
856
933
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
934
|
+
function Fr(t, e) {
|
|
935
|
+
return j(t) ? Me(t, e) : V(t) ? _e(t, e) : t;
|
|
859
936
|
}
|
|
860
|
-
function
|
|
937
|
+
function Fn(t, e = {}) {
|
|
861
938
|
const n = t.keyframes;
|
|
862
|
-
if (!n.some((
|
|
863
|
-
const r = n.length > 0 ? [n[0]] : [];
|
|
864
|
-
for (let
|
|
865
|
-
const i = n[
|
|
866
|
-
|
|
939
|
+
if (!n.some((o) => xt(o.easing))) return t;
|
|
940
|
+
const r = n.length > 0 ? [n[0]] : [], s = { ...e, interpolation: t.interpolation ?? e.interpolation };
|
|
941
|
+
for (let o = 1; o < n.length; o++) {
|
|
942
|
+
const i = n[o];
|
|
943
|
+
xt(i.easing) ? r.push(...On(n[o - 1], i, i.easing, s)) : r.push(i);
|
|
867
944
|
}
|
|
868
945
|
return { ...t, keyframes: r };
|
|
869
946
|
}
|
|
870
|
-
function
|
|
871
|
-
return t.filter(
|
|
872
|
-
t.filter(
|
|
873
|
-
t.filter(V).map((n) =>
|
|
947
|
+
function Nr(t, e) {
|
|
948
|
+
return t.filter(Le).map((n) => Fn(n, e)).concat(
|
|
949
|
+
t.filter(j).map((n) => Me(n, e)),
|
|
950
|
+
t.filter(V).map((n) => _e(n, e))
|
|
874
951
|
);
|
|
875
952
|
}
|
|
876
|
-
function
|
|
953
|
+
function Nn(t, e) {
|
|
877
954
|
if (t.length <= 2) return t;
|
|
878
955
|
const n = [t[0]];
|
|
879
956
|
for (let r = 1; r < t.length - 1; r++) {
|
|
880
|
-
const s = n[n.length - 1],
|
|
881
|
-
if (
|
|
882
|
-
const c = (
|
|
883
|
-
Math.abs(
|
|
957
|
+
const s = n[n.length - 1], o = t[r], i = t[r + 1], a = i.time - s.time;
|
|
958
|
+
if (a <= 0) continue;
|
|
959
|
+
const c = (o.time - s.time) / a, u = s.value + (i.value - s.value) * c;
|
|
960
|
+
Math.abs(o.value - u) > e && n.push(o);
|
|
884
961
|
}
|
|
885
962
|
return n.push(t[t.length - 1]), n;
|
|
886
963
|
}
|
|
887
|
-
function
|
|
964
|
+
function Xn(t) {
|
|
888
965
|
const e = [...t.keyframes].sort((n, r) => n.time - r.time);
|
|
889
966
|
return {
|
|
890
967
|
...t,
|
|
@@ -894,11 +971,11 @@ function yn(t) {
|
|
|
894
971
|
function U(t) {
|
|
895
972
|
return t.targets && t.targets.length > 0 ? t.targets : [t.target];
|
|
896
973
|
}
|
|
897
|
-
function
|
|
974
|
+
function K(t, e, n, r) {
|
|
898
975
|
const s = n ?? 0;
|
|
899
|
-
return !r || e <= 1 ? s : s +
|
|
976
|
+
return !r || e <= 1 ? s : s + oe(t, e, r);
|
|
900
977
|
}
|
|
901
|
-
class
|
|
978
|
+
class _t {
|
|
902
979
|
track;
|
|
903
980
|
targets;
|
|
904
981
|
constructor(e) {
|
|
@@ -911,7 +988,7 @@ class mt {
|
|
|
911
988
|
* that need every target should use `getTargetValues`.
|
|
912
989
|
*/
|
|
913
990
|
getValueAtTime(e) {
|
|
914
|
-
return this.valueForOffset(e -
|
|
991
|
+
return this.valueForOffset(e - K(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
915
992
|
}
|
|
916
993
|
/**
|
|
917
994
|
* Every target's value at a specific time, in target order.
|
|
@@ -922,8 +999,8 @@ class mt {
|
|
|
922
999
|
getTargetValues(e) {
|
|
923
1000
|
const n = this.targets.length, r = [];
|
|
924
1001
|
for (let s = 0; s < n; s++) {
|
|
925
|
-
const
|
|
926
|
-
|
|
1002
|
+
const o = K(s, n, this.track.delay, this.track.stagger), i = this.valueForOffset(e - o);
|
|
1003
|
+
i !== void 0 && r.push({ target: this.targets[s], value: i, start: o + this.track.keyframes[0].time });
|
|
927
1004
|
}
|
|
928
1005
|
return r;
|
|
929
1006
|
}
|
|
@@ -935,7 +1012,7 @@ class mt {
|
|
|
935
1012
|
const { keyframes: e } = this.track;
|
|
936
1013
|
if (e.length === 0)
|
|
937
1014
|
return 0;
|
|
938
|
-
const n = e[e.length - 1].time, r = this.track.stagger ?
|
|
1015
|
+
const n = e[e.length - 1].time, r = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
|
|
939
1016
|
return n + (this.track.delay ?? 0) + r + (this.track.endDelay ?? 0);
|
|
940
1017
|
}
|
|
941
1018
|
/**
|
|
@@ -958,8 +1035,8 @@ class mt {
|
|
|
958
1035
|
return;
|
|
959
1036
|
if (r.time === e)
|
|
960
1037
|
return r.value;
|
|
961
|
-
const
|
|
962
|
-
return
|
|
1038
|
+
const o = s.time - r.time, i = (e - r.time) / o, c = le(s.easing)(i);
|
|
1039
|
+
return me(r.value, this.track.interpolation)(r.value, s.value, c);
|
|
963
1040
|
}
|
|
964
1041
|
/**
|
|
965
1042
|
* Find the keyframes surrounding a given time.
|
|
@@ -972,107 +1049,107 @@ class mt {
|
|
|
972
1049
|
return { from: null, to: null };
|
|
973
1050
|
}
|
|
974
1051
|
}
|
|
975
|
-
class
|
|
1052
|
+
class zn {
|
|
976
1053
|
track;
|
|
977
1054
|
targets;
|
|
978
1055
|
sampler;
|
|
979
1056
|
constructor(e) {
|
|
980
|
-
this.track = e, this.targets = U(e), this.sampler = new
|
|
1057
|
+
this.track = e, this.targets = U(e), this.sampler = new ut(e.spring);
|
|
981
1058
|
}
|
|
982
1059
|
getValueAtTime(e) {
|
|
983
|
-
return this.sampler.valueAt(e -
|
|
1060
|
+
return this.sampler.valueAt(e - K(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
984
1061
|
}
|
|
985
1062
|
getTargetValues(e) {
|
|
986
1063
|
const n = this.targets.length, r = [];
|
|
987
1064
|
for (let s = 0; s < n; s++) {
|
|
988
|
-
const
|
|
989
|
-
r.push({ target: this.targets[s], value: this.sampler.valueAt(e -
|
|
1065
|
+
const o = K(s, n, this.track.delay, this.track.stagger);
|
|
1066
|
+
r.push({ target: this.targets[s], value: this.sampler.valueAt(e - o), start: o });
|
|
990
1067
|
}
|
|
991
1068
|
return r;
|
|
992
1069
|
}
|
|
993
1070
|
/** Settle time plus delay and the widest stagger offset. */
|
|
994
1071
|
getDuration() {
|
|
995
|
-
const e = this.track.stagger ?
|
|
1072
|
+
const e = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
|
|
996
1073
|
return this.sampler.settleTime() + (this.track.delay ?? 0) + e;
|
|
997
1074
|
}
|
|
998
1075
|
getTrack() {
|
|
999
1076
|
return this.track;
|
|
1000
1077
|
}
|
|
1001
1078
|
}
|
|
1002
|
-
class
|
|
1079
|
+
class Yn {
|
|
1003
1080
|
track;
|
|
1004
1081
|
targets;
|
|
1005
1082
|
duration;
|
|
1006
1083
|
constructor(e) {
|
|
1007
|
-
this.track = e, this.targets = U(e), this.duration =
|
|
1084
|
+
this.track = e, this.targets = U(e), this.duration = ft(e.inertia);
|
|
1008
1085
|
}
|
|
1009
1086
|
getValueAtTime(e) {
|
|
1010
|
-
return
|
|
1087
|
+
return kt(this.track.inertia, e - K(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
1011
1088
|
}
|
|
1012
1089
|
getTargetValues(e) {
|
|
1013
1090
|
const n = this.targets.length, r = [];
|
|
1014
1091
|
for (let s = 0; s < n; s++) {
|
|
1015
|
-
const
|
|
1016
|
-
r.push({ target: this.targets[s], value:
|
|
1092
|
+
const o = K(s, n, this.track.delay, this.track.stagger);
|
|
1093
|
+
r.push({ target: this.targets[s], value: kt(this.track.inertia, e - o), start: o });
|
|
1017
1094
|
}
|
|
1018
1095
|
return r;
|
|
1019
1096
|
}
|
|
1020
1097
|
/** Settle time plus delay and the widest stagger offset. */
|
|
1021
1098
|
getDuration() {
|
|
1022
|
-
const e = this.track.stagger ?
|
|
1099
|
+
const e = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
|
|
1023
1100
|
return this.duration + (this.track.delay ?? 0) + e;
|
|
1024
1101
|
}
|
|
1025
1102
|
getTrack() {
|
|
1026
1103
|
return this.track;
|
|
1027
1104
|
}
|
|
1028
1105
|
}
|
|
1029
|
-
function
|
|
1030
|
-
const n = { ...
|
|
1106
|
+
function Te(t, e) {
|
|
1107
|
+
const n = { ...hn(t.pathData, e) };
|
|
1031
1108
|
if (t.matrix) {
|
|
1032
|
-
const [r, s, i, a,
|
|
1033
|
-
n.x = r * u +
|
|
1034
|
-
const h = n.angle * Math.PI / 180,
|
|
1035
|
-
n.angle = Math.atan2(s *
|
|
1109
|
+
const [r, s, o, i, a, c] = t.matrix, { x: u, y: l } = n;
|
|
1110
|
+
n.x = r * u + o * l + a, n.y = s * u + i * l + c;
|
|
1111
|
+
const h = n.angle * Math.PI / 180, f = Math.cos(h), p = Math.sin(h);
|
|
1112
|
+
n.angle = Math.atan2(s * f + i * p, r * f + o * p) * 180 / Math.PI;
|
|
1036
1113
|
}
|
|
1037
1114
|
return t.autoRotate && t.rotateOffset && (n.angle += t.rotateOffset), n;
|
|
1038
1115
|
}
|
|
1039
|
-
function
|
|
1116
|
+
function Xr(t, e, n, r) {
|
|
1040
1117
|
const s = e + (n - e) * r;
|
|
1041
|
-
return
|
|
1118
|
+
return Te(t, s);
|
|
1042
1119
|
}
|
|
1043
|
-
const
|
|
1120
|
+
const bt = {
|
|
1044
1121
|
upperCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
1045
1122
|
lowerCase: "abcdefghijklmnopqrstuvwxyz",
|
|
1046
1123
|
upperAndLowerCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
1047
1124
|
numbers: "0123456789"
|
|
1048
|
-
},
|
|
1049
|
-
function
|
|
1050
|
-
const e =
|
|
1051
|
-
return n.length > 0 ? n : Array.from(
|
|
1125
|
+
}, Un = 20;
|
|
1126
|
+
function Vn(t) {
|
|
1127
|
+
const e = bt[t ?? "upperCase"] ?? t ?? bt.upperCase, n = Array.from(e);
|
|
1128
|
+
return n.length > 0 ? n : Array.from(bt.upperCase);
|
|
1052
1129
|
}
|
|
1053
|
-
function
|
|
1130
|
+
function jn(t, e, n) {
|
|
1054
1131
|
let r = (t | 0) ^ Math.imul(e + 1, 2654435761) ^ Math.imul(n + 1, 2246822507);
|
|
1055
1132
|
return r = Math.imul(r ^ r >>> 16, 2146121005), r = Math.imul(r ^ r >>> 15, 2221713035), (r ^ r >>> 16) >>> 0;
|
|
1056
1133
|
}
|
|
1057
|
-
function
|
|
1058
|
-
const r = t.from ?? "", s = t.to,
|
|
1059
|
-
if (
|
|
1060
|
-
if (
|
|
1061
|
-
const
|
|
1134
|
+
function Hn(t, e, n = 0) {
|
|
1135
|
+
const r = t.from ?? "", s = t.to, o = Math.max(0, Math.min(1, e));
|
|
1136
|
+
if (o <= 0) return r;
|
|
1137
|
+
if (o >= 1) return s;
|
|
1138
|
+
const i = Array.from(r), a = Array.from(s), c = t.rightToLeft ?? !1;
|
|
1062
1139
|
if (t.mode === "type") {
|
|
1063
|
-
const b = Math.round(
|
|
1064
|
-
return c ?
|
|
1140
|
+
const b = Math.round(o * Math.max(i.length, a.length));
|
|
1141
|
+
return c ? i.slice(0, Math.max(0, i.length - b)).join("") + a.slice(Math.max(0, a.length - b)).join("") : a.slice(0, b).join("") + i.slice(b).join("");
|
|
1065
1142
|
}
|
|
1066
|
-
const u = Math.max(0, Math.min(0.999, t.revealDelay ?? 0)), l = Math.max(0, (
|
|
1067
|
-
let
|
|
1068
|
-
for (let b = 0; b <
|
|
1069
|
-
const k = c ? b >=
|
|
1070
|
-
k &&
|
|
1071
|
-
` ?
|
|
1143
|
+
const u = Math.max(0, Math.min(0.999, t.revealDelay ?? 0)), l = Math.max(0, (o - u) / (1 - u)), h = Math.floor(l * a.length), f = t.tweenLength === !1 ? a.length : Math.round(i.length + (a.length - i.length) * o), p = Vn(t.chars), M = t.refreshRate ?? Un, d = M > 0 ? Math.floor(n * M / 1e3) : 0, g = t.seed ?? 1;
|
|
1144
|
+
let _ = "";
|
|
1145
|
+
for (let b = 0; b < f; b++) {
|
|
1146
|
+
const k = c ? b >= f - h : b < h, w = c ? a[a.length - (f - b)] : a[b];
|
|
1147
|
+
k && w !== void 0 || w === " " || w === `
|
|
1148
|
+
` ? _ += w : _ += p[jn(g, b, d) % p.length];
|
|
1072
1149
|
}
|
|
1073
|
-
return
|
|
1150
|
+
return _;
|
|
1074
1151
|
}
|
|
1075
|
-
class
|
|
1152
|
+
class Bn {
|
|
1076
1153
|
id;
|
|
1077
1154
|
name;
|
|
1078
1155
|
_captions;
|
|
@@ -1187,15 +1264,15 @@ class vn {
|
|
|
1187
1264
|
return;
|
|
1188
1265
|
let s = e * this.speed;
|
|
1189
1266
|
if (this._repeatDelayRemaining > 0) {
|
|
1190
|
-
const
|
|
1191
|
-
if (this._repeatDelayRemaining -=
|
|
1267
|
+
const a = Math.min(this._repeatDelayRemaining, s);
|
|
1268
|
+
if (this._repeatDelayRemaining -= a, s -= a, this._repeatDelayRemaining > 0) {
|
|
1192
1269
|
this.onUpdate?.(this.getStateAtTime(this._currentTime));
|
|
1193
1270
|
return;
|
|
1194
1271
|
}
|
|
1195
1272
|
this._wrapAfterDelay && (this._wrapAfterDelay = !1, this._currentTime = 0);
|
|
1196
1273
|
}
|
|
1197
|
-
const
|
|
1198
|
-
for (let
|
|
1274
|
+
const o = 1e3;
|
|
1275
|
+
for (let a = 0; a < o && s > 0 && this._playbackState === "playing"; a++)
|
|
1199
1276
|
if (this._direction === "forward") {
|
|
1200
1277
|
const c = n - this._currentTime;
|
|
1201
1278
|
if (s >= c) {
|
|
@@ -1211,8 +1288,8 @@ class vn {
|
|
|
1211
1288
|
} else
|
|
1212
1289
|
this._currentTime -= s, s = 0;
|
|
1213
1290
|
}
|
|
1214
|
-
const
|
|
1215
|
-
this.onUpdate?.(
|
|
1291
|
+
const i = this.getStateAtTime(this._currentTime);
|
|
1292
|
+
this.onUpdate?.(i);
|
|
1216
1293
|
}
|
|
1217
1294
|
/**
|
|
1218
1295
|
* Get the animation state at a specific time.
|
|
@@ -1223,9 +1300,9 @@ class vn {
|
|
|
1223
1300
|
this._resolveShared(e, n);
|
|
1224
1301
|
else
|
|
1225
1302
|
for (const [r, s] of this._trackPlayers) {
|
|
1226
|
-
const
|
|
1227
|
-
for (const { target:
|
|
1228
|
-
this._write(n, r,
|
|
1303
|
+
const o = s.getTrack().property;
|
|
1304
|
+
for (const { target: i, value: a, start: c } of s.getTargetValues(e))
|
|
1305
|
+
this._write(n, r, i, o, a, e - c);
|
|
1229
1306
|
}
|
|
1230
1307
|
return {
|
|
1231
1308
|
values: n,
|
|
@@ -1250,36 +1327,36 @@ class vn {
|
|
|
1250
1327
|
*/
|
|
1251
1328
|
_resolveShared(e, n) {
|
|
1252
1329
|
const r = /* @__PURE__ */ new Map();
|
|
1253
|
-
for (const [s,
|
|
1254
|
-
const
|
|
1255
|
-
for (const { target:
|
|
1256
|
-
const l = `${
|
|
1257
|
-
(!
|
|
1330
|
+
for (const [s, o] of this._trackPlayers) {
|
|
1331
|
+
const i = o.getTrack().property;
|
|
1332
|
+
for (const { target: a, value: c, start: u } of o.getTargetValues(e)) {
|
|
1333
|
+
const l = `${a}\0${i}`, h = u <= e, f = r.get(l);
|
|
1334
|
+
(!f || (h !== f.started ? h : h ? u >= f.start : u <= f.start)) && r.set(l, { trackId: s, target: a, property: i, value: c, start: u, started: h });
|
|
1258
1335
|
}
|
|
1259
1336
|
}
|
|
1260
|
-
for (const { trackId: s, target:
|
|
1261
|
-
this._write(n, s, i, a,
|
|
1337
|
+
for (const { trackId: s, target: o, property: i, value: a, start: c } of r.values())
|
|
1338
|
+
this._write(n, s, o, i, a, e - c);
|
|
1262
1339
|
}
|
|
1263
1340
|
/**
|
|
1264
1341
|
* Write one track's value for a target, expanding the progress of motion paths
|
|
1265
1342
|
* (into x/y/rotation) and text tracks (into the string). `elapsed` is the time
|
|
1266
1343
|
* since this target's animation on the track started.
|
|
1267
1344
|
*/
|
|
1268
|
-
_write(e, n, r, s,
|
|
1269
|
-
if (
|
|
1270
|
-
let
|
|
1271
|
-
|
|
1345
|
+
_write(e, n, r, s, o, i) {
|
|
1346
|
+
if (o === void 0) return;
|
|
1347
|
+
let a = e.get(r);
|
|
1348
|
+
a || (a = /* @__PURE__ */ new Map(), e.set(r, a));
|
|
1272
1349
|
const c = this._textTracks.get(n);
|
|
1273
|
-
if (c && typeof
|
|
1274
|
-
|
|
1350
|
+
if (c && typeof o == "number") {
|
|
1351
|
+
a.set("text", Hn(c.textConfig, o, Math.max(0, i)));
|
|
1275
1352
|
return;
|
|
1276
1353
|
}
|
|
1277
1354
|
const u = this._motionPathTracks.get(n);
|
|
1278
|
-
if (u && typeof
|
|
1279
|
-
const l =
|
|
1280
|
-
|
|
1355
|
+
if (u && typeof o == "number") {
|
|
1356
|
+
const l = Te(u.motionPathConfig, o);
|
|
1357
|
+
a.set("motionPathX", l.x), a.set("motionPathY", l.y), u.motionPathConfig.autoRotate && a.set("motionPathRotate", l.angle);
|
|
1281
1358
|
} else
|
|
1282
|
-
|
|
1359
|
+
a.set(s, o);
|
|
1283
1360
|
}
|
|
1284
1361
|
/** Cached: does any target+property have more than one track? */
|
|
1285
1362
|
_sharedWrites = null;
|
|
@@ -1304,16 +1381,16 @@ class vn {
|
|
|
1304
1381
|
*/
|
|
1305
1382
|
addTrack(e) {
|
|
1306
1383
|
if (this._tracks.push(e), this._sharedWrites = null, V(e)) {
|
|
1307
|
-
this._trackPlayers.set(e.id, new
|
|
1384
|
+
this._trackPlayers.set(e.id, new Yn(e));
|
|
1308
1385
|
return;
|
|
1309
1386
|
}
|
|
1310
|
-
if (
|
|
1311
|
-
this._trackPlayers.set(e.id, new
|
|
1387
|
+
if (j(e)) {
|
|
1388
|
+
this._trackPlayers.set(e.id, new zn(e)), this._springTracks.set(e.id, e);
|
|
1312
1389
|
return;
|
|
1313
1390
|
}
|
|
1314
|
-
if (
|
|
1315
|
-
this._trackPlayers.set(e.id, new
|
|
1316
|
-
else if (
|
|
1391
|
+
if ($t(e))
|
|
1392
|
+
this._trackPlayers.set(e.id, new _t(e)), this._textTracks.set(e.id, e);
|
|
1393
|
+
else if (re(e)) {
|
|
1317
1394
|
const n = {
|
|
1318
1395
|
id: e.id,
|
|
1319
1396
|
target: e.target,
|
|
@@ -1324,9 +1401,9 @@ class vn {
|
|
|
1324
1401
|
targets: e.targets,
|
|
1325
1402
|
stagger: e.stagger
|
|
1326
1403
|
};
|
|
1327
|
-
this._trackPlayers.set(e.id, new
|
|
1404
|
+
this._trackPlayers.set(e.id, new _t(n)), this._motionPathTracks.set(e.id, e);
|
|
1328
1405
|
} else
|
|
1329
|
-
this._trackPlayers.set(e.id, new
|
|
1406
|
+
this._trackPlayers.set(e.id, new _t(e));
|
|
1330
1407
|
}
|
|
1331
1408
|
/**
|
|
1332
1409
|
* Replace a track with a new version, keeping its place in the track order
|
|
@@ -1334,13 +1411,13 @@ class vn {
|
|
|
1334
1411
|
* different id. Does nothing if no track has `trackId`.
|
|
1335
1412
|
*/
|
|
1336
1413
|
replaceTrack(e, n) {
|
|
1337
|
-
const r = this._tracks.findIndex((
|
|
1414
|
+
const r = this._tracks.findIndex((o) => o.id === e);
|
|
1338
1415
|
if (r < 0) return;
|
|
1339
1416
|
const s = this._tracks.slice(r + 1);
|
|
1340
1417
|
this.removeTrack(e);
|
|
1341
|
-
for (const
|
|
1418
|
+
for (const o of s) this.removeTrack(o.id);
|
|
1342
1419
|
this.addTrack(n);
|
|
1343
|
-
for (const
|
|
1420
|
+
for (const o of s) this.addTrack(o);
|
|
1344
1421
|
}
|
|
1345
1422
|
/**
|
|
1346
1423
|
* Remove a track by its ID.
|
|
@@ -1377,11 +1454,11 @@ class vn {
|
|
|
1377
1454
|
const n = this._trackPlayers.get(e);
|
|
1378
1455
|
if (!n) return;
|
|
1379
1456
|
const r = n.getTrack(), s = r.delay ?? 0;
|
|
1380
|
-
if (
|
|
1457
|
+
if (j(r) || V(r))
|
|
1381
1458
|
return { from: s, to: n.getDuration() };
|
|
1382
|
-
const
|
|
1383
|
-
if (!(!
|
|
1384
|
-
return { from:
|
|
1459
|
+
const o = r.keyframes;
|
|
1460
|
+
if (!(!o || o.length === 0))
|
|
1461
|
+
return { from: o[0].time + s, to: n.getDuration() };
|
|
1385
1462
|
}
|
|
1386
1463
|
/**
|
|
1387
1464
|
* Overlapping writes to the same target+property.
|
|
@@ -1396,20 +1473,20 @@ class vn {
|
|
|
1396
1473
|
for (let n = 0; n < this._tracks.length; n++) {
|
|
1397
1474
|
const r = this._tracks[n], s = this.getTrackSpan(r.id);
|
|
1398
1475
|
if (s)
|
|
1399
|
-
for (let
|
|
1400
|
-
const
|
|
1401
|
-
if (
|
|
1402
|
-
const
|
|
1403
|
-
if (
|
|
1404
|
-
const c = this.getTrackSpan(
|
|
1476
|
+
for (let o = 0; o < n; o++) {
|
|
1477
|
+
const i = this._tracks[o];
|
|
1478
|
+
if (i.property !== r.property) continue;
|
|
1479
|
+
const a = U(i).filter((h) => U(r).includes(h));
|
|
1480
|
+
if (a.length === 0) continue;
|
|
1481
|
+
const c = this.getTrackSpan(i.id);
|
|
1405
1482
|
if (!c || !(c.from <= s.to && s.from <= c.to)) continue;
|
|
1406
1483
|
const l = s.from >= c.from;
|
|
1407
|
-
for (const h of
|
|
1484
|
+
for (const h of a)
|
|
1408
1485
|
e.push({
|
|
1409
1486
|
target: h,
|
|
1410
1487
|
property: r.property,
|
|
1411
|
-
losingTrackId: l ?
|
|
1412
|
-
winningTrackId: l ? r.id :
|
|
1488
|
+
losingTrackId: l ? i.id : r.id,
|
|
1489
|
+
winningTrackId: l ? r.id : i.id
|
|
1413
1490
|
});
|
|
1414
1491
|
}
|
|
1415
1492
|
}
|
|
@@ -1428,7 +1505,7 @@ class vn {
|
|
|
1428
1505
|
*/
|
|
1429
1506
|
toDefinition() {
|
|
1430
1507
|
return {
|
|
1431
|
-
formatVersion:
|
|
1508
|
+
formatVersion: ne(this._tracks),
|
|
1432
1509
|
id: this.id,
|
|
1433
1510
|
name: this.name,
|
|
1434
1511
|
config: { ...this._config },
|
|
@@ -1446,7 +1523,7 @@ class vn {
|
|
|
1446
1523
|
}
|
|
1447
1524
|
/** Replace the markers (kept in time order); an empty list removes them. */
|
|
1448
1525
|
setMarkers(e) {
|
|
1449
|
-
const n = e && e.length > 0 ? [...e].sort((s,
|
|
1526
|
+
const n = e && e.length > 0 ? [...e].sort((s, o) => s.time - o.time).map((s) => ({ ...s })) : void 0, r = { ...this._config };
|
|
1450
1527
|
n ? r.markers = n : delete r.markers, this._config = r;
|
|
1451
1528
|
}
|
|
1452
1529
|
/** Caption text per language, per marker id */
|
|
@@ -1486,65 +1563,66 @@ class vn {
|
|
|
1486
1563
|
return this._config.alternate && (e === -1 || this._loopIteration < e) ? (this._loopIteration++, this._armRepeatDelay(), this._direction = "forward", this._repeatDelayRemaining === 0) : (this._playbackState = "idle", this.onComplete?.(), !1);
|
|
1487
1564
|
}
|
|
1488
1565
|
}
|
|
1489
|
-
const
|
|
1490
|
-
function
|
|
1491
|
-
const s = [],
|
|
1492
|
-
|
|
1493
|
-
const
|
|
1566
|
+
const Wn = 100;
|
|
1567
|
+
function zr(t, e, n, r) {
|
|
1568
|
+
const s = [], o = [], { duration: i, alternate: a } = r, c = (p, M, d, g) => {
|
|
1569
|
+
o.push([p, M]);
|
|
1570
|
+
const _ = [];
|
|
1494
1571
|
t.forEach((b, k) => {
|
|
1495
|
-
(d === "forward" ? (g ? b >=
|
|
1496
|
-
}),
|
|
1497
|
-
for (const b of
|
|
1572
|
+
(d === "forward" ? (g ? b >= p : b > p) && b <= M : (g ? b <= p : b < p) && b >= M) && _.push(k);
|
|
1573
|
+
}), _.sort((b, k) => (d === "forward" ? t[b] - t[k] : t[k] - t[b]) || b - k);
|
|
1574
|
+
for (const b of _) s.push({ kind: "event", index: b, direction: d });
|
|
1498
1575
|
};
|
|
1499
1576
|
let u = e.time, l = e.direction, h = e.fresh === !0;
|
|
1500
|
-
const
|
|
1501
|
-
for (let
|
|
1502
|
-
const
|
|
1503
|
-
c(u,
|
|
1577
|
+
const f = Math.min(Wn, Math.max(0, n.iteration - e.iteration));
|
|
1578
|
+
for (let p = 0; p < f; p++) {
|
|
1579
|
+
const M = l === "forward" ? i : 0;
|
|
1580
|
+
c(u, M, l, h), s.push({ kind: "repeat" }), a ? (l = l === "forward" ? "reverse" : "forward", u = M, h = !1) : (u = l === "forward" ? 0 : i, h = !0);
|
|
1504
1581
|
}
|
|
1505
|
-
return
|
|
1582
|
+
return f > 0 && r.holding && !a ? { crossings: s, passes: o } : (c(u, n.time, l, h), { crossings: s, passes: o });
|
|
1506
1583
|
}
|
|
1507
|
-
function
|
|
1584
|
+
function Qn(t) {
|
|
1508
1585
|
return V(t) ? {
|
|
1509
1586
|
id: t.id,
|
|
1510
1587
|
target: t.target,
|
|
1511
1588
|
property: t.property,
|
|
1512
1589
|
kind: "inertia",
|
|
1513
|
-
inertia:
|
|
1590
|
+
inertia: xe(t.inertia),
|
|
1514
1591
|
...F(t)
|
|
1515
|
-
} :
|
|
1592
|
+
} : j(t) ? {
|
|
1516
1593
|
id: t.id,
|
|
1517
1594
|
target: t.target,
|
|
1518
1595
|
property: t.property,
|
|
1519
1596
|
kind: "spring",
|
|
1520
1597
|
spring: { ...t.spring },
|
|
1521
1598
|
...F(t)
|
|
1522
|
-
} :
|
|
1599
|
+
} : $t(t) ? {
|
|
1523
1600
|
id: t.id,
|
|
1524
1601
|
target: t.target,
|
|
1525
1602
|
property: "text",
|
|
1526
1603
|
textConfig: { ...t.textConfig },
|
|
1527
|
-
keyframes: t.keyframes.map(
|
|
1604
|
+
keyframes: t.keyframes.map(Tt),
|
|
1528
1605
|
...F(t)
|
|
1529
|
-
} :
|
|
1606
|
+
} : re(t) ? {
|
|
1530
1607
|
id: t.id,
|
|
1531
1608
|
target: t.target,
|
|
1532
1609
|
property: "motionPath",
|
|
1533
1610
|
motionPathConfig: { ...t.motionPathConfig },
|
|
1534
|
-
keyframes: t.keyframes.map(
|
|
1611
|
+
keyframes: t.keyframes.map(Tt),
|
|
1535
1612
|
...F(t)
|
|
1536
1613
|
} : {
|
|
1537
1614
|
id: t.id,
|
|
1538
1615
|
target: t.target,
|
|
1539
1616
|
property: t.property,
|
|
1540
|
-
keyframes: t.keyframes.map(
|
|
1617
|
+
keyframes: t.keyframes.map(Tt),
|
|
1618
|
+
...t.interpolation !== void 0 && { interpolation: t.interpolation },
|
|
1541
1619
|
...F(t)
|
|
1542
1620
|
};
|
|
1543
1621
|
}
|
|
1544
|
-
function
|
|
1622
|
+
function xe(t) {
|
|
1545
1623
|
return { ...t, ...Array.isArray(t.end) && { end: [...t.end] } };
|
|
1546
1624
|
}
|
|
1547
|
-
function
|
|
1625
|
+
function Tt(t) {
|
|
1548
1626
|
return {
|
|
1549
1627
|
time: t.time,
|
|
1550
1628
|
value: t.value,
|
|
@@ -1560,7 +1638,7 @@ function F(t) {
|
|
|
1560
1638
|
...t.stagger !== void 0 && { stagger: { ...t.stagger } }
|
|
1561
1639
|
};
|
|
1562
1640
|
}
|
|
1563
|
-
function
|
|
1641
|
+
function Gn(t) {
|
|
1564
1642
|
if (V(t)) {
|
|
1565
1643
|
const e = t;
|
|
1566
1644
|
return {
|
|
@@ -1568,11 +1646,11 @@ function wn(t) {
|
|
|
1568
1646
|
target: e.target,
|
|
1569
1647
|
property: e.property,
|
|
1570
1648
|
kind: "inertia",
|
|
1571
|
-
inertia:
|
|
1649
|
+
inertia: xe(e.inertia),
|
|
1572
1650
|
...F(e)
|
|
1573
1651
|
};
|
|
1574
1652
|
}
|
|
1575
|
-
if (
|
|
1653
|
+
if (j(t)) {
|
|
1576
1654
|
const e = t;
|
|
1577
1655
|
return {
|
|
1578
1656
|
id: e.id,
|
|
@@ -1583,7 +1661,7 @@ function wn(t) {
|
|
|
1583
1661
|
...F(e)
|
|
1584
1662
|
};
|
|
1585
1663
|
}
|
|
1586
|
-
if (
|
|
1664
|
+
if ($t(t)) {
|
|
1587
1665
|
const e = t;
|
|
1588
1666
|
return {
|
|
1589
1667
|
id: e.id,
|
|
@@ -1605,18 +1683,19 @@ function wn(t) {
|
|
|
1605
1683
|
...F(e)
|
|
1606
1684
|
};
|
|
1607
1685
|
}
|
|
1608
|
-
return
|
|
1686
|
+
return Xn({
|
|
1609
1687
|
id: t.id,
|
|
1610
1688
|
target: t.target,
|
|
1611
1689
|
property: t.property,
|
|
1612
1690
|
keyframes: t.keyframes,
|
|
1691
|
+
...t.interpolation !== void 0 && { interpolation: t.interpolation },
|
|
1613
1692
|
...F(t)
|
|
1614
1693
|
});
|
|
1615
1694
|
}
|
|
1616
|
-
function
|
|
1695
|
+
function Kn(t) {
|
|
1617
1696
|
const e = t._config.markers;
|
|
1618
1697
|
return {
|
|
1619
|
-
formatVersion:
|
|
1698
|
+
formatVersion: ne(t.tracks),
|
|
1620
1699
|
id: t.id,
|
|
1621
1700
|
name: t.name,
|
|
1622
1701
|
config: {
|
|
@@ -1627,38 +1706,38 @@ function Pn(t) {
|
|
|
1627
1706
|
repeatDelay: t._config.repeatDelay,
|
|
1628
1707
|
...e && { markers: e.map((n) => ({ ...n })) }
|
|
1629
1708
|
},
|
|
1630
|
-
tracks: t.tracks.map(
|
|
1709
|
+
tracks: t.tracks.map(Qn),
|
|
1631
1710
|
...t.captions && { captions: JSON.parse(JSON.stringify(t.captions)) }
|
|
1632
1711
|
};
|
|
1633
1712
|
}
|
|
1634
|
-
function
|
|
1713
|
+
function Zn(t) {
|
|
1635
1714
|
const e = t.formatVersion ?? 1;
|
|
1636
|
-
if (e >
|
|
1715
|
+
if (e > Xt)
|
|
1637
1716
|
throw new Error(
|
|
1638
|
-
`tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${
|
|
1717
|
+
`tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${Xt}. Update tinyfly to play it.`
|
|
1639
1718
|
);
|
|
1640
|
-
return new
|
|
1719
|
+
return new Bn({
|
|
1641
1720
|
id: t.id,
|
|
1642
1721
|
name: t.name,
|
|
1643
1722
|
config: t.config,
|
|
1644
|
-
tracks: t.tracks.map(
|
|
1723
|
+
tracks: t.tracks.map(Gn),
|
|
1645
1724
|
captions: t.captions
|
|
1646
1725
|
});
|
|
1647
1726
|
}
|
|
1648
|
-
function
|
|
1649
|
-
return JSON.stringify(
|
|
1727
|
+
function Yr(t) {
|
|
1728
|
+
return JSON.stringify(Kn(t));
|
|
1650
1729
|
}
|
|
1651
|
-
function
|
|
1730
|
+
function Ur(t) {
|
|
1652
1731
|
const e = JSON.parse(t);
|
|
1653
|
-
return
|
|
1732
|
+
return Zn(e);
|
|
1654
1733
|
}
|
|
1655
|
-
function
|
|
1734
|
+
function Vr(t) {
|
|
1656
1735
|
let e = 2166136261;
|
|
1657
1736
|
for (let n = 0; n < t.length; n++)
|
|
1658
1737
|
e ^= t.charCodeAt(n), e = Math.imul(e, 16777619);
|
|
1659
1738
|
return e >>> 0;
|
|
1660
1739
|
}
|
|
1661
|
-
function
|
|
1740
|
+
function qn(t) {
|
|
1662
1741
|
let e = t >>> 0 || 2654435769;
|
|
1663
1742
|
return {
|
|
1664
1743
|
seed: t >>> 0,
|
|
@@ -1667,433 +1746,600 @@ function Rn(t) {
|
|
|
1667
1746
|
}
|
|
1668
1747
|
};
|
|
1669
1748
|
}
|
|
1670
|
-
function
|
|
1749
|
+
function ke(t, e, n) {
|
|
1671
1750
|
return e + t.next() * (n - e);
|
|
1672
1751
|
}
|
|
1673
|
-
function
|
|
1674
|
-
if (r <= 0) return
|
|
1675
|
-
const s = Math.floor((n - e) / r),
|
|
1676
|
-
return e +
|
|
1752
|
+
function Jn(t, e, n, r) {
|
|
1753
|
+
if (r <= 0) return ke(t, e, n);
|
|
1754
|
+
const s = Math.floor((n - e) / r), o = Math.round(t.next() * s);
|
|
1755
|
+
return e + o * r;
|
|
1677
1756
|
}
|
|
1678
|
-
function
|
|
1757
|
+
function jr(t, e) {
|
|
1679
1758
|
if (e.length !== 0)
|
|
1680
1759
|
return e[Math.floor(t.next() * e.length)];
|
|
1681
1760
|
}
|
|
1682
|
-
const
|
|
1683
|
-
function
|
|
1684
|
-
return typeof t != "string" ? !1 :
|
|
1761
|
+
const Se = /^([+\-*/])=\s*(-?[\d.]+)$/, Ae = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
|
|
1762
|
+
function Hr(t) {
|
|
1763
|
+
return typeof t != "string" ? !1 : Se.test(t.trim()) || Ae.test(t.trim());
|
|
1685
1764
|
}
|
|
1686
|
-
function
|
|
1765
|
+
function we(t, e = {}) {
|
|
1687
1766
|
if (typeof t != "string") return t;
|
|
1688
|
-
const n = t.trim(), r =
|
|
1767
|
+
const n = t.trim(), r = Se.exec(n);
|
|
1689
1768
|
if (r) {
|
|
1690
|
-
const [,
|
|
1691
|
-
switch (
|
|
1769
|
+
const [, o, i] = r, a = e.base ?? 0, c = Number.parseFloat(i);
|
|
1770
|
+
switch (o) {
|
|
1692
1771
|
case "+":
|
|
1693
|
-
return
|
|
1772
|
+
return a + c;
|
|
1694
1773
|
case "-":
|
|
1695
|
-
return
|
|
1774
|
+
return a - c;
|
|
1696
1775
|
case "*":
|
|
1697
|
-
return
|
|
1776
|
+
return a * c;
|
|
1698
1777
|
case "/":
|
|
1699
|
-
return c === 0 ?
|
|
1778
|
+
return c === 0 ? a : a / c;
|
|
1700
1779
|
}
|
|
1701
1780
|
}
|
|
1702
|
-
const s =
|
|
1781
|
+
const s = Ae.exec(n);
|
|
1703
1782
|
if (s) {
|
|
1704
1783
|
if (!e.random)
|
|
1705
1784
|
throw new Error(
|
|
1706
1785
|
`resolveValue: "${n}" needs a random source — pass one via context.random`
|
|
1707
1786
|
);
|
|
1708
|
-
const
|
|
1709
|
-
return
|
|
1787
|
+
const o = Number.parseFloat(s[1]), i = Number.parseFloat(s[2]), a = s[3] !== void 0 ? Number.parseFloat(s[3]) : void 0;
|
|
1788
|
+
return a !== void 0 ? Jn(e.random, o, i, a) : ke(e.random, o, i);
|
|
1710
1789
|
}
|
|
1711
1790
|
return t;
|
|
1712
1791
|
}
|
|
1713
|
-
function
|
|
1792
|
+
function tr(t, e = 0, n) {
|
|
1714
1793
|
const r = [];
|
|
1715
1794
|
let s = e;
|
|
1716
|
-
for (const
|
|
1717
|
-
const
|
|
1718
|
-
r.push(
|
|
1795
|
+
for (const o of t) {
|
|
1796
|
+
const i = we(o, { base: s, random: n });
|
|
1797
|
+
r.push(i), typeof i == "number" && (s = i);
|
|
1719
1798
|
}
|
|
1720
1799
|
return r;
|
|
1721
1800
|
}
|
|
1722
|
-
class
|
|
1801
|
+
class Br {
|
|
1723
1802
|
random;
|
|
1724
1803
|
constructor(e) {
|
|
1725
|
-
this.random =
|
|
1804
|
+
this.random = qn(e);
|
|
1726
1805
|
}
|
|
1727
1806
|
/** The seed, to be stored alongside the timeline so this can be reproduced. */
|
|
1728
1807
|
get seed() {
|
|
1729
1808
|
return this.random.seed;
|
|
1730
1809
|
}
|
|
1731
1810
|
resolve(e, n = 0) {
|
|
1732
|
-
return
|
|
1811
|
+
return we(e, { base: n, random: this.random });
|
|
1733
1812
|
}
|
|
1734
1813
|
resolveSequence(e, n = 0) {
|
|
1735
|
-
return
|
|
1814
|
+
return tr(e, n, this.random);
|
|
1736
1815
|
}
|
|
1737
1816
|
}
|
|
1738
|
-
const
|
|
1739
|
-
function
|
|
1817
|
+
const er = 600;
|
|
1818
|
+
function Wr(t) {
|
|
1740
1819
|
if (Array.isArray(t)) {
|
|
1741
|
-
const [
|
|
1742
|
-
return { fn:
|
|
1820
|
+
const [f, p, M, d] = t;
|
|
1821
|
+
return { fn: ee(f, p, M, d), bezier: [f, p, M, d] };
|
|
1743
1822
|
}
|
|
1744
|
-
const { segments: e } =
|
|
1823
|
+
const { segments: e } = G(t);
|
|
1745
1824
|
if (e.length === 0) throw new Error(`customEase: no curve in "${t}"`);
|
|
1746
|
-
const n = e[0].startX, r = e[0].startY, s = e[e.length - 1],
|
|
1747
|
-
if (
|
|
1748
|
-
const
|
|
1825
|
+
const n = e[0].startX, r = e[0].startY, s = e[e.length - 1], o = s.endX - n, i = s.endY - r;
|
|
1826
|
+
if (o === 0 || i === 0) throw new Error(`customEase: "${t}" must move along both axes`);
|
|
1827
|
+
const a = (f) => (f - n) / o, c = (f) => (f - r) / i;
|
|
1749
1828
|
if (e.length === 1 && s.type === "C") {
|
|
1750
|
-
const [
|
|
1751
|
-
return { fn:
|
|
1752
|
-
}
|
|
1753
|
-
const u = [], l = [], h = Math.max(8, Math.ceil(
|
|
1754
|
-
for (const
|
|
1755
|
-
for (let
|
|
1756
|
-
const [
|
|
1757
|
-
u.push(
|
|
1829
|
+
const [f, p, M, d] = s.points, g = [a(f), c(p), a(M), c(d)];
|
|
1830
|
+
return { fn: ee(...g), bezier: g };
|
|
1831
|
+
}
|
|
1832
|
+
const u = [], l = [], h = Math.max(8, Math.ceil(er / e.length));
|
|
1833
|
+
for (const f of e)
|
|
1834
|
+
for (let p = u.length === 0 ? 0 : 1; p <= h; p++) {
|
|
1835
|
+
const [M, d] = nr(f, p / h);
|
|
1836
|
+
u.push(a(M)), l.push(c(d));
|
|
1758
1837
|
}
|
|
1759
|
-
return { fn:
|
|
1838
|
+
return { fn: rr(u, l) };
|
|
1760
1839
|
}
|
|
1761
|
-
function
|
|
1840
|
+
function Qr(t = {}) {
|
|
1762
1841
|
const n = 0.1 + Math.max(0, Math.min(1, t.strength ?? 0.7)) * 0.7, r = [1];
|
|
1763
|
-
for (let
|
|
1764
|
-
const s = r.reduce((
|
|
1765
|
-
return (
|
|
1766
|
-
if (
|
|
1767
|
-
if (
|
|
1768
|
-
let
|
|
1769
|
-
for (let
|
|
1770
|
-
if (
|
|
1771
|
-
if (
|
|
1772
|
-
const c = r[
|
|
1842
|
+
for (let o = n; o > 2e-3; o *= n) r.push(2 * Math.sqrt(o));
|
|
1843
|
+
const s = r.reduce((o, i) => o + i, 0);
|
|
1844
|
+
return (o) => {
|
|
1845
|
+
if (o <= 0) return 0;
|
|
1846
|
+
if (o >= 1) return 1;
|
|
1847
|
+
let i = o * s;
|
|
1848
|
+
for (let a = 0; a < r.length; a++) {
|
|
1849
|
+
if (i <= r[a]) {
|
|
1850
|
+
if (a === 0) return (i / r[0]) ** 2;
|
|
1851
|
+
const c = r[a] / 2, u = c * c, l = i - c;
|
|
1773
1852
|
return 1 - (u - l * l);
|
|
1774
1853
|
}
|
|
1775
|
-
|
|
1854
|
+
i -= r[a];
|
|
1776
1855
|
}
|
|
1777
1856
|
return 1;
|
|
1778
1857
|
};
|
|
1779
1858
|
}
|
|
1780
|
-
function
|
|
1859
|
+
function Gr(t = {}) {
|
|
1781
1860
|
const e = Math.max(1, t.wiggles ?? 10), n = t.type ?? "easeOut", r = (s) => n === "uniform" ? 1 : n === "easeInOut" ? Math.sin(Math.PI * s) : (1 - s) ** 2;
|
|
1782
1861
|
return (s) => s <= 0 || s >= 1 ? 0 : Math.sin(s * e * Math.PI * 2) * r(s);
|
|
1783
1862
|
}
|
|
1784
|
-
function
|
|
1863
|
+
function nr(t, e) {
|
|
1785
1864
|
if (t.type === "L") {
|
|
1786
1865
|
const [u, l] = t.points;
|
|
1787
1866
|
return [t.startX + (u - t.startX) * e, t.startY + (l - t.startY) * e];
|
|
1788
1867
|
}
|
|
1789
|
-
const [n, r, s, i, a
|
|
1868
|
+
const [n, r, s, o, i, a] = t.points, c = 1 - e;
|
|
1790
1869
|
return [
|
|
1791
|
-
c * c * c * t.startX + 3 * c * c * e * n + 3 * c * e * e * s + e * e * e *
|
|
1792
|
-
c * c * c * t.startY + 3 * c * c * e * r + 3 * c * e * e *
|
|
1870
|
+
c * c * c * t.startX + 3 * c * c * e * n + 3 * c * e * e * s + e * e * e * i,
|
|
1871
|
+
c * c * c * t.startY + 3 * c * c * e * r + 3 * c * e * e * o + e * e * e * a
|
|
1793
1872
|
];
|
|
1794
1873
|
}
|
|
1795
|
-
function
|
|
1874
|
+
function rr(t, e) {
|
|
1796
1875
|
return (n) => {
|
|
1797
1876
|
if (n <= t[0]) return e[0];
|
|
1798
1877
|
if (n >= t[t.length - 1]) return e[e.length - 1];
|
|
1799
1878
|
let r = 0, s = t.length - 1;
|
|
1800
1879
|
for (; s - r > 1; ) {
|
|
1801
|
-
const
|
|
1802
|
-
t[
|
|
1880
|
+
const i = r + s >> 1;
|
|
1881
|
+
t[i] <= n ? r = i : s = i;
|
|
1803
1882
|
}
|
|
1804
|
-
const
|
|
1805
|
-
return
|
|
1883
|
+
const o = t[s] - t[r];
|
|
1884
|
+
return o === 0 ? e[s] : e[r] + (n - t[r]) / o * (e[s] - e[r]);
|
|
1806
1885
|
};
|
|
1807
1886
|
}
|
|
1808
|
-
function
|
|
1809
|
-
const s = (
|
|
1810
|
-
return (
|
|
1811
|
-
if (
|
|
1812
|
-
if (
|
|
1813
|
-
let
|
|
1887
|
+
function ee(t, e, n, r) {
|
|
1888
|
+
const s = (i, a, c) => 3 * (1 - i) * (1 - i) * i * a + 3 * (1 - i) * i * i * c + i * i * i, o = (i, a, c) => 3 * (1 - i) * (1 - i) * a + 6 * (1 - i) * i * (c - a) + 3 * i * i * (1 - c);
|
|
1889
|
+
return (i) => {
|
|
1890
|
+
if (i <= 0) return 0;
|
|
1891
|
+
if (i >= 1) return 1;
|
|
1892
|
+
let a = i;
|
|
1814
1893
|
for (let l = 0; l < 8; l++) {
|
|
1815
|
-
const h = s(
|
|
1816
|
-
if (Math.abs(h) < 1e-6) return s(
|
|
1817
|
-
if (Math.abs(
|
|
1818
|
-
|
|
1894
|
+
const h = s(a, t, n) - i, f = o(a, t, n);
|
|
1895
|
+
if (Math.abs(h) < 1e-6) return s(a, e, r);
|
|
1896
|
+
if (Math.abs(f) < 1e-6) break;
|
|
1897
|
+
a -= h / f;
|
|
1819
1898
|
}
|
|
1820
1899
|
let c = 0, u = 1;
|
|
1821
|
-
|
|
1900
|
+
a = i;
|
|
1822
1901
|
for (let l = 0; l < 40; l++)
|
|
1823
|
-
s(
|
|
1824
|
-
return s(
|
|
1902
|
+
s(a, t, n) < i ? c = a : u = a, a = (c + u) / 2;
|
|
1903
|
+
return s(a, e, r);
|
|
1825
1904
|
};
|
|
1826
1905
|
}
|
|
1827
|
-
const
|
|
1828
|
-
function
|
|
1829
|
-
const n = e.lead ??
|
|
1830
|
-
let
|
|
1831
|
-
return t.forEach((
|
|
1906
|
+
const sr = 350, or = 300, ir = 550;
|
|
1907
|
+
function Kr(t, e = {}) {
|
|
1908
|
+
const n = e.lead ?? sr, r = e.gap ?? or, s = e.tail ?? ir, o = [];
|
|
1909
|
+
let i = 0;
|
|
1910
|
+
return t.forEach((a, c) => {
|
|
1832
1911
|
const u = [];
|
|
1833
|
-
let l =
|
|
1834
|
-
|
|
1835
|
-
if (!(
|
|
1836
|
-
throw new Error(`narration: scene ${c} line ${
|
|
1837
|
-
|
|
1838
|
-
id:
|
|
1912
|
+
let l = i + n;
|
|
1913
|
+
a.lines.forEach((f, p) => {
|
|
1914
|
+
if (!(f.duration >= 0))
|
|
1915
|
+
throw new Error(`narration: scene ${c} line ${p} has an invalid duration (${f.duration})`);
|
|
1916
|
+
p > 0 && (l += r), u.push({
|
|
1917
|
+
id: f.id ?? `s${c}-l${p}`,
|
|
1839
1918
|
scene: c,
|
|
1840
|
-
line:
|
|
1919
|
+
line: p,
|
|
1841
1920
|
start: l,
|
|
1842
|
-
end: l +
|
|
1843
|
-
text:
|
|
1844
|
-
}), l +=
|
|
1921
|
+
end: l + f.duration,
|
|
1922
|
+
text: f.text
|
|
1923
|
+
}), l += f.duration;
|
|
1845
1924
|
});
|
|
1846
|
-
const h = l + s + (
|
|
1847
|
-
|
|
1848
|
-
}), { duration:
|
|
1925
|
+
const h = l + s + (a.tail ?? 0);
|
|
1926
|
+
o.push({ id: a.id ?? `s${c}`, start: i, duration: h - i, cues: u }), i = h;
|
|
1927
|
+
}), { duration: i, scenes: o, cues: o.flatMap((a) => a.cues) };
|
|
1849
1928
|
}
|
|
1850
|
-
function
|
|
1929
|
+
function Zr(t) {
|
|
1851
1930
|
return t.cues.map((e) => ({ id: e.id, time: e.start, label: e.text }));
|
|
1852
1931
|
}
|
|
1853
|
-
function
|
|
1932
|
+
function qr(t, e) {
|
|
1854
1933
|
let n = t.scenes[0];
|
|
1855
1934
|
for (const r of t.scenes)
|
|
1856
1935
|
if (e >= r.start) n = r;
|
|
1857
1936
|
else break;
|
|
1858
1937
|
return n;
|
|
1859
1938
|
}
|
|
1860
|
-
const
|
|
1861
|
-
function
|
|
1862
|
-
return t.offset + e *
|
|
1939
|
+
const ve = (t) => 6e4 / t.bpm;
|
|
1940
|
+
function Ct(t, e) {
|
|
1941
|
+
return t.offset + e * ve(t);
|
|
1863
1942
|
}
|
|
1864
|
-
function
|
|
1865
|
-
return (e - t.offset) /
|
|
1943
|
+
function It(t, e) {
|
|
1944
|
+
return (e - t.offset) / ve(t);
|
|
1866
1945
|
}
|
|
1867
|
-
function
|
|
1868
|
-
return
|
|
1946
|
+
function Jr(t, e) {
|
|
1947
|
+
return Ct(t, Math.round(It(t, e)));
|
|
1869
1948
|
}
|
|
1870
|
-
function
|
|
1871
|
-
return
|
|
1949
|
+
function ts(t, e) {
|
|
1950
|
+
return Ct(t, Math.ceil(It(t, e) - 1e-9));
|
|
1872
1951
|
}
|
|
1873
|
-
function
|
|
1952
|
+
function es(t, e, n) {
|
|
1874
1953
|
const r = Math.max(1, Math.round(t.beatsPerBar ?? 4)), s = [];
|
|
1875
1954
|
if (!(t.bpm > 0) || n < e) return s;
|
|
1876
|
-
for (let
|
|
1877
|
-
const
|
|
1878
|
-
if (
|
|
1879
|
-
s.push({ time:
|
|
1955
|
+
for (let o = Math.ceil(It(t, e) - 1e-9); ; o++) {
|
|
1956
|
+
const i = Ct(t, o);
|
|
1957
|
+
if (i > n + 1e-9) break;
|
|
1958
|
+
s.push({ time: i, bar: (o % r + r) % r === 0, n: o });
|
|
1880
1959
|
}
|
|
1881
1960
|
return s;
|
|
1882
1961
|
}
|
|
1883
1962
|
const B = 100;
|
|
1884
|
-
function
|
|
1885
|
-
const r = n.minBpm ?? 70, s = n.maxBpm ?? 180,
|
|
1886
|
-
if (
|
|
1887
|
-
const c = new Float64Array(
|
|
1888
|
-
for (let m = 0; m <
|
|
1963
|
+
function ns(t, e, n = {}) {
|
|
1964
|
+
const r = n.minBpm ?? 70, s = n.maxBpm ?? 180, o = Math.max(1, Math.round(e / B)), i = Math.min(t.length, Math.round((n.maxSeconds ?? 60) * e)), a = Math.floor(i / o);
|
|
1965
|
+
if (a < 4) return { bpm: 120, offset: 0, confidence: 0 };
|
|
1966
|
+
const c = new Float64Array(a);
|
|
1967
|
+
for (let m = 0; m < a; m++) {
|
|
1889
1968
|
let T = 0;
|
|
1890
|
-
for (let x = m *
|
|
1891
|
-
c[m] = Math.log(1e-6 + T /
|
|
1892
|
-
}
|
|
1893
|
-
const u = new Float64Array(
|
|
1894
|
-
for (let m = 1; m <
|
|
1895
|
-
const l = u.reduce((m, T) => m + T, 0) /
|
|
1896
|
-
for (let m = 0; m <
|
|
1897
|
-
const h = Math.max(1, Math.floor(60 * B / s)),
|
|
1969
|
+
for (let x = m * o; x < (m + 1) * o; x++) T += t[x] * t[x];
|
|
1970
|
+
c[m] = Math.log(1e-6 + T / o);
|
|
1971
|
+
}
|
|
1972
|
+
const u = new Float64Array(a);
|
|
1973
|
+
for (let m = 1; m < a; m++) u[m] = Math.max(0, c[m] - c[m - 1]);
|
|
1974
|
+
const l = u.reduce((m, T) => m + T, 0) / a;
|
|
1975
|
+
for (let m = 0; m < a; m++) u[m] = Math.max(0, u[m] - l);
|
|
1976
|
+
const h = Math.max(1, Math.floor(60 * B / s)), f = Math.min(a - 1, Math.ceil(60 * B / r)), p = (m) => {
|
|
1898
1977
|
let T = 0;
|
|
1899
|
-
for (let x = m; x <
|
|
1900
|
-
return T / (
|
|
1978
|
+
for (let x = m; x < a; x++) T += u[x] * u[x - m];
|
|
1979
|
+
return T / (a - m);
|
|
1901
1980
|
};
|
|
1902
|
-
let
|
|
1903
|
-
for (let m = 0; m <
|
|
1904
|
-
|
|
1981
|
+
let M = 0;
|
|
1982
|
+
for (let m = 0; m < a; m++) M += u[m] * u[m];
|
|
1983
|
+
M /= a;
|
|
1905
1984
|
let d = h, g = -1 / 0;
|
|
1906
|
-
for (let m = h; m <=
|
|
1907
|
-
const T = 60 * B / m, x = Math.exp(-0.5 * (Math.log2(T / 120) / 0.9) ** 2),
|
|
1908
|
-
|
|
1985
|
+
for (let m = h; m <= f; m++) {
|
|
1986
|
+
const T = 60 * B / m, x = Math.exp(-0.5 * (Math.log2(T / 120) / 0.9) ** 2), S = p(m) * x;
|
|
1987
|
+
S > g && (g = S, d = m);
|
|
1909
1988
|
}
|
|
1910
|
-
const
|
|
1989
|
+
const _ = (m) => {
|
|
1911
1990
|
const T = Math.floor(m);
|
|
1912
|
-
return T < 0 || T + 1 >=
|
|
1991
|
+
return T < 0 || T + 1 >= a ? 0 : u[T] + (u[T + 1] - u[T]) * (m - T);
|
|
1913
1992
|
}, b = (m, T) => {
|
|
1914
1993
|
let x = 0;
|
|
1915
|
-
for (let
|
|
1994
|
+
for (let S = T; S < a; S += m) x += _(S);
|
|
1916
1995
|
return x;
|
|
1917
1996
|
};
|
|
1918
|
-
let k = d,
|
|
1997
|
+
let k = d, w = 0, y = -1 / 0;
|
|
1919
1998
|
for (let m = d - 0.6; m <= d + 0.6 + 1e-9; m += 0.02) {
|
|
1920
1999
|
if (m < 1) continue;
|
|
1921
2000
|
const T = Math.max(1, Math.round(m * 4));
|
|
1922
2001
|
for (let x = 0; x < T; x++) {
|
|
1923
|
-
const
|
|
1924
|
-
$ > y && (y = $,
|
|
2002
|
+
const S = x / T * m, $ = b(m, S);
|
|
2003
|
+
$ > y && (y = $, w = S, k = m);
|
|
1925
2004
|
}
|
|
1926
2005
|
}
|
|
1927
|
-
const
|
|
1928
|
-
return { bpm: Math.round(
|
|
2006
|
+
const v = 60 * B / k, A = M > 0 ? Math.max(0, Math.min(1, p(d) / M)) : 0, D = (w + 0.5) * 1e3 / B;
|
|
2007
|
+
return { bpm: Math.round(v * 100) / 100, offset: Math.round(D % (6e4 / v)), confidence: A };
|
|
1929
2008
|
}
|
|
1930
|
-
const
|
|
1931
|
-
function
|
|
2009
|
+
const O = (t) => Math.round(t * 1e3) / 1e3;
|
|
2010
|
+
function rs(t, e = {}) {
|
|
1932
2011
|
if (t.length === 0) return "";
|
|
1933
2012
|
const n = e.curviness ?? 1, r = e.closed ?? !1, s = t.length;
|
|
1934
|
-
let
|
|
1935
|
-
if (s === 1) return
|
|
1936
|
-
const
|
|
1937
|
-
for (let c = 0; c <
|
|
1938
|
-
const u =
|
|
2013
|
+
let o = `M${O(t[0].x)} ${O(t[0].y)}`;
|
|
2014
|
+
if (s === 1) return o;
|
|
2015
|
+
const i = (c) => r ? t[(c % s + s) % s] : t[Math.max(0, Math.min(s - 1, c))], a = r ? s : s - 1;
|
|
2016
|
+
for (let c = 0; c < a; c++) {
|
|
2017
|
+
const u = i(c - 1), l = i(c), h = i(c + 1), f = i(c + 2);
|
|
1939
2018
|
if (n === 0) {
|
|
1940
|
-
|
|
2019
|
+
o += ` L${O(h.x)} ${O(h.y)}`;
|
|
1941
2020
|
continue;
|
|
1942
2021
|
}
|
|
1943
|
-
const
|
|
1944
|
-
|
|
2022
|
+
const p = n / 6, M = l.x + (h.x - u.x) * p, d = l.y + (h.y - u.y) * p, g = h.x - (f.x - l.x) * p, _ = h.y - (f.y - l.y) * p;
|
|
2023
|
+
o += ` C${O(M)} ${O(d)} ${O(g)} ${O(_)} ${O(h.x)} ${O(h.y)}`;
|
|
1945
2024
|
}
|
|
1946
|
-
return r ? `${
|
|
2025
|
+
return r ? `${o} Z` : o;
|
|
1947
2026
|
}
|
|
1948
|
-
const
|
|
2027
|
+
const C = (t, e = 0) => {
|
|
1949
2028
|
const n = parseFloat(t ?? "");
|
|
1950
2029
|
return Number.isFinite(n) ? n : e;
|
|
1951
2030
|
};
|
|
1952
|
-
function
|
|
2031
|
+
function ar(t) {
|
|
1953
2032
|
const e = (t ?? "").trim().split(/[\s,]+/).filter(Boolean).map(Number), n = [];
|
|
1954
2033
|
for (let r = 0; r + 1 < e.length; r += 2) n.push({ x: e[r], y: e[r + 1] });
|
|
1955
2034
|
return n;
|
|
1956
2035
|
}
|
|
1957
|
-
function
|
|
2036
|
+
function ss(t) {
|
|
1958
2037
|
const e = t.attributes;
|
|
1959
2038
|
switch (t.tag.toLowerCase()) {
|
|
1960
2039
|
case "path":
|
|
1961
2040
|
return e.d ?? null;
|
|
1962
2041
|
case "circle":
|
|
1963
2042
|
case "ellipse": {
|
|
1964
|
-
const n =
|
|
1965
|
-
return `M${n + s} ${r} A${s} ${
|
|
2043
|
+
const n = C(e.cx), r = C(e.cy), s = t.tag.toLowerCase() === "circle" ? C(e.r) : C(e.rx), o = t.tag.toLowerCase() === "circle" ? C(e.r) : C(e.ry);
|
|
2044
|
+
return `M${n + s} ${r} A${s} ${o} 0 1 1 ${n - s} ${r} A${s} ${o} 0 1 1 ${n + s} ${r} Z`;
|
|
1966
2045
|
}
|
|
1967
2046
|
case "rect": {
|
|
1968
|
-
const n =
|
|
1969
|
-
let
|
|
1970
|
-
return
|
|
2047
|
+
const n = C(e.x), r = C(e.y), s = C(e.width), o = C(e.height);
|
|
2048
|
+
let i = e.rx != null ? C(e.rx) : e.ry != null ? C(e.ry) : 0, a = e.ry != null ? C(e.ry) : i;
|
|
2049
|
+
return i = Math.min(i, s / 2), a = Math.min(a, o / 2), i === 0 || a === 0 ? `M${n} ${r} H${n + s} V${r + o} H${n} Z` : `M${n + i} ${r} H${n + s - i} A${i} ${a} 0 0 1 ${n + s} ${r + a} V${r + o - a} A${i} ${a} 0 0 1 ${n + s - i} ${r + o} H${n + i} A${i} ${a} 0 0 1 ${n} ${r + o - a} V${r + a} A${i} ${a} 0 0 1 ${n + i} ${r} Z`;
|
|
1971
2050
|
}
|
|
1972
2051
|
case "line":
|
|
1973
|
-
return `M${
|
|
2052
|
+
return `M${C(e.x1)} ${C(e.y1)} L${C(e.x2)} ${C(e.y2)}`;
|
|
1974
2053
|
case "polyline":
|
|
1975
2054
|
case "polygon": {
|
|
1976
|
-
const n =
|
|
2055
|
+
const n = ar(e.points);
|
|
1977
2056
|
if (n.length === 0) return null;
|
|
1978
|
-
const r = n.map((s,
|
|
2057
|
+
const r = n.map((s, o) => `${o === 0 ? "M" : "L"}${s.x} ${s.y}`).join(" ");
|
|
1979
2058
|
return t.tag.toLowerCase() === "polygon" ? `${r} Z` : r;
|
|
1980
2059
|
}
|
|
1981
2060
|
default:
|
|
1982
2061
|
return null;
|
|
1983
2062
|
}
|
|
1984
2063
|
}
|
|
2064
|
+
function cr(t, e) {
|
|
2065
|
+
return [t[0] + e[0], t[1] + e[1], t[2] + e[2]];
|
|
2066
|
+
}
|
|
2067
|
+
function Et(t, e) {
|
|
2068
|
+
return [t[0] - e[0], t[1] - e[1], t[2] - e[2]];
|
|
2069
|
+
}
|
|
2070
|
+
function Pe(t, e) {
|
|
2071
|
+
return [t[0] * e, t[1] * e, t[2] * e];
|
|
2072
|
+
}
|
|
2073
|
+
function ct(t, e) {
|
|
2074
|
+
return t[0] * e[0] + t[1] * e[1] + t[2] * e[2];
|
|
2075
|
+
}
|
|
2076
|
+
function vt(t, e) {
|
|
2077
|
+
return [t[1] * e[2] - t[2] * e[1], t[2] * e[0] - t[0] * e[2], t[0] * e[1] - t[1] * e[0]];
|
|
2078
|
+
}
|
|
2079
|
+
function Lt(t) {
|
|
2080
|
+
return Math.hypot(t[0], t[1], t[2]);
|
|
2081
|
+
}
|
|
2082
|
+
function ur(t, e) {
|
|
2083
|
+
return Lt(Et(t, e));
|
|
2084
|
+
}
|
|
2085
|
+
function Pt(t) {
|
|
2086
|
+
const e = Lt(t);
|
|
2087
|
+
return e === 0 ? [0, 0, 0] : Pe(t, 1 / e);
|
|
2088
|
+
}
|
|
2089
|
+
function lr(t, e, n) {
|
|
2090
|
+
return [t[0] + (e[0] - t[0]) * n, t[1] + (e[1] - t[1]) * n, t[2] + (e[2] - t[2]) * n];
|
|
2091
|
+
}
|
|
2092
|
+
const os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2093
|
+
__proto__: null,
|
|
2094
|
+
add: cr,
|
|
2095
|
+
cross: vt,
|
|
2096
|
+
distance: ur,
|
|
2097
|
+
dot: ct,
|
|
2098
|
+
length: Lt,
|
|
2099
|
+
lerp: lr,
|
|
2100
|
+
normalize: Pt,
|
|
2101
|
+
scale: Pe,
|
|
2102
|
+
subtract: Et
|
|
2103
|
+
}, Symbol.toStringTag, { value: "Module" })), hr = Math.PI / 180;
|
|
2104
|
+
function fr() {
|
|
2105
|
+
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
2106
|
+
}
|
|
2107
|
+
function pr(t, e) {
|
|
2108
|
+
const n = new Array(16);
|
|
2109
|
+
for (let r = 0; r < 4; r++)
|
|
2110
|
+
for (let s = 0; s < 4; s++) {
|
|
2111
|
+
let o = 0;
|
|
2112
|
+
for (let i = 0; i < 4; i++) o += t[i * 4 + s] * e[r * 4 + i];
|
|
2113
|
+
n[r * 4 + s] = o;
|
|
2114
|
+
}
|
|
2115
|
+
return n;
|
|
2116
|
+
}
|
|
2117
|
+
function dr(t) {
|
|
2118
|
+
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t[0], t[1], t[2], 1];
|
|
2119
|
+
}
|
|
2120
|
+
function gr(t) {
|
|
2121
|
+
return [t[0], 0, 0, 0, 0, t[1], 0, 0, 0, 0, t[2], 0, 0, 0, 0, 1];
|
|
2122
|
+
}
|
|
2123
|
+
function $e(t) {
|
|
2124
|
+
const [e, n, r, s] = t;
|
|
2125
|
+
return [
|
|
2126
|
+
1 - 2 * (n * n + r * r),
|
|
2127
|
+
2 * (e * n + r * s),
|
|
2128
|
+
2 * (e * r - n * s),
|
|
2129
|
+
0,
|
|
2130
|
+
2 * (e * n - r * s),
|
|
2131
|
+
1 - 2 * (e * e + r * r),
|
|
2132
|
+
2 * (n * r + e * s),
|
|
2133
|
+
0,
|
|
2134
|
+
2 * (e * r + n * s),
|
|
2135
|
+
2 * (n * r - e * s),
|
|
2136
|
+
1 - 2 * (e * e + n * n),
|
|
2137
|
+
0,
|
|
2138
|
+
0,
|
|
2139
|
+
0,
|
|
2140
|
+
0,
|
|
2141
|
+
1
|
|
2142
|
+
];
|
|
2143
|
+
}
|
|
2144
|
+
function mr(t, e, n) {
|
|
2145
|
+
const r = $e(e);
|
|
2146
|
+
for (let s = 0; s < 3; s++)
|
|
2147
|
+
r[s] *= n[0], r[4 + s] *= n[1], r[8 + s] *= n[2];
|
|
2148
|
+
return r[12] = t[0], r[13] = t[1], r[14] = t[2], r;
|
|
2149
|
+
}
|
|
2150
|
+
function yr(t) {
|
|
2151
|
+
const e = new Array(16);
|
|
2152
|
+
for (let n = 0; n < 4; n++) for (let r = 0; r < 4; r++) e[r * 4 + n] = t[n * 4 + r];
|
|
2153
|
+
return e;
|
|
2154
|
+
}
|
|
2155
|
+
function Mr(t) {
|
|
2156
|
+
const [e, n, r, s, o, i, a, c, u, l, h, f, p, M, d, g] = t, _ = e * i - n * o, b = e * a - r * o, k = e * c - s * o, w = n * a - r * i, y = n * c - s * i, v = r * c - s * a, A = u * M - l * p, D = u * d - h * p, m = u * g - f * p, T = l * d - h * M, x = l * g - f * M, S = h * g - f * d, $ = _ * S - b * x + k * T + w * m - y * D + v * A;
|
|
2157
|
+
if (Math.abs($) < 1e-12) return null;
|
|
2158
|
+
const P = 1 / $;
|
|
2159
|
+
return [
|
|
2160
|
+
(i * S - a * x + c * T) * P,
|
|
2161
|
+
(r * x - n * S - s * T) * P,
|
|
2162
|
+
(M * v - d * y + g * w) * P,
|
|
2163
|
+
(h * y - l * v - f * w) * P,
|
|
2164
|
+
(a * m - o * S - c * D) * P,
|
|
2165
|
+
(e * S - r * m + s * D) * P,
|
|
2166
|
+
(d * k - p * v - g * b) * P,
|
|
2167
|
+
(u * v - h * k + f * b) * P,
|
|
2168
|
+
(o * x - i * m + c * A) * P,
|
|
2169
|
+
(n * m - e * x - s * A) * P,
|
|
2170
|
+
(p * y - M * k + g * _) * P,
|
|
2171
|
+
(l * k - u * y - f * _) * P,
|
|
2172
|
+
(i * D - o * T - a * A) * P,
|
|
2173
|
+
(e * T - n * D + r * A) * P,
|
|
2174
|
+
(M * b - p * w - d * _) * P,
|
|
2175
|
+
(u * w - l * b + h * _) * P
|
|
2176
|
+
];
|
|
2177
|
+
}
|
|
2178
|
+
function _r(t, e, n, r) {
|
|
2179
|
+
const s = 1 / Math.tan(t * hr / 2), o = 1 / (n - r);
|
|
2180
|
+
return [s / e, 0, 0, 0, 0, s, 0, 0, 0, 0, (r + n) * o, -1, 0, 0, 2 * r * n * o, 0];
|
|
2181
|
+
}
|
|
2182
|
+
function br(t, e, n, r, s, o) {
|
|
2183
|
+
const i = 1 / (e - t), a = 1 / (r - n), c = 1 / (o - s);
|
|
2184
|
+
return [2 * i, 0, 0, 0, 0, 2 * a, 0, 0, 0, 0, -2 * c, 0, -(e + t) * i, -(r + n) * a, -(o + s) * c, 1];
|
|
2185
|
+
}
|
|
2186
|
+
function Tr(t, e, n = [0, 1, 0]) {
|
|
2187
|
+
const r = Pt(Et(t, e)), s = Pt(vt(n, r)), o = vt(r, s);
|
|
2188
|
+
return [
|
|
2189
|
+
s[0],
|
|
2190
|
+
o[0],
|
|
2191
|
+
r[0],
|
|
2192
|
+
0,
|
|
2193
|
+
s[1],
|
|
2194
|
+
o[1],
|
|
2195
|
+
r[1],
|
|
2196
|
+
0,
|
|
2197
|
+
s[2],
|
|
2198
|
+
o[2],
|
|
2199
|
+
r[2],
|
|
2200
|
+
0,
|
|
2201
|
+
-ct(s, t),
|
|
2202
|
+
-ct(o, t),
|
|
2203
|
+
-ct(r, t),
|
|
2204
|
+
1
|
|
2205
|
+
];
|
|
2206
|
+
}
|
|
2207
|
+
function xr(t, e) {
|
|
2208
|
+
const n = t[0] * e[0] + t[4] * e[1] + t[8] * e[2] + t[12], r = t[1] * e[0] + t[5] * e[1] + t[9] * e[2] + t[13], s = t[2] * e[0] + t[6] * e[1] + t[10] * e[2] + t[14], o = t[3] * e[0] + t[7] * e[1] + t[11] * e[2] + t[15];
|
|
2209
|
+
return o === 1 || o === 0 ? [n, r, s] : [n / o, r / o, s / o];
|
|
2210
|
+
}
|
|
2211
|
+
const is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2212
|
+
__proto__: null,
|
|
2213
|
+
compose: mr,
|
|
2214
|
+
fromQuat: $e,
|
|
2215
|
+
identity: fr,
|
|
2216
|
+
invert: Mr,
|
|
2217
|
+
lookAt: Tr,
|
|
2218
|
+
multiply: pr,
|
|
2219
|
+
orthographic: br,
|
|
2220
|
+
perspective: _r,
|
|
2221
|
+
scaling: gr,
|
|
2222
|
+
transformPoint: xr,
|
|
2223
|
+
translation: dr,
|
|
2224
|
+
transpose: yr
|
|
2225
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1985
2226
|
export {
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2227
|
+
Ar as Clock,
|
|
2228
|
+
ye as DEFAULT_BAKE_INTERVAL_MS,
|
|
2229
|
+
zt as DEFAULT_INERTIA_FRICTION,
|
|
2230
|
+
L as DEFAULT_SPRING,
|
|
2231
|
+
Xt as FORMAT_VERSION,
|
|
2232
|
+
ze as INERTIA_MAX_DURATION_MS,
|
|
2233
|
+
Yn as InertiaTrackPlayer,
|
|
2234
|
+
Er as MORPH_SAMPLES,
|
|
2235
|
+
Sr as ManualClock,
|
|
2236
|
+
ie as SPRING_MAX_DURATION_MS,
|
|
2237
|
+
wr as SPRING_PRESETS,
|
|
2238
|
+
tt as SPRING_STEP_MS,
|
|
2239
|
+
ut as SpringSampler,
|
|
2240
|
+
zn as SpringTrackPlayer,
|
|
2241
|
+
Bn as Timeline,
|
|
2242
|
+
_t as TrackPlayer,
|
|
2243
|
+
Br as ValueResolver,
|
|
2244
|
+
Je as backOut,
|
|
2245
|
+
On as bakeEasing,
|
|
2246
|
+
_e as bakeInertiaTrack,
|
|
2247
|
+
Me as bakeSpringTrack,
|
|
2248
|
+
It as beatAtTime,
|
|
2249
|
+
ve as beatLength,
|
|
2250
|
+
Ct as beatTime,
|
|
2251
|
+
es as beatsBetween,
|
|
2252
|
+
qe as bounceOut,
|
|
2253
|
+
Vn as charactersFor,
|
|
2254
|
+
Lr as clearMorphCache,
|
|
2255
|
+
Cr as clearPathCache,
|
|
2256
|
+
Ke as createCubicBezier,
|
|
2257
|
+
qn as createRandom,
|
|
2258
|
+
Xn as createTrack,
|
|
2259
|
+
Rr as criticalDamping,
|
|
2260
|
+
Qr as customBounce,
|
|
2261
|
+
Wr as customEase,
|
|
2262
|
+
Gr as customWiggle,
|
|
2263
|
+
Zn as deserializeTimeline,
|
|
2264
|
+
Gn as deserializeTrack,
|
|
2265
|
+
ns as detectTempo,
|
|
2266
|
+
Be as easeIn,
|
|
2267
|
+
ae as easeInCubic,
|
|
2268
|
+
Qe as easeInOut,
|
|
2269
|
+
ue as easeInOutCubic,
|
|
2270
|
+
He as easeInOutQuad,
|
|
2271
|
+
Ve as easeInQuad,
|
|
2272
|
+
We as easeOut,
|
|
2273
|
+
ce as easeOutCubic,
|
|
2274
|
+
je as easeOutQuad,
|
|
2275
|
+
Ze as elasticOut,
|
|
2276
|
+
Fn as expandParametricEasings,
|
|
2277
|
+
ne as formatVersionFor,
|
|
2278
|
+
Ur as fromJSON,
|
|
2279
|
+
le as getEasingFunction,
|
|
2280
|
+
me as getInterpolator,
|
|
2281
|
+
Te as getMotionPathPoint,
|
|
2282
|
+
Ir as getPathLength,
|
|
2283
|
+
hn as getPointAtProgress,
|
|
2284
|
+
Le as hasKeyframes,
|
|
2285
|
+
Vr as hashSeed,
|
|
2286
|
+
ft as inertiaDuration,
|
|
2287
|
+
ht as inertiaRest,
|
|
2288
|
+
kt as inertiaValueAt,
|
|
2289
|
+
Dr as inertiaVelocityAt,
|
|
2290
|
+
In as interpolateArray,
|
|
2291
|
+
Cn as interpolateColor,
|
|
2292
|
+
Xr as interpolateMotionPath,
|
|
2293
|
+
N as interpolateNumber,
|
|
2294
|
+
Ln as interpolatePathString,
|
|
2295
|
+
En as interpolateQuaternion,
|
|
2296
|
+
te as interpolateString,
|
|
2297
|
+
Ee as isCubicBezierEasing,
|
|
2055
2298
|
V as isInertiaTrack,
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2299
|
+
kr as isMotionPathPoint,
|
|
2300
|
+
re as isMotionPathTrack,
|
|
2301
|
+
xt as isParametricEasing,
|
|
2302
|
+
Sn as isPathData,
|
|
2303
|
+
j as isSpringTrack,
|
|
2304
|
+
$t as isTextTrack,
|
|
2305
|
+
$r as isUnderdamped,
|
|
2306
|
+
Hr as isUnresolved,
|
|
2307
|
+
St as linear,
|
|
2308
|
+
is as mat4,
|
|
2309
|
+
Oe as maxStaggerDistance,
|
|
2310
|
+
kn as morphPath,
|
|
2311
|
+
Zr as narrationMarkers,
|
|
2312
|
+
qr as narrationSceneAt,
|
|
2313
|
+
Ye as naturalRest,
|
|
2314
|
+
Jr as nearestBeat,
|
|
2315
|
+
ts as nextBeat,
|
|
2316
|
+
en as parametricEasing,
|
|
2317
|
+
G as parsePath,
|
|
2318
|
+
Kr as planNarration,
|
|
2319
|
+
zr as playheadCrossings,
|
|
2320
|
+
he as pointAtDistance,
|
|
2321
|
+
rs as pointsToPath,
|
|
2322
|
+
Or as quat,
|
|
2323
|
+
ke as randomBetween,
|
|
2324
|
+
jr as randomChoice,
|
|
2325
|
+
Jn as randomSnapped,
|
|
2326
|
+
tr as resolveSequence,
|
|
2327
|
+
we as resolveValue,
|
|
2328
|
+
Kn as serializeTimeline,
|
|
2329
|
+
Qn as serializeTrack,
|
|
2330
|
+
ss as shapeToPathData,
|
|
2331
|
+
Nn as simplifyKeyframes,
|
|
2332
|
+
Pr as springDuration,
|
|
2333
|
+
vr as springValueAt,
|
|
2334
|
+
se as staggerDistance,
|
|
2335
|
+
oe as staggerOffset,
|
|
2336
|
+
Fe as staggerOffsets,
|
|
2337
|
+
Rt as staggerSpan,
|
|
2338
|
+
tn as stepsEasing,
|
|
2339
|
+
Hn as textAt,
|
|
2340
|
+
Yr as toJSON,
|
|
2341
|
+
Fr as toKeyframedTrack,
|
|
2342
|
+
Nr as toKeyframedTracks,
|
|
2343
|
+
U as trackTargets,
|
|
2344
|
+
os as vec3
|
|
2099
2345
|
};
|