markdown-flow-ui 0.2.22-dev.1 → 0.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/_virtual/index.es8.js +2 -2
  2. package/dist/_virtual/index.es9.js +2 -2
  3. package/dist/_virtual/index8.cjs +1 -1
  4. package/dist/_virtual/index9.cjs +1 -1
  5. package/dist/assets/markdown-flow-ui.css +1 -1
  6. package/dist/components/Slide/Player.cjs +1 -1
  7. package/dist/components/Slide/Player.cjs.map +1 -1
  8. package/dist/components/Slide/Player.d.ts +1 -3
  9. package/dist/components/Slide/Player.es.js +488 -457
  10. package/dist/components/Slide/Player.es.js.map +1 -1
  11. package/dist/components/Slide/Slide.cjs +1 -1
  12. package/dist/components/Slide/Slide.cjs.map +1 -1
  13. package/dist/components/Slide/Slide.es.js +660 -664
  14. package/dist/components/Slide/Slide.es.js.map +1 -1
  15. package/dist/components/Slide/SubtitleOverlay.cjs +1 -1
  16. package/dist/components/Slide/SubtitleOverlay.cjs.map +1 -1
  17. package/dist/components/Slide/SubtitleOverlay.d.ts +1 -2
  18. package/dist/components/Slide/SubtitleOverlay.es.js +18 -20
  19. package/dist/components/Slide/SubtitleOverlay.es.js.map +1 -1
  20. package/dist/components/Slide/slideI18n.cjs.map +1 -1
  21. package/dist/components/Slide/slideI18n.d.ts +0 -1
  22. package/dist/components/Slide/slideI18n.es.js.map +1 -1
  23. package/dist/components/Slide/utils/interactionPlayback.cjs +1 -1
  24. package/dist/components/Slide/utils/interactionPlayback.cjs.map +1 -1
  25. package/dist/components/Slide/utils/interactionPlayback.d.ts +1 -2
  26. package/dist/components/Slide/utils/interactionPlayback.es.js +7 -8
  27. package/dist/components/Slide/utils/interactionPlayback.es.js.map +1 -1
  28. package/dist/components/Slide/utils/playerCustomActions.cjs +1 -1
  29. package/dist/components/Slide/utils/playerCustomActions.cjs.map +1 -1
  30. package/dist/components/Slide/utils/playerCustomActions.d.ts +1 -1
  31. package/dist/components/Slide/utils/playerCustomActions.es.js +14 -18
  32. package/dist/components/Slide/utils/playerCustomActions.es.js.map +1 -1
  33. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs +1 -1
  34. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.map +1 -1
  35. package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +1 -1
  36. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +2 -0
  37. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -1
  38. package/dist/components/Slide/utils/playerVisibility.cjs +1 -1
  39. package/dist/components/Slide/utils/playerVisibility.cjs.map +1 -1
  40. package/dist/components/Slide/utils/playerVisibility.d.ts +10 -0
  41. package/dist/components/Slide/utils/playerVisibility.es.js +14 -6
  42. package/dist/components/Slide/utils/playerVisibility.es.js.map +1 -1
  43. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
  44. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  45. package/dist/node_modules/classnames/index.cjs +1 -1
  46. package/dist/node_modules/classnames/index.es.js +1 -1
  47. package/dist/node_modules/cose-base/cose-base.cjs +1 -1
  48. package/dist/node_modules/cose-base/cose-base.cjs.map +1 -1
  49. package/dist/node_modules/cose-base/cose-base.es.js +1 -1
  50. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs +1 -1
  51. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.map +1 -1
  52. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.es.js +1 -1
  53. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs +1 -1
  54. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.map +1 -1
  55. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.es.js +1 -1
  56. package/dist/node_modules/layout-base/layout-base.cjs +1 -1
  57. package/dist/node_modules/layout-base/layout-base.cjs.map +1 -1
  58. package/dist/node_modules/layout-base/layout-base.es.js +1 -1
  59. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs +7 -0
  60. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs.map +1 -0
  61. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js +29 -0
  62. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js.map +1 -0
  63. package/package.json +1 -1
@@ -1,56 +1,57 @@
1
- import { jsxs as Q, jsx as s, Fragment as Nt } from "react/jsx-runtime";
2
- import ar, { memo as sr, useId as cr, useContext as ir, useRef as o, useState as Ve, useMemo as re, useCallback as r, useEffect as b } from "react";
3
- import { getMarkdownFlowDirection as or, getMarkdownFlowLanguage as fr } from "../../lib/locale.es.js";
4
- import { useDetachedLanguage as dr } from "../../lib/useDetachedLanguage.es.js";
5
- import { useResolvedDirection as mr } from "../../lib/useResolvedDirection.es.js";
6
- import { cn as pr } from "../../lib/utils.es.js";
7
- import hr from "./MobilePlayerSettingsSheet.es.js";
8
- import { getSlidePlayerTexts as yr } from "./slideI18n.es.js";
9
- import { DEFAULT_MOBILE_VIEW_MODE as gr } from "./utils/mobileScreenMode.es.js";
10
- import { hasReachedAudioEnd as br } from "./utils/audioCompletion.es.js";
11
- import { PlayerKeyboardShortcutContext as Sr } from "./utils/playerKeyboardShortcutContext.es.js";
12
- import { activatePlayerKeyboardShortcutOwner as _r, registerPlayerKeyboardShortcutOwner as kr, isActivePlayerKeyboardShortcutOwner as wr, getPlayerKeyboardShortcutAction as Mr, shouldIgnorePlayerKeyboardShortcutEvent as Tr } from "./utils/playerKeyboardShortcuts.es.js";
13
- import { resolveAudioPlaybackSourceType as Cr } from "./utils/playbackSource.es.js";
14
- import { shouldKeepPlayingAfterNavigation as vr } from "./utils/playbackPreference.es.js";
15
- import { toPlayerCustomActionList as Lr } from "./utils/playerCustomActions.es.js";
16
- import { suppressPlayerControlsWakeAfterNavigation as He } from "./utils/playerNavigationContext.es.js";
17
- import { isPlaybackTimeCoveredBySegments as Et, resolveSegmentSeekTarget as xr } from "./utils/segmentSeek.es.js";
18
- import { getSortedAudioSegments as Kt } from "./utils/audioSegments.es.js";
19
- import { getSubtitleCueJumpTarget as Ar, shouldClearSubtitleCueJumpTarget as Rr } from "./utils/subtitleCue.es.js";
1
+ import { jsxs as X, jsx as a, Fragment as cr } from "react/jsx-runtime";
2
+ import or, { memo as fr, useId as dr, useContext as mr, useRef as o, useState as He, useMemo as re, useCallback as r, useEffect as S } from "react";
3
+ import { getMarkdownFlowDirection as pr, getMarkdownFlowLanguage as hr } from "../../lib/locale.es.js";
4
+ import { useDetachedLanguage as yr } from "../../lib/useDetachedLanguage.es.js";
5
+ import { useResolvedDirection as br } from "../../lib/useResolvedDirection.es.js";
6
+ import { cn as Ft } from "../../lib/utils.es.js";
7
+ import Sr from "./MobilePlayerSettingsSheet.es.js";
8
+ import { getSlidePlayerTexts as gr } from "./slideI18n.es.js";
9
+ import { DEFAULT_MOBILE_VIEW_MODE as _r } from "./utils/mobileScreenMode.es.js";
10
+ import { hasReachedAudioEnd as kr } from "./utils/audioCompletion.es.js";
11
+ import { PlayerKeyboardShortcutContext as wr } from "./utils/playerKeyboardShortcutContext.es.js";
12
+ import { activatePlayerKeyboardShortcutOwner as Mr, registerPlayerKeyboardShortcutOwner as Cr, isActivePlayerKeyboardShortcutOwner as Lr, getPlayerKeyboardShortcutAction as vr, shouldIgnorePlayerKeyboardShortcutEvent as Tr } from "./utils/playerKeyboardShortcuts.es.js";
13
+ import { resolveAudioPlaybackSourceType as xr } from "./utils/playbackSource.es.js";
14
+ import { shouldKeepPlayingAfterNavigation as Ar } from "./utils/playbackPreference.es.js";
15
+ import { toPlayerCustomActionList as Nr } from "./utils/playerCustomActions.es.js";
16
+ import { suppressPlayerControlsWakeAfterNavigation as $e } from "./utils/playerNavigationContext.es.js";
17
+ import { isPlaybackTimeCoveredBySegments as Ut, resolveSegmentSeekTarget as Rr } from "./utils/segmentSeek.es.js";
18
+ import { getSortedAudioSegments as Pt } from "./utils/audioSegments.es.js";
19
+ import { getSubtitleCueJumpTarget as Er, shouldClearSubtitleCueJumpTarget as Kr } from "./utils/subtitleCue.es.js";
20
20
  /* empty css */
