@devalok/shilp-sutra 0.36.0 → 0.37.0-next.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 (530) hide show
  1. package/MIGRATION.md +346 -0
  2. package/README.md +26 -29
  3. package/dist/_chunks/badge-group.js +42 -42
  4. package/dist/_chunks/badge-group.js.map +1 -1
  5. package/dist/_chunks/chat.js +324 -327
  6. package/dist/_chunks/chat.js.map +1 -1
  7. package/dist/_chunks/date-picker.js +245 -245
  8. package/dist/_chunks/date-picker.js.map +1 -1
  9. package/dist/_chunks/document-preview.js +33 -33
  10. package/dist/_chunks/document-preview.js.map +1 -1
  11. package/dist/_chunks/file-preview.js +264 -264
  12. package/dist/_chunks/file-preview.js.map +1 -1
  13. package/dist/_chunks/image-preview.js +45 -45
  14. package/dist/_chunks/image-preview.js.map +1 -1
  15. package/dist/_chunks/mention-suggestion.js +85 -85
  16. package/dist/_chunks/mention-suggestion.js.map +1 -1
  17. package/dist/_chunks/motion-provider.js +13 -13
  18. package/dist/_chunks/motion-provider.js.map +1 -1
  19. package/dist/_chunks/popover.js +36 -36
  20. package/dist/_chunks/popover.js.map +1 -1
  21. package/dist/_chunks/primitives.js +489 -489
  22. package/dist/_chunks/primitives.js.map +1 -1
  23. package/dist/_chunks/rich-chat-input.js +1066 -1066
  24. package/dist/_chunks/rich-chat-input.js.map +1 -1
  25. package/dist/_chunks/shared.js +43 -43
  26. package/dist/_chunks/shared.js.map +1 -1
  27. package/dist/_chunks/text.js +432 -0
  28. package/dist/_chunks/text.js.map +1 -0
  29. package/dist/_chunks/tiptap.js +6053 -6187
  30. package/dist/_chunks/tiptap.js.map +1 -1
  31. package/dist/_chunks/tree-view.js +97 -97
  32. package/dist/_chunks/tree-view.js.map +1 -1
  33. package/dist/_chunks/use-calendar.js.map +1 -1
  34. package/dist/ai/ai-command-provider.d.ts.map +1 -1
  35. package/dist/ai/ai-command-provider.js.map +1 -1
  36. package/dist/ai/block-renderer.d.ts.map +1 -1
  37. package/dist/ai/block-renderer.js +43 -43
  38. package/dist/ai/block-renderer.js.map +1 -1
  39. package/dist/ai/blocks/block-table.d.ts.map +1 -1
  40. package/dist/ai/blocks/confirm.d.ts.map +1 -1
  41. package/dist/ai/blocks/divider.d.ts.map +1 -1
  42. package/dist/ai/blocks/error.d.ts.map +1 -1
  43. package/dist/ai/blocks/index.d.ts +5 -5
  44. package/dist/ai/blocks/index.d.ts.map +1 -1
  45. package/dist/ai/blocks/index.js +2 -2
  46. package/dist/ai/blocks/info.d.ts.map +1 -1
  47. package/dist/ai/blocks/loading.d.ts.map +1 -1
  48. package/dist/ai/blocks/stat-row.d.ts.map +1 -1
  49. package/dist/ai/blocks/success.d.ts.map +1 -1
  50. package/dist/ai/blocks/text.d.ts.map +1 -1
  51. package/dist/ai/command-bar.d.ts +0 -11
  52. package/dist/ai/command-bar.d.ts.map +1 -1
  53. package/dist/ai/command-bar.js +128 -128
  54. package/dist/ai/command-bar.js.map +1 -1
  55. package/dist/ai/conversation.d.ts +1 -1
  56. package/dist/ai/conversation.d.ts.map +1 -1
  57. package/dist/ai/conversation.js +76 -76
  58. package/dist/ai/conversation.js.map +1 -1
  59. package/dist/ai/devadoot-icon.d.ts +0 -12
  60. package/dist/ai/devadoot-icon.d.ts.map +1 -1
  61. package/dist/ai/index.d.ts +11 -11
  62. package/dist/ai/index.d.ts.map +1 -1
  63. package/dist/ai/index.js +44 -44
  64. package/dist/ai/index.js.map +1 -1
  65. package/dist/composed/activity-feed.d.ts.map +1 -1
  66. package/dist/composed/activity-feed.js +93 -93
  67. package/dist/composed/activity-feed.js.map +1 -1
  68. package/dist/composed/avatar-group.d.ts.map +1 -1
  69. package/dist/composed/avatar-group.js +50 -50
  70. package/dist/composed/avatar-group.js.map +1 -1
  71. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  72. package/dist/composed/bulk-action-bar.js +40 -40
  73. package/dist/composed/bulk-action-bar.js.map +1 -1
  74. package/dist/composed/command-palette.d.ts +0 -6
  75. package/dist/composed/command-palette.d.ts.map +1 -1
  76. package/dist/composed/command-palette.js +131 -131
  77. package/dist/composed/command-palette.js.map +1 -1
  78. package/dist/composed/confirm-dialog.d.ts.map +1 -1
  79. package/dist/composed/confirm-dialog.js.map +1 -1
  80. package/dist/composed/content-card.d.ts.map +1 -1
  81. package/dist/composed/content-card.js.map +1 -1
  82. package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
  83. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  84. package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
  85. package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
  86. package/dist/composed/date-picker/index.d.ts +11 -11
  87. package/dist/composed/date-picker/index.d.ts.map +1 -1
  88. package/dist/composed/date-picker/index.js +1 -1
  89. package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
  90. package/dist/composed/date-picker/presets.d.ts.map +1 -1
  91. package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
  92. package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
  93. package/dist/composed/deadline-indicator.d.ts.map +1 -1
  94. package/dist/composed/deadline-indicator.js +25 -25
  95. package/dist/composed/deadline-indicator.js.map +1 -1
  96. package/dist/composed/emoji-picker.d.ts.map +1 -1
  97. package/dist/composed/emoji-picker.js +37 -37
  98. package/dist/composed/emoji-picker.js.map +1 -1
  99. package/dist/composed/empty-state.d.ts.map +1 -1
  100. package/dist/composed/empty-state.js +21 -21
  101. package/dist/composed/empty-state.js.map +1 -1
  102. package/dist/composed/error-boundary.d.ts +1 -1
  103. package/dist/composed/error-boundary.d.ts.map +1 -1
  104. package/dist/composed/error-boundary.js.map +1 -1
  105. package/dist/composed/extensions/emoji-node.d.ts.map +1 -1
  106. package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -1
  107. package/dist/composed/extensions/file-attachment.d.ts.map +1 -1
  108. package/dist/composed/extensions/mention-suggestion.d.ts +1 -1
  109. package/dist/composed/extensions/mention-suggestion.d.ts.map +1 -1
  110. package/dist/composed/extensions/slash-command.d.ts +1 -1
  111. package/dist/composed/extensions/slash-command.d.ts.map +1 -1
  112. package/dist/composed/file-preview/audio-preview.d.ts.map +1 -1
  113. package/dist/composed/file-preview/document-preview.d.ts.map +1 -1
  114. package/dist/composed/file-preview/embed-preview.d.ts.map +1 -1
  115. package/dist/composed/file-preview/image-preview.d.ts.map +1 -1
  116. package/dist/composed/file-preview/shared.d.ts.map +1 -1
  117. package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
  118. package/dist/composed/file-preview.d.ts.map +1 -1
  119. package/dist/composed/filter-bar.d.ts +1 -1
  120. package/dist/composed/filter-bar.d.ts.map +1 -1
  121. package/dist/composed/filter-bar.js +54 -54
  122. package/dist/composed/filter-bar.js.map +1 -1
  123. package/dist/composed/form-section.d.ts.map +1 -1
  124. package/dist/composed/form-section.js +26 -26
  125. package/dist/composed/form-section.js.map +1 -1
  126. package/dist/composed/global-loading.d.ts.map +1 -1
  127. package/dist/composed/global-loading.js.map +1 -1
  128. package/dist/composed/index.d.ts +55 -55
  129. package/dist/composed/index.d.ts.map +1 -1
  130. package/dist/composed/index.js +17 -17
  131. package/dist/composed/inline-edit.d.ts.map +1 -1
  132. package/dist/composed/inline-edit.js.map +1 -1
  133. package/dist/composed/loading-skeleton.d.ts +1 -1
  134. package/dist/composed/loading-skeleton.d.ts.map +1 -1
  135. package/dist/composed/loading-skeleton.js.map +1 -1
  136. package/dist/composed/markdown-viewer.d.ts.map +1 -1
  137. package/dist/composed/markdown-viewer.js +3 -3
  138. package/dist/composed/markdown-viewer.js.map +1 -1
  139. package/dist/composed/master-detail.d.ts.map +1 -1
  140. package/dist/composed/master-detail.js +42 -42
  141. package/dist/composed/master-detail.js.map +1 -1
  142. package/dist/composed/member-picker.d.ts.map +1 -1
  143. package/dist/composed/member-picker.js.map +1 -1
  144. package/dist/composed/multi-select-popover.d.ts.map +1 -1
  145. package/dist/composed/multi-select-popover.js +55 -55
  146. package/dist/composed/multi-select-popover.js.map +1 -1
  147. package/dist/composed/page-header.d.ts.map +1 -1
  148. package/dist/composed/page-header.js.map +1 -1
  149. package/dist/composed/page-skeletons.d.ts.map +1 -1
  150. package/dist/composed/page-skeletons.js.map +1 -1
  151. package/dist/composed/priority-indicator.d.ts.map +1 -1
  152. package/dist/composed/priority-indicator.js +34 -34
  153. package/dist/composed/priority-indicator.js.map +1 -1
  154. package/dist/composed/responsive-overlay.d.ts.map +1 -1
  155. package/dist/composed/responsive-overlay.js.map +1 -1
  156. package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
  157. package/dist/composed/rich-chat-input/audio-player.d.ts.map +1 -1
  158. package/dist/composed/rich-chat-input/audio-waveform.d.ts.map +1 -1
  159. package/dist/composed/rich-chat-input/chat-toolbar.d.ts.map +1 -1
  160. package/dist/composed/rich-chat-input/recording-overlay.d.ts.map +1 -1
  161. package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
  162. package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
  163. package/dist/composed/rich-chat-input.d.ts +6 -6
  164. package/dist/composed/rich-chat-input.d.ts.map +1 -1
  165. package/dist/composed/rich-chat-input.js +1 -1
  166. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  167. package/dist/composed/rich-text-editor.js +25 -25
  168. package/dist/composed/rich-text-editor.js.map +1 -1
  169. package/dist/composed/schedule-view.d.ts.map +1 -1
  170. package/dist/composed/schedule-view.js +53 -53
  171. package/dist/composed/schedule-view.js.map +1 -1
  172. package/dist/composed/simple-tooltip.d.ts.map +1 -1
  173. package/dist/composed/simple-tooltip.js.map +1 -1
  174. package/dist/composed/status-badge.d.ts +1 -1
  175. package/dist/composed/status-badge.d.ts.map +1 -1
  176. package/dist/composed/status-badge.js +30 -30
  177. package/dist/composed/status-badge.js.map +1 -1
  178. package/dist/hooks/index.d.ts +3 -3
  179. package/dist/hooks/index.d.ts.map +1 -1
  180. package/dist/hooks/index.js +1 -1
  181. package/dist/hooks/use-color-mode.js.map +1 -1
  182. package/dist/hooks/use-toast.d.ts +1 -1
  183. package/dist/hooks/use-toast.d.ts.map +1 -1
  184. package/dist/motion/index.d.ts +2 -2
  185. package/dist/motion/index.d.ts.map +1 -1
  186. package/dist/motion/index.js.map +1 -1
  187. package/dist/motion/motion-provider.d.ts +1 -1
  188. package/dist/motion/motion-provider.d.ts.map +1 -1
  189. package/dist/motion/primitives-index.d.ts +1 -1
  190. package/dist/motion/primitives-index.d.ts.map +1 -1
  191. package/dist/motion/primitives-index.js +40 -40
  192. package/dist/motion/primitives-index.js.map +1 -1
  193. package/dist/motion/primitives.d.ts +1 -1
  194. package/dist/motion/primitives.d.ts.map +1 -1
  195. package/dist/shell/app-command-palette.d.ts +0 -8
  196. package/dist/shell/app-command-palette.d.ts.map +1 -1
  197. package/dist/shell/app-command-palette.js.map +1 -1
  198. package/dist/shell/bottom-navbar.d.ts +0 -6
  199. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  200. package/dist/shell/bottom-navbar.js +62 -62
  201. package/dist/shell/bottom-navbar.js.map +1 -1
  202. package/dist/shell/index.d.ts +8 -8
  203. package/dist/shell/index.d.ts.map +1 -1
  204. package/dist/shell/index.js +5 -5
  205. package/dist/shell/link-context.d.ts +1 -1
  206. package/dist/shell/link-context.d.ts.map +1 -1
  207. package/dist/shell/notification-center.d.ts +0 -6
  208. package/dist/shell/notification-center.d.ts.map +1 -1
  209. package/dist/shell/notification-center.js +54 -54
  210. package/dist/shell/notification-center.js.map +1 -1
  211. package/dist/shell/notification-preferences.d.ts +0 -6
  212. package/dist/shell/notification-preferences.d.ts.map +1 -1
  213. package/dist/shell/notification-preferences.js +22 -22
  214. package/dist/shell/notification-preferences.js.map +1 -1
  215. package/dist/shell/sidebar.d.ts.map +1 -1
  216. package/dist/shell/sidebar.js.map +1 -1
  217. package/dist/shell/top-bar.d.ts +0 -6
  218. package/dist/shell/top-bar.d.ts.map +1 -1
  219. package/dist/shell/top-bar.js.map +1 -1
  220. package/dist/tailwind/index.cjs +15 -499
  221. package/dist/tailwind/preset.d.ts +21 -0
  222. package/dist/tailwind/preset.d.ts.map +1 -1
  223. package/dist/tailwind/preset.js +14 -489
  224. package/dist/tailwind/preset.js.map +1 -1
  225. package/dist/tokens/animations.css +17 -0
  226. package/dist/tokens/base.css +26 -0
  227. package/dist/tokens/index.css +22 -0
  228. package/dist/tokens/semantic.css +436 -464
  229. package/dist/tokens/shilp-sutra.css +41 -0
  230. package/dist/tokens/typography-semantic.css +48 -41
  231. package/dist/tokens/utilities.css +276 -0
  232. package/dist/tokens/variants.css +14 -0
  233. package/dist/ui/accordion.d.ts +2 -2
  234. package/dist/ui/accordion.d.ts.map +1 -1
  235. package/dist/ui/accordion.js +23 -23
  236. package/dist/ui/accordion.js.map +1 -1
  237. package/dist/ui/alert-dialog.d.ts +2 -2
  238. package/dist/ui/alert-dialog.d.ts.map +1 -1
  239. package/dist/ui/alert-dialog.js +37 -37
  240. package/dist/ui/alert-dialog.js.map +1 -1
  241. package/dist/ui/alert.d.ts.map +1 -1
  242. package/dist/ui/alert.js +36 -36
  243. package/dist/ui/alert.js.map +1 -1
  244. package/dist/ui/aspect-ratio.d.ts +1 -1
  245. package/dist/ui/aspect-ratio.d.ts.map +1 -1
  246. package/dist/ui/aspect-ratio.js.map +1 -1
  247. package/dist/ui/autocomplete.d.ts +1 -1
  248. package/dist/ui/autocomplete.d.ts.map +1 -1
  249. package/dist/ui/autocomplete.js +27 -27
  250. package/dist/ui/autocomplete.js.map +1 -1
  251. package/dist/ui/avatar.d.ts +2 -2
  252. package/dist/ui/avatar.d.ts.map +1 -1
  253. package/dist/ui/avatar.js +41 -41
  254. package/dist/ui/avatar.js.map +1 -1
  255. package/dist/ui/badge-group.d.ts.map +1 -1
  256. package/dist/ui/badge-indicator.d.ts.map +1 -1
  257. package/dist/ui/badge-indicator.js +10 -10
  258. package/dist/ui/badge-indicator.js.map +1 -1
  259. package/dist/ui/badge.d.ts +2 -2
  260. package/dist/ui/badge.d.ts.map +1 -1
  261. package/dist/ui/banner.d.ts.map +1 -1
  262. package/dist/ui/banner.js +28 -28
  263. package/dist/ui/banner.js.map +1 -1
  264. package/dist/ui/breadcrumb.d.ts +1 -1
  265. package/dist/ui/breadcrumb.d.ts.map +1 -1
  266. package/dist/ui/breadcrumb.js.map +1 -1
  267. package/dist/ui/button-group.d.ts.map +1 -1
  268. package/dist/ui/button-group.js.map +1 -1
  269. package/dist/ui/button-processing.d.ts.map +1 -1
  270. package/dist/ui/button-processing.js +15 -15
  271. package/dist/ui/button-processing.js.map +1 -1
  272. package/dist/ui/button.d.ts.map +1 -1
  273. package/dist/ui/button.js +84 -84
  274. package/dist/ui/button.js.map +1 -1
  275. package/dist/ui/card.d.ts +1 -1
  276. package/dist/ui/card.d.ts.map +1 -1
  277. package/dist/ui/card.js +28 -28
  278. package/dist/ui/card.js.map +1 -1
  279. package/dist/ui/charts/_internal/axes.d.ts +1 -1
  280. package/dist/ui/charts/_internal/axes.d.ts.map +1 -1
  281. package/dist/ui/charts/_internal/grid-lines.d.ts.map +1 -1
  282. package/dist/ui/charts/_internal/legend.d.ts.map +1 -1
  283. package/dist/ui/charts/_internal/tooltip.d.ts +1 -1
  284. package/dist/ui/charts/_internal/tooltip.d.ts.map +1 -1
  285. package/dist/ui/charts/area-chart.d.ts.map +1 -1
  286. package/dist/ui/charts/bar-chart.d.ts +1 -1
  287. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  288. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  289. package/dist/ui/charts/gauge-chart.d.ts.map +1 -1
  290. package/dist/ui/charts/index.d.ts +5 -5
  291. package/dist/ui/charts/index.d.ts.map +1 -1
  292. package/dist/ui/charts/index.js +618 -618
  293. package/dist/ui/charts/index.js.map +1 -1
  294. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  295. package/dist/ui/charts/pie-chart.d.ts.map +1 -1
  296. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  297. package/dist/ui/charts/sparkline.d.ts.map +1 -1
  298. package/dist/ui/chat/date-separator.d.ts.map +1 -1
  299. package/dist/ui/chat/index.d.ts +4 -4
  300. package/dist/ui/chat/index.d.ts.map +1 -1
  301. package/dist/ui/chat/index.js +1 -1
  302. package/dist/ui/chat/message-input.d.ts.map +1 -1
  303. package/dist/ui/chat/message-list.d.ts.map +1 -1
  304. package/dist/ui/chat/message.d.ts +1 -1
  305. package/dist/ui/chat/message.d.ts.map +1 -1
  306. package/dist/ui/chat/system-message.d.ts.map +1 -1
  307. package/dist/ui/chat/typing-indicator.d.ts.map +1 -1
  308. package/dist/ui/chat/unread-separator.d.ts.map +1 -1
  309. package/dist/ui/checkbox.d.ts.map +1 -1
  310. package/dist/ui/checkbox.js +18 -18
  311. package/dist/ui/checkbox.js.map +1 -1
  312. package/dist/ui/code.d.ts.map +1 -1
  313. package/dist/ui/code.js.map +1 -1
  314. package/dist/ui/collapsible.d.ts +2 -2
  315. package/dist/ui/collapsible.d.ts.map +1 -1
  316. package/dist/ui/collapsible.js +10 -10
  317. package/dist/ui/collapsible.js.map +1 -1
  318. package/dist/ui/color-input.d.ts.map +1 -1
  319. package/dist/ui/color-input.js +85 -85
  320. package/dist/ui/color-input.js.map +1 -1
  321. package/dist/ui/color-swatch.d.ts.map +1 -1
  322. package/dist/ui/color-swatch.js.map +1 -1
  323. package/dist/ui/combobox.d.ts.map +1 -1
  324. package/dist/ui/combobox.js +58 -58
  325. package/dist/ui/combobox.js.map +1 -1
  326. package/dist/ui/container.d.ts.map +1 -1
  327. package/dist/ui/container.js.map +1 -1
  328. package/dist/ui/context-menu.d.ts +2 -2
  329. package/dist/ui/context-menu.d.ts.map +1 -1
  330. package/dist/ui/context-menu.js +47 -47
  331. package/dist/ui/context-menu.js.map +1 -1
  332. package/dist/ui/data-table-body.d.ts +1 -1
  333. package/dist/ui/data-table-body.d.ts.map +1 -1
  334. package/dist/ui/data-table-body.js +43 -43
  335. package/dist/ui/data-table-body.js.map +1 -1
  336. package/dist/ui/data-table-bulk-actions.js.map +1 -1
  337. package/dist/ui/data-table-card.d.ts.map +1 -1
  338. package/dist/ui/data-table-card.js +7 -7
  339. package/dist/ui/data-table-card.js.map +1 -1
  340. package/dist/ui/data-table-context.d.ts +1 -1
  341. package/dist/ui/data-table-context.d.ts.map +1 -1
  342. package/dist/ui/data-table-context.js.map +1 -1
  343. package/dist/ui/data-table-header.js +38 -38
  344. package/dist/ui/data-table-header.js.map +1 -1
  345. package/dist/ui/data-table-pagination.js.map +1 -1
  346. package/dist/ui/data-table-toolbar.d.ts.map +1 -1
  347. package/dist/ui/data-table-toolbar.js.map +1 -1
  348. package/dist/ui/data-table.d.ts +2 -2
  349. package/dist/ui/data-table.d.ts.map +1 -1
  350. package/dist/ui/data-table.js +5 -5
  351. package/dist/ui/data-table.js.map +1 -1
  352. package/dist/ui/devalok-grain.js +8 -8
  353. package/dist/ui/devalok-grain.js.map +1 -1
  354. package/dist/ui/dialog.d.ts +2 -2
  355. package/dist/ui/dialog.d.ts.map +1 -1
  356. package/dist/ui/dialog.js +41 -41
  357. package/dist/ui/dialog.js.map +1 -1
  358. package/dist/ui/dropdown-menu.d.ts +2 -2
  359. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  360. package/dist/ui/dropdown-menu.js +46 -46
  361. package/dist/ui/dropdown-menu.js.map +1 -1
  362. package/dist/ui/file-upload.d.ts.map +1 -1
  363. package/dist/ui/file-upload.js +54 -54
  364. package/dist/ui/file-upload.js.map +1 -1
  365. package/dist/ui/form.d.ts.map +1 -1
  366. package/dist/ui/form.js +17 -17
  367. package/dist/ui/form.js.map +1 -1
  368. package/dist/ui/hover-card.d.ts +2 -2
  369. package/dist/ui/hover-card.d.ts.map +1 -1
  370. package/dist/ui/hover-card.js +19 -19
  371. package/dist/ui/hover-card.js.map +1 -1
  372. package/dist/ui/icon-button.d.ts.map +1 -1
  373. package/dist/ui/icon-button.js.map +1 -1
  374. package/dist/ui/icon-group.d.ts.map +1 -1
  375. package/dist/ui/icon-group.js +4 -4
  376. package/dist/ui/icon-group.js.map +1 -1
  377. package/dist/ui/icon.d.ts.map +1 -1
  378. package/dist/ui/icon.js +32 -32
  379. package/dist/ui/icon.js.map +1 -1
  380. package/dist/ui/index.d.ts +57 -57
  381. package/dist/ui/index.d.ts.map +1 -1
  382. package/dist/ui/index.js +27 -27
  383. package/dist/ui/index.js.map +1 -1
  384. package/dist/ui/input-otp.d.ts +1 -1
  385. package/dist/ui/input-otp.d.ts.map +1 -1
  386. package/dist/ui/input-otp.js.map +1 -1
  387. package/dist/ui/input.d.ts.map +1 -1
  388. package/dist/ui/input.js +14 -14
  389. package/dist/ui/input.js.map +1 -1
  390. package/dist/ui/label.d.ts +1 -1
  391. package/dist/ui/label.d.ts.map +1 -1
  392. package/dist/ui/label.js.map +1 -1
  393. package/dist/ui/lib/bottom-sheet.d.ts.map +1 -1
  394. package/dist/ui/lib/index.d.ts +4 -4
  395. package/dist/ui/lib/index.d.ts.map +1 -1
  396. package/dist/ui/lib/slot.d.ts +1 -1
  397. package/dist/ui/lib/slot.d.ts.map +1 -1
  398. package/dist/ui/lib/utils.d.ts.map +1 -1
  399. package/dist/ui/lib/utils.js.map +1 -1
  400. package/dist/ui/link.d.ts.map +1 -1
  401. package/dist/ui/link.js.map +1 -1
  402. package/dist/ui/menubar.d.ts +2 -2
  403. package/dist/ui/menubar.d.ts.map +1 -1
  404. package/dist/ui/menubar.js +64 -64
  405. package/dist/ui/menubar.js.map +1 -1
  406. package/dist/ui/navigation-menu.d.ts +2 -2
  407. package/dist/ui/navigation-menu.d.ts.map +1 -1
  408. package/dist/ui/navigation-menu.js +72 -72
  409. package/dist/ui/navigation-menu.js.map +1 -1
  410. package/dist/ui/number-input.d.ts.map +1 -1
  411. package/dist/ui/number-input.js.map +1 -1
  412. package/dist/ui/pagination.d.ts +1 -1
  413. package/dist/ui/pagination.d.ts.map +1 -1
  414. package/dist/ui/pagination.js.map +1 -1
  415. package/dist/ui/popover.d.ts +2 -2
  416. package/dist/ui/popover.d.ts.map +1 -1
  417. package/dist/ui/progress-ring.d.ts +1 -1
  418. package/dist/ui/progress-ring.d.ts.map +1 -1
  419. package/dist/ui/progress-ring.js +33 -33
  420. package/dist/ui/progress-ring.js.map +1 -1
  421. package/dist/ui/progress.d.ts +2 -2
  422. package/dist/ui/progress.d.ts.map +1 -1
  423. package/dist/ui/progress.js +23 -23
  424. package/dist/ui/progress.js.map +1 -1
  425. package/dist/ui/radio.d.ts.map +1 -1
  426. package/dist/ui/radio.js +19 -19
  427. package/dist/ui/radio.js.map +1 -1
  428. package/dist/ui/search-input.d.ts.map +1 -1
  429. package/dist/ui/search-input.js +17 -17
  430. package/dist/ui/search-input.js.map +1 -1
  431. package/dist/ui/segmented-control.d.ts.map +1 -1
  432. package/dist/ui/segmented-control.js +19 -19
  433. package/dist/ui/segmented-control.js.map +1 -1
  434. package/dist/ui/select.d.ts +2 -2
  435. package/dist/ui/select.d.ts.map +1 -1
  436. package/dist/ui/select.js +68 -68
  437. package/dist/ui/select.js.map +1 -1
  438. package/dist/ui/separator.d.ts +1 -1
  439. package/dist/ui/separator.d.ts.map +1 -1
  440. package/dist/ui/separator.js.map +1 -1
  441. package/dist/ui/sheet.d.ts +2 -2
  442. package/dist/ui/sheet.d.ts.map +1 -1
  443. package/dist/ui/sheet.js +44 -44
  444. package/dist/ui/sheet.js.map +1 -1
  445. package/dist/ui/sidebar.d.ts +1 -1
  446. package/dist/ui/sidebar.d.ts.map +1 -1
  447. package/dist/ui/sidebar.js +156 -156
  448. package/dist/ui/sidebar.js.map +1 -1
  449. package/dist/ui/skeleton.d.ts +1 -1
  450. package/dist/ui/skeleton.d.ts.map +1 -1
  451. package/dist/ui/skeleton.js +2 -2
  452. package/dist/ui/skeleton.js.map +1 -1
  453. package/dist/ui/slider.d.ts +2 -2
  454. package/dist/ui/slider.d.ts.map +1 -1
  455. package/dist/ui/slider.js +5 -5
  456. package/dist/ui/slider.js.map +1 -1
  457. package/dist/ui/spinner.d.ts.map +1 -1
  458. package/dist/ui/spinner.js +21 -21
  459. package/dist/ui/spinner.js.map +1 -1
  460. package/dist/ui/split-button.d.ts +1 -1
  461. package/dist/ui/split-button.d.ts.map +1 -1
  462. package/dist/ui/split-button.js +28 -28
  463. package/dist/ui/split-button.js.map +1 -1
  464. package/dist/ui/stack.d.ts +1 -1
  465. package/dist/ui/stack.d.ts.map +1 -1
  466. package/dist/ui/stack.js.map +1 -1
  467. package/dist/ui/stat-card.d.ts.map +1 -1
  468. package/dist/ui/stat-card.js +73 -73
  469. package/dist/ui/stat-card.js.map +1 -1
  470. package/dist/ui/status-dot.d.ts.map +1 -1
  471. package/dist/ui/status-dot.js.map +1 -1
  472. package/dist/ui/stepper.d.ts +1 -1
  473. package/dist/ui/stepper.d.ts.map +1 -1
  474. package/dist/ui/stepper.js +48 -48
  475. package/dist/ui/stepper.js.map +1 -1
  476. package/dist/ui/switch.d.ts +1 -1
  477. package/dist/ui/switch.d.ts.map +1 -1
  478. package/dist/ui/switch.js +15 -15
  479. package/dist/ui/switch.js.map +1 -1
  480. package/dist/ui/table.d.ts +1 -1
  481. package/dist/ui/table.d.ts.map +1 -1
  482. package/dist/ui/table.js.map +1 -1
  483. package/dist/ui/tabs.d.ts +2 -2
  484. package/dist/ui/tabs.d.ts.map +1 -1
  485. package/dist/ui/tabs.js +52 -52
  486. package/dist/ui/tabs.js.map +1 -1
  487. package/dist/ui/text.d.ts +1 -1
  488. package/dist/ui/text.d.ts.map +1 -1
  489. package/dist/ui/text.js.map +1 -1
  490. package/dist/ui/textarea.d.ts.map +1 -1
  491. package/dist/ui/textarea.js +13 -13
  492. package/dist/ui/textarea.js.map +1 -1
  493. package/dist/ui/toast-registry.js.map +1 -1
  494. package/dist/ui/toast.d.ts +3 -3
  495. package/dist/ui/toast.d.ts.map +1 -1
  496. package/dist/ui/toast.js +164 -164
  497. package/dist/ui/toast.js.map +1 -1
  498. package/dist/ui/toaster.d.ts.map +1 -1
  499. package/dist/ui/toaster.js +6 -6
  500. package/dist/ui/toaster.js.map +1 -1
  501. package/dist/ui/toggle-group.d.ts +1 -1
  502. package/dist/ui/toggle-group.d.ts.map +1 -1
  503. package/dist/ui/toggle-group.js.map +1 -1
  504. package/dist/ui/toggle.d.ts +1 -1
  505. package/dist/ui/toggle.d.ts.map +1 -1
  506. package/dist/ui/toggle.js +14 -14
  507. package/dist/ui/toggle.js.map +1 -1
  508. package/dist/ui/tooltip.d.ts +2 -2
  509. package/dist/ui/tooltip.d.ts.map +1 -1
  510. package/dist/ui/tooltip.js +26 -26
  511. package/dist/ui/tooltip.js.map +1 -1
  512. package/dist/ui/tree-view/index.d.ts +2 -2
  513. package/dist/ui/tree-view/index.d.ts.map +1 -1
  514. package/dist/ui/tree-view/index.js +1 -1
  515. package/dist/ui/tree-view/tree-view.d.ts +1 -1
  516. package/dist/ui/tree-view/tree-view.d.ts.map +1 -1
  517. package/dist/ui/visually-hidden.d.ts.map +1 -1
  518. package/dist/ui/visually-hidden.js.map +1 -1
  519. package/docs/components/_header.md +96 -0
  520. package/docs/rollback.md +179 -0
  521. package/llms-full.txt +97 -1
  522. package/llms.txt +24 -2
  523. package/package.json +296 -277
  524. package/dist/_chunks/framer.js +0 -5604
  525. package/dist/_chunks/framer.js.map +0 -1
  526. package/dist/_chunks/rolldown-runtime.js +0 -21
  527. package/dist/_chunks/sonner.js +0 -616
  528. package/dist/_chunks/sonner.js.map +0 -1
  529. package/dist/_chunks/stat-row.js +0 -432
  530. package/dist/_chunks/stat-row.js.map +0 -1
