@designcombo/state 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var ai = Object.defineProperty;
2
2
  var si = (t, r, n) => r in t ? ai(t, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[r] = n;
3
3
  var Et = (t, r, n) => si(t, typeof r != "symbol" ? r + "" : r, n);
4
- import { subject as Bt, filter as Wt, DESIGN_PREFIX as oi, ADD_PREFIX as ci, LAYER_PREFIX as ui, HISTORY_PREFIX as fi, ACTIVE_PREFIX as li, EDIT_PREFIX as pi, DESIGN_LOAD as di, HISTORY_UNDO as hi, HISTORY_REDO as yi, ADD_CAPTION as mi, ADD_TEXT as bi, ADD_IMAGE as _i, ADD_AUDIO as gi, ADD_VIDEO as vi, ACTIVE_DELETE as Ii, ACTIVE_SPLIT as Si, ACTIVE_CLONE as wi, ACTIVE_PASTE as Ti, EDIT_OBJECT as Ai } from "@designcombo/events";
4
+ import { subject as Bt, filter as Wt, DESIGN_PREFIX as oi, ADD_PREFIX as ci, LAYER_PREFIX as ui, HISTORY_PREFIX as fi, ACTIVE_PREFIX as li, EDIT_PREFIX as pi, DESIGN_LOAD as di, HISTORY_UNDO as hi, HISTORY_REDO as yi, LAYER_DELETE as mi, ADD_CAPTION as bi, ADD_TEXT as _i, ADD_IMAGE as gi, ADD_AUDIO as vi, ADD_VIDEO as Ii, ACTIVE_SPLIT as Si, ACTIVE_CLONE as wi, ACTIVE_PASTE as Ti, EDIT_OBJECT as Ai } from "@designcombo/events";
5
5
  var en = function(t, r) {
6
6
  return en = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
7
7
  n.__proto__ = a;
@@ -101,21 +101,21 @@ var Ze = function() {
101
101
  }
102
102
  else
103
103
  l.remove(this);
104
- var S = this.initialTeardown;
105
- if (yt(S))
104
+ var w = this.initialTeardown;
105
+ if (yt(w))
106
106
  try {
107
- S();
107
+ w();
108
108
  } catch (f) {
109
109
  c = f instanceof Xr ? f.errors : [f];
110
110
  }
111
- var R = this._finalizers;
112
- if (R) {
111
+ var z = this._finalizers;
112
+ if (z) {
113
113
  this._finalizers = null;
114
114
  try {
115
- for (var h = rn(R), p = h.next(); !p.done; p = h.next()) {
116
- var v = p.value;
115
+ for (var h = rn(z), p = h.next(); !p.done; p = h.next()) {
116
+ var g = p.value;
117
117
  try {
118
- An(v);
118
+ An(g);
119
119
  } catch (f) {
120
120
  c = c ?? [], f instanceof Xr ? c = an(an([], nn(c)), nn(f.errors)) : c.push(f);
121
121
  }
@@ -513,8 +513,8 @@ function mn(t) {
513
513
  var Ye = { exports: {} };
514
514
  Ye.exports;
515
515
  (function(t, r) {
516
- var n = 200, a = "__lodash_hash_undefined__", o = 1, c = 2, l = 9007199254740991, d = "[object Arguments]", E = "[object Array]", D = "[object AsyncFunction]", S = "[object Boolean]", R = "[object Date]", h = "[object Error]", p = "[object Function]", v = "[object GeneratorFunction]", f = "[object Map]", _ = "[object Number]", m = "[object Null]", g = "[object Object]", b = "[object Promise]", y = "[object Proxy]", F = "[object RegExp]", k = "[object Set]", O = "[object String]", N = "[object Symbol]", z = "[object Undefined]", w = "[object WeakMap]", T = "[object ArrayBuffer]", H = "[object DataView]", _e = "[object Float32Array]", ge = "[object Float64Array]", ve = "[object Int8Array]", er = "[object Int16Array]", rr = "[object Int32Array]", nr = "[object Uint8Array]", ir = "[object Uint8ClampedArray]", C = "[object Uint16Array]", ar = "[object Uint32Array]", sr = /[\\^$.*+?()[\]{}|]/g, rt = /^\[object .+?Constructor\]$/, Ie = /^(?:0|[1-9]\d*)$/, j = {};
517
- j[_e] = j[ge] = j[ve] = j[er] = j[rr] = j[nr] = j[ir] = j[C] = j[ar] = !0, j[d] = j[E] = j[T] = j[S] = j[H] = j[R] = j[h] = j[p] = j[f] = j[_] = j[g] = j[F] = j[k] = j[O] = j[w] = !1;
516
+ var n = 200, a = "__lodash_hash_undefined__", o = 1, c = 2, l = 9007199254740991, d = "[object Arguments]", E = "[object Array]", D = "[object AsyncFunction]", w = "[object Boolean]", z = "[object Date]", h = "[object Error]", p = "[object Function]", g = "[object GeneratorFunction]", f = "[object Map]", v = "[object Number]", b = "[object Null]", _ = "[object Object]", m = "[object Promise]", y = "[object Proxy]", F = "[object RegExp]", k = "[object Set]", M = "[object String]", N = "[object Symbol]", R = "[object Undefined]", S = "[object WeakMap]", T = "[object ArrayBuffer]", H = "[object DataView]", _e = "[object Float32Array]", ge = "[object Float64Array]", ve = "[object Int8Array]", er = "[object Int16Array]", rr = "[object Int32Array]", nr = "[object Uint8Array]", ir = "[object Uint8ClampedArray]", C = "[object Uint16Array]", ar = "[object Uint32Array]", sr = /[\\^$.*+?()[\]{}|]/g, rt = /^\[object .+?Constructor\]$/, Ie = /^(?:0|[1-9]\d*)$/, j = {};
517
+ j[_e] = j[ge] = j[ve] = j[er] = j[rr] = j[nr] = j[ir] = j[C] = j[ar] = !0, j[d] = j[E] = j[T] = j[w] = j[H] = j[z] = j[h] = j[p] = j[f] = j[v] = j[_] = j[F] = j[k] = j[M] = j[S] = !1;
518
518
  var Se = typeof et == "object" && et && et.Object === Object && et, or = typeof self == "object" && self && self.Object === Object && self, nt = Se || or || Function("return this")(), we = r && !r.nodeType && r, Te = we && !0 && t && !t.nodeType && t, $t = Te && Te.exports === we, Kt = $t && Se.process, Ae = function() {
519
519
  try {
520
520
  return Kt && Kt.binding && Kt.binding("util");
@@ -523,8 +523,8 @@ Ye.exports;
523
523
  }(), Vt = Ae && Ae.isTypedArray;
524
524
  function Ee(e, i) {
525
525
  for (var s = -1, u = e == null ? 0 : e.length, A = 0, I = []; ++s < u; ) {
526
- var M = e[s];
527
- i(M, s, e) && (I[A++] = M);
526
+ var x = e[s];
527
+ i(x, s, e) && (I[A++] = x);
528
528
  }
529
529
  return I;
530
530
  }
@@ -620,21 +620,21 @@ Ye.exports;
620
620
  this.__data__ = [], this.size = 0;
621
621
  }
622
622
  function Ir(e) {
623
- var i = this.__data__, s = Ut(i, e);
623
+ var i = this.__data__, s = Lt(i, e);
624
624
  if (s < 0)
625
625
  return !1;
626
626
  var u = i.length - 1;
627
627
  return s == u ? i.pop() : vt.call(i, s, 1), --this.size, !0;
628
628
  }
629
629
  function Sr(e) {
630
- var i = this.__data__, s = Ut(i, e);
630
+ var i = this.__data__, s = Lt(i, e);
631
631
  return s < 0 ? void 0 : i[s][1];
632
632
  }
633
633
  function wr(e) {
634
- return Ut(this.__data__, e) > -1;
634
+ return Lt(this.__data__, e) > -1;
635
635
  }
636
636
  function Tr(e, i) {
637
- var s = this.__data__, u = Ut(s, e);
637
+ var s = this.__data__, u = Lt(s, e);
638
638
  return u < 0 ? (++this.size, s.push([e, i])) : s[u][1] = i, this;
639
639
  }
640
640
  $.prototype.clear = vr, $.prototype.delete = Ir, $.prototype.get = Sr, $.prototype.has = wr, $.prototype.set = Tr;
@@ -708,16 +708,16 @@ Ye.exports;
708
708
  }
709
709
  ot.prototype.clear = ie, ot.prototype.delete = Mr, ot.prototype.get = Pr, ot.prototype.has = Dr, ot.prototype.set = Cr;
710
710
  function jr(e, i) {
711
- var s = Lt(e), u = !s && Ue(e), A = !s && !u && Gt(e), I = !s && !u && !A && Be(e), M = s || u || A || I, x = M ? cr(e.length, String) : [], U = x.length;
711
+ var s = Ut(e), u = !s && Le(e), A = !s && !u && Gt(e), I = !s && !u && !A && Be(e), x = s || u || A || I, O = x ? cr(e.length, String) : [], L = O.length;
712
712
  for (var P in e)
713
- Q.call(e, P) && !(M && // Safari 9 has enumerable `arguments.length` in strict mode.
713
+ Q.call(e, P) && !(x && // Safari 9 has enumerable `arguments.length` in strict mode.
714
714
  (P == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
715
715
  A && (P == "offset" || P == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
716
716
  I && (P == "buffer" || P == "byteLength" || P == "byteOffset") || // Skip index properties.
717
- Gr(P, U))) && x.push(P);
718
- return x;
717
+ Gr(P, L))) && O.push(P);
718
+ return O;
719
719
  }
720
- function Ut(e, i) {
720
+ function Lt(e, i) {
721
721
  for (var s = e.length; s--; )
722
722
  if (He(e[s][0], i))
723
723
  return s;
@@ -725,10 +725,10 @@ Ye.exports;
725
725
  }
726
726
  function ae(e, i, s) {
727
727
  var u = i(e);
728
- return Lt(e) ? u : Yt(u, s(e));
728
+ return Ut(e) ? u : Yt(u, s(e));
729
729
  }
730
730
  function wt(e) {
731
- return e == null ? e === void 0 ? z : m : it && it in Object(e) ? dt(e) : Ne(e);
731
+ return e == null ? e === void 0 ? R : b : it && it in Object(e) ? dt(e) : Ne(e);
732
732
  }
733
733
  function Re(e) {
734
734
  return ut(e) && wt(e) == d;
@@ -737,16 +737,16 @@ Ye.exports;
737
737
  return e === i ? !0 : e == null || i == null || !ut(e) && !ut(i) ? e !== e && i !== i : Fr(e, i, s, u, ze, A);
738
738
  }
739
739
  function Fr(e, i, s, u, A, I) {
740
- var M = Lt(e), x = Lt(i), U = M ? E : ct(e), P = x ? E : ct(i);
741
- U = U == d ? g : U, P = P == d ? g : P;
742
- var K = U == g, q = P == g, L = U == P;
743
- if (L && Gt(e)) {
740
+ var x = Ut(e), O = Ut(i), L = x ? E : ct(e), P = O ? E : ct(i);
741
+ L = L == d ? _ : L, P = P == d ? _ : P;
742
+ var K = L == _, q = P == _, U = L == P;
743
+ if (U && Gt(e)) {
744
744
  if (!Gt(i))
745
745
  return !1;
746
- M = !0, K = !1;
746
+ x = !0, K = !1;
747
747
  }
748
- if (L && !K)
749
- return I || (I = new ot()), M || Be(e) ? se(e, i, s, u, A, I) : Hr(e, i, U, s, u, A, I);
748
+ if (U && !K)
749
+ return I || (I = new ot()), x || Be(e) ? se(e, i, s, u, A, I) : Hr(e, i, L, s, u, A, I);
750
750
  if (!(s & o)) {
751
751
  var V = K && Q.call(e, "__wrapped__"), W = q && Q.call(i, "__wrapped__");
752
752
  if (V || W) {
@@ -754,12 +754,12 @@ Ye.exports;
754
754
  return I || (I = new ot()), A(bt, ht, s, u, I);
755
755
  }
756
756
  }
757
- return L ? (I || (I = new ot()), Ur(e, i, s, u, A, I)) : !1;
757
+ return U ? (I || (I = new ot()), Lr(e, i, s, u, A, I)) : !1;
758
758
  }
759
759
  function Rr(e) {
760
760
  if (!Ge(e) || Wr(e))
761
761
  return !1;
762
- var i = Le(e) ? lr : rt;
762
+ var i = Ue(e) ? lr : rt;
763
763
  return i.test(Y(e));
764
764
  }
765
765
  function zr(e) {
@@ -774,27 +774,27 @@ Ye.exports;
774
774
  return i;
775
775
  }
776
776
  function se(e, i, s, u, A, I) {
777
- var M = s & o, x = e.length, U = i.length;
778
- if (x != U && !(M && U > x))
777
+ var x = s & o, O = e.length, L = i.length;
778
+ if (O != L && !(x && L > O))
779
779
  return !1;
780
780
  var P = I.get(e);
781
781
  if (P && I.get(i))
782
782
  return P == i;
783
- var K = -1, q = !0, L = s & c ? new Nt() : void 0;
784
- for (I.set(e, i), I.set(i, e); ++K < x; ) {
783
+ var K = -1, q = !0, U = s & c ? new Nt() : void 0;
784
+ for (I.set(e, i), I.set(i, e); ++K < O; ) {
785
785
  var V = e[K], W = i[K];
786
786
  if (u)
787
- var bt = M ? u(W, V, K, i, e, I) : u(V, W, K, e, i, I);
787
+ var bt = x ? u(W, V, K, i, e, I) : u(V, W, K, e, i, I);
788
788
  if (bt !== void 0) {
789
789
  if (bt)
790
790
  continue;
791
791
  q = !1;
792
792
  break;
793
793
  }
794
- if (L) {
794
+ if (U) {
795
795
  if (!ke(i, function(ht, At) {
796
- if (!Dt(L, At) && (V === ht || A(V, ht, s, u, I)))
797
- return L.push(At);
796
+ if (!Dt(U, At) && (V === ht || A(V, ht, s, u, I)))
797
+ return U.push(At);
798
798
  })) {
799
799
  q = !1;
800
800
  break;
@@ -806,7 +806,7 @@ Ye.exports;
806
806
  }
807
807
  return I.delete(e), I.delete(i), q;
808
808
  }
809
- function Hr(e, i, s, u, A, I, M) {
809
+ function Hr(e, i, s, u, A, I, x) {
810
810
  switch (s) {
811
811
  case H:
812
812
  if (e.byteLength != i.byteLength || e.byteOffset != i.byteOffset)
@@ -814,40 +814,40 @@ Ye.exports;
814
814
  e = e.buffer, i = i.buffer;
815
815
  case T:
816
816
  return !(e.byteLength != i.byteLength || !I(new De(e), new De(i)));
817
- case S:
818
- case R:
819
- case _:
817
+ case w:
818
+ case z:
819
+ case v:
820
820
  return He(+e, +i);
821
821
  case h:
822
822
  return e.name == i.name && e.message == i.message;
823
823
  case F:
824
- case O:
824
+ case M:
825
825
  return e == i + "";
826
826
  case f:
827
- var x = Oe;
827
+ var O = Oe;
828
828
  case k:
829
- var U = u & o;
830
- if (x || (x = st), e.size != i.size && !U)
829
+ var L = u & o;
830
+ if (O || (O = st), e.size != i.size && !L)
831
831
  return !1;
832
- var P = M.get(e);
832
+ var P = x.get(e);
833
833
  if (P)
834
834
  return P == i;
835
- u |= c, M.set(e, i);
836
- var K = se(x(e), x(i), u, A, I, M);
837
- return M.delete(e), K;
835
+ u |= c, x.set(e, i);
836
+ var K = se(O(e), O(i), u, A, I, x);
837
+ return x.delete(e), K;
838
838
  case N:
839
839
  if (ne)
840
840
  return ne.call(e) == ne.call(i);
841
841
  }
842
842
  return !1;
843
843
  }
844
- function Ur(e, i, s, u, A, I) {
845
- var M = s & o, x = Tt(e), U = x.length, P = Tt(i), K = P.length;
846
- if (U != K && !M)
844
+ function Lr(e, i, s, u, A, I) {
845
+ var x = s & o, O = Tt(e), L = O.length, P = Tt(i), K = P.length;
846
+ if (L != K && !x)
847
847
  return !1;
848
- for (var q = U; q--; ) {
849
- var L = x[q];
850
- if (!(M ? L in i : Q.call(i, L)))
848
+ for (var q = L; q--; ) {
849
+ var U = O[q];
850
+ if (!(x ? U in i : Q.call(i, U)))
851
851
  return !1;
852
852
  }
853
853
  var V = I.get(e);
@@ -855,16 +855,16 @@ Ye.exports;
855
855
  return V == i;
856
856
  var W = !0;
857
857
  I.set(e, i), I.set(i, e);
858
- for (var bt = M; ++q < U; ) {
859
- L = x[q];
860
- var ht = e[L], At = i[L];
858
+ for (var bt = x; ++q < L; ) {
859
+ U = O[q];
860
+ var ht = e[U], At = i[U];
861
861
  if (u)
862
- var Tn = M ? u(At, ht, L, i, e, I) : u(ht, At, L, e, i, I);
862
+ var Tn = x ? u(At, ht, U, i, e, I) : u(ht, At, U, e, i, I);
863
863
  if (!(Tn === void 0 ? ht === At || A(ht, At, s, u, I) : Tn)) {
864
864
  W = !1;
865
865
  break;
866
866
  }
867
- bt || (bt = L == "constructor");
867
+ bt || (bt = U == "constructor");
868
868
  }
869
869
  if (W && !bt) {
870
870
  var We = e.constructor, $e = i.constructor;
@@ -873,7 +873,7 @@ Ye.exports;
873
873
  return I.delete(e), I.delete(i), W;
874
874
  }
875
875
  function Tt(e) {
876
- return ae(e, ue, Lr);
876
+ return ae(e, ue, Ur);
877
877
  }
878
878
  function at(e, i) {
879
879
  var s = e.__data__;
@@ -893,13 +893,13 @@ Ye.exports;
893
893
  var A = Pe.call(e);
894
894
  return u && (i ? e[it] = s : delete e[it]), A;
895
895
  }
896
- var Lr = zt ? function(e) {
896
+ var Ur = zt ? function(e) {
897
897
  return e == null ? [] : (e = Object(e), Ee(zt(e), function(i) {
898
898
  return Rt.call(e, i);
899
899
  }));
900
900
  } : Vr, ct = wt;
901
- (Qt && ct(new Qt(new ArrayBuffer(1))) != H || St && ct(new St()) != f || te && ct(te.resolve()) != b || ee && ct(new ee()) != k || re && ct(new re()) != w) && (ct = function(e) {
902
- var i = wt(e), s = i == g ? e.constructor : void 0, u = s ? Y(s) : "";
901
+ (Qt && ct(new Qt(new ArrayBuffer(1))) != H || St && ct(new St()) != f || te && ct(te.resolve()) != m || ee && ct(new ee()) != k || re && ct(new re()) != S) && (ct = function(e) {
902
+ var i = wt(e), s = i == _ ? e.constructor : void 0, u = s ? Y(s) : "";
903
903
  if (u)
904
904
  switch (u) {
905
905
  case Ce:
@@ -907,11 +907,11 @@ Ye.exports;
907
907
  case lt:
908
908
  return f;
909
909
  case pr:
910
- return b;
910
+ return m;
911
911
  case dr:
912
912
  return k;
913
913
  case hr:
914
- return w;
914
+ return S;
915
915
  }
916
916
  return i;
917
917
  });
@@ -948,23 +948,23 @@ Ye.exports;
948
948
  function He(e, i) {
949
949
  return e === i || e !== e && i !== i;
950
950
  }
951
- var Ue = Re(/* @__PURE__ */ function() {
951
+ var Le = Re(/* @__PURE__ */ function() {
952
952
  return arguments;
953
953
  }()) ? Re : function(e) {
954
954
  return ut(e) && Q.call(e, "callee") && !Rt.call(e, "callee");
955
- }, Lt = Array.isArray;
955
+ }, Ut = Array.isArray;
956
956
  function oe(e) {
957
- return e != null && ce(e.length) && !Le(e);
957
+ return e != null && ce(e.length) && !Ue(e);
958
958
  }
959
959
  var Gt = Zt || Yr;
960
960
  function Kr(e, i) {
961
961
  return ze(e, i);
962
962
  }
963
- function Le(e) {
963
+ function Ue(e) {
964
964
  if (!Ge(e))
965
965
  return !1;
966
966
  var i = wt(e);
967
- return i == p || i == v || i == D || i == y;
967
+ return i == p || i == g || i == D || i == y;
968
968
  }
969
969
  function ce(e) {
970
970
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= l;
@@ -993,8 +993,8 @@ const ft = /* @__PURE__ */ mn(zi);
993
993
  var Xe = { exports: {} };
994
994
  Xe.exports;
995
995
  (function(t, r) {
996
- var n = 200, a = "__lodash_hash_undefined__", o = 9007199254740991, c = "[object Arguments]", l = "[object Array]", d = "[object Boolean]", E = "[object Date]", D = "[object Error]", S = "[object Function]", R = "[object GeneratorFunction]", h = "[object Map]", p = "[object Number]", v = "[object Object]", f = "[object Promise]", _ = "[object RegExp]", m = "[object Set]", g = "[object String]", b = "[object Symbol]", y = "[object WeakMap]", F = "[object ArrayBuffer]", k = "[object DataView]", O = "[object Float32Array]", N = "[object Float64Array]", z = "[object Int8Array]", w = "[object Int16Array]", T = "[object Int32Array]", H = "[object Uint8Array]", _e = "[object Uint8ClampedArray]", ge = "[object Uint16Array]", ve = "[object Uint32Array]", er = /[\\^$.*+?()[\]{}|]/g, rr = /\w*$/, nr = /^\[object .+?Constructor\]$/, ir = /^(?:0|[1-9]\d*)$/, C = {};
997
- C[c] = C[l] = C[F] = C[k] = C[d] = C[E] = C[O] = C[N] = C[z] = C[w] = C[T] = C[h] = C[p] = C[v] = C[_] = C[m] = C[g] = C[b] = C[H] = C[_e] = C[ge] = C[ve] = !0, C[D] = C[S] = C[y] = !1;
996
+ var n = 200, a = "__lodash_hash_undefined__", o = 9007199254740991, c = "[object Arguments]", l = "[object Array]", d = "[object Boolean]", E = "[object Date]", D = "[object Error]", w = "[object Function]", z = "[object GeneratorFunction]", h = "[object Map]", p = "[object Number]", g = "[object Object]", f = "[object Promise]", v = "[object RegExp]", b = "[object Set]", _ = "[object String]", m = "[object Symbol]", y = "[object WeakMap]", F = "[object ArrayBuffer]", k = "[object DataView]", M = "[object Float32Array]", N = "[object Float64Array]", R = "[object Int8Array]", S = "[object Int16Array]", T = "[object Int32Array]", H = "[object Uint8Array]", _e = "[object Uint8ClampedArray]", ge = "[object Uint16Array]", ve = "[object Uint32Array]", er = /[\\^$.*+?()[\]{}|]/g, rr = /\w*$/, nr = /^\[object .+?Constructor\]$/, ir = /^(?:0|[1-9]\d*)$/, C = {};
997
+ C[c] = C[l] = C[F] = C[k] = C[d] = C[E] = C[M] = C[N] = C[R] = C[S] = C[T] = C[h] = C[p] = C[g] = C[v] = C[b] = C[_] = C[m] = C[H] = C[_e] = C[ge] = C[ve] = !0, C[D] = C[w] = C[y] = !1;
998
998
  var ar = typeof et == "object" && et && et.Object === Object && et, sr = typeof self == "object" && self && self.Object === Object && self, rt = ar || sr || Function("return this")(), Ie = r && !r.nodeType && r, j = Ie && !0 && t && !t.nodeType && t, Se = j && j.exports === Ie;
999
999
  function or(e, i) {
1000
1000
  return e.set(i[0], i[1]), e;
@@ -1170,58 +1170,58 @@ Xe.exports;
1170
1170
  }
1171
1171
  X.prototype.clear = Ar, X.prototype.delete = Er, X.prototype.get = kr, X.prototype.has = Or, X.prototype.set = xr;
1172
1172
  function Nt(e, i) {
1173
- var s = oe(e) || Lt(e) ? Kt(e.length, String) : [], u = s.length, A = !!u;
1173
+ var s = oe(e) || Ut(e) ? Kt(e.length, String) : [], u = s.length, A = !!u;
1174
1174
  for (var I in e)
1175
1175
  st.call(e, I) && !(A && (I == "length" || Br(I, u))) && s.push(I);
1176
1176
  return s;
1177
1177
  }
1178
1178
  function Fe(e, i, s) {
1179
1179
  var u = e[i];
1180
- (!(st.call(e, i) && Ue(u, s)) || s === void 0 && !(i in e)) && (e[i] = s);
1180
+ (!(st.call(e, i) && Le(u, s)) || s === void 0 && !(i in e)) && (e[i] = s);
1181
1181
  }
1182
1182
  function Ht(e, i) {
1183
1183
  for (var s = e.length; s--; )
1184
- if (Ue(e[s][0], i))
1184
+ if (Le(e[s][0], i))
1185
1185
  return s;
1186
1186
  return -1;
1187
1187
  }
1188
1188
  function ot(e, i) {
1189
1189
  return e && se(i, ue(i), e);
1190
1190
  }
1191
- function ie(e, i, s, u, A, I, M) {
1192
- var x;
1193
- if (u && (x = I ? u(e, A, I, M) : u(e)), x !== void 0)
1194
- return x;
1191
+ function ie(e, i, s, u, A, I, x) {
1192
+ var O;
1193
+ if (u && (O = I ? u(e, A, I, x) : u(e)), O !== void 0)
1194
+ return O;
1195
1195
  if (!ut(e))
1196
1196
  return e;
1197
- var U = oe(e);
1198
- if (U) {
1199
- if (x = Lr(e), !i)
1200
- return Nr(e, x);
1197
+ var L = oe(e);
1198
+ if (L) {
1199
+ if (O = Ur(e), !i)
1200
+ return Nr(e, O);
1201
1201
  } else {
1202
- var P = dt(e), K = P == S || P == R;
1203
- if (Le(e))
1204
- return Ut(e, i);
1205
- if (P == v || P == c || K && !I) {
1202
+ var P = dt(e), K = P == w || P == z;
1203
+ if (Ue(e))
1204
+ return Lt(e, i);
1205
+ if (P == g || P == c || K && !I) {
1206
1206
  if (Vt(e))
1207
1207
  return I ? e : {};
1208
- if (x = ct(K ? {} : e), !i)
1209
- return Hr(e, ot(x, e));
1208
+ if (O = ct(K ? {} : e), !i)
1209
+ return Hr(e, ot(O, e));
1210
1210
  } else {
1211
1211
  if (!C[P])
1212
1212
  return I ? e : {};
1213
- x = Gr(e, P, ie, i);
1213
+ O = Gr(e, P, ie, i);
1214
1214
  }
1215
1215
  }
1216
- M || (M = new X());
1217
- var q = M.get(e);
1216
+ x || (x = new X());
1217
+ var q = x.get(e);
1218
1218
  if (q)
1219
1219
  return q;
1220
- if (M.set(e, x), !U)
1221
- var L = s ? Ur(e) : ue(e);
1222
- return we(L || e, function(V, W) {
1223
- L && (W = V, V = e[W]), Fe(x, W, ie(V, i, s, u, W, e, M));
1224
- }), x;
1220
+ if (x.set(e, O), !L)
1221
+ var U = s ? Lr(e) : ue(e);
1222
+ return we(U || e, function(V, W) {
1223
+ U && (W = V, V = e[W]), Fe(O, W, ie(V, i, s, u, W, e, x));
1224
+ }), O;
1225
1225
  }
1226
1226
  function Mr(e) {
1227
1227
  return ut(e) ? Me(e) : {};
@@ -1247,7 +1247,7 @@ Xe.exports;
1247
1247
  st.call(e, s) && s != "constructor" && i.push(s);
1248
1248
  return i;
1249
1249
  }
1250
- function Ut(e, i) {
1250
+ function Lt(e, i) {
1251
1251
  if (i)
1252
1252
  return e.slice();
1253
1253
  var s = new e.constructor(e.length);
@@ -1289,15 +1289,15 @@ Xe.exports;
1289
1289
  function se(e, i, s, u) {
1290
1290
  s || (s = {});
1291
1291
  for (var A = -1, I = i.length; ++A < I; ) {
1292
- var M = i[A], x = void 0;
1293
- Fe(s, M, x === void 0 ? e[M] : x);
1292
+ var x = i[A], O = void 0;
1293
+ Fe(s, x, O === void 0 ? e[x] : O);
1294
1294
  }
1295
1295
  return s;
1296
1296
  }
1297
1297
  function Hr(e, i) {
1298
1298
  return se(e, pt(e), i);
1299
1299
  }
1300
- function Ur(e) {
1300
+ function Lr(e) {
1301
1301
  return Pr(e, ue, pt);
1302
1302
  }
1303
1303
  function Tt(e, i) {
@@ -1309,8 +1309,8 @@ Xe.exports;
1309
1309
  return Cr(s) ? s : void 0;
1310
1310
  }
1311
1311
  var pt = Jt ? Yt(Jt, Object) : Vr, dt = Dr;
1312
- (Rt && dt(new Rt(new ArrayBuffer(1))) != k || vt && dt(new vt()) != h || it && dt(it.resolve()) != f || zt && dt(new zt()) != m || Zt && dt(new Zt()) != y) && (dt = function(e) {
1313
- var i = Ct.call(e), s = i == v ? e.constructor : void 0, u = s ? Y(s) : void 0;
1312
+ (Rt && dt(new Rt(new ArrayBuffer(1))) != k || vt && dt(new vt()) != h || it && dt(it.resolve()) != f || zt && dt(new zt()) != b || Zt && dt(new Zt()) != y) && (dt = function(e) {
1313
+ var i = Ct.call(e), s = i == g ? e.constructor : void 0, u = s ? Y(s) : void 0;
1314
1314
  if (u)
1315
1315
  switch (u) {
1316
1316
  case Qt:
@@ -1320,13 +1320,13 @@ Xe.exports;
1320
1320
  case te:
1321
1321
  return f;
1322
1322
  case ee:
1323
- return m;
1323
+ return b;
1324
1324
  case re:
1325
1325
  return y;
1326
1326
  }
1327
1327
  return i;
1328
1328
  });
1329
- function Lr(e) {
1329
+ function Ur(e) {
1330
1330
  var i = e.length, s = e.constructor(i);
1331
1331
  return i && typeof e[0] == "string" && st.call(e, "index") && (s.index = e.index, s.input = e.input), s;
1332
1332
  }
@@ -1343,10 +1343,10 @@ Xe.exports;
1343
1343
  return new A(+e);
1344
1344
  case k:
1345
1345
  return wt(e, u);
1346
- case O:
1346
+ case M:
1347
1347
  case N:
1348
- case z:
1349
- case w:
1348
+ case R:
1349
+ case S:
1350
1350
  case T:
1351
1351
  case H:
1352
1352
  case _e:
@@ -1356,13 +1356,13 @@ Xe.exports;
1356
1356
  case h:
1357
1357
  return Re(e, u, s);
1358
1358
  case p:
1359
- case g:
1360
- return new A(e);
1361
1359
  case _:
1360
+ return new A(e);
1361
+ case v:
1362
1362
  return ze(e);
1363
- case m:
1364
- return Fr(e, u, s);
1365
1363
  case b:
1364
+ return Fr(e, u, s);
1365
+ case m:
1366
1366
  return Rr(e);
1367
1367
  }
1368
1368
  }
@@ -1396,10 +1396,10 @@ Xe.exports;
1396
1396
  function He(e) {
1397
1397
  return ie(e, !0, !0);
1398
1398
  }
1399
- function Ue(e, i) {
1399
+ function Le(e, i) {
1400
1400
  return e === i || e !== e && i !== i;
1401
1401
  }
1402
- function Lt(e) {
1402
+ function Ut(e) {
1403
1403
  return Kr(e) && st.call(e, "callee") && (!Pe.call(e, "callee") || Ct.call(e) == c);
1404
1404
  }
1405
1405
  var oe = Array.isArray;
@@ -1409,10 +1409,10 @@ Xe.exports;
1409
1409
  function Kr(e) {
1410
1410
  return Be(e) && Gt(e);
1411
1411
  }
1412
- var Le = Ft || Yr;
1412
+ var Ue = Ft || Yr;
1413
1413
  function ce(e) {
1414
1414
  var i = ut(e) ? Ct.call(e) : "";
1415
- return i == S || i == R;
1415
+ return i == w || i == z;
1416
1416
  }
1417
1417
  function Ge(e) {
1418
1418
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= o;
@@ -1453,7 +1453,7 @@ const tt = /* @__PURE__ */ mn(Ni), cn = (t) => {
1453
1453
  }, a.onerror = (o) => {
1454
1454
  n(o);
1455
1455
  }, a.crossOrigin = "anonymous", a.src = t;
1456
- }), Ui = (t) => new Promise((r, n) => {
1456
+ }), Li = (t) => new Promise((r, n) => {
1457
1457
  const a = new Audio();
1458
1458
  a.preload = "auto", a.addEventListener("loadedmetadata", () => {
1459
1459
  const o = a.duration * 1e3;
@@ -1461,7 +1461,7 @@ const tt = /* @__PURE__ */ mn(Ni), cn = (t) => {
1461
1461
  }), a.addEventListener("error", (o) => {
1462
1462
  n(o);
1463
1463
  }), a.src = t, a.crossOrigin = "anonymous", a.load();
1464
- }), Li = (t) => new Promise((r, n) => {
1464
+ }), Ui = (t) => new Promise((r, n) => {
1465
1465
  const a = document.createElement("video");
1466
1466
  a.preload = "auto", a.addEventListener("loadedmetadata", () => {
1467
1467
  const o = a.duration * 1e3, c = a.videoWidth, l = a.videoHeight;
@@ -1482,7 +1482,8 @@ const tt = /* @__PURE__ */ mn(Ni), cn = (t) => {
1482
1482
  y: 0,
1483
1483
  blur: 0
1484
1484
  }, Qe = (t, r) => {
1485
- const n = (r == null ? void 0 : r.duration) || 5e3, a = {
1485
+ let n = r != null && r.trim ? r.trim.to - r.trim.from : (r == null ? void 0 : r.duration) || 5e3;
1486
+ const a = {
1486
1487
  from: 0,
1487
1488
  to: n
1488
1489
  };
@@ -1530,9 +1531,9 @@ function _n(t, r) {
1530
1531
  };
1531
1532
  }
1532
1533
  const Bi = async (t, r) => {
1533
- const n = t.details.src, a = await Li(n), o = _n(r, {
1534
+ const n = t.details.src, a = await Ui(n), o = _n(r, {
1534
1535
  ...a
1535
- }), c = {
1536
+ }), c = qn(t.trim, { duration: a.duration }), l = {
1536
1537
  width: a.width,
1537
1538
  height: a.height,
1538
1539
  duration: a.duration,
@@ -1556,20 +1557,20 @@ const Bi = async (t, r) => {
1556
1557
  };
1557
1558
  return {
1558
1559
  ...t,
1559
- trim: qn(t.trim, { duration: a.duration }),
1560
+ trim: c,
1560
1561
  type: "video",
1561
1562
  name: "video",
1562
- details: c,
1563
- display: Qe(t.display, { duration: a.duration })
1563
+ details: l,
1564
+ display: Qe(t.display, { duration: a.duration, trim: c })
1564
1565
  };
1565
1566
  }, Wi = async (t) => {
1566
- const r = t.id, n = t.details, o = (await Ui(n.src)).duration;
1567
+ const r = t.id, n = t.details, o = (await Li(n.src)).duration, c = qn(t.trim, { duration: o });
1567
1568
  return {
1568
1569
  id: r,
1569
1570
  name: "",
1570
1571
  type: "audio",
1571
- display: Qe(t.display, { duration: o }),
1572
- trim: qn(t.trim, { duration: o }),
1572
+ display: Qe(t.display, { duration: o, trim: c }),
1573
+ trim: c,
1573
1574
  details: {
1574
1575
  src: n.src,
1575
1576
  duration: o,
@@ -1733,10 +1734,10 @@ function qi(t) {
1733
1734
  ), l = Bt.pipe(
1734
1735
  Wt(({ key: p }) => p.startsWith(pi))
1735
1736
  ), d = r.subscribe(async (p) => {
1736
- var v;
1737
+ var g;
1737
1738
  if (p.key === di) {
1738
- const f = (v = p.value) == null ? void 0 : v.payload, _ = f.trackItemIds, m = f.trackItemDetailsMap, g = _.map(async (b) => {
1739
- const y = m[b];
1739
+ const f = (g = p.value) == null ? void 0 : g.payload, v = f.trackItemIds, b = f.trackItemDetailsMap, _ = v.map(async (m) => {
1740
+ const y = b[m];
1740
1741
  return (y.type === "caption" || y.type === "text") && await cn([
1741
1742
  {
1742
1743
  fontFamily: y.details.fontFamily,
@@ -1744,7 +1745,7 @@ function qi(t) {
1744
1745
  }
1745
1746
  ]), !0;
1746
1747
  });
1747
- await Promise.all(g), t.updateState({
1748
+ await Promise.all(_), t.updateState({
1748
1749
  ...f
1749
1750
  });
1750
1751
  }
@@ -1752,123 +1753,122 @@ function qi(t) {
1752
1753
  if (p.key === hi) return t.undo();
1753
1754
  if (p.key === yi) return t.redo();
1754
1755
  }), D = a.subscribe((p) => {
1755
- var f, _;
1756
- const v = [];
1757
- (f = p.value) != null && f.payload.trackItemIds && v.push((_ = p.value) == null ? void 0 : _.payload.trackItemIds), t.updateState({ activeIds: v });
1758
- }), S = n.subscribe(async (p) => {
1759
- var b, y, F, k, O, N;
1760
- const v = [], f = tt(t.getState()), _ = ((b = p.value) == null ? void 0 : b.payload.id) ?? Jr();
1761
- if (v.push(_), p.key === mi) {
1762
- const w = ((y = p.value) == null ? void 0 : y.payload).map(async (H) => await Dn(H, f, "caption")), T = await Promise.all(w);
1763
- v.splice(0, v.length), T.forEach((H) => {
1764
- v.push(H), f.trackItemIds.push(H);
1756
+ var f, v, b;
1757
+ const g = [];
1758
+ if ((f = p.value) != null && f.payload.trackItemIds && (g.push((v = p.value) == null ? void 0 : v.payload.trackItemIds), t.updateState({ activeIds: g })), p.key === mi) {
1759
+ const _ = (b = p.value) == null ? void 0 : b.payload.trackItemIds, m = tt(t.getState()), y = _ && _.length ? _ : m.activeIds, F = m.trackItemIds, k = m.trackItemDetailsMap, M = F.filter(
1760
+ (T) => !y.includes(T)
1761
+ ), N = Object.fromEntries(
1762
+ Object.entries(k).filter(
1763
+ ([T]) => !y.includes(T)
1764
+ )
1765
+ ), R = Xi(
1766
+ m.tracks,
1767
+ y
1768
+ ), S = Pn(m.trackItemsMap);
1769
+ t.updateState(
1770
+ {
1771
+ trackItemIds: M,
1772
+ trackItemDetailsMap: N,
1773
+ activeIds: [],
1774
+ tracks: R,
1775
+ duration: S
1776
+ },
1777
+ { updateHistory: !0, kind: "remove" }
1778
+ );
1779
+ }
1780
+ }), w = n.subscribe(async (p) => {
1781
+ var m, y, F, k, M, N;
1782
+ const g = [], f = tt(t.getState()), v = ((m = p.value) == null ? void 0 : m.payload.id) ?? Jr();
1783
+ if (g.push(v), p.key === bi) {
1784
+ const S = ((y = p.value) == null ? void 0 : y.payload).map(async (H) => await Dn(H, f, "caption")), T = await Promise.all(S);
1785
+ g.splice(0, g.length), T.forEach((H) => {
1786
+ g.push(H), f.trackItemIds.push(H);
1765
1787
  });
1766
1788
  }
1767
- if (p.key === bi) {
1768
- const z = await Dn(
1789
+ if (p.key === _i) {
1790
+ const R = await Dn(
1769
1791
  (F = p.value) == null ? void 0 : F.payload,
1770
1792
  f,
1771
1793
  "text"
1772
1794
  );
1773
- f.trackItemIds.push(z);
1795
+ f.trackItemIds.push(R);
1774
1796
  }
1775
- let m = "text";
1776
- if (p.key === _i) {
1777
- m = "image";
1778
- const z = await $i((k = p.value) == null ? void 0 : k.payload, {
1797
+ let b = "text";
1798
+ if (p.key === gi) {
1799
+ b = "image";
1800
+ const R = await $i((k = p.value) == null ? void 0 : k.payload, {
1779
1801
  size: {
1780
1802
  width: 1080,
1781
1803
  height: 1920
1782
1804
  }
1783
- }), { details: w, ...T } = z;
1805
+ }), { details: S, ...T } = R;
1784
1806
  f.trackItemDetailsMap[T.id] = {
1785
- type: m,
1786
- details: w
1807
+ type: b,
1808
+ details: S
1787
1809
  }, f.trackItemsMap[T.id] = T, f.trackItemIds.push(T.id);
1788
1810
  }
1789
- if (p.key === gi) {
1790
- m = "audio";
1791
- const z = await Wi((O = p.value) == null ? void 0 : O.payload), { details: w, ...T } = z;
1811
+ if (p.key === vi) {
1812
+ b = "audio";
1813
+ const R = await Wi((M = p.value) == null ? void 0 : M.payload), { details: S, ...T } = R;
1792
1814
  f.trackItemDetailsMap[T.id] = {
1793
- type: m,
1794
- details: w
1815
+ type: b,
1816
+ details: S
1795
1817
  }, f.trackItemsMap[T.id] = T, f.trackItemIds.push(T.id);
1796
1818
  }
1797
- if (p.key === vi) {
1798
- m = "video";
1799
- const z = await Bi((N = p.value) == null ? void 0 : N.payload, {
1819
+ if (p.key === Ii) {
1820
+ b = "video";
1821
+ const R = await Bi((N = p.value) == null ? void 0 : N.payload, {
1800
1822
  size: {
1801
1823
  width: 1080,
1802
1824
  height: 1920
1803
1825
  }
1804
- }), { details: w, ...T } = z;
1826
+ }), { details: S, ...T } = R;
1805
1827
  f.trackItemDetailsMap[T.id] = {
1806
- type: m,
1807
- details: w
1828
+ type: b,
1829
+ details: S
1808
1830
  }, f.trackItemsMap[T.id] = T, f.trackItemIds.push(T.id);
1809
1831
  }
1810
1832
  f.tracks.unshift({
1811
1833
  id: un(),
1812
1834
  accepts: ["text", "audio", "helper", "video", "image", "caption"],
1813
- type: m,
1814
- items: v,
1835
+ type: b,
1836
+ items: g,
1815
1837
  magnetic: !1,
1816
1838
  static: !1
1817
1839
  });
1818
- const g = Pn(f.trackItemsMap);
1840
+ const _ = Pn(f.trackItemsMap);
1819
1841
  t.updateState(
1820
1842
  {
1821
1843
  trackItemIds: f.trackItemIds,
1822
1844
  trackItemDetailsMap: f.trackItemDetailsMap,
1823
1845
  trackItemsMap: f.trackItemsMap,
1824
1846
  tracks: f.tracks,
1825
- duration: g
1847
+ duration: _
1826
1848
  },
1827
1849
  {
1828
1850
  updateHistory: !0,
1829
1851
  kind: "add"
1830
1852
  }
1831
1853
  );
1832
- }), R = c.subscribe(async (p) => {
1833
- var v;
1834
- if (p.key === Ii) {
1835
- const f = tt(t.getState()), _ = f.activeIds, m = f.trackItemIds, g = f.trackItemDetailsMap, b = m.filter(
1836
- (O) => !_.includes(O)
1837
- ), y = Object.fromEntries(
1838
- Object.entries(g).filter(
1839
- ([O]) => !_.includes(O)
1840
- )
1841
- ), F = Xi(
1842
- f.tracks,
1843
- _
1844
- ), k = Pn(f.trackItemsMap);
1845
- t.updateState(
1846
- {
1847
- trackItemIds: b,
1848
- trackItemDetailsMap: y,
1849
- activeIds: [],
1850
- tracks: F,
1851
- duration: k
1852
- },
1853
- { updateHistory: !0, kind: "remove" }
1854
- );
1855
- }
1854
+ }), z = c.subscribe(async (p) => {
1855
+ var g;
1856
1856
  if (p.key === Si) {
1857
- const f = tt(t.getState()), _ = (v = p.value) == null ? void 0 : v.options.time;
1857
+ const f = tt(t.getState()), v = (g = p.value) == null ? void 0 : g.options.time;
1858
1858
  if (f.activeIds.length === 1) {
1859
- const m = f.activeIds[0], g = f.trackItemsMap[m];
1860
- if (_ >= g.display.to || _ <= g.display.from)
1859
+ const b = f.activeIds[0], _ = f.trackItemsMap[b];
1860
+ if (v >= _.display.to || v <= _.display.from)
1861
1861
  return;
1862
- const b = f.trackItemDetailsMap[m], y = Jr(), F = {
1863
- ...g,
1862
+ const m = f.trackItemDetailsMap[b], y = Jr(), F = {
1863
+ ..._,
1864
1864
  id: y,
1865
1865
  display: {
1866
- from: _,
1867
- to: g.display.to
1866
+ from: v,
1867
+ to: _.display.to
1868
1868
  }
1869
1869
  };
1870
- f.trackItemsMap[m].display.to = _, f.trackItemsMap[y] = F, f.trackItemIds.push(y), f.trackItemDetailsMap[y] = b, f.tracks.forEach((k) => {
1871
- k.items.includes(m) && k.items.push(y);
1870
+ f.trackItemsMap[b].display.to = v, f.trackItemsMap[y] = F, f.trackItemIds.push(y), f.trackItemDetailsMap[y] = m, f.tracks.forEach((k) => {
1871
+ k.items.includes(b) && k.items.push(y);
1872
1872
  }), t.updateState(
1873
1873
  {
1874
1874
  trackItemDetailsMap: f.trackItemDetailsMap,
@@ -1887,51 +1887,51 @@ function qi(t) {
1887
1887
  if (p.key === wi) {
1888
1888
  const f = tt(t.getState());
1889
1889
  if (f.activeIds.length) {
1890
- const _ = f.activeIds, m = [], g = {
1891
- activeIds: _,
1890
+ const v = f.activeIds, b = [], _ = {
1891
+ activeIds: v,
1892
1892
  trackItemDetailsMap: {},
1893
1893
  trackItemsMap: {},
1894
1894
  tracks: []
1895
1895
  };
1896
- _.forEach((y) => {
1897
- g.trackItemDetailsMap[y] = f.trackItemDetailsMap[y], g.trackItemsMap[y] = f.trackItemsMap[y], m.push(
1896
+ v.forEach((y) => {
1897
+ _.trackItemDetailsMap[y] = f.trackItemDetailsMap[y], _.trackItemsMap[y] = f.trackItemsMap[y], b.push(
1898
1898
  f.tracks.find((F) => F.items.includes(y))
1899
1899
  );
1900
1900
  });
1901
- const b = /* @__PURE__ */ new Set();
1902
- m.filter((y) => b.has(y.id) ? !1 : (b.add(y), !0)), g.tracks = Array.from(b.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(g));
1901
+ const m = /* @__PURE__ */ new Set();
1902
+ b.filter((y) => m.has(y.id) ? !1 : (m.add(y), !0)), _.tracks = Array.from(m.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(_));
1903
1903
  }
1904
1904
  }
1905
1905
  if (p.key === Ti) {
1906
1906
  const f = localStorage.getItem("DesignComboTemp");
1907
1907
  if (!f) return;
1908
- const _ = tt(t.getState()), m = JSON.parse(f), g = {}, b = m.trackItemsMap, y = m.trackItemDetailsMap, F = m.tracks, k = [], O = m.activeIds.map(async (N) => {
1909
- const z = y[N];
1910
- (z.type === "caption" || z.type === "text") && await cn([
1908
+ const v = tt(t.getState()), b = JSON.parse(f), _ = {}, m = b.trackItemsMap, y = b.trackItemDetailsMap, F = b.tracks, k = [], M = b.activeIds.map(async (N) => {
1909
+ const R = y[N];
1910
+ (R.type === "caption" || R.type === "text") && await cn([
1911
1911
  {
1912
- fontFamily: z.details.fontFamily,
1913
- url: z.details.fontUrl
1912
+ fontFamily: R.details.fontFamily,
1913
+ url: R.details.fontUrl
1914
1914
  }
1915
1915
  ]);
1916
- const w = Jr();
1917
- return g[N] = w, _.trackItemsMap[w] = {
1918
- ...b[N],
1919
- id: w
1920
- }, _.trackItemDetailsMap[w] = z, _.trackItemIds.push(w), !0;
1916
+ const S = Jr();
1917
+ return _[N] = S, v.trackItemsMap[S] = {
1918
+ ...m[N],
1919
+ id: S
1920
+ }, v.trackItemDetailsMap[S] = R, v.trackItemIds.push(S), !0;
1921
1921
  });
1922
- await Promise.all(O), F.forEach((N) => {
1923
- const z = N.items.map((T) => g[T]), w = {
1922
+ await Promise.all(M), F.forEach((N) => {
1923
+ const R = N.items.map((T) => _[T]), S = {
1924
1924
  ...N,
1925
- items: z,
1925
+ items: R,
1926
1926
  id: un()
1927
1927
  };
1928
- k.push(w);
1929
- }), _.tracks = [..._.tracks, ...k], t.updateState(
1928
+ k.push(S);
1929
+ }), v.tracks = [...v.tracks, ...k], t.updateState(
1930
1930
  {
1931
- trackItemDetailsMap: _.trackItemDetailsMap,
1932
- tracks: _.tracks,
1933
- trackItemIds: _.trackItemIds,
1934
- trackItemsMap: _.trackItemsMap
1931
+ trackItemDetailsMap: v.trackItemDetailsMap,
1932
+ tracks: v.tracks,
1933
+ trackItemIds: v.trackItemIds,
1934
+ trackItemsMap: v.trackItemsMap
1935
1935
  },
1936
1936
  {
1937
1937
  updateHistory: !0,
@@ -1940,19 +1940,19 @@ function qi(t) {
1940
1940
  );
1941
1941
  }
1942
1942
  }), h = l.subscribe((p) => {
1943
- var v, f;
1943
+ var g, f;
1944
1944
  if (p.key === Ai) {
1945
- const _ = t.getState(), m = tt(_.trackItemDetailsMap), g = Object.keys((v = p.value) == null ? void 0 : v.payload);
1946
- if (!g.length) return;
1947
- const b = (f = p.value) == null ? void 0 : f.payload;
1948
- g.forEach((y) => {
1949
- m[y].details = {
1950
- ...m[y].details,
1951
- ...b[y].details
1945
+ const v = t.getState(), b = tt(v.trackItemDetailsMap), _ = Object.keys((g = p.value) == null ? void 0 : g.payload);
1946
+ if (!_.length) return;
1947
+ const m = (f = p.value) == null ? void 0 : f.payload;
1948
+ _.forEach((y) => {
1949
+ b[y].details = {
1950
+ ...b[y].details,
1951
+ ...m[y].details
1952
1952
  };
1953
1953
  }), t.updateState(
1954
1954
  {
1955
- trackItemDetailsMap: { ...m }
1955
+ trackItemDetailsMap: { ...b }
1956
1956
  },
1957
1957
  {
1958
1958
  updateHistory: !0,
@@ -1963,7 +1963,7 @@ function qi(t) {
1963
1963
  });
1964
1964
  return {
1965
1965
  unsubscribe: () => {
1966
- S.unsubscribe(), R.unsubscribe(), h.unsubscribe(), E.unsubscribe(), D.unsubscribe(), d.unsubscribe();
1966
+ w.unsubscribe(), z.unsubscribe(), h.unsubscribe(), E.unsubscribe(), D.unsubscribe(), d.unsubscribe();
1967
1967
  }
1968
1968
  };
1969
1969
  }
@@ -1973,25 +1973,25 @@ function Jn(t, r, n = { cyclesFix: !0 }, a = []) {
1973
1973
  let o = [];
1974
1974
  const c = Array.isArray(t);
1975
1975
  for (const D in t) {
1976
- const S = t[D], R = c ? +D : D;
1976
+ const w = t[D], z = c ? +D : D;
1977
1977
  if (!(D in r)) {
1978
1978
  o.push({
1979
1979
  type: "REMOVE",
1980
- path: [R],
1980
+ path: [z],
1981
1981
  oldValue: t[D]
1982
1982
  });
1983
1983
  continue;
1984
1984
  }
1985
- const h = r[D], p = typeof S == "object" && typeof h == "object" && Array.isArray(S) === Array.isArray(h);
1986
- if (S && h && p && !Ji[(E = (d = Object.getPrototypeOf(S)) == null ? void 0 : d.constructor) == null ? void 0 : E.name] && (!n.cyclesFix || !a.includes(S))) {
1987
- const v = Jn(S, h, n, n.cyclesFix ? a.concat([S]) : []);
1988
- o.push.apply(o, v.map((f) => (f.path.unshift(R), f)));
1989
- } else S !== h && // treat NaN values as equivalent
1990
- !(Number.isNaN(S) && Number.isNaN(h)) && !(p && (isNaN(S) ? S + "" == h + "" : +S == +h)) && o.push({
1991
- path: [R],
1985
+ const h = r[D], p = typeof w == "object" && typeof h == "object" && Array.isArray(w) === Array.isArray(h);
1986
+ if (w && h && p && !Ji[(E = (d = Object.getPrototypeOf(w)) == null ? void 0 : d.constructor) == null ? void 0 : E.name] && (!n.cyclesFix || !a.includes(w))) {
1987
+ const g = Jn(w, h, n, n.cyclesFix ? a.concat([w]) : []);
1988
+ o.push.apply(o, g.map((f) => (f.path.unshift(z), f)));
1989
+ } else w !== h && // treat NaN values as equivalent
1990
+ !(Number.isNaN(w) && Number.isNaN(h)) && !(p && (isNaN(w) ? w + "" == h + "" : +w == +h)) && o.push({
1991
+ path: [z],
1992
1992
  type: "CHANGE",
1993
1993
  value: h,
1994
- oldValue: S
1994
+ oldValue: w
1995
1995
  });
1996
1996
  }
1997
1997
  const l = Array.isArray(r);
@@ -2365,7 +2365,7 @@ var sa = class {
2365
2365
  n = r;
2366
2366
  const l = this;
2367
2367
  return function(E = c, ...D) {
2368
- return l.produce(E, (S) => n.call(this, S, ...D));
2368
+ return l.produce(E, (w) => n.call(this, w, ...D));
2369
2369
  };
2370
2370
  }
2371
2371
  typeof n != "function" && G(6), a !== void 0 && typeof a != "function" && G(7);
@@ -2474,109 +2474,109 @@ function zn() {
2474
2474
  "Patching reserved attributes like __proto__, prototype and constructor is not allowed"
2475
2475
  );
2476
2476
  const r = "replace", n = "add", a = "remove";
2477
- function o(h, p, v, f) {
2477
+ function o(h, p, g, f) {
2478
2478
  switch (h.type_) {
2479
2479
  case 0:
2480
2480
  case 2:
2481
2481
  return l(
2482
2482
  h,
2483
2483
  p,
2484
- v,
2484
+ g,
2485
2485
  f
2486
2486
  );
2487
2487
  case 1:
2488
- return c(h, p, v, f);
2488
+ return c(h, p, g, f);
2489
2489
  case 3:
2490
2490
  return d(
2491
2491
  h,
2492
2492
  p,
2493
- v,
2493
+ g,
2494
2494
  f
2495
2495
  );
2496
2496
  }
2497
2497
  }
2498
- function c(h, p, v, f) {
2499
- let { base_: _, assigned_: m } = h, g = h.copy_;
2500
- g.length < _.length && ([_, g] = [g, _], [v, f] = [f, v]);
2501
- for (let b = 0; b < _.length; b++)
2502
- if (m[b] && g[b] !== _[b]) {
2503
- const y = p.concat([b]);
2504
- v.push({
2498
+ function c(h, p, g, f) {
2499
+ let { base_: v, assigned_: b } = h, _ = h.copy_;
2500
+ _.length < v.length && ([v, _] = [_, v], [g, f] = [f, g]);
2501
+ for (let m = 0; m < v.length; m++)
2502
+ if (b[m] && _[m] !== v[m]) {
2503
+ const y = p.concat([m]);
2504
+ g.push({
2505
2505
  op: r,
2506
2506
  path: y,
2507
2507
  // Need to maybe clone it, as it can in fact be the original value
2508
2508
  // due to the base/copy inversion at the start of this function
2509
- value: R(g[b])
2509
+ value: z(_[m])
2510
2510
  }), f.push({
2511
2511
  op: r,
2512
2512
  path: y,
2513
- value: R(_[b])
2513
+ value: z(v[m])
2514
2514
  });
2515
2515
  }
2516
- for (let b = _.length; b < g.length; b++) {
2517
- const y = p.concat([b]);
2518
- v.push({
2516
+ for (let m = v.length; m < _.length; m++) {
2517
+ const y = p.concat([m]);
2518
+ g.push({
2519
2519
  op: n,
2520
2520
  path: y,
2521
2521
  // Need to maybe clone it, as it can in fact be the original value
2522
2522
  // due to the base/copy inversion at the start of this function
2523
- value: R(g[b])
2523
+ value: z(_[m])
2524
2524
  });
2525
2525
  }
2526
- for (let b = g.length - 1; _.length <= b; --b) {
2527
- const y = p.concat([b]);
2526
+ for (let m = _.length - 1; v.length <= m; --m) {
2527
+ const y = p.concat([m]);
2528
2528
  f.push({
2529
2529
  op: a,
2530
2530
  path: y
2531
2531
  });
2532
2532
  }
2533
2533
  }
2534
- function l(h, p, v, f) {
2535
- const { base_: _, copy_: m } = h;
2536
- le(h.assigned_, (g, b) => {
2537
- const y = Zr(_, g), F = Zr(m, g), k = b ? pe(_, g) ? r : n : a;
2534
+ function l(h, p, g, f) {
2535
+ const { base_: v, copy_: b } = h;
2536
+ le(h.assigned_, (_, m) => {
2537
+ const y = Zr(v, _), F = Zr(b, _), k = m ? pe(v, _) ? r : n : a;
2538
2538
  if (y === F && k === r)
2539
2539
  return;
2540
- const O = p.concat(g);
2541
- v.push(k === a ? { op: k, path: O } : { op: k, path: O, value: F }), f.push(
2542
- k === n ? { op: a, path: O } : k === a ? { op: n, path: O, value: R(y) } : { op: r, path: O, value: R(y) }
2540
+ const M = p.concat(_);
2541
+ g.push(k === a ? { op: k, path: M } : { op: k, path: M, value: F }), f.push(
2542
+ k === n ? { op: a, path: M } : k === a ? { op: n, path: M, value: z(y) } : { op: r, path: M, value: z(y) }
2543
2543
  );
2544
2544
  });
2545
2545
  }
2546
- function d(h, p, v, f) {
2547
- let { base_: _, copy_: m } = h, g = 0;
2548
- _.forEach((b) => {
2549
- if (!m.has(b)) {
2550
- const y = p.concat([g]);
2551
- v.push({
2546
+ function d(h, p, g, f) {
2547
+ let { base_: v, copy_: b } = h, _ = 0;
2548
+ v.forEach((m) => {
2549
+ if (!b.has(m)) {
2550
+ const y = p.concat([_]);
2551
+ g.push({
2552
2552
  op: a,
2553
2553
  path: y,
2554
- value: b
2554
+ value: m
2555
2555
  }), f.unshift({
2556
2556
  op: n,
2557
2557
  path: y,
2558
- value: b
2558
+ value: m
2559
2559
  });
2560
2560
  }
2561
- g++;
2562
- }), g = 0, m.forEach((b) => {
2563
- if (!_.has(b)) {
2564
- const y = p.concat([g]);
2565
- v.push({
2561
+ _++;
2562
+ }), _ = 0, b.forEach((m) => {
2563
+ if (!v.has(m)) {
2564
+ const y = p.concat([_]);
2565
+ g.push({
2566
2566
  op: n,
2567
2567
  path: y,
2568
- value: b
2568
+ value: m
2569
2569
  }), f.unshift({
2570
2570
  op: a,
2571
2571
  path: y,
2572
- value: b
2572
+ value: m
2573
2573
  });
2574
2574
  }
2575
- g++;
2575
+ _++;
2576
2576
  });
2577
2577
  }
2578
- function E(h, p, v, f) {
2579
- v.push({
2578
+ function E(h, p, g, f) {
2579
+ g.push({
2580
2580
  op: r,
2581
2581
  path: [],
2582
2582
  value: p === gn ? void 0 : p
@@ -2587,70 +2587,70 @@ function zn() {
2587
2587
  });
2588
2588
  }
2589
2589
  function D(h, p) {
2590
- return p.forEach((v) => {
2591
- const { path: f, op: _ } = v;
2592
- let m = h;
2590
+ return p.forEach((g) => {
2591
+ const { path: f, op: v } = g;
2592
+ let b = h;
2593
2593
  for (let F = 0; F < f.length - 1; F++) {
2594
- const k = Mt(m);
2595
- let O = f[F];
2596
- typeof O != "string" && typeof O != "number" && (O = "" + O), (k === 0 || k === 1) && (O === "__proto__" || O === "constructor") && G(19), typeof m == "function" && O === "prototype" && G(19), m = Zr(m, O), typeof m != "object" && G(18, f.join("/"));
2594
+ const k = Mt(b);
2595
+ let M = f[F];
2596
+ typeof M != "string" && typeof M != "number" && (M = "" + M), (k === 0 || k === 1) && (M === "__proto__" || M === "constructor") && G(19), typeof b == "function" && M === "prototype" && G(19), b = Zr(b, M), typeof b != "object" && G(18, f.join("/"));
2597
2597
  }
2598
- const g = Mt(m), b = S(v.value), y = f[f.length - 1];
2599
- switch (_) {
2598
+ const _ = Mt(b), m = w(g.value), y = f[f.length - 1];
2599
+ switch (v) {
2600
2600
  case r:
2601
- switch (g) {
2601
+ switch (_) {
2602
2602
  case 2:
2603
- return m.set(y, b);
2603
+ return b.set(y, m);
2604
2604
  case 3:
2605
2605
  G(16);
2606
2606
  default:
2607
- return m[y] = b;
2607
+ return b[y] = m;
2608
2608
  }
2609
2609
  case n:
2610
- switch (g) {
2610
+ switch (_) {
2611
2611
  case 1:
2612
- return y === "-" ? m.push(b) : m.splice(y, 0, b);
2612
+ return y === "-" ? b.push(m) : b.splice(y, 0, m);
2613
2613
  case 2:
2614
- return m.set(y, b);
2614
+ return b.set(y, m);
2615
2615
  case 3:
2616
- return m.add(b);
2616
+ return b.add(m);
2617
2617
  default:
2618
- return m[y] = b;
2618
+ return b[y] = m;
2619
2619
  }
2620
2620
  case a:
2621
- switch (g) {
2621
+ switch (_) {
2622
2622
  case 1:
2623
- return m.splice(y, 1);
2623
+ return b.splice(y, 1);
2624
2624
  case 2:
2625
- return m.delete(y);
2625
+ return b.delete(y);
2626
2626
  case 3:
2627
- return m.delete(v.value);
2627
+ return b.delete(g.value);
2628
2628
  default:
2629
- return delete m[y];
2629
+ return delete b[y];
2630
2630
  }
2631
2631
  default:
2632
- G(17, _);
2632
+ G(17, v);
2633
2633
  }
2634
2634
  }), h;
2635
2635
  }
2636
- function S(h) {
2636
+ function w(h) {
2637
2637
  if (!_t(h))
2638
2638
  return h;
2639
2639
  if (Array.isArray(h))
2640
- return h.map(S);
2640
+ return h.map(w);
2641
2641
  if (me(h))
2642
2642
  return new Map(
2643
- Array.from(h.entries()).map(([v, f]) => [v, S(f)])
2643
+ Array.from(h.entries()).map(([g, f]) => [g, w(f)])
2644
2644
  );
2645
2645
  if (be(h))
2646
- return new Set(Array.from(h).map(S));
2646
+ return new Set(Array.from(h).map(w));
2647
2647
  const p = Object.create(Ot(h));
2648
- for (const v in h)
2649
- p[v] = S(h[v]);
2648
+ for (const g in h)
2649
+ p[g] = w(h[g]);
2650
2650
  return pe(h, fe) && (p[fe] = h[fe]), p;
2651
2651
  }
2652
- function R(h) {
2653
- return xt(h) ? S(h) : h;
2652
+ function z(h) {
2653
+ return xt(h) ? w(h) : h;
2654
2654
  }
2655
2655
  ea("Patches", {
2656
2656
  applyPatches_: D,
@@ -2691,7 +2691,7 @@ function Ia(t, r) {
2691
2691
  t[o + n] = r[n];
2692
2692
  return t;
2693
2693
  }
2694
- var Sn = Object.prototype, Sa = Sn.hasOwnProperty, wn = Sn.toString, Nn = _a.Symbol, wa = Sn.propertyIsEnumerable, Hn = Nn ? Nn.isConcatSpreadable : void 0, Un = Math.max;
2694
+ var Sn = Object.prototype, Sa = Sn.hasOwnProperty, wn = Sn.toString, Nn = _a.Symbol, wa = Sn.propertyIsEnumerable, Hn = Nn ? Nn.isConcatSpreadable : void 0, Ln = Math.max;
2695
2695
  function Ta(t, r, n, a, o) {
2696
2696
  var c = -1, l = t.length;
2697
2697
  for (n || (n = Oa), o || (o = []); ++c < l; ) {
@@ -2713,8 +2713,8 @@ function Ea(t, r, n) {
2713
2713
  return c;
2714
2714
  }
2715
2715
  function ka(t, r) {
2716
- return r = Un(r === void 0 ? t.length - 1 : r, 0), function() {
2717
- for (var n = arguments, a = -1, o = Un(n.length - r, 0), c = Array(o); ++a < o; )
2716
+ return r = Ln(r === void 0 ? t.length - 1 : r, 0), function() {
2717
+ for (var n = arguments, a = -1, o = Ln(n.length - r, 0), c = Array(o); ++a < o; )
2718
2718
  c[a] = n[r + a];
2719
2719
  a = -1;
2720
2720
  for (var l = Array(r + 1); ++a < r; )
@@ -2761,7 +2761,7 @@ function za(t) {
2761
2761
  var Na = ka(function(t, r) {
2762
2762
  return t == null ? {} : Aa(t, va(Ta(r), xa));
2763
2763
  }), Ha = Na;
2764
- const Ln = /* @__PURE__ */ mn(Ha), Ua = {
2764
+ const Un = /* @__PURE__ */ mn(Ha), La = {
2765
2765
  tracks: [],
2766
2766
  trackItemIds: [],
2767
2767
  trackItemsMap: {},
@@ -2791,7 +2791,7 @@ class Ba {
2791
2791
  Et(this, "undos", []);
2792
2792
  Et(this, "redos", []);
2793
2793
  Et(this, "listener");
2794
- const n = r || Ua;
2794
+ const n = r || La;
2795
2795
  this.stateSubject = new Mn(n), this.stateHistorySubject = new Mn({
2796
2796
  handleRedo: !1,
2797
2797
  handleUndo: !1
@@ -2807,7 +2807,7 @@ class Ba {
2807
2807
  this.destroyListeners();
2808
2808
  }
2809
2809
  updateHistory(r, n) {
2810
- const a = Ln(r, Gn), o = Ln(this.getState(), Gn), c = Jn(o, a);
2810
+ const a = Un(r, Gn), o = Un(this.getState(), Gn), c = Jn(o, a);
2811
2811
  c.length && (this.undos.push({ undos: c, type: n }), this.redos = []);
2812
2812
  }
2813
2813
  getStateHistory() {
@@ -2896,58 +2896,58 @@ class Ba {
2896
2896
  transitionIds: d,
2897
2897
  transitionsMap: E,
2898
2898
  trackItemsMap: D
2899
- } = this.getState(), S = tt({
2899
+ } = this.getState(), w = tt({
2900
2900
  trackItemDetailsMap: o,
2901
2901
  trackItemIds: c,
2902
2902
  tracks: l,
2903
2903
  transitionIds: d,
2904
2904
  transitionsMap: E,
2905
2905
  trackItemsMap: D
2906
- }), R = [], h = [], p = [], v = [], f = [], _ = [];
2907
- n.forEach((w) => {
2906
+ }), z = [], h = [], p = [], g = [], f = [], v = [];
2907
+ n.forEach((S) => {
2908
2908
  let T;
2909
- const H = w.path.slice(1);
2910
- w.type === "CREATE" ? T = {
2909
+ const H = S.path.slice(1);
2910
+ S.type === "CREATE" ? T = {
2911
2911
  path: H,
2912
2912
  op: "remove",
2913
- value: w.value
2914
- } : w.type === "CHANGE" ? T = {
2913
+ value: S.value
2914
+ } : S.type === "CHANGE" ? T = {
2915
2915
  path: H,
2916
2916
  op: "replace",
2917
- value: w.oldValue
2917
+ value: S.oldValue
2918
2918
  } : T = {
2919
2919
  path: H,
2920
2920
  op: "add",
2921
- value: w.oldValue
2922
- }, w.path.includes("trackItemIds") ? p.push(T) : w.path.includes("transitionIds") ? h.push(T) : w.path.includes("trackItemsMap") ? f.push(T) : w.path.includes("transitionsMap") ? v.push(T) : w.path.includes("tracks") ? R.push(T) : w.path.includes("trackItemDetailsMap") && _.push(T);
2921
+ value: S.oldValue
2922
+ }, S.path.includes("trackItemIds") ? p.push(T) : S.path.includes("transitionIds") ? h.push(T) : S.path.includes("trackItemsMap") ? f.push(T) : S.path.includes("transitionsMap") ? g.push(T) : S.path.includes("tracks") ? z.push(T) : S.path.includes("trackItemDetailsMap") && v.push(T);
2923
2923
  });
2924
- const m = this.applyPatch(
2925
- S.tracks,
2926
- R
2927
- ), g = this.applyPatch(
2928
- S.transitionIds,
2924
+ const b = this.applyPatch(
2925
+ w.tracks,
2926
+ z
2927
+ ), _ = this.applyPatch(
2928
+ w.transitionIds,
2929
2929
  h
2930
- ), b = this.applyPatch(
2931
- S.trackItemIds,
2930
+ ), m = this.applyPatch(
2931
+ w.trackItemIds,
2932
2932
  p
2933
2933
  ), y = this.applyPatch(
2934
- S.transitionsMap,
2935
- v
2934
+ w.transitionsMap,
2935
+ g
2936
2936
  ), F = this.applyPatch(
2937
- S.trackItemsMap,
2937
+ w.trackItemsMap,
2938
2938
  f
2939
2939
  ), k = this.applyPatch(
2940
- S.trackItemDetailsMap,
2941
- _
2942
- ), O = tt({
2943
- tracks: m,
2944
- transitionIds: g,
2945
- trackItemIds: b,
2940
+ w.trackItemDetailsMap,
2941
+ v
2942
+ ), M = tt({
2943
+ tracks: b,
2944
+ transitionIds: _,
2945
+ trackItemIds: m,
2946
2946
  transitionsMap: y,
2947
2947
  trackItemsMap: F,
2948
2948
  trackItemDetailsMap: k
2949
- }), N = tt(this.getState()), z = { ...N, ...O };
2950
- this.prevState = N, this.redos.push({ redos: n, type: a }), this.stateSubject.next(z), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 });
2949
+ }), N = tt(this.getState()), R = { ...N, ...M };
2950
+ this.prevState = N, this.redos.push({ redos: n, type: a }), this.stateSubject.next(R), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 });
2951
2951
  }
2952
2952
  applyPatch(r, n) {
2953
2953
  return n.reverse().reduce((a, o) => ca(a, (c) => {
@@ -2965,58 +2965,58 @@ class Ba {
2965
2965
  transitionIds: d,
2966
2966
  transitionsMap: E,
2967
2967
  trackItemsMap: D
2968
- } = this.getState(), S = tt({
2968
+ } = this.getState(), w = tt({
2969
2969
  trackItemDetailsMap: o,
2970
2970
  trackItemIds: c,
2971
2971
  tracks: l,
2972
2972
  transitionIds: d,
2973
2973
  transitionsMap: E,
2974
2974
  trackItemsMap: D
2975
- }), R = [], h = [], p = [], v = [], f = [], _ = [];
2976
- n.forEach((w) => {
2975
+ }), z = [], h = [], p = [], g = [], f = [], v = [];
2976
+ n.forEach((S) => {
2977
2977
  let T;
2978
- const H = w.path.slice(1);
2979
- w.type === "CREATE" ? T = {
2978
+ const H = S.path.slice(1);
2979
+ S.type === "CREATE" ? T = {
2980
2980
  path: H,
2981
2981
  op: "add",
2982
- value: w.value
2983
- } : w.type === "CHANGE" ? T = {
2982
+ value: S.value
2983
+ } : S.type === "CHANGE" ? T = {
2984
2984
  path: H,
2985
2985
  op: "replace",
2986
- value: w.value
2986
+ value: S.value
2987
2987
  } : T = {
2988
2988
  path: H,
2989
2989
  op: "remove",
2990
- value: w.oldValue
2991
- }, w.path.includes("trackItemIds") ? p.push(T) : w.path.includes("transitionIds") ? h.push(T) : w.path.includes("trackItemsMap") ? f.push(T) : w.path.includes("transitionsMap") ? v.push(T) : w.path.includes("trackItemDetailsMap") ? _.push(T) : R.push(T);
2990
+ value: S.oldValue
2991
+ }, S.path.includes("trackItemIds") ? p.push(T) : S.path.includes("transitionIds") ? h.push(T) : S.path.includes("trackItemsMap") ? f.push(T) : S.path.includes("transitionsMap") ? g.push(T) : S.path.includes("trackItemDetailsMap") ? v.push(T) : z.push(T);
2992
2992
  });
2993
- const m = this.applyPatch(
2994
- S.tracks,
2995
- R
2996
- ), g = this.applyPatch(
2997
- S.transitionIds,
2993
+ const b = this.applyPatch(
2994
+ w.tracks,
2995
+ z
2996
+ ), _ = this.applyPatch(
2997
+ w.transitionIds,
2998
2998
  h
2999
- ), b = this.applyPatch(
3000
- S.trackItemIds,
2999
+ ), m = this.applyPatch(
3000
+ w.trackItemIds,
3001
3001
  p
3002
3002
  ), y = this.applyPatch(
3003
- S.transitionsMap,
3004
- v
3003
+ w.transitionsMap,
3004
+ g
3005
3005
  ), F = this.applyPatch(
3006
- S.trackItemsMap,
3006
+ w.trackItemsMap,
3007
3007
  f
3008
3008
  ), k = this.applyPatch(
3009
- S.trackItemDetailsMap,
3010
- _
3011
- ), O = tt({
3012
- tracks: m,
3013
- transitionIds: g,
3014
- trackItemIds: b,
3009
+ w.trackItemDetailsMap,
3010
+ v
3011
+ ), M = tt({
3012
+ tracks: b,
3013
+ transitionIds: _,
3014
+ trackItemIds: m,
3015
3015
  transitionsMap: y,
3016
3016
  trackItemsMap: F,
3017
3017
  trackItemDetailsMap: k
3018
- }), N = tt(this.getState()), z = { ...N, ...O };
3019
- this.prevState = N, this.undos.push({ undos: n, type: a }), this.stateSubject.next(z), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 });
3018
+ }), N = tt(this.getState()), R = { ...N, ...M };
3019
+ this.prevState = N, this.undos.push({ undos: n, type: a }), this.stateSubject.next(R), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 });
3020
3020
  }
3021
3021
  }
3022
3022
  export {