@weing-dev/ui-kit-primitive 0.3.1 → 0.4.1

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.
Files changed (63) hide show
  1. package/dist/Divider-m-B4TrPH.js +29 -0
  2. package/dist/Divider.css +1 -0
  3. package/dist/Icon-DExqF865.js +1166 -0
  4. package/dist/bind-D3ZJ5k4I.js +47 -0
  5. package/dist/calendar.css +1 -0
  6. package/dist/calendar.d.ts +10 -0
  7. package/dist/calendar.js +4075 -0
  8. package/dist/chart.d.ts +2 -0
  9. package/dist/chart.js +94 -0
  10. package/dist/color-B71xRiyK.js +384 -0
  11. package/dist/compiler-runtime-BFrE5JtX.js +326 -0
  12. package/dist/components/Form/Dropdown/Dropdown.d.ts +2 -1
  13. package/dist/components/LNB/LNB.context.d.ts +14 -14
  14. package/dist/components/LNB/LNB.d.ts +8 -6
  15. package/dist/components/LNB/makeNavigation.d.ts +11 -6
  16. package/dist/display.css +1 -0
  17. package/dist/display.d.ts +15 -0
  18. package/dist/display.js +5280 -0
  19. package/dist/editor-style.css +7 -0
  20. package/dist/editor-style.d.ts +0 -0
  21. package/dist/editor-style.js +1 -0
  22. package/dist/editor.css +1 -0
  23. package/dist/editor.d.ts +5 -0
  24. package/dist/editor.js +338 -0
  25. package/dist/entry/calendar.d.ts +10 -0
  26. package/dist/entry/chart.d.ts +2 -0
  27. package/dist/entry/display.d.ts +15 -0
  28. package/dist/entry/editor-style.d.ts +0 -0
  29. package/dist/entry/editor.d.ts +5 -0
  30. package/dist/entry/feedback.d.ts +6 -0
  31. package/dist/entry/form.d.ts +17 -0
  32. package/dist/entry/icon.d.ts +5 -0
  33. package/dist/entry/navigation.d.ts +9 -0
  34. package/dist/entry/table.d.ts +3 -0
  35. package/dist/entry/types.d.ts +1 -1
  36. package/dist/entry/video-player-style.d.ts +0 -0
  37. package/dist/entry/video-player.d.ts +3 -0
  38. package/dist/feedback.css +1 -0
  39. package/dist/feedback.d.ts +6 -0
  40. package/dist/feedback.js +385 -0
  41. package/dist/form.css +1 -0
  42. package/dist/form.d.ts +17 -0
  43. package/dist/form.js +3548 -0
  44. package/dist/icon.d.ts +5 -0
  45. package/dist/icon.js +18 -0
  46. package/dist/index.css +1 -7
  47. package/dist/index.js +3947 -3931
  48. package/dist/index.umd.cjs +26 -26
  49. package/dist/navigation.css +1 -0
  50. package/dist/navigation.d.ts +9 -0
  51. package/dist/navigation.js +1036 -0
  52. package/dist/table.css +1 -0
  53. package/dist/table.d.ts +3 -0
  54. package/dist/table.js +184 -0
  55. package/dist/usePopper-DvYrGFkh.js +1038 -0
  56. package/dist/video-player-style.css +1 -0
  57. package/dist/video-player-style.d.ts +0 -0
  58. package/dist/video-player-style.js +1 -0
  59. package/dist/video-player.css +1 -0
  60. package/dist/video-player.d.ts +3 -0
  61. package/dist/video-player.js +1751 -0
  62. package/package.json +44 -2
  63. package/dist/components/GlobalStyle/GlobalStyle.d.ts +0 -2
