@algorisys/tinyfly 0.64.0 → 0.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,7 +56,7 @@ function re(i, t) {
56
56
  function mt(i, t) {
57
57
  return i <= 1 ? 0 : Math.max(...re(i, t));
58
58
  }
59
- const U = 1, Nt = 6e4, j = Nt / U, F = {
59
+ const U = 1, Nt = 6e4, G = Nt / U, F = {
60
60
  stiffness: 180,
61
61
  damping: 12,
62
62
  mass: 1,
@@ -118,12 +118,12 @@ class ae {
118
118
  * of a spring track. Runs the simulation to completion once.
119
119
  */
120
120
  settleTime() {
121
- return this.simulateTo(j + 1), this.settledStep !== null ? this.settledStep * U : Nt;
121
+ return this.simulateTo(G + 1), this.settledStep !== null ? this.settledStep * U : Nt;
122
122
  }
123
123
  /** Advance the cached simulation until it holds at least `steps` samples. */
124
124
  simulateTo(t) {
125
125
  if (this.settledStep !== null) return;
126
- const e = Math.min(t, j + 1), s = U / 1e3;
126
+ const e = Math.min(t, G + 1), s = U / 1e3;
127
127
  for (; this.samples.length < e; ) {
128
128
  const n = this.samples[this.samples.length - 1], r = n - this.to, a = -this.stiffness * r, o = -this.damping * this.velocity, c = (a + o) / this.mass;
129
129
  this.velocity += c * s;
@@ -133,7 +133,7 @@ class ae {
133
133
  return;
134
134
  }
135
135
  }
136
- this.samples.length > j && (this.settledStep = j);
136
+ this.samples.length > G && (this.settledStep = G);
137
137
  }
138
138
  }
139
139
  const At = 4, oe = 2e-3, ce = 1e-4, he = 6e4;
@@ -245,7 +245,7 @@ function _e(i = 1.70158) {
245
245
  return e * e * ((i + 1) * e + i) + 1;
246
246
  };
247
247
  }
248
- function Me(i, t = "end") {
248
+ function ke(i, t = "end") {
249
249
  const e = Math.max(1, Math.floor(i));
250
250
  return (s) => {
251
251
  if (s >= 1) return 1;
@@ -263,10 +263,10 @@ function Me(i, t = "end") {
263
263
  }
264
264
  };
265
265
  }
266
- function ke(i) {
266
+ function Me(i) {
267
267
  switch (i.type) {
268
268
  case "steps":
269
- return Me(i.count, i.position);
269
+ return ke(i.count, i.position);
270
270
  case "elastic":
271
271
  return st(Ae(i.amplitude, i.period), i.mode);
272
272
  case "bounce":
@@ -276,7 +276,7 @@ function ke(i) {
276
276
  }
277
277
  }
278
278
  function we(i) {
279
- return i === void 0 ? dt : ee(i) ? be(i.points) : ie(i) ? ke(i) : Te[i] ?? dt;
279
+ return i === void 0 ? dt : ee(i) ? be(i.points) : ie(i) ? Me(i) : Te[i] ?? dt;
280
280
  }
281
281
  const _t = 32, Pe = 256, Y = /* @__PURE__ */ new Map(), xe = /[MmLlHhVvCcSsQqTtAaZz]/, ve = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, Ce = {
282
282
  M: 2,
@@ -324,22 +324,22 @@ function Re(i, t, e, s, n, r, a, o, c) {
324
324
  const w = Math.sqrt(T);
325
325
  h *= w, u *= w;
326
326
  }
327
- const A = r === a ? -1 : 1, _ = h * h * u * u - h * h * y * y - u * u * g * g, m = h * h * y * y + u * u * g * g, M = A * Math.sqrt(Math.max(0, _ / m)), S = M * h * y / u, R = -M * u * g / h, Q = f * S - d * R + (i + o) / 2, k = d * S + f * R + (t + c) / 2, C = (w, v, I, O) => {
328
- const it = w * I + v * O, G = Math.sqrt((w * w + v * v) * (I * I + O * O)), q = Math.acos(Math.max(-1, Math.min(1, it / G)));
329
- return w * O - v * I < 0 ? -q : q;
327
+ const A = r === a ? -1 : 1, _ = h * h * u * u - h * h * y * y - u * u * g * g, m = h * h * y * y + u * u * g * g, k = A * Math.sqrt(Math.max(0, _ / m)), S = k * h * y / u, R = -k * u * g / h, Q = f * S - d * R + (i + o) / 2, M = d * S + f * R + (t + c) / 2, C = (w, v, I, $) => {
328
+ const it = w * I + v * $, z = Math.sqrt((w * w + v * v) * (I * I + $ * $)), q = Math.acos(Math.max(-1, Math.min(1, it / z)));
329
+ return w * $ - v * I < 0 ? -q : q;
330
330
  }, P = C(1, 0, (g - S) / h, (y - R) / u);
331
331
  let x = C((g - S) / h, (y - R) / u, (-g - S) / h, (-y - R) / u);
332
332
  !a && x > 0 && (x -= 2 * Math.PI), a && x < 0 && (x += 2 * Math.PI);
333
- const E = Math.max(1, Math.ceil(Math.abs(x) / (Math.PI / 2))), et = x / E, z = 4 / 3 * Math.tan(et / 4), yt = (w) => {
333
+ const E = Math.max(1, Math.ceil(Math.abs(x) / (Math.PI / 2))), et = x / E, j = 4 / 3 * Math.tan(et / 4), yt = (w) => {
334
334
  const v = h * Math.cos(w), I = u * Math.sin(w);
335
- return [f * v - d * I + Q, d * v + f * I + k];
335
+ return [f * v - d * I + Q, d * v + f * I + M];
336
336
  }, Tt = (w) => {
337
337
  const v = -h * Math.sin(w), I = u * Math.cos(w);
338
338
  return [f * v - d * I, d * v + f * I];
339
339
  }, bt = [];
340
340
  for (let w = 0; w < E; w++) {
341
- const v = P + w * et, I = v + et, [O, it] = yt(v), [G, q] = w === E - 1 ? [o, c] : yt(I), [Zt, Kt] = Tt(v), [Jt, te] = Tt(I);
342
- bt.push([O + z * Zt, it + z * Kt, G - z * Jt, q - z * te, G, q]);
341
+ const v = P + w * et, I = v + et, [$, it] = yt(v), [z, q] = w === E - 1 ? [o, c] : yt(I), [Zt, Kt] = Tt(v), [Jt, te] = Tt(I);
342
+ bt.push([$ + j * Zt, it + j * Kt, z - j * Jt, q - j * te, z, q]);
343
343
  }
344
344
  return bt;
345
345
  }
@@ -347,7 +347,7 @@ function B(i, t, e, s, n) {
347
347
  const r = 1 - n;
348
348
  return r * r * r * i + 3 * r * r * n * t + 3 * r * n * n * e + n * n * n * s;
349
349
  }
350
- function Mt(i, t, e, s, n) {
350
+ function kt(i, t, e, s, n) {
351
351
  const r = 1 - n;
352
352
  return 3 * r * r * (t - i) + 6 * r * n * (e - t) + 3 * n * n * (s - e);
353
353
  }
@@ -397,54 +397,54 @@ function J(i) {
397
397
  continue;
398
398
  }
399
399
  for (let _ = 0; _ + A <= g.length; _ += A) {
400
- const m = g.slice(_, _ + A), M = T ? s : 0, S = T ? n : 0;
400
+ const m = g.slice(_, _ + A), k = T ? s : 0, S = T ? n : 0;
401
401
  let R = null, Q = null;
402
402
  switch (y) {
403
403
  case "M":
404
- _ === 0 ? (s = m[0] + M, n = m[1] + S, r = s, a = n, (h < 0 || e[e.length - 1]?.subpath === h) && h++) : (l(N(s, n, m[0] + M, m[1] + S)), s = m[0] + M, n = m[1] + S);
404
+ _ === 0 ? (s = m[0] + k, n = m[1] + S, r = s, a = n, (h < 0 || e[e.length - 1]?.subpath === h) && h++) : (l(N(s, n, m[0] + k, m[1] + S)), s = m[0] + k, n = m[1] + S);
405
405
  break;
406
406
  case "L":
407
- l(N(s, n, m[0] + M, m[1] + S)), s = m[0] + M, n = m[1] + S;
407
+ l(N(s, n, m[0] + k, m[1] + S)), s = m[0] + k, n = m[1] + S;
408
408
  break;
409
409
  case "H":
410
- l(N(s, n, m[0] + M, n)), s = m[0] + M;
410
+ l(N(s, n, m[0] + k, n)), s = m[0] + k;
411
411
  break;
412
412
  case "V":
413
413
  l(N(s, n, s, m[0] + S)), n = m[0] + S;
414
414
  break;
415
415
  case "C": {
416
- const k = [m[0] + M, m[1] + S, m[2] + M, m[3] + S, m[4] + M, m[5] + S];
417
- l(Z(s, n, k)), R = [k[2], k[3]], s = k[4], n = k[5];
416
+ const M = [m[0] + k, m[1] + S, m[2] + k, m[3] + S, m[4] + k, m[5] + S];
417
+ l(Z(s, n, M)), R = [M[2], M[3]], s = M[4], n = M[5];
418
418
  break;
419
419
  }
420
420
  case "S": {
421
- const [k, C] = o ? [2 * s - o[0], 2 * n - o[1]] : [s, n], P = [k, C, m[0] + M, m[1] + S, m[2] + M, m[3] + S];
421
+ const [M, C] = o ? [2 * s - o[0], 2 * n - o[1]] : [s, n], P = [M, C, m[0] + k, m[1] + S, m[2] + k, m[3] + S];
422
422
  l(Z(s, n, P)), R = [P[2], P[3]], s = P[4], n = P[5];
423
423
  break;
424
424
  }
425
425
  case "Q":
426
426
  case "T": {
427
- let k = s, C = n;
428
- y === "Q" ? (k = m[0] + M, C = m[1] + S) : c && (k = 2 * s - c[0], C = 2 * n - c[1]);
429
- const P = y === "Q" ? m[2] + M : m[0] + M, x = y === "Q" ? m[3] + S : m[1] + S;
427
+ let M = s, C = n;
428
+ y === "Q" ? (M = m[0] + k, C = m[1] + S) : c && (M = 2 * s - c[0], C = 2 * n - c[1]);
429
+ const P = y === "Q" ? m[2] + k : m[0] + k, x = y === "Q" ? m[3] + S : m[1] + S;
430
430
  l(
431
431
  Z(s, n, [
432
- s + 2 / 3 * (k - s),
432
+ s + 2 / 3 * (M - s),
433
433
  n + 2 / 3 * (C - n),
434
- P + 2 / 3 * (k - P),
434
+ P + 2 / 3 * (M - P),
435
435
  x + 2 / 3 * (C - x),
436
436
  P,
437
437
  x
438
438
  ])
439
- ), Q = [k, C], s = P, n = x;
439
+ ), Q = [M, C], s = P, n = x;
440
440
  break;
441
441
  }
442
442
  case "A": {
443
- const k = m[5] + M, C = m[6] + S;
443
+ const M = m[5] + k, C = m[6] + S;
444
444
  let P = s, x = n;
445
- for (const E of Re(s, n, m[0], m[1], m[2], m[3], m[4], k, C))
445
+ for (const E of Re(s, n, m[0], m[1], m[2], m[3], m[4], M, C))
446
446
  l(Z(P, x, E)), P = E[4], x = E[5];
447
- s = k, n = C;
447
+ s = M, n = C;
448
448
  break;
449
449
  }
450
450
  }
@@ -484,7 +484,7 @@ function Be(i, t) {
484
484
  };
485
485
  }
486
486
  const [e, s, n, r, a, o] = i.points, c = De(i, t);
487
- let h = Mt(i.startX, e, n, a, c), u = Mt(i.startY, s, r, o, c);
487
+ let h = kt(i.startX, e, n, a, c), u = kt(i.startY, s, r, o, c);
488
488
  if (Math.hypot(h, u) < 1e-9) {
489
489
  const l = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), f = B(i.startX, e, n, a, l), d = B(i.startY, s, r, o, l), b = B(i.startX, e, n, a, c), p = B(i.startY, s, r, o, c);
490
490
  h = c < 0.5 ? f - b : b - f, u = c < 0.5 ? d - p : p - d;
@@ -495,7 +495,7 @@ function Be(i, t) {
495
495
  angle: Math.atan2(u, h) * 180 / Math.PI
496
496
  };
497
497
  }
498
- function zt(i, t, e = 0, s = i.length) {
498
+ function jt(i, t, e = 0, s = i.length) {
499
499
  if (s <= e) return { x: 0, y: 0, angle: 0 };
500
500
  let n = 0;
501
501
  for (let r = e; r < s; r++) {
@@ -508,11 +508,11 @@ function zt(i, t, e = 0, s = i.length) {
508
508
  }
509
509
  function Ee(i, t) {
510
510
  const { segments: e, totalLength: s } = J(i);
511
- return zt(e, Math.max(0, Math.min(1, t)) * s);
511
+ return jt(e, Math.max(0, Math.min(1, t)) * s);
512
512
  }
513
- const Le = 24, $e = 320, Oe = 2.5, V = 72, Fe = 0.2, Xe = 128, K = /* @__PURE__ */ new Map();
513
+ const Le = 24, Oe = 320, $e = 2.5, V = 72, Fe = 0.2, Xe = 128, K = /* @__PURE__ */ new Map();
514
514
  let nt = 0, L;
515
- const kt = (i) => Math.round(i * 100) / 100;
515
+ const Mt = (i) => Math.round(i * 100) / 100;
516
516
  function wt(i, t) {
517
517
  const { segments: e, subpaths: s, totalLength: n } = J(i);
518
518
  if (e.length === 0) return [];
@@ -523,7 +523,7 @@ function wt(i, t) {
523
523
  return s.filter((r) => r.length > 0).map((r) => ({ segments: e, start: r.start, end: r.end, length: r.length, closed: r.closed }));
524
524
  }
525
525
  function pt(i, t) {
526
- const e = i.closed ? (t % 1 + 1) % 1 : Math.max(0, Math.min(1, t)), s = zt(i.segments, e * i.length, i.start, i.end);
526
+ const e = i.closed ? (t % 1 + 1) % 1 : Math.max(0, Math.min(1, t)), s = jt(i.segments, e * i.length, i.start, i.end);
527
527
  return [s.x, s.y];
528
528
  }
529
529
  function Pt(i) {
@@ -573,7 +573,7 @@ function Ne(i, t, e) {
573
573
  function Ve(i, t, e) {
574
574
  const s = i.closed && t.closed, n = qe(i, t, e.shapeIndex), r = Math.max(
575
575
  Le,
576
- Math.min($e, Math.ceil(Math.max(i.length, t.length) / Oe))
576
+ Math.min(Oe, Math.ceil(Math.max(i.length, t.length) / $e))
577
577
  ), a = /* @__PURE__ */ new Set(), o = (l) => a.add(Math.round(l * 1e7) / 1e7);
578
578
  for (let l = 0; l <= r; l++) o(l / r);
579
579
  for (const l of Pt(i)) o(l);
@@ -635,7 +635,7 @@ function He(i, t, e, s = {}) {
635
635
  let a = "";
636
636
  for (const o of r.pairs) {
637
637
  for (let c = 0; c < o.from.length; c += 2) {
638
- const h = kt(o.from[c] + (o.to[c] - o.from[c]) * n), u = kt(o.from[c + 1] + (o.to[c + 1] - o.from[c + 1]) * n);
638
+ const h = Mt(o.from[c] + (o.to[c] - o.from[c]) * n), u = Mt(o.from[c + 1] + (o.to[c + 1] - o.from[c + 1]) * n);
639
639
  a += `${c === 0 ? a ? " M" : "M" : " L"}${h} ${u}`;
640
640
  }
641
641
  o.closed && (a += " Z");
@@ -645,7 +645,7 @@ function He(i, t, e, s = {}) {
645
645
  function Qe(i) {
646
646
  return /^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(i);
647
647
  }
648
- const D = (i, t, e) => i + (t - i) * e, Gt = 512, rt = /* @__PURE__ */ new Map(), at = /* @__PURE__ */ new Map();
648
+ const D = (i, t, e) => i + (t - i) * e, zt = 512, rt = /* @__PURE__ */ new Map(), at = /* @__PURE__ */ new Map();
649
649
  function It(i) {
650
650
  const t = rt.get(i);
651
651
  if (t) return t;
@@ -654,25 +654,25 @@ function It(i) {
654
654
  parseInt(e.slice(2, 4), 16),
655
655
  parseInt(e.slice(4, 6), 16)
656
656
  ];
657
- return rt.size < Gt && rt.set(i, s), s;
657
+ return rt.size < zt && rt.set(i, s), s;
658
658
  }
659
- const Rt = (i) => i.charCodeAt(0) === 35, Dt = (i) => i.startsWith("rgb"), Bt = (i) => i.startsWith("rgba"), ze = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, ot = (i) => Math.round(i).toString(16).padStart(2, "0");
660
- function Ge(i, t, e) {
659
+ const Rt = (i) => i.charCodeAt(0) === 35, Dt = (i) => i.startsWith("rgb"), Bt = (i) => i.startsWith("rgba"), je = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, ot = (i) => Math.round(i).toString(16).padStart(2, "0");
660
+ function ze(i, t, e) {
661
661
  return `#${ot(i)}${ot(t)}${ot(e)}`;
662
662
  }
663
663
  function Et(i) {
664
664
  const t = at.get(i);
665
665
  if (t) return t;
666
- const e = i.match(ze);
666
+ const e = i.match(je);
667
667
  if (!e)
668
668
  throw new Error(`Invalid rgb color: ${i}`);
669
669
  const s = parseInt(e[1], 10), n = parseInt(e[2], 10), r = parseInt(e[3], 10), a = e[4] !== void 0 ? [s, n, r, parseFloat(e[4])] : [s, n, r];
670
- return at.size < Gt && at.set(i, a), a;
670
+ return at.size < zt && at.set(i, a), a;
671
671
  }
672
- const je = (i, t, e) => {
672
+ const Ge = (i, t, e) => {
673
673
  if (Rt(i) && Rt(t)) {
674
674
  const [s, n, r] = It(i), [a, o, c] = It(t), h = D(s, a, e), u = D(n, o, e), l = D(r, c, e);
675
- return Ge(h, u, l);
675
+ return ze(h, u, l);
676
676
  }
677
677
  if ((Dt(i) || Bt(i)) && (Dt(t) || Bt(t))) {
678
678
  const s = Et(i), n = Et(t), r = Math.round(D(s[0], n[0], e)), a = Math.round(D(s[1], n[1], e)), o = Math.round(D(s[2], n[2], e));
@@ -690,7 +690,7 @@ const je = (i, t, e) => {
690
690
  return n;
691
691
  }, Lt = (i, t, e) => e < 1 ? i : t, Ke = (i, t, e) => He(i, t, e);
692
692
  function Je(i) {
693
- return typeof i == "number" ? D : Array.isArray(i) ? Ze : typeof i == "string" ? i.startsWith("#") || i.startsWith("rgb") ? je : Qe(i) ? Ke : Lt : Lt;
693
+ return typeof i == "number" ? D : Array.isArray(i) ? Ze : typeof i == "string" ? i.startsWith("#") || i.startsWith("rgb") ? Ge : Qe(i) ? Ke : Lt : Lt;
694
694
  }
695
695
  function ti(i) {
696
696
  const t = [...i.keyframes].sort((e, s) => e.time - s.time);
@@ -699,7 +699,7 @@ function ti(i) {
699
699
  keyframes: t
700
700
  };
701
701
  }
702
- function $(i) {
702
+ function O(i) {
703
703
  return i.targets && i.targets.length > 0 ? i.targets : [i.target];
704
704
  }
705
705
  function X(i, t, e, s) {
@@ -710,7 +710,7 @@ class ct {
710
710
  track;
711
711
  targets;
712
712
  constructor(t) {
713
- this.track = t, this.targets = $(t);
713
+ this.track = t, this.targets = O(t);
714
714
  }
715
715
  /**
716
716
  * Get the interpolated value at a specific time.
@@ -785,7 +785,7 @@ class ei {
785
785
  targets;
786
786
  sampler;
787
787
  constructor(t) {
788
- this.track = t, this.targets = $(t), this.sampler = new ae(t.spring);
788
+ this.track = t, this.targets = O(t), this.sampler = new ae(t.spring);
789
789
  }
790
790
  getValueAtTime(t) {
791
791
  return this.sampler.valueAt(t - X(0, this.targets.length, this.track.delay, this.track.stagger));
@@ -812,7 +812,7 @@ class ii {
812
812
  targets;
813
813
  duration;
814
814
  constructor(t) {
815
- this.track = t, this.targets = $(t), this.duration = Wt(t.inertia);
815
+ this.track = t, this.targets = O(t), this.duration = Wt(t.inertia);
816
816
  }
817
817
  getValueAtTime(t) {
818
818
  return St(this.track.inertia, t - X(0, this.targets.length, this.track.delay, this.track.stagger));
@@ -879,8 +879,7 @@ function oi(i, t, e = 0) {
879
879
  class ci {
880
880
  id;
881
881
  name;
882
- /** Caption text per language, per marker id */
883
- captions;
882
+ _captions;
884
883
  _tracks = [];
885
884
  _trackPlayers = /* @__PURE__ */ new Map();
886
885
  _motionPathTracks = /* @__PURE__ */ new Map();
@@ -902,7 +901,7 @@ class ci {
902
901
  onUpdate = null;
903
902
  onComplete = null;
904
903
  constructor(t) {
905
- if (this.id = t.id, this.name = t.name, this.captions = t.captions, this._config = t.config ?? {}, this._explicitDuration = t.config?.duration, t.tracks)
904
+ if (this.id = t.id, this.name = t.name, this._captions = t.captions, this._config = t.config ?? {}, this._explicitDuration = t.config?.duration, t.tracks)
906
905
  for (const e of t.tracks)
907
906
  this.addTrack(e);
908
907
  }
@@ -1093,7 +1092,7 @@ class ci {
1093
1092
  const t = /* @__PURE__ */ new Set();
1094
1093
  this._sharedWrites = !1;
1095
1094
  t: for (const e of this._tracks)
1096
- for (const s of $(e)) {
1095
+ for (const s of O(e)) {
1097
1096
  const n = `${s}\0${e.property}`;
1098
1097
  if (t.has(n)) {
1099
1098
  this._sharedWrites = !0;
@@ -1204,7 +1203,7 @@ class ci {
1204
1203
  for (let r = 0; r < e; r++) {
1205
1204
  const a = this._tracks[r];
1206
1205
  if (a.property !== s.property) continue;
1207
- const o = $(a).filter((l) => $(s).includes(l));
1206
+ const o = O(a).filter((l) => O(s).includes(l));
1208
1207
  if (o.length === 0) continue;
1209
1208
  const c = this.getTrackSpan(a.id);
1210
1209
  if (!c || !(c.from <= n.to && n.from <= c.to)) continue;
@@ -1221,7 +1220,7 @@ class ci {
1221
1220
  return t;
1222
1221
  }
1223
1222
  _matches(t, e) {
1224
- if (e.id !== void 0 && t.id !== e.id || e.property !== void 0 && t.property !== e.property || e.target !== void 0 && !$(t).includes(e.target)) return !1;
1223
+ if (e.id !== void 0 && t.id !== e.id || e.property !== void 0 && t.property !== e.property || e.target !== void 0 && !O(t).includes(e.target)) return !1;
1225
1224
  if (e.timeRange) {
1226
1225
  const s = this.getTrackSpan(t.id);
1227
1226
  if (!s || s.to < e.timeRange.from || s.from > e.timeRange.to) return !1;
@@ -1249,6 +1248,21 @@ class ci {
1249
1248
  get markers() {
1250
1249
  return [...this._config.markers ?? []].sort((t, e) => t.time - e.time);
1251
1250
  }
1251
+ /** Replace the markers (kept in time order); an empty list removes them. */
1252
+ setMarkers(t) {
1253
+ const e = t && t.length > 0 ? [...t].sort((n, r) => n.time - r.time).map((n) => ({ ...n })) : void 0, s = { ...this._config };
1254
+ e ? s.markers = e : delete s.markers, this._config = s;
1255
+ }
1256
+ /** Caption text per language, per marker id */
1257
+ get captions() {
1258
+ return this._captions;
1259
+ }
1260
+ /** Replace the captions; languages with no captions are dropped. */
1261
+ setCaptions(t) {
1262
+ const e = {};
1263
+ for (const [s, n] of Object.entries(t ?? {})) e[s] = { ...n };
1264
+ this._captions = Object.keys(e).length > 0 ? e : void 0;
1265
+ }
1252
1266
  /** Start the between-iterations pause, if the timeline configures one. */
1253
1267
  _armRepeatDelay() {
1254
1268
  this._repeatDelayRemaining = this._config.repeatDelay ?? 0;
@@ -1405,7 +1419,7 @@ function Ti(i) {
1405
1419
  const t = i.style;
1406
1420
  !t || t.transformBox || (t.transformBox = "fill-box", t.transformOrigin || (t.transformOrigin = "50% 50%"));
1407
1421
  }
1408
- const $t = /* @__PURE__ */ new Set([
1422
+ const Ot = /* @__PURE__ */ new Set([
1409
1423
  "width",
1410
1424
  "height",
1411
1425
  "top",
@@ -1456,7 +1470,7 @@ const $t = /* @__PURE__ */ new Set([
1456
1470
  color: "color",
1457
1471
  backgroundColor: "backgroundColor",
1458
1472
  borderColor: "borderColor"
1459
- }, Ot = {
1473
+ }, $t = {
1460
1474
  fill: "fill",
1461
1475
  stroke: "stroke",
1462
1476
  strokeWidth: "strokeWidth",
@@ -1464,7 +1478,7 @@ const $t = /* @__PURE__ */ new Set([
1464
1478
  strokeDashoffset: "strokeDashoffset",
1465
1479
  fillOpacity: "fillOpacity",
1466
1480
  strokeOpacity: "strokeOpacity"
1467
- }, Mi = "http://www.w3.org/2000/svg";
1481
+ }, ki = "http://www.w3.org/2000/svg";
1468
1482
  class H {
1469
1483
  targets = /* @__PURE__ */ new Map();
1470
1484
  /**
@@ -1600,13 +1614,13 @@ class H {
1600
1614
  */
1601
1615
  applyStyleProperty(t, e, s) {
1602
1616
  let n;
1603
- if (t.namespaceURI === Mi && e in Ot) {
1617
+ if (t.namespaceURI === ki && e in $t) {
1604
1618
  const o = Array.isArray(s) ? s.join(", ") : String(s);
1605
- t.style[Ot[e]] = o;
1619
+ t.style[$t[e]] = o;
1606
1620
  return;
1607
1621
  } else e === "fill" && t.dataset?.elementType === "text" ? n = "color" : n = _i[e] ?? e;
1608
1622
  let a;
1609
- typeof s == "number" ? $t.has(e) || $t.has(n) ? a = `${s}px` : a = String(s) : Array.isArray(s) ? a = s.join(", ") : a = s, t.style[n] = a;
1623
+ typeof s == "number" ? Ot.has(e) || Ot.has(n) ? a = `${s}px` : a = String(s) : Array.isArray(s) ? a = s.join(", ") : a = s, t.style[n] = a;
1610
1624
  }
1611
1625
  }
1612
1626
  class Ft {
@@ -1648,7 +1662,7 @@ class Ft {
1648
1662
  });
1649
1663
  }
1650
1664
  }
1651
- function ki(i, t, e, s, n) {
1665
+ function Mi(i, t, e, s, n) {
1652
1666
  const r = e - n;
1653
1667
  if (r < 0) {
1654
1668
  t.paused || t.pause(), t.currentTime = 0;
@@ -1656,7 +1670,7 @@ function ki(i, t, e, s, n) {
1656
1670
  }
1657
1671
  i.update(r, s);
1658
1672
  }
1659
- class jt {
1673
+ class Gt {
1660
1674
  container;
1661
1675
  timeline = null;
1662
1676
  adapter;
@@ -1822,7 +1836,7 @@ class jt {
1822
1836
  /** Sync all discovered media targets to a timeline time. */
1823
1837
  syncAllMedia(t, e) {
1824
1838
  for (const s of this.mediaTargets)
1825
- ki(s.sync, s.el, t, e, s.startTime);
1839
+ Mi(s.sync, s.el, t, e, s.startTime);
1826
1840
  }
1827
1841
  /**
1828
1842
  * Load animation from inline JSON string.
@@ -2014,11 +2028,11 @@ class jt {
2014
2028
  }
2015
2029
  }
2016
2030
  async function Pi(i, t, e = {}) {
2017
- const s = new jt(i, { ...e, autoplay: !0 });
2031
+ const s = new Gt(i, { ...e, autoplay: !0 });
2018
2032
  return await s.load(t), s;
2019
2033
  }
2020
2034
  function xi(i, t = {}) {
2021
- return new jt(i, t);
2035
+ return new Gt(i, t);
2022
2036
  }
2023
2037
  class wi {
2024
2038
  container;
@@ -2297,10 +2311,10 @@ const Ci = { type: "none", duration: 0 };
2297
2311
  export {
2298
2312
  Ci as DEFAULT_TRANSITION,
2299
2313
  Ft as MediaSync,
2300
- jt as TinyflyPlayer,
2314
+ Gt as TinyflyPlayer,
2301
2315
  wi as TinyflySequencer,
2302
2316
  xi as create,
2303
2317
  Pi as play,
2304
2318
  vi as playSequence,
2305
- ki as syncMediaElement
2319
+ Mi as syncMediaElement
2306
2320
  };