@video-editor/protocol 0.0.1-beta.23 → 0.0.1-beta.24

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.
Files changed (2) hide show
  1. package/dist/index.js +182 -184
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -411,7 +411,7 @@ function X() {
411
411
  let O = B.length;
412
412
  for (; O--; ) {
413
413
  const N = B[O];
414
- N.optimizeNames(x, A) || (Z(x, N.names), B.splice(O, 1));
414
+ N.optimizeNames(x, A) || (W(x, N.names), B.splice(O, 1));
415
415
  }
416
416
  return B.length > 0 ? this : void 0;
417
417
  }
@@ -790,7 +790,7 @@ function X() {
790
790
  return N instanceof o._Code && N._items.some((q) => q instanceof o.Name && x[q.str] === 1 && A[q.str] !== void 0);
791
791
  }
792
792
  }
793
- function Z(T, x) {
793
+ function W(T, x) {
794
794
  for (const A in x)
795
795
  T[A] = (T[A] || 0) - (x[A] || 0);
796
796
  }
@@ -1100,7 +1100,7 @@ function bl() {
1100
1100
  }
1101
1101
  return Ge;
1102
1102
  }
1103
- var ce = {}, qe = {}, Gn;
1103
+ var pe = {}, qe = {}, Gn;
1104
1104
  function Co() {
1105
1105
  if (Gn) return qe;
1106
1106
  Gn = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.getRules = qe.isJSONType = void 0;
@@ -1147,13 +1147,13 @@ function ko() {
1147
1147
  }
1148
1148
  var Vn;
1149
1149
  function yr() {
1150
- if (Vn) return ce;
1151
- Vn = 1, Object.defineProperty(ce, "__esModule", { value: !0 }), ce.reportTypeError = ce.checkDataTypes = ce.checkDataType = ce.coerceAndCheckDataType = ce.getJSONTypes = ce.getSchemaTypes = ce.DataType = void 0;
1150
+ if (Vn) return pe;
1151
+ Vn = 1, Object.defineProperty(pe, "__esModule", { value: !0 }), pe.reportTypeError = pe.checkDataTypes = pe.checkDataType = pe.coerceAndCheckDataType = pe.getJSONTypes = pe.getSchemaTypes = pe.DataType = void 0;
1152
1152
  const l = Co(), o = ko(), c = Xt(), u = X(), _ = ne();
1153
1153
  var h;
1154
1154
  (function(d) {
1155
1155
  d[d.Correct = 0] = "Correct", d[d.Wrong = 1] = "Wrong";
1156
- })(h || (ce.DataType = h = {}));
1156
+ })(h || (pe.DataType = h = {}));
1157
1157
  function g(d) {
1158
1158
  const p = n(d.type);
1159
1159
  if (p.includes("null")) {
@@ -1166,14 +1166,14 @@ function yr() {
1166
1166
  }
1167
1167
  return p;
1168
1168
  }
1169
- ce.getSchemaTypes = g;
1169
+ pe.getSchemaTypes = g;
1170
1170
  function n(d) {
1171
1171
  const p = Array.isArray(d) ? d : d ? [d] : [];
1172
1172
  if (p.every(l.isJSONType))
1173
1173
  return p;
1174
1174
  throw new Error("type must be JSONType or JSONType[]: " + p.join(","));
1175
1175
  }
1176
- ce.getJSONTypes = n;
1176
+ pe.getJSONTypes = n;
1177
1177
  function v(d, p) {
1178
1178
  const { gen: m, data: b, opts: w } = d, U = y(p, w.coerceTypes), P = p.length > 0 && !(U.length === 0 && p.length === 1 && (0, o.schemaHasRulesForType)(d, p[0]));
1179
1179
  if (P) {
@@ -1184,7 +1184,7 @@ function yr() {
1184
1184
  }
1185
1185
  return P;
1186
1186
  }
1187
- ce.coerceAndCheckDataType = v;
1187
+ pe.coerceAndCheckDataType = v;
1188
1188
  const S = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
1189
1189
  function y(d, p) {
1190
1190
  return p ? d.filter((m) => S.has(m) || p === "array" && m === "array") : [];
@@ -1251,7 +1251,7 @@ function yr() {
1251
1251
  return (0, u.and)((0, u._)`typeof ${p} == "number"`, C, m ? (0, u._)`isFinite(${p})` : u.nil);
1252
1252
  }
1253
1253
  }
1254
- ce.checkDataType = a;
1254
+ pe.checkDataType = a;
1255
1255
  function e(d, p, m, b) {
1256
1256
  if (d.length === 1)
1257
1257
  return a(d[0], p, m, b);
@@ -1267,7 +1267,7 @@ function yr() {
1267
1267
  w = (0, u.and)(w, a(P, p, m, b));
1268
1268
  return w;
1269
1269
  }
1270
- ce.checkDataTypes = e;
1270
+ pe.checkDataTypes = e;
1271
1271
  const r = {
1272
1272
  message: ({ schema: d }) => `must be ${d}`,
1273
1273
  params: ({ schema: d, schemaValue: p }) => typeof d == "string" ? (0, u._)`{type: ${d}}` : (0, u._)`{type: ${p}}`
@@ -1276,7 +1276,7 @@ function yr() {
1276
1276
  const p = f(d);
1277
1277
  (0, c.reportError)(p, r);
1278
1278
  }
1279
- ce.reportTypeError = s;
1279
+ pe.reportTypeError = s;
1280
1280
  function f(d) {
1281
1281
  const { gen: p, data: m, schema: b } = d, w = (0, _.schemaRefOrVal)(d, b, "type");
1282
1282
  return {
@@ -1291,7 +1291,7 @@ function yr() {
1291
1291
  it: d
1292
1292
  };
1293
1293
  }
1294
- return ce;
1294
+ return pe;
1295
1295
  }
1296
1296
  var ct = {}, Hn;
1297
1297
  function wl() {
@@ -1470,8 +1470,8 @@ function Sl() {
1470
1470
  return r.assign(G, null), F(l.nil), G;
1471
1471
  }
1472
1472
  function F(G = a.async ? (0, l._)`await ` : l.nil) {
1473
- const H = m.opts.passContext ? o.default.this : o.default.self, Z = !("compile" in a && !p || a.schema === !1);
1474
- r.assign(U, (0, l._)`${G}${(0, c.callValidateCode)(t, w, H, Z)}`, a.modifying);
1473
+ const H = m.opts.passContext ? o.default.this : o.default.self, W = !("compile" in a && !p || a.schema === !1);
1474
+ r.assign(U, (0, l._)`${G}${(0, c.callValidateCode)(t, w, H, W)}`, a.modifying);
1475
1475
  }
1476
1476
  function M(G) {
1477
1477
  var H;
@@ -1574,7 +1574,7 @@ function xl() {
1574
1574
  }
1575
1575
  return Ce.extendSubschemaMode = _, Ce;
1576
1576
  }
1577
- var pe = {}, Nr, Zn;
1577
+ var _e = {}, Nr, Zn;
1578
1578
  function yn() {
1579
1579
  return Zn || (Zn = 1, Nr = function l(o, c) {
1580
1580
  if (o === c) return !0;
@@ -1679,8 +1679,8 @@ function Ul() {
1679
1679
  }
1680
1680
  var Jn;
1681
1681
  function Tr() {
1682
- if (Jn) return pe;
1683
- Jn = 1, Object.defineProperty(pe, "__esModule", { value: !0 }), pe.getSchemaRefs = pe.resolveUrl = pe.normalizeId = pe._getFullPath = pe.getFullPath = pe.inlineRef = void 0;
1682
+ if (Jn) return _e;
1683
+ Jn = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.getSchemaRefs = _e.resolveUrl = _e.normalizeId = _e._getFullPath = _e.getFullPath = _e.inlineRef = void 0;
1684
1684
  const l = ne(), o = yn(), c = Ul(), u = /* @__PURE__ */ new Set([
1685
1685
  "type",
1686
1686
  "format",
@@ -1702,7 +1702,7 @@ function Tr() {
1702
1702
  function _(r, s = !0) {
1703
1703
  return typeof r == "boolean" ? !0 : s === !0 ? !g(r) : s ? n(r) <= s : !1;
1704
1704
  }
1705
- pe.inlineRef = _;
1705
+ _e.inlineRef = _;
1706
1706
  const h = /* @__PURE__ */ new Set([
1707
1707
  "$ref",
1708
1708
  "$recursiveRef",
@@ -1735,20 +1735,20 @@ function Tr() {
1735
1735
  const d = r.parse(s);
1736
1736
  return S(r, d);
1737
1737
  }
1738
- pe.getFullPath = v;
1738
+ _e.getFullPath = v;
1739
1739
  function S(r, s) {
1740
1740
  return r.serialize(s).split("#")[0] + "#";
1741
1741
  }
1742
- pe._getFullPath = S;
1742
+ _e._getFullPath = S;
1743
1743
  const y = /#\/?$/;
1744
1744
  function E(r) {
1745
1745
  return r ? r.replace(y, "") : "";
1746
1746
  }
1747
- pe.normalizeId = E;
1747
+ _e.normalizeId = E;
1748
1748
  function t(r, s, f) {
1749
1749
  return f = E(f), r.resolve(s, f);
1750
1750
  }
1751
- pe.resolveUrl = t;
1751
+ _e.resolveUrl = t;
1752
1752
  const a = /^[a-z_][-a-z0-9._]*$/i;
1753
1753
  function e(r, s) {
1754
1754
  if (typeof r == "boolean")
@@ -1758,11 +1758,11 @@ function Tr() {
1758
1758
  if (G === void 0)
1759
1759
  return;
1760
1760
  const H = b + F;
1761
- let Z = m[G];
1762
- typeof L[f] == "string" && (Z = Q.call(this, L[f])), ie.call(this, L.$anchor), ie.call(this, L.$dynamicAnchor), m[F] = Z;
1761
+ let W = m[G];
1762
+ typeof L[f] == "string" && (W = Q.call(this, L[f])), ie.call(this, L.$anchor), ie.call(this, L.$dynamicAnchor), m[F] = W;
1763
1763
  function Q(J) {
1764
1764
  const j = this.opts.uriResolver.resolve;
1765
- if (J = E(Z ? j(Z, J) : J), U.has(J))
1765
+ if (J = E(W ? j(W, J) : J), U.has(J))
1766
1766
  throw C(J);
1767
1767
  U.add(J);
1768
1768
  let D = this.refs[J];
@@ -1784,7 +1784,7 @@ function Tr() {
1784
1784
  return new Error(`reference "${L}" resolves to more than one schema`);
1785
1785
  }
1786
1786
  }
1787
- return pe.getSchemaRefs = e, pe;
1787
+ return _e.getSchemaRefs = e, _e;
1788
1788
  }
1789
1789
  var Qn;
1790
1790
  function Jt() {
@@ -1799,10 +1799,10 @@ function Jt() {
1799
1799
  a(z, () => (0, l.topBoolOrEmptySchema)(z));
1800
1800
  }
1801
1801
  Pe.validateFunctionCode = t;
1802
- function a({ gen: z, validateName: R, schema: $, schemaEnv: V, opts: Y }, W) {
1802
+ function a({ gen: z, validateName: R, schema: $, schemaEnv: V, opts: Y }, Z) {
1803
1803
  Y.code.es5 ? z.func(R, (0, n._)`${v.default.data}, ${v.default.valCxt}`, V.$async, () => {
1804
- z.code((0, n._)`"use strict"; ${d($, Y)}`), r(z, Y), z.code(W);
1805
- }) : z.func(R, (0, n._)`${v.default.data}, ${e(Y)}`, V.$async, () => z.code(d($, Y)).code(W));
1804
+ z.code((0, n._)`"use strict"; ${d($, Y)}`), r(z, Y), z.code(Z);
1805
+ }) : z.func(R, (0, n._)`${v.default.data}, ${e(Y)}`, V.$async, () => z.code(d($, Y)).code(Z));
1806
1806
  }
1807
1807
  function e(z) {
1808
1808
  return (0, n._)`{${v.default.instancePath}="", ${v.default.parentData}, ${v.default.parentDataProperty}, ${v.default.rootData}=${v.default.data}${z.dynamicRef ? (0, n._)`, ${v.default.dynamicAnchors}={}` : n.nil}}={}`;
@@ -1849,8 +1849,8 @@ function Jt() {
1849
1849
  function w(z, R) {
1850
1850
  const { schema: $, gen: V, opts: Y } = z;
1851
1851
  Y.$comment && $.$comment && G(z), F(z), M(z);
1852
- const W = V.const("_errs", v.default.errors);
1853
- P(z, W), V.var(R, (0, n._)`${W} === ${v.default.errors}`);
1852
+ const Z = V.const("_errs", v.default.errors);
1853
+ P(z, Z), V.var(R, (0, n._)`${Z} === ${v.default.errors}`);
1854
1854
  }
1855
1855
  function U(z) {
1856
1856
  (0, y.checkUnknownRules)(z), C(z);
@@ -1878,41 +1878,41 @@ function Jt() {
1878
1878
  throw new Error("async schema in sync schema");
1879
1879
  }
1880
1880
  function G({ gen: z, schemaEnv: R, schema: $, errSchemaPath: V, opts: Y }) {
1881
- const W = $.$comment;
1881
+ const Z = $.$comment;
1882
1882
  if (Y.$comment === !0)
1883
- z.code((0, n._)`${v.default.self}.logger.log(${W})`);
1883
+ z.code((0, n._)`${v.default.self}.logger.log(${Z})`);
1884
1884
  else if (typeof Y.$comment == "function") {
1885
- const se = (0, n.str)`${V}/$comment`, oe = z.scopeValue("root", { ref: R.root });
1886
- z.code((0, n._)`${v.default.self}.opts.$comment(${W}, ${se}, ${oe}.schema)`);
1885
+ const oe = (0, n.str)`${V}/$comment`, se = z.scopeValue("root", { ref: R.root });
1886
+ z.code((0, n._)`${v.default.self}.opts.$comment(${Z}, ${oe}, ${se}.schema)`);
1887
1887
  }
1888
1888
  }
1889
1889
  function H(z) {
1890
- const { gen: R, schemaEnv: $, validateName: V, ValidationError: Y, opts: W } = z;
1891
- $.$async ? R.if((0, n._)`${v.default.errors} === 0`, () => R.return(v.default.data), () => R.throw((0, n._)`new ${Y}(${v.default.vErrors})`)) : (R.assign((0, n._)`${V}.errors`, v.default.vErrors), W.unevaluated && Z(z), R.return((0, n._)`${v.default.errors} === 0`));
1890
+ const { gen: R, schemaEnv: $, validateName: V, ValidationError: Y, opts: Z } = z;
1891
+ $.$async ? R.if((0, n._)`${v.default.errors} === 0`, () => R.return(v.default.data), () => R.throw((0, n._)`new ${Y}(${v.default.vErrors})`)) : (R.assign((0, n._)`${V}.errors`, v.default.vErrors), Z.unevaluated && W(z), R.return((0, n._)`${v.default.errors} === 0`));
1892
1892
  }
1893
- function Z({ gen: z, evaluated: R, props: $, items: V }) {
1893
+ function W({ gen: z, evaluated: R, props: $, items: V }) {
1894
1894
  $ instanceof n.Name && z.assign((0, n._)`${R}.props`, $), V instanceof n.Name && z.assign((0, n._)`${R}.items`, V);
1895
1895
  }
1896
1896
  function Q(z, R, $, V) {
1897
- const { gen: Y, schema: W, data: se, allErrors: oe, opts: he, self: me } = z, { RULES: ue } = me;
1898
- if (W.$ref && (he.ignoreKeywordsWithRef || !(0, y.schemaHasRulesButRef)(W, ue))) {
1899
- Y.block(() => O(z, "$ref", ue.all.$ref.definition));
1897
+ const { gen: Y, schema: Z, data: oe, allErrors: se, opts: de, self: fe } = z, { RULES: he } = fe;
1898
+ if (Z.$ref && (de.ignoreKeywordsWithRef || !(0, y.schemaHasRulesButRef)(Z, he))) {
1899
+ Y.block(() => O(z, "$ref", he.all.$ref.definition));
1900
1900
  return;
1901
1901
  }
1902
- he.jtd || J(z, R), Y.block(() => {
1903
- for (const ve of ue.rules)
1902
+ de.jtd || J(z, R), Y.block(() => {
1903
+ for (const ve of he.rules)
1904
1904
  Qe(ve);
1905
- Qe(ue.post);
1905
+ Qe(he.post);
1906
1906
  });
1907
1907
  function Qe(ve) {
1908
- (0, c.shouldUseGroup)(W, ve) && (ve.type ? (Y.if((0, u.checkDataType)(ve.type, se, he.strictNumbers)), ie(z, ve), R.length === 1 && R[0] === ve.type && $ && (Y.else(), (0, u.reportTypeError)(z)), Y.endIf()) : ie(z, ve), oe || Y.if((0, n._)`${v.default.errors} === ${V || 0}`));
1908
+ (0, c.shouldUseGroup)(Z, ve) && (ve.type ? (Y.if((0, u.checkDataType)(ve.type, oe, de.strictNumbers)), ie(z, ve), R.length === 1 && R[0] === ve.type && $ && (Y.else(), (0, u.reportTypeError)(z)), Y.endIf()) : ie(z, ve), se || Y.if((0, n._)`${v.default.errors} === ${V || 0}`));
1909
1909
  }
1910
1910
  }
1911
1911
  function ie(z, R) {
1912
1912
  const { gen: $, schema: V, opts: { useDefaults: Y } } = z;
1913
1913
  Y && (0, _.assignDefaults)(z, R.type), $.block(() => {
1914
- for (const W of R.rules)
1915
- (0, c.shouldUseRule)(V, W) && O(z, W.keyword, W.definition, R.type);
1914
+ for (const Z of R.rules)
1915
+ (0, c.shouldUseRule)(V, Z) && O(z, Z.keyword, Z.definition, R.type);
1916
1916
  });
1917
1917
  }
1918
1918
  function J(z, R) {
@@ -1937,8 +1937,8 @@ function Jt() {
1937
1937
  for (const V in $) {
1938
1938
  const Y = $[V];
1939
1939
  if (typeof Y == "object" && (0, c.shouldUseRule)(z.schema, Y)) {
1940
- const { type: W } = Y.definition;
1941
- W.length && !W.some((se) => k(R, se)) && A(z, `missing type "${W.join(",")}" for keyword "${V}"`);
1940
+ const { type: Z } = Y.definition;
1941
+ Z.length && !Z.some((oe) => k(R, oe)) && A(z, `missing type "${Z.join(",")}" for keyword "${V}"`);
1942
1942
  }
1943
1943
  }
1944
1944
  }
@@ -2020,25 +2020,25 @@ function Jt() {
2020
2020
  check$data(R = n.nil, $ = n.nil) {
2021
2021
  if (!this.$data)
2022
2022
  return;
2023
- const { gen: V, schemaCode: Y, schemaType: W, def: se } = this;
2024
- V.if((0, n.or)((0, n._)`${Y} === undefined`, $)), R !== n.nil && V.assign(R, !0), (W.length || se.validateSchema) && (V.elseIf(this.invalid$data()), this.$dataError(), R !== n.nil && V.assign(R, !1)), V.else();
2023
+ const { gen: V, schemaCode: Y, schemaType: Z, def: oe } = this;
2024
+ V.if((0, n.or)((0, n._)`${Y} === undefined`, $)), R !== n.nil && V.assign(R, !0), (Z.length || oe.validateSchema) && (V.elseIf(this.invalid$data()), this.$dataError(), R !== n.nil && V.assign(R, !1)), V.else();
2025
2025
  }
2026
2026
  invalid$data() {
2027
- const { gen: R, schemaCode: $, schemaType: V, def: Y, it: W } = this;
2028
- return (0, n.or)(se(), oe());
2029
- function se() {
2027
+ const { gen: R, schemaCode: $, schemaType: V, def: Y, it: Z } = this;
2028
+ return (0, n.or)(oe(), se());
2029
+ function oe() {
2030
2030
  if (V.length) {
2031
2031
  if (!($ instanceof n.Name))
2032
2032
  throw new Error("ajv implementation error");
2033
- const he = Array.isArray(V) ? V : [V];
2034
- return (0, n._)`${(0, u.checkDataTypes)(he, $, W.opts.strictNumbers, u.DataType.Wrong)}`;
2033
+ const de = Array.isArray(V) ? V : [V];
2034
+ return (0, n._)`${(0, u.checkDataTypes)(de, $, Z.opts.strictNumbers, u.DataType.Wrong)}`;
2035
2035
  }
2036
2036
  return n.nil;
2037
2037
  }
2038
- function oe() {
2038
+ function se() {
2039
2039
  if (Y.validateSchema) {
2040
- const he = R.scopeValue("validate$data", { ref: Y.validateSchema });
2041
- return (0, n._)`!${he}(${$})`;
2040
+ const de = R.scopeValue("validate$data", { ref: Y.validateSchema });
2041
+ return (0, n._)`!${de}(${$})`;
2042
2042
  }
2043
2043
  return n.nil;
2044
2044
  }
@@ -2066,35 +2066,35 @@ function Jt() {
2066
2066
  }
2067
2067
  const N = /^\/(?:[^~]|~0|~1)*$/, q = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
2068
2068
  function K(z, { dataLevel: R, dataNames: $, dataPathArr: V }) {
2069
- let Y, W;
2069
+ let Y, Z;
2070
2070
  if (z === "")
2071
2071
  return v.default.rootData;
2072
2072
  if (z[0] === "/") {
2073
2073
  if (!N.test(z))
2074
2074
  throw new Error(`Invalid JSON-pointer: ${z}`);
2075
- Y = z, W = v.default.rootData;
2075
+ Y = z, Z = v.default.rootData;
2076
2076
  } else {
2077
- const me = q.exec(z);
2078
- if (!me)
2077
+ const fe = q.exec(z);
2078
+ if (!fe)
2079
2079
  throw new Error(`Invalid JSON-pointer: ${z}`);
2080
- const ue = +me[1];
2081
- if (Y = me[2], Y === "#") {
2082
- if (ue >= R)
2083
- throw new Error(he("property/index", ue));
2084
- return V[R - ue];
2085
- }
2086
- if (ue > R)
2087
- throw new Error(he("data", ue));
2088
- if (W = $[R - ue], !Y)
2089
- return W;
2080
+ const he = +fe[1];
2081
+ if (Y = fe[2], Y === "#") {
2082
+ if (he >= R)
2083
+ throw new Error(de("property/index", he));
2084
+ return V[R - he];
2085
+ }
2086
+ if (he > R)
2087
+ throw new Error(de("data", he));
2088
+ if (Z = $[R - he], !Y)
2089
+ return Z;
2090
2090
  }
2091
- let se = W;
2092
- const oe = Y.split("/");
2093
- for (const me of oe)
2094
- me && (W = (0, n._)`${W}${(0, n.getProperty)((0, y.unescapeJsonPointer)(me))}`, se = (0, n._)`${se} && ${W}`);
2095
- return se;
2096
- function he(me, ue) {
2097
- return `Cannot access ${me} ${ue} levels up, current level is ${R}`;
2091
+ let oe = Z;
2092
+ const se = Y.split("/");
2093
+ for (const fe of se)
2094
+ fe && (Z = (0, n._)`${Z}${(0, n.getProperty)((0, y.unescapeJsonPointer)(fe))}`, oe = (0, n._)`${oe} && ${Z}`);
2095
+ return oe;
2096
+ function de(fe, he) {
2097
+ return `Cannot access ${fe} ${he} levels up, current level is ${R}`;
2098
2098
  }
2099
2099
  }
2100
2100
  return Pe.getData = K, Pe;
@@ -2180,12 +2180,12 @@ function vn() {
2180
2180
  L = `${w.scopeRefs(c.default.scope)}return ${F}`, this.opts.code.process && (L = this.opts.code.process(L, s));
2181
2181
  const G = new Function(`${c.default.self}`, `${c.default.scope}`, L)(this, this.scope.get());
2182
2182
  if (this.scope.value(P, { ref: G }), G.errors = null, G.schema = s.schema, G.schemaEnv = s, s.$async && (G.$async = !0), this.opts.code.source === !0 && (G.source = { validateName: P, validateCode: F, scopeValues: w._values }), this.opts.unevaluated) {
2183
- const { props: H, items: Z } = C;
2183
+ const { props: H, items: W } = C;
2184
2184
  G.evaluated = {
2185
2185
  props: H instanceof l.Name ? void 0 : H,
2186
- items: Z instanceof l.Name ? void 0 : Z,
2186
+ items: W instanceof l.Name ? void 0 : W,
2187
2187
  dynamicProps: H instanceof l.Name,
2188
- dynamicItems: Z instanceof l.Name
2188
+ dynamicItems: W instanceof l.Name
2189
2189
  }, G.source && (G.source.evaluated = (0, l.stringify)(G.evaluated));
2190
2190
  }
2191
2191
  return s.validate = G, s;
@@ -2710,7 +2710,7 @@ function Ll() {
2710
2710
  unicode: '"minLength"/"maxLength" account for unicode characters by default.'
2711
2711
  }, d = 200;
2712
2712
  function p(D) {
2713
- var I, k, T, x, A, B, O, N, q, K, z, R, $, V, Y, W, se, oe, he, me, ue, Qe, ve, zr, Fr;
2713
+ var I, k, T, x, A, B, O, N, q, K, z, R, $, V, Y, Z, oe, se, de, fe, he, Qe, ve, zr, Fr;
2714
2714
  const ut = D.strict, Rr = (I = D.code) === null || I === void 0 ? void 0 : I.optimize, Fn = Rr === !0 || Rr === void 0 ? 1 : Rr || 0, Rn = (T = (k = D.code) === null || k === void 0 ? void 0 : k.regExp) !== null && T !== void 0 ? T : a, pl = (x = D.uriResolver) !== null && x !== void 0 ? x : t.default;
2715
2715
  return {
2716
2716
  strictSchema: (B = (A = D.strictSchema) !== null && A !== void 0 ? A : ut) !== null && B !== void 0 ? B : !0,
@@ -2720,12 +2720,12 @@ function Ll() {
2720
2720
  strictRequired: (V = ($ = D.strictRequired) !== null && $ !== void 0 ? $ : ut) !== null && V !== void 0 ? V : !1,
2721
2721
  code: D.code ? { ...D.code, optimize: Fn, regExp: Rn } : { optimize: Fn, regExp: Rn },
2722
2722
  loopRequired: (Y = D.loopRequired) !== null && Y !== void 0 ? Y : d,
2723
- loopEnum: (W = D.loopEnum) !== null && W !== void 0 ? W : d,
2724
- meta: (se = D.meta) !== null && se !== void 0 ? se : !0,
2725
- messages: (oe = D.messages) !== null && oe !== void 0 ? oe : !0,
2726
- inlineRefs: (he = D.inlineRefs) !== null && he !== void 0 ? he : !0,
2727
- schemaId: (me = D.schemaId) !== null && me !== void 0 ? me : "$id",
2728
- addUsedSchema: (ue = D.addUsedSchema) !== null && ue !== void 0 ? ue : !0,
2723
+ loopEnum: (Z = D.loopEnum) !== null && Z !== void 0 ? Z : d,
2724
+ meta: (oe = D.meta) !== null && oe !== void 0 ? oe : !0,
2725
+ messages: (se = D.messages) !== null && se !== void 0 ? se : !0,
2726
+ inlineRefs: (de = D.inlineRefs) !== null && de !== void 0 ? de : !0,
2727
+ schemaId: (fe = D.schemaId) !== null && fe !== void 0 ? fe : "$id",
2728
+ addUsedSchema: (he = D.addUsedSchema) !== null && he !== void 0 ? he : !0,
2729
2729
  validateSchema: (Qe = D.validateSchema) !== null && Qe !== void 0 ? Qe : !0,
2730
2730
  validateFormats: (ve = D.validateFormats) !== null && ve !== void 0 ? ve : !0,
2731
2731
  unicodeRegExp: (zr = D.unicodeRegExp) !== null && zr !== void 0 ? zr : !0,
@@ -2901,14 +2901,14 @@ function Ll() {
2901
2901
  } else
2902
2902
  throw new Error("invalid addKeywords parameters");
2903
2903
  if (H.call(this, T, k), !k)
2904
- return (0, y.eachItem)(T, (A) => Z.call(this, A)), this;
2904
+ return (0, y.eachItem)(T, (A) => W.call(this, A)), this;
2905
2905
  ie.call(this, k);
2906
2906
  const x = {
2907
2907
  ...k,
2908
2908
  type: (0, S.getJSONTypes)(k.type),
2909
2909
  schemaType: (0, S.getJSONTypes)(k.schemaType)
2910
2910
  };
2911
- return (0, y.eachItem)(T, x.type.length === 0 ? (A) => Z.call(this, A, x) : (A) => x.type.forEach((B) => Z.call(this, A, x, B))), this;
2911
+ return (0, y.eachItem)(T, x.type.length === 0 ? (A) => W.call(this, A, x) : (A) => x.type.forEach((B) => W.call(this, A, x, B))), this;
2912
2912
  }
2913
2913
  getKeyword(I) {
2914
2914
  const k = this.RULES.all[I];
@@ -3058,7 +3058,7 @@ function Ll() {
3058
3058
  }), !!I && I.$data && !("code" in I || "validate" in I))
3059
3059
  throw new Error('$data keyword must have "code" or "validate" function');
3060
3060
  }
3061
- function Z(D, I, k) {
3061
+ function W(D, I, k) {
3062
3062
  var T;
3063
3063
  const x = I?.post;
3064
3064
  if (k && x)
@@ -4423,7 +4423,7 @@ function Pd() {
4423
4423
  x && F(x), T && M(T), G(C(U));
4424
4424
  }
4425
4425
  const k = typeof U == "string" ? U : U._;
4426
- k && H(k), s.keepErrors || Z();
4426
+ k && H(k), s.keepErrors || W();
4427
4427
  });
4428
4428
  function C({ properties: k, items: T }) {
4429
4429
  const x = {};
@@ -4527,7 +4527,7 @@ function Pd() {
4527
4527
  params: c._`{errors: ${T}}`
4528
4528
  }));
4529
4529
  }
4530
- function Z() {
4530
+ function W() {
4531
4531
  const k = d.const("emErrs", c._`[]`);
4532
4532
  d.forOf("err", n.default.vErrors, (T) => d.if(c._`!${T}.${S}`, () => d.code(c._`${k}.push(${T})`))), d.assign(n.default.vErrors, k).assign(n.default.errors, c._`${k}.length`);
4533
4533
  }
@@ -4684,8 +4684,8 @@ function kd() {
4684
4684
  const M = u.exec(F);
4685
4685
  if (!M)
4686
4686
  return !1;
4687
- const G = +M[1], H = +M[2], Z = +M[3];
4688
- return H >= 1 && H <= 12 && Z >= 1 && Z <= (H === 2 && c(G) ? 29 : _[H]);
4687
+ const G = +M[1], H = +M[2], W = +M[3];
4688
+ return H >= 1 && H <= 12 && W >= 1 && W <= (H === 2 && c(G) ? 29 : _[H]);
4689
4689
  }
4690
4690
  function g(F, M) {
4691
4691
  if (F && M)
@@ -4697,12 +4697,12 @@ function kd() {
4697
4697
  const H = n.exec(G);
4698
4698
  if (!H)
4699
4699
  return !1;
4700
- const Z = +H[1], Q = +H[2], ie = +H[3], J = H[4], j = H[5] === "-" ? -1 : 1, D = +(H[6] || 0), I = +(H[7] || 0);
4700
+ const W = +H[1], Q = +H[2], ie = +H[3], J = H[4], j = H[5] === "-" ? -1 : 1, D = +(H[6] || 0), I = +(H[7] || 0);
4701
4701
  if (D > 23 || I > 59 || F && !J)
4702
4702
  return !1;
4703
- if (Z <= 23 && Q <= 59 && ie < 60)
4703
+ if (W <= 23 && Q <= 59 && ie < 60)
4704
4704
  return !0;
4705
- const k = Q - I * j, T = Z - D * j - (k < 0 ? 1 : 0);
4705
+ const k = Q - I * j, T = W - D * j - (k < 0 ? 1 : 0);
4706
4706
  return (T === 23 || T === -1) && (k === 59 || k === -1) && ie < 61;
4707
4707
  };
4708
4708
  }
@@ -4724,8 +4724,8 @@ function kd() {
4724
4724
  function t(F) {
4725
4725
  const M = v(F);
4726
4726
  return function(H) {
4727
- const Z = H.split(E);
4728
- return Z.length === 2 && h(Z[0]) && M(Z[1]);
4727
+ const W = H.split(E);
4728
+ return W.length === 2 && h(W[0]) && M(W[1]);
4729
4729
  };
4730
4730
  }
4731
4731
  function a(F, M) {
@@ -4738,7 +4738,7 @@ function kd() {
4738
4738
  function e(F, M) {
4739
4739
  if (!(F && M))
4740
4740
  return;
4741
- const [G, H] = F.split(E), [Z, Q] = M.split(E), ie = g(G, Z);
4741
+ const [G, H] = F.split(E), [W, Q] = M.split(E), ie = g(G, W);
4742
4742
  if (ie !== void 0)
4743
4743
  return ie || S(H, Q);
4744
4744
  }
@@ -6199,7 +6199,7 @@ var Un = /* @__PURE__ */ Symbol.for("immer-nothing"), Mt = /* @__PURE__ */ Symbo
6199
6199
  // Note: if more errors are added, the errorOffset in Patches.ts should be increased
6200
6200
  // See Patches.ts for additional errors
6201
6201
  ] : [];
6202
- function fe(l, ...o) {
6202
+ function ce(l, ...o) {
6203
6203
  if (process.env.NODE_ENV !== "production") {
6204
6204
  const c = Mo[l], u = $e(c) ? c.apply(null, o) : c;
6205
6205
  throw new Error(`[Immer] ${u}`);
@@ -6250,7 +6250,7 @@ function fu(l) {
6250
6250
  const o = +l;
6251
6251
  return Number.isInteger(o) && String(o) === l;
6252
6252
  }
6253
- var Go = (l) => nt(l) ? l?.[te] : null, de = (l) => l.copy_ || l.base_, uu = (l) => {
6253
+ var Go = (l) => nt(l) ? l?.[te] : null, ue = (l) => l.copy_ || l.base_, uu = (l) => {
6254
6254
  const o = Go(l);
6255
6255
  return o ? o.copy_ ?? o.base_ : l;
6256
6256
  }, En = (l) => l.modified_ ? l.copy_ : l.base_;
@@ -6300,7 +6300,7 @@ function Tn(l, o = !1) {
6300
6300
  )), l;
6301
6301
  }
6302
6302
  function cu() {
6303
- fe(2);
6303
+ ce(2);
6304
6304
  }
6305
6305
  var ar = {
6306
6306
  [Vt]: cu
@@ -6311,7 +6311,7 @@ function Ar(l) {
6311
6311
  var Ht = "MapSet", br = "Patches", so = "ArrayMethods", wr = {};
6312
6312
  function Xe(l) {
6313
6313
  const o = wr[l];
6314
- return o || fe(0, l), o;
6314
+ return o || ce(0, l), o;
6315
6315
  }
6316
6316
  var ao = (l) => !!wr[l];
6317
6317
  function qo(l, o) {
@@ -6348,7 +6348,7 @@ function fo(l, o) {
6348
6348
  o.unfinalizedDrafts_ = o.drafts_.length;
6349
6349
  const c = o.drafts_[0];
6350
6350
  if (l !== void 0 && l !== c) {
6351
- c[te].modified_ && (an(o), fe(4)), xe(l) && (l = uo(o, l));
6351
+ c[te].modified_ && (an(o), ce(4)), xe(l) && (l = uo(o, l));
6352
6352
  const { patchPlugin_: _ } = o;
6353
6353
  _ && _.generateReplacementPatches_(
6354
6354
  c[te].base_,
@@ -6386,7 +6386,7 @@ function Vo(l) {
6386
6386
  }
6387
6387
  var Cr = (l, o) => l.scope_ === o, mu = [];
6388
6388
  function Ho(l, o, c, u) {
6389
- const _ = de(l), h = l.type_;
6389
+ const _ = ue(l), h = l.type_;
6390
6390
  if (u !== void 0 && ze(_, u, h) === o) {
6391
6391
  vr(_, u, c, h);
6392
6392
  return;
@@ -6434,7 +6434,7 @@ function gu(l, o, c) {
6434
6434
  Ho(l, c, g, o);
6435
6435
  });
6436
6436
  } else xe(c) && l.callbacks_.push(function() {
6437
- const h = de(l);
6437
+ const h = ue(l);
6438
6438
  ze(h, o, l.type_) === c && u.drafts_.length > 1 && (l.assigned_.get(o) ?? !1) === !0 && l.copy_ && In(
6439
6439
  ze(l.copy_, o, l.type_),
6440
6440
  u.handledSet_,
@@ -6493,7 +6493,7 @@ var Pn = {
6493
6493
  const u = l.type_ === 1 && typeof o == "string";
6494
6494
  if (u && c?.isArrayOperationMethod(o))
6495
6495
  return c.createMethodInterceptor(l, o);
6496
- const _ = de(l);
6496
+ const _ = ue(l);
6497
6497
  if (!jt(_, o, l.type_))
6498
6498
  return bu(l, _, o);
6499
6499
  const h = _[o];
@@ -6509,17 +6509,17 @@ var Pn = {
6509
6509
  return h;
6510
6510
  },
6511
6511
  has(l, o) {
6512
- return o in de(l);
6512
+ return o in ue(l);
6513
6513
  },
6514
6514
  ownKeys(l) {
6515
- return Reflect.ownKeys(de(l));
6515
+ return Reflect.ownKeys(ue(l));
6516
6516
  },
6517
6517
  set(l, o, c) {
6518
- const u = Ko(de(l), o);
6518
+ const u = Ko(ue(l), o);
6519
6519
  if (u?.set)
6520
6520
  return u.set.call(l.draft_, c), !0;
6521
6521
  if (!l.modified_) {
6522
- const _ = Wr(de(l), o), h = _?.[te];
6522
+ const _ = Wr(ue(l), o), h = _?.[te];
6523
6523
  if (h && h.base_ === c)
6524
6524
  return l.copy_[o] = c, l.assigned_.set(o, !1), !0;
6525
6525
  if (du(c, _) && (c !== void 0 || jt(l.base_, o, l.type_)))
@@ -6536,7 +6536,7 @@ var Pn = {
6536
6536
  // Note: We never coerce `desc.value` into an Immer draft, because we can't make
6537
6537
  // the same guarantee in ES5 mode.
6538
6538
  getOwnPropertyDescriptor(l, o) {
6539
- const c = de(l), u = Reflect.getOwnPropertyDescriptor(c, o);
6539
+ const c = ue(l), u = Reflect.getOwnPropertyDescriptor(c, o);
6540
6540
  return u && {
6541
6541
  [dr]: !0,
6542
6542
  [nn]: l.type_ !== 1 || o !== "length",
@@ -6545,13 +6545,13 @@ var Pn = {
6545
6545
  };
6546
6546
  },
6547
6547
  defineProperty() {
6548
- fe(11);
6548
+ ce(11);
6549
6549
  },
6550
6550
  getPrototypeOf(l) {
6551
6551
  return We(l.base_);
6552
6552
  },
6553
6553
  setPrototypeOf() {
6554
- fe(12);
6554
+ ce(12);
6555
6555
  }
6556
6556
  }, Kt = {};
6557
6557
  Je(Pn, (l, o) => {
@@ -6561,14 +6561,14 @@ Je(Pn, (l, o) => {
6561
6561
  };
6562
6562
  });
6563
6563
  Kt.deleteProperty = function(l, o) {
6564
- return process.env.NODE_ENV !== "production" && isNaN(parseInt(o)) && fe(13), Kt.set.call(this, l, o, void 0);
6564
+ return process.env.NODE_ENV !== "production" && isNaN(parseInt(o)) && ce(13), Kt.set.call(this, l, o, void 0);
6565
6565
  };
6566
6566
  Kt.set = function(l, o, c) {
6567
- return process.env.NODE_ENV !== "production" && o !== "length" && isNaN(parseInt(o)) && fe(14), Pn.set.call(this, l[0], o, c, l[0]);
6567
+ return process.env.NODE_ENV !== "production" && o !== "length" && isNaN(parseInt(o)) && ce(14), Pn.set.call(this, l[0], o, c, l[0]);
6568
6568
  };
6569
6569
  function Wr(l, o) {
6570
6570
  const c = l[te];
6571
- return (c ? de(c) : l)[o];
6571
+ return (c ? ue(c) : l)[o];
6572
6572
  }
6573
6573
  function bu(l, o, c) {
6574
6574
  const u = Ko(o, c);
@@ -6609,7 +6609,7 @@ var wu = class {
6609
6609
  return g.produce(v, (y) => c.call(this, y, ...S));
6610
6610
  };
6611
6611
  }
6612
- $e(c) || fe(6), u !== void 0 && !$e(u) && fe(7);
6612
+ $e(c) || ce(6), u !== void 0 && !$e(u) && ce(7);
6613
6613
  let _;
6614
6614
  if (xe(o)) {
6615
6615
  const h = lo(this), g = Wt(h, o, void 0);
@@ -6630,7 +6630,7 @@ var wu = class {
6630
6630
  }
6631
6631
  return _;
6632
6632
  } else
6633
- fe(1, o);
6633
+ ce(1, o);
6634
6634
  }, this.produceWithPatches = (o, c) => {
6635
6635
  if ($e(o))
6636
6636
  return (g, ...n) => this.produceWithPatches(g, (v) => o(v, ...n));
@@ -6641,13 +6641,13 @@ var wu = class {
6641
6641
  }, Kr(l?.autoFreeze) && this.setAutoFreeze(l.autoFreeze), Kr(l?.useStrictShallowCopy) && this.setUseStrictShallowCopy(l.useStrictShallowCopy), Kr(l?.useStrictIteration) && this.setUseStrictIteration(l.useStrictIteration);
6642
6642
  }
6643
6643
  createDraft(l) {
6644
- xe(l) || fe(8), Be(l) && (l = Su(l));
6644
+ xe(l) || ce(8), Be(l) && (l = Su(l));
6645
6645
  const o = lo(this), c = Wt(o, l, void 0);
6646
6646
  return c[te].isManual_ = !0, on(o), c;
6647
6647
  }
6648
6648
  finishDraft(l, o) {
6649
6649
  const c = l && l[te];
6650
- (!c || !c.isManual_) && fe(9);
6650
+ (!c || !c.isManual_) && ce(9);
6651
6651
  const { scope_: u } = c;
6652
6652
  return oo(u, o), fo(void 0, u);
6653
6653
  }
@@ -6705,7 +6705,7 @@ function Wt(l, o, c, u) {
6705
6705
  }), _;
6706
6706
  }
6707
6707
  function Su(l) {
6708
- return Be(l) || fe(10, l), Wo(l);
6708
+ return Be(l) || ce(10, l), Wo(l);
6709
6709
  }
6710
6710
  function Wo(l) {
6711
6711
  if (!xe(l) || Ar(l))
@@ -6910,7 +6910,7 @@ function xu() {
6910
6910
  for (let U = 0; U < f.length - 1; U++) {
6911
6911
  const P = Ze(p);
6912
6912
  let C = f[U];
6913
- typeof C != "string" && typeof C != "number" && (C = "" + C), (P === 0 || P === 1) && (C === "__proto__" || C === qt) && fe(19), $e(p) && C === ei && fe(19), p = ze(p, C), nt(p) || fe(18, f.join("/"));
6913
+ typeof C != "string" && typeof C != "number" && (C = "" + C), (P === 0 || P === 1) && (C === "__proto__" || C === qt) && ce(19), $e(p) && C === ei && ce(19), p = ze(p, C), nt(p) || ce(18, f.join("/"));
6914
6914
  }
6915
6915
  const m = Ze(p), b = t(s.value), w = f[f.length - 1];
6916
6916
  switch (d) {
@@ -6919,7 +6919,7 @@ function xu() {
6919
6919
  case 2:
6920
6920
  return p.set(w, b);
6921
6921
  case 3:
6922
- fe(16);
6922
+ ce(16);
6923
6923
  default:
6924
6924
  return p[w] = b;
6925
6925
  }
@@ -6946,7 +6946,7 @@ function xu() {
6946
6946
  return delete p[w];
6947
6947
  }
6948
6948
  default:
6949
- fe(17, d);
6949
+ ce(17, d);
6950
6950
  }
6951
6951
  }), e;
6952
6952
  }
@@ -6995,14 +6995,14 @@ function Uu() {
6995
6995
  };
6996
6996
  }
6997
6997
  get size() {
6998
- return de(this[te]).size;
6998
+ return ue(this[te]).size;
6999
6999
  }
7000
7000
  has(S) {
7001
- return de(this[te]).has(S);
7001
+ return ue(this[te]).has(S);
7002
7002
  }
7003
7003
  set(S, y) {
7004
7004
  const E = this[te];
7005
- return g(E), (!de(E).has(S) || de(E).get(S) !== y) && (c(E), Fe(E), E.assigned_.set(S, !0), E.copy_.set(S, y), E.assigned_.set(S, !0)), this;
7005
+ return g(E), (!ue(E).has(S) || ue(E).get(S) !== y) && (c(E), Fe(E), E.assigned_.set(S, !0), E.copy_.set(S, y), E.assigned_.set(S, !0)), this;
7006
7006
  }
7007
7007
  delete(S) {
7008
7008
  if (!this.has(S))
@@ -7012,27 +7012,27 @@ function Uu() {
7012
7012
  }
7013
7013
  clear() {
7014
7014
  const S = this[te];
7015
- g(S), de(S).size && (c(S), Fe(S), S.assigned_ = /* @__PURE__ */ new Map(), Je(S.base_, (y) => {
7015
+ g(S), ue(S).size && (c(S), Fe(S), S.assigned_ = /* @__PURE__ */ new Map(), Je(S.base_, (y) => {
7016
7016
  S.assigned_.set(y, !1);
7017
7017
  }), S.copy_.clear());
7018
7018
  }
7019
7019
  forEach(S, y) {
7020
7020
  const E = this[te];
7021
- de(E).forEach((t, a, e) => {
7021
+ ue(E).forEach((t, a, e) => {
7022
7022
  S.call(y, this.get(a), a, this);
7023
7023
  });
7024
7024
  }
7025
7025
  get(S) {
7026
7026
  const y = this[te];
7027
7027
  g(y);
7028
- const E = de(y).get(S);
7028
+ const E = ue(y).get(S);
7029
7029
  if (y.finalized_ || !xe(E) || E !== y.base_.get(S))
7030
7030
  return E;
7031
7031
  const t = Wt(y.scope_, E, y, S);
7032
7032
  return c(y), y.copy_.set(S, t), t;
7033
7033
  }
7034
7034
  keys() {
7035
- return de(this[te]).keys();
7035
+ return ue(this[te]).keys();
7036
7036
  }
7037
7037
  values() {
7038
7038
  const S = this.keys();
@@ -7093,7 +7093,7 @@ function Uu() {
7093
7093
  };
7094
7094
  }
7095
7095
  get size() {
7096
- return de(this[te]).size;
7096
+ return ue(this[te]).size;
7097
7097
  }
7098
7098
  has(S) {
7099
7099
  const y = this[te];
@@ -7114,7 +7114,7 @@ function Uu() {
7114
7114
  }
7115
7115
  clear() {
7116
7116
  const S = this[te];
7117
- g(S), de(S).size && (h(S), Fe(S), S.copy_.clear());
7117
+ g(S), ue(S).size && (h(S), Fe(S), S.copy_.clear());
7118
7118
  }
7119
7119
  values() {
7120
7120
  const S = this[te];
@@ -7151,7 +7151,7 @@ function Uu() {
7151
7151
  }));
7152
7152
  }
7153
7153
  function g(v) {
7154
- v.revoked_ && fe(3, JSON.stringify(de(v)));
7154
+ v.revoked_ && ce(3, JSON.stringify(ue(v)));
7155
7155
  }
7156
7156
  function n(v) {
7157
7157
  if (v.type_ === 3 && v.copy_) {
@@ -7350,13 +7350,13 @@ function Jc(l, o) {
7350
7350
  }), s = (j) => {
7351
7351
  e.value = j;
7352
7352
  }, f = (j, D) => {
7353
- const I = {
7354
- isMain: j.segmentType === "frames" && !D?.length ? !0 : void 0,
7353
+ const I = D.some((x) => x.trackType === "frames" && x.isMain), k = j.segmentType === "frames" && !I, T = {
7354
+ isMain: k ? !0 : void 0,
7355
7355
  trackType: j.segmentType,
7356
7356
  trackId: o?.idFactory?.track?.() ?? Zr(),
7357
7357
  children: [j]
7358
7358
  };
7359
- return D.push(I), j.id;
7359
+ return k ? D.push(T) : D.unshift(T), j.id;
7360
7360
  }, d = (j, D, I) => {
7361
7361
  if (D.isMain) {
7362
7362
  const k = _o(D.children, I), T = j.endTime - j.startTime;
@@ -7406,27 +7406,25 @@ function Jc(l, o) {
7406
7406
  }
7407
7407
  const B = g((N) => {
7408
7408
  if (I.segmentType === "frames") {
7409
- const R = I.startTime, $ = I.endTime, V = N.tracks.filter((W) => W.trackType === "frames");
7409
+ const R = I.startTime, $ = I.endTime, V = N.tracks.filter((se) => se.trackType === "frames");
7410
7410
  let Y;
7411
7411
  if (D) {
7412
- const W = V.find((se) => se.trackId === D);
7413
- W && (W.children.some((oe) => oe.startTime < $ && oe.endTime > R) || (Y = W));
7412
+ const se = V.find((de) => de.trackId === D);
7413
+ se && (se.children.some((fe) => fe.startTime < $ && fe.endTime > R) || (Y = se));
7414
7414
  }
7415
7415
  if (!Y)
7416
- for (const W of V) {
7417
- if (W.trackId === D)
7416
+ for (const se of V) {
7417
+ if (se.trackId === D)
7418
7418
  continue;
7419
- if (!W.children.some((oe) => oe.startTime < $ && oe.endTime > R)) {
7420
- Y = W;
7419
+ if (!se.children.some((fe) => fe.startTime < $ && fe.endTime > R)) {
7420
+ Y = se;
7421
7421
  break;
7422
7422
  }
7423
7423
  }
7424
7424
  if (Y)
7425
- return Y.children.push(I), Y.children.sort((W, se) => W.startTime - se.startTime), k.add(Y.trackId), I.id;
7426
- {
7427
- const W = f(I, N.tracks), se = N.tracks.find((oe) => oe.children.some((he) => he.id === W));
7428
- return se && (T.push(Ye(se)), k.add(se.trackId)), W;
7429
- }
7425
+ return Y.children.push(I), Y.children.sort((se, de) => se.startTime - de.startTime), k.add(Y.trackId), I.id;
7426
+ const Z = f(I, N.tracks), oe = N.tracks.find((se) => se.children.some((de) => de.id === Z));
7427
+ return oe && (T.push(Ye(oe)), k.add(oe.trackId)), Z;
7430
7428
  }
7431
7429
  const q = N.tracks;
7432
7430
  for (let R = q.length - 1; R >= 0; R--) {
@@ -7514,10 +7512,10 @@ function Jc(l, o) {
7514
7512
  }, C = (j) => {
7515
7513
  let D = null;
7516
7514
  const I = [], k = [], T = [], x = g((B) => {
7517
- const O = B.tracks.find((W) => W.trackId === j.trackId);
7515
+ const O = B.tracks.find((Z) => Z.trackId === j.trackId);
7518
7516
  if (!O)
7519
7517
  return !1;
7520
- const N = O.children.findIndex((W) => W.id === j.segmentId);
7518
+ const N = O.children.findIndex((Z) => Z.id === j.segmentId);
7521
7519
  if (N < 0)
7522
7520
  return !1;
7523
7521
  const q = O.children[N], K = q.startTime;
@@ -7527,10 +7525,10 @@ function Jc(l, o) {
7527
7525
  const V = ku(q) ? q : null;
7528
7526
  let Y = V ? V.fromTime ?? 0 : 0;
7529
7527
  if (V && z !== K) {
7530
- const W = V.fromTime ?? 0, se = z - K, oe = Math.max(se, -W);
7531
- if (oe !== se && (z = K + oe, $ = R - z), !Number.isFinite($) || $ < 0)
7528
+ const Z = V.fromTime ?? 0, oe = z - K, se = Math.max(oe, -Z);
7529
+ if (se !== oe && (z = K + se, $ = R - z), !Number.isFinite($) || $ < 0)
7532
7530
  return !1;
7533
- Y = W + oe, V.fromTime = Y;
7531
+ Y = Z + se, V.fromTime = Y;
7534
7532
  }
7535
7533
  return q.startTime = z, q.endTime = R, p(O, N), D = O.trackId, !0;
7536
7534
  }), A = [];
@@ -7586,7 +7584,7 @@ function Jc(l, o) {
7586
7584
  }, H = (j, D) => g((I) => {
7587
7585
  const k = I.tracks.find((T) => T.trackId === j);
7588
7586
  return k ? (k.trackId = D, !0) : !1;
7589
- }), Z = {
7587
+ }), W = {
7590
7588
  success: !1,
7591
7589
  affectedSegments: [],
7592
7590
  affectedTracks: [],
@@ -7615,7 +7613,7 @@ function Jc(l, o) {
7615
7613
  replaceTrackId: H,
7616
7614
  undo: () => {
7617
7615
  if (y.value <= 0)
7618
- return Z;
7616
+ return W;
7619
7617
  const j = Q();
7620
7618
  n();
7621
7619
  const D = Q(), I = mo(j, D);
@@ -7630,7 +7628,7 @@ function Jc(l, o) {
7630
7628
  },
7631
7629
  redo: () => {
7632
7630
  if (E.value <= 0)
7633
- return Z;
7631
+ return W;
7634
7632
  const j = Q();
7635
7633
  v();
7636
7634
  const D = Q(), I = mo(j, D);
@@ -7713,7 +7711,7 @@ function Bu(l) {
7713
7711
  }
7714
7712
  var Zo = (l) => {
7715
7713
  throw TypeError(l);
7716
- }, Xo = (l, o, c) => o.has(l) || Zo("Cannot " + c), re = (l, o, c) => (Xo(l, o, "read from private field"), c ? c.call(l) : o.get(l)), we = (l, o, c) => o.has(l) ? Zo("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(l) : o.set(l, c), _e = (l, o, c, u) => (Xo(l, o, "write to private field"), o.set(l, c), c);
7714
+ }, Xo = (l, o, c) => o.has(l) || Zo("Cannot " + c), re = (l, o, c) => (Xo(l, o, "read from private field"), c ? c.call(l) : o.get(l)), we = (l, o, c) => o.has(l) ? Zo("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(l) : o.set(l, c), me = (l, o, c, u) => (Xo(l, o, "write to private field"), o.set(l, c), c);
7717
7715
  const Jo = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIHUobil7aWYobj09PSIvIilyZXR1cm57cGFyZW50Om51bGwsbmFtZToiIn07Y29uc3QgZT1uLnNwbGl0KCIvIikuZmlsdGVyKGk9PmkubGVuZ3RoPjApO2lmKGUubGVuZ3RoPT09MCl0aHJvdyBFcnJvcigiSW52YWxpZCBwYXRoIik7Y29uc3QgYT1lW2UubGVuZ3RoLTFdLHI9Ii8iK2Uuc2xpY2UoMCwtMSkuam9pbigiLyIpO3JldHVybntuYW1lOmEscGFyZW50OnJ9fWFzeW5jIGZ1bmN0aW9uIHcobixlKXtjb25zdHtwYXJlbnQ6YSxuYW1lOnJ9PXUobik7aWYoYT09bnVsbClyZXR1cm4gYXdhaXQgbmF2aWdhdG9yLnN0b3JhZ2UuZ2V0RGlyZWN0b3J5KCk7Y29uc3QgaT1hLnNwbGl0KCIvIikuZmlsdGVyKHQ9PnQubGVuZ3RoPjApO3RyeXtsZXQgdD1hd2FpdCBuYXZpZ2F0b3Iuc3RvcmFnZS5nZXREaXJlY3RvcnkoKTtmb3IoY29uc3QgcyBvZiBpKXQ9YXdhaXQgdC5nZXREaXJlY3RvcnlIYW5kbGUocyx7Y3JlYXRlOmUuY3JlYXRlfSk7aWYoZS5pc0ZpbGUpcmV0dXJuIGF3YWl0IHQuZ2V0RmlsZUhhbmRsZShyLHtjcmVhdGU6ZS5jcmVhdGV9KX1jYXRjaCh0KXtpZih0Lm5hbWU9PT0iTm90Rm91bmRFcnJvciIpcmV0dXJuIG51bGw7dGhyb3cgdH19Y29uc3QgZj17fTtzZWxmLm9ubWVzc2FnZT1hc3luYyBuPT57dmFyIGk7Y29uc3R7ZXZ0VHlwZTplLGFyZ3M6YX09bi5kYXRhO2xldCByPWZbYS5maWxlSWRdO3RyeXtsZXQgdDtjb25zdCBzPVtdO2lmKGU9PT0icmVnaXN0ZXIiKXtjb25zdCBsPWF3YWl0IHcoYS5maWxlUGF0aCx7Y3JlYXRlOiEwLGlzRmlsZTohMH0pO2lmKGw9PW51bGwpdGhyb3cgRXJyb3IoYG5vdCBmb3VuZCBmaWxlOiAke2EuZmlsZUlkfWApO3I9YXdhaXQgbC5jcmVhdGVTeW5jQWNjZXNzSGFuZGxlKHttb2RlOmEubW9kZX0pLGZbYS5maWxlSWRdPXJ9ZWxzZSBpZihlPT09ImNsb3NlIilhd2FpdCByLmNsb3NlKCksZGVsZXRlIGZbYS5maWxlSWRdO2Vsc2UgaWYoZT09PSJ0cnVuY2F0ZSIpYXdhaXQgci50cnVuY2F0ZShhLm5ld1NpemUpO2Vsc2UgaWYoZT09PSJ3cml0ZSIpe2NvbnN0e2RhdGE6bCxvcHRzOm99PW4uZGF0YS5hcmdzO3Q9YXdhaXQgci53cml0ZShsLG8pfWVsc2UgaWYoZT09PSJyZWFkIil7Y29uc3R7b2Zmc2V0Omwsc2l6ZTpvfT1uLmRhdGEuYXJncyxnPW5ldyBVaW50OEFycmF5KG8pLGQ9YXdhaXQgci5yZWFkKGcse2F0Omx9KSxjPWcuYnVmZmVyO3Q9ZD09PW8/YzooKGk9Yy50cmFuc2Zlcik9PW51bGw/dm9pZCAwOmkuY2FsbChjLGQpKT8/Yy5zbGljZSgwLGQpLHMucHVzaCh0KX1lbHNlIGU9PT0iZ2V0U2l6ZSI/dD1hd2FpdCByLmdldFNpemUoKTplPT09ImZsdXNoIiYmYXdhaXQgci5mbHVzaCgpO3NlbGYucG9zdE1lc3NhZ2Uoe2V2dFR5cGU6ImNhbGxiYWNrIixjYklkOm4uZGF0YS5jYklkLHJldHVyblZhbDp0fSxzKX1jYXRjaCh0KXtjb25zdCBzPXQ7c2VsZi5wb3N0TWVzc2FnZSh7ZXZ0VHlwZToidGhyb3dFcnJvciIsY2JJZDpuLmRhdGEuY2JJZCxlcnJNc2c6cy5uYW1lKyI6ICIrcy5tZXNzYWdlK2AKYCtKU09OLnN0cmluZ2lmeShuLmRhdGEpfSl9fX0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPW9wZnMtd29ya2VyLUY0UldscWNfLmpzLm1hcAo=", Du = (l) => Uint8Array.from(atob(l), (o) => o.charCodeAt(0)), yo = typeof self < "u" && self.Blob && new Blob([Du(Jo)], { type: "text/javascript;charset=utf-8" });
7718
7716
  function Lu(l) {
7719
7717
  let o;
@@ -7859,9 +7857,9 @@ function Ne(l) {
7859
7857
  var Te, cr, Lt;
7860
7858
  const Nu = class Qo {
7861
7859
  constructor(o) {
7862
- we(this, Te), we(this, cr), we(this, Lt), _e(this, Te, o);
7860
+ we(this, Te), we(this, cr), we(this, Lt), me(this, Te, o);
7863
7861
  const { parent: c, name: u } = kr(o);
7864
- _e(this, cr, u), _e(this, Lt, c);
7862
+ me(this, cr, u), me(this, Lt, c);
7865
7863
  }
7866
7864
  get kind() {
7867
7865
  return "dir";
@@ -7993,33 +7991,33 @@ const Gu = class tl {
7993
7991
  we(this, be), we(this, $t), we(this, hr), we(this, Ot), we(this, pr), we(this, ke, 0), we(this, _r, async () => {
7994
7992
  }), we(this, mr, /* @__PURE__ */ (() => {
7995
7993
  let h = null;
7996
- return () => (_e(this, ke, re(this, ke) + 1), h != null || (h = new Promise(async (g, n) => {
7994
+ return () => (me(this, ke, re(this, ke) + 1), h != null || (h = new Promise(async (g, n) => {
7997
7995
  try {
7998
7996
  const v = await $u(
7999
7997
  re(this, pr),
8000
7998
  re(this, be),
8001
7999
  re(this, Ot)
8002
8000
  );
8003
- _e(this, _r, async () => {
8004
- h != null && (h = null, _e(this, ke, 0), await v.close().catch(console.error));
8001
+ me(this, _r, async () => {
8002
+ h != null && (h = null, me(this, ke, 0), await v.close().catch(console.error));
8005
8003
  }), g([
8006
8004
  v,
8007
8005
  async () => {
8008
- _e(this, ke, re(this, ke) - 1), !(re(this, ke) > 0) && (h = null, await v.close());
8006
+ me(this, ke, re(this, ke) - 1), !(re(this, ke) > 0) && (h = null, await v.close());
8009
8007
  }
8010
8008
  ]);
8011
8009
  } catch (v) {
8012
8010
  n(v);
8013
8011
  }
8014
8012
  })), h);
8015
- })()), we(this, it, !1), _e(this, pr, ju()), _e(this, be, o), _e(this, Ot, {
8013
+ })()), we(this, it, !1), me(this, pr, ju()), me(this, be, o), me(this, Ot, {
8016
8014
  r: "read-only",
8017
8015
  rw: "readwrite",
8018
8016
  "rw-unsafe": "readwrite-unsafe"
8019
8017
  }[c]);
8020
8018
  const { parent: u, name: _ } = kr(o);
8021
8019
  if (u == null) throw Error("Invalid path");
8022
- _e(this, hr, _), _e(this, $t, u);
8020
+ me(this, hr, _), me(this, $t, u);
8023
8021
  }
8024
8022
  get kind() {
8025
8023
  return "file";
@@ -8039,7 +8037,7 @@ const Gu = class tl {
8039
8037
  async createWriter() {
8040
8038
  if (re(this, Ot) === "read-only") throw Error("file is read-only");
8041
8039
  if (re(this, it)) throw Error("Other writer have not been closed");
8042
- _e(this, it, !0);
8040
+ me(this, it, !0);
8043
8041
  try {
8044
8042
  const o = new TextEncoder(), [c, u] = await re(this, mr).call(this);
8045
8043
  let _ = await c.getSize(), h = !1;
@@ -8059,11 +8057,11 @@ const Gu = class tl {
8059
8057
  },
8060
8058
  close: async () => {
8061
8059
  if (h) throw Error("Writer is closed");
8062
- h = !0, _e(this, it, !1), await u();
8060
+ h = !0, me(this, it, !1), await u();
8063
8061
  }
8064
8062
  };
8065
8063
  } catch (o) {
8066
- throw _e(this, it, !1), o;
8064
+ throw me(this, it, !1), o;
8067
8065
  }
8068
8066
  }
8069
8067
  /**
@@ -10805,11 +10803,11 @@ function Yu() {
10805
10803
  for (t = 0; t < this.moov.traks.length; t++)
10806
10804
  a = this.moov.traks[t], this.buildTrakSampleLists(a);
10807
10805
  }, y.prototype.buildTrakSampleLists = function(t) {
10808
- var a, e, r, s, f, d, p, m, b, w, U, P, C, L, F, M, G, H, Z, Q, ie, J, j, D;
10809
- if (t.samples = [], t.samples_duration = 0, t.samples_size = 0, e = t.mdia.minf.stbl.stco || t.mdia.minf.stbl.co64, r = t.mdia.minf.stbl.stsc, s = t.mdia.minf.stbl.stsz || t.mdia.minf.stbl.stz2, f = t.mdia.minf.stbl.stts, d = t.mdia.minf.stbl.ctts, p = t.mdia.minf.stbl.stss, m = t.mdia.minf.stbl.stsd, b = t.mdia.minf.stbl.subs, P = t.mdia.minf.stbl.stdp, w = t.mdia.minf.stbl.sbgps, U = t.mdia.minf.stbl.sgpds, H = -1, Z = -1, Q = -1, ie = -1, J = 0, j = 0, D = 0, y.initSampleGroups(t, null, w, U), !(typeof s > "u")) {
10806
+ var a, e, r, s, f, d, p, m, b, w, U, P, C, L, F, M, G, H, W, Q, ie, J, j, D;
10807
+ if (t.samples = [], t.samples_duration = 0, t.samples_size = 0, e = t.mdia.minf.stbl.stco || t.mdia.minf.stbl.co64, r = t.mdia.minf.stbl.stsc, s = t.mdia.minf.stbl.stsz || t.mdia.minf.stbl.stz2, f = t.mdia.minf.stbl.stts, d = t.mdia.minf.stbl.ctts, p = t.mdia.minf.stbl.stss, m = t.mdia.minf.stbl.stsd, b = t.mdia.minf.stbl.subs, P = t.mdia.minf.stbl.stdp, w = t.mdia.minf.stbl.sbgps, U = t.mdia.minf.stbl.sgpds, H = -1, W = -1, Q = -1, ie = -1, J = 0, j = 0, D = 0, y.initSampleGroups(t, null, w, U), !(typeof s > "u")) {
10810
10808
  for (a = 0; a < s.sample_sizes.length; a++) {
10811
10809
  var I = {};
10812
- I.number = a, I.track_id = t.tkhd.track_id, I.timescale = t.mdia.mdhd.timescale, I.alreadyRead = 0, t.samples[a] = I, I.size = s.sample_sizes[a], t.samples_size += I.size, a === 0 ? (L = 1, C = 0, I.chunk_index = L, I.chunk_run_index = C, G = r.samples_per_chunk[C], M = 0, C + 1 < r.first_chunk.length ? F = r.first_chunk[C + 1] - 1 : F = 1 / 0) : a < G ? (I.chunk_index = L, I.chunk_run_index = C) : (L++, I.chunk_index = L, M = 0, L <= F || (C++, C + 1 < r.first_chunk.length ? F = r.first_chunk[C + 1] - 1 : F = 1 / 0), I.chunk_run_index = C, G += r.samples_per_chunk[C]), I.description_index = r.sample_description_index[I.chunk_run_index] - 1, I.description = m.entries[I.description_index], I.offset = e.chunk_offsets[I.chunk_index - 1] + M, M += I.size, a > H && (Z++, H < 0 && (H = 0), H += f.sample_counts[Z]), a > 0 ? (t.samples[a - 1].duration = f.sample_deltas[Z], t.samples_duration += t.samples[a - 1].duration, I.dts = t.samples[a - 1].dts + t.samples[a - 1].duration) : I.dts = 0, d ? (a >= Q && (ie++, Q < 0 && (Q = 0), Q += d.sample_counts[ie]), I.cts = t.samples[a].dts + d.sample_offsets[ie]) : I.cts = I.dts, p ? (a == p.sample_numbers[J] - 1 ? (I.is_sync = !0, J++) : (I.is_sync = !1, I.degradation_priority = 0), b && b.entries[j].sample_delta + D == a + 1 && (I.subsamples = b.entries[j].subsamples, D += b.entries[j].sample_delta, j++)) : I.is_sync = !0, y.process_sdtp(t.mdia.minf.stbl.sdtp, I, I.number), P ? I.degradation_priority = P.priority[a] : I.degradation_priority = 0, b && b.entries[j].sample_delta + D == a && (I.subsamples = b.entries[j].subsamples, D += b.entries[j].sample_delta), (w.length > 0 || U.length > 0) && y.setSampleGroupProperties(t, I, a, t.sample_groups_info);
10810
+ I.number = a, I.track_id = t.tkhd.track_id, I.timescale = t.mdia.mdhd.timescale, I.alreadyRead = 0, t.samples[a] = I, I.size = s.sample_sizes[a], t.samples_size += I.size, a === 0 ? (L = 1, C = 0, I.chunk_index = L, I.chunk_run_index = C, G = r.samples_per_chunk[C], M = 0, C + 1 < r.first_chunk.length ? F = r.first_chunk[C + 1] - 1 : F = 1 / 0) : a < G ? (I.chunk_index = L, I.chunk_run_index = C) : (L++, I.chunk_index = L, M = 0, L <= F || (C++, C + 1 < r.first_chunk.length ? F = r.first_chunk[C + 1] - 1 : F = 1 / 0), I.chunk_run_index = C, G += r.samples_per_chunk[C]), I.description_index = r.sample_description_index[I.chunk_run_index] - 1, I.description = m.entries[I.description_index], I.offset = e.chunk_offsets[I.chunk_index - 1] + M, M += I.size, a > H && (W++, H < 0 && (H = 0), H += f.sample_counts[W]), a > 0 ? (t.samples[a - 1].duration = f.sample_deltas[W], t.samples_duration += t.samples[a - 1].duration, I.dts = t.samples[a - 1].dts + t.samples[a - 1].duration) : I.dts = 0, d ? (a >= Q && (ie++, Q < 0 && (Q = 0), Q += d.sample_counts[ie]), I.cts = t.samples[a].dts + d.sample_offsets[ie]) : I.cts = I.dts, p ? (a == p.sample_numbers[J] - 1 ? (I.is_sync = !0, J++) : (I.is_sync = !1, I.degradation_priority = 0), b && b.entries[j].sample_delta + D == a + 1 && (I.subsamples = b.entries[j].subsamples, D += b.entries[j].sample_delta, j++)) : I.is_sync = !0, y.process_sdtp(t.mdia.minf.stbl.sdtp, I, I.number), P ? I.degradation_priority = P.priority[a] : I.degradation_priority = 0, b && b.entries[j].sample_delta + D == a && (I.subsamples = b.entries[j].subsamples, D += b.entries[j].sample_delta), (w.length > 0 || U.length > 0) && y.setSampleGroupProperties(t, I, a, t.sample_groups_info);
10813
10811
  }
10814
10812
  a > 0 && (t.samples[a - 1].duration = Math.max(t.mdia.mdhd.duration - t.samples[a - 1].dts, 0), t.samples_duration += t.samples[a - 1].duration);
10815
10813
  }
@@ -10823,8 +10821,8 @@ function Yu() {
10823
10821
  var F = w.truns[a];
10824
10822
  for (e = 0; e < F.sample_count; e++) {
10825
10823
  C = {}, C.moof_number = this.lastMoofIndex, C.number_in_traf = w.sample_number, w.sample_number++, C.number = U.samples.length, w.first_sample_index = U.samples.length, U.samples.push(C), C.track_id = U.tkhd.track_id, C.timescale = U.mdia.mdhd.timescale, C.description_index = r - 1, C.description = U.mdia.minf.stbl.stsd.entries[C.description_index], C.size = f, F.flags & n.TRUN_FLAGS_SIZE && (C.size = F.sample_size[e]), U.samples_size += C.size, C.duration = s, F.flags & n.TRUN_FLAGS_DURATION && (C.duration = F.sample_duration[e]), U.samples_duration += C.duration, U.first_traf_merged || e > 0 ? C.dts = U.samples[U.samples.length - 2].dts + U.samples[U.samples.length - 2].duration : (w.tfdt ? C.dts = w.tfdt.baseMediaDecodeTime : C.dts = 0, U.first_traf_merged = !0), C.cts = C.dts, F.flags & n.TRUN_FLAGS_CTS_OFFSET && (C.cts = C.dts + F.sample_composition_time_offset[e]), L = d, F.flags & n.TRUN_FLAGS_FLAGS ? L = F.sample_flags[e] : e === 0 && F.flags & n.TRUN_FLAGS_FIRST_FLAG && (L = F.first_sample_flags), C.is_sync = !(L >> 16 & 1), C.is_leading = L >> 26 & 3, C.depends_on = L >> 24 & 3, C.is_depended_on = L >> 22 & 3, C.has_redundancy = L >> 20 & 3, C.degradation_priority = L & 65535;
10826
- var M = !!(w.tfhd.flags & n.TFHD_FLAG_BASE_DATA_OFFSET), G = !!(w.tfhd.flags & n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF), H = !!(F.flags & n.TRUN_FLAGS_DATA_OFFSET), Z = 0;
10827
- M ? Z = w.tfhd.base_data_offset : G || a === 0 ? Z = b.start : Z = p, a === 0 && e === 0 ? H ? C.offset = Z + F.data_offset : C.offset = Z : C.offset = p, p = C.offset + C.size, (w.sbgps.length > 0 || w.sgpds.length > 0 || U.mdia.minf.stbl.sbgps.length > 0 || U.mdia.minf.stbl.sgpds.length > 0) && y.setSampleGroupProperties(U, C, C.number_in_traf, w.sample_groups_info);
10824
+ var M = !!(w.tfhd.flags & n.TFHD_FLAG_BASE_DATA_OFFSET), G = !!(w.tfhd.flags & n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF), H = !!(F.flags & n.TRUN_FLAGS_DATA_OFFSET), W = 0;
10825
+ M ? W = w.tfhd.base_data_offset : G || a === 0 ? W = b.start : W = p, a === 0 && e === 0 ? H ? C.offset = W + F.data_offset : C.offset = W : C.offset = p, p = C.offset + C.size, (w.sbgps.length > 0 || w.sgpds.length > 0 || U.mdia.minf.stbl.sbgps.length > 0 || U.mdia.minf.stbl.sgpds.length > 0) && y.setSampleGroupProperties(U, C, C.number_in_traf, w.sample_groups_info);
10828
10826
  }
10829
10827
  }
10830
10828
  if (w.subs) {
@@ -13894,11 +13892,11 @@ function ic() {
13894
13892
  for (e = 0; e < this.moov.traks.length; e++)
13895
13893
  r = this.moov.traks[e], this.buildTrakSampleLists(r);
13896
13894
  }, t.prototype.buildTrakSampleLists = function(e) {
13897
- var r, s, f, d, p, m, b, w, U, P, C, L, F, M, G, H, Z, Q, ie, J, j, D, I, k;
13895
+ var r, s, f, d, p, m, b, w, U, P, C, L, F, M, G, H, W, Q, ie, J, j, D, I, k;
13898
13896
  if (e.samples = [], e.samples_duration = 0, e.samples_size = 0, s = e.mdia.minf.stbl.stco || e.mdia.minf.stbl.co64, f = e.mdia.minf.stbl.stsc, d = e.mdia.minf.stbl.stsz || e.mdia.minf.stbl.stz2, p = e.mdia.minf.stbl.stts, m = e.mdia.minf.stbl.ctts, b = e.mdia.minf.stbl.stss, w = e.mdia.minf.stbl.stsd, U = e.mdia.minf.stbl.subs, L = e.mdia.minf.stbl.stdp, P = e.mdia.minf.stbl.sbgps, C = e.mdia.minf.stbl.sgpds, Q = -1, ie = -1, J = -1, j = -1, D = 0, I = 0, k = 0, t.initSampleGroups(e, null, P, C), !(typeof d > "u")) {
13899
13897
  for (r = 0; r < d.sample_sizes.length; r++) {
13900
13898
  var T = {};
13901
- T.number = r, T.track_id = e.tkhd.track_id, T.timescale = e.mdia.mdhd.timescale, T.alreadyRead = 0, e.samples[r] = T, T.size = d.sample_sizes[r], e.samples_size += T.size, r === 0 ? (M = 1, F = 0, T.chunk_index = M, T.chunk_run_index = F, Z = f.samples_per_chunk[F], H = 0, F + 1 < f.first_chunk.length ? G = f.first_chunk[F + 1] - 1 : G = 1 / 0) : r < Z ? (T.chunk_index = M, T.chunk_run_index = F) : (M++, T.chunk_index = M, H = 0, M <= G || (F++, F + 1 < f.first_chunk.length ? G = f.first_chunk[F + 1] - 1 : G = 1 / 0), T.chunk_run_index = F, Z += f.samples_per_chunk[F]), T.description_index = f.sample_description_index[T.chunk_run_index] - 1, T.description = w.entries[T.description_index], T.offset = s.chunk_offsets[T.chunk_index - 1] + H, H += T.size, r > Q && (ie++, Q < 0 && (Q = 0), Q += p.sample_counts[ie]), r > 0 ? (e.samples[r - 1].duration = p.sample_deltas[ie], e.samples_duration += e.samples[r - 1].duration, T.dts = e.samples[r - 1].dts + e.samples[r - 1].duration) : T.dts = 0, m ? (r >= J && (j++, J < 0 && (J = 0), J += m.sample_counts[j]), T.cts = e.samples[r].dts + m.sample_offsets[j]) : T.cts = T.dts, b ? (r == b.sample_numbers[D] - 1 ? (T.is_sync = !0, D++) : (T.is_sync = !1, T.degradation_priority = 0), U && U.entries[I].sample_delta + k == r + 1 && (T.subsamples = U.entries[I].subsamples, k += U.entries[I].sample_delta, I++)) : T.is_sync = !0, t.process_sdtp(e.mdia.minf.stbl.sdtp, T, T.number), L ? T.degradation_priority = L.priority[r] : T.degradation_priority = 0, U && U.entries[I].sample_delta + k == r && (T.subsamples = U.entries[I].subsamples, k += U.entries[I].sample_delta), (P.length > 0 || C.length > 0) && t.setSampleGroupProperties(e, T, r, e.sample_groups_info);
13899
+ T.number = r, T.track_id = e.tkhd.track_id, T.timescale = e.mdia.mdhd.timescale, T.alreadyRead = 0, e.samples[r] = T, T.size = d.sample_sizes[r], e.samples_size += T.size, r === 0 ? (M = 1, F = 0, T.chunk_index = M, T.chunk_run_index = F, W = f.samples_per_chunk[F], H = 0, F + 1 < f.first_chunk.length ? G = f.first_chunk[F + 1] - 1 : G = 1 / 0) : r < W ? (T.chunk_index = M, T.chunk_run_index = F) : (M++, T.chunk_index = M, H = 0, M <= G || (F++, F + 1 < f.first_chunk.length ? G = f.first_chunk[F + 1] - 1 : G = 1 / 0), T.chunk_run_index = F, W += f.samples_per_chunk[F]), T.description_index = f.sample_description_index[T.chunk_run_index] - 1, T.description = w.entries[T.description_index], T.offset = s.chunk_offsets[T.chunk_index - 1] + H, H += T.size, r > Q && (ie++, Q < 0 && (Q = 0), Q += p.sample_counts[ie]), r > 0 ? (e.samples[r - 1].duration = p.sample_deltas[ie], e.samples_duration += e.samples[r - 1].duration, T.dts = e.samples[r - 1].dts + e.samples[r - 1].duration) : T.dts = 0, m ? (r >= J && (j++, J < 0 && (J = 0), J += m.sample_counts[j]), T.cts = e.samples[r].dts + m.sample_offsets[j]) : T.cts = T.dts, b ? (r == b.sample_numbers[D] - 1 ? (T.is_sync = !0, D++) : (T.is_sync = !1, T.degradation_priority = 0), U && U.entries[I].sample_delta + k == r + 1 && (T.subsamples = U.entries[I].subsamples, k += U.entries[I].sample_delta, I++)) : T.is_sync = !0, t.process_sdtp(e.mdia.minf.stbl.sdtp, T, T.number), L ? T.degradation_priority = L.priority[r] : T.degradation_priority = 0, U && U.entries[I].sample_delta + k == r && (T.subsamples = U.entries[I].subsamples, k += U.entries[I].sample_delta), (P.length > 0 || C.length > 0) && t.setSampleGroupProperties(e, T, r, e.sample_groups_info);
13902
13900
  }
13903
13901
  r > 0 && (e.samples[r - 1].duration = Math.max(e.mdia.mdhd.duration - e.samples[r - 1].dts, 0), e.samples_duration += e.samples[r - 1].duration);
13904
13902
  }
@@ -13912,8 +13910,8 @@ function ic() {
13912
13910
  var G = P.truns[r];
13913
13911
  for (s = 0; s < G.sample_count; s++) {
13914
13912
  F = {}, F.moof_number = this.lastMoofIndex, F.number_in_traf = P.sample_number, P.sample_number++, F.number = C.samples.length, P.first_sample_index = C.samples.length, C.samples.push(F), F.track_id = C.tkhd.track_id, F.timescale = C.mdia.mdhd.timescale, F.description_index = f - 1, F.description = C.mdia.minf.stbl.stsd.entries[F.description_index], F.size = p, G.flags & n.TRUN_FLAGS_SIZE && (F.size = G.sample_size[s]), C.samples_size += F.size, F.duration = d, G.flags & n.TRUN_FLAGS_DURATION && (F.duration = G.sample_duration[s]), C.samples_duration += F.duration, C.first_traf_merged || s > 0 ? F.dts = C.samples[C.samples.length - 2].dts + C.samples[C.samples.length - 2].duration : (P.tfdt ? F.dts = P.tfdt.baseMediaDecodeTime : F.dts = 0, C.first_traf_merged = !0), F.cts = F.dts, G.flags & n.TRUN_FLAGS_CTS_OFFSET && (F.cts = F.dts + G.sample_composition_time_offset[s]), M = m, G.flags & n.TRUN_FLAGS_FLAGS ? M = G.sample_flags[s] : s === 0 && G.flags & n.TRUN_FLAGS_FIRST_FLAG && (M = G.first_sample_flags), F.is_sync = !(M >> 16 & 1), F.is_leading = M >> 26 & 3, F.depends_on = M >> 24 & 3, F.is_depended_on = M >> 22 & 3, F.has_redundancy = M >> 20 & 3, F.degradation_priority = M & 65535;
13915
- var H = !!(P.tfhd.flags & n.TFHD_FLAG_BASE_DATA_OFFSET), Z = !!(P.tfhd.flags & n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF), Q = !!(G.flags & n.TRUN_FLAGS_DATA_OFFSET), ie = 0;
13916
- H ? ie = P.tfhd.base_data_offset : Z || r === 0 ? ie = U.start : ie = b, r === 0 && s === 0 ? Q ? F.offset = ie + G.data_offset : F.offset = ie : F.offset = b, b = F.offset + F.size, (P.sbgps.length > 0 || P.sgpds.length > 0 || C.mdia.minf.stbl.sbgps.length > 0 || C.mdia.minf.stbl.sgpds.length > 0) && t.setSampleGroupProperties(C, F, F.number_in_traf, P.sample_groups_info);
13913
+ var H = !!(P.tfhd.flags & n.TFHD_FLAG_BASE_DATA_OFFSET), W = !!(P.tfhd.flags & n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF), Q = !!(G.flags & n.TRUN_FLAGS_DATA_OFFSET), ie = 0;
13914
+ H ? ie = P.tfhd.base_data_offset : W || r === 0 ? ie = U.start : ie = b, r === 0 && s === 0 ? Q ? F.offset = ie + G.data_offset : F.offset = ie : F.offset = b, b = F.offset + F.size, (P.sbgps.length > 0 || P.sgpds.length > 0 || C.mdia.minf.stbl.sbgps.length > 0 || C.mdia.minf.stbl.sgpds.length > 0) && t.setSampleGroupProperties(C, F, F.number_in_traf, P.sample_groups_info);
13917
13915
  }
13918
13916
  }
13919
13917
  if (P.subs) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@video-editor/protocol",
3
3
  "type": "module",
4
- "version": "0.0.1-beta.23",
4
+ "version": "0.0.1-beta.24",
5
5
  "exports": {
6
6
  ".": {
7
7
  "import": "./dist/index.js"
@@ -26,7 +26,7 @@
26
26
  "ajv-keywords": "^5.1.0",
27
27
  "immer": "^11.1.0",
28
28
  "opfs-tools": "^0.7.4",
29
- "@video-editor/shared": "0.0.1-beta.23"
29
+ "@video-editor/shared": "0.0.1-beta.24"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@vue/reactivity": "^3.5.26"