@factorialco/f0-react 7.33.0 → 7.34.0
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/{ChatPdfThumbnail-CewvkWu-.js → ChatPdfThumbnail-CFEB3FYp.js} +1 -1
- package/dist/{ChatPostComposerDialog-CKwdWt5B.js → ChatPostComposerDialog-DnuStGGi.js} +3 -3
- package/dist/{DocumentToolbar-BdgPc16e.js → DocumentToolbar-BT7Ks9jN.js} +2 -2
- package/dist/{DocxViewer-HWpF_G9w.js → DocxViewer-DzCul5m1.js} +2 -2
- package/dist/{F0AiProcessingOverlay-DxlgF3Pt.js → F0AiProcessingOverlay-C3q5kdSu.js} +960 -957
- package/dist/{F0CanvasPanel-BCZjxhVB.js → F0CanvasPanel-DB32LsaK.js} +12768 -12684
- package/dist/{F0Map-DZtgpSnS.js → F0Map-CFivWqOr.js} +4 -4
- package/dist/{F0VideoPlayer-EqXupZV9.js → F0VideoPlayer-C5TOVGjz.js} +356 -377
- package/dist/{MapProvider-C4K2ey4N.js → MapProvider-COBzcEBa.js} +214 -189
- package/dist/{SheetViewer-yK40OmE1.js → SheetViewer-Bvv7GLJ5.js} +2 -2
- package/dist/{TextViewer-BYFQn6S1.js → TextViewer-CTLt0pvu.js} +2 -2
- package/dist/ai.d.ts +13 -8
- package/dist/ai.js +2 -2
- package/dist/component-status.d.ts +8 -8
- package/dist/component-status.js +1 -1
- package/dist/{experimental-BKF7swb0.js → experimental-B0saLXEl.js} +11986 -11293
- package/dist/experimental.d.ts +387 -40
- package/dist/experimental.js +280 -278
- package/dist/f0.d.ts +13 -8
- package/dist/f0.js +10 -10
- package/dist/i18n-provider-defaults.d.ts +13 -8
- package/dist/i18n-provider-defaults.js +8 -0
- package/dist/{index-C_LLYE_o.js → index-AqJa6oaL.js} +3 -3
- package/dist/{index-BzA0lEl1.js → index-BdKI708R.js} +2 -2
- package/dist/index-C2VXFg3o.js +4 -0
- package/dist/{index-DlMbfdLc.js → index-Dq029AUw.js} +1 -1
- package/dist/{index-Ca0rOdez.js → index-H07Crbx2.js} +3 -3
- package/dist/{pdfWorker-CA3xmb-5.js → pdfWorker-CJFmh5Jp.js} +2 -2
- package/dist/styles.css +1 -1
- package/icons/app/Floating.d.ts.map +1 -1
- package/icons/app/Floating.js +1 -1
- package/icons/app/Fullscreen.d.ts +4 -0
- package/icons/app/Fullscreen.d.ts.map +1 -0
- package/icons/app/Fullscreen.js +5 -0
- package/icons/app/PanelLeft.d.ts +4 -0
- package/icons/app/PanelLeft.d.ts.map +1 -0
- package/icons/app/PanelLeft.js +5 -0
- package/icons/app/PanelRight.d.ts +4 -0
- package/icons/app/PanelRight.d.ts.map +1 -0
- package/icons/app/PanelRight.js +5 -0
- package/icons/app/index.d.ts +3 -0
- package/icons/app/index.d.ts.map +1 -1
- package/icons/app/index.js +3 -0
- package/package.json +2 -2
- package/dist/index-Bt9DLm3D.js +0 -4
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { u as W, H as je, J as Xe, y as $, K as Ge, L as Ze, M as
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as re, useId as pt, useState as
|
|
4
|
-
import { d as H, f as
|
|
5
|
-
import { F as
|
|
6
|
-
|
|
1
|
+
import { u as W, H as je, J as Xe, y as $, K as Ge, L as Ze, M as Ye, N as qe, O as Je, Q as Qe, R as et, U as tt, V as nt, W as rt, X as at, Y as ot, Z as st, _ as ye, $ as it, a0 as Pe, l as ct, a1 as lt, a2 as dt, v as ut, B as ft, E as mt } from "./F0CanvasPanel-DB32LsaK.js";
|
|
2
|
+
import { jsxs as R, jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as re, useId as pt, useState as x, useRef as F, useEffect as _, useMemo as J, useCallback as M } from "react";
|
|
4
|
+
import { d as H, f as de } from "./tooltip-CrXp1Uaz.js";
|
|
5
|
+
import { F as Ce, a as ht, b as gt } from "./VolumeMuted-UfTwt2zn.js";
|
|
6
|
+
import { b as vt } from "./MapProvider-COBzcEBa.js";
|
|
7
|
+
function Re(e) {
|
|
7
8
|
return Array.isArray(e) && e.every(
|
|
8
9
|
(t) => typeof t == "object" && t !== null && "locale" in t && "value" in t
|
|
9
10
|
);
|
|
10
11
|
}
|
|
11
12
|
function ee(e, t) {
|
|
12
|
-
return e === void 0 ? void 0 :
|
|
13
|
+
return e === void 0 ? void 0 : Re(e) ? e.length === 0 ? void 0 : ((t ? e.find((r) => r.locale === t) : void 0) ?? e[0]).value : e;
|
|
13
14
|
}
|
|
14
15
|
function ae(...e) {
|
|
15
16
|
const t = /* @__PURE__ */ new Map();
|
|
16
17
|
for (const a of e)
|
|
17
|
-
if (
|
|
18
|
-
for (const
|
|
19
|
-
const o = t.get(
|
|
20
|
-
o ? !o.label &&
|
|
21
|
-
locale:
|
|
22
|
-
label:
|
|
18
|
+
if (Re(a))
|
|
19
|
+
for (const r of a) {
|
|
20
|
+
const o = t.get(r.locale);
|
|
21
|
+
o ? !o.label && r.label && (o.label = r.label) : t.set(r.locale, {
|
|
22
|
+
locale: r.locale,
|
|
23
|
+
label: r.label
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
return Array.from(t.values());
|
|
@@ -37,21 +38,21 @@ function Le(e, t) {
|
|
|
37
38
|
function Z(e, t) {
|
|
38
39
|
if (e.length === 0)
|
|
39
40
|
return;
|
|
40
|
-
const a = e.map((
|
|
41
|
+
const a = e.map((n) => n.locale), r = (n) => n.split("-")[0], o = (n) => a.find((u) => u === n) ?? a.find((u) => r(u) === r(n));
|
|
41
42
|
if (t) {
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
return
|
|
43
|
+
const n = o(t);
|
|
44
|
+
if (n)
|
|
45
|
+
return n;
|
|
45
46
|
}
|
|
46
47
|
const s = typeof navigator < "u" ? navigator.language : void 0;
|
|
47
48
|
if (s) {
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
return
|
|
49
|
+
const n = o(s);
|
|
50
|
+
if (n)
|
|
51
|
+
return n;
|
|
51
52
|
}
|
|
52
53
|
return a[0];
|
|
53
54
|
}
|
|
54
|
-
const
|
|
55
|
+
const Se = [0.5, 0.75, 1, 1.25, 1.5], oe = 1, le = 0.25, Q = 5, te = 0.1, Y = 12, bt = 1, yt = 250, Lt = [25, 50, 75], wt = 300 * 1e3, kt = 10, xt = 0.03;
|
|
55
56
|
function ne(e) {
|
|
56
57
|
if (!Number.isFinite(e) || e < 0)
|
|
57
58
|
return "0:00";
|
|
@@ -62,7 +63,7 @@ function se(e) {
|
|
|
62
63
|
return `${e}x`;
|
|
63
64
|
}
|
|
64
65
|
function Et(e) {
|
|
65
|
-
return
|
|
66
|
+
return Se.includes(e);
|
|
66
67
|
}
|
|
67
68
|
const De = {
|
|
68
69
|
x: 12,
|
|
@@ -72,7 +73,7 @@ const De = {
|
|
|
72
73
|
fontWeight: 700,
|
|
73
74
|
fontFamily: "inherit",
|
|
74
75
|
letterSpacing: -0.4
|
|
75
|
-
},
|
|
76
|
+
}, ue = re(({ animate: e, ...t }, a) => /* @__PURE__ */ R(
|
|
76
77
|
"svg",
|
|
77
78
|
{
|
|
78
79
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -98,10 +99,10 @@ const De = {
|
|
|
98
99
|
]
|
|
99
100
|
}
|
|
100
101
|
));
|
|
101
|
-
|
|
102
|
+
ue.displayName = "AudioDescriptionLineIcon";
|
|
102
103
|
const Te = re(({ animate: e, ...t }, a) => {
|
|
103
|
-
const
|
|
104
|
-
return /* @__PURE__ */
|
|
104
|
+
const r = `ad-mask-${pt().replace(/:/g, "")}`;
|
|
105
|
+
return /* @__PURE__ */ R(
|
|
105
106
|
"svg",
|
|
106
107
|
{
|
|
107
108
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -111,7 +112,7 @@ const Te = re(({ animate: e, ...t }, a) => {
|
|
|
111
112
|
...t,
|
|
112
113
|
"aria-hidden": "true",
|
|
113
114
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ R("mask", { id: r, maskUnits: "userSpaceOnUse", children: [
|
|
115
116
|
/* @__PURE__ */ c("rect", { x: 3, y: 6, width: 18, height: 12, rx: 3, fill: "white" }),
|
|
116
117
|
/* @__PURE__ */ c("text", { ...De, fill: "black", children: "AD" })
|
|
117
118
|
] }),
|
|
@@ -124,7 +125,7 @@ const Te = re(({ animate: e, ...t }, a) => {
|
|
|
124
125
|
height: 12,
|
|
125
126
|
rx: 3,
|
|
126
127
|
fill: "currentColor",
|
|
127
|
-
mask: `url(#${
|
|
128
|
+
mask: `url(#${r})`
|
|
128
129
|
}
|
|
129
130
|
)
|
|
130
131
|
]
|
|
@@ -133,7 +134,7 @@ const Te = re(({ animate: e, ...t }, a) => {
|
|
|
133
134
|
});
|
|
134
135
|
Te.displayName = "AudioDescriptionFilledIcon";
|
|
135
136
|
const fe = re(
|
|
136
|
-
({ animate: e, ...t }, a) => /* @__PURE__ */
|
|
137
|
+
({ animate: e, ...t }, a) => /* @__PURE__ */ R(
|
|
137
138
|
"svg",
|
|
138
139
|
{
|
|
139
140
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -200,47 +201,47 @@ const Me = re(
|
|
|
200
201
|
)
|
|
201
202
|
);
|
|
202
203
|
Me.displayName = "CaptionsFilledIcon";
|
|
203
|
-
function
|
|
204
|
+
function Pt({
|
|
204
205
|
value: e,
|
|
205
206
|
onChange: t,
|
|
206
207
|
containerRef: a
|
|
207
208
|
}) {
|
|
208
|
-
const { t:
|
|
209
|
-
const
|
|
210
|
-
|
|
209
|
+
const { t: r } = W(), [o, s] = x(!1), n = (u) => {
|
|
210
|
+
const d = Array.from(
|
|
211
|
+
u.currentTarget.querySelectorAll(
|
|
211
212
|
'[role="menuitemradio"]'
|
|
212
213
|
)
|
|
213
214
|
);
|
|
214
|
-
if (
|
|
215
|
+
if (d.length === 0)
|
|
215
216
|
return;
|
|
216
|
-
const m =
|
|
217
|
+
const m = d.indexOf(document.activeElement);
|
|
217
218
|
let g;
|
|
218
|
-
switch (
|
|
219
|
+
switch (u.key) {
|
|
219
220
|
case "ArrowDown":
|
|
220
|
-
g = m < 0 ? 0 : (m + 1) %
|
|
221
|
+
g = m < 0 ? 0 : (m + 1) % d.length;
|
|
221
222
|
break;
|
|
222
223
|
case "ArrowUp":
|
|
223
|
-
g = m <= 0 ?
|
|
224
|
+
g = m <= 0 ? d.length - 1 : m - 1;
|
|
224
225
|
break;
|
|
225
226
|
case "Home":
|
|
226
227
|
g = 0;
|
|
227
228
|
break;
|
|
228
229
|
case "End":
|
|
229
|
-
g =
|
|
230
|
+
g = d.length - 1;
|
|
230
231
|
break;
|
|
231
232
|
default:
|
|
232
233
|
return;
|
|
233
234
|
}
|
|
234
|
-
|
|
235
|
+
u.preventDefault(), d[g]?.focus();
|
|
235
236
|
};
|
|
236
|
-
return /* @__PURE__ */
|
|
237
|
+
return /* @__PURE__ */ R(je, { open: o, onOpenChange: s, children: [
|
|
237
238
|
/* @__PURE__ */ c(Xe, { asChild: !0, children: /* @__PURE__ */ c(
|
|
238
239
|
$,
|
|
239
240
|
{
|
|
240
241
|
variant: "ghost",
|
|
241
242
|
size: "sm",
|
|
242
243
|
label: se(e),
|
|
243
|
-
"aria-label":
|
|
244
|
+
"aria-label": r("videoPlayer.playbackSpeed", {
|
|
244
245
|
rate: se(e)
|
|
245
246
|
})
|
|
246
247
|
}
|
|
@@ -257,16 +258,16 @@ function xt({
|
|
|
257
258
|
"border-solid border-f1-border-secondary bg-f1-background p-1 shadow-md"
|
|
258
259
|
),
|
|
259
260
|
role: "menu",
|
|
260
|
-
"aria-label":
|
|
261
|
-
onKeyDown:
|
|
262
|
-
children:
|
|
263
|
-
const
|
|
264
|
-
return /* @__PURE__ */
|
|
261
|
+
"aria-label": r("videoPlayer.playbackSpeedLabel"),
|
|
262
|
+
onKeyDown: n,
|
|
263
|
+
children: Se.map((u) => {
|
|
264
|
+
const d = u === e;
|
|
265
|
+
return /* @__PURE__ */ R(
|
|
265
266
|
"button",
|
|
266
267
|
{
|
|
267
268
|
type: "button",
|
|
268
269
|
role: "menuitemradio",
|
|
269
|
-
"aria-checked":
|
|
270
|
+
"aria-checked": d,
|
|
270
271
|
className: H(
|
|
271
272
|
"relative flex items-center rounded-xs py-1.5 pl-8 pr-3",
|
|
272
273
|
"cursor-pointer border-none bg-transparent text-left text-sm font-medium tabular-nums",
|
|
@@ -275,14 +276,14 @@ function xt({
|
|
|
275
276
|
"[&_svg]:h-3.5 [&_svg]:w-3.5"
|
|
276
277
|
),
|
|
277
278
|
onClick: () => {
|
|
278
|
-
t(
|
|
279
|
+
t(u), s(!1);
|
|
279
280
|
},
|
|
280
281
|
children: [
|
|
281
|
-
|
|
282
|
-
se(
|
|
282
|
+
d ? /* @__PURE__ */ c("span", { className: "absolute left-2.5 inline-flex items-center", children: /* @__PURE__ */ c(Ze, {}) }) : null,
|
|
283
|
+
se(u)
|
|
283
284
|
]
|
|
284
285
|
},
|
|
285
|
-
|
|
286
|
+
u
|
|
286
287
|
);
|
|
287
288
|
})
|
|
288
289
|
}
|
|
@@ -293,53 +294,53 @@ function Ct({
|
|
|
293
294
|
currentTime: e,
|
|
294
295
|
duration: t,
|
|
295
296
|
markerTime: a,
|
|
296
|
-
blockSeekPastMarker:
|
|
297
|
+
blockSeekPastMarker: r = !1,
|
|
297
298
|
onSeek: o
|
|
298
299
|
}) {
|
|
299
|
-
const { t: s } = W(),
|
|
300
|
-
const
|
|
301
|
-
if (!
|
|
300
|
+
const { t: s } = W(), n = F(null), [u, d] = x(!1), [m, g] = x(null), y = t > 0 ? Math.min(1, e / t) : 0, l = a !== void 0 && t > 0 ? Math.min(1, a / t) : 0, f = a !== void 0 && t > 0 && a > 0 && a < t - le && e < a - le, h = (v) => {
|
|
301
|
+
const C = n.current;
|
|
302
|
+
if (!C)
|
|
302
303
|
return 0;
|
|
303
|
-
const A =
|
|
304
|
+
const A = C.getBoundingClientRect();
|
|
304
305
|
return Math.max(0, Math.min(1, (v - A.left) / A.width));
|
|
305
306
|
}, b = (v) => {
|
|
306
307
|
t && o(h(v) * t);
|
|
307
|
-
},
|
|
308
|
-
t && (v.preventDefault(), v.currentTarget.setPointerCapture(v.pointerId),
|
|
309
|
-
},
|
|
310
|
-
t && (g(h(v.clientX)),
|
|
308
|
+
}, E = (v) => {
|
|
309
|
+
t && (v.preventDefault(), v.currentTarget.setPointerCapture(v.pointerId), d(!0), b(v.clientX));
|
|
310
|
+
}, T = (v) => {
|
|
311
|
+
t && (g(h(v.clientX)), u && b(v.clientX));
|
|
311
312
|
}, k = (v) => {
|
|
312
|
-
|
|
313
|
-
}, w = m !== null &&
|
|
313
|
+
u && (d(!1), v.currentTarget.hasPointerCapture(v.pointerId) && v.currentTarget.releasePointerCapture(v.pointerId));
|
|
314
|
+
}, w = m !== null && r && a !== void 0 && m > l, O = (v) => {
|
|
314
315
|
if (!t)
|
|
315
316
|
return;
|
|
316
|
-
let
|
|
317
|
+
let C = null;
|
|
317
318
|
switch (v.key) {
|
|
318
319
|
case "ArrowLeft":
|
|
319
|
-
|
|
320
|
+
C = Math.max(0, e - Q);
|
|
320
321
|
break;
|
|
321
322
|
case "ArrowRight":
|
|
322
|
-
|
|
323
|
+
C = Math.min(t, e + Q);
|
|
323
324
|
break;
|
|
324
325
|
case "Home":
|
|
325
|
-
|
|
326
|
+
C = 0;
|
|
326
327
|
break;
|
|
327
328
|
case "End":
|
|
328
|
-
|
|
329
|
+
C = t;
|
|
329
330
|
break;
|
|
330
331
|
default:
|
|
331
332
|
return;
|
|
332
333
|
}
|
|
333
|
-
v.preventDefault(), v.stopPropagation(), o(
|
|
334
|
+
v.preventDefault(), v.stopPropagation(), o(C);
|
|
334
335
|
};
|
|
335
|
-
return /* @__PURE__ */
|
|
336
|
+
return /* @__PURE__ */ R(
|
|
336
337
|
"div",
|
|
337
338
|
{
|
|
338
|
-
ref:
|
|
339
|
+
ref: n,
|
|
339
340
|
className: H(
|
|
340
341
|
"relative flex h-4 flex-1 items-center rounded-sm",
|
|
341
342
|
"cursor-pointer touch-none",
|
|
342
|
-
|
|
343
|
+
de()
|
|
343
344
|
),
|
|
344
345
|
role: "slider",
|
|
345
346
|
tabIndex: 0,
|
|
@@ -351,11 +352,11 @@ function Ct({
|
|
|
351
352
|
current: ne(e),
|
|
352
353
|
total: ne(t)
|
|
353
354
|
}),
|
|
354
|
-
onPointerDown:
|
|
355
|
-
onPointerMove:
|
|
355
|
+
onPointerDown: E,
|
|
356
|
+
onPointerMove: T,
|
|
356
357
|
onPointerUp: k,
|
|
357
358
|
onPointerCancel: k,
|
|
358
|
-
onLostPointerCapture: () =>
|
|
359
|
+
onLostPointerCapture: () => d(!1),
|
|
359
360
|
onPointerLeave: () => g(null),
|
|
360
361
|
onKeyDown: O,
|
|
361
362
|
children: [
|
|
@@ -387,32 +388,32 @@ function Ct({
|
|
|
387
388
|
}
|
|
388
389
|
);
|
|
389
390
|
}
|
|
390
|
-
const ie = "off", we = "py-2 pr-4 text-base font-medium",
|
|
391
|
+
const ie = "off", we = "py-2 pr-4 text-base font-medium", Rt = "gap-2 py-2 pl-3 pr-2 text-base font-medium", Ae = "max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[13rem] overflow-y-auto p-1";
|
|
391
392
|
function ce({
|
|
392
393
|
icon: e,
|
|
393
394
|
label: t,
|
|
394
395
|
container: a,
|
|
395
|
-
options:
|
|
396
|
+
options: r,
|
|
396
397
|
value: o,
|
|
397
398
|
onLanguageChange: s,
|
|
398
|
-
on:
|
|
399
|
-
onOff:
|
|
400
|
-
offLabel:
|
|
399
|
+
on: n,
|
|
400
|
+
onOff: u,
|
|
401
|
+
offLabel: d
|
|
401
402
|
}) {
|
|
402
|
-
const m =
|
|
403
|
-
return /* @__PURE__ */
|
|
404
|
-
/* @__PURE__ */
|
|
403
|
+
const m = u !== void 0, g = r.find((l) => l.locale === o), y = m && !n ? d : g ? Le(g) : d;
|
|
404
|
+
return /* @__PURE__ */ R(tt, { children: [
|
|
405
|
+
/* @__PURE__ */ R(nt, { className: Rt, children: [
|
|
405
406
|
/* @__PURE__ */ c(rt, { icon: e }),
|
|
406
407
|
/* @__PURE__ */ c("span", { className: "flex-1", children: t }),
|
|
407
408
|
/* @__PURE__ */ c("span", { className: "text-f1-foreground-secondary", children: y })
|
|
408
409
|
] }),
|
|
409
|
-
/* @__PURE__ */ c(at, { container: a ?? void 0, children: /* @__PURE__ */ c(ot, { className: Ae, children: /* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ c(at, { container: a ?? void 0, children: /* @__PURE__ */ c(ot, { className: Ae, children: /* @__PURE__ */ R(
|
|
410
411
|
st,
|
|
411
412
|
{
|
|
412
|
-
value: m ?
|
|
413
|
-
onValueChange: (l) => m && l === ie ?
|
|
413
|
+
value: m ? n ? o : ie : o,
|
|
414
|
+
onValueChange: (l) => m && l === ie ? u() : s(l),
|
|
414
415
|
children: [
|
|
415
|
-
|
|
416
|
+
r.map((l) => /* @__PURE__ */ c(
|
|
416
417
|
ye,
|
|
417
418
|
{
|
|
418
419
|
value: l.locale,
|
|
@@ -421,7 +422,7 @@ function ce({
|
|
|
421
422
|
},
|
|
422
423
|
l.locale
|
|
423
424
|
)),
|
|
424
|
-
m ? /* @__PURE__ */ c(ye, { value: ie, className: we, children:
|
|
425
|
+
m ? /* @__PURE__ */ c(ye, { value: ie, className: we, children: d }) : null
|
|
425
426
|
]
|
|
426
427
|
}
|
|
427
428
|
) }) })
|
|
@@ -431,21 +432,21 @@ function St({
|
|
|
431
432
|
containerRef: e,
|
|
432
433
|
audioLanguages: t,
|
|
433
434
|
audioLanguage: a,
|
|
434
|
-
onAudioLanguageChange:
|
|
435
|
+
onAudioLanguageChange: r,
|
|
435
436
|
captionLanguages: o,
|
|
436
437
|
captionLanguage: s,
|
|
437
|
-
captionsOn:
|
|
438
|
-
onCaptionLanguageChange:
|
|
439
|
-
onCaptionsOff:
|
|
438
|
+
captionsOn: n,
|
|
439
|
+
onCaptionLanguageChange: u,
|
|
440
|
+
onCaptionsOff: d,
|
|
440
441
|
audioDescriptionLanguages: m,
|
|
441
442
|
audioDescriptionLanguage: g,
|
|
442
443
|
audioDescriptionOn: y,
|
|
443
444
|
onAudioDescriptionLanguageChange: l,
|
|
444
445
|
onAudioDescriptionOff: f
|
|
445
446
|
}) {
|
|
446
|
-
const { t: h } = W(), b = e.current,
|
|
447
|
-
return /* @__PURE__ */
|
|
448
|
-
/* @__PURE__ */ c(
|
|
447
|
+
const { t: h } = W(), b = e.current, E = h("videoPlayer.off");
|
|
448
|
+
return /* @__PURE__ */ R(Ye, { children: [
|
|
449
|
+
/* @__PURE__ */ c(qe, { asChild: !0, children: /* @__PURE__ */ c(
|
|
449
450
|
$,
|
|
450
451
|
{
|
|
451
452
|
variant: "ghost",
|
|
@@ -455,7 +456,7 @@ function St({
|
|
|
455
456
|
label: h("videoPlayer.settings")
|
|
456
457
|
}
|
|
457
458
|
) }),
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ R(
|
|
459
460
|
Qe,
|
|
460
461
|
{
|
|
461
462
|
container: b,
|
|
@@ -471,8 +472,8 @@ function St({
|
|
|
471
472
|
container: b,
|
|
472
473
|
options: t,
|
|
473
474
|
value: a,
|
|
474
|
-
onLanguageChange:
|
|
475
|
-
offLabel:
|
|
475
|
+
onLanguageChange: r,
|
|
476
|
+
offLabel: E
|
|
476
477
|
}
|
|
477
478
|
) : null,
|
|
478
479
|
o.length > 1 ? /* @__PURE__ */ c(
|
|
@@ -483,16 +484,16 @@ function St({
|
|
|
483
484
|
container: b,
|
|
484
485
|
options: o,
|
|
485
486
|
value: s,
|
|
486
|
-
on:
|
|
487
|
-
onLanguageChange:
|
|
488
|
-
onOff:
|
|
489
|
-
offLabel:
|
|
487
|
+
on: n,
|
|
488
|
+
onLanguageChange: u,
|
|
489
|
+
onOff: d,
|
|
490
|
+
offLabel: E
|
|
490
491
|
}
|
|
491
492
|
) : null,
|
|
492
493
|
m.length > 1 ? /* @__PURE__ */ c(
|
|
493
494
|
ce,
|
|
494
495
|
{
|
|
495
|
-
icon:
|
|
496
|
+
icon: ue,
|
|
496
497
|
label: h("videoPlayer.audioDescription"),
|
|
497
498
|
container: b,
|
|
498
499
|
options: m,
|
|
@@ -500,7 +501,7 @@ function St({
|
|
|
500
501
|
on: y,
|
|
501
502
|
onLanguageChange: l,
|
|
502
503
|
onOff: f,
|
|
503
|
-
offLabel:
|
|
504
|
+
offLabel: E
|
|
504
505
|
}
|
|
505
506
|
) : null
|
|
506
507
|
]
|
|
@@ -508,20 +509,20 @@ function St({
|
|
|
508
509
|
)
|
|
509
510
|
] });
|
|
510
511
|
}
|
|
511
|
-
function
|
|
512
|
+
function Dt(e) {
|
|
512
513
|
return e.audioLanguages > 1 || e.captionLanguages > 1 || e.audioDescriptionLanguages > 1;
|
|
513
514
|
}
|
|
514
|
-
function
|
|
515
|
-
return t || e === 0 ?
|
|
515
|
+
function Tt(e, t) {
|
|
516
|
+
return t || e === 0 ? Ce : e <= 0.5 ? ht : gt;
|
|
516
517
|
}
|
|
517
|
-
function
|
|
518
|
+
function Mt({
|
|
518
519
|
volume: e,
|
|
519
520
|
isMuted: t,
|
|
520
521
|
onToggleMute: a,
|
|
521
|
-
onVolumeChange:
|
|
522
|
+
onVolumeChange: r,
|
|
522
523
|
silent: o = !1
|
|
523
524
|
}) {
|
|
524
|
-
const { t: s } = W(),
|
|
525
|
+
const { t: s } = W(), n = t || e === 0;
|
|
525
526
|
return o ? /* @__PURE__ */ c(
|
|
526
527
|
$,
|
|
527
528
|
{
|
|
@@ -529,38 +530,38 @@ function Tt({
|
|
|
529
530
|
size: "sm",
|
|
530
531
|
hideLabel: !0,
|
|
531
532
|
disabled: !0,
|
|
532
|
-
icon:
|
|
533
|
+
icon: Ce,
|
|
533
534
|
label: s("videoPlayer.noAudio")
|
|
534
535
|
}
|
|
535
|
-
) : /* @__PURE__ */
|
|
536
|
+
) : /* @__PURE__ */ R("div", { className: "flex items-center gap-1", children: [
|
|
536
537
|
/* @__PURE__ */ c(
|
|
537
538
|
$,
|
|
538
539
|
{
|
|
539
540
|
variant: "ghost",
|
|
540
541
|
size: "sm",
|
|
541
542
|
hideLabel: !0,
|
|
542
|
-
icon:
|
|
543
|
-
label: s(
|
|
543
|
+
icon: Tt(e, n),
|
|
544
|
+
label: s(n ? "videoPlayer.unmute" : "videoPlayer.mute"),
|
|
544
545
|
onClick: a
|
|
545
546
|
}
|
|
546
547
|
),
|
|
547
|
-
/* @__PURE__ */ c(
|
|
548
|
+
/* @__PURE__ */ c(At, { value: n ? 0 : e, onChange: r })
|
|
548
549
|
] });
|
|
549
550
|
}
|
|
550
|
-
function
|
|
551
|
-
const { t: a } = W(),
|
|
552
|
-
const f =
|
|
551
|
+
function At({ value: e, onChange: t }) {
|
|
552
|
+
const { t: a } = W(), r = F(null), [o, s] = x(!1), n = Math.max(0, Math.min(1, e)), u = (l) => {
|
|
553
|
+
const f = r.current;
|
|
553
554
|
if (!f)
|
|
554
555
|
return 0;
|
|
555
|
-
const h = f.getBoundingClientRect(), b = h.width -
|
|
556
|
+
const h = f.getBoundingClientRect(), b = h.width - Y;
|
|
556
557
|
return b <= 0 ? 0 : Math.max(
|
|
557
558
|
0,
|
|
558
|
-
Math.min(1, (l - h.left -
|
|
559
|
+
Math.min(1, (l - h.left - Y / 2) / b)
|
|
559
560
|
);
|
|
560
|
-
},
|
|
561
|
-
l.preventDefault(), l.currentTarget.setPointerCapture(l.pointerId), s(!0), t(
|
|
561
|
+
}, d = (l) => {
|
|
562
|
+
l.preventDefault(), l.currentTarget.setPointerCapture(l.pointerId), s(!0), t(u(l.clientX));
|
|
562
563
|
}, m = (l) => {
|
|
563
|
-
o && t(
|
|
564
|
+
o && t(u(l.clientX));
|
|
564
565
|
}, g = (l) => {
|
|
565
566
|
o && (s(!1), l.currentTarget.hasPointerCapture(l.pointerId) && l.currentTarget.releasePointerCapture(l.pointerId));
|
|
566
567
|
}, y = (l) => {
|
|
@@ -568,11 +569,11 @@ function Mt({ value: e, onChange: t }) {
|
|
|
568
569
|
switch (l.key) {
|
|
569
570
|
case "ArrowRight":
|
|
570
571
|
case "ArrowUp":
|
|
571
|
-
f = Math.min(1,
|
|
572
|
+
f = Math.min(1, n + te);
|
|
572
573
|
break;
|
|
573
574
|
case "ArrowLeft":
|
|
574
575
|
case "ArrowDown":
|
|
575
|
-
f = Math.max(0,
|
|
576
|
+
f = Math.max(0, n - te);
|
|
576
577
|
break;
|
|
577
578
|
case "Home":
|
|
578
579
|
f = 0;
|
|
@@ -585,23 +586,23 @@ function Mt({ value: e, onChange: t }) {
|
|
|
585
586
|
}
|
|
586
587
|
l.preventDefault(), l.stopPropagation(), t(f);
|
|
587
588
|
};
|
|
588
|
-
return /* @__PURE__ */
|
|
589
|
+
return /* @__PURE__ */ R(
|
|
589
590
|
"div",
|
|
590
591
|
{
|
|
591
|
-
ref:
|
|
592
|
+
ref: r,
|
|
592
593
|
className: H(
|
|
593
594
|
"relative flex h-4 w-[60px] items-center rounded-sm",
|
|
594
595
|
"cursor-pointer touch-none",
|
|
595
|
-
|
|
596
|
+
de()
|
|
596
597
|
),
|
|
597
598
|
role: "slider",
|
|
598
599
|
tabIndex: 0,
|
|
599
600
|
"aria-label": a("videoPlayer.volume"),
|
|
600
601
|
"aria-valuemin": 0,
|
|
601
602
|
"aria-valuemax": 1,
|
|
602
|
-
"aria-valuenow": Number(
|
|
603
|
-
"aria-valuetext": `${Math.round(
|
|
604
|
-
onPointerDown:
|
|
603
|
+
"aria-valuenow": Number(n.toFixed(2)),
|
|
604
|
+
"aria-valuetext": `${Math.round(n * 100)}%`,
|
|
605
|
+
onPointerDown: d,
|
|
605
606
|
onPointerMove: m,
|
|
606
607
|
onPointerUp: g,
|
|
607
608
|
onPointerCancel: g,
|
|
@@ -614,7 +615,7 @@ function Mt({ value: e, onChange: t }) {
|
|
|
614
615
|
{
|
|
615
616
|
className: "pointer-events-none absolute left-0 h-1 rounded-sm bg-f1-foreground",
|
|
616
617
|
style: {
|
|
617
|
-
width: `calc(${
|
|
618
|
+
width: `calc(${Y}px + (100% - ${Y}px) * ${n})`
|
|
618
619
|
}
|
|
619
620
|
}
|
|
620
621
|
),
|
|
@@ -623,7 +624,7 @@ function Mt({ value: e, onChange: t }) {
|
|
|
623
624
|
{
|
|
624
625
|
className: "pointer-events-none absolute h-3 w-3 -translate-x-1/2 rounded-full bg-f1-foreground shadow-[0_0_4px_rgba(0,0,0,0.4)]",
|
|
625
626
|
style: {
|
|
626
|
-
left: `calc(${
|
|
627
|
+
left: `calc(${Y / 2}px + (100% - ${Y}px) * ${n})`
|
|
627
628
|
}
|
|
628
629
|
}
|
|
629
630
|
)
|
|
@@ -631,16 +632,16 @@ function Mt({ value: e, onChange: t }) {
|
|
|
631
632
|
}
|
|
632
633
|
);
|
|
633
634
|
}
|
|
634
|
-
function
|
|
635
|
+
function It({
|
|
635
636
|
isPlaying: e,
|
|
636
637
|
currentTime: t,
|
|
637
638
|
duration: a,
|
|
638
|
-
volume:
|
|
639
|
+
volume: r,
|
|
639
640
|
isMuted: o,
|
|
640
641
|
playbackRate: s,
|
|
641
|
-
isFullscreen:
|
|
642
|
-
markerTime:
|
|
643
|
-
blockSeekPastMarker:
|
|
642
|
+
isFullscreen: n,
|
|
643
|
+
markerTime: u,
|
|
644
|
+
blockSeekPastMarker: d,
|
|
644
645
|
containerRef: m,
|
|
645
646
|
captionsAvailable: g,
|
|
646
647
|
captionsOn: y,
|
|
@@ -648,33 +649,33 @@ function At({
|
|
|
648
649
|
audioDescriptionOn: f,
|
|
649
650
|
silent: h,
|
|
650
651
|
persist: b,
|
|
651
|
-
audioLanguages:
|
|
652
|
-
audioLanguage:
|
|
652
|
+
audioLanguages: E,
|
|
653
|
+
audioLanguage: T,
|
|
653
654
|
onAudioLanguageChange: k,
|
|
654
655
|
captionLanguages: w,
|
|
655
656
|
captionLanguage: O,
|
|
656
657
|
onCaptionLanguageChange: v,
|
|
657
|
-
onCaptionsOff:
|
|
658
|
+
onCaptionsOff: C,
|
|
658
659
|
audioDescriptionLanguages: A,
|
|
659
|
-
audioDescriptionLanguage:
|
|
660
|
+
audioDescriptionLanguage: P,
|
|
660
661
|
onAudioDescriptionLanguageChange: i,
|
|
661
662
|
onAudioDescriptionOff: D,
|
|
662
|
-
onTogglePlay:
|
|
663
|
+
onTogglePlay: S,
|
|
663
664
|
onToggleMute: B,
|
|
664
665
|
onVolumeChange: j,
|
|
665
666
|
onPlaybackRateChange: K,
|
|
666
667
|
onToggleFullscreen: X,
|
|
667
|
-
onToggleCaptions:
|
|
668
|
+
onToggleCaptions: N,
|
|
668
669
|
onToggleAudioDescription: U,
|
|
669
|
-
onSeek:
|
|
670
|
+
onSeek: q,
|
|
670
671
|
download: G
|
|
671
672
|
}) {
|
|
672
|
-
const { t: p } = W(), I = g && w.length <= 1, z = l && A.length <= 1, V =
|
|
673
|
-
audioLanguages:
|
|
673
|
+
const { t: p } = W(), I = g && w.length <= 1, z = l && A.length <= 1, V = Dt({
|
|
674
|
+
audioLanguages: E.length,
|
|
674
675
|
captionLanguages: w.length,
|
|
675
676
|
audioDescriptionLanguages: A.length
|
|
676
677
|
});
|
|
677
|
-
return /* @__PURE__ */
|
|
678
|
+
return /* @__PURE__ */ R(
|
|
678
679
|
"div",
|
|
679
680
|
{
|
|
680
681
|
className: H(
|
|
@@ -701,9 +702,9 @@ function At({
|
|
|
701
702
|
variant: "ghost",
|
|
702
703
|
size: "sm",
|
|
703
704
|
hideLabel: !0,
|
|
704
|
-
icon: e ? it :
|
|
705
|
+
icon: e ? it : Pe,
|
|
705
706
|
label: p(e ? "videoPlayer.pause" : "videoPlayer.play"),
|
|
706
|
-
onClick:
|
|
707
|
+
onClick: S
|
|
707
708
|
}
|
|
708
709
|
),
|
|
709
710
|
/* @__PURE__ */ c(
|
|
@@ -711,20 +712,20 @@ function At({
|
|
|
711
712
|
{
|
|
712
713
|
currentTime: t,
|
|
713
714
|
duration: a,
|
|
714
|
-
markerTime:
|
|
715
|
-
blockSeekPastMarker:
|
|
716
|
-
onSeek:
|
|
715
|
+
markerTime: u,
|
|
716
|
+
blockSeekPastMarker: d,
|
|
717
|
+
onSeek: q
|
|
717
718
|
}
|
|
718
719
|
),
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ R("span", { className: "min-w-[80px] whitespace-nowrap text-center text-base font-medium tabular-nums text-f1-foreground", children: [
|
|
720
721
|
ne(t),
|
|
721
722
|
" / ",
|
|
722
723
|
ne(a)
|
|
723
724
|
] }),
|
|
724
725
|
/* @__PURE__ */ c(
|
|
725
|
-
|
|
726
|
+
Mt,
|
|
726
727
|
{
|
|
727
|
-
volume:
|
|
728
|
+
volume: r,
|
|
728
729
|
isMuted: o,
|
|
729
730
|
onToggleMute: B,
|
|
730
731
|
onVolumeChange: j,
|
|
@@ -732,7 +733,7 @@ function At({
|
|
|
732
733
|
}
|
|
733
734
|
),
|
|
734
735
|
/* @__PURE__ */ c(
|
|
735
|
-
|
|
736
|
+
Pt,
|
|
736
737
|
{
|
|
737
738
|
value: s,
|
|
738
739
|
onChange: K,
|
|
@@ -751,7 +752,7 @@ function At({
|
|
|
751
752
|
icon: y ? Me : fe,
|
|
752
753
|
label: p("videoPlayer.captions"),
|
|
753
754
|
"aria-pressed": y,
|
|
754
|
-
onClick:
|
|
755
|
+
onClick: N
|
|
755
756
|
}
|
|
756
757
|
)
|
|
757
758
|
) : null,
|
|
@@ -765,7 +766,7 @@ function At({
|
|
|
765
766
|
variant: "ghost",
|
|
766
767
|
size: "sm",
|
|
767
768
|
hideLabel: !0,
|
|
768
|
-
icon: f ? Te :
|
|
769
|
+
icon: f ? Te : ue,
|
|
769
770
|
label: p("videoPlayer.audioDescription"),
|
|
770
771
|
"aria-pressed": f,
|
|
771
772
|
onClick: U
|
|
@@ -776,16 +777,16 @@ function At({
|
|
|
776
777
|
St,
|
|
777
778
|
{
|
|
778
779
|
containerRef: m,
|
|
779
|
-
audioLanguages:
|
|
780
|
-
audioLanguage:
|
|
780
|
+
audioLanguages: E,
|
|
781
|
+
audioLanguage: T,
|
|
781
782
|
onAudioLanguageChange: k,
|
|
782
783
|
captionLanguages: w,
|
|
783
784
|
captionLanguage: O,
|
|
784
785
|
captionsOn: y,
|
|
785
786
|
onCaptionLanguageChange: v,
|
|
786
|
-
onCaptionsOff:
|
|
787
|
+
onCaptionsOff: C,
|
|
787
788
|
audioDescriptionLanguages: A,
|
|
788
|
-
audioDescriptionLanguage:
|
|
789
|
+
audioDescriptionLanguage: P,
|
|
789
790
|
audioDescriptionOn: f,
|
|
790
791
|
onAudioDescriptionLanguageChange: i,
|
|
791
792
|
onAudioDescriptionOff: D
|
|
@@ -808,8 +809,8 @@ function At({
|
|
|
808
809
|
variant: "ghost",
|
|
809
810
|
size: "sm",
|
|
810
811
|
hideLabel: !0,
|
|
811
|
-
icon:
|
|
812
|
-
label: p(
|
|
812
|
+
icon: n ? lt : dt,
|
|
813
|
+
label: p(n ? "videoPlayer.exitFullscreen" : "videoPlayer.enterFullscreen"),
|
|
813
814
|
onClick: X
|
|
814
815
|
}
|
|
815
816
|
)
|
|
@@ -819,127 +820,105 @@ function At({
|
|
|
819
820
|
}
|
|
820
821
|
const ke = (e) => e.trimStart().startsWith("WEBVTT");
|
|
821
822
|
function Ie(e) {
|
|
822
|
-
const t = e !== void 0 && ke(e), [a,
|
|
823
|
-
return
|
|
823
|
+
const t = e !== void 0 && ke(e), [a, r] = x();
|
|
824
|
+
return _(() => {
|
|
824
825
|
if (e === void 0 || !ke(e)) {
|
|
825
|
-
|
|
826
|
+
r(void 0);
|
|
826
827
|
return;
|
|
827
828
|
}
|
|
828
829
|
const o = URL.createObjectURL(new Blob([e], { type: "text/vtt" }));
|
|
829
|
-
return
|
|
830
|
+
return r(o), () => URL.revokeObjectURL(o);
|
|
830
831
|
}, [e]), {
|
|
831
832
|
trackSrc: e === void 0 ? void 0 : t ? a : e,
|
|
832
833
|
needsCrossOrigin: e !== void 0 && !t
|
|
833
834
|
};
|
|
834
835
|
}
|
|
835
|
-
const
|
|
836
|
-
function
|
|
837
|
-
const o = a !== void 0, { trackSrc: s, needsCrossOrigin:
|
|
838
|
-
return
|
|
836
|
+
const xe = "descriptions";
|
|
837
|
+
function Nt(e, { enabled: t, describedSrc: a, descriptions: r }) {
|
|
838
|
+
const o = a !== void 0, { trackSrc: s, needsCrossOrigin: n } = Ie(r), [u, d] = x(!1), m = o || r !== void 0 || u, [g, y] = x(), l = F(!1);
|
|
839
|
+
return _(() => {
|
|
839
840
|
if (!e)
|
|
840
841
|
return;
|
|
841
|
-
const f = e.textTracks, h = typeof window < "u" && "speechSynthesis" in window, b = t && !o && h,
|
|
842
|
+
const f = e.textTracks, h = typeof window < "u" && "speechSynthesis" in window, b = t && !o && h, E = () => {
|
|
842
843
|
l.current && (l.current = !1, e.play().catch(() => {
|
|
843
844
|
}));
|
|
844
|
-
},
|
|
845
|
+
}, T = (P) => {
|
|
845
846
|
window.speechSynthesis.cancel();
|
|
846
|
-
const i = new SpeechSynthesisUtterance(
|
|
847
|
-
i.onend =
|
|
848
|
-
}, k = /* @__PURE__ */ new WeakSet(), w = [], O = (
|
|
849
|
-
if (
|
|
847
|
+
const i = new SpeechSynthesisUtterance(P);
|
|
848
|
+
i.onend = E, i.onerror = E, window.speechSynthesis.speak(i);
|
|
849
|
+
}, k = /* @__PURE__ */ new WeakSet(), w = [], O = (P) => {
|
|
850
|
+
if (P.kind !== xe || (P.mode = "hidden", k.has(P)) || typeof P.addEventListener != "function")
|
|
850
851
|
return;
|
|
851
|
-
k.add(
|
|
852
|
+
k.add(P);
|
|
852
853
|
const i = () => {
|
|
853
|
-
const
|
|
854
|
-
y(
|
|
854
|
+
const S = P.activeCues?.[0]?.text || void 0;
|
|
855
|
+
y(S), b && S && (e.paused || (e.pause(), l.current = !0), T(S));
|
|
855
856
|
};
|
|
856
|
-
|
|
857
|
+
P.addEventListener("cuechange", i), w.push(() => P.removeEventListener("cuechange", i));
|
|
857
858
|
}, v = () => {
|
|
858
|
-
let
|
|
859
|
+
let P = !1;
|
|
859
860
|
for (const i of Array.from(f))
|
|
860
|
-
i.kind ===
|
|
861
|
-
|
|
861
|
+
i.kind === xe && (r === void 0 && (P = !0), O(i));
|
|
862
|
+
d(P);
|
|
862
863
|
};
|
|
863
864
|
v();
|
|
864
|
-
const
|
|
865
|
-
return
|
|
866
|
-
|
|
865
|
+
const C = typeof f.addEventListener == "function", A = () => v();
|
|
866
|
+
return C && (f.addEventListener("addtrack", A), f.addEventListener("removetrack", A)), () => {
|
|
867
|
+
C && (f.removeEventListener("addtrack", A), f.removeEventListener("removetrack", A)), w.forEach((P) => P()), h && window.speechSynthesis.cancel(), E();
|
|
867
868
|
};
|
|
868
|
-
}, [e, t, o,
|
|
869
|
-
() => ({ trackSrc: s, needsCrossOrigin:
|
|
870
|
-
[s,
|
|
869
|
+
}, [e, t, o, r, s]), J(
|
|
870
|
+
() => ({ trackSrc: s, needsCrossOrigin: n, available: m, activeCue: g }),
|
|
871
|
+
[s, n, m, g]
|
|
871
872
|
);
|
|
872
873
|
}
|
|
873
|
-
function Nt({
|
|
874
|
-
targetRef: e
|
|
875
|
-
}) {
|
|
876
|
-
const [t, a] = E(!1);
|
|
877
|
-
N(() => {
|
|
878
|
-
const o = () => {
|
|
879
|
-
a(document.fullscreenElement === e.current);
|
|
880
|
-
};
|
|
881
|
-
return document.addEventListener("fullscreenchange", o), () => {
|
|
882
|
-
document.removeEventListener("fullscreenchange", o);
|
|
883
|
-
};
|
|
884
|
-
}, [e]);
|
|
885
|
-
const n = T(async () => {
|
|
886
|
-
const o = e.current;
|
|
887
|
-
if (o)
|
|
888
|
-
try {
|
|
889
|
-
document.fullscreenElement ? await document.exitFullscreen() : await o.requestFullscreen();
|
|
890
|
-
} catch {
|
|
891
|
-
}
|
|
892
|
-
}, [e]);
|
|
893
|
-
return { isFullscreen: t, toggleFullscreen: n };
|
|
894
|
-
}
|
|
895
874
|
function _t({
|
|
896
875
|
videoRef: e,
|
|
897
876
|
seek: t,
|
|
898
877
|
togglePlay: a,
|
|
899
|
-
toggleMute:
|
|
878
|
+
toggleMute: r,
|
|
900
879
|
toggleFullscreen: o,
|
|
901
880
|
setVolume: s
|
|
902
881
|
}) {
|
|
903
|
-
return
|
|
904
|
-
(
|
|
905
|
-
const
|
|
906
|
-
if (
|
|
882
|
+
return M(
|
|
883
|
+
(n) => {
|
|
884
|
+
const u = n.target;
|
|
885
|
+
if (u instanceof HTMLElement && (u.closest(
|
|
907
886
|
'button, a, input, textarea, select, [role="button"], [contenteditable="true"]'
|
|
908
|
-
) ||
|
|
887
|
+
) || u.closest('[role="menu"], [role^="menuitem"]') || u.getAttribute("role") === "slider"))
|
|
909
888
|
return;
|
|
910
|
-
const
|
|
911
|
-
if (!
|
|
889
|
+
const d = e.current;
|
|
890
|
+
if (!d)
|
|
912
891
|
return;
|
|
913
|
-
switch (
|
|
892
|
+
switch (n.key.length === 1 ? n.key.toLowerCase() : n.key) {
|
|
914
893
|
case " ":
|
|
915
|
-
|
|
894
|
+
n.preventDefault(), a();
|
|
916
895
|
return;
|
|
917
896
|
case "ArrowLeft":
|
|
918
|
-
|
|
897
|
+
n.preventDefault(), t(Math.max(0, d.currentTime - Q));
|
|
919
898
|
return;
|
|
920
899
|
case "ArrowRight": {
|
|
921
|
-
|
|
922
|
-
const g =
|
|
923
|
-
t(Math.min(g,
|
|
900
|
+
n.preventDefault();
|
|
901
|
+
const g = d.duration || d.currentTime + Q;
|
|
902
|
+
t(Math.min(g, d.currentTime + Q));
|
|
924
903
|
return;
|
|
925
904
|
}
|
|
926
905
|
case "ArrowUp":
|
|
927
|
-
|
|
906
|
+
n.preventDefault(), s(Math.min(1, d.volume + te));
|
|
928
907
|
return;
|
|
929
908
|
case "ArrowDown":
|
|
930
|
-
|
|
909
|
+
n.preventDefault(), s(Math.max(0, d.volume - te));
|
|
931
910
|
return;
|
|
932
911
|
case "m":
|
|
933
|
-
|
|
912
|
+
n.preventDefault(), r();
|
|
934
913
|
return;
|
|
935
914
|
case "f":
|
|
936
|
-
|
|
915
|
+
n.preventDefault(), o();
|
|
937
916
|
return;
|
|
938
917
|
default:
|
|
939
918
|
return;
|
|
940
919
|
}
|
|
941
920
|
},
|
|
942
|
-
[e, t, a,
|
|
921
|
+
[e, t, a, r, o, s]
|
|
943
922
|
);
|
|
944
923
|
}
|
|
945
924
|
function Ft({
|
|
@@ -947,26 +926,26 @@ function Ft({
|
|
|
947
926
|
enabled: t,
|
|
948
927
|
resetKey: a
|
|
949
928
|
}) {
|
|
950
|
-
const
|
|
929
|
+
const r = F(0), o = F(0), s = F(t);
|
|
951
930
|
s.current = t;
|
|
952
|
-
const [
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
}, [a]),
|
|
931
|
+
const [n, u] = x(0);
|
|
932
|
+
_(() => {
|
|
933
|
+
r.current = 0, o.current = 0, u(0);
|
|
934
|
+
}, [a]), _(() => {
|
|
956
935
|
if (!e)
|
|
957
936
|
return;
|
|
958
937
|
const m = () => {
|
|
959
|
-
s.current && e.currentTime >
|
|
938
|
+
s.current && e.currentTime > r.current + le && (e.currentTime = r.current);
|
|
960
939
|
}, g = () => {
|
|
961
|
-
|
|
962
|
-
const b =
|
|
940
|
+
u((h) => {
|
|
941
|
+
const b = r.current;
|
|
963
942
|
return b - h >= 1 ? b : h;
|
|
964
943
|
});
|
|
965
944
|
}, y = () => {
|
|
966
|
-
|
|
945
|
+
u((h) => Math.max(h, r.current));
|
|
967
946
|
}, l = () => {
|
|
968
947
|
const h = e.currentTime - o.current;
|
|
969
|
-
h >= 0 && h <
|
|
948
|
+
h >= 0 && h < bt && e.currentTime > r.current && (r.current = e.currentTime, g()), m(), o.current = e.currentTime;
|
|
970
949
|
}, f = () => {
|
|
971
950
|
m(), y();
|
|
972
951
|
};
|
|
@@ -974,18 +953,18 @@ function Ft({
|
|
|
974
953
|
e.removeEventListener("timeupdate", l), e.removeEventListener("seeking", f), e.removeEventListener("seeked", f), e.removeEventListener("pause", y), e.removeEventListener("ended", y);
|
|
975
954
|
};
|
|
976
955
|
}, [e]);
|
|
977
|
-
const
|
|
978
|
-
return { maxWatchedTime:
|
|
956
|
+
const d = M((m) => s.current ? Math.min(m, r.current) : m, []);
|
|
957
|
+
return { maxWatchedTime: n, clampSeek: d };
|
|
979
958
|
}
|
|
980
|
-
const
|
|
959
|
+
const Ee = /* @__PURE__ */ new Set([
|
|
981
960
|
"captions",
|
|
982
961
|
"subtitles"
|
|
983
962
|
]), Ot = 2, Vt = 3;
|
|
984
963
|
function Ut(e, t) {
|
|
985
|
-
const { trackSrc: a, needsCrossOrigin:
|
|
986
|
-
return
|
|
987
|
-
m(!1),
|
|
988
|
-
}, [a]),
|
|
964
|
+
const { trackSrc: a, needsCrossOrigin: r } = Ie(t), [o, s] = x(!1), [n, u] = x(!1), [d, m] = x(!1), y = n || t !== void 0 && !d;
|
|
965
|
+
return _(() => {
|
|
966
|
+
m(!1), u(!1);
|
|
967
|
+
}, [a]), _(() => {
|
|
989
968
|
if (!e)
|
|
990
969
|
return;
|
|
991
970
|
const l = e.textTracks, f = e.querySelector(
|
|
@@ -993,8 +972,8 @@ function Ut(e, t) {
|
|
|
993
972
|
), h = () => {
|
|
994
973
|
let k = !1;
|
|
995
974
|
for (const w of Array.from(l))
|
|
996
|
-
|
|
997
|
-
if (
|
|
975
|
+
Ee.has(w.kind) && (w.mode = o ? "showing" : "hidden", w.cues && w.cues.length > 0 && (k = !0));
|
|
976
|
+
if (u(k), f) {
|
|
998
977
|
if (f.readyState === Vt)
|
|
999
978
|
m(!0);
|
|
1000
979
|
else if (f.readyState === Ot) {
|
|
@@ -1012,30 +991,30 @@ function Ut(e, t) {
|
|
|
1012
991
|
});
|
|
1013
992
|
}
|
|
1014
993
|
for (const k of Array.from(l)) {
|
|
1015
|
-
if (!
|
|
994
|
+
if (!Ee.has(k.kind) || typeof k.addEventListener != "function")
|
|
1016
995
|
continue;
|
|
1017
996
|
const w = () => h();
|
|
1018
997
|
k.addEventListener("cuechange", w), b.push(() => k.removeEventListener("cuechange", w));
|
|
1019
998
|
}
|
|
1020
|
-
const
|
|
1021
|
-
return
|
|
1022
|
-
b.forEach((k) => k()),
|
|
999
|
+
const E = typeof l.addEventListener == "function", T = () => h();
|
|
1000
|
+
return E && (l.addEventListener("addtrack", T), l.addEventListener("removetrack", T)), e.addEventListener("loadedmetadata", h), () => {
|
|
1001
|
+
b.forEach((k) => k()), E && (l.removeEventListener("addtrack", T), l.removeEventListener("removetrack", T)), e.removeEventListener("loadedmetadata", h);
|
|
1023
1002
|
};
|
|
1024
1003
|
}, [e, t, o, a]), J(
|
|
1025
1004
|
() => ({
|
|
1026
1005
|
trackSrc: a,
|
|
1027
|
-
needsCrossOrigin:
|
|
1006
|
+
needsCrossOrigin: r,
|
|
1028
1007
|
available: y,
|
|
1029
1008
|
showing: o,
|
|
1030
1009
|
toggle: () => s((l) => !l)
|
|
1031
1010
|
}),
|
|
1032
|
-
[a,
|
|
1011
|
+
[a, r, y, o]
|
|
1033
1012
|
);
|
|
1034
1013
|
}
|
|
1035
1014
|
function $t(e) {
|
|
1036
1015
|
const t = Math.min(
|
|
1037
|
-
|
|
1038
|
-
e *
|
|
1016
|
+
kt,
|
|
1017
|
+
e * xt
|
|
1039
1018
|
);
|
|
1040
1019
|
return e - t;
|
|
1041
1020
|
}
|
|
@@ -1044,19 +1023,19 @@ function Kt({
|
|
|
1044
1023
|
onComplete: t,
|
|
1045
1024
|
resetKey: a
|
|
1046
1025
|
}) {
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1026
|
+
const r = F(t);
|
|
1027
|
+
r.current = t;
|
|
1049
1028
|
const o = F(!1), s = !!t;
|
|
1050
|
-
|
|
1029
|
+
_(() => {
|
|
1051
1030
|
o.current = !1;
|
|
1052
|
-
}, [a]),
|
|
1031
|
+
}, [a]), _(() => {
|
|
1053
1032
|
if (!e || !s)
|
|
1054
1033
|
return;
|
|
1055
|
-
const
|
|
1056
|
-
o.current || !e.duration || e.currentTime >= $t(e.duration) && (o.current = !0,
|
|
1034
|
+
const n = () => {
|
|
1035
|
+
o.current || !e.duration || e.currentTime >= $t(e.duration) && (o.current = !0, r.current?.(e));
|
|
1057
1036
|
};
|
|
1058
|
-
return e.addEventListener("timeupdate",
|
|
1059
|
-
e.removeEventListener("timeupdate",
|
|
1037
|
+
return e.addEventListener("timeupdate", n), e.addEventListener("ended", n), () => {
|
|
1038
|
+
e.removeEventListener("timeupdate", n), e.removeEventListener("ended", n);
|
|
1060
1039
|
};
|
|
1061
1040
|
}, [e, s]);
|
|
1062
1041
|
}
|
|
@@ -1065,92 +1044,92 @@ function zt({
|
|
|
1065
1044
|
onMilestone: t,
|
|
1066
1045
|
resetKey: a
|
|
1067
1046
|
}) {
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1047
|
+
const r = F(t);
|
|
1048
|
+
r.current = t;
|
|
1070
1049
|
const o = F(/* @__PURE__ */ new Set()), s = !!t;
|
|
1071
|
-
|
|
1050
|
+
_(() => {
|
|
1072
1051
|
o.current.clear();
|
|
1073
|
-
}, [a]),
|
|
1052
|
+
}, [a]), _(() => {
|
|
1074
1053
|
if (!e || !s)
|
|
1075
1054
|
return;
|
|
1076
|
-
const
|
|
1055
|
+
const n = () => {
|
|
1077
1056
|
if (!e.duration)
|
|
1078
1057
|
return;
|
|
1079
|
-
const
|
|
1080
|
-
for (const
|
|
1081
|
-
o.current.has(
|
|
1058
|
+
const u = Math.round(e.currentTime / e.duration * 100);
|
|
1059
|
+
for (const d of Lt)
|
|
1060
|
+
o.current.has(d) || u >= d && (o.current.add(d), r.current?.(d, e));
|
|
1082
1061
|
};
|
|
1083
|
-
return e.addEventListener("timeupdate",
|
|
1084
|
-
e.removeEventListener("timeupdate",
|
|
1062
|
+
return e.addEventListener("timeupdate", n), () => {
|
|
1063
|
+
e.removeEventListener("timeupdate", n);
|
|
1085
1064
|
};
|
|
1086
1065
|
}, [e, s]);
|
|
1087
1066
|
}
|
|
1088
1067
|
function Bt(e) {
|
|
1089
|
-
const t = F(null), [a,
|
|
1068
|
+
const t = F(null), [a, r] = x(
|
|
1090
1069
|
null
|
|
1091
|
-
), o = F(0), s =
|
|
1092
|
-
t.current = i,
|
|
1093
|
-
}, []), [
|
|
1070
|
+
), o = F(0), s = M((i) => {
|
|
1071
|
+
t.current = i, r(i);
|
|
1072
|
+
}, []), [n, u] = x(!1), [d, m] = x(!1), [g, y] = x(0), [l, f] = x(0), [h, b] = x(1), [E, T] = x(!1), [k, w] = x(
|
|
1094
1073
|
oe
|
|
1095
1074
|
);
|
|
1096
|
-
|
|
1097
|
-
o.current = 0, t.current && (t.current.playbackRate = oe),
|
|
1098
|
-
}, [e]),
|
|
1075
|
+
_(() => {
|
|
1076
|
+
o.current = 0, t.current && (t.current.playbackRate = oe), u(!1), m(!1), y(0), f(0), w(oe);
|
|
1077
|
+
}, [e]), _(() => {
|
|
1099
1078
|
const i = a;
|
|
1100
1079
|
if (!i)
|
|
1101
1080
|
return;
|
|
1102
|
-
const D = () => m(!0),
|
|
1103
|
-
b(i.volume),
|
|
1081
|
+
const D = () => m(!0), S = () => m(!1), B = () => m(!1), j = () => {
|
|
1082
|
+
b(i.volume), T(i.muted);
|
|
1104
1083
|
}, K = () => f(i.duration || 0), X = () => {
|
|
1105
1084
|
Et(i.playbackRate) && w(i.playbackRate);
|
|
1106
|
-
},
|
|
1085
|
+
}, N = () => {
|
|
1107
1086
|
const U = performance.now();
|
|
1108
|
-
U - o.current >=
|
|
1087
|
+
U - o.current >= yt && (o.current = U, y(i.currentTime));
|
|
1109
1088
|
};
|
|
1110
|
-
return i.addEventListener("play", D), i.addEventListener("pause",
|
|
1111
|
-
i.removeEventListener("play", D), i.removeEventListener("pause",
|
|
1089
|
+
return i.addEventListener("play", D), i.addEventListener("pause", S), i.addEventListener("ended", B), i.addEventListener("volumechange", j), i.addEventListener("loadedmetadata", K), i.addEventListener("ratechange", X), i.addEventListener("timeupdate", N), i.readyState >= 1 && i.duration && f(i.duration), () => {
|
|
1090
|
+
i.removeEventListener("play", D), i.removeEventListener("pause", S), i.removeEventListener("ended", B), i.removeEventListener("volumechange", j), i.removeEventListener("loadedmetadata", K), i.removeEventListener("ratechange", X), i.removeEventListener("timeupdate", N);
|
|
1112
1091
|
};
|
|
1113
1092
|
}, [a]);
|
|
1114
|
-
const O =
|
|
1093
|
+
const O = M(() => {
|
|
1115
1094
|
const i = t.current;
|
|
1116
1095
|
i && (i.paused || i.ended ? i.play().catch(() => {
|
|
1117
1096
|
}) : i.pause());
|
|
1118
|
-
}, []), v =
|
|
1097
|
+
}, []), v = M(() => {
|
|
1119
1098
|
const i = t.current;
|
|
1120
1099
|
i && (i.muted = !i.muted);
|
|
1121
|
-
}, []),
|
|
1100
|
+
}, []), C = M((i) => {
|
|
1122
1101
|
const D = t.current;
|
|
1123
1102
|
if (!D)
|
|
1124
1103
|
return;
|
|
1125
|
-
const
|
|
1126
|
-
D.volume =
|
|
1127
|
-
}, []), A =
|
|
1104
|
+
const S = Math.max(0, Math.min(1, i));
|
|
1105
|
+
D.volume = S, D.muted = S === 0;
|
|
1106
|
+
}, []), A = M((i) => {
|
|
1128
1107
|
const D = t.current;
|
|
1129
1108
|
D && (D.playbackRate = i);
|
|
1130
|
-
}, []),
|
|
1109
|
+
}, []), P = M((i) => {
|
|
1131
1110
|
const D = t.current;
|
|
1132
1111
|
if (!D)
|
|
1133
1112
|
return;
|
|
1134
|
-
const
|
|
1135
|
-
D.currentTime =
|
|
1113
|
+
const S = Math.max(0, Math.min(i, D.duration || i));
|
|
1114
|
+
D.currentTime = S, y(S);
|
|
1136
1115
|
}, []);
|
|
1137
1116
|
return {
|
|
1138
1117
|
videoRef: t,
|
|
1139
1118
|
videoElement: a,
|
|
1140
1119
|
setVideoNode: s,
|
|
1141
|
-
videoLoaded:
|
|
1142
|
-
isPlaying:
|
|
1120
|
+
videoLoaded: n,
|
|
1121
|
+
isPlaying: d,
|
|
1143
1122
|
currentTime: g,
|
|
1144
1123
|
duration: l,
|
|
1145
1124
|
volume: h,
|
|
1146
|
-
isMuted:
|
|
1125
|
+
isMuted: E,
|
|
1147
1126
|
playbackRate: k,
|
|
1148
|
-
setVideoLoaded:
|
|
1127
|
+
setVideoLoaded: u,
|
|
1149
1128
|
togglePlay: O,
|
|
1150
1129
|
toggleMute: v,
|
|
1151
|
-
setVolume:
|
|
1130
|
+
setVolume: C,
|
|
1152
1131
|
setPlaybackRate: A,
|
|
1153
|
-
seekTo:
|
|
1132
|
+
seekTo: P
|
|
1154
1133
|
};
|
|
1155
1134
|
}
|
|
1156
1135
|
function Ht({
|
|
@@ -1159,35 +1138,35 @@ function Ht({
|
|
|
1159
1138
|
}) {
|
|
1160
1139
|
const a = F(t);
|
|
1161
1140
|
a.current = t;
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1164
|
-
if (!e || !
|
|
1141
|
+
const r = !!t;
|
|
1142
|
+
_(() => {
|
|
1143
|
+
if (!e || !r)
|
|
1165
1144
|
return;
|
|
1166
1145
|
let o = null;
|
|
1167
1146
|
const s = () => {
|
|
1168
1147
|
o && (clearInterval(o), o = null);
|
|
1169
|
-
},
|
|
1148
|
+
}, n = () => {
|
|
1170
1149
|
a.current?.(), s(), o = setInterval(() => {
|
|
1171
1150
|
a.current?.();
|
|
1172
|
-
},
|
|
1173
|
-
},
|
|
1151
|
+
}, wt);
|
|
1152
|
+
}, u = () => {
|
|
1174
1153
|
a.current?.(), s();
|
|
1175
|
-
},
|
|
1176
|
-
return e.addEventListener("play",
|
|
1177
|
-
s(), e.removeEventListener("play",
|
|
1154
|
+
}, d = () => s();
|
|
1155
|
+
return e.addEventListener("play", n), e.addEventListener("pause", u), e.addEventListener("ended", d), () => {
|
|
1156
|
+
s(), e.removeEventListener("play", n), e.removeEventListener("pause", u), e.removeEventListener("ended", d);
|
|
1178
1157
|
};
|
|
1179
|
-
}, [e,
|
|
1158
|
+
}, [e, r]);
|
|
1180
1159
|
}
|
|
1181
1160
|
function Wt({
|
|
1182
1161
|
src: e,
|
|
1183
1162
|
poster: t,
|
|
1184
1163
|
ariaLabel: a,
|
|
1185
|
-
silent:
|
|
1164
|
+
silent: r = !1,
|
|
1186
1165
|
persistControls: o = !1,
|
|
1187
1166
|
content: s,
|
|
1188
|
-
defaultLanguage:
|
|
1189
|
-
autoPlay:
|
|
1190
|
-
autoFocus:
|
|
1167
|
+
defaultLanguage: n,
|
|
1168
|
+
autoPlay: u = !1,
|
|
1169
|
+
autoFocus: d = !1,
|
|
1191
1170
|
download: m,
|
|
1192
1171
|
restrictForwardSeek: g = !1,
|
|
1193
1172
|
onTrackAction: y,
|
|
@@ -1195,33 +1174,33 @@ function Wt({
|
|
|
1195
1174
|
onComplete: f,
|
|
1196
1175
|
...h
|
|
1197
1176
|
}) {
|
|
1198
|
-
const { t: b } = W(),
|
|
1199
|
-
() => Z(
|
|
1200
|
-
), O =
|
|
1177
|
+
const { t: b } = W(), E = F(null), T = J(() => ae(e), [e]), [k, w] = x(
|
|
1178
|
+
() => Z(T, n)
|
|
1179
|
+
), O = T.some((L) => L.locale === k) ? k : Z(T, n), v = ee(e, O) ?? "", C = J(
|
|
1201
1180
|
() => ae(s?.captions),
|
|
1202
1181
|
[s?.captions]
|
|
1203
|
-
), [A,
|
|
1204
|
-
() => Z(
|
|
1205
|
-
), i =
|
|
1182
|
+
), [A, P] = x(
|
|
1183
|
+
() => Z(C, n)
|
|
1184
|
+
), i = C.some(
|
|
1206
1185
|
(L) => L.locale === A
|
|
1207
|
-
) ? A : Z(
|
|
1186
|
+
) ? A : Z(C, n), D = ee(s?.captions, i), S = J(
|
|
1208
1187
|
() => ae(s?.descriptions, s?.describedSrc),
|
|
1209
1188
|
[s?.descriptions, s?.describedSrc]
|
|
1210
|
-
), [B, j] =
|
|
1211
|
-
() => Z(
|
|
1212
|
-
), K =
|
|
1189
|
+
), [B, j] = x(
|
|
1190
|
+
() => Z(S, n)
|
|
1191
|
+
), K = S.some(
|
|
1213
1192
|
(L) => L.locale === B
|
|
1214
|
-
) ? B : Z(
|
|
1193
|
+
) ? B : Z(S, n), X = ee(
|
|
1215
1194
|
s?.descriptions,
|
|
1216
1195
|
K
|
|
1217
|
-
),
|
|
1196
|
+
), N = ee(
|
|
1218
1197
|
s?.describedSrc,
|
|
1219
1198
|
K
|
|
1220
|
-
), [U,
|
|
1199
|
+
), [U, q] = x(!1), G = U && N ? N : v, p = Bt(G), I = Ut(p.videoElement, D), z = Nt(p.videoElement, {
|
|
1221
1200
|
enabled: U,
|
|
1222
|
-
describedSrc:
|
|
1201
|
+
describedSrc: N,
|
|
1223
1202
|
descriptions: X
|
|
1224
|
-
}), V =
|
|
1203
|
+
}), V = M(() => {
|
|
1225
1204
|
const L = p.videoRef.current;
|
|
1226
1205
|
if (!L)
|
|
1227
1206
|
return;
|
|
@@ -1230,28 +1209,28 @@ function Wt({
|
|
|
1230
1209
|
}), L.removeEventListener("loadedmetadata", be);
|
|
1231
1210
|
};
|
|
1232
1211
|
L.addEventListener("loadedmetadata", be);
|
|
1233
|
-
}, [p.videoRef]), Ne =
|
|
1212
|
+
}, [p.videoRef]), Ne = M(
|
|
1234
1213
|
(L) => {
|
|
1235
1214
|
V(), w(L);
|
|
1236
1215
|
},
|
|
1237
1216
|
[V]
|
|
1238
|
-
), _e =
|
|
1239
|
-
|
|
1240
|
-
}, [
|
|
1217
|
+
), _e = M(() => {
|
|
1218
|
+
N && V(), q((L) => !L);
|
|
1219
|
+
}, [N, V]), Fe = M(
|
|
1241
1220
|
(L) => {
|
|
1242
|
-
|
|
1221
|
+
P(L), I.showing || I.toggle();
|
|
1243
1222
|
},
|
|
1244
1223
|
[I]
|
|
1245
|
-
), Oe =
|
|
1224
|
+
), Oe = M(() => {
|
|
1246
1225
|
I.showing && I.toggle();
|
|
1247
|
-
}, [I]), Ve =
|
|
1226
|
+
}, [I]), Ve = M(
|
|
1248
1227
|
(L) => {
|
|
1249
|
-
|
|
1228
|
+
N && V(), j(L), q(!0);
|
|
1250
1229
|
},
|
|
1251
|
-
[
|
|
1252
|
-
), Ue =
|
|
1253
|
-
|
|
1254
|
-
}, [
|
|
1230
|
+
[N, V]
|
|
1231
|
+
), Ue = M(() => {
|
|
1232
|
+
N && V(), q(!1);
|
|
1233
|
+
}, [N, V]);
|
|
1255
1234
|
Ht({ video: p.videoElement, onTrackAction: y }), zt({
|
|
1256
1235
|
video: p.videoElement,
|
|
1257
1236
|
onMilestone: l,
|
|
@@ -1265,50 +1244,50 @@ function Wt({
|
|
|
1265
1244
|
video: p.videoElement,
|
|
1266
1245
|
enabled: g,
|
|
1267
1246
|
resetKey: v
|
|
1268
|
-
}), pe =
|
|
1247
|
+
}), pe = M(
|
|
1269
1248
|
(L) => p.seekTo(me(L)),
|
|
1270
1249
|
[p, me]
|
|
1271
|
-
), { isFullscreen: Ke, toggleFullscreen: he } =
|
|
1272
|
-
targetRef:
|
|
1273
|
-
}), ge =
|
|
1274
|
-
}, []), ve = !!(U &&
|
|
1275
|
-
|
|
1250
|
+
), { isFullscreen: Ke, toggleFullscreen: he } = vt({
|
|
1251
|
+
targetRef: E
|
|
1252
|
+
}), ge = M(() => {
|
|
1253
|
+
}, []), ve = !!(U && N);
|
|
1254
|
+
_(() => {
|
|
1276
1255
|
const L = p.videoRef.current;
|
|
1277
|
-
|
|
1278
|
-
}, [
|
|
1256
|
+
r && L && (L.muted = !ve);
|
|
1257
|
+
}, [r, ve, p.videoElement, p.videoRef]);
|
|
1279
1258
|
const ze = _t({
|
|
1280
1259
|
videoRef: p.videoRef,
|
|
1281
1260
|
seek: pe,
|
|
1282
1261
|
togglePlay: p.togglePlay,
|
|
1283
|
-
toggleMute:
|
|
1262
|
+
toggleMute: r ? ge : p.toggleMute,
|
|
1284
1263
|
toggleFullscreen: he,
|
|
1285
|
-
setVolume:
|
|
1264
|
+
setVolume: r ? ge : p.setVolume
|
|
1286
1265
|
});
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
}, [
|
|
1266
|
+
_(() => {
|
|
1267
|
+
d && E.current?.focus({ preventScroll: !0 });
|
|
1268
|
+
}, [d]);
|
|
1290
1269
|
const Be = (L) => L.preventDefault();
|
|
1291
|
-
return /* @__PURE__ */
|
|
1270
|
+
return /* @__PURE__ */ R(
|
|
1292
1271
|
"div",
|
|
1293
1272
|
{
|
|
1294
|
-
ref:
|
|
1273
|
+
ref: E,
|
|
1295
1274
|
className: H(
|
|
1296
1275
|
"group relative h-full w-full overflow-hidden rounded-[inherit] bg-f1-foreground dark:bg-f1-background",
|
|
1297
1276
|
"[&:fullscreen]:h-screen [&:fullscreen]:w-screen [&:fullscreen]:rounded-none",
|
|
1298
|
-
|
|
1277
|
+
de()
|
|
1299
1278
|
),
|
|
1300
1279
|
role: "region",
|
|
1301
1280
|
"aria-label": a ?? b("videoPlayer.regionLabel"),
|
|
1302
1281
|
tabIndex: 0,
|
|
1303
1282
|
onKeyDown: ze,
|
|
1304
|
-
"data-video-captions":
|
|
1283
|
+
"data-video-captions": r ? "no-audio" : I.available ? "available" : "missing",
|
|
1305
1284
|
...h,
|
|
1306
1285
|
children: [
|
|
1307
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ R(
|
|
1308
1287
|
"video",
|
|
1309
1288
|
{
|
|
1310
1289
|
ref: p.setVideoNode,
|
|
1311
|
-
autoPlay:
|
|
1290
|
+
autoPlay: u,
|
|
1312
1291
|
playsInline: !0,
|
|
1313
1292
|
disablePictureInPicture: !0,
|
|
1314
1293
|
disableRemotePlayback: !0,
|
|
@@ -1362,7 +1341,7 @@ function Wt({
|
|
|
1362
1341
|
tabIndex: -1,
|
|
1363
1342
|
onClick: p.togglePlay,
|
|
1364
1343
|
className: "pointer-events-auto flex size-14 items-center justify-center rounded-full bg-f1-foreground/70 pl-0.5 shadow-[0_2px_8px_rgba(0,0,0,0.45)] transition-transform duration-150 hover:scale-105 motion-reduce:transition-none dark:bg-f1-background/70 [&_svg]:size-7",
|
|
1365
|
-
children: /* @__PURE__ */ c(
|
|
1344
|
+
children: /* @__PURE__ */ c(ut, { icon: Pe, size: "lg", color: "#fff" })
|
|
1366
1345
|
}
|
|
1367
1346
|
)
|
|
1368
1347
|
}
|
|
@@ -1372,8 +1351,8 @@ function Wt({
|
|
|
1372
1351
|
{
|
|
1373
1352
|
"aria-hidden": !0,
|
|
1374
1353
|
className: "dark pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-center p-3",
|
|
1375
|
-
children: /* @__PURE__ */
|
|
1376
|
-
/* @__PURE__ */
|
|
1354
|
+
children: /* @__PURE__ */ R("p", { className: "max-w-[90%] rounded-md bg-f1-background/70 px-2 py-1 text-center text-base italic text-f1-foreground [text-shadow:0_1px_2px_rgba(0,0,0,0.55)]", children: [
|
|
1355
|
+
/* @__PURE__ */ R("span", { className: "pr-1 font-medium not-italic opacity-70", children: [
|
|
1377
1356
|
"[",
|
|
1378
1357
|
b("videoPlayer.audioDescription"),
|
|
1379
1358
|
"]"
|
|
@@ -1384,7 +1363,7 @@ function Wt({
|
|
|
1384
1363
|
) : null,
|
|
1385
1364
|
/* @__PURE__ */ c("span", { className: "sr-only", "aria-live": "polite", children: p.isPlaying ? b("videoPlayer.playing") : b("videoPlayer.paused") }),
|
|
1386
1365
|
p.videoLoaded ? /* @__PURE__ */ c(
|
|
1387
|
-
|
|
1366
|
+
It,
|
|
1388
1367
|
{
|
|
1389
1368
|
isPlaying: p.isPlaying,
|
|
1390
1369
|
currentTime: p.currentTime,
|
|
@@ -1395,21 +1374,21 @@ function Wt({
|
|
|
1395
1374
|
isFullscreen: Ke,
|
|
1396
1375
|
markerTime: g ? $e : void 0,
|
|
1397
1376
|
blockSeekPastMarker: g,
|
|
1398
|
-
containerRef:
|
|
1377
|
+
containerRef: E,
|
|
1399
1378
|
captionsAvailable: I.available,
|
|
1400
1379
|
captionsOn: I.showing,
|
|
1401
1380
|
audioDescriptionAvailable: z.available,
|
|
1402
1381
|
audioDescriptionOn: U,
|
|
1403
|
-
silent:
|
|
1382
|
+
silent: r,
|
|
1404
1383
|
persist: o,
|
|
1405
|
-
audioLanguages:
|
|
1384
|
+
audioLanguages: T,
|
|
1406
1385
|
audioLanguage: O,
|
|
1407
1386
|
onAudioLanguageChange: Ne,
|
|
1408
|
-
captionLanguages:
|
|
1387
|
+
captionLanguages: C,
|
|
1409
1388
|
captionLanguage: i,
|
|
1410
1389
|
onCaptionLanguageChange: Fe,
|
|
1411
1390
|
onCaptionsOff: Oe,
|
|
1412
|
-
audioDescriptionLanguages:
|
|
1391
|
+
audioDescriptionLanguages: S,
|
|
1413
1392
|
audioDescriptionLanguage: K,
|
|
1414
1393
|
onAudioDescriptionLanguageChange: Ve,
|
|
1415
1394
|
onAudioDescriptionOff: Ue,
|
|
@@ -1430,11 +1409,11 @@ function Wt({
|
|
|
1430
1409
|
}
|
|
1431
1410
|
);
|
|
1432
1411
|
}
|
|
1433
|
-
const
|
|
1412
|
+
const Jt = ft(
|
|
1434
1413
|
mt("F0VideoPlayer", Wt)
|
|
1435
1414
|
);
|
|
1436
1415
|
export {
|
|
1437
|
-
|
|
1416
|
+
Jt as F,
|
|
1438
1417
|
ae as c,
|
|
1439
1418
|
Z as d,
|
|
1440
1419
|
Le as l,
|