markdown-flow-ui 0.1.124 → 0.1.125

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 (45) hide show
  1. package/dist/_virtual/index.cjs8.js +1 -1
  2. package/dist/_virtual/index.cjs9.js +1 -1
  3. package/dist/_virtual/index.es8.js +2 -2
  4. package/dist/_virtual/index.es9.js +2 -2
  5. package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js +1 -1
  6. package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js.map +1 -1
  7. package/dist/components/Slide/MobilePlayerSettingsSheet.d.ts +2 -0
  8. package/dist/components/Slide/MobilePlayerSettingsSheet.es.js +7 -6
  9. package/dist/components/Slide/MobilePlayerSettingsSheet.es.js.map +1 -1
  10. package/dist/components/Slide/Player.cjs.js +1 -1
  11. package/dist/components/Slide/Player.cjs.js.map +1 -1
  12. package/dist/components/Slide/Player.d.ts +37 -1
  13. package/dist/components/Slide/Player.es.js +594 -469
  14. package/dist/components/Slide/Player.es.js.map +1 -1
  15. package/dist/components/Slide/Slide.cjs.js +1 -1
  16. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  17. package/dist/components/Slide/Slide.d.ts +13 -0
  18. package/dist/components/Slide/Slide.es.js +528 -501
  19. package/dist/components/Slide/Slide.es.js.map +1 -1
  20. package/dist/components/Slide/constants.cjs.js +1 -1
  21. package/dist/components/Slide/constants.cjs.js.map +1 -1
  22. package/dist/components/Slide/constants.d.ts +13 -0
  23. package/dist/components/Slide/constants.es.js +13 -0
  24. package/dist/components/Slide/constants.es.js.map +1 -1
  25. package/dist/components/Slide/useWakePlayerFromIframe.cjs.js +1 -1
  26. package/dist/components/Slide/useWakePlayerFromIframe.cjs.js.map +1 -1
  27. package/dist/components/Slide/useWakePlayerFromIframe.d.ts +12 -1
  28. package/dist/components/Slide/useWakePlayerFromIframe.es.js +70 -39
  29. package/dist/components/Slide/useWakePlayerFromIframe.es.js.map +1 -1
  30. package/dist/components/Slide/utils/playerKeyboardShortcutContext.cjs.js +2 -0
  31. package/dist/components/Slide/utils/playerKeyboardShortcutContext.cjs.js.map +1 -0
  32. package/dist/components/Slide/utils/playerKeyboardShortcutContext.d.ts +5 -0
  33. package/dist/components/Slide/utils/playerKeyboardShortcutContext.es.js +6 -0
  34. package/dist/components/Slide/utils/playerKeyboardShortcutContext.es.js.map +1 -0
  35. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.js +2 -0
  36. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.js.map +1 -0
  37. package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +19 -0
  38. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +58 -0
  39. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -0
  40. package/dist/components/Slide/utils/playerKeyboardShortcuts.test.d.ts +1 -0
  41. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
  42. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  43. package/dist/node_modules/classnames/index.cjs.js +1 -1
  44. package/dist/node_modules/classnames/index.es.js +1 -1
  45. package/package.json +2 -1
@@ -1,29 +1,31 @@
1
- import { j as t } from "../../_virtual/jsx-runtime.es.js";
2
- import sr, { memo as lr, useRef as a, useState as Ce, useMemo as Y, useEffect as x, useCallback as u } from "react";
3
- import { cn as Le } from "../../lib/utils.es.js";
4
- import ar from "./MobilePlayerSettingsSheet.es.js";
5
- import { DEFAULT_SLIDE_PLAYER_TEXTS as cr } from "./constants.es.js";
6
- import { DEFAULT_MOBILE_VIEW_MODE as ir } from "./utils/mobileScreenMode.es.js";
7
- import { hasReachedAudioEnd as or } from "./utils/audioCompletion.es.js";
8
- import { resolveAudioPlaybackSourceType as fr } from "./utils/playbackSource.es.js";
9
- import { shouldKeepPlayingAfterNavigation as dr } from "./utils/playbackPreference.es.js";
10
- import { toPlayerCustomActionList as mr } from "./utils/playerCustomActions.es.js";
1
+ import { j as n } from "../../_virtual/jsx-runtime.es.js";
2
+ import jr, { memo as Rr, useId as Er, useContext as Cr, useRef as c, useState as nr, useMemo as G, useCallback as t, useEffect as m } from "react";
3
+ import { cn as ur } from "../../lib/utils.es.js";
4
+ import Nr from "./MobilePlayerSettingsSheet.es.js";
5
+ import { DEFAULT_SLIDE_PLAYER_TEXTS as vr } from "./constants.es.js";
6
+ import { DEFAULT_MOBILE_VIEW_MODE as Tr } from "./utils/mobileScreenMode.es.js";
7
+ import { hasReachedAudioEnd as Kr } from "./utils/audioCompletion.es.js";
8
+ import { PlayerKeyboardShortcutContext as Ur } from "./utils/playerKeyboardShortcutContext.es.js";
9
+ import { activatePlayerKeyboardShortcutOwner as Fr, registerPlayerKeyboardShortcutOwner as Pr, isActivePlayerKeyboardShortcutOwner as Wr, getPlayerKeyboardShortcutAction as Or, shouldIgnorePlayerKeyboardShortcutEvent as Br } from "./utils/playerKeyboardShortcuts.es.js";
10
+ import { resolveAudioPlaybackSourceType as Vr } from "./utils/playbackSource.es.js";
11
+ import { shouldKeepPlayingAfterNavigation as Hr } from "./utils/playbackPreference.es.js";
12
+ import { toPlayerCustomActionList as $r } from "./utils/playerCustomActions.es.js";
11
13
  /* empty css */
