markdown-flow-ui 0.1.108-beta.2 → 0.1.108-beta.4

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 (61) hide show
  1. package/dist/_virtual/index.cjs4.js +1 -1
  2. package/dist/_virtual/index.cjs5.js +1 -1
  3. package/dist/_virtual/index.cjs6.js +1 -1
  4. package/dist/_virtual/index.cjs7.js +1 -1
  5. package/dist/_virtual/index.es4.js +4 -4
  6. package/dist/_virtual/index.es5.js +4 -4
  7. package/dist/_virtual/index.es6.js +2 -5
  8. package/dist/_virtual/index.es6.js.map +1 -1
  9. package/dist/_virtual/index.es7.js +5 -2
  10. package/dist/_virtual/index.es7.js.map +1 -1
  11. package/dist/assets/markdown-flow-ui.css +1 -1
  12. package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js +1 -1
  13. package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js.map +1 -1
  14. package/dist/components/Slide/MobilePlayerSettingsSheet.d.ts +5 -1
  15. package/dist/components/Slide/MobilePlayerSettingsSheet.es.js +69 -27
  16. package/dist/components/Slide/MobilePlayerSettingsSheet.es.js.map +1 -1
  17. package/dist/components/Slide/Player.cjs.js +1 -1
  18. package/dist/components/Slide/Player.cjs.js.map +1 -1
  19. package/dist/components/Slide/Player.d.ts +6 -1
  20. package/dist/components/Slide/Player.es.js +281 -249
  21. package/dist/components/Slide/Player.es.js.map +1 -1
  22. package/dist/components/Slide/Slide.cjs.js +1 -1
  23. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  24. package/dist/components/Slide/Slide.es.js +410 -394
  25. package/dist/components/Slide/Slide.es.js.map +1 -1
  26. package/dist/components/Slide/SubtitleOverlay.cjs.js +1 -1
  27. package/dist/components/Slide/SubtitleOverlay.cjs.js.map +1 -1
  28. package/dist/components/Slide/SubtitleOverlay.d.ts +2 -1
  29. package/dist/components/Slide/SubtitleOverlay.es.js +33 -32
  30. package/dist/components/Slide/SubtitleOverlay.es.js.map +1 -1
  31. package/dist/components/Slide/constants.cjs.js +1 -1
  32. package/dist/components/Slide/constants.cjs.js.map +1 -1
  33. package/dist/components/Slide/constants.d.ts +2 -0
  34. package/dist/components/Slide/constants.es.js +4 -2
  35. package/dist/components/Slide/constants.es.js.map +1 -1
  36. package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
  37. package/dist/components/ui/inputGroup/textarea.es.js +1 -1
  38. package/dist/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.cjs.js +1 -1
  39. package/dist/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
  40. package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.cjs.js +7 -0
  41. package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.cjs.js.map +1 -0
  42. package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.es.js +20 -0
  43. package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.es.js.map +1 -0
  44. package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.cjs.js +7 -0
  45. package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.cjs.js.map +1 -0
  46. package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.es.js +16 -0
  47. package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.es.js.map +1 -0
  48. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.cjs.js +1 -1
  49. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.es.js +1 -1
  50. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.cjs.js +1 -1
  51. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
  52. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.cjs.js +1 -1
  53. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.es.js +1 -1
  54. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.cjs.js +1 -1
  55. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.es.js +1 -1
  56. package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs.js +1 -1
  57. package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.es.js +1 -1
  58. package/dist/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.cjs.js +1 -1
  59. package/dist/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.es.js +1 -1
  60. package/dist/markdown-flow-ui-lib.css +1 -1
  61. package/package.json +1 -1
@@ -1,24 +1,26 @@
1
1
  import { j as r } from "../../_virtual/jsx-runtime.es.js";
2
- import Ye, { memo as Ge, useRef as a, useState as we, useMemo as H, useEffect as b, useCallback as l } from "react";
3
- import { cn as Me } from "../../lib/utils.es.js";
4
- import Je from "./MobilePlayerSettingsSheet.es.js";
5
- import { DEFAULT_SLIDE_PLAYER_TEXTS as Qe } from "./constants.es.js";
6
- import { DEFAULT_MOBILE_VIEW_MODE as Ie } from "./utils/mobileScreenMode.es.js";
7
- import { toPlayerCustomActionList as er } from "./utils/playerCustomActions.es.js";
2
+ import Qe, { memo as Ie, useRef as c, useState as ke, useMemo as H, useEffect as b, useCallback as l } from "react";
3
+ import { cn as Ae } from "../../lib/utils.es.js";
4
+ import er from "./MobilePlayerSettingsSheet.es.js";
5
+ import { DEFAULT_SLIDE_PLAYER_TEXTS as rr } from "./constants.es.js";
6
+ import { DEFAULT_MOBILE_VIEW_MODE as tr } from "./utils/mobileScreenMode.es.js";
7
+ import { toPlayerCustomActionList as nr } from "./utils/playerCustomActions.es.js";
8
8
  /* empty css */
