@designcombo/state 5.4.6 → 5.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -87,8 +87,8 @@ var Er = function() {
87
87
  if (this._parentage = null, Array.isArray(c))
88
88
  try {
89
89
  for (var u = kn(c), d = u.next(); !d.done; d = u.next()) {
90
- var h = d.value;
91
- h.remove(this);
90
+ var p = d.value;
91
+ p.remove(this);
92
92
  }
93
93
  } catch (I) {
94
94
  r = { error: I };
@@ -112,10 +112,10 @@ var Er = function() {
112
112
  if (y) {
113
113
  this._finalizers = null;
114
114
  try {
115
- for (var p = kn(y), v = p.next(); !v.done; v = p.next()) {
116
- var b = v.value;
115
+ for (var h = kn(y), b = h.next(); !b.done; b = h.next()) {
116
+ var k = b.value;
117
117
  try {
118
- Un(b);
118
+ Un(k);
119
119
  } catch (I) {
120
120
  o = o ?? [], I instanceof pn ? o = _n(_n([], vn(o)), vn(I.errors)) : o.push(I);
121
121
  }
@@ -124,7 +124,7 @@ var Er = function() {
124
124
  n = { error: I };
125
125
  } finally {
126
126
  try {
127
- v && !v.done && (i = p.return) && i.call(p);
127
+ b && !b.done && (i = h.return) && i.call(h);
128
128
  } finally {
129
129
  if (n) throw n.error;
130
130
  }
@@ -387,8 +387,8 @@ var Qs = as(function(t) {
387
387
  var d = u.value;
388
388
  d.next(e);
389
389
  }
390
- } catch (h) {
391
- i = { error: h };
390
+ } catch (p) {
391
+ i = { error: p };
392
392
  } finally {
393
393
  try {
394
394
  u && !u.done && (o = c.return) && o.call(c);
@@ -492,9 +492,9 @@ function Cn(t) {
492
492
  var vr = { exports: {} };
493
493
  vr.exports;
494
494
  (function(t, r) {
495
- var e = 200, n = "__lodash_hash_undefined__", i = 1, o = 2, c = 9007199254740991, u = "[object Arguments]", d = "[object Array]", h = "[object AsyncFunction]", m = "[object Boolean]", y = "[object Date]", p = "[object Error]", v = "[object Function]", b = "[object GeneratorFunction]", I = "[object Map]", S = "[object Number]", f = "[object Null]", k = "[object Object]", T = "[object Promise]", w = "[object Proxy]", A = "[object RegExp]", _ = "[object Set]", E = "[object String]", L = "[object Symbol]", P = "[object Undefined]", Y = "[object WeakMap]", x = "[object ArrayBuffer]", F = "[object DataView]", tt = "[object Float32Array]", Qt = "[object Float64Array]", te = "[object Int8Array]", Se = "[object Int16Array]", we = "[object Int32Array]", Te = "[object Uint8Array]", Ee = "[object Uint8ClampedArray]", z = "[object Uint16Array]", Ae = "[object Uint32Array]", Me = /[\\^$.*+?()[\]{}|]/g, st = /^\[object .+?Constructor\]$/, ee = /^(?:0|[1-9]\d*)$/, $ = {};
496
- $[tt] = $[Qt] = $[te] = $[Se] = $[we] = $[Te] = $[Ee] = $[z] = $[Ae] = !0, $[u] = $[d] = $[x] = $[m] = $[F] = $[y] = $[p] = $[v] = $[I] = $[S] = $[k] = $[A] = $[_] = $[E] = $[Y] = !1;
497
- var re = typeof ft == "object" && ft && ft.Object === Object && ft, xe = typeof self == "object" && self && self.Object === Object && self, it = re || xe || Function("return this")(), ne = r && !r.nodeType && r, se = ne && !0 && t && !t.nodeType && t, zt = se && se.exports === ne, $t = zt && re.process, ie = function() {
495
+ var e = 200, n = "__lodash_hash_undefined__", i = 1, o = 2, c = 9007199254740991, u = "[object Arguments]", d = "[object Array]", p = "[object AsyncFunction]", m = "[object Boolean]", y = "[object Date]", h = "[object Error]", b = "[object Function]", k = "[object GeneratorFunction]", I = "[object Map]", _ = "[object Number]", f = "[object Null]", v = "[object Object]", T = "[object Promise]", w = "[object Proxy]", A = "[object RegExp]", S = "[object Set]", E = "[object String]", L = "[object Symbol]", P = "[object Undefined]", Y = "[object WeakMap]", x = "[object ArrayBuffer]", F = "[object DataView]", tt = "[object Float32Array]", Qt = "[object Float64Array]", te = "[object Int8Array]", Se = "[object Int16Array]", we = "[object Int32Array]", Te = "[object Uint8Array]", Ee = "[object Uint8ClampedArray]", z = "[object Uint16Array]", Ae = "[object Uint32Array]", Me = /[\\^$.*+?()[\]{}|]/g, nt = /^\[object .+?Constructor\]$/, ee = /^(?:0|[1-9]\d*)$/, $ = {};
496
+ $[tt] = $[Qt] = $[te] = $[Se] = $[we] = $[Te] = $[Ee] = $[z] = $[Ae] = !0, $[u] = $[d] = $[x] = $[m] = $[F] = $[y] = $[h] = $[b] = $[I] = $[_] = $[v] = $[A] = $[S] = $[E] = $[Y] = !1;
497
+ var re = typeof ft == "object" && ft && ft.Object === Object && ft, xe = typeof self == "object" && self && self.Object === Object && self, st = re || xe || Function("return this")(), ne = r && !r.nodeType && r, se = ne && !0 && t && !t.nodeType && t, zt = se && se.exports === ne, $t = zt && re.process, ie = function() {
498
498
  try {
499
499
  return $t && $t.binding && $t.binding("util");
500
500
  } catch {
@@ -551,12 +551,12 @@ vr.exports;
551
551
  l[++a] = g;
552
552
  }), l;
553
553
  }
554
- var Tt = Array.prototype, Pe = Function.prototype, gt = Object.prototype, Et = it["__core-js_shared__"], Ht = Pe.toString, et = gt.hasOwnProperty, le = function() {
554
+ var Tt = Array.prototype, Pe = Function.prototype, gt = Object.prototype, Et = st["__core-js_shared__"], Ht = Pe.toString, et = gt.hasOwnProperty, le = function() {
555
555
  var s = /[^.]+$/.exec(Et && Et.keys && Et.keys.IE_PROTO || "");
556
556
  return s ? "Symbol(src)_1." + s : "";
557
557
  }(), de = gt.toString, Re = RegExp(
558
558
  "^" + Ht.call(et).replace(Me, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
559
- ), Ut = zt ? it.Buffer : void 0, At = it.Symbol, fe = it.Uint8Array, Mt = gt.propertyIsEnumerable, yt = Tt.splice, at = At ? At.toStringTag : void 0, xt = Object.getOwnPropertySymbols, Wt = Ut ? Ut.isBuffer : void 0, It = ue(Object.keys, Object), Bt = Ct(it, "DataView"), bt = Ct(it, "Map"), jt = Ct(it, "Promise"), Yt = Ct(it, "Set"), We = Ct(it, "WeakMap"), Gt = Ct(Object, "create"), ar = rt(Bt), Ot = rt(bt), xr = rt(jt), Or = rt(Yt), Cr = rt(We), or = At ? At.prototype : void 0, Be = or ? or.valueOf : void 0;
559
+ ), Ut = zt ? st.Buffer : void 0, At = st.Symbol, fe = st.Uint8Array, Mt = gt.propertyIsEnumerable, yt = Tt.splice, it = At ? At.toStringTag : void 0, xt = Object.getOwnPropertySymbols, Wt = Ut ? Ut.isBuffer : void 0, It = ue(Object.keys, Object), Bt = Ct(st, "DataView"), bt = Ct(st, "Map"), jt = Ct(st, "Promise"), Yt = Ct(st, "Set"), We = Ct(st, "WeakMap"), Gt = Ct(Object, "create"), ar = rt(Bt), Ot = rt(bt), xr = rt(jt), Or = rt(Yt), Cr = rt(We), or = At ? At.prototype : void 0, Be = or ? or.valueOf : void 0;
560
560
  function X(s) {
561
561
  var a = -1, l = s == null ? 0 : s.length;
562
562
  for (this.clear(); ++a < l; ) {
@@ -617,7 +617,7 @@ vr.exports;
617
617
  return g < 0 ? (++this.size, l.push([s, a])) : l[g][1] = a, this;
618
618
  }
619
619
  q.prototype.clear = Fr, q.prototype.delete = Nr, q.prototype.get = Lr, q.prototype.has = Hr, q.prototype.set = Ur;
620
- function ot(s) {
620
+ function at(s) {
621
621
  var a = -1, l = s == null ? 0 : s.length;
622
622
  for (this.clear(); ++a < l; ) {
623
623
  var g = s[a];
@@ -645,10 +645,10 @@ vr.exports;
645
645
  var l = mt(this, s), g = l.size;
646
646
  return l.set(s, a), this.size += l.size == g ? 0 : 1, this;
647
647
  }
648
- ot.prototype.clear = Wr, ot.prototype.delete = Br, ot.prototype.get = jr, ot.prototype.has = Yr, ot.prototype.set = Gr;
648
+ at.prototype.clear = Wr, at.prototype.delete = Br, at.prototype.get = jr, at.prototype.has = Yr, at.prototype.set = Gr;
649
649
  function De(s) {
650
650
  var a = -1, l = s == null ? 0 : s.length;
651
- for (this.__data__ = new ot(); ++a < l; )
651
+ for (this.__data__ = new at(); ++a < l; )
652
652
  this.add(s[a]);
653
653
  }
654
654
  function cr(s) {
@@ -681,7 +681,7 @@ vr.exports;
681
681
  var g = l.__data__;
682
682
  if (!bt || g.length < e - 1)
683
683
  return g.push([s, a]), this.size = ++l.size, this;
684
- l = this.__data__ = new ot(g);
684
+ l = this.__data__ = new at(g);
685
685
  }
686
686
  return l.set(s, a), this.size = l.size, this;
687
687
  }
@@ -707,7 +707,7 @@ vr.exports;
707
707
  return Fe(s) ? g : Nt(g, l(s));
708
708
  }
709
709
  function pe(s) {
710
- return s == null ? s === void 0 ? P : f : at && at in Object(s) ? Pt(s) : dr(s);
710
+ return s == null ? s === void 0 ? P : f : it && it in Object(s) ? Pt(s) : dr(s);
711
711
  }
712
712
  function ur(s) {
713
713
  return _t(s) && pe(s) == u;
@@ -717,8 +717,8 @@ vr.exports;
717
717
  }
718
718
  function Zr(s, a, l, g, O, M) {
719
719
  var D = Fe(s), R = Fe(a), U = D ? d : vt(s), N = R ? d : vt(a);
720
- U = U == u ? k : U, N = N == u ? k : N;
721
- var J = U == k, ct = N == k, W = U == N;
720
+ U = U == u ? v : U, N = N == u ? v : N;
721
+ var J = U == v, ot = N == v, W = U == N;
722
722
  if (W && Ne(s)) {
723
723
  if (!Ne(a))
724
724
  return !1;
@@ -727,7 +727,7 @@ vr.exports;
727
727
  if (W && !J)
728
728
  return M || (M = new kt()), D || gr(s) ? Ge(s, a, l, g, O, M) : rn(s, a, U, l, g, O, M);
729
729
  if (!(l & i)) {
730
- var Z = J && et.call(s, "__wrapped__"), K = ct && et.call(a, "__wrapped__");
730
+ var Z = J && et.call(s, "__wrapped__"), K = ot && et.call(a, "__wrapped__");
731
731
  if (Z || K) {
732
732
  var Xt = Z ? s.value() : s, Rt = K ? a.value() : a;
733
733
  return M || (M = new kt()), O(Xt, Rt, l, g, M);
@@ -738,7 +738,7 @@ vr.exports;
738
738
  function Qr(s) {
739
739
  if (!mr(s) || cn(s))
740
740
  return !1;
741
- var a = hr(s) ? Re : st;
741
+ var a = hr(s) ? Re : nt;
742
742
  return a.test(rt(s));
743
743
  }
744
744
  function tn(s) {
@@ -759,7 +759,7 @@ vr.exports;
759
759
  var N = M.get(s);
760
760
  if (N && M.get(a))
761
761
  return N == a;
762
- var J = -1, ct = !0, W = l & o ? new De() : void 0;
762
+ var J = -1, ot = !0, W = l & o ? new De() : void 0;
763
763
  for (M.set(s, a), M.set(a, s); ++J < R; ) {
764
764
  var Z = s[J], K = a[J];
765
765
  if (g)
@@ -767,7 +767,7 @@ vr.exports;
767
767
  if (Xt !== void 0) {
768
768
  if (Xt)
769
769
  continue;
770
- ct = !1;
770
+ ot = !1;
771
771
  break;
772
772
  }
773
773
  if (W) {
@@ -775,15 +775,15 @@ vr.exports;
775
775
  if (!wt(W, me) && (Z === Rt || O(Z, Rt, l, g, M)))
776
776
  return W.push(me);
777
777
  })) {
778
- ct = !1;
778
+ ot = !1;
779
779
  break;
780
780
  }
781
781
  } else if (!(Z === K || O(Z, K, l, g, M))) {
782
- ct = !1;
782
+ ot = !1;
783
783
  break;
784
784
  }
785
785
  }
786
- return M.delete(s), M.delete(a), ct;
786
+ return M.delete(s), M.delete(a), ot;
787
787
  }
788
788
  function rn(s, a, l, g, O, M, D) {
789
789
  switch (l) {
@@ -795,16 +795,16 @@ vr.exports;
795
795
  return !(s.byteLength != a.byteLength || !M(new fe(s), new fe(a)));
796
796
  case m:
797
797
  case y:
798
- case S:
798
+ case _:
799
799
  return fr(+s, +a);
800
- case p:
800
+ case h:
801
801
  return s.name == a.name && s.message == a.message;
802
802
  case A:
803
803
  case E:
804
804
  return s == a + "";
805
805
  case I:
806
806
  var R = ce;
807
- case _:
807
+ case S:
808
808
  var U = g & i;
809
809
  if (R || (R = ut), s.size != a.size && !U)
810
810
  return !1;
@@ -824,8 +824,8 @@ vr.exports;
824
824
  var D = l & i, R = he(s), U = R.length, N = he(a), J = N.length;
825
825
  if (U != J && !D)
826
826
  return !1;
827
- for (var ct = U; ct--; ) {
828
- var W = R[ct];
827
+ for (var ot = U; ot--; ) {
828
+ var W = R[ot];
829
829
  if (!(D ? W in a : et.call(a, W)))
830
830
  return !1;
831
831
  }
@@ -834,8 +834,8 @@ vr.exports;
834
834
  return Z == a;
835
835
  var K = !0;
836
836
  M.set(s, a), M.set(a, s);
837
- for (var Xt = D; ++ct < U; ) {
838
- W = R[ct];
837
+ for (var Xt = D; ++ot < U; ) {
838
+ W = R[ot];
839
839
  var Rt = s[W], me = a[W];
840
840
  if (g)
841
841
  var Hn = D ? g(me, Rt, W, a, s, M) : g(Rt, me, W, s, a, M);
@@ -863,22 +863,22 @@ vr.exports;
863
863
  return Qr(l) ? l : void 0;
864
864
  }
865
865
  function Pt(s) {
866
- var a = et.call(s, at), l = s[at];
866
+ var a = et.call(s, it), l = s[it];
867
867
  try {
868
- s[at] = void 0;
868
+ s[it] = void 0;
869
869
  var g = !0;
870
870
  } catch {
871
871
  }
872
872
  var O = de.call(s);
873
- return g && (a ? s[at] = l : delete s[at]), O;
873
+ return g && (a ? s[it] = l : delete s[it]), O;
874
874
  }
875
875
  var sn = xt ? function(s) {
876
876
  return s == null ? [] : (s = Object(s), ae(xt(s), function(a) {
877
877
  return Mt.call(s, a);
878
878
  }));
879
879
  } : dn, vt = pe;
880
- (Bt && vt(new Bt(new ArrayBuffer(1))) != F || bt && vt(new bt()) != I || jt && vt(jt.resolve()) != T || Yt && vt(new Yt()) != _ || We && vt(new We()) != Y) && (vt = function(s) {
881
- var a = pe(s), l = a == k ? s.constructor : void 0, g = l ? rt(l) : "";
880
+ (Bt && vt(new Bt(new ArrayBuffer(1))) != F || bt && vt(new bt()) != I || jt && vt(jt.resolve()) != T || Yt && vt(new Yt()) != S || We && vt(new We()) != Y) && (vt = function(s) {
881
+ var a = pe(s), l = a == v ? s.constructor : void 0, g = l ? rt(l) : "";
882
882
  if (g)
883
883
  switch (g) {
884
884
  case ar:
@@ -888,7 +888,7 @@ vr.exports;
888
888
  case xr:
889
889
  return T;
890
890
  case Or:
891
- return _;
891
+ return S;
892
892
  case Cr:
893
893
  return Y;
894
894
  }
@@ -943,7 +943,7 @@ vr.exports;
943
943
  if (!mr(s))
944
944
  return !1;
945
945
  var a = pe(s);
946
- return a == v || a == b || a == h || a == w;
946
+ return a == b || a == k || a == p || a == w;
947
947
  }
948
948
  function Ke(s) {
949
949
  return typeof s == "number" && s > -1 && s % 1 == 0 && s <= c;
@@ -972,13 +972,13 @@ const B = /* @__PURE__ */ Cn(ti), vo = "add", ei = "track", ri = "trackItems", _
972
972
  var _r = { exports: {} };
973
973
  _r.exports;
974
974
  (function(t, r) {
975
- var e = 200, n = "__lodash_hash_undefined__", i = 9007199254740991, o = "[object Arguments]", c = "[object Array]", u = "[object Boolean]", d = "[object Date]", h = "[object Error]", m = "[object Function]", y = "[object GeneratorFunction]", p = "[object Map]", v = "[object Number]", b = "[object Object]", I = "[object Promise]", S = "[object RegExp]", f = "[object Set]", k = "[object String]", T = "[object Symbol]", w = "[object WeakMap]", A = "[object ArrayBuffer]", _ = "[object DataView]", E = "[object Float32Array]", L = "[object Float64Array]", P = "[object Int8Array]", Y = "[object Int16Array]", x = "[object Int32Array]", F = "[object Uint8Array]", tt = "[object Uint8ClampedArray]", Qt = "[object Uint16Array]", te = "[object Uint32Array]", Se = /[\\^$.*+?()[\]{}|]/g, we = /\w*$/, Te = /^\[object .+?Constructor\]$/, Ee = /^(?:0|[1-9]\d*)$/, z = {};
976
- z[o] = z[c] = z[A] = z[_] = z[u] = z[d] = z[E] = z[L] = z[P] = z[Y] = z[x] = z[p] = z[v] = z[b] = z[S] = z[f] = z[k] = z[T] = z[F] = z[tt] = z[Qt] = z[te] = !0, z[h] = z[m] = z[w] = !1;
977
- var Ae = typeof ft == "object" && ft && ft.Object === Object && ft, Me = typeof self == "object" && self && self.Object === Object && self, st = Ae || Me || Function("return this")(), ee = r && !r.nodeType && r, $ = ee && !0 && t && !t.nodeType && t, re = $ && $.exports === ee;
975
+ var e = 200, n = "__lodash_hash_undefined__", i = 9007199254740991, o = "[object Arguments]", c = "[object Array]", u = "[object Boolean]", d = "[object Date]", p = "[object Error]", m = "[object Function]", y = "[object GeneratorFunction]", h = "[object Map]", b = "[object Number]", k = "[object Object]", I = "[object Promise]", _ = "[object RegExp]", f = "[object Set]", v = "[object String]", T = "[object Symbol]", w = "[object WeakMap]", A = "[object ArrayBuffer]", S = "[object DataView]", E = "[object Float32Array]", L = "[object Float64Array]", P = "[object Int8Array]", Y = "[object Int16Array]", x = "[object Int32Array]", F = "[object Uint8Array]", tt = "[object Uint8ClampedArray]", Qt = "[object Uint16Array]", te = "[object Uint32Array]", Se = /[\\^$.*+?()[\]{}|]/g, we = /\w*$/, Te = /^\[object .+?Constructor\]$/, Ee = /^(?:0|[1-9]\d*)$/, z = {};
976
+ z[o] = z[c] = z[A] = z[S] = z[u] = z[d] = z[E] = z[L] = z[P] = z[Y] = z[x] = z[h] = z[b] = z[k] = z[_] = z[f] = z[v] = z[T] = z[F] = z[tt] = z[Qt] = z[te] = !0, z[p] = z[m] = z[w] = !1;
977
+ var Ae = typeof ft == "object" && ft && ft.Object === Object && ft, Me = typeof self == "object" && self && self.Object === Object && self, nt = Ae || Me || Function("return this")(), ee = r && !r.nodeType && r, $ = ee && !0 && t && !t.nodeType && t, re = $ && $.exports === ee;
978
978
  function xe(s, a) {
979
979
  return s.set(a[0], a[1]), s;
980
980
  }
981
- function it(s, a) {
981
+ function st(s, a) {
982
982
  return s.add(a), s;
983
983
  }
984
984
  function ne(s, a) {
@@ -1030,12 +1030,12 @@ _r.exports;
1030
1030
  l[++a] = g;
1031
1031
  }), l;
1032
1032
  }
1033
- var Oe = Array.prototype, Ce = Function.prototype, wt = Object.prototype, Lt = st["__core-js_shared__"], ce = function() {
1033
+ var Oe = Array.prototype, Ce = Function.prototype, wt = Object.prototype, Lt = nt["__core-js_shared__"], ce = function() {
1034
1034
  var s = /[^.]+$/.exec(Lt && Lt.keys && Lt.keys.IE_PROTO || "");
1035
1035
  return s ? "Symbol(src)_1." + s : "";
1036
1036
  }(), ue = Ce.toString, ut = wt.hasOwnProperty, Tt = wt.toString, Pe = RegExp(
1037
1037
  "^" + ue.call(ut).replace(Se, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1038
- ), gt = re ? st.Buffer : void 0, Et = st.Symbol, Ht = st.Uint8Array, et = Nt(Object.getPrototypeOf, Object), le = Object.create, de = wt.propertyIsEnumerable, Re = Oe.splice, Ut = Object.getOwnPropertySymbols, At = gt ? gt.isBuffer : void 0, fe = Nt(Object.keys, Object), Mt = mt(st, "DataView"), yt = mt(st, "Map"), at = mt(st, "Promise"), xt = mt(st, "Set"), Wt = mt(st, "WeakMap"), It = mt(Object, "create"), Bt = rt(Mt), bt = rt(yt), jt = rt(at), Yt = rt(xt), We = rt(Wt), Gt = Et ? Et.prototype : void 0, ar = Gt ? Gt.valueOf : void 0;
1038
+ ), gt = re ? nt.Buffer : void 0, Et = nt.Symbol, Ht = nt.Uint8Array, et = Nt(Object.getPrototypeOf, Object), le = Object.create, de = wt.propertyIsEnumerable, Re = Oe.splice, Ut = Object.getOwnPropertySymbols, At = gt ? gt.isBuffer : void 0, fe = Nt(Object.keys, Object), Mt = mt(nt, "DataView"), yt = mt(nt, "Map"), it = mt(nt, "Promise"), xt = mt(nt, "Set"), Wt = mt(nt, "WeakMap"), It = mt(Object, "create"), Bt = rt(Mt), bt = rt(yt), jt = rt(it), Yt = rt(xt), We = rt(Wt), Gt = Et ? Et.prototype : void 0, ar = Gt ? Gt.valueOf : void 0;
1039
1039
  function Ot(s) {
1040
1040
  var a = -1, l = s ? s.length : 0;
1041
1041
  for (this.clear(); ++a < l; ) {
@@ -1122,7 +1122,7 @@ _r.exports;
1122
1122
  return he(this, s).set(s, a), this;
1123
1123
  }
1124
1124
  q.prototype.clear = Fr, q.prototype.delete = Nr, q.prototype.get = Lr, q.prototype.has = Hr, q.prototype.set = Ur;
1125
- function ot(s) {
1125
+ function at(s) {
1126
1126
  this.__data__ = new X(s);
1127
1127
  }
1128
1128
  function Wr() {
@@ -1147,7 +1147,7 @@ _r.exports;
1147
1147
  }
1148
1148
  return l.set(s, a), this;
1149
1149
  }
1150
- ot.prototype.clear = Wr, ot.prototype.delete = Br, ot.prototype.get = jr, ot.prototype.has = Yr, ot.prototype.set = Gr;
1150
+ at.prototype.clear = Wr, at.prototype.delete = Br, at.prototype.get = jr, at.prototype.has = Yr, at.prototype.set = Gr;
1151
1151
  function De(s, a) {
1152
1152
  var l = Xe(s) || Fe(s) ? $t(s.length, String) : [], g = l.length, O = !!g;
1153
1153
  for (var M in s)
@@ -1181,7 +1181,7 @@ _r.exports;
1181
1181
  var N = Pt(s), J = N == m || N == y;
1182
1182
  if (hr(s))
1183
1183
  return $e(s, a);
1184
- if (N == b || N == o || J && !M) {
1184
+ if (N == k || N == o || J && !M) {
1185
1185
  if (Ft(s))
1186
1186
  return M ? s : {};
1187
1187
  if (R = vt(J ? {} : s), !a)
@@ -1192,10 +1192,10 @@ _r.exports;
1192
1192
  R = an(s, N, je, a);
1193
1193
  }
1194
1194
  }
1195
- D || (D = new ot());
1196
- var ct = D.get(s);
1197
- if (ct)
1198
- return ct;
1195
+ D || (D = new at());
1196
+ var ot = D.get(s);
1197
+ if (ot)
1198
+ return ot;
1199
1199
  if (D.set(s, R), !U)
1200
1200
  var W = l ? nn(s) : Ve(s);
1201
1201
  return ne(W || s, function(Z, K) {
@@ -1250,7 +1250,7 @@ _r.exports;
1250
1250
  }
1251
1251
  function Zr(s, a, l) {
1252
1252
  var g = a ? l(oe(s), !0) : oe(s);
1253
- return zt(g, it, new s.constructor());
1253
+ return zt(g, st, new s.constructor());
1254
1254
  }
1255
1255
  function Qr(s) {
1256
1256
  return ar ? Object(ar.call(s)) : {};
@@ -1288,14 +1288,14 @@ _r.exports;
1288
1288
  return qr(l) ? l : void 0;
1289
1289
  }
1290
1290
  var Ct = Ut ? Nt(Ut, Object) : dn, Pt = Vr;
1291
- (Mt && Pt(new Mt(new ArrayBuffer(1))) != _ || yt && Pt(new yt()) != p || at && Pt(at.resolve()) != I || xt && Pt(new xt()) != f || Wt && Pt(new Wt()) != w) && (Pt = function(s) {
1292
- var a = Tt.call(s), l = a == b ? s.constructor : void 0, g = l ? rt(l) : void 0;
1291
+ (Mt && Pt(new Mt(new ArrayBuffer(1))) != S || yt && Pt(new yt()) != h || it && Pt(it.resolve()) != I || xt && Pt(new xt()) != f || Wt && Pt(new Wt()) != w) && (Pt = function(s) {
1292
+ var a = Tt.call(s), l = a == k ? s.constructor : void 0, g = l ? rt(l) : void 0;
1293
1293
  if (g)
1294
1294
  switch (g) {
1295
1295
  case Bt:
1296
- return _;
1296
+ return S;
1297
1297
  case bt:
1298
- return p;
1298
+ return h;
1299
1299
  case jt:
1300
1300
  return I;
1301
1301
  case Yt:
@@ -1320,7 +1320,7 @@ _r.exports;
1320
1320
  case u:
1321
1321
  case d:
1322
1322
  return new O(+s);
1323
- case _:
1323
+ case S:
1324
1324
  return pe(s, g);
1325
1325
  case E:
1326
1326
  case L:
@@ -1332,12 +1332,12 @@ _r.exports;
1332
1332
  case Qt:
1333
1333
  case te:
1334
1334
  return tn(s, g);
1335
- case p:
1335
+ case h:
1336
1336
  return ur(s, g, l);
1337
+ case b:
1337
1338
  case v:
1338
- case k:
1339
1339
  return new O(s);
1340
- case S:
1340
+ case _:
1341
1341
  return lr(s);
1342
1342
  case f:
1343
1343
  return Zr(s, g, l);
@@ -1428,42 +1428,44 @@ const G = (t) => Object.keys(t).reduce((r, e) => {
1428
1428
  const { display: n } = t[e];
1429
1429
  return Math.max(r, n.to);
1430
1430
  }, 0);
1431
- function nt(t, r, e) {
1431
+ function ct(t, r, e) {
1432
1432
  t.forEach((n) => {
1433
- const i = Object.values(r).filter(
1434
- (p) => n.items.includes(p.id)
1435
- ), c = i.filter(
1436
- (p) => !e.includes(p.id)
1433
+ const i = n.items.map((k) => String(k)), o = Object.values(r).filter(
1434
+ (k) => i.includes(String(k.id))
1435
+ ), u = o.filter(
1436
+ (k) => !e.includes(String(k.id))
1437
1437
  ).sort(
1438
- (p, v) => p.display.from - v.display.from
1439
- ), u = c[c.length - 1];
1440
- let d = (u == null ? void 0 : u.display.to) || 0;
1441
- i.forEach((p) => {
1442
- if (e.includes(p.id)) {
1443
- const v = p.display.to - p.display.from;
1444
- p.display = {
1445
- from: d,
1446
- to: d + v
1447
- }, d = d + v;
1438
+ (k, I) => k.display.from - I.display.from
1439
+ ), d = o.sort(
1440
+ (k, I) => k.display.from - I.display.from
1441
+ ), p = u[u.length - 1];
1442
+ let m = (p == null ? void 0 : p.display.to) || 0;
1443
+ d.forEach((k) => {
1444
+ if (e.includes(String(k.id))) {
1445
+ const I = k.display.to - k.display.from;
1446
+ k.display = {
1447
+ from: m,
1448
+ to: m + I
1449
+ }, m = m + I;
1448
1450
  }
1449
1451
  });
1450
- const m = i.sort(
1451
- (p, v) => p.display.from - v.display.from
1452
- ).map((p) => p.id);
1453
- let y = 0;
1454
- m.forEach((p) => {
1455
- const v = [];
1456
- let b = 0;
1457
- if (v.forEach((I) => {
1458
- I.forEach((S) => {
1459
- S.type === "transition" && (b += S.duration);
1452
+ const h = o.sort(
1453
+ (k, I) => k.display.from - I.display.from
1454
+ ).map((k) => String(k.id));
1455
+ let b = 0;
1456
+ h.forEach((k) => {
1457
+ const I = [];
1458
+ let _ = 0;
1459
+ if (I.forEach((f) => {
1460
+ f.forEach((v) => {
1461
+ v.type === "transition" && (_ += v.duration);
1460
1462
  });
1461
- }), r[p]) {
1462
- const I = r[p].display.to - r[p].display.from;
1463
- r[p].display = {
1464
- from: y - b,
1465
- to: y + I - b
1466
- }, y += I;
1463
+ }), r[String(k)]) {
1464
+ const f = r[String(k)].display.to - r[String(k)].display.from;
1465
+ r[String(k)].display = {
1466
+ from: b - _,
1467
+ to: b + f - _
1468
+ }, b += f;
1467
1469
  }
1468
1470
  });
1469
1471
  });
@@ -1484,76 +1486,76 @@ function fs(t, r, e, n, i, o) {
1484
1486
  }), { updatedTrackItems: i, updatedStructure: o };
1485
1487
  }
1486
1488
  function Ui(t, r) {
1487
- const e = C(t), n = r && r.length ? r : e.activeIds, i = n.map((_) => e.trackItemsMap[_]).filter((_) => !!_).map((_) => _.id), o = e.transitionIds.filter(
1488
- (_) => {
1489
- const E = e.transitionsMap[_];
1489
+ const e = C(t), n = r && r.length ? r : e.activeIds, i = n.map((S) => e.trackItemsMap[S]).filter((S) => !!S).map((S) => S.id), o = e.transitionIds.filter(
1490
+ (S) => {
1491
+ const E = e.transitionsMap[S];
1490
1492
  return i.includes(E.fromId) || i.includes(E.toId);
1491
1493
  }
1492
1494
  );
1493
1495
  i.push(...o);
1494
- const c = e.trackItemIds, u = e.transitionIds, d = C(e.tracks), h = C(e.structure);
1495
- i.forEach((_) => {
1496
+ const c = e.trackItemIds, u = e.transitionIds, d = C(e.tracks), p = C(e.structure);
1497
+ i.forEach((S) => {
1496
1498
  var L;
1497
- const E = e.trackItemsMap[_] || e.transitionsMap[_];
1499
+ const E = e.trackItemsMap[S] || e.transitionsMap[S];
1498
1500
  if (E.type === "template" || E.type === "composition") {
1499
1501
  const P = (L = e.structure.find(
1500
1502
  (x) => x.id === E.id
1501
1503
  )) == null ? void 0 : L.items;
1502
1504
  i.push(...P);
1503
- const Y = h.findIndex(
1505
+ const Y = p.findIndex(
1504
1506
  (x) => x.id === E.id
1505
1507
  );
1506
- h.splice(Y, 1);
1508
+ p.splice(Y, 1);
1507
1509
  }
1508
- }), i.forEach((_) => {
1509
- h.forEach((E) => {
1510
- E.items.includes(_) && (E.items = E.items.filter((L) => L !== _));
1510
+ }), i.forEach((S) => {
1511
+ p.forEach((E) => {
1512
+ E.items.includes(S) && (E.items = E.items.filter((L) => L !== S));
1511
1513
  });
1512
1514
  });
1513
1515
  const m = c.filter(
1514
- (_) => !i.includes(_)
1516
+ (S) => !i.includes(S)
1515
1517
  );
1516
- u.forEach((_) => {
1517
- n.includes(_) && n.length === 1 && C(e.transitionsMap[_]);
1518
+ u.forEach((S) => {
1519
+ n.includes(S) && n.length === 1 && C(e.transitionsMap[S]);
1518
1520
  });
1519
1521
  const y = u.filter(
1520
- (_) => !i.includes(_) && !n.includes(_)
1521
- ), p = Object.fromEntries(
1522
+ (S) => !i.includes(S) && !n.includes(S)
1523
+ ), h = Object.fromEntries(
1522
1524
  Object.entries(e.transitionsMap).filter(
1523
- ([_]) => !i.includes(_)
1525
+ ([S]) => !i.includes(S)
1524
1526
  )
1525
1527
  );
1526
- Object.keys(p).forEach((_) => {
1527
- n.includes(_) && (p[_].kind = "none");
1528
+ Object.keys(h).forEach((S) => {
1529
+ n.includes(S) && (h[S].kind = "none");
1528
1530
  });
1529
- const v = e.trackItemIds.filter(
1530
- (_) => !n.includes(_)
1531
- ), b = Hi(
1531
+ const b = e.trackItemIds.filter(
1532
+ (S) => !n.includes(S)
1533
+ ), k = Hi(
1532
1534
  e.tracks,
1533
1535
  n
1534
1536
  ), I = Object.fromEntries(
1535
1537
  Object.entries(e.trackItemsMap).filter(
1536
- ([_]) => !i.includes(_)
1538
+ ([S]) => !i.includes(S)
1537
1539
  )
1538
- ), S = d.filter((_) => _.magnetic);
1539
- nt(S, I, []);
1540
- const f = {}, k = [], { updatedTrackItems: T, updatedStructure: w } = fs(
1540
+ ), _ = d.filter((S) => S.magnetic);
1541
+ ct(_, I, []);
1542
+ const f = {}, v = [], { updatedTrackItems: T, updatedStructure: w } = fs(
1541
1543
  i,
1542
- v,
1544
+ b,
1543
1545
  e.trackItemsMap,
1544
1546
  e.structure,
1545
1547
  f,
1546
- k
1548
+ v
1547
1549
  ), A = G(T);
1548
1550
  return {
1549
1551
  trackItemIds: m,
1550
1552
  activeIds: [],
1551
1553
  trackItemsMap: T,
1552
- tracks: b,
1554
+ tracks: k,
1553
1555
  duration: A,
1554
1556
  structure: w,
1555
1557
  transitionIds: y,
1556
- transitionsMap: p
1558
+ transitionsMap: h
1557
1559
  };
1558
1560
  }
1559
1561
  const Wi = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
@@ -1606,13 +1608,13 @@ async function ji(t) {
1606
1608
  let n = C(JSON.parse(r));
1607
1609
  const i = n.activeIds, o = n.trackItemsMap, c = n.structure;
1608
1610
  Object.keys(o).forEach((I) => {
1609
- const S = o[I];
1610
- if ((S.type === "text" || S.type === "caption") && He([
1611
+ const _ = o[I];
1612
+ if ((_.type === "text" || _.type === "caption") && He([
1611
1613
  {
1612
- fontFamily: S.details.fontFamily,
1613
- url: S.details.fontUrl
1614
+ fontFamily: _.details.fontFamily,
1615
+ url: _.details.fontUrl
1614
1616
  }
1615
- ]), S.type === "composition" || S.type === "template") {
1617
+ ]), _.type === "composition" || _.type === "template") {
1616
1618
  const f = hs(
1617
1619
  c,
1618
1620
  I,
@@ -1621,34 +1623,34 @@ async function ji(t) {
1621
1623
  i.push(...f);
1622
1624
  }
1623
1625
  });
1624
- const u = Bi(i, r), d = C(JSON.parse(u)), h = e.tracks;
1626
+ const u = Bi(i, r), d = C(JSON.parse(u)), p = e.tracks;
1625
1627
  d.activeIds.forEach((I) => {
1626
- const S = d.trackItemsMap[I];
1627
- e.trackItemsMap[I] = S, e.trackItemIds.push(I);
1628
+ const _ = d.trackItemsMap[I];
1629
+ e.trackItemsMap[I] = _, e.trackItemIds.push(I);
1628
1630
  const f = {
1629
1631
  id: Ie(),
1630
- type: S.type,
1632
+ type: _.type,
1631
1633
  items: [I],
1632
1634
  magnetic: !1,
1633
1635
  static: !1
1634
1636
  };
1635
- h.unshift(f);
1637
+ p.unshift(f);
1636
1638
  });
1637
- const m = [...d.structure, ...e.structure], y = e.trackItemIds, p = {
1639
+ const m = [...d.structure, ...e.structure], y = e.trackItemIds, h = {
1638
1640
  ...d.trackItemsMap,
1639
1641
  ...e.trackItemsMap
1640
- }, v = {
1642
+ }, b = {
1641
1643
  structure: m,
1642
1644
  trackItemIds: y,
1643
- trackItemsMap: p,
1644
- tracks: h
1645
- }, b = G(v.trackItemsMap);
1645
+ trackItemsMap: h,
1646
+ tracks: p
1647
+ }, k = G(b.trackItemsMap);
1646
1648
  return {
1647
- trackItemIds: v.trackItemIds,
1648
- trackItemsMap: v.trackItemsMap,
1649
- structure: v.structure,
1650
- tracks: v.tracks,
1651
- duration: b
1649
+ trackItemIds: b.trackItemIds,
1650
+ trackItemsMap: b.trackItemsMap,
1651
+ structure: b.structure,
1652
+ tracks: b.tracks,
1653
+ duration: k
1652
1654
  };
1653
1655
  }
1654
1656
  let Sr = {
@@ -1746,14 +1748,14 @@ async function Ki(t, r) {
1746
1748
  const e = { ...t }, n = Object.keys(r)[0], i = Object.values(r)[0], o = e.trackItemsMap[n], c = { ...e.trackItemsMap[n] }, u = o.details;
1747
1749
  if (!i.details.src) return {};
1748
1750
  if (o.type === "image") {
1749
- const d = await Ue(i.details.src), { crop: h, newHeight: m, newWidth: y } = Kn(o, d);
1750
- i.details.crop = h, i.details.height = m, i.details.width = y;
1751
+ const d = await Ue(i.details.src), { crop: p, newHeight: m, newWidth: y } = Kn(o, d);
1752
+ i.details.crop = p, i.details.height = m, i.details.width = y;
1751
1753
  } else if (o.type === "video") {
1752
- const d = await Dn(i.details.src), h = e.trackItemsMap[n], { display: m, duration: y, trim: p } = Vn(h, d), { crop: v, newHeight: b, newWidth: I } = Kn(o, d);
1753
- i.details.crop = v, i.details.height = b, i.details.width = I, c.display = m, c.duration = y, c.trim = p;
1754
+ const d = await Dn(i.details.src), p = e.trackItemsMap[n], { display: m, duration: y, trim: h } = Vn(p, d), { crop: b, newHeight: k, newWidth: I } = Kn(o, d);
1755
+ i.details.crop = b, i.details.height = k, i.details.width = I, c.display = m, c.duration = y, c.trim = h;
1754
1756
  } else if (o.type === "audio") {
1755
- const d = await ms(i.details.src), h = e.trackItemsMap[n], { display: m, duration: y, trim: p } = Vn(h, d);
1756
- c.display = m, c.duration = y, c.trim = p;
1757
+ const d = await ms(i.details.src), p = e.trackItemsMap[n], { display: m, duration: y, trim: h } = Vn(p, d);
1758
+ c.display = m, c.duration = y, c.trim = h;
1757
1759
  }
1758
1760
  return o.metadata && i.metadata ? c.metadata = { ...o.metadata, ...i.metadata } : i.metadata && (c.metadata = i.metadata), o.details = { ...u, ...i.details }, e.trackItemsMap[n] = { ...c }, {
1759
1761
  trackItemsMap: {
@@ -1771,11 +1773,11 @@ function Vi(t, r) {
1771
1773
  ...C(u),
1772
1774
  id: d
1773
1775
  }, e.trackItemIds.push(d);
1774
- const h = e.tracks.find(
1776
+ const p = e.tracks.find(
1775
1777
  (m) => m.items.includes(c)
1776
1778
  );
1777
- n[h.id] ? n[h.id].items.push(d) : n[h.id] = {
1778
- ...h,
1779
+ n[p.id] ? n[p.id].items.push(d) : n[p.id] = {
1780
+ ...p,
1779
1781
  id: Ie(),
1780
1782
  items: [d],
1781
1783
  static: !1,
@@ -1799,10 +1801,10 @@ function qi(t) {
1799
1801
  }
1800
1802
  return t = t.replace(r, (c, u) => i(u)), t = t.replace(
1801
1803
  e,
1802
- (c, u, d, h) => o(+u, +d, +h)
1804
+ (c, u, d, p) => o(+u, +d, +p)
1803
1805
  ), t = t.replace(
1804
1806
  n,
1805
- (c, u, d, h) => o(+u, +d, +h)
1807
+ (c, u, d, p) => o(+u, +d, +p)
1806
1808
  ), t;
1807
1809
  }
1808
1810
  function V(t) {
@@ -1840,8 +1842,8 @@ const Ji = (t) => {
1840
1842
  const r = `.${t.split(".").filter((o) => o.includes("fill:")).join(".")}`, e = {}, n = /\.([\w-]+)\s*\{\s*([^}]+)\s*\}/g;
1841
1843
  let i;
1842
1844
  for (; (i = n.exec(r)) !== null; ) {
1843
- const o = i[1], c = i[2], u = {}, d = /fill\s*:\s*([^;]+);?/.exec(c), h = /stroke\s*:\s*([^;]+);?/.exec(c);
1844
- d && (u.fill = V(d[1].trim())), h && (u.stroke = V(h[1].trim())), e[o] = u;
1845
+ const o = i[1], c = i[2], u = {}, d = /fill\s*:\s*([^;]+);?/.exec(c), p = /stroke\s*:\s*([^;]+);?/.exec(c);
1846
+ d && (u.fill = V(d[1].trim())), p && (u.stroke = V(p[1].trim())), e[o] = u;
1845
1847
  }
1846
1848
  return e;
1847
1849
  };
@@ -1857,12 +1859,12 @@ function hn(t) {
1857
1859
  function Zi(t, r, e = 300, n = 300) {
1858
1860
  const i = [], c = new DOMParser().parseFromString(t, "image/svg+xml"), u = c.documentElement;
1859
1861
  u.setAttribute("width", `${e}`), u.setAttribute("height", `${n}`);
1860
- const d = u.querySelectorAll("style"), h = {};
1862
+ const d = u.querySelectorAll("style"), p = {};
1861
1863
  d.forEach((I) => {
1862
- const S = I.textContent || "", f = Ji(S);
1863
- Object.assign(h, f);
1864
- const k = S.replace(/\.(st[\w-]+)/g, `.${r}-$1`).replace(/url\(#(.*?)\)/g, `url(#${r}-$1)`);
1865
- I.textContent = k;
1864
+ const _ = I.textContent || "", f = Ji(_);
1865
+ Object.assign(p, f);
1866
+ const v = _.replace(/\.(st[\w-]+)/g, `.${r}-$1`).replace(/url\(#(.*?)\)/g, `url(#${r}-$1)`);
1867
+ I.textContent = v;
1866
1868
  const T = Array.from(c.querySelectorAll("*")), w = /* @__PURE__ */ new Set();
1867
1869
  T.forEach((A) => {
1868
1870
  if (hn(A)) return;
@@ -1870,9 +1872,9 @@ function Zi(t, r, e = 300, n = 300) {
1870
1872
  const P = A.getAttribute(L);
1871
1873
  P && !["none", "transparent"].includes(P) && w.add(V(P));
1872
1874
  });
1873
- const _ = A.getAttribute("style");
1874
- if (_) {
1875
- const L = /fill\s*:\s*([^;]+);?/.exec(_), P = /stroke\s*:\s*([^;]+);?/.exec(_), Y = /stop-color\s*:\s*([^;]+);?/.exec(_);
1875
+ const S = A.getAttribute("style");
1876
+ if (S) {
1877
+ const L = /fill\s*:\s*([^;]+);?/.exec(S), P = /stroke\s*:\s*([^;]+);?/.exec(S), Y = /stop-color\s*:\s*([^;]+);?/.exec(S);
1876
1878
  if (L) {
1877
1879
  const x = L[1].trim();
1878
1880
  x && !["none", "transparent"].includes(x) && qe(V(x)) && w.add(V(x));
@@ -1888,7 +1890,7 @@ function Zi(t, r, e = 300, n = 300) {
1888
1890
  }
1889
1891
  const E = A.getAttribute("class");
1890
1892
  E && E.split(" ").forEach((L) => {
1891
- const P = h[L];
1893
+ const P = p[L];
1892
1894
  P != null && P.fill && !["none", "transparent"].includes(P.fill) && w.add(V(P.fill)), P != null && P.stroke && !["none", "transparent"].includes(P.stroke) && w.add(V(P.stroke));
1893
1895
  });
1894
1896
  }), Array.from(w).forEach((A) => {
@@ -1898,23 +1900,23 @@ function Zi(t, r, e = 300, n = 300) {
1898
1900
  const m = Array.from(c.querySelectorAll("*")), y = /* @__PURE__ */ new Set();
1899
1901
  return m.forEach((I) => {
1900
1902
  if (hn(I)) return;
1901
- const S = I.getAttribute("class");
1902
- if (S) {
1903
- const k = S.split(" ").map((T) => `${r}-${T}`).join(" ");
1904
- I.setAttribute("class", k), k.split(" ").forEach((T) => {
1905
- const w = h[T];
1903
+ const _ = I.getAttribute("class");
1904
+ if (_) {
1905
+ const v = _.split(" ").map((T) => `${r}-${T}`).join(" ");
1906
+ I.setAttribute("class", v), v.split(" ").forEach((T) => {
1907
+ const w = p[T];
1906
1908
  w != null && w.fill && !["none", "transparent"].includes(w.fill) && y.add(V(w.fill)), w != null && w.stroke && !["none", "transparent"].includes(w.stroke) && y.add(V(w.stroke));
1907
1909
  });
1908
1910
  }
1909
- ["fill", "stroke", "stop-color"].forEach((k) => {
1910
- const T = I.getAttribute(k);
1911
+ ["fill", "stroke", "stop-color"].forEach((v) => {
1912
+ const T = I.getAttribute(v);
1911
1913
  T && !["none", "transparent"].includes(T) && y.add(V(T));
1912
1914
  });
1913
1915
  const f = I.getAttribute("style");
1914
1916
  if (f) {
1915
- const k = /fill\s*:\s*([^;]+);?/.exec(f), T = /stroke\s*:\s*([^;]+);?/.exec(f), w = /stop-color\s*:\s*([^;]+);?/.exec(f);
1916
- if (k) {
1917
- const A = k[1].trim();
1917
+ const v = /fill\s*:\s*([^;]+);?/.exec(f), T = /stroke\s*:\s*([^;]+);?/.exec(f), w = /stop-color\s*:\s*([^;]+);?/.exec(f);
1918
+ if (v) {
1919
+ const A = v[1].trim();
1918
1920
  A && !["none", "transparent"].includes(A) && y.add(V(A));
1919
1921
  }
1920
1922
  if (T) {
@@ -1930,22 +1932,22 @@ function Zi(t, r, e = 300, n = 300) {
1930
1932
  (I) => !i.includes(I) && qe(I) && i.push(I)
1931
1933
  ), Array.from(c.querySelectorAll("*")).forEach((I) => {
1932
1934
  if (I.hasAttribute("id")) {
1933
- const S = I.getAttribute("id");
1934
- I.setAttribute("id", `${r}-${S}`);
1935
+ const _ = I.getAttribute("id");
1936
+ I.setAttribute("id", `${r}-${_}`);
1935
1937
  }
1936
1938
  if (["fill", "stroke", "stop-color", "filter", "clip-path", "mask"].forEach(
1937
- (S) => {
1938
- const f = I.getAttribute(S);
1939
+ (_) => {
1940
+ const f = I.getAttribute(_);
1939
1941
  f && f.includes("url(#") && I.setAttribute(
1940
- S,
1942
+ _,
1941
1943
  f.replace(/url\(#(.*?)\)/g, `url(#${r}-$1)`)
1942
1944
  );
1943
1945
  }
1944
1946
  ), I.hasAttribute("style")) {
1945
- const S = I.getAttribute("style");
1946
- S.includes("url(#") && I.setAttribute(
1947
+ const _ = I.getAttribute("style");
1948
+ _.includes("url(#") && I.setAttribute(
1947
1949
  "style",
1948
- S.replace(/url\(#(.*?)\)/g, `url(#${r}-$1)`)
1950
+ _.replace(/url\(#(.*?)\)/g, `url(#${r}-$1)`)
1949
1951
  );
1950
1952
  }
1951
1953
  }), Array.from(c.querySelectorAll("path")).forEach((I) => {
@@ -2302,12 +2304,12 @@ const vs = async (t, r) => {
2302
2304
  r.size.width / n.width,
2303
2305
  r.size.height / n.height
2304
2306
  ), o = ((y = t.details) == null ? void 0 : y.rotate) || 0, c = ht(r, n), u = t.display;
2305
- let d = 1 / 0, h = 0;
2306
- e.forEach((p) => {
2307
- const v = t.trackItemsMap[p];
2308
- v.display.from < d && (d = v.display.from), v.display.to > h && (h = v.display.to);
2307
+ let d = 1 / 0, p = 0;
2308
+ e.forEach((h) => {
2309
+ const b = t.trackItemsMap[h];
2310
+ b.display.from < d && (d = b.display.from), b.display.to > p && (p = b.display.to);
2309
2311
  });
2310
- const m = t.trim || t.display || { from: d, to: h };
2312
+ const m = t.trim || t.display || { from: d, to: p };
2311
2313
  return {
2312
2314
  id: t.id,
2313
2315
  type: "template",
@@ -2322,7 +2324,7 @@ const vs = async (t, r) => {
2322
2324
  background: t.details.background || "transparent"
2323
2325
  },
2324
2326
  trim: m,
2325
- display: u || { from: d, to: h },
2327
+ display: u || { from: d, to: p },
2326
2328
  activeEdit: !1
2327
2329
  };
2328
2330
  }, na = async (t, r) => {
@@ -2334,10 +2336,10 @@ const vs = async (t, r) => {
2334
2336
  r.size.width / n.width,
2335
2337
  r.size.height / n.height
2336
2338
  ), o = ((m = t.details) == null ? void 0 : m.rotate) || 0, c = ht(r, n), u = t.display;
2337
- let d = 1 / 0, h = 0;
2339
+ let d = 1 / 0, p = 0;
2338
2340
  return e.forEach((y) => {
2339
- const p = t.trackItemsMap[y];
2340
- p.display.from < d && (d = p.display.from), p.display.to > h && (h = p.display.to);
2341
+ const h = t.trackItemsMap[y];
2342
+ h.display.from < d && (d = h.display.from), h.display.to > p && (p = h.display.to);
2341
2343
  }), {
2342
2344
  id: t.id,
2343
2345
  type: "composition",
@@ -2350,18 +2352,18 @@ const vs = async (t, r) => {
2350
2352
  scale: i,
2351
2353
  rotate: o
2352
2354
  },
2353
- display: u || { from: d, to: h }
2355
+ display: u || { from: d, to: p }
2354
2356
  };
2355
2357
  }, ws = async (t, r) => {
2356
2358
  const e = t.details, n = Ue(e.src), i = fetch(e.src), [o, c] = await Promise.all([
2357
2359
  n,
2358
2360
  i
2359
- ]), u = await c.text(), d = ht(r, o), { serializer: h, colors: m } = Zi(
2361
+ ]), u = await c.text(), d = ht(r, o), { serializer: p, colors: m } = Zi(
2360
2362
  qi(u),
2361
2363
  t.id,
2362
2364
  Number(e.width || o.width),
2363
2365
  Number(e.height || o.height)
2364
- ), y = t.details.colorMap || Object.fromEntries(m.map((p) => [p, p]));
2366
+ ), y = t.details.colorMap || Object.fromEntries(m.map((h) => [h, h]));
2365
2367
  return {
2366
2368
  id: t.id,
2367
2369
  name: "illustration",
@@ -2395,8 +2397,8 @@ const vs = async (t, r) => {
2395
2397
  flipY: e.flipY || !1,
2396
2398
  rotate: e.rotate || "0deg",
2397
2399
  visibility: e.visibility || "visible",
2398
- svgString: h,
2399
- initialSvgString: C(h),
2400
+ svgString: p,
2401
+ initialSvgString: C(p),
2400
2402
  colorMap: y
2401
2403
  },
2402
2404
  metadata: t.metadata || {}
@@ -2691,8 +2693,8 @@ const Os = (t = [], r = []) => t.length === 0 ? r.map((n) => ({
2691
2693
  async function oa(t, r) {
2692
2694
  var c, u, d;
2693
2695
  const e = r.trackItemsMap, n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map();
2694
- for (const h in e) {
2695
- const m = e[h];
2696
+ for (const p in e) {
2697
+ const m = e[p];
2696
2698
  if (m.type === "text" || m.type === "caption") {
2697
2699
  if (m.details.fontUrl) {
2698
2700
  const y = {
@@ -2703,51 +2705,51 @@ async function oa(t, r) {
2703
2705
  }
2704
2706
  (c = m.animations) != null && c.in && m.animations.in.composition.forEach(
2705
2707
  (y) => {
2706
- var p;
2707
- (p = y.details) != null && p.fonts && y.details.fonts.forEach(
2708
- (v) => {
2709
- n.add(JSON.stringify(v));
2708
+ var h;
2709
+ (h = y.details) != null && h.fonts && y.details.fonts.forEach(
2710
+ (b) => {
2711
+ n.add(JSON.stringify(b));
2710
2712
  }
2711
2713
  );
2712
2714
  }
2713
2715
  ), (u = m.animations) != null && u.loop && m.animations.loop.composition.forEach(
2714
2716
  (y) => {
2715
- var p;
2716
- (p = y.details) != null && p.fonts && y.details.fonts.forEach(
2717
- (v) => {
2718
- n.add(JSON.stringify(v));
2717
+ var h;
2718
+ (h = y.details) != null && h.fonts && y.details.fonts.forEach(
2719
+ (b) => {
2720
+ n.add(JSON.stringify(b));
2719
2721
  }
2720
2722
  );
2721
2723
  }
2722
2724
  ), (d = m.animations) != null && d.out && m.animations.out.composition.forEach(
2723
2725
  (y) => {
2724
- var p;
2725
- (p = y.details) != null && p.fonts && y.details.fonts.forEach(
2726
- (v) => {
2727
- n.add(JSON.stringify(v));
2726
+ var h;
2727
+ (h = y.details) != null && h.fonts && y.details.fonts.forEach(
2728
+ (b) => {
2729
+ n.add(JSON.stringify(b));
2728
2730
  }
2729
2731
  );
2730
2732
  }
2731
2733
  );
2732
- } else m.type === "illustration" && i.set(h, {
2734
+ } else m.type === "illustration" && i.set(p, {
2733
2735
  trackItem: m,
2734
2736
  details: m.details
2735
2737
  });
2736
2738
  }
2737
2739
  n.size > 0 && await He(
2738
- Array.from(n).map((h) => JSON.parse(h))
2740
+ Array.from(n).map((p) => JSON.parse(p))
2739
2741
  );
2740
- for (const [h, m] of i) {
2742
+ for (const [p, m] of i) {
2741
2743
  const y = await ws(
2742
2744
  { ...m.trackItem, details: m.details },
2743
2745
  {
2744
2746
  size: { width: m.details.width, height: m.details.height }
2745
2747
  }
2746
- ), p = ys(
2748
+ ), h = ys(
2747
2749
  y.details.svgString,
2748
2750
  m.details.colorMap
2749
2751
  );
2750
- y.details.svgString = p, e[h] = y;
2752
+ y.details.svgString = h, e[p] = y;
2751
2753
  }
2752
2754
  const o = G(e);
2753
2755
  return {
@@ -2765,15 +2767,15 @@ function ca(t) {
2765
2767
  structure: []
2766
2768
  };
2767
2769
  e.forEach((d) => {
2768
- i.trackItemsMap[d] = r.trackItemsMap[d], n.push(r.tracks.find((h) => h.items.includes(d)));
2770
+ i.trackItemsMap[d] = r.trackItemsMap[d], n.push(r.tracks.find((p) => p.items.includes(d)));
2769
2771
  });
2770
2772
  const o = /* @__PURE__ */ new Set();
2771
2773
  n.filter((d) => o.has(d.id) ? !1 : (o.add(d.id), !0)), i.tracks = Array.from(o), i.activeIds.forEach((d) => {
2772
2774
  if (i.trackItemsMap[d].type === "composition" || i.trackItemsMap[d].type === "template") {
2773
- const h = r.structure.find(
2775
+ const p = r.structure.find(
2774
2776
  (m) => m.id === d
2775
2777
  );
2776
- h && (i.structure.push(h), h.items.forEach((m) => {
2778
+ p && (i.structure.push(p), p.items.forEach((m) => {
2777
2779
  i.trackItemsMap[m] = r.trackItemsMap[m];
2778
2780
  }));
2779
2781
  }
@@ -2802,7 +2804,7 @@ function ua(t, r) {
2802
2804
  }
2803
2805
  }, d = Object.values(e.transitionsMap).find(
2804
2806
  (m) => m.fromId === i.id && m.kind !== "none"
2805
- ), h = Object.values(e.transitionsMap).find(
2807
+ ), p = Object.values(e.transitionsMap).find(
2806
2808
  (m) => m.toId === i.id && m.kind !== "none"
2807
2809
  );
2808
2810
  if (i.type === "video" || i.type === "audio") {
@@ -2815,34 +2817,34 @@ function ua(t, r) {
2815
2817
  to: i.trim.to
2816
2818
  };
2817
2819
  }
2818
- if (h) {
2820
+ if (p) {
2819
2821
  const m = c.display.to - c.display.from;
2820
- if (h.duration / 2 > m) {
2822
+ if (p.duration / 2 > m) {
2821
2823
  e.transitionIds = e.transitionIds.filter(
2822
- (p) => p !== h.id
2824
+ (h) => h !== p.id
2823
2825
  );
2824
2826
  const y = {};
2825
2827
  e.transitionIds.forEach(
2826
- (p) => y[p] = e.transitionsMap[p]
2828
+ (h) => y[h] = e.transitionsMap[h]
2827
2829
  ), e.transitionsMap = y;
2828
2830
  }
2829
2831
  }
2830
2832
  if (d) {
2831
2833
  const m = u.display.to - u.display.from, y = {};
2832
2834
  d.duration / 2 > m ? (e.transitionIds = e.transitionIds.filter(
2833
- (p) => p !== d.id
2835
+ (h) => h !== d.id
2834
2836
  ), e.transitionIds.forEach(
2835
- (p) => y[p] = e.transitionsMap[p]
2836
- ), e.transitionsMap = y) : (e.transitionIds = e.transitionIds.map((p) => e.transitionsMap[p].fromId === c.id ? p.replace(c.id, o) : p), Object.keys(e.transitionsMap).forEach((p) => {
2837
- if (e.transitionsMap[p].fromId === c.id) {
2838
- const b = p.replace(c.id, o);
2839
- y[b] = {
2840
- ...e.transitionsMap[p],
2841
- id: b,
2837
+ (h) => y[h] = e.transitionsMap[h]
2838
+ ), e.transitionsMap = y) : (e.transitionIds = e.transitionIds.map((h) => e.transitionsMap[h].fromId === c.id ? h.replace(c.id, o) : h), Object.keys(e.transitionsMap).forEach((h) => {
2839
+ if (e.transitionsMap[h].fromId === c.id) {
2840
+ const k = h.replace(c.id, o);
2841
+ y[k] = {
2842
+ ...e.transitionsMap[h],
2843
+ id: k,
2842
2844
  fromId: o
2843
2845
  };
2844
2846
  } else
2845
- y[p] = e.transitionsMap[p];
2847
+ y[h] = e.transitionsMap[h];
2846
2848
  }), e.transitionsMap = y);
2847
2849
  }
2848
2850
  return e.trackItemsMap[n] = c, e.trackItemsMap[o] = u, e.trackItemIds.push(o), e.tracks.forEach((m) => {
@@ -2864,21 +2866,21 @@ async function la(t, r) {
2864
2866
  ...n[c].details,
2865
2867
  ...u.details
2866
2868
  }, u.details.colorMap)) {
2867
- const d = n[c].details.initialSvgString, h = ys(
2869
+ const d = n[c].details.initialSvgString, p = ys(
2868
2870
  d,
2869
2871
  u.details.colorMap
2870
2872
  );
2871
- n[c].details.svgString = h;
2873
+ n[c].details.svgString = p;
2872
2874
  }
2873
2875
  if (u.metadata && (n[c].metadata ? n[c].metadata = {
2874
2876
  ...n[c].metadata,
2875
2877
  ...u.metadata
2876
2878
  } : n[c].metadata = u.metadata), u.display || u.playbackRate) {
2877
- const d = u.playbackRate, h = n[c].playbackRate || 1, m = n[c].display, v = (m.to - m.from) * h / d, b = {
2879
+ const d = u.playbackRate, p = n[c].playbackRate || 1, m = n[c].display, b = (m.to - m.from) * p / d, k = {
2878
2880
  from: m.from,
2879
- to: m.from + v
2881
+ to: m.from + b
2880
2882
  };
2881
- n[c].display = b, n[c].playbackRate = d;
2883
+ n[c].display = k, n[c].playbackRate = d;
2882
2884
  }
2883
2885
  u.animations && (n[c].animations = {
2884
2886
  ...n[c].animations,
@@ -2902,20 +2904,20 @@ async function da(t, r) {
2902
2904
  const e = C(t), n = Object.keys(r)[0], i = Object.values(r)[0], o = e.trackItemsMap[n], c = o.details;
2903
2905
  if (!i.details.src) return {};
2904
2906
  if (o.type === "image") {
2905
- const u = await Ue(i.details.src), d = o.details.width || 0, h = o.details.height || 0;
2907
+ const u = await Ue(i.details.src), d = o.details.width || 0, p = o.details.height || 0;
2906
2908
  let m = u.width, y = u.height;
2907
- const p = u.width / u.height;
2908
- d / h > p ? (m = d, y = d / p) : (y = h, m = h * p), c.crop = {
2909
+ const h = u.width / u.height;
2910
+ d / p > h ? (m = d, y = d / h) : (y = p, m = p * h), c.crop = {
2909
2911
  x: 0,
2910
2912
  y: 0,
2911
2913
  height: c.height,
2912
2914
  width: c.width
2913
2915
  }, i.details.width = m, i.details.height = y;
2914
2916
  } else if (o.type === "video") {
2915
- const u = await Dn(i.details.src), d = o.details.width || 0, h = o.details.height || 0;
2917
+ const u = await Dn(i.details.src), d = o.details.width || 0, p = o.details.height || 0;
2916
2918
  let m = u.width, y = u.height;
2917
- const p = u.width / u.height;
2918
- d / h > p ? (m = d, y = d / p) : (y = h, m = h * p), c.crop = {
2919
+ const h = u.width / u.height;
2920
+ d / p > h ? (m = d, y = d / h) : (y = p, m = p * h), c.crop = {
2919
2921
  x: 0,
2920
2922
  y: 0,
2921
2923
  height: c.height,
@@ -2938,27 +2940,30 @@ function fa(t, r) {
2938
2940
  };
2939
2941
  }
2940
2942
  function pa(t, { idTrack: r, idItems: e }, n) {
2941
- const i = n.tracks.find((c) => c.id === r);
2942
- if (!i) return;
2943
- const o = i.items.reduce((c, u) => {
2944
- const d = n.trackItemsMap[u];
2945
- return d.display.to > c.display.to ? d : c;
2946
- }, t[0]);
2947
- e.forEach((c) => {
2948
- const u = t.find((h) => h.id === c);
2949
- if (!u) return;
2950
- const d = u.display.to - u.display.from;
2951
- u.display.from = o.display.to, u.display.to = u.display.from + d;
2943
+ const i = n.tracks.find((u) => u.id === r);
2944
+ if (!i || !i.magnetic) return;
2945
+ let c = i.items.reduce(
2946
+ (u, d) => {
2947
+ const p = n.trackItemsMap[d];
2948
+ return p.display.to > u.display.to ? p : u;
2949
+ },
2950
+ { display: { to: 0 } }
2951
+ ).display.to;
2952
+ e.forEach((u) => {
2953
+ const d = t.find((m) => String(m.id) === String(u));
2954
+ if (!d) return;
2955
+ const p = d.display.to - d.display.from;
2956
+ d.display.from = c, d.display.to = c + p, c = c + p;
2952
2957
  });
2953
2958
  }
2954
2959
  async function ha(t, r, e = {}) {
2955
- var v;
2960
+ var h;
2956
2961
  const n = C(t), i = r.trackItems.map(
2957
2962
  (b) => aa(b, {
2958
2963
  size: n.size
2959
2964
  })
2960
2965
  ), o = await Promise.all(i);
2961
- (v = r.tracks) == null || v.forEach((b) => {
2966
+ (h = r.tracks) == null || h.forEach((b) => {
2962
2967
  pa(
2963
2968
  o,
2964
2969
  { idTrack: b.id, idItems: b.items },
@@ -2975,46 +2980,40 @@ async function ha(t, r, e = {}) {
2975
2980
  ...n.transitionsMap,
2976
2981
  ...b.transitionsMap
2977
2982
  };
2978
- const I = {
2983
+ const k = {
2979
2984
  id: b.id,
2980
2985
  items: b.trackItemIds,
2981
2986
  transitions: b.transitionsIds || [],
2982
2987
  tracks: b.tracks
2983
2988
  };
2984
- u.push(I);
2989
+ u.push(k);
2985
2990
  });
2986
- const h = [], m = {};
2987
- if (o.forEach((b) => {
2988
- h.push(b.id), m[b.id] = b;
2989
- }), xs(
2990
- n.tracks,
2991
- c
2992
- ))
2993
- n.tracks.forEach((b) => {
2994
- c.forEach((I) => {
2995
- b.id === I.id && (b.magnetic && nt(
2996
- [b],
2991
+ const p = [], m = {};
2992
+ return o.forEach((b) => {
2993
+ p.push(b.id), m[b.id] = b;
2994
+ }), c.map((b) => xs(n.tracks, [b]) ? b : null).forEach((b, k) => {
2995
+ if (b)
2996
+ n.tracks.forEach((I) => {
2997
+ I.id === b.id && (I.items = I.items.concat(b.items), I.magnetic && ct(
2998
+ [I],
2997
2999
  n.trackItemsMap,
2998
3000
  d
2999
- ), b.items.push(...h));
3001
+ ));
3000
3002
  });
3001
- });
3002
- else {
3003
- const b = e.trackIndex || 0, I = Math.min(
3004
- Math.max(b, 0),
3005
- n.tracks.length
3006
- );
3007
- n.tracks.splice(I, 0, ...c);
3008
- }
3009
- n.trackItemsMap = {
3003
+ else {
3004
+ const I = e.trackIndex || 0, _ = c[k], f = Math.min(
3005
+ Math.max(I, 0),
3006
+ n.tracks.length
3007
+ );
3008
+ n.tracks.splice(f, 0, _);
3009
+ }
3010
+ }), n.trackItemsMap = {
3010
3011
  ...n.trackItemsMap,
3011
3012
  ...m
3012
3013
  }, n.trackItemIds = [
3013
3014
  ...n.trackItemIds,
3014
- ...h
3015
- ], n.structure = [...n.structure, ...u];
3016
- const p = n.tracks.filter((b) => b.magnetic);
3017
- return nt(p, n.trackItemsMap, d), n.duration = G(n.trackItemsMap), {
3015
+ ...p
3016
+ ], n.structure = [...n.structure, ...u], n.duration = G(n.trackItemsMap), {
3018
3017
  trackItemIds: n.trackItemIds,
3019
3018
  trackItemsMap: n.trackItemsMap,
3020
3019
  tracks: n.tracks,
@@ -3033,7 +3032,7 @@ function St(t, r, e = {
3033
3032
  }), (e.targetTrackIndex !== void 0 || e.targetTrackId) && !e.isNewTrack) {
3034
3033
  const c = e.targetTrackIndex || 0, u = e.targetTrackId;
3035
3034
  let d = t.tracks[c];
3036
- if (u && (d = t.tracks.find((h) => h.id === u)), !d)
3035
+ if (u && (d = t.tracks.find((p) => p.id === u)), !d)
3037
3036
  throw new Error("Target track not found");
3038
3037
  d.items.push(...i);
3039
3038
  } else {
@@ -3062,8 +3061,8 @@ async function ma(t, r, e = {}) {
3062
3061
  scaleMode: e.scaleMode,
3063
3062
  scaleAspectRatio: e.scaleAspectRatio
3064
3063
  })
3065
- ], o = await Promise.all(i), c = o.map((h) => h.id), u = St(n, o, e), d = u.tracks.filter((h) => h.magnetic);
3066
- return nt(d, u.trackItemsMap, c), u.duration = G(u.trackItemsMap), {
3064
+ ], o = await Promise.all(i), c = o.map((p) => p.id), u = St(n, o, e), d = u.tracks.filter((p) => p.magnetic);
3065
+ return ct(d, u.trackItemsMap, c), u.duration = G(u.trackItemsMap), {
3067
3066
  trackItemIds: u.trackItemIds,
3068
3067
  trackItemsMap: u.trackItemsMap,
3069
3068
  tracks: u.tracks,
@@ -3071,10 +3070,10 @@ async function ma(t, r, e = {}) {
3071
3070
  };
3072
3071
  }
3073
3072
  async function ga(t, r, e = {}) {
3074
- const n = C(t), i = [_s(r)], o = await Promise.all(i), c = o.map((h) => h.id), u = St(n, o, e);
3073
+ const n = C(t), i = [_s(r)], o = await Promise.all(i), c = o.map((p) => p.id), u = St(n, o, e);
3075
3074
  u.duration = G(u.trackItemsMap);
3076
- const d = u.tracks.filter((h) => h.magnetic);
3077
- return nt(d, u.trackItemsMap, c), {
3075
+ const d = u.tracks.filter((p) => p.magnetic);
3076
+ return ct(d, u.trackItemsMap, c), {
3078
3077
  trackItemIds: u.trackItemIds,
3079
3078
  trackItemsMap: u.trackItemsMap,
3080
3079
  tracks: u.tracks,
@@ -3088,10 +3087,10 @@ async function ya(t, r, e = {}) {
3088
3087
  scaleMode: e.scaleMode,
3089
3088
  scaleAspectRatio: e.scaleAspectRatio
3090
3089
  })
3091
- ], o = await Promise.all(i), c = o.map((h) => h.id), u = St(n, o, e);
3090
+ ], o = await Promise.all(i), c = o.map((p) => p.id), u = St(n, o, e);
3092
3091
  u.duration = G(u.trackItemsMap);
3093
- const d = u.tracks.filter((h) => h.magnetic);
3094
- return nt(d, u.trackItemsMap, c), {
3092
+ const d = u.tracks.filter((p) => p.magnetic);
3093
+ return ct(d, u.trackItemsMap, c), {
3095
3094
  trackItemIds: u.trackItemIds,
3096
3095
  trackItemsMap: u.trackItemsMap,
3097
3096
  tracks: u.tracks,
@@ -3103,10 +3102,10 @@ async function Ia(t, r, e = {}) {
3103
3102
  As(r, {
3104
3103
  size: e.size
3105
3104
  })
3106
- ], o = await Promise.all(i), c = o.map((h) => h.id), u = St(n, o, e);
3105
+ ], o = await Promise.all(i), c = o.map((p) => p.id), u = St(n, o, e);
3107
3106
  u.duration = G(u.trackItemsMap);
3108
- const d = u.tracks.filter((h) => h.magnetic);
3109
- return nt(d, u.trackItemsMap, c), {
3107
+ const d = u.tracks.filter((p) => p.magnetic);
3108
+ return ct(d, u.trackItemsMap, c), {
3110
3109
  trackItemIds: u.trackItemIds,
3111
3110
  trackItemsMap: u.trackItemsMap,
3112
3111
  tracks: u.tracks,
@@ -3120,10 +3119,10 @@ async function ba(t, r, e = {}) {
3120
3119
  scaleMode: e.scaleMode,
3121
3120
  scaleAspectRatio: e.scaleAspectRatio
3122
3121
  })
3123
- ], o = await Promise.all(i), c = o.map((h) => h.id), u = St(n, o, e);
3122
+ ], o = await Promise.all(i), c = o.map((p) => p.id), u = St(n, o, e);
3124
3123
  u.duration = G(u.trackItemsMap);
3125
- const d = u.tracks.filter((h) => h.magnetic);
3126
- return nt(d, u.trackItemsMap, c), {
3124
+ const d = u.tracks.filter((p) => p.magnetic);
3125
+ return ct(d, u.trackItemsMap, c), {
3127
3126
  trackItemIds: u.trackItemIds,
3128
3127
  trackItemsMap: u.trackItemsMap,
3129
3128
  tracks: u.tracks,
@@ -3137,10 +3136,10 @@ async function ka(t, r, e = {}) {
3137
3136
  scaleMode: e.scaleMode,
3138
3137
  scaleAspectRatio: e.scaleAspectRatio
3139
3138
  })
3140
- ], o = await Promise.all(i), c = o.map((h) => h.id), u = St(n, o, e);
3139
+ ], o = await Promise.all(i), c = o.map((p) => p.id), u = St(n, o, e);
3141
3140
  u.duration = G(u.trackItemsMap);
3142
- const d = u.tracks.filter((h) => h.magnetic);
3143
- return nt(d, u.trackItemsMap, c), {
3141
+ const d = u.tracks.filter((p) => p.magnetic);
3142
+ return ct(d, u.trackItemsMap, c), {
3144
3143
  trackItemIds: u.trackItemIds,
3145
3144
  trackItemsMap: u.trackItemsMap,
3146
3145
  tracks: u.tracks,
@@ -3148,7 +3147,7 @@ async function ka(t, r, e = {}) {
3148
3147
  };
3149
3148
  }
3150
3149
  async function va(t, r, e = {}) {
3151
- const n = C(t), i = "composition", o = r.trackItemsMap, c = r.trackItemIds, u = r.tracks || [], d = r.trackItemDetailsMap, { details: h, ...m } = await na(r, {
3150
+ const n = C(t), i = "composition", o = r.trackItemsMap, c = r.trackItemIds, u = r.tracks || [], d = r.trackItemDetailsMap, { details: p, ...m } = await na(r, {
3152
3151
  size: n.size,
3153
3152
  scaleMode: e.scaleMode,
3154
3153
  scaleAspectRatio: e.scaleAspectRatio
@@ -3157,34 +3156,34 @@ async function va(t, r, e = {}) {
3157
3156
  items: c,
3158
3157
  transitions: [],
3159
3158
  tracks: u
3160
- }, v = [{
3159
+ }, b = [{
3161
3160
  ...m,
3162
3161
  type: i,
3163
- details: h
3164
- }], b = St(n, v, e);
3165
- b.trackItemsMap = {
3166
- ...b.trackItemsMap,
3162
+ details: p
3163
+ }], k = St(n, b, e);
3164
+ k.trackItemsMap = {
3165
+ ...k.trackItemsMap,
3167
3166
  ...o,
3168
3167
  [m.id]: {
3169
3168
  ...m,
3170
3169
  type: i,
3171
- details: h
3170
+ details: p
3172
3171
  }
3173
- }, b.structure = [...b.structure, y], b.duration = G(b.trackItemsMap);
3174
- const I = b.tracks.filter((S) => S.magnetic);
3175
- return nt(I, b.trackItemsMap, [m.id]), d && Object.keys(d).forEach((S) => {
3176
- b.trackItemsMap[S] = {
3177
- ...b.trackItemsMap[S],
3172
+ }, k.structure = [...k.structure, y], k.duration = G(k.trackItemsMap);
3173
+ const I = k.tracks.filter((_) => _.magnetic);
3174
+ return ct(I, k.trackItemsMap, [m.id]), d && Object.keys(d).forEach((_) => {
3175
+ k.trackItemsMap[_] = {
3176
+ ...k.trackItemsMap[_],
3178
3177
  details: {
3179
- ...d[S].details
3178
+ ...d[_].details
3180
3179
  }
3181
3180
  };
3182
3181
  }), {
3183
- trackItemIds: b.trackItemIds,
3184
- trackItemsMap: b.trackItemsMap,
3185
- tracks: b.tracks,
3186
- duration: b.duration,
3187
- structure: b.structure
3182
+ trackItemIds: k.trackItemIds,
3183
+ trackItemsMap: k.trackItemsMap,
3184
+ tracks: k.tracks,
3185
+ duration: k.duration,
3186
+ structure: k.structure
3188
3187
  };
3189
3188
  }
3190
3189
  async function ge(t, r, e = {}, n) {
@@ -3235,58 +3234,58 @@ async function ge(t, r, e = {}, n) {
3235
3234
  scaleAspectRatio: e.scaleAspectRatio
3236
3235
  })
3237
3236
  );
3238
- const u = await Promise.all(c), d = u.map((y) => y.id), h = St(i, u, e);
3239
- h.duration = G(h.trackItemsMap);
3240
- const m = h.tracks.filter((y) => y.magnetic);
3241
- return nt(m, h.trackItemsMap, d), {
3242
- trackItemIds: h.trackItemIds,
3243
- trackItemsMap: h.trackItemsMap,
3244
- tracks: h.tracks,
3245
- duration: h.duration
3237
+ const u = await Promise.all(c), d = u.map((y) => y.id), p = St(i, u, e);
3238
+ p.duration = G(p.trackItemsMap);
3239
+ const m = p.tracks.filter((y) => y.magnetic);
3240
+ return ct(m, p.trackItemsMap, d), {
3241
+ trackItemIds: p.trackItemIds,
3242
+ trackItemsMap: p.trackItemsMap,
3243
+ tracks: p.tracks,
3244
+ duration: p.duration
3246
3245
  };
3247
3246
  }
3248
3247
  async function _a(t, r, e = {}) {
3249
- const n = C(t), i = "template", o = r.trackItemsMap, c = r.trackItemIds, u = r.transitionsMap, d = r.transitionIds || [], h = r.tracks || [], m = r.structure || [], { details: y, ...p } = await Ss(r, {
3248
+ const n = C(t), i = "template", o = r.trackItemsMap, c = r.trackItemIds, u = r.transitionsMap, d = r.transitionIds || [], p = r.tracks || [], m = r.structure || [], { details: y, ...h } = await Ss(r, {
3250
3249
  size: n.size,
3251
3250
  scaleMode: e.scaleMode,
3252
3251
  scaleAspectRatio: e.scaleAspectRatio
3253
- }), v = {
3254
- id: p.id,
3252
+ }), b = {
3253
+ id: h.id,
3255
3254
  items: c,
3256
3255
  transitions: d,
3257
- tracks: h
3256
+ tracks: p
3258
3257
  }, I = [{
3259
- ...p,
3258
+ ...h,
3260
3259
  type: i,
3261
3260
  details: y
3262
- }], S = St(n, I, e);
3263
- S.transitionIds = [
3264
- ...S.transitionIds,
3261
+ }], _ = St(n, I, e);
3262
+ _.transitionIds = [
3263
+ ..._.transitionIds,
3265
3264
  ...d
3266
- ], S.transitionsMap = {
3267
- ...S.transitionsMap,
3265
+ ], _.transitionsMap = {
3266
+ ..._.transitionsMap,
3268
3267
  ...u
3269
- }, S.trackItemsMap = {
3270
- ...S.trackItemsMap,
3268
+ }, _.trackItemsMap = {
3269
+ ..._.trackItemsMap,
3271
3270
  ...o,
3272
- [p.id]: {
3273
- ...p,
3271
+ [h.id]: {
3272
+ ...h,
3274
3273
  type: i,
3275
3274
  details: y
3276
3275
  }
3277
- }, S.structure = [
3278
- ...S.structure,
3279
- v,
3276
+ }, _.structure = [
3277
+ ..._.structure,
3278
+ b,
3280
3279
  ...m
3281
- ], S.duration = G(S.trackItemsMap);
3282
- const f = S.tracks.filter((k) => k.magnetic);
3283
- return nt(f, S.trackItemsMap, [p.id]), {
3284
- trackItemIds: S.trackItemIds,
3285
- trackItemsMap: S.trackItemsMap,
3286
- tracks: S.tracks,
3287
- duration: S.duration,
3288
- structure: S.structure,
3289
- transitionsMap: S.transitionsMap
3280
+ ], _.duration = G(_.trackItemsMap);
3281
+ const f = _.tracks.filter((v) => v.magnetic);
3282
+ return ct(f, _.trackItemsMap, [h.id]), {
3283
+ trackItemIds: _.trackItemIds,
3284
+ trackItemsMap: _.trackItemsMap,
3285
+ tracks: _.tracks,
3286
+ duration: _.duration,
3287
+ structure: _.structure,
3288
+ transitionsMap: _.transitionsMap
3290
3289
  };
3291
3290
  }
3292
3291
  async function Sa(t, r, e = {}) {
@@ -3296,15 +3295,15 @@ async function Sa(t, r, e = {}) {
3296
3295
  })
3297
3296
  ), o = await Promise.all(i), c = Os(r.tracks, r.trackItems), u = [], d = {};
3298
3297
  if (o.forEach((y) => {
3299
- const { details: p, ...v } = y;
3300
- u.push(y.id), d[y.id] = v;
3298
+ const { details: h, ...b } = y;
3299
+ u.push(y.id), d[y.id] = b;
3301
3300
  }), xs(
3302
3301
  n.tracks,
3303
3302
  c
3304
3303
  ))
3305
3304
  n.tracks.forEach((y) => {
3306
- c.forEach((p) => {
3307
- y.id === p.id && (y.magnetic && nt(
3305
+ c.forEach((h) => {
3306
+ y.id === h.id && (y.magnetic && ct(
3308
3307
  [y],
3309
3308
  n.trackItemsMap,
3310
3309
  u
@@ -3312,11 +3311,11 @@ async function Sa(t, r, e = {}) {
3312
3311
  });
3313
3312
  });
3314
3313
  else {
3315
- const y = e.trackIndex || 0, p = Math.min(
3314
+ const y = e.trackIndex || 0, h = Math.min(
3316
3315
  Math.max(y, 0),
3317
3316
  n.tracks.length
3318
3317
  );
3319
- n.tracks.splice(p, 0, ...c);
3318
+ n.tracks.splice(h, 0, ...c);
3320
3319
  }
3321
3320
  n.trackItemsMap = {
3322
3321
  ...n.trackItemsMap,
@@ -3326,7 +3325,7 @@ async function Sa(t, r, e = {}) {
3326
3325
  ...u
3327
3326
  ], n.duration = G(n.trackItemsMap);
3328
3327
  const m = n.tracks.filter((y) => y.magnetic);
3329
- return nt(
3328
+ return ct(
3330
3329
  m,
3331
3330
  n.trackItemsMap,
3332
3331
  u
@@ -3372,10 +3371,10 @@ async function Ta(t, r, e = {}) {
3372
3371
  scaleMode: e.scaleMode,
3373
3372
  scaleAspectRatio: e.scaleAspectRatio
3374
3373
  })
3375
- ], o = await Promise.all(i), c = o.map((h) => h.id), u = St(n, o, e);
3374
+ ], o = await Promise.all(i), c = o.map((p) => p.id), u = St(n, o, e);
3376
3375
  u.duration = G(u.trackItemsMap);
3377
- const d = u.tracks.filter((h) => h.magnetic);
3378
- return nt(d, u.trackItemsMap, c), {
3376
+ const d = u.tracks.filter((p) => p.magnetic);
3377
+ return ct(d, u.trackItemsMap, c), {
3379
3378
  trackItemIds: u.trackItemIds,
3380
3379
  trackItemsMap: u.trackItemsMap,
3381
3380
  tracks: u.tracks,
@@ -3399,18 +3398,18 @@ function Ea(t) {
3399
3398
  qt(({ key: f }) => f.startsWith(Zt))
3400
3399
  ), d = Vt.pipe(
3401
3400
  qt(({ key: f }) => f.startsWith(ds))
3402
- ), h = r.subscribe(async (f) => {
3403
- var k;
3401
+ ), p = r.subscribe(async (f) => {
3402
+ var v;
3404
3403
  if (f.key === Xn) {
3405
- const { actions: T } = (k = f.value) == null ? void 0 : k.payload;
3404
+ const { actions: T } = (v = f.value) == null ? void 0 : v.payload;
3406
3405
  T.forEach((w) => {
3407
3406
  Us(w.type, w.payload && { payload: w.payload });
3408
3407
  });
3409
3408
  }
3410
3409
  }), m = e.subscribe(async (f) => {
3411
- var k, T;
3410
+ var v, T;
3412
3411
  if (f.key === ii) {
3413
- const w = (k = f.value) == null ? void 0 : k.payload, A = await oa(t.getState(), w);
3412
+ const w = (v = f.value) == null ? void 0 : v.payload, A = await oa(t.getState(), w);
3414
3413
  t.updateState(A, {
3415
3414
  kind: "design:load",
3416
3415
  updateHistory: !1
@@ -3431,10 +3430,10 @@ function Ea(t) {
3431
3430
  }), y = o.subscribe((f) => {
3432
3431
  if (f.key === $i) return t.undo();
3433
3432
  if (f.key === Fi) return t.redo();
3434
- }), p = d.subscribe((f) => {
3435
- var k;
3433
+ }), h = d.subscribe((f) => {
3434
+ var v;
3436
3435
  if (f.key === Ni) {
3437
- const T = (k = f.value) == null ? void 0 : k.payload.scale;
3436
+ const T = (v = f.value) == null ? void 0 : v.payload.scale;
3438
3437
  t.updateState(
3439
3438
  {
3440
3439
  scale: T
@@ -3445,12 +3444,12 @@ function Ea(t) {
3445
3444
  }
3446
3445
  );
3447
3446
  }
3448
- }), v = i.subscribe(async (f) => {
3449
- var k, T, w, A;
3447
+ }), b = i.subscribe(async (f) => {
3448
+ var v, T, w, A;
3450
3449
  if (f.key === Ci) {
3451
- const _ = ((k = f.value) == null ? void 0 : k.payload.trackItemIds) || [];
3450
+ const S = ((v = f.value) == null ? void 0 : v.payload.trackItemIds) || [];
3452
3451
  t.updateState(
3453
- { activeIds: _ },
3452
+ { activeIds: S },
3454
3453
  {
3455
3454
  kind: "update",
3456
3455
  updateHistory: !1
@@ -3458,133 +3457,133 @@ function Ea(t) {
3458
3457
  );
3459
3458
  }
3460
3459
  if (f.key === Pi && ca(t.getState()), f.key === Di) {
3461
- const _ = (T = f.value) == null ? void 0 : T.payload.trackItemIds, E = Ui(t.getState(), _);
3460
+ const S = (T = f.value) == null ? void 0 : T.payload.trackItemIds, E = Ui(t.getState(), S);
3462
3461
  t.updateState(E, { updateHistory: !0, kind: "remove" });
3463
3462
  }
3464
3463
  if (f.key === Ri) {
3465
- const _ = Vi(
3464
+ const S = Vi(
3466
3465
  t.getState(),
3467
3466
  (w = f.value) == null ? void 0 : w.payload.trackItemIds
3468
3467
  );
3469
- t.updateState(_, {
3468
+ t.updateState(S, {
3470
3469
  updateHistory: !0,
3471
3470
  kind: "update"
3472
3471
  });
3473
3472
  }
3474
3473
  if (f.key === zi) {
3475
- const _ = (A = f.value) == null ? void 0 : A.payload, E = await Ki(t.getState(), _);
3474
+ const S = (A = f.value) == null ? void 0 : A.payload, E = await Ki(t.getState(), S);
3476
3475
  t.updateState(E, {
3477
3476
  updateHistory: !0,
3478
3477
  kind: "update:details"
3479
3478
  });
3480
3479
  }
3481
- }), b = n.subscribe(async (f) => {
3482
- var L, P, Y, x, F, tt, Qt, te, Se, we, Te, Ee, z, Ae, Me, st, ee, $, re, xe, it, ne, se, zt, $t, ie, Ft, ae, Nt, oe, Oe, Ce, wt, Lt, ce, ue, ut, Tt, Pe, gt, Et, Ht, et, le, de, Re, Ut, At, fe, Mt, yt, at, xt, Wt, It, Bt, bt, jt, Yt;
3483
- const k = C(t.getState()), T = ((P = (L = f.value) == null ? void 0 : L.options) == null ? void 0 : P.isSelected) || !1, w = (x = (Y = f.value) == null ? void 0 : Y.options) == null ? void 0 : x.scaleMode, A = (tt = (F = f.value) == null ? void 0 : F.options) == null ? void 0 : tt.scaleAspectRatio, _ = (te = (Qt = f.value) == null ? void 0 : Qt.options) == null ? void 0 : te.trackIndex;
3480
+ }), k = n.subscribe(async (f) => {
3481
+ var L, P, Y, x, F, tt, Qt, te, Se, we, Te, Ee, z, Ae, Me, nt, ee, $, re, xe, st, ne, se, zt, $t, ie, Ft, ae, Nt, oe, Oe, Ce, wt, Lt, ce, ue, ut, Tt, Pe, gt, Et, Ht, et, le, de, Re, Ut, At, fe, Mt, yt, it, xt, Wt, It, Bt, bt, jt, Yt;
3482
+ const v = C(t.getState()), T = ((P = (L = f.value) == null ? void 0 : L.options) == null ? void 0 : P.isSelected) || !1, w = (x = (Y = f.value) == null ? void 0 : Y.options) == null ? void 0 : x.scaleMode, A = (tt = (F = f.value) == null ? void 0 : F.options) == null ? void 0 : tt.scaleAspectRatio, S = (te = (Qt = f.value) == null ? void 0 : Qt.options) == null ? void 0 : te.trackIndex;
3484
3483
  let E = {};
3485
- f.key === pi ? E = await wa(k, (Se = f.value) == null ? void 0 : Se.payload) : f.key === gi ? E = await ha(k, (we = f.value) == null ? void 0 : we.payload, {
3486
- trackIndex: _
3487
- }) : f.key === hi ? E = await Sa(k, (Te = f.value) == null ? void 0 : Te.payload, {
3488
- trackIndex: _
3489
- }) : f.key === oi ? E = await Ia(k, (Ee = f.value) == null ? void 0 : Ee.payload, {
3490
- targetTrackIndex: _,
3484
+ f.key === pi ? E = await wa(v, (Se = f.value) == null ? void 0 : Se.payload) : f.key === gi ? E = await ha(v, (we = f.value) == null ? void 0 : we.payload, {
3485
+ trackIndex: S
3486
+ }) : f.key === hi ? E = await Sa(v, (Te = f.value) == null ? void 0 : Te.payload, {
3487
+ trackIndex: S
3488
+ }) : f.key === oi ? E = await Ia(v, (Ee = f.value) == null ? void 0 : Ee.payload, {
3489
+ targetTrackIndex: S,
3491
3490
  targetTrackId: (z = f.value) == null ? void 0 : z.options.targetTrackId,
3492
- size: k.size,
3491
+ size: v.size,
3493
3492
  isNewTrack: (Me = (Ae = f.value) == null ? void 0 : Ae.options) == null ? void 0 : Me.isNewTrack
3494
- }) : f.key === mi ? E = await _a(k, (st = f.value) == null ? void 0 : st.payload, {
3493
+ }) : f.key === mi ? E = await _a(v, (nt = f.value) == null ? void 0 : nt.payload, {
3495
3494
  scaleMode: w,
3496
3495
  scaleAspectRatio: A,
3497
- targetTrackIndex: _,
3496
+ targetTrackIndex: S,
3498
3497
  targetTrackId: ($ = (ee = f.value) == null ? void 0 : ee.options) == null ? void 0 : $.targetTrackId
3499
- }) : f.key === di ? E = await ka(k, (re = f.value) == null ? void 0 : re.payload, {
3498
+ }) : f.key === di ? E = await ka(v, (re = f.value) == null ? void 0 : re.payload, {
3500
3499
  scaleMode: w,
3501
3500
  scaleAspectRatio: A,
3502
- targetTrackIndex: _,
3501
+ targetTrackIndex: S,
3503
3502
  targetTrackId: (xe = f.value) == null ? void 0 : xe.options.targetTrackId
3504
- }) : f.key === fi ? E = await ba(k, (it = f.value) == null ? void 0 : it.payload, {
3503
+ }) : f.key === fi ? E = await ba(v, (st = f.value) == null ? void 0 : st.payload, {
3505
3504
  scaleMode: w,
3506
3505
  scaleAspectRatio: A,
3507
- targetTrackIndex: _,
3506
+ targetTrackIndex: S,
3508
3507
  targetTrackId: (ne = f.value) == null ? void 0 : ne.options.targetTrackId
3509
- }) : f.key === Ti ? E = await Ta(k, (se = f.value) == null ? void 0 : se.payload, {
3508
+ }) : f.key === Ti ? E = await Ta(v, (se = f.value) == null ? void 0 : se.payload, {
3510
3509
  scaleMode: w,
3511
3510
  scaleAspectRatio: A,
3512
- targetTrackIndex: _,
3511
+ targetTrackIndex: S,
3513
3512
  targetTrackId: (zt = f.value) == null ? void 0 : zt.options.targetTrackId
3514
- }) : f.key === li ? E = await ma(k, ($t = f.value) == null ? void 0 : $t.payload, {
3513
+ }) : f.key === li ? E = await ma(v, ($t = f.value) == null ? void 0 : $t.payload, {
3515
3514
  scaleMode: w,
3516
3515
  scaleAspectRatio: A,
3517
- targetTrackIndex: _,
3516
+ targetTrackIndex: S,
3518
3517
  targetTrackId: (ie = f.value) == null ? void 0 : ie.options.targetTrackId,
3519
3518
  isNewTrack: (ae = (Ft = f.value) == null ? void 0 : Ft.options) == null ? void 0 : ae.isNewTrack
3520
- }) : f.key === ui ? E = await ga(k, (Nt = f.value) == null ? void 0 : Nt.payload, {
3521
- targetTrackIndex: _,
3519
+ }) : f.key === ui ? E = await ga(v, (Nt = f.value) == null ? void 0 : Nt.payload, {
3520
+ targetTrackIndex: S,
3522
3521
  targetTrackId: (oe = f.value) == null ? void 0 : oe.options.targetTrackId,
3523
3522
  isNewTrack: (Ce = (Oe = f.value) == null ? void 0 : Oe.options) == null ? void 0 : Ce.isNewTrack
3524
- }) : f.key === ci ? E = await ya(k, (wt = f.value) == null ? void 0 : wt.payload, {
3523
+ }) : f.key === ci ? E = await ya(v, (wt = f.value) == null ? void 0 : wt.payload, {
3525
3524
  scaleMode: w,
3526
3525
  scaleAspectRatio: A,
3527
- targetTrackIndex: _,
3526
+ targetTrackIndex: S,
3528
3527
  targetTrackId: (Lt = f.value) == null ? void 0 : Lt.options.targetTrackId,
3529
3528
  isNewTrack: (ue = (ce = f.value) == null ? void 0 : ce.options) == null ? void 0 : ue.isNewTrack
3530
- }) : f.key === yi ? E = await va(k, (ut = f.value) == null ? void 0 : ut.payload, {
3529
+ }) : f.key === yi ? E = await va(v, (ut = f.value) == null ? void 0 : ut.payload, {
3531
3530
  scaleMode: w,
3532
3531
  scaleAspectRatio: A,
3533
- targetTrackIndex: _,
3532
+ targetTrackIndex: S,
3534
3533
  targetTrackId: (Tt = f.value) == null ? void 0 : Tt.options.targetTrackId
3535
3534
  }) : f.key === Ii ? E = await ge(
3536
- k,
3535
+ v,
3537
3536
  (Pe = f.value) == null ? void 0 : Pe.payload,
3538
3537
  {
3539
- targetTrackIndex: _,
3538
+ targetTrackIndex: S,
3540
3539
  targetTrackId: (Et = (gt = f.value) == null ? void 0 : gt.options) == null ? void 0 : Et.targetTrackId
3541
3540
  },
3542
3541
  "progress-bar"
3543
3542
  ) : f.key === _i ? E = await ge(
3544
- k,
3543
+ v,
3545
3544
  (Ht = f.value) == null ? void 0 : Ht.payload,
3546
3545
  {
3547
- targetTrackIndex: _,
3546
+ targetTrackIndex: S,
3548
3547
  targetTrackId: (le = (et = f.value) == null ? void 0 : et.options) == null ? void 0 : le.targetTrackId
3549
3548
  },
3550
3549
  "progress-square"
3551
3550
  ) : f.key === bi ? E = await ge(
3552
- k,
3551
+ v,
3553
3552
  (de = f.value) == null ? void 0 : de.payload,
3554
3553
  {
3555
- targetTrackIndex: _,
3554
+ targetTrackIndex: S,
3556
3555
  targetTrackId: (Ut = (Re = f.value) == null ? void 0 : Re.options) == null ? void 0 : Ut.targetTrackId
3557
3556
  },
3558
3557
  "progress-frame"
3559
3558
  ) : f.key === ki ? E = await ge(
3560
- k,
3559
+ v,
3561
3560
  (At = f.value) == null ? void 0 : At.payload,
3562
3561
  {
3563
- targetTrackIndex: _,
3562
+ targetTrackIndex: S,
3564
3563
  targetTrackId: (Mt = (fe = f.value) == null ? void 0 : fe.options) == null ? void 0 : Mt.targetTrackId
3565
3564
  },
3566
3565
  "radial-audio-bars"
3567
3566
  ) : f.key === vi ? E = await ge(
3568
- k,
3567
+ v,
3569
3568
  (yt = f.value) == null ? void 0 : yt.payload,
3570
3569
  {
3571
- targetTrackIndex: _,
3572
- targetTrackId: (xt = (at = f.value) == null ? void 0 : at.options) == null ? void 0 : xt.targetTrackId
3570
+ targetTrackIndex: S,
3571
+ targetTrackId: (xt = (it = f.value) == null ? void 0 : it.options) == null ? void 0 : xt.targetTrackId
3573
3572
  },
3574
3573
  "lineal-audio-bars"
3575
3574
  ) : f.key === Si ? E = await ge(
3576
- k,
3575
+ v,
3577
3576
  (Wt = f.value) == null ? void 0 : Wt.payload,
3578
3577
  {
3579
- targetTrackIndex: _,
3578
+ targetTrackIndex: S,
3580
3579
  targetTrackId: (Bt = (It = f.value) == null ? void 0 : It.options) == null ? void 0 : Bt.targetTrackId
3581
3580
  },
3582
3581
  "wave-audio-bars"
3583
3582
  ) : f.key === wi && (E = await ge(
3584
- k,
3583
+ v,
3585
3584
  (bt = f.value) == null ? void 0 : bt.payload,
3586
3585
  {
3587
- targetTrackIndex: _,
3586
+ targetTrackIndex: S,
3588
3587
  targetTrackId: (Yt = (jt = f.value) == null ? void 0 : jt.options) == null ? void 0 : Yt.targetTrackId
3589
3588
  },
3590
3589
  "hill-audio-bars"
@@ -3593,9 +3592,9 @@ function Ea(t) {
3593
3592
  kind: "add"
3594
3593
  });
3595
3594
  }), I = c.subscribe(async (f) => {
3596
- var k;
3595
+ var v;
3597
3596
  if (f.key === Oi) {
3598
- const T = (k = f.value) == null ? void 0 : k.options.time, w = ua(t.getState(), T);
3597
+ const T = (v = f.value) == null ? void 0 : v.options.time, w = ua(t.getState(), T);
3599
3598
  Object.keys(w).length > 0 && t.updateState(w, {
3600
3599
  updateHistory: !0,
3601
3600
  kind: "update"
@@ -3608,12 +3607,12 @@ function Ea(t) {
3608
3607
  kind: "update"
3609
3608
  });
3610
3609
  }
3611
- }), S = u.subscribe(async (f) => {
3612
- var k, T, w;
3610
+ }), _ = u.subscribe(async (f) => {
3611
+ var v, T, w;
3613
3612
  if (f.key === Ei) {
3614
3613
  const A = await la(
3615
3614
  t.getState(),
3616
- (k = f.value) == null ? void 0 : k.payload
3615
+ (v = f.value) == null ? void 0 : v.payload
3617
3616
  );
3618
3617
  t.updateState(A, {
3619
3618
  updateHistory: !0,
@@ -3640,7 +3639,7 @@ function Ea(t) {
3640
3639
  });
3641
3640
  return {
3642
3641
  unsubscribe: () => {
3643
- b.unsubscribe(), I.unsubscribe(), S.unsubscribe(), y.unsubscribe(), v.unsubscribe(), m.unsubscribe(), p.unsubscribe(), h.unsubscribe();
3642
+ k.unsubscribe(), I.unsubscribe(), _.unsubscribe(), y.unsubscribe(), b.unsubscribe(), m.unsubscribe(), h.unsubscribe(), p.unsubscribe();
3644
3643
  }
3645
3644
  };
3646
3645
  }
@@ -3649,31 +3648,31 @@ function Cs(t, r, e = { cyclesFix: !0 }, n = []) {
3649
3648
  var u, d;
3650
3649
  let i = [];
3651
3650
  const o = Array.isArray(t);
3652
- for (const h in t) {
3653
- const m = t[h], y = o ? +h : h;
3654
- if (!(h in r)) {
3651
+ for (const p in t) {
3652
+ const m = t[p], y = o ? +p : p;
3653
+ if (!(p in r)) {
3655
3654
  i.push({
3656
3655
  type: "REMOVE",
3657
3656
  path: [y],
3658
- oldValue: t[h]
3657
+ oldValue: t[p]
3659
3658
  });
3660
3659
  continue;
3661
3660
  }
3662
- const p = r[h], v = typeof m == "object" && typeof p == "object" && Array.isArray(m) === Array.isArray(p);
3663
- m && p && v && !Aa[(d = (u = Object.getPrototypeOf(m)) == null ? void 0 : u.constructor) == null ? void 0 : d.name] && (!e.cyclesFix || !n.includes(m)) ? i.push.apply(i, Cs(m, p, e, e.cyclesFix ? n.concat([m]) : []).map((b) => (b.path.unshift(y), b))) : m !== p && // treat NaN values as equivalent
3664
- !(Number.isNaN(m) && Number.isNaN(p)) && !(v && (isNaN(m) ? m + "" == p + "" : +m == +p)) && i.push({
3661
+ const h = r[p], b = typeof m == "object" && typeof h == "object" && Array.isArray(m) === Array.isArray(h);
3662
+ m && h && b && !Aa[(d = (u = Object.getPrototypeOf(m)) == null ? void 0 : u.constructor) == null ? void 0 : d.name] && (!e.cyclesFix || !n.includes(m)) ? i.push.apply(i, Cs(m, h, e, e.cyclesFix ? n.concat([m]) : []).map((k) => (k.path.unshift(y), k))) : m !== h && // treat NaN values as equivalent
3663
+ !(Number.isNaN(m) && Number.isNaN(h)) && !(b && (isNaN(m) ? m + "" == h + "" : +m == +h)) && i.push({
3665
3664
  path: [y],
3666
3665
  type: "CHANGE",
3667
- value: p,
3666
+ value: h,
3668
3667
  oldValue: m
3669
3668
  });
3670
3669
  }
3671
3670
  const c = Array.isArray(r);
3672
- for (const h in r)
3673
- h in t || i.push({
3671
+ for (const p in r)
3672
+ p in t || i.push({
3674
3673
  type: "CREATE",
3675
- path: [c ? +h : h],
3676
- value: r[h]
3674
+ path: [c ? +p : p],
3675
+ value: r[p]
3677
3676
  });
3678
3677
  return i;
3679
3678
  }
@@ -4038,8 +4037,8 @@ var $a = class {
4038
4037
  const o = e;
4039
4038
  e = r;
4040
4039
  const c = this;
4041
- return function(d = o, ...h) {
4042
- return c.produce(d, (m) => e.call(this, m, ...h));
4040
+ return function(d = o, ...p) {
4041
+ return c.produce(d, (m) => e.call(this, m, ...p));
4043
4042
  };
4044
4043
  }
4045
4044
  typeof e != "function" && j(6), n !== void 0 && typeof n != "function" && j(7);
@@ -4139,90 +4138,90 @@ function Fs(t) {
4139
4138
  function ts() {
4140
4139
  process.env.NODE_ENV !== "production" && Ps.push(
4141
4140
  'Sets cannot have "replace" patches.',
4142
- function(p) {
4143
- return "Unsupported patch operation: " + p;
4141
+ function(h) {
4142
+ return "Unsupported patch operation: " + h;
4144
4143
  },
4145
- function(p) {
4146
- return "Cannot apply patch, path doesn't resolve: " + p;
4144
+ function(h) {
4145
+ return "Cannot apply patch, path doesn't resolve: " + h;
4147
4146
  },
4148
4147
  "Patching reserved attributes like __proto__, prototype and constructor is not allowed"
4149
4148
  );
4150
4149
  const r = "replace", e = "add", n = "remove";
4151
- function i(p, v, b, I) {
4152
- switch (p.type_) {
4150
+ function i(h, b, k, I) {
4151
+ switch (h.type_) {
4153
4152
  case 0:
4154
4153
  case 2:
4155
4154
  return c(
4156
- p,
4157
- v,
4155
+ h,
4158
4156
  b,
4157
+ k,
4159
4158
  I
4160
4159
  );
4161
4160
  case 1:
4162
- return o(p, v, b, I);
4161
+ return o(h, b, k, I);
4163
4162
  case 3:
4164
4163
  return u(
4165
- p,
4166
- v,
4164
+ h,
4167
4165
  b,
4166
+ k,
4168
4167
  I
4169
4168
  );
4170
4169
  }
4171
4170
  }
4172
- function o(p, v, b, I) {
4173
- let { base_: S, assigned_: f } = p, k = p.copy_;
4174
- k.length < S.length && ([S, k] = [k, S], [b, I] = [I, b]);
4175
- for (let T = 0; T < S.length; T++)
4176
- if (f[T] && k[T] !== S[T]) {
4177
- const w = v.concat([T]);
4178
- b.push({
4171
+ function o(h, b, k, I) {
4172
+ let { base_: _, assigned_: f } = h, v = h.copy_;
4173
+ v.length < _.length && ([_, v] = [v, _], [k, I] = [I, k]);
4174
+ for (let T = 0; T < _.length; T++)
4175
+ if (f[T] && v[T] !== _[T]) {
4176
+ const w = b.concat([T]);
4177
+ k.push({
4179
4178
  op: r,
4180
4179
  path: w,
4181
4180
  // Need to maybe clone it, as it can in fact be the original value
4182
4181
  // due to the base/copy inversion at the start of this function
4183
- value: y(k[T])
4182
+ value: y(v[T])
4184
4183
  }), I.push({
4185
4184
  op: r,
4186
4185
  path: w,
4187
- value: y(S[T])
4186
+ value: y(_[T])
4188
4187
  });
4189
4188
  }
4190
- for (let T = S.length; T < k.length; T++) {
4191
- const w = v.concat([T]);
4192
- b.push({
4189
+ for (let T = _.length; T < v.length; T++) {
4190
+ const w = b.concat([T]);
4191
+ k.push({
4193
4192
  op: e,
4194
4193
  path: w,
4195
4194
  // Need to maybe clone it, as it can in fact be the original value
4196
4195
  // due to the base/copy inversion at the start of this function
4197
- value: y(k[T])
4196
+ value: y(v[T])
4198
4197
  });
4199
4198
  }
4200
- for (let T = k.length - 1; S.length <= T; --T) {
4201
- const w = v.concat([T]);
4199
+ for (let T = v.length - 1; _.length <= T; --T) {
4200
+ const w = b.concat([T]);
4202
4201
  I.push({
4203
4202
  op: n,
4204
4203
  path: w
4205
4204
  });
4206
4205
  }
4207
4206
  }
4208
- function c(p, v, b, I) {
4209
- const { base_: S, copy_: f } = p;
4210
- Ze(p.assigned_, (k, T) => {
4211
- const w = gn(S, k), A = gn(f, k), _ = T ? Qe(S, k) ? r : e : n;
4212
- if (w === A && _ === r)
4207
+ function c(h, b, k, I) {
4208
+ const { base_: _, copy_: f } = h;
4209
+ Ze(h.assigned_, (v, T) => {
4210
+ const w = gn(_, v), A = gn(f, v), S = T ? Qe(_, v) ? r : e : n;
4211
+ if (w === A && S === r)
4213
4212
  return;
4214
- const E = v.concat(k);
4215
- b.push(_ === n ? { op: _, path: E } : { op: _, path: E, value: A }), I.push(
4216
- _ === e ? { op: n, path: E } : _ === n ? { op: e, path: E, value: y(w) } : { op: r, path: E, value: y(w) }
4213
+ const E = b.concat(v);
4214
+ k.push(S === n ? { op: S, path: E } : { op: S, path: E, value: A }), I.push(
4215
+ S === e ? { op: n, path: E } : S === n ? { op: e, path: E, value: y(w) } : { op: r, path: E, value: y(w) }
4217
4216
  );
4218
4217
  });
4219
4218
  }
4220
- function u(p, v, b, I) {
4221
- let { base_: S, copy_: f } = p, k = 0;
4222
- S.forEach((T) => {
4219
+ function u(h, b, k, I) {
4220
+ let { base_: _, copy_: f } = h, v = 0;
4221
+ _.forEach((T) => {
4223
4222
  if (!f.has(T)) {
4224
- const w = v.concat([k]);
4225
- b.push({
4223
+ const w = b.concat([v]);
4224
+ k.push({
4226
4225
  op: n,
4227
4226
  path: w,
4228
4227
  value: T
@@ -4232,11 +4231,11 @@ function ts() {
4232
4231
  value: T
4233
4232
  });
4234
4233
  }
4235
- k++;
4236
- }), k = 0, f.forEach((T) => {
4237
- if (!S.has(T)) {
4238
- const w = v.concat([k]);
4239
- b.push({
4234
+ v++;
4235
+ }), v = 0, f.forEach((T) => {
4236
+ if (!_.has(T)) {
4237
+ const w = b.concat([v]);
4238
+ k.push({
4240
4239
  op: e,
4241
4240
  path: w,
4242
4241
  value: T
@@ -4246,33 +4245,33 @@ function ts() {
4246
4245
  value: T
4247
4246
  });
4248
4247
  }
4249
- k++;
4248
+ v++;
4250
4249
  });
4251
4250
  }
4252
- function d(p, v, b, I) {
4253
- b.push({
4251
+ function d(h, b, k, I) {
4252
+ k.push({
4254
4253
  op: r,
4255
4254
  path: [],
4256
- value: v === zn ? void 0 : v
4255
+ value: b === zn ? void 0 : b
4257
4256
  }), I.push({
4258
4257
  op: r,
4259
4258
  path: [],
4260
- value: p
4259
+ value: h
4261
4260
  });
4262
4261
  }
4263
- function h(p, v) {
4264
- return v.forEach((b) => {
4265
- const { path: I, op: S } = b;
4266
- let f = p;
4262
+ function p(h, b) {
4263
+ return b.forEach((k) => {
4264
+ const { path: I, op: _ } = k;
4265
+ let f = h;
4267
4266
  for (let A = 0; A < I.length - 1; A++) {
4268
- const _ = ve(f);
4267
+ const S = ve(f);
4269
4268
  let E = I[A];
4270
- typeof E != "string" && typeof E != "number" && (E = "" + E), (_ === 0 || _ === 1) && (E === "__proto__" || E === "constructor") && j(19), typeof f == "function" && E === "prototype" && j(19), f = gn(f, E), typeof f != "object" && j(18, I.join("/"));
4269
+ typeof E != "string" && typeof E != "number" && (E = "" + E), (S === 0 || S === 1) && (E === "__proto__" || E === "constructor") && j(19), typeof f == "function" && E === "prototype" && j(19), f = gn(f, E), typeof f != "object" && j(18, I.join("/"));
4271
4270
  }
4272
- const k = ve(f), T = m(b.value), w = I[I.length - 1];
4273
- switch (S) {
4271
+ const v = ve(f), T = m(k.value), w = I[I.length - 1];
4272
+ switch (_) {
4274
4273
  case r:
4275
- switch (k) {
4274
+ switch (v) {
4276
4275
  case 2:
4277
4276
  return f.set(w, T);
4278
4277
  case 3:
@@ -4281,7 +4280,7 @@ function ts() {
4281
4280
  return f[w] = T;
4282
4281
  }
4283
4282
  case e:
4284
- switch (k) {
4283
+ switch (v) {
4285
4284
  case 1:
4286
4285
  return w === "-" ? f.push(T) : f.splice(w, 0, T);
4287
4286
  case 2:
@@ -4292,42 +4291,42 @@ function ts() {
4292
4291
  return f[w] = T;
4293
4292
  }
4294
4293
  case n:
4295
- switch (k) {
4294
+ switch (v) {
4296
4295
  case 1:
4297
4296
  return f.splice(w, 1);
4298
4297
  case 2:
4299
4298
  return f.delete(w);
4300
4299
  case 3:
4301
- return f.delete(b.value);
4300
+ return f.delete(k.value);
4302
4301
  default:
4303
4302
  return delete f[w];
4304
4303
  }
4305
4304
  default:
4306
- j(17, S);
4305
+ j(17, _);
4307
4306
  }
4308
- }), p;
4309
- }
4310
- function m(p) {
4311
- if (!Jt(p))
4312
- return p;
4313
- if (Array.isArray(p))
4314
- return p.map(m);
4315
- if (sr(p))
4307
+ }), h;
4308
+ }
4309
+ function m(h) {
4310
+ if (!Jt(h))
4311
+ return h;
4312
+ if (Array.isArray(h))
4313
+ return h.map(m);
4314
+ if (sr(h))
4316
4315
  return new Map(
4317
- Array.from(p.entries()).map(([b, I]) => [b, m(I)])
4316
+ Array.from(h.entries()).map(([k, I]) => [k, m(I)])
4318
4317
  );
4319
- if (ir(p))
4320
- return new Set(Array.from(p).map(m));
4321
- const v = Object.create(be(p));
4322
- for (const b in p)
4323
- v[b] = m(p[b]);
4324
- return Qe(p, Je) && (v[Je] = p[Je]), v;
4318
+ if (ir(h))
4319
+ return new Set(Array.from(h).map(m));
4320
+ const b = Object.create(be(h));
4321
+ for (const k in h)
4322
+ b[k] = m(h[k]);
4323
+ return Qe(h, Je) && (b[Je] = h[Je]), b;
4325
4324
  }
4326
- function y(p) {
4327
- return ke(p) ? m(p) : p;
4325
+ function y(h) {
4326
+ return ke(h) ? m(h) : h;
4328
4327
  }
4329
4328
  Ca("Patches", {
4330
- applyPatches_: h,
4329
+ applyPatches_: p,
4331
4330
  generatePatches_: i,
4332
4331
  generateReplacementPatches_: d
4333
4332
  });
@@ -4656,15 +4655,15 @@ class Xo {
4656
4655
  transitionIds: c,
4657
4656
  transitionsMap: u,
4658
4657
  trackItemsMap: d,
4659
- structure: h
4658
+ structure: p
4660
4659
  } = this.getState(), m = C({
4661
4660
  trackItemIds: i,
4662
4661
  tracks: o,
4663
4662
  transitionIds: c,
4664
4663
  transitionsMap: u,
4665
4664
  trackItemsMap: d,
4666
- structure: h
4667
- }), y = [], p = [], v = [], b = [], I = [], S = [];
4665
+ structure: p
4666
+ }), y = [], h = [], b = [], k = [], I = [], _ = [];
4668
4667
  e.forEach((x) => {
4669
4668
  let F;
4670
4669
  const tt = x.path.slice(1);
@@ -4680,33 +4679,33 @@ class Xo {
4680
4679
  path: tt,
4681
4680
  op: "add",
4682
4681
  value: x.oldValue
4683
- }, x.path.includes("trackItemIds") ? v.push(F) : x.path.includes("transitionIds") ? p.push(F) : x.path.includes("trackItemsMap") ? I.push(F) : x.path.includes("transitionsMap") ? b.push(F) : x.path.includes("tracks") ? y.push(F) : x.path.includes("structure") && S.push(F);
4682
+ }, x.path.includes("trackItemIds") ? b.push(F) : x.path.includes("transitionIds") ? h.push(F) : x.path.includes("trackItemsMap") ? I.push(F) : x.path.includes("transitionsMap") ? k.push(F) : x.path.includes("tracks") ? y.push(F) : x.path.includes("structure") && _.push(F);
4684
4683
  });
4685
4684
  const f = this.applyPatch(
4686
4685
  m.tracks,
4687
4686
  y
4688
- ), k = this.applyPatch(
4687
+ ), v = this.applyPatch(
4689
4688
  m.transitionIds,
4690
- p
4689
+ h
4691
4690
  ), T = this.applyPatch(
4692
4691
  m.trackItemIds,
4693
- v
4692
+ b
4694
4693
  ), w = this.applyPatch(
4695
4694
  m.transitionsMap,
4696
- b
4695
+ k
4697
4696
  ), A = this.applyPatch(
4698
4697
  m.trackItemsMap,
4699
4698
  I
4700
- ), _ = this.applyPatch(
4699
+ ), S = this.applyPatch(
4701
4700
  m.structure,
4702
- S
4701
+ _
4703
4702
  ), E = C({
4704
4703
  tracks: f,
4705
- transitionIds: k,
4704
+ transitionIds: v,
4706
4705
  trackItemIds: T,
4707
4706
  transitionsMap: w,
4708
4707
  trackItemsMap: A,
4709
- structure: _
4708
+ structure: S
4710
4709
  }), L = C(this.getState()), P = { ...L, ...E };
4711
4710
  this.prevState = L, this.redos.push({ redos: e, type: n });
4712
4711
  const Y = G(P.trackItemsMap);
@@ -4727,15 +4726,15 @@ class Xo {
4727
4726
  transitionIds: c,
4728
4727
  transitionsMap: u,
4729
4728
  trackItemsMap: d,
4730
- structure: h
4729
+ structure: p
4731
4730
  } = this.getState(), m = C({
4732
4731
  trackItemIds: i,
4733
4732
  tracks: o,
4734
4733
  transitionIds: c,
4735
4734
  transitionsMap: u,
4736
4735
  trackItemsMap: d,
4737
- structure: h
4738
- }), y = [], p = [], v = [], b = [], I = [], S = [];
4736
+ structure: p
4737
+ }), y = [], h = [], b = [], k = [], I = [], _ = [];
4739
4738
  e.forEach((x) => {
4740
4739
  let F;
4741
4740
  const tt = x.path.slice(1);
@@ -4751,33 +4750,33 @@ class Xo {
4751
4750
  path: tt,
4752
4751
  op: "remove",
4753
4752
  value: x.oldValue
4754
- }, x.path.includes("trackItemIds") ? v.push(F) : x.path.includes("transitionIds") ? p.push(F) : x.path.includes("trackItemsMap") ? I.push(F) : x.path.includes("transitionsMap") ? b.push(F) : x.path.includes("structure") ? S.push(F) : y.push(F);
4753
+ }, x.path.includes("trackItemIds") ? b.push(F) : x.path.includes("transitionIds") ? h.push(F) : x.path.includes("trackItemsMap") ? I.push(F) : x.path.includes("transitionsMap") ? k.push(F) : x.path.includes("structure") ? _.push(F) : y.push(F);
4755
4754
  });
4756
4755
  const f = this.applyPatch(
4757
4756
  m.tracks,
4758
4757
  y
4759
- ), k = this.applyPatch(
4758
+ ), v = this.applyPatch(
4760
4759
  m.transitionIds,
4761
- p
4760
+ h
4762
4761
  ), T = this.applyPatch(
4763
4762
  m.trackItemIds,
4764
- v
4763
+ b
4765
4764
  ), w = this.applyPatch(
4766
4765
  m.transitionsMap,
4767
- b
4766
+ k
4768
4767
  ), A = this.applyPatch(
4769
4768
  m.trackItemsMap,
4770
4769
  I
4771
- ), _ = this.applyPatch(
4770
+ ), S = this.applyPatch(
4772
4771
  m.structure,
4773
- S
4772
+ _
4774
4773
  ), E = C({
4775
4774
  tracks: f,
4776
- transitionIds: k,
4775
+ transitionIds: v,
4777
4776
  trackItemIds: T,
4778
4777
  transitionsMap: w,
4779
4778
  trackItemsMap: A,
4780
- structure: _
4779
+ structure: S
4781
4780
  }), L = C(this.getState()), P = { ...L, ...E };
4782
4781
  this.prevState = L, this.undos.push({ undos: e, type: n });
4783
4782
  const Y = G(P.trackItemsMap);