21
- import Nr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
22
- import Er from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
23
- import Kr from "../../node_modules/lucide-react/dist/esm/icons/skip-back.es.js";
24
- import Ur from "../../node_modules/lucide-react/dist/esm/icons/skip-forward.es.js";
25
- import Fr from "../../node_modules/lucide-react/dist/esm/icons/rewind.es.js";
26
- import Pr from "../../node_modules/lucide-react/dist/esm/icons/fast-forward.es.js";
27
- import Wr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
28
- import Br from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
29
- import Or from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
30
- import Vr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
31
- const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
32
- if (typeof window > "u" || !f || Ut.has(f))
21
+ import Fr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
22
+ import Ur from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
23
+ import Pr from "../../node_modules/lucide-react/dist/esm/icons/skip-back.es.js";
24
+ import Wr from "../../node_modules/lucide-react/dist/esm/icons/skip-forward.es.js";
25
+ import Br from "../../node_modules/lucide-react/dist/esm/icons/rewind.es.js";
26
+ import Or from "../../node_modules/lucide-react/dist/esm/icons/fast-forward.es.js";
27
+ import Vr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
28
+ import Hr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
29
+ import $r from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
30
+ import Dr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
31
+ import Jr from "../../node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
32
+ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
33
+ if (typeof window > "u" || !f || Wt.has(f))
33
34
  return;
34
35
  const d = window.document.createElement("audio");
