@devalok/shilp-sutra 0.27.2 → 0.29.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 (250) hide show
  1. package/dist/_chunks/badge-group.js +299 -0
  2. package/dist/_chunks/framer.js +1915 -1980
  3. package/dist/_chunks/keybinding.js +4 -5
  4. package/dist/_chunks/primitives.js +3198 -3272
  5. package/dist/_chunks/sonner.js +29 -31
  6. package/dist/_chunks/stat-row.js +110 -131
  7. package/dist/_chunks/tiptap.js +42 -78
  8. package/dist/_chunks/tree-view.js +138 -149
  9. package/dist/_chunks/typing-indicator.js +565 -0
  10. package/dist/_chunks/use-calendar.js +416 -439
  11. package/dist/_chunks/vendor-client.js +977 -814
  12. package/dist/_chunks/vendor-utils.js +5 -5
  13. package/dist/ai/block-renderer.js +22 -22
  14. package/dist/ai/blocks/loading.d.ts.map +1 -1
  15. package/dist/ai/command-bar.d.ts.map +1 -1
  16. package/dist/ai/command-bar.js +241 -263
  17. package/dist/ai/conversation.d.ts.map +1 -1
  18. package/dist/ai/conversation.js +87 -107
  19. package/dist/composed/activity-feed.d.ts +2 -0
  20. package/dist/composed/activity-feed.d.ts.map +1 -1
  21. package/dist/composed/activity-feed.js +118 -90
  22. package/dist/composed/avatar-group.d.ts +1 -0
  23. package/dist/composed/avatar-group.d.ts.map +1 -1
  24. package/dist/composed/avatar-group.js +91 -67
  25. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  26. package/dist/composed/bulk-action-bar.js +29 -28
  27. package/dist/composed/command-palette.d.ts.map +1 -1
  28. package/dist/composed/command-palette.js +99 -113
  29. package/dist/composed/content-card.js +1 -1
  30. package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
  31. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  32. package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
  33. package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
  34. package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
  35. package/dist/composed/deadline-indicator.d.ts.map +1 -1
  36. package/dist/composed/deadline-indicator.js +29 -28
  37. package/dist/composed/error-boundary.d.ts.map +1 -1
  38. package/dist/composed/error-boundary.js +30 -27
  39. package/dist/composed/extensions/file-attachment.d.ts.map +1 -1
  40. package/dist/composed/file-preview.d.ts.map +1 -1
  41. package/dist/composed/file-preview.js +261 -271
  42. package/dist/composed/filter-bar.d.ts.map +1 -1
  43. package/dist/composed/filter-bar.js +49 -48
  44. package/dist/composed/form-section.d.ts.map +1 -1
  45. package/dist/composed/form-section.js +12 -11
  46. package/dist/composed/global-loading.js +1 -1
  47. package/dist/composed/index.js +63 -63
  48. package/dist/composed/inline-edit.d.ts.map +1 -1
  49. package/dist/composed/inline-edit.js +55 -54
  50. package/dist/composed/markdown-viewer.d.ts.map +1 -1
  51. package/dist/composed/markdown-viewer.js +44 -43
  52. package/dist/composed/master-detail.d.ts.map +1 -1
  53. package/dist/composed/master-detail.js +35 -34
  54. package/dist/composed/multi-select-popover.d.ts.map +1 -1
  55. package/dist/composed/multi-select-popover.js +64 -64
  56. package/dist/composed/page-header.d.ts.map +1 -1
  57. package/dist/composed/page-header.js +31 -37
  58. package/dist/composed/priority-indicator.d.ts.map +1 -1
  59. package/dist/composed/priority-indicator.js +37 -36
  60. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  61. package/dist/composed/rich-text-editor.js +287 -306
  62. package/dist/composed/schedule-view.js +62 -62
  63. package/dist/composed/status-badge.d.ts +4 -2
  64. package/dist/composed/status-badge.d.ts.map +1 -1
  65. package/dist/composed/status-badge.js +58 -45
  66. package/dist/shell/app-command-palette.d.ts.map +1 -1
  67. package/dist/shell/app-command-palette.js +93 -93
  68. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  69. package/dist/shell/bottom-navbar.js +21 -20
  70. package/dist/shell/index.js +18 -18
  71. package/dist/shell/notification-center.d.ts.map +1 -1
  72. package/dist/shell/notification-center.js +96 -95
  73. package/dist/shell/notification-preferences.d.ts.map +1 -1
  74. package/dist/shell/notification-preferences.js +82 -85
  75. package/dist/shell/sidebar.js +59 -60
  76. package/dist/shell/top-bar.d.ts.map +1 -1
  77. package/dist/shell/top-bar.js +103 -103
  78. package/dist/tailwind/index.cjs +37 -4
  79. package/dist/tailwind/preset.d.ts.map +1 -1
  80. package/dist/tailwind/preset.js +38 -5
  81. package/dist/tokens/primitives.css +10 -0
  82. package/dist/tokens/semantic.css +70 -7
  83. package/dist/ui/accordion.d.ts +5 -2
  84. package/dist/ui/accordion.d.ts.map +1 -1
  85. package/dist/ui/accordion.js +44 -39
  86. package/dist/ui/alert-dialog.js +57 -57
  87. package/dist/ui/alert.d.ts +1 -1
  88. package/dist/ui/alert.d.ts.map +1 -1
  89. package/dist/ui/alert.js +30 -29
  90. package/dist/ui/aspect-ratio.js +4 -4
  91. package/dist/ui/autocomplete.js +56 -56
  92. package/dist/ui/avatar.js +2 -2
  93. package/dist/ui/badge-group.d.ts +22 -0
  94. package/dist/ui/badge-group.d.ts.map +1 -0
  95. package/dist/ui/badge-group.js +8 -0
  96. package/dist/ui/badge-indicator.d.ts +32 -0
  97. package/dist/ui/badge-indicator.d.ts.map +1 -0
  98. package/dist/ui/badge-indicator.js +54 -0
  99. package/dist/ui/badge.d.ts +27 -24
  100. package/dist/ui/badge.d.ts.map +1 -1
  101. package/dist/ui/badge.js +13 -129
  102. package/dist/ui/banner.d.ts +1 -1
  103. package/dist/ui/banner.d.ts.map +1 -1
  104. package/dist/ui/banner.js +27 -26
  105. package/dist/ui/breadcrumb.d.ts.map +1 -1
  106. package/dist/ui/breadcrumb.js +37 -36
  107. package/dist/ui/button-group.d.ts +12 -6
  108. package/dist/ui/button-group.d.ts.map +1 -1
  109. package/dist/ui/button-group.js +18 -18
  110. package/dist/ui/button-processing.d.ts +15 -0
  111. package/dist/ui/button-processing.d.ts.map +1 -0
  112. package/dist/ui/button-processing.js +77 -0
  113. package/dist/ui/button.d.ts +50 -25
  114. package/dist/ui/button.d.ts.map +1 -1
  115. package/dist/ui/button.js +243 -127
  116. package/dist/ui/card.js +20 -21
  117. package/dist/ui/charts/index.js +499 -508
  118. package/dist/ui/chat/date-separator.d.ts +12 -0
  119. package/dist/ui/chat/date-separator.d.ts.map +1 -0
  120. package/dist/ui/chat/index.d.ts +9 -0
  121. package/dist/ui/chat/index.d.ts.map +1 -0
  122. package/dist/ui/chat/index.js +12 -0
  123. package/dist/ui/chat/message-input.d.ts +16 -0
  124. package/dist/ui/chat/message-input.d.ts.map +1 -0
  125. package/dist/ui/chat/message-list.d.ts +24 -0
  126. package/dist/ui/chat/message-list.d.ts.map +1 -0
  127. package/dist/ui/chat/message.d.ts +108 -0
  128. package/dist/ui/chat/message.d.ts.map +1 -0
  129. package/dist/ui/chat/system-message.d.ts +11 -0
  130. package/dist/ui/chat/system-message.d.ts.map +1 -0
  131. package/dist/ui/chat/typing-indicator.d.ts +14 -0
  132. package/dist/ui/chat/typing-indicator.d.ts.map +1 -0
  133. package/dist/ui/chat/unread-separator.d.ts +12 -0
  134. package/dist/ui/chat/unread-separator.d.ts.map +1 -0
  135. package/dist/ui/checkbox.js +18 -18
  136. package/dist/ui/chip.d.ts +13 -62
  137. package/dist/ui/chip.d.ts.map +1 -1
  138. package/dist/ui/chip.js +10 -109
  139. package/dist/ui/collapsible.js +4 -4
  140. package/dist/ui/color-input.d.ts +19 -5
  141. package/dist/ui/color-input.d.ts.map +1 -1
  142. package/dist/ui/color-input.js +371 -79
  143. package/dist/ui/color-swatch.js +11 -11
  144. package/dist/ui/combobox.d.ts.map +1 -1
  145. package/dist/ui/combobox.js +74 -80
  146. package/dist/ui/context-menu.d.ts.map +1 -1
  147. package/dist/ui/context-menu.js +86 -85
  148. package/dist/ui/data-table-toolbar.d.ts.map +1 -1
  149. package/dist/ui/data-table-toolbar.js +51 -57
  150. package/dist/ui/data-table.d.ts.map +1 -1
  151. package/dist/ui/data-table.js +268 -296
  152. package/dist/ui/devalok-grain.d.ts +81 -0
  153. package/dist/ui/devalok-grain.d.ts.map +1 -0
  154. package/dist/ui/devalok-grain.js +69 -0
  155. package/dist/ui/dialog.d.ts.map +1 -1
  156. package/dist/ui/dialog.js +73 -72
  157. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  158. package/dist/ui/dropdown-menu.js +93 -92
  159. package/dist/ui/file-upload.d.ts.map +1 -1
  160. package/dist/ui/file-upload.js +82 -82
  161. package/dist/ui/hover-card.js +29 -29
  162. package/dist/ui/icon-button.d.ts +7 -7
  163. package/dist/ui/icon-button.d.ts.map +1 -1
  164. package/dist/ui/icon-context.d.ts +15 -0
  165. package/dist/ui/icon-context.d.ts.map +1 -0
  166. package/dist/ui/icon-context.js +20 -0
  167. package/dist/ui/icon-group.d.ts +22 -0
  168. package/dist/ui/icon-group.d.ts.map +1 -0
  169. package/dist/ui/icon-group.js +32 -0
  170. package/dist/ui/icon.d.ts +57 -0
  171. package/dist/ui/icon.d.ts.map +1 -0
  172. package/dist/ui/icon.js +122 -0
  173. package/dist/ui/index.d.ts +8 -1
  174. package/dist/ui/index.d.ts.map +1 -1
  175. package/dist/ui/index.js +351 -329
  176. package/dist/ui/input-otp.d.ts.map +1 -1
  177. package/dist/ui/input-otp.js +21 -20
  178. package/dist/ui/input.d.ts +32 -11
  179. package/dist/ui/input.d.ts.map +1 -1
  180. package/dist/ui/input.js +149 -44
  181. package/dist/ui/label.js +1 -1
  182. package/dist/ui/lib/motion.d.ts +2 -0
  183. package/dist/ui/lib/motion.d.ts.map +1 -1
  184. package/dist/ui/lib/motion.js +13 -11
  185. package/dist/ui/lib/utils.js +1 -1
  186. package/dist/ui/menubar.d.ts.map +1 -1
  187. package/dist/ui/menubar.js +87 -86
  188. package/dist/ui/navigation-menu.d.ts.map +1 -1
  189. package/dist/ui/navigation-menu.js +23 -28
  190. package/dist/ui/number-input.d.ts.map +1 -1
  191. package/dist/ui/number-input.js +54 -53
  192. package/dist/ui/pagination.d.ts.map +1 -1
  193. package/dist/ui/pagination.js +45 -44
  194. package/dist/ui/popover.js +30 -30
  195. package/dist/ui/progress.d.ts +3 -1
  196. package/dist/ui/progress.d.ts.map +1 -1
  197. package/dist/ui/progress.js +43 -39
  198. package/dist/ui/radio.js +1 -1
  199. package/dist/ui/search-input.d.ts.map +1 -1
  200. package/dist/ui/search-input.js +47 -60
  201. package/dist/ui/segmented-control.js +1 -1
  202. package/dist/ui/select.d.ts.map +1 -1
  203. package/dist/ui/select.js +54 -53
  204. package/dist/ui/separator.js +5 -5
  205. package/dist/ui/sheet.d.ts.map +1 -1
  206. package/dist/ui/sheet.js +46 -45
  207. package/dist/ui/sidebar.d.ts.map +1 -1
  208. package/dist/ui/sidebar.js +196 -193
  209. package/dist/ui/skeleton.js +1 -1
  210. package/dist/ui/slider.js +1 -1
  211. package/dist/ui/spinner.js +74 -74
  212. package/dist/ui/stat-card.d.ts.map +1 -1
  213. package/dist/ui/stat-card.js +85 -86
  214. package/dist/ui/switch.d.ts +3 -0
  215. package/dist/ui/switch.d.ts.map +1 -1
  216. package/dist/ui/switch.js +40 -26
  217. package/dist/ui/tabs.js +43 -43
  218. package/dist/ui/text.js +1 -1
  219. package/dist/ui/textarea.js +10 -10
  220. package/dist/ui/toast.d.ts.map +1 -1
  221. package/dist/ui/toast.js +169 -169
  222. package/dist/ui/toggle-group.js +1 -1
  223. package/dist/ui/toggle.js +5 -5
  224. package/dist/ui/tooltip.js +41 -41
  225. package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
  226. package/docs/components/_header.md +4 -4
  227. package/docs/components/composed/activity-feed.md +7 -0
  228. package/docs/components/composed/avatar-group.md +8 -5
  229. package/docs/components/composed/status-badge.md +14 -1
  230. package/docs/components/ui/accordion.md +5 -2
  231. package/docs/components/ui/badge-group.md +38 -0
  232. package/docs/components/ui/badge-indicator.md +40 -0
  233. package/docs/components/ui/badge.md +36 -5
  234. package/docs/components/ui/button-processing.md +15 -0
  235. package/docs/components/ui/button.md +40 -11
  236. package/docs/components/ui/chat.md +214 -0
  237. package/docs/components/ui/color-input.md +58 -4
  238. package/docs/components/ui/data-table.md +3 -0
  239. package/docs/components/ui/devalok-grain.md +55 -0
  240. package/docs/components/ui/icon-button.md +12 -5
  241. package/docs/components/ui/icon-context.md +38 -0
  242. package/docs/components/ui/icon-group.md +36 -0
  243. package/docs/components/ui/icon.md +47 -0
  244. package/docs/components/ui/input.md +32 -6
  245. package/docs/components/ui/progress.md +5 -0
  246. package/docs/components/ui/spinner.md +3 -0
  247. package/docs/components/ui/switch.md +13 -0
  248. package/llms-full.txt +724 -44
  249. package/llms.txt +38 -19
  250. package/package.json +8 -2
