markdown-flow-ui 0.1.123 → 0.1.124

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