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.
- package/dist/components/Slide/Player.cjs.js +1 -1
- package/dist/components/Slide/Player.cjs.js.map +1 -1
- package/dist/components/Slide/Player.es.js +191 -201
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs.js +1 -1
- package/dist/components/Slide/Slide.cjs.js.map +1 -1
- package/dist/components/Slide/Slide.es.js +116 -116
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/utils/playbackPreference.cjs.js +1 -1
- package/dist/components/Slide/utils/playbackPreference.cjs.js.map +1 -1
- package/dist/components/Slide/utils/playbackPreference.d.ts +1 -6
- package/dist/components/Slide/utils/playbackPreference.es.js +4 -9
- package/dist/components/Slide/utils/playbackPreference.es.js.map +1 -1
- package/dist/node_modules/cose-base/cose-base.cjs.js +1 -1
- package/dist/node_modules/cose-base/cose-base.cjs.js.map +1 -1
- package/dist/node_modules/cose-base/cose-base.es.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.js.map +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.es.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.js.map +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.es.js +1 -1
- package/dist/node_modules/layout-base/layout-base.cjs.js +1 -1
- package/dist/node_modules/layout-base/layout-base.cjs.js.map +1 -1
- package/dist/node_modules/layout-base/layout-base.es.js +1 -1
- 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
|
|
3
|
-
import { cn as
|
|
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
|
|
7
|
-
import { hasReachedAudioEnd as
|
|
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
|
|
22
|
-
if (typeof window > "u" || !
|
|
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 =
|
|
26
|
-
},
|
|
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
|
-
),
|
|
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:
|
|
65
|
+
audioList: R = [],
|
|
66
66
|
className: U,
|
|
67
67
|
currentAudioIndex: m = -1,
|
|
68
|
-
defaultPlaying:
|
|
69
|
-
isPlaybackPaused:
|
|
70
|
-
isAutoAdvanceEnabled:
|
|
71
|
-
useAutoAdvanceToggle:
|
|
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:
|
|
76
|
-
onSubtitleToggle:
|
|
75
|
+
onPlaybackTimeChange: G,
|
|
76
|
+
onSubtitleToggle: ie,
|
|
77
77
|
onPrev: Ue,
|
|
78
|
-
onNext:
|
|
79
|
-
onFullscreen:
|
|
78
|
+
onNext: Pe,
|
|
79
|
+
onFullscreen: oe,
|
|
80
80
|
isFullscreen: fe = !1,
|
|
81
|
-
mobileViewMode:
|
|
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
|
|
99
|
-
|
|
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
|
-
[
|
|
103
|
-
), Se =
|
|
104
|
+
[f?.audioSegments]
|
|
105
|
+
), Se = Y(
|
|
104
106
|
() => mr(pe, he),
|
|
105
107
|
[he, pe]
|
|
106
|
-
), we = Se.length + 5, qe =
|
|
108
|
+
), we = Se.length + 5, qe = Y(
|
|
107
109
|
() => ({
|
|
108
110
|
"--slide-player-mobile-control-count": String(we)
|
|
109
111
|
}),
|
|
110
112
|
[we]
|
|
111
|
-
),
|
|
113
|
+
), B = Y(
|
|
112
114
|
() => ({
|
|
113
115
|
...cr,
|
|
114
116
|
...ye
|
|
115
117
|
}),
|
|
116
118
|
[ye]
|
|
117
|
-
), se =
|
|
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
|
-
|
|
120
|
-
}, [
|
|
121
|
-
|
|
122
|
-
}, [
|
|
123
|
-
te ||
|
|
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 &&
|
|
127
|
+
!ge.current && D && K(!1), ge.current = D;
|
|
126
128
|
}, [D]), x(() => {
|
|
127
|
-
|
|
128
|
-
}, [
|
|
129
|
-
const e =
|
|
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
|
-
}, [
|
|
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
|
-
),
|
|
142
|
+
), O = u(
|
|
141
143
|
(e) => {
|
|
142
|
-
|
|
144
|
+
Q.current = e, ae?.(e);
|
|
143
145
|
},
|
|
144
146
|
[ae]
|
|
145
|
-
),
|
|
146
|
-
shouldContinuePlayback:
|
|
147
|
+
), Me = u(() => T ? {
|
|
148
|
+
shouldContinuePlayback: Q.current
|
|
147
149
|
} : {
|
|
148
150
|
shouldContinuePlayback: dr({
|
|
149
|
-
defaultPlaying:
|
|
150
|
-
|
|
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 :
|
|
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
|
-
}, []),
|
|
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
|
-
), []),
|
|
174
|
-
const e =
|
|
175
|
-
return e ?
|
|
176
|
-
}, [
|
|
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
|
-
|
|
169
|
+
ne.current !== r && (ne.current = r, G?.(r));
|
|
180
170
|
},
|
|
181
|
-
[
|
|
171
|
+
[G]
|
|
182
172
|
), i = u(() => {
|
|
183
|
-
b(
|
|
184
|
-
}, [
|
|
173
|
+
b(Ne());
|
|
174
|
+
}, [Ne, b]), d = u(() => {
|
|
185
175
|
typeof window > "u" || W.current === null || (window.cancelAnimationFrame(W.current), W.current = null);
|
|
186
|
-
}, []),
|
|
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 =
|
|
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]),
|
|
200
|
-
const e =
|
|
201
|
-
e && (d(), s.current = !1,
|
|
202
|
-
}, [b, d, n]),
|
|
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 =
|
|
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
|
-
|
|
199
|
+
v.current === "unknown" && (v.current = "auto"), s.current = !1, w.current = !1;
|
|
210
200
|
}).catch((N) => {
|
|
211
|
-
|
|
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
|
-
[
|
|
204
|
+
[ke, n]
|
|
215
205
|
), E = u(
|
|
216
206
|
(e, r) => {
|
|
217
|
-
const l =
|
|
207
|
+
const l = p.current, N = j.current[e];
|
|
218
208
|
if (!l || !N)
|
|
219
209
|
return !1;
|
|
220
|
-
const
|
|
221
|
-
S.current = e, c.current = null,
|
|
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 !==
|
|
225
|
-
return
|
|
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
|
-
|
|
220
|
+
Z,
|
|
231
221
|
b,
|
|
232
|
-
|
|
222
|
+
k,
|
|
233
223
|
n
|
|
234
224
|
]
|
|
235
|
-
),
|
|
225
|
+
), z = u(
|
|
236
226
|
(e) => {
|
|
237
|
-
d(), s.current = !1,
|
|
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 =
|
|
249
|
-
return !r ||
|
|
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(),
|
|
242
|
+
}) ? !1 : (s.current = !1, r.pause(), z(e), !0);
|
|
253
243
|
},
|
|
254
|
-
[
|
|
244
|
+
[z]
|
|
255
245
|
), Re = u(() => {
|
|
256
|
-
const e = S.current + 1, r =
|
|
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 || !
|
|
262
|
-
S.current = e, c.current = e,
|
|
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
|
-
|
|
255
|
+
z("segments-completed");
|
|
266
256
|
}, [
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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,
|
|
278
|
-
const e =
|
|
279
|
-
e && (e.pause(), e.removeAttribute("src"), e.load(),
|
|
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
|
-
|
|
284
|
-
|
|
273
|
+
M.length,
|
|
274
|
+
V,
|
|
285
275
|
b,
|
|
286
276
|
d,
|
|
287
277
|
n
|
|
288
278
|
]), x(() => {
|
|
289
|
-
const e =
|
|
279
|
+
const e = p.current;
|
|
290
280
|
if (e) {
|
|
291
|
-
if (
|
|
292
|
-
X.current = !!(
|
|
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 || !
|
|
285
|
+
if (!(!X.current || !J.current || h.current)) {
|
|
296
286
|
if (X.current = !1, c.current !== null) {
|
|
297
|
-
if (c.current <
|
|
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 &&
|
|
294
|
+
if (!C.current && j.current.length > 0) {
|
|
305
295
|
E(
|
|
306
296
|
Math.min(
|
|
307
297
|
S.current,
|
|
308
|
-
|
|
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,
|
|
304
|
+
e.paused && (s.current = !0, k("external-resume"));
|
|
315
305
|
}
|
|
316
306
|
}
|
|
317
307
|
}, [
|
|
318
|
-
|
|
308
|
+
P,
|
|
319
309
|
E,
|
|
320
|
-
|
|
310
|
+
k,
|
|
321
311
|
n
|
|
322
312
|
]), x(() => {
|
|
323
|
-
const e =
|
|
313
|
+
const e = p.current;
|
|
324
314
|
if (!e)
|
|
325
315
|
return;
|
|
326
|
-
if (!
|
|
327
|
-
|
|
316
|
+
if (!f) {
|
|
317
|
+
q();
|
|
328
318
|
return;
|
|
329
319
|
}
|
|
330
|
-
if (
|
|
331
|
-
s.current = !1, n(!1), e.pause(),
|
|
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:
|
|
336
|
-
hasAudioUrl: !!
|
|
337
|
-
segmentCount:
|
|
338
|
-
preferredSourceType:
|
|
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 &&
|
|
342
|
-
const l = C.current !==
|
|
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
|
|
345
|
-
e.pause(), e.removeAttribute("src"), e.load(), C.current =
|
|
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,
|
|
348
|
-
s.current = !1, e.pause(),
|
|
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
|
-
|
|
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 <
|
|
356
|
-
if (
|
|
357
|
-
|
|
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
|
-
|
|
353
|
+
_.current = !0, s.current = F(), o(!1), n(F());
|
|
364
354
|
return;
|
|
365
355
|
}
|
|
366
|
-
if (r === "segment" && !
|
|
367
|
-
if (
|
|
368
|
-
c.current = S.current,
|
|
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
|
-
|
|
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
|
-
|
|
368
|
+
M.length - 1
|
|
379
369
|
),
|
|
380
370
|
"effect-init"
|
|
381
371
|
);
|
|
382
372
|
return;
|
|
383
373
|
}
|
|
384
374
|
if (r !== "segment") {
|
|
385
|
-
|
|
375
|
+
q();
|
|
386
376
|
return;
|
|
387
377
|
}
|
|
388
|
-
if (!
|
|
389
|
-
s.current = !1, e.pause(),
|
|
378
|
+
if (!g || h.current) {
|
|
379
|
+
s.current = !1, e.pause(), o(!1);
|
|
390
380
|
return;
|
|
391
381
|
}
|
|
392
|
-
e.paused && (s.current = !0,
|
|
382
|
+
e.paused && (s.current = !0, k("sync-paused-retry"));
|
|
393
383
|
}, [
|
|
394
|
-
|
|
384
|
+
f,
|
|
395
385
|
m,
|
|
396
|
-
|
|
386
|
+
M,
|
|
387
|
+
V,
|
|
388
|
+
g,
|
|
397
389
|
P,
|
|
398
|
-
p,
|
|
399
|
-
j,
|
|
400
390
|
F,
|
|
401
391
|
b,
|
|
402
|
-
|
|
392
|
+
q,
|
|
403
393
|
E,
|
|
404
|
-
|
|
405
|
-
|
|
394
|
+
k,
|
|
395
|
+
Ee,
|
|
406
396
|
n
|
|
407
|
-
]), x(() =>
|
|
397
|
+
]), x(() => q, [q]), x(() => d, [d]);
|
|
408
398
|
const Xe = u(() => {
|
|
409
|
-
i(),
|
|
399
|
+
i(), Ae(), o(!0), n(!1), ce?.();
|
|
410
400
|
}, [
|
|
411
401
|
ce,
|
|
412
|
-
|
|
402
|
+
Ae,
|
|
413
403
|
i,
|
|
414
404
|
n
|
|
415
405
|
]), Ye = u(() => {
|
|
416
|
-
|
|
406
|
+
_.current || w.current || (d(), i(), o(!1));
|
|
417
407
|
}, [m, d, i]), Ge = u(() => {
|
|
418
|
-
const e =
|
|
419
|
-
e &&
|
|
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
|
-
|
|
412
|
+
g,
|
|
423
413
|
I,
|
|
424
414
|
i,
|
|
425
|
-
|
|
415
|
+
k
|
|
426
416
|
]), Je = u(() => {
|
|
427
|
-
const e =
|
|
428
|
-
e &&
|
|
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
|
-
|
|
422
|
+
_.current || n(!0, "loadingAudio");
|
|
433
423
|
}, [n]), er = u(() => {
|
|
434
|
-
if (
|
|
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 =
|
|
432
|
+
const e = L.current === "url" || j.current.length === 0;
|
|
443
433
|
if (d(), w.current = !1, e) {
|
|
444
|
-
|
|
434
|
+
z("url-ended");
|
|
445
435
|
return;
|
|
446
436
|
}
|
|
447
437
|
Re();
|
|
448
|
-
}, [
|
|
449
|
-
d(), i(),
|
|
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),
|
|
442
|
+
de?.(e), K(!1);
|
|
453
443
|
},
|
|
454
444
|
[de]
|
|
455
445
|
);
|
|
456
446
|
return x(() => {
|
|
457
|
-
|
|
458
|
-
}, [
|
|
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:
|
|
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:
|
|
485
|
-
nonFullscreen:
|
|
486
|
-
screen:
|
|
487
|
-
subtitle:
|
|
488
|
-
subtitleToggle:
|
|
489
|
-
title:
|
|
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: () =>
|
|
493
|
-
onOpenChange:
|
|
494
|
-
onSubtitleToggle:
|
|
482
|
+
onClose: () => K(!1),
|
|
483
|
+
onOpenChange: K,
|
|
484
|
+
onSubtitleToggle: ie ?? (() => {
|
|
495
485
|
}),
|
|
496
486
|
onViewModeChange: nr,
|
|
497
487
|
open: xe,
|
|
498
|
-
viewMode:
|
|
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
|
-
|
|
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":
|
|
517
|
+
"aria-label": B.subtitleToggleAriaLabel,
|
|
528
518
|
"aria-pressed": re,
|
|
529
519
|
className: "slide-player__action slide-player__action--subtitle",
|
|
530
|
-
onClick:
|
|
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?.(
|
|
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 (
|
|
561
|
-
const r =
|
|
562
|
-
|
|
550
|
+
if (T) {
|
|
551
|
+
const r = !$;
|
|
552
|
+
O(r), Be?.(r);
|
|
563
553
|
return;
|
|
564
554
|
}
|
|
565
|
-
const e =
|
|
566
|
-
if (!(
|
|
555
|
+
const e = p.current;
|
|
556
|
+
if (!(P || !e || !f)) {
|
|
567
557
|
if (c.current !== null) {
|
|
568
|
-
if (
|
|
569
|
-
|
|
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
|
-
|
|
562
|
+
O(!0), v.current = "manual", h.current = !1, s.current = !0, n(!0, "waitingForMoreAudio");
|
|
573
563
|
return;
|
|
574
564
|
}
|
|
575
|
-
if (!e.src &&
|
|
576
|
-
|
|
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
|
-
|
|
569
|
+
M.length - 1
|
|
580
570
|
),
|
|
581
571
|
"toggle"
|
|
582
572
|
);
|
|
583
573
|
return;
|
|
584
574
|
}
|
|
585
575
|
if (e.paused) {
|
|
586
|
-
|
|
576
|
+
O(!0), v.current = "manual", h.current = !1, s.current = !0, k("toggle-resume");
|
|
587
577
|
return;
|
|
588
578
|
}
|
|
589
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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
|
-
},
|
|
660
|
-
|
|
649
|
+
}, Er = lr(jr);
|
|
650
|
+
Er.displayName = "Player";
|
|
661
651
|
export {
|
|
662
|
-
|
|
652
|
+
Er as default
|
|
663
653
|
};
|
|
664
654
|
//# sourceMappingURL=Player.es.js.map
|