@designcombo/state 3.1.12 → 3.1.13
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 +959 -981
- package/dist/index.umd.js +2 -2
- package/package.json +13 -6
- package/src/index.ts +0 -2
package/dist/index.es.js
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var le = (t, e, r) =>
|
1
|
+
var xs = Object.defineProperty;
|
2
|
+
var Ds = (t, e, r) => e in t ? xs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
3
|
+
var le = (t, e, r) => Ds(t, typeof e != "symbol" ? e + "" : e, r);
|
4
4
|
import { subject as de, filter as fe } from "@designcombo/events";
|
5
|
-
var
|
6
|
-
return
|
5
|
+
var mn = function(t, e) {
|
6
|
+
return mn = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, s) {
|
7
7
|
r.__proto__ = s;
|
8
8
|
} || function(r, s) {
|
9
9
|
for (var a in s) Object.prototype.hasOwnProperty.call(s, a) && (r[a] = s[a]);
|
10
|
-
},
|
10
|
+
}, mn(t, e);
|
11
11
|
};
|
12
12
|
function Qe(t, e) {
|
13
13
|
if (typeof e != "function" && e !== null)
|
14
14
|
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
15
|
-
|
15
|
+
mn(t, e);
|
16
16
|
function r() {
|
17
17
|
this.constructor = t;
|
18
18
|
}
|
19
19
|
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
20
20
|
}
|
21
|
-
function
|
21
|
+
function yn(t) {
|
22
22
|
var e = typeof Symbol == "function" && Symbol.iterator, r = e && t[e], s = 0;
|
23
23
|
if (r) return r.call(t);
|
24
24
|
if (t && typeof t.length == "number") return {
|
@@ -28,24 +28,24 @@ function gn(t) {
|
|
28
28
|
};
|
29
29
|
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
30
30
|
}
|
31
|
-
function
|
31
|
+
function gn(t, e) {
|
32
32
|
var r = typeof Symbol == "function" && t[Symbol.iterator];
|
33
33
|
if (!r) return t;
|
34
|
-
var s = r.call(t), a, c = [],
|
34
|
+
var s = r.call(t), a, c = [], d;
|
35
35
|
try {
|
36
36
|
for (; (e === void 0 || e-- > 0) && !(a = s.next()).done; ) c.push(a.value);
|
37
37
|
} catch (f) {
|
38
|
-
|
38
|
+
d = { error: f };
|
39
39
|
} finally {
|
40
40
|
try {
|
41
41
|
a && !a.done && (r = s.return) && r.call(s);
|
42
42
|
} finally {
|
43
|
-
if (
|
43
|
+
if (d) throw d.error;
|
44
44
|
}
|
45
45
|
}
|
46
46
|
return c;
|
47
47
|
}
|
48
|
-
function
|
48
|
+
function In(t, e, r) {
|
49
49
|
if (r || arguments.length === 2) for (var s = 0, a = e.length, c; s < a; s++)
|
50
50
|
(c || !(s in e)) && (c || (c = Array.prototype.slice.call(e, 0, s)), c[s] = e[s]);
|
51
51
|
return t.concat(c || Array.prototype.slice.call(e));
|
@@ -53,13 +53,13 @@ function bn(t, e, r) {
|
|
53
53
|
function Wt(t) {
|
54
54
|
return typeof t == "function";
|
55
55
|
}
|
56
|
-
function
|
56
|
+
function ss(t) {
|
57
57
|
var e = function(s) {
|
58
58
|
Error.call(s), s.stack = new Error().stack;
|
59
59
|
}, r = t(e);
|
60
60
|
return r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, r;
|
61
61
|
}
|
62
|
-
var ln =
|
62
|
+
var ln = ss(function(t) {
|
63
63
|
return function(r) {
|
64
64
|
t(this), this.message = r ? r.length + ` errors occurred during unsubscription:
|
65
65
|
` + r.map(function(s, a) {
|
@@ -68,7 +68,7 @@ var ln = is(function(t) {
|
|
68
68
|
`) : "", this.name = "UnsubscriptionError", this.errors = r;
|
69
69
|
};
|
70
70
|
});
|
71
|
-
function
|
71
|
+
function bn(t, e) {
|
72
72
|
if (t) {
|
73
73
|
var r = t.indexOf(e);
|
74
74
|
0 <= r && t.splice(r, 1);
|
@@ -82,11 +82,11 @@ var kr = function() {
|
|
82
82
|
var e, r, s, a, c;
|
83
83
|
if (!this.closed) {
|
84
84
|
this.closed = !0;
|
85
|
-
var
|
86
|
-
if (
|
87
|
-
if (this._parentage = null, Array.isArray(
|
85
|
+
var d = this._parentage;
|
86
|
+
if (d)
|
87
|
+
if (this._parentage = null, Array.isArray(d))
|
88
88
|
try {
|
89
|
-
for (var f =
|
89
|
+
for (var f = yn(d), b = f.next(); !b.done; b = f.next()) {
|
90
90
|
var _ = b.value;
|
91
91
|
_.remove(this);
|
92
92
|
}
|
@@ -100,7 +100,7 @@ var kr = function() {
|
|
100
100
|
}
|
101
101
|
}
|
102
102
|
else
|
103
|
-
|
103
|
+
d.remove(this);
|
104
104
|
var M = this.initialTeardown;
|
105
105
|
if (Wt(M))
|
106
106
|
try {
|
@@ -112,19 +112,19 @@ var kr = function() {
|
|
112
112
|
if (E) {
|
113
113
|
this._finalizers = null;
|
114
114
|
try {
|
115
|
-
for (var
|
115
|
+
for (var m = yn(E), T = m.next(); !T.done; T = m.next()) {
|
116
116
|
var C = T.value;
|
117
117
|
try {
|
118
|
-
|
118
|
+
$n(C);
|
119
119
|
} catch (u) {
|
120
|
-
c = c ?? [], u instanceof ln ? c =
|
120
|
+
c = c ?? [], u instanceof ln ? c = In(In([], gn(c)), gn(u.errors)) : c.push(u);
|
121
121
|
}
|
122
122
|
}
|
123
123
|
} catch (u) {
|
124
124
|
s = { error: u };
|
125
125
|
} finally {
|
126
126
|
try {
|
127
|
-
T && !T.done && (a =
|
127
|
+
T && !T.done && (a = m.return) && a.call(m);
|
128
128
|
} finally {
|
129
129
|
if (s) throw s.error;
|
130
130
|
}
|
@@ -137,7 +137,7 @@ var kr = function() {
|
|
137
137
|
var r;
|
138
138
|
if (e && e !== this)
|
139
139
|
if (this.closed)
|
140
|
-
|
140
|
+
$n(e);
|
141
141
|
else {
|
142
142
|
if (e instanceof t) {
|
143
143
|
if (e.closed || e._hasParent(this))
|
@@ -154,57 +154,52 @@ var kr = function() {
|
|
154
154
|
this._parentage = Array.isArray(r) ? (r.push(e), r) : r ? [r, e] : e;
|
155
155
|
}, t.prototype._removeParent = function(e) {
|
156
156
|
var r = this._parentage;
|
157
|
-
r === e ? this._parentage = null : Array.isArray(r) &&
|
157
|
+
r === e ? this._parentage = null : Array.isArray(r) && bn(r, e);
|
158
158
|
}, t.prototype.remove = function(e) {
|
159
159
|
var r = this._finalizers;
|
160
|
-
r &&
|
160
|
+
r && bn(r, e), e instanceof t && e._removeParent(this);
|
161
161
|
}, t.EMPTY = function() {
|
162
162
|
var e = new t();
|
163
163
|
return e.closed = !0, e;
|
164
164
|
}(), t;
|
165
|
-
}(),
|
166
|
-
function
|
165
|
+
}(), is = kr.EMPTY;
|
166
|
+
function as(t) {
|
167
167
|
return t instanceof kr || t && "closed" in t && Wt(t.remove) && Wt(t.add) && Wt(t.unsubscribe);
|
168
168
|
}
|
169
|
-
function
|
169
|
+
function $n(t) {
|
170
170
|
Wt(t) ? t() : t.unsubscribe();
|
171
171
|
}
|
172
|
-
var
|
173
|
-
|
174
|
-
|
175
|
-
Promise: void 0,
|
176
|
-
useDeprecatedSynchronousErrorHandling: !1,
|
177
|
-
useDeprecatedNextContext: !1
|
178
|
-
}, us = {
|
172
|
+
var Os = {
|
173
|
+
Promise: void 0
|
174
|
+
}, Cs = {
|
179
175
|
setTimeout: function(t, e) {
|
180
176
|
for (var r = [], s = 2; s < arguments.length; s++)
|
181
177
|
r[s - 2] = arguments[s];
|
182
|
-
return setTimeout.apply(void 0,
|
178
|
+
return setTimeout.apply(void 0, In([t, e], gn(r)));
|
183
179
|
},
|
184
180
|
clearTimeout: function(t) {
|
185
|
-
|
186
|
-
return ((e == null ? void 0 : e.clearTimeout) || clearTimeout)(t);
|
181
|
+
return clearTimeout(t);
|
187
182
|
},
|
188
183
|
delegate: void 0
|
189
184
|
};
|
190
|
-
function
|
191
|
-
|
185
|
+
function Ps(t) {
|
186
|
+
Cs.setTimeout(function() {
|
192
187
|
throw t;
|
193
188
|
});
|
194
189
|
}
|
195
|
-
function
|
190
|
+
function Nn() {
|
196
191
|
}
|
197
192
|
function yr(t) {
|
198
193
|
t();
|
199
194
|
}
|
200
|
-
var
|
195
|
+
var os = function(t) {
|
201
196
|
Qe(e, t);
|
202
197
|
function e(r) {
|
203
198
|
var s = t.call(this) || this;
|
204
|
-
return s.isStopped = !1, r ? (s.destination = r,
|
199
|
+
return s.isStopped = !1, r ? (s.destination = r, as(r) && r.add(s)) : s.destination = Fs, s;
|
205
200
|
}
|
206
201
|
return e.create = function(r, s, a) {
|
207
|
-
return new
|
202
|
+
return new vn(r, s, a);
|
208
203
|
}, e.prototype.next = function(r) {
|
209
204
|
this.isStopped || this._next(r);
|
210
205
|
}, e.prototype.error = function(r) {
|
@@ -228,11 +223,7 @@ var ls = function(t) {
|
|
228
223
|
this.unsubscribe();
|
229
224
|
}
|
230
225
|
}, e;
|
231
|
-
}(kr),
|
232
|
-
function dn(t, e) {
|
233
|
-
return Fs.call(t, e);
|
234
|
-
}
|
235
|
-
var zs = function() {
|
226
|
+
}(kr), Rs = function() {
|
236
227
|
function t(e) {
|
237
228
|
this.partialObserver = e;
|
238
229
|
}
|
@@ -263,55 +254,43 @@ var zs = function() {
|
|
263
254
|
mr(r);
|
264
255
|
}
|
265
256
|
}, t;
|
266
|
-
}(),
|
257
|
+
}(), vn = function(t) {
|
267
258
|
Qe(e, t);
|
268
259
|
function e(r, s, a) {
|
269
|
-
var c = t.call(this) || this,
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
};
|
276
|
-
else {
|
277
|
-
var f;
|
278
|
-
c && cs.useDeprecatedNextContext ? (f = Object.create(r), f.unsubscribe = function() {
|
279
|
-
return c.unsubscribe();
|
280
|
-
}, l = {
|
281
|
-
next: r.next && dn(r.next, f),
|
282
|
-
error: r.error && dn(r.error, f),
|
283
|
-
complete: r.complete && dn(r.complete, f)
|
284
|
-
}) : l = r;
|
285
|
-
}
|
286
|
-
return c.destination = new zs(l), c;
|
260
|
+
var c = t.call(this) || this, d;
|
261
|
+
return Wt(r) || !r ? d = {
|
262
|
+
next: r ?? void 0,
|
263
|
+
error: s ?? void 0,
|
264
|
+
complete: a ?? void 0
|
265
|
+
} : d = r, c.destination = new Rs(d), c;
|
287
266
|
}
|
288
267
|
return e;
|
289
|
-
}(
|
268
|
+
}(os);
|
290
269
|
function mr(t) {
|
291
|
-
|
270
|
+
Ps(t);
|
292
271
|
}
|
293
|
-
function
|
272
|
+
function zs(t) {
|
294
273
|
throw t;
|
295
274
|
}
|
296
|
-
var
|
275
|
+
var Fs = {
|
297
276
|
closed: !0,
|
298
|
-
next:
|
299
|
-
error:
|
300
|
-
complete:
|
301
|
-
},
|
277
|
+
next: Nn,
|
278
|
+
error: zs,
|
279
|
+
complete: Nn
|
280
|
+
}, $s = function() {
|
302
281
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
303
282
|
}();
|
304
283
|
function Ns(t) {
|
305
284
|
return t;
|
306
285
|
}
|
307
|
-
function
|
286
|
+
function js(t) {
|
308
287
|
return t.length === 0 ? Ns : t.length === 1 ? t[0] : function(r) {
|
309
288
|
return t.reduce(function(s, a) {
|
310
289
|
return a(s);
|
311
290
|
}, r);
|
312
291
|
};
|
313
292
|
}
|
314
|
-
var
|
293
|
+
var jn = function() {
|
315
294
|
function t(e) {
|
316
295
|
e && (this._subscribe = e);
|
317
296
|
}
|
@@ -319,9 +298,9 @@ var Nn = function() {
|
|
319
298
|
var r = new t();
|
320
299
|
return r.source = this, r.operator = e, r;
|
321
300
|
}, t.prototype.subscribe = function(e, r, s) {
|
322
|
-
var a = this, c =
|
301
|
+
var a = this, c = Ls(e) ? e : new vn(e, r, s);
|
323
302
|
return yr(function() {
|
324
|
-
var
|
303
|
+
var d = a, f = d.operator, b = d.source;
|
325
304
|
c.add(f ? f.call(c, b) : b ? a._subscribe(c) : a._trySubscribe(c));
|
326
305
|
}), c;
|
327
306
|
}, t.prototype._trySubscribe = function(e) {
|
@@ -332,37 +311,37 @@ var Nn = function() {
|
|
332
311
|
}
|
333
312
|
}, t.prototype.forEach = function(e, r) {
|
334
313
|
var s = this;
|
335
|
-
return r =
|
336
|
-
var
|
314
|
+
return r = Hn(r), new r(function(a, c) {
|
315
|
+
var d = new vn({
|
337
316
|
next: function(f) {
|
338
317
|
try {
|
339
318
|
e(f);
|
340
319
|
} catch (b) {
|
341
|
-
c(b),
|
320
|
+
c(b), d.unsubscribe();
|
342
321
|
}
|
343
322
|
},
|
344
323
|
error: c,
|
345
324
|
complete: a
|
346
325
|
});
|
347
|
-
s.subscribe(
|
326
|
+
s.subscribe(d);
|
348
327
|
});
|
349
328
|
}, t.prototype._subscribe = function(e) {
|
350
329
|
var r;
|
351
330
|
return (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e);
|
352
|
-
}, t.prototype[
|
331
|
+
}, t.prototype[$s] = function() {
|
353
332
|
return this;
|
354
333
|
}, t.prototype.pipe = function() {
|
355
334
|
for (var e = [], r = 0; r < arguments.length; r++)
|
356
335
|
e[r] = arguments[r];
|
357
|
-
return
|
336
|
+
return js(e)(this);
|
358
337
|
}, t.prototype.toPromise = function(e) {
|
359
338
|
var r = this;
|
360
|
-
return e =
|
339
|
+
return e = Hn(e), new e(function(s, a) {
|
361
340
|
var c;
|
362
|
-
r.subscribe(function(
|
363
|
-
return c =
|
364
|
-
}, function(
|
365
|
-
return a(
|
341
|
+
r.subscribe(function(d) {
|
342
|
+
return c = d;
|
343
|
+
}, function(d) {
|
344
|
+
return a(d);
|
366
345
|
}, function() {
|
367
346
|
return s(c);
|
368
347
|
});
|
@@ -371,32 +350,32 @@ var Nn = function() {
|
|
371
350
|
return new t(e);
|
372
351
|
}, t;
|
373
352
|
}();
|
374
|
-
function
|
353
|
+
function Hn(t) {
|
375
354
|
var e;
|
376
|
-
return (e = t ??
|
355
|
+
return (e = t ?? Os.Promise) !== null && e !== void 0 ? e : Promise;
|
377
356
|
}
|
378
|
-
function
|
357
|
+
function Hs(t) {
|
379
358
|
return t && Wt(t.next) && Wt(t.error) && Wt(t.complete);
|
380
359
|
}
|
381
|
-
function
|
382
|
-
return t && t instanceof
|
360
|
+
function Ls(t) {
|
361
|
+
return t && t instanceof os || Hs(t) && as(t);
|
383
362
|
}
|
384
|
-
var
|
363
|
+
var Us = ss(function(t) {
|
385
364
|
return function() {
|
386
365
|
t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
387
366
|
};
|
388
|
-
}),
|
367
|
+
}), cs = function(t) {
|
389
368
|
Qe(e, t);
|
390
369
|
function e() {
|
391
370
|
var r = t.call(this) || this;
|
392
371
|
return r.closed = !1, r.currentObservers = null, r.observers = [], r.isStopped = !1, r.hasError = !1, r.thrownError = null, r;
|
393
372
|
}
|
394
373
|
return e.prototype.lift = function(r) {
|
395
|
-
var s = new
|
374
|
+
var s = new Ln(this, this);
|
396
375
|
return s.operator = r, s;
|
397
376
|
}, e.prototype._throwIfClosed = function() {
|
398
377
|
if (this.closed)
|
399
|
-
throw new
|
378
|
+
throw new Us();
|
400
379
|
}, e.prototype.next = function(r) {
|
401
380
|
var s = this;
|
402
381
|
yr(function() {
|
@@ -404,7 +383,7 @@ var Gs = is(function(t) {
|
|
404
383
|
if (s._throwIfClosed(), !s.isStopped) {
|
405
384
|
s.currentObservers || (s.currentObservers = Array.from(s.observers));
|
406
385
|
try {
|
407
|
-
for (var
|
386
|
+
for (var d = yn(s.currentObservers), f = d.next(); !f.done; f = d.next()) {
|
408
387
|
var b = f.value;
|
409
388
|
b.next(r);
|
410
389
|
}
|
@@ -412,7 +391,7 @@ var Gs = is(function(t) {
|
|
412
391
|
a = { error: _ };
|
413
392
|
} finally {
|
414
393
|
try {
|
415
|
-
f && !f.done && (c =
|
394
|
+
f && !f.done && (c = d.return) && c.call(d);
|
416
395
|
} finally {
|
417
396
|
if (a) throw a.error;
|
418
397
|
}
|
@@ -451,20 +430,20 @@ var Gs = is(function(t) {
|
|
451
430
|
}, e.prototype._subscribe = function(r) {
|
452
431
|
return this._throwIfClosed(), this._checkFinalizedStatuses(r), this._innerSubscribe(r);
|
453
432
|
}, e.prototype._innerSubscribe = function(r) {
|
454
|
-
var s = this, a = this, c = a.hasError,
|
455
|
-
return c ||
|
456
|
-
s.currentObservers = null,
|
433
|
+
var s = this, a = this, c = a.hasError, d = a.isStopped, f = a.observers;
|
434
|
+
return c || d ? is : (this.currentObservers = null, f.push(r), new kr(function() {
|
435
|
+
s.currentObservers = null, bn(f, r);
|
457
436
|
}));
|
458
437
|
}, e.prototype._checkFinalizedStatuses = function(r) {
|
459
|
-
var s = this, a = s.hasError, c = s.thrownError,
|
460
|
-
a ? r.error(c) :
|
438
|
+
var s = this, a = s.hasError, c = s.thrownError, d = s.isStopped;
|
439
|
+
a ? r.error(c) : d && r.complete();
|
461
440
|
}, e.prototype.asObservable = function() {
|
462
|
-
var r = new
|
441
|
+
var r = new jn();
|
463
442
|
return r.source = this, r;
|
464
443
|
}, e.create = function(r, s) {
|
465
|
-
return new
|
444
|
+
return new Ln(r, s);
|
466
445
|
}, e;
|
467
|
-
}(
|
446
|
+
}(jn), Ln = function(t) {
|
468
447
|
Qe(e, t);
|
469
448
|
function e(r, s) {
|
470
449
|
var a = t.call(this) || this;
|
@@ -481,9 +460,9 @@ var Gs = is(function(t) {
|
|
481
460
|
(s = (r = this.destination) === null || r === void 0 ? void 0 : r.complete) === null || s === void 0 || s.call(r);
|
482
461
|
}, e.prototype._subscribe = function(r) {
|
483
462
|
var s, a;
|
484
|
-
return (a = (s = this.source) === null || s === void 0 ? void 0 : s.subscribe(r)) !== null && a !== void 0 ? a :
|
463
|
+
return (a = (s = this.source) === null || s === void 0 ? void 0 : s.subscribe(r)) !== null && a !== void 0 ? a : is;
|
485
464
|
}, e;
|
486
|
-
}(
|
465
|
+
}(cs), Un = function(t) {
|
487
466
|
Qe(e, t);
|
488
467
|
function e(r) {
|
489
468
|
var s = t.call(this) || this;
|
@@ -506,15 +485,15 @@ var Gs = is(function(t) {
|
|
506
485
|
}, e.prototype.next = function(r) {
|
507
486
|
t.prototype.next.call(this, this._value = r);
|
508
487
|
}, e;
|
509
|
-
}(
|
488
|
+
}(cs), St = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
510
489
|
function xn(t) {
|
511
490
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
512
491
|
}
|
513
492
|
var gr = { exports: {} };
|
514
493
|
gr.exports;
|
515
494
|
(function(t, e) {
|
516
|
-
var r = 200, s = "__lodash_hash_undefined__", a = 1, c = 2,
|
517
|
-
A[L] = A[R] = A[
|
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
|
+
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;
|
518
497
|
var et = typeof St == "object" && St && St.Object === Object && St, Mt = typeof self == "object" && self && self.Object === Object && self, ot = et || Mt || Function("return this")(), $t = e && !e.nodeType && e, Et = $t && !0 && t && !t.nodeType && t, Gt = Et && Et.exports === $t, Yt = Gt && et.process, ee = function() {
|
519
498
|
try {
|
520
499
|
return Yt && Yt.binding && Yt.binding("util");
|
@@ -522,15 +501,15 @@ gr.exports;
|
|
522
501
|
}
|
523
502
|
}(), Bt = ee && ee.isTypedArray;
|
524
503
|
function re(n, i) {
|
525
|
-
for (var o = -1, p = n == null ? 0 : n.length,
|
504
|
+
for (var o = -1, p = n == null ? 0 : n.length, N = 0, P = []; ++o < p; ) {
|
526
505
|
var G = n[o];
|
527
|
-
i(G, o, n) && (P[
|
506
|
+
i(G, o, n) && (P[N++] = G);
|
528
507
|
}
|
529
508
|
return P;
|
530
509
|
}
|
531
510
|
function Xt(n, i) {
|
532
|
-
for (var o = -1, p = i.length,
|
533
|
-
n[
|
511
|
+
for (var o = -1, p = i.length, N = n.length; ++o < p; )
|
512
|
+
n[N + o] = i[o];
|
534
513
|
return n;
|
535
514
|
}
|
536
515
|
function ne(n, i) {
|
@@ -549,7 +528,7 @@ gr.exports;
|
|
549
528
|
return n(i);
|
550
529
|
};
|
551
530
|
}
|
552
|
-
function
|
531
|
+
function Nt(n, i) {
|
553
532
|
return n.has(i);
|
554
533
|
}
|
555
534
|
function Kt(n, i) {
|
@@ -557,16 +536,16 @@ gr.exports;
|
|
557
536
|
}
|
558
537
|
function $(n) {
|
559
538
|
var i = -1, o = Array(n.size);
|
560
|
-
return n.forEach(function(p,
|
561
|
-
o[++i] = [
|
539
|
+
return n.forEach(function(p, N) {
|
540
|
+
o[++i] = [N, p];
|
562
541
|
}), o;
|
563
542
|
}
|
564
|
-
function
|
543
|
+
function H(n, i) {
|
565
544
|
return function(o) {
|
566
545
|
return n(i(o));
|
567
546
|
};
|
568
547
|
}
|
569
|
-
function
|
548
|
+
function z(n) {
|
570
549
|
var i = -1, o = Array(n.size);
|
571
550
|
return n.forEach(function(p) {
|
572
551
|
o[++i] = p;
|
@@ -577,7 +556,7 @@ gr.exports;
|
|
577
556
|
return n ? "Symbol(src)_1." + n : "";
|
578
557
|
}(), se = B.toString, Pe = RegExp(
|
579
558
|
"^" + q.call(ht).replace(wt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
580
|
-
), Y = Gt ? ot.Buffer : void 0, mt = ot.Symbol, Vt = ot.Uint8Array, qt = B.propertyIsEnumerable, Tt = rt.splice, At = mt ? mt.toStringTag : void 0, we = Object.getOwnPropertySymbols, Re = Y ? Y.isBuffer : void 0, ie =
|
559
|
+
), Y = Gt ? ot.Buffer : void 0, mt = ot.Symbol, Vt = ot.Uint8Array, qt = B.propertyIsEnumerable, Tt = rt.splice, At = mt ? mt.toStringTag : void 0, we = Object.getOwnPropertySymbols, Re = Y ? Y.isBuffer : void 0, ie = H(Object.keys, Object), ze = Ht(ot, "DataView"), ae = Ht(ot, "Map"), Fe = Ht(ot, "Promise"), $e = Ht(ot, "Set"), Ne = Ht(ot, "WeakMap"), Jt = Ht(Object, "create"), rr = yt(ze), jt = yt(ae), Er = yt(Fe), Tr = yt($e), Ar = yt(Ne), nr = mt ? mt.prototype : void 0, je = nr ? nr.valueOf : void 0;
|
581
560
|
function nt(n) {
|
582
561
|
var i = -1, o = n == null ? 0 : n.length;
|
583
562
|
for (this.clear(); ++i < o; ) {
|
@@ -585,10 +564,10 @@ gr.exports;
|
|
585
564
|
this.set(p[0], p[1]);
|
586
565
|
}
|
587
566
|
}
|
588
|
-
function
|
567
|
+
function xr() {
|
589
568
|
this.__data__ = Jt ? Jt(null) : {}, this.size = 0;
|
590
569
|
}
|
591
|
-
function
|
570
|
+
function Dr(n) {
|
592
571
|
var i = this.has(n) && delete this.__data__[n];
|
593
572
|
return this.size -= i ? 1 : 0, i;
|
594
573
|
}
|
@@ -608,7 +587,7 @@ gr.exports;
|
|
608
587
|
var o = this.__data__;
|
609
588
|
return this.size += this.has(n) ? 0 : 1, o[n] = Jt && i === void 0 ? s : i, this;
|
610
589
|
}
|
611
|
-
nt.prototype.clear =
|
590
|
+
nt.prototype.clear = xr, nt.prototype.delete = Dr, nt.prototype.get = Or, nt.prototype.has = Cr, nt.prototype.set = Pr;
|
612
591
|
function lt(n) {
|
613
592
|
var i = -1, o = n == null ? 0 : n.length;
|
614
593
|
for (this.clear(); ++i < o; ) {
|
@@ -619,25 +598,25 @@ gr.exports;
|
|
619
598
|
function Rr() {
|
620
599
|
this.__data__ = [], this.size = 0;
|
621
600
|
}
|
622
|
-
function
|
601
|
+
function zr(n) {
|
623
602
|
var i = this.__data__, o = Te(i, n);
|
624
603
|
if (o < 0)
|
625
604
|
return !1;
|
626
605
|
var p = i.length - 1;
|
627
606
|
return o == p ? i.pop() : Tt.call(i, o, 1), --this.size, !0;
|
628
607
|
}
|
629
|
-
function
|
608
|
+
function Fr(n) {
|
630
609
|
var i = this.__data__, o = Te(i, n);
|
631
610
|
return o < 0 ? void 0 : i[o][1];
|
632
611
|
}
|
633
612
|
function $r(n) {
|
634
613
|
return Te(this.__data__, n) > -1;
|
635
614
|
}
|
636
|
-
function
|
615
|
+
function Nr(n, i) {
|
637
616
|
var o = this.__data__, p = Te(o, n);
|
638
617
|
return p < 0 ? (++this.size, o.push([n, i])) : o[p][1] = i, this;
|
639
618
|
}
|
640
|
-
lt.prototype.clear = Rr, lt.prototype.delete =
|
619
|
+
lt.prototype.clear = Rr, lt.prototype.delete = zr, lt.prototype.get = Fr, lt.prototype.has = $r, lt.prototype.set = Nr;
|
641
620
|
function It(n) {
|
642
621
|
var i = -1, o = n == null ? 0 : n.length;
|
643
622
|
for (this.clear(); ++i < o; ) {
|
@@ -645,28 +624,28 @@ gr.exports;
|
|
645
624
|
this.set(p[0], p[1]);
|
646
625
|
}
|
647
626
|
}
|
648
|
-
function
|
627
|
+
function jr() {
|
649
628
|
this.size = 0, this.__data__ = {
|
650
629
|
hash: new nt(),
|
651
630
|
map: new (ae || lt)(),
|
652
631
|
string: new nt()
|
653
632
|
};
|
654
633
|
}
|
655
|
-
function
|
656
|
-
var i =
|
634
|
+
function Hr(n) {
|
635
|
+
var i = xt(this, n).delete(n);
|
657
636
|
return this.size -= i ? 1 : 0, i;
|
658
637
|
}
|
659
638
|
function Lr(n) {
|
660
|
-
return
|
639
|
+
return xt(this, n).get(n);
|
661
640
|
}
|
662
641
|
function Ur(n) {
|
663
|
-
return
|
642
|
+
return xt(this, n).has(n);
|
664
643
|
}
|
665
644
|
function Wr(n, i) {
|
666
|
-
var o =
|
645
|
+
var o = xt(this, n), p = o.size;
|
667
646
|
return o.set(n, i), this.size += o.size == p ? 0 : 1, this;
|
668
647
|
}
|
669
|
-
It.prototype.clear =
|
648
|
+
It.prototype.clear = jr, It.prototype.delete = Hr, It.prototype.get = Lr, It.prototype.has = Ur, It.prototype.set = Wr;
|
670
649
|
function Me(n) {
|
671
650
|
var i = -1, o = n == null ? 0 : n.length;
|
672
651
|
for (this.__data__ = new It(); ++i < o; )
|
@@ -683,7 +662,7 @@ gr.exports;
|
|
683
662
|
var i = this.__data__ = new lt(n);
|
684
663
|
this.size = i.size;
|
685
664
|
}
|
686
|
-
function
|
665
|
+
function He() {
|
687
666
|
this.__data__ = new lt(), this.size = 0;
|
688
667
|
}
|
689
668
|
function Gr(n) {
|
@@ -706,13 +685,13 @@ gr.exports;
|
|
706
685
|
}
|
707
686
|
return o.set(n, i), this.size = o.size, this;
|
708
687
|
}
|
709
|
-
Ct.prototype.clear =
|
688
|
+
Ct.prototype.clear = He, Ct.prototype.delete = Gr, Ct.prototype.get = Yr, Ct.prototype.has = Br, Ct.prototype.set = Xr;
|
710
689
|
function Kr(n, i) {
|
711
|
-
var o = Ae(n), p = !o && ur(n),
|
690
|
+
var o = Ae(n), p = !o && ur(n), N = !o && !p && xe(n), P = !o && !p && !N && fr(n), G = o || p || N || P, W = G ? _e(n.length, String) : [], J = W.length;
|
712
691
|
for (var X in n)
|
713
692
|
ht.call(n, X) && !(G && // Safari 9 has enumerable `arguments.length` in strict mode.
|
714
693
|
(X == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
715
|
-
|
694
|
+
N && (X == "offset" || X == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
716
695
|
P && (X == "buffer" || X == "byteLength" || X == "byteOffset") || // Skip index properties.
|
717
696
|
rn(X, J))) && W.push(X);
|
718
697
|
return W;
|
@@ -733,28 +712,28 @@ gr.exports;
|
|
733
712
|
function ir(n) {
|
734
713
|
return Rt(n) && oe(n) == f;
|
735
714
|
}
|
736
|
-
function ar(n, i, o, p,
|
737
|
-
return n === i ? !0 : n == null || i == null || !Rt(n) && !Rt(i) ? n !== n && i !== i : Vr(n, i, o, p, ar,
|
715
|
+
function ar(n, i, o, p, N) {
|
716
|
+
return n === i ? !0 : n == null || i == null || !Rt(n) && !Rt(i) ? n !== n && i !== i : Vr(n, i, o, p, ar, N);
|
738
717
|
}
|
739
|
-
function Vr(n, i, o, p,
|
718
|
+
function Vr(n, i, o, p, N, P) {
|
740
719
|
var G = Ae(n), W = Ae(i), J = G ? b : Pt(n), X = W ? b : Pt(i);
|
741
720
|
J = J == f ? w : J, X = X == f ? w : X;
|
742
721
|
var dt = J == w, bt = X == w, Z = J == X;
|
743
|
-
if (Z &&
|
744
|
-
if (!
|
722
|
+
if (Z && xe(n)) {
|
723
|
+
if (!xe(i))
|
745
724
|
return !1;
|
746
725
|
G = !0, dt = !1;
|
747
726
|
}
|
748
727
|
if (Z && !dt)
|
749
|
-
return P || (P = new Ct()), G || fr(n) ? Ue(n, i, o, p,
|
728
|
+
return P || (P = new Ct()), G || fr(n) ? Ue(n, i, o, p, N, P) : Qr(n, i, J, o, p, N, P);
|
750
729
|
if (!(o & a)) {
|
751
730
|
var ft = dt && ht.call(n, "__wrapped__"), st = bt && ht.call(i, "__wrapped__");
|
752
731
|
if (ft || st) {
|
753
732
|
var Zt = ft ? n.value() : n, Ut = st ? i.value() : i;
|
754
|
-
return P || (P = new Ct()),
|
733
|
+
return P || (P = new Ct()), N(Zt, Ut, o, p, P);
|
755
734
|
}
|
756
735
|
}
|
757
|
-
return Z ? (P || (P = new Ct()), tn(n, i, o, p,
|
736
|
+
return Z ? (P || (P = new Ct()), tn(n, i, o, p, N, P)) : !1;
|
758
737
|
}
|
759
738
|
function qr(n) {
|
760
739
|
if (!dr(n) || sn(n))
|
@@ -773,7 +752,7 @@ gr.exports;
|
|
773
752
|
ht.call(n, o) && o != "constructor" && i.push(o);
|
774
753
|
return i;
|
775
754
|
}
|
776
|
-
function Ue(n, i, o, p,
|
755
|
+
function Ue(n, i, o, p, N, P) {
|
777
756
|
var G = o & a, W = n.length, J = i.length;
|
778
757
|
if (W != J && !(G && J > W))
|
779
758
|
return !1;
|
@@ -793,22 +772,22 @@ gr.exports;
|
|
793
772
|
}
|
794
773
|
if (Z) {
|
795
774
|
if (!ne(i, function(Ut, ue) {
|
796
|
-
if (!
|
775
|
+
if (!Nt(Z, ue) && (ft === Ut || N(ft, Ut, o, p, P)))
|
797
776
|
return Z.push(ue);
|
798
777
|
})) {
|
799
778
|
bt = !1;
|
800
779
|
break;
|
801
780
|
}
|
802
|
-
} else if (!(ft === st ||
|
781
|
+
} else if (!(ft === st || N(ft, st, o, p, P))) {
|
803
782
|
bt = !1;
|
804
783
|
break;
|
805
784
|
}
|
806
785
|
}
|
807
786
|
return P.delete(n), P.delete(i), bt;
|
808
787
|
}
|
809
|
-
function Qr(n, i, o, p,
|
788
|
+
function Qr(n, i, o, p, N, P, G) {
|
810
789
|
switch (o) {
|
811
|
-
case
|
790
|
+
case j:
|
812
791
|
if (n.byteLength != i.byteLength || n.byteOffset != i.byteOffset)
|
813
792
|
return !1;
|
814
793
|
n = n.buffer, i = i.buffer;
|
@@ -816,32 +795,32 @@ gr.exports;
|
|
816
795
|
return !(n.byteLength != i.byteLength || !P(new Vt(n), new Vt(i)));
|
817
796
|
case M:
|
818
797
|
case E:
|
819
|
-
case
|
798
|
+
case l:
|
820
799
|
return cr(+n, +i);
|
821
|
-
case y:
|
822
|
-
return n.name == i.name && n.message == i.message;
|
823
800
|
case m:
|
801
|
+
return n.name == i.name && n.message == i.message;
|
802
|
+
case y:
|
824
803
|
case I:
|
825
804
|
return n == i + "";
|
826
805
|
case u:
|
827
806
|
var W = $;
|
828
807
|
case v:
|
829
808
|
var J = p & a;
|
830
|
-
if (W || (W =
|
809
|
+
if (W || (W = z), n.size != i.size && !J)
|
831
810
|
return !1;
|
832
811
|
var X = G.get(n);
|
833
812
|
if (X)
|
834
813
|
return X == i;
|
835
814
|
p |= c, G.set(n, i);
|
836
|
-
var dt = Ue(W(n), W(i), p,
|
815
|
+
var dt = Ue(W(n), W(i), p, N, P, G);
|
837
816
|
return G.delete(n), dt;
|
838
817
|
case x:
|
839
|
-
if (
|
840
|
-
return
|
818
|
+
if (je)
|
819
|
+
return je.call(n) == je.call(i);
|
841
820
|
}
|
842
821
|
return !1;
|
843
822
|
}
|
844
|
-
function tn(n, i, o, p,
|
823
|
+
function tn(n, i, o, p, N, P) {
|
845
824
|
var G = o & a, W = ce(n), J = W.length, X = ce(i), dt = X.length;
|
846
825
|
if (J != dt && !G)
|
847
826
|
return !1;
|
@@ -859,8 +838,8 @@ gr.exports;
|
|
859
838
|
Z = W[bt];
|
860
839
|
var Ut = n[Z], ue = i[Z];
|
861
840
|
if (p)
|
862
|
-
var
|
863
|
-
if (!(
|
841
|
+
var Fn = G ? p(ue, Ut, Z, i, n, P) : p(Ut, ue, Z, n, i, P);
|
842
|
+
if (!(Fn === void 0 ? Ut === ue || N(Ut, ue, o, p, P) : Fn)) {
|
864
843
|
st = !1;
|
865
844
|
break;
|
866
845
|
}
|
@@ -875,11 +854,11 @@ gr.exports;
|
|
875
854
|
function ce(n) {
|
876
855
|
return Le(n, Ye, en);
|
877
856
|
}
|
878
|
-
function
|
857
|
+
function xt(n, i) {
|
879
858
|
var o = n.__data__;
|
880
859
|
return nn(i) ? o[typeof i == "string" ? "string" : "hash"] : o.map;
|
881
860
|
}
|
882
|
-
function
|
861
|
+
function Ht(n, i) {
|
883
862
|
var o = Kt(n, i);
|
884
863
|
return qr(o) ? o : void 0;
|
885
864
|
}
|
@@ -890,21 +869,21 @@ gr.exports;
|
|
890
869
|
var p = !0;
|
891
870
|
} catch {
|
892
871
|
}
|
893
|
-
var
|
894
|
-
return p && (i ? n[At] = o : delete n[At]),
|
872
|
+
var N = se.call(n);
|
873
|
+
return p && (i ? n[At] = o : delete n[At]), N;
|
895
874
|
}
|
896
875
|
var en = we ? function(n) {
|
897
876
|
return n == null ? [] : (n = Object(n), re(we(n), function(i) {
|
898
877
|
return qt.call(n, i);
|
899
878
|
}));
|
900
879
|
} : cn, Pt = oe;
|
901
|
-
(
|
880
|
+
(ze && Pt(new ze(new ArrayBuffer(1))) != j || ae && Pt(new ae()) != u || Fe && Pt(Fe.resolve()) != k || $e && Pt(new $e()) != v || Ne && Pt(new Ne()) != O) && (Pt = function(n) {
|
902
881
|
var i = oe(n), o = i == w ? n.constructor : void 0, p = o ? yt(o) : "";
|
903
882
|
if (p)
|
904
883
|
switch (p) {
|
905
884
|
case rr:
|
906
|
-
return
|
907
|
-
case
|
885
|
+
return j;
|
886
|
+
case jt:
|
908
887
|
return u;
|
909
888
|
case Er:
|
910
889
|
return k;
|
@@ -916,7 +895,7 @@ gr.exports;
|
|
916
895
|
return i;
|
917
896
|
});
|
918
897
|
function rn(n, i) {
|
919
|
-
return i = i ??
|
898
|
+
return i = i ?? d, !!i && (typeof n == "number" || Ft.test(n)) && n > -1 && n % 1 == 0 && n < i;
|
920
899
|
}
|
921
900
|
function nn(n) {
|
922
901
|
var i = typeof n;
|
@@ -956,7 +935,7 @@ gr.exports;
|
|
956
935
|
function We(n) {
|
957
936
|
return n != null && Ge(n.length) && !lr(n);
|
958
937
|
}
|
959
|
-
var
|
938
|
+
var xe = Re || un;
|
960
939
|
function on(n, i) {
|
961
940
|
return ar(n, i);
|
962
941
|
}
|
@@ -967,7 +946,7 @@ gr.exports;
|
|
967
946
|
return i == T || i == C || i == _ || i == h;
|
968
947
|
}
|
969
948
|
function Ge(n) {
|
970
|
-
return typeof n == "number" && n > -1 && n % 1 == 0 && n <=
|
949
|
+
return typeof n == "number" && n > -1 && n % 1 == 0 && n <= d;
|
971
950
|
}
|
972
951
|
function dr(n) {
|
973
952
|
var i = typeof n;
|
@@ -988,14 +967,14 @@ gr.exports;
|
|
988
967
|
}
|
989
968
|
t.exports = on;
|
990
969
|
})(gr, gr.exports);
|
991
|
-
var
|
992
|
-
const Q = /* @__PURE__ */ xn(
|
970
|
+
var Ws = gr.exports;
|
971
|
+
const Q = /* @__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`;
|
993
972
|
var Ir = { exports: {} };
|
994
973
|
Ir.exports;
|
995
974
|
(function(t, e) {
|
996
|
-
var r = 200, s = "__lodash_hash_undefined__", a = 9007199254740991, c = "[object Arguments]",
|
997
|
-
U[c] = U[
|
998
|
-
var
|
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
|
+
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, et = A && A.exports === Ft;
|
999
978
|
function Mt(n, i) {
|
1000
979
|
return n.set(i[0], i[1]), n;
|
1001
980
|
}
|
@@ -1008,13 +987,13 @@ Ir.exports;
|
|
1008
987
|
return n;
|
1009
988
|
}
|
1010
989
|
function Et(n, i) {
|
1011
|
-
for (var o = -1, p = i.length,
|
1012
|
-
n[
|
990
|
+
for (var o = -1, p = i.length, N = n.length; ++o < p; )
|
991
|
+
n[N + o] = i[o];
|
1013
992
|
return n;
|
1014
993
|
}
|
1015
994
|
function Gt(n, i, o, p) {
|
1016
|
-
for (var
|
1017
|
-
o = i(o, n[
|
995
|
+
for (var N = -1, P = n ? n.length : 0; ++N < P; )
|
996
|
+
o = i(o, n[N], N, n);
|
1018
997
|
return o;
|
1019
998
|
}
|
1020
999
|
function Yt(n, i) {
|
@@ -1036,8 +1015,8 @@ Ir.exports;
|
|
1036
1015
|
}
|
1037
1016
|
function re(n) {
|
1038
1017
|
var i = -1, o = Array(n.size);
|
1039
|
-
return n.forEach(function(p,
|
1040
|
-
o[++i] = [
|
1018
|
+
return n.forEach(function(p, N) {
|
1019
|
+
o[++i] = [N, p];
|
1041
1020
|
}), o;
|
1042
1021
|
}
|
1043
1022
|
function Xt(n, i) {
|
@@ -1051,13 +1030,13 @@ Ir.exports;
|
|
1051
1030
|
o[++i] = p;
|
1052
1031
|
}), o;
|
1053
1032
|
}
|
1054
|
-
var _e = Array.prototype, ke = Function.prototype,
|
1033
|
+
var _e = Array.prototype, ke = Function.prototype, Nt = Object.prototype, Kt = at["__core-js_shared__"], $ = function() {
|
1055
1034
|
var n = /[^.]+$/.exec(Kt && Kt.keys && Kt.keys.IE_PROTO || "");
|
1056
1035
|
return n ? "Symbol(src)_1." + n : "";
|
1057
|
-
}(),
|
1058
|
-
"^" +
|
1059
|
-
), B = et ? at.Buffer : void 0, ut = at.Symbol, q = at.Uint8Array, ht = Xt(Object.getPrototypeOf, Object), Se = Object.create, se =
|
1060
|
-
function
|
1036
|
+
}(), H = ke.toString, z = Nt.hasOwnProperty, rt = Nt.toString, ct = RegExp(
|
1037
|
+
"^" + H.call(z).replace(V, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
1038
|
+
), B = et ? 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
|
+
function jt(n) {
|
1061
1040
|
var i = -1, o = n ? n.length : 0;
|
1062
1041
|
for (this.clear(); ++i < o; ) {
|
1063
1042
|
var p = n[i];
|
@@ -1076,17 +1055,17 @@ Ir.exports;
|
|
1076
1055
|
var o = i[n];
|
1077
1056
|
return o === s ? void 0 : o;
|
1078
1057
|
}
|
1079
|
-
return
|
1058
|
+
return z.call(i, n) ? i[n] : void 0;
|
1080
1059
|
}
|
1081
1060
|
function nr(n) {
|
1082
1061
|
var i = this.__data__;
|
1083
|
-
return ie ? i[n] !== void 0 :
|
1062
|
+
return ie ? i[n] !== void 0 : z.call(i, n);
|
1084
1063
|
}
|
1085
|
-
function
|
1064
|
+
function je(n, i) {
|
1086
1065
|
var o = this.__data__;
|
1087
1066
|
return o[n] = ie && i === void 0 ? s : i, this;
|
1088
1067
|
}
|
1089
|
-
|
1068
|
+
jt.prototype.clear = Er, jt.prototype.delete = Tr, jt.prototype.get = Ar, jt.prototype.has = nr, jt.prototype.set = je;
|
1090
1069
|
function nt(n) {
|
1091
1070
|
var i = -1, o = n ? n.length : 0;
|
1092
1071
|
for (this.clear(); ++i < o; ) {
|
@@ -1094,10 +1073,10 @@ Ir.exports;
|
|
1094
1073
|
this.set(p[0], p[1]);
|
1095
1074
|
}
|
1096
1075
|
}
|
1097
|
-
function
|
1076
|
+
function xr() {
|
1098
1077
|
this.__data__ = [];
|
1099
1078
|
}
|
1100
|
-
function
|
1079
|
+
function Dr(n) {
|
1101
1080
|
var i = this.__data__, o = Ee(i, n);
|
1102
1081
|
if (o < 0)
|
1103
1082
|
return !1;
|
@@ -1115,7 +1094,7 @@ Ir.exports;
|
|
1115
1094
|
var o = this.__data__, p = Ee(o, n);
|
1116
1095
|
return p < 0 ? o.push([n, i]) : o[p][1] = i, this;
|
1117
1096
|
}
|
1118
|
-
nt.prototype.clear =
|
1097
|
+
nt.prototype.clear = xr, nt.prototype.delete = Dr, nt.prototype.get = Or, nt.prototype.has = Cr, nt.prototype.set = Pr;
|
1119
1098
|
function lt(n) {
|
1120
1099
|
var i = -1, o = n ? n.length : 0;
|
1121
1100
|
for (this.clear(); ++i < o; ) {
|
@@ -1125,31 +1104,31 @@ Ir.exports;
|
|
1125
1104
|
}
|
1126
1105
|
function Rr() {
|
1127
1106
|
this.__data__ = {
|
1128
|
-
hash: new
|
1107
|
+
hash: new jt(),
|
1129
1108
|
map: new (Tt || nt)(),
|
1130
|
-
string: new
|
1109
|
+
string: new jt()
|
1131
1110
|
};
|
1132
1111
|
}
|
1133
|
-
function
|
1112
|
+
function zr(n) {
|
1134
1113
|
return ce(this, n).delete(n);
|
1135
1114
|
}
|
1136
|
-
function
|
1115
|
+
function Fr(n) {
|
1137
1116
|
return ce(this, n).get(n);
|
1138
1117
|
}
|
1139
1118
|
function $r(n) {
|
1140
1119
|
return ce(this, n).has(n);
|
1141
1120
|
}
|
1142
|
-
function
|
1121
|
+
function Nr(n, i) {
|
1143
1122
|
return ce(this, n).set(n, i), this;
|
1144
1123
|
}
|
1145
|
-
lt.prototype.clear = Rr, lt.prototype.delete =
|
1124
|
+
lt.prototype.clear = Rr, lt.prototype.delete = zr, lt.prototype.get = Fr, lt.prototype.has = $r, lt.prototype.set = Nr;
|
1146
1125
|
function It(n) {
|
1147
1126
|
this.__data__ = new nt(n);
|
1148
1127
|
}
|
1149
|
-
function
|
1128
|
+
function jr() {
|
1150
1129
|
this.__data__ = new nt();
|
1151
1130
|
}
|
1152
|
-
function
|
1131
|
+
function Hr(n) {
|
1153
1132
|
return this.__data__.delete(n);
|
1154
1133
|
}
|
1155
1134
|
function Lr(n) {
|
@@ -1168,16 +1147,16 @@ Ir.exports;
|
|
1168
1147
|
}
|
1169
1148
|
return o.set(n, i), this;
|
1170
1149
|
}
|
1171
|
-
It.prototype.clear =
|
1150
|
+
It.prototype.clear = jr, It.prototype.delete = Hr, It.prototype.get = Lr, It.prototype.has = Ur, It.prototype.set = Wr;
|
1172
1151
|
function Me(n, i) {
|
1173
|
-
var o = We(n) || Ae(n) ? Yt(n.length, String) : [], p = o.length,
|
1152
|
+
var o = We(n) || Ae(n) ? Yt(n.length, String) : [], p = o.length, N = !!p;
|
1174
1153
|
for (var P in n)
|
1175
|
-
|
1154
|
+
z.call(n, P) && !(N && (P == "length" || nn(P, p))) && o.push(P);
|
1176
1155
|
return o;
|
1177
1156
|
}
|
1178
1157
|
function sr(n, i, o) {
|
1179
1158
|
var p = n[i];
|
1180
|
-
(!(
|
1159
|
+
(!(z.call(n, i) && ur(p, o)) || o === void 0 && !(i in n)) && (n[i] = o);
|
1181
1160
|
}
|
1182
1161
|
function Ee(n, i) {
|
1183
1162
|
for (var o = n.length; o--; )
|
@@ -1188,9 +1167,9 @@ Ir.exports;
|
|
1188
1167
|
function Ct(n, i) {
|
1189
1168
|
return n && Ue(i, Ye(i), n);
|
1190
1169
|
}
|
1191
|
-
function
|
1170
|
+
function He(n, i, o, p, N, P, G) {
|
1192
1171
|
var W;
|
1193
|
-
if (p && (W = P ? p(n,
|
1172
|
+
if (p && (W = P ? p(n, N, P, G) : p(n)), W !== void 0)
|
1194
1173
|
return W;
|
1195
1174
|
if (!Rt(n))
|
1196
1175
|
return n;
|
@@ -1210,7 +1189,7 @@ Ir.exports;
|
|
1210
1189
|
} else {
|
1211
1190
|
if (!U[X])
|
1212
1191
|
return P ? n : {};
|
1213
|
-
W = rn(n, X,
|
1192
|
+
W = rn(n, X, He, i);
|
1214
1193
|
}
|
1215
1194
|
}
|
1216
1195
|
G || (G = new It());
|
@@ -1220,7 +1199,7 @@ Ir.exports;
|
|
1220
1199
|
if (G.set(n, W), !J)
|
1221
1200
|
var Z = o ? tn(n) : Ye(n);
|
1222
1201
|
return $t(Z || n, function(ft, st) {
|
1223
|
-
Z && (st = ft, ft = n[st]), sr(W, st,
|
1202
|
+
Z && (st = ft, ft = n[st]), sr(W, st, He(ft, i, o, p, st, n, G));
|
1224
1203
|
}), W;
|
1225
1204
|
}
|
1226
1205
|
function Gr(n) {
|
@@ -1236,7 +1215,7 @@ Ir.exports;
|
|
1236
1215
|
function Xr(n) {
|
1237
1216
|
if (!Rt(n) || an(n))
|
1238
1217
|
return !1;
|
1239
|
-
var i = Ge(n) || Bt(n) ? ct :
|
1218
|
+
var i = Ge(n) || Bt(n) ? ct : Dt;
|
1240
1219
|
return i.test(yt(n));
|
1241
1220
|
}
|
1242
1221
|
function Kr(n) {
|
@@ -1244,7 +1223,7 @@ Ir.exports;
|
|
1244
1223
|
return Vt(n);
|
1245
1224
|
var i = [];
|
1246
1225
|
for (var o in Object(n))
|
1247
|
-
|
1226
|
+
z.call(n, o) && o != "constructor" && i.push(o);
|
1248
1227
|
return i;
|
1249
1228
|
}
|
1250
1229
|
function Te(n, i) {
|
@@ -1288,59 +1267,59 @@ Ir.exports;
|
|
1288
1267
|
}
|
1289
1268
|
function Ue(n, i, o, p) {
|
1290
1269
|
o || (o = {});
|
1291
|
-
for (var
|
1292
|
-
var G = i[
|
1270
|
+
for (var N = -1, P = i.length; ++N < P; ) {
|
1271
|
+
var G = i[N], W = void 0;
|
1293
1272
|
sr(o, G, W === void 0 ? n[G] : W);
|
1294
1273
|
}
|
1295
1274
|
return o;
|
1296
1275
|
}
|
1297
1276
|
function Qr(n, i) {
|
1298
|
-
return Ue(n,
|
1277
|
+
return Ue(n, Ht(n), i);
|
1299
1278
|
}
|
1300
1279
|
function tn(n) {
|
1301
|
-
return Yr(n, Ye,
|
1280
|
+
return Yr(n, Ye, Ht);
|
1302
1281
|
}
|
1303
1282
|
function ce(n, i) {
|
1304
1283
|
var o = n.__data__;
|
1305
1284
|
return sn(i) ? o[typeof i == "string" ? "string" : "hash"] : o.map;
|
1306
1285
|
}
|
1307
|
-
function
|
1286
|
+
function xt(n, i) {
|
1308
1287
|
var o = ee(n, i);
|
1309
1288
|
return Xr(o) ? o : void 0;
|
1310
1289
|
}
|
1311
|
-
var
|
1312
|
-
(qt && Lt(new qt(new ArrayBuffer(1))) != v || Tt && Lt(new Tt()) !=
|
1290
|
+
var Ht = Y ? Xt(Y, Object) : cn, Lt = Br;
|
1291
|
+
(qt && Lt(new qt(new ArrayBuffer(1))) != v || Tt && Lt(new Tt()) != m || At && Lt(At.resolve()) != u || we && Lt(new we()) != S || Re && Lt(new Re()) != h) && (Lt = function(n) {
|
1313
1292
|
var i = rt.call(n), o = i == C ? n.constructor : void 0, p = o ? yt(o) : void 0;
|
1314
1293
|
if (p)
|
1315
1294
|
switch (p) {
|
1316
|
-
case
|
1295
|
+
case ze:
|
1317
1296
|
return v;
|
1318
1297
|
case ae:
|
1319
|
-
return
|
1320
|
-
case
|
1298
|
+
return m;
|
1299
|
+
case Fe:
|
1321
1300
|
return u;
|
1322
1301
|
case $e:
|
1323
1302
|
return S;
|
1324
|
-
case
|
1303
|
+
case Ne:
|
1325
1304
|
return h;
|
1326
1305
|
}
|
1327
1306
|
return i;
|
1328
1307
|
});
|
1329
1308
|
function en(n) {
|
1330
1309
|
var i = n.length, o = n.constructor(i);
|
1331
|
-
return i && typeof n[0] == "string" &&
|
1310
|
+
return i && typeof n[0] == "string" && z.call(n, "index") && (o.index = n.index, o.input = n.input), o;
|
1332
1311
|
}
|
1333
1312
|
function Pt(n) {
|
1334
1313
|
return typeof n.constructor == "function" && !or(n) ? Gr(ht(n)) : {};
|
1335
1314
|
}
|
1336
1315
|
function rn(n, i, o, p) {
|
1337
|
-
var
|
1316
|
+
var N = n.constructor;
|
1338
1317
|
switch (i) {
|
1339
|
-
case
|
1318
|
+
case y:
|
1340
1319
|
return Le(n);
|
1341
1320
|
case f:
|
1342
1321
|
case b:
|
1343
|
-
return new
|
1322
|
+
return new N(+n);
|
1344
1323
|
case v:
|
1345
1324
|
return oe(n, p);
|
1346
1325
|
case I:
|
@@ -1348,17 +1327,17 @@ Ir.exports;
|
|
1348
1327
|
case g:
|
1349
1328
|
case O:
|
1350
1329
|
case D:
|
1351
|
-
case
|
1330
|
+
case j:
|
1352
1331
|
case L:
|
1353
1332
|
case R:
|
1354
|
-
case
|
1333
|
+
case F:
|
1355
1334
|
return Jr(n, p);
|
1356
|
-
case
|
1335
|
+
case m:
|
1357
1336
|
return ir(n, p, o);
|
1358
1337
|
case T:
|
1359
1338
|
case w:
|
1360
|
-
return new
|
1361
|
-
case
|
1339
|
+
return new N(n);
|
1340
|
+
case l:
|
1362
1341
|
return ar(n);
|
1363
1342
|
case S:
|
1364
1343
|
return Vr(n, p, o);
|
@@ -1377,13 +1356,13 @@ Ir.exports;
|
|
1377
1356
|
return !!$ && $ in n;
|
1378
1357
|
}
|
1379
1358
|
function or(n) {
|
1380
|
-
var i = n && n.constructor, o = typeof i == "function" && i.prototype ||
|
1359
|
+
var i = n && n.constructor, o = typeof i == "function" && i.prototype || Nt;
|
1381
1360
|
return n === o;
|
1382
1361
|
}
|
1383
1362
|
function yt(n) {
|
1384
1363
|
if (n != null) {
|
1385
1364
|
try {
|
1386
|
-
return
|
1365
|
+
return H.call(n);
|
1387
1366
|
} catch {
|
1388
1367
|
}
|
1389
1368
|
try {
|
@@ -1394,20 +1373,20 @@ Ir.exports;
|
|
1394
1373
|
return "";
|
1395
1374
|
}
|
1396
1375
|
function cr(n) {
|
1397
|
-
return
|
1376
|
+
return He(n, !0, !0);
|
1398
1377
|
}
|
1399
1378
|
function ur(n, i) {
|
1400
1379
|
return n === i || n !== n && i !== i;
|
1401
1380
|
}
|
1402
1381
|
function Ae(n) {
|
1403
|
-
return on(n) &&
|
1382
|
+
return on(n) && z.call(n, "callee") && (!se.call(n, "callee") || rt.call(n) == c);
|
1404
1383
|
}
|
1405
1384
|
var We = Array.isArray;
|
1406
|
-
function
|
1385
|
+
function xe(n) {
|
1407
1386
|
return n != null && dr(n.length) && !Ge(n);
|
1408
1387
|
}
|
1409
1388
|
function on(n) {
|
1410
|
-
return fr(n) &&
|
1389
|
+
return fr(n) && xe(n);
|
1411
1390
|
}
|
1412
1391
|
var lr = mt || un;
|
1413
1392
|
function Ge(n) {
|
@@ -1425,7 +1404,7 @@ Ir.exports;
|
|
1425
1404
|
return !!n && typeof n == "object";
|
1426
1405
|
}
|
1427
1406
|
function Ye(n) {
|
1428
|
-
return
|
1407
|
+
return xe(n) ? Me(n) : Kr(n);
|
1429
1408
|
}
|
1430
1409
|
function cn() {
|
1431
1410
|
return [];
|
@@ -1435,8 +1414,8 @@ Ir.exports;
|
|
1435
1414
|
}
|
1436
1415
|
t.exports = cr;
|
1437
1416
|
})(Ir, Ir.exports);
|
1438
|
-
var
|
1439
|
-
const K = /* @__PURE__ */ xn(
|
1417
|
+
var gi = Ir.exports;
|
1418
|
+
const K = /* @__PURE__ */ xn(gi), Oe = (t) => new Promise((e, r) => {
|
1440
1419
|
const s = new Image();
|
1441
1420
|
console.warn("update cdn config for cors?"), s.onload = () => {
|
1442
1421
|
const a = s.width, c = s.height;
|
@@ -1444,7 +1423,7 @@ const K = /* @__PURE__ */ xn(bi), Oe = (t) => new Promise((e, r) => {
|
|
1444
1423
|
}, s.onerror = (a) => {
|
1445
1424
|
r(a);
|
1446
1425
|
}, s.crossOrigin = "anonymous", s.src = t;
|
1447
|
-
}),
|
1426
|
+
}), ls = (t) => new Promise((e, r) => {
|
1448
1427
|
const s = new Audio();
|
1449
1428
|
s.preload = "auto", s.addEventListener("loadedmetadata", () => {
|
1450
1429
|
const a = s.duration * 1e3;
|
@@ -1452,19 +1431,19 @@ const K = /* @__PURE__ */ xn(bi), Oe = (t) => new Promise((e, r) => {
|
|
1452
1431
|
}), s.addEventListener("error", (a) => {
|
1453
1432
|
r(a);
|
1454
1433
|
}), s.src = t, s.crossOrigin = "anonymous", s.load();
|
1455
|
-
}),
|
1434
|
+
}), _n = (t) => new Promise((e, r) => {
|
1456
1435
|
const s = document.createElement("video");
|
1457
1436
|
s.preload = "auto", s.addEventListener("loadedmetadata", () => {
|
1458
|
-
const a = s.duration * 1e3, c = s.videoWidth,
|
1459
|
-
e({ duration: a, width: c, height:
|
1437
|
+
const a = s.duration * 1e3, c = s.videoWidth, d = s.videoHeight;
|
1438
|
+
e({ duration: a, width: c, height: d });
|
1460
1439
|
}), s.addEventListener("error", (a) => {
|
1461
1440
|
r(a);
|
1462
1441
|
}), s.src = t, s.load();
|
1463
|
-
}),
|
1442
|
+
}), Ii = async (t) => {
|
1464
1443
|
var a, c;
|
1465
1444
|
const e = t.duration, r = (a = t.details) == null ? void 0 : a.width, s = (c = t.details) == null ? void 0 : c.height;
|
1466
|
-
return e && r && s ? { duration: e, width: r, height: s } :
|
1467
|
-
},
|
1445
|
+
return e && r && s ? { duration: e, width: r, height: s } : _n(t.details.src);
|
1446
|
+
}, ds = (t, e) => {
|
1468
1447
|
const r = document.createElement("div");
|
1469
1448
|
Object.keys(e).forEach((a) => {
|
1470
1449
|
a !== "height" && (r.style[a] = e[a]);
|
@@ -1480,38 +1459,38 @@ const K = /* @__PURE__ */ xn(bi), Oe = (t) => new Promise((e, r) => {
|
|
1480
1459
|
});
|
1481
1460
|
}).catch((a) => s(a));
|
1482
1461
|
});
|
1483
|
-
},
|
1462
|
+
}, bi = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
1484
1463
|
let Xe = (t = 21) => {
|
1485
|
-
let e = "", r = crypto.getRandomValues(new Uint8Array(t));
|
1464
|
+
let e = "", r = crypto.getRandomValues(new Uint8Array(t |= 0));
|
1486
1465
|
for (; t--; )
|
1487
|
-
e +=
|
1466
|
+
e += bi[r[t] & 63];
|
1488
1467
|
return e;
|
1489
1468
|
};
|
1490
|
-
function
|
1469
|
+
function De(t = 16) {
|
1491
1470
|
const e = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", r = e.charAt(Math.floor(Math.random() * e.length));
|
1492
1471
|
let s = Xe(t - 1);
|
1493
1472
|
return s = s.replace(/[^a-zA-Z0-9]/g, "").slice(0, t - 1), r + s;
|
1494
1473
|
}
|
1495
|
-
function
|
1474
|
+
function vi(t) {
|
1496
1475
|
const e = /#([0-9a-fA-F]{3,6})\b/g, r = /rgb\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)/g, s = /rgba\(\s*(\d+),\s*(\d+),\s*(\d+),\s*([0-9.]+)\s*\)/g;
|
1497
|
-
function a(
|
1498
|
-
return
|
1476
|
+
function a(d) {
|
1477
|
+
return d.length === 3 ? `#${d[0]}${d[0]}${d[1]}${d[1]}${d[2]}${d[2]}`.toUpperCase() : `#${d.toUpperCase()}`;
|
1499
1478
|
}
|
1500
|
-
function c(
|
1501
|
-
return `#${(1 << 24 |
|
1479
|
+
function c(d, f, b) {
|
1480
|
+
return `#${(1 << 24 | d << 16 | f << 8 | b).toString(16).slice(1).toUpperCase()}`;
|
1502
1481
|
}
|
1503
|
-
return t = t.replace(e, (
|
1482
|
+
return t = t.replace(e, (d, f) => a(f)), t = t.replace(
|
1504
1483
|
r,
|
1505
|
-
(
|
1484
|
+
(d, f, b, _) => c(+f, +b, +_)
|
1506
1485
|
), t = t.replace(
|
1507
1486
|
s,
|
1508
|
-
(
|
1487
|
+
(d, f, b, _) => c(+f, +b, +_)
|
1509
1488
|
), t;
|
1510
1489
|
}
|
1511
1490
|
function it(t) {
|
1512
1491
|
return /^#[0-9a-fA-F]{3}$/.test(t) ? "#" + t[1] + t[1] + t[2] + t[2] + t[3] + t[3] : t;
|
1513
1492
|
}
|
1514
|
-
function
|
1493
|
+
function Wn(t, e) {
|
1515
1494
|
let r = t;
|
1516
1495
|
for (const s in e)
|
1517
1496
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
@@ -1520,7 +1499,7 @@ function Gn(t, e) {
|
|
1520
1499
|
}
|
1521
1500
|
return r;
|
1522
1501
|
}
|
1523
|
-
function
|
1502
|
+
function fs(t) {
|
1524
1503
|
const e = t.getAttribute("fill");
|
1525
1504
|
if (e && e.trim() !== "" && e.trim() !== "none")
|
1526
1505
|
return e.trim();
|
@@ -1534,21 +1513,21 @@ function ms(t) {
|
|
1534
1513
|
}
|
1535
1514
|
}
|
1536
1515
|
const s = t.parentElement;
|
1537
|
-
return s ?
|
1516
|
+
return s ? fs(s) : null;
|
1538
1517
|
}
|
1539
1518
|
function Be(t) {
|
1540
1519
|
return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(t);
|
1541
1520
|
}
|
1542
|
-
const
|
1521
|
+
const _i = (t) => {
|
1543
1522
|
const e = `.${t.split(".").filter((c) => c.includes("fill:")).join(".")}`, r = {}, s = /\.([\w-]+)\s*\{\s*([^}]+)\s*\}/g;
|
1544
1523
|
let a;
|
1545
1524
|
for (; (a = s.exec(e)) !== null; ) {
|
1546
|
-
const c = a[1],
|
1525
|
+
const c = a[1], d = a[2], f = {}, b = /fill\s*:\s*([^;]+);?/.exec(d), _ = /stroke\s*:\s*([^;]+);?/.exec(d);
|
1547
1526
|
b && (f.fill = it(b[1].trim())), _ && (f.stroke = it(_[1].trim())), r[c] = f;
|
1548
1527
|
}
|
1549
1528
|
return r;
|
1550
1529
|
};
|
1551
|
-
function
|
1530
|
+
function dn(t) {
|
1552
1531
|
let e = t.parentElement;
|
1553
1532
|
for (; e; ) {
|
1554
1533
|
if (e.tagName.toLowerCase() === "mask")
|
@@ -1557,23 +1536,23 @@ function fn(t) {
|
|
1557
1536
|
}
|
1558
1537
|
return !1;
|
1559
1538
|
}
|
1560
|
-
function
|
1561
|
-
const a = [],
|
1539
|
+
function ki(t, e, r = 300, s = 300) {
|
1540
|
+
const a = [], d = new DOMParser().parseFromString(t, "image/svg+xml"), f = d.documentElement;
|
1562
1541
|
f.setAttribute("width", `${r}`), f.setAttribute("height", `${s}`);
|
1563
1542
|
const b = f.querySelectorAll("style"), _ = {};
|
1564
1543
|
b.forEach((u) => {
|
1565
|
-
const
|
1544
|
+
const l = u.textContent || "", S = _i(l);
|
1566
1545
|
Object.assign(_, S);
|
1567
|
-
const w =
|
1546
|
+
const w = l.replace(/\.(st[\w-]+)/g, `.${e}-$1`).replace(/url\(#(.*?)\)/g, `url(#${e}-$1)`);
|
1568
1547
|
u.textContent = w;
|
1569
|
-
const k = Array.from(
|
1570
|
-
k.forEach((
|
1571
|
-
if (
|
1548
|
+
const k = Array.from(d.querySelectorAll("*")), h = /* @__PURE__ */ new Set();
|
1549
|
+
k.forEach((y) => {
|
1550
|
+
if (dn(y)) return;
|
1572
1551
|
["fill", "stroke", "stop-color"].forEach((x) => {
|
1573
|
-
const g =
|
1552
|
+
const g = y.getAttribute(x);
|
1574
1553
|
g && !["none", "transparent"].includes(g) && h.add(it(g));
|
1575
1554
|
});
|
1576
|
-
const v =
|
1555
|
+
const v = y.getAttribute("style");
|
1577
1556
|
if (v) {
|
1578
1557
|
const x = /fill\s*:\s*([^;]+);?/.exec(v), g = /stroke\s*:\s*([^;]+);?/.exec(v), O = /stop-color\s*:\s*([^;]+);?/.exec(v);
|
1579
1558
|
if (x) {
|
@@ -1589,21 +1568,21 @@ function wi(t, e, r = 300, s = 300) {
|
|
1589
1568
|
D && !["none", "transparent"].includes(D) && Be(it(D)) && h.add(it(D));
|
1590
1569
|
}
|
1591
1570
|
}
|
1592
|
-
const I =
|
1571
|
+
const I = y.getAttribute("class");
|
1593
1572
|
I && I.split(" ").forEach((x) => {
|
1594
1573
|
const g = _[x];
|
1595
1574
|
g != null && g.fill && !["none", "transparent"].includes(g.fill) && h.add(it(g.fill)), g != null && g.stroke && !["none", "transparent"].includes(g.stroke) && h.add(it(g.stroke));
|
1596
1575
|
});
|
1597
|
-
}), Array.from(h).forEach((
|
1598
|
-
Be(
|
1576
|
+
}), Array.from(h).forEach((y) => {
|
1577
|
+
Be(y) && a.push(y);
|
1599
1578
|
});
|
1600
1579
|
});
|
1601
|
-
const M = Array.from(
|
1580
|
+
const M = Array.from(d.querySelectorAll("*")), E = /* @__PURE__ */ new Set();
|
1602
1581
|
return M.forEach((u) => {
|
1603
|
-
if (
|
1604
|
-
const
|
1605
|
-
if (
|
1606
|
-
const w =
|
1582
|
+
if (dn(u)) return;
|
1583
|
+
const l = u.getAttribute("class");
|
1584
|
+
if (l) {
|
1585
|
+
const w = l.split(" ").map((k) => `${e}-${k}`).join(" ");
|
1607
1586
|
u.setAttribute("class", w), w.split(" ").forEach((k) => {
|
1608
1587
|
const h = _[k];
|
1609
1588
|
h != null && h.fill && !["none", "transparent"].includes(h.fill) && E.add(it(h.fill)), h != null && h.stroke && !["none", "transparent"].includes(h.stroke) && E.add(it(h.stroke));
|
@@ -1617,44 +1596,44 @@ function wi(t, e, r = 300, s = 300) {
|
|
1617
1596
|
if (S) {
|
1618
1597
|
const w = /fill\s*:\s*([^;]+);?/.exec(S), k = /stroke\s*:\s*([^;]+);?/.exec(S), h = /stop-color\s*:\s*([^;]+);?/.exec(S);
|
1619
1598
|
if (w) {
|
1620
|
-
const
|
1621
|
-
|
1599
|
+
const y = w[1].trim();
|
1600
|
+
y && !["none", "transparent"].includes(y) && E.add(it(y));
|
1622
1601
|
}
|
1623
1602
|
if (k) {
|
1624
|
-
const
|
1625
|
-
|
1603
|
+
const y = k[1].trim();
|
1604
|
+
y && !["none", "transparent"].includes(y) && E.add(it(y));
|
1626
1605
|
}
|
1627
1606
|
if (h) {
|
1628
|
-
const
|
1629
|
-
|
1607
|
+
const y = h[1].trim();
|
1608
|
+
y && !["none", "transparent"].includes(y) && E.add(it(y));
|
1630
1609
|
}
|
1631
1610
|
}
|
1632
1611
|
}), E.forEach(
|
1633
1612
|
(u) => !a.includes(u) && Be(u) && a.push(u)
|
1634
|
-
), Array.from(
|
1613
|
+
), Array.from(d.querySelectorAll("*")).forEach((u) => {
|
1635
1614
|
if (u.hasAttribute("id")) {
|
1636
|
-
const
|
1637
|
-
u.setAttribute("id", `${e}-${
|
1615
|
+
const l = u.getAttribute("id");
|
1616
|
+
u.setAttribute("id", `${e}-${l}`);
|
1638
1617
|
}
|
1639
1618
|
if (["fill", "stroke", "stop-color", "filter", "clip-path", "mask"].forEach(
|
1640
|
-
(
|
1641
|
-
const S = u.getAttribute(
|
1619
|
+
(l) => {
|
1620
|
+
const S = u.getAttribute(l);
|
1642
1621
|
S && S.includes("url(#") && u.setAttribute(
|
1643
|
-
|
1622
|
+
l,
|
1644
1623
|
S.replace(/url\(#(.*?)\)/g, `url(#${e}-$1)`)
|
1645
1624
|
);
|
1646
1625
|
}
|
1647
1626
|
), u.hasAttribute("style")) {
|
1648
|
-
const
|
1649
|
-
|
1627
|
+
const l = u.getAttribute("style");
|
1628
|
+
l.includes("url(#") && u.setAttribute(
|
1650
1629
|
"style",
|
1651
|
-
|
1630
|
+
l.replace(/url\(#(.*?)\)/g, `url(#${e}-$1)`)
|
1652
1631
|
);
|
1653
1632
|
}
|
1654
|
-
}), Array.from(
|
1655
|
-
if (
|
1656
|
-
!
|
1657
|
-
}), { serializer: new XMLSerializer().serializeToString(
|
1633
|
+
}), Array.from(d.querySelectorAll("path")).forEach((u) => {
|
1634
|
+
if (dn(u)) return;
|
1635
|
+
!fs(u) && !u.getAttribute("class") && (u.setAttribute("fill", "#000000"), a.includes("#000000") || a.push("#000000"));
|
1636
|
+
}), { serializer: new XMLSerializer().serializeToString(d), colors: a };
|
1658
1637
|
}
|
1659
1638
|
const wr = {
|
1660
1639
|
color: "#000000",
|
@@ -1689,7 +1668,7 @@ const wr = {
|
|
1689
1668
|
), s;
|
1690
1669
|
}
|
1691
1670
|
return t;
|
1692
|
-
},
|
1671
|
+
}, ps = (t, e) => t ? t.from && !t.to ? {
|
1693
1672
|
from: t.from,
|
1694
1673
|
to: e.duration
|
1695
1674
|
} : t : {
|
@@ -1709,17 +1688,17 @@ function te(t, e) {
|
|
1709
1688
|
t.size.width / e.width,
|
1710
1689
|
t.size.height / e.height
|
1711
1690
|
);
|
1712
|
-
const
|
1691
|
+
const d = s.x - a.x;
|
1713
1692
|
return {
|
1714
1693
|
top: `${s.y - a.y}px`,
|
1715
|
-
left: `${
|
1694
|
+
left: `${d}px`,
|
1716
1695
|
transform: `scale(${c})`
|
1717
1696
|
};
|
1718
1697
|
}
|
1719
|
-
const
|
1720
|
-
const r = t.details.src, s = await
|
1698
|
+
const hs = async (t, e) => {
|
1699
|
+
const r = t.details.src, s = await Ii(t), a = te(e, {
|
1721
1700
|
...s
|
1722
|
-
}), c =
|
1701
|
+
}), c = ps(t.trim, { duration: s.duration }), d = {
|
1723
1702
|
width: s.width,
|
1724
1703
|
height: s.height,
|
1725
1704
|
opacity: 100,
|
@@ -1751,13 +1730,13 @@ const gs = async (t, e) => {
|
|
1751
1730
|
trim: c,
|
1752
1731
|
type: "video",
|
1753
1732
|
name: "video",
|
1754
|
-
details:
|
1733
|
+
details: d,
|
1755
1734
|
playbackRate: t.playbackRate || 1,
|
1756
1735
|
display: ve(t.display, { duration: s.duration, trim: c }),
|
1757
1736
|
duration: s.duration
|
1758
1737
|
};
|
1759
|
-
},
|
1760
|
-
const e = t.id, r = t.details, a = (await
|
1738
|
+
}, ms = async (t) => {
|
1739
|
+
const e = t.id, r = t.details, a = (await ls(r.src)).duration, c = ps(t.trim, { duration: a });
|
1761
1740
|
return {
|
1762
1741
|
id: e,
|
1763
1742
|
name: t.name || "audio",
|
@@ -1773,7 +1752,7 @@ const gs = async (t, e) => {
|
|
1773
1752
|
metadata: { ...t.metadata },
|
1774
1753
|
duration: a
|
1775
1754
|
};
|
1776
|
-
},
|
1755
|
+
}, ys = async (t, e) => {
|
1777
1756
|
var E;
|
1778
1757
|
const r = t.trackItemIds, s = t.size || {
|
1779
1758
|
width: t.details.width,
|
@@ -1781,10 +1760,10 @@ const gs = async (t, e) => {
|
|
1781
1760
|
}, a = Math.min(
|
1782
1761
|
e.size.width / s.width,
|
1783
1762
|
e.size.height / s.height
|
1784
|
-
), c = ((E = t.details) == null ? void 0 : E.rotate) || 0,
|
1763
|
+
), c = ((E = t.details) == null ? void 0 : E.rotate) || 0, d = te(e, s), f = t.display;
|
1785
1764
|
let b = 1 / 0, _ = 0;
|
1786
|
-
r.forEach((
|
1787
|
-
const T = t.trackItemsMap[
|
1765
|
+
r.forEach((m) => {
|
1766
|
+
const T = t.trackItemsMap[m];
|
1788
1767
|
T.display.from < b && (b = T.display.from), T.display.to > _ && (_ = T.display.to);
|
1789
1768
|
});
|
1790
1769
|
const M = t.trim || t.display || { from: b, to: _ };
|
@@ -1793,8 +1772,8 @@ const gs = async (t, e) => {
|
|
1793
1772
|
type: "template",
|
1794
1773
|
details: {
|
1795
1774
|
...s,
|
1796
|
-
top: t.details.top ||
|
1797
|
-
left: t.details.left ||
|
1775
|
+
top: t.details.top || d.top,
|
1776
|
+
left: t.details.left || d.left,
|
1798
1777
|
scale: a,
|
1799
1778
|
rotate: c
|
1800
1779
|
},
|
@@ -1802,7 +1781,7 @@ const gs = async (t, e) => {
|
|
1802
1781
|
display: f || { from: b, to: _ },
|
1803
1782
|
activeEdit: !1
|
1804
1783
|
};
|
1805
|
-
},
|
1784
|
+
}, Si = async (t, e) => {
|
1806
1785
|
var M;
|
1807
1786
|
const r = t.trackItemIds, s = t.size || {
|
1808
1787
|
width: t.details.width,
|
@@ -1810,33 +1789,33 @@ const gs = async (t, e) => {
|
|
1810
1789
|
}, a = Math.min(
|
1811
1790
|
e.size.width / s.width,
|
1812
1791
|
e.size.height / s.height
|
1813
|
-
), c = ((M = t.details) == null ? void 0 : M.rotate) || 0,
|
1792
|
+
), c = ((M = t.details) == null ? void 0 : M.rotate) || 0, d = te(e, s), f = t.display;
|
1814
1793
|
let b = 1 / 0, _ = 0;
|
1815
1794
|
return r.forEach((E) => {
|
1816
|
-
const
|
1817
|
-
|
1795
|
+
const m = t.trackItemsMap[E];
|
1796
|
+
m.display.from < b && (b = m.display.from), m.display.to > _ && (_ = m.display.to);
|
1818
1797
|
}), {
|
1819
1798
|
id: t.id,
|
1820
1799
|
type: "composition",
|
1821
1800
|
details: {
|
1822
1801
|
...s,
|
1823
|
-
top: t.details.top ||
|
1824
|
-
left: t.details.left ||
|
1802
|
+
top: t.details.top || d.top,
|
1803
|
+
left: t.details.left || d.left,
|
1825
1804
|
scale: a,
|
1826
1805
|
rotate: c
|
1827
1806
|
},
|
1828
1807
|
display: f || { from: b, to: _ }
|
1829
1808
|
};
|
1830
|
-
},
|
1831
|
-
const r = t.details, s = Oe(r.src), a = fetch(r.src), [c,
|
1809
|
+
}, Gn = async (t, e) => {
|
1810
|
+
const r = t.details, s = Oe(r.src), a = fetch(r.src), [c, d] = await Promise.all([
|
1832
1811
|
s,
|
1833
1812
|
a
|
1834
|
-
]), f = await
|
1835
|
-
|
1813
|
+
]), f = await d.text(), b = te(e, c), { serializer: _, colors: M } = ki(
|
1814
|
+
vi(f),
|
1836
1815
|
t.id,
|
1837
1816
|
parseFloat(r.width || c.width),
|
1838
1817
|
parseFloat(r.height || c.height)
|
1839
|
-
), E = t.details.colorMap || Object.fromEntries(M.map((
|
1818
|
+
), E = t.details.colorMap || Object.fromEntries(M.map((m) => [m, m]));
|
1840
1819
|
return {
|
1841
1820
|
id: t.id,
|
1842
1821
|
name: "illustration",
|
@@ -1876,7 +1855,7 @@ const gs = async (t, e) => {
|
|
1876
1855
|
},
|
1877
1856
|
metadata: t.metadata || {}
|
1878
1857
|
};
|
1879
|
-
},
|
1858
|
+
}, wi = async (t, e) => {
|
1880
1859
|
const r = t.details, s = Oe(r.src), [a] = await Promise.all([s]), c = te(e, a);
|
1881
1860
|
return {
|
1882
1861
|
id: t.id,
|
@@ -1915,7 +1894,7 @@ const gs = async (t, e) => {
|
|
1915
1894
|
},
|
1916
1895
|
metadata: t.metadata || {}
|
1917
1896
|
};
|
1918
|
-
},
|
1897
|
+
}, gs = async (t, e) => {
|
1919
1898
|
const r = t.details, s = await Oe(r.src), a = te(e, s);
|
1920
1899
|
return {
|
1921
1900
|
id: t.id,
|
@@ -1957,7 +1936,7 @@ const gs = async (t, e) => {
|
|
1957
1936
|
},
|
1958
1937
|
metadata: t.metadata || {}
|
1959
1938
|
};
|
1960
|
-
},
|
1939
|
+
}, Is = async (t, e) => {
|
1961
1940
|
const r = t;
|
1962
1941
|
r.details.fontUrl && await br([
|
1963
1942
|
{
|
@@ -1965,9 +1944,9 @@ const gs = async (t, e) => {
|
|
1965
1944
|
url: r.details.fontUrl
|
1966
1945
|
}
|
1967
1946
|
]);
|
1968
|
-
const s = r.id, a = r.details, c =
|
1947
|
+
const s = r.id, a = r.details, c = vs(a), d = ds(r.details.text, c), f = te(e, {
|
1969
1948
|
width: c.width,
|
1970
|
-
height:
|
1949
|
+
height: d
|
1971
1950
|
});
|
1972
1951
|
return {
|
1973
1952
|
id: s,
|
@@ -1978,7 +1957,7 @@ const gs = async (t, e) => {
|
|
1978
1957
|
...c,
|
1979
1958
|
text: a.text || "",
|
1980
1959
|
// Default text content
|
1981
|
-
height:
|
1960
|
+
height: d,
|
1982
1961
|
// Default height
|
1983
1962
|
fontUrl: a.fontUrl,
|
1984
1963
|
top: c.top || f.top,
|
@@ -1993,14 +1972,14 @@ const gs = async (t, e) => {
|
|
1993
1972
|
},
|
1994
1973
|
metadata: t.metadata || {}
|
1995
1974
|
};
|
1996
|
-
},
|
1975
|
+
}, bs = async (t, e) => {
|
1997
1976
|
t.details.fontUrl && await br([
|
1998
1977
|
{
|
1999
1978
|
fontFamily: t.details.fontFamily,
|
2000
1979
|
url: t.details.fontUrl
|
2001
1980
|
}
|
2002
1981
|
]);
|
2003
|
-
const r = t.id, s = t.details, a =
|
1982
|
+
const r = t.id, s = t.details, a = vs(s), c = ds(t.details.text, a), d = te(e, {
|
2004
1983
|
width: a.width,
|
2005
1984
|
height: c
|
2006
1985
|
});
|
@@ -2016,15 +1995,15 @@ const gs = async (t, e) => {
|
|
2016
1995
|
height: c,
|
2017
1996
|
// Default height
|
2018
1997
|
fontUrl: s.fontUrl,
|
2019
|
-
top: a.top ||
|
2020
|
-
left: a.left ||
|
1998
|
+
top: a.top || d.top,
|
1999
|
+
left: a.left || d.left,
|
2021
2000
|
borderWidth: s.borderWidth || 0,
|
2022
2001
|
borderColor: s.borderColor || "#000000",
|
2023
2002
|
boxShadow: s.boxShadow || wr
|
2024
2003
|
},
|
2025
2004
|
metadata: {}
|
2026
2005
|
};
|
2027
|
-
},
|
2006
|
+
}, vs = (t) => ({
|
2028
2007
|
fontFamily: t.fontFamily || "Arial",
|
2029
2008
|
// Default font family
|
2030
2009
|
fontSize: t.fontSize || "16px",
|
@@ -2068,33 +2047,33 @@ const gs = async (t, e) => {
|
|
2068
2047
|
transform: t.transform || "none",
|
2069
2048
|
skewX: t.skewX || 0,
|
2070
2049
|
skewY: t.skewY || 0
|
2071
|
-
}),
|
2050
|
+
}), Mi = async (t, e) => {
|
2072
2051
|
switch (t.type) {
|
2073
2052
|
case "video":
|
2074
|
-
return
|
2053
|
+
return hs(t, e || {});
|
2075
2054
|
case "audio":
|
2076
|
-
return
|
2055
|
+
return ms(t);
|
2077
2056
|
case "image":
|
2078
|
-
return
|
2057
|
+
return gs(t, e || {});
|
2079
2058
|
case "text":
|
2080
|
-
return
|
2059
|
+
return bs(t, e || {});
|
2081
2060
|
case "caption":
|
2082
|
-
return
|
2061
|
+
return Is(t, e || {});
|
2083
2062
|
case "template":
|
2084
|
-
return
|
2063
|
+
return ys(t, {
|
2085
2064
|
size: e == null ? void 0 : e.size
|
2086
2065
|
});
|
2087
2066
|
default:
|
2088
2067
|
throw new Error("Unsupported track item");
|
2089
2068
|
}
|
2090
2069
|
};
|
2091
|
-
function
|
2070
|
+
function Ei(t, e) {
|
2092
2071
|
return e.some(
|
2093
2072
|
(r) => t.some((s) => s.id === r.id)
|
2094
2073
|
);
|
2095
2074
|
}
|
2096
|
-
const
|
2097
|
-
id:
|
2075
|
+
const Ti = (t = [], e = []) => t.length === 0 ? e.map((s) => ({
|
2076
|
+
id: De(),
|
2098
2077
|
items: [s.id],
|
2099
2078
|
type: s.type,
|
2100
2079
|
accepts: ["text", "image", "video", "audio", "caption", "template"]
|
@@ -2105,9 +2084,9 @@ const Di = (t = [], e = []) => t.length === 0 ? e.map((s) => ({
|
|
2105
2084
|
type: r.type || "text",
|
2106
2085
|
magnetic: r.magnetic || !1,
|
2107
2086
|
static: r.static || !1,
|
2108
|
-
id: r.id ||
|
2087
|
+
id: r.id || De()
|
2109
2088
|
}));
|
2110
|
-
function
|
2089
|
+
function Ai(t, e) {
|
2111
2090
|
return t.filter((s) => {
|
2112
2091
|
if (e.forEach((a) => {
|
2113
2092
|
s.items.includes(a) && (s.items = s.items.filter((c) => c !== a));
|
@@ -2119,24 +2098,24 @@ const he = (t) => Object.keys(t).reduce((e, r) => {
|
|
2119
2098
|
const { display: s, playbackRate: a } = t[r];
|
2120
2099
|
return Math.max(e, s.to / (a || 1));
|
2121
2100
|
}, 0);
|
2122
|
-
function
|
2101
|
+
function kn(t, e, r) {
|
2123
2102
|
return Math.min(Math.max(t, e), r);
|
2124
2103
|
}
|
2125
|
-
const
|
2104
|
+
const xi = (t, e, r, s, a) => {
|
2126
2105
|
if (s === void 0 && a === void 0)
|
2127
2106
|
return { trackId: void 0, trackIndex: void 0 };
|
2128
|
-
const c = a !== void 0 ? e[
|
2107
|
+
const c = a !== void 0 ? e[kn(a, 0, e.length)] : e.find((b) => b.id === s);
|
2129
2108
|
if (!c)
|
2130
2109
|
return {
|
2131
2110
|
trackId: void 0,
|
2132
|
-
trackIndex: a !== void 0 ?
|
2111
|
+
trackIndex: a !== void 0 ? kn(a, 0, e.length) : void 0
|
2133
2112
|
};
|
2134
|
-
const
|
2135
|
-
for (const b of
|
2113
|
+
const d = c.items.map((b) => r[b]), f = t.map((b) => r[b]);
|
2114
|
+
for (const b of d) {
|
2136
2115
|
const _ = b.display.from, M = b.display.to;
|
2137
2116
|
for (const E of f) {
|
2138
|
-
const
|
2139
|
-
if (!(E.display.to <= _ ||
|
2117
|
+
const m = E.display.from;
|
2118
|
+
if (!(E.display.to <= _ || m >= M))
|
2140
2119
|
return {
|
2141
2120
|
trackId: void 0,
|
2142
2121
|
trackIndex: e.indexOf(c)
|
@@ -2147,12 +2126,12 @@ const Oi = (t, e, r, s, a) => {
|
|
2147
2126
|
trackId: c.id,
|
2148
2127
|
trackIndex: e.indexOf(c)
|
2149
2128
|
};
|
2150
|
-
},
|
2129
|
+
}, Yn = (t, e) => {
|
2151
2130
|
var f, b;
|
2152
2131
|
const r = ((f = t.details.crop) == null ? void 0 : f.width) || t.details.width || 0, s = ((b = t.details.crop) == null ? void 0 : b.height) || t.details.height || 0;
|
2153
2132
|
let a = e.width, c = e.height;
|
2154
|
-
const
|
2155
|
-
return r / s >
|
2133
|
+
const d = e.width / e.height;
|
2134
|
+
return r / s > d ? (a = r, c = r / d) : (c = s, a = s * d), {
|
2156
2135
|
newWidth: a,
|
2157
2136
|
newHeight: c,
|
2158
2137
|
crop: {
|
@@ -2162,27 +2141,27 @@ const Oi = (t, e, r, s, a) => {
|
|
2162
2141
|
width: r
|
2163
2142
|
}
|
2164
2143
|
};
|
2165
|
-
},
|
2144
|
+
}, Bn = (t, e) => {
|
2166
2145
|
const r = K(t.trim), s = K(t.display);
|
2167
2146
|
return e.duration < t.display.to && (s.to = e.duration, r && (r.to = e.duration)), {
|
2168
2147
|
duration: e.duration,
|
2169
2148
|
trim: r,
|
2170
2149
|
display: s
|
2171
2150
|
};
|
2172
|
-
},
|
2151
|
+
}, Di = (t) => {
|
2173
2152
|
const { trackItemIds: e, transitionsMap: r, trackItemsMap: s } = t, a = /* @__PURE__ */ new Map();
|
2174
2153
|
Object.values(r).forEach((_) => {
|
2175
2154
|
var T, C;
|
2176
|
-
const { fromId: M, toId: E, kind:
|
2177
|
-
|
2155
|
+
const { fromId: M, toId: E, kind: m } = _;
|
2156
|
+
m !== "none" && (a.has(M) || a.set(M, []), a.has(E) || a.set(E, []), (T = a.get(M)) == null || T.push(_), (C = a.get(E)) == null || C.push(_));
|
2178
2157
|
});
|
2179
|
-
const c = [],
|
2158
|
+
const c = [], d = /* @__PURE__ */ new Set(), f = (_) => {
|
2180
2159
|
const M = [];
|
2181
2160
|
let E = _;
|
2182
|
-
for (; E && !
|
2183
|
-
|
2184
|
-
const
|
2185
|
-
M.push(
|
2161
|
+
for (; E && !d.has(E); ) {
|
2162
|
+
d.add(E);
|
2163
|
+
const m = s[E];
|
2164
|
+
M.push(m);
|
2186
2165
|
const T = Object.values(r).find(
|
2187
2166
|
(C) => C.fromId === E && C.kind !== "none"
|
2188
2167
|
// Filter here
|
@@ -2195,7 +2174,7 @@ const Oi = (t, e, r, s, a) => {
|
|
2195
2174
|
(_) => _.kind !== "none"
|
2196
2175
|
);
|
2197
2176
|
for (const _ of e)
|
2198
|
-
if (!
|
2177
|
+
if (!d.has(_) && (!a.has(_) || !b.some((M) => M.toId === _))) {
|
2199
2178
|
const M = f(_);
|
2200
2179
|
M.length > 0 && c.push(M);
|
2201
2180
|
}
|
@@ -2203,22 +2182,22 @@ const Oi = (t, e, r, s, a) => {
|
|
2203
2182
|
_.sort((M, E) => "display" in M && "display" in E ? M.display.from - E.display.from : 0);
|
2204
2183
|
}), c.filter((_) => _.filter((E) => E !== void 0).length > 0);
|
2205
2184
|
};
|
2206
|
-
function
|
2185
|
+
function Xn(t, e, r) {
|
2207
2186
|
t.forEach((s) => {
|
2208
|
-
const
|
2187
|
+
const d = Object.values(e).filter(
|
2209
2188
|
(_) => s.items.includes(_.id)
|
2210
2189
|
).sort(
|
2211
2190
|
(_, M) => _.display.from - M.display.from
|
2212
|
-
).map((_) => _.id), f =
|
2213
|
-
trackItemIds:
|
2191
|
+
).map((_) => _.id), f = Di({
|
2192
|
+
trackItemIds: d,
|
2214
2193
|
transitionsMap: r,
|
2215
2194
|
trackItemsMap: e
|
2216
2195
|
});
|
2217
2196
|
let b = 0;
|
2218
|
-
|
2197
|
+
d.forEach((_) => {
|
2219
2198
|
const M = [];
|
2220
|
-
for (const
|
2221
|
-
if (
|
2199
|
+
for (const m of f)
|
2200
|
+
if (m.find((T) => T.id === _)) {
|
2222
2201
|
const T = f.findIndex(
|
2223
2202
|
(C) => C.find((u) => u.id === _)
|
2224
2203
|
);
|
@@ -2229,21 +2208,21 @@ function Kn(t, e, r) {
|
|
2229
2208
|
}
|
2230
2209
|
}
|
2231
2210
|
let E = 0;
|
2232
|
-
if (M.forEach((
|
2233
|
-
|
2211
|
+
if (M.forEach((m) => {
|
2212
|
+
m.forEach((T) => {
|
2234
2213
|
T.type === "transition" && (E += T.duration);
|
2235
2214
|
});
|
2236
2215
|
}), e[_]) {
|
2237
|
-
const
|
2216
|
+
const m = e[_].display.to - e[_].display.from;
|
2238
2217
|
e[_].display = {
|
2239
2218
|
from: b - E,
|
2240
|
-
to: b +
|
2241
|
-
}, b +=
|
2219
|
+
to: b + m - E
|
2220
|
+
}, b += m;
|
2242
2221
|
}
|
2243
2222
|
});
|
2244
2223
|
});
|
2245
2224
|
}
|
2246
|
-
function
|
2225
|
+
function Oi(t, e) {
|
2247
2226
|
let s = e.reduce(
|
2248
2227
|
(a, c) => c.display.to > a.display.to ? c : a,
|
2249
2228
|
{ display: { to: 0 } }
|
@@ -2253,15 +2232,15 @@ function Pi(t, e) {
|
|
2253
2232
|
a.display.from = s, a.display.to = a.display.from + f, s = a.display.to;
|
2254
2233
|
});
|
2255
2234
|
}
|
2256
|
-
function
|
2257
|
-
const e = t, r = e.tracks, s = e.trackItemsMap, a = [], c = {},
|
2235
|
+
function Ci(t) {
|
2236
|
+
const e = t, r = e.tracks, s = e.trackItemsMap, a = [], c = {}, d = e.structure;
|
2258
2237
|
return r.forEach((f) => {
|
2259
2238
|
var _;
|
2260
2239
|
const b = f.items.map((M) => s[M]).sort((M, E) => M.display.from - E.display.from);
|
2261
2240
|
for (let M = 0; M < b.length - 1; M++) {
|
2262
|
-
const E = b[M],
|
2263
|
-
if (Math.abs(E.display.to -
|
2264
|
-
const T = `${E.id}-${
|
2241
|
+
const E = b[M], m = b[M + 1];
|
2242
|
+
if (Math.abs(E.display.to - m.display.from) <= 1) {
|
2243
|
+
const T = `${E.id}-${m.id}`;
|
2265
2244
|
if ((_ = e.transitionIds) == null ? void 0 : _.includes(T))
|
2266
2245
|
c[T] = e.transitionsMap[T];
|
2267
2246
|
else {
|
@@ -2269,7 +2248,7 @@ function Ri(t) {
|
|
2269
2248
|
id: T,
|
2270
2249
|
duration: 1500,
|
2271
2250
|
fromId: E.id,
|
2272
|
-
toId:
|
2251
|
+
toId: m.id,
|
2273
2252
|
kind: "none",
|
2274
2253
|
trackId: f.id,
|
2275
2254
|
type: "transition"
|
@@ -2279,7 +2258,7 @@ function Ri(t) {
|
|
2279
2258
|
a.push(T);
|
2280
2259
|
}
|
2281
2260
|
}
|
2282
|
-
}),
|
2261
|
+
}), d.forEach((f) => {
|
2283
2262
|
f.transitions.forEach((b) => {
|
2284
2263
|
c[b] = {
|
2285
2264
|
...e.transitionsMap[b],
|
@@ -2291,16 +2270,16 @@ function Ri(t) {
|
|
2291
2270
|
transitionsMap: c
|
2292
2271
|
};
|
2293
2272
|
}
|
2294
|
-
function
|
2295
|
-
const s = t.toId, a = r[s], c = e.find((
|
2296
|
-
c && (c.magnetic || c.items.forEach((
|
2297
|
-
const f = r[
|
2273
|
+
function Pi(t, e, r) {
|
2274
|
+
const s = t.toId, a = r[s], c = e.find((d) => d.items.includes(s));
|
2275
|
+
c && (c.magnetic || c.items.forEach((d) => {
|
2276
|
+
const f = r[d];
|
2298
2277
|
f.display.from > a.display.from && (f.display.from = f.display.from + t.duration, f.display.to = f.display.to + t.duration);
|
2299
2278
|
}));
|
2300
2279
|
}
|
2301
|
-
function
|
2280
|
+
function Ri(t) {
|
2302
2281
|
const e = de.pipe(
|
2303
|
-
fe(({ key: u }) => u.startsWith(
|
2282
|
+
fe(({ key: u }) => u.startsWith(Dn))
|
2304
2283
|
), r = de.pipe(
|
2305
2284
|
fe(({ key: u }) => u.startsWith(gt))
|
2306
2285
|
), s = de.pipe(
|
@@ -2309,14 +2288,14 @@ function zi(t) {
|
|
2309
2288
|
fe(({ key: u }) => u.startsWith(Sr))
|
2310
2289
|
), c = de.pipe(
|
2311
2290
|
fe(({ key: u }) => u.startsWith(Ce))
|
2312
|
-
),
|
2291
|
+
), d = de.pipe(
|
2313
2292
|
fe(({ key: u }) => u.startsWith(be))
|
2314
2293
|
), f = de.pipe(
|
2315
|
-
fe(({ key: u }) => u.startsWith(
|
2294
|
+
fe(({ key: u }) => u.startsWith(us))
|
2316
2295
|
), b = e.subscribe(async (u) => {
|
2317
|
-
var
|
2318
|
-
if (u.key ===
|
2319
|
-
const w = (
|
2296
|
+
var l, S;
|
2297
|
+
if (u.key === Xs) {
|
2298
|
+
const w = (l = u.value) == null ? void 0 : l.payload, k = w.trackItemsMap, h = w.trackItemDetailsMap;
|
2320
2299
|
console.warn("IMPROVE FONTS LOADING");
|
2321
2300
|
for (const v in h)
|
2322
2301
|
if (h[v].type === "text" || h[v].type === "caption") {
|
@@ -2328,19 +2307,22 @@ function zi(t) {
|
|
2328
2307
|
}
|
2329
2308
|
]);
|
2330
2309
|
} else if (h[v].type === "illustration") {
|
2331
|
-
const I = k[v], x = h[v].details, g = await
|
2332
|
-
|
2333
|
-
|
2310
|
+
const I = k[v], x = h[v].details, g = await Gn(
|
2311
|
+
{ ...I, details: x },
|
2312
|
+
{
|
2313
|
+
size: { width: x.width, height: x.height }
|
2314
|
+
}
|
2315
|
+
), O = Wn(
|
2334
2316
|
g.details.svgString,
|
2335
2317
|
x.colorMap
|
2336
2318
|
);
|
2337
2319
|
g.details.svgString = O, h[v].details = g.details, k[v] = g;
|
2338
2320
|
}
|
2339
|
-
const
|
2321
|
+
const y = he(k);
|
2340
2322
|
t.updateState(
|
2341
2323
|
{
|
2342
2324
|
...w,
|
2343
|
-
duration:
|
2325
|
+
duration: y
|
2344
2326
|
},
|
2345
2327
|
{
|
2346
2328
|
kind: "design:load",
|
@@ -2348,7 +2330,7 @@ function zi(t) {
|
|
2348
2330
|
}
|
2349
2331
|
);
|
2350
2332
|
}
|
2351
|
-
if (u.key ===
|
2333
|
+
if (u.key === Ks) {
|
2352
2334
|
const w = (S = u.value) == null ? void 0 : S.payload;
|
2353
2335
|
t.updateState(
|
2354
2336
|
{
|
@@ -2361,12 +2343,12 @@ function zi(t) {
|
|
2361
2343
|
);
|
2362
2344
|
}
|
2363
2345
|
}), _ = a.subscribe((u) => {
|
2364
|
-
if (u.key ===
|
2365
|
-
if (u.key ===
|
2346
|
+
if (u.key === hi) return t.undo();
|
2347
|
+
if (u.key === mi) return t.redo();
|
2366
2348
|
}), M = f.subscribe((u) => {
|
2367
|
-
var
|
2368
|
-
if (u.key ===
|
2369
|
-
const S = (
|
2349
|
+
var l;
|
2350
|
+
if (u.key === yi) {
|
2351
|
+
const S = (l = u.value) == null ? void 0 : l.payload.scale;
|
2370
2352
|
t.updateState(
|
2371
2353
|
{
|
2372
2354
|
scale: S
|
@@ -2378,15 +2360,15 @@ function zi(t) {
|
|
2378
2360
|
);
|
2379
2361
|
}
|
2380
2362
|
}), E = s.subscribe(async (u) => {
|
2381
|
-
var S, w, k, h,
|
2382
|
-
const
|
2383
|
-
if ((S = u.value) != null && S.payload.trackItemIds && (
|
2384
|
-
{ activeIds:
|
2363
|
+
var S, w, k, h, y;
|
2364
|
+
const l = [];
|
2365
|
+
if ((S = u.value) != null && S.payload.trackItemIds && (l.push((w = u.value) == null ? void 0 : w.payload.trackItemIds), t.updateState(
|
2366
|
+
{ activeIds: l },
|
2385
2367
|
{
|
2386
2368
|
kind: "update",
|
2387
2369
|
updateHistory: !1
|
2388
2370
|
}
|
2389
|
-
)), u.key ===
|
2371
|
+
)), u.key === fi) {
|
2390
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(
|
2391
2373
|
(A) => {
|
2392
2374
|
const et = I.transitionsMap[A];
|
@@ -2394,7 +2376,7 @@ function zi(t) {
|
|
2394
2376
|
}
|
2395
2377
|
);
|
2396
2378
|
g.push(...O);
|
2397
|
-
const D = {},
|
2379
|
+
const D = {}, j = I.trackItemIds, L = I.transitionIds, R = I.trackItemDetailsMap, F = K(I.tracks), V = K(I.structure);
|
2398
2380
|
g.forEach((A) => {
|
2399
2381
|
var Mt;
|
2400
2382
|
const et = I.trackItemsMap[A] || I.transitionsMap[A];
|
@@ -2413,13 +2395,13 @@ function zi(t) {
|
|
2413
2395
|
et.items.includes(A) && (et.items = et.items.filter((Mt) => Mt !== A));
|
2414
2396
|
});
|
2415
2397
|
});
|
2416
|
-
const kt =
|
2398
|
+
const kt = j.filter(
|
2417
2399
|
(A) => !g.includes(A)
|
2418
2400
|
);
|
2419
2401
|
L.forEach((A) => {
|
2420
2402
|
x.includes(A) && x.length === 1 && (D[A] = K(I.transitionsMap[A]));
|
2421
2403
|
});
|
2422
|
-
const
|
2404
|
+
const Dt = L.filter(
|
2423
2405
|
(A) => !g.includes(A) && !x.includes(A)
|
2424
2406
|
), Ot = Object.fromEntries(
|
2425
2407
|
Object.entries(R).filter(
|
@@ -2433,24 +2415,24 @@ function zi(t) {
|
|
2433
2415
|
Object.keys(U).forEach((A) => {
|
2434
2416
|
x.includes(A) && (U[A].kind = "none");
|
2435
2417
|
});
|
2436
|
-
const
|
2418
|
+
const zt = Ai(
|
2437
2419
|
I.tracks,
|
2438
2420
|
g
|
2439
2421
|
), wt = Object.fromEntries(
|
2440
2422
|
Object.entries(I.trackItemsMap).filter(
|
2441
2423
|
([A]) => !g.includes(A)
|
2442
2424
|
)
|
2443
|
-
), at =
|
2444
|
-
|
2425
|
+
), at = F.filter((A) => A.magnetic);
|
2426
|
+
Xn(
|
2445
2427
|
at,
|
2446
2428
|
wt,
|
2447
2429
|
I.transitionsMap
|
2448
2430
|
);
|
2449
|
-
const
|
2431
|
+
const Ft = he(wt);
|
2450
2432
|
Object.keys(D).forEach((A) => {
|
2451
|
-
|
2433
|
+
Pi(
|
2452
2434
|
D[A],
|
2453
|
-
|
2435
|
+
zt,
|
2454
2436
|
wt
|
2455
2437
|
);
|
2456
2438
|
}), t.updateState(
|
@@ -2459,32 +2441,32 @@ function zi(t) {
|
|
2459
2441
|
trackItemDetailsMap: Ot,
|
2460
2442
|
activeIds: [],
|
2461
2443
|
trackItemsMap: wt,
|
2462
|
-
tracks:
|
2463
|
-
duration:
|
2444
|
+
tracks: zt,
|
2445
|
+
duration: Ft,
|
2464
2446
|
structure: V,
|
2465
|
-
transitionIds:
|
2447
|
+
transitionIds: Dt,
|
2466
2448
|
transitionsMap: U
|
2467
2449
|
},
|
2468
2450
|
{ updateHistory: !0, kind: "remove" }
|
2469
2451
|
);
|
2470
2452
|
}
|
2471
|
-
if (u.key ===
|
2453
|
+
if (u.key === di) {
|
2472
2454
|
const v = K(t.getState()), I = {}, x = ((h = u.value) == null ? void 0 : h.payload.trackItemIds) || v.activeIds;
|
2473
2455
|
if (x.length === 0) return;
|
2474
2456
|
x.forEach((O) => {
|
2475
|
-
const D = v.trackItemsMap[O],
|
2457
|
+
const D = v.trackItemsMap[O], j = v.trackItemDetailsMap[O], L = De();
|
2476
2458
|
v.trackItemsMap[L] = {
|
2477
2459
|
...K(D),
|
2478
2460
|
id: L
|
2479
2461
|
}, v.trackItemDetailsMap[L] = {
|
2480
|
-
...K(
|
2462
|
+
...K(j)
|
2481
2463
|
}, v.trackItemIds.push(L);
|
2482
2464
|
const R = v.tracks.find(
|
2483
|
-
(
|
2465
|
+
(F) => F.items.includes(O)
|
2484
2466
|
);
|
2485
2467
|
I[R.id] ? I[R.id].items.push(L) : I[R.id] = {
|
2486
2468
|
...R,
|
2487
|
-
id:
|
2469
|
+
id: De(),
|
2488
2470
|
items: [L],
|
2489
2471
|
static: !1,
|
2490
2472
|
magnetic: !1
|
@@ -2504,26 +2486,26 @@ function zi(t) {
|
|
2504
2486
|
}
|
2505
2487
|
);
|
2506
2488
|
}
|
2507
|
-
if (u.key ===
|
2508
|
-
const v = (
|
2489
|
+
if (u.key === pi) {
|
2490
|
+
const v = (y = u.value) == null ? void 0 : y.payload, I = Object.keys(v)[0], x = Object.values(v)[0], g = K(t.getState()), O = g.trackItemDetailsMap[I], D = K(g.trackItemsMap[I]), j = O.details;
|
2509
2491
|
if (!x.details.src) return;
|
2510
2492
|
if (O.type === "image") {
|
2511
|
-
const L = await Oe(x.details.src), { crop: R, newHeight:
|
2493
|
+
const L = await Oe(x.details.src), { crop: R, newHeight: F, newWidth: V } = Yn(
|
2512
2494
|
O,
|
2513
2495
|
L
|
2514
2496
|
);
|
2515
|
-
x.details.crop = R, x.details.height =
|
2497
|
+
x.details.crop = R, x.details.height = F, x.details.width = V;
|
2516
2498
|
} else if (O.type === "video") {
|
2517
|
-
const L = await
|
2499
|
+
const L = await _n(x.details.src), R = g.trackItemsMap[I], { display: F, duration: V, trim: kt } = Bn(R, L), { crop: Dt, newHeight: Ot, newWidth: U } = Yn(
|
2518
2500
|
O,
|
2519
2501
|
L
|
2520
2502
|
);
|
2521
|
-
x.details.crop =
|
2503
|
+
x.details.crop = Dt, x.details.height = Ot, x.details.width = U, D.display = F, D.duration = V, D.trim = kt;
|
2522
2504
|
} else if (O.type === "audio") {
|
2523
|
-
const L = await
|
2524
|
-
D.display =
|
2505
|
+
const L = await ls(x.details.src), R = g.trackItemsMap[I], { display: F, duration: V, trim: kt } = Bn(R, L);
|
2506
|
+
D.display = F, D.duration = V, D.trim = kt;
|
2525
2507
|
}
|
2526
|
-
O.details = { ...
|
2508
|
+
O.details = { ...j, ...x.details }, g.trackItemDetailsMap[I] = { ...O }, g.trackItemsMap[I] = { ...D }, t.updateState(
|
2527
2509
|
{
|
2528
2510
|
trackItemDetailsMap: g.trackItemDetailsMap,
|
2529
2511
|
trackItemsMap: g.trackItemsMap
|
@@ -2534,33 +2516,33 @@ function zi(t) {
|
|
2534
2516
|
}
|
2535
2517
|
);
|
2536
2518
|
}
|
2537
|
-
}),
|
2538
|
-
var g, O, D,
|
2539
|
-
const
|
2540
|
-
let h = [],
|
2541
|
-
const v = (V = (
|
2542
|
-
let I = (
|
2543
|
-
if (u.key ===
|
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, et, Mt, ot, $t, Et, Gt, Yt, ee, Bt, re, Xt, ne, _e, ke, Nt, Kt;
|
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
|
+
let h = [], y = "text";
|
2523
|
+
const v = (V = (F = u.value) == null ? void 0 : F.options) == null ? void 0 : V.trackId;
|
2524
|
+
let I = (Dt = (kt = u.value) == null ? void 0 : kt.options) == null ? void 0 : Dt.trackIndex;
|
2525
|
+
if (u.key === ei) {
|
2544
2526
|
const $ = (Ot = u.value) == null ? void 0 : Ot.payload;
|
2545
|
-
let
|
2546
|
-
|
2527
|
+
let H = l.trackItemsMap[$.id].animations;
|
2528
|
+
H ? H.in && $.animations.in ? H.in = $.animations.in : H.out && $.animations.out || !H.out && $.animations.out ? H.out = $.animations.out : !H.in && $.animations.in ? H.in = $.animations.in : H = $.animations : l.trackItemsMap[$.id].animations = $.animations;
|
2547
2529
|
}
|
2548
|
-
if (u.key ===
|
2549
|
-
const $ = (U = u.value) == null ? void 0 : U.payload,
|
2550
|
-
(Y) =>
|
2551
|
-
size:
|
2530
|
+
if (u.key === si) {
|
2531
|
+
const $ = (U = u.value) == null ? void 0 : U.payload, H = $.trackItems.map(
|
2532
|
+
(Y) => Mi(Y, {
|
2533
|
+
size: l.size
|
2552
2534
|
})
|
2553
|
-
),
|
2535
|
+
), z = await Promise.all(H), rt = Ti($.tracks, $.trackItems), ct = [];
|
2554
2536
|
$.trackItems.forEach((Y) => {
|
2555
2537
|
if (Y.type !== "template") return;
|
2556
|
-
|
2557
|
-
...
|
2538
|
+
l.trackItemsMap = {
|
2539
|
+
...l.trackItemsMap,
|
2558
2540
|
...Y.trackItemsMap
|
2559
|
-
},
|
2560
|
-
...
|
2541
|
+
}, l.trackItemDetailsMap = {
|
2542
|
+
...l.trackItemDetailsMap,
|
2561
2543
|
...Y.trackItemDetailsMap
|
2562
|
-
},
|
2563
|
-
...
|
2544
|
+
}, l.transitionsMap = {
|
2545
|
+
...l.transitionsMap,
|
2564
2546
|
...Y.transitionsMap
|
2565
2547
|
};
|
2566
2548
|
const mt = {
|
@@ -2572,24 +2554,24 @@ function zi(t) {
|
|
2572
2554
|
ct.push(mt);
|
2573
2555
|
});
|
2574
2556
|
const B = [], ut = {}, q = {};
|
2575
|
-
if (
|
2557
|
+
if (z.forEach((Y) => {
|
2576
2558
|
const { details: mt, ...Vt } = Y;
|
2577
2559
|
B.push(Y.id), ut[Y.id] = {
|
2578
2560
|
type: Y.type,
|
2579
2561
|
details: mt
|
2580
2562
|
}, q[Y.id] = Vt;
|
2581
|
-
}),
|
2582
|
-
|
2563
|
+
}), Ei(
|
2564
|
+
l.tracks,
|
2583
2565
|
rt
|
2584
2566
|
))
|
2585
|
-
|
2567
|
+
l.tracks.forEach((Y) => {
|
2586
2568
|
rt.forEach((mt) => {
|
2587
2569
|
if (Y.id === mt.id) {
|
2588
2570
|
if (Y.magnetic) {
|
2589
2571
|
const Vt = mt.items.map((Tt) => q[Tt]), qt = Y.items.map(
|
2590
|
-
(Tt) =>
|
2572
|
+
(Tt) => l.trackItemsMap[Tt]
|
2591
2573
|
);
|
2592
|
-
|
2574
|
+
Oi(
|
2593
2575
|
Vt,
|
2594
2576
|
qt
|
2595
2577
|
);
|
@@ -2599,38 +2581,38 @@ function zi(t) {
|
|
2599
2581
|
});
|
2600
2582
|
});
|
2601
2583
|
else {
|
2602
|
-
const Y = ((wt = (
|
2584
|
+
const Y = ((wt = (zt = u.value) == null ? void 0 : zt.options) == null ? void 0 : wt.trackIndex) || 0, mt = kn(
|
2603
2585
|
Y,
|
2604
2586
|
0,
|
2605
|
-
|
2587
|
+
l.tracks.length
|
2606
2588
|
);
|
2607
|
-
|
2589
|
+
l.tracks.splice(mt, 0, ...rt);
|
2608
2590
|
}
|
2609
|
-
|
2610
|
-
...
|
2591
|
+
l.trackItemDetailsMap = {
|
2592
|
+
...l.trackItemDetailsMap,
|
2611
2593
|
...ut
|
2612
|
-
},
|
2613
|
-
...
|
2594
|
+
}, l.trackItemsMap = {
|
2595
|
+
...l.trackItemsMap,
|
2614
2596
|
...q
|
2615
|
-
},
|
2616
|
-
...
|
2597
|
+
}, l.trackItemIds = [
|
2598
|
+
...l.trackItemIds,
|
2617
2599
|
...B
|
2618
|
-
],
|
2619
|
-
const { transitionIds: Se, transitionsMap: se } =
|
2620
|
-
|
2621
|
-
), Pe =
|
2622
|
-
|
2600
|
+
], l.structure = [...l.structure, ...ct], l.duration = he(l.trackItemsMap);
|
2601
|
+
const { transitionIds: Se, transitionsMap: se } = Ci(
|
2602
|
+
l
|
2603
|
+
), Pe = l.tracks.filter((Y) => Y.magnetic);
|
2604
|
+
Xn(
|
2623
2605
|
Pe,
|
2624
|
-
|
2606
|
+
l.trackItemsMap,
|
2625
2607
|
se
|
2626
2608
|
), t.updateState(
|
2627
2609
|
{
|
2628
|
-
trackItemIds:
|
2629
|
-
trackItemDetailsMap:
|
2630
|
-
trackItemsMap:
|
2631
|
-
tracks:
|
2632
|
-
duration:
|
2633
|
-
structure:
|
2610
|
+
trackItemIds: l.trackItemIds,
|
2611
|
+
trackItemDetailsMap: l.trackItemDetailsMap,
|
2612
|
+
trackItemsMap: l.trackItemsMap,
|
2613
|
+
tracks: l.tracks,
|
2614
|
+
duration: l.duration,
|
2615
|
+
structure: l.structure,
|
2634
2616
|
transitionIds: Se,
|
2635
2617
|
transitionsMap: se
|
2636
2618
|
},
|
@@ -2641,161 +2623,161 @@ function zi(t) {
|
|
2641
2623
|
);
|
2642
2624
|
return;
|
2643
2625
|
}
|
2644
|
-
if (u.key ===
|
2645
|
-
|
2646
|
-
const $ = (at = u.value) == null ? void 0 : at.payload,
|
2626
|
+
if (u.key === ri) {
|
2627
|
+
y = "caption";
|
2628
|
+
const $ = (at = u.value) == null ? void 0 : at.payload, H = [];
|
2647
2629
|
for (const ct of $) {
|
2648
|
-
const B =
|
2649
|
-
size:
|
2630
|
+
const B = Is(ct, {
|
2631
|
+
size: l.size
|
2650
2632
|
});
|
2651
|
-
|
2633
|
+
H.push(B);
|
2652
2634
|
}
|
2653
|
-
const
|
2654
|
-
for (const ct of
|
2635
|
+
const z = await Promise.all(H), rt = [];
|
2636
|
+
for (const ct of z) {
|
2655
2637
|
const B = ct.id;
|
2656
2638
|
rt.push(B);
|
2657
2639
|
const { details: ut, ...q } = ct;
|
2658
|
-
|
2659
|
-
type:
|
2640
|
+
l.trackItemDetailsMap[B] = {
|
2641
|
+
type: y,
|
2660
2642
|
details: ut
|
2661
|
-
},
|
2643
|
+
}, l.trackItemsMap[B] = q, l.trackItemIds.push(B);
|
2662
2644
|
}
|
2663
2645
|
h = rt;
|
2664
2646
|
}
|
2665
|
-
if (u.key ===
|
2666
|
-
|
2667
|
-
const $ = await
|
2668
|
-
size:
|
2669
|
-
}), { details:
|
2670
|
-
|
2671
|
-
type:
|
2672
|
-
details:
|
2673
|
-
},
|
2647
|
+
if (u.key === Vs) {
|
2648
|
+
y = "text";
|
2649
|
+
const $ = await bs((Ft = u.value) == null ? void 0 : Ft.payload, {
|
2650
|
+
size: l.size
|
2651
|
+
}), { details: H, ...z } = $;
|
2652
|
+
l.trackItemDetailsMap[z.id] = {
|
2653
|
+
type: y,
|
2654
|
+
details: H
|
2655
|
+
}, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
|
2674
2656
|
}
|
2675
|
-
if (u.key ===
|
2676
|
-
|
2677
|
-
const $ = (A = u.value) == null ? void 0 : A.payload.trackItemsMap,
|
2678
|
-
size:
|
2657
|
+
if (u.key === ni) {
|
2658
|
+
y = "template";
|
2659
|
+
const $ = (A = u.value) == null ? void 0 : A.payload.trackItemsMap, H = (et = u.value) == null ? void 0 : et.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
|
+
size: l.size
|
2679
2661
|
}), ht = {
|
2680
2662
|
id: q.id,
|
2681
2663
|
items: ct,
|
2682
2664
|
transitions: rt,
|
2683
2665
|
tracks: B
|
2684
2666
|
};
|
2685
|
-
|
2686
|
-
type:
|
2667
|
+
l.trackItemDetailsMap[q.id] = {
|
2668
|
+
type: y,
|
2687
2669
|
details: ut
|
2688
|
-
},
|
2689
|
-
...
|
2670
|
+
}, l.trackItemsMap[q.id] = q, l.trackItemIds.push(q.id), h = [q.id], l.trackItemsMap = {
|
2671
|
+
...l.trackItemsMap,
|
2690
2672
|
...$,
|
2691
2673
|
[q.id]: {
|
2692
2674
|
...q
|
2693
2675
|
}
|
2694
|
-
},
|
2695
|
-
...
|
2696
|
-
...
|
2676
|
+
}, l.trackItemDetailsMap = {
|
2677
|
+
...l.trackItemDetailsMap,
|
2678
|
+
...H,
|
2697
2679
|
[q.id]: {
|
2698
2680
|
type: "template",
|
2699
2681
|
details: ut
|
2700
2682
|
}
|
2701
|
-
},
|
2702
|
-
...
|
2703
|
-
...
|
2704
|
-
},
|
2683
|
+
}, l.transitionsMap = {
|
2684
|
+
...l.transitionsMap,
|
2685
|
+
...z
|
2686
|
+
}, l.structure = [...l.structure, ht];
|
2705
2687
|
}
|
2706
|
-
if (u.key ===
|
2707
|
-
|
2708
|
-
const $ = await
|
2709
|
-
size:
|
2710
|
-
}), { details:
|
2711
|
-
|
2712
|
-
type:
|
2713
|
-
details:
|
2714
|
-
},
|
2715
|
-
}
|
2716
|
-
if (u.key === ri) {
|
2717
|
-
m = "shape";
|
2718
|
-
const $ = await Ei((ee = u.value) == null ? void 0 : ee.payload, {
|
2719
|
-
size: d.size
|
2720
|
-
}), { details: N, ...F } = $;
|
2721
|
-
d.trackItemDetailsMap[F.id] = {
|
2722
|
-
type: m,
|
2723
|
-
details: N
|
2724
|
-
}, d.trackItemsMap[F.id] = F, d.trackItemIds.push(F.id), h = [F.id];
|
2688
|
+
if (u.key === Qs) {
|
2689
|
+
y = "illustration";
|
2690
|
+
const $ = await Gn((Yt = u.value) == null ? void 0 : Yt.payload, {
|
2691
|
+
size: l.size
|
2692
|
+
}), { details: H, ...z } = $;
|
2693
|
+
l.trackItemDetailsMap[z.id] = {
|
2694
|
+
type: y,
|
2695
|
+
details: H
|
2696
|
+
}, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
|
2725
2697
|
}
|
2726
2698
|
if (u.key === ti) {
|
2727
|
-
|
2728
|
-
const $ = await
|
2729
|
-
size:
|
2699
|
+
y = "shape";
|
2700
|
+
const $ = await wi((ee = u.value) == null ? void 0 : ee.payload, {
|
2701
|
+
size: l.size
|
2702
|
+
}), { details: H, ...z } = $;
|
2703
|
+
l.trackItemDetailsMap[z.id] = {
|
2704
|
+
type: y,
|
2705
|
+
details: H
|
2706
|
+
}, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
|
2707
|
+
}
|
2708
|
+
if (u.key === Zs) {
|
2709
|
+
y = "image";
|
2710
|
+
const $ = await gs((Bt = u.value) == null ? void 0 : Bt.payload, {
|
2711
|
+
size: l.size,
|
2730
2712
|
scaleMode: w
|
2731
|
-
}), { details:
|
2732
|
-
|
2733
|
-
type:
|
2734
|
-
details:
|
2735
|
-
},
|
2713
|
+
}), { details: H, ...z } = $;
|
2714
|
+
l.trackItemDetailsMap[z.id] = {
|
2715
|
+
type: y,
|
2716
|
+
details: H
|
2717
|
+
}, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
|
2736
2718
|
}
|
2737
|
-
if (u.key ===
|
2738
|
-
|
2739
|
-
const $ = await
|
2740
|
-
|
2741
|
-
type:
|
2742
|
-
details:
|
2743
|
-
},
|
2719
|
+
if (u.key === Js) {
|
2720
|
+
y = "audio";
|
2721
|
+
const $ = await ms((re = u.value) == null ? void 0 : re.payload), { details: H, ...z } = $;
|
2722
|
+
l.trackItemDetailsMap[z.id] = {
|
2723
|
+
type: y,
|
2724
|
+
details: H
|
2725
|
+
}, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
|
2744
2726
|
}
|
2745
|
-
if (u.key ===
|
2746
|
-
|
2747
|
-
const $ = await
|
2748
|
-
size:
|
2727
|
+
if (u.key === qs) {
|
2728
|
+
y = "video";
|
2729
|
+
const $ = await hs((Xt = u.value) == null ? void 0 : Xt.payload, {
|
2730
|
+
size: l.size,
|
2749
2731
|
scaleMode: w
|
2750
|
-
}), { details:
|
2751
|
-
|
2752
|
-
type:
|
2753
|
-
details:
|
2754
|
-
metadata:
|
2755
|
-
},
|
2732
|
+
}), { details: H, ...z } = $;
|
2733
|
+
l.trackItemDetailsMap[z.id] = {
|
2734
|
+
type: y,
|
2735
|
+
details: H,
|
2736
|
+
metadata: z.metadata
|
2737
|
+
}, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
|
2756
2738
|
}
|
2757
|
-
if (u.key ===
|
2758
|
-
|
2759
|
-
const $ = (ne = u.value) == null ? void 0 : ne.payload.trackItemsMap,
|
2739
|
+
if (u.key === ii) {
|
2740
|
+
y = "composition";
|
2741
|
+
const $ = (ne = u.value) == null ? void 0 : ne.payload.trackItemsMap, H = (_e = u.value) == null ? void 0 : _e.payload.trackItemDetailsMap, z = (ke = u.value) == null ? void 0 : ke.payload.trackItemIds, rt = ((Nt = u.value) == null ? void 0 : Nt.payload.tracks) || [], { details: ct, ...B } = await Si(
|
2760
2742
|
(Kt = u.value) == null ? void 0 : Kt.payload,
|
2761
2743
|
{
|
2762
|
-
size:
|
2744
|
+
size: l.size
|
2763
2745
|
}
|
2764
2746
|
), ut = {
|
2765
2747
|
id: B.id,
|
2766
|
-
items:
|
2748
|
+
items: z,
|
2767
2749
|
transitions: [],
|
2768
2750
|
tracks: rt
|
2769
2751
|
};
|
2770
|
-
|
2771
|
-
type:
|
2752
|
+
l.trackItemDetailsMap[B.id] = {
|
2753
|
+
type: y,
|
2772
2754
|
details: ct
|
2773
|
-
},
|
2774
|
-
...
|
2755
|
+
}, l.trackItemsMap[B.id] = B, l.trackItemIds.push(B.id), h = [B.id], l.trackItemsMap = {
|
2756
|
+
...l.trackItemsMap,
|
2775
2757
|
...$,
|
2776
2758
|
[B.id]: {
|
2777
2759
|
...B
|
2778
2760
|
}
|
2779
|
-
},
|
2780
|
-
...
|
2781
|
-
...
|
2761
|
+
}, l.trackItemDetailsMap = {
|
2762
|
+
...l.trackItemDetailsMap,
|
2763
|
+
...H,
|
2782
2764
|
[B.id]: {
|
2783
|
-
type:
|
2765
|
+
type: y,
|
2784
2766
|
details: ct
|
2785
2767
|
}
|
2786
|
-
},
|
2768
|
+
}, l.structure = [...l.structure, ut];
|
2787
2769
|
}
|
2788
|
-
const x =
|
2770
|
+
const x = xi(
|
2789
2771
|
h,
|
2790
|
-
|
2791
|
-
|
2772
|
+
l.tracks,
|
2773
|
+
l.trackItemsMap,
|
2792
2774
|
v,
|
2793
2775
|
I
|
2794
2776
|
);
|
2795
2777
|
if (k) {
|
2796
2778
|
const $ = Xe();
|
2797
2779
|
x.trackId = $;
|
2798
|
-
const
|
2780
|
+
const H = {
|
2799
2781
|
id: x.trackId,
|
2800
2782
|
accepts: [
|
2801
2783
|
"text",
|
@@ -2806,15 +2788,15 @@ function zi(t) {
|
|
2806
2788
|
"caption",
|
2807
2789
|
"template"
|
2808
2790
|
],
|
2809
|
-
type:
|
2791
|
+
type: y,
|
2810
2792
|
items: h,
|
2811
2793
|
magnetic: !1,
|
2812
2794
|
static: !1
|
2813
2795
|
};
|
2814
|
-
|
2796
|
+
l.tracks.splice(x.trackIndex, 0, H);
|
2815
2797
|
} else if (x.trackId) {
|
2816
|
-
const $ =
|
2817
|
-
(
|
2798
|
+
const $ = l.tracks.find(
|
2799
|
+
(H) => H.id === x.trackId
|
2818
2800
|
);
|
2819
2801
|
$ && $.items.push(...h);
|
2820
2802
|
} else if (x.trackIndex !== void 0) {
|
@@ -2829,14 +2811,14 @@ function zi(t) {
|
|
2829
2811
|
"caption",
|
2830
2812
|
"template"
|
2831
2813
|
],
|
2832
|
-
type:
|
2814
|
+
type: y,
|
2833
2815
|
items: h,
|
2834
2816
|
magnetic: !1,
|
2835
2817
|
static: !1
|
2836
2818
|
};
|
2837
|
-
|
2819
|
+
l.tracks.splice(x.trackIndex, 0, $);
|
2838
2820
|
} else
|
2839
|
-
|
2821
|
+
l.tracks.unshift({
|
2840
2822
|
id: Xe(),
|
2841
2823
|
accepts: [
|
2842
2824
|
"text",
|
@@ -2847,21 +2829,21 @@ function zi(t) {
|
|
2847
2829
|
"caption",
|
2848
2830
|
"template"
|
2849
2831
|
],
|
2850
|
-
type:
|
2832
|
+
type: y,
|
2851
2833
|
items: h,
|
2852
2834
|
magnetic: !1,
|
2853
2835
|
static: !1
|
2854
2836
|
});
|
2855
|
-
S && (
|
2837
|
+
S && (l.activeIds = h), l.duration = he(l.trackItemsMap), t.updateState(
|
2856
2838
|
{
|
2857
|
-
activeIds:
|
2858
|
-
trackItemIds:
|
2859
|
-
trackItemDetailsMap:
|
2860
|
-
trackItemsMap:
|
2861
|
-
transitionsMap:
|
2862
|
-
tracks:
|
2863
|
-
duration:
|
2864
|
-
structure:
|
2839
|
+
activeIds: l.activeIds,
|
2840
|
+
trackItemIds: l.trackItemIds,
|
2841
|
+
trackItemDetailsMap: l.trackItemDetailsMap,
|
2842
|
+
trackItemsMap: l.trackItemsMap,
|
2843
|
+
transitionsMap: l.transitionsMap,
|
2844
|
+
tracks: l.tracks,
|
2845
|
+
duration: l.duration,
|
2846
|
+
structure: l.structure
|
2865
2847
|
},
|
2866
2848
|
{
|
2867
2849
|
updateHistory: !0,
|
@@ -2869,14 +2851,14 @@ function zi(t) {
|
|
2869
2851
|
}
|
2870
2852
|
);
|
2871
2853
|
}), T = c.subscribe(async (u) => {
|
2872
|
-
var
|
2873
|
-
if (u.key ===
|
2874
|
-
const S = K(t.getState()), w = (
|
2854
|
+
var l;
|
2855
|
+
if (u.key === li) {
|
2856
|
+
const S = K(t.getState()), w = (l = u.value) == null ? void 0 : l.options.time;
|
2875
2857
|
if (S.activeIds.length === 1) {
|
2876
2858
|
const k = S.activeIds[0], h = K(S.trackItemsMap[k]);
|
2877
2859
|
if (w >= h.display.to || w <= h.display.from)
|
2878
2860
|
return;
|
2879
|
-
const
|
2861
|
+
const y = K(S.trackItemDetailsMap[k]), v = De(), I = K({
|
2880
2862
|
...h,
|
2881
2863
|
display: {
|
2882
2864
|
from: h.display.from,
|
@@ -2900,7 +2882,7 @@ function zi(t) {
|
|
2900
2882
|
to: h.trim.to
|
2901
2883
|
};
|
2902
2884
|
}
|
2903
|
-
S.trackItemsMap[k] = I, S.trackItemsMap[v] = x, S.trackItemIds.push(v), S.trackItemDetailsMap[v] =
|
2885
|
+
S.trackItemsMap[k] = I, S.trackItemsMap[v] = x, S.trackItemIds.push(v), S.trackItemDetailsMap[v] = y, S.tracks.forEach((g) => {
|
2904
2886
|
g.items.includes(k) && g.items.push(v);
|
2905
2887
|
}), t.updateState(
|
2906
2888
|
{
|
@@ -2917,7 +2899,7 @@ function zi(t) {
|
|
2917
2899
|
}
|
2918
2900
|
return;
|
2919
2901
|
}
|
2920
|
-
if (u.key ===
|
2902
|
+
if (u.key === ui) {
|
2921
2903
|
const S = K(t.getState());
|
2922
2904
|
if (S.activeIds.length) {
|
2923
2905
|
const w = S.activeIds, k = [], h = {
|
@@ -2931,14 +2913,14 @@ function zi(t) {
|
|
2931
2913
|
S.tracks.find((I) => I.items.includes(v))
|
2932
2914
|
);
|
2933
2915
|
});
|
2934
|
-
const
|
2935
|
-
k.filter((v) =>
|
2916
|
+
const y = /* @__PURE__ */ new Set();
|
2917
|
+
k.filter((v) => y.has(v.id) ? !1 : (y.add(v), !0)), h.tracks = Array.from(y.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(h));
|
2936
2918
|
}
|
2937
2919
|
}
|
2938
|
-
if (u.key ===
|
2920
|
+
if (u.key === ci) {
|
2939
2921
|
const S = localStorage.getItem("DesignComboTemp");
|
2940
2922
|
if (!S) return;
|
2941
|
-
const w = K(t.getState()), k = JSON.parse(S), h = {},
|
2923
|
+
const w = K(t.getState()), k = JSON.parse(S), h = {}, y = k.trackItemsMap, v = k.trackItemDetailsMap, I = k.tracks, x = [], g = k.activeIds.map(async (O) => {
|
2942
2924
|
const D = v[O];
|
2943
2925
|
(D.type === "caption" || D.type === "text") && D.details.fontUrl && await br([
|
2944
2926
|
{
|
@@ -2946,21 +2928,21 @@ function zi(t) {
|
|
2946
2928
|
url: D.details.fontUrl
|
2947
2929
|
}
|
2948
2930
|
]);
|
2949
|
-
const
|
2950
|
-
return h[O] =
|
2951
|
-
...
|
2952
|
-
id:
|
2953
|
-
}, w.trackItemDetailsMap[
|
2931
|
+
const j = De();
|
2932
|
+
return h[O] = j, w.trackItemsMap[j] = {
|
2933
|
+
...y[O],
|
2934
|
+
id: j
|
2935
|
+
}, w.trackItemDetailsMap[j] = D, w.trackItemIds.push(j), !0;
|
2954
2936
|
});
|
2955
2937
|
await Promise.all(g), I.forEach((O) => {
|
2956
|
-
const D = O.items.map((L) => h[L]),
|
2938
|
+
const D = O.items.map((L) => h[L]), j = {
|
2957
2939
|
...O,
|
2958
2940
|
magnetic: !1,
|
2959
2941
|
static: !1,
|
2960
2942
|
items: D,
|
2961
2943
|
id: Xe()
|
2962
2944
|
};
|
2963
|
-
x.push(
|
2945
|
+
x.push(j);
|
2964
2946
|
}), w.tracks = [...x, ...w.tracks], t.updateState(
|
2965
2947
|
{
|
2966
2948
|
trackItemDetailsMap: w.trackItemDetailsMap,
|
@@ -2974,10 +2956,10 @@ function zi(t) {
|
|
2974
2956
|
}
|
2975
2957
|
);
|
2976
2958
|
}
|
2977
|
-
}), C =
|
2978
|
-
var
|
2979
|
-
if (u.key ===
|
2980
|
-
const k = K(t.getState()), h = k.trackItemDetailsMap,
|
2959
|
+
}), C = d.subscribe(async (u) => {
|
2960
|
+
var l, S, w;
|
2961
|
+
if (u.key === ai) {
|
2962
|
+
const k = K(t.getState()), h = k.trackItemDetailsMap, y = k.trackItemsMap, v = Object.keys((l = u.value) == null ? void 0 : l.payload);
|
2981
2963
|
if (!v.length) return;
|
2982
2964
|
const I = (S = u.value) == null ? void 0 : S.payload;
|
2983
2965
|
v.forEach((g) => {
|
@@ -2987,31 +2969,30 @@ function zi(t) {
|
|
2987
2969
|
...h[g].details,
|
2988
2970
|
...O.details
|
2989
2971
|
}, O.details.colorMap) {
|
2990
|
-
const D =
|
2972
|
+
const D = h[g].details.initialSvgString, j = Wn(
|
2991
2973
|
D,
|
2992
2974
|
O.details.colorMap
|
2993
2975
|
);
|
2994
|
-
h[g].details.svgString =
|
2976
|
+
h[g].details.svgString = j;
|
2995
2977
|
}
|
2996
|
-
} else I[g].playbackRate && (
|
2997
|
-
I[g].metadata && (
|
2998
|
-
...
|
2978
|
+
} else I[g].playbackRate && (y[g].playbackRate = I[g].playbackRate);
|
2979
|
+
I[g].metadata && (y[g].metadata ? y[g].metadata = {
|
2980
|
+
...y[g].metadata,
|
2999
2981
|
...I[g].metadata
|
3000
|
-
} :
|
2982
|
+
} : y[g].metadata = I[g].metadata), I[g].display && (y[g].display = I[g].display);
|
3001
2983
|
});
|
3002
2984
|
for (const g of v) {
|
3003
|
-
m[g].details.width = 500;
|
3004
2985
|
const O = I[g];
|
3005
|
-
if (
|
2986
|
+
if (y[g].type === "shape" && O.details.src) {
|
3006
2987
|
const D = await Oe(O.details.src);
|
3007
2988
|
h[g].details.width = D.width, h[g].details.height = D.height;
|
3008
2989
|
}
|
3009
2990
|
}
|
3010
|
-
const x = he(
|
2991
|
+
const x = he(y);
|
3011
2992
|
t.updateState(
|
3012
2993
|
{
|
3013
2994
|
trackItemDetailsMap: { ...h },
|
3014
|
-
trackItemsMap: { ...
|
2995
|
+
trackItemsMap: { ...y },
|
3015
2996
|
duration: x
|
3016
2997
|
},
|
3017
2998
|
{
|
@@ -3020,37 +3001,37 @@ function zi(t) {
|
|
3020
3001
|
}
|
3021
3002
|
);
|
3022
3003
|
}
|
3023
|
-
if (u.key ===
|
3024
|
-
const k = (w = u.value) == null ? void 0 : w.payload, h = Object.keys(k)[0],
|
3025
|
-
if (
|
3026
|
-
if (
|
3027
|
-
const O = await Oe(
|
3004
|
+
if (u.key === oi) {
|
3005
|
+
const k = (w = u.value) == null ? void 0 : w.payload, h = Object.keys(k)[0], y = Object.values(k)[0], v = K(t.getState()), I = v.trackItemDetailsMap[h], x = I.details;
|
3006
|
+
if (y.details) {
|
3007
|
+
if (y.type === "image" && y.details.src) {
|
3008
|
+
const O = await Oe(y.details.src), D = I.details.width || 0, j = I.details.height || 0;
|
3028
3009
|
let L = O.width, R = O.height;
|
3029
|
-
const
|
3030
|
-
D /
|
3010
|
+
const F = O.width / O.height;
|
3011
|
+
D / j > F ? (L = D, R = D / F) : (R = j, L = j * F), x.crop = {
|
3031
3012
|
x: 0,
|
3032
3013
|
y: 0,
|
3033
3014
|
height: x.height,
|
3034
3015
|
width: x.width
|
3035
|
-
},
|
3016
|
+
}, y.details.width = L, y.details.height = R;
|
3036
3017
|
}
|
3037
|
-
if (
|
3038
|
-
const O = await
|
3018
|
+
if (y.type === "video" && y.details.src) {
|
3019
|
+
const O = await _n(y.details.src), D = I.details.width || 0, j = I.details.height || 0;
|
3039
3020
|
let L = O.width, R = O.height;
|
3040
|
-
const
|
3041
|
-
D /
|
3021
|
+
const F = O.width / O.height;
|
3022
|
+
D / j > F ? (L = D, R = D / F) : (R = j, L = j * F), x.crop = {
|
3042
3023
|
x: 0,
|
3043
3024
|
y: 0,
|
3044
3025
|
height: x.height,
|
3045
3026
|
width: x.width
|
3046
|
-
},
|
3027
|
+
}, y.details.width = L, y.details.height = R;
|
3047
3028
|
}
|
3048
|
-
I.details = { ...x, ...
|
3029
|
+
I.details = { ...x, ...y.details }, y.details = I.details;
|
3049
3030
|
}
|
3050
|
-
const g = { ...I, ...
|
3031
|
+
const g = { ...I, ...y };
|
3051
3032
|
v.trackItemDetailsMap[h] = g, v.trackItemsMap[h] = {
|
3052
3033
|
...v.trackItemsMap[h],
|
3053
|
-
type:
|
3034
|
+
type: y.type
|
3054
3035
|
}, t.updateState(
|
3055
3036
|
{
|
3056
3037
|
trackItemDetailsMap: {
|
@@ -3069,12 +3050,12 @@ function zi(t) {
|
|
3069
3050
|
});
|
3070
3051
|
return {
|
3071
3052
|
unsubscribe: () => {
|
3072
|
-
|
3053
|
+
m.unsubscribe(), T.unsubscribe(), C.unsubscribe(), _.unsubscribe(), E.unsubscribe(), b.unsubscribe(), M.unsubscribe();
|
3073
3054
|
}
|
3074
3055
|
};
|
3075
3056
|
}
|
3076
|
-
const
|
3077
|
-
function
|
3057
|
+
const zi = { Date: !0, RegExp: !0, String: !0, Number: !0 };
|
3058
|
+
function _s(t, e, r = { cyclesFix: !0 }, s = []) {
|
3078
3059
|
var f, b;
|
3079
3060
|
let a = [];
|
3080
3061
|
const c = Array.isArray(t);
|
@@ -3088,28 +3069,25 @@ function ws(t, e, r = { cyclesFix: !0 }, s = []) {
|
|
3088
3069
|
});
|
3089
3070
|
continue;
|
3090
3071
|
}
|
3091
|
-
const
|
3092
|
-
|
3093
|
-
|
3094
|
-
a.push.apply(a, C.map((u) => (u.path.unshift(E), u)));
|
3095
|
-
} else M !== y && // treat NaN values as equivalent
|
3096
|
-
!(Number.isNaN(M) && Number.isNaN(y)) && !(T && (isNaN(M) ? M + "" == y + "" : +M == +y)) && a.push({
|
3072
|
+
const m = e[_], T = typeof M == "object" && typeof m == "object" && Array.isArray(M) === Array.isArray(m);
|
3073
|
+
M && m && T && !zi[(b = (f = Object.getPrototypeOf(M)) == null ? void 0 : f.constructor) == null ? void 0 : b.name] && (!r.cyclesFix || !s.includes(M)) ? a.push.apply(a, _s(M, m, r, r.cyclesFix ? s.concat([M]) : []).map((C) => (C.path.unshift(E), C))) : M !== m && // treat NaN values as equivalent
|
3074
|
+
!(Number.isNaN(M) && Number.isNaN(m)) && !(T && (isNaN(M) ? M + "" == m + "" : +M == +m)) && a.push({
|
3097
3075
|
path: [E],
|
3098
3076
|
type: "CHANGE",
|
3099
|
-
value:
|
3077
|
+
value: m,
|
3100
3078
|
oldValue: M
|
3101
3079
|
});
|
3102
3080
|
}
|
3103
|
-
const
|
3081
|
+
const d = Array.isArray(e);
|
3104
3082
|
for (const _ in e)
|
3105
3083
|
_ in t || a.push({
|
3106
3084
|
type: "CREATE",
|
3107
|
-
path: [
|
3085
|
+
path: [d ? +_ : _],
|
3108
3086
|
value: e[_]
|
3109
3087
|
});
|
3110
3088
|
return a;
|
3111
3089
|
}
|
3112
|
-
var
|
3090
|
+
var On = Symbol.for("immer-nothing"), Ke = Symbol.for("immer-draftable"), vt = Symbol.for("immer-state"), ks = process.env.NODE_ENV !== "production" ? [
|
3113
3091
|
// All error codes, starting by 0:
|
3114
3092
|
function(t) {
|
3115
3093
|
return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
|
@@ -3142,7 +3120,7 @@ var Cn = Symbol.for("immer-nothing"), Ke = Symbol.for("immer-draftable"), vt = S
|
|
3142
3120
|
] : [];
|
3143
3121
|
function tt(t, ...e) {
|
3144
3122
|
if (process.env.NODE_ENV !== "production") {
|
3145
|
-
const r =
|
3123
|
+
const r = ks[t], s = typeof r == "function" ? r.apply(null, e) : r;
|
3146
3124
|
throw new Error(`[Immer] ${s}`);
|
3147
3125
|
}
|
3148
3126
|
throw new Error(
|
@@ -3155,17 +3133,17 @@ function ye(t) {
|
|
3155
3133
|
}
|
3156
3134
|
function Qt(t) {
|
3157
3135
|
var e;
|
3158
|
-
return t ?
|
3136
|
+
return t ? Ss(t) || Array.isArray(t) || !!t[Ke] || !!((e = t.constructor) != null && e[Ke]) || tr(t) || er(t) : !1;
|
3159
3137
|
}
|
3160
|
-
var
|
3161
|
-
function
|
3138
|
+
var Fi = Object.prototype.constructor.toString();
|
3139
|
+
function Ss(t) {
|
3162
3140
|
if (!t || typeof t != "object")
|
3163
3141
|
return !1;
|
3164
3142
|
const e = me(t);
|
3165
3143
|
if (e === null)
|
3166
3144
|
return !0;
|
3167
3145
|
const r = Object.hasOwnProperty.call(e, "constructor") && e.constructor;
|
3168
|
-
return r === Object ? !0 : typeof r == "function" && Function.toString.call(r) ===
|
3146
|
+
return r === Object ? !0 : typeof r == "function" && Function.toString.call(r) === Fi;
|
3169
3147
|
}
|
3170
3148
|
function Ve(t, e) {
|
3171
3149
|
ge(t) === 0 ? Reflect.ownKeys(t).forEach((r) => {
|
@@ -3179,14 +3157,14 @@ function ge(t) {
|
|
3179
3157
|
function qe(t, e) {
|
3180
3158
|
return ge(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
3181
3159
|
}
|
3182
|
-
function
|
3160
|
+
function fn(t, e) {
|
3183
3161
|
return ge(t) === 2 ? t.get(e) : t[e];
|
3184
3162
|
}
|
3185
|
-
function
|
3163
|
+
function ws(t, e, r) {
|
3186
3164
|
const s = ge(t);
|
3187
3165
|
s === 2 ? t.set(e, r) : s === 3 ? t.add(r) : t[e] = r;
|
3188
3166
|
}
|
3189
|
-
function
|
3167
|
+
function $i(t, e) {
|
3190
3168
|
return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
|
3191
3169
|
}
|
3192
3170
|
function tr(t) {
|
@@ -3198,26 +3176,26 @@ function er(t) {
|
|
3198
3176
|
function pe(t) {
|
3199
3177
|
return t.copy_ || t.base_;
|
3200
3178
|
}
|
3201
|
-
function
|
3179
|
+
function Sn(t, e) {
|
3202
3180
|
if (tr(t))
|
3203
3181
|
return new Map(t);
|
3204
3182
|
if (er(t))
|
3205
3183
|
return new Set(t);
|
3206
3184
|
if (Array.isArray(t))
|
3207
3185
|
return Array.prototype.slice.call(t);
|
3208
|
-
const r =
|
3186
|
+
const r = Ss(t);
|
3209
3187
|
if (e === !0 || e === "class_only" && !r) {
|
3210
3188
|
const s = Object.getOwnPropertyDescriptors(t);
|
3211
3189
|
delete s[vt];
|
3212
3190
|
let a = Reflect.ownKeys(s);
|
3213
3191
|
for (let c = 0; c < a.length; c++) {
|
3214
|
-
const
|
3215
|
-
f.writable === !1 && (f.writable = !0, f.configurable = !0), (f.get || f.set) && (s[
|
3192
|
+
const d = a[c], f = s[d];
|
3193
|
+
f.writable === !1 && (f.writable = !0, f.configurable = !0), (f.get || f.set) && (s[d] = {
|
3216
3194
|
configurable: !0,
|
3217
3195
|
writable: !0,
|
3218
3196
|
// could live with !!desc.set as well here...
|
3219
3197
|
enumerable: f.enumerable,
|
3220
|
-
value: t[
|
3198
|
+
value: t[d]
|
3221
3199
|
});
|
3222
3200
|
}
|
3223
3201
|
return Object.create(me(t), s);
|
@@ -3229,8 +3207,8 @@ function wn(t, e) {
|
|
3229
3207
|
return Object.assign(a, t);
|
3230
3208
|
}
|
3231
3209
|
}
|
3232
|
-
function
|
3233
|
-
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]) =>
|
3210
|
+
function Cn(t, e = !1) {
|
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;
|
3234
3212
|
}
|
3235
3213
|
function Ni() {
|
3236
3214
|
tt(2);
|
@@ -3238,19 +3216,19 @@ function Ni() {
|
|
3238
3216
|
function Mr(t) {
|
3239
3217
|
return Object.isFrozen(t);
|
3240
3218
|
}
|
3241
|
-
var
|
3219
|
+
var wn = {};
|
3242
3220
|
function Ie(t) {
|
3243
|
-
const e =
|
3221
|
+
const e = wn[t];
|
3244
3222
|
return e || tt(0, t), e;
|
3245
3223
|
}
|
3246
|
-
function
|
3247
|
-
|
3224
|
+
function ji(t, e) {
|
3225
|
+
wn[t] || (wn[t] = e);
|
3248
3226
|
}
|
3249
3227
|
var Je;
|
3250
|
-
function
|
3228
|
+
function Ms() {
|
3251
3229
|
return Je;
|
3252
3230
|
}
|
3253
|
-
function
|
3231
|
+
function Hi(t, e) {
|
3254
3232
|
return {
|
3255
3233
|
drafts_: [],
|
3256
3234
|
parent_: t,
|
@@ -3261,31 +3239,31 @@ function Ui(t, e) {
|
|
3261
3239
|
unfinalizedDrafts_: 0
|
3262
3240
|
};
|
3263
3241
|
}
|
3264
|
-
function
|
3242
|
+
function Kn(t, e) {
|
3265
3243
|
e && (Ie("Patches"), t.patches_ = [], t.inversePatches_ = [], t.patchListener_ = e);
|
3266
3244
|
}
|
3267
|
-
function
|
3268
|
-
|
3245
|
+
function Mn(t) {
|
3246
|
+
En(t), t.drafts_.forEach(Li), t.drafts_ = null;
|
3269
3247
|
}
|
3270
|
-
function
|
3248
|
+
function En(t) {
|
3271
3249
|
t === Je && (Je = t.parent_);
|
3272
3250
|
}
|
3273
|
-
function
|
3274
|
-
return Je =
|
3251
|
+
function Vn(t) {
|
3252
|
+
return Je = Hi(Je, t);
|
3275
3253
|
}
|
3276
|
-
function
|
3254
|
+
function Li(t) {
|
3277
3255
|
const e = t[vt];
|
3278
3256
|
e.type_ === 0 || e.type_ === 1 ? e.revoke_() : e.revoked_ = !0;
|
3279
3257
|
}
|
3280
|
-
function
|
3258
|
+
function qn(t, e) {
|
3281
3259
|
e.unfinalizedDrafts_ = e.drafts_.length;
|
3282
3260
|
const r = e.drafts_[0];
|
3283
|
-
return t !== void 0 && t !== r ? (r[vt].modified_ && (
|
3261
|
+
return t !== void 0 && t !== r ? (r[vt].modified_ && (Mn(e), tt(4)), Qt(t) && (t = vr(e, t), e.parent_ || _r(e, t)), e.patches_ && Ie("Patches").generateReplacementPatches_(
|
3284
3262
|
r[vt].base_,
|
3285
3263
|
t,
|
3286
3264
|
e.patches_,
|
3287
3265
|
e.inversePatches_
|
3288
|
-
)) : t = vr(e, r, []),
|
3266
|
+
)) : t = vr(e, r, []), Mn(e), e.patches_ && e.patchListener_(e.patches_, e.inversePatches_), t !== On ? t : void 0;
|
3289
3267
|
}
|
3290
3268
|
function vr(t, e, r) {
|
3291
3269
|
if (Mr(e))
|
@@ -3294,7 +3272,7 @@ function vr(t, e, r) {
|
|
3294
3272
|
if (!s)
|
3295
3273
|
return Ve(
|
3296
3274
|
e,
|
3297
|
-
(a, c) =>
|
3275
|
+
(a, c) => Jn(t, s, e, a, c, r)
|
3298
3276
|
), e;
|
3299
3277
|
if (s.scope_ !== t)
|
3300
3278
|
return e;
|
@@ -3303,10 +3281,10 @@ function vr(t, e, r) {
|
|
3303
3281
|
if (!s.finalized_) {
|
3304
3282
|
s.finalized_ = !0, s.scope_.unfinalizedDrafts_--;
|
3305
3283
|
const a = s.copy_;
|
3306
|
-
let c = a,
|
3307
|
-
s.type_ === 3 && (c = new Set(a), a.clear(),
|
3284
|
+
let c = a, d = !1;
|
3285
|
+
s.type_ === 3 && (c = new Set(a), a.clear(), d = !0), Ve(
|
3308
3286
|
c,
|
3309
|
-
(f, b) =>
|
3287
|
+
(f, b) => Jn(t, s, a, f, b, r, d)
|
3310
3288
|
), _r(t, a, !1), r && t.patches_ && Ie("Patches").generatePatches_(
|
3311
3289
|
s,
|
3312
3290
|
r,
|
@@ -3316,15 +3294,15 @@ function vr(t, e, r) {
|
|
3316
3294
|
}
|
3317
3295
|
return s.copy_;
|
3318
3296
|
}
|
3319
|
-
function
|
3297
|
+
function Jn(t, e, r, s, a, c, d) {
|
3320
3298
|
if (process.env.NODE_ENV !== "production" && a === r && tt(5), ye(a)) {
|
3321
3299
|
const f = c && e && e.type_ !== 3 && // Set objects are atomic since they have no keys.
|
3322
3300
|
!qe(e.assigned_, s) ? c.concat(s) : void 0, b = vr(t, a, f);
|
3323
|
-
if (
|
3301
|
+
if (ws(r, s, b), ye(b))
|
3324
3302
|
t.canAutoFreeze_ = !1;
|
3325
3303
|
else
|
3326
3304
|
return;
|
3327
|
-
} else
|
3305
|
+
} else d && r.add(a);
|
3328
3306
|
if (Qt(a) && !Mr(a)) {
|
3329
3307
|
if (!t.immer_.autoFreeze_ && t.unfinalizedDrafts_ < 1)
|
3330
3308
|
return;
|
@@ -3332,13 +3310,13 @@ function Zn(t, e, r, s, a, c, l) {
|
|
3332
3310
|
}
|
3333
3311
|
}
|
3334
3312
|
function _r(t, e, r = !1) {
|
3335
|
-
!t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ &&
|
3313
|
+
!t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && Cn(e, r);
|
3336
3314
|
}
|
3337
|
-
function
|
3315
|
+
function Ui(t, e) {
|
3338
3316
|
const r = Array.isArray(t), s = {
|
3339
3317
|
type_: r ? 1 : 0,
|
3340
3318
|
// Track which produce call this is associated with.
|
3341
|
-
scope_: e ? e.scope_ :
|
3319
|
+
scope_: e ? e.scope_ : Ms(),
|
3342
3320
|
// True for both shallow and deep changes.
|
3343
3321
|
modified_: !1,
|
3344
3322
|
// Used during finalization.
|
@@ -3358,20 +3336,20 @@ function Gi(t, e) {
|
|
3358
3336
|
revoke_: null,
|
3359
3337
|
isManual_: !1
|
3360
3338
|
};
|
3361
|
-
let a = s, c =
|
3339
|
+
let a = s, c = Pn;
|
3362
3340
|
r && (a = [s], c = Ze);
|
3363
|
-
const { revoke:
|
3364
|
-
return s.draft_ = f, s.revoke_ =
|
3341
|
+
const { revoke: d, proxy: f } = Proxy.revocable(a, c);
|
3342
|
+
return s.draft_ = f, s.revoke_ = d, f;
|
3365
3343
|
}
|
3366
|
-
var
|
3344
|
+
var Pn = {
|
3367
3345
|
get(t, e) {
|
3368
3346
|
if (e === vt)
|
3369
3347
|
return t;
|
3370
3348
|
const r = pe(t);
|
3371
3349
|
if (!qe(r, e))
|
3372
|
-
return
|
3350
|
+
return Wi(t, r, e);
|
3373
3351
|
const s = r[e];
|
3374
|
-
return t.finalized_ || !Qt(s) ? s : s ===
|
3352
|
+
return t.finalized_ || !Qt(s) ? s : s === pn(t.base_, e) ? (hn(t), t.copy_[e] = An(s, t)) : s;
|
3375
3353
|
},
|
3376
3354
|
has(t, e) {
|
3377
3355
|
return e in pe(t);
|
@@ -3380,23 +3358,23 @@ var Rn = {
|
|
3380
3358
|
return Reflect.ownKeys(pe(t));
|
3381
3359
|
},
|
3382
3360
|
set(t, e, r) {
|
3383
|
-
const s =
|
3361
|
+
const s = Es(pe(t), e);
|
3384
3362
|
if (s != null && s.set)
|
3385
3363
|
return s.set.call(t.draft_, r), !0;
|
3386
3364
|
if (!t.modified_) {
|
3387
|
-
const a =
|
3365
|
+
const a = pn(pe(t), e), c = a == null ? void 0 : a[vt];
|
3388
3366
|
if (c && c.base_ === r)
|
3389
3367
|
return t.copy_[e] = r, t.assigned_[e] = !1, !0;
|
3390
|
-
if (
|
3368
|
+
if ($i(r, a) && (r !== void 0 || qe(t.base_, e)))
|
3391
3369
|
return !0;
|
3392
|
-
|
3370
|
+
hn(t), Tn(t);
|
3393
3371
|
}
|
3394
3372
|
return t.copy_[e] === r && // special case: handle new props with value 'undefined'
|
3395
3373
|
(r !== void 0 || e in t.copy_) || // special case: NaN
|
3396
3374
|
Number.isNaN(r) && Number.isNaN(t.copy_[e]) || (t.copy_[e] = r, t.assigned_[e] = !0), !0;
|
3397
3375
|
},
|
3398
3376
|
deleteProperty(t, e) {
|
3399
|
-
return
|
3377
|
+
return pn(t.base_, e) !== void 0 || e in t.base_ ? (t.assigned_[e] = !1, hn(t), Tn(t)) : delete t.assigned_[e], t.copy_ && delete t.copy_[e], !0;
|
3400
3378
|
},
|
3401
3379
|
// Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
3402
3380
|
// the same guarantee in ES5 mode.
|
@@ -3419,7 +3397,7 @@ var Rn = {
|
|
3419
3397
|
tt(12);
|
3420
3398
|
}
|
3421
3399
|
}, Ze = {};
|
3422
|
-
Ve(
|
3400
|
+
Ve(Pn, (t, e) => {
|
3423
3401
|
Ze[t] = function() {
|
3424
3402
|
return arguments[0] = arguments[0][0], e.apply(this, arguments);
|
3425
3403
|
};
|
@@ -3428,22 +3406,22 @@ Ze.deleteProperty = function(t, e) {
|
|
3428
3406
|
return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) && tt(13), Ze.set.call(this, t, e, void 0);
|
3429
3407
|
};
|
3430
3408
|
Ze.set = function(t, e, r) {
|
3431
|
-
return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) && tt(14),
|
3409
|
+
return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) && tt(14), Pn.set.call(this, t[0], e, r, t[0]);
|
3432
3410
|
};
|
3433
|
-
function
|
3411
|
+
function pn(t, e) {
|
3434
3412
|
const r = t[vt];
|
3435
3413
|
return (r ? pe(r) : t)[e];
|
3436
3414
|
}
|
3437
|
-
function
|
3415
|
+
function Wi(t, e, r) {
|
3438
3416
|
var a;
|
3439
|
-
const s =
|
3417
|
+
const s = Es(e, r);
|
3440
3418
|
return s ? "value" in s ? s.value : (
|
3441
3419
|
// This is a very special case, if the prop is a getter defined by the
|
3442
3420
|
// prototype, we should invoke it with the draft as context!
|
3443
3421
|
(a = s.get) == null ? void 0 : a.call(t.draft_)
|
3444
3422
|
) : void 0;
|
3445
3423
|
}
|
3446
|
-
function
|
3424
|
+
function Es(t, e) {
|
3447
3425
|
if (!(e in t))
|
3448
3426
|
return;
|
3449
3427
|
let r = me(t);
|
@@ -3454,64 +3432,64 @@ function Ds(t, e) {
|
|
3454
3432
|
r = me(r);
|
3455
3433
|
}
|
3456
3434
|
}
|
3457
|
-
function
|
3458
|
-
t.modified_ || (t.modified_ = !0, t.parent_ &&
|
3435
|
+
function Tn(t) {
|
3436
|
+
t.modified_ || (t.modified_ = !0, t.parent_ && Tn(t.parent_));
|
3459
3437
|
}
|
3460
|
-
function
|
3461
|
-
t.copy_ || (t.copy_ =
|
3438
|
+
function hn(t) {
|
3439
|
+
t.copy_ || (t.copy_ = Sn(
|
3462
3440
|
t.base_,
|
3463
3441
|
t.scope_.immer_.useStrictShallowCopy_
|
3464
3442
|
));
|
3465
3443
|
}
|
3466
|
-
var
|
3444
|
+
var Gi = class {
|
3467
3445
|
constructor(t) {
|
3468
3446
|
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.produce = (e, r, s) => {
|
3469
3447
|
if (typeof e == "function" && typeof r != "function") {
|
3470
3448
|
const c = r;
|
3471
3449
|
r = e;
|
3472
|
-
const
|
3450
|
+
const d = this;
|
3473
3451
|
return function(b = c, ..._) {
|
3474
|
-
return
|
3452
|
+
return d.produce(b, (M) => r.call(this, M, ..._));
|
3475
3453
|
};
|
3476
3454
|
}
|
3477
3455
|
typeof r != "function" && tt(6), s !== void 0 && typeof s != "function" && tt(7);
|
3478
3456
|
let a;
|
3479
3457
|
if (Qt(e)) {
|
3480
|
-
const c =
|
3458
|
+
const c = Vn(this), d = An(e, void 0);
|
3481
3459
|
let f = !0;
|
3482
3460
|
try {
|
3483
|
-
a = r(
|
3461
|
+
a = r(d), f = !1;
|
3484
3462
|
} finally {
|
3485
|
-
f ?
|
3463
|
+
f ? Mn(c) : En(c);
|
3486
3464
|
}
|
3487
|
-
return
|
3465
|
+
return Kn(c, s), qn(a, c);
|
3488
3466
|
} else if (!e || typeof e != "object") {
|
3489
|
-
if (a = r(e), a === void 0 && (a = e), a ===
|
3490
|
-
const c = [],
|
3491
|
-
Ie("Patches").generateReplacementPatches_(e, a, c,
|
3467
|
+
if (a = r(e), a === void 0 && (a = e), a === On && (a = void 0), this.autoFreeze_ && Cn(a, !0), s) {
|
3468
|
+
const c = [], d = [];
|
3469
|
+
Ie("Patches").generateReplacementPatches_(e, a, c, d), s(c, d);
|
3492
3470
|
}
|
3493
3471
|
return a;
|
3494
3472
|
} else
|
3495
3473
|
tt(1, e);
|
3496
3474
|
}, this.produceWithPatches = (e, r) => {
|
3497
3475
|
if (typeof e == "function")
|
3498
|
-
return (
|
3476
|
+
return (d, ...f) => this.produceWithPatches(d, (b) => e(b, ...f));
|
3499
3477
|
let s, a;
|
3500
|
-
return [this.produce(e, r, (
|
3501
|
-
s =
|
3478
|
+
return [this.produce(e, r, (d, f) => {
|
3479
|
+
s = d, a = f;
|
3502
3480
|
}), s, a];
|
3503
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);
|
3504
3482
|
}
|
3505
3483
|
createDraft(t) {
|
3506
|
-
Qt(t) || tt(8), ye(t) && (t =
|
3507
|
-
const e =
|
3508
|
-
return r[vt].isManual_ = !0,
|
3484
|
+
Qt(t) || tt(8), ye(t) && (t = Yi(t));
|
3485
|
+
const e = Vn(this), r = An(t, void 0);
|
3486
|
+
return r[vt].isManual_ = !0, En(e), r;
|
3509
3487
|
}
|
3510
3488
|
finishDraft(t, e) {
|
3511
3489
|
const r = t && t[vt];
|
3512
3490
|
(!r || !r.isManual_) && tt(9);
|
3513
3491
|
const { scope_: s } = r;
|
3514
|
-
return
|
3492
|
+
return Kn(s, e), qn(void 0, s);
|
3515
3493
|
}
|
3516
3494
|
/**
|
3517
3495
|
* Pass true to automatically freeze all copies created by Immer.
|
@@ -3546,14 +3524,14 @@ var Bi = class {
|
|
3546
3524
|
);
|
3547
3525
|
}
|
3548
3526
|
};
|
3549
|
-
function
|
3550
|
-
const r = tr(t) ? Ie("MapSet").proxyMap_(t, e) : er(t) ? Ie("MapSet").proxySet_(t, e) :
|
3551
|
-
return (e ? e.scope_ :
|
3527
|
+
function An(t, e) {
|
3528
|
+
const r = tr(t) ? Ie("MapSet").proxyMap_(t, e) : er(t) ? Ie("MapSet").proxySet_(t, e) : Ui(t, e);
|
3529
|
+
return (e ? e.scope_ : Ms()).drafts_.push(r), r;
|
3552
3530
|
}
|
3553
|
-
function
|
3554
|
-
return ye(t) || tt(10, t),
|
3531
|
+
function Yi(t) {
|
3532
|
+
return ye(t) || tt(10, t), Ts(t);
|
3555
3533
|
}
|
3556
|
-
function
|
3534
|
+
function Ts(t) {
|
3557
3535
|
if (!Qt(t) || Mr(t))
|
3558
3536
|
return t;
|
3559
3537
|
const e = t[vt];
|
@@ -3561,51 +3539,51 @@ function xs(t) {
|
|
3561
3539
|
if (e) {
|
3562
3540
|
if (!e.modified_)
|
3563
3541
|
return e.base_;
|
3564
|
-
e.finalized_ = !0, r =
|
3542
|
+
e.finalized_ = !0, r = Sn(t, e.scope_.immer_.useStrictShallowCopy_);
|
3565
3543
|
} else
|
3566
|
-
r =
|
3544
|
+
r = Sn(t, !0);
|
3567
3545
|
return Ve(r, (s, a) => {
|
3568
|
-
|
3546
|
+
ws(r, s, Ts(a));
|
3569
3547
|
}), e && (e.finalized_ = !1), r;
|
3570
3548
|
}
|
3571
|
-
function
|
3572
|
-
process.env.NODE_ENV !== "production" &&
|
3549
|
+
function Zn() {
|
3550
|
+
process.env.NODE_ENV !== "production" && ks.push(
|
3573
3551
|
'Sets cannot have "replace" patches.',
|
3574
|
-
function(
|
3575
|
-
return "Unsupported patch operation: " +
|
3552
|
+
function(m) {
|
3553
|
+
return "Unsupported patch operation: " + m;
|
3576
3554
|
},
|
3577
|
-
function(
|
3578
|
-
return "Cannot apply patch, path doesn't resolve: " +
|
3555
|
+
function(m) {
|
3556
|
+
return "Cannot apply patch, path doesn't resolve: " + m;
|
3579
3557
|
},
|
3580
3558
|
"Patching reserved attributes like __proto__, prototype and constructor is not allowed"
|
3581
3559
|
);
|
3582
3560
|
const e = "replace", r = "add", s = "remove";
|
3583
|
-
function a(
|
3584
|
-
switch (
|
3561
|
+
function a(m, T, C, u) {
|
3562
|
+
switch (m.type_) {
|
3585
3563
|
case 0:
|
3586
3564
|
case 2:
|
3587
|
-
return
|
3588
|
-
|
3565
|
+
return d(
|
3566
|
+
m,
|
3589
3567
|
T,
|
3590
3568
|
C,
|
3591
3569
|
u
|
3592
3570
|
);
|
3593
3571
|
case 1:
|
3594
|
-
return c(
|
3572
|
+
return c(m, T, C, u);
|
3595
3573
|
case 3:
|
3596
3574
|
return f(
|
3597
|
-
|
3575
|
+
m,
|
3598
3576
|
T,
|
3599
3577
|
C,
|
3600
3578
|
u
|
3601
3579
|
);
|
3602
3580
|
}
|
3603
3581
|
}
|
3604
|
-
function c(
|
3605
|
-
let { base_:
|
3606
|
-
w.length <
|
3607
|
-
for (let k = 0; k <
|
3608
|
-
if (S[k] && w[k] !==
|
3582
|
+
function c(m, T, C, u) {
|
3583
|
+
let { base_: l, assigned_: S } = m, w = m.copy_;
|
3584
|
+
w.length < l.length && ([l, w] = [w, l], [C, u] = [u, C]);
|
3585
|
+
for (let k = 0; k < l.length; k++)
|
3586
|
+
if (S[k] && w[k] !== l[k]) {
|
3609
3587
|
const h = T.concat([k]);
|
3610
3588
|
C.push({
|
3611
3589
|
op: e,
|
@@ -3616,10 +3594,10 @@ function Qn() {
|
|
3616
3594
|
}), u.push({
|
3617
3595
|
op: e,
|
3618
3596
|
path: h,
|
3619
|
-
value: E(
|
3597
|
+
value: E(l[k])
|
3620
3598
|
});
|
3621
3599
|
}
|
3622
|
-
for (let k =
|
3600
|
+
for (let k = l.length; k < w.length; k++) {
|
3623
3601
|
const h = T.concat([k]);
|
3624
3602
|
C.push({
|
3625
3603
|
op: r,
|
@@ -3629,7 +3607,7 @@ function Qn() {
|
|
3629
3607
|
value: E(w[k])
|
3630
3608
|
});
|
3631
3609
|
}
|
3632
|
-
for (let k = w.length - 1;
|
3610
|
+
for (let k = w.length - 1; l.length <= k; --k) {
|
3633
3611
|
const h = T.concat([k]);
|
3634
3612
|
u.push({
|
3635
3613
|
op: s,
|
@@ -3637,21 +3615,21 @@ function Qn() {
|
|
3637
3615
|
});
|
3638
3616
|
}
|
3639
3617
|
}
|
3640
|
-
function
|
3641
|
-
const { base_:
|
3642
|
-
Ve(
|
3643
|
-
const h =
|
3644
|
-
if (h ===
|
3618
|
+
function d(m, T, C, u) {
|
3619
|
+
const { base_: l, copy_: S } = m;
|
3620
|
+
Ve(m.assigned_, (w, k) => {
|
3621
|
+
const h = fn(l, w), y = fn(S, w), v = k ? qe(l, w) ? e : r : s;
|
3622
|
+
if (h === y && v === e)
|
3645
3623
|
return;
|
3646
3624
|
const I = T.concat(w);
|
3647
|
-
C.push(v === s ? { op: v, path: I } : { op: v, path: I, value:
|
3625
|
+
C.push(v === s ? { op: v, path: I } : { op: v, path: I, value: y }), u.push(
|
3648
3626
|
v === r ? { op: s, path: I } : v === s ? { op: r, path: I, value: E(h) } : { op: e, path: I, value: E(h) }
|
3649
3627
|
);
|
3650
3628
|
});
|
3651
3629
|
}
|
3652
|
-
function f(
|
3653
|
-
let { base_:
|
3654
|
-
|
3630
|
+
function f(m, T, C, u) {
|
3631
|
+
let { base_: l, copy_: S } = m, w = 0;
|
3632
|
+
l.forEach((k) => {
|
3655
3633
|
if (!S.has(k)) {
|
3656
3634
|
const h = T.concat([w]);
|
3657
3635
|
C.push({
|
@@ -3666,7 +3644,7 @@ function Qn() {
|
|
3666
3644
|
}
|
3667
3645
|
w++;
|
3668
3646
|
}), w = 0, S.forEach((k) => {
|
3669
|
-
if (!
|
3647
|
+
if (!l.has(k)) {
|
3670
3648
|
const h = T.concat([w]);
|
3671
3649
|
C.push({
|
3672
3650
|
op: r,
|
@@ -3681,28 +3659,28 @@ function Qn() {
|
|
3681
3659
|
w++;
|
3682
3660
|
});
|
3683
3661
|
}
|
3684
|
-
function b(
|
3662
|
+
function b(m, T, C, u) {
|
3685
3663
|
C.push({
|
3686
3664
|
op: e,
|
3687
3665
|
path: [],
|
3688
|
-
value: T ===
|
3666
|
+
value: T === On ? void 0 : T
|
3689
3667
|
}), u.push({
|
3690
3668
|
op: e,
|
3691
3669
|
path: [],
|
3692
|
-
value:
|
3670
|
+
value: m
|
3693
3671
|
});
|
3694
3672
|
}
|
3695
|
-
function _(
|
3673
|
+
function _(m, T) {
|
3696
3674
|
return T.forEach((C) => {
|
3697
|
-
const { path: u, op:
|
3698
|
-
let S =
|
3699
|
-
for (let
|
3675
|
+
const { path: u, op: l } = C;
|
3676
|
+
let S = m;
|
3677
|
+
for (let y = 0; y < u.length - 1; y++) {
|
3700
3678
|
const v = ge(S);
|
3701
|
-
let I = u[
|
3702
|
-
typeof I != "string" && typeof I != "number" && (I = "" + I), (v === 0 || v === 1) && (I === "__proto__" || I === "constructor") && tt(19), typeof S == "function" && I === "prototype" && tt(19), S =
|
3679
|
+
let I = u[y];
|
3680
|
+
typeof I != "string" && typeof I != "number" && (I = "" + I), (v === 0 || v === 1) && (I === "__proto__" || I === "constructor") && tt(19), typeof S == "function" && I === "prototype" && tt(19), S = fn(S, I), typeof S != "object" && tt(18, u.join("/"));
|
3703
3681
|
}
|
3704
3682
|
const w = ge(S), k = M(C.value), h = u[u.length - 1];
|
3705
|
-
switch (
|
3683
|
+
switch (l) {
|
3706
3684
|
case e:
|
3707
3685
|
switch (w) {
|
3708
3686
|
case 2:
|
@@ -3735,46 +3713,46 @@ function Qn() {
|
|
3735
3713
|
return delete S[h];
|
3736
3714
|
}
|
3737
3715
|
default:
|
3738
|
-
tt(17,
|
3716
|
+
tt(17, l);
|
3739
3717
|
}
|
3740
|
-
}),
|
3741
|
-
}
|
3742
|
-
function M(
|
3743
|
-
if (!Qt(
|
3744
|
-
return
|
3745
|
-
if (Array.isArray(
|
3746
|
-
return
|
3747
|
-
if (tr(
|
3718
|
+
}), m;
|
3719
|
+
}
|
3720
|
+
function M(m) {
|
3721
|
+
if (!Qt(m))
|
3722
|
+
return m;
|
3723
|
+
if (Array.isArray(m))
|
3724
|
+
return m.map(M);
|
3725
|
+
if (tr(m))
|
3748
3726
|
return new Map(
|
3749
|
-
Array.from(
|
3727
|
+
Array.from(m.entries()).map(([C, u]) => [C, M(u)])
|
3750
3728
|
);
|
3751
|
-
if (er(
|
3752
|
-
return new Set(Array.from(
|
3753
|
-
const T = Object.create(me(
|
3754
|
-
for (const C in
|
3755
|
-
T[C] = M(
|
3756
|
-
return qe(
|
3729
|
+
if (er(m))
|
3730
|
+
return new Set(Array.from(m).map(M));
|
3731
|
+
const T = Object.create(me(m));
|
3732
|
+
for (const C in m)
|
3733
|
+
T[C] = M(m[C]);
|
3734
|
+
return qe(m, Ke) && (T[Ke] = m[Ke]), T;
|
3757
3735
|
}
|
3758
|
-
function E(
|
3759
|
-
return ye(
|
3736
|
+
function E(m) {
|
3737
|
+
return ye(m) ? M(m) : m;
|
3760
3738
|
}
|
3761
|
-
|
3739
|
+
ji("Patches", {
|
3762
3740
|
applyPatches_: _,
|
3763
3741
|
generatePatches_: a,
|
3764
3742
|
generateReplacementPatches_: b
|
3765
3743
|
});
|
3766
3744
|
}
|
3767
|
-
var _t = new
|
3745
|
+
var _t = new Gi(), Bi = _t.produce;
|
3768
3746
|
_t.produceWithPatches.bind(
|
3769
3747
|
_t
|
3770
3748
|
);
|
3771
3749
|
_t.setAutoFreeze.bind(_t);
|
3772
3750
|
_t.setUseStrictShallowCopy.bind(_t);
|
3773
|
-
var
|
3751
|
+
var Xi = _t.applyPatches.bind(_t);
|
3774
3752
|
_t.createDraft.bind(_t);
|
3775
3753
|
_t.finishDraft.bind(_t);
|
3776
|
-
var
|
3777
|
-
function
|
3754
|
+
var Ki = 9007199254740991, Vi = "[object Arguments]", qi = "[object Function]", Ji = "[object GeneratorFunction]", Zi = "[object Symbol]", Qi = typeof St == "object" && St && St.Object === Object && St, ta = typeof self == "object" && self && self.Object === Object && self, ea = Qi || ta || Function("return this")();
|
3755
|
+
function ra(t, e, r) {
|
3778
3756
|
switch (r.length) {
|
3779
3757
|
case 0:
|
3780
3758
|
return t.call(e);
|
@@ -3787,92 +3765,92 @@ function ia(t, e, r) {
|
|
3787
3765
|
}
|
3788
3766
|
return t.apply(e, r);
|
3789
3767
|
}
|
3790
|
-
function
|
3768
|
+
function na(t, e) {
|
3791
3769
|
for (var r = -1, s = t ? t.length : 0, a = Array(s); ++r < s; )
|
3792
3770
|
a[r] = e(t[r], r, t);
|
3793
3771
|
return a;
|
3794
3772
|
}
|
3795
|
-
function
|
3773
|
+
function sa(t, e) {
|
3796
3774
|
for (var r = -1, s = e.length, a = t.length; ++r < s; )
|
3797
3775
|
t[a + r] = e[r];
|
3798
3776
|
return t;
|
3799
3777
|
}
|
3800
|
-
var
|
3801
|
-
function
|
3802
|
-
var c = -1,
|
3803
|
-
for (r || (r =
|
3778
|
+
var Rn = Object.prototype, ia = Rn.hasOwnProperty, zn = Rn.toString, Qn = ea.Symbol, aa = Rn.propertyIsEnumerable, ts = Qn ? Qn.isConcatSpreadable : void 0, es = Math.max;
|
3779
|
+
function oa(t, e, r, s, a) {
|
3780
|
+
var c = -1, d = t.length;
|
3781
|
+
for (r || (r = da), a || (a = []); ++c < d; ) {
|
3804
3782
|
var f = t[c];
|
3805
|
-
r(f) ?
|
3783
|
+
r(f) ? sa(a, f) : a[a.length] = f;
|
3806
3784
|
}
|
3807
3785
|
return a;
|
3808
3786
|
}
|
3809
|
-
function
|
3810
|
-
return t = Object(t),
|
3787
|
+
function ca(t, e) {
|
3788
|
+
return t = Object(t), ua(t, e, function(r, s) {
|
3811
3789
|
return s in t;
|
3812
3790
|
});
|
3813
3791
|
}
|
3814
|
-
function
|
3792
|
+
function ua(t, e, r) {
|
3815
3793
|
for (var s = -1, a = e.length, c = {}; ++s < a; ) {
|
3816
|
-
var
|
3817
|
-
r(f,
|
3794
|
+
var d = e[s], f = t[d];
|
3795
|
+
r(f, d) && (c[d] = f);
|
3818
3796
|
}
|
3819
3797
|
return c;
|
3820
3798
|
}
|
3821
|
-
function
|
3822
|
-
return e =
|
3823
|
-
for (var r = arguments, s = -1, a =
|
3799
|
+
function la(t, e) {
|
3800
|
+
return e = es(e === void 0 ? t.length - 1 : e, 0), function() {
|
3801
|
+
for (var r = arguments, s = -1, a = es(r.length - e, 0), c = Array(a); ++s < a; )
|
3824
3802
|
c[s] = r[e + s];
|
3825
3803
|
s = -1;
|
3826
|
-
for (var
|
3827
|
-
|
3828
|
-
return
|
3804
|
+
for (var d = Array(e + 1); ++s < e; )
|
3805
|
+
d[s] = r[s];
|
3806
|
+
return d[e] = c, ra(t, this, d);
|
3829
3807
|
};
|
3830
3808
|
}
|
3831
|
-
function
|
3832
|
-
return
|
3809
|
+
function da(t) {
|
3810
|
+
return ha(t) || pa(t) || !!(ts && t && t[ts]);
|
3833
3811
|
}
|
3834
|
-
function
|
3835
|
-
if (typeof t == "string" ||
|
3812
|
+
function fa(t) {
|
3813
|
+
if (typeof t == "string" || va(t))
|
3836
3814
|
return t;
|
3837
3815
|
var e = t + "";
|
3838
|
-
return e == "0" && 1 / t == -
|
3816
|
+
return e == "0" && 1 / t == -1 / 0 ? "-0" : e;
|
3839
3817
|
}
|
3840
|
-
function
|
3841
|
-
return
|
3818
|
+
function pa(t) {
|
3819
|
+
return ya(t) && ia.call(t, "callee") && (!aa.call(t, "callee") || zn.call(t) == Vi);
|
3842
3820
|
}
|
3843
|
-
var
|
3844
|
-
function
|
3845
|
-
return t != null &&
|
3821
|
+
var ha = Array.isArray;
|
3822
|
+
function ma(t) {
|
3823
|
+
return t != null && Ia(t.length) && !ga(t);
|
3846
3824
|
}
|
3847
|
-
function
|
3848
|
-
return
|
3825
|
+
function ya(t) {
|
3826
|
+
return As(t) && ma(t);
|
3849
3827
|
}
|
3850
|
-
function
|
3851
|
-
var e =
|
3852
|
-
return e ==
|
3828
|
+
function ga(t) {
|
3829
|
+
var e = ba(t) ? zn.call(t) : "";
|
3830
|
+
return e == qi || e == Ji;
|
3853
3831
|
}
|
3854
|
-
function
|
3855
|
-
return typeof t == "number" && t > -1 && t % 1 == 0 && t <=
|
3832
|
+
function Ia(t) {
|
3833
|
+
return typeof t == "number" && t > -1 && t % 1 == 0 && t <= Ki;
|
3856
3834
|
}
|
3857
|
-
function
|
3835
|
+
function ba(t) {
|
3858
3836
|
var e = typeof t;
|
3859
3837
|
return !!t && (e == "object" || e == "function");
|
3860
3838
|
}
|
3861
|
-
function
|
3839
|
+
function As(t) {
|
3862
3840
|
return !!t && typeof t == "object";
|
3863
3841
|
}
|
3864
|
-
function
|
3865
|
-
return typeof t == "symbol" ||
|
3842
|
+
function va(t) {
|
3843
|
+
return typeof t == "symbol" || As(t) && zn.call(t) == Zi;
|
3866
3844
|
}
|
3867
|
-
var
|
3868
|
-
return t == null ? {} :
|
3869
|
-
}),
|
3870
|
-
const
|
3845
|
+
var _a = la(function(t, e) {
|
3846
|
+
return t == null ? {} : ca(t, na(oa(e), fa));
|
3847
|
+
}), ka = _a;
|
3848
|
+
const rs = /* @__PURE__ */ xn(ka), Sa = {
|
3871
3849
|
width: 1080,
|
3872
3850
|
height: 1920
|
3873
|
-
},
|
3874
|
-
size:
|
3875
|
-
fps:
|
3851
|
+
}, wa = 30, Ma = {
|
3852
|
+
size: Sa,
|
3853
|
+
fps: wa,
|
3876
3854
|
tracks: [],
|
3877
3855
|
trackItemIds: [],
|
3878
3856
|
trackItemsMap: {},
|
@@ -3888,7 +3866,7 @@ const ns = /* @__PURE__ */ xn(Ma), Ea = {
|
|
3888
3866
|
activeIds: [],
|
3889
3867
|
trackItemDetailsMap: {},
|
3890
3868
|
structure: []
|
3891
|
-
},
|
3869
|
+
}, ns = [
|
3892
3870
|
"tracks",
|
3893
3871
|
"trackItemsMap",
|
3894
3872
|
"trackItemDetailsMap",
|
@@ -3897,7 +3875,7 @@ const ns = /* @__PURE__ */ xn(Ma), Ea = {
|
|
3897
3875
|
"trackItemIds",
|
3898
3876
|
"structure"
|
3899
3877
|
];
|
3900
|
-
class
|
3878
|
+
class eo {
|
3901
3879
|
constructor(e) {
|
3902
3880
|
le(this, "stateSubject");
|
3903
3881
|
le(this, "stateHistorySubject");
|
@@ -3905,14 +3883,14 @@ class so {
|
|
3905
3883
|
le(this, "undos", []);
|
3906
3884
|
le(this, "redos", []);
|
3907
3885
|
le(this, "listener");
|
3908
|
-
const r = Object.assign({},
|
3909
|
-
this.stateSubject = new
|
3886
|
+
const r = Object.assign({}, Ma, e);
|
3887
|
+
this.stateSubject = new Un(r), this.stateHistorySubject = new Un({
|
3910
3888
|
handleRedo: !1,
|
3911
3889
|
handleUndo: !1
|
3912
3890
|
}), this.prevState = r, this.initListeners();
|
3913
3891
|
}
|
3914
3892
|
initListeners() {
|
3915
|
-
|
3893
|
+
Ri(this);
|
3916
3894
|
}
|
3917
3895
|
destroyListeners() {
|
3918
3896
|
this.listener && this.listener.unsubscribe();
|
@@ -3921,7 +3899,7 @@ class so {
|
|
3921
3899
|
this.destroyListeners();
|
3922
3900
|
}
|
3923
3901
|
updateHistory(e, r) {
|
3924
|
-
const s =
|
3902
|
+
const s = rs(e, ns), a = rs(this.getState(), ns), c = _s(a, s);
|
3925
3903
|
c.length && (this.undos.push({ undos: c, type: r }), this.redos = []);
|
3926
3904
|
}
|
3927
3905
|
getStateHistory() {
|
@@ -3973,8 +3951,8 @@ class so {
|
|
3973
3951
|
return this.stateSubject.asObservable().subscribe((r) => {
|
3974
3952
|
const s = Object.keys(r.trackItemsMap).filter(
|
3975
3953
|
(a) => {
|
3976
|
-
const c = this.prevState.trackItemsMap[a],
|
3977
|
-
return c &&
|
3954
|
+
const c = this.prevState.trackItemsMap[a], d = r.trackItemsMap[a];
|
3955
|
+
return c && d && !Q(c.animations, d.animations);
|
3978
3956
|
}
|
3979
3957
|
);
|
3980
3958
|
e({ trackItemsMap: r.trackItemsMap, changedAnimationIds: s });
|
@@ -3984,12 +3962,12 @@ class so {
|
|
3984
3962
|
return this.stateSubject.asObservable().subscribe((r) => {
|
3985
3963
|
if (!Q(r.trackItemsMap, this.prevState.trackItemsMap)) {
|
3986
3964
|
const s = Object.keys(r.trackItemsMap).filter((c) => {
|
3987
|
-
const
|
3988
|
-
return
|
3965
|
+
const d = this.prevState.trackItemsMap[c], f = r.trackItemsMap[c];
|
3966
|
+
return d && f && !Q(d.trim, f.trim);
|
3989
3967
|
}), a = Object.keys(r.trackItemsMap).filter(
|
3990
3968
|
(c) => {
|
3991
|
-
const
|
3992
|
-
return
|
3969
|
+
const d = this.prevState.trackItemsMap[c], f = r.trackItemsMap[c];
|
3970
|
+
return d && f && !Q(d.display, f.display);
|
3993
3971
|
}
|
3994
3972
|
);
|
3995
3973
|
e({
|
@@ -4025,8 +4003,8 @@ class so {
|
|
4025
4003
|
}
|
4026
4004
|
subscribeToAddOrRemoveItems(e) {
|
4027
4005
|
return this.stateSubject.asObservable().subscribe((r) => {
|
4028
|
-
const s = [...r.trackItemIds].sort(), a = [...this.prevState.trackItemIds].sort(), c = [...r.transitionIds].sort(),
|
4029
|
-
(!Q(s, a) || !Q(c,
|
4006
|
+
const s = [...r.trackItemIds].sort(), a = [...this.prevState.trackItemIds].sort(), c = [...r.transitionIds].sort(), d = [...this.prevState.transitionIds].sort();
|
4007
|
+
(!Q(s, a) || !Q(c, d)) && e({ trackItemIds: r.trackItemIds });
|
4030
4008
|
});
|
4031
4009
|
}
|
4032
4010
|
// Selectively subscribe to activeIds changes
|
@@ -4037,12 +4015,12 @@ class so {
|
|
4037
4015
|
}
|
4038
4016
|
subscribeToTracks(e) {
|
4039
4017
|
return this.stateSubject.asObservable().subscribe((r) => {
|
4040
|
-
const s = r.tracks, c = this.prevState.tracks.map((f) => f.id),
|
4018
|
+
const s = r.tracks, c = this.prevState.tracks.map((f) => f.id), d = s.filter(
|
4041
4019
|
(f) => !c.includes(f.id)
|
4042
4020
|
);
|
4043
|
-
|
4021
|
+
d.length && e({
|
4044
4022
|
tracks: r.tracks,
|
4045
|
-
changedTracks:
|
4023
|
+
changedTracks: d.map((f) => f.id)
|
4046
4024
|
});
|
4047
4025
|
});
|
4048
4026
|
}
|
@@ -4066,11 +4044,11 @@ class so {
|
|
4066
4044
|
undo() {
|
4067
4045
|
const e = this.undos.pop(), r = e == null ? void 0 : e.undos, s = e == null ? void 0 : e.type;
|
4068
4046
|
if (!r || !s) return;
|
4069
|
-
|
4047
|
+
Zn();
|
4070
4048
|
const {
|
4071
4049
|
trackItemDetailsMap: a,
|
4072
4050
|
trackItemIds: c,
|
4073
|
-
tracks:
|
4051
|
+
tracks: d,
|
4074
4052
|
transitionIds: f,
|
4075
4053
|
transitionsMap: b,
|
4076
4054
|
trackItemsMap: _,
|
@@ -4078,36 +4056,36 @@ class so {
|
|
4078
4056
|
} = this.getState(), E = K({
|
4079
4057
|
trackItemDetailsMap: a,
|
4080
4058
|
trackItemIds: c,
|
4081
|
-
tracks:
|
4059
|
+
tracks: d,
|
4082
4060
|
transitionIds: f,
|
4083
4061
|
transitionsMap: b,
|
4084
4062
|
trackItemsMap: _,
|
4085
4063
|
structure: M
|
4086
|
-
}),
|
4064
|
+
}), m = [], T = [], C = [], u = [], l = [], S = [], w = [];
|
4087
4065
|
r.forEach((R) => {
|
4088
|
-
let
|
4066
|
+
let F;
|
4089
4067
|
const V = R.path.slice(1);
|
4090
|
-
R.type === "CREATE" ?
|
4068
|
+
R.type === "CREATE" ? F = {
|
4091
4069
|
path: V,
|
4092
4070
|
op: "remove",
|
4093
4071
|
value: R.value
|
4094
|
-
} : R.type === "CHANGE" ?
|
4072
|
+
} : R.type === "CHANGE" ? F = {
|
4095
4073
|
path: V,
|
4096
4074
|
op: "replace",
|
4097
4075
|
value: R.oldValue
|
4098
|
-
} :
|
4076
|
+
} : F = {
|
4099
4077
|
path: V,
|
4100
4078
|
op: "add",
|
4101
4079
|
value: R.oldValue
|
4102
|
-
}, R.path.includes("trackItemIds") ? C.push(
|
4080
|
+
}, R.path.includes("trackItemIds") ? C.push(F) : R.path.includes("transitionIds") ? T.push(F) : R.path.includes("trackItemsMap") ? l.push(F) : R.path.includes("transitionsMap") ? u.push(F) : R.path.includes("tracks") ? m.push(F) : R.path.includes("trackItemDetailsMap") ? S.push(F) : R.path.includes("structure") && w.push(F);
|
4103
4081
|
});
|
4104
4082
|
const k = this.applyPatch(
|
4105
4083
|
E.tracks,
|
4106
|
-
|
4084
|
+
m
|
4107
4085
|
), h = this.applyPatch(
|
4108
4086
|
E.transitionIds,
|
4109
4087
|
T
|
4110
|
-
),
|
4088
|
+
), y = this.applyPatch(
|
4111
4089
|
E.trackItemIds,
|
4112
4090
|
C
|
4113
4091
|
), v = this.applyPatch(
|
@@ -4115,7 +4093,7 @@ class so {
|
|
4115
4093
|
u
|
4116
4094
|
), I = this.applyPatch(
|
4117
4095
|
E.trackItemsMap,
|
4118
|
-
|
4096
|
+
l
|
4119
4097
|
), x = this.applyPatch(
|
4120
4098
|
E.trackItemDetailsMap,
|
4121
4099
|
S
|
@@ -4125,29 +4103,29 @@ class so {
|
|
4125
4103
|
), O = K({
|
4126
4104
|
tracks: k,
|
4127
4105
|
transitionIds: h,
|
4128
|
-
trackItemIds:
|
4106
|
+
trackItemIds: y,
|
4129
4107
|
transitionsMap: v,
|
4130
4108
|
trackItemsMap: I,
|
4131
4109
|
trackItemDetailsMap: x,
|
4132
4110
|
structure: g
|
4133
|
-
}), D = K(this.getState()),
|
4111
|
+
}), D = K(this.getState()), j = { ...D, ...O };
|
4134
4112
|
this.prevState = D, this.redos.push({ redos: r, type: s });
|
4135
|
-
const L = he(
|
4136
|
-
this.stateSubject.next({ ...
|
4113
|
+
const L = he(j.trackItemsMap);
|
4114
|
+
this.stateSubject.next({ ...j, duration: L }), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 }), this.updateState(j, { updateHistory: !1 });
|
4137
4115
|
}
|
4138
4116
|
applyPatch(e, r) {
|
4139
|
-
return r.reverse().reduce((s, a) =>
|
4140
|
-
|
4117
|
+
return r.reverse().reduce((s, a) => Bi(s, (c) => {
|
4118
|
+
Xi(c, [a]);
|
4141
4119
|
}), e);
|
4142
4120
|
}
|
4143
4121
|
redo() {
|
4144
4122
|
const e = this.redos.pop(), r = e == null ? void 0 : e.redos, s = e == null ? void 0 : e.type;
|
4145
4123
|
if (!r || !s) return;
|
4146
|
-
|
4124
|
+
Zn();
|
4147
4125
|
const {
|
4148
4126
|
trackItemDetailsMap: a,
|
4149
4127
|
trackItemIds: c,
|
4150
|
-
tracks:
|
4128
|
+
tracks: d,
|
4151
4129
|
transitionIds: f,
|
4152
4130
|
transitionsMap: b,
|
4153
4131
|
trackItemsMap: _,
|
@@ -4155,36 +4133,36 @@ class so {
|
|
4155
4133
|
} = this.getState(), E = K({
|
4156
4134
|
trackItemDetailsMap: a,
|
4157
4135
|
trackItemIds: c,
|
4158
|
-
tracks:
|
4136
|
+
tracks: d,
|
4159
4137
|
transitionIds: f,
|
4160
4138
|
transitionsMap: b,
|
4161
4139
|
trackItemsMap: _,
|
4162
4140
|
structure: M
|
4163
|
-
}),
|
4141
|
+
}), m = [], T = [], C = [], u = [], l = [], S = [], w = [];
|
4164
4142
|
r.forEach((R) => {
|
4165
|
-
let
|
4143
|
+
let F;
|
4166
4144
|
const V = R.path.slice(1);
|
4167
|
-
R.type === "CREATE" ?
|
4145
|
+
R.type === "CREATE" ? F = {
|
4168
4146
|
path: V,
|
4169
4147
|
op: "add",
|
4170
4148
|
value: R.value
|
4171
|
-
} : R.type === "CHANGE" ?
|
4149
|
+
} : R.type === "CHANGE" ? F = {
|
4172
4150
|
path: V,
|
4173
4151
|
op: "replace",
|
4174
4152
|
value: R.value
|
4175
|
-
} :
|
4153
|
+
} : F = {
|
4176
4154
|
path: V,
|
4177
4155
|
op: "remove",
|
4178
4156
|
value: R.oldValue
|
4179
|
-
}, R.path.includes("trackItemIds") ? C.push(
|
4157
|
+
}, R.path.includes("trackItemIds") ? C.push(F) : R.path.includes("transitionIds") ? T.push(F) : R.path.includes("trackItemsMap") ? l.push(F) : R.path.includes("transitionsMap") ? u.push(F) : R.path.includes("trackItemDetailsMap") ? S.push(F) : R.path.includes("structure") ? w.push(F) : m.push(F);
|
4180
4158
|
});
|
4181
4159
|
const k = this.applyPatch(
|
4182
4160
|
E.tracks,
|
4183
|
-
|
4161
|
+
m
|
4184
4162
|
), h = this.applyPatch(
|
4185
4163
|
E.transitionIds,
|
4186
4164
|
T
|
4187
|
-
),
|
4165
|
+
), y = this.applyPatch(
|
4188
4166
|
E.trackItemIds,
|
4189
4167
|
C
|
4190
4168
|
), v = this.applyPatch(
|
@@ -4192,7 +4170,7 @@ class so {
|
|
4192
4170
|
u
|
4193
4171
|
), I = this.applyPatch(
|
4194
4172
|
E.trackItemsMap,
|
4195
|
-
|
4173
|
+
l
|
4196
4174
|
), x = this.applyPatch(
|
4197
4175
|
E.trackItemDetailsMap,
|
4198
4176
|
S
|
@@ -4202,15 +4180,15 @@ class so {
|
|
4202
4180
|
), O = K({
|
4203
4181
|
tracks: k,
|
4204
4182
|
transitionIds: h,
|
4205
|
-
trackItemIds:
|
4183
|
+
trackItemIds: y,
|
4206
4184
|
transitionsMap: v,
|
4207
4185
|
trackItemsMap: I,
|
4208
4186
|
trackItemDetailsMap: x,
|
4209
4187
|
structure: g
|
4210
|
-
}), D = K(this.getState()),
|
4188
|
+
}), D = K(this.getState()), j = { ...D, ...O };
|
4211
4189
|
this.prevState = D, this.undos.push({ undos: r, type: s });
|
4212
|
-
const L = he(
|
4213
|
-
this.stateSubject.next({ ...
|
4190
|
+
const L = he(j.trackItemsMap);
|
4191
|
+
this.stateSubject.next({ ...j, duration: L }), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 }), this.updateState(j, { updateHistory: !1 });
|
4214
4192
|
}
|
4215
4193
|
toJSON() {
|
4216
4194
|
const {
|
@@ -4219,7 +4197,7 @@ class so {
|
|
4219
4197
|
size: s,
|
4220
4198
|
trackItemDetailsMap: a,
|
4221
4199
|
trackItemIds: c,
|
4222
|
-
transitionsMap:
|
4200
|
+
transitionsMap: d,
|
4223
4201
|
trackItemsMap: f,
|
4224
4202
|
transitionIds: b
|
4225
4203
|
} = this.getState();
|
@@ -4229,73 +4207,73 @@ class so {
|
|
4229
4207
|
size: s,
|
4230
4208
|
trackItemDetailsMap: a,
|
4231
4209
|
trackItemIds: c,
|
4232
|
-
transitionsMap:
|
4210
|
+
transitionsMap: d,
|
4233
4211
|
trackItemsMap: f,
|
4234
4212
|
transitionIds: b
|
4235
4213
|
};
|
4236
4214
|
}
|
4237
4215
|
}
|
4238
4216
|
export {
|
4239
|
-
|
4240
|
-
|
4241
|
-
|
4217
|
+
ui as ACTIVE_CLONE,
|
4218
|
+
La as ACTIVE_DELETE,
|
4219
|
+
ci as ACTIVE_PASTE,
|
4242
4220
|
Ce as ACTIVE_PREFIX,
|
4243
|
-
|
4244
|
-
|
4245
|
-
|
4246
|
-
|
4247
|
-
|
4248
|
-
|
4249
|
-
|
4250
|
-
|
4251
|
-
|
4252
|
-
|
4253
|
-
|
4221
|
+
Ha as ACTIVE_SET,
|
4222
|
+
li as ACTIVE_SPLIT,
|
4223
|
+
ei as ADD_ANIMATION,
|
4224
|
+
Js as ADD_AUDIO,
|
4225
|
+
ri as ADD_CAPTIONS,
|
4226
|
+
ii as ADD_COMPOSITION,
|
4227
|
+
Qs as ADD_ILLUSTRATION,
|
4228
|
+
Zs as ADD_IMAGE,
|
4229
|
+
si as ADD_ITEMS,
|
4230
|
+
Pa as ADD_MASK,
|
4231
|
+
Ca as ADD_PLACEHOLDER,
|
4254
4232
|
gt as ADD_PREFIX,
|
4255
|
-
|
4256
|
-
|
4257
|
-
|
4258
|
-
|
4259
|
-
|
4260
|
-
|
4261
|
-
|
4262
|
-
|
4263
|
-
|
4264
|
-
|
4265
|
-
|
4233
|
+
ti as ADD_SHAPE,
|
4234
|
+
Aa as ADD_SUFFIX,
|
4235
|
+
ni as ADD_TEMPLATE,
|
4236
|
+
Vs as ADD_TEXT,
|
4237
|
+
Ra as ADD_TRANSITION,
|
4238
|
+
qs as ADD_VIDEO,
|
4239
|
+
Na as DELETE_TEMPLATE_ITEM,
|
4240
|
+
Xs as DESIGN_LOAD,
|
4241
|
+
Dn as DESIGN_PREFIX,
|
4242
|
+
Ks as DESIGN_RESIZE,
|
4243
|
+
ai as EDIT_OBJECT,
|
4266
4244
|
be as EDIT_PREFIX,
|
4267
|
-
|
4268
|
-
|
4269
|
-
|
4270
|
-
|
4245
|
+
Fa as EDIT_SHAPE,
|
4246
|
+
$a as EDIT_TEMPLATE_ITEM,
|
4247
|
+
za as EDIT_TEXT,
|
4248
|
+
ja as ENTER_EDIT_MODE,
|
4271
4249
|
Sr as HISTORY_PREFIX,
|
4272
|
-
|
4273
|
-
|
4274
|
-
|
4275
|
-
|
4276
|
-
|
4277
|
-
|
4278
|
-
|
4279
|
-
|
4280
|
-
|
4281
|
-
|
4282
|
-
|
4283
|
-
|
4250
|
+
mi as HISTORY_REDO,
|
4251
|
+
to as HISTORY_RESET,
|
4252
|
+
hi as HISTORY_UNDO,
|
4253
|
+
di as LAYER_CLONE,
|
4254
|
+
qa as LAYER_COPY,
|
4255
|
+
Qa as LAYER_CUT,
|
4256
|
+
fi as LAYER_DELETE,
|
4257
|
+
Va as LAYER_EDITING_NAME,
|
4258
|
+
Wa as LAYER_HIDDEN,
|
4259
|
+
Ua as LAYER_LOCKED,
|
4260
|
+
Ga as LAYER_MOVE,
|
4261
|
+
Ja as LAYER_PASTE,
|
4284
4262
|
pt as LAYER_PREFIX,
|
4285
|
-
|
4286
|
-
|
4287
|
-
|
4288
|
-
|
4289
|
-
|
4290
|
-
|
4291
|
-
|
4292
|
-
|
4293
|
-
|
4294
|
-
|
4295
|
-
|
4296
|
-
|
4297
|
-
|
4298
|
-
|
4299
|
-
|
4300
|
-
|
4263
|
+
Ka as LAYER_RENAME,
|
4264
|
+
pi as LAYER_REPLACE,
|
4265
|
+
Ya as LAYER_SELECT,
|
4266
|
+
Ba as LAYER_SELECTION,
|
4267
|
+
Xa as LAYER_SEND_TO,
|
4268
|
+
Za as LAYER_SPLIT,
|
4269
|
+
oi as REPLACE_MEDIA,
|
4270
|
+
Oa as STATE_CHANGED,
|
4271
|
+
Bs as STATE_PREFIX,
|
4272
|
+
yi as TIMELINE_SCALE_CHANGED,
|
4273
|
+
us as TIMELINE_SCALE_PREFIX,
|
4274
|
+
xa as TRACKS_CHANGED,
|
4275
|
+
Da as TRACK_ITEMS_CHANGED,
|
4276
|
+
Ys as TRACK_ITEMS_PREFIX,
|
4277
|
+
Gs as TRACK_PREFIX,
|
4278
|
+
eo as default
|
4301
4279
|
};
|