markdown-flow-ui 0.1.123 → 0.1.125
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/_virtual/index.cjs8.js +1 -1
- package/dist/_virtual/index.cjs9.js +1 -1
- package/dist/_virtual/index.es8.js +2 -2
- package/dist/_virtual/index.es9.js +2 -2
- package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js +1 -1
- package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js.map +1 -1
- package/dist/components/Slide/MobilePlayerSettingsSheet.d.ts +2 -0
- package/dist/components/Slide/MobilePlayerSettingsSheet.es.js +7 -6
- package/dist/components/Slide/MobilePlayerSettingsSheet.es.js.map +1 -1
- package/dist/components/Slide/Player.cjs.js +1 -1
- package/dist/components/Slide/Player.cjs.js.map +1 -1
- package/dist/components/Slide/Player.d.ts +37 -1
- package/dist/components/Slide/Player.es.js +602 -487
- 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.d.ts +13 -0
- package/dist/components/Slide/Slide.es.js +528 -501
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/constants.cjs.js +1 -1
- package/dist/components/Slide/constants.cjs.js.map +1 -1
- package/dist/components/Slide/constants.d.ts +13 -0
- package/dist/components/Slide/constants.es.js +13 -0
- package/dist/components/Slide/constants.es.js.map +1 -1
- package/dist/components/Slide/useWakePlayerFromIframe.cjs.js +1 -1
- package/dist/components/Slide/useWakePlayerFromIframe.cjs.js.map +1 -1
- package/dist/components/Slide/useWakePlayerFromIframe.d.ts +12 -1
- package/dist/components/Slide/useWakePlayerFromIframe.es.js +70 -39
- package/dist/components/Slide/useWakePlayerFromIframe.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/components/Slide/utils/playerKeyboardShortcutContext.cjs.js +2 -0
- package/dist/components/Slide/utils/playerKeyboardShortcutContext.cjs.js.map +1 -0
- package/dist/components/Slide/utils/playerKeyboardShortcutContext.d.ts +5 -0
- package/dist/components/Slide/utils/playerKeyboardShortcutContext.es.js +6 -0
- package/dist/components/Slide/utils/playerKeyboardShortcutContext.es.js.map +1 -0
- package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.js +2 -0
- package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.js.map +1 -0
- package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +19 -0
- package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +58 -0
- package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -0
- package/dist/components/Slide/utils/playerKeyboardShortcuts.test.d.ts +1 -0
- package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
- package/dist/node_modules/classnames/index.cjs.js +1 -1
- package/dist/node_modules/classnames/index.es.js +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 +2 -1
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { cn as
|
|
4
|
-
import
|
|
5
|
-
import { DEFAULT_SLIDE_PLAYER_TEXTS as
|
|
6
|
-
import { DEFAULT_MOBILE_VIEW_MODE as
|
|
7
|
-
import { hasReachedAudioEnd as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { j as n } from "../../_virtual/jsx-runtime.es.js";
|
|
2
|
+
import jr, { memo as Rr, useId as Er, useContext as Cr, useRef as c, useState as nr, useMemo as G, useCallback as t, useEffect as m } from "react";
|
|
3
|
+
import { cn as ur } from "../../lib/utils.es.js";
|
|
4
|
+
import Nr from "./MobilePlayerSettingsSheet.es.js";
|
|
5
|
+
import { DEFAULT_SLIDE_PLAYER_TEXTS as vr } from "./constants.es.js";
|
|
6
|
+
import { DEFAULT_MOBILE_VIEW_MODE as Tr } from "./utils/mobileScreenMode.es.js";
|
|
7
|
+
import { hasReachedAudioEnd as Kr } from "./utils/audioCompletion.es.js";
|
|
8
|
+
import { PlayerKeyboardShortcutContext as Ur } from "./utils/playerKeyboardShortcutContext.es.js";
|
|
9
|
+
import { activatePlayerKeyboardShortcutOwner as Fr, registerPlayerKeyboardShortcutOwner as Pr, isActivePlayerKeyboardShortcutOwner as Wr, getPlayerKeyboardShortcutAction as Or, shouldIgnorePlayerKeyboardShortcutEvent as Br } from "./utils/playerKeyboardShortcuts.es.js";
|
|
10
|
+
import { resolveAudioPlaybackSourceType as Vr } from "./utils/playbackSource.es.js";
|
|
11
|
+
import { shouldKeepPlayingAfterNavigation as Hr } from "./utils/playbackPreference.es.js";
|
|
12
|
+
import { toPlayerCustomActionList as $r } from "./utils/playerCustomActions.es.js";
|
|
11
13
|
/* empty css */
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
const
|
|
22
|
-
if (typeof window > "u" || !
|
|
14
|
+
import Zr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
|
|
15
|
+
import qr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
|
|
16
|
+
import zr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
|
|
17
|
+
import Yr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
|
|
18
|
+
import Dr from "../../node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
|
|
19
|
+
import Xr from "../../node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
|
|
20
|
+
import Gr from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
|
|
21
|
+
import Jr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
|
|
22
|
+
import Qr from "../../node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
|
|
23
|
+
const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
24
|
+
if (typeof window > "u" || !k || ar.has(k))
|
|
23
25
|
return;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
},
|
|
26
|
+
const j = window.document.createElement("audio");
|
|
27
|
+
j.preload = "auto", j.setAttribute("playsinline", "true"), j.src = k, j.load(), ar.set(k, j);
|
|
28
|
+
}, Ir = () => /* @__PURE__ */ n.jsxs(
|
|
27
29
|
"svg",
|
|
28
30
|
{
|
|
29
31
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -32,17 +34,17 @@ const Le = /* @__PURE__ */ new Map(), Fe = (T) => {
|
|
|
32
34
|
viewBox: "0 0 34 34",
|
|
33
35
|
fill: "none",
|
|
34
36
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ n.jsx(
|
|
36
38
|
"path",
|
|
37
39
|
{
|
|
38
40
|
d: "M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",
|
|
39
41
|
fill: "#0A0A0A"
|
|
40
42
|
}
|
|
41
43
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ n.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
|
|
43
45
|
]
|
|
44
46
|
}
|
|
45
|
-
),
|
|
47
|
+
), et = () => /* @__PURE__ */ n.jsxs(
|
|
46
48
|
"svg",
|
|
47
49
|
{
|
|
48
50
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -51,614 +53,727 @@ const Le = /* @__PURE__ */ new Map(), Fe = (T) => {
|
|
|
51
53
|
viewBox: "0 0 34 34",
|
|
52
54
|
fill: "none",
|
|
53
55
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ n.jsx(
|
|
55
57
|
"path",
|
|
56
58
|
{
|
|
57
59
|
d: "M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",
|
|
58
60
|
fill: "#0A0A0A"
|
|
59
61
|
}
|
|
60
62
|
),
|
|
61
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ n.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
|
|
62
64
|
]
|
|
63
65
|
}
|
|
64
|
-
),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
66
|
+
), J = {
|
|
67
|
+
fullscreen: "F",
|
|
68
|
+
next: "→",
|
|
69
|
+
notes: "N",
|
|
70
|
+
playback: "Space",
|
|
71
|
+
previous: "←",
|
|
72
|
+
subtitle: "C"
|
|
73
|
+
}, rt = (k, j) => k ? `${k} (${j})` : j, tt = ({
|
|
74
|
+
audioList: k = [],
|
|
75
|
+
className: j,
|
|
76
|
+
currentAudioIndex: h = -1,
|
|
77
|
+
defaultPlaying: g = !0,
|
|
78
|
+
isPlaybackPaused: K = !1,
|
|
79
|
+
isAutoAdvanceEnabled: O = !0,
|
|
80
|
+
useAutoAdvanceToggle: N = !1,
|
|
81
|
+
onLoadingChange: xe,
|
|
82
|
+
onPlaybackPreferenceChange: ke,
|
|
83
|
+
onPlaybackStarted: Me,
|
|
84
|
+
onPlaybackTimeChange: ne,
|
|
85
|
+
onSubtitleToggle: Q,
|
|
86
|
+
onPrev: ue,
|
|
87
|
+
onNext: ae,
|
|
88
|
+
onFullscreen: I,
|
|
89
|
+
isFullscreen: Le = !1,
|
|
90
|
+
mobileViewMode: lr = Tr,
|
|
91
|
+
settingsPortalContainer: cr,
|
|
92
|
+
onMobileViewModeChange: Ae,
|
|
93
|
+
onEnded: je,
|
|
94
|
+
onAutoAdvanceToggle: Re,
|
|
95
|
+
onInteractionToggle: se,
|
|
96
|
+
hasInteraction: me = !1,
|
|
97
|
+
isInteractionOpen: ee = !1,
|
|
98
|
+
isSubtitleEnabled: pe = !0,
|
|
99
|
+
prevDisabled: he = !1,
|
|
100
|
+
nextDisabled: ye = !1,
|
|
101
|
+
showControls: be = !0,
|
|
102
|
+
enableKeyboardShortcuts: or = !0,
|
|
103
|
+
customActions: Ee,
|
|
104
|
+
customActionContext: Ce,
|
|
105
|
+
texts: Ne,
|
|
106
|
+
onFocusCapture: ve,
|
|
107
|
+
onPointerDown: Te,
|
|
108
|
+
...ir
|
|
97
109
|
}) => {
|
|
98
|
-
const
|
|
99
|
-
|
|
110
|
+
const fr = Er(), Ke = Cr(Ur), y = c(null), Ue = c(ee), U = c(null), Fe = c(null), R = c(0), o = c(null), le = c(void 0), v = c([]), ce = c(
|
|
111
|
+
N ? O : g
|
|
112
|
+
), re = c(!1), Pe = c(!1), b = c(!1), F = c(null), q = c(null), _ = c(!1), s = c(!1), S = c(null), E = c(!1), B = c(null), Se = c(0), P = c("unknown"), [oe, f] = nr(g), [We, z] = nr(!1), V = Ke?.ownerId ?? fr, T = or && (Ke?.enabled ?? !0), d = h >= 0 ? k[h] : void 0, H = d?.audioUrl, M = G(
|
|
113
|
+
() => [...d?.audioSegments ?? []].sort(
|
|
100
114
|
(e, r) => e.segment_index - r.segment_index
|
|
101
115
|
),
|
|
102
|
-
[
|
|
103
|
-
),
|
|
104
|
-
() =>
|
|
105
|
-
[
|
|
106
|
-
),
|
|
116
|
+
[d?.audioSegments]
|
|
117
|
+
), Oe = G(
|
|
118
|
+
() => $r(Ee, Ce),
|
|
119
|
+
[Ce, Ee]
|
|
120
|
+
), Be = Oe.length + 5, dr = G(
|
|
107
121
|
() => ({
|
|
108
|
-
"--slide-player-mobile-control-count": String(
|
|
122
|
+
"--slide-player-mobile-control-count": String(Be)
|
|
109
123
|
}),
|
|
110
|
-
[
|
|
111
|
-
),
|
|
124
|
+
[Be]
|
|
125
|
+
), l = G(
|
|
112
126
|
() => ({
|
|
113
|
-
...
|
|
114
|
-
...
|
|
127
|
+
...vr,
|
|
128
|
+
...Ne
|
|
115
129
|
}),
|
|
116
|
-
[
|
|
117
|
-
),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
[Ne]
|
|
131
|
+
), ge = G(() => d ? d.audioKey ?? `${String(d.sequenceNumber ?? "none")}:${String(d.audioUrl ?? "")}` : "none", [d]), mr = N ? O : oe, Ve = N ? O ? l.pauseAutoplayLabel : l.playAutoplayLabel : oe ? l.pauseLabel : l.playLabel, He = Le ? l.exitFullscreenLabel : l.enterFullscreenLabel, Y = t(
|
|
132
|
+
(e, r, a) => ({
|
|
133
|
+
ariaKeyShortcuts: T ? a : void 0,
|
|
134
|
+
title: T ? rt(e, r) : e
|
|
135
|
+
}),
|
|
136
|
+
[T]
|
|
137
|
+
), $e = Y(
|
|
138
|
+
l.subtitleToggleAriaLabel,
|
|
139
|
+
J.subtitle,
|
|
140
|
+
"c"
|
|
141
|
+
), Ze = Y(
|
|
142
|
+
l.previousLabel,
|
|
143
|
+
J.previous,
|
|
144
|
+
"ArrowLeft"
|
|
145
|
+
), qe = Y(
|
|
146
|
+
Ve,
|
|
147
|
+
J.playback,
|
|
148
|
+
"Space"
|
|
149
|
+
), ze = Y(
|
|
150
|
+
l.nextLabel,
|
|
151
|
+
J.next,
|
|
152
|
+
"ArrowRight"
|
|
153
|
+
), Ye = Y(
|
|
154
|
+
He,
|
|
155
|
+
J.fullscreen,
|
|
156
|
+
"f"
|
|
157
|
+
), De = Y(
|
|
158
|
+
l.notesLabel,
|
|
159
|
+
J.notes,
|
|
160
|
+
"n"
|
|
161
|
+
), ie = t(() => {
|
|
162
|
+
T && Fr(V);
|
|
163
|
+
}, [V, T]), pr = t(
|
|
164
|
+
(e) => {
|
|
165
|
+
ie(), Te?.(e);
|
|
166
|
+
},
|
|
167
|
+
[ie, Te]
|
|
168
|
+
), hr = t(
|
|
169
|
+
(e) => {
|
|
170
|
+
ie(), ve?.(e);
|
|
171
|
+
},
|
|
172
|
+
[ie, ve]
|
|
173
|
+
);
|
|
174
|
+
m(() => {
|
|
175
|
+
le.current = d;
|
|
176
|
+
}, [d]), m(() => {
|
|
177
|
+
ce.current = N ? O : g;
|
|
178
|
+
}, [g, O, N]), m(() => {
|
|
179
|
+
be || z(!1);
|
|
180
|
+
}, [be]), m(() => {
|
|
181
|
+
!Ue.current && ee && z(!1), Ue.current = ee;
|
|
182
|
+
}, [ee]), m(() => {
|
|
183
|
+
v.current = M;
|
|
184
|
+
}, [M]), m(() => {
|
|
185
|
+
const e = d?.audioUrl, r = h >= 0 ? k[h + 1]?.audioUrl : void 0;
|
|
186
|
+
sr(e), sr(r);
|
|
187
|
+
}, [k, d?.audioUrl, h]);
|
|
188
|
+
const u = t(
|
|
133
189
|
(e, r = null) => {
|
|
134
|
-
|
|
190
|
+
Pe.current === e && (!e || r === null) || (Pe.current = e, xe?.({
|
|
135
191
|
loading: e,
|
|
136
192
|
reason: e ? r : null
|
|
137
193
|
}));
|
|
138
194
|
},
|
|
139
|
-
[
|
|
140
|
-
),
|
|
195
|
+
[xe]
|
|
196
|
+
), $ = t(
|
|
141
197
|
(e) => {
|
|
142
|
-
|
|
198
|
+
ce.current = e, ke?.(e);
|
|
143
199
|
},
|
|
144
|
-
[
|
|
145
|
-
),
|
|
146
|
-
shouldContinuePlayback:
|
|
200
|
+
[ke]
|
|
201
|
+
), te = t(() => N ? {
|
|
202
|
+
shouldContinuePlayback: ce.current
|
|
147
203
|
} : {
|
|
148
|
-
shouldContinuePlayback:
|
|
149
|
-
defaultPlaying:
|
|
150
|
-
|
|
151
|
-
hasPendingAutoPlay: s.current,
|
|
152
|
-
isPausedByUser: y.current,
|
|
153
|
-
isPlaybackPaused: j,
|
|
154
|
-
isPlaying: Y,
|
|
155
|
-
isWaitingForMoreAudio: g.current || c.current !== null
|
|
204
|
+
shouldContinuePlayback: Hr({
|
|
205
|
+
defaultPlaying: ce.current,
|
|
206
|
+
isPausedByUser: b.current
|
|
156
207
|
})
|
|
157
|
-
}, [
|
|
158
|
-
o
|
|
159
|
-
|
|
160
|
-
|
|
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(() => {
|
|
165
|
-
const e = c.current;
|
|
166
|
-
return e == null || e <= 0 ? 0 : k.current.slice(0, e).reduce(
|
|
167
|
-
(r, l) => r + Math.max(Number(l.duration_ms ?? 0), 0),
|
|
208
|
+
}, [N]), Xe = t((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), W = t(() => g && !K && !b.current && P.current !== "blocked", [g, K]), Ge = t((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Je = t(() => {
|
|
209
|
+
const e = o.current;
|
|
210
|
+
return e == null || e <= 0 ? 0 : v.current.slice(0, e).reduce(
|
|
211
|
+
(r, a) => r + Math.max(Number(a.duration_ms ?? 0), 0),
|
|
168
212
|
0
|
|
169
213
|
) / 1e3;
|
|
170
|
-
}, []),
|
|
171
|
-
(r,
|
|
214
|
+
}, []), Z = t((e) => e <= 0 ? 0 : v.current.slice(0, e).reduce(
|
|
215
|
+
(r, a) => r + Math.max(Number(a.duration_ms ?? 0), 0),
|
|
172
216
|
0
|
|
173
|
-
), []),
|
|
174
|
-
const e =
|
|
175
|
-
return e ?
|
|
176
|
-
}, [
|
|
217
|
+
), []), Qe = t(() => {
|
|
218
|
+
const e = y.current;
|
|
219
|
+
return e ? F.current === "segment" ? Z(R.current) + Math.max(e.currentTime, 0) * 1e3 : S.current !== null && e.readyState === 0 ? S.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : o.current != null ? Z(o.current) : 0;
|
|
220
|
+
}, [Z]), w = t(
|
|
177
221
|
(e) => {
|
|
178
222
|
const r = Math.max(e, 0);
|
|
179
|
-
|
|
223
|
+
Se.current !== r && (Se.current = r, ne?.(r));
|
|
180
224
|
},
|
|
181
|
-
[
|
|
182
|
-
), i =
|
|
183
|
-
|
|
184
|
-
}, [
|
|
185
|
-
typeof window > "u" ||
|
|
186
|
-
}, []),
|
|
187
|
-
if (typeof window > "u" ||
|
|
225
|
+
[ne]
|
|
226
|
+
), i = t(() => {
|
|
227
|
+
w(Qe());
|
|
228
|
+
}, [Qe, w]), p = t(() => {
|
|
229
|
+
typeof window > "u" || B.current === null || (window.cancelAnimationFrame(B.current), B.current = null);
|
|
230
|
+
}, []), Ie = t(() => {
|
|
231
|
+
if (typeof window > "u" || B.current !== null)
|
|
188
232
|
return;
|
|
189
233
|
const e = () => {
|
|
190
234
|
i();
|
|
191
|
-
const r =
|
|
235
|
+
const r = y.current;
|
|
192
236
|
if (!r || r.paused || r.ended) {
|
|
193
|
-
|
|
237
|
+
B.current = null;
|
|
194
238
|
return;
|
|
195
239
|
}
|
|
196
|
-
|
|
240
|
+
B.current = window.requestAnimationFrame(e);
|
|
197
241
|
};
|
|
198
|
-
|
|
199
|
-
}, [i]),
|
|
200
|
-
const e =
|
|
201
|
-
e && (
|
|
202
|
-
}, [
|
|
242
|
+
B.current = window.requestAnimationFrame(e);
|
|
243
|
+
}, [i]), D = t(() => {
|
|
244
|
+
const e = y.current;
|
|
245
|
+
e && (p(), s.current = !1, b.current = !1, re.current = !1, F.current = null, S.current = null, _.current = !1, E.current = !1, q.current = null, e.pause(), e.removeAttribute("src"), e.load(), U.current = null, R.current = 0, o.current = null, w(0), f(!1), u(!1));
|
|
246
|
+
}, [w, p, u]), L = t(
|
|
203
247
|
(e) => {
|
|
204
|
-
const r =
|
|
248
|
+
const r = y.current;
|
|
205
249
|
if (!r)
|
|
206
250
|
return !1;
|
|
207
|
-
const
|
|
208
|
-
return
|
|
209
|
-
|
|
210
|
-
}).catch((
|
|
211
|
-
|
|
251
|
+
const a = r.play();
|
|
252
|
+
return a && typeof a.then == "function" && a.then(() => {
|
|
253
|
+
P.current === "unknown" && (P.current = "auto"), s.current = !1, E.current = !1;
|
|
254
|
+
}).catch((x) => {
|
|
255
|
+
P.current === "unknown" && Xe(x) && (P.current = "blocked", s.current = !1, u(!1)), E.current = !1, f(!1);
|
|
212
256
|
}), !0;
|
|
213
257
|
},
|
|
214
|
-
[
|
|
215
|
-
),
|
|
258
|
+
[Xe, u]
|
|
259
|
+
), C = t(
|
|
216
260
|
(e, r) => {
|
|
217
|
-
const
|
|
218
|
-
if (!
|
|
261
|
+
const a = y.current, x = v.current[e];
|
|
262
|
+
if (!a || !x)
|
|
219
263
|
return !1;
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
const
|
|
223
|
-
s.current =
|
|
224
|
-
const
|
|
225
|
-
return
|
|
264
|
+
const A = Ge(x.audio_data);
|
|
265
|
+
R.current = e, o.current = null, _.current = !1, E.current = !0, q.current = "segment", w(Z(e));
|
|
266
|
+
const de = W();
|
|
267
|
+
s.current = de, u(!1);
|
|
268
|
+
const Ar = U.current !== A;
|
|
269
|
+
return F.current = "segment", Ar && (a.pause(), a.removeAttribute("src"), a.load(), U.current = A, a.src = A, a.load()), S.current = 0, a.readyState > 0 && (a.currentTime = 0, S.current = null), de ? L(`start-segment:${r}`) : (s.current = !1, E.current = !1, a.pause(), f(!1), !0);
|
|
226
270
|
},
|
|
227
271
|
[
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
272
|
+
W,
|
|
273
|
+
Ge,
|
|
274
|
+
Z,
|
|
275
|
+
w,
|
|
276
|
+
L,
|
|
277
|
+
u
|
|
234
278
|
]
|
|
235
|
-
),
|
|
279
|
+
), X = t(
|
|
236
280
|
(e) => {
|
|
237
|
-
|
|
281
|
+
p(), s.current = !1, _.current = !1, E.current = !1, i(), f(!1), u(!1), h >= 0 && je?.(h);
|
|
238
282
|
},
|
|
239
283
|
[
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
284
|
+
h,
|
|
285
|
+
je,
|
|
286
|
+
p,
|
|
243
287
|
i,
|
|
244
|
-
|
|
288
|
+
u
|
|
245
289
|
]
|
|
246
|
-
),
|
|
290
|
+
), fe = t(
|
|
247
291
|
(e) => {
|
|
248
|
-
const r =
|
|
249
|
-
return !r ||
|
|
292
|
+
const r = y.current;
|
|
293
|
+
return !r || F.current !== "url" || !Kr({
|
|
250
294
|
currentTimeSeconds: Math.max(r.currentTime, 0),
|
|
251
295
|
durationSeconds: r.duration
|
|
252
|
-
}) ? !1 : (s.current = !1, r.pause(),
|
|
296
|
+
}) ? !1 : (s.current = !1, r.pause(), X(e), !0);
|
|
253
297
|
},
|
|
254
|
-
[
|
|
255
|
-
),
|
|
256
|
-
const e =
|
|
257
|
-
if (
|
|
258
|
-
|
|
298
|
+
[X]
|
|
299
|
+
), er = t(() => {
|
|
300
|
+
const e = R.current + 1, r = v.current, a = r[e], x = le.current, A = r.some((de) => de.is_final);
|
|
301
|
+
if (a) {
|
|
302
|
+
C(e, "ended");
|
|
259
303
|
return;
|
|
260
304
|
}
|
|
261
|
-
if (
|
|
262
|
-
|
|
305
|
+
if (x?.isAudioStreaming || !A) {
|
|
306
|
+
R.current = e, o.current = e, _.current = !0, s.current = g, w(Z(e)), f(!1), u(!0, "waitingForMoreAudio");
|
|
263
307
|
return;
|
|
264
308
|
}
|
|
265
|
-
|
|
309
|
+
X("segments-completed");
|
|
266
310
|
}, [
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
311
|
+
g,
|
|
312
|
+
X,
|
|
313
|
+
Z,
|
|
314
|
+
w,
|
|
315
|
+
C,
|
|
316
|
+
u
|
|
273
317
|
]);
|
|
274
|
-
|
|
275
|
-
if (
|
|
318
|
+
m(() => {
|
|
319
|
+
if (Fe.current === ge)
|
|
276
320
|
return;
|
|
277
|
-
|
|
278
|
-
const e =
|
|
321
|
+
Fe.current = ge, R.current = 0, o.current = null, _.current = !1, b.current = !1, re.current = !1, s.current = !1, E.current = !1, F.current = null, q.current = null, U.current = null, p(), w(0), u(!1);
|
|
322
|
+
const e = y.current;
|
|
279
323
|
e && (e.pause(), e.removeAttribute("src"), e.load(), f(!1));
|
|
280
324
|
}, [
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
]),
|
|
289
|
-
const e =
|
|
325
|
+
h,
|
|
326
|
+
ge,
|
|
327
|
+
M.length,
|
|
328
|
+
H,
|
|
329
|
+
w,
|
|
330
|
+
p,
|
|
331
|
+
u
|
|
332
|
+
]), m(() => {
|
|
333
|
+
const e = y.current;
|
|
290
334
|
if (e) {
|
|
291
|
-
if (
|
|
292
|
-
|
|
335
|
+
if (K) {
|
|
336
|
+
re.current = !!(le.current && !b.current && (!e.paused || s.current || o.current !== null)), s.current = !1, u(!1), e.pause(), f(!1);
|
|
293
337
|
return;
|
|
294
338
|
}
|
|
295
|
-
if (!(!
|
|
296
|
-
if (
|
|
297
|
-
if (
|
|
298
|
-
|
|
339
|
+
if (!(!re.current || !le.current || b.current)) {
|
|
340
|
+
if (re.current = !1, o.current !== null) {
|
|
341
|
+
if (o.current < v.current.length) {
|
|
342
|
+
C(o.current, "external-resume");
|
|
299
343
|
return;
|
|
300
344
|
}
|
|
301
|
-
s.current = !0,
|
|
345
|
+
s.current = !0, u(!0, "waitingForMoreAudio");
|
|
302
346
|
return;
|
|
303
347
|
}
|
|
304
|
-
if (!
|
|
305
|
-
|
|
348
|
+
if (!U.current && v.current.length > 0) {
|
|
349
|
+
C(
|
|
306
350
|
Math.min(
|
|
307
|
-
|
|
308
|
-
|
|
351
|
+
R.current,
|
|
352
|
+
v.current.length - 1
|
|
309
353
|
),
|
|
310
354
|
"external-resume-init"
|
|
311
355
|
);
|
|
312
356
|
return;
|
|
313
357
|
}
|
|
314
|
-
e.paused && (s.current = !0,
|
|
358
|
+
e.paused && (s.current = !0, L("external-resume"));
|
|
315
359
|
}
|
|
316
360
|
}
|
|
317
361
|
}, [
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
]),
|
|
323
|
-
const e =
|
|
362
|
+
K,
|
|
363
|
+
C,
|
|
364
|
+
L,
|
|
365
|
+
u
|
|
366
|
+
]), m(() => {
|
|
367
|
+
const e = y.current;
|
|
324
368
|
if (!e)
|
|
325
369
|
return;
|
|
326
|
-
if (!
|
|
327
|
-
|
|
370
|
+
if (!d) {
|
|
371
|
+
D();
|
|
328
372
|
return;
|
|
329
373
|
}
|
|
330
|
-
if (
|
|
331
|
-
s.current = !1,
|
|
374
|
+
if (K) {
|
|
375
|
+
s.current = !1, u(!1), e.pause(), f(!1);
|
|
332
376
|
return;
|
|
333
377
|
}
|
|
334
|
-
const r =
|
|
335
|
-
activeSourceType:
|
|
336
|
-
hasAudioUrl: !!
|
|
337
|
-
segmentCount:
|
|
338
|
-
preferredSourceType:
|
|
339
|
-
waitingSegmentIndex:
|
|
378
|
+
const r = Vr({
|
|
379
|
+
activeSourceType: F.current,
|
|
380
|
+
hasAudioUrl: !!H,
|
|
381
|
+
segmentCount: M.length,
|
|
382
|
+
preferredSourceType: q.current,
|
|
383
|
+
waitingSegmentIndex: o.current
|
|
340
384
|
});
|
|
341
|
-
if (r &&
|
|
342
|
-
const
|
|
343
|
-
if (
|
|
344
|
-
const
|
|
345
|
-
e.pause(), e.removeAttribute("src"), e.load(),
|
|
385
|
+
if (r && q.current !== r && (q.current = r), r === "url" && H) {
|
|
386
|
+
const a = U.current !== H, x = W();
|
|
387
|
+
if (a) {
|
|
388
|
+
const A = o.current !== null ? Je() : 0;
|
|
389
|
+
e.pause(), e.removeAttribute("src"), e.load(), U.current = H, F.current = "url", e.src = H, e.load(), S.current = A, w(A * 1e3), e.readyState > 0 && (e.currentTime = A, S.current = null);
|
|
346
390
|
}
|
|
347
|
-
if (s.current =
|
|
391
|
+
if (s.current = x, _.current = !1, E.current = !1, u(!1), !x) {
|
|
348
392
|
s.current = !1, e.pause(), f(!1);
|
|
349
393
|
return;
|
|
350
394
|
}
|
|
351
|
-
|
|
395
|
+
L(a ? "sync-url-init" : "sync-url");
|
|
352
396
|
return;
|
|
353
397
|
}
|
|
354
|
-
if (r === "segment" &&
|
|
355
|
-
if (
|
|
356
|
-
if (
|
|
357
|
-
f(!1),
|
|
398
|
+
if (r === "segment" && o.current !== null) {
|
|
399
|
+
if (o.current < M.length) {
|
|
400
|
+
if (b.current) {
|
|
401
|
+
f(!1), u(!1);
|
|
358
402
|
return;
|
|
359
403
|
}
|
|
360
|
-
|
|
404
|
+
C(o.current, "wait-resume");
|
|
361
405
|
return;
|
|
362
406
|
}
|
|
363
|
-
|
|
407
|
+
_.current = !0, s.current = W(), f(!1), u(W());
|
|
364
408
|
return;
|
|
365
409
|
}
|
|
366
|
-
if (r === "segment" && !
|
|
367
|
-
if (
|
|
368
|
-
|
|
410
|
+
if (r === "segment" && !M.length) {
|
|
411
|
+
if (d.isAudioStreaming) {
|
|
412
|
+
o.current = R.current, _.current = !0, s.current = W(), f(!1), u(W());
|
|
369
413
|
return;
|
|
370
414
|
}
|
|
371
|
-
|
|
415
|
+
D();
|
|
372
416
|
return;
|
|
373
417
|
}
|
|
374
|
-
if (r === "segment" && !
|
|
375
|
-
|
|
418
|
+
if (r === "segment" && !U.current) {
|
|
419
|
+
C(
|
|
376
420
|
Math.min(
|
|
377
|
-
|
|
378
|
-
|
|
421
|
+
R.current,
|
|
422
|
+
M.length - 1
|
|
379
423
|
),
|
|
380
424
|
"effect-init"
|
|
381
425
|
);
|
|
382
426
|
return;
|
|
383
427
|
}
|
|
384
428
|
if (r !== "segment") {
|
|
385
|
-
|
|
429
|
+
D();
|
|
386
430
|
return;
|
|
387
431
|
}
|
|
388
|
-
if (!
|
|
432
|
+
if (!g || b.current) {
|
|
389
433
|
s.current = !1, e.pause(), f(!1);
|
|
390
434
|
return;
|
|
391
435
|
}
|
|
392
|
-
e.paused && (s.current = !0,
|
|
436
|
+
e.paused && (s.current = !0, L("sync-paused-retry"));
|
|
393
437
|
}, [
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
A,
|
|
397
|
-
P,
|
|
398
|
-
p,
|
|
399
|
-
j,
|
|
400
|
-
F,
|
|
401
|
-
b,
|
|
402
|
-
K,
|
|
403
|
-
E,
|
|
438
|
+
d,
|
|
439
|
+
h,
|
|
404
440
|
M,
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
441
|
+
H,
|
|
442
|
+
g,
|
|
443
|
+
K,
|
|
444
|
+
W,
|
|
445
|
+
w,
|
|
446
|
+
D,
|
|
447
|
+
C,
|
|
448
|
+
L,
|
|
449
|
+
Je,
|
|
450
|
+
u
|
|
451
|
+
]), m(() => D, [D]), m(() => p, [p]);
|
|
452
|
+
const yr = t(() => {
|
|
453
|
+
i(), Ie(), f(!0), u(!1), Me?.();
|
|
410
454
|
}, [
|
|
411
|
-
|
|
412
|
-
|
|
455
|
+
Me,
|
|
456
|
+
Ie,
|
|
413
457
|
i,
|
|
414
|
-
|
|
415
|
-
]),
|
|
416
|
-
|
|
417
|
-
}, [
|
|
418
|
-
const e =
|
|
419
|
-
e &&
|
|
458
|
+
u
|
|
459
|
+
]), br = t(() => {
|
|
460
|
+
_.current || E.current || (p(), i(), f(!1));
|
|
461
|
+
}, [h, p, i]), Sr = t(() => {
|
|
462
|
+
const e = y.current;
|
|
463
|
+
e && S.current !== null && (e.currentTime = S.current, S.current = null), i(), !fe("canplay-seek-finished") && (!s.current || !g || L("canplay"));
|
|
420
464
|
}, [
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
465
|
+
h,
|
|
466
|
+
g,
|
|
467
|
+
fe,
|
|
424
468
|
i,
|
|
425
|
-
|
|
426
|
-
]),
|
|
427
|
-
const e =
|
|
428
|
-
e &&
|
|
429
|
-
}, [
|
|
469
|
+
L
|
|
470
|
+
]), gr = t(() => {
|
|
471
|
+
const e = y.current;
|
|
472
|
+
e && S.current !== null && (e.currentTime = S.current, S.current = null), i(), fe("metadata-seek-finished");
|
|
473
|
+
}, [h, fe, i]), _r = t(() => {
|
|
430
474
|
i();
|
|
431
|
-
}, [i]),
|
|
432
|
-
|
|
433
|
-
}, [
|
|
434
|
-
if (
|
|
435
|
-
|
|
475
|
+
}, [i]), wr = t(() => {
|
|
476
|
+
_.current || u(!0, "loadingAudio");
|
|
477
|
+
}, [u]), xr = t(() => {
|
|
478
|
+
if (_.current) {
|
|
479
|
+
u(!0, "waitingForMoreAudio");
|
|
436
480
|
return;
|
|
437
481
|
}
|
|
438
|
-
|
|
439
|
-
}, [
|
|
482
|
+
u(!0, "loadingAudio");
|
|
483
|
+
}, [u]), rr = t(() => {
|
|
440
484
|
i();
|
|
441
|
-
}, [i]),
|
|
442
|
-
const e =
|
|
443
|
-
if (
|
|
444
|
-
|
|
485
|
+
}, [i]), kr = t(() => {
|
|
486
|
+
const e = F.current === "url" || v.current.length === 0;
|
|
487
|
+
if (p(), E.current = !1, e) {
|
|
488
|
+
X("url-ended");
|
|
445
489
|
return;
|
|
446
490
|
}
|
|
447
|
-
|
|
448
|
-
}, [
|
|
449
|
-
|
|
450
|
-
}, [
|
|
491
|
+
er();
|
|
492
|
+
}, [X, er, p]), Mr = t(() => {
|
|
493
|
+
p(), i(), f(!1), u(!1);
|
|
494
|
+
}, [p, i, u]), Lr = t(
|
|
451
495
|
(e) => {
|
|
452
|
-
|
|
496
|
+
Ae?.(e), z(!1);
|
|
453
497
|
},
|
|
454
|
-
[
|
|
455
|
-
)
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
onLoadStart: Ie,
|
|
466
|
-
onLoadedMetadata: Je,
|
|
467
|
-
onCanPlay: Ge,
|
|
468
|
-
onPlay: Xe,
|
|
469
|
-
onPause: Ye,
|
|
470
|
-
onWaiting: er,
|
|
471
|
-
onSeeking: Te,
|
|
472
|
-
onSeeked: Te,
|
|
473
|
-
onTimeUpdate: Qe,
|
|
474
|
-
onEnded: rr,
|
|
475
|
-
onError: tr
|
|
476
|
-
}
|
|
477
|
-
),
|
|
478
|
-
te ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
479
|
-
/* @__PURE__ */ t.jsx(
|
|
480
|
-
ar,
|
|
481
|
-
{
|
|
482
|
-
container: Ve,
|
|
483
|
-
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
|
|
490
|
-
},
|
|
491
|
-
isSubtitleEnabled: re,
|
|
492
|
-
onClose: () => $(!1),
|
|
493
|
-
onOpenChange: $,
|
|
494
|
-
onSubtitleToggle: oe ?? (() => {
|
|
495
|
-
}),
|
|
496
|
-
onViewModeChange: nr,
|
|
497
|
-
open: xe,
|
|
498
|
-
viewMode: Pe
|
|
499
|
-
}
|
|
498
|
+
[Ae]
|
|
499
|
+
), _e = t(() => {
|
|
500
|
+
if (N) {
|
|
501
|
+
const r = !O;
|
|
502
|
+
return $(r), Re?.(r), !0;
|
|
503
|
+
}
|
|
504
|
+
const e = y.current;
|
|
505
|
+
return K || !e || !d ? !1 : o.current !== null ? oe ? ($(!1), s.current = !1, b.current = !0, o.current = null, _.current = !1, f(!1), u(!1), e.pause(), !0) : ($(!0), P.current = "manual", b.current = !1, s.current = !0, u(!0, "waitingForMoreAudio"), !0) : !e.src && M.length > 0 ? ($(!0), P.current = "manual", b.current = !1, C(
|
|
506
|
+
Math.min(
|
|
507
|
+
R.current,
|
|
508
|
+
M.length - 1
|
|
500
509
|
),
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
510
|
+
"toggle"
|
|
511
|
+
), !0) : e.paused ? ($(!0), P.current = "manual", b.current = !1, s.current = !0, L("toggle-resume"), !0) : ($(!1), s.current = !1, b.current = !0, e.pause(), !0);
|
|
512
|
+
}, [
|
|
513
|
+
d,
|
|
514
|
+
M.length,
|
|
515
|
+
O,
|
|
516
|
+
K,
|
|
517
|
+
oe,
|
|
518
|
+
Re,
|
|
519
|
+
C,
|
|
520
|
+
L,
|
|
521
|
+
u,
|
|
522
|
+
$,
|
|
523
|
+
N
|
|
524
|
+
]);
|
|
525
|
+
m(() => {
|
|
526
|
+
if (T)
|
|
527
|
+
return Pr(V);
|
|
528
|
+
}, [V, T]);
|
|
529
|
+
const we = G(
|
|
530
|
+
() => ({
|
|
531
|
+
fullscreen: () => I ? (I(), !0) : !1,
|
|
532
|
+
interaction: () => se ? (me && se(), !0) : !1,
|
|
533
|
+
next: () => ae ? (ye || ae(te()), !0) : !1,
|
|
534
|
+
previous: () => ue ? (he || ue(te()), !0) : !1,
|
|
535
|
+
subtitle: () => Q ? (Q(), !0) : !1,
|
|
536
|
+
togglePlayback: () => (_e(), !0)
|
|
537
|
+
}),
|
|
538
|
+
[
|
|
539
|
+
te,
|
|
540
|
+
me,
|
|
541
|
+
ye,
|
|
542
|
+
I,
|
|
543
|
+
se,
|
|
544
|
+
ae,
|
|
545
|
+
ue,
|
|
546
|
+
Q,
|
|
547
|
+
he,
|
|
548
|
+
_e
|
|
549
|
+
]
|
|
550
|
+
), tr = c(we);
|
|
551
|
+
return m(() => {
|
|
552
|
+
tr.current = we;
|
|
553
|
+
}, [we]), m(() => {
|
|
554
|
+
if (!T || typeof document > "u")
|
|
555
|
+
return;
|
|
556
|
+
const e = (r) => {
|
|
557
|
+
if (!Wr(V))
|
|
558
|
+
return;
|
|
559
|
+
const a = Or(r);
|
|
560
|
+
if (!a || Br(r, a))
|
|
561
|
+
return;
|
|
562
|
+
let x = !1;
|
|
563
|
+
const A = tr.current[a];
|
|
564
|
+
x = A(), x && r.preventDefault();
|
|
565
|
+
};
|
|
566
|
+
return document.addEventListener("keydown", e), () => {
|
|
567
|
+
document.removeEventListener("keydown", e);
|
|
568
|
+
};
|
|
569
|
+
}, [V, T]), m(() => {
|
|
570
|
+
ne?.(Se.current);
|
|
571
|
+
}, [ne]), /* @__PURE__ */ n.jsxs(
|
|
572
|
+
"div",
|
|
573
|
+
{
|
|
574
|
+
...ir,
|
|
575
|
+
"data-slide-player-shortcut-owner": V,
|
|
576
|
+
className: ur("slide-player", j),
|
|
577
|
+
onFocusCapture: hr,
|
|
578
|
+
onPointerDown: pr,
|
|
579
|
+
children: [
|
|
580
|
+
/* @__PURE__ */ n.jsx(
|
|
581
|
+
"audio",
|
|
582
|
+
{
|
|
583
|
+
ref: y,
|
|
584
|
+
preload: "auto",
|
|
585
|
+
playsInline: !0,
|
|
586
|
+
onLoadStart: wr,
|
|
587
|
+
onLoadedMetadata: gr,
|
|
588
|
+
onCanPlay: Sr,
|
|
589
|
+
onPlay: yr,
|
|
590
|
+
onPause: br,
|
|
591
|
+
onWaiting: xr,
|
|
592
|
+
onSeeking: rr,
|
|
593
|
+
onSeeked: rr,
|
|
594
|
+
onTimeUpdate: _r,
|
|
595
|
+
onEnded: kr,
|
|
596
|
+
onError: Mr
|
|
597
|
+
}
|
|
598
|
+
),
|
|
599
|
+
be ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
600
|
+
/* @__PURE__ */ n.jsx(
|
|
601
|
+
Nr,
|
|
505
602
|
{
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
603
|
+
container: cr,
|
|
604
|
+
labels: {
|
|
605
|
+
closeSettings: l.closeSettingsLabel,
|
|
606
|
+
fullscreen: l.fullscreenLabel,
|
|
607
|
+
nonFullscreen: l.nonFullscreenLabel,
|
|
608
|
+
screen: l.screenLabel,
|
|
609
|
+
screenMode: l.screenModeLabel,
|
|
610
|
+
subtitle: l.subtitleLabel,
|
|
611
|
+
subtitleToggle: l.subtitleToggleAriaLabel,
|
|
612
|
+
title: l.settingsTitle
|
|
512
613
|
},
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
614
|
+
isSubtitleEnabled: pe,
|
|
615
|
+
onClose: () => z(!1),
|
|
616
|
+
onOpenChange: z,
|
|
617
|
+
onSubtitleToggle: Q ?? (() => {
|
|
618
|
+
}),
|
|
619
|
+
onViewModeChange: Lr,
|
|
620
|
+
open: We,
|
|
621
|
+
viewMode: lr
|
|
521
622
|
}
|
|
522
623
|
),
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
"aria-label": V.subtitleToggleAriaLabel,
|
|
528
|
-
"aria-pressed": re,
|
|
529
|
-
className: "slide-player__action slide-player__action--subtitle",
|
|
530
|
-
onClick: oe,
|
|
531
|
-
type: "button",
|
|
532
|
-
children: re ? /* @__PURE__ */ t.jsx(yr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ t.jsx(
|
|
533
|
-
gr,
|
|
624
|
+
/* @__PURE__ */ n.jsxs("div", { className: "slide-player__controls", style: dr, children: [
|
|
625
|
+
/* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
|
|
626
|
+
/* @__PURE__ */ n.jsx(
|
|
627
|
+
"button",
|
|
534
628
|
{
|
|
535
|
-
|
|
536
|
-
|
|
629
|
+
"aria-expanded": We,
|
|
630
|
+
"aria-haspopup": "dialog",
|
|
631
|
+
"aria-label": l.moreOptionsAriaLabel,
|
|
632
|
+
className: "slide-player__action slide-player__action--mobile-more",
|
|
633
|
+
onClick: () => {
|
|
634
|
+
z((e) => !e);
|
|
635
|
+
},
|
|
636
|
+
type: "button",
|
|
637
|
+
children: /* @__PURE__ */ n.jsx(
|
|
638
|
+
Zr,
|
|
639
|
+
{
|
|
640
|
+
className: "slide-player__icon",
|
|
641
|
+
strokeWidth: 2.25
|
|
642
|
+
}
|
|
643
|
+
)
|
|
537
644
|
}
|
|
538
|
-
)
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
disabled: He,
|
|
547
|
-
onClick: () => {
|
|
548
|
-
Ue?.(Ae());
|
|
549
|
-
},
|
|
550
|
-
type: "button",
|
|
551
|
-
children: /* @__PURE__ */ t.jsx(_r, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
552
|
-
}
|
|
553
|
-
),
|
|
554
|
-
/* @__PURE__ */ t.jsx(
|
|
555
|
-
"button",
|
|
556
|
-
{
|
|
557
|
-
"aria-label": De,
|
|
558
|
-
className: "slide-player__toggle slide-player__toggle--playback",
|
|
559
|
-
onClick: () => {
|
|
560
|
-
if (z) {
|
|
561
|
-
const r = !q;
|
|
562
|
-
H(r), Be?.(r);
|
|
563
|
-
return;
|
|
645
|
+
),
|
|
646
|
+
/* @__PURE__ */ n.jsx(
|
|
647
|
+
"button",
|
|
648
|
+
{
|
|
649
|
+
"aria-label": l.volumeAriaLabel,
|
|
650
|
+
className: "hidden",
|
|
651
|
+
type: "button",
|
|
652
|
+
children: /* @__PURE__ */ n.jsx(qr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
564
653
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
654
|
+
),
|
|
655
|
+
/* @__PURE__ */ n.jsx(
|
|
656
|
+
"button",
|
|
657
|
+
{
|
|
658
|
+
"aria-label": l.subtitleToggleAriaLabel,
|
|
659
|
+
"aria-keyshortcuts": $e.ariaKeyShortcuts,
|
|
660
|
+
"aria-pressed": pe,
|
|
661
|
+
className: "slide-player__action slide-player__action--subtitle",
|
|
662
|
+
onClick: Q,
|
|
663
|
+
title: $e.title,
|
|
664
|
+
type: "button",
|
|
665
|
+
children: pe ? /* @__PURE__ */ n.jsx(zr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ n.jsx(
|
|
666
|
+
Yr,
|
|
667
|
+
{
|
|
668
|
+
className: "slide-player__icon",
|
|
669
|
+
strokeWidth: 2.25
|
|
571
670
|
}
|
|
572
|
-
|
|
573
|
-
return;
|
|
574
|
-
}
|
|
575
|
-
if (!e.src && A.length > 0) {
|
|
576
|
-
H(!0), L.current = "manual", y.current = !1, E(
|
|
577
|
-
Math.min(
|
|
578
|
-
S.current,
|
|
579
|
-
A.length - 1
|
|
580
|
-
),
|
|
581
|
-
"toggle"
|
|
582
|
-
);
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
if (e.paused) {
|
|
586
|
-
H(!0), L.current = "manual", y.current = !1, s.current = !0, M("toggle-resume");
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
|
-
H(!1), s.current = !1, y.current = !0, e.pause();
|
|
671
|
+
)
|
|
590
672
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
}
|
|
595
|
-
),
|
|
596
|
-
/* @__PURE__ */ t.jsx(
|
|
597
|
-
"button",
|
|
598
|
-
{
|
|
599
|
-
"aria-label": "Forward",
|
|
600
|
-
className: "slide-player__action slide-player__action--next",
|
|
601
|
-
disabled: Ke,
|
|
602
|
-
onClick: () => {
|
|
603
|
-
We?.(Ae());
|
|
604
|
-
},
|
|
605
|
-
type: "button",
|
|
606
|
-
children: /* @__PURE__ */ t.jsx(br, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
607
|
-
}
|
|
608
|
-
),
|
|
609
|
-
ie ? /* @__PURE__ */ t.jsx(
|
|
610
|
-
"button",
|
|
611
|
-
{
|
|
612
|
-
"aria-label": fe ? "Exit fullscreen" : "Enter fullscreen",
|
|
613
|
-
className: "slide-player__action slide-player__action--fullscreen",
|
|
614
|
-
onClick: ie,
|
|
615
|
-
type: "button",
|
|
616
|
-
children: fe ? /* @__PURE__ */ t.jsx(
|
|
617
|
-
xr,
|
|
673
|
+
),
|
|
674
|
+
/* @__PURE__ */ n.jsx(
|
|
675
|
+
"button",
|
|
618
676
|
{
|
|
619
|
-
|
|
620
|
-
|
|
677
|
+
"aria-keyshortcuts": Ze.ariaKeyShortcuts,
|
|
678
|
+
"aria-label": l.previousLabel,
|
|
679
|
+
className: "slide-player__action slide-player__action--prev",
|
|
680
|
+
disabled: he,
|
|
681
|
+
onClick: () => {
|
|
682
|
+
ue?.(te());
|
|
683
|
+
},
|
|
684
|
+
title: Ze.title,
|
|
685
|
+
type: "button",
|
|
686
|
+
children: /* @__PURE__ */ n.jsx(Dr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
621
687
|
}
|
|
622
|
-
)
|
|
623
|
-
|
|
688
|
+
),
|
|
689
|
+
/* @__PURE__ */ n.jsx(
|
|
690
|
+
"button",
|
|
624
691
|
{
|
|
625
|
-
|
|
626
|
-
|
|
692
|
+
"aria-label": Ve,
|
|
693
|
+
"aria-keyshortcuts": qe.ariaKeyShortcuts,
|
|
694
|
+
className: "slide-player__toggle slide-player__toggle--playback",
|
|
695
|
+
onClick: () => {
|
|
696
|
+
_e();
|
|
697
|
+
},
|
|
698
|
+
title: qe.title,
|
|
699
|
+
type: "button",
|
|
700
|
+
children: mr ? /* @__PURE__ */ n.jsx(Ir, {}) : /* @__PURE__ */ n.jsx(et, {})
|
|
627
701
|
}
|
|
628
|
-
)
|
|
629
|
-
}
|
|
630
|
-
) : null
|
|
631
|
-
] }),
|
|
632
|
-
/* @__PURE__ */ t.jsx("div", { className: "slide-player__separator" }),
|
|
633
|
-
/* @__PURE__ */ t.jsxs("div", { className: "slide-player__group", children: [
|
|
634
|
-
Se.map((e, r) => /* @__PURE__ */ t.jsx(sr.Fragment, { children: e }, `custom-action-${r}`)),
|
|
635
|
-
/* @__PURE__ */ t.jsx(
|
|
636
|
-
"button",
|
|
637
|
-
{
|
|
638
|
-
"aria-label": "Notes",
|
|
639
|
-
className: ve(
|
|
640
|
-
"slide-player__action slide-player__action--notes",
|
|
641
|
-
D && "slide-player__action--active"
|
|
642
702
|
),
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
type: "button",
|
|
646
|
-
children: /* @__PURE__ */ t.jsx(
|
|
647
|
-
wr,
|
|
703
|
+
/* @__PURE__ */ n.jsx(
|
|
704
|
+
"button",
|
|
648
705
|
{
|
|
649
|
-
|
|
650
|
-
|
|
706
|
+
"aria-keyshortcuts": ze.ariaKeyShortcuts,
|
|
707
|
+
"aria-label": l.nextLabel,
|
|
708
|
+
className: "slide-player__action slide-player__action--next",
|
|
709
|
+
disabled: ye,
|
|
710
|
+
onClick: () => {
|
|
711
|
+
ae?.(te());
|
|
712
|
+
},
|
|
713
|
+
title: ze.title,
|
|
714
|
+
type: "button",
|
|
715
|
+
children: /* @__PURE__ */ n.jsx(Xr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
716
|
+
}
|
|
717
|
+
),
|
|
718
|
+
I ? /* @__PURE__ */ n.jsx(
|
|
719
|
+
"button",
|
|
720
|
+
{
|
|
721
|
+
"aria-label": He,
|
|
722
|
+
"aria-keyshortcuts": Ye.ariaKeyShortcuts,
|
|
723
|
+
className: "slide-player__action slide-player__action--fullscreen",
|
|
724
|
+
onClick: I,
|
|
725
|
+
title: Ye.title,
|
|
726
|
+
type: "button",
|
|
727
|
+
children: Le ? /* @__PURE__ */ n.jsx(
|
|
728
|
+
Gr,
|
|
729
|
+
{
|
|
730
|
+
className: "slide-player__icon",
|
|
731
|
+
strokeWidth: 2.25
|
|
732
|
+
}
|
|
733
|
+
) : /* @__PURE__ */ n.jsx(
|
|
734
|
+
Jr,
|
|
735
|
+
{
|
|
736
|
+
className: "slide-player__icon",
|
|
737
|
+
strokeWidth: 2.25
|
|
738
|
+
}
|
|
739
|
+
)
|
|
740
|
+
}
|
|
741
|
+
) : null
|
|
742
|
+
] }),
|
|
743
|
+
/* @__PURE__ */ n.jsx("div", { className: "slide-player__separator" }),
|
|
744
|
+
/* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
|
|
745
|
+
Oe.map((e, r) => /* @__PURE__ */ n.jsx(jr.Fragment, { children: e }, `custom-action-${r}`)),
|
|
746
|
+
/* @__PURE__ */ n.jsx(
|
|
747
|
+
"button",
|
|
748
|
+
{
|
|
749
|
+
"aria-label": l.notesLabel,
|
|
750
|
+
"aria-keyshortcuts": De.ariaKeyShortcuts,
|
|
751
|
+
className: ur(
|
|
752
|
+
"slide-player__action slide-player__action--notes",
|
|
753
|
+
ee && "slide-player__action--active"
|
|
754
|
+
),
|
|
755
|
+
disabled: !me,
|
|
756
|
+
onClick: se,
|
|
757
|
+
title: De.title,
|
|
758
|
+
type: "button",
|
|
759
|
+
children: /* @__PURE__ */ n.jsx(
|
|
760
|
+
Qr,
|
|
761
|
+
{
|
|
762
|
+
className: "slide-player__icon",
|
|
763
|
+
strokeWidth: 2.25
|
|
764
|
+
}
|
|
765
|
+
)
|
|
651
766
|
}
|
|
652
767
|
)
|
|
653
|
-
}
|
|
654
|
-
)
|
|
655
|
-
] })
|
|
656
|
-
]
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
},
|
|
660
|
-
|
|
768
|
+
] })
|
|
769
|
+
] })
|
|
770
|
+
] }) : null
|
|
771
|
+
]
|
|
772
|
+
}
|
|
773
|
+
);
|
|
774
|
+
}, nt = Rr(tt);
|
|
775
|
+
nt.displayName = "Player";
|
|
661
776
|
export {
|
|
662
|
-
|
|
777
|
+
nt as default
|
|
663
778
|
};
|
|
664
779
|
//# sourceMappingURL=Player.es.js.map
|