@@ -1,28 +1,28 @@
1
1
  "use client";
2
2
  import { ln as e, mn as t, pn as n, un as r } from "./primitives.js";
3
- import { a as i, c as a, n as o } from "./framer.js";
4
- import { durations as s } from "../ui/lib/motion.js";
5
- import { cn as c } from "../ui/lib/utils.js";
6
- import { Spinner as l } from "../ui/spinner.js";
7
- import { Icon as u } from "../ui/icon.js";
8
- import { useIsMobile as d } from "../hooks/use-mobile.js";
9
- import { Button as f } from "../ui/button.js";
10
- import { Dialog as p, DialogContent as m, DialogFooter as h, DialogHeader as g, DialogTitle as _ } from "../ui/dialog.js";
11
- import { SplitButton as v } from "../ui/split-button.js";
12
- import { emojiDataLoaders as y } from "../composed/emoji-picker.js";
13
- import { c as b, d as x, g as ee, h as S, i as C, l as te, m as ne, n as re, o as ie, r as w, s as ae, t as T, y as oe } from "./tiptap.js";
3
+ import { durations as i } from "../ui/lib/motion.js";
4
+ import { cn as a } from "../ui/lib/utils.js";
5
+ import { Spinner as o } from "../ui/spinner.js";
6
+ import { Icon as s } from "../ui/icon.js";
7
+ import { useIsMobile as c } from "../hooks/use-mobile.js";
8
+ import { Button as l } from "../ui/button.js";
9
+ import { Dialog as u, DialogContent as d, DialogFooter as f, DialogHeader as p, DialogTitle as m } from "../ui/dialog.js";
10
+ import { SplitButton as h } from "../ui/split-button.js";
11
+ import { emojiDataLoaders as g } from "../composed/emoji-picker.js";
12
+ import { n as _, t as v } from "./use-calendar.js";
13
+ import { a as y, c as b, d as x, g as S, h as C, i as w, l as ee, m as te, n as ne, o as re, s as ie, u as ae, y as oe } from "./tiptap.js";
14
14
  import { a as se, i as ce, n as le, o as ue, r as de, t as fe } from "./mention-suggestion.js";
15
15
  import { useColorMode as pe } from "../hooks/use-color-mode.js";
16
- import { n as me, t as E } from "./use-calendar.js";
17
- import * as D from "react";
18
- import { useCallback as O, useEffect as he, useRef as k, useState as A } from "react";
19
- import { Fragment as ge, jsx as j, jsxs as M } from "react/jsx-runtime";
20
- import * as _e from "react-dom";
21
- import { IconAt as ve, IconBlockquote as N, IconBold as ye, IconCalendarEvent as be, IconChevronDown as xe, IconClock as Se, IconCode as Ce, IconFile as we, IconHighlight as Te, IconItalic as P, IconLink as Ee, IconList as F, IconListNumbers as De, IconMicrophone as Oe, IconMoodSmile as ke, IconPencil as Ae, IconPlayerPause as je, IconPlayerPlay as I, IconPlus as Me, IconSend as Ne, IconSlash as L, IconSquare as Pe, IconStrikethrough as R, IconTextSize as Fe, IconTrash as Ie, IconUnderline as Le, IconX as z } from "@tabler/icons-react";
16
+ import * as T from "react";
17
+ import { useCallback as E, useEffect as me, useRef as D, useState as O } from "react";
18
+ import { Fragment as he, jsx as k, jsxs as A } from "react/jsx-runtime";
19
+ import * as ge from "react-dom";
20
+ import { IconAt as _e, IconBlockquote as ve, IconBold as j, IconCalendarEvent as ye, IconChevronDown as be, IconClock as xe, IconCode as Se, IconFile as Ce, IconHighlight as we, IconItalic as Te, IconLink as M, IconList as Ee, IconListNumbers as N, IconMicrophone as De, IconMoodSmile as Oe, IconPencil as ke, IconPlayerPause as Ae, IconPlayerPlay as je, IconPlus as Me, IconSend as Ne, IconSlash as P, IconSquare as Pe, IconStrikethrough as F, IconTextSize as Fe, IconTrash as Ie, IconUnderline as I, IconX as L } from "@tabler/icons-react";
21
+ import { AnimatePresence as R, motion as z, useReducedMotion as Le } from "framer-motion";
22
22
  import { createRoot as Re } from "react-dom/client";
23
23
  //#region src/composed/extensions/slash-command.tsx
