@openrails/contentkit-ui 0.83.0 → 0.86.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.
Files changed (219) hide show
  1. package/README.md +18 -7
  2. package/dist/client/beacons.d.ts +18 -6
  3. package/dist/client/beacons.js +26 -11
  4. package/dist/client/beacons.js.map +1 -1
  5. package/dist/client/client.d.ts +3 -0
  6. package/dist/client/client.js +29 -27
  7. package/dist/client/client.js.map +1 -1
  8. package/dist/client/codes.d.ts +6 -1
  9. package/dist/client/codes.js +4 -1
  10. package/dist/client/codes.js.map +1 -1
  11. package/dist/client/content/moderation.d.ts +14 -2
  12. package/dist/client/content/moderation.js +34 -0
  13. package/dist/client/content/moderation.js.map +1 -1
  14. package/dist/client/content/types.d.ts +13 -0
  15. package/dist/client/content/types.js.map +1 -1
  16. package/dist/client/discovery.d.ts +6 -0
  17. package/dist/client/discovery.js.map +1 -1
  18. package/dist/client/generated/error-codes.d.ts +1 -1
  19. package/dist/client/generated/error-codes.js +9 -1
  20. package/dist/client/generated/error-codes.js.map +1 -1
  21. package/dist/client/generated/routes.d.ts +91 -13
  22. package/dist/client/generated/routes.js +123 -2
  23. package/dist/client/generated/routes.js.map +1 -1
  24. package/dist/client/generated/wire.d.ts +81 -0
  25. package/dist/client/generated/wire.js.map +1 -1
  26. package/dist/client/index.d.ts +4 -2
  27. package/dist/client/media/queue.d.ts +4 -2
  28. package/dist/client/media/queue.js +18 -12
  29. package/dist/client/media/queue.js.map +1 -1
  30. package/dist/client/media/rules.d.ts +7 -1
  31. package/dist/client/media/rules.js +27 -21
  32. package/dist/client/media/rules.js.map +1 -1
  33. package/dist/client/reader-meta.d.ts +27 -0
  34. package/dist/client/reader-meta.js +99 -0
  35. package/dist/client/reader-meta.js.map +1 -0
  36. package/dist/client/stats.d.ts +32 -0
  37. package/dist/client/stats.js +35 -0
  38. package/dist/client/stats.js.map +1 -0
  39. package/dist/client/versions.d.ts +1 -1
  40. package/dist/client/versions.js +7 -2
  41. package/dist/client/versions.js.map +1 -1
  42. package/dist/client.js +30 -28
  43. package/dist/components/admin/content-manager.js +206 -206
  44. package/dist/components/admin/content-manager.js.map +1 -1
  45. package/dist/components/admin/group-manager.js +71 -70
  46. package/dist/components/admin/group-manager.js.map +1 -1
  47. package/dist/components/admin/media-item-panel.d.ts +24 -7
  48. package/dist/components/admin/media-item-panel.js +209 -197
  49. package/dist/components/admin/media-item-panel.js.map +1 -1
  50. package/dist/components/admin/poll-manager.js +25 -25
  51. package/dist/components/admin/reader-manifest.d.ts +18 -0
  52. package/dist/components/admin/reader-manifest.js +490 -0
  53. package/dist/components/admin/reader-manifest.js.map +1 -0
  54. package/dist/components/admin/stats-dashboard.d.ts +22 -0
  55. package/dist/components/admin/stats-dashboard.js +257 -0
  56. package/dist/components/admin/stats-dashboard.js.map +1 -0
  57. package/dist/components/content/card.js +43 -43
  58. package/dist/components/content/card.js.map +1 -1
  59. package/dist/components/content/editors.d.ts +2 -1
  60. package/dist/components/content/editors.js +479 -416
  61. package/dist/components/content/editors.js.map +1 -1
  62. package/dist/components/content/grid.js +47 -47
  63. package/dist/components/content/index.d.ts +2 -1
  64. package/dist/components/content/listing.js +34 -34
  65. package/dist/components/content/listing.js.map +1 -1
  66. package/dist/components/content/paywall.d.ts +17 -5
  67. package/dist/components/content/paywall.js +115 -100
  68. package/dist/components/content/paywall.js.map +1 -1
  69. package/dist/components/content/reader-stats.d.ts +12 -0
  70. package/dist/components/content/reader-stats.js +47 -0
  71. package/dist/components/content/reader-stats.js.map +1 -0
  72. package/dist/components/groups/banner.d.ts +1 -1
  73. package/dist/components/groups/banner.js +34 -34
  74. package/dist/components/groups/banner.js.map +1 -1
  75. package/dist/components/groups/directory.js +11 -11
  76. package/dist/components/groups/editor.js +294 -294
  77. package/dist/components/groups/editor.js.map +1 -1
  78. package/dist/components/groups/header.js +27 -27
  79. package/dist/components/groups/header.js.map +1 -1
  80. package/dist/components/groups/memberships.js +180 -180
  81. package/dist/components/groups/parts.d.ts +2 -4
  82. package/dist/components/groups/parts.js +69 -88
  83. package/dist/components/groups/parts.js.map +1 -1
  84. package/dist/components/media-folder-editor.js +239 -189
  85. package/dist/components/media-folder-editor.js.map +1 -1
  86. package/dist/components/notifications.js +17 -17
  87. package/dist/components/slot-upload.d.ts +2 -2
  88. package/dist/components/slot-upload.js +84 -79
  89. package/dist/components/slot-upload.js.map +1 -1
  90. package/dist/components/social/bans.js +34 -34
  91. package/dist/components/social/comments.js +59 -45
  92. package/dist/components/social/comments.js.map +1 -1
  93. package/dist/components/social/index.d.ts +1 -0
  94. package/dist/components/social/moderation.d.ts +5 -4
  95. package/dist/components/social/moderation.js +177 -160
  96. package/dist/components/social/moderation.js.map +1 -1
  97. package/dist/components/social/parts.js +22 -14
  98. package/dist/components/social/parts.js.map +1 -1
  99. package/dist/components/social/rules.d.ts +23 -0
  100. package/dist/components/social/rules.js +261 -0
  101. package/dist/components/social/rules.js.map +1 -0
  102. package/dist/components/video-player.d.ts +2 -0
  103. package/dist/components/video-player.js +318 -314
  104. package/dist/components/video-player.js.map +1 -1
  105. package/dist/i18n/context.d.ts +2 -0
  106. package/dist/i18n/context.js +23 -5
  107. package/dist/i18n/context.js.map +1 -1
  108. package/dist/index.d.ts +3 -1
  109. package/dist/index.js +28 -24
  110. package/dist/locales/admin/de.js +105 -0
  111. package/dist/locales/admin/de.js.map +1 -1
  112. package/dist/locales/admin/en.d.ts +105 -0
  113. package/dist/locales/admin/en.js +105 -0
  114. package/dist/locales/admin/en.js.map +1 -1
  115. package/dist/locales/admin/es.js +105 -0
  116. package/dist/locales/admin/es.js.map +1 -1
  117. package/dist/locales/admin/ja.js +105 -0
  118. package/dist/locales/admin/ja.js.map +1 -1
  119. package/dist/locales/admin/ko.js +105 -0
  120. package/dist/locales/admin/ko.js.map +1 -1
  121. package/dist/locales/admin/zh.js +105 -0
  122. package/dist/locales/admin/zh.js.map +1 -1
  123. package/dist/locales/content/de.js +6 -0
  124. package/dist/locales/content/de.js.map +1 -1
  125. package/dist/locales/content/en.d.ts +6 -0
  126. package/dist/locales/content/en.js +6 -0
  127. package/dist/locales/content/en.js.map +1 -1
  128. package/dist/locales/content/es.js +6 -0
  129. package/dist/locales/content/es.js.map +1 -1
  130. package/dist/locales/content/ja.js +6 -0
  131. package/dist/locales/content/ja.js.map +1 -1
  132. package/dist/locales/content/ko.js +6 -0
  133. package/dist/locales/content/ko.js.map +1 -1
  134. package/dist/locales/content/zh.js +6 -0
  135. package/dist/locales/content/zh.js.map +1 -1
  136. package/dist/locales/de.js +4 -1
  137. package/dist/locales/de.js.map +1 -1
  138. package/dist/locales/discovery/de.js +1 -0
  139. package/dist/locales/discovery/de.js.map +1 -1
  140. package/dist/locales/discovery/en.d.ts +1 -0
  141. package/dist/locales/discovery/en.js +1 -0
  142. package/dist/locales/discovery/en.js.map +1 -1
  143. package/dist/locales/discovery/es.js +1 -0
  144. package/dist/locales/discovery/es.js.map +1 -1
  145. package/dist/locales/discovery/ja.js +1 -0
  146. package/dist/locales/discovery/ja.js.map +1 -1
  147. package/dist/locales/discovery/ko.js +1 -0
  148. package/dist/locales/discovery/ko.js.map +1 -1
  149. package/dist/locales/discovery/zh.js +1 -0
  150. package/dist/locales/discovery/zh.js.map +1 -1
  151. package/dist/locales/en.d.ts +118 -0
  152. package/dist/locales/en.js +4 -1
  153. package/dist/locales/en.js.map +1 -1
  154. package/dist/locales/es.js +4 -1
  155. package/dist/locales/es.js.map +1 -1
  156. package/dist/locales/ja.js +4 -1
  157. package/dist/locales/ja.js.map +1 -1
  158. package/dist/locales/ko.js +4 -1
  159. package/dist/locales/ko.js.map +1 -1
  160. package/dist/locales/social/de.js +3 -0
  161. package/dist/locales/social/de.js.map +1 -1
  162. package/dist/locales/social/en.d.ts +3 -0
  163. package/dist/locales/social/en.js +3 -0
  164. package/dist/locales/social/en.js.map +1 -1
  165. package/dist/locales/social/es.js +3 -0
  166. package/dist/locales/social/es.js.map +1 -1
  167. package/dist/locales/social/ja.js +3 -0
  168. package/dist/locales/social/ja.js.map +1 -1
  169. package/dist/locales/social/ko.js +3 -0
  170. package/dist/locales/social/ko.js.map +1 -1
  171. package/dist/locales/social/zh.js +3 -0
  172. package/dist/locales/social/zh.js.map +1 -1
  173. package/dist/locales/zh.js +4 -1
  174. package/dist/locales/zh.js.map +1 -1
  175. package/dist/react/admin.d.ts +1 -1
  176. package/dist/react/admin.js +24 -23
  177. package/dist/react/admin.js.map +1 -1
  178. package/dist/react/canonical.d.ts +4 -3
  179. package/dist/react/canonical.js +34 -33
  180. package/dist/react/canonical.js.map +1 -1
  181. package/dist/react/comments.d.ts +29 -1
  182. package/dist/react/comments.js +30 -2
  183. package/dist/react/comments.js.map +1 -1
  184. package/dist/react/contents.js +144 -144
  185. package/dist/react/contents.js.map +1 -1
  186. package/dist/react/context.d.ts +1 -1
  187. package/dist/react/context.js.map +1 -1
  188. package/dist/react/detail.d.ts +12 -6
  189. package/dist/react/detail.js +31 -24
  190. package/dist/react/detail.js.map +1 -1
  191. package/dist/react/discovery.js +1 -1
  192. package/dist/react/discovery.js.map +1 -1
  193. package/dist/react/folder.d.ts +7 -2
  194. package/dist/react/folder.js +165 -147
  195. package/dist/react/folder.js.map +1 -1
  196. package/dist/react/groups.d.ts +0 -1
  197. package/dist/react/groups.js +13 -12
  198. package/dist/react/groups.js.map +1 -1
  199. package/dist/react/index.d.ts +5 -3
  200. package/dist/react/location.d.ts +11 -0
  201. package/dist/react/location.js +18 -0
  202. package/dist/react/location.js.map +1 -0
  203. package/dist/react/public.d.ts +8 -0
  204. package/dist/react/public.js +32 -27
  205. package/dist/react/public.js.map +1 -1
  206. package/dist/react/resources.js +6 -0
  207. package/dist/react/resources.js.map +1 -1
  208. package/dist/react/stats.d.ts +24 -0
  209. package/dist/react/stats.js +28 -0
  210. package/dist/react/stats.js.map +1 -0
  211. package/dist/react/use-resource.js +8 -7
  212. package/dist/react/use-resource.js.map +1 -1
  213. package/dist/react/versions.js +20 -20
  214. package/dist/react.js +26 -24
  215. package/dist/styles.css +1 -1
  216. package/dist/urls/index.d.ts +35 -10
  217. package/dist/urls.js +100 -70
  218. package/dist/urls.js.map +1 -1
  219. package/package.json +1 -1
