@clockworkdog/cogs-client 3.0.2 → 3.0.4
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/browser/index.mjs
CHANGED
|
@@ -443,13 +443,13 @@ function sn({ interval: e, send: t, onChange: n = en, syncSampleSize: r = rn, sy
|
|
|
443
443
|
async function i() {
|
|
444
444
|
const h = [];
|
|
445
445
|
for (let m = 0; m < r; m++) {
|
|
446
|
-
const
|
|
446
|
+
const v = new Promise((I) => {
|
|
447
447
|
const H = nn(), de = Date.now(), fe = performance.now();
|
|
448
448
|
t({ timesync: { id: H } });
|
|
449
449
|
const S = (z, N) => I({ sentAt: fe, receivedAt: z, serverNow: N, clientNow: de });
|
|
450
450
|
s[H] = { complete: S }, setTimeout(() => I(null), o);
|
|
451
451
|
});
|
|
452
|
-
h.push(
|
|
452
|
+
h.push(v), await v;
|
|
453
453
|
}
|
|
454
454
|
const f = (await Promise.all(h)).filter((m) => m !== null), d = cn(f);
|
|
455
455
|
isNaN(d) || n(Date.now() + d);
|
|
@@ -527,8 +527,8 @@ class dc {
|
|
|
527
527
|
break;
|
|
528
528
|
case "media_config_update":
|
|
529
529
|
this._mediaConfig = m;
|
|
530
|
-
for (const
|
|
531
|
-
m[
|
|
530
|
+
for (const v of ["preferOptimizedAudio", "preferOptimizedVideo", "preferOptimizedImages"])
|
|
531
|
+
m[v] ? this.urlParams.set(v, "true") : this.urlParams.delete(v);
|
|
532
532
|
this.dispatchEvent(new mn(m));
|
|
533
533
|
break;
|
|
534
534
|
case "data_store_items":
|
|
@@ -549,9 +549,9 @@ class dc {
|
|
|
549
549
|
case "image_show":
|
|
550
550
|
case "image_hide":
|
|
551
551
|
case "image_set_fit": {
|
|
552
|
-
const { type:
|
|
552
|
+
const { type: v } = m;
|
|
553
553
|
"media_strategy" in m || console.warn(
|
|
554
|
-
`Legacy ${
|
|
554
|
+
`Legacy ${v} message received, this is no longer supported. Please upgrade to COGS 5.10 or downgrade to cogs-client@2.11`
|
|
555
555
|
);
|
|
556
556
|
}
|
|
557
557
|
}
|
|
@@ -1583,10 +1583,10 @@ const Tr = {
|
|
|
1583
1583
|
inst: e
|
|
1584
1584
|
}), n;
|
|
1585
1585
|
};
|
|
1586
|
-
}),
|
|
1586
|
+
}), w = /* @__PURE__ */ u("$ZodStringFormat", (e, t) => {
|
|
1587
1587
|
le.init(e, t), Oe.init(e, t);
|
|
1588
1588
|
}), Ir = /* @__PURE__ */ u("$ZodGUID", (e, t) => {
|
|
1589
|
-
t.pattern ?? (t.pattern = Yn),
|
|
1589
|
+
t.pattern ?? (t.pattern = Yn), w.init(e, t);
|
|
1590
1590
|
}), Pr = /* @__PURE__ */ u("$ZodUUID", (e, t) => {
|
|
1591
1591
|
if (t.version) {
|
|
1592
1592
|
const r = {
|
|
@@ -1604,11 +1604,11 @@ const Tr = {
|
|
|
1604
1604
|
t.pattern ?? (t.pattern = Le(r));
|
|
1605
1605
|
} else
|
|
1606
1606
|
t.pattern ?? (t.pattern = Le());
|
|
1607
|
-
|
|
1607
|
+
w.init(e, t);
|
|
1608
1608
|
}), Cr = /* @__PURE__ */ u("$ZodEmail", (e, t) => {
|
|
1609
|
-
t.pattern ?? (t.pattern = qn),
|
|
1609
|
+
t.pattern ?? (t.pattern = qn), w.init(e, t);
|
|
1610
1610
|
}), Ar = /* @__PURE__ */ u("$ZodURL", (e, t) => {
|
|
1611
|
-
|
|
1611
|
+
w.init(e, t), e._zod.check = (n) => {
|
|
1612
1612
|
try {
|
|
1613
1613
|
const r = n.value.trim(), o = new URL(r);
|
|
1614
1614
|
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
|
|
@@ -1640,31 +1640,31 @@ const Tr = {
|
|
|
1640
1640
|
}
|
|
1641
1641
|
};
|
|
1642
1642
|
}), Rr = /* @__PURE__ */ u("$ZodEmoji", (e, t) => {
|
|
1643
|
-
t.pattern ?? (t.pattern = Qn()),
|
|
1643
|
+
t.pattern ?? (t.pattern = Qn()), w.init(e, t);
|
|
1644
1644
|
}), Nr = /* @__PURE__ */ u("$ZodNanoID", (e, t) => {
|
|
1645
|
-
t.pattern ?? (t.pattern = Jn),
|
|
1645
|
+
t.pattern ?? (t.pattern = Jn), w.init(e, t);
|
|
1646
1646
|
}), Dr = /* @__PURE__ */ u("$ZodCUID", (e, t) => {
|
|
1647
|
-
t.pattern ?? (t.pattern = Kn),
|
|
1647
|
+
t.pattern ?? (t.pattern = Kn), w.init(e, t);
|
|
1648
1648
|
}), xr = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
|
|
1649
|
-
t.pattern ?? (t.pattern = Vn),
|
|
1649
|
+
t.pattern ?? (t.pattern = Vn), w.init(e, t);
|
|
1650
1650
|
}), Lr = /* @__PURE__ */ u("$ZodULID", (e, t) => {
|
|
1651
|
-
t.pattern ?? (t.pattern = Wn),
|
|
1651
|
+
t.pattern ?? (t.pattern = Wn), w.init(e, t);
|
|
1652
1652
|
}), jr = /* @__PURE__ */ u("$ZodXID", (e, t) => {
|
|
1653
|
-
t.pattern ?? (t.pattern = Gn),
|
|
1653
|
+
t.pattern ?? (t.pattern = Gn), w.init(e, t);
|
|
1654
1654
|
}), Ur = /* @__PURE__ */ u("$ZodKSUID", (e, t) => {
|
|
1655
|
-
t.pattern ?? (t.pattern = Bn),
|
|
1655
|
+
t.pattern ?? (t.pattern = Bn), w.init(e, t);
|
|
1656
1656
|
}), Mr = /* @__PURE__ */ u("$ZodISODateTime", (e, t) => {
|
|
1657
|
-
t.pattern ?? (t.pattern = ur(t)),
|
|
1657
|
+
t.pattern ?? (t.pattern = ur(t)), w.init(e, t);
|
|
1658
1658
|
}), Fr = /* @__PURE__ */ u("$ZodISODate", (e, t) => {
|
|
1659
|
-
t.pattern ?? (t.pattern = ir),
|
|
1659
|
+
t.pattern ?? (t.pattern = ir), w.init(e, t);
|
|
1660
1660
|
}), Kr = /* @__PURE__ */ u("$ZodISOTime", (e, t) => {
|
|
1661
|
-
t.pattern ?? (t.pattern = cr(t)),
|
|
1661
|
+
t.pattern ?? (t.pattern = cr(t)), w.init(e, t);
|
|
1662
1662
|
}), Vr = /* @__PURE__ */ u("$ZodISODuration", (e, t) => {
|
|
1663
|
-
t.pattern ?? (t.pattern = Hn),
|
|
1663
|
+
t.pattern ?? (t.pattern = Hn), w.init(e, t);
|
|
1664
1664
|
}), Wr = /* @__PURE__ */ u("$ZodIPv4", (e, t) => {
|
|
1665
|
-
t.pattern ?? (t.pattern = er),
|
|
1665
|
+
t.pattern ?? (t.pattern = er), w.init(e, t), e._zod.bag.format = "ipv4";
|
|
1666
1666
|
}), Gr = /* @__PURE__ */ u("$ZodIPv6", (e, t) => {
|
|
1667
|
-
t.pattern ?? (t.pattern = tr),
|
|
1667
|
+
t.pattern ?? (t.pattern = tr), w.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
1668
1668
|
try {
|
|
1669
1669
|
new URL(`http://[${n.value}]`);
|
|
1670
1670
|
} catch {
|
|
@@ -1678,9 +1678,9 @@ const Tr = {
|
|
|
1678
1678
|
}
|
|
1679
1679
|
};
|
|
1680
1680
|
}), Br = /* @__PURE__ */ u("$ZodCIDRv4", (e, t) => {
|
|
1681
|
-
t.pattern ?? (t.pattern = nr),
|
|
1681
|
+
t.pattern ?? (t.pattern = nr), w.init(e, t);
|
|
1682
1682
|
}), Jr = /* @__PURE__ */ u("$ZodCIDRv6", (e, t) => {
|
|
1683
|
-
t.pattern ?? (t.pattern = rr),
|
|
1683
|
+
t.pattern ?? (t.pattern = rr), w.init(e, t), e._zod.check = (n) => {
|
|
1684
1684
|
const r = n.value.split("/");
|
|
1685
1685
|
try {
|
|
1686
1686
|
if (r.length !== 2)
|
|
@@ -1717,7 +1717,7 @@ function St(e) {
|
|
|
1717
1717
|
}
|
|
1718
1718
|
}
|
|
1719
1719
|
const Hr = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
|
|
1720
|
-
t.pattern ?? (t.pattern = or),
|
|
1720
|
+
t.pattern ?? (t.pattern = or), w.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
|
|
1721
1721
|
St(n.value) || n.issues.push({
|
|
1722
1722
|
code: "invalid_format",
|
|
1723
1723
|
format: "base64",
|
|
@@ -1734,7 +1734,7 @@ function Yr(e) {
|
|
|
1734
1734
|
return St(n);
|
|
1735
1735
|
}
|
|
1736
1736
|
const qr = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
|
|
1737
|
-
t.pattern ?? (t.pattern = yt),
|
|
1737
|
+
t.pattern ?? (t.pattern = yt), w.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
|
|
1738
1738
|
Yr(n.value) || n.issues.push({
|
|
1739
1739
|
code: "invalid_format",
|
|
1740
1740
|
format: "base64url",
|
|
@@ -1744,7 +1744,7 @@ const qr = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
|
|
|
1744
1744
|
});
|
|
1745
1745
|
};
|
|
1746
1746
|
}), Xr = /* @__PURE__ */ u("$ZodE164", (e, t) => {
|
|
1747
|
-
t.pattern ?? (t.pattern = sr),
|
|
1747
|
+
t.pattern ?? (t.pattern = sr), w.init(e, t);
|
|
1748
1748
|
});
|
|
1749
1749
|
function Qr(e, t = null) {
|
|
1750
1750
|
try {
|
|
@@ -1761,7 +1761,7 @@ function Qr(e, t = null) {
|
|
|
1761
1761
|
}
|
|
1762
1762
|
}
|
|
1763
1763
|
const eo = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
1764
|
-
|
|
1764
|
+
w.init(e, t), e._zod.check = (n) => {
|
|
1765
1765
|
Qr(n.value, t.alg) || n.issues.push({
|
|
1766
1766
|
code: "invalid_format",
|
|
1767
1767
|
format: "jwt",
|
|
@@ -1927,25 +1927,25 @@ const co = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1927
1927
|
c.value = {};
|
|
1928
1928
|
const h = [], f = i.shape;
|
|
1929
1929
|
for (const d of i.keys) {
|
|
1930
|
-
const
|
|
1931
|
-
|
|
1930
|
+
const v = f[d]._zod.run({ value: l[d], issues: [] }, a);
|
|
1931
|
+
v instanceof Promise ? h.push(v.then((I) => se(I, c, d, l))) : se(v, c, d, l);
|
|
1932
1932
|
}
|
|
1933
1933
|
return s ? It(h, l, c, a, r.value, e) : h.length ? Promise.all(h).then(() => c) : c;
|
|
1934
1934
|
};
|
|
1935
1935
|
}), uo = /* @__PURE__ */ u("$ZodObjectJIT", (e, t) => {
|
|
1936
1936
|
co.init(e, t);
|
|
1937
1937
|
const n = e._zod.parse, r = ke(() => Tt(t)), o = (d) => {
|
|
1938
|
-
const m = new Or(["shape", "payload", "ctx"]),
|
|
1938
|
+
const m = new Or(["shape", "payload", "ctx"]), v = r.value, I = (S) => {
|
|
1939
1939
|
const z = xe(S);
|
|
1940
1940
|
return `shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`;
|
|
1941
1941
|
};
|
|
1942
1942
|
m.write("const input = payload.value;");
|
|
1943
1943
|
const H = /* @__PURE__ */ Object.create(null);
|
|
1944
1944
|
let de = 0;
|
|
1945
|
-
for (const S of
|
|
1945
|
+
for (const S of v.keys)
|
|
1946
1946
|
H[S] = `key_${de++}`;
|
|
1947
1947
|
m.write("const newResult = {};");
|
|
1948
|
-
for (const S of
|
|
1948
|
+
for (const S of v.keys) {
|
|
1949
1949
|
const z = H[S], N = xe(S);
|
|
1950
1950
|
m.write(`const ${z} = ${I(S)};`), m.write(`
|
|
1951
1951
|
if (${z}.issues.length) {
|
|
@@ -1975,11 +1975,11 @@ const co = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1975
1975
|
let f;
|
|
1976
1976
|
e._zod.parse = (d, m) => {
|
|
1977
1977
|
f ?? (f = r.value);
|
|
1978
|
-
const
|
|
1979
|
-
return i(
|
|
1978
|
+
const v = d.value;
|
|
1979
|
+
return i(v) ? c && l && m?.async === !1 && m.jitless !== !0 ? (s || (s = o(t.shape)), d = s(d, m), h ? It([], v, d, m, f, e) : d) : n(d, m) : (d.issues.push({
|
|
1980
1980
|
expected: "object",
|
|
1981
1981
|
code: "invalid_type",
|
|
1982
|
-
input:
|
|
1982
|
+
input: v,
|
|
1983
1983
|
inst: e
|
|
1984
1984
|
}), d);
|
|
1985
1985
|
};
|
|
@@ -2879,7 +2879,7 @@ const Ts = (e, t) => {
|
|
|
2879
2879
|
});
|
|
2880
2880
|
}, Z = /* @__PURE__ */ u("ZodError", Ts, {
|
|
2881
2881
|
Parent: Error
|
|
2882
|
-
}), Is = /* @__PURE__ */ Ze(Z), Ps = /* @__PURE__ */ Se(Z), Cs = /* @__PURE__ */ ue(Z), As = /* @__PURE__ */ ae(Z), Rs = /* @__PURE__ */ Nn(Z), Ns = /* @__PURE__ */ Dn(Z), Ds = /* @__PURE__ */ xn(Z), xs = /* @__PURE__ */ Ln(Z), Ls = /* @__PURE__ */ jn(Z), js = /* @__PURE__ */ Un(Z), Us = /* @__PURE__ */ Mn(Z), Ms = /* @__PURE__ */ Fn(Z),
|
|
2882
|
+
}), Is = /* @__PURE__ */ Ze(Z), Ps = /* @__PURE__ */ Se(Z), Cs = /* @__PURE__ */ ue(Z), As = /* @__PURE__ */ ae(Z), Rs = /* @__PURE__ */ Nn(Z), Ns = /* @__PURE__ */ Dn(Z), Ds = /* @__PURE__ */ xn(Z), xs = /* @__PURE__ */ Ln(Z), Ls = /* @__PURE__ */ jn(Z), js = /* @__PURE__ */ Un(Z), Us = /* @__PURE__ */ Mn(Z), Ms = /* @__PURE__ */ Fn(Z), y = /* @__PURE__ */ u("ZodType", (e, t) => (g.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(j(t, {
|
|
2883
2883
|
checks: [
|
|
2884
2884
|
...t.checks ?? [],
|
|
2885
2885
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
@@ -2898,7 +2898,7 @@ const Ts = (e, t) => {
|
|
|
2898
2898
|
const r = e.clone();
|
|
2899
2899
|
return te.add(r, n[0]), r;
|
|
2900
2900
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), At = /* @__PURE__ */ u("_ZodString", (e, t) => {
|
|
2901
|
-
Oe.init(e, t),
|
|
2901
|
+
Oe.init(e, t), y.init(e, t);
|
|
2902
2902
|
const n = e._zod.bag;
|
|
2903
2903
|
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(is(...r)), e.includes = (...r) => e.check(as(...r)), e.startsWith = (...r) => e.check(ls(...r)), e.endsWith = (...r) => e.check(hs(...r)), e.min = (...r) => e.check(ie(...r)), e.max = (...r) => e.check(Pt(...r)), e.length = (...r) => e.check(Ct(...r)), e.nonempty = (...r) => e.check(ie(1, ...r)), e.lowercase = (r) => e.check(cs(r)), e.uppercase = (r) => e.check(us(r)), e.trim = () => e.check(fs()), e.normalize = (...r) => e.check(ds(...r)), e.toLowerCase = () => e.check(ps()), e.toUpperCase = () => e.check(ms()), e.slugify = () => e.check(_s());
|
|
2904
2904
|
}), Fs = /* @__PURE__ */ u("ZodString", (e, t) => {
|
|
@@ -2908,7 +2908,7 @@ function W(e) {
|
|
|
2908
2908
|
return Oo(Fs, e);
|
|
2909
2909
|
}
|
|
2910
2910
|
const k = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
2911
|
-
|
|
2911
|
+
w.init(e, t), At.init(e, t);
|
|
2912
2912
|
}), Ks = /* @__PURE__ */ u("ZodEmail", (e, t) => {
|
|
2913
2913
|
Cr.init(e, t), k.init(e, t);
|
|
2914
2914
|
}), Xe = /* @__PURE__ */ u("ZodGUID", (e, t) => {
|
|
@@ -2948,7 +2948,7 @@ const k = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
|
2948
2948
|
}), si = /* @__PURE__ */ u("ZodJWT", (e, t) => {
|
|
2949
2949
|
eo.init(e, t), k.init(e, t);
|
|
2950
2950
|
}), Rt = /* @__PURE__ */ u("ZodNumber", (e, t) => {
|
|
2951
|
-
Ot.init(e, t),
|
|
2951
|
+
Ot.init(e, t), y.init(e, t), e.gt = (r, o) => e.check(Ye(r, o)), e.gte = (r, o) => e.check(me(r, o)), e.min = (r, o) => e.check(me(r, o)), e.lt = (r, o) => e.check(He(r, o)), e.lte = (r, o) => e.check(pe(r, o)), e.max = (r, o) => e.check(pe(r, o)), e.int = (r) => e.check(Qe(r)), e.safe = (r) => e.check(Qe(r)), e.positive = (r) => e.check(Ye(0, r)), e.nonnegative = (r) => e.check(me(0, r)), e.negative = (r) => e.check(He(0, r)), e.nonpositive = (r) => e.check(pe(0, r)), e.multipleOf = (r, o) => e.check(qe(r, o)), e.step = (r, o) => e.check(qe(r, o)), e.finite = () => e;
|
|
2952
2952
|
const n = e._zod.bag;
|
|
2953
2953
|
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
2954
2954
|
});
|
|
@@ -2962,39 +2962,39 @@ function Qe(e) {
|
|
|
2962
2962
|
return ts(ii, e);
|
|
2963
2963
|
}
|
|
2964
2964
|
const ci = /* @__PURE__ */ u("ZodBoolean", (e, t) => {
|
|
2965
|
-
no.init(e, t),
|
|
2965
|
+
no.init(e, t), y.init(e, t);
|
|
2966
2966
|
});
|
|
2967
2967
|
function Nt(e) {
|
|
2968
2968
|
return ns(ci, e);
|
|
2969
2969
|
}
|
|
2970
2970
|
const ui = /* @__PURE__ */ u("ZodNull", (e, t) => {
|
|
2971
|
-
ro.init(e, t),
|
|
2971
|
+
ro.init(e, t), y.init(e, t);
|
|
2972
2972
|
});
|
|
2973
2973
|
function ai(e) {
|
|
2974
2974
|
return rs(ui, e);
|
|
2975
2975
|
}
|
|
2976
2976
|
const li = /* @__PURE__ */ u("ZodUnknown", (e, t) => {
|
|
2977
|
-
oo.init(e, t),
|
|
2977
|
+
oo.init(e, t), y.init(e, t);
|
|
2978
2978
|
});
|
|
2979
2979
|
function et() {
|
|
2980
2980
|
return os(li);
|
|
2981
2981
|
}
|
|
2982
2982
|
const hi = /* @__PURE__ */ u("ZodNever", (e, t) => {
|
|
2983
|
-
so.init(e, t),
|
|
2983
|
+
so.init(e, t), y.init(e, t);
|
|
2984
2984
|
});
|
|
2985
2985
|
function di(e) {
|
|
2986
2986
|
return ss(hi, e);
|
|
2987
2987
|
}
|
|
2988
2988
|
const fi = /* @__PURE__ */ u("ZodArray", (e, t) => {
|
|
2989
|
-
io.init(e, t),
|
|
2989
|
+
io.init(e, t), y.init(e, t), e.element = t.element, e.min = (n, r) => e.check(ie(n, r)), e.nonempty = (n) => e.check(ie(1, n)), e.max = (n, r) => e.check(Pt(n, r)), e.length = (n, r) => e.check(Ct(n, r)), e.unwrap = () => e.element;
|
|
2990
2990
|
});
|
|
2991
2991
|
function pi(e, t) {
|
|
2992
2992
|
return gs(fi, e, t);
|
|
2993
2993
|
}
|
|
2994
2994
|
const mi = /* @__PURE__ */ u("ZodObject", (e, t) => {
|
|
2995
|
-
uo.init(e, t),
|
|
2995
|
+
uo.init(e, t), y.init(e, t), _(e, "shape", () => t.shape), e.keyof = () => ki(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: et() }), e.loose = () => e.clone({ ...e._zod.def, catchall: et() }), e.strict = () => e.clone({ ...e._zod.def, catchall: di() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Zn(e, n), e.safeExtend = (n) => Sn(e, n), e.merge = (n) => On(e, n), e.pick = (n) => zn(e, n), e.omit = (n) => $n(e, n), e.partial = (...n) => Tn(Dt, e, n[0]), e.required = (...n) => In(xt, e, n[0]);
|
|
2996
2996
|
});
|
|
2997
|
-
function
|
|
2997
|
+
function b(e, t) {
|
|
2998
2998
|
const n = {
|
|
2999
2999
|
type: "object",
|
|
3000
3000
|
shape: e ?? {},
|
|
@@ -3003,7 +3003,7 @@ function v(e, t) {
|
|
|
3003
3003
|
return new mi(n);
|
|
3004
3004
|
}
|
|
3005
3005
|
const _i = /* @__PURE__ */ u("ZodUnion", (e, t) => {
|
|
3006
|
-
ao.init(e, t),
|
|
3006
|
+
ao.init(e, t), y.init(e, t), e.options = t.options;
|
|
3007
3007
|
});
|
|
3008
3008
|
function U(e, t) {
|
|
3009
3009
|
return new _i({
|
|
@@ -3013,7 +3013,7 @@ function U(e, t) {
|
|
|
3013
3013
|
});
|
|
3014
3014
|
}
|
|
3015
3015
|
const gi = /* @__PURE__ */ u("ZodIntersection", (e, t) => {
|
|
3016
|
-
lo.init(e, t),
|
|
3016
|
+
lo.init(e, t), y.init(e, t);
|
|
3017
3017
|
});
|
|
3018
3018
|
function vi(e, t) {
|
|
3019
3019
|
return new gi({
|
|
@@ -3023,7 +3023,7 @@ function vi(e, t) {
|
|
|
3023
3023
|
});
|
|
3024
3024
|
}
|
|
3025
3025
|
const bi = /* @__PURE__ */ u("ZodTuple", (e, t) => {
|
|
3026
|
-
ho.init(e, t),
|
|
3026
|
+
ho.init(e, t), y.init(e, t), e.rest = (n) => e.clone({
|
|
3027
3027
|
...e._zod.def,
|
|
3028
3028
|
rest: n
|
|
3029
3029
|
});
|
|
@@ -3038,7 +3038,7 @@ function T(e, t, n) {
|
|
|
3038
3038
|
});
|
|
3039
3039
|
}
|
|
3040
3040
|
const wi = /* @__PURE__ */ u("ZodRecord", (e, t) => {
|
|
3041
|
-
fo.init(e, t),
|
|
3041
|
+
fo.init(e, t), y.init(e, t), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
3042
3042
|
});
|
|
3043
3043
|
function yi(e, t, n) {
|
|
3044
3044
|
return new wi({
|
|
@@ -3049,7 +3049,7 @@ function yi(e, t, n) {
|
|
|
3049
3049
|
});
|
|
3050
3050
|
}
|
|
3051
3051
|
const ye = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
3052
|
-
po.init(e, t),
|
|
3052
|
+
po.init(e, t), y.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
3053
3053
|
const n = new Set(Object.keys(t.entries));
|
|
3054
3054
|
e.extract = (r, o) => {
|
|
3055
3055
|
const s = {};
|
|
@@ -3088,7 +3088,7 @@ function ki(e, t) {
|
|
|
3088
3088
|
});
|
|
3089
3089
|
}
|
|
3090
3090
|
const Ei = /* @__PURE__ */ u("ZodLiteral", (e, t) => {
|
|
3091
|
-
mo.init(e, t),
|
|
3091
|
+
mo.init(e, t), y.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", {
|
|
3092
3092
|
get() {
|
|
3093
3093
|
if (t.values.length > 1)
|
|
3094
3094
|
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
@@ -3104,7 +3104,7 @@ function P(e, t) {
|
|
|
3104
3104
|
});
|
|
3105
3105
|
}
|
|
3106
3106
|
const zi = /* @__PURE__ */ u("ZodTransform", (e, t) => {
|
|
3107
|
-
_o.init(e, t),
|
|
3107
|
+
_o.init(e, t), y.init(e, t), e._zod.parse = (n, r) => {
|
|
3108
3108
|
if (r.direction === "backward")
|
|
3109
3109
|
throw new pt(e.constructor.name);
|
|
3110
3110
|
n.addIssue = (s) => {
|
|
@@ -3126,7 +3126,7 @@ function $i(e) {
|
|
|
3126
3126
|
});
|
|
3127
3127
|
}
|
|
3128
3128
|
const Dt = /* @__PURE__ */ u("ZodOptional", (e, t) => {
|
|
3129
|
-
go.init(e, t),
|
|
3129
|
+
go.init(e, t), y.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3130
3130
|
});
|
|
3131
3131
|
function tt(e) {
|
|
3132
3132
|
return new Dt({
|
|
@@ -3135,7 +3135,7 @@ function tt(e) {
|
|
|
3135
3135
|
});
|
|
3136
3136
|
}
|
|
3137
3137
|
const Zi = /* @__PURE__ */ u("ZodNullable", (e, t) => {
|
|
3138
|
-
vo.init(e, t),
|
|
3138
|
+
vo.init(e, t), y.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3139
3139
|
});
|
|
3140
3140
|
function nt(e) {
|
|
3141
3141
|
return new Zi({
|
|
@@ -3144,7 +3144,7 @@ function nt(e) {
|
|
|
3144
3144
|
});
|
|
3145
3145
|
}
|
|
3146
3146
|
const Si = /* @__PURE__ */ u("ZodDefault", (e, t) => {
|
|
3147
|
-
bo.init(e, t),
|
|
3147
|
+
bo.init(e, t), y.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
3148
3148
|
});
|
|
3149
3149
|
function Oi(e, t) {
|
|
3150
3150
|
return new Si({
|
|
@@ -3156,7 +3156,7 @@ function Oi(e, t) {
|
|
|
3156
3156
|
});
|
|
3157
3157
|
}
|
|
3158
3158
|
const Ti = /* @__PURE__ */ u("ZodPrefault", (e, t) => {
|
|
3159
|
-
wo.init(e, t),
|
|
3159
|
+
wo.init(e, t), y.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3160
3160
|
});
|
|
3161
3161
|
function Ii(e, t) {
|
|
3162
3162
|
return new Ti({
|
|
@@ -3168,7 +3168,7 @@ function Ii(e, t) {
|
|
|
3168
3168
|
});
|
|
3169
3169
|
}
|
|
3170
3170
|
const xt = /* @__PURE__ */ u("ZodNonOptional", (e, t) => {
|
|
3171
|
-
yo.init(e, t),
|
|
3171
|
+
yo.init(e, t), y.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3172
3172
|
});
|
|
3173
3173
|
function Pi(e, t) {
|
|
3174
3174
|
return new xt({
|
|
@@ -3178,7 +3178,7 @@ function Pi(e, t) {
|
|
|
3178
3178
|
});
|
|
3179
3179
|
}
|
|
3180
3180
|
const Ci = /* @__PURE__ */ u("ZodCatch", (e, t) => {
|
|
3181
|
-
ko.init(e, t),
|
|
3181
|
+
ko.init(e, t), y.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
3182
3182
|
});
|
|
3183
3183
|
function Ai(e, t) {
|
|
3184
3184
|
return new Ci({
|
|
@@ -3188,7 +3188,7 @@ function Ai(e, t) {
|
|
|
3188
3188
|
});
|
|
3189
3189
|
}
|
|
3190
3190
|
const Ri = /* @__PURE__ */ u("ZodPipe", (e, t) => {
|
|
3191
|
-
Eo.init(e, t),
|
|
3191
|
+
Eo.init(e, t), y.init(e, t), e.in = t.in, e.out = t.out;
|
|
3192
3192
|
});
|
|
3193
3193
|
function rt(e, t) {
|
|
3194
3194
|
return new Ri({
|
|
@@ -3199,7 +3199,7 @@ function rt(e, t) {
|
|
|
3199
3199
|
});
|
|
3200
3200
|
}
|
|
3201
3201
|
const Ni = /* @__PURE__ */ u("ZodReadonly", (e, t) => {
|
|
3202
|
-
zo.init(e, t),
|
|
3202
|
+
zo.init(e, t), y.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3203
3203
|
});
|
|
3204
3204
|
function Di(e) {
|
|
3205
3205
|
return new Ni({
|
|
@@ -3208,7 +3208,7 @@ function Di(e) {
|
|
|
3208
3208
|
});
|
|
3209
3209
|
}
|
|
3210
3210
|
const xi = /* @__PURE__ */ u("ZodCustom", (e, t) => {
|
|
3211
|
-
$o.init(e, t),
|
|
3211
|
+
$o.init(e, t), y.init(e, t);
|
|
3212
3212
|
});
|
|
3213
3213
|
function Li(e, t = {}) {
|
|
3214
3214
|
return vs(xi, e, t);
|
|
@@ -3216,24 +3216,24 @@ function Li(e, t = {}) {
|
|
|
3216
3216
|
function ji(e) {
|
|
3217
3217
|
return bs(e);
|
|
3218
3218
|
}
|
|
3219
|
-
const he =
|
|
3219
|
+
const he = b({
|
|
3220
3220
|
t: $().gte(0),
|
|
3221
3221
|
rate: $().gte(0)
|
|
3222
|
-
}), G =
|
|
3222
|
+
}), G = b({
|
|
3223
3223
|
opacity: $().gte(0).lte(1),
|
|
3224
3224
|
zIndex: $().default(0)
|
|
3225
|
-
}), B =
|
|
3225
|
+
}), B = b({
|
|
3226
3226
|
volume: $().gte(0).lte(1)
|
|
3227
|
-
}), Ui =
|
|
3227
|
+
}), Ui = b({
|
|
3228
3228
|
type: P("image"),
|
|
3229
3229
|
file: W(),
|
|
3230
3230
|
fit: U([P("contain"), P("cover"), P("none")])
|
|
3231
|
-
}), Mi =
|
|
3231
|
+
}), Mi = b({
|
|
3232
3232
|
type: P("audio"),
|
|
3233
3233
|
file: W(),
|
|
3234
3234
|
audioOutput: W(),
|
|
3235
3235
|
enablePlaybackRateAdjustment: Nt()
|
|
3236
|
-
}), Fi =
|
|
3236
|
+
}), Fi = b({
|
|
3237
3237
|
type: P("video"),
|
|
3238
3238
|
file: W(),
|
|
3239
3239
|
audioOutput: W(),
|
|
@@ -3241,44 +3241,44 @@ const he = v({
|
|
|
3241
3241
|
fit: U([P("contain"), P("cover"), P("none")])
|
|
3242
3242
|
}), Te = T([$(), ai()]), Ki = T([
|
|
3243
3243
|
$(),
|
|
3244
|
-
|
|
3245
|
-
set:
|
|
3244
|
+
b({
|
|
3245
|
+
set: b({
|
|
3246
3246
|
...G.shape
|
|
3247
3247
|
}).partial()
|
|
3248
3248
|
}).partial()
|
|
3249
3249
|
]), Vi = T([
|
|
3250
3250
|
$(),
|
|
3251
|
-
|
|
3252
|
-
set:
|
|
3251
|
+
b({
|
|
3252
|
+
set: b({
|
|
3253
3253
|
...G.shape
|
|
3254
3254
|
}).partial(),
|
|
3255
|
-
lerp:
|
|
3255
|
+
lerp: b({
|
|
3256
3256
|
...G.shape
|
|
3257
3257
|
}).partial()
|
|
3258
3258
|
}).partial()
|
|
3259
3259
|
]), Wi = T([
|
|
3260
3260
|
$(),
|
|
3261
|
-
|
|
3262
|
-
set:
|
|
3261
|
+
b({
|
|
3262
|
+
set: b({
|
|
3263
3263
|
...he.shape,
|
|
3264
3264
|
...B.shape
|
|
3265
3265
|
}).partial()
|
|
3266
3266
|
}).partial()
|
|
3267
3267
|
]), Gi = T([
|
|
3268
3268
|
$(),
|
|
3269
|
-
|
|
3270
|
-
set:
|
|
3269
|
+
b({
|
|
3270
|
+
set: b({
|
|
3271
3271
|
...he.shape,
|
|
3272
3272
|
...B.shape
|
|
3273
3273
|
}).partial(),
|
|
3274
|
-
lerp:
|
|
3274
|
+
lerp: b({
|
|
3275
3275
|
...B.shape
|
|
3276
3276
|
}).partial()
|
|
3277
3277
|
}).partial()
|
|
3278
3278
|
]), Bi = T([
|
|
3279
3279
|
$(),
|
|
3280
|
-
|
|
3281
|
-
set:
|
|
3280
|
+
b({
|
|
3281
|
+
set: b({
|
|
3282
3282
|
...he.shape,
|
|
3283
3283
|
...B.shape,
|
|
3284
3284
|
...G.shape
|
|
@@ -3286,24 +3286,24 @@ const he = v({
|
|
|
3286
3286
|
}).partial()
|
|
3287
3287
|
]), Ji = T([
|
|
3288
3288
|
$(),
|
|
3289
|
-
|
|
3290
|
-
set:
|
|
3289
|
+
b({
|
|
3290
|
+
set: b({
|
|
3291
3291
|
...he.shape,
|
|
3292
3292
|
...B.shape,
|
|
3293
3293
|
...G.shape
|
|
3294
3294
|
}).partial(),
|
|
3295
|
-
lerp:
|
|
3295
|
+
lerp: b({
|
|
3296
3296
|
...B.shape,
|
|
3297
3297
|
...G.shape
|
|
3298
3298
|
}).partial()
|
|
3299
3299
|
}).partial()
|
|
3300
|
-
]), Hi =
|
|
3300
|
+
]), Hi = b({
|
|
3301
3301
|
...Ui.shape,
|
|
3302
3302
|
keyframes: T([Vi], U([Ki, Te]))
|
|
3303
|
-
}), Yi =
|
|
3303
|
+
}), Yi = b({
|
|
3304
3304
|
...Mi.shape,
|
|
3305
3305
|
keyframes: T([Gi], U([Wi, Te]))
|
|
3306
|
-
}), qi =
|
|
3306
|
+
}), qi = b({
|
|
3307
3307
|
...Fi.shape,
|
|
3308
3308
|
keyframes: T([Ji], U([Bi, Te]))
|
|
3309
3309
|
}), Xi = yi(W(), U([Hi, Yi, qi])), Lt = {
|
|
@@ -3471,7 +3471,7 @@ function Mt(e, t, n, r) {
|
|
|
3471
3471
|
} catch {
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
3474
|
-
const st = 2e3, nc = 1e3, it = 100, ct = 50, Ft = 5, re = 1e3, rc = 10, oc =
|
|
3474
|
+
const st = 2e3, nc = 1e3, it = 100, ct = 50, Ft = 5, re = 1e3, rc = 10, oc = 100, sc = 0.3, ic = 0.1;
|
|
3475
3475
|
function cc(e) {
|
|
3476
3476
|
return Math.sign(e) * Math.pow(Math.abs(e) / re, sc) * ic;
|
|
3477
3477
|
}
|
|
@@ -3479,17 +3479,17 @@ function O(e, t) {
|
|
|
3479
3479
|
e.playbackRate !== t && (e.playbackRate = t), e.paused && e.play().catch(() => {
|
|
3480
3480
|
});
|
|
3481
3481
|
}
|
|
3482
|
-
function Kt(e, t, n, r, o) {
|
|
3483
|
-
const
|
|
3484
|
-
let
|
|
3482
|
+
function Kt(e, t, n, r, o, s) {
|
|
3483
|
+
const i = s && !ec;
|
|
3484
|
+
let c = !1;
|
|
3485
3485
|
if (e.duration) {
|
|
3486
|
-
const
|
|
3487
|
-
if (
|
|
3488
|
-
const
|
|
3489
|
-
|
|
3486
|
+
const d = n.filter(([m]) => m > n[0][0] && m > r).filter(([, m]) => m?.set?.t !== void 0 || m?.set?.rate !== void 0)[0];
|
|
3487
|
+
if (d?.[1]?.set?.t === 0) {
|
|
3488
|
+
const m = (e.duration * 1e3 - t.t) / t.rate, v = d[0] - r;
|
|
3489
|
+
c = Math.abs(m - v) <= oc, e.loop !== c && (e.loop = c);
|
|
3490
3490
|
}
|
|
3491
3491
|
}
|
|
3492
|
-
const
|
|
3492
|
+
const a = e.currentTime * 1e3, l = c && e.duration !== void 0 ? tc(a, t.t, e.duration * 1e3) : a - t.t, h = Math.abs(l);
|
|
3493
3493
|
switch (!0) {
|
|
3494
3494
|
/**
|
|
3495
3495
|
* Seek ahead behavior
|
|
@@ -3497,21 +3497,21 @@ function Kt(e, t, n, r, o) {
|
|
|
3497
3497
|
* We'll make sure everything is buffered and ready, then wait until we're on time.
|
|
3498
3498
|
* We'll try to press play once and leave it to continue.
|
|
3499
3499
|
*/
|
|
3500
|
-
case (!
|
|
3501
|
-
const
|
|
3502
|
-
return e.duration !== void 0 &&
|
|
3500
|
+
case (!i && o.state === "idle" && t.rate > 0 && h > st): {
|
|
3501
|
+
const f = (t.t + t.rate * nc) / 1e3;
|
|
3502
|
+
return e.duration !== void 0 && f > e.duration && !c ? { state: "idle" } : (O(e, 0), e.currentTime = c ? ce(f, e.duration * 1e3) : f, { state: "seeking-ahead" });
|
|
3503
3503
|
}
|
|
3504
|
-
case (
|
|
3504
|
+
case (o.state === "seeking-ahead" && e.seeking === !0):
|
|
3505
3505
|
return { state: "seeking-ahead" };
|
|
3506
|
-
case (
|
|
3506
|
+
case (o.state === "seeking-ahead" && e.seeking === !1):
|
|
3507
3507
|
return O(e, 0), { state: "seeked-ahead" };
|
|
3508
|
-
case (
|
|
3508
|
+
case (o.state === "seeked-ahead" && l < -it):
|
|
3509
3509
|
return O(e, t.rate), console.warn("Failed to seek ahead in time"), { state: "idle" };
|
|
3510
|
-
case (
|
|
3510
|
+
case (o.state === "seeked-ahead" && h <= it):
|
|
3511
3511
|
return O(e, t.rate), { state: "idle" };
|
|
3512
|
-
case (
|
|
3512
|
+
case (o.state === "seeked-ahead" && h > st * 1.5):
|
|
3513
3513
|
return console.warn("Failed to seek ahead"), { state: "idle" };
|
|
3514
|
-
case
|
|
3514
|
+
case o.state === "seeked-ahead":
|
|
3515
3515
|
return { state: "seeked-ahead" };
|
|
3516
3516
|
/**
|
|
3517
3517
|
* Time synchronization behavior
|
|
@@ -3519,40 +3519,40 @@ function Kt(e, t, n, r, o) {
|
|
|
3519
3519
|
* We address larger deviations with a seek, hoping to land close enough so we can finely adjust with playbackRate.
|
|
3520
3520
|
*/
|
|
3521
3521
|
// Start intercept
|
|
3522
|
-
case (
|
|
3523
|
-
const
|
|
3524
|
-
return O(e,
|
|
3522
|
+
case (i && o.state === "idle" && t.rate > 0 && h > ct && h <= re): {
|
|
3523
|
+
const f = cc(l), d = Math.max(0, t.rate - f);
|
|
3524
|
+
return O(e, d), { state: "intercepting" };
|
|
3525
3525
|
}
|
|
3526
3526
|
// Perfectly intercepted
|
|
3527
|
-
case (
|
|
3527
|
+
case (o.state === "intercepting" && h <= Ft):
|
|
3528
3528
|
return O(e, t.rate), { state: "idle" };
|
|
3529
3529
|
// Intercept went too far
|
|
3530
|
-
case (
|
|
3530
|
+
case (o.state === "intercepting" && Math.sign(l) === Math.sign(e.playbackRate - t.rate)):
|
|
3531
3531
|
return O(e, t.rate), { state: "idle" };
|
|
3532
3532
|
// We're still on course
|
|
3533
|
-
case (
|
|
3533
|
+
case (o.state === "intercepting" && h < re * 2):
|
|
3534
3534
|
return { state: "intercepting" };
|
|
3535
3535
|
// We're way off track
|
|
3536
|
-
case
|
|
3536
|
+
case o.state === "intercepting":
|
|
3537
3537
|
return O(e, t.rate), { state: "idle" };
|
|
3538
3538
|
/**
|
|
3539
3539
|
* Time synchronization behavior
|
|
3540
3540
|
* When playbackRate adjustment is enabled we will address small deviations in time by ramping speed up and down.
|
|
3541
3541
|
* We address larger deviations with a seek, hoping to land close enough so we can finely adjust with playbackRate.
|
|
3542
3542
|
*/
|
|
3543
|
-
case (
|
|
3544
|
-
const
|
|
3545
|
-
return e.currentTime =
|
|
3543
|
+
case (i && o.state === "idle" && h > re): {
|
|
3544
|
+
const f = (t.t + t.rate * rc) / 1e3;
|
|
3545
|
+
return e.currentTime = c ? ce(f, e.duration * 1e3) : f, O(e, t.rate), { state: "seeking" };
|
|
3546
3546
|
}
|
|
3547
|
-
case (
|
|
3547
|
+
case (o.state === "seeking" && e.seeking):
|
|
3548
3548
|
return { state: "seeking" };
|
|
3549
|
-
case (
|
|
3549
|
+
case (o.state === "seeking" && !e.seeking):
|
|
3550
3550
|
return { state: "idle" };
|
|
3551
3551
|
/**
|
|
3552
3552
|
* Idle behavior
|
|
3553
3553
|
*/
|
|
3554
|
-
case
|
|
3555
|
-
return O(e, t.rate), t.rate === 0 &&
|
|
3554
|
+
case o.state === "idle":
|
|
3555
|
+
return O(e, t.rate), t.rate === 0 && h > ct && (e.currentTime = t.t / 1e3), { state: "idle" };
|
|
3556
3556
|
/**
|
|
3557
3557
|
* If none of the above conditions are met, we should exit the behavior.
|
|
3558
3558
|
* For example: we are intercepting but the media has now been paused
|
|
@@ -3582,24 +3582,25 @@ class ut extends Ce {
|
|
|
3582
3582
|
audioElement;
|
|
3583
3583
|
volume = 1;
|
|
3584
3584
|
update() {
|
|
3585
|
-
const t = Pe(this._state,
|
|
3586
|
-
if (
|
|
3585
|
+
const t = Date.now(), n = Pe(this._state, t);
|
|
3586
|
+
if (n ? this.audioElement = Ae(
|
|
3587
3587
|
this.audioElement,
|
|
3588
3588
|
this.clipElement,
|
|
3589
3589
|
this._state,
|
|
3590
3590
|
this.constructAssetURL,
|
|
3591
3591
|
this.mediaPreloader
|
|
3592
|
-
) : this.destroy(), !
|
|
3593
|
-
const
|
|
3594
|
-
Mt(this.audioElement,
|
|
3595
|
-
const
|
|
3592
|
+
) : this.destroy(), !n || !this.audioElement) return;
|
|
3593
|
+
const r = this.getAudioOutput(this._state.audioOutput);
|
|
3594
|
+
Mt(this.audioElement, n, r, this.volume);
|
|
3595
|
+
const o = Kt(
|
|
3596
3596
|
this.audioElement,
|
|
3597
|
-
|
|
3597
|
+
n,
|
|
3598
3598
|
this._state.keyframes,
|
|
3599
|
+
t,
|
|
3599
3600
|
this.syncState,
|
|
3600
3601
|
this._state.enablePlaybackRateAdjustment
|
|
3601
3602
|
);
|
|
3602
|
-
this.syncState =
|
|
3603
|
+
this.syncState = o;
|
|
3603
3604
|
}
|
|
3604
3605
|
destroy() {
|
|
3605
3606
|
this.audioElement && (this.audioElement.pause(), this.audioElement.remove(), this.audioElement.volume = 0, this.audioElement.currentTime = 0, this.mediaPreloader.releaseElement(this.audioElement)), this.audioElement = void 0;
|
|
@@ -3610,24 +3611,25 @@ class at extends Ce {
|
|
|
3610
3611
|
videoElement;
|
|
3611
3612
|
volume = 1;
|
|
3612
3613
|
update() {
|
|
3613
|
-
const t = Pe(this._state,
|
|
3614
|
-
if (
|
|
3614
|
+
const t = Date.now(), n = Pe(this._state, t);
|
|
3615
|
+
if (n ? this.videoElement = Ae(
|
|
3615
3616
|
this.videoElement,
|
|
3616
3617
|
this.clipElement,
|
|
3617
3618
|
this._state,
|
|
3618
3619
|
this.constructAssetURL,
|
|
3619
3620
|
this.mediaPreloader
|
|
3620
|
-
) : this.destroy(), !
|
|
3621
|
-
const
|
|
3622
|
-
Ut(this.videoElement,
|
|
3623
|
-
const
|
|
3621
|
+
) : this.destroy(), !n || !this.videoElement) return;
|
|
3622
|
+
const r = this.getAudioOutput(this._state.audioOutput);
|
|
3623
|
+
Ut(this.videoElement, n, this._state.fit), Mt(this.videoElement, n, r, this.volume);
|
|
3624
|
+
const o = Kt(
|
|
3624
3625
|
this.videoElement,
|
|
3625
|
-
|
|
3626
|
+
n,
|
|
3626
3627
|
this._state.keyframes,
|
|
3628
|
+
t,
|
|
3627
3629
|
this.syncState,
|
|
3628
3630
|
this._state.enablePlaybackRateAdjustment
|
|
3629
3631
|
);
|
|
3630
|
-
this.syncState =
|
|
3632
|
+
this.syncState = o;
|
|
3631
3633
|
}
|
|
3632
3634
|
destroy() {
|
|
3633
3635
|
this.videoElement && (this.videoElement.pause(), this.videoElement.remove(), this.videoElement.volume = 0, this.videoElement.currentTime = 0, this.mediaPreloader.releaseElement(this.videoElement)), this.videoElement = void 0;
|