markdown-flow-ui 0.3.9 → 0.3.11

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