@latest-thinking/lt-player 3.0.0-beta.6 → 3.0.0-beta.7
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/player.js +294 -291
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/player.js
CHANGED
|
@@ -20464,15 +20464,18 @@ function Yg({ children: e, intentQueue: t, mediaRef: n, sources: r, ...i }) {
|
|
|
20464
20464
|
}
|
|
20465
20465
|
//#endregion
|
|
20466
20466
|
//#region src/core/media-engine.tsx
|
|
20467
|
-
function Xg(
|
|
20467
|
+
function Xg(e) {
|
|
20468
|
+
return !e || typeof navigator < "u" && /\bFirefox\//u.test(navigator.userAgent);
|
|
20469
|
+
}
|
|
20470
|
+
function Zg(...e) {
|
|
20468
20471
|
return e;
|
|
20469
20472
|
}
|
|
20470
|
-
var { Player:
|
|
20471
|
-
features:
|
|
20473
|
+
var { Player: Qg, usePlayer: $g } = mc({
|
|
20474
|
+
features: Zg(fr, mr, Mr, Ar, xr, Cn, er, dr, Bn, Or, Hn, ur),
|
|
20472
20475
|
displayName: "LTMediaEnginePlayer"
|
|
20473
|
-
}),
|
|
20474
|
-
function
|
|
20475
|
-
let t =
|
|
20476
|
+
}), e_ = P(fr), t_ = P(xr), n_ = P(Hn), r_ = P(Ar), i_ = P(Mr), a_ = P(mr), o_ = P(Or), s_ = P(dr), c_ = P(Bn), l_ = P(ur);
|
|
20477
|
+
function u_(e) {
|
|
20478
|
+
let t = e_(e), n = t_(e), r = n_(e), i = r_(e);
|
|
20476
20479
|
if (t === void 0 || n === void 0 || r === void 0 || i === void 0) throw Error("The LT media engine state features are not configured");
|
|
20477
20480
|
return {
|
|
20478
20481
|
paused: t.paused,
|
|
@@ -20485,10 +20488,10 @@ function l_(e) {
|
|
|
20485
20488
|
currentTime: i.currentTime
|
|
20486
20489
|
};
|
|
20487
20490
|
}
|
|
20488
|
-
function
|
|
20489
|
-
let r =
|
|
20491
|
+
function d_({ children: e, mediaRef: t, userStateSession: n }) {
|
|
20492
|
+
let r = $g(), i = Et((e) => r.subscribe(e), () => r.state, u_), a = (0, w.useCallback)((e, t) => {
|
|
20490
20493
|
if (e.source === null) return Promise.reject(/* @__PURE__ */ Error("Cannot recover media without a selected source"));
|
|
20491
|
-
let n = r.state, i =
|
|
20494
|
+
let n = r.state, i = n_(n), a = t_(n);
|
|
20492
20495
|
return i === void 0 || a === void 0 ? Promise.reject(/* @__PURE__ */ Error("The LT media recovery features are not configured")) : (i.dismissError(), a.loadSource(e.source), new Promise((n, i) => {
|
|
20493
20496
|
let a = !1, o = !1, s = !1, c = () => void 0, l = (e) => {
|
|
20494
20497
|
s || (s = !0, c(), t.removeEventListener("abort", u), e === void 0 ? n() : i(e));
|
|
@@ -20497,7 +20500,7 @@ function u_({ children: e, mediaRef: t, userStateSession: n }) {
|
|
|
20497
20500
|
u();
|
|
20498
20501
|
return;
|
|
20499
20502
|
}
|
|
20500
|
-
let n = r.state, i =
|
|
20503
|
+
let n = r.state, i = e_(n), s = t_(n), c = n_(n), f = r_(n);
|
|
20501
20504
|
if (i === void 0 || s === void 0 || c === void 0 || f === void 0) {
|
|
20502
20505
|
l(/* @__PURE__ */ Error("The LT media recovery features are not configured"));
|
|
20503
20506
|
return;
|
|
@@ -20518,7 +20521,7 @@ function u_({ children: e, mediaRef: t, userStateSession: n }) {
|
|
|
20518
20521
|
}));
|
|
20519
20522
|
}, [r]), o = (0, w.useCallback)(() => eg({ recoverMedia: a }), [a]), s = (0, w.useMemo)(() => ({
|
|
20520
20523
|
getSnapshot: () => {
|
|
20521
|
-
let e = r.state, n =
|
|
20524
|
+
let e = r.state, n = i_(e), i = a_(e), a = t_(e), o = o_(e);
|
|
20522
20525
|
if (n === void 0 || i === void 0 || a === void 0 || o === void 0) throw Error("The LT user-state media features are not configured");
|
|
20523
20526
|
return {
|
|
20524
20527
|
attached: !!r.target,
|
|
@@ -20538,7 +20541,7 @@ function u_({ children: e, mediaRef: t, userStateSession: n }) {
|
|
|
20538
20541
|
},
|
|
20539
20542
|
subscribe: (e) => r.subscribe(e),
|
|
20540
20543
|
setVolume(e) {
|
|
20541
|
-
|
|
20544
|
+
i_(r.state)?.setVolume(e);
|
|
20542
20545
|
},
|
|
20543
20546
|
setMuted(e) {
|
|
20544
20547
|
let n = t?.current;
|
|
@@ -20546,14 +20549,14 @@ function u_({ children: e, mediaRef: t, userStateSession: n }) {
|
|
|
20546
20549
|
n.muted !== e && (n.muted = e);
|
|
20547
20550
|
return;
|
|
20548
20551
|
}
|
|
20549
|
-
let i =
|
|
20552
|
+
let i = i_(r.state);
|
|
20550
20553
|
i !== void 0 && i.muted !== e && i.toggleMuted();
|
|
20551
20554
|
},
|
|
20552
20555
|
setPlaybackRate(e) {
|
|
20553
|
-
|
|
20556
|
+
a_(r.state)?.setPlaybackRate(e);
|
|
20554
20557
|
},
|
|
20555
20558
|
selectSubtitlesTrack(e) {
|
|
20556
|
-
if (
|
|
20559
|
+
if (o_(r.state)?.selectSubtitlesTrack(e), e === "off") return;
|
|
20557
20560
|
let n = kf(t?.current ?? null).find((t) => t.id === e);
|
|
20558
20561
|
n !== void 0 && (n.mode = "hidden");
|
|
20559
20562
|
}
|
|
@@ -20581,16 +20584,16 @@ function u_({ children: e, mediaRef: t, userStateSession: n }) {
|
|
|
20581
20584
|
})
|
|
20582
20585
|
});
|
|
20583
20586
|
}
|
|
20584
|
-
function
|
|
20587
|
+
function f_({ children: e, mediaRef: t, poster: n, stringCatalog: r = hh, title: i, userStateSession: a }) {
|
|
20585
20588
|
return /* @__PURE__ */ (0, N.jsx)(Vd, {
|
|
20586
20589
|
value: r,
|
|
20587
20590
|
children: /* @__PURE__ */ (0, N.jsx)(ch, {
|
|
20588
20591
|
language: r.selectedLanguage,
|
|
20589
20592
|
strings: r.strings,
|
|
20590
|
-
children: /* @__PURE__ */ (0, N.jsx)(
|
|
20593
|
+
children: /* @__PURE__ */ (0, N.jsx)(Qg, {
|
|
20591
20594
|
poster: n,
|
|
20592
20595
|
title: i,
|
|
20593
|
-
children: /* @__PURE__ */ (0, N.jsx)(
|
|
20596
|
+
children: /* @__PURE__ */ (0, N.jsx)(d_, {
|
|
20594
20597
|
mediaRef: t,
|
|
20595
20598
|
userStateSession: a,
|
|
20596
20599
|
children: e
|
|
@@ -20599,8 +20602,8 @@ function d_({ children: e, mediaRef: t, poster: n, stringCatalog: r = hh, title:
|
|
|
20599
20602
|
})
|
|
20600
20603
|
});
|
|
20601
20604
|
}
|
|
20602
|
-
function
|
|
20603
|
-
let n =
|
|
20605
|
+
function p_(e, t) {
|
|
20606
|
+
let n = r_(e), r = i_(e), i = a_(e), a = o_(e), o = s_(e);
|
|
20604
20607
|
if (n === void 0 || r === void 0 || i === void 0 || a === void 0 || o === void 0) throw Error("The LT page API media features are not configured");
|
|
20605
20608
|
let s = kf(t).find((e) => Ff(e.kind) && If(e.mode));
|
|
20606
20609
|
return Object.freeze({
|
|
@@ -20616,8 +20619,8 @@ function f_(e, t) {
|
|
|
20616
20619
|
pip: o.pip
|
|
20617
20620
|
});
|
|
20618
20621
|
}
|
|
20619
|
-
function
|
|
20620
|
-
let i =
|
|
20622
|
+
function m_({ application: e, intentQueue: t, mediaRef: n, runtime: r }) {
|
|
20623
|
+
let i = $g(), a = rg(), o = Pf(), s = (0, w.useMemo)(() => ({
|
|
20621
20624
|
get media() {
|
|
20622
20625
|
let e = n.current;
|
|
20623
20626
|
if (e === null) throw Error("The LT media element is not attached");
|
|
@@ -20625,16 +20628,16 @@ function p_({ application: e, intentQueue: t, mediaRef: n, runtime: r }) {
|
|
|
20625
20628
|
},
|
|
20626
20629
|
playerState: a,
|
|
20627
20630
|
userState: o,
|
|
20628
|
-
getSnapshot: () =>
|
|
20631
|
+
getSnapshot: () => p_(i.state, n.current),
|
|
20629
20632
|
subscribe: (e) => i.subscribe(e),
|
|
20630
20633
|
play() {
|
|
20631
|
-
t.play(() =>
|
|
20634
|
+
t.play(() => e_(i.state)?.play().catch(() => void 0));
|
|
20632
20635
|
},
|
|
20633
20636
|
pause() {
|
|
20634
|
-
t.pause(() =>
|
|
20637
|
+
t.pause(() => e_(i.state)?.pause());
|
|
20635
20638
|
},
|
|
20636
20639
|
seek(e) {
|
|
20637
|
-
|
|
20640
|
+
r_(i.state)?.seek(e).catch(() => void 0);
|
|
20638
20641
|
},
|
|
20639
20642
|
load() {
|
|
20640
20643
|
n.current?.load();
|
|
@@ -20654,9 +20657,9 @@ function p_({ application: e, intentQueue: t, mediaRef: n, runtime: r }) {
|
|
|
20654
20657
|
r
|
|
20655
20658
|
]), null;
|
|
20656
20659
|
}
|
|
20657
|
-
function
|
|
20658
|
-
let n =
|
|
20659
|
-
let e =
|
|
20660
|
+
function h_({ application: e, visible: t }) {
|
|
20661
|
+
let n = $g(), { playback: r } = ig(), i = Wd("coverButton"), { config: a } = e, o = a.controls.cover, s = (0, w.useCallback)(() => {
|
|
20662
|
+
let e = e_(n.state);
|
|
20660
20663
|
return e === void 0 ? Promise.reject(/* @__PURE__ */ Error("The LT media playback feature is not configured")) : e.play();
|
|
20661
20664
|
}, [n]);
|
|
20662
20665
|
if (!o.enabled) return null;
|
|
@@ -20675,7 +20678,7 @@ function m_({ application: e, visible: t }) {
|
|
|
20675
20678
|
visibleButtonLabel: c
|
|
20676
20679
|
});
|
|
20677
20680
|
}
|
|
20678
|
-
function
|
|
20681
|
+
function g_({ application: e, runtime: t }) {
|
|
20679
20682
|
let { config: n, strings: r } = e;
|
|
20680
20683
|
if (e.initialError) {
|
|
20681
20684
|
let e = n.layout === "landscape" ? "ltp-landscape" : "ltp-portrait";
|
|
@@ -20687,12 +20690,12 @@ function h_({ application: e, runtime: t }) {
|
|
|
20687
20690
|
children: [/* @__PURE__ */ (0, N.jsx)(bd, {}), /* @__PURE__ */ (0, N.jsx)(Bg, { message: r.strings.configErrorMessage })]
|
|
20688
20691
|
});
|
|
20689
20692
|
}
|
|
20690
|
-
return /* @__PURE__ */ (0, N.jsx)(
|
|
20693
|
+
return /* @__PURE__ */ (0, N.jsx)(__, {
|
|
20691
20694
|
application: e,
|
|
20692
20695
|
runtime: t
|
|
20693
20696
|
});
|
|
20694
20697
|
}
|
|
20695
|
-
function
|
|
20698
|
+
function __({ application: e, runtime: t }) {
|
|
20696
20699
|
let n = (0, w.useRef)(null), [r, i] = (0, w.useState)(null), a = (0, w.useRef)(null), o = (0, w.useRef)(null);
|
|
20697
20700
|
a.current ??= Gg();
|
|
20698
20701
|
let s = a.current, c = (0, w.useCallback)((e) => {
|
|
@@ -20704,7 +20707,7 @@ function g_({ application: e, runtime: t }) {
|
|
|
20704
20707
|
"aria-label": l.content.title,
|
|
20705
20708
|
className: "ltp-media-engine__video",
|
|
20706
20709
|
crossOrigin: "anonymous",
|
|
20707
|
-
disablePictureInPicture:
|
|
20710
|
+
disablePictureInPicture: Xg(l.controls.pip.enabled),
|
|
20708
20711
|
intentQueue: s,
|
|
20709
20712
|
playsInline: !0,
|
|
20710
20713
|
preload: "metadata",
|
|
@@ -20713,7 +20716,7 @@ function g_({ application: e, runtime: t }) {
|
|
|
20713
20716
|
index: n,
|
|
20714
20717
|
track: t
|
|
20715
20718
|
}, `${e.generation}:${t.src}:${t.kind ?? ""}:${n}`))
|
|
20716
|
-
}), f = e.configurationError ? /* @__PURE__ */ (0, N.jsx)(Bg, { message: u.strings.configErrorMessage }) : void 0, p = /* @__PURE__ */ (0, N.jsx)(
|
|
20719
|
+
}), f = e.configurationError ? /* @__PURE__ */ (0, N.jsx)(Bg, { message: u.strings.configErrorMessage }) : void 0, p = /* @__PURE__ */ (0, N.jsx)(m_, {
|
|
20717
20720
|
application: e,
|
|
20718
20721
|
intentQueue: s,
|
|
20719
20722
|
mediaRef: n,
|
|
@@ -20723,7 +20726,7 @@ function g_({ application: e, runtime: t }) {
|
|
|
20723
20726
|
value: l,
|
|
20724
20727
|
children: /* @__PURE__ */ (0, N.jsx)(Wm, {
|
|
20725
20728
|
registry: e.registry,
|
|
20726
|
-
children: /* @__PURE__ */ (0, N.jsx)(
|
|
20729
|
+
children: /* @__PURE__ */ (0, N.jsx)(f_, {
|
|
20727
20730
|
mediaRef: n,
|
|
20728
20731
|
poster: l.content.poster ?? null,
|
|
20729
20732
|
stringCatalog: u,
|
|
@@ -20732,7 +20735,7 @@ function g_({ application: e, runtime: t }) {
|
|
|
20732
20735
|
children: /* @__PURE__ */ (0, N.jsx)(qf, {
|
|
20733
20736
|
generation: e.generation,
|
|
20734
20737
|
media: r,
|
|
20735
|
-
children: /* @__PURE__ */ (0, N.jsx)(
|
|
20738
|
+
children: /* @__PURE__ */ (0, N.jsx)(x_, {
|
|
20736
20739
|
application: e,
|
|
20737
20740
|
configurationError: f,
|
|
20738
20741
|
media: d,
|
|
@@ -20743,17 +20746,17 @@ function g_({ application: e, runtime: t }) {
|
|
|
20743
20746
|
})
|
|
20744
20747
|
});
|
|
20745
20748
|
}
|
|
20746
|
-
function
|
|
20747
|
-
let t =
|
|
20749
|
+
function v_(e) {
|
|
20750
|
+
let t = y_(e), n = r_(e);
|
|
20748
20751
|
if (t === void 0 || n === void 0) throw Error("The LT core control media features are not configured");
|
|
20749
20752
|
return {
|
|
20750
20753
|
buffered: t.buffered,
|
|
20751
20754
|
duration: n.duration
|
|
20752
20755
|
};
|
|
20753
20756
|
}
|
|
20754
|
-
var
|
|
20755
|
-
function
|
|
20756
|
-
let t =
|
|
20757
|
+
var y_ = P(Cn);
|
|
20758
|
+
function b_(e) {
|
|
20759
|
+
let t = c_(e);
|
|
20757
20760
|
if (t === void 0) throw Error("The LT control visibility media feature is not configured");
|
|
20758
20761
|
return {
|
|
20759
20762
|
controlsVisible: t.controlsVisible,
|
|
@@ -20761,8 +20764,8 @@ function y_(e) {
|
|
|
20761
20764
|
userActive: t.userActive
|
|
20762
20765
|
};
|
|
20763
20766
|
}
|
|
20764
|
-
function
|
|
20765
|
-
let i =
|
|
20767
|
+
function x_({ application: e, configurationError: t, media: n, runtimeBridge: r }) {
|
|
20768
|
+
let i = $g(), { playback: a } = ig(), { config: o } = e, s = Et((e) => i.subscribe(e), () => i.state, b_), c = (0, w.useRef)(null), l = (0, w.useRef)({
|
|
20766
20769
|
configurationError: t !== void 0,
|
|
20767
20770
|
engine: s,
|
|
20768
20771
|
generation: e.generation,
|
|
@@ -20791,7 +20794,7 @@ function b_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
20791
20794
|
a
|
|
20792
20795
|
]), /* @__PURE__ */ (0, N.jsx)(gg, {
|
|
20793
20796
|
controller: d,
|
|
20794
|
-
children: /* @__PURE__ */ (0, N.jsx)(
|
|
20797
|
+
children: /* @__PURE__ */ (0, N.jsx)(T_, {
|
|
20795
20798
|
application: e,
|
|
20796
20799
|
configurationError: t,
|
|
20797
20800
|
media: n,
|
|
@@ -20799,12 +20802,12 @@ function b_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
20799
20802
|
})
|
|
20800
20803
|
});
|
|
20801
20804
|
}
|
|
20802
|
-
function
|
|
20805
|
+
function S_() {
|
|
20803
20806
|
let e = Gm().getModule("share"), t = (0, w.useSyncExternalStore)(e.subscribeInteraction, e.getInteractionSnapshot, e.getInteractionSnapshot).open;
|
|
20804
20807
|
return yg(t), null;
|
|
20805
20808
|
}
|
|
20806
|
-
function
|
|
20807
|
-
let t =
|
|
20809
|
+
function C_(e) {
|
|
20810
|
+
let t = l_(e), n = e_(e), r = a_(e), i = r_(e);
|
|
20808
20811
|
if (t === void 0 || n === void 0 || r === void 0 || i === void 0) throw Error("The LT Media Session features are not configured");
|
|
20809
20812
|
return {
|
|
20810
20813
|
currentTime: i.currentTime,
|
|
@@ -20815,16 +20818,16 @@ function S_(e) {
|
|
|
20815
20818
|
title: t.title
|
|
20816
20819
|
};
|
|
20817
20820
|
}
|
|
20818
|
-
function
|
|
20819
|
-
let t =
|
|
20821
|
+
function w_({ application: e }) {
|
|
20822
|
+
let t = $g(), n = ig(), r = Et((e) => t.subscribe(e), () => t.state, C_), i = (0, w.useMemo)(() => ({
|
|
20820
20823
|
play() {
|
|
20821
|
-
|
|
20824
|
+
e_(t.state)?.play().catch(() => void 0);
|
|
20822
20825
|
},
|
|
20823
20826
|
pause() {
|
|
20824
|
-
|
|
20827
|
+
e_(t.state)?.pause();
|
|
20825
20828
|
},
|
|
20826
20829
|
seek(e) {
|
|
20827
|
-
|
|
20830
|
+
r_(t.state)?.seek(e).catch(() => void 0);
|
|
20828
20831
|
},
|
|
20829
20832
|
...e.mediaSessionTrackCommands === void 0 ? {} : {
|
|
20830
20833
|
previousTrack: e.mediaSessionTrackCommands.previousTrack,
|
|
@@ -20851,8 +20854,8 @@ function C_({ application: e }) {
|
|
|
20851
20854
|
};
|
|
20852
20855
|
}, [i]), (0, w.useLayoutEffect)(() => s.current?.update(a), [a]), null;
|
|
20853
20856
|
}
|
|
20854
|
-
function
|
|
20855
|
-
let i =
|
|
20857
|
+
function T_({ application: e, configurationError: t, media: n, runtimeBridge: r }) {
|
|
20858
|
+
let i = $g(), a = ig(), { playback: o } = a, { config: s, strings: c } = e, l = vg(), u = Km(), d = Gm().getModule("share"), f = Gm().getModule("contextPanel"), p = Wf(), m = Et((e) => i.subscribe(e), () => i.state, v_), h = p.available ? u.capabilities.captions.state : "dormant", g = u.capabilities.speed.state, _ = (0, w.useMemo)(() => Gd(s, {
|
|
20856
20859
|
captions: h,
|
|
20857
20860
|
speed: g
|
|
20858
20861
|
}), [
|
|
@@ -20860,11 +20863,11 @@ function w_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
20860
20863
|
s,
|
|
20861
20864
|
g
|
|
20862
20865
|
]), v = t !== void 0 || o === "error", y = (0, w.useCallback)((e) => {
|
|
20863
|
-
|
|
20866
|
+
r_(i.state)?.seek(e).catch(() => void 0);
|
|
20864
20867
|
}, [i]), b = wg(_.gestures && !v), x = t === void 0 && a.playback === "error" && a.errorKind === "media" ? /* @__PURE__ */ (0, N.jsx)(Vg, {}) : void 0, { chromeVisible: S, coverVisible: C } = sg(o, e.generation, s.controls.cover.enabled), T = {
|
|
20865
20868
|
configurationError: t,
|
|
20866
20869
|
core: {
|
|
20867
|
-
cover: s.controls.cover.enabled && C ? /* @__PURE__ */ (0, N.jsx)(
|
|
20870
|
+
cover: s.controls.cover.enabled && C ? /* @__PURE__ */ (0, N.jsx)(h_, {
|
|
20868
20871
|
application: e,
|
|
20869
20872
|
visible: C
|
|
20870
20873
|
}, e.generation) : void 0,
|
|
@@ -20894,7 +20897,7 @@ function w_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
20894
20897
|
runtimeBridge: r
|
|
20895
20898
|
};
|
|
20896
20899
|
return /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [
|
|
20897
|
-
/* @__PURE__ */ (0, N.jsx)(
|
|
20900
|
+
/* @__PURE__ */ (0, N.jsx)(w_, { application: e }),
|
|
20898
20901
|
/* @__PURE__ */ (0, N.jsx)(Eg, {
|
|
20899
20902
|
disabled: v,
|
|
20900
20903
|
layout: s.layout,
|
|
@@ -20908,7 +20911,7 @@ function w_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
20908
20911
|
module: f,
|
|
20909
20912
|
children: /* @__PURE__ */ (0, N.jsx)(pp, {
|
|
20910
20913
|
module: d,
|
|
20911
|
-
children: s.layout === "landscape" ? /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsx)(
|
|
20914
|
+
children: s.layout === "landscape" ? /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsx)(S_, {}), /* @__PURE__ */ (0, N.jsx)(Qm, {
|
|
20912
20915
|
...T,
|
|
20913
20916
|
controlsMounted: S,
|
|
20914
20917
|
controlsVisible: l.visible,
|
|
@@ -20925,8 +20928,8 @@ function w_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
20925
20928
|
}
|
|
20926
20929
|
//#endregion
|
|
20927
20930
|
//#region src/player-application-mode.ts
|
|
20928
|
-
var
|
|
20929
|
-
function
|
|
20931
|
+
var E_ = Object.freeze({ mode: "standalone" }), D_ = /* @__PURE__ */ new WeakMap();
|
|
20932
|
+
function O_(e, t, n) {
|
|
20930
20933
|
let r = Object.freeze({
|
|
20931
20934
|
mode: t.mode,
|
|
20932
20935
|
...t.mediaSessionTrackCommands === void 0 ? {} : { mediaSessionTrackCommands: Object.freeze({
|
|
@@ -20934,32 +20937,32 @@ function D_(e, t, n) {
|
|
|
20934
20937
|
nextTrack: t.mediaSessionTrackCommands.nextTrack
|
|
20935
20938
|
}) }
|
|
20936
20939
|
});
|
|
20937
|
-
|
|
20940
|
+
D_.set(e, r);
|
|
20938
20941
|
try {
|
|
20939
20942
|
return n();
|
|
20940
20943
|
} finally {
|
|
20941
|
-
|
|
20944
|
+
D_.delete(e);
|
|
20942
20945
|
}
|
|
20943
20946
|
}
|
|
20944
|
-
function
|
|
20945
|
-
return
|
|
20947
|
+
function k_(e) {
|
|
20948
|
+
return D_.get(e) ?? E_;
|
|
20946
20949
|
}
|
|
20947
20950
|
//#endregion
|
|
20948
20951
|
//#region src/config/diagnostics.ts
|
|
20949
|
-
function
|
|
20952
|
+
function A_(e) {
|
|
20950
20953
|
return e.length === 0 ? null : {
|
|
20951
20954
|
level: "warning",
|
|
20952
20955
|
code: "config-soft-degrade",
|
|
20953
20956
|
message: `[lt-player] Configuration soft-degraded:\n${e.map((e) => `- ${e.path}: ${e.message}`).join("\n")}`
|
|
20954
20957
|
};
|
|
20955
20958
|
}
|
|
20956
|
-
function
|
|
20957
|
-
let n =
|
|
20959
|
+
function j_(e, t) {
|
|
20960
|
+
let n = A_(e);
|
|
20958
20961
|
return n !== null && t(n), n;
|
|
20959
20962
|
}
|
|
20960
20963
|
//#endregion
|
|
20961
20964
|
//#region src/config/parse-config.ts
|
|
20962
|
-
var
|
|
20965
|
+
var M_ = [
|
|
20963
20966
|
"version",
|
|
20964
20967
|
"layout",
|
|
20965
20968
|
"language",
|
|
@@ -20967,7 +20970,7 @@ var j_ = [
|
|
|
20967
20970
|
"controls",
|
|
20968
20971
|
"capabilities",
|
|
20969
20972
|
"strings"
|
|
20970
|
-
],
|
|
20973
|
+
], N_ = [
|
|
20971
20974
|
"title",
|
|
20972
20975
|
"author",
|
|
20973
20976
|
"description",
|
|
@@ -20977,14 +20980,14 @@ var j_ = [
|
|
|
20977
20980
|
"tracks",
|
|
20978
20981
|
"chapters",
|
|
20979
20982
|
"metadata"
|
|
20980
|
-
],
|
|
20983
|
+
], P_ = [
|
|
20981
20984
|
"inANutshell",
|
|
20982
20985
|
"keyConcepts",
|
|
20983
20986
|
"researchField",
|
|
20984
20987
|
"transcript",
|
|
20985
20988
|
"underlyingPublication",
|
|
20986
20989
|
"relatedVideos"
|
|
20987
|
-
],
|
|
20990
|
+
], F_ = [
|
|
20988
20991
|
"cover",
|
|
20989
20992
|
"playPause",
|
|
20990
20993
|
"timeline",
|
|
@@ -20997,27 +21000,27 @@ var j_ = [
|
|
|
20997
21000
|
"logo",
|
|
20998
21001
|
"gestures",
|
|
20999
21002
|
"hotkeys"
|
|
21000
|
-
],
|
|
21003
|
+
], I_ = [
|
|
21001
21004
|
"chapters",
|
|
21002
21005
|
"captions",
|
|
21003
21006
|
"speed",
|
|
21004
21007
|
"share",
|
|
21005
21008
|
"contextPanel"
|
|
21006
21009
|
];
|
|
21007
|
-
function
|
|
21010
|
+
function L_(e) {
|
|
21008
21011
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
21009
21012
|
}
|
|
21010
|
-
function
|
|
21013
|
+
function R_(e, t) {
|
|
21011
21014
|
return Object.hasOwn(e, t);
|
|
21012
21015
|
}
|
|
21013
|
-
function
|
|
21016
|
+
function z_(e) {
|
|
21014
21017
|
return e === "landscape" || e === "portrait";
|
|
21015
21018
|
}
|
|
21016
|
-
function
|
|
21019
|
+
function B_(e) {
|
|
21017
21020
|
return typeof e == "number" && Number.isFinite(e);
|
|
21018
21021
|
}
|
|
21019
|
-
function
|
|
21020
|
-
return
|
|
21022
|
+
function V_(e) {
|
|
21023
|
+
return B_(e) && e > 0;
|
|
21021
21024
|
}
|
|
21022
21025
|
function $(e, t, n, r, i) {
|
|
21023
21026
|
e.push({
|
|
@@ -21027,46 +21030,46 @@ function $(e, t, n, r, i) {
|
|
|
21027
21030
|
message: i
|
|
21028
21031
|
});
|
|
21029
21032
|
}
|
|
21030
|
-
function
|
|
21033
|
+
function H_(e, t, n, r) {
|
|
21031
21034
|
let i = new Set(t);
|
|
21032
21035
|
for (let t of Object.keys(e)) i.has(t) || $(r, "unknown-key", `${n}.${t}`, "omitted", "unknown key was ignored");
|
|
21033
21036
|
}
|
|
21034
|
-
function
|
|
21035
|
-
if (!
|
|
21037
|
+
function U_(e, t, n, r) {
|
|
21038
|
+
if (!R_(e, t)) return;
|
|
21036
21039
|
let i = e[t];
|
|
21037
21040
|
if (typeof i == "string") return i;
|
|
21038
21041
|
$(r, "wrong-type", `${n}.${t}`, "omitted", "expected a string");
|
|
21039
21042
|
}
|
|
21040
|
-
function
|
|
21041
|
-
if (!
|
|
21043
|
+
function W_(e, t, n, r) {
|
|
21044
|
+
if (!R_(e, t)) return;
|
|
21042
21045
|
let i = e[t];
|
|
21043
21046
|
if (typeof i == "boolean") return i;
|
|
21044
21047
|
$(r, "wrong-type", `${n}.${t}`, "omitted", "expected a boolean");
|
|
21045
21048
|
}
|
|
21046
|
-
function W_(e, t, n, r) {
|
|
21047
|
-
if (!L_(e, t)) return;
|
|
21048
|
-
let i = e[t];
|
|
21049
|
-
if (z_(i) && i >= 0) return i;
|
|
21050
|
-
$(r, z_(i) ? "invalid-value" : "wrong-type", `${n}.${t}`, "omitted", "expected a finite nonnegative number");
|
|
21051
|
-
}
|
|
21052
21049
|
function G_(e, t, n, r) {
|
|
21053
|
-
if (!
|
|
21050
|
+
if (!R_(e, t)) return;
|
|
21054
21051
|
let i = e[t];
|
|
21055
|
-
if (
|
|
21056
|
-
$(r,
|
|
21052
|
+
if (B_(i) && i >= 0) return i;
|
|
21053
|
+
$(r, B_(i) ? "invalid-value" : "wrong-type", `${n}.${t}`, "omitted", "expected a finite nonnegative number");
|
|
21057
21054
|
}
|
|
21058
21055
|
function K_(e, t, n, r) {
|
|
21056
|
+
if (!R_(e, t)) return;
|
|
21059
21057
|
let i = e[t];
|
|
21060
|
-
if (
|
|
21061
|
-
$(r,
|
|
21058
|
+
if (B_(i) && i > 0) return i;
|
|
21059
|
+
$(r, B_(i) ? "invalid-value" : "wrong-type", `${n}.${t}`, "omitted", "expected a finite positive number");
|
|
21062
21060
|
}
|
|
21063
21061
|
function q_(e, t, n, r) {
|
|
21064
21062
|
let i = e[t];
|
|
21065
|
-
if (
|
|
21066
|
-
$(r,
|
|
21063
|
+
if (typeof i == "string" && i.length > 0) return i;
|
|
21064
|
+
$(r, R_(e, t) ? typeof i == "string" ? "invalid-value" : "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires a non-empty string");
|
|
21065
|
+
}
|
|
21066
|
+
function J_(e, t, n, r) {
|
|
21067
|
+
let i = e[t];
|
|
21068
|
+
if (B_(i) && i >= 0) return i;
|
|
21069
|
+
$(r, R_(e, t) ? B_(i) ? "invalid-value" : "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires a finite nonnegative number");
|
|
21067
21070
|
}
|
|
21068
|
-
function
|
|
21069
|
-
if (!
|
|
21071
|
+
function Y_(e, t, n, r, i) {
|
|
21072
|
+
if (!R_(e, t)) return;
|
|
21070
21073
|
let a = e[t];
|
|
21071
21074
|
if (!Array.isArray(a)) {
|
|
21072
21075
|
$(r, "wrong-type", `${n}.${t}`, "omitted", "expected an array");
|
|
@@ -21078,30 +21081,30 @@ function J_(e, t, n, r, i) {
|
|
|
21078
21081
|
s !== void 0 && o.push(s);
|
|
21079
21082
|
}), o;
|
|
21080
21083
|
}
|
|
21081
|
-
function
|
|
21082
|
-
if (!
|
|
21084
|
+
function X_(e, t, n) {
|
|
21085
|
+
if (!L_(e)) {
|
|
21083
21086
|
$(n, "dropped-entry", t, "dropped", "source entry must be an object");
|
|
21084
21087
|
return;
|
|
21085
21088
|
}
|
|
21086
|
-
|
|
21087
|
-
let r =
|
|
21089
|
+
H_(e, ["src", "type"], t, n);
|
|
21090
|
+
let r = q_(e, "src", t, n);
|
|
21088
21091
|
if (r === void 0) return;
|
|
21089
|
-
let i = { src: r }, a =
|
|
21092
|
+
let i = { src: r }, a = U_(e, "type", t, n);
|
|
21090
21093
|
return a !== void 0 && (i.type = a), i;
|
|
21091
21094
|
}
|
|
21092
|
-
function
|
|
21093
|
-
if (!
|
|
21095
|
+
function Z_(e, t, n) {
|
|
21096
|
+
if (!L_(e)) {
|
|
21094
21097
|
$(n, "dropped-entry", t, "dropped", "track entry must be an object");
|
|
21095
21098
|
return;
|
|
21096
21099
|
}
|
|
21097
|
-
|
|
21100
|
+
H_(e, [
|
|
21098
21101
|
"src",
|
|
21099
21102
|
"kind",
|
|
21100
21103
|
"label",
|
|
21101
21104
|
"srclang",
|
|
21102
21105
|
"default"
|
|
21103
21106
|
], t, n);
|
|
21104
|
-
let r =
|
|
21107
|
+
let r = q_(e, "src", t, n);
|
|
21105
21108
|
if (r === void 0) return;
|
|
21106
21109
|
let i = { src: r };
|
|
21107
21110
|
for (let r of [
|
|
@@ -21109,19 +21112,19 @@ function X_(e, t, n) {
|
|
|
21109
21112
|
"label",
|
|
21110
21113
|
"srclang"
|
|
21111
21114
|
]) {
|
|
21112
|
-
let a =
|
|
21115
|
+
let a = U_(e, r, t, n);
|
|
21113
21116
|
a !== void 0 && (i[r] = a);
|
|
21114
21117
|
}
|
|
21115
|
-
let a =
|
|
21118
|
+
let a = W_(e, "default", t, n);
|
|
21116
21119
|
return a !== void 0 && (i.default = a), i;
|
|
21117
21120
|
}
|
|
21118
|
-
function
|
|
21119
|
-
if (!
|
|
21121
|
+
function Q_(e, t, n) {
|
|
21122
|
+
if (!L_(e)) {
|
|
21120
21123
|
$(n, "dropped-entry", t, "dropped", "chapter entry must be an object");
|
|
21121
21124
|
return;
|
|
21122
21125
|
}
|
|
21123
|
-
|
|
21124
|
-
let r =
|
|
21126
|
+
H_(e, ["name", "start"], t, n);
|
|
21127
|
+
let r = q_(e, "name", t, n), i = J_(e, "start", t, n);
|
|
21125
21128
|
if (r === void 0 || i === void 0) return;
|
|
21126
21129
|
let a = t.match(/\[(\d+)\]$/u);
|
|
21127
21130
|
return {
|
|
@@ -21132,8 +21135,8 @@ function Z_(e, t, n) {
|
|
|
21132
21135
|
index: Number(a?.[1] ?? 0)
|
|
21133
21136
|
};
|
|
21134
21137
|
}
|
|
21135
|
-
function
|
|
21136
|
-
let n =
|
|
21138
|
+
function $_(e, t) {
|
|
21139
|
+
let n = Y_(e, "chapters", "$.content", t, Q_);
|
|
21137
21140
|
if (n === void 0) return;
|
|
21138
21141
|
let r = /* @__PURE__ */ new Set(), i = [];
|
|
21139
21142
|
for (let { chapter: e, index: a } of n) {
|
|
@@ -21145,99 +21148,99 @@ function Q_(e, t) {
|
|
|
21145
21148
|
}
|
|
21146
21149
|
return i.sort((e, t) => e.start - t.start);
|
|
21147
21150
|
}
|
|
21148
|
-
function
|
|
21149
|
-
let r = {}, i =
|
|
21151
|
+
function ev(e, t, n) {
|
|
21152
|
+
let r = {}, i = W_(e, "generatedByAi", t, n);
|
|
21150
21153
|
return i !== void 0 && (r.generatedByAi = i), r;
|
|
21151
21154
|
}
|
|
21152
|
-
function
|
|
21153
|
-
if (!
|
|
21155
|
+
function tv(e, t, n) {
|
|
21156
|
+
if (!L_(e)) {
|
|
21154
21157
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21155
21158
|
return;
|
|
21156
21159
|
}
|
|
21157
|
-
|
|
21160
|
+
H_(e, [
|
|
21158
21161
|
"generatedByAi",
|
|
21159
21162
|
"keyTakeaway",
|
|
21160
21163
|
"summary"
|
|
21161
21164
|
], t, n);
|
|
21162
|
-
let r =
|
|
21165
|
+
let r = ev(e, t, n);
|
|
21163
21166
|
for (let i of ["keyTakeaway", "summary"]) {
|
|
21164
|
-
let a =
|
|
21167
|
+
let a = U_(e, i, t, n);
|
|
21165
21168
|
a !== void 0 && (r[i] = a);
|
|
21166
21169
|
}
|
|
21167
21170
|
return r;
|
|
21168
21171
|
}
|
|
21169
|
-
function
|
|
21170
|
-
if (!
|
|
21172
|
+
function nv(e, t, n) {
|
|
21173
|
+
if (!L_(e)) {
|
|
21171
21174
|
$(n, "dropped-entry", t, "dropped", "key-concept entry must be an object");
|
|
21172
21175
|
return;
|
|
21173
21176
|
}
|
|
21174
|
-
|
|
21177
|
+
H_(e, [
|
|
21175
21178
|
"label",
|
|
21176
21179
|
"description",
|
|
21177
21180
|
"start"
|
|
21178
21181
|
], t, n);
|
|
21179
|
-
let r =
|
|
21182
|
+
let r = q_(e, "label", t, n), i = q_(e, "description", t, n);
|
|
21180
21183
|
if (r === void 0 || i === void 0) return;
|
|
21181
21184
|
let a = {
|
|
21182
21185
|
label: r,
|
|
21183
21186
|
description: i
|
|
21184
|
-
}, o =
|
|
21187
|
+
}, o = G_(e, "start", t, n);
|
|
21185
21188
|
return o !== void 0 && (a.start = o), a;
|
|
21186
21189
|
}
|
|
21187
|
-
function
|
|
21188
|
-
if (!
|
|
21190
|
+
function rv(e, t, n) {
|
|
21191
|
+
if (!L_(e)) {
|
|
21189
21192
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21190
21193
|
return;
|
|
21191
21194
|
}
|
|
21192
|
-
|
|
21193
|
-
let r =
|
|
21195
|
+
H_(e, ["generatedByAi", "items"], t, n);
|
|
21196
|
+
let r = ev(e, t, n), i = Y_(e, "items", t, n, nv);
|
|
21194
21197
|
return i !== void 0 && (r.items = i), r;
|
|
21195
21198
|
}
|
|
21196
|
-
function
|
|
21197
|
-
if (!
|
|
21199
|
+
function iv(e, t, n) {
|
|
21200
|
+
if (!L_(e)) {
|
|
21198
21201
|
$(n, "dropped-entry", t, "dropped", "research-field entry must be an object");
|
|
21199
21202
|
return;
|
|
21200
21203
|
}
|
|
21201
|
-
|
|
21202
|
-
let r =
|
|
21204
|
+
H_(e, ["title", "description"], t, n);
|
|
21205
|
+
let r = q_(e, "title", t, n), i = q_(e, "description", t, n);
|
|
21203
21206
|
return r === void 0 || i === void 0 ? void 0 : {
|
|
21204
21207
|
title: r,
|
|
21205
21208
|
description: i
|
|
21206
21209
|
};
|
|
21207
21210
|
}
|
|
21208
|
-
function
|
|
21209
|
-
if (!
|
|
21211
|
+
function av(e, t, n) {
|
|
21212
|
+
if (!L_(e)) {
|
|
21210
21213
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21211
21214
|
return;
|
|
21212
21215
|
}
|
|
21213
|
-
|
|
21214
|
-
let r =
|
|
21216
|
+
H_(e, ["generatedByAi", "sections"], t, n);
|
|
21217
|
+
let r = ev(e, t, n), i = Y_(e, "sections", t, n, iv);
|
|
21215
21218
|
return i !== void 0 && (r.sections = i), r;
|
|
21216
21219
|
}
|
|
21217
|
-
function
|
|
21218
|
-
if (!
|
|
21220
|
+
function ov(e, t, n) {
|
|
21221
|
+
if (!L_(e)) {
|
|
21219
21222
|
$(n, "dropped-entry", t, "dropped", "transcript entry must be an object");
|
|
21220
21223
|
return;
|
|
21221
21224
|
}
|
|
21222
|
-
|
|
21223
|
-
let r =
|
|
21225
|
+
H_(e, ["start", "text"], t, n);
|
|
21226
|
+
let r = J_(e, "start", t, n), i = q_(e, "text", t, n);
|
|
21224
21227
|
return r === void 0 || i === void 0 ? void 0 : {
|
|
21225
21228
|
start: r,
|
|
21226
21229
|
text: i
|
|
21227
21230
|
};
|
|
21228
21231
|
}
|
|
21229
|
-
function
|
|
21230
|
-
if (!
|
|
21232
|
+
function sv(e, t, n) {
|
|
21233
|
+
if (!L_(e)) {
|
|
21231
21234
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21232
21235
|
return;
|
|
21233
21236
|
}
|
|
21234
|
-
|
|
21235
|
-
let r =
|
|
21237
|
+
H_(e, ["generatedByAi", "entries"], t, n);
|
|
21238
|
+
let r = ev(e, t, n), i = Y_(e, "entries", t, n, ov);
|
|
21236
21239
|
return i !== void 0 && (r.entries = i), r;
|
|
21237
21240
|
}
|
|
21238
|
-
function
|
|
21239
|
-
if (!
|
|
21240
|
-
$(r,
|
|
21241
|
+
function cv(e, t, n, r) {
|
|
21242
|
+
if (!R_(e, t) || !Array.isArray(e[t])) {
|
|
21243
|
+
$(r, R_(e, t) ? "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires an array of strings");
|
|
21241
21244
|
return;
|
|
21242
21245
|
}
|
|
21243
21246
|
let i = [];
|
|
@@ -21245,19 +21248,19 @@ function sv(e, t, n, r) {
|
|
|
21245
21248
|
typeof e == "string" ? i.push(e) : $(r, "dropped-entry", `${n}.${t}[${a}]`, "dropped", "expected a string");
|
|
21246
21249
|
}), i;
|
|
21247
21250
|
}
|
|
21248
|
-
function
|
|
21249
|
-
if (!
|
|
21251
|
+
function lv(e, t, n) {
|
|
21252
|
+
if (!L_(e)) {
|
|
21250
21253
|
$(n, "dropped-entry", t, "dropped", "publication entry must be an object");
|
|
21251
21254
|
return;
|
|
21252
21255
|
}
|
|
21253
|
-
|
|
21256
|
+
H_(e, [
|
|
21254
21257
|
"title",
|
|
21255
21258
|
"authors",
|
|
21256
21259
|
"journal",
|
|
21257
21260
|
"abstract",
|
|
21258
21261
|
"url"
|
|
21259
21262
|
], t, n);
|
|
21260
|
-
let r =
|
|
21263
|
+
let r = q_(e, "title", t, n), i = cv(e, "authors", t, n), a = q_(e, "journal", t, n), o = q_(e, "abstract", t, n), s = q_(e, "url", t, n);
|
|
21261
21264
|
if (r !== void 0 && i !== void 0 && a !== void 0 && o !== void 0 && s !== void 0) return {
|
|
21262
21265
|
title: r,
|
|
21263
21266
|
authors: i,
|
|
@@ -21266,92 +21269,92 @@ function cv(e, t, n) {
|
|
|
21266
21269
|
url: s
|
|
21267
21270
|
};
|
|
21268
21271
|
}
|
|
21269
|
-
function
|
|
21270
|
-
if (!
|
|
21272
|
+
function uv(e, t, n) {
|
|
21273
|
+
if (!L_(e)) {
|
|
21271
21274
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21272
21275
|
return;
|
|
21273
21276
|
}
|
|
21274
|
-
|
|
21275
|
-
let r =
|
|
21277
|
+
H_(e, ["generatedByAi", "items"], t, n);
|
|
21278
|
+
let r = ev(e, t, n), i = Y_(e, "items", t, n, lv);
|
|
21276
21279
|
return i !== void 0 && (r.items = i), r;
|
|
21277
21280
|
}
|
|
21278
|
-
function
|
|
21279
|
-
if (!
|
|
21281
|
+
function dv(e, t, n) {
|
|
21282
|
+
if (!L_(e)) {
|
|
21280
21283
|
$(n, "dropped-entry", t, "dropped", "related-video entry must be an object");
|
|
21281
21284
|
return;
|
|
21282
21285
|
}
|
|
21283
|
-
|
|
21286
|
+
H_(e, [
|
|
21284
21287
|
"title",
|
|
21285
21288
|
"poster",
|
|
21286
21289
|
"url"
|
|
21287
21290
|
], t, n);
|
|
21288
|
-
let r =
|
|
21291
|
+
let r = q_(e, "title", t, n), i = q_(e, "poster", t, n), a = q_(e, "url", t, n);
|
|
21289
21292
|
return r === void 0 || i === void 0 || a === void 0 ? void 0 : {
|
|
21290
21293
|
title: r,
|
|
21291
21294
|
poster: i,
|
|
21292
21295
|
url: a
|
|
21293
21296
|
};
|
|
21294
21297
|
}
|
|
21295
|
-
function
|
|
21296
|
-
if (!
|
|
21298
|
+
function fv(e, t, n) {
|
|
21299
|
+
if (!L_(e)) {
|
|
21297
21300
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21298
21301
|
return;
|
|
21299
21302
|
}
|
|
21300
|
-
|
|
21303
|
+
H_(e, [
|
|
21301
21304
|
"generatedByAi",
|
|
21302
21305
|
"related",
|
|
21303
21306
|
"forYou"
|
|
21304
21307
|
], t, n);
|
|
21305
|
-
let r =
|
|
21308
|
+
let r = ev(e, t, n);
|
|
21306
21309
|
for (let i of ["related", "forYou"]) {
|
|
21307
|
-
let a =
|
|
21310
|
+
let a = Y_(e, i, t, n, dv);
|
|
21308
21311
|
a !== void 0 && (r[i] = a);
|
|
21309
21312
|
}
|
|
21310
21313
|
return r;
|
|
21311
21314
|
}
|
|
21312
|
-
function
|
|
21313
|
-
if (!
|
|
21315
|
+
function pv(e, t, n) {
|
|
21316
|
+
if (!L_(e)) {
|
|
21314
21317
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21315
21318
|
return;
|
|
21316
21319
|
}
|
|
21317
|
-
|
|
21320
|
+
H_(e, P_, t, n);
|
|
21318
21321
|
let r = {}, i = {
|
|
21319
|
-
inANutshell:
|
|
21320
|
-
keyConcepts:
|
|
21321
|
-
researchField:
|
|
21322
|
-
transcript:
|
|
21323
|
-
underlyingPublication:
|
|
21324
|
-
relatedVideos:
|
|
21322
|
+
inANutshell: tv,
|
|
21323
|
+
keyConcepts: rv,
|
|
21324
|
+
researchField: av,
|
|
21325
|
+
transcript: sv,
|
|
21326
|
+
underlyingPublication: uv,
|
|
21327
|
+
relatedVideos: fv
|
|
21325
21328
|
};
|
|
21326
|
-
for (let a of
|
|
21327
|
-
if (!
|
|
21329
|
+
for (let a of P_) {
|
|
21330
|
+
if (!R_(e, a)) continue;
|
|
21328
21331
|
let o = i[a](e[a], `${t}.${a}`, n);
|
|
21329
21332
|
o !== void 0 && Object.assign(r, { [a]: o });
|
|
21330
21333
|
}
|
|
21331
21334
|
return r;
|
|
21332
21335
|
}
|
|
21333
|
-
function
|
|
21336
|
+
function mv(e, t, n) {
|
|
21334
21337
|
if (typeof e == "boolean") return e;
|
|
21335
|
-
if (
|
|
21338
|
+
if (L_(e)) return H_(e, [], t, n), {};
|
|
21336
21339
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21337
21340
|
}
|
|
21338
|
-
function
|
|
21341
|
+
function hv(e, t, n) {
|
|
21339
21342
|
if (typeof e == "boolean") return e;
|
|
21340
|
-
if (!
|
|
21343
|
+
if (!L_(e)) {
|
|
21341
21344
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21342
21345
|
return;
|
|
21343
21346
|
}
|
|
21344
|
-
|
|
21345
|
-
let r = {}, i =
|
|
21347
|
+
H_(e, ["label"], t, n);
|
|
21348
|
+
let r = {}, i = U_(e, "label", t, n);
|
|
21346
21349
|
return i !== void 0 && (r.label = i), r;
|
|
21347
21350
|
}
|
|
21348
|
-
function
|
|
21351
|
+
function gv(e, t, n) {
|
|
21349
21352
|
if (typeof e == "boolean") return e;
|
|
21350
|
-
if (!
|
|
21353
|
+
if (!L_(e)) {
|
|
21351
21354
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21352
21355
|
return;
|
|
21353
21356
|
}
|
|
21354
|
-
|
|
21357
|
+
H_(e, [
|
|
21355
21358
|
"image",
|
|
21356
21359
|
"title",
|
|
21357
21360
|
"author",
|
|
@@ -21363,62 +21366,62 @@ function hv(e, t, n) {
|
|
|
21363
21366
|
"title",
|
|
21364
21367
|
"author"
|
|
21365
21368
|
]) {
|
|
21366
|
-
let a =
|
|
21369
|
+
let a = W_(e, i, t, n);
|
|
21367
21370
|
a !== void 0 && (r[i] = a);
|
|
21368
21371
|
}
|
|
21369
|
-
if (
|
|
21370
|
-
let i =
|
|
21372
|
+
if (R_(e, "button")) {
|
|
21373
|
+
let i = hv(e.button, `${t}.button`, n);
|
|
21371
21374
|
i !== void 0 && (r.button = i);
|
|
21372
21375
|
}
|
|
21373
21376
|
return r;
|
|
21374
21377
|
}
|
|
21375
|
-
function
|
|
21378
|
+
function _v(e, t, n) {
|
|
21376
21379
|
if (typeof e == "boolean") return e;
|
|
21377
|
-
if (!
|
|
21380
|
+
if (!L_(e)) {
|
|
21378
21381
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21379
21382
|
return;
|
|
21380
21383
|
}
|
|
21381
|
-
|
|
21384
|
+
H_(e, ["seekStep"], t, n);
|
|
21382
21385
|
let r = {};
|
|
21383
|
-
if (
|
|
21386
|
+
if (R_(e, "seekStep")) {
|
|
21384
21387
|
let i = e.seekStep;
|
|
21385
|
-
|
|
21388
|
+
B_(i) && i > 0 ? r.seekStep = i : $(n, B_(i) ? "invalid-value" : "wrong-type", `${t}.seekStep`, "omitted", "expected a finite positive number");
|
|
21386
21389
|
}
|
|
21387
21390
|
return r;
|
|
21388
21391
|
}
|
|
21389
|
-
function
|
|
21390
|
-
if (!
|
|
21392
|
+
function vv(e, t, n) {
|
|
21393
|
+
if (!L_(e)) {
|
|
21391
21394
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21392
21395
|
return;
|
|
21393
21396
|
}
|
|
21394
|
-
|
|
21397
|
+
H_(e, F_, t, n);
|
|
21395
21398
|
let r = {};
|
|
21396
|
-
for (let i of
|
|
21397
|
-
if (!
|
|
21398
|
-
let a = i === "cover" ?
|
|
21399
|
+
for (let i of F_) {
|
|
21400
|
+
if (!R_(e, i)) continue;
|
|
21401
|
+
let a = i === "cover" ? gv(e[i], `${t}.${i}`, n) : i === "timeline" ? _v(e[i], `${t}.${i}`, n) : mv(e[i], `${t}.${i}`, n);
|
|
21399
21402
|
a !== void 0 && Object.assign(r, { [i]: a });
|
|
21400
21403
|
}
|
|
21401
21404
|
return r;
|
|
21402
21405
|
}
|
|
21403
|
-
function
|
|
21406
|
+
function yv(e, t, n) {
|
|
21404
21407
|
if (typeof e == "boolean") return e;
|
|
21405
|
-
if (!
|
|
21408
|
+
if (!L_(e)) {
|
|
21406
21409
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21407
21410
|
return;
|
|
21408
21411
|
}
|
|
21409
|
-
|
|
21412
|
+
H_(e, ["options"], t, n);
|
|
21410
21413
|
let r = {};
|
|
21411
|
-
if (!
|
|
21414
|
+
if (!R_(e, "options")) return r;
|
|
21412
21415
|
let i = e.options;
|
|
21413
|
-
return Array.isArray(i) && i.length > 0 && i.every((e) =>
|
|
21416
|
+
return Array.isArray(i) && i.length > 0 && i.every((e) => B_(e) && e > 0) && i.every((e, t) => t === 0 || e > i[t - 1]) ? r.options = [...i] : $(n, Array.isArray(i) ? "invalid-value" : "wrong-type", `${t}.options`, "omitted", "expected a non-empty strictly ascending list of positive rates"), r;
|
|
21414
21417
|
}
|
|
21415
|
-
function
|
|
21418
|
+
function bv(e, t, n) {
|
|
21416
21419
|
if (typeof e == "boolean") return e;
|
|
21417
|
-
if (!
|
|
21420
|
+
if (!L_(e)) {
|
|
21418
21421
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21419
21422
|
return;
|
|
21420
21423
|
}
|
|
21421
|
-
|
|
21424
|
+
H_(e, [
|
|
21422
21425
|
"canonicalUrl",
|
|
21423
21426
|
"embedUrl",
|
|
21424
21427
|
"targets",
|
|
@@ -21426,10 +21429,10 @@ function yv(e, t, n) {
|
|
|
21426
21429
|
], t, n);
|
|
21427
21430
|
let r = {};
|
|
21428
21431
|
for (let i of ["canonicalUrl", "embedUrl"]) {
|
|
21429
|
-
let a =
|
|
21432
|
+
let a = U_(e, i, t, n);
|
|
21430
21433
|
a !== void 0 && (r[i] = a);
|
|
21431
21434
|
}
|
|
21432
|
-
if (
|
|
21435
|
+
if (R_(e, "targets")) {
|
|
21433
21436
|
let i = e.targets;
|
|
21434
21437
|
if (!Array.isArray(i)) $(n, "wrong-type", `${t}.targets`, "omitted", "expected an array");
|
|
21435
21438
|
else {
|
|
@@ -21461,13 +21464,13 @@ function yv(e, t, n) {
|
|
|
21461
21464
|
}), r.targets = o;
|
|
21462
21465
|
}
|
|
21463
21466
|
}
|
|
21464
|
-
if (
|
|
21465
|
-
if (!
|
|
21467
|
+
if (R_(e, "templates")) {
|
|
21468
|
+
if (!L_(e.templates)) $(n, "wrong-type", `${t}.templates`, "omitted", "expected an object");
|
|
21466
21469
|
else {
|
|
21467
|
-
|
|
21470
|
+
H_(e.templates, ["message"], `${t}.templates`, n);
|
|
21468
21471
|
let i = {};
|
|
21469
21472
|
for (let r of ["message"]) {
|
|
21470
|
-
let a =
|
|
21473
|
+
let a = U_(e.templates, r, `${t}.templates`, n);
|
|
21471
21474
|
a !== void 0 && (i[r] = a);
|
|
21472
21475
|
}
|
|
21473
21476
|
r.templates = i;
|
|
@@ -21475,22 +21478,22 @@ function yv(e, t, n) {
|
|
|
21475
21478
|
}
|
|
21476
21479
|
return r;
|
|
21477
21480
|
}
|
|
21478
|
-
function
|
|
21479
|
-
if (!
|
|
21481
|
+
function xv(e, t, n) {
|
|
21482
|
+
if (!L_(e)) {
|
|
21480
21483
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21481
21484
|
return;
|
|
21482
21485
|
}
|
|
21483
|
-
|
|
21486
|
+
H_(e, I_, t, n);
|
|
21484
21487
|
let r = {};
|
|
21485
|
-
for (let i of
|
|
21486
|
-
if (!
|
|
21487
|
-
let a = i === "speed" ?
|
|
21488
|
+
for (let i of I_) {
|
|
21489
|
+
if (!R_(e, i)) continue;
|
|
21490
|
+
let a = i === "speed" ? yv(e[i], `${t}.${i}`, n) : i === "share" ? bv(e[i], `${t}.${i}`, n) : W_(e, i, t, n);
|
|
21488
21491
|
a !== void 0 && Object.assign(r, { [i]: a });
|
|
21489
21492
|
}
|
|
21490
21493
|
return r;
|
|
21491
21494
|
}
|
|
21492
|
-
function
|
|
21493
|
-
if (!
|
|
21495
|
+
function Sv(e, t, n) {
|
|
21496
|
+
if (!L_(e)) {
|
|
21494
21497
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21495
21498
|
return;
|
|
21496
21499
|
}
|
|
@@ -21498,7 +21501,7 @@ function xv(e, t, n) {
|
|
|
21498
21501
|
for (let [i, a] of Object.entries(e)) typeof a == "string" ? r[i] = a : $(n, "wrong-type", `${t}.${i}`, "omitted", "expected a string");
|
|
21499
21502
|
return r;
|
|
21500
21503
|
}
|
|
21501
|
-
function
|
|
21504
|
+
function Cv(e, t, n) {
|
|
21502
21505
|
if (typeof e == "string") return e;
|
|
21503
21506
|
if (!Array.isArray(e)) {
|
|
21504
21507
|
$(n, "wrong-type", t, "omitted", "expected a string or string array");
|
|
@@ -21513,50 +21516,50 @@ function Sv(e, t, n) {
|
|
|
21513
21516
|
typeof e == "string" ? r.push(e) : $(n, "dropped-entry", `${t}[${i}]`, "dropped", "expected a string");
|
|
21514
21517
|
}), r.length > 0 ? r : void 0;
|
|
21515
21518
|
}
|
|
21516
|
-
function
|
|
21517
|
-
|
|
21518
|
-
let n = { sources: e.sources.map((e, n) =>
|
|
21519
|
+
function wv(e, t) {
|
|
21520
|
+
H_(e, N_, "$.content", t);
|
|
21521
|
+
let n = { sources: e.sources.map((e, n) => X_(e, `$.content.sources[${n}]`, t)).filter((e) => e !== void 0) };
|
|
21519
21522
|
for (let r of [
|
|
21520
21523
|
"title",
|
|
21521
21524
|
"author",
|
|
21522
21525
|
"description",
|
|
21523
21526
|
"poster"
|
|
21524
21527
|
]) {
|
|
21525
|
-
let i =
|
|
21528
|
+
let i = U_(e, r, "$.content", t);
|
|
21526
21529
|
i !== void 0 && (n[r] = i);
|
|
21527
21530
|
}
|
|
21528
|
-
let r =
|
|
21531
|
+
let r = K_(e, "duration", "$.content", t);
|
|
21529
21532
|
r !== void 0 && (n.duration = r);
|
|
21530
|
-
let i =
|
|
21533
|
+
let i = Y_(e, "tracks", "$.content", t, Z_);
|
|
21531
21534
|
i !== void 0 && (n.tracks = i);
|
|
21532
|
-
let a =
|
|
21533
|
-
if (a !== void 0 && (n.chapters = a),
|
|
21534
|
-
let r =
|
|
21535
|
+
let a = $_(e, t);
|
|
21536
|
+
if (a !== void 0 && (n.chapters = a), R_(e, "metadata")) {
|
|
21537
|
+
let r = pv(e.metadata, "$.content.metadata", t);
|
|
21535
21538
|
r !== void 0 && (n.metadata = r);
|
|
21536
21539
|
}
|
|
21537
21540
|
return n;
|
|
21538
21541
|
}
|
|
21539
|
-
function
|
|
21542
|
+
function Tv(e, t) {
|
|
21540
21543
|
return {
|
|
21541
21544
|
level: "error",
|
|
21542
21545
|
code: t ? "legacy-config-invalid" : "config-invalid",
|
|
21543
21546
|
message: `${t ? "[lt-player] Legacy pre-v3 configuration rejected" : "[lt-player] Configuration rejected"}:\n${e.map((e) => `- ${e.path}: ${e.message}`).join("\n")}`
|
|
21544
21547
|
};
|
|
21545
21548
|
}
|
|
21546
|
-
function
|
|
21549
|
+
function Ev(e, t) {
|
|
21547
21550
|
return {
|
|
21548
21551
|
status: "valid",
|
|
21549
21552
|
config: e,
|
|
21550
21553
|
findings: t,
|
|
21551
|
-
diagnostic:
|
|
21554
|
+
diagnostic: A_(t)
|
|
21552
21555
|
};
|
|
21553
21556
|
}
|
|
21554
|
-
function
|
|
21557
|
+
function Dv(e, t, n) {
|
|
21555
21558
|
return e.filter((e) => e.start <= t || ($(n, "chapter-beyond-duration", "$.content.chapters", "dropped", `chapter "${e.name}" at ${e.start} seconds exceeds duration ${t}`), !1));
|
|
21556
21559
|
}
|
|
21557
|
-
function
|
|
21558
|
-
let n =
|
|
21559
|
-
if (
|
|
21560
|
+
function Ov(e, t) {
|
|
21561
|
+
let n = L_(e) ? e : {}, r = L_(n.content) ? n.content : void 0, i = n.layout, a = [];
|
|
21562
|
+
if (z_(i) || a.push({
|
|
21560
21563
|
code: "invalid-layout",
|
|
21561
21564
|
path: "$.layout",
|
|
21562
21565
|
message: "layout must be landscape or portrait"
|
|
@@ -21564,54 +21567,54 @@ function Dv(e, t) {
|
|
|
21564
21567
|
code: "missing-sources",
|
|
21565
21568
|
path: "$.content.sources",
|
|
21566
21569
|
message: "content.sources must be a non-empty array"
|
|
21567
|
-
}), t.application === "update" &&
|
|
21570
|
+
}), t.application === "update" && z_(i) && i !== t.instanceLayout && a.push({
|
|
21568
21571
|
code: "layout-change",
|
|
21569
21572
|
path: "$.layout",
|
|
21570
21573
|
message: `layout cannot change from ${t.instanceLayout} to ${i}`
|
|
21571
21574
|
}), a.length > 0) {
|
|
21572
|
-
let e =
|
|
21575
|
+
let e = R_(n, "body");
|
|
21573
21576
|
return {
|
|
21574
21577
|
status: "invalid",
|
|
21575
21578
|
violations: a,
|
|
21576
21579
|
legacy: e,
|
|
21577
|
-
diagnostic:
|
|
21580
|
+
diagnostic: Tv(a, e)
|
|
21578
21581
|
};
|
|
21579
21582
|
}
|
|
21580
21583
|
let o = [];
|
|
21581
|
-
|
|
21584
|
+
H_(n, M_, "$", o);
|
|
21582
21585
|
let s = {
|
|
21583
21586
|
version: 3,
|
|
21584
21587
|
layout: i,
|
|
21585
|
-
content:
|
|
21588
|
+
content: wv(r, o)
|
|
21586
21589
|
};
|
|
21587
|
-
if (
|
|
21588
|
-
let e =
|
|
21590
|
+
if (R_(n, "version") && n.version !== 3 && $(o, typeof n.version == "number" ? "invalid-value" : "wrong-type", "$.version", "omitted", "version was normalized to 3"), R_(n, "language")) {
|
|
21591
|
+
let e = Cv(n.language, "$.language", o);
|
|
21589
21592
|
e !== void 0 && (s.language = e);
|
|
21590
21593
|
}
|
|
21591
|
-
if (
|
|
21592
|
-
let e =
|
|
21594
|
+
if (R_(n, "controls")) {
|
|
21595
|
+
let e = vv(n.controls, "$.controls", o);
|
|
21593
21596
|
e !== void 0 && (s.controls = e);
|
|
21594
21597
|
}
|
|
21595
|
-
if (
|
|
21596
|
-
let e =
|
|
21598
|
+
if (R_(n, "capabilities")) {
|
|
21599
|
+
let e = xv(n.capabilities, "$.capabilities", o);
|
|
21597
21600
|
e !== void 0 && (s.capabilities = e);
|
|
21598
21601
|
}
|
|
21599
|
-
if (
|
|
21600
|
-
let e =
|
|
21602
|
+
if (R_(n, "strings")) {
|
|
21603
|
+
let e = Sv(n.strings, "$.strings", o);
|
|
21601
21604
|
e !== void 0 && (s.strings = e);
|
|
21602
21605
|
}
|
|
21603
|
-
let c = s.content.chapters, l = s.content.duration ?? (
|
|
21606
|
+
let c = s.content.chapters, l = s.content.duration ?? (V_(t.engineDuration) ? t.engineDuration : void 0);
|
|
21604
21607
|
return c !== void 0 && c.length > 0 && l === void 0 ? {
|
|
21605
21608
|
status: "pending-duration",
|
|
21606
21609
|
config: s,
|
|
21607
21610
|
findings: o,
|
|
21608
21611
|
diagnostic: null
|
|
21609
|
-
} : (c !== void 0 && l !== void 0 && (s.content.chapters =
|
|
21612
|
+
} : (c !== void 0 && l !== void 0 && (s.content.chapters = Dv(c, l, o)), Ev(s, o));
|
|
21610
21613
|
}
|
|
21611
|
-
function
|
|
21612
|
-
if (!
|
|
21613
|
-
let n = [...e.findings], r =
|
|
21614
|
-
return
|
|
21614
|
+
function kv(e, t) {
|
|
21615
|
+
if (!V_(t)) return e;
|
|
21616
|
+
let n = [...e.findings], r = Dv(e.config.content.chapters ?? [], t, n);
|
|
21617
|
+
return Ev({
|
|
21615
21618
|
...e.config,
|
|
21616
21619
|
content: {
|
|
21617
21620
|
...e.config.content,
|
|
@@ -21619,16 +21622,16 @@ function Ov(e, t) {
|
|
|
21619
21622
|
}
|
|
21620
21623
|
}, n);
|
|
21621
21624
|
}
|
|
21622
|
-
function
|
|
21623
|
-
return
|
|
21625
|
+
function Av(e) {
|
|
21626
|
+
return Ev(e.config, e.findings);
|
|
21624
21627
|
}
|
|
21625
21628
|
//#endregion
|
|
21626
21629
|
//#region src/page-api/player-runtime.ts
|
|
21627
|
-
var
|
|
21628
|
-
function
|
|
21630
|
+
var jv = Symbol("chapter-unset"), Mv = () => void 0;
|
|
21631
|
+
function Nv(e) {
|
|
21629
21632
|
return Number.isFinite(e) && e >= 0 ? e : 0;
|
|
21630
21633
|
}
|
|
21631
|
-
function
|
|
21634
|
+
function Pv(e) {
|
|
21632
21635
|
return Eh({
|
|
21633
21636
|
version: 3,
|
|
21634
21637
|
layout: e,
|
|
@@ -21642,14 +21645,14 @@ function Nv(e) {
|
|
|
21642
21645
|
}
|
|
21643
21646
|
});
|
|
21644
21647
|
}
|
|
21645
|
-
function
|
|
21648
|
+
function Fv(e) {
|
|
21646
21649
|
if (typeof e == "object" && e && "layout" in e) {
|
|
21647
21650
|
let t = e.layout;
|
|
21648
21651
|
if (t === "landscape" || t === "portrait") return t;
|
|
21649
21652
|
}
|
|
21650
21653
|
return "landscape";
|
|
21651
21654
|
}
|
|
21652
|
-
var
|
|
21655
|
+
var Iv = class {
|
|
21653
21656
|
#e;
|
|
21654
21657
|
#t;
|
|
21655
21658
|
#n;
|
|
@@ -21668,7 +21671,7 @@ var Fv = class {
|
|
|
21668
21671
|
#h = 0;
|
|
21669
21672
|
#g = "";
|
|
21670
21673
|
#_ = -1;
|
|
21671
|
-
#v =
|
|
21674
|
+
#v = jv;
|
|
21672
21675
|
#y = Object.freeze({
|
|
21673
21676
|
playback: "idle",
|
|
21674
21677
|
currentTime: 0,
|
|
@@ -21721,9 +21724,9 @@ var Fv = class {
|
|
|
21721
21724
|
return this.#x;
|
|
21722
21725
|
}
|
|
21723
21726
|
mount(e) {
|
|
21724
|
-
let t =
|
|
21727
|
+
let t = Ov(e, { application: "mount" });
|
|
21725
21728
|
if (t.status === "invalid") {
|
|
21726
|
-
let n =
|
|
21729
|
+
let n = Fv(e), r = Pv(n), i = mh(), a = Hm(r);
|
|
21727
21730
|
throw this.#m += 1, this.#l = Object.freeze({
|
|
21728
21731
|
generation: this.#m,
|
|
21729
21732
|
revision: ++this.#h,
|
|
@@ -21746,7 +21749,7 @@ var Fv = class {
|
|
|
21746
21749
|
if (this.#b) return;
|
|
21747
21750
|
let t = this.application;
|
|
21748
21751
|
this.#E();
|
|
21749
|
-
let n =
|
|
21752
|
+
let n = Ov(e, {
|
|
21750
21753
|
application: "update",
|
|
21751
21754
|
instanceLayout: t.config.layout
|
|
21752
21755
|
});
|
|
@@ -21770,8 +21773,8 @@ var Fv = class {
|
|
|
21770
21773
|
});
|
|
21771
21774
|
let e = this.#d.getSnapshot(), t = this.#d.playerState.getSnapshot().playback, n = Object.freeze({
|
|
21772
21775
|
playback: t,
|
|
21773
|
-
currentTime:
|
|
21774
|
-
duration:
|
|
21776
|
+
currentTime: Nv(e.currentTime),
|
|
21777
|
+
duration: Nv(e.duration),
|
|
21775
21778
|
volume: e.volume,
|
|
21776
21779
|
muted: e.muted,
|
|
21777
21780
|
rate: e.rate,
|
|
@@ -21782,7 +21785,7 @@ var Fv = class {
|
|
|
21782
21785
|
return this.#y = n, n;
|
|
21783
21786
|
}
|
|
21784
21787
|
on(e, t) {
|
|
21785
|
-
if (this.#b) return
|
|
21788
|
+
if (this.#b) return Mv;
|
|
21786
21789
|
let n = this.#s.get(e) ?? /* @__PURE__ */ new Set();
|
|
21787
21790
|
this.#s.set(e, n);
|
|
21788
21791
|
let r = t;
|
|
@@ -21793,7 +21796,7 @@ var Fv = class {
|
|
|
21793
21796
|
};
|
|
21794
21797
|
}
|
|
21795
21798
|
attachEngine(e) {
|
|
21796
|
-
if (this.#b) return
|
|
21799
|
+
if (this.#b) return Mv;
|
|
21797
21800
|
this.#f?.(), this.#d = e;
|
|
21798
21801
|
let t = e.media, n = e.getSnapshot(), r = e.playerState.getSnapshot(), i = e.subscribe(() => {
|
|
21799
21802
|
let t = e.getSnapshot();
|
|
@@ -21823,7 +21826,7 @@ var Fv = class {
|
|
|
21823
21826
|
let n = this.application;
|
|
21824
21827
|
if (n.generation !== e || n.revision !== t) return;
|
|
21825
21828
|
let r = `${e}:${t}`;
|
|
21826
|
-
this.#g !== r && (this.#g = r, n.commit !== "duration" && (this.#S = !0, this.#_ = -1, this.#v =
|
|
21829
|
+
this.#g !== r && (this.#g = r, n.commit !== "duration" && (this.#S = !0, this.#_ = -1, this.#v = jv, n.configurationError ? (this.#d.pause(), this.#d.playerState.enterConfigurationError()) : (this.#C = n.generation, this.#d.playerState.resetForApplication(this.#r), this.#d.userState.applyResolvedConfig(n.config, this.#r), this.#d.load()), this.#S = !1, n.commit === "update" && this.#I("videoChange", {})));
|
|
21827
21830
|
}
|
|
21828
21831
|
#w(e, t) {
|
|
21829
21832
|
let n = this.#d?.userState.getSnapshot() ?? this.#a.hydrate(), r = Eh(e.config, n), i = mh(typeof r.language == "string" ? r.language : [...r.language], r.strings), a = this.#l?.registry ?? Hm(r);
|
|
@@ -21846,7 +21849,7 @@ var Fv = class {
|
|
|
21846
21849
|
#T(e) {
|
|
21847
21850
|
let t = this.#u;
|
|
21848
21851
|
if (t === null || t.generation !== this.application.generation || this.#C !== -1 || !Number.isFinite(e) || e <= 0) return;
|
|
21849
|
-
let n =
|
|
21852
|
+
let n = kv(t.result, e);
|
|
21850
21853
|
if (n.status === "pending-duration") return;
|
|
21851
21854
|
this.#u = null;
|
|
21852
21855
|
let r = this.#d?.userState.getSnapshot() ?? this.#a.hydrate(), i = Eh(n.config, r);
|
|
@@ -21861,7 +21864,7 @@ var Fv = class {
|
|
|
21861
21864
|
let e = this.#u;
|
|
21862
21865
|
if (e === null) return;
|
|
21863
21866
|
this.#u = null;
|
|
21864
|
-
let t =
|
|
21867
|
+
let t = Av(e.result);
|
|
21865
21868
|
this.#L([...t.findings, ...e.stringFindings]);
|
|
21866
21869
|
}
|
|
21867
21870
|
#D(e) {
|
|
@@ -21891,7 +21894,7 @@ var Fv = class {
|
|
|
21891
21894
|
#M(e) {
|
|
21892
21895
|
if (!(this.#b || this.#S || this.#d === null)) {
|
|
21893
21896
|
if (e === "canplay") {
|
|
21894
|
-
this.#C = -1, this.#T(this.#d.getSnapshot().duration), this.#_ !== this.application.generation && (this.#_ = this.application.generation, this.#I("ready", { duration:
|
|
21897
|
+
this.#C = -1, this.#T(this.#d.getSnapshot().duration), this.#_ !== this.application.generation && (this.#_ = this.application.generation, this.#I("ready", { duration: Nv(this.#d.getSnapshot().duration) }));
|
|
21895
21898
|
return;
|
|
21896
21899
|
}
|
|
21897
21900
|
if (this.#C === -1) {
|
|
@@ -21926,33 +21929,33 @@ var Fv = class {
|
|
|
21926
21929
|
}
|
|
21927
21930
|
#I(e, t) {
|
|
21928
21931
|
if (this.#b) return;
|
|
21929
|
-
let n =
|
|
21932
|
+
let n = Nv(this.#d?.getSnapshot().currentTime ?? 0), r = Object.freeze({
|
|
21930
21933
|
currentTime: n,
|
|
21931
21934
|
...t
|
|
21932
21935
|
});
|
|
21933
21936
|
for (let t of [...this.#s.get(e) ?? []]) t(r);
|
|
21934
21937
|
}
|
|
21935
21938
|
#L(e) {
|
|
21936
|
-
|
|
21939
|
+
j_(e, (e) => this.#R(e));
|
|
21937
21940
|
}
|
|
21938
21941
|
#R(e) {
|
|
21939
21942
|
e.level === "error" ? console.error(e.message) : console.warn(e.message);
|
|
21940
21943
|
}
|
|
21941
|
-
},
|
|
21942
|
-
function
|
|
21944
|
+
}, Lv = /* @__PURE__ */ new WeakMap();
|
|
21945
|
+
function Rv(e) {
|
|
21943
21946
|
return e.id ? `#${e.id}` : e.tagName.toLowerCase();
|
|
21944
21947
|
}
|
|
21945
|
-
function
|
|
21946
|
-
let n =
|
|
21948
|
+
function zv(e, t) {
|
|
21949
|
+
let n = Lv.get(e);
|
|
21947
21950
|
if (n !== void 0) {
|
|
21948
|
-
if (!n.isFailedMount()) throw Error(`Cannot create player: host ${
|
|
21951
|
+
if (!n.isFailedMount()) throw Error(`Cannot create player: host ${Rv(e)} is already owned`);
|
|
21949
21952
|
n.destroy();
|
|
21950
21953
|
}
|
|
21951
|
-
let r = (0, od.createRoot)(e), i = new
|
|
21952
|
-
applicationContext:
|
|
21954
|
+
let r = (0, od.createRoot)(e), i = new Iv({
|
|
21955
|
+
applicationContext: k_(e),
|
|
21953
21956
|
render(e) {
|
|
21954
21957
|
r !== null && (0, Cl.flushSync)(() => {
|
|
21955
|
-
r?.render((0, w.createElement)(
|
|
21958
|
+
r?.render((0, w.createElement)(g_, {
|
|
21956
21959
|
application: e,
|
|
21957
21960
|
runtime: i
|
|
21958
21961
|
}));
|
|
@@ -21964,10 +21967,10 @@ function Rv(e, t) {
|
|
|
21964
21967
|
r = null, (0, Cl.flushSync)(() => e.unmount());
|
|
21965
21968
|
},
|
|
21966
21969
|
releaseHost() {
|
|
21967
|
-
|
|
21970
|
+
Lv.get(e) === i && Lv.delete(e);
|
|
21968
21971
|
}
|
|
21969
21972
|
});
|
|
21970
|
-
return
|
|
21973
|
+
return Lv.set(e, i), i.mount(t);
|
|
21971
21974
|
}
|
|
21972
21975
|
//#endregion
|
|
21973
|
-
export { m as _, jp as a, Qt as c, bt as d, ht as f, v as g, f as h, kp as i, Zt as l, _ as m,
|
|
21976
|
+
export { m as _, jp as a, Qt as c, bt as d, ht as f, v as g, f as h, kp as i, Zt as l, _ as m, O_ as n, Nd as o, M as p, Ep as r, yn as s, zv as t, Xt as u };
|