@waveform-playlist/browser 9.0.3 → 9.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1053,11 +1053,7 @@ var mh = 44100, gh = 1e3, vh = [256, 512, 1024, 2048, 4096, 8192], rl = 0.1, yh
1053
1053
  ), this._emitStateChange());
1054
1054
  }
1055
1055
  setLoopEnabled(e) {
1056
- e !== this._isLoopEnabled && (this._isLoopEnabled = e, this._adapter?.setLoop(
1057
- e && this._isBeforeLoopEnd(),
1058
- this._loopStart,
1059
- this._loopEnd
1060
- ), this._emitStateChange());
1056
+ e !== this._isLoopEnabled && (this._isLoopEnabled = e, this._adapter?.setLoop(e && this._isBeforeLoopEnd(), this._loopStart, this._loopEnd), this._emitStateChange());
1061
1057
  }
1062
1058
  // ---------------------------------------------------------------------------
1063
1059
  // Per-Track Audio (delegates to adapter)
@@ -2925,12 +2921,12 @@ function Ea(e, t = e.getBoundingClientRect(), n = 0) {
2925
2921
  let d = e.parentElement;
2926
2922
  for (; d && d !== c.documentElement; ) {
2927
2923
  if (!fp(d)) {
2928
- const w = d.getBoundingClientRect(), g = n * (w.bottom - w.top), _ = n * (w.right - w.left), C = n * (w.bottom - w.top), S = n * (w.right - w.left);
2924
+ const w = d.getBoundingClientRect(), g = n * (w.bottom - w.top), _ = n * (w.right - w.left), S = n * (w.bottom - w.top), C = n * (w.right - w.left);
2929
2925
  l = {
2930
2926
  top: Math.max(l.top, w.top - g),
2931
2927
  right: Math.min(l.right, w.right + _),
2932
- bottom: Math.min(l.bottom, w.bottom + C),
2933
- left: Math.max(l.left, w.left - S),
2928
+ bottom: Math.min(l.bottom, w.bottom + S),
2929
+ left: Math.max(l.left, w.left - C),
2934
2930
  width: 0,
2935
2931
  // Will be calculated next
2936
2932
  height: 0
@@ -3151,10 +3147,10 @@ var pl = Array.from({ length: 100 }, (e, t) => t / 100), $u = 75, yn, Ma, en, bn
3151
3147
  const { element: l } = this;
3152
3148
  if ((o = re(this, bn)) == null || o.disconnect(), re(this, kr) || !re(this, yn) || !l.isConnected)
3153
3149
  return;
3154
- const c = (s = l.ownerDocument) != null ? s : document, { innerHeight: u, innerWidth: d } = (i = c.defaultView) != null ? i : window, h = l.getBoundingClientRect(), f = Ea(l, h), { top: m, left: y, bottom: v, right: p } = f, b = -Math.floor(m), w = -Math.floor(y), g = -Math.floor(d - p), _ = -Math.floor(u - v), C = `${b}px ${g}px ${_}px ${w}px`;
3150
+ const c = (s = l.ownerDocument) != null ? s : document, { innerHeight: u, innerWidth: d } = (i = c.defaultView) != null ? i : window, h = l.getBoundingClientRect(), f = Ea(l, h), { top: m, left: y, bottom: v, right: p } = f, b = -Math.floor(m), w = -Math.floor(y), g = -Math.floor(d - p), _ = -Math.floor(u - v), S = `${b}px ${g}px ${_}px ${w}px`;
3155
3151
  this.boundingClientRect = h, yt(this, bn, new IntersectionObserver(
3156
- (S) => {
3157
- const [k] = S, { intersectionRect: I } = k;
3152
+ (C) => {
3153
+ const [k] = C, { intersectionRect: I } = k;
3158
3154
  (k.intersectionRatio !== 1 ? k.intersectionRatio : zr.intersectionRatio(
3159
3155
  I,
3160
3156
  Ea(l)
@@ -3162,7 +3158,7 @@ var pl = Array.from({ length: 100 }, (e, t) => t / 100), $u = 75, yn, Ma, en, bn
3162
3158
  },
3163
3159
  {
3164
3160
  threshold: pl,
3165
- rootMargin: C,
3161
+ rootMargin: S,
3166
3162
  root: c
3167
3163
  }
3168
3164
  )), re(this, bn).observe(l), xu(this, $a, Tu).call(this);
@@ -3842,12 +3838,12 @@ var gm = ["dragover", "dragmove"], vm = class extends pt {
3842
3838
  y,
3843
3839
  i
3844
3840
  ), p = Object.entries(o).map(
3845
- ([_, C]) => this.manager.monitor.addEventListener(
3841
+ ([_, S]) => this.manager.monitor.addEventListener(
3846
3842
  _,
3847
- (S, k) => {
3843
+ (C, k) => {
3848
3844
  const I = h;
3849
3845
  if (!I) return;
3850
- const E = C?.(S, k);
3846
+ const E = S?.(C, k);
3851
3847
  E && I.nodeValue !== E && (f = E, gm.includes(_) ? v() : (y(), v.cancel()));
3852
3848
  }
3853
3849
  )
@@ -3865,26 +3861,26 @@ var gm = ["dragover", "dragmove"], vm = class extends pt {
3865
3861
  this.registerEffect(() => {
3866
3862
  var _;
3867
3863
  w.clear();
3868
- for (const C of this.manager.registry.draggables.value) {
3869
- const S = (_ = C.handle) != null ? _ : C.element;
3870
- if (S) {
3871
- (!u || !d) && w.add(b), (!hm(S) || Gs()) && !S.hasAttribute("tabindex") && w.add(() => S.setAttribute("tabindex", "0")), !S.hasAttribute("role") && S.tagName.toLowerCase() !== "button" && w.add(
3872
- () => S.setAttribute("role", yl.role)
3873
- ), S.hasAttribute("aria-roledescription") || w.add(
3874
- () => S.setAttribute(
3864
+ for (const S of this.manager.registry.draggables.value) {
3865
+ const C = (_ = S.handle) != null ? _ : S.element;
3866
+ if (C) {
3867
+ (!u || !d) && w.add(b), (!hm(C) || Gs()) && !C.hasAttribute("tabindex") && w.add(() => C.setAttribute("tabindex", "0")), !C.hasAttribute("role") && C.tagName.toLowerCase() !== "button" && w.add(
3868
+ () => C.setAttribute("role", yl.role)
3869
+ ), C.hasAttribute("aria-roledescription") || w.add(
3870
+ () => C.setAttribute(
3875
3871
  "aria-roledescription",
3876
3872
  yl.roleDescription
3877
3873
  )
3878
- ), S.hasAttribute("aria-describedby") || w.add(
3879
- () => S.setAttribute("aria-describedby", l)
3874
+ ), C.hasAttribute("aria-describedby") || w.add(
3875
+ () => C.setAttribute("aria-describedby", l)
3880
3876
  );
3881
3877
  for (const I of ["aria-pressed", "aria-grabbed"]) {
3882
- const E = String(C.isDragging);
3883
- S.getAttribute(I) !== E && w.add(() => S.setAttribute(I, E));
3878
+ const E = String(S.isDragging);
3879
+ C.getAttribute(I) !== E && w.add(() => C.setAttribute(I, E));
3884
3880
  }
3885
- const k = String(C.disabled);
3886
- S.getAttribute("aria-disabled") !== k && w.add(
3887
- () => S.setAttribute("aria-disabled", k)
3881
+ const k = String(S.disabled);
3882
+ C.getAttribute("aria-disabled") !== k && w.add(
3883
+ () => C.setAttribute("aria-disabled", k)
3888
3884
  );
3889
3885
  }
3890
3886
  }
@@ -4353,9 +4349,9 @@ qu = function() {
4353
4349
  x: y.scaleX / m.scaleX,
4354
4350
  y: y.scaleY / m.scaleY
4355
4351
  };
4356
- let { width: w, height: g, top: _, left: C } = p;
4352
+ let { width: w, height: g, top: _, left: S } = p;
4357
4353
  v && (w = w / b.x, g = g / b.y);
4358
- const S = new jp(f), {
4354
+ const C = new jp(f), {
4359
4355
  transition: k,
4360
4356
  translate: I,
4361
4357
  boxSizing: E,
@@ -4377,11 +4373,11 @@ qu = function() {
4377
4373
  if (!h.transformOrigin) {
4378
4374
  const ne = Se(() => i.current);
4379
4375
  h.transformOrigin = {
4380
- x: (ne.x - C * m.scaleX - m.x) / (w * m.scaleX),
4376
+ x: (ne.x - S * m.scaleX - m.x) / (w * m.scaleX),
4381
4377
  y: (ne.y - _ * m.scaleY - m.y) / (g * m.scaleY)
4382
4378
  };
4383
4379
  }
4384
- const { transformOrigin: _e } = h, Fe = _ * m.scaleY + m.y, Y = C * m.scaleX + m.x;
4380
+ const { transformOrigin: _e } = h, Fe = _ * m.scaleY + m.y, Y = S * m.scaleX + m.x;
4385
4381
  if (!h.coordinates && (h.coordinates = {
4386
4382
  x: Y,
4387
4383
  y: Fe
@@ -4400,12 +4396,12 @@ qu = function() {
4400
4396
  x: N.x / m.scaleX + he.width,
4401
4397
  y: N.y / m.scaleY + he.height
4402
4398
  }, $ = {
4403
- left: C + U.x,
4399
+ left: S + U.x,
4404
4400
  top: _ + U.y
4405
4401
  };
4406
4402
  f.setAttribute(Bt, "true");
4407
4403
  const ge = Se(() => s.transform), Le = (t = h.translate) != null ? t : { x: 0, y: 0 }, Q = ge.x * m.scaleX + Le.x, be = ge.y * m.scaleY + Le.y, Ge = ku();
4408
- S.set(
4404
+ C.set(
4409
4405
  {
4410
4406
  width: w - se,
4411
4407
  height: g - ie,
@@ -4428,11 +4424,11 @@ qu = function() {
4428
4424
  width: w,
4429
4425
  height: g,
4430
4426
  top: _,
4431
- left: C,
4427
+ left: S,
4432
4428
  widthOffset: se,
4433
4429
  heightOffset: ie,
4434
4430
  delta: U,
4435
- styles: S,
4431
+ styles: C,
4436
4432
  dragOperation: s,
4437
4433
  getElementMutationObserver: () => qe,
4438
4434
  getSavedCellWidths: () => Oe,
@@ -4463,7 +4459,7 @@ qu = function() {
4463
4459
  if (qe?.disconnect(), q?.disconnect(), Ye.disconnect(), Je.removeEventListener("resize", tt), Ho(f) && (f.removeEventListener(
4464
4460
  "beforetoggle",
4465
4461
  bl
4466
- ), f.removeAttribute("popover")), f.removeAttribute(Bt), S.reset(), Oe && Ko(u)) {
4462
+ ), f.removeAttribute("popover")), f.removeAttribute(Bt), C.reset(), Oe && Ko(u)) {
4467
4463
  const Me = Array.from(u.cells);
4468
4464
  for (const [Ue, kt] of Me.entries())
4469
4465
  kt.style.width = (ne = Oe[Ue]) != null ? ne : "";
@@ -4484,7 +4480,7 @@ qu = function() {
4484
4480
  var we;
4485
4481
  return (we = s.shape) == null ? void 0 : we.current;
4486
4482
  }), Ie = ye && !dt ? "250ms cubic-bezier(0.25, 1, 0.5, 1)" : "0ms linear";
4487
- if (S.set(
4483
+ if (C.set(
4488
4484
  {
4489
4485
  transition: `${k}, translate ${Ie}`,
4490
4486
  translate: `${kt.x}px ${kt.y}px 0`
@@ -4523,7 +4519,7 @@ qu = function() {
4523
4519
  moved: Me,
4524
4520
  transition: k,
4525
4521
  alignment: l.alignment,
4526
- styles: S,
4522
+ styles: C,
4527
4523
  animation: ne ?? void 0,
4528
4524
  getElementMutationObserver: () => qe,
4529
4525
  cleanup: G,
@@ -6101,11 +6097,20 @@ var Md = {
6101
6097
  const i = e.current;
6102
6098
  if (!i) return;
6103
6099
  o(), i.addEventListener("scroll", s, { passive: !0 });
6104
- const l = new ResizeObserver(() => {
6100
+ let l = !1;
6101
+ const c = () => {
6102
+ l = !0;
6103
+ };
6104
+ i.addEventListener("pointerdown", c, { once: !0 }), i.addEventListener("keydown", c, { once: !0 }), i.addEventListener("wheel", c, { once: !0, passive: !0 });
6105
+ const u = () => {
6106
+ !l && i.scrollLeft !== 0 && (i.scrollLeft = 0, o()), i.removeEventListener("scroll", u);
6107
+ };
6108
+ i.addEventListener("scroll", u);
6109
+ const d = new ResizeObserver(() => {
6105
6110
  s();
6106
6111
  });
6107
- return l.observe(i), () => {
6108
- i.removeEventListener("scroll", s), l.disconnect(), a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
6112
+ return d.observe(i), () => {
6113
+ i.removeEventListener("scroll", s), i.removeEventListener("scroll", u), i.removeEventListener("pointerdown", c), i.removeEventListener("keydown", c), i.removeEventListener("wheel", c), d.disconnect(), a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
6109
6114
  };
6110
6115
  }, [e, o, s]), /* @__PURE__ */ x($d.Provider, { value: r, children: t });
6111
6116
  };
@@ -6227,11 +6232,11 @@ var Lg = W.canvas.attrs((e) => ({
6227
6232
  } = e, { canvasRef: m, canvasMapRef: y } = mi(), v = Dd(), p = pi(r, et, v);
6228
6233
  qn(() => {
6229
6234
  const _ = u + d;
6230
- for (const [C, S] of y.current.entries()) {
6231
- const k = C * et, I = S.getContext("2d"), E = Math.floor(i / 2);
6235
+ for (const [S, C] of y.current.entries()) {
6236
+ const k = S * et, I = C.getContext("2d"), E = Math.floor(i / 2);
6232
6237
  if (I) {
6233
- I.resetTransform(), I.clearRect(0, 0, S.width, S.height), I.imageSmoothingEnabled = !1, I.scale(s, s);
6234
- const D = S.width / s;
6238
+ I.resetTransform(), I.clearRect(0, 0, C.width, C.height), I.imageSmoothingEnabled = !1, I.scale(s, s);
6239
+ const D = C.width / s;
6235
6240
  let R;
6236
6241
  f === "normal" ? R = c : R = l, I.fillStyle = Vg(I, R, D, i);
6237
6242
  const A = k, O = k + D, B = Bg(A, u, _);
@@ -6262,13 +6267,13 @@ var Lg = W.canvas.attrs((e) => ({
6262
6267
  p
6263
6268
  ]);
6264
6269
  const b = p.map((_) => {
6265
- const C = _ * et, S = Math.min(r - C, et);
6270
+ const S = _ * et, C = Math.min(r - S, et);
6266
6271
  return /* @__PURE__ */ x(
6267
6272
  Lg,
6268
6273
  {
6269
- $cssWidth: S,
6270
- $left: C,
6271
- width: S * s,
6274
+ $cssWidth: C,
6275
+ $left: S,
6276
+ width: C * s,
6272
6277
  height: i * s,
6273
6278
  $waveHeight: i,
6274
6279
  "data-index": _,
@@ -6525,23 +6530,23 @@ var $l = ({
6525
6530
  showFades: b = !1,
6526
6531
  touchOptimized: w = !1
6527
6532
  }) => {
6528
- const g = Math.floor(s / l), C = Math.floor((s + i) / l) - g, S = c && !u && !d, k = `clip-${r}-${a}`, {
6533
+ const g = Math.floor(s / l), S = Math.floor((s + i) / l) - g, C = c && !u && !d, k = `clip-${r}-${a}`, {
6529
6534
  ref: I,
6530
6535
  handleRef: E,
6531
6536
  isDragSource: D
6532
6537
  } = vo({
6533
6538
  id: k,
6534
6539
  data: { clipId: n, trackIndex: r, clipIndex: a },
6535
- disabled: !S
6540
+ disabled: !C
6536
6541
  }), R = `clip-boundary-left-${r}-${a}`, { ref: A, isDragSource: O } = vo({
6537
6542
  id: R,
6538
6543
  data: { clipId: n, trackIndex: r, clipIndex: a, boundary: "left" },
6539
- disabled: !S,
6544
+ disabled: !C,
6540
6545
  feedback: "none"
6541
6546
  }), B = `clip-boundary-right-${r}-${a}`, { ref: X, isDragSource: J } = vo({
6542
6547
  id: B,
6543
6548
  data: { clipId: n, trackIndex: r, clipIndex: a, boundary: "right" },
6544
- disabled: !S,
6549
+ disabled: !C,
6545
6550
  feedback: "none"
6546
6551
  });
6547
6552
  return /* @__PURE__ */ me(
@@ -6551,11 +6556,12 @@ var $l = ({
6551
6556
  style: D ? { zIndex: 100 } : void 0,
6552
6557
  className: t,
6553
6558
  $left: g,
6554
- $width: C,
6559
+ $width: S,
6555
6560
  $isOverlay: d,
6556
6561
  "data-clip-container": "true",
6557
6562
  "data-track-id": m,
6558
6563
  onMouseDown: f,
6564
+ ...C ? {} : { tabIndex: -1 },
6559
6565
  children: [
6560
6566
  c && /* @__PURE__ */ x(
6561
6567
  Ng,
@@ -6566,7 +6572,7 @@ var $l = ({
6566
6572
  trackName: o,
6567
6573
  isSelected: h,
6568
6574
  disableDrag: u,
6569
- dragHandleProps: S ? { handleRef: E } : void 0
6575
+ dragHandleProps: C ? { handleRef: E } : void 0
6570
6576
  }
6571
6577
  ),
6572
6578
  /* @__PURE__ */ x(Wg, { originX: g, children: /* @__PURE__ */ me(Jg, { $isOverlay: d, children: [
@@ -6583,7 +6589,7 @@ var $l = ({
6583
6589
  b && v && v.duration > 0 && /* @__PURE__ */ x(
6584
6590
  $l,
6585
6591
  {
6586
- left: C - Math.floor(v.duration * p / l),
6592
+ left: S - Math.floor(v.duration * p / l),
6587
6593
  width: Math.floor(v.duration * p / l),
6588
6594
  type: "fadeOut",
6589
6595
  curveType: v.type
@@ -6902,12 +6908,12 @@ var Tl = W.div.attrs((e) => ({
6902
6908
  (p, b) => {
6903
6909
  p.preventDefault(), p.stopPropagation(), u(b), d.current = p.clientX, h.current = b === "start" ? e : t;
6904
6910
  const w = (_) => {
6905
- const C = _.clientX - d.current, S = h.current + C;
6911
+ const S = _.clientX - d.current, C = h.current + S;
6906
6912
  if (b === "start") {
6907
- const k = Math.max(i, Math.min(t - 10, S));
6913
+ const k = Math.max(i, Math.min(t - 10, C));
6908
6914
  a?.(k);
6909
6915
  } else {
6910
- const k = Math.max(e + 10, Math.min(l, S));
6916
+ const k = Math.max(e + 10, Math.min(l, C));
6911
6917
  o?.(k);
6912
6918
  }
6913
6919
  }, g = () => {
@@ -6920,9 +6926,9 @@ var Tl = W.div.attrs((e) => ({
6920
6926
  (p) => {
6921
6927
  p.preventDefault(), p.stopPropagation(), u("region"), d.current = p.clientX, h.current = e, f.current = t;
6922
6928
  const b = t - e, w = (_) => {
6923
- const C = _.clientX - d.current;
6924
- let S = h.current + C, k = f.current + C;
6925
- S < i && (S = i, k = i + b), k > l && (k = l, S = l - b), s?.(S, k);
6929
+ const S = _.clientX - d.current;
6930
+ let C = h.current + S, k = f.current + S;
6931
+ C < i && (C = i, k = i + b), k > l && (k = l, C = l - b), s?.(C, k);
6926
6932
  }, g = () => {
6927
6933
  u(null), document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", g);
6928
6934
  };
@@ -6997,8 +7003,8 @@ var Tl = W.div.attrs((e) => ({
6997
7003
  const v = f.clientX - y.left, p = Math.max(o, Math.min(s, v));
6998
7004
  c.current = p, a?.(p, p);
6999
7005
  const b = (g) => {
7000
- const _ = g.clientX - y.left, C = Math.max(o, Math.min(s, _)), S = Math.min(c.current, C), k = Math.max(c.current, C);
7001
- a?.(S, k);
7006
+ const _ = g.clientX - y.left, S = Math.max(o, Math.min(s, _)), C = Math.min(c.current, S), k = Math.max(c.current, S);
7007
+ a?.(C, k);
7002
7008
  }, w = () => {
7003
7009
  l(!1), document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", w);
7004
7010
  };
@@ -7241,7 +7247,7 @@ var S0 = C0(), Pl = ({
7241
7247
  clipId: h,
7242
7248
  onCanvasesReady: f
7243
7249
  }) => {
7244
- const m = t ?? e, { canvasRef: y, canvasMapRef: v } = mi(), p = T([]), b = T(/* @__PURE__ */ new WeakSet()), w = T(d), g = T(f), _ = !!(d && h), C = Dd(), S = pi(r, et, C), k = i ?? S0, I = u ?? (n ? n.sampleRate / 2 : 22050), E = l ?? w0, D = !!l;
7250
+ const m = t ?? e, { canvasRef: y, canvasMapRef: v } = mi(), p = T([]), b = T(/* @__PURE__ */ new WeakSet()), w = T(d), g = T(f), _ = !!(d && h), S = Dd(), C = pi(r, et, S), k = i ?? S0, I = u ?? (n ? n.sampleRate / 2 : 22050), E = l ?? w0, D = !!l;
7245
7251
  j(() => {
7246
7252
  w.current = d;
7247
7253
  }, [d]), j(() => {
@@ -7297,7 +7303,7 @@ var S0 = C0(), Pl = ({
7297
7303
  });
7298
7304
  g.current?.(oe, L);
7299
7305
  }
7300
- }, [v, _, h, m, r, S]), j(() => () => {
7306
+ }, [v, _, h, m, r, C]), j(() => () => {
7301
7307
  const A = w.current;
7302
7308
  if (A) {
7303
7309
  for (const O of p.current)
@@ -7365,9 +7371,9 @@ var S0 = C0(), Pl = ({
7365
7371
  I,
7366
7372
  E,
7367
7373
  D,
7368
- S
7374
+ C
7369
7375
  ]);
7370
- const R = S.map((A) => {
7376
+ const R = C.map((A) => {
7371
7377
  const O = A * et, B = Math.min(r - O, et);
7372
7378
  return /* @__PURE__ */ x(
7373
7379
  x0,
@@ -7399,8 +7405,8 @@ var S0 = C0(), Pl = ({
7399
7405
  spectrogramOnCanvasesReady: d,
7400
7406
  ...h
7401
7407
  }) => {
7402
- const f = jr(), { waveHeight: m, barWidth: y, barGap: v, samplesPerPixel: p } = ja(), b = vi(), w = o ?? p, g = e && f ? f.selectedWaveOutlineColor : f?.waveOutlineColor, _ = e && f ? f.selectedWaveFillColor : f?.waveFillColor, C = f?.waveformDrawMode || "inverted", S = r || c;
7403
- if (n === "spectrogram" && S)
7408
+ const f = jr(), { waveHeight: m, barWidth: y, barGap: v, samplesPerPixel: p } = ja(), b = vi(), w = o ?? p, g = e && f ? f.selectedWaveOutlineColor : f?.waveOutlineColor, _ = e && f ? f.selectedWaveFillColor : f?.waveFillColor, S = f?.waveformDrawMode || "inverted", C = r || c;
7409
+ if (n === "spectrogram" && C)
7404
7410
  return /* @__PURE__ */ x(
7405
7411
  Pl,
7406
7412
  {
@@ -7419,7 +7425,7 @@ var S0 = C0(), Pl = ({
7419
7425
  onCanvasesReady: d
7420
7426
  }
7421
7427
  );
7422
- if (n === "both" && S) {
7428
+ if (n === "both" && C) {
7423
7429
  const k = Math.floor(m / 2);
7424
7430
  return /* @__PURE__ */ me(Lt, { children: [
7425
7431
  /* @__PURE__ */ x(
@@ -7462,7 +7468,7 @@ var S0 = C0(), Pl = ({
7462
7468
  barWidth: y,
7463
7469
  barGap: v,
7464
7470
  transparentBackground: t,
7465
- drawMode: C
7471
+ drawMode: S
7466
7472
  }
7467
7473
  )
7468
7474
  }
@@ -7480,7 +7486,7 @@ var S0 = C0(), Pl = ({
7480
7486
  barWidth: y,
7481
7487
  barGap: v,
7482
7488
  transparentBackground: t,
7483
- drawMode: C
7489
+ drawMode: S
7484
7490
  }
7485
7491
  );
7486
7492
  }, Rl = 72, k0 = W.div`
@@ -7541,8 +7547,8 @@ var E0 = ({
7541
7547
  for (const w of v) {
7542
7548
  const g = n(w, r, a);
7543
7549
  if (g < 0 || g > 1) continue;
7544
- const _ = b + d * (1 - g), C = w >= 1e3 ? `${(w / 1e3).toFixed(1)}k` : `${w} Hz`, S = y.measureText(C), k = 3;
7545
- y.fillStyle = s, y.fillRect(0, _ - 7, S.width + k * 2, 14), y.fillStyle = o, y.fillText(C, k, _);
7550
+ const _ = b + d * (1 - g), S = w >= 1e3 ? `${(w / 1e3).toFixed(1)}k` : `${w} Hz`, C = y.measureText(S), k = 3;
7551
+ y.fillStyle = s, y.fillRect(0, _ - 7, C.width + k * 2, 14), y.fillStyle = o, y.fillText(S, k, _);
7546
7552
  }
7547
7553
  }
7548
7554
  }, [
@@ -7623,19 +7629,19 @@ var $0 = W.div.attrs((e) => ({
7623
7629
  timeScaleHeight: d,
7624
7630
  controls: { show: h, width: f }
7625
7631
  } = We(Kr), m = vi(), { widthX: y, canvasInfo: v, timeMarkersWithPositions: p } = Te(() => {
7626
- const S = /* @__PURE__ */ new Map(), k = [], I = A0(n / 1e3, u, c), E = c / u;
7632
+ const C = /* @__PURE__ */ new Map(), k = [], I = A0(n / 1e3, u, c), E = c / u;
7627
7633
  let D = 0;
7628
7634
  for (let R = 0; R < I; R += E * o / 1e3) {
7629
7635
  const A = Math.floor(R);
7630
7636
  if (D % r === 0) {
7631
7637
  const O = D, B = M0(O), X = s ? /* @__PURE__ */ x(bt.Fragment, { children: s(O, A) }, `timestamp-${D}`) : /* @__PURE__ */ x(D0, { $left: A, children: B }, B);
7632
- k.push({ pix: A, element: X }), S.set(A, d);
7633
- } else D % a === 0 ? S.set(A, Math.floor(d / 2)) : D % o === 0 && S.set(A, Math.floor(d / 5));
7638
+ k.push({ pix: A, element: X }), C.set(A, d);
7639
+ } else D % a === 0 ? C.set(A, Math.floor(d / 2)) : D % o === 0 && C.set(A, Math.floor(d / 5));
7634
7640
  D += o;
7635
7641
  }
7636
7642
  return {
7637
7643
  widthX: I,
7638
- canvasInfo: S,
7644
+ canvasInfo: C,
7639
7645
  timeMarkersWithPositions: k
7640
7646
  };
7641
7647
  }, [
@@ -7647,8 +7653,8 @@ var $0 = W.div.attrs((e) => ({
7647
7653
  o,
7648
7654
  s,
7649
7655
  d
7650
- ]), b = pi(y, et), w = b.map((S) => {
7651
- const k = S * et, I = Math.min(y - k, et);
7656
+ ]), b = pi(y, et), w = b.map((C) => {
7657
+ const k = C * et, I = Math.min(y - k, et);
7652
7658
  return /* @__PURE__ */ x(
7653
7659
  T0,
7654
7660
  {
@@ -7657,17 +7663,17 @@ var $0 = W.div.attrs((e) => ({
7657
7663
  $timeScaleHeight: d,
7658
7664
  width: I * m,
7659
7665
  height: d * m,
7660
- "data-index": S,
7666
+ "data-index": C,
7661
7667
  ref: i
7662
7668
  },
7663
- `timescale-${S}`
7669
+ `timescale-${C}`
7664
7670
  );
7665
- }), g = b.length > 0 ? b[0] * et : 0, _ = b.length > 0 ? (b[b.length - 1] + 1) * et : 1 / 0, C = b.length > 0 ? p.filter(({ pix: S }) => S >= g && S < _).map(({ element: S }) => S) : p.map(({ element: S }) => S);
7671
+ }), g = b.length > 0 ? b[0] * et : 0, _ = b.length > 0 ? (b[b.length - 1] + 1) * et : 1 / 0, S = b.length > 0 ? p.filter(({ pix: C }) => C >= g && C < _).map(({ element: C }) => C) : p.map(({ element: C }) => C);
7666
7672
  return qn(() => {
7667
- for (const [S, k] of l.current.entries()) {
7673
+ for (const [C, k] of l.current.entries()) {
7668
7674
  const I = k.getContext("2d");
7669
7675
  if (!I) continue;
7670
- const E = S * et, D = k.width / m;
7676
+ const E = C * et, D = k.width / m;
7671
7677
  I.resetTransform(), I.clearRect(0, 0, k.width, k.height), I.imageSmoothingEnabled = !1, I.fillStyle = t, I.scale(m, m);
7672
7678
  for (const [R, A] of v.entries()) {
7673
7679
  if (R < E || R >= E + D) continue;
@@ -7690,7 +7696,7 @@ var $0 = W.div.attrs((e) => ({
7690
7696
  $controlWidth: h ? f : 0,
7691
7697
  $timeScaleHeight: d,
7692
7698
  children: [
7693
- C,
7699
+ S,
7694
7700
  w
7695
7701
  ]
7696
7702
  }
@@ -8183,14 +8189,14 @@ function sv(e) {
8183
8189
  var w = e.bits === 8 ? nv : av, g = e.bits === 8 ? tv : rv;
8184
8190
  f.setInt32(0, 2, !0), f.setUint32(4, e.bits === 8, !0), f.setInt32(8, o, !0), f.setInt32(12, t, !0), f.setInt32(16, c, !0), f.setInt32(20, i, !0);
8185
8191
  for (var _ = 0; _ < a; _++) {
8186
- var C = 0;
8192
+ var S = 0;
8187
8193
  if (i === 1) {
8188
- for (var S = 0; S < s.length; ++S)
8189
- C += s[S][_];
8190
- C = Math.floor(g * C * n / s.length), C < v[0] && (v[0] = C, v[0] < w && (v[0] = w)), C > p[0] && (p[0] = C, p[0] > g && (p[0] = g));
8194
+ for (var C = 0; C < s.length; ++C)
8195
+ S += s[C][_];
8196
+ S = Math.floor(g * S * n / s.length), S < v[0] && (v[0] = S, v[0] < w && (v[0] = w)), S > p[0] && (p[0] = S, p[0] > g && (p[0] = g));
8191
8197
  } else
8192
8198
  for (var k = 0; k < i; ++k)
8193
- C = Math.floor(g * s[k][_] * n), C < v[k] && (v[k] = C, v[k] < w && (v[k] = w)), C > p[k] && (p[k] = C, p[k] > g && (p[k] = g));
8199
+ S = Math.floor(g * s[k][_] * n), S < v[k] && (v[k] = S, v[k] < w && (v[k] = w)), S > p[k] && (p[k] = S, p[k] > g && (p[k] = g));
8194
8200
  if (++m === t) {
8195
8201
  for (var I = 0; I < i; I++)
8196
8202
  e.bits === 8 ? (f.setInt8(y++, v[I]), f.setInt8(y++, p[I])) : (f.setInt16(y, v[I], !0), f.setInt16(y + 2, p[I], !0), y += 4), v[I] = 1 / 0, p[I] = -1 / 0;
@@ -8805,7 +8811,7 @@ function Jy(e, t = {}) {
8805
8811
  const g = w ?? p.audioBuffer;
8806
8812
  if (!g && !p.waveformData)
8807
8813
  throw new Error(`Track ${b + 1}: Must provide src, audioBuffer, or waveformData`);
8808
- const _ = g?.duration ?? p.waveformData?.duration, C = rc({
8814
+ const _ = g?.duration ?? p.waveformData?.duration, S = rc({
8809
8815
  audioBuffer: g,
8810
8816
  startTime: p.startTime ?? 0,
8811
8817
  duration: p.duration ?? _,
@@ -8815,12 +8821,12 @@ function Jy(e, t = {}) {
8815
8821
  fadeOut: p.fadeOut,
8816
8822
  waveformData: p.waveformData
8817
8823
  });
8818
- if (isNaN(C.startSample) || isNaN(C.durationSamples) || isNaN(C.offsetSamples))
8819
- throw console.error("Invalid clip values:", C), new Error(`Invalid clip values for track ${b + 1}`);
8824
+ if (isNaN(S.startSample) || isNaN(S.durationSamples) || isNaN(S.offsetSamples))
8825
+ throw console.error("Invalid clip values:", S), new Error(`Invalid clip values for track ${b + 1}`);
8820
8826
  return {
8821
8827
  ...ac({
8822
8828
  name: p.name || `Track ${b + 1}`,
8823
- clips: [C],
8829
+ clips: [S],
8824
8830
  muted: p.muted ?? !1,
8825
8831
  soloed: p.soloed ?? !1,
8826
8832
  volume: p.volume ?? 1,
@@ -8855,10 +8861,10 @@ function Jy(e, t = {}) {
8855
8861
  }
8856
8862
  if (!g.src)
8857
8863
  throw new Error(`Track ${_ + 1}: Must provide src, audioBuffer, or waveformData`);
8858
- const C = await fetch(g.src, { signal: f.signal });
8859
- if (!C.ok)
8860
- throw new Error(`Failed to fetch ${g.src}: ${C.statusText}`);
8861
- const S = await C.arrayBuffer(), k = await p.decodeAudioData(S);
8864
+ const S = await fetch(g.src, { signal: f.signal });
8865
+ if (!S.ok)
8866
+ throw new Error(`Failed to fetch ${g.src}: ${S.statusText}`);
8867
+ const C = await S.arrayBuffer(), k = await p.decodeAudioData(C);
8862
8868
  if (!k || !k.sampleRate || !k.duration)
8863
8869
  throw new Error(`Invalid audio buffer for ${g.src}`);
8864
8870
  const I = y(g, _, k);
@@ -8908,9 +8914,9 @@ function Qy({
8908
8914
  (d) => {
8909
8915
  const h = d.operation.source?.data;
8910
8916
  if (!h || !h.boundary || !s.current) return;
8911
- const { boundary: f, trackIndex: m, clipIndex: y } = h, b = ((d.to?.x ?? d.operation.position.current.x) - d.operation.position.initial.x) * n, w = Math.floor(0.1 * r), g = s.current, _ = e.map((C, S) => {
8912
- if (S !== m) return C;
8913
- const k = [...C.clips].sort((D, R) => D.startSample - R.startSample), I = k.findIndex((D) => D === C.clips[y]), E = C.clips.map((D, R) => {
8917
+ const { boundary: f, trackIndex: m, clipIndex: y } = h, b = ((d.to?.x ?? d.operation.position.current.x) - d.operation.position.initial.x) * n, w = Math.floor(0.1 * r), g = s.current, _ = e.map((S, C) => {
8918
+ if (C !== m) return S;
8919
+ const k = [...S.clips].sort((D, R) => D.startSample - R.startSample), I = k.findIndex((D) => D === S.clips[y]), E = S.clips.map((D, R) => {
8914
8920
  if (R !== y) return D;
8915
8921
  if (f === "left") {
8916
8922
  const A = {
@@ -8949,7 +8955,7 @@ function Qy({
8949
8955
  return { ...D, durationSamples: B };
8950
8956
  }
8951
8957
  });
8952
- return { ...C, clips: E };
8958
+ return { ...S, clips: E };
8953
8959
  });
8954
8960
  i.current = b, t(_);
8955
8961
  },
@@ -8960,17 +8966,17 @@ function Qy({
8960
8966
  if (s.current) {
8961
8967
  const b = d.operation.source?.data;
8962
8968
  if (b) {
8963
- const { trackIndex: w, clipIndex: g } = b, _ = s.current, C = e.map((S, k) => {
8964
- if (k !== w) return S;
8965
- const I = S.clips.map((E, D) => D !== g ? E : {
8969
+ const { trackIndex: w, clipIndex: g } = b, _ = s.current, S = e.map((C, k) => {
8970
+ if (k !== w) return C;
8971
+ const I = C.clips.map((E, D) => D !== g ? E : {
8966
8972
  ...E,
8967
8973
  offsetSamples: _.offsetSamples,
8968
8974
  durationSamples: _.durationSamples,
8969
8975
  startSample: _.startSample
8970
8976
  });
8971
- return { ...S, clips: I };
8977
+ return { ...C, clips: I };
8972
8978
  });
8973
- t(C);
8979
+ t(S);
8974
8980
  }
8975
8981
  }
8976
8982
  o.current = !1, s.current = null, i.current = 0;
@@ -9371,11 +9377,11 @@ function a1({
9371
9377
  !r || e.length === 0 || r(e[e.length - 1].id);
9372
9378
  }, [e, r]), _ = M(() => {
9373
9379
  r && r(null);
9374
- }, [r]), C = M(() => {
9380
+ }, [r]), S = M(() => {
9375
9381
  if (f < 0 || !h) return;
9376
9382
  const I = e[f], E = s ? void 0 : I.end - I.start;
9377
9383
  h(I.start, E);
9378
- }, [e, f, s, h]), S = Te(
9384
+ }, [e, f, s, h]), C = Te(
9379
9385
  () => [
9380
9386
  {
9381
9387
  key: "[",
@@ -9405,12 +9411,12 @@ function a1({
9405
9411
  },
9406
9412
  {
9407
9413
  key: "Enter",
9408
- action: C,
9414
+ action: S,
9409
9415
  description: "Play selected annotation",
9410
9416
  preventDefault: !0
9411
9417
  }
9412
9418
  ],
9413
- [y, v, C]
9419
+ [y, v, S]
9414
9420
  ), k = Te(
9415
9421
  () => [
9416
9422
  {
@@ -9459,7 +9465,7 @@ function a1({
9459
9465
  [p, b, w, g, _]
9460
9466
  );
9461
9467
  return is({
9462
- shortcuts: S,
9468
+ shortcuts: C,
9463
9469
  enabled: i && f >= 0
9464
9470
  }), is({
9465
9471
  shortcuts: k,
@@ -9473,7 +9479,7 @@ function a1({
9473
9479
  selectLast: g,
9474
9480
  clearSelection: _,
9475
9481
  scrollToAnnotation: m,
9476
- playActiveAnnotation: C
9482
+ playActiveAnnotation: S
9477
9483
  };
9478
9484
  }
9479
9485
  const Ja = [
@@ -10119,22 +10125,22 @@ function l1(e = 256) {
10119
10125
  const { masterGainNode: b, destination: w, analyserNode: g } = p;
10120
10126
  try {
10121
10127
  b.disconnect();
10122
- } catch (C) {
10123
- console.warn("[waveform-playlist] Error disconnecting master effects chain:", C);
10128
+ } catch (S) {
10129
+ console.warn("[waveform-playlist] Error disconnecting master effects chain:", S);
10124
10130
  }
10125
- const _ = v.map((C) => a.current.get(C.instanceId)).filter((C) => C !== void 0);
10131
+ const _ = v.map((S) => a.current.get(S.instanceId)).filter((S) => S !== void 0);
10126
10132
  if (_.length === 0)
10127
10133
  b.connect(g), g.connect(w);
10128
10134
  else {
10129
- let C = b;
10130
- _.forEach((S) => {
10135
+ let S = b;
10136
+ _.forEach((C) => {
10131
10137
  try {
10132
- S.disconnect();
10138
+ C.disconnect();
10133
10139
  } catch (k) {
10134
- console.warn(`[waveform-playlist] Error disconnecting effect "${S.id}":`, k);
10140
+ console.warn(`[waveform-playlist] Error disconnecting effect "${C.id}":`, k);
10135
10141
  }
10136
- C.connect(S.effect), C = S.effect;
10137
- }), C.connect(g), g.connect(w);
10142
+ S.connect(C.effect), S = C.effect;
10143
+ }), S.connect(g), g.connect(w);
10138
10144
  }
10139
10145
  }, []), l = M((v) => {
10140
10146
  const p = Gd(v);
@@ -10199,14 +10205,14 @@ function l1(e = 256) {
10199
10205
  destination: p,
10200
10206
  analyserNode: w
10201
10207
  };
10202
- const _ = r.current.map((C) => a.current.get(C.instanceId)).filter((C) => C !== void 0);
10208
+ const _ = r.current.map((S) => a.current.get(S.instanceId)).filter((S) => S !== void 0);
10203
10209
  if (_.length === 0)
10204
10210
  v.connect(w), w.connect(p);
10205
10211
  else {
10206
- let C = v;
10207
- _.forEach((S) => {
10208
- C.connect(S.effect), C = S.effect;
10209
- }), C.connect(w), w.connect(p);
10212
+ let S = v;
10213
+ _.forEach((C) => {
10214
+ S.connect(C.effect), S = C.effect;
10215
+ }), S.connect(w), w.connect(p);
10210
10216
  }
10211
10217
  return function() {
10212
10218
  w.dispose(), o.current = null, s.current = null;
@@ -10227,19 +10233,19 @@ function l1(e = 256) {
10227
10233
  return (p, b, w) => {
10228
10234
  const g = [];
10229
10235
  for (const _ of v) {
10230
- const C = La(_.definition, _.params);
10231
- g.push(C);
10236
+ const S = La(_.definition, _.params);
10237
+ g.push(S);
10232
10238
  }
10233
10239
  if (g.length === 0)
10234
10240
  p.connect(b);
10235
10241
  else {
10236
10242
  let _ = p;
10237
- g.forEach((C) => {
10238
- _.connect(C.effect), _ = C.effect;
10243
+ g.forEach((S) => {
10244
+ _.connect(S.effect), _ = S.effect;
10239
10245
  }), _.connect(b);
10240
10246
  }
10241
10247
  return function() {
10242
- g.forEach((C) => C.dispose());
10248
+ g.forEach((S) => S.dispose());
10243
10249
  };
10244
10250
  };
10245
10251
  }, [t]);
@@ -10277,10 +10283,10 @@ function c1() {
10277
10283
  w.forEach((_) => {
10278
10284
  try {
10279
10285
  _.disconnect();
10280
- } catch (C) {
10286
+ } catch (S) {
10281
10287
  console.warn(
10282
10288
  `[waveform-playlist] Error disconnecting effect "${_.id}" on track "${f}":`,
10283
- C
10289
+ S
10284
10290
  );
10285
10291
  }
10286
10292
  g.connect(_.effect), g = _.effect;
@@ -10326,7 +10332,7 @@ function c1() {
10326
10332
  return g.set(
10327
10333
  f,
10328
10334
  _.map(
10329
- (C) => C.instanceId === m ? { ...C, params: { ...C.params, [y]: v } } : C
10335
+ (S) => S.instanceId === m ? { ...S, params: { ...S.params, [y]: v } } : S
10330
10336
  )
10331
10337
  ), g;
10332
10338
  });
@@ -10341,10 +10347,10 @@ function c1() {
10341
10347
  w.setParameter("wet", p ? 0 : g);
10342
10348
  }
10343
10349
  t((g) => {
10344
- const _ = new Map(g), C = _.get(f) || [];
10350
+ const _ = new Map(g), S = _.get(f) || [];
10345
10351
  return _.set(
10346
10352
  f,
10347
- C.map((S) => S.instanceId === m ? { ...S, bypassed: p } : S)
10353
+ S.map((C) => C.instanceId === m ? { ...C, bypassed: p } : C)
10348
10354
  ), _;
10349
10355
  });
10350
10356
  }, []), c = M((f) => {
@@ -10483,13 +10489,13 @@ function Dv() {
10483
10489
  g = Math.max(g, A);
10484
10490
  }
10485
10491
  g += Math.round(w * 0.1);
10486
- const _ = g / w, C = d === "individual" ? [{ track: i[h], state: l[h], index: h }] : i.map((D, R) => ({ track: D, state: l[R], index: R })), S = l.some((D) => D.soloed), k = !!v;
10492
+ const _ = g / w, S = d === "individual" ? [{ track: i[h], state: l[h], index: h }] : i.map((D, R) => ({ track: D, state: l[R], index: R })), C = l.some((D) => D.soloed), k = !!v;
10487
10493
  let I;
10488
10494
  if ((y || k) && m)
10489
10495
  I = await Pv(
10490
- C,
10491
- l,
10492
10496
  S,
10497
+ l,
10498
+ C,
10493
10499
  _,
10494
10500
  w,
10495
10501
  y,
@@ -10501,9 +10507,9 @@ function Dv() {
10501
10507
  else {
10502
10508
  const D = new OfflineAudioContext(2, g, w);
10503
10509
  let R = 0;
10504
- const A = C.reduce((O, { track: B }) => O + B.clips.length, 0);
10505
- for (const { track: O, state: B } of C)
10506
- if (!(B.muted && !B.soloed) && !(S && !B.soloed))
10510
+ const A = S.reduce((O, { track: B }) => O + B.clips.length, 0);
10511
+ for (const { track: O, state: B } of S)
10512
+ if (!(B.muted && !B.soloed) && !(C && !B.soloed))
10507
10513
  for (const X of O.clips) {
10508
10514
  await Wv(D, X, B, w, m), R++;
10509
10515
  const J = R / A * 0.5;
@@ -10548,8 +10554,8 @@ async function Pv(e, t, n, r, a, o, s, i) {
10548
10554
  o ? b = o(p, v, !0) : p.connect(v);
10549
10555
  for (const { track: w, state: g } of e) {
10550
10556
  if (g.muted && !g.soloed || n && !g.soloed) continue;
10551
- const _ = new c(Rv(g.volume)), C = new d(g.pan), S = new u(g.muted ? 0 : 1), k = s?.(w.id);
10552
- k ? k(S, p, !0) : S.connect(p), C.connect(S), _.connect(C);
10557
+ const _ = new c(Rv(g.volume)), S = new d(g.pan), C = new u(g.muted ? 0 : 1), k = s?.(w.id);
10558
+ k ? k(C, p, !0) : C.connect(p), S.connect(C), _.connect(S);
10553
10559
  for (const I of w.clips) {
10554
10560
  const {
10555
10561
  audioBuffer: E,
@@ -10910,12 +10916,12 @@ function Vv(e, t) {
10910
10916
  continue;
10911
10917
  }
10912
10918
  if (m.get(g.audioBuffer)) {
10913
- const S = y.get(g.audioBuffer);
10914
- S ? S.add(g.id) : y.set(g.audioBuffer, /* @__PURE__ */ new Set([g.id]));
10919
+ const C = y.get(g.audioBuffer);
10920
+ C ? C.add(g.id) : y.set(g.audioBuffer, /* @__PURE__ */ new Set([g.id]));
10915
10921
  continue;
10916
10922
  }
10917
- const C = p.get(g.audioBuffer);
10918
- C ? C.add(g.id) : p.set(g.audioBuffer, /* @__PURE__ */ new Set([g.id]));
10923
+ const S = p.get(g.audioBuffer);
10924
+ S ? S.add(g.id) : p.set(g.audioBuffer, /* @__PURE__ */ new Set([g.id]));
10919
10925
  }
10920
10926
  if (v.length > 0 && r((w) => {
10921
10927
  const g = new Map(w);
@@ -10930,8 +10936,8 @@ function Vv(e, t) {
10930
10936
  const _ = [];
10931
10937
  for (let k = 0; k < w.numberOfChannels; k++)
10932
10938
  _.push(w.getChannelData(k).slice().buffer);
10933
- const C = `buffer-${Math.random().toString(36).slice(2, 11)}`, S = b.generate({
10934
- id: C,
10939
+ const S = `buffer-${Math.random().toString(36).slice(2, 11)}`, C = b.generate({
10940
+ id: S,
10935
10941
  channels: _,
10936
10942
  length: w.length,
10937
10943
  sampleRate: w.sampleRate,
@@ -10950,7 +10956,7 @@ function Vv(e, t) {
10950
10956
  }).catch((k) => {
10951
10957
  y.delete(w), m.delete(w), !h && (console.warn("[waveform-playlist] Worker peak generation failed:", k), u.current--, u.current <= 0 && (u.current = 0, o(!1)));
10952
10958
  });
10953
- m.set(w, S);
10959
+ m.set(w, C);
10954
10960
  }
10955
10961
  return () => {
10956
10962
  h = !0, l.current = /* @__PURE__ */ new WeakMap(), c.current = /* @__PURE__ */ new WeakMap(), u.current = 0, o(!1);
@@ -11069,9 +11075,9 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11069
11075
  ), [];
11070
11076
  }
11071
11077
  return c.annotations;
11072
- }, [c?.annotations]), C = T(_);
11073
- C.current = _;
11074
- const [S, k] = V(null), [I, E] = V(!1), [D, R] = V(0), [A, O] = V(0), [B, X] = V([]), [J, oe] = V([]), [L, ae] = V([]), [se, ie] = V(s), [ce, ye] = V(
11078
+ }, [c?.annotations]), S = T(_);
11079
+ S.current = _;
11080
+ const [C, k] = V(null), [I, E] = V(!1), [D, R] = V(0), [A, O] = V(0), [B, X] = V([]), [J, oe] = V([]), [L, ae] = V([]), [se, ie] = V(s), [ce, ye] = V(
11075
11081
  c?.isContinuousPlay ?? !1
11076
11082
  ), [_e, Fe] = V(c?.linkEndpoints ?? !1), [Y, N] = V(c?.editable ?? !1), [he, U] = V(!1), $ = T(null), ge = T(!1), Le = T(!1);
11077
11083
  Le.current = I;
@@ -11296,7 +11302,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11296
11302
  const F = () => {
11297
11303
  const H = Dn();
11298
11304
  be.current = H;
11299
- const pe = C.current;
11305
+ const pe = S.current;
11300
11306
  if (pe.length > 0) {
11301
11307
  const z = pe.find(
11302
11308
  (Ee) => H >= Ee.start && H < Ee.end
@@ -11435,7 +11441,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11435
11441
  ro.current = f;
11436
11442
  const Ni = M(
11437
11443
  (F) => {
11438
- const H = typeof F == "function" ? F(C.current) : F;
11444
+ const H = typeof F == "function" ? F(S.current) : F;
11439
11445
  if (!ro.current) {
11440
11446
  process.env.NODE_ENV !== "production" && console.warn(
11441
11447
  "waveform-playlist: setAnnotations was called but no onAnnotationsChange callback is provided. Annotation edits will not persist. Pass onAnnotationsChange to WaveformPlaylistProvider to handle annotation updates."
@@ -11470,7 +11476,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11470
11476
  isAutomaticScroll: se,
11471
11477
  isLoopEnabled: Ht,
11472
11478
  annotations: _,
11473
- activeAnnotationId: S,
11479
+ activeAnnotationId: C,
11474
11480
  selectionStart: ot,
11475
11481
  selectionEnd: mt,
11476
11482
  selectedTrackId: Ii,
@@ -11484,7 +11490,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11484
11490
  se,
11485
11491
  Ht,
11486
11492
  _,
11487
- S,
11493
+ C,
11488
11494
  ot,
11489
11495
  mt,
11490
11496
  Ii,
@@ -11900,7 +11906,7 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
11900
11906
  onReady: f,
11901
11907
  children: m
11902
11908
  }) => {
11903
- const y = d ?? c + u, [v, p] = V(!1), [b, w] = V(0), [g, _] = V(0), [C, S] = V([]), [k, I] = V(a), E = Te(() => {
11909
+ const y = d ?? c + u, [v, p] = V(!1), [b, w] = V(0), [g, _] = V(0), [S, C] = V([]), [k, I] = V(a), E = Te(() => {
11904
11910
  if (!l?.annotations) return [];
11905
11911
  if (process.env.NODE_ENV !== "production" && l.annotations.length > 0) {
11906
11912
  const G = l.annotations[0];
@@ -11974,7 +11980,7 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
11974
11980
  startSample: 0,
11975
11981
  durationSamples: Math.ceil(e.waveformData.duration * $)
11976
11982
  };
11977
- S([[ue]]);
11983
+ C([[ue]]);
11978
11984
  } catch (G) {
11979
11985
  console.warn("[waveform-playlist] Failed to extract peaks from waveform data:", G);
11980
11986
  }
@@ -12087,7 +12093,7 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
12087
12093
  ), St = Te(
12088
12094
  () => ({
12089
12095
  duration: g,
12090
- peaksDataArray: C,
12096
+ peaksDataArray: S,
12091
12097
  sampleRate: $,
12092
12098
  waveHeight: n,
12093
12099
  timeScaleHeight: Oe,
@@ -12100,7 +12106,7 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
12100
12106
  }),
12101
12107
  [
12102
12108
  g,
12103
- C,
12109
+ S,
12104
12110
  $,
12105
12111
  n,
12106
12112
  Oe,
@@ -12415,15 +12421,15 @@ const $1 = ({ className: e }) => {
12415
12421
  }) => {
12416
12422
  const r = T(null), a = T(null), o = jr(), { waveHeight: s } = ja(), { isPlaying: i, currentTimeRef: l, getPlaybackTime: c } = xt(), { samplesPerPixel: u, sampleRate: d } = Dt(), h = o?.waveProgressColor || "rgba(0, 0, 0, 0.1)";
12417
12423
  j(() => {
12418
- const C = () => {
12424
+ const S = () => {
12419
12425
  if (r.current) {
12420
12426
  const k = (i ? c() : l.current ?? 0) * d, I = e + t;
12421
12427
  let E = 0;
12422
12428
  k <= e ? E = 0 : k >= I ? E = 1 : E = (k - e) / t, r.current.style.transform = `scaleX(${E})`;
12423
12429
  }
12424
- i && (a.current = requestAnimationFrame(C));
12430
+ i && (a.current = requestAnimationFrame(S));
12425
12431
  };
12426
- return i ? a.current = requestAnimationFrame(C) : C(), () => {
12432
+ return i ? a.current = requestAnimationFrame(S) : S(), () => {
12427
12433
  a.current && (cancelAnimationFrame(a.current), a.current = null);
12428
12434
  };
12429
12435
  }, [
@@ -12437,9 +12443,9 @@ const $1 = ({ className: e }) => {
12437
12443
  c
12438
12444
  ]), j(() => {
12439
12445
  if (!i && r.current) {
12440
- const S = (l.current ?? 0) * d, k = e + t;
12446
+ const C = (l.current ?? 0) * d, k = e + t;
12441
12447
  let I = 0;
12442
- S <= e ? I = 0 : S >= k ? I = 1 : I = (S - e) / t, r.current.style.transform = `scaleX(${I})`;
12448
+ C <= e ? I = 0 : C >= k ? I = 1 : I = (C - e) / t, r.current.style.transform = `scaleX(${I})`;
12443
12449
  }
12444
12450
  });
12445
12451
  const f = o?.waveformDrawMode || "inverted";
@@ -12521,8 +12527,8 @@ const Kv = 60, jv = ({
12521
12527
  selectionEnd: w,
12522
12528
  annotations: g,
12523
12529
  activeAnnotationId: _,
12524
- annotationsEditable: C,
12525
- linkEndpoints: S,
12530
+ annotationsEditable: S,
12531
+ linkEndpoints: C,
12526
12532
  continuousPlay: k,
12527
12533
  selectedTrackId: I,
12528
12534
  loopStart: E,
@@ -12915,7 +12921,7 @@ const Kv = 60, jv = ({
12915
12921
  color: "#ff9800",
12916
12922
  isActive: Z.id === _,
12917
12923
  onClick: () => nt(Z),
12918
- editable: C
12924
+ editable: S
12919
12925
  },
12920
12926
  Z.id
12921
12927
  );
@@ -13118,60 +13124,60 @@ function oy(e) {
13118
13124
  "onDragOver",
13119
13125
  "onDragEnd"
13120
13126
  ]);
13121
- const u = T(null), { plugins: d, modifiers: h, sensors: f } = c, m = Ut(d, Nn.plugins), y = Ut(f, Nn.sensors), v = Ut(h, Nn.modifiers), p = On(a), b = On(o), w = On(i), g = On(s), _ = On(l), C = On(r), S = sy(() => {
13127
+ const u = T(null), { plugins: d, modifiers: h, sensors: f } = c, m = Ut(d, Nn.plugins), y = Ut(f, Nn.sensors), v = Ut(h, Nn.modifiers), p = On(a), b = On(o), w = On(i), g = On(s), _ = On(l), S = On(r), C = sy(() => {
13122
13128
  var k;
13123
13129
  return (k = c.manager) != null ? k : new si(c);
13124
13130
  });
13125
13131
  return j(() => {
13126
13132
  if (!u.current) throw new Error("Renderer not found");
13127
- const { renderer: k, trackRendering: I } = u.current, { monitor: E } = S;
13128
- S.renderer = k;
13133
+ const { renderer: k, trackRendering: I } = u.current, { monitor: E } = C;
13134
+ C.renderer = k;
13129
13135
  const D = [
13130
13136
  E.addEventListener("beforedragstart", (R) => {
13131
13137
  const A = p.current;
13132
- A && I(() => A(R, S));
13138
+ A && I(() => A(R, C));
13133
13139
  }),
13134
13140
  E.addEventListener(
13135
13141
  "dragstart",
13136
13142
  (R) => {
13137
13143
  var A;
13138
- return (A = b.current) == null ? void 0 : A.call(b, R, S);
13144
+ return (A = b.current) == null ? void 0 : A.call(b, R, C);
13139
13145
  }
13140
13146
  ),
13141
13147
  E.addEventListener("dragover", (R) => {
13142
13148
  const A = w.current;
13143
- A && I(() => A(R, S));
13149
+ A && I(() => A(R, C));
13144
13150
  }),
13145
13151
  E.addEventListener("dragmove", (R) => {
13146
13152
  const A = g.current;
13147
- A && I(() => A(R, S));
13153
+ A && I(() => A(R, C));
13148
13154
  }),
13149
13155
  E.addEventListener("dragend", (R) => {
13150
13156
  const A = _.current;
13151
- A && I(() => A(R, S));
13157
+ A && I(() => A(R, C));
13152
13158
  }),
13153
13159
  E.addEventListener(
13154
13160
  "collision",
13155
13161
  (R) => {
13156
13162
  var A;
13157
- return (A = C.current) == null ? void 0 : A.call(C, R, S);
13163
+ return (A = S.current) == null ? void 0 : A.call(S, R, C);
13158
13164
  }
13159
13165
  )
13160
13166
  ];
13161
13167
  return () => D.forEach((R) => R());
13162
- }, [S]), _o(
13168
+ }, [C]), _o(
13163
13169
  m,
13164
- () => S && (S.plugins = m),
13170
+ () => C && (C.plugins = m),
13165
13171
  ...xo
13166
13172
  ), _o(
13167
13173
  y,
13168
- () => S && (S.sensors = y),
13174
+ () => C && (C.sensors = y),
13169
13175
  ...xo
13170
13176
  ), _o(
13171
13177
  v,
13172
- () => S && (S.modifiers = v),
13178
+ () => C && (C.modifiers = v),
13173
13179
  ...xo
13174
- ), /* @__PURE__ */ me(ry.Provider, { value: S, children: [
13180
+ ), /* @__PURE__ */ me(ry.Provider, { value: C, children: [
13175
13181
  /* @__PURE__ */ x(ay, { ref: u, children: n }),
13176
13182
  n
13177
13183
  ] });
@@ -13477,8 +13483,8 @@ const Cy = (e) => {
13477
13483
  timeScaleHeight: w,
13478
13484
  samplesPerPixel: g,
13479
13485
  controls: _,
13480
- playoutRef: C,
13481
- barWidth: S,
13486
+ playoutRef: S,
13487
+ barWidth: C,
13482
13488
  barGap: k
13483
13489
  } = _i(), [I, E] = V(0), [D, R] = V(0), [A, O] = V(!1), B = T(null), X = M(
13484
13490
  (Y) => {
@@ -13529,7 +13535,7 @@ const Cy = (e) => {
13529
13535
  if (!A) return;
13530
13536
  O(!1);
13531
13537
  const N = Y.currentTarget.getBoundingClientRect(), he = _.show ? _.width : 0, $ = (Y.clientX - N.left - he) * g / p, ge = Math.min(I, $), Le = Math.max(I, $);
13532
- Math.abs(Le - ge) < 0.1 ? (d(ge), E(ge), R(ge), s && C.current && (C.current.stop(), u(ge))) : (E(ge), R(Le));
13538
+ Math.abs(Le - ge) < 0.1 ? (d(ge), E(ge), R(ge), s && S.current && (S.current.stop(), u(ge))) : (E(ge), R(Le));
13533
13539
  },
13534
13540
  [
13535
13541
  A,
@@ -13539,7 +13545,7 @@ const Cy = (e) => {
13539
13545
  _,
13540
13546
  d,
13541
13547
  s,
13542
- C,
13548
+ S,
13543
13549
  u
13544
13550
  ]
13545
13551
  );
@@ -13557,7 +13563,7 @@ const Cy = (e) => {
13557
13563
  timeScaleHeight: w,
13558
13564
  duration: y * 1e3,
13559
13565
  controls: _,
13560
- barWidth: S,
13566
+ barWidth: C,
13561
13567
  barGap: k
13562
13568
  },
13563
13569
  children: /* @__PURE__ */ x(