@@ -1,23 +1,23 @@
1
1
  import { useInlinePreview as e } from "../react/inline-preview.js";
2
2
  import { RenditionImg as t } from "./rendition-img.js";
3
3
  import { publicRenditions as n } from "../client/public.js";
4
- import { useMessages as r } from "../i18n/context.js";
5
- import { ContentKitUiRoot as i } from "../scope.js";
6
- import { EncodeProgress as a } from "./encode-progress.js";
4
+ import { useLanguageName as r, useMessages as i } from "../i18n/context.js";
5
+ import { ContentKitUiRoot as a } from "../scope.js";
6
+ import { EncodeProgress as ee } from "./encode-progress.js";
7
7
  import { Button as o } from "../ui/button.js";
8
- import { formatDuration as ee } from "../client/gallery.js";
9
- import { PLAYBACK_SPEEDS as te, PLAYER_VOLUME_KEY as ne, nextSpeed as re, playerKeyAction as ie, resumeAt as ae, writeVolume as oe } from "../client/player.js";
10
- import { useHlsPlayer as se } from "../react/gallery.js";
11
- import { useActiveCues as ce, useFullscreen as le, useMediaState as ue, usePictureInPicture as de, useProgressReports as fe, useSprite as pe } from "../react/player.js";
12
- import { Captions as me, ControlButton as s, SeekBar as he, SeekFlash as ge, SettingsMenu as _e, Spinner as ve, VolumeControl as ye, clock as be } from "./player-controls.js";
8
+ import { formatDuration as te } from "../client/gallery.js";
9
+ import { PLAYBACK_SPEEDS as ne, PLAYER_VOLUME_KEY as re, nextSpeed as ie, playerKeyAction as ae, resumeAt as oe, writeVolume as se } from "../client/player.js";
10
+ import { useHlsPlayer as ce } from "../react/gallery.js";
11
+ import { useActiveCues as le, useFullscreen as ue, useMediaState as de, usePictureInPicture as fe, useProgressReports as pe, useSprite as me } from "../react/player.js";
12
+ import { Captions as he, ControlButton as s, SeekBar as ge, SeekFlash as _e, SettingsMenu as ve, Spinner as ye, VolumeControl as be, clock as xe } from "./player-controls.js";
13
13
  import { useCallback as c, useEffect as l, useRef as u, useState as d } from "react";
14
- import { Fragment as xe, jsx as f, jsxs as p } from "react/jsx-runtime";
14
+ import { Fragment as Se, jsx as f, jsxs as p } from "react/jsx-runtime";
15
15
  import { cn as m } from "cn";