9
- import rr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
10
- import tr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
11
- import nr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
12
- import ur from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
13
- import lr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
14
- import sr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.es.js";
15
- import cr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
16
- const je = /* @__PURE__ */ new Map(), Ee = (N) => {
17
- if (typeof window > "u" || !N || je.has(N))
9
+ import sr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
10
+ import lr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
11
+ import ur from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.es.js";
12
+ import ar from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
13
+ import cr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
14
+ import ir from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
15
+ import or from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
16
+ import fr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.es.js";
17
+ import dr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
18
+ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
19
+ if (typeof window > "u" || !R || Ee.has(R))
18
20
  return;
19
- const C = window.document.createElement("audio");
20
- C.preload = "auto", C.setAttribute("playsinline", "true"), C.src = N, C.load(), je.set(N, C);
21
- }, ar = () => /* @__PURE__ */ r.jsxs(
21
+ const v = window.document.createElement("audio");
22
+ v.preload = "auto", v.setAttribute("playsinline", "true"), v.src = R, v.load(), Ee.set(R, v);
23
+ }, mr = () => /* @__PURE__ */ r.jsxs(
22
24
  "svg",
23
25
  {
24
26
  xmlns: "http://www.w3.org/2000/svg",
@@ -37,7 +39,7 @@ const je = /* @__PURE__ */ new Map(), Ee = (N) => {
37
39
  /* @__PURE__ */ r.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
38
40
  ]
39
41
  }
40
- ), or = () => /* @__PURE__ */ r.jsxs(
42
+ ), pr = () => /* @__PURE__ */ r.jsxs(
41
43
  "svg",
42
44
  {
43
45
  xmlns: "http://www.w3.org/2000/svg",
@@ -56,100 +58,103 @@ const je = /* @__PURE__ */ new Map(), Ee = (N) => {
56
58
  /* @__PURE__ */ r.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
57
59
  ]
58
60
  }
59
- ), ir = ({
60
- audioList: N = [],
61
- className: C,
61
+ ), hr = ({
62
+ audioList: R = [],
63
+ className: v,
62
64
  currentAudioIndex: m = -1,
63
- defaultPlaying: M = !0,
65
+ defaultPlaying: j = !0,
64
66
  isPlaybackPaused: L = !1,
65
67
  isAutoAdvanceEnabled: Y = !0,
66
68
  useAutoAdvanceToggle: G = !1,
67
- onLoadingChange: re,
68
- onPlaybackTimeChange: O,
69
- onPrev: ke,
70
- onNext: Ae,
71
- onFullscreen: te,
72
- isFullscreen: ne = !1,
73
- mobileViewMode: Re = Ie,
74
- settingsPortalContainer: Ne,
75
- onMobileViewModeChange: ue,
76
- onEnded: le,
77
- onAutoAdvanceToggle: ve,
78
- onInteractionToggle: Te,
79
- hasInteraction: Ce = !1,
80
- isInteractionOpen: K = !1,
81
- prevDisabled: Le = !1,
82
- nextDisabled: Ue = !1,
83
- showControls: J = !0,
84
- customActions: se,
85
- customActionContext: ce,
86
- texts: ae,
87
- ...Fe
69
+ onLoadingChange: te,
70
+ onPlaybackStarted: ne,
71
+ onPlaybackTimeChange: q,
72
+ onSubtitleToggle: se,
73
+ onPrev: Re,
74
+ onNext: Te,
75
+ onFullscreen: le,
76
+ isFullscreen: ue = !1,
77
+ mobileViewMode: Ce = tr,
78
+ settingsPortalContainer: ve,
79
+ onMobileViewModeChange: ae,
80
+ onEnded: ce,
81
+ onAutoAdvanceToggle: Le,
82
+ onInteractionToggle: Ue,
83
+ hasInteraction: Fe = !1,
84
+ isInteractionOpen: O = !1,
85
+ isSubtitleEnabled: J = !0,
86
+ prevDisabled: Pe = !1,
87
+ nextDisabled: We = !1,
88
+ showControls: Q = !0,
89
+ customActions: ie,
90
+ customActionContext: oe,
91
+ texts: fe,
92
+ ...Ve
88
93
  }) => {
89
- const h = a(null), oe = a(K), j = a(null), ie = a(null), S = a(0), c = a(null), q = a(void 0), E = a([]), Z = a(!1), fe = a(!1), y = a(!1), U = a(null), x = a(!1), u = a(!1), p = a(null), w = a(!1), F = a(null), Q = a(0), v = a("unknown"), [I, o] = we(M), [de, W] = we(!1), f = m >= 0 ? N[m] : void 0, B = f?.audioUrl, Pe = f?.element?.subtitle_cues ?? [], k = H(
94
+ const h = c(null), de = c(O), M = c(null), me = c(null), x = c(0), a = c(null), z = c(void 0), k = c([]), Z = c(!1), pe = c(!1), y = c(!1), U = c(null), S = c(!1), s = c(!1), p = c(null), w = c(!1), F = c(null), I = c(0), T = c("unknown"), [ee, i] = ke(j), [he, B] = ke(!1), f = m >= 0 ? R[m] : void 0, K = f?.audioUrl, Be = f?.element?.subtitle_cues ?? [], A = H(
90
95
  () => [...f?.audioSegments ?? []].sort(
91
96
  (e, t) => e.segment_index - t.segment_index
92
97
  ),
93
98
  [f?.audioSegments]
94
- ), me = H(
95
- () => er(se, ce),
96
- [ce, se]
97
- ), pe = me.length + 5, Ve = H(
99
+ ), ye = H(
100
+ () => nr(ie, oe),
101
+ [oe, ie]
102
+ ), ge = ye.length + 5, Ke = H(
98
103
  () => ({
99
- "--slide-player-mobile-control-count": String(pe)
104
+ "--slide-player-mobile-control-count": String(ge)
100
105
  }),
101
- [pe]
102
- ), z = H(
106
+ [ge]
107
+ ), P = H(
103
108
  () => ({
104
- ...Qe,
105
- ...ae
109
+ ...rr,
110
+ ...fe
106
111
  }),
107
- [ae]
108
- ), ee = H(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]), We = G ? Y : I, Be = G ? Y ? "Pause autoplay" : "Play autoplay" : I ? "Pause" : "Play";
112
+ [fe]
113
+ ), re = H(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]), Oe = G ? Y : ee, Ze = G ? Y ? "Pause autoplay" : "Play autoplay" : ee ? "Pause" : "Play";
109
114
  b(() => {
110
- q.current = f;
115
+ z.current = f;
111
116
  }, [f]), b(() => {
112
- J || W(!1);
113
- }, [J]), b(() => {
114
- !oe.current && K && W(!1), oe.current = K;
115
- }, [K]), b(() => {
116
- E.current = k;
117
- }, [k]), b(() => {
118
- const e = f?.audioUrl, t = m >= 0 ? N[m + 1]?.audioUrl : void 0;
119
- Ee(e), Ee(t);
120
- }, [N, f?.audioUrl, m]);
117
+ Q || B(!1);
118
+ }, [Q]), b(() => {
119
+ !de.current && O && B(!1), de.current = O;
120
+ }, [O]), b(() => {
121
+ k.current = A;
122
+ }, [A]), b(() => {
123
+ const e = f?.audioUrl, t = m >= 0 ? R[m + 1]?.audioUrl : void 0;
124
+ Ne(e), Ne(t);
125
+ }, [R, f?.audioUrl, m]);
121
126
  const n = l(
122
127
  (e) => {
123
- fe.current !== e && (fe.current = e, re?.(e));
128
+ pe.current !== e && (pe.current = e, te?.(e));
124
129
  },
125
- [re]
126
- ), he = l((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), T = l(() => M && !L && !y.current && v.current !== "blocked", [M, L]), ye = l((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), ge = l(() => {
127
- const e = c.current;
128
- return e == null || e <= 0 ? 0 : E.current.slice(0, e).reduce(
129
- (t, s) => t + Math.max(Number(s.duration_ms ?? 0), 0),
130
+ [te]
131
+ ), _e = l((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), C = l(() => j && !L && !y.current && T.current !== "blocked", [j, L]), be = l((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), xe = l(() => {
132
+ const e = a.current;
133
+ return e == null || e <= 0 ? 0 : k.current.slice(0, e).reduce(
134
+ (t, u) => t + Math.max(Number(u.duration_ms ?? 0), 0),
130
135
  0
131
136
  ) / 1e3;
132
- }, []), P = l((e) => e <= 0 ? 0 : E.current.slice(0, e).reduce(
133
- (t, s) => t + Math.max(Number(s.duration_ms ?? 0), 0),
137
+ }, []), W = l((e) => e <= 0 ? 0 : k.current.slice(0, e).reduce(
138
+ (t, u) => t + Math.max(Number(u.duration_ms ?? 0), 0),
134
139
  0
135
- ), []), _e = l(() => {
140
+ ), []), Se = l(() => {
136
141
  const e = h.current;
137
- return e ? U.current === "segment" ? P(S.current) + Math.max(e.currentTime, 0) * 1e3 : p.current !== null && e.readyState === 0 ? p.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : c.current != null ? P(c.current) : 0;
138
- }, [P]), g = l(
142
+ return e ? U.current === "segment" ? W(x.current) + Math.max(e.currentTime, 0) * 1e3 : p.current !== null && e.readyState === 0 ? p.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : a.current != null ? W(a.current) : 0;
143
+ }, [W]), g = l(
139
144
  (e) => {
140
145
  const t = Math.max(e, 0);
141
- Q.current !== t && (Q.current = t, O?.(t));
146
+ I.current !== t && (I.current = t, q?.(t));
142
147
  },
143
- [O]
144
- ), i = l(() => {
145
- g(_e());
146
- }, [_e, g]), d = l(() => {
148
+ [q]
149
+ ), o = l(() => {
150
+ g(Se());
151
+ }, [Se, g]), d = l(() => {
147
152
  typeof window > "u" || F.current === null || (window.cancelAnimationFrame(F.current), F.current = null);
148
- }, []), be = l(() => {
153
+ }, []), we = l(() => {
149
154
  if (typeof window > "u" || F.current !== null)
150
155
  return;
151
156
  const e = () => {
152
- i();
157
+ o();
153
158
  const t = h.current;
154
159
  if (!t || t.paused || t.ended) {
155
160
  F.current = null;
@@ -158,83 +163,83 @@ const je = /* @__PURE__ */ new Map(), Ee = (N) => {
158
163
  F.current = window.requestAnimationFrame(e);
159
164
  };
160
165
  F.current = window.requestAnimationFrame(e);
161
- }, [i]), $ = l(() => {
166
+ }, [o]), $ = l(() => {
162
167
  const e = h.current;
163
- e && (d(), u.current = !1, y.current = !1, Z.current = !1, U.current = null, p.current = null, x.current = !1, w.current = !1, e.pause(), e.removeAttribute("src"), e.load(), j.current = null, S.current = 0, c.current = null, g(0), o(!1), n(!1));
168
+ e && (d(), s.current = !1, y.current = !1, Z.current = !1, U.current = null, p.current = null, S.current = !1, w.current = !1, e.pause(), e.removeAttribute("src"), e.load(), M.current = null, x.current = 0, a.current = null, g(0), i(!1), n(!1));
164
169
  }, [g, d, n]), _ = l(
165
170
  (e) => {
166
171
  const t = h.current;
167
172
  if (!t)
168
173
  return !1;
169
- const s = t.play();
170
- return s && typeof s.then == "function" && s.then(() => {
171
- v.current === "unknown" && (v.current = "auto"), u.current = !1, w.current = !1;
174
+ const u = t.play();
175
+ return u && typeof u.then == "function" && u.then(() => {
176
+ T.current === "unknown" && (T.current = "auto"), s.current = !1, w.current = !1;
172
177
  }).catch((V) => {
173
- v.current === "unknown" && he(V) && (v.current = "blocked", u.current = !1, n(!1)), w.current = !1, o(!1);
178
+ T.current === "unknown" && _e(V) && (T.current = "blocked", s.current = !1, n(!1)), w.current = !1, i(!1);
174
179
  }), !0;
175
180
  },
176
- [he, n]
177
- ), A = l(
181
+ [_e, n]
182
+ ), E = l(
178
183
  (e, t) => {
179
- const s = h.current, V = E.current[e];
180
- if (!s || !V)
184
+ const u = h.current, V = k.current[e];
185
+ if (!u || !V)
181
186
  return !1;
182
- const R = ye(V.audio_data);
183
- S.current = e, c.current = null, x.current = !1, w.current = !0, g(P(e));
184
- const X = T();
185
- u.current = X, n(!1);
186
- const Xe = j.current !== R;
187
- return U.current = "segment", Xe && (s.pause(), s.removeAttribute("src"), s.load(), j.current = R, s.src = R, s.load()), p.current = 0, s.readyState > 0 && (s.currentTime = 0, p.current = null), X ? _(`start-segment:${t}`) : (u.current = !1, w.current = !1, s.pause(), o(!1), !0);
187
+ const N = be(V.audio_data);
188
+ x.current = e, a.current = null, S.current = !1, w.current = !0, g(W(e));
189
+ const X = C();
190
+ s.current = X, n(!1);
191
+ const Je = M.current !== N;
192
+ return U.current = "segment", Je && (u.pause(), u.removeAttribute("src"), u.load(), M.current = N, u.src = N, u.load()), p.current = 0, u.readyState > 0 && (u.currentTime = 0, p.current = null), X ? _(`start-segment:${t}`) : (s.current = !1, w.current = !1, u.pause(), i(!1), !0);
188
193
  },
189
194
  [
190
- T,
191
- ye,
192
- P,
195
+ C,
196
+ be,
197
+ W,
193
198
  g,
194
199
  _,
195
200
  n
196
201
  ]
197
202
  ), D = l(
198
203
  (e) => {
199
- d(), u.current = !1, x.current = !1, w.current = !1, i(), o(!1), n(!1), m >= 0 && le?.(m);
204
+ d(), s.current = !1, S.current = !1, w.current = !1, o(), i(!1), n(!1), m >= 0 && ce?.(m);
200
205
  },
201
206
  [
202
207
  m,
203
- le,
208
+ ce,
204
209
  d,
205
- i,
210
+ o,
206
211
  n
207
212
  ]
208
- ), Se = l(() => {
209
- const e = S.current + 1, t = E.current, s = t[e], V = q.current, R = t.some((X) => X.is_final);
210
- if (s) {
211
- A(e, "ended");
213
+ ), je = l(() => {
214
+ const e = x.current + 1, t = k.current, u = t[e], V = z.current, N = t.some((X) => X.is_final);
215
+ if (u) {
216
+ E(e, "ended");
212
217
  return;
213
218
  }
214
- if (V?.isAudioStreaming || !R) {
215
- S.current = e, c.current = e, x.current = !0, u.current = M, g(P(e)), o(!1), n(!0);
219
+ if (V?.isAudioStreaming || !N) {
220
+ x.current = e, a.current = e, S.current = !0, s.current = j, g(W(e)), i(!1), n(!0);
216
221
  return;
217
222
  }
218
223
  D("segments-completed");
219
224
  }, [
220
- M,
225
+ j,
221
226
  D,
222
- P,
227
+ W,
223
228
  g,
224
- A,
229
+ E,
225
230
  n
226
231
  ]);
227
232
  b(() => {
228
- if (ie.current === ee)
233
+ if (me.current === re)
229
234
  return;
230
- ie.current = ee, S.current = 0, c.current = null, x.current = !1, y.current = !1, Z.current = !1, u.current = !1, w.current = !1, U.current = null, j.current = null, d(), g(0), n(!1);
235
+ me.current = re, x.current = 0, a.current = null, S.current = !1, y.current = !1, Z.current = !1, s.current = !1, w.current = !1, U.current = null, M.current = null, d(), g(0), n(!1);
231
236
  const e = h.current;
232
- e && (e.pause(), e.removeAttribute("src"), e.load(), o(!1));
237
+ e && (e.pause(), e.removeAttribute("src"), e.load(), i(!1));
233
238
  }, [
234
239
  m,
235
- ee,
236
- k.length,
237
- B,
240
+ re,
241
+ A.length,
242
+ K,
238
243
  g,
239
244
  d,
240
245
  n
@@ -242,34 +247,34 @@ const je = /* @__PURE__ */ new Map(), Ee = (N) => {
242
247
  const e = h.current;
243
248
  if (e) {
244
249
  if (L) {
245
- Z.current = !!(q.current && !y.current && (!e.paused || u.current || c.current !== null)), u.current = !1, n(!1), e.pause(), o(!1);
250
+ Z.current = !!(z.current && !y.current && (!e.paused || s.current || a.current !== null)), s.current = !1, n(!1), e.pause(), i(!1);
246
251
  return;
247
252
  }
248
- if (!(!Z.current || !q.current || y.current)) {
249
- if (Z.current = !1, c.current !== null) {
250
- if (c.current < E.current.length) {
251
- A(c.current, "external-resume");
253
+ if (!(!Z.current || !z.current || y.current)) {
254
+ if (Z.current = !1, a.current !== null) {
255
+ if (a.current < k.current.length) {
256
+ E(a.current, "external-resume");
252
257
  return;
253
258
  }
254
- u.current = !0, n(!0);
259
+ s.current = !0, n(!0);
255
260
  return;
256
261
  }
257
- if (!j.current && E.current.length > 0) {
258
- A(
262
+ if (!M.current && k.current.length > 0) {
263
+ E(
259
264
  Math.min(
260
- S.current,
261
- E.current.length - 1
265
+ x.current,
266
+ k.current.length - 1
262
267
  ),
263
268
  "external-resume-init"
264
269
  );
265
270
  return;
266
271
  }
267
- e.paused && (u.current = !0, _("external-resume"));
272
+ e.paused && (s.current = !0, _("external-resume"));
268
273
  }
269
274
  }
270
275
  }, [
271
276
  L,
272
- A,
277
+ E,
273
278
  _,
274
279
  n
275
280
  ]), b(() => {
@@ -280,168 +285,196 @@ const je = /* @__PURE__ */ new Map(), Ee = (N) => {
280
285
  return;
281
286
  }
282
287
  if (L) {
283
- u.current = !1, n(!1), e.pause(), o(!1);
288
+ s.current = !1, n(!1), e.pause(), i(!1);
284
289
  return;
285
290
  }
286
- if (B) {
287
- const t = j.current !== B, s = T();
288
- if (U.current === "segment" && !!j.current && c.current === null) {
289
- if (!s) {
290
- u.current = !1, e.pause(), o(!1);
291
+ if (K) {
292
+ const t = M.current !== K, u = C();
293
+ if (U.current === "segment" && !!M.current && a.current === null) {
294
+ if (!u) {
295
+ s.current = !1, e.pause(), i(!1);
291
296
  return;
292
297
  }
293
- e.paused && (u.current = !0, _("keep-segment-source"));
298
+ e.paused && (s.current = !0, _("keep-segment-source"));
294
299
  return;
295
300
  }
296
301
  if (t) {
297
- const R = c.current !== null ? ge() : 0;
298
- e.pause(), e.removeAttribute("src"), e.load(), j.current = B, U.current = "url", e.src = B, e.load(), p.current = R, g(R * 1e3), e.readyState > 0 && (e.currentTime = R, p.current = null);
302
+ const N = a.current !== null ? xe() : 0;
303
+ e.pause(), e.removeAttribute("src"), e.load(), M.current = K, U.current = "url", e.src = K, e.load(), p.current = N, g(N * 1e3), e.readyState > 0 && (e.currentTime = N, p.current = null);
299
304
  }
300
- if (u.current = s, x.current = !1, w.current = !1, n(!1), !s) {
301
- u.current = !1, e.pause(), o(!1);
305
+ if (s.current = u, S.current = !1, w.current = !1, n(!1), !u) {
306
+ s.current = !1, e.pause(), i(!1);
302
307
  return;
303
308
  }
304
309
  _(t ? "sync-url-init" : "sync-url");
305
310
  return;
306
311
  }
307
- if (c.current !== null) {
308
- if (c.current < k.length) {
312
+ if (a.current !== null) {
313
+ if (a.current < A.length) {
309
314
  if (y.current) {
310
- o(!1), n(!1);
315
+ i(!1), n(!1);
311
316
  return;
312
317
  }
313
- A(c.current, "wait-resume");
318
+ E(a.current, "wait-resume");
314
319
  return;
315
320
  }
316
- x.current = !0, u.current = T(), o(!1), n(T());
321
+ S.current = !0, s.current = C(), i(!1), n(C());
317
322
  return;
318
323
  }
319
- if (!k.length) {
324
+ if (!A.length) {
320
325
  if (f.isAudioStreaming) {
321
- c.current = S.current, x.current = !0, u.current = T(), o(!1), n(T());
326
+ a.current = x.current, S.current = !0, s.current = C(), i(!1), n(C());
322
327
  return;
323
328
  }
324
329
  $();
325
330
  return;
326
331
  }
327
- if (!j.current) {
328
- A(
332
+ if (!M.current) {
333
+ E(
329
334
  Math.min(
330
- S.current,
331
- k.length - 1
335
+ x.current,
336
+ A.length - 1
332
337
  ),
333
338
  "effect-init"
334
339
  );
335
340
  return;
336
341
  }
337
- if (!M || y.current) {
338
- u.current = !1, e.pause(), o(!1);
342
+ if (!j || y.current) {
343
+ s.current = !1, e.pause(), i(!1);
339
344
  return;
340
345
  }
341
- e.paused && (u.current = !0, _("sync-paused-retry"));
346
+ e.paused && (s.current = !0, _("sync-paused-retry"));
342
347
  }
343
348
  }, [
344
349
  f,
345
350
  m,
346
- k,
347
- B,
348
- M,
351
+ A,
352
+ K,
353
+ j,
349
354
  L,
350
- T,
355
+ C,
351
356
  g,
352
357
  $,
353
- A,
358
+ E,
354
359
  _,
355
- ge,
360
+ xe,
356
361
  n
357
362
  ]), b(() => $, [$]), b(() => d, [d]);
358
- const Ke = l(() => {
359
- i(), be(), o(!0), n(!1);
360
- }, [be, i, n]), Ze = l(() => {
361
- x.current || w.current || (d(), i(), o(!1));
362
- }, [m, d, i]), $e = l(() => {
363
+ const $e = l(() => {
364
+ o(), we(), i(!0), n(!1), ne?.();
365
+ }, [
366
+ ne,
367
+ we,
368
+ o,
369
+ n
370
+ ]), He = l(() => {
371
+ S.current || w.current || (d(), o(), i(!1));
372
+ }, [m, d, o]), qe = l(() => {
363
373
  const e = h.current;
364
- e && p.current !== null && (e.currentTime = p.current, p.current = null), i(), !(!u.current || !M) && _("canplay");
374
+ e && p.current !== null && (e.currentTime = p.current, p.current = null), o(), !(!s.current || !j) && _("canplay");
365
375
  }, [
366
376
  m,
367
- M,
368
- i,
377
+ j,
378
+ o,
369
379
  _
370
- ]), He = l(() => {
380
+ ]), ze = l(() => {
371
381
  const e = h.current;
372
- e && p.current !== null && (e.currentTime = p.current, p.current = null), i();
373
- }, [m, i]), Oe = l(() => {
374
- i();
375
- }, [i]), xe = l(() => {
376
- i();
377
- }, [i]), qe = l(() => {
378
- const e = U.current === "url" || E.current.length === 0;
382
+ e && p.current !== null && (e.currentTime = p.current, p.current = null), o();
383
+ }, [m, o]), De = l(() => {
384
+ o();
385
+ }, [o]), Me = l(() => {
386
+ o();
387
+ }, [o]), Xe = l(() => {
388
+ const e = U.current === "url" || k.current.length === 0;
379
389
  if (d(), w.current = !1, e) {
380
390
  D("url-ended");
381
391
  return;
382
392
  }
383
- Se();
384
- }, [D, Se, d]), ze = l(() => {
385
- d(), i(), o(!1), n(!1);
386
- }, [d, i, n]), De = l(
393
+ je();
394
+ }, [D, je, d]), Ye = l(() => {
395
+ d(), o(), i(!1), n(!1);
396
+ }, [d, o, n]), Ge = l(
387
397
  (e) => {
388
- ue?.(e), W(!1);
398
+ ae?.(e), B(!1);
389
399
  },
390
- [ue]
400
+ [ae]
391
401
  );
392
- return console.log("SubtitleOverlay", Pe), b(() => {
393
- O?.(Q.current);
394
- }, [O]), /* @__PURE__ */ r.jsxs("div", { className: Me("slide-player", C), ...Fe, children: [
402
+ return console.log("SubtitleOverlay", Be), b(() => {
403
+ q?.(I.current);
404
+ }, [q]), /* @__PURE__ */ r.jsxs("div", { className: Ae("slide-player", v), ...Ve, children: [
395
405
  /* @__PURE__ */ r.jsx(
396
406
  "audio",
397
407
  {
398
408
  ref: h,
399
409
  preload: "auto",
400
410
  playsInline: !0,
401
- onLoadedMetadata: He,
402
- onCanPlay: $e,
403
- onPlay: Ke,
404
- onPause: Ze,
405
- onSeeking: xe,
406
- onSeeked: xe,
407
- onTimeUpdate: Oe,
408
- onEnded: qe,
409
- onError: ze
411
+ onLoadedMetadata: ze,
412
+ onCanPlay: qe,
413
+ onPlay: $e,
414
+ onPause: He,
415
+ onSeeking: Me,
416
+ onSeeked: Me,
417
+ onTimeUpdate: De,
418
+ onEnded: Xe,
419
+ onError: Ye
410
420
  }
411
421
  ),
412
- J ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
422
+ Q ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
413
423
  /* @__PURE__ */ r.jsx(
414
- Je,
424
+ er,
415
425
  {
416
- container: Ne,
426
+ container: ve,
417
427
  labels: {
418
- fullscreen: z.fullscreenLabel,
419
- nonFullscreen: z.nonFullscreenLabel,
420
- screen: z.screenLabel,
421
- title: z.settingsTitle
428
+ fullscreen: P.fullscreenLabel,
429
+ nonFullscreen: P.nonFullscreenLabel,
430
+ screen: P.screenLabel,
431
+ subtitle: P.subtitleLabel,
432
+ subtitleToggle: P.subtitleToggleAriaLabel,
433
+ title: P.settingsTitle
422
434
  },
423
- onClose: () => W(!1),
424
- onOpenChange: W,
425
- onViewModeChange: De,
426
- open: de,
427
- viewMode: Re
435
+ isSubtitleEnabled: J,
436
+ onClose: () => B(!1),
437
+ onOpenChange: B,
438
+ onSubtitleToggle: se ?? (() => {
439
+ }),
440
+ onViewModeChange: Ge,
441
+ open: he,
442
+ viewMode: Ce
428
443
  }
429
444
  ),
430
- /* @__PURE__ */ r.jsxs("div", { className: "slide-player__controls", style: Ve, children: [
445
+ /* @__PURE__ */ r.jsxs("div", { className: "slide-player__controls", style: Ke, children: [
431
446
  /* @__PURE__ */ r.jsxs("div", { className: "slide-player__group", children: [
432
447
  /* @__PURE__ */ r.jsx(
433
448
  "button",
434
449
  {
435
- "aria-expanded": de,
450
+ "aria-expanded": he,
436
451
  "aria-haspopup": "dialog",
437
452
  "aria-label": "More options",
438
453
  className: "slide-player__action slide-player__action--mobile-more",
439
454
  onClick: () => {
440
- W((e) => !e);
455
+ B((e) => !e);
441
456
  },
442
457
  type: "button",
443
458
  children: /* @__PURE__ */ r.jsx(
444
- rr,
459
+ sr,
460
+ {
461
+ className: "slide-player__icon",
462
+ strokeWidth: 2.25
463
+ }
464
+ )
465
+ }
466
+ ),
467
+ /* @__PURE__ */ r.jsx("button", { "aria-label": "Volume", className: "hidden", type: "button", children: /* @__PURE__ */ r.jsx(lr, { className: "slide-player__icon", strokeWidth: 2.25 }) }),
468
+ /* @__PURE__ */ r.jsx(
469
+ "button",
470
+ {
471
+ "aria-label": P.subtitleToggleAriaLabel,
472
+ "aria-pressed": J,
473
+ className: "slide-player__action slide-player__action--subtitle",
474
+ onClick: se,
475
+ type: "button",
476
+ children: J ? /* @__PURE__ */ r.jsx(ur, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ r.jsx(
477
+ ar,
445
478
  {
446
479
  className: "slide-player__icon",
447
480
  strokeWidth: 2.25
@@ -449,57 +482,56 @@ const je = /* @__PURE__ */ new Map(), Ee = (N) => {
449
482
  )
450
483
  }
451
484
  ),
452
- /* @__PURE__ */ r.jsx("button", { "aria-label": "Volume", className: "hidden", type: "button", children: /* @__PURE__ */ r.jsx(tr, { className: "slide-player__icon", strokeWidth: 2.25 }) }),
453
485
  /* @__PURE__ */ r.jsx(
454
486
  "button",
455
487
  {
456
488
  "aria-label": "Rewind",
457
489
  className: "slide-player__action slide-player__action--prev",
458
- disabled: Le,
459
- onClick: ke,
490
+ disabled: Pe,
491
+ onClick: Re,
460
492
  type: "button",
461
- children: /* @__PURE__ */ r.jsx(nr, { className: "slide-player__icon", strokeWidth: 2.25 })
493
+ children: /* @__PURE__ */ r.jsx(cr, { className: "slide-player__icon", strokeWidth: 2.25 })
462
494
  }
463
495
  ),
464
496
  /* @__PURE__ */ r.jsx(
465
497
  "button",
466
498
  {
467
- "aria-label": Be,
499
+ "aria-label": Ze,
468
500
  className: "slide-player__toggle slide-player__toggle--playback",
469
501
  onClick: () => {
470
502
  if (G) {
471
- ve?.(!Y);
503
+ Le?.(!Y);
472
504
  return;
473
505
  }
474
506
  const e = h.current;
475
507
  if (!(L || !e || !f)) {
476
- if (c.current !== null) {
477
- if (I) {
478
- u.current = !1, y.current = !0, c.current = null, x.current = !1, o(!1), n(!1), e.pause();
508
+ if (a.current !== null) {
509
+ if (ee) {
510
+ s.current = !1, y.current = !0, a.current = null, S.current = !1, i(!1), n(!1), e.pause();
479
511
  return;
480
512
  }
481
- v.current = "manual", y.current = !1, u.current = !0, n(!0);
513
+ T.current = "manual", y.current = !1, s.current = !0, n(!0);
482
514
  return;
483
515
  }
484
- if (!e.src && k.length > 0) {
485
- v.current = "manual", y.current = !1, A(
516
+ if (!e.src && A.length > 0) {
517
+ T.current = "manual", y.current = !1, E(
486
518
  Math.min(
487
- S.current,
488
- k.length - 1
519
+ x.current,
520
+ A.length - 1
489
521
  ),
490
522
  "toggle"
491
523
  );
492
524
  return;
493
525
  }
494
526
  if (e.paused) {
495
- v.current = "manual", y.current = !1, u.current = !0, _("toggle-resume");
527
+ T.current = "manual", y.current = !1, s.current = !0, _("toggle-resume");
496
528
  return;
497
529
  }
498
- u.current = !1, y.current = !0, e.pause();
530
+ s.current = !1, y.current = !0, e.pause();
499
531
  }
500
532
  },
501
533
  type: "button",
502
- children: We ? /* @__PURE__ */ r.jsx(ar, {}) : /* @__PURE__ */ r.jsx(or, {})
534
+ children: Oe ? /* @__PURE__ */ r.jsx(mr, {}) : /* @__PURE__ */ r.jsx(pr, {})
503
535
  }
504
536
  ),
505
537
  /* @__PURE__ */ r.jsx(
@@ -507,27 +539,27 @@ const je = /* @__PURE__ */ new Map(), Ee = (N) => {
507
539
  {
508
540
  "aria-label": "Forward",
509
541
  className: "slide-player__action slide-player__action--next",
510
- disabled: Ue,
511
- onClick: Ae,
542
+ disabled: We,
543
+ onClick: Te,
512
544
  type: "button",
513
- children: /* @__PURE__ */ r.jsx(ur, { className: "slide-player__icon", strokeWidth: 2.25 })
545
+ children: /* @__PURE__ */ r.jsx(ir, { className: "slide-player__icon", strokeWidth: 2.25 })
514
546
  }
515
547
  ),
516
- te ? /* @__PURE__ */ r.jsx(
548
+ le ? /* @__PURE__ */ r.jsx(
517
549
  "button",
518
550
  {
519
- "aria-label": ne ? "Exit fullscreen" : "Enter fullscreen",
551
+ "aria-label": ue ? "Exit fullscreen" : "Enter fullscreen",
520
552
  className: "slide-player__action slide-player__action--fullscreen",
521
- onClick: te,
553
+ onClick: le,
522
554
  type: "button",
523
- children: ne ? /* @__PURE__ */ r.jsx(
524
- lr,
555
+ children: ue ? /* @__PURE__ */ r.jsx(
556
+ or,
525
557
  {
526
558
  className: "slide-player__icon",
527
559
  strokeWidth: 2.25
528
560
  }
529
561
  ) : /* @__PURE__ */ r.jsx(
530
- sr,
562
+ fr,
531
563
  {
532
564
  className: "slide-player__icon",
533
565
  strokeWidth: 2.25
@@ -538,20 +570,20 @@ const je = /* @__PURE__ */ new Map(), Ee = (N) => {
538
570
  ] }),
539
571
  /* @__PURE__ */ r.jsx("div", { className: "slide-player__separator" }),
540
572
  /* @__PURE__ */ r.jsxs("div", { className: "slide-player__group", children: [
541
- me.map((e, t) => /* @__PURE__ */ r.jsx(Ye.Fragment, { children: e }, `custom-action-${t}`)),
573
+ ye.map((e, t) => /* @__PURE__ */ r.jsx(Qe.Fragment, { children: e }, `custom-action-${t}`)),
542
574
  /* @__PURE__ */ r.jsx(
543
575
  "button",
544
576
  {
545
577
  "aria-label": "Notes",
546
- className: Me(
578
+ className: Ae(
547
579
  "slide-player__action slide-player__action--notes",
548
- K && "slide-player__action--active"
580
+ O && "slide-player__action--active"
549
581
  ),
550
- disabled: !Ce,
551
- onClick: Te,
582
+ disabled: !Fe,
583
+ onClick: Ue,
552
584
  type: "button",
553
585
  children: /* @__PURE__ */ r.jsx(
554
- cr,
586
+ dr,
555
587
  {
556
588
  className: "slide-player__icon",
557
589
  strokeWidth: 2.25
@@ -563,9 +595,9 @@ const je = /* @__PURE__ */ new Map(), Ee = (N) => {
563
595
  ] })
564
596
  ] }) : null
565
597
  ] });
566
- }, fr = Ge(ir);
567
- fr.displayName = "Player";
598
+ }, yr = Ie(hr);
599
+ yr.displayName = "Player";
568
600
  export {
569
- fr as default
601
+ yr as default
570
602
  };
571
603
  //# sourceMappingURL=Player.es.js.map