@latest-thinking/lt-player 3.0.0-beta.15 → 3.0.0-beta.17

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 CHANGED
@@ -16639,22 +16639,33 @@ function of(e) {
16639
16639
  let t = Math.max(0, Math.floor(Number.isFinite(e) ? e : 0)), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
16640
16640
  return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
16641
16641
  }
16642
- function sf() {
16643
- let e = Kd(), t = (0, w.useMemo)(() => ({
16644
- muted: e.muted,
16645
- volume: e.volume,
16646
- captionsOn: e.captionsOn,
16647
- captionsOff: e.captionsOff,
16648
- paused: e.paused,
16649
- playing: e.playing,
16650
- fullscreen: e.fullscreenEntered,
16651
- exitFullscreen: e.exitFullscreen,
16652
- pictureInPicture: e.pictureInPictureEntered,
16653
- exitPictureInPicture: e.pictureInPictureExited,
16654
- volumeWithValue: (t) => Vd(e, "volumeFeedback", { value: t }),
16655
- seekedTo: (t) => Vd(e, "seekedTo", { time: of(t) }),
16656
- playbackRate: (t) => Vd(e, "playbackRate", { rate: t })
16657
- }), [e]);
16642
+ function sf({ captions: e }) {
16643
+ let t = Kd(), n = (0, w.useMemo)(() => ({
16644
+ muted: t.muted,
16645
+ volume: t.volume,
16646
+ captionsOn: t.captionsOn,
16647
+ captionsOff: t.captionsOff,
16648
+ paused: t.paused,
16649
+ playing: t.playing,
16650
+ fullscreen: t.fullscreenEntered,
16651
+ exitFullscreen: t.exitFullscreen,
16652
+ pictureInPicture: t.pictureInPictureEntered,
16653
+ exitPictureInPicture: t.pictureInPictureExited,
16654
+ volumeWithValue: (e) => Vd(t, "volumeFeedback", { value: e }),
16655
+ seekedTo: (e) => Vd(t, "seekedTo", { time: of(e) }),
16656
+ playbackRate: (e) => Vd(t, "playbackRate", { rate: e })
16657
+ }), [t]);
16658
+ return /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsx)(Tu, {
16659
+ className: "ltp-core-status-announcer",
16660
+ labels: n
16661
+ }), /* @__PURE__ */ (0, N.jsx)("span", {
16662
+ "aria-atomic": "true",
16663
+ "aria-live": "polite",
16664
+ className: "ltp-core-captions-announcer",
16665
+ children: /* @__PURE__ */ (0, N.jsx)("span", { children: e === null ? "" : e.enabled ? t.captionsOn : t.captionsOff }, e?.generation)
16666
+ })] });
16667
+ }
16668
+ function cf() {
16658
16669
  return /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [
16659
16670
  /* @__PURE__ */ (0, N.jsx)(mu.Root, {
16660
16671
  className: "ltp-core-seek-indicator",
@@ -16704,16 +16715,12 @@ function sf() {
16704
16715
  children: t.status === "play" ? /* @__PURE__ */ (0, N.jsx)(Y, { name: "play-landscape" }) : t.status === "pause" ? /* @__PURE__ */ (0, N.jsx)(Y, { name: "pause-landscape" }) : e.children
16705
16716
  })
16706
16717
  })
16707
- }),
16708
- /* @__PURE__ */ (0, N.jsx)(Tu, {
16709
- className: "ltp-core-status-announcer",
16710
- labels: t
16711
16718
  })
16712
16719
  ] });
16713
16720
  }
16714
16721
  //#endregion
16715
16722
  //#region src/capabilities/chapters-model.ts