@@ -1,71 +1,71 @@
1
1
  "use client";
2
2
  import { jsx as e, jsxs as d, Fragment as G } from "react/jsx-runtime";
3
3
  import * as n from "react";
4
- import { cn as R } from "../ui/lib/utils.js";
4
+ import { cn as z } from "../ui/lib/utils.js";
5
5
  import { tweens as B, springs as Y } from "../ui/lib/motion.js";
6
6
  import { Skeleton as V } from "../ui/skeleton.js";
7
7
  import { Button as L } from "../ui/button.js";
8
- import { Badge as J } from "../ui/badge.js";
9
- import { IconZoomOut as Q, IconZoomIn as ee, IconZoomReset as te, IconMinimize as ne, IconMaximize as O, IconChevronLeft as ae, IconChevronRight as re, IconAlertTriangle as se, IconDownload as W, IconPlayerPlay as K, IconPlayerPause as _, IconVolumeOff as oe, IconVolume as ie } from "@tabler/icons-react";
10
- import { m as E, A as H } from "../_chunks/framer.js";
11
- function ce(a, o) {
12
- var r;
13
- if (o) {
14
- if (o.startsWith("image/")) return "image";
15
- if (o === "application/pdf") return "pdf";
16
- if (o.startsWith("video/")) return "video";
17
- if (o.startsWith("audio/")) return "audio";
8
+ import { Icon as w } from "../ui/icon.js";
9
+ import { B as J } from "../_chunks/badge-group.js";
10
+ import { IconZoomOut as Q, IconZoomIn as ee, IconZoomReset as te, IconMinimize as ne, IconMaximize as O, IconChevronLeft as re, IconChevronRight as ae, IconAlertTriangle as oe, IconDownload as W, IconPlayerPlay as K, IconPlayerPause as _, IconVolumeOff as se, IconVolume as ie } from "@tabler/icons-react";
11
+ import { m as A, A as H } from "../_chunks/framer.js";
12
+ function ce(r, s) {
13
+ if (s) {
14
+ if (s.startsWith("image/")) return "image";
15
+ if (s === "application/pdf") return "pdf";
16
+ if (s.startsWith("video/")) return "video";
17
+ if (s.startsWith("audio/")) return "audio";
18
18
  }
19
- const t = (r = a.split("?")[0].split(".").pop()) == null ? void 0 : r.toLowerCase();
20
- return ["jpg", "jpeg", "png", "gif", "webp", "svg", "avif", "bmp"].includes(t ?? "") ? "image" : t === "pdf" ? "pdf" : ["mp4", "webm", "ogg", "mov"].includes(t ?? "") ? "video" : ["mp3", "wav", "ogg", "aac", "flac"].includes(t ?? "") ? "audio" : a.includes("figma.com") || a.includes("loom.com") || a.includes("youtube.com") || a.includes("youtu.be") || a.includes("vimeo.com") ? "embed" : "image";
19
+ const t = r.split("?")[0].split(".").pop()?.toLowerCase();
20
+ return ["jpg", "jpeg", "png", "gif", "webp", "svg", "avif", "bmp"].includes(t ?? "") ? "image" : t === "pdf" ? "pdf" : ["mp4", "webm", "ogg", "mov"].includes(t ?? "") ? "video" : ["mp3", "wav", "ogg", "aac", "flac"].includes(t ?? "") ? "audio" : r.includes("figma.com") || r.includes("loom.com") || r.includes("youtube.com") || r.includes("youtu.be") || r.includes("vimeo.com") ? "embed" : "image";
21
21
  }
22
- function le(a) {
23
- const o = a.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&?]+)/);
24
- if (o) return `https://www.youtube.com/embed/${o[1]}`;
25
- const t = a.match(/vimeo\.com\/(\d+)/);
22
+ function le(r) {
23
+ const s = r.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&?]+)/);
24
+ if (s) return `https://www.youtube.com/embed/${s[1]}`;
25
+ const t = r.match(/vimeo\.com\/(\d+)/);
26
26
  if (t) return `https://player.vimeo.com/video/${t[1]}`;