24
- var B = D.forwardRef(({ groups: e, query: t, command: n }, r) => {
25
- let [i, a] = D.useState(0), o = D.useMemo(() => {
24
+ var B = T.forwardRef(({ groups: e, query: t, command: n }, r) => {
25
+ let [i, o] = T.useState(0), s = T.useMemo(() => {
26
26
  let n = t.toLowerCase(), r = [];
27
27
  return e.forEach((e, t) => {
28
28
  e.commands.forEach((e) => {
@@ -33,48 +33,48 @@ var B = D.forwardRef(({ groups: e, query: t, command: n }, r) => {
33
33
  });
34
34
  }), r;
35
35
  }, [e, t]);
36
- if (D.useEffect(() => a(0), [o]), D.useImperativeHandle(r, () => ({ onKeyDown: ({ event: e }) => e.key === "ArrowUp" ? (a((e) => (e + o.length - 1) % o.length), !0) : e.key === "ArrowDown" ? (a((e) => (e + 1) % o.length), !0) : e.key === "Enter" ? (o[i] && n(o[i].command), !0) : !1 })), !o.length) return null;
37
- let s = [], l = 0;
38
- for (let t of o) {
39
- let n = e[t.groupIndex].label, r = s[s.length - 1];
36
+ if (T.useEffect(() => o(0), [s]), T.useImperativeHandle(r, () => ({ onKeyDown: ({ event: e }) => e.key === "ArrowUp" ? (o((e) => (e + s.length - 1) % s.length), !0) : e.key === "ArrowDown" ? (o((e) => (e + 1) % s.length), !0) : e.key === "Enter" ? (s[i] && n(s[i].command), !0) : !1 })), !s.length) return null;
37
+ let c = [], l = 0;
38
+ for (let t of s) {
39
+ let n = e[t.groupIndex].label, r = c[c.length - 1];
40
40
  (!r || r.label !== n) && (r = {
41
41
  label: n,
42
42
  items: []
43
- }, s.push(r)), r.items.push({
43
+ }, c.push(r)), r.items.push({
44
44
  command: t.command,
45
45
  flatIndex: l
46
46
  }), l++;
47
47
  }
48
- return /* @__PURE__ */ j("div", {
48
+ return /* @__PURE__ */ k("div", {
49
49
  role: "listbox",
50
50
  "aria-label": "Slash commands",
51
51
  className: "z-popover max-h-[320px] min-w-[220px] overflow-x-hidden overflow-y-auto rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-02 shadow-floating",
52
- children: s.map((e, t) => /* @__PURE__ */ M("div", {
52
+ children: c.map((e, t) => /* @__PURE__ */ A("div", {
53
53
  role: "group",
54
54
  "aria-label": e.label,
55
55
  children: [
56
- t > 0 && /* @__PURE__ */ j("div", { className: "my-ds-01 border-t border-surface-border" }),
57
- /* @__PURE__ */ j("div", {
56
+ t > 0 && /* @__PURE__ */ k("div", { className: "my-ds-01 border-t border-surface-border" }),
57
+ /* @__PURE__ */ k("div", {
58
58
  className: "px-ds-03 py-ds-01 text-ds-xs font-medium text-surface-fg-subtle",
59
59
  children: e.label
60
60
  }),
61
61
  e.items.map(({ command: e, flatIndex: t }) => {
62
62
  let r = e.icon;
63
- return /* @__PURE__ */ M("button", {
63
+ return /* @__PURE__ */ A("button", {
64
64
  type: "button",
65
65
  role: "option",
66
66
  "aria-selected": t === i,
67
67
  onClick: () => n(e),
68
- className: c("flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02 text-left cursor-pointer", t === i ? "bg-surface-raised-hover" : "hover:bg-surface-raised-hover"),
69
- children: [r && /* @__PURE__ */ j("span", {
68
+ className: a("flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02 text-left cursor-pointer", t === i ? "bg-surface-raised-hover" : "hover:bg-surface-raised-hover"),
69
+ children: [r && /* @__PURE__ */ k("span", {
70
70
  className: "flex h-4 w-4 shrink-0 items-center justify-center text-surface-fg-muted",
71
- children: /* @__PURE__ */ j(r, { className: "h-4 w-4" })
72
- }), /* @__PURE__ */ M("div", {
71
+ children: /* @__PURE__ */ k(r, { className: "h-4 w-4" })
72
+ }), /* @__PURE__ */ A("div", {
73
73
  className: "flex flex-col",
74
- children: [/* @__PURE__ */ j("span", {
74
+ children: [/* @__PURE__ */ k("span", {
75
75
  className: "text-ds-sm text-surface-fg",
76
76
  children: e.label
77
- }), e.description && /* @__PURE__ */ j("span", {
77
+ }), e.description && /* @__PURE__ */ k("span", {
78
78
  className: "text-ds-xs text-surface-fg-subtle",
79
79
  children: e.description
80
80
  })]
@@ -93,7 +93,7 @@ function ze(e) {
93
93
  onStart: (i) => {
94
94
  n = document.createElement("div"), n.style.position = "absolute", n.style.zIndex = "1400";
95
95
  let a = i.clientRect?.();
96
- a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), document.body.appendChild(n), t = Re(n), t.render(/* @__PURE__ */ j(B, {
96
+ a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), document.body.appendChild(n), t = Re(n), t.render(/* @__PURE__ */ k(B, {
97
97
  ref: (e) => {
98
98
  r = e;
99
99
  },
@@ -105,7 +105,7 @@ function ze(e) {
105
105
  onUpdate: (i) => {
106
106
  if (!t || !n) return;
107
107
  let a = i.clientRect?.();
108
- a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), t.render(/* @__PURE__ */ j(B, {
108
+ a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), t.render(/* @__PURE__ */ k(B, {
109
109
  ref: (e) => {
110
110
  r = e;
111
111
  },
@@ -123,10 +123,10 @@ function ze(e) {
123
123
  }
124
124
  function Be(e) {
125
125
  let t = e.flatMap((e) => e.commands);
126
- return ee.create({
126
+ return S.create({
127
127
  name: "slashCommand",
128
128
  addProseMirrorPlugins() {
129
- return [w({
129
+ return [ae({
130
130
  pluginKey: new oe("slashCommand"),
131
131
  editor: this.editor,
132
132
  char: "/",
@@ -146,430 +146,12 @@ function Be(e) {
146
146
  });
147
147
  }
148
148
  //#endregion
149
- //#region src/composed/rich-chat-input/reply-banner.tsx
150
- function Ve({ author: e, preview: t, onDismiss: n }) {
151
- return /* @__PURE__ */ j(i.div, {
152
- initial: {
153
- height: 0,
154
- opacity: 0
155
- },
156
- animate: {
157
- height: "auto",
158
- opacity: 1
159
- },
160
- exit: {
161
- height: 0,
162
- opacity: 0
163
- },
164
- transition: {
165
- duration: s.moderate02,
166
- ease: [
167
- .2,
168
- 0,
169
- .38,
170
- .9
171
- ]
172
- },
173
- className: "overflow-hidden",
174
- children: /* @__PURE__ */ M("div", {
175
- role: "status",
176
- "aria-label": `Replying to ${e}`,
177
- className: "flex items-center gap-ds-03 border-b border-surface-border px-ds-04 py-ds-02b",
178
- children: [/* @__PURE__ */ M("div", {
179
- className: "flex-1 min-w-0",
180
- children: [
181
- /* @__PURE__ */ M("span", {
182
- className: "text-ds-sm font-semibold text-surface-fg",
183
- children: ["Replying to ", e]
184
- }),
185
- /* @__PURE__ */ j("span", {
186
- className: "mx-ds-02 text-surface-fg-subtle",
187
- children: "·"
188
- }),
189
- /* @__PURE__ */ j("span", {
190
- className: "text-ds-sm text-surface-fg-muted truncate",
191
- children: t
192
- })
193
- ]
194
- }), /* @__PURE__ */ j("button", {
195
- type: "button",
196
- onClick: n,
197
- className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "text-surface-fg-subtle hover:text-surface-fg hover:bg-surface-raised-hover", "transition-colors duration-fast-01 ease-productive-standard", "active:scale-95"),
198
- "aria-label": "Cancel reply",
199
- title: "Cancel reply",
200
- children: /* @__PURE__ */ j(u, {
201
- icon: z,
202
- size: "xs"
203
- })
204
- })]
205
- })
206
- });
207
- }
208
- //#endregion
209
- //#region src/composed/rich-chat-input/schedule-send.tsx
210
- function He() {
211
- let e = /* @__PURE__ */ new Date(), t = e.getHours(), n = [], r = (t, n = 0) => {
212
- let r = new Date(e);
213
- return r.setDate(r.getDate() + n), r.setHours(t, 0, 0, 0), r;
214
- }, i = (t) => {
215
- let n = new Date(e), r = n.getDay(), i = r === 0 ? 1 : r === 1 ? 7 : 8 - r;
216
- return n.setDate(n.getDate() + i), n.setHours(t, 0, 0, 0), n;
217
- };
218
- t < 9 ? (n.push({
219
- label: "Later this morning · 9:00 AM",
220
- date: r(9)
221
- }), n.push({
222
- label: "This afternoon · 1:00 PM",
223
- date: r(13)
224
- }), n.push({
225
- label: "This evening · 6:00 PM",
226
- date: r(18)
227
- })) : t < 13 ? (n.push({
228
- label: "This afternoon · 1:00 PM",
229
- date: r(13)
230
- }), n.push({
231
- label: "This evening · 6:00 PM",
232
- date: r(18)
233
- }), n.push({
234
- label: "Tomorrow morning · 9:00 AM",
235
- date: r(9, 1)
236
- })) : t < 18 ? (n.push({
237
- label: "This evening · 6:00 PM",
238
- date: r(18)
239
- }), n.push({
240
- label: "Tomorrow morning · 9:00 AM",
241
- date: r(9, 1)
242
- }), n.push({
243
- label: "Tomorrow afternoon · 1:00 PM",
244
- date: r(13, 1)
245
- })) : (n.push({
246
- label: "Tomorrow morning · 9:00 AM",
247
- date: r(9, 1)
248
- }), n.push({
249
- label: "Tomorrow afternoon · 1:00 PM",
250
- date: r(13, 1)
251
- }));
252
- let a = i(9);
253
- return a.getTime() - e.getTime() > 2880 * 60 * 1e3 && n.push({
254
- label: "Next Monday · 9:00 AM",
255
- date: a
256
- }), n;
257
- }
258
- function Ue({ value: e, onChange: t }) {
259
- let n = e.getHours() % 12 || 12, r = e.getMinutes(), i = e.getHours() >= 12, a = (n) => {
260
- let r = new Date(e);
261
- r.setHours(i ? n % 12 + 12 : n % 12), t(r);
262
- }, o = (n) => {
263
- let r = new Date(e);
264
- r.setMinutes(n), t(r);
265
- }, s = (n) => {
266
- let r = new Date(e), i = r.getHours();
267
- n && i < 12 ? r.setHours(i + 12) : !n && i >= 12 && r.setHours(i - 12), t(r);
268
- };
269
- return /* @__PURE__ */ M("div", {
270
- className: "flex items-center gap-ds-02",
271
- children: [
272
- /* @__PURE__ */ j("select", {
273
- value: n,
274
- onChange: (e) => a(Number(e.target.value)),
275
- className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9",
276
- "aria-label": "Hour",
277
- children: Array.from({ length: 12 }, (e, t) => t + 1).map((e) => /* @__PURE__ */ j("option", {
278
- value: e,
279
- children: e
280
- }, e))
281
- }),
282
- /* @__PURE__ */ j("span", {
283
- className: "text-ds-sm text-surface-fg-subtle font-medium",
284
- children: ":"
285
- }),
286
- /* @__PURE__ */ j("select", {
287
- value: r - r % 5,
288
- onChange: (e) => o(Number(e.target.value)),
289
- className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9",
290
- "aria-label": "Minute",
291
- children: Array.from({ length: 12 }, (e, t) => t * 5).map((e) => /* @__PURE__ */ j("option", {
292
- value: e,
293
- children: String(e).padStart(2, "0")
294
- }, e))
295
- }),
296
- /* @__PURE__ */ M("div", {
297
- className: "inline-flex rounded-ds-md border border-surface-border-strong overflow-hidden",
298
- children: [/* @__PURE__ */ j("button", {
299
- type: "button",
300
- onClick: () => s(!1),
301
- className: c("px-ds-02b py-ds-01 text-ds-xs font-medium transition-colors duration-fast-01", i ? "bg-surface-raised text-surface-fg-subtle hover:bg-surface-raised-hover" : "bg-accent-9 text-white"),
302
- children: "AM"
303
- }), /* @__PURE__ */ j("button", {
304
- type: "button",
305
- onClick: () => s(!0),
306
- className: c("px-ds-02b py-ds-01 text-ds-xs font-medium transition-colors duration-fast-01", i ? "bg-accent-9 text-white" : "bg-surface-raised text-surface-fg-subtle hover:bg-surface-raised-hover"),
307
- children: "PM"
308
- })]
309
- })
310
- ]
311
- });
312
- }
313
- function We({ value: e, onChange: t, minDate: n }) {
314
- let r = /* @__PURE__ */ new Date(), i = e ?? (() => {
315
- let e = new Date(r);
316
- return e.setHours(e.getHours() + 1, 0, 0, 0), e;
317
- })(), a = `${i.getFullYear()}-${String(i.getMonth() + 1).padStart(2, "0")}-${String(i.getDate()).padStart(2, "0")}`, o = (e) => {
318
- let n = e.target.value.split("-");
319
- if (n.length !== 3) return;
320
- let r = new Date(i);
321
- r.setFullYear(Number(n[0]), Number(n[1]) - 1, Number(n[2])), t(r);
322
- }, s = n ? `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}` : void 0;
323
- return /* @__PURE__ */ M("div", {
324
- className: "space-y-ds-03",
325
- children: [/* @__PURE__ */ M("div", {
326
- className: "flex items-center justify-between",
327
- children: [/* @__PURE__ */ j("span", {
328
- className: "text-ds-xs font-medium text-surface-fg-subtle",
329
- children: "Date"
330
- }), /* @__PURE__ */ j("input", {
331
- type: "date",
332
- value: a,
333
- min: s,
334
- onChange: o,
335
- className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-03 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9"
336
- })]
337
- }), /* @__PURE__ */ M("div", {
338
- className: "flex items-center justify-between",
339
- children: [/* @__PURE__ */ j("span", {
340
- className: "text-ds-xs font-medium text-surface-fg-subtle",
341
- children: "Time"
342
- }), /* @__PURE__ */ j(Ue, {
343
- value: i,
344
- onChange: t
345
- })]
346
- })]
347
- });
348
- }
349
- function Ge({ value: e, onChange: t, minDate: n }) {
350
- let r = /* @__PURE__ */ new Date(), i = e ?? (() => {
351
- let e = new Date(r);
352
- return e.setHours(e.getHours() + 1, 0, 0, 0), e;
353
- })(), { currentMonth: a, goToPreviousMonth: o, goToNextMonth: s } = E(i);
354
- return /* @__PURE__ */ M("div", {
355
- className: "space-y-ds-03",
356
- children: [/* @__PURE__ */ j(me, {
357
- currentMonth: a,
358
- selected: i,
359
- onSelect: (e) => {
360
- let n = new Date(e);
361
- n.setHours(i.getHours(), i.getMinutes(), 0, 0), t(n);
362
- },
363
- onMonthChange: (e) => {
364
- e < a ? o() : s();
365
- },
366
- minDate: n,
367
- className: "w-full"
368
- }), /* @__PURE__ */ M("div", {
369
- className: "flex items-center justify-between border-t border-surface-border pt-ds-03",
370
- children: [/* @__PURE__ */ j("span", {
371
- className: "text-ds-xs font-medium text-surface-fg-subtle",
372
- children: "Time"
373
- }), /* @__PURE__ */ j(Ue, {
374
- value: i,
375
- onChange: t
376
- })]
377
- })]
378
- });
379
- }
380
- function Ke({ onSchedule: e, onClose: t, onOpenDialog: n }) {
381
- let [r, i] = D.useState(!1), [a, o] = D.useState(null), s = D.useMemo(() => He(), []), c = (n) => {
382
- e(n), t();
383
- };
384
- return r ? /* @__PURE__ */ M("div", {
385
- className: "p-ds-04",
386
- style: { minWidth: 270 },
387
- children: [
388
- /* @__PURE__ */ M("div", {
389
- className: "mb-ds-03 flex items-center justify-between",
390
- children: [/* @__PURE__ */ j("p", {
391
- className: "text-ds-sm font-medium text-surface-fg",
392
- children: "Pick date & time"
393
- }), /* @__PURE__ */ j("button", {
394
- type: "button",
395
- onClick: () => i(!1),
396
- className: "inline-flex items-center justify-center rounded-ds-md p-ds-01 text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg transition-colors",
397
- "aria-label": "Back to presets",
398
- children: /* @__PURE__ */ j(u, {
399
- icon: z,
400
- size: "sm"
401
- })
402
- })]
403
- }),
404
- /* @__PURE__ */ j(We, {
405
- value: a,
406
- onChange: o,
407
- minDate: /* @__PURE__ */ new Date()
408
- }),
409
- /* @__PURE__ */ j("div", {
410
- className: "mt-ds-03 flex justify-end",
411
- children: /* @__PURE__ */ j(f, {
412
- variant: "solid",
413
- size: "sm",
414
- onClick: () => {
415
- a && a > /* @__PURE__ */ new Date() && (e(a), t(), o(null), i(!1));
416
- },
417
- disabled: !a || a <= /* @__PURE__ */ new Date(),
418
- children: "Confirm"
419
- })
420
- })
421
- ]
422
- }) : /* @__PURE__ */ M("div", {
423
- className: "p-ds-02",
424
- style: { minWidth: 260 },
425
- children: [
426
- /* @__PURE__ */ j("p", {
427
- className: "px-ds-03 py-ds-01 text-ds-xs font-medium text-surface-fg-subtle",
428
- children: "Schedule send"
429
- }),
430
- s.map((e, t) => /* @__PURE__ */ M("button", {
431
- type: "button",
432
- onClick: () => c(e.date),
433
- className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
434
- children: [/* @__PURE__ */ j(u, {
435
- icon: Se,
436
- size: "sm",
437
- className: "shrink-0 text-surface-fg-muted"
438
- }), e.label]
439
- }, t)),
440
- /* @__PURE__ */ j("div", { className: "mx-ds-02 my-ds-02 h-px bg-surface-border" }),
441
- /* @__PURE__ */ M("button", {
442
- type: "button",
443
- onClick: () => i(!0),
444
- className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
445
- children: [/* @__PURE__ */ j(u, {
446
- icon: be,
447
- size: "sm",
448
- className: "shrink-0 text-accent-11"
449
- }), "Pick date & time..."]
450
- }),
451
- n && /* @__PURE__ */ M("button", {
452
- type: "button",
453
- onClick: () => {
454
- n(), t();
455
- },
456
- className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
457
- children: [/* @__PURE__ */ j(u, {
458
- icon: be,
459
- size: "sm",
460
- className: "shrink-0 text-surface-fg-muted"
461
- }), "Open full picker..."]
462
- })
463
- ]
464
- });
465
- }
466
- function qe({ open: e, onOpenChange: t, onSchedule: n, initialDate: r }) {
467
- let [i, a] = D.useState(r ?? null);
468
- return D.useEffect(() => {
469
- e && a(r ?? null);
470
- }, [e, r]), /* @__PURE__ */ j(p, {
471
- open: e,
472
- onOpenChange: t,
473
- children: /* @__PURE__ */ M(m, {
474
- className: "sm:max-w-[380px]",
475
- children: [
476
- /* @__PURE__ */ j(g, { children: /* @__PURE__ */ j(_, { children: r ? "Reschedule message" : "Schedule send" }) }),
477
- /* @__PURE__ */ j(Ge, {
478
- value: i,
479
- onChange: a,
480
- minDate: /* @__PURE__ */ new Date()
481
- }),
482
- /* @__PURE__ */ M(h, {
483
- className: "gap-ds-02",
484
- children: [/* @__PURE__ */ j(f, {
485
- variant: "soft",
486
- onClick: () => t(!1),
487
- children: "Cancel"
488
- }), /* @__PURE__ */ j(f, {
489
- variant: "solid",
490
- onClick: () => {
491
- i && i > /* @__PURE__ */ new Date() && (n(i), t(!1));
492
- },
493
- disabled: !i || i <= /* @__PURE__ */ new Date(),
494
- children: r ? "Reschedule" : "Schedule"
495
- })]
496
- })
497
- ]
498
- })
499
- });
500
- }
501
- function Je(e) {
502
- let t = /* @__PURE__ */ new Date(), n = new Date(t);
503
- n.setDate(n.getDate() + 1);
504
- let r = e.toDateString() === t.toDateString(), i = e.toDateString() === n.toDateString(), a = e.toLocaleTimeString(void 0, {
505
- hour: "numeric",
506
- minute: "2-digit"
507
- });
508
- return r ? `Today at ${a}` : i ? `Tomorrow at ${a}` : `${e.toLocaleDateString(void 0, {
509
- weekday: "short",
510
- month: "short",
511
- day: "numeric"
512
- })} at ${a}`;
513
- }
514
- function Ye({ date: e, onClear: t, onEdit: n }) {
515
- return /* @__PURE__ */ j(i.div, {
516
- initial: {
517
- height: 0,
518
- opacity: 0
519
- },
520
- animate: {
521
- height: "auto",
522
- opacity: 1
523
- },
524
- exit: {
525
- height: 0,
526
- opacity: 0
527
- },
528
- transition: { duration: s.moderate01 },
529
- className: "overflow-hidden",
530
- children: /* @__PURE__ */ M("div", {
531
- className: "flex items-center gap-ds-03 px-ds-04 py-ds-02b text-ds-xs text-accent-11 bg-accent-2 border-b border-accent-4",
532
- children: [
533
- /* @__PURE__ */ j(u, {
534
- icon: Se,
535
- size: "xs",
536
- className: "shrink-0"
537
- }),
538
- /* @__PURE__ */ M("span", {
539
- className: "flex-1 truncate",
540
- children: ["Scheduled for ", Je(e)]
541
- }),
542
- n && /* @__PURE__ */ j("button", {
543
- type: "button",
544
- onClick: n,
545
- className: "inline-flex shrink-0 items-center justify-center rounded-ds-sm p-ds-01 hover:bg-accent-3 transition-colors",
546
- "aria-label": "Edit schedule",
547
- children: /* @__PURE__ */ j(u, {
548
- icon: Ae,
549
- size: "xs"
550
- })
551
- }),
552
- /* @__PURE__ */ j("button", {
553
- type: "button",
554
- onClick: t,
555
- className: "inline-flex shrink-0 items-center justify-center rounded-ds-sm p-ds-01 hover:bg-accent-3 transition-colors",
556
- "aria-label": "Cancel schedule",
557
- children: /* @__PURE__ */ j(u, {
558
- icon: z,
559
- size: "xs"
560
- })
561
- })
562
- ]
563
- })
564
- });
565
- }
566
- //#endregion
567
149
  //#region src/composed/rich-chat-input/attachment-strip.tsx
568
- function Xe(e) {
150
+ function Ve(e) {
569
151
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
570
152
  }
571
- function Ze({ attachments: e, onRemoveAttachment: t }) {
572
- return /* @__PURE__ */ j(i.div, {
153
+ function He({ attachments: e, onRemoveAttachment: t }) {
154
+ return /* @__PURE__ */ k(z.div, {
573
155
  initial: {
574
156
  height: 0,
575
157
  opacity: 0
@@ -583,7 +165,7 @@ function Ze({ attachments: e, onRemoveAttachment: t }) {
583
165
  opacity: 0
584
166
  },
585
167
  transition: {
586
- duration: s.moderate02,
168
+ duration: i.moderate02,
587
169
  ease: [
588
170
  .2,
589
171
  0,
@@ -592,13 +174,13 @@ function Ze({ attachments: e, onRemoveAttachment: t }) {
592
174
  ]
593
175
  },
594
176
  className: "overflow-hidden",
595
- children: /* @__PURE__ */ j("div", {
177
+ children: /* @__PURE__ */ k("div", {
596
178
  role: "list",
597
179
  "aria-label": "Attachments",
598
180
  className: "flex gap-ds-02 overflow-x-auto px-ds-04 py-ds-02b border-b border-surface-border",
599
- children: /* @__PURE__ */ j(a, {
181
+ children: /* @__PURE__ */ k(R, {
600
182
  initial: !1,
601
- children: e.map((e) => e.type === "image" ? /* @__PURE__ */ M(i.div, {
183
+ children: e.map((e) => e.type === "image" ? /* @__PURE__ */ A(z.div, {
602
184
  role: "listitem",
603
185
  "aria-label": `Image: ${e.name}`,
604
186
  layout: !0,
@@ -625,33 +207,33 @@ function Ze({ attachments: e, onRemoveAttachment: t }) {
625
207
  stiffness: 400,
626
208
  damping: 30
627
209
  },
628
- opacity: { duration: s.fast02 }
210
+ opacity: { duration: i.fast02 }
629
211
  },
630
212
  className: "relative h-12 w-12 shrink-0 group",
631
213
  children: [
632
- /* @__PURE__ */ j("img", {
214
+ /* @__PURE__ */ k("img", {
633
215
  src: e.url,
634
216
  alt: e.name,
635
217
  className: "h-full w-full rounded-ds-md object-cover"
636
218
  }),
637
- /* @__PURE__ */ j("button", {
219
+ /* @__PURE__ */ k("button", {
638
220
  onClick: () => t(e.id),
639
221
  className: "absolute -top-1 -right-1 h-ico-sm w-ico-sm rounded-full bg-error-9 text-error-fg flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-fast-02",
640
222
  "aria-label": `Remove ${e.name}`,
641
223
  title: "Remove",
642
- children: /* @__PURE__ */ j(u, {
643
- icon: z,
224
+ children: /* @__PURE__ */ k(s, {
225
+ icon: L,
644
226
  size: "xs"
645
227
  })
646
228
  }),
647
- e.uploading && /* @__PURE__ */ j("div", {
229
+ e.uploading && /* @__PURE__ */ k("div", {
648
230
  className: "absolute inset-0 rounded-ds-md bg-surface-overlay/50 flex items-center justify-center",
649
- children: /* @__PURE__ */ j(l, { size: "sm" })
231
+ children: /* @__PURE__ */ k(o, { size: "sm" })
650
232
  })
651
233
  ]
652
- }, e.id) : /* @__PURE__ */ M(i.div, {
234
+ }, e.id) : /* @__PURE__ */ A(z.div, {
653
235
  role: "listitem",
654
- "aria-label": `File: ${e.name}, ${Xe(e.size)}`,
236
+ "aria-label": `File: ${e.name}, ${Ve(e.size)}`,
655
237
  layout: !0,
656
238
  initial: {
657
239
  scale: 0,
@@ -676,30 +258,30 @@ function Ze({ attachments: e, onRemoveAttachment: t }) {
676
258
  stiffness: 400,
677
259
  damping: 30
678
260
  },
679
- opacity: { duration: s.fast02 }
261
+ opacity: { duration: i.fast02 }
680
262
  },
681
263
  className: "flex items-center gap-ds-02 shrink-0 rounded-ds-md bg-surface-raised px-ds-03 py-ds-01 group",
682
264
  children: [
683
- /* @__PURE__ */ j(u, {
684
- icon: we,
265
+ /* @__PURE__ */ k(s, {
266
+ icon: Ce,
685
267
  size: "xs",
686
268
  className: "text-surface-fg-muted"
687
269
  }),
688
- /* @__PURE__ */ j("span", {
270
+ /* @__PURE__ */ k("span", {
689
271
  className: "text-ds-xs text-surface-fg-muted truncate max-w-[120px]",
690
272
  children: e.name
691
273
  }),
692
- /* @__PURE__ */ j("span", {
274
+ /* @__PURE__ */ k("span", {
693
275
  className: "text-ds-xs text-surface-fg-subtle",
694
- children: Xe(e.size)
276
+ children: Ve(e.size)
695
277
  }),
696
- /* @__PURE__ */ j("button", {
278
+ /* @__PURE__ */ k("button", {
697
279
  onClick: () => t(e.id),
698
280
  className: "text-surface-fg-subtle hover:text-error-11 opacity-0 group-hover:opacity-100 transition-opacity duration-fast-02",
699
281
  "aria-label": `Remove ${e.name}`,
700
282
  title: "Remove",
701
- children: /* @__PURE__ */ j(u, {
702
- icon: z,
283
+ children: /* @__PURE__ */ k(s, {
284
+ icon: L,
703
285
  size: "xs"
704
286
  })
705
287
  })
@@ -711,14 +293,14 @@ function Ze({ attachments: e, onRemoveAttachment: t }) {
711
293
  }
712
294
  //#endregion
713
295
  //#region src/composed/rich-chat-input/audio-waveform.tsx
714
- var V = D.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r = 0, barWidth: i = 3, barGap: a = 2, barCount: o = 40, height: s = 32, className: l, ...u }, d) {
715
- let [f, p] = D.useState(() => Array(o).fill(.05)), m = D.useRef(0), h = D.useRef(f);
716
- D.useEffect(() => {
296
+ var V = T.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r = 0, barWidth: i = 3, barGap: o = 2, barCount: s = 40, height: c = 32, className: l, ...u }, d) {
297
+ let [f, p] = T.useState(() => Array(s).fill(.05)), m = T.useRef(0), h = T.useRef(f);
298
+ T.useEffect(() => {
717
299
  if (e !== "live" || !t) return;
718
300
  let n = new Uint8Array(t.frequencyBinCount), r = () => {
719
301
  t.getByteFrequencyData(n);
720
- let e = Math.floor(n.length / o), i = Array(o);
721
- for (let t = 0; t < o; t++) {
302
+ let e = Math.floor(n.length / s), i = Array(s);
303
+ for (let t = 0; t < s; t++) {
722
304
  let r = 0;
723
305
  for (let i = 0; i < e; i++) r += n[t * e + i];
724
306
  let a = r / (e * 255);
@@ -730,12 +312,12 @@ var V = D.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r =
730
312
  }, [
731
313
  e,
732
314
  t,
733
- o
734
- ]), D.useEffect(() => {
735
- if (!(e !== "static" || !n)) if (n.length === o) p(n);
315
+ s
316
+ ]), T.useEffect(() => {
317
+ if (!(e !== "static" || !n)) if (n.length === s) p(n);
736
318
  else {
737
- let e = Array(o), t = n.length / o;
738
- for (let r = 0; r < o; r++) {
319
+ let e = Array(s), t = n.length / s;
320
+ for (let r = 0; r < s; r++) {
739
321
  let i = Math.floor(r * t);
740
322
  e[r] = n[Math.min(i, n.length - 1)];
741
323
  }
@@ -744,15 +326,15 @@ var V = D.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r =
744
326
  }, [
745
327
  e,
746
328
  n,
747
- o
329
+ s
748
330
  ]);
749
- let g = o * (i + a) - a, _ = D.useMemo(() => f.map((t, n) => {
750
- let c = Math.max(2, t * s), l = n * (i + a), u = (s - c) / 2, d = e === "static" && r > 0 && n / o <= r;
751
- return /* @__PURE__ */ j("rect", {
331
+ let g = s * (i + o) - o, _ = T.useMemo(() => f.map((t, n) => {
332
+ let a = Math.max(2, t * c), l = n * (i + o), u = (c - a) / 2, d = e === "static" && r > 0 && n / s <= r;
333
+ return /* @__PURE__ */ k("rect", {
752
334
  x: l,
753
335
  y: u,
754
336
  width: i,
755
- height: c,
337
+ height: a,
756
338
  rx: i / 2,
757
339
  fill: d ? "var(--color-accent-9)" : "var(--color-surface-border)"
758
340
  }, n);
@@ -761,445 +343,863 @@ var V = D.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r =
761
343
  r,
762
344
  e,
763
345
  i,
764
- a,
765
346
  o,
766
- s
347
+ s,
348
+ c
767
349
  ]);
768
- return /* @__PURE__ */ j("svg", {
350
+ return /* @__PURE__ */ k("svg", {
769
351
  ref: d,
770
- height: s,
771
- viewBox: `0 0 ${g} ${s}`,
352
+ height: c,
353
+ viewBox: `0 0 ${g} ${c}`,
772
354
  preserveAspectRatio: "none",
773
355
  "aria-hidden": "true",
774
- className: c("shrink-0", l),
356
+ className: a("shrink-0", l),
775
357
  ...u,
776
358
  children: _
777
359
  });
778
360
  });
779
361
  V.displayName = "AudioWaveform";
780
362
  //#endregion
781
- //#region src/composed/rich-chat-input/recording-overlay.tsx
782
- function Qe(e) {
783
- let t = Math.floor(e / 60), n = Math.floor(e % 60);
784
- return {
785
- minutes: String(t),
786
- separator: ":",
787
- secs: n.toString().padStart(2, "0")
788
- };
363
+ //#region src/composed/rich-chat-input/audio-player.tsx
364
+ var Ue = [
365
+ 1,
366
+ 1.5,
367
+ 2
368
+ ];
369
+ function We(e) {
370
+ return `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
789
371
  }
790
- function $e({ duration: e, analyserNode: t, maxDuration: n, onCancel: r }) {
791
- let i = o();
792
- D.useEffect(() => {
793
- let e = (e) => {
794
- e.key === "Escape" && r();
372
+ var Ge = T.forwardRef(function({ src: e, duration: t, waveformData: n, className: r, ...i }, o) {
373
+ let s = T.useRef(null), c = T.useRef(null), [l, u] = T.useState(!1), [d, f] = T.useState(0), [p, m] = T.useState(0), [h, g] = T.useState(null), _ = T.useMemo(() => {
374
+ if (typeof e == "string") return e;
375
+ let t = URL.createObjectURL(e);
376
+ return g(t), t;
377
+ }, [e]);
378
+ T.useEffect(() => () => {
379
+ h && URL.revokeObjectURL(h);
380
+ }, [h]), T.useEffect(() => {
381
+ let e = s.current;
382
+ if (!e) return;
383
+ let t = () => f(e.currentTime), n = () => {
384
+ u(!1), f(0);
795
385
  };
796
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
797
- }, [r]);
798
- let a = n != null && n > 0 && e >= n - 10, s = n != null && n > 0 && e >= n - 5, l = s ? "animate-[pulse_500ms_ease-in-out_infinite]" : "animate-[pulse_1s_ease-in-out_infinite]", u = Qe(e), d = s ? "text-error-11" : a ? "text-warning-11" : "text-surface-fg";
799
- return /* @__PURE__ */ M("div", {
800
- role: "status",
801
- "aria-live": "polite",
802
- "aria-label": "Recording voice message",
803
- className: "absolute inset-0 flex items-center gap-ds-03 px-ds-04 py-ds-03 bg-surface-raised-hover rounded-ds-lg z-10",
386
+ return e.addEventListener("timeupdate", t), e.addEventListener("ended", n), () => {
387
+ e.removeEventListener("timeupdate", t), e.removeEventListener("ended", n);
388
+ };
389
+ }, []);
390
+ let v = T.useCallback(() => {
391
+ let e = s.current;
392
+ e && (l ? (e.pause(), u(!1)) : (e.play(), u(!0)));
393
+ }, [l]), y = T.useCallback((e) => {
394
+ (e.key === " " || e.key === "Enter") && (e.preventDefault(), v());
395
+ }, [v]), b = T.useCallback((e) => {
396
+ let n = s.current, r = c.current;
397
+ if (!n || !r || t <= 0) return;
398
+ let i = r.getBoundingClientRect(), a = e.clientX - i.left;
399
+ n.currentTime = Math.max(0, Math.min(1, a / i.width)) * t, f(n.currentTime);
400
+ }, [t]), x = T.useCallback(() => {
401
+ let e = (p + 1) % Ue.length;
402
+ m(e), s.current && (s.current.playbackRate = Ue[e]);
403
+ }, [p]), S = t > 0 ? d / t : 0, C = Ue[p];
404
+ return /* @__PURE__ */ A("div", {
405
+ ref: o,
406
+ role: "group",
407
+ "aria-label": "Voice message player",
408
+ className: a("flex items-center gap-ds-03", r),
409
+ ...i,
804
410
  children: [
805
- /* @__PURE__ */ j("span", {
806
- className: c("w-ds-02b h-ds-02b shrink-0 rounded-ds-full bg-error-9", i ? "opacity-100" : l),
807
- "aria-hidden": "true"
411
+ /* @__PURE__ */ k("audio", {
412
+ ref: s,
413
+ src: _,
414
+ preload: "metadata"
415
+ }),
416
+ /* @__PURE__ */ k("button", {
417
+ type: "button",
418
+ onClick: v,
419
+ onKeyDown: y,
420
+ "aria-label": l ? "Pause voice message" : "Play voice message",
421
+ className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-ds-full bg-accent-9 text-accent-fg hover:bg-accent-10 active:scale-95 transition-colors duration-fast-01 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
422
+ children: k(l ? Ae : je, {
423
+ size: 16,
424
+ stroke: 2,
425
+ "aria-hidden": "true"
426
+ })
808
427
  }),
809
- /* @__PURE__ */ M("span", {
810
- className: c("text-ds-sm font-mono tabular-nums whitespace-nowrap", d),
811
- "aria-label": `${u.minutes} minutes ${u.secs} seconds`,
428
+ /* @__PURE__ */ k(V, {
429
+ ref: c,
430
+ mode: "static",
431
+ data: n,
432
+ progress: S,
433
+ className: "cursor-pointer",
434
+ onClick: b
435
+ }),
436
+ /* @__PURE__ */ A("span", {
437
+ className: "text-ds-xs tabular-nums text-surface-fg-subtle whitespace-nowrap",
812
438
  children: [
813
- u.minutes,
814
- /* @__PURE__ */ j("span", {
815
- className: i ? void 0 : "animate-[blink_1s_step-end_infinite]",
816
- "aria-hidden": "true",
817
- children: u.separator
818
- }),
819
- u.secs
439
+ We(d),
440
+ " / ",
441
+ We(t)
820
442
  ]
821
443
  }),
822
- /* @__PURE__ */ j("div", {
823
- className: "flex-1 min-w-0 overflow-hidden",
824
- children: /* @__PURE__ */ j(V, {
825
- mode: "live",
826
- analyserNode: t,
827
- height: 24,
828
- barCount: 60,
829
- className: "w-full"
830
- })
444
+ /* @__PURE__ */ A("button", {
445
+ type: "button",
446
+ onClick: x,
447
+ "aria-label": `Playback speed ${C}x`,
448
+ className: "shrink-0 text-ds-xs bg-surface-raised rounded-ds-full px-ds-02 py-[1px] hover:bg-surface-raised-hover tabular-nums transition-colors duration-fast-01 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
449
+ children: [C, "x"]
831
450
  })
832
451
  ]
833
452
  });
834
- }
835
- $e.displayName = "RecordingOverlay";
453
+ });
454
+ Ge.displayName = "AudioPlayer";
836
455
  //#endregion
837
456
  //#region src/composed/rich-chat-input/chat-toolbar.tsx
838
- var H = D.createContext(null);
839
- function U() {
840
- let e = D.useContext(H);
457
+ var Ke = T.createContext(null);
458
+ function H() {
459
+ let e = T.useContext(Ke);
841
460
  if (!e) throw Error("Toolbar primitives must be used inside <ChatToolbar>");
842
461
  return e;
843
462
  }
844
- function W({ onClick: e, isActive: t, disabled: n, title: r, children: i, className: a }) {
845
- let { disabled: o } = U();
846
- return /* @__PURE__ */ j("button", {
463
+ function U({ onClick: e, isActive: t, disabled: n, title: r, children: i, className: o }) {
464
+ let { disabled: s } = H();
465
+ return /* @__PURE__ */ k("button", {
847
466
  type: "button",
848
467
  onClick: e,
849
- disabled: n ?? o,
468
+ disabled: n ?? s,
850
469
  title: r,
851
470
  "aria-label": r,
852
471
  "aria-pressed": t,
853
- className: c("inline-flex h-ds-xs-plus items-center justify-center rounded-ds-md touch-target", !a?.includes("w-") && "w-ds-xs-plus", "transition-[color,background-color,transform] duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover hover:text-surface-fg", "active:scale-95", "disabled:pointer-events-none disabled:opacity-action-disabled", t ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle", a),
472
+ className: a("inline-flex h-ds-xs-plus items-center justify-center rounded-ds-md touch-target", !o?.includes("w-") && "w-ds-xs-plus", "transition-[color,background-color,transform] duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover hover:text-surface-fg", "active:scale-95", "disabled:pointer-events-none disabled:opacity-action-disabled", t ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle", o),
854
473
  children: i
855
474
  });
856
475
  }
857
- function G() {
858
- return /* @__PURE__ */ j("div", { className: "h-4 w-px bg-surface-border-subtle mx-ds-01" });
476
+ function W() {
477
+ return /* @__PURE__ */ k("div", { className: "h-4 w-px bg-surface-border-subtle mx-ds-01" });
859
478
  }
860
- function K({ children: e, className: t }) {
861
- return /* @__PURE__ */ j("div", {
862
- className: c("flex items-center gap-ds-01", t),
479
+ function G({ children: e, className: t }) {
480
+ return /* @__PURE__ */ k("div", {
481
+ className: a("flex items-center gap-ds-01", t),
863
482
  children: e
864
483
  });
865
484
  }
866
- function et() {
867
- let { editor: e } = U(), { isActive: t } = S({
485
+ function K() {
486
+ let { editor: e } = H(), { isActive: t } = C({
868
487
  editor: e,
869
488
  selector: ({ editor: e }) => ({ isActive: e.isActive("bold") })
870
489
  });
871
- return /* @__PURE__ */ j(W, {
490
+ return /* @__PURE__ */ k(U, {
872
491
  onClick: () => e.chain().focus().toggleBold().run(),
873
492
  isActive: t,
874
493
  title: "Bold",
875
- children: /* @__PURE__ */ j(u, {
876
- icon: ye,
494
+ children: /* @__PURE__ */ k(s, {
495
+ icon: j,
877
496
  size: "xs"
878
497
  })
879
498
  });
880
499
  }
881
- function tt() {
882
- let { editor: e } = U(), { isActive: t } = S({
500
+ function q() {
501
+ let { editor: e } = H(), { isActive: t } = C({
883
502
  editor: e,
884
503
  selector: ({ editor: e }) => ({ isActive: e.isActive("italic") })
885
504
  });
886
- return /* @__PURE__ */ j(W, {
505
+ return /* @__PURE__ */ k(U, {
887
506
  onClick: () => e.chain().focus().toggleItalic().run(),
888
507
  isActive: t,
889
508
  title: "Italic",
890
- children: /* @__PURE__ */ j(u, {
891
- icon: P,
509
+ children: /* @__PURE__ */ k(s, {
510
+ icon: Te,
892
511
  size: "xs"
893
512
  })
894
513
  });
895
514
  }
896
- function nt() {
897
- let { editor: e } = U(), { isActive: t } = S({
515
+ function qe() {
516
+ let { editor: e } = H(), { isActive: t } = C({
898
517
  editor: e,
899
518
  selector: ({ editor: e }) => ({ isActive: e.isActive("underline") })
900
519
  });
901
- return /* @__PURE__ */ j(W, {
520
+ return /* @__PURE__ */ k(U, {
902
521
  onClick: () => e.chain().focus().toggleUnderline().run(),
903
522
  isActive: t,
904
523
  title: "Underline",
905
- children: /* @__PURE__ */ j(u, {
906
- icon: Le,
524
+ children: /* @__PURE__ */ k(s, {
525
+ icon: I,
907
526
  size: "xs"
908
527
  })
909
528
  });
910
529
  }
911
- function rt() {
912
- let { editor: e } = U(), { isActive: t } = S({
530
+ function Je() {
531
+ let { editor: e } = H(), { isActive: t } = C({
913
532
  editor: e,
914
533
  selector: ({ editor: e }) => ({ isActive: e.isActive("strike") })
915
534
  });
916
- return /* @__PURE__ */ j(W, {
535
+ return /* @__PURE__ */ k(U, {
917
536
  onClick: () => e.chain().focus().toggleStrike().run(),
918
537
  isActive: t,
919
538
  title: "Strikethrough",
920
- children: /* @__PURE__ */ j(u, {
921
- icon: R,
539
+ children: /* @__PURE__ */ k(s, {
540
+ icon: F,
922
541
  size: "xs"
923
542
  })
924
543
  });
925
544
  }
926
- function it() {
927
- let { editor: e } = U(), { isActive: t } = S({
545
+ function Ye() {
546
+ let { editor: e } = H(), { isActive: t } = C({
928
547
  editor: e,
929
548
  selector: ({ editor: e }) => ({ isActive: e.isActive("highlight") })
930
549
  });
931
- return /* @__PURE__ */ j(W, {
550
+ return /* @__PURE__ */ k(U, {
932
551
  onClick: () => e.chain().focus().toggleHighlight().run(),
933
552
  isActive: t,
934
553
  title: "Highlight",
935
- children: /* @__PURE__ */ j(u, {
936
- icon: Te,
554
+ children: /* @__PURE__ */ k(s, {
555
+ icon: we,
937
556
  size: "xs"
938
557
  })
939
558
  });
940
559
  }
941
- function at() {
942
- let { editor: e } = U(), { isActive: t } = S({
560
+ function Xe() {
561
+ let { editor: e } = H(), { isActive: t } = C({
943
562
  editor: e,
944
563
  selector: ({ editor: e }) => ({ isActive: e.isActive("code") })
945
564
  });
946
- return /* @__PURE__ */ j(W, {
565
+ return /* @__PURE__ */ k(U, {
947
566
  onClick: () => e.chain().focus().toggleCode().run(),
948
567
  isActive: t,
949
568
  title: "Inline code",
950
- children: /* @__PURE__ */ j(u, {
951
- icon: Ce,
569
+ children: /* @__PURE__ */ k(s, {
570
+ icon: Se,
952
571
  size: "xs"
953
572
  })
954
573
  });
955
574
  }
956
- function ot() {
957
- let { editor: e } = U(), { isActive: t } = S({
575
+ function Ze() {
576
+ let { editor: e } = H(), { isActive: t } = C({
958
577
  editor: e,
959
578
  selector: ({ editor: e }) => ({ isActive: e.isActive("bulletList") })
960
579
  });
961
- return /* @__PURE__ */ j(W, {
580
+ return /* @__PURE__ */ k(U, {
962
581
  onClick: () => e.chain().focus().toggleBulletList().run(),
963
582
  isActive: t,
964
583
  title: "Bullet list",
965
- children: /* @__PURE__ */ j(u, {
966
- icon: F,
584
+ children: /* @__PURE__ */ k(s, {
585
+ icon: Ee,
967
586
  size: "xs"
968
587
  })
969
588
  });
970
589
  }
971
- function q() {
972
- let { editor: e } = U(), { isActive: t } = S({
590
+ function Qe() {
591
+ let { editor: e } = H(), { isActive: t } = C({
973
592
  editor: e,
974
593
  selector: ({ editor: e }) => ({ isActive: e.isActive("orderedList") })
975
594
  });
976
- return /* @__PURE__ */ j(W, {
595
+ return /* @__PURE__ */ k(U, {
977
596
  onClick: () => e.chain().focus().toggleOrderedList().run(),
978
597
  isActive: t,
979
598
  title: "Ordered list",
980
- children: /* @__PURE__ */ j(u, {
981
- icon: De,
599
+ children: /* @__PURE__ */ k(s, {
600
+ icon: N,
982
601
  size: "xs"
983
602
  })
984
603
  });
985
604
  }
986
- function st() {
987
- let { editor: e } = U(), { isActive: t } = S({
605
+ function $e() {
606
+ let { editor: e } = H(), { isActive: t } = C({
988
607
  editor: e,
989
608
  selector: ({ editor: e }) => ({ isActive: e.isActive("blockquote") })
990
609
  });
991
- return /* @__PURE__ */ j(W, {
610
+ return /* @__PURE__ */ k(U, {
992
611
  onClick: () => e.chain().focus().toggleBlockquote().run(),
993
612
  isActive: t,
994
613
  title: "Quote",
995
- children: /* @__PURE__ */ j(u, {
996
- icon: N,
614
+ children: /* @__PURE__ */ k(s, {
615
+ icon: ve,
997
616
  size: "xs"
998
617
  })
999
618
  });
1000
619
  }
1001
- function J() {
1002
- let { editor: e } = U(), { isActive: t } = S({
620
+ function et() {
621
+ let { editor: e } = H(), { isActive: t } = C({
1003
622
  editor: e,
1004
623
  selector: ({ editor: e }) => ({ isActive: e.isActive("link") })
1005
624
  });
1006
- return /* @__PURE__ */ j(W, {
625
+ return /* @__PURE__ */ k(U, {
1007
626
  onClick: () => {
1008
627
  let t = window.prompt("URL");
1009
628
  t && e.chain().focus().setLink({ href: t }).run();
1010
629
  },
1011
630
  isActive: t,
1012
631
  title: "Link",
1013
- children: /* @__PURE__ */ j(u, {
1014
- icon: Ee,
632
+ children: /* @__PURE__ */ k(s, {
633
+ icon: M,
634
+ size: "xs"
635
+ })
636
+ });
637
+ }
638
+ function tt() {
639
+ let { editor: e } = H();
640
+ return /* @__PURE__ */ k(U, {
641
+ onClick: () => e.chain().focus().insertContent("@").run(),
642
+ title: "Mention",
643
+ children: /* @__PURE__ */ k(s, {
644
+ icon: _e,
645
+ size: "xs"
646
+ })
647
+ });
648
+ }
649
+ function J() {
650
+ let { editor: e } = H();
651
+ return /* @__PURE__ */ k(U, {
652
+ onClick: () => e.chain().focus().insertContent(":").run(),
653
+ title: "Emoji",
654
+ children: /* @__PURE__ */ k(s, {
655
+ icon: Oe,
656
+ size: "xs"
657
+ })
658
+ });
659
+ }
660
+ function nt() {
661
+ let { editor: e } = H();
662
+ return /* @__PURE__ */ k(U, {
663
+ onClick: () => e.chain().focus().insertContent("/").run(),
664
+ title: "Slash command",
665
+ children: /* @__PURE__ */ k(s, {
666
+ icon: P,
1015
667
  size: "xs"
1016
668
  })
1017
669
  });
1018
670
  }
1019
- function ct() {
1020
- let { editor: e } = U();
1021
- return /* @__PURE__ */ j(W, {
1022
- onClick: () => e.chain().focus().insertContent("@").run(),
1023
- title: "Mention",
1024
- children: /* @__PURE__ */ j(u, {
1025
- icon: ve,
1026
- size: "xs"
1027
- })
671
+ function Y({ items: e, isMobile: t, hasMentions: n, hasSlashCommands: r }) {
672
+ let i = (t) => !e || e.includes(t);
673
+ return /* @__PURE__ */ A(he, { children: [
674
+ !t && /* @__PURE__ */ A(G, { children: [
675
+ i("bold") && /* @__PURE__ */ k(K, {}),
676
+ i("italic") && /* @__PURE__ */ k(q, {}),
677
+ i("underline") && /* @__PURE__ */ k(qe, {}),
678
+ i("strike") && /* @__PURE__ */ k(Je, {}),
679
+ i("highlight") && /* @__PURE__ */ k(Ye, {})
680
+ ] }),
681
+ !t && /* @__PURE__ */ k(W, {}),
682
+ !t && /* @__PURE__ */ A(G, { children: [i("bulletList") && /* @__PURE__ */ k(Ze, {}), i("orderedList") && /* @__PURE__ */ k(Qe, {})] }),
683
+ !t && (i("blockquote") || i("link") || i("code")) && /* @__PURE__ */ k(W, {}),
684
+ !t && /* @__PURE__ */ A(G, { children: [
685
+ i("blockquote") && /* @__PURE__ */ k($e, {}),
686
+ i("link") && /* @__PURE__ */ k(et, {}),
687
+ i("code") && /* @__PURE__ */ k(Xe, {})
688
+ ] }),
689
+ !t && (n || r) && /* @__PURE__ */ k(W, {}),
690
+ /* @__PURE__ */ A(G, { children: [
691
+ n && i("mention") && /* @__PURE__ */ k(tt, {}),
692
+ i("emoji") && /* @__PURE__ */ k(J, {}),
693
+ r && i("slash") && /* @__PURE__ */ k(nt, {})
694
+ ] })
695
+ ] });
696
+ }
697
+ function rt({ editor: e, toolbar: t, isMobile: n, hasMentions: r, hasSlashCommands: i, disabled: a }) {
698
+ if (t === !1) return null;
699
+ let o = typeof t != "boolean" && !Array.isArray(t), s = Array.isArray(t) ? t : null;
700
+ return /* @__PURE__ */ k(Ke.Provider, {
701
+ value: {
702
+ editor: e,
703
+ disabled: a
704
+ },
705
+ children: /* @__PURE__ */ k("div", {
706
+ role: "toolbar",
707
+ "aria-label": "Text formatting",
708
+ className: "flex flex-wrap items-center gap-ds-01 border-t border-surface-border px-ds-04 py-ds-02b",
709
+ children: o ? t : /* @__PURE__ */ k(Y, {
710
+ items: s,
711
+ isMobile: n,
712
+ hasMentions: r,
713
+ hasSlashCommands: i
714
+ })
715
+ })
716
+ });
717
+ }
718
+ //#endregion
719
+ //#region src/composed/rich-chat-input/recording-overlay.tsx
720
+ function it(e) {
721
+ let t = Math.floor(e / 60), n = Math.floor(e % 60);
722
+ return {
723
+ minutes: String(t),
724
+ separator: ":",
725
+ secs: n.toString().padStart(2, "0")
726
+ };
727
+ }
728
+ function at({ duration: e, analyserNode: t, maxDuration: n, onCancel: r }) {
729
+ let i = Le();
730
+ T.useEffect(() => {
731
+ let e = (e) => {
732
+ e.key === "Escape" && r();
733
+ };
734
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
735
+ }, [r]);
736
+ let o = n != null && n > 0 && e >= n - 10, s = n != null && n > 0 && e >= n - 5, c = s ? "animate-[pulse_500ms_ease-in-out_infinite]" : "animate-[pulse_1s_ease-in-out_infinite]", l = it(e), u = s ? "text-error-11" : o ? "text-warning-11" : "text-surface-fg";
737
+ return /* @__PURE__ */ A("div", {
738
+ role: "status",
739
+ "aria-live": "polite",
740
+ "aria-label": "Recording voice message",
741
+ className: "absolute inset-0 flex items-center gap-ds-03 px-ds-04 py-ds-03 bg-surface-raised-hover rounded-ds-lg z-10",
742
+ children: [
743
+ /* @__PURE__ */ k("span", {
744
+ className: a("w-ds-02b h-ds-02b shrink-0 rounded-ds-full bg-error-9", i ? "opacity-100" : c),
745
+ "aria-hidden": "true"
746
+ }),
747
+ /* @__PURE__ */ A("span", {
748
+ className: a("text-ds-sm font-mono tabular-nums whitespace-nowrap", u),
749
+ "aria-label": `${l.minutes} minutes ${l.secs} seconds`,
750
+ children: [
751
+ l.minutes,
752
+ /* @__PURE__ */ k("span", {
753
+ className: i ? void 0 : "animate-[blink_1s_step-end_infinite]",
754
+ "aria-hidden": "true",
755
+ children: l.separator
756
+ }),
757
+ l.secs
758
+ ]
759
+ }),
760
+ /* @__PURE__ */ k("div", {
761
+ className: "flex-1 min-w-0 overflow-hidden",
762
+ children: /* @__PURE__ */ k(V, {
763
+ mode: "live",
764
+ analyserNode: t,
765
+ height: 24,
766
+ barCount: 60,
767
+ className: "w-full"
768
+ })
769
+ })
770
+ ]
771
+ });
772
+ }
773
+ at.displayName = "RecordingOverlay";
774
+ //#endregion
775
+ //#region src/composed/rich-chat-input/reply-banner.tsx
776
+ function ot({ author: e, preview: t, onDismiss: n }) {
777
+ return /* @__PURE__ */ k(z.div, {
778
+ initial: {
779
+ height: 0,
780
+ opacity: 0
781
+ },
782
+ animate: {
783
+ height: "auto",
784
+ opacity: 1
785
+ },
786
+ exit: {
787
+ height: 0,
788
+ opacity: 0
789
+ },
790
+ transition: {
791
+ duration: i.moderate02,
792
+ ease: [
793
+ .2,
794
+ 0,
795
+ .38,
796
+ .9
797
+ ]
798
+ },
799
+ className: "overflow-hidden",
800
+ children: /* @__PURE__ */ A("div", {
801
+ role: "status",
802
+ "aria-label": `Replying to ${e}`,
803
+ className: "flex items-center gap-ds-03 border-b border-surface-border px-ds-04 py-ds-02b",
804
+ children: [/* @__PURE__ */ A("div", {
805
+ className: "flex-1 min-w-0",
806
+ children: [
807
+ /* @__PURE__ */ A("span", {
808
+ className: "text-ds-sm font-semibold text-surface-fg",
809
+ children: ["Replying to ", e]
810
+ }),
811
+ /* @__PURE__ */ k("span", {
812
+ className: "mx-ds-02 text-surface-fg-subtle",
813
+ children: "·"
814
+ }),
815
+ /* @__PURE__ */ k("span", {
816
+ className: "text-ds-sm text-surface-fg-muted truncate",
817
+ children: t
818
+ })
819
+ ]
820
+ }), /* @__PURE__ */ k("button", {
821
+ type: "button",
822
+ onClick: n,
823
+ className: a("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "text-surface-fg-subtle hover:text-surface-fg hover:bg-surface-raised-hover", "transition-colors duration-fast-01 ease-productive-standard", "active:scale-95"),
824
+ "aria-label": "Cancel reply",
825
+ title: "Cancel reply",
826
+ children: /* @__PURE__ */ k(s, {
827
+ icon: L,
828
+ size: "xs"
829
+ })
830
+ })]
831
+ })
832
+ });
833
+ }
834
+ //#endregion
835
+ //#region src/composed/rich-chat-input/schedule-send.tsx
836
+ function st() {
837
+ let e = /* @__PURE__ */ new Date(), t = e.getHours(), n = [], r = (t, n = 0) => {
838
+ let r = new Date(e);
839
+ return r.setDate(r.getDate() + n), r.setHours(t, 0, 0, 0), r;
840
+ }, i = (t) => {
841
+ let n = new Date(e), r = n.getDay(), i = r === 0 ? 1 : r === 1 ? 7 : 8 - r;
842
+ return n.setDate(n.getDate() + i), n.setHours(t, 0, 0, 0), n;
843
+ };
844
+ t < 9 ? (n.push({
845
+ label: "Later this morning · 9:00 AM",
846
+ date: r(9)
847
+ }), n.push({
848
+ label: "This afternoon · 1:00 PM",
849
+ date: r(13)
850
+ }), n.push({
851
+ label: "This evening · 6:00 PM",
852
+ date: r(18)
853
+ })) : t < 13 ? (n.push({
854
+ label: "This afternoon · 1:00 PM",
855
+ date: r(13)
856
+ }), n.push({
857
+ label: "This evening · 6:00 PM",
858
+ date: r(18)
859
+ }), n.push({
860
+ label: "Tomorrow morning · 9:00 AM",
861
+ date: r(9, 1)
862
+ })) : t < 18 ? (n.push({
863
+ label: "This evening · 6:00 PM",
864
+ date: r(18)
865
+ }), n.push({
866
+ label: "Tomorrow morning · 9:00 AM",
867
+ date: r(9, 1)
868
+ }), n.push({
869
+ label: "Tomorrow afternoon · 1:00 PM",
870
+ date: r(13, 1)
871
+ })) : (n.push({
872
+ label: "Tomorrow morning · 9:00 AM",
873
+ date: r(9, 1)
874
+ }), n.push({
875
+ label: "Tomorrow afternoon · 1:00 PM",
876
+ date: r(13, 1)
877
+ }));
878
+ let a = i(9);
879
+ return a.getTime() - e.getTime() > 2880 * 60 * 1e3 && n.push({
880
+ label: "Next Monday · 9:00 AM",
881
+ date: a
882
+ }), n;
883
+ }
884
+ function ct({ value: e, onChange: t }) {
885
+ let n = e.getHours() % 12 || 12, r = e.getMinutes(), i = e.getHours() >= 12, o = (n) => {
886
+ let r = new Date(e);
887
+ r.setHours(i ? n % 12 + 12 : n % 12), t(r);
888
+ }, s = (n) => {
889
+ let r = new Date(e);
890
+ r.setMinutes(n), t(r);
891
+ }, c = (n) => {
892
+ let r = new Date(e), i = r.getHours();
893
+ n && i < 12 ? r.setHours(i + 12) : !n && i >= 12 && r.setHours(i - 12), t(r);
894
+ };
895
+ return /* @__PURE__ */ A("div", {
896
+ className: "flex items-center gap-ds-02",
897
+ children: [
898
+ /* @__PURE__ */ k("select", {
899
+ value: n,
900
+ onChange: (e) => o(Number(e.target.value)),
901
+ className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9",
902
+ "aria-label": "Hour",
903
+ children: Array.from({ length: 12 }, (e, t) => t + 1).map((e) => /* @__PURE__ */ k("option", {
904
+ value: e,
905
+ children: e
906
+ }, e))
907
+ }),
908
+ /* @__PURE__ */ k("span", {
909
+ className: "text-ds-sm text-surface-fg-subtle font-medium",
910
+ children: ":"
911
+ }),
912
+ /* @__PURE__ */ k("select", {
913
+ value: r - r % 5,
914
+ onChange: (e) => s(Number(e.target.value)),
915
+ className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9",
916
+ "aria-label": "Minute",
917
+ children: Array.from({ length: 12 }, (e, t) => t * 5).map((e) => /* @__PURE__ */ k("option", {
918
+ value: e,
919
+ children: String(e).padStart(2, "0")
920
+ }, e))
921
+ }),
922
+ /* @__PURE__ */ A("div", {
923
+ className: "inline-flex rounded-ds-md border border-surface-border-strong overflow-hidden",
924
+ children: [/* @__PURE__ */ k("button", {
925
+ type: "button",
926
+ onClick: () => c(!1),
927
+ className: a("px-ds-02b py-ds-01 text-ds-xs font-medium transition-colors duration-fast-01", i ? "bg-surface-raised text-surface-fg-subtle hover:bg-surface-raised-hover" : "bg-accent-9 text-white"),
928
+ children: "AM"
929
+ }), /* @__PURE__ */ k("button", {
930
+ type: "button",
931
+ onClick: () => c(!0),
932
+ className: a("px-ds-02b py-ds-01 text-ds-xs font-medium transition-colors duration-fast-01", i ? "bg-accent-9 text-white" : "bg-surface-raised text-surface-fg-subtle hover:bg-surface-raised-hover"),
933
+ children: "PM"
934
+ })]
935
+ })
936
+ ]
937
+ });
938
+ }
939
+ function X({ value: e, onChange: t, minDate: n }) {
940
+ let r = /* @__PURE__ */ new Date(), i = e ?? (() => {
941
+ let e = new Date(r);
942
+ return e.setHours(e.getHours() + 1, 0, 0, 0), e;
943
+ })(), a = `${i.getFullYear()}-${String(i.getMonth() + 1).padStart(2, "0")}-${String(i.getDate()).padStart(2, "0")}`, o = (e) => {
944
+ let n = e.target.value.split("-");
945
+ if (n.length !== 3) return;
946
+ let r = new Date(i);
947
+ r.setFullYear(Number(n[0]), Number(n[1]) - 1, Number(n[2])), t(r);
948
+ }, s = n ? `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}` : void 0;
949
+ return /* @__PURE__ */ A("div", {
950
+ className: "space-y-ds-03",
951
+ children: [/* @__PURE__ */ A("div", {
952
+ className: "flex items-center justify-between",
953
+ children: [/* @__PURE__ */ k("span", {
954
+ className: "text-ds-xs font-medium text-surface-fg-subtle",
955
+ children: "Date"
956
+ }), /* @__PURE__ */ k("input", {
957
+ type: "date",
958
+ value: a,
959
+ min: s,
960
+ onChange: o,
961
+ className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-03 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9"
962
+ })]
963
+ }), /* @__PURE__ */ A("div", {
964
+ className: "flex items-center justify-between",
965
+ children: [/* @__PURE__ */ k("span", {
966
+ className: "text-ds-xs font-medium text-surface-fg-subtle",
967
+ children: "Time"
968
+ }), /* @__PURE__ */ k(ct, {
969
+ value: i,
970
+ onChange: t
971
+ })]
972
+ })]
973
+ });
974
+ }
975
+ function lt({ value: e, onChange: t, minDate: n }) {
976
+ let r = /* @__PURE__ */ new Date(), i = e ?? (() => {
977
+ let e = new Date(r);
978
+ return e.setHours(e.getHours() + 1, 0, 0, 0), e;
979
+ })(), { currentMonth: a, goToPreviousMonth: o, goToNextMonth: s } = v(i);
980
+ return /* @__PURE__ */ A("div", {
981
+ className: "space-y-ds-03",
982
+ children: [/* @__PURE__ */ k(_, {
983
+ currentMonth: a,
984
+ selected: i,
985
+ onSelect: (e) => {
986
+ let n = new Date(e);
987
+ n.setHours(i.getHours(), i.getMinutes(), 0, 0), t(n);
988
+ },
989
+ onMonthChange: (e) => {
990
+ e < a ? o() : s();
991
+ },
992
+ minDate: n,
993
+ className: "w-full"
994
+ }), /* @__PURE__ */ A("div", {
995
+ className: "flex items-center justify-between border-t border-surface-border pt-ds-03",
996
+ children: [/* @__PURE__ */ k("span", {
997
+ className: "text-ds-xs font-medium text-surface-fg-subtle",
998
+ children: "Time"
999
+ }), /* @__PURE__ */ k(ct, {
1000
+ value: i,
1001
+ onChange: t
1002
+ })]
1003
+ })]
1028
1004
  });
1029
1005
  }
1030
- function lt() {
1031
- let { editor: e } = U();
1032
- return /* @__PURE__ */ j(W, {
1033
- onClick: () => e.chain().focus().insertContent(":").run(),
1034
- title: "Emoji",
1035
- children: /* @__PURE__ */ j(u, {
1036
- icon: ke,
1037
- size: "xs"
1038
- })
1006
+ function ut({ onSchedule: e, onClose: t, onOpenDialog: n }) {
1007
+ let [r, i] = T.useState(!1), [a, o] = T.useState(null), c = T.useMemo(() => st(), []), u = (n) => {
1008
+ e(n), t();
1009
+ };
1010
+ return r ? /* @__PURE__ */ A("div", {
1011
+ className: "p-ds-04",
1012
+ style: { minWidth: 270 },
1013
+ children: [
1014
+ /* @__PURE__ */ A("div", {
1015
+ className: "mb-ds-03 flex items-center justify-between",
1016
+ children: [/* @__PURE__ */ k("p", {
1017
+ className: "text-ds-sm font-medium text-surface-fg",
1018
+ children: "Pick date & time"
1019
+ }), /* @__PURE__ */ k("button", {
1020
+ type: "button",
1021
+ onClick: () => i(!1),
1022
+ className: "inline-flex items-center justify-center rounded-ds-md p-ds-01 text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg transition-colors",
1023
+ "aria-label": "Back to presets",
1024
+ children: /* @__PURE__ */ k(s, {
1025
+ icon: L,
1026
+ size: "sm"
1027
+ })
1028
+ })]
1029
+ }),
1030
+ /* @__PURE__ */ k(X, {
1031
+ value: a,
1032
+ onChange: o,
1033
+ minDate: /* @__PURE__ */ new Date()
1034
+ }),
1035
+ /* @__PURE__ */ k("div", {
1036
+ className: "mt-ds-03 flex justify-end",
1037
+ children: /* @__PURE__ */ k(l, {
1038
+ variant: "solid",
1039
+ size: "sm",
1040
+ onClick: () => {
1041
+ a && a > /* @__PURE__ */ new Date() && (e(a), t(), o(null), i(!1));
1042
+ },
1043
+ disabled: !a || a <= /* @__PURE__ */ new Date(),
1044
+ children: "Confirm"
1045
+ })
1046
+ })
1047
+ ]
1048
+ }) : /* @__PURE__ */ A("div", {
1049
+ className: "p-ds-02",
1050
+ style: { minWidth: 260 },
1051
+ children: [
1052
+ /* @__PURE__ */ k("p", {
1053
+ className: "px-ds-03 py-ds-01 text-ds-xs font-medium text-surface-fg-subtle",
1054
+ children: "Schedule send"
1055
+ }),
1056
+ c.map((e, t) => /* @__PURE__ */ A("button", {
1057
+ type: "button",
1058
+ onClick: () => u(e.date),
1059
+ className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
1060
+ children: [/* @__PURE__ */ k(s, {
1061
+ icon: xe,
1062
+ size: "sm",
1063
+ className: "shrink-0 text-surface-fg-muted"
1064
+ }), e.label]
1065
+ }, t)),
1066
+ /* @__PURE__ */ k("div", { className: "mx-ds-02 my-ds-02 h-px bg-surface-border" }),
1067
+ /* @__PURE__ */ A("button", {
1068
+ type: "button",
1069
+ onClick: () => i(!0),
1070
+ className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
1071
+ children: [/* @__PURE__ */ k(s, {
1072
+ icon: ye,
1073
+ size: "sm",
1074
+ className: "shrink-0 text-accent-11"
1075
+ }), "Pick date & time..."]
1076
+ }),
1077
+ n && /* @__PURE__ */ A("button", {
1078
+ type: "button",
1079
+ onClick: () => {
1080
+ n(), t();
1081
+ },
1082
+ className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
1083
+ children: [/* @__PURE__ */ k(s, {
1084
+ icon: ye,
1085
+ size: "sm",
1086
+ className: "shrink-0 text-surface-fg-muted"
1087
+ }), "Open full picker..."]
1088
+ })
1089
+ ]
1039
1090
  });
1040
1091
  }
1041
- function ut() {
1042
- let { editor: e } = U();
1043
- return /* @__PURE__ */ j(W, {
1044
- onClick: () => e.chain().focus().insertContent("/").run(),
1045
- title: "Slash command",
1046
- children: /* @__PURE__ */ j(u, {
1047
- icon: L,
1048
- size: "xs"
1092
+ function dt({ open: e, onOpenChange: t, onSchedule: n, initialDate: r }) {
1093
+ let [i, a] = T.useState(r ?? null);
1094
+ return T.useEffect(() => {
1095
+ e && a(r ?? null);
1096
+ }, [e, r]), /* @__PURE__ */ k(u, {
1097
+ open: e,
1098
+ onOpenChange: t,
1099
+ children: /* @__PURE__ */ A(d, {
1100
+ className: "sm:max-w-[380px]",
1101
+ children: [
1102
+ /* @__PURE__ */ k(p, { children: /* @__PURE__ */ k(m, { children: r ? "Reschedule message" : "Schedule send" }) }),
1103
+ /* @__PURE__ */ k(lt, {
1104
+ value: i,
1105
+ onChange: a,
1106
+ minDate: /* @__PURE__ */ new Date()
1107
+ }),
1108
+ /* @__PURE__ */ A(f, {
1109
+ className: "gap-ds-02",
1110
+ children: [/* @__PURE__ */ k(l, {
1111
+ variant: "soft",
1112
+ onClick: () => t(!1),
1113
+ children: "Cancel"
1114
+ }), /* @__PURE__ */ k(l, {
1115
+ variant: "solid",
1116
+ onClick: () => {
1117
+ i && i > /* @__PURE__ */ new Date() && (n(i), t(!1));
1118
+ },
1119
+ disabled: !i || i <= /* @__PURE__ */ new Date(),
1120
+ children: r ? "Reschedule" : "Schedule"
1121
+ })]
1122
+ })
1123
+ ]
1049
1124
  })
1050
1125
  });
1051
1126
  }
1052
- function Y({ items: e, isMobile: t, hasMentions: n, hasSlashCommands: r }) {
1053
- let i = (t) => !e || e.includes(t);
1054
- return /* @__PURE__ */ M(ge, { children: [
1055
- !t && /* @__PURE__ */ M(K, { children: [
1056
- i("bold") && /* @__PURE__ */ j(et, {}),
1057
- i("italic") && /* @__PURE__ */ j(tt, {}),
1058
- i("underline") && /* @__PURE__ */ j(nt, {}),
1059
- i("strike") && /* @__PURE__ */ j(rt, {}),
1060
- i("highlight") && /* @__PURE__ */ j(it, {})
1061
- ] }),
1062
- !t && /* @__PURE__ */ j(G, {}),
1063
- !t && /* @__PURE__ */ M(K, { children: [i("bulletList") && /* @__PURE__ */ j(ot, {}), i("orderedList") && /* @__PURE__ */ j(q, {})] }),
1064
- !t && (i("blockquote") || i("link") || i("code")) && /* @__PURE__ */ j(G, {}),
1065
- !t && /* @__PURE__ */ M(K, { children: [
1066
- i("blockquote") && /* @__PURE__ */ j(st, {}),
1067
- i("link") && /* @__PURE__ */ j(J, {}),
1068
- i("code") && /* @__PURE__ */ j(at, {})
1069
- ] }),
1070
- !t && (n || r) && /* @__PURE__ */ j(G, {}),
1071
- /* @__PURE__ */ M(K, { children: [
1072
- n && i("mention") && /* @__PURE__ */ j(ct, {}),
1073
- i("emoji") && /* @__PURE__ */ j(lt, {}),
1074
- r && i("slash") && /* @__PURE__ */ j(ut, {})
1075
- ] })
1076
- ] });
1127
+ function Z(e) {
1128
+ let t = /* @__PURE__ */ new Date(), n = new Date(t);
1129
+ n.setDate(n.getDate() + 1);
1130
+ let r = e.toDateString() === t.toDateString(), i = e.toDateString() === n.toDateString(), a = e.toLocaleTimeString(void 0, {
1131
+ hour: "numeric",
1132
+ minute: "2-digit"
1133
+ });
1134
+ return r ? `Today at ${a}` : i ? `Tomorrow at ${a}` : `${e.toLocaleDateString(void 0, {
1135
+ weekday: "short",
1136
+ month: "short",
1137
+ day: "numeric"
1138
+ })} at ${a}`;
1077
1139
  }
1078
- function dt({ editor: e, toolbar: t, isMobile: n, hasMentions: r, hasSlashCommands: i, disabled: a }) {
1079
- if (t === !1) return null;
1080
- let o = typeof t != "boolean" && !Array.isArray(t), s = Array.isArray(t) ? t : null;
1081
- return /* @__PURE__ */ j(H.Provider, {
1082
- value: {
1083
- editor: e,
1084
- disabled: a
1140
+ function ft({ date: e, onClear: t, onEdit: n }) {
1141
+ return /* @__PURE__ */ k(z.div, {
1142
+ initial: {
1143
+ height: 0,
1144
+ opacity: 0
1085
1145
  },
1086
- children: /* @__PURE__ */ j("div", {
1087
- role: "toolbar",
1088
- "aria-label": "Text formatting",
1089
- className: "flex flex-wrap items-center gap-ds-01 border-t border-surface-border px-ds-04 py-ds-02b",
1090
- children: o ? t : /* @__PURE__ */ j(Y, {
1091
- items: s,
1092
- isMobile: n,
1093
- hasMentions: r,
1094
- hasSlashCommands: i
1095
- })
1146
+ animate: {
1147
+ height: "auto",
1148
+ opacity: 1
1149
+ },
1150
+ exit: {
1151
+ height: 0,
1152
+ opacity: 0
1153
+ },
1154
+ transition: { duration: i.moderate01 },
1155
+ className: "overflow-hidden",
1156
+ children: /* @__PURE__ */ A("div", {
1157
+ className: "flex items-center gap-ds-03 px-ds-04 py-ds-02b text-ds-xs text-accent-11 bg-accent-2 border-b border-accent-4",
1158
+ children: [
1159
+ /* @__PURE__ */ k(s, {
1160
+ icon: xe,
1161
+ size: "xs",
1162
+ className: "shrink-0"
1163
+ }),
1164
+ /* @__PURE__ */ A("span", {
1165
+ className: "flex-1 truncate",
1166
+ children: ["Scheduled for ", Z(e)]
1167
+ }),
1168
+ n && /* @__PURE__ */ k("button", {
1169
+ type: "button",
1170
+ onClick: n,
1171
+ className: "inline-flex shrink-0 items-center justify-center rounded-ds-sm p-ds-01 hover:bg-accent-3 transition-colors",
1172
+ "aria-label": "Edit schedule",
1173
+ children: /* @__PURE__ */ k(s, {
1174
+ icon: ke,
1175
+ size: "xs"
1176
+ })
1177
+ }),
1178
+ /* @__PURE__ */ k("button", {
1179
+ type: "button",
1180
+ onClick: t,
1181
+ className: "inline-flex shrink-0 items-center justify-center rounded-ds-sm p-ds-01 hover:bg-accent-3 transition-colors",
1182
+ "aria-label": "Cancel schedule",
1183
+ children: /* @__PURE__ */ k(s, {
1184
+ icon: L,
1185
+ size: "xs"
1186
+ })
1187
+ })
1188
+ ]
1096
1189
  })
1097
1190
  });
1098
1191
  }
1099
1192
  //#endregion
1100
- //#region src/composed/rich-chat-input/audio-player.tsx
1101
- var X = [
1102
- 1,
1103
- 1.5,
1104
- 2
1105
- ];
1106
- function Z(e) {
1107
- return `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
1108
- }
1109
- var ft = D.forwardRef(function({ src: e, duration: t, waveformData: n, className: r, ...i }, a) {
1110
- let o = D.useRef(null), s = D.useRef(null), [l, u] = D.useState(!1), [d, f] = D.useState(0), [p, m] = D.useState(0), [h, g] = D.useState(null), _ = D.useMemo(() => {
1111
- if (typeof e == "string") return e;
1112
- let t = URL.createObjectURL(e);
1113
- return g(t), t;
1114
- }, [e]);
1115
- D.useEffect(() => () => {
1116
- h && URL.revokeObjectURL(h);
1117
- }, [h]), D.useEffect(() => {
1118
- let e = o.current;
1119
- if (!e) return;
1120
- let t = () => f(e.currentTime), n = () => {
1121
- u(!1), f(0);
1122
- };
1123
- return e.addEventListener("timeupdate", t), e.addEventListener("ended", n), () => {
1124
- e.removeEventListener("timeupdate", t), e.removeEventListener("ended", n);
1125
- };
1126
- }, []);
1127
- let v = D.useCallback(() => {
1128
- let e = o.current;
1129
- e && (l ? (e.pause(), u(!1)) : (e.play(), u(!0)));
1130
- }, [l]), y = D.useCallback((e) => {
1131
- (e.key === " " || e.key === "Enter") && (e.preventDefault(), v());
1132
- }, [v]), b = D.useCallback((e) => {
1133
- let n = o.current, r = s.current;
1134
- if (!n || !r || t <= 0) return;
1135
- let i = r.getBoundingClientRect(), a = e.clientX - i.left;
1136
- n.currentTime = Math.max(0, Math.min(1, a / i.width)) * t, f(n.currentTime);
1137
- }, [t]), x = D.useCallback(() => {
1138
- let e = (p + 1) % X.length;
1139
- m(e), o.current && (o.current.playbackRate = X[e]);
1140
- }, [p]), ee = t > 0 ? d / t : 0, S = X[p];
1141
- return /* @__PURE__ */ M("div", {
1142
- ref: a,
1143
- role: "group",
1144
- "aria-label": "Voice message player",
1145
- className: c("flex items-center gap-ds-03", r),
1146
- ...i,
1147
- children: [
1148
- /* @__PURE__ */ j("audio", {
1149
- ref: o,
1150
- src: _,
1151
- preload: "metadata"
1152
- }),
1153
- /* @__PURE__ */ j("button", {
1154
- type: "button",
1155
- onClick: v,
1156
- onKeyDown: y,
1157
- "aria-label": l ? "Pause voice message" : "Play voice message",
1158
- className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-ds-full bg-accent-9 text-accent-fg hover:bg-accent-10 active:scale-95 transition-colors duration-fast-01 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
1159
- children: j(l ? je : I, {
1160
- size: 16,
1161
- stroke: 2,
1162
- "aria-hidden": "true"
1163
- })
1164
- }),
1165
- /* @__PURE__ */ j(V, {
1166
- ref: s,
1167
- mode: "static",
1168
- data: n,
1169
- progress: ee,
1170
- className: "cursor-pointer",
1171
- onClick: b
1172
- }),
1173
- /* @__PURE__ */ M("span", {
1174
- className: "text-ds-xs tabular-nums text-surface-fg-subtle whitespace-nowrap",
1175
- children: [
1176
- Z(d),
1177
- " / ",
1178
- Z(t)
1179
- ]
1180
- }),
1181
- /* @__PURE__ */ M("button", {
1182
- type: "button",
1183
- onClick: x,
1184
- "aria-label": `Playback speed ${S}x`,
1185
- className: "shrink-0 text-ds-xs bg-surface-raised rounded-ds-full px-ds-02 py-[1px] hover:bg-surface-raised-hover tabular-nums transition-colors duration-fast-01 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
1186
- children: [S, "x"]
1187
- })
1188
- ]
1189
- });
1190
- });
1191
- ft.displayName = "AudioPlayer";
1192
- //#endregion
1193
1193
  //#region src/composed/rich-chat-input/use-voice-recorder.ts
1194
1194
  function pt() {
1195
1195
  return typeof MediaRecorder < "u" && MediaRecorder.isTypeSupported("audio/webm;codecs=opus") ? "audio/webm;codecs=opus" : typeof MediaRecorder < "u" && MediaRecorder.isTypeSupported("audio/mp4") ? "audio/mp4" : "";
1196
1196
  }
1197
1197
  function mt(e) {
1198
- let { maxDuration: t, onComplete: n } = e, [r, i] = A("idle"), [a, o] = A(0), [s, c] = A(null), [l, u] = A([]), d = k(null), f = k(null), p = k(null), m = k([]), h = k(null), g = k(null), _ = k(null), v = k(null), y = k(0), b = k([]), x = k(!1), ee = k(n);
1199
- ee.current = n;
1200
- let S = O(() => {
1198
+ let { maxDuration: t, onComplete: n } = e, [r, i] = O("idle"), [a, o] = O(0), [s, c] = O(null), [l, u] = O([]), d = D(null), f = D(null), p = D(null), m = D([]), h = D(null), g = D(null), _ = D(null), v = D(null), y = D(0), b = D([]), x = D(!1), S = D(n);
1199
+ S.current = n;
1200
+ let C = E(() => {
1201
1201
  h.current !== null && (clearInterval(h.current), h.current = null), g.current !== null && (clearInterval(g.current), g.current = null), _.current !== null && (clearTimeout(_.current), _.current = null), p.current &&= (p.current.getTracks().forEach((e) => e.stop()), null), f.current &&= (f.current.close().catch(() => {}), null), v.current = null, c(null), d.current = null, m.current = [];
1202
- }, []), C = O(async () => {
1202
+ }, []), w = E(async () => {
1203
1203
  if (typeof MediaRecorder > "u") throw Error("MediaRecorder is not supported in this browser. Voice recording requires a modern browser with MediaRecorder support.");
1204
1204
  let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
1205
1205
  p.current = e;
@@ -1211,33 +1211,33 @@ function mt(e) {
1211
1211
  l.fftSize = 256, l.smoothingTimeConstant = .7, s.connect(l), v.current = l, c(l), r.ondataavailable = (e) => {
1212
1212
  e.data.size > 0 && m.current.push(e.data);
1213
1213
  }, r.onstop = () => {
1214
- if (x.current) S(), i("idle"), o(0), u([]);
1214
+ if (x.current) C(), i("idle"), o(0), u([]);
1215
1215
  else {
1216
1216
  let e = new Blob(m.current, { type: r.mimeType || "audio/webm" }), t = y.current, n = b.current;
1217
- S(), i("idle"), o(0), u([]), ee.current(e, t, n);
1217
+ C(), i("idle"), o(0), u([]), S.current(e, t, n);
1218
1218
  }
1219
1219
  }, r.start(), o(0), y.current = 0, h.current = setInterval(() => {
1220
1220
  y.current += 1, o((e) => e + 1);
1221
1221
  }, 1e3);
1222
- let C = new Uint8Array(l.frequencyBinCount);
1222
+ let w = new Uint8Array(l.frequencyBinCount);
1223
1223
  u([]), b.current = [], g.current = setInterval(() => {
1224
1224
  if (v.current) {
1225
- v.current.getByteFrequencyData(C);
1225
+ v.current.getByteFrequencyData(w);
1226
1226
  let e = 0;
1227
- for (let t = 0; t < C.length; t++) e += C[t];
1228
- let t = e / C.length / 255;
1227
+ for (let t = 0; t < w.length; t++) e += w[t];
1228
+ let t = e / w.length / 255;
1229
1229
  b.current = [...b.current, t], u((e) => [...e, t]);
1230
1230
  }
1231
1231
  }, 100), t !== void 0 && t > 0 && (_.current = setTimeout(() => {
1232
1232
  d.current && d.current.state !== "inactive" && d.current.stop();
1233
1233
  }, t * 1e3)), i("recording");
1234
- }, [t, S]), te = O(() => {
1234
+ }, [t, C]), ee = E(() => {
1235
1235
  d.current && d.current.state !== "inactive" && (x.current = !1, d.current.stop());
1236
- }, []), ne = O(() => {
1237
- d.current && d.current.state !== "inactive" ? (x.current = !0, d.current.stop()) : (S(), i("idle"), o(0), u([]));
1238
- }, [S]), re = O(() => {
1236
+ }, []), te = E(() => {
1237
+ d.current && d.current.state !== "inactive" ? (x.current = !0, d.current.stop()) : (C(), i("idle"), o(0), u([]));
1238
+ }, [C]), ne = E(() => {
1239
1239
  d.current && d.current.state === "recording" && (d.current.pause(), h.current !== null && (clearInterval(h.current), h.current = null), g.current !== null && (clearInterval(g.current), g.current = null), i("paused"));
1240
- }, []), ie = O(() => {
1240
+ }, []), re = E(() => {
1241
1241
  if (d.current && d.current.state === "paused") {
1242
1242
  d.current.resume(), h.current = setInterval(() => {
1243
1243
  y.current += 1, o((e) => e + 1);
@@ -1254,18 +1254,18 @@ function mt(e) {
1254
1254
  }, 100), i("recording");
1255
1255
  }
1256
1256
  }, []);
1257
- return he(() => () => {
1257
+ return me(() => () => {
1258
1258
  h.current !== null && clearInterval(h.current), g.current !== null && clearInterval(g.current), _.current !== null && clearTimeout(_.current), d.current && d.current.state !== "inactive" && d.current.stop(), p.current && p.current.getTracks().forEach((e) => e.stop()), f.current && f.current.close().catch(() => {});
1259
1259
  }, []), {
1260
1260
  state: r,
1261
1261
  duration: a,
1262
1262
  analyserNode: s,
1263
1263
  waveformData: l,
1264
- start: C,
1265
- stop: te,
1266
- cancel: ne,
1267
- pause: re,
1268
- resume: ie
1264
+ start: w,
1265
+ stop: ee,
1266
+ cancel: te,
1267
+ pause: ne,
1268
+ resume: re
1269
1269
  };
1270
1270
  }
1271
1271
  //#endregion
@@ -1306,77 +1306,77 @@ var ht = {
1306
1306
  "[&_li]:text-surface-fg",
1307
1307
  "[&_code]:rounded [&_code]:bg-surface-raised [&_code]:px-ds-02 [&_code]:py-[1px] [&_code]:text-ds-md [&_code]:text-accent-11",
1308
1308
  "[&_strong]:font-semibold [&_strong]:text-surface-fg",
1309
- "[[&_mark]:rounded-sm_mark]:rounded-xs [&_mark]:bg-warning-3 [&_mark]:px-[2px]",
1309
+ "[&_mark]:rounded-xs [&_mark]:bg-warning-3 [&_mark]:px-[2px]",
1310
1310
  "[&_a]:text-accent-11 [&_a]:underline",
1311
1311
  "[&_.mention]:rounded-ds-sm [&_.mention]:bg-accent-2 [&_.mention]:px-ds-02 [&_.mention]:py-[1px] [&_.mention]:font-medium [&_.mention]:text-accent-11"
1312
1312
  ].join(" ");
1313
1313
  function _t({ options: e }) {
1314
- let [t, n] = D.useState(!1), r = D.useRef(null);
1315
- return D.useEffect(() => {
1314
+ let [t, n] = T.useState(!1), r = T.useRef(null);
1315
+ return T.useEffect(() => {
1316
1316
  if (!t) return;
1317
1317
  let e = (e) => {
1318
1318
  r.current && !r.current.contains(e.target) && n(!1);
1319
1319
  };
1320
1320
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
1321
- }, [t]), /* @__PURE__ */ M("div", {
1321
+ }, [t]), /* @__PURE__ */ A("div", {
1322
1322
  ref: r,
1323
1323
  className: "relative",
1324
- children: [/* @__PURE__ */ j("button", {
1324
+ children: [/* @__PURE__ */ k("button", {
1325
1325
  type: "button",
1326
1326
  onClick: () => n((e) => !e),
1327
1327
  title: "More send options",
1328
1328
  "aria-label": "More send options",
1329
1329
  "aria-expanded": t,
1330
- className: c("inline-flex h-ds-xs-plus w-5 items-center justify-center rounded-ds-md touch-target", "text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg", "transition-colors duration-fast-01 ease-productive-standard", t && "bg-surface-raised-hover text-surface-fg"),
1331
- children: /* @__PURE__ */ j(u, {
1332
- icon: xe,
1330
+ className: a("inline-flex h-ds-xs-plus w-5 items-center justify-center rounded-ds-md touch-target", "text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg", "transition-colors duration-fast-01 ease-productive-standard", t && "bg-surface-raised-hover text-surface-fg"),
1331
+ children: /* @__PURE__ */ k(s, {
1332
+ icon: be,
1333
1333
  size: "xs"
1334
1334
  })
1335
- }), t && /* @__PURE__ */ M("div", {
1335
+ }), t && /* @__PURE__ */ A("div", {
1336
1336
  className: "absolute bottom-full right-0 mb-ds-02 min-w-[200px] rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-02 shadow-floating z-popover",
1337
- children: [/* @__PURE__ */ j("p", {
1337
+ children: [/* @__PURE__ */ k("p", {
1338
1338
  className: "px-ds-03 py-ds-01 text-ds-xs font-medium text-surface-fg-subtle",
1339
1339
  children: "Send options"
1340
- }), e.map((e, t) => /* @__PURE__ */ M("button", {
1340
+ }), e.map((e, t) => /* @__PURE__ */ A("button", {
1341
1341
  type: "button",
1342
1342
  onClick: () => {
1343
1343
  e.onSelect(), n(!1);
1344
1344
  },
1345
1345
  className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02 text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
1346
- children: [e.icon && /* @__PURE__ */ j(e.icon, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }), e.label]
1346
+ children: [e.icon && /* @__PURE__ */ k(e.icon, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }), e.label]
1347
1347
  }, t))]
1348
1348
  })]
1349
1349
  });
1350
1350
  }
1351
- var vt = D.lazy(() => import("@emoji-mart/react"));
1351
+ var vt = T.lazy(() => import("@emoji-mart/react"));
1352
1352
  function yt({ set: e = "native", onSelect: t, onClose: n }) {
1353
- let [r, i] = D.useState(null), { colorMode: a } = pe(), o = D.useRef(null);
1354
- D.useEffect(() => {
1355
- (y[e] ?? y.native)().then((e) => i(e.default));
1356
- }, [e]), D.useEffect(() => {
1353
+ let [r, i] = T.useState(null), { colorMode: a } = pe(), o = T.useRef(null);
1354
+ T.useEffect(() => {
1355
+ (g[e] ?? g.native)().then((e) => i(e.default));
1356
+ }, [e]), T.useEffect(() => {
1357
1357
  let e = (e) => {
1358
1358
  o.current && !o.current.contains(e.target) && n();
1359
1359
  };
1360
1360
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
1361
- }, [n]), D.useEffect(() => {
1361
+ }, [n]), T.useEffect(() => {
1362
1362
  let e = (e) => {
1363
1363
  e.key === "Escape" && n();
1364
1364
  };
1365
1365
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
1366
1366
  }, [n]);
1367
- let s = /* @__PURE__ */ j("div", {
1367
+ let s = /* @__PURE__ */ k("div", {
1368
1368
  className: "flex h-[350px] w-[352px] items-center justify-center rounded-ds-lg border border-surface-border-strong bg-surface-overlay shadow-floating",
1369
- children: /* @__PURE__ */ j("span", {
1369
+ children: /* @__PURE__ */ k("span", {
1370
1370
  className: "text-ds-sm text-surface-fg-subtle",
1371
1371
  children: "Loading..."
1372
1372
  })
1373
1373
  });
1374
- return /* @__PURE__ */ j("div", {
1374
+ return /* @__PURE__ */ k("div", {
1375
1375
  ref: o,
1376
1376
  className: "rounded-ds-lg border border-surface-border-strong bg-surface-overlay shadow-floating overflow-hidden",
1377
- children: r ? /* @__PURE__ */ j(D.Suspense, {
1377
+ children: r ? /* @__PURE__ */ k(T.Suspense, {
1378
1378
  fallback: s,
1379
- children: /* @__PURE__ */ j(vt, {
1379
+ children: /* @__PURE__ */ k(vt, {
1380
1380
  data: r,
1381
1381
  set: e,
1382
1382
  onEmojiSelect: (e) => t({
@@ -1391,18 +1391,18 @@ function yt({ set: e = "native", onSelect: t, onClose: n }) {
1391
1391
  });
1392
1392
  }
1393
1393
  function Q({ onClick: e, isActive: t = !1, title: n, children: r }) {
1394
- return /* @__PURE__ */ j("button", {
1394
+ return /* @__PURE__ */ k("button", {
1395
1395
  type: "button",
1396
1396
  onClick: e,
1397
1397
  title: n,
1398
1398
  "aria-label": n,
1399
1399
  "aria-pressed": t,
1400
- className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "transition-colors duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover", t ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle"),
1400
+ className: a("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "transition-colors duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover", t ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle"),
1401
1401
  children: r
1402
1402
  });
1403
1403
  }
1404
1404
  function bt({ editor: e }) {
1405
- let t = S({
1405
+ let t = C({
1406
1406
  editor: e,
1407
1407
  selector: ({ editor: e }) => ({
1408
1408
  isBold: e.isActive("bold"),
@@ -1413,72 +1413,72 @@ function bt({ editor: e }) {
1413
1413
  isCode: e.isActive("code")
1414
1414
  })
1415
1415
  });
1416
- return /* @__PURE__ */ M(T, {
1416
+ return /* @__PURE__ */ A(w, {
1417
1417
  editor: e,
1418
1418
  className: "flex gap-ds-01 rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-02 shadow-floating",
1419
1419
  children: [
1420
- /* @__PURE__ */ j(Q, {
1420
+ /* @__PURE__ */ k(Q, {
1421
1421
  onClick: () => e.chain().focus().toggleBold().run(),
1422
1422
  isActive: t.isBold,
1423
1423
  title: "Bold",
1424
- children: /* @__PURE__ */ j(u, {
1425
- icon: ye,
1424
+ children: /* @__PURE__ */ k(s, {
1425
+ icon: j,
1426
1426
  size: "xs"
1427
1427
  })
1428
1428
  }),
1429
- /* @__PURE__ */ j(Q, {
1429
+ /* @__PURE__ */ k(Q, {
1430
1430
  onClick: () => e.chain().focus().toggleItalic().run(),
1431
1431
  isActive: t.isItalic,
1432
1432
  title: "Italic",
1433
- children: /* @__PURE__ */ j(u, {
1434
- icon: P,
1433
+ children: /* @__PURE__ */ k(s, {
1434
+ icon: Te,
1435
1435
  size: "xs"
1436
1436
  })
1437
1437
  }),
1438
- /* @__PURE__ */ j(Q, {
1438
+ /* @__PURE__ */ k(Q, {
1439
1439
  onClick: () => e.chain().focus().toggleUnderline().run(),
1440
1440
  isActive: t.isUnderline,
1441
1441
  title: "Underline",
1442
- children: /* @__PURE__ */ j(u, {
1443
- icon: Le,
1442
+ children: /* @__PURE__ */ k(s, {
1443
+ icon: I,
1444
1444
  size: "xs"
1445
1445
  })
1446
1446
  }),
1447
- /* @__PURE__ */ j(Q, {
1447
+ /* @__PURE__ */ k(Q, {
1448
1448
  onClick: () => e.chain().focus().toggleStrike().run(),
1449
1449
  isActive: t.isStrike,
1450
1450
  title: "Strikethrough",
1451
- children: /* @__PURE__ */ j(u, {
1452
- icon: R,
1451
+ children: /* @__PURE__ */ k(s, {
1452
+ icon: F,
1453
1453
  size: "xs"
1454
1454
  })
1455
1455
  }),
1456
- /* @__PURE__ */ j(Q, {
1456
+ /* @__PURE__ */ k(Q, {
1457
1457
  onClick: () => e.chain().focus().toggleHighlight().run(),
1458
1458
  isActive: t.isHighlight,
1459
1459
  title: "Highlight",
1460
- children: /* @__PURE__ */ j(u, {
1461
- icon: Te,
1460
+ children: /* @__PURE__ */ k(s, {
1461
+ icon: we,
1462
1462
  size: "xs"
1463
1463
  })
1464
1464
  }),
1465
- /* @__PURE__ */ j(Q, {
1465
+ /* @__PURE__ */ k(Q, {
1466
1466
  onClick: () => e.chain().focus().toggleCode().run(),
1467
1467
  isActive: t.isCode,
1468
1468
  title: "Code",
1469
- children: /* @__PURE__ */ j(u, {
1470
- icon: Ce,
1469
+ children: /* @__PURE__ */ k(s, {
1470
+ icon: Se,
1471
1471
  size: "xs"
1472
1472
  })
1473
1473
  })
1474
1474
  ]
1475
1475
  });
1476
1476
  }
1477
- var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message...", disabled: p = !1, content: m = "", variant: h = "compact", enterBehavior: g = "send", maxLength: _, charCountDisplay: y = "near-limit", mentions: w, onMentionSearch: T, onMentionSelect: oe, onFileUpload: pe, onImageUpload: me, slashCommands: E, onVoiceRecord: O, onTranscribe: he, maxDuration: k, replyTo: A, onTyping: ge, onEmpty: ve, isStreaming: N = !1, onCancel: ye, leadingSlot: be, trailingSlot: xe, disclaimer: Ce, toolbar: we = !0, sendOptions: Te, onSchedule: P, actionButton: Ee, emojiSet: F = "native", className: De, ...Ae }, je) {
1478
- let [I, L] = D.useState("idle"), [R, Le] = D.useState(!1), [z, Re] = D.useState(!1), [B, ze] = D.useState(null), [He, Ue] = D.useState(!1), [We, Ge] = D.useState(!1), [Je, Xe] = D.useState(0), V = D.useRef(null), Qe = D.useRef(null);
1479
- D.useEffect(() => {
1480
- if (!z || !V.current || !Qe.current) return;
1481
- let i = V.current, a = Qe.current, o = () => {
1477
+ var xt = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message...", disabled: d = !1, content: f = "", variant: p = "compact", enterBehavior: m = "send", maxLength: g, charCountDisplay: _ = "near-limit", mentions: v, onMentionSearch: w, onMentionSelect: ae, onFileUpload: oe, onImageUpload: pe, slashCommands: E, onVoiceRecord: me, onTranscribe: D, maxDuration: O, replyTo: he, onTyping: _e, onEmpty: ve, isStreaming: j = !1, onCancel: ye, leadingSlot: be, trailingSlot: Se, disclaimer: Ce, toolbar: we = !0, sendOptions: Te, onSchedule: M, actionButton: Ee, emojiSet: N = "native", className: ke, ...Ae }, je) {
1478
+ let [P, F] = T.useState("idle"), [I, L] = T.useState(!1), [Le, Re] = T.useState(!1), [B, ze] = T.useState(null), [Ve, V] = T.useState(!1), [Ue, We] = T.useState(!1), [Ke, H] = T.useState(0), U = T.useRef(null), W = T.useRef(null);
1479
+ T.useEffect(() => {
1480
+ if (!Le || !U.current || !W.current) return;
1481
+ let i = U.current, a = W.current, o = () => {
1482
1482
  e(i, a, {
1483
1483
  placement: "top-end",
1484
1484
  middleware: [
@@ -1496,36 +1496,36 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
1496
1496
  return o(), window.addEventListener("scroll", o, !0), window.addEventListener("resize", o), () => {
1497
1497
  window.removeEventListener("scroll", o, !0), window.removeEventListener("resize", o);
1498
1498
  };
1499
- }, [z]);
1500
- let [H, U] = D.useState([]), [W, G] = D.useState(null), [K, et] = D.useState(!1), tt = D.useRef(null), nt = D.useRef(null), rt = D.useRef(void 0), it = D.useRef(void 0), at = D.useRef(g);
1501
- at.current = g;
1502
- let ot = d(), q = ht[h], st = q.maxHeight, J = mt({
1503
- maxDuration: k,
1499
+ }, [Le]);
1500
+ let [G, K] = T.useState([]), [q, qe] = T.useState(null), [Je, Ye] = T.useState(!1), Xe = T.useRef(null), Ze = T.useRef(null), Qe = T.useRef(void 0), $e = T.useRef(void 0), et = T.useRef(m);
1501
+ et.current = m;
1502
+ let tt = c(), J = ht[p], nt = J.maxHeight, Y = mt({
1503
+ maxDuration: O,
1504
1504
  onComplete: async (e, t, n) => {
1505
- if (O?.(e, t), he) {
1506
- let n = await he(e, t);
1505
+ if (me?.(e, t), D) {
1506
+ let n = await D(e, t);
1507
1507
  if (n != null) {
1508
- Y?.chain().focus().insertContent(n).run(), L("idle");
1508
+ X?.chain().focus().insertContent(n).run(), F("idle");
1509
1509
  return;
1510
1510
  }
1511
1511
  }
1512
- G({
1512
+ qe({
1513
1513
  blob: e,
1514
1514
  duration: t,
1515
1515
  waveformData: n
1516
- }), L("review");
1516
+ }), F("review");
1517
1517
  }
1518
- }), ct = D.useCallback(() => {
1519
- J.start(), L("recording");
1520
- }, [J]), lt = D.useCallback(() => {
1521
- J.stop();
1522
- }, [J]), ut = D.useCallback(() => {
1523
- J.cancel(), L("idle");
1524
- }, [J]), Y = ne({
1518
+ }), it = T.useCallback(() => {
1519
+ Y.start(), F("recording");
1520
+ }, [Y]), st = T.useCallback(() => {
1521
+ Y.stop();
1522
+ }, [Y]), ct = T.useCallback(() => {
1523
+ Y.cancel(), F("idle");
1524
+ }, [Y]), X = te({
1525
1525
  immediatelyRender: !1,
1526
- extensions: D.useMemo(() => {
1526
+ extensions: T.useMemo(() => {
1527
1527
  let e = [
1528
- ae.configure({
1528
+ ne.configure({
1529
1529
  heading: !1,
1530
1530
  horizontalRule: !1,
1531
1531
  codeBlock: !1,
@@ -1535,41 +1535,41 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
1535
1535
  HTMLAttributes: { class: "text-accent-11 underline" }
1536
1536
  }
1537
1537
  }),
1538
- te.configure({ placeholder: l }),
1539
- ie.configure({ multicolor: !1 }),
1540
- C,
1541
- b.configure({ limit: _ || void 0 }),
1542
- ue,
1543
- de,
1544
- le(F),
1545
- ee.create({
1538
+ re.configure({ placeholder: u }),
1539
+ ee.configure({ multicolor: !1 }),
1540
+ b,
1541
+ y.configure({ limit: g || void 0 }),
1542
+ le,
1543
+ ce,
1544
+ de(N),
1545
+ S.create({
1546
1546
  name: "enterToSend",
1547
1547
  addKeyboardShortcuts() {
1548
1548
  return {
1549
- Enter: () => at.current === "send" ? (it.current?.(), !0) : !1,
1550
- "Shift-Enter": () => at.current === "send" ? (this.editor.commands.splitBlock(), !0) : !1,
1551
- "Mod-Enter": () => (it.current?.(), !0)
1549
+ Enter: () => et.current === "send" ? ($e.current?.(), !0) : !1,
1550
+ "Shift-Enter": () => et.current === "send" ? (this.editor.commands.splitBlock(), !0) : !1,
1551
+ "Mod-Enter": () => ($e.current?.(), !0)
1552
1552
  };
1553
1553
  }
1554
1554
  })
1555
1555
  ];
1556
- return (w || T) && e.push(re.configure({
1556
+ return (v || w) && e.push(ie.configure({
1557
1557
  HTMLAttributes: { class: "mention" },
1558
1558
  suggestion: {
1559
- items: async ({ query: e }) => T ? await T(e) : w ? w.filter((t) => t.label.toLowerCase().includes(e.toLowerCase())).slice(0, 8) : [],
1560
- render: fe(oe)
1559
+ items: async ({ query: e }) => w ? await w(e) : v ? v.filter((t) => t.label.toLowerCase().includes(e.toLowerCase())).slice(0, 8) : [],
1560
+ render: fe(ae)
1561
1561
  }
1562
1562
  })), E && e.push(Be(E)), e;
1563
1563
  }, [
1564
- l,
1565
- _,
1566
- F,
1564
+ u,
1565
+ g,
1566
+ N,
1567
+ !!v,
1567
1568
  !!w,
1568
- !!T,
1569
1569
  !!E
1570
1570
  ]),
1571
- content: m || void 0,
1572
- editable: !p,
1571
+ content: f || void 0,
1572
+ editable: !d,
1573
1573
  editorProps: {
1574
1574
  attributes: { class: gt },
1575
1575
  handlePaste: (e, t) => {
@@ -1577,52 +1577,52 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
1577
1577
  return n.length > 0 ? (n.forEach(Z), !0) : !1;
1578
1578
  }
1579
1579
  }
1580
- }), X = D.useCallback(() => {
1581
- if (!Y) return;
1582
- let e = !Y.isEmpty, t = H.length > 0, n = !!W;
1583
- if (!e && !t && !n || N) return;
1580
+ }), lt = T.useCallback(() => {
1581
+ if (!X) return;
1582
+ let e = !X.isEmpty, t = G.length > 0, n = !!q;
1583
+ if (!e && !t && !n || j) return;
1584
1584
  let r = {
1585
- html: e ? Y.getHTML() : "",
1586
- plainText: e ? Y.getText() : ""
1585
+ html: e ? X.getHTML() : "",
1586
+ plainText: e ? X.getText() : ""
1587
1587
  };
1588
- t && (r.attachments = H.filter((e) => !e.uploading && e.url).map((e) => ({
1588
+ t && (r.attachments = G.filter((e) => !e.uploading && e.url).map((e) => ({
1589
1589
  url: e.url,
1590
1590
  name: e.name,
1591
1591
  size: e.size,
1592
1592
  type: e.type
1593
1593
  }))), n && (r.voiceNote = {
1594
- blob: W.blob,
1595
- duration: W.duration
1596
- }), B && P ? P(r, B) : o(r), Y.commands.clearContent(), U([]), G(null), ze(null), L("idle");
1594
+ blob: q.blob,
1595
+ duration: q.duration
1596
+ }), B && M ? M(r, B) : o(r), X.commands.clearContent(), K([]), qe(null), ze(null), F("idle");
1597
1597
  }, [
1598
- Y,
1599
- H,
1600
- W,
1601
- N,
1598
+ X,
1599
+ G,
1600
+ q,
1601
+ j,
1602
1602
  o,
1603
- P,
1603
+ M,
1604
1604
  B
1605
1605
  ]);
1606
- it.current = X, D.useEffect(() => {
1607
- if (!Y || !ge) return;
1606
+ $e.current = lt, T.useEffect(() => {
1607
+ if (!X || !_e) return;
1608
1608
  let e = () => {
1609
- ge(!0), clearTimeout(rt.current), rt.current = setTimeout(() => ge(!1), 2e3);
1609
+ _e(!0), clearTimeout(Qe.current), Qe.current = setTimeout(() => _e(!1), 2e3);
1610
1610
  };
1611
- return Y.on("update", e), () => {
1612
- Y.off("update", e), clearTimeout(rt.current);
1611
+ return X.on("update", e), () => {
1612
+ X.off("update", e), clearTimeout(Qe.current);
1613
1613
  };
1614
- }, [Y, ge]), D.useEffect(() => {
1615
- if (!Y || !ve) return;
1614
+ }, [X, _e]), T.useEffect(() => {
1615
+ if (!X || !ve) return;
1616
1616
  let e = () => {
1617
- ve(Y.isEmpty);
1617
+ ve(X.isEmpty);
1618
1618
  };
1619
- return Y.on("update", e), e(), () => {
1620
- Y.off("update", e);
1619
+ return X.on("update", e), e(), () => {
1620
+ X.off("update", e);
1621
1621
  };
1622
- }, [Y, ve]);
1623
- let Z = D.useCallback(async (e) => {
1622
+ }, [X, ve]);
1623
+ let Z = T.useCallback(async (e) => {
1624
1624
  let t = Math.random().toString(36).slice(2), n = e.type.startsWith("image/");
1625
- U((r) => [...r, {
1625
+ K((r) => [...r, {
1626
1626
  id: t,
1627
1627
  name: e.name,
1628
1628
  size: e.size,
@@ -1630,16 +1630,16 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
1630
1630
  uploading: !0
1631
1631
  }]);
1632
1632
  try {
1633
- if (n && me) {
1634
- let n = await me(e);
1635
- U((e) => e.map((e) => e.id === t ? {
1633
+ if (n && pe) {
1634
+ let n = await pe(e);
1635
+ K((e) => e.map((e) => e.id === t ? {
1636
1636
  ...e,
1637
1637
  url: n,
1638
1638
  uploading: !1
1639
1639
  } : e));
1640
- } else if (pe) {
1641
- let n = await pe(e);
1642
- U((e) => e.map((e) => e.id === t ? {
1640
+ } else if (oe) {
1641
+ let n = await oe(e);
1642
+ K((e) => e.map((e) => e.id === t ? {
1643
1643
  ...e,
1644
1644
  url: n.url,
1645
1645
  name: n.name,
@@ -1648,163 +1648,163 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
1648
1648
  } : e));
1649
1649
  } else if (n) {
1650
1650
  let n = URL.createObjectURL(e);
1651
- U((e) => e.map((e) => e.id === t ? {
1651
+ K((e) => e.map((e) => e.id === t ? {
1652
1652
  ...e,
1653
1653
  url: n,
1654
1654
  uploading: !1
1655
1655
  } : e));
1656
- } else U((e) => e.filter((e) => e.id !== t));
1656
+ } else K((e) => e.filter((e) => e.id !== t));
1657
1657
  } catch {
1658
- U((e) => e.filter((e) => e.id !== t));
1658
+ K((e) => e.filter((e) => e.id !== t));
1659
1659
  }
1660
- }, [pe, me]), pt = D.useCallback((e) => {
1661
- U((t) => t.filter((t) => t.id !== e));
1662
- }, []), vt = D.useCallback((e) => {
1663
- e.preventDefault(), et(!1), Array.from(e.dataTransfer.files).forEach(Z);
1664
- }, [Z]), Q = D.useCallback((e) => {
1660
+ }, [oe, pe]), pt = T.useCallback((e) => {
1661
+ K((t) => t.filter((t) => t.id !== e));
1662
+ }, []), vt = T.useCallback((e) => {
1663
+ e.preventDefault(), Ye(!1), Array.from(e.dataTransfer.files).forEach(Z);
1664
+ }, [Z]), Q = T.useCallback((e) => {
1665
1665
  Array.from(e.target.files || []).forEach(Z), e.target.value = "";
1666
- }, [Z]), xt = D.useCallback(() => {
1667
- G(null), L("idle");
1668
- }, []), St = S({
1669
- editor: Y,
1666
+ }, [Z]), xt = T.useCallback(() => {
1667
+ qe(null), F("idle");
1668
+ }, []), St = C({
1669
+ editor: X,
1670
1670
  selector: ({ editor: e }) => e ? { editorIsEmpty: e.isEmpty } : null
1671
1671
  })?.editorIsEmpty ?? !0;
1672
- D.useEffect(() => {
1673
- if (!Y) return;
1672
+ T.useEffect(() => {
1673
+ if (!X) return;
1674
1674
  let e = () => {
1675
- Xe(Y.state.doc.textBetween(0, Y.state.doc.content.size, void 0, " ").length);
1675
+ H(X.state.doc.textBetween(0, X.state.doc.content.size, void 0, " ").length);
1676
1676
  };
1677
- return e(), Y.on("update", e), () => {
1678
- Y.off("update", e);
1677
+ return e(), X.on("update", e), () => {
1678
+ X.off("update", e);
1679
1679
  };
1680
- }, [Y]);
1681
- let Ct = !St || H.length > 0 || !!W, wt = R || I === "review" || h === "expanded", $ = "icon-md";
1682
- return /* @__PURE__ */ M("div", {
1680
+ }, [X]);
1681
+ let Ct = !St || G.length > 0 || !!q, wt = I || P === "review" || p === "expanded", $ = "icon-md";
1682
+ return /* @__PURE__ */ A("div", {
1683
1683
  ref: je,
1684
- className: c("border-t border-surface-border-subtle px-ds-05 py-ds-04", "flex items-center gap-ds-03", De),
1684
+ className: a("border-t border-surface-border-subtle px-ds-05 py-ds-04", "flex items-center gap-ds-03", ke),
1685
1685
  ...Ae,
1686
1686
  children: [
1687
- Ee !== !1 && (Ee ?? (pe || me ? /* @__PURE__ */ j(f, {
1687
+ Ee !== !1 && (Ee ?? (oe || pe ? /* @__PURE__ */ k(l, {
1688
1688
  variant: "solid",
1689
1689
  size: "icon-md",
1690
- onClick: () => tt.current?.click(),
1690
+ onClick: () => Xe.current?.click(),
1691
1691
  title: "Attach",
1692
1692
  "aria-label": "Attach file",
1693
1693
  className: "shrink-0",
1694
- children: /* @__PURE__ */ j(u, {
1694
+ children: /* @__PURE__ */ k(s, {
1695
1695
  icon: Me,
1696
1696
  size: "md"
1697
1697
  })
1698
1698
  }) : null)),
1699
- /* @__PURE__ */ M("div", {
1699
+ /* @__PURE__ */ A("div", {
1700
1700
  role: "region",
1701
1701
  "aria-label": "Message composer",
1702
- className: c("flex-1 min-w-0 overflow-hidden rounded-ds-lg border border-surface-border-strong bg-surface-raised-hover", "transition-[color,background-color,border-color,box-shadow] duration-fast-02 ease-productive-standard", "hover:bg-surface-raised-active", "focus-within:ring-2 focus-within:ring-accent-9 focus-within:ring-offset-2 focus-within:border-accent-9", I === "recording" && "border-error-7/30", K && "border-dashed border-accent-7 bg-accent-2", p && "opacity-action-disabled cursor-not-allowed"),
1703
- onFocus: () => Ge(!0),
1702
+ className: a("flex-1 min-w-0 overflow-hidden rounded-ds-lg border border-surface-border-strong bg-surface-raised-hover", "transition-[color,background-color,border-color,box-shadow] duration-fast-02 ease-productive-standard", "hover:bg-surface-raised-active", "focus-within:ring-2 focus-within:ring-accent-9 focus-within:ring-offset-2 focus-within:border-accent-9", P === "recording" && "border-error-7/30", Je && "border-dashed border-accent-7 bg-accent-2", d && "opacity-action-disabled cursor-not-allowed"),
1703
+ onFocus: () => We(!0),
1704
1704
  onBlur: (e) => {
1705
- e.currentTarget.contains(e.relatedTarget) || Ge(!1);
1705
+ e.currentTarget.contains(e.relatedTarget) || We(!1);
1706
1706
  },
1707
1707
  onDragOver: (e) => {
1708
- e.preventDefault(), et(!0);
1708
+ e.preventDefault(), Ye(!0);
1709
1709
  },
1710
- onDragLeave: () => et(!1),
1710
+ onDragLeave: () => Ye(!1),
1711
1711
  onDrop: vt,
1712
1712
  children: [
1713
1713
  be,
1714
- /* @__PURE__ */ j(a, { children: A && /* @__PURE__ */ j(Ve, {
1715
- author: A.author,
1716
- preview: A.preview,
1717
- onDismiss: A.onDismiss
1714
+ /* @__PURE__ */ k(R, { children: he && /* @__PURE__ */ k(ot, {
1715
+ author: he.author,
1716
+ preview: he.preview,
1717
+ onDismiss: he.onDismiss
1718
1718
  }, "reply") }),
1719
- /* @__PURE__ */ j(a, { children: B && /* @__PURE__ */ j(Ye, {
1719
+ /* @__PURE__ */ k(R, { children: B && /* @__PURE__ */ k(ft, {
1720
1720
  date: B,
1721
- onEdit: () => Ue(!0),
1721
+ onEdit: () => V(!0),
1722
1722
  onClear: () => ze(null)
1723
1723
  }, "schedule") }),
1724
- /* @__PURE__ */ j(a, { children: H.length > 0 && /* @__PURE__ */ j(Ze, {
1725
- attachments: H,
1724
+ /* @__PURE__ */ k(R, { children: G.length > 0 && /* @__PURE__ */ k(He, {
1725
+ attachments: G,
1726
1726
  onRemoveAttachment: pt
1727
1727
  }, "attachments") }),
1728
- q.toolbarPosition === "top" && Y && /* @__PURE__ */ j("div", {
1729
- className: c("grid transition-[grid-template-rows,opacity] duration-moderate-01 ease-productive-standard", R ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
1730
- children: /* @__PURE__ */ j("div", {
1728
+ J.toolbarPosition === "top" && X && /* @__PURE__ */ k("div", {
1729
+ className: a("grid transition-[grid-template-rows,opacity] duration-moderate-01 ease-productive-standard", I ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
1730
+ children: /* @__PURE__ */ k("div", {
1731
1731
  className: "overflow-hidden",
1732
- children: /* @__PURE__ */ j(dt, {
1733
- editor: Y,
1732
+ children: /* @__PURE__ */ k(rt, {
1733
+ editor: X,
1734
1734
  toolbar: we,
1735
1735
  isMobile: !1,
1736
- hasMentions: !!(w || T),
1736
+ hasMentions: !!(v || w),
1737
1737
  hasSlashCommands: !!E,
1738
- disabled: p
1738
+ disabled: d
1739
1739
  })
1740
1740
  })
1741
1741
  }),
1742
- /* @__PURE__ */ M("div", {
1742
+ /* @__PURE__ */ A("div", {
1743
1743
  className: "relative",
1744
- children: [I === "recording" && /* @__PURE__ */ j($e, {
1745
- duration: J.duration,
1746
- analyserNode: J.analyserNode,
1747
- maxDuration: k,
1748
- onCancel: ut
1749
- }), /* @__PURE__ */ M("div", {
1750
- ref: nt,
1751
- className: c("flex items-center px-ds-04 py-ds-03 cursor-text [&_.tiptap]:w-full [&_.tiptap]:outline-hidden", I === "recording" && "invisible"),
1744
+ children: [P === "recording" && /* @__PURE__ */ k(at, {
1745
+ duration: Y.duration,
1746
+ analyserNode: Y.analyserNode,
1747
+ maxDuration: O,
1748
+ onCancel: ct
1749
+ }), /* @__PURE__ */ A("div", {
1750
+ ref: Ze,
1751
+ className: a("flex items-center px-ds-04 py-ds-03 cursor-text [&_.tiptap]:w-full [&_.tiptap]:outline-hidden", P === "recording" && "invisible"),
1752
1752
  style: {
1753
- minHeight: q.minHeight,
1754
- maxHeight: st,
1753
+ minHeight: J.minHeight,
1754
+ maxHeight: nt,
1755
1755
  overflowY: "auto"
1756
1756
  },
1757
- onClick: () => Y?.commands.focus(),
1758
- children: [/* @__PURE__ */ j("div", {
1757
+ onClick: () => X?.commands.focus(),
1758
+ children: [/* @__PURE__ */ k("div", {
1759
1759
  className: "flex-1 min-w-0",
1760
- children: /* @__PURE__ */ j(x, { editor: Y })
1761
- }), Y && I !== "recording" && /* @__PURE__ */ M("div", {
1760
+ children: /* @__PURE__ */ k(x, { editor: X })
1761
+ }), X && P !== "recording" && /* @__PURE__ */ A("div", {
1762
1762
  className: "flex items-center gap-ds-01 shrink-0 ml-ds-03",
1763
- children: [/* @__PURE__ */ j("button", {
1763
+ children: [/* @__PURE__ */ k("button", {
1764
1764
  type: "button",
1765
- onClick: () => Le((e) => !e),
1766
- title: R ? "Hide formatting" : "Show formatting",
1767
- "aria-label": R ? "Hide formatting" : "Show formatting",
1768
- "aria-pressed": R,
1769
- className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "transition-colors duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover", R ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle"),
1770
- children: /* @__PURE__ */ j(u, {
1765
+ onClick: () => L((e) => !e),
1766
+ title: I ? "Hide formatting" : "Show formatting",
1767
+ "aria-label": I ? "Hide formatting" : "Show formatting",
1768
+ "aria-pressed": I,
1769
+ className: a("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "transition-colors duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover", I ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle"),
1770
+ children: /* @__PURE__ */ k(s, {
1771
1771
  icon: Fe,
1772
1772
  size: "xs"
1773
1773
  })
1774
- }), /* @__PURE__ */ M("div", {
1774
+ }), /* @__PURE__ */ A("div", {
1775
1775
  className: "relative",
1776
- children: [/* @__PURE__ */ j("button", {
1777
- ref: V,
1776
+ children: [/* @__PURE__ */ k("button", {
1777
+ ref: U,
1778
1778
  type: "button",
1779
1779
  onClick: () => Re((e) => !e),
1780
1780
  title: "Emoji",
1781
1781
  "aria-label": "Emoji",
1782
- className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target transition-colors duration-fast-01", z ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg"),
1783
- children: /* @__PURE__ */ j(u, {
1784
- icon: ke,
1782
+ className: a("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target transition-colors duration-fast-01", Le ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg"),
1783
+ children: /* @__PURE__ */ k(s, {
1784
+ icon: Oe,
1785
1785
  size: "xs"
1786
1786
  })
1787
- }), z && _e.createPortal(/* @__PURE__ */ j("div", {
1788
- ref: Qe,
1787
+ }), Le && ge.createPortal(/* @__PURE__ */ k("div", {
1788
+ ref: W,
1789
1789
  className: "absolute z-popover",
1790
1790
  style: {
1791
1791
  top: 0,
1792
1792
  left: 0
1793
1793
  },
1794
- children: /* @__PURE__ */ j(yt, {
1795
- set: F,
1794
+ children: /* @__PURE__ */ k(yt, {
1795
+ set: N,
1796
1796
  onSelect: async ({ id: e, native: t }) => {
1797
- let n = se(await ce(F), e);
1798
- n ? Y.chain().focus().insertContent({
1797
+ let n = ue(await se(N), e);
1798
+ n ? X.chain().focus().insertContent({
1799
1799
  type: "emojiNode",
1800
1800
  attrs: {
1801
1801
  id: e,
1802
1802
  native: n.native,
1803
- set: F,
1803
+ set: N,
1804
1804
  x: n.x,
1805
1805
  y: n.y
1806
1806
  }
1807
- }).run() : Y.chain().focus().insertContent(t).run(), Re(!1);
1807
+ }).run() : X.chain().focus().insertContent(t).run(), Re(!1);
1808
1808
  },
1809
1809
  onClose: () => Re(!1)
1810
1810
  })
@@ -1813,55 +1813,55 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
1813
1813
  })]
1814
1814
  })]
1815
1815
  }),
1816
- I === "review" && W && /* @__PURE__ */ M("div", {
1816
+ P === "review" && q && /* @__PURE__ */ A("div", {
1817
1817
  className: "flex items-center gap-ds-03 px-ds-04 py-ds-02b border-b border-surface-border",
1818
- children: [/* @__PURE__ */ j(ft, {
1819
- src: W.blob,
1820
- duration: W.duration,
1821
- waveformData: W.waveformData,
1818
+ children: [/* @__PURE__ */ k(Ge, {
1819
+ src: q.blob,
1820
+ duration: q.duration,
1821
+ waveformData: q.waveformData,
1822
1822
  className: "flex-1"
1823
- }), /* @__PURE__ */ j(f, {
1823
+ }), /* @__PURE__ */ k(l, {
1824
1824
  variant: "ghost",
1825
1825
  size: "icon-sm",
1826
1826
  onClick: xt,
1827
1827
  "aria-label": "Discard voice note",
1828
1828
  title: "Discard voice note",
1829
1829
  className: "text-surface-fg-subtle hover:text-error-11",
1830
- children: /* @__PURE__ */ j(u, {
1830
+ children: /* @__PURE__ */ k(s, {
1831
1831
  icon: Ie,
1832
1832
  size: "sm"
1833
1833
  })
1834
1834
  })]
1835
1835
  }),
1836
- ot && Y && !St && /* @__PURE__ */ j(bt, { editor: Y }),
1837
- q.toolbarPosition === "bottom" && Y && /* @__PURE__ */ j("div", {
1838
- className: c("grid transition-[grid-template-rows,opacity] duration-moderate-01 ease-productive-standard", wt ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
1839
- children: /* @__PURE__ */ j("div", {
1836
+ tt && X && !St && /* @__PURE__ */ k(bt, { editor: X }),
1837
+ J.toolbarPosition === "bottom" && X && /* @__PURE__ */ k("div", {
1838
+ className: a("grid transition-[grid-template-rows,opacity] duration-moderate-01 ease-productive-standard", wt ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
1839
+ children: /* @__PURE__ */ k("div", {
1840
1840
  className: "overflow-hidden",
1841
- children: /* @__PURE__ */ j(dt, {
1842
- editor: Y,
1841
+ children: /* @__PURE__ */ k(rt, {
1842
+ editor: X,
1843
1843
  toolbar: we,
1844
- isMobile: ot,
1845
- hasMentions: !!(w || T),
1844
+ isMobile: tt,
1845
+ hasMentions: !!(v || w),
1846
1846
  hasSlashCommands: !!E,
1847
- disabled: p
1847
+ disabled: d
1848
1848
  })
1849
1849
  })
1850
1850
  }),
1851
- _ && y !== "hidden" && (() => {
1852
- let e = Je / _;
1853
- return y === "always" || y === "focus" && We || (y === "near-limit" || !y) && e >= .8 || e >= 1 ? /* @__PURE__ */ M("div", {
1854
- className: c("flex justify-end px-ds-04 pb-ds-02 text-ds-xs tabular-nums transition-opacity duration-fast-01", e >= 1 ? "text-error-11 font-medium" : e >= .9 ? "text-warning-11" : "text-surface-fg-subtle"),
1851
+ g && _ !== "hidden" && (() => {
1852
+ let e = Ke / g;
1853
+ return _ === "always" || _ === "focus" && Ue || (_ === "near-limit" || !_) && e >= .8 || e >= 1 ? /* @__PURE__ */ A("div", {
1854
+ className: a("flex justify-end px-ds-04 pb-ds-02 text-ds-xs tabular-nums transition-opacity duration-fast-01", e >= 1 ? "text-error-11 font-medium" : e >= .9 ? "text-warning-11" : "text-surface-fg-subtle"),
1855
1855
  children: [
1856
- Je,
1856
+ Ke,
1857
1857
  "/",
1858
- _
1858
+ g
1859
1859
  ]
1860
1860
  }) : null;
1861
1861
  })(),
1862
- xe,
1863
- /* @__PURE__ */ j("input", {
1864
- ref: tt,
1862
+ Se,
1863
+ /* @__PURE__ */ k("input", {
1864
+ ref: Xe,
1865
1865
  type: "file",
1866
1866
  multiple: !0,
1867
1867
  className: "hidden",
@@ -1869,13 +1869,13 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
1869
1869
  })
1870
1870
  ]
1871
1871
  }),
1872
- /* @__PURE__ */ M("div", {
1872
+ /* @__PURE__ */ A("div", {
1873
1873
  className: "flex items-center gap-ds-02 shrink-0",
1874
- children: [Te && Te.length > 0 && I !== "recording" && /* @__PURE__ */ j(_t, { options: Te }), /* @__PURE__ */ M(a, {
1874
+ children: [Te && Te.length > 0 && P !== "recording" && /* @__PURE__ */ k(_t, { options: Te }), /* @__PURE__ */ A(R, {
1875
1875
  mode: "popLayout",
1876
1876
  initial: !1,
1877
1877
  children: [
1878
- I === "recording" && /* @__PURE__ */ M(i.div, {
1878
+ P === "recording" && /* @__PURE__ */ A(z.div, {
1879
1879
  initial: {
1880
1880
  scale: .8,
1881
1881
  opacity: 0
@@ -1888,33 +1888,33 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
1888
1888
  scale: .8,
1889
1889
  opacity: 0
1890
1890
  },
1891
- transition: { duration: s.moderate01 },
1891
+ transition: { duration: i.moderate01 },
1892
1892
  className: "flex items-center gap-ds-02",
1893
- children: [/* @__PURE__ */ j(f, {
1893
+ children: [/* @__PURE__ */ k(l, {
1894
1894
  variant: "soft",
1895
1895
  size: $,
1896
- onClick: ut,
1896
+ onClick: ct,
1897
1897
  "aria-label": "Cancel recording",
1898
1898
  title: "Cancel recording",
1899
1899
  className: "text-surface-fg-subtle hover:text-error-11",
1900
- children: /* @__PURE__ */ j(u, {
1900
+ children: /* @__PURE__ */ k(s, {
1901
1901
  icon: Ie,
1902
1902
  size: "md"
1903
1903
  })
1904
- }), /* @__PURE__ */ j(f, {
1904
+ }), /* @__PURE__ */ k(l, {
1905
1905
  variant: "solid",
1906
1906
  size: $,
1907
1907
  color: "error",
1908
- onClick: lt,
1908
+ onClick: st,
1909
1909
  "aria-label": "Stop recording",
1910
1910
  title: "Stop recording",
1911
- children: /* @__PURE__ */ j(u, {
1911
+ children: /* @__PURE__ */ k(s, {
1912
1912
  icon: Pe,
1913
1913
  size: "md"
1914
1914
  })
1915
1915
  })]
1916
1916
  }, "recording"),
1917
- N && I !== "recording" && /* @__PURE__ */ j(i.div, {
1917
+ j && P !== "recording" && /* @__PURE__ */ k(z.div, {
1918
1918
  initial: {
1919
1919
  scale: .8,
1920
1920
  opacity: 0
@@ -1927,21 +1927,21 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
1927
1927
  scale: .8,
1928
1928
  opacity: 0
1929
1929
  },
1930
- transition: { duration: s.moderate01 },
1931
- children: /* @__PURE__ */ j(f, {
1930
+ transition: { duration: i.moderate01 },
1931
+ children: /* @__PURE__ */ k(l, {
1932
1932
  variant: "solid",
1933
1933
  size: $,
1934
1934
  color: "error",
1935
1935
  onClick: ye,
1936
1936
  "aria-label": "Stop",
1937
1937
  title: "Stop",
1938
- children: /* @__PURE__ */ j(u, {
1938
+ children: /* @__PURE__ */ k(s, {
1939
1939
  icon: Pe,
1940
1940
  size: "md"
1941
1941
  })
1942
1942
  })
1943
1943
  }, "streaming"),
1944
- !N && I !== "recording" && Ct && P && /* @__PURE__ */ j(i.div, {
1944
+ !j && P !== "recording" && Ct && M && /* @__PURE__ */ k(z.div, {
1945
1945
  initial: {
1946
1946
  scale: .8,
1947
1947
  opacity: 0
@@ -1954,24 +1954,24 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
1954
1954
  scale: .8,
1955
1955
  opacity: 0
1956
1956
  },
1957
- transition: { duration: s.moderate01 },
1958
- children: /* @__PURE__ */ j(v, {
1959
- onClick: X,
1960
- disabled: p,
1957
+ transition: { duration: i.moderate01 },
1958
+ children: /* @__PURE__ */ k(h, {
1959
+ onClick: lt,
1960
+ disabled: d,
1961
1961
  "aria-label": B ? "Schedule send" : "Send",
1962
1962
  size: $,
1963
- dropdownContent: /* @__PURE__ */ j(Ke, {
1963
+ dropdownContent: /* @__PURE__ */ k(ut, {
1964
1964
  onSchedule: (e) => ze(e),
1965
1965
  onClose: () => {},
1966
- onOpenDialog: () => Ue(!0)
1966
+ onOpenDialog: () => V(!0)
1967
1967
  }),
1968
- children: /* @__PURE__ */ j(u, {
1969
- icon: B ? Se : Ne,
1968
+ children: /* @__PURE__ */ k(s, {
1969
+ icon: B ? xe : Ne,
1970
1970
  size: "md"
1971
1971
  })
1972
1972
  })
1973
1973
  }, "split-send"),
1974
- !N && I !== "recording" && Ct && !P && /* @__PURE__ */ j(i.div, {
1974
+ !j && P !== "recording" && Ct && !M && /* @__PURE__ */ k(z.div, {
1975
1975
  initial: {
1976
1976
  scale: .8,
1977
1977
  opacity: 0
@@ -1984,21 +1984,21 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
1984
1984
  scale: .8,
1985
1985
  opacity: 0
1986
1986
  },
1987
- transition: { duration: s.moderate01 },
1988
- children: /* @__PURE__ */ j(f, {
1987
+ transition: { duration: i.moderate01 },
1988
+ children: /* @__PURE__ */ k(l, {
1989
1989
  variant: "solid",
1990
1990
  size: $,
1991
- onClick: X,
1992
- disabled: p,
1991
+ onClick: lt,
1992
+ disabled: d,
1993
1993
  "aria-label": "Send",
1994
1994
  title: "Send",
1995
- children: /* @__PURE__ */ j(u, {
1995
+ children: /* @__PURE__ */ k(s, {
1996
1996
  icon: Ne,
1997
1997
  size: "md"
1998
1998
  })
1999
1999
  })
2000
2000
  }, "send"),
2001
- !N && I !== "recording" && !Ct && O && /* @__PURE__ */ j(i.div, {
2001
+ !j && P !== "recording" && !Ct && me && /* @__PURE__ */ k(z.div, {
2002
2002
  initial: {
2003
2003
  scale: .8,
2004
2004
  opacity: 0
@@ -2011,20 +2011,20 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
2011
2011
  scale: .8,
2012
2012
  opacity: 0
2013
2013
  },
2014
- transition: { duration: s.moderate01 },
2015
- children: /* @__PURE__ */ j(f, {
2014
+ transition: { duration: i.moderate01 },
2015
+ children: /* @__PURE__ */ k(l, {
2016
2016
  variant: "soft",
2017
2017
  size: $,
2018
- onClick: ct,
2018
+ onClick: it,
2019
2019
  "aria-label": "Record voice message",
2020
2020
  title: "Record voice message",
2021
- children: /* @__PURE__ */ j(u, {
2022
- icon: Oe,
2021
+ children: /* @__PURE__ */ k(s, {
2022
+ icon: De,
2023
2023
  size: "md"
2024
2024
  })
2025
2025
  })
2026
2026
  }, "mic"),
2027
- !N && I !== "recording" && !Ct && !O && /* @__PURE__ */ j(i.div, {
2027
+ !j && P !== "recording" && !Ct && !me && /* @__PURE__ */ k(z.div, {
2028
2028
  initial: {
2029
2029
  scale: .8,
2030
2030
  opacity: 0
@@ -2037,14 +2037,14 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
2037
2037
  scale: .8,
2038
2038
  opacity: 0
2039
2039
  },
2040
- transition: { duration: s.moderate01 },
2041
- children: /* @__PURE__ */ j(f, {
2040
+ transition: { duration: i.moderate01 },
2041
+ children: /* @__PURE__ */ k(l, {
2042
2042
  variant: "solid",
2043
2043
  size: $,
2044
2044
  disabled: !0,
2045
2045
  "aria-label": "Send",
2046
2046
  title: "Send",
2047
- children: /* @__PURE__ */ j(u, {
2047
+ children: /* @__PURE__ */ k(s, {
2048
2048
  icon: Ne,
2049
2049
  size: "md"
2050
2050
  })
@@ -2053,13 +2053,13 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
2053
2053
  ]
2054
2054
  })]
2055
2055
  }),
2056
- Ce && /* @__PURE__ */ j("p", {
2056
+ Ce && /* @__PURE__ */ k("p", {
2057
2057
  className: "mt-ds-02 text-center text-ds-xs text-surface-fg-subtle/50",
2058
2058
  children: Ce
2059
2059
  }),
2060
- P && /* @__PURE__ */ j(qe, {
2061
- open: He,
2062
- onOpenChange: Ue,
2060
+ M && /* @__PURE__ */ k(dt, {
2061
+ open: Ve,
2062
+ onOpenChange: V,
2063
2063
  onSchedule: (e) => ze(e),
2064
2064
  initialDate: B
2065
2065
  })
@@ -2068,4 +2068,4 @@ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message..
2068
2068
  });
2069
2069
  xt.displayName = "RichChatInput";
2070
2070
  //#endregion
2071
- export { G as _, et as a, V as b, lt as c, J as d, ct as f, W as g, rt as h, st as i, it as l, ut as m, mt as n, ot as o, q as p, ft as r, at as s, xt as t, tt as u, K as v, nt as y };
2071
+ export { G as _, Ze as a, V as b, Ye as c, tt as d, Qe as f, W as g, U as h, K as i, q as l, Je as m, mt as n, Xe as o, nt as p, $e as r, J as s, xt as t, et as u, qe as v, Ge as y };