16716
- function cf(e, t) {
16723
+ function lf(e, t) {
16717
16724
  let n = null;
16718
16725
  for (let r of e) {
16719
16726
  if (r.start > t) break;
@@ -16721,20 +16728,20 @@ function cf(e, t) {
16721
16728
  }
16722
16729
  return n;
16723
16730
  }
16724
- function lf(e) {
16731
+ function uf(e) {
16725
16732
  return e[0]?.start ?? null;
16726
16733
  }
16727
- function uf(e, t, n) {
16734
+ function df(e, t, n) {
16728
16735
  let r = e[t];
16729
16736
  if (r === void 0) return null;
16730
16737
  let i = e[t + 1];
16731
16738
  return i === void 0 ? n === null || !Number.isFinite(n) || n < r.start ? null : Math.max(0, n - r.start) : Math.max(0, i.start - r.start);
16732
16739
  }
16733
- function df(e) {
16740
+ function ff(e) {
16734
16741
  let t = Math.max(0, Math.floor(Number.isFinite(e) ? e : 0)), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
16735
16742
  return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
16736
16743
  }
16737
- function ff(e) {
16744
+ function pf(e) {
16738
16745
  let t = Math.max(0, Math.round(e));
16739
16746
  return Object.freeze({
16740
16747
  minutes: Math.floor(t / 60),
@@ -16743,51 +16750,51 @@ function ff(e) {
16743
16750
  }
16744
16751
  //#endregion
16745
16752
  //#region src/capabilities/interaction-context.tsx
16746
- var pf = (0, w.createContext)(!1);
16747
- function mf({ blocked: e, children: t }) {
16748
- return /* @__PURE__ */ (0, N.jsx)(pf, {
16753
+ var mf = (0, w.createContext)(!1);
16754
+ function hf({ blocked: e, children: t }) {
16755
+ return /* @__PURE__ */ (0, N.jsx)(mf, {
16749
16756
  value: e,
16750
16757
  children: t
16751
16758
  });
16752
16759
  }
16753
- function hf() {
16754
- return (0, w.useContext)(pf);
16760
+ function gf() {
16761
+ return (0, w.useContext)(mf);
16755
16762
  }
16756
16763
  //#endregion
16757
16764
  //#region src/capabilities/chapters.tsx
16758
- function gf(e) {
16765
+ function _f(e) {
16759
16766
  if (e.key !== "chapters") throw Error("Expected the chapters capability module");
16760
16767
  return e;
16761
16768
  }
16762
- function _f(e) {
16769
+ function vf(e) {
16763
16770
  return (0, w.useSyncExternalStore)(e.subscribeInteraction, e.getInteractionSnapshot, e.getInteractionSnapshot);
16764
16771
  }
16765
- function vf(e) {
16772
+ function yf(e) {
16766
16773
  return (0, w.useSyncExternalStore)(e.subscribeMenuPortalTarget, e.getMenuPortalTarget, e.getMenuPortalTarget);
16767
16774
  }
16768
- function yf(e, t) {
16775
+ function bf(e, t) {
16769
16776
  return e !== void 0 && Number.isFinite(e) && e > 0 ? e : Number.isFinite(t) && t > 0 ? t : null;
16770
16777
  }
16771
- function bf(e, t) {
16778
+ function xf(e, t) {
16772
16779
  let { left: n, width: r } = e.getBoundingClientRect();
16773
16780
  return !Number.isFinite(r) || r <= 0 ? 0 : Math.min(100, Math.max(0, (t - n) / r * 100));
16774
16781
  }
16775
- function xf(e, t) {
16782
+ function Sf(e, t) {
16776
16783
  return e.map((n, r) => ({
16777
16784
  startTime: n.start,
16778
16785
  endTime: e[r + 1]?.start ?? t,
16779
16786
  text: n.name
16780
16787
  }));
16781
16788
  }
16782
- function Sf(e, t, n, r) {
16789
+ function Cf(e, t, n, r) {
16783
16790
  let i = Math.max(e, n), a = Math.min(t, r), o = r - n;
16784
16791
  return a <= i || o <= 0 ? null : {
16785
16792
  "--ltp-chapter-buffer-left": `${(i - n) / o * 100}%`,
16786
16793
  "--ltp-chapter-buffer-width": `${(a - i) / o * 100}%`
16787
16794
  };
16788
16795
  }
16789
- function Cf({ buffered: e, chapters: t, duration: n, pointerPercent: r, slider: i }) {
16790
- let [a] = (0, w.useState)(() => new Xs()), [o] = (0, w.useState)(() => new os()), s = (0, w.useMemo)(() => xf(t, n), [t, n]), c = (0, w.useMemo)(() => Ys(s, 0, n), [s, n]), l = (0, w.useMemo)(() => c.map(({ end: e, key: t, start: n }) => ({
16796
+ function wf({ buffered: e, chapters: t, duration: n, pointerPercent: r, slider: i }) {
16797
+ let [a] = (0, w.useState)(() => new Xs()), [o] = (0, w.useState)(() => new os()), s = (0, w.useMemo)(() => Sf(t, n), [t, n]), c = (0, w.useMemo)(() => Ys(s, 0, n), [s, n]), l = (0, w.useMemo)(() => c.map(({ end: e, key: t, start: n }) => ({
16791
16798
  key: t,
16792
16799
  start: n,
16793
16800
  end: e
@@ -16812,7 +16819,7 @@ function Cf({ buffered: e, chapters: t, duration: n, pointerPercent: r, slider:
16812
16819
  "--ltp-chapter-segment-fill": `${n.fillPercent}%`,
16813
16820
  "--ltp-chapter-segment-buffer": `${n.bufferPercent}%`
16814
16821
  }, s = e.flatMap(([e, n], r) => {
16815
- let i = Sf(e, n, t.start, t.end);
16822
+ let i = Cf(e, n, t.start, t.end);
16816
16823
  return i === null ? [] : [/* @__PURE__ */ (0, N.jsx)("span", {
16817
16824
  className: "ltp-chapters-timeline__buffer-range",
16818
16825
  style: i
@@ -16835,8 +16842,8 @@ function Cf({ buffered: e, chapters: t, duration: n, pointerPercent: r, slider:
16835
16842
  })
16836
16843
  });
16837
16844
  }
16838
- function wf({ module: e, slot: t, state: n, surfaceId: r }) {
16839
- gf(e);
16845
+ function Tf({ module: e, slot: t, state: n, surfaceId: r }) {
16846
+ _f(e);
16840
16847
  let i = fd(), a = Lt($r), o = qd("seek"), s = a?.buffered ?? [], [c, l] = (0, w.useState)(null);
16841
16848
  return i.controls.timeline.enabled ? /* @__PURE__ */ (0, N.jsx)(Vu.Root, {
16842
16849
  className: "ltp-core-timeline ltp-chapters-timeline",
@@ -16847,15 +16854,15 @@ function wf({ module: e, slot: t, state: n, surfaceId: r }) {
16847
16854
  "data-ltp-surface": r,
16848
16855
  label: o,
16849
16856
  render: (e, t) => {
16850
- let n = Number.isFinite(t.duration) && t.duration > 0 ? t.duration : null, r = c ?? t.pointerPercent, a = n === null ? null : cf(i.content.chapters, r / 100 * n);
16857
+ let n = Number.isFinite(t.duration) && t.duration > 0 ? t.duration : null, r = c ?? t.pointerPercent, a = n === null ? null : lf(i.content.chapters, r / 100 * n);
16851
16858
  return /* @__PURE__ */ (0, N.jsx)("div", {
16852
16859
  ...e,
16853
16860
  "data-ltp-chapter-segments": n === null ? void 0 : "",
16854
16861
  onPointerDown: (t) => {
16855
- e.onPointerDown?.(t), l(bf(t.currentTarget, t.clientX));
16862
+ e.onPointerDown?.(t), l(xf(t.currentTarget, t.clientX));
16856
16863
  },
16857
16864
  onPointerMove: (t) => {
16858
- e.onPointerMove?.(t), l(bf(t.currentTarget, t.clientX));
16865
+ e.onPointerMove?.(t), l(xf(t.currentTarget, t.clientX));
16859
16866
  },
16860
16867
  children: /* @__PURE__ */ (0, N.jsx)(Qd, {
16861
16868
  buffered: s,
@@ -16864,7 +16871,7 @@ function wf({ module: e, slot: t, state: n, surfaceId: r }) {
16864
16871
  className: "ltp-chapters-trigger__name ltp-core-timeline__preview-chapter",
16865
16872
  children: a.name
16866
16873
  }),
16867
- segments: n === null ? void 0 : /* @__PURE__ */ (0, N.jsx)(Cf, {
16874
+ segments: n === null ? void 0 : /* @__PURE__ */ (0, N.jsx)(wf, {
16868
16875
  buffered: s,
16869
16876
  chapters: i.content.chapters,
16870
16877
  duration: n,
@@ -16877,8 +16884,8 @@ function wf({ module: e, slot: t, state: n, surfaceId: r }) {
16877
16884
  step: i.controls.timeline.seekStep
16878
16885
  }) : null;
16879
16886
  }
16880
- function Tf({ module: e, slot: t, state: n, surfaceId: r }) {
16881
- let i = gf(e), a = fd(), o = Lt(si), s = qd("chapters"), c = _f(i), l = vf(i), u = cf(a.content.chapters, o?.currentTime ?? 0), d = hf();
16887
+ function Ef({ module: e, slot: t, state: n, surfaceId: r }) {
16888
+ let i = _f(e), a = fd(), o = Lt(si), s = qd("chapters"), c = vf(i), l = yf(i), u = lf(a.content.chapters, o?.currentTime ?? 0), d = gf();
16882
16889
  return (0, w.useEffect)(() => {
16883
16890
  d && i.close();
16884
16891
  }, [d, i]), (0, w.useEffect)(() => () => {
@@ -16910,18 +16917,18 @@ function Tf({ module: e, slot: t, state: n, surfaceId: r }) {
16910
16917
  className: "ltp-core-tooltip",
16911
16918
  children: /* @__PURE__ */ (0, N.jsx)(Zu.Label, { children: s })
16912
16919
  })]
16913
- }), d || l === null ? null : (0, Dl.createPortal)(/* @__PURE__ */ (0, N.jsx)(Df, {
16920
+ }), d || l === null ? null : (0, Dl.createPortal)(/* @__PURE__ */ (0, N.jsx)(Of, {
16914
16921
  module: i,
16915
16922
  state: n
16916
16923
  }), l)]
16917
16924
  });
16918
16925
  }
16919
- function Ef(e, t) {
16920
- let { minutes: n, seconds: r } = ff(e), i = [];
16926
+ function Df(e, t) {
16927
+ let { minutes: n, seconds: r } = pf(e), i = [];
16921
16928
  return n > 0 && i.push(Vd(t, "chapterMinute", { count: n })), (r > 0 || i.length === 0) && i.push(Vd(t, "chapterSecond", { count: r })), i.join(" ");
16922
16929
  }
16923
- function Df({ module: e, state: t }) {
16924
- let n = fd(), r = Lt(si), i = qd("chapters"), a = Kd(), o = yf(n.content.duration, r?.duration ?? 0), s = cf(n.content.chapters, r?.currentTime ?? 0);
16930
+ function Of({ module: e, state: t }) {
16931
+ let n = fd(), r = Lt(si), i = qd("chapters"), a = Kd(), o = bf(n.content.duration, r?.duration ?? 0), s = lf(n.content.chapters, r?.currentTime ?? 0);
16925
16932
  return /* @__PURE__ */ (0, N.jsx)(q.Popup, {
16926
16933
  className: "ltp-chapters-menu",
16927
16934
  "data-ltp-capability": "chapters",
@@ -16933,7 +16940,7 @@ function Df({ module: e, state: t }) {
16933
16940
  "aria-label": i,
16934
16941
  className: "ltp-chapters-menu__content",
16935
16942
  children: n.content.chapters.map((t, i) => {
16936
- let c = uf(n.content.chapters, i, o), l = s === t;
16943
+ let c = df(n.content.chapters, i, o), l = s === t;
16937
16944
  return /* @__PURE__ */ (0, N.jsxs)(q.Item, {
16938
16945
  "aria-current": l || void 0,
16939
16946
  className: "ltp-chapters-menu__item",
@@ -16954,20 +16961,20 @@ function Df({ module: e, state: t }) {
16954
16961
  }) : null]
16955
16962
  }), c === null ? null : /* @__PURE__ */ (0, N.jsx)("span", {
16956
16963
  className: "ltp-chapters-menu__duration",
16957
- children: Ef(c, a)
16964
+ children: Df(c, a)
16958
16965
  })]
16959
16966
  }), /* @__PURE__ */ (0, N.jsx)("time", {
16960
16967
  className: "ltp-chapters-menu__start",
16961
16968
  dateTime: `PT${t.start}S`,
16962
- children: df(t.start)
16969
+ children: ff(t.start)
16963
16970
  })]
16964
16971
  }, `${t.start}:${t.name}`);
16965
16972
  })
16966
16973
  })
16967
16974
  });
16968
16975
  }
16969
- function Of({ module: e, slot: t, state: n, surfaceId: r }) {
16970
- let i = gf(e), a = (0, w.useMemo)(() => (e) => i.setMenuPortalTarget(e), [i]);
16976
+ function kf({ module: e, slot: t, state: n, surfaceId: r }) {
16977
+ let i = _f(e), a = (0, w.useMemo)(() => (e) => i.setMenuPortalTarget(e), [i]);
16971
16978
  return /* @__PURE__ */ (0, N.jsx)("span", {
16972
16979
  className: "ltp-chapters-menu-anchor",
16973
16980
  "data-ltp-capability": "chapters",
@@ -16979,23 +16986,23 @@ function Of({ module: e, slot: t, state: n, surfaceId: r }) {
16979
16986
  }
16980
16987
  //#endregion
16981
16988
  //#region src/core/authored-text-tracks.ts
16982
- var kf = "data-ltp-authored-track";
16983
- function Af(e) {
16984
- return e === null ? [] : Array.from(e.querySelectorAll(`track[${kf}]`));
16985
- }
16989
+ var Af = "data-ltp-authored-track";
16986
16990
  function jf(e) {
16987
- return new Set(Af(e).map((e) => e.track).filter((e) => e != null));
16991
+ return e === null ? [] : Array.from(e.querySelectorAll(`track[${Af}]`));
16988
16992
  }
16989
16993
  function Mf(e) {
16990
- return Af(e).filter((e) => !e.hasAttribute("data-ltp-track-failed")).map((e) => e.track).filter((e) => e != null);
16994
+ return new Set(jf(e).map((e) => e.track).filter((e) => e != null));
16991
16995
  }
16992
16996
  function Nf(e) {
16993
- let t = jf(e);
16997
+ return jf(e).filter((e) => !e.hasAttribute("data-ltp-track-failed")).map((e) => e.track).filter((e) => e != null);
16998
+ }
16999
+ function Pf(e) {
17000
+ let t = Mf(e);
16994
17001
  for (let n of Array.from(e.textTracks)) !t.has(n) && n.mode !== "disabled" && (n.mode = "disabled");
16995
17002
  }
16996
- function Pf(e, t) {
17003
+ function Ff(e, t) {
16997
17004
  let n = () => {
16998
- Nf(e), t?.(jf(e));
17005
+ Pf(e), t?.(Mf(e));
16999
17006
  };
17000
17007
  return e.textTracks.addEventListener("addtrack", n), e.textTracks.addEventListener("change", n), e.addEventListener("addtrack", n), e.addEventListener("change", n), n(), () => {
17001
17008
  e.textTracks.removeEventListener("addtrack", n), e.textTracks.removeEventListener("change", n), e.removeEventListener("addtrack", n), e.removeEventListener("change", n);
@@ -17003,30 +17010,30 @@ function Pf(e, t) {
17003
17010
  }
17004
17011
  //#endregion
17005
17012
  //#region src/user-state/user-state-context.tsx
17006
- var Ff = (0, w.createContext)(null);
17007
- function If({ children: e, controller: t }) {
17008
- return /* @__PURE__ */ (0, N.jsx)(Ff, {
17013
+ var If = (0, w.createContext)(null);
17014
+ function Lf({ children: e, controller: t }) {
17015
+ return /* @__PURE__ */ (0, N.jsx)(If, {
17009
17016
  value: t,
17010
17017
  children: e
17011
17018
  });
17012
17019
  }
17013
- function Lf() {
17014
- let e = (0, w.useContext)(Ff);
17020
+ function Rf() {
17021
+ let e = (0, w.useContext)(If);
17015
17022
  if (e === null) throw Error("useUserStateController must be used within UserStateProvider");
17016
17023
  return e;
17017
17024
  }
17018
17025
  //#endregion
17019
17026
  //#region src/capabilities/captions-model.ts
17020
- function Rf(e) {
17027
+ function zf(e) {
17021
17028
  return e === "captions" || e === "subtitles";
17022
17029
  }
17023
- function zf(e) {
17030
+ function Bf(e) {
17024
17031
  return e === "hidden" || e === "showing";
17025
17032
  }
17026
- function Bf(e) {
17033
+ function Vf(e) {
17027
17034
  return `ltp-text-track-${e}`;
17028
17035
  }
17029
- function Vf(e) {
17036
+ function Hf(e) {
17030
17037
  if (typeof e != "object" || !e) return "";
17031
17038
  let t = e;
17032
17039
  if (typeof t.getCueAsHTML == "function") try {
@@ -17034,34 +17041,34 @@ function Vf(e) {
17034
17041
  } catch {}
17035
17042
  return typeof t.text == "string" ? t.text.trim() : "";
17036
17043
  }
17037
- function Hf(e, t) {
17044
+ function Uf(e, t) {
17038
17045
  let n = () => {
17039
- t(Object.freeze(Array.from(e.activeCues ?? []).map((e) => Vf(e)).filter((e) => e.length > 0)));
17046
+ t(Object.freeze(Array.from(e.activeCues ?? []).map((e) => Hf(e)).filter((e) => e.length > 0)));
17040
17047
  };
17041
17048
  return e.addEventListener("cuechange", n), n(), () => e.removeEventListener("cuechange", n);
17042
17049
  }
17043
17050
  //#endregion
17044
17051
  //#region src/capabilities/captions.tsx
17045
- var Uf = (0, w.createContext)(null);
17046
- function Wf(e) {
17052
+ var Wf = (0, w.createContext)(null);
17053
+ function Gf(e) {
17047
17054
  if (e.key !== "captions") throw Error("Expected the captions capability module");
17048
17055
  return e;
17049
17056
  }
17050
- function Gf(e) {
17057
+ function Kf(e) {
17051
17058
  return (0, w.useSyncExternalStore)(e.subscribeInteraction, e.getInteractionSnapshot, e.getInteractionSnapshot);
17052
17059
  }
17053
- function Kf(e) {
17060
+ function qf(e) {
17054
17061
  return (0, w.useSyncExternalStore)(e.subscribeMenuPortalTarget, e.getMenuPortalTarget, e.getMenuPortalTarget);
17055
17062
  }
17056
- function qf() {
17057
- let e = (0, w.useContext)(Uf);
17063
+ function Jf() {
17064
+ let e = (0, w.useContext)(Wf);
17058
17065
  if (e === null) throw Error("Captions runtime hooks must be used within CaptionsRuntimeProvider");
17059
17066
  return e;
17060
17067
  }
17061
- function Jf() {
17062
- return (0, w.useContext)(Uf);
17068
+ function Yf() {
17069
+ return (0, w.useContext)(Wf);
17063
17070
  }
17064
- function Yf({ module: e, slot: t, state: n, surfaceId: r }) {
17071
+ function Xf({ module: e, slot: t, state: n, surfaceId: r }) {
17065
17072
  return /* @__PURE__ */ (0, N.jsx)("span", {
17066
17073
  "aria-hidden": "true",
17067
17074
  "data-ltp-capability": e.key,
@@ -17071,14 +17078,14 @@ function Yf({ module: e, slot: t, state: n, surfaceId: r }) {
17071
17078
  hidden: !0
17072
17079
  });
17073
17080
  }
17074
- function Xf({ children: e, generation: t, media: n }) {
17075
- let r = Lt(oi), i = fd(), a = Lf(), o = Gf(Jm().getModule("captions")), [s, c] = (0, w.useState)(Object.freeze([])), [l, u] = (0, w.useState)(0);
17076
- (0, w.useLayoutEffect)(() => u((e) => e + 1), [t]);
17077
- let d = (0, w.useMemo)(() => {
17078
- let e = Af(n);
17081
+ function Zf({ children: e, generation: t, media: n }) {
17082
+ let r = Lt(oi), i = fd(), a = Rf(), o = Kf(Xm().getModule("captions")), [s, c] = (0, w.useState)(Object.freeze([])), [l, u] = (0, w.useState)(null), [d, f] = (0, w.useState)(0);
17083
+ (0, w.useLayoutEffect)(() => f((e) => e + 1), [t]);
17084
+ let p = (0, w.useMemo)(() => {
17085
+ let e = jf(n);
17079
17086
  return Object.freeze(i.content.tracks.flatMap((t, n) => {
17080
- if (!Rf(t.kind ?? "")) return [];
17081
- let r = e[n], i = r?.id ?? Bf(n);
17087
+ if (!zf(t.kind ?? "")) return [];
17088
+ let r = e[n], i = r?.id ?? Vf(n);
17082
17089
  if (r?.hasAttribute("data-ltp-track-failed")) return [];
17083
17090
  let a = r?.track;
17084
17091
  return [Object.freeze({
@@ -17094,56 +17101,74 @@ function Xf({ children: e, generation: t, media: n }) {
17094
17101
  o.failedTrackIds,
17095
17102
  n,
17096
17103
  r?.textTrackList,
17097
- l
17098
- ]), f = d.find((e) => zf(e.mode)) ?? null;
17104
+ d
17105
+ ]), m = p.find((e) => Bf(e.mode)) ?? null;
17099
17106
  (0, w.useLayoutEffect)(() => {
17100
- if (n !== null) return Pf(n, (e) => {
17101
- for (let t of e) Rf(t.kind) && t.mode === "showing" && (t.mode = "hidden");
17107
+ if (n !== null) return Ff(n, (e) => {
17108
+ for (let t of e) zf(t.kind) && t.mode === "showing" && (t.mode = "hidden");
17102
17109
  });
17103
17110
  }, [
17104
17111
  t,
17105
17112
  n,
17106
17113
  r?.textTrackList
17107
17114
  ]), (0, w.useEffect)(() => {
17108
- let e = n === null || f === null ? void 0 : Array.from(n.textTracks).find((e) => e.id === f.id);
17115
+ let e = n === null || m === null ? void 0 : Array.from(n.textTracks).find((e) => e.id === m.id);
17109
17116
  if (e === void 0) {
17110
17117
  c(Object.freeze([]));
17111
17118
  return;
17112
17119
  }
17113
- return Hf(e, c);
17120
+ return Uf(e, c);
17114
17121
  }, [
17115
17122
  t,
17116
17123
  n,
17117
- f?.id
17124
+ m?.id
17118
17125
  ]);
17119
- let p = (0, w.useCallback)(() => {
17120
- a.setCaptions(f === null);
17121
- }, [f, a]), m = (0, w.useCallback)(() => a.setCaptions(!1), [a]), h = (0, w.useCallback)((e) => {
17122
- let t = d.find((t) => t.id === e);
17123
- t !== void 0 && a.selectCaptionTrack(t.id, t.language);
17124
- }, [d, a]), g = (0, w.useMemo)(() => Object.freeze({
17126
+ let h = (0, w.useCallback)((e) => {
17127
+ u((t) => ({
17128
+ enabled: e,
17129
+ generation: (t?.generation ?? 0) + 1
17130
+ }));
17131
+ }, []), g = (0, w.useCallback)(() => {
17132
+ let e = m === null;
17133
+ a.setCaptions(e), h(e);
17134
+ }, [
17135
+ h,
17136
+ m,
17137
+ a
17138
+ ]), _ = (0, w.useCallback)(() => {
17139
+ a.setCaptions(!1), h(!1);
17140
+ }, [h, a]), v = (0, w.useCallback)((e) => {
17141
+ let t = p.find((t) => t.id === e);
17142
+ t !== void 0 && (a.selectCaptionTrack(t.id, t.language), h(!0));
17143
+ }, [
17144
+ h,
17145
+ p,
17146
+ a
17147
+ ]), y = (0, w.useMemo)(() => Object.freeze({
17125
17148
  activeCues: s,
17126
- available: d.length > 0,
17127
- disable: m,
17128
- selectedTrack: f,
17129
- tracks: d,
17130
- selectTrack: h,
17131
- toggle: p
17149
+ announcement: l,
17150
+ available: p.length > 0,
17151
+ disable: _,
17152
+ selectedTrack: m,
17153
+ tracks: p,
17154
+ selectTrack: v,
17155
+ toggle: g
17132
17156
  }), [
17133
17157
  s,
17158
+ l,
17159
+ _,
17160
+ v,
17134
17161
  m,
17135
- h,
17136
- f,
17137
- p,
17138
- d
17162
+ g,
17163
+ p
17139
17164
  ]);
17140
- return /* @__PURE__ */ (0, N.jsx)(Uf, {
17141
- value: g,
17165
+ return /* @__PURE__ */ (0, N.jsx)(Wf, {
17166
+ value: y,
17142
17167
  children: e
17143
17168
  });
17144
17169
  }
17145
- function Zf({ index: e, track: t }) {
17146
- let n = Jm().getModule("captions"), r = Lf(), i = Bf(e), a = Rf(t.kind ?? "");
17170
+ function Qf({ index: e, track: t }) {
17171
+ let n = Xm().getModule("captions"), r = Rf(), i = Vf(e), a = zf(t.kind ?? "");
17147
17172
  return /* @__PURE__ */ (0, N.jsx)("track", {
17148
17173
  "data-ltp-authored-track": "",
17149
17174
  "data-ltp-caption-track": a || void 0,
@@ -17157,15 +17182,15 @@ function Zf({ index: e, track: t }) {
17157
17182
  srcLang: t.srclang
17158
17183
  });
17159
17184
  }
17160
- function Qf({ enabled: e }) {
17185
+ function $f({ enabled: e }) {
17161
17186
  return /* @__PURE__ */ (0, N.jsx)("span", {
17162
17187
  "aria-hidden": "true",
17163
17188
  className: "ltp-captions-control__icon",
17164
17189
  children: /* @__PURE__ */ (0, N.jsx)(Y, { name: e ? "subtitles-on" : "subtitles-off" })
17165
17190
  });
17166
17191
  }
17167
- function $f() {
17168
- let e = qf(), t = qd("enableCaptions"), n = qd("disableCaptions"), r = e.selectedTrack !== null, i = r ? n : t;
17192
+ function ep() {
17193
+ let e = Jf(), t = qd("enableCaptions"), n = qd("disableCaptions"), r = e.selectedTrack !== null, i = r ? n : t;
17169
17194
  return /* @__PURE__ */ (0, N.jsxs)(Zu.Root, {
17170
17195
  side: "top",
17171
17196
  children: [/* @__PURE__ */ (0, N.jsx)(Zu.Trigger, { render: /* @__PURE__ */ (0, N.jsx)("button", {
@@ -17174,15 +17199,15 @@ function $f() {
17174
17199
  className: "ltp-core-button ltp-captions-control",
17175
17200
  onClick: e.toggle,
17176
17201
  type: "button",
17177
- children: /* @__PURE__ */ (0, N.jsx)(Qf, { enabled: r })
17202
+ children: /* @__PURE__ */ (0, N.jsx)($f, { enabled: r })
17178
17203
  }) }), /* @__PURE__ */ (0, N.jsx)(Zu.Popup, {
17179
17204
  className: "ltp-core-tooltip",
17180
17205
  children: /* @__PURE__ */ (0, N.jsx)(Zu.Label, { children: i })
17181
17206
  })]
17182
17207
  });
17183
17208
  }
17184
- function ep({ module: e, state: t }) {
17185
- let n = qf(), r = qd("captions"), i = qd("captionsOffOption"), a = n.selectedTrack?.id ?? "off";
17209
+ function tp({ module: e, state: t }) {
17210
+ let n = Jf(), r = qd("captions"), i = qd("captionsOffOption"), a = n.selectedTrack?.id ?? "off";
17186
17211
  return /* @__PURE__ */ (0, N.jsx)(q.Popup, {
17187
17212
  className: "ltp-captions-menu",
17188
17213
  "data-ltp-capability": "captions",
@@ -17221,13 +17246,13 @@ function ep({ module: e, state: t }) {
17221
17246
  })
17222
17247
  });
17223
17248
  }
17224
- function tp({ module: e, slot: t, state: n, surfaceId: r }) {
17225
- let i = Wf(e), a = Jf(), o = Gf(i), s = Kf(i), c = hf(), l = qd("captions"), u = a?.selectedTrack !== null;
17249
+ function np({ module: e, slot: t, state: n, surfaceId: r }) {
17250
+ let i = Gf(e), a = Yf(), o = Kf(i), s = qf(i), c = gf(), l = qd("captions"), u = a?.selectedTrack !== null;
17226
17251
  return (0, w.useEffect)(() => {
17227
17252
  c && i.close();
17228
17253
  }, [c, i]), (0, w.useEffect)(() => () => {
17229
17254
  i.close();
17230
- }, [i]), a === null ? /* @__PURE__ */ (0, N.jsx)(Yf, {
17255
+ }, [i]), a === null ? /* @__PURE__ */ (0, N.jsx)(Xf, {
17231
17256
  module: e,
17232
17257
  slot: t,
17233
17258
  state: n,
@@ -17237,7 +17262,7 @@ function tp({ module: e, slot: t, state: n, surfaceId: r }) {
17237
17262
  "data-ltp-slot": t,
17238
17263
  "data-ltp-state": n,
17239
17264
  "data-ltp-surface": r,
17240
- children: /* @__PURE__ */ (0, N.jsx)($f, {})
17265
+ children: /* @__PURE__ */ (0, N.jsx)(ep, {})
17241
17266
  }) : /* @__PURE__ */ (0, N.jsxs)(q.Root, {
17242
17267
  align: "end",
17243
17268
  onOpenChange: (e) => i.setOpen(e),
@@ -17253,21 +17278,21 @@ function tp({ module: e, slot: t, state: n, surfaceId: r }) {
17253
17278
  "data-ltp-slot": t,
17254
17279
  "data-ltp-state": n,
17255
17280
  "data-ltp-surface": r,
17256
- children: /* @__PURE__ */ (0, N.jsx)(Qf, { enabled: u })
17281
+ children: /* @__PURE__ */ (0, N.jsx)($f, { enabled: u })
17257
17282
  }) }), /* @__PURE__ */ (0, N.jsx)(Zu.Popup, {
17258
17283
  className: "ltp-core-tooltip",
17259
17284
  children: /* @__PURE__ */ (0, N.jsx)(Zu.Label, { children: l })
17260
17285
  })]
17261
- }), c || s === null ? null : (0, Dl.createPortal)(/* @__PURE__ */ (0, N.jsx)(ep, {
17286
+ }), c || s === null ? null : (0, Dl.createPortal)(/* @__PURE__ */ (0, N.jsx)(tp, {
17262
17287
  module: i,
17263
17288
  state: n
17264
17289
  }), s)]
17265
17290
  }) : null;
17266
17291
  }
17267
- function np({ module: e, slot: t, state: n, surfaceId: r }) {
17268
- Wf(e);
17269
- let i = Jf();
17270
- return i === null ? /* @__PURE__ */ (0, N.jsx)(Yf, {
17292
+ function rp({ module: e, slot: t, state: n, surfaceId: r }) {
17293
+ Gf(e);
17294
+ let i = Yf();
17295
+ return i === null ? /* @__PURE__ */ (0, N.jsx)(Xf, {
17271
17296
  module: e,
17272
17297
  slot: t,
17273
17298
  state: n,
@@ -17285,8 +17310,8 @@ function np({ module: e, slot: t, state: n, surfaceId: r }) {
17285
17310
  }, `${e}:${t}`))
17286
17311
  });
17287
17312
  }
17288
- function rp({ module: e, slot: t, state: n, surfaceId: r }) {
17289
- let i = Wf(e), a = (0, w.useMemo)(() => (e) => i.setMenuPortalTarget(e), [i]);
17313
+ function ip({ module: e, slot: t, state: n, surfaceId: r }) {
17314
+ let i = Gf(e), a = (0, w.useMemo)(() => (e) => i.setMenuPortalTarget(e), [i]);
17290
17315
  return /* @__PURE__ */ (0, N.jsx)("span", {
17291
17316
  className: "ltp-captions-menu-anchor",
17292
17317
  "data-ltp-capability": "captions",
@@ -17298,7 +17323,7 @@ function rp({ module: e, slot: t, state: n, surfaceId: r }) {
17298
17323
  }
17299
17324
  //#endregion
17300
17325
  //#region src/capabilities/speed.tsx
17301
- function ip(e, t, n) {
17326
+ function ap(e, t, n) {
17302
17327
  if (e.length === 0) return null;
17303
17328
  let r = e.indexOf(t);
17304
17329
  if (r >= 0) return e[(r + (n === "forward" ? 1 : -1) + e.length) % e.length] ?? null;
@@ -17309,12 +17334,12 @@ function ip(e, t, n) {
17309
17334
  }
17310
17335
  return e.at(-1) ?? null;
17311
17336
  }
17312
- function ap(e) {
17337
+ function op(e) {
17313
17338
  return `${e}x`;
17314
17339
  }
17315
- function op({ module: e, slot: t, state: n, surfaceId: r }) {
17340
+ function sp({ module: e, slot: t, state: n, surfaceId: r }) {
17316
17341
  if (e.key !== "speed") throw Error("Expected the speed capability module");
17317
- let i = Lt(ai), a = fd(), o = Kd(), s = Lf(), c = hf(), l = Mc("speedUp"), [u] = (0, w.useState)(() => new Lo()), d = i?.playbackRate ?? a.initialState.playbackRate, f = Vd(o, "playbackRate", { rate: d }), p = i ? {
17342
+ let i = Lt(ai), a = fd(), o = Kd(), s = Rf(), c = gf(), l = Mc("speedUp"), [u] = (0, w.useState)(() => new Lo()), d = i?.playbackRate ?? a.initialState.playbackRate, f = Vd(o, "playbackRate", { rate: d }), p = i ? {
17318
17343
  playbackRate: d,
17319
17344
  playbackRates: a.capabilities.speed.options,
17320
17345
  setPlaybackRate: (e) => s.setPlaybackRate(e)
@@ -17328,7 +17353,7 @@ function op({ module: e, slot: t, state: n, surfaceId: r }) {
17328
17353
  isDisabled: () => c || p === null,
17329
17354
  onActivate: () => {
17330
17355
  if (p === null) return;
17331
- let e = ip(p.playbackRates, p.playbackRate, "forward");
17356
+ let e = ap(p.playbackRates, p.playbackRate, "forward");
17332
17357
  e !== null && s.setPlaybackRate(e);
17333
17358
  }
17334
17359
  });
@@ -17350,7 +17375,7 @@ function op({ module: e, slot: t, state: n, surfaceId: r }) {
17350
17375
  children: /* @__PURE__ */ (0, N.jsx)("span", {
17351
17376
  "aria-hidden": "true",
17352
17377
  className: "ltp-speed-control__value",
17353
- children: ap(m.rate)
17378
+ children: op(m.rate)
17354
17379
  })
17355
17380
  });
17356
17381
  return /* @__PURE__ */ (0, N.jsxs)(Zu.Root, {
@@ -17364,7 +17389,7 @@ function op({ module: e, slot: t, state: n, surfaceId: r }) {
17364
17389
  }
17365
17390
  //#endregion
17366
17391
  //#region src/capabilities/share.tsx
17367
- var sp = Object.freeze([
17392
+ var cp = Object.freeze([
17368
17393
  "link",
17369
17394
  "embed",
17370
17395
  "facebook",
@@ -17372,13 +17397,13 @@ var sp = Object.freeze([
17372
17397
  "linkedin",
17373
17398
  "whatsapp",
17374
17399
  "more"
17375
- ]), cp = 574;
17376
- function lp(e, t = typeof navigator < "u" && typeof navigator.share == "function") {
17400
+ ]), lp = 574;
17401
+ function up(e, t = typeof navigator < "u" && typeof navigator.share == "function") {
17377
17402
  if (!e.canonicalUrl) return [];
17378
17403
  let n = new Set(e.targets);
17379
- return sp.filter((r) => n.has(r) ? r === "embed" ? !!e.embedUrl : r !== "more" || t : !1);
17404
+ return cp.filter((r) => n.has(r) ? r === "embed" ? !!e.embedUrl : r !== "more" || t : !1);
17380
17405
  }
17381
- function up(e, t) {
17406
+ function dp(e, t) {
17382
17407
  let n = {
17383
17408
  author: t.author ?? "",
17384
17409
  title: t.title ?? "",
@@ -17386,25 +17411,29 @@ function up(e, t) {
17386
17411
  };
17387
17412
  return e.replace(/\{([^{}]+)\}/g, (e, t) => Object.hasOwn(n, t) ? n[t] : e);
17388
17413
  }
17389
- function dp(e) {
17414
+ function fp(e) {
17390
17415
  return e.replace(/[&"<>]/g, (e) => e === "&" ? "&amp;" : e === "\"" ? "&quot;" : e === "<" ? "&lt;" : "&gt;");
17391
17416
  }
17392
- function fp(e, t, n) {
17393
- let r = dp(e), i = dp(t);
17417
+ function pp(e, t, n) {
17418
+ let r = fp(e), i = fp(t);
17394
17419
  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; gyroscope; web-share"></iframe>`;
17395
17420
  }
17396
- function pp(e) {
17421
+ function mp(e) {
17397
17422
  if (e.key !== "share") throw Error("Expected the share capability module");
17398
17423
  return e;
17399
17424
  }
17400
- function mp(e) {
17425
+ function hp(e) {
17401
17426
  return (0, w.useSyncExternalStore)(e.subscribeInteraction, e.getInteractionSnapshot, e.getInteractionSnapshot);
17402
17427
  }
17403
- function hp(e) {
17404
- return e !== null && e.classList.contains("ltp-landscape") && !e.matches(":fullscreen") && e.clientWidth > 0 && e.clientWidth < cp;
17428
+ function gp(e) {
17429
+ let t = e.ownerDocument;
17430
+ return (t.fullscreenElement ?? t.webkitFullscreenElement) === e;
17431
+ }
17432
+ function _p(e) {
17433
+ return e !== null && e.classList.contains("ltp-landscape") && !gp(e) && e.clientWidth > 0 && e.clientWidth < lp;
17405
17434
  }
17406
- function gp({ children: e, module: t }) {
17407
- let n = mp(t);
17435
+ function vp({ children: e, module: t }) {
17436
+ let n = hp(t);
17408
17437
  return /* @__PURE__ */ (0, N.jsx)(ru.Root, {
17409
17438
  closeOnEscape: !1,
17410
17439
  closeOnOutsideClick: !1,
@@ -17419,8 +17448,8 @@ function gp({ children: e, module: t }) {
17419
17448
  })
17420
17449
  });
17421
17450
  }
17422
- function _p({ module: e, slot: t, state: n, surfaceId: r }) {
17423
- let i = mp(pp(e)), { playerTrigger: a } = fd().capabilities.share, o = qd("share");
17451
+ function yp({ module: e, slot: t, state: n, surfaceId: r }) {
17452
+ let i = hp(mp(e)), { playerTrigger: a } = fd().capabilities.share, o = qd("share");
17424
17453
  return !a || i.targets.length === 0 ? null : /* @__PURE__ */ (0, N.jsx)(Sl.Trigger, {
17425
17454
  "aria-label": o,
17426
17455
  className: "ltp-share-trigger",
@@ -17432,31 +17461,31 @@ function _p({ module: e, slot: t, state: n, surfaceId: r }) {
17432
17461
  children: /* @__PURE__ */ (0, N.jsx)(Y, { name: "share" })
17433
17462
  });
17434
17463
  }
17435
- var vp = {
17464
+ var bp = {
17436
17465
  facebook: "facebook",
17437
17466
  x: "x",
17438
17467
  linkedin: "linkedin",
17439
17468
  whatsapp: "whatsapp"
17440
- }, yp = {
17469
+ }, xp = {
17441
17470
  facebook: "shareFacebook",
17442
17471
  x: "shareX",
17443
17472
  linkedin: "shareLinkedIn",
17444
17473
  whatsapp: "shareWhatsApp",
17445
17474
  more: "shareMore"
17446
17475
  };
17447
- function bp(e) {
17476
+ function Sp(e) {
17448
17477
  let t = window.open(e, "_blank", "noopener,noreferrer");
17449
17478
  t && (t.opener = null);
17450
17479
  }
17451
- function xp(e, t) {
17452
- let { canonicalUrl: n = "", templates: r } = t.capabilities.share, i = up(r.message, {
17480
+ function Cp(e, t) {
17481
+ let { canonicalUrl: n = "", templates: r } = t.capabilities.share, i = dp(r.message, {
17453
17482
  author: t.content.author,
17454
17483
  title: t.content.title,
17455
17484
  url: n
17456
17485
  });
17457
17486
  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)}`;
17458
17487
  }
17459
- async function Sp(e) {
17488
+ async function wp(e) {
17460
17489
  try {
17461
17490
  if (navigator.clipboard?.writeText) return await navigator.clipboard.writeText(e), !0;
17462
17491
  let t = document.createElement("textarea");
@@ -17467,9 +17496,9 @@ async function Sp(e) {
17467
17496
  return !1;
17468
17497
  }
17469
17498
  }
17470
- function Cp({ interaction: e, module: t, titleId: n }) {
17471
- let r = fd(), i = Kd(), a = e.mode === "embed" && r.capabilities.share.embedUrl ? fp(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) => {
17472
- let t = r.capabilities.share.canonicalUrl ?? "", n = up(r.capabilities.share.templates.message, {
17499
+ function Tp({ interaction: e, module: t, titleId: n }) {
17500
+ let r = fd(), i = Kd(), a = e.mode === "embed" && r.capabilities.share.embedUrl ? pp(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) => {
17501
+ let t = r.capabilities.share.canonicalUrl ?? "", n = dp(r.capabilities.share.templates.message, {
17473
17502
  author: r.content.author,
17474
17503
  title: r.content.title,
17475
17504
  url: t
@@ -17484,7 +17513,7 @@ function Cp({ interaction: e, module: t, titleId: n }) {
17484
17513
  } catch {}
17485
17514
  return;
17486
17515
  }
17487
- bp(xp(e, r));
17516
+ Sp(Cp(e, r));
17488
17517
  };
17489
17518
  return /* @__PURE__ */ (0, N.jsxs)("div", {
17490
17519
  className: "ltp-share-dialog__card",
@@ -17494,6 +17523,8 @@ function Cp({ interaction: e, module: t, titleId: n }) {
17494
17523
  children: [/* @__PURE__ */ (0, N.jsx)("h2", {
17495
17524
  className: "ltp-share-dialog__title",
17496
17525
  id: n,
17526
+ ref: (e) => e?.setAttribute("autofocus", ""),
17527
+ tabIndex: -1,
17497
17528
  children: i.share
17498
17529
  }), /* @__PURE__ */ (0, N.jsx)("button", {
17499
17530
  "aria-label": i.closeShare,
@@ -17521,7 +17552,7 @@ function Cp({ interaction: e, module: t, titleId: n }) {
17521
17552
  type: "button",
17522
17553
  children: /* @__PURE__ */ (0, N.jsx)(Y, { name: "copy-code" })
17523
17554
  }) : null] }), o.map((e) => /* @__PURE__ */ (0, N.jsx)("button", {
17524
- "aria-label": i[yp[e]],
17555
+ "aria-label": i[xp[e]],
17525
17556
  className: "ltp-share-dialog__target",
17526
17557
  onClick: () => void s(e),
17527
17558
  type: "button",
@@ -17529,7 +17560,7 @@ function Cp({ interaction: e, module: t, titleId: n }) {
17529
17560
  "aria-hidden": "true",
17530
17561
  className: "ltp-share-dialog__more",
17531
17562
  children: "…"
17532
- }) : /* @__PURE__ */ (0, N.jsx)(Y, { name: vp[e] })
17563
+ }) : /* @__PURE__ */ (0, N.jsx)(Y, { name: bp[e] })
17533
17564
  }, e))]
17534
17565
  }),
17535
17566
  e.mode === null ? null : /* @__PURE__ */ (0, N.jsxs)("section", {
@@ -17550,7 +17581,7 @@ function Cp({ interaction: e, module: t, titleId: n }) {
17550
17581
  /* @__PURE__ */ (0, N.jsx)("button", {
17551
17582
  className: "ltp-share-dialog__copy",
17552
17583
  onClick: async () => {
17553
- await Sp(a) && t.setCopied(!0);
17584
+ await wp(a) && t.setCopied(!0);
17554
17585
  },
17555
17586
  type: "button",
17556
17587
  children: e.copied ? i.copied : i.copy
@@ -17566,7 +17597,7 @@ function Cp({ interaction: e, module: t, titleId: n }) {
17566
17597
  ]
17567
17598
  });
17568
17599
  }
17569
- function wp({ interaction: e, module: t }) {
17600
+ function Ep({ interaction: e, module: t }) {
17570
17601
  let n = (0, w.useId)();
17571
17602
  return /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsx)(Sl.Backdrop, {
17572
17603
  className: "ltp-share-dialog__player-backdrop",
@@ -17578,14 +17609,14 @@ function wp({ interaction: e, module: t }) {
17578
17609
  onClick: (e) => {
17579
17610
  e.target === e.currentTarget && t.close();
17580
17611
  },
17581
- children: /* @__PURE__ */ (0, N.jsx)(Cp, {
17612
+ children: /* @__PURE__ */ (0, N.jsx)(Tp, {
17582
17613
  interaction: e,
17583
17614
  module: t,
17584
17615
  titleId: n
17585
17616
  })
17586
17617
  })] });
17587
17618
  }
17588
- function Tp(e) {
17619
+ function Dp(e) {
17589
17620
  if (e.key !== "Tab") return;
17590
17621
  let t = [...e.currentTarget.querySelectorAll("button, input")].filter((e) => !e.hasAttribute("disabled") && e.tabIndex >= 0);
17591
17622
  if (t.length === 0) {
@@ -17595,11 +17626,11 @@ function Tp(e) {
17595
17626
  let n = t[0], r = t.at(-1);
17596
17627
  e.shiftKey && document.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n?.focus());
17597
17628
  }
17598
- function Ep({ interaction: e, module: t }) {
17629
+ function Op({ interaction: e, module: t }) {
17599
17630
  let n = (0, w.useRef)(null), r = (0, w.useRef)(null), i = (0, w.useId)();
17600
17631
  return (0, w.useLayoutEffect)(() => {
17601
17632
  let e = n.current;
17602
- if (e) return r.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.showModal(), e.querySelector("[autofocus], button, input")?.focus(), () => {
17633
+ if (e) return r.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.showModal(), e.querySelector(".ltp-share-dialog__title")?.focus(), () => {
17603
17634
  e.open && e.close();
17604
17635
  let t = r.current;
17605
17636
  r.current = null, t?.isConnected && t.focus();
@@ -17615,19 +17646,19 @@ function Ep({ interaction: e, module: t }) {
17615
17646
  onClick: (e) => {
17616
17647
  e.target === e.currentTarget && t.close();
17617
17648
  },
17618
- onKeyDown: Tp,
17649
+ onKeyDown: Dp,
17619
17650
  ref: n,
17620
- children: /* @__PURE__ */ (0, N.jsx)(Cp, {
17651
+ children: /* @__PURE__ */ (0, N.jsx)(Tp, {
17621
17652
  interaction: e,
17622
17653
  module: t,
17623
17654
  titleId: i
17624
17655
  })
17625
17656
  });
17626
17657
  }
17627
- function Dp({ module: e }) {
17628
- let t = pp(e), n = mp(t), r = Bt(), i = Lt(), a = (0, w.useRef)(!1);
17658
+ function kp({ module: e }) {
17659
+ let t = mp(e), n = hp(t), r = Bt(), i = Lt(), a = (0, w.useRef)(!1);
17629
17660
  return (0, w.useLayoutEffect)(() => {
17630
- if (n.open && n.source === "player" && hp(r)) {
17661
+ if (n.open && n.source === "player" && _p(r)) {
17631
17662
  let e = ii(i.state);
17632
17663
  !a.current && e && !e.paused && (a.current = !0, e.pause());
17633
17664
  return;
@@ -17638,17 +17669,17 @@ function Dp({ module: e }) {
17638
17669
  n.open,
17639
17670
  n.source,
17640
17671
  i
17641
- ]), !n.open || n.source === null || r === null ? null : (0, Dl.createPortal)(n.source === "player" ? /* @__PURE__ */ (0, N.jsx)(wp, {
17672
+ ]), !n.open || n.source === null || r === null ? null : (0, Dl.createPortal)(n.source === "player" ? /* @__PURE__ */ (0, N.jsx)(Ep, {
17642
17673
  interaction: n,
17643
17674
  module: t
17644
- }) : /* @__PURE__ */ (0, N.jsx)(Ep, {
17675
+ }) : /* @__PURE__ */ (0, N.jsx)(Op, {
17645
17676
  interaction: n,
17646
17677
  module: t
17647
17678
  }), r);
17648
17679
  }
17649
17680
  //#endregion
17650
17681
  //#region src/presentation-navigation.ts
17651
- var Op = "[data-ltp-presentation-stage]", kp = "ltp-presentation-navigation", Ap = [
17682
+ var Ap = "[data-ltp-presentation-stage]", jp = "ltp-presentation-navigation", Mp = [
17652
17683
  "input",
17653
17684
  "select",
17654
17685
  "textarea",
@@ -17665,38 +17696,38 @@ var Op = "[data-ltp-presentation-stage]", kp = "ltp-presentation-navigation", Ap
17665
17696
  "[role=\"tablist\"][aria-orientation=\"vertical\"]",
17666
17697
  "[role=\"dialog\"][aria-modal=\"true\"]"
17667
17698
  ].join(",");
17668
- function jp(e) {
17699
+ function Np(e) {
17669
17700
  if (!(e instanceof HTMLElement) || e.matches("[role=\"tablist\"]:not([aria-orientation=\"vertical\"]), [role=\"tablist\"][aria-orientation=\"horizontal\"]")) return !1;
17670
17701
  let t = getComputedStyle(e).overflowY;
17671
17702
  return (t === "auto" || t === "scroll" || t === "overlay") && e.scrollHeight > e.clientHeight;
17672
17703
  }
17673
- function Mp(e, t) {
17704
+ function Pp(e, t) {
17674
17705
  if (!(e instanceof Element)) return !1;
17675
17706
  for (let n = e; n && n !== t;) {
17676
- if (n.matches(Ap) || jp(n)) return !0;
17707
+ if (n.matches(Mp) || Np(n)) return !0;
17677
17708
  n = n.parentElement;
17678
17709
  }
17679
17710
  return !1;
17680
17711
  }
17681
- function Np(e, t) {
17682
- return !e.dispatchEvent(new CustomEvent(kp, {
17712
+ function Fp(e, t) {
17713
+ return !e.dispatchEvent(new CustomEvent(jp, {
17683
17714
  cancelable: !0,
17684
17715
  detail: { direction: t }
17685
17716
  }));
17686
17717
  }
17687
- function Pp(e) {
17718
+ function Ip(e) {
17688
17719
  if (!(e instanceof CustomEvent)) return null;
17689
17720
  let t = e.detail;
17690
17721
  return t?.direction === "previous" || t?.direction === "next" ? t.direction : null;
17691
17722
  }
17692
17723
  //#endregion
17693
17724
  //#region src/capabilities/context-panel.tsx
17694
- var Fp = 420, Ip = 650, Lp = 32, Rp = 192, zp = 32;
17695
- function Bp(e, t, n = []) {
17696
- let r = Math.min(Rp, t.width * .12), i = t.width - e.width - zp;
17725
+ var Lp = 420, Rp = 650, zp = 32, Bp = 192, Vp = 32;
17726
+ function Hp(e, t, n = []) {
17727
+ let r = Math.min(Bp, t.width * .12), i = t.width - e.width - Vp;
17697
17728
  if (i < 452) return null;
17698
- let a = Math.max(Lp, Math.min(r, i - Fp)), o = (n) => Math.min(Ip, i - n, t.right - zp - (e.right + n)), s = o(a);
17699
- if (s < Fp && (a = Lp, s = o(a)), s < Fp) return null;
17729
+ let a = Math.max(zp, Math.min(r, i - Lp)), o = (n) => Math.min(Rp, i - n, t.right - Vp - (e.right + n)), s = o(a);
17730
+ if (s < Lp && (a = zp, s = o(a)), s < Lp) return null;
17700
17731
  let c = {
17701
17732
  gap: a,
17702
17733
  left: e.right + a,
@@ -17707,32 +17738,32 @@ function Bp(e, t, n = []) {
17707
17738
  ...c,
17708
17739
  right: c.left + c.width,
17709
17740
  bottom: c.top + c.height
17710
- }, u = l.left >= t.left && l.right <= t.right - zp && 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);
17741
+ }, u = l.left >= t.left && l.right <= t.right - Vp && 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);
17711
17742
  return u && !d ? c : null;
17712
17743
  }
17713
- function Vp(e) {
17744
+ function Up(e) {
17714
17745
  if (e.key !== "contextPanel") throw Error("Expected the context panel capability module");
17715
17746
  return e;
17716
17747
  }
17717
- function Hp(e) {
17748
+ function Wp(e) {
17718
17749
  return (0, w.useSyncExternalStore)(e.subscribeInteraction, e.getInteractionSnapshot, e.getInteractionSnapshot);
17719
17750
  }
17720
- var Up = (0, w.createContext)(null);
17721
- function Wp({ children: e, seek: t }) {
17722
- return /* @__PURE__ */ (0, N.jsx)(Up, {
17751
+ var Gp = (0, w.createContext)(null);
17752
+ function Kp({ children: e, seek: t }) {
17753
+ return /* @__PURE__ */ (0, N.jsx)(Gp, {
17723
17754
  value: { seek: t },
17724
17755
  children: e
17725
17756
  });
17726
17757
  }
17727
- function Gp() {
17728
- let e = (0, w.useContext)(Up);
17758
+ function qp() {
17759
+ let e = (0, w.useContext)(Gp);
17729
17760
  if (e === null) throw Error("Context panel surfaces require a runtime provider");
17730
17761
  return e;
17731
17762
  }
17732
- var Kp = (0, w.createContext)(null);
17733
- function qp({ children: e, module: t }) {
17734
- let n = Hp(t), r = (0, w.useId)();
17735
- return /* @__PURE__ */ (0, N.jsx)(Kp, {
17763
+ var Jp = (0, w.createContext)(null);
17764
+ function Yp({ children: e, module: t }) {
17765
+ let n = Wp(t), r = (0, w.useId)();
17766
+ return /* @__PURE__ */ (0, N.jsx)(Jp, {
17736
17767
  value: r,
17737
17768
  children: /* @__PURE__ */ (0, N.jsx)(ru.Root, {
17738
17769
  closeOnEscape: !1,
@@ -17749,28 +17780,28 @@ function qp({ children: e, module: t }) {
17749
17780
  })
17750
17781
  });
17751
17782
  }
17752
- var Jp = {
17783
+ var Xp = {
17753
17784
  knowledge: "key-concepts",
17754
17785
  underlyingPublication: "underlying-publication",
17755
17786
  relatedVideos: "related-videos"
17756
- }, Yp = {
17787
+ }, Zp = {
17757
17788
  knowledge: "openKnowledge",
17758
17789
  underlyingPublication: "openUnderlyingPublication",
17759
17790
  relatedVideos: "openRelatedVideos"
17760
17791
  };
17761
- function Xp({ module: e, slot: t, state: n, surfaceId: r }) {
17762
- let i = Vp(e), a = Hp(i), o = Kd(), s = hf(), c = (0, w.useContext)(Kp), l = (0, w.useId)(), u = c ?? l, d = (e, t = {}) => /* @__PURE__ */ (0, N.jsx)("button", {
17792
+ function Qp({ module: e, slot: t, state: n, surfaceId: r }) {
17793
+ let i = Up(e), a = Wp(i), o = Kd(), s = gf(), c = (0, w.useContext)(Jp), l = (0, w.useId)(), u = c ?? l, d = (e, t = {}) => /* @__PURE__ */ (0, N.jsx)("button", {
17763
17794
  ...t,
17764
17795
  "aria-controls": u,
17765
17796
  "aria-disabled": s || void 0,
17766
- "aria-label": o[Yp[e]],
17797
+ "aria-label": o[Zp[e]],
17767
17798
  "aria-pressed": a.view === e,
17768
17799
  className: "ltp-context-panel-trigger",
17769
17800
  onClick: (t) => {
17770
17801
  t.preventDefault(), s || i.toggle(e);
17771
17802
  },
17772
17803
  type: "button",
17773
- children: /* @__PURE__ */ (0, N.jsx)(Y, { name: Jp[e] })
17804
+ children: /* @__PURE__ */ (0, N.jsx)(Y, { name: Xp[e] })
17774
17805
  });
17775
17806
  return /* @__PURE__ */ (0, N.jsx)("div", {
17776
17807
  className: "ltp-context-panel-triggers",
@@ -17784,7 +17815,7 @@ function Xp({ module: e, slot: t, state: n, surfaceId: r }) {
17784
17815
  }, e))
17785
17816
  });
17786
17817
  }
17787
- function Zp(e) {
17818
+ function $p(e) {
17788
17819
  return {
17789
17820
  bottom: e.bottom,
17790
17821
  height: e.height,
@@ -17794,7 +17825,7 @@ function Zp(e) {
17794
17825
  width: e.width
17795
17826
  };
17796
17827
  }
17797
- function Qp() {
17828
+ function em() {
17798
17829
  let e = window.visualViewport, t = e?.offsetLeft ?? 0, n = e?.offsetTop ?? 0, r = e?.width ?? window.innerWidth, i = e?.height ?? window.innerHeight;
17799
17830
  return {
17800
17831
  left: t,
@@ -17805,7 +17836,7 @@ function Qp() {
17805
17836
  bottom: n + i
17806
17837
  };
17807
17838
  }
17808
- function $p(e) {
17839
+ function tm(e) {
17809
17840
  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");
17810
17841
  return {
17811
17842
  left: r,
@@ -17816,23 +17847,23 @@ function $p(e) {
17816
17847
  height: o - a
17817
17848
  };
17818
17849
  }
17819
- function em(e) {
17850
+ function nm(e) {
17820
17851
  return e.closest("[data-ltp-presentation-stage]") ?? e;
17821
17852
  }
17822
- function tm(e) {
17823
- return e.matches("[data-ltp-presentation-stage]") ? Zp(e.getBoundingClientRect()) : $p(e);
17853
+ function rm(e) {
17854
+ return e.matches("[data-ltp-presentation-stage]") ? $p(e.getBoundingClientRect()) : tm(e);
17824
17855
  }
17825
- function nm(e, t) {
17826
- let n = Zp(e.getBoundingClientRect());
17856
+ function im(e, t) {
17857
+ let n = $p(e.getBoundingClientRect());
17827
17858
  if (!t.matches("[data-ltp-presentation-stage]")) return n;
17828
- let r = Zp(t.getBoundingClientRect());
17859
+ let r = $p(t.getBoundingClientRect());
17829
17860
  return {
17830
17861
  ...n,
17831
17862
  top: r.top,
17832
17863
  bottom: r.top + n.height
17833
17864
  };
17834
17865
  }
17835
- function rm(e, t) {
17866
+ function am(e, t) {
17836
17867
  let n = t.left + t.width, r = t.top + t.height;
17837
17868
  for (let i = e.parentElement; i && i !== document.body; i = i.parentElement) {
17838
17869
  let e = getComputedStyle(i);
@@ -17846,7 +17877,7 @@ function rm(e, t) {
17846
17877
  }
17847
17878
  return !1;
17848
17879
  }
17849
- function im(e, t) {
17880
+ function om(e, t) {
17850
17881
  let [n, r] = (0, w.useState)({
17851
17882
  open: !1,
17852
17883
  placement: null
@@ -17877,9 +17908,9 @@ function im(e, t) {
17877
17908
  });
17878
17909
  return;
17879
17910
  }
17880
- let s = em(t);
17911
+ let s = nm(t);
17881
17912
  s !== o && (o !== null && l?.unobserve(o), o = s, l?.observe(s), a = "", e = !0);
17882
- let c = nm(n, s), u = tm(s), d = [...t.children].filter((e) => e !== i).map((e) => Zp(e.getBoundingClientRect())), f = [
17913
+ let c = im(n, s), u = rm(s), d = [...t.children].filter((e) => e !== i).map((e) => $p(e.getBoundingClientRect())), f = [
17883
17914
  c,
17884
17915
  u,
17885
17916
  ...d
@@ -17893,7 +17924,7 @@ function im(e, t) {
17893
17924
  ]).join(":");
17894
17925
  if (!e && f === a) return;
17895
17926
  a = f;
17896
- let p = Bp(c, u, d), m = p && !rm(s, p) ? p : null;
17927
+ let p = Hp(c, u, d), m = p && !am(s, p) ? p : null;
17897
17928
  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 : {
17898
17929
  open: !0,
17899
17930
  placement: m
@@ -17907,7 +17938,7 @@ function im(e, t) {
17907
17938
  };
17908
17939
  }, [t, e]), e && n.open ? n.placement : void 0;
17909
17940
  }
17910
- function am({ active: e, label: t, onSelect: n, tabs: r, text: i }) {
17941
+ function sm({ active: e, label: t, onSelect: n, tabs: r, text: i }) {
17911
17942
  let a = (0, w.useRef)(/* @__PURE__ */ new Map()), o = (e, t) => {
17912
17943
  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;
17913
17944
  if (o === null) return;
@@ -17934,15 +17965,15 @@ function am({ active: e, label: t, onSelect: n, tabs: r, text: i }) {
17934
17965
  }, t))
17935
17966
  });
17936
17967
  }
17937
- function om() {
17968
+ function cm() {
17938
17969
  let e = qd("generatedByAiDisclaimer");
17939
17970
  return /* @__PURE__ */ (0, N.jsxs)("footer", {
17940
17971
  className: "ltp-context-panel__ai-footer",
17941
17972
  children: [/* @__PURE__ */ (0, N.jsx)(Y, { name: "ai-generated" }), /* @__PURE__ */ (0, N.jsx)("small", { children: e })]
17942
17973
  });
17943
17974
  }
17944
- function sm({ interaction: e, metadata: t, module: n }) {
17945
- let r = Kd(), i = Gp(), a = e.knowledgeTab;
17975
+ function lm({ interaction: e, metadata: t, module: n }) {
17976
+ let r = Kd(), i = qp(), a = e.knowledgeTab;
17946
17977
  if (a === null) return null;
17947
17978
  let o, s;
17948
17979
  if (a === "inANutshell") {
@@ -17967,7 +17998,7 @@ function sm({ interaction: e, metadata: t, module: n }) {
17967
17998
  type: "button",
17968
17999
  children: e.label
17969
18000
  }, e.label))
17970
- }), c ? /* @__PURE__ */ (0, N.jsx)(cm, { concept: c }) : null]
18001
+ }), c ? /* @__PURE__ */ (0, N.jsx)(um, { concept: c }) : null]
17971
18002
  });
17972
18003
  } else if (a === "researchField") {
17973
18004
  let e = t.researchField;
@@ -17984,17 +18015,17 @@ function sm({ interaction: e, metadata: t, module: n }) {
17984
18015
  children: e?.entries?.map((e, t) => /* @__PURE__ */ (0, N.jsxs)("button", {
17985
18016
  onClick: () => i.seek(e.start),
17986
18017
  type: "button",
17987
- children: [/* @__PURE__ */ (0, N.jsx)("time", { children: df(e.start) }), /* @__PURE__ */ (0, N.jsx)("span", { children: e.text })]
18018
+ children: [/* @__PURE__ */ (0, N.jsx)("time", { children: ff(e.start) }), /* @__PURE__ */ (0, N.jsx)("span", { children: e.text })]
17988
18019
  }, `${e.start}:${t}`))
17989
18020
  });
17990
18021
  }
17991
18022
  return /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsx)("div", {
17992
18023
  className: "ltp-context-panel__scroll",
17993
18024
  children: o
17994
- }), s ? /* @__PURE__ */ (0, N.jsx)(om, {}) : null] });
18025
+ }), s ? /* @__PURE__ */ (0, N.jsx)(cm, {}) : null] });
17995
18026
  }
17996
- function cm({ concept: e }) {
17997
- let t = df(e.start ?? 0), n = qd("playAt", { time: t }), r = n.indexOf(t), i = Gp();
18027
+ function um({ concept: e }) {
18028
+ let t = ff(e.start ?? 0), n = qd("playAt", { time: t }), r = n.indexOf(t), i = qp();
17998
18029
  return /* @__PURE__ */ (0, N.jsxs)("div", {
17999
18030
  className: "ltp-context-panel__concept-description",
18000
18031
  children: [/* @__PURE__ */ (0, N.jsx)("p", { children: e.description }), e.start === void 0 ? null : /* @__PURE__ */ (0, N.jsxs)("button", {
@@ -18008,7 +18039,7 @@ function cm({ concept: e }) {
18008
18039
  })]
18009
18040
  });
18010
18041
  }
18011
- function lm({ items: e }) {
18042
+ function dm({ items: e }) {
18012
18043
  let t = Kd();
18013
18044
  return /* @__PURE__ */ (0, N.jsx)("section", {
18014
18045
  className: "ltp-context-panel__scroll ltp-context-panel__publications",
@@ -18040,7 +18071,7 @@ function lm({ items: e }) {
18040
18071
  ] }, `${e.url}:${n}`))
18041
18072
  });
18042
18073
  }
18043
- function um({ video: e }) {
18074
+ function fm({ video: e }) {
18044
18075
  return /* @__PURE__ */ (0, N.jsxs)("a", {
18045
18076
  className: "ltp-context-panel__video-card",
18046
18077
  draggable: !1,
@@ -18061,38 +18092,38 @@ function um({ video: e }) {
18061
18092
  })]
18062
18093
  });
18063
18094
  }
18064
- function dm({ interaction: e, metadata: t }) {
18095
+ function pm({ interaction: e, metadata: t }) {
18065
18096
  let n = e.relatedTab === "relatedVideos" ? t.related ?? [] : t.forYou ?? [];
18066
18097
  return /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsx)("div", {
18067
18098
  className: "ltp-context-panel__scroll",
18068
18099
  children: /* @__PURE__ */ (0, N.jsx)("div", {
18069
18100
  className: "ltp-context-panel__video-grid",
18070
- children: n.map((e, t) => /* @__PURE__ */ (0, N.jsx)(um, { video: e }, `${e.url}:${t}`))
18101
+ children: n.map((e, t) => /* @__PURE__ */ (0, N.jsx)(fm, { video: e }, `${e.url}:${t}`))
18071
18102
  })
18072
- }), t.generatedByAi ? /* @__PURE__ */ (0, N.jsx)(om, {}) : null] });
18103
+ }), t.generatedByAi ? /* @__PURE__ */ (0, N.jsx)(cm, {}) : null] });
18073
18104
  }
18074
- function fm({ module: e }) {
18075
- let t = Hp(e), n = fd(), r = Kd(), i = t.view;
18105
+ function mm({ module: e }) {
18106
+ let t = Wp(e), n = fd(), r = Kd(), i = t.view;
18076
18107
  if (i === null) return null;
18077
- if (i === "knowledge") return /* @__PURE__ */ (0, N.jsx)(sm, {
18108
+ if (i === "knowledge") return /* @__PURE__ */ (0, N.jsx)(lm, {
18078
18109
  interaction: t,
18079
18110
  metadata: n.content.metadata,
18080
18111
  module: e
18081
18112
  });
18082
18113
  if (i === "underlyingPublication") {
18083
18114
  let e = n.content.metadata.underlyingPublication;
18084
- return /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsx)(lm, { items: e?.items ?? [] }), e?.generatedByAi ? /* @__PURE__ */ (0, N.jsx)(om, {}) : null] });
18115
+ return /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsx)(dm, { items: e?.items ?? [] }), e?.generatedByAi ? /* @__PURE__ */ (0, N.jsx)(cm, {}) : null] });
18085
18116
  }
18086
18117
  let a = n.content.metadata.relatedVideos;
18087
- return a ? /* @__PURE__ */ (0, N.jsx)(dm, {
18118
+ return a ? /* @__PURE__ */ (0, N.jsx)(pm, {
18088
18119
  interaction: t,
18089
18120
  metadata: a
18090
18121
  }) : /* @__PURE__ */ (0, N.jsx)("div", { "aria-label": r.relatedVideos });
18091
18122
  }
18092
- function pm(e, t) {
18123
+ function hm(e, t) {
18093
18124
  return e === "knowledge" ? t.knowledge : e === "underlyingPublication" ? t.underlyingPublication : t.relatedVideos;
18094
18125
  }
18095
- function mm({ interaction: e, module: t }) {
18126
+ function gm({ interaction: e, module: t }) {
18096
18127
  let n = Kd();
18097
18128
  if (e.view === "knowledge" && e.knowledgeTab !== null) {
18098
18129
  let r = {
@@ -18101,7 +18132,7 @@ function mm({ interaction: e, module: t }) {
18101
18132
  researchField: n.researchField,
18102
18133
  transcript: n.transcript
18103
18134
  };
18104
- return /* @__PURE__ */ (0, N.jsx)(am, {
18135
+ return /* @__PURE__ */ (0, N.jsx)(sm, {
18105
18136
  active: e.knowledgeTab,
18106
18137
  label: n.knowledge,
18107
18138
  onSelect: (e) => t.setKnowledgeTab(e),
@@ -18114,7 +18145,7 @@ function mm({ interaction: e, module: t }) {
18114
18145
  relatedVideos: n.relatedVideos,
18115
18146
  forYou: n.forYou
18116
18147
  };
18117
- return /* @__PURE__ */ (0, N.jsx)(am, {
18148
+ return /* @__PURE__ */ (0, N.jsx)(sm, {
18118
18149
  active: e.relatedTab,
18119
18150
  label: n.relatedVideos,
18120
18151
  onSelect: (e) => t.setRelatedTab(e),
@@ -18127,8 +18158,8 @@ function mm({ interaction: e, module: t }) {
18127
18158
  children: n.underlyingPublication
18128
18159
  });
18129
18160
  }
18130
- function hm({ module: e, presentation: t, titleId: n }) {
18131
- let r = Hp(e), i = Kd();
18161
+ function _m({ module: e, presentation: t, titleId: n }) {
18162
+ let r = Wp(e), i = Kd();
18132
18163
  return r.view === null ? null : /* @__PURE__ */ (0, N.jsxs)("div", {
18133
18164
  className: "ltp-context-panel__frame",
18134
18165
  "data-ltp-context-presentation": t,
@@ -18140,8 +18171,8 @@ function hm({ module: e, presentation: t, titleId: n }) {
18140
18171
  children: [/* @__PURE__ */ (0, N.jsx)("span", {
18141
18172
  "aria-hidden": "true",
18142
18173
  className: "ltp-context-panel__header-icon",
18143
- children: /* @__PURE__ */ (0, N.jsx)(Y, { name: Jp[r.view] })
18144
- }), /* @__PURE__ */ (0, N.jsx)(mm, {
18174
+ children: /* @__PURE__ */ (0, N.jsx)(Y, { name: Xp[r.view] })
18175
+ }), /* @__PURE__ */ (0, N.jsx)(gm, {
18145
18176
  interaction: r,
18146
18177
  module: e
18147
18178
  })]
@@ -18149,7 +18180,8 @@ function hm({ module: e, presentation: t, titleId: n }) {
18149
18180
  /* @__PURE__ */ (0, N.jsx)(Sl.Title, {
18150
18181
  className: "ltp-context-panel__title",
18151
18182
  id: n,
18152
- children: pm(r.view, i)
18183
+ tabIndex: t === "dialog" ? -1 : void 0,
18184
+ children: hm(r.view, i)
18153
18185
  }),
18154
18186
  /* @__PURE__ */ (0, N.jsx)("button", {
18155
18187
  "aria-label": i.closeContextPanel,
@@ -18159,20 +18191,20 @@ function hm({ module: e, presentation: t, titleId: n }) {
18159
18191
  children: /* @__PURE__ */ (0, N.jsx)(Y, { name: "close" })
18160
18192
  })
18161
18193
  ]
18162
- }), /* @__PURE__ */ (0, N.jsx)(fm, { module: e })]
18194
+ }), /* @__PURE__ */ (0, N.jsx)(mm, { module: e })]
18163
18195
  });
18164
18196
  }
18165
- function gm({ module: e, titleId: t }) {
18166
- let n = Hp(e), r = (0, w.useRef)(null), i = (0, w.useContext)(Kp), a = (0, w.useId)(), o = i ?? a, s = (0, w.useRef)(null);
18197
+ function vm({ module: e, titleId: t }) {
18198
+ let n = Wp(e), r = (0, w.useRef)(null), i = (0, w.useContext)(Jp), a = (0, w.useId)(), o = i ?? a, s = (0, w.useRef)(null);
18167
18199
  return (0, w.useLayoutEffect)(() => {
18168
18200
  let e = r.current;
18169
18201
  if (!e || n.view === null) return;
18170
18202
  s.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
18171
18203
  let t = () => {
18172
- let t = Qp();
18204
+ let t = em();
18173
18205
  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`);
18174
18206
  };
18175
- return typeof e.showModal == "function" ? e.showModal() : e.setAttribute("open", ""), t(), e.querySelector("button, a")?.focus(), window.visualViewport?.addEventListener("resize", t), window.visualViewport?.addEventListener("scroll", t), window.addEventListener("resize", t), () => {
18207
+ 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), () => {
18176
18208
  window.visualViewport?.removeEventListener("resize", t), window.visualViewport?.removeEventListener("scroll", t), window.removeEventListener("resize", t), e.open && typeof e.close == "function" ? e.close() : e.removeAttribute("open");
18177
18209
  let n = s.current;
18178
18210
  s.current = null, n?.isConnected && n.focus();
@@ -18192,15 +18224,15 @@ function gm({ module: e, titleId: t }) {
18192
18224
  !n || !r || (e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus()));
18193
18225
  },
18194
18226
  ref: r,
18195
- children: /* @__PURE__ */ (0, N.jsx)(hm, {
18227
+ children: /* @__PURE__ */ (0, N.jsx)(_m, {
18196
18228
  module: e,
18197
18229
  presentation: "dialog",
18198
18230
  titleId: t
18199
18231
  })
18200
18232
  })] });
18201
18233
  }
18202
- function _m({ module: e, slot: t, state: n, surfaceId: r }) {
18203
- let i = Vp(e), a = Hp(i), o = Kd(), s = hf(), c = (0, w.useRef)(null), l = (0, w.useId)(), u = im(a.view !== null, c);
18234
+ function ym({ module: e, slot: t, state: n, surfaceId: r }) {
18235
+ let i = Up(e), a = Wp(i), o = Kd(), s = gf(), c = (0, w.useRef)(null), l = (0, w.useId)(), u = om(a.view !== null, c);
18204
18236
  (0, w.useEffect)(() => {
18205
18237
  s && i.close();
18206
18238
  }, [s, i]), (0, w.useEffect)(() => () => {
@@ -18231,25 +18263,25 @@ function _m({ module: e, slot: t, state: n, surfaceId: r }) {
18231
18263
  "data-ltp-surface": r,
18232
18264
  children: a.view === null || u === void 0 ? null : u ? (0, Dl.createPortal)(/* @__PURE__ */ (0, N.jsx)("aside", {
18233
18265
  className: "ltp-player ltp-context-panel ltp-context-panel--side-card",
18234
- "aria-label": pm(a.view, o),
18266
+ "aria-label": hm(a.view, o),
18235
18267
  onKeyDownCapture: (e) => {
18236
18268
  if (e.key === "Escape") {
18237
18269
  e.preventDefault(), i.close();
18238
18270
  return;
18239
18271
  }
18240
- if ((e.key === "ArrowUp" || e.key === "ArrowDown") && !Mp(e.target, e.currentTarget)) {
18241
- let t = c.current?.closest(Op);
18242
- t && Np(t, e.key === "ArrowUp" ? "previous" : "next") && (e.preventDefault(), e.stopPropagation());
18272
+ if ((e.key === "ArrowUp" || e.key === "ArrowDown") && !Pp(e.target, e.currentTarget)) {
18273
+ let t = c.current?.closest(Ap);
18274
+ t && Fp(t, e.key === "ArrowUp" ? "previous" : "next") && (e.preventDefault(), e.stopPropagation());
18243
18275
  }
18244
18276
  },
18245
18277
  role: "region",
18246
18278
  style: d,
18247
- children: /* @__PURE__ */ (0, N.jsx)(hm, {
18279
+ children: /* @__PURE__ */ (0, N.jsx)(_m, {
18248
18280
  module: i,
18249
18281
  presentation: "side-card",
18250
18282
  titleId: l
18251
18283
  })
18252
- }), document.body) : /* @__PURE__ */ (0, N.jsx)(gm, {
18284
+ }), document.body) : /* @__PURE__ */ (0, N.jsx)(vm, {
18253
18285
  module: i,
18254
18286
  titleId: l
18255
18287
  })
@@ -18257,13 +18289,13 @@ function _m({ module: e, slot: t, state: n, surfaceId: r }) {
18257
18289
  }
18258
18290
  //#endregion
18259
18291
  //#region src/capabilities/types.ts
18260
- var vm = [
18292
+ var bm = [
18261
18293
  "chapters",
18262
18294
  "captions",
18263
18295
  "speed",
18264
18296
  "share",
18265
18297
  "contextPanel"
18266
- ], ym = [
18298
+ ], xm = [
18267
18299
  "timeline",
18268
18300
  "controlBarLeft",
18269
18301
  "controlBarCenter",
@@ -18274,7 +18306,7 @@ var vm = [
18274
18306
  "overlay",
18275
18307
  "menu",
18276
18308
  "contextPanel"
18277
- ], bm = Object.freeze({
18309
+ ], Sm = Object.freeze({
18278
18310
  landscape: Object.freeze([
18279
18311
  "timeline",
18280
18312
  "controlBarLeft",
@@ -18298,14 +18330,14 @@ var vm = [
18298
18330
  "contextPanel"
18299
18331
  ])
18300
18332
  });
18301
- function xm(e) {
18333
+ function Cm(e) {
18302
18334
  for (let t of e.surfaces) Object.freeze(t.slots), Object.freeze(t);
18303
18335
  return Object.freeze(e.surfaces), Object.freeze(e);
18304
18336
  }
18305
18337
  //#endregion
18306
18338
  //#region src/capabilities/modules.tsx
18307
- var Sm = Pd("chapters"), Cm = Pd("captions"), wm = Pd("speed"), Tm = Pd("share"), Em = Pd("contextPanel");
18308
- function Dm(e, t, n) {
18339
+ var wm = Pd("chapters"), Tm = Pd("captions"), Em = Pd("speed"), Dm = Pd("share"), Om = Pd("contextPanel");
18340
+ function km(e, t, n) {
18309
18341
  let r = e.surfaces.find((e) => e.id === t);
18310
18342
  if (r === void 0) throw Error(`Missing capability surface metadata: ${e.key}.${t}`);
18311
18343
  return {
@@ -18313,7 +18345,7 @@ function Dm(e, t, n) {
18313
18345
  component: n
18314
18346
  };
18315
18347
  }
18316
- function Om(e) {
18348
+ function Am(e) {
18317
18349
  let t = !1;
18318
18350
  return Object.freeze({
18319
18351
  key: e,
@@ -18325,7 +18357,7 @@ function Om(e) {
18325
18357
  }
18326
18358
  });
18327
18359
  }
18328
- function km() {
18360
+ function jm() {
18329
18361
  let e = !1, t = !1, n = null, r = null, i = Object.freeze({ open: !1 }), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = (e) => {
18330
18362
  if (i.open === e) return !1;
18331
18363
  i = Object.freeze({ open: e });
@@ -18336,7 +18368,7 @@ function km() {
18336
18368
  key: "chapters",
18337
18369
  apply({ config: r, state: i }) {
18338
18370
  if (e) throw Error("Cannot apply disposed capability module: chapters");
18339
- t = i === "active", n = lf(r.content.chapters), t || s(!1);
18371
+ t = i === "active", n = uf(r.content.chapters), t || s(!1);
18340
18372
  },
18341
18373
  getInteractionSnapshot: () => i,
18342
18374
  subscribeInteraction(t) {
@@ -18364,7 +18396,7 @@ function km() {
18364
18396
  }
18365
18397
  });
18366
18398
  }
18367
- function Am() {
18399
+ function Mm() {
18368
18400
  let e = !1, t = !1, n = null, r = Object.freeze({
18369
18401
  failedTrackIds: Object.freeze([]),
18370
18402
  open: !1
@@ -18411,7 +18443,7 @@ function Am() {
18411
18443
  }
18412
18444
  });
18413
18445
  }
18414
- function jm() {
18446
+ function Nm() {
18415
18447
  let e = !1, t = !1, n = /* @__PURE__ */ new Set(), r = Object.freeze({
18416
18448
  copied: !1,
18417
18449
  mode: null,
@@ -18432,7 +18464,7 @@ function jm() {
18432
18464
  apply({ config: i, state: o }) {
18433
18465
  if (e) throw Error("Cannot apply disposed capability module: share");
18434
18466
  t = o === "active";
18435
- let s = t ? lp(i.capabilities.share) : [];
18467
+ let s = t ? up(i.capabilities.share) : [];
18436
18468
  n = new Set(s.filter((e) => e === "link" || e === "embed"));
18437
18469
  let c = r.mode !== null && n.has(r.mode) ? r.mode : s.find((e) => e === "link" || e === "embed") ?? null;
18438
18470
  a({
@@ -18480,11 +18512,11 @@ function jm() {
18480
18512
  }
18481
18513
  });
18482
18514
  }
18483
- function Mm(e) {
18515
+ function Pm(e) {
18484
18516
  let t = e.content.metadata;
18485
18517
  return t.inANutshell !== void 0 || t.keyConcepts !== void 0 || t.researchField !== void 0 || t.transcript !== void 0;
18486
18518
  }
18487
- function Nm() {
18519
+ function Fm() {
18488
18520
  let e = !1, t = !1, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = Object.freeze({
18489
18521
  availableViews: Object.freeze([]),
18490
18522
  knowledgeTab: null,
@@ -18506,7 +18538,7 @@ function Nm() {
18506
18538
  key: "contextPanel",
18507
18539
  apply({ config: o, state: c }) {
18508
18540
  if (e) throw Error("Cannot apply disposed capability module: contextPanel");
18509
- t = c === "active" && bm[o.layout].includes("contextPanel"), n = /* @__PURE__ */ new Set(), Mm(o) && n.add("knowledge"), o.content.metadata.underlyingPublication !== void 0 && n.add("underlyingPublication"), o.content.metadata.relatedVideos !== void 0 && n.add("relatedVideos");
18541
+ t = c === "active" && Sm[o.layout].includes("contextPanel"), n = /* @__PURE__ */ new Set(), Pm(o) && n.add("knowledge"), o.content.metadata.underlyingPublication !== void 0 && n.add("underlyingPublication"), o.content.metadata.relatedVideos !== void 0 && n.add("relatedVideos");
18510
18542
  let l = o.content.metadata, u = [
18511
18543
  ...l.inANutshell === void 0 ? [] : ["inANutshell"],
18512
18544
  ...l.keyConcepts === void 0 ? [] : ["keyConcepts"],
@@ -18571,70 +18603,70 @@ function Nm() {
18571
18603
  }
18572
18604
  });
18573
18605
  }
18574
- var Pm = xm({
18575
- key: Sm.key,
18576
- defaults: Sm.defaults,
18577
- strings: Sm.strings,
18606
+ var Im = Cm({
18607
+ key: wm.key,
18608
+ defaults: wm.defaults,
18609
+ strings: wm.strings,
18578
18610
  selectOptions: (e) => e.capabilities.chapters,
18579
18611
  isAvailable: ({ content: e }) => e.chapters.length > 0,
18580
18612
  surfaces: [
18581
- Dm(Sm, "timeline", wf),
18582
- Dm(Sm, "trigger", Tf),
18583
- Dm(Sm, "menu", Of)
18613
+ km(wm, "timeline", Tf),
18614
+ km(wm, "trigger", Ef),
18615
+ km(wm, "menu", kf)
18584
18616
  ],
18585
- create: km
18586
- }), Fm = xm({
18587
- key: Cm.key,
18588
- defaults: Cm.defaults,
18589
- strings: Cm.strings,
18617
+ create: jm
18618
+ }), Lm = Cm({
18619
+ key: Tm.key,
18620
+ defaults: Tm.defaults,
18621
+ strings: Tm.strings,
18590
18622
  selectOptions: (e) => e.capabilities.captions,
18591
18623
  isAvailable: ({ content: e }) => e.tracks.some((e) => e.kind === "subtitles" || e.kind === "captions"),
18592
18624
  surfaces: [
18593
- Dm(Cm, "text", np),
18594
- Dm(Cm, "control", tp),
18595
- Dm(Cm, "menu", rp)
18625
+ km(Tm, "text", rp),
18626
+ km(Tm, "control", np),
18627
+ km(Tm, "menu", ip)
18596
18628
  ],
18597
- create: Am
18598
- }), Im = xm({
18599
- key: wm.key,
18600
- defaults: wm.defaults,
18601
- strings: wm.strings,
18629
+ create: Mm
18630
+ }), Rm = Cm({
18631
+ key: Em.key,
18632
+ defaults: Em.defaults,
18633
+ strings: Em.strings,
18602
18634
  selectOptions: (e) => e.capabilities.speed,
18603
18635
  isAvailable: () => !0,
18604
- surfaces: [Dm(wm, "control", op)],
18605
- create: () => Om("speed")
18606
- }), Lm = xm({
18607
- key: Tm.key,
18608
- defaults: Tm.defaults,
18609
- strings: Tm.strings,
18636
+ surfaces: [km(Em, "control", sp)],
18637
+ create: () => Am("speed")
18638
+ }), zm = Cm({
18639
+ key: Dm.key,
18640
+ defaults: Dm.defaults,
18641
+ strings: Dm.strings,
18610
18642
  selectOptions: (e) => e.capabilities.share,
18611
18643
  isAvailable: ({ options: e }) => e.canonicalUrl !== void 0 && e.canonicalUrl.length > 0,
18612
- surfaces: [Dm(Tm, "trigger", _p), Dm(Tm, "dialog", Dp)],
18613
- create: jm
18614
- }), Rm = xm({
18615
- key: Em.key,
18616
- defaults: Em.defaults,
18617
- strings: Em.strings,
18644
+ surfaces: [km(Dm, "trigger", yp), km(Dm, "dialog", kp)],
18645
+ create: Nm
18646
+ }), Bm = Cm({
18647
+ key: Om.key,
18648
+ defaults: Om.defaults,
18649
+ strings: Om.strings,
18618
18650
  selectOptions: (e) => e.capabilities.contextPanel,
18619
18651
  isAvailable: ({ content: e }) => Object.keys(e.metadata).length > 0,
18620
- surfaces: [Dm(Em, "triggers", Xp), Dm(Em, "panel", _m)],
18621
- create: Nm
18622
- }), zm = Object.freeze([
18623
- Pm,
18624
- Fm,
18652
+ surfaces: [km(Om, "triggers", Qp), km(Om, "panel", ym)],
18653
+ create: Fm
18654
+ }), Vm = Object.freeze([
18625
18655
  Im,
18626
18656
  Lm,
18627
- Rm
18628
- ]), Bm = class extends Error {
18657
+ Rm,
18658
+ zm,
18659
+ Bm
18660
+ ]), Hm = class extends Error {
18629
18661
  constructor(e) {
18630
18662
  super(e), this.name = "CapabilityRegistryLifecycleError";
18631
18663
  }
18632
18664
  };
18633
- function Vm() {
18634
- return ym.reduce((e, t) => (e[t] = [], e), {});
18665
+ function Um() {
18666
+ return xm.reduce((e, t) => (e[t] = [], e), {});
18635
18667
  }
18636
- function Hm(e) {
18637
- let t = Vm(), n = {};
18668
+ function Wm(e) {
18669
+ let t = Um(), n = {};
18638
18670
  for (let r of e) {
18639
18671
  let e = Object.freeze({
18640
18672
  key: r.declaration.key,
@@ -18652,42 +18684,42 @@ function Hm(e) {
18652
18684
  n === "controlBarRight" && r.declaration.key === "speed" ? t[n].unshift(i) : t[n].push(i);
18653
18685
  }
18654
18686
  }
18655
- if (t.timeline.length > 1) throw new Bm("Only one capability timeline replacement may be active");
18656
- for (let e of ym) Object.freeze(t[e]);
18687
+ if (t.timeline.length > 1) throw new Hm("Only one capability timeline replacement may be active");
18688
+ for (let e of xm) Object.freeze(t[e]);
18657
18689
  return Object.freeze({
18658
18690
  capabilities: Object.freeze(n),
18659
18691
  slots: Object.freeze(t)
18660
18692
  });
18661
18693
  }
18662
- function Um(e, t, n) {
18694
+ function Gm(e, t, n) {
18663
18695
  return n.enabled ? e.isAvailable({
18664
18696
  content: t.content,
18665
18697
  options: n
18666
18698
  }) ? "active" : "dormant" : "removed";
18667
18699
  }
18668
- function Wm(e, t) {
18700
+ function Km(e, t) {
18669
18701
  let n = t.map(({ key: e }) => e);
18670
- if (t.length !== vm.length || vm.some((e) => n.filter((t) => t === e).length !== 1)) throw new Bm("The capability registry must contain each fixed capability exactly once");
18671
- if (t.flatMap((e) => e.surfaces.filter((e) => e.slots.includes("timeline"))).length > 1) throw new Bm("Only one capability timeline replacement may be registered");
18702
+ if (t.length !== bm.length || bm.some((e) => n.filter((t) => t === e).length !== 1)) throw new Hm("The capability registry must contain each fixed capability exactly once");
18703
+ if (t.flatMap((e) => e.surfaces.filter((e) => e.slots.includes("timeline"))).length > 1) throw new Hm("Only one capability timeline replacement may be registered");
18672
18704
  for (let e of t) {
18673
18705
  let t = e.surfaces.map(({ id: e }) => e);
18674
- if (e.surfaces.some(({ slots: e }) => e.length === 0) || new Set(t).size !== t.length) throw new Bm(`Capability surfaces must have unique identifiers and at least one slot: ${e.key}`);
18706
+ if (e.surfaces.some(({ slots: e }) => e.length === 0) || new Set(t).size !== t.length) throw new Hm(`Capability surfaces must have unique identifiers and at least one slot: ${e.key}`);
18675
18707
  }
18676
18708
  let r = t.map((e) => ({
18677
18709
  declaration: e,
18678
18710
  module: e.create(),
18679
18711
  state: "dormant"
18680
18712
  })), i = /* @__PURE__ */ new Set(), a = !1, o, s = (e, t) => {
18681
- if (a) throw new Bm("Cannot apply a configuration after the capability registry is disposed");
18713
+ if (a) throw new Hm("Cannot apply a configuration after the capability registry is disposed");
18682
18714
  for (let t of r) {
18683
- let n = t.declaration.selectOptions(e), r = Um(t.declaration, e, n);
18715
+ let n = t.declaration.selectOptions(e), r = Gm(t.declaration, e, n);
18684
18716
  t.module.apply({
18685
18717
  config: e,
18686
18718
  options: n,
18687
18719
  state: r
18688
18720
  }), t.state = r;
18689
18721
  }
18690
- if (o = Hm(r), t) for (let e of i) e();
18722
+ if (o = Wm(r), t) for (let e of i) e();
18691
18723
  };
18692
18724
  return s(e, !1), Object.freeze({
18693
18725
  getSnapshot: () => o,
@@ -18696,7 +18728,7 @@ function Wm(e, t) {
18696
18728
  },
18697
18729
  getModule(e) {
18698
18730
  let t = r.find(({ declaration: t }) => t.key === e);
18699
- if (t === void 0) throw new Bm(`Unknown capability module: ${e}`);
18731
+ if (t === void 0) throw new Hm(`Unknown capability module: ${e}`);
18700
18732
  return t.module;
18701
18733
  },
18702
18734
  applyConfig(e) {
@@ -18711,34 +18743,34 @@ function Wm(e, t) {
18711
18743
  isDisposed: () => a
18712
18744
  });
18713
18745
  }
18714
- function Gm(e) {
18715
- return Wm(e, zm);
18746
+ function qm(e) {
18747
+ return Km(e, Vm);
18716
18748
  }
18717
- var Km = (0, w.createContext)(null);
18718
- function qm({ children: e, registry: t }) {
18719
- return /* @__PURE__ */ (0, N.jsx)(Km, {
18749
+ var Jm = (0, w.createContext)(null);
18750
+ function Ym({ children: e, registry: t }) {
18751
+ return /* @__PURE__ */ (0, N.jsx)(Jm, {
18720
18752
  value: t,
18721
18753
  children: e
18722
18754
  });
18723
18755
  }
18724
- function Jm() {
18725
- let e = (0, w.useContext)(Km);
18756
+ function Xm() {
18757
+ let e = (0, w.useContext)(Jm);
18726
18758
  if (e === null) throw Error("Capability hooks must be used within CapabilityRegistryProvider");
18727
18759
  return e;
18728
18760
  }
18729
- function Ym() {
18730
- let e = Jm();
18761
+ function Zm() {
18762
+ let e = Xm();
18731
18763
  return (0, w.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getSnapshot);
18732
18764
  }
18733
- function Xm({ slot: e }) {
18734
- return /* @__PURE__ */ (0, N.jsx)(w.Fragment, { children: Ym().slots[e] });
18765
+ function Qm({ slot: e }) {
18766
+ return /* @__PURE__ */ (0, N.jsx)(w.Fragment, { children: Zm().slots[e] });
18735
18767
  }
18736
- function Zm({ coreTimeline: e }) {
18737
- let t = Ym().slots.timeline;
18768
+ function $m({ coreTimeline: e }) {
18769
+ let t = Zm().slots.timeline;
18738
18770
  return /* @__PURE__ */ (0, N.jsx)(w.Fragment, { children: t.length === 0 ? e : t });
18739
18771
  }
18740
- Object.freeze(bm.landscape.filter((e) => e !== "fullscreen"));
18741
- var Qm = Object.freeze({
18772
+ Object.freeze(Sm.landscape.filter((e) => e !== "fullscreen"));
18773
+ var eh = Object.freeze({
18742
18774
  timeline: "timeline",
18743
18775
  controlBarLeft: "control-left",
18744
18776
  controlBarRight: "control-right",
@@ -18747,65 +18779,66 @@ var Qm = Object.freeze({
18747
18779
  overlay: "overlay",
18748
18780
  menu: "menu-anchor"
18749
18781
  });
18750
- function $m({ children: e, name: t }) {
18782
+ function th({ children: e, name: t }) {
18751
18783
  return /* @__PURE__ */ (0, N.jsx)("div", {
18752
18784
  className: `ltp-landscape__core ltp-landscape__core--${t}`,
18753
18785
  "data-ltp-core-slot": t,
18754
18786
  children: e
18755
18787
  });
18756
18788
  }
18757
- function eh({ slot: e }) {
18789
+ function nh({ slot: e }) {
18758
18790
  return /* @__PURE__ */ (0, N.jsx)("div", {
18759
- className: `ltp-landscape__capability ltp-landscape__capability--${Qm[e]}`,
18791
+ className: `ltp-landscape__capability ltp-landscape__capability--${eh[e]}`,
18760
18792
  "data-ltp-landscape-slot": e,
18761
- children: /* @__PURE__ */ (0, N.jsx)(Xm, { slot: e })
18793
+ children: /* @__PURE__ */ (0, N.jsx)(Qm, { slot: e })
18762
18794
  });
18763
18795
  }
18764
- function th({ configurationError: e, controlsMounted: t = !0, controlsVisible: n = !0, controlVisibilityHandlers: r, core: i = {}, inputPolicy: a, language: o, media: s, mediaError: c, runtimeBridge: l }) {
18765
- let u = e !== void 0, d = c !== void 0, f = u || d, p = Ym().slots, m = t && (i.logo !== void 0 || p.topIcons.length > 0), h = t && (i.playPause !== void 0 || i.volume !== void 0 || i.time !== void 0 || i.timeline !== void 0 || i.fullscreen !== void 0 || p.timeline.length > 0 || p.controlBarLeft.length > 0 || p.controlBarCenter.length > 0 || p.controlBarRight.length > 0);
18796
+ function rh({ announcer: e, configurationError: t, controlsMounted: n = !0, controlsVisible: r = !0, controlVisibilityHandlers: i, core: a = {}, inputPolicy: o, language: s, media: c, mediaError: l, runtimeBridge: u }) {
18797
+ let d = t !== void 0, f = l !== void 0, p = d || f, m = Zm().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);
18766
18798
  return /* @__PURE__ */ (0, N.jsxs)(_c, {
18767
18799
  className: "ltp-player ltp-media-engine ltp-landscape",
18768
- "data-ltp-configuration-error": u || void 0,
18769
- "data-ltp-media-error": d || void 0,
18770
- "data-ltp-controls-hidden": t && !n ? !0 : void 0,
18771
- "data-ltp-controls-visible": t && n ? !0 : void 0,
18800
+ "data-ltp-configuration-error": d || void 0,
18801
+ "data-ltp-media-error": f || void 0,
18802
+ "data-ltp-controls-hidden": n && !r ? !0 : void 0,
18803
+ "data-ltp-controls-visible": n && r ? !0 : void 0,
18772
18804
  "data-ltp-layout": "landscape",
18773
- lang: o,
18774
- ...r,
18805
+ lang: s,
18806
+ ...i,
18775
18807
  children: [
18776
18808
  /* @__PURE__ */ (0, N.jsx)(Cd, {}),
18809
+ e,
18777
18810
  /* @__PURE__ */ (0, N.jsxs)("div", {
18778
- "aria-hidden": f || void 0,
18811
+ "aria-hidden": p || void 0,
18779
18812
  className: "ltp-landscape__content",
18780
- "data-ltp-fullscreen-input": a?.fullscreen || void 0,
18781
- "data-ltp-gestures-input": a?.gestures || void 0,
18782
- "data-ltp-hotkeys-input": a?.hotkeys || void 0,
18783
- "data-ltp-pip-input": a?.pip || void 0,
18784
- "data-ltp-play-pause-input": a?.playPause || void 0,
18785
- "data-ltp-seek-input": a?.seek || void 0,
18786
- "data-ltp-seek-step": a?.seekStep,
18787
- "data-ltp-volume-input": a?.volume || void 0,
18788
- inert: f || void 0,
18813
+ "data-ltp-fullscreen-input": o?.fullscreen || void 0,
18814
+ "data-ltp-gestures-input": o?.gestures || void 0,
18815
+ "data-ltp-hotkeys-input": o?.hotkeys || void 0,
18816
+ "data-ltp-pip-input": o?.pip || void 0,
18817
+ "data-ltp-play-pause-input": o?.playPause || void 0,
18818
+ "data-ltp-seek-input": o?.seek || void 0,
18819
+ "data-ltp-seek-step": o?.seekStep,
18820
+ "data-ltp-volume-input": o?.volume || void 0,
18821
+ inert: p || void 0,
18789
18822
  children: [
18790
18823
  /* @__PURE__ */ (0, N.jsx)("div", {
18791
18824
  className: "ltp-landscape__media",
18792
- children: s
18825
+ children: c
18793
18826
  }),
18794
18827
  /* @__PURE__ */ (0, N.jsx)("div", {
18795
18828
  className: "ltp-landscape__cover",
18796
18829
  "data-ltp-landscape-region": "cover",
18797
- children: /* @__PURE__ */ (0, N.jsx)($m, {
18830
+ children: /* @__PURE__ */ (0, N.jsx)(th, {
18798
18831
  name: "cover",
18799
- children: i.cover
18832
+ children: a.cover
18800
18833
  })
18801
18834
  }),
18802
- m ? /* @__PURE__ */ (0, N.jsx)("div", {
18835
+ h ? /* @__PURE__ */ (0, N.jsx)("div", {
18803
18836
  "aria-hidden": "true",
18804
18837
  className: "ltp-landscape__scrim ltp-landscape__scrim--top",
18805
18838
  "data-ltp-control-visibility-fade": !0,
18806
18839
  "data-ltp-landscape-region": "top-scrim"
18807
18840
  }) : null,
18808
- h ? /* @__PURE__ */ (0, N.jsx)("div", {
18841
+ g ? /* @__PURE__ */ (0, N.jsx)("div", {
18809
18842
  "aria-hidden": "true",
18810
18843
  className: "ltp-landscape__scrim ltp-landscape__scrim--bottom",
18811
18844
  "data-ltp-control-visibility-fade": !0,
@@ -18814,44 +18847,44 @@ function th({ configurationError: e, controlsMounted: t = !0, controlsVisible: n
18814
18847
  /* @__PURE__ */ (0, N.jsx)("div", {
18815
18848
  className: "ltp-landscape__buffering",
18816
18849
  "data-ltp-landscape-region": "buffering",
18817
- children: /* @__PURE__ */ (0, N.jsx)($m, {
18850
+ children: /* @__PURE__ */ (0, N.jsx)(th, {
18818
18851
  name: "buffering",
18819
- children: i.buffering
18852
+ children: a.buffering
18820
18853
  })
18821
18854
  }),
18822
- i.logo !== void 0 || t ? /* @__PURE__ */ (0, N.jsxs)("div", {
18855
+ a.logo !== void 0 || n ? /* @__PURE__ */ (0, N.jsxs)("div", {
18823
18856
  className: "ltp-landscape__top-row",
18824
18857
  "data-ltp-landscape-region": "top-row",
18825
- children: [/* @__PURE__ */ (0, N.jsx)($m, {
18858
+ children: [/* @__PURE__ */ (0, N.jsx)(th, {
18826
18859
  name: "logo",
18827
- children: i.logo
18828
- }), t ? /* @__PURE__ */ (0, N.jsx)("div", {
18860
+ children: a.logo
18861
+ }), n ? /* @__PURE__ */ (0, N.jsx)("div", {
18829
18862
  className: "ltp-landscape__top-actions",
18830
18863
  "data-ltp-control-visibility-fade": !0,
18831
18864
  "data-ltp-control-visibility-lock": !0,
18832
- children: /* @__PURE__ */ (0, N.jsx)(eh, { slot: "topIcons" })
18865
+ children: /* @__PURE__ */ (0, N.jsx)(nh, { slot: "topIcons" })
18833
18866
  }) : null]
18834
18867
  }) : null,
18835
- t ? /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [
18868
+ n ? /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [
18836
18869
  /* @__PURE__ */ (0, N.jsx)("div", {
18837
18870
  className: "ltp-landscape__input-feedback",
18838
18871
  "data-ltp-landscape-region": "input-feedback",
18839
- children: /* @__PURE__ */ (0, N.jsx)($m, {
18872
+ children: /* @__PURE__ */ (0, N.jsx)(th, {
18840
18873
  name: "inputFeedback",
18841
- children: i.inputFeedback
18874
+ children: a.inputFeedback
18842
18875
  })
18843
18876
  }),
18844
18877
  /* @__PURE__ */ (0, N.jsx)("div", {
18845
18878
  className: "ltp-landscape__captions",
18846
18879
  "data-ltp-landscape-region": "captions",
18847
- children: /* @__PURE__ */ (0, N.jsx)(eh, { slot: "captions" })
18880
+ children: /* @__PURE__ */ (0, N.jsx)(nh, { slot: "captions" })
18848
18881
  }),
18849
18882
  /* @__PURE__ */ (0, N.jsx)("div", {
18850
18883
  className: "ltp-landscape__information",
18851
18884
  "data-ltp-landscape-region": "information",
18852
- children: /* @__PURE__ */ (0, N.jsx)($m, {
18885
+ children: /* @__PURE__ */ (0, N.jsx)(th, {
18853
18886
  name: "information",
18854
- children: i.information
18887
+ children: a.information
18855
18888
  })
18856
18889
  }),
18857
18890
  /* @__PURE__ */ (0, N.jsx)("div", {
@@ -18860,9 +18893,9 @@ function th({ configurationError: e, controlsMounted: t = !0, controlsVisible: n
18860
18893
  "data-ltp-control-visibility-lock": !0,
18861
18894
  "data-ltp-landscape-region": "timeline",
18862
18895
  "data-ltp-landscape-slot": "timeline",
18863
- children: /* @__PURE__ */ (0, N.jsx)(Zm, { coreTimeline: /* @__PURE__ */ (0, N.jsx)($m, {
18896
+ children: /* @__PURE__ */ (0, N.jsx)($m, { coreTimeline: /* @__PURE__ */ (0, N.jsx)(th, {
18864
18897
  name: "timeline",
18865
- children: i.timeline
18898
+ children: a.timeline
18866
18899
  }) })
18867
18900
  }),
18868
18901
  /* @__PURE__ */ (0, N.jsxs)("div", {
@@ -18874,26 +18907,26 @@ function th({ configurationError: e, controlsMounted: t = !0, controlsVisible: n
18874
18907
  className: "ltp-landscape__control-group",
18875
18908
  "data-ltp-control-group": "left",
18876
18909
  children: [
18877
- /* @__PURE__ */ (0, N.jsx)($m, {
18910
+ /* @__PURE__ */ (0, N.jsx)(th, {
18878
18911
  name: "playPause",
18879
- children: i.playPause
18912
+ children: a.playPause
18880
18913
  }),
18881
- /* @__PURE__ */ (0, N.jsx)($m, {
18914
+ /* @__PURE__ */ (0, N.jsx)(th, {
18882
18915
  name: "volume",
18883
- children: i.volume
18916
+ children: a.volume
18884
18917
  }),
18885
- /* @__PURE__ */ (0, N.jsx)($m, {
18918
+ /* @__PURE__ */ (0, N.jsx)(th, {
18886
18919
  name: "time",
18887
- children: i.time
18920
+ children: a.time
18888
18921
  }),
18889
- /* @__PURE__ */ (0, N.jsx)(eh, { slot: "controlBarLeft" })
18922
+ /* @__PURE__ */ (0, N.jsx)(nh, { slot: "controlBarLeft" })
18890
18923
  ]
18891
18924
  }), /* @__PURE__ */ (0, N.jsxs)("div", {
18892
18925
  className: "ltp-landscape__control-group",
18893
18926
  "data-ltp-control-group": "right",
18894
- children: [/* @__PURE__ */ (0, N.jsx)(eh, { slot: "controlBarRight" }), /* @__PURE__ */ (0, N.jsx)($m, {
18927
+ children: [/* @__PURE__ */ (0, N.jsx)(nh, { slot: "controlBarRight" }), /* @__PURE__ */ (0, N.jsx)(th, {
18895
18928
  name: "fullscreen",
18896
- children: i.fullscreen
18929
+ children: a.fullscreen
18897
18930
  })]
18898
18931
  })]
18899
18932
  }),
@@ -18901,7 +18934,7 @@ function th({ configurationError: e, controlsMounted: t = !0, controlsVisible: n
18901
18934
  className: "ltp-landscape__menu",
18902
18935
  "data-ltp-control-visibility-fade": !0,
18903
18936
  "data-ltp-landscape-region": "menu-anchor",
18904
- children: /* @__PURE__ */ (0, N.jsx)(eh, { slot: "menu" })
18937
+ children: /* @__PURE__ */ (0, N.jsx)(nh, { slot: "menu" })
18905
18938
  })
18906
18939
  ] }) : null
18907
18940
  ]
@@ -18909,16 +18942,16 @@ function th({ configurationError: e, controlsMounted: t = !0, controlsVisible: n
18909
18942
  /* @__PURE__ */ (0, N.jsx)("div", {
18910
18943
  className: "ltp-landscape__overlay",
18911
18944
  "data-ltp-landscape-region": "overlay",
18912
- children: /* @__PURE__ */ (0, N.jsx)(eh, { slot: "overlay" })
18945
+ children: /* @__PURE__ */ (0, N.jsx)(nh, { slot: "overlay" })
18913
18946
  }),
18914
- e,
18915
- c,
18916
- l
18947
+ t,
18948
+ l,
18949
+ u
18917
18950
  ]
18918
18951
  });
18919
18952
  }
18920
- Object.freeze([...bm.portrait]);
18921
- var nh = Object.freeze({
18953
+ Object.freeze([...Sm.portrait]);
18954
+ var ih = Object.freeze({
18922
18955
  timeline: "timeline",
18923
18956
  controlBarLeft: "control-left",
18924
18957
  controlBarCenter: "control-center",
@@ -18930,61 +18963,62 @@ var nh = Object.freeze({
18930
18963
  menu: "menu-anchor",
18931
18964
  contextPanel: "context-panel"
18932
18965
  });
18933
- function rh({ children: e, name: t }) {
18966
+ function ah({ children: e, name: t }) {
18934
18967
  return /* @__PURE__ */ (0, N.jsx)("div", {
18935
18968
  className: `ltp-portrait__core ltp-portrait__core--${t}`,
18936
18969
  "data-ltp-core-slot": t,
18937
18970
  children: e
18938
18971
  });
18939
18972
  }
18940
- function ih({ slot: e }) {
18973
+ function oh({ slot: e }) {
18941
18974
  return /* @__PURE__ */ (0, N.jsx)("div", {
18942
- className: `ltp-portrait__capability ltp-portrait__capability--${nh[e]}`,
18975
+ className: `ltp-portrait__capability ltp-portrait__capability--${ih[e]}`,
18943
18976
  "data-ltp-portrait-slot": e,
18944
- children: /* @__PURE__ */ (0, N.jsx)(Xm, { slot: e })
18977
+ children: /* @__PURE__ */ (0, N.jsx)(Qm, { slot: e })
18945
18978
  });
18946
18979
  }
18947
- function ah({ configurationError: e, controlsVisible: t = !0, core: n = {}, inputPolicy: r, language: i, media: a, mediaError: o, runtimeBridge: s }) {
18948
- let c = e !== void 0, l = o !== void 0, u = c || l, d = Ym().slots, f = t && (n.logo !== void 0 || n.volume !== void 0 || d.topIcons.length > 0), p = t && (n.playPause !== void 0 || n.time !== void 0 || n.timeline !== void 0 || d.timeline.length > 0 || d.controlBarLeft.length > 0 || d.controlBarCenter.length > 0 || d.controlBarRight.length > 0);
18980
+ function sh({ announcer: e, configurationError: t, controlsVisible: n = !0, core: r = {}, inputPolicy: i, language: a, media: o, mediaError: s, runtimeBridge: c }) {
18981
+ let l = t !== void 0, u = s !== void 0, d = l || u, f = Zm().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);
18949
18982
  return /* @__PURE__ */ (0, N.jsxs)(_c, {
18950
18983
  className: "ltp-player ltp-media-engine ltp-portrait",
18951
- "data-ltp-configuration-error": c || void 0,
18952
- "data-ltp-media-error": l || void 0,
18984
+ "data-ltp-configuration-error": l || void 0,
18985
+ "data-ltp-media-error": u || void 0,
18953
18986
  "data-ltp-layout": "portrait",
18954
- lang: i,
18987
+ lang: a,
18955
18988
  children: [
18956
18989
  /* @__PURE__ */ (0, N.jsx)(Cd, {}),
18990
+ e,
18957
18991
  /* @__PURE__ */ (0, N.jsxs)("div", {
18958
- "aria-hidden": u || void 0,
18992
+ "aria-hidden": d || void 0,
18959
18993
  className: "ltp-portrait__content",
18960
- "data-ltp-fullscreen-input": r?.fullscreen || void 0,
18961
- "data-ltp-gestures-input": r?.gestures || void 0,
18962
- "data-ltp-hotkeys-input": r?.hotkeys || void 0,
18963
- "data-ltp-pip-input": r?.pip || void 0,
18964
- "data-ltp-play-pause-input": r?.playPause || void 0,
18965
- "data-ltp-seek-input": r?.seek || void 0,
18966
- "data-ltp-seek-step": r?.seekStep,
18967
- "data-ltp-volume-input": r?.volume || void 0,
18968
- inert: u || void 0,
18994
+ "data-ltp-fullscreen-input": i?.fullscreen || void 0,
18995
+ "data-ltp-gestures-input": i?.gestures || void 0,
18996
+ "data-ltp-hotkeys-input": i?.hotkeys || void 0,
18997
+ "data-ltp-pip-input": i?.pip || void 0,
18998
+ "data-ltp-play-pause-input": i?.playPause || void 0,
18999
+ "data-ltp-seek-input": i?.seek || void 0,
19000
+ "data-ltp-seek-step": i?.seekStep,
19001
+ "data-ltp-volume-input": i?.volume || void 0,
19002
+ inert: d || void 0,
18969
19003
  children: [
18970
19004
  /* @__PURE__ */ (0, N.jsx)("div", {
18971
19005
  className: "ltp-portrait__media",
18972
- children: a
19006
+ children: o
18973
19007
  }),
18974
19008
  /* @__PURE__ */ (0, N.jsx)("div", {
18975
19009
  className: "ltp-portrait__cover",
18976
19010
  "data-ltp-portrait-region": "cover",
18977
- children: /* @__PURE__ */ (0, N.jsx)(rh, {
19011
+ children: /* @__PURE__ */ (0, N.jsx)(ah, {
18978
19012
  name: "cover",
18979
- children: n.cover
19013
+ children: r.cover
18980
19014
  })
18981
19015
  }),
18982
- f ? /* @__PURE__ */ (0, N.jsx)("div", {
19016
+ p ? /* @__PURE__ */ (0, N.jsx)("div", {
18983
19017
  "aria-hidden": "true",
18984
19018
  className: "ltp-portrait__scrim ltp-portrait__scrim--top",
18985
19019
  "data-ltp-portrait-region": "top-scrim"
18986
19020
  }) : null,
18987
- p ? /* @__PURE__ */ (0, N.jsx)("div", {
19021
+ m ? /* @__PURE__ */ (0, N.jsx)("div", {
18988
19022
  "aria-hidden": "true",
18989
19023
  className: "ltp-portrait__scrim ltp-portrait__scrim--bottom",
18990
19024
  "data-ltp-portrait-region": "bottom-scrim"
@@ -18992,37 +19026,37 @@ function ah({ configurationError: e, controlsVisible: t = !0, core: n = {}, inpu
18992
19026
  /* @__PURE__ */ (0, N.jsx)("div", {
18993
19027
  className: "ltp-portrait__buffering",
18994
19028
  "data-ltp-portrait-region": "buffering",
18995
- children: /* @__PURE__ */ (0, N.jsx)(rh, {
19029
+ children: /* @__PURE__ */ (0, N.jsx)(ah, {
18996
19030
  name: "buffering",
18997
- children: n.buffering
19031
+ children: r.buffering
18998
19032
  })
18999
19033
  }),
19000
- n.logo === void 0 ? null : /* @__PURE__ */ (0, N.jsx)("div", {
19034
+ r.logo === void 0 ? null : /* @__PURE__ */ (0, N.jsx)("div", {
19001
19035
  className: "ltp-portrait__top-left",
19002
19036
  "data-ltp-portrait-region": "top-left",
19003
- children: /* @__PURE__ */ (0, N.jsx)(rh, {
19037
+ children: /* @__PURE__ */ (0, N.jsx)(ah, {
19004
19038
  name: "logo",
19005
- children: n.logo
19039
+ children: r.logo
19006
19040
  })
19007
19041
  }),
19008
- t ? /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [
19042
+ n ? /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [
19009
19043
  /* @__PURE__ */ (0, N.jsx)("div", {
19010
19044
  className: "ltp-portrait__input-feedback",
19011
19045
  "data-ltp-portrait-region": "input-feedback",
19012
- children: /* @__PURE__ */ (0, N.jsx)(rh, {
19046
+ children: /* @__PURE__ */ (0, N.jsx)(ah, {
19013
19047
  name: "inputFeedback",
19014
- children: n.inputFeedback
19048
+ children: r.inputFeedback
19015
19049
  })
19016
19050
  }),
19017
19051
  /* @__PURE__ */ (0, N.jsx)("div", {
19018
19052
  className: "ltp-portrait__top-right",
19019
19053
  "data-ltp-portrait-region": "top-right",
19020
- children: /* @__PURE__ */ (0, N.jsx)(ih, { slot: "topIcons" })
19054
+ children: /* @__PURE__ */ (0, N.jsx)(oh, { slot: "topIcons" })
19021
19055
  }),
19022
19056
  /* @__PURE__ */ (0, N.jsx)("div", {
19023
19057
  className: "ltp-portrait__captions",
19024
19058
  "data-ltp-portrait-region": "captions",
19025
- children: /* @__PURE__ */ (0, N.jsx)(ih, { slot: "captions" })
19059
+ children: /* @__PURE__ */ (0, N.jsx)(oh, { slot: "captions" })
19026
19060
  }),
19027
19061
  /* @__PURE__ */ (0, N.jsxs)("div", {
19028
19062
  className: "ltp-portrait__information-stack",
@@ -19030,13 +19064,13 @@ function ah({ configurationError: e, controlsVisible: t = !0, core: n = {}, inpu
19030
19064
  children: [/* @__PURE__ */ (0, N.jsx)("div", {
19031
19065
  className: "ltp-portrait__trigger-rail",
19032
19066
  "data-ltp-portrait-region": "trigger-rail",
19033
- children: /* @__PURE__ */ (0, N.jsx)(ih, { slot: "triggerRail" })
19067
+ children: /* @__PURE__ */ (0, N.jsx)(oh, { slot: "triggerRail" })
19034
19068
  }), /* @__PURE__ */ (0, N.jsx)("div", {
19035
19069
  className: "ltp-portrait__information",
19036
19070
  "data-ltp-portrait-region": "information",
19037
- children: /* @__PURE__ */ (0, N.jsx)(rh, {
19071
+ children: /* @__PURE__ */ (0, N.jsx)(ah, {
19038
19072
  name: "information",
19039
- children: n.information
19073
+ children: r.information
19040
19074
  })
19041
19075
  })]
19042
19076
  }),
@@ -19044,59 +19078,59 @@ function ah({ configurationError: e, controlsVisible: t = !0, core: n = {}, inpu
19044
19078
  className: "ltp-portrait__timeline",
19045
19079
  "data-ltp-portrait-region": "timeline",
19046
19080
  "data-ltp-portrait-slot": "timeline",
19047
- children: /* @__PURE__ */ (0, N.jsx)(Zm, { coreTimeline: /* @__PURE__ */ (0, N.jsx)(rh, {
19081
+ children: /* @__PURE__ */ (0, N.jsx)($m, { coreTimeline: /* @__PURE__ */ (0, N.jsx)(ah, {
19048
19082
  name: "timeline",
19049
- children: n.timeline
19083
+ children: r.timeline
19050
19084
  }) })
19051
19085
  }),
19052
19086
  /* @__PURE__ */ (0, N.jsxs)("div", {
19053
19087
  className: "ltp-portrait__control-group ltp-portrait__control-group--left",
19054
19088
  "data-ltp-control-group": "left",
19055
19089
  "data-ltp-portrait-region": "bottom-left",
19056
- children: [/* @__PURE__ */ (0, N.jsx)(ih, { slot: "controlBarLeft" }), /* @__PURE__ */ (0, N.jsx)(rh, {
19090
+ children: [/* @__PURE__ */ (0, N.jsx)(oh, { slot: "controlBarLeft" }), /* @__PURE__ */ (0, N.jsx)(ah, {
19057
19091
  name: "time",
19058
- children: n.time
19092
+ children: r.time
19059
19093
  })]
19060
19094
  }),
19061
19095
  /* @__PURE__ */ (0, N.jsxs)("div", {
19062
19096
  className: "ltp-portrait__control-group ltp-portrait__control-group--center",
19063
19097
  "data-ltp-control-group": "center",
19064
19098
  "data-ltp-portrait-region": "bottom-center",
19065
- children: [/* @__PURE__ */ (0, N.jsx)(rh, {
19099
+ children: [/* @__PURE__ */ (0, N.jsx)(ah, {
19066
19100
  name: "playPause",
19067
- children: n.playPause
19068
- }), /* @__PURE__ */ (0, N.jsx)(ih, { slot: "controlBarCenter" })]
19101
+ children: r.playPause
19102
+ }), /* @__PURE__ */ (0, N.jsx)(oh, { slot: "controlBarCenter" })]
19069
19103
  }),
19070
19104
  /* @__PURE__ */ (0, N.jsxs)("div", {
19071
19105
  className: "ltp-portrait__control-group ltp-portrait__control-group--right",
19072
19106
  "data-ltp-control-group": "right",
19073
19107
  "data-ltp-portrait-region": "bottom-right",
19074
- children: [/* @__PURE__ */ (0, N.jsx)(ih, { slot: "controlBarRight" }), /* @__PURE__ */ (0, N.jsx)(rh, {
19108
+ children: [/* @__PURE__ */ (0, N.jsx)(oh, { slot: "controlBarRight" }), /* @__PURE__ */ (0, N.jsx)(ah, {
19075
19109
  name: "volume",
19076
- children: n.volume
19110
+ children: r.volume
19077
19111
  })]
19078
19112
  }),
19079
19113
  /* @__PURE__ */ (0, N.jsx)("div", {
19080
19114
  className: "ltp-portrait__menu",
19081
19115
  "data-ltp-portrait-region": "menu-anchor",
19082
- children: /* @__PURE__ */ (0, N.jsx)(ih, { slot: "menu" })
19116
+ children: /* @__PURE__ */ (0, N.jsx)(oh, { slot: "menu" })
19083
19117
  })
19084
19118
  ] }) : null,
19085
19119
  /* @__PURE__ */ (0, N.jsx)("div", {
19086
19120
  className: "ltp-portrait__context-panel",
19087
19121
  "data-ltp-portrait-region": "context-panel",
19088
- children: /* @__PURE__ */ (0, N.jsx)(ih, { slot: "contextPanel" })
19122
+ children: /* @__PURE__ */ (0, N.jsx)(oh, { slot: "contextPanel" })
19089
19123
  })
19090
19124
  ]
19091
19125
  }),
19092
19126
  /* @__PURE__ */ (0, N.jsx)("div", {
19093
19127
  className: "ltp-portrait__overlay",
19094
19128
  "data-ltp-portrait-region": "overlay",
19095
- children: /* @__PURE__ */ (0, N.jsx)(ih, { slot: "overlay" })
19129
+ children: /* @__PURE__ */ (0, N.jsx)(oh, { slot: "overlay" })
19096
19130
  }),
19097
- e,
19098
- o,
19099
- s
19131
+ t,
19132
+ s,
19133
+ c
19100
19134
  ]
19101
19135
  });
19102
19136
  }
@@ -19109,7 +19143,7 @@ function Q(e, t, n = {}) {
19109
19143
  placeholders: Object.freeze(n)
19110
19144
  });
19111
19145
  }
19112
- var oh = Object.freeze([
19146
+ var ch = Object.freeze([
19113
19147
  Q("container.label", "playerLabel"),
19114
19148
  Q("buttons.play", "play"),
19115
19149
  Q("buttons.pause", "pause"),
@@ -19149,13 +19183,13 @@ var oh = Object.freeze([
19149
19183
  Q("menu.off", "captionsOffOption"),
19150
19184
  Q("menu.subtitles", "subtitles")
19151
19185
  ]);
19152
- function sh(e, t) {
19186
+ function lh(e, t) {
19153
19187
  return e.replace(/\{([^{}]+)\}/g, (e, n) => {
19154
19188
  let r = t[n];
19155
19189
  return r === void 0 ? e : `{${r}}`;
19156
19190
  });
19157
19191
  }
19158
- function ch(e, t, n) {
19192
+ function uh(e, t, n) {
19159
19193
  let r = t.split("."), i = e;
19160
19194
  for (let e of r.slice(0, -1)) {
19161
19195
  let t = i[e];
@@ -19169,24 +19203,24 @@ function ch(e, t, n) {
19169
19203
  if (a === void 0) throw Error("Engine translation key cannot be empty");
19170
19204
  i[a] = n;
19171
19205
  }
19172
- function lh(e) {
19206
+ function dh(e) {
19173
19207
  let t = {};
19174
- for (let n of oh) ch(t, n.engineKey, sh(e[n.playerKey], n.placeholders));
19208
+ for (let n of ch) uh(t, n.engineKey, lh(e[n.playerKey], n.placeholders));
19175
19209
  return t;
19176
19210
  }
19177
- function uh(e, t = "", n = {}) {
19211
+ function fh(e, t = "", n = {}) {
19178
19212
  for (let [r, i] of Object.entries(e)) {
19179
19213
  if (i === void 0) continue;
19180
19214
  let e = t === "" ? r : `${t}.${r}`;
19181
- typeof i == "string" ? n[e] = i : uh(i, e, n);
19215
+ typeof i == "string" ? n[e] = i : fh(i, e, n);
19182
19216
  }
19183
19217
  return n;
19184
19218
  }
19185
- ce("en", l), ce("en", lh(Bd));
19186
- function dh({ children: e, language: t, strings: n }) {
19187
- let r = (0, w.useMemo)(() => lh(n), [n]), i = (0, w.useMemo)(() => me({
19219
+ ce("en", l), ce("en", dh(Bd));
19220
+ function ph({ children: e, language: t, strings: n }) {
19221
+ let r = (0, w.useMemo)(() => dh(n), [n]), i = (0, w.useMemo)(() => me({
19188
19222
  ...le(t),
19189
- ...uh(r)
19223
+ ...fh(r)
19190
19224
  }, t), [t, r]), a = (0, w.useMemo)(() => ({
19191
19225
  translator: i,
19192
19226
  locale: t,
@@ -19205,71 +19239,71 @@ function dh({ children: e, language: t, strings: n }) {
19205
19239
  }
19206
19240
  //#endregion
19207
19241
  //#region src/strings/resolve-strings.ts
19208
- var fh = Object.freeze({
19242
+ var mh = Object.freeze({
19209
19243
  language: "en",
19210
19244
  strings: Bd
19211
19245
  });
19212
- function ph(e) {
19246
+ function hh(e) {
19213
19247
  if (typeof e != "object" || !e || Object.isFrozen(e)) return e;
19214
- for (let t of Object.values(e)) ph(t);
19248
+ for (let t of Object.values(e)) hh(t);
19215
19249
  return Object.freeze(e);
19216
19250
  }
19217
- function mh(e) {
19251
+ function gh(e) {
19218
19252
  try {
19219
19253
  return Intl.getCanonicalLocales(e)[0] ?? null;
19220
19254
  } catch {
19221
19255
  return null;
19222
19256
  }
19223
19257
  }
19224
- function hh(e, t) {
19225
- let n = new Map(t.map((e) => [mh(e.language), e])), r = e === void 0 ? [] : Array.isArray(e) ? e : [e];
19258
+ function _h(e, t) {
19259
+ let n = new Map(t.map((e) => [gh(e.language), e])), r = e === void 0 ? [] : Array.isArray(e) ? e : [e];
19226
19260
  for (let e of r) {
19227
- let t = mh(e);
19261
+ let t = gh(e);
19228
19262
  if (t !== null) {
19229
19263
  let e = n.get(t);
19230
19264
  if (e !== void 0) return e;
19231
19265
  }
19232
19266
  }
19233
- return fh;
19267
+ return mh;
19234
19268
  }
19235
- function gh(e) {
19269
+ function vh(e) {
19236
19270
  return /^[A-Za-z_$][\w$]*$/.test(e) ? `$.strings.${e}` : `$.strings[${JSON.stringify(e)}]`;
19237
19271
  }
19238
- function _h(e, t = {}, n = []) {
19239
- let r = hh(e, [fh, ...n]), i = Object.keys(t).filter((e) => !Hd(e)).sort(), a = i.map((e) => ({
19272
+ function yh(e, t = {}, n = []) {
19273
+ let r = _h(e, [mh, ...n]), i = Object.keys(t).filter((e) => !Hd(e)).sort(), a = i.map((e) => ({
19240
19274
  code: "unknown-string-key",
19241
- path: gh(e),
19275
+ path: vh(e),
19242
19276
  action: "omitted",
19243
19277
  message: `unknown player string key ${JSON.stringify(e)}`
19244
19278
  })), o = Object.fromEntries(Object.keys(Bd).map((e) => [e, Object.hasOwn(t, e) ? t[e] : r.strings[e] ?? Bd[e]]));
19245
- return ph({
19246
- selectedLanguage: mh(r.language) ?? "en",
19279
+ return hh({
19280
+ selectedLanguage: gh(r.language) ?? "en",
19247
19281
  strings: o,
19248
19282
  unknownKeys: i,
19249
19283
  findings: a
19250
19284
  });
19251
19285
  }
19252
- var vh = _h();
19286
+ var bh = yh();
19253
19287
  //#endregion
19254
19288
  //#region src/config/resolve-config.ts
19255
- function yh(e) {
19256
- return Array.isArray(e) ? e.map((e) => yh(e)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, yh(t)])) : e;
19289
+ function xh(e) {
19290
+ return Array.isArray(e) ? e.map((e) => xh(e)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, xh(t)])) : e;
19257
19291
  }
19258
- function bh(e) {
19292
+ function Sh(e) {
19259
19293
  if (typeof e != "object" || !e || Object.isFrozen(e)) return e;
19260
- for (let t of Object.values(e)) bh(t);
19294
+ for (let t of Object.values(e)) Sh(t);
19261
19295
  return Object.freeze(e);
19262
19296
  }
19263
- function xh(e, t) {
19297
+ function Ch(e, t) {
19264
19298
  return { enabled: e === void 0 ? t.enabled : e !== !1 };
19265
19299
  }
19266
- function Sh(e) {
19300
+ function wh(e) {
19267
19301
  let t = X.controls.cover;
19268
19302
  if (e === !1) return {
19269
- ...yh(t),
19303
+ ...xh(t),
19270
19304
  enabled: !1
19271
19305
  };
19272
- if (typeof e != "object" || !e) return yh(t);
19306
+ if (typeof e != "object" || !e) return xh(t);
19273
19307
  let n = e, r = n.button, i = r === !1 ? {
19274
19308
  ...t.button,
19275
19309
  enabled: !1
@@ -19285,7 +19319,7 @@ function Sh(e) {
19285
19319
  button: i
19286
19320
  };
19287
19321
  }
19288
- function Ch(e) {
19322
+ function Th(e) {
19289
19323
  let t = X.controls.timeline;
19290
19324
  return e === !1 ? {
19291
19325
  ...t,
@@ -19295,28 +19329,28 @@ function Ch(e) {
19295
19329
  seekStep: e.seekStep ?? t.seekStep
19296
19330
  };
19297
19331
  }
19298
- function wh(e) {
19332
+ function Eh(e) {
19299
19333
  let t = e.controls;
19300
19334
  return {
19301
- cover: Sh(t?.cover),
19302
- playPause: xh(t?.playPause, X.controls.playPause),
19303
- timeline: Ch(t?.timeline),
19304
- time: xh(t?.time, X.controls.time),
19305
- volume: xh(t?.volume, X.controls.volume),
19306
- fullscreen: xh(t?.fullscreen, X.controls.fullscreen),
19307
- pip: xh(t?.pip, X.controls.pip),
19308
- buffering: xh(t?.buffering, X.controls.buffering),
19309
- inputFeedback: xh(t?.inputFeedback, X.controls.inputFeedback),
19310
- logo: xh(t?.logo, X.controls.logo),
19311
- gestures: xh(t?.gestures, X.controls.gestures),
19312
- hotkeys: xh(t?.hotkeys, X.controls.hotkeys)
19335
+ cover: wh(t?.cover),
19336
+ playPause: Ch(t?.playPause, X.controls.playPause),
19337
+ timeline: Th(t?.timeline),
19338
+ time: Ch(t?.time, X.controls.time),
19339
+ volume: Ch(t?.volume, X.controls.volume),
19340
+ fullscreen: Ch(t?.fullscreen, X.controls.fullscreen),
19341
+ pip: Ch(t?.pip, X.controls.pip),
19342
+ buffering: Ch(t?.buffering, X.controls.buffering),
19343
+ inputFeedback: Ch(t?.inputFeedback, X.controls.inputFeedback),
19344
+ logo: Ch(t?.logo, X.controls.logo),
19345
+ gestures: Ch(t?.gestures, X.controls.gestures),
19346
+ hotkeys: Ch(t?.hotkeys, X.controls.hotkeys)
19313
19347
  };
19314
19348
  }
19315
- function Th(e) {
19349
+ function Dh(e) {
19316
19350
  let t = e.capabilities, n = t?.speed, r = t?.share;
19317
19351
  return {
19318
- chapters: xh(t?.chapters, X.capabilities.chapters),
19319
- captions: xh(t?.captions, X.capabilities.captions),
19352
+ chapters: Ch(t?.chapters, X.capabilities.chapters),
19353
+ captions: Ch(t?.captions, X.capabilities.captions),
19320
19354
  speed: {
19321
19355
  enabled: n === void 0 ? X.capabilities.speed.enabled : n !== !1,
19322
19356
  options: typeof n == "object" && n.options !== void 0 ? [...n.options] : [...X.capabilities.speed.options]
@@ -19329,17 +19363,17 @@ function Th(e) {
19329
19363
  targets: typeof r == "object" && r.targets !== void 0 ? X.capabilities.share.targets.filter((e) => r.targets?.includes(e)) : [...X.capabilities.share.targets],
19330
19364
  templates: { message: typeof r == "object" && r.templates?.message !== void 0 ? r.templates.message : X.capabilities.share.templates.message }
19331
19365
  },
19332
- contextPanel: xh(t?.contextPanel, X.capabilities.contextPanel)
19366
+ contextPanel: Ch(t?.contextPanel, X.capabilities.contextPanel)
19333
19367
  };
19334
19368
  }
19335
- function Eh(e, t) {
19369
+ function Oh(e, t) {
19336
19370
  return t.reduce((t, n) => {
19337
19371
  let r = Math.abs(n - e), i = Math.abs(t - e);
19338
19372
  return Math.abs(r - i) <= 2 ** -52 * Math.max(1, r, i) * 4 ? Math.min(n, t) : r < i ? n : t;
19339
19373
  });
19340
19374
  }
19341
- function Dh(e, t, n) {
19342
- let r = t.speed.enabled ? Eh(n.playbackRate ?? X.initialState.playbackRate, t.speed.options) : X.initialState.playbackRate;
19375
+ function kh(e, t, n) {
19376
+ let r = t.speed.enabled ? Oh(n.playbackRate ?? X.initialState.playbackRate, t.speed.options) : X.initialState.playbackRate;
19343
19377
  if (!t.captions.enabled) return {
19344
19378
  playbackRate: r,
19345
19379
  captions: { enabled: !1 }
@@ -19353,58 +19387,58 @@ function Dh(e, t, n) {
19353
19387
  }
19354
19388
  };
19355
19389
  }
19356
- function Oh(e) {
19357
- let t = yh(e);
19390
+ function Ah(e) {
19391
+ let t = xh(e);
19358
19392
  return {
19359
19393
  ...t,
19360
19394
  sources: t.sources,
19361
19395
  tracks: t.tracks ?? [...X.content.tracks],
19362
19396
  chapters: t.chapters ?? [...X.content.chapters],
19363
- metadata: t.metadata ?? yh(X.content.metadata)
19397
+ metadata: t.metadata ?? xh(X.content.metadata)
19364
19398
  };
19365
19399
  }
19366
- function kh(e, t = {}) {
19367
- let n = Th(e);
19368
- return bh({
19400
+ function jh(e, t = {}) {
19401
+ let n = Dh(e);
19402
+ return Sh({
19369
19403
  version: X.version,
19370
19404
  layout: e.layout,
19371
- language: yh(e.language ?? X.language),
19372
- content: Oh(e.content),
19373
- controls: wh(e),
19405
+ language: xh(e.language ?? X.language),
19406
+ content: Ah(e.content),
19407
+ controls: Eh(e),
19374
19408
  capabilities: n,
19375
- strings: yh(e.strings ?? X.strings),
19376
- initialState: Dh(e, n, t)
19409
+ strings: xh(e.strings ?? X.strings),
19410
+ initialState: kh(e, n, t)
19377
19411
  });
19378
19412
  }
19379
19413
  //#endregion
19380
19414
  //#region src/user-state/storage.ts
19381
- var Ah = "lt-player:user:v1", jh = !1, Mh = Object.freeze({});
19382
- function Nh(e) {
19415
+ var Mh = "lt-player:user:v1", Nh = !1, Ph = Object.freeze({});
19416
+ function Fh(e) {
19383
19417
  return Object.freeze({ ...e });
19384
19418
  }
19385
- function Ph(e) {
19419
+ function Ih(e) {
19386
19420
  try {
19387
19421
  return Intl.getCanonicalLocales(e).length === 1;
19388
19422
  } catch {
19389
19423
  return !1;
19390
19424
  }
19391
19425
  }
19392
- function Fh(e) {
19393
- if (typeof e != "object" || !e || Array.isArray(e)) return Nh({});
19426
+ function Lh(e) {
19427
+ if (typeof e != "object" || !e || Array.isArray(e)) return Fh({});
19394
19428
  let t = e, n = {};
19395
- 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" && Ph(t.captionsLanguage) && (n.captionsLanguage = t.captionsLanguage), Nh(n);
19429
+ 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" && Ih(t.captionsLanguage) && (n.captionsLanguage = t.captionsLanguage), Fh(n);
19396
19430
  }
19397
- function Ih(e) {
19398
- jh = !0, e !== void 0 && (Mh = Nh(e));
19431
+ function Rh(e) {
19432
+ Nh = !0, e !== void 0 && (Ph = Fh(e));
19399
19433
  }
19400
- function Lh(e = {}) {
19434
+ function zh(e = {}) {
19401
19435
  let t = e.getStorage ?? (() => globalThis.localStorage), n = e.stringify ?? JSON.stringify, r, i = () => {
19402
- if (!jh) {
19436
+ if (!Nh) {
19403
19437
  if (r !== void 0) return r;
19404
19438
  try {
19405
19439
  return r = t(), r;
19406
19440
  } catch {
19407
- Ih();
19441
+ Rh();
19408
19442
  return;
19409
19443
  }
19410
19444
  }
@@ -19412,74 +19446,74 @@ function Lh(e = {}) {
19412
19446
  return {
19413
19447
  read() {
19414
19448
  let e = i();
19415
- if (e === void 0) return Nh(Mh);
19449
+ if (e === void 0) return Fh(Ph);
19416
19450
  let t;
19417
19451
  try {
19418
- t = e.getItem(Ah);
19452
+ t = e.getItem(Mh);
19419
19453
  } catch {
19420
- return Ih(), Nh(Mh);
19454
+ return Rh(), Fh(Ph);
19421
19455
  }
19422
- if (t === null) return Nh({});
19456
+ if (t === null) return Fh({});
19423
19457
  try {
19424
- return Fh(JSON.parse(t));
19458
+ return Lh(JSON.parse(t));
19425
19459
  } catch {
19426
- return Nh({});
19460
+ return Fh({});
19427
19461
  }
19428
19462
  },
19429
19463
  write(e) {
19430
- let t = Fh(e);
19431
- if (jh) {
19432
- Mh = t;
19464
+ let t = Lh(e);
19465
+ if (Nh) {
19466
+ Ph = t;
19433
19467
  return;
19434
19468
  }
19435
19469
  let r;
19436
19470
  try {
19437
19471
  r = n(t);
19438
19472
  } catch {
19439
- Ih(t);
19473
+ Rh(t);
19440
19474
  return;
19441
19475
  }
19442
19476
  let a = i();
19443
19477
  if (a === void 0) {
19444
- Mh = t;
19478
+ Ph = t;
19445
19479
  return;
19446
19480
  }
19447
19481
  try {
19448
- a.setItem(Ah, r);
19482
+ a.setItem(Mh, r);
19449
19483
  } catch {
19450
- Ih(t);
19484
+ Rh(t);
19451
19485
  }
19452
19486
  }
19453
19487
  };
19454
19488
  }
19455
19489
  //#endregion
19456
19490
  //#region src/user-state/user-state.ts
19457
- var Rh = Symbol("ignore-observed-value");
19458
- function zh(e) {
19491
+ var Bh = Symbol("ignore-observed-value");
19492
+ function Vh(e) {
19459
19493
  return Object.freeze({ ...e });
19460
19494
  }
19461
- function Bh(e) {
19462
- let t = e.textTracks.find((e) => Vh(e) && (e.mode === "hidden" || e.mode === "showing"));
19495
+ function Hh(e) {
19496
+ let t = e.textTracks.find((e) => Uh(e) && (e.mode === "hidden" || e.mode === "showing"));
19463
19497
  return t === void 0 ? "off" : `on:${t.id ?? ""}:${t.language}`;
19464
19498
  }
19465
- function Vh(e) {
19499
+ function Uh(e) {
19466
19500
  return e.kind === "captions" || e.kind === "subtitles";
19467
19501
  }
19468
- function Hh(e) {
19502
+ function Wh(e) {
19469
19503
  try {
19470
19504
  return Intl.getCanonicalLocales(e)[0]?.toLowerCase();
19471
19505
  } catch {
19472
19506
  return;
19473
19507
  }
19474
19508
  }
19475
- function Uh(e, t) {
19476
- let n = Hh(e), r = Hh(t);
19509
+ function Gh(e, t) {
19510
+ let n = Wh(e), r = Wh(t);
19477
19511
  return n === void 0 || r === void 0 ? !1 : n === r || n.startsWith(`${r}-`) || r.startsWith(`${n}-`);
19478
19512
  }
19479
- function Wh(e) {
19513
+ function Kh(e) {
19480
19514
  return typeof e == "string" ? [e] : e;
19481
19515
  }
19482
- function Gh(e = Lh()) {
19516
+ function qh(e = zh()) {
19483
19517
  let t;
19484
19518
  return {
19485
19519
  storage: e,
@@ -19488,12 +19522,12 @@ function Gh(e = Lh()) {
19488
19522
  }
19489
19523
  };
19490
19524
  }
19491
- var Kh = class {
19525
+ var Jh = class {
19492
19526
  #e;
19493
19527
  #t;
19494
19528
  #n = /* @__PURE__ */ new Set();
19495
19529
  #r = /* @__PURE__ */ new Map();
19496
- #i = zh({});
19530
+ #i = Vh({});
19497
19531
  #a;
19498
19532
  #o = null;
19499
19533
  #s = null;
@@ -19512,7 +19546,7 @@ var Kh = class {
19512
19546
  getSnapshot = () => this.#i;
19513
19547
  subscribe = (e) => this.#g ? () => void 0 : (this.#n.add(e), () => this.#n.delete(e));
19514
19548
  start() {
19515
- this.#h || this.#g || (this.#h = !0, this.#i = zh(this.#t.hydrate()), this.#a = this.#e.getSnapshot(), this.#m = this.#a.canPlay, this.#o = this.#e.subscribe(this.#_), this.#k(), this.#y());
19549
+ this.#h || this.#g || (this.#h = !0, this.#i = Vh(this.#t.hydrate()), this.#a = this.#e.getSnapshot(), this.#m = this.#a.canPlay, this.#o = this.#e.subscribe(this.#_), this.#k(), this.#y());
19516
19550
  }
19517
19551
  applyResolvedConfig(e, t) {
19518
19552
  this.#g || (this.start(), this.#s = e, this.#c = t, this.#l += 1, this.#f = !0, this.#p = !0, this.#m = !1, this.#y());
@@ -19520,32 +19554,32 @@ var Kh = class {
19520
19554
  setVolume(e) {
19521
19555
  if (this.#g || (this.start(), !Number.isFinite(e))) return;
19522
19556
  let t = Math.min(1, Math.max(0, e));
19523
- this.#O({ volume: t }) && this.#D([["volume", t], ["muted", Rh]], () => this.#e.setVolume(t));
19557
+ this.#O({ volume: t }) && this.#D([["volume", t], ["muted", Bh]], () => this.#e.setVolume(t));
19524
19558
  }
19525
19559
  setMuted(e) {
19526
19560
  this.#g || (this.start(), !(!this.#O({ muted: e }) && this.#e.getSnapshot().muted === e) && this.#D([["muted", e]], () => this.#e.setMuted(e)));
19527
19561
  }
19528
19562
  setPlaybackRate(e) {
19529
19563
  if (this.#g || (this.start(), this.#s?.capabilities.speed.enabled === !1) || !Number.isFinite(e) || e <= 0 || !this.#O({ playbackRate: e })) return;
19530
- let t = this.#s?.capabilities.speed, n = t === void 0 ? e : t.enabled ? Eh(e, t.options) : 1;
19564
+ let t = this.#s?.capabilities.speed, n = t === void 0 ? e : t.enabled ? Oh(e, t.options) : 1;
19531
19565
  this.#f = !1, this.#D([["playbackRate", n]], () => this.#e.setPlaybackRate(n));
19532
19566
  }
19533
19567
  setCaptions(e, t) {
19534
19568
  if (this.#g || (this.start(), this.#s?.capabilities.captions.enabled === !1)) return;
19535
- let n = t === void 0 ? void 0 : Fh({ captionsLanguage: t }).captionsLanguage, r = { captionsEnabled: e };
19569
+ let n = t === void 0 ? void 0 : Lh({ captionsLanguage: t }).captionsLanguage, r = { captionsEnabled: e };
19536
19570
  n !== void 0 && (r.captionsLanguage = n), this.#O(r) && (this.#p = !1, this.#m = this.#e.getSnapshot().canPlay, this.#T());
19537
19571
  }
19538
19572
  selectCaptionTrack(e, t) {
19539
19573
  if (this.#g || (this.start(), this.#s?.capabilities.captions.enabled === !1)) return;
19540
- let n = this.#e.getSnapshot().textTracks.find((t) => Vh(t) && t.id === e);
19574
+ let n = this.#e.getSnapshot().textTracks.find((t) => Uh(t) && t.id === e);
19541
19575
  if (n === void 0) return;
19542
- let r = Fh({ captionsLanguage: t ?? n.language }).captionsLanguage;
19576
+ let r = Lh({ captionsLanguage: t ?? n.language }).captionsLanguage;
19543
19577
  this.#O({
19544
19578
  captionsEnabled: !0,
19545
19579
  ...r === void 0 ? {} : { captionsLanguage: r }
19546
19580
  }), this.#p = !1, this.#m = this.#e.getSnapshot().canPlay;
19547
19581
  let i = `on:${e}:${n.language}`;
19548
- Bh(this.#e.getSnapshot()) !== i && this.#D([["captions", i]], () => this.#e.selectSubtitlesTrack(e));
19582
+ Hh(this.#e.getSnapshot()) !== i && this.#D([["captions", i]], () => this.#e.selectSubtitlesTrack(e));
19549
19583
  }
19550
19584
  refreshCaptions() {
19551
19585
  this.#g || this.#s === null || (this.#a = this.#e.getSnapshot(), this.#p = !0, this.#m = !1, this.#C(this.#a));
@@ -19572,11 +19606,11 @@ var Kh = class {
19572
19606
  }), this.#p) this.#C(t);
19573
19607
  else if (!this.#m) t.canPlay && (this.#m = !0);
19574
19608
  else {
19575
- let n = Bh(t), i = Bh(e);
19609
+ let n = Hh(t), i = Hh(e);
19576
19610
  this.#v("captions", n, i, () => {
19577
- let e = t.textTracks.find((e) => Vh(e) && (e.mode === "hidden" || e.mode === "showing"));
19611
+ let e = t.textTracks.find((e) => Uh(e) && (e.mode === "hidden" || e.mode === "showing"));
19578
19612
  if (r.captionsEnabled = e !== void 0, e !== void 0) {
19579
- let t = Fh({ captionsLanguage: e.language }).captionsLanguage;
19613
+ let t = Lh({ captionsLanguage: e.language }).captionsLanguage;
19580
19614
  t !== void 0 && (r.captionsLanguage = t);
19581
19615
  }
19582
19616
  });
@@ -19586,7 +19620,7 @@ var Kh = class {
19586
19620
  #v(e, t, n, r) {
19587
19621
  let i = this.#r.get(e);
19588
19622
  if (i !== void 0) {
19589
- (i.expected === Rh || Object.is(t, i.expected)) && this.#r.delete(e);
19623
+ (i.expected === Bh || Object.is(t, i.expected)) && this.#r.delete(e);
19590
19624
  return;
19591
19625
  }
19592
19626
  Object.is(t, n) || r(t);
@@ -19598,7 +19632,7 @@ var Kh = class {
19598
19632
  }
19599
19633
  async #b() {
19600
19634
  let e = this.#i.volume, t = [];
19601
- e !== void 0 && t.push(this.#D([["volume", e], ["muted", Rh]], () => this.#e.setVolume(e)));
19635
+ e !== void 0 && t.push(this.#D([["volume", e], ["muted", Bh]], () => this.#e.setVolume(e)));
19602
19636
  let n = this.#c === "feed" || this.#i.muted;
19603
19637
  n !== void 0 && t.push(this.#D([["muted", n]], () => this.#e.setMuted(n))), await Promise.all(t);
19604
19638
  }
@@ -19623,7 +19657,7 @@ var Kh = class {
19623
19657
  #C(e) {
19624
19658
  if (!this.#p || this.#s === null || !e.attached || this.#r.has("captions")) return;
19625
19659
  let t = this.#E(e);
19626
- if (t !== null && t.value !== Bh(e)) {
19660
+ if (t !== null && t.value !== Hh(e)) {
19627
19661
  let e = this.#l;
19628
19662
  this.#D([["captions", t.value]], () => this.#e.selectSubtitlesTrack(t.action)).then(() => {
19629
19663
  !this.#g && e === this.#l && this.#e.getSnapshot().canPlay && this.#w();
@@ -19638,7 +19672,7 @@ var Kh = class {
19638
19672
  #T() {
19639
19673
  if (!this.#a.attached) return;
19640
19674
  let e = this.#E(this.#a);
19641
- e !== null && e.value !== Bh(this.#a) && this.#D([["captions", e.value]], () => this.#e.selectSubtitlesTrack(e.action));
19675
+ e !== null && e.value !== Hh(this.#a) && this.#D([["captions", e.value]], () => this.#e.selectSubtitlesTrack(e.action));
19642
19676
  }
19643
19677
  #E(e) {
19644
19678
  let t = this.#s;
@@ -19646,13 +19680,13 @@ var Kh = class {
19646
19680
  action: "off",
19647
19681
  value: "off"
19648
19682
  };
19649
- let n = e.textTracks.filter(Vh);
19683
+ let n = e.textTracks.filter(Uh);
19650
19684
  if (n.length === 0) return null;
19651
19685
  let r = [
19652
19686
  this.#i.captionsLanguage,
19653
19687
  t.initialState.captions.language,
19654
- ...Wh(t.language)
19655
- ].filter((e) => e !== void 0).map((e) => n.find((t) => Uh(t.language, e))).find((e) => e !== void 0) ?? n[0];
19688
+ ...Kh(t.language)
19689
+ ].filter((e) => e !== void 0).map((e) => n.find((t) => Gh(t.language, e))).find((e) => e !== void 0) ?? n[0];
19656
19690
  return r?.id === void 0 ? null : {
19657
19691
  action: r.id,
19658
19692
  value: `on:${r.id}:${r.language}`
@@ -19679,7 +19713,7 @@ var Kh = class {
19679
19713
  });
19680
19714
  }
19681
19715
  #O(e) {
19682
- let t = zh({
19716
+ let t = Vh({
19683
19717
  ...this.#i,
19684
19718
  ...e
19685
19719
  });
@@ -19689,10 +19723,10 @@ var Kh = class {
19689
19723
  for (let e of this.#n) e();
19690
19724
  }
19691
19725
  };
19692
- function qh(e, t = Gh()) {
19693
- return new Kh(e, t);
19726
+ function Yh(e, t = qh()) {
19727
+ return new Jh(e, t);
19694
19728
  }
19695
- var Jh = 1e4, Yh = 1e4, Xh = Qh("idle", null, null), Zh = {
19729
+ var Xh = 1e4, Zh = 1e4, Qh = eg("idle", null, null), $h = {
19696
19730
  idle: { start: "buffering" },
19697
19731
  buffering: {
19698
19732
  frames: "playing",
@@ -19707,7 +19741,7 @@ var Jh = 1e4, Yh = 1e4, Xh = Qh("idle", null, null), Zh = {
19707
19741
  ended: { replay: "buffering" },
19708
19742
  error: { retry: "buffering" }
19709
19743
  };
19710
- function Qh(e, t, n) {
19744
+ function eg(e, t, n) {
19711
19745
  return Object.freeze({
19712
19746
  playback: e,
19713
19747
  errorKind: t,
@@ -19715,19 +19749,19 @@ function Qh(e, t, n) {
19715
19749
  retryable: e === "error" && t === "media"
19716
19750
  });
19717
19751
  }
19718
- function $h(e) {
19752
+ function tg(e) {
19719
19753
  return e.error === null ? e.ended ? "ended" : e.started ? e.waiting ? "buffering" : e.paused ? "paused" : "playing" : "idle" : "error";
19720
19754
  }
19721
- function eg(e, t) {
19722
- return t === "media-error" || t === "config-error" ? "error" : t === "standalone-update" ? "idle" : t === "feed-update" ? "buffering" : Zh[e]?.[t] ?? e;
19755
+ function ng(e, t) {
19756
+ return t === "media-error" || t === "config-error" ? "error" : t === "standalone-update" ? "idle" : t === "feed-update" ? "buffering" : $h[e]?.[t] ?? e;
19723
19757
  }
19724
- function tg(e) {
19758
+ function rg(e) {
19725
19759
  return e;
19726
19760
  }
19727
- var ng = class {
19761
+ var ig = class {
19728
19762
  #e;
19729
19763
  #t = /* @__PURE__ */ new Set();
19730
- #n = Xh;
19764
+ #n = Qh;
19731
19765
  #r = null;
19732
19766
  #i = null;
19733
19767
  #a = "idle";
@@ -19754,7 +19788,7 @@ var ng = class {
19754
19788
  subscribe = (e) => this.#_ ? () => void 0 : (this.#t.add(e), () => this.#t.delete(e));
19755
19789
  applyEngineSnapshot(e) {
19756
19790
  if (this.#_) return;
19757
- let t = this.#o, n = t !== null && Number.isFinite(e.currentTime) && e.currentTime > t.currentTime, r = t !== null && !t.canPlay && e.canPlay, i = $h(e);
19791
+ let t = this.#o, n = t !== null && Number.isFinite(e.currentTime) && e.currentTime > t.currentTime, r = t !== null && !t.canPlay && e.canPlay, i = tg(e);
19758
19792
  if (this.#o = e, (n || i === "playing") && (this.#c = !0), i === "error") {
19759
19793
  if (this.#F(), this.#g) return;
19760
19794
  this.#c && this.#a !== "error" ? this.#w(this.#A(e)) : this.#k(this.#A(e, !1));
@@ -19795,7 +19829,7 @@ var ng = class {
19795
19829
  }
19796
19830
  }
19797
19831
  #y(e) {
19798
- this.#a = eg(this.#a, e);
19832
+ this.#a = ng(this.#a, e);
19799
19833
  }
19800
19834
  #b(e = !1) {
19801
19835
  if (this.#a === "buffering") {
@@ -19812,7 +19846,7 @@ var ng = class {
19812
19846
  #S(e) {
19813
19847
  this.#u === null && (this.#u = setTimeout(() => {
19814
19848
  this.#u = null, this.#a === "buffering" && !this.#g && this.#w(this.#A(e));
19815
- }, Jh));
19849
+ }, Xh));
19816
19850
  }
19817
19851
  #C(e) {
19818
19852
  this.#F(), this.#S(e);
@@ -19832,7 +19866,7 @@ var ng = class {
19832
19866
  let t = new AbortController();
19833
19867
  this.#p = t, this.#f = setTimeout(() => {
19834
19868
  e === this.#m && this.#p === t && (t.abort(), this.#D(e, t));
19835
- }, Yh);
19869
+ }, Zh);
19836
19870
  let n;
19837
19871
  try {
19838
19872
  n = this.#e(this.#s, t.signal);
@@ -19865,7 +19899,7 @@ var ng = class {
19865
19899
  this.#r = e;
19866
19900
  }
19867
19901
  #M(e) {
19868
- let t = Qh(e, this.#r, this.#i);
19902
+ let t = eg(e, this.#r, this.#i);
19869
19903
  if (t.playback !== this.#n.playback || t.errorKind !== this.#n.errorKind || t.mediaFailurePhase !== this.#n.mediaFailurePhase) {
19870
19904
  this.#n = t;
19871
19905
  for (let e of this.#t) e();
@@ -19887,30 +19921,30 @@ var ng = class {
19887
19921
  this.#f !== null && (clearTimeout(this.#f), this.#f = null);
19888
19922
  }
19889
19923
  };
19890
- function rg(e) {
19891
- return new ng(e);
19924
+ function ag(e) {
19925
+ return new ig(e);
19892
19926
  }
19893
19927
  //#endregion
19894
19928
  //#region src/core/player-state-context.tsx
19895
- var ig = (0, w.createContext)(null);
19896
- function ag({ children: e, controller: t }) {
19897
- return /* @__PURE__ */ (0, N.jsx)(ig, {
19929
+ var og = (0, w.createContext)(null);
19930
+ function sg({ children: e, controller: t }) {
19931
+ return /* @__PURE__ */ (0, N.jsx)(og, {
19898
19932
  value: t,
19899
19933
  children: e
19900
19934
  });
19901
19935
  }
19902
- function og() {
19903
- let e = (0, w.useContext)(ig);
19936
+ function cg() {
19937
+ let e = (0, w.useContext)(og);
19904
19938
  if (e === null) throw Error("usePlayerStateController must be used within PlayerStateProvider");
19905
19939
  return e;
19906
19940
  }
19907
- function sg() {
19908
- let e = og();
19909
- return Et(e.subscribe, e.getSnapshot, tg, Object.is);
19941
+ function lg() {
19942
+ let e = cg();
19943
+ return Et(e.subscribe, e.getSnapshot, rg, Object.is);
19910
19944
  }
19911
19945
  //#endregion
19912
19946
  //#region src/core/identity.tsx
19913
- function cg({ author: e, hidden: t = !1, surface: n, title: r }) {
19947
+ function ug({ author: e, hidden: t = !1, surface: n, title: r }) {
19914
19948
  if (e === void 0 && r === void 0) return null;
19915
19949
  let i = n === "cover", a = !i && t;
19916
19950
  return /* @__PURE__ */ (0, N.jsxs)("span", {
@@ -19934,7 +19968,7 @@ function cg({ author: e, hidden: t = !1, surface: n, title: r }) {
19934
19968
  }
19935
19969
  //#endregion
19936
19970
  //#region src/core/cover.tsx
19937
- function lg(e, t) {
19971
+ function dg(e, t) {
19938
19972
  let n = (0, w.useRef)({
19939
19973
  generation: t,
19940
19974
  hasPlayed: !1,
@@ -19952,14 +19986,14 @@ function lg(e, t) {
19952
19986
  "ended"
19953
19987
  ].includes(e) && (r.hasPlayed = !0), !r.hasPlayed;
19954
19988
  }
19955
- function ug(e, t, n) {
19956
- let r = lg(e, t), i = n && r;
19989
+ function fg(e, t, n) {
19990
+ let r = dg(e, t), i = n && r;
19957
19991
  return {
19958
19992
  chromeVisible: !n || !i,
19959
19993
  coverVisible: i
19960
19994
  };
19961
19995
  }
19962
- function dg({ author: e, buttonEnabled: t, buttonLabel: n, imageEnabled: r, layout: i, onPlay: a, playback: o, poster: s, title: c, visible: l, visibleButtonLabel: u }) {
19996
+ function pg({ author: e, buttonEnabled: t, buttonLabel: n, imageEnabled: r, layout: i, onPlay: a, playback: o, poster: s, title: c, visible: l, visibleButtonLabel: u }) {
19963
19997
  let [d, f] = (0, w.useState)(!1), p = (0, w.useRef)(!1), m = (0, w.useRef)(o);
19964
19998
  return m.current = o, l ? /* @__PURE__ */ (0, N.jsxs)("button", {
19965
19999
  "aria-disabled": d || o === "buffering" || void 0,
@@ -19979,7 +20013,7 @@ function dg({ author: e, buttonEnabled: t, buttonLabel: n, imageEnabled: r, layo
19979
20013
  className: "ltp-cover__poster",
19980
20014
  src: s
19981
20015
  }) : null,
19982
- /* @__PURE__ */ (0, N.jsx)(cg, {
20016
+ /* @__PURE__ */ (0, N.jsx)(ug, {
19983
20017
  author: e,
19984
20018
  surface: "cover",
19985
20019
  title: c
@@ -20001,13 +20035,13 @@ function dg({ author: e, buttonEnabled: t, buttonLabel: n, imageEnabled: r, layo
20001
20035
  }
20002
20036
  //#endregion
20003
20037
  //#region src/core/control-visibility.ts
20004
- var fg = 3e3, pg = 2e3, mg = Object.freeze({ visible: !0 }), hg = Object.freeze({ visible: !1 });
20005
- function gg(e) {
20038
+ var mg = 3e3, hg = 2e3, gg = Object.freeze({ visible: !0 }), _g = Object.freeze({ visible: !1 });
20039
+ function vg(e) {
20006
20040
  return e !== null && e.layout === "landscape" && e.playback === "playing" && !e.configurationError;
20007
20041
  }
20008
- function _g() {
20009
- let e = null, t = !1, n = Date.now(), r = mg, i = null, a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = (e) => {
20010
- let t = e ? mg : hg;
20042
+ function yg() {
20043
+ let e = null, t = !1, n = Date.now(), r = gg, i = null, a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = (e) => {
20044
+ let t = e ? gg : _g;
20011
20045
  if (r !== t) {
20012
20046
  r = t;
20013
20047
  for (let e of a) e();
@@ -20015,10 +20049,10 @@ function _g() {
20015
20049
  }, c = () => {
20016
20050
  i !== null && (clearTimeout(i), i = null);
20017
20051
  }, l = () => e !== null && (e.engine.userActive || e.engine.controlsVisible), u = () => {
20018
- if (c(), !gg(e) || o.size > 0) return;
20019
- let r = Math.max(0, n + fg - Date.now());
20052
+ if (c(), !vg(e) || o.size > 0) return;
20053
+ let r = Math.max(0, n + mg - Date.now());
20020
20054
  i = setTimeout(() => {
20021
- i = null, !t && gg(e) && o.size === 0 && !l() && s(!1);
20055
+ i = null, !t && vg(e) && o.size === 0 && !l() && s(!1);
20022
20056
  }, r);
20023
20057
  }, d = () => {
20024
20058
  t || e?.layout === "portrait" || (n = Date.now(), s(!0), u());
@@ -20026,12 +20060,12 @@ function _g() {
20026
20060
  return Object.freeze({
20027
20061
  apply(r) {
20028
20062
  if (t) return;
20029
- let i = e, a = i?.generation !== r.generation, f = gg(r) && !gg(i), p = i !== null && !i.engine.userActive && r.engine.userActive, m = i !== null && i.engine.userActive && !r.engine.userActive && !r.engine.controlsVisible;
20063
+ let i = e, a = i?.generation !== r.generation, f = vg(r) && !vg(i), p = i !== null && !i.engine.userActive && r.engine.userActive, m = i !== null && i.engine.userActive && !r.engine.userActive && !r.engine.controlsVisible;
20030
20064
  if (e = r, a || r.layout === "portrait") {
20031
- n = Date.now(), c(), s(!0), r.layout === "landscape" && gg(r) && u();
20065
+ n = Date.now(), c(), s(!0), r.layout === "landscape" && vg(r) && u();
20032
20066
  return;
20033
20067
  }
20034
- if (!gg(r)) {
20068
+ if (!vg(r)) {
20035
20069
  c(), s(!0);
20036
20070
  return;
20037
20071
  }
@@ -20039,7 +20073,7 @@ function _g() {
20039
20073
  d();
20040
20074
  return;
20041
20075
  }
20042
- if (m && (n = Math.max(n, Date.now() - pg)), o.size > 0 || l()) {
20076
+ if (m && (n = Math.max(n, Date.now() - hg)), o.size > 0 || l()) {
20043
20077
  c(), s(!0);
20044
20078
  return;
20045
20079
  }
@@ -20064,7 +20098,7 @@ function _g() {
20064
20098
  },
20065
20099
  setGestureVisibility(n) {
20066
20100
  if (!(t || e?.layout === "portrait")) {
20067
- if (n || !gg(e) || o.size > 0) {
20101
+ if (n || !vg(e) || o.size > 0) {
20068
20102
  d();
20069
20103
  return;
20070
20104
  }
@@ -20078,40 +20112,40 @@ function _g() {
20078
20112
  }
20079
20113
  //#endregion
20080
20114
  //#region src/core/control-visibility-context.tsx
20081
- var vg = (0, w.createContext)(null);
20082
- function yg({ children: e, controller: t }) {
20083
- return /* @__PURE__ */ (0, N.jsx)(vg, {
20115
+ var bg = (0, w.createContext)(null);
20116
+ function xg({ children: e, controller: t }) {
20117
+ return /* @__PURE__ */ (0, N.jsx)(bg, {
20084
20118
  value: t,
20085
20119
  children: e
20086
20120
  });
20087
20121
  }
20088
- function bg() {
20089
- let e = (0, w.useContext)(vg);
20122
+ function Sg() {
20123
+ let e = (0, w.useContext)(bg);
20090
20124
  if (e === null) throw Error("Control visibility hooks must be used within ControlVisibilityProvider");
20091
20125
  return e;
20092
20126
  }
20093
- function xg() {
20094
- let e = bg();
20127
+ function Cg() {
20128
+ let e = Sg();
20095
20129
  return (0, w.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getSnapshot);
20096
20130
  }
20097
- function Sg(e) {
20098
- let t = bg();
20131
+ function wg(e) {
20132
+ let t = Sg();
20099
20133
  (0, w.useEffect)(() => {
20100
20134
  if (e) return t.requestControlsLock();
20101
20135
  }, [e, t]);
20102
20136
  }
20103
- var Cg = "[data-ltp-control-visibility-lock]", wg = "button, input, select, textarea, [role=\"button\"], [tabindex]:not([tabindex=\"-1\"])";
20104
- function Tg(e) {
20105
- return e instanceof Element ? e.closest(Cg) : null;
20137
+ var Tg = "[data-ltp-control-visibility-lock]", Eg = "button, input, select, textarea, [role=\"button\"], [tabindex]:not([tabindex=\"-1\"])";
20138
+ function Dg(e) {
20139
+ return e instanceof Element ? e.closest(Tg) : null;
20106
20140
  }
20107
- function Eg(e) {
20108
- return e instanceof HTMLElement && e.matches(wg) && e.closest(Cg) !== null && e.matches(":focus-visible");
20141
+ function Og(e) {
20142
+ return e instanceof HTMLElement && e.matches(Eg) && e.closest(Tg) !== null && e.matches(":focus-visible");
20109
20143
  }
20110
- function Dg(e = !0) {
20111
- let t = bg(), 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)(() => {
20144
+ function kg(e = !0) {
20145
+ let t = Sg(), 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)(() => {
20112
20146
  n.current?.(), n.current = null;
20113
20147
  }, []), c = (0, w.useCallback)((e) => {
20114
- !Eg(e) || n.current !== null || (n.current = t.requestControlsLock());
20148
+ !Og(e) || n.current !== null || (n.current = t.requestControlsLock());
20115
20149
  }, [t]), l = (0, w.useCallback)(() => {
20116
20150
  i.current?.(), i.current = null, r.current = null;
20117
20151
  }, []), u = (0, w.useCallback)((e) => {
@@ -20137,10 +20171,10 @@ function Dg(e = !0) {
20137
20171
  }, [e]), {
20138
20172
  onBlurCapture(e) {
20139
20173
  let t = e.relatedTarget;
20140
- Eg(t) || s();
20174
+ Og(t) || s();
20141
20175
  },
20142
20176
  onFocusCapture(e) {
20143
- c(e.target), Eg(e.target) && t.noteInteraction();
20177
+ c(e.target), Og(e.target) && t.noteInteraction();
20144
20178
  },
20145
20179
  onKeyDownCapture(e) {
20146
20180
  t.noteInteraction(), c(e.target);
@@ -20149,18 +20183,18 @@ function Dg(e = !0) {
20149
20183
  u(e.pointerId);
20150
20184
  },
20151
20185
  onPointerDownCapture(n) {
20152
- s(), n.pointerType === "mouse" && t.noteInteraction(), !(n.pointerType !== "touch" || !e || !t.getSnapshot().visible || Tg(n.target) === null) && (a.current.has(n.pointerId) || a.current.set(n.pointerId, t.requestControlsLock()));
20186
+ s(), n.pointerType === "mouse" && t.noteInteraction(), !(n.pointerType !== "touch" || !e || !t.getSnapshot().visible || Dg(n.target) === null) && (a.current.has(n.pointerId) || a.current.set(n.pointerId, t.requestControlsLock()));
20153
20187
  },
20154
20188
  onPointerMoveCapture(e) {
20155
20189
  e.pointerType === "mouse" && t.noteInteraction();
20156
20190
  },
20157
20191
  onPointerOutCapture(e) {
20158
- let t = Tg(e.target), n = Tg(e.relatedTarget);
20192
+ let t = Dg(e.target), n = Dg(e.relatedTarget);
20159
20193
  t !== null && t === r.current && t !== n && l();
20160
20194
  },
20161
20195
  onPointerOverCapture(e) {
20162
20196
  if (e.pointerType !== "mouse" && e.pointerType !== "pen") return;
20163
- let n = Tg(e.target);
20197
+ let n = Dg(e.target);
20164
20198
  n !== null && n !== r.current && (l(), r.current = n, i.current = t.requestControlsLock());
20165
20199
  },
20166
20200
  onPointerUpCapture(n) {
@@ -20170,12 +20204,12 @@ function Dg(e = !0) {
20170
20204
  }
20171
20205
  //#endregion
20172
20206
  //#region src/core/input-bindings.tsx
20173
- var Og = .05;
20174
- function kg({ disabled: e, layout: t, policy: n }) {
20175
- let r = Bt(), i = Lt(), a = Jm(), { toggle: o } = qf(), s = Lf(), c = bg(), l = a.getModule("share"), u = a.getModule("contextPanel"), d = (0, w.useSyncExternalStore)(l.subscribeInteraction, l.getInteractionSnapshot, l.getInteractionSnapshot).open, f = (0, w.useSyncExternalStore)(u.subscribeInteraction, u.getInteractionSnapshot, u.getInteractionSnapshot).view;
20207
+ var Ag = .05;
20208
+ function jg({ disabled: e, layout: t, policy: n }) {
20209
+ let r = Bt(), i = Lt(), a = Xm(), { toggle: o } = Jf(), s = Rf(), c = Sg(), l = a.getModule("share"), u = a.getModule("contextPanel"), d = (0, w.useSyncExternalStore)(l.subscribeInteraction, l.getInteractionSnapshot, l.getInteractionSnapshot).open, f = (0, w.useSyncExternalStore)(u.subscribeInteraction, u.getInteractionSnapshot, u.getInteractionSnapshot).view;
20176
20210
  return (0, w.useEffect)(() => {
20177
20211
  if (r === null) return;
20178
- let a = [], p = n.hotkeys && !e, m = n.gestures && !e, h = (e, t, r) => Ag(i, e, t, r, n.speedOptions, (e) => s.setPlaybackRate(e), e === "toggleControls" ? c.setGestureVisibility : void 0), g = (e, t, n, i) => {
20212
+ let a = [], p = n.hotkeys && !e, m = n.gestures && !e, h = (e, t, r) => Mg(i, e, t, r, n.speedOptions, (e) => s.setPlaybackRate(e), e === "toggleControls" ? c.setGestureVisibility : void 0), g = (e, t, n, i) => {
20179
20213
  !p || !n || a.push(Oi(r, {
20180
20214
  action: t,
20181
20215
  keys: e,
@@ -20184,7 +20218,7 @@ function kg({ disabled: e, layout: t, policy: n }) {
20184
20218
  onActivate: (e, n) => h(t, i, n)
20185
20219
  }));
20186
20220
  };
20187
- g("Space", "togglePaused", n.playPause), g("k", "togglePaused", n.playPause), g("ArrowLeft", "seekStep", n.seek, -n.seekStep), g("j", "seekStep", n.seek, -n.seekStep), g("ArrowRight", "seekStep", n.seek, n.seekStep), g("l", "seekStep", n.seek, n.seekStep), g("ArrowUp", "volumeStep", n.volume, Og), g("ArrowDown", "volumeStep", n.volume, -.05), g("m", "toggleMuted", n.volume), g("f", "toggleFullscreen", n.fullscreen), p && n.captions && a.push(Oi(r, {
20221
+ g("Space", "togglePaused", n.playPause), g("k", "togglePaused", n.playPause), g("ArrowLeft", "seekStep", n.seek, -n.seekStep), g("j", "seekStep", n.seek, -n.seekStep), g("ArrowRight", "seekStep", n.seek, n.seekStep), g("l", "seekStep", n.seek, n.seekStep), g("ArrowUp", "volumeStep", n.volume, Ag), g("ArrowDown", "volumeStep", n.volume, -.05), g("m", "toggleMuted", n.volume), g("f", "toggleFullscreen", n.fullscreen), p && n.captions && a.push(Oi(r, {
20188
20222
  action: "toggleSubtitles",
20189
20223
  keys: "c",
20190
20224
  repeatable: !1,
@@ -20227,7 +20261,7 @@ function kg({ disabled: e, layout: t, policy: n }) {
20227
20261
  s
20228
20262
  ]), null;
20229
20263
  }
20230
- function Ag(e, t, n, r, i = [], a = () => void 0, o) {
20264
+ function Mg(e, t, n, r, i = [], a = () => void 0, o) {
20231
20265
  if (t.startsWith("toggle")) {
20232
20266
  let n = e.state[t];
20233
20267
  if (typeof n == "function") {
@@ -20243,7 +20277,7 @@ function Ag(e, t, n, r, i = [], a = () => void 0, o) {
20243
20277
  } else if (t === "speedUp" || t === "speedDown") {
20244
20278
  let n = ai(e.state);
20245
20279
  if (!n) return;
20246
- let r = ip(i, n.playbackRate, t === "speedUp" ? "forward" : "backward");
20280
+ let r = ap(i, n.playbackRate, t === "speedUp" ? "forward" : "backward");
20247
20281
  r !== null && a(r);
20248
20282
  } else if (t === "seekToPercent") {
20249
20283
  let t = si(e.state), i = n ?? (r !== void 0 && r >= "0" && r <= "9" ? Number(r) * 10 : void 0);
@@ -20252,7 +20286,7 @@ function Ag(e, t, n, r, i = [], a = () => void 0, o) {
20252
20286
  }
20253
20287
  //#endregion
20254
20288
  //#region src/core/media-session.ts
20255
- var jg = [
20289
+ var Ng = [
20256
20290
  "play",
20257
20291
  "pause",
20258
20292
  "seekbackward",
@@ -20261,31 +20295,31 @@ var jg = [
20261
20295
  "previoustrack",
20262
20296
  "nexttrack"
20263
20297
  ];
20264
- function Mg() {
20298
+ function Pg() {
20265
20299
  return typeof navigator > "u" || !("mediaSession" in navigator) ? null : navigator.mediaSession;
20266
20300
  }
20267
- function Ng(e) {
20301
+ function Fg(e) {
20268
20302
  return e.configurationError || e.playback === "error";
20269
20303
  }
20270
- function Pg(e, t, n) {
20304
+ function Ig(e, t, n) {
20271
20305
  try {
20272
20306
  e.setActionHandler(t, n);
20273
20307
  } catch {}
20274
20308
  }
20275
- function Fg(e) {
20276
- for (let t of jg) Pg(e, t, null);
20309
+ function Lg(e) {
20310
+ for (let t of Ng) Ig(e, t, null);
20277
20311
  }
20278
- function Ig(e) {
20312
+ function Rg(e) {
20279
20313
  try {
20280
20314
  e.setPositionState();
20281
20315
  } catch {}
20282
20316
  }
20283
- function Lg(e, t) {
20317
+ function zg(e, t) {
20284
20318
  try {
20285
20319
  e.playbackState = t;
20286
20320
  } catch {}
20287
20321
  }
20288
- function Rg(e, t) {
20322
+ function Bg(e, t) {
20289
20323
  if (typeof MediaMetadata > "u") {
20290
20324
  try {
20291
20325
  e.metadata = null;
@@ -20307,9 +20341,9 @@ function Rg(e, t) {
20307
20341
  } catch {}
20308
20342
  }
20309
20343
  }
20310
- function zg(e, t) {
20344
+ function Vg(e, t) {
20311
20345
  if (!Number.isFinite(t.duration) || t.duration <= 0 || !Number.isFinite(t.currentTime) || !Number.isFinite(t.playbackRate) || t.playbackRate <= 0) {
20312
- Ig(e);
20346
+ Rg(e);
20313
20347
  return;
20314
20348
  }
20315
20349
  try {
@@ -20319,10 +20353,10 @@ function zg(e, t) {
20319
20353
  position: Math.min(t.duration, Math.max(0, t.currentTime))
20320
20354
  });
20321
20355
  } catch {
20322
- Ig(e);
20356
+ Rg(e);
20323
20357
  }
20324
20358
  }
20325
- var Bg = new class {
20359
+ var Hg = new class {
20326
20360
  #e = [];
20327
20361
  #t = null;
20328
20362
  #n = null;
@@ -20335,7 +20369,7 @@ var Bg = new class {
20335
20369
  commands: t,
20336
20370
  snapshot: e,
20337
20371
  activity: 0,
20338
- eligible: !Ng(e),
20372
+ eligible: !Fg(e),
20339
20373
  destroyed: !1
20340
20374
  };
20341
20375
  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), {
@@ -20349,7 +20383,7 @@ var Bg = new class {
20349
20383
  #o(e, t) {
20350
20384
  if (e.destroyed) return;
20351
20385
  let n = e.snapshot.playback === "playing", r = e.eligible;
20352
- if (e.snapshot = t, e.eligible = !Ng(t), e.eligible && t.playback === "playing" && (!n || !r)) {
20386
+ if (e.snapshot = t, e.eligible = !Fg(t), e.eligible && t.playback === "playing" && (!n || !r)) {
20353
20387
  this.#c(e);
20354
20388
  return;
20355
20389
  }
@@ -20373,37 +20407,37 @@ var Bg = new class {
20373
20407
  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);
20374
20408
  }
20375
20409
  #u(e) {
20376
- let t = Mg();
20410
+ let t = Pg();
20377
20411
  if (t === null) return;
20378
- let n = e.snapshot, r = this.#r, i = this.#n !== e, a = r === null || Ng(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;
20379
- if (o && Rg(t, n), s && Fg(t), !e.eligible) {
20380
- Ig(t), Lg(t, "none"), this.#n = e, this.#r = n;
20412
+ let n = e.snapshot, r = this.#r, i = this.#n !== e, a = r === null || Fg(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;
20413
+ if (o && Bg(t, n), s && Lg(t), !e.eligible) {
20414
+ Rg(t), zg(t, "none"), this.#n = e, this.#r = n;
20381
20415
  return;
20382
20416
  }
20383
- s && n.playPauseEnabled && (Pg(t, "play", () => e.commands.play()), Pg(t, "pause", () => e.commands.pause())), s && n.timelineEnabled && (Pg(t, "seekbackward", () => {
20417
+ s && n.playPauseEnabled && (Ig(t, "play", () => e.commands.play()), Ig(t, "pause", () => e.commands.pause())), s && n.timelineEnabled && (Ig(t, "seekbackward", () => {
20384
20418
  e.commands.seek(e.snapshot.currentTime - e.snapshot.seekStep);
20385
- }), Pg(t, "seekforward", () => {
20419
+ }), Ig(t, "seekforward", () => {
20386
20420
  e.commands.seek(e.snapshot.currentTime + e.snapshot.seekStep);
20387
- }), Pg(t, "seekto", (t) => {
20421
+ }), Ig(t, "seekto", (t) => {
20388
20422
  "seekTime" in t && typeof t.seekTime == "number" && Number.isFinite(t.seekTime) && e.commands.seek(t.seekTime);
20389
- })), s && e.commands.previousTrack !== void 0 && Pg(t, "previoustrack", e.commands.previousTrack), s && e.commands.nextTrack !== void 0 && Pg(t, "nexttrack", e.commands.nextTrack), Lg(t, n.paused ? "paused" : "playing"), zg(t, n), this.#n = e, this.#r = n;
20423
+ })), s && e.commands.previousTrack !== void 0 && Ig(t, "previoustrack", e.commands.previousTrack), s && e.commands.nextTrack !== void 0 && Ig(t, "nexttrack", e.commands.nextTrack), zg(t, n.paused ? "paused" : "playing"), Vg(t, n), this.#n = e, this.#r = n;
20390
20424
  }
20391
20425
  #d() {
20392
- let e = Mg();
20426
+ let e = Pg();
20393
20427
  if (e !== null) {
20394
- Fg(e), Ig(e), Lg(e, "none"), this.#n = null, this.#r = null;
20428
+ Lg(e), Rg(e), zg(e, "none"), this.#n = null, this.#r = null;
20395
20429
  try {
20396
20430
  e.metadata = null;
20397
20431
  } catch {}
20398
20432
  }
20399
20433
  }
20400
20434
  }();
20401
- function Vg(e, t) {
20402
- return Bg.create(e, t);
20435
+ function Ug(e, t) {
20436
+ return Hg.create(e, t);
20403
20437
  }
20404
20438
  //#endregion
20405
20439
  //#region src/core/state-presentations.tsx
20406
- function Hg({ kind: e, message: t, onRetry: n, retryLabel: r }) {
20440
+ function Wg({ kind: e, message: t, onRetry: n, retryLabel: r }) {
20407
20441
  return /* @__PURE__ */ (0, N.jsxs)("div", {
20408
20442
  className: e === "configuration" ? "ltp-state-error ltp-state-error--configuration ltp-configuration-error" : "ltp-state-error ltp-state-error--media",
20409
20443
  "data-ltp-error-presentation": e,
@@ -20419,15 +20453,15 @@ function Hg({ kind: e, message: t, onRetry: n, retryLabel: r }) {
20419
20453
  }) : null]
20420
20454
  });
20421
20455
  }
20422
- function Ug({ message: e }) {
20423
- return /* @__PURE__ */ (0, N.jsx)(Hg, {
20456
+ function Gg({ message: e }) {
20457
+ return /* @__PURE__ */ (0, N.jsx)(Wg, {
20424
20458
  kind: "configuration",
20425
20459
  message: e
20426
20460
  });
20427
20461
  }
20428
- function Wg() {
20429
- let e = sg(), t = og(), n = qd("mediaErrorMessage"), r = qd("retry");
20430
- return e.playback !== "error" || e.errorKind !== "media" ? null : /* @__PURE__ */ (0, N.jsx)(Hg, {
20462
+ function Kg() {
20463
+ let e = lg(), t = cg(), n = qd("mediaErrorMessage"), r = qd("retry");
20464
+ return e.playback !== "error" || e.errorKind !== "media" ? null : /* @__PURE__ */ (0, N.jsx)(Wg, {
20431
20465
  kind: "media",
20432
20466
  message: n,
20433
20467
  onRetry: e.retryable ? () => t.retryMediaError() : void 0,
@@ -20436,12 +20470,12 @@ function Wg() {
20436
20470
  }
20437
20471
  //#endregion
20438
20472
  //#region src/core/adaptive-video.tsx
20439
- var Gg = "application/vnd.apple.mpegurl", Kg = /* @__PURE__ */ new Set(["application/x-mpegurl", Gg]), qg = Object.freeze({
20473
+ var qg = "application/vnd.apple.mpegurl", Jg = /* @__PURE__ */ new Set(["application/x-mpegurl", qg]), Yg = Object.freeze({
20440
20474
  enableWebVTT: !1,
20441
20475
  enableCEA708Captions: !1,
20442
20476
  renderTextTracksNatively: !1
20443
20477
  });
20444
- function Jg() {
20478
+ function Xg() {
20445
20479
  let e = !1, t = null;
20446
20480
  return {
20447
20481
  begin() {
@@ -20475,11 +20509,11 @@ function Jg() {
20475
20509
  }
20476
20510
  };
20477
20511
  }
20478
- function Yg(e) {
20479
- return e !== void 0 && Kg.has(e.toLowerCase());
20512
+ function Zg(e) {
20513
+ return e !== void 0 && Jg.has(e.toLowerCase());
20480
20514
  }
20481
- function Xg(e) {
20482
- return e.findIndex((e) => Yg(e.type)) === 0 ? {
20515
+ function Qg(e) {
20516
+ return e.findIndex((e) => Zg(e.type)) === 0 ? {
20483
20517
  kind: "hls",
20484
20518
  source: e[0]
20485
20519
  } : {
@@ -20487,21 +20521,21 @@ function Xg(e) {
20487
20521
  sources: e
20488
20522
  };
20489
20523
  }
20490
- function Zg(e, t) {
20524
+ function $g(e, t) {
20491
20525
  return e.src === t.src && e.type === t.type;
20492
20526
  }
20493
- function Qg(e, t) {
20494
- return e.kind === t.kind ? e.kind === "hls" && t.kind === "hls" ? Zg(e.source, t.source) : e.kind !== "native" || t.kind !== "native" ? !1 : e.sources.length === t.sources.length && e.sources.every((e, n) => Zg(e, t.sources[n])) : !1;
20527
+ function e_(e, t) {
20528
+ return e.kind === t.kind ? e.kind === "hls" && t.kind === "hls" ? $g(e.source, t.source) : e.kind !== "native" || t.kind !== "native" ? !1 : e.sources.length === t.sources.length && e.sources.every((e, n) => $g(e, t.sources[n])) : !1;
20495
20529
  }
20496
- function $g(e) {
20497
- let t = (0, w.useRef)(Xg(e)), n = Xg(e);
20498
- return Qg(t.current, n) || (t.current = n), t.current;
20530
+ function t_(e) {
20531
+ let t = (0, w.useRef)(Qg(e)), n = Qg(e);
20532
+ return e_(t.current, n) || (t.current = n), t.current;
20499
20533
  }
20500
- function e_() {
20501
- return typeof document > "u" || typeof navigator > "u" || !/apple/i.test(navigator.vendor) ? !1 : document.createElement("video").canPlayType(Gg) !== "";
20534
+ function n_() {
20535
+ return typeof document > "u" || typeof navigator > "u" || !/apple/i.test(navigator.vendor) ? !1 : document.createElement("video").canPlayType(qg) !== "";
20502
20536
  }
20503
- function t_({ children: e, intentQueue: t, mediaRef: n, sources: r, ...i }) {
20504
- let a = Ht(), o = (0, w.useRef)(null), s = (0, w.useRef)(null), c = (0, w.useRef)(null), l = (0, w.useRef)(0), u = $g(r), d = u.kind === "hls" && e_(), f = u.kind === "hls" && !d, p = (0, w.useCallback)((e) => {
20537
+ function r_({ children: e, intentQueue: t, mediaRef: n, sources: r, ...i }) {
20538
+ let a = Ht(), o = (0, w.useRef)(null), s = (0, w.useRef)(null), c = (0, w.useRef)(null), l = (0, w.useRef)(0), u = t_(r), d = u.kind === "hls" && n_(), f = u.kind === "hls" && !d, p = (0, w.useCallback)((e) => {
20505
20539
  if (o.current = e, e === null) {
20506
20540
  a?.(null);
20507
20541
  return;
@@ -20524,9 +20558,9 @@ function t_({ children: e, intentQueue: t, mediaRef: n, sources: r, ...i }) {
20524
20558
  let d = s.current ?? new o();
20525
20559
  s.current = d, c.current !== d && (d.attach(e), c.current = d), d.preload = i.preload === "" || i.preload === "none" || i.preload === "auto" || i.preload === "metadata" ? i.preload : "metadata", a?.(d), d.source = {
20526
20560
  src: u.source.src,
20527
- type: Gg,
20561
+ type: qg,
20528
20562
  preferPlayback: "mse",
20529
- engine: { hlsJs: qg }
20563
+ engine: { hlsJs: Yg }
20530
20564
  }, queueMicrotask(() => {
20531
20565
  !r && n === l.current && t?.finish(d);
20532
20566
  });
@@ -20558,18 +20592,18 @@ function t_({ children: e, intentQueue: t, mediaRef: n, sources: r, ...i }) {
20558
20592
  }
20559
20593
  //#endregion
20560
20594
  //#region src/core/media-engine.tsx
20561
- function n_(e) {
20595
+ function i_(e) {
20562
20596
  return !e || typeof navigator < "u" && /\bFirefox\//u.test(navigator.userAgent);
20563
20597
  }
20564
- function r_(...e) {
20598
+ function a_(...e) {
20565
20599
  return e;
20566
20600
  }
20567
- var { Player: i_, usePlayer: a_ } = yc({
20568
- features: r_(fr, mr, Mr, Ar, xr, Cn, er, ji, dr, Bn, Or, Hn, ur),
20601
+ var { Player: o_, usePlayer: s_ } = yc({
20602
+ features: a_(fr, mr, Mr, Ar, xr, Cn, er, ji, dr, Bn, Or, Hn, ur),
20569
20603
  displayName: "LTMediaEnginePlayer"
20570
- }), o_ = P(fr), s_ = P(xr), c_ = P(Hn), l_ = P(Ar), u_ = P(Mr), d_ = P(mr), f_ = P(Or), p_ = P(dr), m_ = P(Bn), h_ = P(ur);
20571
- function g_(e) {
20572
- let t = o_(e), n = s_(e), r = c_(e), i = l_(e);
20604
+ }), c_ = P(fr), l_ = P(xr), u_ = P(Hn), d_ = P(Ar), f_ = P(Mr), p_ = P(mr), m_ = P(Or), h_ = P(dr), g_ = P(Bn), __ = P(ur);
20605
+ function v_(e) {
20606
+ let t = c_(e), n = l_(e), r = u_(e), i = d_(e);
20573
20607
  if (t === void 0 || n === void 0 || r === void 0 || i === void 0) throw Error("The LT media engine state features are not configured");
20574
20608
  return {
20575
20609
  paused: t.paused,
@@ -20582,10 +20616,10 @@ function g_(e) {
20582
20616
  currentTime: i.currentTime
20583
20617
  };
20584
20618
  }
20585
- function __({ children: e, mediaRef: t, userStateSession: n }) {
20586
- let r = a_(), i = Et((e) => r.subscribe(e), () => r.state, g_), a = (0, w.useCallback)((e, t) => {
20619
+ function y_({ children: e, mediaRef: t, userStateSession: n }) {
20620
+ let r = s_(), i = Et((e) => r.subscribe(e), () => r.state, v_), a = (0, w.useCallback)((e, t) => {
20587
20621
  if (e.source === null) return Promise.reject(/* @__PURE__ */ Error("Cannot recover media without a selected source"));
20588
- let n = r.state, i = c_(n), a = s_(n);
20622
+ let n = r.state, i = u_(n), a = l_(n);
20589
20623
  return i === void 0 || a === void 0 ? Promise.reject(/* @__PURE__ */ Error("The LT media recovery features are not configured")) : (i.dismissError(), a.loadSource(e.source), new Promise((n, i) => {
20590
20624
  let a = !1, o = !1, s = !1, c = () => void 0, l = (e) => {
20591
20625
  s || (s = !0, c(), t.removeEventListener("abort", u), e === void 0 ? n() : i(e));
@@ -20594,7 +20628,7 @@ function __({ children: e, mediaRef: t, userStateSession: n }) {
20594
20628
  u();
20595
20629
  return;
20596
20630
  }
20597
- let n = r.state, i = o_(n), s = s_(n), c = c_(n), f = l_(n);
20631
+ let n = r.state, i = c_(n), s = l_(n), c = u_(n), f = d_(n);
20598
20632
  if (i === void 0 || s === void 0 || c === void 0 || f === void 0) {
20599
20633
  l(/* @__PURE__ */ Error("The LT media recovery features are not configured"));
20600
20634
  return;
@@ -20613,9 +20647,9 @@ function __({ children: e, mediaRef: t, userStateSession: n }) {
20613
20647
  };
20614
20648
  c = r.subscribe(d), t.addEventListener("abort", u, { once: !0 }), d();
20615
20649
  }));
20616
- }, [r]), o = (0, w.useCallback)(() => rg({ recoverMedia: a }), [a]), s = (0, w.useMemo)(() => ({
20650
+ }, [r]), o = (0, w.useCallback)(() => ag({ recoverMedia: a }), [a]), s = (0, w.useMemo)(() => ({
20617
20651
  getSnapshot: () => {
20618
- let e = r.state, n = u_(e), i = d_(e), a = s_(e), o = f_(e);
20652
+ let e = r.state, n = f_(e), i = p_(e), a = l_(e), o = m_(e);
20619
20653
  if (n === void 0 || i === void 0 || a === void 0 || o === void 0) throw Error("The LT user-state media features are not configured");
20620
20654
  return {
20621
20655
  attached: !!r.target,
@@ -20624,7 +20658,7 @@ function __({ children: e, mediaRef: t, userStateSession: n }) {
20624
20658
  muted: n.muted,
20625
20659
  playbackRate: i.playbackRate,
20626
20660
  canPlay: a.canPlay,
20627
- textTracks: Mf(t?.current ?? null).map((e) => ({
20661
+ textTracks: Nf(t?.current ?? null).map((e) => ({
20628
20662
  id: e.id,
20629
20663
  kind: e.kind,
20630
20664
  label: e.label,
@@ -20635,7 +20669,7 @@ function __({ children: e, mediaRef: t, userStateSession: n }) {
20635
20669
  },
20636
20670
  subscribe: (e) => r.subscribe(e),
20637
20671
  setVolume(e) {
20638
- u_(r.state)?.setVolume(e);
20672
+ f_(r.state)?.setVolume(e);
20639
20673
  },
20640
20674
  setMuted(e) {
20641
20675
  let n = t?.current;
@@ -20643,19 +20677,19 @@ function __({ children: e, mediaRef: t, userStateSession: n }) {
20643
20677
  n.muted !== e && (n.muted = e);
20644
20678
  return;
20645
20679
  }
20646
- let i = u_(r.state);
20680
+ let i = f_(r.state);
20647
20681
  i !== void 0 && i.muted !== e && i.toggleMuted();
20648
20682
  },
20649
20683
  setPlaybackRate(e) {
20650
- d_(r.state)?.setPlaybackRate(e);
20684
+ p_(r.state)?.setPlaybackRate(e);
20651
20685
  },
20652
20686
  selectSubtitlesTrack(e) {
20653
- if (f_(r.state)?.selectSubtitlesTrack(e), e === "off") return;
20654
- let n = Mf(t?.current ?? null).find((t) => t.id === e);
20687
+ if (m_(r.state)?.selectSubtitlesTrack(e), e === "off") return;
20688
+ let n = Nf(t?.current ?? null).find((t) => t.id === e);
20655
20689
  n !== void 0 && (n.mode = "hidden");
20656
20690
  }
20657
- }), [t, r]), c = (0, w.useCallback)((e) => qh(s, e), [s]), l = (0, w.useRef)(null), u = (0, w.useRef)(null), d = (0, w.useRef)(null), f = (0, w.useRef)(i), [, p] = (0, w.useState)(0);
20658
- f.current = i, l.current === null && (l.current = o()), d.current ??= n ?? Gh(), u.current ??= c(d.current);
20691
+ }), [t, r]), c = (0, w.useCallback)((e) => Yh(s, e), [s]), l = (0, w.useRef)(null), u = (0, w.useRef)(null), d = (0, w.useRef)(null), f = (0, w.useRef)(i), [, p] = (0, w.useState)(0);
20692
+ f.current = i, l.current === null && (l.current = o()), d.current ??= n ?? qh(), u.current ??= c(d.current);
20659
20693
  let m = l.current, h = u.current;
20660
20694
  return (0, w.useEffect)(() => {
20661
20695
  let e = l.current;
@@ -20666,29 +20700,29 @@ function __({ children: e, mediaRef: t, userStateSession: n }) {
20666
20700
  }, [i]), (0, w.useEffect)(() => {
20667
20701
  let e = u.current;
20668
20702
  if (e === null || e.isDestroyed()) {
20669
- let t = d.current ?? Gh();
20703
+ let t = d.current ?? qh();
20670
20704
  d.current = t, e = c(t), u.current = e, p((e) => e + 1);
20671
20705
  }
20672
20706
  return e.start(), () => e.destroy();
20673
- }, [c]), /* @__PURE__ */ (0, N.jsx)(ag, {
20707
+ }, [c]), /* @__PURE__ */ (0, N.jsx)(sg, {
20674
20708
  controller: m,
20675
- children: /* @__PURE__ */ (0, N.jsx)(If, {
20709
+ children: /* @__PURE__ */ (0, N.jsx)(Lf, {
20676
20710
  controller: h,
20677
20711
  children: e
20678
20712
  })
20679
20713
  });
20680
20714
  }
20681
- function v_({ children: e, mediaRef: t, orientationLockType: n, poster: r, stringCatalog: i = vh, title: a, userStateSession: o }) {
20715
+ function b_({ children: e, mediaRef: t, orientationLockType: n, poster: r, stringCatalog: i = bh, title: a, userStateSession: o }) {
20682
20716
  return /* @__PURE__ */ (0, N.jsx)(Wd, {
20683
20717
  value: i,
20684
- children: /* @__PURE__ */ (0, N.jsx)(dh, {
20718
+ children: /* @__PURE__ */ (0, N.jsx)(ph, {
20685
20719
  language: i.selectedLanguage,
20686
20720
  strings: i.strings,
20687
- children: /* @__PURE__ */ (0, N.jsx)(i_, {
20721
+ children: /* @__PURE__ */ (0, N.jsx)(o_, {
20688
20722
  orientationLockType: n,
20689
20723
  poster: r,
20690
20724
  title: a,
20691
- children: /* @__PURE__ */ (0, N.jsx)(__, {
20725
+ children: /* @__PURE__ */ (0, N.jsx)(y_, {
20692
20726
  mediaRef: t,
20693
20727
  userStateSession: o,
20694
20728
  children: e
@@ -20697,10 +20731,10 @@ function v_({ children: e, mediaRef: t, orientationLockType: n, poster: r, strin
20697
20731
  })
20698
20732
  });
20699
20733
  }
20700
- function y_(e, t) {
20701
- let n = l_(e), r = u_(e), i = d_(e), a = f_(e), o = p_(e);
20734
+ function x_(e, t) {
20735
+ let n = d_(e), r = f_(e), i = p_(e), a = m_(e), o = h_(e);
20702
20736
  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");
20703
- let s = Mf(t).find((e) => Rf(e.kind) && zf(e.mode));
20737
+ let s = Nf(t).find((e) => zf(e.kind) && Bf(e.mode));
20704
20738
  return Object.freeze({
20705
20739
  currentTime: n.currentTime,
20706
20740
  duration: n.duration,
@@ -20714,8 +20748,8 @@ function y_(e, t) {
20714
20748
  pip: o.pip
20715
20749
  });
20716
20750
  }
20717
- function b_({ application: e, intentQueue: t, mediaRef: n, runtime: r }) {
20718
- let i = a_(), a = og(), o = Lf(), s = (0, w.useMemo)(() => ({
20751
+ function S_({ application: e, intentQueue: t, mediaRef: n, runtime: r }) {
20752
+ let i = s_(), a = cg(), o = Rf(), s = (0, w.useMemo)(() => ({
20719
20753
  get media() {
20720
20754
  let e = n.current;
20721
20755
  if (e === null) throw Error("The LT media element is not attached");
@@ -20723,16 +20757,16 @@ function b_({ application: e, intentQueue: t, mediaRef: n, runtime: r }) {
20723
20757
  },
20724
20758
  playerState: a,
20725
20759
  userState: o,
20726
- getSnapshot: () => y_(i.state, n.current),
20760
+ getSnapshot: () => x_(i.state, n.current),
20727
20761
  subscribe: (e) => i.subscribe(e),
20728
20762
  play() {
20729
- t.play(() => o_(i.state)?.play().catch(() => void 0));
20763
+ t.play(() => c_(i.state)?.play().catch(() => void 0));
20730
20764
  },
20731
20765
  pause() {
20732
- t.pause(() => o_(i.state)?.pause());
20766
+ t.pause(() => c_(i.state)?.pause());
20733
20767
  },
20734
20768
  seek(e) {
20735
- l_(i.state)?.seek(e).catch(() => void 0);
20769
+ d_(i.state)?.seek(e).catch(() => void 0);
20736
20770
  },
20737
20771
  load() {
20738
20772
  n.current?.load();
@@ -20752,14 +20786,14 @@ function b_({ application: e, intentQueue: t, mediaRef: n, runtime: r }) {
20752
20786
  r
20753
20787
  ]), null;
20754
20788
  }
20755
- function x_({ application: e, visible: t }) {
20756
- let n = a_(), { playback: r } = sg(), i = qd("coverButton"), { config: a } = e, o = a.controls.cover, s = (0, w.useCallback)(() => {
20757
- let e = o_(n.state);
20789
+ function C_({ application: e, visible: t }) {
20790
+ let n = s_(), { playback: r } = lg(), i = qd("coverButton"), { config: a } = e, o = a.controls.cover, s = (0, w.useCallback)(() => {
20791
+ let e = c_(n.state);
20758
20792
  return e === void 0 ? Promise.reject(/* @__PURE__ */ Error("The LT media playback feature is not configured")) : e.play();
20759
20793
  }, [n]);
20760
20794
  if (!o.enabled) return null;
20761
20795
  let c = o.button.label;
20762
- return /* @__PURE__ */ (0, N.jsx)(dg, {
20796
+ return /* @__PURE__ */ (0, N.jsx)(pg, {
20763
20797
  author: o.author ? a.content.author : void 0,
20764
20798
  buttonEnabled: o.button.enabled,
20765
20799
  buttonLabel: c ?? i,
@@ -20773,7 +20807,7 @@ function x_({ application: e, visible: t }) {
20773
20807
  visibleButtonLabel: c
20774
20808
  });
20775
20809
  }
20776
- function S_({ application: e, runtime: t }) {
20810
+ function w_({ application: e, runtime: t }) {
20777
20811
  let { config: n, strings: r } = e;
20778
20812
  if (e.initialError) {
20779
20813
  let e = n.layout === "landscape" ? "ltp-landscape" : "ltp-portrait";
@@ -20782,36 +20816,36 @@ function S_({ application: e, runtime: t }) {
20782
20816
  "data-ltp-configuration-error": !0,
20783
20817
  "data-ltp-layout": n.layout,
20784
20818
  lang: r.selectedLanguage,
20785
- children: [/* @__PURE__ */ (0, N.jsx)(Cd, {}), /* @__PURE__ */ (0, N.jsx)(Ug, { message: r.strings.configErrorMessage })]
20819
+ children: [/* @__PURE__ */ (0, N.jsx)(Cd, {}), /* @__PURE__ */ (0, N.jsx)(Gg, { message: r.strings.configErrorMessage })]
20786
20820
  });
20787
20821
  }
20788
- return /* @__PURE__ */ (0, N.jsx)(C_, {
20822
+ return /* @__PURE__ */ (0, N.jsx)(T_, {
20789
20823
  application: e,
20790
20824
  runtime: t
20791
20825
  });
20792
20826
  }
20793
- function C_({ application: e, runtime: t }) {
20827
+ function T_({ application: e, runtime: t }) {
20794
20828
  let n = (0, w.useRef)(null), [r, i] = (0, w.useState)(null), a = (0, w.useRef)(null), o = (0, w.useRef)(null);
20795
- a.current ??= Jg();
20829
+ a.current ??= Xg();
20796
20830
  let s = a.current, c = (0, w.useCallback)((e) => {
20797
20831
  n.current = e, i(e), e !== null && t.prepareMedia(e);
20798
20832
  }, [t]), { config: l, strings: u } = e;
20799
20833
  o.current !== e.generation && (o.current = e.generation, s.begin());
20800
- let d = /* @__PURE__ */ (0, N.jsx)(t_, {
20834
+ let d = /* @__PURE__ */ (0, N.jsx)(r_, {
20801
20835
  mediaRef: c,
20802
20836
  "aria-label": l.content.title,
20803
20837
  className: "ltp-media-engine__video",
20804
20838
  crossOrigin: "anonymous",
20805
- disablePictureInPicture: n_(l.controls.pip.enabled),
20839
+ disablePictureInPicture: i_(l.controls.pip.enabled),
20806
20840
  intentQueue: s,
20807
20841
  playsInline: !0,
20808
20842
  preload: "metadata",
20809
20843
  sources: l.content.sources,
20810
- children: l.content.tracks.map((t, n) => /* @__PURE__ */ (0, N.jsx)(Zf, {
20844
+ children: l.content.tracks.map((t, n) => /* @__PURE__ */ (0, N.jsx)(Qf, {
20811
20845
  index: n,
20812
20846
  track: t
20813
20847
  }, `${e.generation}:${t.src}:${t.kind ?? ""}:${n}`))
20814
- }), f = e.configurationError ? /* @__PURE__ */ (0, N.jsx)(Ug, { message: u.strings.configErrorMessage }) : void 0, p = /* @__PURE__ */ (0, N.jsx)(b_, {
20848
+ }), f = e.configurationError ? /* @__PURE__ */ (0, N.jsx)(Gg, { message: u.strings.configErrorMessage }) : void 0, p = /* @__PURE__ */ (0, N.jsx)(S_, {
20815
20849
  application: e,
20816
20850
  intentQueue: s,
20817
20851
  mediaRef: n,
@@ -20819,19 +20853,19 @@ function C_({ application: e, runtime: t }) {
20819
20853
  });
20820
20854
  return /* @__PURE__ */ (0, N.jsx)(dd, {
20821
20855
  value: l,
20822
- children: /* @__PURE__ */ (0, N.jsx)(qm, {
20856
+ children: /* @__PURE__ */ (0, N.jsx)(Ym, {
20823
20857
  registry: e.registry,
20824
- children: /* @__PURE__ */ (0, N.jsx)(v_, {
20858
+ children: /* @__PURE__ */ (0, N.jsx)(b_, {
20825
20859
  mediaRef: n,
20826
20860
  orientationLockType: l.layout,
20827
20861
  poster: l.content.poster ?? null,
20828
20862
  stringCatalog: u,
20829
20863
  title: l.content.title ?? null,
20830
20864
  userStateSession: t.userStateSession,
20831
- children: /* @__PURE__ */ (0, N.jsx)(Xf, {
20865
+ children: /* @__PURE__ */ (0, N.jsx)(Zf, {
20832
20866
  generation: e.generation,
20833
20867
  media: r,
20834
- children: /* @__PURE__ */ (0, N.jsx)(D_, {
20868
+ children: /* @__PURE__ */ (0, N.jsx)(k_, {
20835
20869
  application: e,
20836
20870
  configurationError: f,
20837
20871
  media: d,
@@ -20842,17 +20876,17 @@ function C_({ application: e, runtime: t }) {
20842
20876
  })
20843
20877
  });
20844
20878
  }
20845
- function w_(e) {
20846
- let t = T_(e), n = l_(e);
20879
+ function E_(e) {
20880
+ let t = D_(e), n = d_(e);
20847
20881
  if (t === void 0 || n === void 0) throw Error("The LT core control media features are not configured");
20848
20882
  return {
20849
20883
  buffered: t.buffered,
20850
20884
  duration: n.duration
20851
20885
  };
20852
20886
  }
20853
- var T_ = P(Cn);
20854
- function E_(e) {
20855
- let t = m_(e);
20887
+ var D_ = P(Cn);
20888
+ function O_(e) {
20889
+ let t = g_(e);
20856
20890
  if (t === void 0) throw Error("The LT control visibility media feature is not configured");
20857
20891
  return {
20858
20892
  controlsVisible: t.controlsVisible,
@@ -20860,8 +20894,8 @@ function E_(e) {
20860
20894
  userActive: t.userActive
20861
20895
  };
20862
20896
  }
20863
- function D_({ application: e, configurationError: t, media: n, runtimeBridge: r }) {
20864
- let i = a_(), { playback: a } = sg(), { config: o } = e, s = Et((e) => i.subscribe(e), () => i.state, E_), c = (0, w.useRef)(null), l = (0, w.useRef)({
20897
+ function k_({ application: e, configurationError: t, media: n, runtimeBridge: r }) {
20898
+ let i = s_(), { playback: a } = lg(), { config: o } = e, s = Et((e) => i.subscribe(e), () => i.state, O_), c = (0, w.useRef)(null), l = (0, w.useRef)({
20865
20899
  configurationError: t !== void 0,
20866
20900
  engine: s,
20867
20901
  generation: e.generation,
@@ -20874,11 +20908,11 @@ function D_({ application: e, configurationError: t, media: n, runtimeBridge: r
20874
20908
  generation: e.generation,
20875
20909
  layout: o.layout,
20876
20910
  playback: a
20877
- }, c.current === null && (c.current = _g());
20911
+ }, c.current === null && (c.current = yg());
20878
20912
  let d = c.current;
20879
20913
  return (0, w.useEffect)(() => {
20880
20914
  let e = c.current;
20881
- return (e === null || e.isDestroyed()) && (e = _g(), c.current = e, u((e) => e + 1)), e.apply(l.current), () => e.destroy();
20915
+ return (e === null || e.isDestroyed()) && (e = yg(), c.current = e, u((e) => e + 1)), e.apply(l.current), () => e.destroy();
20882
20916
  }, []), (0, w.useLayoutEffect)(() => {
20883
20917
  let e = c.current;
20884
20918
  e !== null && !e.isDestroyed() && e.apply(l.current);
@@ -20888,9 +20922,9 @@ function D_({ application: e, configurationError: t, media: n, runtimeBridge: r
20888
20922
  t,
20889
20923
  s,
20890
20924
  a
20891
- ]), /* @__PURE__ */ (0, N.jsx)(yg, {
20925
+ ]), /* @__PURE__ */ (0, N.jsx)(xg, {
20892
20926
  controller: d,
20893
- children: /* @__PURE__ */ (0, N.jsx)(j_, {
20927
+ children: /* @__PURE__ */ (0, N.jsx)(N_, {
20894
20928
  application: e,
20895
20929
  configurationError: t,
20896
20930
  media: n,
@@ -20898,12 +20932,12 @@ function D_({ application: e, configurationError: t, media: n, runtimeBridge: r
20898
20932
  })
20899
20933
  });
20900
20934
  }
20901
- function O_() {
20902
- let e = Jm().getModule("share"), t = (0, w.useSyncExternalStore)(e.subscribeInteraction, e.getInteractionSnapshot, e.getInteractionSnapshot).open;
20903
- return Sg(t), null;
20935
+ function A_() {
20936
+ let e = Xm().getModule("share"), t = (0, w.useSyncExternalStore)(e.subscribeInteraction, e.getInteractionSnapshot, e.getInteractionSnapshot).open;
20937
+ return wg(t), null;
20904
20938
  }
20905
- function k_(e) {
20906
- let t = h_(e), n = o_(e), r = d_(e), i = l_(e);
20939
+ function j_(e) {
20940
+ let t = __(e), n = c_(e), r = p_(e), i = d_(e);
20907
20941
  if (t === void 0 || n === void 0 || r === void 0 || i === void 0) throw Error("The LT Media Session features are not configured");
20908
20942
  return {
20909
20943
  currentTime: i.currentTime,
@@ -20914,16 +20948,16 @@ function k_(e) {
20914
20948
  title: t.title
20915
20949
  };
20916
20950
  }
20917
- function A_({ application: e }) {
20918
- let t = a_(), n = sg(), r = Et((e) => t.subscribe(e), () => t.state, k_), i = (0, w.useMemo)(() => ({
20951
+ function M_({ application: e }) {
20952
+ let t = s_(), n = lg(), r = Et((e) => t.subscribe(e), () => t.state, j_), i = (0, w.useMemo)(() => ({
20919
20953
  play() {
20920
- o_(t.state)?.play().catch(() => void 0);
20954
+ c_(t.state)?.play().catch(() => void 0);
20921
20955
  },
20922
20956
  pause() {
20923
- o_(t.state)?.pause();
20957
+ c_(t.state)?.pause();
20924
20958
  },
20925
20959
  seek(e) {
20926
- l_(t.state)?.seek(e).catch(() => void 0);
20960
+ d_(t.state)?.seek(e).catch(() => void 0);
20927
20961
  },
20928
20962
  ...e.mediaSessionTrackCommands === void 0 ? {} : {
20929
20963
  previousTrack: e.mediaSessionTrackCommands.previousTrack,
@@ -20944,14 +20978,14 @@ function A_({ application: e }) {
20944
20978
  configurationError: e.configurationError
20945
20979
  }, o = (0, w.useRef)(a), s = (0, w.useRef)(null);
20946
20980
  return o.current = a, (0, w.useLayoutEffect)(() => {
20947
- let e = Vg(o.current, i);
20981
+ let e = Ug(o.current, i);
20948
20982
  return s.current = e, () => {
20949
20983
  e.destroy(), s.current === e && (s.current = null);
20950
20984
  };
20951
20985
  }, [i]), (0, w.useLayoutEffect)(() => s.current?.update(a), [a]), null;
20952
20986
  }
20953
- function j_({ application: e, configurationError: t, media: n, runtimeBridge: r }) {
20954
- let i = a_(), a = sg(), { playback: o } = a, { config: s, strings: c } = e, l = xg(), u = Ym(), d = Jm().getModule("share"), f = Jm().getModule("contextPanel"), p = qf(), m = Et((e) => i.subscribe(e), () => i.state, w_), h = p.available ? u.capabilities.captions.state : "dormant", g = u.capabilities.speed.state, _ = (0, w.useMemo)(() => Jd(s, {
20987
+ function N_({ application: e, configurationError: t, media: n, runtimeBridge: r }) {
20988
+ let i = s_(), a = lg(), { playback: o } = a, { config: s, strings: c } = e, l = Cg(), u = Zm(), d = Xm().getModule("share"), f = Xm().getModule("contextPanel"), p = Jf(), m = Et((e) => i.subscribe(e), () => i.state, E_), h = p.available ? u.capabilities.captions.state : "dormant", g = u.capabilities.speed.state, _ = (0, w.useMemo)(() => Jd(s, {
20955
20989
  captions: h,
20956
20990
  speed: g
20957
20991
  }), [
@@ -20959,33 +20993,34 @@ function j_({ application: e, configurationError: t, media: n, runtimeBridge: r
20959
20993
  s,
20960
20994
  g
20961
20995
  ]), v = t !== void 0 || o === "error", y = (0, w.useCallback)((e) => {
20962
- l_(i.state)?.seek(e).catch(() => void 0);
20963
- }, [i]), b = Dg(_.gestures && !v), x = t === void 0 && a.playback === "error" && a.errorKind === "media" ? /* @__PURE__ */ (0, N.jsx)(Wg, {}) : void 0, { chromeVisible: S, coverVisible: C } = ug(o, e.generation, s.controls.cover.enabled), T = {
20996
+ d_(i.state)?.seek(e).catch(() => void 0);
20997
+ }, [i]), b = kg(_.gestures && !v), x = t === void 0 && a.playback === "error" && a.errorKind === "media" ? /* @__PURE__ */ (0, N.jsx)(Kg, {}) : void 0, { chromeVisible: S, coverVisible: C } = fg(o, e.generation, s.controls.cover.enabled), T = {
20998
+ cover: s.controls.cover.enabled && C ? /* @__PURE__ */ (0, N.jsx)(C_, {
20999
+ application: e,
21000
+ visible: C
21001
+ }, e.generation) : void 0,
21002
+ logo: S && s.controls.logo.enabled ? /* @__PURE__ */ (0, N.jsx)(rf, {}) : void 0,
21003
+ playPause: S && s.controls.playPause.enabled ? /* @__PURE__ */ (0, N.jsx)(Xd, {}) : void 0,
21004
+ volume: S && s.controls.volume.enabled ? /* @__PURE__ */ (0, N.jsx)(tf, { layout: s.layout }) : void 0,
21005
+ time: S && s.controls.time.enabled ? /* @__PURE__ */ (0, N.jsx)(ef, {}) : void 0,
21006
+ timeline: S && s.controls.timeline.enabled ? /* @__PURE__ */ (0, N.jsx)($d, {
21007
+ buffered: m.buffered,
21008
+ duration: m.duration,
21009
+ seekStep: s.controls.timeline.seekStep
21010
+ }) : void 0,
21011
+ information: S && s.layout === "portrait" && (s.content.author !== void 0 || s.content.title !== void 0) ? /* @__PURE__ */ (0, N.jsx)(ug, {
21012
+ author: s.content.author,
21013
+ hidden: p.selectedTrack !== null,
21014
+ surface: "playback",
21015
+ title: s.content.title
21016
+ }) : void 0,
21017
+ fullscreen: S && s.layout === "landscape" && s.controls.fullscreen.enabled ? /* @__PURE__ */ (0, N.jsx)(nf, {}) : void 0,
21018
+ buffering: s.controls.buffering.enabled ? /* @__PURE__ */ (0, N.jsx)(af, { playback: o }) : void 0,
21019
+ inputFeedback: S && s.controls.inputFeedback.enabled ? /* @__PURE__ */ (0, N.jsx)(cf, {}) : void 0
21020
+ }, E = {
21021
+ announcer: /* @__PURE__ */ (0, N.jsx)(sf, { captions: p.announcement }),
20964
21022
  configurationError: t,
20965
- core: {
20966
- cover: s.controls.cover.enabled && C ? /* @__PURE__ */ (0, N.jsx)(x_, {
20967
- application: e,
20968
- visible: C
20969
- }, e.generation) : void 0,
20970
- logo: S && s.controls.logo.enabled ? /* @__PURE__ */ (0, N.jsx)(rf, {}) : void 0,
20971
- playPause: S && s.controls.playPause.enabled ? /* @__PURE__ */ (0, N.jsx)(Xd, {}) : void 0,
20972
- volume: S && s.controls.volume.enabled ? /* @__PURE__ */ (0, N.jsx)(tf, { layout: s.layout }) : void 0,
20973
- time: S && s.controls.time.enabled ? /* @__PURE__ */ (0, N.jsx)(ef, {}) : void 0,
20974
- timeline: S && s.controls.timeline.enabled ? /* @__PURE__ */ (0, N.jsx)($d, {
20975
- buffered: m.buffered,
20976
- duration: m.duration,
20977
- seekStep: s.controls.timeline.seekStep
20978
- }) : void 0,
20979
- information: S && s.layout === "portrait" && (s.content.author !== void 0 || s.content.title !== void 0) ? /* @__PURE__ */ (0, N.jsx)(cg, {
20980
- author: s.content.author,
20981
- hidden: p.selectedTrack !== null,
20982
- surface: "playback",
20983
- title: s.content.title
20984
- }) : void 0,
20985
- fullscreen: S && s.layout === "landscape" && s.controls.fullscreen.enabled ? /* @__PURE__ */ (0, N.jsx)(nf, {}) : void 0,
20986
- buffering: s.controls.buffering.enabled ? /* @__PURE__ */ (0, N.jsx)(af, { playback: o }) : void 0,
20987
- inputFeedback: S && s.controls.inputFeedback.enabled ? /* @__PURE__ */ (0, N.jsx)(sf, {}) : void 0
20988
- },
21023
+ core: T,
20989
21024
  inputPolicy: _,
20990
21025
  language: c.selectedLanguage,
20991
21026
  media: n,
@@ -20993,27 +21028,27 @@ function j_({ application: e, configurationError: t, media: n, runtimeBridge: r
20993
21028
  runtimeBridge: r
20994
21029
  };
20995
21030
  return /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [
20996
- /* @__PURE__ */ (0, N.jsx)(A_, { application: e }),
20997
- /* @__PURE__ */ (0, N.jsx)(kg, {
21031
+ /* @__PURE__ */ (0, N.jsx)(M_, { application: e }),
21032
+ /* @__PURE__ */ (0, N.jsx)(jg, {
20998
21033
  disabled: v,
20999
21034
  layout: s.layout,
21000
21035
  policy: _
21001
21036
  }),
21002
- /* @__PURE__ */ (0, N.jsx)(mf, {
21037
+ /* @__PURE__ */ (0, N.jsx)(hf, {
21003
21038
  blocked: v,
21004
- children: /* @__PURE__ */ (0, N.jsx)(Wp, {
21039
+ children: /* @__PURE__ */ (0, N.jsx)(Kp, {
21005
21040
  seek: y,
21006
- children: /* @__PURE__ */ (0, N.jsx)(qp, {
21041
+ children: /* @__PURE__ */ (0, N.jsx)(Yp, {
21007
21042
  module: f,
21008
- children: /* @__PURE__ */ (0, N.jsx)(gp, {
21043
+ children: /* @__PURE__ */ (0, N.jsx)(vp, {
21009
21044
  module: d,
21010
- children: s.layout === "landscape" ? /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsx)(O_, {}), /* @__PURE__ */ (0, N.jsx)(th, {
21011
- ...T,
21045
+ children: s.layout === "landscape" ? /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsx)(A_, {}), /* @__PURE__ */ (0, N.jsx)(rh, {
21046
+ ...E,
21012
21047
  controlsMounted: S,
21013
21048
  controlsVisible: l.visible,
21014
21049
  controlVisibilityHandlers: b
21015
- })] }) : /* @__PURE__ */ (0, N.jsx)(ah, {
21016
- ...T,
21050
+ })] }) : /* @__PURE__ */ (0, N.jsx)(sh, {
21051
+ ...E,
21017
21052
  controlsVisible: S
21018
21053
  })
21019
21054
  })
@@ -21024,8 +21059,8 @@ function j_({ application: e, configurationError: t, media: n, runtimeBridge: r
21024
21059
  }
21025
21060
  //#endregion
21026
21061
  //#region src/player-application-mode.ts
21027
- var M_ = Object.freeze({ mode: "standalone" }), N_ = /* @__PURE__ */ new WeakMap();
21028
- function P_(e, t, n) {
21062
+ var P_ = Object.freeze({ mode: "standalone" }), F_ = /* @__PURE__ */ new WeakMap();
21063
+ function I_(e, t, n) {
21029
21064
  let r = Object.freeze({
21030
21065
  mode: t.mode,
21031
21066
  ...t.mediaSessionTrackCommands === void 0 ? {} : { mediaSessionTrackCommands: Object.freeze({
@@ -21033,32 +21068,32 @@ function P_(e, t, n) {
21033
21068
  nextTrack: t.mediaSessionTrackCommands.nextTrack
21034
21069
  }) }
21035
21070
  });
21036
- N_.set(e, r);
21071
+ F_.set(e, r);
21037
21072
  try {
21038
21073
  return n();
21039
21074
  } finally {
21040
- N_.delete(e);
21075
+ F_.delete(e);
21041
21076
  }
21042
21077
  }
21043
- function F_(e) {
21044
- return N_.get(e) ?? M_;
21078
+ function L_(e) {
21079
+ return F_.get(e) ?? P_;
21045
21080
  }
21046
21081
  //#endregion
21047
21082
  //#region src/config/diagnostics.ts
21048
- function I_(e) {
21083
+ function R_(e) {
21049
21084
  return e.length === 0 ? null : {
21050
21085
  level: "warning",
21051
21086
  code: "config-soft-degrade",
21052
21087
  message: `[lt-player] Configuration soft-degraded:\n${e.map((e) => `- ${e.path}: ${e.message}`).join("\n")}`
21053
21088
  };
21054
21089
  }
21055
- function L_(e, t) {
21056
- let n = I_(e);
21090
+ function z_(e, t) {
21091
+ let n = R_(e);
21057
21092
  return n !== null && t(n), n;
21058
21093
  }
21059
21094
  //#endregion
21060
21095
  //#region src/config/parse-config.ts
21061
- var R_ = [
21096
+ var B_ = [
21062
21097
  "version",
21063
21098
  "layout",
21064
21099
  "language",
@@ -21066,7 +21101,7 @@ var R_ = [
21066
21101
  "controls",
21067
21102
  "capabilities",
21068
21103
  "strings"
21069
- ], z_ = [
21104
+ ], V_ = [
21070
21105
  "title",
21071
21106
  "author",
21072
21107
  "description",
@@ -21076,14 +21111,14 @@ var R_ = [
21076
21111
  "tracks",
21077
21112
  "chapters",
21078
21113
  "metadata"
21079
- ], B_ = [
21114
+ ], H_ = [
21080
21115
  "inANutshell",
21081
21116
  "keyConcepts",
21082
21117
  "researchField",
21083
21118
  "transcript",
21084
21119
  "underlyingPublication",
21085
21120
  "relatedVideos"
21086
- ], V_ = [
21121
+ ], U_ = [
21087
21122
  "cover",
21088
21123
  "playPause",
21089
21124
  "timeline",
@@ -21096,27 +21131,27 @@ var R_ = [
21096
21131
  "logo",
21097
21132
  "gestures",
21098
21133
  "hotkeys"
21099
- ], H_ = [
21134
+ ], W_ = [
21100
21135
  "chapters",
21101
21136
  "captions",
21102
21137
  "speed",
21103
21138
  "share",
21104
21139
  "contextPanel"
21105
21140
  ];
21106
- function U_(e) {
21141
+ function G_(e) {
21107
21142
  return typeof e == "object" && !!e && !Array.isArray(e);
21108
21143
  }
21109
- function W_(e, t) {
21144
+ function K_(e, t) {
21110
21145
  return Object.hasOwn(e, t);
21111
21146
  }
21112
- function G_(e) {
21147
+ function q_(e) {
21113
21148
  return e === "landscape" || e === "portrait";
21114
21149
  }
21115
- function K_(e) {
21150
+ function J_(e) {
21116
21151
  return typeof e == "number" && Number.isFinite(e);
21117
21152
  }
21118
- function q_(e) {
21119
- return K_(e) && e > 0;
21153
+ function Y_(e) {
21154
+ return J_(e) && e > 0;
21120
21155
  }
21121
21156
  function $(e, t, n, r, i) {
21122
21157
  e.push({
@@ -21126,46 +21161,46 @@ function $(e, t, n, r, i) {
21126
21161
  message: i
21127
21162
  });
21128
21163
  }
21129
- function J_(e, t, n, r) {
21164
+ function X_(e, t, n, r) {
21130
21165
  let i = new Set(t);
21131
21166
  for (let t of Object.keys(e)) i.has(t) || $(r, "unknown-key", `${n}.${t}`, "omitted", "unknown key was ignored");
21132
21167
  }
21133
- function Y_(e, t, n, r) {
21134
- if (!W_(e, t)) return;
21168
+ function Z_(e, t, n, r) {
21169
+ if (!K_(e, t)) return;
21135
21170
  let i = e[t];
21136
21171
  if (typeof i == "string") return i;
21137
21172
  $(r, "wrong-type", `${n}.${t}`, "omitted", "expected a string");
21138
21173
  }
21139
- function X_(e, t, n, r) {
21140
- if (!W_(e, t)) return;
21174
+ function Q_(e, t, n, r) {
21175
+ if (!K_(e, t)) return;
21141
21176
  let i = e[t];
21142
21177
  if (typeof i == "boolean") return i;
21143
21178
  $(r, "wrong-type", `${n}.${t}`, "omitted", "expected a boolean");
21144
21179
  }
21145
- function Z_(e, t, n, r) {
21146
- if (!W_(e, t)) return;
21180
+ function $_(e, t, n, r) {
21181
+ if (!K_(e, t)) return;
21147
21182
  let i = e[t];
21148
- if (K_(i) && i >= 0) return i;
21149
- $(r, K_(i) ? "invalid-value" : "wrong-type", `${n}.${t}`, "omitted", "expected a finite nonnegative number");
21183
+ if (J_(i) && i >= 0) return i;
21184
+ $(r, J_(i) ? "invalid-value" : "wrong-type", `${n}.${t}`, "omitted", "expected a finite nonnegative number");
21150
21185
  }
21151
- function Q_(e, t, n, r) {
21152
- if (!W_(e, t)) return;
21186
+ function ev(e, t, n, r) {
21187
+ if (!K_(e, t)) return;
21153
21188
  let i = e[t];
21154
- if (K_(i) && i > 0) return i;
21155
- $(r, K_(i) ? "invalid-value" : "wrong-type", `${n}.${t}`, "omitted", "expected a finite positive number");
21189
+ if (J_(i) && i > 0) return i;
21190
+ $(r, J_(i) ? "invalid-value" : "wrong-type", `${n}.${t}`, "omitted", "expected a finite positive number");
21156
21191
  }
21157
- function $_(e, t, n, r) {
21192
+ function tv(e, t, n, r) {
21158
21193
  let i = e[t];
21159
21194
  if (typeof i == "string" && i.length > 0) return i;
21160
- $(r, W_(e, t) ? typeof i == "string" ? "invalid-value" : "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires a non-empty string");
21195
+ $(r, K_(e, t) ? typeof i == "string" ? "invalid-value" : "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires a non-empty string");
21161
21196
  }
21162
- function ev(e, t, n, r) {
21197
+ function nv(e, t, n, r) {
21163
21198
  let i = e[t];
21164
- if (K_(i) && i >= 0) return i;
21165
- $(r, W_(e, t) ? K_(i) ? "invalid-value" : "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires a finite nonnegative number");
21199
+ if (J_(i) && i >= 0) return i;
21200
+ $(r, K_(e, t) ? J_(i) ? "invalid-value" : "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires a finite nonnegative number");
21166
21201
  }
21167
- function tv(e, t, n, r, i) {
21168
- if (!W_(e, t)) return;
21202
+ function rv(e, t, n, r, i) {
21203
+ if (!K_(e, t)) return;
21169
21204
  let a = e[t];
21170
21205
  if (!Array.isArray(a)) {
21171
21206
  $(r, "wrong-type", `${n}.${t}`, "omitted", "expected an array");
@@ -21177,30 +21212,30 @@ function tv(e, t, n, r, i) {
21177
21212
  s !== void 0 && o.push(s);
21178
21213
  }), o;
21179
21214
  }
21180
- function nv(e, t, n) {
21181
- if (!U_(e)) {
21215
+ function iv(e, t, n) {
21216
+ if (!G_(e)) {
21182
21217
  $(n, "dropped-entry", t, "dropped", "source entry must be an object");
21183
21218
  return;
21184
21219
  }
21185
- J_(e, ["src", "type"], t, n);
21186
- let r = $_(e, "src", t, n);
21220
+ X_(e, ["src", "type"], t, n);
21221
+ let r = tv(e, "src", t, n);
21187
21222
  if (r === void 0) return;
21188
- let i = { src: r }, a = Y_(e, "type", t, n);
21223
+ let i = { src: r }, a = Z_(e, "type", t, n);
21189
21224
  return a !== void 0 && (i.type = a), i;
21190
21225
  }
21191
- function rv(e, t, n) {
21192
- if (!U_(e)) {
21226
+ function av(e, t, n) {
21227
+ if (!G_(e)) {
21193
21228
  $(n, "dropped-entry", t, "dropped", "track entry must be an object");
21194
21229
  return;
21195
21230
  }
21196
- J_(e, [
21231
+ X_(e, [
21197
21232
  "src",
21198
21233
  "kind",
21199
21234
  "label",
21200
21235
  "srclang",
21201
21236
  "default"
21202
21237
  ], t, n);
21203
- let r = $_(e, "src", t, n);
21238
+ let r = tv(e, "src", t, n);
21204
21239
  if (r === void 0) return;
21205
21240
  let i = { src: r };
21206
21241
  for (let r of [
@@ -21208,19 +21243,19 @@ function rv(e, t, n) {
21208
21243
  "label",
21209
21244
  "srclang"
21210
21245
  ]) {
21211
- let a = Y_(e, r, t, n);
21246
+ let a = Z_(e, r, t, n);
21212
21247
  a !== void 0 && (i[r] = a);
21213
21248
  }
21214
- let a = X_(e, "default", t, n);
21249
+ let a = Q_(e, "default", t, n);
21215
21250
  return a !== void 0 && (i.default = a), i;
21216
21251
  }
21217
- function iv(e, t, n) {
21218
- if (!U_(e)) {
21252
+ function ov(e, t, n) {
21253
+ if (!G_(e)) {
21219
21254
  $(n, "dropped-entry", t, "dropped", "chapter entry must be an object");
21220
21255
  return;
21221
21256
  }
21222
- J_(e, ["name", "start"], t, n);
21223
- let r = $_(e, "name", t, n), i = ev(e, "start", t, n);
21257
+ X_(e, ["name", "start"], t, n);
21258
+ let r = tv(e, "name", t, n), i = nv(e, "start", t, n);
21224
21259
  if (r === void 0 || i === void 0) return;
21225
21260
  let a = t.match(/\[(\d+)\]$/u);
21226
21261
  return {
@@ -21231,8 +21266,8 @@ function iv(e, t, n) {
21231
21266
  index: Number(a?.[1] ?? 0)
21232
21267
  };
21233
21268
  }
21234
- function av(e, t) {
21235
- let n = tv(e, "chapters", "$.content", t, iv);
21269
+ function sv(e, t) {
21270
+ let n = rv(e, "chapters", "$.content", t, ov);
21236
21271
  if (n === void 0) return;
21237
21272
  let r = /* @__PURE__ */ new Set(), i = [];
21238
21273
  for (let { chapter: e, index: a } of n) {
@@ -21244,99 +21279,99 @@ function av(e, t) {
21244
21279
  }
21245
21280
  return i.sort((e, t) => e.start - t.start);
21246
21281
  }
21247
- function ov(e, t, n) {
21248
- let r = {}, i = X_(e, "generatedByAi", t, n);
21282
+ function cv(e, t, n) {
21283
+ let r = {}, i = Q_(e, "generatedByAi", t, n);
21249
21284
  return i !== void 0 && (r.generatedByAi = i), r;
21250
21285
  }
21251
- function sv(e, t, n) {
21252
- if (!U_(e)) {
21286
+ function lv(e, t, n) {
21287
+ if (!G_(e)) {
21253
21288
  $(n, "wrong-type", t, "omitted", "expected an object");
21254
21289
  return;
21255
21290
  }
21256
- J_(e, [
21291
+ X_(e, [
21257
21292
  "generatedByAi",
21258
21293
  "keyTakeaway",
21259
21294
  "summary"
21260
21295
  ], t, n);
21261
- let r = ov(e, t, n);
21296
+ let r = cv(e, t, n);
21262
21297
  for (let i of ["keyTakeaway", "summary"]) {
21263
- let a = Y_(e, i, t, n);
21298
+ let a = Z_(e, i, t, n);
21264
21299
  a !== void 0 && (r[i] = a);
21265
21300
  }
21266
21301
  return r;
21267
21302
  }
21268
- function cv(e, t, n) {
21269
- if (!U_(e)) {
21303
+ function uv(e, t, n) {
21304
+ if (!G_(e)) {
21270
21305
  $(n, "dropped-entry", t, "dropped", "key-concept entry must be an object");
21271
21306
  return;
21272
21307
  }
21273
- J_(e, [
21308
+ X_(e, [
21274
21309
  "label",
21275
21310
  "description",
21276
21311
  "start"
21277
21312
  ], t, n);
21278
- let r = $_(e, "label", t, n), i = $_(e, "description", t, n);
21313
+ let r = tv(e, "label", t, n), i = tv(e, "description", t, n);
21279
21314
  if (r === void 0 || i === void 0) return;
21280
21315
  let a = {
21281
21316
  label: r,
21282
21317
  description: i
21283
- }, o = Z_(e, "start", t, n);
21318
+ }, o = $_(e, "start", t, n);
21284
21319
  return o !== void 0 && (a.start = o), a;
21285
21320
  }
21286
- function lv(e, t, n) {
21287
- if (!U_(e)) {
21321
+ function dv(e, t, n) {
21322
+ if (!G_(e)) {
21288
21323
  $(n, "wrong-type", t, "omitted", "expected an object");
21289
21324
  return;
21290
21325
  }
21291
- J_(e, ["generatedByAi", "items"], t, n);
21292
- let r = ov(e, t, n), i = tv(e, "items", t, n, cv);
21326
+ X_(e, ["generatedByAi", "items"], t, n);
21327
+ let r = cv(e, t, n), i = rv(e, "items", t, n, uv);
21293
21328
  return i !== void 0 && (r.items = i), r;
21294
21329
  }
21295
- function uv(e, t, n) {
21296
- if (!U_(e)) {
21330
+ function fv(e, t, n) {
21331
+ if (!G_(e)) {
21297
21332
  $(n, "dropped-entry", t, "dropped", "research-field entry must be an object");
21298
21333
  return;
21299
21334
  }
21300
- J_(e, ["title", "description"], t, n);
21301
- let r = $_(e, "title", t, n), i = $_(e, "description", t, n);
21335
+ X_(e, ["title", "description"], t, n);
21336
+ let r = tv(e, "title", t, n), i = tv(e, "description", t, n);
21302
21337
  return r === void 0 || i === void 0 ? void 0 : {
21303
21338
  title: r,
21304
21339
  description: i
21305
21340
  };
21306
21341
  }
21307
- function dv(e, t, n) {
21308
- if (!U_(e)) {
21342
+ function pv(e, t, n) {
21343
+ if (!G_(e)) {
21309
21344
  $(n, "wrong-type", t, "omitted", "expected an object");
21310
21345
  return;
21311
21346
  }
21312
- J_(e, ["generatedByAi", "sections"], t, n);
21313
- let r = ov(e, t, n), i = tv(e, "sections", t, n, uv);
21347
+ X_(e, ["generatedByAi", "sections"], t, n);
21348
+ let r = cv(e, t, n), i = rv(e, "sections", t, n, fv);
21314
21349
  return i !== void 0 && (r.sections = i), r;
21315
21350
  }
21316
- function fv(e, t, n) {
21317
- if (!U_(e)) {
21351
+ function mv(e, t, n) {
21352
+ if (!G_(e)) {
21318
21353
  $(n, "dropped-entry", t, "dropped", "transcript entry must be an object");
21319
21354
  return;
21320
21355
  }
21321
- J_(e, ["start", "text"], t, n);
21322
- let r = ev(e, "start", t, n), i = $_(e, "text", t, n);
21356
+ X_(e, ["start", "text"], t, n);
21357
+ let r = nv(e, "start", t, n), i = tv(e, "text", t, n);
21323
21358
  return r === void 0 || i === void 0 ? void 0 : {
21324
21359
  start: r,
21325
21360
  text: i
21326
21361
  };
21327
21362
  }
21328
- function pv(e, t, n) {
21329
- if (!U_(e)) {
21363
+ function hv(e, t, n) {
21364
+ if (!G_(e)) {
21330
21365
  $(n, "wrong-type", t, "omitted", "expected an object");
21331
21366
  return;
21332
21367
  }
21333
- J_(e, ["generatedByAi", "entries"], t, n);
21334
- let r = ov(e, t, n), i = tv(e, "entries", t, n, fv);
21368
+ X_(e, ["generatedByAi", "entries"], t, n);
21369
+ let r = cv(e, t, n), i = rv(e, "entries", t, n, mv);
21335
21370
  return i !== void 0 && (r.entries = i), r;
21336
21371
  }
21337
- function mv(e, t, n, r) {
21338
- if (!W_(e, t) || !Array.isArray(e[t])) {
21339
- $(r, W_(e, t) ? "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires an array of strings");
21372
+ function gv(e, t, n, r) {
21373
+ if (!K_(e, t) || !Array.isArray(e[t])) {
21374
+ $(r, K_(e, t) ? "wrong-type" : "missing-value", `${n}.${t}`, "dropped", "entry requires an array of strings");
21340
21375
  return;
21341
21376
  }
21342
21377
  let i = [];
@@ -21344,19 +21379,19 @@ function mv(e, t, n, r) {
21344
21379
  typeof e == "string" ? i.push(e) : $(r, "dropped-entry", `${n}.${t}[${a}]`, "dropped", "expected a string");
21345
21380
  }), i;
21346
21381
  }
21347
- function hv(e, t, n) {
21348
- if (!U_(e)) {
21382
+ function _v(e, t, n) {
21383
+ if (!G_(e)) {
21349
21384
  $(n, "dropped-entry", t, "dropped", "publication entry must be an object");
21350
21385
  return;
21351
21386
  }
21352
- J_(e, [
21387
+ X_(e, [
21353
21388
  "title",
21354
21389
  "authors",
21355
21390
  "journal",
21356
21391
  "abstract",
21357
21392
  "url"
21358
21393
  ], t, n);
21359
- let r = $_(e, "title", t, n), i = mv(e, "authors", t, n), a = $_(e, "journal", t, n), o = $_(e, "abstract", t, n), s = $_(e, "url", t, n);
21394
+ let r = tv(e, "title", t, n), i = gv(e, "authors", t, n), a = tv(e, "journal", t, n), o = tv(e, "abstract", t, n), s = tv(e, "url", t, n);
21360
21395
  if (r !== void 0 && i !== void 0 && a !== void 0 && o !== void 0 && s !== void 0) return {
21361
21396
  title: r,
21362
21397
  authors: i,
@@ -21365,92 +21400,92 @@ function hv(e, t, n) {
21365
21400
  url: s
21366
21401
  };
21367
21402
  }
21368
- function gv(e, t, n) {
21369
- if (!U_(e)) {
21403
+ function vv(e, t, n) {
21404
+ if (!G_(e)) {
21370
21405
  $(n, "wrong-type", t, "omitted", "expected an object");
21371
21406
  return;
21372
21407
  }
21373
- J_(e, ["generatedByAi", "items"], t, n);
21374
- let r = ov(e, t, n), i = tv(e, "items", t, n, hv);
21408
+ X_(e, ["generatedByAi", "items"], t, n);
21409
+ let r = cv(e, t, n), i = rv(e, "items", t, n, _v);
21375
21410
  return i !== void 0 && (r.items = i), r;
21376
21411
  }
21377
- function _v(e, t, n) {
21378
- if (!U_(e)) {
21412
+ function yv(e, t, n) {
21413
+ if (!G_(e)) {
21379
21414
  $(n, "dropped-entry", t, "dropped", "related-video entry must be an object");
21380
21415
  return;
21381
21416
  }
21382
- J_(e, [
21417
+ X_(e, [
21383
21418
  "title",
21384
21419
  "poster",
21385
21420
  "url"
21386
21421
  ], t, n);
21387
- let r = $_(e, "title", t, n), i = $_(e, "poster", t, n), a = $_(e, "url", t, n);
21422
+ let r = tv(e, "title", t, n), i = tv(e, "poster", t, n), a = tv(e, "url", t, n);
21388
21423
  return r === void 0 || i === void 0 || a === void 0 ? void 0 : {
21389
21424
  title: r,
21390
21425
  poster: i,
21391
21426
  url: a
21392
21427
  };
21393
21428
  }
21394
- function vv(e, t, n) {
21395
- if (!U_(e)) {
21429
+ function bv(e, t, n) {
21430
+ if (!G_(e)) {
21396
21431
  $(n, "wrong-type", t, "omitted", "expected an object");
21397
21432
  return;
21398
21433
  }
21399
- J_(e, [
21434
+ X_(e, [
21400
21435
  "generatedByAi",
21401
21436
  "related",
21402
21437
  "forYou"
21403
21438
  ], t, n);
21404
- let r = ov(e, t, n);
21439
+ let r = cv(e, t, n);
21405
21440
  for (let i of ["related", "forYou"]) {
21406
- let a = tv(e, i, t, n, _v);
21441
+ let a = rv(e, i, t, n, yv);
21407
21442
  a !== void 0 && (r[i] = a);
21408
21443
  }
21409
21444
  return r;
21410
21445
  }
21411
- function yv(e, t, n) {
21412
- if (!U_(e)) {
21446
+ function xv(e, t, n) {
21447
+ if (!G_(e)) {
21413
21448
  $(n, "wrong-type", t, "omitted", "expected an object");
21414
21449
  return;
21415
21450
  }
21416
- J_(e, B_, t, n);
21451
+ X_(e, H_, t, n);
21417
21452
  let r = {}, i = {
21418
- inANutshell: sv,
21419
- keyConcepts: lv,
21420
- researchField: dv,
21421
- transcript: pv,
21422
- underlyingPublication: gv,
21423
- relatedVideos: vv
21453
+ inANutshell: lv,
21454
+ keyConcepts: dv,
21455
+ researchField: pv,
21456
+ transcript: hv,
21457
+ underlyingPublication: vv,
21458
+ relatedVideos: bv
21424
21459
  };
21425
- for (let a of B_) {
21426
- if (!W_(e, a)) continue;
21460
+ for (let a of H_) {
21461
+ if (!K_(e, a)) continue;
21427
21462
  let o = i[a](e[a], `${t}.${a}`, n);
21428
21463
  o !== void 0 && Object.assign(r, { [a]: o });
21429
21464
  }
21430
21465
  return r;
21431
21466
  }
21432
- function bv(e, t, n) {
21467
+ function Sv(e, t, n) {
21433
21468
  if (typeof e == "boolean") return e;
21434
- if (U_(e)) return J_(e, [], t, n), {};
21469
+ if (G_(e)) return X_(e, [], t, n), {};
21435
21470
  $(n, "wrong-type", t, "omitted", "expected a boolean or object");
21436
21471
  }
21437
- function xv(e, t, n) {
21472
+ function Cv(e, t, n) {
21438
21473
  if (typeof e == "boolean") return e;
21439
- if (!U_(e)) {
21474
+ if (!G_(e)) {
21440
21475
  $(n, "wrong-type", t, "omitted", "expected a boolean or object");
21441
21476
  return;
21442
21477
  }
21443
- J_(e, ["label"], t, n);
21444
- let r = {}, i = Y_(e, "label", t, n);
21478
+ X_(e, ["label"], t, n);
21479
+ let r = {}, i = Z_(e, "label", t, n);
21445
21480
  return i !== void 0 && (r.label = i), r;
21446
21481
  }
21447
- function Sv(e, t, n) {
21482
+ function wv(e, t, n) {
21448
21483
  if (typeof e == "boolean") return e;
21449
- if (!U_(e)) {
21484
+ if (!G_(e)) {
21450
21485
  $(n, "wrong-type", t, "omitted", "expected a boolean or object");
21451
21486
  return;
21452
21487
  }
21453
- J_(e, [
21488
+ X_(e, [
21454
21489
  "image",
21455
21490
  "title",
21456
21491
  "author",
@@ -21462,62 +21497,62 @@ function Sv(e, t, n) {
21462
21497
  "title",
21463
21498
  "author"
21464
21499
  ]) {
21465
- let a = X_(e, i, t, n);
21500
+ let a = Q_(e, i, t, n);
21466
21501
  a !== void 0 && (r[i] = a);
21467
21502
  }
21468
- if (W_(e, "button")) {
21469
- let i = xv(e.button, `${t}.button`, n);
21503
+ if (K_(e, "button")) {
21504
+ let i = Cv(e.button, `${t}.button`, n);
21470
21505
  i !== void 0 && (r.button = i);
21471
21506
  }
21472
21507
  return r;
21473
21508
  }
21474
- function Cv(e, t, n) {
21509
+ function Tv(e, t, n) {
21475
21510
  if (typeof e == "boolean") return e;
21476
- if (!U_(e)) {
21511
+ if (!G_(e)) {
21477
21512
  $(n, "wrong-type", t, "omitted", "expected a boolean or object");
21478
21513
  return;
21479
21514
  }
21480
- J_(e, ["seekStep"], t, n);
21515
+ X_(e, ["seekStep"], t, n);
21481
21516
  let r = {};
21482
- if (W_(e, "seekStep")) {
21517
+ if (K_(e, "seekStep")) {
21483
21518
  let i = e.seekStep;
21484
- K_(i) && i > 0 ? r.seekStep = i : $(n, K_(i) ? "invalid-value" : "wrong-type", `${t}.seekStep`, "omitted", "expected a finite positive number");
21519
+ J_(i) && i > 0 ? r.seekStep = i : $(n, J_(i) ? "invalid-value" : "wrong-type", `${t}.seekStep`, "omitted", "expected a finite positive number");
21485
21520
  }
21486
21521
  return r;
21487
21522
  }
21488
- function wv(e, t, n) {
21489
- if (!U_(e)) {
21523
+ function Ev(e, t, n) {
21524
+ if (!G_(e)) {
21490
21525
  $(n, "wrong-type", t, "omitted", "expected an object");
21491
21526
  return;
21492
21527
  }
21493
- J_(e, V_, t, n);
21528
+ X_(e, U_, t, n);
21494
21529
  let r = {};
21495
- for (let i of V_) {
21496
- if (!W_(e, i)) continue;
21497
- let a = i === "cover" ? Sv(e[i], `${t}.${i}`, n) : i === "timeline" ? Cv(e[i], `${t}.${i}`, n) : bv(e[i], `${t}.${i}`, n);
21530
+ for (let i of U_) {
21531
+ if (!K_(e, i)) continue;
21532
+ let a = i === "cover" ? wv(e[i], `${t}.${i}`, n) : i === "timeline" ? Tv(e[i], `${t}.${i}`, n) : Sv(e[i], `${t}.${i}`, n);
21498
21533
  a !== void 0 && Object.assign(r, { [i]: a });
21499
21534
  }
21500
21535
  return r;
21501
21536
  }
21502
- function Tv(e, t, n) {
21537
+ function Dv(e, t, n) {
21503
21538
  if (typeof e == "boolean") return e;
21504
- if (!U_(e)) {
21539
+ if (!G_(e)) {
21505
21540
  $(n, "wrong-type", t, "omitted", "expected a boolean or object");
21506
21541
  return;
21507
21542
  }
21508
- J_(e, ["options"], t, n);
21543
+ X_(e, ["options"], t, n);
21509
21544
  let r = {};
21510
- if (!W_(e, "options")) return r;
21545
+ if (!K_(e, "options")) return r;
21511
21546
  let i = e.options;
21512
- return Array.isArray(i) && i.length > 0 && i.every((e) => K_(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;
21547
+ return Array.isArray(i) && i.length > 0 && i.every((e) => J_(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;
21513
21548
  }
21514
- function Ev(e, t, n) {
21549
+ function Ov(e, t, n) {
21515
21550
  if (typeof e == "boolean") return e;
21516
- if (!U_(e)) {
21551
+ if (!G_(e)) {
21517
21552
  $(n, "wrong-type", t, "omitted", "expected a boolean or object");
21518
21553
  return;
21519
21554
  }
21520
- J_(e, [
21555
+ X_(e, [
21521
21556
  "canonicalUrl",
21522
21557
  "embedUrl",
21523
21558
  "playerTrigger",
@@ -21526,11 +21561,11 @@ function Ev(e, t, n) {
21526
21561
  ], t, n);
21527
21562
  let r = {};
21528
21563
  for (let i of ["canonicalUrl", "embedUrl"]) {
21529
- let a = Y_(e, i, t, n);
21564
+ let a = Z_(e, i, t, n);
21530
21565
  a !== void 0 && (r[i] = a);
21531
21566
  }
21532
- let i = X_(e, "playerTrigger", t, n);
21533
- if (i !== void 0 && (r.playerTrigger = i), W_(e, "targets")) {
21567
+ let i = Q_(e, "playerTrigger", t, n);
21568
+ if (i !== void 0 && (r.playerTrigger = i), K_(e, "targets")) {
21534
21569
  let i = e.targets;
21535
21570
  if (!Array.isArray(i)) $(n, "wrong-type", `${t}.targets`, "omitted", "expected an array");
21536
21571
  else {
@@ -21562,13 +21597,13 @@ function Ev(e, t, n) {
21562
21597
  }), r.targets = o;
21563
21598
  }
21564
21599
  }
21565
- if (W_(e, "templates")) {
21566
- if (!U_(e.templates)) $(n, "wrong-type", `${t}.templates`, "omitted", "expected an object");
21600
+ if (K_(e, "templates")) {
21601
+ if (!G_(e.templates)) $(n, "wrong-type", `${t}.templates`, "omitted", "expected an object");
21567
21602
  else {
21568
- J_(e.templates, ["message"], `${t}.templates`, n);
21603
+ X_(e.templates, ["message"], `${t}.templates`, n);
21569
21604
  let i = {};
21570
21605
  for (let r of ["message"]) {
21571
- let a = Y_(e.templates, r, `${t}.templates`, n);
21606
+ let a = Z_(e.templates, r, `${t}.templates`, n);
21572
21607
  a !== void 0 && (i[r] = a);
21573
21608
  }
21574
21609
  r.templates = i;
@@ -21576,22 +21611,22 @@ function Ev(e, t, n) {
21576
21611
  }
21577
21612
  return r;
21578
21613
  }
21579
- function Dv(e, t, n) {
21580
- if (!U_(e)) {
21614
+ function kv(e, t, n) {
21615
+ if (!G_(e)) {
21581
21616
  $(n, "wrong-type", t, "omitted", "expected an object");
21582
21617
  return;
21583
21618
  }
21584
- J_(e, H_, t, n);
21619
+ X_(e, W_, t, n);
21585
21620
  let r = {};
21586
- for (let i of H_) {
21587
- if (!W_(e, i)) continue;
21588
- let a = i === "speed" ? Tv(e[i], `${t}.${i}`, n) : i === "share" ? Ev(e[i], `${t}.${i}`, n) : X_(e, i, t, n);
21621
+ for (let i of W_) {
21622
+ if (!K_(e, i)) continue;
21623
+ let a = i === "speed" ? Dv(e[i], `${t}.${i}`, n) : i === "share" ? Ov(e[i], `${t}.${i}`, n) : Q_(e, i, t, n);
21589
21624
  a !== void 0 && Object.assign(r, { [i]: a });
21590
21625
  }
21591
21626
  return r;
21592
21627
  }
21593
- function Ov(e, t, n) {
21594
- if (!U_(e)) {
21628
+ function Av(e, t, n) {
21629
+ if (!G_(e)) {
21595
21630
  $(n, "wrong-type", t, "omitted", "expected an object");
21596
21631
  return;
21597
21632
  }
@@ -21599,7 +21634,7 @@ function Ov(e, t, n) {
21599
21634
  for (let [i, a] of Object.entries(e)) typeof a == "string" ? r[i] = a : $(n, "wrong-type", `${t}.${i}`, "omitted", "expected a string");
21600
21635
  return r;
21601
21636
  }
21602
- function kv(e, t, n) {
21637
+ function jv(e, t, n) {
21603
21638
  if (typeof e == "string") return e;
21604
21639
  if (!Array.isArray(e)) {
21605
21640
  $(n, "wrong-type", t, "omitted", "expected a string or string array");
@@ -21614,50 +21649,50 @@ function kv(e, t, n) {
21614
21649
  typeof e == "string" ? r.push(e) : $(n, "dropped-entry", `${t}[${i}]`, "dropped", "expected a string");
21615
21650
  }), r.length > 0 ? r : void 0;
21616
21651
  }
21617
- function Av(e, t) {
21618
- J_(e, z_, "$.content", t);
21619
- let n = { sources: e.sources.map((e, n) => nv(e, `$.content.sources[${n}]`, t)).filter((e) => e !== void 0) };
21652
+ function Mv(e, t) {
21653
+ X_(e, V_, "$.content", t);
21654
+ let n = { sources: e.sources.map((e, n) => iv(e, `$.content.sources[${n}]`, t)).filter((e) => e !== void 0) };
21620
21655
  for (let r of [
21621
21656
  "title",
21622
21657
  "author",
21623
21658
  "description",
21624
21659
  "poster"
21625
21660
  ]) {
21626
- let i = Y_(e, r, "$.content", t);
21661
+ let i = Z_(e, r, "$.content", t);
21627
21662
  i !== void 0 && (n[r] = i);
21628
21663
  }
21629
- let r = Q_(e, "duration", "$.content", t);
21664
+ let r = ev(e, "duration", "$.content", t);
21630
21665
  r !== void 0 && (n.duration = r);
21631
- let i = tv(e, "tracks", "$.content", t, rv);
21666
+ let i = rv(e, "tracks", "$.content", t, av);
21632
21667
  i !== void 0 && (n.tracks = i);
21633
- let a = av(e, t);
21634
- if (a !== void 0 && (n.chapters = a), W_(e, "metadata")) {
21635
- let r = yv(e.metadata, "$.content.metadata", t);
21668
+ let a = sv(e, t);
21669
+ if (a !== void 0 && (n.chapters = a), K_(e, "metadata")) {
21670
+ let r = xv(e.metadata, "$.content.metadata", t);
21636
21671
  r !== void 0 && (n.metadata = r);
21637
21672
  }
21638
21673
  return n;
21639
21674
  }
21640
- function jv(e, t) {
21675
+ function Nv(e, t) {
21641
21676
  return {
21642
21677
  level: "error",
21643
21678
  code: t ? "legacy-config-invalid" : "config-invalid",
21644
21679
  message: `${t ? "[lt-player] Legacy pre-v3 configuration rejected" : "[lt-player] Configuration rejected"}:\n${e.map((e) => `- ${e.path}: ${e.message}`).join("\n")}`
21645
21680
  };
21646
21681
  }
21647
- function Mv(e, t) {
21682
+ function Pv(e, t) {
21648
21683
  return {
21649
21684
  status: "valid",
21650
21685
  config: e,
21651
21686
  findings: t,
21652
- diagnostic: I_(t)
21687
+ diagnostic: R_(t)
21653
21688
  };
21654
21689
  }
21655
- function Nv(e, t, n) {
21690
+ function Fv(e, t, n) {
21656
21691
  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));
21657
21692
  }
21658
- function Pv(e, t) {
21659
- let n = U_(e) ? e : {}, r = U_(n.content) ? n.content : void 0, i = n.layout, a = [];
21660
- if (G_(i) || a.push({
21693
+ function Iv(e, t) {
21694
+ let n = G_(e) ? e : {}, r = G_(n.content) ? n.content : void 0, i = n.layout, a = [];
21695
+ if (q_(i) || a.push({
21661
21696
  code: "invalid-layout",
21662
21697
  path: "$.layout",
21663
21698
  message: "layout must be landscape or portrait"
@@ -21665,54 +21700,54 @@ function Pv(e, t) {
21665
21700
  code: "missing-sources",
21666
21701
  path: "$.content.sources",
21667
21702
  message: "content.sources must be a non-empty array"
21668
- }), t.application === "update" && G_(i) && i !== t.instanceLayout && a.push({
21703
+ }), t.application === "update" && q_(i) && i !== t.instanceLayout && a.push({
21669
21704
  code: "layout-change",
21670
21705
  path: "$.layout",
21671
21706
  message: `layout cannot change from ${t.instanceLayout} to ${i}`
21672
21707
  }), a.length > 0) {
21673
- let e = W_(n, "body");
21708
+ let e = K_(n, "body");
21674
21709
  return {
21675
21710
  status: "invalid",
21676
21711
  violations: a,
21677
21712
  legacy: e,
21678
- diagnostic: jv(a, e)
21713
+ diagnostic: Nv(a, e)
21679
21714
  };
21680
21715
  }
21681
21716
  let o = [];
21682
- J_(n, R_, "$", o);
21717
+ X_(n, B_, "$", o);
21683
21718
  let s = {
21684
21719
  version: 3,
21685
21720
  layout: i,
21686
- content: Av(r, o)
21721
+ content: Mv(r, o)
21687
21722
  };
21688
- if (W_(n, "version") && n.version !== 3 && $(o, typeof n.version == "number" ? "invalid-value" : "wrong-type", "$.version", "omitted", "version was normalized to 3"), W_(n, "language")) {
21689
- let e = kv(n.language, "$.language", o);
21723
+ if (K_(n, "version") && n.version !== 3 && $(o, typeof n.version == "number" ? "invalid-value" : "wrong-type", "$.version", "omitted", "version was normalized to 3"), K_(n, "language")) {
21724
+ let e = jv(n.language, "$.language", o);
21690
21725
  e !== void 0 && (s.language = e);
21691
21726
  }
21692
- if (W_(n, "controls")) {
21693
- let e = wv(n.controls, "$.controls", o);
21727
+ if (K_(n, "controls")) {
21728
+ let e = Ev(n.controls, "$.controls", o);
21694
21729
  e !== void 0 && (s.controls = e);
21695
21730
  }
21696
- if (W_(n, "capabilities")) {
21697
- let e = Dv(n.capabilities, "$.capabilities", o);
21731
+ if (K_(n, "capabilities")) {
21732
+ let e = kv(n.capabilities, "$.capabilities", o);
21698
21733
  e !== void 0 && (s.capabilities = e);
21699
21734
  }
21700
- if (W_(n, "strings")) {
21701
- let e = Ov(n.strings, "$.strings", o);
21735
+ if (K_(n, "strings")) {
21736
+ let e = Av(n.strings, "$.strings", o);
21702
21737
  e !== void 0 && (s.strings = e);
21703
21738
  }
21704
- let c = s.content.chapters, l = s.content.duration ?? (q_(t.engineDuration) ? t.engineDuration : void 0);
21739
+ let c = s.content.chapters, l = s.content.duration ?? (Y_(t.engineDuration) ? t.engineDuration : void 0);
21705
21740
  return c !== void 0 && c.length > 0 && l === void 0 ? {
21706
21741
  status: "pending-duration",
21707
21742
  config: s,
21708
21743
  findings: o,
21709
21744
  diagnostic: null
21710
- } : (c !== void 0 && l !== void 0 && (s.content.chapters = Nv(c, l, o)), Mv(s, o));
21745
+ } : (c !== void 0 && l !== void 0 && (s.content.chapters = Fv(c, l, o)), Pv(s, o));
21711
21746
  }
21712
- function Fv(e, t) {
21713
- if (!q_(t)) return e;
21714
- let n = [...e.findings], r = Nv(e.config.content.chapters ?? [], t, n);
21715
- return Mv({
21747
+ function Lv(e, t) {
21748
+ if (!Y_(t)) return e;
21749
+ let n = [...e.findings], r = Fv(e.config.content.chapters ?? [], t, n);
21750
+ return Pv({
21716
21751
  ...e.config,
21717
21752
  content: {
21718
21753
  ...e.config.content,
@@ -21720,17 +21755,17 @@ function Fv(e, t) {
21720
21755
  }
21721
21756
  }, n);
21722
21757
  }
21723
- function Iv(e) {
21724
- return Mv(e.config, e.findings);
21758
+ function Rv(e) {
21759
+ return Pv(e.config, e.findings);
21725
21760
  }
21726
21761
  //#endregion
21727
21762
  //#region src/page-api/player-runtime.ts
21728
- var Lv = Symbol("chapter-unset"), Rv = () => void 0;
21729
- function zv(e) {
21763
+ var zv = Symbol("chapter-unset"), Bv = () => void 0;
21764
+ function Vv(e) {
21730
21765
  return Number.isFinite(e) && e >= 0 ? e : 0;
21731
21766
  }
21732
- function Bv(e) {
21733
- return kh({
21767
+ function Hv(e) {
21768
+ return jh({
21734
21769
  version: 3,
21735
21770
  layout: e,
21736
21771
  content: { sources: [] },
@@ -21743,14 +21778,14 @@ function Bv(e) {
21743
21778
  }
21744
21779
  });
21745
21780
  }
21746
- function Vv(e) {
21781
+ function Uv(e) {
21747
21782
  if (typeof e == "object" && e && "layout" in e) {
21748
21783
  let t = e.layout;
21749
21784
  if (t === "landscape" || t === "portrait") return t;
21750
21785
  }
21751
21786
  return "landscape";
21752
21787
  }
21753
- var Hv = class {
21788
+ var Wv = class {
21754
21789
  #e;
21755
21790
  #t;
21756
21791
  #n;
@@ -21769,7 +21804,7 @@ var Hv = class {
21769
21804
  #h = 0;
21770
21805
  #g = "";
21771
21806
  #_ = -1;
21772
- #v = Lv;
21807
+ #v = zv;
21773
21808
  #y = Object.freeze({
21774
21809
  playback: "idle",
21775
21810
  currentTime: 0,
@@ -21786,7 +21821,7 @@ var Hv = class {
21786
21821
  #S = !1;
21787
21822
  #C = -1;
21788
21823
  constructor(e) {
21789
- 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 ?? Gh(), this.#c = Object.freeze({
21824
+ 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 ?? qh(), this.#c = Object.freeze({
21790
21825
  update: (e) => this.update(e),
21791
21826
  destroy: () => this.destroy(),
21792
21827
  getState: () => this.getState(),
@@ -21822,9 +21857,9 @@ var Hv = class {
21822
21857
  return this.#x;
21823
21858
  }
21824
21859
  mount(e) {
21825
- let t = Pv(e, { application: "mount" });
21860
+ let t = Iv(e, { application: "mount" });
21826
21861
  if (t.status === "invalid") {
21827
- let n = Vv(e), r = Bv(n), i = _h(), a = Gm(r);
21862
+ let n = Uv(e), r = Hv(n), i = yh(), a = qm(r);
21828
21863
  throw this.#m += 1, this.#l = Object.freeze({
21829
21864
  generation: this.#m,
21830
21865
  revision: ++this.#h,
@@ -21847,7 +21882,7 @@ var Hv = class {
21847
21882
  if (this.#b) return;
21848
21883
  let t = this.application;
21849
21884
  this.#E();
21850
- let n = Pv(e, {
21885
+ let n = Iv(e, {
21851
21886
  application: "update",
21852
21887
  instanceLayout: t.config.layout
21853
21888
  });
@@ -21871,8 +21906,8 @@ var Hv = class {
21871
21906
  });
21872
21907
  let e = this.#d.getSnapshot(), t = this.#d.playerState.getSnapshot().playback, n = Object.freeze({
21873
21908
  playback: t,
21874
- currentTime: zv(e.currentTime),
21875
- duration: zv(e.duration),
21909
+ currentTime: Vv(e.currentTime),
21910
+ duration: Vv(e.duration),
21876
21911
  volume: e.volume,
21877
21912
  muted: e.muted,
21878
21913
  rate: e.rate,
@@ -21883,7 +21918,7 @@ var Hv = class {
21883
21918
  return this.#y = n, n;
21884
21919
  }
21885
21920
  on(e, t) {
21886
- if (this.#b) return Rv;
21921
+ if (this.#b) return Bv;
21887
21922
  let n = this.#s.get(e) ?? /* @__PURE__ */ new Set();
21888
21923
  this.#s.set(e, n);
21889
21924
  let r = t;
@@ -21894,7 +21929,7 @@ var Hv = class {
21894
21929
  };
21895
21930
  }
21896
21931
  attachEngine(e) {
21897
- if (this.#b) return Rv;
21932
+ if (this.#b) return Bv;
21898
21933
  this.#f?.(), this.#d = e;
21899
21934
  let t = e.media, n = e.getSnapshot(), r = e.playerState.getSnapshot(), i = e.subscribe(() => {
21900
21935
  let t = e.getSnapshot();
@@ -21924,10 +21959,10 @@ var Hv = class {
21924
21959
  let n = this.application;
21925
21960
  if (n.generation !== e || n.revision !== t) return;
21926
21961
  let r = `${e}:${t}`;
21927
- this.#g !== r && (this.#g = r, n.commit !== "duration" && (this.#S = !0, this.#_ = -1, this.#v = Lv, 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", {})));
21962
+ this.#g !== r && (this.#g = r, n.commit !== "duration" && (this.#S = !0, this.#_ = -1, this.#v = zv, 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", {})));
21928
21963
  }
21929
21964
  #w(e, t) {
21930
- let n = this.#d?.userState.getSnapshot() ?? this.#a.hydrate(), r = kh(e.config, n), i = _h(typeof r.language == "string" ? r.language : [...r.language], r.strings), a = this.#l?.registry ?? Gm(r);
21965
+ let n = this.#d?.userState.getSnapshot() ?? this.#a.hydrate(), r = jh(e.config, n), i = yh(typeof r.language == "string" ? r.language : [...r.language], r.strings), a = this.#l?.registry ?? qm(r);
21931
21966
  this.#l !== null && a.applyConfig(r), this.#m += 1, this.#l = Object.freeze({
21932
21967
  generation: this.#m,
21933
21968
  revision: ++this.#h,
@@ -21947,10 +21982,10 @@ var Hv = class {
21947
21982
  #T(e) {
21948
21983
  let t = this.#u;
21949
21984
  if (t === null || t.generation !== this.application.generation || this.#C !== -1 || !Number.isFinite(e) || e <= 0) return;
21950
- let n = Fv(t.result, e);
21985
+ let n = Lv(t.result, e);
21951
21986
  if (n.status === "pending-duration") return;
21952
21987
  this.#u = null;
21953
- let r = this.#d?.userState.getSnapshot() ?? this.#a.hydrate(), i = kh(n.config, r);
21988
+ let r = this.#d?.userState.getSnapshot() ?? this.#a.hydrate(), i = jh(n.config, r);
21954
21989
  this.application.registry.applyConfig(i), this.#l = Object.freeze({
21955
21990
  ...this.application,
21956
21991
  revision: ++this.#h,
@@ -21962,7 +21997,7 @@ var Hv = class {
21962
21997
  let e = this.#u;
21963
21998
  if (e === null) return;
21964
21999
  this.#u = null;
21965
- let t = Iv(e.result);
22000
+ let t = Rv(e.result);
21966
22001
  this.#L([...t.findings, ...e.stringFindings]);
21967
22002
  }
21968
22003
  #D(e) {
@@ -21992,7 +22027,7 @@ var Hv = class {
21992
22027
  #M(e) {
21993
22028
  if (!(this.#b || this.#S || this.#d === null)) {
21994
22029
  if (e === "canplay") {
21995
- this.#C = -1, this.#T(this.#d.getSnapshot().duration), this.#_ !== this.application.generation && (this.#_ = this.application.generation, this.#I("ready", { duration: zv(this.#d.getSnapshot().duration) }));
22030
+ this.#C = -1, this.#T(this.#d.getSnapshot().duration), this.#_ !== this.application.generation && (this.#_ = this.application.generation, this.#I("ready", { duration: Vv(this.#d.getSnapshot().duration) }));
21996
22031
  return;
21997
22032
  }
21998
22033
  if (this.#C === -1) {
@@ -22022,38 +22057,38 @@ var Hv = class {
22022
22057
  }
22023
22058
  #F() {
22024
22059
  if (this.#d === null || this.#l === null) return;
22025
- let e = cf(this.#l.config.content.chapters, this.#d.getSnapshot().currentTime);
22060
+ let e = lf(this.#l.config.content.chapters, this.#d.getSnapshot().currentTime);
22026
22061
  this.#v !== e && (this.#v = e, this.#I("chapterChange", { chapter: e }));
22027
22062
  }
22028
22063
  #I(e, t) {
22029
22064
  if (this.#b) return;
22030
- let n = zv(this.#d?.getSnapshot().currentTime ?? 0), r = Object.freeze({
22065
+ let n = Vv(this.#d?.getSnapshot().currentTime ?? 0), r = Object.freeze({
22031
22066
  currentTime: n,
22032
22067
  ...t
22033
22068
  });
22034
22069
  for (let t of [...this.#s.get(e) ?? []]) t(r);
22035
22070
  }
22036
22071
  #L(e) {
22037
- L_(e, (e) => this.#R(e));
22072
+ z_(e, (e) => this.#R(e));
22038
22073
  }
22039
22074
  #R(e) {
22040
22075
  e.level === "error" ? console.error(e.message) : console.warn(e.message);
22041
22076
  }
22042
- }, Uv = /* @__PURE__ */ new WeakMap();
22043
- function Wv(e) {
22077
+ }, Gv = /* @__PURE__ */ new WeakMap();
22078
+ function Kv(e) {
22044
22079
  return e.id ? `#${e.id}` : e.tagName.toLowerCase();
22045
22080
  }
22046
- function Gv(e, t) {
22047
- let n = Uv.get(e);
22081
+ function qv(e, t) {
22082
+ let n = Gv.get(e);
22048
22083
  if (n !== void 0) {
22049
- if (!n.isFailedMount()) throw Error(`Cannot create player: host ${Wv(e)} is already owned`);
22084
+ if (!n.isFailedMount()) throw Error(`Cannot create player: host ${Kv(e)} is already owned`);
22050
22085
  n.destroy();
22051
22086
  }
22052
- let r = (0, ld.createRoot)(e), i = new Hv({
22053
- applicationContext: F_(e),
22087
+ let r = (0, ld.createRoot)(e), i = new Wv({
22088
+ applicationContext: L_(e),
22054
22089
  render(e) {
22055
22090
  r !== null && (0, Dl.flushSync)(() => {
22056
- r?.render((0, w.createElement)(S_, {
22091
+ r?.render((0, w.createElement)(w_, {
22057
22092
  application: e,
22058
22093
  runtime: i
22059
22094
  }));
@@ -22065,10 +22100,10 @@ function Gv(e, t) {
22065
22100
  r = null, (0, Dl.flushSync)(() => e.unmount());
22066
22101
  },
22067
22102
  releaseHost() {
22068
- Uv.get(e) === i && Uv.delete(e);
22103
+ Gv.get(e) === i && Gv.delete(e);
22069
22104
  }
22070
22105
  });
22071
- return Uv.set(e, i), i.mount(t);
22106
+ return Gv.set(e, i), i.mount(t);
22072
22107
  }
22073
22108
  //#endregion
22074
- export { m as _, Pp as a, Qt as c, bt as d, ht as f, v as g, f as h, Mp as i, Zt as l, _ as m, P_ as n, Fd as o, M as p, kp as r, yn as s, Gv as t, Xt as u };
22109
+ export { m as _, Ip as a, Qt as c, bt as d, ht as f, v as g, f as h, Pp as i, Zt as l, _ as m, I_ as n, Fd as o, M as p, jp as r, yn as s, qv as t, Xt as u };