markdown-flow-ui 0.2.26-dev.4 → 0.2.26-dev.5

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.
@@ -1,5 +1,5 @@
1
- import { jsxs as re, jsx as s, Fragment as Jt } from "react/jsx-runtime";
2
- import _r, { memo as Mr, useId as wr, useContext as Tr, useRef as i, useState as Ge, useMemo as ce, useCallback as u, useEffect as d } from "react";
1
+ import { jsxs as H, jsx as s, Fragment as Pt } from "react/jsx-runtime";
2
+ import _r, { memo as Mr, useId as wr, useContext as Tr, useRef as i, useState as Ge, useMemo as ce, useCallback as u, useEffect as m } from "react";
3
3
  import { getMarkdownFlowDirection as kr, getMarkdownFlowLanguage as vr } from "../../lib/locale.es.js";
4
4
  import { useDetachedLanguage as Lr } from "../../lib/useDetachedLanguage.es.js";
5
5
  import { useResolvedDirection as Ar } from "../../lib/useResolvedDirection.es.js";
@@ -12,14 +12,14 @@ import { PlayerKeyboardShortcutContext as Fr } from "./utils/playerKeyboardShort
12
12
  import { activatePlayerKeyboardShortcutOwner as Ur, registerPlayerKeyboardShortcutOwner as Br, isActivePlayerKeyboardShortcutOwner as Wr, getPlayerKeyboardShortcutAction as Or, shouldIgnorePlayerKeyboardShortcutEvent as Rr } from "./utils/playerKeyboardShortcuts.es.js";
13
13
  import { resolveAudioPlaybackSourceType as Vr } from "./utils/playbackSource.es.js";
14
14
  import { shouldKeepPlayingAfterNavigation as Ir } from "./utils/playbackPreference.es.js";
15
- import { toPlayerCustomActionList as Pr } from "./utils/playerCustomActions.es.js";
15
+ import { toPlayerCustomActionList as $r } from "./utils/playerCustomActions.es.js";
16
16
  import { suppressPlayerControlsWakeAfterNavigation as Qe } from "./utils/playerNavigationContext.es.js";
17
17
  import { isPlaybackTimeCoveredBySegments as Xe, resolveSegmentSeekTarget as Zt } from "./utils/segmentSeek.es.js";
18
18
  import { getSortedAudioSegments as jt } from "./utils/audioSegments.es.js";
19
- import { getSubtitleCueJumpTarget as $r, shouldClearSubtitleCueJumpTarget as Hr } from "./utils/subtitleCue.es.js";
19
+ import { getSubtitleCueJumpTarget as Hr, shouldClearSubtitleCueJumpTarget as Dr } from "./utils/subtitleCue.es.js";
20
20
  /* empty css */
21
- import Dr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
22
- import Jr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
21
+ import Jr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
22
+ import Pr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
23
23
  import Zr from "../../node_modules/lucide-react/dist/esm/icons/skip-back.es.js";
24
24
  import jr from "../../node_modules/lucide-react/dist/esm/icons/skip-forward.es.js";
25
25
  import zr from "../../node_modules/lucide-react/dist/esm/icons/rewind.es.js";
@@ -28,29 +28,29 @@ import Gr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
28
28
  import Qr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
29
29
  import Xr from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
30
30
  import qr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