@@ -0,0 +1,1751 @@
1
+ import { c as B, j as p } from "./compiler-runtime-BFrE5JtX.js";
2
+ import _ from "react";
3
+ import { c as Q } from "./bind-D3ZJ5k4I.js";
4
+ import { useStore as We, create as Ke } from "zustand";
5
+ import Je from "video.js";
6
+ import { a as Ge } from "./Icon-DExqF865.js";
7
+ const ke = (t) => Symbol.iterator in t, xe = (t) => (
8
+ // HACK: avoid checking entries type
9
+ "entries" in t
10
+ ), we = (t, e) => {
11
+ const n = t instanceof Map ? t : new Map(t.entries()), s = e instanceof Map ? e : new Map(e.entries());
12
+ if (n.size !== s.size)
13
+ return !1;
14
+ for (const [r, l] of n)
15
+ if (!Object.is(l, s.get(r)))
16
+ return !1;
17
+ return !0;
18
+ }, Xe = (t, e) => {
19
+ const n = t[Symbol.iterator](), s = e[Symbol.iterator]();
20
+ let r = n.next(), l = s.next();
21
+ for (; !r.done && !l.done; ) {
22
+ if (!Object.is(r.value, l.value))
23
+ return !1;
24
+ r = n.next(), l = s.next();
25
+ }
26
+ return !!r.done && !!l.done;
27
+ };
28
+ function Qe(t, e) {
29
+ return Object.is(t, e) ? !0 : typeof t != "object" || t === null || typeof e != "object" || e === null ? !1 : !ke(t) || !ke(e) ? we(
30
+ { entries: () => Object.entries(t) },
31
+ { entries: () => Object.entries(e) }
32
+ ) : xe(t) && xe(e) ? we(t, e) : Xe(t, e);
33
+ }
34
+ function Le(t) {
35
+ const e = _.useRef();
36
+ return (n) => {
37
+ const s = t(n);
38
+ return Qe(e.current, s) ? e.current : e.current = s;
39
+ };
40
+ }
41
+ const me = _.createContext(void 0), ve = (t) => {
42
+ const e = B.c(14);
43
+ let n, s, r, l, o, c;
44
+ e[0] !== t ? ({
45
+ src: o,
46
+ alt: n,
47
+ width: c,
48
+ height: r,
49
+ className: s,
50
+ ...l
51
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r, e[4] = l, e[5] = o, e[6] = c) : (n = e[1], s = e[2], r = e[3], l = e[4], o = e[5], c = e[6]);
52
+ let d;
53
+ return e[7] !== n || e[8] !== s || e[9] !== r || e[10] !== l || e[11] !== o || e[12] !== c ? (d = /* @__PURE__ */ p.jsx("img", { src: o, alt: n, width: c, height: r, className: s, ...l }), e[7] = n, e[8] = s, e[9] = r, e[10] = l, e[11] = o, e[12] = c, e[13] = d) : d = e[13], d;
54
+ }, Te = _.createContext(ve), Ne = () => _.use(Te), Ie = (t) => {
55
+ const e = _.use(me);
56
+ if (!e)
57
+ throw new Error("useVideoPlayerStore는 VideoPlayerProvider 내부에서만 사용해야 합니다.");
58
+ return We(e, t);
59
+ };
60
+ function Y(t) {
61
+ const e = B.c(3), n = typeof t == "function", s = Le(n ? t : Ye);
62
+ let r;
63
+ e[0] !== t || e[1] !== n ? (r = (c) => n ? {} : Object.fromEntries(t.map((d) => [d, c[d]])), e[0] = t, e[1] = n, e[2] = r) : r = e[2];
64
+ const l = Le(r);
65
+ return Ie(n ? s : l);
66
+ }
67
+ function Ye() {
68
+ return {};
69
+ }
70
+ const F = {
71
+ layout: {
72
+ width: "100%",
73
+ height: "400px",
74
+ maxWidth: "1200px"
75
+ },
76
+ overlay: {
77
+ autoHide: !0,
78
+ autoHideDelayMs: 1e3
79
+ },
80
+ volume: {
81
+ persist: !0,
82
+ storageKey: "videoPlayerVolume",
83
+ fallback: 1
84
+ },
85
+ speed: {
86
+ options: [0.5, 0.75, 1, 1.25, 1.5, 2],
87
+ defaultRate: 1
88
+ },
89
+ texts: {
90
+ loading: "비디오를 로딩 중입니다...",
91
+ errorTitle: "비디오를 재생할 수 없습니다",
92
+ errorDescription: "비디오 파일을 확인해주세요.",
93
+ errorRetry: "다시 시도"
94
+ },
95
+ aria: {
96
+ progress: "비디오 진행률",
97
+ play: "재생",
98
+ pause: "일시정지",
99
+ fullscreenEnter: "전체화면",
100
+ fullscreenExit: "전체화면 종료",
101
+ pictureInPictureEnter: "Picture-in-Picture",
102
+ pictureInPictureExit: "Picture-in-Picture 종료",
103
+ speed: "재생 속도 조절",
104
+ mute: "음소거",
105
+ unmute: "음소거 해제",
106
+ captionOn: "자막 켜기",
107
+ captionOff: "자막 끄기",
108
+ back: "뒤로가기",
109
+ share: "공유"
110
+ },
111
+ icons: {
112
+ play: "Play",
113
+ pause: "Pause",
114
+ back: "BackButton",
115
+ share: "Share",
116
+ volumeOn: "VolumeUp",
117
+ volumeOff: "VolumeOff",
118
+ caption: "SubtitleFilled",
119
+ fullscreenEnter: "FullScreen",
120
+ fullscreenExit: "FullScreenClose",
121
+ pictureInPictureEnter: "Pip",
122
+ pictureInPictureExit: "PipExit"
123
+ }
124
+ }, Oe = (t) => {
125
+ const e = t.tech();
126
+ if (!e) return null;
127
+ const n = e.el();
128
+ return n instanceof HTMLVideoElement ? n : null;
129
+ }, Ve = (t) => {
130
+ const e = t.trim(), n = e.lastIndexOf("."), s = n >= 0 ? e.slice(0, n) : e, l = (n >= 0 ? e.slice(n + 1) : "0").padEnd(3, "0").slice(0, 3), o = Number.parseInt(l, 10);
131
+ if (Number.isNaN(o)) return null;
132
+ const c = s.split(":").map((d) => Number.parseInt(d.trim(), 10));
133
+ if (c.some((d) => Number.isNaN(d))) return null;
134
+ if (c.length === 3) {
135
+ const [d, f, u] = c;
136
+ return d === void 0 || f === void 0 || u === void 0 ? null : d * 3600 + f * 60 + u + o / 1e3;
137
+ }
138
+ if (c.length === 2) {
139
+ const [d, f] = c;
140
+ return d === void 0 || f === void 0 ? null : d * 60 + f + o / 1e3;
141
+ }
142
+ return null;
143
+ }, Ze = (t) => {
144
+ const e = t.indexOf("-->");
145
+ if (e < 0) return null;
146
+ const n = t.slice(0, e).trim(), s = t.slice(e + 3).trim(), r = n.split(/\s+/)[0], l = s.split(/\s+/)[0];
147
+ if (r === void 0 || l === void 0) return null;
148
+ const o = Ve(r), c = Ve(l);
149
+ return o === null || c === null ? null : {
150
+ start: o,
151
+ end: c
152
+ };
153
+ }, ze = (t) => {
154
+ const n = t.replace(/\r\n/g, `
155
+ `).replace(/\r/g, `
156
+ `).split(/\n{2,}/), s = [];
157
+ for (const r of n) {
158
+ const l = r.split(`
159
+ `).map((i) => i.trimEnd()).filter((i) => i.trim() !== "");
160
+ if (l.length === 0) continue;
161
+ let o = 0;
162
+ const c = l[0];
163
+ c !== void 0 && !c.includes("-->") && (o = 1);
164
+ const d = l[o];
165
+ if (d === void 0 || !d.includes("-->")) continue;
166
+ const f = Ze(d);
167
+ if (!f) continue;
168
+ const h = l.slice(o + 1).join(`
169
+ `).trim();
170
+ h !== "" && s.push({
171
+ start: f.start,
172
+ end: f.end,
173
+ text: h
174
+ });
175
+ }
176
+ return s;
177
+ }, Ee = (t) => {
178
+ const e = (c) => c.replace(/\r\n/g, `
179
+ `).replace(/\r/g, `
180
+ `), n = (c) => c.trim().replace(/,/g, "."), s = (c) => {
181
+ const [d, ...f] = c.split("-->");
182
+ if (!d || f.length === 0)
183
+ return c.trim();
184
+ const u = f.join("-->").trim(), [h, ...i] = u.split(/\s+/), a = n(d), m = n(h ?? ""), y = i.length > 0 ? ` ${i.join(" ")}` : "";
185
+ return `${a} --> ${m}${y}`;
186
+ }, r = e(t).trim();
187
+ if (r === "")
188
+ return "WEBVTT";
189
+ const l = r.split(/\n{2,}/), o = ["WEBVTT", ""];
190
+ return l.forEach((c) => {
191
+ const d = c.split(`
192
+ `).map((V) => V.trimEnd()).filter((V) => V.trim() !== "");
193
+ if (d.length === 0)
194
+ return;
195
+ const [f, u, ...h] = d, i = f.includes("-->"), a = (u == null ? void 0 : u.includes("-->")) ?? !1, m = !i && a, y = m ? u ?? "" : f;
196
+ if (!y.includes("-->")) {
197
+ d.forEach((V) => o.push(V)), o.push("");
198
+ return;
199
+ }
200
+ const b = m ? f : null, v = m ? h : [u, ...h].filter((V) => V !== void 0);
201
+ b !== null && o.push(b), o.push(s(y)), v.forEach((V) => {
202
+ o.push(V);
203
+ }), o.push("");
204
+ }), o.join(`
205
+ `);
206
+ }, $e = (t) => t.trim().toLowerCase().endsWith(".srt"), et = (t) => {
207
+ const e = Ee(t), n = new Blob([e], {
208
+ type: "text/vtt"
209
+ });
210
+ return URL.createObjectURL(n);
211
+ }, tt = (t, e) => {
212
+ if (t === e) return !0;
213
+ if (t == null || e == null) return t === e;
214
+ if (t.length !== e.length) return !1;
215
+ for (let n = 0; n < t.length; n++) {
216
+ const s = t[n], r = e[n];
217
+ if (s === void 0 || r === void 0 || s.src !== r.src || s.type !== r.type) return !1;
218
+ }
219
+ return !0;
220
+ }, Me = (t, e) => e.src !== void 0 && e.src !== t.src ? !0 : e.sources !== void 0 ? !tt(e.sources, t.sources) : !1, Se = (t) => Math.max(0, Math.min(1, t)), nt = (t, e) => {
221
+ if (typeof window > "u") return e;
222
+ const n = window.localStorage.getItem(t);
223
+ if (!n) return e;
224
+ const s = parseFloat(n);
225
+ return Number.isNaN(s) ? e : Se(s);
226
+ }, rt = (t, e) => {
227
+ typeof window > "u" || window.localStorage.setItem(t, e.toString());
228
+ }, je = (t) => ({
229
+ autoHide: t.autoHide,
230
+ isPlaying: t.isPlaying,
231
+ overlayAutoHideSuspended: t.overlayAutoHideSuspended,
232
+ overlayControlsVisible: t.overlayControlsVisible,
233
+ autoHideDelayMs: t.autoHideDelayMs
234
+ }), st = (t, e) => t.autoHide === e.autoHide && t.isPlaying === e.isPlaying && t.overlayAutoHideSuspended === e.overlayAutoHideSuspended && t.overlayControlsVisible === e.overlayControlsVisible && t.autoHideDelayMs === e.autoHideDelayMs, De = (t) => ({
235
+ volumePersist: (t == null ? void 0 : t.volumePersist) ?? F.volume.persist,
236
+ volumeStorageKey: (t == null ? void 0 : t.volumeStorageKey) ?? F.volume.storageKey,
237
+ volumeFallback: (t == null ? void 0 : t.volumeFallback) ?? F.volume.fallback,
238
+ playbackRateDefault: (t == null ? void 0 : t.playbackRateDefault) ?? F.speed.defaultRate
239
+ }), Ae = (t, e) => {
240
+ const n = De(t), s = nt(n.volumeStorageKey, n.volumeFallback), r = {
241
+ // 플레이어 상태
242
+ isLoading: !0,
243
+ hasError: !1,
244
+ isPlaying: !1,
245
+ currentTime: 0,
246
+ duration: 0,
247
+ buffered: 0,
248
+ volume: s,
249
+ playbackRate: n.playbackRateDefault,
250
+ isFullscreen: !1,
251
+ isPictureInPicture: !1,
252
+ isMuted: s === 0,
253
+ previousVolume: s || n.volumeFallback,
254
+ player: null,
255
+ // 플레이어 설정값
256
+ width: (e == null ? void 0 : e.width) ?? F.layout.width,
257
+ height: (e == null ? void 0 : e.height) ?? F.layout.height,
258
+ src: (e == null ? void 0 : e.src) ?? null,
259
+ sources: (e == null ? void 0 : e.sources) ?? null,
260
+ speedOptions: (e == null ? void 0 : e.speedOptions) ?? [...F.speed.options],
261
+ playerOptions: (e == null ? void 0 : e.playerOptions) ?? null,
262
+ events: (e == null ? void 0 : e.events) ?? null,
263
+ disableVideoJsStyles: (e == null ? void 0 : e.disableVideoJsStyles) ?? !1,
264
+ tracks: (e == null ? void 0 : e.tracks) ?? [],
265
+ activeCaptionLang: (e == null ? void 0 : e.activeCaptionLang) ?? (e == null ? void 0 : e.initialActiveCaptionLang) ?? null,
266
+ onCaptionLangChange: e == null ? void 0 : e.onCaptionLangChange,
267
+ // Overlay 설정값
268
+ autoHide: (e == null ? void 0 : e.autoHide) ?? F.overlay.autoHide,
269
+ autoHideDelayMs: (e == null ? void 0 : e.autoHideDelayMs) ?? F.overlay.autoHideDelayMs,
270
+ overlayClickAction: (e == null ? void 0 : e.overlayClickAction) ?? "toggle-play",
271
+ overlayControlsVisible: !0,
272
+ overlayAutoHideSuspended: !1,
273
+ // 기본 텍스트 설정값
274
+ loadingText: (e == null ? void 0 : e.loadingText) ?? F.texts.loading,
275
+ errorTitle: (e == null ? void 0 : e.errorTitle) ?? F.texts.errorTitle,
276
+ errorDescription: (e == null ? void 0 : e.errorDescription) ?? F.texts.errorDescription,
277
+ errorRetry: (e == null ? void 0 : e.errorRetry) ?? F.texts.errorRetry
278
+ };
279
+ return Ke()((l, o) => {
280
+ let c;
281
+ const d = () => {
282
+ typeof window > "u" || c !== void 0 && (window.clearTimeout(c), c = void 0);
283
+ }, f = () => {
284
+ if (typeof window > "u") return;
285
+ const i = o();
286
+ if (!i.autoHide) {
287
+ d(), i.overlayControlsVisible || l({
288
+ overlayControlsVisible: !0
289
+ });
290
+ return;
291
+ }
292
+ if (!i.isPlaying || i.overlayAutoHideSuspended) {
293
+ d(), i.overlayControlsVisible || l({
294
+ overlayControlsVisible: !0
295
+ });
296
+ return;
297
+ }
298
+ if (!i.overlayControlsVisible) {
299
+ d();
300
+ return;
301
+ }
302
+ d();
303
+ const a = i.autoHideDelayMs;
304
+ c = window.setTimeout(() => {
305
+ l({
306
+ overlayControlsVisible: !1
307
+ }), c = void 0, f();
308
+ }, a);
309
+ }, u = (i) => {
310
+ const a = je(o());
311
+ l(i);
312
+ const m = je(o());
313
+ st(a, m) || f();
314
+ }, h = {
315
+ ...r,
316
+ setState: u,
317
+ notifyOverlayPointerActivity: () => {
318
+ o().overlayControlsVisible || u({
319
+ overlayControlsVisible: !0
320
+ }), f();
321
+ },
322
+ notifyOverlayPointerLeave: () => {
323
+ f();
324
+ },
325
+ clearOverlayAutoHideTimer: () => {
326
+ d();
327
+ },
328
+ setPlayer: (i) => l({
329
+ player: i
330
+ }),
331
+ setVolume: (i) => l((a) => {
332
+ const m = Se(i);
333
+ return n.volumePersist && rt(n.volumeStorageKey, m), {
334
+ volume: m,
335
+ isMuted: m === 0,
336
+ previousVolume: m > 0 ? m : a.previousVolume
337
+ };
338
+ }),
339
+ handlePlayPause: () => {
340
+ const {
341
+ player: i,
342
+ isPlaying: a
343
+ } = o();
344
+ i && (a ? i.pause() : i.play());
345
+ },
346
+ handleSeek: (i) => {
347
+ const {
348
+ player: a
349
+ } = o();
350
+ a && a.currentTime(i);
351
+ },
352
+ handleSeekAndPlay: (i) => {
353
+ const {
354
+ player: a
355
+ } = o();
356
+ a && (a.currentTime(i), a.play());
357
+ },
358
+ handleVolumeChange: (i) => {
359
+ const {
360
+ player: a,
361
+ setVolume: m
362
+ } = o();
363
+ a && a.volume(Se(i)), m(i);
364
+ },
365
+ handleSpeedChange: (i) => {
366
+ const {
367
+ player: a
368
+ } = o();
369
+ a && a.playbackRate(i), o().setState({
370
+ playbackRate: i
371
+ });
372
+ },
373
+ handleFullscreenToggle: () => {
374
+ const {
375
+ player: i
376
+ } = o();
377
+ i && (i.isFullscreen() ? i.exitFullscreen() : i.requestFullscreen());
378
+ },
379
+ handlePictureInPictureToggle: () => {
380
+ if (typeof document > "u" || !document.pictureInPictureEnabled) return;
381
+ const {
382
+ player: i
383
+ } = o();
384
+ if (!i) return;
385
+ const a = Oe(i);
386
+ if (!(!a || a.disablePictureInPicture)) {
387
+ if (document.pictureInPictureElement === a) {
388
+ document.exitPictureInPicture().catch(() => {
389
+ });
390
+ return;
391
+ }
392
+ a.requestPictureInPicture().catch(() => {
393
+ });
394
+ }
395
+ },
396
+ handleMuteToggle: () => {
397
+ const {
398
+ player: i,
399
+ isMuted: a,
400
+ previousVolume: m,
401
+ setVolume: y
402
+ } = o();
403
+ if (!i) return;
404
+ if (a) {
405
+ const v = m || n.volumeFallback;
406
+ i.volume(v), y(v), o().setState({
407
+ isMuted: !1
408
+ });
409
+ return;
410
+ }
411
+ const b = i.volume() ?? n.volumeFallback;
412
+ o().setState({
413
+ previousVolume: b
414
+ }), i.volume(0), y(0), o().setState({
415
+ isMuted: !0
416
+ });
417
+ },
418
+ handleCaptionToggle: () => {
419
+ const {
420
+ activeCaptionLang: i,
421
+ tracks: a,
422
+ setActiveCaptionLang: m
423
+ } = o();
424
+ if (i !== null) {
425
+ m(null);
426
+ return;
427
+ }
428
+ const y = a.find((b) => {
429
+ const v = b.kind ?? "subtitles";
430
+ return !(v === "subtitles" || v === "captions") || !b.srclang ? !1 : b.srclang.trim() !== "";
431
+ });
432
+ m((y == null ? void 0 : y.srclang) ?? null);
433
+ },
434
+ setActiveCaptionLang: (i) => {
435
+ const {
436
+ onCaptionLangChange: a
437
+ } = o();
438
+ l({
439
+ activeCaptionLang: i
440
+ }), a == null || a(i);
441
+ }
442
+ };
443
+ return queueMicrotask(() => {
444
+ typeof window < "u" && f();
445
+ }), h;
446
+ });
447
+ }, Be = (t) => {
448
+ const {
449
+ children: e,
450
+ storeConfig: n,
451
+ width: s,
452
+ height: r,
453
+ src: l,
454
+ sources: o,
455
+ speedOptions: c,
456
+ playerOptions: d,
457
+ events: f,
458
+ disableVideoJsStyles: u,
459
+ tracks: h,
460
+ initialActiveCaptionLang: i,
461
+ activeCaptionLang: a,
462
+ onCaptionLangChange: m,
463
+ autoHide: y,
464
+ autoHideDelayMs: b,
465
+ overlayClickAction: v,
466
+ loadingText: V,
467
+ errorTitle: N,
468
+ errorDescription: w,
469
+ errorRetry: k,
470
+ controllerRef: C
471
+ } = t, x = _.useRef(null);
472
+ x.current || (x.current = Ae(n, {
473
+ width: s,
474
+ height: r,
475
+ src: l,
476
+ sources: o,
477
+ speedOptions: c,
478
+ playerOptions: d,
479
+ events: f,
480
+ disableVideoJsStyles: u,
481
+ tracks: h,
482
+ initialActiveCaptionLang: i,
483
+ activeCaptionLang: a,
484
+ onCaptionLangChange: m,
485
+ autoHide: y,
486
+ autoHideDelayMs: b,
487
+ overlayClickAction: v,
488
+ loadingText: V,
489
+ errorTitle: N,
490
+ errorDescription: w,
491
+ errorRetry: k
492
+ }));
493
+ const L = _.useMemo(() => Object.fromEntries(Object.entries({
494
+ width: s,
495
+ height: r,
496
+ src: l,
497
+ sources: o,
498
+ speedOptions: c,
499
+ playerOptions: d,
500
+ events: f,
501
+ disableVideoJsStyles: u,
502
+ tracks: h,
503
+ activeCaptionLang: a,
504
+ onCaptionLangChange: m,
505
+ autoHide: y,
506
+ autoHideDelayMs: b,
507
+ overlayClickAction: v,
508
+ loadingText: V,
509
+ errorTitle: N,
510
+ errorDescription: w,
511
+ errorRetry: k
512
+ }).filter(([, S]) => S !== void 0)), [s, r, l, o, c, d, f, u, h, a, m, y, b, v, V, N, w, k]);
513
+ return _.useLayoutEffect(() => {
514
+ if (x.current && Object.keys(L).length > 0) {
515
+ const T = x.current.getState(), S = Me({
516
+ src: T.src,
517
+ sources: T.sources
518
+ }, L);
519
+ x.current.getState().setState({
520
+ ...L,
521
+ ...S ? {
522
+ currentTime: 0,
523
+ duration: 0,
524
+ buffered: 0,
525
+ isPlaying: !1,
526
+ hasError: !1,
527
+ isLoading: !0
528
+ } : {}
529
+ });
530
+ }
531
+ }, [L]), _.useEffect(() => {
532
+ if (!C || !x.current) return;
533
+ const T = x.current, S = {
534
+ getPlayer: () => T.getState().player,
535
+ isPlaying: () => T.getState().isPlaying,
536
+ getCurrentTime: () => T.getState().currentTime,
537
+ getDuration: () => T.getState().duration,
538
+ play: () => {
539
+ const j = T.getState().player;
540
+ j && j.play();
541
+ },
542
+ pause: () => {
543
+ const j = T.getState().player;
544
+ j && j.pause();
545
+ },
546
+ togglePlayPause: () => {
547
+ T.getState().handlePlayPause();
548
+ },
549
+ seek: (j) => {
550
+ T.getState().handleSeek(j);
551
+ },
552
+ seekAndPlay: (j) => {
553
+ T.getState().handleSeekAndPlay(j);
554
+ },
555
+ togglePictureInPicture: () => {
556
+ T.getState().handlePictureInPictureToggle();
557
+ },
558
+ toggleFullscreen: () => {
559
+ T.getState().handleFullscreenToggle();
560
+ }
561
+ };
562
+ return C.current = S, () => {
563
+ C.current === S && (C.current = null);
564
+ };
565
+ }, [C]), /* @__PURE__ */ p.jsx(me, { value: x.current, children: e });
566
+ }, lt = "_Overlay_1topf_1", ot = "_fullscreen_1topf_11", it = "_OverlayGrid_1topf_19", at = "_TopLeft_1topf_32", ct = "_TopCenter_1topf_38", ut = "_TopRight_1topf_44", ft = "_MiddleLeft_1topf_50", dt = "_MiddleCenter_1topf_56", mt = "_MiddleRight_1topf_62", yt = "_BottomLeft_1topf_68", gt = "_BottomCenter_1topf_74", ht = "_BottomRight_1topf_80", pt = "_ProgressContainer_1topf_86", _t = "_visible_1topf_98", bt = "_Content_1topf_102", St = "_hidden_1topf_111", vt = {
567
+ Overlay: lt,
568
+ fullscreen: ot,
569
+ OverlayGrid: it,
570
+ TopLeft: at,
571
+ TopCenter: ct,
572
+ TopRight: ut,
573
+ MiddleLeft: ft,
574
+ MiddleCenter: dt,
575
+ MiddleRight: mt,
576
+ BottomLeft: yt,
577
+ BottomCenter: gt,
578
+ BottomRight: ht,
579
+ ProgressContainer: pt,
580
+ visible: _t,
581
+ Content: bt,
582
+ hidden: St
583
+ }, G = Q.bind(vt), Tt = (t) => {
584
+ const e = B.c(13);
585
+ let n, s, r;
586
+ e[0] !== t ? ({
587
+ className: s,
588
+ children: n,
589
+ ...r
590
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r) : (n = e[1], s = e[2], r = e[3]);
591
+ let l;
592
+ e[4] !== s ? (l = G("OverlayGrid", s), e[4] = s, e[5] = l) : l = e[5];
593
+ let o;
594
+ e[6] !== r ? (o = (d) => {
595
+ var f;
596
+ (f = r.onClick) == null || f.call(r, d);
597
+ }, e[6] = r, e[7] = o) : o = e[7];
598
+ let c;
599
+ return e[8] !== n || e[9] !== r || e[10] !== l || e[11] !== o ? (c = /* @__PURE__ */ p.jsx("div", { className: l, ...r, onClick: o, children: n }), e[8] = n, e[9] = r, e[10] = l, e[11] = o, e[12] = c) : c = e[12], c;
600
+ }, Ct = (t) => {
601
+ const e = B.c(10);
602
+ let n, s, r;
603
+ e[0] !== t ? ({
604
+ className: s,
605
+ children: n,
606
+ ...r
607
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r) : (n = e[1], s = e[2], r = e[3]);
608
+ let l;
609
+ e[4] !== s ? (l = G("TopLeft", s), e[4] = s, e[5] = l) : l = e[5];
610
+ let o;
611
+ return e[6] !== n || e[7] !== r || e[8] !== l ? (o = /* @__PURE__ */ p.jsx("div", { className: l, ...r, children: n }), e[6] = n, e[7] = r, e[8] = l, e[9] = o) : o = e[9], o;
612
+ }, kt = (t) => {
613
+ const e = B.c(10);
614
+ let n, s, r;
615
+ e[0] !== t ? ({
616
+ className: s,
617
+ children: n,
618
+ ...r
619
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r) : (n = e[1], s = e[2], r = e[3]);
620
+ let l;
621
+ e[4] !== s ? (l = G("TopCenter", s), e[4] = s, e[5] = l) : l = e[5];
622
+ let o;
623
+ return e[6] !== n || e[7] !== r || e[8] !== l ? (o = /* @__PURE__ */ p.jsx("div", { className: l, ...r, children: n }), e[6] = n, e[7] = r, e[8] = l, e[9] = o) : o = e[9], o;
624
+ }, xt = (t) => {
625
+ const e = B.c(10);
626
+ let n, s, r;
627
+ e[0] !== t ? ({
628
+ className: s,
629
+ children: n,
630
+ ...r
631
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r) : (n = e[1], s = e[2], r = e[3]);
632
+ let l;
633
+ e[4] !== s ? (l = G("TopRight", s), e[4] = s, e[5] = l) : l = e[5];
634
+ let o;
635
+ return e[6] !== n || e[7] !== r || e[8] !== l ? (o = /* @__PURE__ */ p.jsx("div", { className: l, ...r, children: n }), e[6] = n, e[7] = r, e[8] = l, e[9] = o) : o = e[9], o;
636
+ }, wt = (t) => {
637
+ const e = B.c(10);
638
+ let n, s, r;
639
+ e[0] !== t ? ({
640
+ className: s,
641
+ children: n,
642
+ ...r
643
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r) : (n = e[1], s = e[2], r = e[3]);
644
+ let l;
645
+ e[4] !== s ? (l = G("MiddleLeft", s), e[4] = s, e[5] = l) : l = e[5];
646
+ let o;
647
+ return e[6] !== n || e[7] !== r || e[8] !== l ? (o = /* @__PURE__ */ p.jsx("div", { className: l, ...r, children: n }), e[6] = n, e[7] = r, e[8] = l, e[9] = o) : o = e[9], o;
648
+ }, Lt = (t) => {
649
+ const e = B.c(10);
650
+ let n, s, r;
651
+ e[0] !== t ? ({
652
+ className: s,
653
+ children: n,
654
+ ...r
655
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r) : (n = e[1], s = e[2], r = e[3]);
656
+ let l;
657
+ e[4] !== s ? (l = G("MiddleCenter", s), e[4] = s, e[5] = l) : l = e[5];
658
+ let o;
659
+ return e[6] !== n || e[7] !== r || e[8] !== l ? (o = /* @__PURE__ */ p.jsx("div", { className: l, ...r, children: n }), e[6] = n, e[7] = r, e[8] = l, e[9] = o) : o = e[9], o;
660
+ }, Vt = (t) => {
661
+ const e = B.c(10);
662
+ let n, s, r;
663
+ e[0] !== t ? ({
664
+ className: s,
665
+ children: n,
666
+ ...r
667
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r) : (n = e[1], s = e[2], r = e[3]);
668
+ let l;
669
+ e[4] !== s ? (l = G("MiddleRight", s), e[4] = s, e[5] = l) : l = e[5];
670
+ let o;
671
+ return e[6] !== n || e[7] !== r || e[8] !== l ? (o = /* @__PURE__ */ p.jsx("div", { className: l, ...r, children: n }), e[6] = n, e[7] = r, e[8] = l, e[9] = o) : o = e[9], o;
672
+ }, jt = (t) => {
673
+ const e = B.c(10);
674
+ let n, s, r;
675
+ e[0] !== t ? ({
676
+ className: s,
677
+ children: n,
678
+ ...r
679
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r) : (n = e[1], s = e[2], r = e[3]);
680
+ let l;
681
+ e[4] !== s ? (l = G("BottomLeft", s), e[4] = s, e[5] = l) : l = e[5];
682
+ let o;
683
+ return e[6] !== n || e[7] !== r || e[8] !== l ? (o = /* @__PURE__ */ p.jsx("div", { className: l, ...r, children: n }), e[6] = n, e[7] = r, e[8] = l, e[9] = o) : o = e[9], o;
684
+ }, Pt = (t) => {
685
+ const e = B.c(10);
686
+ let n, s, r;
687
+ e[0] !== t ? ({
688
+ className: s,
689
+ children: n,
690
+ ...r
691
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r) : (n = e[1], s = e[2], r = e[3]);
692
+ let l;
693
+ e[4] !== s ? (l = G("BottomCenter", s), e[4] = s, e[5] = l) : l = e[5];
694
+ let o;
695
+ return e[6] !== n || e[7] !== r || e[8] !== l ? (o = /* @__PURE__ */ p.jsx("div", { className: l, ...r, children: n }), e[6] = n, e[7] = r, e[8] = l, e[9] = o) : o = e[9], o;
696
+ }, Rt = (t) => {
697
+ const e = B.c(10);
698
+ let n, s, r;
699
+ e[0] !== t ? ({
700
+ className: s,
701
+ children: n,
702
+ ...r
703
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r) : (n = e[1], s = e[2], r = e[3]);
704
+ let l;
705
+ e[4] !== s ? (l = G("BottomRight", s), e[4] = s, e[5] = l) : l = e[5];
706
+ let o;
707
+ return e[6] !== n || e[7] !== r || e[8] !== l ? (o = /* @__PURE__ */ p.jsx("div", { className: l, ...r, children: n }), e[6] = n, e[7] = r, e[8] = l, e[9] = o) : o = e[9], o;
708
+ }, Nt = (t) => {
709
+ const e = B.c(30), {
710
+ className: n,
711
+ onOverlayClick: s,
712
+ children: r
713
+ } = t, l = n === void 0 ? "" : n, o = _.useContext(me);
714
+ if (!o)
715
+ throw new Error("VideoOverlay는 VideoPlayerProvider 내부에서만 사용해야 합니다.");
716
+ let c;
717
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (c = ["handlePlayPause", "isFullscreen", "isPictureInPicture", "overlayClickAction", "overlayControlsVisible", "notifyOverlayPointerActivity", "notifyOverlayPointerLeave"], e[0] = c) : c = e[0];
718
+ const {
719
+ handlePlayPause: d,
720
+ isFullscreen: f,
721
+ isPictureInPicture: u,
722
+ overlayClickAction: h,
723
+ overlayControlsVisible: i,
724
+ notifyOverlayPointerActivity: a,
725
+ notifyOverlayPointerLeave: m
726
+ } = Y(c);
727
+ let y;
728
+ e[1] !== d || e[2] !== s || e[3] !== h ? (y = (S) => {
729
+ S.target === S.currentTarget && (s && s(), h !== "none" && d());
730
+ }, e[1] = d, e[2] = s, e[3] = h, e[4] = y) : y = e[4];
731
+ const b = y;
732
+ let v;
733
+ e[5] !== l || e[6] !== f ? (v = G("Overlay", {
734
+ fullscreen: f
735
+ }, l), e[5] = l, e[6] = f, e[7] = v) : v = e[7];
736
+ const V = v;
737
+ let N;
738
+ e[8] !== r || e[9] !== b || e[10] !== f || e[11] !== u || e[12] !== a || e[13] !== m || e[14] !== i ? (N = r({
739
+ showControls: i,
740
+ onMouseMove: a,
741
+ onMouseLeave: m,
742
+ onClick: b,
743
+ isFullscreen: f,
744
+ isPictureInPicture: u
745
+ }), e[8] = r, e[9] = b, e[10] = f, e[11] = u, e[12] = a, e[13] = m, e[14] = i, e[15] = N) : N = e[15];
746
+ const w = N;
747
+ let k;
748
+ e[16] !== o ? (k = (S) => {
749
+ S === null && o.getState().clearOverlayAutoHideTimer();
750
+ }, e[16] = o, e[17] = k) : k = e[17];
751
+ const C = !i;
752
+ let x;
753
+ e[18] !== C ? (x = G("Content", {
754
+ hidden: C
755
+ }), e[18] = C, e[19] = x) : x = e[19];
756
+ let L;
757
+ e[20] !== w || e[21] !== x ? (L = /* @__PURE__ */ p.jsx("div", { className: x, children: w }), e[20] = w, e[21] = x, e[22] = L) : L = e[22];
758
+ let T;
759
+ return e[23] !== V || e[24] !== b || e[25] !== a || e[26] !== m || e[27] !== k || e[28] !== L ? (T = /* @__PURE__ */ p.jsx("div", { className: V, onMouseMove: a, onMouseLeave: m, onClick: b, ref: k, role: "presentation", children: L }), e[23] = V, e[24] = b, e[25] = a, e[26] = m, e[27] = k, e[28] = L, e[29] = T) : T = e[29], T;
760
+ }, It = Object.assign(Nt, {
761
+ Grid: Tt,
762
+ TopLeft: Ct,
763
+ TopCenter: kt,
764
+ TopRight: xt,
765
+ MiddleLeft: wt,
766
+ MiddleCenter: Lt,
767
+ MiddleRight: Vt,
768
+ BottomLeft: jt,
769
+ BottomCenter: Pt,
770
+ BottomRight: Rt
771
+ }), Ot = "_Loading_1nfaq_1", Et = "_LoadingSpinner_1nfaq_11", $t = "_spin_1nfaq_1", Mt = "_LoadingText_1nfaq_27", Dt = {
772
+ Loading: Ot,
773
+ LoadingSpinner: Et,
774
+ spin: $t,
775
+ LoadingText: Mt
776
+ }, be = Q.bind(Dt), At = (t) => {
777
+ const e = B.c(13), {
778
+ className: n,
779
+ as: s
780
+ } = t, r = n === void 0 ? "" : n;
781
+ let l;
782
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = ["isLoading", "loadingText"], e[0] = l) : l = e[0];
783
+ const {
784
+ isLoading: o,
785
+ loadingText: c
786
+ } = Y(l);
787
+ if (!o)
788
+ return null;
789
+ const d = c;
790
+ let f, u;
791
+ if (e[1] !== s || e[2] !== r || e[3] !== d) {
792
+ u = Symbol.for("react.early_return_sentinel");
793
+ e:
794
+ if (f = be("Loading", r), s) {
795
+ u = /* @__PURE__ */ p.jsx(p.Fragment, { children: s({
796
+ defaultClassName: f,
797
+ loadingText: d
798
+ }) });
799
+ break e;
800
+ }
801
+ e[1] = s, e[2] = r, e[3] = d, e[4] = f, e[5] = u;
802
+ } else
803
+ f = e[4], u = e[5];
804
+ if (u !== Symbol.for("react.early_return_sentinel"))
805
+ return u;
806
+ let h, i;
807
+ e[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ p.jsx("div", { className: be("LoadingSpinner") }), i = be("LoadingText"), e[6] = h, e[7] = i) : (h = e[6], i = e[7]);
808
+ let a;
809
+ e[8] !== d ? (a = /* @__PURE__ */ p.jsx("div", { className: i, children: d }), e[8] = d, e[9] = a) : a = e[9];
810
+ let m;
811
+ return e[10] !== f || e[11] !== a ? (m = /* @__PURE__ */ p.jsxs("div", { className: f, children: [
812
+ h,
813
+ a
814
+ ] }), e[10] = f, e[11] = a, e[12] = m) : m = e[12], m;
815
+ }, Bt = "_ErrorTitle_1755e_16", Ft = "_ErrorDescription_1755e_22", Ht = "_ErrorActionButton_1755e_28", Ut = {
816
+ Error: "_Error_1755e_1",
817
+ ErrorTitle: Bt,
818
+ ErrorDescription: Ft,
819
+ ErrorActionButton: Ht
820
+ }, ge = Q.bind(Ut), qt = (t) => {
821
+ const e = B.c(26), {
822
+ className: n,
823
+ onRetry: s,
824
+ as: r
825
+ } = t, l = n === void 0 ? "" : n;
826
+ let o;
827
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (o = ["hasError", "errorTitle", "errorDescription", "errorRetry"], e[0] = o) : o = e[0];
828
+ const {
829
+ hasError: c,
830
+ errorTitle: d,
831
+ errorDescription: f,
832
+ errorRetry: u
833
+ } = Y(o);
834
+ if (!c)
835
+ return null;
836
+ const h = d, i = f, a = u;
837
+ let m;
838
+ e[1] !== s ? (m = () => {
839
+ if (s) {
840
+ s();
841
+ return;
842
+ }
843
+ window.location.reload();
844
+ }, e[1] = s, e[2] = m) : m = e[2];
845
+ const y = m;
846
+ let b, v;
847
+ if (e[3] !== r || e[4] !== l || e[5] !== y || e[6] !== i || e[7] !== a || e[8] !== h) {
848
+ v = Symbol.for("react.early_return_sentinel");
849
+ e:
850
+ if (b = ge("Error", l), r) {
851
+ v = /* @__PURE__ */ p.jsx(p.Fragment, { children: r({
852
+ defaultClassName: b,
853
+ errorTitle: h,
854
+ errorDescription: i,
855
+ errorRetry: a,
856
+ onRetry: y
857
+ }) });
858
+ break e;
859
+ }
860
+ e[3] = r, e[4] = l, e[5] = y, e[6] = i, e[7] = a, e[8] = h, e[9] = b, e[10] = v;
861
+ } else
862
+ b = e[9], v = e[10];
863
+ if (v !== Symbol.for("react.early_return_sentinel"))
864
+ return v;
865
+ let V;
866
+ e[11] === Symbol.for("react.memo_cache_sentinel") ? (V = ge("ErrorTitle"), e[11] = V) : V = e[11];
867
+ let N;
868
+ e[12] !== h ? (N = /* @__PURE__ */ p.jsx("h3", { className: V, children: h }), e[12] = h, e[13] = N) : N = e[13];
869
+ let w;
870
+ e[14] === Symbol.for("react.memo_cache_sentinel") ? (w = ge("ErrorDescription"), e[14] = w) : w = e[14];
871
+ let k;
872
+ e[15] !== i ? (k = /* @__PURE__ */ p.jsx("p", { className: w, children: i }), e[15] = i, e[16] = k) : k = e[16];
873
+ let C;
874
+ e[17] === Symbol.for("react.memo_cache_sentinel") ? (C = ge("ErrorActionButton"), e[17] = C) : C = e[17];
875
+ let x;
876
+ e[18] !== y || e[19] !== a ? (x = /* @__PURE__ */ p.jsx("button", { className: C, onClick: y, children: a }), e[18] = y, e[19] = a, e[20] = x) : x = e[20];
877
+ let L;
878
+ return e[21] !== b || e[22] !== N || e[23] !== k || e[24] !== x ? (L = /* @__PURE__ */ p.jsxs("div", { className: b, children: [
879
+ N,
880
+ k,
881
+ x
882
+ ] }), e[21] = b, e[22] = N, e[23] = k, e[24] = x, e[25] = L) : L = e[25], L;
883
+ }, Wt = "_Frame_1y5ek_1", Kt = {
884
+ Frame: Wt,
885
+ "vjs-tech": "_vjs-tech_1y5ek_23",
886
+ "vjs-fullscreen": "_vjs-fullscreen_1y5ek_29",
887
+ "vjs-control-bar": "_vjs-control-bar_1y5ek_43",
888
+ "vjs-big-play-button": "_vjs-big-play-button_1y5ek_46",
889
+ "vjs-loading-spinner": "_vjs-loading-spinner_1y5ek_49",
890
+ "vjs-error-display": "_vjs-error-display_1y5ek_52"
891
+ }, Jt = Q.bind(Kt), Gt = (t) => {
892
+ const e = B.c(17);
893
+ let n, s, r;
894
+ e[0] !== t ? ({
895
+ className: r,
896
+ children: n,
897
+ ...s
898
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r) : (n = e[1], s = e[2], r = e[3]);
899
+ const l = r === void 0 ? "" : r;
900
+ let o;
901
+ e[4] === Symbol.for("react.memo_cache_sentinel") ? (o = ["width", "height"], e[4] = o) : o = e[4];
902
+ const {
903
+ width: c,
904
+ height: d
905
+ } = Y(o), f = typeof c == "number" ? `${c}px` : c, u = typeof d == "number" ? `${d}px` : d;
906
+ let h;
907
+ e[5] !== u || e[6] !== f ? (h = {
908
+ "--video-player-width": f,
909
+ "--video-player-height": u,
910
+ "--video-player-max-width": F.layout.maxWidth
911
+ }, e[5] = u, e[6] = f, e[7] = h) : h = e[7];
912
+ const i = h;
913
+ let a;
914
+ e[8] !== l ? (a = Jt("Frame", l), e[8] = l, e[9] = a) : a = e[9];
915
+ let m;
916
+ e[10] !== n ? (m = /* @__PURE__ */ p.jsx("div", { "data-vjs-player": !0, children: n }), e[10] = n, e[11] = m) : m = e[11];
917
+ let y;
918
+ return e[12] !== i || e[13] !== s || e[14] !== a || e[15] !== m ? (y = /* @__PURE__ */ p.jsx("div", { className: a, style: i, ...s, children: m }), e[12] = i, e[13] = s, e[14] = a, e[15] = m, e[16] = y) : y = e[16], y;
919
+ }, Xt = "_VideoElement_cfekd_2", Qt = {
920
+ VideoElement: Xt
921
+ }, Yt = Q.bind(Qt), oe = (t) => t ? t.trim().toLowerCase() : "", Zt = (t) => oe(t.srclang) || oe(t.language), zt = (t) => {
922
+ const {
923
+ src: e,
924
+ sources: n
925
+ } = t;
926
+ return n && n.length > 0 ? n : e.includes(".m3u8") ? [{
927
+ src: e,
928
+ type: "application/x-mpegURL"
929
+ }] : [{
930
+ src: e,
931
+ type: "video/mp4"
932
+ }];
933
+ }, en = (t) => t.map((e) => `${e.src}|${e.srclang ?? ""}|${e.kind ?? "subtitles"}`).join(";"), tn = (t) => {
934
+ const {
935
+ className: e = "",
936
+ preload: n,
937
+ ...s
938
+ } = t, {
939
+ width: r,
940
+ height: l,
941
+ src: o,
942
+ sources: c,
943
+ speedOptions: d,
944
+ playerOptions: f,
945
+ events: u,
946
+ disableVideoJsStyles: h,
947
+ tracks: i,
948
+ player: a,
949
+ activeCaptionLang: m,
950
+ setState: y,
951
+ setPlayer: b,
952
+ setVolume: v,
953
+ volume: V,
954
+ playbackRate: N
955
+ } = Y(["width", "height", "src", "sources", "speedOptions", "playerOptions", "events", "disableVideoJsStyles", "tracks", "player", "activeCaptionLang", "setState", "setPlayer", "setVolume", "volume", "playbackRate"]), w = _.useRef(null), k = _.useRef(null), C = _.useRef(null), x = _.useRef(0), L = _.useRef([]), T = _.useRef(null), S = _.useRef(null), j = _.useRef(V), E = _.useRef(N), D = _.useRef(m);
956
+ D.current = m;
957
+ const H = _.useMemo(() => zt({
958
+ src: o ?? "",
959
+ sources: c ?? void 0
960
+ }), [o, c]), $ = d, O = _.useMemo(() => en(i), [i]), K = _.useRef(i);
961
+ K.current = i;
962
+ const g = _.useMemo(() => u, [u]);
963
+ return _.useEffect(() => {
964
+ j.current = V;
965
+ }, [V]), _.useEffect(() => {
966
+ E.current = N;
967
+ }, [N]), _.useEffect(() => {
968
+ if (!a) return;
969
+ const A = a.textTracks(), I = Array.prototype.slice.call(A);
970
+ for (const q of I)
971
+ if (q.kind === "subtitles" || q.kind === "captions") {
972
+ const U = oe(m) !== "" && Zt(q) === oe(m);
973
+ q.mode = U ? "showing" : "hidden";
974
+ }
975
+ }, [a, m]), _.useLayoutEffect(() => () => {
976
+ var I;
977
+ x.current += 1, (I = C.current) == null || I.call(C), C.current = null, y({
978
+ isPictureInPicture: !1
979
+ });
980
+ const A = k.current;
981
+ A && (A.dispose(), k.current = null, b(null)), T.current = null, S.current = null, L.current.length > 0 && (L.current.forEach((q) => {
982
+ URL.revokeObjectURL(q);
983
+ }), L.current = []);
984
+ }, [b, y]), _.useLayoutEffect(() => {
985
+ var U;
986
+ if (!o)
987
+ return;
988
+ const A = JSON.stringify(H), I = k.current;
989
+ if (I && T.current !== null && T.current === O) {
990
+ S.current !== A && (I.src(H), I.load(), y({
991
+ hasError: !1,
992
+ isLoading: !0
993
+ }), S.current = A);
994
+ return;
995
+ }
996
+ if (I && T.current !== O && ((U = C.current) == null || U.call(C), C.current = null, y({
997
+ isPictureInPicture: !1
998
+ }), I.dispose(), k.current = null, b(null), T.current = null, S.current = null, L.current.length > 0 && (L.current.forEach((te) => {
999
+ URL.revokeObjectURL(te);
1000
+ }), L.current = [])), k.current)
1001
+ return;
1002
+ (async () => {
1003
+ var ne, fe;
1004
+ const te = x.current;
1005
+ if (!((ne = w.current) != null && ne.isConnected))
1006
+ return;
1007
+ const re = K.current, se = re.length > 0 ? await Promise.all(re.map(async (P) => {
1008
+ let R = P.src;
1009
+ if ($e(R))
1010
+ try {
1011
+ const W = await fetch(R);
1012
+ if (!W.ok)
1013
+ throw new Error(`Failed to load subtitle: ${W.status}`);
1014
+ const Z = await W.text(), z = et(Z);
1015
+ L.current = [...L.current, z], R = z;
1016
+ } catch (W) {
1017
+ console.error("SRT 자막 변환에 실패했습니다. 원본 경로를 사용합니다.", W);
1018
+ }
1019
+ return {
1020
+ src: R,
1021
+ kind: P.kind ?? "subtitles",
1022
+ srclang: P.srclang ?? "",
1023
+ label: P.label ?? "",
1024
+ default: oe(D.current) !== "" && oe(P.srclang) === oe(D.current)
1025
+ };
1026
+ })) : void 0;
1027
+ if (te !== x.current || !((fe = w.current) != null && fe.isConnected) || k.current)
1028
+ return;
1029
+ const ie = {
1030
+ ...{
1031
+ controls: !1,
1032
+ responsive: !1,
1033
+ fluid: !1,
1034
+ width: r,
1035
+ height: l,
1036
+ preload: "auto",
1037
+ playbackRates: $,
1038
+ fullscreen: {
1039
+ options: {
1040
+ navigationUI: "hide"
1041
+ }
1042
+ },
1043
+ html5: {
1044
+ vhs: {
1045
+ overrideNative: !0,
1046
+ enableLowInitialPlaylist: !0,
1047
+ smoothQualityChange: !0
1048
+ }
1049
+ },
1050
+ sources: H,
1051
+ ...se ? {
1052
+ tracks: se
1053
+ } : {}
1054
+ },
1055
+ ...f ?? {}
1056
+ };
1057
+ try {
1058
+ const P = Je(w.current, ie);
1059
+ k.current = P, T.current = O, S.current = A, b(P), P.on("ready", () => {
1060
+ var W;
1061
+ y({
1062
+ isLoading: !1
1063
+ }), P.volume(j.current), P.playbackRate(E.current), v(j.current), y({
1064
+ playbackRate: E.current
1065
+ }), (W = C.current) == null || W.call(C), C.current = null;
1066
+ const R = Oe(P);
1067
+ if (R) {
1068
+ const Z = () => {
1069
+ const ee = typeof document < "u" && document.pictureInPictureElement === R;
1070
+ y({
1071
+ isPictureInPicture: ee
1072
+ }), g != null && g.onPictureInPictureChange && g.onPictureInPictureChange(ee);
1073
+ }, z = () => {
1074
+ y({
1075
+ isPictureInPicture: !0
1076
+ }), g != null && g.onPictureInPictureChange && g.onPictureInPictureChange(!0);
1077
+ }, ae = () => {
1078
+ y({
1079
+ isPictureInPicture: !1
1080
+ }), g != null && g.onPictureInPictureChange && g.onPictureInPictureChange(!1);
1081
+ };
1082
+ R.addEventListener("enterpictureinpicture", z), R.addEventListener("leavepictureinpicture", ae), Z(), C.current = () => {
1083
+ R.removeEventListener("enterpictureinpicture", z), R.removeEventListener("leavepictureinpicture", ae);
1084
+ };
1085
+ }
1086
+ g != null && g.onReady && g.onReady(P);
1087
+ }), P.on("loadstart", () => {
1088
+ y({
1089
+ isLoading: !0,
1090
+ hasError: !1
1091
+ }), g != null && g.onLoadStart && g.onLoadStart();
1092
+ }), P.on("canplay", () => {
1093
+ y({
1094
+ isLoading: !1
1095
+ }), g != null && g.onCanPlay && g.onCanPlay();
1096
+ }), P.on("error", (R) => {
1097
+ console.error("비디오 에러:", R), y({
1098
+ hasError: !0,
1099
+ isLoading: !1
1100
+ }), g != null && g.onError && g.onError(R);
1101
+ }), P.on("play", () => {
1102
+ y({
1103
+ isPlaying: !0
1104
+ }), g != null && g.onPlay && g.onPlay();
1105
+ }), P.on("pause", () => {
1106
+ y({
1107
+ isPlaying: !1
1108
+ }), g != null && g.onPause && g.onPause();
1109
+ }), P.on("ended", () => {
1110
+ y({
1111
+ isPlaying: !1
1112
+ }), g != null && g.onEnded && g.onEnded();
1113
+ }), P.on("timeupdate", () => {
1114
+ const R = P.currentTime() ?? 0;
1115
+ y({
1116
+ currentTime: R
1117
+ }), g != null && g.onTimeUpdate && g.onTimeUpdate(R);
1118
+ }), P.on("progress", () => {
1119
+ const R = P.buffered();
1120
+ if (R.length > 0) {
1121
+ const W = R.end(R.length - 1);
1122
+ y({
1123
+ buffered: W
1124
+ }), g != null && g.onProgress && g.onProgress(W);
1125
+ }
1126
+ }), P.on("volumechange", () => {
1127
+ const R = P.volume() ?? 1;
1128
+ v(R), g != null && g.onVolumeChange && g.onVolumeChange(R);
1129
+ }), P.on("ratechange", () => {
1130
+ const R = P.playbackRate() ?? 1;
1131
+ y({
1132
+ playbackRate: R
1133
+ }), g != null && g.onRateChange && g.onRateChange(R);
1134
+ }), P.on("fullscreenchange", () => {
1135
+ const R = P.isFullscreen() ?? !1;
1136
+ y({
1137
+ isFullscreen: R
1138
+ }), g != null && g.onFullscreenChange && g.onFullscreenChange(R);
1139
+ }), P.on("loadedmetadata", () => {
1140
+ const R = P.duration() ?? 0;
1141
+ y({
1142
+ duration: R
1143
+ }), g != null && g.onDurationChange && g.onDurationChange(R);
1144
+ });
1145
+ } catch (P) {
1146
+ console.error("Video.js 플레이어 생성 실패:", P), y({
1147
+ hasError: !0,
1148
+ isLoading: !1
1149
+ }), g != null && g.onError && g.onError(P);
1150
+ }
1151
+ })();
1152
+ }, [o, r, l, O, b, y, v, H, $, f, g]), _.useLayoutEffect(() => {
1153
+ const A = k.current;
1154
+ A && (A.width(r), A.height(l));
1155
+ }, [r, l]), /* @__PURE__ */ p.jsx("video", { ref: w, className: Yt("VideoElement", "video-js", h ? "" : "vjs-default-skin", e), preload: n ?? "auto", ...s });
1156
+ }, nn = "_Thumbnail_1hgib_1", rn = "_ThumbnailImage_1hgib_11", sn = {
1157
+ Thumbnail: nn,
1158
+ ThumbnailImage: rn
1159
+ }, Pe = Q.bind(sn), ln = (t) => {
1160
+ const e = B.c(17);
1161
+ let n, s, r, l;
1162
+ e[0] !== t ? ({
1163
+ src: s,
1164
+ alt: r,
1165
+ className: l,
1166
+ ...n
1167
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r, e[4] = l) : (n = e[1], s = e[2], r = e[3], l = e[4]);
1168
+ const o = r === void 0 ? "Video thumbnail" : r, c = l === void 0 ? "" : l, d = Ne();
1169
+ let f;
1170
+ e[5] === Symbol.for("react.memo_cache_sentinel") ? (f = ["isPlaying", "currentTime"], e[5] = f) : f = e[5];
1171
+ const {
1172
+ isPlaying: u,
1173
+ currentTime: h
1174
+ } = Y(f);
1175
+ if (u || h !== 0)
1176
+ return null;
1177
+ let i;
1178
+ e[6] !== c ? (i = Pe("Thumbnail", c), e[6] = c, e[7] = i) : i = e[7];
1179
+ let a;
1180
+ e[8] === Symbol.for("react.memo_cache_sentinel") ? (a = Pe("ThumbnailImage"), e[8] = a) : a = e[8];
1181
+ let m;
1182
+ e[9] !== d || e[10] !== o || e[11] !== s ? (m = /* @__PURE__ */ p.jsx(d, { src: s, alt: o, className: a }), e[9] = d, e[10] = o, e[11] = s, e[12] = m) : m = e[12];
1183
+ let y;
1184
+ return e[13] !== n || e[14] !== i || e[15] !== m ? (y = /* @__PURE__ */ p.jsx("div", { className: i, ...n, children: m }), e[13] = n, e[14] = i, e[15] = m, e[16] = y) : y = e[16], y;
1185
+ }, on = "_WidgetButton_1g3p0_2", an = {
1186
+ WidgetButton: on
1187
+ }, cn = Q.bind(an), Ce = (t) => {
1188
+ const e = B.c(20);
1189
+ let n, s, r, l, o, c;
1190
+ e[0] !== t ? ({
1191
+ icon: r,
1192
+ children: s,
1193
+ onClick: l,
1194
+ ariaLabel: n,
1195
+ className: c,
1196
+ ...o
1197
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r, e[4] = l, e[5] = o, e[6] = c) : (n = e[1], s = e[2], r = e[3], l = e[4], o = e[5], c = e[6]);
1198
+ const d = c === void 0 ? "" : c;
1199
+ let f;
1200
+ e[7] !== d ? (f = cn("WidgetButton", d), e[7] = d, e[8] = f) : f = e[8];
1201
+ let u;
1202
+ e[9] !== l ? (u = (a) => {
1203
+ a.stopPropagation(), l == null || l();
1204
+ }, e[9] = l, e[10] = u) : u = e[10];
1205
+ let h;
1206
+ e[11] !== s || e[12] !== r ? (h = s ?? (r ? /* @__PURE__ */ p.jsx(Ge, { ...r }) : null), e[11] = s, e[12] = r, e[13] = h) : h = e[13];
1207
+ let i;
1208
+ return e[14] !== n || e[15] !== o || e[16] !== f || e[17] !== u || e[18] !== h ? (i = /* @__PURE__ */ p.jsx("button", { type: "button", className: f, onClick: u, "aria-label": n, ...o, children: h }), e[14] = n, e[15] = o, e[16] = f, e[17] = u, e[18] = h, e[19] = i) : i = e[19], i;
1209
+ }, un = "_ProgressBar_yylk1_1", fn = "_ProgressTrack_yylk1_16", dn = "_BufferedProgress_yylk1_24", mn = "_CurrentProgress_yylk1_33", yn = {
1210
+ ProgressBar: un,
1211
+ ProgressTrack: fn,
1212
+ BufferedProgress: dn,
1213
+ CurrentProgress: mn
1214
+ }, he = Q.bind(yn), gn = (t) => {
1215
+ const e = B.c(48), {
1216
+ className: n,
1217
+ onInteractionChange: s,
1218
+ ariaLabel: r,
1219
+ as: l
1220
+ } = t, o = n === void 0 ? "" : n;
1221
+ let c;
1222
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (c = ["isPlaying", "playbackRate", "duration", "buffered", "currentTime", "handleSeek"], e[0] = c) : c = e[0];
1223
+ const {
1224
+ isPlaying: d,
1225
+ playbackRate: f,
1226
+ duration: u,
1227
+ buffered: h,
1228
+ currentTime: i,
1229
+ handleSeek: a
1230
+ } = Y(c), m = _.useRef(i), y = _.useRef(null), [b, v] = _.useState(0), [V, N] = _.useState(0), [w, k] = _.useState(!1), [C, x] = _.useState(!1), L = _.useRef(void 0);
1231
+ let T, S;
1232
+ e[1] !== h || e[2] !== u || e[3] !== d || e[4] !== f ? (T = () => {
1233
+ let M = Date.now();
1234
+ const J = () => {
1235
+ const pe = Date.now(), _e = (pe - M) / 1e3;
1236
+ if (M = pe, d) {
1237
+ const Ue = m.current + _e * f, qe = u > 0 ? Ue / u * 100 : 0;
1238
+ v(qe);
1239
+ }
1240
+ const He = u > 0 ? h / u * 100 : 0;
1241
+ N(He);
1242
+ }, X = window.setInterval(J, 8.333333333333334);
1243
+ return () => {
1244
+ window.clearInterval(X);
1245
+ };
1246
+ }, S = [d, f, u, h], e[1] = h, e[2] = u, e[3] = d, e[4] = f, e[5] = T, e[6] = S) : (T = e[5], S = e[6]), _.useEffect(T, S);
1247
+ let j, E;
1248
+ e[7] !== i || e[8] !== u || e[9] !== d ? (j = () => {
1249
+ if (m.current = i, !d) {
1250
+ const M = u > 0 ? i / u * 100 : 0;
1251
+ v(M);
1252
+ }
1253
+ }, E = [i, d, u], e[7] = i, e[8] = u, e[9] = d, e[10] = j, e[11] = E) : (j = e[10], E = e[11]), _.useEffect(j, E);
1254
+ let D;
1255
+ e[12] !== u || e[13] !== a ? (D = (M) => {
1256
+ if (u <= 0)
1257
+ return;
1258
+ const J = Math.min(Math.max(M, 0), u);
1259
+ m.current = J;
1260
+ const X = J / u * 100;
1261
+ v(X), a(J);
1262
+ }, e[12] = u, e[13] = a, e[14] = D) : D = e[14];
1263
+ const H = D;
1264
+ let $;
1265
+ e[15] !== u || e[16] !== H ? ($ = (M) => {
1266
+ const J = y.current;
1267
+ if (J === null || u <= 0)
1268
+ return;
1269
+ const X = J.getBoundingClientRect();
1270
+ if (X.width === 0)
1271
+ return;
1272
+ const _e = (M - X.left) / X.width * u;
1273
+ H(_e);
1274
+ }, e[15] = u, e[16] = H, e[17] = $) : $ = e[17];
1275
+ const O = $;
1276
+ let K;
1277
+ e[18] !== O ? (K = (M) => {
1278
+ M.preventDefault(), M.stopPropagation(), k(!0), O(M.clientX);
1279
+ }, e[18] = O, e[19] = K) : K = e[19];
1280
+ const g = K;
1281
+ let A, I;
1282
+ e[20] !== w || e[21] !== O ? (I = () => {
1283
+ if (!w)
1284
+ return;
1285
+ const M = (X) => {
1286
+ O(X.clientX);
1287
+ }, J = () => {
1288
+ k(!1);
1289
+ };
1290
+ return window.addEventListener("pointermove", M), window.addEventListener("pointerup", J), () => {
1291
+ window.removeEventListener("pointermove", M), window.removeEventListener("pointerup", J);
1292
+ };
1293
+ }, A = [w, O], e[20] = w, e[21] = O, e[22] = A, e[23] = I) : (A = e[22], I = e[23]), _.useEffect(I, A);
1294
+ const q = (M) => {
1295
+ if (u <= 0)
1296
+ return;
1297
+ const J = Math.max(u * 0.02, 1);
1298
+ if (M.key === "ArrowRight" || M.key === "ArrowUp" || M.key === "ArrowLeft" || M.key === "ArrowDown") {
1299
+ M.preventDefault(), L.current && (window.clearTimeout(L.current), L.current = void 0), x(!0);
1300
+ const X = M.key === "ArrowRight" || M.key === "ArrowUp" ? J : -J;
1301
+ H(m.current + X), L.current = window.setTimeout(() => {
1302
+ x(!1), L.current = void 0;
1303
+ }, 600);
1304
+ }
1305
+ };
1306
+ let U, te;
1307
+ e[24] !== w || e[25] !== C || e[26] !== s ? (U = () => {
1308
+ s && s(w || C);
1309
+ }, te = [w, C, s], e[24] = w, e[25] = C, e[26] = s, e[27] = U, e[28] = te) : (U = e[27], te = e[28]), _.useEffect(U, te);
1310
+ let re, se;
1311
+ e[29] === Symbol.for("react.memo_cache_sentinel") ? (re = () => () => {
1312
+ L.current && window.clearTimeout(L.current);
1313
+ }, se = [], e[29] = re, e[30] = se) : (re = e[29], se = e[30]), _.useEffect(re, se);
1314
+ const ue = he("ProgressBar", o), ie = r ?? F.aria.progress, ne = b, fe = V;
1315
+ if (l)
1316
+ return /* @__PURE__ */ p.jsx(p.Fragment, { children: l({
1317
+ defaultClassName: ue,
1318
+ progress: ne,
1319
+ buffered: fe,
1320
+ ariaLabel: ie,
1321
+ onPointerDown: g,
1322
+ onKeyDown: q,
1323
+ trackRef: y
1324
+ }) });
1325
+ let P, R;
1326
+ e[31] === Symbol.for("react.memo_cache_sentinel") ? (P = he("ProgressTrack"), R = he("BufferedProgress"), e[31] = P, e[32] = R) : (P = e[31], R = e[32]);
1327
+ const W = `${fe}%`;
1328
+ let Z;
1329
+ e[33] !== W ? (Z = /* @__PURE__ */ p.jsx("div", { className: R, style: {
1330
+ width: W
1331
+ } }), e[33] = W, e[34] = Z) : Z = e[34];
1332
+ let z;
1333
+ e[35] === Symbol.for("react.memo_cache_sentinel") ? (z = he("CurrentProgress"), e[35] = z) : z = e[35];
1334
+ const ae = `${ne}%`;
1335
+ let ee;
1336
+ e[36] !== ae ? (ee = /* @__PURE__ */ p.jsx("div", { className: z, style: {
1337
+ width: ae
1338
+ } }), e[36] = ae, e[37] = ee) : ee = e[37];
1339
+ let ce;
1340
+ e[38] !== Z || e[39] !== ee ? (ce = /* @__PURE__ */ p.jsxs("div", { className: P, children: [
1341
+ Z,
1342
+ ee
1343
+ ] }), e[38] = Z, e[39] = ee, e[40] = ce) : ce = e[40];
1344
+ let ye;
1345
+ return e[41] !== ue || e[42] !== q || e[43] !== g || e[44] !== ne || e[45] !== ie || e[46] !== ce ? (ye = /* @__PURE__ */ p.jsx("div", { className: ue, ref: y, onPointerDown: g, onKeyDown: q, role: "progressbar", tabIndex: 0, "aria-valuenow": ne, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": ie, children: ce }), e[41] = ue, e[42] = q, e[43] = g, e[44] = ne, e[45] = ie, e[46] = ce, e[47] = ye) : ye = e[47], ye;
1346
+ }, hn = "_VolumeControl_cqcm4_1", pn = "_isActive_cqcm4_25", _n = "_VolumeSlider_cqcm4_30", bn = "_VolumeButton_cqcm4_35", Sn = "_InlineTrackWrapper_cqcm4_63", vn = "_InlineTrackBackground_cqcm4_78", Tn = "_InlineTrackProgress_cqcm4_88", Cn = "_InlineThumb_cqcm4_98", kn = "_VolumeValue_cqcm4_110", xn = {
1347
+ VolumeControl: hn,
1348
+ isActive: pn,
1349
+ VolumeSlider: _n,
1350
+ VolumeButton: bn,
1351
+ InlineTrackWrapper: Sn,
1352
+ InlineTrackBackground: vn,
1353
+ InlineTrackProgress: Tn,
1354
+ InlineThumb: Cn,
1355
+ VolumeValue: kn
1356
+ }, le = Q.bind(xn);
1357
+ function Re(t, e) {
1358
+ return t === void 0 ? {
1359
+ name: e,
1360
+ size: 24
1361
+ } : typeof t == "string" ? {
1362
+ name: t,
1363
+ size: 24
1364
+ } : {
1365
+ size: 24,
1366
+ ...t
1367
+ };
1368
+ }
1369
+ const wn = (t) => {
1370
+ const {
1371
+ className: e = "",
1372
+ onInteractionChange: n,
1373
+ icons: s,
1374
+ aria: r,
1375
+ as: l
1376
+ } = t, o = {
1377
+ volumeOn: Re(s == null ? void 0 : s.volumeOn, F.icons.volumeOn),
1378
+ volumeOff: Re(s == null ? void 0 : s.volumeOff, F.icons.volumeOff)
1379
+ }, c = {
1380
+ mute: (r == null ? void 0 : r.mute) ?? F.aria.mute,
1381
+ unmute: (r == null ? void 0 : r.unmute) ?? F.aria.unmute
1382
+ }, {
1383
+ volume: d,
1384
+ isMuted: f,
1385
+ handleVolumeChange: u,
1386
+ handleMuteToggle: h
1387
+ } = Y(["volume", "isMuted", "handleVolumeChange", "handleMuteToggle"]), [i, a] = _.useState(!1), [m, y] = _.useState(!1), b = i || m, v = d, V = _.useRef(null), N = _.useMemo(() => ({
1388
+ "--vp-volume-fill": `${v * 100}%`,
1389
+ "--vp-volume-thumb": `${v * 100}%`
1390
+ }), [v]), w = _.useCallback((S) => {
1391
+ const j = Math.min(Math.max(S, 0), 1);
1392
+ u(j);
1393
+ }, [u]), k = _.useCallback((S) => {
1394
+ const j = V.current;
1395
+ if (j === null)
1396
+ return;
1397
+ const E = j.getBoundingClientRect();
1398
+ if (E.width === 0)
1399
+ return;
1400
+ const D = (S - E.left) / E.width;
1401
+ w(D);
1402
+ }, [w]), C = _.useCallback((S) => {
1403
+ S.preventDefault(), a(!0), y(!0), k(S.clientX);
1404
+ }, [k]);
1405
+ _.useEffect(() => {
1406
+ n && n(b || m);
1407
+ }, [m, n, b]), _.useEffect(() => {
1408
+ if (!m)
1409
+ return;
1410
+ const S = (E) => {
1411
+ k(E.clientX);
1412
+ }, j = () => {
1413
+ y(!1), a(!1);
1414
+ };
1415
+ return window.addEventListener("pointermove", S), window.addEventListener("pointerup", j), () => {
1416
+ window.removeEventListener("pointermove", S), window.removeEventListener("pointerup", j);
1417
+ };
1418
+ }, [m, k]);
1419
+ const x = _.useCallback((S) => {
1420
+ S.key === "ArrowRight" || S.key === "ArrowUp" ? (S.preventDefault(), w(v + 0.05), a(!0)) : (S.key === "ArrowLeft" || S.key === "ArrowDown") && (S.preventDefault(), w(v - 0.05), a(!0));
1421
+ }, [w, v]), L = le("VolumeControl", {
1422
+ isActive: b
1423
+ }, e), T = f ? c.unmute : c.mute;
1424
+ return l ? /* @__PURE__ */ p.jsx(p.Fragment, { children: l({
1425
+ defaultClassName: L,
1426
+ volume: d,
1427
+ isMuted: f,
1428
+ ariaLabel: T,
1429
+ onMuteToggle: h,
1430
+ onVolumeChange: u,
1431
+ volumeOnIcon: o.volumeOn.name,
1432
+ volumeOffIcon: o.volumeOff.name,
1433
+ sliderVisible: b,
1434
+ sliderValue: v,
1435
+ onSliderFocus: a,
1436
+ onPointerDown: (S) => {
1437
+ C(S);
1438
+ },
1439
+ trackRef: V
1440
+ }) }) : /* @__PURE__ */ p.jsxs("div", { className: L, children: [
1441
+ /* @__PURE__ */ p.jsx(Ce, { className: le("VolumeButton"), icon: f ? o.volumeOff : o.volumeOn, onClick: h, ariaLabel: T }),
1442
+ /* @__PURE__ */ p.jsx("div", { className: le("VolumeSlider"), "aria-hidden": !b, children: /* @__PURE__ */ p.jsxs("div", { className: le("InlineTrackWrapper"), ref: V, role: "slider", "aria-valuemin": 0, "aria-valuemax": 1, "aria-valuenow": Number(v.toFixed(2)), "aria-valuetext": `${Math.round(v * 100)}%`, tabIndex: 0, style: N, onPointerDown: C, onKeyDown: x, onFocus: () => a(!0), onBlur: () => a(!1), children: [
1443
+ /* @__PURE__ */ p.jsx("div", { className: le("InlineTrackBackground"), children: /* @__PURE__ */ p.jsx("div", { className: le("InlineTrackProgress") }) }),
1444
+ /* @__PURE__ */ p.jsx("div", { className: le("InlineThumb") })
1445
+ ] }) })
1446
+ ] });
1447
+ }, Ln = "_SpeedControl_3kfjh_1", Vn = "_SpeedButton_3kfjh_8", jn = "_SpeedText_3kfjh_23", Pn = "_SpeedMenu_3kfjh_28", Rn = "_SpeedOption_3kfjh_40", Nn = "_active_3kfjh_54", In = "_cycle_3kfjh_59", On = {
1448
+ SpeedControl: Ln,
1449
+ SpeedButton: Vn,
1450
+ SpeedText: jn,
1451
+ SpeedMenu: Pn,
1452
+ SpeedOption: Rn,
1453
+ active: Nn,
1454
+ cycle: In
1455
+ }, de = Q.bind(On), En = (t) => {
1456
+ const e = B.c(48), {
1457
+ className: n,
1458
+ variant: s,
1459
+ ariaLabel: r,
1460
+ as: l
1461
+ } = t, o = n === void 0 ? "" : n, c = s === void 0 ? "menu" : s;
1462
+ let d;
1463
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (d = ["playbackRate", "speedOptions", "handleSpeedChange"], e[0] = d) : d = e[0];
1464
+ const {
1465
+ playbackRate: f,
1466
+ speedOptions: u,
1467
+ handleSpeedChange: h
1468
+ } = Y(d), [i, a] = _.useState(!1);
1469
+ let m;
1470
+ e[1] !== h ? (m = ($) => {
1471
+ h($), a(!1);
1472
+ }, e[1] = h, e[2] = m) : m = e[2];
1473
+ const y = m;
1474
+ let b;
1475
+ e[3] !== h || e[4] !== f || e[5] !== u ? (b = () => {
1476
+ const O = (u.findIndex((K) => K === f) + 1) % u.length;
1477
+ h(u[O]);
1478
+ }, e[3] = h, e[4] = f, e[5] = u, e[6] = b) : b = e[6];
1479
+ const v = b;
1480
+ let V;
1481
+ e[7] !== v || e[8] !== c ? (V = () => {
1482
+ c === "cycle" ? v() : a($n);
1483
+ }, e[7] = v, e[8] = c, e[9] = V) : V = e[9];
1484
+ const N = V;
1485
+ let w, k, C;
1486
+ if (e[10] !== r || e[11] !== l || e[12] !== o || e[13] !== N || e[14] !== y || e[15] !== i || e[16] !== f || e[17] !== u || e[18] !== c) {
1487
+ C = Symbol.for("react.early_return_sentinel");
1488
+ e:
1489
+ if (w = de("SpeedControl", o, c), k = r ?? F.aria.speed, l) {
1490
+ let $, O;
1491
+ e[22] !== c ? ($ = () => {
1492
+ c === "menu" && a(!0);
1493
+ }, O = () => {
1494
+ c === "menu" && a(!1);
1495
+ }, e[22] = c, e[23] = $, e[24] = O) : ($ = e[23], O = e[24]), C = /* @__PURE__ */ p.jsx(p.Fragment, { children: l({
1496
+ defaultClassName: w,
1497
+ playbackRate: f,
1498
+ speedOptions: u,
1499
+ variant: c,
1500
+ isOpen: i,
1501
+ ariaLabel: k,
1502
+ onButtonClick: N,
1503
+ onSpeedSelect: y,
1504
+ onMouseEnter: $,
1505
+ onMouseLeave: O
1506
+ }) });
1507
+ break e;
1508
+ }
1509
+ e[10] = r, e[11] = l, e[12] = o, e[13] = N, e[14] = y, e[15] = i, e[16] = f, e[17] = u, e[18] = c, e[19] = w, e[20] = k, e[21] = C;
1510
+ } else
1511
+ w = e[19], k = e[20], C = e[21];
1512
+ if (C !== Symbol.for("react.early_return_sentinel"))
1513
+ return C;
1514
+ let x, L;
1515
+ e[25] !== c ? (x = () => {
1516
+ c === "menu" && a(!0);
1517
+ }, L = () => {
1518
+ c === "menu" && a(!1);
1519
+ }, e[25] = c, e[26] = x, e[27] = L) : (x = e[26], L = e[27]);
1520
+ let T;
1521
+ e[28] === Symbol.for("react.memo_cache_sentinel") ? (T = de("SpeedButton"), e[28] = T) : T = e[28];
1522
+ let S;
1523
+ e[29] === Symbol.for("react.memo_cache_sentinel") ? (S = de("SpeedText"), e[29] = S) : S = e[29];
1524
+ let j;
1525
+ e[30] !== f ? (j = /* @__PURE__ */ p.jsxs("span", { className: S, children: [
1526
+ f,
1527
+ "x"
1528
+ ] }), e[30] = f, e[31] = j) : j = e[31];
1529
+ let E;
1530
+ e[32] !== N || e[33] !== k || e[34] !== j ? (E = /* @__PURE__ */ p.jsx(Ce, { className: T, ariaLabel: k, onClick: N, children: j }), e[32] = N, e[33] = k, e[34] = j, e[35] = E) : E = e[35];
1531
+ let D;
1532
+ e[36] !== y || e[37] !== i || e[38] !== f || e[39] !== u || e[40] !== c ? (D = c === "menu" && i && /* @__PURE__ */ p.jsx("div", { className: de("SpeedMenu"), children: u.map(($) => /* @__PURE__ */ p.jsxs("button", { className: de("SpeedOption", {
1533
+ active: $ === f
1534
+ }), onClick: () => y($), children: [
1535
+ $,
1536
+ "x"
1537
+ ] }, $)) }), e[36] = y, e[37] = i, e[38] = f, e[39] = u, e[40] = c, e[41] = D) : D = e[41];
1538
+ let H;
1539
+ return e[42] !== w || e[43] !== E || e[44] !== D || e[45] !== x || e[46] !== L ? (H = /* @__PURE__ */ p.jsxs("div", { className: w, onMouseEnter: x, onMouseLeave: L, children: [
1540
+ E,
1541
+ D
1542
+ ] }), e[42] = w, e[43] = E, e[44] = D, e[45] = x, e[46] = L, e[47] = H) : H = e[47], H;
1543
+ };
1544
+ function $n(t) {
1545
+ return !t;
1546
+ }
1547
+ const Mn = "_TimeDisplay_1m48s_2", Dn = {
1548
+ TimeDisplay: Mn
1549
+ }, An = Q.bind(Dn), Bn = (t) => {
1550
+ const e = Math.floor(t / 60), n = Math.floor(t % 60);
1551
+ return `${e.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
1552
+ }, Fn = (t) => {
1553
+ const e = B.c(14), {
1554
+ className: n,
1555
+ formatTime: s,
1556
+ as: r
1557
+ } = t, l = n === void 0 ? "" : n, o = s === void 0 ? Bn : s;
1558
+ let c;
1559
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (c = ["currentTime", "duration"], e[0] = c) : c = e[0];
1560
+ const {
1561
+ currentTime: d,
1562
+ duration: f
1563
+ } = Y(c);
1564
+ let u, h, i, a;
1565
+ if (e[1] !== r || e[2] !== l || e[3] !== d || e[4] !== f || e[5] !== o) {
1566
+ a = Symbol.for("react.early_return_sentinel");
1567
+ e:
1568
+ if (h = o(d), i = o(f), u = An("TimeDisplay", l), r) {
1569
+ a = /* @__PURE__ */ p.jsx(p.Fragment, { children: r({
1570
+ defaultClassName: u,
1571
+ currentTime: d,
1572
+ duration: f,
1573
+ formattedCurrentTime: h,
1574
+ formattedDuration: i
1575
+ }) });
1576
+ break e;
1577
+ }
1578
+ e[1] = r, e[2] = l, e[3] = d, e[4] = f, e[5] = o, e[6] = u, e[7] = h, e[8] = i, e[9] = a;
1579
+ } else
1580
+ u = e[6], h = e[7], i = e[8], a = e[9];
1581
+ if (a !== Symbol.for("react.early_return_sentinel"))
1582
+ return a;
1583
+ let m;
1584
+ return e[10] !== u || e[11] !== h || e[12] !== i ? (m = /* @__PURE__ */ p.jsxs("div", { className: u, children: [
1585
+ h,
1586
+ " / ",
1587
+ i
1588
+ ] }), e[10] = u, e[11] = h, e[12] = i, e[13] = m) : m = e[13], m;
1589
+ }, Hn = Object.assign({}, {
1590
+ Button: Ce,
1591
+ ProgressBar: gn,
1592
+ VolumeControl: wn,
1593
+ SpeedControl: En,
1594
+ Time: Fn
1595
+ }), Fe = (t) => {
1596
+ const e = B.c(53), {
1597
+ storeConfig: n,
1598
+ Image: s,
1599
+ width: r,
1600
+ height: l,
1601
+ src: o,
1602
+ sources: c,
1603
+ speedOptions: d,
1604
+ playerOptions: f,
1605
+ events: u,
1606
+ disableVideoJsStyles: h,
1607
+ tracks: i,
1608
+ initialActiveCaptionLang: a,
1609
+ activeCaptionLang: m,
1610
+ onCaptionLangChange: y,
1611
+ autoHide: b,
1612
+ autoHideDelayMs: v,
1613
+ overlayClickAction: V,
1614
+ loadingText: N,
1615
+ errorTitle: w,
1616
+ errorDescription: k,
1617
+ errorRetry: C,
1618
+ controllerRef: x,
1619
+ children: L
1620
+ } = t, T = _.useContext(me);
1621
+ let S, j;
1622
+ e[0] !== x || e[1] !== T ? (S = () => {
1623
+ if (!x)
1624
+ return;
1625
+ const I = T;
1626
+ if (!I)
1627
+ return;
1628
+ const q = {
1629
+ getPlayer: () => I.getState().player,
1630
+ isPlaying: () => I.getState().isPlaying,
1631
+ getCurrentTime: () => I.getState().currentTime,
1632
+ getDuration: () => I.getState().duration,
1633
+ play: () => {
1634
+ const U = I.getState().player;
1635
+ U && U.play();
1636
+ },
1637
+ pause: () => {
1638
+ const U = I.getState().player;
1639
+ U && U.pause();
1640
+ },
1641
+ togglePlayPause: () => {
1642
+ I.getState().handlePlayPause();
1643
+ },
1644
+ seek: (U) => {
1645
+ I.getState().handleSeek(U);
1646
+ },
1647
+ seekAndPlay: (U) => {
1648
+ I.getState().handleSeekAndPlay(U);
1649
+ },
1650
+ togglePictureInPicture: () => {
1651
+ I.getState().handlePictureInPictureToggle();
1652
+ },
1653
+ toggleFullscreen: () => {
1654
+ I.getState().handleFullscreenToggle();
1655
+ }
1656
+ };
1657
+ return x.current = q, () => {
1658
+ x.current === q && (x.current = null);
1659
+ };
1660
+ }, j = [T, x], e[0] = x, e[1] = T, e[2] = S, e[3] = j) : (S = e[2], j = e[3]), _.useEffect(S, j);
1661
+ const E = s || ve;
1662
+ let D;
1663
+ e[4] !== E || e[5] !== L ? (D = /* @__PURE__ */ p.jsx(Te, { value: E, children: L }), e[4] = E, e[5] = L, e[6] = D) : D = e[6];
1664
+ const H = D;
1665
+ let $;
1666
+ e[7] !== m || e[8] !== b || e[9] !== v || e[10] !== h || e[11] !== k || e[12] !== C || e[13] !== w || e[14] !== u || e[15] !== l || e[16] !== N || e[17] !== y || e[18] !== V || e[19] !== f || e[20] !== c || e[21] !== d || e[22] !== o || e[23] !== i || e[24] !== r ? ($ = Object.fromEntries(Object.entries({
1667
+ width: r,
1668
+ height: l,
1669
+ src: o,
1670
+ sources: c,
1671
+ speedOptions: d,
1672
+ playerOptions: f,
1673
+ events: u,
1674
+ disableVideoJsStyles: h,
1675
+ tracks: i,
1676
+ activeCaptionLang: m,
1677
+ onCaptionLangChange: y,
1678
+ autoHide: b,
1679
+ autoHideDelayMs: v,
1680
+ overlayClickAction: V,
1681
+ loadingText: N,
1682
+ errorTitle: w,
1683
+ errorDescription: k,
1684
+ errorRetry: C
1685
+ }).filter(Un)), e[7] = m, e[8] = b, e[9] = v, e[10] = h, e[11] = k, e[12] = C, e[13] = w, e[14] = u, e[15] = l, e[16] = N, e[17] = y, e[18] = V, e[19] = f, e[20] = c, e[21] = d, e[22] = o, e[23] = i, e[24] = r, e[25] = $) : $ = e[25];
1686
+ const O = $;
1687
+ let K, g;
1688
+ if (e[26] !== O || e[27] !== T ? (K = () => {
1689
+ if (T && Object.keys(O).length > 0) {
1690
+ const I = T.getState(), q = Me({
1691
+ src: I.src,
1692
+ sources: I.sources
1693
+ }, O);
1694
+ T.getState().setState({
1695
+ ...O,
1696
+ ...q ? {
1697
+ currentTime: 0,
1698
+ duration: 0,
1699
+ buffered: 0,
1700
+ isPlaying: !1,
1701
+ hasError: !1,
1702
+ isLoading: !0
1703
+ } : {}
1704
+ });
1705
+ }
1706
+ }, g = [T, O], e[26] = O, e[27] = T, e[28] = K, e[29] = g) : (K = e[28], g = e[29]), _.useLayoutEffect(K, g), T)
1707
+ return H;
1708
+ let A;
1709
+ return e[30] !== m || e[31] !== b || e[32] !== v || e[33] !== H || e[34] !== x || e[35] !== h || e[36] !== k || e[37] !== C || e[38] !== w || e[39] !== u || e[40] !== l || e[41] !== a || e[42] !== N || e[43] !== y || e[44] !== V || e[45] !== f || e[46] !== c || e[47] !== d || e[48] !== o || e[49] !== n || e[50] !== i || e[51] !== r ? (A = /* @__PURE__ */ p.jsx(Be, { storeConfig: n, width: r, height: l, src: o, sources: c, speedOptions: d, playerOptions: f, events: u, disableVideoJsStyles: h, tracks: i, initialActiveCaptionLang: a, activeCaptionLang: m, onCaptionLangChange: y, autoHide: b, autoHideDelayMs: v, overlayClickAction: V, loadingText: N, errorTitle: w, errorDescription: k, errorRetry: C, controllerRef: x, children: H }), e[30] = m, e[31] = b, e[32] = v, e[33] = H, e[34] = x, e[35] = h, e[36] = k, e[37] = C, e[38] = w, e[39] = u, e[40] = l, e[41] = a, e[42] = N, e[43] = y, e[44] = V, e[45] = f, e[46] = c, e[47] = d, e[48] = o, e[49] = n, e[50] = i, e[51] = r, e[52] = A) : A = e[52], A;
1710
+ };
1711
+ Fe.displayName = "VideoPlayer.Root";
1712
+ const Qn = Object.assign({
1713
+ Root: Fe,
1714
+ Frame: Gt,
1715
+ Player: tn,
1716
+ Thumbnail: ln,
1717
+ Overlay: It,
1718
+ Loading: At,
1719
+ Error: qt,
1720
+ Widgets: Hn
1721
+ }, {
1722
+ useVideoPlayerStore: Ie,
1723
+ useVideoPlayerShallow: Y,
1724
+ useVideoPlayerImage: Ne,
1725
+ VideoPlayerStoreContext: me,
1726
+ VideoPlayerImageContext: Te,
1727
+ VideoPlayerProvider: Be,
1728
+ createVideoPlayerStore: Ae,
1729
+ resolveVideoPlayerStoreConfig: De,
1730
+ VIDEO_PLAYER_DEFAULTS: F,
1731
+ DefaultImage: ve,
1732
+ convertSrtToVtt: Ee,
1733
+ isSrtSubtitleSource: $e,
1734
+ parseWebVttToCues: ze
1735
+ });
1736
+ function Un(t) {
1737
+ const [, e] = t;
1738
+ return e !== void 0;
1739
+ }
1740
+ export {
1741
+ F as VIDEO_PLAYER_DEFAULTS,
1742
+ Ee as VideeoPlayerConvertSrtToVtt,
1743
+ ze as VideeoPlayerParseWebVttToCues,
1744
+ Qn as VideoPlayer,
1745
+ Ee as convertSrtToVtt,
1746
+ Oe as getHtmlVideoElementFromVideoJs,
1747
+ $e as isSrtSubtitleSource,
1748
+ ze as parseWebVttToCues,
1749
+ Ee as videeoPlayerConvertSrtToVtt,
1750
+ ze as videeoPlayerParseWebVttToCues
1751
+ };