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