@shotstack/shotstack-studio 2.0.0-rc.4 → 2.0.0-rc.5

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.
@@ -1,4 +1,4 @@
1
- import * as G from "pixi.js";
1
+ import * as H from "pixi.js";
2
2
  import { Filter as rg, deprecation as ng, GpuProgram as og, GlProgram as lg, Color as cg } from "pixi.js";
3
3
  import * as dg from "howler";
4
4
  import * as Vl from "opentype.js";
@@ -10,7 +10,7 @@ import "pixi.js/text-html";
10
10
  import "pixi.js/sprite-tiling";
11
11
  import "pixi.js/filters";
12
12
  import "pixi.js/mesh";
13
- const ug = "2.0.0-rc.4", fg = {
13
+ const ug = "2.0.0-rc.5", fg = {
14
14
  version: ug
15
15
  };
16
16
  class hg {
@@ -139,8 +139,8 @@ class hg {
139
139
  };
140
140
  }
141
141
  getValue(e, t, i, a) {
142
- const r = this.curves[a ?? ""] ?? this.curves.ease, [[n, o], [l, c]] = r, d = i + (3 * n - 3 * l + 1) * i * (1 - i), u = e, f = e + (t - e) * o, p = e + (t - e) * c, g = t, w = d, C = 1 - w;
143
- return C ** 3 * u + 3 * C ** 2 * w * f + 3 * C * w ** 2 * p + w ** 3 * g;
142
+ const r = this.curves[a ?? ""] ?? this.curves.ease, [[n, o], [l, c]] = r, d = i + (3 * n - 3 * l + 1) * i * (1 - i), u = e, f = e + (t - e) * o, g = e + (t - e) * c, p = t, w = d, v = 1 - w;
143
+ return v ** 3 * u + 3 * v ** 2 * w * f + 3 * v * w ** 2 * g + w ** 3 * p;
144
144
  }
145
145
  }
146
146
  class ur {
@@ -329,16 +329,16 @@ class pg {
329
329
  case "slideRight":
330
330
  case "slideUp":
331
331
  case "slideDown": {
332
- const f = u === "slideLeft" || u === "slideRight", p = u === "slideLeft" || u === "slideUp", g = this.getFittedSize(e, t), w = f ? e.width : e.height, C = f ? g.width : g.height;
333
- let v = this.getSlideStart();
334
- const S = w + w * v * 2;
335
- if (C < S) {
336
- const D = S / C;
332
+ const f = u === "slideLeft" || u === "slideRight", g = u === "slideLeft" || u === "slideUp", p = this.getFittedSize(e, t), w = f ? e.width : e.height, v = f ? p.width : p.height;
333
+ let x = this.getSlideStart();
334
+ const S = w + w * x * 2;
335
+ if (v < S) {
336
+ const D = S / v;
337
337
  n.push({ from: D, to: D, start: d, length: c, interpolation: "linear" });
338
338
  } else
339
- v = (C - w) / 2 / w;
340
- const [x, T] = p ? [v, -v] : [-v, v];
341
- (f ? i : a).push({ from: x, to: T, start: d, length: c });
339
+ x = (v - w) / 2 / w;
340
+ const [C, T] = g ? [x, -x] : [-x, x];
341
+ (f ? i : a).push({ from: C, to: T, start: d, length: c });
342
342
  break;
343
343
  }
344
344
  }
@@ -436,10 +436,10 @@ class gg {
436
436
  case "slideRight":
437
437
  case "slideUp":
438
438
  case "slideDown": {
439
- const l = n === "slideLeft" || n === "slideRight", c = n === "slideLeft" || n === "slideUp", d = 0.025, [u, f] = o ? [c ? d : -d, 0] : [0, c ? -d : d], p = o ? "linear" : "bezier", [g, w] = o ? [0, 1] : [1, 0];
439
+ const l = n === "slideLeft" || n === "slideRight", c = n === "slideLeft" || n === "slideUp", d = 0.025, [u, f] = o ? [c ? d : -d, 0] : [0, c ? -d : d], g = o ? "linear" : "bezier", [p, w] = o ? [0, 1] : [1, 0];
440
440
  (l ? t.offsetXKeyframes : t.offsetYKeyframes).push(
441
- o ? { from: u, to: f, start: r, length: a, interpolation: p } : { from: u, to: f, start: r, length: a, interpolation: p, easing: "ease" }
442
- ), t.opacityKeyframes.push({ from: g, to: w, start: r, length: a, interpolation: "bezier", easing: "ease" });
441
+ o ? { from: u, to: f, start: r, length: a, interpolation: g } : { from: u, to: f, start: r, length: a, interpolation: g, easing: "ease" }
442
+ ), t.opacityKeyframes.push({ from: p, to: w, start: r, length: a, interpolation: "bezier", easing: "ease" });
443
443
  break;
444
444
  }
445
445
  case "carouselLeft":
@@ -484,7 +484,7 @@ class gg {
484
484
  }
485
485
  }
486
486
  }
487
- const H = {
487
+ const G = {
488
488
  // Playback
489
489
  PlaybackPlay: "playback:play",
490
490
  PlaybackPause: "playback:pause",
@@ -717,7 +717,7 @@ class eh {
717
717
  class wg {
718
718
  container;
719
719
  constructor() {
720
- this.container = new G.Container();
720
+ this.container = new H.Container();
721
721
  }
722
722
  /** @internal */
723
723
  getContainer() {
@@ -748,9 +748,10 @@ class Dt extends wg {
748
748
  skewYKeyframeBuilder;
749
749
  maskXKeyframeBuilder;
750
750
  wipeMask;
751
+ lumaWrapper;
751
752
  contentContainer;
752
753
  constructor(e, t, i) {
753
- super(), this.edit = e, this.layer = 0, this.shouldDispose = !1, this.playerType = i, this.clipConfiguration = t, this.positionBuilder = new eh(e.size), this.resolvedTiming = { start: t.start, length: t.length }, this.wipeMask = null, this.contentContainer = new G.Container(), this.getContainer().addChild(this.contentContainer);
754
+ super(), this.edit = e, this.layer = 0, this.shouldDispose = !1, this.playerType = i, this.clipConfiguration = t, this.positionBuilder = new eh(e.size), this.resolvedTiming = { start: t.start, length: t.length }, this.wipeMask = null, this.lumaWrapper = new H.Container(), this.contentContainer = new H.Container(), this.lumaWrapper.addChild(this.contentContainer), this.getContainer().addChild(this.lumaWrapper);
754
755
  }
755
756
  reconfigureAfterRestore() {
756
757
  this.configureKeyframes();
@@ -774,11 +775,11 @@ class Dt extends wg {
774
775
  length: e
775
776
  }, u = new pg(d).buildRelative(this.edit.size, this.getSize()), f = new gg(d).buildRelative();
776
777
  this.offsetXKeyframeBuilder.addLayer(u.offsetXKeyframes), this.offsetYKeyframeBuilder.addLayer(u.offsetYKeyframes), this.scaleKeyframeBuilder.addLayer(u.scaleKeyframes), this.opacityKeyframeBuilder.addLayer(u.opacityKeyframes), this.rotationKeyframeBuilder.addLayer(u.rotationKeyframes), this.offsetXKeyframeBuilder.addLayer(f.in.offsetXKeyframes), this.offsetYKeyframeBuilder.addLayer(f.in.offsetYKeyframes), this.scaleKeyframeBuilder.addLayer(f.in.scaleKeyframes), this.opacityKeyframeBuilder.addLayer(f.in.opacityKeyframes), this.rotationKeyframeBuilder.addLayer(f.in.rotationKeyframes), this.offsetXKeyframeBuilder.addLayer(f.out.offsetXKeyframes), this.offsetYKeyframeBuilder.addLayer(f.out.offsetYKeyframes), this.scaleKeyframeBuilder.addLayer(f.out.scaleKeyframes), this.opacityKeyframeBuilder.addLayer(f.out.opacityKeyframes), this.rotationKeyframeBuilder.addLayer(f.out.rotationKeyframes);
777
- const p = [...f.in.maskXKeyframes, ...f.out.maskXKeyframes];
778
- p.length && (this.maskXKeyframeBuilder = new ur(p, e));
778
+ const g = [...f.in.maskXKeyframes, ...f.out.maskXKeyframes];
779
+ g.length && (this.maskXKeyframeBuilder = new ur(g, e));
779
780
  }
780
781
  async load() {
781
- this.contentContainer?.destroyed && (this.contentContainer = new G.Container(), this.getContainer().addChild(this.contentContainer)), this.getContainer().sortableChildren = !0, this.getContainer().cursor = "pointer", this.getContainer().eventMode = "static", this.getContainer().on?.("pointerdown", this.onPointerDown.bind(this));
782
+ this.lumaWrapper?.destroyed && (this.lumaWrapper = new H.Container(), this.getContainer().addChild(this.lumaWrapper)), this.contentContainer?.destroyed && (this.contentContainer = new H.Container(), this.lumaWrapper.addChild(this.contentContainer)), this.getContainer().sortableChildren = !0, this.getContainer().cursor = "pointer", this.getContainer().eventMode = "static", this.getContainer().on?.("pointerdown", this.onPointerDown.bind(this));
782
783
  }
783
784
  update(e, t) {
784
785
  if (this.getContainer().visible = this.isActive(), this.getContainer().zIndex = 1e5 - this.layer * 100, !this.isActive())
@@ -796,10 +797,10 @@ class Dt extends wg {
796
797
  return;
797
798
  }
798
799
  const e = this.maskXKeyframeBuilder.getValue(this.getPlaybackTime()), t = this.getSize();
799
- this.wipeMask || (this.wipeMask = new G.Graphics(), this.getContainer().addChild(this.wipeMask), this.getContainer().mask = this.wipeMask), this.wipeMask.clear(), this.wipeMask.rect(0, 0, t.width * e, t.height), this.wipeMask.fill(16777215);
800
+ this.wipeMask || (this.wipeMask = new H.Graphics(), this.getContainer().addChild(this.wipeMask), this.getContainer().mask = this.wipeMask), this.wipeMask.clear(), this.wipeMask.rect(0, 0, t.width * e, t.height), this.wipeMask.fill(16777215);
800
801
  }
801
802
  dispose() {
802
- this.wipeMask?.destroy(), this.wipeMask = null, this.contentContainer?.destroy();
803
+ this.wipeMask?.destroy(), this.wipeMask = null, this.contentContainer?.destroy(), this.lumaWrapper?.destroy();
803
804
  }
804
805
  getStart() {
805
806
  return this.resolvedTiming.start;
@@ -862,6 +863,10 @@ class Dt extends wg {
862
863
  getContentContainer() {
863
864
  return this.contentContainer;
864
865
  }
866
+ /** @internal */
867
+ getLumaWrapper() {
868
+ return this.lumaWrapper;
869
+ }
865
870
  getOpacity() {
866
871
  return this.opacityKeyframeBuilder?.getValue(this.getPlaybackTime()) ?? 1;
867
872
  }
@@ -936,18 +941,22 @@ class Dt extends wg {
936
941
  applyFixedDimensions() {
937
942
  const e = this.clipConfiguration.width, t = this.clipConfiguration.height;
938
943
  if (!e || !t) return;
939
- const i = this.contentContainer.children.find((p) => p instanceof G.Sprite);
944
+ const i = this.contentContainer.children.find((v) => v instanceof H.Sprite);
940
945
  if (!i?.texture) return;
941
946
  const a = i.texture.width, r = i.texture.height, n = this.clipConfiguration.fit || "crop", o = this.contentContainer.mask;
942
- let l = null;
943
- if (o instanceof G.Graphics ? l = o : o || (l = new G.Graphics(), this.contentContainer.addChild(l), this.contentContainer.mask = l), l) {
944
- const { asset: p } = this.clipConfiguration, g = p && "border" in p && p.border && typeof p.border == "object" ? p.border.width ?? 0 : 0, w = g / 2;
945
- l.clear(), l.rect(-w, -w, e + g, t + g), l.fill(16777215);
946
- }
947
- const c = this.scaleKeyframeBuilder?.getValue(this.getPlaybackTime()) ?? 1;
947
+ let l;
948
+ if (o instanceof H.Graphics)
949
+ l = o;
950
+ else if (!o)
951
+ l = new H.Graphics(), this.contentContainer.addChild(l), this.contentContainer.mask = l;
952
+ else
953
+ return;
954
+ const { asset: c } = this.clipConfiguration, d = c && "border" in c && c.border && typeof c.border == "object" ? c.border.width ?? 0 : 0, u = d / 2;
955
+ l.clear(), l.rect(-u, -u, e + d, t + d), l.fill(16777215);
956
+ const f = this.scaleKeyframeBuilder?.getValue(this.getPlaybackTime()) ?? 1;
948
957
  i.anchor.set(0.5, 0.5);
949
- const f = bg({ width: a, height: r }, { width: e, height: t }, n);
950
- i.scale.set(f.scaleX, f.scaleY), i.position.set(f.positionX, f.positionY), this.contentContainer.scale.set(c, c), this.contentContainer.position.set(e / 2 * (1 - c), t / 2 * (1 - c));
958
+ const w = bg({ width: a, height: r }, { width: e, height: t }, n);
959
+ i.scale.set(w.scaleX, w.scaleY), i.position.set(w.positionX, w.positionY), this.contentContainer.scale.set(f, f), this.contentContainer.position.set(e / 2 * (1 - f), t / 2 * (1 - f));
951
960
  }
952
961
  applyAnchorPositioning(e, t, i, a) {
953
962
  const r = a.width, n = a.height;
@@ -987,8 +996,8 @@ class fr {
987
996
  validAudioExtensions;
988
997
  constructor() {
989
998
  this.id = fr.Name, this.name = fr.Name, this.extension = {
990
- type: [G.ExtensionType.LoadParser],
991
- priority: G.LoaderParserPriority.Normal,
999
+ type: [H.ExtensionType.LoadParser],
1000
+ priority: H.LoaderParserPriority.Normal,
992
1001
  ref: null
993
1002
  }, this.validAudioExtensions = ["mp3", "mpeg", "ogg", "wav"];
994
1003
  }
@@ -16474,8 +16483,8 @@ class hr {
16474
16483
  validExtensions;
16475
16484
  constructor() {
16476
16485
  this.id = hr.Name, this.name = hr.Name, this.extension = {
16477
- type: [G.ExtensionType.LoadParser],
16478
- priority: G.LoaderParserPriority.Normal,
16486
+ type: [H.ExtensionType.LoadParser],
16487
+ priority: H.LoaderParserPriority.Normal,
16479
16488
  ref: null
16480
16489
  }, this.validExtensions = ["srt", "vtt"];
16481
16490
  }
@@ -16811,7 +16820,7 @@ class An extends Dt {
16811
16820
  async load() {
16812
16821
  await super.load();
16813
16822
  const e = this.clipConfiguration.asset, t = e.font?.family ?? "Open Sans";
16814
- if (await this.loadFont(t), this.state = ds(e.src) ? { kind: "placeholder" } : await this.loadSubtitles(e.src), this.background = new G.Graphics(), this.contentContainer.addChild(this.background), this.text = new G.Text({ text: "", style: this.createTextStyle(e) }), this.text.visible = !1, e.stroke?.width && e.stroke.width > 0 && e.stroke.color) {
16823
+ if (await this.loadFont(t), this.state = ds(e.src) ? { kind: "placeholder" } : await this.loadSubtitles(e.src), this.background = new H.Graphics(), this.contentContainer.addChild(this.background), this.text = new H.Text({ text: "", style: this.createTextStyle(e) }), this.text.visible = !1, e.stroke?.width && e.stroke.width > 0 && e.stroke.color) {
16815
16824
  const i = new pr({
16816
16825
  thickness: e.stroke.width,
16817
16826
  color: e.stroke.color
@@ -16859,7 +16868,7 @@ class An extends Dt {
16859
16868
  }
16860
16869
  createTextStyle(e) {
16861
16870
  const t = e.font?.family ?? "Open Sans", { baseFontFamily: i, fontWeight: a } = cs(t), r = e.font?.size ?? 32, { width: n } = this.getSize();
16862
- return new G.TextStyle({
16871
+ return new H.TextStyle({
16863
16872
  fontFamily: i,
16864
16873
  fontSize: r,
16865
16874
  fill: e.font?.color ?? "#ffffff",
@@ -16927,12 +16936,12 @@ class Mg extends Dt {
16927
16936
  const e = this.clipConfiguration.asset, t = await this.parseDocument();
16928
16937
  if (!t)
16929
16938
  return;
16930
- const i = new G.Graphics();
16939
+ const i = new H.Graphics();
16931
16940
  t.background.color && (i.fillStyle = {
16932
16941
  color: t.background.color,
16933
16942
  alpha: t.background.opacity ?? 1
16934
16943
  }, i.rect(0, 0, e.width ?? this.edit.size.width, e.height ?? this.edit.size.height), i.fill());
16935
- const a = new G.Text();
16944
+ const a = new H.Text();
16936
16945
  a.text = t.text;
16937
16946
  const { horizontal: r, vertical: n } = t.alignment;
16938
16947
  a.style = {
@@ -17052,9 +17061,9 @@ class Lg extends Dt {
17052
17061
  }
17053
17062
  async loadTexture() {
17054
17063
  const e = this.clipConfiguration.asset, { src: t } = e, i = `${t}${t.includes("?") ? "&" : "?"}x-cors=1`, a = { src: i, crossorigin: "anonymous", data: {} }, r = await this.edit.assetLoader.load(i, a);
17055
- if (!(r?.source instanceof G.ImageSource))
17064
+ if (!(r?.source instanceof H.ImageSource))
17056
17065
  throw r && r.destroy(!0), new Error(`Invalid image source '${t}'.`);
17057
- this.texture = this.createCroppedTexture(r), this.sprite = new G.Sprite(this.texture), this.contentContainer.addChild(this.sprite), this.clipConfiguration.width && this.clipConfiguration.height && this.applyFixedDimensions();
17066
+ this.texture = this.createCroppedTexture(r), this.sprite = new H.Sprite(this.texture), this.contentContainer.addChild(this.sprite), this.clipConfiguration.width && this.clipConfiguration.height && this.applyFixedDimensions();
17058
17067
  }
17059
17068
  disposeTexture() {
17060
17069
  this.sprite && (this.contentContainer.removeChild(this.sprite), this.sprite.destroy(), this.sprite = null), this.texture = null;
@@ -17066,8 +17075,8 @@ class Lg extends Dt {
17066
17075
  const t = this.clipConfiguration.asset;
17067
17076
  if (!t.crop)
17068
17077
  return e;
17069
- const i = e.width, a = e.height, r = Math.floor((t.crop?.left ?? 0) * i), n = Math.floor((t.crop?.right ?? 0) * i), o = Math.floor((t.crop?.top ?? 0) * a), l = Math.floor((t.crop?.bottom ?? 0) * a), c = r, d = o, u = i - r - n, f = a - o - l, p = new G.Rectangle(c, d, u, f);
17070
- return new G.Texture({ source: e.source, frame: p });
17078
+ const i = e.width, a = e.height, r = Math.floor((t.crop?.left ?? 0) * i), n = Math.floor((t.crop?.right ?? 0) * i), o = Math.floor((t.crop?.top ?? 0) * a), l = Math.floor((t.crop?.bottom ?? 0) * a), c = r, d = o, u = i - r - n, f = a - o - l, g = new H.Rectangle(c, d, u, f);
17079
+ return new H.Texture({ source: e.source, frame: g });
17071
17080
  }
17072
17081
  }
17073
17082
  const Bg = /* @__PURE__ */ new Set(["text-to-image", "image-to-video", "text-to-speech"]);
@@ -17101,11 +17110,11 @@ function za(s, e, t) {
17101
17110
  const i = s / 360, a = e / 100, r = t / 100;
17102
17111
  let n, o, l;
17103
17112
  {
17104
- const f = (w, C, v) => {
17105
- let S = v;
17106
- return S < 0 && (S += 1), S > 1 && (S -= 1), S < 0.16666666666666666 ? w + (C - w) * 6 * S : S < 0.5 ? C : S < 0.6666666666666666 ? w + (C - w) * (0.6666666666666666 - S) * 6 : w;
17107
- }, p = r + a - r * a, g = 2 * r - p;
17108
- n = f(g, p, i + 1 / 3), o = f(g, p, i), l = f(g, p, i - 1 / 3);
17113
+ const f = (w, v, x) => {
17114
+ let S = x;
17115
+ return S < 0 && (S += 1), S > 1 && (S -= 1), S < 0.16666666666666666 ? w + (v - w) * 6 * S : S < 0.5 ? v : S < 0.6666666666666666 ? w + (v - w) * (0.6666666666666666 - S) * 6 : w;
17116
+ }, g = r + a - r * a, p = 2 * r - g;
17117
+ n = f(p, g, i + 1 / 3), o = f(p, g, i), l = f(p, g, i - 1 / 3);
17109
17118
  }
17110
17119
  const c = Math.round(n * 255) * 65536, d = Math.round(o * 255) * 256, u = Math.round(l * 255);
17111
17120
  return c + d + u;
@@ -17282,7 +17291,7 @@ function Wg(s) {
17282
17291
  const Lo = 64, hs = 72, ud = 42;
17283
17292
  class Ll {
17284
17293
  constructor(e) {
17285
- this.options = e, this.container = new G.Container(), this.build(), this.startAnimation();
17294
+ this.options = e, this.container = new H.Container(), this.build(), this.startAnimation();
17286
17295
  }
17287
17296
  container;
17288
17297
  layers = [];
@@ -17322,19 +17331,19 @@ class Ll {
17322
17331
  build() {
17323
17332
  const { mode: e, width: t, height: i } = this.options;
17324
17333
  if (e === "panel") {
17325
- const o = new G.Graphics();
17334
+ const o = new H.Graphics();
17326
17335
  o.roundRect(0, 0, t, i, 4), o.fill({ color: "#1E1B2E", alpha: 1 }), this.container.addChild(o);
17327
17336
  } else {
17328
- const o = new G.Graphics();
17337
+ const o = new H.Graphics();
17329
17338
  o.rect(0, 0, t, i), o.fill({ color: "#000000", alpha: 0.25 }), this.container.addChild(o);
17330
17339
  }
17331
- this.auroraLayer = new G.Container(), this.layers = Wg(this.options.assetNumber).map((o) => {
17332
- const l = new G.Graphics();
17340
+ this.auroraLayer = new H.Container(), this.layers = Wg(this.options.assetNumber).map((o) => {
17341
+ const l = new H.Graphics();
17333
17342
  return this.auroraLayer.addChild(l), { ...o, graphics: l };
17334
17343
  });
17335
- const a = Math.min(Math.max(Math.min(t, i) * 0.04, 12), 40), r = new G.BlurFilter({ strength: a, quality: 4 });
17344
+ const a = Math.min(Math.max(Math.min(t, i) * 0.04, 12), 40), r = new H.BlurFilter({ strength: a, quality: 4 });
17336
17345
  this.auroraLayer.filters = [r];
17337
- const n = new G.Graphics();
17346
+ const n = new H.Graphics();
17338
17347
  e === "panel" ? n.roundRect(0, 0, t, i, 4) : n.rect(0, 0, t, i), n.fill({ color: "#ffffff" }), this.auroraLayer.addChild(n), this.auroraLayer.mask = n, this.container.addChild(this.auroraLayer), this.drawAurora(), this.buildBadge();
17339
17348
  }
17340
17349
  /**
@@ -17346,22 +17355,22 @@ class Ll {
17346
17355
  r.graphics.clear();
17347
17356
  const n = Math.sin(i * 0.3 + r.phase * 1.7) * 0.5 + 0.5, o = r.baseAlpha * (0.7 + 0.3 * n), l = i * r.scrollSpeed;
17348
17357
  for (let c = 0; c < Lo; c += 1) {
17349
- const u = c / Lo * Math.PI * 2 + l, f = Zg(u, i, r.phase, r.waves), p = (r.baseY + f) * t, g = 0.6 + 0.4 * Math.sin(u * 3.7 + i * 0.2 + r.phase * 2.3), w = r.rayHeight * t * g, C = 0.4 + 0.6 * (Math.sin(u * 5 + i * 0.15 + r.phase * 3.1) * 0.5 + 0.5) ** 0.7, v = o * C, S = c * a;
17350
- r.graphics.rect(S, p, a + 1, w), r.graphics.fill({ color: r.color, alpha: v });
17358
+ const u = c / Lo * Math.PI * 2 + l, f = Zg(u, i, r.phase, r.waves), g = (r.baseY + f) * t, p = 0.6 + 0.4 * Math.sin(u * 3.7 + i * 0.2 + r.phase * 2.3), w = r.rayHeight * t * p, v = 0.4 + 0.6 * (Math.sin(u * 5 + i * 0.15 + r.phase * 3.1) * 0.5 + 0.5) ** 0.7, x = o * v, S = c * a;
17359
+ r.graphics.rect(S, g, a + 1, w), r.graphics.fill({ color: r.color, alpha: x });
17351
17360
  }
17352
17361
  }
17353
17362
  }
17354
17363
  buildBadge() {
17355
- const { width: e, height: t, icon: i, assetNumber: a, prompt: r, assetType: n } = this.options, o = new G.Container();
17364
+ const { width: e, height: t, icon: i, assetNumber: a, prompt: r, assetType: n } = this.options, o = new H.Container();
17356
17365
  o.position.set(e / 2 - hs / 2, t / 2 - hs / 2);
17357
- const l = new G.Graphics();
17366
+ const l = new H.Graphics();
17358
17367
  l.circle(hs / 2, hs / 2, hs / 2), l.fill({ color: "#000000", alpha: 0.5 }), o.addChild(l);
17359
- const c = new G.Graphics();
17368
+ const c = new H.Graphics();
17360
17369
  c.svg(`<svg viewBox="0 0 24 24"><path d="${Rg[i]}" fill="#C084FC" /></svg>`);
17361
17370
  const d = ud / 24, u = (hs - ud) / 2;
17362
17371
  if (c.scale.set(d, d), c.position.set(u, u), o.addChild(c), a !== void 0) {
17363
- const f = n ? th(n) : "", p = f ? `${f} ${a}` : String(a), g = new G.Text({
17364
- text: p,
17372
+ const f = n ? th(n) : "", g = f ? `${f} ${a}` : String(a), p = new H.Text({
17373
+ text: g,
17365
17374
  style: {
17366
17375
  fontFamily: "Arial",
17367
17376
  fontSize: 18,
@@ -17369,10 +17378,10 @@ class Ll {
17369
17378
  fill: "#ffffff"
17370
17379
  }
17371
17380
  });
17372
- g.anchor.set(0.5, 0.5), g.position.set(hs / 2, hs + 15), o.addChild(g);
17381
+ p.anchor.set(0.5, 0.5), p.position.set(hs / 2, hs + 15), o.addChild(p);
17373
17382
  }
17374
17383
  if (r) {
17375
- const f = sh(r, 60), p = new G.Text({
17384
+ const f = sh(r, 60), g = new H.Text({
17376
17385
  text: f,
17377
17386
  style: {
17378
17387
  fontFamily: "Arial",
@@ -17385,13 +17394,13 @@ class Ll {
17385
17394
  lineHeight: 20
17386
17395
  }
17387
17396
  });
17388
- p.anchor.set(0.5, 0), p.position.set(hs / 2, hs + 40), o.addChild(p);
17397
+ g.anchor.set(0.5, 0), g.position.set(hs / 2, hs + 40), o.addChild(g);
17389
17398
  }
17390
17399
  this.container.addChild(o);
17391
17400
  }
17392
17401
  }
17393
17402
  function ih(s, e) {
17394
- const t = new G.Graphics();
17403
+ const t = new H.Graphics();
17395
17404
  return t.fillStyle = { color: "#cccccc", alpha: 0.5 }, t.rect(0, 0, s, e), t.fill(), t.strokeStyle = { color: "#999999", width: 2 }, t.moveTo(0, 0), t.lineTo(s, e), t.moveTo(s, 0), t.lineTo(0, e), t.stroke(), t;
17396
17405
  }
17397
17406
  class Hg extends Dt {
@@ -17461,9 +17470,9 @@ class Hg extends Dt {
17461
17470
  }
17462
17471
  async loadTexture() {
17463
17472
  const e = this.clipConfiguration.asset, { src: t } = e, i = `${t}${t.includes("?") ? "&" : "?"}x-cors=1`, a = { src: i, crossorigin: "anonymous", data: {} }, r = await this.edit.assetLoader.load(i, a);
17464
- if (!(r?.source instanceof G.ImageSource))
17473
+ if (!(r?.source instanceof H.ImageSource))
17465
17474
  throw r && r.destroy(!0), new Error(`Invalid image source '${t}'.`);
17466
- this.texture = r, this.sprite = new G.Sprite(this.texture), this.contentContainer.addChild(this.sprite), this.clipConfiguration.width && this.clipConfiguration.height && this.applyFixedDimensions();
17475
+ this.texture = r, this.sprite = new H.Sprite(this.texture), this.contentContainer.addChild(this.sprite), this.clipConfiguration.width && this.clipConfiguration.height && this.applyFixedDimensions();
17467
17476
  }
17468
17477
  }
17469
17478
  class Gg extends Dt {
@@ -17476,12 +17485,12 @@ class Gg extends Dt {
17476
17485
  async load() {
17477
17486
  await super.load();
17478
17487
  const e = this.clipConfiguration.asset, t = e.src, i = { src: t, data: { autoPlay: !1, muted: !0 } }, a = await this.edit.assetLoader.load(t, i);
17479
- if (!(a?.source instanceof G.ImageSource || a?.source instanceof G.VideoSource))
17488
+ if (!(a?.source instanceof H.ImageSource || a?.source instanceof H.VideoSource))
17480
17489
  throw a && this.edit.assetLoader.decrementRef(t), new Error(`Invalid luma source '${e.src}'.`);
17481
- a.source instanceof G.VideoSource && (a.source.alphaMode = "no-premultiply-alpha"), this.texture = a, this.sprite = new G.Sprite(this.texture), this.contentContainer.addChild(this.sprite), this.configureKeyframes();
17490
+ a.source instanceof H.VideoSource && (a.source.alphaMode = "no-premultiply-alpha"), this.texture = a, this.sprite = new H.Sprite(this.texture), this.contentContainer.addChild(this.sprite), this.configureKeyframes();
17482
17491
  }
17483
17492
  update(e, t) {
17484
- if (super.update(e, t), !this.texture || !(this.texture.source instanceof G.VideoSource))
17493
+ if (super.update(e, t), !this.texture || !(this.texture.source instanceof H.VideoSource))
17485
17494
  return;
17486
17495
  const i = this.getPlaybackTime(), a = this.edit.isPlaying && this.isActive();
17487
17496
  a && (this.isPlaying || (this.isPlaying = !0, this.texture.source.resource.currentTime = i, this.texture.source.resource.play().catch(console.error)), this.texture.source.resource.volume !== this.getVolume() && (this.texture.source.resource.volume = this.getVolume()), Math.abs(this.texture.source.resource.currentTime - i) > 0.1 && (this.texture.source.resource.currentTime = i)), !a && this.isPlaying && (this.isPlaying = !1, this.texture.source.resource.pause()), !this.edit.isPlaying && this.isActive() && (this.texture.source.resource.currentTime = i);
@@ -17502,10 +17511,10 @@ class Gg extends Dt {
17502
17511
  return this.sprite;
17503
17512
  }
17504
17513
  isVideoSource() {
17505
- return this.texture?.source instanceof G.VideoSource;
17514
+ return this.texture?.source instanceof H.VideoSource;
17506
17515
  }
17507
17516
  getVideoCurrentTime() {
17508
- return this.texture?.source instanceof G.VideoSource ? this.texture.source.resource.currentTime : -1;
17517
+ return this.texture?.source instanceof H.VideoSource ? this.texture.source.resource.currentTime : -1;
17509
17518
  }
17510
17519
  }
17511
17520
  function U(s, e, t) {
@@ -18283,12 +18292,12 @@ const sy = {
18283
18292
  continue;
18284
18293
  } else if (c)
18285
18294
  continue;
18286
- const f = n.issues.length, p = u._zod.check(n);
18287
- if (p instanceof Promise && l?.async === !1)
18295
+ const f = n.issues.length, g = u._zod.check(n);
18296
+ if (g instanceof Promise && l?.async === !1)
18288
18297
  throw new pa();
18289
- if (d || p instanceof Promise)
18298
+ if (d || g instanceof Promise)
18290
18299
  d = (d ?? Promise.resolve()).then(async () => {
18291
- await p, n.issues.length !== f && (c || (c = la(n, f)));
18300
+ await g, n.issues.length !== f && (c || (c = la(n, f)));
18292
18301
  });
18293
18302
  else {
18294
18303
  if (n.issues.length === f)
@@ -18650,7 +18659,7 @@ function Ch(s, e, t, i, a, r) {
18650
18659
  continue;
18651
18660
  }
18652
18661
  const f = l.run({ value: e[u], issues: [] }, i);
18653
- f instanceof Promise ? s.push(f.then((p) => In(p, t, u, e, d))) : In(f, t, u, e, d);
18662
+ f instanceof Promise ? s.push(f.then((g) => In(g, t, u, e, d))) : In(f, t, u, e, d);
18654
18663
  }
18655
18664
  return n.length && t.issues.push({
18656
18665
  code: "unrecognized_keys",
@@ -18699,27 +18708,27 @@ const My = /* @__PURE__ */ U("$ZodObject", (s, e) => {
18699
18708
  o.value = {};
18700
18709
  const d = [], u = n.shape;
18701
18710
  for (const f of n.keys) {
18702
- const p = u[f], g = p._zod.optout === "optional", w = p._zod.run({ value: c[f], issues: [] }, l);
18703
- w instanceof Promise ? d.push(w.then((C) => In(C, o, f, c, g))) : In(w, o, f, c, g);
18711
+ const g = u[f], p = g._zod.optout === "optional", w = g._zod.run({ value: c[f], issues: [] }, l);
18712
+ w instanceof Promise ? d.push(w.then((v) => In(v, o, f, c, p))) : In(w, o, f, c, p);
18704
18713
  }
18705
18714
  return r ? Ch(d, c, o, l, i.value, s) : d.length ? Promise.all(d).then(() => o) : o;
18706
18715
  };
18707
18716
  }), Ly = /* @__PURE__ */ U("$ZodObjectJIT", (s, e) => {
18708
18717
  My.init(s, e);
18709
18718
  const t = s._zod.parse, i = so(() => xh(e)), a = (f) => {
18710
- const p = new ty(["shape", "payload", "ctx"]), g = i.value, w = (x) => {
18711
- const T = hd(x);
18719
+ const g = new ty(["shape", "payload", "ctx"]), p = i.value, w = (C) => {
18720
+ const T = hd(C);
18712
18721
  return `shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`;
18713
18722
  };
18714
- p.write("const input = payload.value;");
18715
- const C = /* @__PURE__ */ Object.create(null);
18716
- let v = 0;
18717
- for (const x of g.keys)
18718
- C[x] = `key_${v++}`;
18719
- p.write("const newResult = {};");
18720
- for (const x of g.keys) {
18721
- const T = C[x], b = hd(x), M = f[x]?._zod?.optout === "optional";
18722
- p.write(`const ${T} = ${w(x)};`), M ? p.write(`
18723
+ g.write("const input = payload.value;");
18724
+ const v = /* @__PURE__ */ Object.create(null);
18725
+ let x = 0;
18726
+ for (const C of p.keys)
18727
+ v[C] = `key_${x++}`;
18728
+ g.write("const newResult = {};");
18729
+ for (const C of p.keys) {
18730
+ const T = v[C], b = hd(C), M = f[C]?._zod?.optout === "optional";
18731
+ g.write(`const ${T} = ${w(C)};`), M ? g.write(`
18723
18732
  if (${T}.issues.length) {
18724
18733
  if (${b} in input) {
18725
18734
  payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
@@ -18737,7 +18746,7 @@ const My = /* @__PURE__ */ U("$ZodObject", (s, e) => {
18737
18746
  newResult[${b}] = ${T}.value;
18738
18747
  }
18739
18748
 
18740
- `) : p.write(`
18749
+ `) : g.write(`
18741
18750
  if (${T}.issues.length) {
18742
18751
  payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
18743
18752
  ...iss,
@@ -18755,20 +18764,20 @@ const My = /* @__PURE__ */ U("$ZodObject", (s, e) => {
18755
18764
 
18756
18765
  `);
18757
18766
  }
18758
- p.write("payload.value = newResult;"), p.write("return payload;");
18759
- const S = p.compile();
18760
- return (x, T) => S(f, x, T);
18767
+ g.write("payload.value = newResult;"), g.write("return payload;");
18768
+ const S = g.compile();
18769
+ return (C, T) => S(f, C, T);
18761
18770
  };
18762
18771
  let r;
18763
18772
  const n = gr, o = !rh.jitless, c = o && jg.value, d = e.catchall;
18764
18773
  let u;
18765
- s._zod.parse = (f, p) => {
18774
+ s._zod.parse = (f, g) => {
18766
18775
  u ?? (u = i.value);
18767
- const g = f.value;
18768
- return n(g) ? o && c && p?.async === !1 && p.jitless !== !0 ? (r || (r = a(e.shape)), f = r(f, p), d ? Ch([], g, f, p, u, s) : f) : t(f, p) : (f.issues.push({
18776
+ const p = f.value;
18777
+ return n(p) ? o && c && g?.async === !1 && g.jitless !== !0 ? (r || (r = a(e.shape)), f = r(f, g), d ? Ch([], p, f, g, u, s) : f) : t(f, g) : (f.issues.push({
18769
18778
  expected: "object",
18770
18779
  code: "invalid_type",
18771
- input: g,
18780
+ input: p,
18772
18781
  inst: s
18773
18782
  }), f);
18774
18783
  };
@@ -19725,10 +19734,10 @@ function yt(s, e, t = { path: [], schemaPath: [] }) {
19725
19734
  if (s._zod.processJSONSchema)
19726
19735
  s._zod.processJSONSchema(e, n.schema, d);
19727
19736
  else {
19728
- const f = n.schema, p = e.processors[a.type];
19729
- if (!p)
19737
+ const f = n.schema, g = e.processors[a.type];
19738
+ if (!g)
19730
19739
  throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);
19731
- p(s, e, f, d);
19740
+ g(s, e, f, d);
19732
19741
  }
19733
19742
  const u = s._zod.parent;
19734
19743
  u && (n.ref || (n.ref = u), yt(u, e, d), e.seen.get(u).isParent = !0);
@@ -19753,11 +19762,11 @@ function Eh(s, e) {
19753
19762
  const a = (n) => {
19754
19763
  const o = s.target === "draft-2020-12" ? "$defs" : "definitions";
19755
19764
  if (s.external) {
19756
- const u = s.external.registry.get(n[0])?.id, f = s.external.uri ?? ((g) => g);
19765
+ const u = s.external.registry.get(n[0])?.id, f = s.external.uri ?? ((p) => p);
19757
19766
  if (u)
19758
19767
  return { ref: f(u) };
19759
- const p = n[1].defId ?? n[1].schema.id ?? `schema${s.counter++}`;
19760
- return n[1].defId = p, { defId: p, ref: `${f("__shared")}#/${o}/${p}` };
19768
+ const g = n[1].defId ?? n[1].schema.id ?? `schema${s.counter++}`;
19769
+ return n[1].defId = g, { defId: g, ref: `${f("__shared")}#/${o}/${g}` };
19761
19770
  }
19762
19771
  if (n[1] === t)
19763
19772
  return { ref: "#" };
@@ -19819,11 +19828,11 @@ function Nh(s, e) {
19819
19828
  const l = o.def ?? o.schema, c = { ...l }, d = o.ref;
19820
19829
  if (o.ref = null, d) {
19821
19830
  i(d);
19822
- const f = s.seen.get(d), p = f.schema;
19823
- if (p.$ref && (s.target === "draft-07" || s.target === "draft-04" || s.target === "openapi-3.0") ? (l.allOf = l.allOf ?? [], l.allOf.push(p)) : Object.assign(l, p), Object.assign(l, c), n._zod.parent === d)
19831
+ const f = s.seen.get(d), g = f.schema;
19832
+ if (g.$ref && (s.target === "draft-07" || s.target === "draft-04" || s.target === "openapi-3.0") ? (l.allOf = l.allOf ?? [], l.allOf.push(g)) : Object.assign(l, g), Object.assign(l, c), n._zod.parent === d)
19824
19833
  for (const w in l)
19825
19834
  w === "$ref" || w === "allOf" || w in c || delete l[w];
19826
- if (p.$ref && f.def)
19835
+ if (g.$ref && f.def)
19827
19836
  for (const w in l)
19828
19837
  w === "$ref" || w === "allOf" || w in f.def && JSON.stringify(l[w]) === JSON.stringify(f.def[w]) && delete l[w];
19829
19838
  }
@@ -19832,8 +19841,8 @@ function Nh(s, e) {
19832
19841
  i(u);
19833
19842
  const f = s.seen.get(u);
19834
19843
  if (f?.schema.$ref && (l.$ref = f.schema.$ref, f.def))
19835
- for (const p in l)
19836
- p === "$ref" || p === "allOf" || p in f.def && JSON.stringify(l[p]) === JSON.stringify(f.def[p]) && delete l[p];
19844
+ for (const g in l)
19845
+ g === "$ref" || g === "allOf" || g in f.def && JSON.stringify(l[g]) === JSON.stringify(f.def[g]) && delete l[g];
19837
19846
  }
19838
19847
  s.override({
19839
19848
  zodSchema: n,
@@ -23855,8 +23864,8 @@ const hp = /* @__PURE__ */ Ea(w4);
23855
23864
  var pp = { exports: {} };
23856
23865
  (function(s) {
23857
23866
  var e = function() {
23858
- function t(f, p) {
23859
- return p != null && f instanceof p;
23867
+ function t(f, g) {
23868
+ return g != null && f instanceof g;
23860
23869
  }
23861
23870
  var i;
23862
23871
  try {
@@ -23879,10 +23888,10 @@ var pp = { exports: {} };
23879
23888
  r = function() {
23880
23889
  };
23881
23890
  }
23882
- function n(f, p, g, w, C) {
23883
- typeof p == "object" && (g = p.depth, w = p.prototype, C = p.includeNonEnumerable, p = p.circular);
23884
- var v = [], S = [], x = typeof Buffer < "u";
23885
- typeof p > "u" && (p = !0), typeof g > "u" && (g = 1 / 0);
23891
+ function n(f, g, p, w, v) {
23892
+ typeof g == "object" && (p = g.depth, w = g.prototype, v = g.includeNonEnumerable, g = g.circular);
23893
+ var x = [], S = [], C = typeof Buffer < "u";
23894
+ typeof g > "u" && (g = !0), typeof p > "u" && (p = 1 / 0);
23886
23895
  function T(b, D) {
23887
23896
  if (b === null)
23888
23897
  return null;
@@ -23910,15 +23919,15 @@ var pp = { exports: {} };
23910
23919
  else if (n.__isDate(b))
23911
23920
  M = new Date(b.getTime());
23912
23921
  else {
23913
- if (x && Buffer.isBuffer(b))
23922
+ if (C && Buffer.isBuffer(b))
23914
23923
  return Buffer.allocUnsafe ? M = Buffer.allocUnsafe(b.length) : M = new Buffer(b.length), b.copy(M), M;
23915
23924
  t(b, Error) ? M = Object.create(b) : typeof w > "u" ? (L = Object.getPrototypeOf(b), M = Object.create(L)) : (M = Object.create(w), L = w);
23916
23925
  }
23917
- if (p) {
23918
- var Q = v.indexOf(b);
23926
+ if (g) {
23927
+ var Q = x.indexOf(b);
23919
23928
  if (Q != -1)
23920
23929
  return S[Q];
23921
- v.push(b), S.push(M);
23930
+ x.push(b), S.push(M);
23922
23931
  }
23923
23932
  t(b, i) && b.forEach(function(we, Z) {
23924
23933
  var j = T(Z, D - 1), Y = T(we, D - 1);
@@ -23934,11 +23943,11 @@ var pp = { exports: {} };
23934
23943
  if (Object.getOwnPropertySymbols)
23935
23944
  for (var ce = Object.getOwnPropertySymbols(b), K = 0; K < ce.length; K++) {
23936
23945
  var re = ce[K], ve = Object.getOwnPropertyDescriptor(b, re);
23937
- ve && !ve.enumerable && !C || (M[re] = T(b[re], D - 1), ve.enumerable || Object.defineProperty(M, re, {
23946
+ ve && !ve.enumerable && !v || (M[re] = T(b[re], D - 1), ve.enumerable || Object.defineProperty(M, re, {
23938
23947
  enumerable: !1
23939
23948
  }));
23940
23949
  }
23941
- if (C)
23950
+ if (v)
23942
23951
  for (var he = Object.getOwnPropertyNames(b), K = 0; K < he.length; K++) {
23943
23952
  var Ce = he[K], ve = Object.getOwnPropertyDescriptor(b, Ce);
23944
23953
  ve && ve.enumerable || (M[Ce] = T(b[Ce], D - 1), Object.defineProperty(M, Ce, {
@@ -23947,14 +23956,14 @@ var pp = { exports: {} };
23947
23956
  }
23948
23957
  return M;
23949
23958
  }
23950
- return T(f, g);
23959
+ return T(f, p);
23951
23960
  }
23952
- n.clonePrototype = function(p) {
23953
- if (p === null)
23961
+ n.clonePrototype = function(g) {
23962
+ if (g === null)
23954
23963
  return null;
23955
- var g = function() {
23964
+ var p = function() {
23956
23965
  };
23957
- return g.prototype = p, new g();
23966
+ return p.prototype = g, new p();
23958
23967
  };
23959
23968
  function o(f) {
23960
23969
  return Object.prototype.toString.call(f);
@@ -23973,8 +23982,8 @@ var pp = { exports: {} };
23973
23982
  }
23974
23983
  n.__isRegExp = d;
23975
23984
  function u(f) {
23976
- var p = "";
23977
- return f.global && (p += "g"), f.ignoreCase && (p += "i"), f.multiline && (p += "m"), p;
23985
+ var g = "";
23986
+ return f.global && (g += "g"), f.ignoreCase && (g += "i"), f.multiline && (g += "m"), g;
23978
23987
  }
23979
23988
  return n.__getRegExpFlags = u, n;
23980
23989
  }();
@@ -24169,24 +24178,24 @@ function I4(s, e, t) {
24169
24178
  return e - t;
24170
24179
  }
24171
24180
  _n.BrotliBuildHuffmanTable = function(s, e, t, i, a) {
24172
- var r = e, n, o, l, c, d, u, f, p, g, w, C, v = new Int32Array(ra + 1), S = new Int32Array(ra + 1);
24173
- for (C = new Int32Array(a), l = 0; l < a; l++)
24174
- v[i[l]]++;
24181
+ var r = e, n, o, l, c, d, u, f, g, p, w, v, x = new Int32Array(ra + 1), S = new Int32Array(ra + 1);
24182
+ for (v = new Int32Array(a), l = 0; l < a; l++)
24183
+ x[i[l]]++;
24175
24184
  for (S[1] = 0, o = 1; o < ra; o++)
24176
- S[o + 1] = S[o] + v[o];
24185
+ S[o + 1] = S[o] + x[o];
24177
24186
  for (l = 0; l < a; l++)
24178
- i[l] !== 0 && (C[S[i[l]]++] = l);
24179
- if (p = t, g = 1 << p, w = g, S[ra] === 1) {
24187
+ i[l] !== 0 && (v[S[i[l]]++] = l);
24188
+ if (g = t, p = 1 << g, w = p, S[ra] === 1) {
24180
24189
  for (c = 0; c < w; ++c)
24181
- s[e + c] = new da(0, C[0] & 65535);
24190
+ s[e + c] = new da(0, v[0] & 65535);
24182
24191
  return w;
24183
24192
  }
24184
24193
  for (c = 0, l = 0, o = 1, d = 2; o <= t; ++o, d <<= 1)
24185
- for (; v[o] > 0; --v[o])
24186
- n = new da(o & 255, C[l++] & 65535), qd(s, e + c, d, g, n), c = Gd(c, o);
24194
+ for (; x[o] > 0; --x[o])
24195
+ n = new da(o & 255, v[l++] & 65535), qd(s, e + c, d, p, n), c = Gd(c, o);
24187
24196
  for (f = w - 1, u = -1, o = t + 1, d = 2; o <= ra; ++o, d <<= 1)
24188
- for (; v[o] > 0; --v[o])
24189
- (c & f) !== u && (e += g, p = I4(v, o, t), g = 1 << p, w += g, u = c & f, s[r + u] = new da(p + t & 255, e - r - u & 65535)), n = new da(o - t & 255, C[l++] & 65535), qd(s, e + (c >> t), d, g, n), c = Gd(c, o);
24197
+ for (; x[o] > 0; --x[o])
24198
+ (c & f) !== u && (e += p, g = I4(x, o, t), p = 1 << g, w += p, u = c & f, s[r + u] = new da(g + t & 255, e - r - u & 65535)), n = new da(o - t & 255, v[l++] & 65535), qd(s, e + (c >> t), d, p, n), c = Gd(c, o);
24190
24199
  return w;
24191
24200
  };
24192
24201
  var Mc = {};
@@ -26121,7 +26130,7 @@ var Za = {}, Yd;
26121
26130
  function T4() {
26122
26131
  if (Yd) return Za;
26123
26132
  Yd = 1;
26124
- var s = bp(), e = 0, t = 1, i = 2, a = 3, r = 4, n = 5, o = 6, l = 7, c = 8, d = 9, u = 10, f = 11, p = 12, g = 13, w = 14, C = 15, v = 16, S = 17, x = 18, T = 20;
26133
+ var s = bp(), e = 0, t = 1, i = 2, a = 3, r = 4, n = 5, o = 6, l = 7, c = 8, d = 9, u = 10, f = 11, g = 12, p = 13, w = 14, v = 15, x = 16, S = 17, C = 18, T = 20;
26125
26134
  function b(L, Q, K) {
26126
26135
  this.prefix = new Uint8Array(L.length), this.transform = Q, this.suffix = new Uint8Array(K.length);
26127
26136
  for (var q = 0; q < L.length; q++)
@@ -26133,7 +26142,7 @@ function T4() {
26133
26142
  new b("", e, ""),
26134
26143
  new b("", e, " "),
26135
26144
  new b(" ", e, " "),
26136
- new b("", p, ""),
26145
+ new b("", g, ""),
26137
26146
  new b("", u, " "),
26138
26147
  new b("", e, " the "),
26139
26148
  new b(" ", e, ""),
@@ -26141,7 +26150,7 @@ function T4() {
26141
26150
  new b("", e, " of "),
26142
26151
  new b("", u, ""),
26143
26152
  new b("", e, " and "),
26144
- new b("", g, ""),
26153
+ new b("", p, ""),
26145
26154
  new b("", t, ""),
26146
26155
  new b(", ", e, " "),
26147
26156
  new b("", e, ", "),
@@ -26165,12 +26174,12 @@ function T4() {
26165
26174
  new b("", e, ". "),
26166
26175
  new b(".", e, ""),
26167
26176
  new b(" ", e, ", "),
26168
- new b("", C, ""),
26177
+ new b("", v, ""),
26169
26178
  new b("", e, " with "),
26170
26179
  new b("", e, "'"),
26171
26180
  new b("", e, " from "),
26172
26181
  new b("", e, " by "),
26173
- new b("", v, ""),
26182
+ new b("", x, ""),
26174
26183
  new b("", S, ""),
26175
26184
  new b(" the ", e, ""),
26176
26185
  new b("", r, ""),
@@ -26187,7 +26196,7 @@ function T4() {
26187
26196
  new b(" ", e, ". "),
26188
26197
  new b("", e, "ed "),
26189
26198
  new b("", T, ""),
26190
- new b("", x, ""),
26199
+ new b("", C, ""),
26191
26200
  new b("", o, ""),
26192
26201
  new b("", e, "("),
26193
26202
  new b("", u, ", "),
@@ -26259,7 +26268,7 @@ function T4() {
26259
26268
  return L[Q] < 192 ? (L[Q] >= 97 && L[Q] <= 122 && (L[Q] ^= 32), 1) : L[Q] < 224 ? (L[Q + 1] ^= 32, 2) : (L[Q + 2] ^= 5, 3);
26260
26269
  }
26261
26270
  return Za.transformDictionaryWord = function(L, Q, K, q, ce) {
26262
- var re = D[ce].prefix, ve = D[ce].suffix, he = D[ce].transform, Ce = he < p ? 0 : he - (p - 1), we = 0, Z = Q, j;
26271
+ var re = D[ce].prefix, ve = D[ce].suffix, he = D[ce].transform, Ce = he < g ? 0 : he - (g - 1), we = 0, Z = Q, j;
26263
26272
  Ce > q && (Ce = q);
26264
26273
  for (var Y = 0; Y < re.length; )
26265
26274
  L[Q++] = re[Y++];
@@ -26281,7 +26290,7 @@ var jd;
26281
26290
  function wp() {
26282
26291
  if (jd) return Ua;
26283
26292
  jd = 1;
26284
- var s = Vn.BrotliInput, e = Vn.BrotliOutput, t = k4, i = bp(), a = _n.HuffmanCode, r = _n.BrotliBuildHuffmanTable, n = Mc, o = Na, l = T4(), c = 8, d = 16, u = 256, f = 704, p = 26, g = 6, w = 2, C = 8, v = 255, S = 1080, x = 18, T = new Uint8Array([
26293
+ var s = Vn.BrotliInput, e = Vn.BrotliOutput, t = k4, i = bp(), a = _n.HuffmanCode, r = _n.BrotliBuildHuffmanTable, n = Mc, o = Na, l = T4(), c = 8, d = 16, u = 256, f = 704, g = 26, p = 6, w = 2, v = 8, x = 255, S = 1080, C = 18, T = new Uint8Array([
26285
26294
  1,
26286
26295
  2,
26287
26296
  3,
@@ -26399,12 +26408,12 @@ function wp() {
26399
26408
  }
26400
26409
  function re(X, R, O) {
26401
26410
  var B;
26402
- return O.fillBitWindow(), R += O.val_ >>> O.bit_pos_ & v, B = X[R].bits - C, B > 0 && (O.bit_pos_ += C, R += X[R].value, R += O.val_ >>> O.bit_pos_ & (1 << B) - 1), O.bit_pos_ += X[R].bits, X[R].value;
26411
+ return O.fillBitWindow(), R += O.val_ >>> O.bit_pos_ & x, B = X[R].bits - v, B > 0 && (O.bit_pos_ += v, R += X[R].value, R += O.val_ >>> O.bit_pos_ & (1 << B) - 1), O.bit_pos_ += X[R].bits, X[R].value;
26403
26412
  }
26404
26413
  function ve(X, R, O, B) {
26405
26414
  for (var ne = 0, fe = c, le = 0, ue = 0, Te = 32768, de = [], ie = 0; ie < 32; ie++)
26406
26415
  de.push(new a(0, 0));
26407
- for (r(de, 0, 5, X, x); ne < R && Te > 0; ) {
26416
+ for (r(de, 0, 5, X, C); ne < R && Te > 0; ) {
26408
26417
  var Ne = 0, at;
26409
26418
  if (B.readMoreInput(), B.fillBitWindow(), Ne += B.val_ >>> B.bit_pos_ & 31, B.bit_pos_ += de[Ne].bits, at = de[Ne].value & 255, at < d)
26410
26419
  le = 0, O[ne++] = at, at !== 0 && (fe = at, Te -= 32768 >> at);
@@ -26448,7 +26457,7 @@ function wp() {
26448
26457
  break;
26449
26458
  }
26450
26459
  } else {
26451
- var ue, at = new Uint8Array(x), kt = 32, $e = 0, pt = [
26460
+ var ue, at = new Uint8Array(C), kt = 32, $e = 0, pt = [
26452
26461
  new a(2, 0),
26453
26462
  new a(2, 4),
26454
26463
  new a(2, 3),
@@ -26466,7 +26475,7 @@ function wp() {
26466
26475
  new a(2, 3),
26467
26476
  new a(4, 5)
26468
26477
  ];
26469
- for (ue = fe; ue < x && kt > 0; ++ue) {
26478
+ for (ue = fe; ue < C && kt > 0; ++ue) {
26470
26479
  var gt = T[ue], Pt = 0, Rt;
26471
26480
  B.fillBitWindow(), Pt += B.val_ >>> B.bit_pos_ & 15, B.bit_pos_ += pt[Pt].bits, Rt = pt[Pt].value, at[gt] = Rt, Rt !== 0 && (kt -= 32 >> Rt, ++$e);
26472
26481
  }
@@ -26474,7 +26483,7 @@ function wp() {
26474
26483
  throw new Error("[ReadHuffmanCode] invalid num_codes or space");
26475
26484
  ve(at, X, le, B);
26476
26485
  }
26477
- if (ne = r(R, O, C, le, X), ne === 0)
26486
+ if (ne = r(R, O, v, le, X), ne === 0)
26478
26487
  throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");
26479
26488
  return ne;
26480
26489
  }
@@ -26617,10 +26626,10 @@ function wp() {
26617
26626
  continue;
26618
26627
  }
26619
26628
  for (O = 0; O < 3; ++O)
26620
- qt[O] = K(Pe) + 1, qt[O] >= 2 && (he(qt[O] + 2, Pt, O * S, Pe), he(p, Rt, O * S, Pe), Qt[O] = Ce(Rt, O * S, Pe), Ci[O] = 1);
26629
+ qt[O] = K(Pe) + 1, qt[O] >= 2 && (he(qt[O] + 2, Pt, O * S, Pe), he(g, Rt, O * S, Pe), Qt[O] = Ce(Rt, O * S, Pe), Ci[O] = 1);
26621
26630
  for (Pe.readMoreInput(), Xs = Pe.readBits(2), Yt = b + (Pe.readBits(4) << Xs), Br = (1 << Xs) - 1, Ki = Yt + (48 << Xs), Ks = new Uint8Array(qt[0]), O = 0; O < qt[0]; ++O)
26622
26631
  Pe.readMoreInput(), Ks[O] = Pe.readBits(2) << 1;
26623
- var Ur = Ie(qt[0] << g, Pe);
26632
+ var Ur = Ie(qt[0] << p, Pe);
26624
26633
  Dr = Ur.num_htrees, Or = Ur.context_map;
26625
26634
  var Eo = Ie(qt[2] << w, Pe);
26626
26635
  for (Ma = Eo.num_htrees, Rr = Eo.context_map, gt[0] = new Y(u, Dr), gt[1] = new Y(f, qt[1]), gt[2] = new Y(Ki, Ma), O = 0; O < 3; ++O)
@@ -26644,7 +26653,7 @@ function wp() {
26644
26653
  Ms,
26645
26654
  Ci,
26646
26655
  Pe
26647
- ), Qt[0] = Ce(Rt, 0, Pe), zr = ss[0] << g, Qi = zr, qe = Ks[ss[0]], oe = n.lookupOffsets[qe], Re = n.lookupOffsets[qe + 1]), Oa = n.lookup[oe + $e] | n.lookup[Re + pt], is = Or[Qi + Oa], --Qt[0], pt = $e, $e = re(gt[0].codes, gt[0].htrees[is], Pe), ie[B & de] = $e, (B & de) === de && R.write(ie, Te), ++B;
26656
+ ), Qt[0] = Ce(Rt, 0, Pe), zr = ss[0] << p, Qi = zr, qe = Ks[ss[0]], oe = n.lookupOffsets[qe], Re = n.lookupOffsets[qe + 1]), Oa = n.lookup[oe + $e] | n.lookup[Re + pt], is = Or[Qi + Oa], --Qt[0], pt = $e, $e = re(gt[0].codes, gt[0].htrees[is], Pe), ie[B & de] = $e, (B & de) === de && R.write(ie, Te), ++B;
26648
26657
  if (wt -= Fo, wt <= 0) break;
26649
26658
  if (jt < 0) {
26650
26659
  var Oa;
@@ -31781,34 +31790,34 @@ class H3 {
31781
31790
  r.codePoints.length > 1 && (n.minX += (r.codePoints.length - 1) * n.width / r.codePoints.length);
31782
31791
  let o = -t[i].xAdvance, l = 0, c = this.font.unitsPerEm / 16;
31783
31792
  for (let d = i + 1; d <= a; d++) {
31784
- let u = e[d], f = u.cbox, p = t[d], g = this.getCombiningClass(u.codePoints[0]);
31785
- if (g !== "Not_Reordered") {
31786
- switch (p.xOffset = p.yOffset = 0, g) {
31793
+ let u = e[d], f = u.cbox, g = t[d], p = this.getCombiningClass(u.codePoints[0]);
31794
+ if (p !== "Not_Reordered") {
31795
+ switch (g.xOffset = g.yOffset = 0, p) {
31787
31796
  case "Double_Above":
31788
31797
  case "Double_Below":
31789
- p.xOffset += n.minX - f.width / 2 - f.minX;
31798
+ g.xOffset += n.minX - f.width / 2 - f.minX;
31790
31799
  break;
31791
31800
  case "Attached_Below_Left":
31792
31801
  case "Below_Left":
31793
31802
  case "Above_Left":
31794
- p.xOffset += n.minX - f.minX;
31803
+ g.xOffset += n.minX - f.minX;
31795
31804
  break;
31796
31805
  case "Attached_Above_Right":
31797
31806
  case "Below_Right":
31798
31807
  case "Above_Right":
31799
- p.xOffset += n.maxX - f.width - f.minX;
31808
+ g.xOffset += n.maxX - f.width - f.minX;
31800
31809
  break;
31801
31810
  default:
31802
- p.xOffset += n.minX + (n.width - f.width) / 2 - f.minX;
31811
+ g.xOffset += n.minX + (n.width - f.width) / 2 - f.minX;
31803
31812
  }
31804
- switch (g) {
31813
+ switch (p) {
31805
31814
  case "Double_Below":
31806
31815
  case "Below_Left":
31807
31816
  case "Below":
31808
31817
  case "Below_Right":
31809
31818
  case "Attached_Below_Left":
31810
31819
  case "Attached_Below":
31811
- (g === "Attached_Below_Left" || g === "Attached_Below") && (n.minY += c), p.yOffset = -n.minY - f.maxY, n.minY += f.height;
31820
+ (p === "Attached_Below_Left" || p === "Attached_Below") && (n.minY += c), g.yOffset = -n.minY - f.maxY, n.minY += f.height;
31812
31821
  break;
31813
31822
  case "Double_Above":
31814
31823
  case "Above_Left":
@@ -31816,12 +31825,12 @@ class H3 {
31816
31825
  case "Above_Right":
31817
31826
  case "Attached_Above":
31818
31827
  case "Attached_Above_Right":
31819
- (g === "Attached_Above" || g === "Attached_Above_Right") && (n.maxY += c), p.yOffset = n.maxY - f.minY, n.maxY += f.height;
31828
+ (p === "Attached_Above" || p === "Attached_Above_Right") && (n.maxY += c), g.yOffset = n.maxY - f.minY, n.maxY += f.height;
31820
31829
  break;
31821
31830
  }
31822
- p.xAdvance = p.yAdvance = 0, p.xOffset += o, p.yOffset += l;
31831
+ g.xAdvance = g.yAdvance = 0, g.xOffset += o, g.yOffset += l;
31823
31832
  } else
31824
- o -= p.xAdvance, l -= p.yAdvance;
31833
+ o -= g.xAdvance, l -= g.yAdvance;
31825
31834
  }
31826
31835
  }
31827
31836
  getCombiningClass(e) {
@@ -32846,14 +32855,14 @@ class Hp {
32846
32855
  for (; !l; ) {
32847
32856
  let f = this.ligatureStack.pop();
32848
32857
  d.unshift(...this.glyphs[f].codePoints);
32849
- let p = a.getItem(o++);
32850
- l = !!(p & oS);
32851
- let g = !!(p & lS), w = (p & cS) << 2 >> 2;
32858
+ let g = a.getItem(o++);
32859
+ l = !!(g & oS);
32860
+ let p = !!(g & lS), w = (g & cS) << 2 >> 2;
32852
32861
  w += this.glyphs[f].id;
32853
- let C = r.getItem(w);
32854
- if (c += C, l || g) {
32855
- let v = n.getItem(c);
32856
- this.glyphs[f] = this.font.getGlyph(v, d), u.push(f), c = 0, d = [];
32862
+ let v = r.getItem(w);
32863
+ if (c += v, l || p) {
32864
+ let x = n.getItem(c);
32865
+ this.glyphs[f] = this.font.getGlyph(x, d), u.push(f), c = 0, d = [];
32857
32866
  } else this.glyphs[f] = this.font.getGlyph(65535);
32858
32867
  }
32859
32868
  this.ligatureStack.push(...u);
@@ -32920,11 +32929,11 @@ class Hp {
32920
32929
  let d = this.font.getGlyph(o);
32921
32930
  r.push(d), c.push(r[r.length - 1]), a(c[c.length - 1], l, c.length - 1);
32922
32931
  let u = 0, f = 0;
32923
- for (let p = 0; p < c.length && u <= 1; p++) c[p].id !== 65535 && (u++, f = c[p].id);
32932
+ for (let g = 0; g < c.length && u <= 1; g++) c[g].id !== 65535 && (u++, f = c[g].id);
32924
32933
  if (u === 1) {
32925
- let p = r.map((w) => w.id), g = this.inputCache[f];
32926
- g ? g.push(p) : this.inputCache[f] = [
32927
- p
32934
+ let g = r.map((w) => w.id), p = this.inputCache[f];
32935
+ p ? p.push(g) : this.inputCache[f] = [
32936
+ g
32928
32937
  ];
32929
32938
  }
32930
32939
  },
@@ -33949,15 +33958,15 @@ function qS(s, e, t) {
33949
33958
  l = n, u = i;
33950
33959
  else {
33951
33960
  r === Un ? (c = s[e - 1], d = i) : (c = s[e - 2], d = s[e - 1], u = i);
33952
- let p = c.codePoints[0], g = d.codePoints[0];
33953
- RS(p) && zS(g) && (l = ka + ((p - bo) * zn + (g - wo)) * xr);
33961
+ let g = c.codePoints[0], p = d.codePoints[0];
33962
+ RS(g) && zS(p) && (l = ka + ((g - bo) * zn + (p - wo)) * xr);
33954
33963
  }
33955
33964
  let f = u && u.codePoints[0] || Ri;
33956
33965
  if (l != null && (f === Ri || US(f))) {
33957
- let p = l + (f - Ri);
33958
- if (t.hasGlyphForCodePoint(p)) {
33959
- let g = o === Un ? 3 : 2;
33960
- return s.splice(e - g + 1, g, ar(t, p, i.features)), e - g + 1;
33966
+ let g = l + (f - Ri);
33967
+ if (t.hasGlyphForCodePoint(g)) {
33968
+ let p = o === Un ? 3 : 2;
33969
+ return s.splice(e - p + 1, p, ar(t, g, i.features)), e - p + 1;
33961
33970
  }
33962
33971
  }
33963
33972
  return c && (c.features.ljmo = !0), d && (d.features.vjmo = !0), u && (u.features.tjmo = !0), o === Zn ? (jp(s, e - 1, t), e + 1) : e;
@@ -34247,66 +34256,66 @@ function s5(s, e, t) {
34247
34256
  let { category: c, syllableType: d } = e[o].shaperInfo;
34248
34257
  if (d === "symbol_cluster" || d === "non_indic_cluster") continue;
34249
34258
  if (d === "broken_cluster" && r) {
34250
- let x = new fs(s, r, [
34259
+ let C = new fs(s, r, [
34251
34260
  9676
34252
34261
  ]);
34253
- x.shaperInfo = new gn(1 << Jl(x), Jp(x), e[o].shaperInfo.syllableType, e[o].shaperInfo.syllable);
34262
+ C.shaperInfo = new gn(1 << Jl(C), Jp(C), e[o].shaperInfo.syllableType, e[o].shaperInfo.syllable);
34254
34263
  let T = o;
34255
34264
  for (; T < l && e[T].shaperInfo.category === _e.Repha; ) T++;
34256
- e.splice(T++, 0, x), l++;
34265
+ e.splice(T++, 0, C), l++;
34257
34266
  }
34258
- let u = l, f = o, p = !1;
34267
+ let u = l, f = o, g = !1;
34259
34268
  if (i.rephPos !== ye.Ra_To_Become_Reph && a.rphf && o + 3 <= l && (i.rephMode === "Implicit" && !ks(e[o + 2]) || i.rephMode === "Explicit" && e[o + 2].shaperInfo.category === _e.ZWJ)) {
34260
- let x = [
34269
+ let C = [
34261
34270
  e[o].copy(),
34262
34271
  e[o + 1].copy(),
34263
34272
  e[o + 2].copy()
34264
34273
  ];
34265
- if (Rs(x.slice(0, 2), "rphf") || i.rephMode === "Explicit" && Rs(x, "rphf")) {
34274
+ if (Rs(C.slice(0, 2), "rphf") || i.rephMode === "Explicit" && Rs(C, "rphf")) {
34266
34275
  for (f += 2; f < l && ks(e[f]); ) f++;
34267
- u = o, p = !0;
34276
+ u = o, g = !0;
34268
34277
  }
34269
34278
  } else if (i.rephMode === "Log_Repha" && e[o].shaperInfo.category === _e.Repha) {
34270
34279
  for (f++; f < l && ks(e[f]); ) f++;
34271
- u = o, p = !0;
34280
+ u = o, g = !0;
34272
34281
  }
34273
34282
  switch (i.basePos) {
34274
34283
  case "Last": {
34275
- let x = l, T = !1;
34284
+ let C = l, T = !1;
34276
34285
  do {
34277
- let b = e[--x].shaperInfo;
34278
- if (Ei(e[x])) {
34286
+ let b = e[--C].shaperInfo;
34287
+ if (Ei(e[C])) {
34279
34288
  if (b.position !== ye.Below_C && (b.position !== ye.Post_C || T)) {
34280
- u = x;
34289
+ u = C;
34281
34290
  break;
34282
34291
  }
34283
- b.position === ye.Below_C && (T = !0), u = x;
34284
- } else if (o < x && b.category === _e.ZWJ && e[x - 1].shaperInfo.category === _e.H) break;
34285
- } while (x > f);
34292
+ b.position === ye.Below_C && (T = !0), u = C;
34293
+ } else if (o < C && b.category === _e.ZWJ && e[C - 1].shaperInfo.category === _e.H) break;
34294
+ } while (C > f);
34286
34295
  break;
34287
34296
  }
34288
34297
  case "First":
34289
34298
  u = o;
34290
- for (let x = u + 1; x < l; x++) Ei(e[x]) && (e[x].shaperInfo.position = ye.Below_C);
34299
+ for (let C = u + 1; C < l; C++) Ei(e[C]) && (e[C].shaperInfo.position = ye.Below_C);
34291
34300
  }
34292
- p && u === o && f - u <= 2 && (p = !1);
34293
- for (let x = o; x < u; x++) {
34294
- let T = e[x].shaperInfo;
34301
+ g && u === o && f - u <= 2 && (g = !1);
34302
+ for (let C = o; C < u; C++) {
34303
+ let T = e[C].shaperInfo;
34295
34304
  T.position = Math.min(ye.Pre_C, T.position);
34296
34305
  }
34297
34306
  u < l && (e[u].shaperInfo.position = ye.Base_C);
34298
- for (let x = u + 1; x < l; x++) if (e[x].shaperInfo.category === _e.M) {
34299
- for (let T = x + 1; T < l; T++) if (Ei(e[T])) {
34307
+ for (let C = u + 1; C < l; C++) if (e[C].shaperInfo.category === _e.M) {
34308
+ for (let T = C + 1; T < l; T++) if (Ei(e[T])) {
34300
34309
  e[T].shaperInfo.position = ye.Final_C;
34301
34310
  break;
34302
34311
  }
34303
34312
  break;
34304
34313
  }
34305
- if (p && (e[o].shaperInfo.position = ye.Ra_To_Become_Reph), t.isOldSpec) {
34306
- let x = t.unicodeScript !== "Malayalam";
34314
+ if (g && (e[o].shaperInfo.position = ye.Ra_To_Become_Reph), t.isOldSpec) {
34315
+ let C = t.unicodeScript !== "Malayalam";
34307
34316
  for (let T = u + 1; T < l; T++) if (e[T].shaperInfo.category === _e.H) {
34308
34317
  let b;
34309
- for (b = l - 1; b > T && !(Ei(e[b]) || x && e[b].shaperInfo.category === _e.H); b--)
34318
+ for (b = l - 1; b > T && !(Ei(e[b]) || C && e[b].shaperInfo.category === _e.H); b--)
34310
34319
  ;
34311
34320
  if (e[b].shaperInfo.category !== _e.H && b > T) {
34312
34321
  let D = e[T];
@@ -34315,53 +34324,53 @@ function s5(s, e, t) {
34315
34324
  break;
34316
34325
  }
34317
34326
  }
34318
- let g = ye.Start;
34319
- for (let x = o; x < l; x++) {
34320
- let T = e[x].shaperInfo;
34327
+ let p = ye.Start;
34328
+ for (let C = o; C < l; C++) {
34329
+ let T = e[C].shaperInfo;
34321
34330
  if (T.category & (Kp | _e.N | _e.RS | _e.CM | rr & T.category)) {
34322
- if (T.position = g, T.category === _e.H && T.position === ye.Pre_M) {
34323
- for (let b = x; b > o; b--) if (e[b - 1].shaperInfo.position !== ye.Pre_M) {
34331
+ if (T.position = p, T.category === _e.H && T.position === ye.Pre_M) {
34332
+ for (let b = C; b > o; b--) if (e[b - 1].shaperInfo.position !== ye.Pre_M) {
34324
34333
  T.position = e[b - 1].shaperInfo.position;
34325
34334
  break;
34326
34335
  }
34327
34336
  }
34328
- } else T.position !== ye.SMVD && (g = T.position);
34337
+ } else T.position !== ye.SMVD && (p = T.position);
34329
34338
  }
34330
34339
  let w = u;
34331
- for (let x = u + 1; x < l; x++)
34332
- if (Ei(e[x])) {
34333
- for (let T = w + 1; T < x; T++) e[T].shaperInfo.position < ye.SMVD && (e[T].shaperInfo.position = e[x].shaperInfo.position);
34334
- w = x;
34335
- } else e[x].shaperInfo.category === _e.M && (w = x);
34336
- let C = e.slice(o, l);
34337
- C.sort((x, T) => x.shaperInfo.position - T.shaperInfo.position), e.splice(o, C.length, ...C);
34338
- for (let x = o; x < l; x++) if (e[x].shaperInfo.position === ye.Base_C) {
34339
- u = x;
34340
+ for (let C = u + 1; C < l; C++)
34341
+ if (Ei(e[C])) {
34342
+ for (let T = w + 1; T < C; T++) e[T].shaperInfo.position < ye.SMVD && (e[T].shaperInfo.position = e[C].shaperInfo.position);
34343
+ w = C;
34344
+ } else e[C].shaperInfo.category === _e.M && (w = C);
34345
+ let v = e.slice(o, l);
34346
+ v.sort((C, T) => C.shaperInfo.position - T.shaperInfo.position), e.splice(o, v.length, ...v);
34347
+ for (let C = o; C < l; C++) if (e[C].shaperInfo.position === ye.Base_C) {
34348
+ u = C;
34340
34349
  break;
34341
34350
  }
34342
- for (let x = o; x < l && e[x].shaperInfo.position === ye.Ra_To_Become_Reph; x++) e[x].features.rphf = !0;
34343
- let v = !t.isOldSpec && i.blwfMode === "Pre_And_Post";
34344
- for (let x = o; x < u; x++)
34345
- e[x].features.half = !0, v && (e[x].features.blwf = !0);
34346
- for (let x = u + 1; x < l; x++)
34347
- e[x].features.abvf = !0, e[x].features.pstf = !0, e[x].features.blwf = !0;
34351
+ for (let C = o; C < l && e[C].shaperInfo.position === ye.Ra_To_Become_Reph; C++) e[C].features.rphf = !0;
34352
+ let x = !t.isOldSpec && i.blwfMode === "Pre_And_Post";
34353
+ for (let C = o; C < u; C++)
34354
+ e[C].features.half = !0, x && (e[C].features.blwf = !0);
34355
+ for (let C = u + 1; C < l; C++)
34356
+ e[C].features.abvf = !0, e[C].features.pstf = !0, e[C].features.blwf = !0;
34348
34357
  if (t.isOldSpec && t.unicodeScript === "Devanagari")
34349
- for (let x = o; x + 1 < u; x++) e[x].shaperInfo.category === _e.Ra && e[x + 1].shaperInfo.category === _e.H && (x + 1 === u || e[x + 2].shaperInfo.category === _e.ZWJ) && (e[x].features.blwf = !0, e[x + 1].features.blwf = !0);
34358
+ for (let C = o; C + 1 < u; C++) e[C].shaperInfo.category === _e.Ra && e[C + 1].shaperInfo.category === _e.H && (C + 1 === u || e[C + 2].shaperInfo.category === _e.ZWJ) && (e[C].features.blwf = !0, e[C + 1].features.blwf = !0);
34350
34359
  let S = 2;
34351
34360
  if (a.pref && u + S < l)
34352
- for (let x = u + 1; x + S - 1 < l; x++) {
34361
+ for (let C = u + 1; C + S - 1 < l; C++) {
34353
34362
  let T = [
34354
- e[x].copy(),
34355
- e[x + 1].copy()
34363
+ e[C].copy(),
34364
+ e[C + 1].copy()
34356
34365
  ];
34357
34366
  if (Rs(T, "pref")) {
34358
- for (let b = 0; b < S; b++) e[x++].features.pref = !0;
34359
- if (a.cfar) for (; x < l; x++) e[x].features.cfar = !0;
34367
+ for (let b = 0; b < S; b++) e[C++].features.pref = !0;
34368
+ if (a.cfar) for (; C < l; C++) e[C].features.cfar = !0;
34360
34369
  break;
34361
34370
  }
34362
34371
  }
34363
- for (let x = o + 1; x < l; x++) if (ks(e[x])) {
34364
- let T = e[x].shaperInfo.category === _e.ZWNJ, b = x;
34372
+ for (let C = o + 1; C < l; C++) if (ks(e[C])) {
34373
+ let T = e[C].shaperInfo.category === _e.ZWNJ, b = C;
34365
34374
  do
34366
34375
  b--, T && delete e[b].features.half;
34367
34376
  while (b > o && !Ei(e[b]));
@@ -34427,7 +34436,7 @@ function i5(s, e, t) {
34427
34436
  if (!u) {
34428
34437
  for (c = n - 1; c > r && e[c].shaperInfo.position === ye.SMVD; ) c--;
34429
34438
  if (Bs(e[c]))
34430
- for (let p = l + 1; p < c; p++) e[p].shaperInfo.category === _e.M && c--;
34439
+ for (let g = l + 1; g < c; g++) e[g].shaperInfo.category === _e.M && c--;
34431
34440
  }
34432
34441
  let f = e[r];
34433
34442
  e.splice(r, 0, ...e.splice(r + 1, c - r)), e[c] = f, r < l && l <= c && l--;
@@ -34439,8 +34448,8 @@ function i5(s, e, t) {
34439
34448
  if (t.unicodeScript !== "Malayalam" && t.unicodeScript !== "Tamil") {
34440
34449
  for (; d > r && !(e[d - 1].shaperInfo.category & (_e.M | rr)); ) d--;
34441
34450
  if (d > r && e[d - 1].shaperInfo.category === _e.M) {
34442
- let p = c;
34443
- for (let g = l + 1; g < p; g++) if (e[g].shaperInfo.category === _e.M) {
34451
+ let g = c;
34452
+ for (let p = l + 1; p < g; p++) if (e[p].shaperInfo.category === _e.M) {
34444
34453
  d--;
34445
34454
  break;
34446
34455
  }
@@ -34710,17 +34719,17 @@ class p5 extends Rn {
34710
34719
  let d = o.isMark;
34711
34720
  for (let w = 0; w < n.length && d; w++) d = this.glyphs[n[w]].isMark;
34712
34721
  c.ligatureID = d ? null : this.ligatureID++;
34713
- let u = o.ligatureID, f = o.codePoints.length, p = f, g = this.glyphIterator.index + 1;
34722
+ let u = o.ligatureID, f = o.codePoints.length, g = f, p = this.glyphIterator.index + 1;
34714
34723
  for (let w of n) {
34715
- if (d) g = w;
34716
- else for (; g < w; ) {
34717
- var i = p - f + Math.min(this.glyphs[g].ligatureComponent || 1, f);
34718
- this.glyphs[g].ligatureID = c.ligatureID, this.glyphs[g].ligatureComponent = i, g++;
34724
+ if (d) p = w;
34725
+ else for (; p < w; ) {
34726
+ var i = g - f + Math.min(this.glyphs[p].ligatureComponent || 1, f);
34727
+ this.glyphs[p].ligatureID = c.ligatureID, this.glyphs[p].ligatureComponent = i, p++;
34719
34728
  }
34720
- u = this.glyphs[g].ligatureID, f = this.glyphs[g].codePoints.length, p += f, g++;
34729
+ u = this.glyphs[p].ligatureID, f = this.glyphs[p].codePoints.length, g += f, p++;
34721
34730
  }
34722
- if (u && !d) for (let w = g; w < this.glyphs.length && this.glyphs[w].ligatureID === u; w++) {
34723
- var i = p - f + Math.min(this.glyphs[w].ligatureComponent || 1, f);
34731
+ if (u && !d) for (let w = p; w < this.glyphs.length && this.glyphs[w].ligatureID === u; w++) {
34732
+ var i = g - f + Math.min(this.glyphs[w].ligatureComponent || 1, f);
34724
34733
  this.glyphs[w].ligatureComponent = i;
34725
34734
  }
34726
34735
  for (let w = n.length - 1; w >= 0; w--) this.glyphs.splice(n[w], 1);
@@ -35033,12 +35042,12 @@ class Fa {
35033
35042
  */
35034
35043
  get bbox() {
35035
35044
  if (this._bbox) return this._bbox;
35036
- let e = new gi(), t = 0, i = 0, a = (S) => Math.pow(1 - S, 3) * p[v] + 3 * Math.pow(1 - S, 2) * S * g[v] + 3 * (1 - S) * Math.pow(S, 2) * w[v] + Math.pow(S, 3) * C[v];
35045
+ let e = new gi(), t = 0, i = 0, a = (S) => Math.pow(1 - S, 3) * g[x] + 3 * Math.pow(1 - S, 2) * S * p[x] + 3 * (1 - S) * Math.pow(S, 2) * w[x] + Math.pow(S, 3) * v[x];
35037
35046
  for (let S of this.commands) switch (S.command) {
35038
35047
  case "moveTo":
35039
35048
  case "lineTo":
35040
- let [x, T] = S.args;
35041
- e.addPoint(x, T), t = x, i = T;
35049
+ let [C, T] = S.args;
35050
+ e.addPoint(C, T), t = C, i = T;
35042
35051
  break;
35043
35052
  case "quadraticCurveTo":
35044
35053
  case "bezierCurveTo":
@@ -35046,32 +35055,32 @@ class Fa {
35046
35055
  var [r, n, u, f] = S.args, o = t + 2 / 3 * (r - t), l = i + 2 / 3 * (n - i), c = u + 2 / 3 * (r - u), d = f + 2 / 3 * (n - f);
35047
35056
  else var [o, l, c, d, u, f] = S.args;
35048
35057
  e.addPoint(u, f);
35049
- for (var p = [
35058
+ for (var g = [
35050
35059
  t,
35051
35060
  i
35052
- ], g = [
35061
+ ], p = [
35053
35062
  o,
35054
35063
  l
35055
35064
  ], w = [
35056
35065
  c,
35057
35066
  d
35058
- ], C = [
35067
+ ], v = [
35059
35068
  u,
35060
35069
  f
35061
- ], v = 0; v <= 1; v++) {
35062
- let b = 6 * p[v] - 12 * g[v] + 6 * w[v], D = -3 * p[v] + 9 * g[v] - 9 * w[v] + 3 * C[v];
35063
- if (S = 3 * g[v] - 3 * p[v], D === 0) {
35070
+ ], x = 0; x <= 1; x++) {
35071
+ let b = 6 * g[x] - 12 * p[x] + 6 * w[x], D = -3 * g[x] + 9 * p[x] - 9 * w[x] + 3 * v[x];
35072
+ if (S = 3 * p[x] - 3 * g[x], D === 0) {
35064
35073
  if (b === 0) continue;
35065
35074
  let K = -S / b;
35066
- 0 < K && K < 1 && (v === 0 ? e.addPoint(a(K), e.maxY) : v === 1 && e.addPoint(e.maxX, a(K)));
35075
+ 0 < K && K < 1 && (x === 0 ? e.addPoint(a(K), e.maxY) : x === 1 && e.addPoint(e.maxX, a(K)));
35067
35076
  continue;
35068
35077
  }
35069
35078
  let M = Math.pow(b, 2) - 4 * S * D;
35070
35079
  if (M < 0) continue;
35071
35080
  let L = (-b + Math.sqrt(M)) / (2 * D);
35072
- 0 < L && L < 1 && (v === 0 ? e.addPoint(a(L), e.maxY) : v === 1 && e.addPoint(e.maxX, a(L)));
35081
+ 0 < L && L < 1 && (x === 0 ? e.addPoint(a(L), e.maxY) : x === 1 && e.addPoint(e.maxX, a(L)));
35073
35082
  let Q = (-b - Math.sqrt(M)) / (2 * D);
35074
- 0 < Q && Q < 1 && (v === 0 ? e.addPoint(a(Q), e.maxY) : v === 1 && e.addPoint(e.maxX, a(Q)));
35083
+ 0 < Q && Q < 1 && (x === 0 ? e.addPoint(a(Q), e.maxY) : x === 1 && e.addPoint(e.maxX, a(Q)));
35075
35084
  }
35076
35085
  t = u, i = f;
35077
35086
  break;
@@ -35678,8 +35687,8 @@ class xo extends Fs {
35678
35687
  for (let l = 0; l < o.length; l++) {
35679
35688
  let c = o[l];
35680
35689
  for (let d = 0; d < c.length; d++) {
35681
- let u = c[d], f = u.x * n.scaleX + u.y * n.scale01 + n.dx, p = u.y * n.scaleY + u.x * n.scale10 + n.dy;
35682
- t.push(new rs(u.onCurve, u.endContour, f, p));
35690
+ let u = c[d], f = u.x * n.scaleX + u.y * n.scale01 + n.dx, g = u.y * n.scaleY + u.x * n.scale10 + n.dy;
35691
+ t.push(new rs(u.onCurve, u.endContour, f, g));
35683
35692
  }
35684
35693
  }
35685
35694
  }
@@ -35715,8 +35724,8 @@ class xo extends Fs {
35715
35724
  if (u.onCurve && d.onCurve) t.lineTo(d.x, d.y);
35716
35725
  else if (u.onCurve && !d.onCurve) var i = d;
35717
35726
  else if (!u.onCurve && !d.onCurve) {
35718
- let p = (u.x + d.x) / 2, g = (u.y + d.y) / 2;
35719
- t.quadraticCurveTo(u.x, u.y, p, g);
35727
+ let g = (u.x + d.x) / 2, p = (u.y + d.y) / 2;
35728
+ t.quadraticCurveTo(u.x, u.y, g, p);
35720
35729
  var i = d;
35721
35730
  } else if (!u.onCurve && d.onCurve) {
35722
35731
  t.quadraticCurveTo(i.x, i.y, d.x, d.y);
@@ -35741,17 +35750,17 @@ class F5 extends Fs {
35741
35750
  _getPath() {
35742
35751
  let e = this._font.CFF2 || this._font["CFF "], { stream: t } = e, i = e.topDict.CharStrings[this.id], a = i.offset + i.length;
35743
35752
  t.pos = i.offset;
35744
- let r = new Fa(), n = [], o = [], l = null, c = 0, d = 0, u = 0, f, p, g = !1;
35745
- this._usedGsubrs = f = {}, this._usedSubrs = p = {};
35746
- let w = e.globalSubrIndex || [], C = this.bias(w), v = e.privateDictForGlyph(this.id) || {}, S = v.Subrs || [], x = this.bias(S), T = e.topDict.vstore && e.topDict.vstore.itemVariationStore, b = v.vsindex, D = this._font._variationProcessor;
35753
+ let r = new Fa(), n = [], o = [], l = null, c = 0, d = 0, u = 0, f, g, p = !1;
35754
+ this._usedGsubrs = f = {}, this._usedSubrs = g = {};
35755
+ let w = e.globalSubrIndex || [], v = this.bias(w), x = e.privateDictForGlyph(this.id) || {}, S = x.Subrs || [], C = this.bias(S), T = e.topDict.vstore && e.topDict.vstore.itemVariationStore, b = x.vsindex, D = this._font._variationProcessor;
35747
35756
  function M() {
35748
- l == null && (l = n.shift() + v.nominalWidthX);
35757
+ l == null && (l = n.shift() + x.nominalWidthX);
35749
35758
  }
35750
35759
  function L() {
35751
35760
  return n.length % 2 !== 0 && M(), c += n.length >> 1, n.length = 0;
35752
35761
  }
35753
35762
  function Q(q, ce) {
35754
- g && r.closePath(), r.moveTo(q, ce), g = !0;
35763
+ p && r.closePath(), r.moveTo(q, ce), p = !0;
35755
35764
  }
35756
35765
  let K = function() {
35757
35766
  for (; t.pos < a; ) {
@@ -35782,8 +35791,8 @@ class F5 extends Fs {
35782
35791
  we = d + n.shift(), Z = u + n.shift(), j = we + n.shift(), Y = Z + n.shift(), d = j + n.shift(), u = Y + n.shift(), r.bezierCurveTo(we, Z, j, Y, d, u);
35783
35792
  break;
35784
35793
  case 10:
35785
- if (ve = n.pop() + x, he = S[ve], he) {
35786
- p[ve] = !0;
35794
+ if (ve = n.pop() + C, he = S[ve], he) {
35795
+ g[ve] = !0;
35787
35796
  let O = t.pos, B = a;
35788
35797
  t.pos = he.offset, a = he.offset + he.length, K(), t.pos = O, a = B;
35789
35798
  }
@@ -35793,7 +35802,7 @@ class F5 extends Fs {
35793
35802
  return;
35794
35803
  case 14:
35795
35804
  if (e.version >= 2) break;
35796
- n.length > 0 && M(), g && (r.closePath(), g = !1);
35805
+ n.length > 0 && M(), p && (r.closePath(), p = !1);
35797
35806
  break;
35798
35807
  case 15:
35799
35808
  if (e.version < 2) throw new Error("vsindex operator not supported in CFF v1");
@@ -35843,7 +35852,7 @@ class F5 extends Fs {
35843
35852
  n.push(t.readInt16BE());
35844
35853
  break;
35845
35854
  case 29:
35846
- if (ve = n.pop() + C, he = w[ve], he) {
35855
+ if (ve = n.pop() + v, he = w[ve], he) {
35847
35856
  f[ve] = !0;
35848
35857
  let O = t.pos, B = a;
35849
35858
  t.pos = he.offset, a = he.offset + he.length, K(), t.pos = O, a = B;
@@ -35965,7 +35974,7 @@ class F5 extends Fs {
35965
35974
  } else n.push(t.readInt32BE() / 65536);
35966
35975
  }
35967
35976
  };
35968
- return K(), g && r.closePath(), r;
35977
+ return K(), p && r.closePath(), r;
35969
35978
  }
35970
35979
  constructor(...e) {
35971
35980
  super(...e), Gt(this, "type", "CFF");
@@ -36109,10 +36118,10 @@ class Z5 {
36109
36118
  var c = this.decodePoints();
36110
36119
  o = r.pos, r.pos = l;
36111
36120
  }
36112
- let d = t.map((C) => C.copy());
36121
+ let d = t.map((v) => v.copy());
36113
36122
  n &= B5;
36114
- for (let C = 0; C < n; C++) {
36115
- let v = r.readUInt16BE(), S = r.readUInt16BE();
36123
+ for (let v = 0; v < n; v++) {
36124
+ let x = r.readUInt16BE(), S = r.readUInt16BE();
36116
36125
  if (S & O5) {
36117
36126
  var u = [];
36118
36127
  for (let L = 0; L < i.axisCount; L++) u.push(r.readInt16BE() / 16384);
@@ -36123,29 +36132,29 @@ class Z5 {
36123
36132
  if (S & Fu) {
36124
36133
  var f = [];
36125
36134
  for (let L = 0; L < i.axisCount; L++) f.push(r.readInt16BE() / 16384);
36126
- var p = [];
36127
- for (let L = 0; L < i.axisCount; L++) p.push(r.readInt16BE() / 16384);
36135
+ var g = [];
36136
+ for (let L = 0; L < i.axisCount; L++) g.push(r.readInt16BE() / 16384);
36128
36137
  }
36129
- let x = this.tupleFactor(S, u, f, p);
36130
- if (x === 0) {
36131
- o += v;
36138
+ let C = this.tupleFactor(S, u, f, g);
36139
+ if (C === 0) {
36140
+ o += x;
36132
36141
  continue;
36133
36142
  }
36134
36143
  var l = r.pos;
36135
- if (r.pos = o, S & D5) var g = this.decodePoints();
36136
- else var g = c;
36137
- let b = g.length === 0 ? t.length : g.length, D = this.decodeDeltas(b), M = this.decodeDeltas(b);
36138
- if (g.length === 0) for (let L = 0; L < t.length; L++) {
36144
+ if (r.pos = o, S & D5) var p = this.decodePoints();
36145
+ else var p = c;
36146
+ let b = p.length === 0 ? t.length : p.length, D = this.decodeDeltas(b), M = this.decodeDeltas(b);
36147
+ if (p.length === 0) for (let L = 0; L < t.length; L++) {
36139
36148
  var w = t[L];
36140
- w.x += Math.round(D[L] * x), w.y += Math.round(M[L] * x);
36149
+ w.x += Math.round(D[L] * C), w.y += Math.round(M[L] * C);
36141
36150
  }
36142
36151
  else {
36143
36152
  let L = d.map((K) => K.copy()), Q = t.map(() => !1);
36144
- for (let K = 0; K < g.length; K++) {
36145
- let q = g[K];
36153
+ for (let K = 0; K < p.length; K++) {
36154
+ let q = p[K];
36146
36155
  if (q < t.length) {
36147
36156
  let ce = L[q];
36148
- Q[q] = !0, ce.x += D[K] * x, ce.y += M[K] * x;
36157
+ Q[q] = !0, ce.x += D[K] * C, ce.y += M[K] * C;
36149
36158
  }
36150
36159
  }
36151
36160
  this.interpolateMissingDeltas(L, d, Q);
@@ -36154,7 +36163,7 @@ class Z5 {
36154
36163
  t[K].x = Math.round(t[K].x + q), t[K].y = Math.round(t[K].y + ce);
36155
36164
  }
36156
36165
  }
36157
- o += v, r.pos = l;
36166
+ o += x, r.pos = l;
36158
36167
  }
36159
36168
  }
36160
36169
  decodePoints() {
@@ -36224,12 +36233,12 @@ class Z5 {
36224
36233
  var l = i;
36225
36234
  i = a, a = l;
36226
36235
  }
36227
- let u = r[i][d], f = r[a][d], p = n[i][d], g = n[a][d];
36228
- if (u !== f || p === g) {
36229
- let w = u === f ? 0 : (g - p) / (f - u);
36230
- for (let C = e; C <= t; C++) {
36231
- let v = r[C][d];
36232
- v <= u ? v += p - u : v >= f ? v += g - f : v = p + (v - u) * w, n[C][d] = v;
36236
+ let u = r[i][d], f = r[a][d], g = n[i][d], p = n[a][d];
36237
+ if (u !== f || g === p) {
36238
+ let w = u === f ? 0 : (p - g) / (f - u);
36239
+ for (let v = e; v <= t; v++) {
36240
+ let x = r[v][d];
36241
+ x <= u ? x += g - u : x >= f ? x += p - f : x = g + (x - u) * w, n[v][d] = x;
36233
36242
  }
36234
36243
  }
36235
36244
  }
@@ -36309,23 +36318,23 @@ let Bu = new _({
36309
36318
  class X5 {
36310
36319
  encodeSimple(e, t = []) {
36311
36320
  let i = [], a = [], r = [], n = [], o = 0, l = 0, c = 0, d = 0, u = 0;
36312
- for (let v = 0; v < e.commands.length; v++) {
36313
- let S = e.commands[v];
36314
- for (let x = 0; x < S.args.length; x += 2) {
36315
- let T = S.args[x], b = S.args[x + 1], D = 0;
36316
- if (S.command === "quadraticCurveTo" && x === 2) {
36317
- let M = e.commands[v + 1];
36321
+ for (let x = 0; x < e.commands.length; x++) {
36322
+ let S = e.commands[x];
36323
+ for (let C = 0; C < S.args.length; C += 2) {
36324
+ let T = S.args[C], b = S.args[C + 1], D = 0;
36325
+ if (S.command === "quadraticCurveTo" && C === 2) {
36326
+ let M = e.commands[x + 1];
36318
36327
  if (M && M.command === "quadraticCurveTo") {
36319
36328
  let L = (l + M.args[0]) / 2, Q = (c + M.args[1]) / 2;
36320
36329
  if (T === L && b === Q) continue;
36321
36330
  }
36322
36331
  }
36323
- S.command === "quadraticCurveTo" && x === 0 || (D |= W5), D = this._encodePoint(T, l, a, D, H5, Y5), D = this._encodePoint(b, c, r, D, G5, j5), D === d && o < 255 ? (n[n.length - 1] |= q5, o++) : (o > 0 && (n.push(o), o = 0), n.push(D), d = D), l = T, c = b, u++;
36332
+ S.command === "quadraticCurveTo" && C === 0 || (D |= W5), D = this._encodePoint(T, l, a, D, H5, Y5), D = this._encodePoint(b, c, r, D, G5, j5), D === d && o < 255 ? (n[n.length - 1] |= q5, o++) : (o > 0 && (n.push(o), o = 0), n.push(D), d = D), l = T, c = b, u++;
36324
36333
  }
36325
36334
  S.command === "closePath" && i.push(u - 1);
36326
36335
  }
36327
36336
  e.commands.length > 1 && e.commands[e.commands.length - 1].command !== "closePath" && i.push(u - 1);
36328
- let f = e.bbox, p = {
36337
+ let f = e.bbox, g = {
36329
36338
  numberOfContours: i.length,
36330
36339
  xMin: f.minX,
36331
36340
  yMin: f.minY,
@@ -36336,8 +36345,8 @@ class X5 {
36336
36345
  flags: n,
36337
36346
  xPoints: a,
36338
36347
  yPoints: r
36339
- }, g = Bu.size(p), w = 4 - g % 4, C = new Pn(g + w);
36340
- return Bu.encode(C, p), w !== 0 && C.fill(0, w), C.buffer;
36348
+ }, p = Bu.size(g), w = 4 - p % 4, v = new Pn(p + w);
36349
+ return Bu.encode(v, g), w !== 0 && v.fill(0, w), v.buffer;
36341
36350
  }
36342
36351
  _encodePoint(e, t, i, a, r, n) {
36343
36352
  let o = e - t;
@@ -37168,8 +37177,8 @@ function dA(s, e, t) {
37168
37177
  c = gs(u, 1 + (n / 12 << 8) + e.readUInt8()), d = gs(u >> 1, 1 + (n % 12 >> 2 << 8) + e.readUInt8());
37169
37178
  } else if (u < 124) {
37170
37179
  var o = e.readUInt8();
37171
- let g = e.readUInt8();
37172
- c = gs(u, (o << 4) + (g >> 4)), d = gs(u >> 1, ((g & 15) << 8) + e.readUInt8());
37180
+ let p = e.readUInt8();
37181
+ c = gs(u, (o << 4) + (p >> 4)), d = gs(u >> 1, ((p & 15) << 8) + e.readUInt8());
37173
37182
  } else
37174
37183
  c = gs(u, e.readUInt16BE()), d = gs(u >> 1, e.readUInt16BE());
37175
37184
  a += c, i += d, r.push(new rs(f, !1, a, i));
@@ -37716,8 +37725,8 @@ var _r = class tt {
37716
37725
  try {
37717
37726
  const d = typeof Buffer < "u" ? Buffer.from(e) : new Uint8Array(e), u = vp(d), f = t.family;
37718
37727
  if (this.fontkitBaseFonts.has(f) || this.fontkitBaseFonts.set(f, u), this.detectColorEmojiFont(u) && (this.colorEmojiFonts.add(t.family), this.colorEmojiFontBytes.has(t.family) || this.colorEmojiFontBytes.set(t.family, e.slice(0))), u.variationAxes && Object.keys(u.variationAxes).length > 0) {
37719
- const g = u.getVariation({ wght: c });
37720
- this.fontkitFonts.set(i, g);
37728
+ const p = u.getVariation({ wght: c });
37729
+ this.fontkitFonts.set(i, p);
37721
37730
  } else
37722
37731
  this.fontkitFonts.set(i, u);
37723
37732
  } catch (d) {
@@ -37761,9 +37770,9 @@ var _r = class tt {
37761
37770
  async tryDeriveFromExistingFont(e) {
37762
37771
  const t = e.family, i = tn(e.weight), a = parseInt(i, 10);
37763
37772
  let r;
37764
- for (const [f, p] of this.blobs)
37773
+ for (const [f, g] of this.blobs)
37765
37774
  if (f.startsWith(`${t}__`)) {
37766
- r = p;
37775
+ r = g;
37767
37776
  break;
37768
37777
  }
37769
37778
  const n = this.fontkitBaseFonts.get(t);
@@ -37928,14 +37937,14 @@ var OA = class {
37928
37937
  if (!n)
37929
37938
  l = await this.shapeFull(o, t);
37930
37939
  else {
37931
- const S = Array.from(o), x = [];
37940
+ const S = Array.from(o), C = [];
37932
37941
  let T = { text: "", startIndex: 0, isEmoji: !1 };
37933
37942
  for (let b = 0; b < S.length; b++) {
37934
37943
  const D = S[b], M = BA(D);
37935
- b === 0 ? T = { text: D, startIndex: 0, isEmoji: M } : T.isEmoji === M ? T.text += D : (x.push(T), T = { text: D, startIndex: T.startIndex + T.text.length, isEmoji: M });
37944
+ b === 0 ? T = { text: D, startIndex: 0, isEmoji: M } : T.isEmoji === M ? T.text += D : (C.push(T), T = { text: D, startIndex: T.startIndex + T.text.length, isEmoji: M });
37936
37945
  }
37937
- T.text && x.push(T), l = [];
37938
- for (const b of x) {
37946
+ T.text && C.push(T), l = [];
37947
+ for (const b of C) {
37939
37948
  const D = b.isEmoji ? n : t, M = await this.shapeFull(b.text, D);
37940
37949
  for (const L of M)
37941
37950
  L.cl += b.startIndex, L.fontDesc = D;
@@ -37954,10 +37963,10 @@ var OA = class {
37954
37963
  );
37955
37964
  }
37956
37965
  const d = i / c, u = l.map((S) => {
37957
- const x = S.cl;
37966
+ const C = S.cl;
37958
37967
  let T;
37959
- if (x >= 0 && x < o.length) {
37960
- const b = o.codePointAt(x);
37968
+ if (C >= 0 && C < o.length) {
37969
+ const b = o.codePointAt(C);
37961
37970
  b !== void 0 && (T = String.fromCodePoint(b));
37962
37971
  }
37963
37972
  return {
@@ -37971,48 +37980,48 @@ var OA = class {
37971
37980
  // Preserve font descriptor
37972
37981
  };
37973
37982
  }), f = [];
37974
- let p = [], g = 0;
37983
+ let g = [], p = 0;
37975
37984
  const w = /* @__PURE__ */ new Set();
37976
37985
  for (let S = 0; S < o.length; S++)
37977
37986
  o[S] === " " && w.add(S);
37978
- let C = -1;
37987
+ let v = -1;
37979
37988
  for (let S = 0; S < u.length; S++) {
37980
- const x = u[S], T = x.xAdvance;
37981
- if (x.char === `
37989
+ const C = u[S], T = C.xAdvance;
37990
+ if (C.char === `
37982
37991
  `) {
37983
37992
  f.push({
37984
- glyphs: p,
37985
- width: g,
37993
+ glyphs: g,
37994
+ width: p,
37986
37995
  y: 0
37987
- }), p = [], g = 0, C = S;
37996
+ }), g = [], p = 0, v = S;
37988
37997
  continue;
37989
37998
  }
37990
- if (g + T > r && p.length > 0) {
37991
- if (C > -1) {
37992
- const b = C - (S - p.length) + 1, D = p.splice(b), M = p.reduce((L, Q) => L + Q.xAdvance, 0);
37999
+ if (p + T > r && g.length > 0) {
38000
+ if (v > -1) {
38001
+ const b = v - (S - g.length) + 1, D = g.splice(b), M = g.reduce((L, Q) => L + Q.xAdvance, 0);
37993
38002
  f.push({
37994
- glyphs: p,
38003
+ glyphs: g,
37995
38004
  width: M,
37996
38005
  y: 0
37997
- }), p = D, g = D.reduce((L, Q) => L + Q.xAdvance, 0);
38006
+ }), g = D, p = D.reduce((L, Q) => L + Q.xAdvance, 0);
37998
38007
  } else
37999
38008
  f.push({
38000
- glyphs: p,
38001
- width: g,
38009
+ glyphs: g,
38010
+ width: p,
38002
38011
  y: 0
38003
- }), p = [], g = 0;
38004
- C = -1;
38012
+ }), g = [], p = 0;
38013
+ v = -1;
38005
38014
  }
38006
- p.push(x), g += T, w.has(x.cluster) && (C = S);
38015
+ g.push(C), p += T, w.has(C.cluster) && (v = S);
38007
38016
  }
38008
- p.length > 0 && f.push({
38009
- glyphs: p,
38010
- width: g,
38017
+ g.length > 0 && f.push({
38018
+ glyphs: g,
38019
+ width: p,
38011
38020
  y: 0
38012
38021
  });
38013
- const v = s.lineHeight * i;
38022
+ const x = s.lineHeight * i;
38014
38023
  for (let S = 0; S < f.length; S++)
38015
- f[S].y = (S + 1) * v;
38024
+ f[S].y = (S + 1) * x;
38016
38025
  return f;
38017
38026
  } catch (e) {
38018
38027
  throw e instanceof Error ? e : new Error(`Layout failed: ${String(e)}`);
@@ -38057,37 +38066,37 @@ async function UA(s) {
38057
38066
  }
38058
38067
  l += i + t.top;
38059
38068
  const c = s.style.gradient ? DA(s.style.gradient, 1) : { kind: "solid", color: s.font.color, opacity: s.font.opacity }, d = s.style.gradient ? s.style.gradient.stops[s.style.gradient.stops.length - 1]?.color ?? s.font.color : s.font.color, u = [], f = [];
38060
- let p = 1 / 0, g = 1 / 0, w = -1 / 0, C = -1 / 0;
38061
- for (const v of s.lines) {
38069
+ let g = 1 / 0, p = 1 / 0, w = -1 / 0, v = -1 / 0;
38070
+ for (const x of s.lines) {
38062
38071
  let S;
38063
38072
  switch (s.align.horizontal) {
38064
38073
  case "left":
38065
38074
  S = 0;
38066
38075
  break;
38067
38076
  case "right":
38068
- S = s.textRect.width - v.width;
38077
+ S = s.textRect.width - x.width;
38069
38078
  break;
38070
38079
  case "center":
38071
38080
  default:
38072
- S = (s.textRect.width - v.width) / 2;
38081
+ S = (s.textRect.width - x.width) / 2;
38073
38082
  break;
38074
38083
  }
38075
38084
  S += i + t.left;
38076
- let x = S;
38077
- const T = s.lines.indexOf(v), b = l + T * o;
38085
+ let C = S;
38086
+ const T = s.lines.indexOf(x), b = l + T * o;
38078
38087
  if (s.font.background) {
38079
38088
  const D = s.font.size * 0.15, M = s.font.size * 0.12, L = s.font.size * 0.92 + M * 2, Q = b - s.font.size * 0.78 - M;
38080
38089
  f.push({
38081
38090
  op: "Rectangle",
38082
38091
  x: S - D,
38083
38092
  y: Q,
38084
- width: v.width + D * 2,
38093
+ width: x.width + D * 2,
38085
38094
  height: L,
38086
38095
  fill: { kind: "solid", color: s.font.background, opacity: 1 }
38087
38096
  });
38088
38097
  }
38089
- for (const D of v.glyphs) {
38090
- const M = x + D.xOffset, L = b + D.yOffset, Q = D.fontDesc?.family;
38098
+ for (const D of x.glyphs) {
38099
+ const M = C + D.xOffset, L = b + D.yOffset, Q = D.fontDesc?.family;
38091
38100
  if ((D.isColorEmoji || Q && s.isColorEmojiFont && s.isColorEmojiFont(Q)) && D.char) {
38092
38101
  u.push({
38093
38102
  op: "DrawColorEmoji",
@@ -38096,16 +38105,16 @@ async function UA(s) {
38096
38105
  y: L,
38097
38106
  fontSize: s.font.size,
38098
38107
  fontFamily: Q || "NotoColorEmoji"
38099
- }), x += D.xAdvance;
38108
+ }), C += D.xAdvance;
38100
38109
  continue;
38101
38110
  }
38102
38111
  const q = await s.glyphPathProvider(D.id, D.fontDesc);
38103
38112
  if (!q || q === "M 0 0") {
38104
- x += D.xAdvance;
38113
+ C += D.xAdvance;
38105
38114
  continue;
38106
38115
  }
38107
38116
  const ce = WA(q), re = M + r * ce.x, ve = M + r * (ce.x + ce.w), he = L - r * (ce.y + ce.h), Ce = L - r * ce.y;
38108
- re < p && (p = re), he < g && (g = he), ve > w && (w = ve), Ce > C && (C = Ce), s.shadow && s.shadow.blur > 0 && u.push({
38117
+ re < g && (g = re), he < p && (p = he), ve > w && (w = ve), Ce > v && (v = Ce), s.shadow && s.shadow.blur > 0 && u.push({
38109
38118
  isShadow: !0,
38110
38119
  op: "FillPath",
38111
38120
  path: q,
@@ -38129,13 +38138,13 @@ async function UA(s) {
38129
38138
  y: L,
38130
38139
  scale: r,
38131
38140
  fill: c
38132
- }), x += D.xAdvance;
38141
+ }), C += D.xAdvance;
38133
38142
  }
38134
38143
  if (s.style.textDecoration !== "none") {
38135
38144
  const D = RA(s.style.textDecoration, {
38136
38145
  baselineY: b,
38137
38146
  fontSize: s.font.size,
38138
- lineWidth: v.width,
38147
+ lineWidth: x.width,
38139
38148
  xStart: S
38140
38149
  });
38141
38150
  u.push({
@@ -38148,32 +38157,32 @@ async function UA(s) {
38148
38157
  });
38149
38158
  }
38150
38159
  }
38151
- if (p !== 1 / 0) {
38152
- const v = {
38153
- x: p,
38154
- y: g,
38155
- w: Math.max(1, w - p),
38156
- h: Math.max(1, C - g)
38160
+ if (g !== 1 / 0) {
38161
+ const x = {
38162
+ x: g,
38163
+ y: p,
38164
+ w: Math.max(1, w - g),
38165
+ h: Math.max(1, v - p)
38157
38166
  };
38158
38167
  for (const S of u)
38159
- S.op === "FillPath" && !S.isShadow && (S.gradientBBox = v);
38168
+ S.op === "FillPath" && !S.isShadow && (S.gradientBBox = x);
38160
38169
  }
38161
38170
  if (s.background || s.border) {
38162
- const v = s.contentRect?.width ?? s.canvas.width, S = s.contentRect?.height ?? s.canvas.height, x = s.border?.width ?? 0, T = s.border?.radius ?? 0, b = x / 2, D = s.canvas.width / 2, M = s.canvas.height / 2, L = D - v / 2, Q = M - S / 2, K = Math.min(v - x, S - x) / 2, q = Math.min(T, K), ce = Math.max(0, q - b);
38171
+ const x = s.contentRect?.width ?? s.canvas.width, S = s.contentRect?.height ?? s.canvas.height, C = s.border?.width ?? 0, T = s.border?.radius ?? 0, b = C / 2, D = s.canvas.width / 2, M = s.canvas.height / 2, L = D - x / 2, Q = M - S / 2, K = Math.min(x - C, S - C) / 2, q = Math.min(T, K), ce = Math.max(0, q - b);
38163
38172
  s.background?.color && e.push({
38164
38173
  op: "Rectangle",
38165
- x: L + x,
38166
- y: Q + x,
38167
- width: v - x * 2,
38168
- height: S - x * 2,
38174
+ x: L + C,
38175
+ y: Q + C,
38176
+ width: x - C * 2,
38177
+ height: S - C * 2,
38169
38178
  fill: { kind: "solid", color: s.background.color, opacity: s.background.opacity },
38170
38179
  borderRadius: ce
38171
38180
  }), s.border && s.border.width > 0 && e.push({
38172
38181
  op: "RectangleStroke",
38173
38182
  x: L + b,
38174
38183
  y: Q + b,
38175
- width: v - x,
38176
- height: S - x,
38184
+ width: x - C,
38185
+ height: S - C,
38177
38186
  stroke: {
38178
38187
  width: s.border.width,
38179
38188
  color: s.border.color,
@@ -38202,8 +38211,8 @@ function WA(s) {
38202
38211
  break;
38203
38212
  }
38204
38213
  case "C": {
38205
- const c = parseFloat(e[t++]), d = parseFloat(e[t++]), u = parseFloat(e[t++]), f = parseFloat(e[t++]), p = parseFloat(e[t++]), g = parseFloat(e[t++]);
38206
- o(c, d), o(u, f), o(p, g);
38214
+ const c = parseFloat(e[t++]), d = parseFloat(e[t++]), u = parseFloat(e[t++]), f = parseFloat(e[t++]), g = parseFloat(e[t++]), p = parseFloat(e[t++]);
38215
+ o(c, d), o(u, f), o(g, p);
38207
38216
  break;
38208
38217
  }
38209
38218
  case "Q": {
@@ -38275,14 +38284,14 @@ function qA(s, e, t, i, a, r, n) {
38275
38284
  if (i === "word") {
38276
38285
  const l = Mr(e), c = l.length, d = Math.floor(t * c);
38277
38286
  if (d === 0)
38278
- return s.filter((g) => g.op === "BeginFrame" || g.op === "Rectangle" || g.op === "RectangleStroke");
38287
+ return s.filter((p) => p.op === "BeginFrame" || p.op === "Rectangle" || p.op === "RectangleStroke");
38279
38288
  let u = 0;
38280
- for (let g = 0; g < Math.min(d, l.length); g++)
38281
- u += l[g].glyphCount;
38282
- const f = Hu(s, u), p = t >= $l ? f : f.filter((g) => g.op !== "DecorationLine");
38283
- return t < 1 && u > 0 ? Gu(p, u, a) : p;
38289
+ for (let p = 0; p < Math.min(d, l.length); p++)
38290
+ u += l[p].glyphCount;
38291
+ const f = Hu(s, u), g = t >= $l ? f : f.filter((p) => p.op !== "DecorationLine");
38292
+ return t < 1 && u > 0 ? Gu(g, u, a) : g;
38284
38293
  } else {
38285
- const l = e.reduce((f, p) => f + p.glyphs.length, 0), c = Math.floor(t * l);
38294
+ const l = e.reduce((f, g) => f + g.glyphs.length, 0), c = Math.floor(t * l);
38286
38295
  if (c === 0)
38287
38296
  return s.filter((f) => f.op === "BeginFrame" || f.op === "Rectangle" || f.op === "RectangleStroke");
38288
38297
  const d = Hu(s, c), u = t >= $l ? d : d.filter((f) => f.op !== "DecorationLine");
@@ -38300,21 +38309,21 @@ function YA(s, e, t, i, a, r) {
38300
38309
  for (const d of s)
38301
38310
  if (d.op === "FillPath" || d.op === "StrokePath") {
38302
38311
  let u = -1, f = 0;
38303
- for (let p = 0; p < n.length; p++) {
38304
- const g = n[p].glyphCount;
38305
- if (c >= f && c < f + g) {
38306
- u = p;
38312
+ for (let g = 0; g < n.length; g++) {
38313
+ const p = n[g].glyphCount;
38314
+ if (c >= f && c < f + p) {
38315
+ u = g;
38307
38316
  break;
38308
38317
  }
38309
- f += g;
38318
+ f += p;
38310
38319
  }
38311
38320
  if (u >= 0) {
38312
- const p = u / Math.max(1, o) * (r / r), g = Math.min(1, p + 0.3);
38313
- if (t >= g)
38321
+ const g = u / Math.max(1, o) * (r / r), p = Math.min(1, g + 0.3);
38322
+ if (t >= p)
38314
38323
  l.push(d);
38315
- else if (t > p) {
38316
- const w = (t - p) / Math.max(1e-6, g - p), C = qn(Math.min(1, w)), v = i === "up" ? a * 0.4 : -a * 0.4, S = { ...d, y: d.y + v * (1 - C) };
38317
- d.op === "FillPath" ? S.fill.kind === "solid" ? S.fill = { ...S.fill, opacity: S.fill.opacity * C } : S.fill = { ...S.fill, opacity: (S.fill.opacity ?? 1) * C } : S.opacity = S.opacity * C, l.push(S);
38324
+ else if (t > g) {
38325
+ const w = (t - g) / Math.max(1e-6, p - g), v = qn(Math.min(1, w)), x = i === "up" ? a * 0.4 : -a * 0.4, S = { ...d, y: d.y + x * (1 - v) };
38326
+ d.op === "FillPath" ? S.fill.kind === "solid" ? S.fill = { ...S.fill, opacity: S.fill.opacity * v } : S.fill = { ...S.fill, opacity: (S.fill.opacity ?? 1) * v } : S.opacity = S.opacity * v, l.push(S);
38318
38327
  }
38319
38328
  }
38320
38329
  Co(d) && c++;
@@ -38327,20 +38336,20 @@ function jA(s, e, t, i, a, r, n) {
38327
38336
  right: { x: -a * 0.6, y: 0 },
38328
38337
  up: { x: 0, y: a * 0.6 },
38329
38338
  down: { x: 0, y: -a * 0.6 }
38330
- }[i], d = o ? Mr(e) : [], u = e.reduce((x, T) => x + T.glyphs.length, 0), f = o ? d.length : u;
38339
+ }[i], d = o ? Mr(e) : [], u = e.reduce((C, T) => C + T.glyphs.length, 0), f = o ? d.length : u;
38331
38340
  if (f === 0) return s;
38332
- const p = [];
38333
- for (const x of s)
38334
- if ((x.op === "BeginFrame" || x.op === "Rectangle" || x.op === "RectangleStroke") && p.push(x), x.op === "FillPath" || x.op === "StrokePath")
38341
+ const g = [];
38342
+ for (const C of s)
38343
+ if ((C.op === "BeginFrame" || C.op === "Rectangle" || C.op === "RectangleStroke") && g.push(C), C.op === "FillPath" || C.op === "StrokePath")
38335
38344
  break;
38336
- const g = 0.3, C = n * 0.7 / Math.max(1, f - 1), v = (x) => {
38337
- const T = x * C, b = T / n, D = Math.min(1, (T + g) / n);
38345
+ const p = 0.3, v = n * 0.7 / Math.max(1, f - 1), x = (C) => {
38346
+ const T = C * v, b = T / n, D = Math.min(1, (T + p) / n);
38338
38347
  return { startF: b, endF: D };
38339
38348
  };
38340
38349
  let S = 0;
38341
- for (const x of s) {
38342
- if (x.op !== "FillPath" && x.op !== "StrokePath") {
38343
- x.op === "DecorationLine" && t > 0.8 && p.push(x);
38350
+ for (const C of s) {
38351
+ if (C.op !== "FillPath" && C.op !== "StrokePath") {
38352
+ C.op === "DecorationLine" && t > 0.8 && g.push(C);
38344
38353
  continue;
38345
38354
  }
38346
38355
  let T;
@@ -38358,57 +38367,57 @@ function jA(s, e, t, i, a, r, n) {
38358
38367
  }
38359
38368
  T = Math.max(0, M);
38360
38369
  }
38361
- const { startF: b, endF: D } = v(T);
38370
+ const { startF: b, endF: D } = x(T);
38362
38371
  if (t <= b) {
38363
- const M = { ...x, x: x.x + c.x, y: x.y + c.y };
38364
- x.op === "FillPath" ? M.fill.kind === "solid" ? M.fill = { ...M.fill, opacity: 0 } : M.fill = { ...M.fill, opacity: 0 } : M.opacity = 0, p.push(M);
38372
+ const M = { ...C, x: C.x + c.x, y: C.y + c.y };
38373
+ C.op === "FillPath" ? M.fill.kind === "solid" ? M.fill = { ...M.fill, opacity: 0 } : M.fill = { ...M.fill, opacity: 0 } : M.opacity = 0, g.push(M);
38365
38374
  } else if (t >= D)
38366
- p.push(x);
38375
+ g.push(C);
38367
38376
  else {
38368
- const M = (t - b) / Math.max(1e-6, D - b), L = qn(Math.min(1, M)), Q = c.x * (1 - L), K = c.y * (1 - L), q = { ...x, x: x.x + Q, y: x.y + K };
38369
- if (x.op === "FillPath") {
38377
+ const M = (t - b) / Math.max(1e-6, D - b), L = qn(Math.min(1, M)), Q = c.x * (1 - L), K = c.y * (1 - L), q = { ...C, x: C.x + Q, y: C.y + K };
38378
+ if (C.op === "FillPath") {
38370
38379
  const ce = q.fill.kind === "solid" ? q.fill.opacity : q.fill.opacity ?? 1;
38371
38380
  q.fill.kind === "solid" ? q.fill = { ...q.fill, opacity: ce * L } : q.fill = { ...q.fill, opacity: ce * L };
38372
38381
  } else
38373
38382
  q.opacity = q.opacity * L;
38374
- p.push(q);
38383
+ g.push(q);
38375
38384
  }
38376
- Co(x) && S++;
38385
+ Co(C) && S++;
38377
38386
  }
38378
- return p;
38387
+ return g;
38379
38388
  }
38380
38389
  function XA(s, e, t, i, a, r) {
38381
38390
  const n = i === "word";
38382
38391
  if (!n && !(i === "character")) {
38383
- const v = ec(t), S = 0.95 + 0.05 * v;
38384
- return $A(s, v, S);
38392
+ const x = ec(t), S = 0.95 + 0.05 * x;
38393
+ return $A(s, x, S);
38385
38394
  }
38386
- const l = n ? Mr(e) : [], c = e.reduce((v, S) => v + S.glyphs.length, 0), d = n ? l.length : c;
38395
+ const l = n ? Mr(e) : [], c = e.reduce((x, S) => x + S.glyphs.length, 0), d = n ? l.length : c;
38387
38396
  if (d === 0) return s;
38388
38397
  const u = [];
38389
- for (const v of s)
38390
- if (v.op === "BeginFrame") {
38391
- u.push(v);
38398
+ for (const x of s)
38399
+ if (x.op === "BeginFrame") {
38400
+ u.push(x);
38392
38401
  break;
38393
38402
  }
38394
- const f = 0.3, g = r * 0.7 / Math.max(1, d - 1), w = (v) => {
38395
- const S = v * g, x = S / r, T = Math.min(1, (S + f) / r);
38396
- return { startF: x, endF: T };
38403
+ const f = 0.3, p = r * 0.7 / Math.max(1, d - 1), w = (x) => {
38404
+ const S = x * p, C = S / r, T = Math.min(1, (S + f) / r);
38405
+ return { startF: C, endF: T };
38397
38406
  };
38398
- let C = 0;
38399
- for (const v of s) {
38400
- if (v.op !== "FillPath" && v.op !== "StrokePath") {
38401
- v.op === "DecorationLine" && t > 0.8 && u.push(v);
38407
+ let v = 0;
38408
+ for (const x of s) {
38409
+ if (x.op !== "FillPath" && x.op !== "StrokePath") {
38410
+ x.op === "DecorationLine" && t > 0.8 && u.push(x);
38402
38411
  continue;
38403
38412
  }
38404
38413
  let S;
38405
38414
  if (!n)
38406
- S = C;
38415
+ S = v;
38407
38416
  else {
38408
38417
  let b = -1, D = 0;
38409
38418
  for (let M = 0; M < l.length; M++) {
38410
38419
  const L = l[M].glyphCount;
38411
- if (C >= D && C < D + L) {
38420
+ if (v >= D && v < D + L) {
38412
38421
  b = M;
38413
38422
  break;
38414
38423
  }
@@ -38416,22 +38425,22 @@ function XA(s, e, t, i, a, r) {
38416
38425
  }
38417
38426
  S = Math.max(0, b);
38418
38427
  }
38419
- const { startF: x, endF: T } = w(S);
38420
- if (t <= x) {
38421
- const b = { ...v };
38422
- v.op === "FillPath" ? b.fill.kind === "solid" ? b.fill = { ...b.fill, opacity: 0 } : b.fill = { ...b.fill, opacity: 0 } : b.opacity = 0, u.push(b);
38428
+ const { startF: C, endF: T } = w(S);
38429
+ if (t <= C) {
38430
+ const b = { ...x };
38431
+ x.op === "FillPath" ? b.fill.kind === "solid" ? b.fill = { ...b.fill, opacity: 0 } : b.fill = { ...b.fill, opacity: 0 } : b.opacity = 0, u.push(b);
38423
38432
  } else if (t >= T)
38424
- u.push(v);
38433
+ u.push(x);
38425
38434
  else {
38426
- const b = (t - x) / Math.max(1e-6, T - x), D = ec(Math.min(1, b)), M = { ...v };
38427
- if (v.op === "FillPath") {
38435
+ const b = (t - C) / Math.max(1e-6, T - C), D = ec(Math.min(1, b)), M = { ...x };
38436
+ if (x.op === "FillPath") {
38428
38437
  const L = M.fill.kind === "solid" ? M.fill.opacity : M.fill.opacity ?? 1;
38429
38438
  M.fill.kind === "solid" ? M.fill = { ...M.fill, opacity: L * D } : M.fill = { ...M.fill, opacity: L * D };
38430
38439
  } else
38431
38440
  M.opacity = M.opacity * D;
38432
38441
  u.push(M);
38433
38442
  }
38434
- Co(v) && C++;
38443
+ Co(x) && v++;
38435
38444
  }
38436
38445
  return u;
38437
38446
  }
@@ -38446,32 +38455,32 @@ function KA(s, e, t, i, a, r, n) {
38446
38455
  right: { x: -a * 2, y: 0 },
38447
38456
  up: { x: 0, y: a * 2 },
38448
38457
  down: { x: 0, y: -a * 2 }
38449
- }[i], u = o ? Mr(e) : [], f = e.reduce((T, b) => T + b.glyphs.length, 0), p = o ? u.length : f;
38450
- if (p === 0) return s;
38451
- const g = [];
38458
+ }[i], u = o ? Mr(e) : [], f = e.reduce((T, b) => T + b.glyphs.length, 0), g = o ? u.length : f;
38459
+ if (g === 0) return s;
38460
+ const p = [];
38452
38461
  for (const T of s)
38453
38462
  if (T.op === "BeginFrame") {
38454
- g.push(T);
38463
+ p.push(T);
38455
38464
  break;
38456
38465
  }
38457
- const w = 0.3, v = n * 0.7 / Math.max(1, p - 1), S = (T) => {
38458
- const b = T * v, D = b / n, M = Math.min(1, (b + w) / n);
38466
+ const w = 0.3, x = n * 0.7 / Math.max(1, g - 1), S = (T) => {
38467
+ const b = T * x, D = b / n, M = Math.min(1, (b + w) / n);
38459
38468
  return { startF: D, endF: M };
38460
38469
  };
38461
- let x = 0;
38470
+ let C = 0;
38462
38471
  for (const T of s) {
38463
38472
  if (T.op !== "FillPath" && T.op !== "StrokePath") {
38464
- T.op === "DecorationLine" && t > 0.8 && g.push(T);
38473
+ T.op === "DecorationLine" && t > 0.8 && p.push(T);
38465
38474
  continue;
38466
38475
  }
38467
38476
  let b;
38468
38477
  if (!o)
38469
- b = x;
38478
+ b = C;
38470
38479
  else {
38471
38480
  let L = -1, Q = 0;
38472
38481
  for (let K = 0; K < u.length; K++) {
38473
38482
  const q = u[K].glyphCount;
38474
- if (x >= Q && x < Q + q) {
38483
+ if (C >= Q && C < Q + q) {
38475
38484
  L = K;
38476
38485
  break;
38477
38486
  }
@@ -38482,9 +38491,9 @@ function KA(s, e, t, i, a, r, n) {
38482
38491
  const { startF: D, endF: M } = S(b);
38483
38492
  if (t <= D) {
38484
38493
  const L = { ...T, x: T.x + d.x, y: T.y + d.y };
38485
- T.op === "FillPath" ? L.fill.kind === "solid" ? L.fill = { ...L.fill, opacity: 0 } : L.fill = { ...L.fill, opacity: 0 } : L.opacity = 0, g.push(L);
38494
+ T.op === "FillPath" ? L.fill.kind === "solid" ? L.fill = { ...L.fill, opacity: 0 } : L.fill = { ...L.fill, opacity: 0 } : L.opacity = 0, p.push(L);
38486
38495
  } else if (t >= M)
38487
- g.push(T);
38496
+ p.push(T);
38488
38497
  else {
38489
38498
  const L = (t - D) / Math.max(1e-6, M - D), Q = qn(Math.min(1, L)), K = d.x * (1 - Q), q = d.y * (1 - Q), ce = { ...T, x: T.x + K, y: T.y + q };
38490
38499
  if (T.op === "FillPath") {
@@ -38492,11 +38501,11 @@ function KA(s, e, t, i, a, r, n) {
38492
38501
  ce.fill.kind === "solid" ? ce.fill = { ...ce.fill, opacity: re * Q } : ce.fill = { ...ce.fill, opacity: re * Q };
38493
38502
  } else
38494
38503
  ce.opacity = ce.opacity * Q;
38495
- g.push(ce);
38504
+ p.push(ce);
38496
38505
  }
38497
- Co(T) && x++;
38506
+ Co(T) && C++;
38498
38507
  }
38499
- return g;
38508
+ return p;
38500
38509
  }
38501
38510
  function QA(s, e, t, i) {
38502
38511
  const a = i * 0.3;
@@ -38713,8 +38722,8 @@ function iI(s) {
38713
38722
  e.save();
38714
38723
  const n = Bi(r.stroke.color, r.stroke.opacity);
38715
38724
  if (e.strokeStyle = `rgba(${n.r},${n.g},${n.b},${n.a})`, e.lineWidth = r.stroke.width, r.borderRadius && r.borderRadius > 0) {
38716
- const o = new Path2D(), l = r.x, c = r.y, d = r.width, u = r.height, f = Math.min(d, u) / 2, p = Math.min(r.borderRadius, f);
38717
- o.moveTo(l + p, c), o.arcTo(l + d, c, l + d, c + u, p), o.arcTo(l + d, c + u, l, c + u, p), o.arcTo(l, c + u, l, c, p), o.arcTo(l, c, l + d, c, p), o.closePath(), e.stroke(o);
38725
+ const o = new Path2D(), l = r.x, c = r.y, d = r.width, u = r.height, f = Math.min(d, u) / 2, g = Math.min(r.borderRadius, f);
38726
+ o.moveTo(l + g, c), o.arcTo(l + d, c, l + d, c + u, g), o.arcTo(l + d, c + u, l, c + u, g), o.arcTo(l, c + u, l, c, g), o.arcTo(l, c, l + d, c, g), o.closePath(), e.stroke(o);
38718
38727
  } else
38719
38728
  e.strokeRect(r.x, r.y, r.width, r.height);
38720
38729
  e.restore();
@@ -38825,8 +38834,8 @@ function s0(s) {
38825
38834
  break;
38826
38835
  }
38827
38836
  case "C": {
38828
- const c = parseFloat(e[t++]), d = parseFloat(e[t++]), u = parseFloat(e[t++]), f = parseFloat(e[t++]), p = parseFloat(e[t++]), g = parseFloat(e[t++]);
38829
- o(c, d), o(u, f), o(p, g);
38837
+ const c = parseFloat(e[t++]), d = parseFloat(e[t++]), u = parseFloat(e[t++]), f = parseFloat(e[t++]), g = parseFloat(e[t++]), p = parseFloat(e[t++]);
38838
+ o(c, d), o(u, f), o(g, p);
38830
38839
  break;
38831
38840
  }
38832
38841
  case "Q": {
@@ -38967,20 +38976,20 @@ function dI(s, e, t) {
38967
38976
  const i = Kt(s.width, e), a = Kt(s.height, t), r = fI(s.shape), n = kI(r), o = i / 2, l = a / 2, c = n.x + n.w / 2, d = n.y + n.h / 2;
38968
38977
  let u = o - c, f = l - d;
38969
38978
  s.transform && (u += Kt(s.transform.x, 0), f += Kt(s.transform.y, 0));
38970
- const p = [];
38979
+ const g = [];
38971
38980
  if (s.shadow) {
38972
- const w = Kt(s.shadow.offsetX, 4), C = Kt(s.shadow.offsetY, 4), v = s.shadow.color ?? "#000000", S = Kt(s.shadow.opacity, 0.5);
38973
- p.push(
38974
- `<path d="${r}" transform="translate(${u + w}, ${f + C})" fill="${v}" fill-opacity="${S}"/>`
38981
+ const w = Kt(s.shadow.offsetX, 4), v = Kt(s.shadow.offsetY, 4), x = s.shadow.color ?? "#000000", S = Kt(s.shadow.opacity, 0.5);
38982
+ g.push(
38983
+ `<path d="${r}" transform="translate(${u + w}, ${f + v})" fill="${x}" fill-opacity="${S}"/>`
38975
38984
  );
38976
38985
  }
38977
- const g = [`d="${r}"`, `transform="translate(${u}, ${f})"`];
38986
+ const p = [`d="${r}"`, `transform="translate(${u}, ${f})"`];
38978
38987
  if (s.fill) {
38979
- const w = `fill-${Date.now()}`, C = uI(s.fill, w);
38980
- C.defs && p.unshift(C.defs), g.push(`fill="${C.fill}"`), s.fill.opacity !== void 0 && s.fill.opacity !== 1 && g.push(`fill-opacity="${s.fill.opacity}"`);
38988
+ const w = `fill-${Date.now()}`, v = uI(s.fill, w);
38989
+ v.defs && g.unshift(v.defs), p.push(`fill="${v.fill}"`), s.fill.opacity !== void 0 && s.fill.opacity !== 1 && p.push(`fill-opacity="${s.fill.opacity}"`);
38981
38990
  } else
38982
- g.push('fill="none"');
38983
- return s.stroke && s.stroke.width && Kt(s.stroke.width, 0) > 0 && (g.push(`stroke="${s.stroke.color ?? "#000000"}"`), g.push(`stroke-width="${s.stroke.width}"`), s.stroke.opacity !== void 0 && s.stroke.opacity !== 1 && g.push(`stroke-opacity="${s.stroke.opacity}"`), s.stroke.dashArray && s.stroke.dashArray.length > 0 && g.push(`stroke-dasharray="${s.stroke.dashArray.join(" ")}"`), s.stroke.lineCap && g.push(`stroke-linecap="${s.stroke.lineCap}"`), s.stroke.lineJoin && g.push(`stroke-linejoin="${s.stroke.lineJoin}"`)), s.opacity !== void 0 && s.opacity !== 1 && g.push(`opacity="${s.opacity}"`), p.push(`<path ${g.join(" ")}/>`), `<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${a}" viewBox="0 0 ${i} ${a}">${p.join(
38991
+ p.push('fill="none"');
38992
+ return s.stroke && s.stroke.width && Kt(s.stroke.width, 0) > 0 && (p.push(`stroke="${s.stroke.color ?? "#000000"}"`), p.push(`stroke-width="${s.stroke.width}"`), s.stroke.opacity !== void 0 && s.stroke.opacity !== 1 && p.push(`stroke-opacity="${s.stroke.opacity}"`), s.stroke.dashArray && s.stroke.dashArray.length > 0 && p.push(`stroke-dasharray="${s.stroke.dashArray.join(" ")}"`), s.stroke.lineCap && p.push(`stroke-linecap="${s.stroke.lineCap}"`), s.stroke.lineJoin && p.push(`stroke-linejoin="${s.stroke.lineJoin}"`)), s.opacity !== void 0 && s.opacity !== 1 && p.push(`opacity="${s.opacity}"`), g.push(`<path ${p.join(" ")}/>`), `<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${a}" viewBox="0 0 ${i} ${a}">${g.join(
38984
38993
  ""
38985
38994
  )}</svg>`;
38986
38995
  }
@@ -39161,8 +39170,8 @@ function kI(s) {
39161
39170
  const e = /-?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g, t = [];
39162
39171
  let i;
39163
39172
  for (; (i = e.exec(s)) !== null; ) {
39164
- const p = parseFloat(i[0]);
39165
- !isNaN(p) && isFinite(p) && t.push(p);
39173
+ const g = parseFloat(i[0]);
39174
+ !isNaN(g) && isFinite(g) && t.push(g);
39166
39175
  }
39167
39176
  if (t.length < 2)
39168
39177
  return { x: 0, y: 0, w: 0, h: 0 };
@@ -39195,32 +39204,32 @@ function kI(s) {
39195
39204
  break;
39196
39205
  case "C":
39197
39206
  if (f + 5 < t.length)
39198
- for (let g = 0; g < 3; g++) {
39199
- const w = t[f++], C = t[f++];
39200
- a = Math.min(a, w), n = Math.max(n, w), r = Math.min(r, C), o = Math.max(o, C), g === 2 && (l = w, c = C);
39207
+ for (let p = 0; p < 3; p++) {
39208
+ const w = t[f++], v = t[f++];
39209
+ a = Math.min(a, w), n = Math.max(n, w), r = Math.min(r, v), o = Math.max(o, v), p === 2 && (l = w, c = v);
39201
39210
  }
39202
39211
  break;
39203
39212
  case "c":
39204
39213
  if (f + 5 < t.length)
39205
- for (let g = 0; g < 3; g++) {
39206
- const w = l + t[f++], C = c + t[f++];
39207
- a = Math.min(a, w), n = Math.max(n, w), r = Math.min(r, C), o = Math.max(o, C), g === 2 && (l = w, c = C);
39214
+ for (let p = 0; p < 3; p++) {
39215
+ const w = l + t[f++], v = c + t[f++];
39216
+ a = Math.min(a, w), n = Math.max(n, w), r = Math.min(r, v), o = Math.max(o, v), p === 2 && (l = w, c = v);
39208
39217
  }
39209
39218
  break;
39210
39219
  case "S":
39211
39220
  case "Q":
39212
39221
  if (f + 3 < t.length)
39213
- for (let g = 0; g < 2; g++) {
39214
- const w = t[f++], C = t[f++];
39215
- a = Math.min(a, w), n = Math.max(n, w), r = Math.min(r, C), o = Math.max(o, C), g === 1 && (l = w, c = C);
39222
+ for (let p = 0; p < 2; p++) {
39223
+ const w = t[f++], v = t[f++];
39224
+ a = Math.min(a, w), n = Math.max(n, w), r = Math.min(r, v), o = Math.max(o, v), p === 1 && (l = w, c = v);
39216
39225
  }
39217
39226
  break;
39218
39227
  case "s":
39219
39228
  case "q":
39220
39229
  if (f + 3 < t.length)
39221
- for (let g = 0; g < 2; g++) {
39222
- const w = l + t[f++], C = c + t[f++];
39223
- a = Math.min(a, w), n = Math.max(n, w), r = Math.min(r, C), o = Math.max(o, C), g === 1 && (l = w, c = C);
39230
+ for (let p = 0; p < 2; p++) {
39231
+ const w = l + t[f++], v = c + t[f++];
39232
+ a = Math.min(a, w), n = Math.max(n, w), r = Math.min(r, v), o = Math.max(o, v), p === 1 && (l = w, c = v);
39224
39233
  }
39225
39234
  break;
39226
39235
  case "A":
@@ -39271,80 +39280,80 @@ function AI(s) {
39271
39280
  var ju = "https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxP.ttf";
39272
39281
  async function II(s = {}) {
39273
39282
  const e = s.width ?? Ct.DEFAULTS.width, t = s.height ?? Ct.DEFAULTS.height, i = s.pixelRatio ?? Ct.DEFAULTS.pixelRatio, a = "https://shotstack-ingest-api-dev-sources.s3.ap-southeast-2.amazonaws.com/euo5r93oyr/zzz01k9h-yycyx-2x2y6-qx9bj-7n567b/source.wasm";
39274
- Wu.setFallbackLoader(async (g) => {
39275
- const w = (g.family ?? "Roboto").toLowerCase(), C = `${g.weight ?? "400"}`;
39276
- if (w === "roboto" && C === "400")
39283
+ Wu.setFallbackLoader(async (p) => {
39284
+ const w = (p.family ?? "Roboto").toLowerCase(), v = `${p.weight ?? "400"}`;
39285
+ if (w === "roboto" && v === "400")
39277
39286
  return sn(ju);
39278
39287
  });
39279
39288
  let r;
39280
39289
  try {
39281
39290
  r = await Wu.getSharedInstance(a);
39282
- } catch (g) {
39291
+ } catch (p) {
39283
39292
  throw new Error(
39284
- `Failed to initialize font registry: ${g instanceof Error ? g.message : String(g)}`
39293
+ `Failed to initialize font registry: ${p instanceof Error ? p.message : String(p)}`
39285
39294
  );
39286
39295
  }
39287
- const n = new OA(r), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), c = (g) => `${g ?? "400"}`, d = (g, w) => `${g}__${c(w)}`, u = async (g, w) => {
39288
- const C = {
39296
+ const n = new OA(r), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), c = (p) => `${p ?? "400"}`, d = (p, w) => `${p}__${c(w)}`, u = async (p, w) => {
39297
+ const v = {
39289
39298
  family: w.family,
39290
39299
  weight: c(w.weight)
39291
- }, v = `${g}|${d(C.family, C.weight)}`, S = l.get(v);
39300
+ }, x = `${p}|${d(v.family, v.weight)}`, S = l.get(x);
39292
39301
  if (S)
39293
39302
  return S;
39294
- const x = (async () => {
39295
- if (r.hasRegisteredFace(C))
39303
+ const C = (async () => {
39304
+ if (r.hasRegisteredFace(v))
39296
39305
  return;
39297
- const T = await sn(g);
39298
- await r.registerFromBytes(T, C);
39306
+ const T = await sn(p);
39307
+ await r.registerFromBytes(T, v);
39299
39308
  })();
39300
- return l.set(v, x), x;
39301
- }, f = async (g) => {
39309
+ return l.set(x, C), C;
39310
+ }, f = async (p) => {
39302
39311
  const w = {
39303
- family: g.family,
39304
- weight: c(g.weight)
39305
- }, C = `${g.src}|${d(w.family, w.weight)}`, v = o.get(C);
39306
- if (v)
39307
- return v;
39312
+ family: p.family,
39313
+ weight: c(p.weight)
39314
+ }, v = `${p.src}|${d(w.family, w.weight)}`, x = o.get(v);
39315
+ if (x)
39316
+ return x;
39308
39317
  const S = (async () => {
39309
39318
  if (r.hasRegisteredFace(w))
39310
39319
  return;
39311
- const x = await sn(g.src);
39312
- await r.registerFromBytes(x, w);
39320
+ const C = await sn(p.src);
39321
+ await r.registerFromBytes(C, w);
39313
39322
  })();
39314
- return o.set(C, S), S;
39323
+ return o.set(v, S), S;
39315
39324
  };
39316
- async function p(g) {
39325
+ async function g(p) {
39317
39326
  try {
39318
- if (g.customFonts)
39319
- for (const S of g.customFonts)
39327
+ if (p.customFonts)
39328
+ for (const S of p.customFonts)
39320
39329
  try {
39321
39330
  await f(S);
39322
- } catch (x) {
39331
+ } catch (C) {
39323
39332
  throw new Error(
39324
- `Failed to load custom font "${S.family}" from ${S.src}: ${x instanceof Error ? x.message : String(x)}`
39333
+ `Failed to load custom font "${S.family}" from ${S.src}: ${C instanceof Error ? C.message : String(C)}`
39325
39334
  );
39326
39335
  }
39327
- const w = g.font ?? {
39336
+ const w = p.font ?? {
39328
39337
  family: "Roboto",
39329
39338
  weight: "400",
39330
39339
  size: 48,
39331
39340
  color: "#000000",
39332
39341
  opacity: 1
39333
- }, C = { family: w.family, weight: `${w.weight}` };
39342
+ }, v = { family: w.family, weight: `${w.weight}` };
39334
39343
  return await (async () => {
39335
39344
  try {
39336
- await r.getFace(C);
39345
+ await r.getFace(v);
39337
39346
  } catch {
39338
39347
  if ((w.family || "Roboto").toLowerCase() === "roboto" && `${w.weight}` == "400") {
39339
39348
  if (!r.hasRegisteredFace({ family: "Roboto", weight: "400" })) {
39340
- const x = await sn(ju);
39341
- await r.registerFromBytes(x, {
39349
+ const C = await sn(ju);
39350
+ await r.registerFromBytes(C, {
39342
39351
  family: "Roboto",
39343
39352
  weight: "400"
39344
39353
  });
39345
39354
  }
39346
39355
  } else
39347
- throw new Error(`Font not registered for ${C.family}__${C.weight}`);
39356
+ throw new Error(`Font not registered for ${v.family}__${v.weight}`);
39348
39357
  }
39349
39358
  })(), w;
39350
39359
  } catch (w) {
@@ -39352,54 +39361,54 @@ async function II(s = {}) {
39352
39361
  }
39353
39362
  }
39354
39363
  return {
39355
- validate(g) {
39356
- const w = PA.safeParse(g);
39364
+ validate(p) {
39365
+ const w = PA.safeParse(p);
39357
39366
  if (!w.success) {
39358
- const C = w.error.issues.map((v) => v.message).join(". ");
39359
- throw new Error(`Validation failed: ${C}`);
39367
+ const v = w.error.issues.map((x) => x.message).join(". ");
39368
+ throw new Error(`Validation failed: ${v}`);
39360
39369
  }
39361
39370
  return { value: w.data };
39362
39371
  },
39363
- async registerFontFromUrl(g, w) {
39372
+ async registerFontFromUrl(p, w) {
39364
39373
  try {
39365
- await u(g, w);
39366
- } catch (C) {
39374
+ await u(p, w);
39375
+ } catch (v) {
39367
39376
  throw new Error(
39368
- `Failed to register font "${w.family}" from URL ${g}: ${C instanceof Error ? C.message : String(C)}`
39377
+ `Failed to register font "${w.family}" from URL ${p}: ${v instanceof Error ? v.message : String(v)}`
39369
39378
  );
39370
39379
  }
39371
39380
  },
39372
- async registerFontFromFile(g, w) {
39381
+ async registerFontFromFile(p, w) {
39373
39382
  try {
39374
- let C;
39375
- if (typeof g == "string") {
39376
- await u(g, w);
39383
+ let v;
39384
+ if (typeof p == "string") {
39385
+ await u(p, w);
39377
39386
  return;
39378
39387
  } else
39379
39388
  try {
39380
- C = await g.arrayBuffer();
39389
+ v = await p.arrayBuffer();
39381
39390
  } catch (S) {
39382
39391
  throw new Error(
39383
39392
  `Failed to read Blob as ArrayBuffer: ${S instanceof Error ? S.message : String(S)}`
39384
39393
  );
39385
39394
  }
39386
- const v = {
39395
+ const x = {
39387
39396
  family: w.family,
39388
39397
  weight: c(w.weight)
39389
39398
  };
39390
- if (r.hasRegisteredFace(v))
39399
+ if (r.hasRegisteredFace(x))
39391
39400
  return;
39392
- await r.registerFromBytes(C, v);
39393
- } catch (C) {
39394
- throw C instanceof Error ? C : new Error(
39395
- `Failed to register font "${w.family}" from ${typeof g == "string" ? g : "Blob"}: ${String(C)}`
39401
+ await r.registerFromBytes(v, x);
39402
+ } catch (v) {
39403
+ throw v instanceof Error ? v : new Error(
39404
+ `Failed to register font "${w.family}" from ${typeof p == "string" ? p : "Blob"}: ${String(v)}`
39396
39405
  );
39397
39406
  }
39398
39407
  },
39399
- async renderFrame(g, w, C) {
39408
+ async renderFrame(p, w, v) {
39400
39409
  try {
39401
- const v = await p(g), S = { family: v.family, weight: `${v.weight}` };
39402
- let x;
39410
+ const x = await g(p), S = { family: x.family, weight: `${x.weight}` };
39411
+ let C;
39403
39412
  try {
39404
39413
  let re;
39405
39414
  const ve = r.getColorEmojiFontFamilies();
@@ -39412,20 +39421,20 @@ async function II(s = {}) {
39412
39421
  } catch {
39413
39422
  }
39414
39423
  }
39415
- const he = g.padding ? typeof g.padding == "number" ? {
39416
- top: g.padding,
39417
- right: g.padding,
39418
- bottom: g.padding,
39419
- left: g.padding
39420
- } : g.padding : { top: 0, right: 0, bottom: 0, left: 0 };
39421
- x = await n.layout({
39422
- text: g.text,
39423
- width: (g.width ?? e) - he.left - he.right,
39424
- letterSpacing: g.style?.letterSpacing ?? 0,
39425
- fontSize: v.size,
39426
- lineHeight: g.style?.lineHeight ?? 1.2,
39424
+ const he = p.padding ? typeof p.padding == "number" ? {
39425
+ top: p.padding,
39426
+ right: p.padding,
39427
+ bottom: p.padding,
39428
+ left: p.padding
39429
+ } : p.padding : { top: 0, right: 0, bottom: 0, left: 0 };
39430
+ C = await n.layout({
39431
+ text: p.text,
39432
+ width: (p.width ?? e) - he.left - he.right,
39433
+ letterSpacing: p.style?.letterSpacing ?? 0,
39434
+ fontSize: x.size,
39435
+ lineHeight: p.style?.lineHeight ?? 1.2,
39427
39436
  desc: S,
39428
- textTransform: g.style?.textTransform ?? "none",
39437
+ textTransform: p.style?.textTransform ?? "none",
39429
39438
  emojiFallback: re
39430
39439
  });
39431
39440
  } catch (re) {
@@ -39433,46 +39442,46 @@ async function II(s = {}) {
39433
39442
  `Failed to layout text: ${re instanceof Error ? re.message : String(re)}`
39434
39443
  );
39435
39444
  }
39436
- const T = g.padding ? typeof g.padding == "number" ? {
39437
- top: g.padding,
39438
- right: g.padding,
39439
- bottom: g.padding,
39440
- left: g.padding
39441
- } : g.padding : { top: 0, right: 0, bottom: 0, left: 0 }, b = g.border?.width ?? 0, D = (g.width ?? e) + b * 2, M = (g.height ?? t) + b * 2, L = i, Q = {
39445
+ const T = p.padding ? typeof p.padding == "number" ? {
39446
+ top: p.padding,
39447
+ right: p.padding,
39448
+ bottom: p.padding,
39449
+ left: p.padding
39450
+ } : p.padding : { top: 0, right: 0, bottom: 0, left: 0 }, b = p.border?.width ?? 0, D = (p.width ?? e) + b * 2, M = (p.height ?? t) + b * 2, L = i, Q = {
39442
39451
  x: 0,
39443
39452
  y: 0,
39444
- width: (g.width ?? e) - T.left - T.right,
39445
- height: (g.height ?? t) - T.top - T.bottom
39446
- }, K = g.width ?? e, q = g.height ?? t;
39453
+ width: (p.width ?? e) - T.left - T.right,
39454
+ height: (p.height ?? t) - T.top - T.bottom
39455
+ }, K = p.width ?? e, q = p.height ?? t;
39447
39456
  let ce;
39448
39457
  try {
39449
39458
  ce = await UA({
39450
39459
  canvas: { width: D, height: M, pixelRatio: L },
39451
39460
  textRect: Q,
39452
- lines: x,
39461
+ lines: C,
39453
39462
  contentRect: { width: K, height: q },
39454
39463
  font: {
39455
- family: v.family,
39456
- size: v.size,
39457
- weight: `${v.weight}`,
39458
- color: v.color,
39459
- opacity: v.opacity,
39460
- background: v.background
39464
+ family: x.family,
39465
+ size: x.size,
39466
+ weight: `${x.weight}`,
39467
+ color: x.color,
39468
+ opacity: x.opacity,
39469
+ background: x.background
39461
39470
  },
39462
39471
  style: {
39463
- lineHeight: g.style?.lineHeight ?? 1.2,
39464
- textDecoration: g.style?.textDecoration ?? "none",
39465
- gradient: g.style?.gradient
39472
+ lineHeight: p.style?.lineHeight ?? 1.2,
39473
+ textDecoration: p.style?.textDecoration ?? "none",
39474
+ gradient: p.style?.gradient
39466
39475
  },
39467
- stroke: g.stroke,
39468
- shadow: g.shadow,
39476
+ stroke: p.stroke,
39477
+ shadow: p.shadow,
39469
39478
  align: {
39470
- horizontal: g.align?.horizontal ?? "center",
39471
- vertical: g.align?.vertical ?? "middle"
39479
+ horizontal: p.align?.horizontal ?? "center",
39480
+ vertical: p.align?.vertical ?? "middle"
39472
39481
  },
39473
- background: g.background,
39474
- border: g.border,
39475
- padding: g.padding,
39482
+ background: p.background,
39483
+ border: p.border,
39484
+ padding: p.padding,
39476
39485
  glyphPathProvider: (re, ve) => r.glyphPath(ve || S, re),
39477
39486
  getUnitsPerEm: (re) => r.getUnitsPerEm(re || S),
39478
39487
  isColorEmojiFont: (re) => r.isColorEmojiFont(re)
@@ -39483,16 +39492,16 @@ async function II(s = {}) {
39483
39492
  );
39484
39493
  }
39485
39494
  try {
39486
- return HA(ce, x, {
39495
+ return HA(ce, C, {
39487
39496
  t: w,
39488
- fontSize: v.size,
39489
- clipDuration: C,
39490
- anim: g.animation ? {
39491
- preset: g.animation.preset,
39492
- speed: g.animation.speed,
39493
- duration: g.animation.duration,
39494
- style: g.animation.style,
39495
- direction: g.animation.direction
39497
+ fontSize: x.size,
39498
+ clipDuration: v,
39499
+ anim: p.animation ? {
39500
+ preset: p.animation.preset,
39501
+ speed: p.animation.speed,
39502
+ duration: p.animation.duration,
39503
+ style: p.animation.style,
39504
+ direction: p.animation.direction
39496
39505
  } : void 0
39497
39506
  });
39498
39507
  } catch (re) {
@@ -39500,13 +39509,13 @@ async function II(s = {}) {
39500
39509
  `Failed to apply animation: ${re instanceof Error ? re.message : String(re)}`
39501
39510
  );
39502
39511
  }
39503
- } catch (v) {
39504
- throw v instanceof Error ? v : new Error(`Failed to render frame at time ${w}s: ${String(v)}`);
39512
+ } catch (x) {
39513
+ throw x instanceof Error ? x : new Error(`Failed to render frame at time ${w}s: ${String(x)}`);
39505
39514
  }
39506
39515
  },
39507
- createRenderer(g) {
39516
+ createRenderer(p) {
39508
39517
  try {
39509
- return iI(g);
39518
+ return iI(p);
39510
39519
  } catch (w) {
39511
39520
  throw new Error(
39512
39521
  `Failed to create renderer: ${w instanceof Error ? w.message : String(w)}`
@@ -39516,8 +39525,8 @@ async function II(s = {}) {
39516
39525
  destroy() {
39517
39526
  try {
39518
39527
  r.release();
39519
- } catch (g) {
39520
- console.error(`Error during cleanup: ${g instanceof Error ? g.message : String(g)}`);
39528
+ } catch (p) {
39529
+ console.error(`Error during cleanup: ${p instanceof Error ? p.message : String(p)}`);
39521
39530
  }
39522
39531
  }
39523
39532
  };
@@ -39558,23 +39567,23 @@ class ws extends Dt {
39558
39567
  return typeof i == "string" ? parseInt(i, 10) || t : typeof i == "number" ? i : t;
39559
39568
  }
39560
39569
  buildCanvasPayload(e, t) {
39561
- const i = this.clipConfiguration.width || this.edit.size.width, a = this.clipConfiguration.height || this.edit.size.height, r = e.font?.family, { baseFontFamily: n, fontWeight: o } = t ?? (r ? cs(r) : { baseFontFamily: r, fontWeight: 400 }), l = this.resolveFontWeight(e, o), c = this.edit.getTimelineFonts(), d = r ? c.find((g) => {
39562
- const { full: w, base: C } = Xu(g.src), v = r.toLowerCase();
39563
- return w.toLowerCase() === v || C.toLowerCase() === v;
39570
+ const i = this.clipConfiguration.width || this.edit.size.width, a = this.clipConfiguration.height || this.edit.size.height, r = e.font?.family, { baseFontFamily: n, fontWeight: o } = t ?? (r ? cs(r) : { baseFontFamily: r, fontWeight: 400 }), l = this.resolveFontWeight(e, o), c = this.edit.getTimelineFonts(), d = r ? c.find((p) => {
39571
+ const { full: w, base: v } = Xu(p.src), x = r.toLowerCase();
39572
+ return w.toLowerCase() === x || v.toLowerCase() === x;
39564
39573
  }) : void 0;
39565
39574
  let u;
39566
39575
  if (d && r)
39567
39576
  u = [{ src: d.src, family: n || r, weight: l.toString() }];
39568
39577
  else if (r) {
39569
- const g = this.edit.getFontMetadata(), w = (n || r).toLowerCase(), v = c.filter((S) => !TI(S.src)).find((S) => g.get(S.src)?.baseFamilyName.toLowerCase() === w);
39570
- v && (u = [{ src: v.src, family: n || r, weight: l.toString() }]);
39578
+ const p = this.edit.getFontMetadata(), w = (n || r).toLowerCase(), x = c.filter((S) => !TI(S.src)).find((S) => p.get(S.src)?.baseFamilyName.toLowerCase() === w);
39579
+ x && (u = [{ src: x.src, family: n || r, weight: l.toString() }]);
39571
39580
  }
39572
- const p = u || r && Sn(r) ? n || r : void 0;
39581
+ const g = u || r && Sn(r) ? n || r : void 0;
39573
39582
  return {
39574
39583
  ...e,
39575
39584
  width: i,
39576
39585
  height: a,
39577
- font: e.font ? { ...e.font, family: p || "Roboto", weight: l } : void 0,
39586
+ font: e.font ? { ...e.font, family: g || "Roboto", weight: l } : void 0,
39578
39587
  stroke: e.font?.stroke,
39579
39588
  ...u && { customFonts: u }
39580
39589
  };
@@ -39696,21 +39705,21 @@ class ws extends Dt {
39696
39705
  try {
39697
39706
  const i = this.getLength(), a = await this.textEngine.renderFrame(this.validatedAsset, e, i), r = this.canvas.getContext("2d");
39698
39707
  r && r.clearRect(0, 0, this.canvas.width, this.canvas.height), await this.renderer.render(a);
39699
- const n = G.Texture.from(this.canvas);
39700
- this.sprite ? (this.texture && !this.cachedFrames.has(t) && this.texture.destroy(), this.sprite.texture = n) : (this.sprite = new G.Sprite(n), this.contentContainer.addChild(this.sprite)), this.texture = n, this.cachedFrames.size < 150 && this.cachedFrames.set(t, n), this.lastRenderedTime = e;
39708
+ const n = H.Texture.from(this.canvas);
39709
+ this.sprite ? (this.texture && !this.cachedFrames.has(t) && this.texture.destroy(), this.sprite.texture = n) : (this.sprite = new H.Sprite(n), this.contentContainer.addChild(this.sprite)), this.texture = n, this.cachedFrames.size < 150 && this.cachedFrames.set(t, n), this.lastRenderedTime = e;
39701
39710
  } catch (i) {
39702
39711
  console.error("Failed to render rich text frame:", i);
39703
39712
  }
39704
39713
  }
39705
39714
  createFallbackText(e) {
39706
- const t = this.edit.getEdit(), i = this.clipConfiguration.width || t?.output?.size?.width || this.edit.size.width, a = this.clipConfiguration.height || t?.output?.size?.height || this.edit.size.height, r = new G.TextStyle({
39715
+ const t = this.edit.getEdit(), i = this.clipConfiguration.width || t?.output?.size?.width || this.edit.size.width, a = this.clipConfiguration.height || t?.output?.size?.height || this.edit.size.height, r = new H.TextStyle({
39707
39716
  fontFamily: e.font?.family || "Arial",
39708
39717
  fontSize: e.font?.size || 48,
39709
39718
  fill: e.font?.color || "#ffffff",
39710
39719
  align: e.align?.horizontal || "center",
39711
39720
  wordWrap: !0,
39712
39721
  wordWrapWidth: i
39713
- }), n = new G.Text(e.text, r);
39722
+ }), n = new H.Text(e.text, r);
39714
39723
  switch (e.align?.horizontal) {
39715
39724
  case "left":
39716
39725
  n.anchor.set(0, 0.5), n.x = 0;
@@ -39814,9 +39823,9 @@ class EI extends Dt {
39814
39823
  }
39815
39824
  async load() {
39816
39825
  await super.load();
39817
- const e = this.clipConfiguration.asset, t = new G.Graphics(), i = e.width ?? this.edit.size.width, a = e.height ?? this.edit.size.height;
39826
+ const e = this.clipConfiguration.asset, t = new H.Graphics(), i = e.width ?? this.edit.size.width, a = e.height ?? this.edit.size.height;
39818
39827
  t.fillStyle = { color: "transparent" }, t.rect(0, 0, i, a), t.fill();
39819
- const r = new G.Graphics();
39828
+ const r = new H.Graphics();
39820
39829
  switch (e.shape) {
39821
39830
  case "rectangle": {
39822
39831
  const n = e.rectangle, o = i / 2 - n.width / 2, l = a / 2 - n.height / 2;
@@ -39956,7 +39965,7 @@ class Ds extends Dt {
39956
39965
  const r = new Blob([a.png], { type: "image/png" }), n = URL.createObjectURL(r), o = new Image();
39957
39966
  o.src = n, await new Promise((l, c) => {
39958
39967
  o.onload = () => l(), o.onerror = () => c(new Error("Failed to load SVG image"));
39959
- }), URL.revokeObjectURL(n), this.texture = G.Texture.from(o), this.sprite = new G.Sprite(this.texture), this.contentContainer.addChild(this.sprite), this.clipConfiguration.width && this.clipConfiguration.height && this.applyFixedDimensions();
39968
+ }), URL.revokeObjectURL(n), this.texture = H.Texture.from(o), this.sprite = new H.Sprite(this.texture), this.contentContainer.addChild(this.sprite), this.clipConfiguration.width && this.clipConfiguration.height && this.applyFixedDimensions();
39960
39969
  }
39961
39970
  }
39962
39971
  class or {
@@ -40035,7 +40044,7 @@ class or {
40035
40044
  }
40036
40045
  createCursor() {
40037
40046
  if (!this.textElement) return;
40038
- this.cursor = new G.Graphics(), this.cursor.fillStyle = { color: this.color };
40047
+ this.cursor = new H.Graphics(), this.cursor.fillStyle = { color: this.color };
40039
40048
  const e = this.textElement.style.fontSize;
40040
40049
  this.cursor.rect(0, 0, this.width, e), this.cursor.fill(), this.parent.addChild(this.cursor), this.cursor.visible = this.isVisible;
40041
40050
  }
@@ -40056,14 +40065,14 @@ class or {
40056
40065
  c.length > 0 && c.endsWith(" ") ? d = this.measureText(`${c}x`, t) - this.measureText("x", t) : d = this.measureText(c, t);
40057
40066
  const u = t.lineHeight;
40058
40067
  this.pixelY = this.currentLine * u;
40059
- const p = this.clipConfig.asset.alignment?.horizontal ?? "center";
40060
- let g = d;
40061
- if (p !== "left") {
40062
- const w = this.measureText(n, t), C = this.textElement.width;
40063
- let v = 0;
40064
- p === "center" ? v = (C - w) / 2 : p === "right" && (v = C - w), g = v + d;
40068
+ const g = this.clipConfig.asset.alignment?.horizontal ?? "center";
40069
+ let p = d;
40070
+ if (g !== "left") {
40071
+ const w = this.measureText(n, t), v = this.textElement.width;
40072
+ let x = 0;
40073
+ g === "center" ? x = (v - w) / 2 : g === "right" && (x = v - w), p = x + d;
40065
40074
  }
40066
- this.pixelX = g;
40075
+ this.pixelX = p;
40067
40076
  }
40068
40077
  updateGraphicsPosition() {
40069
40078
  this.cursor && this.cursor.position.set(this.pixelX, this.pixelY);
@@ -40077,7 +40086,7 @@ class or {
40077
40086
  this.blinkInterval !== null && (window.clearInterval(this.blinkInterval), this.blinkInterval = null), this.isBlinking = !1, this.cursor && (this.cursor.visible = this.isVisible);
40078
40087
  }
40079
40088
  measureText(e, t) {
40080
- const i = new G.Text(e, t), { width: a } = i;
40089
+ const i = new H.Text(e, t), { width: a } = i;
40081
40090
  return i.destroy(), a;
40082
40091
  }
40083
40092
  isInitialized() {
@@ -40304,14 +40313,14 @@ class vs {
40304
40313
  this.setupEditingContainer(), this.editingContainer && this.editableText && (this.textCursor = new or(this.editingContainer, this.editableText, this.clipConfig), this.textCursor.updatePosition(this.targetText.text.length), this.textCursor.startBlinking()), this.setupTextInputHandler(), this.updateTextAlignment();
40305
40314
  }
40306
40315
  setupEditingContainer() {
40307
- this.editingContainer = new G.Container(), this.parent.getContainer().addChild(this.editingContainer);
40308
- const e = new G.Graphics();
40316
+ this.editingContainer = new H.Container(), this.parent.getContainer().addChild(this.editingContainer);
40317
+ const e = new H.Graphics();
40309
40318
  e.fillStyle = { color: 0, alpha: vs.EDITING_BG_ALPHA }, e.rect(
40310
40319
  -5,
40311
40320
  -5,
40312
40321
  this.targetText.width + 2 * vs.EDITING_BG_PADDING_PX,
40313
40322
  this.targetText.height + 2 * vs.EDITING_BG_PADDING_PX
40314
- ), e.fill(), this.editingContainer.addChild(e), this.editableText = new G.Text(this.targetText.text, this.targetText.style), this.editableText.eventMode = "static", this.editableText.cursor = "text", this.editingContainer.addChild(this.editableText);
40323
+ ), e.fill(), this.editingContainer.addChild(e), this.editableText = new H.Text(this.targetText.text, this.targetText.style), this.editableText.eventMode = "static", this.editableText.cursor = "text", this.editingContainer.addChild(this.editableText);
40315
40324
  }
40316
40325
  setupTextInputHandler() {
40317
40326
  this.textInputHandler = new jn(), this.textInputHandler.setTextInputHandler((e, t) => {
@@ -40326,7 +40335,7 @@ class vs {
40326
40335
  const e = this.getContainerDimensions(), t = this.getAlignmentSettings(), i = this.calculateHorizontalPosition({ width: this.editableText.width }, e, t.horizontal), a = this.calculateVerticalPosition({ height: this.editableText.height }, e, t.vertical);
40327
40336
  if (this.editingContainer.position.set(i, a), this.editingContainer.children.length > 0) {
40328
40337
  const r = this.editingContainer.getChildAt(0);
40329
- r instanceof G.Graphics && (r.clear(), r.fillStyle = { color: 0, alpha: vs.EDITING_BG_ALPHA }, r.rect(
40338
+ r instanceof H.Graphics && (r.clear(), r.fillStyle = { color: 0, alpha: vs.EDITING_BG_ALPHA }, r.rect(
40330
40339
  -5,
40331
40340
  -5,
40332
40341
  this.editableText.width + 2 * vs.EDITING_BG_PADDING_PX,
@@ -40383,7 +40392,7 @@ class ma extends Dt {
40383
40392
  async load() {
40384
40393
  await super.load();
40385
40394
  const e = this.clipConfiguration.asset, t = e.font?.family ?? "Open Sans";
40386
- if (await this.loadFont(t), this.background = new G.Graphics(), this.drawBackground(), this.text = new G.Text({ text: e.text ?? "", style: this.createTextStyle(e) }), this.positionText(e), e.stroke?.width && e.stroke.width > 0 && e.stroke.color) {
40395
+ if (await this.loadFont(t), this.background = new H.Graphics(), this.drawBackground(), this.text = new H.Text({ text: e.text ?? "", style: this.createTextStyle(e) }), this.positionText(e), e.stroke?.width && e.stroke.width > 0 && e.stroke.color) {
40387
40396
  const i = new pr({
40388
40397
  thickness: e.stroke.width,
40389
40398
  color: e.stroke.color
@@ -40442,7 +40451,7 @@ class ma extends Dt {
40442
40451
  }
40443
40452
  createTextStyle(e) {
40444
40453
  const t = e.font?.family ?? "Open Sans", { baseFontFamily: i, fontWeight: a } = cs(t), { width: r } = this.getSize();
40445
- return new G.TextStyle({
40454
+ return new H.TextStyle({
40446
40455
  fontFamily: i,
40447
40456
  fontSize: e.font?.size ?? 32,
40448
40457
  fill: e.font?.color ?? "#ffffff",
@@ -40586,7 +40595,7 @@ class VI extends Dt {
40586
40595
  if (t.endsWith(".mov"))
40587
40596
  throw new Error(`Video source '${t}' is not supported. .mov files cannot be played in the browser. Please convert to .webm or .mp4 first.`);
40588
40597
  const i = `${t}${t.includes("?") ? "&" : "?"}x-cors=1`, a = { src: i, data: { autoPlay: !1, muted: !1 } }, r = await this.edit.assetLoader.loadVideoUnique(i, a);
40589
- if (!r || !(r.source instanceof G.VideoSource))
40598
+ if (!r || !(r.source instanceof H.VideoSource))
40590
40599
  throw new Error(`Invalid video source '${t}'.`);
40591
40600
  r.source.alphaMode = "no-premultiply-alpha", this.texture = this.createCroppedTexture(r);
40592
40601
  const n = this.texture.source.resource;
@@ -40595,7 +40604,7 @@ class VI extends Dt {
40595
40604
  n.removeEventListener("loadeddata", l), o();
40596
40605
  };
40597
40606
  n.addEventListener("loadeddata", l), n.readyState >= 2 && o();
40598
- }), this.sprite = new G.Sprite(this.texture), this.contentContainer.addChild(this.sprite);
40607
+ }), this.sprite = new H.Sprite(this.texture), this.contentContainer.addChild(this.sprite);
40599
40608
  }
40600
40609
  disposeVideo() {
40601
40610
  this.texture?.source?.resource && (this.texture.source.resource.pause(), this.texture.source.resource.src = "", this.texture.source.resource.load()), this.sprite && (this.contentContainer.removeChild(this.sprite), this.sprite.destroy(), this.sprite = null), this.texture && (this.texture.destroy(!0), this.texture = null);
@@ -40615,8 +40624,8 @@ class VI extends Dt {
40615
40624
  const i = e.width, a = e.height;
40616
40625
  if (i <= 0 || a <= 0)
40617
40626
  return e;
40618
- const r = Math.floor((t.crop?.left ?? 0) * i), n = Math.floor((t.crop?.right ?? 0) * i), o = Math.floor((t.crop?.top ?? 0) * a), l = Math.floor((t.crop?.bottom ?? 0) * a), c = r, d = o, u = i - r - n, f = a - o - l, p = new G.Rectangle(c, d, u, f);
40619
- return new G.Texture({ source: e.source, frame: p });
40627
+ const r = Math.floor((t.crop?.left ?? 0) * i), n = Math.floor((t.crop?.right ?? 0) * i), o = Math.floor((t.crop?.top ?? 0) * a), l = Math.floor((t.crop?.bottom ?? 0) * a), c = r, d = o, u = i - r - n, f = a - o - l, g = new H.Rectangle(c, d, u, f);
40628
+ return new H.Texture({ source: e.source, frame: g });
40620
40629
  }
40621
40630
  }
40622
40631
  class Ku {
@@ -40669,11 +40678,11 @@ function Zc(s, e, t, i) {
40669
40678
  if (!i?.has(`${n}:${l}`)) {
40670
40679
  const c = o[l], d = c.id, u = e.timeline.tracks[n]?.clips[l];
40671
40680
  let f = !1;
40672
- const p = {};
40673
- if (c.start === r && (p.start = c.start, f = !0), c.length === r && (p.length = c.length, f = !0), f && d && u) {
40674
- a.set(d, p);
40675
- const g = {};
40676
- p.start && (g.start = u.start), p.length && (g.length = u.length), s.updateClip(n, l, g);
40681
+ const g = {};
40682
+ if (c.start === r && (g.start = c.start, f = !0), c.length === r && (g.length = c.length, f = !0), f && d && u) {
40683
+ a.set(d, g);
40684
+ const p = {};
40685
+ g.start && (p.start = u.start), g.length && (p.length = u.length), s.updateClip(n, l, p);
40677
40686
  }
40678
40687
  }
40679
40688
  }
@@ -40722,7 +40731,7 @@ class LI {
40722
40731
  const i = e.documentAddClip(this.trackIdx, this.clip);
40723
40732
  this.addedClipId = i.id, this.convertedReferences && this.convertedReferences.size > 0 && Wc(t, this.convertedReferences), e.resolve(), e.updateDuration();
40724
40733
  const n = e.getDocumentTrack(this.trackIdx)?.clips?.findIndex((o) => o.id === this.addedClipId) ?? -1;
40725
- return e.emitEvent(H.ClipAdded, {
40734
+ return e.emitEvent(G.ClipAdded, {
40726
40735
  trackIndex: this.trackIdx,
40727
40736
  clipIndex: n
40728
40737
  }), xe();
@@ -40740,7 +40749,7 @@ class LI {
40740
40749
  const o = /* @__PURE__ */ new Set([`${this.trackIdx}:${r}`]);
40741
40750
  this.convertedReferences = Zc(t, e.getEditState(), n, o);
40742
40751
  }
40743
- return e.documentRemoveClip(this.trackIdx, r), e.resolve(), e.updateDuration(), e.emitEvent(H.ClipDeleted, {
40752
+ return e.documentRemoveClip(this.trackIdx, r), e.resolve(), e.updateDuration(), e.emitEvent(G.ClipDeleted, {
40744
40753
  trackIndex: this.trackIdx,
40745
40754
  clipIndex: r
40746
40755
  }), xe();
@@ -40758,7 +40767,7 @@ class n0 {
40758
40767
  if (!e) throw new Error("AddTrackCommand.execute: context is required");
40759
40768
  const t = e.getDocument();
40760
40769
  if (!t) throw new Error("AddTrackCommand.execute: document is required");
40761
- return t.addTrack(this.trackIdx), e.resolve(), e.updateDuration(), e.emitEvent(H.TrackAdded, {
40770
+ return t.addTrack(this.trackIdx), e.resolve(), e.updateDuration(), e.emitEvent(G.TrackAdded, {
40762
40771
  trackIndex: this.trackIdx,
40763
40772
  totalTracks: t.getTrackCount()
40764
40773
  }), xe();
@@ -40794,7 +40803,7 @@ class Hc {
40794
40803
  r.add(`${this.trackIdx}:${n}`);
40795
40804
  this.convertedReferences = _I(t, e.getEditState(), a, r);
40796
40805
  }
40797
- return t.removeTrack(this.trackIdx), e.resolve(), e.updateDuration(), e.emitEvent(H.TrackRemoved, { trackIndex: this.trackIdx }), xe();
40806
+ return t.removeTrack(this.trackIdx), e.resolve(), e.updateDuration(), e.emitEvent(G.TrackRemoved, { trackIndex: this.trackIdx }), xe();
40798
40807
  }
40799
40808
  undo(e) {
40800
40809
  if (!e) throw new Error("DeleteTrackCommand.undo: context is required");
@@ -40803,7 +40812,7 @@ class Hc {
40803
40812
  t.addTrack(this.trackIdx);
40804
40813
  for (let i = 0; i < this.deletedClips.length; i += 1)
40805
40814
  t.addClip(this.trackIdx, this.deletedClips[i], i);
40806
- return this.convertedReferences && this.convertedReferences.size > 0 && Wc(t, this.convertedReferences), e.resolve(), e.updateDuration(), e.emitEvent(H.TrackAdded, { trackIndex: this.trackIdx, totalTracks: t.getTrackCount() }), xe();
40815
+ return this.convertedReferences && this.convertedReferences.size > 0 && Wc(t, this.convertedReferences), e.resolve(), e.updateDuration(), e.emitEvent(G.TrackAdded, { trackIndex: this.trackIdx, totalTracks: t.getTrackCount() }), xe();
40807
40816
  }
40808
40817
  dispose() {
40809
40818
  this.deletedClips = [], this.convertedReferences = void 0;
@@ -40838,9 +40847,9 @@ class rl {
40838
40847
  }
40839
40848
  e.clearClipError(this.trackIdx, this.clipIdx);
40840
40849
  const r = e.getSelectedClip();
40841
- r && this.deletedClipId && r.clipId === this.deletedClipId && (e.setSelectedClip(null), e.emitEvent(H.SelectionCleared)), e.documentRemoveClip(this.trackIdx, this.clipIdx);
40850
+ r && this.deletedClipId && r.clipId === this.deletedClipId && (e.setSelectedClip(null), e.emitEvent(G.SelectionCleared)), e.documentRemoveClip(this.trackIdx, this.clipIdx);
40842
40851
  const n = t.getTrack(this.trackIdx);
40843
- return n && n.clips.length === 0 && (this.deleteTrackCommand = new Hc(this.trackIdx), this.deleteTrackCommand.execute(e).status === "success" && (this.trackWasDeleted = !0)), e.resolve(), e.updateDuration(), e.emitEvent(H.ClipDeleted, {
40852
+ return n && n.clips.length === 0 && (this.deleteTrackCommand = new Hc(this.trackIdx), this.deleteTrackCommand.execute(e).status === "success" && (this.trackWasDeleted = !0)), e.resolve(), e.updateDuration(), e.emitEvent(G.ClipDeleted, {
40844
40853
  trackIndex: this.trackIdx,
40845
40854
  clipIndex: this.clipIdx
40846
40855
  }), xe();
@@ -40852,10 +40861,10 @@ class rl {
40852
40861
  if (!t) throw new Error("DeleteClipCommand.undo: no document");
40853
40862
  this.trackWasDeleted && t.addTrack(this.trackIdx);
40854
40863
  const a = e.documentAddClip(this.trackIdx, this.deletedClipConfig, this.clipIdx).id;
40855
- return a && this.storedBindings && this.storedBindings.size > 0 && t.setClipBindingsForClip(a, this.storedBindings), this.convertedReferences && this.convertedReferences.size > 0 && Wc(t, this.convertedReferences), e.resolve(), e.updateDuration(), this.trackWasDeleted && (e.emitEvent(H.TrackAdded, {
40864
+ return a && this.storedBindings && this.storedBindings.size > 0 && t.setClipBindingsForClip(a, this.storedBindings), this.convertedReferences && this.convertedReferences.size > 0 && Wc(t, this.convertedReferences), e.resolve(), e.updateDuration(), this.trackWasDeleted && (e.emitEvent(G.TrackAdded, {
40856
40865
  trackIndex: this.trackIdx,
40857
40866
  totalTracks: t.getTrackCount()
40858
- }), this.trackWasDeleted = !1), e.emitEvent(H.ClipRestored, {
40867
+ }), this.trackWasDeleted = !1), e.emitEvent(G.ClipRestored, {
40859
40868
  trackIndex: this.trackIdx,
40860
40869
  clipIndex: this.clipIdx
40861
40870
  }), xe();
@@ -41081,19 +41090,19 @@ class nl {
41081
41090
  const n = this.trackIndex >= 0 ? this.trackIndex : i.layer - 1, o = this.clipIndex >= 0 ? this.clipIndex : e.getTracks()[n]?.indexOf(i) ?? -1, l = this.storedFinalConfig ?? this.finalClipConfig;
41082
41091
  l && t.replaceClipProperties(n, o, l), e.resolve();
41083
41092
  const c = e.getClipAt(n, o);
41084
- for (const [w, { resolvedValue: C }] of this.storedInitialBindings)
41085
- (c ? ya(c.clipConfiguration, w) : void 0) !== C && this.clipId && e.removeClipBinding(this.clipId, w);
41086
- const d = this.storedInitialConfig ?? this.initialClipConfig, u = this.storedFinalConfig ?? this.finalClipConfig, f = d?.asset, p = u?.asset;
41087
- if (f?.src !== p?.src) {
41093
+ for (const [w, { resolvedValue: v }] of this.storedInitialBindings)
41094
+ (c ? ya(c.clipConfiguration, w) : void 0) !== v && this.clipId && e.removeClipBinding(this.clipId, w);
41095
+ const d = this.storedInitialConfig ?? this.initialClipConfig, u = this.storedFinalConfig ?? this.finalClipConfig, f = d?.asset, g = u?.asset;
41096
+ if (f?.src !== g?.src) {
41088
41097
  const w = e.getClipAt(n, o);
41089
41098
  w && w.getTimingIntent().length === "auto" && await e.resolveClipAutoLength(w);
41090
41099
  }
41091
- const g = e.getDocumentClip(n, o);
41092
- if (!this.previousDocClip || !g)
41100
+ const p = e.getDocumentClip(n, o);
41101
+ if (!this.previousDocClip || !p)
41093
41102
  throw new Error(`SetUpdatedClipCommand: document clip not found after mutation at ${n}/${o}`);
41094
- return e.emitEvent(H.ClipUpdated, {
41103
+ return e.emitEvent(G.ClipUpdated, {
41095
41104
  previous: { clip: Oe(this.previousDocClip), trackIndex: n, clipIndex: o },
41096
- current: { clip: Oe(g), trackIndex: n, clipIndex: o }
41105
+ current: { clip: Oe(p), trackIndex: n, clipIndex: o }
41097
41106
  }), xe();
41098
41107
  }
41099
41108
  async undo(e) {
@@ -41117,7 +41126,7 @@ class nl {
41117
41126
  const u = e.getDocumentClip(r, n);
41118
41127
  if (!o || !u)
41119
41128
  throw new Error(`SetUpdatedClipCommand: document clip not found after undo at ${r}/${n}`);
41120
- return e.emitEvent(H.ClipUpdated, {
41129
+ return e.emitEvent(G.ClipUpdated, {
41121
41130
  previous: { clip: Oe(o), trackIndex: r, clipIndex: n },
41122
41131
  current: { clip: Oe(u), trackIndex: r, clipIndex: n }
41123
41132
  }), xe();
@@ -41152,7 +41161,7 @@ class WI {
41152
41161
  }), e.updateDuration();
41153
41162
  const l = e.getDocumentClip(this.trackIndex, this.clipIndex);
41154
41163
  if (!l) throw new Error(`UpdateClipTimingCommand: document clip not found after mutation at ${this.trackIndex}/${this.clipIndex}`);
41155
- return e.emitEvent(H.ClipUpdated, {
41164
+ return e.emitEvent(G.ClipUpdated, {
41156
41165
  previous: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: Oe(n) },
41157
41166
  current: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: Oe(l) }
41158
41167
  }), e.propagateTimingChanges(this.trackIndex, this.clipIndex), xe();
@@ -41172,7 +41181,7 @@ class WI {
41172
41181
  const n = e.getDocumentClip(this.trackIndex, this.clipIndex);
41173
41182
  if (!a || !n)
41174
41183
  throw new Error(`UpdateClipTimingCommand: document clip not found after undo at ${this.trackIndex}/${this.clipIndex}`);
41175
- return e.emitEvent(H.ClipUpdated, {
41184
+ return e.emitEvent(G.ClipUpdated, {
41176
41185
  previous: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: Oe(a) },
41177
41186
  current: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: Oe(n) }
41178
41187
  }), e.propagateTimingChanges(this.trackIndex, this.clipIndex), xe();
@@ -41204,7 +41213,7 @@ class HI {
41204
41213
  const l = e.getDocumentClip(this.trackIndex, this.clipIndex);
41205
41214
  if (!this.previousDocClip || !l)
41206
41215
  throw new Error(`UpdateTextContentCommand: document clip not found after mutation at ${this.trackIndex}/${this.clipIndex}`);
41207
- return e.emitEvent(H.ClipUpdated, {
41216
+ return e.emitEvent(G.ClipUpdated, {
41208
41217
  previous: { clip: Oe(this.previousDocClip), trackIndex: this.trackIndex, clipIndex: this.clipIndex },
41209
41218
  current: { clip: Oe(l), trackIndex: this.trackIndex, clipIndex: this.clipIndex }
41210
41219
  }), xe();
@@ -41221,7 +41230,7 @@ class HI {
41221
41230
  if (this.previousDocClip) {
41222
41231
  if (!i || !o)
41223
41232
  throw new Error(`UpdateTextContentCommand: document clip not found after undo at ${this.trackIndex}/${this.clipIndex}`);
41224
- e.emitEvent(H.ClipUpdated, {
41233
+ e.emitEvent(G.ClipUpdated, {
41225
41234
  previous: { clip: Oe(i), trackIndex: this.trackIndex, clipIndex: this.clipIndex },
41226
41235
  current: { clip: Oe(o), trackIndex: this.trackIndex, clipIndex: this.clipIndex }
41227
41236
  });
@@ -41312,7 +41321,7 @@ class qI {
41312
41321
  if (t === -1)
41313
41322
  return;
41314
41323
  const i = this.activeLumaMasks[t];
41315
- i.contentClip && (i.contentClip.getContentContainer().mask = null), i.maskSprite.parent?.removeChild(i.maskSprite), i.tempContainer.destroy({ children: !0 }), this.activeLumaMasks.splice(t, 1), this.pendingMaskCleanup.push({ maskSprite: i.maskSprite, frameCount: 0 });
41324
+ i.contentClip && (i.contentClip.getLumaWrapper().mask = null), i.maskSprite.parent?.removeChild(i.maskSprite), i.tempContainer.destroy({ children: !0 }), this.activeLumaMasks.splice(t, 1), this.pendingMaskCleanup.push({ maskSprite: i.maskSprite, frameCount: 0 });
41316
41325
  }
41317
41326
  /**
41318
41327
  * Handle PlayerLoaded event - set up luma mask if player is a luma player.
@@ -41336,17 +41345,17 @@ class qI {
41336
41345
  const a = this.getCanvas();
41337
41346
  if (!a)
41338
41347
  return;
41339
- const { renderer: r } = a.application, { width: n, height: o } = i.getSize(), l = new G.Container(), c = new G.Sprite(t);
41348
+ const { renderer: r } = a.application, { width: n, height: o } = i.getSize(), l = new H.Container(), c = new H.Sprite(t);
41340
41349
  c.width = n, c.height = o;
41341
- const d = new G.ColorMatrixFilter();
41350
+ const d = new H.ColorMatrixFilter();
41342
41351
  d.negative(!1), c.filters = [d], l.addChild(c);
41343
41352
  const u = r.generateTexture({
41344
41353
  target: l,
41345
41354
  resolution: Ju
41346
- }), f = new G.Sprite(u);
41355
+ }), f = new H.Sprite(u);
41347
41356
  i.getContainer().addChild(f);
41348
- const p = i.getContentContainer();
41349
- p.mask = f, this.activeLumaMasks.push({ lumaPlayer: e, maskSprite: f, tempContainer: l, contentClip: i, lastVideoTime: -1 });
41357
+ const g = i.getLumaWrapper();
41358
+ g.mask = f, this.activeLumaMasks.push({ lumaPlayer: e, maskSprite: f, tempContainer: l, contentClip: i, lastVideoTime: -1 });
41350
41359
  }
41351
41360
  updateLumaMasks() {
41352
41361
  const e = this.getCanvas();
@@ -41366,10 +41375,10 @@ class qI {
41366
41375
  }
41367
41376
  }
41368
41377
  setupEventListeners() {
41369
- this.events.on(Be.PlayerLoaded, this.onPlayerLoadedBound), this.events.on(H.ClipUpdated, this.onClipChangedBound);
41378
+ this.events.on(Be.PlayerLoaded, this.onPlayerLoadedBound), this.events.on(G.ClipUpdated, this.onClipChangedBound);
41370
41379
  }
41371
41380
  removeEventListeners() {
41372
- this.events.off(Be.PlayerLoaded, this.onPlayerLoadedBound), this.events.off(H.ClipUpdated, this.onClipChangedBound);
41381
+ this.events.off(Be.PlayerLoaded, this.onPlayerLoadedBound), this.events.off(G.ClipUpdated, this.onClipChangedBound);
41373
41382
  }
41374
41383
  processPendingMaskCleanup() {
41375
41384
  for (let e = this.pendingMaskCleanup.length - 1; e >= 0; e -= 1) {
@@ -41422,7 +41431,7 @@ class KI {
41422
41431
  * @param options.silent If true, suppresses event emission (for command-based operations)
41423
41432
  */
41424
41433
  register(e, t) {
41425
- this.fields.set(e.name, e), t?.silent || this.events.emit(H.MergeFieldChanged, { fields: this.getAll() });
41434
+ this.fields.set(e.name, e), t?.silent || this.events.emit(G.MergeFieldChanged, { fields: this.getAll() });
41426
41435
  }
41427
41436
  /**
41428
41437
  * Remove a merge field by name.
@@ -41431,7 +41440,7 @@ class KI {
41431
41440
  */
41432
41441
  remove(e, t) {
41433
41442
  const i = this.fields.delete(e);
41434
- return i && !t?.silent && this.events.emit(H.MergeFieldChanged, { fields: this.getAll() }), i;
41443
+ return i && !t?.silent && this.events.emit(G.MergeFieldChanged, { fields: this.getAll() }), i;
41435
41444
  }
41436
41445
  /** Get a merge field by name */
41437
41446
  get(e) {
@@ -41560,7 +41569,7 @@ class JI {
41560
41569
  size: i
41561
41570
  }, delete a.output.resolution, delete a.output.aspectRatio);
41562
41571
  const r = this.edit.getDocument();
41563
- r?.setSize(i), r?.clearResolution(), r?.clearAspectRatio(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(H.OutputResized, i);
41572
+ r?.setSize(i), r?.clearResolution(), r?.clearAspectRatio(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(G.OutputResized, i);
41564
41573
  }
41565
41574
  getSize() {
41566
41575
  return this.edit.size;
@@ -41574,7 +41583,7 @@ class JI {
41574
41583
  i && (i.output = {
41575
41584
  ...i.output,
41576
41585
  fps: t
41577
- }), this.edit.getDocument()?.setFps(t), this.edit.getInternalEvents().emit(H.OutputFpsChanged, { fps: e });
41586
+ }), this.edit.getDocument()?.setFps(t), this.edit.getInternalEvents().emit(G.OutputFpsChanged, { fps: e });
41578
41587
  }
41579
41588
  getFps() {
41580
41589
  return this.edit.getResolvedEdit()?.output?.fps ?? 30;
@@ -41585,7 +41594,7 @@ class JI {
41585
41594
  i && (i.output = {
41586
41595
  ...i.output,
41587
41596
  format: t
41588
- }), this.edit.getDocument()?.setFormat(t), this.edit.getInternalEvents().emit(H.OutputFormatChanged, { format: t });
41597
+ }), this.edit.getDocument()?.setFormat(t), this.edit.getInternalEvents().emit(G.OutputFormatChanged, { format: t });
41589
41598
  }
41590
41599
  getFormat() {
41591
41600
  return this.edit.getResolvedEdit()?.output?.format ?? "mp4";
@@ -41596,7 +41605,7 @@ class JI {
41596
41605
  i && (i.output = {
41597
41606
  ...i.output,
41598
41607
  destinations: t
41599
- }), this.edit.getInternalEvents().emit(H.OutputDestinationsChanged, { destinations: t });
41608
+ }), this.edit.getInternalEvents().emit(G.OutputDestinationsChanged, { destinations: t });
41600
41609
  }
41601
41610
  getDestinations() {
41602
41611
  return this.edit.getResolvedEdit()?.output?.destinations ?? [];
@@ -41609,7 +41618,7 @@ class JI {
41609
41618
  resolution: t
41610
41619
  }, delete i.output.size);
41611
41620
  const n = this.edit.getDocument();
41612
- n?.setResolution(t), n?.clearSize(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(H.OutputResolutionChanged, { resolution: t }), this.edit.getInternalEvents().emit(H.OutputResized, { width: r.width, height: r.height });
41621
+ n?.setResolution(t), n?.clearSize(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(G.OutputResolutionChanged, { resolution: t }), this.edit.getInternalEvents().emit(G.OutputResized, { width: r.width, height: r.height });
41613
41622
  }
41614
41623
  getResolution() {
41615
41624
  return this.edit.getResolvedEdit()?.output?.resolution;
@@ -41621,7 +41630,7 @@ class JI {
41621
41630
  i && (i.output = {
41622
41631
  ...i.output,
41623
41632
  aspectRatio: t
41624
- }), this.edit.getDocument()?.setAspectRatio(t), this.edit.getInternalEvents().emit(H.OutputAspectRatioChanged, { aspectRatio: t });
41633
+ }), this.edit.getDocument()?.setAspectRatio(t), this.edit.getInternalEvents().emit(G.OutputAspectRatioChanged, { aspectRatio: t });
41625
41634
  return;
41626
41635
  }
41627
41636
  const r = Xn(a, t);
@@ -41630,7 +41639,7 @@ class JI {
41630
41639
  aspectRatio: t
41631
41640
  }, delete i.output.size);
41632
41641
  const n = this.edit.getDocument();
41633
- n?.setAspectRatio(t), n?.clearSize(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(H.OutputAspectRatioChanged, { aspectRatio: t }), this.edit.getInternalEvents().emit(H.OutputResized, { width: r.width, height: r.height });
41642
+ n?.setAspectRatio(t), n?.clearSize(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(G.OutputAspectRatioChanged, { aspectRatio: t }), this.edit.getInternalEvents().emit(G.OutputResized, { width: r.width, height: r.height });
41634
41643
  }
41635
41644
  getAspectRatio() {
41636
41645
  return this.edit.getResolvedEdit()?.output?.aspectRatio;
@@ -41651,7 +41660,7 @@ class $I {
41651
41660
  if (i) {
41652
41661
  this.selectedClip = i;
41653
41662
  const a = this.edit.getDocumentClip(e, t);
41654
- a && this.edit.getInternalEvents().emit(H.ClipSelected, {
41663
+ a && this.edit.getInternalEvents().emit(G.ClipSelected, {
41655
41664
  clip: Oe(a),
41656
41665
  trackIndex: e,
41657
41666
  clipIndex: t
@@ -41669,7 +41678,7 @@ class $I {
41669
41678
  * Clear the current selection.
41670
41679
  */
41671
41680
  clearSelection() {
41672
- this.selectedClip = null, this.edit.getInternalEvents().emit(H.SelectionCleared);
41681
+ this.selectedClip = null, this.edit.getInternalEvents().emit(G.SelectionCleared);
41673
41682
  }
41674
41683
  /**
41675
41684
  * Check if a specific clip is selected by indices.
@@ -41718,7 +41727,7 @@ class $I {
41718
41727
  i && (this.copiedClip = {
41719
41728
  trackIndex: e,
41720
41729
  clipConfiguration: structuredClone(i)
41721
- }, this.edit.getInternalEvents().emit(H.ClipCopied, { trackIndex: e, clipIndex: t }));
41730
+ }, this.edit.getInternalEvents().emit(G.ClipCopied, { trackIndex: e, clipIndex: t }));
41722
41731
  }
41723
41732
  /**
41724
41733
  * Paste the copied clip at the current playhead position.
@@ -41811,8 +41820,8 @@ class s6 {
41811
41820
  const c = n[l], d = o?.clips[l];
41812
41821
  if (d) {
41813
41822
  const u = c.getTimingIntent(), f = d.start;
41814
- let p = d.length;
41815
- u.length === "auto" && (p = await l0(c.clipConfiguration.asset)), c.setResolvedTiming({ start: f, length: p });
41823
+ let g = d.length;
41824
+ u.length === "auto" && (g = await l0(c.clipConfiguration.asset)), c.setResolvedTiming({ start: f, length: g });
41816
41825
  }
41817
41826
  }
41818
41827
  }
@@ -41860,7 +41869,7 @@ class s6 {
41860
41869
  }), o.reconfigureAfterRestore());
41861
41870
  }
41862
41871
  }
41863
- this.edit.updateTotalDuration(), this.edit.getInternalEvents().emit(H.TimelineUpdated, {
41872
+ this.edit.updateTotalDuration(), this.edit.getInternalEvents().emit(G.TimelineUpdated, {
41864
41873
  current: this.edit.getEdit()
41865
41874
  });
41866
41875
  }
@@ -41877,8 +41886,8 @@ class s6 {
41877
41886
  for (let n = 0; n < a.length; n += 1) {
41878
41887
  const o = a[n], l = r?.clips[n], c = o.getTimingIntent(), d = ds(c.start), u = ds(c.length);
41879
41888
  if ((d || u) && l) {
41880
- const f = o.getStart(), p = o.getLength(), g = Math.abs(l.start - f) > 1e-3, w = Math.abs(l.length - p) > 1e-3;
41881
- (g || w) && (o.setResolvedTiming({
41889
+ const f = o.getStart(), g = o.getLength(), p = Math.abs(l.start - f) > 1e-3, w = Math.abs(l.length - g) > 1e-3;
41890
+ (p || w) && (o.setResolvedTiming({
41882
41891
  start: l.start,
41883
41892
  length: l.length
41884
41893
  }), o.reconfigureAfterRestore());
@@ -41932,14 +41941,14 @@ class Kn {
41932
41941
  return t <= 1 ? (this.refCounts.delete(e), !0) : (this.refCounts.set(e, t - 1), !1);
41933
41942
  }
41934
41943
  constructor() {
41935
- G.Assets.setPreferences({ crossOrigin: "anonymous" });
41944
+ H.Assets.setPreferences({ crossOrigin: "anonymous" });
41936
41945
  }
41937
41946
  async load(e, t) {
41938
41947
  this.updateAssetLoadMetadata(e, "pending", 0), this.incrementRef(e);
41939
41948
  try {
41940
41949
  if (await this.shouldUseSafariVideoLoader(t))
41941
41950
  return await this.loadVideoForSafari(e, t);
41942
- const a = await G.Assets.load(t, (r) => {
41951
+ const a = await H.Assets.load(t, (r) => {
41943
41952
  this.updateAssetLoadMetadata(e, "loading", r);
41944
41953
  });
41945
41954
  return this.updateAssetLoadMetadata(e, "success", 1), a;
@@ -41964,12 +41973,12 @@ class Kn {
41964
41973
  "loadedmetadata",
41965
41974
  () => {
41966
41975
  try {
41967
- const c = new G.VideoSource({
41976
+ const c = new H.VideoSource({
41968
41977
  resource: l,
41969
41978
  autoPlay: a.autoPlay ?? !1,
41970
41979
  ...a
41971
41980
  });
41972
- n(new G.Texture({ source: c }));
41981
+ n(new H.Texture({ source: c }));
41973
41982
  } catch (c) {
41974
41983
  o(c);
41975
41984
  }
@@ -42022,12 +42031,12 @@ class Kn {
42022
42031
  "loadedmetadata",
42023
42032
  () => {
42024
42033
  try {
42025
- const c = new G.VideoSource({
42034
+ const c = new H.VideoSource({
42026
42035
  resource: l,
42027
42036
  autoPlay: a.autoPlay ?? !1,
42028
42037
  ...a
42029
42038
  });
42030
- n(new G.Texture({ source: c }));
42039
+ n(new H.Texture({ source: c }));
42031
42040
  } catch (c) {
42032
42041
  o(c);
42033
42042
  }
@@ -42052,8 +42061,8 @@ class Cr {
42052
42061
  woff2Decompressor;
42053
42062
  constructor() {
42054
42063
  this.id = Cr.Name, this.name = Cr.Name, this.extension = {
42055
- type: [G.ExtensionType.LoadParser],
42056
- priority: G.LoaderParserPriority.High,
42064
+ type: [H.ExtensionType.LoadParser],
42065
+ priority: H.LoaderParserPriority.High,
42057
42066
  ref: null
42058
42067
  }, this.validFontExtensions = ["ttf", "otf", "woff", "woff2"], this.woff2Decompressor = null;
42059
42068
  }
@@ -42064,8 +42073,8 @@ class Cr {
42064
42073
  async load(e, t, i) {
42065
42074
  const a = e.split("?")[0]?.split(".").pop()?.toLowerCase() ?? "", r = await fetch(e).then((f) => f.arrayBuffer());
42066
42075
  if (a !== "woff2") {
42067
- const f = Vl.parse(new Uint8Array(r).buffer), p = f.names.fontFamily.en || f.names.fontFamily[Object.keys(f.names.fontFamily)[0]], g = new FontFace(p, `url(${e})`);
42068
- return await g.load(), document.fonts.add(g), g;
42076
+ const f = Vl.parse(new Uint8Array(r).buffer), g = f.names.fontFamily.en || f.names.fontFamily[Object.keys(f.names.fontFamily)[0]], p = new FontFace(g, `url(${e})`);
42077
+ return await p.load(), document.fonts.add(p), p;
42069
42078
  }
42070
42079
  if (await this.loadWoff2Decompressor(), !this.woff2Decompressor)
42071
42080
  throw new Error("Cannot initialize Woff2 decompressor.");
@@ -42182,8 +42191,8 @@ function h6(s, e, t) {
42182
42191
  function p6(s, e, t, i, a) {
42183
42192
  const r = s.config.start, n = r + s.config.length, o = t + i / 2, l = r + s.config.length / 2;
42184
42193
  if (o >= l) {
42185
- const p = n, g = p + i, w = a[e + 1];
42186
- return w && g > w.config.start ? { newStartTime: p, pushOffset: g - w.config.start } : { newStartTime: p, pushOffset: 0 };
42194
+ const g = n, p = g + i, w = a[e + 1];
42195
+ return w && p > w.config.start ? { newStartTime: g, pushOffset: p - w.config.start } : { newStartTime: g, pushOffset: 0 };
42187
42196
  }
42188
42197
  const d = e > 0 ? a[e - 1].config.start + a[e - 1].config.length : 0;
42189
42198
  if (r - d >= i)
@@ -42835,7 +42844,7 @@ class S6 {
42835
42844
  player: r,
42836
42845
  trackIndex: i,
42837
42846
  clipIndex: a
42838
- }), k6.has(n) && this.edit.getInternalEvents().emit(H.ClipUnresolved, {
42847
+ }), k6.has(n) && this.edit.getInternalEvents().emit(G.ClipUnresolved, {
42839
42848
  trackIndex: i,
42840
42849
  clipIndex: a,
42841
42850
  assetType: n,
@@ -42843,7 +42852,7 @@ class S6 {
42843
42852
  });
42844
42853
  }).catch((l) => {
42845
42854
  const c = l instanceof Error ? l.message : String(l);
42846
- this.edit.getInternalEvents().emit(H.ClipLoadFailed, {
42855
+ this.edit.getInternalEvents().emit(G.ClipLoadFailed, {
42847
42856
  trackIndex: i,
42848
42857
  clipIndex: a,
42849
42858
  error: c,
@@ -43112,44 +43121,44 @@ function N6(s, e, t) {
43112
43121
  function af(s, e) {
43113
43122
  const { dependencies: t, allClips: i } = A6(s);
43114
43123
  if (t.size > 0) {
43115
- const p = I6(t);
43116
- if (p)
43117
- throw new Error(`Circular alias reference detected: ${p.join(" -> ")}`);
43124
+ const g = I6(t);
43125
+ if (g)
43126
+ throw new Error(`Circular alias reference detected: ${g.join(" -> ")}`);
43118
43127
  }
43119
- const a = i.map((p) => p.id), r = T6(t, a), n = /* @__PURE__ */ new Map();
43120
- for (const p of i)
43121
- n.set(p.id, p);
43128
+ const a = i.map((g) => g.id), r = T6(t, a), n = /* @__PURE__ */ new Map();
43129
+ for (const g of i)
43130
+ n.set(g.id, g);
43122
43131
  const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
43123
- for (const p of r) {
43124
- const g = n.get(p);
43125
- if (g) {
43126
- const { clip: w, trackIndex: C, clipIndex: v } = g, S = d0(w, e.mergeFields), x = c.get(C) ?? 0, T = u0(S, x, l);
43127
- o.set(`${C}-${v}`, T);
43128
- const b = T.start + T.length, D = c.get(C) ?? 0;
43129
- b > D && c.set(C, b), w.alias && l.set(w.alias, {
43132
+ for (const g of r) {
43133
+ const p = n.get(g);
43134
+ if (p) {
43135
+ const { clip: w, trackIndex: v, clipIndex: x } = p, S = d0(w, e.mergeFields), C = c.get(v) ?? 0, T = u0(S, C, l);
43136
+ o.set(`${v}-${x}`, T);
43137
+ const b = T.start + T.length, D = c.get(v) ?? 0;
43138
+ b > D && c.set(v, b), w.alias && l.set(w.alias, {
43130
43139
  start: T.start,
43131
43140
  length: T.length
43132
43141
  });
43133
43142
  }
43134
43143
  }
43135
43144
  const d = [];
43136
- for (let p = 0; p < s.getTrackCount(); p += 1) {
43137
- const g = s.getClipsInTrack(p).length, w = [];
43138
- for (let C = 0; C < g; C += 1) {
43139
- const v = o.get(`${p}-${C}`);
43140
- if (!v)
43141
- throw new Error(`Internal error: Clip at track ${p}, index ${C} was not resolved.`);
43142
- w.push(v);
43145
+ for (let g = 0; g < s.getTrackCount(); g += 1) {
43146
+ const p = s.getClipsInTrack(g).length, w = [];
43147
+ for (let v = 0; v < p; v += 1) {
43148
+ const x = o.get(`${g}-${v}`);
43149
+ if (!x)
43150
+ throw new Error(`Internal error: Clip at track ${g}, index ${v} was not resolved.`);
43151
+ w.push(x);
43143
43152
  }
43144
43153
  d.push({ clips: w });
43145
43154
  }
43146
- const u = E6(d), f = d.map((p) => ({
43147
- clips: p.clips.map((g) => {
43148
- if (g.pendingEndLength) {
43149
- const w = Math.max(u - g.start, 0.1);
43150
- return ic({ ...g, length: w });
43155
+ const u = E6(d), f = d.map((g) => ({
43156
+ clips: g.clips.map((p) => {
43157
+ if (p.pendingEndLength) {
43158
+ const w = Math.max(u - p.start, 0.1);
43159
+ return ic({ ...p, length: w });
43151
43160
  }
43152
- return ic(g);
43161
+ return ic(p);
43153
43162
  })
43154
43163
  }));
43155
43164
  return {
@@ -43236,8 +43245,8 @@ class kr {
43236
43245
  (r.timeline.fonts ?? []).map(async (o) => {
43237
43246
  const l = o.src, c = { src: l, parser: Cr.Name }, d = await this.assetLoader.load(l, c);
43238
43247
  if (d?.family) {
43239
- const u = d.family.replace(/^["']|["']$/g, ""), { baseFontFamily: f, fontWeight: p } = cs(u);
43240
- this.fontMetadata.set(l, { baseFamilyName: f, weight: p });
43248
+ const u = d.family.replace(/^["']|["']$/g, ""), { baseFontFamily: f, fontWeight: g } = cs(u);
43249
+ this.fontMetadata.set(l, { baseFamilyName: f, weight: g });
43241
43250
  }
43242
43251
  return d;
43243
43252
  })
@@ -43246,7 +43255,7 @@ class kr {
43246
43255
  this.lumaMaskController.initialize(), await this.playerReconciler.reconcileInitial(n), this.normalizeLumaAttachments();
43247
43256
  for (const [o, l] of a)
43248
43257
  l.size > 0 && this.document.setClipBindingsForClip(o, l);
43249
- await this.timingManager.resolveAllTiming(), this.updateTotalDuration(), r.timeline.soundtrack && await this.loadSoundtrack(r.timeline.soundtrack), this.internalEvents.emit(H.TimelineUpdated, { current: this.getEdit() }), this.emitEditChanged(e);
43258
+ await this.timingManager.resolveAllTiming(), this.updateTotalDuration(), r.timeline.soundtrack && await this.loadSoundtrack(r.timeline.soundtrack), this.internalEvents.emit(G.TimelineUpdated, { current: this.getEdit() }), this.emitEditChanged(e);
43250
43259
  }
43251
43260
  /** @internal */
43252
43261
  getInternalEvents() {
@@ -43273,10 +43282,10 @@ class kr {
43273
43282
  }), this.internalEvents.emit(Be.ViewportNeedsZoomToFit);
43274
43283
  }
43275
43284
  play() {
43276
- this.isPlaying = !0, this.internalEvents.emit(H.PlaybackPlay);
43285
+ this.isPlaying = !0, this.internalEvents.emit(G.PlaybackPlay);
43277
43286
  }
43278
43287
  pause() {
43279
- this.isPlaying = !1, this.internalEvents.emit(H.PlaybackPause);
43288
+ this.isPlaying = !1, this.internalEvents.emit(G.PlaybackPause);
43280
43289
  }
43281
43290
  seek(e) {
43282
43291
  this.playbackTime = Math.max(0, Math.min(e, this.totalDuration)), this.pause(), this.update(0, kr.SEEK_ELAPSED_MARKER);
@@ -43418,8 +43427,8 @@ class kr {
43418
43427
  if (!u)
43419
43428
  return !1;
43420
43429
  if (this.lastResolved) {
43421
- const p = this.lastResolved.timeline.tracks[u.trackIndex];
43422
- p && p.clips[u.clipIndex] && (p.clips[u.clipIndex] = u.resolved);
43430
+ const g = this.lastResolved.timeline.tracks[u.trackIndex];
43431
+ g && g.clips[u.clipIndex] && (g.clips[u.clipIndex] = u.resolved);
43423
43432
  }
43424
43433
  return this.playerReconciler.updateSinglePlayer(t, u.resolved, u.trackIndex, u.clipIndex) !== !1;
43425
43434
  }
@@ -43609,7 +43618,7 @@ class kr {
43609
43618
  const e = this.commandHistory[this.commandIndex];
43610
43619
  if (e.undo) {
43611
43620
  const t = this.createCommandContext();
43612
- await Promise.resolve(e.undo(t)), this.commandIndex -= 1, this.internalEvents.emit(H.EditUndo, { command: e.name }), this.emitEditChanged(`undo:${e.name}`);
43621
+ await Promise.resolve(e.undo(t)), this.commandIndex -= 1, this.internalEvents.emit(G.EditUndo, { command: e.name }), this.emitEditChanged(`undo:${e.name}`);
43613
43622
  }
43614
43623
  }
43615
43624
  });
@@ -43618,7 +43627,7 @@ class kr {
43618
43627
  return this.commandQueue.enqueue(async () => {
43619
43628
  if (this.commandIndex < this.commandHistory.length - 1) {
43620
43629
  const e = this.commandIndex + 1, t = this.commandHistory[e], i = this.createCommandContext();
43621
- await Promise.resolve(t.execute(i)), this.commandIndex = e, this.internalEvents.emit(H.EditRedo, { command: t.name }), this.emitEditChanged(`redo:${t.name}`);
43630
+ await Promise.resolve(t.execute(i)), this.commandIndex = e, this.internalEvents.emit(G.EditRedo, { command: t.name }), this.emitEditChanged(`redo:${t.name}`);
43622
43631
  }
43623
43632
  });
43624
43633
  }
@@ -43732,7 +43741,7 @@ class kr {
43732
43741
  * @internal
43733
43742
  */
43734
43743
  emitEditChanged(e) {
43735
- this.isBatchingEvents || this.internalEvents.emit(H.EditChanged, { source: e, timestamp: Date.now() });
43744
+ this.isBatchingEvents || this.internalEvents.emit(G.EditChanged, { source: e, timestamp: Date.now() });
43736
43745
  }
43737
43746
  /**
43738
43747
  * Detects merge field placeholders in the raw edit before substitution.
@@ -43887,7 +43896,7 @@ class kr {
43887
43896
  }
43888
43897
  this.addPlayerToContainer(e, t), t.load().catch((a) => {
43889
43898
  const r = t.clipConfiguration?.asset?.type ?? "unknown", n = a instanceof Error ? a.message : String(a);
43890
- this.clipErrors.set(`${e}-${i}`, { error: n, assetType: r }), this.internalEvents.emit(H.ClipLoadFailed, {
43899
+ this.clipErrors.set(`${e}-${i}`, { error: n, assetType: r }), this.internalEvents.emit(G.ClipLoadFailed, {
43891
43900
  trackIndex: e,
43892
43901
  clipIndex: i,
43893
43902
  error: n,
@@ -44057,7 +44066,7 @@ class kr {
44057
44066
  const t = this.canvas?.getViewportContainer();
44058
44067
  if (t) {
44059
44068
  for (const i of t.children)
44060
- if (i instanceof G.Container && i.label?.toString().startsWith("shotstack-track-") && i.children.includes(e.getContainer())) {
44069
+ if (i instanceof H.Container && i.label?.toString().startsWith("shotstack-track-") && i.children.includes(e.getContainer())) {
44061
44070
  i.removeChild(e.getContainer());
44062
44071
  break;
44063
44072
  }
@@ -44069,7 +44078,7 @@ class kr {
44069
44078
  }
44070
44079
  unloadClipAssets(e) {
44071
44080
  const { asset: t } = e.clipConfiguration;
44072
- t && "src" in t && typeof t.src == "string" && this.assetLoader.decrementRef(t.src) && G.Assets.cache.has(t.src) && G.Assets.unload(t.src);
44081
+ t && "src" in t && typeof t.src == "string" && this.assetLoader.decrementRef(t.src) && H.Assets.cache.has(t.src) && H.Assets.unload(t.src);
44073
44082
  }
44074
44083
  /** @internal */
44075
44084
  clearClips() {
@@ -44084,7 +44093,7 @@ class kr {
44084
44093
  for (const a of i)
44085
44094
  e = Math.max(e, a.getEnd());
44086
44095
  const t = this.totalDuration;
44087
- this.totalDuration = e, t !== this.totalDuration && this.internalEvents.emit(H.DurationChanged, { duration: this.totalDuration });
44096
+ this.totalDuration = e, t !== this.totalDuration && this.internalEvents.emit(G.DurationChanged, { duration: this.totalDuration });
44088
44097
  }
44089
44098
  /** @internal */
44090
44099
  propagateTimingChanges(e, t) {
@@ -44316,7 +44325,7 @@ class kr {
44316
44325
  width: this.size.width,
44317
44326
  height: this.size.height,
44318
44327
  backgroundColor: this.backgroundColor
44319
- }), this.internalEvents.emit(H.TimelineBackgroundChanged, { color: e });
44328
+ }), this.internalEvents.emit(G.TimelineBackgroundChanged, { color: e });
44320
44329
  }
44321
44330
  getTimelineBackground() {
44322
44331
  return this.backgroundColor;
@@ -44460,7 +44469,7 @@ class P6 {
44460
44469
  canvasWidth;
44461
44470
  canvasHeight;
44462
44471
  constructor(e, t, i) {
44463
- this.canvasWidth = t, this.canvasHeight = i, this.graphics = new G.Graphics(), this.graphics.zIndex = 999999, e.addChild(this.graphics);
44472
+ this.canvasWidth = t, this.canvasHeight = i, this.graphics = new H.Graphics(), this.graphics.zIndex = 999999, e.addChild(this.graphics);
44464
44473
  }
44465
44474
  clear() {
44466
44475
  this.graphics.clear();
@@ -44481,8 +44490,8 @@ class P6 {
44481
44490
  const r = i - e, n = a - t, o = Math.sqrt(r * r + n * n), l = Math.floor(o / (ll + of)), c = r / o, d = n / o;
44482
44491
  this.graphics.strokeStyle = { width: nf, color: rf };
44483
44492
  for (let u = 0; u < l; u += 1) {
44484
- const f = u * (ll + of), p = f + ll, g = e + c * f, w = t + d * f, C = e + c * Math.min(p, o), v = t + d * Math.min(p, o);
44485
- this.graphics.moveTo(g, w), this.graphics.lineTo(C, v);
44493
+ const f = u * (ll + of), g = f + ll, p = e + c * f, w = t + d * f, v = e + c * Math.min(g, o), x = t + d * Math.min(g, o);
44494
+ this.graphics.moveTo(p, w), this.graphics.lineTo(v, x);
44486
44495
  }
44487
44496
  this.graphics.stroke();
44488
44497
  }
@@ -44545,7 +44554,7 @@ class zs {
44545
44554
  onWheelBound;
44546
44555
  canvasRoot = null;
44547
44556
  constructor(e) {
44548
- this.application = new G.Application(), this.edit = e, this.overlayContainer = new G.Container(), this.overlayContainer.sortableChildren = !0, this.onTickBound = this.onTick.bind(this), this.onBackgroundClickBound = this.onBackgroundClick.bind(this), this.onWheelBound = this.onWheel.bind(this), e.setCanvas(this);
44557
+ this.application = new H.Application(), this.edit = e, this.overlayContainer = new H.Container(), this.overlayContainer.sortableChildren = !0, this.onTickBound = this.onTick.bind(this), this.onBackgroundClickBound = this.onBackgroundClick.bind(this), this.onWheelBound = this.onWheel.bind(this), e.setCanvas(this);
44549
44558
  }
44550
44559
  /**
44551
44560
  * Set the UIController for this canvas.
@@ -44563,7 +44572,7 @@ class zs {
44563
44572
  return;
44564
44573
  }
44565
44574
  const i = e.getBoundingClientRect();
44566
- this.viewportSize = i.width > 0 && i.height > 0 ? { width: i.width, height: i.height } : { width: this.edit.size.width, height: this.edit.size.height }, this.registerExtensions(), this.container = new G.Container(), this.background = new G.Graphics(), this.background.fillStyle = { color: "#F0F1F5" }, this.background.rect(0, 0, this.viewportSize.width, this.viewportSize.height), this.background.fill(), this.viewportContainer = new G.Container(), this.viewportContainer.sortableChildren = !0, this.editBackground = new G.Graphics(), this.editBackground.fillStyle = { color: this.edit.getTimelineBackground() }, this.editBackground.rect(0, 0, this.edit.size.width, this.edit.size.height), this.editBackground.fill(), this.viewportContainer.addChild(this.editBackground), this.viewportMask = new G.Graphics(), this.viewportMask.rect(0, 0, this.edit.size.width, this.edit.size.height), this.viewportMask.fill(16777215), this.viewportContainer.addChild(this.viewportMask), this.viewportContainer.setMask({ mask: this.viewportMask }), this.alignmentGuides = new P6(this.viewportContainer, this.edit.size.width, this.edit.size.height), this.subscribeToEditEvents(), await this.configureApplication(), this.configureStage();
44575
+ this.viewportSize = i.width > 0 && i.height > 0 ? { width: i.width, height: i.height } : { width: this.edit.size.width, height: this.edit.size.height }, this.registerExtensions(), this.container = new H.Container(), this.background = new H.Graphics(), this.background.fillStyle = { color: "#F0F1F5" }, this.background.rect(0, 0, this.viewportSize.width, this.viewportSize.height), this.background.fill(), this.viewportContainer = new H.Container(), this.viewportContainer.sortableChildren = !0, this.editBackground = new H.Graphics(), this.editBackground.fillStyle = { color: this.edit.getTimelineBackground() }, this.editBackground.rect(0, 0, this.edit.size.width, this.edit.size.height), this.editBackground.fill(), this.viewportContainer.addChild(this.editBackground), this.viewportMask = new H.Graphics(), this.viewportMask.rect(0, 0, this.edit.size.width, this.edit.size.height), this.viewportMask.fill(16777215), this.viewportContainer.addChild(this.viewportMask), this.viewportContainer.setMask({ mask: this.viewportMask }), this.alignmentGuides = new P6(this.viewportContainer, this.edit.size.width, this.edit.size.height), this.subscribeToEditEvents(), await this.configureApplication(), this.configureStage();
44567
44576
  const a = this.edit.getTracks();
44568
44577
  for (let r = 0; r < a.length; r += 1)
44569
44578
  for (const n of a[r])
@@ -44604,7 +44613,7 @@ class zs {
44604
44613
  const e = document.querySelector(zs.CanvasSelector);
44605
44614
  if (!e) return;
44606
44615
  const t = e.getBoundingClientRect();
44607
- t.width <= 0 || t.height <= 0 || (this.viewportSize = { width: t.width, height: t.height }, this.application.renderer.resize(t.width, t.height), this.background && (this.background.clear(), this.background.rect(0, 0, this.viewportSize.width, this.viewportSize.height), this.background.fill({ color: 15790581 })), this.application.stage.hitArea = new G.Rectangle(0, 0, this.viewportSize.width, this.viewportSize.height), this.zoomToFit());
44616
+ t.width <= 0 || t.height <= 0 || (this.viewportSize = { width: t.width, height: t.height }, this.application.renderer.resize(t.width, t.height), this.background && (this.background.clear(), this.background.rect(0, 0, this.viewportSize.width, this.viewportSize.height), this.background.fill({ color: 15790581 })), this.application.stage.hitArea = new H.Rectangle(0, 0, this.viewportSize.width, this.viewportSize.height), this.zoomToFit());
44608
44617
  }
44609
44618
  setZoom(e) {
44610
44619
  this.viewportContainer && (this.currentZoom = Math.min(Math.max(e, this.minZoom), this.maxZoom), this.viewportContainer.scale.x = this.currentZoom, this.viewportContainer.scale.y = this.currentZoom, this.syncContentTransforms());
@@ -44672,7 +44681,7 @@ class zs {
44672
44681
  if (!this.viewportContainer) return;
44673
44682
  const i = 1e5 - (t + 1) * qa, a = `shotstack-track-${i}`;
44674
44683
  let r = this.viewportContainer.getChildByLabel(a, !1);
44675
- r || (r = new G.Container({ label: a, zIndex: i }), this.viewportContainer.addChild(r)), r.addChild(e.getContainer());
44684
+ r || (r = new H.Container({ label: a, zIndex: i }), this.viewportContainer.addChild(r)), r.addChild(e.getContainer());
44676
44685
  }
44677
44686
  /**
44678
44687
  * Move a player's container between track containers.
@@ -44682,7 +44691,7 @@ class zs {
44682
44691
  if (!this.viewportContainer || t === i) return;
44683
44692
  const a = 1e5 - (t + 1) * qa, r = 1e5 - (i + 1) * qa, n = `shotstack-track-${a}`, o = `shotstack-track-${r}`, l = this.viewportContainer.getChildByLabel(n, !1);
44684
44693
  let c = this.viewportContainer.getChildByLabel(o, !1);
44685
- c || (c = new G.Container({ label: o, zIndex: r }), this.viewportContainer.addChild(c)), l && l.removeChild(e.getContainer()), c.addChild(e.getContainer()), this.viewportContainer.sortDirty = !0;
44694
+ c || (c = new H.Container({ label: o, zIndex: r }), this.viewportContainer.addChild(c)), l && l.removeChild(e.getContainer()), c.addChild(e.getContainer()), this.viewportContainer.sortDirty = !0;
44686
44695
  }
44687
44696
  /**
44688
44697
  * Remove an empty track container.
@@ -44737,7 +44746,7 @@ class zs {
44737
44746
  this.zoomToFit();
44738
44747
  };
44739
44748
  registerExtensions() {
44740
- zs.extensionsRegistered || (G.extensions.add(new fr()), G.extensions.add(new Cr()), G.extensions.add(new hr()), zs.extensionsRegistered = !0);
44749
+ zs.extensionsRegistered || (H.extensions.add(new fr()), H.extensions.add(new Cr()), H.extensions.add(new hr()), zs.extensionsRegistered = !0);
44741
44750
  }
44742
44751
  async configureApplication() {
44743
44752
  const e = {
@@ -44764,7 +44773,7 @@ class zs {
44764
44773
  configureStage() {
44765
44774
  if (!this.container || !this.background || !this.viewportContainer)
44766
44775
  throw new Error("Shotstack canvas container not set up.");
44767
- this.container.addChild(this.background), this.container.addChild(this.viewportContainer), this.container.addChild(this.overlayContainer), this.application.stage.addChild(this.container), this.application.stage.eventMode = "static", this.application.stage.hitArea = new G.Rectangle(0, 0, this.viewportSize.width, this.viewportSize.height), this.background.eventMode = "static", this.background.on("pointerdown", this.onBackgroundClickBound);
44776
+ this.container.addChild(this.background), this.container.addChild(this.viewportContainer), this.container.addChild(this.overlayContainer), this.application.stage.addChild(this.container), this.application.stage.eventMode = "static", this.application.stage.hitArea = new H.Rectangle(0, 0, this.viewportSize.width, this.viewportSize.height), this.background.eventMode = "static", this.background.on("pointerdown", this.onBackgroundClickBound);
44768
44777
  }
44769
44778
  onBackgroundClick(e) {
44770
44779
  e.target === this.background && this.edit.getInternalEvents().emit(Be.CanvasBackgroundClicked);
@@ -45416,8 +45425,8 @@ const Zi = [
45416
45425
  }
45417
45426
  throw new TypeError(`Unhandled codec '${s}'.`);
45418
45427
  }, X6 = (s) => {
45419
- const e = s.split("."), a = (1 << 7) + 1, r = Number(e[1]), n = e[2], o = Number(n.slice(0, -1)), l = (r << 5) + o, c = n.slice(-1) === "H" ? 1 : 0, u = Number(e[3]) === 8 ? 0 : 1, f = 0, p = e[4] ? Number(e[4]) : 0, g = e[5] ? Number(e[5][0]) : 1, w = e[5] ? Number(e[5][1]) : 1, C = e[5] ? Number(e[5][2]) : 0, v = (c << 7) + (u << 6) + (f << 5) + (p << 4) + (g << 3) + (w << 2) + C;
45420
- return [a, l, v, 0];
45428
+ const e = s.split("."), a = (1 << 7) + 1, r = Number(e[1]), n = e[2], o = Number(n.slice(0, -1)), l = (r << 5) + o, c = n.slice(-1) === "H" ? 1 : 0, u = Number(e[3]) === 8 ? 0 : 1, f = 0, g = e[4] ? Number(e[4]) : 0, p = e[5] ? Number(e[5][0]) : 1, w = e[5] ? Number(e[5][1]) : 1, v = e[5] ? Number(e[5][2]) : 0, x = (c << 7) + (u << 6) + (f << 5) + (g << 4) + (p << 3) + (w << 2) + v;
45429
+ return [a, l, x, 0];
45421
45430
  }, K6 = (s, e, t) => {
45422
45431
  if (s === "aac")
45423
45432
  return e >= 2 && t <= 24e3 ? "mp4a.40.29" : t <= 24e3 ? "mp4a.40.5" : "mp4a.40.2";
@@ -45758,23 +45767,23 @@ const Jc = function* (s) {
45758
45767
  Hs(e);
45759
45768
  }
45760
45769
  te(e), e.skipBits(1);
45761
- const u = te(e), f = te(e), p = 16 * (u + 1), g = 16 * (f + 1);
45762
- let w = p, C = g;
45763
- const v = e.readBits(1);
45764
- if (v || e.skipBits(1), e.skipBits(1), e.readBits(1)) {
45770
+ const u = te(e), f = te(e), g = 16 * (u + 1), p = 16 * (f + 1);
45771
+ let w = g, v = p;
45772
+ const x = e.readBits(1);
45773
+ if (x || e.skipBits(1), e.skipBits(1), e.readBits(1)) {
45765
45774
  const K = te(e), q = te(e), ce = te(e), re = te(e);
45766
45775
  let ve, he;
45767
45776
  if ((c === 0 ? n : 0) === 0)
45768
- ve = 1, he = 2 - v;
45777
+ ve = 1, he = 2 - x;
45769
45778
  else {
45770
45779
  const we = n === 3 ? 1 : 2, Z = n === 1 ? 2 : 1;
45771
- ve = we, he = Z * (2 - v);
45780
+ ve = we, he = Z * (2 - x);
45772
45781
  }
45773
- w -= ve * (K + q), C -= he * (ce + re);
45782
+ w -= ve * (K + q), v -= he * (ce + re);
45774
45783
  }
45775
- let x = 2, T = 2, b = 2, D = 0, M = null, L = null;
45784
+ let C = 2, T = 2, b = 2, D = 0, M = null, L = null;
45776
45785
  if (e.readBits(1)) {
45777
- e.readBits(1) && e.readBits(8) === 255 && (e.skipBits(16), e.skipBits(16)), e.readBits(1) && e.skipBits(1), e.readBits(1) && (e.skipBits(3), D = e.readBits(1), e.readBits(1) && (x = e.readBits(8), T = e.readBits(8), b = e.readBits(8))), e.readBits(1) && (te(e), te(e)), e.readBits(1) && (e.skipBits(32), e.skipBits(32), e.skipBits(1));
45786
+ e.readBits(1) && e.readBits(8) === 255 && (e.skipBits(16), e.skipBits(16)), e.readBits(1) && e.skipBits(1), e.readBits(1) && (e.skipBits(3), D = e.readBits(1), e.readBits(1) && (C = e.readBits(8), T = e.readBits(8), b = e.readBits(8))), e.readBits(1) && (te(e), te(e)), e.readBits(1) && (e.skipBits(32), e.skipBits(32), e.skipBits(1));
45778
45787
  const he = e.readBits(1);
45779
45788
  he && uf(e);
45780
45789
  const Ce = e.readBits(1);
@@ -45786,7 +45795,7 @@ const Jc = function* (s) {
45786
45795
  if ((i === 44 || i === 86 || i === 100 || i === 110 || i === 122 || i === 244) && K)
45787
45796
  M = 0, L = 0;
45788
45797
  else {
45789
- const q = u + 1, ce = f + 1, re = (2 - v) * ce, ve = Jn.find((Ce) => Ce.level >= r) ?? $t(Jn), he = Math.min(Math.floor(ve.maxDpbMbs / (q * re)), 16);
45798
+ const q = u + 1, ce = f + 1, re = (2 - x) * ce, ve = Jn.find((Ce) => Ce.level >= r) ?? $t(Jn), he = Math.min(Math.floor(ve.maxDpbMbs / (q * re)), 16);
45790
45799
  M = he, L = he;
45791
45800
  }
45792
45801
  }
@@ -45794,15 +45803,15 @@ const Jc = function* (s) {
45794
45803
  profileIdc: i,
45795
45804
  constraintFlags: a,
45796
45805
  levelIdc: r,
45797
- frameMbsOnlyFlag: v,
45806
+ frameMbsOnlyFlag: x,
45798
45807
  chromaFormatIdc: n,
45799
45808
  bitDepthLumaMinus8: o,
45800
45809
  bitDepthChromaMinus8: l,
45801
- codedWidth: p,
45802
- codedHeight: g,
45810
+ codedWidth: g,
45811
+ codedHeight: p,
45803
45812
  displayWidth: w,
45804
- displayHeight: C,
45805
- colourPrimaries: x,
45813
+ displayHeight: v,
45814
+ colourPrimaries: C,
45806
45815
  matrixCoefficients: b,
45807
45816
  transferCharacteristics: T,
45808
45817
  fullRangeFlag: D,
@@ -45827,19 +45836,19 @@ const Jc = function* (s) {
45827
45836
  const d = te(e);
45828
45837
  let u = 0;
45829
45838
  d === 3 && (u = e.readBits(1));
45830
- const f = te(e), p = te(e);
45831
- let g = f, w = p;
45839
+ const f = te(e), g = te(e);
45840
+ let p = f, w = g;
45832
45841
  if (e.readBits(1)) {
45833
45842
  const q = te(e), ce = te(e), re = te(e), ve = te(e);
45834
45843
  let he = 1, Ce = 1;
45835
45844
  const we = u === 0 ? d : 0;
45836
- we === 1 ? (he = 2, Ce = 2) : we === 2 && (he = 2, Ce = 1), g -= (q + ce) * he, w -= (re + ve) * Ce;
45845
+ we === 1 ? (he = 2, Ce = 2) : we === 2 && (he = 2, Ce = 1), p -= (q + ce) * he, w -= (re + ve) * Ce;
45837
45846
  }
45838
- const C = te(e), v = te(e);
45847
+ const v = te(e), x = te(e);
45839
45848
  te(e);
45840
- const x = e.readBits(1) ? 0 : t;
45849
+ const C = e.readBits(1) ? 0 : t;
45841
45850
  let T = 0;
45842
- for (let q = x; q <= t; q++)
45851
+ for (let q = C; q <= t; q++)
45843
45852
  te(e), T = te(e), te(e);
45844
45853
  te(e), te(e), te(e), te(e), te(e), te(e), e.readBits(1) && e.readBits(1) && y8(e), e.skipBits(1), e.skipBits(1), e.readBits(1) && (e.skipBits(4), e.skipBits(4), te(e), te(e), e.skipBits(1));
45845
45854
  const b = te(e);
@@ -45855,7 +45864,7 @@ const Jc = function* (s) {
45855
45864
  D = q.colourPrimaries, M = q.transferCharacteristics, L = q.matrixCoefficients, Q = q.fullRangeFlag, K = q.minSpatialSegmentationIdc;
45856
45865
  }
45857
45866
  return {
45858
- displayWidth: g,
45867
+ displayWidth: p,
45859
45868
  displayHeight: w,
45860
45869
  colourPrimaries: D,
45861
45870
  transferCharacteristics: M,
@@ -45871,8 +45880,8 @@ const Jc = function* (s) {
45871
45880
  generalConstraintIndicatorFlags: l,
45872
45881
  generalLevelIdc: c,
45873
45882
  chromaFormatIdc: d,
45874
- bitDepthLumaMinus8: C,
45875
- bitDepthChromaMinus8: v,
45883
+ bitDepthLumaMinus8: v,
45884
+ bitDepthChromaMinus8: x,
45876
45885
  minSpatialSegmentationIdc: K
45877
45886
  };
45878
45887
  } catch (e) {
@@ -46449,8 +46458,8 @@ class Oi {
46449
46458
  });
46450
46459
  }
46451
46460
  draw(e, t, i, a, r, n, o, l, c) {
46452
- let d = 0, u = 0, f = this.displayWidth, p = this.displayHeight, g = 0, w = 0, C = this.displayWidth, v = this.displayHeight;
46453
- if (n !== void 0 ? (d = t, u = i, f = a, p = r, g = n, w = o, l !== void 0 ? (C = l, v = c) : (C = f, v = p)) : (g = t, w = i, a !== void 0 && (C = a, v = r)), !(typeof CanvasRenderingContext2D < "u" && e instanceof CanvasRenderingContext2D || typeof OffscreenCanvasRenderingContext2D < "u" && e instanceof OffscreenCanvasRenderingContext2D))
46461
+ let d = 0, u = 0, f = this.displayWidth, g = this.displayHeight, p = 0, w = 0, v = this.displayWidth, x = this.displayHeight;
46462
+ if (n !== void 0 ? (d = t, u = i, f = a, g = r, p = n, w = o, l !== void 0 ? (v = l, x = c) : (v = f, x = g)) : (p = t, w = i, a !== void 0 && (v = a, x = r)), !(typeof CanvasRenderingContext2D < "u" && e instanceof CanvasRenderingContext2D || typeof OffscreenCanvasRenderingContext2D < "u" && e instanceof OffscreenCanvasRenderingContext2D))
46454
46463
  throw new TypeError("context must be a CanvasRenderingContext2D or OffscreenCanvasRenderingContext2D.");
46455
46464
  if (!Number.isFinite(d))
46456
46465
  throw new TypeError("sx must be a number.");
@@ -46458,25 +46467,25 @@ class Oi {
46458
46467
  throw new TypeError("sy must be a number.");
46459
46468
  if (!Number.isFinite(f) || f < 0)
46460
46469
  throw new TypeError("sWidth must be a non-negative number.");
46461
- if (!Number.isFinite(p) || p < 0)
46470
+ if (!Number.isFinite(g) || g < 0)
46462
46471
  throw new TypeError("sHeight must be a non-negative number.");
46463
- if (!Number.isFinite(g))
46472
+ if (!Number.isFinite(p))
46464
46473
  throw new TypeError("dx must be a number.");
46465
46474
  if (!Number.isFinite(w))
46466
46475
  throw new TypeError("dy must be a number.");
46467
- if (!Number.isFinite(C) || C < 0)
46468
- throw new TypeError("dWidth must be a non-negative number.");
46469
46476
  if (!Number.isFinite(v) || v < 0)
46477
+ throw new TypeError("dWidth must be a non-negative number.");
46478
+ if (!Number.isFinite(x) || x < 0)
46470
46479
  throw new TypeError("dHeight must be a non-negative number.");
46471
46480
  if (this._closed)
46472
46481
  throw new Error("VideoSample is closed.");
46473
- ({ sx: d, sy: u, sWidth: f, sHeight: p } = this._rotateSourceRegion(d, u, f, p, this.rotation));
46482
+ ({ sx: d, sy: u, sWidth: f, sHeight: g } = this._rotateSourceRegion(d, u, f, g, this.rotation));
46474
46483
  const S = this.toCanvasImageSource();
46475
46484
  e.save();
46476
- const x = g + C / 2, T = w + v / 2;
46477
- e.translate(x, T), e.rotate(this.rotation * Math.PI / 180);
46478
- const b = this.rotation % 180 === 0 ? 1 : C / v;
46479
- e.scale(1 / b, b), e.drawImage(S, d, u, f, p, -C / 2, -v / 2, C, v), e.restore();
46485
+ const C = p + v / 2, T = w + x / 2;
46486
+ e.translate(C, T), e.rotate(this.rotation * Math.PI / 180);
46487
+ const b = this.rotation % 180 === 0 ? 1 : v / x;
46488
+ e.scale(1 / b, b), e.drawImage(S, d, u, f, g, -v / 2, -x / 2, v, x), e.restore();
46480
46489
  }
46481
46490
  /**
46482
46491
  * Draws the sample in the middle of the canvas corresponding to the context with the specified fit behavior.
@@ -46494,16 +46503,16 @@ class Oi {
46494
46503
  const i = e.canvas.width, a = e.canvas.height, r = t.rotation ?? this.rotation, [n, o] = r % 180 === 0 ? [this.codedWidth, this.codedHeight] : [this.codedHeight, this.codedWidth];
46495
46504
  t.crop && N8(t.crop, n, o);
46496
46505
  let l, c, d, u;
46497
- const { sx: f, sy: p, sWidth: g, sHeight: w } = this._rotateSourceRegion(t.crop?.left ?? 0, t.crop?.top ?? 0, t.crop?.width ?? n, t.crop?.height ?? o, r);
46506
+ const { sx: f, sy: g, sWidth: p, sHeight: w } = this._rotateSourceRegion(t.crop?.left ?? 0, t.crop?.top ?? 0, t.crop?.width ?? n, t.crop?.height ?? o, r);
46498
46507
  if (t.fit === "fill")
46499
46508
  l = 0, c = 0, d = i, u = a;
46500
46509
  else {
46501
- const [v, S] = t.crop ? [t.crop.width, t.crop.height] : [n, o], x = t.fit === "contain" ? Math.min(i / v, a / S) : Math.max(i / v, a / S);
46502
- d = v * x, u = S * x, l = (i - d) / 2, c = (a - u) / 2;
46510
+ const [x, S] = t.crop ? [t.crop.width, t.crop.height] : [n, o], C = t.fit === "contain" ? Math.min(i / x, a / S) : Math.max(i / x, a / S);
46511
+ d = x * C, u = S * C, l = (i - d) / 2, c = (a - u) / 2;
46503
46512
  }
46504
46513
  e.save();
46505
- const C = r % 180 === 0 ? 1 : d / u;
46506
- e.translate(i / 2, a / 2), e.rotate(r * Math.PI / 180), e.scale(1 / C, C), e.translate(-i / 2, -a / 2), e.drawImage(this.toCanvasImageSource(), f, p, g, w, l, c, d, u), e.restore();
46514
+ const v = r % 180 === 0 ? 1 : d / u;
46515
+ e.translate(i / 2, a / 2), e.rotate(r * Math.PI / 180), e.scale(1 / v, v), e.translate(-i / 2, -a / 2), e.drawImage(this.toCanvasImageSource(), f, g, p, w, l, c, d, u), e.restore();
46507
46516
  }
46508
46517
  /** @internal */
46509
46518
  _rotateSourceRegion(e, t, i, a, r) {
@@ -46788,38 +46797,38 @@ class oi {
46788
46797
  const f = r !== void 0 ? r : c - u;
46789
46798
  if (f > c - u)
46790
46799
  throw new RangeError("frameCount out of range");
46791
- const p = Pi(l), g = fa(l);
46792
- if (g && i >= d)
46800
+ const g = Pi(l), p = fa(l);
46801
+ if (p && i >= d)
46793
46802
  throw new RangeError("planeIndex out of range");
46794
- if (!g && i !== 0)
46803
+ if (!p && i !== 0)
46795
46804
  throw new RangeError("planeIndex out of range");
46796
- const C = (g ? f : f * d) * p;
46797
- if (e.byteLength < C)
46805
+ const v = (p ? f : f * d) * g;
46806
+ if (e.byteLength < v)
46798
46807
  throw new RangeError("Destination buffer is too small");
46799
- const v = ri(e), S = C0(l);
46808
+ const x = ri(e), S = C0(l);
46800
46809
  if (Ya(this._data))
46801
- W6() && d > 2 && l !== o ? _8(this._data, v, o, l, d, i, u, f) : this._data.copyTo(e, {
46810
+ W6() && d > 2 && l !== o ? _8(this._data, x, o, l, d, i, u, f) : this._data.copyTo(e, {
46802
46811
  planeIndex: i,
46803
46812
  frameOffset: u,
46804
46813
  frameCount: f,
46805
46814
  format: l
46806
46815
  });
46807
46816
  else {
46808
- const x = this._data, T = ri(x), b = x0(o), D = Pi(o), M = fa(o);
46817
+ const C = this._data, T = ri(C), b = x0(o), D = Pi(o), M = fa(o);
46809
46818
  for (let L = 0; L < f; L++)
46810
- if (g) {
46811
- const Q = L * p;
46819
+ if (p) {
46820
+ const Q = L * g;
46812
46821
  let K;
46813
46822
  M ? K = (i * c + (L + u)) * D : K = ((L + u) * d + i) * D;
46814
46823
  const q = b(T, K);
46815
- S(v, Q, q);
46824
+ S(x, Q, q);
46816
46825
  } else
46817
46826
  for (let Q = 0; Q < d; Q++) {
46818
- const q = (L * d + Q) * p;
46827
+ const q = (L * d + Q) * g;
46819
46828
  let ce;
46820
46829
  M ? ce = (Q * c + (L + u)) * D : ce = ((L + u) * d + Q) * D;
46821
46830
  const re = b(T, ce);
46822
- S(v, q, re);
46831
+ S(x, q, re);
46823
46832
  }
46824
46833
  }
46825
46834
  }
@@ -46946,9 +46955,9 @@ class oi {
46946
46955
  const d = [];
46947
46956
  for (; c > 0; ) {
46948
46957
  const u = Math.min(o, c), f = new Float32Array(a * u);
46949
- for (let g = 0; g < a; g++)
46950
- e.copyFromChannel(f.subarray(g * u, (g + 1) * u), g, l);
46951
- const p = new oi({
46958
+ for (let p = 0; p < a; p++)
46959
+ e.copyFromChannel(f.subarray(p * u, (p + 1) * u), p, l);
46960
+ const g = new oi({
46952
46961
  format: "f32-planar",
46953
46962
  sampleRate: r,
46954
46963
  numberOfFrames: u,
@@ -46956,7 +46965,7 @@ class oi {
46956
46965
  timestamp: t + l / r,
46957
46966
  data: f
46958
46967
  });
46959
- d.push(p), l += u, c -= u;
46968
+ d.push(g), l += u, c -= u;
46960
46969
  }
46961
46970
  return d;
46962
46971
  }
@@ -47022,55 +47031,55 @@ const Pi = (s) => {
47022
47031
  const l = x0(t), c = C0(i), d = Pi(t), u = Pi(i), f = fa(t);
47023
47032
  if (fa(i))
47024
47033
  if (f) {
47025
- const g = new ArrayBuffer(o * d), w = ri(g);
47026
- s.copyTo(g, {
47034
+ const p = new ArrayBuffer(o * d), w = ri(p);
47035
+ s.copyTo(p, {
47027
47036
  planeIndex: r,
47028
47037
  frameOffset: n,
47029
47038
  frameCount: o,
47030
47039
  format: t
47031
47040
  });
47032
- for (let C = 0; C < o; C++) {
47033
- const v = C * d, S = C * u, x = l(w, v);
47034
- c(e, S, x);
47041
+ for (let v = 0; v < o; v++) {
47042
+ const x = v * d, S = v * u, C = l(w, x);
47043
+ c(e, S, C);
47035
47044
  }
47036
47045
  } else {
47037
- const g = new ArrayBuffer(o * a * d), w = ri(g);
47038
- s.copyTo(g, {
47046
+ const p = new ArrayBuffer(o * a * d), w = ri(p);
47047
+ s.copyTo(p, {
47039
47048
  planeIndex: 0,
47040
47049
  frameOffset: n,
47041
47050
  frameCount: o,
47042
47051
  format: t
47043
47052
  });
47044
- for (let C = 0; C < o; C++) {
47045
- const v = (C * a + r) * d, S = C * u, x = l(w, v);
47046
- c(e, S, x);
47053
+ for (let v = 0; v < o; v++) {
47054
+ const x = (v * a + r) * d, S = v * u, C = l(w, x);
47055
+ c(e, S, C);
47047
47056
  }
47048
47057
  }
47049
47058
  else if (f) {
47050
- const g = o * d, w = new ArrayBuffer(g), C = ri(w);
47051
- for (let v = 0; v < a; v++) {
47059
+ const p = o * d, w = new ArrayBuffer(p), v = ri(w);
47060
+ for (let x = 0; x < a; x++) {
47052
47061
  s.copyTo(w, {
47053
- planeIndex: v,
47062
+ planeIndex: x,
47054
47063
  frameOffset: n,
47055
47064
  frameCount: o,
47056
47065
  format: t
47057
47066
  });
47058
47067
  for (let S = 0; S < o; S++) {
47059
- const x = S * d, T = (S * a + v) * u, b = l(C, x);
47068
+ const C = S * d, T = (S * a + x) * u, b = l(v, C);
47060
47069
  c(e, T, b);
47061
47070
  }
47062
47071
  }
47063
47072
  } else {
47064
- const g = new ArrayBuffer(o * a * d), w = ri(g);
47065
- s.copyTo(g, {
47073
+ const p = new ArrayBuffer(o * a * d), w = ri(p);
47074
+ s.copyTo(p, {
47066
47075
  planeIndex: 0,
47067
47076
  frameOffset: n,
47068
47077
  frameCount: o,
47069
47078
  format: t
47070
47079
  });
47071
- for (let C = 0; C < o; C++)
47072
- for (let v = 0; v < a; v++) {
47073
- const S = C * a + v, x = S * d, T = S * u, b = l(w, x);
47080
+ for (let v = 0; v < o; v++)
47081
+ for (let x = 0; x < a; x++) {
47082
+ const S = v * a + x, C = S * d, T = S * u, b = l(w, C);
47074
47083
  c(e, T, b);
47075
47084
  }
47076
47085
  }
@@ -47912,23 +47921,23 @@ const ze = /* @__PURE__ */ new Uint8Array(8), _s = /* @__PURE__ */ new DataView(
47912
47921
  // Base Media Decode Time
47913
47922
  ])), VT = (s) => {
47914
47923
  J(s.currentChunk);
47915
- const e = s.currentChunk.samples.map((w) => w.timescaleUnitsToNextSample), t = s.currentChunk.samples.map((w) => w.size), i = s.currentChunk.samples.map(N0), a = s.currentChunk.samples.map((w) => At(w.timestamp - w.decodeTimestamp, s.timescale)), r = new Set(e), n = new Set(t), o = new Set(i), l = new Set(a), c = o.size === 2 && i[0] !== i[1], d = r.size > 1, u = n.size > 1, f = !c && o.size > 1, p = l.size > 1 || [...l].some((w) => w !== 0);
47916
- let g = 0;
47917
- return g |= 1, g |= 4 * +c, g |= 256 * +d, g |= 512 * +u, g |= 1024 * +f, g |= 2048 * +p, We("trun", 1, g, [
47924
+ const e = s.currentChunk.samples.map((w) => w.timescaleUnitsToNextSample), t = s.currentChunk.samples.map((w) => w.size), i = s.currentChunk.samples.map(N0), a = s.currentChunk.samples.map((w) => At(w.timestamp - w.decodeTimestamp, s.timescale)), r = new Set(e), n = new Set(t), o = new Set(i), l = new Set(a), c = o.size === 2 && i[0] !== i[1], d = r.size > 1, u = n.size > 1, f = !c && o.size > 1, g = l.size > 1 || [...l].some((w) => w !== 0);
47925
+ let p = 0;
47926
+ return p |= 1, p |= 4 * +c, p |= 256 * +d, p |= 512 * +u, p |= 1024 * +f, p |= 2048 * +g, We("trun", 1, p, [
47918
47927
  $(s.currentChunk.samples.length),
47919
47928
  // Sample count
47920
47929
  $(s.currentChunk.offset - s.currentChunk.moofOffset || 0),
47921
47930
  // Data offset
47922
47931
  c ? $(i[0]) : [],
47923
- s.currentChunk.samples.map((w, C) => [
47924
- d ? $(e[C]) : [],
47932
+ s.currentChunk.samples.map((w, v) => [
47933
+ d ? $(e[v]) : [],
47925
47934
  // Sample duration
47926
- u ? $(t[C]) : [],
47935
+ u ? $(t[v]) : [],
47927
47936
  // Sample size
47928
- f ? $(i[C]) : [],
47937
+ f ? $(i[v]) : [],
47929
47938
  // Sample flags
47930
47939
  // Sample composition time offsets
47931
- p ? si(a[C]) : []
47940
+ g ? si(a[v]) : []
47932
47941
  ])
47933
47942
  ]);
47934
47943
  }, _T = (s) => be("mfra", void 0, [
@@ -48677,13 +48686,13 @@ class QT extends z8 {
48677
48686
  break;
48678
48687
  xf.lastIndex = 0;
48679
48688
  const u = xf.test(d.text), f = d.timestamp + d.duration;
48680
- let p = e.cueToSourceId.get(d);
48681
- if (p === void 0 && n < f && (p = e.nextSourceId++, e.cueToSourceId.set(d, p)), d.notes) {
48689
+ let g = e.cueToSourceId.get(d);
48690
+ if (g === void 0 && n < f && (g = e.nextSourceId++, e.cueToSourceId.set(d, g)), d.notes) {
48682
48691
  const w = DT(d.notes);
48683
48692
  this.auxBoxWriter.writeBox(w);
48684
48693
  }
48685
- const g = OT(d.text, u ? r : null, d.identifier ?? null, d.settings ?? null, p ?? null);
48686
- this.auxBoxWriter.writeBox(g), f === n && e.cueQueue.splice(c--, 1);
48694
+ const p = OT(d.text, u ? r : null, d.identifier ?? null, d.settings ?? null, g ?? null);
48695
+ this.auxBoxWriter.writeBox(p), f === n && e.cueQueue.splice(c--, 1);
48687
48696
  }
48688
48697
  const o = this.auxWriter.getSlice(0, this.auxWriter.getPos()), l = this.createSampleForTrack(e, o, r, n - r, "key");
48689
48698
  await this.registerSample(e, l), e.lastCueEndTimestamp = n;
@@ -48838,42 +48847,42 @@ class QT extends z8 {
48838
48847
  const t = this.nextFragmentNumber++;
48839
48848
  if (t === 1) {
48840
48849
  this.format._options.onMoov && this.writer.startTrackingWrites();
48841
- const p = ja(this);
48842
- if (this.boxWriter.writeBox(p), this.format._options.onMoov) {
48843
- const { data: g, start: w } = this.writer.stopTrackingWrites();
48844
- this.format._options.onMoov(g, w);
48850
+ const g = ja(this);
48851
+ if (this.boxWriter.writeBox(g), this.format._options.onMoov) {
48852
+ const { data: p, start: w } = this.writer.stopTrackingWrites();
48853
+ this.format._options.onMoov(p, w);
48845
48854
  }
48846
48855
  }
48847
- const i = this.trackDatas.filter((p) => p.currentChunk), a = Sf(t, i), r = this.writer.getPos(), n = r + this.boxWriter.measureBox(a);
48856
+ const i = this.trackDatas.filter((g) => g.currentChunk), a = Sf(t, i), r = this.writer.getPos(), n = r + this.boxWriter.measureBox(a);
48848
48857
  let o = n + hl, l = 1 / 0;
48849
- for (const p of i) {
48850
- p.currentChunk.offset = o, p.currentChunk.moofOffset = r;
48851
- for (const g of p.currentChunk.samples)
48852
- o += g.size;
48853
- l = Math.min(l, p.currentChunk.startTimestamp);
48858
+ for (const g of i) {
48859
+ g.currentChunk.offset = o, g.currentChunk.moofOffset = r;
48860
+ for (const p of g.currentChunk.samples)
48861
+ o += p.size;
48862
+ l = Math.min(l, g.currentChunk.startTimestamp);
48854
48863
  }
48855
48864
  const c = o - n, d = c >= 2 ** 32;
48856
48865
  if (d)
48857
- for (const p of i)
48858
- p.currentChunk.offset += wf - hl;
48866
+ for (const g of i)
48867
+ g.currentChunk.offset += wf - hl;
48859
48868
  this.format._options.onMoof && this.writer.startTrackingWrites();
48860
48869
  const u = Sf(t, i);
48861
48870
  if (this.boxWriter.writeBox(u), this.format._options.onMoof) {
48862
- const { data: p, start: g } = this.writer.stopTrackingWrites();
48863
- this.format._options.onMoof(p, g, l);
48871
+ const { data: g, start: p } = this.writer.stopTrackingWrites();
48872
+ this.format._options.onMoof(g, p, l);
48864
48873
  }
48865
48874
  J(this.writer.getPos() === n), this.format._options.onMdat && this.writer.startTrackingWrites();
48866
48875
  const f = nn(d);
48867
48876
  f.size = c, this.boxWriter.writeBox(f), this.writer.seek(n + (d ? wf : hl));
48868
- for (const p of i)
48869
- for (const g of p.currentChunk.samples)
48870
- this.writer.write(g.data), g.data = null;
48877
+ for (const g of i)
48878
+ for (const p of g.currentChunk.samples)
48879
+ this.writer.write(p.data), p.data = null;
48871
48880
  if (this.format._options.onMdat) {
48872
- const { data: p, start: g } = this.writer.stopTrackingWrites();
48873
- this.format._options.onMdat(p, g);
48881
+ const { data: g, start: p } = this.writer.stopTrackingWrites();
48882
+ this.format._options.onMdat(g, p);
48874
48883
  }
48875
- for (const p of i)
48876
- p.finalizedChunks.push(p.currentChunk), this.finalizedChunks.push(p.currentChunk), p.currentChunk = null;
48884
+ for (const g of i)
48885
+ g.finalizedChunks.push(g.currentChunk), this.finalizedChunks.push(g.currentChunk), g.currentChunk = null;
48877
48886
  e && await this.writer.flush();
48878
48887
  }
48879
48888
  async registerSampleFastStartReserve(e, t) {
@@ -49419,30 +49428,30 @@ class aE {
49419
49428
  throw new Error(`This specific encoder configuration (${i.codec}, ${i.bitrate} bps, ${i.width}x${i.height}, hardware acceleration: ${i.hardwareAcceleration ?? "no-preference"}) is not supported by this browser. Consider using another codec or changing your video parameters.`);
49420
49429
  const o = [], l = [];
49421
49430
  let c = 0, d = 0;
49422
- const u = (f, p, g) => {
49431
+ const u = (f, g, p) => {
49423
49432
  const w = {};
49424
- if (p) {
49425
- const v = new Uint8Array(p.byteLength);
49426
- p.copyTo(v), w.alpha = v;
49433
+ if (g) {
49434
+ const x = new Uint8Array(g.byteLength);
49435
+ g.copyTo(x), w.alpha = x;
49427
49436
  }
49428
- const C = ui.fromEncodedChunk(f, w);
49429
- this.encodingConfig.onEncodedPacket?.(C, g), this.muxer.addEncodedVideoPacket(this.source._connectedTrack, C, g).catch((v) => {
49430
- this.error ??= v, this.errorNeedsNewStack = !1;
49437
+ const v = ui.fromEncodedChunk(f, w);
49438
+ this.encodingConfig.onEncodedPacket?.(v, p), this.muxer.addEncodedVideoPacket(this.source._connectedTrack, v, p).catch((x) => {
49439
+ this.error ??= x, this.errorNeedsNewStack = !1;
49431
49440
  });
49432
49441
  };
49433
49442
  this.encoder = new VideoEncoder({
49434
- output: (f, p) => {
49443
+ output: (f, g) => {
49435
49444
  if (!this.alphaEncoder) {
49436
- u(f, null, p);
49445
+ u(f, null, g);
49437
49446
  return;
49438
49447
  }
49439
- const g = this.alphaFrameQueue.shift();
49440
- J(g !== void 0), g ? (this.alphaEncoder.encode(g, {
49448
+ const p = this.alphaFrameQueue.shift();
49449
+ J(p !== void 0), p ? (this.alphaEncoder.encode(p, {
49441
49450
  // Crucial: The alpha frame is forced to be a key frame whenever the color frame
49442
49451
  // also is. Without this, playback can glitch and even crash in some browsers.
49443
49452
  // This is the reason why the two encoders are wired in series and not in parallel.
49444
49453
  keyFrame: f.type === "key"
49445
- }), d++, g.close(), o.push({ chunk: f, meta: p })) : d === 0 ? u(f, null, p) : (l.push(c + d), o.push({ chunk: f, meta: p }));
49454
+ }), d++, p.close(), o.push({ chunk: f, meta: g })) : d === 0 ? u(f, null, g) : (l.push(c + d), o.push({ chunk: f, meta: g }));
49446
49455
  },
49447
49456
  error: (f) => {
49448
49457
  f.stack = t.stack, this.error ??= f;
@@ -49450,10 +49459,10 @@ class aE {
49450
49459
  }), this.encoder.configure(i), this.encodingConfig.alpha === "keep" && (this.alphaEncoder = new VideoEncoder({
49451
49460
  // We ignore the alpha chunk's metadata
49452
49461
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
49453
- output: (f, p) => {
49462
+ output: (f, g) => {
49454
49463
  d--;
49455
- const g = o.shift();
49456
- for (J(g !== void 0), u(g.chunk, f, g.meta), c++; l.length > 0 && l[0] === c; ) {
49464
+ const p = o.shift();
49465
+ for (J(p !== void 0), u(p.chunk, f, p.meta), c++; l.length > 0 && l[0] === c; ) {
49457
49466
  l.shift();
49458
49467
  const w = o.shift();
49459
49468
  J(w !== void 0), u(w.chunk, null, w.meta);
@@ -49719,16 +49728,16 @@ class oE {
49719
49728
  J(this.outputSampleSize), J(this.writeOutputValue);
49720
49729
  const { numberOfChannels: i, numberOfFrames: a, sampleRate: r, timestamp: n } = e, o = 2048, l = [];
49721
49730
  for (let f = 0; f < a; f += o) {
49722
- const p = Math.min(o, e.numberOfFrames - f), g = p * i * this.outputSampleSize, w = new ArrayBuffer(g), C = new DataView(w);
49723
- l.push({ frameCount: p, view: C });
49731
+ const g = Math.min(o, e.numberOfFrames - f), p = g * i * this.outputSampleSize, w = new ArrayBuffer(p), v = new DataView(w);
49732
+ l.push({ frameCount: g, view: v });
49724
49733
  }
49725
49734
  const c = e.allocationSize({ planeIndex: 0, format: "f32-planar" }), d = new Float32Array(c / Float32Array.BYTES_PER_ELEMENT);
49726
49735
  for (let f = 0; f < i; f++) {
49727
49736
  e.copyTo(d, { planeIndex: f, format: "f32-planar" });
49728
- for (let p = 0; p < l.length; p++) {
49729
- const { frameCount: g, view: w } = l[p];
49730
- for (let C = 0; C < g; C++)
49731
- this.writeOutputValue(w, (C * i + f) * this.outputSampleSize, d[p * o + C]);
49737
+ for (let g = 0; g < l.length; g++) {
49738
+ const { frameCount: p, view: w } = l[g];
49739
+ for (let v = 0; v < p; v++)
49740
+ this.writeOutputValue(w, (v * i + f) * this.outputSampleSize, d[g * o + v]);
49732
49741
  }
49733
49742
  }
49734
49743
  t && e.close();
@@ -49740,8 +49749,8 @@ class oE {
49740
49749
  }
49741
49750
  };
49742
49751
  for (let f = 0; f < l.length; f++) {
49743
- const { frameCount: p, view: g } = l[f], w = g.buffer, C = f * o, v = new ui(new Uint8Array(w), "key", n + C / r, p / r);
49744
- this.encodingConfig.onEncodedPacket?.(v, u), await this.muxer.addEncodedAudioPacket(this.source._connectedTrack, v, u);
49752
+ const { frameCount: g, view: p } = l[f], w = p.buffer, v = f * o, x = new ui(new Uint8Array(w), "key", n + v / r, g / r);
49753
+ this.encodingConfig.onEncodedPacket?.(x, u), await this.muxer.addEncodedAudioPacket(this.source._connectedTrack, x, u);
49745
49754
  }
49746
49755
  }
49747
49756
  ensureEncoder(e) {
@@ -50218,7 +50227,7 @@ class gE {
50218
50227
  const n = document.createElement("canvas");
50219
50228
  n.width = i.width, n.height = i.height;
50220
50229
  const o = n.getContext("2d");
50221
- o && (o.putImageData(i, 0, 0), r = G.Texture.from(n), this.textureCache.set(a, r));
50230
+ o && (o.putImageData(i, 0, 0), r = H.Texture.from(n), this.textureCache.set(a, r));
50222
50231
  }
50223
50232
  r && e.texture && (e.originalTextureSource || (e.originalTextureSource = e.texture.source, e.texture.source?.resource instanceof HTMLVideoElement && (e.originalVideoElement = e.texture.source.resource)), e.texture = r, e.sprite?.texture && (e.sprite.texture = r), e.lastReplacedTimestamp = t);
50224
50233
  }
@@ -50283,8 +50292,8 @@ class V9 {
50283
50292
  await r.start(), c && (this.progressUI.update(20, 100, "Encoding audio..."), await this.audioProcessor.processAudioSamples(c)), this.progressUI.update(25, 100, "Exporting..."), await this.processFrames(a, l, n, o), await r.finalize();
50284
50293
  const d = r.target.buffer;
50285
50294
  if (!d) throw new Error("No video data");
50286
- const u = new Blob([d], { type: "video/mp4" }), f = URL.createObjectURL(u), p = document.createElement("a");
50287
- p.href = f, p.download = e, p.click(), URL.revokeObjectURL(f), this.progressUI.update(100, 100, "Complete!");
50295
+ const u = new Blob([d], { type: "video/mp4" }), f = URL.createObjectURL(u), g = document.createElement("a");
50296
+ g.href = f, g.download = e, g.click(), URL.revokeObjectURL(f), this.progressUI.update(100, 100, "Complete!");
50288
50297
  } catch (a) {
50289
50298
  throw a instanceof mn ? a : new mn(`Export failed: ${a}`, "export");
50290
50299
  } finally {
@@ -50301,13 +50310,13 @@ class V9 {
50301
50310
  for (const u of this.exportCommand.getClips())
50302
50311
  u.update(0, 0);
50303
50312
  for (const u of n) {
50304
- const f = u.getStart?.() || 0, p = u.getEnd?.() || f + (u.getLength?.() || 0);
50305
- l >= f && l < p && await this.videoProcessor.replaceVideoTexture(u, l);
50313
+ const f = u.getStart?.() || 0, g = u.getEnd?.() || f + (u.getLength?.() || 0);
50314
+ l >= f && l < g && await this.videoProcessor.replaceVideoTexture(u, l);
50306
50315
  }
50307
50316
  this.app.renderer.render(this.app.stage);
50308
50317
  const c = this.app.renderer.extract.pixels({
50309
50318
  target: r,
50310
- frame: new G.Rectangle(0, 0, e.size.width, e.size.height)
50319
+ frame: new H.Rectangle(0, 0, e.size.width, e.size.height)
50311
50320
  }), d = new ImageData(new Uint8ClampedArray(c.pixels), c.width, c.height);
50312
50321
  a.putImageData(d, 0, 0), await t.add(o / e.fps, 1 / e.fps), this.progressUI.update(25 + Math.round((o + 1) / e.frames * 75), 100, "Exporting...");
50313
50322
  }
@@ -50345,7 +50354,7 @@ class V9 {
50345
50354
  if (this.isVideoPlayer(i)) {
50346
50355
  const a = i;
50347
50356
  if (a.skipVideoUpdate = !1, a.originalVideoElement && a.texture) {
50348
- const r = G.Texture.from(a.originalVideoElement);
50357
+ const r = H.Texture.from(a.originalVideoElement);
50349
50358
  a.texture = r, a.sprite && (a.sprite.texture = r), delete a.originalVideoElement, delete a.originalTextureSource, delete a.lastReplacedTimestamp;
50350
50359
  } else a.originalTextureSource && a.texture && (a.texture.source = a.originalTextureSource, delete a.originalTextureSource, delete a.lastReplacedTimestamp);
50351
50360
  }
@@ -50386,7 +50395,7 @@ class ii {
50386
50395
  const n = t.getClip(this.effectiveToTrackIndex, this.newClipIndex);
50387
50396
  if (!this.previousDocClip || !n)
50388
50397
  throw new Error(`MoveClipCommand: document clip not found after mutation at ${this.effectiveToTrackIndex}/${this.newClipIndex}`);
50389
- e.emitEvent(H.ClipUpdated, {
50398
+ e.emitEvent(G.ClipUpdated, {
50390
50399
  previous: {
50391
50400
  clip: Oe(this.previousDocClip),
50392
50401
  trackIndex: this.fromTrackIndex,
@@ -50399,7 +50408,7 @@ class ii {
50399
50408
  }
50400
50409
  });
50401
50410
  const o = this.clipId ? e.getPlayerByClipId(this.clipId) : i;
50402
- return o && (e.setSelectedClip(o), e.emitEvent(H.ClipSelected, {
50411
+ return o && (e.setSelectedClip(o), e.emitEvent(G.ClipSelected, {
50403
50412
  clip: Oe(n),
50404
50413
  trackIndex: this.effectiveToTrackIndex,
50405
50414
  clipIndex: this.newClipIndex
@@ -50418,7 +50427,7 @@ class ii {
50418
50427
  start: this.originalStart
50419
50428
  }), e.resolve(), e.updateDuration(), this.fromTrackIndex !== this.effectiveToTrackIndex && e.propagateTimingChanges(this.effectiveToTrackIndex, this.newClipIndex - 1), e.propagateTimingChanges(this.fromTrackIndex, this.fromClipIndex);
50420
50429
  const r = t.getClip(this.fromTrackIndex, this.fromClipIndex);
50421
- this.previousDocClip && e.emitEvent(H.ClipUpdated, {
50430
+ this.previousDocClip && e.emitEvent(G.ClipUpdated, {
50422
50431
  previous: {
50423
50432
  clip: Oe(a ?? this.previousDocClip),
50424
50433
  trackIndex: this.effectiveToTrackIndex,
@@ -50431,7 +50440,7 @@ class ii {
50431
50440
  }
50432
50441
  });
50433
50442
  const n = e.getPlayerByClipId(this.clipId);
50434
- return n && r && (e.setSelectedClip(n), e.emitEvent(H.ClipSelected, {
50443
+ return n && r && (e.setSelectedClip(n), e.emitEvent(G.ClipSelected, {
50435
50444
  clip: Oe(r),
50436
50445
  trackIndex: this.fromTrackIndex,
50437
50446
  clipIndex: this.fromClipIndex
@@ -50471,7 +50480,7 @@ class Z0 {
50471
50480
  }
50472
50481
  async undo(e) {
50473
50482
  if (!e) throw new Error("CreateTrackAndMoveClipCommand.undo: context is required");
50474
- return this.wasExecuted ? (await this.moveClipCommand.undo(e), this.addTrackCommand.undo(e), this.wasExecuted = !1, e.emitEvent(H.TrackRemoved, {
50483
+ return this.wasExecuted ? (await this.moveClipCommand.undo(e), this.addTrackCommand.undo(e), this.wasExecuted = !1, e.emitEvent(G.TrackRemoved, {
50475
50484
  trackIndex: this.insertionIndex
50476
50485
  }), xe()) : Me("Command was not executed");
50477
50486
  }
@@ -50500,7 +50509,7 @@ class W0 {
50500
50509
  e.documentUpdateClip(this.trackIndex, this.clipIndex, { asset: n }), e.resolve();
50501
50510
  const o = e.getDocumentClip(this.trackIndex, this.clipIndex);
50502
50511
  if (!o) throw new Error(`TransformClipAssetCommand: document clip not found after mutation at ${this.trackIndex}/${this.clipIndex}`);
50503
- return e.emitEvent(H.ClipUpdated, {
50512
+ return e.emitEvent(G.ClipUpdated, {
50504
50513
  previous: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: Oe(a) },
50505
50514
  current: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: Oe(o) }
50506
50515
  }), xe();
@@ -50512,7 +50521,7 @@ class W0 {
50512
50521
  const i = e.getDocumentClip(this.trackIndex, this.clipIndex);
50513
50522
  if (!t || !i)
50514
50523
  throw new Error(`TransformClipAssetCommand: document clip not found after undo at ${this.trackIndex}/${this.clipIndex}`);
50515
- return e.emitEvent(H.ClipUpdated, {
50524
+ return e.emitEvent(G.ClipUpdated, {
50516
50525
  previous: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: Oe(t) },
50517
50526
  current: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: Oe(i) }
50518
50527
  }), xe();
@@ -50541,7 +50550,7 @@ class H0 {
50541
50550
  const i = structuredClone(e.getDocumentClip(this.lumaTrackIndex, this.lumaClipIndex)), a = e.getEditSession();
50542
50551
  this.storedContentClipId = a.getLumaContentRelationship(t.clipId) ?? null, a.clearLumaContentRelationship(t.clipId), this.transformCommand.execute(e), e.resolve();
50543
50552
  const r = e.getDocumentClip(this.lumaTrackIndex, this.lumaClipIndex);
50544
- return i && r && e.emitEvent(H.ClipUpdated, {
50553
+ return i && r && e.emitEvent(G.ClipUpdated, {
50545
50554
  previous: {
50546
50555
  trackIndex: this.lumaTrackIndex,
50547
50556
  clipIndex: this.lumaClipIndex,
@@ -50564,7 +50573,7 @@ class H0 {
50564
50573
  }
50565
50574
  e.resolve();
50566
50575
  const i = e.getDocumentClip(this.lumaTrackIndex, this.lumaClipIndex);
50567
- return t && i && e.emitEvent(H.ClipUpdated, {
50576
+ return t && i && e.emitEvent(G.ClipUpdated, {
50568
50577
  previous: {
50569
50578
  trackIndex: this.lumaTrackIndex,
50570
50579
  clipIndex: this.lumaClipIndex,
@@ -51198,12 +51207,12 @@ class SE {
51198
51207
  const r = this.element.scrollTop, n = t + r;
51199
51208
  let o = 0, l = -1;
51200
51209
  for (let u = 0; u < this.trackComponents.length; u += 1) {
51201
- const f = this.trackComponents[u].getCurrentTrack(), p = qs(f?.primaryAssetType ?? "default");
51202
- if (n >= o && n < o + p) {
51210
+ const f = this.trackComponents[u].getCurrentTrack(), g = qs(f?.primaryAssetType ?? "default");
51211
+ if (n >= o && n < o + g) {
51203
51212
  l = u;
51204
51213
  break;
51205
51214
  }
51206
- o += p;
51215
+ o += g;
51207
51216
  }
51208
51217
  if (l < 0 || l >= this.trackComponents.length)
51209
51218
  return null;
@@ -51274,7 +51283,7 @@ class AE {
51274
51283
  length: t.getLength()
51275
51284
  }), e.resolve();
51276
51285
  const o = e.getDocumentClip(this.lumaTrackIndex, this.lumaClipIndex);
51277
- return a && o && e.emitEvent(H.ClipUpdated, {
51286
+ return a && o && e.emitEvent(G.ClipUpdated, {
51278
51287
  previous: {
51279
51288
  trackIndex: this.lumaTrackIndex,
51280
51289
  clipIndex: this.lumaClipIndex,
@@ -51303,7 +51312,7 @@ class AE {
51303
51312
  }
51304
51313
  this.transformCommand.undo(e), e.resolve();
51305
51314
  const i = e.getDocumentClip(this.lumaTrackIndex, this.lumaClipIndex);
51306
- return t && i && e.emitEvent(H.ClipUpdated, {
51315
+ return t && i && e.emitEvent(G.ClipUpdated, {
51307
51316
  previous: {
51308
51317
  trackIndex: this.lumaTrackIndex,
51309
51318
  clipIndex: this.lumaClipIndex,
@@ -51429,7 +51438,7 @@ class on {
51429
51438
  t.updateClip(this.trackIndex, this.clipIndex, { length: this.newLength }), this.clipId ? e.resolveClip(this.clipId) : e.resolve(), e.updateDuration();
51430
51439
  const o = e.getDocumentClip(this.trackIndex, this.clipIndex);
51431
51440
  if (!o) throw new Error(`ResizeClipCommand: document clip not found after mutation at ${this.trackIndex}/${this.clipIndex}`);
51432
- return e.emitEvent(H.ClipUpdated, {
51441
+ return e.emitEvent(G.ClipUpdated, {
51433
51442
  previous: { clip: Oe(n), trackIndex: this.trackIndex, clipIndex: this.clipIndex },
51434
51443
  current: { clip: Oe(o), trackIndex: this.trackIndex, clipIndex: this.clipIndex }
51435
51444
  }), e.propagateTimingChanges(this.trackIndex, this.clipIndex), xe();
@@ -51445,7 +51454,7 @@ class on {
51445
51454
  const r = e.getDocumentClip(this.trackIndex, this.clipIndex);
51446
51455
  if (!a || !r)
51447
51456
  throw new Error(`ResizeClipCommand: document clip not found after undo at ${this.trackIndex}/${this.clipIndex}`);
51448
- return e.emitEvent(H.ClipUpdated, {
51457
+ return e.emitEvent(G.ClipUpdated, {
51449
51458
  previous: { clip: Oe(a), trackIndex: this.trackIndex, clipIndex: this.clipIndex },
51450
51459
  current: { clip: Oe(r), trackIndex: this.trackIndex, clipIndex: this.clipIndex }
51451
51460
  }), e.propagateTimingChanges(this.trackIndex, this.clipIndex), xe();
@@ -51666,27 +51675,27 @@ class zE {
51666
51675
  pointerEvents: r.style.pointerEvents
51667
51676
  }, o = r.getBoundingClientRect(), l = e.clientX - o.left, c = e.clientY - o.top;
51668
51677
  r.style.position = "fixed", r.style.left = `${o.left}px`, r.style.top = `${o.top}px`, r.style.width = `${o.width}px`, r.style.height = `${o.height}px`, r.style.zIndex = "18", r.style.pointerEvents = "none";
51669
- const d = this.stateManager.getViewport().pixelsPerSecond, u = this.stateManager.getTracks()[i.trackIndex], f = a.config.asset?.type || "unknown", p = u?.primaryAssetType ?? f, g = FE(a.config.length, f, p, d);
51670
- this.feedbackElements.container.appendChild(g), this.state = OE(t, r, g, l, c, n, a.config.length, e.altKey);
51678
+ const d = this.stateManager.getViewport().pixelsPerSecond, u = this.stateManager.getTracks()[i.trackIndex], f = a.config.asset?.type || "unknown", g = u?.primaryAssetType ?? f, p = FE(a.config.length, f, g, d);
51679
+ this.feedbackElements.container.appendChild(p), this.state = OE(t, r, p, l, c, n, a.config.length, e.altKey);
51671
51680
  const w = kl(this.feedbackElements.container, this.tracksContainer);
51672
- g.style.left = `${a.config.start * d}px`, g.style.top = `${this.getTrackYPositionCached(i.trackIndex) + 4 + w}px`, this.buildSnapPointsForClip(i);
51681
+ p.style.left = `${a.config.start * d}px`, p.style.top = `${this.getTrackYPositionCached(i.trackIndex) + 4 + w}px`, this.buildSnapPointsForClip(i);
51673
51682
  }
51674
51683
  handleDragMove(e, t) {
51675
51684
  const i = this.tracksContainer.getBoundingClientRect(), a = this.tracksContainer.scrollLeft, r = this.stateManager.getViewport().pixelsPerSecond, n = kl(this.feedbackElements.container, this.tracksContainer), o = { pixelsPerSecond: r, scrollLeft: a, tracksOffset: n };
51676
51685
  t.clipElement.style.left = `${e.clientX - t.dragOffsetX}px`, t.clipElement.style.top = `${e.clientY - t.dragOffsetY}px`;
51677
51686
  const l = e.clientX - i.left + a, c = e.clientY - i.top + this.tracksContainer.scrollTop, d = l - t.dragOffsetX;
51678
51687
  let u = Math.max(0, d / r);
51679
- const f = this.getDragTargetAtYPosition(c), p = Xa(t, { dragTarget: f, altKeyHeld: e.altKey });
51680
- this.state = p, u = this.applySnapAndShowLine(u, o);
51681
- const g = this.stateManager.getClipAt(t.clipRef.trackIndex, t.clipRef.clipIndex), w = f.type === "track" ? this.findContentClipAtPositionOnTrack(f.trackIndex, u, t.clipRef) : null, C = w && f.type === "track" ? this.stateManager.findAttachedLuma(f.trackIndex, w.clipIndex) : null, v = r6({
51688
+ const f = this.getDragTargetAtYPosition(c), g = Xa(t, { dragTarget: f, altKeyHeld: e.altKey });
51689
+ this.state = g, u = this.applySnapAndShowLine(u, o);
51690
+ const p = this.stateManager.getClipAt(t.clipRef.trackIndex, t.clipRef.clipIndex), w = f.type === "track" ? this.findContentClipAtPositionOnTrack(f.trackIndex, u, t.clipRef) : null, v = w && f.type === "track" ? this.stateManager.findAttachedLuma(f.trackIndex, w.clipIndex) : null, x = r6({
51682
51691
  dragTarget: f,
51683
- draggedAssetType: g?.config.asset?.type,
51692
+ draggedAssetType: p?.config.asset?.type,
51684
51693
  altKeyHeld: e.altKey,
51685
51694
  targetClip: w,
51686
- existingLumaRef: C,
51695
+ existingLumaRef: v,
51687
51696
  draggedClipRef: t.clipRef
51688
51697
  });
51689
- u = this.applyDragBehavior(p, v, u, o), this.updateGhostPosition(p, u, o);
51698
+ u = this.applyDragBehavior(g, x, u, o), this.updateGhostPosition(g, u, o);
51690
51699
  }
51691
51700
  // ─── Drag Behavior Helpers ─────────────────────────────────────────────────
51692
51701
  applySnapAndShowLine(e, t) {
@@ -51762,15 +51771,15 @@ class zE {
51762
51771
  let l = Math.max(0, o / r);
51763
51772
  const c = this.applySnap(l);
51764
51773
  c !== null ? (l = c, this.feedbackElements.snapLine = Ff(this.feedbackElements, l, n)) : yn(this.feedbackElements.snapLine);
51765
- const { edge: d, originalStart: u, originalLength: f, clipElement: p } = t;
51774
+ const { edge: d, originalStart: u, originalLength: f, clipElement: g } = t;
51766
51775
  if (d === "left") {
51767
- const g = u + f, w = Math.max(0, Math.min(l, g - 0.1)), C = g - w;
51768
- p.style.setProperty("--clip-start", String(w)), p.style.setProperty("--clip-length", String(C)), this.feedbackElements.dragTimeTooltip = Cl(this.feedbackElements, w, e.clientX - i.left, e.clientY - i.top);
51776
+ const p = u + f, w = Math.max(0, Math.min(l, p - 0.1)), v = p - w;
51777
+ g.style.setProperty("--clip-start", String(w)), g.style.setProperty("--clip-length", String(v)), this.feedbackElements.dragTimeTooltip = Cl(this.feedbackElements, w, e.clientX - i.left, e.clientY - i.top);
51769
51778
  } else {
51770
- const g = Math.max(0.1, l - u);
51771
- p.style.setProperty("--clip-length", String(g)), this.feedbackElements.dragTimeTooltip = Cl(
51779
+ const p = Math.max(0.1, l - u);
51780
+ g.style.setProperty("--clip-length", String(p)), this.feedbackElements.dragTimeTooltip = Cl(
51772
51781
  this.feedbackElements,
51773
- u + g,
51782
+ u + p,
51774
51783
  e.clientX - i.left,
51775
51784
  e.clientY - i.top
51776
51785
  );
@@ -51792,19 +51801,19 @@ class zE {
51792
51801
  completeDrag(e, t) {
51793
51802
  const { clipRef: i, clipElement: a, ghost: r, originalStyles: n, dragTarget: o, collisionResult: l, altKeyHeld: c, startTime: d, originalTrack: u } = t;
51794
51803
  LE(a, n);
51795
- const f = this.stateManager.getClipAt(i.trackIndex, i.clipIndex), p = o.type === "track" ? this.findContentClipAtPositionOnTrack(o.trackIndex, l.newStartTime, i) : null, g = p && o.type === "track" ? this.stateManager.findAttachedLuma(p.trackIndex, p.clipIndex) : null, w = v6({
51804
+ const f = this.stateManager.getClipAt(i.trackIndex, i.clipIndex), g = o.type === "track" ? this.findContentClipAtPositionOnTrack(o.trackIndex, l.newStartTime, i) : null, p = g && o.type === "track" ? this.stateManager.findAttachedLuma(g.trackIndex, g.clipIndex) : null, w = v6({
51796
51805
  dragTarget: o,
51797
51806
  draggedAssetType: f?.config.asset?.type,
51798
51807
  altKeyHeld: c,
51799
- targetClip: p,
51800
- existingLumaRef: g,
51808
+ targetClip: g,
51809
+ existingLumaRef: p,
51801
51810
  draggedClipRef: i,
51802
51811
  startTime: d,
51803
51812
  newTime: l.newStartTime,
51804
51813
  originalTrack: u,
51805
51814
  pushOffset: l.pushOffset
51806
51815
  });
51807
- this.executeDropAction(t, w, p, g), r.remove(), this.feedbackElements = VE(this.feedbackElements, a), this.state = aa;
51816
+ this.executeDropAction(t, w, g, p), r.remove(), this.feedbackElements = VE(this.feedbackElements, a), this.state = aa;
51808
51817
  }
51809
51818
  executeDropAction(e, t, i, a) {
51810
51819
  switch (t.type) {
@@ -51909,41 +51918,41 @@ class zE {
51909
51918
  let u = Math.max(0, d / c);
51910
51919
  const f = this.applySnap(u);
51911
51920
  f !== null && (u = f);
51912
- const p = this.stateManager.getAttachedLumaPlayer(i.trackIndex, i.clipIndex);
51921
+ const g = this.stateManager.getAttachedLumaPlayer(i.trackIndex, i.clipIndex);
51913
51922
  if (a === "left") {
51914
- const g = r + n, w = Math.max(0, Math.min(u, g - 0.1)), C = g - w;
51915
- if (w !== r || C !== n) {
51923
+ const p = r + n, w = Math.max(0, Math.min(u, p - 0.1)), v = p - w;
51924
+ if (w !== r || v !== n) {
51916
51925
  if (w !== r) {
51917
- const v = new ii(i.trackIndex, i.clipIndex, i.trackIndex, w);
51918
- this.edit.executeEditCommand(v);
51926
+ const x = new ii(i.trackIndex, i.clipIndex, i.trackIndex, w);
51927
+ this.edit.executeEditCommand(x);
51919
51928
  }
51920
- if (C !== n) {
51921
- const v = new on(i.trackIndex, i.clipIndex, C);
51922
- this.edit.executeEditCommand(v);
51929
+ if (v !== n) {
51930
+ const x = new on(i.trackIndex, i.clipIndex, v);
51931
+ this.edit.executeEditCommand(x);
51923
51932
  }
51924
- if (p) {
51925
- const v = this.edit.findClipIndices(p);
51926
- if (v) {
51933
+ if (g) {
51934
+ const x = this.edit.findClipIndices(g);
51935
+ if (x) {
51927
51936
  if (w !== r) {
51928
- const S = new ii(v.trackIndex, v.clipIndex, v.trackIndex, w);
51937
+ const S = new ii(x.trackIndex, x.clipIndex, x.trackIndex, w);
51929
51938
  this.edit.executeEditCommand(S);
51930
51939
  }
51931
- if (C !== n) {
51932
- const S = new on(v.trackIndex, v.clipIndex, C);
51940
+ if (v !== n) {
51941
+ const S = new on(x.trackIndex, x.clipIndex, v);
51933
51942
  this.edit.executeEditCommand(S);
51934
51943
  }
51935
51944
  }
51936
51945
  }
51937
51946
  }
51938
51947
  } else {
51939
- const g = Math.max(0.1, u - r);
51940
- if (g !== n) {
51941
- const w = new on(i.trackIndex, i.clipIndex, g);
51942
- if (this.edit.executeEditCommand(w), p) {
51943
- const C = this.edit.findClipIndices(p);
51944
- if (C) {
51945
- const v = new on(C.trackIndex, C.clipIndex, g);
51946
- this.edit.executeEditCommand(v);
51948
+ const p = Math.max(0.1, u - r);
51949
+ if (p !== n) {
51950
+ const w = new on(i.trackIndex, i.clipIndex, p);
51951
+ if (this.edit.executeEditCommand(w), g) {
51952
+ const v = this.edit.findClipIndices(g);
51953
+ if (v) {
51954
+ const x = new on(v.trackIndex, v.clipIndex, p);
51955
+ this.edit.executeEditCommand(x);
51947
51956
  }
51948
51957
  }
51949
51958
  }
@@ -52238,7 +52247,7 @@ class HE {
52238
52247
  pixelsPerSecond: t.pixelsPerSecond ?? 50,
52239
52248
  width: t.width ?? 800,
52240
52249
  height: t.height ?? 400
52241
- }, this.edit.getInternalEvents().on(Be.Resolved, this.invalidateCache), this.edit.events.on(H.ClipUpdated, this.invalidateCache), this.edit.events.on(H.TimelineUpdated, this.invalidateCache), this.edit.events.on(H.ClipSelected, this.invalidateCache), this.edit.events.on(H.SelectionCleared, this.invalidateCache);
52250
+ }, this.edit.getInternalEvents().on(Be.Resolved, this.invalidateCache), this.edit.events.on(G.ClipUpdated, this.invalidateCache), this.edit.events.on(G.TimelineUpdated, this.invalidateCache), this.edit.events.on(G.ClipSelected, this.invalidateCache), this.edit.events.on(G.SelectionCleared, this.invalidateCache);
52242
52251
  }
52243
52252
  viewport;
52244
52253
  interactionQuery = null;
@@ -52355,7 +52364,7 @@ class HE {
52355
52364
  this.lumaEditingVisibleByClipId.delete(e);
52356
52365
  }
52357
52366
  dispose() {
52358
- this.edit.getInternalEvents().off(Be.Resolved, this.invalidateCache), this.edit.events.off(H.ClipUpdated, this.invalidateCache), this.edit.events.off(H.TimelineUpdated, this.invalidateCache), this.edit.events.off(H.ClipSelected, this.invalidateCache), this.edit.events.off(H.SelectionCleared, this.invalidateCache), this.cachedTracks = null, this.interactionQuery = null, this.lumaEditingVisibleByClipId.clear();
52367
+ this.edit.getInternalEvents().off(Be.Resolved, this.invalidateCache), this.edit.events.off(G.ClipUpdated, this.invalidateCache), this.edit.events.off(G.TimelineUpdated, this.invalidateCache), this.edit.events.off(G.ClipSelected, this.invalidateCache), this.edit.events.off(G.SelectionCleared, this.invalidateCache), this.cachedTracks = null, this.interactionQuery = null, this.lumaEditingVisibleByClipId.clear();
52359
52368
  }
52360
52369
  // ========== Private ==========
52361
52370
  getComputedVisualState(e, t, i) {
@@ -52463,10 +52472,10 @@ class _9 {
52463
52472
  return e;
52464
52473
  }
52465
52474
  setupEventListeners() {
52466
- this.edit.events.on(H.TimelineUpdated, this.handleTimelineUpdated), this.edit.events.on(H.ClipAdded, this.handleTimelineUpdated), this.edit.events.on(H.ClipDeleted, this.handleTimelineUpdated), this.edit.events.on(H.ClipRestored, this.handleTimelineUpdated), this.edit.events.on(H.TrackAdded, this.handleTimelineUpdated), this.edit.events.on(H.TrackRemoved, this.handleTimelineUpdated), this.edit.events.on(H.PlaybackPlay, this.handlePlaybackPlay), this.edit.events.on(H.PlaybackPause, this.handlePlaybackPause), this.edit.events.on(H.ClipSelected, this.handleClipSelected), this.edit.events.on(H.ClipUpdated, this.handleClipUpdated), this.edit.events.on(H.ClipLoadFailed, this.handleClipLoadFailed);
52475
+ this.edit.events.on(G.TimelineUpdated, this.handleTimelineUpdated), this.edit.events.on(G.ClipAdded, this.handleTimelineUpdated), this.edit.events.on(G.ClipDeleted, this.handleTimelineUpdated), this.edit.events.on(G.ClipRestored, this.handleTimelineUpdated), this.edit.events.on(G.TrackAdded, this.handleTimelineUpdated), this.edit.events.on(G.TrackRemoved, this.handleTimelineUpdated), this.edit.events.on(G.PlaybackPlay, this.handlePlaybackPlay), this.edit.events.on(G.PlaybackPause, this.handlePlaybackPause), this.edit.events.on(G.ClipSelected, this.handleClipSelected), this.edit.events.on(G.ClipUpdated, this.handleClipUpdated), this.edit.events.on(G.ClipLoadFailed, this.handleClipLoadFailed);
52467
52476
  }
52468
52477
  removeEventListeners() {
52469
- this.edit.events.off(H.TimelineUpdated, this.handleTimelineUpdated), this.edit.events.off(H.ClipAdded, this.handleTimelineUpdated), this.edit.events.off(H.ClipDeleted, this.handleTimelineUpdated), this.edit.events.off(H.ClipRestored, this.handleTimelineUpdated), this.edit.events.off(H.TrackAdded, this.handleTimelineUpdated), this.edit.events.off(H.TrackRemoved, this.handleTimelineUpdated), this.edit.events.off(H.PlaybackPlay, this.handlePlaybackPlay), this.edit.events.off(H.PlaybackPause, this.handlePlaybackPause), this.edit.events.off(H.ClipSelected, this.handleClipSelected), this.edit.events.off(H.ClipUpdated, this.handleClipUpdated), this.edit.events.off(H.ClipLoadFailed, this.handleClipLoadFailed);
52478
+ this.edit.events.off(G.TimelineUpdated, this.handleTimelineUpdated), this.edit.events.off(G.ClipAdded, this.handleTimelineUpdated), this.edit.events.off(G.ClipDeleted, this.handleTimelineUpdated), this.edit.events.off(G.ClipRestored, this.handleTimelineUpdated), this.edit.events.off(G.TrackAdded, this.handleTimelineUpdated), this.edit.events.off(G.TrackRemoved, this.handleTimelineUpdated), this.edit.events.off(G.PlaybackPlay, this.handlePlaybackPlay), this.edit.events.off(G.PlaybackPause, this.handlePlaybackPause), this.edit.events.off(G.ClipSelected, this.handleClipSelected), this.edit.events.off(G.ClipUpdated, this.handleClipUpdated), this.edit.events.off(G.ClipLoadFailed, this.handleClipLoadFailed);
52470
52479
  }
52471
52480
  /** Start continuous render loop (during playback or interaction) */
52472
52481
  startRenderLoop() {
@@ -52639,12 +52648,12 @@ class Vf {
52639
52648
  this.updateDocumentClip(e, i, !0);
52640
52649
  } else
52641
52650
  this.updateDocumentClip(e, this.storedNewValue, !1);
52642
- return e.resolve(), e.emitEvent(H.MergeFieldChanged, { fields: t.getAll() }), xe();
52651
+ return e.resolve(), e.emitEvent(G.MergeFieldChanged, { fields: t.getAll() }), xe();
52643
52652
  }
52644
52653
  async undo(e) {
52645
52654
  if (!e) throw new Error("SetMergeFieldCommand.undo: context is required");
52646
52655
  const t = e.getMergeFields();
52647
- return this.storedPreviousBinding ? e.setClipBinding(this.clipId, this.propertyPath, this.storedPreviousBinding) : e.removeClipBinding(this.clipId, this.propertyPath), this.previousFieldName && t.register({ name: this.previousFieldName, defaultValue: this.storedPreviousValue }, { silent: !0 }), this.storedPreviousBinding ? this.updateDocumentClip(e, this.storedPreviousBinding.placeholder, !0) : this.updateDocumentClip(e, this.storedPreviousValue, !1), e.resolve(), e.emitEvent(H.MergeFieldChanged, { fields: t.getAll() }), xe();
52656
+ return this.storedPreviousBinding ? e.setClipBinding(this.clipId, this.propertyPath, this.storedPreviousBinding) : e.removeClipBinding(this.clipId, this.propertyPath), this.previousFieldName && t.register({ name: this.previousFieldName, defaultValue: this.storedPreviousValue }, { silent: !0 }), this.storedPreviousBinding ? this.updateDocumentClip(e, this.storedPreviousBinding.placeholder, !0) : this.updateDocumentClip(e, this.storedPreviousValue, !1), e.resolve(), e.emitEvent(G.MergeFieldChanged, { fields: t.getAll() }), xe();
52648
52657
  }
52649
52658
  dispose() {
52650
52659
  this.storedPreviousBinding = void 0;
@@ -52725,7 +52734,7 @@ class XE extends kr {
52725
52734
  this.mergeFieldService.register({ ...i, defaultValue: t }, { silent: !0 });
52726
52735
  for (const [, a] of this.getPlayerMap())
52727
52736
  this.updateMergeFieldBindings(a, e, t);
52728
- this.resolve(), this.getInternalEvents().emit(H.TimelineUpdated, { current: this.getEdit() });
52737
+ this.resolve(), this.getInternalEvents().emit(G.TimelineUpdated, { current: this.getEdit() });
52729
52738
  } finally {
52730
52739
  this.isUpdatingMergeFields = !1;
52731
52740
  }
@@ -52770,8 +52779,8 @@ class XE extends kr {
52770
52779
  if (l) {
52771
52780
  const c = structuredClone(l.clip);
52772
52781
  for (const [u, f] of o) {
52773
- const p = this.mergeFieldService.resolve(f.placeholder);
52774
- Gs(c, u, p);
52782
+ const g = this.mergeFieldService.resolve(f.placeholder);
52783
+ Gs(c, u, g);
52775
52784
  }
52776
52785
  delete c.id;
52777
52786
  const d = Nn.safeParse(c);
@@ -52812,7 +52821,7 @@ class XE extends kr {
52812
52821
  const o = this.getTemplateClipById(n);
52813
52822
  o && await this.restoreMergeFieldInClip(n, o, i, a);
52814
52823
  }
52815
- this.mergeFieldService.remove(e) || this.getInternalEvents().emit(H.MergeFieldChanged, { fields: this.mergeFieldService.getAll() });
52824
+ this.mergeFieldService.remove(e) || this.getInternalEvents().emit(G.MergeFieldChanged, { fields: this.mergeFieldService.getAll() });
52816
52825
  }
52817
52826
  // ─── Text Conversion API ───────────────────────────────────────────────────
52818
52827
  /**
@@ -52909,7 +52918,7 @@ class XE extends kr {
52909
52918
  resolvedValue: u
52910
52919
  };
52911
52920
  if (r.setClipBinding(a, l, f), o) {
52912
- const g = (typeof u == "string" ? u.trim() : "").length > 0 ? Number(u) : NaN, w = Number.isFinite(g) ? g : u;
52921
+ const p = (typeof u == "string" ? u.trim() : "").length > 0 ? Number(u) : NaN, w = Number.isFinite(p) ? p : u;
52913
52922
  Gs(o.clip, l, w);
52914
52923
  }
52915
52924
  }
@@ -52961,7 +52970,7 @@ function JE(s = "ss-toolbar-drag-handle", e = "horizontal") {
52961
52970
  function ad(s) {
52962
52971
  const { container: e, handleClassName: t, handleOrientation: i, boundsPadding: a = 12 } = s, r = JE(t, i);
52963
52972
  e.insertBefore(r, e.firstChild);
52964
- let n = !1, o = 0, l = 0, c = !1, d = !1, u = 0, f = 0, p = 0, g = 0;
52973
+ let n = !1, o = 0, l = 0, c = !1, d = !1, u = 0, f = 0, g = 0, p = 0;
52965
52974
  function w(b, D) {
52966
52975
  const M = e.getBoundingClientRect(), L = window.innerWidth, Q = window.innerHeight;
52967
52976
  return {
@@ -52969,33 +52978,33 @@ function ad(s) {
52969
52978
  y: Math.max(a, Math.min(Q - M.height - a, D))
52970
52979
  };
52971
52980
  }
52972
- function C(b) {
52981
+ function v(b) {
52973
52982
  if (!c) return;
52974
52983
  d || (d = !0, e.style.transform = "none", e.classList.add("ss-toolbar--dragging"), document.body.classList.add("ss-dragging-toolbar"));
52975
- const D = b.clientX - u, M = b.clientY - f, L = p + D, Q = g + M, K = w(L, Q);
52984
+ const D = b.clientX - u, M = b.clientY - f, L = g + D, Q = p + M, K = w(L, Q);
52976
52985
  e.style.left = `${K.x}px`, e.style.top = `${K.y}px`, o = K.x, l = K.y, n = !0;
52977
52986
  }
52978
- function v() {
52979
- c && (c = !1, d && (e.classList.remove("ss-toolbar--dragging"), document.body.classList.remove("ss-dragging-toolbar")), d = !1, document.removeEventListener("pointermove", C), document.removeEventListener("pointerup", v));
52987
+ function x() {
52988
+ c && (c = !1, d && (e.classList.remove("ss-toolbar--dragging"), document.body.classList.remove("ss-dragging-toolbar")), d = !1, document.removeEventListener("pointermove", v), document.removeEventListener("pointerup", x));
52980
52989
  }
52981
52990
  function S() {
52982
52991
  n = !1, o = 0, l = 0, s.onReset?.();
52983
52992
  }
52984
- function x(b) {
52993
+ function C(b) {
52985
52994
  b.preventDefault(), b.stopPropagation(), S();
52986
52995
  }
52987
52996
  function T(b) {
52988
52997
  if (b.button !== 0) return;
52989
52998
  b.preventDefault(), b.stopPropagation(), c = !0, u = b.clientX, f = b.clientY;
52990
52999
  const D = e.getBoundingClientRect(), L = e.offsetParent?.getBoundingClientRect() ?? { left: 0, top: 0 };
52991
- e.style.position === "fixed" || getComputedStyle(e).position === "fixed" ? (p = D.left, g = D.top) : (p = D.left - L.left, g = D.top - L.top), document.addEventListener("pointermove", C), document.addEventListener("pointerup", v);
53000
+ e.style.position === "fixed" || getComputedStyle(e).position === "fixed" ? (g = D.left, p = D.top) : (g = D.left - L.left, p = D.top - L.top), document.addEventListener("pointermove", v), document.addEventListener("pointerup", x);
52992
53001
  }
52993
- return r.addEventListener("pointerdown", T), r.addEventListener("dblclick", x), {
53002
+ return r.addEventListener("pointerdown", T), r.addEventListener("dblclick", C), {
52994
53003
  getState() {
52995
53004
  return { hasUserPosition: n, userX: o, userY: l };
52996
53005
  },
52997
53006
  dispose() {
52998
- r.removeEventListener("pointerdown", T), r.removeEventListener("dblclick", x), r.remove(), document.removeEventListener("pointermove", C), document.removeEventListener("pointerup", v), document.body.classList.remove("ss-dragging-toolbar"), e.classList.remove("ss-toolbar--dragging");
53007
+ r.removeEventListener("pointerdown", T), r.removeEventListener("dblclick", C), r.remove(), document.removeEventListener("pointermove", v), document.removeEventListener("pointerup", x), document.body.classList.remove("ss-dragging-toolbar"), e.classList.remove("ss-toolbar--dragging");
52999
53008
  }
53000
53009
  };
53001
53010
  }
@@ -54069,9 +54078,9 @@ class cN extends ji {
54069
54078
  setupEventListeners() {
54070
54079
  this.editChangedListener = () => {
54071
54080
  this.selectedTrackIdx >= 0 && this.selectedClipIdx >= 0 && this.syncState();
54072
- }, this.edit.events.on(H.EditChanged, this.editChangedListener), this.mergeFieldChangedListener = () => {
54081
+ }, this.edit.events.on(G.EditChanged, this.editChangedListener), this.mergeFieldChangedListener = () => {
54073
54082
  this.selectedTrackIdx >= 0 && this.selectedClipIdx >= 0 && this.syncState();
54074
- }, this.edit.events.on(H.MergeFieldChanged, this.mergeFieldChangedListener);
54083
+ }, this.edit.events.on(G.MergeFieldChanged, this.mergeFieldChangedListener);
54075
54084
  }
54076
54085
  mountComponents() {
54077
54086
  const e = this.container?.querySelector("[data-start-mount]");
@@ -54152,7 +54161,7 @@ class cN extends ji {
54152
54161
  return [];
54153
54162
  }
54154
54163
  dispose() {
54155
- this.editChangedListener && (this.edit.events.off(H.EditChanged, this.editChangedListener), this.editChangedListener = null), this.mergeFieldChangedListener && (this.edit.events.off(H.MergeFieldChanged, this.mergeFieldChangedListener), this.mergeFieldChangedListener = null), this.startMergeLabel?.dispose(), this.lengthMergeLabel?.dispose(), this.startControl?.dispose(), this.lengthControl?.dispose(), super.dispose(), this.startMergeLabel = null, this.lengthMergeLabel = null, this.startControl = null, this.lengthControl = null;
54164
+ this.editChangedListener && (this.edit.events.off(G.EditChanged, this.editChangedListener), this.editChangedListener = null), this.mergeFieldChangedListener && (this.edit.events.off(G.MergeFieldChanged, this.mergeFieldChangedListener), this.mergeFieldChangedListener = null), this.startMergeLabel?.dispose(), this.lengthMergeLabel?.dispose(), this.startControl?.dispose(), this.lengthControl?.dispose(), super.dispose(), this.startMergeLabel = null, this.lengthMergeLabel = null, this.startControl = null, this.lengthControl = null;
54156
54165
  }
54157
54166
  }
54158
54167
  class ns extends xi {
@@ -55058,7 +55067,7 @@ class cr extends ji {
55058
55067
  </div>
55059
55068
  </div>
55060
55069
  ` : ""}
55061
- `, e.insertBefore(this.container, e.firstChild), this.fitBtn = this.container.querySelector('[data-action="fit"]'), this.opacityBtn = this.container.querySelector('[data-action="opacity"]'), this.scaleBtn = this.container.querySelector('[data-action="scale"]'), this.volumeBtn = this.container.querySelector('[data-action="volume"]'), this.transitionBtn = this.container.querySelector('[data-action="transition"]'), this.effectBtn = this.container.querySelector('[data-action="effect"]'), this.advancedBtn = this.container.querySelector('[data-action="advanced"]'), this.audioFadeBtn = this.container.querySelector('[data-action="audio-fade"]'), this.fitPopup = this.container.querySelector('[data-popup="fit"]'), this.opacityPopup = this.container.querySelector('[data-popup="opacity"]'), this.scalePopup = this.container.querySelector('[data-popup="scale"]'), this.volumePopup = this.container.querySelector('[data-popup="volume"]'), this.transitionPopup = this.container.querySelector('[data-popup="transition"]'), this.effectPopup = this.container.querySelector('[data-popup="effect"]'), this.advancedPopup = this.container.querySelector('[data-popup="advanced"]'), this.audioFadePopup = this.container.querySelector('[data-popup="audio-fade"]'), this.fitLabel = this.container.querySelector("[data-fit-label]"), this.volumeValue = this.container.querySelector("[data-volume-value]"), this.volumeSlider = this.container.querySelector("[data-volume-slider]"), this.volumeDisplayInput = this.container.querySelector("[data-volume-display]"), this.volumeSection = this.container.querySelector("[data-volume-section]"), this.visualSection = this.container.querySelector("[data-visual-section]"), this.audioSection = this.container.querySelector("[data-audio-section]"), this.dynamicToggle = this.container.querySelector("[data-dynamic-toggle]"), this.dynamicPanel = this.container.querySelector("[data-dynamic-panel]"), this.dynamicInput = this.container.querySelector("[data-dynamic-input]"), this.mountCompositeComponents(), this.showMergeFields && (this.mergeFieldManager = new j0(this, cr.MEDIA_PROPERTY_DEFAULTS), this.mergeFieldManager.init(), this.unsubMergeFieldChanged = this.edit.getInternalEvents().on(H.MergeFieldChanged, () => {
55070
+ `, e.insertBefore(this.container, e.firstChild), this.fitBtn = this.container.querySelector('[data-action="fit"]'), this.opacityBtn = this.container.querySelector('[data-action="opacity"]'), this.scaleBtn = this.container.querySelector('[data-action="scale"]'), this.volumeBtn = this.container.querySelector('[data-action="volume"]'), this.transitionBtn = this.container.querySelector('[data-action="transition"]'), this.effectBtn = this.container.querySelector('[data-action="effect"]'), this.advancedBtn = this.container.querySelector('[data-action="advanced"]'), this.audioFadeBtn = this.container.querySelector('[data-action="audio-fade"]'), this.fitPopup = this.container.querySelector('[data-popup="fit"]'), this.opacityPopup = this.container.querySelector('[data-popup="opacity"]'), this.scalePopup = this.container.querySelector('[data-popup="scale"]'), this.volumePopup = this.container.querySelector('[data-popup="volume"]'), this.transitionPopup = this.container.querySelector('[data-popup="transition"]'), this.effectPopup = this.container.querySelector('[data-popup="effect"]'), this.advancedPopup = this.container.querySelector('[data-popup="advanced"]'), this.audioFadePopup = this.container.querySelector('[data-popup="audio-fade"]'), this.fitLabel = this.container.querySelector("[data-fit-label]"), this.volumeValue = this.container.querySelector("[data-volume-value]"), this.volumeSlider = this.container.querySelector("[data-volume-slider]"), this.volumeDisplayInput = this.container.querySelector("[data-volume-display]"), this.volumeSection = this.container.querySelector("[data-volume-section]"), this.visualSection = this.container.querySelector("[data-visual-section]"), this.audioSection = this.container.querySelector("[data-audio-section]"), this.dynamicToggle = this.container.querySelector("[data-dynamic-toggle]"), this.dynamicPanel = this.container.querySelector("[data-dynamic-panel]"), this.dynamicInput = this.container.querySelector("[data-dynamic-input]"), this.mountCompositeComponents(), this.showMergeFields && (this.mergeFieldManager = new j0(this, cr.MEDIA_PROPERTY_DEFAULTS), this.mergeFieldManager.init(), this.unsubMergeFieldChanged = this.edit.getInternalEvents().on(G.MergeFieldChanged, () => {
55062
55071
  this.container?.style.display !== "none" && this.mergeFieldManager?.hasLabels && this.mergeFieldManager.sync();
55063
55072
  })), this.setupEventListeners(), this.setupOutsideClickHandler(), this.enableDrag();
55064
55073
  }
@@ -57473,11 +57482,11 @@ class ha extends ji {
57473
57482
  const u = this.getCurrentAsset();
57474
57483
  if (!u) return;
57475
57484
  if (n) {
57476
- const f = u.background || { color: "#FFFFFF", opacity: 1, borderRadius: 0 }, p = {
57485
+ const f = u.background || { color: "#FFFFFF", opacity: 1, borderRadius: 0 }, g = {
57477
57486
  ...u,
57478
57487
  background: { ...f, color: o, opacity: l }
57479
57488
  };
57480
- this.edit.updateClipInDocument(d, { asset: p });
57489
+ this.edit.updateClipInDocument(d, { asset: g });
57481
57490
  } else {
57482
57491
  const f = { ...u };
57483
57492
  delete f.background, this.edit.updateClipInDocument(d, { asset: f });
@@ -57526,7 +57535,7 @@ class ha extends ji {
57526
57535
  a.key === "Enter" && (a.ctrlKey || a.metaKey) && (a.preventDefault(), this.textEditDebounceTimer && (clearTimeout(this.textEditDebounceTimer), this.textEditDebounceTimer = null), this.applyTextEdit(), this.closeAllPopups()), a.key === "Escape" && this.closeAllPopups();
57527
57536
  }), this.setupOutsideClickHandler(), this.enableDrag(), e.style.position = "relative", e.insertBefore(this.container, e.firstChild), this.unsubFontCapabilities = this.edit.getInternalEvents().on(Be.FontCapabilitiesChanged, () => {
57528
57537
  this.container?.style.display !== "none" && this.syncState();
57529
- }), this.unsubMergeFieldChanged = this.edit.getInternalEvents().on(H.MergeFieldChanged, () => {
57538
+ }), this.unsubMergeFieldChanged = this.edit.getInternalEvents().on(G.MergeFieldChanged, () => {
57530
57539
  this.container?.style.display !== "none" && this.showMergeFields && this.mergeFieldManager?.hasLabels && this.mergeFieldManager.sync();
57531
57540
  });
57532
57541
  }
@@ -58207,8 +58216,8 @@ function _N(s, e, t, i) {
58207
58216
  const f = Math.abs(d - u);
58208
58217
  if (f < l) {
58209
58218
  l = f, r.x = s.x + (u - d);
58210
- const p = a.findIndex((g) => g.axis === "x");
58211
- p >= 0 && a.splice(p, 1), a.push({ axis: "x", position: u, type: "canvas" });
58219
+ const g = a.findIndex((p) => p.axis === "x");
58220
+ g >= 0 && a.splice(g, 1), a.push({ axis: "x", position: u, type: "canvas" });
58212
58221
  }
58213
58222
  }
58214
58223
  for (const d of n.y)
@@ -58216,8 +58225,8 @@ function _N(s, e, t, i) {
58216
58225
  const f = Math.abs(d - u);
58217
58226
  if (f < c) {
58218
58227
  c = f, r.y = s.y + (u - d);
58219
- const p = a.findIndex((g) => g.axis === "y");
58220
- p >= 0 && a.splice(p, 1), a.push({ axis: "y", position: u, type: "canvas" });
58228
+ const g = a.findIndex((p) => p.axis === "y");
58229
+ g >= 0 && a.splice(g, 1), a.push({ axis: "y", position: u, type: "canvas" });
58221
58230
  }
58222
58231
  }
58223
58232
  return { position: r, guides: a };
@@ -58228,33 +58237,33 @@ function MN(s, e, t, i) {
58228
58237
  return { position: r, guides: a };
58229
58238
  const n = Q0(s, e), o = s.y, l = s.y + e.height, c = s.x, d = s.x + e.width;
58230
58239
  let u = i, f = i;
58231
- for (const p of t) {
58232
- const g = VN(p);
58240
+ for (const g of t) {
58241
+ const p = VN(g);
58233
58242
  for (const w of n.x)
58234
- for (const C of g.x) {
58235
- const v = Math.abs(w - C);
58236
- if (v < u) {
58237
- u = v, r.x = s.x + (C - w);
58238
- const S = Math.min(o, p.top), x = Math.max(l, p.bottom), T = a.findIndex((b) => b.axis === "x");
58243
+ for (const v of p.x) {
58244
+ const x = Math.abs(w - v);
58245
+ if (x < u) {
58246
+ u = x, r.x = s.x + (v - w);
58247
+ const S = Math.min(o, g.top), C = Math.max(l, g.bottom), T = a.findIndex((b) => b.axis === "x");
58239
58248
  T >= 0 && a.splice(T, 1), a.push({
58240
58249
  axis: "x",
58241
- position: C,
58250
+ position: v,
58242
58251
  type: "clip",
58243
- bounds: { start: S, end: x }
58252
+ bounds: { start: S, end: C }
58244
58253
  });
58245
58254
  }
58246
58255
  }
58247
58256
  for (const w of n.y)
58248
- for (const C of g.y) {
58249
- const v = Math.abs(w - C);
58250
- if (v < f) {
58251
- f = v, r.y = s.y + (C - w);
58252
- const S = Math.min(c, p.left), x = Math.max(d, p.right), T = a.findIndex((b) => b.axis === "y");
58257
+ for (const v of p.y) {
58258
+ const x = Math.abs(w - v);
58259
+ if (x < f) {
58260
+ f = x, r.y = s.y + (v - w);
58261
+ const S = Math.min(c, g.left), C = Math.max(d, g.right), T = a.findIndex((b) => b.axis === "y");
58253
58262
  T >= 0 && a.splice(T, 1), a.push({
58254
58263
  axis: "y",
58255
- position: C,
58264
+ position: v,
58256
58265
  type: "clip",
58257
- bounds: { start: S, end: x }
58266
+ bounds: { start: S, end: C }
58258
58267
  });
58259
58268
  }
58260
58269
  }
@@ -58265,8 +58274,8 @@ function LN(s, e) {
58265
58274
  const { clipSize: t, canvasSize: i, otherClips: a, config: r } = e, { threshold: n, snapToCanvas: o, snapToClips: l } = r;
58266
58275
  let c = { position: { ...s }, guides: [] };
58267
58276
  if (o && (c = _N(c.position, t, i, n)), l && a.length > 0) {
58268
- const d = MN(c.position, t, a, n), u = d.guides.some((p) => p.axis === "x"), f = d.guides.some((p) => p.axis === "y");
58269
- u && (c.position.x = d.position.x, c.guides = c.guides.filter((p) => p.axis !== "x")), f && (c.position.y = d.position.y, c.guides = c.guides.filter((p) => p.axis !== "y")), c.guides.push(...d.guides);
58277
+ const d = MN(c.position, t, a, n), u = d.guides.some((g) => g.axis === "x"), f = d.guides.some((g) => g.axis === "y");
58278
+ u && (c.position.x = d.position.x, c.guides = c.guides.filter((g) => g.axis !== "x")), f && (c.position.y = d.position.y, c.guides = c.guides.filter((g) => g.axis !== "y")), c.guides.push(...d.guides);
58270
58279
  }
58271
58280
  return c;
58272
58281
  }
@@ -58315,12 +58324,12 @@ function ZN(s, e, t) {
58315
58324
  if (!l || !c)
58316
58325
  return console.warn("[SVG Utils] Invalid viewBox dimensions"), s;
58317
58326
  const d = e / l, u = t / c, f = Math.min(d, u);
58318
- return n.setAttribute("viewBox", `0 0 ${e} ${t}`), a.querySelectorAll("rect").forEach((p) => {
58319
- const g = (w, C) => {
58320
- const v = p.getAttribute(w);
58321
- v && p.setAttribute(w, String(parseFloat(v) * C));
58327
+ return n.setAttribute("viewBox", `0 0 ${e} ${t}`), a.querySelectorAll("rect").forEach((g) => {
58328
+ const p = (w, v) => {
58329
+ const x = g.getAttribute(w);
58330
+ x && g.setAttribute(w, String(parseFloat(x) * v));
58322
58331
  };
58323
- g("x", d), g("y", u), g("width", d), g("height", u), g("rx", f), g("ry", f);
58332
+ p("x", d), p("y", u), p("width", d), p("height", u), p("rx", f), p("ry", f);
58324
58333
  }), new XMLSerializer().serializeToString(a);
58325
58334
  }
58326
58335
  function Pl(s, e, t) {
@@ -58334,14 +58343,14 @@ function Pl(s, e, t) {
58334
58343
  const WN = 20, HN = 4, GN = 11, Gf = 6, qf = 3, qN = 8;
58335
58344
  class YN {
58336
58345
  constructor(e) {
58337
- this.edit = e, this.container = new G.Container(), this.container.zIndex = 18, this.container.sortableChildren = !0, this.outline = new G.Graphics(), this.handles = /* @__PURE__ */ new Map(), this.edgeHandles = /* @__PURE__ */ new Map(), this.dimensionContainer = new G.Container(), this.dimensionContainer.zIndex = 20, this.dimensionContainer.visible = !1, this.dimensionBackground = new G.Graphics(), this.dimensionLabel = new G.Text({
58346
+ this.edit = e, this.container = new H.Container(), this.container.zIndex = 18, this.container.sortableChildren = !0, this.outline = new H.Graphics(), this.handles = /* @__PURE__ */ new Map(), this.edgeHandles = /* @__PURE__ */ new Map(), this.dimensionContainer = new H.Container(), this.dimensionContainer.zIndex = 20, this.dimensionContainer.visible = !1, this.dimensionBackground = new H.Graphics(), this.dimensionLabel = new H.Text({
58338
58347
  text: "",
58339
58348
  style: {
58340
58349
  fontFamily: "system-ui, -apple-system, sans-serif",
58341
58350
  fontSize: GN,
58342
58351
  fill: "#ffffff"
58343
58352
  }
58344
- }), this.dimensionContainer.addChild(this.dimensionBackground), this.dimensionContainer.addChild(this.dimensionLabel), this.positionBuilder = new eh(e.size), this.onClipSelectedBound = this.onClipSelected.bind(this), this.onSelectionClearedBound = this.onSelectionCleared.bind(this), this.onPointerDownBound = this.onPointerDown.bind(this), this.onPointerMoveBound = this.onPointerMove.bind(this), this.onPointerUpBound = this.onPointerUp.bind(this), this.edit.events.on(H.ClipSelected, this.onClipSelectedBound), this.edit.events.on(H.SelectionCleared, this.onSelectionClearedBound);
58353
+ }), this.dimensionContainer.addChild(this.dimensionBackground), this.dimensionContainer.addChild(this.dimensionLabel), this.positionBuilder = new eh(e.size), this.onClipSelectedBound = this.onClipSelected.bind(this), this.onSelectionClearedBound = this.onSelectionCleared.bind(this), this.onPointerDownBound = this.onPointerDown.bind(this), this.onPointerMoveBound = this.onPointerMove.bind(this), this.onPointerUpBound = this.onPointerUp.bind(this), this.edit.events.on(G.ClipSelected, this.onClipSelectedBound), this.edit.events.on(G.SelectionCleared, this.onSelectionClearedBound);
58345
58354
  }
58346
58355
  container;
58347
58356
  outline;
@@ -58383,12 +58392,12 @@ class YN {
58383
58392
  this.app = t, this.container.addChild(this.outline);
58384
58393
  const i = ["topLeft", "topRight", "bottomRight", "bottomLeft"];
58385
58394
  for (const r of i) {
58386
- const n = new G.Graphics();
58395
+ const n = new H.Graphics();
58387
58396
  n.zIndex = 19, n.eventMode = "static", this.handles.set(r, n), this.container.addChild(n);
58388
58397
  }
58389
58398
  const a = ["top", "bottom", "left", "right"];
58390
58399
  for (const r of a) {
58391
- const n = new G.Graphics();
58400
+ const n = new H.Graphics();
58392
58401
  n.zIndex = 19, n.eventMode = "static", this.edgeHandles.set(r, n), this.container.addChild(n);
58393
58402
  }
58394
58403
  e.addChild(this.container), e.addChild(this.dimensionContainer), t.stage.on("pointerdown", this.onPointerDownBound), t.stage.on("globalpointermove", this.onPointerMoveBound), t.stage.on("pointerup", this.onPointerUpBound), t.stage.on("pointerupoutside", this.onPointerUpBound);
@@ -58404,7 +58413,7 @@ class YN {
58404
58413
  this.container.visible = !0, this.drawOutline(), this.drawHandles();
58405
58414
  }
58406
58415
  dispose() {
58407
- this.edit.events.off(H.ClipSelected, this.onClipSelectedBound), this.edit.events.off(H.SelectionCleared, this.onSelectionClearedBound), this.app && (this.app.stage.off("pointerdown", this.onPointerDownBound), this.app.stage.off("globalpointermove", this.onPointerMoveBound), this.app.stage.off("pointerup", this.onPointerUpBound), this.app.stage.off("pointerupoutside", this.onPointerUpBound)), this.outline.destroy();
58416
+ this.edit.events.off(G.ClipSelected, this.onClipSelectedBound), this.edit.events.off(G.SelectionCleared, this.onSelectionClearedBound), this.app && (this.app.stage.off("pointerdown", this.onPointerDownBound), this.app.stage.off("globalpointermove", this.onPointerMoveBound), this.app.stage.off("pointerup", this.onPointerUpBound), this.app.stage.off("pointerupoutside", this.onPointerUpBound)), this.outline.destroy();
58408
58417
  for (const e of this.handles.values())
58409
58418
  e.destroy();
58410
58419
  for (const e of this.edgeHandles.values())
@@ -58457,14 +58466,14 @@ class YN {
58457
58466
  d.visible = !0;
58458
58467
  const u = l[c];
58459
58468
  if (u.isHorizontal) {
58460
- const g = u.x - r / 2, w = u.y - n / 2;
58461
- d.fillStyle = { color: i }, d.roundRect(g, w, r, n, o), d.fill();
58469
+ const p = u.x - r / 2, w = u.y - n / 2;
58470
+ d.fillStyle = { color: i }, d.roundRect(p, w, r, n, o), d.fill();
58462
58471
  } else {
58463
- const g = u.x - n / 2, w = u.y - r / 2;
58464
- d.fillStyle = { color: i }, d.roundRect(g, w, n, r, o), d.fill();
58472
+ const p = u.x - n / 2, w = u.y - r / 2;
58473
+ d.fillStyle = { color: i }, d.roundRect(p, w, n, r, o), d.fill();
58465
58474
  }
58466
- const f = this.selectedPlayer?.getRotation() ?? 0, p = El[c] ?? 0;
58467
- d.cursor = Nl(p + f);
58475
+ const f = this.selectedPlayer?.getRotation() ?? 0, g = El[c] ?? 0;
58476
+ d.cursor = Nl(g + f);
58468
58477
  }
58469
58478
  }
58470
58479
  getUIScale() {
@@ -58561,17 +58570,17 @@ class YN {
58561
58570
  y: r.y - a.y
58562
58571
  };
58563
58572
  this.edit.clearAlignmentGuides();
58564
- const l = this.edit.getActivePlayersExcept(this.selectedPlayer).map((g) => {
58565
- const w = g.getContainer().position, C = g.getSize();
58566
- return RN({ x: w.x, y: w.y }, C);
58573
+ const l = this.edit.getActivePlayersExcept(this.selectedPlayer).map((p) => {
58574
+ const w = p.getContainer().position, v = p.getSize();
58575
+ return RN({ x: w.x, y: w.y }, v);
58567
58576
  }), c = zN(this.selectedPlayer.getSize(), this.edit.size, l), d = LN(n, c);
58568
- for (const g of d.guides)
58569
- this.edit.showAlignmentGuide(g.type, g.axis, g.position, g.bounds);
58570
- const u = this.selectedPlayer.getSize(), f = this.selectedPlayer.clipConfiguration.position ?? "center", p = this.positionBuilder.absoluteToRelative(u, f, d.position);
58577
+ for (const p of d.guides)
58578
+ this.edit.showAlignmentGuide(p.type, p.axis, p.position, p.bounds);
58579
+ const u = this.selectedPlayer.getSize(), f = this.selectedPlayer.clipConfiguration.position ?? "center", g = this.positionBuilder.absoluteToRelative(u, f, d.position);
58571
58580
  this.finalDragState = {
58572
- offset: { x: p.x, y: p.y }
58581
+ offset: { x: g.x, y: g.y }
58573
58582
  }, this.edit.updateClipInDocument(this.selectedClipId, {
58574
- offset: { x: p.x, y: p.y }
58583
+ offset: { x: g.x, y: g.y }
58575
58584
  }), this.edit.resolveClip(this.selectedClipId);
58576
58585
  }
58577
58586
  startCornerResize(e, t) {
@@ -60358,7 +60367,7 @@ class oc {
60358
60367
  * Subscribe to edit events. Called by factory methods.
60359
60368
  */
60360
60369
  subscribeToEvents() {
60361
- this.edit.events.on(H.ClipSelected, this.onClipSelected), this.edit.events.on(H.SelectionCleared, this.onSelectionCleared);
60370
+ this.edit.events.on(G.ClipSelected, this.onClipSelected), this.edit.events.on(G.SelectionCleared, this.onSelectionCleared);
60362
60371
  }
60363
60372
  /**
60364
60373
  * Register all standard toolbars. Called by create() factory.
@@ -60471,7 +60480,7 @@ class oc {
60471
60480
  */
60472
60481
  dispose() {
60473
60482
  if (this.isDisposed) return;
60474
- this.isDisposed = !0, this.edit.events.off(H.ClipSelected, this.onClipSelected), this.edit.events.off(H.SelectionCleared, this.onSelectionCleared), document.removeEventListener("keydown", this.onKeyDownBound);
60483
+ this.isDisposed = !0, this.edit.events.off(G.ClipSelected, this.onClipSelected), this.edit.events.off(G.SelectionCleared, this.onSelectionCleared), document.removeEventListener("keydown", this.onKeyDownBound);
60475
60484
  for (const { btn: t, handler: i } of this.modeButtonHandlers)
60476
60485
  t.removeEventListener("click", i);
60477
60486
  this.modeButtonHandlers = [];
@@ -60656,14 +60665,14 @@ var t9 = ep({
60656
60665
  function f(E) {
60657
60666
  return n.locateFile ? n.locateFile(E, u) : u + E;
60658
60667
  }
60659
- var p, g;
60668
+ var g, p;
60660
60669
  if (c) {
60661
60670
  var w = gx("fs");
60662
- u = __dirname + "/", g = (E) => {
60671
+ u = __dirname + "/", p = (E) => {
60663
60672
  E = T(E) ? new URL(E) : E;
60664
60673
  var oe = w.readFileSync(E);
60665
60674
  return oe;
60666
- }, p = async (E, oe = !0) => {
60675
+ }, g = async (E, oe = !0) => {
60667
60676
  E = T(E) ? new URL(E) : E;
60668
60677
  var Re = w.readFileSync(E, oe ? void 0 : "utf8");
60669
60678
  return Re;
@@ -60675,10 +60684,10 @@ var t9 = ep({
60675
60684
  u = new URL(".", i).href;
60676
60685
  } catch {
60677
60686
  }
60678
- l && (g = (E) => {
60687
+ l && (p = (E) => {
60679
60688
  var oe = new XMLHttpRequest();
60680
60689
  return oe.open("GET", E, !1), oe.responseType = "arraybuffer", oe.send(null), new Uint8Array(oe.response);
60681
- }), p = async (E) => {
60690
+ }), g = async (E) => {
60682
60691
  if (T(E))
60683
60692
  return new Promise((Re, qe) => {
60684
60693
  var Qe = new XMLHttpRequest();
@@ -60697,7 +60706,7 @@ var t9 = ep({
60697
60706
  };
60698
60707
  }
60699
60708
  console.log.bind(console);
60700
- var C = console.error.bind(console), v, S = !1, x, T = (E) => E.startsWith("file://"), b, D, M, L, Q = !1;
60709
+ var v = console.error.bind(console), x, S = !1, C, T = (E) => E.startsWith("file://"), b, D, M, L, Q = !1;
60701
60710
  function K() {
60702
60711
  var E = M.buffer;
60703
60712
  n.HEAP8 = new Int8Array(E), n.HEAPU8 = L = new Uint8Array(E), n.HEAP32 = new Int32Array(E), n.HEAPU32 = new Uint32Array(E), n.HEAPF32 = new Float32Array(E), new BigInt64Array(E), new BigUint64Array(E);
@@ -60728,7 +60737,7 @@ var t9 = ep({
60728
60737
  }
60729
60738
  }
60730
60739
  function Z(E) {
60731
- n.onAbort?.(E), E = "Aborted(" + E + ")", C(E), S = !0, E += ". Build with -sASSERTIONS for more info.";
60740
+ n.onAbort?.(E), E = "Aborted(" + E + ")", v(E), S = !0, E += ". Build with -sASSERTIONS for more info.";
60732
60741
  var oe = new WebAssembly.RuntimeError(E);
60733
60742
  throw D?.(oe), oe;
60734
60743
  }
@@ -60737,16 +60746,16 @@ var t9 = ep({
60737
60746
  return f("hb.wasm");
60738
60747
  }
60739
60748
  function Ie(E) {
60740
- if (E == j && v)
60741
- return new Uint8Array(v);
60742
- if (g)
60743
- return g(E);
60749
+ if (E == j && x)
60750
+ return new Uint8Array(x);
60751
+ if (p)
60752
+ return p(E);
60744
60753
  throw "both async and sync fetching of the wasm failed";
60745
60754
  }
60746
60755
  async function ke(E) {
60747
- if (!v)
60756
+ if (!x)
60748
60757
  try {
60749
- var oe = await p(E);
60758
+ var oe = await g(E);
60750
60759
  return new Uint8Array(oe);
60751
60760
  } catch {
60752
60761
  }
@@ -60757,7 +60766,7 @@ var t9 = ep({
60757
60766
  var Re = await ke(E), qe = await WebAssembly.instantiate(Re, oe);
60758
60767
  return qe;
60759
60768
  } catch (Qe) {
60760
- C(`failed to asynchronously prepare wasm: ${Qe}`), Z(Qe);
60769
+ v(`failed to asynchronously prepare wasm: ${Qe}`), Z(Qe);
60761
60770
  }
60762
60771
  }
60763
60772
  async function Ke(E, oe, Re) {
@@ -60766,7 +60775,7 @@ var t9 = ep({
60766
60775
  var qe = fetch(oe, { credentials: "same-origin" }), Qe = await WebAssembly.instantiateStreaming(qe, Re);
60767
60776
  return Qe;
60768
60777
  } catch (vt) {
60769
- C(`wasm streaming compile failed: ${vt}`), C("falling back to ArrayBuffer instantiation");
60778
+ v(`wasm streaming compile failed: ${vt}`), v("falling back to ArrayBuffer instantiation");
60770
60779
  }
60771
60780
  return Ze(oe, Re);
60772
60781
  }
@@ -60789,7 +60798,7 @@ var t9 = ep({
60789
60798
  });
60790
60799
  });
60791
60800
  j ?? (j = Y());
60792
- var qe = await Ke(v, j, Re), Qe = oe(qe);
60801
+ var qe = await Ke(x, j, Re), Qe = oe(qe);
60793
60802
  return Qe;
60794
60803
  }
60795
60804
  class bt {
@@ -60804,16 +60813,16 @@ var t9 = ep({
60804
60813
  fe = !1, ue = 0;
60805
60814
  }, de = {}, ie = (E) => {
60806
60815
  if (E instanceof bt || E == "unwind")
60807
- return x;
60816
+ return C;
60808
60817
  d(1, E);
60809
60818
  }, Ne = () => fe || ue > 0, at = (E) => {
60810
- x = E, Ne() || (n.onExit?.(E), S = !0), d(E, new bt(E));
60819
+ C = E, Ne() || (n.onExit?.(E), S = !0), d(E, new bt(E));
60811
60820
  }, kt = (E, oe) => {
60812
- x = E, at(E);
60821
+ C = E, at(E);
60813
60822
  }, $e = kt, pt = () => {
60814
60823
  if (!Ne())
60815
60824
  try {
60816
- $e(x);
60825
+ $e(C);
60817
60826
  } catch (E) {
60818
60827
  ie(E);
60819
60828
  }
@@ -60882,7 +60891,7 @@ var t9 = ep({
60882
60891
  }, Rr = (E) => {
60883
60892
  Yt.delete(Ci(E)), Ks(E, null), Ki.push(E);
60884
60893
  };
60885
- n.noExitRuntime && (fe = n.noExitRuntime), n.print && n.print, n.printErr && (C = n.printErr), n.wasmBinary && (v = n.wasmBinary), n.arguments && n.arguments, n.thisProgram && n.thisProgram, n.wasmMemory = M, n.wasmExports = is, n.addFunction = Dr, n.removeFunction = Rr;
60894
+ n.noExitRuntime && (fe = n.noExitRuntime), n.print && n.print, n.printErr && (v = n.printErr), n.wasmBinary && (x = n.wasmBinary), n.arguments && n.arguments, n.thisProgram && n.thisProgram, n.wasmMemory = M, n.wasmExports = is, n.addFunction = Dr, n.removeFunction = Rr;
60886
60895
  var Ma;
60887
60896
  function zr(E) {
60888
60897
  n._hb_blob_create = E.hb_blob_create, n._hb_blob_destroy = E.hb_blob_destroy, n._hb_blob_get_length = E.hb_blob_get_length, n._hb_blob_get_data = E.hb_blob_get_data, n._hb_buffer_serialize_glyphs = E.hb_buffer_serialize_glyphs, n._hb_buffer_create = E.hb_buffer_create, n._hb_buffer_destroy = E.hb_buffer_destroy, n._hb_buffer_get_content_type = E.hb_buffer_get_content_type, n._hb_buffer_set_direction = E.hb_buffer_set_direction, n._hb_buffer_set_script = E.hb_buffer_set_script, n._hb_buffer_set_language = E.hb_buffer_set_language, n._hb_buffer_set_flags = E.hb_buffer_set_flags, n._hb_buffer_set_cluster_level = E.hb_buffer_set_cluster_level, n._hb_buffer_get_length = E.hb_buffer_get_length, n._hb_buffer_get_glyph_infos = E.hb_buffer_get_glyph_infos, n._hb_buffer_get_glyph_positions = E.hb_buffer_get_glyph_positions, n._hb_glyph_info_get_glyph_flags = E.hb_glyph_info_get_glyph_flags, n._hb_buffer_guess_segment_properties = E.hb_buffer_guess_segment_properties, n._hb_buffer_add_utf8 = E.hb_buffer_add_utf8, n._hb_buffer_add_utf16 = E.hb_buffer_add_utf16, n._hb_buffer_set_message_func = E.hb_buffer_set_message_func, n._hb_language_from_string = E.hb_language_from_string, n._hb_script_from_string = E.hb_script_from_string, n._hb_version = E.hb_version, n._hb_version_string = E.hb_version_string, n._hb_feature_from_string = E.hb_feature_from_string, n._malloc = E.malloc, n._free = E.free, n._hb_draw_funcs_set_move_to_func = E.hb_draw_funcs_set_move_to_func, n._hb_draw_funcs_set_line_to_func = E.hb_draw_funcs_set_line_to_func, n._hb_draw_funcs_set_quadratic_to_func = E.hb_draw_funcs_set_quadratic_to_func, n._hb_draw_funcs_set_cubic_to_func = E.hb_draw_funcs_set_cubic_to_func, n._hb_draw_funcs_set_close_path_func = E.hb_draw_funcs_set_close_path_func, n._hb_draw_funcs_create = E.hb_draw_funcs_create, n._hb_draw_funcs_destroy = E.hb_draw_funcs_destroy, n._hb_face_create = E.hb_face_create, n._hb_face_destroy = E.hb_face_destroy, n._hb_face_reference_table = E.hb_face_reference_table, n._hb_face_get_upem = E.hb_face_get_upem, n._hb_face_collect_unicodes = E.hb_face_collect_unicodes, n._hb_font_draw_glyph = E.hb_font_draw_glyph, n._hb_font_glyph_to_string = E.hb_font_glyph_to_string, n._hb_font_create = E.hb_font_create, n._hb_font_set_variations = E.hb_font_set_variations, n._hb_font_destroy = E.hb_font_destroy, n._hb_font_set_scale = E.hb_font_set_scale, n._hb_set_create = E.hb_set_create, n._hb_set_destroy = E.hb_set_destroy, n._hb_ot_var_get_axis_infos = E.hb_ot_var_get_axis_infos, n._hb_set_get_population = E.hb_set_get_population, n._hb_set_next_many = E.hb_set_next_many, n._hb_shape = E.hb_shape, Ma = E._emscripten_timeout;
@@ -60928,11 +60937,11 @@ var a9 = ep({
60928
60937
  let n = i.addFunction, o = i.removeFunction;
60929
60938
  var l = n(function(Z) {
60930
60939
  a.free(Z);
60931
- }, "vi"), c = 2, d = -1, u = 2, f = 0, p = 1, g = 2;
60940
+ }, "vi"), c = 2, d = -1, u = 2, f = 0, g = 1, p = 2;
60932
60941
  function w(Z) {
60933
60942
  return (Z.charCodeAt(0) & 255) << 24 | (Z.charCodeAt(1) & 255) << 16 | (Z.charCodeAt(2) & 255) << 8 | (Z.charCodeAt(3) & 255) << 0;
60934
60943
  }
60935
- var C = w("JSON"), v = 4;
60944
+ var v = w("JSON"), x = 4;
60936
60945
  function S(Z) {
60937
60946
  return [
60938
60947
  String.fromCharCode(Z >> 24 & 255),
@@ -60941,7 +60950,7 @@ var a9 = ep({
60941
60950
  String.fromCharCode(Z >> 0 & 255)
60942
60951
  ].join("");
60943
60952
  }
60944
- function x(Z) {
60953
+ function C(Z) {
60945
60954
  return Z == "BOT" ? 1 : Z == "EOT" ? 2 : Z == "PRESERVE_DEFAULT_IGNORABLES" ? 4 : Z == "REMOVE_DEFAULT_IGNORABLES" ? 8 : Z == "DO_NOT_INSERT_DOTTED_CIRCLE" ? 16 : Z == "PRODUCE_UNSAFE_TO_CONCAT" ? 64 : 0;
60946
60955
  }
60947
60956
  function T(Z) {
@@ -61161,7 +61170,7 @@ var a9 = ep({
61161
61170
  setFlags: function(j) {
61162
61171
  var Y = 0;
61163
61172
  j.forEach(function(Ie) {
61164
- Y |= x(Ie);
61173
+ Y |= C(Ie);
61165
61174
  }), a.hb_buffer_set_flags(Z, Y);
61166
61175
  },
61167
61176
  /**
@@ -61235,7 +61244,7 @@ var a9 = ep({
61235
61244
  function he(Z, j, Y, Ie, ke) {
61236
61245
  var Ze = [], Ke = f, He = !1, Ue = 1024 * 1024, bt = a.malloc(Ue), X = function(O, B, ne, fe) {
61237
61246
  var le = r.decode(i.HEAPU8.subarray(ne, i.HEAPU8.indexOf(0, ne)));
61238
- return le.startsWith("start table GSUB") ? Ke = p : le.startsWith("start table GPOS") && (Ke = g), Ke != ke && (He = !1), ke != f && Ke == ke && le.startsWith("end lookup " + Ie) && (He = !0), He ? 0 : (a.hb_buffer_serialize_glyphs(
61247
+ return le.startsWith("start table GSUB") ? Ke = g : le.startsWith("start table GPOS") && (Ke = p), Ke != ke && (He = !1), ke != f && Ke == ke && le.startsWith("end lookup " + Ie) && (He = !0), He ? 0 : (a.hb_buffer_serialize_glyphs(
61239
61248
  O,
61240
61249
  0,
61241
61250
  a.hb_buffer_get_length(O),
@@ -61243,8 +61252,8 @@ var a9 = ep({
61243
61252
  Ue,
61244
61253
  0,
61245
61254
  B,
61246
- C,
61247
- v
61255
+ v,
61256
+ x
61248
61257
  ), Ze.push({
61249
61258
  m: le,
61250
61259
  t: JSON.parse(r.decode(i.HEAPU8.subarray(bt, i.HEAPU8.indexOf(0, bt)))),