@cliquify.me/state 3.1.18 → 3.1.19
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 +61 -61
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -494,7 +494,7 @@ gr.exports;
|
|
|
494
494
|
(function(t, e) {
|
|
495
495
|
var r = 200, s = "__lodash_hash_undefined__", a = 1, c = 2, d = 9007199254740991, f = "[object Arguments]", b = "[object Array]", _ = "[object AsyncFunction]", M = "[object Boolean]", E = "[object Date]", m = "[object Error]", T = "[object Function]", C = "[object GeneratorFunction]", u = "[object Map]", l = "[object Number]", S = "[object Null]", w = "[object Object]", k = "[object Promise]", h = "[object Proxy]", y = "[object RegExp]", v = "[object Set]", I = "[object String]", x = "[object Symbol]", g = "[object Undefined]", O = "[object WeakMap]", D = "[object ArrayBuffer]", j = "[object DataView]", L = "[object Float32Array]", R = "[object Float64Array]", F = "[object Int8Array]", V = "[object Int16Array]", kt = "[object Int32Array]", Dt = "[object Uint8Array]", Ot = "[object Uint8ClampedArray]", U = "[object Uint16Array]", zt = "[object Uint32Array]", wt = /[\\^$.*+?()[\]{}|]/g, at = /^\[object .+?Constructor\]$/, Ft = /^(?:0|[1-9]\d*)$/, A = {};
|
|
496
496
|
A[L] = A[R] = A[F] = A[V] = A[kt] = A[Dt] = A[Ot] = A[U] = A[zt] = !0, A[f] = A[b] = A[D] = A[M] = A[j] = A[E] = A[m] = A[T] = A[u] = A[l] = A[w] = A[y] = A[v] = A[I] = A[O] = !1;
|
|
497
|
-
var
|
|
497
|
+
var Z = typeof St == "object" && St && St.Object === Object && St, Mt = typeof self == "object" && self && self.Object === Object && self, ot = Z || Mt || Function("return this")(), $t = e && !e.nodeType && e, Et = $t && !0 && t && !t.nodeType && t, Gt = Et && Et.exports === $t, Yt = Gt && Z.process, ee = function() {
|
|
498
498
|
try {
|
|
499
499
|
return Yt && Yt.binding && Yt.binding("util");
|
|
500
500
|
} catch {
|
|
@@ -718,13 +718,13 @@ gr.exports;
|
|
|
718
718
|
function Vr(n, i, o, p, N, P) {
|
|
719
719
|
var G = Ae(n), W = Ae(i), J = G ? b : Pt(n), X = W ? b : Pt(i);
|
|
720
720
|
J = J == f ? w : J, X = X == f ? w : X;
|
|
721
|
-
var dt = J == w, bt = X == w,
|
|
722
|
-
if (
|
|
721
|
+
var dt = J == w, bt = X == w, Q = J == X;
|
|
722
|
+
if (Q && xe(n)) {
|
|
723
723
|
if (!xe(i))
|
|
724
724
|
return !1;
|
|
725
725
|
G = !0, dt = !1;
|
|
726
726
|
}
|
|
727
|
-
if (
|
|
727
|
+
if (Q && !dt)
|
|
728
728
|
return P || (P = new Ct()), G || fr(n) ? Ue(n, i, o, p, N, P) : Qr(n, i, J, o, p, N, P);
|
|
729
729
|
if (!(o & a)) {
|
|
730
730
|
var ft = dt && ht.call(n, "__wrapped__"), st = bt && ht.call(i, "__wrapped__");
|
|
@@ -733,7 +733,7 @@ gr.exports;
|
|
|
733
733
|
return P || (P = new Ct()), N(Zt, Ut, o, p, P);
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
|
-
return
|
|
736
|
+
return Q ? (P || (P = new Ct()), tn(n, i, o, p, N, P)) : !1;
|
|
737
737
|
}
|
|
738
738
|
function qr(n) {
|
|
739
739
|
if (!dr(n) || sn(n))
|
|
@@ -759,7 +759,7 @@ gr.exports;
|
|
|
759
759
|
var X = P.get(n);
|
|
760
760
|
if (X && P.get(i))
|
|
761
761
|
return X == i;
|
|
762
|
-
var dt = -1, bt = !0,
|
|
762
|
+
var dt = -1, bt = !0, Q = o & c ? new Me() : void 0;
|
|
763
763
|
for (P.set(n, i), P.set(i, n); ++dt < W; ) {
|
|
764
764
|
var ft = n[dt], st = i[dt];
|
|
765
765
|
if (p)
|
|
@@ -770,10 +770,10 @@ gr.exports;
|
|
|
770
770
|
bt = !1;
|
|
771
771
|
break;
|
|
772
772
|
}
|
|
773
|
-
if (
|
|
773
|
+
if (Q) {
|
|
774
774
|
if (!ne(i, function(Ut, ue) {
|
|
775
|
-
if (!Nt(
|
|
776
|
-
return
|
|
775
|
+
if (!Nt(Q, ue) && (ft === Ut || N(ft, Ut, o, p, P)))
|
|
776
|
+
return Q.push(ue);
|
|
777
777
|
})) {
|
|
778
778
|
bt = !1;
|
|
779
779
|
break;
|
|
@@ -825,8 +825,8 @@ gr.exports;
|
|
|
825
825
|
if (J != dt && !G)
|
|
826
826
|
return !1;
|
|
827
827
|
for (var bt = J; bt--; ) {
|
|
828
|
-
var
|
|
829
|
-
if (!(G ?
|
|
828
|
+
var Q = W[bt];
|
|
829
|
+
if (!(G ? Q in i : ht.call(i, Q)))
|
|
830
830
|
return !1;
|
|
831
831
|
}
|
|
832
832
|
var ft = P.get(n);
|
|
@@ -835,15 +835,15 @@ gr.exports;
|
|
|
835
835
|
var st = !0;
|
|
836
836
|
P.set(n, i), P.set(i, n);
|
|
837
837
|
for (var Zt = G; ++bt < J; ) {
|
|
838
|
-
|
|
839
|
-
var Ut = n[
|
|
838
|
+
Q = W[bt];
|
|
839
|
+
var Ut = n[Q], ue = i[Q];
|
|
840
840
|
if (p)
|
|
841
|
-
var Fn = G ? p(ue, Ut,
|
|
841
|
+
var Fn = G ? p(ue, Ut, Q, i, n, P) : p(Ut, ue, Q, n, i, P);
|
|
842
842
|
if (!(Fn === void 0 ? Ut === ue || N(Ut, ue, o, p, P) : Fn)) {
|
|
843
843
|
st = !1;
|
|
844
844
|
break;
|
|
845
845
|
}
|
|
846
|
-
Zt || (Zt =
|
|
846
|
+
Zt || (Zt = Q == "constructor");
|
|
847
847
|
}
|
|
848
848
|
if (st && !Zt) {
|
|
849
849
|
var pr = n.constructor, hr = i.constructor;
|
|
@@ -968,13 +968,13 @@ gr.exports;
|
|
|
968
968
|
t.exports = on;
|
|
969
969
|
})(gr, gr.exports);
|
|
970
970
|
var Ws = gr.exports;
|
|
971
|
-
const
|
|
971
|
+
const tt = /* @__PURE__ */ xn(Ws), Aa = "add", Gs = "track", Ys = "trackItems", xa = `${Gs}:changed`, Da = `${Ys}:changed`, Bs = "state", Oa = `${Bs}:changed`, Dn = "design", Xs = `${Dn}:load`, Ks = `${Dn}:resize`, gt = "add", Vs = `${gt}:text`, qs = `${gt}:video`, Js = `${gt}:audio`, Ca = `${gt}:placeholder`, Zs = `${gt}:image`, Qs = `${gt}:illustration`, ti = `${gt}:shape`, Pa = `${gt}:mask`, Ra = `${gt}:transition`, ei = `${gt}:animation`, ri = `${gt}:caption`, ni = `${gt}:template`, si = `${gt}:items`, ii = `${gt}:composition`, be = "edit", ai = `${be}:object`, oi = `${be}:replaceMedia`, za = `${be}:text`, Fa = `${be}:shape`, $a = `${be}:templateItem`, Na = `${be}:deleteTemplateItem`, ja = "enterEditMode", Ce = "active", Ha = `${Ce}:set`, La = `${Ce}:delete`, ci = `${Ce}:paste`, ui = `${Ce}:clone`, li = `${Ce}:split`, pt = "layer", Ua = `${pt}:locked`, Wa = `${pt}:hidden`, Ga = `${pt}:move`, Ya = `${pt}:select`, Ba = `${pt}:selection`, Xa = `${pt}:sendTo`, Ka = `${pt}:rename`, Va = `${pt}:editingName`, qa = `${pt}:copy`, Ja = `${pt}:paste`, di = `${pt}:clone`, Za = `${pt}:split`, Qa = `${pt}:cut`, fi = `${pt}:delete`, pi = `${pt}:replace`, Sr = "history", hi = `${Sr}:undo`, mi = `${Sr}:redo`, to = `${Sr}:reset`, us = "scale", yi = `${us}:changed`;
|
|
972
972
|
var Ir = { exports: {} };
|
|
973
973
|
Ir.exports;
|
|
974
974
|
(function(t, e) {
|
|
975
975
|
var r = 200, s = "__lodash_hash_undefined__", a = 9007199254740991, c = "[object Arguments]", d = "[object Array]", f = "[object Boolean]", b = "[object Date]", _ = "[object Error]", M = "[object Function]", E = "[object GeneratorFunction]", m = "[object Map]", T = "[object Number]", C = "[object Object]", u = "[object Promise]", l = "[object RegExp]", S = "[object Set]", w = "[object String]", k = "[object Symbol]", h = "[object WeakMap]", y = "[object ArrayBuffer]", v = "[object DataView]", I = "[object Float32Array]", x = "[object Float64Array]", g = "[object Int8Array]", O = "[object Int16Array]", D = "[object Int32Array]", j = "[object Uint8Array]", L = "[object Uint8ClampedArray]", R = "[object Uint16Array]", F = "[object Uint32Array]", V = /[\\^$.*+?()[\]{}|]/g, kt = /\w*$/, Dt = /^\[object .+?Constructor\]$/, Ot = /^(?:0|[1-9]\d*)$/, U = {};
|
|
976
976
|
U[c] = U[d] = U[y] = U[v] = U[f] = U[b] = U[I] = U[x] = U[g] = U[O] = U[D] = U[m] = U[T] = U[C] = U[l] = U[S] = U[w] = U[k] = U[j] = U[L] = U[R] = U[F] = !0, U[_] = U[M] = U[h] = !1;
|
|
977
|
-
var zt = typeof St == "object" && St && St.Object === Object && St, wt = typeof self == "object" && self && self.Object === Object && self, at = zt || wt || Function("return this")(), Ft = e && !e.nodeType && e, A = Ft && !0 && t && !t.nodeType && t,
|
|
977
|
+
var zt = typeof St == "object" && St && St.Object === Object && St, wt = typeof self == "object" && self && self.Object === Object && self, at = zt || wt || Function("return this")(), Ft = e && !e.nodeType && e, A = Ft && !0 && t && !t.nodeType && t, Z = A && A.exports === Ft;
|
|
978
978
|
function Mt(n, i) {
|
|
979
979
|
return n.set(i[0], i[1]), n;
|
|
980
980
|
}
|
|
@@ -1035,7 +1035,7 @@ Ir.exports;
|
|
|
1035
1035
|
return n ? "Symbol(src)_1." + n : "";
|
|
1036
1036
|
}(), H = ke.toString, z = Nt.hasOwnProperty, rt = Nt.toString, ct = RegExp(
|
|
1037
1037
|
"^" + H.call(z).replace(V, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1038
|
-
), B =
|
|
1038
|
+
), B = Z ? at.Buffer : void 0, ut = at.Symbol, q = at.Uint8Array, ht = Xt(Object.getPrototypeOf, Object), Se = Object.create, se = Nt.propertyIsEnumerable, Pe = _e.splice, Y = Object.getOwnPropertySymbols, mt = B ? B.isBuffer : void 0, Vt = Xt(Object.keys, Object), qt = xt(at, "DataView"), Tt = xt(at, "Map"), At = xt(at, "Promise"), we = xt(at, "Set"), Re = xt(at, "WeakMap"), ie = xt(Object, "create"), ze = yt(qt), ae = yt(Tt), Fe = yt(At), $e = yt(we), Ne = yt(Re), Jt = ut ? ut.prototype : void 0, rr = Jt ? Jt.valueOf : void 0;
|
|
1039
1039
|
function jt(n) {
|
|
1040
1040
|
var i = -1, o = n ? n.length : 0;
|
|
1041
1041
|
for (this.clear(); ++i < o; ) {
|
|
@@ -1197,9 +1197,9 @@ Ir.exports;
|
|
|
1197
1197
|
if (bt)
|
|
1198
1198
|
return bt;
|
|
1199
1199
|
if (G.set(n, W), !J)
|
|
1200
|
-
var
|
|
1201
|
-
return $t(
|
|
1202
|
-
|
|
1200
|
+
var Q = o ? tn(n) : Ye(n);
|
|
1201
|
+
return $t(Q || n, function(ft, st) {
|
|
1202
|
+
Q && (st = ft, ft = n[st]), sr(W, st, He(ft, i, o, p, st, n, G));
|
|
1203
1203
|
}), W;
|
|
1204
1204
|
}
|
|
1205
1205
|
function Gr(n) {
|
|
@@ -2371,28 +2371,28 @@ function Ri(t) {
|
|
|
2371
2371
|
)), u.key === fi) {
|
|
2372
2372
|
const v = (k = u.value) == null ? void 0 : k.payload.trackItemIds, I = K(t.getState()), x = v && v.length ? v : I.activeIds, g = x.map((A) => I.trackItemsMap[A]).filter((A) => !!A).map((A) => A.id), O = I.transitionIds.filter(
|
|
2373
2373
|
(A) => {
|
|
2374
|
-
const
|
|
2375
|
-
return g.includes(
|
|
2374
|
+
const Z = I.transitionsMap[A];
|
|
2375
|
+
return g.includes(Z.fromId) || g.includes(Z.toId);
|
|
2376
2376
|
}
|
|
2377
2377
|
);
|
|
2378
2378
|
g.push(...O);
|
|
2379
2379
|
const D = {}, j = I.trackItemIds, L = I.transitionIds, R = I.trackItemDetailsMap, F = K(I.tracks), V = K(I.structure);
|
|
2380
2380
|
g.forEach((A) => {
|
|
2381
2381
|
var Mt;
|
|
2382
|
-
const
|
|
2383
|
-
if (
|
|
2382
|
+
const Z = I.trackItemsMap[A] || I.transitionsMap[A];
|
|
2383
|
+
if (Z.type === "template" || Z.type === "caption") {
|
|
2384
2384
|
const ot = (Mt = I.structure.find(
|
|
2385
|
-
(Et) => Et.id ===
|
|
2385
|
+
(Et) => Et.id === Z.id
|
|
2386
2386
|
)) == null ? void 0 : Mt.items;
|
|
2387
2387
|
g.push(...ot);
|
|
2388
2388
|
const $t = V.findIndex(
|
|
2389
|
-
(Et) => Et.id ===
|
|
2389
|
+
(Et) => Et.id === Z.id
|
|
2390
2390
|
);
|
|
2391
2391
|
V.splice($t, 1);
|
|
2392
2392
|
}
|
|
2393
2393
|
}), g.forEach((A) => {
|
|
2394
|
-
V.forEach((
|
|
2395
|
-
|
|
2394
|
+
V.forEach((Z) => {
|
|
2395
|
+
Z.items.includes(A) && (Z.items = Z.items.filter((Mt) => Mt !== A));
|
|
2396
2396
|
});
|
|
2397
2397
|
});
|
|
2398
2398
|
const kt = j.filter(
|
|
@@ -2517,7 +2517,7 @@ function Ri(t) {
|
|
|
2517
2517
|
);
|
|
2518
2518
|
}
|
|
2519
2519
|
}), m = r.subscribe(async (u) => {
|
|
2520
|
-
var g, O, D, j, L, R, F, V, kt, Dt, Ot, U, zt, wt, at, Ft, A,
|
|
2520
|
+
var g, O, D, j, L, R, F, V, kt, Dt, Ot, U, zt, wt, at, Ft, A, Z, Mt, ot, $t, Et, Gt, Yt, ee, Bt, re, Xt, ne, _e, ke, Nt, Kt;
|
|
2521
2521
|
const l = K(t.getState()), S = ((O = (g = u.value) == null ? void 0 : g.options) == null ? void 0 : O.isSelected) || !1, w = (j = (D = u.value) == null ? void 0 : D.options) == null ? void 0 : j.scaleMode, k = (R = (L = u.value) == null ? void 0 : L.options) == null ? void 0 : R.isNewTrack;
|
|
2522
2522
|
let h = [], y = "text";
|
|
2523
2523
|
const v = (V = (F = u.value) == null ? void 0 : F.options) == null ? void 0 : V.trackId;
|
|
@@ -2656,7 +2656,7 @@ function Ri(t) {
|
|
|
2656
2656
|
}
|
|
2657
2657
|
if (u.key === ni) {
|
|
2658
2658
|
y = "template";
|
|
2659
|
-
const $ = (A = u.value) == null ? void 0 : A.payload.trackItemsMap, H = (
|
|
2659
|
+
const $ = (A = u.value) == null ? void 0 : A.payload.trackItemsMap, H = (Z = u.value) == null ? void 0 : Z.payload.trackItemDetailsMap, z = (Mt = u.value) == null ? void 0 : Mt.payload.transitionsMap, rt = ((ot = u.value) == null ? void 0 : ot.payload.transitionIds) || [], ct = ($t = u.value) == null ? void 0 : $t.payload.trackItemIds, B = ((Et = u.value) == null ? void 0 : Et.payload.tracks) || [], { details: ut, ...q } = await ys((Gt = u.value) == null ? void 0 : Gt.payload, {
|
|
2660
2660
|
size: l.size
|
|
2661
2661
|
}), ht = {
|
|
2662
2662
|
id: q.id,
|
|
@@ -3118,7 +3118,7 @@ var On = Symbol.for("immer-nothing"), Ke = Symbol.for("immer-draftable"), vt = S
|
|
|
3118
3118
|
// Note: if more errors are added, the errorOffset in Patches.ts should be increased
|
|
3119
3119
|
// See Patches.ts for additional errors
|
|
3120
3120
|
] : [];
|
|
3121
|
-
function
|
|
3121
|
+
function et(t, ...e) {
|
|
3122
3122
|
if (process.env.NODE_ENV !== "production") {
|
|
3123
3123
|
const r = ks[t], s = typeof r == "function" ? r.apply(null, e) : r;
|
|
3124
3124
|
throw new Error(`[Immer] ${s}`);
|
|
@@ -3211,7 +3211,7 @@ function Cn(t, e = !1) {
|
|
|
3211
3211
|
return Mr(t) || ye(t) || !Qt(t) || (ge(t) > 1 && (t.set = t.add = t.clear = t.delete = Ni), Object.freeze(t), e && Object.entries(t).forEach(([r, s]) => Cn(s, !0))), t;
|
|
3212
3212
|
}
|
|
3213
3213
|
function Ni() {
|
|
3214
|
-
|
|
3214
|
+
et(2);
|
|
3215
3215
|
}
|
|
3216
3216
|
function Mr(t) {
|
|
3217
3217
|
return Object.isFrozen(t);
|
|
@@ -3219,7 +3219,7 @@ function Mr(t) {
|
|
|
3219
3219
|
var wn = {};
|
|
3220
3220
|
function Ie(t) {
|
|
3221
3221
|
const e = wn[t];
|
|
3222
|
-
return e ||
|
|
3222
|
+
return e || et(0, t), e;
|
|
3223
3223
|
}
|
|
3224
3224
|
function ji(t, e) {
|
|
3225
3225
|
wn[t] || (wn[t] = e);
|
|
@@ -3258,7 +3258,7 @@ function Li(t) {
|
|
|
3258
3258
|
function qn(t, e) {
|
|
3259
3259
|
e.unfinalizedDrafts_ = e.drafts_.length;
|
|
3260
3260
|
const r = e.drafts_[0];
|
|
3261
|
-
return t !== void 0 && t !== r ? (r[vt].modified_ && (Mn(e),
|
|
3261
|
+
return t !== void 0 && t !== r ? (r[vt].modified_ && (Mn(e), et(4)), Qt(t) && (t = vr(e, t), e.parent_ || _r(e, t)), e.patches_ && Ie("Patches").generateReplacementPatches_(
|
|
3262
3262
|
r[vt].base_,
|
|
3263
3263
|
t,
|
|
3264
3264
|
e.patches_,
|
|
@@ -3295,7 +3295,7 @@ function vr(t, e, r) {
|
|
|
3295
3295
|
return s.copy_;
|
|
3296
3296
|
}
|
|
3297
3297
|
function Jn(t, e, r, s, a, c, d) {
|
|
3298
|
-
if (process.env.NODE_ENV !== "production" && a === r &&
|
|
3298
|
+
if (process.env.NODE_ENV !== "production" && a === r && et(5), ye(a)) {
|
|
3299
3299
|
const f = c && e && e.type_ !== 3 && // Set objects are atomic since they have no keys.
|
|
3300
3300
|
!qe(e.assigned_, s) ? c.concat(s) : void 0, b = vr(t, a, f);
|
|
3301
3301
|
if (ws(r, s, b), ye(b))
|
|
@@ -3388,13 +3388,13 @@ var Pn = {
|
|
|
3388
3388
|
};
|
|
3389
3389
|
},
|
|
3390
3390
|
defineProperty() {
|
|
3391
|
-
|
|
3391
|
+
et(11);
|
|
3392
3392
|
},
|
|
3393
3393
|
getPrototypeOf(t) {
|
|
3394
3394
|
return me(t.base_);
|
|
3395
3395
|
},
|
|
3396
3396
|
setPrototypeOf() {
|
|
3397
|
-
|
|
3397
|
+
et(12);
|
|
3398
3398
|
}
|
|
3399
3399
|
}, Ze = {};
|
|
3400
3400
|
Ve(Pn, (t, e) => {
|
|
@@ -3403,10 +3403,10 @@ Ve(Pn, (t, e) => {
|
|
|
3403
3403
|
};
|
|
3404
3404
|
});
|
|
3405
3405
|
Ze.deleteProperty = function(t, e) {
|
|
3406
|
-
return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) &&
|
|
3406
|
+
return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) && et(13), Ze.set.call(this, t, e, void 0);
|
|
3407
3407
|
};
|
|
3408
3408
|
Ze.set = function(t, e, r) {
|
|
3409
|
-
return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) &&
|
|
3409
|
+
return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) && et(14), Pn.set.call(this, t[0], e, r, t[0]);
|
|
3410
3410
|
};
|
|
3411
3411
|
function pn(t, e) {
|
|
3412
3412
|
const r = t[vt];
|
|
@@ -3452,7 +3452,7 @@ var Gi = class {
|
|
|
3452
3452
|
return d.produce(b, (M) => r.call(this, M, ..._));
|
|
3453
3453
|
};
|
|
3454
3454
|
}
|
|
3455
|
-
typeof r != "function" &&
|
|
3455
|
+
typeof r != "function" && et(6), s !== void 0 && typeof s != "function" && et(7);
|
|
3456
3456
|
let a;
|
|
3457
3457
|
if (Qt(e)) {
|
|
3458
3458
|
const c = Vn(this), d = An(e, void 0);
|
|
@@ -3470,7 +3470,7 @@ var Gi = class {
|
|
|
3470
3470
|
}
|
|
3471
3471
|
return a;
|
|
3472
3472
|
} else
|
|
3473
|
-
|
|
3473
|
+
et(1, e);
|
|
3474
3474
|
}, this.produceWithPatches = (e, r) => {
|
|
3475
3475
|
if (typeof e == "function")
|
|
3476
3476
|
return (d, ...f) => this.produceWithPatches(d, (b) => e(b, ...f));
|
|
@@ -3481,13 +3481,13 @@ var Gi = class {
|
|
|
3481
3481
|
}, typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze), typeof (t == null ? void 0 : t.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(t.useStrictShallowCopy);
|
|
3482
3482
|
}
|
|
3483
3483
|
createDraft(t) {
|
|
3484
|
-
Qt(t) ||
|
|
3484
|
+
Qt(t) || et(8), ye(t) && (t = Yi(t));
|
|
3485
3485
|
const e = Vn(this), r = An(t, void 0);
|
|
3486
3486
|
return r[vt].isManual_ = !0, En(e), r;
|
|
3487
3487
|
}
|
|
3488
3488
|
finishDraft(t, e) {
|
|
3489
3489
|
const r = t && t[vt];
|
|
3490
|
-
(!r || !r.isManual_) &&
|
|
3490
|
+
(!r || !r.isManual_) && et(9);
|
|
3491
3491
|
const { scope_: s } = r;
|
|
3492
3492
|
return Kn(s, e), qn(void 0, s);
|
|
3493
3493
|
}
|
|
@@ -3529,7 +3529,7 @@ function An(t, e) {
|
|
|
3529
3529
|
return (e ? e.scope_ : Ms()).drafts_.push(r), r;
|
|
3530
3530
|
}
|
|
3531
3531
|
function Yi(t) {
|
|
3532
|
-
return ye(t) ||
|
|
3532
|
+
return ye(t) || et(10, t), Ts(t);
|
|
3533
3533
|
}
|
|
3534
3534
|
function Ts(t) {
|
|
3535
3535
|
if (!Qt(t) || Mr(t))
|
|
@@ -3677,7 +3677,7 @@ function Zn() {
|
|
|
3677
3677
|
for (let y = 0; y < u.length - 1; y++) {
|
|
3678
3678
|
const v = ge(S);
|
|
3679
3679
|
let I = u[y];
|
|
3680
|
-
typeof I != "string" && typeof I != "number" && (I = "" + I), (v === 0 || v === 1) && (I === "__proto__" || I === "constructor") &&
|
|
3680
|
+
typeof I != "string" && typeof I != "number" && (I = "" + I), (v === 0 || v === 1) && (I === "__proto__" || I === "constructor") && et(19), typeof S == "function" && I === "prototype" && et(19), S = fn(S, I), typeof S != "object" && et(18, u.join("/"));
|
|
3681
3681
|
}
|
|
3682
3682
|
const w = ge(S), k = M(C.value), h = u[u.length - 1];
|
|
3683
3683
|
switch (l) {
|
|
@@ -3686,7 +3686,7 @@ function Zn() {
|
|
|
3686
3686
|
case 2:
|
|
3687
3687
|
return S.set(h, k);
|
|
3688
3688
|
case 3:
|
|
3689
|
-
|
|
3689
|
+
et(16);
|
|
3690
3690
|
default:
|
|
3691
3691
|
return S[h] = k;
|
|
3692
3692
|
}
|
|
@@ -3713,7 +3713,7 @@ function Zn() {
|
|
|
3713
3713
|
return delete S[h];
|
|
3714
3714
|
}
|
|
3715
3715
|
default:
|
|
3716
|
-
|
|
3716
|
+
et(17, l);
|
|
3717
3717
|
}
|
|
3718
3718
|
}), m;
|
|
3719
3719
|
}
|
|
@@ -3922,18 +3922,18 @@ class eo {
|
|
|
3922
3922
|
...K(s),
|
|
3923
3923
|
...K(e)
|
|
3924
3924
|
};
|
|
3925
|
-
|
|
3925
|
+
tt(s, a) || (r.updateHistory && this.updateHistory(a, r.kind), this.prevState = s, this.stateSubject.next(a));
|
|
3926
3926
|
}
|
|
3927
3927
|
// emit changes for design size
|
|
3928
3928
|
subscribeToSize(e) {
|
|
3929
3929
|
return this.stateSubject.asObservable().subscribe((r) => {
|
|
3930
|
-
|
|
3930
|
+
tt(r.size, this.prevState.size) || e({ size: r.size });
|
|
3931
3931
|
});
|
|
3932
3932
|
}
|
|
3933
3933
|
// Selectively subscribe to scale changes
|
|
3934
3934
|
subscribeToScale(e) {
|
|
3935
3935
|
return this.stateSubject.asObservable().subscribe((r) => {
|
|
3936
|
-
|
|
3936
|
+
tt(r.scale, this.prevState.scale) || e({ scale: r.scale });
|
|
3937
3937
|
});
|
|
3938
3938
|
}
|
|
3939
3939
|
// Selectively subscribe to fps changes
|
|
@@ -3944,7 +3944,7 @@ class eo {
|
|
|
3944
3944
|
}
|
|
3945
3945
|
subscribeToUpdateTrackItem(e) {
|
|
3946
3946
|
return this.stateSubject.asObservable().subscribe((r) => {
|
|
3947
|
-
|
|
3947
|
+
tt(r.trackItemsMap, this.prevState.trackItemsMap) || e({ trackItemsMap: r.trackItemsMap });
|
|
3948
3948
|
});
|
|
3949
3949
|
}
|
|
3950
3950
|
subscribeToUpdateAnimations(e) {
|
|
@@ -3952,7 +3952,7 @@ class eo {
|
|
|
3952
3952
|
const s = Object.keys(r.trackItemsMap).filter(
|
|
3953
3953
|
(a) => {
|
|
3954
3954
|
const c = this.prevState.trackItemsMap[a], d = r.trackItemsMap[a];
|
|
3955
|
-
return c && d && !
|
|
3955
|
+
return c && d && !tt(c.animations, d.animations);
|
|
3956
3956
|
}
|
|
3957
3957
|
);
|
|
3958
3958
|
e({ trackItemsMap: r.trackItemsMap, changedAnimationIds: s });
|
|
@@ -3960,14 +3960,14 @@ class eo {
|
|
|
3960
3960
|
}
|
|
3961
3961
|
subscribeToUpdateTrackItemTiming(e) {
|
|
3962
3962
|
return this.stateSubject.asObservable().subscribe((r) => {
|
|
3963
|
-
if (!
|
|
3963
|
+
if (!tt(r.trackItemsMap, this.prevState.trackItemsMap)) {
|
|
3964
3964
|
const s = Object.keys(r.trackItemsMap).filter((c) => {
|
|
3965
3965
|
const d = this.prevState.trackItemsMap[c], f = r.trackItemsMap[c];
|
|
3966
|
-
return d && f && !
|
|
3966
|
+
return d && f && !tt(d.trim, f.trim);
|
|
3967
3967
|
}), a = Object.keys(r.trackItemsMap).filter(
|
|
3968
3968
|
(c) => {
|
|
3969
3969
|
const d = this.prevState.trackItemsMap[c], f = r.trackItemsMap[c];
|
|
3970
|
-
return d && f && !
|
|
3970
|
+
return d && f && !tt(d.display, f.display);
|
|
3971
3971
|
}
|
|
3972
3972
|
);
|
|
3973
3973
|
e({
|
|
@@ -3980,7 +3980,7 @@ class eo {
|
|
|
3980
3980
|
}
|
|
3981
3981
|
subscribeToUpdateItemDetails(e) {
|
|
3982
3982
|
return this.stateSubject.asObservable().subscribe((r) => {
|
|
3983
|
-
|
|
3983
|
+
tt(r.trackItemDetailsMap, this.prevState.trackItemDetailsMap) || e({ trackItemDetailsMap: r.trackItemDetailsMap });
|
|
3984
3984
|
});
|
|
3985
3985
|
}
|
|
3986
3986
|
// Selectively subscribe to duration changes
|
|
@@ -4004,13 +4004,13 @@ class eo {
|
|
|
4004
4004
|
subscribeToAddOrRemoveItems(e) {
|
|
4005
4005
|
return this.stateSubject.asObservable().subscribe((r) => {
|
|
4006
4006
|
const s = [...r.trackItemIds].sort(), a = [...this.prevState.trackItemIds].sort(), c = [...r.transitionIds].sort(), d = [...this.prevState.transitionIds].sort();
|
|
4007
|
-
(!
|
|
4007
|
+
(!tt(s, a) || !tt(c, d)) && e({ trackItemIds: r.trackItemIds });
|
|
4008
4008
|
});
|
|
4009
4009
|
}
|
|
4010
4010
|
// Selectively subscribe to activeIds changes
|
|
4011
4011
|
subscribeToActiveIds(e) {
|
|
4012
4012
|
return this.stateSubject.asObservable().subscribe((r) => {
|
|
4013
|
-
|
|
4013
|
+
tt(r.activeIds, this.prevState.activeIds) || e({ activeIds: r.activeIds });
|
|
4014
4014
|
});
|
|
4015
4015
|
}
|
|
4016
4016
|
subscribeToTracks(e) {
|
|
@@ -4027,10 +4027,10 @@ class eo {
|
|
|
4027
4027
|
// Selectively subscribe to multiple track-related properties
|
|
4028
4028
|
subscribeToState(e) {
|
|
4029
4029
|
return this.stateSubject.asObservable().subscribe((r) => {
|
|
4030
|
-
(!
|
|
4030
|
+
(!tt(r.tracks, this.prevState.tracks) || !tt(r.trackItemIds, this.prevState.trackItemIds) || !tt(r.trackItemsMap, this.prevState.trackItemsMap) || !tt(r.transitionIds, this.prevState.transitionIds) || !tt(r.transitionsMap, this.prevState.transitionsMap) || !tt(
|
|
4031
4031
|
r.trackItemDetailsMap,
|
|
4032
4032
|
this.prevState.trackItemDetailsMap
|
|
4033
|
-
) || !
|
|
4033
|
+
) || !tt(r.structure, this.prevState.structure)) && e({
|
|
4034
4034
|
tracks: r.tracks,
|
|
4035
4035
|
trackItemIds: r.trackItemIds,
|
|
4036
4036
|
trackItemsMap: r.trackItemsMap,
|
package/dist/index.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(function(M,q){typeof exports=="object"&&typeof module<"u"?q(exports,require("@designcombo/events")):typeof define=="function"&&define.amd?define(["exports","@designcombo/events"],q):(M=typeof globalThis<"u"?globalThis:M||self,q(M.events={},M.events))})(this,function(M,q){"use strict";var qa=Object.defineProperty;var Ja=(M,q,Xt)=>q in M?qa(M,q,{enumerable:!0,configurable:!0,writable:!0,value:Xt}):M[q]=Xt;var Se=(M,q,Xt)=>Ja(M,typeof q!="symbol"?q+"":q,Xt);var Xt=function(t,e){return Xt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},Xt(t,e)};function Re(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Xt(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Ar(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dr(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),a,c=[],d;try{for(;(e===void 0||e-- >0)&&!(a=i.next()).done;)c.push(a.value)}catch(f){d={error:f}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(d)throw d.error}}return c}function Or(t,e,r){if(r||arguments.length===2)for(var i=0,a=e.length,c;i<a;i++)(c||!(i in e))&&(c||(c=Array.prototype.slice.call(e,0,i)),c[i]=e[i]);return t.concat(c||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;function Nt(t){return typeof t=="function"}function Nn(t){var e=function(i){Error.call(i),i.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Cr=Nn(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
2
2
|
`+r.map(function(i,a){return a+1+") "+i.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});function Pr(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var ir=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,i,a,c;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var f=Ar(d),b=f.next();!b.done;b=f.next()){var v=b.value;v.remove(this)}}catch(u){e={error:u}}finally{try{b&&!b.done&&(r=f.return)&&r.call(f)}finally{if(e)throw e.error}}else d.remove(this);var T=this.initialTeardown;if(Nt(T))try{T()}catch(u){c=u instanceof Cr?u.errors:[u]}var w=this._finalizers;if(w){this._finalizers=null;try{for(var m=Ar(w),A=m.next();!A.done;A=m.next()){var x=A.value;try{Hn(x)}catch(u){c=c??[],u instanceof Cr?c=Or(Or([],Dr(c)),Dr(u.errors)):c.push(u)}}}catch(u){i={error:u}}finally{try{A&&!A.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}}if(c)throw new Cr(c)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)Hn(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&Pr(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&Pr(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),zn=ir.EMPTY;function $n(t){return t instanceof ir||t&&"closed"in t&&Nt(t.remove)&&Nt(t.add)&&Nt(t.unsubscribe)}function Hn(t){Nt(t)?t():t.unsubscribe()}var rs={Promise:void 0},ns={setTimeout:function(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Or([t,e],Dr(r)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function is(t){ns.setTimeout(function(){throw t})}function jn(){}function sr(t){t()}var Un=function(t){Re(e,t);function e(r){var i=t.call(this)||this;return i.isStopped=!1,r?(i.destination=r,$n(r)&&r.add(i)):i.destination=os,i}return e.create=function(r,i,a){return new xr(r,i,a)},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(ir),ss=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(i){ar(i)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(i){ar(i)}else ar(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){ar(r)}},t}(),xr=function(t){Re(e,t);function e(r,i,a){var c=t.call(this)||this,d;return Nt(r)||!r?d={next:r??void 0,error:i??void 0,complete:a??void 0}:d=r,c.destination=new ss(d),c}return e}(Un);function ar(t){is(t)}function as(t){throw t}var os={closed:!0,next:jn,error:as,complete:jn},cs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function us(t){return t}function ls(t){return t.length===0?us:t.length===1?t[0]:function(r){return t.reduce(function(i,a){return a(i)},r)}}var Yn=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,i){var a=this,c=fs(e)?e:new xr(e,r,i);return sr(function(){var d=a,f=d.operator,b=d.source;c.add(f?f.call(c,b):b?a._subscribe(c):a._trySubscribe(c))}),c},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var i=this;return r=Gn(r),new r(function(a,c){var d=new xr({next:function(f){try{e(f)}catch(b){c(b),d.unsubscribe()}},error:c,complete:a});i.subscribe(d)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[cs]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return ls(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=Gn(e),new e(function(i,a){var c;r.subscribe(function(d){return c=d},function(d){return a(d)},function(){return i(c)})})},t.create=function(e){return new t(e)},t}();function Gn(t){var e;return(e=t??rs.Promise)!==null&&e!==void 0?e:Promise}function ds(t){return t&&Nt(t.next)&&Nt(t.error)&&Nt(t.complete)}function fs(t){return t&&t instanceof Un||ds(t)&&$n(t)}var ps=Nn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Wn=function(t){Re(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var i=new Xn(this,this);return i.operator=r,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new ps},e.prototype.next=function(r){var i=this;sr(function(){var a,c;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var d=Ar(i.currentObservers),f=d.next();!f.done;f=d.next()){var b=f.value;b.next(r)}}catch(v){a={error:v}}finally{try{f&&!f.done&&(c=d.return)&&c.call(d)}finally{if(a)throw a.error}}}})},e.prototype.error=function(r){var i=this;sr(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var a=i.observers;a.length;)a.shift().error(r)}})},e.prototype.complete=function(){var r=this;sr(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var i=this,a=this,c=a.hasError,d=a.isStopped,f=a.observers;return c||d?zn:(this.currentObservers=null,f.push(r),new ir(function(){i.currentObservers=null,Pr(f,r)}))},e.prototype._checkFinalizedStatuses=function(r){var i=this,a=i.hasError,c=i.thrownError,d=i.isStopped;a?r.error(c):d&&r.complete()},e.prototype.asObservable=function(){var r=new Yn;return r.source=this,r},e.create=function(r,i){return new Xn(r,i)},e}(Yn),Xn=function(t){Re(e,t);function e(r,i){var a=t.call(this)||this;return a.destination=r,a.source=i,a}return e.prototype.next=function(r){var i,a;(a=(i=this.destination)===null||i===void 0?void 0:i.next)===null||a===void 0||a.call(i,r)},e.prototype.error=function(r){var i,a;(a=(i=this.destination)===null||i===void 0?void 0:i.error)===null||a===void 0||a.call(i,r)},e.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},e.prototype._subscribe=function(r){var i,a;return(a=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&a!==void 0?a:zn},e}(Wn),Bn=function(t){Re(e,t);function e(r){var i=t.call(this)||this;return i._value=r,i}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var i=t.prototype._subscribe.call(this,r);return!i.closed&&r.next(this._value),i},e.prototype.getValue=function(){var r=this,i=r.hasError,a=r.thrownError,c=r._value;if(i)throw a;return this._throwIfClosed(),c},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(Wn),Et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var or={exports:{}};or.exports,function(t,e){var r=200,i="__lodash_hash_undefined__",a=1,c=2,d=9007199254740991,f="[object Arguments]",b="[object Array]",v="[object AsyncFunction]",T="[object Boolean]",w="[object Date]",m="[object Error]",A="[object Function]",x="[object GeneratorFunction]",u="[object Map]",l="[object Number]",k="[object Null]",E="[object Object]",S="[object Promise]",h="[object Proxy]",y="[object RegExp]",_="[object Set]",g="[object String]",O="[object Symbol]",I="[object Undefined]",P="[object WeakMap]",C="[object ArrayBuffer]",H="[object DataView]",U="[object Float32Array]",L="[object Float64Array]",N="[object Int8Array]",J="[object Int16Array]",Tt="[object Int32Array]",Pt="[object Uint8Array]",xt="[object Uint8ClampedArray]",Y="[object Uint16Array]",zt="[object Uint32Array]",wt=/[\\^$.*+?()[\]{}|]/g,lt=/^\[object .+?Constructor\]$/,$t=/^(?:0|[1-9]\d*)$/,D={};D[U]=D[L]=D[N]=D[J]=D[Tt]=D[Pt]=D[xt]=D[Y]=D[zt]=!0,D[f]=D[b]=D[C]=D[T]=D[H]=D[w]=D[m]=D[A]=D[u]=D[l]=D[E]=D[y]=D[_]=D[g]=D[P]=!1;var nt=typeof Et=="object"&&Et&&Et.Object===Object&&Et,Mt=typeof self=="object"&&self&&self.Object===Object&&self,dt=nt||Mt||Function("return this")(),Ht=e&&!e.nodeType&&e,At=Ht&&!0&&t&&!t.nodeType&&t,qt=At&&At.exports===Ht,Jt=qt&&nt.process,pe=function(){try{return Jt&&Jt.binding&&Jt.binding("util")}catch{}}(),Zt=pe&&pe.isTypedArray;function he(n,s){for(var o=-1,p=n==null?0:n.length,$=0,R=[];++o<p;){var W=n[o];s(W,o,n)&&(R[$++]=W)}return R}function Qt(n,s){for(var o=-1,p=s.length,$=n.length;++o<p;)n[$+o]=s[o];return n}function me(n,s){for(var o=-1,p=n==null?0:n.length;++o<p;)if(s(n[o],o,n))return!0;return!1}function Te(n,s){for(var o=-1,p=Array(n);++o<n;)p[o]=s(o);return p}function we(n){return function(s){return n(s)}}function jt(n,s){return n.has(s)}function te(n,s){return n==null?void 0:n[s]}function z(n){var s=-1,o=Array(n.size);return n.forEach(function(p,$){o[++s]=[$,p]}),o}function j(n,s){return function(o){return n(s(o))}}function F(n){var s=-1,o=Array(n.size);return n.forEach(function(p){o[++s]=p}),o}var at=Array.prototype,ft=Function.prototype,K=Object.prototype,pt=dt["__core-js_shared__"],Z=ft.toString,It=K.hasOwnProperty,Me=function(){var n=/[^.]+$/.exec(pt&&pt.keys&&pt.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),ye=K.toString,We=RegExp("^"+Z.call(It).replace(wt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),X=qt?dt.Buffer:void 0,gt=dt.Symbol,ee=dt.Uint8Array,re=K.propertyIsEnumerable,Dt=at.splice,Ot=gt?gt.toStringTag:void 0,Ae=Object.getOwnPropertySymbols,Xe=X?X.isBuffer:void 0,Ie=j(Object.keys,Object),Be=Yt(dt,"DataView"),ge=Yt(dt,"Map"),Ke=Yt(dt,"Promise"),Ve=Yt(dt,"Set"),qe=Yt(dt,"WeakMap"),ne=Yt(Object,"create"),mr=bt(Be),Ut=bt(ge),Qr=bt(Ke),tn=bt(Ve),en=bt(qe),yr=gt?gt.prototype:void 0,Je=yr?yr.valueOf:void 0;function ot(n){var s=-1,o=n==null?0:n.length;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function rn(){this.__data__=ne?ne(null):{},this.size=0}function nn(n){var s=this.has(n)&&delete this.__data__[n];return this.size-=s?1:0,s}function sn(n){var s=this.__data__;if(ne){var o=s[n];return o===i?void 0:o}return It.call(s,n)?s[n]:void 0}function an(n){var s=this.__data__;return ne?s[n]!==void 0:It.call(s,n)}function on(n,s){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=ne&&s===void 0?i:s,this}ot.prototype.clear=rn,ot.prototype.delete=nn,ot.prototype.get=sn,ot.prototype.has=an,ot.prototype.set=on;function ht(n){var s=-1,o=n==null?0:n.length;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function cn(){this.__data__=[],this.size=0}function un(n){var s=this.__data__,o=Ce(s,n);if(o<0)return!1;var p=s.length-1;return o==p?s.pop():Dt.call(s,o,1),--this.size,!0}function ln(n){var s=this.__data__,o=Ce(s,n);return o<0?void 0:s[o][1]}function dn(n){return Ce(this.__data__,n)>-1}function fn(n,s){var o=this.__data__,p=Ce(o,n);return p<0?(++this.size,o.push([n,s])):o[p][1]=s,this}ht.prototype.clear=cn,ht.prototype.delete=un,ht.prototype.get=ln,ht.prototype.has=dn,ht.prototype.set=fn;function _t(n){var s=-1,o=n==null?0:n.length;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function pn(){this.size=0,this.__data__={hash:new ot,map:new(ge||ht),string:new ot}}function hn(n){var s=Ct(this,n).delete(n);return this.size-=s?1:0,s}function mn(n){return Ct(this,n).get(n)}function yn(n){return Ct(this,n).has(n)}function In(n,s){var o=Ct(this,n),p=o.size;return o.set(n,s),this.size+=o.size==p?0:1,this}_t.prototype.clear=pn,_t.prototype.delete=hn,_t.prototype.get=mn,_t.prototype.has=yn,_t.prototype.set=In;function De(n){var s=-1,o=n==null?0:n.length;for(this.__data__=new _t;++s<o;)this.add(n[s])}function Ir(n){return this.__data__.set(n,i),this}function Oe(n){return this.__data__.has(n)}De.prototype.add=De.prototype.push=Ir,De.prototype.has=Oe;function Rt(n){var s=this.__data__=new ht(n);this.size=s.size}function Ze(){this.__data__=new ht,this.size=0}function gn(n){var s=this.__data__,o=s.delete(n);return this.size=s.size,o}function bn(n){return this.__data__.get(n)}function _n(n){return this.__data__.has(n)}function vn(n,s){var o=this.__data__;if(o instanceof ht){var p=o.__data__;if(!ge||p.length<r-1)return p.push([n,s]),this.size=++o.size,this;o=this.__data__=new _t(p)}return o.set(n,s),this.size=o.size,this}Rt.prototype.clear=Ze,Rt.prototype.delete=gn,Rt.prototype.get=bn,Rt.prototype.has=_n,Rt.prototype.set=vn;function Sn(n,s){var o=Pe(n),p=!o&&Sr(n),$=!o&&!p&&xe(n),R=!o&&!p&&!$&&Tr(n),W=o||p||$||R,G=W?Te(n.length,String):[],Q=G.length;for(var V in n)It.call(n,V)&&!(W&&(V=="length"||$&&(V=="offset"||V=="parent")||R&&(V=="buffer"||V=="byteLength"||V=="byteOffset")||On(V,Q)))&&G.push(V);return G}function Ce(n,s){for(var o=n.length;o--;)if(vr(n[o][0],s))return o;return-1}function Qe(n,s,o){var p=s(n);return Pe(n)?p:Qt(p,o(n))}function be(n){return n==null?n===void 0?I:k:Ot&&Ot in Object(n)?Gt(n):_r(n)}function gr(n){return Ft(n)&&be(n)==f}function br(n,s,o,p,$){return n===s?!0:n==null||s==null||!Ft(n)&&!Ft(s)?n!==n&&s!==s:kn(n,s,o,p,br,$)}function kn(n,s,o,p,$,R){var W=Pe(n),G=Pe(s),Q=W?b:Lt(n),V=G?b:Lt(s);Q=Q==f?E:Q,V=V==f?E:V;var mt=Q==E,vt=V==E,rt=Q==V;if(rt&&xe(n)){if(!xe(s))return!1;W=!0,mt=!1}if(rt&&!mt)return R||(R=new Rt),W||Tr(n)?tr(n,s,o,p,$,R):Mn(n,s,Q,o,p,$,R);if(!(o&a)){var yt=mt&&It.call(n,"__wrapped__"),ct=vt&&It.call(s,"__wrapped__");if(yt||ct){var ie=yt?n.value():n,Wt=ct?s.value():s;return R||(R=new Rt),$(ie,Wt,o,p,R)}}return rt?(R||(R=new Rt),An(n,s,o,p,$,R)):!1}function En(n){if(!Er(n)||Pn(n))return!1;var s=kr(n)?We:lt;return s.test(bt(n))}function Tn(n){return Ft(n)&&rr(n.length)&&!!D[be(n)]}function wn(n){if(!xn(n))return Ie(n);var s=[];for(var o in Object(n))It.call(n,o)&&o!="constructor"&&s.push(o);return s}function tr(n,s,o,p,$,R){var W=o&a,G=n.length,Q=s.length;if(G!=Q&&!(W&&Q>G))return!1;var V=R.get(n);if(V&&R.get(s))return V==s;var mt=-1,vt=!0,rt=o&c?new De:void 0;for(R.set(n,s),R.set(s,n);++mt<G;){var yt=n[mt],ct=s[mt];if(p)var ie=W?p(ct,yt,mt,s,n,R):p(yt,ct,mt,n,s,R);if(ie!==void 0){if(ie)continue;vt=!1;break}if(rt){if(!me(s,function(Wt,ve){if(!jt(rt,ve)&&(yt===Wt||$(yt,Wt,o,p,R)))return rt.push(ve)})){vt=!1;break}}else if(!(yt===ct||$(yt,ct,o,p,R))){vt=!1;break}}return R.delete(n),R.delete(s),vt}function Mn(n,s,o,p,$,R,W){switch(o){case H:if(n.byteLength!=s.byteLength||n.byteOffset!=s.byteOffset)return!1;n=n.buffer,s=s.buffer;case C:return!(n.byteLength!=s.byteLength||!R(new ee(n),new ee(s)));case T:case w:case l:return vr(+n,+s);case m:return n.name==s.name&&n.message==s.message;case y:case g:return n==s+"";case u:var G=z;case _:var Q=p&a;if(G||(G=F),n.size!=s.size&&!Q)return!1;var V=W.get(n);if(V)return V==s;p|=c,W.set(n,s);var mt=tr(G(n),G(s),p,$,R,W);return W.delete(n),mt;case O:if(Je)return Je.call(n)==Je.call(s)}return!1}function An(n,s,o,p,$,R){var W=o&a,G=_e(n),Q=G.length,V=_e(s),mt=V.length;if(Q!=mt&&!W)return!1;for(var vt=Q;vt--;){var rt=G[vt];if(!(W?rt in s:It.call(s,rt)))return!1}var yt=R.get(n);if(yt&&R.get(s))return yt==s;var ct=!0;R.set(n,s),R.set(s,n);for(var ie=W;++vt<Q;){rt=G[vt];var Wt=n[rt],ve=s[rt];if(p)var es=W?p(ve,Wt,rt,s,n,R):p(Wt,ve,rt,n,s,R);if(!(es===void 0?Wt===ve||$(Wt,ve,o,p,R):es)){ct=!1;break}ie||(ie=rt=="constructor")}if(ct&&!ie){var wr=n.constructor,Mr=s.constructor;wr!=Mr&&"constructor"in n&&"constructor"in s&&!(typeof wr=="function"&&wr instanceof wr&&typeof Mr=="function"&&Mr instanceof Mr)&&(ct=!1)}return R.delete(n),R.delete(s),ct}function _e(n){return Qe(n,nr,Dn)}function Ct(n,s){var o=n.__data__;return Cn(s)?o[typeof s=="string"?"string":"hash"]:o.map}function Yt(n,s){var o=te(n,s);return En(o)?o:void 0}function Gt(n){var s=It.call(n,Ot),o=n[Ot];try{n[Ot]=void 0;var p=!0}catch{}var $=ye.call(n);return p&&(s?n[Ot]=o:delete n[Ot]),$}var Dn=Ae?function(n){return n==null?[]:(n=Object(n),he(Ae(n),function(s){return re.call(n,s)}))}:Ln,Lt=be;(Be&&Lt(new Be(new ArrayBuffer(1)))!=H||ge&&Lt(new ge)!=u||Ke&&Lt(Ke.resolve())!=S||Ve&&Lt(new Ve)!=_||qe&&Lt(new qe)!=P)&&(Lt=function(n){var s=be(n),o=s==E?n.constructor:void 0,p=o?bt(o):"";if(p)switch(p){case mr:return H;case Ut:return u;case Qr:return S;case tn:return _;case en:return P}return s});function On(n,s){return s=s??d,!!s&&(typeof n=="number"||$t.test(n))&&n>-1&&n%1==0&&n<s}function Cn(n){var s=typeof n;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?n!=="__proto__":n===null}function Pn(n){return!!Me&&Me in n}function xn(n){var s=n&&n.constructor,o=typeof s=="function"&&s.prototype||K;return n===o}function _r(n){return ye.call(n)}function bt(n){if(n!=null){try{return Z.call(n)}catch{}try{return n+""}catch{}}return""}function vr(n,s){return n===s||n!==n&&s!==s}var Sr=gr(function(){return arguments}())?gr:function(n){return Ft(n)&&It.call(n,"callee")&&!re.call(n,"callee")},Pe=Array.isArray;function er(n){return n!=null&&rr(n.length)&&!kr(n)}var xe=Xe||Fn;function Rn(n,s){return br(n,s)}function kr(n){if(!Er(n))return!1;var s=be(n);return s==A||s==x||s==v||s==h}function rr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=d}function Er(n){var s=typeof n;return n!=null&&(s=="object"||s=="function")}function Ft(n){return n!=null&&typeof n=="object"}var Tr=Zt?we(Zt):Tn;function nr(n){return er(n)?Sn(n):wn(n)}function Ln(){return[]}function Fn(){return!1}t.exports=Rn}(or,or.exports);var hs=or.exports;const tt=Rr(hs),ms="add",Kn="track",Vn="trackItems",ys=`${Kn}:changed`,Is=`${Vn}:changed`,qn="state",gs=`${qn}:changed`,cr="design",Jn=`${cr}:load`,Zn=`${cr}:resize`,ut="add",Qn=`${ut}:text`,ti=`${ut}:video`,ei=`${ut}:audio`,bs=`${ut}:placeholder`,ri=`${ut}:image`,ni=`${ut}:illustration`,ii=`${ut}:shape`,_s=`${ut}:mask`,vs=`${ut}:transition`,si=`${ut}:animation`,ai=`${ut}:caption`,oi=`${ut}:template`,ci=`${ut}:items`,ui=`${ut}:composition`,Bt="edit",li=`${Bt}:object`,di=`${Bt}:replaceMedia`,Ss=`${Bt}:text`,ks=`${Bt}:shape`,Es=`${Bt}:templateItem`,Ts=`${Bt}:deleteTemplateItem`,ws="enterEditMode",se="active",Ms=`${se}:set`,As=`${se}:delete`,fi=`${se}:paste`,pi=`${se}:clone`,hi=`${se}:split`,it="layer",Ds=`${it}:locked`,Os=`${it}:hidden`,Cs=`${it}:move`,Ps=`${it}:select`,xs=`${it}:selection`,Rs=`${it}:sendTo`,Ls=`${it}:rename`,Fs=`${it}:editingName`,Ns=`${it}:copy`,zs=`${it}:paste`,mi=`${it}:clone`,$s=`${it}:split`,Hs=`${it}:cut`,yi=`${it}:delete`,Ii=`${it}:replace`,Le="history",gi=`${Le}:undo`,bi=`${Le}:redo`,js=`${Le}:reset`,Lr="scale",_i=`${Lr}:changed`;var ur={exports:{}};ur.exports,function(t,e){var r=200,i="__lodash_hash_undefined__",a=9007199254740991,c="[object Arguments]",d="[object Array]",f="[object Boolean]",b="[object Date]",v="[object Error]",T="[object Function]",w="[object GeneratorFunction]",m="[object Map]",A="[object Number]",x="[object Object]",u="[object Promise]",l="[object RegExp]",k="[object Set]",E="[object String]",S="[object Symbol]",h="[object WeakMap]",y="[object ArrayBuffer]",_="[object DataView]",g="[object Float32Array]",O="[object Float64Array]",I="[object Int8Array]",P="[object Int16Array]",C="[object Int32Array]",H="[object Uint8Array]",U="[object Uint8ClampedArray]",L="[object Uint16Array]",N="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,Tt=/\w*$/,Pt=/^\[object .+?Constructor\]$/,xt=/^(?:0|[1-9]\d*)$/,Y={};Y[c]=Y[d]=Y[y]=Y[_]=Y[f]=Y[b]=Y[g]=Y[O]=Y[I]=Y[P]=Y[C]=Y[m]=Y[A]=Y[x]=Y[l]=Y[k]=Y[E]=Y[S]=Y[H]=Y[U]=Y[L]=Y[N]=!0,Y[v]=Y[T]=Y[h]=!1;var zt=typeof Et=="object"&&Et&&Et.Object===Object&&Et,wt=typeof self=="object"&&self&&self.Object===Object&&self,lt=zt||wt||Function("return this")(),$t=e&&!e.nodeType&&e,D=$t&&!0&&t&&!t.nodeType&&t,nt=D&&D.exports===$t;function Mt(n,s){return n.set(s[0],s[1]),n}function dt(n,s){return n.add(s),n}function Ht(n,s){for(var o=-1,p=n?n.length:0;++o<p&&s(n[o],o,n)!==!1;);return n}function At(n,s){for(var o=-1,p=s.length,$=n.length;++o<p;)n[$+o]=s[o];return n}function qt(n,s,o,p){for(var $=-1,R=n?n.length:0;++$<R;)o=s(o,n[$],$,n);return o}function Jt(n,s){for(var o=-1,p=Array(n);++o<n;)p[o]=s(o);return p}function pe(n,s){return n==null?void 0:n[s]}function Zt(n){var s=!1;if(n!=null&&typeof n.toString!="function")try{s=!!(n+"")}catch{}return s}function he(n){var s=-1,o=Array(n.size);return n.forEach(function(p,$){o[++s]=[$,p]}),o}function Qt(n,s){return function(o){return n(s(o))}}function me(n){var s=-1,o=Array(n.size);return n.forEach(function(p){o[++s]=p}),o}var Te=Array.prototype,we=Function.prototype,jt=Object.prototype,te=lt["__core-js_shared__"],z=function(){var n=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),j=we.toString,F=jt.hasOwnProperty,at=jt.toString,ft=RegExp("^"+j.call(F).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),K=nt?lt.Buffer:void 0,pt=lt.Symbol,Z=lt.Uint8Array,It=Qt(Object.getPrototypeOf,Object),Me=Object.create,ye=jt.propertyIsEnumerable,We=Te.splice,X=Object.getOwnPropertySymbols,gt=K?K.isBuffer:void 0,ee=Qt(Object.keys,Object),re=Ct(lt,"DataView"),Dt=Ct(lt,"Map"),Ot=Ct(lt,"Promise"),Ae=Ct(lt,"Set"),Xe=Ct(lt,"WeakMap"),Ie=Ct(Object,"create"),Be=bt(re),ge=bt(Dt),Ke=bt(Ot),Ve=bt(Ae),qe=bt(Xe),ne=pt?pt.prototype:void 0,mr=ne?ne.valueOf:void 0;function Ut(n){var s=-1,o=n?n.length:0;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function Qr(){this.__data__=Ie?Ie(null):{}}function tn(n){return this.has(n)&&delete this.__data__[n]}function en(n){var s=this.__data__;if(Ie){var o=s[n];return o===i?void 0:o}return F.call(s,n)?s[n]:void 0}function yr(n){var s=this.__data__;return Ie?s[n]!==void 0:F.call(s,n)}function Je(n,s){var o=this.__data__;return o[n]=Ie&&s===void 0?i:s,this}Ut.prototype.clear=Qr,Ut.prototype.delete=tn,Ut.prototype.get=en,Ut.prototype.has=yr,Ut.prototype.set=Je;function ot(n){var s=-1,o=n?n.length:0;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function rn(){this.__data__=[]}function nn(n){var s=this.__data__,o=Oe(s,n);if(o<0)return!1;var p=s.length-1;return o==p?s.pop():We.call(s,o,1),!0}function sn(n){var s=this.__data__,o=Oe(s,n);return o<0?void 0:s[o][1]}function an(n){return Oe(this.__data__,n)>-1}function on(n,s){var o=this.__data__,p=Oe(o,n);return p<0?o.push([n,s]):o[p][1]=s,this}ot.prototype.clear=rn,ot.prototype.delete=nn,ot.prototype.get=sn,ot.prototype.has=an,ot.prototype.set=on;function ht(n){var s=-1,o=n?n.length:0;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function cn(){this.__data__={hash:new Ut,map:new(Dt||ot),string:new Ut}}function un(n){return _e(this,n).delete(n)}function ln(n){return _e(this,n).get(n)}function dn(n){return _e(this,n).has(n)}function fn(n,s){return _e(this,n).set(n,s),this}ht.prototype.clear=cn,ht.prototype.delete=un,ht.prototype.get=ln,ht.prototype.has=dn,ht.prototype.set=fn;function _t(n){this.__data__=new ot(n)}function pn(){this.__data__=new ot}function hn(n){return this.__data__.delete(n)}function mn(n){return this.__data__.get(n)}function yn(n){return this.__data__.has(n)}function In(n,s){var o=this.__data__;if(o instanceof ot){var p=o.__data__;if(!Dt||p.length<r-1)return p.push([n,s]),this;o=this.__data__=new ht(p)}return o.set(n,s),this}_t.prototype.clear=pn,_t.prototype.delete=hn,_t.prototype.get=mn,_t.prototype.has=yn,_t.prototype.set=In;function De(n,s){var o=er(n)||Pe(n)?Jt(n.length,String):[],p=o.length,$=!!p;for(var R in n)F.call(n,R)&&!($&&(R=="length"||Cn(R,p)))&&o.push(R);return o}function Ir(n,s,o){var p=n[s];(!(F.call(n,s)&&Sr(p,o))||o===void 0&&!(s in n))&&(n[s]=o)}function Oe(n,s){for(var o=n.length;o--;)if(Sr(n[o][0],s))return o;return-1}function Rt(n,s){return n&&tr(s,nr(s),n)}function Ze(n,s,o,p,$,R,W){var G;if(p&&(G=R?p(n,$,R,W):p(n)),G!==void 0)return G;if(!Ft(n))return n;var Q=er(n);if(Q){if(G=Dn(n),!s)return wn(n,G)}else{var V=Gt(n),mt=V==T||V==w;if(kr(n))return Ce(n,s);if(V==x||V==c||mt&&!R){if(Zt(n))return R?n:{};if(G=Lt(mt?{}:n),!s)return Mn(n,Rt(G,n))}else{if(!Y[V])return R?n:{};G=On(n,V,Ze,s)}}W||(W=new _t);var vt=W.get(n);if(vt)return vt;if(W.set(n,G),!Q)var rt=o?An(n):nr(n);return Ht(rt||n,function(yt,ct){rt&&(ct=yt,yt=n[ct]),Ir(G,ct,Ze(yt,s,o,p,ct,n,W))}),G}function gn(n){return Ft(n)?Me(n):{}}function bn(n,s,o){var p=s(n);return er(n)?p:At(p,o(n))}function _n(n){return at.call(n)}function vn(n){if(!Ft(n)||xn(n))return!1;var s=rr(n)||Zt(n)?ft:Pt;return s.test(bt(n))}function Sn(n){if(!_r(n))return ee(n);var s=[];for(var o in Object(n))F.call(n,o)&&o!="constructor"&&s.push(o);return s}function Ce(n,s){if(s)return n.slice();var o=new n.constructor(n.length);return n.copy(o),o}function Qe(n){var s=new n.constructor(n.byteLength);return new Z(s).set(new Z(n)),s}function be(n,s){var o=s?Qe(n.buffer):n.buffer;return new n.constructor(o,n.byteOffset,n.byteLength)}function gr(n,s,o){var p=s?o(he(n),!0):he(n);return qt(p,Mt,new n.constructor)}function br(n){var s=new n.constructor(n.source,Tt.exec(n));return s.lastIndex=n.lastIndex,s}function kn(n,s,o){var p=s?o(me(n),!0):me(n);return qt(p,dt,new n.constructor)}function En(n){return mr?Object(mr.call(n)):{}}function Tn(n,s){var o=s?Qe(n.buffer):n.buffer;return new n.constructor(o,n.byteOffset,n.length)}function wn(n,s){var o=-1,p=n.length;for(s||(s=Array(p));++o<p;)s[o]=n[o];return s}function tr(n,s,o,p){o||(o={});for(var $=-1,R=s.length;++$<R;){var W=s[$],G=void 0;Ir(o,W,G===void 0?n[W]:G)}return o}function Mn(n,s){return tr(n,Yt(n),s)}function An(n){return bn(n,nr,Yt)}function _e(n,s){var o=n.__data__;return Pn(s)?o[typeof s=="string"?"string":"hash"]:o.map}function Ct(n,s){var o=pe(n,s);return vn(o)?o:void 0}var Yt=X?Qt(X,Object):Ln,Gt=_n;(re&&Gt(new re(new ArrayBuffer(1)))!=_||Dt&&Gt(new Dt)!=m||Ot&&Gt(Ot.resolve())!=u||Ae&&Gt(new Ae)!=k||Xe&&Gt(new Xe)!=h)&&(Gt=function(n){var s=at.call(n),o=s==x?n.constructor:void 0,p=o?bt(o):void 0;if(p)switch(p){case Be:return _;case ge:return m;case Ke:return u;case Ve:return k;case qe:return h}return s});function Dn(n){var s=n.length,o=n.constructor(s);return s&&typeof n[0]=="string"&&F.call(n,"index")&&(o.index=n.index,o.input=n.input),o}function Lt(n){return typeof n.constructor=="function"&&!_r(n)?gn(It(n)):{}}function On(n,s,o,p){var $=n.constructor;switch(s){case y:return Qe(n);case f:case b:return new $(+n);case _:return be(n,p);case g:case O:case I:case P:case C:case H:case U:case L:case N:return Tn(n,p);case m:return gr(n,p,o);case A:case E:return new $(n);case l:return br(n);case k:return kn(n,p,o);case S:return En(n)}}function Cn(n,s){return s=s??a,!!s&&(typeof n=="number"||xt.test(n))&&n>-1&&n%1==0&&n<s}function Pn(n){var s=typeof n;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?n!=="__proto__":n===null}function xn(n){return!!z&&z in n}function _r(n){var s=n&&n.constructor,o=typeof s=="function"&&s.prototype||jt;return n===o}function bt(n){if(n!=null){try{return j.call(n)}catch{}try{return n+""}catch{}}return""}function vr(n){return Ze(n,!0,!0)}function Sr(n,s){return n===s||n!==n&&s!==s}function Pe(n){return Rn(n)&&F.call(n,"callee")&&(!ye.call(n,"callee")||at.call(n)==c)}var er=Array.isArray;function xe(n){return n!=null&&Er(n.length)&&!rr(n)}function Rn(n){return Tr(n)&&xe(n)}var kr=gt||Fn;function rr(n){var s=Ft(n)?at.call(n):"";return s==T||s==w}function Er(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=a}function Ft(n){var s=typeof n;return!!n&&(s=="object"||s=="function")}function Tr(n){return!!n&&typeof n=="object"}function nr(n){return xe(n)?De(n):Sn(n)}function Ln(){return[]}function Fn(){return!1}t.exports=vr}(ur,ur.exports);var Us=ur.exports;const B=Rr(Us),ke=t=>new Promise((e,r)=>{const i=new Image;console.warn("update cdn config for cors?"),i.onload=()=>{const a=i.width,c=i.height;e({width:a,height:c})},i.onerror=a=>{r(a)},i.crossOrigin="anonymous",i.src=t}),vi=t=>new Promise((e,r)=>{const i=new Audio;i.preload="auto",i.addEventListener("loadedmetadata",()=>{const a=i.duration*1e3;e({duration:a})}),i.addEventListener("error",a=>{r(a)}),i.src=t,i.crossOrigin="anonymous",i.load()}),Fr=t=>new Promise((e,r)=>{const i=document.createElement("video");i.preload="auto",i.addEventListener("loadedmetadata",()=>{const a=i.duration*1e3,c=i.videoWidth,d=i.videoHeight;e({duration:a,width:c,height:d})}),i.addEventListener("error",a=>{r(a)}),i.src=t,i.load()}),Ys=async t=>{var a,c;const e=t.duration,r=(a=t.details)==null?void 0:a.width,i=(c=t.details)==null?void 0:c.height;return e&&r&&i?{duration:e,width:r,height:i}:Fr(t.details.src)},Si=(t,e)=>{const r=document.createElement("div");Object.keys(e).forEach(a=>{a!=="height"&&(r.style[a]=e[a])}),document.body.appendChild(r),r.textContent=t,r.style.whiteSpace="normal",r.style.position="absolute",r.style.visibility="hidden",r.style.display="inline-block",r.style.width=e.width+"px",r.style.fontSize=e.fontSize+"px";const i=getComputedStyle(r).height;return document.body.removeChild(r),parseFloat(i)},lr=t=>{const e=t.map(r=>new FontFace(r.fontFamily,`url(${r.url})`).load().catch(i=>i));return e.length===0?Promise.resolve(!0):new Promise((r,i)=>{Promise.all(e).then(a=>{a.forEach(c=>{c&&c.family&&(document.fonts.add(c),r(!0))})}).catch(a=>i(a))})},Gs="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Fe=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Gs[r[t]&63];return e};function Ee(t=16){const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r=e.charAt(Math.floor(Math.random()*e.length));let i=Fe(t-1);return i=i.replace(/[^a-zA-Z0-9]/g,"").slice(0,t-1),r+i}function Ws(t){const e=/#([0-9a-fA-F]{3,6})\b/g,r=/rgb\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)/g,i=/rgba\(\s*(\d+),\s*(\d+),\s*(\d+),\s*([0-9.]+)\s*\)/g;function a(d){return d.length===3?`#${d[0]}${d[0]}${d[1]}${d[1]}${d[2]}${d[2]}`.toUpperCase():`#${d.toUpperCase()}`}function c(d,f,b){return`#${(1<<24|d<<16|f<<8|b).toString(16).slice(1).toUpperCase()}`}return t=t.replace(e,(d,f)=>a(f)),t=t.replace(r,(d,f,b,v)=>c(+f,+b,+v)),t=t.replace(i,(d,f,b,v)=>c(+f,+b,+v)),t}function st(t){return/^#[0-9a-fA-F]{3}$/.test(t)?"#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]:t}function ki(t,e){let r=t;for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const a=new RegExp(i,"g");r=r.replace(a,e[i])}return r}function Ei(t){const e=t.getAttribute("fill");if(e&&e.trim()!==""&&e.trim()!=="none")return e.trim();const r=t.getAttribute("style");if(r){const a=/fill\s*:\s*([^;]+);?/.exec(r);if(a){const c=a[1].trim();if(c!==""&&c!=="none")return c}}const i=t.parentElement;return i?Ei(i):null}function Ne(t){return/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(t)}const Xs=t=>{const e=`.${t.split(".").filter(c=>c.includes("fill:")).join(".")}`,r={},i=/\.([\w-]+)\s*\{\s*([^}]+)\s*\}/g;let a;for(;(a=i.exec(e))!==null;){const c=a[1],d=a[2],f={},b=/fill\s*:\s*([^;]+);?/.exec(d),v=/stroke\s*:\s*([^;]+);?/.exec(d);b&&(f.fill=st(b[1].trim())),v&&(f.stroke=st(v[1].trim())),r[c]=f}return r};function Nr(t){let e=t.parentElement;for(;e;){if(e.tagName.toLowerCase()==="mask")return!0;e=e.parentElement}return!1}function Bs(t,e,r=300,i=300){const a=[],d=new DOMParser().parseFromString(t,"image/svg+xml"),f=d.documentElement;f.setAttribute("width",`${r}`),f.setAttribute("height",`${i}`);const b=f.querySelectorAll("style"),v={};b.forEach(u=>{const l=u.textContent||"",k=Xs(l);Object.assign(v,k);const E=l.replace(/\.(st[\w-]+)/g,`.${e}-$1`).replace(/url\(#(.*?)\)/g,`url(#${e}-$1)`);u.textContent=E;const S=Array.from(d.querySelectorAll("*")),h=new Set;S.forEach(y=>{if(Nr(y))return;["fill","stroke","stop-color"].forEach(O=>{const I=y.getAttribute(O);I&&!["none","transparent"].includes(I)&&h.add(st(I))});const _=y.getAttribute("style");if(_){const O=/fill\s*:\s*([^;]+);?/.exec(_),I=/stroke\s*:\s*([^;]+);?/.exec(_),P=/stop-color\s*:\s*([^;]+);?/.exec(_);if(O){const C=O[1].trim();C&&!["none","transparent"].includes(C)&&Ne(st(C))&&h.add(st(C))}if(I){const C=I[1].trim();C&&!["none","transparent"].includes(C)&&Ne(st(C))&&h.add(st(C))}if(P){const C=P[1].trim();C&&!["none","transparent"].includes(C)&&Ne(st(C))&&h.add(st(C))}}const g=y.getAttribute("class");g&&g.split(" ").forEach(O=>{const I=v[O];I!=null&&I.fill&&!["none","transparent"].includes(I.fill)&&h.add(st(I.fill)),I!=null&&I.stroke&&!["none","transparent"].includes(I.stroke)&&h.add(st(I.stroke))})}),Array.from(h).forEach(y=>{Ne(y)&&a.push(y)})});const T=Array.from(d.querySelectorAll("*")),w=new Set;return T.forEach(u=>{if(Nr(u))return;const l=u.getAttribute("class");if(l){const E=l.split(" ").map(S=>`${e}-${S}`).join(" ");u.setAttribute("class",E),E.split(" ").forEach(S=>{const h=v[S];h!=null&&h.fill&&!["none","transparent"].includes(h.fill)&&w.add(st(h.fill)),h!=null&&h.stroke&&!["none","transparent"].includes(h.stroke)&&w.add(st(h.stroke))})}["fill","stroke","stop-color"].forEach(E=>{const S=u.getAttribute(E);S&&!["none","transparent"].includes(S)&&w.add(st(S))});const k=u.getAttribute("style");if(k){const E=/fill\s*:\s*([^;]+);?/.exec(k),S=/stroke\s*:\s*([^;]+);?/.exec(k),h=/stop-color\s*:\s*([^;]+);?/.exec(k);if(E){const y=E[1].trim();y&&!["none","transparent"].includes(y)&&w.add(st(y))}if(S){const y=S[1].trim();y&&!["none","transparent"].includes(y)&&w.add(st(y))}if(h){const y=h[1].trim();y&&!["none","transparent"].includes(y)&&w.add(st(y))}}}),w.forEach(u=>!a.includes(u)&&Ne(u)&&a.push(u)),Array.from(d.querySelectorAll("*")).forEach(u=>{if(u.hasAttribute("id")){const l=u.getAttribute("id");u.setAttribute("id",`${e}-${l}`)}if(["fill","stroke","stop-color","filter","clip-path","mask"].forEach(l=>{const k=u.getAttribute(l);k&&k.includes("url(#")&&u.setAttribute(l,k.replace(/url\(#(.*?)\)/g,`url(#${e}-$1)`))}),u.hasAttribute("style")){const l=u.getAttribute("style");l.includes("url(#")&&u.setAttribute("style",l.replace(/url\(#(.*?)\)/g,`url(#${e}-$1)`))}}),Array.from(d.querySelectorAll("path")).forEach(u=>{if(Nr(u))return;!Ei(u)&&!u.getAttribute("class")&&(u.setAttribute("fill","#000000"),a.includes("#000000")||a.push("#000000"))}),{serializer:new XMLSerializer().serializeToString(d),colors:a}}const dr={color:"#000000",x:0,y:0,blur:0},ae=(t,e)=>{let r=e!=null&&e.trim?e.trim.to-e.trim.from:(e==null?void 0:e.duration)||5e3;const i={from:0,to:r};if(!t)return i;if(t.from<0)return console.error("'from' must be a non-negative number. Returning default display."),i;if(t.from!==void 0&&t.to===void 0)return{from:t.from,to:t.from+r};if(t.to!==void 0){if(t.to<0)return console.error("'to' must be a non-negative number. Returning default display."),i;if(t.to<t.from)return console.error("'to' must be greater than or equal to 'from'. Returning default display."),i}return t},Ti=(t,e)=>t?t.from&&!t.to?{from:t.from,to:e.duration}:t:{from:0,to:e.duration};function Kt(t,e){const r=t.scaleMode,i={x:t.size.width/2,y:t.size.height/2},a={x:e.width/2,y:e.height/2};let c;r==="fill"?c=Math.max(t.size.width/e.width,t.size.height/e.height):c=Math.min(t.size.width/e.width,t.size.height/e.height);const d=i.x-a.x;return{top:`${i.y-a.y}px`,left:`${d}px`,transform:`scale(${c})`}}const wi=async(t,e)=>{const r=t.details.src,i=await Ys(t),a=Kt(e,{...i}),c=Ti(t.trim,{duration:i.duration}),d={width:i.width,height:i.height,opacity:100,src:r,volume:t.details.volume??100,borderRadius:t.details.borderRadius??0,borderWidth:t.details.borderWidth??0,borderColor:t.details.borderColor||"#000000",boxShadow:t.details.boxShadow||dr,top:t.details.top||a.top||"0px",left:t.details.left||a.left||"0px",transform:t.details.transform||a.transform,blur:t.details.blur||0,brightness:t.details.brightness||100,flipX:t.details.flipX||!1,flipY:t.details.flipY||!1,rotate:t.details.rotate||"0deg",visibility:t.details.visibility||"visible"};return{...t,trim:c,type:"video",name:"video",details:d,playbackRate:t.playbackRate||1,display:ae(t.display,{duration:i.duration,trim:c}),duration:i.duration}},Mi=async t=>{const e=t.id,r=t.details,a=(await vi(r.src)).duration,c=Ti(t.trim,{duration:a});return{id:e,name:t.name||"audio",type:"audio",display:ae(t.display,{duration:a,trim:c}),trim:c,playbackRate:t.playbackRate||1,details:{src:r.src,volume:r.volume??100},metadata:{...t.metadata},duration:a}},Ai=async(t,e)=>{var w;const r=t.trackItemIds,i=t.size||{width:t.details.width,height:t.details.height},a=Math.min(e.size.width/i.width,e.size.height/i.height),c=((w=t.details)==null?void 0:w.rotate)||0,d=Kt(e,i),f=t.display;let b=1/0,v=0;r.forEach(m=>{const A=t.trackItemsMap[m];A.display.from<b&&(b=A.display.from),A.display.to>v&&(v=A.display.to)});const T=t.trim||t.display||{from:b,to:v};return{id:t.id,type:"template",details:{...i,top:t.details.top||d.top,left:t.details.left||d.left,scale:a,rotate:c},trim:T,display:f||{from:b,to:v},activeEdit:!1}},Ks=async(t,e)=>{var T;const r=t.trackItemIds,i=t.size||{width:t.details.width,height:t.details.height},a=Math.min(e.size.width/i.width,e.size.height/i.height),c=((T=t.details)==null?void 0:T.rotate)||0,d=Kt(e,i),f=t.display;let b=1/0,v=0;return r.forEach(w=>{const m=t.trackItemsMap[w];m.display.from<b&&(b=m.display.from),m.display.to>v&&(v=m.display.to)}),{id:t.id,type:"composition",details:{...i,top:t.details.top||d.top,left:t.details.left||d.left,scale:a,rotate:c},display:f||{from:b,to:v}}},Di=async(t,e)=>{const r=t.details,i=ke(r.src),a=fetch(r.src),[c,d]=await Promise.all([i,a]),f=await d.text(),b=Kt(e,c),{serializer:v,colors:T}=Bs(Ws(f),t.id,parseFloat(r.width||c.width),parseFloat(r.height||c.height)),w=t.details.colorMap||Object.fromEntries(T.map(m=>[m,m]));return{id:t.id,name:"illustration",type:t.type,display:ae(t.display),playbackRate:t.playbackRate||1,details:{src:r.src||"",width:r.width||c.width||100,height:r.height||c.height||100,opacity:r.opacity??100,transform:r.transform||b.transform,border:r.border||"none",borderRadius:r.borderRadius||0,top:r.top||b.top||"0px",left:r.left||b.left||"0px",borderWidth:r.borderWidth??0,borderColor:r.borderColor||"#000000",flipX:r.flipX||!1,flipY:r.flipY||!1,rotate:r.rotate||"0deg",visibility:r.visibility||"visible",svgString:v,initialSvgString:B(v),colorMap:w},metadata:t.metadata||{}}},Vs=async(t,e)=>{const r=t.details,i=ke(r.src),[a]=await Promise.all([i]),c=Kt(e,a);return{id:t.id,name:"shape",type:t.type,display:ae(t.display),playbackRate:t.playbackRate||1,details:{src:r.src||"",width:r.width||a.width||100,height:r.height||a.height||100,opacity:r.opacity??100,transform:r.transform||c.transform,border:r.border||"none",borderRadius:r.borderRadius||0,top:r.top||c.top||"0px",left:r.left||c.left||"0px",borderWidth:r.borderWidth??0,borderColor:r.borderColor||"#000000",flipX:r.flipX||!1,flipY:r.flipY||!1,rotate:r.rotate||"0deg",visibility:r.visibility||"visible",backgroundColor:r.backgroundColor||"#808080"},metadata:t.metadata||{}}},Oi=async(t,e)=>{const r=t.details,i=await ke(r.src),a=Kt(e,i);return{id:t.id,type:"image",name:"image",display:ae(t.display),playbackRate:t.playbackRate||1,details:{src:r.src||"",width:r.width||i.width||100,height:r.height||i.height||100,opacity:r.opacity??100,transform:r.transform||a.transform,border:r.border||"none",borderRadius:r.borderRadius||0,boxShadow:r.boxShadow||dr,top:r.top||a.top||"0px",left:r.left||a.left||"0px",borderWidth:r.borderWidth??0,borderColor:r.borderColor||"#000000",blur:r.blur||0,brightness:r.brightness||100,flipX:r.flipX||!1,flipY:r.flipY||!1,rotate:r.rotate||"0deg",visibility:r.visibility||"visible"},metadata:t.metadata||{}}},Ci=async(t,e)=>{const r=t;r.details.fontUrl&&await lr([{fontFamily:r.details.fontFamily,url:r.details.fontUrl}]);const i=r.id,a=r.details,c=xi(a),d=Si(r.details.text,c),f=Kt(e,{width:c.width,height:d});return{id:i,name:"caption",type:"caption",display:ae(r.display),details:{...c,text:a.text||"",height:d,fontUrl:a.fontUrl,top:c.top||f.top,left:c.left||f.left,borderWidth:a.borderWidth||0,borderColor:a.borderColor||"#000000",boxShadow:a.boxShadow||dr,words:a.words||[],appearedColor:a.appearedColor||a.color,activeColor:a.activeColor||a.color,activeFillColor:a.activeFillColor||"transparent"},metadata:t.metadata||{}}},Pi=async(t,e)=>{t.details.fontUrl&&await lr([{fontFamily:t.details.fontFamily,url:t.details.fontUrl}]);const r=t.id,i=t.details,a=xi(i),c=Si(t.details.text,a),d=Kt(e,{width:a.width,height:c});return{id:r,name:"text",type:"text",display:ae(t.display),details:{...a,text:i.text||"",height:c,fontUrl:i.fontUrl,top:a.top||d.top,left:a.left||d.left,borderWidth:i.borderWidth||0,borderColor:i.borderColor||"#000000",boxShadow:i.boxShadow||dr},metadata:{}}},xi=t=>({fontFamily:t.fontFamily||"Arial",fontSize:t.fontSize||"16px",fontWeight:t.fontWeight||"normal",fontStyle:t.fontStyle||"normal",textDecoration:t.textDecoration||"none",textAlign:t.textAlign||"left",lineHeight:t.lineHeight||"normal",letterSpacing:t.letterSpacing||"normal",wordSpacing:t.wordSpacing||"normal",color:t.color||"#ffffff",backgroundColor:t.backgroundColor||"transparent",border:t.border||"none",textShadow:t.textShadow||"none",text:t.text||"",opacity:t.opacity??100,width:t.width||300,wordWrap:t.wordWrap||"normal",wordBreak:t.wordBreak||"normal",WebkitTextStrokeColor:t.WebkitTextStrokeColor||"#ffffff",WebkitTextStrokeWidth:t.WebkitTextStrokeWidth||"0px",top:t.top,left:t.left,textTransform:t.textTransform||"none",transform:t.transform||"none",skewX:t.skewX||0,skewY:t.skewY||0}),qs=async(t,e)=>{switch(t.type){case"video":return wi(t,e||{});case"audio":return Mi(t);case"image":return Oi(t,e||{});case"text":return Pi(t,e||{});case"caption":return Ci(t,e||{});case"template":return Ai(t,{size:e==null?void 0:e.size});default:throw new Error("Unsupported track item")}};function Js(t,e){return e.some(r=>t.some(i=>i.id===r.id))}const Zs=(t=[],e=[])=>t.length===0?e.map(i=>({id:Ee(),items:[i.id],type:i.type,accepts:["text","image","video","audio","caption","template"]})):t.map(r=>({...r,items:r.items||[],accepts:["audio","video","image","text","caption","template"],type:r.type||"text",magnetic:r.magnetic||!1,static:r.static||!1,id:r.id||Ee()}));function Qs(t,e){return t.filter(i=>{if(e.forEach(a=>{i.items.includes(a)&&(i.items=i.items.filter(c=>c!==a))}),i.items.length!==0||i.static)return i})}const oe=t=>Object.keys(t).reduce((e,r)=>{const{display:i,playbackRate:a}=t[r];return Math.max(e,i.to/(a||1))},0);function zr(t,e,r){return Math.min(Math.max(t,e),r)}const ta=(t,e,r,i,a)=>{if(i===void 0&&a===void 0)return{trackId:void 0,trackIndex:void 0};const c=a!==void 0?e[zr(a,0,e.length)]:e.find(b=>b.id===i);if(!c)return{trackId:void 0,trackIndex:a!==void 0?zr(a,0,e.length):void 0};const d=c.items.map(b=>r[b]),f=t.map(b=>r[b]);for(const b of d){const v=b.display.from,T=b.display.to;for(const w of f){const m=w.display.from;if(!(w.display.to<=v||m>=T))return{trackId:void 0,trackIndex:e.indexOf(c)}}}return{trackId:c.id,trackIndex:e.indexOf(c)}},Ri=(t,e)=>{var f,b;const r=((f=t.details.crop)==null?void 0:f.width)||t.details.width||0,i=((b=t.details.crop)==null?void 0:b.height)||t.details.height||0;let a=e.width,c=e.height;const d=e.width/e.height;return r/i>d?(a=r,c=r/d):(c=i,a=i*d),{newWidth:a,newHeight:c,crop:{x:0,y:0,height:i,width:r}}},Li=(t,e)=>{const r=B(t.trim),i=B(t.display);return e.duration<t.display.to&&(i.to=e.duration,r&&(r.to=e.duration)),{duration:e.duration,trim:r,display:i}},ea=t=>{const{trackItemIds:e,transitionsMap:r,trackItemsMap:i}=t,a=new Map;Object.values(r).forEach(v=>{var A,x;const{fromId:T,toId:w,kind:m}=v;m!=="none"&&(a.has(T)||a.set(T,[]),a.has(w)||a.set(w,[]),(A=a.get(T))==null||A.push(v),(x=a.get(w))==null||x.push(v))});const c=[],d=new Set,f=v=>{const T=[];let w=v;for(;w&&!d.has(w);){d.add(w);const m=i[w];T.push(m);const A=Object.values(r).find(x=>x.fromId===w&&x.kind!=="none");if(!A)break;T.push(A),w=A.toId}return T},b=Object.values(r).filter(v=>v.kind!=="none");for(const v of e)if(!d.has(v)&&(!a.has(v)||!b.some(T=>T.toId===v))){const T=f(v);T.length>0&&c.push(T)}return c.forEach(v=>{v.sort((T,w)=>"display"in T&&"display"in w?T.display.from-w.display.from:0)}),c.filter(v=>v.filter(w=>w!==void 0).length>0)};function Fi(t,e,r){t.forEach(i=>{const d=Object.values(e).filter(v=>i.items.includes(v.id)).sort((v,T)=>v.display.from-T.display.from).map(v=>v.id),f=ea({trackItemIds:d,transitionsMap:r,trackItemsMap:e});let b=0;d.forEach(v=>{const T=[];for(const m of f)if(m.find(A=>A.id===v)){const A=f.findIndex(x=>x.find(u=>u.id===v));if(A-1>=0)for(let x=A-1;x>=0;x--){const u=f[x];T.push(u)}}let w=0;if(T.forEach(m=>{m.forEach(A=>{A.type==="transition"&&(w+=A.duration)})}),e[v]){const m=e[v].display.to-e[v].display.from;e[v].display={from:b-w,to:b+m-w},b+=m}})})}function ra(t,e){let i=e.reduce((a,c)=>c.display.to>a.display.to?c:a,{display:{to:0}}).display.to;t.forEach(a=>{const c=a.display.from,f=a.display.to-c;a.display.from=i,a.display.to=a.display.from+f,i=a.display.to})}function na(t){const e=t,r=e.tracks,i=e.trackItemsMap,a=[],c={},d=e.structure;return r.forEach(f=>{var v;const b=f.items.map(T=>i[T]).sort((T,w)=>T.display.from-w.display.from);for(let T=0;T<b.length-1;T++){const w=b[T],m=b[T+1];if(Math.abs(w.display.to-m.display.from)<=1){const A=`${w.id}-${m.id}`;if((v=e.transitionIds)==null?void 0:v.includes(A))c[A]=e.transitionsMap[A];else{const u={id:A,duration:1500,fromId:w.id,toId:m.id,kind:"none",trackId:f.id,type:"transition"};c[A]=u}a.push(A)}}}),d.forEach(f=>{f.transitions.forEach(b=>{c[b]={...e.transitionsMap[b],trackId:f.id}})}),e.transitionIds=a,e.transitionsMap=c,{transitionIds:a,transitionsMap:c}}function ia(t,e,r){const i=t.toId,a=r[i],c=e.find(d=>d.items.includes(i));c&&(c.magnetic||c.items.forEach(d=>{const f=r[d];f.display.from>a.display.from&&(f.display.from=f.display.from+t.duration,f.display.to=f.display.to+t.duration)}))}function sa(t){const e=q.subject.pipe(q.filter(({key:u})=>u.startsWith(cr))),r=q.subject.pipe(q.filter(({key:u})=>u.startsWith(ut))),i=q.subject.pipe(q.filter(({key:u})=>u.startsWith(it))),a=q.subject.pipe(q.filter(({key:u})=>u.startsWith(Le))),c=q.subject.pipe(q.filter(({key:u})=>u.startsWith(se))),d=q.subject.pipe(q.filter(({key:u})=>u.startsWith(Bt))),f=q.subject.pipe(q.filter(({key:u})=>u.startsWith(Lr))),b=e.subscribe(async u=>{var l,k;if(u.key===Jn){const E=(l=u.value)==null?void 0:l.payload,S=E.trackItemsMap,h=E.trackItemDetailsMap;console.warn("IMPROVE FONTS LOADING");for(const _ in h)if(h[_].type==="text"||h[_].type==="caption"){const g=h[_].details;await lr([{fontFamily:g.fontFamily,url:g.fontUrl}])}else if(h[_].type==="illustration"){const g=S[_],O=h[_].details,I=await Di({...g,details:O},{size:{width:O.width,height:O.height}}),P=ki(I.details.svgString,O.colorMap);I.details.svgString=P,h[_].details=I.details,S[_]=I}const y=oe(S);t.updateState({...E,duration:y},{kind:"design:load",updateHistory:!1})}if(u.key===Zn){const E=(k=u.value)==null?void 0:k.payload;t.updateState({size:E},{kind:"design:resize",updateHistory:!1})}}),v=a.subscribe(u=>{if(u.key===gi)return t.undo();if(u.key===bi)return t.redo()}),T=f.subscribe(u=>{var l;if(u.key===_i){const k=(l=u.value)==null?void 0:l.payload.scale;t.updateState({scale:k},{kind:"update",updateHistory:!1})}}),w=i.subscribe(async u=>{var k,E,S,h,y;const l=[];if((k=u.value)!=null&&k.payload.trackItemIds&&(l.push((E=u.value)==null?void 0:E.payload.trackItemIds),t.updateState({activeIds:l},{kind:"update",updateHistory:!1})),u.key===yi){const _=(S=u.value)==null?void 0:S.payload.trackItemIds,g=B(t.getState()),O=_&&_.length?_:g.activeIds,I=O.map(D=>g.trackItemsMap[D]).filter(D=>!!D).map(D=>D.id),P=g.transitionIds.filter(D=>{const nt=g.transitionsMap[D];return I.includes(nt.fromId)||I.includes(nt.toId)});I.push(...P);const C={},H=g.trackItemIds,U=g.transitionIds,L=g.trackItemDetailsMap,N=B(g.tracks),J=B(g.structure);I.forEach(D=>{var Mt;const nt=g.trackItemsMap[D]||g.transitionsMap[D];if(nt.type==="template"){const dt=(Mt=g.structure.find(At=>At.id===nt.id))==null?void 0:Mt.items;I.push(...dt);const Ht=J.findIndex(At=>At.id===nt.id);J.splice(Ht,1)}}),I.forEach(D=>{J.forEach(nt=>{nt.items.includes(D)&&(nt.items=nt.items.filter(Mt=>Mt!==D))})});const Tt=H.filter(D=>!I.includes(D));U.forEach(D=>{O.includes(D)&&O.length===1&&(C[D]=B(g.transitionsMap[D]))});const Pt=U.filter(D=>!I.includes(D)&&!O.includes(D)),xt=Object.fromEntries(Object.entries(L).filter(([D])=>!I.includes(D))),Y=Object.fromEntries(Object.entries(g.transitionsMap).filter(([D])=>!I.includes(D)));Object.keys(Y).forEach(D=>{O.includes(D)&&(Y[D].kind="none")});const zt=Qs(g.tracks,I),wt=Object.fromEntries(Object.entries(g.trackItemsMap).filter(([D])=>!I.includes(D))),lt=N.filter(D=>D.magnetic);Fi(lt,wt,g.transitionsMap);const $t=oe(wt);Object.keys(C).forEach(D=>{ia(C[D],zt,wt)}),t.updateState({trackItemIds:Tt,trackItemDetailsMap:xt,activeIds:[],trackItemsMap:wt,tracks:zt,duration:$t,structure:J,transitionIds:Pt,transitionsMap:Y},{updateHistory:!0,kind:"remove"})}if(u.key===mi){const _=B(t.getState()),g={},O=((h=u.value)==null?void 0:h.payload.trackItemIds)||_.activeIds;if(O.length===0)return;O.forEach(P=>{const C=_.trackItemsMap[P],H=_.trackItemDetailsMap[P],U=Ee();_.trackItemsMap[U]={...B(C),id:U},_.trackItemDetailsMap[U]={...B(H)},_.trackItemIds.push(U);const L=_.tracks.find(N=>N.items.includes(P));g[L.id]?g[L.id].items.push(U):g[L.id]={...L,id:Ee(),items:[U],static:!1,magnetic:!1}});const I=Object.values(g);_.tracks=[...I,..._.tracks],t.updateState({trackItemDetailsMap:_.trackItemDetailsMap,tracks:_.tracks,trackItemIds:_.trackItemIds,trackItemsMap:_.trackItemsMap},{updateHistory:!0,kind:"update"})}if(u.key===Ii){const _=(y=u.value)==null?void 0:y.payload,g=Object.keys(_)[0],O=Object.values(_)[0],I=B(t.getState()),P=I.trackItemDetailsMap[g],C=B(I.trackItemsMap[g]),H=P.details;if(!O.details.src)return;if(P.type==="image"){const U=await ke(O.details.src),{crop:L,newHeight:N,newWidth:J}=Ri(P,U);O.details.crop=L,O.details.height=N,O.details.width=J}else if(P.type==="video"){const U=await Fr(O.details.src),L=I.trackItemsMap[g],{display:N,duration:J,trim:Tt}=Li(L,U),{crop:Pt,newHeight:xt,newWidth:Y}=Ri(P,U);O.details.crop=Pt,O.details.height=xt,O.details.width=Y,C.display=N,C.duration=J,C.trim=Tt}else if(P.type==="audio"){const U=await vi(O.details.src),L=I.trackItemsMap[g],{display:N,duration:J,trim:Tt}=Li(L,U);C.display=N,C.duration=J,C.trim=Tt}P.details={...H,...O.details},I.trackItemDetailsMap[g]={...P},I.trackItemsMap[g]={...C},t.updateState({trackItemDetailsMap:I.trackItemDetailsMap,trackItemsMap:I.trackItemsMap},{updateHistory:!0,kind:"update:details"})}}),m=r.subscribe(async u=>{var I,P,C,H,U,L,N,J,Tt,Pt,xt,Y,zt,wt,lt,$t,D,nt,Mt,dt,Ht,At,qt,Jt,pe,Zt,he,Qt,me,Te,we,jt,te;const l=B(t.getState()),k=((P=(I=u.value)==null?void 0:I.options)==null?void 0:P.isSelected)||!1,E=(H=(C=u.value)==null?void 0:C.options)==null?void 0:H.scaleMode,S=(L=(U=u.value)==null?void 0:U.options)==null?void 0:L.isNewTrack;let h=[],y="text";const _=(J=(N=u.value)==null?void 0:N.options)==null?void 0:J.trackId;let g=(Pt=(Tt=u.value)==null?void 0:Tt.options)==null?void 0:Pt.trackIndex;if(u.key===si){const z=(xt=u.value)==null?void 0:xt.payload;let j=l.trackItemsMap[z.id].animations;j?j.in&&z.animations.in?j.in=z.animations.in:j.out&&z.animations.out||!j.out&&z.animations.out?j.out=z.animations.out:!j.in&&z.animations.in?j.in=z.animations.in:j=z.animations:l.trackItemsMap[z.id].animations=z.animations}if(u.key===ci){const z=(Y=u.value)==null?void 0:Y.payload,j=z.trackItems.map(X=>qs(X,{size:l.size})),F=await Promise.all(j),at=Zs(z.tracks,z.trackItems),ft=[];z.trackItems.forEach(X=>{if(X.type!=="template")return;l.trackItemsMap={...l.trackItemsMap,...X.trackItemsMap},l.trackItemDetailsMap={...l.trackItemDetailsMap,...X.trackItemDetailsMap},l.transitionsMap={...l.transitionsMap,...X.transitionsMap};const gt={id:X.id,items:X.trackItemIds,transitions:X.transitionsIds||[],tracks:X.tracks};ft.push(gt)});const K=[],pt={},Z={};if(F.forEach(X=>{const{details:gt,...ee}=X;K.push(X.id),pt[X.id]={type:X.type,details:gt},Z[X.id]=ee}),Js(l.tracks,at))l.tracks.forEach(X=>{at.forEach(gt=>{if(X.id===gt.id){if(X.magnetic){const ee=gt.items.map(Dt=>Z[Dt]),re=X.items.map(Dt=>l.trackItemsMap[Dt]);ra(ee,re)}X.items.push(...K)}})});else{const X=((wt=(zt=u.value)==null?void 0:zt.options)==null?void 0:wt.trackIndex)||0,gt=zr(X,0,l.tracks.length);l.tracks.splice(gt,0,...at)}l.trackItemDetailsMap={...l.trackItemDetailsMap,...pt},l.trackItemsMap={...l.trackItemsMap,...Z},l.trackItemIds=[...l.trackItemIds,...K],l.structure=[...l.structure,...ft],l.duration=oe(l.trackItemsMap);const{transitionIds:Me,transitionsMap:ye}=na(l),We=l.tracks.filter(X=>X.magnetic);Fi(We,l.trackItemsMap,ye),t.updateState({trackItemIds:l.trackItemIds,trackItemDetailsMap:l.trackItemDetailsMap,trackItemsMap:l.trackItemsMap,tracks:l.tracks,duration:l.duration,structure:l.structure,transitionIds:Me,transitionsMap:ye},{updateHistory:!0,kind:"add"});return}if(u.key===ai){y="caption";const z=(lt=u.value)==null?void 0:lt.payload,j=[];for(const ft of z){const K=Ci(ft,{size:l.size});j.push(K)}const F=await Promise.all(j),at=[];for(const ft of F){const K=ft.id;at.push(K);const{details:pt,...Z}=ft;l.trackItemDetailsMap[K]={type:y,details:pt},l.trackItemsMap[K]=Z,l.trackItemIds.push(K)}h=at}if(u.key===Qn){y="text";const z=await Pi(($t=u.value)==null?void 0:$t.payload,{size:l.size}),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===oi){y="template";const z=(D=u.value)==null?void 0:D.payload.trackItemsMap,j=(nt=u.value)==null?void 0:nt.payload.trackItemDetailsMap,F=(Mt=u.value)==null?void 0:Mt.payload.transitionsMap,at=((dt=u.value)==null?void 0:dt.payload.transitionIds)||[],ft=(Ht=u.value)==null?void 0:Ht.payload.trackItemIds,K=((At=u.value)==null?void 0:At.payload.tracks)||[],{details:pt,...Z}=await Ai((qt=u.value)==null?void 0:qt.payload,{size:l.size}),It={id:Z.id,items:ft,transitions:at,tracks:K};l.trackItemDetailsMap[Z.id]={type:y,details:pt},l.trackItemsMap[Z.id]=Z,l.trackItemIds.push(Z.id),h=[Z.id],l.trackItemsMap={...l.trackItemsMap,...z,[Z.id]:{...Z}},l.trackItemDetailsMap={...l.trackItemDetailsMap,...j,[Z.id]:{type:"template",details:pt}},l.transitionsMap={...l.transitionsMap,...F},l.structure=[...l.structure,It]}if(u.key===ni){y="illustration";const z=await Di((Jt=u.value)==null?void 0:Jt.payload,{size:l.size}),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===ii){y="shape";const z=await Vs((pe=u.value)==null?void 0:pe.payload,{size:l.size}),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===ri){y="image";const z=await Oi((Zt=u.value)==null?void 0:Zt.payload,{size:l.size,scaleMode:E}),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===ei){y="audio";const z=await Mi((he=u.value)==null?void 0:he.payload),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===ti){y="video";const z=await wi((Qt=u.value)==null?void 0:Qt.payload,{size:l.size,scaleMode:E}),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j,metadata:F.metadata},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===ui){y="composition";const z=(me=u.value)==null?void 0:me.payload.trackItemsMap,j=(Te=u.value)==null?void 0:Te.payload.trackItemDetailsMap,F=(we=u.value)==null?void 0:we.payload.trackItemIds,at=((jt=u.value)==null?void 0:jt.payload.tracks)||[],{details:ft,...K}=await Ks((te=u.value)==null?void 0:te.payload,{size:l.size}),pt={id:K.id,items:F,transitions:[],tracks:at};l.trackItemDetailsMap[K.id]={type:y,details:ft},l.trackItemsMap[K.id]=K,l.trackItemIds.push(K.id),h=[K.id],l.trackItemsMap={...l.trackItemsMap,...z,[K.id]:{...K}},l.trackItemDetailsMap={...l.trackItemDetailsMap,...j,[K.id]:{type:y,details:ft}},l.structure=[...l.structure,pt]}const O=ta(h,l.tracks,l.trackItemsMap,_,g);if(S){const z=Fe();O.trackId=z;const j={id:O.trackId,accepts:["text","audio","helper","video","image","caption","template"],type:y,items:h,magnetic:!1,static:!1};l.tracks.splice(O.trackIndex,0,j)}else if(O.trackId){const z=l.tracks.find(j=>j.id===O.trackId);z&&z.items.push(...h)}else if(O.trackIndex!==void 0){const z={id:Fe(),accepts:["text","audio","helper","video","image","caption","template"],type:y,items:h,magnetic:!1,static:!1};l.tracks.splice(O.trackIndex,0,z)}else l.tracks.unshift({id:Fe(),accepts:["text","audio","helper","video","image","caption","template"],type:y,items:h,magnetic:!1,static:!1});k&&(l.activeIds=h),l.duration=oe(l.trackItemsMap),t.updateState({activeIds:l.activeIds,trackItemIds:l.trackItemIds,trackItemDetailsMap:l.trackItemDetailsMap,trackItemsMap:l.trackItemsMap,transitionsMap:l.transitionsMap,tracks:l.tracks,duration:l.duration,structure:l.structure},{updateHistory:!0,kind:"add"})}),A=c.subscribe(async u=>{var l;if(u.key===hi){const k=B(t.getState()),E=(l=u.value)==null?void 0:l.options.time;if(k.activeIds.length===1){const S=k.activeIds[0],h=B(k.trackItemsMap[S]);if(E>=h.display.to||E<=h.display.from)return;const y=B(k.trackItemDetailsMap[S]),_=Ee(),g=B({...h,display:{from:h.display.from,to:E}}),O=B({...h,id:_,display:{from:E,to:h.display.to}});if(h.type==="video"||h.type==="audio"){const I=E-g.display.from;g.trim={from:h.trim.from,to:h.trim.from+I},O.trim={from:h.trim.from+I,to:h.trim.to}}k.trackItemsMap[S]=g,k.trackItemsMap[_]=O,k.trackItemIds.push(_),k.trackItemDetailsMap[_]=y,k.tracks.forEach(I=>{I.items.includes(S)&&I.items.push(_)}),t.updateState({trackItemDetailsMap:k.trackItemDetailsMap,tracks:k.tracks,trackItemIds:k.trackItemIds,trackItemsMap:k.trackItemsMap},{updateHistory:!0,kind:"update"})}return}if(u.key===pi){const k=B(t.getState());if(k.activeIds.length){const E=k.activeIds,S=[],h={activeIds:E,trackItemDetailsMap:{},trackItemsMap:{},tracks:[]};E.forEach(_=>{h.trackItemDetailsMap[_]=k.trackItemDetailsMap[_],h.trackItemsMap[_]=k.trackItemsMap[_],S.push(k.tracks.find(g=>g.items.includes(_)))});const y=new Set;S.filter(_=>y.has(_.id)?!1:(y.add(_),!0)),h.tracks=Array.from(y.keys()),localStorage.setItem("DesignComboTemp",JSON.stringify(h))}}if(u.key===fi){const k=localStorage.getItem("DesignComboTemp");if(!k)return;const E=B(t.getState()),S=JSON.parse(k),h={},y=S.trackItemsMap,_=S.trackItemDetailsMap,g=S.tracks,O=[],I=S.activeIds.map(async P=>{const C=_[P];(C.type==="caption"||C.type==="text")&&C.details.fontUrl&&await lr([{fontFamily:C.details.fontFamily,url:C.details.fontUrl}]);const H=Ee();return h[P]=H,E.trackItemsMap[H]={...y[P],id:H},E.trackItemDetailsMap[H]=C,E.trackItemIds.push(H),!0});await Promise.all(I),g.forEach(P=>{const C=P.items.map(U=>h[U]),H={...P,magnetic:!1,static:!1,items:C,id:Fe()};O.push(H)}),E.tracks=[...O,...E.tracks],t.updateState({trackItemDetailsMap:E.trackItemDetailsMap,tracks:E.tracks,trackItemIds:E.trackItemIds,trackItemsMap:E.trackItemsMap},{updateHistory:!0,kind:"update"})}}),x=d.subscribe(async u=>{var l,k,E;if(u.key===li){const S=B(t.getState()),h=S.trackItemDetailsMap,y=S.trackItemsMap,_=Object.keys((l=u.value)==null?void 0:l.payload);if(!_.length)return;const g=(k=u.value)==null?void 0:k.payload;_.forEach(I=>{const P=g[I];if(P.details){if(h[I].details={...h[I].details,...P.details},P.details.colorMap){const C=h[I].details.initialSvgString,H=ki(C,P.details.colorMap);h[I].details.svgString=H}}else g[I].playbackRate&&(y[I].playbackRate=g[I].playbackRate);g[I].metadata&&(y[I].metadata?y[I].metadata={...y[I].metadata,...g[I].metadata}:y[I].metadata=g[I].metadata),g[I].display&&(y[I].display=g[I].display)});for(const I of _){const P=g[I];if(y[I].type==="shape"&&P.details.src){const C=await ke(P.details.src);h[I].details.width=C.width,h[I].details.height=C.height}}const O=oe(y);t.updateState({trackItemDetailsMap:{...h},trackItemsMap:{...y},duration:O},{updateHistory:!0,kind:"update:details"})}if(u.key===di){const S=(E=u.value)==null?void 0:E.payload,h=Object.keys(S)[0],y=Object.values(S)[0],_=B(t.getState()),g=_.trackItemDetailsMap[h],O=g.details;if(y.details){if(y.type==="image"&&y.details.src){const P=await ke(y.details.src),C=g.details.width||0,H=g.details.height||0;let U=P.width,L=P.height;const N=P.width/P.height;C/H>N?(U=C,L=C/N):(L=H,U=H*N),O.crop={x:0,y:0,height:O.height,width:O.width},y.details.width=U,y.details.height=L}if(y.type==="video"&&y.details.src){const P=await Fr(y.details.src),C=g.details.width||0,H=g.details.height||0;let U=P.width,L=P.height;const N=P.width/P.height;C/H>N?(U=C,L=C/N):(L=H,U=H*N),O.crop={x:0,y:0,height:O.height,width:O.width},y.details.width=U,y.details.height=L}g.details={...O,...y.details},y.details=g.details}const I={...g,...y};_.trackItemDetailsMap[h]=I,_.trackItemsMap[h]={..._.trackItemsMap[h],type:y.type},t.updateState({trackItemDetailsMap:{..._.trackItemDetailsMap},trackItemsMap:{..._.trackItemsMap}},{updateHistory:!0,kind:"update:details"})}});return{unsubscribe:()=>{m.unsubscribe(),A.unsubscribe(),x.unsubscribe(),v.unsubscribe(),w.unsubscribe(),b.unsubscribe(),T.unsubscribe()}}}const aa={Date:!0,RegExp:!0,String:!0,Number:!0};function Ni(t,e,r={cyclesFix:!0},i=[]){var f,b;let a=[];const c=Array.isArray(t);for(const v in t){const T=t[v],w=c?+v:v;if(!(v in e)){a.push({type:"REMOVE",path:[w],oldValue:t[v]});continue}const m=e[v],A=typeof T=="object"&&typeof m=="object"&&Array.isArray(T)===Array.isArray(m);T&&m&&A&&!aa[(b=(f=Object.getPrototypeOf(T))==null?void 0:f.constructor)==null?void 0:b.name]&&(!r.cyclesFix||!i.includes(T))?a.push.apply(a,Ni(T,m,r,r.cyclesFix?i.concat([T]):[]).map(x=>(x.path.unshift(w),x))):T!==m&&!(Number.isNaN(T)&&Number.isNaN(m))&&!(A&&(isNaN(T)?T+""==m+"":+T==+m))&&a.push({path:[w],type:"CHANGE",value:m,oldValue:T})}const d=Array.isArray(e);for(const v in e)v in t||a.push({type:"CREATE",path:[d?+v:v],value:e[v]});return a}var $r=Symbol.for("immer-nothing"),ze=Symbol.for("immer-draftable"),St=Symbol.for("immer-state"),zi=process.env.NODE_ENV!=="production"?[function(t){return`The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`},function(t){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${t}'`},"This object has been frozen and should not be mutated",function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(t){return`'current' expects a draft, got: ${t}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(t){return`'original' expects a draft, got: ${t}`}]:[];function et(t,...e){if(process.env.NODE_ENV!=="production"){const r=zi[t],i=typeof r=="function"?r.apply(null,e):r;throw new Error(`[Immer] ${i}`)}throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var ce=Object.getPrototypeOf;function ue(t){return!!t&&!!t[St]}function Vt(t){var e;return t?$i(t)||Array.isArray(t)||!!t[ze]||!!((e=t.constructor)!=null&&e[ze])||je(t)||Ue(t):!1}var oa=Object.prototype.constructor.toString();function $i(t){if(!t||typeof t!="object")return!1;const e=ce(t);if(e===null)return!0;const r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===oa}function $e(t,e){le(t)===0?Reflect.ownKeys(t).forEach(r=>{e(r,t[r],t)}):t.forEach((r,i)=>e(i,r,t))}function le(t){const e=t[St];return e?e.type_:Array.isArray(t)?1:je(t)?2:Ue(t)?3:0}function He(t,e){return le(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Hr(t,e){return le(t)===2?t.get(e):t[e]}function Hi(t,e,r){const i=le(t);i===2?t.set(e,r):i===3?t.add(r):t[e]=r}function ca(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function je(t){return t instanceof Map}function Ue(t){return t instanceof Set}function de(t){return t.copy_||t.base_}function jr(t,e){if(je(t))return new Map(t);if(Ue(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const r=$i(t);if(e===!0||e==="class_only"&&!r){const i=Object.getOwnPropertyDescriptors(t);delete i[St];let a=Reflect.ownKeys(i);for(let c=0;c<a.length;c++){const d=a[c],f=i[d];f.writable===!1&&(f.writable=!0,f.configurable=!0),(f.get||f.set)&&(i[d]={configurable:!0,writable:!0,enumerable:f.enumerable,value:t[d]})}return Object.create(ce(t),i)}else{const i=ce(t);if(i!==null&&r)return{...t};const a=Object.create(i);return Object.assign(a,t)}}function Ur(t,e=!1){return fr(t)||ue(t)||!Vt(t)||(le(t)>1&&(t.set=t.add=t.clear=t.delete=ua),Object.freeze(t),e&&Object.entries(t).forEach(([r,i])=>Ur(i,!0))),t}function ua(){et(2)}function fr(t){return Object.isFrozen(t)}var Yr={};function fe(t){const e=Yr[t];return e||et(0,t),e}function la(t,e){Yr[t]||(Yr[t]=e)}var Ye;function ji(){return Ye}function da(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ui(t,e){e&&(fe("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Gr(t){Wr(t),t.drafts_.forEach(fa),t.drafts_=null}function Wr(t){t===Ye&&(Ye=t.parent_)}function Yi(t){return Ye=da(Ye,t)}function fa(t){const e=t[St];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function Gi(t,e){e.unfinalizedDrafts_=e.drafts_.length;const r=e.drafts_[0];return t!==void 0&&t!==r?(r[St].modified_&&(Gr(e),et(4)),Vt(t)&&(t=pr(e,t),e.parent_||hr(e,t)),e.patches_&&fe("Patches").generateReplacementPatches_(r[St].base_,t,e.patches_,e.inversePatches_)):t=pr(e,r,[]),Gr(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==$r?t:void 0}function pr(t,e,r){if(fr(e))return e;const i=e[St];if(!i)return $e(e,(a,c)=>Wi(t,i,e,a,c,r)),e;if(i.scope_!==t)return e;if(!i.modified_)return hr(t,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let c=a,d=!1;i.type_===3&&(c=new Set(a),a.clear(),d=!0),$e(c,(f,b)=>Wi(t,i,a,f,b,r,d)),hr(t,a,!1),r&&t.patches_&&fe("Patches").generatePatches_(i,r,t.patches_,t.inversePatches_)}return i.copy_}function Wi(t,e,r,i,a,c,d){if(process.env.NODE_ENV!=="production"&&a===r&&et(5),ue(a)){const f=c&&e&&e.type_!==3&&!He(e.assigned_,i)?c.concat(i):void 0,b=pr(t,a,f);if(Hi(r,i,b),ue(b))t.canAutoFreeze_=!1;else return}else d&&r.add(a);if(Vt(a)&&!fr(a)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;pr(t,a),(!e||!e.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,i)&&hr(t,a)}}function hr(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Ur(e,r)}function pa(t,e){const r=Array.isArray(t),i={type_:r?1:0,scope_:e?e.scope_:ji(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=i,c=Xr;r&&(a=[i],c=Ge);const{revoke:d,proxy:f}=Proxy.revocable(a,c);return i.draft_=f,i.revoke_=d,f}var Xr={get(t,e){if(e===St)return t;const r=de(t);if(!He(r,e))return ha(t,r,e);const i=r[e];return t.finalized_||!Vt(i)?i:i===Br(t.base_,e)?(Vr(t),t.copy_[e]=qr(i,t)):i},has(t,e){return e in de(t)},ownKeys(t){return Reflect.ownKeys(de(t))},set(t,e,r){const i=Xi(de(t),e);if(i!=null&&i.set)return i.set.call(t.draft_,r),!0;if(!t.modified_){const a=Br(de(t),e),c=a==null?void 0:a[St];if(c&&c.base_===r)return t.copy_[e]=r,t.assigned_[e]=!1,!0;if(ca(r,a)&&(r!==void 0||He(t.base_,e)))return!0;Vr(t),Kr(t)}return t.copy_[e]===r&&(r!==void 0||e in t.copy_)||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_[e]=!0),!0},deleteProperty(t,e){return Br(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,Vr(t),Kr(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const r=de(t),i=Reflect.getOwnPropertyDescriptor(r,e);return i&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:i.enumerable,value:r[e]}},defineProperty(){et(11)},getPrototypeOf(t){return ce(t.base_)},setPrototypeOf(){et(12)}},Ge={};$e(Xr,(t,e)=>{Ge[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Ge.deleteProperty=function(t,e){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(e))&&et(13),Ge.set.call(this,t,e,void 0)},Ge.set=function(t,e,r){return process.env.NODE_ENV!=="production"&&e!=="length"&&isNaN(parseInt(e))&&et(14),Xr.set.call(this,t[0],e,r,t[0])};function Br(t,e){const r=t[St];return(r?de(r):t)[e]}function ha(t,e,r){var a;const i=Xi(e,r);return i?"value"in i?i.value:(a=i.get)==null?void 0:a.call(t.draft_):void 0}function Xi(t,e){if(!(e in t))return;let r=ce(t);for(;r;){const i=Object.getOwnPropertyDescriptor(r,e);if(i)return i;r=ce(r)}}function Kr(t){t.modified_||(t.modified_=!0,t.parent_&&Kr(t.parent_))}function Vr(t){t.copy_||(t.copy_=jr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var ma=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,r,i)=>{if(typeof e=="function"&&typeof r!="function"){const c=r;r=e;const d=this;return function(b=c,...v){return d.produce(b,T=>r.call(this,T,...v))}}typeof r!="function"&&et(6),i!==void 0&&typeof i!="function"&&et(7);let a;if(Vt(e)){const c=Yi(this),d=qr(e,void 0);let f=!0;try{a=r(d),f=!1}finally{f?Gr(c):Wr(c)}return Ui(c,i),Gi(a,c)}else if(!e||typeof e!="object"){if(a=r(e),a===void 0&&(a=e),a===$r&&(a=void 0),this.autoFreeze_&&Ur(a,!0),i){const c=[],d=[];fe("Patches").generateReplacementPatches_(e,a,c,d),i(c,d)}return a}else et(1,e)},this.produceWithPatches=(e,r)=>{if(typeof e=="function")return(d,...f)=>this.produceWithPatches(d,b=>e(b,...f));let i,a;return[this.produce(e,r,(d,f)=>{i=d,a=f}),i,a]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){Vt(t)||et(8),ue(t)&&(t=ya(t));const e=Yi(this),r=qr(t,void 0);return r[St].isManual_=!0,Wr(e),r}finishDraft(t,e){const r=t&&t[St];(!r||!r.isManual_)&&et(9);const{scope_:i}=r;return Ui(i,e),Gi(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){const a=e[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(e=e.slice(r+1));const i=fe("Patches").applyPatches_;return ue(t)?i(t,e):this.produce(t,a=>i(a,e))}};function qr(t,e){const r=je(t)?fe("MapSet").proxyMap_(t,e):Ue(t)?fe("MapSet").proxySet_(t,e):pa(t,e);return(e?e.scope_:ji()).drafts_.push(r),r}function ya(t){return ue(t)||et(10,t),Bi(t)}function Bi(t){if(!Vt(t)||fr(t))return t;const e=t[St];let r;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=jr(t,e.scope_.immer_.useStrictShallowCopy_)}else r=jr(t,!0);return $e(r,(i,a)=>{Hi(r,i,Bi(a))}),e&&(e.finalized_=!1),r}function Ki(){process.env.NODE_ENV!=="production"&&zi.push('Sets cannot have "replace" patches.',function(m){return"Unsupported patch operation: "+m},function(m){return"Cannot apply patch, path doesn't resolve: "+m},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");const e="replace",r="add",i="remove";function a(m,A,x,u){switch(m.type_){case 0:case 2:return d(m,A,x,u);case 1:return c(m,A,x,u);case 3:return f(m,A,x,u)}}function c(m,A,x,u){let{base_:l,assigned_:k}=m,E=m.copy_;E.length<l.length&&([l,E]=[E,l],[x,u]=[u,x]);for(let S=0;S<l.length;S++)if(k[S]&&E[S]!==l[S]){const h=A.concat([S]);x.push({op:e,path:h,value:w(E[S])}),u.push({op:e,path:h,value:w(l[S])})}for(let S=l.length;S<E.length;S++){const h=A.concat([S]);x.push({op:r,path:h,value:w(E[S])})}for(let S=E.length-1;l.length<=S;--S){const h=A.concat([S]);u.push({op:i,path:h})}}function d(m,A,x,u){const{base_:l,copy_:k}=m;$e(m.assigned_,(E,S)=>{const h=Hr(l,E),y=Hr(k,E),_=S?He(l,E)?e:r:i;if(h===y&&_===e)return;const g=A.concat(E);x.push(_===i?{op:_,path:g}:{op:_,path:g,value:y}),u.push(_===r?{op:i,path:g}:_===i?{op:r,path:g,value:w(h)}:{op:e,path:g,value:w(h)})})}function f(m,A,x,u){let{base_:l,copy_:k}=m,E=0;l.forEach(S=>{if(!k.has(S)){const h=A.concat([E]);x.push({op:i,path:h,value:S}),u.unshift({op:r,path:h,value:S})}E++}),E=0,k.forEach(S=>{if(!l.has(S)){const h=A.concat([E]);x.push({op:r,path:h,value:S}),u.unshift({op:i,path:h,value:S})}E++})}function b(m,A,x,u){x.push({op:e,path:[],value:A===$r?void 0:A}),u.push({op:e,path:[],value:m})}function v(m,A){return A.forEach(x=>{const{path:u,op:l}=x;let k=m;for(let y=0;y<u.length-1;y++){const _=le(k);let g=u[y];typeof g!="string"&&typeof g!="number"&&(g=""+g),(_===0||_===1)&&(g==="__proto__"||g==="constructor")&&et(19),typeof k=="function"&&g==="prototype"&&et(19),k=Hr(k,g),typeof k!="object"&&et(18,u.join("/"))}const E=le(k),S=T(x.value),h=u[u.length-1];switch(l){case e:switch(E){case 2:return k.set(h,S);case 3:et(16);default:return k[h]=S}case r:switch(E){case 1:return h==="-"?k.push(S):k.splice(h,0,S);case 2:return k.set(h,S);case 3:return k.add(S);default:return k[h]=S}case i:switch(E){case 1:return k.splice(h,1);case 2:return k.delete(h);case 3:return k.delete(x.value);default:return delete k[h]}default:et(17,l)}}),m}function T(m){if(!Vt(m))return m;if(Array.isArray(m))return m.map(T);if(je(m))return new Map(Array.from(m.entries()).map(([x,u])=>[x,T(u)]));if(Ue(m))return new Set(Array.from(m).map(T));const A=Object.create(ce(m));for(const x in m)A[x]=T(m[x]);return He(m,ze)&&(A[ze]=m[ze]),A}function w(m){return ue(m)?T(m):m}la("Patches",{applyPatches_:v,generatePatches_:a,generateReplacementPatches_:b})}var kt=new ma,Ia=kt.produce;kt.produceWithPatches.bind(kt),kt.setAutoFreeze.bind(kt),kt.setUseStrictShallowCopy.bind(kt);var ga=kt.applyPatches.bind(kt);kt.createDraft.bind(kt),kt.finishDraft.bind(kt);var ba=9007199254740991,_a="[object Arguments]",va="[object Function]",Sa="[object GeneratorFunction]",ka="[object Symbol]",Ea=typeof Et=="object"&&Et&&Et.Object===Object&&Et,Ta=typeof self=="object"&&self&&self.Object===Object&&self,wa=Ea||Ta||Function("return this")();function Ma(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Aa(t,e){for(var r=-1,i=t?t.length:0,a=Array(i);++r<i;)a[r]=e(t[r],r,t);return a}function Da(t,e){for(var r=-1,i=e.length,a=t.length;++r<i;)t[a+r]=e[r];return t}var Jr=Object.prototype,Oa=Jr.hasOwnProperty,Zr=Jr.toString,Vi=wa.Symbol,Ca=Jr.propertyIsEnumerable,qi=Vi?Vi.isConcatSpreadable:void 0,Ji=Math.max;function Pa(t,e,r,i,a){var c=-1,d=t.length;for(r||(r=Fa),a||(a=[]);++c<d;){var f=t[c];r(f)?Da(a,f):a[a.length]=f}return a}function xa(t,e){return t=Object(t),Ra(t,e,function(r,i){return i in t})}function Ra(t,e,r){for(var i=-1,a=e.length,c={};++i<a;){var d=e[i],f=t[d];r(f,d)&&(c[d]=f)}return c}function La(t,e){return e=Ji(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=Ji(r.length-e,0),c=Array(a);++i<a;)c[i]=r[e+i];i=-1;for(var d=Array(e+1);++i<e;)d[i]=r[i];return d[e]=c,Ma(t,this,d)}}function Fa(t){return $a(t)||za(t)||!!(qi&&t&&t[qi])}function Na(t){if(typeof t=="string"||Wa(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function za(t){return ja(t)&&Oa.call(t,"callee")&&(!Ca.call(t,"callee")||Zr.call(t)==_a)}var $a=Array.isArray;function Ha(t){return t!=null&&Ya(t.length)&&!Ua(t)}function ja(t){return Zi(t)&&Ha(t)}function Ua(t){var e=Ga(t)?Zr.call(t):"";return e==va||e==Sa}function Ya(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ba}function Ga(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Zi(t){return!!t&&typeof t=="object"}function Wa(t){return typeof t=="symbol"||Zi(t)&&Zr.call(t)==ka}var Xa=La(function(t,e){return t==null?{}:xa(t,Aa(Pa(e),Na))}),Ba=Xa;const Qi=Rr(Ba),Ka={size:{width:1080,height:1920},fps:30,tracks:[],trackItemIds:[],trackItemsMap:{},transitionIds:[],transitionsMap:{},scale:{unit:1,zoom:1,segments:1,index:1},duration:0,activeIds:[],trackItemDetailsMap:{},structure:[]},ts=["tracks","trackItemsMap","trackItemDetailsMap","transitionIds","transitionsMap","trackItemIds","structure"];class Va{constructor(e){Se(this,"stateSubject");Se(this,"stateHistorySubject");Se(this,"prevState");Se(this,"undos",[]);Se(this,"redos",[]);Se(this,"listener");const r=Object.assign({},Ka,e);this.stateSubject=new Bn(r),this.stateHistorySubject=new Bn({handleRedo:!1,handleUndo:!1}),this.prevState=r,this.initListeners()}initListeners(){sa(this)}destroyListeners(){this.listener&&this.listener.unsubscribe()}purge(){this.destroyListeners()}updateHistory(e,r){const i=Qi(e,ts),a=Qi(this.getState(),ts),c=Ni(a,i);c.length&&(this.undos.push({undos:c,type:r}),this.redos=[])}getStateHistory(){return this.stateHistorySubject.getValue()}subscribeHistory(e){return this.stateHistorySubject.subscribe(e)}getState(){return this.stateSubject.getValue()}subscribe(e){return this.stateSubject.subscribe(e)}updateState(e,r={updateHistory:!1}){const i=this.getState(),a={...B(i),...B(e)};tt(i,a)||(r.updateHistory&&this.updateHistory(a,r.kind),this.prevState=i,this.stateSubject.next(a))}subscribeToSize(e){return this.stateSubject.asObservable().subscribe(r=>{tt(r.size,this.prevState.size)||e({size:r.size})})}subscribeToScale(e){return this.stateSubject.asObservable().subscribe(r=>{tt(r.scale,this.prevState.scale)||e({scale:r.scale})})}subscribeToFps(e){return this.stateSubject.asObservable().subscribe(r=>{r.fps!==this.prevState.fps&&e({fps:r.fps})})}subscribeToUpdateTrackItem(e){return this.stateSubject.asObservable().subscribe(r=>{tt(r.trackItemsMap,this.prevState.trackItemsMap)||e({trackItemsMap:r.trackItemsMap})})}subscribeToUpdateAnimations(e){return this.stateSubject.asObservable().subscribe(r=>{const i=Object.keys(r.trackItemsMap).filter(a=>{const c=this.prevState.trackItemsMap[a],d=r.trackItemsMap[a];return c&&d&&!tt(c.animations,d.animations)});e({trackItemsMap:r.trackItemsMap,changedAnimationIds:i})})}subscribeToUpdateTrackItemTiming(e){return this.stateSubject.asObservable().subscribe(r=>{if(!tt(r.trackItemsMap,this.prevState.trackItemsMap)){const i=Object.keys(r.trackItemsMap).filter(c=>{const d=this.prevState.trackItemsMap[c],f=r.trackItemsMap[c];return d&&f&&!tt(d.trim,f.trim)}),a=Object.keys(r.trackItemsMap).filter(c=>{const d=this.prevState.trackItemsMap[c],f=r.trackItemsMap[c];return d&&f&&!tt(d.display,f.display)});e({trackItemsMap:r.trackItemsMap,changedTrimIds:i.length>0?i:void 0,changedDisplayIds:a.length>0?a:void 0})}})}subscribeToUpdateItemDetails(e){return this.stateSubject.asObservable().subscribe(r=>{tt(r.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||e({trackItemDetailsMap:r.trackItemDetailsMap})})}subscribeToDuration(e){return this.stateSubject.asObservable().subscribe(r=>{r.duration!==this.prevState.duration&&e({duration:r.duration})})}subscribeToHistory(e){return this.stateHistorySubject.asObservable().subscribe(r=>{if(r.handleRedo){const i=this.undos[this.undos.length-1].type;e({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}if(r.handleUndo){const i=this.redos[this.redos.length-1].type;e({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}})}subscribeToAddOrRemoveItems(e){return this.stateSubject.asObservable().subscribe(r=>{const i=[...r.trackItemIds].sort(),a=[...this.prevState.trackItemIds].sort(),c=[...r.transitionIds].sort(),d=[...this.prevState.transitionIds].sort();(!tt(i,a)||!tt(c,d))&&e({trackItemIds:r.trackItemIds})})}subscribeToActiveIds(e){return this.stateSubject.asObservable().subscribe(r=>{tt(r.activeIds,this.prevState.activeIds)||e({activeIds:r.activeIds})})}subscribeToTracks(e){return this.stateSubject.asObservable().subscribe(r=>{const i=r.tracks,c=this.prevState.tracks.map(f=>f.id),d=i.filter(f=>!c.includes(f.id));d.length&&e({tracks:r.tracks,changedTracks:d.map(f=>f.id)})})}subscribeToState(e){return this.stateSubject.asObservable().subscribe(r=>{(!tt(r.tracks,this.prevState.tracks)||!tt(r.trackItemIds,this.prevState.trackItemIds)||!tt(r.trackItemsMap,this.prevState.trackItemsMap)||!tt(r.transitionIds,this.prevState.transitionIds)||!tt(r.transitionsMap,this.prevState.transitionsMap)||!tt(r.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||!tt(r.structure,this.prevState.structure))&&e({tracks:r.tracks,trackItemIds:r.trackItemIds,trackItemsMap:r.trackItemsMap,transitionIds:r.transitionIds,transitionsMap:r.transitionsMap,trackItemDetailsMap:r.trackItemDetailsMap,structure:r.structure})})}undo(){const e=this.undos.pop(),r=e==null?void 0:e.undos,i=e==null?void 0:e.type;if(!r||!i)return;Ki();const{trackItemDetailsMap:a,trackItemIds:c,tracks:d,transitionIds:f,transitionsMap:b,trackItemsMap:v,structure:T}=this.getState(),w=B({trackItemDetailsMap:a,trackItemIds:c,tracks:d,transitionIds:f,transitionsMap:b,trackItemsMap:v,structure:T}),m=[],A=[],x=[],u=[],l=[],k=[],E=[];r.forEach(L=>{let N;const J=L.path.slice(1);L.type==="CREATE"?N={path:J,op:"remove",value:L.value}:L.type==="CHANGE"?N={path:J,op:"replace",value:L.oldValue}:N={path:J,op:"add",value:L.oldValue},L.path.includes("trackItemIds")?x.push(N):L.path.includes("transitionIds")?A.push(N):L.path.includes("trackItemsMap")?l.push(N):L.path.includes("transitionsMap")?u.push(N):L.path.includes("tracks")?m.push(N):L.path.includes("trackItemDetailsMap")?k.push(N):L.path.includes("structure")&&E.push(N)});const S=this.applyPatch(w.tracks,m),h=this.applyPatch(w.transitionIds,A),y=this.applyPatch(w.trackItemIds,x),_=this.applyPatch(w.transitionsMap,u),g=this.applyPatch(w.trackItemsMap,l),O=this.applyPatch(w.trackItemDetailsMap,k),I=this.applyPatch(w.structure,E),P=B({tracks:S,transitionIds:h,trackItemIds:y,transitionsMap:_,trackItemsMap:g,trackItemDetailsMap:O,structure:I}),C=B(this.getState()),H={...C,...P};this.prevState=C,this.redos.push({redos:r,type:i});const U=oe(H.trackItemsMap);this.stateSubject.next({...H,duration:U}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!0}),this.updateState(H,{updateHistory:!1})}applyPatch(e,r){return r.reverse().reduce((i,a)=>Ia(i,c=>{ga(c,[a])}),e)}redo(){const e=this.redos.pop(),r=e==null?void 0:e.redos,i=e==null?void 0:e.type;if(!r||!i)return;Ki();const{trackItemDetailsMap:a,trackItemIds:c,tracks:d,transitionIds:f,transitionsMap:b,trackItemsMap:v,structure:T}=this.getState(),w=B({trackItemDetailsMap:a,trackItemIds:c,tracks:d,transitionIds:f,transitionsMap:b,trackItemsMap:v,structure:T}),m=[],A=[],x=[],u=[],l=[],k=[],E=[];r.forEach(L=>{let N;const J=L.path.slice(1);L.type==="CREATE"?N={path:J,op:"add",value:L.value}:L.type==="CHANGE"?N={path:J,op:"replace",value:L.value}:N={path:J,op:"remove",value:L.oldValue},L.path.includes("trackItemIds")?x.push(N):L.path.includes("transitionIds")?A.push(N):L.path.includes("trackItemsMap")?l.push(N):L.path.includes("transitionsMap")?u.push(N):L.path.includes("trackItemDetailsMap")?k.push(N):L.path.includes("structure")?E.push(N):m.push(N)});const S=this.applyPatch(w.tracks,m),h=this.applyPatch(w.transitionIds,A),y=this.applyPatch(w.trackItemIds,x),_=this.applyPatch(w.transitionsMap,u),g=this.applyPatch(w.trackItemsMap,l),O=this.applyPatch(w.trackItemDetailsMap,k),I=this.applyPatch(w.structure,E),P=B({tracks:S,transitionIds:h,trackItemIds:y,transitionsMap:_,trackItemsMap:g,trackItemDetailsMap:O,structure:I}),C=B(this.getState()),H={...C,...P};this.prevState=C,this.undos.push({undos:r,type:i});const U=oe(H.trackItemsMap);this.stateSubject.next({...H,duration:U}),this.stateHistorySubject.next({handleRedo:!0,handleUndo:!1}),this.updateState(H,{updateHistory:!1})}toJSON(){const{fps:e,tracks:r,size:i,trackItemDetailsMap:a,trackItemIds:c,transitionsMap:d,trackItemsMap:f,transitionIds:b}=this.getState();return{fps:e,tracks:r,size:i,trackItemDetailsMap:a,trackItemIds:c,transitionsMap:d,trackItemsMap:f,transitionIds:b}}}M.ACTIVE_CLONE=pi,M.ACTIVE_DELETE=As,M.ACTIVE_PASTE=fi,M.ACTIVE_PREFIX=se,M.ACTIVE_SET=Ms,M.ACTIVE_SPLIT=hi,M.ADD_ANIMATION=si,M.ADD_AUDIO=ei,M.ADD_CAPTIONS=ai,M.ADD_COMPOSITION=ui,M.ADD_ILLUSTRATION=ni,M.ADD_IMAGE=ri,M.ADD_ITEMS=ci,M.ADD_MASK=_s,M.ADD_PLACEHOLDER=bs,M.ADD_PREFIX=ut,M.ADD_SHAPE=ii,M.ADD_SUFFIX=ms,M.ADD_TEMPLATE=oi,M.ADD_TEXT=Qn,M.ADD_TRANSITION=vs,M.ADD_VIDEO=ti,M.DELETE_TEMPLATE_ITEM=Ts,M.DESIGN_LOAD=Jn,M.DESIGN_PREFIX=cr,M.DESIGN_RESIZE=Zn,M.EDIT_OBJECT=li,M.EDIT_PREFIX=Bt,M.EDIT_SHAPE=ks,M.EDIT_TEMPLATE_ITEM=Es,M.EDIT_TEXT=Ss,M.ENTER_EDIT_MODE=ws,M.HISTORY_PREFIX=Le,M.HISTORY_REDO=bi,M.HISTORY_RESET=js,M.HISTORY_UNDO=gi,M.LAYER_CLONE=mi,M.LAYER_COPY=Ns,M.LAYER_CUT=Hs,M.LAYER_DELETE=yi,M.LAYER_EDITING_NAME=Fs,M.LAYER_HIDDEN=Os,M.LAYER_LOCKED=Ds,M.LAYER_MOVE=Cs,M.LAYER_PASTE=zs,M.LAYER_PREFIX=it,M.LAYER_RENAME=Ls,M.LAYER_REPLACE=Ii,M.LAYER_SELECT=Ps,M.LAYER_SELECTION=xs,M.LAYER_SEND_TO=Rs,M.LAYER_SPLIT=$s,M.REPLACE_MEDIA=di,M.STATE_CHANGED=gs,M.STATE_PREFIX=qn,M.TIMELINE_SCALE_CHANGED=_i,M.TIMELINE_SCALE_PREFIX=Lr,M.TRACKS_CHANGED=ys,M.TRACK_ITEMS_CHANGED=Is,M.TRACK_ITEMS_PREFIX=Vn,M.TRACK_PREFIX=Kn,M.default=Va,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function Pr(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var ir=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,i,a,c;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var f=Ar(d),b=f.next();!b.done;b=f.next()){var v=b.value;v.remove(this)}}catch(u){e={error:u}}finally{try{b&&!b.done&&(r=f.return)&&r.call(f)}finally{if(e)throw e.error}}else d.remove(this);var T=this.initialTeardown;if(Nt(T))try{T()}catch(u){c=u instanceof Cr?u.errors:[u]}var w=this._finalizers;if(w){this._finalizers=null;try{for(var m=Ar(w),A=m.next();!A.done;A=m.next()){var x=A.value;try{Hn(x)}catch(u){c=c??[],u instanceof Cr?c=Or(Or([],Dr(c)),Dr(u.errors)):c.push(u)}}}catch(u){i={error:u}}finally{try{A&&!A.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}}if(c)throw new Cr(c)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)Hn(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&Pr(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&Pr(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),zn=ir.EMPTY;function $n(t){return t instanceof ir||t&&"closed"in t&&Nt(t.remove)&&Nt(t.add)&&Nt(t.unsubscribe)}function Hn(t){Nt(t)?t():t.unsubscribe()}var rs={Promise:void 0},ns={setTimeout:function(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Or([t,e],Dr(r)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function is(t){ns.setTimeout(function(){throw t})}function jn(){}function sr(t){t()}var Un=function(t){Re(e,t);function e(r){var i=t.call(this)||this;return i.isStopped=!1,r?(i.destination=r,$n(r)&&r.add(i)):i.destination=os,i}return e.create=function(r,i,a){return new xr(r,i,a)},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(ir),ss=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(i){ar(i)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(i){ar(i)}else ar(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){ar(r)}},t}(),xr=function(t){Re(e,t);function e(r,i,a){var c=t.call(this)||this,d;return Nt(r)||!r?d={next:r??void 0,error:i??void 0,complete:a??void 0}:d=r,c.destination=new ss(d),c}return e}(Un);function ar(t){is(t)}function as(t){throw t}var os={closed:!0,next:jn,error:as,complete:jn},cs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function us(t){return t}function ls(t){return t.length===0?us:t.length===1?t[0]:function(r){return t.reduce(function(i,a){return a(i)},r)}}var Yn=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,i){var a=this,c=fs(e)?e:new xr(e,r,i);return sr(function(){var d=a,f=d.operator,b=d.source;c.add(f?f.call(c,b):b?a._subscribe(c):a._trySubscribe(c))}),c},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var i=this;return r=Gn(r),new r(function(a,c){var d=new xr({next:function(f){try{e(f)}catch(b){c(b),d.unsubscribe()}},error:c,complete:a});i.subscribe(d)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[cs]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return ls(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=Gn(e),new e(function(i,a){var c;r.subscribe(function(d){return c=d},function(d){return a(d)},function(){return i(c)})})},t.create=function(e){return new t(e)},t}();function Gn(t){var e;return(e=t??rs.Promise)!==null&&e!==void 0?e:Promise}function ds(t){return t&&Nt(t.next)&&Nt(t.error)&&Nt(t.complete)}function fs(t){return t&&t instanceof Un||ds(t)&&$n(t)}var ps=Nn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Wn=function(t){Re(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var i=new Xn(this,this);return i.operator=r,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new ps},e.prototype.next=function(r){var i=this;sr(function(){var a,c;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var d=Ar(i.currentObservers),f=d.next();!f.done;f=d.next()){var b=f.value;b.next(r)}}catch(v){a={error:v}}finally{try{f&&!f.done&&(c=d.return)&&c.call(d)}finally{if(a)throw a.error}}}})},e.prototype.error=function(r){var i=this;sr(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var a=i.observers;a.length;)a.shift().error(r)}})},e.prototype.complete=function(){var r=this;sr(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var i=this,a=this,c=a.hasError,d=a.isStopped,f=a.observers;return c||d?zn:(this.currentObservers=null,f.push(r),new ir(function(){i.currentObservers=null,Pr(f,r)}))},e.prototype._checkFinalizedStatuses=function(r){var i=this,a=i.hasError,c=i.thrownError,d=i.isStopped;a?r.error(c):d&&r.complete()},e.prototype.asObservable=function(){var r=new Yn;return r.source=this,r},e.create=function(r,i){return new Xn(r,i)},e}(Yn),Xn=function(t){Re(e,t);function e(r,i){var a=t.call(this)||this;return a.destination=r,a.source=i,a}return e.prototype.next=function(r){var i,a;(a=(i=this.destination)===null||i===void 0?void 0:i.next)===null||a===void 0||a.call(i,r)},e.prototype.error=function(r){var i,a;(a=(i=this.destination)===null||i===void 0?void 0:i.error)===null||a===void 0||a.call(i,r)},e.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},e.prototype._subscribe=function(r){var i,a;return(a=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&a!==void 0?a:zn},e}(Wn),Bn=function(t){Re(e,t);function e(r){var i=t.call(this)||this;return i._value=r,i}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var i=t.prototype._subscribe.call(this,r);return!i.closed&&r.next(this._value),i},e.prototype.getValue=function(){var r=this,i=r.hasError,a=r.thrownError,c=r._value;if(i)throw a;return this._throwIfClosed(),c},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(Wn),Et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var or={exports:{}};or.exports,function(t,e){var r=200,i="__lodash_hash_undefined__",a=1,c=2,d=9007199254740991,f="[object Arguments]",b="[object Array]",v="[object AsyncFunction]",T="[object Boolean]",w="[object Date]",m="[object Error]",A="[object Function]",x="[object GeneratorFunction]",u="[object Map]",l="[object Number]",k="[object Null]",E="[object Object]",S="[object Promise]",h="[object Proxy]",y="[object RegExp]",_="[object Set]",g="[object String]",O="[object Symbol]",I="[object Undefined]",P="[object WeakMap]",C="[object ArrayBuffer]",H="[object DataView]",U="[object Float32Array]",L="[object Float64Array]",N="[object Int8Array]",J="[object Int16Array]",Tt="[object Int32Array]",Pt="[object Uint8Array]",xt="[object Uint8ClampedArray]",Y="[object Uint16Array]",zt="[object Uint32Array]",wt=/[\\^$.*+?()[\]{}|]/g,lt=/^\[object .+?Constructor\]$/,$t=/^(?:0|[1-9]\d*)$/,D={};D[U]=D[L]=D[N]=D[J]=D[Tt]=D[Pt]=D[xt]=D[Y]=D[zt]=!0,D[f]=D[b]=D[C]=D[T]=D[H]=D[w]=D[m]=D[A]=D[u]=D[l]=D[E]=D[y]=D[_]=D[g]=D[P]=!1;var rt=typeof Et=="object"&&Et&&Et.Object===Object&&Et,Mt=typeof self=="object"&&self&&self.Object===Object&&self,dt=rt||Mt||Function("return this")(),Ht=e&&!e.nodeType&&e,At=Ht&&!0&&t&&!t.nodeType&&t,qt=At&&At.exports===Ht,Jt=qt&&rt.process,pe=function(){try{return Jt&&Jt.binding&&Jt.binding("util")}catch{}}(),Zt=pe&&pe.isTypedArray;function he(n,s){for(var o=-1,p=n==null?0:n.length,$=0,R=[];++o<p;){var W=n[o];s(W,o,n)&&(R[$++]=W)}return R}function Qt(n,s){for(var o=-1,p=s.length,$=n.length;++o<p;)n[$+o]=s[o];return n}function me(n,s){for(var o=-1,p=n==null?0:n.length;++o<p;)if(s(n[o],o,n))return!0;return!1}function Te(n,s){for(var o=-1,p=Array(n);++o<n;)p[o]=s(o);return p}function we(n){return function(s){return n(s)}}function jt(n,s){return n.has(s)}function te(n,s){return n==null?void 0:n[s]}function z(n){var s=-1,o=Array(n.size);return n.forEach(function(p,$){o[++s]=[$,p]}),o}function j(n,s){return function(o){return n(s(o))}}function F(n){var s=-1,o=Array(n.size);return n.forEach(function(p){o[++s]=p}),o}var at=Array.prototype,ft=Function.prototype,K=Object.prototype,pt=dt["__core-js_shared__"],Z=ft.toString,It=K.hasOwnProperty,Me=function(){var n=/[^.]+$/.exec(pt&&pt.keys&&pt.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),ye=K.toString,We=RegExp("^"+Z.call(It).replace(wt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),X=qt?dt.Buffer:void 0,gt=dt.Symbol,ee=dt.Uint8Array,re=K.propertyIsEnumerable,Dt=at.splice,Ot=gt?gt.toStringTag:void 0,Ae=Object.getOwnPropertySymbols,Xe=X?X.isBuffer:void 0,Ie=j(Object.keys,Object),Be=Yt(dt,"DataView"),ge=Yt(dt,"Map"),Ke=Yt(dt,"Promise"),Ve=Yt(dt,"Set"),qe=Yt(dt,"WeakMap"),ne=Yt(Object,"create"),mr=bt(Be),Ut=bt(ge),Qr=bt(Ke),tn=bt(Ve),en=bt(qe),yr=gt?gt.prototype:void 0,Je=yr?yr.valueOf:void 0;function ot(n){var s=-1,o=n==null?0:n.length;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function rn(){this.__data__=ne?ne(null):{},this.size=0}function nn(n){var s=this.has(n)&&delete this.__data__[n];return this.size-=s?1:0,s}function sn(n){var s=this.__data__;if(ne){var o=s[n];return o===i?void 0:o}return It.call(s,n)?s[n]:void 0}function an(n){var s=this.__data__;return ne?s[n]!==void 0:It.call(s,n)}function on(n,s){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=ne&&s===void 0?i:s,this}ot.prototype.clear=rn,ot.prototype.delete=nn,ot.prototype.get=sn,ot.prototype.has=an,ot.prototype.set=on;function ht(n){var s=-1,o=n==null?0:n.length;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function cn(){this.__data__=[],this.size=0}function un(n){var s=this.__data__,o=Ce(s,n);if(o<0)return!1;var p=s.length-1;return o==p?s.pop():Dt.call(s,o,1),--this.size,!0}function ln(n){var s=this.__data__,o=Ce(s,n);return o<0?void 0:s[o][1]}function dn(n){return Ce(this.__data__,n)>-1}function fn(n,s){var o=this.__data__,p=Ce(o,n);return p<0?(++this.size,o.push([n,s])):o[p][1]=s,this}ht.prototype.clear=cn,ht.prototype.delete=un,ht.prototype.get=ln,ht.prototype.has=dn,ht.prototype.set=fn;function _t(n){var s=-1,o=n==null?0:n.length;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function pn(){this.size=0,this.__data__={hash:new ot,map:new(ge||ht),string:new ot}}function hn(n){var s=Ct(this,n).delete(n);return this.size-=s?1:0,s}function mn(n){return Ct(this,n).get(n)}function yn(n){return Ct(this,n).has(n)}function In(n,s){var o=Ct(this,n),p=o.size;return o.set(n,s),this.size+=o.size==p?0:1,this}_t.prototype.clear=pn,_t.prototype.delete=hn,_t.prototype.get=mn,_t.prototype.has=yn,_t.prototype.set=In;function De(n){var s=-1,o=n==null?0:n.length;for(this.__data__=new _t;++s<o;)this.add(n[s])}function Ir(n){return this.__data__.set(n,i),this}function Oe(n){return this.__data__.has(n)}De.prototype.add=De.prototype.push=Ir,De.prototype.has=Oe;function Rt(n){var s=this.__data__=new ht(n);this.size=s.size}function Ze(){this.__data__=new ht,this.size=0}function gn(n){var s=this.__data__,o=s.delete(n);return this.size=s.size,o}function bn(n){return this.__data__.get(n)}function _n(n){return this.__data__.has(n)}function vn(n,s){var o=this.__data__;if(o instanceof ht){var p=o.__data__;if(!ge||p.length<r-1)return p.push([n,s]),this.size=++o.size,this;o=this.__data__=new _t(p)}return o.set(n,s),this.size=o.size,this}Rt.prototype.clear=Ze,Rt.prototype.delete=gn,Rt.prototype.get=bn,Rt.prototype.has=_n,Rt.prototype.set=vn;function Sn(n,s){var o=Pe(n),p=!o&&Sr(n),$=!o&&!p&&xe(n),R=!o&&!p&&!$&&Tr(n),W=o||p||$||R,G=W?Te(n.length,String):[],Q=G.length;for(var V in n)It.call(n,V)&&!(W&&(V=="length"||$&&(V=="offset"||V=="parent")||R&&(V=="buffer"||V=="byteLength"||V=="byteOffset")||On(V,Q)))&&G.push(V);return G}function Ce(n,s){for(var o=n.length;o--;)if(vr(n[o][0],s))return o;return-1}function Qe(n,s,o){var p=s(n);return Pe(n)?p:Qt(p,o(n))}function be(n){return n==null?n===void 0?I:k:Ot&&Ot in Object(n)?Gt(n):_r(n)}function gr(n){return Ft(n)&&be(n)==f}function br(n,s,o,p,$){return n===s?!0:n==null||s==null||!Ft(n)&&!Ft(s)?n!==n&&s!==s:kn(n,s,o,p,br,$)}function kn(n,s,o,p,$,R){var W=Pe(n),G=Pe(s),Q=W?b:Lt(n),V=G?b:Lt(s);Q=Q==f?E:Q,V=V==f?E:V;var mt=Q==E,vt=V==E,nt=Q==V;if(nt&&xe(n)){if(!xe(s))return!1;W=!0,mt=!1}if(nt&&!mt)return R||(R=new Rt),W||Tr(n)?tr(n,s,o,p,$,R):Mn(n,s,Q,o,p,$,R);if(!(o&a)){var yt=mt&&It.call(n,"__wrapped__"),ct=vt&&It.call(s,"__wrapped__");if(yt||ct){var ie=yt?n.value():n,Wt=ct?s.value():s;return R||(R=new Rt),$(ie,Wt,o,p,R)}}return nt?(R||(R=new Rt),An(n,s,o,p,$,R)):!1}function En(n){if(!Er(n)||Pn(n))return!1;var s=kr(n)?We:lt;return s.test(bt(n))}function Tn(n){return Ft(n)&&rr(n.length)&&!!D[be(n)]}function wn(n){if(!xn(n))return Ie(n);var s=[];for(var o in Object(n))It.call(n,o)&&o!="constructor"&&s.push(o);return s}function tr(n,s,o,p,$,R){var W=o&a,G=n.length,Q=s.length;if(G!=Q&&!(W&&Q>G))return!1;var V=R.get(n);if(V&&R.get(s))return V==s;var mt=-1,vt=!0,nt=o&c?new De:void 0;for(R.set(n,s),R.set(s,n);++mt<G;){var yt=n[mt],ct=s[mt];if(p)var ie=W?p(ct,yt,mt,s,n,R):p(yt,ct,mt,n,s,R);if(ie!==void 0){if(ie)continue;vt=!1;break}if(nt){if(!me(s,function(Wt,ve){if(!jt(nt,ve)&&(yt===Wt||$(yt,Wt,o,p,R)))return nt.push(ve)})){vt=!1;break}}else if(!(yt===ct||$(yt,ct,o,p,R))){vt=!1;break}}return R.delete(n),R.delete(s),vt}function Mn(n,s,o,p,$,R,W){switch(o){case H:if(n.byteLength!=s.byteLength||n.byteOffset!=s.byteOffset)return!1;n=n.buffer,s=s.buffer;case C:return!(n.byteLength!=s.byteLength||!R(new ee(n),new ee(s)));case T:case w:case l:return vr(+n,+s);case m:return n.name==s.name&&n.message==s.message;case y:case g:return n==s+"";case u:var G=z;case _:var Q=p&a;if(G||(G=F),n.size!=s.size&&!Q)return!1;var V=W.get(n);if(V)return V==s;p|=c,W.set(n,s);var mt=tr(G(n),G(s),p,$,R,W);return W.delete(n),mt;case O:if(Je)return Je.call(n)==Je.call(s)}return!1}function An(n,s,o,p,$,R){var W=o&a,G=_e(n),Q=G.length,V=_e(s),mt=V.length;if(Q!=mt&&!W)return!1;for(var vt=Q;vt--;){var nt=G[vt];if(!(W?nt in s:It.call(s,nt)))return!1}var yt=R.get(n);if(yt&&R.get(s))return yt==s;var ct=!0;R.set(n,s),R.set(s,n);for(var ie=W;++vt<Q;){nt=G[vt];var Wt=n[nt],ve=s[nt];if(p)var es=W?p(ve,Wt,nt,s,n,R):p(Wt,ve,nt,n,s,R);if(!(es===void 0?Wt===ve||$(Wt,ve,o,p,R):es)){ct=!1;break}ie||(ie=nt=="constructor")}if(ct&&!ie){var wr=n.constructor,Mr=s.constructor;wr!=Mr&&"constructor"in n&&"constructor"in s&&!(typeof wr=="function"&&wr instanceof wr&&typeof Mr=="function"&&Mr instanceof Mr)&&(ct=!1)}return R.delete(n),R.delete(s),ct}function _e(n){return Qe(n,nr,Dn)}function Ct(n,s){var o=n.__data__;return Cn(s)?o[typeof s=="string"?"string":"hash"]:o.map}function Yt(n,s){var o=te(n,s);return En(o)?o:void 0}function Gt(n){var s=It.call(n,Ot),o=n[Ot];try{n[Ot]=void 0;var p=!0}catch{}var $=ye.call(n);return p&&(s?n[Ot]=o:delete n[Ot]),$}var Dn=Ae?function(n){return n==null?[]:(n=Object(n),he(Ae(n),function(s){return re.call(n,s)}))}:Ln,Lt=be;(Be&&Lt(new Be(new ArrayBuffer(1)))!=H||ge&&Lt(new ge)!=u||Ke&&Lt(Ke.resolve())!=S||Ve&&Lt(new Ve)!=_||qe&&Lt(new qe)!=P)&&(Lt=function(n){var s=be(n),o=s==E?n.constructor:void 0,p=o?bt(o):"";if(p)switch(p){case mr:return H;case Ut:return u;case Qr:return S;case tn:return _;case en:return P}return s});function On(n,s){return s=s??d,!!s&&(typeof n=="number"||$t.test(n))&&n>-1&&n%1==0&&n<s}function Cn(n){var s=typeof n;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?n!=="__proto__":n===null}function Pn(n){return!!Me&&Me in n}function xn(n){var s=n&&n.constructor,o=typeof s=="function"&&s.prototype||K;return n===o}function _r(n){return ye.call(n)}function bt(n){if(n!=null){try{return Z.call(n)}catch{}try{return n+""}catch{}}return""}function vr(n,s){return n===s||n!==n&&s!==s}var Sr=gr(function(){return arguments}())?gr:function(n){return Ft(n)&&It.call(n,"callee")&&!re.call(n,"callee")},Pe=Array.isArray;function er(n){return n!=null&&rr(n.length)&&!kr(n)}var xe=Xe||Fn;function Rn(n,s){return br(n,s)}function kr(n){if(!Er(n))return!1;var s=be(n);return s==A||s==x||s==v||s==h}function rr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=d}function Er(n){var s=typeof n;return n!=null&&(s=="object"||s=="function")}function Ft(n){return n!=null&&typeof n=="object"}var Tr=Zt?we(Zt):Tn;function nr(n){return er(n)?Sn(n):wn(n)}function Ln(){return[]}function Fn(){return!1}t.exports=Rn}(or,or.exports);var hs=or.exports;const tt=Rr(hs),ms="add",Kn="track",Vn="trackItems",ys=`${Kn}:changed`,Is=`${Vn}:changed`,qn="state",gs=`${qn}:changed`,cr="design",Jn=`${cr}:load`,Zn=`${cr}:resize`,ut="add",Qn=`${ut}:text`,ti=`${ut}:video`,ei=`${ut}:audio`,bs=`${ut}:placeholder`,ri=`${ut}:image`,ni=`${ut}:illustration`,ii=`${ut}:shape`,_s=`${ut}:mask`,vs=`${ut}:transition`,si=`${ut}:animation`,ai=`${ut}:caption`,oi=`${ut}:template`,ci=`${ut}:items`,ui=`${ut}:composition`,Bt="edit",li=`${Bt}:object`,di=`${Bt}:replaceMedia`,Ss=`${Bt}:text`,ks=`${Bt}:shape`,Es=`${Bt}:templateItem`,Ts=`${Bt}:deleteTemplateItem`,ws="enterEditMode",se="active",Ms=`${se}:set`,As=`${se}:delete`,fi=`${se}:paste`,pi=`${se}:clone`,hi=`${se}:split`,it="layer",Ds=`${it}:locked`,Os=`${it}:hidden`,Cs=`${it}:move`,Ps=`${it}:select`,xs=`${it}:selection`,Rs=`${it}:sendTo`,Ls=`${it}:rename`,Fs=`${it}:editingName`,Ns=`${it}:copy`,zs=`${it}:paste`,mi=`${it}:clone`,$s=`${it}:split`,Hs=`${it}:cut`,yi=`${it}:delete`,Ii=`${it}:replace`,Le="history",gi=`${Le}:undo`,bi=`${Le}:redo`,js=`${Le}:reset`,Lr="scale",_i=`${Lr}:changed`;var ur={exports:{}};ur.exports,function(t,e){var r=200,i="__lodash_hash_undefined__",a=9007199254740991,c="[object Arguments]",d="[object Array]",f="[object Boolean]",b="[object Date]",v="[object Error]",T="[object Function]",w="[object GeneratorFunction]",m="[object Map]",A="[object Number]",x="[object Object]",u="[object Promise]",l="[object RegExp]",k="[object Set]",E="[object String]",S="[object Symbol]",h="[object WeakMap]",y="[object ArrayBuffer]",_="[object DataView]",g="[object Float32Array]",O="[object Float64Array]",I="[object Int8Array]",P="[object Int16Array]",C="[object Int32Array]",H="[object Uint8Array]",U="[object Uint8ClampedArray]",L="[object Uint16Array]",N="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,Tt=/\w*$/,Pt=/^\[object .+?Constructor\]$/,xt=/^(?:0|[1-9]\d*)$/,Y={};Y[c]=Y[d]=Y[y]=Y[_]=Y[f]=Y[b]=Y[g]=Y[O]=Y[I]=Y[P]=Y[C]=Y[m]=Y[A]=Y[x]=Y[l]=Y[k]=Y[E]=Y[S]=Y[H]=Y[U]=Y[L]=Y[N]=!0,Y[v]=Y[T]=Y[h]=!1;var zt=typeof Et=="object"&&Et&&Et.Object===Object&&Et,wt=typeof self=="object"&&self&&self.Object===Object&&self,lt=zt||wt||Function("return this")(),$t=e&&!e.nodeType&&e,D=$t&&!0&&t&&!t.nodeType&&t,rt=D&&D.exports===$t;function Mt(n,s){return n.set(s[0],s[1]),n}function dt(n,s){return n.add(s),n}function Ht(n,s){for(var o=-1,p=n?n.length:0;++o<p&&s(n[o],o,n)!==!1;);return n}function At(n,s){for(var o=-1,p=s.length,$=n.length;++o<p;)n[$+o]=s[o];return n}function qt(n,s,o,p){for(var $=-1,R=n?n.length:0;++$<R;)o=s(o,n[$],$,n);return o}function Jt(n,s){for(var o=-1,p=Array(n);++o<n;)p[o]=s(o);return p}function pe(n,s){return n==null?void 0:n[s]}function Zt(n){var s=!1;if(n!=null&&typeof n.toString!="function")try{s=!!(n+"")}catch{}return s}function he(n){var s=-1,o=Array(n.size);return n.forEach(function(p,$){o[++s]=[$,p]}),o}function Qt(n,s){return function(o){return n(s(o))}}function me(n){var s=-1,o=Array(n.size);return n.forEach(function(p){o[++s]=p}),o}var Te=Array.prototype,we=Function.prototype,jt=Object.prototype,te=lt["__core-js_shared__"],z=function(){var n=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),j=we.toString,F=jt.hasOwnProperty,at=jt.toString,ft=RegExp("^"+j.call(F).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),K=rt?lt.Buffer:void 0,pt=lt.Symbol,Z=lt.Uint8Array,It=Qt(Object.getPrototypeOf,Object),Me=Object.create,ye=jt.propertyIsEnumerable,We=Te.splice,X=Object.getOwnPropertySymbols,gt=K?K.isBuffer:void 0,ee=Qt(Object.keys,Object),re=Ct(lt,"DataView"),Dt=Ct(lt,"Map"),Ot=Ct(lt,"Promise"),Ae=Ct(lt,"Set"),Xe=Ct(lt,"WeakMap"),Ie=Ct(Object,"create"),Be=bt(re),ge=bt(Dt),Ke=bt(Ot),Ve=bt(Ae),qe=bt(Xe),ne=pt?pt.prototype:void 0,mr=ne?ne.valueOf:void 0;function Ut(n){var s=-1,o=n?n.length:0;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function Qr(){this.__data__=Ie?Ie(null):{}}function tn(n){return this.has(n)&&delete this.__data__[n]}function en(n){var s=this.__data__;if(Ie){var o=s[n];return o===i?void 0:o}return F.call(s,n)?s[n]:void 0}function yr(n){var s=this.__data__;return Ie?s[n]!==void 0:F.call(s,n)}function Je(n,s){var o=this.__data__;return o[n]=Ie&&s===void 0?i:s,this}Ut.prototype.clear=Qr,Ut.prototype.delete=tn,Ut.prototype.get=en,Ut.prototype.has=yr,Ut.prototype.set=Je;function ot(n){var s=-1,o=n?n.length:0;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function rn(){this.__data__=[]}function nn(n){var s=this.__data__,o=Oe(s,n);if(o<0)return!1;var p=s.length-1;return o==p?s.pop():We.call(s,o,1),!0}function sn(n){var s=this.__data__,o=Oe(s,n);return o<0?void 0:s[o][1]}function an(n){return Oe(this.__data__,n)>-1}function on(n,s){var o=this.__data__,p=Oe(o,n);return p<0?o.push([n,s]):o[p][1]=s,this}ot.prototype.clear=rn,ot.prototype.delete=nn,ot.prototype.get=sn,ot.prototype.has=an,ot.prototype.set=on;function ht(n){var s=-1,o=n?n.length:0;for(this.clear();++s<o;){var p=n[s];this.set(p[0],p[1])}}function cn(){this.__data__={hash:new Ut,map:new(Dt||ot),string:new Ut}}function un(n){return _e(this,n).delete(n)}function ln(n){return _e(this,n).get(n)}function dn(n){return _e(this,n).has(n)}function fn(n,s){return _e(this,n).set(n,s),this}ht.prototype.clear=cn,ht.prototype.delete=un,ht.prototype.get=ln,ht.prototype.has=dn,ht.prototype.set=fn;function _t(n){this.__data__=new ot(n)}function pn(){this.__data__=new ot}function hn(n){return this.__data__.delete(n)}function mn(n){return this.__data__.get(n)}function yn(n){return this.__data__.has(n)}function In(n,s){var o=this.__data__;if(o instanceof ot){var p=o.__data__;if(!Dt||p.length<r-1)return p.push([n,s]),this;o=this.__data__=new ht(p)}return o.set(n,s),this}_t.prototype.clear=pn,_t.prototype.delete=hn,_t.prototype.get=mn,_t.prototype.has=yn,_t.prototype.set=In;function De(n,s){var o=er(n)||Pe(n)?Jt(n.length,String):[],p=o.length,$=!!p;for(var R in n)F.call(n,R)&&!($&&(R=="length"||Cn(R,p)))&&o.push(R);return o}function Ir(n,s,o){var p=n[s];(!(F.call(n,s)&&Sr(p,o))||o===void 0&&!(s in n))&&(n[s]=o)}function Oe(n,s){for(var o=n.length;o--;)if(Sr(n[o][0],s))return o;return-1}function Rt(n,s){return n&&tr(s,nr(s),n)}function Ze(n,s,o,p,$,R,W){var G;if(p&&(G=R?p(n,$,R,W):p(n)),G!==void 0)return G;if(!Ft(n))return n;var Q=er(n);if(Q){if(G=Dn(n),!s)return wn(n,G)}else{var V=Gt(n),mt=V==T||V==w;if(kr(n))return Ce(n,s);if(V==x||V==c||mt&&!R){if(Zt(n))return R?n:{};if(G=Lt(mt?{}:n),!s)return Mn(n,Rt(G,n))}else{if(!Y[V])return R?n:{};G=On(n,V,Ze,s)}}W||(W=new _t);var vt=W.get(n);if(vt)return vt;if(W.set(n,G),!Q)var nt=o?An(n):nr(n);return Ht(nt||n,function(yt,ct){nt&&(ct=yt,yt=n[ct]),Ir(G,ct,Ze(yt,s,o,p,ct,n,W))}),G}function gn(n){return Ft(n)?Me(n):{}}function bn(n,s,o){var p=s(n);return er(n)?p:At(p,o(n))}function _n(n){return at.call(n)}function vn(n){if(!Ft(n)||xn(n))return!1;var s=rr(n)||Zt(n)?ft:Pt;return s.test(bt(n))}function Sn(n){if(!_r(n))return ee(n);var s=[];for(var o in Object(n))F.call(n,o)&&o!="constructor"&&s.push(o);return s}function Ce(n,s){if(s)return n.slice();var o=new n.constructor(n.length);return n.copy(o),o}function Qe(n){var s=new n.constructor(n.byteLength);return new Z(s).set(new Z(n)),s}function be(n,s){var o=s?Qe(n.buffer):n.buffer;return new n.constructor(o,n.byteOffset,n.byteLength)}function gr(n,s,o){var p=s?o(he(n),!0):he(n);return qt(p,Mt,new n.constructor)}function br(n){var s=new n.constructor(n.source,Tt.exec(n));return s.lastIndex=n.lastIndex,s}function kn(n,s,o){var p=s?o(me(n),!0):me(n);return qt(p,dt,new n.constructor)}function En(n){return mr?Object(mr.call(n)):{}}function Tn(n,s){var o=s?Qe(n.buffer):n.buffer;return new n.constructor(o,n.byteOffset,n.length)}function wn(n,s){var o=-1,p=n.length;for(s||(s=Array(p));++o<p;)s[o]=n[o];return s}function tr(n,s,o,p){o||(o={});for(var $=-1,R=s.length;++$<R;){var W=s[$],G=void 0;Ir(o,W,G===void 0?n[W]:G)}return o}function Mn(n,s){return tr(n,Yt(n),s)}function An(n){return bn(n,nr,Yt)}function _e(n,s){var o=n.__data__;return Pn(s)?o[typeof s=="string"?"string":"hash"]:o.map}function Ct(n,s){var o=pe(n,s);return vn(o)?o:void 0}var Yt=X?Qt(X,Object):Ln,Gt=_n;(re&&Gt(new re(new ArrayBuffer(1)))!=_||Dt&&Gt(new Dt)!=m||Ot&&Gt(Ot.resolve())!=u||Ae&&Gt(new Ae)!=k||Xe&&Gt(new Xe)!=h)&&(Gt=function(n){var s=at.call(n),o=s==x?n.constructor:void 0,p=o?bt(o):void 0;if(p)switch(p){case Be:return _;case ge:return m;case Ke:return u;case Ve:return k;case qe:return h}return s});function Dn(n){var s=n.length,o=n.constructor(s);return s&&typeof n[0]=="string"&&F.call(n,"index")&&(o.index=n.index,o.input=n.input),o}function Lt(n){return typeof n.constructor=="function"&&!_r(n)?gn(It(n)):{}}function On(n,s,o,p){var $=n.constructor;switch(s){case y:return Qe(n);case f:case b:return new $(+n);case _:return be(n,p);case g:case O:case I:case P:case C:case H:case U:case L:case N:return Tn(n,p);case m:return gr(n,p,o);case A:case E:return new $(n);case l:return br(n);case k:return kn(n,p,o);case S:return En(n)}}function Cn(n,s){return s=s??a,!!s&&(typeof n=="number"||xt.test(n))&&n>-1&&n%1==0&&n<s}function Pn(n){var s=typeof n;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?n!=="__proto__":n===null}function xn(n){return!!z&&z in n}function _r(n){var s=n&&n.constructor,o=typeof s=="function"&&s.prototype||jt;return n===o}function bt(n){if(n!=null){try{return j.call(n)}catch{}try{return n+""}catch{}}return""}function vr(n){return Ze(n,!0,!0)}function Sr(n,s){return n===s||n!==n&&s!==s}function Pe(n){return Rn(n)&&F.call(n,"callee")&&(!ye.call(n,"callee")||at.call(n)==c)}var er=Array.isArray;function xe(n){return n!=null&&Er(n.length)&&!rr(n)}function Rn(n){return Tr(n)&&xe(n)}var kr=gt||Fn;function rr(n){var s=Ft(n)?at.call(n):"";return s==T||s==w}function Er(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=a}function Ft(n){var s=typeof n;return!!n&&(s=="object"||s=="function")}function Tr(n){return!!n&&typeof n=="object"}function nr(n){return xe(n)?De(n):Sn(n)}function Ln(){return[]}function Fn(){return!1}t.exports=vr}(ur,ur.exports);var Us=ur.exports;const B=Rr(Us),ke=t=>new Promise((e,r)=>{const i=new Image;console.warn("update cdn config for cors?"),i.onload=()=>{const a=i.width,c=i.height;e({width:a,height:c})},i.onerror=a=>{r(a)},i.crossOrigin="anonymous",i.src=t}),vi=t=>new Promise((e,r)=>{const i=new Audio;i.preload="auto",i.addEventListener("loadedmetadata",()=>{const a=i.duration*1e3;e({duration:a})}),i.addEventListener("error",a=>{r(a)}),i.src=t,i.crossOrigin="anonymous",i.load()}),Fr=t=>new Promise((e,r)=>{const i=document.createElement("video");i.preload="auto",i.addEventListener("loadedmetadata",()=>{const a=i.duration*1e3,c=i.videoWidth,d=i.videoHeight;e({duration:a,width:c,height:d})}),i.addEventListener("error",a=>{r(a)}),i.src=t,i.load()}),Ys=async t=>{var a,c;const e=t.duration,r=(a=t.details)==null?void 0:a.width,i=(c=t.details)==null?void 0:c.height;return e&&r&&i?{duration:e,width:r,height:i}:Fr(t.details.src)},Si=(t,e)=>{const r=document.createElement("div");Object.keys(e).forEach(a=>{a!=="height"&&(r.style[a]=e[a])}),document.body.appendChild(r),r.textContent=t,r.style.whiteSpace="normal",r.style.position="absolute",r.style.visibility="hidden",r.style.display="inline-block",r.style.width=e.width+"px",r.style.fontSize=e.fontSize+"px";const i=getComputedStyle(r).height;return document.body.removeChild(r),parseFloat(i)},lr=t=>{const e=t.map(r=>new FontFace(r.fontFamily,`url(${r.url})`).load().catch(i=>i));return e.length===0?Promise.resolve(!0):new Promise((r,i)=>{Promise.all(e).then(a=>{a.forEach(c=>{c&&c.family&&(document.fonts.add(c),r(!0))})}).catch(a=>i(a))})},Gs="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Fe=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Gs[r[t]&63];return e};function Ee(t=16){const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r=e.charAt(Math.floor(Math.random()*e.length));let i=Fe(t-1);return i=i.replace(/[^a-zA-Z0-9]/g,"").slice(0,t-1),r+i}function Ws(t){const e=/#([0-9a-fA-F]{3,6})\b/g,r=/rgb\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)/g,i=/rgba\(\s*(\d+),\s*(\d+),\s*(\d+),\s*([0-9.]+)\s*\)/g;function a(d){return d.length===3?`#${d[0]}${d[0]}${d[1]}${d[1]}${d[2]}${d[2]}`.toUpperCase():`#${d.toUpperCase()}`}function c(d,f,b){return`#${(1<<24|d<<16|f<<8|b).toString(16).slice(1).toUpperCase()}`}return t=t.replace(e,(d,f)=>a(f)),t=t.replace(r,(d,f,b,v)=>c(+f,+b,+v)),t=t.replace(i,(d,f,b,v)=>c(+f,+b,+v)),t}function st(t){return/^#[0-9a-fA-F]{3}$/.test(t)?"#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]:t}function ki(t,e){let r=t;for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const a=new RegExp(i,"g");r=r.replace(a,e[i])}return r}function Ei(t){const e=t.getAttribute("fill");if(e&&e.trim()!==""&&e.trim()!=="none")return e.trim();const r=t.getAttribute("style");if(r){const a=/fill\s*:\s*([^;]+);?/.exec(r);if(a){const c=a[1].trim();if(c!==""&&c!=="none")return c}}const i=t.parentElement;return i?Ei(i):null}function Ne(t){return/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(t)}const Xs=t=>{const e=`.${t.split(".").filter(c=>c.includes("fill:")).join(".")}`,r={},i=/\.([\w-]+)\s*\{\s*([^}]+)\s*\}/g;let a;for(;(a=i.exec(e))!==null;){const c=a[1],d=a[2],f={},b=/fill\s*:\s*([^;]+);?/.exec(d),v=/stroke\s*:\s*([^;]+);?/.exec(d);b&&(f.fill=st(b[1].trim())),v&&(f.stroke=st(v[1].trim())),r[c]=f}return r};function Nr(t){let e=t.parentElement;for(;e;){if(e.tagName.toLowerCase()==="mask")return!0;e=e.parentElement}return!1}function Bs(t,e,r=300,i=300){const a=[],d=new DOMParser().parseFromString(t,"image/svg+xml"),f=d.documentElement;f.setAttribute("width",`${r}`),f.setAttribute("height",`${i}`);const b=f.querySelectorAll("style"),v={};b.forEach(u=>{const l=u.textContent||"",k=Xs(l);Object.assign(v,k);const E=l.replace(/\.(st[\w-]+)/g,`.${e}-$1`).replace(/url\(#(.*?)\)/g,`url(#${e}-$1)`);u.textContent=E;const S=Array.from(d.querySelectorAll("*")),h=new Set;S.forEach(y=>{if(Nr(y))return;["fill","stroke","stop-color"].forEach(O=>{const I=y.getAttribute(O);I&&!["none","transparent"].includes(I)&&h.add(st(I))});const _=y.getAttribute("style");if(_){const O=/fill\s*:\s*([^;]+);?/.exec(_),I=/stroke\s*:\s*([^;]+);?/.exec(_),P=/stop-color\s*:\s*([^;]+);?/.exec(_);if(O){const C=O[1].trim();C&&!["none","transparent"].includes(C)&&Ne(st(C))&&h.add(st(C))}if(I){const C=I[1].trim();C&&!["none","transparent"].includes(C)&&Ne(st(C))&&h.add(st(C))}if(P){const C=P[1].trim();C&&!["none","transparent"].includes(C)&&Ne(st(C))&&h.add(st(C))}}const g=y.getAttribute("class");g&&g.split(" ").forEach(O=>{const I=v[O];I!=null&&I.fill&&!["none","transparent"].includes(I.fill)&&h.add(st(I.fill)),I!=null&&I.stroke&&!["none","transparent"].includes(I.stroke)&&h.add(st(I.stroke))})}),Array.from(h).forEach(y=>{Ne(y)&&a.push(y)})});const T=Array.from(d.querySelectorAll("*")),w=new Set;return T.forEach(u=>{if(Nr(u))return;const l=u.getAttribute("class");if(l){const E=l.split(" ").map(S=>`${e}-${S}`).join(" ");u.setAttribute("class",E),E.split(" ").forEach(S=>{const h=v[S];h!=null&&h.fill&&!["none","transparent"].includes(h.fill)&&w.add(st(h.fill)),h!=null&&h.stroke&&!["none","transparent"].includes(h.stroke)&&w.add(st(h.stroke))})}["fill","stroke","stop-color"].forEach(E=>{const S=u.getAttribute(E);S&&!["none","transparent"].includes(S)&&w.add(st(S))});const k=u.getAttribute("style");if(k){const E=/fill\s*:\s*([^;]+);?/.exec(k),S=/stroke\s*:\s*([^;]+);?/.exec(k),h=/stop-color\s*:\s*([^;]+);?/.exec(k);if(E){const y=E[1].trim();y&&!["none","transparent"].includes(y)&&w.add(st(y))}if(S){const y=S[1].trim();y&&!["none","transparent"].includes(y)&&w.add(st(y))}if(h){const y=h[1].trim();y&&!["none","transparent"].includes(y)&&w.add(st(y))}}}),w.forEach(u=>!a.includes(u)&&Ne(u)&&a.push(u)),Array.from(d.querySelectorAll("*")).forEach(u=>{if(u.hasAttribute("id")){const l=u.getAttribute("id");u.setAttribute("id",`${e}-${l}`)}if(["fill","stroke","stop-color","filter","clip-path","mask"].forEach(l=>{const k=u.getAttribute(l);k&&k.includes("url(#")&&u.setAttribute(l,k.replace(/url\(#(.*?)\)/g,`url(#${e}-$1)`))}),u.hasAttribute("style")){const l=u.getAttribute("style");l.includes("url(#")&&u.setAttribute("style",l.replace(/url\(#(.*?)\)/g,`url(#${e}-$1)`))}}),Array.from(d.querySelectorAll("path")).forEach(u=>{if(Nr(u))return;!Ei(u)&&!u.getAttribute("class")&&(u.setAttribute("fill","#000000"),a.includes("#000000")||a.push("#000000"))}),{serializer:new XMLSerializer().serializeToString(d),colors:a}}const dr={color:"#000000",x:0,y:0,blur:0},ae=(t,e)=>{let r=e!=null&&e.trim?e.trim.to-e.trim.from:(e==null?void 0:e.duration)||5e3;const i={from:0,to:r};if(!t)return i;if(t.from<0)return console.error("'from' must be a non-negative number. Returning default display."),i;if(t.from!==void 0&&t.to===void 0)return{from:t.from,to:t.from+r};if(t.to!==void 0){if(t.to<0)return console.error("'to' must be a non-negative number. Returning default display."),i;if(t.to<t.from)return console.error("'to' must be greater than or equal to 'from'. Returning default display."),i}return t},Ti=(t,e)=>t?t.from&&!t.to?{from:t.from,to:e.duration}:t:{from:0,to:e.duration};function Kt(t,e){const r=t.scaleMode,i={x:t.size.width/2,y:t.size.height/2},a={x:e.width/2,y:e.height/2};let c;r==="fill"?c=Math.max(t.size.width/e.width,t.size.height/e.height):c=Math.min(t.size.width/e.width,t.size.height/e.height);const d=i.x-a.x;return{top:`${i.y-a.y}px`,left:`${d}px`,transform:`scale(${c})`}}const wi=async(t,e)=>{const r=t.details.src,i=await Ys(t),a=Kt(e,{...i}),c=Ti(t.trim,{duration:i.duration}),d={width:i.width,height:i.height,opacity:100,src:r,volume:t.details.volume??100,borderRadius:t.details.borderRadius??0,borderWidth:t.details.borderWidth??0,borderColor:t.details.borderColor||"#000000",boxShadow:t.details.boxShadow||dr,top:t.details.top||a.top||"0px",left:t.details.left||a.left||"0px",transform:t.details.transform||a.transform,blur:t.details.blur||0,brightness:t.details.brightness||100,flipX:t.details.flipX||!1,flipY:t.details.flipY||!1,rotate:t.details.rotate||"0deg",visibility:t.details.visibility||"visible"};return{...t,trim:c,type:"video",name:"video",details:d,playbackRate:t.playbackRate||1,display:ae(t.display,{duration:i.duration,trim:c}),duration:i.duration}},Mi=async t=>{const e=t.id,r=t.details,a=(await vi(r.src)).duration,c=Ti(t.trim,{duration:a});return{id:e,name:t.name||"audio",type:"audio",display:ae(t.display,{duration:a,trim:c}),trim:c,playbackRate:t.playbackRate||1,details:{src:r.src,volume:r.volume??100},metadata:{...t.metadata},duration:a}},Ai=async(t,e)=>{var w;const r=t.trackItemIds,i=t.size||{width:t.details.width,height:t.details.height},a=Math.min(e.size.width/i.width,e.size.height/i.height),c=((w=t.details)==null?void 0:w.rotate)||0,d=Kt(e,i),f=t.display;let b=1/0,v=0;r.forEach(m=>{const A=t.trackItemsMap[m];A.display.from<b&&(b=A.display.from),A.display.to>v&&(v=A.display.to)});const T=t.trim||t.display||{from:b,to:v};return{id:t.id,type:"template",details:{...i,top:t.details.top||d.top,left:t.details.left||d.left,scale:a,rotate:c},trim:T,display:f||{from:b,to:v},activeEdit:!1}},Ks=async(t,e)=>{var T;const r=t.trackItemIds,i=t.size||{width:t.details.width,height:t.details.height},a=Math.min(e.size.width/i.width,e.size.height/i.height),c=((T=t.details)==null?void 0:T.rotate)||0,d=Kt(e,i),f=t.display;let b=1/0,v=0;return r.forEach(w=>{const m=t.trackItemsMap[w];m.display.from<b&&(b=m.display.from),m.display.to>v&&(v=m.display.to)}),{id:t.id,type:"composition",details:{...i,top:t.details.top||d.top,left:t.details.left||d.left,scale:a,rotate:c},display:f||{from:b,to:v}}},Di=async(t,e)=>{const r=t.details,i=ke(r.src),a=fetch(r.src),[c,d]=await Promise.all([i,a]),f=await d.text(),b=Kt(e,c),{serializer:v,colors:T}=Bs(Ws(f),t.id,parseFloat(r.width||c.width),parseFloat(r.height||c.height)),w=t.details.colorMap||Object.fromEntries(T.map(m=>[m,m]));return{id:t.id,name:"illustration",type:t.type,display:ae(t.display),playbackRate:t.playbackRate||1,details:{src:r.src||"",width:r.width||c.width||100,height:r.height||c.height||100,opacity:r.opacity??100,transform:r.transform||b.transform,border:r.border||"none",borderRadius:r.borderRadius||0,top:r.top||b.top||"0px",left:r.left||b.left||"0px",borderWidth:r.borderWidth??0,borderColor:r.borderColor||"#000000",flipX:r.flipX||!1,flipY:r.flipY||!1,rotate:r.rotate||"0deg",visibility:r.visibility||"visible",svgString:v,initialSvgString:B(v),colorMap:w},metadata:t.metadata||{}}},Vs=async(t,e)=>{const r=t.details,i=ke(r.src),[a]=await Promise.all([i]),c=Kt(e,a);return{id:t.id,name:"shape",type:t.type,display:ae(t.display),playbackRate:t.playbackRate||1,details:{src:r.src||"",width:r.width||a.width||100,height:r.height||a.height||100,opacity:r.opacity??100,transform:r.transform||c.transform,border:r.border||"none",borderRadius:r.borderRadius||0,top:r.top||c.top||"0px",left:r.left||c.left||"0px",borderWidth:r.borderWidth??0,borderColor:r.borderColor||"#000000",flipX:r.flipX||!1,flipY:r.flipY||!1,rotate:r.rotate||"0deg",visibility:r.visibility||"visible",backgroundColor:r.backgroundColor||"#808080"},metadata:t.metadata||{}}},Oi=async(t,e)=>{const r=t.details,i=await ke(r.src),a=Kt(e,i);return{id:t.id,type:"image",name:"image",display:ae(t.display),playbackRate:t.playbackRate||1,details:{src:r.src||"",width:r.width||i.width||100,height:r.height||i.height||100,opacity:r.opacity??100,transform:r.transform||a.transform,border:r.border||"none",borderRadius:r.borderRadius||0,boxShadow:r.boxShadow||dr,top:r.top||a.top||"0px",left:r.left||a.left||"0px",borderWidth:r.borderWidth??0,borderColor:r.borderColor||"#000000",blur:r.blur||0,brightness:r.brightness||100,flipX:r.flipX||!1,flipY:r.flipY||!1,rotate:r.rotate||"0deg",visibility:r.visibility||"visible"},metadata:t.metadata||{}}},Ci=async(t,e)=>{const r=t;r.details.fontUrl&&await lr([{fontFamily:r.details.fontFamily,url:r.details.fontUrl}]);const i=r.id,a=r.details,c=xi(a),d=Si(r.details.text,c),f=Kt(e,{width:c.width,height:d});return{id:i,name:"caption",type:"caption",display:ae(r.display),details:{...c,text:a.text||"",height:d,fontUrl:a.fontUrl,top:c.top||f.top,left:c.left||f.left,borderWidth:a.borderWidth||0,borderColor:a.borderColor||"#000000",boxShadow:a.boxShadow||dr,words:a.words||[],appearedColor:a.appearedColor||a.color,activeColor:a.activeColor||a.color,activeFillColor:a.activeFillColor||"transparent"},metadata:t.metadata||{}}},Pi=async(t,e)=>{t.details.fontUrl&&await lr([{fontFamily:t.details.fontFamily,url:t.details.fontUrl}]);const r=t.id,i=t.details,a=xi(i),c=Si(t.details.text,a),d=Kt(e,{width:a.width,height:c});return{id:r,name:"text",type:"text",display:ae(t.display),details:{...a,text:i.text||"",height:c,fontUrl:i.fontUrl,top:a.top||d.top,left:a.left||d.left,borderWidth:i.borderWidth||0,borderColor:i.borderColor||"#000000",boxShadow:i.boxShadow||dr},metadata:{}}},xi=t=>({fontFamily:t.fontFamily||"Arial",fontSize:t.fontSize||"16px",fontWeight:t.fontWeight||"normal",fontStyle:t.fontStyle||"normal",textDecoration:t.textDecoration||"none",textAlign:t.textAlign||"left",lineHeight:t.lineHeight||"normal",letterSpacing:t.letterSpacing||"normal",wordSpacing:t.wordSpacing||"normal",color:t.color||"#ffffff",backgroundColor:t.backgroundColor||"transparent",border:t.border||"none",textShadow:t.textShadow||"none",text:t.text||"",opacity:t.opacity??100,width:t.width||300,wordWrap:t.wordWrap||"normal",wordBreak:t.wordBreak||"normal",WebkitTextStrokeColor:t.WebkitTextStrokeColor||"#ffffff",WebkitTextStrokeWidth:t.WebkitTextStrokeWidth||"0px",top:t.top,left:t.left,textTransform:t.textTransform||"none",transform:t.transform||"none",skewX:t.skewX||0,skewY:t.skewY||0}),qs=async(t,e)=>{switch(t.type){case"video":return wi(t,e||{});case"audio":return Mi(t);case"image":return Oi(t,e||{});case"text":return Pi(t,e||{});case"caption":return Ci(t,e||{});case"template":return Ai(t,{size:e==null?void 0:e.size});default:throw new Error("Unsupported track item")}};function Js(t,e){return e.some(r=>t.some(i=>i.id===r.id))}const Zs=(t=[],e=[])=>t.length===0?e.map(i=>({id:Ee(),items:[i.id],type:i.type,accepts:["text","image","video","audio","caption","template"]})):t.map(r=>({...r,items:r.items||[],accepts:["audio","video","image","text","caption","template"],type:r.type||"text",magnetic:r.magnetic||!1,static:r.static||!1,id:r.id||Ee()}));function Qs(t,e){return t.filter(i=>{if(e.forEach(a=>{i.items.includes(a)&&(i.items=i.items.filter(c=>c!==a))}),i.items.length!==0||i.static)return i})}const oe=t=>Object.keys(t).reduce((e,r)=>{const{display:i,playbackRate:a}=t[r];return Math.max(e,i.to/(a||1))},0);function zr(t,e,r){return Math.min(Math.max(t,e),r)}const ta=(t,e,r,i,a)=>{if(i===void 0&&a===void 0)return{trackId:void 0,trackIndex:void 0};const c=a!==void 0?e[zr(a,0,e.length)]:e.find(b=>b.id===i);if(!c)return{trackId:void 0,trackIndex:a!==void 0?zr(a,0,e.length):void 0};const d=c.items.map(b=>r[b]),f=t.map(b=>r[b]);for(const b of d){const v=b.display.from,T=b.display.to;for(const w of f){const m=w.display.from;if(!(w.display.to<=v||m>=T))return{trackId:void 0,trackIndex:e.indexOf(c)}}}return{trackId:c.id,trackIndex:e.indexOf(c)}},Ri=(t,e)=>{var f,b;const r=((f=t.details.crop)==null?void 0:f.width)||t.details.width||0,i=((b=t.details.crop)==null?void 0:b.height)||t.details.height||0;let a=e.width,c=e.height;const d=e.width/e.height;return r/i>d?(a=r,c=r/d):(c=i,a=i*d),{newWidth:a,newHeight:c,crop:{x:0,y:0,height:i,width:r}}},Li=(t,e)=>{const r=B(t.trim),i=B(t.display);return e.duration<t.display.to&&(i.to=e.duration,r&&(r.to=e.duration)),{duration:e.duration,trim:r,display:i}},ea=t=>{const{trackItemIds:e,transitionsMap:r,trackItemsMap:i}=t,a=new Map;Object.values(r).forEach(v=>{var A,x;const{fromId:T,toId:w,kind:m}=v;m!=="none"&&(a.has(T)||a.set(T,[]),a.has(w)||a.set(w,[]),(A=a.get(T))==null||A.push(v),(x=a.get(w))==null||x.push(v))});const c=[],d=new Set,f=v=>{const T=[];let w=v;for(;w&&!d.has(w);){d.add(w);const m=i[w];T.push(m);const A=Object.values(r).find(x=>x.fromId===w&&x.kind!=="none");if(!A)break;T.push(A),w=A.toId}return T},b=Object.values(r).filter(v=>v.kind!=="none");for(const v of e)if(!d.has(v)&&(!a.has(v)||!b.some(T=>T.toId===v))){const T=f(v);T.length>0&&c.push(T)}return c.forEach(v=>{v.sort((T,w)=>"display"in T&&"display"in w?T.display.from-w.display.from:0)}),c.filter(v=>v.filter(w=>w!==void 0).length>0)};function Fi(t,e,r){t.forEach(i=>{const d=Object.values(e).filter(v=>i.items.includes(v.id)).sort((v,T)=>v.display.from-T.display.from).map(v=>v.id),f=ea({trackItemIds:d,transitionsMap:r,trackItemsMap:e});let b=0;d.forEach(v=>{const T=[];for(const m of f)if(m.find(A=>A.id===v)){const A=f.findIndex(x=>x.find(u=>u.id===v));if(A-1>=0)for(let x=A-1;x>=0;x--){const u=f[x];T.push(u)}}let w=0;if(T.forEach(m=>{m.forEach(A=>{A.type==="transition"&&(w+=A.duration)})}),e[v]){const m=e[v].display.to-e[v].display.from;e[v].display={from:b-w,to:b+m-w},b+=m}})})}function ra(t,e){let i=e.reduce((a,c)=>c.display.to>a.display.to?c:a,{display:{to:0}}).display.to;t.forEach(a=>{const c=a.display.from,f=a.display.to-c;a.display.from=i,a.display.to=a.display.from+f,i=a.display.to})}function na(t){const e=t,r=e.tracks,i=e.trackItemsMap,a=[],c={},d=e.structure;return r.forEach(f=>{var v;const b=f.items.map(T=>i[T]).sort((T,w)=>T.display.from-w.display.from);for(let T=0;T<b.length-1;T++){const w=b[T],m=b[T+1];if(Math.abs(w.display.to-m.display.from)<=1){const A=`${w.id}-${m.id}`;if((v=e.transitionIds)==null?void 0:v.includes(A))c[A]=e.transitionsMap[A];else{const u={id:A,duration:1500,fromId:w.id,toId:m.id,kind:"none",trackId:f.id,type:"transition"};c[A]=u}a.push(A)}}}),d.forEach(f=>{f.transitions.forEach(b=>{c[b]={...e.transitionsMap[b],trackId:f.id}})}),e.transitionIds=a,e.transitionsMap=c,{transitionIds:a,transitionsMap:c}}function ia(t,e,r){const i=t.toId,a=r[i],c=e.find(d=>d.items.includes(i));c&&(c.magnetic||c.items.forEach(d=>{const f=r[d];f.display.from>a.display.from&&(f.display.from=f.display.from+t.duration,f.display.to=f.display.to+t.duration)}))}function sa(t){const e=q.subject.pipe(q.filter(({key:u})=>u.startsWith(cr))),r=q.subject.pipe(q.filter(({key:u})=>u.startsWith(ut))),i=q.subject.pipe(q.filter(({key:u})=>u.startsWith(it))),a=q.subject.pipe(q.filter(({key:u})=>u.startsWith(Le))),c=q.subject.pipe(q.filter(({key:u})=>u.startsWith(se))),d=q.subject.pipe(q.filter(({key:u})=>u.startsWith(Bt))),f=q.subject.pipe(q.filter(({key:u})=>u.startsWith(Lr))),b=e.subscribe(async u=>{var l,k;if(u.key===Jn){const E=(l=u.value)==null?void 0:l.payload,S=E.trackItemsMap,h=E.trackItemDetailsMap;console.warn("IMPROVE FONTS LOADING");for(const _ in h)if(h[_].type==="text"||h[_].type==="caption"){const g=h[_].details;await lr([{fontFamily:g.fontFamily,url:g.fontUrl}])}else if(h[_].type==="illustration"){const g=S[_],O=h[_].details,I=await Di({...g,details:O},{size:{width:O.width,height:O.height}}),P=ki(I.details.svgString,O.colorMap);I.details.svgString=P,h[_].details=I.details,S[_]=I}const y=oe(S);t.updateState({...E,duration:y},{kind:"design:load",updateHistory:!1})}if(u.key===Zn){const E=(k=u.value)==null?void 0:k.payload;t.updateState({size:E},{kind:"design:resize",updateHistory:!1})}}),v=a.subscribe(u=>{if(u.key===gi)return t.undo();if(u.key===bi)return t.redo()}),T=f.subscribe(u=>{var l;if(u.key===_i){const k=(l=u.value)==null?void 0:l.payload.scale;t.updateState({scale:k},{kind:"update",updateHistory:!1})}}),w=i.subscribe(async u=>{var k,E,S,h,y;const l=[];if((k=u.value)!=null&&k.payload.trackItemIds&&(l.push((E=u.value)==null?void 0:E.payload.trackItemIds),t.updateState({activeIds:l},{kind:"update",updateHistory:!1})),u.key===yi){const _=(S=u.value)==null?void 0:S.payload.trackItemIds,g=B(t.getState()),O=_&&_.length?_:g.activeIds,I=O.map(D=>g.trackItemsMap[D]).filter(D=>!!D).map(D=>D.id),P=g.transitionIds.filter(D=>{const rt=g.transitionsMap[D];return I.includes(rt.fromId)||I.includes(rt.toId)});I.push(...P);const C={},H=g.trackItemIds,U=g.transitionIds,L=g.trackItemDetailsMap,N=B(g.tracks),J=B(g.structure);I.forEach(D=>{var Mt;const rt=g.trackItemsMap[D]||g.transitionsMap[D];if(rt.type==="template"||rt.type==="caption"){const dt=(Mt=g.structure.find(At=>At.id===rt.id))==null?void 0:Mt.items;I.push(...dt);const Ht=J.findIndex(At=>At.id===rt.id);J.splice(Ht,1)}}),I.forEach(D=>{J.forEach(rt=>{rt.items.includes(D)&&(rt.items=rt.items.filter(Mt=>Mt!==D))})});const Tt=H.filter(D=>!I.includes(D));U.forEach(D=>{O.includes(D)&&O.length===1&&(C[D]=B(g.transitionsMap[D]))});const Pt=U.filter(D=>!I.includes(D)&&!O.includes(D)),xt=Object.fromEntries(Object.entries(L).filter(([D])=>!I.includes(D))),Y=Object.fromEntries(Object.entries(g.transitionsMap).filter(([D])=>!I.includes(D)));Object.keys(Y).forEach(D=>{O.includes(D)&&(Y[D].kind="none")});const zt=Qs(g.tracks,I),wt=Object.fromEntries(Object.entries(g.trackItemsMap).filter(([D])=>!I.includes(D))),lt=N.filter(D=>D.magnetic);Fi(lt,wt,g.transitionsMap);const $t=oe(wt);Object.keys(C).forEach(D=>{ia(C[D],zt,wt)}),t.updateState({trackItemIds:Tt,trackItemDetailsMap:xt,activeIds:[],trackItemsMap:wt,tracks:zt,duration:$t,structure:J,transitionIds:Pt,transitionsMap:Y},{updateHistory:!0,kind:"remove"})}if(u.key===mi){const _=B(t.getState()),g={},O=((h=u.value)==null?void 0:h.payload.trackItemIds)||_.activeIds;if(O.length===0)return;O.forEach(P=>{const C=_.trackItemsMap[P],H=_.trackItemDetailsMap[P],U=Ee();_.trackItemsMap[U]={...B(C),id:U},_.trackItemDetailsMap[U]={...B(H)},_.trackItemIds.push(U);const L=_.tracks.find(N=>N.items.includes(P));g[L.id]?g[L.id].items.push(U):g[L.id]={...L,id:Ee(),items:[U],static:!1,magnetic:!1}});const I=Object.values(g);_.tracks=[...I,..._.tracks],t.updateState({trackItemDetailsMap:_.trackItemDetailsMap,tracks:_.tracks,trackItemIds:_.trackItemIds,trackItemsMap:_.trackItemsMap},{updateHistory:!0,kind:"update"})}if(u.key===Ii){const _=(y=u.value)==null?void 0:y.payload,g=Object.keys(_)[0],O=Object.values(_)[0],I=B(t.getState()),P=I.trackItemDetailsMap[g],C=B(I.trackItemsMap[g]),H=P.details;if(!O.details.src)return;if(P.type==="image"){const U=await ke(O.details.src),{crop:L,newHeight:N,newWidth:J}=Ri(P,U);O.details.crop=L,O.details.height=N,O.details.width=J}else if(P.type==="video"){const U=await Fr(O.details.src),L=I.trackItemsMap[g],{display:N,duration:J,trim:Tt}=Li(L,U),{crop:Pt,newHeight:xt,newWidth:Y}=Ri(P,U);O.details.crop=Pt,O.details.height=xt,O.details.width=Y,C.display=N,C.duration=J,C.trim=Tt}else if(P.type==="audio"){const U=await vi(O.details.src),L=I.trackItemsMap[g],{display:N,duration:J,trim:Tt}=Li(L,U);C.display=N,C.duration=J,C.trim=Tt}P.details={...H,...O.details},I.trackItemDetailsMap[g]={...P},I.trackItemsMap[g]={...C},t.updateState({trackItemDetailsMap:I.trackItemDetailsMap,trackItemsMap:I.trackItemsMap},{updateHistory:!0,kind:"update:details"})}}),m=r.subscribe(async u=>{var I,P,C,H,U,L,N,J,Tt,Pt,xt,Y,zt,wt,lt,$t,D,rt,Mt,dt,Ht,At,qt,Jt,pe,Zt,he,Qt,me,Te,we,jt,te;const l=B(t.getState()),k=((P=(I=u.value)==null?void 0:I.options)==null?void 0:P.isSelected)||!1,E=(H=(C=u.value)==null?void 0:C.options)==null?void 0:H.scaleMode,S=(L=(U=u.value)==null?void 0:U.options)==null?void 0:L.isNewTrack;let h=[],y="text";const _=(J=(N=u.value)==null?void 0:N.options)==null?void 0:J.trackId;let g=(Pt=(Tt=u.value)==null?void 0:Tt.options)==null?void 0:Pt.trackIndex;if(u.key===si){const z=(xt=u.value)==null?void 0:xt.payload;let j=l.trackItemsMap[z.id].animations;j?j.in&&z.animations.in?j.in=z.animations.in:j.out&&z.animations.out||!j.out&&z.animations.out?j.out=z.animations.out:!j.in&&z.animations.in?j.in=z.animations.in:j=z.animations:l.trackItemsMap[z.id].animations=z.animations}if(u.key===ci){const z=(Y=u.value)==null?void 0:Y.payload,j=z.trackItems.map(X=>qs(X,{size:l.size})),F=await Promise.all(j),at=Zs(z.tracks,z.trackItems),ft=[];z.trackItems.forEach(X=>{if(X.type!=="template")return;l.trackItemsMap={...l.trackItemsMap,...X.trackItemsMap},l.trackItemDetailsMap={...l.trackItemDetailsMap,...X.trackItemDetailsMap},l.transitionsMap={...l.transitionsMap,...X.transitionsMap};const gt={id:X.id,items:X.trackItemIds,transitions:X.transitionsIds||[],tracks:X.tracks};ft.push(gt)});const K=[],pt={},Z={};if(F.forEach(X=>{const{details:gt,...ee}=X;K.push(X.id),pt[X.id]={type:X.type,details:gt},Z[X.id]=ee}),Js(l.tracks,at))l.tracks.forEach(X=>{at.forEach(gt=>{if(X.id===gt.id){if(X.magnetic){const ee=gt.items.map(Dt=>Z[Dt]),re=X.items.map(Dt=>l.trackItemsMap[Dt]);ra(ee,re)}X.items.push(...K)}})});else{const X=((wt=(zt=u.value)==null?void 0:zt.options)==null?void 0:wt.trackIndex)||0,gt=zr(X,0,l.tracks.length);l.tracks.splice(gt,0,...at)}l.trackItemDetailsMap={...l.trackItemDetailsMap,...pt},l.trackItemsMap={...l.trackItemsMap,...Z},l.trackItemIds=[...l.trackItemIds,...K],l.structure=[...l.structure,...ft],l.duration=oe(l.trackItemsMap);const{transitionIds:Me,transitionsMap:ye}=na(l),We=l.tracks.filter(X=>X.magnetic);Fi(We,l.trackItemsMap,ye),t.updateState({trackItemIds:l.trackItemIds,trackItemDetailsMap:l.trackItemDetailsMap,trackItemsMap:l.trackItemsMap,tracks:l.tracks,duration:l.duration,structure:l.structure,transitionIds:Me,transitionsMap:ye},{updateHistory:!0,kind:"add"});return}if(u.key===ai){y="caption";const z=(lt=u.value)==null?void 0:lt.payload,j=[];for(const ft of z){const K=Ci(ft,{size:l.size});j.push(K)}const F=await Promise.all(j),at=[];for(const ft of F){const K=ft.id;at.push(K);const{details:pt,...Z}=ft;l.trackItemDetailsMap[K]={type:y,details:pt},l.trackItemsMap[K]=Z,l.trackItemIds.push(K)}h=at}if(u.key===Qn){y="text";const z=await Pi(($t=u.value)==null?void 0:$t.payload,{size:l.size}),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===oi){y="template";const z=(D=u.value)==null?void 0:D.payload.trackItemsMap,j=(rt=u.value)==null?void 0:rt.payload.trackItemDetailsMap,F=(Mt=u.value)==null?void 0:Mt.payload.transitionsMap,at=((dt=u.value)==null?void 0:dt.payload.transitionIds)||[],ft=(Ht=u.value)==null?void 0:Ht.payload.trackItemIds,K=((At=u.value)==null?void 0:At.payload.tracks)||[],{details:pt,...Z}=await Ai((qt=u.value)==null?void 0:qt.payload,{size:l.size}),It={id:Z.id,items:ft,transitions:at,tracks:K};l.trackItemDetailsMap[Z.id]={type:y,details:pt},l.trackItemsMap[Z.id]=Z,l.trackItemIds.push(Z.id),h=[Z.id],l.trackItemsMap={...l.trackItemsMap,...z,[Z.id]:{...Z}},l.trackItemDetailsMap={...l.trackItemDetailsMap,...j,[Z.id]:{type:"template",details:pt}},l.transitionsMap={...l.transitionsMap,...F},l.structure=[...l.structure,It]}if(u.key===ni){y="illustration";const z=await Di((Jt=u.value)==null?void 0:Jt.payload,{size:l.size}),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===ii){y="shape";const z=await Vs((pe=u.value)==null?void 0:pe.payload,{size:l.size}),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===ri){y="image";const z=await Oi((Zt=u.value)==null?void 0:Zt.payload,{size:l.size,scaleMode:E}),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===ei){y="audio";const z=await Mi((he=u.value)==null?void 0:he.payload),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===ti){y="video";const z=await wi((Qt=u.value)==null?void 0:Qt.payload,{size:l.size,scaleMode:E}),{details:j,...F}=z;l.trackItemDetailsMap[F.id]={type:y,details:j,metadata:F.metadata},l.trackItemsMap[F.id]=F,l.trackItemIds.push(F.id),h=[F.id]}if(u.key===ui){y="composition";const z=(me=u.value)==null?void 0:me.payload.trackItemsMap,j=(Te=u.value)==null?void 0:Te.payload.trackItemDetailsMap,F=(we=u.value)==null?void 0:we.payload.trackItemIds,at=((jt=u.value)==null?void 0:jt.payload.tracks)||[],{details:ft,...K}=await Ks((te=u.value)==null?void 0:te.payload,{size:l.size}),pt={id:K.id,items:F,transitions:[],tracks:at};l.trackItemDetailsMap[K.id]={type:y,details:ft},l.trackItemsMap[K.id]=K,l.trackItemIds.push(K.id),h=[K.id],l.trackItemsMap={...l.trackItemsMap,...z,[K.id]:{...K}},l.trackItemDetailsMap={...l.trackItemDetailsMap,...j,[K.id]:{type:y,details:ft}},l.structure=[...l.structure,pt]}const O=ta(h,l.tracks,l.trackItemsMap,_,g);if(S){const z=Fe();O.trackId=z;const j={id:O.trackId,accepts:["text","audio","helper","video","image","caption","template"],type:y,items:h,magnetic:!1,static:!1};l.tracks.splice(O.trackIndex,0,j)}else if(O.trackId){const z=l.tracks.find(j=>j.id===O.trackId);z&&z.items.push(...h)}else if(O.trackIndex!==void 0){const z={id:Fe(),accepts:["text","audio","helper","video","image","caption","template"],type:y,items:h,magnetic:!1,static:!1};l.tracks.splice(O.trackIndex,0,z)}else l.tracks.unshift({id:Fe(),accepts:["text","audio","helper","video","image","caption","template"],type:y,items:h,magnetic:!1,static:!1});k&&(l.activeIds=h),l.duration=oe(l.trackItemsMap),t.updateState({activeIds:l.activeIds,trackItemIds:l.trackItemIds,trackItemDetailsMap:l.trackItemDetailsMap,trackItemsMap:l.trackItemsMap,transitionsMap:l.transitionsMap,tracks:l.tracks,duration:l.duration,structure:l.structure},{updateHistory:!0,kind:"add"})}),A=c.subscribe(async u=>{var l;if(u.key===hi){const k=B(t.getState()),E=(l=u.value)==null?void 0:l.options.time;if(k.activeIds.length===1){const S=k.activeIds[0],h=B(k.trackItemsMap[S]);if(E>=h.display.to||E<=h.display.from)return;const y=B(k.trackItemDetailsMap[S]),_=Ee(),g=B({...h,display:{from:h.display.from,to:E}}),O=B({...h,id:_,display:{from:E,to:h.display.to}});if(h.type==="video"||h.type==="audio"){const I=E-g.display.from;g.trim={from:h.trim.from,to:h.trim.from+I},O.trim={from:h.trim.from+I,to:h.trim.to}}k.trackItemsMap[S]=g,k.trackItemsMap[_]=O,k.trackItemIds.push(_),k.trackItemDetailsMap[_]=y,k.tracks.forEach(I=>{I.items.includes(S)&&I.items.push(_)}),t.updateState({trackItemDetailsMap:k.trackItemDetailsMap,tracks:k.tracks,trackItemIds:k.trackItemIds,trackItemsMap:k.trackItemsMap},{updateHistory:!0,kind:"update"})}return}if(u.key===pi){const k=B(t.getState());if(k.activeIds.length){const E=k.activeIds,S=[],h={activeIds:E,trackItemDetailsMap:{},trackItemsMap:{},tracks:[]};E.forEach(_=>{h.trackItemDetailsMap[_]=k.trackItemDetailsMap[_],h.trackItemsMap[_]=k.trackItemsMap[_],S.push(k.tracks.find(g=>g.items.includes(_)))});const y=new Set;S.filter(_=>y.has(_.id)?!1:(y.add(_),!0)),h.tracks=Array.from(y.keys()),localStorage.setItem("DesignComboTemp",JSON.stringify(h))}}if(u.key===fi){const k=localStorage.getItem("DesignComboTemp");if(!k)return;const E=B(t.getState()),S=JSON.parse(k),h={},y=S.trackItemsMap,_=S.trackItemDetailsMap,g=S.tracks,O=[],I=S.activeIds.map(async P=>{const C=_[P];(C.type==="caption"||C.type==="text")&&C.details.fontUrl&&await lr([{fontFamily:C.details.fontFamily,url:C.details.fontUrl}]);const H=Ee();return h[P]=H,E.trackItemsMap[H]={...y[P],id:H},E.trackItemDetailsMap[H]=C,E.trackItemIds.push(H),!0});await Promise.all(I),g.forEach(P=>{const C=P.items.map(U=>h[U]),H={...P,magnetic:!1,static:!1,items:C,id:Fe()};O.push(H)}),E.tracks=[...O,...E.tracks],t.updateState({trackItemDetailsMap:E.trackItemDetailsMap,tracks:E.tracks,trackItemIds:E.trackItemIds,trackItemsMap:E.trackItemsMap},{updateHistory:!0,kind:"update"})}}),x=d.subscribe(async u=>{var l,k,E;if(u.key===li){const S=B(t.getState()),h=S.trackItemDetailsMap,y=S.trackItemsMap,_=Object.keys((l=u.value)==null?void 0:l.payload);if(!_.length)return;const g=(k=u.value)==null?void 0:k.payload;_.forEach(I=>{const P=g[I];if(P.details){if(h[I].details={...h[I].details,...P.details},P.details.colorMap){const C=h[I].details.initialSvgString,H=ki(C,P.details.colorMap);h[I].details.svgString=H}}else g[I].playbackRate&&(y[I].playbackRate=g[I].playbackRate);g[I].metadata&&(y[I].metadata?y[I].metadata={...y[I].metadata,...g[I].metadata}:y[I].metadata=g[I].metadata),g[I].display&&(y[I].display=g[I].display)});for(const I of _){const P=g[I];if(y[I].type==="shape"&&P.details.src){const C=await ke(P.details.src);h[I].details.width=C.width,h[I].details.height=C.height}}const O=oe(y);t.updateState({trackItemDetailsMap:{...h},trackItemsMap:{...y},duration:O},{updateHistory:!0,kind:"update:details"})}if(u.key===di){const S=(E=u.value)==null?void 0:E.payload,h=Object.keys(S)[0],y=Object.values(S)[0],_=B(t.getState()),g=_.trackItemDetailsMap[h],O=g.details;if(y.details){if(y.type==="image"&&y.details.src){const P=await ke(y.details.src),C=g.details.width||0,H=g.details.height||0;let U=P.width,L=P.height;const N=P.width/P.height;C/H>N?(U=C,L=C/N):(L=H,U=H*N),O.crop={x:0,y:0,height:O.height,width:O.width},y.details.width=U,y.details.height=L}if(y.type==="video"&&y.details.src){const P=await Fr(y.details.src),C=g.details.width||0,H=g.details.height||0;let U=P.width,L=P.height;const N=P.width/P.height;C/H>N?(U=C,L=C/N):(L=H,U=H*N),O.crop={x:0,y:0,height:O.height,width:O.width},y.details.width=U,y.details.height=L}g.details={...O,...y.details},y.details=g.details}const I={...g,...y};_.trackItemDetailsMap[h]=I,_.trackItemsMap[h]={..._.trackItemsMap[h],type:y.type},t.updateState({trackItemDetailsMap:{..._.trackItemDetailsMap},trackItemsMap:{..._.trackItemsMap}},{updateHistory:!0,kind:"update:details"})}});return{unsubscribe:()=>{m.unsubscribe(),A.unsubscribe(),x.unsubscribe(),v.unsubscribe(),w.unsubscribe(),b.unsubscribe(),T.unsubscribe()}}}const aa={Date:!0,RegExp:!0,String:!0,Number:!0};function Ni(t,e,r={cyclesFix:!0},i=[]){var f,b;let a=[];const c=Array.isArray(t);for(const v in t){const T=t[v],w=c?+v:v;if(!(v in e)){a.push({type:"REMOVE",path:[w],oldValue:t[v]});continue}const m=e[v],A=typeof T=="object"&&typeof m=="object"&&Array.isArray(T)===Array.isArray(m);T&&m&&A&&!aa[(b=(f=Object.getPrototypeOf(T))==null?void 0:f.constructor)==null?void 0:b.name]&&(!r.cyclesFix||!i.includes(T))?a.push.apply(a,Ni(T,m,r,r.cyclesFix?i.concat([T]):[]).map(x=>(x.path.unshift(w),x))):T!==m&&!(Number.isNaN(T)&&Number.isNaN(m))&&!(A&&(isNaN(T)?T+""==m+"":+T==+m))&&a.push({path:[w],type:"CHANGE",value:m,oldValue:T})}const d=Array.isArray(e);for(const v in e)v in t||a.push({type:"CREATE",path:[d?+v:v],value:e[v]});return a}var $r=Symbol.for("immer-nothing"),ze=Symbol.for("immer-draftable"),St=Symbol.for("immer-state"),zi=process.env.NODE_ENV!=="production"?[function(t){return`The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`},function(t){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${t}'`},"This object has been frozen and should not be mutated",function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(t){return`'current' expects a draft, got: ${t}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(t){return`'original' expects a draft, got: ${t}`}]:[];function et(t,...e){if(process.env.NODE_ENV!=="production"){const r=zi[t],i=typeof r=="function"?r.apply(null,e):r;throw new Error(`[Immer] ${i}`)}throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var ce=Object.getPrototypeOf;function ue(t){return!!t&&!!t[St]}function Vt(t){var e;return t?$i(t)||Array.isArray(t)||!!t[ze]||!!((e=t.constructor)!=null&&e[ze])||je(t)||Ue(t):!1}var oa=Object.prototype.constructor.toString();function $i(t){if(!t||typeof t!="object")return!1;const e=ce(t);if(e===null)return!0;const r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===oa}function $e(t,e){le(t)===0?Reflect.ownKeys(t).forEach(r=>{e(r,t[r],t)}):t.forEach((r,i)=>e(i,r,t))}function le(t){const e=t[St];return e?e.type_:Array.isArray(t)?1:je(t)?2:Ue(t)?3:0}function He(t,e){return le(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Hr(t,e){return le(t)===2?t.get(e):t[e]}function Hi(t,e,r){const i=le(t);i===2?t.set(e,r):i===3?t.add(r):t[e]=r}function ca(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function je(t){return t instanceof Map}function Ue(t){return t instanceof Set}function de(t){return t.copy_||t.base_}function jr(t,e){if(je(t))return new Map(t);if(Ue(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const r=$i(t);if(e===!0||e==="class_only"&&!r){const i=Object.getOwnPropertyDescriptors(t);delete i[St];let a=Reflect.ownKeys(i);for(let c=0;c<a.length;c++){const d=a[c],f=i[d];f.writable===!1&&(f.writable=!0,f.configurable=!0),(f.get||f.set)&&(i[d]={configurable:!0,writable:!0,enumerable:f.enumerable,value:t[d]})}return Object.create(ce(t),i)}else{const i=ce(t);if(i!==null&&r)return{...t};const a=Object.create(i);return Object.assign(a,t)}}function Ur(t,e=!1){return fr(t)||ue(t)||!Vt(t)||(le(t)>1&&(t.set=t.add=t.clear=t.delete=ua),Object.freeze(t),e&&Object.entries(t).forEach(([r,i])=>Ur(i,!0))),t}function ua(){et(2)}function fr(t){return Object.isFrozen(t)}var Yr={};function fe(t){const e=Yr[t];return e||et(0,t),e}function la(t,e){Yr[t]||(Yr[t]=e)}var Ye;function ji(){return Ye}function da(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ui(t,e){e&&(fe("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Gr(t){Wr(t),t.drafts_.forEach(fa),t.drafts_=null}function Wr(t){t===Ye&&(Ye=t.parent_)}function Yi(t){return Ye=da(Ye,t)}function fa(t){const e=t[St];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function Gi(t,e){e.unfinalizedDrafts_=e.drafts_.length;const r=e.drafts_[0];return t!==void 0&&t!==r?(r[St].modified_&&(Gr(e),et(4)),Vt(t)&&(t=pr(e,t),e.parent_||hr(e,t)),e.patches_&&fe("Patches").generateReplacementPatches_(r[St].base_,t,e.patches_,e.inversePatches_)):t=pr(e,r,[]),Gr(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==$r?t:void 0}function pr(t,e,r){if(fr(e))return e;const i=e[St];if(!i)return $e(e,(a,c)=>Wi(t,i,e,a,c,r)),e;if(i.scope_!==t)return e;if(!i.modified_)return hr(t,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let c=a,d=!1;i.type_===3&&(c=new Set(a),a.clear(),d=!0),$e(c,(f,b)=>Wi(t,i,a,f,b,r,d)),hr(t,a,!1),r&&t.patches_&&fe("Patches").generatePatches_(i,r,t.patches_,t.inversePatches_)}return i.copy_}function Wi(t,e,r,i,a,c,d){if(process.env.NODE_ENV!=="production"&&a===r&&et(5),ue(a)){const f=c&&e&&e.type_!==3&&!He(e.assigned_,i)?c.concat(i):void 0,b=pr(t,a,f);if(Hi(r,i,b),ue(b))t.canAutoFreeze_=!1;else return}else d&&r.add(a);if(Vt(a)&&!fr(a)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;pr(t,a),(!e||!e.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,i)&&hr(t,a)}}function hr(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Ur(e,r)}function pa(t,e){const r=Array.isArray(t),i={type_:r?1:0,scope_:e?e.scope_:ji(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=i,c=Xr;r&&(a=[i],c=Ge);const{revoke:d,proxy:f}=Proxy.revocable(a,c);return i.draft_=f,i.revoke_=d,f}var Xr={get(t,e){if(e===St)return t;const r=de(t);if(!He(r,e))return ha(t,r,e);const i=r[e];return t.finalized_||!Vt(i)?i:i===Br(t.base_,e)?(Vr(t),t.copy_[e]=qr(i,t)):i},has(t,e){return e in de(t)},ownKeys(t){return Reflect.ownKeys(de(t))},set(t,e,r){const i=Xi(de(t),e);if(i!=null&&i.set)return i.set.call(t.draft_,r),!0;if(!t.modified_){const a=Br(de(t),e),c=a==null?void 0:a[St];if(c&&c.base_===r)return t.copy_[e]=r,t.assigned_[e]=!1,!0;if(ca(r,a)&&(r!==void 0||He(t.base_,e)))return!0;Vr(t),Kr(t)}return t.copy_[e]===r&&(r!==void 0||e in t.copy_)||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_[e]=!0),!0},deleteProperty(t,e){return Br(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,Vr(t),Kr(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const r=de(t),i=Reflect.getOwnPropertyDescriptor(r,e);return i&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:i.enumerable,value:r[e]}},defineProperty(){et(11)},getPrototypeOf(t){return ce(t.base_)},setPrototypeOf(){et(12)}},Ge={};$e(Xr,(t,e)=>{Ge[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Ge.deleteProperty=function(t,e){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(e))&&et(13),Ge.set.call(this,t,e,void 0)},Ge.set=function(t,e,r){return process.env.NODE_ENV!=="production"&&e!=="length"&&isNaN(parseInt(e))&&et(14),Xr.set.call(this,t[0],e,r,t[0])};function Br(t,e){const r=t[St];return(r?de(r):t)[e]}function ha(t,e,r){var a;const i=Xi(e,r);return i?"value"in i?i.value:(a=i.get)==null?void 0:a.call(t.draft_):void 0}function Xi(t,e){if(!(e in t))return;let r=ce(t);for(;r;){const i=Object.getOwnPropertyDescriptor(r,e);if(i)return i;r=ce(r)}}function Kr(t){t.modified_||(t.modified_=!0,t.parent_&&Kr(t.parent_))}function Vr(t){t.copy_||(t.copy_=jr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var ma=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,r,i)=>{if(typeof e=="function"&&typeof r!="function"){const c=r;r=e;const d=this;return function(b=c,...v){return d.produce(b,T=>r.call(this,T,...v))}}typeof r!="function"&&et(6),i!==void 0&&typeof i!="function"&&et(7);let a;if(Vt(e)){const c=Yi(this),d=qr(e,void 0);let f=!0;try{a=r(d),f=!1}finally{f?Gr(c):Wr(c)}return Ui(c,i),Gi(a,c)}else if(!e||typeof e!="object"){if(a=r(e),a===void 0&&(a=e),a===$r&&(a=void 0),this.autoFreeze_&&Ur(a,!0),i){const c=[],d=[];fe("Patches").generateReplacementPatches_(e,a,c,d),i(c,d)}return a}else et(1,e)},this.produceWithPatches=(e,r)=>{if(typeof e=="function")return(d,...f)=>this.produceWithPatches(d,b=>e(b,...f));let i,a;return[this.produce(e,r,(d,f)=>{i=d,a=f}),i,a]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){Vt(t)||et(8),ue(t)&&(t=ya(t));const e=Yi(this),r=qr(t,void 0);return r[St].isManual_=!0,Wr(e),r}finishDraft(t,e){const r=t&&t[St];(!r||!r.isManual_)&&et(9);const{scope_:i}=r;return Ui(i,e),Gi(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){const a=e[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(e=e.slice(r+1));const i=fe("Patches").applyPatches_;return ue(t)?i(t,e):this.produce(t,a=>i(a,e))}};function qr(t,e){const r=je(t)?fe("MapSet").proxyMap_(t,e):Ue(t)?fe("MapSet").proxySet_(t,e):pa(t,e);return(e?e.scope_:ji()).drafts_.push(r),r}function ya(t){return ue(t)||et(10,t),Bi(t)}function Bi(t){if(!Vt(t)||fr(t))return t;const e=t[St];let r;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=jr(t,e.scope_.immer_.useStrictShallowCopy_)}else r=jr(t,!0);return $e(r,(i,a)=>{Hi(r,i,Bi(a))}),e&&(e.finalized_=!1),r}function Ki(){process.env.NODE_ENV!=="production"&&zi.push('Sets cannot have "replace" patches.',function(m){return"Unsupported patch operation: "+m},function(m){return"Cannot apply patch, path doesn't resolve: "+m},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");const e="replace",r="add",i="remove";function a(m,A,x,u){switch(m.type_){case 0:case 2:return d(m,A,x,u);case 1:return c(m,A,x,u);case 3:return f(m,A,x,u)}}function c(m,A,x,u){let{base_:l,assigned_:k}=m,E=m.copy_;E.length<l.length&&([l,E]=[E,l],[x,u]=[u,x]);for(let S=0;S<l.length;S++)if(k[S]&&E[S]!==l[S]){const h=A.concat([S]);x.push({op:e,path:h,value:w(E[S])}),u.push({op:e,path:h,value:w(l[S])})}for(let S=l.length;S<E.length;S++){const h=A.concat([S]);x.push({op:r,path:h,value:w(E[S])})}for(let S=E.length-1;l.length<=S;--S){const h=A.concat([S]);u.push({op:i,path:h})}}function d(m,A,x,u){const{base_:l,copy_:k}=m;$e(m.assigned_,(E,S)=>{const h=Hr(l,E),y=Hr(k,E),_=S?He(l,E)?e:r:i;if(h===y&&_===e)return;const g=A.concat(E);x.push(_===i?{op:_,path:g}:{op:_,path:g,value:y}),u.push(_===r?{op:i,path:g}:_===i?{op:r,path:g,value:w(h)}:{op:e,path:g,value:w(h)})})}function f(m,A,x,u){let{base_:l,copy_:k}=m,E=0;l.forEach(S=>{if(!k.has(S)){const h=A.concat([E]);x.push({op:i,path:h,value:S}),u.unshift({op:r,path:h,value:S})}E++}),E=0,k.forEach(S=>{if(!l.has(S)){const h=A.concat([E]);x.push({op:r,path:h,value:S}),u.unshift({op:i,path:h,value:S})}E++})}function b(m,A,x,u){x.push({op:e,path:[],value:A===$r?void 0:A}),u.push({op:e,path:[],value:m})}function v(m,A){return A.forEach(x=>{const{path:u,op:l}=x;let k=m;for(let y=0;y<u.length-1;y++){const _=le(k);let g=u[y];typeof g!="string"&&typeof g!="number"&&(g=""+g),(_===0||_===1)&&(g==="__proto__"||g==="constructor")&&et(19),typeof k=="function"&&g==="prototype"&&et(19),k=Hr(k,g),typeof k!="object"&&et(18,u.join("/"))}const E=le(k),S=T(x.value),h=u[u.length-1];switch(l){case e:switch(E){case 2:return k.set(h,S);case 3:et(16);default:return k[h]=S}case r:switch(E){case 1:return h==="-"?k.push(S):k.splice(h,0,S);case 2:return k.set(h,S);case 3:return k.add(S);default:return k[h]=S}case i:switch(E){case 1:return k.splice(h,1);case 2:return k.delete(h);case 3:return k.delete(x.value);default:return delete k[h]}default:et(17,l)}}),m}function T(m){if(!Vt(m))return m;if(Array.isArray(m))return m.map(T);if(je(m))return new Map(Array.from(m.entries()).map(([x,u])=>[x,T(u)]));if(Ue(m))return new Set(Array.from(m).map(T));const A=Object.create(ce(m));for(const x in m)A[x]=T(m[x]);return He(m,ze)&&(A[ze]=m[ze]),A}function w(m){return ue(m)?T(m):m}la("Patches",{applyPatches_:v,generatePatches_:a,generateReplacementPatches_:b})}var kt=new ma,Ia=kt.produce;kt.produceWithPatches.bind(kt),kt.setAutoFreeze.bind(kt),kt.setUseStrictShallowCopy.bind(kt);var ga=kt.applyPatches.bind(kt);kt.createDraft.bind(kt),kt.finishDraft.bind(kt);var ba=9007199254740991,_a="[object Arguments]",va="[object Function]",Sa="[object GeneratorFunction]",ka="[object Symbol]",Ea=typeof Et=="object"&&Et&&Et.Object===Object&&Et,Ta=typeof self=="object"&&self&&self.Object===Object&&self,wa=Ea||Ta||Function("return this")();function Ma(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Aa(t,e){for(var r=-1,i=t?t.length:0,a=Array(i);++r<i;)a[r]=e(t[r],r,t);return a}function Da(t,e){for(var r=-1,i=e.length,a=t.length;++r<i;)t[a+r]=e[r];return t}var Jr=Object.prototype,Oa=Jr.hasOwnProperty,Zr=Jr.toString,Vi=wa.Symbol,Ca=Jr.propertyIsEnumerable,qi=Vi?Vi.isConcatSpreadable:void 0,Ji=Math.max;function Pa(t,e,r,i,a){var c=-1,d=t.length;for(r||(r=Fa),a||(a=[]);++c<d;){var f=t[c];r(f)?Da(a,f):a[a.length]=f}return a}function xa(t,e){return t=Object(t),Ra(t,e,function(r,i){return i in t})}function Ra(t,e,r){for(var i=-1,a=e.length,c={};++i<a;){var d=e[i],f=t[d];r(f,d)&&(c[d]=f)}return c}function La(t,e){return e=Ji(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=Ji(r.length-e,0),c=Array(a);++i<a;)c[i]=r[e+i];i=-1;for(var d=Array(e+1);++i<e;)d[i]=r[i];return d[e]=c,Ma(t,this,d)}}function Fa(t){return $a(t)||za(t)||!!(qi&&t&&t[qi])}function Na(t){if(typeof t=="string"||Wa(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function za(t){return ja(t)&&Oa.call(t,"callee")&&(!Ca.call(t,"callee")||Zr.call(t)==_a)}var $a=Array.isArray;function Ha(t){return t!=null&&Ya(t.length)&&!Ua(t)}function ja(t){return Zi(t)&&Ha(t)}function Ua(t){var e=Ga(t)?Zr.call(t):"";return e==va||e==Sa}function Ya(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ba}function Ga(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Zi(t){return!!t&&typeof t=="object"}function Wa(t){return typeof t=="symbol"||Zi(t)&&Zr.call(t)==ka}var Xa=La(function(t,e){return t==null?{}:xa(t,Aa(Pa(e),Na))}),Ba=Xa;const Qi=Rr(Ba),Ka={size:{width:1080,height:1920},fps:30,tracks:[],trackItemIds:[],trackItemsMap:{},transitionIds:[],transitionsMap:{},scale:{unit:1,zoom:1,segments:1,index:1},duration:0,activeIds:[],trackItemDetailsMap:{},structure:[]},ts=["tracks","trackItemsMap","trackItemDetailsMap","transitionIds","transitionsMap","trackItemIds","structure"];class Va{constructor(e){Se(this,"stateSubject");Se(this,"stateHistorySubject");Se(this,"prevState");Se(this,"undos",[]);Se(this,"redos",[]);Se(this,"listener");const r=Object.assign({},Ka,e);this.stateSubject=new Bn(r),this.stateHistorySubject=new Bn({handleRedo:!1,handleUndo:!1}),this.prevState=r,this.initListeners()}initListeners(){sa(this)}destroyListeners(){this.listener&&this.listener.unsubscribe()}purge(){this.destroyListeners()}updateHistory(e,r){const i=Qi(e,ts),a=Qi(this.getState(),ts),c=Ni(a,i);c.length&&(this.undos.push({undos:c,type:r}),this.redos=[])}getStateHistory(){return this.stateHistorySubject.getValue()}subscribeHistory(e){return this.stateHistorySubject.subscribe(e)}getState(){return this.stateSubject.getValue()}subscribe(e){return this.stateSubject.subscribe(e)}updateState(e,r={updateHistory:!1}){const i=this.getState(),a={...B(i),...B(e)};tt(i,a)||(r.updateHistory&&this.updateHistory(a,r.kind),this.prevState=i,this.stateSubject.next(a))}subscribeToSize(e){return this.stateSubject.asObservable().subscribe(r=>{tt(r.size,this.prevState.size)||e({size:r.size})})}subscribeToScale(e){return this.stateSubject.asObservable().subscribe(r=>{tt(r.scale,this.prevState.scale)||e({scale:r.scale})})}subscribeToFps(e){return this.stateSubject.asObservable().subscribe(r=>{r.fps!==this.prevState.fps&&e({fps:r.fps})})}subscribeToUpdateTrackItem(e){return this.stateSubject.asObservable().subscribe(r=>{tt(r.trackItemsMap,this.prevState.trackItemsMap)||e({trackItemsMap:r.trackItemsMap})})}subscribeToUpdateAnimations(e){return this.stateSubject.asObservable().subscribe(r=>{const i=Object.keys(r.trackItemsMap).filter(a=>{const c=this.prevState.trackItemsMap[a],d=r.trackItemsMap[a];return c&&d&&!tt(c.animations,d.animations)});e({trackItemsMap:r.trackItemsMap,changedAnimationIds:i})})}subscribeToUpdateTrackItemTiming(e){return this.stateSubject.asObservable().subscribe(r=>{if(!tt(r.trackItemsMap,this.prevState.trackItemsMap)){const i=Object.keys(r.trackItemsMap).filter(c=>{const d=this.prevState.trackItemsMap[c],f=r.trackItemsMap[c];return d&&f&&!tt(d.trim,f.trim)}),a=Object.keys(r.trackItemsMap).filter(c=>{const d=this.prevState.trackItemsMap[c],f=r.trackItemsMap[c];return d&&f&&!tt(d.display,f.display)});e({trackItemsMap:r.trackItemsMap,changedTrimIds:i.length>0?i:void 0,changedDisplayIds:a.length>0?a:void 0})}})}subscribeToUpdateItemDetails(e){return this.stateSubject.asObservable().subscribe(r=>{tt(r.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||e({trackItemDetailsMap:r.trackItemDetailsMap})})}subscribeToDuration(e){return this.stateSubject.asObservable().subscribe(r=>{r.duration!==this.prevState.duration&&e({duration:r.duration})})}subscribeToHistory(e){return this.stateHistorySubject.asObservable().subscribe(r=>{if(r.handleRedo){const i=this.undos[this.undos.length-1].type;e({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}if(r.handleUndo){const i=this.redos[this.redos.length-1].type;e({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}})}subscribeToAddOrRemoveItems(e){return this.stateSubject.asObservable().subscribe(r=>{const i=[...r.trackItemIds].sort(),a=[...this.prevState.trackItemIds].sort(),c=[...r.transitionIds].sort(),d=[...this.prevState.transitionIds].sort();(!tt(i,a)||!tt(c,d))&&e({trackItemIds:r.trackItemIds})})}subscribeToActiveIds(e){return this.stateSubject.asObservable().subscribe(r=>{tt(r.activeIds,this.prevState.activeIds)||e({activeIds:r.activeIds})})}subscribeToTracks(e){return this.stateSubject.asObservable().subscribe(r=>{const i=r.tracks,c=this.prevState.tracks.map(f=>f.id),d=i.filter(f=>!c.includes(f.id));d.length&&e({tracks:r.tracks,changedTracks:d.map(f=>f.id)})})}subscribeToState(e){return this.stateSubject.asObservable().subscribe(r=>{(!tt(r.tracks,this.prevState.tracks)||!tt(r.trackItemIds,this.prevState.trackItemIds)||!tt(r.trackItemsMap,this.prevState.trackItemsMap)||!tt(r.transitionIds,this.prevState.transitionIds)||!tt(r.transitionsMap,this.prevState.transitionsMap)||!tt(r.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||!tt(r.structure,this.prevState.structure))&&e({tracks:r.tracks,trackItemIds:r.trackItemIds,trackItemsMap:r.trackItemsMap,transitionIds:r.transitionIds,transitionsMap:r.transitionsMap,trackItemDetailsMap:r.trackItemDetailsMap,structure:r.structure})})}undo(){const e=this.undos.pop(),r=e==null?void 0:e.undos,i=e==null?void 0:e.type;if(!r||!i)return;Ki();const{trackItemDetailsMap:a,trackItemIds:c,tracks:d,transitionIds:f,transitionsMap:b,trackItemsMap:v,structure:T}=this.getState(),w=B({trackItemDetailsMap:a,trackItemIds:c,tracks:d,transitionIds:f,transitionsMap:b,trackItemsMap:v,structure:T}),m=[],A=[],x=[],u=[],l=[],k=[],E=[];r.forEach(L=>{let N;const J=L.path.slice(1);L.type==="CREATE"?N={path:J,op:"remove",value:L.value}:L.type==="CHANGE"?N={path:J,op:"replace",value:L.oldValue}:N={path:J,op:"add",value:L.oldValue},L.path.includes("trackItemIds")?x.push(N):L.path.includes("transitionIds")?A.push(N):L.path.includes("trackItemsMap")?l.push(N):L.path.includes("transitionsMap")?u.push(N):L.path.includes("tracks")?m.push(N):L.path.includes("trackItemDetailsMap")?k.push(N):L.path.includes("structure")&&E.push(N)});const S=this.applyPatch(w.tracks,m),h=this.applyPatch(w.transitionIds,A),y=this.applyPatch(w.trackItemIds,x),_=this.applyPatch(w.transitionsMap,u),g=this.applyPatch(w.trackItemsMap,l),O=this.applyPatch(w.trackItemDetailsMap,k),I=this.applyPatch(w.structure,E),P=B({tracks:S,transitionIds:h,trackItemIds:y,transitionsMap:_,trackItemsMap:g,trackItemDetailsMap:O,structure:I}),C=B(this.getState()),H={...C,...P};this.prevState=C,this.redos.push({redos:r,type:i});const U=oe(H.trackItemsMap);this.stateSubject.next({...H,duration:U}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!0}),this.updateState(H,{updateHistory:!1})}applyPatch(e,r){return r.reverse().reduce((i,a)=>Ia(i,c=>{ga(c,[a])}),e)}redo(){const e=this.redos.pop(),r=e==null?void 0:e.redos,i=e==null?void 0:e.type;if(!r||!i)return;Ki();const{trackItemDetailsMap:a,trackItemIds:c,tracks:d,transitionIds:f,transitionsMap:b,trackItemsMap:v,structure:T}=this.getState(),w=B({trackItemDetailsMap:a,trackItemIds:c,tracks:d,transitionIds:f,transitionsMap:b,trackItemsMap:v,structure:T}),m=[],A=[],x=[],u=[],l=[],k=[],E=[];r.forEach(L=>{let N;const J=L.path.slice(1);L.type==="CREATE"?N={path:J,op:"add",value:L.value}:L.type==="CHANGE"?N={path:J,op:"replace",value:L.value}:N={path:J,op:"remove",value:L.oldValue},L.path.includes("trackItemIds")?x.push(N):L.path.includes("transitionIds")?A.push(N):L.path.includes("trackItemsMap")?l.push(N):L.path.includes("transitionsMap")?u.push(N):L.path.includes("trackItemDetailsMap")?k.push(N):L.path.includes("structure")?E.push(N):m.push(N)});const S=this.applyPatch(w.tracks,m),h=this.applyPatch(w.transitionIds,A),y=this.applyPatch(w.trackItemIds,x),_=this.applyPatch(w.transitionsMap,u),g=this.applyPatch(w.trackItemsMap,l),O=this.applyPatch(w.trackItemDetailsMap,k),I=this.applyPatch(w.structure,E),P=B({tracks:S,transitionIds:h,trackItemIds:y,transitionsMap:_,trackItemsMap:g,trackItemDetailsMap:O,structure:I}),C=B(this.getState()),H={...C,...P};this.prevState=C,this.undos.push({undos:r,type:i});const U=oe(H.trackItemsMap);this.stateSubject.next({...H,duration:U}),this.stateHistorySubject.next({handleRedo:!0,handleUndo:!1}),this.updateState(H,{updateHistory:!1})}toJSON(){const{fps:e,tracks:r,size:i,trackItemDetailsMap:a,trackItemIds:c,transitionsMap:d,trackItemsMap:f,transitionIds:b}=this.getState();return{fps:e,tracks:r,size:i,trackItemDetailsMap:a,trackItemIds:c,transitionsMap:d,trackItemsMap:f,transitionIds:b}}}M.ACTIVE_CLONE=pi,M.ACTIVE_DELETE=As,M.ACTIVE_PASTE=fi,M.ACTIVE_PREFIX=se,M.ACTIVE_SET=Ms,M.ACTIVE_SPLIT=hi,M.ADD_ANIMATION=si,M.ADD_AUDIO=ei,M.ADD_CAPTIONS=ai,M.ADD_COMPOSITION=ui,M.ADD_ILLUSTRATION=ni,M.ADD_IMAGE=ri,M.ADD_ITEMS=ci,M.ADD_MASK=_s,M.ADD_PLACEHOLDER=bs,M.ADD_PREFIX=ut,M.ADD_SHAPE=ii,M.ADD_SUFFIX=ms,M.ADD_TEMPLATE=oi,M.ADD_TEXT=Qn,M.ADD_TRANSITION=vs,M.ADD_VIDEO=ti,M.DELETE_TEMPLATE_ITEM=Ts,M.DESIGN_LOAD=Jn,M.DESIGN_PREFIX=cr,M.DESIGN_RESIZE=Zn,M.EDIT_OBJECT=li,M.EDIT_PREFIX=Bt,M.EDIT_SHAPE=ks,M.EDIT_TEMPLATE_ITEM=Es,M.EDIT_TEXT=Ss,M.ENTER_EDIT_MODE=ws,M.HISTORY_PREFIX=Le,M.HISTORY_REDO=bi,M.HISTORY_RESET=js,M.HISTORY_UNDO=gi,M.LAYER_CLONE=mi,M.LAYER_COPY=Ns,M.LAYER_CUT=Hs,M.LAYER_DELETE=yi,M.LAYER_EDITING_NAME=Fs,M.LAYER_HIDDEN=Os,M.LAYER_LOCKED=Ds,M.LAYER_MOVE=Cs,M.LAYER_PASTE=zs,M.LAYER_PREFIX=it,M.LAYER_RENAME=Ls,M.LAYER_REPLACE=Ii,M.LAYER_SELECT=Ps,M.LAYER_SELECTION=xs,M.LAYER_SEND_TO=Rs,M.LAYER_SPLIT=$s,M.REPLACE_MEDIA=di,M.STATE_CHANGED=gs,M.STATE_PREFIX=qn,M.TIMELINE_SCALE_CHANGED=_i,M.TIMELINE_SCALE_PREFIX=Lr,M.TRACKS_CHANGED=ys,M.TRACK_ITEMS_CHANGED=Is,M.TRACK_ITEMS_PREFIX=Vn,M.TRACK_PREFIX=Kn,M.default=Va,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cliquify.me/state",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"typescript": "5.4.5",
|
|
26
26
|
"vite": "^5.2.0",
|
|
27
27
|
"vite-plugin-dts": "^3.9.1",
|
|
28
|
-
"@cliquify.me/types": "3.1.
|
|
28
|
+
"@cliquify.me/types": "3.1.19",
|
|
29
29
|
"@cliquify.me/typescript-config": "0.0.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@designcombo/events": "^1.0.2",
|
|
42
|
-
"@cliquify.me/types": "3.1.
|
|
42
|
+
"@cliquify.me/types": "3.1.19"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"dev": "vite",
|