16
- import { AlertCircleIcon as h, ArrowShrink02Icon as Se, ClosedCaptionIcon as Ce, FullScreenIcon as we, PauseIcon as Te, PictureInPicture01Icon as Ee, PictureInPictureExitIcon as De, PictureInPictureOnIcon as Oe, PlayIcon as ke, RectangularIcon as Ae, Refresh01Icon as g, Settings01Icon as je } from "@hugeicons/core-free-icons";
17
- import { HugeiconsIcon as _ } from "@hugeicons/react";
16
+ import { AlertCircleIcon as h, ArrowShrink02Icon as Ce, ClosedCaptionIcon as we, FullScreenIcon as Te, PauseIcon as Ee, PictureInPicture01Icon as De, PictureInPictureExitIcon as Oe, PictureInPictureOnIcon as ke, PlayIcon as Ae, RectangularIcon as je, Refresh01Icon as Me, Settings01Icon as Ne } from "@hugeicons/core-free-icons";
17
+ import { HugeiconsIcon as g } from "@hugeicons/react";
18
18
  //#region src/components/video-player.tsx
19
- function Me({ vtt: e, xhrSetup: t, fit: n = "contain", className: r }) {
20
- let i = pe(e, t), a = i?.cues[0];
19
+ function Pe({ vtt: e, xhrSetup: t, fit: n = "contain", className: r }) {
20
+ let i = me(e, t), a = i?.cues[0];
21
21
  return !i || !a ? null : /* @__PURE__ */ f("svg", {
22
22
  "aria-hidden": !0,
23
23
  className: m("pointer-events-none absolute inset-0 size-full", r),
@@ -31,328 +31,332 @@ function Me({ vtt: e, xhrSetup: t, fit: n = "contain", className: r }) {
31
31
  })
32
32
  });
33
33
  }
