@latest-thinking/lt-player 3.0.0-beta.26 → 3.0.0-beta.27
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 +953 -929
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/player.js
CHANGED
|
@@ -16897,22 +16897,22 @@ function Ef({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
16897
16897
|
}) : null;
|
|
16898
16898
|
}
|
|
16899
16899
|
function Df({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
16900
|
-
let i = vf(e), a = fd(), o =
|
|
16900
|
+
let i = vf(e), a = fd(), o = qd("chapters"), s = yf(i), c = bf(i), l = Rt((0, w.useMemo)(() => (e) => uf(a.content.chapters, ci(e)?.currentTime ?? 0), [a.content.chapters])), u = _f(), d = a.controls.hotkeys.enabled && !u;
|
|
16901
16901
|
return (0, w.useEffect)(() => {
|
|
16902
|
-
|
|
16903
|
-
}, [
|
|
16902
|
+
u && i.close();
|
|
16903
|
+
}, [u, i]), (0, w.useEffect)(() => () => {
|
|
16904
16904
|
i.close();
|
|
16905
16905
|
}, [i]), /* @__PURE__ */ (0, M.jsxs)(q.Root, {
|
|
16906
16906
|
align: "start",
|
|
16907
16907
|
onOpenChange: (e) => i.setOpen(e),
|
|
16908
|
-
open: !
|
|
16908
|
+
open: !u && s.open,
|
|
16909
16909
|
side: "top",
|
|
16910
16910
|
children: [/* @__PURE__ */ (0, M.jsxs)(Zu.Root, {
|
|
16911
|
-
disabled:
|
|
16911
|
+
disabled: u,
|
|
16912
16912
|
side: "top",
|
|
16913
16913
|
children: [/* @__PURE__ */ (0, M.jsx)(Zu.Trigger, { render: /* @__PURE__ */ (0, M.jsxs)(q.Trigger, {
|
|
16914
|
-
"aria-keyshortcuts":
|
|
16915
|
-
"aria-label":
|
|
16914
|
+
"aria-keyshortcuts": d ? lf.aria : void 0,
|
|
16915
|
+
"aria-label": o,
|
|
16916
16916
|
className: "ltp-chapters-trigger",
|
|
16917
16917
|
"data-ltp-capability": "chapters",
|
|
16918
16918
|
"data-ltp-slot": t,
|
|
@@ -16922,19 +16922,19 @@ function Df({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
16922
16922
|
"aria-hidden": "true",
|
|
16923
16923
|
className: "ltp-chapters-trigger__icon",
|
|
16924
16924
|
children: /* @__PURE__ */ (0, M.jsx)(Y, { name: "chapters" })
|
|
16925
|
-
}),
|
|
16925
|
+
}), l === null ? null : /* @__PURE__ */ (0, M.jsx)("span", {
|
|
16926
16926
|
className: "ltp-chapters-trigger__name",
|
|
16927
|
-
children:
|
|
16927
|
+
children: l.name
|
|
16928
16928
|
})]
|
|
16929
16929
|
}) }), /* @__PURE__ */ (0, M.jsxs)(Zu.Popup, {
|
|
16930
16930
|
className: "ltp-core-tooltip",
|
|
16931
|
-
children: [/* @__PURE__ */ (0, M.jsx)(Zu.Label, { children:
|
|
16931
|
+
children: [/* @__PURE__ */ (0, M.jsx)(Zu.Label, { children: o }), d ? /* @__PURE__ */ (0, M.jsx)(Zu.Shortcut, { children: lf.display }) : null]
|
|
16932
16932
|
})]
|
|
16933
|
-
}),
|
|
16933
|
+
}), u || c === null ? null : (0, Dl.createPortal)(/* @__PURE__ */ (0, M.jsx)(Mf, {
|
|
16934
16934
|
module: i,
|
|
16935
|
-
open:
|
|
16935
|
+
open: s.open,
|
|
16936
16936
|
state: n
|
|
16937
|
-
}),
|
|
16937
|
+
}), c)]
|
|
16938
16938
|
});
|
|
16939
16939
|
}
|
|
16940
16940
|
function Of(e, t) {
|
|
@@ -16942,22 +16942,50 @@ function Of(e, t) {
|
|
|
16942
16942
|
return n > 0 && i.push(Vd(t, "chapterMinute", { count: n })), (r > 0 || i.length === 0) && i.push(Vd(t, "chapterSecond", { count: r })), i.join(" ");
|
|
16943
16943
|
}
|
|
16944
16944
|
function kf(e, t, n) {
|
|
16945
|
-
return n <= e ? 0 : t === null || t <= 0 ?
|
|
16945
|
+
return n <= e ? 0 : t === null || t <= 0 ? 1 : Math.min(1, (n - e) / t);
|
|
16946
16946
|
}
|
|
16947
|
-
function Af(e, t) {
|
|
16947
|
+
function Af({ duration: e, start: t }) {
|
|
16948
|
+
let n = Rt(), r = (0, w.useRef)(null);
|
|
16949
|
+
return (0, w.useEffect)(() => {
|
|
16950
|
+
let i = () => {
|
|
16951
|
+
let i = ci(n.state)?.currentTime ?? 0;
|
|
16952
|
+
r.current?.style.setProperty("--ltp-chapter-menu-progress", String(kf(t, e, i)));
|
|
16953
|
+
};
|
|
16954
|
+
return i(), n.subscribe(i);
|
|
16955
|
+
}, [
|
|
16956
|
+
e,
|
|
16957
|
+
n,
|
|
16958
|
+
t
|
|
16959
|
+
]), /* @__PURE__ */ (0, M.jsx)("span", {
|
|
16960
|
+
"aria-hidden": "true",
|
|
16961
|
+
className: "ltp-chapters-menu__progress",
|
|
16962
|
+
children: /* @__PURE__ */ (0, M.jsx)("span", {
|
|
16963
|
+
className: "ltp-chapters-menu__progress-fill",
|
|
16964
|
+
ref: r
|
|
16965
|
+
})
|
|
16966
|
+
});
|
|
16967
|
+
}
|
|
16968
|
+
function jf(e, t) {
|
|
16948
16969
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
16949
16970
|
r.top < n.top ? e.scrollTop += r.top - n.top : r.bottom > n.bottom && (e.scrollTop += r.bottom - n.bottom);
|
|
16950
16971
|
}
|
|
16951
|
-
function
|
|
16952
|
-
let r = fd(), i =
|
|
16972
|
+
function Mf({ module: e, open: t, state: n }) {
|
|
16973
|
+
let r = fd(), i = qd("chapters"), a = Kd(), { current: o, duration: s, seek: c } = Rt((0, w.useMemo)(() => (e) => {
|
|
16974
|
+
let t = ci(e);
|
|
16975
|
+
return {
|
|
16976
|
+
current: uf(r.content.chapters, t?.currentTime ?? 0),
|
|
16977
|
+
duration: xf(r.content.duration, t?.duration ?? 0),
|
|
16978
|
+
seek: t?.seek
|
|
16979
|
+
};
|
|
16980
|
+
}, [r.content.chapters, r.content.duration])), l = (0, w.useRef)(null);
|
|
16953
16981
|
return (0, w.useEffect)(() => {
|
|
16954
16982
|
if (!t) return;
|
|
16955
16983
|
let e = requestAnimationFrame(() => {
|
|
16956
|
-
let e =
|
|
16957
|
-
e !== null && t != null &&
|
|
16984
|
+
let e = l.current, t = e?.querySelector("[data-ltp-active-chapter]");
|
|
16985
|
+
e !== null && t != null && jf(e, t);
|
|
16958
16986
|
});
|
|
16959
16987
|
return () => cancelAnimationFrame(e);
|
|
16960
|
-
}, [
|
|
16988
|
+
}, [t]), /* @__PURE__ */ (0, M.jsx)(q.Popup, {
|
|
16961
16989
|
className: "ltp-chapters-menu",
|
|
16962
16990
|
"data-ltp-capability": "chapters",
|
|
16963
16991
|
"data-ltp-chapters-menu": "",
|
|
@@ -16965,17 +16993,17 @@ function jf({ module: e, open: t, state: n }) {
|
|
|
16965
16993
|
"data-ltp-state": n,
|
|
16966
16994
|
"data-ltp-surface": "menu",
|
|
16967
16995
|
children: /* @__PURE__ */ (0, M.jsx)(q.Content, {
|
|
16968
|
-
"aria-label":
|
|
16996
|
+
"aria-label": i,
|
|
16969
16997
|
className: "ltp-chapters-menu__content",
|
|
16970
|
-
ref:
|
|
16998
|
+
ref: l,
|
|
16971
16999
|
children: r.content.chapters.map((t, n) => {
|
|
16972
|
-
let
|
|
17000
|
+
let i = ff(r.content.chapters, n, s), l = o === t;
|
|
16973
17001
|
return /* @__PURE__ */ (0, M.jsxs)(q.Item, {
|
|
16974
|
-
"aria-current":
|
|
17002
|
+
"aria-current": l || void 0,
|
|
16975
17003
|
className: "ltp-chapters-menu__item",
|
|
16976
|
-
"data-ltp-active-chapter":
|
|
17004
|
+
"data-ltp-active-chapter": l || void 0,
|
|
16977
17005
|
onSelect: () => {
|
|
16978
|
-
e.close(),
|
|
17006
|
+
e.close(), c?.(t.start).catch(() => void 0);
|
|
16979
17007
|
},
|
|
16980
17008
|
children: [
|
|
16981
17009
|
/* @__PURE__ */ (0, M.jsxs)("span", {
|
|
@@ -16985,13 +17013,13 @@ function jf({ module: e, open: t, state: n }) {
|
|
|
16985
17013
|
children: [/* @__PURE__ */ (0, M.jsx)("span", {
|
|
16986
17014
|
className: "ltp-chapters-menu__authored-name",
|
|
16987
17015
|
children: t.name
|
|
16988
|
-
}),
|
|
17016
|
+
}), l ? /* @__PURE__ */ (0, M.jsx)("span", {
|
|
16989
17017
|
"aria-hidden": "true",
|
|
16990
17018
|
className: "ltp-chapters-menu__active-dot"
|
|
16991
17019
|
}) : null]
|
|
16992
|
-
}),
|
|
17020
|
+
}), i === null ? null : /* @__PURE__ */ (0, M.jsx)("span", {
|
|
16993
17021
|
className: "ltp-chapters-menu__duration",
|
|
16994
|
-
children: Of(
|
|
17022
|
+
children: Of(i, a)
|
|
16995
17023
|
})]
|
|
16996
17024
|
}),
|
|
16997
17025
|
/* @__PURE__ */ (0, M.jsx)("time", {
|
|
@@ -16999,13 +17027,9 @@ function jf({ module: e, open: t, state: n }) {
|
|
|
16999
17027
|
dateTime: `PT${t.start}S`,
|
|
17000
17028
|
children: pf(t.start)
|
|
17001
17029
|
}),
|
|
17002
|
-
|
|
17003
|
-
|
|
17004
|
-
|
|
17005
|
-
children: /* @__PURE__ */ (0, M.jsx)("span", {
|
|
17006
|
-
className: "ltp-chapters-menu__progress-fill",
|
|
17007
|
-
style: { "--ltp-chapter-menu-progress": `${u}%` }
|
|
17008
|
-
})
|
|
17030
|
+
l ? /* @__PURE__ */ (0, M.jsx)(Af, {
|
|
17031
|
+
duration: i,
|
|
17032
|
+
start: t.start
|
|
17009
17033
|
}) : null
|
|
17010
17034
|
]
|
|
17011
17035
|
}, `${t.start}:${t.name}`);
|
|
@@ -17013,7 +17037,7 @@ function jf({ module: e, open: t, state: n }) {
|
|
|
17013
17037
|
})
|
|
17014
17038
|
});
|
|
17015
17039
|
}
|
|
17016
|
-
function
|
|
17040
|
+
function Nf({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
17017
17041
|
let i = vf(e), a = (0, w.useMemo)(() => (e) => i.setMenuPortalTarget(e), [i]);
|
|
17018
17042
|
return /* @__PURE__ */ (0, M.jsx)("span", {
|
|
17019
17043
|
className: "ltp-chapters-menu-anchor",
|
|
@@ -17026,23 +17050,23 @@ function Mf({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
17026
17050
|
}
|
|
17027
17051
|
//#endregion
|
|
17028
17052
|
//#region src/core/authored-text-tracks.ts
|
|
17029
|
-
var
|
|
17030
|
-
function Pf(e) {
|
|
17031
|
-
return e === null ? [] : Array.from(e.querySelectorAll(`track[${Nf}]`));
|
|
17032
|
-
}
|
|
17053
|
+
var Pf = "data-ltp-authored-track";
|
|
17033
17054
|
function Ff(e) {
|
|
17034
|
-
return
|
|
17055
|
+
return e === null ? [] : Array.from(e.querySelectorAll(`track[${Pf}]`));
|
|
17035
17056
|
}
|
|
17036
17057
|
function If(e) {
|
|
17037
|
-
return
|
|
17058
|
+
return new Set(Ff(e).map((e) => e.track).filter((e) => e != null));
|
|
17038
17059
|
}
|
|
17039
17060
|
function Lf(e) {
|
|
17040
|
-
|
|
17061
|
+
return Ff(e).filter((e) => !e.hasAttribute("data-ltp-track-failed")).map((e) => e.track).filter((e) => e != null);
|
|
17062
|
+
}
|
|
17063
|
+
function Rf(e) {
|
|
17064
|
+
let t = If(e);
|
|
17041
17065
|
for (let n of Array.from(e.textTracks)) !t.has(n) && n.mode !== "disabled" && (n.mode = "disabled");
|
|
17042
17066
|
}
|
|
17043
|
-
function
|
|
17067
|
+
function zf(e, t) {
|
|
17044
17068
|
let n = () => {
|
|
17045
|
-
|
|
17069
|
+
Rf(e), t?.(If(e));
|
|
17046
17070
|
};
|
|
17047
17071
|
return e.textTracks.addEventListener("addtrack", n), e.textTracks.addEventListener("change", n), e.addEventListener("addtrack", n), e.addEventListener("change", n), n(), () => {
|
|
17048
17072
|
e.textTracks.removeEventListener("addtrack", n), e.textTracks.removeEventListener("change", n), e.removeEventListener("addtrack", n), e.removeEventListener("change", n);
|
|
@@ -17050,30 +17074,30 @@ function Rf(e, t) {
|
|
|
17050
17074
|
}
|
|
17051
17075
|
//#endregion
|
|
17052
17076
|
//#region src/user-state/user-state-context.tsx
|
|
17053
|
-
var
|
|
17054
|
-
function
|
|
17055
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
17077
|
+
var Bf = (0, w.createContext)(null);
|
|
17078
|
+
function Vf({ children: e, controller: t }) {
|
|
17079
|
+
return /* @__PURE__ */ (0, M.jsx)(Bf, {
|
|
17056
17080
|
value: t,
|
|
17057
17081
|
children: e
|
|
17058
17082
|
});
|
|
17059
17083
|
}
|
|
17060
|
-
function
|
|
17061
|
-
let e = (0, w.useContext)(
|
|
17084
|
+
function Hf() {
|
|
17085
|
+
let e = (0, w.useContext)(Bf);
|
|
17062
17086
|
if (e === null) throw Error("useUserStateController must be used within UserStateProvider");
|
|
17063
17087
|
return e;
|
|
17064
17088
|
}
|
|
17065
17089
|
//#endregion
|
|
17066
17090
|
//#region src/capabilities/captions-model.ts
|
|
17067
|
-
function
|
|
17091
|
+
function Uf(e) {
|
|
17068
17092
|
return e === "captions" || e === "subtitles";
|
|
17069
17093
|
}
|
|
17070
|
-
function
|
|
17094
|
+
function Wf(e) {
|
|
17071
17095
|
return e === "hidden" || e === "showing";
|
|
17072
17096
|
}
|
|
17073
|
-
function
|
|
17097
|
+
function Gf(e) {
|
|
17074
17098
|
return `ltp-text-track-${e}`;
|
|
17075
17099
|
}
|
|
17076
|
-
function
|
|
17100
|
+
function Kf(e) {
|
|
17077
17101
|
if (typeof e != "object" || !e) return "";
|
|
17078
17102
|
let t = e;
|
|
17079
17103
|
if (typeof t.getCueAsHTML == "function") try {
|
|
@@ -17081,34 +17105,34 @@ function Gf(e) {
|
|
|
17081
17105
|
} catch {}
|
|
17082
17106
|
return typeof t.text == "string" ? t.text.trim() : "";
|
|
17083
17107
|
}
|
|
17084
|
-
function
|
|
17108
|
+
function qf(e, t) {
|
|
17085
17109
|
let n = () => {
|
|
17086
|
-
t(Object.freeze(Array.from(e.activeCues ?? []).map((e) =>
|
|
17110
|
+
t(Object.freeze(Array.from(e.activeCues ?? []).map((e) => Kf(e)).filter((e) => e.length > 0)));
|
|
17087
17111
|
};
|
|
17088
17112
|
return e.addEventListener("cuechange", n), n(), () => e.removeEventListener("cuechange", n);
|
|
17089
17113
|
}
|
|
17090
17114
|
//#endregion
|
|
17091
17115
|
//#region src/capabilities/captions.tsx
|
|
17092
|
-
var
|
|
17093
|
-
function
|
|
17116
|
+
var Jf = (0, w.createContext)(null);
|
|
17117
|
+
function Yf(e) {
|
|
17094
17118
|
if (e.key !== "captions") throw Error("Expected the captions capability module");
|
|
17095
17119
|
return e;
|
|
17096
17120
|
}
|
|
17097
|
-
function
|
|
17121
|
+
function Xf(e) {
|
|
17098
17122
|
return (0, w.useSyncExternalStore)(e.subscribeInteraction, e.getInteractionSnapshot, e.getInteractionSnapshot);
|
|
17099
17123
|
}
|
|
17100
|
-
function
|
|
17124
|
+
function Zf(e) {
|
|
17101
17125
|
return (0, w.useSyncExternalStore)(e.subscribeMenuPortalTarget, e.getMenuPortalTarget, e.getMenuPortalTarget);
|
|
17102
17126
|
}
|
|
17103
|
-
function
|
|
17104
|
-
let e = (0, w.useContext)(
|
|
17127
|
+
function Qf() {
|
|
17128
|
+
let e = (0, w.useContext)(Jf);
|
|
17105
17129
|
if (e === null) throw Error("Captions runtime hooks must be used within CaptionsRuntimeProvider");
|
|
17106
17130
|
return e;
|
|
17107
17131
|
}
|
|
17108
|
-
function
|
|
17109
|
-
return (0, w.useContext)(
|
|
17132
|
+
function $f() {
|
|
17133
|
+
return (0, w.useContext)(Jf);
|
|
17110
17134
|
}
|
|
17111
|
-
function
|
|
17135
|
+
function ep({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
17112
17136
|
return /* @__PURE__ */ (0, M.jsx)("span", {
|
|
17113
17137
|
"aria-hidden": "true",
|
|
17114
17138
|
"data-ltp-capability": e.key,
|
|
@@ -17118,32 +17142,32 @@ function $f({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
17118
17142
|
hidden: !0
|
|
17119
17143
|
});
|
|
17120
17144
|
}
|
|
17121
|
-
function
|
|
17145
|
+
function tp(e) {
|
|
17122
17146
|
if (e === null) return !1;
|
|
17123
17147
|
let t = e;
|
|
17124
17148
|
return t.webkitPresentationMode === "fullscreen" || t.webkitDisplayingFullscreen === !0;
|
|
17125
17149
|
}
|
|
17126
|
-
function
|
|
17127
|
-
let [n, r] = (0, w.useState)(() =>
|
|
17150
|
+
function np(e, t) {
|
|
17151
|
+
let [n, r] = (0, w.useState)(() => tp(t));
|
|
17128
17152
|
return (0, w.useLayoutEffect)(() => {
|
|
17129
17153
|
if (t === null) {
|
|
17130
17154
|
r(!1);
|
|
17131
17155
|
return;
|
|
17132
17156
|
}
|
|
17133
|
-
let e = () => r(
|
|
17157
|
+
let e = () => r(tp(t)), n = () => r(!0), i = () => r(!1);
|
|
17134
17158
|
return t.addEventListener("webkitpresentationmodechanged", e), t.addEventListener("webkitbeginfullscreen", n), t.addEventListener("webkitendfullscreen", i), e(), () => {
|
|
17135
17159
|
t.removeEventListener("webkitpresentationmodechanged", e), t.removeEventListener("webkitbeginfullscreen", n), t.removeEventListener("webkitendfullscreen", i);
|
|
17136
17160
|
};
|
|
17137
17161
|
}, [e, t]), n;
|
|
17138
17162
|
}
|
|
17139
|
-
function
|
|
17140
|
-
let r = Rt(si), i = fd(), a =
|
|
17163
|
+
function rp({ children: e, generation: t, media: n }) {
|
|
17164
|
+
let r = Rt(si), i = fd(), a = Hf(), o = Xf(nh().getModule("captions")), s = np(t, n), [c, l] = (0, w.useState)(Object.freeze([])), [u, d] = (0, w.useState)(null), [f, p] = (0, w.useState)(0);
|
|
17141
17165
|
(0, w.useLayoutEffect)(() => p((e) => e + 1), [t]);
|
|
17142
17166
|
let m = (0, w.useMemo)(() => {
|
|
17143
|
-
let e =
|
|
17167
|
+
let e = Ff(n);
|
|
17144
17168
|
return Object.freeze(i.content.tracks.flatMap((t, n) => {
|
|
17145
|
-
if (!
|
|
17146
|
-
let r = e[n], i = r?.id ??
|
|
17169
|
+
if (!Uf(t.kind ?? "")) return [];
|
|
17170
|
+
let r = e[n], i = r?.id ?? Gf(n);
|
|
17147
17171
|
if (r?.hasAttribute("data-ltp-track-failed")) return [];
|
|
17148
17172
|
let a = r?.track;
|
|
17149
17173
|
return [Object.freeze({
|
|
@@ -17160,11 +17184,11 @@ function np({ children: e, generation: t, media: n }) {
|
|
|
17160
17184
|
n,
|
|
17161
17185
|
r?.textTrackList,
|
|
17162
17186
|
f
|
|
17163
|
-
]), h = m.find((e) =>
|
|
17187
|
+
]), h = m.find((e) => Wf(e.mode)) ?? null;
|
|
17164
17188
|
(0, w.useLayoutEffect)(() => {
|
|
17165
|
-
if (n !== null) return
|
|
17189
|
+
if (n !== null) return zf(n, (e) => {
|
|
17166
17190
|
for (let t of e) {
|
|
17167
|
-
if (!
|
|
17191
|
+
if (!Uf(t.kind) || !Wf(t.mode)) continue;
|
|
17168
17192
|
let e = s ? "showing" : "hidden";
|
|
17169
17193
|
t.mode !== e && (t.mode = e);
|
|
17170
17194
|
}
|
|
@@ -17180,7 +17204,7 @@ function np({ children: e, generation: t, media: n }) {
|
|
|
17180
17204
|
l(Object.freeze([]));
|
|
17181
17205
|
return;
|
|
17182
17206
|
}
|
|
17183
|
-
return
|
|
17207
|
+
return qf(e, l);
|
|
17184
17208
|
}, [
|
|
17185
17209
|
t,
|
|
17186
17210
|
n,
|
|
@@ -17225,13 +17249,13 @@ function np({ children: e, generation: t, media: n }) {
|
|
|
17225
17249
|
_,
|
|
17226
17250
|
m
|
|
17227
17251
|
]);
|
|
17228
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
17252
|
+
return /* @__PURE__ */ (0, M.jsx)(Jf, {
|
|
17229
17253
|
value: b,
|
|
17230
17254
|
children: e
|
|
17231
17255
|
});
|
|
17232
17256
|
}
|
|
17233
|
-
function
|
|
17234
|
-
let n =
|
|
17257
|
+
function ip({ index: e, track: t }) {
|
|
17258
|
+
let n = nh().getModule("captions"), r = Hf(), i = Gf(e), a = Uf(t.kind ?? "");
|
|
17235
17259
|
return /* @__PURE__ */ (0, M.jsx)("track", {
|
|
17236
17260
|
"data-ltp-authored-track": "",
|
|
17237
17261
|
"data-ltp-caption-track": a || void 0,
|
|
@@ -17245,15 +17269,15 @@ function rp({ index: e, track: t }) {
|
|
|
17245
17269
|
srcLang: t.srclang
|
|
17246
17270
|
});
|
|
17247
17271
|
}
|
|
17248
|
-
function
|
|
17272
|
+
function ap({ enabled: e }) {
|
|
17249
17273
|
return /* @__PURE__ */ (0, M.jsx)("span", {
|
|
17250
17274
|
"aria-hidden": "true",
|
|
17251
17275
|
className: "ltp-captions-control__icon",
|
|
17252
17276
|
children: /* @__PURE__ */ (0, M.jsx)(Y, { name: e ? "subtitles-on" : "subtitles-off" })
|
|
17253
17277
|
});
|
|
17254
17278
|
}
|
|
17255
|
-
function
|
|
17256
|
-
let e =
|
|
17279
|
+
function op() {
|
|
17280
|
+
let e = Qf(), t = Mc("toggleSubtitles"), n = qd("enableCaptions"), r = qd("disableCaptions"), i = e.selectedTrack !== null, a = i ? r : n;
|
|
17257
17281
|
return /* @__PURE__ */ (0, M.jsxs)(Zu.Root, {
|
|
17258
17282
|
side: "top",
|
|
17259
17283
|
children: [/* @__PURE__ */ (0, M.jsx)(Zu.Trigger, { render: /* @__PURE__ */ (0, M.jsx)("button", {
|
|
@@ -17263,15 +17287,15 @@ function ap() {
|
|
|
17263
17287
|
className: "ltp-core-button ltp-captions-control",
|
|
17264
17288
|
onClick: e.toggle,
|
|
17265
17289
|
type: "button",
|
|
17266
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
17290
|
+
children: /* @__PURE__ */ (0, M.jsx)(ap, { enabled: i })
|
|
17267
17291
|
}) }), /* @__PURE__ */ (0, M.jsxs)(Zu.Popup, {
|
|
17268
17292
|
className: "ltp-core-tooltip",
|
|
17269
17293
|
children: [/* @__PURE__ */ (0, M.jsx)(Zu.Label, { children: a }), t.shortcut ? /* @__PURE__ */ (0, M.jsx)(Zu.Shortcut, { children: t.shortcut }) : null]
|
|
17270
17294
|
})]
|
|
17271
17295
|
});
|
|
17272
17296
|
}
|
|
17273
|
-
function
|
|
17274
|
-
let n =
|
|
17297
|
+
function sp({ module: e, state: t }) {
|
|
17298
|
+
let n = Qf(), r = qd("captions"), i = qd("captionsOffOption"), a = n.selectedTrack?.id ?? "off";
|
|
17275
17299
|
return /* @__PURE__ */ (0, M.jsx)(q.Popup, {
|
|
17276
17300
|
className: "ltp-captions-menu",
|
|
17277
17301
|
"data-ltp-capability": "captions",
|
|
@@ -17310,13 +17334,13 @@ function op({ module: e, state: t }) {
|
|
|
17310
17334
|
})
|
|
17311
17335
|
});
|
|
17312
17336
|
}
|
|
17313
|
-
function
|
|
17314
|
-
let i =
|
|
17337
|
+
function cp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
17338
|
+
let i = Yf(e), a = $f(), o = Xf(i), s = Zf(i), c = _f(), l = Mc("toggleSubtitles"), u = qd("captions"), d = a?.selectedTrack !== null;
|
|
17315
17339
|
return (0, w.useEffect)(() => {
|
|
17316
17340
|
c && i.close();
|
|
17317
17341
|
}, [c, i]), (0, w.useEffect)(() => () => {
|
|
17318
17342
|
i.close();
|
|
17319
|
-
}, [i]), a === null ? /* @__PURE__ */ (0, M.jsx)(
|
|
17343
|
+
}, [i]), a === null ? /* @__PURE__ */ (0, M.jsx)(ep, {
|
|
17320
17344
|
module: e,
|
|
17321
17345
|
slot: t,
|
|
17322
17346
|
state: n,
|
|
@@ -17326,7 +17350,7 @@ function sp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
17326
17350
|
"data-ltp-slot": t,
|
|
17327
17351
|
"data-ltp-state": n,
|
|
17328
17352
|
"data-ltp-surface": r,
|
|
17329
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
17353
|
+
children: /* @__PURE__ */ (0, M.jsx)(op, {})
|
|
17330
17354
|
}) : /* @__PURE__ */ (0, M.jsxs)(q.Root, {
|
|
17331
17355
|
align: "end",
|
|
17332
17356
|
onOpenChange: (e) => i.setOpen(e),
|
|
@@ -17343,21 +17367,21 @@ function sp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
17343
17367
|
"data-ltp-slot": t,
|
|
17344
17368
|
"data-ltp-state": n,
|
|
17345
17369
|
"data-ltp-surface": r,
|
|
17346
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
17370
|
+
children: /* @__PURE__ */ (0, M.jsx)(ap, { enabled: d })
|
|
17347
17371
|
}) }), /* @__PURE__ */ (0, M.jsxs)(Zu.Popup, {
|
|
17348
17372
|
className: "ltp-core-tooltip",
|
|
17349
17373
|
children: [/* @__PURE__ */ (0, M.jsx)(Zu.Label, { children: u }), l.shortcut ? /* @__PURE__ */ (0, M.jsx)(Zu.Shortcut, { children: l.shortcut }) : null]
|
|
17350
17374
|
})]
|
|
17351
|
-
}), c || s === null ? null : (0, Dl.createPortal)(/* @__PURE__ */ (0, M.jsx)(
|
|
17375
|
+
}), c || s === null ? null : (0, Dl.createPortal)(/* @__PURE__ */ (0, M.jsx)(sp, {
|
|
17352
17376
|
module: i,
|
|
17353
17377
|
state: n
|
|
17354
17378
|
}), s)]
|
|
17355
17379
|
}) : null;
|
|
17356
17380
|
}
|
|
17357
|
-
function
|
|
17358
|
-
|
|
17359
|
-
let i =
|
|
17360
|
-
return i === null ? /* @__PURE__ */ (0, M.jsx)(
|
|
17381
|
+
function lp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
17382
|
+
Yf(e);
|
|
17383
|
+
let i = $f();
|
|
17384
|
+
return i === null ? /* @__PURE__ */ (0, M.jsx)(ep, {
|
|
17361
17385
|
module: e,
|
|
17362
17386
|
slot: t,
|
|
17363
17387
|
state: n,
|
|
@@ -17375,8 +17399,8 @@ function cp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
17375
17399
|
}, `${e}:${t}`))
|
|
17376
17400
|
});
|
|
17377
17401
|
}
|
|
17378
|
-
function
|
|
17379
|
-
let i =
|
|
17402
|
+
function up({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
17403
|
+
let i = Yf(e), a = (0, w.useMemo)(() => (e) => i.setMenuPortalTarget(e), [i]);
|
|
17380
17404
|
return /* @__PURE__ */ (0, M.jsx)("span", {
|
|
17381
17405
|
className: "ltp-captions-menu-anchor",
|
|
17382
17406
|
"data-ltp-capability": "captions",
|
|
@@ -17388,7 +17412,7 @@ function lp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
17388
17412
|
}
|
|
17389
17413
|
//#endregion
|
|
17390
17414
|
//#region src/capabilities/speed.tsx
|
|
17391
|
-
function
|
|
17415
|
+
function dp(e, t, n) {
|
|
17392
17416
|
if (e.length === 0) return null;
|
|
17393
17417
|
let r = e.indexOf(t);
|
|
17394
17418
|
if (r >= 0) return e[(r + (n === "forward" ? 1 : -1) + e.length) % e.length] ?? null;
|
|
@@ -17399,12 +17423,12 @@ function up(e, t, n) {
|
|
|
17399
17423
|
}
|
|
17400
17424
|
return e.at(-1) ?? null;
|
|
17401
17425
|
}
|
|
17402
|
-
function
|
|
17426
|
+
function fp(e) {
|
|
17403
17427
|
return `${e}x`;
|
|
17404
17428
|
}
|
|
17405
|
-
function
|
|
17429
|
+
function pp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
17406
17430
|
if (e.key !== "speed") throw Error("Expected the speed capability module");
|
|
17407
|
-
let i = Rt(oi), a = fd(), o = Kd(), s =
|
|
17431
|
+
let i = Rt(oi), a = fd(), o = Kd(), s = Hf(), c = _f(), l = Mc("speedUp"), [u] = (0, w.useState)(() => new Lo()), d = i?.playbackRate ?? a.initialState.playbackRate, f = Vd(o, "playbackRate", { rate: d }), p = i ? {
|
|
17408
17432
|
playbackRate: d,
|
|
17409
17433
|
playbackRates: a.capabilities.speed.options,
|
|
17410
17434
|
setPlaybackRate: (e) => s.setPlaybackRate(e)
|
|
@@ -17418,7 +17442,7 @@ function fp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
17418
17442
|
isDisabled: () => c || p === null,
|
|
17419
17443
|
onActivate: () => {
|
|
17420
17444
|
if (p === null) return;
|
|
17421
|
-
let e =
|
|
17445
|
+
let e = dp(p.playbackRates, p.playbackRate, "forward");
|
|
17422
17446
|
e !== null && s.setPlaybackRate(e);
|
|
17423
17447
|
}
|
|
17424
17448
|
});
|
|
@@ -17440,7 +17464,7 @@ function fp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
17440
17464
|
children: /* @__PURE__ */ (0, M.jsx)("span", {
|
|
17441
17465
|
"aria-hidden": "true",
|
|
17442
17466
|
className: "ltp-speed-control__value",
|
|
17443
|
-
children:
|
|
17467
|
+
children: fp(m.rate)
|
|
17444
17468
|
})
|
|
17445
17469
|
});
|
|
17446
17470
|
return /* @__PURE__ */ (0, M.jsxs)(Zu.Root, {
|
|
@@ -17454,7 +17478,7 @@ function fp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
17454
17478
|
}
|
|
17455
17479
|
//#endregion
|
|
17456
17480
|
//#region src/capabilities/share.tsx
|
|
17457
|
-
var
|
|
17481
|
+
var mp = Object.freeze([
|
|
17458
17482
|
"link",
|
|
17459
17483
|
"embed",
|
|
17460
17484
|
"facebook",
|
|
@@ -17462,13 +17486,13 @@ var pp = Object.freeze([
|
|
|
17462
17486
|
"linkedin",
|
|
17463
17487
|
"whatsapp",
|
|
17464
17488
|
"more"
|
|
17465
|
-
]),
|
|
17466
|
-
function
|
|
17489
|
+
]), hp = 574;
|
|
17490
|
+
function gp(e, t = typeof navigator < "u" && typeof navigator.share == "function") {
|
|
17467
17491
|
if (!e.canonicalUrl) return [];
|
|
17468
17492
|
let n = new Set(e.targets);
|
|
17469
|
-
return
|
|
17493
|
+
return mp.filter((r) => n.has(r) ? r === "embed" ? !!e.embedUrl : r !== "more" || t : !1);
|
|
17470
17494
|
}
|
|
17471
|
-
function
|
|
17495
|
+
function _p(e, t) {
|
|
17472
17496
|
let n = {
|
|
17473
17497
|
author: t.author ?? "",
|
|
17474
17498
|
title: t.title ?? "",
|
|
@@ -17476,29 +17500,29 @@ function gp(e, t) {
|
|
|
17476
17500
|
};
|
|
17477
17501
|
return e.replace(/\{([^{}]+)\}/g, (e, t) => Object.hasOwn(n, t) ? n[t] : e);
|
|
17478
17502
|
}
|
|
17479
|
-
function
|
|
17503
|
+
function vp(e) {
|
|
17480
17504
|
return e.replace(/[&"<>]/g, (e) => e === "&" ? "&" : e === "\"" ? """ : e === "<" ? "<" : ">");
|
|
17481
17505
|
}
|
|
17482
|
-
function
|
|
17483
|
-
let r =
|
|
17506
|
+
function yp(e, t, n) {
|
|
17507
|
+
let r = vp(e), i = vp(t);
|
|
17484
17508
|
return `<iframe src="${r}" style="aspect-ratio: ${n === "portrait" ? "9 / 16" : "16 / 9"}; display: block; width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0 0 0 30px; background: transparent; color-scheme: light; user-select: none;" title="${i}" loading="lazy" allowfullscreen frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture; web-share"></iframe>`;
|
|
17485
17509
|
}
|
|
17486
|
-
function
|
|
17510
|
+
function bp(e) {
|
|
17487
17511
|
if (e.key !== "share") throw Error("Expected the share capability module");
|
|
17488
17512
|
return e;
|
|
17489
17513
|
}
|
|
17490
|
-
function
|
|
17514
|
+
function xp(e) {
|
|
17491
17515
|
return (0, w.useSyncExternalStore)(e.subscribeInteraction, e.getInteractionSnapshot, e.getInteractionSnapshot);
|
|
17492
17516
|
}
|
|
17493
|
-
function
|
|
17517
|
+
function Sp(e) {
|
|
17494
17518
|
let t = e.ownerDocument;
|
|
17495
17519
|
return (t.fullscreenElement ?? t.webkitFullscreenElement) === e;
|
|
17496
17520
|
}
|
|
17497
|
-
function
|
|
17498
|
-
return e !== null && e.classList.contains("ltp-landscape") && !
|
|
17521
|
+
function Cp(e) {
|
|
17522
|
+
return e !== null && e.classList.contains("ltp-landscape") && !Sp(e) && e.clientWidth > 0 && e.clientWidth < hp;
|
|
17499
17523
|
}
|
|
17500
|
-
function
|
|
17501
|
-
let n =
|
|
17524
|
+
function wp({ children: e, module: t }) {
|
|
17525
|
+
let n = xp(t);
|
|
17502
17526
|
return /* @__PURE__ */ (0, M.jsx)(ru.Root, {
|
|
17503
17527
|
closeOnEscape: !1,
|
|
17504
17528
|
closeOnOutsideClick: !1,
|
|
@@ -17513,8 +17537,8 @@ function Cp({ children: e, module: t }) {
|
|
|
17513
17537
|
})
|
|
17514
17538
|
});
|
|
17515
17539
|
}
|
|
17516
|
-
function
|
|
17517
|
-
let i = bp(
|
|
17540
|
+
function Tp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
17541
|
+
let i = xp(bp(e)), { playerTrigger: a } = fd().capabilities.share, o = qd("share");
|
|
17518
17542
|
return !a || i.targets.length === 0 ? null : /* @__PURE__ */ (0, M.jsx)(Sl.Trigger, {
|
|
17519
17543
|
"aria-label": o,
|
|
17520
17544
|
className: "ltp-share-trigger",
|
|
@@ -17526,31 +17550,31 @@ function wp({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
17526
17550
|
children: /* @__PURE__ */ (0, M.jsx)(Y, { name: "share" })
|
|
17527
17551
|
});
|
|
17528
17552
|
}
|
|
17529
|
-
var
|
|
17553
|
+
var Ep = {
|
|
17530
17554
|
facebook: "facebook",
|
|
17531
17555
|
x: "x",
|
|
17532
17556
|
linkedin: "linkedin",
|
|
17533
17557
|
whatsapp: "whatsapp"
|
|
17534
|
-
},
|
|
17558
|
+
}, Dp = {
|
|
17535
17559
|
facebook: "shareFacebook",
|
|
17536
17560
|
x: "shareX",
|
|
17537
17561
|
linkedin: "shareLinkedIn",
|
|
17538
17562
|
whatsapp: "shareWhatsApp",
|
|
17539
17563
|
more: "shareMore"
|
|
17540
17564
|
};
|
|
17541
|
-
function
|
|
17565
|
+
function Op(e) {
|
|
17542
17566
|
let t = window.open(e, "_blank", "noopener,noreferrer");
|
|
17543
17567
|
t && (t.opener = null);
|
|
17544
17568
|
}
|
|
17545
|
-
function
|
|
17546
|
-
let { canonicalUrl: n = "", templates: r } = t.capabilities.share, i =
|
|
17569
|
+
function kp(e, t) {
|
|
17570
|
+
let { canonicalUrl: n = "", templates: r } = t.capabilities.share, i = _p(r.message, {
|
|
17547
17571
|
author: t.content.author,
|
|
17548
17572
|
title: t.content.title,
|
|
17549
17573
|
url: n
|
|
17550
17574
|
});
|
|
17551
17575
|
return e === "facebook" ? `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(n)}` : e === "x" ? `https://x.com/intent/post?text=${encodeURIComponent(i)}` : e === "linkedin" ? `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(n)}` : `https://wa.me/?text=${encodeURIComponent(i)}`;
|
|
17552
17576
|
}
|
|
17553
|
-
async function
|
|
17577
|
+
async function Ap(e) {
|
|
17554
17578
|
try {
|
|
17555
17579
|
if (navigator.clipboard?.writeText) return await navigator.clipboard.writeText(e), !0;
|
|
17556
17580
|
let t = document.createElement("textarea");
|
|
@@ -17561,9 +17585,9 @@ async function kp(e) {
|
|
|
17561
17585
|
return !1;
|
|
17562
17586
|
}
|
|
17563
17587
|
}
|
|
17564
|
-
function
|
|
17565
|
-
let r = fd(), i = Kd(), a = e.mode === "embed" && r.capabilities.share.embedUrl ?
|
|
17566
|
-
let t = r.capabilities.share.canonicalUrl ?? "", n =
|
|
17588
|
+
function jp({ interaction: e, module: t, titleId: n }) {
|
|
17589
|
+
let r = fd(), i = Kd(), a = e.mode === "embed" && r.capabilities.share.embedUrl ? yp(r.capabilities.share.embedUrl, r.content.title ?? i.playerLabel, r.layout) : r.capabilities.share.canonicalUrl ?? "", o = e.targets.filter((e) => e !== "link" && e !== "embed"), s = async (e) => {
|
|
17590
|
+
let t = r.capabilities.share.canonicalUrl ?? "", n = _p(r.capabilities.share.templates.message, {
|
|
17567
17591
|
author: r.content.author,
|
|
17568
17592
|
title: r.content.title,
|
|
17569
17593
|
url: t
|
|
@@ -17578,7 +17602,7 @@ function Ap({ interaction: e, module: t, titleId: n }) {
|
|
|
17578
17602
|
} catch {}
|
|
17579
17603
|
return;
|
|
17580
17604
|
}
|
|
17581
|
-
|
|
17605
|
+
Op(kp(e, r));
|
|
17582
17606
|
};
|
|
17583
17607
|
return /* @__PURE__ */ (0, M.jsxs)("div", {
|
|
17584
17608
|
className: "ltp-share-dialog__card",
|
|
@@ -17617,7 +17641,7 @@ function Ap({ interaction: e, module: t, titleId: n }) {
|
|
|
17617
17641
|
type: "button",
|
|
17618
17642
|
children: /* @__PURE__ */ (0, M.jsx)(Y, { name: "copy-code" })
|
|
17619
17643
|
}) : null] }), o.map((e) => /* @__PURE__ */ (0, M.jsx)("button", {
|
|
17620
|
-
"aria-label": i[
|
|
17644
|
+
"aria-label": i[Dp[e]],
|
|
17621
17645
|
className: "ltp-share-dialog__target",
|
|
17622
17646
|
onClick: () => void s(e),
|
|
17623
17647
|
type: "button",
|
|
@@ -17625,7 +17649,7 @@ function Ap({ interaction: e, module: t, titleId: n }) {
|
|
|
17625
17649
|
"aria-hidden": "true",
|
|
17626
17650
|
className: "ltp-share-dialog__more",
|
|
17627
17651
|
children: "…"
|
|
17628
|
-
}) : /* @__PURE__ */ (0, M.jsx)(Y, { name:
|
|
17652
|
+
}) : /* @__PURE__ */ (0, M.jsx)(Y, { name: Ep[e] })
|
|
17629
17653
|
}, e))]
|
|
17630
17654
|
}),
|
|
17631
17655
|
e.mode === null ? null : /* @__PURE__ */ (0, M.jsxs)("section", {
|
|
@@ -17646,7 +17670,7 @@ function Ap({ interaction: e, module: t, titleId: n }) {
|
|
|
17646
17670
|
/* @__PURE__ */ (0, M.jsx)("button", {
|
|
17647
17671
|
className: "ltp-share-dialog__copy",
|
|
17648
17672
|
onClick: async () => {
|
|
17649
|
-
await
|
|
17673
|
+
await Ap(a) && t.setCopied(!0);
|
|
17650
17674
|
},
|
|
17651
17675
|
type: "button",
|
|
17652
17676
|
children: e.copied ? i.copied : i.copy
|
|
@@ -17662,7 +17686,7 @@ function Ap({ interaction: e, module: t, titleId: n }) {
|
|
|
17662
17686
|
]
|
|
17663
17687
|
});
|
|
17664
17688
|
}
|
|
17665
|
-
function
|
|
17689
|
+
function Mp({ interaction: e, module: t }) {
|
|
17666
17690
|
let n = (0, w.useId)();
|
|
17667
17691
|
return /* @__PURE__ */ (0, M.jsxs)(M.Fragment, { children: [/* @__PURE__ */ (0, M.jsx)(Sl.Backdrop, {
|
|
17668
17692
|
className: "ltp-share-dialog__player-backdrop",
|
|
@@ -17674,14 +17698,14 @@ function jp({ interaction: e, module: t }) {
|
|
|
17674
17698
|
onClick: (e) => {
|
|
17675
17699
|
e.target === e.currentTarget && t.close();
|
|
17676
17700
|
},
|
|
17677
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
17701
|
+
children: /* @__PURE__ */ (0, M.jsx)(jp, {
|
|
17678
17702
|
interaction: e,
|
|
17679
17703
|
module: t,
|
|
17680
17704
|
titleId: n
|
|
17681
17705
|
})
|
|
17682
17706
|
})] });
|
|
17683
17707
|
}
|
|
17684
|
-
function
|
|
17708
|
+
function Np(e) {
|
|
17685
17709
|
if (e.key !== "Tab") return;
|
|
17686
17710
|
let t = [...e.currentTarget.querySelectorAll("button, input")].filter((e) => !e.hasAttribute("disabled") && e.tabIndex >= 0);
|
|
17687
17711
|
if (t.length === 0) {
|
|
@@ -17691,7 +17715,7 @@ function Mp(e) {
|
|
|
17691
17715
|
let n = t[0], r = t.at(-1);
|
|
17692
17716
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n?.focus());
|
|
17693
17717
|
}
|
|
17694
|
-
function
|
|
17718
|
+
function Pp({ interaction: e, module: t }) {
|
|
17695
17719
|
let n = (0, w.useRef)(null), r = (0, w.useRef)(null), i = (0, w.useId)();
|
|
17696
17720
|
return (0, w.useLayoutEffect)(() => {
|
|
17697
17721
|
let e = n.current;
|
|
@@ -17711,19 +17735,19 @@ function Np({ interaction: e, module: t }) {
|
|
|
17711
17735
|
onClick: (e) => {
|
|
17712
17736
|
e.target === e.currentTarget && t.close();
|
|
17713
17737
|
},
|
|
17714
|
-
onKeyDown:
|
|
17738
|
+
onKeyDown: Np,
|
|
17715
17739
|
ref: n,
|
|
17716
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
17740
|
+
children: /* @__PURE__ */ (0, M.jsx)(jp, {
|
|
17717
17741
|
interaction: e,
|
|
17718
17742
|
module: t,
|
|
17719
17743
|
titleId: i
|
|
17720
17744
|
})
|
|
17721
17745
|
});
|
|
17722
17746
|
}
|
|
17723
|
-
function
|
|
17724
|
-
let t =
|
|
17747
|
+
function Fp({ module: e }) {
|
|
17748
|
+
let t = bp(e), n = xp(t), r = Vt(), i = Rt(), a = (0, w.useRef)(!1);
|
|
17725
17749
|
return (0, w.useLayoutEffect)(() => {
|
|
17726
|
-
if (n.open && n.source === "player" &&
|
|
17750
|
+
if (n.open && n.source === "player" && Cp(r)) {
|
|
17727
17751
|
let e = ai(i.state);
|
|
17728
17752
|
!a.current && e && !e.paused && (a.current = !0, e.pause());
|
|
17729
17753
|
return;
|
|
@@ -17734,17 +17758,17 @@ function Pp({ module: e }) {
|
|
|
17734
17758
|
n.open,
|
|
17735
17759
|
n.source,
|
|
17736
17760
|
i
|
|
17737
|
-
]), !n.open || n.source === null || r === null ? null : (0, Dl.createPortal)(n.source === "player" ? /* @__PURE__ */ (0, M.jsx)(
|
|
17761
|
+
]), !n.open || n.source === null || r === null ? null : (0, Dl.createPortal)(n.source === "player" ? /* @__PURE__ */ (0, M.jsx)(Mp, {
|
|
17738
17762
|
interaction: n,
|
|
17739
17763
|
module: t
|
|
17740
|
-
}) : /* @__PURE__ */ (0, M.jsx)(
|
|
17764
|
+
}) : /* @__PURE__ */ (0, M.jsx)(Pp, {
|
|
17741
17765
|
interaction: n,
|
|
17742
17766
|
module: t
|
|
17743
17767
|
}), r);
|
|
17744
17768
|
}
|
|
17745
17769
|
//#endregion
|
|
17746
17770
|
//#region src/presentation-navigation.ts
|
|
17747
|
-
var
|
|
17771
|
+
var Ip = "[data-ltp-presentation-stage]", Lp = "ltp-presentation-navigation", Rp = [
|
|
17748
17772
|
"input",
|
|
17749
17773
|
"select",
|
|
17750
17774
|
"textarea",
|
|
@@ -17761,38 +17785,38 @@ var Fp = "[data-ltp-presentation-stage]", Ip = "ltp-presentation-navigation", Lp
|
|
|
17761
17785
|
"[role=\"tablist\"][aria-orientation=\"vertical\"]",
|
|
17762
17786
|
"[role=\"dialog\"][aria-modal=\"true\"]"
|
|
17763
17787
|
].join(",");
|
|
17764
|
-
function
|
|
17788
|
+
function zp(e) {
|
|
17765
17789
|
if (!(e instanceof HTMLElement) || e.matches("[role=\"tablist\"]:not([aria-orientation=\"vertical\"]), [role=\"tablist\"][aria-orientation=\"horizontal\"]")) return !1;
|
|
17766
17790
|
let t = getComputedStyle(e).overflowY;
|
|
17767
17791
|
return (t === "auto" || t === "scroll" || t === "overlay") && e.scrollHeight > e.clientHeight;
|
|
17768
17792
|
}
|
|
17769
|
-
function
|
|
17793
|
+
function Bp(e, t) {
|
|
17770
17794
|
if (!(e instanceof Element)) return !1;
|
|
17771
17795
|
for (let n = e; n && n !== t;) {
|
|
17772
|
-
if (n.matches(
|
|
17796
|
+
if (n.matches(Rp) || zp(n)) return !0;
|
|
17773
17797
|
n = n.parentElement;
|
|
17774
17798
|
}
|
|
17775
17799
|
return !1;
|
|
17776
17800
|
}
|
|
17777
|
-
function
|
|
17778
|
-
return !e.dispatchEvent(new CustomEvent(
|
|
17801
|
+
function Vp(e, t) {
|
|
17802
|
+
return !e.dispatchEvent(new CustomEvent(Lp, {
|
|
17779
17803
|
cancelable: !0,
|
|
17780
17804
|
detail: { direction: t }
|
|
17781
17805
|
}));
|
|
17782
17806
|
}
|
|
17783
|
-
function
|
|
17807
|
+
function Hp(e) {
|
|
17784
17808
|
if (!(e instanceof CustomEvent)) return null;
|
|
17785
17809
|
let t = e.detail;
|
|
17786
17810
|
return t?.direction === "previous" || t?.direction === "next" ? t.direction : null;
|
|
17787
17811
|
}
|
|
17788
17812
|
//#endregion
|
|
17789
17813
|
//#region src/capabilities/context-panel.tsx
|
|
17790
|
-
var
|
|
17791
|
-
function
|
|
17792
|
-
let r = Math.min(
|
|
17814
|
+
var Up = 420, Wp = 650, Gp = 32, Kp = 192, qp = 32;
|
|
17815
|
+
function Jp(e, t, n = []) {
|
|
17816
|
+
let r = Math.min(Kp, t.width * .12), i = t.width - e.width - qp;
|
|
17793
17817
|
if (i < 452) return null;
|
|
17794
|
-
let a = Math.max(
|
|
17795
|
-
if (s <
|
|
17818
|
+
let a = Math.max(Gp, Math.min(r, i - Up)), o = (n) => Math.min(Wp, i - n, t.right - qp - (e.right + n)), s = o(a);
|
|
17819
|
+
if (s < Up && (a = Gp, s = o(a)), s < Up) return null;
|
|
17796
17820
|
let c = {
|
|
17797
17821
|
gap: a,
|
|
17798
17822
|
left: e.right + a,
|
|
@@ -17803,32 +17827,32 @@ function qp(e, t, n = []) {
|
|
|
17803
17827
|
...c,
|
|
17804
17828
|
right: c.left + c.width,
|
|
17805
17829
|
bottom: c.top + c.height
|
|
17806
|
-
}, u = l.left >= t.left && l.right <= t.right -
|
|
17830
|
+
}, u = l.left >= t.left && l.right <= t.right - qp && l.top >= t.top && l.bottom <= t.bottom, d = n.some((e) => e.width > 0 && e.height > 0 && l.left < e.right && l.right > e.left && l.top < e.bottom && l.bottom > e.top);
|
|
17807
17831
|
return u && !d ? c : null;
|
|
17808
17832
|
}
|
|
17809
|
-
function
|
|
17833
|
+
function Yp(e) {
|
|
17810
17834
|
if (e.key !== "contextPanel") throw Error("Expected the context panel capability module");
|
|
17811
17835
|
return e;
|
|
17812
17836
|
}
|
|
17813
|
-
function
|
|
17837
|
+
function Xp(e) {
|
|
17814
17838
|
return (0, w.useSyncExternalStore)(e.subscribeInteraction, e.getInteractionSnapshot, e.getInteractionSnapshot);
|
|
17815
17839
|
}
|
|
17816
|
-
var
|
|
17817
|
-
function
|
|
17818
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
17840
|
+
var Zp = (0, w.createContext)(null);
|
|
17841
|
+
function Qp({ children: e, seek: t }) {
|
|
17842
|
+
return /* @__PURE__ */ (0, M.jsx)(Zp, {
|
|
17819
17843
|
value: { seek: t },
|
|
17820
17844
|
children: e
|
|
17821
17845
|
});
|
|
17822
17846
|
}
|
|
17823
|
-
function
|
|
17824
|
-
let e = (0, w.useContext)(
|
|
17847
|
+
function $p() {
|
|
17848
|
+
let e = (0, w.useContext)(Zp);
|
|
17825
17849
|
if (e === null) throw Error("Context panel surfaces require a runtime provider");
|
|
17826
17850
|
return e;
|
|
17827
17851
|
}
|
|
17828
|
-
var
|
|
17829
|
-
function
|
|
17830
|
-
let n =
|
|
17831
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
17852
|
+
var em = (0, w.createContext)(null);
|
|
17853
|
+
function tm({ children: e, module: t }) {
|
|
17854
|
+
let n = Xp(t), r = (0, w.useId)();
|
|
17855
|
+
return /* @__PURE__ */ (0, M.jsx)(em, {
|
|
17832
17856
|
value: r,
|
|
17833
17857
|
children: /* @__PURE__ */ (0, M.jsx)(ru.Root, {
|
|
17834
17858
|
closeOnEscape: !1,
|
|
@@ -17845,28 +17869,28 @@ function em({ children: e, module: t }) {
|
|
|
17845
17869
|
})
|
|
17846
17870
|
});
|
|
17847
17871
|
}
|
|
17848
|
-
var
|
|
17872
|
+
var nm = {
|
|
17849
17873
|
knowledge: "key-concepts",
|
|
17850
17874
|
underlyingPublication: "underlying-publication",
|
|
17851
17875
|
relatedVideos: "related-videos"
|
|
17852
|
-
},
|
|
17876
|
+
}, rm = {
|
|
17853
17877
|
knowledge: "openKnowledge",
|
|
17854
17878
|
underlyingPublication: "openUnderlyingPublication",
|
|
17855
17879
|
relatedVideos: "openRelatedVideos"
|
|
17856
17880
|
};
|
|
17857
|
-
function
|
|
17858
|
-
let i =
|
|
17881
|
+
function im({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
17882
|
+
let i = Yp(e), a = Xp(i), o = Kd(), s = _f(), c = (0, w.useContext)(em), l = (0, w.useId)(), u = c ?? l, d = (e, t = {}) => /* @__PURE__ */ (0, M.jsx)("button", {
|
|
17859
17883
|
...t,
|
|
17860
17884
|
"aria-controls": u,
|
|
17861
17885
|
"aria-disabled": s || void 0,
|
|
17862
|
-
"aria-label": o[
|
|
17886
|
+
"aria-label": o[rm[e]],
|
|
17863
17887
|
"aria-pressed": a.view === e,
|
|
17864
17888
|
className: "ltp-context-panel-trigger",
|
|
17865
17889
|
onClick: (t) => {
|
|
17866
17890
|
t.preventDefault(), s || i.toggle(e);
|
|
17867
17891
|
},
|
|
17868
17892
|
type: "button",
|
|
17869
|
-
children: /* @__PURE__ */ (0, M.jsx)(Y, { name:
|
|
17893
|
+
children: /* @__PURE__ */ (0, M.jsx)(Y, { name: nm[e] })
|
|
17870
17894
|
});
|
|
17871
17895
|
return /* @__PURE__ */ (0, M.jsx)("div", {
|
|
17872
17896
|
className: "ltp-context-panel-triggers",
|
|
@@ -17880,7 +17904,7 @@ function rm({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
17880
17904
|
}, e))
|
|
17881
17905
|
});
|
|
17882
17906
|
}
|
|
17883
|
-
function
|
|
17907
|
+
function am(e) {
|
|
17884
17908
|
return {
|
|
17885
17909
|
bottom: e.bottom,
|
|
17886
17910
|
height: e.height,
|
|
@@ -17890,7 +17914,7 @@ function im(e) {
|
|
|
17890
17914
|
width: e.width
|
|
17891
17915
|
};
|
|
17892
17916
|
}
|
|
17893
|
-
function
|
|
17917
|
+
function om() {
|
|
17894
17918
|
let e = window.visualViewport, t = e?.offsetLeft ?? 0, n = e?.offsetTop ?? 0, r = e?.width ?? window.innerWidth, i = e?.height ?? window.innerHeight;
|
|
17895
17919
|
return {
|
|
17896
17920
|
left: t,
|
|
@@ -17901,7 +17925,7 @@ function am() {
|
|
|
17901
17925
|
bottom: n + i
|
|
17902
17926
|
};
|
|
17903
17927
|
}
|
|
17904
|
-
function
|
|
17928
|
+
function sm(e) {
|
|
17905
17929
|
let t = e.getBoundingClientRect(), n = getComputedStyle(e), r = t.left + Number.parseFloat(n.borderLeftWidth || "0") + Number.parseFloat(n.paddingLeft || "0"), i = t.right - Number.parseFloat(n.borderRightWidth || "0") - Number.parseFloat(n.paddingRight || "0"), a = t.top + Number.parseFloat(n.borderTopWidth || "0") + Number.parseFloat(n.paddingTop || "0"), o = t.bottom - Number.parseFloat(n.borderBottomWidth || "0") - Number.parseFloat(n.paddingBottom || "0");
|
|
17906
17930
|
return {
|
|
17907
17931
|
left: r,
|
|
@@ -17912,23 +17936,23 @@ function om(e) {
|
|
|
17912
17936
|
height: o - a
|
|
17913
17937
|
};
|
|
17914
17938
|
}
|
|
17915
|
-
function
|
|
17939
|
+
function cm(e) {
|
|
17916
17940
|
return e.closest("[data-ltp-presentation-stage]") ?? e;
|
|
17917
17941
|
}
|
|
17918
|
-
function
|
|
17919
|
-
return e.matches("[data-ltp-presentation-stage]") ?
|
|
17942
|
+
function lm(e) {
|
|
17943
|
+
return e.matches("[data-ltp-presentation-stage]") ? am(e.getBoundingClientRect()) : sm(e);
|
|
17920
17944
|
}
|
|
17921
|
-
function
|
|
17922
|
-
let n =
|
|
17945
|
+
function um(e, t) {
|
|
17946
|
+
let n = am(e.getBoundingClientRect());
|
|
17923
17947
|
if (!t.matches("[data-ltp-presentation-stage]")) return n;
|
|
17924
|
-
let r =
|
|
17948
|
+
let r = am(t.getBoundingClientRect());
|
|
17925
17949
|
return {
|
|
17926
17950
|
...n,
|
|
17927
17951
|
top: r.top,
|
|
17928
17952
|
bottom: r.top + n.height
|
|
17929
17953
|
};
|
|
17930
17954
|
}
|
|
17931
|
-
function
|
|
17955
|
+
function dm(e, t) {
|
|
17932
17956
|
let n = t.left + t.width, r = t.top + t.height;
|
|
17933
17957
|
for (let i = e.parentElement; i && i !== document.body; i = i.parentElement) {
|
|
17934
17958
|
let e = getComputedStyle(i);
|
|
@@ -17942,7 +17966,7 @@ function um(e, t) {
|
|
|
17942
17966
|
}
|
|
17943
17967
|
return !1;
|
|
17944
17968
|
}
|
|
17945
|
-
function
|
|
17969
|
+
function fm(e, t) {
|
|
17946
17970
|
let [n, r] = (0, w.useState)({
|
|
17947
17971
|
open: !1,
|
|
17948
17972
|
placement: null
|
|
@@ -17973,9 +17997,9 @@ function dm(e, t) {
|
|
|
17973
17997
|
});
|
|
17974
17998
|
return;
|
|
17975
17999
|
}
|
|
17976
|
-
let s =
|
|
18000
|
+
let s = cm(t);
|
|
17977
18001
|
s !== o && (o !== null && l?.unobserve(o), o = s, l?.observe(s), a = "", e = !0);
|
|
17978
|
-
let c =
|
|
18002
|
+
let c = um(n, s), u = lm(s), d = [...t.children].filter((e) => e !== i).map((e) => am(e.getBoundingClientRect())), f = [
|
|
17979
18003
|
c,
|
|
17980
18004
|
u,
|
|
17981
18005
|
...d
|
|
@@ -17989,7 +18013,7 @@ function dm(e, t) {
|
|
|
17989
18013
|
]).join(":");
|
|
17990
18014
|
if (!e && f === a) return;
|
|
17991
18015
|
a = f;
|
|
17992
|
-
let p =
|
|
18016
|
+
let p = Jp(c, u, d), m = p && !dm(s, p) ? p : null;
|
|
17993
18017
|
r((e) => e.open && (e.placement === null && m === null || e.placement !== null && m !== null && e.placement.gap === m.gap && e.placement.height === m.height && e.placement.left === m.left && e.placement.top === m.top && e.placement.width === m.width) ? e : {
|
|
17994
18018
|
open: !0,
|
|
17995
18019
|
placement: m
|
|
@@ -18003,7 +18027,7 @@ function dm(e, t) {
|
|
|
18003
18027
|
};
|
|
18004
18028
|
}, [t, e]), e && n.open ? n.placement : void 0;
|
|
18005
18029
|
}
|
|
18006
|
-
function
|
|
18030
|
+
function pm({ active: e, label: t, onSelect: n, tabs: r, text: i }) {
|
|
18007
18031
|
let a = (0, w.useRef)(/* @__PURE__ */ new Map()), o = (e, t) => {
|
|
18008
18032
|
let i = r.indexOf(t), o = e.key === "ArrowRight" ? (i + 1) % r.length : e.key === "ArrowLeft" ? (i - 1 + r.length) % r.length : e.key === "Home" ? 0 : e.key === "End" ? r.length - 1 : null;
|
|
18009
18033
|
if (o === null) return;
|
|
@@ -18030,7 +18054,7 @@ function fm({ active: e, label: t, onSelect: n, tabs: r, text: i }) {
|
|
|
18030
18054
|
}, t))
|
|
18031
18055
|
});
|
|
18032
18056
|
}
|
|
18033
|
-
function
|
|
18057
|
+
function mm() {
|
|
18034
18058
|
let e = qd("generatedByAiLabel"), t = qd("generatedByAiDisclaimer");
|
|
18035
18059
|
return /* @__PURE__ */ (0, M.jsxs)("footer", {
|
|
18036
18060
|
className: "ltp-context-panel__ai-footer",
|
|
@@ -18048,8 +18072,8 @@ function pm() {
|
|
|
18048
18072
|
] })]
|
|
18049
18073
|
});
|
|
18050
18074
|
}
|
|
18051
|
-
function
|
|
18052
|
-
let r = Kd(), i =
|
|
18075
|
+
function hm({ interaction: e, metadata: t, module: n }) {
|
|
18076
|
+
let r = Kd(), i = $p(), a = e.knowledgeTab;
|
|
18053
18077
|
if (a === null) return null;
|
|
18054
18078
|
let o, s;
|
|
18055
18079
|
if (a === "inANutshell") {
|
|
@@ -18074,7 +18098,7 @@ function mm({ interaction: e, metadata: t, module: n }) {
|
|
|
18074
18098
|
type: "button",
|
|
18075
18099
|
children: e.label
|
|
18076
18100
|
}, e.label))
|
|
18077
|
-
}), c ? /* @__PURE__ */ (0, M.jsx)(
|
|
18101
|
+
}), c ? /* @__PURE__ */ (0, M.jsx)(gm, { concept: c }) : null]
|
|
18078
18102
|
});
|
|
18079
18103
|
} else if (a === "researchField") {
|
|
18080
18104
|
let e = t.researchField;
|
|
@@ -18098,10 +18122,10 @@ function mm({ interaction: e, metadata: t, module: n }) {
|
|
|
18098
18122
|
return /* @__PURE__ */ (0, M.jsxs)(M.Fragment, { children: [/* @__PURE__ */ (0, M.jsx)("div", {
|
|
18099
18123
|
className: "ltp-context-panel__scroll",
|
|
18100
18124
|
children: o
|
|
18101
|
-
}), s ? /* @__PURE__ */ (0, M.jsx)(
|
|
18125
|
+
}), s ? /* @__PURE__ */ (0, M.jsx)(mm, {}) : null] });
|
|
18102
18126
|
}
|
|
18103
|
-
function
|
|
18104
|
-
let t = pf(e.start ?? 0), n = qd("playAt", { time: t }), r = n.indexOf(t), i =
|
|
18127
|
+
function gm({ concept: e }) {
|
|
18128
|
+
let t = pf(e.start ?? 0), n = qd("playAt", { time: t }), r = n.indexOf(t), i = $p();
|
|
18105
18129
|
return /* @__PURE__ */ (0, M.jsxs)("div", {
|
|
18106
18130
|
className: "ltp-context-panel__concept-description",
|
|
18107
18131
|
children: [/* @__PURE__ */ (0, M.jsx)("p", { children: e.description }), e.start === void 0 ? null : /* @__PURE__ */ (0, M.jsxs)("button", {
|
|
@@ -18115,7 +18139,7 @@ function hm({ concept: e }) {
|
|
|
18115
18139
|
})]
|
|
18116
18140
|
});
|
|
18117
18141
|
}
|
|
18118
|
-
function
|
|
18142
|
+
function _m({ items: e }) {
|
|
18119
18143
|
let t = Kd();
|
|
18120
18144
|
return /* @__PURE__ */ (0, M.jsx)("section", {
|
|
18121
18145
|
className: "ltp-context-panel__scroll ltp-context-panel__publications",
|
|
@@ -18147,7 +18171,7 @@ function gm({ items: e }) {
|
|
|
18147
18171
|
] }, `${e.url}:${n}`))
|
|
18148
18172
|
});
|
|
18149
18173
|
}
|
|
18150
|
-
function
|
|
18174
|
+
function vm({ video: e }) {
|
|
18151
18175
|
return /* @__PURE__ */ (0, M.jsxs)("a", {
|
|
18152
18176
|
className: "ltp-context-panel__video-card",
|
|
18153
18177
|
draggable: !1,
|
|
@@ -18168,38 +18192,38 @@ function _m({ video: e }) {
|
|
|
18168
18192
|
})]
|
|
18169
18193
|
});
|
|
18170
18194
|
}
|
|
18171
|
-
function
|
|
18195
|
+
function ym({ interaction: e, metadata: t }) {
|
|
18172
18196
|
let n = e.relatedTab === "relatedVideos" ? t.related ?? [] : t.forYou ?? [];
|
|
18173
18197
|
return /* @__PURE__ */ (0, M.jsxs)(M.Fragment, { children: [/* @__PURE__ */ (0, M.jsx)("div", {
|
|
18174
18198
|
className: "ltp-context-panel__scroll",
|
|
18175
18199
|
children: /* @__PURE__ */ (0, M.jsx)("div", {
|
|
18176
18200
|
className: "ltp-context-panel__video-grid",
|
|
18177
|
-
children: n.map((e, t) => /* @__PURE__ */ (0, M.jsx)(
|
|
18201
|
+
children: n.map((e, t) => /* @__PURE__ */ (0, M.jsx)(vm, { video: e }, `${e.url}:${t}`))
|
|
18178
18202
|
})
|
|
18179
|
-
}), t.generatedByAi ? /* @__PURE__ */ (0, M.jsx)(
|
|
18203
|
+
}), t.generatedByAi ? /* @__PURE__ */ (0, M.jsx)(mm, {}) : null] });
|
|
18180
18204
|
}
|
|
18181
|
-
function
|
|
18182
|
-
let t =
|
|
18205
|
+
function bm({ module: e }) {
|
|
18206
|
+
let t = Xp(e), n = fd(), r = Kd(), i = t.view;
|
|
18183
18207
|
if (i === null) return null;
|
|
18184
|
-
if (i === "knowledge") return /* @__PURE__ */ (0, M.jsx)(
|
|
18208
|
+
if (i === "knowledge") return /* @__PURE__ */ (0, M.jsx)(hm, {
|
|
18185
18209
|
interaction: t,
|
|
18186
18210
|
metadata: n.content.metadata,
|
|
18187
18211
|
module: e
|
|
18188
18212
|
});
|
|
18189
18213
|
if (i === "underlyingPublication") {
|
|
18190
18214
|
let e = n.content.metadata.underlyingPublication;
|
|
18191
|
-
return /* @__PURE__ */ (0, M.jsxs)(M.Fragment, { children: [/* @__PURE__ */ (0, M.jsx)(
|
|
18215
|
+
return /* @__PURE__ */ (0, M.jsxs)(M.Fragment, { children: [/* @__PURE__ */ (0, M.jsx)(_m, { items: e?.items ?? [] }), e?.generatedByAi ? /* @__PURE__ */ (0, M.jsx)(mm, {}) : null] });
|
|
18192
18216
|
}
|
|
18193
18217
|
let a = n.content.metadata.relatedVideos;
|
|
18194
|
-
return a ? /* @__PURE__ */ (0, M.jsx)(
|
|
18218
|
+
return a ? /* @__PURE__ */ (0, M.jsx)(ym, {
|
|
18195
18219
|
interaction: t,
|
|
18196
18220
|
metadata: a
|
|
18197
18221
|
}) : /* @__PURE__ */ (0, M.jsx)("div", { "aria-label": r.relatedVideos });
|
|
18198
18222
|
}
|
|
18199
|
-
function
|
|
18223
|
+
function xm(e, t) {
|
|
18200
18224
|
return e === "knowledge" ? t.knowledge : e === "underlyingPublication" ? t.underlyingPublication : t.relatedVideos;
|
|
18201
18225
|
}
|
|
18202
|
-
function
|
|
18226
|
+
function Sm({ interaction: e, module: t }) {
|
|
18203
18227
|
let n = Kd();
|
|
18204
18228
|
if (e.view === "knowledge" && e.knowledgeTab !== null) {
|
|
18205
18229
|
let r = {
|
|
@@ -18208,7 +18232,7 @@ function xm({ interaction: e, module: t }) {
|
|
|
18208
18232
|
researchField: n.researchField,
|
|
18209
18233
|
transcript: n.transcript
|
|
18210
18234
|
};
|
|
18211
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
18235
|
+
return /* @__PURE__ */ (0, M.jsx)(pm, {
|
|
18212
18236
|
active: e.knowledgeTab,
|
|
18213
18237
|
label: n.knowledge,
|
|
18214
18238
|
onSelect: (e) => t.setKnowledgeTab(e),
|
|
@@ -18221,7 +18245,7 @@ function xm({ interaction: e, module: t }) {
|
|
|
18221
18245
|
relatedVideos: n.relatedVideos,
|
|
18222
18246
|
forYou: n.forYou
|
|
18223
18247
|
};
|
|
18224
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
18248
|
+
return /* @__PURE__ */ (0, M.jsx)(pm, {
|
|
18225
18249
|
active: e.relatedTab,
|
|
18226
18250
|
label: n.relatedVideos,
|
|
18227
18251
|
onSelect: (e) => t.setRelatedTab(e),
|
|
@@ -18234,8 +18258,8 @@ function xm({ interaction: e, module: t }) {
|
|
|
18234
18258
|
children: n.underlyingPublication
|
|
18235
18259
|
});
|
|
18236
18260
|
}
|
|
18237
|
-
function
|
|
18238
|
-
let r =
|
|
18261
|
+
function Cm({ module: e, presentation: t, titleId: n }) {
|
|
18262
|
+
let r = Xp(e), i = Kd();
|
|
18239
18263
|
return r.view === null ? null : /* @__PURE__ */ (0, M.jsxs)("div", {
|
|
18240
18264
|
className: "ltp-context-panel__frame",
|
|
18241
18265
|
"data-ltp-context-presentation": t,
|
|
@@ -18247,8 +18271,8 @@ function Sm({ module: e, presentation: t, titleId: n }) {
|
|
|
18247
18271
|
children: [/* @__PURE__ */ (0, M.jsx)("span", {
|
|
18248
18272
|
"aria-hidden": "true",
|
|
18249
18273
|
className: "ltp-context-panel__header-icon",
|
|
18250
|
-
children: /* @__PURE__ */ (0, M.jsx)(Y, { name:
|
|
18251
|
-
}), /* @__PURE__ */ (0, M.jsx)(
|
|
18274
|
+
children: /* @__PURE__ */ (0, M.jsx)(Y, { name: nm[r.view] })
|
|
18275
|
+
}), /* @__PURE__ */ (0, M.jsx)(Sm, {
|
|
18252
18276
|
interaction: r,
|
|
18253
18277
|
module: e
|
|
18254
18278
|
})]
|
|
@@ -18257,7 +18281,7 @@ function Sm({ module: e, presentation: t, titleId: n }) {
|
|
|
18257
18281
|
className: "ltp-context-panel__title",
|
|
18258
18282
|
id: n,
|
|
18259
18283
|
tabIndex: t === "dialog" ? -1 : void 0,
|
|
18260
|
-
children:
|
|
18284
|
+
children: xm(r.view, i)
|
|
18261
18285
|
}),
|
|
18262
18286
|
/* @__PURE__ */ (0, M.jsx)("button", {
|
|
18263
18287
|
"aria-label": i.closeContextPanel,
|
|
@@ -18267,17 +18291,17 @@ function Sm({ module: e, presentation: t, titleId: n }) {
|
|
|
18267
18291
|
children: /* @__PURE__ */ (0, M.jsx)(Y, { name: "close" })
|
|
18268
18292
|
})
|
|
18269
18293
|
]
|
|
18270
|
-
}), /* @__PURE__ */ (0, M.jsx)(
|
|
18294
|
+
}), /* @__PURE__ */ (0, M.jsx)(bm, { module: e })]
|
|
18271
18295
|
});
|
|
18272
18296
|
}
|
|
18273
|
-
function
|
|
18274
|
-
let n =
|
|
18297
|
+
function wm({ module: e, titleId: t }) {
|
|
18298
|
+
let n = Xp(e), r = (0, w.useRef)(null), i = (0, w.useContext)(em), a = (0, w.useId)(), o = i ?? a, s = (0, w.useRef)(null);
|
|
18275
18299
|
return (0, w.useLayoutEffect)(() => {
|
|
18276
18300
|
let e = r.current;
|
|
18277
18301
|
if (!e || n.view === null) return;
|
|
18278
18302
|
s.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
18279
18303
|
let t = () => {
|
|
18280
|
-
let t =
|
|
18304
|
+
let t = om();
|
|
18281
18305
|
e.style.setProperty("--ltp-context-viewport-left", `${t.left}px`), e.style.setProperty("--ltp-context-viewport-top", `${t.top}px`), e.style.setProperty("--ltp-context-viewport-width", `${t.width}px`), e.style.setProperty("--ltp-context-viewport-height", `${t.height}px`);
|
|
18282
18306
|
};
|
|
18283
18307
|
return typeof e.showModal == "function" ? e.showModal() : e.setAttribute("open", ""), t(), e.querySelector(".ltp-context-panel__title")?.focus(), window.visualViewport?.addEventListener("resize", t), window.visualViewport?.addEventListener("scroll", t), window.addEventListener("resize", t), () => {
|
|
@@ -18300,15 +18324,15 @@ function Cm({ module: e, titleId: t }) {
|
|
|
18300
18324
|
!n || !r || (e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus()));
|
|
18301
18325
|
},
|
|
18302
18326
|
ref: r,
|
|
18303
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
18327
|
+
children: /* @__PURE__ */ (0, M.jsx)(Cm, {
|
|
18304
18328
|
module: e,
|
|
18305
18329
|
presentation: "dialog",
|
|
18306
18330
|
titleId: t
|
|
18307
18331
|
})
|
|
18308
18332
|
})] });
|
|
18309
18333
|
}
|
|
18310
|
-
function
|
|
18311
|
-
let i =
|
|
18334
|
+
function Tm({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
18335
|
+
let i = Yp(e), a = Xp(i), o = Kd(), s = _f(), c = (0, w.useRef)(null), l = (0, w.useId)(), u = fm(a.view !== null, c);
|
|
18312
18336
|
(0, w.useEffect)(() => {
|
|
18313
18337
|
s && i.close();
|
|
18314
18338
|
}, [s, i]), (0, w.useEffect)(() => () => {
|
|
@@ -18339,25 +18363,25 @@ function wm({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
18339
18363
|
"data-ltp-surface": r,
|
|
18340
18364
|
children: a.view === null || u === void 0 ? null : u ? (0, Dl.createPortal)(/* @__PURE__ */ (0, M.jsx)("aside", {
|
|
18341
18365
|
className: "ltp-player ltp-context-panel ltp-context-panel--side-card",
|
|
18342
|
-
"aria-label":
|
|
18366
|
+
"aria-label": xm(a.view, o),
|
|
18343
18367
|
onKeyDownCapture: (e) => {
|
|
18344
18368
|
if (e.key === "Escape") {
|
|
18345
18369
|
e.preventDefault(), i.close();
|
|
18346
18370
|
return;
|
|
18347
18371
|
}
|
|
18348
|
-
if ((e.key === "ArrowUp" || e.key === "ArrowDown") && !
|
|
18349
|
-
let t = c.current?.closest(
|
|
18350
|
-
t &&
|
|
18372
|
+
if ((e.key === "ArrowUp" || e.key === "ArrowDown") && !Bp(e.target, e.currentTarget)) {
|
|
18373
|
+
let t = c.current?.closest(Ip);
|
|
18374
|
+
t && Vp(t, e.key === "ArrowUp" ? "previous" : "next") && (e.preventDefault(), e.stopPropagation());
|
|
18351
18375
|
}
|
|
18352
18376
|
},
|
|
18353
18377
|
role: "region",
|
|
18354
18378
|
style: d,
|
|
18355
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
18379
|
+
children: /* @__PURE__ */ (0, M.jsx)(Cm, {
|
|
18356
18380
|
module: i,
|
|
18357
18381
|
presentation: "side-card",
|
|
18358
18382
|
titleId: l
|
|
18359
18383
|
})
|
|
18360
|
-
}), document.body) : /* @__PURE__ */ (0, M.jsx)(
|
|
18384
|
+
}), document.body) : /* @__PURE__ */ (0, M.jsx)(wm, {
|
|
18361
18385
|
module: i,
|
|
18362
18386
|
titleId: l
|
|
18363
18387
|
})
|
|
@@ -18365,13 +18389,13 @@ function wm({ module: e, slot: t, state: n, surfaceId: r }) {
|
|
|
18365
18389
|
}
|
|
18366
18390
|
//#endregion
|
|
18367
18391
|
//#region src/capabilities/types.ts
|
|
18368
|
-
var
|
|
18392
|
+
var Em = [
|
|
18369
18393
|
"chapters",
|
|
18370
18394
|
"captions",
|
|
18371
18395
|
"speed",
|
|
18372
18396
|
"share",
|
|
18373
18397
|
"contextPanel"
|
|
18374
|
-
],
|
|
18398
|
+
], Dm = [
|
|
18375
18399
|
"timeline",
|
|
18376
18400
|
"controlBarLeft",
|
|
18377
18401
|
"controlBarCenter",
|
|
@@ -18382,7 +18406,7 @@ var Tm = [
|
|
|
18382
18406
|
"overlay",
|
|
18383
18407
|
"menu",
|
|
18384
18408
|
"contextPanel"
|
|
18385
|
-
],
|
|
18409
|
+
], Om = Object.freeze({
|
|
18386
18410
|
landscape: Object.freeze([
|
|
18387
18411
|
"timeline",
|
|
18388
18412
|
"controlBarLeft",
|
|
@@ -18406,14 +18430,14 @@ var Tm = [
|
|
|
18406
18430
|
"contextPanel"
|
|
18407
18431
|
])
|
|
18408
18432
|
});
|
|
18409
|
-
function
|
|
18433
|
+
function km(e) {
|
|
18410
18434
|
for (let t of e.surfaces) Object.freeze(t.slots), Object.freeze(t);
|
|
18411
18435
|
return Object.freeze(e.surfaces), Object.freeze(e);
|
|
18412
18436
|
}
|
|
18413
18437
|
//#endregion
|
|
18414
18438
|
//#region src/capabilities/modules.tsx
|
|
18415
|
-
var
|
|
18416
|
-
function
|
|
18439
|
+
var Am = Pd("chapters"), jm = Pd("captions"), Mm = Pd("speed"), Nm = Pd("share"), Pm = Pd("contextPanel");
|
|
18440
|
+
function Fm(e, t, n) {
|
|
18417
18441
|
let r = e.surfaces.find((e) => e.id === t);
|
|
18418
18442
|
if (r === void 0) throw Error(`Missing capability surface metadata: ${e.key}.${t}`);
|
|
18419
18443
|
return {
|
|
@@ -18421,7 +18445,7 @@ function Pm(e, t, n) {
|
|
|
18421
18445
|
component: n
|
|
18422
18446
|
};
|
|
18423
18447
|
}
|
|
18424
|
-
function
|
|
18448
|
+
function Im(e) {
|
|
18425
18449
|
let t = !1;
|
|
18426
18450
|
return Object.freeze({
|
|
18427
18451
|
key: e,
|
|
@@ -18433,7 +18457,7 @@ function Fm(e) {
|
|
|
18433
18457
|
}
|
|
18434
18458
|
});
|
|
18435
18459
|
}
|
|
18436
|
-
function
|
|
18460
|
+
function Lm() {
|
|
18437
18461
|
let e = !1, t = !1, n = null, r = null, i = Object.freeze({ open: !1 }), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
18438
18462
|
if (i.open === e) return !1;
|
|
18439
18463
|
i = Object.freeze({ open: e });
|
|
@@ -18472,7 +18496,7 @@ function Im() {
|
|
|
18472
18496
|
}
|
|
18473
18497
|
});
|
|
18474
18498
|
}
|
|
18475
|
-
function
|
|
18499
|
+
function Rm() {
|
|
18476
18500
|
let e = !1, t = !1, n = null, r = Object.freeze({
|
|
18477
18501
|
failedTrackIds: Object.freeze([]),
|
|
18478
18502
|
open: !1
|
|
@@ -18519,7 +18543,7 @@ function Lm() {
|
|
|
18519
18543
|
}
|
|
18520
18544
|
});
|
|
18521
18545
|
}
|
|
18522
|
-
function
|
|
18546
|
+
function zm() {
|
|
18523
18547
|
let e = !1, t = !1, n = /* @__PURE__ */ new Set(), r = Object.freeze({
|
|
18524
18548
|
copied: !1,
|
|
18525
18549
|
mode: null,
|
|
@@ -18540,7 +18564,7 @@ function Rm() {
|
|
|
18540
18564
|
apply({ config: i, state: o }) {
|
|
18541
18565
|
if (e) throw Error("Cannot apply disposed capability module: share");
|
|
18542
18566
|
t = o === "active";
|
|
18543
|
-
let s = t ?
|
|
18567
|
+
let s = t ? gp(i.capabilities.share) : [];
|
|
18544
18568
|
n = new Set(s.filter((e) => e === "link" || e === "embed"));
|
|
18545
18569
|
let c = r.mode !== null && n.has(r.mode) ? r.mode : s.find((e) => e === "link" || e === "embed") ?? null;
|
|
18546
18570
|
a({
|
|
@@ -18588,11 +18612,11 @@ function Rm() {
|
|
|
18588
18612
|
}
|
|
18589
18613
|
});
|
|
18590
18614
|
}
|
|
18591
|
-
function
|
|
18615
|
+
function Bm(e) {
|
|
18592
18616
|
let t = e.content.metadata;
|
|
18593
18617
|
return t.inANutshell !== void 0 || t.keyConcepts !== void 0 || t.researchField !== void 0 || t.transcript !== void 0;
|
|
18594
18618
|
}
|
|
18595
|
-
function
|
|
18619
|
+
function Vm() {
|
|
18596
18620
|
let e = !1, t = !1, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = Object.freeze({
|
|
18597
18621
|
availableViews: Object.freeze([]),
|
|
18598
18622
|
knowledgeTab: null,
|
|
@@ -18614,7 +18638,7 @@ function Bm() {
|
|
|
18614
18638
|
key: "contextPanel",
|
|
18615
18639
|
apply({ config: o, state: c }) {
|
|
18616
18640
|
if (e) throw Error("Cannot apply disposed capability module: contextPanel");
|
|
18617
|
-
t = c === "active" &&
|
|
18641
|
+
t = c === "active" && Om[o.layout].includes("contextPanel"), n = /* @__PURE__ */ new Set(), Bm(o) && n.add("knowledge"), o.content.metadata.underlyingPublication !== void 0 && n.add("underlyingPublication"), o.content.metadata.relatedVideos !== void 0 && n.add("relatedVideos");
|
|
18618
18642
|
let l = o.content.metadata, u = [
|
|
18619
18643
|
...l.inANutshell === void 0 ? [] : ["inANutshell"],
|
|
18620
18644
|
...l.keyConcepts === void 0 ? [] : ["keyConcepts"],
|
|
@@ -18679,70 +18703,70 @@ function Bm() {
|
|
|
18679
18703
|
}
|
|
18680
18704
|
});
|
|
18681
18705
|
}
|
|
18682
|
-
var
|
|
18683
|
-
key: km.key,
|
|
18684
|
-
defaults: km.defaults,
|
|
18685
|
-
strings: km.strings,
|
|
18686
|
-
selectOptions: (e) => e.capabilities.chapters,
|
|
18687
|
-
isAvailable: ({ content: e }) => e.chapters.length > 0,
|
|
18688
|
-
surfaces: [
|
|
18689
|
-
Pm(km, "timeline", Ef),
|
|
18690
|
-
Pm(km, "trigger", Df),
|
|
18691
|
-
Pm(km, "menu", Mf)
|
|
18692
|
-
],
|
|
18693
|
-
create: Im
|
|
18694
|
-
}), Hm = Om({
|
|
18706
|
+
var Hm = km({
|
|
18695
18707
|
key: Am.key,
|
|
18696
18708
|
defaults: Am.defaults,
|
|
18697
18709
|
strings: Am.strings,
|
|
18698
|
-
selectOptions: (e) => e.capabilities.
|
|
18699
|
-
isAvailable: ({ content: e }) => e.
|
|
18710
|
+
selectOptions: (e) => e.capabilities.chapters,
|
|
18711
|
+
isAvailable: ({ content: e }) => e.chapters.length > 0,
|
|
18700
18712
|
surfaces: [
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18713
|
+
Fm(Am, "timeline", Ef),
|
|
18714
|
+
Fm(Am, "trigger", Df),
|
|
18715
|
+
Fm(Am, "menu", Nf)
|
|
18704
18716
|
],
|
|
18705
18717
|
create: Lm
|
|
18706
|
-
}), Um =
|
|
18718
|
+
}), Um = km({
|
|
18707
18719
|
key: jm.key,
|
|
18708
18720
|
defaults: jm.defaults,
|
|
18709
18721
|
strings: jm.strings,
|
|
18710
|
-
selectOptions: (e) => e.capabilities.
|
|
18711
|
-
isAvailable: () =>
|
|
18712
|
-
surfaces: [
|
|
18713
|
-
|
|
18714
|
-
|
|
18722
|
+
selectOptions: (e) => e.capabilities.captions,
|
|
18723
|
+
isAvailable: ({ content: e }) => e.tracks.some((e) => e.kind === "subtitles" || e.kind === "captions"),
|
|
18724
|
+
surfaces: [
|
|
18725
|
+
Fm(jm, "text", lp),
|
|
18726
|
+
Fm(jm, "control", cp),
|
|
18727
|
+
Fm(jm, "menu", up)
|
|
18728
|
+
],
|
|
18729
|
+
create: Rm
|
|
18730
|
+
}), Wm = km({
|
|
18715
18731
|
key: Mm.key,
|
|
18716
18732
|
defaults: Mm.defaults,
|
|
18717
18733
|
strings: Mm.strings,
|
|
18718
|
-
selectOptions: (e) => e.capabilities.
|
|
18719
|
-
isAvailable: (
|
|
18720
|
-
surfaces: [
|
|
18721
|
-
create:
|
|
18722
|
-
}), Gm =
|
|
18734
|
+
selectOptions: (e) => e.capabilities.speed,
|
|
18735
|
+
isAvailable: () => !0,
|
|
18736
|
+
surfaces: [Fm(Mm, "control", pp)],
|
|
18737
|
+
create: () => Im("speed")
|
|
18738
|
+
}), Gm = km({
|
|
18723
18739
|
key: Nm.key,
|
|
18724
18740
|
defaults: Nm.defaults,
|
|
18725
18741
|
strings: Nm.strings,
|
|
18742
|
+
selectOptions: (e) => e.capabilities.share,
|
|
18743
|
+
isAvailable: ({ options: e }) => e.canonicalUrl !== void 0 && e.canonicalUrl.length > 0,
|
|
18744
|
+
surfaces: [Fm(Nm, "trigger", Tp), Fm(Nm, "dialog", Fp)],
|
|
18745
|
+
create: zm
|
|
18746
|
+
}), Km = km({
|
|
18747
|
+
key: Pm.key,
|
|
18748
|
+
defaults: Pm.defaults,
|
|
18749
|
+
strings: Pm.strings,
|
|
18726
18750
|
selectOptions: (e) => e.capabilities.contextPanel,
|
|
18727
18751
|
isAvailable: ({ content: e }) => Object.keys(e.metadata).length > 0,
|
|
18728
|
-
surfaces: [Pm
|
|
18729
|
-
create:
|
|
18730
|
-
}),
|
|
18731
|
-
Vm,
|
|
18752
|
+
surfaces: [Fm(Pm, "triggers", im), Fm(Pm, "panel", Tm)],
|
|
18753
|
+
create: Vm
|
|
18754
|
+
}), qm = Object.freeze([
|
|
18732
18755
|
Hm,
|
|
18733
18756
|
Um,
|
|
18734
18757
|
Wm,
|
|
18735
|
-
Gm
|
|
18736
|
-
|
|
18758
|
+
Gm,
|
|
18759
|
+
Km
|
|
18760
|
+
]), Jm = class extends Error {
|
|
18737
18761
|
constructor(e) {
|
|
18738
18762
|
super(e), this.name = "CapabilityRegistryLifecycleError";
|
|
18739
18763
|
}
|
|
18740
18764
|
};
|
|
18741
|
-
function
|
|
18742
|
-
return
|
|
18765
|
+
function Ym() {
|
|
18766
|
+
return Dm.reduce((e, t) => (e[t] = [], e), {});
|
|
18743
18767
|
}
|
|
18744
|
-
function
|
|
18745
|
-
let t =
|
|
18768
|
+
function Xm(e) {
|
|
18769
|
+
let t = Ym(), n = {};
|
|
18746
18770
|
for (let r of e) {
|
|
18747
18771
|
let e = Object.freeze({
|
|
18748
18772
|
key: r.declaration.key,
|
|
@@ -18760,42 +18784,42 @@ function Ym(e) {
|
|
|
18760
18784
|
n === "controlBarRight" && r.declaration.key === "speed" ? t[n].unshift(i) : t[n].push(i);
|
|
18761
18785
|
}
|
|
18762
18786
|
}
|
|
18763
|
-
if (t.timeline.length > 1) throw new
|
|
18764
|
-
for (let e of
|
|
18787
|
+
if (t.timeline.length > 1) throw new Jm("Only one capability timeline replacement may be active");
|
|
18788
|
+
for (let e of Dm) Object.freeze(t[e]);
|
|
18765
18789
|
return Object.freeze({
|
|
18766
18790
|
capabilities: Object.freeze(n),
|
|
18767
18791
|
slots: Object.freeze(t)
|
|
18768
18792
|
});
|
|
18769
18793
|
}
|
|
18770
|
-
function
|
|
18794
|
+
function Zm(e, t, n) {
|
|
18771
18795
|
return n.enabled ? e.isAvailable({
|
|
18772
18796
|
content: t.content,
|
|
18773
18797
|
options: n
|
|
18774
18798
|
}) ? "active" : "dormant" : "removed";
|
|
18775
18799
|
}
|
|
18776
|
-
function
|
|
18800
|
+
function Qm(e, t) {
|
|
18777
18801
|
let n = t.map(({ key: e }) => e);
|
|
18778
|
-
if (t.length !==
|
|
18779
|
-
if (t.flatMap((e) => e.surfaces.filter((e) => e.slots.includes("timeline"))).length > 1) throw new
|
|
18802
|
+
if (t.length !== Em.length || Em.some((e) => n.filter((t) => t === e).length !== 1)) throw new Jm("The capability registry must contain each fixed capability exactly once");
|
|
18803
|
+
if (t.flatMap((e) => e.surfaces.filter((e) => e.slots.includes("timeline"))).length > 1) throw new Jm("Only one capability timeline replacement may be registered");
|
|
18780
18804
|
for (let e of t) {
|
|
18781
18805
|
let t = e.surfaces.map(({ id: e }) => e);
|
|
18782
|
-
if (e.surfaces.some(({ slots: e }) => e.length === 0) || new Set(t).size !== t.length) throw new
|
|
18806
|
+
if (e.surfaces.some(({ slots: e }) => e.length === 0) || new Set(t).size !== t.length) throw new Jm(`Capability surfaces must have unique identifiers and at least one slot: ${e.key}`);
|
|
18783
18807
|
}
|
|
18784
18808
|
let r = t.map((e) => ({
|
|
18785
18809
|
declaration: e,
|
|
18786
18810
|
module: e.create(),
|
|
18787
18811
|
state: "dormant"
|
|
18788
18812
|
})), i = /* @__PURE__ */ new Set(), a = !1, o, s = (e, t) => {
|
|
18789
|
-
if (a) throw new
|
|
18813
|
+
if (a) throw new Jm("Cannot apply a configuration after the capability registry is disposed");
|
|
18790
18814
|
for (let t of r) {
|
|
18791
|
-
let n = t.declaration.selectOptions(e), r =
|
|
18815
|
+
let n = t.declaration.selectOptions(e), r = Zm(t.declaration, e, n);
|
|
18792
18816
|
t.module.apply({
|
|
18793
18817
|
config: e,
|
|
18794
18818
|
options: n,
|
|
18795
18819
|
state: r
|
|
18796
18820
|
}), t.state = r;
|
|
18797
18821
|
}
|
|
18798
|
-
if (o =
|
|
18822
|
+
if (o = Xm(r), t) for (let e of i) e();
|
|
18799
18823
|
};
|
|
18800
18824
|
return s(e, !1), Object.freeze({
|
|
18801
18825
|
getSnapshot: () => o,
|
|
@@ -18804,7 +18828,7 @@ function Zm(e, t) {
|
|
|
18804
18828
|
},
|
|
18805
18829
|
getModule(e) {
|
|
18806
18830
|
let t = r.find(({ declaration: t }) => t.key === e);
|
|
18807
|
-
if (t === void 0) throw new
|
|
18831
|
+
if (t === void 0) throw new Jm(`Unknown capability module: ${e}`);
|
|
18808
18832
|
return t.module;
|
|
18809
18833
|
},
|
|
18810
18834
|
applyConfig(e) {
|
|
@@ -18819,34 +18843,34 @@ function Zm(e, t) {
|
|
|
18819
18843
|
isDisposed: () => a
|
|
18820
18844
|
});
|
|
18821
18845
|
}
|
|
18822
|
-
function
|
|
18823
|
-
return
|
|
18846
|
+
function $m(e) {
|
|
18847
|
+
return Qm(e, qm);
|
|
18824
18848
|
}
|
|
18825
|
-
var
|
|
18826
|
-
function
|
|
18827
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
18849
|
+
var eh = (0, w.createContext)(null);
|
|
18850
|
+
function th({ children: e, registry: t }) {
|
|
18851
|
+
return /* @__PURE__ */ (0, M.jsx)(eh, {
|
|
18828
18852
|
value: t,
|
|
18829
18853
|
children: e
|
|
18830
18854
|
});
|
|
18831
18855
|
}
|
|
18832
|
-
function
|
|
18833
|
-
let e = (0, w.useContext)(
|
|
18856
|
+
function nh() {
|
|
18857
|
+
let e = (0, w.useContext)(eh);
|
|
18834
18858
|
if (e === null) throw Error("Capability hooks must be used within CapabilityRegistryProvider");
|
|
18835
18859
|
return e;
|
|
18836
18860
|
}
|
|
18837
|
-
function
|
|
18838
|
-
let e =
|
|
18861
|
+
function rh() {
|
|
18862
|
+
let e = nh();
|
|
18839
18863
|
return (0, w.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getSnapshot);
|
|
18840
18864
|
}
|
|
18841
|
-
function
|
|
18842
|
-
return /* @__PURE__ */ (0, M.jsx)(w.Fragment, { children:
|
|
18865
|
+
function ih({ slot: e }) {
|
|
18866
|
+
return /* @__PURE__ */ (0, M.jsx)(w.Fragment, { children: rh().slots[e] });
|
|
18843
18867
|
}
|
|
18844
|
-
function
|
|
18845
|
-
let t =
|
|
18868
|
+
function ah({ coreTimeline: e }) {
|
|
18869
|
+
let t = rh().slots.timeline;
|
|
18846
18870
|
return /* @__PURE__ */ (0, M.jsx)(w.Fragment, { children: t.length === 0 ? e : t });
|
|
18847
18871
|
}
|
|
18848
|
-
Object.freeze(
|
|
18849
|
-
var
|
|
18872
|
+
Object.freeze(Om.landscape.filter((e) => e !== "fullscreen"));
|
|
18873
|
+
var oh = Object.freeze({
|
|
18850
18874
|
timeline: "timeline",
|
|
18851
18875
|
controlBarLeft: "control-left",
|
|
18852
18876
|
controlBarRight: "control-right",
|
|
@@ -18855,22 +18879,22 @@ var ah = Object.freeze({
|
|
|
18855
18879
|
overlay: "overlay",
|
|
18856
18880
|
menu: "menu-anchor"
|
|
18857
18881
|
});
|
|
18858
|
-
function
|
|
18882
|
+
function sh({ children: e, name: t }) {
|
|
18859
18883
|
return /* @__PURE__ */ (0, M.jsx)("div", {
|
|
18860
18884
|
className: `ltp-landscape__core ltp-landscape__core--${t}`,
|
|
18861
18885
|
"data-ltp-core-slot": t,
|
|
18862
18886
|
children: e
|
|
18863
18887
|
});
|
|
18864
18888
|
}
|
|
18865
|
-
function
|
|
18889
|
+
function ch({ slot: e }) {
|
|
18866
18890
|
return /* @__PURE__ */ (0, M.jsx)("div", {
|
|
18867
|
-
className: `ltp-landscape__capability ltp-landscape__capability--${
|
|
18891
|
+
className: `ltp-landscape__capability ltp-landscape__capability--${oh[e]}`,
|
|
18868
18892
|
"data-ltp-landscape-slot": e,
|
|
18869
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
18893
|
+
children: /* @__PURE__ */ (0, M.jsx)(ih, { slot: e })
|
|
18870
18894
|
});
|
|
18871
18895
|
}
|
|
18872
|
-
function
|
|
18873
|
-
let d = t !== void 0, f = l !== void 0, p = d || f, m =
|
|
18896
|
+
function lh({ announcer: e, configurationError: t, controlsMounted: n = !0, controlsVisible: r = !0, controlVisibilityHandlers: i, core: a = {}, inputPolicy: o, language: s, media: c, mediaError: l, runtimeBridge: u }) {
|
|
18897
|
+
let d = t !== void 0, f = l !== void 0, p = d || f, m = rh().slots, h = n && (a.logo !== void 0 || m.topIcons.length > 0), g = n && (a.playPause !== void 0 || a.volume !== void 0 || a.time !== void 0 || a.timeline !== void 0 || a.fullscreen !== void 0 || m.timeline.length > 0 || m.controlBarLeft.length > 0 || m.controlBarCenter.length > 0 || m.controlBarRight.length > 0);
|
|
18874
18898
|
return /* @__PURE__ */ (0, M.jsxs)(_c, {
|
|
18875
18899
|
className: "ltp-player ltp-media-engine ltp-landscape",
|
|
18876
18900
|
"data-ltp-configuration-error": d || void 0,
|
|
@@ -18903,7 +18927,7 @@ function ch({ announcer: e, configurationError: t, controlsMounted: n = !0, cont
|
|
|
18903
18927
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
18904
18928
|
className: "ltp-landscape__cover",
|
|
18905
18929
|
"data-ltp-landscape-region": "cover",
|
|
18906
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
18930
|
+
children: /* @__PURE__ */ (0, M.jsx)(sh, {
|
|
18907
18931
|
name: "cover",
|
|
18908
18932
|
children: a.cover
|
|
18909
18933
|
})
|
|
@@ -18923,7 +18947,7 @@ function ch({ announcer: e, configurationError: t, controlsMounted: n = !0, cont
|
|
|
18923
18947
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
18924
18948
|
className: "ltp-landscape__buffering",
|
|
18925
18949
|
"data-ltp-landscape-region": "buffering",
|
|
18926
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
18950
|
+
children: /* @__PURE__ */ (0, M.jsx)(sh, {
|
|
18927
18951
|
name: "buffering",
|
|
18928
18952
|
children: a.buffering
|
|
18929
18953
|
})
|
|
@@ -18931,21 +18955,21 @@ function ch({ announcer: e, configurationError: t, controlsMounted: n = !0, cont
|
|
|
18931
18955
|
a.logo !== void 0 || n ? /* @__PURE__ */ (0, M.jsxs)("div", {
|
|
18932
18956
|
className: "ltp-landscape__top-row",
|
|
18933
18957
|
"data-ltp-landscape-region": "top-row",
|
|
18934
|
-
children: [/* @__PURE__ */ (0, M.jsx)(
|
|
18958
|
+
children: [/* @__PURE__ */ (0, M.jsx)(sh, {
|
|
18935
18959
|
name: "logo",
|
|
18936
18960
|
children: a.logo
|
|
18937
18961
|
}), n ? /* @__PURE__ */ (0, M.jsx)("div", {
|
|
18938
18962
|
className: "ltp-landscape__top-actions",
|
|
18939
18963
|
"data-ltp-control-visibility-fade": !0,
|
|
18940
18964
|
"data-ltp-control-visibility-lock": !0,
|
|
18941
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
18965
|
+
children: /* @__PURE__ */ (0, M.jsx)(ch, { slot: "topIcons" })
|
|
18942
18966
|
}) : null]
|
|
18943
18967
|
}) : null,
|
|
18944
18968
|
n ? /* @__PURE__ */ (0, M.jsxs)(M.Fragment, { children: [
|
|
18945
18969
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
18946
18970
|
className: "ltp-landscape__input-feedback",
|
|
18947
18971
|
"data-ltp-landscape-region": "input-feedback",
|
|
18948
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
18972
|
+
children: /* @__PURE__ */ (0, M.jsx)(sh, {
|
|
18949
18973
|
name: "inputFeedback",
|
|
18950
18974
|
children: a.inputFeedback
|
|
18951
18975
|
})
|
|
@@ -18953,12 +18977,12 @@ function ch({ announcer: e, configurationError: t, controlsMounted: n = !0, cont
|
|
|
18953
18977
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
18954
18978
|
className: "ltp-landscape__captions",
|
|
18955
18979
|
"data-ltp-landscape-region": "captions",
|
|
18956
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
18980
|
+
children: /* @__PURE__ */ (0, M.jsx)(ch, { slot: "captions" })
|
|
18957
18981
|
}),
|
|
18958
18982
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
18959
18983
|
className: "ltp-landscape__information",
|
|
18960
18984
|
"data-ltp-landscape-region": "information",
|
|
18961
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
18985
|
+
children: /* @__PURE__ */ (0, M.jsx)(sh, {
|
|
18962
18986
|
name: "information",
|
|
18963
18987
|
children: a.information
|
|
18964
18988
|
})
|
|
@@ -18969,7 +18993,7 @@ function ch({ announcer: e, configurationError: t, controlsMounted: n = !0, cont
|
|
|
18969
18993
|
"data-ltp-control-visibility-lock": !0,
|
|
18970
18994
|
"data-ltp-landscape-region": "timeline",
|
|
18971
18995
|
"data-ltp-landscape-slot": "timeline",
|
|
18972
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
18996
|
+
children: /* @__PURE__ */ (0, M.jsx)(ah, { coreTimeline: /* @__PURE__ */ (0, M.jsx)(sh, {
|
|
18973
18997
|
name: "timeline",
|
|
18974
18998
|
children: a.timeline
|
|
18975
18999
|
}) })
|
|
@@ -18983,24 +19007,24 @@ function ch({ announcer: e, configurationError: t, controlsMounted: n = !0, cont
|
|
|
18983
19007
|
className: "ltp-landscape__control-group",
|
|
18984
19008
|
"data-ltp-control-group": "left",
|
|
18985
19009
|
children: [
|
|
18986
|
-
/* @__PURE__ */ (0, M.jsx)(
|
|
19010
|
+
/* @__PURE__ */ (0, M.jsx)(sh, {
|
|
18987
19011
|
name: "playPause",
|
|
18988
19012
|
children: a.playPause
|
|
18989
19013
|
}),
|
|
18990
|
-
/* @__PURE__ */ (0, M.jsx)(
|
|
19014
|
+
/* @__PURE__ */ (0, M.jsx)(sh, {
|
|
18991
19015
|
name: "volume",
|
|
18992
19016
|
children: a.volume
|
|
18993
19017
|
}),
|
|
18994
|
-
/* @__PURE__ */ (0, M.jsx)(
|
|
19018
|
+
/* @__PURE__ */ (0, M.jsx)(sh, {
|
|
18995
19019
|
name: "time",
|
|
18996
19020
|
children: a.time
|
|
18997
19021
|
}),
|
|
18998
|
-
/* @__PURE__ */ (0, M.jsx)(
|
|
19022
|
+
/* @__PURE__ */ (0, M.jsx)(ch, { slot: "controlBarLeft" })
|
|
18999
19023
|
]
|
|
19000
19024
|
}), /* @__PURE__ */ (0, M.jsxs)("div", {
|
|
19001
19025
|
className: "ltp-landscape__control-group",
|
|
19002
19026
|
"data-ltp-control-group": "right",
|
|
19003
|
-
children: [/* @__PURE__ */ (0, M.jsx)(
|
|
19027
|
+
children: [/* @__PURE__ */ (0, M.jsx)(ch, { slot: "controlBarRight" }), /* @__PURE__ */ (0, M.jsx)(sh, {
|
|
19004
19028
|
name: "fullscreen",
|
|
19005
19029
|
children: a.fullscreen
|
|
19006
19030
|
})]
|
|
@@ -19010,7 +19034,7 @@ function ch({ announcer: e, configurationError: t, controlsMounted: n = !0, cont
|
|
|
19010
19034
|
className: "ltp-landscape__menu",
|
|
19011
19035
|
"data-ltp-control-visibility-fade": !0,
|
|
19012
19036
|
"data-ltp-landscape-region": "menu-anchor",
|
|
19013
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19037
|
+
children: /* @__PURE__ */ (0, M.jsx)(ch, { slot: "menu" })
|
|
19014
19038
|
})
|
|
19015
19039
|
] }) : null
|
|
19016
19040
|
]
|
|
@@ -19018,7 +19042,7 @@ function ch({ announcer: e, configurationError: t, controlsMounted: n = !0, cont
|
|
|
19018
19042
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
19019
19043
|
className: "ltp-landscape__overlay",
|
|
19020
19044
|
"data-ltp-landscape-region": "overlay",
|
|
19021
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19045
|
+
children: /* @__PURE__ */ (0, M.jsx)(ch, { slot: "overlay" })
|
|
19022
19046
|
}),
|
|
19023
19047
|
t,
|
|
19024
19048
|
l,
|
|
@@ -19026,8 +19050,8 @@ function ch({ announcer: e, configurationError: t, controlsMounted: n = !0, cont
|
|
|
19026
19050
|
]
|
|
19027
19051
|
});
|
|
19028
19052
|
}
|
|
19029
|
-
Object.freeze([...
|
|
19030
|
-
var
|
|
19053
|
+
Object.freeze([...Om.portrait]);
|
|
19054
|
+
var uh = Object.freeze({
|
|
19031
19055
|
timeline: "timeline",
|
|
19032
19056
|
controlBarLeft: "control-left",
|
|
19033
19057
|
controlBarCenter: "control-center",
|
|
@@ -19039,22 +19063,22 @@ var lh = Object.freeze({
|
|
|
19039
19063
|
menu: "menu-anchor",
|
|
19040
19064
|
contextPanel: "context-panel"
|
|
19041
19065
|
});
|
|
19042
|
-
function
|
|
19066
|
+
function dh({ children: e, name: t }) {
|
|
19043
19067
|
return /* @__PURE__ */ (0, M.jsx)("div", {
|
|
19044
19068
|
className: `ltp-portrait__core ltp-portrait__core--${t}`,
|
|
19045
19069
|
"data-ltp-core-slot": t,
|
|
19046
19070
|
children: e
|
|
19047
19071
|
});
|
|
19048
19072
|
}
|
|
19049
|
-
function
|
|
19073
|
+
function fh({ slot: e }) {
|
|
19050
19074
|
return /* @__PURE__ */ (0, M.jsx)("div", {
|
|
19051
|
-
className: `ltp-portrait__capability ltp-portrait__capability--${
|
|
19075
|
+
className: `ltp-portrait__capability ltp-portrait__capability--${uh[e]}`,
|
|
19052
19076
|
"data-ltp-portrait-slot": e,
|
|
19053
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19077
|
+
children: /* @__PURE__ */ (0, M.jsx)(ih, { slot: e })
|
|
19054
19078
|
});
|
|
19055
19079
|
}
|
|
19056
|
-
function
|
|
19057
|
-
let l = t !== void 0, u = s !== void 0, d = l || u, f =
|
|
19080
|
+
function ph({ announcer: e, configurationError: t, controlsVisible: n = !0, core: r = {}, inputPolicy: i, language: a, media: o, mediaError: s, runtimeBridge: c }) {
|
|
19081
|
+
let l = t !== void 0, u = s !== void 0, d = l || u, f = rh().slots, p = n && (r.logo !== void 0 || r.volume !== void 0 || f.topIcons.length > 0), m = n && (r.playPause !== void 0 || r.time !== void 0 || r.timeline !== void 0 || f.timeline.length > 0 || f.controlBarLeft.length > 0 || f.controlBarCenter.length > 0 || f.controlBarRight.length > 0);
|
|
19058
19082
|
return /* @__PURE__ */ (0, M.jsxs)(_c, {
|
|
19059
19083
|
className: "ltp-player ltp-media-engine ltp-portrait",
|
|
19060
19084
|
"data-ltp-configuration-error": l || void 0,
|
|
@@ -19084,7 +19108,7 @@ function fh({ announcer: e, configurationError: t, controlsVisible: n = !0, core
|
|
|
19084
19108
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
19085
19109
|
className: "ltp-portrait__cover",
|
|
19086
19110
|
"data-ltp-portrait-region": "cover",
|
|
19087
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19111
|
+
children: /* @__PURE__ */ (0, M.jsx)(dh, {
|
|
19088
19112
|
name: "cover",
|
|
19089
19113
|
children: r.cover
|
|
19090
19114
|
})
|
|
@@ -19102,7 +19126,7 @@ function fh({ announcer: e, configurationError: t, controlsVisible: n = !0, core
|
|
|
19102
19126
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
19103
19127
|
className: "ltp-portrait__buffering",
|
|
19104
19128
|
"data-ltp-portrait-region": "buffering",
|
|
19105
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19129
|
+
children: /* @__PURE__ */ (0, M.jsx)(dh, {
|
|
19106
19130
|
name: "buffering",
|
|
19107
19131
|
children: r.buffering
|
|
19108
19132
|
})
|
|
@@ -19110,7 +19134,7 @@ function fh({ announcer: e, configurationError: t, controlsVisible: n = !0, core
|
|
|
19110
19134
|
r.logo === void 0 ? null : /* @__PURE__ */ (0, M.jsx)("div", {
|
|
19111
19135
|
className: "ltp-portrait__top-left",
|
|
19112
19136
|
"data-ltp-portrait-region": "top-left",
|
|
19113
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19137
|
+
children: /* @__PURE__ */ (0, M.jsx)(dh, {
|
|
19114
19138
|
name: "logo",
|
|
19115
19139
|
children: r.logo
|
|
19116
19140
|
})
|
|
@@ -19119,7 +19143,7 @@ function fh({ announcer: e, configurationError: t, controlsVisible: n = !0, core
|
|
|
19119
19143
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
19120
19144
|
className: "ltp-portrait__input-feedback",
|
|
19121
19145
|
"data-ltp-portrait-region": "input-feedback",
|
|
19122
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19146
|
+
children: /* @__PURE__ */ (0, M.jsx)(dh, {
|
|
19123
19147
|
name: "inputFeedback",
|
|
19124
19148
|
children: r.inputFeedback
|
|
19125
19149
|
})
|
|
@@ -19127,12 +19151,12 @@ function fh({ announcer: e, configurationError: t, controlsVisible: n = !0, core
|
|
|
19127
19151
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
19128
19152
|
className: "ltp-portrait__top-right",
|
|
19129
19153
|
"data-ltp-portrait-region": "top-right",
|
|
19130
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19154
|
+
children: /* @__PURE__ */ (0, M.jsx)(fh, { slot: "topIcons" })
|
|
19131
19155
|
}),
|
|
19132
19156
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
19133
19157
|
className: "ltp-portrait__captions",
|
|
19134
19158
|
"data-ltp-portrait-region": "captions",
|
|
19135
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19159
|
+
children: /* @__PURE__ */ (0, M.jsx)(fh, { slot: "captions" })
|
|
19136
19160
|
}),
|
|
19137
19161
|
/* @__PURE__ */ (0, M.jsxs)("div", {
|
|
19138
19162
|
className: "ltp-portrait__information-stack",
|
|
@@ -19140,11 +19164,11 @@ function fh({ announcer: e, configurationError: t, controlsVisible: n = !0, core
|
|
|
19140
19164
|
children: [/* @__PURE__ */ (0, M.jsx)("div", {
|
|
19141
19165
|
className: "ltp-portrait__trigger-rail",
|
|
19142
19166
|
"data-ltp-portrait-region": "trigger-rail",
|
|
19143
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19167
|
+
children: /* @__PURE__ */ (0, M.jsx)(fh, { slot: "triggerRail" })
|
|
19144
19168
|
}), /* @__PURE__ */ (0, M.jsx)("div", {
|
|
19145
19169
|
className: "ltp-portrait__information",
|
|
19146
19170
|
"data-ltp-portrait-region": "information",
|
|
19147
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19171
|
+
children: /* @__PURE__ */ (0, M.jsx)(dh, {
|
|
19148
19172
|
name: "information",
|
|
19149
19173
|
children: r.information
|
|
19150
19174
|
})
|
|
@@ -19154,7 +19178,7 @@ function fh({ announcer: e, configurationError: t, controlsVisible: n = !0, core
|
|
|
19154
19178
|
className: "ltp-portrait__timeline",
|
|
19155
19179
|
"data-ltp-portrait-region": "timeline",
|
|
19156
19180
|
"data-ltp-portrait-slot": "timeline",
|
|
19157
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19181
|
+
children: /* @__PURE__ */ (0, M.jsx)(ah, { coreTimeline: /* @__PURE__ */ (0, M.jsx)(dh, {
|
|
19158
19182
|
name: "timeline",
|
|
19159
19183
|
children: r.timeline
|
|
19160
19184
|
}) })
|
|
@@ -19163,7 +19187,7 @@ function fh({ announcer: e, configurationError: t, controlsVisible: n = !0, core
|
|
|
19163
19187
|
className: "ltp-portrait__control-group ltp-portrait__control-group--left",
|
|
19164
19188
|
"data-ltp-control-group": "left",
|
|
19165
19189
|
"data-ltp-portrait-region": "bottom-left",
|
|
19166
|
-
children: [/* @__PURE__ */ (0, M.jsx)(
|
|
19190
|
+
children: [/* @__PURE__ */ (0, M.jsx)(fh, { slot: "controlBarLeft" }), /* @__PURE__ */ (0, M.jsx)(dh, {
|
|
19167
19191
|
name: "time",
|
|
19168
19192
|
children: r.time
|
|
19169
19193
|
})]
|
|
@@ -19172,16 +19196,16 @@ function fh({ announcer: e, configurationError: t, controlsVisible: n = !0, core
|
|
|
19172
19196
|
className: "ltp-portrait__control-group ltp-portrait__control-group--center",
|
|
19173
19197
|
"data-ltp-control-group": "center",
|
|
19174
19198
|
"data-ltp-portrait-region": "bottom-center",
|
|
19175
|
-
children: [/* @__PURE__ */ (0, M.jsx)(
|
|
19199
|
+
children: [/* @__PURE__ */ (0, M.jsx)(dh, {
|
|
19176
19200
|
name: "playPause",
|
|
19177
19201
|
children: r.playPause
|
|
19178
|
-
}), /* @__PURE__ */ (0, M.jsx)(
|
|
19202
|
+
}), /* @__PURE__ */ (0, M.jsx)(fh, { slot: "controlBarCenter" })]
|
|
19179
19203
|
}),
|
|
19180
19204
|
/* @__PURE__ */ (0, M.jsxs)("div", {
|
|
19181
19205
|
className: "ltp-portrait__control-group ltp-portrait__control-group--right",
|
|
19182
19206
|
"data-ltp-control-group": "right",
|
|
19183
19207
|
"data-ltp-portrait-region": "bottom-right",
|
|
19184
|
-
children: [/* @__PURE__ */ (0, M.jsx)(
|
|
19208
|
+
children: [/* @__PURE__ */ (0, M.jsx)(fh, { slot: "controlBarRight" }), /* @__PURE__ */ (0, M.jsx)(dh, {
|
|
19185
19209
|
name: "volume",
|
|
19186
19210
|
children: r.volume
|
|
19187
19211
|
})]
|
|
@@ -19189,20 +19213,20 @@ function fh({ announcer: e, configurationError: t, controlsVisible: n = !0, core
|
|
|
19189
19213
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
19190
19214
|
className: "ltp-portrait__menu",
|
|
19191
19215
|
"data-ltp-portrait-region": "menu-anchor",
|
|
19192
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19216
|
+
children: /* @__PURE__ */ (0, M.jsx)(fh, { slot: "menu" })
|
|
19193
19217
|
})
|
|
19194
19218
|
] }) : null,
|
|
19195
19219
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
19196
19220
|
className: "ltp-portrait__context-panel",
|
|
19197
19221
|
"data-ltp-portrait-region": "context-panel",
|
|
19198
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19222
|
+
children: /* @__PURE__ */ (0, M.jsx)(fh, { slot: "contextPanel" })
|
|
19199
19223
|
})
|
|
19200
19224
|
]
|
|
19201
19225
|
}),
|
|
19202
19226
|
/* @__PURE__ */ (0, M.jsx)("div", {
|
|
19203
19227
|
className: "ltp-portrait__overlay",
|
|
19204
19228
|
"data-ltp-portrait-region": "overlay",
|
|
19205
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
19229
|
+
children: /* @__PURE__ */ (0, M.jsx)(fh, { slot: "overlay" })
|
|
19206
19230
|
}),
|
|
19207
19231
|
t,
|
|
19208
19232
|
s,
|
|
@@ -19219,7 +19243,7 @@ function Q(e, t, n = {}) {
|
|
|
19219
19243
|
placeholders: Object.freeze(n)
|
|
19220
19244
|
});
|
|
19221
19245
|
}
|
|
19222
|
-
var
|
|
19246
|
+
var mh = Object.freeze([
|
|
19223
19247
|
Q("container.label", "playerLabel"),
|
|
19224
19248
|
Q("buttons.play", "play"),
|
|
19225
19249
|
Q("buttons.pause", "pause"),
|
|
@@ -19259,13 +19283,13 @@ var ph = Object.freeze([
|
|
|
19259
19283
|
Q("menu.off", "captionsOffOption"),
|
|
19260
19284
|
Q("menu.subtitles", "subtitles")
|
|
19261
19285
|
]);
|
|
19262
|
-
function
|
|
19286
|
+
function hh(e, t) {
|
|
19263
19287
|
return e.replace(/\{([^{}]+)\}/g, (e, n) => {
|
|
19264
19288
|
let r = t[n];
|
|
19265
19289
|
return r === void 0 ? e : `{${r}}`;
|
|
19266
19290
|
});
|
|
19267
19291
|
}
|
|
19268
|
-
function
|
|
19292
|
+
function gh(e, t, n) {
|
|
19269
19293
|
let r = t.split("."), i = e;
|
|
19270
19294
|
for (let e of r.slice(0, -1)) {
|
|
19271
19295
|
let t = i[e];
|
|
@@ -19279,24 +19303,24 @@ function hh(e, t, n) {
|
|
|
19279
19303
|
if (a === void 0) throw Error("Engine translation key cannot be empty");
|
|
19280
19304
|
i[a] = n;
|
|
19281
19305
|
}
|
|
19282
|
-
function
|
|
19306
|
+
function _h(e) {
|
|
19283
19307
|
let t = {};
|
|
19284
|
-
for (let n of
|
|
19308
|
+
for (let n of mh) gh(t, n.engineKey, hh(e[n.playerKey], n.placeholders));
|
|
19285
19309
|
return t;
|
|
19286
19310
|
}
|
|
19287
|
-
function
|
|
19311
|
+
function vh(e, t = "", n = {}) {
|
|
19288
19312
|
for (let [r, i] of Object.entries(e)) {
|
|
19289
19313
|
if (i === void 0) continue;
|
|
19290
19314
|
let e = t === "" ? r : `${t}.${r}`;
|
|
19291
|
-
typeof i == "string" ? n[e] = i :
|
|
19315
|
+
typeof i == "string" ? n[e] = i : vh(i, e, n);
|
|
19292
19316
|
}
|
|
19293
19317
|
return n;
|
|
19294
19318
|
}
|
|
19295
|
-
ce("en", l), ce("en",
|
|
19296
|
-
function
|
|
19297
|
-
let r = (0, w.useMemo)(() =>
|
|
19319
|
+
ce("en", l), ce("en", _h(Bd));
|
|
19320
|
+
function yh({ children: e, language: t, strings: n }) {
|
|
19321
|
+
let r = (0, w.useMemo)(() => _h(n), [n]), i = (0, w.useMemo)(() => he({
|
|
19298
19322
|
...le(t),
|
|
19299
|
-
...
|
|
19323
|
+
...vh(r)
|
|
19300
19324
|
}, t), [t, r]), a = (0, w.useMemo)(() => ({
|
|
19301
19325
|
translator: i,
|
|
19302
19326
|
locale: t,
|
|
@@ -19315,71 +19339,71 @@ function vh({ children: e, language: t, strings: n }) {
|
|
|
19315
19339
|
}
|
|
19316
19340
|
//#endregion
|
|
19317
19341
|
//#region src/strings/resolve-strings.ts
|
|
19318
|
-
var
|
|
19342
|
+
var bh = Object.freeze({
|
|
19319
19343
|
language: "en",
|
|
19320
19344
|
strings: Bd
|
|
19321
19345
|
});
|
|
19322
|
-
function
|
|
19346
|
+
function xh(e) {
|
|
19323
19347
|
if (typeof e != "object" || !e || Object.isFrozen(e)) return e;
|
|
19324
|
-
for (let t of Object.values(e))
|
|
19348
|
+
for (let t of Object.values(e)) xh(t);
|
|
19325
19349
|
return Object.freeze(e);
|
|
19326
19350
|
}
|
|
19327
|
-
function
|
|
19351
|
+
function Sh(e) {
|
|
19328
19352
|
try {
|
|
19329
19353
|
return Intl.getCanonicalLocales(e)[0] ?? null;
|
|
19330
19354
|
} catch {
|
|
19331
19355
|
return null;
|
|
19332
19356
|
}
|
|
19333
19357
|
}
|
|
19334
|
-
function
|
|
19335
|
-
let n = new Map(t.map((e) => [
|
|
19358
|
+
function Ch(e, t) {
|
|
19359
|
+
let n = new Map(t.map((e) => [Sh(e.language), e])), r = e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
19336
19360
|
for (let e of r) {
|
|
19337
|
-
let t =
|
|
19361
|
+
let t = Sh(e);
|
|
19338
19362
|
if (t !== null) {
|
|
19339
19363
|
let e = n.get(t);
|
|
19340
19364
|
if (e !== void 0) return e;
|
|
19341
19365
|
}
|
|
19342
19366
|
}
|
|
19343
|
-
return
|
|
19367
|
+
return bh;
|
|
19344
19368
|
}
|
|
19345
|
-
function
|
|
19369
|
+
function wh(e) {
|
|
19346
19370
|
return /^[A-Za-z_$][\w$]*$/.test(e) ? `$.strings.${e}` : `$.strings[${JSON.stringify(e)}]`;
|
|
19347
19371
|
}
|
|
19348
|
-
function
|
|
19349
|
-
let r =
|
|
19372
|
+
function Th(e, t = {}, n = []) {
|
|
19373
|
+
let r = Ch(e, [bh, ...n]), i = Object.keys(t).filter((e) => !Hd(e)).sort(), a = i.map((e) => ({
|
|
19350
19374
|
code: "unknown-string-key",
|
|
19351
|
-
path:
|
|
19375
|
+
path: wh(e),
|
|
19352
19376
|
action: "omitted",
|
|
19353
19377
|
message: `unknown player string key ${JSON.stringify(e)}`
|
|
19354
19378
|
})), o = Object.fromEntries(Object.keys(Bd).map((e) => [e, Object.hasOwn(t, e) ? t[e] : r.strings[e] ?? Bd[e]]));
|
|
19355
|
-
return
|
|
19356
|
-
selectedLanguage:
|
|
19379
|
+
return xh({
|
|
19380
|
+
selectedLanguage: Sh(r.language) ?? "en",
|
|
19357
19381
|
strings: o,
|
|
19358
19382
|
unknownKeys: i,
|
|
19359
19383
|
findings: a
|
|
19360
19384
|
});
|
|
19361
19385
|
}
|
|
19362
|
-
var
|
|
19386
|
+
var Eh = Th();
|
|
19363
19387
|
//#endregion
|
|
19364
19388
|
//#region src/config/resolve-config.ts
|
|
19365
|
-
function Eh(e) {
|
|
19366
|
-
return Array.isArray(e) ? e.map((e) => Eh(e)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, Eh(t)])) : e;
|
|
19367
|
-
}
|
|
19368
19389
|
function Dh(e) {
|
|
19390
|
+
return Array.isArray(e) ? e.map((e) => Dh(e)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, Dh(t)])) : e;
|
|
19391
|
+
}
|
|
19392
|
+
function Oh(e) {
|
|
19369
19393
|
if (typeof e != "object" || !e || Object.isFrozen(e)) return e;
|
|
19370
|
-
for (let t of Object.values(e))
|
|
19394
|
+
for (let t of Object.values(e)) Oh(t);
|
|
19371
19395
|
return Object.freeze(e);
|
|
19372
19396
|
}
|
|
19373
|
-
function
|
|
19397
|
+
function kh(e, t) {
|
|
19374
19398
|
return { enabled: e === void 0 ? t.enabled : e !== !1 };
|
|
19375
19399
|
}
|
|
19376
|
-
function
|
|
19400
|
+
function Ah(e) {
|
|
19377
19401
|
let t = X.controls.cover;
|
|
19378
19402
|
if (e === !1) return {
|
|
19379
|
-
...
|
|
19403
|
+
...Dh(t),
|
|
19380
19404
|
enabled: !1
|
|
19381
19405
|
};
|
|
19382
|
-
if (typeof e != "object" || !e) return
|
|
19406
|
+
if (typeof e != "object" || !e) return Dh(t);
|
|
19383
19407
|
let n = e, r = n.button, i = r === !1 ? {
|
|
19384
19408
|
...t.button,
|
|
19385
19409
|
enabled: !1
|
|
@@ -19395,7 +19419,7 @@ function kh(e) {
|
|
|
19395
19419
|
button: i
|
|
19396
19420
|
};
|
|
19397
19421
|
}
|
|
19398
|
-
function
|
|
19422
|
+
function jh(e) {
|
|
19399
19423
|
let t = X.controls.timeline;
|
|
19400
19424
|
return e === !1 ? {
|
|
19401
19425
|
...t,
|
|
@@ -19405,28 +19429,28 @@ function Ah(e) {
|
|
|
19405
19429
|
seekStep: e.seekStep ?? t.seekStep
|
|
19406
19430
|
};
|
|
19407
19431
|
}
|
|
19408
|
-
function
|
|
19432
|
+
function Mh(e) {
|
|
19409
19433
|
let t = e.controls;
|
|
19410
19434
|
return {
|
|
19411
|
-
cover:
|
|
19412
|
-
playPause:
|
|
19413
|
-
timeline:
|
|
19414
|
-
time:
|
|
19415
|
-
volume:
|
|
19416
|
-
fullscreen:
|
|
19417
|
-
pip:
|
|
19418
|
-
buffering:
|
|
19419
|
-
inputFeedback:
|
|
19420
|
-
logo:
|
|
19421
|
-
gestures:
|
|
19422
|
-
hotkeys:
|
|
19435
|
+
cover: Ah(t?.cover),
|
|
19436
|
+
playPause: kh(t?.playPause, X.controls.playPause),
|
|
19437
|
+
timeline: jh(t?.timeline),
|
|
19438
|
+
time: kh(t?.time, X.controls.time),
|
|
19439
|
+
volume: kh(t?.volume, X.controls.volume),
|
|
19440
|
+
fullscreen: kh(t?.fullscreen, X.controls.fullscreen),
|
|
19441
|
+
pip: kh(t?.pip, X.controls.pip),
|
|
19442
|
+
buffering: kh(t?.buffering, X.controls.buffering),
|
|
19443
|
+
inputFeedback: kh(t?.inputFeedback, X.controls.inputFeedback),
|
|
19444
|
+
logo: kh(t?.logo, X.controls.logo),
|
|
19445
|
+
gestures: kh(t?.gestures, X.controls.gestures),
|
|
19446
|
+
hotkeys: kh(t?.hotkeys, X.controls.hotkeys)
|
|
19423
19447
|
};
|
|
19424
19448
|
}
|
|
19425
|
-
function
|
|
19449
|
+
function Nh(e) {
|
|
19426
19450
|
let t = e.capabilities, n = t?.speed, r = t?.share;
|
|
19427
19451
|
return {
|
|
19428
|
-
chapters:
|
|
19429
|
-
captions:
|
|
19452
|
+
chapters: kh(t?.chapters, X.capabilities.chapters),
|
|
19453
|
+
captions: kh(t?.captions, X.capabilities.captions),
|
|
19430
19454
|
speed: {
|
|
19431
19455
|
enabled: n === void 0 ? X.capabilities.speed.enabled : n !== !1,
|
|
19432
19456
|
options: typeof n == "object" && n.options !== void 0 ? [...n.options] : [...X.capabilities.speed.options]
|
|
@@ -19439,17 +19463,17 @@ function Mh(e) {
|
|
|
19439
19463
|
targets: typeof r == "object" && r.targets !== void 0 ? X.capabilities.share.targets.filter((e) => r.targets?.includes(e)) : [...X.capabilities.share.targets],
|
|
19440
19464
|
templates: { message: typeof r == "object" && r.templates?.message !== void 0 ? r.templates.message : X.capabilities.share.templates.message }
|
|
19441
19465
|
},
|
|
19442
|
-
contextPanel:
|
|
19466
|
+
contextPanel: kh(t?.contextPanel, X.capabilities.contextPanel)
|
|
19443
19467
|
};
|
|
19444
19468
|
}
|
|
19445
|
-
function
|
|
19469
|
+
function Ph(e, t) {
|
|
19446
19470
|
return t.reduce((t, n) => {
|
|
19447
19471
|
let r = Math.abs(n - e), i = Math.abs(t - e);
|
|
19448
19472
|
return Math.abs(r - i) <= 2 ** -52 * Math.max(1, r, i) * 4 ? Math.min(n, t) : r < i ? n : t;
|
|
19449
19473
|
});
|
|
19450
19474
|
}
|
|
19451
|
-
function
|
|
19452
|
-
let r = t.speed.enabled ?
|
|
19475
|
+
function Fh(e, t, n) {
|
|
19476
|
+
let r = t.speed.enabled ? Ph(n.playbackRate ?? X.initialState.playbackRate, t.speed.options) : X.initialState.playbackRate;
|
|
19453
19477
|
if (!t.captions.enabled) return {
|
|
19454
19478
|
playbackRate: r,
|
|
19455
19479
|
captions: { enabled: !1 }
|
|
@@ -19463,58 +19487,58 @@ function Ph(e, t, n) {
|
|
|
19463
19487
|
}
|
|
19464
19488
|
};
|
|
19465
19489
|
}
|
|
19466
|
-
function
|
|
19467
|
-
let t =
|
|
19490
|
+
function Ih(e) {
|
|
19491
|
+
let t = Dh(e);
|
|
19468
19492
|
return {
|
|
19469
19493
|
...t,
|
|
19470
19494
|
sources: t.sources,
|
|
19471
19495
|
tracks: t.tracks ?? [...X.content.tracks],
|
|
19472
19496
|
chapters: t.chapters ?? [...X.content.chapters],
|
|
19473
|
-
metadata: t.metadata ??
|
|
19497
|
+
metadata: t.metadata ?? Dh(X.content.metadata)
|
|
19474
19498
|
};
|
|
19475
19499
|
}
|
|
19476
|
-
function
|
|
19477
|
-
let n =
|
|
19478
|
-
return
|
|
19500
|
+
function Lh(e, t = {}) {
|
|
19501
|
+
let n = Nh(e);
|
|
19502
|
+
return Oh({
|
|
19479
19503
|
version: X.version,
|
|
19480
19504
|
layout: e.layout,
|
|
19481
|
-
language:
|
|
19482
|
-
content:
|
|
19483
|
-
controls:
|
|
19505
|
+
language: Dh(e.language ?? X.language),
|
|
19506
|
+
content: Ih(e.content),
|
|
19507
|
+
controls: Mh(e),
|
|
19484
19508
|
capabilities: n,
|
|
19485
|
-
strings:
|
|
19486
|
-
initialState:
|
|
19509
|
+
strings: Dh(e.strings ?? X.strings),
|
|
19510
|
+
initialState: Fh(e, n, t)
|
|
19487
19511
|
});
|
|
19488
19512
|
}
|
|
19489
19513
|
//#endregion
|
|
19490
19514
|
//#region src/user-state/storage.ts
|
|
19491
|
-
var
|
|
19492
|
-
function
|
|
19515
|
+
var Rh = "lt-player:user:v1", zh = !1, Bh = Object.freeze({});
|
|
19516
|
+
function Vh(e) {
|
|
19493
19517
|
return Object.freeze({ ...e });
|
|
19494
19518
|
}
|
|
19495
|
-
function
|
|
19519
|
+
function Hh(e) {
|
|
19496
19520
|
try {
|
|
19497
19521
|
return Intl.getCanonicalLocales(e).length === 1;
|
|
19498
19522
|
} catch {
|
|
19499
19523
|
return !1;
|
|
19500
19524
|
}
|
|
19501
19525
|
}
|
|
19502
|
-
function
|
|
19503
|
-
if (typeof e != "object" || !e || Array.isArray(e)) return
|
|
19526
|
+
function Uh(e) {
|
|
19527
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return Vh({});
|
|
19504
19528
|
let t = e, n = {};
|
|
19505
|
-
return typeof t.volume == "number" && Number.isFinite(t.volume) && t.volume >= 0 && t.volume <= 1 && (n.volume = t.volume), typeof t.muted == "boolean" && (n.muted = t.muted), typeof t.playbackRate == "number" && Number.isFinite(t.playbackRate) && t.playbackRate > 0 && (n.playbackRate = t.playbackRate), typeof t.captionsEnabled == "boolean" && (n.captionsEnabled = t.captionsEnabled), typeof t.captionsLanguage == "string" &&
|
|
19529
|
+
return typeof t.volume == "number" && Number.isFinite(t.volume) && t.volume >= 0 && t.volume <= 1 && (n.volume = t.volume), typeof t.muted == "boolean" && (n.muted = t.muted), typeof t.playbackRate == "number" && Number.isFinite(t.playbackRate) && t.playbackRate > 0 && (n.playbackRate = t.playbackRate), typeof t.captionsEnabled == "boolean" && (n.captionsEnabled = t.captionsEnabled), typeof t.captionsLanguage == "string" && Hh(t.captionsLanguage) && (n.captionsLanguage = t.captionsLanguage), Vh(n);
|
|
19506
19530
|
}
|
|
19507
|
-
function
|
|
19508
|
-
|
|
19531
|
+
function Wh(e) {
|
|
19532
|
+
zh = !0, e !== void 0 && (Bh = Vh(e));
|
|
19509
19533
|
}
|
|
19510
|
-
function
|
|
19534
|
+
function Gh(e = {}) {
|
|
19511
19535
|
let t = e.getStorage ?? (() => globalThis.localStorage), n = e.stringify ?? JSON.stringify, r, i = () => {
|
|
19512
|
-
if (!
|
|
19536
|
+
if (!zh) {
|
|
19513
19537
|
if (r !== void 0) return r;
|
|
19514
19538
|
try {
|
|
19515
19539
|
return r = t(), r;
|
|
19516
19540
|
} catch {
|
|
19517
|
-
|
|
19541
|
+
Wh();
|
|
19518
19542
|
return;
|
|
19519
19543
|
}
|
|
19520
19544
|
}
|
|
@@ -19522,74 +19546,74 @@ function Wh(e = {}) {
|
|
|
19522
19546
|
return {
|
|
19523
19547
|
read() {
|
|
19524
19548
|
let e = i();
|
|
19525
|
-
if (e === void 0) return Bh
|
|
19549
|
+
if (e === void 0) return Vh(Bh);
|
|
19526
19550
|
let t;
|
|
19527
19551
|
try {
|
|
19528
|
-
t = e.getItem(
|
|
19552
|
+
t = e.getItem(Rh);
|
|
19529
19553
|
} catch {
|
|
19530
|
-
return
|
|
19554
|
+
return Wh(), Vh(Bh);
|
|
19531
19555
|
}
|
|
19532
|
-
if (t === null) return
|
|
19556
|
+
if (t === null) return Vh({});
|
|
19533
19557
|
try {
|
|
19534
|
-
return
|
|
19558
|
+
return Uh(JSON.parse(t));
|
|
19535
19559
|
} catch {
|
|
19536
|
-
return
|
|
19560
|
+
return Vh({});
|
|
19537
19561
|
}
|
|
19538
19562
|
},
|
|
19539
19563
|
write(e) {
|
|
19540
|
-
let t =
|
|
19541
|
-
if (
|
|
19542
|
-
|
|
19564
|
+
let t = Uh(e);
|
|
19565
|
+
if (zh) {
|
|
19566
|
+
Bh = t;
|
|
19543
19567
|
return;
|
|
19544
19568
|
}
|
|
19545
19569
|
let r;
|
|
19546
19570
|
try {
|
|
19547
19571
|
r = n(t);
|
|
19548
19572
|
} catch {
|
|
19549
|
-
|
|
19573
|
+
Wh(t);
|
|
19550
19574
|
return;
|
|
19551
19575
|
}
|
|
19552
19576
|
let a = i();
|
|
19553
19577
|
if (a === void 0) {
|
|
19554
|
-
|
|
19578
|
+
Bh = t;
|
|
19555
19579
|
return;
|
|
19556
19580
|
}
|
|
19557
19581
|
try {
|
|
19558
|
-
a.setItem(
|
|
19582
|
+
a.setItem(Rh, r);
|
|
19559
19583
|
} catch {
|
|
19560
|
-
|
|
19584
|
+
Wh(t);
|
|
19561
19585
|
}
|
|
19562
19586
|
}
|
|
19563
19587
|
};
|
|
19564
19588
|
}
|
|
19565
19589
|
//#endregion
|
|
19566
19590
|
//#region src/user-state/user-state.ts
|
|
19567
|
-
var
|
|
19568
|
-
function
|
|
19591
|
+
var Kh = Symbol("ignore-observed-value");
|
|
19592
|
+
function qh(e) {
|
|
19569
19593
|
return Object.freeze({ ...e });
|
|
19570
19594
|
}
|
|
19571
|
-
function
|
|
19572
|
-
let t = e.textTracks.find((e) =>
|
|
19595
|
+
function Jh(e) {
|
|
19596
|
+
let t = e.textTracks.find((e) => Yh(e) && (e.mode === "hidden" || e.mode === "showing"));
|
|
19573
19597
|
return t === void 0 ? "off" : `on:${t.id ?? ""}:${t.language}`;
|
|
19574
19598
|
}
|
|
19575
|
-
function
|
|
19599
|
+
function Yh(e) {
|
|
19576
19600
|
return e.kind === "captions" || e.kind === "subtitles";
|
|
19577
19601
|
}
|
|
19578
|
-
function
|
|
19602
|
+
function Xh(e) {
|
|
19579
19603
|
try {
|
|
19580
19604
|
return Intl.getCanonicalLocales(e)[0]?.toLowerCase();
|
|
19581
19605
|
} catch {
|
|
19582
19606
|
return;
|
|
19583
19607
|
}
|
|
19584
19608
|
}
|
|
19585
|
-
function
|
|
19586
|
-
let n =
|
|
19609
|
+
function Zh(e, t) {
|
|
19610
|
+
let n = Xh(e), r = Xh(t);
|
|
19587
19611
|
return n === void 0 || r === void 0 ? !1 : n === r || n.startsWith(`${r}-`) || r.startsWith(`${n}-`);
|
|
19588
19612
|
}
|
|
19589
|
-
function
|
|
19613
|
+
function Qh(e) {
|
|
19590
19614
|
return typeof e == "string" ? [e] : e;
|
|
19591
19615
|
}
|
|
19592
|
-
function
|
|
19616
|
+
function $h(e = Gh()) {
|
|
19593
19617
|
let t;
|
|
19594
19618
|
return {
|
|
19595
19619
|
storage: e,
|
|
@@ -19598,12 +19622,12 @@ function Qh(e = Wh()) {
|
|
|
19598
19622
|
}
|
|
19599
19623
|
};
|
|
19600
19624
|
}
|
|
19601
|
-
var
|
|
19625
|
+
var eg = class {
|
|
19602
19626
|
#e;
|
|
19603
19627
|
#t;
|
|
19604
19628
|
#n = /* @__PURE__ */ new Set();
|
|
19605
19629
|
#r = /* @__PURE__ */ new Map();
|
|
19606
|
-
#i =
|
|
19630
|
+
#i = qh({});
|
|
19607
19631
|
#a;
|
|
19608
19632
|
#o = null;
|
|
19609
19633
|
#s = null;
|
|
@@ -19622,7 +19646,7 @@ var $h = class {
|
|
|
19622
19646
|
getSnapshot = () => this.#i;
|
|
19623
19647
|
subscribe = (e) => this.#g ? () => void 0 : (this.#n.add(e), () => this.#n.delete(e));
|
|
19624
19648
|
start() {
|
|
19625
|
-
this.#h || this.#g || (this.#h = !0, this.#i =
|
|
19649
|
+
this.#h || this.#g || (this.#h = !0, this.#i = qh(this.#t.hydrate()), this.#a = this.#e.getSnapshot(), this.#m = this.#a.canPlay, this.#o = this.#e.subscribe(this.#_), this.#k(), this.#y());
|
|
19626
19650
|
}
|
|
19627
19651
|
applyResolvedConfig(e, t) {
|
|
19628
19652
|
this.#g || (this.start(), this.#s = e, this.#c = t, this.#l += 1, this.#f = !0, this.#p = !0, this.#m = !1, this.#y());
|
|
@@ -19630,32 +19654,32 @@ var $h = class {
|
|
|
19630
19654
|
setVolume(e) {
|
|
19631
19655
|
if (this.#g || (this.start(), !Number.isFinite(e))) return;
|
|
19632
19656
|
let t = Math.min(1, Math.max(0, e));
|
|
19633
|
-
this.#O({ volume: t }) && this.#D([["volume", t], ["muted",
|
|
19657
|
+
this.#O({ volume: t }) && this.#D([["volume", t], ["muted", Kh]], () => this.#e.setVolume(t));
|
|
19634
19658
|
}
|
|
19635
19659
|
setMuted(e) {
|
|
19636
19660
|
this.#g || (this.start(), !(!this.#O({ muted: e }) && this.#e.getSnapshot().muted === e) && this.#D([["muted", e]], () => this.#e.setMuted(e)));
|
|
19637
19661
|
}
|
|
19638
19662
|
setPlaybackRate(e) {
|
|
19639
19663
|
if (this.#g || (this.start(), this.#s?.capabilities.speed.enabled === !1) || !Number.isFinite(e) || e <= 0 || !this.#O({ playbackRate: e })) return;
|
|
19640
|
-
let t = this.#s?.capabilities.speed, n = t === void 0 ? e : t.enabled ?
|
|
19664
|
+
let t = this.#s?.capabilities.speed, n = t === void 0 ? e : t.enabled ? Ph(e, t.options) : 1;
|
|
19641
19665
|
this.#f = !1, this.#D([["playbackRate", n]], () => this.#e.setPlaybackRate(n));
|
|
19642
19666
|
}
|
|
19643
19667
|
setCaptions(e, t) {
|
|
19644
19668
|
if (this.#g || (this.start(), this.#s?.capabilities.captions.enabled === !1)) return;
|
|
19645
|
-
let n = t === void 0 ? void 0 :
|
|
19669
|
+
let n = t === void 0 ? void 0 : Uh({ captionsLanguage: t }).captionsLanguage, r = { captionsEnabled: e };
|
|
19646
19670
|
n !== void 0 && (r.captionsLanguage = n), this.#O(r) && (this.#p = !1, this.#m = this.#e.getSnapshot().canPlay, this.#T());
|
|
19647
19671
|
}
|
|
19648
19672
|
selectCaptionTrack(e, t) {
|
|
19649
19673
|
if (this.#g || (this.start(), this.#s?.capabilities.captions.enabled === !1)) return;
|
|
19650
|
-
let n = this.#e.getSnapshot().textTracks.find((t) =>
|
|
19674
|
+
let n = this.#e.getSnapshot().textTracks.find((t) => Yh(t) && t.id === e);
|
|
19651
19675
|
if (n === void 0) return;
|
|
19652
|
-
let r =
|
|
19676
|
+
let r = Uh({ captionsLanguage: t ?? n.language }).captionsLanguage;
|
|
19653
19677
|
this.#O({
|
|
19654
19678
|
captionsEnabled: !0,
|
|
19655
19679
|
...r === void 0 ? {} : { captionsLanguage: r }
|
|
19656
19680
|
}), this.#p = !1, this.#m = this.#e.getSnapshot().canPlay;
|
|
19657
19681
|
let i = `on:${e}:${n.language}`;
|
|
19658
|
-
|
|
19682
|
+
Jh(this.#e.getSnapshot()) !== i && this.#D([["captions", i]], () => this.#e.selectSubtitlesTrack(e));
|
|
19659
19683
|
}
|
|
19660
19684
|
refreshCaptions() {
|
|
19661
19685
|
this.#g || this.#s === null || (this.#a = this.#e.getSnapshot(), this.#p = !0, this.#m = !1, this.#C(this.#a));
|
|
@@ -19682,11 +19706,11 @@ var $h = class {
|
|
|
19682
19706
|
}), this.#p) this.#C(t);
|
|
19683
19707
|
else if (!this.#m) t.canPlay && (this.#m = !0);
|
|
19684
19708
|
else {
|
|
19685
|
-
let n =
|
|
19709
|
+
let n = Jh(t), i = Jh(e);
|
|
19686
19710
|
this.#v("captions", n, i, () => {
|
|
19687
|
-
let e = t.textTracks.find((e) =>
|
|
19711
|
+
let e = t.textTracks.find((e) => Yh(e) && (e.mode === "hidden" || e.mode === "showing"));
|
|
19688
19712
|
if (r.captionsEnabled = e !== void 0, e !== void 0) {
|
|
19689
|
-
let t =
|
|
19713
|
+
let t = Uh({ captionsLanguage: e.language }).captionsLanguage;
|
|
19690
19714
|
t !== void 0 && (r.captionsLanguage = t);
|
|
19691
19715
|
}
|
|
19692
19716
|
});
|
|
@@ -19696,7 +19720,7 @@ var $h = class {
|
|
|
19696
19720
|
#v(e, t, n, r) {
|
|
19697
19721
|
let i = this.#r.get(e);
|
|
19698
19722
|
if (i !== void 0) {
|
|
19699
|
-
(i.expected ===
|
|
19723
|
+
(i.expected === Kh || Object.is(t, i.expected)) && this.#r.delete(e);
|
|
19700
19724
|
return;
|
|
19701
19725
|
}
|
|
19702
19726
|
Object.is(t, n) || r(t);
|
|
@@ -19708,7 +19732,7 @@ var $h = class {
|
|
|
19708
19732
|
}
|
|
19709
19733
|
async #b() {
|
|
19710
19734
|
let e = this.#i.volume, t = [];
|
|
19711
|
-
e !== void 0 && t.push(this.#D([["volume", e], ["muted",
|
|
19735
|
+
e !== void 0 && t.push(this.#D([["volume", e], ["muted", Kh]], () => this.#e.setVolume(e)));
|
|
19712
19736
|
let n = this.#c === "feed" || this.#i.muted;
|
|
19713
19737
|
n !== void 0 && t.push(this.#D([["muted", n]], () => this.#e.setMuted(n))), await Promise.all(t);
|
|
19714
19738
|
}
|
|
@@ -19733,7 +19757,7 @@ var $h = class {
|
|
|
19733
19757
|
#C(e) {
|
|
19734
19758
|
if (!this.#p || this.#s === null || !e.attached || this.#r.has("captions")) return;
|
|
19735
19759
|
let t = this.#E(e);
|
|
19736
|
-
if (t !== null && t.value !==
|
|
19760
|
+
if (t !== null && t.value !== Jh(e)) {
|
|
19737
19761
|
let e = this.#l;
|
|
19738
19762
|
this.#D([["captions", t.value]], () => this.#e.selectSubtitlesTrack(t.action)).then(() => {
|
|
19739
19763
|
!this.#g && e === this.#l && this.#e.getSnapshot().canPlay && this.#w();
|
|
@@ -19748,7 +19772,7 @@ var $h = class {
|
|
|
19748
19772
|
#T() {
|
|
19749
19773
|
if (!this.#a.attached) return;
|
|
19750
19774
|
let e = this.#E(this.#a);
|
|
19751
|
-
e !== null && e.value !==
|
|
19775
|
+
e !== null && e.value !== Jh(this.#a) && this.#D([["captions", e.value]], () => this.#e.selectSubtitlesTrack(e.action));
|
|
19752
19776
|
}
|
|
19753
19777
|
#E(e) {
|
|
19754
19778
|
let t = this.#s;
|
|
@@ -19756,13 +19780,13 @@ var $h = class {
|
|
|
19756
19780
|
action: "off",
|
|
19757
19781
|
value: "off"
|
|
19758
19782
|
};
|
|
19759
|
-
let n = e.textTracks.filter(
|
|
19783
|
+
let n = e.textTracks.filter(Yh);
|
|
19760
19784
|
if (n.length === 0) return null;
|
|
19761
19785
|
let r = [
|
|
19762
19786
|
this.#i.captionsLanguage,
|
|
19763
19787
|
t.initialState.captions.language,
|
|
19764
|
-
...
|
|
19765
|
-
].filter((e) => e !== void 0).map((e) => n.find((t) =>
|
|
19788
|
+
...Qh(t.language)
|
|
19789
|
+
].filter((e) => e !== void 0).map((e) => n.find((t) => Zh(t.language, e))).find((e) => e !== void 0) ?? n[0];
|
|
19766
19790
|
return r?.id === void 0 ? null : {
|
|
19767
19791
|
action: r.id,
|
|
19768
19792
|
value: `on:${r.id}:${r.language}`
|
|
@@ -19789,7 +19813,7 @@ var $h = class {
|
|
|
19789
19813
|
});
|
|
19790
19814
|
}
|
|
19791
19815
|
#O(e) {
|
|
19792
|
-
let t =
|
|
19816
|
+
let t = qh({
|
|
19793
19817
|
...this.#i,
|
|
19794
19818
|
...e
|
|
19795
19819
|
});
|
|
@@ -19799,10 +19823,10 @@ var $h = class {
|
|
|
19799
19823
|
for (let e of this.#n) e();
|
|
19800
19824
|
}
|
|
19801
19825
|
};
|
|
19802
|
-
function
|
|
19803
|
-
return new
|
|
19826
|
+
function tg(e, t = $h()) {
|
|
19827
|
+
return new eg(e, t);
|
|
19804
19828
|
}
|
|
19805
|
-
var
|
|
19829
|
+
var ng = 1e4, rg = 1e4, ig = og("idle", null, null), ag = {
|
|
19806
19830
|
idle: { start: "buffering" },
|
|
19807
19831
|
buffering: {
|
|
19808
19832
|
frames: "playing",
|
|
@@ -19817,7 +19841,7 @@ var tg = 1e4, ng = 1e4, rg = ag("idle", null, null), ig = {
|
|
|
19817
19841
|
ended: { replay: "buffering" },
|
|
19818
19842
|
error: { retry: "buffering" }
|
|
19819
19843
|
};
|
|
19820
|
-
function
|
|
19844
|
+
function og(e, t, n) {
|
|
19821
19845
|
return Object.freeze({
|
|
19822
19846
|
playback: e,
|
|
19823
19847
|
errorKind: t,
|
|
@@ -19825,19 +19849,19 @@ function ag(e, t, n) {
|
|
|
19825
19849
|
retryable: e === "error" && t === "media"
|
|
19826
19850
|
});
|
|
19827
19851
|
}
|
|
19828
|
-
function
|
|
19852
|
+
function sg(e) {
|
|
19829
19853
|
return e.error === null ? e.ended ? "ended" : e.started ? e.waiting ? "buffering" : e.paused ? "paused" : "playing" : "idle" : "error";
|
|
19830
19854
|
}
|
|
19831
|
-
function
|
|
19832
|
-
return t === "media-error" || t === "config-error" ? "error" : t === "standalone-update" ? "idle" : t === "feed-update" ? "buffering" :
|
|
19855
|
+
function cg(e, t) {
|
|
19856
|
+
return t === "media-error" || t === "config-error" ? "error" : t === "standalone-update" ? "idle" : t === "feed-update" ? "buffering" : ag[e]?.[t] ?? e;
|
|
19833
19857
|
}
|
|
19834
|
-
function
|
|
19858
|
+
function lg(e) {
|
|
19835
19859
|
return e;
|
|
19836
19860
|
}
|
|
19837
|
-
var
|
|
19861
|
+
var ug = class {
|
|
19838
19862
|
#e;
|
|
19839
19863
|
#t = /* @__PURE__ */ new Set();
|
|
19840
|
-
#n =
|
|
19864
|
+
#n = ig;
|
|
19841
19865
|
#r = null;
|
|
19842
19866
|
#i = null;
|
|
19843
19867
|
#a = "idle";
|
|
@@ -19864,7 +19888,7 @@ var lg = class {
|
|
|
19864
19888
|
subscribe = (e) => this.#_ ? () => void 0 : (this.#t.add(e), () => this.#t.delete(e));
|
|
19865
19889
|
applyEngineSnapshot(e) {
|
|
19866
19890
|
if (this.#_) return;
|
|
19867
|
-
let t = this.#o, n = t !== null && Number.isFinite(e.currentTime) && e.currentTime > t.currentTime, r = t !== null && !t.canPlay && e.canPlay, i =
|
|
19891
|
+
let t = this.#o, n = t !== null && Number.isFinite(e.currentTime) && e.currentTime > t.currentTime, r = t !== null && !t.canPlay && e.canPlay, i = sg(e);
|
|
19868
19892
|
if (this.#o = e, (n || i === "playing") && (this.#c = !0), i === "error") {
|
|
19869
19893
|
if (this.#F(), this.#g) return;
|
|
19870
19894
|
this.#c && this.#a !== "error" ? this.#w(this.#A(e)) : this.#k(this.#A(e, !1));
|
|
@@ -19905,7 +19929,7 @@ var lg = class {
|
|
|
19905
19929
|
}
|
|
19906
19930
|
}
|
|
19907
19931
|
#y(e) {
|
|
19908
|
-
this.#a =
|
|
19932
|
+
this.#a = cg(this.#a, e);
|
|
19909
19933
|
}
|
|
19910
19934
|
#b(e = !1) {
|
|
19911
19935
|
if (this.#a === "buffering") {
|
|
@@ -19922,7 +19946,7 @@ var lg = class {
|
|
|
19922
19946
|
#S(e) {
|
|
19923
19947
|
this.#u === null && (this.#u = setTimeout(() => {
|
|
19924
19948
|
this.#u = null, this.#a === "buffering" && !this.#g && this.#w(this.#A(e));
|
|
19925
|
-
},
|
|
19949
|
+
}, ng));
|
|
19926
19950
|
}
|
|
19927
19951
|
#C(e) {
|
|
19928
19952
|
this.#F(), this.#S(e);
|
|
@@ -19942,7 +19966,7 @@ var lg = class {
|
|
|
19942
19966
|
let t = new AbortController();
|
|
19943
19967
|
this.#p = t, this.#f = setTimeout(() => {
|
|
19944
19968
|
e === this.#m && this.#p === t && (t.abort(), this.#D(e, t));
|
|
19945
|
-
},
|
|
19969
|
+
}, rg);
|
|
19946
19970
|
let n;
|
|
19947
19971
|
try {
|
|
19948
19972
|
n = this.#e(this.#s, t.signal);
|
|
@@ -19975,7 +19999,7 @@ var lg = class {
|
|
|
19975
19999
|
this.#r = e;
|
|
19976
20000
|
}
|
|
19977
20001
|
#M(e) {
|
|
19978
|
-
let t =
|
|
20002
|
+
let t = og(e, this.#r, this.#i);
|
|
19979
20003
|
if (t.playback !== this.#n.playback || t.errorKind !== this.#n.errorKind || t.mediaFailurePhase !== this.#n.mediaFailurePhase) {
|
|
19980
20004
|
this.#n = t;
|
|
19981
20005
|
for (let e of this.#t) e();
|
|
@@ -19997,30 +20021,30 @@ var lg = class {
|
|
|
19997
20021
|
this.#f !== null && (clearTimeout(this.#f), this.#f = null);
|
|
19998
20022
|
}
|
|
19999
20023
|
};
|
|
20000
|
-
function
|
|
20001
|
-
return new
|
|
20024
|
+
function dg(e) {
|
|
20025
|
+
return new ug(e);
|
|
20002
20026
|
}
|
|
20003
20027
|
//#endregion
|
|
20004
20028
|
//#region src/core/player-state-context.tsx
|
|
20005
|
-
var
|
|
20006
|
-
function
|
|
20007
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
20029
|
+
var fg = (0, w.createContext)(null);
|
|
20030
|
+
function pg({ children: e, controller: t }) {
|
|
20031
|
+
return /* @__PURE__ */ (0, M.jsx)(fg, {
|
|
20008
20032
|
value: t,
|
|
20009
20033
|
children: e
|
|
20010
20034
|
});
|
|
20011
20035
|
}
|
|
20012
|
-
function
|
|
20013
|
-
let e = (0, w.useContext)(
|
|
20036
|
+
function mg() {
|
|
20037
|
+
let e = (0, w.useContext)(fg);
|
|
20014
20038
|
if (e === null) throw Error("usePlayerStateController must be used within PlayerStateProvider");
|
|
20015
20039
|
return e;
|
|
20016
20040
|
}
|
|
20017
|
-
function
|
|
20018
|
-
let e =
|
|
20019
|
-
return Dt(e.subscribe, e.getSnapshot,
|
|
20041
|
+
function hg() {
|
|
20042
|
+
let e = mg();
|
|
20043
|
+
return Dt(e.subscribe, e.getSnapshot, lg, Object.is);
|
|
20020
20044
|
}
|
|
20021
20045
|
//#endregion
|
|
20022
20046
|
//#region src/core/identity.tsx
|
|
20023
|
-
function
|
|
20047
|
+
function gg({ author: e, hidden: t = !1, surface: n, title: r }) {
|
|
20024
20048
|
if (e === void 0 && r === void 0) return null;
|
|
20025
20049
|
let i = n === "cover", a = !i && t;
|
|
20026
20050
|
return /* @__PURE__ */ (0, M.jsxs)("span", {
|
|
@@ -20044,7 +20068,7 @@ function hg({ author: e, hidden: t = !1, surface: n, title: r }) {
|
|
|
20044
20068
|
}
|
|
20045
20069
|
//#endregion
|
|
20046
20070
|
//#region src/core/cover.tsx
|
|
20047
|
-
function
|
|
20071
|
+
function _g(e, t) {
|
|
20048
20072
|
let n = (0, w.useRef)({
|
|
20049
20073
|
generation: t,
|
|
20050
20074
|
hasPlayed: !1,
|
|
@@ -20062,14 +20086,14 @@ function gg(e, t) {
|
|
|
20062
20086
|
"ended"
|
|
20063
20087
|
].includes(e) && (r.hasPlayed = !0), !r.hasPlayed;
|
|
20064
20088
|
}
|
|
20065
|
-
function
|
|
20066
|
-
let r =
|
|
20089
|
+
function vg(e, t, n) {
|
|
20090
|
+
let r = _g(e, t), i = n && r;
|
|
20067
20091
|
return {
|
|
20068
20092
|
chromeVisible: !n || !i,
|
|
20069
20093
|
coverVisible: i
|
|
20070
20094
|
};
|
|
20071
20095
|
}
|
|
20072
|
-
function
|
|
20096
|
+
function yg({ author: e, buttonEnabled: t, buttonLabel: n, imageEnabled: r, layout: i, onPlay: a, playback: o, poster: s, title: c, visible: l, visibleButtonLabel: u }) {
|
|
20073
20097
|
let [d, f] = (0, w.useState)(!1), p = (0, w.useRef)(!1), m = (0, w.useRef)(o);
|
|
20074
20098
|
return m.current = o, l ? /* @__PURE__ */ (0, M.jsxs)("button", {
|
|
20075
20099
|
"aria-disabled": d || o === "buffering" || void 0,
|
|
@@ -20092,7 +20116,7 @@ function vg({ author: e, buttonEnabled: t, buttonLabel: n, imageEnabled: r, layo
|
|
|
20092
20116
|
className: "ltp-cover__poster",
|
|
20093
20117
|
src: s
|
|
20094
20118
|
}) : null,
|
|
20095
|
-
/* @__PURE__ */ (0, M.jsx)(
|
|
20119
|
+
/* @__PURE__ */ (0, M.jsx)(gg, {
|
|
20096
20120
|
author: e,
|
|
20097
20121
|
surface: "cover",
|
|
20098
20122
|
title: c
|
|
@@ -20114,13 +20138,13 @@ function vg({ author: e, buttonEnabled: t, buttonLabel: n, imageEnabled: r, layo
|
|
|
20114
20138
|
}
|
|
20115
20139
|
//#endregion
|
|
20116
20140
|
//#region src/core/control-visibility.ts
|
|
20117
|
-
var
|
|
20118
|
-
function
|
|
20141
|
+
var bg = 3e3, xg = 2e3, Sg = Object.freeze({ visible: !0 }), Cg = Object.freeze({ visible: !1 });
|
|
20142
|
+
function wg(e) {
|
|
20119
20143
|
return e !== null && e.layout === "landscape" && e.playback === "playing" && !e.configurationError;
|
|
20120
20144
|
}
|
|
20121
|
-
function
|
|
20122
|
-
let e = null, t = !1, n = Date.now(), r =
|
|
20123
|
-
let t = e ?
|
|
20145
|
+
function Tg() {
|
|
20146
|
+
let e = null, t = !1, n = Date.now(), r = Sg, i = null, a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
20147
|
+
let t = e ? Sg : Cg;
|
|
20124
20148
|
if (r !== t) {
|
|
20125
20149
|
r = t;
|
|
20126
20150
|
for (let e of a) e();
|
|
@@ -20128,10 +20152,10 @@ function wg() {
|
|
|
20128
20152
|
}, c = () => {
|
|
20129
20153
|
i !== null && (clearTimeout(i), i = null);
|
|
20130
20154
|
}, l = () => e !== null && (e.engine.userActive || e.engine.controlsVisible), u = () => {
|
|
20131
|
-
if (c(), !
|
|
20132
|
-
let r = Math.max(0, n +
|
|
20155
|
+
if (c(), !wg(e) || o.size > 0) return;
|
|
20156
|
+
let r = Math.max(0, n + bg - Date.now());
|
|
20133
20157
|
i = setTimeout(() => {
|
|
20134
|
-
i = null, !t &&
|
|
20158
|
+
i = null, !t && wg(e) && o.size === 0 && !l() && s(!1);
|
|
20135
20159
|
}, r);
|
|
20136
20160
|
}, d = () => {
|
|
20137
20161
|
t || e?.layout === "portrait" || (n = Date.now(), s(!0), u());
|
|
@@ -20139,12 +20163,12 @@ function wg() {
|
|
|
20139
20163
|
return Object.freeze({
|
|
20140
20164
|
apply(r) {
|
|
20141
20165
|
if (t) return;
|
|
20142
|
-
let i = e, a = i?.generation !== r.generation, f =
|
|
20166
|
+
let i = e, a = i?.generation !== r.generation, f = wg(r) && !wg(i), p = i !== null && !i.engine.userActive && r.engine.userActive, m = i !== null && i.engine.userActive && !r.engine.userActive && !r.engine.controlsVisible;
|
|
20143
20167
|
if (e = r, a || r.layout === "portrait") {
|
|
20144
|
-
n = Date.now(), c(), s(!0), r.layout === "landscape" &&
|
|
20168
|
+
n = Date.now(), c(), s(!0), r.layout === "landscape" && wg(r) && u();
|
|
20145
20169
|
return;
|
|
20146
20170
|
}
|
|
20147
|
-
if (!
|
|
20171
|
+
if (!wg(r)) {
|
|
20148
20172
|
c(), s(!0);
|
|
20149
20173
|
return;
|
|
20150
20174
|
}
|
|
@@ -20152,7 +20176,7 @@ function wg() {
|
|
|
20152
20176
|
d();
|
|
20153
20177
|
return;
|
|
20154
20178
|
}
|
|
20155
|
-
if (m && (n = Math.max(n, Date.now() -
|
|
20179
|
+
if (m && (n = Math.max(n, Date.now() - xg)), o.size > 0 || l()) {
|
|
20156
20180
|
c(), s(!0);
|
|
20157
20181
|
return;
|
|
20158
20182
|
}
|
|
@@ -20177,7 +20201,7 @@ function wg() {
|
|
|
20177
20201
|
},
|
|
20178
20202
|
setGestureVisibility(n) {
|
|
20179
20203
|
if (!(t || e?.layout === "portrait")) {
|
|
20180
|
-
if (n || !
|
|
20204
|
+
if (n || !wg(e) || o.size > 0) {
|
|
20181
20205
|
d();
|
|
20182
20206
|
return;
|
|
20183
20207
|
}
|
|
@@ -20191,40 +20215,40 @@ function wg() {
|
|
|
20191
20215
|
}
|
|
20192
20216
|
//#endregion
|
|
20193
20217
|
//#region src/core/control-visibility-context.tsx
|
|
20194
|
-
var
|
|
20195
|
-
function
|
|
20196
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
20218
|
+
var Eg = (0, w.createContext)(null);
|
|
20219
|
+
function Dg({ children: e, controller: t }) {
|
|
20220
|
+
return /* @__PURE__ */ (0, M.jsx)(Eg, {
|
|
20197
20221
|
value: t,
|
|
20198
20222
|
children: e
|
|
20199
20223
|
});
|
|
20200
20224
|
}
|
|
20201
|
-
function
|
|
20202
|
-
let e = (0, w.useContext)(
|
|
20225
|
+
function Og() {
|
|
20226
|
+
let e = (0, w.useContext)(Eg);
|
|
20203
20227
|
if (e === null) throw Error("Control visibility hooks must be used within ControlVisibilityProvider");
|
|
20204
20228
|
return e;
|
|
20205
20229
|
}
|
|
20206
|
-
function
|
|
20207
|
-
let e =
|
|
20230
|
+
function kg() {
|
|
20231
|
+
let e = Og();
|
|
20208
20232
|
return (0, w.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getSnapshot);
|
|
20209
20233
|
}
|
|
20210
|
-
function
|
|
20211
|
-
let t =
|
|
20234
|
+
function Ag(e) {
|
|
20235
|
+
let t = Og();
|
|
20212
20236
|
(0, w.useEffect)(() => {
|
|
20213
20237
|
if (e) return t.requestControlsLock();
|
|
20214
20238
|
}, [e, t]);
|
|
20215
20239
|
}
|
|
20216
|
-
var
|
|
20217
|
-
function Mg(e) {
|
|
20218
|
-
return e instanceof Element ? e.closest(Ag) : null;
|
|
20219
|
-
}
|
|
20240
|
+
var jg = "[data-ltp-control-visibility-lock]", Mg = "button, input, select, textarea, [role=\"button\"], [tabindex]:not([tabindex=\"-1\"])";
|
|
20220
20241
|
function Ng(e) {
|
|
20221
|
-
return e instanceof
|
|
20242
|
+
return e instanceof Element ? e.closest(jg) : null;
|
|
20243
|
+
}
|
|
20244
|
+
function Pg(e) {
|
|
20245
|
+
return e instanceof HTMLElement && e.matches(Mg) && e.closest(jg) !== null && e.matches(":focus-visible");
|
|
20222
20246
|
}
|
|
20223
|
-
function
|
|
20224
|
-
let t =
|
|
20247
|
+
function Fg(e = !0) {
|
|
20248
|
+
let t = Og(), n = (0, w.useRef)(null), r = (0, w.useRef)(null), i = (0, w.useRef)(null), a = (0, w.useRef)(/* @__PURE__ */ new Map()), o = (0, w.useRef)(/* @__PURE__ */ new Set()), s = (0, w.useCallback)(() => {
|
|
20225
20249
|
n.current?.(), n.current = null;
|
|
20226
20250
|
}, []), c = (0, w.useCallback)((e) => {
|
|
20227
|
-
!
|
|
20251
|
+
!Pg(e) || n.current !== null || (n.current = t.requestControlsLock());
|
|
20228
20252
|
}, [t]), l = (0, w.useCallback)(() => {
|
|
20229
20253
|
i.current?.(), i.current = null, r.current = null;
|
|
20230
20254
|
}, []), u = (0, w.useCallback)((e) => {
|
|
@@ -20250,10 +20274,10 @@ function Pg(e = !0) {
|
|
|
20250
20274
|
}, [e]), {
|
|
20251
20275
|
onBlurCapture(e) {
|
|
20252
20276
|
let t = e.relatedTarget;
|
|
20253
|
-
|
|
20277
|
+
Pg(t) || s();
|
|
20254
20278
|
},
|
|
20255
20279
|
onFocusCapture(e) {
|
|
20256
|
-
c(e.target),
|
|
20280
|
+
c(e.target), Pg(e.target) && t.noteInteraction();
|
|
20257
20281
|
},
|
|
20258
20282
|
onKeyDownCapture(e) {
|
|
20259
20283
|
t.noteInteraction(), c(e.target);
|
|
@@ -20262,18 +20286,18 @@ function Pg(e = !0) {
|
|
|
20262
20286
|
u(e.pointerId);
|
|
20263
20287
|
},
|
|
20264
20288
|
onPointerDownCapture(n) {
|
|
20265
|
-
s(), n.pointerType === "mouse" && t.noteInteraction(), !(n.pointerType !== "touch" || !e || !t.getSnapshot().visible ||
|
|
20289
|
+
s(), n.pointerType === "mouse" && t.noteInteraction(), !(n.pointerType !== "touch" || !e || !t.getSnapshot().visible || Ng(n.target) === null) && (a.current.has(n.pointerId) || a.current.set(n.pointerId, t.requestControlsLock()));
|
|
20266
20290
|
},
|
|
20267
20291
|
onPointerMoveCapture(e) {
|
|
20268
20292
|
e.pointerType === "mouse" && t.noteInteraction();
|
|
20269
20293
|
},
|
|
20270
20294
|
onPointerOutCapture(e) {
|
|
20271
|
-
let t =
|
|
20295
|
+
let t = Ng(e.target), n = Ng(e.relatedTarget);
|
|
20272
20296
|
t !== null && t === r.current && t !== n && l();
|
|
20273
20297
|
},
|
|
20274
20298
|
onPointerOverCapture(e) {
|
|
20275
20299
|
if (e.pointerType !== "mouse" && e.pointerType !== "pen") return;
|
|
20276
|
-
let n =
|
|
20300
|
+
let n = Ng(e.target);
|
|
20277
20301
|
n !== null && n !== r.current && (l(), r.current = n, i.current = t.requestControlsLock());
|
|
20278
20302
|
},
|
|
20279
20303
|
onPointerUpCapture(n) {
|
|
@@ -20283,12 +20307,12 @@ function Pg(e = !0) {
|
|
|
20283
20307
|
}
|
|
20284
20308
|
//#endregion
|
|
20285
20309
|
//#region src/core/input-bindings.tsx
|
|
20286
|
-
var
|
|
20287
|
-
function
|
|
20288
|
-
let r = Vt(), i = Rt(), a =
|
|
20310
|
+
var Ig = .05;
|
|
20311
|
+
function Lg({ disabled: e, layout: t, policy: n }) {
|
|
20312
|
+
let r = Vt(), i = Rt(), a = nh(), { toggle: o } = Qf(), s = Hf(), c = Og(), l = a.getModule("chapters"), u = a.getModule("share"), d = a.getModule("contextPanel"), f = (0, w.useSyncExternalStore)(u.subscribeInteraction, u.getInteractionSnapshot, u.getInteractionSnapshot).open, p = (0, w.useSyncExternalStore)(d.subscribeInteraction, d.getInteractionSnapshot, d.getInteractionSnapshot).view;
|
|
20289
20313
|
return (0, w.useEffect)(() => {
|
|
20290
20314
|
if (r === null) return;
|
|
20291
|
-
let a = [], m = n.hotkeys && !e, h = n.gestures && !e, g = (e, t, r) =>
|
|
20315
|
+
let a = [], m = n.hotkeys && !e, h = n.gestures && !e, g = (e, t, r) => Rg(i, e, t, r, n.speedOptions, (e) => s.setPlaybackRate(e), e === "toggleControls" ? c.setGestureVisibility : void 0), _ = (e, t, n, i) => {
|
|
20292
20316
|
!m || !n || a.push(ki(r, {
|
|
20293
20317
|
action: t,
|
|
20294
20318
|
keys: e,
|
|
@@ -20297,7 +20321,7 @@ function Ig({ disabled: e, layout: t, policy: n }) {
|
|
|
20297
20321
|
onActivate: (e, n) => g(t, i, n)
|
|
20298
20322
|
}));
|
|
20299
20323
|
};
|
|
20300
|
-
_("Space", "togglePaused", n.playPause), _("k", "togglePaused", n.playPause), _("ArrowLeft", "seekStep", n.seek, -n.seekStep), _("j", "seekStep", n.seek, -n.seekStep), _("ArrowRight", "seekStep", n.seek, n.seekStep), _("l", "seekStep", n.seek, n.seekStep), _("ArrowUp", "volumeStep", n.volume,
|
|
20324
|
+
_("Space", "togglePaused", n.playPause), _("k", "togglePaused", n.playPause), _("ArrowLeft", "seekStep", n.seek, -n.seekStep), _("j", "seekStep", n.seek, -n.seekStep), _("ArrowRight", "seekStep", n.seek, n.seekStep), _("l", "seekStep", n.seek, n.seekStep), _("ArrowUp", "volumeStep", n.volume, Ig), _("ArrowDown", "volumeStep", n.volume, -.05), _("m", "toggleMuted", n.volume), _("f", "toggleFullscreen", n.fullscreen), m && n.captions && a.push(ki(r, {
|
|
20301
20325
|
action: "toggleSubtitles",
|
|
20302
20326
|
keys: "c",
|
|
20303
20327
|
repeatable: !1,
|
|
@@ -20345,7 +20369,7 @@ function Ig({ disabled: e, layout: t, policy: n }) {
|
|
|
20345
20369
|
s
|
|
20346
20370
|
]), null;
|
|
20347
20371
|
}
|
|
20348
|
-
function
|
|
20372
|
+
function Rg(e, t, n, r, i = [], a = () => void 0, o) {
|
|
20349
20373
|
if (t.startsWith("toggle")) {
|
|
20350
20374
|
let n = e.state[t];
|
|
20351
20375
|
if (typeof n == "function") {
|
|
@@ -20361,7 +20385,7 @@ function Lg(e, t, n, r, i = [], a = () => void 0, o) {
|
|
|
20361
20385
|
} else if (t === "speedUp" || t === "speedDown") {
|
|
20362
20386
|
let n = oi(e.state);
|
|
20363
20387
|
if (!n) return;
|
|
20364
|
-
let r =
|
|
20388
|
+
let r = dp(i, n.playbackRate, t === "speedUp" ? "forward" : "backward");
|
|
20365
20389
|
r !== null && a(r);
|
|
20366
20390
|
} else if (t === "seekToPercent") {
|
|
20367
20391
|
let t = ci(e.state), i = n ?? (r !== void 0 && r >= "0" && r <= "9" ? Number(r) * 10 : void 0);
|
|
@@ -20370,7 +20394,7 @@ function Lg(e, t, n, r, i = [], a = () => void 0, o) {
|
|
|
20370
20394
|
}
|
|
20371
20395
|
//#endregion
|
|
20372
20396
|
//#region src/core/media-session.ts
|
|
20373
|
-
var
|
|
20397
|
+
var zg = [
|
|
20374
20398
|
"play",
|
|
20375
20399
|
"pause",
|
|
20376
20400
|
"seekbackward",
|
|
@@ -20379,31 +20403,31 @@ var Rg = [
|
|
|
20379
20403
|
"previoustrack",
|
|
20380
20404
|
"nexttrack"
|
|
20381
20405
|
];
|
|
20382
|
-
function
|
|
20406
|
+
function Bg() {
|
|
20383
20407
|
return typeof navigator > "u" || !("mediaSession" in navigator) ? null : navigator.mediaSession;
|
|
20384
20408
|
}
|
|
20385
|
-
function
|
|
20409
|
+
function Vg(e) {
|
|
20386
20410
|
return e.configurationError || e.playback === "error";
|
|
20387
20411
|
}
|
|
20388
|
-
function
|
|
20412
|
+
function Hg(e, t, n) {
|
|
20389
20413
|
try {
|
|
20390
20414
|
e.setActionHandler(t, n);
|
|
20391
20415
|
} catch {}
|
|
20392
20416
|
}
|
|
20393
|
-
function Hg(e) {
|
|
20394
|
-
for (let t of Rg) Vg(e, t, null);
|
|
20395
|
-
}
|
|
20396
20417
|
function Ug(e) {
|
|
20418
|
+
for (let t of zg) Hg(e, t, null);
|
|
20419
|
+
}
|
|
20420
|
+
function Wg(e) {
|
|
20397
20421
|
try {
|
|
20398
20422
|
e.setPositionState();
|
|
20399
20423
|
} catch {}
|
|
20400
20424
|
}
|
|
20401
|
-
function
|
|
20425
|
+
function Gg(e, t) {
|
|
20402
20426
|
try {
|
|
20403
20427
|
e.playbackState = t;
|
|
20404
20428
|
} catch {}
|
|
20405
20429
|
}
|
|
20406
|
-
function
|
|
20430
|
+
function Kg(e, t) {
|
|
20407
20431
|
if (typeof MediaMetadata > "u") {
|
|
20408
20432
|
try {
|
|
20409
20433
|
e.metadata = null;
|
|
@@ -20425,9 +20449,9 @@ function Gg(e, t) {
|
|
|
20425
20449
|
} catch {}
|
|
20426
20450
|
}
|
|
20427
20451
|
}
|
|
20428
|
-
function
|
|
20452
|
+
function qg(e, t) {
|
|
20429
20453
|
if (!Number.isFinite(t.duration) || t.duration <= 0 || !Number.isFinite(t.currentTime) || !Number.isFinite(t.playbackRate) || t.playbackRate <= 0) {
|
|
20430
|
-
|
|
20454
|
+
Wg(e);
|
|
20431
20455
|
return;
|
|
20432
20456
|
}
|
|
20433
20457
|
try {
|
|
@@ -20437,10 +20461,10 @@ function Kg(e, t) {
|
|
|
20437
20461
|
position: Math.min(t.duration, Math.max(0, t.currentTime))
|
|
20438
20462
|
});
|
|
20439
20463
|
} catch {
|
|
20440
|
-
|
|
20464
|
+
Wg(e);
|
|
20441
20465
|
}
|
|
20442
20466
|
}
|
|
20443
|
-
var
|
|
20467
|
+
var Jg = new class {
|
|
20444
20468
|
#e = [];
|
|
20445
20469
|
#t = null;
|
|
20446
20470
|
#n = null;
|
|
@@ -20453,7 +20477,7 @@ var qg = new class {
|
|
|
20453
20477
|
commands: t,
|
|
20454
20478
|
snapshot: e,
|
|
20455
20479
|
activity: 0,
|
|
20456
|
-
eligible: !
|
|
20480
|
+
eligible: !Vg(e),
|
|
20457
20481
|
destroyed: !1
|
|
20458
20482
|
};
|
|
20459
20483
|
return this.#e.push(n), (this.#t === null || !this.#t.eligible) && (this.#t = n.eligible ? n : this.#t), e.playback === "playing" && n.eligible ? this.#c(n) : this.#t === n && this.#u(n), {
|
|
@@ -20467,7 +20491,7 @@ var qg = new class {
|
|
|
20467
20491
|
#o(e, t) {
|
|
20468
20492
|
if (e.destroyed) return;
|
|
20469
20493
|
let n = e.snapshot.playback === "playing", r = e.eligible;
|
|
20470
|
-
if (e.snapshot = t, e.eligible = !
|
|
20494
|
+
if (e.snapshot = t, e.eligible = !Vg(t), e.eligible && t.playback === "playing" && (!n || !r)) {
|
|
20471
20495
|
this.#c(e);
|
|
20472
20496
|
return;
|
|
20473
20497
|
}
|
|
@@ -20491,37 +20515,37 @@ var qg = new class {
|
|
|
20491
20515
|
return t.length === 0 ? null : t.reduce((e, t) => t.activity === e.activity ? t.id < e.id ? t : e : t.activity > e.activity ? t : e);
|
|
20492
20516
|
}
|
|
20493
20517
|
#u(e) {
|
|
20494
|
-
let t =
|
|
20518
|
+
let t = Bg();
|
|
20495
20519
|
if (t === null) return;
|
|
20496
|
-
let n = e.snapshot, r = this.#r, i = this.#n !== e, a = r === null ||
|
|
20497
|
-
if (o &&
|
|
20498
|
-
|
|
20520
|
+
let n = e.snapshot, r = this.#r, i = this.#n !== e, a = r === null || Vg(r) !== !e.eligible, o = i || r === null || r.title !== n.title || r.artist !== n.artist || r.poster !== n.poster, s = i || a || r === null || r.playPauseEnabled !== n.playPauseEnabled || r.timelineEnabled !== n.timelineEnabled;
|
|
20521
|
+
if (o && Kg(t, n), s && Ug(t), !e.eligible) {
|
|
20522
|
+
Wg(t), Gg(t, "none"), this.#n = e, this.#r = n;
|
|
20499
20523
|
return;
|
|
20500
20524
|
}
|
|
20501
|
-
s && n.playPauseEnabled && (
|
|
20525
|
+
s && n.playPauseEnabled && (Hg(t, "play", () => e.commands.play()), Hg(t, "pause", () => e.commands.pause())), s && n.timelineEnabled && (Hg(t, "seekbackward", () => {
|
|
20502
20526
|
e.commands.seek(e.snapshot.currentTime - e.snapshot.seekStep);
|
|
20503
|
-
}),
|
|
20527
|
+
}), Hg(t, "seekforward", () => {
|
|
20504
20528
|
e.commands.seek(e.snapshot.currentTime + e.snapshot.seekStep);
|
|
20505
|
-
}),
|
|
20529
|
+
}), Hg(t, "seekto", (t) => {
|
|
20506
20530
|
"seekTime" in t && typeof t.seekTime == "number" && Number.isFinite(t.seekTime) && e.commands.seek(t.seekTime);
|
|
20507
|
-
})), s && e.commands.previousTrack !== void 0 &&
|
|
20531
|
+
})), s && e.commands.previousTrack !== void 0 && Hg(t, "previoustrack", e.commands.previousTrack), s && e.commands.nextTrack !== void 0 && Hg(t, "nexttrack", e.commands.nextTrack), Gg(t, n.paused ? "paused" : "playing"), qg(t, n), this.#n = e, this.#r = n;
|
|
20508
20532
|
}
|
|
20509
20533
|
#d() {
|
|
20510
|
-
let e =
|
|
20534
|
+
let e = Bg();
|
|
20511
20535
|
if (e !== null) {
|
|
20512
|
-
|
|
20536
|
+
Ug(e), Wg(e), Gg(e, "none"), this.#n = null, this.#r = null;
|
|
20513
20537
|
try {
|
|
20514
20538
|
e.metadata = null;
|
|
20515
20539
|
} catch {}
|
|
20516
20540
|
}
|
|
20517
20541
|
}
|
|
20518
20542
|
}();
|
|
20519
|
-
function
|
|
20520
|
-
return
|
|
20543
|
+
function Yg(e, t) {
|
|
20544
|
+
return Jg.create(e, t);
|
|
20521
20545
|
}
|
|
20522
20546
|
//#endregion
|
|
20523
20547
|
//#region src/core/state-presentations.tsx
|
|
20524
|
-
function
|
|
20548
|
+
function Xg({ kind: e, message: t, onRetry: n, retryLabel: r }) {
|
|
20525
20549
|
return /* @__PURE__ */ (0, M.jsxs)("div", {
|
|
20526
20550
|
className: e === "configuration" ? "ltp-state-error ltp-state-error--configuration ltp-configuration-error" : "ltp-state-error ltp-state-error--media",
|
|
20527
20551
|
"data-ltp-error-presentation": e,
|
|
@@ -20537,15 +20561,15 @@ function Yg({ kind: e, message: t, onRetry: n, retryLabel: r }) {
|
|
|
20537
20561
|
}) : null]
|
|
20538
20562
|
});
|
|
20539
20563
|
}
|
|
20540
|
-
function
|
|
20541
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
20564
|
+
function Zg({ message: e }) {
|
|
20565
|
+
return /* @__PURE__ */ (0, M.jsx)(Xg, {
|
|
20542
20566
|
kind: "configuration",
|
|
20543
20567
|
message: e
|
|
20544
20568
|
});
|
|
20545
20569
|
}
|
|
20546
|
-
function
|
|
20547
|
-
let e =
|
|
20548
|
-
return e.playback !== "error" || e.errorKind !== "media" ? null : /* @__PURE__ */ (0, M.jsx)(
|
|
20570
|
+
function Qg() {
|
|
20571
|
+
let e = hg(), t = mg(), n = qd("mediaErrorMessage"), r = qd("retry");
|
|
20572
|
+
return e.playback !== "error" || e.errorKind !== "media" ? null : /* @__PURE__ */ (0, M.jsx)(Xg, {
|
|
20549
20573
|
kind: "media",
|
|
20550
20574
|
message: n,
|
|
20551
20575
|
onRetry: e.retryable ? () => t.retryMediaError() : void 0,
|
|
@@ -20554,17 +20578,17 @@ function Zg() {
|
|
|
20554
20578
|
}
|
|
20555
20579
|
//#endregion
|
|
20556
20580
|
//#region src/core/adaptive-video.tsx
|
|
20557
|
-
var
|
|
20581
|
+
var $g = "application/vnd.apple.mpegurl", e_ = /* @__PURE__ */ new Set(["application/x-mpegurl", $g]), t_ = [
|
|
20558
20582
|
0,
|
|
20559
20583
|
50,
|
|
20560
20584
|
200,
|
|
20561
20585
|
500
|
|
20562
|
-
],
|
|
20586
|
+
], n_ = Object.freeze({
|
|
20563
20587
|
enableWebVTT: !1,
|
|
20564
20588
|
enableCEA708Captions: !1,
|
|
20565
20589
|
renderTextTracksNatively: !1
|
|
20566
20590
|
});
|
|
20567
|
-
function
|
|
20591
|
+
function r_() {
|
|
20568
20592
|
let e = !1, t = null;
|
|
20569
20593
|
return {
|
|
20570
20594
|
begin() {
|
|
@@ -20598,11 +20622,11 @@ function n_() {
|
|
|
20598
20622
|
}
|
|
20599
20623
|
};
|
|
20600
20624
|
}
|
|
20601
|
-
function r_(e) {
|
|
20602
|
-
return e !== void 0 && $g.has(e.toLowerCase());
|
|
20603
|
-
}
|
|
20604
20625
|
function i_(e) {
|
|
20605
|
-
return e
|
|
20626
|
+
return e !== void 0 && e_.has(e.toLowerCase());
|
|
20627
|
+
}
|
|
20628
|
+
function a_(e) {
|
|
20629
|
+
return e.findIndex((e) => i_(e.type)) === 0 ? {
|
|
20606
20630
|
kind: "hls",
|
|
20607
20631
|
source: e[0]
|
|
20608
20632
|
} : {
|
|
@@ -20610,23 +20634,23 @@ function i_(e) {
|
|
|
20610
20634
|
sources: e
|
|
20611
20635
|
};
|
|
20612
20636
|
}
|
|
20613
|
-
function
|
|
20637
|
+
function o_(e, t) {
|
|
20614
20638
|
return e.src === t.src && e.type === t.type;
|
|
20615
20639
|
}
|
|
20616
|
-
function
|
|
20617
|
-
return e.kind === t.kind ? e.kind === "hls" && t.kind === "hls" ?
|
|
20640
|
+
function s_(e, t) {
|
|
20641
|
+
return e.kind === t.kind ? e.kind === "hls" && t.kind === "hls" ? o_(e.source, t.source) : e.kind !== "native" || t.kind !== "native" ? !1 : e.sources.length === t.sources.length && e.sources.every((e, n) => o_(e, t.sources[n])) : !1;
|
|
20618
20642
|
}
|
|
20619
|
-
function
|
|
20620
|
-
let t = (0, w.useRef)(
|
|
20621
|
-
return
|
|
20643
|
+
function c_(e) {
|
|
20644
|
+
let t = (0, w.useRef)(a_(e)), n = a_(e);
|
|
20645
|
+
return s_(t.current, n) || (t.current = n), t.current;
|
|
20622
20646
|
}
|
|
20623
|
-
function
|
|
20624
|
-
return typeof document > "u" || typeof navigator > "u" || !/apple/i.test(navigator.vendor) ? !1 : document.createElement("video").canPlayType(
|
|
20647
|
+
function l_() {
|
|
20648
|
+
return typeof document > "u" || typeof navigator > "u" || !/apple/i.test(navigator.vendor) ? !1 : document.createElement("video").canPlayType($g) !== "";
|
|
20625
20649
|
}
|
|
20626
|
-
function
|
|
20627
|
-
let o = Ut(), s = (0, w.useRef)(null), c = (0, w.useRef)(null), l = (0, w.useRef)(null), u = (0, w.useRef)(0), d = (0, w.useRef)(null), f = (0, w.useRef)(0), p = (0, w.useRef)(/* @__PURE__ */ new Set()), m = (0, w.useRef)(null), h = (0, w.useRef)(null), g = (0, w.useRef)(null), _ =
|
|
20650
|
+
function u_({ children: e, intentQueue: t, mediaRef: n, onNativeSourceErrorChange: r, sources: i, ...a }) {
|
|
20651
|
+
let o = Ut(), s = (0, w.useRef)(null), c = (0, w.useRef)(null), l = (0, w.useRef)(null), u = (0, w.useRef)(0), d = (0, w.useRef)(null), f = (0, w.useRef)(0), p = (0, w.useRef)(/* @__PURE__ */ new Set()), m = (0, w.useRef)(null), h = (0, w.useRef)(null), g = (0, w.useRef)(null), _ = c_(i);
|
|
20628
20652
|
d.current !== _ && (d.current = _, f.current += 1, p.current.clear(), m.current = null);
|
|
20629
|
-
let v = f.current, y = _.kind === "hls" &&
|
|
20653
|
+
let v = f.current, y = _.kind === "hls" && l_(), b = _.kind === "hls" && !y, x = (0, w.useCallback)((e) => {
|
|
20630
20654
|
if (s.current = e, e === null) {
|
|
20631
20655
|
o?.(null);
|
|
20632
20656
|
return;
|
|
@@ -20649,9 +20673,9 @@ function l_({ children: e, intentQueue: t, mediaRef: n, onNativeSourceErrorChang
|
|
|
20649
20673
|
let s = c.current ?? new i();
|
|
20650
20674
|
c.current = s, l.current !== s && (s.attach(e), l.current = s), s.preload = a.preload === "" || a.preload === "none" || a.preload === "auto" || a.preload === "metadata" ? a.preload : "metadata", o?.(s), s.source = {
|
|
20651
20675
|
src: _.source.src,
|
|
20652
|
-
type:
|
|
20676
|
+
type: $g,
|
|
20653
20677
|
preferPlayback: "mse",
|
|
20654
|
-
engine: { hlsJs:
|
|
20678
|
+
engine: { hlsJs: n_ }
|
|
20655
20679
|
}, queueMicrotask(() => {
|
|
20656
20680
|
!r && n === u.current && t?.finish(s);
|
|
20657
20681
|
});
|
|
@@ -20690,7 +20714,7 @@ function l_({ children: e, intentQueue: t, mediaRef: n, onNativeSourceErrorChang
|
|
|
20690
20714
|
m.current = e, r?.(/* @__PURE__ */ Error("No authored native media source could be loaded"));
|
|
20691
20715
|
return;
|
|
20692
20716
|
}
|
|
20693
|
-
let a =
|
|
20717
|
+
let a = t_[t];
|
|
20694
20718
|
t += 1, a !== void 0 && (g.current = setTimeout(n, a));
|
|
20695
20719
|
};
|
|
20696
20720
|
queueMicrotask(n);
|
|
@@ -20717,18 +20741,18 @@ function l_({ children: e, intentQueue: t, mediaRef: n, onNativeSourceErrorChang
|
|
|
20717
20741
|
}
|
|
20718
20742
|
//#endregion
|
|
20719
20743
|
//#region src/core/media-engine.tsx
|
|
20720
|
-
function
|
|
20744
|
+
function d_(e) {
|
|
20721
20745
|
return !e || typeof navigator < "u" && /\bFirefox\//u.test(navigator.userAgent);
|
|
20722
20746
|
}
|
|
20723
|
-
function
|
|
20747
|
+
function f_(...e) {
|
|
20724
20748
|
return e;
|
|
20725
20749
|
}
|
|
20726
|
-
var { Player:
|
|
20727
|
-
features:
|
|
20750
|
+
var { Player: p_, usePlayer: m_ } = yc({
|
|
20751
|
+
features: f_(pr, hr, Nr, jr, Sr, wn, tr, Mi, fr, Vn, kr, Un, dr),
|
|
20728
20752
|
displayName: "LTMediaEnginePlayer"
|
|
20729
|
-
}),
|
|
20730
|
-
function
|
|
20731
|
-
let n =
|
|
20753
|
+
}), h_ = N(pr), g_ = N(Sr), __ = N(Un), v_ = N(jr), y_ = N(Nr), b_ = N(hr), x_ = N(kr), S_ = N(fr), C_ = N(Vn), w_ = N(dr);
|
|
20754
|
+
function T_(e, t = null) {
|
|
20755
|
+
let n = h_(e), r = g_(e), i = __(e), a = v_(e);
|
|
20732
20756
|
if (n === void 0 || r === void 0 || i === void 0 || a === void 0) throw Error("The LT media engine state features are not configured");
|
|
20733
20757
|
return {
|
|
20734
20758
|
paused: n.paused,
|
|
@@ -20741,10 +20765,10 @@ function w_(e, t = null) {
|
|
|
20741
20765
|
currentTime: a.currentTime
|
|
20742
20766
|
};
|
|
20743
20767
|
}
|
|
20744
|
-
function
|
|
20745
|
-
let a =
|
|
20768
|
+
function E_({ children: e, clearNativeSourceError: t, mediaRef: n, nativeSourceError: r = null, userStateSession: i }) {
|
|
20769
|
+
let a = m_(), o = Dt((e) => a.subscribe(e), () => a.state, (0, w.useCallback)((e) => T_(e, r), [r])), s = (0, w.useCallback)((e, n) => {
|
|
20746
20770
|
if (e.source === null) return Promise.reject(/* @__PURE__ */ Error("Cannot recover media without a selected source"));
|
|
20747
|
-
let r = a.state, i =
|
|
20771
|
+
let r = a.state, i = __(r), o = g_(r);
|
|
20748
20772
|
return i === void 0 || o === void 0 ? Promise.reject(/* @__PURE__ */ Error("The LT media recovery features are not configured")) : (t?.(), i.dismissError(), o.loadSource(e.source), new Promise((t, r) => {
|
|
20749
20773
|
let i = !1, o = !1, s = !1, c = () => void 0, l = (e) => {
|
|
20750
20774
|
s || (s = !0, c(), n.removeEventListener("abort", u), e === void 0 ? t() : r(e));
|
|
@@ -20753,7 +20777,7 @@ function T_({ children: e, clearNativeSourceError: t, mediaRef: n, nativeSourceE
|
|
|
20753
20777
|
u();
|
|
20754
20778
|
return;
|
|
20755
20779
|
}
|
|
20756
|
-
let t = a.state, r =
|
|
20780
|
+
let t = a.state, r = h_(t), s = g_(t), c = __(t), f = v_(t);
|
|
20757
20781
|
if (r === void 0 || s === void 0 || c === void 0 || f === void 0) {
|
|
20758
20782
|
l(/* @__PURE__ */ Error("The LT media recovery features are not configured"));
|
|
20759
20783
|
return;
|
|
@@ -20772,9 +20796,9 @@ function T_({ children: e, clearNativeSourceError: t, mediaRef: n, nativeSourceE
|
|
|
20772
20796
|
};
|
|
20773
20797
|
c = a.subscribe(d), n.addEventListener("abort", u, { once: !0 }), d();
|
|
20774
20798
|
}));
|
|
20775
|
-
}, [t, a]), c = (0, w.useCallback)(() =>
|
|
20799
|
+
}, [t, a]), c = (0, w.useCallback)(() => dg({ recoverMedia: s }), [s]), l = (0, w.useMemo)(() => ({
|
|
20776
20800
|
getSnapshot: () => {
|
|
20777
|
-
let e = a.state, t =
|
|
20801
|
+
let e = a.state, t = y_(e), r = b_(e), i = g_(e), o = x_(e);
|
|
20778
20802
|
if (t === void 0 || r === void 0 || i === void 0 || o === void 0) throw Error("The LT user-state media features are not configured");
|
|
20779
20803
|
return {
|
|
20780
20804
|
attached: !!a.target,
|
|
@@ -20783,7 +20807,7 @@ function T_({ children: e, clearNativeSourceError: t, mediaRef: n, nativeSourceE
|
|
|
20783
20807
|
muted: t.muted,
|
|
20784
20808
|
playbackRate: r.playbackRate,
|
|
20785
20809
|
canPlay: i.canPlay,
|
|
20786
|
-
textTracks:
|
|
20810
|
+
textTracks: Lf(n?.current ?? null).map((e) => ({
|
|
20787
20811
|
id: e.id,
|
|
20788
20812
|
kind: e.kind,
|
|
20789
20813
|
label: e.label,
|
|
@@ -20794,7 +20818,7 @@ function T_({ children: e, clearNativeSourceError: t, mediaRef: n, nativeSourceE
|
|
|
20794
20818
|
},
|
|
20795
20819
|
subscribe: (e) => a.subscribe(e),
|
|
20796
20820
|
setVolume(e) {
|
|
20797
|
-
|
|
20821
|
+
y_(a.state)?.setVolume(e);
|
|
20798
20822
|
},
|
|
20799
20823
|
setMuted(e) {
|
|
20800
20824
|
let t = n?.current;
|
|
@@ -20802,19 +20826,19 @@ function T_({ children: e, clearNativeSourceError: t, mediaRef: n, nativeSourceE
|
|
|
20802
20826
|
t.muted !== e && (t.muted = e);
|
|
20803
20827
|
return;
|
|
20804
20828
|
}
|
|
20805
|
-
let r =
|
|
20829
|
+
let r = y_(a.state);
|
|
20806
20830
|
r !== void 0 && r.muted !== e && r.toggleMuted();
|
|
20807
20831
|
},
|
|
20808
20832
|
setPlaybackRate(e) {
|
|
20809
|
-
|
|
20833
|
+
b_(a.state)?.setPlaybackRate(e);
|
|
20810
20834
|
},
|
|
20811
20835
|
selectSubtitlesTrack(e) {
|
|
20812
|
-
if (
|
|
20813
|
-
let t =
|
|
20836
|
+
if (x_(a.state)?.selectSubtitlesTrack(e), e === "off") return;
|
|
20837
|
+
let t = Lf(n?.current ?? null).find((t) => t.id === e);
|
|
20814
20838
|
t !== void 0 && (t.mode = "hidden");
|
|
20815
20839
|
}
|
|
20816
|
-
}), [n, a]), u = (0, w.useCallback)((e) =>
|
|
20817
|
-
m.current = o, d.current === null && (d.current = c()), p.current ??= i ??
|
|
20840
|
+
}), [n, a]), u = (0, w.useCallback)((e) => tg(l, e), [l]), d = (0, w.useRef)(null), f = (0, w.useRef)(null), p = (0, w.useRef)(null), m = (0, w.useRef)(o), [, h] = (0, w.useState)(0);
|
|
20841
|
+
m.current = o, d.current === null && (d.current = c()), p.current ??= i ?? $h(), f.current ??= u(p.current);
|
|
20818
20842
|
let g = d.current, _ = f.current;
|
|
20819
20843
|
return (0, w.useEffect)(() => {
|
|
20820
20844
|
let e = d.current;
|
|
@@ -20825,29 +20849,29 @@ function T_({ children: e, clearNativeSourceError: t, mediaRef: n, nativeSourceE
|
|
|
20825
20849
|
}, [o]), (0, w.useEffect)(() => {
|
|
20826
20850
|
let e = f.current;
|
|
20827
20851
|
if (e === null || e.isDestroyed()) {
|
|
20828
|
-
let t = p.current ??
|
|
20852
|
+
let t = p.current ?? $h();
|
|
20829
20853
|
p.current = t, e = u(t), f.current = e, h((e) => e + 1);
|
|
20830
20854
|
}
|
|
20831
20855
|
return e.start(), () => e.destroy();
|
|
20832
|
-
}, [u]), /* @__PURE__ */ (0, M.jsx)(
|
|
20856
|
+
}, [u]), /* @__PURE__ */ (0, M.jsx)(pg, {
|
|
20833
20857
|
controller: g,
|
|
20834
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
20858
|
+
children: /* @__PURE__ */ (0, M.jsx)(Vf, {
|
|
20835
20859
|
controller: _,
|
|
20836
20860
|
children: e
|
|
20837
20861
|
})
|
|
20838
20862
|
});
|
|
20839
20863
|
}
|
|
20840
|
-
function
|
|
20864
|
+
function D_({ children: e, clearNativeSourceError: t, mediaRef: n, nativeSourceError: r, orientationLockType: i, poster: a, stringCatalog: o = Eh, title: s, userStateSession: c }) {
|
|
20841
20865
|
return /* @__PURE__ */ (0, M.jsx)(Wd, {
|
|
20842
20866
|
value: o,
|
|
20843
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
20867
|
+
children: /* @__PURE__ */ (0, M.jsx)(yh, {
|
|
20844
20868
|
language: o.selectedLanguage,
|
|
20845
20869
|
strings: o.strings,
|
|
20846
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
20870
|
+
children: /* @__PURE__ */ (0, M.jsx)(p_, {
|
|
20847
20871
|
orientationLockType: i,
|
|
20848
20872
|
poster: a,
|
|
20849
20873
|
title: s,
|
|
20850
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
20874
|
+
children: /* @__PURE__ */ (0, M.jsx)(E_, {
|
|
20851
20875
|
clearNativeSourceError: t,
|
|
20852
20876
|
mediaRef: n,
|
|
20853
20877
|
nativeSourceError: r,
|
|
@@ -20858,10 +20882,10 @@ function E_({ children: e, clearNativeSourceError: t, mediaRef: n, nativeSourceE
|
|
|
20858
20882
|
})
|
|
20859
20883
|
});
|
|
20860
20884
|
}
|
|
20861
|
-
function
|
|
20862
|
-
let n =
|
|
20885
|
+
function O_(e, t) {
|
|
20886
|
+
let n = v_(e), r = y_(e), i = b_(e), a = x_(e), o = S_(e);
|
|
20863
20887
|
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");
|
|
20864
|
-
let s =
|
|
20888
|
+
let s = Lf(t).find((e) => Uf(e.kind) && Wf(e.mode));
|
|
20865
20889
|
return Object.freeze({
|
|
20866
20890
|
currentTime: n.currentTime,
|
|
20867
20891
|
duration: n.duration,
|
|
@@ -20875,8 +20899,8 @@ function D_(e, t) {
|
|
|
20875
20899
|
pip: o.pip
|
|
20876
20900
|
});
|
|
20877
20901
|
}
|
|
20878
|
-
function
|
|
20879
|
-
let i =
|
|
20902
|
+
function k_({ application: e, intentQueue: t, mediaRef: n, runtime: r }) {
|
|
20903
|
+
let i = m_(), a = mg(), o = Hf(), s = (0, w.useMemo)(() => ({
|
|
20880
20904
|
get media() {
|
|
20881
20905
|
let e = n.current;
|
|
20882
20906
|
if (e === null) throw Error("The LT media element is not attached");
|
|
@@ -20884,16 +20908,16 @@ function O_({ application: e, intentQueue: t, mediaRef: n, runtime: r }) {
|
|
|
20884
20908
|
},
|
|
20885
20909
|
playerState: a,
|
|
20886
20910
|
userState: o,
|
|
20887
|
-
getSnapshot: () =>
|
|
20911
|
+
getSnapshot: () => O_(i.state, n.current),
|
|
20888
20912
|
subscribe: (e) => i.subscribe(e),
|
|
20889
20913
|
play() {
|
|
20890
|
-
t.play(() =>
|
|
20914
|
+
t.play(() => h_(i.state)?.play().catch(() => void 0));
|
|
20891
20915
|
},
|
|
20892
20916
|
pause() {
|
|
20893
|
-
t.pause(() =>
|
|
20917
|
+
t.pause(() => h_(i.state)?.pause());
|
|
20894
20918
|
},
|
|
20895
20919
|
seek(e) {
|
|
20896
|
-
|
|
20920
|
+
v_(i.state)?.seek(e).catch(() => void 0);
|
|
20897
20921
|
},
|
|
20898
20922
|
load() {
|
|
20899
20923
|
n.current?.load();
|
|
@@ -20913,14 +20937,14 @@ function O_({ application: e, intentQueue: t, mediaRef: n, runtime: r }) {
|
|
|
20913
20937
|
r
|
|
20914
20938
|
]), null;
|
|
20915
20939
|
}
|
|
20916
|
-
function
|
|
20917
|
-
let n =
|
|
20918
|
-
let e =
|
|
20940
|
+
function A_({ application: e, visible: t }) {
|
|
20941
|
+
let n = m_(), { playback: r } = hg(), i = qd("coverButton"), { config: a } = e, o = a.controls.cover, s = (0, w.useCallback)(() => {
|
|
20942
|
+
let e = h_(n.state);
|
|
20919
20943
|
return e === void 0 ? Promise.reject(/* @__PURE__ */ Error("The LT media playback feature is not configured")) : e.play();
|
|
20920
20944
|
}, [n]);
|
|
20921
20945
|
if (!o.enabled) return null;
|
|
20922
20946
|
let c = o.button.label;
|
|
20923
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
20947
|
+
return /* @__PURE__ */ (0, M.jsx)(yg, {
|
|
20924
20948
|
author: o.author ? a.content.author : void 0,
|
|
20925
20949
|
buttonEnabled: o.button.enabled,
|
|
20926
20950
|
buttonLabel: c ?? i,
|
|
@@ -20934,7 +20958,7 @@ function k_({ application: e, visible: t }) {
|
|
|
20934
20958
|
visibleButtonLabel: c
|
|
20935
20959
|
});
|
|
20936
20960
|
}
|
|
20937
|
-
function
|
|
20961
|
+
function j_({ application: e, runtime: t }) {
|
|
20938
20962
|
let { config: n, strings: r } = e;
|
|
20939
20963
|
if (e.initialError) {
|
|
20940
20964
|
let e = n.layout === "landscape" ? "ltp-landscape" : "ltp-portrait";
|
|
@@ -20943,17 +20967,17 @@ function A_({ application: e, runtime: t }) {
|
|
|
20943
20967
|
"data-ltp-configuration-error": !0,
|
|
20944
20968
|
"data-ltp-layout": n.layout,
|
|
20945
20969
|
lang: r.selectedLanguage,
|
|
20946
|
-
children: [/* @__PURE__ */ (0, M.jsx)(Cd, {}), /* @__PURE__ */ (0, M.jsx)(
|
|
20970
|
+
children: [/* @__PURE__ */ (0, M.jsx)(Cd, {}), /* @__PURE__ */ (0, M.jsx)(Zg, { message: r.strings.configErrorMessage })]
|
|
20947
20971
|
});
|
|
20948
20972
|
}
|
|
20949
|
-
return /* @__PURE__ */ (0, M.jsx)(
|
|
20973
|
+
return /* @__PURE__ */ (0, M.jsx)(M_, {
|
|
20950
20974
|
application: e,
|
|
20951
20975
|
runtime: t
|
|
20952
20976
|
});
|
|
20953
20977
|
}
|
|
20954
|
-
function
|
|
20978
|
+
function M_({ application: e, runtime: t }) {
|
|
20955
20979
|
let n = (0, w.useRef)(null), [r, i] = (0, w.useState)(null), [a, o] = (0, w.useState)(null), s = (0, w.useRef)(null), c = (0, w.useRef)(null);
|
|
20956
|
-
s.current ??=
|
|
20980
|
+
s.current ??= r_();
|
|
20957
20981
|
let l = s.current, u = (0, w.useCallback)((e) => {
|
|
20958
20982
|
n.current = e, i(e), e !== null && t.prepareMedia(e);
|
|
20959
20983
|
}, [t]), { config: d, strings: f } = e, p = a?.generation === e.generation ? a.error : null, m = (0, w.useCallback)(() => o(null), []), h = (0, w.useCallback)((t) => o(t === null ? null : {
|
|
@@ -20961,22 +20985,22 @@ function j_({ application: e, runtime: t }) {
|
|
|
20961
20985
|
generation: e.generation
|
|
20962
20986
|
}), [e.generation]);
|
|
20963
20987
|
c.current !== e.generation && (c.current = e.generation, l.begin());
|
|
20964
|
-
let g = /* @__PURE__ */ (0, M.jsx)(
|
|
20988
|
+
let g = /* @__PURE__ */ (0, M.jsx)(u_, {
|
|
20965
20989
|
mediaRef: u,
|
|
20966
20990
|
"aria-label": d.content.title,
|
|
20967
20991
|
className: "ltp-media-engine__video",
|
|
20968
20992
|
crossOrigin: "anonymous",
|
|
20969
|
-
disablePictureInPicture:
|
|
20993
|
+
disablePictureInPicture: d_(d.controls.pip.enabled),
|
|
20970
20994
|
intentQueue: l,
|
|
20971
20995
|
onNativeSourceErrorChange: h,
|
|
20972
20996
|
playsInline: !0,
|
|
20973
20997
|
preload: "metadata",
|
|
20974
20998
|
sources: d.content.sources,
|
|
20975
|
-
children: d.content.tracks.map((t, n) => /* @__PURE__ */ (0, M.jsx)(
|
|
20999
|
+
children: d.content.tracks.map((t, n) => /* @__PURE__ */ (0, M.jsx)(ip, {
|
|
20976
21000
|
index: n,
|
|
20977
21001
|
track: t
|
|
20978
21002
|
}, `${e.generation}:${t.src}:${t.kind ?? ""}:${n}`))
|
|
20979
|
-
}), _ = e.configurationError ? /* @__PURE__ */ (0, M.jsx)(
|
|
21003
|
+
}), _ = e.configurationError ? /* @__PURE__ */ (0, M.jsx)(Zg, { message: f.strings.configErrorMessage }) : void 0, v = /* @__PURE__ */ (0, M.jsx)(k_, {
|
|
20980
21004
|
application: e,
|
|
20981
21005
|
intentQueue: l,
|
|
20982
21006
|
mediaRef: n,
|
|
@@ -20984,9 +21008,9 @@ function j_({ application: e, runtime: t }) {
|
|
|
20984
21008
|
});
|
|
20985
21009
|
return /* @__PURE__ */ (0, M.jsx)(dd, {
|
|
20986
21010
|
value: d,
|
|
20987
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
21011
|
+
children: /* @__PURE__ */ (0, M.jsx)(th, {
|
|
20988
21012
|
registry: e.registry,
|
|
20989
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
21013
|
+
children: /* @__PURE__ */ (0, M.jsx)(D_, {
|
|
20990
21014
|
clearNativeSourceError: m,
|
|
20991
21015
|
mediaRef: n,
|
|
20992
21016
|
nativeSourceError: p,
|
|
@@ -20995,10 +21019,10 @@ function j_({ application: e, runtime: t }) {
|
|
|
20995
21019
|
stringCatalog: f,
|
|
20996
21020
|
title: d.content.title ?? null,
|
|
20997
21021
|
userStateSession: t.userStateSession,
|
|
20998
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
21022
|
+
children: /* @__PURE__ */ (0, M.jsx)(rp, {
|
|
20999
21023
|
generation: e.generation,
|
|
21000
21024
|
media: r,
|
|
21001
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
21025
|
+
children: /* @__PURE__ */ (0, M.jsx)(I_, {
|
|
21002
21026
|
application: e,
|
|
21003
21027
|
configurationError: _,
|
|
21004
21028
|
media: g,
|
|
@@ -21009,17 +21033,17 @@ function j_({ application: e, runtime: t }) {
|
|
|
21009
21033
|
})
|
|
21010
21034
|
});
|
|
21011
21035
|
}
|
|
21012
|
-
function
|
|
21013
|
-
let t =
|
|
21036
|
+
function N_(e) {
|
|
21037
|
+
let t = P_(e), n = v_(e);
|
|
21014
21038
|
if (t === void 0 || n === void 0) throw Error("The LT core control media features are not configured");
|
|
21015
21039
|
return {
|
|
21016
21040
|
buffered: t.buffered,
|
|
21017
21041
|
duration: n.duration
|
|
21018
21042
|
};
|
|
21019
21043
|
}
|
|
21020
|
-
var
|
|
21021
|
-
function
|
|
21022
|
-
let t =
|
|
21044
|
+
var P_ = N(wn);
|
|
21045
|
+
function F_(e) {
|
|
21046
|
+
let t = C_(e);
|
|
21023
21047
|
if (t === void 0) throw Error("The LT control visibility media feature is not configured");
|
|
21024
21048
|
return {
|
|
21025
21049
|
controlsVisible: t.controlsVisible,
|
|
@@ -21027,8 +21051,8 @@ function P_(e) {
|
|
|
21027
21051
|
userActive: t.userActive
|
|
21028
21052
|
};
|
|
21029
21053
|
}
|
|
21030
|
-
function
|
|
21031
|
-
let i =
|
|
21054
|
+
function I_({ application: e, configurationError: t, media: n, runtimeBridge: r }) {
|
|
21055
|
+
let i = m_(), { playback: a } = hg(), { config: o } = e, s = Dt((e) => i.subscribe(e), () => i.state, F_), c = (0, w.useRef)(null), l = (0, w.useRef)({
|
|
21032
21056
|
configurationError: t !== void 0,
|
|
21033
21057
|
engine: s,
|
|
21034
21058
|
generation: e.generation,
|
|
@@ -21041,11 +21065,11 @@ function F_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
21041
21065
|
generation: e.generation,
|
|
21042
21066
|
layout: o.layout,
|
|
21043
21067
|
playback: a
|
|
21044
|
-
}, c.current === null && (c.current =
|
|
21068
|
+
}, c.current === null && (c.current = Tg());
|
|
21045
21069
|
let d = c.current;
|
|
21046
21070
|
return (0, w.useEffect)(() => {
|
|
21047
21071
|
let e = c.current;
|
|
21048
|
-
return (e === null || e.isDestroyed()) && (e =
|
|
21072
|
+
return (e === null || e.isDestroyed()) && (e = Tg(), c.current = e, u((e) => e + 1)), e.apply(l.current), () => e.destroy();
|
|
21049
21073
|
}, []), (0, w.useLayoutEffect)(() => {
|
|
21050
21074
|
let e = c.current;
|
|
21051
21075
|
e !== null && !e.isDestroyed() && e.apply(l.current);
|
|
@@ -21055,9 +21079,9 @@ function F_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
21055
21079
|
t,
|
|
21056
21080
|
s,
|
|
21057
21081
|
a
|
|
21058
|
-
]), /* @__PURE__ */ (0, M.jsx)(
|
|
21082
|
+
]), /* @__PURE__ */ (0, M.jsx)(Dg, {
|
|
21059
21083
|
controller: d,
|
|
21060
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
21084
|
+
children: /* @__PURE__ */ (0, M.jsx)(B_, {
|
|
21061
21085
|
application: e,
|
|
21062
21086
|
configurationError: t,
|
|
21063
21087
|
media: n,
|
|
@@ -21065,12 +21089,12 @@ function F_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
21065
21089
|
})
|
|
21066
21090
|
});
|
|
21067
21091
|
}
|
|
21068
|
-
function
|
|
21069
|
-
let e =
|
|
21070
|
-
return
|
|
21092
|
+
function L_() {
|
|
21093
|
+
let e = nh().getModule("share"), t = (0, w.useSyncExternalStore)(e.subscribeInteraction, e.getInteractionSnapshot, e.getInteractionSnapshot).open;
|
|
21094
|
+
return Ag(t), null;
|
|
21071
21095
|
}
|
|
21072
|
-
function
|
|
21073
|
-
let t =
|
|
21096
|
+
function R_(e) {
|
|
21097
|
+
let t = w_(e), n = h_(e), r = b_(e), i = v_(e);
|
|
21074
21098
|
if (t === void 0 || n === void 0 || r === void 0 || i === void 0) throw Error("The LT Media Session features are not configured");
|
|
21075
21099
|
return {
|
|
21076
21100
|
currentTime: i.currentTime,
|
|
@@ -21081,16 +21105,16 @@ function L_(e) {
|
|
|
21081
21105
|
title: t.title
|
|
21082
21106
|
};
|
|
21083
21107
|
}
|
|
21084
|
-
function
|
|
21085
|
-
let t =
|
|
21108
|
+
function z_({ application: e }) {
|
|
21109
|
+
let t = m_(), n = hg(), r = Dt((e) => t.subscribe(e), () => t.state, R_), i = (0, w.useMemo)(() => ({
|
|
21086
21110
|
play() {
|
|
21087
|
-
|
|
21111
|
+
h_(t.state)?.play().catch(() => void 0);
|
|
21088
21112
|
},
|
|
21089
21113
|
pause() {
|
|
21090
|
-
|
|
21114
|
+
h_(t.state)?.pause();
|
|
21091
21115
|
},
|
|
21092
21116
|
seek(e) {
|
|
21093
|
-
|
|
21117
|
+
v_(t.state)?.seek(e).catch(() => void 0);
|
|
21094
21118
|
},
|
|
21095
21119
|
...e.mediaSessionTrackCommands === void 0 ? {} : {
|
|
21096
21120
|
previousTrack: e.mediaSessionTrackCommands.previousTrack,
|
|
@@ -21111,14 +21135,14 @@ function R_({ application: e }) {
|
|
|
21111
21135
|
configurationError: e.configurationError
|
|
21112
21136
|
}, o = (0, w.useRef)(a), s = (0, w.useRef)(null);
|
|
21113
21137
|
return o.current = a, (0, w.useLayoutEffect)(() => {
|
|
21114
|
-
let e =
|
|
21138
|
+
let e = Yg(o.current, i);
|
|
21115
21139
|
return s.current = e, () => {
|
|
21116
21140
|
e.destroy(), s.current === e && (s.current = null);
|
|
21117
21141
|
};
|
|
21118
21142
|
}, [i]), (0, w.useLayoutEffect)(() => s.current?.update(a), [a]), null;
|
|
21119
21143
|
}
|
|
21120
|
-
function
|
|
21121
|
-
let i =
|
|
21144
|
+
function B_({ application: e, configurationError: t, media: n, runtimeBridge: r }) {
|
|
21145
|
+
let i = m_(), a = hg(), { playback: o } = a, { config: s, strings: c } = e, l = kg(), u = rh(), d = nh().getModule("share"), f = nh().getModule("contextPanel"), p = Qf(), m = Dt((e) => i.subscribe(e), () => i.state, N_), h = p.available ? u.capabilities.captions.state : "dormant", g = u.capabilities.chapters.state, _ = u.capabilities.speed.state, v = (0, w.useMemo)(() => Jd(s, {
|
|
21122
21146
|
captions: h,
|
|
21123
21147
|
chapters: g,
|
|
21124
21148
|
speed: _
|
|
@@ -21128,9 +21152,9 @@ function z_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
21128
21152
|
s,
|
|
21129
21153
|
_
|
|
21130
21154
|
]), y = t !== void 0 || o === "error", b = (0, w.useCallback)((e) => {
|
|
21131
|
-
|
|
21132
|
-
}, [i]), x =
|
|
21133
|
-
cover: s.controls.cover.enabled && T ? /* @__PURE__ */ (0, M.jsx)(
|
|
21155
|
+
v_(i.state)?.seek(e).catch(() => void 0);
|
|
21156
|
+
}, [i]), x = Fg(v.gestures && !y), S = t === void 0 && a.playback === "error" && a.errorKind === "media" ? /* @__PURE__ */ (0, M.jsx)(Qg, {}) : void 0, { chromeVisible: C, coverVisible: T } = vg(o, e.generation, s.controls.cover.enabled), E = {
|
|
21157
|
+
cover: s.controls.cover.enabled && T ? /* @__PURE__ */ (0, M.jsx)(A_, {
|
|
21134
21158
|
application: e,
|
|
21135
21159
|
visible: T
|
|
21136
21160
|
}, e.generation) : void 0,
|
|
@@ -21143,7 +21167,7 @@ function z_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
21143
21167
|
duration: m.duration,
|
|
21144
21168
|
seekStep: s.controls.timeline.seekStep
|
|
21145
21169
|
}) : void 0,
|
|
21146
|
-
information: C && s.layout === "portrait" && (s.content.author !== void 0 || s.content.title !== void 0) ? /* @__PURE__ */ (0, M.jsx)(
|
|
21170
|
+
information: C && s.layout === "portrait" && (s.content.author !== void 0 || s.content.title !== void 0) ? /* @__PURE__ */ (0, M.jsx)(gg, {
|
|
21147
21171
|
author: s.content.author,
|
|
21148
21172
|
hidden: p.selectedTrack !== null,
|
|
21149
21173
|
surface: "playback",
|
|
@@ -21163,26 +21187,26 @@ function z_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
21163
21187
|
runtimeBridge: r
|
|
21164
21188
|
};
|
|
21165
21189
|
return /* @__PURE__ */ (0, M.jsxs)(M.Fragment, { children: [
|
|
21166
|
-
/* @__PURE__ */ (0, M.jsx)(
|
|
21167
|
-
/* @__PURE__ */ (0, M.jsx)(
|
|
21190
|
+
/* @__PURE__ */ (0, M.jsx)(z_, { application: e }),
|
|
21191
|
+
/* @__PURE__ */ (0, M.jsx)(Lg, {
|
|
21168
21192
|
disabled: y,
|
|
21169
21193
|
layout: s.layout,
|
|
21170
21194
|
policy: v
|
|
21171
21195
|
}),
|
|
21172
21196
|
/* @__PURE__ */ (0, M.jsx)(gf, {
|
|
21173
21197
|
blocked: y,
|
|
21174
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
21198
|
+
children: /* @__PURE__ */ (0, M.jsx)(Qp, {
|
|
21175
21199
|
seek: b,
|
|
21176
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
21200
|
+
children: /* @__PURE__ */ (0, M.jsx)(tm, {
|
|
21177
21201
|
module: f,
|
|
21178
|
-
children: /* @__PURE__ */ (0, M.jsx)(
|
|
21202
|
+
children: /* @__PURE__ */ (0, M.jsx)(wp, {
|
|
21179
21203
|
module: d,
|
|
21180
|
-
children: s.layout === "landscape" ? /* @__PURE__ */ (0, M.jsxs)(M.Fragment, { children: [/* @__PURE__ */ (0, M.jsx)(
|
|
21204
|
+
children: s.layout === "landscape" ? /* @__PURE__ */ (0, M.jsxs)(M.Fragment, { children: [/* @__PURE__ */ (0, M.jsx)(L_, {}), /* @__PURE__ */ (0, M.jsx)(lh, {
|
|
21181
21205
|
...ee,
|
|
21182
21206
|
controlsMounted: C,
|
|
21183
21207
|
controlsVisible: l.visible,
|
|
21184
21208
|
controlVisibilityHandlers: x
|
|
21185
|
-
})] }) : /* @__PURE__ */ (0, M.jsx)(
|
|
21209
|
+
})] }) : /* @__PURE__ */ (0, M.jsx)(ph, {
|
|
21186
21210
|
...ee,
|
|
21187
21211
|
controlsVisible: C
|
|
21188
21212
|
})
|
|
@@ -21194,8 +21218,8 @@ function z_({ application: e, configurationError: t, media: n, runtimeBridge: r
|
|
|
21194
21218
|
}
|
|
21195
21219
|
//#endregion
|
|
21196
21220
|
//#region src/player-application-mode.ts
|
|
21197
|
-
var
|
|
21198
|
-
function
|
|
21221
|
+
var V_ = Object.freeze({ mode: "standalone" }), H_ = /* @__PURE__ */ new WeakMap();
|
|
21222
|
+
function U_(e, t, n) {
|
|
21199
21223
|
let r = Object.freeze({
|
|
21200
21224
|
mode: t.mode,
|
|
21201
21225
|
...t.mediaSessionTrackCommands === void 0 ? {} : { mediaSessionTrackCommands: Object.freeze({
|
|
@@ -21203,32 +21227,32 @@ function H_(e, t, n) {
|
|
|
21203
21227
|
nextTrack: t.mediaSessionTrackCommands.nextTrack
|
|
21204
21228
|
}) }
|
|
21205
21229
|
});
|
|
21206
|
-
|
|
21230
|
+
H_.set(e, r);
|
|
21207
21231
|
try {
|
|
21208
21232
|
return n();
|
|
21209
21233
|
} finally {
|
|
21210
|
-
|
|
21234
|
+
H_.delete(e);
|
|
21211
21235
|
}
|
|
21212
21236
|
}
|
|
21213
|
-
function
|
|
21214
|
-
return
|
|
21237
|
+
function W_(e) {
|
|
21238
|
+
return H_.get(e) ?? V_;
|
|
21215
21239
|
}
|
|
21216
21240
|
//#endregion
|
|
21217
21241
|
//#region src/config/diagnostics.ts
|
|
21218
|
-
function
|
|
21242
|
+
function G_(e) {
|
|
21219
21243
|
return e.length === 0 ? null : {
|
|
21220
21244
|
level: "warning",
|
|
21221
21245
|
code: "config-soft-degrade",
|
|
21222
21246
|
message: `[lt-player] Configuration soft-degraded:\n${e.map((e) => `- ${e.path}: ${e.message}`).join("\n")}`
|
|
21223
21247
|
};
|
|
21224
21248
|
}
|
|
21225
|
-
function
|
|
21226
|
-
let n =
|
|
21249
|
+
function K_(e, t) {
|
|
21250
|
+
let n = G_(e);
|
|
21227
21251
|
return n !== null && t(n), n;
|
|
21228
21252
|
}
|
|
21229
21253
|
//#endregion
|
|
21230
21254
|
//#region src/config/parse-config.ts
|
|
21231
|
-
var
|
|
21255
|
+
var q_ = [
|
|
21232
21256
|
"version",
|
|
21233
21257
|
"layout",
|
|
21234
21258
|
"language",
|
|
@@ -21236,7 +21260,7 @@ var K_ = [
|
|
|
21236
21260
|
"controls",
|
|
21237
21261
|
"capabilities",
|
|
21238
21262
|
"strings"
|
|
21239
|
-
],
|
|
21263
|
+
], J_ = [
|
|
21240
21264
|
"title",
|
|
21241
21265
|
"author",
|
|
21242
21266
|
"description",
|
|
@@ -21246,14 +21270,14 @@ var K_ = [
|
|
|
21246
21270
|
"tracks",
|
|
21247
21271
|
"chapters",
|
|
21248
21272
|
"metadata"
|
|
21249
|
-
],
|
|
21273
|
+
], Y_ = [
|
|
21250
21274
|
"inANutshell",
|
|
21251
21275
|
"keyConcepts",
|
|
21252
21276
|
"researchField",
|
|
21253
21277
|
"transcript",
|
|
21254
21278
|
"underlyingPublication",
|
|
21255
21279
|
"relatedVideos"
|
|
21256
|
-
],
|
|
21280
|
+
], X_ = [
|
|
21257
21281
|
"cover",
|
|
21258
21282
|
"playPause",
|
|
21259
21283
|
"timeline",
|
|
@@ -21266,27 +21290,27 @@ var K_ = [
|
|
|
21266
21290
|
"logo",
|
|
21267
21291
|
"gestures",
|
|
21268
21292
|
"hotkeys"
|
|
21269
|
-
],
|
|
21293
|
+
], Z_ = [
|
|
21270
21294
|
"chapters",
|
|
21271
21295
|
"captions",
|
|
21272
21296
|
"speed",
|
|
21273
21297
|
"share",
|
|
21274
21298
|
"contextPanel"
|
|
21275
21299
|
];
|
|
21276
|
-
function
|
|
21300
|
+
function Q_(e) {
|
|
21277
21301
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
21278
21302
|
}
|
|
21279
|
-
function
|
|
21303
|
+
function $_(e, t) {
|
|
21280
21304
|
return Object.hasOwn(e, t);
|
|
21281
21305
|
}
|
|
21282
|
-
function
|
|
21306
|
+
function ev(e) {
|
|
21283
21307
|
return e === "landscape" || e === "portrait";
|
|
21284
21308
|
}
|
|
21285
|
-
function
|
|
21309
|
+
function tv(e) {
|
|
21286
21310
|
return typeof e == "number" && Number.isFinite(e);
|
|
21287
21311
|
}
|
|
21288
|
-
function
|
|
21289
|
-
return
|
|
21312
|
+
function nv(e) {
|
|
21313
|
+
return tv(e) && e > 0;
|
|
21290
21314
|
}
|
|
21291
21315
|
function $(e, t, n, r, i) {
|
|
21292
21316
|
e.push({
|
|
@@ -21296,46 +21320,46 @@ function $(e, t, n, r, i) {
|
|
|
21296
21320
|
message: i
|
|
21297
21321
|
});
|
|
21298
21322
|
}
|
|
21299
|
-
function
|
|
21323
|
+
function rv(e, t, n, r) {
|
|
21300
21324
|
let i = new Set(t);
|
|
21301
21325
|
for (let t of Object.keys(e)) i.has(t) || $(r, "unknown-key", `${n}.${t}`, "omitted", "unknown key was ignored");
|
|
21302
21326
|
}
|
|
21303
|
-
function
|
|
21304
|
-
if (
|
|
21327
|
+
function iv(e, t, n, r) {
|
|
21328
|
+
if (!$_(e, t)) return;
|
|
21305
21329
|
let i = e[t];
|
|
21306
21330
|
if (typeof i == "string") return i;
|
|
21307
21331
|
$(r, "wrong-type", `${n}.${t}`, "omitted", "expected a string");
|
|
21308
21332
|
}
|
|
21309
|
-
function
|
|
21310
|
-
if (
|
|
21333
|
+
function av(e, t, n, r) {
|
|
21334
|
+
if (!$_(e, t)) return;
|
|
21311
21335
|
let i = e[t];
|
|
21312
21336
|
if (typeof i == "boolean") return i;
|
|
21313
21337
|
$(r, "wrong-type", `${n}.${t}`, "omitted", "expected a boolean");
|
|
21314
21338
|
}
|
|
21315
|
-
function av(e, t, n, r) {
|
|
21316
|
-
if (!Q_(e, t)) return;
|
|
21317
|
-
let i = e[t];
|
|
21318
|
-
if (ev(i) && i >= 0) return i;
|
|
21319
|
-
$(r, ev(i) ? "invalid-value" : "wrong-type", `${n}.${t}`, "omitted", "expected a finite nonnegative number");
|
|
21320
|
-
}
|
|
21321
21339
|
function ov(e, t, n, r) {
|
|
21322
|
-
if (
|
|
21340
|
+
if (!$_(e, t)) return;
|
|
21323
21341
|
let i = e[t];
|
|
21324
|
-
if (
|
|
21325
|
-
$(r,
|
|
21342
|
+
if (tv(i) && i >= 0) return i;
|
|
21343
|
+
$(r, tv(i) ? "invalid-value" : "wrong-type", `${n}.${t}`, "omitted", "expected a finite nonnegative number");
|
|
21326
21344
|
}
|
|
21327
21345
|
function sv(e, t, n, r) {
|
|
21346
|
+
if (!$_(e, t)) return;
|
|
21328
21347
|
let i = e[t];
|
|
21329
|
-
if (
|
|
21330
|
-
$(r,
|
|
21348
|
+
if (tv(i) && i > 0) return i;
|
|
21349
|
+
$(r, tv(i) ? "invalid-value" : "wrong-type", `${n}.${t}`, "omitted", "expected a finite positive number");
|
|
21331
21350
|
}
|
|
21332
21351
|
function cv(e, t, n, r) {
|
|
21333
21352
|
let i = e[t];
|
|
21334
|
-
if (
|
|
21335
|
-
$(r,
|
|
21353
|
+
if (typeof i == "string" && i.length > 0) return i;
|
|
21354
|
+
$(r, $_(e, t) ? typeof i == "string" ? "invalid-value" : "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires a non-empty string");
|
|
21355
|
+
}
|
|
21356
|
+
function lv(e, t, n, r) {
|
|
21357
|
+
let i = e[t];
|
|
21358
|
+
if (tv(i) && i >= 0) return i;
|
|
21359
|
+
$(r, $_(e, t) ? tv(i) ? "invalid-value" : "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires a finite nonnegative number");
|
|
21336
21360
|
}
|
|
21337
|
-
function
|
|
21338
|
-
if (
|
|
21361
|
+
function uv(e, t, n, r, i) {
|
|
21362
|
+
if (!$_(e, t)) return;
|
|
21339
21363
|
let a = e[t];
|
|
21340
21364
|
if (!Array.isArray(a)) {
|
|
21341
21365
|
$(r, "wrong-type", `${n}.${t}`, "omitted", "expected an array");
|
|
@@ -21347,30 +21371,30 @@ function lv(e, t, n, r, i) {
|
|
|
21347
21371
|
s !== void 0 && o.push(s);
|
|
21348
21372
|
}), o;
|
|
21349
21373
|
}
|
|
21350
|
-
function
|
|
21351
|
-
if (!
|
|
21374
|
+
function dv(e, t, n) {
|
|
21375
|
+
if (!Q_(e)) {
|
|
21352
21376
|
$(n, "dropped-entry", t, "dropped", "source entry must be an object");
|
|
21353
21377
|
return;
|
|
21354
21378
|
}
|
|
21355
|
-
|
|
21356
|
-
let r =
|
|
21379
|
+
rv(e, ["src", "type"], t, n);
|
|
21380
|
+
let r = cv(e, "src", t, n);
|
|
21357
21381
|
if (r === void 0) return;
|
|
21358
|
-
let i = { src: r }, a =
|
|
21382
|
+
let i = { src: r }, a = iv(e, "type", t, n);
|
|
21359
21383
|
return a !== void 0 && (i.type = a), i;
|
|
21360
21384
|
}
|
|
21361
|
-
function
|
|
21362
|
-
if (!
|
|
21385
|
+
function fv(e, t, n) {
|
|
21386
|
+
if (!Q_(e)) {
|
|
21363
21387
|
$(n, "dropped-entry", t, "dropped", "track entry must be an object");
|
|
21364
21388
|
return;
|
|
21365
21389
|
}
|
|
21366
|
-
|
|
21390
|
+
rv(e, [
|
|
21367
21391
|
"src",
|
|
21368
21392
|
"kind",
|
|
21369
21393
|
"label",
|
|
21370
21394
|
"srclang",
|
|
21371
21395
|
"default"
|
|
21372
21396
|
], t, n);
|
|
21373
|
-
let r =
|
|
21397
|
+
let r = cv(e, "src", t, n);
|
|
21374
21398
|
if (r === void 0) return;
|
|
21375
21399
|
let i = { src: r };
|
|
21376
21400
|
for (let r of [
|
|
@@ -21378,19 +21402,19 @@ function dv(e, t, n) {
|
|
|
21378
21402
|
"label",
|
|
21379
21403
|
"srclang"
|
|
21380
21404
|
]) {
|
|
21381
|
-
let a =
|
|
21405
|
+
let a = iv(e, r, t, n);
|
|
21382
21406
|
a !== void 0 && (i[r] = a);
|
|
21383
21407
|
}
|
|
21384
|
-
let a =
|
|
21408
|
+
let a = av(e, "default", t, n);
|
|
21385
21409
|
return a !== void 0 && (i.default = a), i;
|
|
21386
21410
|
}
|
|
21387
|
-
function
|
|
21388
|
-
if (!
|
|
21411
|
+
function pv(e, t, n) {
|
|
21412
|
+
if (!Q_(e)) {
|
|
21389
21413
|
$(n, "dropped-entry", t, "dropped", "chapter entry must be an object");
|
|
21390
21414
|
return;
|
|
21391
21415
|
}
|
|
21392
|
-
|
|
21393
|
-
let r =
|
|
21416
|
+
rv(e, ["name", "start"], t, n);
|
|
21417
|
+
let r = cv(e, "name", t, n), i = lv(e, "start", t, n);
|
|
21394
21418
|
if (r === void 0 || i === void 0) return;
|
|
21395
21419
|
let a = t.match(/\[(\d+)\]$/u);
|
|
21396
21420
|
return {
|
|
@@ -21401,8 +21425,8 @@ function fv(e, t, n) {
|
|
|
21401
21425
|
index: Number(a?.[1] ?? 0)
|
|
21402
21426
|
};
|
|
21403
21427
|
}
|
|
21404
|
-
function
|
|
21405
|
-
let n =
|
|
21428
|
+
function mv(e, t) {
|
|
21429
|
+
let n = uv(e, "chapters", "$.content", t, pv);
|
|
21406
21430
|
if (n === void 0) return;
|
|
21407
21431
|
let r = /* @__PURE__ */ new Set(), i = [];
|
|
21408
21432
|
for (let { chapter: e, index: a } of n) {
|
|
@@ -21414,99 +21438,99 @@ function pv(e, t) {
|
|
|
21414
21438
|
}
|
|
21415
21439
|
return i.sort((e, t) => e.start - t.start);
|
|
21416
21440
|
}
|
|
21417
|
-
function
|
|
21418
|
-
let r = {}, i =
|
|
21441
|
+
function hv(e, t, n) {
|
|
21442
|
+
let r = {}, i = av(e, "generatedByAi", t, n);
|
|
21419
21443
|
return i !== void 0 && (r.generatedByAi = i), r;
|
|
21420
21444
|
}
|
|
21421
|
-
function
|
|
21422
|
-
if (!
|
|
21445
|
+
function gv(e, t, n) {
|
|
21446
|
+
if (!Q_(e)) {
|
|
21423
21447
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21424
21448
|
return;
|
|
21425
21449
|
}
|
|
21426
|
-
|
|
21450
|
+
rv(e, [
|
|
21427
21451
|
"generatedByAi",
|
|
21428
21452
|
"keyTakeaway",
|
|
21429
21453
|
"summary"
|
|
21430
21454
|
], t, n);
|
|
21431
|
-
let r =
|
|
21455
|
+
let r = hv(e, t, n);
|
|
21432
21456
|
for (let i of ["keyTakeaway", "summary"]) {
|
|
21433
|
-
let a =
|
|
21457
|
+
let a = iv(e, i, t, n);
|
|
21434
21458
|
a !== void 0 && (r[i] = a);
|
|
21435
21459
|
}
|
|
21436
21460
|
return r;
|
|
21437
21461
|
}
|
|
21438
|
-
function
|
|
21439
|
-
if (!
|
|
21462
|
+
function _v(e, t, n) {
|
|
21463
|
+
if (!Q_(e)) {
|
|
21440
21464
|
$(n, "dropped-entry", t, "dropped", "key-concept entry must be an object");
|
|
21441
21465
|
return;
|
|
21442
21466
|
}
|
|
21443
|
-
|
|
21467
|
+
rv(e, [
|
|
21444
21468
|
"label",
|
|
21445
21469
|
"description",
|
|
21446
21470
|
"start"
|
|
21447
21471
|
], t, n);
|
|
21448
|
-
let r =
|
|
21472
|
+
let r = cv(e, "label", t, n), i = cv(e, "description", t, n);
|
|
21449
21473
|
if (r === void 0 || i === void 0) return;
|
|
21450
21474
|
let a = {
|
|
21451
21475
|
label: r,
|
|
21452
21476
|
description: i
|
|
21453
|
-
}, o =
|
|
21477
|
+
}, o = ov(e, "start", t, n);
|
|
21454
21478
|
return o !== void 0 && (a.start = o), a;
|
|
21455
21479
|
}
|
|
21456
|
-
function
|
|
21457
|
-
if (!
|
|
21480
|
+
function vv(e, t, n) {
|
|
21481
|
+
if (!Q_(e)) {
|
|
21458
21482
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21459
21483
|
return;
|
|
21460
21484
|
}
|
|
21461
|
-
|
|
21462
|
-
let r =
|
|
21485
|
+
rv(e, ["generatedByAi", "items"], t, n);
|
|
21486
|
+
let r = hv(e, t, n), i = uv(e, "items", t, n, _v);
|
|
21463
21487
|
return i !== void 0 && (r.items = i), r;
|
|
21464
21488
|
}
|
|
21465
|
-
function
|
|
21466
|
-
if (!
|
|
21489
|
+
function yv(e, t, n) {
|
|
21490
|
+
if (!Q_(e)) {
|
|
21467
21491
|
$(n, "dropped-entry", t, "dropped", "research-field entry must be an object");
|
|
21468
21492
|
return;
|
|
21469
21493
|
}
|
|
21470
|
-
|
|
21471
|
-
let r =
|
|
21494
|
+
rv(e, ["title", "description"], t, n);
|
|
21495
|
+
let r = cv(e, "title", t, n), i = cv(e, "description", t, n);
|
|
21472
21496
|
return r === void 0 || i === void 0 ? void 0 : {
|
|
21473
21497
|
title: r,
|
|
21474
21498
|
description: i
|
|
21475
21499
|
};
|
|
21476
21500
|
}
|
|
21477
|
-
function
|
|
21478
|
-
if (!
|
|
21501
|
+
function bv(e, t, n) {
|
|
21502
|
+
if (!Q_(e)) {
|
|
21479
21503
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21480
21504
|
return;
|
|
21481
21505
|
}
|
|
21482
|
-
|
|
21483
|
-
let r =
|
|
21506
|
+
rv(e, ["generatedByAi", "sections"], t, n);
|
|
21507
|
+
let r = hv(e, t, n), i = uv(e, "sections", t, n, yv);
|
|
21484
21508
|
return i !== void 0 && (r.sections = i), r;
|
|
21485
21509
|
}
|
|
21486
|
-
function
|
|
21487
|
-
if (!
|
|
21510
|
+
function xv(e, t, n) {
|
|
21511
|
+
if (!Q_(e)) {
|
|
21488
21512
|
$(n, "dropped-entry", t, "dropped", "transcript entry must be an object");
|
|
21489
21513
|
return;
|
|
21490
21514
|
}
|
|
21491
|
-
|
|
21492
|
-
let r =
|
|
21515
|
+
rv(e, ["start", "text"], t, n);
|
|
21516
|
+
let r = lv(e, "start", t, n), i = cv(e, "text", t, n);
|
|
21493
21517
|
return r === void 0 || i === void 0 ? void 0 : {
|
|
21494
21518
|
start: r,
|
|
21495
21519
|
text: i
|
|
21496
21520
|
};
|
|
21497
21521
|
}
|
|
21498
|
-
function
|
|
21499
|
-
if (!
|
|
21522
|
+
function Sv(e, t, n) {
|
|
21523
|
+
if (!Q_(e)) {
|
|
21500
21524
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21501
21525
|
return;
|
|
21502
21526
|
}
|
|
21503
|
-
|
|
21504
|
-
let r =
|
|
21527
|
+
rv(e, ["generatedByAi", "entries"], t, n);
|
|
21528
|
+
let r = hv(e, t, n), i = uv(e, "entries", t, n, xv);
|
|
21505
21529
|
return i !== void 0 && (r.entries = i), r;
|
|
21506
21530
|
}
|
|
21507
|
-
function
|
|
21508
|
-
if (
|
|
21509
|
-
$(r,
|
|
21531
|
+
function Cv(e, t, n, r) {
|
|
21532
|
+
if (!$_(e, t) || !Array.isArray(e[t])) {
|
|
21533
|
+
$(r, $_(e, t) ? "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires an array of strings");
|
|
21510
21534
|
return;
|
|
21511
21535
|
}
|
|
21512
21536
|
let i = [];
|
|
@@ -21514,19 +21538,19 @@ function Sv(e, t, n, r) {
|
|
|
21514
21538
|
typeof e == "string" ? i.push(e) : $(r, "dropped-entry", `${n}.${t}[${a}]`, "dropped", "expected a string");
|
|
21515
21539
|
}), i;
|
|
21516
21540
|
}
|
|
21517
|
-
function
|
|
21518
|
-
if (!
|
|
21541
|
+
function wv(e, t, n) {
|
|
21542
|
+
if (!Q_(e)) {
|
|
21519
21543
|
$(n, "dropped-entry", t, "dropped", "publication entry must be an object");
|
|
21520
21544
|
return;
|
|
21521
21545
|
}
|
|
21522
|
-
|
|
21546
|
+
rv(e, [
|
|
21523
21547
|
"title",
|
|
21524
21548
|
"authors",
|
|
21525
21549
|
"journal",
|
|
21526
21550
|
"abstract",
|
|
21527
21551
|
"url"
|
|
21528
21552
|
], t, n);
|
|
21529
|
-
let r =
|
|
21553
|
+
let r = cv(e, "title", t, n), i = Cv(e, "authors", t, n), a = cv(e, "journal", t, n), o = cv(e, "abstract", t, n), s = cv(e, "url", t, n);
|
|
21530
21554
|
if (r !== void 0 && i !== void 0 && a !== void 0 && o !== void 0 && s !== void 0) return {
|
|
21531
21555
|
title: r,
|
|
21532
21556
|
authors: i,
|
|
@@ -21535,92 +21559,92 @@ function Cv(e, t, n) {
|
|
|
21535
21559
|
url: s
|
|
21536
21560
|
};
|
|
21537
21561
|
}
|
|
21538
|
-
function
|
|
21539
|
-
if (!
|
|
21562
|
+
function Tv(e, t, n) {
|
|
21563
|
+
if (!Q_(e)) {
|
|
21540
21564
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21541
21565
|
return;
|
|
21542
21566
|
}
|
|
21543
|
-
|
|
21544
|
-
let r =
|
|
21567
|
+
rv(e, ["generatedByAi", "items"], t, n);
|
|
21568
|
+
let r = hv(e, t, n), i = uv(e, "items", t, n, wv);
|
|
21545
21569
|
return i !== void 0 && (r.items = i), r;
|
|
21546
21570
|
}
|
|
21547
|
-
function
|
|
21548
|
-
if (!
|
|
21571
|
+
function Ev(e, t, n) {
|
|
21572
|
+
if (!Q_(e)) {
|
|
21549
21573
|
$(n, "dropped-entry", t, "dropped", "related-video entry must be an object");
|
|
21550
21574
|
return;
|
|
21551
21575
|
}
|
|
21552
|
-
|
|
21576
|
+
rv(e, [
|
|
21553
21577
|
"title",
|
|
21554
21578
|
"poster",
|
|
21555
21579
|
"url"
|
|
21556
21580
|
], t, n);
|
|
21557
|
-
let r =
|
|
21581
|
+
let r = cv(e, "title", t, n), i = cv(e, "poster", t, n), a = cv(e, "url", t, n);
|
|
21558
21582
|
return r === void 0 || i === void 0 || a === void 0 ? void 0 : {
|
|
21559
21583
|
title: r,
|
|
21560
21584
|
poster: i,
|
|
21561
21585
|
url: a
|
|
21562
21586
|
};
|
|
21563
21587
|
}
|
|
21564
|
-
function
|
|
21565
|
-
if (!
|
|
21588
|
+
function Dv(e, t, n) {
|
|
21589
|
+
if (!Q_(e)) {
|
|
21566
21590
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21567
21591
|
return;
|
|
21568
21592
|
}
|
|
21569
|
-
|
|
21593
|
+
rv(e, [
|
|
21570
21594
|
"generatedByAi",
|
|
21571
21595
|
"related",
|
|
21572
21596
|
"forYou"
|
|
21573
21597
|
], t, n);
|
|
21574
|
-
let r =
|
|
21598
|
+
let r = hv(e, t, n);
|
|
21575
21599
|
for (let i of ["related", "forYou"]) {
|
|
21576
|
-
let a =
|
|
21600
|
+
let a = uv(e, i, t, n, Ev);
|
|
21577
21601
|
a !== void 0 && (r[i] = a);
|
|
21578
21602
|
}
|
|
21579
21603
|
return r;
|
|
21580
21604
|
}
|
|
21581
|
-
function
|
|
21582
|
-
if (!
|
|
21605
|
+
function Ov(e, t, n) {
|
|
21606
|
+
if (!Q_(e)) {
|
|
21583
21607
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21584
21608
|
return;
|
|
21585
21609
|
}
|
|
21586
|
-
|
|
21610
|
+
rv(e, Y_, t, n);
|
|
21587
21611
|
let r = {}, i = {
|
|
21588
|
-
inANutshell:
|
|
21589
|
-
keyConcepts:
|
|
21590
|
-
researchField:
|
|
21591
|
-
transcript:
|
|
21592
|
-
underlyingPublication:
|
|
21593
|
-
relatedVideos:
|
|
21612
|
+
inANutshell: gv,
|
|
21613
|
+
keyConcepts: vv,
|
|
21614
|
+
researchField: bv,
|
|
21615
|
+
transcript: Sv,
|
|
21616
|
+
underlyingPublication: Tv,
|
|
21617
|
+
relatedVideos: Dv
|
|
21594
21618
|
};
|
|
21595
|
-
for (let a of
|
|
21596
|
-
if (
|
|
21619
|
+
for (let a of Y_) {
|
|
21620
|
+
if (!$_(e, a)) continue;
|
|
21597
21621
|
let o = i[a](e[a], `${t}.${a}`, n);
|
|
21598
21622
|
o !== void 0 && Object.assign(r, { [a]: o });
|
|
21599
21623
|
}
|
|
21600
21624
|
return r;
|
|
21601
21625
|
}
|
|
21602
|
-
function
|
|
21626
|
+
function kv(e, t, n) {
|
|
21603
21627
|
if (typeof e == "boolean") return e;
|
|
21604
|
-
if (
|
|
21628
|
+
if (Q_(e)) return rv(e, [], t, n), {};
|
|
21605
21629
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21606
21630
|
}
|
|
21607
|
-
function
|
|
21631
|
+
function Av(e, t, n) {
|
|
21608
21632
|
if (typeof e == "boolean") return e;
|
|
21609
|
-
if (!
|
|
21633
|
+
if (!Q_(e)) {
|
|
21610
21634
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21611
21635
|
return;
|
|
21612
21636
|
}
|
|
21613
|
-
|
|
21614
|
-
let r = {}, i =
|
|
21637
|
+
rv(e, ["label"], t, n);
|
|
21638
|
+
let r = {}, i = iv(e, "label", t, n);
|
|
21615
21639
|
return i !== void 0 && (r.label = i), r;
|
|
21616
21640
|
}
|
|
21617
|
-
function
|
|
21641
|
+
function jv(e, t, n) {
|
|
21618
21642
|
if (typeof e == "boolean") return e;
|
|
21619
|
-
if (!
|
|
21643
|
+
if (!Q_(e)) {
|
|
21620
21644
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21621
21645
|
return;
|
|
21622
21646
|
}
|
|
21623
|
-
|
|
21647
|
+
rv(e, [
|
|
21624
21648
|
"image",
|
|
21625
21649
|
"title",
|
|
21626
21650
|
"author",
|
|
@@ -21632,62 +21656,62 @@ function Av(e, t, n) {
|
|
|
21632
21656
|
"title",
|
|
21633
21657
|
"author"
|
|
21634
21658
|
]) {
|
|
21635
|
-
let a =
|
|
21659
|
+
let a = av(e, i, t, n);
|
|
21636
21660
|
a !== void 0 && (r[i] = a);
|
|
21637
21661
|
}
|
|
21638
|
-
if (
|
|
21639
|
-
let i =
|
|
21662
|
+
if ($_(e, "button")) {
|
|
21663
|
+
let i = Av(e.button, `${t}.button`, n);
|
|
21640
21664
|
i !== void 0 && (r.button = i);
|
|
21641
21665
|
}
|
|
21642
21666
|
return r;
|
|
21643
21667
|
}
|
|
21644
|
-
function
|
|
21668
|
+
function Mv(e, t, n) {
|
|
21645
21669
|
if (typeof e == "boolean") return e;
|
|
21646
|
-
if (!
|
|
21670
|
+
if (!Q_(e)) {
|
|
21647
21671
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21648
21672
|
return;
|
|
21649
21673
|
}
|
|
21650
|
-
|
|
21674
|
+
rv(e, ["seekStep"], t, n);
|
|
21651
21675
|
let r = {};
|
|
21652
|
-
if (
|
|
21676
|
+
if ($_(e, "seekStep")) {
|
|
21653
21677
|
let i = e.seekStep;
|
|
21654
|
-
|
|
21678
|
+
tv(i) && i > 0 ? r.seekStep = i : $(n, tv(i) ? "invalid-value" : "wrong-type", `${t}.seekStep`, "omitted", "expected a finite positive number");
|
|
21655
21679
|
}
|
|
21656
21680
|
return r;
|
|
21657
21681
|
}
|
|
21658
|
-
function
|
|
21659
|
-
if (!
|
|
21682
|
+
function Nv(e, t, n) {
|
|
21683
|
+
if (!Q_(e)) {
|
|
21660
21684
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21661
21685
|
return;
|
|
21662
21686
|
}
|
|
21663
|
-
|
|
21687
|
+
rv(e, X_, t, n);
|
|
21664
21688
|
let r = {};
|
|
21665
|
-
for (let i of
|
|
21666
|
-
if (
|
|
21667
|
-
let a = i === "cover" ?
|
|
21689
|
+
for (let i of X_) {
|
|
21690
|
+
if (!$_(e, i)) continue;
|
|
21691
|
+
let a = i === "cover" ? jv(e[i], `${t}.${i}`, n) : i === "timeline" ? Mv(e[i], `${t}.${i}`, n) : kv(e[i], `${t}.${i}`, n);
|
|
21668
21692
|
a !== void 0 && Object.assign(r, { [i]: a });
|
|
21669
21693
|
}
|
|
21670
21694
|
return r;
|
|
21671
21695
|
}
|
|
21672
|
-
function
|
|
21696
|
+
function Pv(e, t, n) {
|
|
21673
21697
|
if (typeof e == "boolean") return e;
|
|
21674
|
-
if (!
|
|
21698
|
+
if (!Q_(e)) {
|
|
21675
21699
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21676
21700
|
return;
|
|
21677
21701
|
}
|
|
21678
|
-
|
|
21702
|
+
rv(e, ["options"], t, n);
|
|
21679
21703
|
let r = {};
|
|
21680
|
-
if (
|
|
21704
|
+
if (!$_(e, "options")) return r;
|
|
21681
21705
|
let i = e.options;
|
|
21682
|
-
return Array.isArray(i) && i.length > 0 && i.every((e) =>
|
|
21706
|
+
return Array.isArray(i) && i.length > 0 && i.every((e) => tv(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;
|
|
21683
21707
|
}
|
|
21684
|
-
function
|
|
21708
|
+
function Fv(e, t, n) {
|
|
21685
21709
|
if (typeof e == "boolean") return e;
|
|
21686
|
-
if (!
|
|
21710
|
+
if (!Q_(e)) {
|
|
21687
21711
|
$(n, "wrong-type", t, "omitted", "expected a boolean or object");
|
|
21688
21712
|
return;
|
|
21689
21713
|
}
|
|
21690
|
-
|
|
21714
|
+
rv(e, [
|
|
21691
21715
|
"canonicalUrl",
|
|
21692
21716
|
"embedUrl",
|
|
21693
21717
|
"playerTrigger",
|
|
@@ -21696,11 +21720,11 @@ function Pv(e, t, n) {
|
|
|
21696
21720
|
], t, n);
|
|
21697
21721
|
let r = {};
|
|
21698
21722
|
for (let i of ["canonicalUrl", "embedUrl"]) {
|
|
21699
|
-
let a =
|
|
21723
|
+
let a = iv(e, i, t, n);
|
|
21700
21724
|
a !== void 0 && (r[i] = a);
|
|
21701
21725
|
}
|
|
21702
|
-
let i =
|
|
21703
|
-
if (i !== void 0 && (r.playerTrigger = i),
|
|
21726
|
+
let i = av(e, "playerTrigger", t, n);
|
|
21727
|
+
if (i !== void 0 && (r.playerTrigger = i), $_(e, "targets")) {
|
|
21704
21728
|
let i = e.targets;
|
|
21705
21729
|
if (!Array.isArray(i)) $(n, "wrong-type", `${t}.targets`, "omitted", "expected an array");
|
|
21706
21730
|
else {
|
|
@@ -21732,13 +21756,13 @@ function Pv(e, t, n) {
|
|
|
21732
21756
|
}), r.targets = o;
|
|
21733
21757
|
}
|
|
21734
21758
|
}
|
|
21735
|
-
if (
|
|
21736
|
-
if (!
|
|
21759
|
+
if ($_(e, "templates")) {
|
|
21760
|
+
if (!Q_(e.templates)) $(n, "wrong-type", `${t}.templates`, "omitted", "expected an object");
|
|
21737
21761
|
else {
|
|
21738
|
-
|
|
21762
|
+
rv(e.templates, ["message"], `${t}.templates`, n);
|
|
21739
21763
|
let i = {};
|
|
21740
21764
|
for (let r of ["message"]) {
|
|
21741
|
-
let a =
|
|
21765
|
+
let a = iv(e.templates, r, `${t}.templates`, n);
|
|
21742
21766
|
a !== void 0 && (i[r] = a);
|
|
21743
21767
|
}
|
|
21744
21768
|
r.templates = i;
|
|
@@ -21746,22 +21770,22 @@ function Pv(e, t, n) {
|
|
|
21746
21770
|
}
|
|
21747
21771
|
return r;
|
|
21748
21772
|
}
|
|
21749
|
-
function
|
|
21750
|
-
if (!
|
|
21773
|
+
function Iv(e, t, n) {
|
|
21774
|
+
if (!Q_(e)) {
|
|
21751
21775
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21752
21776
|
return;
|
|
21753
21777
|
}
|
|
21754
|
-
|
|
21778
|
+
rv(e, Z_, t, n);
|
|
21755
21779
|
let r = {};
|
|
21756
|
-
for (let i of
|
|
21757
|
-
if (
|
|
21758
|
-
let a = i === "speed" ?
|
|
21780
|
+
for (let i of Z_) {
|
|
21781
|
+
if (!$_(e, i)) continue;
|
|
21782
|
+
let a = i === "speed" ? Pv(e[i], `${t}.${i}`, n) : i === "share" ? Fv(e[i], `${t}.${i}`, n) : av(e, i, t, n);
|
|
21759
21783
|
a !== void 0 && Object.assign(r, { [i]: a });
|
|
21760
21784
|
}
|
|
21761
21785
|
return r;
|
|
21762
21786
|
}
|
|
21763
|
-
function
|
|
21764
|
-
if (!
|
|
21787
|
+
function Lv(e, t, n) {
|
|
21788
|
+
if (!Q_(e)) {
|
|
21765
21789
|
$(n, "wrong-type", t, "omitted", "expected an object");
|
|
21766
21790
|
return;
|
|
21767
21791
|
}
|
|
@@ -21769,7 +21793,7 @@ function Iv(e, t, n) {
|
|
|
21769
21793
|
for (let [i, a] of Object.entries(e)) typeof a == "string" ? r[i] = a : $(n, "wrong-type", `${t}.${i}`, "omitted", "expected a string");
|
|
21770
21794
|
return r;
|
|
21771
21795
|
}
|
|
21772
|
-
function
|
|
21796
|
+
function Rv(e, t, n) {
|
|
21773
21797
|
if (typeof e == "string") return e;
|
|
21774
21798
|
if (!Array.isArray(e)) {
|
|
21775
21799
|
$(n, "wrong-type", t, "omitted", "expected a string or string array");
|
|
@@ -21784,50 +21808,50 @@ function Lv(e, t, n) {
|
|
|
21784
21808
|
typeof e == "string" ? r.push(e) : $(n, "dropped-entry", `${t}[${i}]`, "dropped", "expected a string");
|
|
21785
21809
|
}), r.length > 0 ? r : void 0;
|
|
21786
21810
|
}
|
|
21787
|
-
function
|
|
21788
|
-
|
|
21789
|
-
let n = { sources: e.sources.map((e, n) =>
|
|
21811
|
+
function zv(e, t) {
|
|
21812
|
+
rv(e, J_, "$.content", t);
|
|
21813
|
+
let n = { sources: e.sources.map((e, n) => dv(e, `$.content.sources[${n}]`, t)).filter((e) => e !== void 0) };
|
|
21790
21814
|
for (let r of [
|
|
21791
21815
|
"title",
|
|
21792
21816
|
"author",
|
|
21793
21817
|
"description",
|
|
21794
21818
|
"poster"
|
|
21795
21819
|
]) {
|
|
21796
|
-
let i =
|
|
21820
|
+
let i = iv(e, r, "$.content", t);
|
|
21797
21821
|
i !== void 0 && (n[r] = i);
|
|
21798
21822
|
}
|
|
21799
|
-
let r =
|
|
21823
|
+
let r = sv(e, "duration", "$.content", t);
|
|
21800
21824
|
r !== void 0 && (n.duration = r);
|
|
21801
|
-
let i =
|
|
21825
|
+
let i = uv(e, "tracks", "$.content", t, fv);
|
|
21802
21826
|
i !== void 0 && (n.tracks = i);
|
|
21803
|
-
let a =
|
|
21804
|
-
if (a !== void 0 && (n.chapters = a),
|
|
21805
|
-
let r =
|
|
21827
|
+
let a = mv(e, t);
|
|
21828
|
+
if (a !== void 0 && (n.chapters = a), $_(e, "metadata")) {
|
|
21829
|
+
let r = Ov(e.metadata, "$.content.metadata", t);
|
|
21806
21830
|
r !== void 0 && (n.metadata = r);
|
|
21807
21831
|
}
|
|
21808
21832
|
return n;
|
|
21809
21833
|
}
|
|
21810
|
-
function
|
|
21834
|
+
function Bv(e, t) {
|
|
21811
21835
|
return {
|
|
21812
21836
|
level: "error",
|
|
21813
21837
|
code: t ? "legacy-config-invalid" : "config-invalid",
|
|
21814
21838
|
message: `${t ? "[lt-player] Legacy pre-v3 configuration rejected" : "[lt-player] Configuration rejected"}:\n${e.map((e) => `- ${e.path}: ${e.message}`).join("\n")}`
|
|
21815
21839
|
};
|
|
21816
21840
|
}
|
|
21817
|
-
function
|
|
21841
|
+
function Vv(e, t) {
|
|
21818
21842
|
return {
|
|
21819
21843
|
status: "valid",
|
|
21820
21844
|
config: e,
|
|
21821
21845
|
findings: t,
|
|
21822
|
-
diagnostic:
|
|
21846
|
+
diagnostic: G_(t)
|
|
21823
21847
|
};
|
|
21824
21848
|
}
|
|
21825
|
-
function
|
|
21849
|
+
function Hv(e, t, n) {
|
|
21826
21850
|
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));
|
|
21827
21851
|
}
|
|
21828
|
-
function
|
|
21829
|
-
let n =
|
|
21830
|
-
if (
|
|
21852
|
+
function Uv(e, t) {
|
|
21853
|
+
let n = Q_(e) ? e : {}, r = Q_(n.content) ? n.content : void 0, i = n.layout, a = [];
|
|
21854
|
+
if (ev(i) || a.push({
|
|
21831
21855
|
code: "invalid-layout",
|
|
21832
21856
|
path: "$.layout",
|
|
21833
21857
|
message: "layout must be landscape or portrait"
|
|
@@ -21835,54 +21859,54 @@ function Hv(e, t) {
|
|
|
21835
21859
|
code: "missing-sources",
|
|
21836
21860
|
path: "$.content.sources",
|
|
21837
21861
|
message: "content.sources must be a non-empty array"
|
|
21838
|
-
}), t.application === "update" &&
|
|
21862
|
+
}), t.application === "update" && ev(i) && i !== t.instanceLayout && a.push({
|
|
21839
21863
|
code: "layout-change",
|
|
21840
21864
|
path: "$.layout",
|
|
21841
21865
|
message: `layout cannot change from ${t.instanceLayout} to ${i}`
|
|
21842
21866
|
}), a.length > 0) {
|
|
21843
|
-
let e =
|
|
21867
|
+
let e = $_(n, "body");
|
|
21844
21868
|
return {
|
|
21845
21869
|
status: "invalid",
|
|
21846
21870
|
violations: a,
|
|
21847
21871
|
legacy: e,
|
|
21848
|
-
diagnostic:
|
|
21872
|
+
diagnostic: Bv(a, e)
|
|
21849
21873
|
};
|
|
21850
21874
|
}
|
|
21851
21875
|
let o = [];
|
|
21852
|
-
|
|
21876
|
+
rv(n, q_, "$", o);
|
|
21853
21877
|
let s = {
|
|
21854
21878
|
version: 3,
|
|
21855
21879
|
layout: i,
|
|
21856
|
-
content:
|
|
21880
|
+
content: zv(r, o)
|
|
21857
21881
|
};
|
|
21858
|
-
if (
|
|
21859
|
-
let e =
|
|
21882
|
+
if ($_(n, "version") && n.version !== 3 && $(o, typeof n.version == "number" ? "invalid-value" : "wrong-type", "$.version", "omitted", "version was normalized to 3"), $_(n, "language")) {
|
|
21883
|
+
let e = Rv(n.language, "$.language", o);
|
|
21860
21884
|
e !== void 0 && (s.language = e);
|
|
21861
21885
|
}
|
|
21862
|
-
if (
|
|
21863
|
-
let e =
|
|
21886
|
+
if ($_(n, "controls")) {
|
|
21887
|
+
let e = Nv(n.controls, "$.controls", o);
|
|
21864
21888
|
e !== void 0 && (s.controls = e);
|
|
21865
21889
|
}
|
|
21866
|
-
if (
|
|
21867
|
-
let e =
|
|
21890
|
+
if ($_(n, "capabilities")) {
|
|
21891
|
+
let e = Iv(n.capabilities, "$.capabilities", o);
|
|
21868
21892
|
e !== void 0 && (s.capabilities = e);
|
|
21869
21893
|
}
|
|
21870
|
-
if (
|
|
21871
|
-
let e =
|
|
21894
|
+
if ($_(n, "strings")) {
|
|
21895
|
+
let e = Lv(n.strings, "$.strings", o);
|
|
21872
21896
|
e !== void 0 && (s.strings = e);
|
|
21873
21897
|
}
|
|
21874
|
-
let c = s.content.chapters, l = s.content.duration ?? (
|
|
21898
|
+
let c = s.content.chapters, l = s.content.duration ?? (nv(t.engineDuration) ? t.engineDuration : void 0);
|
|
21875
21899
|
return c !== void 0 && c.length > 0 && l === void 0 ? {
|
|
21876
21900
|
status: "pending-duration",
|
|
21877
21901
|
config: s,
|
|
21878
21902
|
findings: o,
|
|
21879
21903
|
diagnostic: null
|
|
21880
|
-
} : (c !== void 0 && l !== void 0 && (s.content.chapters =
|
|
21904
|
+
} : (c !== void 0 && l !== void 0 && (s.content.chapters = Hv(c, l, o)), Vv(s, o));
|
|
21881
21905
|
}
|
|
21882
|
-
function
|
|
21883
|
-
if (!
|
|
21884
|
-
let n = [...e.findings], r =
|
|
21885
|
-
return
|
|
21906
|
+
function Wv(e, t) {
|
|
21907
|
+
if (!nv(t)) return e;
|
|
21908
|
+
let n = [...e.findings], r = Hv(e.config.content.chapters ?? [], t, n);
|
|
21909
|
+
return Vv({
|
|
21886
21910
|
...e.config,
|
|
21887
21911
|
content: {
|
|
21888
21912
|
...e.config.content,
|
|
@@ -21890,17 +21914,17 @@ function Uv(e, t) {
|
|
|
21890
21914
|
}
|
|
21891
21915
|
}, n);
|
|
21892
21916
|
}
|
|
21893
|
-
function
|
|
21894
|
-
return
|
|
21917
|
+
function Gv(e) {
|
|
21918
|
+
return Vv(e.config, e.findings);
|
|
21895
21919
|
}
|
|
21896
21920
|
//#endregion
|
|
21897
21921
|
//#region src/page-api/player-runtime.ts
|
|
21898
|
-
var
|
|
21899
|
-
function
|
|
21922
|
+
var Kv = Symbol("chapter-unset"), qv = () => void 0;
|
|
21923
|
+
function Jv(e) {
|
|
21900
21924
|
return Number.isFinite(e) && e >= 0 ? e : 0;
|
|
21901
21925
|
}
|
|
21902
|
-
function
|
|
21903
|
-
return
|
|
21926
|
+
function Yv(e) {
|
|
21927
|
+
return Lh({
|
|
21904
21928
|
version: 3,
|
|
21905
21929
|
layout: e,
|
|
21906
21930
|
content: { sources: [] },
|
|
@@ -21913,14 +21937,14 @@ function Jv(e) {
|
|
|
21913
21937
|
}
|
|
21914
21938
|
});
|
|
21915
21939
|
}
|
|
21916
|
-
function
|
|
21940
|
+
function Xv(e) {
|
|
21917
21941
|
if (typeof e == "object" && e && "layout" in e) {
|
|
21918
21942
|
let t = e.layout;
|
|
21919
21943
|
if (t === "landscape" || t === "portrait") return t;
|
|
21920
21944
|
}
|
|
21921
21945
|
return "landscape";
|
|
21922
21946
|
}
|
|
21923
|
-
var
|
|
21947
|
+
var Zv = class {
|
|
21924
21948
|
#e;
|
|
21925
21949
|
#t;
|
|
21926
21950
|
#n;
|
|
@@ -21939,7 +21963,7 @@ var Xv = class {
|
|
|
21939
21963
|
#h = 0;
|
|
21940
21964
|
#g = "";
|
|
21941
21965
|
#_ = -1;
|
|
21942
|
-
#v =
|
|
21966
|
+
#v = Kv;
|
|
21943
21967
|
#y = Object.freeze({
|
|
21944
21968
|
playback: "idle",
|
|
21945
21969
|
currentTime: 0,
|
|
@@ -21956,7 +21980,7 @@ var Xv = class {
|
|
|
21956
21980
|
#S = !1;
|
|
21957
21981
|
#C = -1;
|
|
21958
21982
|
constructor(e) {
|
|
21959
|
-
this.#r = e.applicationContext?.mode ?? "standalone", this.#i = e.applicationContext?.mediaSessionTrackCommands, this.#e = e.render, this.#t = e.unmount, this.#n = e.releaseHost, this.#a = e.userStateSession ??
|
|
21983
|
+
this.#r = e.applicationContext?.mode ?? "standalone", this.#i = e.applicationContext?.mediaSessionTrackCommands, this.#e = e.render, this.#t = e.unmount, this.#n = e.releaseHost, this.#a = e.userStateSession ?? $h(), this.#c = Object.freeze({
|
|
21960
21984
|
update: (e) => this.update(e),
|
|
21961
21985
|
destroy: () => this.destroy(),
|
|
21962
21986
|
getState: () => this.getState(),
|
|
@@ -21992,9 +22016,9 @@ var Xv = class {
|
|
|
21992
22016
|
return this.#x;
|
|
21993
22017
|
}
|
|
21994
22018
|
mount(e) {
|
|
21995
|
-
let t =
|
|
22019
|
+
let t = Uv(e, { application: "mount" });
|
|
21996
22020
|
if (t.status === "invalid") {
|
|
21997
|
-
let n =
|
|
22021
|
+
let n = Xv(e), r = Yv(n), i = Th(), a = $m(r);
|
|
21998
22022
|
throw this.#m += 1, this.#l = Object.freeze({
|
|
21999
22023
|
generation: this.#m,
|
|
22000
22024
|
revision: ++this.#h,
|
|
@@ -22017,7 +22041,7 @@ var Xv = class {
|
|
|
22017
22041
|
if (this.#b) return;
|
|
22018
22042
|
let t = this.application;
|
|
22019
22043
|
this.#E();
|
|
22020
|
-
let n =
|
|
22044
|
+
let n = Uv(e, {
|
|
22021
22045
|
application: "update",
|
|
22022
22046
|
instanceLayout: t.config.layout
|
|
22023
22047
|
});
|
|
@@ -22041,8 +22065,8 @@ var Xv = class {
|
|
|
22041
22065
|
});
|
|
22042
22066
|
let e = this.#d.getSnapshot(), t = this.#d.playerState.getSnapshot().playback, n = Object.freeze({
|
|
22043
22067
|
playback: t,
|
|
22044
|
-
currentTime:
|
|
22045
|
-
duration:
|
|
22068
|
+
currentTime: Jv(e.currentTime),
|
|
22069
|
+
duration: Jv(e.duration),
|
|
22046
22070
|
volume: e.volume,
|
|
22047
22071
|
muted: e.muted,
|
|
22048
22072
|
rate: e.rate,
|
|
@@ -22053,7 +22077,7 @@ var Xv = class {
|
|
|
22053
22077
|
return this.#y = n, n;
|
|
22054
22078
|
}
|
|
22055
22079
|
on(e, t) {
|
|
22056
|
-
if (this.#b) return
|
|
22080
|
+
if (this.#b) return qv;
|
|
22057
22081
|
let n = this.#s.get(e) ?? /* @__PURE__ */ new Set();
|
|
22058
22082
|
this.#s.set(e, n);
|
|
22059
22083
|
let r = t;
|
|
@@ -22064,7 +22088,7 @@ var Xv = class {
|
|
|
22064
22088
|
};
|
|
22065
22089
|
}
|
|
22066
22090
|
attachEngine(e) {
|
|
22067
|
-
if (this.#b) return
|
|
22091
|
+
if (this.#b) return qv;
|
|
22068
22092
|
this.#f?.(), this.#d = e;
|
|
22069
22093
|
let t = e.media, n = e.getSnapshot(), r = e.playerState.getSnapshot(), i = e.subscribe(() => {
|
|
22070
22094
|
let t = e.getSnapshot();
|
|
@@ -22094,10 +22118,10 @@ var Xv = class {
|
|
|
22094
22118
|
let n = this.application;
|
|
22095
22119
|
if (n.generation !== e || n.revision !== t) return;
|
|
22096
22120
|
let r = `${e}:${t}`;
|
|
22097
|
-
this.#g !== r && (this.#g = r, n.commit !== "duration" && (this.#S = !0, this.#_ = -1, this.#v =
|
|
22121
|
+
this.#g !== r && (this.#g = r, n.commit !== "duration" && (this.#S = !0, this.#_ = -1, this.#v = Kv, 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", {})));
|
|
22098
22122
|
}
|
|
22099
22123
|
#w(e, t) {
|
|
22100
|
-
let n = this.#d?.userState.getSnapshot() ?? this.#a.hydrate(), r =
|
|
22124
|
+
let n = this.#d?.userState.getSnapshot() ?? this.#a.hydrate(), r = Lh(e.config, n), i = Th(typeof r.language == "string" ? r.language : [...r.language], r.strings), a = this.#l?.registry ?? $m(r);
|
|
22101
22125
|
this.#l !== null && a.applyConfig(r), this.#m += 1, this.#l = Object.freeze({
|
|
22102
22126
|
generation: this.#m,
|
|
22103
22127
|
revision: ++this.#h,
|
|
@@ -22117,10 +22141,10 @@ var Xv = class {
|
|
|
22117
22141
|
#T(e) {
|
|
22118
22142
|
let t = this.#u;
|
|
22119
22143
|
if (t === null || t.generation !== this.application.generation || this.#C !== -1 || !Number.isFinite(e) || e <= 0) return;
|
|
22120
|
-
let n =
|
|
22144
|
+
let n = Wv(t.result, e);
|
|
22121
22145
|
if (n.status === "pending-duration") return;
|
|
22122
22146
|
this.#u = null;
|
|
22123
|
-
let r = this.#d?.userState.getSnapshot() ?? this.#a.hydrate(), i =
|
|
22147
|
+
let r = this.#d?.userState.getSnapshot() ?? this.#a.hydrate(), i = Lh(n.config, r);
|
|
22124
22148
|
this.application.registry.applyConfig(i), this.#l = Object.freeze({
|
|
22125
22149
|
...this.application,
|
|
22126
22150
|
revision: ++this.#h,
|
|
@@ -22132,7 +22156,7 @@ var Xv = class {
|
|
|
22132
22156
|
let e = this.#u;
|
|
22133
22157
|
if (e === null) return;
|
|
22134
22158
|
this.#u = null;
|
|
22135
|
-
let t =
|
|
22159
|
+
let t = Gv(e.result);
|
|
22136
22160
|
this.#L([...t.findings, ...e.stringFindings]);
|
|
22137
22161
|
}
|
|
22138
22162
|
#D(e) {
|
|
@@ -22162,7 +22186,7 @@ var Xv = class {
|
|
|
22162
22186
|
#M(e) {
|
|
22163
22187
|
if (!(this.#b || this.#S || this.#d === null)) {
|
|
22164
22188
|
if (e === "canplay") {
|
|
22165
|
-
this.#C = -1, this.#T(this.#d.getSnapshot().duration), this.#_ !== this.application.generation && (this.#_ = this.application.generation, this.#I("ready", { duration:
|
|
22189
|
+
this.#C = -1, this.#T(this.#d.getSnapshot().duration), this.#_ !== this.application.generation && (this.#_ = this.application.generation, this.#I("ready", { duration: Jv(this.#d.getSnapshot().duration) }));
|
|
22166
22190
|
return;
|
|
22167
22191
|
}
|
|
22168
22192
|
if (this.#C === -1) {
|
|
@@ -22197,33 +22221,33 @@ var Xv = class {
|
|
|
22197
22221
|
}
|
|
22198
22222
|
#I(e, t) {
|
|
22199
22223
|
if (this.#b) return;
|
|
22200
|
-
let n =
|
|
22224
|
+
let n = Jv(this.#d?.getSnapshot().currentTime ?? 0), r = Object.freeze({
|
|
22201
22225
|
currentTime: n,
|
|
22202
22226
|
...t
|
|
22203
22227
|
});
|
|
22204
22228
|
for (let t of [...this.#s.get(e) ?? []]) t(r);
|
|
22205
22229
|
}
|
|
22206
22230
|
#L(e) {
|
|
22207
|
-
|
|
22231
|
+
K_(e, (e) => this.#R(e));
|
|
22208
22232
|
}
|
|
22209
22233
|
#R(e) {
|
|
22210
22234
|
e.level === "error" ? console.error(e.message) : console.warn(e.message);
|
|
22211
22235
|
}
|
|
22212
|
-
},
|
|
22213
|
-
function
|
|
22236
|
+
}, Qv = /* @__PURE__ */ new WeakMap();
|
|
22237
|
+
function $v(e) {
|
|
22214
22238
|
return e.id ? `#${e.id}` : e.tagName.toLowerCase();
|
|
22215
22239
|
}
|
|
22216
|
-
function
|
|
22217
|
-
let n =
|
|
22240
|
+
function ey(e, t) {
|
|
22241
|
+
let n = Qv.get(e);
|
|
22218
22242
|
if (n !== void 0) {
|
|
22219
|
-
if (!n.isFailedMount()) throw Error(`Cannot create player: host ${
|
|
22243
|
+
if (!n.isFailedMount()) throw Error(`Cannot create player: host ${$v(e)} is already owned`);
|
|
22220
22244
|
n.destroy();
|
|
22221
22245
|
}
|
|
22222
|
-
let r = (0, ld.createRoot)(e), i = new
|
|
22223
|
-
applicationContext:
|
|
22246
|
+
let r = (0, ld.createRoot)(e), i = new Zv({
|
|
22247
|
+
applicationContext: W_(e),
|
|
22224
22248
|
render(e) {
|
|
22225
22249
|
r !== null && (0, Dl.flushSync)(() => {
|
|
22226
|
-
r?.render((0, w.createElement)(
|
|
22250
|
+
r?.render((0, w.createElement)(j_, {
|
|
22227
22251
|
application: e,
|
|
22228
22252
|
runtime: i
|
|
22229
22253
|
}));
|
|
@@ -22235,10 +22259,10 @@ function $v(e, t) {
|
|
|
22235
22259
|
r = null, (0, Dl.flushSync)(() => e.unmount());
|
|
22236
22260
|
},
|
|
22237
22261
|
releaseHost() {
|
|
22238
|
-
|
|
22262
|
+
Qv.get(e) === i && Qv.delete(e);
|
|
22239
22263
|
}
|
|
22240
22264
|
});
|
|
22241
|
-
return
|
|
22265
|
+
return Qv.set(e, i), i.mount(t);
|
|
22242
22266
|
}
|
|
22243
22267
|
//#endregion
|
|
22244
|
-
export { m as _,
|
|
22268
|
+
export { m as _, Hp as a, $t as c, xt as d, gt as f, v as g, f as h, Bp as i, Qt as l, _ as m, U_ as n, Fd as o, j as p, Lp as r, bn as s, ey as t, Zt as u };
|