12
- import pr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
13
- import hr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
14
- import yr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
15
- import gr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
16
- import _r from "../../node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
17
- import br from "../../node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
18
- import xr from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
19
- import Sr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
20
- import wr from "../../node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
21
- const ve = /* @__PURE__ */ new Map(), Fe = (R) => {
22
- if (typeof window > "u" || !R || ve.has(R))
14
+ import Zr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
15
+ import qr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
16
+ import zr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
17
+ import Yr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
18
+ import Dr from "../../node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
19
+ import Xr from "../../node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
20
+ import Gr from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
21
+ import Jr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
22
+ import Qr from "../../node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
23
+ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
24
+ if (typeof window > "u" || !k || ar.has(k))
23
25
  return;
24
- const U = window.document.createElement("audio");
25
- U.preload = "auto", U.setAttribute("playsinline", "true"), U.src = R, U.load(), ve.set(R, U);
26
- }, Mr = () => /* @__PURE__ */ t.jsxs(
26
+ const j = window.document.createElement("audio");
27
+ j.preload = "auto", j.setAttribute("playsinline", "true"), j.src = k, j.load(), ar.set(k, j);
28
+ }, Ir = () => /* @__PURE__ */ n.jsxs(
27
29
  "svg",
28
30
  {
29
31
  xmlns: "http://www.w3.org/2000/svg",
@@ -32,17 +34,17 @@ const ve = /* @__PURE__ */ new Map(), Fe = (R) => {
32
34
  viewBox: "0 0 34 34",
33
35
  fill: "none",
34
36
  children: [
35
- /* @__PURE__ */ t.jsx(
37
+ /* @__PURE__ */ n.jsx(
36
38
  "path",
37
39
  {
38
40
  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",
39
41
  fill: "#0A0A0A"
40
42
  }
41
43
  ),
42
- /* @__PURE__ */ t.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
44
+ /* @__PURE__ */ n.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
43
45
  ]
44
46
  }
45
- ), kr = () => /* @__PURE__ */ t.jsxs(
47
+ ), et = () => /* @__PURE__ */ n.jsxs(
46
48
  "svg",
47
49
  {
48
50
  xmlns: "http://www.w3.org/2000/svg",
@@ -51,320 +53,372 @@ const ve = /* @__PURE__ */ new Map(), Fe = (R) => {
51
53
  viewBox: "0 0 34 34",
52
54
  fill: "none",
53
55
  children: [
54
- /* @__PURE__ */ t.jsx(
56
+ /* @__PURE__ */ n.jsx(
55
57
  "path",
56
58
  {
57
59
  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",
58
60
  fill: "#0A0A0A"
59
61
  }
60
62
  ),
61
- /* @__PURE__ */ t.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
63
+ /* @__PURE__ */ n.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
62
64
  ]
63
65
  }
64
- ), jr = ({
65
- audioList: R = [],
66
- className: U,
67
- currentAudioIndex: m = -1,
66
+ ), J = {
67
+ fullscreen: "F",
68
+ next: "→",
69
+ notes: "N",
70
+ playback: "Space",
71
+ previous: "←",
72
+ subtitle: "C"
73
+ }, rt = (k, j) => k ? `${k} (${j})` : j, tt = ({
74
+ audioList: k = [],
75
+ className: j,
76
+ currentAudioIndex: h = -1,
68
77
  defaultPlaying: g = !0,
69
- isPlaybackPaused: P = !1,
70
- isAutoAdvanceEnabled: $ = !0,
71
- useAutoAdvanceToggle: T = !1,
72
- onLoadingChange: le,
73
- onPlaybackPreferenceChange: ae,
74
- onPlaybackStarted: ce,
75
- onPlaybackTimeChange: G,
76
- onSubtitleToggle: ie,
77
- onPrev: Ue,
78
- onNext: Pe,
79
- onFullscreen: oe,
80
- isFullscreen: fe = !1,
81
- mobileViewMode: We = ir,
82
- settingsPortalContainer: Ve,
83
- onMobileViewModeChange: de,
84
- onEnded: me,
85
- onAutoAdvanceToggle: Be,
86
- onInteractionToggle: Ze,
87
- hasInteraction: $e = !1,
88
- isInteractionOpen: D = !1,
89
- isSubtitleEnabled: re = !0,
90
- prevDisabled: He = !1,
91
- nextDisabled: Ke = !1,
92
- showControls: te = !0,
93
- customActions: pe,
94
- customActionContext: he,
95
- texts: ye,
96
- ...Oe
78
+ isPlaybackPaused: K = !1,
79
+ isAutoAdvanceEnabled: O = !0,
80
+ useAutoAdvanceToggle: N = !1,
81
+ onLoadingChange: xe,
82
+ onPlaybackPreferenceChange: ke,
83
+ onPlaybackStarted: Me,
84
+ onPlaybackTimeChange: ne,
85
+ onSubtitleToggle: Q,
86
+ onPrev: ue,
87
+ onNext: ae,
88
+ onFullscreen: I,
89
+ isFullscreen: Le = !1,
90
+ mobileViewMode: lr = Tr,
91
+ settingsPortalContainer: cr,
92
+ onMobileViewModeChange: Ae,
93
+ onEnded: je,
94
+ onAutoAdvanceToggle: Re,
95
+ onInteractionToggle: se,
96
+ hasInteraction: me = !1,
97
+ isInteractionOpen: ee = !1,
98
+ isSubtitleEnabled: pe = !0,
99
+ prevDisabled: he = !1,
100
+ nextDisabled: ye = !1,
101
+ showControls: be = !0,
102
+ enableKeyboardShortcuts: or = !0,
103
+ customActions: Ee,
104
+ customActionContext: Ce,
105
+ texts: Ne,
106
+ onFocusCapture: ve,
107
+ onPointerDown: Te,
108
+ ...ir
97
109
  }) => {
98
- const p = a(null), ge = a(D), C = a(null), _e = a(null), S = a(0), c = a(null), J = a(void 0), j = a([]), Q = a(
99
- T ? $ : g
100
- ), X = a(!1), be = a(!1), h = a(!1), L = a(null), H = a(null), _ = a(!1), s = a(!1), y = a(null), w = a(!1), W = a(null), ne = a(0), v = a("unknown"), [ue, o] = Ce(g), [xe, K] = Ce(!1), f = m >= 0 ? R[m] : void 0, V = f?.audioUrl, M = Y(
101
- () => [...f?.audioSegments ?? []].sort(
110
+ const fr = Er(), Ke = Cr(Ur), y = c(null), Ue = c(ee), U = c(null), Fe = c(null), R = c(0), o = c(null), le = c(void 0), v = c([]), ce = c(
111
+ N ? O : g
112
+ ), re = c(!1), Pe = c(!1), b = c(!1), F = c(null), q = c(null), _ = c(!1), s = c(!1), S = c(null), E = c(!1), B = c(null), Se = c(0), P = c("unknown"), [oe, f] = nr(g), [We, z] = nr(!1), V = Ke?.ownerId ?? fr, T = or && (Ke?.enabled ?? !0), d = h >= 0 ? k[h] : void 0, H = d?.audioUrl, M = G(
113
+ () => [...d?.audioSegments ?? []].sort(
102
114
  (e, r) => e.segment_index - r.segment_index
103
115
  ),
104
- [f?.audioSegments]
105
- ), Se = Y(
106
- () => mr(pe, he),
107
- [he, pe]
108
- ), we = Se.length + 5, qe = Y(
116
+ [d?.audioSegments]
117
+ ), Oe = G(
118
+ () => $r(Ee, Ce),
119
+ [Ce, Ee]
120
+ ), Be = Oe.length + 5, dr = G(
109
121
  () => ({
110
- "--slide-player-mobile-control-count": String(we)
122
+ "--slide-player-mobile-control-count": String(Be)
111
123
  }),
112
- [we]
113
- ), B = Y(
124
+ [Be]
125
+ ), l = G(
114
126
  () => ({
115
- ...cr,
116
- ...ye
127
+ ...vr,
128
+ ...Ne
117
129
  }),
118
- [ye]
119
- ), se = Y(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]), ze = T ? $ : ue, De = T ? $ ? "Pause autoplay" : "Play autoplay" : ue ? "Pause" : "Play";
120
- x(() => {
121
- J.current = f;
122
- }, [f]), x(() => {
123
- Q.current = T ? $ : g;
124
- }, [g, $, T]), x(() => {
125
- te || K(!1);
126
- }, [te]), x(() => {
127
- !ge.current && D && K(!1), ge.current = D;
128
- }, [D]), x(() => {
129
- j.current = M;
130
- }, [M]), x(() => {
131
- const e = f?.audioUrl, r = m >= 0 ? R[m + 1]?.audioUrl : void 0;
132
- Fe(e), Fe(r);
133
- }, [R, f?.audioUrl, m]);
134
- const n = u(
130
+ [Ne]
131
+ ), ge = G(() => d ? d.audioKey ?? `${String(d.sequenceNumber ?? "none")}:${String(d.audioUrl ?? "")}` : "none", [d]), mr = N ? O : oe, Ve = N ? O ? l.pauseAutoplayLabel : l.playAutoplayLabel : oe ? l.pauseLabel : l.playLabel, He = Le ? l.exitFullscreenLabel : l.enterFullscreenLabel, Y = t(
132
+ (e, r, a) => ({
133
+ ariaKeyShortcuts: T ? a : void 0,
134
+ title: T ? rt(e, r) : e
135
+ }),
136
+ [T]
137
+ ), $e = Y(
138
+ l.subtitleToggleAriaLabel,
139
+ J.subtitle,
140
+ "c"
141
+ ), Ze = Y(
142
+ l.previousLabel,
143
+ J.previous,
144
+ "ArrowLeft"
145
+ ), qe = Y(
146
+ Ve,
147
+ J.playback,
148
+ "Space"
149
+ ), ze = Y(
150
+ l.nextLabel,
151
+ J.next,
152
+ "ArrowRight"
153
+ ), Ye = Y(
154
+ He,
155
+ J.fullscreen,
156
+ "f"
157
+ ), De = Y(
158
+ l.notesLabel,
159
+ J.notes,
160
+ "n"
161
+ ), ie = t(() => {
162
+ T && Fr(V);
163
+ }, [V, T]), pr = t(
164
+ (e) => {
165
+ ie(), Te?.(e);
166
+ },
167
+ [ie, Te]
168
+ ), hr = t(
169
+ (e) => {
170
+ ie(), ve?.(e);
171
+ },
172
+ [ie, ve]
173
+ );
174
+ m(() => {
175
+ le.current = d;
176
+ }, [d]), m(() => {
177
+ ce.current = N ? O : g;
178
+ }, [g, O, N]), m(() => {
179
+ be || z(!1);
180
+ }, [be]), m(() => {
181
+ !Ue.current && ee && z(!1), Ue.current = ee;
182
+ }, [ee]), m(() => {
183
+ v.current = M;
184
+ }, [M]), m(() => {
185
+ const e = d?.audioUrl, r = h >= 0 ? k[h + 1]?.audioUrl : void 0;
186
+ sr(e), sr(r);
187
+ }, [k, d?.audioUrl, h]);
188
+ const u = t(
135
189
  (e, r = null) => {
136
- be.current === e && (!e || r === null) || (be.current = e, le?.({
190
+ Pe.current === e && (!e || r === null) || (Pe.current = e, xe?.({
137
191
  loading: e,
138
192
  reason: e ? r : null
139
193
  }));
140
194
  },
141
- [le]
142
- ), O = u(
195
+ [xe]
196
+ ), $ = t(
143
197
  (e) => {
144
- Q.current = e, ae?.(e);
198
+ ce.current = e, ke?.(e);
145
199
  },
146
- [ae]
147
- ), Me = u(() => T ? {
148
- shouldContinuePlayback: Q.current
200
+ [ke]
201
+ ), te = t(() => N ? {
202
+ shouldContinuePlayback: ce.current
149
203
  } : {
150
- shouldContinuePlayback: dr({
151
- defaultPlaying: Q.current,
152
- isPausedByUser: h.current
204
+ shouldContinuePlayback: Hr({
205
+ defaultPlaying: ce.current,
206
+ isPausedByUser: b.current
153
207
  })
154
- }, [T]), ke = u((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), F = u(() => g && !P && !h.current && v.current !== "blocked", [g, P]), je = u((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Ee = u(() => {
155
- const e = c.current;
156
- return e == null || e <= 0 ? 0 : j.current.slice(0, e).reduce(
157
- (r, l) => r + Math.max(Number(l.duration_ms ?? 0), 0),
208
+ }, [N]), Xe = t((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), W = t(() => g && !K && !b.current && P.current !== "blocked", [g, K]), Ge = t((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Je = t(() => {
209
+ const e = o.current;
210
+ return e == null || e <= 0 ? 0 : v.current.slice(0, e).reduce(
211
+ (r, a) => r + Math.max(Number(a.duration_ms ?? 0), 0),
158
212
  0
159
213
  ) / 1e3;
160
- }, []), Z = u((e) => e <= 0 ? 0 : j.current.slice(0, e).reduce(
161
- (r, l) => r + Math.max(Number(l.duration_ms ?? 0), 0),
214
+ }, []), Z = t((e) => e <= 0 ? 0 : v.current.slice(0, e).reduce(
215
+ (r, a) => r + Math.max(Number(a.duration_ms ?? 0), 0),
162
216
  0
163
- ), []), Ne = u(() => {
164
- const e = p.current;
165
- return e ? L.current === "segment" ? Z(S.current) + Math.max(e.currentTime, 0) * 1e3 : y.current !== null && e.readyState === 0 ? y.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : c.current != null ? Z(c.current) : 0;
166
- }, [Z]), b = u(
217
+ ), []), Qe = t(() => {
218
+ const e = y.current;
219
+ return e ? F.current === "segment" ? Z(R.current) + Math.max(e.currentTime, 0) * 1e3 : S.current !== null && e.readyState === 0 ? S.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : o.current != null ? Z(o.current) : 0;
220
+ }, [Z]), w = t(
167
221
  (e) => {
168
222
  const r = Math.max(e, 0);
169
- ne.current !== r && (ne.current = r, G?.(r));
223
+ Se.current !== r && (Se.current = r, ne?.(r));
170
224
  },
171
- [G]
172
- ), i = u(() => {
173
- b(Ne());
174
- }, [Ne, b]), d = u(() => {
175
- typeof window > "u" || W.current === null || (window.cancelAnimationFrame(W.current), W.current = null);
176
- }, []), Ae = u(() => {
177
- if (typeof window > "u" || W.current !== null)
225
+ [ne]
226
+ ), i = t(() => {
227
+ w(Qe());
228
+ }, [Qe, w]), p = t(() => {
229
+ typeof window > "u" || B.current === null || (window.cancelAnimationFrame(B.current), B.current = null);
230
+ }, []), Ie = t(() => {
231
+ if (typeof window > "u" || B.current !== null)
178
232
  return;
179
233
  const e = () => {
180
234
  i();
181
- const r = p.current;
235
+ const r = y.current;
182
236
  if (!r || r.paused || r.ended) {
183
- W.current = null;
237
+ B.current = null;
184
238
  return;
185
239
  }
186
- W.current = window.requestAnimationFrame(e);
240
+ B.current = window.requestAnimationFrame(e);
187
241
  };
188
- W.current = window.requestAnimationFrame(e);
189
- }, [i]), q = u(() => {
190
- const e = p.current;
191
- e && (d(), s.current = !1, h.current = !1, X.current = !1, L.current = null, y.current = null, _.current = !1, w.current = !1, H.current = null, e.pause(), e.removeAttribute("src"), e.load(), C.current = null, S.current = 0, c.current = null, b(0), o(!1), n(!1));
192
- }, [b, d, n]), k = u(
242
+ B.current = window.requestAnimationFrame(e);
243
+ }, [i]), D = t(() => {
244
+ const e = y.current;
245
+ e && (p(), s.current = !1, b.current = !1, re.current = !1, F.current = null, S.current = null, _.current = !1, E.current = !1, q.current = null, e.pause(), e.removeAttribute("src"), e.load(), U.current = null, R.current = 0, o.current = null, w(0), f(!1), u(!1));
246
+ }, [w, p, u]), L = t(
193
247
  (e) => {
194
- const r = p.current;
248
+ const r = y.current;
195
249
  if (!r)
196
250
  return !1;
197
- const l = r.play();
198
- return l && typeof l.then == "function" && l.then(() => {
199
- v.current === "unknown" && (v.current = "auto"), s.current = !1, w.current = !1;
200
- }).catch((N) => {
201
- v.current === "unknown" && ke(N) && (v.current = "blocked", s.current = !1, n(!1)), w.current = !1, o(!1);
251
+ const a = r.play();
252
+ return a && typeof a.then == "function" && a.then(() => {
253
+ P.current === "unknown" && (P.current = "auto"), s.current = !1, E.current = !1;
254
+ }).catch((x) => {
255
+ P.current === "unknown" && Xe(x) && (P.current = "blocked", s.current = !1, u(!1)), E.current = !1, f(!1);
202
256
  }), !0;
203
257
  },
204
- [ke, n]
205
- ), E = u(
258
+ [Xe, u]
259
+ ), C = t(
206
260
  (e, r) => {
207
- const l = p.current, N = j.current[e];
208
- if (!l || !N)
261
+ const a = y.current, x = v.current[e];
262
+ if (!a || !x)
209
263
  return !1;
210
- const A = je(N.audio_data);
211
- S.current = e, c.current = null, _.current = !1, w.current = !0, H.current = "segment", b(Z(e));
212
- const ee = F();
213
- s.current = ee, n(!1);
214
- const ur = C.current !== A;
215
- return L.current = "segment", ur && (l.pause(), l.removeAttribute("src"), l.load(), C.current = A, l.src = A, l.load()), y.current = 0, l.readyState > 0 && (l.currentTime = 0, y.current = null), ee ? k(`start-segment:${r}`) : (s.current = !1, w.current = !1, l.pause(), o(!1), !0);
264
+ const A = Ge(x.audio_data);
265
+ R.current = e, o.current = null, _.current = !1, E.current = !0, q.current = "segment", w(Z(e));
266
+ const de = W();
267
+ s.current = de, u(!1);
268
+ const Ar = U.current !== A;
269
+ return F.current = "segment", Ar && (a.pause(), a.removeAttribute("src"), a.load(), U.current = A, a.src = A, a.load()), S.current = 0, a.readyState > 0 && (a.currentTime = 0, S.current = null), de ? L(`start-segment:${r}`) : (s.current = !1, E.current = !1, a.pause(), f(!1), !0);
216
270
  },
217
271
  [
218
- F,
219
- je,
272
+ W,
273
+ Ge,
220
274
  Z,
221
- b,
222
- k,
223
- n
275
+ w,
276
+ L,
277
+ u
224
278
  ]
225
- ), z = u(
279
+ ), X = t(
226
280
  (e) => {
227
- d(), s.current = !1, _.current = !1, w.current = !1, i(), o(!1), n(!1), m >= 0 && me?.(m);
281
+ p(), s.current = !1, _.current = !1, E.current = !1, i(), f(!1), u(!1), h >= 0 && je?.(h);
228
282
  },
229
283
  [
230
- m,
231
- me,
232
- d,
284
+ h,
285
+ je,
286
+ p,
233
287
  i,
234
- n
288
+ u
235
289
  ]
236
- ), I = u(
290
+ ), fe = t(
237
291
  (e) => {
238
- const r = p.current;
239
- return !r || L.current !== "url" || !or({
292
+ const r = y.current;
293
+ return !r || F.current !== "url" || !Kr({
240
294
  currentTimeSeconds: Math.max(r.currentTime, 0),
241
295
  durationSeconds: r.duration
242
- }) ? !1 : (s.current = !1, r.pause(), z(e), !0);
296
+ }) ? !1 : (s.current = !1, r.pause(), X(e), !0);
243
297
  },
244
- [z]
245
- ), Re = u(() => {
246
- const e = S.current + 1, r = j.current, l = r[e], N = J.current, A = r.some((ee) => ee.is_final);
247
- if (l) {
248
- E(e, "ended");
298
+ [X]
299
+ ), er = t(() => {
300
+ const e = R.current + 1, r = v.current, a = r[e], x = le.current, A = r.some((de) => de.is_final);
301
+ if (a) {
302
+ C(e, "ended");
249
303
  return;
250
304
  }
251
- if (N?.isAudioStreaming || !A) {
252
- S.current = e, c.current = e, _.current = !0, s.current = g, b(Z(e)), o(!1), n(!0, "waitingForMoreAudio");
305
+ if (x?.isAudioStreaming || !A) {
306
+ R.current = e, o.current = e, _.current = !0, s.current = g, w(Z(e)), f(!1), u(!0, "waitingForMoreAudio");
253
307
  return;
254
308
  }
255
- z("segments-completed");
309
+ X("segments-completed");
256
310
  }, [
257
311
  g,
258
- z,
312
+ X,
259
313
  Z,
260
- b,
261
- E,
262
- n
314
+ w,
315
+ C,
316
+ u
263
317
  ]);
264
- x(() => {
265
- if (_e.current === se)
318
+ m(() => {
319
+ if (Fe.current === ge)
266
320
  return;
267
- _e.current = se, S.current = 0, c.current = null, _.current = !1, h.current = !1, X.current = !1, s.current = !1, w.current = !1, L.current = null, H.current = null, C.current = null, d(), b(0), n(!1);
268
- const e = p.current;
269
- e && (e.pause(), e.removeAttribute("src"), e.load(), o(!1));
321
+ Fe.current = ge, R.current = 0, o.current = null, _.current = !1, b.current = !1, re.current = !1, s.current = !1, E.current = !1, F.current = null, q.current = null, U.current = null, p(), w(0), u(!1);
322
+ const e = y.current;
323
+ e && (e.pause(), e.removeAttribute("src"), e.load(), f(!1));
270
324
  }, [
271
- m,
272
- se,
325
+ h,
326
+ ge,
273
327
  M.length,
274
- V,
275
- b,
276
- d,
277
- n
278
- ]), x(() => {
279
- const e = p.current;
328
+ H,
329
+ w,
330
+ p,
331
+ u
332
+ ]), m(() => {
333
+ const e = y.current;
280
334
  if (e) {
281
- if (P) {
282
- X.current = !!(J.current && !h.current && (!e.paused || s.current || c.current !== null)), s.current = !1, n(!1), e.pause(), o(!1);
335
+ if (K) {
336
+ re.current = !!(le.current && !b.current && (!e.paused || s.current || o.current !== null)), s.current = !1, u(!1), e.pause(), f(!1);
283
337
  return;
284
338
  }
285
- if (!(!X.current || !J.current || h.current)) {
286
- if (X.current = !1, c.current !== null) {
287
- if (c.current < j.current.length) {
288
- E(c.current, "external-resume");
339
+ if (!(!re.current || !le.current || b.current)) {
340
+ if (re.current = !1, o.current !== null) {
341
+ if (o.current < v.current.length) {
342
+ C(o.current, "external-resume");
289
343
  return;
290
344
  }
291
- s.current = !0, n(!0, "waitingForMoreAudio");
345
+ s.current = !0, u(!0, "waitingForMoreAudio");
292
346
  return;
293
347
  }
294
- if (!C.current && j.current.length > 0) {
295
- E(
348
+ if (!U.current && v.current.length > 0) {
349
+ C(
296
350
  Math.min(
297
- S.current,
298
- j.current.length - 1
351
+ R.current,
352
+ v.current.length - 1
299
353
  ),
300
354
  "external-resume-init"
301
355
  );
302
356
  return;
303
357
  }
304
- e.paused && (s.current = !0, k("external-resume"));
358
+ e.paused && (s.current = !0, L("external-resume"));
305
359
  }
306
360
  }
307
361
  }, [
308
- P,
309
- E,
310
- k,
311
- n
312
- ]), x(() => {
313
- const e = p.current;
362
+ K,
363
+ C,
364
+ L,
365
+ u
366
+ ]), m(() => {
367
+ const e = y.current;
314
368
  if (!e)
315
369
  return;
316
- if (!f) {
317
- q();
370
+ if (!d) {
371
+ D();
318
372
  return;
319
373
  }
320
- if (P) {
321
- s.current = !1, n(!1), e.pause(), o(!1);
374
+ if (K) {
375
+ s.current = !1, u(!1), e.pause(), f(!1);
322
376
  return;
323
377
  }
324
- const r = fr({
325
- activeSourceType: L.current,
326
- hasAudioUrl: !!V,
378
+ const r = Vr({
379
+ activeSourceType: F.current,
380
+ hasAudioUrl: !!H,
327
381
  segmentCount: M.length,
328
- preferredSourceType: H.current,
329
- waitingSegmentIndex: c.current
382
+ preferredSourceType: q.current,
383
+ waitingSegmentIndex: o.current
330
384
  });
331
- if (r && H.current !== r && (H.current = r), r === "url" && V) {
332
- const l = C.current !== V, N = F();
333
- if (l) {
334
- const A = c.current !== null ? Ee() : 0;
335
- e.pause(), e.removeAttribute("src"), e.load(), C.current = V, L.current = "url", e.src = V, e.load(), y.current = A, b(A * 1e3), e.readyState > 0 && (e.currentTime = A, y.current = null);
385
+ if (r && q.current !== r && (q.current = r), r === "url" && H) {
386
+ const a = U.current !== H, x = W();
387
+ if (a) {
388
+ const A = o.current !== null ? Je() : 0;
389
+ e.pause(), e.removeAttribute("src"), e.load(), U.current = H, F.current = "url", e.src = H, e.load(), S.current = A, w(A * 1e3), e.readyState > 0 && (e.currentTime = A, S.current = null);
336
390
  }
337
- if (s.current = N, _.current = !1, w.current = !1, n(!1), !N) {
338
- s.current = !1, e.pause(), o(!1);
391
+ if (s.current = x, _.current = !1, E.current = !1, u(!1), !x) {
392
+ s.current = !1, e.pause(), f(!1);
339
393
  return;
340
394
  }
341
- k(l ? "sync-url-init" : "sync-url");
395
+ L(a ? "sync-url-init" : "sync-url");
342
396
  return;
343
397
  }
344
- if (r === "segment" && c.current !== null) {
345
- if (c.current < M.length) {
346
- if (h.current) {
347
- o(!1), n(!1);
398
+ if (r === "segment" && o.current !== null) {
399
+ if (o.current < M.length) {
400
+ if (b.current) {
401
+ f(!1), u(!1);
348
402
  return;
349
403
  }
350
- E(c.current, "wait-resume");
404
+ C(o.current, "wait-resume");
351
405
  return;
352
406
  }
353
- _.current = !0, s.current = F(), o(!1), n(F());
407
+ _.current = !0, s.current = W(), f(!1), u(W());
354
408
  return;
355
409
  }
356
410
  if (r === "segment" && !M.length) {
357
- if (f.isAudioStreaming) {
358
- c.current = S.current, _.current = !0, s.current = F(), o(!1), n(F());
411
+ if (d.isAudioStreaming) {
412
+ o.current = R.current, _.current = !0, s.current = W(), f(!1), u(W());
359
413
  return;
360
414
  }
361
- q();
415
+ D();
362
416
  return;
363
417
  }
364
- if (r === "segment" && !C.current) {
365
- E(
418
+ if (r === "segment" && !U.current) {
419
+ C(
366
420
  Math.min(
367
- S.current,
421
+ R.current,
368
422
  M.length - 1
369
423
  ),
370
424
  "effect-init"
@@ -372,283 +426,354 @@ const ve = /* @__PURE__ */ new Map(), Fe = (R) => {
372
426
  return;
373
427
  }
374
428
  if (r !== "segment") {
375
- q();
429
+ D();
376
430
  return;
377
431
  }
378
- if (!g || h.current) {
379
- s.current = !1, e.pause(), o(!1);
432
+ if (!g || b.current) {
433
+ s.current = !1, e.pause(), f(!1);
380
434
  return;
381
435
  }
382
- e.paused && (s.current = !0, k("sync-paused-retry"));
436
+ e.paused && (s.current = !0, L("sync-paused-retry"));
383
437
  }, [
384
- f,
385
- m,
438
+ d,
439
+ h,
386
440
  M,
387
- V,
441
+ H,
388
442
  g,
389
- P,
390
- F,
391
- b,
392
- q,
393
- E,
394
- k,
395
- Ee,
396
- n
397
- ]), x(() => q, [q]), x(() => d, [d]);
398
- const Xe = u(() => {
399
- i(), Ae(), o(!0), n(!1), ce?.();
443
+ K,
444
+ W,
445
+ w,
446
+ D,
447
+ C,
448
+ L,
449
+ Je,
450
+ u
451
+ ]), m(() => D, [D]), m(() => p, [p]);
452
+ const yr = t(() => {
453
+ i(), Ie(), f(!0), u(!1), Me?.();
400
454
  }, [
401
- ce,
402
- Ae,
455
+ Me,
456
+ Ie,
403
457
  i,
404
- n
405
- ]), Ye = u(() => {
406
- _.current || w.current || (d(), i(), o(!1));
407
- }, [m, d, i]), Ge = u(() => {
408
- const e = p.current;
409
- e && y.current !== null && (e.currentTime = y.current, y.current = null), i(), !I("canplay-seek-finished") && (!s.current || !g || k("canplay"));
458
+ u
459
+ ]), br = t(() => {
460
+ _.current || E.current || (p(), i(), f(!1));
461
+ }, [h, p, i]), Sr = t(() => {
462
+ const e = y.current;
463
+ e && S.current !== null && (e.currentTime = S.current, S.current = null), i(), !fe("canplay-seek-finished") && (!s.current || !g || L("canplay"));
410
464
  }, [
411
- m,
465
+ h,
412
466
  g,
413
- I,
467
+ fe,
414
468
  i,
415
- k
416
- ]), Je = u(() => {
417
- const e = p.current;
418
- e && y.current !== null && (e.currentTime = y.current, y.current = null), i(), I("metadata-seek-finished");
419
- }, [m, I, i]), Qe = u(() => {
469
+ L
470
+ ]), gr = t(() => {
471
+ const e = y.current;
472
+ e && S.current !== null && (e.currentTime = S.current, S.current = null), i(), fe("metadata-seek-finished");
473
+ }, [h, fe, i]), _r = t(() => {
420
474
  i();
421
- }, [i]), Ie = u(() => {
422
- _.current || n(!0, "loadingAudio");
423
- }, [n]), er = u(() => {
475
+ }, [i]), wr = t(() => {
476
+ _.current || u(!0, "loadingAudio");
477
+ }, [u]), xr = t(() => {
424
478
  if (_.current) {
425
- n(!0, "waitingForMoreAudio");
479
+ u(!0, "waitingForMoreAudio");
426
480
  return;
427
481
  }
428
- n(!0, "loadingAudio");
429
- }, [n]), Te = u(() => {
482
+ u(!0, "loadingAudio");
483
+ }, [u]), rr = t(() => {
430
484
  i();
431
- }, [i]), rr = u(() => {
432
- const e = L.current === "url" || j.current.length === 0;
433
- if (d(), w.current = !1, e) {
434
- z("url-ended");
485
+ }, [i]), kr = t(() => {
486
+ const e = F.current === "url" || v.current.length === 0;
487
+ if (p(), E.current = !1, e) {
488
+ X("url-ended");
435
489
  return;
436
490
  }
437
- Re();
438
- }, [z, Re, d]), tr = u(() => {
439
- d(), i(), o(!1), n(!1);
440
- }, [d, i, n]), nr = u(
491
+ er();
492
+ }, [X, er, p]), Mr = t(() => {
493
+ p(), i(), f(!1), u(!1);
494
+ }, [p, i, u]), Lr = t(
441
495
  (e) => {
442
- de?.(e), K(!1);
496
+ Ae?.(e), z(!1);
443
497
  },
444
- [de]
445
- );
446
- return x(() => {
447
- G?.(ne.current);
448
- }, [G]), /* @__PURE__ */ t.jsxs("div", { className: Le("slide-player", U), ...Oe, children: [
449
- /* @__PURE__ */ t.jsx(
450
- "audio",
451
- {
452
- ref: p,
453
- preload: "auto",
454
- playsInline: !0,
455
- onLoadStart: Ie,
456
- onLoadedMetadata: Je,
457
- onCanPlay: Ge,
458
- onPlay: Xe,
459
- onPause: Ye,
460
- onWaiting: er,
461
- onSeeking: Te,
462
- onSeeked: Te,
463
- onTimeUpdate: Qe,
464
- onEnded: rr,
465
- onError: tr
466
- }
467
- ),
468
- te ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
469
- /* @__PURE__ */ t.jsx(
470
- ar,
471
- {
472
- container: Ve,
473
- labels: {
474
- fullscreen: B.fullscreenLabel,
475
- nonFullscreen: B.nonFullscreenLabel,
476
- screen: B.screenLabel,
477
- subtitle: B.subtitleLabel,
478
- subtitleToggle: B.subtitleToggleAriaLabel,
479
- title: B.settingsTitle
480
- },
481
- isSubtitleEnabled: re,
482
- onClose: () => K(!1),
483
- onOpenChange: K,
484
- onSubtitleToggle: ie ?? (() => {
485
- }),
486
- onViewModeChange: nr,
487
- open: xe,
488
- viewMode: We
489
- }
498
+ [Ae]
499
+ ), _e = t(() => {
500
+ if (N) {
501
+ const r = !O;
502
+ return $(r), Re?.(r), !0;
503
+ }
504
+ const e = y.current;
505
+ return K || !e || !d ? !1 : o.current !== null ? oe ? ($(!1), s.current = !1, b.current = !0, o.current = null, _.current = !1, f(!1), u(!1), e.pause(), !0) : ($(!0), P.current = "manual", b.current = !1, s.current = !0, u(!0, "waitingForMoreAudio"), !0) : !e.src && M.length > 0 ? ($(!0), P.current = "manual", b.current = !1, C(
506
+ Math.min(
507
+ R.current,
508
+ M.length - 1
490
509
  ),
491
- /* @__PURE__ */ t.jsxs("div", { className: "slide-player__controls", style: qe, children: [
492
- /* @__PURE__ */ t.jsxs("div", { className: "slide-player__group", children: [
493
- /* @__PURE__ */ t.jsx(
494
- "button",
510
+ "toggle"
511
+ ), !0) : e.paused ? ($(!0), P.current = "manual", b.current = !1, s.current = !0, L("toggle-resume"), !0) : ($(!1), s.current = !1, b.current = !0, e.pause(), !0);
512
+ }, [
513
+ d,
514
+ M.length,
515
+ O,
516
+ K,
517
+ oe,
518
+ Re,
519
+ C,
520
+ L,
521
+ u,
522
+ $,
523
+ N
524
+ ]);
525
+ m(() => {
526
+ if (T)
527
+ return Pr(V);
528
+ }, [V, T]);
529
+ const we = G(
530
+ () => ({
531
+ fullscreen: () => I ? (I(), !0) : !1,
532
+ interaction: () => se ? (me && se(), !0) : !1,
533
+ next: () => ae ? (ye || ae(te()), !0) : !1,
534
+ previous: () => ue ? (he || ue(te()), !0) : !1,
535
+ subtitle: () => Q ? (Q(), !0) : !1,
536
+ togglePlayback: () => (_e(), !0)
537
+ }),
538
+ [
539
+ te,
540
+ me,
541
+ ye,
542
+ I,
543
+ se,
544
+ ae,
545
+ ue,
546
+ Q,
547
+ he,
548
+ _e
549
+ ]
550
+ ), tr = c(we);
551
+ return m(() => {
552
+ tr.current = we;
553
+ }, [we]), m(() => {
554
+ if (!T || typeof document > "u")
555
+ return;
556
+ const e = (r) => {
557
+ if (!Wr(V))
558
+ return;
559
+ const a = Or(r);
560
+ if (!a || Br(r, a))
561
+ return;
562
+ let x = !1;
563
+ const A = tr.current[a];
564
+ x = A(), x && r.preventDefault();
565
+ };
566
+ return document.addEventListener("keydown", e), () => {
567
+ document.removeEventListener("keydown", e);
568
+ };
569
+ }, [V, T]), m(() => {
570
+ ne?.(Se.current);
571
+ }, [ne]), /* @__PURE__ */ n.jsxs(
572
+ "div",
573
+ {
574
+ ...ir,
575
+ "data-slide-player-shortcut-owner": V,
576
+ className: ur("slide-player", j),
577
+ onFocusCapture: hr,
578
+ onPointerDown: pr,
579
+ children: [
580
+ /* @__PURE__ */ n.jsx(
581
+ "audio",
582
+ {
583
+ ref: y,
584
+ preload: "auto",
585
+ playsInline: !0,
586
+ onLoadStart: wr,
587
+ onLoadedMetadata: gr,
588
+ onCanPlay: Sr,
589
+ onPlay: yr,
590
+ onPause: br,
591
+ onWaiting: xr,
592
+ onSeeking: rr,
593
+ onSeeked: rr,
594
+ onTimeUpdate: _r,
595
+ onEnded: kr,
596
+ onError: Mr
597
+ }
598
+ ),
599
+ be ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
600
+ /* @__PURE__ */ n.jsx(
601
+ Nr,
495
602
  {
496
- "aria-expanded": xe,
497
- "aria-haspopup": "dialog",
498
- "aria-label": "More options",
499
- className: "slide-player__action slide-player__action--mobile-more",
500
- onClick: () => {
501
- K((e) => !e);
603
+ container: cr,
604
+ labels: {
605
+ closeSettings: l.closeSettingsLabel,
606
+ fullscreen: l.fullscreenLabel,
607
+ nonFullscreen: l.nonFullscreenLabel,
608
+ screen: l.screenLabel,
609
+ screenMode: l.screenModeLabel,
610
+ subtitle: l.subtitleLabel,
611
+ subtitleToggle: l.subtitleToggleAriaLabel,
612
+ title: l.settingsTitle
502
613
  },
503
- type: "button",
504
- children: /* @__PURE__ */ t.jsx(
505
- pr,
506
- {
507
- className: "slide-player__icon",
508
- strokeWidth: 2.25
509
- }
510
- )
614
+ isSubtitleEnabled: pe,
615
+ onClose: () => z(!1),
616
+ onOpenChange: z,
617
+ onSubtitleToggle: Q ?? (() => {
618
+ }),
619
+ onViewModeChange: Lr,
620
+ open: We,
621
+ viewMode: lr
511
622
  }
512
623
  ),
513
- /* @__PURE__ */ t.jsx("button", { "aria-label": "Volume", className: "hidden", type: "button", children: /* @__PURE__ */ t.jsx(hr, { className: "slide-player__icon", strokeWidth: 2.25 }) }),
514
- /* @__PURE__ */ t.jsx(
515
- "button",
516
- {
517
- "aria-label": B.subtitleToggleAriaLabel,
518
- "aria-pressed": re,
519
- className: "slide-player__action slide-player__action--subtitle",
520
- onClick: ie,
521
- type: "button",
522
- children: re ? /* @__PURE__ */ t.jsx(yr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ t.jsx(
523
- gr,
624
+ /* @__PURE__ */ n.jsxs("div", { className: "slide-player__controls", style: dr, children: [
625
+ /* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
626
+ /* @__PURE__ */ n.jsx(
627
+ "button",
524
628
  {
525
- className: "slide-player__icon",
526
- strokeWidth: 2.25
629
+ "aria-expanded": We,
630
+ "aria-haspopup": "dialog",
631
+ "aria-label": l.moreOptionsAriaLabel,
632
+ className: "slide-player__action slide-player__action--mobile-more",
633
+ onClick: () => {
634
+ z((e) => !e);
635
+ },
636
+ type: "button",
637
+ children: /* @__PURE__ */ n.jsx(
638
+ Zr,
639
+ {
640
+ className: "slide-player__icon",
641
+ strokeWidth: 2.25
642
+ }
643
+ )
527
644
  }
528
- )
529
- }
530
- ),
531
- /* @__PURE__ */ t.jsx(
532
- "button",
533
- {
534
- "aria-label": "Rewind",
535
- className: "slide-player__action slide-player__action--prev",
536
- disabled: He,
537
- onClick: () => {
538
- Ue?.(Me());
539
- },
540
- type: "button",
541
- children: /* @__PURE__ */ t.jsx(_r, { className: "slide-player__icon", strokeWidth: 2.25 })
542
- }
543
- ),
544
- /* @__PURE__ */ t.jsx(
545
- "button",
546
- {
547
- "aria-label": De,
548
- className: "slide-player__toggle slide-player__toggle--playback",
549
- onClick: () => {
550
- if (T) {
551
- const r = !$;
552
- O(r), Be?.(r);
553
- return;
645
+ ),
646
+ /* @__PURE__ */ n.jsx(
647
+ "button",
648
+ {
649
+ "aria-label": l.volumeAriaLabel,
650
+ className: "hidden",
651
+ type: "button",
652
+ children: /* @__PURE__ */ n.jsx(qr, { className: "slide-player__icon", strokeWidth: 2.25 })
554
653
  }
555
- const e = p.current;
556
- if (!(P || !e || !f)) {
557
- if (c.current !== null) {
558
- if (ue) {
559
- O(!1), s.current = !1, h.current = !0, c.current = null, _.current = !1, o(!1), n(!1), e.pause();
560
- return;
654
+ ),
655
+ /* @__PURE__ */ n.jsx(
656
+ "button",
657
+ {
658
+ "aria-label": l.subtitleToggleAriaLabel,
659
+ "aria-keyshortcuts": $e.ariaKeyShortcuts,
660
+ "aria-pressed": pe,
661
+ className: "slide-player__action slide-player__action--subtitle",
662
+ onClick: Q,
663
+ title: $e.title,
664
+ type: "button",
665
+ children: pe ? /* @__PURE__ */ n.jsx(zr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ n.jsx(
666
+ Yr,
667
+ {
668
+ className: "slide-player__icon",
669
+ strokeWidth: 2.25
561
670
  }
562
- O(!0), v.current = "manual", h.current = !1, s.current = !0, n(!0, "waitingForMoreAudio");
563
- return;
564
- }
565
- if (!e.src && M.length > 0) {
566
- O(!0), v.current = "manual", h.current = !1, E(
567
- Math.min(
568
- S.current,
569
- M.length - 1
570
- ),
571
- "toggle"
572
- );
573
- return;
574
- }
575
- if (e.paused) {
576
- O(!0), v.current = "manual", h.current = !1, s.current = !0, k("toggle-resume");
577
- return;
578
- }
579
- O(!1), s.current = !1, h.current = !0, e.pause();
671
+ )
580
672
  }
581
- },
582
- type: "button",
583
- children: ze ? /* @__PURE__ */ t.jsx(Mr, {}) : /* @__PURE__ */ t.jsx(kr, {})
584
- }
585
- ),
586
- /* @__PURE__ */ t.jsx(
587
- "button",
588
- {
589
- "aria-label": "Forward",
590
- className: "slide-player__action slide-player__action--next",
591
- disabled: Ke,
592
- onClick: () => {
593
- Pe?.(Me());
594
- },
595
- type: "button",
596
- children: /* @__PURE__ */ t.jsx(br, { className: "slide-player__icon", strokeWidth: 2.25 })
597
- }
598
- ),
599
- oe ? /* @__PURE__ */ t.jsx(
600
- "button",
601
- {
602
- "aria-label": fe ? "Exit fullscreen" : "Enter fullscreen",
603
- className: "slide-player__action slide-player__action--fullscreen",
604
- onClick: oe,
605
- type: "button",
606
- children: fe ? /* @__PURE__ */ t.jsx(
607
- xr,
673
+ ),
674
+ /* @__PURE__ */ n.jsx(
675
+ "button",
608
676
  {
609
- className: "slide-player__icon",
610
- strokeWidth: 2.25
677
+ "aria-keyshortcuts": Ze.ariaKeyShortcuts,
678
+ "aria-label": l.previousLabel,
679
+ className: "slide-player__action slide-player__action--prev",
680
+ disabled: he,
681
+ onClick: () => {
682
+ ue?.(te());
683
+ },
684
+ title: Ze.title,
685
+ type: "button",
686
+ children: /* @__PURE__ */ n.jsx(Dr, { className: "slide-player__icon", strokeWidth: 2.25 })
611
687
  }
612
- ) : /* @__PURE__ */ t.jsx(
613
- Sr,
688
+ ),
689
+ /* @__PURE__ */ n.jsx(
690
+ "button",
614
691
  {
615
- className: "slide-player__icon",
616
- strokeWidth: 2.25
692
+ "aria-label": Ve,
693
+ "aria-keyshortcuts": qe.ariaKeyShortcuts,
694
+ className: "slide-player__toggle slide-player__toggle--playback",
695
+ onClick: () => {
696
+ _e();
697
+ },
698
+ title: qe.title,
699
+ type: "button",
700
+ children: mr ? /* @__PURE__ */ n.jsx(Ir, {}) : /* @__PURE__ */ n.jsx(et, {})
701
+ }
702
+ ),
703
+ /* @__PURE__ */ n.jsx(
704
+ "button",
705
+ {
706
+ "aria-keyshortcuts": ze.ariaKeyShortcuts,
707
+ "aria-label": l.nextLabel,
708
+ className: "slide-player__action slide-player__action--next",
709
+ disabled: ye,
710
+ onClick: () => {
711
+ ae?.(te());
712
+ },
713
+ title: ze.title,
714
+ type: "button",
715
+ children: /* @__PURE__ */ n.jsx(Xr, { className: "slide-player__icon", strokeWidth: 2.25 })
617
716
  }
618
- )
619
- }
620
- ) : null
621
- ] }),
622
- /* @__PURE__ */ t.jsx("div", { className: "slide-player__separator" }),
623
- /* @__PURE__ */ t.jsxs("div", { className: "slide-player__group", children: [
624
- Se.map((e, r) => /* @__PURE__ */ t.jsx(sr.Fragment, { children: e }, `custom-action-${r}`)),
625
- /* @__PURE__ */ t.jsx(
626
- "button",
627
- {
628
- "aria-label": "Notes",
629
- className: Le(
630
- "slide-player__action slide-player__action--notes",
631
- D && "slide-player__action--active"
632
717
  ),
633
- disabled: !$e,
634
- onClick: Ze,
635
- type: "button",
636
- children: /* @__PURE__ */ t.jsx(
637
- wr,
718
+ I ? /* @__PURE__ */ n.jsx(
719
+ "button",
638
720
  {
639
- className: "slide-player__icon",
640
- strokeWidth: 2.25
721
+ "aria-label": He,
722
+ "aria-keyshortcuts": Ye.ariaKeyShortcuts,
723
+ className: "slide-player__action slide-player__action--fullscreen",
724
+ onClick: I,
725
+ title: Ye.title,
726
+ type: "button",
727
+ children: Le ? /* @__PURE__ */ n.jsx(
728
+ Gr,
729
+ {
730
+ className: "slide-player__icon",
731
+ strokeWidth: 2.25
732
+ }
733
+ ) : /* @__PURE__ */ n.jsx(
734
+ Jr,
735
+ {
736
+ className: "slide-player__icon",
737
+ strokeWidth: 2.25
738
+ }
739
+ )
740
+ }
741
+ ) : null
742
+ ] }),
743
+ /* @__PURE__ */ n.jsx("div", { className: "slide-player__separator" }),
744
+ /* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
745
+ Oe.map((e, r) => /* @__PURE__ */ n.jsx(jr.Fragment, { children: e }, `custom-action-${r}`)),
746
+ /* @__PURE__ */ n.jsx(
747
+ "button",
748
+ {
749
+ "aria-label": l.notesLabel,
750
+ "aria-keyshortcuts": De.ariaKeyShortcuts,
751
+ className: ur(
752
+ "slide-player__action slide-player__action--notes",
753
+ ee && "slide-player__action--active"
754
+ ),
755
+ disabled: !me,
756
+ onClick: se,
757
+ title: De.title,
758
+ type: "button",
759
+ children: /* @__PURE__ */ n.jsx(
760
+ Qr,
761
+ {
762
+ className: "slide-player__icon",
763
+ strokeWidth: 2.25
764
+ }
765
+ )
641
766
  }
642
767
  )
643
- }
644
- )
645
- ] })
646
- ] })
647
- ] }) : null
648
- ] });
649
- }, Er = lr(jr);
650
- Er.displayName = "Player";
768
+ ] })
769
+ ] })
770
+ ] }) : null
771
+ ]
772
+ }
773
+ );
774
+ }, nt = Rr(tt);
775
+ nt.displayName = "Player";
651
776
  export {
652
- Er as default
777
+ nt as default
653
778
  };
654
779
  //# sourceMappingURL=Player.es.js.map