34
- var Ne = 2500, Pe = 300, Fe = 700, Ie = 650, v = "textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=textbox], [role=combobox], [role=searchbox], input:not([type=range]):not([type=button]):not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=reset])", y = "[role=menu], [role=menuitem], [role=menuitemradio], [role=menuitemcheckbox], [role=listbox], [role=option]", b = "a, button, input, [role=button], [role=dialog], [role=alertdialog]";
35
- function Le(e, t, n) {
36
- return e instanceof Element ? e.closest(v) || e.closest(y) || e.closest("input[type=range], [role=slider]") && /^(Arrow|Page|Home$|End$)/.test(t) ? !1 : n.contains(e) || !e.closest(b) : !0;
34
+ var Fe = 2500, Ie = 300, Le = 700, Re = 650, _ = "textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=textbox], [role=combobox], [role=searchbox], input:not([type=range]):not([type=button]):not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=reset])", v = "[role=menu], [role=menuitem], [role=menuitemradio], [role=menuitemcheckbox], [role=listbox], [role=option]", y = "a, button, input, [role=button], [role=dialog], [role=alertdialog]";
35
+ function ze(e, t) {
36
+ let n = e.lang && (!e.label || e.label.toLowerCase() === e.lang.toLowerCase()) ? e.lang : void 0;
37
+ return n ? t(n) : e.label;
37
38
  }
38
- var Re = (e, t) => e instanceof Element && t.contains(e) && !!e.closest("button") && !e.closest(y);
39
- function x({ base: o, poster: h, width: v, height: y, duration: b, pending: x, progress: We, failed: S, layout: Ge = "frame", maxHeight: Ke = "80svh", inlinePreview: qe, previewStart: Je, keyboard: C = "focus", onProgress: Ye, progressInterval: Xe = 1e4, onEvent: Ze, theater: w, onTheaterChange: Qe, onMiniPlayer: T, renderDownloads: $e, menuItems: et, crossOrigin: tt, label: nt, className: rt, style: it, appearance: at, startAt: ot, ...E }) {
40
- let { t: D } = r(), st = !!o && !x && !S, ct = st ? `${o}master.m3u8` : null, O = ae(ot, b), k = se({
41
- ...E,
42
- src: ct,
43
- startAt: O
44
- }), { status: A, error: j, started: M, previewing: N, audio: P, subtitles: F, quality: I } = k, [L, lt] = d(null), [R, ut] = d(null), dt = k.ref, ft = c((e) => {
45
- dt(e), ut(e);
46
- }, [dt]);
39
+ function Be(e, t, n) {
40
+ return e instanceof Element ? e.closest(_) || e.closest(v) || e.closest("input[type=range], [role=slider]") && /^(Arrow|Page|Home$|End$)/.test(t) ? !1 : n.contains(e) || !e.closest(y) : !0;
41
+ }
42
+ var Ve = (e, t) => e instanceof Element && t.contains(e) && !!e.closest("button") && !e.closest(v);
43
+ function b({ base: o, poster: h, width: _, height: v, duration: y, pending: b, progress: Ke, failed: S, layout: qe = "frame", maxHeight: Je = "80svh", inlinePreview: Ye, previewStart: Xe, keyboard: C = "focus", onProgress: Ze, progressInterval: Qe = 1e4, onEvent: $e, theater: w, onTheaterChange: T, onMiniPlayer: E, renderDownloads: et, menuItems: tt, crossOrigin: nt, label: rt, className: it, style: at, appearance: ot, startAt: st, ...D }) {
44
+ let { t: O } = i(), ct = r(), k = !!o && !b && !S, lt = k ? `${o}master.m3u8` : null, A = oe(st, y), j = ce({
45
+ ...D,
46
+ src: lt,
47
+ startAt: A
48
+ }), { status: M, error: N, started: P, previewing: F, audio: I, subtitles: L, quality: R } = j, [z, ut] = d(null), [B, dt] = d(null), ft = j.ref, pt = c((e) => {
49
+ ft(e), dt(e);
50
+ }, [ft]);
47
51
  e({
48
- setting: qe,
49
- available: st && !M && !j && E.active !== !1 && !E.autoPlay,
50
- target: L,
51
- playing: M && A === "playing",
52
- start: () => k.preview(Ve(Je, b)),
53
- stop: k.unload
52
+ setting: Ye,
53
+ available: k && !P && !N && D.active !== !1 && !D.autoPlay,
54
+ target: z,
55
+ playing: P && M === "playing",
56
+ start: () => j.preview(We(Xe, y)),
57
+ stop: j.unload
54
58
  });
55
- let z = ue(R), B = le(L, R), V = de(R), pt = ce(R), mt = pe(M && o ? `${o}sprite.vtt` : null, E.xhrSetup), H = !N && M;
56
- fe(R, {
57
- enabled: H,
58
- source: H ? ct : null,
59
- interval: Xe,
60
- onProgress: Ye
59
+ let V = de(B), H = ue(z, B), U = fe(B), mt = le(B), ht = me(P && o ? `${o}sprite.vtt` : null, D.xhrSetup), gt = !F && P;
60
+ pe(B, {
61
+ enabled: gt,
62
+ source: gt ? lt : null,
63
+ interval: Qe,
64
+ onProgress: Ze
61
65
  });
62
- let ht = u(Ze);
63
- ht.current = Ze;
64
- let gt = u(!1);
65
- gt.current = !N && A !== "idle";
66
- let U = c((e, t = !1) => {
67
- (t || gt.current) && ht.current && ht.current({
66
+ let _t = u($e);
67
+ _t.current = $e;
68
+ let vt = u(!1);
69
+ vt.current = !F && M !== "idle";
70
+ let W = c((e, t = !1) => {
71
+ (t || vt.current) && _t.current && _t.current({
68
72
  ...e,
69
- time: R?.currentTime ?? 0
73
+ time: B?.currentTime ?? 0
70
74
  });
71
- }, [R]);
75
+ }, [B]);
72
76
  l(() => {
73
- if (!R) return;
77
+ if (!B) return;
74
78
  let e = 0, t = {
75
- play: () => U({ type: "play" }),
76
- playing: () => U({ type: "playing" }),
77
- pause: () => !R.ended && U({ type: "pause" }),
78
- waiting: () => U({ type: "waiting" }),
79
- ended: () => U({ type: "ended" }),
79
+ play: () => W({ type: "play" }),
80
+ playing: () => W({ type: "playing" }),
81
+ pause: () => !B.ended && W({ type: "pause" }),
82
+ waiting: () => W({ type: "waiting" }),
83
+ ended: () => W({ type: "ended" }),
80
84
  timeupdate: () => {
81
- R.seeking || (e = R.currentTime);
85
+ B.seeking || (e = B.currentTime);
82
86
  },
83
87
  seeked: () => {
84
- U({
88
+ W({
85
89
  type: "seek",
86
90
  from: e
87
- }), e = R.currentTime;
91
+ }), e = B.currentTime;
88
92
  },
89
- ratechange: () => U({
93
+ ratechange: () => W({
90
94
  type: "rate",
91
- rate: R.playbackRate
95
+ rate: B.playbackRate
92
96
  })
93
97
  };
94
- for (let [e, n] of Object.entries(t)) R.addEventListener(e, n);
98
+ for (let [e, n] of Object.entries(t)) B.addEventListener(e, n);
95
99
  return () => {
96
- for (let [e, n] of Object.entries(t)) R.removeEventListener(e, n);
100
+ for (let [e, n] of Object.entries(t)) B.removeEventListener(e, n);
97
101
  };
98
- }, [R, U]), l(() => {
99
- j && !N && U({
102
+ }, [B, W]), l(() => {
103
+ N && !F && W({
100
104
  type: "error",
101
- error: j
105
+ error: N
102
106
  }, !0);
103
107
  }, [
104
- j,
105
108
  N,
106
- U
109
+ F,
110
+ W
107
111
  ]);
108
- let _t = u({
112
+ let yt = u({
109
113
  fs: !1,
110
114
  pip: !1
111
115
  });
112
116
  l(() => {
113
- _t.current.fs !== B.active && U({
117
+ yt.current.fs !== H.active && W({
114
118
  type: "fullscreen",
115
- on: B.active
116
- }), _t.current.pip !== V.active && U({
119
+ on: H.active
120
+ }), yt.current.pip !== U.active && W({
117
121
  type: "pip",
118
- on: V.active
119
- }), _t.current = {
120
- fs: B.active,
121
- pip: V.active
122
+ on: U.active
123
+ }), yt.current = {
124
+ fs: H.active,
125
+ pip: U.active
122
126
  };
123
127
  }, [
124
- B.active,
125
- V.active,
126
- U
128
+ H.active,
129
+ U.active,
130
+ W
127
131
  ]);
128
- let vt = u(O);
132
+ let bt = u(A);
129
133
  l(() => {
130
- vt.current !== O && (vt.current = O, R && M && (R.currentTime = O));
134
+ bt.current !== A && (bt.current = A, B && P && (B.currentTime = A));
131
135
  }, [
132
- O,
133
- R,
134
- M
136
+ A,
137
+ B,
138
+ P
135
139
  ]);
136
- let [yt, W] = d(!1), G = u(void 0), K = c(() => {
137
- W(!0), clearTimeout(G.current), G.current = setTimeout(() => W(!1), Ne);
138
- }, []), bt = c(() => {
139
- clearTimeout(G.current), W(!1);
140
+ let [xt, St] = d(!1), G = u(void 0), K = c(() => {
141
+ St(!0), clearTimeout(G.current), G.current = setTimeout(() => St(!1), Fe);
142
+ }, []), Ct = c(() => {
143
+ clearTimeout(G.current), St(!1);
140
144
  }, []);
141
145
  l(() => () => clearTimeout(G.current), []), l(() => {
142
- M && K();
143
- }, [M, K]);
144
- let [xt, St] = d(!1), [Ct, wt] = d(!1), [Tt, Et] = d(!1), q = M && !j && (yt || z.paused || z.ended || xt || Ct || Tt), [Dt, Ot] = d(null), J = u(void 0), kt = c((e, t) => {
146
+ P && K();
147
+ }, [P, K]);
148
+ let [wt, Tt] = d(!1), [Et, Dt] = d(!1), [Ot, kt] = d(!1), q = P && !N && (xt || V.paused || V.ended || wt || Et || Ot), [At, jt] = d(null), J = u(void 0), Mt = c((e, t) => {
145
149
  let n = J.current !== void 0;
146
- clearTimeout(J.current), Ot((r) => ({
150
+ clearTimeout(J.current), jt((r) => ({
147
151
  direction: e,
148
152
  seconds: n && r?.direction === e ? r.seconds + t : t
149
153
  })), J.current = setTimeout(() => {
150
- Ot(null), J.current = void 0;
151
- }, Ie);
154
+ jt(null), J.current = void 0;
155
+ }, Re);
152
156
  }, []);
153
157
  l(() => () => clearTimeout(J.current), []);
154
- let At = E.volumeKey === void 0 ? ne : E.volumeKey, Y = z.duration || b || 0, jt = (e) => {
155
- R && (R.currentTime = Math.min(Y || e, Math.max(0, e)));
156
- }, Mt = (e) => {
157
- R && (jt(R.currentTime + e), kt(e < 0 ? -1 : 1, Math.abs(e)));
158
+ let Nt = D.volumeKey === void 0 ? re : D.volumeKey, Y = V.duration || y || 0, Pt = (e) => {
159
+ B && (B.currentTime = Math.min(Y || e, Math.max(0, e)));
160
+ }, Ft = (e) => {
161
+ B && (Pt(B.currentTime + e), Mt(e < 0 ? -1 : 1, Math.abs(e)));
158
162
  }, X = () => {
159
- R && (!M || R.ended ? (R.ended && (R.currentTime = 0), k.play()) : R.paused ? k.play() : R.pause());
160
- }, Nt = (e) => {
161
- R && (R.volume = Math.min(1, Math.max(0, e)), R.volume > 0 && R.muted && (R.muted = !1), oe(At, {
162
- volume: R.volume,
163
- muted: R.muted
164
- }), U({
163
+ B && (!P || B.ended ? (B.ended && (B.currentTime = 0), j.play()) : B.paused ? j.play() : B.pause());
164
+ }, It = (e) => {
165
+ B && (B.volume = Math.min(1, Math.max(0, e)), B.volume > 0 && B.muted && (B.muted = !1), se(Nt, {
166
+ volume: B.volume,
167
+ muted: B.muted
168
+ }), W({
165
169
  type: "volume",
166
- volume: R.volume,
167
- muted: R.muted
170
+ volume: B.volume,
171
+ muted: B.muted
168
172
  }));
169
- }, Pt = () => {
170
- R && (R.muted = !R.muted, !R.muted && R.volume === 0 && (R.volume = 1), oe(At, {
171
- volume: R.volume,
172
- muted: R.muted
173
- }), U({
173
+ }, Lt = () => {
174
+ B && (B.muted = !B.muted, !B.muted && B.volume === 0 && (B.volume = 1), se(Nt, {
175
+ volume: B.volume,
176
+ muted: B.muted
177
+ }), W({
174
178
  type: "volume",
175
- volume: R.volume,
176
- muted: R.muted
179
+ volume: B.volume,
180
+ muted: B.muted
177
181
  }));
178
- }, Ft = (e) => {
179
- P.select(e);
180
- let t = P.list[e];
181
- t && U({
182
+ }, Rt = (e) => {
183
+ I.select(e);
184
+ let t = I.list[e];
185
+ t && W({
182
186
  type: "audio",
183
187
  track: t
184
188
  });
185
- }, It = u(-1);
186
- F.selected >= 0 && (It.current = F.selected);
187
- let Lt = (e) => {
188
- F.select(e), U({
189
+ }, zt = u(-1);
190
+ L.selected >= 0 && (zt.current = L.selected);
191
+ let Bt = (e) => {
192
+ L.select(e), W({
189
193
  type: "subtitles",
190
- track: F.list[e] ?? null
194
+ track: L.list[e] ?? null
191
195
  });
192
- }, Rt = () => Lt(F.selected >= 0 ? -1 : It.current >= 0 ? It.current : 0), zt = (e) => {
193
- I.select(e), U({
196
+ }, Vt = () => Bt(L.selected >= 0 ? -1 : zt.current >= 0 ? zt.current : 0), Ht = (e) => {
197
+ R.select(e), W({
194
198
  type: "quality",
195
- height: I.levels.find((t) => t.index === e)?.height ?? null
199
+ height: R.levels.find((t) => t.index === e)?.height ?? null
196
200
  });
197
- }, Bt = () => {
198
- Qe?.(!w), U({
201
+ }, Ut = () => {
202
+ T?.(!w), W({
199
203
  type: "theater",
200
204
  on: !w
201
205
  });
202
- }, Vt = () => {
203
- if (!T || !o || !R) return;
204
- let e = P.list[P.selected], t = F.list[F.selected], n = {
206
+ }, Wt = () => {
207
+ if (!E || !o || !B) return;
208
+ let e = I.list[I.selected], t = L.list[L.selected], n = {
205
209
  base: o,
206
- time: R.currentTime,
207
- playing: !R.paused && !R.ended,
208
- width: v ?? (R.videoWidth || void 0),
209
- height: y ?? (R.videoHeight || void 0),
210
+ time: B.currentTime,
211
+ playing: !B.paused && !B.ended,
212
+ width: _ ?? (B.videoWidth || void 0),
213
+ height: v ?? (B.videoHeight || void 0),
210
214
  duration: Y || void 0,
211
215
  poster: h,
212
216
  audioLanguage: e?.lang,
213
217
  subtitleLanguage: t?.lang ?? null
214
218
  };
215
- R.pause(), B.active && B.toggle(), T(n);
216
- }, Ht = (e) => {
217
- if (!R || !M && e.type !== "toggle") return !1;
219
+ B.pause(), H.active && H.toggle(), E(n);
220
+ }, Gt = (e) => {
221
+ if (!B || !P && e.type !== "toggle") return !1;
218
222
  switch (e.type) {
219
223
  case "toggle":
220
224
  X();
221
225
  break;
222
226
  case "seekBy":
223
- Mt(e.seconds);
227
+ Ft(e.seconds);
224
228
  break;
225
229
  case "seekTo":
226
230
  if (!Y) return !1;
227
- jt(Y * e.fraction);
231
+ Pt(Y * e.fraction);
228
232
  break;
229
233
  case "volumeBy":
230
- Nt((R.muted ? 0 : R.volume) + e.delta);
234
+ It((B.muted ? 0 : B.volume) + e.delta);
231
235
  break;
232
236
  case "mute":
233
- Pt();
237
+ Lt();
234
238
  break;
235
239
  case "captions":
236
- if (!F.list.length) return !1;
237
- Rt();
240
+ if (!L.list.length) return !1;
241
+ Vt();
238
242
  break;
239
243
  case "fullscreen":
240
- if (!B.supported) return !1;
241
- B.toggle();
244
+ if (!H.supported) return !1;
245
+ H.toggle();
242
246
  break;
243
247
  case "theater":
244
- if (!Qe) return !1;
245
- Bt();
248
+ if (!T) return !1;
249
+ Ut();
246
250
  break;
247
251
  case "miniPlayer":
248
- if (!T) return !1;
249
- Vt();
252
+ if (!E) return !1;
253
+ Wt();
250
254
  break;
251
- case "speed": R.playbackRate = re(R.playbackRate, e.step);
255
+ case "speed": B.playbackRate = ie(B.playbackRate, e.step);
252
256
  }
253
- return M && K(), !0;
254
- }, Ut = u(Ht);
255
- Ut.current = Ht;
256
- let Wt = E.active !== !1;
257
+ return P && K(), !0;
258
+ }, Kt = u(Gt);
259
+ Kt.current = Gt;
260
+ let qt = D.active !== !1;
257
261
  l(() => {
258
- if (!C || !L || !Wt) return;
259
- let e = C === "global" ? document : L, t = (e) => {
262
+ if (!C || !z || !qt) return;
263
+ let e = C === "global" ? document : z, t = (e) => {
260
264
  let t = e;
261
265
  if (t.defaultPrevented) return;
262
- let n = ie(t);
263
- n && Le(t.target, t.key, L) && Ut.current(n) && t.preventDefault();
266
+ let n = ae(t);
267
+ n && Be(t.target, t.key, z) && Kt.current(n) && t.preventDefault();
264
268
  }, n = (e) => {
265
269
  let t = e;
266
- t.key === " " && Re(t.target, L) && t.preventDefault();
270
+ t.key === " " && Ve(t.target, z) && t.preventDefault();
267
271
  };
268
272
  return e.addEventListener("keydown", t), e.addEventListener("keyup", n), () => {
269
273
  e.removeEventListener("keydown", t), e.removeEventListener("keyup", n);
270
274
  };
271
275
  }, [
272
276
  C,
273
- L,
274
- Wt
277
+ z,
278
+ qt
275
279
  ]);
276
- let Gt = u("mouse"), Kt = u(null), Z = u(0), qt = (e) => {
277
- if (Gt.current === "mouse") {
280
+ let Jt = u("mouse"), Yt = u(null), Z = u(0), Xt = (e) => {
281
+ if (Jt.current === "mouse") {
278
282
  X(), K();
279
283
  return;
280
284
  }
281
- let t = e.currentTarget.getBoundingClientRect(), n = t.width ? (e.clientX - t.left) / t.width : .5, r = n < .4 ? -1 : n > .6 ? 1 : null, i = Date.now(), a = Kt.current;
282
- if (Kt.current = r ? {
285
+ let t = e.currentTarget.getBoundingClientRect(), n = t.width ? (e.clientX - t.left) / t.width : .5, r = n < .4 ? -1 : n > .6 ? 1 : null, i = Date.now(), a = Yt.current;
286
+ if (Yt.current = r ? {
283
287
  at: i,
284
288
  side: r
285
- } : null, r && a?.side === r && (i < Z.current || i - a.at <= Pe)) {
286
- Z.current = i + Fe, Mt(r * 10);
289
+ } : null, r && a?.side === r && (i < Z.current || i - a.at <= Ie)) {
290
+ Z.current = i + Le, Ft(r * 10);
287
291
  return;
288
292
  }
289
- q && !z.paused ? bt() : K();
290
- }, Jt = () => {
291
- Date.now() >= Z.current && B.supported && B.toggle();
292
- }, Yt = v && y ? v / y : z.aspect ?? 16 / 9, Xt = B.active ? {
293
+ q && !V.paused ? Ct() : K();
294
+ }, Zt = () => {
295
+ Date.now() >= Z.current && H.supported && H.toggle();
296
+ }, Qt = _ && v ? _ / v : V.aspect ?? 16 / 9, $t = H.active ? {
293
297
  width: "100%",
294
298
  height: "100%",
295
299
  borderRadius: 0
296
- } : Ge === "frame" ? {
297
- aspectRatio: String(Yt),
298
- width: `min(100%, calc(${Ke} * ${Yt}))`,
300
+ } : qe === "frame" ? {
301
+ aspectRatio: String(Qt),
302
+ width: `min(100%, calc(${Je} * ${Qt}))`,
299
303
  marginInline: "auto"
300
- } : {}, Zt = typeof h == "string" ? [] : n(h), Q = !j && !N && (A === "loading" || A === "buffering"), $ = m("transition-opacity duration-300 motion-reduce:transition-none", N && A === "playing" && "opacity-0"), Qt = B.active && L ? L : void 0, $t = tn();
301
- function en(e) {
302
- let t = e.label || D("player.track", { number: e.index + 1 });
303
- return e.forced ? D("player.forced", { label: t }) : t;
304
+ } : {}, en = typeof h == "string" ? [] : n(h), Q = !N && !F && (M === "loading" || M === "buffering"), $ = m("transition-opacity duration-300 motion-reduce:transition-none", F && M === "playing" && "opacity-0"), tn = H.active && z ? z : void 0, nn = an();
305
+ function rn(e) {
306
+ let t = ze(e, ct) || O("player.track", { number: e.index + 1 });
307
+ return e.forced ? O("player.forced", { label: t }) : t;
304
308
  }
305
- function tn() {
309
+ function an() {
306
310
  let e = [];
307
- if (P.list.length > 1 && e.push({
311
+ if (I.list.length > 1 && e.push({
308
312
  key: "audio",
309
- label: D("player.audio"),
310
- value: String(P.selected),
311
- options: P.list.map((e) => ({
313
+ label: O("player.audio"),
314
+ value: String(I.selected),
315
+ options: I.list.map((e) => ({
312
316
  value: String(e.index),
313
- label: en(e)
317
+ label: rn(e)
314
318
  })),
315
- onChange: (e) => Ft(Number(e))
316
- }), F.list.length && e.push({
319
+ onChange: (e) => Rt(Number(e))
320
+ }), L.list.length && e.push({
317
321
  key: "subtitles",
318
- label: D("player.subtitles"),
319
- value: String(F.selected),
322
+ label: O("player.subtitles"),
323
+ value: String(L.selected),
320
324
  options: [{
321
325
  value: "-1",
322
- label: D("player.subtitlesOff")
323
- }, ...F.list.map((e) => ({
326
+ label: O("player.subtitlesOff")
327
+ }, ...L.list.map((e) => ({
324
328
  value: String(e.index),
325
- label: en(e)
329
+ label: rn(e)
326
330
  }))],
327
- onChange: (e) => Lt(Number(e))
328
- }), I.levels.length > 1) {
329
- let t = I.levels.find((e) => e.index === I.current);
331
+ onChange: (e) => Bt(Number(e))
332
+ }), R.levels.length > 1) {
333
+ let t = R.levels.find((e) => e.index === R.current);
330
334
  e.push({
331
335
  key: "quality",
332
- label: D("player.quality"),
333
- value: String(I.selected),
334
- options: [...[...I.levels].reverse().map((e) => ({
336
+ label: O("player.quality"),
337
+ value: String(R.selected),
338
+ options: [...[...R.levels].reverse().map((e) => ({
335
339
  value: String(e.index),
336
- label: He(e.height)
340
+ label: x(e.height)
337
341
  })), {
338
342
  value: "-1",
339
- label: t && I.selected === -1 ? D("player.autoCurrent", { quality: He(t.height).split(" ")[0] }) : D("player.auto")
343
+ label: t && R.selected === -1 ? O("player.autoCurrent", { quality: x(t.height).split(" ")[0] }) : O("player.auto")
340
344
  }],
341
- onChange: (e) => zt(Number(e))
345
+ onChange: (e) => Ht(Number(e))
342
346
  });
343
347
  }
344
348
  return e.push({
345
349
  key: "speed",
346
- label: D("player.speed"),
347
- value: String(z.rate),
348
- options: te.map((e) => ({
350
+ label: O("player.speed"),
351
+ value: String(V.rate),
352
+ options: ne.map((e) => ({
349
353
  value: String(e),
350
- label: e === 1 ? D("player.normal") : `${e}×`
354
+ label: e === 1 ? O("player.normal") : `${e}×`
351
355
  })),
352
356
  onChange: (e) => {
353
- R && (R.playbackRate = Number(e));
357
+ B && (B.playbackRate = Number(e));
354
358
  }
355
- }), et?.forEach((t, n) => {
359
+ }), tt?.forEach((t, n) => {
356
360
  "options" in t && e.push({
357
361
  key: `host-${n}`,
358
362
  label: t.label,
@@ -362,189 +366,189 @@ function x({ base: o, poster: h, width: v, height: y, duration: b, pending: x, p
362
366
  });
363
367
  }), e;
364
368
  }
365
- let nn = et?.filter((e) => "onSelect" in e);
366
- return /* @__PURE__ */ f(i, {
367
- appearance: at,
368
- className: m("@container relative w-full touch-manipulation overflow-hidden bg-black text-white outline-none", Ge === "fill" ? "size-full" : !B.active && "rounded-lg", M && !q && "cursor-none", rt),
369
+ let on = tt?.filter((e) => "onSelect" in e);
370
+ return /* @__PURE__ */ f(a, {
371
+ appearance: ot,
372
+ className: m("@container relative w-full touch-manipulation overflow-hidden bg-black text-white outline-none", qe === "fill" ? "size-full" : !H.active && "rounded-lg", P && !q && "cursor-none", it),
369
373
  style: {
370
- ...Xt,
371
- ...it
374
+ ...$t,
375
+ ...at
372
376
  },
373
377
  "data-ckui": "video-player",
374
- "data-status": S ? "failed" : x ? "pending" : A,
375
- "data-previewing": N ? "" : void 0,
376
- "data-fullscreen": B.active ? "" : void 0,
378
+ "data-status": S ? "failed" : b ? "pending" : M,
379
+ "data-previewing": F ? "" : void 0,
380
+ "data-fullscreen": H.active ? "" : void 0,
377
381
  "data-controls": q ? "" : void 0,
378
- ref: lt,
382
+ ref: ut,
379
383
  role: "group",
380
- "aria-label": nt ?? D("player.label"),
381
- tabIndex: st ? -1 : void 0,
382
- onPointerDown: (e) => Gt.current = e.pointerType || "mouse",
383
- onPointerMove: (e) => e.pointerType === "mouse" && M && K(),
384
- onPointerLeave: (e) => e.pointerType === "mouse" && !Ct && !xt && bt(),
385
- onFocus: (e) => Et(ze(e.target)),
386
- onBlur: () => Et(!1),
387
- children: S ? /* @__PURE__ */ f(Ue, {
384
+ "aria-label": rt ?? O("player.label"),
385
+ tabIndex: k ? -1 : void 0,
386
+ onPointerDown: (e) => Jt.current = e.pointerType || "mouse",
387
+ onPointerMove: (e) => e.pointerType === "mouse" && P && K(),
388
+ onPointerLeave: (e) => e.pointerType === "mouse" && !Et && !wt && Ct(),
389
+ onFocus: (e) => kt(He(e.target)),
390
+ onBlur: () => kt(!1),
391
+ children: S ? /* @__PURE__ */ f(Ge, {
388
392
  icon: !0,
389
- children: D("player.failed")
390
- }) : x || !o ? /* @__PURE__ */ f("div", {
393
+ children: O("player.failed")
394
+ }) : b || !o ? /* @__PURE__ */ f("div", {
391
395
  className: "absolute inset-0 flex items-center justify-center bg-muted p-6 text-foreground",
392
- children: /* @__PURE__ */ f(a, {
393
- progress: We,
396
+ children: /* @__PURE__ */ f(ee, {
397
+ progress: Ke,
394
398
  className: "max-w-xs"
395
399
  })
396
- }) : /* @__PURE__ */ p(xe, { children: [
400
+ }) : /* @__PURE__ */ p(Se, { children: [
397
401
  /* @__PURE__ */ f("video", {
398
- ref: ft,
402
+ ref: pt,
399
403
  className: "absolute inset-0 size-full object-contain",
400
404
  playsInline: !0,
401
405
  preload: "none",
402
- crossOrigin: tt,
403
- "aria-label": nt
406
+ crossOrigin: nt,
407
+ "aria-label": rt
404
408
  }),
405
- M && !j && /* @__PURE__ */ f("div", {
409
+ P && !N && /* @__PURE__ */ f("div", {
406
410
  "data-ckui": "surface",
407
411
  className: "absolute inset-0",
408
- onClick: qt,
409
- onDoubleClick: Jt
412
+ onClick: Xt,
413
+ onDoubleClick: Zt
410
414
  }),
411
- !M && !j && /* @__PURE__ */ p(xe, { children: [
415
+ !P && !N && /* @__PURE__ */ p(Se, { children: [
412
416
  typeof h == "string" ? /* @__PURE__ */ f("img", {
413
417
  alt: "",
414
418
  src: h,
415
419
  decoding: "async",
416
420
  className: m("pointer-events-none absolute inset-0 size-full object-contain", $)
417
- }) : Zt.length ? /* @__PURE__ */ f(t, {
418
- outputs: Zt,
421
+ }) : en.length ? /* @__PURE__ */ f(t, {
422
+ outputs: en,
419
423
  className: m("pointer-events-none absolute inset-0 size-full object-contain", $)
420
- }) : /* @__PURE__ */ f(Me, {
424
+ }) : /* @__PURE__ */ f(Pe, {
421
425
  vtt: `${o}sprite.vtt`,
422
- xhrSetup: E.xhrSetup,
426
+ xhrSetup: D.xhrSetup,
423
427
  className: $
424
428
  }),
425
- /* @__PURE__ */ f(Be, {
426
- label: D("player.play"),
427
- onClick: k.play,
429
+ /* @__PURE__ */ f(Ue, {
430
+ label: O("player.play"),
431
+ onClick: j.play,
428
432
  disabled: Q,
429
433
  className: $,
430
- children: Q ? /* @__PURE__ */ f(ve, {}) : /* @__PURE__ */ f(_, {
431
- icon: ke,
434
+ children: Q ? /* @__PURE__ */ f(ye, {}) : /* @__PURE__ */ f(g, {
435
+ icon: Ae,
432
436
  className: "ml-1 size-7 fill-current",
433
437
  strokeWidth: 1.5
434
438
  })
435
439
  }),
436
- b ? /* @__PURE__ */ f("span", {
440
+ y ? /* @__PURE__ */ f("span", {
437
441
  className: "pointer-events-none absolute right-2 bottom-2 rounded bg-black/65 px-1.5 py-0.5 text-xs font-medium tabular-nums",
438
- children: ee(b)
442
+ children: te(y)
439
443
  }) : null
440
444
  ] }),
441
- M && !j && z.ended && /* @__PURE__ */ f(Be, {
442
- label: D("player.replay"),
445
+ P && !N && V.ended && /* @__PURE__ */ f(Ue, {
446
+ label: O("player.replay"),
443
447
  onClick: X,
444
- children: /* @__PURE__ */ f(_, {
445
- icon: g,
448
+ children: /* @__PURE__ */ f(g, {
449
+ icon: Me,
446
450
  className: "size-7",
447
451
  strokeWidth: 1.75
448
452
  })
449
453
  }),
450
- /* @__PURE__ */ f(me, {
451
- cues: H ? pt : [],
454
+ /* @__PURE__ */ f(he, {
455
+ cues: gt ? mt : [],
452
456
  bottom: q ? "4.75rem" : "1.25rem"
453
457
  }),
454
- M && Q && /* @__PURE__ */ f("div", {
458
+ P && Q && /* @__PURE__ */ f("div", {
455
459
  className: "pointer-events-none absolute inset-0 flex items-center justify-center",
456
460
  children: /* @__PURE__ */ f("span", {
457
461
  className: "flex size-14 items-center justify-center rounded-full bg-black/45",
458
- children: /* @__PURE__ */ f(ve, {})
462
+ children: /* @__PURE__ */ f(ye, {})
459
463
  })
460
464
  }),
461
- /* @__PURE__ */ f(ge, { flash: Dt }),
462
- M && !j && /* @__PURE__ */ p("div", {
465
+ /* @__PURE__ */ f(_e, { flash: At }),
466
+ P && !N && /* @__PURE__ */ p("div", {
463
467
  "data-ckui": "controls",
464
468
  "data-ckui-noswipe": "",
465
469
  className: m("pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col bg-linear-to-t from-black/75 via-black/35 to-transparent px-2 pt-12 pb-1 transition-opacity duration-200 motion-reduce:transition-none", q ? "opacity-100 *:pointer-events-auto" : "opacity-0"),
466
- children: [/* @__PURE__ */ f(he, {
467
- time: z.time,
470
+ children: [/* @__PURE__ */ f(ge, {
471
+ time: V.time,
468
472
  duration: Y,
469
- buffered: z.buffered,
470
- onSeek: jt,
471
- onScrub: (e) => wt(e !== null),
472
- sprite: mt
473
+ buffered: V.buffered,
474
+ onSeek: Pt,
475
+ onScrub: (e) => Dt(e !== null),
476
+ sprite: ht
473
477
  }), /* @__PURE__ */ p("div", {
474
478
  className: "flex items-center gap-0.5",
475
479
  children: [
476
480
  /* @__PURE__ */ f(s, {
477
- label: z.ended ? D("player.replay") : z.paused ? D("player.resume") : D("player.pause"),
481
+ label: V.ended ? O("player.replay") : V.paused ? O("player.resume") : O("player.pause"),
478
482
  shortcut: "k",
479
- icon: z.ended ? g : z.paused ? ke : Te,
483
+ icon: V.ended ? Me : V.paused ? Ae : Ee,
480
484
  onClick: X,
481
485
  "data-ckui": "play"
482
486
  }),
483
- /* @__PURE__ */ f(ye, {
484
- volume: z.volume,
485
- muted: z.muted,
486
- onVolume: Nt,
487
- onMute: Pt
487
+ /* @__PURE__ */ f(be, {
488
+ volume: V.volume,
489
+ muted: V.muted,
490
+ onVolume: It,
491
+ onMute: Lt
488
492
  }),
489
493
  /* @__PURE__ */ p("span", {
490
494
  className: "ml-1 shrink-0 text-xs font-medium whitespace-nowrap text-white/90 tabular-nums",
491
495
  "data-ckui": "time",
492
496
  children: [
493
- be(z.time),
497
+ xe(V.time),
494
498
  " / ",
495
- be(Y)
499
+ xe(Y)
496
500
  ]
497
501
  }),
498
502
  /* @__PURE__ */ f("div", { className: "min-w-0 flex-1" }),
499
- F.list.length > 0 && /* @__PURE__ */ f(s, {
500
- label: D("player.subtitles"),
503
+ L.list.length > 0 && /* @__PURE__ */ f(s, {
504
+ label: O("player.subtitles"),
501
505
  shortcut: "c",
502
- icon: Ce,
503
- "aria-pressed": F.selected >= 0,
504
- onClick: Rt,
506
+ icon: we,
507
+ "aria-pressed": L.selected >= 0,
508
+ onClick: Vt,
505
509
  "data-ckui": "captions-toggle"
506
510
  }),
507
- $e?.({
508
- container: Qt,
511
+ et?.({
512
+ container: tn,
509
513
  className: "inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-white outline-none transition-colors hover:bg-white/15 focus-visible:ring-2 focus-visible:ring-white/80 motion-reduce:transition-none data-popup-open:bg-white/15 [&_svg]:size-5 relative aria-pressed:after:absolute aria-pressed:after:bottom-1 aria-pressed:after:h-0.5 aria-pressed:after:w-4 aria-pressed:after:rounded-full aria-pressed:after:bg-player-accent"
510
514
  }),
511
- /* @__PURE__ */ f(_e, {
512
- icon: je,
513
- label: D("player.settings"),
514
- sections: $t,
515
- actions: nn,
516
- container: Qt,
517
- onOpenChange: St
515
+ /* @__PURE__ */ f(ve, {
516
+ icon: Ne,
517
+ label: O("player.settings"),
518
+ sections: nn,
519
+ actions: on,
520
+ container: tn,
521
+ onOpenChange: Tt
518
522
  }),
519
- T && /* @__PURE__ */ f(s, {
523
+ E && /* @__PURE__ */ f(s, {
520
524
  className: "@max-sm:hidden",
521
- label: D("player.miniPlayer"),
525
+ label: O("player.miniPlayer"),
522
526
  shortcut: "i",
523
- icon: Oe,
524
- onClick: Vt,
527
+ icon: ke,
528
+ onClick: Wt,
525
529
  "data-ckui": "mini-player-open"
526
530
  }),
527
- V.supported && /* @__PURE__ */ f(s, {
531
+ U.supported && /* @__PURE__ */ f(s, {
528
532
  className: "@max-md:hidden",
529
- label: V.active ? D("player.exitPip") : D("player.pip"),
530
- icon: V.active ? De : Ee,
531
- onClick: V.toggle,
533
+ label: U.active ? O("player.exitPip") : O("player.pip"),
534
+ icon: U.active ? Oe : De,
535
+ onClick: U.toggle,
532
536
  "data-ckui": "pip"
533
537
  }),
534
- Qe && /* @__PURE__ */ f(s, {
538
+ T && /* @__PURE__ */ f(s, {
535
539
  className: "max-lg:hidden",
536
- label: D("player.theater"),
540
+ label: O("player.theater"),
537
541
  shortcut: "t",
538
- icon: Ae,
542
+ icon: je,
539
543
  "aria-pressed": !!w,
540
- onClick: Bt,
544
+ onClick: Ut,
541
545
  "data-ckui": "theater"
542
546
  }),
543
- B.supported && /* @__PURE__ */ f(s, {
544
- label: B.active ? D("player.exitFullscreen") : D("player.fullscreen"),
547
+ H.supported && /* @__PURE__ */ f(s, {
548
+ label: H.active ? O("player.exitFullscreen") : O("player.fullscreen"),
545
549
  shortcut: "f",
546
- icon: B.active ? Se : we,
547
- onClick: B.toggle,
550
+ icon: H.active ? Ce : Te,
551
+ onClick: H.toggle,
548
552
  "data-ckui": "fullscreen"
549
553
  })
550
554
  ]
@@ -553,25 +557,25 @@ function x({ base: o, poster: h, width: v, height: y, duration: b, pending: x, p
553
557
  /* @__PURE__ */ f("span", {
554
558
  className: "sr-only",
555
559
  "aria-live": "polite",
556
- children: Q ? D("player.loading") : ""
560
+ children: Q ? O("player.loading") : ""
557
561
  }),
558
- j && /* @__PURE__ */ f(Ue, {
562
+ N && /* @__PURE__ */ f(Ge, {
559
563
  icon: !0,
560
- code: j.code,
561
- onRetry: k.retry,
562
- children: D(`player.errors.${j.kind}`)
564
+ code: N.code,
565
+ onRetry: j.retry,
566
+ children: O(`player.errors.${N.kind}`)
563
567
  })
564
568
  ] })
565
569
  });
566
570
  }
567
- function ze(e) {
571
+ function He(e) {
568
572
  try {
569
573
  return e instanceof Element && e.matches(":focus-visible") && !!e.closest("[data-ckui=controls]");
570
574
  } catch {
571
575
  return !1;
572
576
  }
573
577
  }
574
- function Be({ label: e, onClick: t, disabled: n, className: r, children: i }) {
578
+ function Ue({ label: e, onClick: t, disabled: n, className: r, children: i }) {
575
579
  return /* @__PURE__ */ f("button", {
576
580
  type: "button",
577
581
  className: "absolute inset-0 z-[7] flex items-center justify-center outline-none focus-visible:[&>span]:ring-4 focus-visible:[&>span]:ring-white/60",
@@ -584,22 +588,22 @@ function Be({ label: e, onClick: t, disabled: n, className: r, children: i }) {
584
588
  })
585
589
  });
586
590
  }
587
- function Ve(e, t) {
591
+ function We(e, t) {
588
592
  let n = t ?? 0, r = e ?? n * .1;
589
593
  return Math.max(0, n > 1 ? Math.min(r, n - 1) : 0);
590
594
  }
591
- function He(e) {
595
+ function x(e) {
592
596
  return `${e}p${e >= 2160 ? " 4K" : e === 1080 ? " HD" : ""}`;
593
597
  }
594
- function Ue({ children: e, icon: t, code: n, onRetry: i }) {
595
- let { t: a } = r();
598
+ function Ge({ children: e, icon: t, code: n, onRetry: r }) {
599
+ let { t: a } = i();
596
600
  return /* @__PURE__ */ p("div", {
597
601
  role: "alert",
598
602
  "data-ckui": "player-error",
599
603
  "data-ckui-noswipe": "",
600
604
  className: "absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-black/80 p-6 text-center",
601
605
  children: [
602
- t && /* @__PURE__ */ f(_, {
606
+ t && /* @__PURE__ */ f(g, {
603
607
  icon: h,
604
608
  className: "size-7 text-white/80",
605
609
  strokeWidth: 1.75
@@ -608,12 +612,12 @@ function Ue({ children: e, icon: t, code: n, onRetry: i }) {
608
612
  className: "max-w-sm text-sm font-medium text-balance",
609
613
  children: e
610
614
  }),
611
- i && /* @__PURE__ */ p(o, {
615
+ r && /* @__PURE__ */ p(o, {
612
616
  size: "sm",
613
617
  variant: "secondary",
614
- onClick: i,
615
- children: [/* @__PURE__ */ f(_, {
616
- icon: g,
618
+ onClick: r,
619
+ children: [/* @__PURE__ */ f(g, {
620
+ icon: Me,
617
621
  "data-icon": "inline-start"
618
622
  }), a("player.retry")]
619
623
  }),
@@ -625,6 +629,6 @@ function Ue({ children: e, icon: t, code: n, onRetry: i }) {
625
629
  });
626
630
  }
627
631
  //#endregion
628
- export { Me as SpriteFrame, x as VideoPlayer, Le as keyAllowed, Ve as previewStartAt, He as qualityLabel };
632
+ export { Pe as SpriteFrame, b as VideoPlayer, Be as keyAllowed, We as previewStartAt, x as qualityLabel, ze as trackLabel };
629
633
 
630
634
  //# sourceMappingURL=video-player.js.map