@factorialco/f0-react 10.17.2 → 11.1.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/{ChatPostComposerDialog-BtPiTMRu.js → ChatPostComposerDialog-BRPhPg0V.js} +3 -3
- package/dist/{CoachmarkProvider-rDkLQ01u.js → CoachmarkProvider-Cv-8HfUP.js} +12978 -12978
- package/dist/{DocumentToolbar-KX3rz4K4.js → DocumentToolbar-Dibdy0XD.js} +5 -5
- package/dist/{DocxViewer-BSGDgnM3.js → DocxViewer-D4R37ej-.js} +2 -2
- package/dist/{F0AiProcessingOverlay-B3Spv9Lg.js → F0AiProcessingOverlay-DMiGnFsb.js} +926 -935
- package/dist/{F0CanvasPanel-BUFxHyKh.js → F0CanvasPanel-BwTjB_ef.js} +156 -127
- package/dist/{F0DocumentViewer-B5vLS5aP.js → F0DocumentViewer-CBDtqTP1.js} +8 -8
- package/dist/F0DocumentViewer-vZ5QrV_0.js +3 -0
- package/dist/{F0Map-FN0N9L8R.js → F0Map-xxT7h77R.js} +6 -6
- package/dist/{F0Select-Bzp4aOU7.js → F0Select-DSKdq9ZK.js} +2 -2
- package/dist/{F0Text-eOwHoc51.js → F0Text-CxMxdCn2.js} +2 -2
- package/dist/F0VideoPlayer-B96rE7Un.js +1 -0
- package/dist/{F0VideoPlayer-DRn2ln3H.js → F0VideoPlayer-BXkn2HYD.js} +276 -276
- package/dist/{Map-2DiynZpl.js → Map-DHXAVOwj.js} +9 -9
- package/dist/{PdfThumbnail-CST7SEFz.js → PdfThumbnail-CcphMSG_.js} +1 -1
- package/dist/{SheetViewer-DGsjtuo_.js → SheetViewer-Dfb0hEj5.js} +4 -4
- package/dist/{TextViewer-BjE8AxXq.js → TextViewer-D0aQleNb.js} +2 -2
- package/dist/ai.d.ts +3 -3
- package/dist/ai.js +5 -5
- package/dist/component-status.js +30 -8
- package/dist/{dist-Ck_UA8Lz.js → dist-B7gjXV8f.js} +1 -1
- package/dist/experimental.d.ts +33 -30
- package/dist/experimental.js +3730 -3742
- package/dist/{exports-BaPJp_sC.d.ts → exports-CYHNvlyA.d.ts} +1 -1
- package/dist/f0.d.ts +4 -4
- package/dist/f0.js +175 -175
- package/dist/{i18n-provider-defaults-Ch0JDGbK.js → i18n-provider-defaults-0FwmF5YL.js} +1 -0
- package/dist/{i18n-provider-defaults-D1lWzbYx.d.ts → i18n-provider-defaults-Yf7knX-_.d.ts} +3 -0
- package/dist/i18n-provider-defaults.d.ts +1 -1
- package/dist/i18n-provider-defaults.js +1 -1
- package/dist/{index-2J8R9Uml.d.ts → index-CvmeBmNt.d.ts} +68 -33
- package/dist/{index-Cw2Dwul8.d.ts → index-D7hTWma8.d.ts} +2 -2
- package/dist/{maplibre-Dj1I8pzk.js → maplibre-Be6fCegj.js} +1 -1
- package/dist/{pdfWorker-BYbuhKsY.js → pdfWorker-BrM0bRsr.js} +1 -1
- package/dist/{popover-DNcAIP25.js → popover-CL68oVjH.js} +1 -1
- package/dist/{useData-zygrn6e-.js → useData-B6HLHEev.js} +1 -1
- package/package.json +1 -1
- package/dist/F0DocumentViewer-bKmfYHcz.js +0 -3
- package/dist/F0VideoPlayer-wBssbLIF.js +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { A as e, B as t, F as n, I as r, L as i, U as a, V as o, a as s, an as c, ar as l, b as u, i as d, in as f, j as p, rn as m, rr as h, t as g, z as _ } from "./popover-
|
|
1
|
+
import { A as e, B as t, F as n, I as r, L as i, U as a, V as o, a as s, an as c, ar as l, b as u, i as d, in as f, j as p, rn as m, rr as h, t as g, z as _ } from "./popover-CL68oVjH.js";
|
|
2
2
|
import { L as v, R as y } from "./tooltip-BX4dSfeL.js";
|
|
3
|
-
import { Ga as b,
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import { jsx as
|
|
3
|
+
import { Ga as b, Ka as x, Uo as S, Wa as C, Xo as ee, fo as te, go as w, ks as T, po as ne, ps as re } from "./F0CanvasPanel-BwTjB_ef.js";
|
|
4
|
+
import { t as E } from "./Check-DAp9gCRh.js";
|
|
5
|
+
import { t as D } from "./useFullscreen-CNwpzjpz.js";
|
|
6
|
+
import { forwardRef as O, useCallback as k, useEffect as A, useId as j, useMemo as M, useRef as N, useState as P } from "react";
|
|
7
|
+
import { jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
8
8
|
//#region src/elements/lib/localized.ts
|
|
9
|
-
function
|
|
9
|
+
function L(e) {
|
|
10
10
|
return Array.isArray(e) && e.every((e) => typeof e == "object" && !!e && "locale" in e && "value" in e);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function R(e, t) {
|
|
13
13
|
if (e !== void 0) {
|
|
14
|
-
if (!
|
|
14
|
+
if (!L(e)) return e;
|
|
15
15
|
if (e.length !== 0) return ((t ? e.find((e) => e.locale === t) : void 0) ?? e[0]).value;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function z(...e) {
|
|
19
19
|
let t = /* @__PURE__ */ new Map();
|
|
20
|
-
for (let n of e) if (
|
|
20
|
+
for (let n of e) if (L(n)) for (let e of n) {
|
|
21
21
|
let n = t.get(e.locale);
|
|
22
22
|
n ? !n.label && e.label && (n.label = e.label) : t.set(e.locale, {
|
|
23
23
|
locale: e.locale,
|
|
@@ -26,7 +26,7 @@ function V(...e) {
|
|
|
26
26
|
}
|
|
27
27
|
return Array.from(t.values());
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function B(e, t) {
|
|
30
30
|
if (e.label) return e.label;
|
|
31
31
|
try {
|
|
32
32
|
let n = t ?? e.locale, r = new Intl.DisplayNames([n], { type: "language" }).of(e.locale) ?? e.locale;
|
|
@@ -35,7 +35,7 @@ function H(e, t) {
|
|
|
35
35
|
return e.locale;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function V(e, t) {
|
|
39
39
|
if (e.length === 0) return;
|
|
40
40
|
let n = e.map((e) => e.locale), r = (e) => e.split("-")[0], i = (e) => n.find((t) => t === e) ?? n.find((t) => r(t) === r(e));
|
|
41
41
|
if (t) {
|
|
@@ -51,29 +51,29 @@ function U(e, t) {
|
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/blocks/F0VideoPlayer/utils.ts
|
|
54
|
-
var
|
|
54
|
+
var H = [
|
|
55
55
|
.5,
|
|
56
56
|
.75,
|
|
57
57
|
1,
|
|
58
58
|
1.25,
|
|
59
59
|
1.5
|
|
60
|
-
],
|
|
60
|
+
], U = .1, W = [
|
|
61
61
|
25,
|
|
62
62
|
50,
|
|
63
63
|
75
|
|
64
|
-
],
|
|
65
|
-
function
|
|
64
|
+
], G = 3e5, K = .03;
|
|
65
|
+
function q(e) {
|
|
66
66
|
return !Number.isFinite(e) || e < 0 ? "0:00" : `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function J(e) {
|
|
69
69
|
return `${e}x`;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
71
|
+
function Y(e) {
|
|
72
|
+
return H.includes(e);
|
|
73
73
|
}
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/blocks/F0VideoPlayer/components/AudioDescriptionToggleIcons.tsx
|
|
76
|
-
var
|
|
76
|
+
var X = {
|
|
77
77
|
x: 12,
|
|
78
78
|
y: 15,
|
|
79
79
|
textAnchor: "middle",
|
|
@@ -81,14 +81,14 @@ var Q = {
|
|
|
81
81
|
fontWeight: 700,
|
|
82
82
|
fontFamily: "inherit",
|
|
83
83
|
letterSpacing: -.4
|
|
84
|
-
},
|
|
84
|
+
}, Z = O(({ animate: e, ...t }, n) => /* @__PURE__ */ I("svg", {
|
|
85
85
|
xmlns: "http://www.w3.org/2000/svg",
|
|
86
86
|
viewBox: "0 0 24 24",
|
|
87
87
|
fill: "none",
|
|
88
88
|
ref: n,
|
|
89
89
|
...t,
|
|
90
90
|
"aria-hidden": "true",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ F("rect", {
|
|
92
92
|
x: 3.5,
|
|
93
93
|
y: 6.5,
|
|
94
94
|
width: 17,
|
|
@@ -96,38 +96,38 @@ var Q = {
|
|
|
96
96
|
rx: 2.5,
|
|
97
97
|
stroke: "currentColor",
|
|
98
98
|
vectorEffect: "non-scaling-stroke"
|
|
99
|
-
}), /* @__PURE__ */
|
|
100
|
-
...
|
|
99
|
+
}), /* @__PURE__ */ F("text", {
|
|
100
|
+
...X,
|
|
101
101
|
fill: "currentColor",
|
|
102
102
|
children: "AD"
|
|
103
103
|
})]
|
|
104
104
|
}));
|
|
105
|
-
|
|
106
|
-
var
|
|
107
|
-
let r = `ad-mask-${
|
|
108
|
-
return /* @__PURE__ */
|
|
105
|
+
Z.displayName = "AudioDescriptionLineIcon";
|
|
106
|
+
var ie = O(({ animate: e, ...t }, n) => {
|
|
107
|
+
let r = `ad-mask-${j().replace(/:/g, "")}`;
|
|
108
|
+
return /* @__PURE__ */ I("svg", {
|
|
109
109
|
xmlns: "http://www.w3.org/2000/svg",
|
|
110
110
|
viewBox: "0 0 24 24",
|
|
111
111
|
fill: "none",
|
|
112
112
|
ref: n,
|
|
113
113
|
...t,
|
|
114
114
|
"aria-hidden": "true",
|
|
115
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ I("mask", {
|
|
116
116
|
id: r,
|
|
117
117
|
maskUnits: "userSpaceOnUse",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ F("rect", {
|
|
119
119
|
x: 3,
|
|
120
120
|
y: 6,
|
|
121
121
|
width: 18,
|
|
122
122
|
height: 12,
|
|
123
123
|
rx: 3,
|
|
124
124
|
fill: "white"
|
|
125
|
-
}), /* @__PURE__ */
|
|
126
|
-
...
|
|
125
|
+
}), /* @__PURE__ */ F("text", {
|
|
126
|
+
...X,
|
|
127
127
|
fill: "black",
|
|
128
128
|
children: "AD"
|
|
129
129
|
})]
|
|
130
|
-
}), /* @__PURE__ */
|
|
130
|
+
}), /* @__PURE__ */ F("rect", {
|
|
131
131
|
x: 3,
|
|
132
132
|
y: 6,
|
|
133
133
|
width: 18,
|
|
@@ -138,17 +138,17 @@ var ne = A(({ animate: e, ...t }, n) => {
|
|
|
138
138
|
})]
|
|
139
139
|
});
|
|
140
140
|
});
|
|
141
|
-
|
|
141
|
+
ie.displayName = "AudioDescriptionFilledIcon";
|
|
142
142
|
//#endregion
|
|
143
143
|
//#region src/blocks/F0VideoPlayer/components/CaptionsToggleIcons.tsx
|
|
144
|
-
var
|
|
144
|
+
var Q = O(({ animate: e, ...t }, n) => /* @__PURE__ */ I("svg", {
|
|
145
145
|
xmlns: "http://www.w3.org/2000/svg",
|
|
146
146
|
fill: "none",
|
|
147
147
|
viewBox: "0 0 24 24",
|
|
148
148
|
ref: n,
|
|
149
149
|
...t,
|
|
150
150
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ F("rect", {
|
|
152
152
|
x: 3.5,
|
|
153
153
|
y: 6.5,
|
|
154
154
|
width: 17,
|
|
@@ -157,13 +157,13 @@ var re = A(({ animate: e, ...t }, n) => /* @__PURE__ */ R("svg", {
|
|
|
157
157
|
stroke: "currentColor",
|
|
158
158
|
vectorEffect: "non-scaling-stroke"
|
|
159
159
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ F("path", {
|
|
161
161
|
stroke: "currentColor",
|
|
162
162
|
strokeLinecap: "round",
|
|
163
163
|
d: "M7 10.75h8",
|
|
164
164
|
vectorEffect: "non-scaling-stroke"
|
|
165
165
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ F("path", {
|
|
167
167
|
stroke: "currentColor",
|
|
168
168
|
strokeLinecap: "round",
|
|
169
169
|
d: "M7 13.75h4.5",
|
|
@@ -171,14 +171,14 @@ var re = A(({ animate: e, ...t }, n) => /* @__PURE__ */ R("svg", {
|
|
|
171
171
|
})
|
|
172
172
|
]
|
|
173
173
|
}));
|
|
174
|
-
|
|
175
|
-
var
|
|
174
|
+
Q.displayName = "CaptionsLineIcon";
|
|
175
|
+
var ae = O(({ animate: e, ...t }, n) => /* @__PURE__ */ F("svg", {
|
|
176
176
|
xmlns: "http://www.w3.org/2000/svg",
|
|
177
177
|
fill: "none",
|
|
178
178
|
viewBox: "0 0 24 24",
|
|
179
179
|
ref: n,
|
|
180
180
|
...t,
|
|
181
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ F("path", {
|
|
182
182
|
fill: "currentColor",
|
|
183
183
|
fillRule: "evenodd",
|
|
184
184
|
clipRule: "evenodd",
|
|
@@ -186,23 +186,23 @@ var ie = A(({ animate: e, ...t }, n) => /* @__PURE__ */ L("svg", {
|
|
|
186
186
|
vectorEffect: "non-scaling-stroke"
|
|
187
187
|
})
|
|
188
188
|
}));
|
|
189
|
-
|
|
189
|
+
ae.displayName = "CaptionsFilledIcon";
|
|
190
190
|
//#endregion
|
|
191
191
|
//#region src/blocks/F0VideoPlayer/components/PlaybackRateMenu.tsx
|
|
192
|
-
function
|
|
193
|
-
let { t: r } = m(), [i, a] =
|
|
194
|
-
return /* @__PURE__ */
|
|
192
|
+
function oe({ value: e, onChange: t, containerRef: n }) {
|
|
193
|
+
let { t: r } = m(), [i, a] = P(!1);
|
|
194
|
+
return /* @__PURE__ */ I(g, {
|
|
195
195
|
open: i,
|
|
196
196
|
onOpenChange: a,
|
|
197
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ F(s, {
|
|
198
198
|
asChild: !0,
|
|
199
|
-
children: /* @__PURE__ */
|
|
199
|
+
children: /* @__PURE__ */ F(u, {
|
|
200
200
|
variant: "ghost",
|
|
201
201
|
size: "sm",
|
|
202
|
-
label:
|
|
203
|
-
"aria-label": r("videoPlayer.playbackSpeed", { rate:
|
|
202
|
+
label: J(e),
|
|
203
|
+
"aria-label": r("videoPlayer.playbackSpeed", { rate: J(e) })
|
|
204
204
|
})
|
|
205
|
-
}), /* @__PURE__ */
|
|
205
|
+
}), /* @__PURE__ */ F(d, {
|
|
206
206
|
container: n.current,
|
|
207
207
|
side: "top",
|
|
208
208
|
align: "end",
|
|
@@ -231,9 +231,9 @@ function ae({ value: e, onChange: t, containerRef: n }) {
|
|
|
231
231
|
}
|
|
232
232
|
e.preventDefault(), t[r]?.focus();
|
|
233
233
|
},
|
|
234
|
-
children:
|
|
234
|
+
children: H.map((n) => {
|
|
235
235
|
let r = n === e;
|
|
236
|
-
return /* @__PURE__ */
|
|
236
|
+
return /* @__PURE__ */ I("button", {
|
|
237
237
|
type: "button",
|
|
238
238
|
role: "menuitemradio",
|
|
239
239
|
"aria-checked": r,
|
|
@@ -241,10 +241,10 @@ function ae({ value: e, onChange: t, containerRef: n }) {
|
|
|
241
241
|
onClick: () => {
|
|
242
242
|
t(n), a(!1);
|
|
243
243
|
},
|
|
244
|
-
children: [r ? /* @__PURE__ */
|
|
244
|
+
children: [r ? /* @__PURE__ */ F("span", {
|
|
245
245
|
className: "absolute left-2.5 inline-flex items-center",
|
|
246
|
-
children: /* @__PURE__ */
|
|
247
|
-
}) : null,
|
|
246
|
+
children: /* @__PURE__ */ F(E, {})
|
|
247
|
+
}) : null, J(n)]
|
|
248
248
|
}, n);
|
|
249
249
|
})
|
|
250
250
|
})]
|
|
@@ -252,8 +252,8 @@ function ae({ value: e, onChange: t, containerRef: n }) {
|
|
|
252
252
|
}
|
|
253
253
|
//#endregion
|
|
254
254
|
//#region src/blocks/F0VideoPlayer/components/Seekbar.tsx
|
|
255
|
-
function
|
|
256
|
-
let { t: a } = m(), o =
|
|
255
|
+
function se({ currentTime: e, duration: t, markerTime: n, blockSeekPastMarker: r = !1, onSeek: i }) {
|
|
256
|
+
let { t: a } = m(), o = N(null), [s, c] = P(!1), [l, u] = P(null), d = t > 0 ? Math.min(1, e / t) : 0, f = n !== void 0 && t > 0 ? Math.min(1, n / t) : 0, p = n !== void 0 && t > 0 && n > 0 && n < t - .25 && e < n - .25, h = (e) => {
|
|
257
257
|
let t = o.current;
|
|
258
258
|
if (!t) return 0;
|
|
259
259
|
let n = t.getBoundingClientRect();
|
|
@@ -267,7 +267,7 @@ function oe({ currentTime: e, duration: t, markerTime: n, blockSeekPastMarker: r
|
|
|
267
267
|
}, x = (e) => {
|
|
268
268
|
s && (c(!1), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
|
|
269
269
|
}, S = l !== null && r && n !== void 0 && l > f;
|
|
270
|
-
return /* @__PURE__ */
|
|
270
|
+
return /* @__PURE__ */ I("div", {
|
|
271
271
|
ref: o,
|
|
272
272
|
className: v("relative flex h-4 flex-1 items-center rounded-sm", "cursor-pointer touch-none", y()),
|
|
273
273
|
role: "slider",
|
|
@@ -277,8 +277,8 @@ function oe({ currentTime: e, duration: t, markerTime: n, blockSeekPastMarker: r
|
|
|
277
277
|
"aria-valuemax": t || 0,
|
|
278
278
|
"aria-valuenow": e,
|
|
279
279
|
"aria-valuetext": a("videoPlayer.timeProgress", {
|
|
280
|
-
current:
|
|
281
|
-
total:
|
|
280
|
+
current: q(e),
|
|
281
|
+
total: q(t)
|
|
282
282
|
}),
|
|
283
283
|
onPointerDown: _,
|
|
284
284
|
onPointerMove: b,
|
|
@@ -307,55 +307,55 @@ function oe({ currentTime: e, duration: t, markerTime: n, blockSeekPastMarker: r
|
|
|
307
307
|
n.preventDefault(), n.stopPropagation(), i(r);
|
|
308
308
|
},
|
|
309
309
|
children: [
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ F("div", { className: "absolute inset-x-0 h-1 rounded-sm bg-f1-foreground/30" }),
|
|
311
|
+
/* @__PURE__ */ F("div", {
|
|
312
312
|
className: "pointer-events-none absolute left-0 h-1 rounded-sm bg-f1-foreground",
|
|
313
313
|
style: { width: `${d * 100}%` }
|
|
314
314
|
}),
|
|
315
|
-
p ? /* @__PURE__ */
|
|
315
|
+
p ? /* @__PURE__ */ F("div", {
|
|
316
316
|
className: "pointer-events-none absolute z-[1] h-2.5 w-0.5 -translate-x-px bg-f1-foreground/95",
|
|
317
317
|
style: { left: `${f * 100}%` },
|
|
318
318
|
"aria-hidden": "true"
|
|
319
319
|
}) : null,
|
|
320
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ F("div", {
|
|
321
321
|
className: "pointer-events-none absolute z-[2] h-3 w-3 -translate-x-1/2 rounded-full bg-f1-foreground shadow-[0_0_4px_rgba(0,0,0,0.4)]",
|
|
322
322
|
style: { left: `${d * 100}%` }
|
|
323
323
|
}),
|
|
324
|
-
S ? /* @__PURE__ */
|
|
324
|
+
S ? /* @__PURE__ */ F("div", { className: "absolute inset-0 cursor-not-allowed" }) : null
|
|
325
325
|
]
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
328
|
//#endregion
|
|
329
329
|
//#region src/blocks/F0VideoPlayer/components/SettingsMenu.tsx
|
|
330
|
-
var
|
|
330
|
+
var $ = "off", ce = "py-2 pr-4 text-base font-medium", le = "gap-2 py-2 pl-3 pr-2 text-base font-medium", ue = "max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[13rem] overflow-y-auto p-1";
|
|
331
331
|
function de({ icon: e, label: a, container: s, options: l, value: u, onLanguageChange: d, on: f, onOff: p, offLabel: m }) {
|
|
332
|
-
let h = p !== void 0, g = l.find((e) => e.locale === u), v = h && !f ? m : g ?
|
|
333
|
-
return /* @__PURE__ */
|
|
332
|
+
let h = p !== void 0, g = l.find((e) => e.locale === u), v = h && !f ? m : g ? B(g) : m;
|
|
333
|
+
return /* @__PURE__ */ I(_, { children: [/* @__PURE__ */ I(o, {
|
|
334
334
|
className: le,
|
|
335
335
|
children: [
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ F(c, { icon: e }),
|
|
337
|
+
/* @__PURE__ */ F("span", {
|
|
338
338
|
className: "flex-1",
|
|
339
339
|
children: a
|
|
340
340
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ F("span", {
|
|
342
342
|
className: "text-f1-foreground-secondary",
|
|
343
343
|
children: v
|
|
344
344
|
})
|
|
345
345
|
]
|
|
346
|
-
}), /* @__PURE__ */
|
|
346
|
+
}), /* @__PURE__ */ F(n, {
|
|
347
347
|
container: s ?? void 0,
|
|
348
|
-
children: /* @__PURE__ */
|
|
348
|
+
children: /* @__PURE__ */ F(t, {
|
|
349
349
|
className: ue,
|
|
350
|
-
children: /* @__PURE__ */
|
|
351
|
-
value: h ? f ? u :
|
|
352
|
-
onValueChange: (e) => h && e ===
|
|
353
|
-
children: [l.map((e) => /* @__PURE__ */
|
|
350
|
+
children: /* @__PURE__ */ I(r, {
|
|
351
|
+
value: h ? f ? u : $ : u,
|
|
352
|
+
onValueChange: (e) => h && e === $ ? p() : d(e),
|
|
353
|
+
children: [l.map((e) => /* @__PURE__ */ F(i, {
|
|
354
354
|
value: e.locale,
|
|
355
355
|
className: ce,
|
|
356
|
-
children:
|
|
357
|
-
}, e.locale)), h ? /* @__PURE__ */
|
|
358
|
-
value:
|
|
356
|
+
children: B(e)
|
|
357
|
+
}, e.locale)), h ? /* @__PURE__ */ F(i, {
|
|
358
|
+
value: $,
|
|
359
359
|
className: ce,
|
|
360
360
|
children: m
|
|
361
361
|
}) : null]
|
|
@@ -365,23 +365,23 @@ function de({ icon: e, label: a, container: s, options: l, value: u, onLanguageC
|
|
|
365
365
|
}
|
|
366
366
|
function fe({ containerRef: t, audioLanguages: n, audioLanguage: r, onAudioLanguageChange: i, captionLanguages: o, captionLanguage: s, captionsOn: c, onCaptionLanguageChange: l, onCaptionsOff: d, audioDescriptionLanguages: f, audioDescriptionLanguage: h, audioDescriptionOn: g, onAudioDescriptionLanguageChange: _, onAudioDescriptionOff: v }) {
|
|
367
367
|
let { t: y } = m(), b = t.current, x = y("videoPlayer.off");
|
|
368
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */ I(e, { children: [/* @__PURE__ */ F(a, {
|
|
369
369
|
asChild: !0,
|
|
370
|
-
children: /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ F(u, {
|
|
371
371
|
variant: "ghost",
|
|
372
372
|
size: "sm",
|
|
373
373
|
hideLabel: !0,
|
|
374
|
-
icon:
|
|
374
|
+
icon: w,
|
|
375
375
|
label: y("videoPlayer.settings")
|
|
376
376
|
})
|
|
377
|
-
}), /* @__PURE__ */
|
|
377
|
+
}), /* @__PURE__ */ I(p, {
|
|
378
378
|
container: b,
|
|
379
379
|
side: "top",
|
|
380
380
|
align: "end",
|
|
381
381
|
className: ue,
|
|
382
382
|
children: [
|
|
383
|
-
n.length > 1 ? /* @__PURE__ */
|
|
384
|
-
icon:
|
|
383
|
+
n.length > 1 ? /* @__PURE__ */ F(de, {
|
|
384
|
+
icon: re,
|
|
385
385
|
label: y("videoPlayer.audio"),
|
|
386
386
|
container: b,
|
|
387
387
|
options: n,
|
|
@@ -389,8 +389,8 @@ function fe({ containerRef: t, audioLanguages: n, audioLanguage: r, onAudioLangu
|
|
|
389
389
|
onLanguageChange: i,
|
|
390
390
|
offLabel: x
|
|
391
391
|
}) : null,
|
|
392
|
-
o.length > 1 ? /* @__PURE__ */
|
|
393
|
-
icon:
|
|
392
|
+
o.length > 1 ? /* @__PURE__ */ F(de, {
|
|
393
|
+
icon: Q,
|
|
394
394
|
label: y("videoPlayer.subtitles"),
|
|
395
395
|
container: b,
|
|
396
396
|
options: o,
|
|
@@ -400,8 +400,8 @@ function fe({ containerRef: t, audioLanguages: n, audioLanguage: r, onAudioLangu
|
|
|
400
400
|
onOff: d,
|
|
401
401
|
offLabel: x
|
|
402
402
|
}) : null,
|
|
403
|
-
f.length > 1 ? /* @__PURE__ */
|
|
404
|
-
icon:
|
|
403
|
+
f.length > 1 ? /* @__PURE__ */ F(de, {
|
|
404
|
+
icon: Z,
|
|
405
405
|
label: y("videoPlayer.audioDescription"),
|
|
406
406
|
container: b,
|
|
407
407
|
options: f,
|
|
@@ -420,34 +420,34 @@ function pe(e) {
|
|
|
420
420
|
//#endregion
|
|
421
421
|
//#region src/blocks/F0VideoPlayer/components/VolumeControl.tsx
|
|
422
422
|
function me(e, t) {
|
|
423
|
-
return t || e === 0 ? C : e <= .5 ?
|
|
423
|
+
return t || e === 0 ? C : e <= .5 ? b : x;
|
|
424
424
|
}
|
|
425
425
|
function he({ volume: e, isMuted: t, onToggleMute: n, onVolumeChange: r, silent: i = !1 }) {
|
|
426
426
|
let { t: a } = m(), o = t || e === 0;
|
|
427
|
-
return i ? /* @__PURE__ */
|
|
427
|
+
return i ? /* @__PURE__ */ F(u, {
|
|
428
428
|
variant: "ghost",
|
|
429
429
|
size: "sm",
|
|
430
430
|
hideLabel: !0,
|
|
431
431
|
disabled: !0,
|
|
432
432
|
icon: C,
|
|
433
433
|
label: a("videoPlayer.noAudio")
|
|
434
|
-
}) : /* @__PURE__ */
|
|
434
|
+
}) : /* @__PURE__ */ I("div", {
|
|
435
435
|
className: "flex items-center gap-1",
|
|
436
|
-
children: [/* @__PURE__ */
|
|
436
|
+
children: [/* @__PURE__ */ F(u, {
|
|
437
437
|
variant: "ghost",
|
|
438
438
|
size: "sm",
|
|
439
439
|
hideLabel: !0,
|
|
440
440
|
icon: me(e, o),
|
|
441
441
|
label: a(o ? "videoPlayer.unmute" : "videoPlayer.mute"),
|
|
442
442
|
onClick: n
|
|
443
|
-
}), /* @__PURE__ */
|
|
443
|
+
}), /* @__PURE__ */ F(ge, {
|
|
444
444
|
value: o ? 0 : e,
|
|
445
445
|
onChange: r
|
|
446
446
|
})]
|
|
447
447
|
});
|
|
448
448
|
}
|
|
449
449
|
function ge({ value: e, onChange: t }) {
|
|
450
|
-
let { t: n } = m(), r =
|
|
450
|
+
let { t: n } = m(), r = N(null), [i, a] = P(!1), o = Math.max(0, Math.min(1, e)), s = (e) => {
|
|
451
451
|
let t = r.current;
|
|
452
452
|
if (!t) return 0;
|
|
453
453
|
let n = t.getBoundingClientRect(), i = n.width - 12;
|
|
@@ -459,7 +459,7 @@ function ge({ value: e, onChange: t }) {
|
|
|
459
459
|
}, u = (e) => {
|
|
460
460
|
i && (a(!1), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
|
|
461
461
|
};
|
|
462
|
-
return /* @__PURE__ */
|
|
462
|
+
return /* @__PURE__ */ I("div", {
|
|
463
463
|
ref: r,
|
|
464
464
|
className: v("relative flex h-4 w-[60px] items-center rounded-sm", "cursor-pointer touch-none", y()),
|
|
465
465
|
role: "slider",
|
|
@@ -479,11 +479,11 @@ function ge({ value: e, onChange: t }) {
|
|
|
479
479
|
switch (e.key) {
|
|
480
480
|
case "ArrowRight":
|
|
481
481
|
case "ArrowUp":
|
|
482
|
-
n = Math.min(1, o +
|
|
482
|
+
n = Math.min(1, o + U);
|
|
483
483
|
break;
|
|
484
484
|
case "ArrowLeft":
|
|
485
485
|
case "ArrowDown":
|
|
486
|
-
n = Math.max(0, o -
|
|
486
|
+
n = Math.max(0, o - U);
|
|
487
487
|
break;
|
|
488
488
|
case "Home":
|
|
489
489
|
n = 0;
|
|
@@ -496,12 +496,12 @@ function ge({ value: e, onChange: t }) {
|
|
|
496
496
|
e.preventDefault(), e.stopPropagation(), t(n);
|
|
497
497
|
},
|
|
498
498
|
children: [
|
|
499
|
-
/* @__PURE__ */
|
|
500
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ F("div", { className: "absolute inset-x-0 h-1 rounded-sm bg-f1-foreground/30" }),
|
|
500
|
+
/* @__PURE__ */ F("div", {
|
|
501
501
|
className: "pointer-events-none absolute left-0 h-1 rounded-sm bg-f1-foreground",
|
|
502
502
|
style: { width: `calc(12px + (100% - 12px) * ${o})` }
|
|
503
503
|
}),
|
|
504
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ F("div", {
|
|
505
505
|
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)]",
|
|
506
506
|
style: { left: `calc(6px + (100% - 12px) * ${o})` }
|
|
507
507
|
})
|
|
@@ -510,99 +510,99 @@ function ge({ value: e, onChange: t }) {
|
|
|
510
510
|
}
|
|
511
511
|
//#endregion
|
|
512
512
|
//#region src/blocks/F0VideoPlayer/components/Controls.tsx
|
|
513
|
-
function _e({ isPlaying: e, currentTime: t, duration: n, volume: r, isMuted: i, playbackRate: a, isFullscreen: o, markerTime: s, blockSeekPastMarker: c, containerRef: l, captionsAvailable: d, captionsOn: f, audioDescriptionAvailable: p, audioDescriptionOn: h, silent: g, persist: _, audioLanguages: y, audioLanguage: b, onAudioLanguageChange:
|
|
514
|
-
let { t:
|
|
513
|
+
function _e({ isPlaying: e, currentTime: t, duration: n, volume: r, isMuted: i, playbackRate: a, isFullscreen: o, markerTime: s, blockSeekPastMarker: c, containerRef: l, captionsAvailable: d, captionsOn: f, audioDescriptionAvailable: p, audioDescriptionOn: h, silent: g, persist: _, audioLanguages: y, audioLanguage: b, onAudioLanguageChange: x, captionLanguages: C, captionLanguage: w, onCaptionLanguageChange: re, onCaptionsOff: E, audioDescriptionLanguages: D, audioDescriptionLanguage: O, onAudioDescriptionLanguageChange: k, onAudioDescriptionOff: A, onTogglePlay: j, onToggleMute: M, onVolumeChange: N, onPlaybackRateChange: P, onToggleFullscreen: L, onToggleCaptions: R, onToggleAudioDescription: z, onSeek: B, download: V }) {
|
|
514
|
+
let { t: H } = m(), U = d && C.length <= 1, W = p && D.length <= 1, G = pe({
|
|
515
515
|
audioLanguages: y.length,
|
|
516
|
-
captionLanguages:
|
|
517
|
-
audioDescriptionLanguages:
|
|
516
|
+
captionLanguages: C.length,
|
|
517
|
+
audioDescriptionLanguages: D.length
|
|
518
518
|
});
|
|
519
|
-
return /* @__PURE__ */
|
|
519
|
+
return /* @__PURE__ */ I("div", {
|
|
520
520
|
className: v("dark absolute inset-x-0 bottom-0 z-[2] flex select-none items-center gap-2", "rounded-b-[inherit] bg-gradient-to-t from-[#000000f2] via-[#000000b3] to-transparent px-3 py-3", "[text-shadow:0_1px_2px_rgba(0,0,0,0.55)] [&_svg]:drop-shadow-[0_1px_2px_rgba(0,0,0,0.55)]", "transition-opacity duration-200 motion-reduce:transition-none", !e || _ ? "opacity-100" : "opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"),
|
|
521
521
|
children: [
|
|
522
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ F(u, {
|
|
523
523
|
variant: "ghost",
|
|
524
524
|
size: "sm",
|
|
525
525
|
hideLabel: !0,
|
|
526
|
-
icon: e ?
|
|
527
|
-
label:
|
|
528
|
-
onClick:
|
|
526
|
+
icon: e ? ne : te,
|
|
527
|
+
label: H(e ? "videoPlayer.pause" : "videoPlayer.play"),
|
|
528
|
+
onClick: j
|
|
529
529
|
}),
|
|
530
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ F(se, {
|
|
531
531
|
currentTime: t,
|
|
532
532
|
duration: n,
|
|
533
533
|
markerTime: s,
|
|
534
534
|
blockSeekPastMarker: c,
|
|
535
|
-
onSeek:
|
|
535
|
+
onSeek: B
|
|
536
536
|
}),
|
|
537
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ I("span", {
|
|
538
538
|
className: "min-w-[80px] whitespace-nowrap text-center text-base font-medium tabular-nums text-f1-foreground",
|
|
539
539
|
children: [
|
|
540
|
-
|
|
540
|
+
q(t),
|
|
541
541
|
" / ",
|
|
542
|
-
|
|
542
|
+
q(n)
|
|
543
543
|
]
|
|
544
544
|
}),
|
|
545
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ F(he, {
|
|
546
546
|
volume: r,
|
|
547
547
|
isMuted: i,
|
|
548
|
-
onToggleMute:
|
|
549
|
-
onVolumeChange:
|
|
548
|
+
onToggleMute: M,
|
|
549
|
+
onVolumeChange: N,
|
|
550
550
|
silent: g
|
|
551
551
|
}),
|
|
552
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ F(oe, {
|
|
553
553
|
value: a,
|
|
554
|
-
onChange:
|
|
554
|
+
onChange: P,
|
|
555
555
|
containerRef: l
|
|
556
556
|
}),
|
|
557
|
-
|
|
557
|
+
U ? /* @__PURE__ */ F(u, {
|
|
558
558
|
variant: "ghost",
|
|
559
559
|
size: "sm",
|
|
560
560
|
hideLabel: !0,
|
|
561
|
-
icon: f ?
|
|
562
|
-
label:
|
|
561
|
+
icon: f ? ae : Q,
|
|
562
|
+
label: H("videoPlayer.captions"),
|
|
563
563
|
"aria-pressed": f,
|
|
564
|
-
onClick:
|
|
564
|
+
onClick: R
|
|
565
565
|
}) : null,
|
|
566
|
-
|
|
566
|
+
W ? /* @__PURE__ */ F(u, {
|
|
567
567
|
variant: "ghost",
|
|
568
568
|
size: "sm",
|
|
569
569
|
hideLabel: !0,
|
|
570
|
-
icon: h ?
|
|
571
|
-
label:
|
|
570
|
+
icon: h ? ie : Z,
|
|
571
|
+
label: H("videoPlayer.audioDescription"),
|
|
572
572
|
"aria-pressed": h,
|
|
573
|
-
onClick:
|
|
573
|
+
onClick: z
|
|
574
574
|
}) : null,
|
|
575
|
-
|
|
575
|
+
G ? /* @__PURE__ */ F(fe, {
|
|
576
576
|
containerRef: l,
|
|
577
577
|
audioLanguages: y,
|
|
578
578
|
audioLanguage: b,
|
|
579
|
-
onAudioLanguageChange:
|
|
580
|
-
captionLanguages:
|
|
581
|
-
captionLanguage:
|
|
579
|
+
onAudioLanguageChange: x,
|
|
580
|
+
captionLanguages: C,
|
|
581
|
+
captionLanguage: w,
|
|
582
582
|
captionsOn: f,
|
|
583
|
-
onCaptionLanguageChange:
|
|
584
|
-
onCaptionsOff:
|
|
585
|
-
audioDescriptionLanguages:
|
|
586
|
-
audioDescriptionLanguage:
|
|
583
|
+
onCaptionLanguageChange: re,
|
|
584
|
+
onCaptionsOff: E,
|
|
585
|
+
audioDescriptionLanguages: D,
|
|
586
|
+
audioDescriptionLanguage: O,
|
|
587
587
|
audioDescriptionOn: h,
|
|
588
|
-
onAudioDescriptionLanguageChange:
|
|
589
|
-
onAudioDescriptionOff:
|
|
588
|
+
onAudioDescriptionLanguageChange: k,
|
|
589
|
+
onAudioDescriptionOff: A
|
|
590
590
|
}) : null,
|
|
591
|
-
|
|
591
|
+
V ? /* @__PURE__ */ F(u, {
|
|
592
592
|
variant: "ghost",
|
|
593
593
|
size: "sm",
|
|
594
594
|
hideLabel: !0,
|
|
595
|
-
icon:
|
|
596
|
-
label:
|
|
597
|
-
onClick:
|
|
595
|
+
icon: T,
|
|
596
|
+
label: V.label,
|
|
597
|
+
onClick: V.onClick
|
|
598
598
|
}) : null,
|
|
599
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ F(u, {
|
|
600
600
|
variant: "ghost",
|
|
601
601
|
size: "sm",
|
|
602
602
|
hideLabel: !0,
|
|
603
|
-
icon: o ?
|
|
604
|
-
label:
|
|
605
|
-
onClick:
|
|
603
|
+
icon: o ? S : ee,
|
|
604
|
+
label: H(o ? "videoPlayer.exitFullscreen" : "videoPlayer.enterFullscreen"),
|
|
605
|
+
onClick: L
|
|
606
606
|
})
|
|
607
607
|
]
|
|
608
608
|
});
|
|
@@ -611,8 +611,8 @@ function _e({ isPlaying: e, currentTime: t, duration: n, volume: r, isMuted: i,
|
|
|
611
611
|
//#region src/blocks/F0VideoPlayer/hooks/useVttSource.ts
|
|
612
612
|
var ve = (e) => e.trimStart().startsWith("WEBVTT");
|
|
613
613
|
function ye(e) {
|
|
614
|
-
let t = e !== void 0 && ve(e), [n, r] =
|
|
615
|
-
return
|
|
614
|
+
let t = e !== void 0 && ve(e), [n, r] = P();
|
|
615
|
+
return A(() => {
|
|
616
616
|
if (e === void 0 || !ve(e)) {
|
|
617
617
|
r(void 0);
|
|
618
618
|
return;
|
|
@@ -628,8 +628,8 @@ function ye(e) {
|
|
|
628
628
|
//#region src/blocks/F0VideoPlayer/hooks/useAudioDescription.ts
|
|
629
629
|
var be = "descriptions";
|
|
630
630
|
function xe(e, { enabled: t, describedSrc: n, descriptions: r }) {
|
|
631
|
-
let i = n !== void 0, { trackSrc: a, needsCrossOrigin: o } = ye(r), [s, c] =
|
|
632
|
-
return
|
|
631
|
+
let i = n !== void 0, { trackSrc: a, needsCrossOrigin: o } = ye(r), [s, c] = P(!1), l = i || r !== void 0 || s, [u, d] = P(), f = N(!1);
|
|
632
|
+
return A(() => {
|
|
633
633
|
if (!e) return;
|
|
634
634
|
let n = e.textTracks, a = typeof window < "u" && "speechSynthesis" in window, o = t && !i && a, s = () => {
|
|
635
635
|
f.current && (f.current = !1, e.play().catch(() => {}));
|
|
@@ -661,7 +661,7 @@ function xe(e, { enabled: t, describedSrc: n, descriptions: r }) {
|
|
|
661
661
|
i,
|
|
662
662
|
r,
|
|
663
663
|
a
|
|
664
|
-
]),
|
|
664
|
+
]), M(() => ({
|
|
665
665
|
trackSrc: a,
|
|
666
666
|
needsCrossOrigin: o,
|
|
667
667
|
available: l,
|
|
@@ -676,7 +676,7 @@ function xe(e, { enabled: t, describedSrc: n, descriptions: r }) {
|
|
|
676
676
|
//#endregion
|
|
677
677
|
//#region src/blocks/F0VideoPlayer/hooks/useKeyboardShortcuts.ts
|
|
678
678
|
function Se({ videoRef: e, seek: t, togglePlay: n, toggleMute: r, toggleFullscreen: i, setVolume: a }) {
|
|
679
|
-
return
|
|
679
|
+
return k((o) => {
|
|
680
680
|
let s = o.target;
|
|
681
681
|
if (s instanceof HTMLElement && (s.closest("button, a, input, textarea, select, [role=\"button\"], [contenteditable=\"true\"]") || s.closest("[role=\"menu\"], [role^=\"menuitem\"]") || s.getAttribute("role") === "slider")) return;
|
|
682
682
|
let c = e.current;
|
|
@@ -694,10 +694,10 @@ function Se({ videoRef: e, seek: t, togglePlay: n, toggleMute: r, toggleFullscre
|
|
|
694
694
|
return;
|
|
695
695
|
}
|
|
696
696
|
case "ArrowUp":
|
|
697
|
-
o.preventDefault(), a(Math.min(1, c.volume +
|
|
697
|
+
o.preventDefault(), a(Math.min(1, c.volume + U));
|
|
698
698
|
return;
|
|
699
699
|
case "ArrowDown":
|
|
700
|
-
o.preventDefault(), a(Math.max(0, c.volume -
|
|
700
|
+
o.preventDefault(), a(Math.max(0, c.volume - U));
|
|
701
701
|
return;
|
|
702
702
|
case "m":
|
|
703
703
|
o.preventDefault(), r();
|
|
@@ -719,12 +719,12 @@ function Se({ videoRef: e, seek: t, togglePlay: n, toggleMute: r, toggleFullscre
|
|
|
719
719
|
//#endregion
|
|
720
720
|
//#region src/blocks/F0VideoPlayer/hooks/useRestrictForwardSeek.ts
|
|
721
721
|
function Ce({ video: e, enabled: t, resetKey: n }) {
|
|
722
|
-
let r =
|
|
722
|
+
let r = N(0), i = N(0), a = N(t);
|
|
723
723
|
a.current = t;
|
|
724
|
-
let [o, s] =
|
|
725
|
-
return
|
|
724
|
+
let [o, s] = P(0);
|
|
725
|
+
return A(() => {
|
|
726
726
|
r.current = 0, i.current = 0, s(0);
|
|
727
|
-
}, [n]),
|
|
727
|
+
}, [n]), A(() => {
|
|
728
728
|
if (!e) return;
|
|
729
729
|
let t = () => {
|
|
730
730
|
a.current && e.currentTime > r.current + .25 && (e.currentTime = r.current);
|
|
@@ -746,17 +746,17 @@ function Ce({ video: e, enabled: t, resetKey: n }) {
|
|
|
746
746
|
};
|
|
747
747
|
}, [e]), {
|
|
748
748
|
maxWatchedTime: o,
|
|
749
|
-
clampSeek:
|
|
749
|
+
clampSeek: k((e) => a.current ? Math.min(e, r.current) : e, [])
|
|
750
750
|
};
|
|
751
751
|
}
|
|
752
752
|
//#endregion
|
|
753
753
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoCaptions.ts
|
|
754
754
|
var we = /* @__PURE__ */ new Set(["captions", "subtitles"]), Te = 2, Ee = 3;
|
|
755
755
|
function De(e, t) {
|
|
756
|
-
let { trackSrc: n, needsCrossOrigin: r } = ye(t), [i, a] =
|
|
757
|
-
return
|
|
756
|
+
let { trackSrc: n, needsCrossOrigin: r } = ye(t), [i, a] = P(!1), [o, s] = P(!1), [c, l] = P(!1), u = o || t !== void 0 && !c;
|
|
757
|
+
return A(() => {
|
|
758
758
|
l(!1), s(!1);
|
|
759
|
-
}, [n]),
|
|
759
|
+
}, [n]), A(() => {
|
|
760
760
|
if (!e) return;
|
|
761
761
|
let t = e.textTracks, n = e.querySelector("track[kind=\"captions\"]"), r = () => {
|
|
762
762
|
let e = !1;
|
|
@@ -791,7 +791,7 @@ function De(e, t) {
|
|
|
791
791
|
t,
|
|
792
792
|
i,
|
|
793
793
|
n
|
|
794
|
-
]),
|
|
794
|
+
]), M(() => ({
|
|
795
795
|
trackSrc: n,
|
|
796
796
|
needsCrossOrigin: r,
|
|
797
797
|
available: u,
|
|
@@ -807,15 +807,15 @@ function De(e, t) {
|
|
|
807
807
|
//#endregion
|
|
808
808
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoCompletion.ts
|
|
809
809
|
function Oe(e) {
|
|
810
|
-
return e - Math.min(10, e *
|
|
810
|
+
return e - Math.min(10, e * K);
|
|
811
811
|
}
|
|
812
812
|
function ke({ video: e, onComplete: t, resetKey: n }) {
|
|
813
|
-
let r =
|
|
813
|
+
let r = N(t);
|
|
814
814
|
r.current = t;
|
|
815
|
-
let i =
|
|
816
|
-
|
|
815
|
+
let i = N(!1), a = !!t;
|
|
816
|
+
A(() => {
|
|
817
817
|
i.current = !1;
|
|
818
|
-
}, [n]),
|
|
818
|
+
}, [n]), A(() => {
|
|
819
819
|
if (!e || !a) return;
|
|
820
820
|
let t = () => {
|
|
821
821
|
!i.current && e.duration && e.currentTime >= Oe(e.duration) && (i.current = !0, r.current?.(e));
|
|
@@ -828,17 +828,17 @@ function ke({ video: e, onComplete: t, resetKey: n }) {
|
|
|
828
828
|
//#endregion
|
|
829
829
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoMilestones.ts
|
|
830
830
|
function Ae({ video: e, onMilestone: t, resetKey: n }) {
|
|
831
|
-
let r =
|
|
831
|
+
let r = N(t);
|
|
832
832
|
r.current = t;
|
|
833
|
-
let i =
|
|
834
|
-
|
|
833
|
+
let i = N(/* @__PURE__ */ new Set()), a = !!t;
|
|
834
|
+
A(() => {
|
|
835
835
|
i.current.clear();
|
|
836
|
-
}, [n]),
|
|
836
|
+
}, [n]), A(() => {
|
|
837
837
|
if (!e || !a) return;
|
|
838
838
|
let t = () => {
|
|
839
839
|
if (!e.duration) return;
|
|
840
840
|
let t = Math.round(e.currentTime / e.duration * 100);
|
|
841
|
-
for (let n of
|
|
841
|
+
for (let n of W) i.current.has(n) || t >= n && (i.current.add(n), r.current?.(n, e));
|
|
842
842
|
};
|
|
843
843
|
return e.addEventListener("timeupdate", t), () => {
|
|
844
844
|
e.removeEventListener("timeupdate", t);
|
|
@@ -848,18 +848,18 @@ function Ae({ video: e, onMilestone: t, resetKey: n }) {
|
|
|
848
848
|
//#endregion
|
|
849
849
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoState.ts
|
|
850
850
|
function je(e) {
|
|
851
|
-
let t =
|
|
851
|
+
let t = N(null), [n, r] = P(null), i = N(0), a = k((e) => {
|
|
852
852
|
t.current = e, r(e);
|
|
853
|
-
}, []), [o, s] =
|
|
854
|
-
return
|
|
853
|
+
}, []), [o, s] = P(!1), [c, l] = P(!1), [u, d] = P(0), [f, p] = P(0), [m, h] = P(1), [g, _] = P(!1), [v, y] = P(1);
|
|
854
|
+
return A(() => {
|
|
855
855
|
i.current = 0, t.current && (t.current.playbackRate = 1), s(!1), l(!1), d(0), p(0), y(1);
|
|
856
|
-
}, [e]),
|
|
856
|
+
}, [e]), A(() => {
|
|
857
857
|
let e = n;
|
|
858
858
|
if (!e) return;
|
|
859
859
|
let t = () => l(!0), r = () => l(!1), a = () => l(!1), o = () => {
|
|
860
860
|
h(e.volume), _(e.muted);
|
|
861
861
|
}, s = () => p(e.duration || 0), c = () => {
|
|
862
|
-
|
|
862
|
+
Y(e.playbackRate) && y(e.playbackRate);
|
|
863
863
|
}, u = () => {
|
|
864
864
|
let t = performance.now();
|
|
865
865
|
t - i.current >= 250 && (i.current = t, d(e.currentTime));
|
|
@@ -879,25 +879,25 @@ function je(e) {
|
|
|
879
879
|
isMuted: g,
|
|
880
880
|
playbackRate: v,
|
|
881
881
|
setVideoLoaded: s,
|
|
882
|
-
togglePlay:
|
|
882
|
+
togglePlay: k(() => {
|
|
883
883
|
let e = t.current;
|
|
884
884
|
e && (e.paused || e.ended ? e.play().catch(() => {}) : e.pause());
|
|
885
885
|
}, []),
|
|
886
|
-
toggleMute:
|
|
886
|
+
toggleMute: k(() => {
|
|
887
887
|
let e = t.current;
|
|
888
888
|
e && (e.muted = !e.muted);
|
|
889
889
|
}, []),
|
|
890
|
-
setVolume:
|
|
890
|
+
setVolume: k((e) => {
|
|
891
891
|
let n = t.current;
|
|
892
892
|
if (!n) return;
|
|
893
893
|
let r = Math.max(0, Math.min(1, e));
|
|
894
894
|
n.volume = r, n.muted = r === 0;
|
|
895
895
|
}, []),
|
|
896
|
-
setPlaybackRate:
|
|
896
|
+
setPlaybackRate: k((e) => {
|
|
897
897
|
let n = t.current;
|
|
898
898
|
n && (n.playbackRate = e);
|
|
899
899
|
}, []),
|
|
900
|
-
seekTo:
|
|
900
|
+
seekTo: k((e) => {
|
|
901
901
|
let n = t.current;
|
|
902
902
|
if (!n) return;
|
|
903
903
|
let r = Math.max(0, Math.min(e, n.duration || e));
|
|
@@ -908,17 +908,17 @@ function je(e) {
|
|
|
908
908
|
//#endregion
|
|
909
909
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoTracking.ts
|
|
910
910
|
function Me({ video: e, onTrackAction: t }) {
|
|
911
|
-
let n =
|
|
911
|
+
let n = N(t);
|
|
912
912
|
n.current = t;
|
|
913
913
|
let r = !!t;
|
|
914
|
-
|
|
914
|
+
A(() => {
|
|
915
915
|
if (!e || !r) return;
|
|
916
916
|
let t = null, i = () => {
|
|
917
917
|
t &&= (clearInterval(t), null);
|
|
918
918
|
}, a = () => {
|
|
919
919
|
n.current?.(), i(), t = setInterval(() => {
|
|
920
920
|
n.current?.();
|
|
921
|
-
},
|
|
921
|
+
}, G);
|
|
922
922
|
}, o = () => {
|
|
923
923
|
n.current?.(), i();
|
|
924
924
|
}, s = () => i();
|
|
@@ -930,176 +930,176 @@ function Me({ video: e, onTrackAction: t }) {
|
|
|
930
930
|
//#endregion
|
|
931
931
|
//#region src/blocks/F0VideoPlayer/internal.tsx
|
|
932
932
|
function Ne({ src: e, poster: t, ariaLabel: n, silent: r = !1, persistControls: i = !1, content: a, defaultLanguage: o, autoPlay: s = !1, autoFocus: c = !1, download: l, restrictForwardSeek: u = !1, onTrackAction: d, onMilestone: p, onComplete: h, ...g }) {
|
|
933
|
-
let { t: _ } = m(), b =
|
|
934
|
-
enabled:
|
|
935
|
-
describedSrc:
|
|
936
|
-
descriptions:
|
|
937
|
-
}),
|
|
938
|
-
let e =
|
|
933
|
+
let { t: _ } = m(), b = N(null), x = M(() => z(e), [e]), [S, C] = P(() => V(x, o)), ee = x.some((e) => e.locale === S) ? S : V(x, o), w = R(e, ee) ?? "", T = M(() => z(a?.captions), [a?.captions]), [ne, re] = P(() => V(T, o)), E = T.some((e) => e.locale === ne) ? ne : V(T, o), O = R(a?.captions, E), j = M(() => z(a?.descriptions, a?.describedSrc), [a?.descriptions, a?.describedSrc]), [L, B] = P(() => V(j, o)), H = j.some((e) => e.locale === L) ? L : V(j, o), U = R(a?.descriptions, H), W = R(a?.describedSrc, H), [G, K] = P(!1), q = G && W ? W : w, J = je(q), Y = De(J.videoElement, O), X = xe(J.videoElement, {
|
|
934
|
+
enabled: G,
|
|
935
|
+
describedSrc: W,
|
|
936
|
+
descriptions: U
|
|
937
|
+
}), Z = k(() => {
|
|
938
|
+
let e = J.videoRef.current;
|
|
939
939
|
if (!e) return;
|
|
940
940
|
let t = e.currentTime, n = !e.paused, r = () => {
|
|
941
941
|
e.currentTime = t, n && e.play().catch(() => {}), e.removeEventListener("loadedmetadata", r);
|
|
942
942
|
};
|
|
943
943
|
e.addEventListener("loadedmetadata", r);
|
|
944
|
-
}, [
|
|
945
|
-
|
|
946
|
-
}, [
|
|
947
|
-
|
|
948
|
-
}, [
|
|
949
|
-
|
|
950
|
-
}, [
|
|
951
|
-
|
|
952
|
-
}, [
|
|
953
|
-
|
|
954
|
-
}, [
|
|
955
|
-
|
|
956
|
-
}, [
|
|
944
|
+
}, [J.videoRef]), ie = k((e) => {
|
|
945
|
+
Z(), C(e);
|
|
946
|
+
}, [Z]), Q = k(() => {
|
|
947
|
+
W && Z(), K((e) => !e);
|
|
948
|
+
}, [W, Z]), ae = k((e) => {
|
|
949
|
+
re(e), Y.showing || Y.toggle();
|
|
950
|
+
}, [Y]), oe = k(() => {
|
|
951
|
+
Y.showing && Y.toggle();
|
|
952
|
+
}, [Y]), se = k((e) => {
|
|
953
|
+
W && Z(), B(e), K(!0);
|
|
954
|
+
}, [W, Z]), $ = k(() => {
|
|
955
|
+
W && Z(), K(!1);
|
|
956
|
+
}, [W, Z]);
|
|
957
957
|
Me({
|
|
958
|
-
video:
|
|
958
|
+
video: J.videoElement,
|
|
959
959
|
onTrackAction: d
|
|
960
960
|
}), Ae({
|
|
961
|
-
video:
|
|
961
|
+
video: J.videoElement,
|
|
962
962
|
onMilestone: p,
|
|
963
|
-
resetKey:
|
|
963
|
+
resetKey: w
|
|
964
964
|
}), ke({
|
|
965
|
-
video:
|
|
965
|
+
video: J.videoElement,
|
|
966
966
|
onComplete: h,
|
|
967
|
-
resetKey:
|
|
967
|
+
resetKey: w
|
|
968
968
|
});
|
|
969
969
|
let { maxWatchedTime: ce, clampSeek: le } = Ce({
|
|
970
|
-
video:
|
|
970
|
+
video: J.videoElement,
|
|
971
971
|
enabled: u,
|
|
972
|
-
resetKey:
|
|
973
|
-
}), ue =
|
|
974
|
-
|
|
975
|
-
let e =
|
|
972
|
+
resetKey: w
|
|
973
|
+
}), ue = k((e) => J.seekTo(le(e)), [J, le]), { isFullscreen: de, toggleFullscreen: fe } = D({ targetRef: b }), pe = k(() => {}, []), me = !!(G && W);
|
|
974
|
+
A(() => {
|
|
975
|
+
let e = J.videoRef.current;
|
|
976
976
|
r && e && (e.muted = !me);
|
|
977
977
|
}, [
|
|
978
978
|
r,
|
|
979
979
|
me,
|
|
980
|
-
|
|
981
|
-
|
|
980
|
+
J.videoElement,
|
|
981
|
+
J.videoRef
|
|
982
982
|
]);
|
|
983
983
|
let he = Se({
|
|
984
|
-
videoRef:
|
|
984
|
+
videoRef: J.videoRef,
|
|
985
985
|
seek: ue,
|
|
986
|
-
togglePlay:
|
|
987
|
-
toggleMute: r ? pe :
|
|
986
|
+
togglePlay: J.togglePlay,
|
|
987
|
+
toggleMute: r ? pe : J.toggleMute,
|
|
988
988
|
toggleFullscreen: fe,
|
|
989
|
-
setVolume: r ? pe :
|
|
989
|
+
setVolume: r ? pe : J.setVolume
|
|
990
990
|
});
|
|
991
|
-
|
|
991
|
+
A(() => {
|
|
992
992
|
c && b.current?.focus({ preventScroll: !0 });
|
|
993
993
|
}, [c]);
|
|
994
994
|
let ge = (e) => e.preventDefault();
|
|
995
|
-
return /* @__PURE__ */
|
|
995
|
+
return /* @__PURE__ */ I("div", {
|
|
996
996
|
ref: b,
|
|
997
997
|
className: v("group relative h-full w-full overflow-hidden rounded-[inherit] bg-f1-foreground dark:bg-f1-background", "[&:fullscreen]:h-screen [&:fullscreen]:w-screen [&:fullscreen]:rounded-none", y()),
|
|
998
998
|
role: "region",
|
|
999
999
|
"aria-label": n ?? _("videoPlayer.regionLabel"),
|
|
1000
1000
|
tabIndex: 0,
|
|
1001
1001
|
onKeyDown: he,
|
|
1002
|
-
"data-video-captions": r ? "no-audio" :
|
|
1002
|
+
"data-video-captions": r ? "no-audio" : Y.available ? "available" : "missing",
|
|
1003
1003
|
...g,
|
|
1004
1004
|
children: [
|
|
1005
|
-
/* @__PURE__ */
|
|
1006
|
-
ref:
|
|
1005
|
+
/* @__PURE__ */ I("video", {
|
|
1006
|
+
ref: J.setVideoNode,
|
|
1007
1007
|
autoPlay: s,
|
|
1008
1008
|
playsInline: !0,
|
|
1009
1009
|
disablePictureInPicture: !0,
|
|
1010
1010
|
disableRemotePlayback: !0,
|
|
1011
1011
|
draggable: !1,
|
|
1012
1012
|
onContextMenu: ge,
|
|
1013
|
-
onClick:
|
|
1014
|
-
src:
|
|
1013
|
+
onClick: J.togglePlay,
|
|
1014
|
+
src: q,
|
|
1015
1015
|
poster: t,
|
|
1016
|
-
crossOrigin:
|
|
1017
|
-
onLoadedData: () =>
|
|
1016
|
+
crossOrigin: Y.needsCrossOrigin || X.needsCrossOrigin ? "anonymous" : void 0,
|
|
1017
|
+
onLoadedData: () => J.setVideoLoaded(!0),
|
|
1018
1018
|
className: v("block h-full w-full cursor-pointer rounded-[inherit] object-contain transition-opacity duration-300", "[&::-webkit-media-text-track-container]:![transform:translateY(-3.5rem)]"),
|
|
1019
|
-
style: { opacity:
|
|
1020
|
-
children: [
|
|
1019
|
+
style: { opacity: J.videoLoaded || t ? 1 : 0 },
|
|
1020
|
+
children: [Y.trackSrc ? /* @__PURE__ */ F("track", {
|
|
1021
1021
|
kind: "captions",
|
|
1022
|
-
src:
|
|
1022
|
+
src: Y.trackSrc,
|
|
1023
1023
|
label: _("videoPlayer.captions"),
|
|
1024
1024
|
default: !1
|
|
1025
|
-
}) : null,
|
|
1025
|
+
}) : null, X.trackSrc ? /* @__PURE__ */ F("track", {
|
|
1026
1026
|
kind: "descriptions",
|
|
1027
|
-
src:
|
|
1027
|
+
src: X.trackSrc,
|
|
1028
1028
|
label: _("videoPlayer.audioDescription"),
|
|
1029
1029
|
default: !1
|
|
1030
1030
|
}) : null]
|
|
1031
1031
|
}),
|
|
1032
|
-
|
|
1032
|
+
J.isPlaying ? null : /* @__PURE__ */ F("div", {
|
|
1033
1033
|
"aria-hidden": !0,
|
|
1034
1034
|
"data-video-play-overlay": !0,
|
|
1035
1035
|
className: "pointer-events-none absolute inset-0 z-[1] flex items-center justify-center",
|
|
1036
|
-
children: /* @__PURE__ */
|
|
1036
|
+
children: /* @__PURE__ */ F("button", {
|
|
1037
1037
|
type: "button",
|
|
1038
1038
|
tabIndex: -1,
|
|
1039
|
-
onClick:
|
|
1039
|
+
onClick: J.togglePlay,
|
|
1040
1040
|
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",
|
|
1041
|
-
children: /* @__PURE__ */
|
|
1042
|
-
icon:
|
|
1041
|
+
children: /* @__PURE__ */ F(f, {
|
|
1042
|
+
icon: te,
|
|
1043
1043
|
size: "lg",
|
|
1044
1044
|
color: "#fff"
|
|
1045
1045
|
})
|
|
1046
1046
|
})
|
|
1047
1047
|
}),
|
|
1048
|
-
|
|
1048
|
+
Y.showing && X.activeCue ? /* @__PURE__ */ F("div", {
|
|
1049
1049
|
"aria-hidden": !0,
|
|
1050
1050
|
className: "dark pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-center p-3",
|
|
1051
|
-
children: /* @__PURE__ */
|
|
1051
|
+
children: /* @__PURE__ */ I("p", {
|
|
1052
1052
|
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)]",
|
|
1053
|
-
children: [/* @__PURE__ */
|
|
1053
|
+
children: [/* @__PURE__ */ I("span", {
|
|
1054
1054
|
className: "pr-1 font-medium not-italic opacity-70",
|
|
1055
1055
|
children: [
|
|
1056
1056
|
"[",
|
|
1057
1057
|
_("videoPlayer.audioDescription"),
|
|
1058
1058
|
"]"
|
|
1059
1059
|
]
|
|
1060
|
-
}),
|
|
1060
|
+
}), X.activeCue]
|
|
1061
1061
|
})
|
|
1062
1062
|
}) : null,
|
|
1063
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ F("span", {
|
|
1064
1064
|
className: "sr-only",
|
|
1065
1065
|
"aria-live": "polite",
|
|
1066
|
-
children:
|
|
1066
|
+
children: J.isPlaying ? _("videoPlayer.playing") : _("videoPlayer.paused")
|
|
1067
1067
|
}),
|
|
1068
|
-
|
|
1069
|
-
isPlaying:
|
|
1070
|
-
currentTime:
|
|
1071
|
-
duration:
|
|
1072
|
-
volume:
|
|
1073
|
-
isMuted:
|
|
1074
|
-
playbackRate:
|
|
1068
|
+
J.videoLoaded ? /* @__PURE__ */ F(_e, {
|
|
1069
|
+
isPlaying: J.isPlaying,
|
|
1070
|
+
currentTime: J.currentTime,
|
|
1071
|
+
duration: J.duration,
|
|
1072
|
+
volume: J.volume,
|
|
1073
|
+
isMuted: J.isMuted,
|
|
1074
|
+
playbackRate: J.playbackRate,
|
|
1075
1075
|
isFullscreen: de,
|
|
1076
1076
|
markerTime: u ? ce : void 0,
|
|
1077
1077
|
blockSeekPastMarker: u,
|
|
1078
1078
|
containerRef: b,
|
|
1079
|
-
captionsAvailable:
|
|
1080
|
-
captionsOn:
|
|
1081
|
-
audioDescriptionAvailable:
|
|
1082
|
-
audioDescriptionOn:
|
|
1079
|
+
captionsAvailable: Y.available,
|
|
1080
|
+
captionsOn: Y.showing,
|
|
1081
|
+
audioDescriptionAvailable: X.available,
|
|
1082
|
+
audioDescriptionOn: G,
|
|
1083
1083
|
silent: r,
|
|
1084
1084
|
persist: i,
|
|
1085
1085
|
audioLanguages: x,
|
|
1086
|
-
audioLanguage:
|
|
1087
|
-
onAudioLanguageChange:
|
|
1088
|
-
captionLanguages:
|
|
1089
|
-
captionLanguage:
|
|
1090
|
-
onCaptionLanguageChange:
|
|
1091
|
-
onCaptionsOff:
|
|
1092
|
-
audioDescriptionLanguages:
|
|
1093
|
-
audioDescriptionLanguage:
|
|
1094
|
-
onAudioDescriptionLanguageChange:
|
|
1095
|
-
onAudioDescriptionOff:
|
|
1096
|
-
onTogglePlay:
|
|
1097
|
-
onToggleMute:
|
|
1098
|
-
onVolumeChange:
|
|
1099
|
-
onPlaybackRateChange:
|
|
1086
|
+
audioLanguage: ee,
|
|
1087
|
+
onAudioLanguageChange: ie,
|
|
1088
|
+
captionLanguages: T,
|
|
1089
|
+
captionLanguage: E,
|
|
1090
|
+
onCaptionLanguageChange: ae,
|
|
1091
|
+
onCaptionsOff: oe,
|
|
1092
|
+
audioDescriptionLanguages: j,
|
|
1093
|
+
audioDescriptionLanguage: H,
|
|
1094
|
+
onAudioDescriptionLanguageChange: se,
|
|
1095
|
+
onAudioDescriptionOff: $,
|
|
1096
|
+
onTogglePlay: J.togglePlay,
|
|
1097
|
+
onToggleMute: J.toggleMute,
|
|
1098
|
+
onVolumeChange: J.setVolume,
|
|
1099
|
+
onPlaybackRateChange: J.setPlaybackRate,
|
|
1100
1100
|
onToggleFullscreen: () => void fe(),
|
|
1101
|
-
onToggleCaptions:
|
|
1102
|
-
onToggleAudioDescription:
|
|
1101
|
+
onToggleCaptions: Y.toggle,
|
|
1102
|
+
onToggleAudioDescription: Q,
|
|
1103
1103
|
onSeek: ue,
|
|
1104
1104
|
download: l
|
|
1105
1105
|
}) : null
|
|
@@ -1110,4 +1110,4 @@ function Ne({ src: e, poster: t, ariaLabel: n, silent: r = !1, persistControls:
|
|
|
1110
1110
|
//#region src/blocks/F0VideoPlayer/F0VideoPlayer.tsx
|
|
1111
1111
|
var Pe = l(h("F0VideoPlayer", Ne));
|
|
1112
1112
|
//#endregion
|
|
1113
|
-
export {
|
|
1113
|
+
export { R as a, B as i, z as n, V as r, Pe as t };
|