31
- const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
32
- if (typeof window > "u" || !m || zt.has(m))
31
+ const zt = /* @__PURE__ */ new Map(), Yt = (d) => {
32
+ if (typeof window > "u" || !d || zt.has(d))
33
33
  return;
34
34
  const p = window.document.createElement("audio");
35
- p.preload = "auto", p.setAttribute("playsinline", "true"), p.src = m, p.load(), zt.set(m, p);
36
- }, en = (m, p) => p !== null && p.audioList === m && p.subtitleCueLists.length === m.length && m.every((a, w) => {
37
- const T = a.element?.subtitle_cues;
35
+ p.preload = "auto", p.setAttribute("playsinline", "true"), p.src = d, p.load(), zt.set(d, p);
36
+ }, en = (d, p) => p !== null && p.audioList === d && p.subtitleCueLists.length === d.length && d.every((l, w) => {
37
+ const T = l.element?.subtitle_cues;
38
38
  return p.subtitleCueLists[w] === T && p.subtitleCueLengths[w] === (T?.length ?? 0);
39
- }), tn = (m) => {
40
- const p = m.map(
41
- (a) => a.element?.subtitle_cues
39
+ }), tn = (d) => {
40
+ const p = d.map(
41
+ (l) => l.element?.subtitle_cues
42
42
  );
43
43
  return {
44
- audioList: m,
44
+ audioList: d,
45
45
  subtitleCueLists: p,
46
46
  subtitleCueLengths: p.map(
47
- (a) => a?.length ?? 0
47
+ (l) => l?.length ?? 0
48
48
  ),
49
- tracks: p.map((a) => ({
50
- subtitleCues: a ?? []
49
+ tracks: p.map((l) => ({
50
+ subtitleCues: l ?? []
51
51
  }))
52
52
  };
53
- }, rn = () => /* @__PURE__ */ re(
53
+ }, rn = () => /* @__PURE__ */ H(
54
54
  "svg",
55
55
  {
56
56
  xmlns: "http://www.w3.org/2000/svg",
@@ -69,7 +69,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
69
69
  /* @__PURE__ */ s("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
70
70
  ]
71
71
  }
72
- ), nn = () => /* @__PURE__ */ re(
72
+ ), nn = () => /* @__PURE__ */ H(
73
73
  "svg",
74
74
  {
75
75
  xmlns: "http://www.w3.org/2000/svg",
@@ -88,21 +88,21 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
88
88
  /* @__PURE__ */ s("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
89
89
  ]
90
90
  }
91
- ), Z = {
91
+ ), j = {
92
92
  fullscreen: "F",
93
93
  next: "→",
94
94
  nextSubtitle: "Shift+→",
95
95
  previous: "←",
96
96
  previousSubtitle: "Shift+←",
97
97
  subtitle: "C"
98
- }, un = 250, ln = 15e3, an = (m, p) => m ? `${m} (${p})` : p, sn = ({
99
- audioList: m = [],
98
+ }, un = 250, an = 15e3, ln = (d, p) => d ? `${d} (${p})` : p, sn = ({
99
+ audioList: d = [],
100
100
  className: p,
101
- currentAudioIndex: a = -1,
101
+ currentAudioIndex: l = -1,
102
102
  defaultPlaying: w = !0,
103
103
  isPlaybackPaused: T = !1,
104
- isAutoAdvanceEnabled: j = !0,
105
- useAutoAdvanceToggle: W = !1,
104
+ isAutoAdvanceEnabled: z = !0,
105
+ useAutoAdvanceToggle: O = !1,
106
106
  onLoadingChange: qe,
107
107
  onPlaybackPreferenceChange: et,
108
108
  onPlaybackStarted: tt,
@@ -115,13 +115,13 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
115
115
  onNext: Me,
116
116
  onSubtitleJump: we,
117
117
  canJumpToSubtitleTarget: Be,
118
- onFullscreen: me,
118
+ onFullscreen: de,
119
119
  isFullscreen: rt = !1,
120
120
  mobileViewMode: Gt = Er,
121
121
  settingsPortalContainer: Qt,
122
122
  onMobileViewModeChange: nt,
123
123
  onEnded: ut,
124
- onAutoAdvanceToggle: lt,
124
+ onAutoAdvanceToggle: at,
125
125
  onInteractionToggle: on,
126
126
  hasInteraction: fn,
127
127
  isInteractionOpen: Te = !1,
@@ -131,10 +131,10 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
131
131
  showControls: Ve = !0,
132
132
  onControlsPointerEnter: Xt,
133
133
  onControlsPointerLeave: qt,
134
- slideProgress: O = null,
134
+ slideProgress: N = null,
135
135
  enableKeyboardShortcuts: er = !0,
136
- subtitleSeekRequest: $ = null,
137
- customActions: at,
136
+ subtitleSeekRequest: D = null,
137
+ customActions: lt,
138
138
  customActionContext: it,
139
139
  locale: ke,
140
140
  texts: st,
@@ -142,22 +142,22 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
142
142
  onPointerDown: ot,
143
143
  ...Ie
144
144
  }) => {
145
- const Pe = Ie.dir ?? kr(ke), ft = Ie.lang ?? vr(ke), tr = wr(), mt = Tr(Fr), g = i(null), { resolvedDirection: dt, readDirection: pt } = Ar(g, Pe), ve = dt === "rtl", rr = Lr(g, ft), ht = i(Te), R = i(null), Le = i(null), K = i(0), h = i(null), de = i(void 0), k = i([]), pe = i(
146
- W ? j : w
147
- ), he = i(!1), gt = i(!1), v = i(!1), B = i(null), z = i(null), N = i(!1), c = i(!1), x = i(null), F = i(!1), Y = i(null), Ae = i(0), St = i(() => {
148
- }), Ce = i(null), ge = i(null), yt = i(null), G = i(null), bt = i(0), $e = i(!1), He = i(!1), _t = i(ne), Mt = i(() => 0), wt = i(null), V = i("unknown"), [xe, S] = Ge(w), [Tt, ue] = Ge(!1), [le, nr] = Ge({
145
+ const $e = Ie.dir ?? kr(ke), ft = Ie.lang ?? vr(ke), tr = wr(), dt = Tr(Fr), g = i(null), { resolvedDirection: mt, readDirection: pt } = Ar(g, $e), ve = mt === "rtl", rr = Lr(g, ft), ht = i(Te), R = i(null), Le = i(null), F = i(0), h = i(null), me = i(void 0), k = i([]), pe = i(
146
+ O ? z : w
147
+ ), he = i(!1), gt = i(!1), v = i(!1), W = i(null), Y = i(null), E = i(!1), c = i(!1), x = i(null), U = i(!1), G = i(null), Ae = i(0), St = i(() => {
148
+ }), Ce = i(null), ge = i(null), yt = i(null), Q = i(null), bt = i(0), He = i(!1), De = i(!1), _t = i(ne), Mt = i(() => 0), wt = i(null), V = i("unknown"), [xe, S] = Ge(w), [Tt, ue] = Ge(!1), [ae, nr] = Ge({
149
149
  next: !1,
150
150
  previous: !1
151
- }), Q = mt?.ownerId ?? tr, I = er && (mt?.enabled ?? !0), f = a >= 0 ? m[a] : void 0, A = f?.audioUrl, kt = f?.audioSegments, ur = kt?.length ?? 0, U = ce(
151
+ }), X = dt?.ownerId ?? tr, I = er && (dt?.enabled ?? !0), f = l >= 0 ? d[l] : void 0, A = f?.audioUrl, kt = f?.audioSegments, ur = kt?.length ?? 0, B = ce(
152
152
  () => jt(f),
153
153
  [f, ur, kt]
154
154
  );
155
155
  let Ne = wt.current;
156
- en(m, Ne) || (Ne = tn(m), wt.current = Ne);
157
- const vt = Ne.tracks, De = ce(
158
- () => Pr(at, it),
159
- [it, at]
160
- ), Lt = De.length + 6, lr = ce(
156
+ en(d, Ne) || (Ne = tn(d), wt.current = Ne);
157
+ const vt = Ne.tracks, Je = ce(
158
+ () => $r(lt, it),
159
+ [it, lt]
160
+ ), Lt = Je.length + 6, ar = ce(
161
161
  () => ({
162
162
  "--slide-player-mobile-control-count": String(Lt)
163
163
  }),
@@ -168,43 +168,43 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
168
168
  ...st
169
169
  }),
170
170
  [ke, st]
171
- ), Je = ce(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]), ar = W ? j : xe, At = W ? j ? o.pauseAutoplayLabel : o.playAutoplayLabel : xe ? o.pauseLabel : o.playLabel, Ct = rt ? o.exitFullscreenLabel : o.enterFullscreenLabel, X = u(
171
+ ), Pe = ce(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]), lr = O ? z : xe, At = O ? z ? o.pauseAutoplayLabel : o.playAutoplayLabel : xe ? o.pauseLabel : o.playLabel, Ct = rt ? o.exitFullscreenLabel : o.enterFullscreenLabel, q = u(
172
172
  (e, t, r) => ({
173
173
  ariaKeyShortcuts: I ? r : void 0,
174
- title: I ? an(e, t) : e
174
+ title: I ? ln(e, t) : e
175
175
  }),
176
176
  [I]
177
- ), xt = X(
177
+ ), xt = q(
178
178
  o.subtitleToggleAriaLabel,
179
- Z.subtitle,
179
+ j.subtitle,
180
180
  "c"
181
- ), Nt = X(
181
+ ), Nt = q(
182
182
  o.previousLabel,
183
- ve ? Z.next : Z.previous,
183
+ ve ? j.next : j.previous,
184
184
  ve ? "ArrowRight" : "ArrowLeft"
185
- ), Et = X(
185
+ ), Et = q(
186
186
  o.previousSubtitleLabel,
187
- Z.previousSubtitle,
187
+ j.previousSubtitle,
188
188
  "Shift+ArrowLeft"
189
- ), Kt = X(
189
+ ), Kt = q(
190
190
  At,
191
191
  o.playbackShortcutLabel,
192
192
  "Space"
193
- ), Ft = X(
193
+ ), Ft = q(
194
194
  o.nextLabel,
195
- ve ? Z.previous : Z.next,
195
+ ve ? j.previous : j.next,
196
196
  ve ? "ArrowLeft" : "ArrowRight"
197
- ), Ut = X(
197
+ ), Ut = q(
198
198
  o.nextSubtitleLabel,
199
- Z.nextSubtitle,
199
+ j.nextSubtitle,
200
200
  "Shift+ArrowRight"
201
- ), Bt = X(
201
+ ), Bt = q(
202
202
  Ct,
203
- Z.fullscreen,
203
+ j.fullscreen,
204
204
  "f"
205
205
  ), Ee = u(() => {
206
- I && Ur(Q);
207
- }, [Q, I]), ir = u(
206
+ I && Ur(X);
207
+ }, [X, I]), ir = u(
208
208
  (e) => {
209
209
  Ee(), ot?.(e);
210
210
  },
@@ -215,21 +215,21 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
215
215
  },
216
216
  [Ee, ct]
217
217
  );
218
- d(() => {
219
- de.current = f;
220
- }, [f]), d(() => {
221
- pe.current = W ? j : w;
222
- }, [w, j, W]), d(() => {
218
+ m(() => {
219
+ me.current = f;
220
+ }, [f]), m(() => {
221
+ pe.current = O ? z : w;
222
+ }, [w, z, O]), m(() => {
223
223
  Ve || ue(!1);
224
- }, [Ve]), d(() => {
224
+ }, [Ve]), m(() => {
225
225
  !ht.current && Te && ue(!1), ht.current = Te;
226
- }, [Te]), d(() => {
227
- k.current = U;
228
- }, [U]), d(() => {
229
- const e = f?.audioUrl, t = a >= 0 ? m[a + 1]?.audioUrl : void 0;
226
+ }, [Te]), m(() => {
227
+ k.current = B;
228
+ }, [B]), m(() => {
229
+ const e = f?.audioUrl, t = l >= 0 ? d[l + 1]?.audioUrl : void 0;
230
230
  Yt(e), Yt(t);
231
- }, [m, f?.audioUrl, a]);
232
- const l = u(
231
+ }, [d, f?.audioUrl, l]);
232
+ const a = u(
233
233
  (e, t = null) => {
234
234
  gt.current === e && (!e || t === null) || (gt.current = e, qe?.({
235
235
  loading: e,
@@ -237,25 +237,25 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
237
237
  }));
238
238
  },
239
239
  [qe]
240
- ), P = u(
240
+ ), $ = u(
241
241
  (e) => {
242
242
  pe.current = e, et?.(e);
243
243
  },
244
244
  [et]
245
- ), q = u(() => W ? {
245
+ ), ee = u(() => O ? {
246
246
  shouldContinuePlayback: pe.current
247
247
  } : {
248
248
  shouldContinuePlayback: Ir({
249
249
  defaultPlaying: pe.current,
250
250
  isPausedByUser: v.current
251
251
  })
252
- }, [W]), Wt = u((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), H = u(() => w && !T && !v.current && V.current !== "blocked", [w, T]), Ot = u((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Rt = u(() => {
252
+ }, [O]), Wt = u((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), J = u(() => w && !T && !v.current && V.current !== "blocked", [w, T]), Ot = u((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Rt = u(() => {
253
253
  const e = h.current;
254
254
  return e == null || e <= 0 ? 0 : k.current.slice(0, e).reduce(
255
255
  (t, r) => t + Math.max(Number(r.duration_ms ?? 0), 0),
256
256
  0
257
257
  ) / 1e3;
258
- }, []), ee = u((e) => e <= 0 ? 0 : k.current.slice(0, e).reduce(
258
+ }, []), te = u((e) => e <= 0 ? 0 : k.current.slice(0, e).reduce(
259
259
  (t, r) => t + Math.max(Number(r.duration_ms ?? 0), 0),
260
260
  0
261
261
  ), []), Ke = u(
@@ -266,23 +266,23 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
266
266
  [T]
267
267
  ), Se = u(
268
268
  (e, t, r = {}) => {
269
- const n = $r({
270
- currentAudioIndex: a,
269
+ const n = Hr({
270
+ currentAudioIndex: l,
271
271
  currentTimeMs: t,
272
272
  direction: e,
273
273
  excludeTarget: r.excludeTarget,
274
274
  tracks: vt
275
275
  });
276
276
  return !n || !Ke(
277
- m[n.audioIndex],
277
+ d[n.audioIndex],
278
278
  n.timeMs
279
- ) || n.audioIndex !== a && (!we || Be && !Be(n)) ? null : n;
279
+ ) || n.audioIndex !== l && (!we || Be && !Be(n)) ? null : n;
280
280
  },
281
281
  [
282
- m,
282
+ d,
283
283
  Be,
284
284
  Ke,
285
- a,
285
+ l,
286
286
  we,
287
287
  vt
288
288
  ]
@@ -302,111 +302,111 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
302
302
  },
303
303
  [Se]
304
304
  );
305
- d(() => {
305
+ m(() => {
306
306
  St.current = Ze, Ze(Ae.current, !0);
307
307
  }, [Ze]);
308
- const D = u(() => {
308
+ const P = u(() => {
309
309
  const e = g.current;
310
- return e ? B.current === "segment" ? ee(K.current) + Math.max(e.currentTime, 0) * 1e3 : x.current !== null && e.readyState === 0 ? x.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : h.current != null ? ee(h.current) : 0;
311
- }, [ee]);
312
- d(() => {
310
+ return e ? W.current === "segment" ? te(F.current) + Math.max(e.currentTime, 0) * 1e3 : x.current !== null && e.readyState === 0 ? x.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : h.current != null ? te(h.current) : 0;
311
+ }, [te]);
312
+ m(() => {
313
313
  _t.current = ne;
314
- }, [ne]), d(() => {
315
- Mt.current = D;
316
- }, [D]);
317
- const E = u(
314
+ }, [ne]), m(() => {
315
+ Mt.current = P;
316
+ }, [P]);
317
+ const K = u(
318
318
  (e) => {
319
319
  const t = Math.max(e, 0);
320
- Ae.current !== t && (Ae.current = t, Hr({
321
- currentAudioIndex: a,
320
+ Ae.current !== t && (Ae.current = t, Dr({
321
+ currentAudioIndex: l,
322
322
  currentTimeMs: t,
323
323
  target: ge.current
324
324
  }) && (ge.current = null), be?.(t), St.current(t));
325
325
  },
326
- [a, be]
326
+ [l, be]
327
327
  ), y = u(() => {
328
- E(D());
329
- }, [D, E]), J = u(
328
+ K(P());
329
+ }, [P, K]), Z = u(
330
330
  (e = !1, t = !1) => {
331
331
  const r = Le.current;
332
332
  if (!ne || !r)
333
333
  return;
334
334
  const n = Date.now();
335
- !e && n - bt.current < 5e3 || (bt.current = n, $e.current = t, ne({
335
+ !e && n - bt.current < 5e3 || (bt.current = n, He.current = t, ne({
336
336
  audioKey: r,
337
337
  isComplete: t,
338
- timeMs: D()
338
+ timeMs: P()
339
339
  }));
340
340
  },
341
- [D, ne]
341
+ [P, ne]
342
342
  );
343
- d(
343
+ m(
344
344
  () => () => {
345
- $e.current || _t.current?.({
345
+ He.current || _t.current?.({
346
346
  audioKey: Le.current ?? "none",
347
347
  isComplete: !1,
348
348
  timeMs: Mt.current()
349
349
  });
350
350
  },
351
351
  []
352
- ), d(() => {
353
- $e.current = !1;
354
- }, [a]);
352
+ ), m(() => {
353
+ He.current = !1;
354
+ }, [l]);
355
355
  const M = u(() => {
356
- typeof window > "u" || Y.current === null || (window.cancelAnimationFrame(Y.current), Y.current = null);
356
+ typeof window > "u" || G.current === null || (window.cancelAnimationFrame(G.current), G.current = null);
357
357
  }, []), Vt = u(() => {
358
- if (typeof window > "u" || Y.current !== null)
358
+ if (typeof window > "u" || G.current !== null)
359
359
  return;
360
360
  const e = () => {
361
361
  y();
362
362
  const t = g.current;
363
363
  if (!t || t.paused || t.ended) {
364
- Y.current = null;
364
+ G.current = null;
365
365
  return;
366
366
  }
367
- Y.current = window.requestAnimationFrame(e);
367
+ G.current = window.requestAnimationFrame(e);
368
368
  };
369
- Y.current = window.requestAnimationFrame(e);
370
- }, [y]), ae = u(() => {
369
+ G.current = window.requestAnimationFrame(e);
370
+ }, [y]), le = u(() => {
371
371
  const e = g.current;
372
- e && (M(), c.current = !1, v.current = !1, he.current = !1, B.current = null, x.current = null, N.current = !1, F.current = !1, z.current = null, e.pause(), e.removeAttribute("src"), e.load(), R.current = null, K.current = 0, h.current = null, E(0), S(!1), l(!1));
373
- }, [E, M, l]), L = u(
372
+ e && (M(), c.current = !1, v.current = !1, he.current = !1, W.current = null, x.current = null, E.current = !1, U.current = !1, Y.current = null, e.pause(), e.removeAttribute("src"), e.load(), R.current = null, F.current = 0, h.current = null, K(0), S(!1), a(!1));
373
+ }, [K, M, a]), L = u(
374
374
  (e) => {
375
375
  const t = g.current;
376
376
  if (!t)
377
377
  return !1;
378
378
  const r = t.play();
379
379
  return r && typeof r.then == "function" && r.then(() => {
380
- V.current === "unknown" && (V.current = "auto"), c.current = !1, F.current = !1;
380
+ V.current === "unknown" && (V.current = "auto"), c.current = !1, U.current = !1;
381
381
  }).catch((n) => {
382
- V.current === "unknown" && Wt(n) && (V.current = "blocked", c.current = !1, l(!1)), F.current = !1, S(!1);
382
+ V.current === "unknown" && Wt(n) && (V.current = "blocked", c.current = !1, a(!1)), U.current = !1, S(!1);
383
383
  }), !0;
384
384
  },
385
- [Wt, l]
385
+ [Wt, a]
386
386
  ), C = u(
387
387
  (e, t, r = {}) => {
388
388
  const n = g.current, b = k.current[e];
389
389
  if (!n || !b)
390
390
  return !1;
391
- const te = Ot(b.audio_data), Ye = Math.max(
391
+ const re = Ot(b.audio_data), Ye = Math.max(
392
392
  Number(r.seekTimeSeconds ?? 0),
393
393
  0
394
394
  );
395
- K.current = e, h.current = null, N.current = !1, F.current = !0, z.current = "segment", E(
396
- ee(e) + Ye * 1e3
395
+ F.current = e, h.current = null, E.current = !1, U.current = !0, Y.current = "segment", K(
396
+ te(e) + Ye * 1e3
397
397
  );
398
- const Dt = r.shouldResume ?? H();
399
- c.current = Dt, l(!1);
400
- const br = R.current !== te;
401
- return B.current = "segment", br && (n.pause(), n.removeAttribute("src"), n.load(), R.current = te, n.src = te, n.load()), x.current = Ye, n.readyState > 0 && (n.currentTime = Ye, x.current = null), Dt ? L(`start-segment:${t}`) : (c.current = !1, F.current = !1, n.pause(), S(!1), !0);
398
+ const Jt = r.shouldResume ?? J();
399
+ c.current = Jt, a(!1);
400
+ const br = R.current !== re;
401
+ return W.current = "segment", br && (n.pause(), n.removeAttribute("src"), n.load(), R.current = re, n.src = re, n.load()), x.current = Ye, n.readyState > 0 && (n.currentTime = Ye, x.current = null), Jt ? L(`start-segment:${t}`) : (c.current = !1, U.current = !1, n.pause(), S(!1), !0);
402
402
  },
403
403
  [
404
- H,
404
+ J,
405
405
  Ot,
406
- ee,
407
- E,
406
+ te,
407
+ K,
408
408
  L,
409
- l
409
+ a
410
410
  ]
411
411
  ), ie = u(
412
412
  (e, t) => {
@@ -414,22 +414,22 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
414
414
  if (!r)
415
415
  return !1;
416
416
  const n = Math.max(Number(t), 0) / 1e3;
417
- return R.current !== e && (r.pause(), r.removeAttribute("src"), r.load(), R.current = e, B.current = "url", z.current = "url", r.src = e, r.load()), x.current = n, E(n * 1e3), r.readyState > 0 && (r.currentTime = n, x.current = null), !0;
417
+ return R.current !== e && (r.pause(), r.removeAttribute("src"), r.load(), R.current = e, W.current = "url", Y.current = "url", r.src = e, r.load()), x.current = n, K(n * 1e3), r.readyState > 0 && (r.currentTime = n, x.current = null), !0;
418
418
  },
419
- [E]
419
+ [K]
420
420
  ), Fe = u(
421
421
  (e) => {
422
422
  const t = g.current;
423
423
  if (!t || !f || T)
424
424
  return !1;
425
- const r = Math.max(Number(e), 0), n = !t.paused && !t.ended || c.current || F.current || h.current !== null && pe.current && !v.current, b = Xe(
425
+ const r = Math.max(Number(e), 0), n = !t.paused && !t.ended || c.current || U.current || h.current !== null && pe.current && !v.current, b = Xe(
426
426
  k.current,
427
427
  r
428
428
  ) ? Zt(
429
429
  k.current,
430
430
  r
431
431
  ) : null;
432
- return Ce.current = null, M(), c.current = n, l(!1), n && (V.current = "manual", v.current = !1, P(!0)), b && (B.current === "segment" || !A) ? C(
432
+ return Ce.current = null, M(), c.current = n, a(!1), n && (V.current = "manual", v.current = !1, $(!0)), b && (W.current === "segment" || !A) ? C(
433
433
  b.segmentIndex,
434
434
  "subtitle-seek-segment",
435
435
  {
@@ -446,8 +446,8 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
446
446
  C,
447
447
  M,
448
448
  L,
449
- l,
450
- P
449
+ a,
450
+ $
451
451
  ]
452
452
  ), It = u(
453
453
  (e) => {
@@ -460,7 +460,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
460
460
  k.current,
461
461
  r
462
462
  ) : null;
463
- return c.current = !0, l(!1), n && (B.current === "segment" || !A) ? C(n.segmentIndex, "restore", {
463
+ return c.current = !0, a(!1), n && (W.current === "segment" || !A) ? C(n.segmentIndex, "restore", {
464
464
  seekTimeSeconds: n.segmentTimeSeconds,
465
465
  shouldResume: !0
466
466
  }) : !A || !ie(A, r) ? !1 : (L("restore"), !0);
@@ -471,111 +471,111 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
471
471
  ie,
472
472
  C,
473
473
  L,
474
- l
474
+ a
475
475
  ]
476
476
  ), ye = u(
477
477
  (e) => {
478
478
  const t = Se(
479
479
  e,
480
- D(),
480
+ P(),
481
481
  {
482
482
  excludeTarget: e === "previous" ? ge.current : null
483
483
  }
484
484
  );
485
485
  if (t === null)
486
486
  return !1;
487
- if (t.audioIndex === a) {
487
+ if (t.audioIndex === l) {
488
488
  const n = Fe(t.timeMs);
489
489
  return n && (ge.current = t), n;
490
490
  }
491
491
  const r = !!we?.(
492
492
  t,
493
- Qe(q())
493
+ Qe(ee())
494
494
  );
495
495
  return r && (ge.current = t), r;
496
496
  },
497
497
  [
498
- a,
499
- D,
500
- q,
498
+ l,
499
+ P,
500
+ ee,
501
501
  Se,
502
502
  we,
503
503
  Fe
504
504
  ]
505
505
  ), se = u(
506
506
  (e) => {
507
- M(), c.current = !1, N.current = !1, F.current = !1, y(), S(!1), l(!1), a >= 0 && ut?.(a);
507
+ M(), c.current = !1, E.current = !1, U.current = !1, y(), S(!1), a(!1), l >= 0 && ut?.(l);
508
508
  },
509
509
  [
510
- a,
510
+ l,
511
511
  ut,
512
512
  M,
513
513
  y,
514
- l
514
+ a
515
515
  ]
516
516
  ), Ue = u(
517
517
  (e) => {
518
518
  const t = g.current;
519
- return !t || B.current !== "url" || !Kr({
519
+ return !t || W.current !== "url" || !Kr({
520
520
  currentTimeSeconds: Math.max(t.currentTime, 0),
521
521
  durationSeconds: t.duration
522
522
  }) ? !1 : (c.current = !1, t.pause(), se(e), !0);
523
523
  },
524
524
  [se]
525
- ), Pt = u(() => {
526
- const e = K.current + 1, t = k.current, r = t[e], n = de.current, b = t.some((te) => te.is_final);
525
+ ), $t = u(() => {
526
+ const e = F.current + 1, t = k.current, r = t[e], n = me.current, b = t.some((re) => re.is_final);
527
527
  if (r) {
528
528
  C(e, "ended");
529
529
  return;
530
530
  }
531
531
  if (n?.isAudioStreaming || !b) {
532
- K.current = e, h.current = e, N.current = !0, c.current = w, E(ee(e)), S(!1), l(!0, "waitingForMoreAudio");
532
+ F.current = e, h.current = e, E.current = !0, c.current = w, K(te(e)), S(!1), a(!0, "waitingForMoreAudio");
533
533
  return;
534
534
  }
535
535
  se("segments-completed");
536
536
  }, [
537
537
  w,
538
538
  se,
539
- ee,
540
- E,
539
+ te,
540
+ K,
541
541
  C,
542
- l
542
+ a
543
543
  ]);
544
- d(() => {
545
- if (Le.current === Je)
544
+ m(() => {
545
+ if (Le.current === Pe)
546
546
  return;
547
- J(!0), Le.current = Je, K.current = 0, h.current = null, N.current = !1, v.current = !1, he.current = !1, c.current = !1, F.current = !1, B.current = null, z.current = null, R.current = null, M(), E(0), l(!1);
547
+ Z(!0), Le.current = Pe, F.current = 0, h.current = null, E.current = !1, v.current = !1, he.current = !1, c.current = !1, U.current = !1, W.current = null, Y.current = null, R.current = null, M(), K(0), a(!1);
548
548
  const e = g.current;
549
- e && (He.current = !0, e.pause(), e.removeAttribute("src"), e.load(), He.current = !1, S(!1));
549
+ e && (De.current = !0, e.pause(), e.removeAttribute("src"), e.load(), De.current = !1, S(!1));
550
550
  }, [
551
- a,
552
- Je,
553
- U.length,
551
+ l,
552
+ Pe,
553
+ B.length,
554
554
  A,
555
- J,
556
- E,
555
+ Z,
556
+ K,
557
557
  M,
558
- l
559
- ]), d(() => {
558
+ a
559
+ ]), m(() => {
560
560
  const e = g.current;
561
561
  if (e) {
562
562
  if (T) {
563
- he.current = !!(de.current && !v.current && (!e.paused || c.current || h.current !== null)), c.current = !1, l(!1), e.pause(), S(!1);
563
+ he.current = !!(me.current && !v.current && (!e.paused || c.current || h.current !== null)), c.current = !1, a(!1), e.pause(), S(!1);
564
564
  return;
565
565
  }
566
- if (!(!he.current || !de.current || v.current)) {
566
+ if (!(!he.current || !me.current || v.current)) {
567
567
  if (he.current = !1, h.current !== null) {
568
568
  if (h.current < k.current.length) {
569
569
  C(h.current, "external-resume");
570
570
  return;
571
571
  }
572
- c.current = !0, l(!0, "waitingForMoreAudio");
572
+ c.current = !0, a(!0, "waitingForMoreAudio");
573
573
  return;
574
574
  }
575
575
  if (!R.current && k.current.length > 0) {
576
576
  C(
577
577
  Math.min(
578
- K.current,
578
+ F.current,
579
579
  k.current.length - 1
580
580
  ),
581
581
  "external-resume-init"
@@ -589,35 +589,35 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
589
589
  T,
590
590
  C,
591
591
  L,
592
- l
593
- ]), d(() => {
592
+ a
593
+ ]), m(() => {
594
594
  const e = g.current;
595
595
  if (!e)
596
596
  return;
597
597
  if (!f) {
598
- ae();
598
+ le();
599
599
  return;
600
600
  }
601
- if (_ && _.id !== G.current)
601
+ if (_ && _.id !== Q.current)
602
602
  return;
603
603
  if (T) {
604
- c.current = !1, l(!1), e.pause(), S(!1);
604
+ c.current = !1, a(!1), e.pause(), S(!1);
605
605
  return;
606
606
  }
607
607
  const t = Vr({
608
- activeSourceType: B.current,
608
+ activeSourceType: W.current,
609
609
  hasAudioUrl: !!A,
610
- segmentCount: U.length,
611
- preferredSourceType: z.current,
610
+ segmentCount: B.length,
611
+ preferredSourceType: Y.current,
612
612
  waitingSegmentIndex: h.current
613
613
  });
614
- if (t && z.current !== t && (z.current = t), t === "url" && A) {
615
- const r = R.current !== A, n = H();
614
+ if (t && Y.current !== t && (Y.current = t), t === "url" && A) {
615
+ const r = R.current !== A, n = J();
616
616
  if (r) {
617
617
  const b = h.current !== null ? Rt() : 0;
618
618
  ie(A, b * 1e3);
619
619
  }
620
- if (c.current = n, N.current = !1, F.current = !1, l(!1), !n) {
620
+ if (c.current = n, E.current = !1, U.current = !1, a(!1), !n) {
621
621
  c.current = !1, e.pause(), S(!1);
622
622
  return;
623
623
  }
@@ -625,37 +625,37 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
625
625
  return;
626
626
  }
627
627
  if (t === "segment" && h.current !== null) {
628
- if (h.current < U.length) {
628
+ if (h.current < B.length) {
629
629
  if (v.current) {
630
- S(!1), l(!1);
630
+ S(!1), a(!1);
631
631
  return;
632
632
  }
633
633
  C(h.current, "wait-resume");
634
634
  return;
635
635
  }
636
- N.current = !0, c.current = H(), S(!1), l(H());
636
+ E.current = !0, c.current = J(), S(!1), a(J());
637
637
  return;
638
638
  }
639
- if (t === "segment" && !U.length) {
639
+ if (t === "segment" && !B.length) {
640
640
  if (f.isAudioStreaming) {
641
- h.current = K.current, N.current = !0, c.current = H(), S(!1), l(H());
641
+ h.current = F.current, E.current = !0, c.current = J(), S(!1), a(J());
642
642
  return;
643
643
  }
644
- ae();
644
+ le();
645
645
  return;
646
646
  }
647
647
  if (t === "segment" && !R.current) {
648
648
  C(
649
649
  Math.min(
650
- K.current,
651
- U.length - 1
650
+ F.current,
651
+ B.length - 1
652
652
  ),
653
653
  "effect-init"
654
654
  );
655
655
  return;
656
656
  }
657
657
  if (t !== "segment") {
658
- ae();
658
+ le();
659
659
  return;
660
660
  }
661
661
  if (!w || v.current) {
@@ -665,201 +665,201 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
665
665
  e.paused && (c.current = !0, L("sync-paused-retry"));
666
666
  }, [
667
667
  f,
668
- a,
669
- U,
668
+ l,
669
+ B,
670
670
  A,
671
671
  w,
672
672
  T,
673
673
  _,
674
- H,
675
- ae,
674
+ J,
675
+ le,
676
676
  ie,
677
677
  C,
678
678
  L,
679
679
  Rt,
680
- l
681
- ]), d(() => {
682
- if (!$ || $.id === yt.current || $.audioIndex !== a)
680
+ a
681
+ ]), m(() => {
682
+ if (!D || D.id === yt.current || D.audioIndex !== l)
683
683
  return;
684
- const e = m[$.audioIndex];
685
- Ke(e, $.timeMs) && (yt.current = $.id, Fe($.timeMs));
684
+ const e = d[D.audioIndex];
685
+ Ke(e, D.timeMs) && (yt.current = D.id, Fe(D.timeMs));
686
686
  }, [
687
- m,
687
+ d,
688
688
  Ke,
689
- a,
689
+ l,
690
690
  Fe,
691
- $
692
- ]), d(() => {
693
- if (!(!_ || _.id === G.current || a < 0)) {
691
+ D
692
+ ]), m(() => {
693
+ if (!(!_ || _.id === Q.current || l < 0)) {
694
694
  if (It(_.timeMs)) {
695
- G.current = _.id, oe?.(_.id);
695
+ Q.current = _.id, oe?.(_.id);
696
696
  return;
697
697
  }
698
- f?.isAudioStreaming || (G.current = _.id, oe?.(_.id));
698
+ f?.isAudioStreaming || (Q.current = _.id, oe?.(_.id));
699
699
  }
700
700
  }, [
701
701
  f?.isAudioStreaming,
702
- a,
702
+ l,
703
703
  oe,
704
704
  _,
705
705
  It
706
- ]), d(() => {
707
- if (!_ || _.id === G.current || a < 0 || !f?.isAudioStreaming)
706
+ ]), m(() => {
707
+ if (!_ || _.id === Q.current || l < 0 || !f?.isAudioStreaming)
708
708
  return;
709
709
  const e = window.setTimeout(() => {
710
- _.id !== G.current && (G.current = _.id, oe?.(_.id));
711
- }, ln);
710
+ _.id !== Q.current && (Q.current = _.id, oe?.(_.id));
711
+ }, an);
712
712
  return () => {
713
713
  window.clearTimeout(e);
714
714
  };
715
715
  }, [
716
716
  f?.isAudioStreaming,
717
- a,
717
+ l,
718
718
  oe,
719
719
  _
720
- ]), d(() => ae, [ae]), d(() => M, [M]);
720
+ ]), m(() => le, [le]), m(() => M, [M]);
721
721
  const cr = u(() => {
722
- y(), Vt(), S(!0), l(!1), tt?.();
722
+ y(), Vt(), S(!0), a(!1), tt?.();
723
723
  }, [
724
724
  tt,
725
725
  Vt,
726
726
  y,
727
- l
727
+ a
728
728
  ]), or = u(() => {
729
- He.current || N.current || F.current || (M(), y(), J(!0), S(!1));
730
- }, [J, M, y]), fr = u(() => {
729
+ De.current || E.current || U.current || (M(), y(), Z(!0), S(!1));
730
+ }, [Z, M, y]), fr = u(() => {
731
731
  const e = g.current;
732
732
  e && x.current !== null && (e.currentTime = x.current, x.current = null), y(), !Ue("canplay-seek-finished") && (!c.current || !w || L("canplay"));
733
733
  }, [
734
- a,
734
+ l,
735
735
  w,
736
736
  Ue,
737
737
  y,
738
738
  L
739
- ]), mr = u(() => {
739
+ ]), dr = u(() => {
740
740
  const e = g.current;
741
741
  e && x.current !== null && (e.currentTime = x.current, x.current = null), y(), Ue("metadata-seek-finished");
742
- }, [a, Ue, y]), dr = u(() => {
743
- y(), J();
744
- }, [J, y]), pr = u(() => {
745
- N.current || l(!0, "loadingAudio");
746
- }, [l]), hr = u(() => {
747
- if (N.current) {
748
- l(!0, "waitingForMoreAudio");
742
+ }, [l, Ue, y]), mr = u(() => {
743
+ y(), Z();
744
+ }, [Z, y]), pr = u(() => {
745
+ E.current || a(!0, "loadingAudio");
746
+ }, [a]), hr = u(() => {
747
+ if (E.current) {
748
+ a(!0, "waitingForMoreAudio");
749
749
  return;
750
750
  }
751
- l(!0, "loadingAudio");
752
- }, [l]), $t = u(() => {
751
+ a(!0, "loadingAudio");
752
+ }, [a]), Ht = u(() => {
753
753
  y();
754
754
  }, [y]), gr = u(() => {
755
- const e = de.current, t = B.current === "url" || k.current.length === 0, r = !!k.current[K.current + 1], n = k.current.some(
756
- (te) => te.is_final
755
+ const e = me.current, t = W.current === "url" || k.current.length === 0, r = !!k.current[F.current + 1], n = k.current.some(
756
+ (re) => re.is_final
757
757
  ), b = !!e?.isAudioStreaming;
758
- if (J(
758
+ if (Z(
759
759
  !0,
760
760
  t || !b && !r && n
761
- ), M(), F.current = !1, t) {
761
+ ), M(), U.current = !1, t) {
762
762
  se("url-ended");
763
763
  return;
764
764
  }
765
- Pt();
765
+ $t();
766
766
  }, [
767
- J,
767
+ Z,
768
768
  se,
769
- Pt,
769
+ $t,
770
770
  M
771
771
  ]), Sr = u(() => {
772
- M(), y(), S(!1), l(!1);
773
- }, [M, y, l]), yr = u(
772
+ M(), y(), S(!1), a(!1);
773
+ }, [M, y, a]), yr = u(
774
774
  (e) => {
775
775
  nt?.(e), ue(!1);
776
776
  },
777
777
  [nt]
778
778
  ), je = u(() => {
779
- if (W) {
780
- const t = !j;
781
- return P(t), lt?.(t), !0;
779
+ if (O) {
780
+ const t = !z;
781
+ return $(t), at?.(t), !0;
782
782
  }
783
783
  const e = g.current;
784
- return T || !e || !f ? !1 : h.current !== null ? xe ? (P(!1), c.current = !1, v.current = !0, h.current = null, N.current = !1, S(!1), l(!1), e.pause(), !0) : (P(!0), V.current = "manual", v.current = !1, c.current = !0, l(!0, "waitingForMoreAudio"), !0) : !e.src && U.length > 0 ? (P(!0), V.current = "manual", v.current = !1, C(
784
+ return T || !e || !f ? !1 : h.current !== null ? xe ? ($(!1), c.current = !1, v.current = !0, h.current = null, E.current = !1, S(!1), a(!1), e.pause(), !0) : ($(!0), V.current = "manual", v.current = !1, c.current = !0, a(!0, "waitingForMoreAudio"), !0) : !e.src && B.length > 0 ? ($(!0), V.current = "manual", v.current = !1, C(
785
785
  Math.min(
786
- K.current,
787
- U.length - 1
786
+ F.current,
787
+ B.length - 1
788
788
  ),
789
789
  "toggle"
790
- ), !0) : e.paused ? (P(!0), V.current = "manual", v.current = !1, c.current = !0, L("toggle-resume"), !0) : (P(!1), c.current = !1, v.current = !0, e.pause(), !0);
790
+ ), !0) : e.paused ? ($(!0), V.current = "manual", v.current = !1, c.current = !0, L("toggle-resume"), !0) : ($(!1), c.current = !1, v.current = !0, e.pause(), !0);
791
791
  }, [
792
792
  f,
793
- U.length,
794
- j,
793
+ B.length,
794
+ z,
795
795
  T,
796
796
  xe,
797
- lt,
797
+ at,
798
798
  C,
799
799
  L,
800
- l,
801
- P,
802
- W
800
+ a,
801
+ $,
802
+ O
803
803
  ]);
804
- d(() => {
804
+ m(() => {
805
805
  if (I)
806
- return Br(Q);
807
- }, [Q, I]);
806
+ return Br(X);
807
+ }, [X, I]);
808
808
  const ze = ce(
809
809
  () => ({
810
- fullscreen: () => me ? (me(), !0) : !1,
810
+ fullscreen: () => de ? (de(), !0) : !1,
811
811
  next: () => Me ? (Re || Me(
812
- Qe(q())
812
+ Qe(ee())
813
813
  ), !0) : !1,
814
- nextSubtitle: () => le.next ? ye("next") : !0,
814
+ nextSubtitle: () => ae.next ? ye("next") : !0,
815
815
  previous: () => _e ? (Oe || _e(
816
- Qe(q())
816
+ Qe(ee())
817
817
  ), !0) : !1,
818
- previousSubtitle: () => le.previous ? ye("previous") : !0,
818
+ previousSubtitle: () => ae.previous ? ye("previous") : !0,
819
819
  subtitle: () => fe ? (fe(), !0) : !1,
820
820
  togglePlayback: () => (je(), !0)
821
821
  }),
822
822
  [
823
- q,
823
+ ee,
824
824
  ye,
825
825
  Re,
826
- me,
826
+ de,
827
827
  Me,
828
828
  _e,
829
829
  fe,
830
830
  Oe,
831
- le.next,
832
- le.previous,
831
+ ae.next,
832
+ ae.previous,
833
833
  je
834
834
  ]
835
- ), Ht = i(ze);
836
- return d(() => {
837
- Ht.current = ze;
838
- }, [ze]), d(() => {
835
+ ), Dt = i(ze);
836
+ return m(() => {
837
+ Dt.current = ze;
838
+ }, [ze]), m(() => {
839
839
  if (!I || typeof document > "u")
840
840
  return;
841
841
  const e = (t) => {
842
- if (!Wr(Q))
842
+ if (!Wr(X))
843
843
  return;
844
844
  const r = Or(t, pt());
845
845
  if (!r || Rr(t, r))
846
846
  return;
847
847
  let n = !1;
848
- const b = Ht.current[r];
848
+ const b = Dt.current[r];
849
849
  n = b(), n && t.preventDefault();
850
850
  };
851
851
  return document.addEventListener("keydown", e), () => {
852
852
  document.removeEventListener("keydown", e);
853
853
  };
854
- }, [Q, pt, I]), d(() => {
854
+ }, [X, pt, I]), m(() => {
855
855
  be?.(Ae.current);
856
- }, [be]), /* @__PURE__ */ re(
856
+ }, [be]), /* @__PURE__ */ H(
857
857
  "div",
858
858
  {
859
859
  ...Ie,
860
- dir: Pe,
860
+ dir: $e,
861
861
  lang: ft,
862
- "data-slide-player-shortcut-owner": Q,
862
+ "data-slide-player-shortcut-owner": X,
863
863
  className: Cr("slide-player", p),
864
864
  onFocusCapture: sr,
865
865
  onPointerDown: ir,
@@ -871,24 +871,24 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
871
871
  preload: "auto",
872
872
  playsInline: !0,
873
873
  onLoadStart: pr,
874
- onLoadedMetadata: mr,
874
+ onLoadedMetadata: dr,
875
875
  onCanPlay: fr,
876
876
  onPlay: cr,
877
877
  onPause: or,
878
878
  onWaiting: hr,
879
- onSeeking: $t,
880
- onSeeked: $t,
881
- onTimeUpdate: dr,
879
+ onSeeking: Ht,
880
+ onSeeked: Ht,
881
+ onTimeUpdate: mr,
882
882
  onEnded: gr,
883
883
  onError: Sr
884
884
  }
885
885
  ),
886
- Ve ? /* @__PURE__ */ re(Jt, { children: [
886
+ Ve ? /* @__PURE__ */ H(Pt, { children: [
887
887
  /* @__PURE__ */ s(
888
888
  xr,
889
889
  {
890
890
  container: Qt,
891
- dir: Pe ?? dt,
891
+ dir: $e ?? mt,
892
892
  lang: rr,
893
893
  labels: {
894
894
  closeSettings: o.closeSettingsLabel,
@@ -910,15 +910,15 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
910
910
  viewMode: Gt
911
911
  }
912
912
  ),
913
- /* @__PURE__ */ re(
913
+ /* @__PURE__ */ H(
914
914
  "div",
915
915
  {
916
916
  className: "slide-player__controls",
917
917
  onPointerEnter: Xt,
918
918
  onPointerLeave: qt,
919
- style: lr,
919
+ style: ar,
920
920
  children: [
921
- /* @__PURE__ */ re("div", { className: "slide-player__group", children: [
921
+ /* @__PURE__ */ H("div", { className: "slide-player__group", children: [
922
922
  /* @__PURE__ */ s(
923
923
  "button",
924
924
  {
@@ -931,7 +931,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
931
931
  },
932
932
  type: "button",
933
933
  children: /* @__PURE__ */ s(
934
- Dr,
934
+ Jr,
935
935
  {
936
936
  className: "slide-player__icon",
937
937
  strokeWidth: 2.25
@@ -945,7 +945,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
945
945
  "aria-label": o.volumeAriaLabel,
946
946
  className: "hidden",
947
947
  type: "button",
948
- children: /* @__PURE__ */ s(Jr, { className: "slide-player__icon", strokeWidth: 2.25 })
948
+ children: /* @__PURE__ */ s(Pr, { className: "slide-player__icon", strokeWidth: 2.25 })
949
949
  }
950
950
  ),
951
951
  /* @__PURE__ */ s(
@@ -959,7 +959,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
959
959
  },
960
960
  title: Kt.title,
961
961
  type: "button",
962
- children: ar ? /* @__PURE__ */ s(rn, {}) : /* @__PURE__ */ s(nn, {})
962
+ children: lr ? /* @__PURE__ */ s(rn, {}) : /* @__PURE__ */ s(nn, {})
963
963
  }
964
964
  ),
965
965
  /* @__PURE__ */ s(
@@ -970,7 +970,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
970
970
  className: "slide-player__action slide-player__action--prev",
971
971
  disabled: Oe,
972
972
  onClick: () => {
973
- _e?.(q());
973
+ _e?.(ee());
974
974
  },
975
975
  title: Nt.title,
976
976
  type: "button",
@@ -985,7 +985,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
985
985
  className: "slide-player__action slide-player__action--next",
986
986
  disabled: Re,
987
987
  onClick: () => {
988
- Me?.(q());
988
+ Me?.(ee());
989
989
  },
990
990
  title: Ft.title,
991
991
  type: "button",
@@ -1004,7 +1004,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
1004
1004
  "aria-keyshortcuts": Et.ariaKeyShortcuts,
1005
1005
  "aria-label": o.previousSubtitleLabel,
1006
1006
  className: "slide-player__action slide-player__action--prev-subtitle",
1007
- disabled: !le.previous,
1007
+ disabled: !ae.previous,
1008
1008
  onClick: () => {
1009
1009
  ye("previous");
1010
1010
  },
@@ -1019,7 +1019,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
1019
1019
  "aria-keyshortcuts": Ut.ariaKeyShortcuts,
1020
1020
  "aria-label": o.nextSubtitleLabel,
1021
1021
  className: "slide-player__action slide-player__action--next-subtitle",
1022
- disabled: !le.next,
1022
+ disabled: !ae.next,
1023
1023
  onClick: () => {
1024
1024
  ye("next");
1025
1025
  },
@@ -1053,13 +1053,13 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
1053
1053
  )
1054
1054
  }
1055
1055
  ),
1056
- me ? /* @__PURE__ */ s(
1056
+ de ? /* @__PURE__ */ s(
1057
1057
  "button",
1058
1058
  {
1059
1059
  "aria-label": Ct,
1060
1060
  "aria-keyshortcuts": Bt.ariaKeyShortcuts,
1061
1061
  className: "slide-player__action slide-player__action--fullscreen",
1062
- onClick: me,
1062
+ onClick: de,
1063
1063
  title: Bt.title,
1064
1064
  type: "button",
1065
1065
  children: rt ? /* @__PURE__ */ s(
@@ -1078,31 +1078,40 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
1078
1078
  }
1079
1079
  ) : null
1080
1080
  ] }),
1081
- De.length > 0 ? /* @__PURE__ */ re(Jt, { children: [
1081
+ Je.length > 0 ? /* @__PURE__ */ H(Pt, { children: [
1082
1082
  /* @__PURE__ */ s("div", { className: "slide-player__separator" }),
1083
- /* @__PURE__ */ s("div", { className: "slide-player__group slide-player__group--custom-actions", children: De.map((e, t) => /* @__PURE__ */ s(_r.Fragment, { children: e }, `custom-action-${t}`)) })
1083
+ /* @__PURE__ */ s("div", { className: "slide-player__group slide-player__group--custom-actions", children: Je.map((e, t) => /* @__PURE__ */ s(_r.Fragment, { children: e }, `custom-action-${t}`)) })
1084
1084
  ] }) : null
1085
1085
  ]
1086
1086
  }
1087
1087
  ),
1088
- O && O.totalSteps > 1 ? /* @__PURE__ */ s(
1088
+ N && (N.totalSteps > 1 || N.isGenerating) ? /* @__PURE__ */ s(
1089
1089
  "div",
1090
1090
  {
1091
- "aria-label": O.ariaLabel,
1091
+ "aria-label": N.ariaLabel,
1092
1092
  className: "slide-player__slide-progress",
1093
1093
  role: "navigation",
1094
- children: Array.from({ length: O.totalSteps }, (e, t) => /* @__PURE__ */ s(
1095
- "button",
1096
- {
1097
- "aria-current": t === O.currentIndex ? "step" : void 0,
1098
- "aria-label": `${O.ariaLabel} ${t + 1}`,
1099
- className: "slide-player__slide-progress-segment",
1100
- "data-state": t < O.currentIndex ? "completed" : t === O.currentIndex ? "current" : "upcoming",
1101
- onClick: () => O.onNavigate?.(t),
1102
- type: "button"
1103
- },
1104
- t
1105
- ))
1094
+ children: /* @__PURE__ */ H("div", { className: "slide-player__slide-progress-track", children: [
1095
+ Array.from(
1096
+ { length: N.totalSteps },
1097
+ (e, t) => /* @__PURE__ */ s(
1098
+ "button",
1099
+ {
1100
+ "aria-current": t === N.currentIndex ? "step" : void 0,
1101
+ "aria-label": `${N.ariaLabel} ${t + 1}`,
1102
+ className: "slide-player__slide-progress-segment",
1103
+ "data-state": t < N.currentIndex ? "completed" : t === N.currentIndex ? "current" : "upcoming",
1104
+ onClick: () => N.onNavigate?.(t),
1105
+ type: "button"
1106
+ },
1107
+ t
1108
+ )
1109
+ ),
1110
+ N.isGenerating ? /* @__PURE__ */ H("span", { className: "slide-player__slide-progress-generating", children: [
1111
+ /* @__PURE__ */ s("span", { "aria-hidden": "true" }),
1112
+ N.generatingLabel
1113
+ ] }) : null
1114
+ ] })
1106
1115
  }
1107
1116
  ) : null
1108
1117
  ] }) : null