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