27
- if (a.includes("figma.com")) return `https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(a)}`;
28
- const r = a.match(/loom\.com\/share\/([^?]+)/);
29
- return r ? `https://www.loom.com/embed/${r[1]}` : a;
27
+ if (r.includes("figma.com")) return `https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(r)}`;
28
+ const a = r.match(/loom\.com\/share\/([^?]+)/);
29
+ return a ? `https://www.loom.com/embed/${a[1]}` : r;
30
30
  }
31
31
  function X({
32
- volume: a,
33
- muted: o,
32
+ volume: r,
33
+ muted: s,
34
34
  onVolumeChange: t,
35
- onMuteToggle: r,
36
- variant: m = "light"
35
+ onMuteToggle: a,
36
+ variant: v = "light"
37
37
  }) {
38
- const h = n.useRef(null), [b, p] = n.useState(!1), v = o ? 0 : a;
39
- function x(w) {
40
- if (!h.current) return a;
41
- const T = h.current.getBoundingClientRect();
42
- return Math.max(0, Math.min(1, (w.clientX - T.left) / T.width));
38
+ const m = n.useRef(null), [b, h] = n.useState(!1), g = s ? 0 : r;
39
+ function y(x) {
40
+ if (!m.current) return r;
41
+ const E = m.current.getBoundingClientRect();
42
+ return Math.max(0, Math.min(1, (x.clientX - E.left) / E.width));
43
43
  }
44
- function g(w) {
45
- w.preventDefault(), p(!0);
46
- const T = x(w);
47
- t(T), w.target.setPointerCapture(w.pointerId);
44
+ function p(x) {
45
+ x.preventDefault(), h(!0);
46
+ const E = y(x);
47
+ t(E), x.target.setPointerCapture(x.pointerId);
48
48
  }
49
- function y(w) {
50
- b && t(x(w));
49
+ function k(x) {
50
+ b && t(y(x));
51
51
  }
52
- function k() {
53
- p(!1);
52
+ function N() {
53
+ h(!1);
54
54
  }
55
- const f = m === "dark", I = f ? "bg-white/30" : "bg-surface-sunken", D = f ? "bg-white" : "bg-accent-9", P = f ? "bg-white" : "bg-accent-9";
55
+ const f = v === "dark", I = f ? "bg-white/30" : "bg-surface-sunken", D = f ? "bg-white" : "bg-accent-9", C = f ? "bg-white" : "bg-accent-9";
56
56
  return /* @__PURE__ */ d("div", { className: "group/vol flex items-center gap-ds-02 shrink-0", children: [
57
- /* @__PURE__ */ e("button", { onClick: r, className: R("transition-colors", f ? "text-white hover:text-white/80" : "text-surface-fg-muted hover:text-surface-fg"), "aria-label": o ? "Unmute (M)" : "Mute (M)", children: o || a === 0 ? /* @__PURE__ */ e(oe, { className: "h-ico-sm w-ico-sm" }) : /* @__PURE__ */ e(ie, { className: "h-ico-sm w-ico-sm" }) }),
57
+ /* @__PURE__ */ e("button", { onClick: a, className: z("transition-colors", f ? "text-white hover:text-white/80" : "text-surface-fg-muted hover:text-surface-fg"), "aria-label": s ? "Unmute (M)" : "Mute (M)", children: s || r === 0 ? /* @__PURE__ */ e(w, { icon: se, size: "sm" }) : /* @__PURE__ */ e(w, { icon: ie, size: "sm" }) }),
58
58
  /* @__PURE__ */ e("div", { className: "w-0 overflow-hidden group-hover/vol:w-20 transition-[width] duration-200 ease-productive-standard flex items-center", children: /* @__PURE__ */ d(
59
59
  "div",
60
60
  {
61
- ref: h,
62
- className: R("relative w-full h-1 rounded-full cursor-pointer", I),
63
- onPointerDown: g,
64
- onPointerMove: y,
65
- onPointerUp: k,
61
+ ref: m,
62
+ className: z("relative w-full h-1 rounded-full cursor-pointer", I),
63
+ onPointerDown: p,
64
+ onPointerMove: k,
65
+ onPointerUp: N,
66
66
  role: "slider",
67
67
  "aria-label": "Volume",
68
- "aria-valuenow": Math.round(v * 100),
68
+ "aria-valuenow": Math.round(g * 100),
69
69
  "aria-valuemin": 0,
70
70
  "aria-valuemax": 100,
71
71
  tabIndex: 0,
@@ -73,19 +73,19 @@ function X({
73
73
  /* @__PURE__ */ e(
74
74
  "div",
75
75
  {
76
- className: R("absolute left-0 top-0 h-full rounded-full transition-[width] duration-75", D),
77
- style: { width: `${v * 100}%` }
76
+ className: z("absolute left-0 top-0 h-full rounded-full transition-[width] duration-75", D),
77
+ style: { width: `${g * 100}%` }
78
78
  }
79
79
  ),
80
80
  /* @__PURE__ */ e(
81
81
  "div",
82
82
  {
83
- className: R(
83
+ className: z(
84
84
  "absolute top-1/2 -translate-y-1/2 h-2.5 w-2.5 rounded-full shadow-raised transition-opacity",
85
- P,
85
+ C,
86
86
  b ? "opacity-100 scale-110" : "opacity-0 group-hover/vol:opacity-100"
87
87
  ),
88
- style: { left: `${v * 100}%`, marginLeft: "-5px" }
88
+ style: { left: `${g * 100}%`, marginLeft: "-5px" }
89
89
  }
90
90
  )
91
91
  ]
@@ -93,33 +93,33 @@ function X({
93
93
  ) })
94
94
  ] });
95
95
  }
96
- function j(a) {
97
- if (!isFinite(a) || a < 0) return "0:00";
98
- const o = Math.floor(a / 3600), t = Math.floor(a % 3600 / 60), r = Math.floor(a % 60);
99
- return o > 0 ? `${o}:${t.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}` : `${t}:${r.toString().padStart(2, "0")}`;
96
+ function j(r) {
97
+ if (!isFinite(r) || r < 0) return "0:00";
98
+ const s = Math.floor(r / 3600), t = Math.floor(r % 3600 / 60), a = Math.floor(r % 60);
99
+ return s > 0 ? `${s}:${t.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}` : `${t}:${a.toString().padStart(2, "0")}`;
100
100
  }
101
- function $({ message: a, url: o }) {
101
+ function $({ message: r, url: s }) {
102
102
  return /* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center gap-ds-04 rounded-ds-md border border-surface-border bg-surface-sunken p-ds-08 text-center", children: [
103
- /* @__PURE__ */ e(se, { className: "h-8 w-8 text-warning-9" }),
103
+ /* @__PURE__ */ e(w, { icon: oe, size: "2xl", className: "text-warning-9" }),
104
104
  /* @__PURE__ */ d("div", { children: [
105
105
  /* @__PURE__ */ e("p", { className: "text-ds-md font-semibold text-surface-fg", children: "Preview unavailable" }),
106
- /* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-muted mt-ds-01", children: a })
106
+ /* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-muted mt-ds-01", children: r })
107
107
  ] }),
108
- /* @__PURE__ */ e(L, { variant: "outline", size: "xs", startIcon: /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" }), asChild: !0, children: /* @__PURE__ */ e("a", { href: o, download: !0, target: "_blank", rel: "noopener noreferrer", children: "Download file" }) })
108
+ /* @__PURE__ */ e(L, { variant: "outline", size: "xs", startIcon: /* @__PURE__ */ e(w, { icon: W }), asChild: !0, children: /* @__PURE__ */ e("a", { href: s, download: !0, target: "_blank", rel: "noopener noreferrer", children: "Download file" }) })
109
109
  ] });
110
110
  }
111
- function q({ children: a, className: o }) {
111
+ function q({ children: r, className: s }) {
112
112
  return /* @__PURE__ */ e(
113
- E.div,
113
+ A.div,
114
114
  {
115
115
  initial: { opacity: 0, y: 8 },
116
116
  animate: { opacity: 1, y: 0 },
117
117
  transition: B.fade,
118
- className: R(
118
+ className: z(
119
119
  "flex items-center gap-ds-01 rounded-ds-md border border-surface-border bg-surface-overlay/95 px-ds-02 py-ds-01 shadow-floating backdrop-blur-sm",
120
- o
120
+ s
121
121
  ),
122
- children: a
122
+ children: r
123
123
  }
124
124
  );
125
125
  }
@@ -127,75 +127,75 @@ function Z() {
127
127
  return /* @__PURE__ */ e("div", { className: "mx-ds-01 h-4 w-px bg-surface-border-subtle" });
128
128
  }
129
129
  const ue = n.lazy(
130
- () => import("react-zoom-pan-pinch").then((a) => ({
131
- default: function({ url: t, alt: r, onError: m }) {
132
- const { TransformWrapper: h, TransformComponent: b } = a, [p, v] = n.useState(!1), [x, g] = n.useState(!1), [y, k] = n.useState(100), [f, I] = n.useState(!1), D = n.useRef(null), [P, C] = n.useState(!1), w = n.useRef(null);
130
+ () => import("react-zoom-pan-pinch").then((r) => ({
131
+ default: function({ url: t, alt: a, onError: v }) {
132
+ const { TransformWrapper: m, TransformComponent: b } = r, [h, g] = n.useState(!1), [y, p] = n.useState(!1), [k, N] = n.useState(100), [f, I] = n.useState(!1), D = n.useRef(null), [C, T] = n.useState(!1), x = n.useRef(null);
133
133
  return n.useEffect(() => {
134
- function u(i) {
135
- const M = D.current;
136
- if (!M || !M.contains(document.activeElement) && !P) return;
137
- const S = w.current;
138
- S && (i.key === "+" || i.key === "=" ? (i.preventDefault(), S.zoomIn()) : i.key === "-" ? (i.preventDefault(), S.zoomOut()) : i.key === "0" ? (i.preventDefault(), S.resetTransform()) : i.key === "f" || i.key === "F" ? (i.preventDefault(), I((s) => !s)) : i.key === "Escape" && f && (i.preventDefault(), I(!1)));
134
+ function u(o) {
135
+ const S = D.current;
136
+ if (!S || !S.contains(document.activeElement) && !C) return;
137
+ const P = x.current;
138
+ P && (o.key === "+" || o.key === "=" ? (o.preventDefault(), P.zoomIn()) : o.key === "-" ? (o.preventDefault(), P.zoomOut()) : o.key === "0" ? (o.preventDefault(), P.resetTransform()) : o.key === "f" || o.key === "F" ? (o.preventDefault(), I((i) => !i)) : o.key === "Escape" && f && (o.preventDefault(), I(!1)));
139
139
  }
140
140
  return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
141
- }, [P, f]), x ? /* @__PURE__ */ e($, { message: "Could not load image", url: t }) : /* @__PURE__ */ e(
141
+ }, [C, f]), y ? /* @__PURE__ */ e($, { message: "Could not load image", url: t }) : /* @__PURE__ */ e(
142
142
  "div",
143
143
  {
144
144
  ref: D,
145
145
  className: f ? "fixed inset-0 z-50 flex flex-col items-center justify-center bg-black/90 backdrop-blur-sm" : "relative flex flex-col items-center gap-ds-03",
146
- onMouseEnter: () => C(!0),
147
- onMouseLeave: () => C(!1),
146
+ onMouseEnter: () => T(!0),
147
+ onMouseLeave: () => T(!1),
148
148
  tabIndex: -1,
149
149
  children: /* @__PURE__ */ e(
150
- h,
150
+ m,
151
151
  {
152
152
  initialScale: 1,
153
153
  minScale: 0.1,
154
154
  maxScale: 8,
155
155
  centerOnInit: !0,
156
156
  doubleClick: { mode: "toggle", step: 2 },
157
- onTransformed: (u, i) => k(Math.round(i.scale * 100)),
158
- children: ({ zoomIn: u, zoomOut: i, resetTransform: M, centerView: A }) => (w.current = { zoomIn: u, zoomOut: i, resetTransform: M, centerView: A }, /* @__PURE__ */ d(G, { children: [
159
- /* @__PURE__ */ d("div", { className: R(
157
+ onTransformed: (u, o) => N(Math.round(o.scale * 100)),
158
+ children: ({ zoomIn: u, zoomOut: o, resetTransform: S, centerView: F }) => (x.current = { zoomIn: u, zoomOut: o, resetTransform: S, centerView: F }, /* @__PURE__ */ d(G, { children: [
159
+ /* @__PURE__ */ d("div", { className: z(
160
160
  "overflow-hidden rounded-ds-md bg-surface-sunken",
161
161
  f ? "flex-1 w-full" : "max-h-[70vh] max-w-full"
162
162
  ), children: [
163
- !p && /* @__PURE__ */ e(V, { className: "h-64 w-full rounded-ds-md" }),
163
+ !h && /* @__PURE__ */ e(V, { className: "h-64 w-full rounded-ds-md" }),
164
164
  /* @__PURE__ */ e(
165
165
  b,
166
166
  {
167
- wrapperClass: R("!w-full", f && "!h-full"),
167
+ wrapperClass: z("!w-full", f && "!h-full"),
168
168
  contentClass: "!w-full !flex !items-center !justify-center",
169
169
  children: /* @__PURE__ */ e(
170
- E.img,
170
+ A.img,
171
171
  {
172
172
  src: t,
173
- alt: r ?? "",
174
- onLoad: () => v(!0),
173
+ alt: a ?? "",
174
+ onLoad: () => g(!0),
175
175
  onError: () => {
176
- g(!0), m == null || m("Image failed to load");
176
+ p(!0), v?.("Image failed to load");
177
177
  },
178
178
  initial: { opacity: 0 },
179
- animate: { opacity: p ? 1 : 0 },
179
+ animate: { opacity: h ? 1 : 0 },
180
180
  transition: B.fade,
181
- className: R("max-w-full select-none", !p && "hidden", f && "max-h-[90vh] object-contain"),
181
+ className: z("max-w-full select-none", !h && "hidden", f && "max-h-[90vh] object-contain"),
182
182
  draggable: !1
183
183
  }
184
184
  )
185
185
  }
186
186
  )
187
187
  ] }),
188
- p && /* @__PURE__ */ d(q, { className: f ? "absolute bottom-ds-06" : void 0, children: [
189
- /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => i(), "aria-label": "Zoom out (-)", children: /* @__PURE__ */ e(Q, { className: "h-ico-sm w-ico-sm" }) }),
188
+ h && /* @__PURE__ */ d(q, { className: f ? "absolute bottom-ds-06" : void 0, children: [
189
+ /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => o(), "aria-label": "Zoom out (-)", children: /* @__PURE__ */ e(w, { icon: Q, size: "sm" }) }),
190
190
  /* @__PURE__ */ d("span", { className: "text-ds-xs font-mono text-surface-fg-muted w-12 text-center tabular-nums select-none", children: [
191
- y,
191
+ k,
192
192
  "%"
193
193
  ] }),
194
- /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => u(), "aria-label": "Zoom in (+)", children: /* @__PURE__ */ e(ee, { className: "h-ico-sm w-ico-sm" }) }),
194
+ /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => u(), "aria-label": "Zoom in (+)", children: /* @__PURE__ */ e(w, { icon: ee, size: "sm" }) }),
195
195
  /* @__PURE__ */ e(Z, {}),
196
- /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => M(), "aria-label": "Reset zoom (0)", children: /* @__PURE__ */ e(te, { className: "h-ico-sm w-ico-sm" }) }),
196
+ /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => S(), "aria-label": "Reset zoom (0)", children: /* @__PURE__ */ e(w, { icon: te, size: "sm" }) }),
197
197
  /* @__PURE__ */ e(Z, {}),
198
- /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => I((S) => !S), "aria-label": f ? "Exit fullscreen (Esc)" : "Fullscreen (F)", children: f ? /* @__PURE__ */ e(ne, { className: "h-ico-sm w-ico-sm" }) : /* @__PURE__ */ e(O, { className: "h-ico-sm w-ico-sm" }) })
198
+ /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => I((P) => !P), "aria-label": f ? "Exit fullscreen (Esc)" : "Fullscreen (F)", children: f ? /* @__PURE__ */ e(w, { icon: ne, size: "sm" }) : /* @__PURE__ */ e(w, { icon: O, size: "sm" }) })
199
199
  ] })
200
200
  ] }))
201
201
  }
@@ -205,81 +205,81 @@ const ue = n.lazy(
205
205
  }
206
206
  }))
207
207
  ), de = n.lazy(
208
- () => import("react-pdf").then((a) => ({
209
- default: function({ url: t, initialPage: r, onError: m }) {
210
- const { Document: h, Page: b, pdfjs: p } = a;
208
+ () => import("react-pdf").then((r) => ({
209
+ default: function({ url: t, initialPage: a, onError: v }) {
210
+ const { Document: m, Page: b, pdfjs: h } = r;
211
211
  n.useEffect(() => {
212
- p.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${p.version}/build/pdf.worker.min.mjs`;
212
+ h.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${h.version}/build/pdf.worker.min.mjs`;
213
213
  }, []);
214
- const [v, x] = n.useState(0), [g, y] = n.useState(r), [k, f] = n.useState(String(r)), [I, D] = n.useState(!1), P = n.useRef(null), [C, w] = n.useState(!1);
214
+ const [g, y] = n.useState(0), [p, k] = n.useState(a), [N, f] = n.useState(String(a)), [I, D] = n.useState(!1), C = n.useRef(null), [T, x] = n.useState(!1);
215
215
  n.useEffect(() => {
216
- f(String(g));
217
- }, [g]), n.useEffect(() => {
218
- function u(i) {
219
- const M = P.current;
220
- !M || !M.contains(document.activeElement) && !C || (i.key === "ArrowRight" || i.key === "ArrowDown" ? (i.preventDefault(), y((S) => Math.min(v, S + 1))) : (i.key === "ArrowLeft" || i.key === "ArrowUp") && (i.preventDefault(), y((S) => Math.max(1, S - 1))));
216
+ f(String(p));
217
+ }, [p]), n.useEffect(() => {
218
+ function u(o) {
219
+ const S = C.current;
220
+ !S || !S.contains(document.activeElement) && !T || (o.key === "ArrowRight" || o.key === "ArrowDown" ? (o.preventDefault(), k((P) => Math.min(g, P + 1))) : (o.key === "ArrowLeft" || o.key === "ArrowUp") && (o.preventDefault(), k((P) => Math.max(1, P - 1))));
221
221
  }
222
222
  return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
223
- }, [v, C]);
224
- function T(u) {
223
+ }, [g, T]);
224
+ function E(u) {
225
225
  if (u.key === "Enter") {
226
- const i = parseInt(k, 10);
227
- i >= 1 && i <= v ? y(i) : f(String(g));
226
+ const o = parseInt(N, 10);
227
+ o >= 1 && o <= g ? k(o) : f(String(p));
228
228
  }
229
229
  }
230
230
  return I ? /* @__PURE__ */ e($, { message: "Could not load PDF", url: t }) : /* @__PURE__ */ d(
231
231
  "div",
232
232
  {
233
- ref: P,
233
+ ref: C,
234
234
  className: "flex flex-col items-center gap-ds-03",
235
- onMouseEnter: () => w(!0),
236
- onMouseLeave: () => w(!1),
235
+ onMouseEnter: () => x(!0),
236
+ onMouseLeave: () => x(!1),
237
237
  tabIndex: -1,
238
238
  children: [
239
239
  /* @__PURE__ */ e("div", { className: "overflow-auto max-h-[70vh] rounded-ds-md bg-surface-sunken border border-surface-border", children: /* @__PURE__ */ e(
240
- h,
240
+ m,
241
241
  {
242
242
  file: t,
243
- onLoadSuccess: ({ numPages: u }) => x(u),
243
+ onLoadSuccess: ({ numPages: u }) => y(u),
244
244
  onLoadError: () => {
245
- D(!0), m == null || m("PDF failed to load");
245
+ D(!0), v?.("PDF failed to load");
246
246
  },
247
247
  loading: /* @__PURE__ */ e(V, { className: "h-[500px] w-[400px]" }),
248
248
  error: /* @__PURE__ */ e($, { message: "Failed to load PDF", url: t }),
249
249
  children: /* @__PURE__ */ e(H, { mode: "wait", children: /* @__PURE__ */ e(
250
- E.div,
250
+ A.div,
251
251
  {
252
252
  initial: { opacity: 0 },
253
253
  animate: { opacity: 1 },
254
254
  exit: { opacity: 0 },
255
255
  transition: B.fade,
256
- children: /* @__PURE__ */ e(b, { pageNumber: g, renderTextLayer: !1, renderAnnotationLayer: !1 })
256
+ children: /* @__PURE__ */ e(b, { pageNumber: p, renderTextLayer: !1, renderAnnotationLayer: !1 })
257
257
  },
258
- g
258
+ p
259
259
  ) })
260
260
  }
261
261
  ) }),
262
- v > 0 && /* @__PURE__ */ d(q, { children: [
263
- /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => y((u) => Math.max(1, u - 1)), disabled: g <= 1, "aria-label": "Previous page (←)", children: /* @__PURE__ */ e(ae, { className: "h-ico-sm w-ico-sm" }) }),
262
+ g > 0 && /* @__PURE__ */ d(q, { children: [
263
+ /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => k((u) => Math.max(1, u - 1)), disabled: p <= 1, "aria-label": "Previous page (←)", children: /* @__PURE__ */ e(w, { icon: re, size: "sm" }) }),
264
264
  /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-01 text-ds-xs text-surface-fg-muted", children: [
265
265
  /* @__PURE__ */ e(
266
266
  "input",
267
267
  {
268
268
  type: "text",
269
- value: k,
269
+ value: N,
270
270
  onChange: (u) => f(u.target.value),
271
- onKeyDown: T,
272
- onBlur: () => f(String(g)),
271
+ onKeyDown: E,
272
+ onBlur: () => f(String(p)),
273
273
  className: "w-8 bg-transparent text-center font-mono text-surface-fg outline-none focus:bg-surface-raised-hover rounded-ds-sm",
274
274
  "aria-label": "Page number"
275
275
  }
276
276
  ),
277
277
  /* @__PURE__ */ d("span", { children: [
278
278
  "/ ",
279
- v
279
+ g
280
280
  ] })
281
281
  ] }),
282
- /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => y((u) => Math.min(v, u + 1)), disabled: g >= v, "aria-label": "Next page (→)", children: /* @__PURE__ */ e(re, { className: "h-ico-sm w-ico-sm" }) })
282
+ /* @__PURE__ */ e(L, { variant: "ghost", size: "icon-xs", onClick: () => k((u) => Math.min(g, u + 1)), disabled: p >= g, "aria-label": "Next page (→)", children: /* @__PURE__ */ e(w, { icon: ae, size: "sm" }) })
283
283
  ] })
284
284
  ]
285
285
  }
@@ -287,110 +287,106 @@ const ue = n.lazy(
287
287
  }
288
288
  }))
289
289
  ), U = [0.5, 0.75, 1, 1.25, 1.5, 2];
290
- function fe({ url: a, onError: o }) {
291
- const t = n.useRef(null), r = n.useRef(null), [m, h] = n.useState(!1), [b, p] = n.useState(0), [v, x] = n.useState(0), [g, y] = n.useState(0), [k, f] = n.useState(!1), [I, D] = n.useState(!1), [P, C] = n.useState(!0), [w, T] = n.useState(1), u = n.useRef();
290
+ function fe({ url: r, onError: s }) {
291
+ const t = n.useRef(null), a = n.useRef(null), [v, m] = n.useState(!1), [b, h] = n.useState(0), [g, y] = n.useState(0), [p, k] = n.useState(0), [N, f] = n.useState(!1), [I, D] = n.useState(!1), [C, T] = n.useState(!0), [x, E] = n.useState(1), u = n.useRef(void 0);
292
292
  n.useEffect(() => () => clearTimeout(u.current), []), n.useEffect(() => {
293
- function s(c) {
294
- var F;
295
- const N = r.current;
296
- if (!N || !N.contains(document.activeElement) && document.activeElement !== N) return;
297
- const l = t.current;
298
- if (l)
299
- switch (c.key) {
293
+ function i(l) {
294
+ const M = a.current;
295
+ if (!M || !M.contains(document.activeElement) && document.activeElement !== M) return;
296
+ const c = t.current;
297
+ if (c)
298
+ switch (l.key) {
300
299
  case " ":
301
300
  case "k":
302
- c.preventDefault(), h((z) => (z ? l.pause() : l.play(), !z));
301
+ l.preventDefault(), m((R) => (R ? c.pause() : c.play(), !R));
303
302
  break;
304
303
  case "ArrowRight":
305
- c.preventDefault(), l.currentTime = Math.min(l.duration, l.currentTime + 5);
304
+ l.preventDefault(), c.currentTime = Math.min(c.duration, c.currentTime + 5);
306
305
  break;
307
306
  case "ArrowLeft":
308
- c.preventDefault(), l.currentTime = Math.max(0, l.currentTime - 5);
307
+ l.preventDefault(), c.currentTime = Math.max(0, c.currentTime - 5);
309
308
  break;
310
309
  case "j":
311
- c.preventDefault(), l.currentTime = Math.max(0, l.currentTime - 10);
310
+ l.preventDefault(), c.currentTime = Math.max(0, c.currentTime - 10);
312
311
  break;
313
312
  case "l":
314
- c.preventDefault(), l.currentTime = Math.min(l.duration, l.currentTime + 10);
313
+ l.preventDefault(), c.currentTime = Math.min(c.duration, c.currentTime + 10);
315
314
  break;
316
315
  case "m":
317
- c.preventDefault(), f((z) => (l.muted = !z, !z));
316
+ l.preventDefault(), f((R) => (c.muted = !R, !R));
318
317
  break;
319
318
  case "f":
320
- c.preventDefault(), (F = l.requestFullscreen) == null || F.call(l);
319
+ l.preventDefault(), c.requestFullscreen?.();
321
320
  break;
322
321
  case ">":
323
- c.preventDefault(), i(1);
322
+ l.preventDefault(), o(1);
324
323
  break;
325
324
  case "<":
326
- c.preventDefault(), i(-1);
325
+ l.preventDefault(), o(-1);
327
326
  break;
328
327
  }
329
328
  }
330
- return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
329
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
331
330
  }, []);
332
- function i(s) {
333
- const c = U.indexOf(w), N = Math.max(0, Math.min(U.length - 1, c + s)), l = U[N];
334
- T(l), t.current && (t.current.playbackRate = l);
331
+ function o(i) {
332
+ const l = U.indexOf(x), M = Math.max(0, Math.min(U.length - 1, l + i)), c = U[M];
333
+ E(c), t.current && (t.current.playbackRate = c);
335
334
  }
336
- function M() {
337
- t.current && (m ? t.current.pause() : t.current.play(), h(!m));
335
+ function S() {
336
+ t.current && (v ? t.current.pause() : t.current.play(), m(!v));
338
337
  }
339
- function A(s) {
340
- if (!t.current || !v) return;
341
- const c = s.currentTarget.getBoundingClientRect(), N = (s.clientX - c.left) / c.width;
342
- t.current.currentTime = N * v;
338
+ function F(i) {
339
+ if (!t.current || !g) return;
340
+ const l = i.currentTarget.getBoundingClientRect(), M = (i.clientX - l.left) / l.width;
341
+ t.current.currentTime = M * g;
343
342
  }
344
- function S() {
345
- C(!0), clearTimeout(u.current), m && (u.current = setTimeout(() => C(!1), 3e3));
343
+ function P() {
344
+ T(!0), clearTimeout(u.current), v && (u.current = setTimeout(() => T(!1), 3e3));
346
345
  }
347
- return I ? /* @__PURE__ */ e($, { message: "Could not load video", url: a }) : /* @__PURE__ */ d(
346
+ return I ? /* @__PURE__ */ e($, { message: "Could not load video", url: r }) : /* @__PURE__ */ d(
348
347
  "div",
349
348
  {
350
- ref: r,
349
+ ref: a,
351
350
  className: "group relative rounded-ds-md bg-black overflow-hidden",
352
- onMouseMove: S,
353
- onMouseLeave: () => m && C(!1),
351
+ onMouseMove: P,
352
+ onMouseLeave: () => v && T(!1),
354
353
  tabIndex: -1,
355
354
  children: [
356
355
  /* @__PURE__ */ e(
357
356
  "video",
358
357
  {
359
358
  ref: t,
360
- src: a,
359
+ src: r,
361
360
  className: "max-h-[70vh] w-full",
362
- onClick: M,
363
- muted: k,
361
+ onClick: S,
362
+ muted: N,
364
363
  onTimeUpdate: () => {
365
- t.current && (y(t.current.currentTime), t.current.duration && p(t.current.currentTime / t.current.duration * 100));
366
- },
367
- onLoadedMetadata: () => {
368
- var s;
369
- return x(((s = t.current) == null ? void 0 : s.duration) ?? 0);
364
+ t.current && (k(t.current.currentTime), t.current.duration && h(t.current.currentTime / t.current.duration * 100));
370
365
  },
366
+ onLoadedMetadata: () => y(t.current?.duration ?? 0),
371
367
  onEnded: () => {
372
- h(!1), C(!0);
368
+ m(!1), T(!0);
373
369
  },
374
370
  onError: () => {
375
- D(!0), o == null || o("Video failed to load");
371
+ D(!0), s?.("Video failed to load");
376
372
  },
377
373
  playsInline: !0
378
374
  }
379
375
  ),
380
- !m && /* @__PURE__ */ e(
381
- E.button,
376
+ !v && /* @__PURE__ */ e(
377
+ A.button,
382
378
  {
383
379
  initial: { opacity: 0, scale: 0.8 },
384
380
  animate: { opacity: 1, scale: 1 },
385
381
  transition: Y.snappy,
386
- onClick: M,
382
+ onClick: S,
387
383
  className: "absolute inset-0 flex items-center justify-center bg-black/30",
388
384
  "aria-label": "Play video",
389
- children: /* @__PURE__ */ e("div", { className: "flex h-14 w-14 items-center justify-center rounded-full bg-white/90 shadow-floating", children: /* @__PURE__ */ e(K, { className: "h-6 w-6 text-surface-fg ml-0.5" }) })
385
+ children: /* @__PURE__ */ e("div", { className: "flex h-14 w-14 items-center justify-center rounded-full bg-white/90 shadow-floating", children: /* @__PURE__ */ e(w, { icon: K, size: "xl", className: "text-surface-fg ml-0.5" }) })
390
386
  }
391
387
  ),
392
- /* @__PURE__ */ e(H, { children: P && v > 0 && /* @__PURE__ */ d(
393
- E.div,
388
+ /* @__PURE__ */ e(H, { children: C && g > 0 && /* @__PURE__ */ d(
389
+ A.div,
394
390
  {
395
391
  initial: { opacity: 0, y: 10 },
396
392
  animate: { opacity: 1, y: 0 },
@@ -402,7 +398,7 @@ function fe({ url: a, onError: o }) {
402
398
  "div",
403
399
  {
404
400
  className: "relative h-1 w-full cursor-pointer rounded-full bg-white/30 mb-ds-03 group/progress",
405
- onClick: A,
401
+ onClick: F,
406
402
  role: "slider",
407
403
  "aria-label": "Video progress",
408
404
  "aria-valuenow": Math.round(b),
@@ -428,35 +424,35 @@ function fe({ url: a, onError: o }) {
428
424
  }
429
425
  ),
430
426
  /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03", children: [
431
- /* @__PURE__ */ e("button", { onClick: M, className: "text-white hover:text-white/80", "aria-label": m ? "Pause" : "Play", children: m ? /* @__PURE__ */ e(_, { className: "h-5 w-5" }) : /* @__PURE__ */ e(K, { className: "h-5 w-5" }) }),
427
+ /* @__PURE__ */ e("button", { onClick: S, className: "text-white hover:text-white/80", "aria-label": v ? "Pause" : "Play", children: v ? /* @__PURE__ */ e(w, { icon: _, size: "lg" }) : /* @__PURE__ */ e(w, { icon: K, size: "lg" }) }),
432
428
  /* @__PURE__ */ e(
433
429
  X,
434
430
  {
435
- volume: k ? 0 : 1,
436
- muted: k,
437
- onVolumeChange: (s) => {
438
- t.current && (t.current.volume = s), s > 0 && k && (f(!1), t.current && (t.current.muted = !1));
431
+ volume: N ? 0 : 1,
432
+ muted: N,
433
+ onVolumeChange: (i) => {
434
+ t.current && (t.current.volume = i), i > 0 && N && (f(!1), t.current && (t.current.muted = !1));
439
435
  },
440
436
  onMuteToggle: () => {
441
- f(!k), t.current && (t.current.muted = !k);
437
+ f(!N), t.current && (t.current.muted = !N);
442
438
  },
443
439
  variant: "dark"
444
440
  }
445
441
  ),
446
442
  /* @__PURE__ */ d("span", { className: "text-[11px] font-mono text-white/70 tabular-nums", children: [
447
- j(g),
443
+ j(p),
448
444
  " / ",
449
- j(v)
445
+ j(g)
450
446
  ] }),
451
447
  /* @__PURE__ */ e("div", { className: "flex-1" }),
452
448
  /* @__PURE__ */ d(
453
449
  "button",
454
450
  {
455
- onClick: () => i(1),
451
+ onClick: () => o(1),
456
452
  className: "text-[11px] font-mono text-white/70 hover:text-white px-1 rounded-ds-sm hover:bg-white/10 transition-colors",
457
- "aria-label": `Playback speed: ${w}x`,
453
+ "aria-label": `Playback speed: ${x}x`,
458
454
  children: [
459
- w,
455
+ x,
460
456
  "x"
461
457
  ]
462
458
  }
@@ -464,13 +460,10 @@ function fe({ url: a, onError: o }) {
464
460
  /* @__PURE__ */ e(
465
461
  "button",
466
462
  {
467
- onClick: () => {
468
- var s, c;
469
- return (c = (s = t.current) == null ? void 0 : s.requestFullscreen) == null ? void 0 : c.call(s);
470
- },
463
+ onClick: () => t.current?.requestFullscreen?.(),
471
464
  className: "text-white hover:text-white/80",
472
465
  "aria-label": "Fullscreen (F)",
473
- children: /* @__PURE__ */ e(O, { className: "h-4 w-4" })
466
+ children: /* @__PURE__ */ e(w, { icon: O, size: "sm" })
474
467
  }
475
468
  )
476
469
  ] })
@@ -481,65 +474,62 @@ function fe({ url: a, onError: o }) {
481
474
  }
482
475
  );
483
476
  }
484
- function me({ url: a, fileName: o, onError: t }) {
485
- const r = n.useRef(null), m = n.useRef(null), [h, b] = n.useState(!1), [p, v] = n.useState(0), [x, g] = n.useState(0), [y, k] = n.useState(0), [f, I] = n.useState(1), [D, P] = n.useState(!1), [C, w] = n.useState(!1), [T, u] = n.useState(null);
477
+ function me({ url: r, fileName: s, onError: t }) {
478
+ const a = n.useRef(null), v = n.useRef(null), [m, b] = n.useState(!1), [h, g] = n.useState(0), [y, p] = n.useState(0), [k, N] = n.useState(0), [f, I] = n.useState(1), [D, C] = n.useState(!1), [T, x] = n.useState(!1), [E, u] = n.useState(null);
486
479
  n.useEffect(() => {
487
- function s(c) {
488
- const N = m.current;
489
- if (!N || !N.contains(document.activeElement) && document.activeElement !== N) return;
490
- const l = r.current;
491
- if (l)
492
- switch (c.key) {
480
+ function i(l) {
481
+ const M = v.current;
482
+ if (!M || !M.contains(document.activeElement) && document.activeElement !== M) return;
483
+ const c = a.current;
484
+ if (c)
485
+ switch (l.key) {
493
486
  case " ":
494
- c.preventDefault(), b((F) => (F ? l.pause() : l.play(), !F));
487
+ l.preventDefault(), b((R) => (R ? c.pause() : c.play(), !R));
495
488
  break;
496
489
  case "ArrowRight":
497
- c.preventDefault(), l.currentTime = Math.min(l.duration || 0, l.currentTime + 5);
490
+ l.preventDefault(), c.currentTime = Math.min(c.duration || 0, c.currentTime + 5);
498
491
  break;
499
492
  case "ArrowLeft":
500
- c.preventDefault(), l.currentTime = Math.max(0, l.currentTime - 5);
493
+ l.preventDefault(), c.currentTime = Math.max(0, c.currentTime - 5);
501
494
  break;
502
495
  case "m":
503
- c.preventDefault(), P((F) => (l.muted = !F, !F));
496
+ l.preventDefault(), C((R) => (c.muted = !R, !R));
504
497
  break;
505
498
  }
506
499
  }
507
- return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
500
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
508
501
  }, []);
509
- function i() {
510
- r.current && (h ? r.current.pause() : r.current.play(), b(!h));
502
+ function o() {
503
+ a.current && (m ? a.current.pause() : a.current.play(), b(!m));
511
504
  }
512
- function M(s) {
513
- if (!r.current || !x) return;
514
- const c = s.currentTarget.getBoundingClientRect(), N = Math.max(0, Math.min(1, (s.clientX - c.left) / c.width));
515
- r.current.currentTime = N * x;
505
+ function S(i) {
506
+ if (!a.current || !y) return;
507
+ const l = i.currentTarget.getBoundingClientRect(), M = Math.max(0, Math.min(1, (i.clientX - l.left) / l.width));
508
+ a.current.currentTime = M * y;
516
509
  }
517
- function A(s) {
518
- if (!x) return;
519
- const c = s.currentTarget.getBoundingClientRect(), N = (s.clientX - c.left) / c.width;
520
- u(N * x);
510
+ function F(i) {
511
+ if (!y) return;
512
+ const l = i.currentTarget.getBoundingClientRect(), M = (i.clientX - l.left) / l.width;
513
+ u(M * y);
521
514
  }
522
- function S() {
523
- if (!r.current) return;
524
- const s = !D;
525
- P(s), r.current.muted = s;
515
+ function P() {
516
+ if (!a.current) return;
517
+ const i = !D;
518
+ C(i), a.current.muted = i;
526
519
  }
527
- return C ? /* @__PURE__ */ e($, { message: "Could not load audio", url: a }) : /* @__PURE__ */ d("div", { ref: m, className: "rounded-ds-lg border border-surface-border bg-surface-raised shadow-raised overflow-hidden", tabIndex: -1, children: [
520
+ return T ? /* @__PURE__ */ e($, { message: "Could not load audio", url: r }) : /* @__PURE__ */ d("div", { ref: v, className: "rounded-ds-lg border border-surface-border bg-surface-raised shadow-raised overflow-hidden", tabIndex: -1, children: [
528
521
  /* @__PURE__ */ e(
529
522
  "audio",
530
523
  {
531
- ref: r,
532
- src: a,
524
+ ref: a,
525
+ src: r,
533
526
  onTimeUpdate: () => {
534
- r.current && (k(r.current.currentTime), r.current.duration && v(r.current.currentTime / r.current.duration * 100));
535
- },
536
- onLoadedMetadata: () => {
537
- var s;
538
- return g(((s = r.current) == null ? void 0 : s.duration) ?? 0);
527
+ a.current && (N(a.current.currentTime), a.current.duration && g(a.current.currentTime / a.current.duration * 100));
539
528
  },
529
+ onLoadedMetadata: () => p(a.current?.duration ?? 0),
540
530
  onEnded: () => b(!1),
541
531
  onError: () => {
542
- w(!0), t == null || t("Audio failed to load");
532
+ x(!0), t?.("Audio failed to load");
543
533
  }
544
534
  }
545
535
  ),
@@ -547,12 +537,12 @@ function me({ url: a, fileName: o, onError: t }) {
547
537
  "div",
548
538
  {
549
539
  className: "relative h-1 w-full cursor-pointer bg-surface-sunken group/bar",
550
- onClick: M,
551
- onMouseMove: A,
540
+ onClick: S,
541
+ onMouseMove: F,
552
542
  onMouseLeave: () => u(null),
553
543
  role: "slider",
554
544
  "aria-label": "Audio progress",
555
- "aria-valuenow": Math.round(p),
545
+ "aria-valuenow": Math.round(h),
556
546
  "aria-valuemin": 0,
557
547
  "aria-valuemax": 100,
558
548
  tabIndex: 0,
@@ -561,22 +551,22 @@ function me({ url: a, fileName: o, onError: t }) {
561
551
  "div",
562
552
  {
563
553
  className: "absolute left-0 top-0 h-full bg-accent-9 transition-[width] duration-75",
564
- style: { width: `${p}%` }
554
+ style: { width: `${h}%` }
565
555
  }
566
556
  ),
567
- T !== null && /* @__PURE__ */ e(
557
+ E !== null && /* @__PURE__ */ e(
568
558
  "div",
569
559
  {
570
560
  className: "absolute -top-7 -translate-x-1/2 rounded-ds-sm bg-surface-overlay px-1.5 py-0.5 text-[10px] font-mono text-surface-fg shadow-floating pointer-events-none",
571
- style: { left: `${T / (x || 1) * 100}%` },
572
- children: j(T)
561
+ style: { left: `${E / (y || 1) * 100}%` },
562
+ children: j(E)
573
563
  }
574
564
  ),
575
565
  /* @__PURE__ */ e(
576
566
  "div",
577
567
  {
578
568
  className: "absolute top-1/2 -translate-y-1/2 h-2.5 w-2.5 rounded-full bg-accent-9 shadow-raised opacity-0 group-hover/bar:opacity-100 transition-opacity",
579
- style: { left: `${p}%`, marginLeft: "-5px" }
569
+ style: { left: `${h}%`, marginLeft: "-5px" }
580
570
  }
581
571
  )
582
572
  ]
@@ -588,18 +578,18 @@ function me({ url: a, fileName: o, onError: t }) {
588
578
  {
589
579
  variant: "solid",
590
580
  size: "icon-sm",
591
- onClick: i,
592
- "aria-label": h ? "Pause" : "Play",
581
+ onClick: o,
582
+ "aria-label": m ? "Pause" : "Play",
593
583
  className: "shrink-0",
594
- children: h ? /* @__PURE__ */ e(_, { className: "h-ico-sm w-ico-sm" }) : /* @__PURE__ */ e(K, { className: "h-ico-sm w-ico-sm ml-0.5" })
584
+ children: m ? /* @__PURE__ */ e(w, { icon: _, size: "sm" }) : /* @__PURE__ */ e(w, { icon: K, size: "sm", className: "ml-0.5" })
595
585
  }
596
586
  ),
597
587
  /* @__PURE__ */ d("div", { className: "flex-1 min-w-0", children: [
598
- o && /* @__PURE__ */ e("p", { className: "text-ds-sm font-semibold text-surface-fg truncate", children: o }),
588
+ s && /* @__PURE__ */ e("p", { className: "text-ds-sm font-semibold text-surface-fg truncate", children: s }),
599
589
  /* @__PURE__ */ d("p", { className: "text-ds-xs font-mono text-surface-fg-muted tabular-nums", children: [
600
- j(y),
590
+ j(k),
601
591
  " / ",
602
- j(x)
592
+ j(y)
603
593
  ] })
604
594
  ] }),
605
595
  /* @__PURE__ */ e(
@@ -607,33 +597,33 @@ function me({ url: a, fileName: o, onError: t }) {
607
597
  {
608
598
  volume: f,
609
599
  muted: D,
610
- onVolumeChange: (s) => {
611
- I(s), r.current && (r.current.volume = s), s > 0 && D && (P(!1), r.current && (r.current.muted = !1));
600
+ onVolumeChange: (i) => {
601
+ I(i), a.current && (a.current.volume = i), i > 0 && D && (C(!1), a.current && (a.current.muted = !1));
612
602
  },
613
- onMuteToggle: S,
603
+ onMuteToggle: P,
614
604
  variant: "light"
615
605
  }
616
606
  )
617
607
  ] })
618
608
  ] });
619
609
  }
620
- function he({ url: a, onError: o }) {
621
- const [t, r] = n.useState(!1), [m, h] = n.useState(!1), b = le(a);
610
+ function he({ url: r, onError: s }) {
611
+ const [t, a] = n.useState(!1), [v, m] = n.useState(!1), b = le(r);
622
612
  return n.useEffect(() => {
623
- const p = setTimeout(() => {
624
- t || (h(!0), o == null || o("Embed timed out"));
613
+ const h = setTimeout(() => {
614
+ t || (m(!0), s?.("Embed timed out"));
625
615
  }, 15e3);
626
- return () => clearTimeout(p);
627
- }, [t, o]), m ? /* @__PURE__ */ e($, { message: "Could not load embed", url: a }) : /* @__PURE__ */ d("div", { className: "relative w-full rounded-ds-md overflow-hidden", style: { aspectRatio: "16 / 9" }, children: [
616
+ return () => clearTimeout(h);
617
+ }, [t, s]), v ? /* @__PURE__ */ e($, { message: "Could not load embed", url: r }) : /* @__PURE__ */ d("div", { className: "relative w-full rounded-ds-md overflow-hidden", style: { aspectRatio: "16 / 9" }, children: [
628
618
  !t && /* @__PURE__ */ e(V, { className: "absolute inset-0" }),
629
619
  /* @__PURE__ */ e(
630
- E.iframe,
620
+ A.iframe,
631
621
  {
632
622
  src: b,
633
623
  title: "Embedded content",
634
- onLoad: () => r(!0),
624
+ onLoad: () => a(!0),
635
625
  onError: () => {
636
- h(!0), o == null || o("Embed failed to load");
626
+ m(!0), s?.("Embed failed to load");
637
627
  },
638
628
  initial: { opacity: 0 },
639
629
  animate: { opacity: t ? 1 : 0 },
@@ -644,32 +634,32 @@ function he({ url: a, onError: o }) {
644
634
  )
645
635
  ] });
646
636
  }
647
- function Ne({
648
- url: a,
649
- type: o,
637
+ function Me({
638
+ url: r,
639
+ type: s,
650
640
  mimeType: t,
651
- alt: r,
652
- initialPage: m = 1,
653
- fileName: h,
641
+ alt: a,
642
+ initialPage: v = 1,
643
+ fileName: m,
654
644
  fileSize: b,
655
- onError: p,
656
- className: v,
657
- ...x
645
+ onError: h,
646
+ className: g,
647
+ ...y
658
648
  }) {
659
- const g = o ?? ce(a, t), y = /* @__PURE__ */ e(V, { className: "h-64 w-full rounded-ds-md" });
660
- return /* @__PURE__ */ d("div", { className: R("flex flex-col gap-ds-03", v), ...x, children: [
661
- (h || b) && /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03", children: [
662
- h && /* @__PURE__ */ e("span", { className: "text-ds-sm font-semibold text-surface-fg truncate", children: h }),
649
+ const p = s ?? ce(r, t), k = /* @__PURE__ */ e(V, { className: "h-64 w-full rounded-ds-md" });
650
+ return /* @__PURE__ */ d("div", { className: z("flex flex-col gap-ds-03", g), ...y, children: [
651
+ (m || b) && /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03", children: [
652
+ m && /* @__PURE__ */ e("span", { className: "text-ds-sm font-semibold text-surface-fg truncate", children: m }),
663
653
  b && /* @__PURE__ */ e(J, { variant: "subtle", size: "xs", children: b })
664
654
  ] }),
665
- g === "image" && /* @__PURE__ */ e(n.Suspense, { fallback: y, children: /* @__PURE__ */ e(ue, { url: a, alt: r, onError: p }) }),
666
- g === "pdf" && /* @__PURE__ */ e(n.Suspense, { fallback: y, children: /* @__PURE__ */ e(de, { url: a, initialPage: m, onError: p }) }),
667
- g === "video" && /* @__PURE__ */ e(fe, { url: a, onError: p }),
668
- g === "audio" && /* @__PURE__ */ e(me, { url: a, fileName: h, onError: p }),
669
- g === "embed" && /* @__PURE__ */ e(he, { url: a, onError: p }),
670
- g !== "audio" && /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ e(L, { variant: "ghost", size: "xs", startIcon: /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" }), asChild: !0, children: /* @__PURE__ */ e("a", { href: a, download: !0, target: "_blank", rel: "noopener noreferrer", children: "Download" }) }) })
655
+ p === "image" && /* @__PURE__ */ e(n.Suspense, { fallback: k, children: /* @__PURE__ */ e(ue, { url: r, alt: a, onError: h }) }),
656
+ p === "pdf" && /* @__PURE__ */ e(n.Suspense, { fallback: k, children: /* @__PURE__ */ e(de, { url: r, initialPage: v, onError: h }) }),
657
+ p === "video" && /* @__PURE__ */ e(fe, { url: r, onError: h }),
658
+ p === "audio" && /* @__PURE__ */ e(me, { url: r, fileName: m, onError: h }),
659
+ p === "embed" && /* @__PURE__ */ e(he, { url: r, onError: h }),
660
+ p !== "audio" && /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ e(L, { variant: "ghost", size: "xs", startIcon: /* @__PURE__ */ e(w, { icon: W }), asChild: !0, children: /* @__PURE__ */ e("a", { href: r, download: !0, target: "_blank", rel: "noopener noreferrer", children: "Download" }) }) })
671
661
  ] });
672
662
  }
673
663
  export {
674
- Ne as FilePreview
664
+ Me as FilePreview
675
665
  };