35
- d.preload = "auto", d.setAttribute("playsinline", "true"), d.src = f, d.load(), Ut.set(f, d);
36
- }, Hr = (f, d) => d !== null && d.audioList === f && d.subtitleCueLists.length === f.length && f.every((a, k) => {
37
- const w = a.element?.subtitle_cues;
36
+ d.preload = "auto", d.setAttribute("playsinline", "true"), d.src = f, d.load(), Wt.set(f, d);
37
+ }, Zr = (f, d) => d !== null && d.audioList === f && d.subtitleCueLists.length === f.length && f.every((s, k) => {
38
+ const w = s.element?.subtitle_cues;
38
39
  return d.subtitleCueLists[k] === w && d.subtitleCueLengths[k] === (w?.length ?? 0);
39
- }), Ir = (f) => {
40
+ }), jr = (f) => {
40
41
  const d = f.map(
41
- (a) => a.element?.subtitle_cues
42
+ (s) => s.element?.subtitle_cues
42
43
  );
43
44
  return {
44
45
  audioList: f,
45
46
  subtitleCueLists: d,
46
47
  subtitleCueLengths: d.map(
47
- (a) => a?.length ?? 0
48
+ (s) => s?.length ?? 0
48
49
  ),
49
- tracks: d.map((a) => ({
50
- subtitleCues: a ?? []
50
+ tracks: d.map((s) => ({
51
+ subtitleCues: s ?? []
51
52
  }))
52
53
  };
53
- }, $r = () => /* @__PURE__ */ Q(
54
+ }, zr = () => /* @__PURE__ */ X(
54
55
  "svg",
55
56
  {
56
57
  xmlns: "http://www.w3.org/2000/svg",
@@ -59,17 +60,17 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
59
60
  viewBox: "0 0 34 34",
60
61
  fill: "none",
61
62
  children: [
62
- /* @__PURE__ */ s(
63
+ /* @__PURE__ */ a(
63
64
  "path",
64
65
  {
65
66
  d: "M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",
66
67
  fill: "#0A0A0A"
67
68
  }
68
69
  ),
69
- /* @__PURE__ */ s("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
70
+ /* @__PURE__ */ a("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
70
71
  ]
71
72
  }
72
- ), Dr = () => /* @__PURE__ */ Q(
73
+ ), Yr = () => /* @__PURE__ */ X(
73
74
  "svg",
74
75
  {
75
76
  xmlns: "http://www.w3.org/2000/svg",
@@ -78,324 +79,329 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
78
79
  viewBox: "0 0 34 34",
79
80
  fill: "none",
80
81
  children: [
81
- /* @__PURE__ */ s(
82
+ /* @__PURE__ */ a(
82
83
  "path",
83
84
  {
84
85
  d: "M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",
85
86
  fill: "#0A0A0A"
86
87
  }
87
88
  ),
88
- /* @__PURE__ */ s("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
89
+ /* @__PURE__ */ a("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
89
90
  ]
90
91
  }
91
- ), $ = {
92
+ ), V = {
92
93
  fullscreen: "F",
93
94
  next: "→",
94
95
  nextSubtitle: "Shift+→",
96
+ notes: "N",
95
97
  previous: "←",
96
98
  previousSubtitle: "Shift+←",
97
99
  subtitle: "C"
98
- }, Jr = 250, Zr = (f, d) => f ? `${f} (${d})` : d, jr = ({
100
+ }, Gr = 250, Qr = (f, d) => f ? `${f} (${d})` : d, Xr = ({
99
101
  audioList: f = [],
100
102
  className: d,
101
- currentAudioIndex: a = -1,
103
+ currentAudioIndex: s = -1,
102
104
  defaultPlaying: k = !0,
103
105
  isPlaybackPaused: w = !1,
104
- isAutoAdvanceEnabled: D = !0,
106
+ isAutoAdvanceEnabled: Z = !0,
105
107
  useAutoAdvanceToggle: P = !1,
106
- onLoadingChange: Ie,
107
- onPlaybackPreferenceChange: $e,
108
- onPlaybackStarted: De,
109
- onPlaybackTimeChange: oe,
108
+ onLoadingChange: De,
109
+ onPlaybackPreferenceChange: Je,
110
+ onPlaybackStarted: Ze,
111
+ onPlaybackTimeChange: fe,
110
112
  onSubtitleToggle: ne,
111
- onPrev: fe,
112
- onNext: de,
113
- onSubtitleJump: me,
114
- canJumpToSubtitleTarget: xe,
113
+ onPrev: de,
114
+ onNext: me,
115
+ onSubtitleJump: pe,
116
+ canJumpToSubtitleTarget: Ae,
115
117
  onFullscreen: ue,
116
- isFullscreen: Je = !1,
117
- mobileViewMode: Pt = gr,
118
- settingsPortalContainer: Wt,
119
- onMobileViewModeChange: Ze,
120
- onEnded: je,
121
- onAutoAdvanceToggle: ze,
122
- onInteractionToggle: Yr,
123
- hasInteraction: Gr,
124
- isInteractionOpen: pe = !1,
125
- isSubtitleEnabled: Ae = !0,
126
- prevDisabled: Re = !1,
127
- nextDisabled: Ne = !1,
128
- showControls: Ee = !0,
129
- onControlsPointerEnter: Bt,
130
- onControlsPointerLeave: Ot,
131
- enableKeyboardShortcuts: Vt = !0,
132
- subtitleSeekRequest: V = null,
133
- customActions: Ye,
134
- customActionContext: Ge,
135
- locale: he,
136
- texts: Qe,
137
- onFocusCapture: Xe,
138
- onPointerDown: qe,
139
- ...Ke
118
+ isFullscreen: je = !1,
119
+ mobileViewMode: Ot = _r,
120
+ settingsPortalContainer: Vt,
121
+ onMobileViewModeChange: ze,
122
+ onEnded: Ye,
123
+ onAutoAdvanceToggle: Ge,
124
+ onInteractionToggle: he,
125
+ hasInteraction: Ne = !1,
126
+ isInteractionOpen: le = !1,
127
+ isSubtitleEnabled: Re = !0,
128
+ prevDisabled: Ee = !1,
129
+ nextDisabled: Ke = !1,
130
+ showControls: Fe = !0,
131
+ onControlsPointerEnter: Ht,
132
+ onControlsPointerLeave: $t,
133
+ enableKeyboardShortcuts: Dt = !0,
134
+ subtitleSeekRequest: H = null,
135
+ customActions: Qe,
136
+ customActionContext: Xe,
137
+ locale: ye,
138
+ texts: qe,
139
+ onFocusCapture: Ie,
140
+ onPointerDown: et,
141
+ ...Ue
140
142
  }) => {
141
- const Ue = Ke.dir ?? or(he), et = Ke.lang ?? fr(he), Ht = cr(), tt = ir(Sr), S = o(null), { resolvedDirection: rt, readDirection: nt } = mr(S, Ue), ye = rt === "rtl", It = dr(S, et), ut = o(pe), K = o(null), lt = o(null), U = o(0), m = o(null), ge = o(void 0), R = o([]), le = o(
142
- P ? D : k
143
- ), ae = o(!1), at = o(!1), M = o(!1), F = o(null), J = o(null), x = o(!1), c = o(!1), T = o(null), N = o(!1), Z = o(null), be = o(0), st = o(() => {
144
- }), Se = o(null), se = o(null), ct = o(null), it = o(null), W = o("unknown"), [_e, h] = Ve(k), [ot, X] = Ve(!1), [q, $t] = Ve({
143
+ const Pe = Ue.dir ?? pr(ye), tt = Ue.lang ?? hr(ye), Jt = dr(), rt = mr(wr), g = o(null), { resolvedDirection: nt, readDirection: ut } = br(g, Pe), be = nt === "rtl", Zt = yr(g, tt), lt = o(le), K = o(null), at = o(null), F = o(0), m = o(null), Se = o(void 0), N = o([]), ae = o(
144
+ P ? Z : k
145
+ ), se = o(!1), st = o(!1), M = o(!1), U = o(null), j = o(null), x = o(!1), c = o(!1), C = o(null), R = o(!1), z = o(null), ge = o(0), it = o(() => {
146
+ }), _e = o(null), ie = o(null), ct = o(null), ot = o(null), W = o("unknown"), [ke, h] = He(k), [ft, q] = He(!1), [I, jt] = He({
145
147
  next: !1,
146
148
  previous: !1
147
- }), j = tt?.ownerId ?? Ht, B = Vt && (tt?.enabled ?? !0), p = a >= 0 ? f[a] : void 0, v = p?.audioUrl, ft = p?.audioSegments, Dt = ft?.length ?? 0, E = re(
148
- () => Kt(p),
149
- [p, Dt, ft]
149
+ }), Y = rt?.ownerId ?? Jt, B = Dt && (rt?.enabled ?? !0), p = s >= 0 ? f[s] : void 0, v = p?.audioUrl, dt = p?.audioSegments, zt = dt?.length ?? 0, E = re(
150
+ () => Pt(p),
151
+ [p, zt, dt]
150
152
  );
151
- let ke = it.current;
152
- Hr(f, ke) || (ke = Ir(f), it.current = ke);
153
- const dt = ke.tracks, Fe = re(
154
- () => Lr(Ye, Ge),
155
- [Ge, Ye]
156
- ), mt = Fe.length + 6, Jt = re(
153
+ let we = ot.current;
154
+ Zr(f, we) || (we = jr(f), ot.current = we);
155
+ const mt = we.tracks, pt = re(
156
+ () => Nr(Qe, Xe),
157
+ [Xe, Qe]
158
+ ), ht = pt.length + 7, Yt = re(
157
159
  () => ({
158
- "--slide-player-mobile-control-count": String(mt)
160
+ "--slide-player-mobile-control-count": String(ht)
159
161
  }),
160
- [mt]
162
+ [ht]
161
163
  ), i = re(
162
164
  () => ({
163
- ...yr(he),
164
- ...Qe
165
+ ...gr(ye),
166
+ ...qe
165
167
  }),
166
- [he, Qe]
167
- ), Pe = re(() => p ? p.audioKey ?? `${String(p.sequenceNumber ?? "none")}:${String(p.audioUrl ?? "")}` : "none", [p]), Zt = P ? D : _e, pt = P ? D ? i.pauseAutoplayLabel : i.playAutoplayLabel : _e ? i.pauseLabel : i.playLabel, ht = Je ? i.exitFullscreenLabel : i.enterFullscreenLabel, z = r(
168
+ [ye, qe]
169
+ ), We = re(() => p ? p.audioKey ?? `${String(p.sequenceNumber ?? "none")}:${String(p.audioUrl ?? "")}` : "none", [p]), Gt = P ? Z : ke, yt = P ? Z ? i.pauseAutoplayLabel : i.playAutoplayLabel : ke ? i.pauseLabel : i.playLabel, bt = je ? i.exitFullscreenLabel : i.enterFullscreenLabel, $ = r(
168
170
  (e, t, u) => ({
169
171
  ariaKeyShortcuts: B ? u : void 0,
170
- title: B ? Zr(e, t) : e
172
+ title: B ? Qr(e, t) : e
171
173
  }),
172
174
  [B]
173
- ), yt = z(
175
+ ), St = $(
174
176
  i.subtitleToggleAriaLabel,
175
- $.subtitle,
177
+ V.subtitle,
176
178
  "c"
177
- ), gt = z(
179
+ ), gt = $(
178
180
  i.previousLabel,
179
- ye ? $.next : $.previous,
180
- ye ? "ArrowRight" : "ArrowLeft"
181
- ), bt = z(
181
+ be ? V.next : V.previous,
182
+ be ? "ArrowRight" : "ArrowLeft"
183
+ ), _t = $(
182
184
  i.previousSubtitleLabel,
183
- $.previousSubtitle,
185
+ V.previousSubtitle,
184
186
  "Shift+ArrowLeft"
185
- ), St = z(
186
- pt,
187
+ ), kt = $(
188
+ yt,
187
189
  i.playbackShortcutLabel,
188
190
  "Space"
189
- ), _t = z(
191
+ ), wt = $(
190
192
  i.nextLabel,
191
- ye ? $.previous : $.next,
192
- ye ? "ArrowLeft" : "ArrowRight"
193
- ), kt = z(
193
+ be ? V.previous : V.next,
194
+ be ? "ArrowLeft" : "ArrowRight"
195
+ ), Mt = $(
194
196
  i.nextSubtitleLabel,
195
- $.nextSubtitle,
197
+ V.nextSubtitle,
196
198
  "Shift+ArrowRight"
197
- ), wt = z(
198
- ht,
199
- $.fullscreen,
199
+ ), Ct = $(
200
+ bt,
201
+ V.fullscreen,
200
202
  "f"
201
- ), we = r(() => {
202
- B && _r(j);
203
- }, [j, B]), jt = r(
203
+ ), Lt = $(
204
+ i.notesLabel,
205
+ V.notes,
206
+ "n"
207
+ ), Me = r(() => {
208
+ B && Mr(Y);
209
+ }, [Y, B]), Qt = r(
204
210
  (e) => {
205
- we(), qe?.(e);
211
+ Me(), et?.(e);
206
212
  },
207
- [we, qe]
208
- ), zt = r(
213
+ [Me, et]
214
+ ), Xt = r(
209
215
  (e) => {
210
- we(), Xe?.(e);
216
+ Me(), Ie?.(e);
211
217
  },
212
- [we, Xe]
218
+ [Me, Ie]
213
219
  );
214
- b(() => {
215
- ge.current = p;
216
- }, [p]), b(() => {
217
- le.current = P ? D : k;
218
- }, [k, D, P]), b(() => {
219
- Ee || X(!1);
220
- }, [Ee]), b(() => {
221
- !ut.current && pe && X(!1), ut.current = pe;
222
- }, [pe]), b(() => {
223
- R.current = E;
224
- }, [E]), b(() => {
225
- const e = p?.audioUrl, t = a >= 0 ? f[a + 1]?.audioUrl : void 0;
226
- Ft(e), Ft(t);
227
- }, [f, p?.audioUrl, a]);
220
+ S(() => {
221
+ Se.current = p;
222
+ }, [p]), S(() => {
223
+ ae.current = P ? Z : k;
224
+ }, [k, Z, P]), S(() => {
225
+ Fe || q(!1);
226
+ }, [Fe]), S(() => {
227
+ !lt.current && le && q(!1), lt.current = le;
228
+ }, [le]), S(() => {
229
+ N.current = E;
230
+ }, [E]), S(() => {
231
+ const e = p?.audioUrl, t = s >= 0 ? f[s + 1]?.audioUrl : void 0;
232
+ Bt(e), Bt(t);
233
+ }, [f, p?.audioUrl, s]);
228
234
  const l = r(
229
235
  (e, t = null) => {
230
- at.current === e && (!e || t === null) || (at.current = e, Ie?.({
236
+ st.current === e && (!e || t === null) || (st.current = e, De?.({
231
237
  loading: e,
232
238
  reason: e ? t : null
233
239
  }));
234
240
  },
235
- [Ie]
241
+ [De]
236
242
  ), O = r(
237
243
  (e) => {
238
- le.current = e, $e?.(e);
244
+ ae.current = e, Je?.(e);
239
245
  },
240
- [$e]
241
- ), Y = r(() => P ? {
242
- shouldContinuePlayback: le.current
246
+ [Je]
247
+ ), G = r(() => P ? {
248
+ shouldContinuePlayback: ae.current
243
249
  } : {
244
- shouldContinuePlayback: vr({
245
- defaultPlaying: le.current,
250
+ shouldContinuePlayback: Ar({
251
+ defaultPlaying: ae.current,
246
252
  isPausedByUser: M.current
247
253
  })
248
- }, [P]), Mt = r((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), H = r(() => k && !w && !M.current && W.current !== "blocked", [k, w]), Tt = r((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Ct = r(() => {
254
+ }, [P]), vt = r((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), D = r(() => k && !w && !M.current && W.current !== "blocked", [k, w]), Tt = r((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), xt = r(() => {
249
255
  const e = m.current;
250
- return e == null || e <= 0 ? 0 : R.current.slice(0, e).reduce(
256
+ return e == null || e <= 0 ? 0 : N.current.slice(0, e).reduce(
251
257
  (t, u) => t + Math.max(Number(u.duration_ms ?? 0), 0),
252
258
  0
253
259
  ) / 1e3;
254
- }, []), G = r((e) => e <= 0 ? 0 : R.current.slice(0, e).reduce(
260
+ }, []), Q = r((e) => e <= 0 ? 0 : N.current.slice(0, e).reduce(
255
261
  (t, u) => t + Math.max(Number(u.duration_ms ?? 0), 0),
256
262
  0
257
- ), []), Me = r(
258
- (e, t) => !e || w ? !1 : e.audioUrl ? !0 : Et(
259
- Kt(e),
263
+ ), []), Ce = r(
264
+ (e, t) => !e || w ? !1 : e.audioUrl ? !0 : Ut(
265
+ Pt(e),
260
266
  t
261
267
  ),
262
268
  [w]
263
269
  ), ce = r(
264
270
  (e, t, u = {}) => {
265
- const n = Ar({
266
- currentAudioIndex: a,
271
+ const n = Er({
272
+ currentAudioIndex: s,
267
273
  currentTimeMs: t,
268
274
  direction: e,
269
275
  excludeTarget: u.excludeTarget,
270
- tracks: dt
276
+ tracks: mt
271
277
  });
272
- return !n || !Me(
278
+ return !n || !Ce(
273
279
  f[n.audioIndex],
274
280
  n.timeMs
275
- ) || n.audioIndex !== a && (!me || xe && !xe(n)) ? null : n;
281
+ ) || n.audioIndex !== s && (!pe || Ae && !Ae(n)) ? null : n;
276
282
  },
277
283
  [
278
284
  f,
279
- xe,
280
- Me,
281
- a,
282
- me,
283
- dt
285
+ Ae,
286
+ Ce,
287
+ s,
288
+ pe,
289
+ mt
284
290
  ]
285
- ), We = r(
291
+ ), Be = r(
286
292
  (e, t = !1) => {
287
293
  const u = Math.max(Number(e), 0);
288
- if (!t && Se.current !== null && Math.abs(
289
- u - Se.current
290
- ) < Jr)
294
+ if (!t && _e.current !== null && Math.abs(
295
+ u - _e.current
296
+ ) < Gr)
291
297
  return;
292
- Se.current = u;
298
+ _e.current = u;
293
299
  const n = {
294
300
  previous: ce("previous", u) !== null,
295
301
  next: ce("next", u) !== null
296
302
  };
297
- $t((g) => g.previous === n.previous && g.next === n.next ? g : n);
303
+ jt((b) => b.previous === n.previous && b.next === n.next ? b : n);
298
304
  },
299
305
  [ce]
300
306
  );
301
- b(() => {
302
- st.current = We, We(be.current, !0);
303
- }, [We]);
304
- const Te = r(() => {
305
- const e = S.current;
306
- return e ? F.current === "segment" ? G(U.current) + Math.max(e.currentTime, 0) * 1e3 : T.current !== null && e.readyState === 0 ? T.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : m.current != null ? G(m.current) : 0;
307
- }, [G]), C = r(
307
+ S(() => {
308
+ it.current = Be, Be(ge.current, !0);
309
+ }, [Be]);
310
+ const Le = r(() => {
311
+ const e = g.current;
312
+ return e ? U.current === "segment" ? Q(F.current) + Math.max(e.currentTime, 0) * 1e3 : C.current !== null && e.readyState === 0 ? C.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : m.current != null ? Q(m.current) : 0;
313
+ }, [Q]), L = r(
308
314
  (e) => {
309
315
  const t = Math.max(e, 0);
310
- be.current !== t && (be.current = t, Rr({
311
- currentAudioIndex: a,
316
+ ge.current !== t && (ge.current = t, Kr({
317
+ currentAudioIndex: s,
312
318
  currentTimeMs: t,
313
- target: se.current
314
- }) && (se.current = null), oe?.(t), st.current(t));
319
+ target: ie.current
320
+ }) && (ie.current = null), fe?.(t), it.current(t));
315
321
  },
316
- [a, oe]
322
+ [s, fe]
317
323
  ), y = r(() => {
318
- C(Te());
319
- }, [Te, C]), _ = r(() => {
320
- typeof window > "u" || Z.current === null || (window.cancelAnimationFrame(Z.current), Z.current = null);
321
- }, []), vt = r(() => {
322
- if (typeof window > "u" || Z.current !== null)
324
+ L(Le());
325
+ }, [Le, L]), _ = r(() => {
326
+ typeof window > "u" || z.current === null || (window.cancelAnimationFrame(z.current), z.current = null);
327
+ }, []), At = r(() => {
328
+ if (typeof window > "u" || z.current !== null)
323
329
  return;
324
330
  const e = () => {
325
331
  y();
326
- const t = S.current;
332
+ const t = g.current;
327
333
  if (!t || t.paused || t.ended) {
328
- Z.current = null;
334
+ z.current = null;
329
335
  return;
330
336
  }
331
- Z.current = window.requestAnimationFrame(e);
337
+ z.current = window.requestAnimationFrame(e);
332
338
  };
333
- Z.current = window.requestAnimationFrame(e);
339
+ z.current = window.requestAnimationFrame(e);
334
340
  }, [y]), ee = r(() => {
335
- const e = S.current;
336
- e && (_(), c.current = !1, M.current = !1, ae.current = !1, F.current = null, T.current = null, x.current = !1, N.current = !1, J.current = null, e.pause(), e.removeAttribute("src"), e.load(), K.current = null, U.current = 0, m.current = null, C(0), h(!1), l(!1));
337
- }, [C, _, l]), L = r(
341
+ const e = g.current;
342
+ e && (_(), c.current = !1, M.current = !1, se.current = !1, U.current = null, C.current = null, x.current = !1, R.current = !1, j.current = null, e.pause(), e.removeAttribute("src"), e.load(), K.current = null, F.current = 0, m.current = null, L(0), h(!1), l(!1));
343
+ }, [L, _, l]), T = r(
338
344
  (e) => {
339
- const t = S.current;
345
+ const t = g.current;
340
346
  if (!t)
341
347
  return !1;
342
348
  const u = t.play();
343
349
  return u && typeof u.then == "function" && u.then(() => {
344
- W.current === "unknown" && (W.current = "auto"), c.current = !1, N.current = !1;
350
+ W.current === "unknown" && (W.current = "auto"), c.current = !1, R.current = !1;
345
351
  }).catch((n) => {
346
- W.current === "unknown" && Mt(n) && (W.current = "blocked", c.current = !1, l(!1)), N.current = !1, h(!1);
352
+ W.current === "unknown" && vt(n) && (W.current = "blocked", c.current = !1, l(!1)), R.current = !1, h(!1);
347
353
  }), !0;
348
354
  },
349
- [Mt, l]
355
+ [vt, l]
350
356
  ), A = r(
351
357
  (e, t, u = {}) => {
352
- const n = S.current, g = R.current[e];
353
- if (!n || !g)
358
+ const n = g.current, b = N.current[e];
359
+ if (!n || !b)
354
360
  return !1;
355
- const I = Tt(g.audio_data), Le = Math.max(
361
+ const J = Tt(b.audio_data), xe = Math.max(
356
362
  Number(u.seekTimeSeconds ?? 0),
357
363
  0
358
364
  );
359
- U.current = e, m.current = null, x.current = !1, N.current = !0, J.current = "segment", C(
360
- G(e) + Le * 1e3
365
+ F.current = e, m.current = null, x.current = !1, R.current = !0, j.current = "segment", L(
366
+ Q(e) + xe * 1e3
361
367
  );
362
- const Rt = u.shouldResume ?? H();
363
- c.current = Rt, l(!1);
364
- const lr = K.current !== I;
365
- return F.current = "segment", lr && (n.pause(), n.removeAttribute("src"), n.load(), K.current = I, n.src = I, n.load()), T.current = Le, n.readyState > 0 && (n.currentTime = Le, T.current = null), Rt ? L(`start-segment:${t}`) : (c.current = !1, N.current = !1, n.pause(), h(!1), !0);
368
+ const Kt = u.shouldResume ?? D();
369
+ c.current = Kt, l(!1);
370
+ const ir = K.current !== J;
371
+ return U.current = "segment", ir && (n.pause(), n.removeAttribute("src"), n.load(), K.current = J, n.src = J, n.load()), C.current = xe, n.readyState > 0 && (n.currentTime = xe, C.current = null), Kt ? T(`start-segment:${t}`) : (c.current = !1, R.current = !1, n.pause(), h(!1), !0);
366
372
  },
367
373
  [
368
- H,
374
+ D,
369
375
  Tt,
370
- G,
371
- C,
376
+ Q,
372
377
  L,
378
+ T,
373
379
  l
374
380
  ]
375
- ), Ce = r(
381
+ ), ve = r(
376
382
  (e) => {
377
- const t = S.current;
383
+ const t = g.current;
378
384
  if (!t || !p || w)
379
385
  return !1;
380
- const u = Math.max(Number(e), 0), n = !t.paused && !t.ended || c.current || N.current || m.current !== null && le.current && !M.current, g = Et(
381
- R.current,
386
+ const u = Math.max(Number(e), 0), n = !t.paused && !t.ended || c.current || R.current || m.current !== null && ae.current && !M.current, b = Ut(
387
+ N.current,
382
388
  u
383
- ) ? xr(
384
- R.current,
389
+ ) ? Rr(
390
+ N.current,
385
391
  u
386
392
  ) : null;
387
- if (Se.current = null, _(), c.current = n, l(!1), n && (W.current = "manual", M.current = !1, O(!0)), g && (F.current === "segment" || !v))
393
+ if (_e.current = null, _(), c.current = n, l(!1), n && (W.current = "manual", M.current = !1, O(!0)), b && (U.current === "segment" || !v))
388
394
  return A(
389
- g.segmentIndex,
395
+ b.segmentIndex,
390
396
  "subtitle-seek-segment",
391
397
  {
392
- seekTimeSeconds: g.segmentTimeSeconds,
398
+ seekTimeSeconds: b.segmentTimeSeconds,
393
399
  shouldResume: n
394
400
  }
395
401
  );
396
402
  if (v) {
397
- const I = u / 1e3;
398
- return K.current !== v && (t.pause(), t.removeAttribute("src"), t.load(), K.current = v, F.current = "url", J.current = "url", t.src = v, t.load()), T.current = I, C(u), t.readyState > 0 && (t.currentTime = I, T.current = null), n ? L("subtitle-seek-url") : (c.current = !1, t.pause(), h(!1), !0);
403
+ const J = u / 1e3;
404
+ return K.current !== v && (t.pause(), t.removeAttribute("src"), t.load(), K.current = v, U.current = "url", j.current = "url", t.src = v, t.load()), C.current = J, L(u), t.readyState > 0 && (t.currentTime = J, C.current = null), n ? T("subtitle-seek-url") : (c.current = !1, t.pause(), h(!1), !0);
399
405
  }
400
406
  return !1;
401
407
  },
@@ -403,131 +409,131 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
403
409
  p,
404
410
  v,
405
411
  w,
406
- C,
412
+ L,
407
413
  A,
408
414
  _,
409
- L,
415
+ T,
410
416
  l,
411
417
  O
412
418
  ]
413
- ), ie = r(
419
+ ), oe = r(
414
420
  (e) => {
415
421
  const t = ce(
416
422
  e,
417
- Te(),
423
+ Le(),
418
424
  {
419
- excludeTarget: e === "previous" ? se.current : null
425
+ excludeTarget: e === "previous" ? ie.current : null
420
426
  }
421
427
  );
422
428
  if (t === null)
423
429
  return !1;
424
- if (t.audioIndex === a) {
425
- const n = Ce(t.timeMs);
426
- return n && (se.current = t), n;
430
+ if (t.audioIndex === s) {
431
+ const n = ve(t.timeMs);
432
+ return n && (ie.current = t), n;
427
433
  }
428
- const u = !!me?.(
434
+ const u = !!pe?.(
429
435
  t,
430
- He(Y())
436
+ $e(G())
431
437
  );
432
- return u && (se.current = t), u;
438
+ return u && (ie.current = t), u;
433
439
  },
434
440
  [
435
- a,
436
- Te,
437
- Y,
441
+ s,
442
+ Le,
443
+ G,
438
444
  ce,
439
- me,
440
- Ce
445
+ pe,
446
+ ve
441
447
  ]
442
448
  ), te = r(
443
449
  (e) => {
444
- _(), c.current = !1, x.current = !1, N.current = !1, y(), h(!1), l(!1), a >= 0 && je?.(a);
450
+ _(), c.current = !1, x.current = !1, R.current = !1, y(), h(!1), l(!1), s >= 0 && Ye?.(s);
445
451
  },
446
452
  [
447
- a,
448
- je,
453
+ s,
454
+ Ye,
449
455
  _,
450
456
  y,
451
457
  l
452
458
  ]
453
- ), ve = r(
459
+ ), Te = r(
454
460
  (e) => {
455
- const t = S.current;
456
- return !t || F.current !== "url" || !br({
461
+ const t = g.current;
462
+ return !t || U.current !== "url" || !kr({
457
463
  currentTimeSeconds: Math.max(t.currentTime, 0),
458
464
  durationSeconds: t.duration
459
465
  }) ? !1 : (c.current = !1, t.pause(), te(e), !0);
460
466
  },
461
467
  [te]
462
- ), Lt = r(() => {
463
- const e = U.current + 1, t = R.current, u = t[e], n = ge.current, g = t.some((I) => I.is_final);
468
+ ), Nt = r(() => {
469
+ const e = F.current + 1, t = N.current, u = t[e], n = Se.current, b = t.some((J) => J.is_final);
464
470
  if (u) {
465
471
  A(e, "ended");
466
472
  return;
467
473
  }
468
- if (n?.isAudioStreaming || !g) {
469
- U.current = e, m.current = e, x.current = !0, c.current = k, C(G(e)), h(!1), l(!0, "waitingForMoreAudio");
474
+ if (n?.isAudioStreaming || !b) {
475
+ F.current = e, m.current = e, x.current = !0, c.current = k, L(Q(e)), h(!1), l(!0, "waitingForMoreAudio");
470
476
  return;
471
477
  }
472
478
  te("segments-completed");
473
479
  }, [
474
480
  k,
475
481
  te,
476
- G,
477
- C,
482
+ Q,
483
+ L,
478
484
  A,
479
485
  l
480
486
  ]);
481
- b(() => {
482
- if (lt.current === Pe)
487
+ S(() => {
488
+ if (at.current === We)
483
489
  return;
484
- lt.current = Pe, U.current = 0, m.current = null, x.current = !1, M.current = !1, ae.current = !1, c.current = !1, N.current = !1, F.current = null, J.current = null, K.current = null, _(), C(0), l(!1);
485
- const e = S.current;
490
+ at.current = We, F.current = 0, m.current = null, x.current = !1, M.current = !1, se.current = !1, c.current = !1, R.current = !1, U.current = null, j.current = null, K.current = null, _(), L(0), l(!1);
491
+ const e = g.current;
486
492
  e && (e.pause(), e.removeAttribute("src"), e.load(), h(!1));
487
493
  }, [
488
- a,
489
- Pe,
494
+ s,
495
+ We,
490
496
  E.length,
491
497
  v,
492
- C,
498
+ L,
493
499
  _,
494
500
  l
495
- ]), b(() => {
496
- const e = S.current;
501
+ ]), S(() => {
502
+ const e = g.current;
497
503
  if (e) {
498
504
  if (w) {
499
- ae.current = !!(ge.current && !M.current && (!e.paused || c.current || m.current !== null)), c.current = !1, l(!1), e.pause(), h(!1);
505
+ se.current = !!(Se.current && !M.current && (!e.paused || c.current || m.current !== null)), c.current = !1, l(!1), e.pause(), h(!1);
500
506
  return;
501
507
  }
502
- if (!(!ae.current || !ge.current || M.current)) {
503
- if (ae.current = !1, m.current !== null) {
504
- if (m.current < R.current.length) {
508
+ if (!(!se.current || !Se.current || M.current)) {
509
+ if (se.current = !1, m.current !== null) {
510
+ if (m.current < N.current.length) {
505
511
  A(m.current, "external-resume");
506
512
  return;
507
513
  }
508
514
  c.current = !0, l(!0, "waitingForMoreAudio");
509
515
  return;
510
516
  }
511
- if (!K.current && R.current.length > 0) {
517
+ if (!K.current && N.current.length > 0) {
512
518
  A(
513
519
  Math.min(
514
- U.current,
515
- R.current.length - 1
520
+ F.current,
521
+ N.current.length - 1
516
522
  ),
517
523
  "external-resume-init"
518
524
  );
519
525
  return;
520
526
  }
521
- e.paused && (c.current = !0, L("external-resume"));
527
+ e.paused && (c.current = !0, T("external-resume"));
522
528
  }
523
529
  }
524
530
  }, [
525
531
  w,
526
532
  A,
527
- L,
533
+ T,
528
534
  l
529
- ]), b(() => {
530
- const e = S.current;
535
+ ]), S(() => {
536
+ const e = g.current;
531
537
  if (!e)
532
538
  return;
533
539
  if (!p) {
@@ -538,24 +544,24 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
538
544
  c.current = !1, l(!1), e.pause(), h(!1);
539
545
  return;
540
546
  }
541
- const t = Cr({
542
- activeSourceType: F.current,
547
+ const t = xr({
548
+ activeSourceType: U.current,
543
549
  hasAudioUrl: !!v,
544
550
  segmentCount: E.length,
545
- preferredSourceType: J.current,
551
+ preferredSourceType: j.current,
546
552
  waitingSegmentIndex: m.current
547
553
  });
548
- if (t && J.current !== t && (J.current = t), t === "url" && v) {
549
- const u = K.current !== v, n = H();
554
+ if (t && j.current !== t && (j.current = t), t === "url" && v) {
555
+ const u = K.current !== v, n = D();
550
556
  if (u) {
551
- const g = m.current !== null ? Ct() : 0;
552
- e.pause(), e.removeAttribute("src"), e.load(), K.current = v, F.current = "url", e.src = v, e.load(), T.current = g, C(g * 1e3), e.readyState > 0 && (e.currentTime = g, T.current = null);
557
+ const b = m.current !== null ? xt() : 0;
558
+ e.pause(), e.removeAttribute("src"), e.load(), K.current = v, U.current = "url", e.src = v, e.load(), C.current = b, L(b * 1e3), e.readyState > 0 && (e.currentTime = b, C.current = null);
553
559
  }
554
- if (c.current = n, x.current = !1, N.current = !1, l(!1), !n) {
560
+ if (c.current = n, x.current = !1, R.current = !1, l(!1), !n) {
555
561
  c.current = !1, e.pause(), h(!1);
556
562
  return;
557
563
  }
558
- L(u ? "sync-url-init" : "sync-url");
564
+ T(u ? "sync-url-init" : "sync-url");
559
565
  return;
560
566
  }
561
567
  if (t === "segment" && m.current !== null) {
@@ -567,12 +573,12 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
567
573
  A(m.current, "wait-resume");
568
574
  return;
569
575
  }
570
- x.current = !0, c.current = H(), h(!1), l(H());
576
+ x.current = !0, c.current = D(), h(!1), l(D());
571
577
  return;
572
578
  }
573
579
  if (t === "segment" && !E.length) {
574
580
  if (p.isAudioStreaming) {
575
- m.current = U.current, x.current = !0, c.current = H(), h(!1), l(H());
581
+ m.current = F.current, x.current = !0, c.current = D(), h(!1), l(D());
576
582
  return;
577
583
  }
578
584
  ee();
@@ -581,7 +587,7 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
581
587
  if (t === "segment" && !K.current) {
582
588
  A(
583
589
  Math.min(
584
- U.current,
590
+ F.current,
585
591
  E.length - 1
586
592
  ),
587
593
  "effect-init"
@@ -596,195 +602,198 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
596
602
  c.current = !1, e.pause(), h(!1);
597
603
  return;
598
604
  }
599
- e.paused && (c.current = !0, L("sync-paused-retry"));
605
+ e.paused && (c.current = !0, T("sync-paused-retry"));
600
606
  }, [
601
607
  p,
602
- a,
608
+ s,
603
609
  E,
604
610
  v,
605
611
  k,
606
612
  w,
607
- H,
608
- C,
613
+ D,
614
+ L,
609
615
  ee,
610
616
  A,
611
- L,
612
- Ct,
617
+ T,
618
+ xt,
613
619
  l
614
- ]), b(() => {
615
- if (!V || V.id === ct.current || V.audioIndex !== a)
620
+ ]), S(() => {
621
+ if (!H || H.id === ct.current || H.audioIndex !== s)
616
622
  return;
617
- const e = f[V.audioIndex];
618
- Me(e, V.timeMs) && (ct.current = V.id, Ce(V.timeMs));
623
+ const e = f[H.audioIndex];
624
+ Ce(e, H.timeMs) && (ct.current = H.id, ve(H.timeMs));
619
625
  }, [
620
626
  f,
621
- Me,
622
- a,
623
627
  Ce,
624
- V
625
- ]), b(() => ee, [ee]), b(() => _, [_]);
626
- const Yt = r(() => {
627
- y(), vt(), h(!0), l(!1), De?.();
628
+ s,
629
+ ve,
630
+ H
631
+ ]), S(() => ee, [ee]), S(() => _, [_]);
632
+ const qt = r(() => {
633
+ y(), At(), h(!0), l(!1), Ze?.();
628
634
  }, [
629
- De,
630
- vt,
635
+ Ze,
636
+ At,
631
637
  y,
632
638
  l
633
- ]), Gt = r(() => {
634
- x.current || N.current || (_(), y(), h(!1));
635
- }, [a, _, y]), Qt = r(() => {
636
- const e = S.current;
637
- e && T.current !== null && (e.currentTime = T.current, T.current = null), y(), !ve("canplay-seek-finished") && (!c.current || !k || L("canplay"));
639
+ ]), It = r(() => {
640
+ x.current || R.current || (_(), y(), h(!1));
641
+ }, [s, _, y]), er = r(() => {
642
+ const e = g.current;
643
+ e && C.current !== null && (e.currentTime = C.current, C.current = null), y(), !Te("canplay-seek-finished") && (!c.current || !k || T("canplay"));
638
644
  }, [
639
- a,
645
+ s,
640
646
  k,
641
- ve,
647
+ Te,
642
648
  y,
643
- L
644
- ]), Xt = r(() => {
645
- const e = S.current;
646
- e && T.current !== null && (e.currentTime = T.current, T.current = null), y(), ve("metadata-seek-finished");
647
- }, [a, ve, y]), qt = r(() => {
649
+ T
650
+ ]), tr = r(() => {
651
+ const e = g.current;
652
+ e && C.current !== null && (e.currentTime = C.current, C.current = null), y(), Te("metadata-seek-finished");
653
+ }, [s, Te, y]), rr = r(() => {
648
654
  y();
649
- }, [y]), er = r(() => {
655
+ }, [y]), nr = r(() => {
650
656
  x.current || l(!0, "loadingAudio");
651
- }, [l]), tr = r(() => {
657
+ }, [l]), ur = r(() => {
652
658
  if (x.current) {
653
659
  l(!0, "waitingForMoreAudio");
654
660
  return;
655
661
  }
656
662
  l(!0, "loadingAudio");
657
- }, [l]), xt = r(() => {
663
+ }, [l]), Rt = r(() => {
658
664
  y();
659
- }, [y]), rr = r(() => {
660
- const e = F.current === "url" || R.current.length === 0;
661
- if (_(), N.current = !1, e) {
665
+ }, [y]), lr = r(() => {
666
+ const e = U.current === "url" || N.current.length === 0;
667
+ if (_(), R.current = !1, e) {
662
668
  te("url-ended");
663
669
  return;
664
670
  }
665
- Lt();
666
- }, [te, Lt, _]), nr = r(() => {
671
+ Nt();
672
+ }, [te, Nt, _]), ar = r(() => {
667
673
  _(), y(), h(!1), l(!1);
668
- }, [_, y, l]), ur = r(
674
+ }, [_, y, l]), sr = r(
669
675
  (e) => {
670
- Ze?.(e), X(!1);
676
+ ze?.(e), q(!1);
671
677
  },
672
- [Ze]
673
- ), Be = r(() => {
678
+ [ze]
679
+ ), Oe = r(() => {
674
680
  if (P) {
675
- const t = !D;
676
- return O(t), ze?.(t), !0;
681
+ const t = !Z;
682
+ return O(t), Ge?.(t), !0;
677
683
  }
678
- const e = S.current;
679
- return w || !e || !p ? !1 : m.current !== null ? _e ? (O(!1), c.current = !1, M.current = !0, m.current = null, x.current = !1, h(!1), l(!1), e.pause(), !0) : (O(!0), W.current = "manual", M.current = !1, c.current = !0, l(!0, "waitingForMoreAudio"), !0) : !e.src && E.length > 0 ? (O(!0), W.current = "manual", M.current = !1, A(
684
+ const e = g.current;
685
+ return w || !e || !p ? !1 : m.current !== null ? ke ? (O(!1), c.current = !1, M.current = !0, m.current = null, x.current = !1, h(!1), l(!1), e.pause(), !0) : (O(!0), W.current = "manual", M.current = !1, c.current = !0, l(!0, "waitingForMoreAudio"), !0) : !e.src && E.length > 0 ? (O(!0), W.current = "manual", M.current = !1, A(
680
686
  Math.min(
681
- U.current,
687
+ F.current,
682
688
  E.length - 1
683
689
  ),
684
690
  "toggle"
685
- ), !0) : e.paused ? (O(!0), W.current = "manual", M.current = !1, c.current = !0, L("toggle-resume"), !0) : (O(!1), c.current = !1, M.current = !0, e.pause(), !0);
691
+ ), !0) : e.paused ? (O(!0), W.current = "manual", M.current = !1, c.current = !0, T("toggle-resume"), !0) : (O(!1), c.current = !1, M.current = !0, e.pause(), !0);
686
692
  }, [
687
693
  p,
688
694
  E.length,
689
- D,
695
+ Z,
690
696
  w,
691
- _e,
692
- ze,
697
+ ke,
698
+ Ge,
693
699
  A,
694
- L,
700
+ T,
695
701
  l,
696
702
  O,
697
703
  P
698
704
  ]);
699
- b(() => {
705
+ S(() => {
700
706
  if (B)
701
- return kr(j);
702
- }, [j, B]);
703
- const Oe = re(
707
+ return Cr(Y);
708
+ }, [Y, B]);
709
+ const Ve = re(
704
710
  () => ({
705
711
  fullscreen: () => ue ? (ue(), !0) : !1,
706
- next: () => de ? (Ne || de(
707
- He(Y())
712
+ interaction: () => he ? (Ne && he(), !0) : !1,
713
+ next: () => me ? (Ke || me(
714
+ $e(G())
708
715
  ), !0) : !1,
709
- nextSubtitle: () => q.next ? ie("next") : !0,
710
- previous: () => fe ? (Re || fe(
711
- He(Y())
716
+ nextSubtitle: () => I.next ? oe("next") : !0,
717
+ previous: () => de ? (Ee || de(
718
+ $e(G())
712
719
  ), !0) : !1,
713
- previousSubtitle: () => q.previous ? ie("previous") : !0,
720
+ previousSubtitle: () => I.previous ? oe("previous") : !0,
714
721
  subtitle: () => ne ? (ne(), !0) : !1,
715
- togglePlayback: () => (Be(), !0)
722
+ togglePlayback: () => (Oe(), !0)
716
723
  }),
717
724
  [
718
- Y,
719
- ie,
725
+ G,
720
726
  Ne,
727
+ oe,
728
+ Ke,
721
729
  ue,
730
+ he,
731
+ me,
722
732
  de,
723
- fe,
724
733
  ne,
725
- Re,
726
- q.next,
727
- q.previous,
728
- Be
734
+ Ee,
735
+ I.next,
736
+ I.previous,
737
+ Oe
729
738
  ]
730
- ), At = o(Oe);
731
- return b(() => {
732
- At.current = Oe;
733
- }, [Oe]), b(() => {
739
+ ), Et = o(Ve);
740
+ return S(() => {
741
+ Et.current = Ve;
742
+ }, [Ve]), S(() => {
734
743
  if (!B || typeof document > "u")
735
744
  return;
736
745
  const e = (t) => {
737
- if (!wr(j))
746
+ if (!Lr(Y))
738
747
  return;
739
- const u = Mr(t, nt());
748
+ const u = vr(t, ut());
740
749
  if (!u || Tr(t, u))
741
750
  return;
742
751
  let n = !1;
743
- const g = At.current[u];
744
- n = g(), n && t.preventDefault();
752
+ const b = Et.current[u];
753
+ n = b(), n && t.preventDefault();
745
754
  };
746
755
  return document.addEventListener("keydown", e), () => {
747
756
  document.removeEventListener("keydown", e);
748
757
  };
749
- }, [j, nt, B]), b(() => {
750
- oe?.(be.current);
751
- }, [oe]), /* @__PURE__ */ Q(
758
+ }, [Y, ut, B]), S(() => {
759
+ fe?.(ge.current);
760
+ }, [fe]), /* @__PURE__ */ X(
752
761
  "div",
753
762
  {
754
- ...Ke,
755
- dir: Ue,
756
- lang: et,
757
- "data-slide-player-shortcut-owner": j,
758
- className: pr("slide-player", d),
759
- onFocusCapture: zt,
760
- onPointerDown: jt,
763
+ ...Ue,
764
+ dir: Pe,
765
+ lang: tt,
766
+ "data-slide-player-shortcut-owner": Y,
767
+ className: Ft("slide-player", d),
768
+ onFocusCapture: Xt,
769
+ onPointerDown: Qt,
761
770
  children: [
762
- /* @__PURE__ */ s(
771
+ /* @__PURE__ */ a(
763
772
  "audio",
764
773
  {
765
- ref: S,
774
+ ref: g,
766
775
  preload: "auto",
767
776
  playsInline: !0,
768
- onLoadStart: er,
769
- onLoadedMetadata: Xt,
770
- onCanPlay: Qt,
771
- onPlay: Yt,
772
- onPause: Gt,
773
- onWaiting: tr,
774
- onSeeking: xt,
775
- onSeeked: xt,
776
- onTimeUpdate: qt,
777
- onEnded: rr,
778
- onError: nr
777
+ onLoadStart: nr,
778
+ onLoadedMetadata: tr,
779
+ onCanPlay: er,
780
+ onPlay: qt,
781
+ onPause: It,
782
+ onWaiting: ur,
783
+ onSeeking: Rt,
784
+ onSeeked: Rt,
785
+ onTimeUpdate: rr,
786
+ onEnded: lr,
787
+ onError: ar
779
788
  }
780
789
  ),
781
- Ee ? /* @__PURE__ */ Q(Nt, { children: [
782
- /* @__PURE__ */ s(
783
- hr,
790
+ Fe ? /* @__PURE__ */ X(cr, { children: [
791
+ /* @__PURE__ */ a(
792
+ Sr,
784
793
  {
785
- container: Wt,
786
- dir: Ue ?? rt,
787
- lang: It,
794
+ container: Vt,
795
+ dir: Pe ?? nt,
796
+ lang: Zt,
788
797
  labels: {
789
798
  closeSettings: i.closeSettingsLabel,
790
799
  fullscreen: i.fullscreenLabel,
@@ -795,38 +804,38 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
795
804
  subtitleToggle: i.subtitleToggleAriaLabel,
796
805
  title: i.settingsTitle
797
806
  },
798
- isSubtitleEnabled: Ae,
799
- onClose: () => X(!1),
800
- onOpenChange: X,
807
+ isSubtitleEnabled: Re,
808
+ onClose: () => q(!1),
809
+ onOpenChange: q,
801
810
  onSubtitleToggle: ne ?? (() => {
802
811
  }),
803
- onViewModeChange: ur,
804
- open: ot,
805
- viewMode: Pt
812
+ onViewModeChange: sr,
813
+ open: ft,
814
+ viewMode: Ot
806
815
  }
807
816
  ),
808
- /* @__PURE__ */ Q(
817
+ /* @__PURE__ */ X(
809
818
  "div",
810
819
  {
811
820
  className: "slide-player__controls",
812
- onPointerEnter: Bt,
813
- onPointerLeave: Ot,
814
- style: Jt,
821
+ onPointerEnter: Ht,
822
+ onPointerLeave: $t,
823
+ style: Yt,
815
824
  children: [
816
- /* @__PURE__ */ Q("div", { className: "slide-player__group", children: [
817
- /* @__PURE__ */ s(
825
+ /* @__PURE__ */ X("div", { className: "slide-player__group", children: [
826
+ /* @__PURE__ */ a(
818
827
  "button",
819
828
  {
820
- "aria-expanded": ot,
829
+ "aria-expanded": ft,
821
830
  "aria-haspopup": "dialog",
822
831
  "aria-label": i.moreOptionsAriaLabel,
823
832
  className: "slide-player__action slide-player__action--mobile-more",
824
833
  onClick: () => {
825
- X((e) => !e);
834
+ q((e) => !e);
826
835
  },
827
836
  type: "button",
828
- children: /* @__PURE__ */ s(
829
- Nr,
837
+ children: /* @__PURE__ */ a(
838
+ Fr,
830
839
  {
831
840
  className: "slide-player__icon",
832
841
  strokeWidth: 2.25
@@ -834,58 +843,58 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
834
843
  )
835
844
  }
836
845
  ),
837
- /* @__PURE__ */ s(
846
+ /* @__PURE__ */ a(
838
847
  "button",
839
848
  {
840
849
  "aria-label": i.volumeAriaLabel,
841
850
  className: "hidden",
842
851
  type: "button",
843
- children: /* @__PURE__ */ s(Er, { className: "slide-player__icon", strokeWidth: 2.25 })
852
+ children: /* @__PURE__ */ a(Ur, { className: "slide-player__icon", strokeWidth: 2.25 })
844
853
  }
845
854
  ),
846
- /* @__PURE__ */ s(
855
+ /* @__PURE__ */ a(
847
856
  "button",
848
857
  {
849
- "aria-label": pt,
850
- "aria-keyshortcuts": St.ariaKeyShortcuts,
858
+ "aria-label": yt,
859
+ "aria-keyshortcuts": kt.ariaKeyShortcuts,
851
860
  className: "slide-player__toggle slide-player__toggle--playback",
852
861
  onClick: () => {
853
- Be();
862
+ Oe();
854
863
  },
855
- title: St.title,
864
+ title: kt.title,
856
865
  type: "button",
857
- children: Zt ? /* @__PURE__ */ s($r, {}) : /* @__PURE__ */ s(Dr, {})
866
+ children: Gt ? /* @__PURE__ */ a(zr, {}) : /* @__PURE__ */ a(Yr, {})
858
867
  }
859
868
  ),
860
- /* @__PURE__ */ s(
869
+ /* @__PURE__ */ a(
861
870
  "button",
862
871
  {
863
872
  "aria-keyshortcuts": gt.ariaKeyShortcuts,
864
873
  "aria-label": i.previousLabel,
865
874
  className: "slide-player__action slide-player__action--prev",
866
- disabled: Re,
875
+ disabled: Ee,
867
876
  onClick: () => {
868
- fe?.(Y());
877
+ de?.(G());
869
878
  },
870
879
  title: gt.title,
871
880
  type: "button",
872
- children: /* @__PURE__ */ s(Kr, { className: "slide-player__icon", strokeWidth: 2.25 })
881
+ children: /* @__PURE__ */ a(Pr, { className: "slide-player__icon", strokeWidth: 2.25 })
873
882
  }
874
883
  ),
875
- /* @__PURE__ */ s(
884
+ /* @__PURE__ */ a(
876
885
  "button",
877
886
  {
878
- "aria-keyshortcuts": _t.ariaKeyShortcuts,
887
+ "aria-keyshortcuts": wt.ariaKeyShortcuts,
879
888
  "aria-label": i.nextLabel,
880
889
  className: "slide-player__action slide-player__action--next",
881
- disabled: Ne,
890
+ disabled: Ke,
882
891
  onClick: () => {
883
- de?.(Y());
892
+ me?.(G());
884
893
  },
885
- title: _t.title,
894
+ title: wt.title,
886
895
  type: "button",
887
- children: /* @__PURE__ */ s(
888
- Ur,
896
+ children: /* @__PURE__ */ a(
897
+ Wr,
889
898
  {
890
899
  className: "slide-player__icon",
891
900
  strokeWidth: 2.25
@@ -893,35 +902,35 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
893
902
  )
894
903
  }
895
904
  ),
896
- /* @__PURE__ */ s(
905
+ /* @__PURE__ */ a(
897
906
  "button",
898
907
  {
899
- "aria-keyshortcuts": bt.ariaKeyShortcuts,
908
+ "aria-keyshortcuts": _t.ariaKeyShortcuts,
900
909
  "aria-label": i.previousSubtitleLabel,
901
910
  className: "slide-player__action slide-player__action--prev-subtitle",
902
- disabled: !q.previous,
911
+ disabled: !I.previous,
903
912
  onClick: () => {
904
- ie("previous");
913
+ oe("previous");
905
914
  },
906
- title: bt.title,
915
+ title: _t.title,
907
916
  type: "button",
908
- children: /* @__PURE__ */ s(Fr, { className: "slide-player__icon", strokeWidth: 2.25 })
917
+ children: /* @__PURE__ */ a(Br, { className: "slide-player__icon", strokeWidth: 2.25 })
909
918
  }
910
919
  ),
911
- /* @__PURE__ */ s(
920
+ /* @__PURE__ */ a(
912
921
  "button",
913
922
  {
914
- "aria-keyshortcuts": kt.ariaKeyShortcuts,
923
+ "aria-keyshortcuts": Mt.ariaKeyShortcuts,
915
924
  "aria-label": i.nextSubtitleLabel,
916
925
  className: "slide-player__action slide-player__action--next-subtitle",
917
- disabled: !q.next,
926
+ disabled: !I.next,
918
927
  onClick: () => {
919
- ie("next");
928
+ oe("next");
920
929
  },
921
- title: kt.title,
930
+ title: Mt.title,
922
931
  type: "button",
923
- children: /* @__PURE__ */ s(
924
- Pr,
932
+ children: /* @__PURE__ */ a(
933
+ Or,
925
934
  {
926
935
  className: "slide-player__icon",
927
936
  strokeWidth: 2.25
@@ -929,18 +938,18 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
929
938
  )
930
939
  }
931
940
  ),
932
- /* @__PURE__ */ s(
941
+ /* @__PURE__ */ a(
933
942
  "button",
934
943
  {
935
944
  "aria-label": i.subtitleToggleAriaLabel,
936
- "aria-keyshortcuts": yt.ariaKeyShortcuts,
937
- "aria-pressed": Ae,
945
+ "aria-keyshortcuts": St.ariaKeyShortcuts,
946
+ "aria-pressed": Re,
938
947
  className: "slide-player__action slide-player__action--subtitle",
939
948
  onClick: ne,
940
- title: yt.title,
949
+ title: St.title,
941
950
  type: "button",
942
- children: Ae ? /* @__PURE__ */ s(Wr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ s(
943
- Br,
951
+ children: Re ? /* @__PURE__ */ a(Vr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ a(
952
+ Hr,
944
953
  {
945
954
  className: "slide-player__icon",
946
955
  strokeWidth: 2.25
@@ -948,23 +957,23 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
948
957
  )
949
958
  }
950
959
  ),
951
- ue ? /* @__PURE__ */ s(
960
+ ue ? /* @__PURE__ */ a(
952
961
  "button",
953
962
  {
954
- "aria-label": ht,
955
- "aria-keyshortcuts": wt.ariaKeyShortcuts,
963
+ "aria-label": bt,
964
+ "aria-keyshortcuts": Ct.ariaKeyShortcuts,
956
965
  className: "slide-player__action slide-player__action--fullscreen",
957
966
  onClick: ue,
958
- title: wt.title,
967
+ title: Ct.title,
959
968
  type: "button",
960
- children: Je ? /* @__PURE__ */ s(
961
- Or,
969
+ children: je ? /* @__PURE__ */ a(
970
+ $r,
962
971
  {
963
972
  className: "slide-player__icon",
964
973
  strokeWidth: 2.25
965
974
  }
966
- ) : /* @__PURE__ */ s(
967
- Vr,
975
+ ) : /* @__PURE__ */ a(
976
+ Dr,
968
977
  {
969
978
  className: "slide-player__icon",
970
979
  strokeWidth: 2.25
@@ -973,10 +982,32 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
973
982
  }
974
983
  ) : null
975
984
  ] }),
976
- Fe.length > 0 ? /* @__PURE__ */ Q(Nt, { children: [
977
- /* @__PURE__ */ s("div", { className: "slide-player__separator" }),
978
- /* @__PURE__ */ s("div", { className: "slide-player__group slide-player__group--custom-actions", children: Fe.map((e, t) => /* @__PURE__ */ s(ar.Fragment, { children: e }, `custom-action-${t}`)) })
979
- ] }) : null
985
+ /* @__PURE__ */ a("div", { className: "slide-player__separator" }),
986
+ /* @__PURE__ */ X("div", { className: "slide-player__group", children: [
987
+ pt.map((e, t) => /* @__PURE__ */ a(or.Fragment, { children: e }, `custom-action-${t}`)),
988
+ /* @__PURE__ */ a(
989
+ "button",
990
+ {
991
+ "aria-label": i.notesLabel,
992
+ "aria-keyshortcuts": Lt.ariaKeyShortcuts,
993
+ className: Ft(
994
+ "slide-player__action slide-player__action--notes",
995
+ le && "slide-player__action--active"
996
+ ),
997
+ disabled: !Ne,
998
+ onClick: he,
999
+ title: Lt.title,
1000
+ type: "button",
1001
+ children: /* @__PURE__ */ a(
1002
+ Jr,
1003
+ {
1004
+ className: "slide-player__icon",
1005
+ strokeWidth: 2.25
1006
+ }
1007
+ )
1008
+ }
1009
+ )
1010
+ ] })
980
1011
  ]
981
1012
  }
982
1013
  )
@@ -984,9 +1015,9 @@ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
984
1015
  ]
985
1016
  }
986
1017
  );
987
- }, zr = sr(jr);
988
- zr.displayName = "Player";
1018
+ }, qr = fr(Xr);
1019
+ qr.displayName = "Player";
989
1020
  export {
990
- zr as default
1021
+ qr as default
991
1022
  };
992
1023
  //# sourceMappingURL=Player.es.js.map