@nivaro/react 0.3.114 → 0.3.116

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 (293) hide show
  1. package/dist/components/ScreenShareHost.js +24 -0
  2. package/dist/full.css +50 -2
  3. package/dist/hooks/useSessionRecorder.js +61 -60
  4. package/dist/index.d.ts +1728 -22
  5. package/dist/index.js +1091 -950
  6. package/dist/shared/components/ActivityEntry.js +209 -97
  7. package/dist/shared/components/AgentPresenceChip.js +51 -0
  8. package/dist/shared/components/AnnouncementBanner.js +56 -41
  9. package/dist/shared/components/AutolinkedText.js +98 -85
  10. package/dist/shared/components/BroadcastView.js +149 -141
  11. package/dist/shared/components/CacheStamp.js +78 -30
  12. package/dist/shared/components/CollectionBrowserView.js +4909 -4182
  13. package/dist/shared/components/ConfigChangeStrip.js +63 -0
  14. package/dist/shared/components/ConfigReachNote.js +107 -0
  15. package/dist/shared/components/ConformanceView.js +389 -319
  16. package/dist/shared/components/DataTable.js +612 -551
  17. package/dist/shared/components/DelegateCoverLine.js +164 -0
  18. package/dist/shared/components/EnvironmentNotice.js +56 -65
  19. package/dist/shared/components/FilePreviewLightbox.js +89 -43
  20. package/dist/shared/components/FindingFixedMark.js +23 -0
  21. package/dist/shared/components/GridPresenceLine.js +100 -0
  22. package/dist/shared/components/IdleReloadWatcher.js +82 -43
  23. package/dist/shared/components/InStep.js +46 -0
  24. package/dist/shared/components/ItemEditForm.js +5504 -4889
  25. package/dist/shared/components/LiveAnnouncer.js +62 -0
  26. package/dist/shared/components/LiveCount.js +54 -0
  27. package/dist/shared/components/LiveFigure.js +28 -0
  28. package/dist/shared/components/LiveListControls.js +114 -0
  29. package/dist/shared/components/LiveNewMatchesPill.js +25 -0
  30. package/dist/shared/components/LiveOffNote.js +44 -0
  31. package/dist/shared/components/LivePreferenceHost.js +42 -0
  32. package/dist/shared/components/LiveRowMark.js +25 -20
  33. package/dist/shared/components/LiveTraceView.js +257 -0
  34. package/dist/shared/components/MapView.js +30 -29
  35. package/dist/shared/components/MatrixEditor.js +497 -462
  36. package/dist/shared/components/MyWorkView.js +346 -272
  37. package/dist/shared/components/NotificationBell.js +215 -201
  38. package/dist/shared/components/OverflowRail.js +326 -0
  39. package/dist/shared/components/PageRenderer.js +636 -599
  40. package/dist/shared/components/PresenceDot.js +21 -0
  41. package/dist/shared/components/ProfileView.js +656 -536
  42. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  43. package/dist/shared/components/RecentRecordsRail.js +51 -48
  44. package/dist/shared/components/RecordCompare.js +241 -150
  45. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  46. package/dist/shared/components/RecordGridEditor.js +350 -311
  47. package/dist/shared/components/RecordHoverCard.js +147 -0
  48. package/dist/shared/components/RecordPeekHost.js +111 -0
  49. package/dist/shared/components/RecordReadView.js +414 -412
  50. package/dist/shared/components/RelativeTime.js +16 -0
  51. package/dist/shared/components/ReportView.js +1396 -1304
  52. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  53. package/dist/shared/components/TabCountHost.js +10 -0
  54. package/dist/shared/components/TickerNumber.js +19 -18
  55. package/dist/shared/components/TipLayer.js +70 -58
  56. package/dist/shared/components/WidgetImageMenu.js +59 -0
  57. package/dist/shared/components/WidgetSlot.js +571 -524
  58. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  59. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  60. package/dist/shared/components/cbv/approval-changed.js +20 -0
  61. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  62. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
  63. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  65. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  66. package/dist/shared/components/change-proposals/types.js +4 -0
  67. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  68. package/dist/shared/components/chat/Composer.js +276 -298
  69. package/dist/shared/components/chat/room-due.js +13 -0
  70. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  71. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  72. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  73. package/dist/shared/components/imports/ImportConsole.js +159 -155
  74. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  75. package/dist/shared/components/integrations/SendStatus.js +202 -0
  76. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  77. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  78. package/dist/shared/components/integrations/console/SignalCard.js +84 -77
  79. package/dist/shared/components/integrations/console/api.js +161 -117
  80. package/dist/shared/components/integrations/console/tone.js +15 -12
  81. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  82. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  83. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  84. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  85. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  86. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  87. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  88. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  89. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  90. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  91. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  92. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  93. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  94. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  95. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  96. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  97. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  98. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  99. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  100. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  101. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  102. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  103. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  104. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  105. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  106. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  107. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  108. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  109. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  110. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  111. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  112. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  113. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  114. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  115. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  116. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  117. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  118. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  119. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  120. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  121. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  122. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  123. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  124. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  125. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  126. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  127. package/dist/shared/components/item-edit/file-live.js +77 -0
  128. package/dist/shared/components/item-edit/file-processing.js +87 -0
  129. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  130. package/dist/shared/components/item-edit/live-related.js +23 -0
  131. package/dist/shared/components/item-edit/live-title.js +66 -0
  132. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  133. package/dist/shared/components/item-edit/removed-line.js +58 -0
  134. package/dist/shared/components/item-edit/render-stability.js +70 -59
  135. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  136. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  137. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  138. package/dist/shared/components/list/InlineEdit.js +504 -208
  139. package/dist/shared/components/list/ListViewers.js +81 -0
  140. package/dist/shared/components/list/PhonePager.js +50 -0
  141. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  142. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  143. package/dist/shared/components/merge/merge-values.js +110 -0
  144. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  145. package/dist/shared/components/notifications/NotificationCenterView.js +389 -323
  146. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  147. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  148. package/dist/shared/components/notifications/bundles.js +21 -19
  149. package/dist/shared/components/notifications/resolved-line.js +25 -0
  150. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  151. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  152. package/dist/shared/components/panels/AlertBanners.js +132 -0
  153. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  154. package/dist/shared/components/panels/BranchLanes.js +82 -54
  155. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  156. package/dist/shared/components/panels/CommentImages.js +219 -0
  157. package/dist/shared/components/panels/CommentPanel.js +649 -530
  158. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  159. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  160. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  161. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  162. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  163. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  164. package/dist/shared/components/panels/SlaClock.js +130 -99
  165. package/dist/shared/components/panels/TaskPanel.js +308 -287
  166. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  167. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  168. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  169. package/dist/shared/components/pipeline/PipelineEditorView.js +2050 -1942
  170. package/dist/shared/components/profile/AgentNameField.js +141 -0
  171. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  172. package/dist/shared/components/profile/PersonAccess.js +398 -330
  173. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  174. package/dist/shared/components/profile/PersonProfile.js +81 -73
  175. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  176. package/dist/shared/components/queue/OwnerAvatars.js +9 -9
  177. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  178. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  179. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  180. package/dist/shared/components/queue/QueueWorklist.js +2407 -1950
  181. package/dist/shared/components/queue/worklist-helpers.js +10 -6
  182. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  183. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  184. package/dist/shared/components/support/ReportProblem.js +1 -0
  185. package/dist/shared/components/support/ScreenShare.js +554 -0
  186. package/dist/shared/components/support/SupportView.js +160 -129
  187. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  188. package/dist/shared/components/ui/popover.js +53 -29
  189. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  190. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  191. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  192. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  193. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  194. package/dist/shared/lib/activity-sentence.js +87 -75
  195. package/dist/shared/lib/agent-presence.js +46 -0
  196. package/dist/shared/lib/approval-progress.js +49 -0
  197. package/dist/shared/lib/attention-prefs.js +27 -0
  198. package/dist/shared/lib/cell-locks.js +56 -0
  199. package/dist/shared/lib/co-edit.js +166 -0
  200. package/dist/shared/lib/coedit-registry.js +44 -0
  201. package/dist/shared/lib/comment-awareness.js +124 -0
  202. package/dist/shared/lib/comment-images.js +45 -0
  203. package/dist/shared/lib/config-watch.js +94 -0
  204. package/dist/shared/lib/copy-rules.js +65 -0
  205. package/dist/shared/lib/count-step.js +30 -0
  206. package/dist/shared/lib/deadline-ticker.js +68 -0
  207. package/dist/shared/lib/derived-causes.js +115 -0
  208. package/dist/shared/lib/draft-store.js +114 -85
  209. package/dist/shared/lib/error-hints.js +1 -0
  210. package/dist/shared/lib/field-merge.js +126 -0
  211. package/dist/shared/lib/filter-sentence.js +10 -10
  212. package/dist/shared/lib/focus-mode.js +16 -12
  213. package/dist/shared/lib/grid-cursors.js +77 -0
  214. package/dist/shared/lib/grid-presence.js +182 -0
  215. package/dist/shared/lib/idle-reload.js +100 -73
  216. package/dist/shared/lib/in-step.js +45 -0
  217. package/dist/shared/lib/integration-chip.js +19 -18
  218. package/dist/shared/lib/keep-row-focus.js +43 -0
  219. package/dist/shared/lib/line-locks.js +141 -0
  220. package/dist/shared/lib/line-split.js +41 -0
  221. package/dist/shared/lib/linked-changes.js +150 -0
  222. package/dist/shared/lib/list-return.js +231 -0
  223. package/dist/shared/lib/list-viewers.js +52 -0
  224. package/dist/shared/lib/live-announcer.js +86 -0
  225. package/dist/shared/lib/live-counts.js +85 -0
  226. package/dist/shared/lib/live-data-changed.js +108 -0
  227. package/dist/shared/lib/live-deltas.js +81 -0
  228. package/dist/shared/lib/live-findings.js +113 -0
  229. package/dist/shared/lib/live-groups.js +122 -0
  230. package/dist/shared/lib/live-link-labels.js +162 -0
  231. package/dist/shared/lib/live-list-flow.js +334 -0
  232. package/dist/shared/lib/live-list.js +143 -129
  233. package/dist/shared/lib/live-moves.js +51 -0
  234. package/dist/shared/lib/live-ops.js +26 -26
  235. package/dist/shared/lib/live-pickers.js +7 -0
  236. package/dist/shared/lib/live-preference.js +184 -0
  237. package/dist/shared/lib/live-queries.js +226 -181
  238. package/dist/shared/lib/live-screen.js +333 -0
  239. package/dist/shared/lib/live-search.js +108 -0
  240. package/dist/shared/lib/live-seen.js +35 -0
  241. package/dist/shared/lib/live-views.js +100 -0
  242. package/dist/shared/lib/live.js +159 -133
  243. package/dist/shared/lib/missed-updates.js +198 -0
  244. package/dist/shared/lib/newer-file.js +56 -0
  245. package/dist/shared/lib/notification-sound.js +42 -20
  246. package/dist/shared/lib/obligation-banner.js +17 -17
  247. package/dist/shared/lib/own-writes.js +59 -41
  248. package/dist/shared/lib/picker-badges.js +94 -0
  249. package/dist/shared/lib/presence-signals.js +131 -84
  250. package/dist/shared/lib/rail-menu-context.js +9 -0
  251. package/dist/shared/lib/realtime.js +49 -24
  252. package/dist/shared/lib/record-gaps.js +85 -0
  253. package/dist/shared/lib/record-outbox.js +369 -222
  254. package/dist/shared/lib/record-peek.js +75 -0
  255. package/dist/shared/lib/record-tabs.js +92 -72
  256. package/dist/shared/lib/relative-ticker.js +42 -0
  257. package/dist/shared/lib/request-gate.js +119 -119
  258. package/dist/shared/lib/rollup-recalc.js +107 -0
  259. package/dist/shared/lib/room-gaps.js +40 -36
  260. package/dist/shared/lib/row-surface.js +7 -0
  261. package/dist/shared/lib/rum.js +137 -87
  262. package/dist/shared/lib/save-progress.js +20 -0
  263. package/dist/shared/lib/scheduled-countdown.js +67 -0
  264. package/dist/shared/lib/screen-refresh.js +160 -0
  265. package/dist/shared/lib/screen-share.js +234 -0
  266. package/dist/shared/lib/seen-since.js +74 -0
  267. package/dist/shared/lib/selection-watch.js +205 -0
  268. package/dist/shared/lib/send-status.js +132 -0
  269. package/dist/shared/lib/send-view.js +23 -0
  270. package/dist/shared/lib/socket-liveness.js +155 -0
  271. package/dist/shared/lib/socket-realtime.js +168 -140
  272. package/dist/shared/lib/state-census.js +53 -0
  273. package/dist/shared/lib/summary-mode.js +61 -39
  274. package/dist/shared/lib/tab-attention.js +143 -32
  275. package/dist/shared/lib/table-density.js +64 -0
  276. package/dist/shared/lib/table-pins.js +20 -18
  277. package/dist/shared/lib/track-travel.js +40 -0
  278. package/dist/shared/lib/unseen-changes.js +68 -0
  279. package/dist/shared/lib/upload-file.js +62 -0
  280. package/dist/shared/lib/upload-presence.js +127 -0
  281. package/dist/shared/lib/urgent-chime.js +65 -0
  282. package/dist/shared/lib/use-below-md.js +29 -0
  283. package/dist/shared/lib/use-online-users.js +32 -11
  284. package/dist/shared/lib/user-sync.js +155 -39
  285. package/dist/shared/lib/waiting-count.js +44 -0
  286. package/dist/shared/lib/watch-desktop.js +83 -0
  287. package/dist/shared/lib/watch-list.js +447 -0
  288. package/dist/shared/lib/widget-image-render.js +64 -0
  289. package/dist/shared/lib/widget-image.js +111 -0
  290. package/dist/shared/lib/worker-socket.js +130 -104
  291. package/dist/shared/lib/write-to-screen.js +133 -0
  292. package/package.json +1 -1
  293. package/styles.css +49 -1
@@ -1,67 +1,68 @@
1
- import { jsxs as a, jsx as t, Fragment as ce } from "react/jsx-runtime";
2
- import { useQueryClient as me, useQuery as k, useMutation as $ } from "@tanstack/react-query";
3
- import { useState as u, useMemo as Y, useEffect as Ae } from "react";
4
- import { createPortal as Te } from "react-dom";
5
- import { useNivaroClient as I } from "../context.js";
6
- import { get as v, post as j, patch as Le, del as je } from "../lib/commands.js";
7
- import { useLiveOps as Fe } from "../lib/live-ops.js";
8
- import { useLiveRefetchInterval as Ke } from "../lib/live-queries.js";
9
- import { cn as y } from "../lib/utils.js";
10
- import { audienceConfirmFromError as Pe, AudienceConfirmPanel as Ee } from "./AudienceConfirmPanel.js";
11
- import { BroadcastDraftPanel as De } from "./BroadcastDraft.js";
12
- import { useHelpVideoLibrary as Oe } from "./help-videos/api.js";
13
- import { formatDuration as Ie } from "./help-videos/viewer/format.js";
14
- import { PickList as Qe } from "./imports/ServiceConfigBuilder.js";
15
- const ue = {
1
+ import { jsxs as a, jsx as t, Fragment as Q } from "react/jsx-runtime";
2
+ import { useQueryClient as pe, useQuery as k, useMutation as $ } from "@tanstack/react-query";
3
+ import { useState as u, useMemo as J, useEffect as Fe } from "react";
4
+ import { createPortal as je } from "react-dom";
5
+ import { useNivaroClient as R } from "../context.js";
6
+ import { get as v, post as j, patch as Ke, del as Le } from "../lib/commands.js";
7
+ import { useLiveOps as Pe } from "../lib/live-ops.js";
8
+ import { useLiveRefetchInterval as Ee } from "../lib/live-queries.js";
9
+ import { cn as y, formatDateTime as I } from "../lib/utils.js";
10
+ import { audienceConfirmFromError as Oe, AudienceConfirmPanel as De } from "./AudienceConfirmPanel.js";
11
+ import { BroadcastDraftPanel as Ie } from "./BroadcastDraft.js";
12
+ import { useHelpVideoLibrary as Qe } from "./help-videos/api.js";
13
+ import { formatDuration as Re } from "./help-videos/viewer/format.js";
14
+ import { PickList as Me } from "./imports/ServiceConfigBuilder.js";
15
+ import { LiveFigure as ue } from "./LiveFigure.js";
16
+ const xe = {
16
17
  info: "bg-sky-500",
17
18
  warn: "bg-amber-500",
18
19
  critical: "bg-red-500"
19
20
  };
20
- function st({ className: r }) {
21
- var ie;
22
- const i = I(), c = me(), [b, h] = u(""), [s, p] = u(""), [o, n] = u("info"), [m, x] = u(!1), [d, N] = u(!1), [g, xe] = u(!0), [Q, he] = u(!1), [_, be] = u("banner"), [R, ge] = u(!1), [Z, fe] = u(""), [M, H] = u(""), [J, ye] = u(""), [F, V] = u([]), [A, ke] = u([]), [W, q] = u(null), [T, X] = u(""), [ee, te] = u(""), L = Oe({ status: "published" }), ae = () => {
21
+ function ot({ className: r }) {
22
+ var me;
23
+ const i = R(), c = pe(), [b, h] = u(""), [s, p] = u(""), [o, n] = u("info"), [m, x] = u(!1), [d, N] = u(!1), [g, be] = u(!0), [M, ge] = u(!1), [S, fe] = u("banner"), [H, ye] = u(!1), [W, ke] = u(""), [V, U] = u(""), [X, ve] = u(""), [K, B] = u([]), [A, Ne] = u([]), [ee, q] = u(null), [T, te] = u(""), [ae, re] = u(""), F = Qe({ status: "published" }), ne = () => {
23
24
  if (!T) return {};
24
- const e = Number(ee);
25
+ const e = Number(ae);
25
26
  return {
26
27
  help_video_id: T,
27
28
  help_video_t_ms: Number.isFinite(e) && e > 0 ? Math.round(e * 1e3) : null
28
29
  };
29
- }, { data: U } = k({
30
+ }, { data: G } = k({
30
31
  queryKey: ["broadcast-config"],
31
32
  queryFn: () => i.request(v("/announcements/config")).then((e) => e.data).catch(() => ({ sms_enabled: !1 })),
32
33
  staleTime: 5 * 6e4
33
- }), { data: ve = [] } = k({
34
+ }), { data: we = [] } = k({
34
35
  queryKey: ["broadcast-dimensions"],
35
36
  queryFn: () => i.request(v("/scope-dimensions")).then((e) => e.data ?? []).catch(() => []),
36
37
  staleTime: 5 * 6e4
37
- }), { data: Ne = [] } = k({
38
+ }), { data: _e = [] } = k({
38
39
  queryKey: ["broadcast-roles"],
39
40
  queryFn: () => i.request(v("/chat/roles")).then((e) => e.data ?? []).catch(() => []),
40
41
  staleTime: 5 * 6e4
41
- }), { data: re = [] } = k({
42
+ }), { data: se = [] } = k({
42
43
  queryKey: ["broadcasts"],
43
44
  queryFn: () => i.request(v("/announcements")).then((e) => e.data ?? [])
44
45
  });
45
- Fe("broadcasts", () => {
46
+ Pe("broadcasts", () => {
46
47
  c.invalidateQueries({ queryKey: ["broadcasts"] }), c.invalidateQueries({ queryKey: ["broadcast-receipt-summary"] }), c.invalidateQueries({ queryKey: ["broadcast-receipts"] });
47
48
  });
48
- const w = Y(() => {
49
+ const w = J(() => {
49
50
  const e = [];
50
- return g && e.push(_), m && e.push("email"), d && e.push("sms"), Q && e.push("login"), e;
51
- }, [g, _, m, d, Q]), K = Y(
52
- () => F.map((e) => {
51
+ return g && e.push(S), m && e.push("email"), d && e.push("sms"), M && e.push("login"), e;
52
+ }, [g, S, m, d, M]), L = J(
53
+ () => K.map((e) => {
53
54
  const l = {};
54
- for (const [f, S] of Object.entries(e)) f && S.length > 0 && (l[f] = S);
55
+ for (const [f, _] of Object.entries(e)) f && _.length > 0 && (l[f] = _);
55
56
  return l;
56
57
  }).filter((e) => Object.keys(e).length > 0),
57
- [F]
58
- ), P = Y(
58
+ [K]
59
+ ), P = J(
59
60
  () => ({
60
- ...K.length > 0 ? { groups: K } : {},
61
+ ...L.length > 0 ? { groups: L } : {},
61
62
  ...A.length > 0 ? { roles: A } : {}
62
63
  }),
63
- [K, A]
64
- ), [ne, E] = u(null), C = $({
64
+ [L, A]
65
+ ), [de, E] = u(null), C = $({
65
66
  mutationFn: (e) => i.request(
66
67
  j("/announcements", {
67
68
  ...e != null && e.confirm ? { confirm_audience: !0 } : {},
@@ -69,12 +70,12 @@ function st({ className: r }) {
69
70
  message: s.trim(),
70
71
  severity: o,
71
72
  channels: w,
72
- starts_at: Z || void 0,
73
- scheduled_send_at: M || void 0,
74
- ends_at: J || void 0,
75
- require_ack: g && _ === "banner" ? R : !1,
73
+ starts_at: W || void 0,
74
+ scheduled_send_at: V || void 0,
75
+ ends_at: X || void 0,
76
+ require_ack: g && S === "banner" ? H : !1,
76
77
  audience: P,
77
- ...ae()
78
+ ...ne()
78
79
  })
79
80
  ),
80
81
  onSuccess: (e) => {
@@ -82,21 +83,21 @@ function st({ className: r }) {
82
83
  const l = e.data.scheduled_for;
83
84
  q(
84
85
  l ? `Scheduled — delivers ${new Date(l).toLocaleString()}. Cancel from the history below.` : w.some((f) => f !== "banner") ? `Sent — reached ${e.data.delivered} recipient(s).` : "Banner published."
85
- ), p(""), h(""), H(""), X(""), te(""), c.invalidateQueries({ queryKey: ["broadcasts"] }), c.invalidateQueries({ queryKey: ["announcements-active"] });
86
+ ), p(""), h(""), U(""), te(""), re(""), c.invalidateQueries({ queryKey: ["broadcasts"] }), c.invalidateQueries({ queryKey: ["announcements-active"] });
86
87
  },
87
88
  onError: (e) => {
88
- const l = Pe(e);
89
+ const l = Oe(e);
89
90
  if (l) {
90
91
  E(l);
91
92
  return;
92
93
  }
93
94
  q(e.message);
94
95
  }
95
- }), D = s.trim().length > 0 && w.length > 0 && !C.isPending, { data: se = [] } = k({
96
+ }), O = s.trim().length > 0 && w.length > 0 && !C.isPending, { data: le = [] } = k({
96
97
  queryKey: ["broadcast-templates"],
97
98
  queryFn: () => i.request(v("/announcements/templates")).then((e) => e.data ?? []).catch(() => []),
98
99
  staleTime: 6e4
99
- }), de = $({
100
+ }), oe = $({
100
101
  mutationFn: (e) => i.request(
101
102
  j("/announcements/templates", {
102
103
  name: e,
@@ -105,35 +106,35 @@ function st({ className: r }) {
105
106
  message: s,
106
107
  severity: o,
107
108
  channels: w,
108
- require_ack: R,
109
+ require_ack: H,
109
110
  audience: P
110
111
  }
111
112
  })
112
113
  ),
113
114
  onSuccess: () => void c.invalidateQueries({ queryKey: ["broadcast-templates"] })
114
- }), we = (e) => {
115
+ }), Se = (e) => {
115
116
  const l = e.snapshot ?? {};
116
117
  typeof l.subject == "string" && h(l.subject), typeof l.message == "string" && p(l.message);
117
- }, [B, le] = u(""), [Se, oe] = u(!1), G = $({
118
+ }, [z, ie] = u(""), [qe, ce] = u(!1), Y = $({
118
119
  mutationFn: () => i.request(
119
120
  j("/announcements/test-send", {
120
121
  subject: b.trim() || void 0,
121
122
  message: s.trim(),
122
123
  channels: w.filter((e) => e !== "banner"),
123
- ...ae()
124
+ ...ne()
124
125
  })
125
126
  ),
126
127
  onSuccess: (e) => q(
127
128
  `Test sent to you — ${Object.entries(e.data ?? {}).map(([l, f]) => `${l}: ${f}`).join(", ")}`
128
129
  ),
129
130
  onError: (e) => q(e.message)
130
- }), O = (/* @__PURE__ */ new Date()).getHours(), _e = !M && (O >= 21 || O < 7), qe = $({
131
- mutationFn: ({ id: e, body: l }) => i.request(Le(`/announcements/${e}`, l)),
131
+ }), D = (/* @__PURE__ */ new Date()).getHours(), Ce = !V && (D >= 21 || D < 7), $e = $({
132
+ mutationFn: ({ id: e, body: l }) => i.request(Ke(`/announcements/${e}`, l)),
132
133
  onSuccess: () => {
133
134
  c.invalidateQueries({ queryKey: ["broadcasts"] }), c.invalidateQueries({ queryKey: ["announcements-active"] });
134
135
  }
135
- }), Ce = $({
136
- mutationFn: (e) => i.request(je(`/announcements/${e}`)),
136
+ }), Ae = $({
137
+ mutationFn: (e) => i.request(Le(`/announcements/${e}`)),
137
138
  onSuccess: () => {
138
139
  c.invalidateQueries({ queryKey: ["broadcasts"] }), c.invalidateQueries({ queryKey: ["announcements-active"] });
139
140
  }
@@ -143,14 +144,14 @@ function st({ className: r }) {
143
144
  /* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: "Audience" }),
144
145
  /* @__PURE__ */ t("p", { className: "mt-0.5 text-[11.5px] text-slate-400", children: "No selection = everyone. Zone/role targeting narrows both send channels and who sees a banner." }),
145
146
  /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: [
146
- F.map((e, l) => /* @__PURE__ */ t(
147
- Me,
147
+ K.map((e, l) => /* @__PURE__ */ t(
148
+ Ve,
148
149
  {
149
150
  index: l,
150
151
  group: e,
151
- dimensions: ve,
152
- onChange: (f) => V((S) => S.map((z, $e) => $e === l ? f : z)),
153
- onRemove: () => V((f) => f.filter((S, z) => z !== l))
152
+ dimensions: we,
153
+ onChange: (f) => B((_) => _.map((Z, Te) => Te === l ? f : Z)),
154
+ onRemove: () => B((f) => f.filter((_, Z) => Z !== l))
154
155
  },
155
156
  l
156
157
  )),
@@ -158,25 +159,25 @@ function st({ className: r }) {
158
159
  "button",
159
160
  {
160
161
  type: "button",
161
- onClick: () => V((e) => [...e, {}]),
162
+ onClick: () => B((e) => [...e, {}]),
162
163
  className: "rounded-md border border-dashed border-slate-300 px-3 py-1.5 text-[11.5px] text-slate-500 hover:border-slate-400 hover:text-slate-700 dark:border-border dark:text-muted-foreground",
163
164
  children: [
164
165
  "+",
165
166
  " ",
166
- F.length === 0 ? "Target by scope (e.g. Zone 2 + Node Splits)" : "Add another group (OR)"
167
+ K.length === 0 ? "Target by scope (e.g. Zone 2 + Node Splits)" : "Add another group (OR)"
167
168
  ]
168
169
  }
169
170
  )
170
171
  ] }),
171
172
  /* @__PURE__ */ a("div", { className: "mt-3", children: [
172
173
  /* @__PURE__ */ t("p", { className: "mb-1 text-[11.5px] font-medium text-slate-700 dark:text-foreground", children: "Limit to roles" }),
173
- /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1.5", children: Ne.map((e) => {
174
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1.5", children: _e.map((e) => {
174
175
  const l = A.includes(e.id);
175
176
  return /* @__PURE__ */ t(
176
177
  "button",
177
178
  {
178
179
  type: "button",
179
- onClick: () => ke((f) => l ? f.filter((S) => S !== e.id) : [...f, e.id]),
180
+ onClick: () => Ne((f) => l ? f.filter((_) => _ !== e.id) : [...f, e.id]),
180
181
  className: y(
181
182
  "rounded-full border px-2.5 py-0.5 text-[11.5px] transition-colors",
182
183
  l ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "border-slate-200 text-slate-500 hover:text-slate-700 dark:border-border dark:text-muted-foreground"
@@ -188,10 +189,10 @@ function st({ className: r }) {
188
189
  }) })
189
190
  ] }),
190
191
  /* @__PURE__ */ t("div", { className: "mt-3 border-t border-slate-100 pt-2.5 dark:border-border", children: /* @__PURE__ */ t(
191
- pe,
192
+ he,
192
193
  {
193
194
  audience: P,
194
- everyone: K.length === 0 && A.length === 0,
195
+ everyone: L.length === 0 && A.length === 0,
195
196
  label: "Sending to"
196
197
  }
197
198
  ) })
@@ -199,7 +200,7 @@ function st({ className: r }) {
199
200
  /* @__PURE__ */ a("div", { className: "max-w-[760px] rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
200
201
  /* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: "Message" }),
201
202
  /* @__PURE__ */ t(
202
- De,
203
+ Ie,
203
204
  {
204
205
  audience: P,
205
206
  channels: w,
@@ -255,15 +256,15 @@ function st({ className: r }) {
255
256
  "select",
256
257
  {
257
258
  value: T,
258
- onChange: (e) => X(e.target.value),
259
+ onChange: (e) => te(e.target.value),
259
260
  className: "h-7 max-w-[320px] rounded-md border border-slate-200 bg-background px-1.5 text-[12px] text-slate-800 dark:border-border dark:text-foreground",
260
261
  "aria-label": "Attach a video",
261
262
  "data-broadcast-video-id": !0,
262
263
  children: [
263
264
  /* @__PURE__ */ t("option", { value: "", children: "None" }),
264
- (((ie = L.data) == null ? void 0 : ie.data) ?? []).map((e) => /* @__PURE__ */ a("option", { value: e.id, children: [
265
+ (((me = F.data) == null ? void 0 : me.data) ?? []).map((e) => /* @__PURE__ */ a("option", { value: e.id, children: [
265
266
  e.title || "Untitled video",
266
- e.duration_ms != null ? ` (${Ie(e.duration_ms)})` : ""
267
+ e.duration_ms != null ? ` (${Re(e.duration_ms)})` : ""
267
268
  ] }, e.id))
268
269
  ]
269
270
  }
@@ -277,8 +278,8 @@ function st({ className: r }) {
277
278
  type: "number",
278
279
  min: 0,
279
280
  step: 1,
280
- value: ee,
281
- onChange: (e) => te(e.target.value),
281
+ value: ae,
282
+ onChange: (e) => re(e.target.value),
282
283
  placeholder: "0",
283
284
  className: "h-7 w-20 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border",
284
285
  "aria-label": "Start at (seconds)",
@@ -287,14 +288,14 @@ function st({ className: r }) {
287
288
  ),
288
289
  "seconds"
289
290
  ] }),
290
- L.hasNextPage && /* @__PURE__ */ t(
291
+ F.hasNextPage && /* @__PURE__ */ t(
291
292
  "button",
292
293
  {
293
294
  type: "button",
294
- onClick: () => void L.fetchNextPage(),
295
- disabled: L.isFetchingNextPage,
295
+ onClick: () => void F.fetchNextPage(),
296
+ disabled: F.isFetchingNextPage,
296
297
  className: "rounded border border-slate-200 px-1.5 py-0.5 text-[11px] hover:bg-slate-50 dark:border-border dark:hover:bg-muted",
297
- children: L.isFetchingNextPage ? "Loading…" : "More videos"
298
+ children: F.isFetchingNextPage ? "Loading…" : "More videos"
298
299
  }
299
300
  ),
300
301
  T && /* @__PURE__ */ t("span", { className: "text-slate-400 dark:text-slate-500", children: "Shown as a card with a link to that moment — only to people who can watch the video." })
@@ -308,7 +309,7 @@ function st({ className: r }) {
308
309
  {
309
310
  type: "checkbox",
310
311
  checked: g,
311
- onChange: (e) => xe(e.target.checked),
312
+ onChange: (e) => be(e.target.checked),
312
313
  className: "h-3.5 w-3.5"
313
314
  }
314
315
  ),
@@ -321,10 +322,10 @@ function st({ className: r }) {
321
322
  "button",
322
323
  {
323
324
  type: "button",
324
- onClick: () => be(e.value),
325
+ onClick: () => fe(e.value),
325
326
  className: y(
326
327
  "rounded px-2 py-0.5 text-[11px] font-medium transition-colors",
327
- _ === e.value ? "bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "text-slate-400 hover:text-slate-600"
328
+ S === e.value ? "bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "text-slate-400 hover:text-slate-600"
328
329
  ),
329
330
  children: e.label
330
331
  },
@@ -352,8 +353,8 @@ function st({ className: r }) {
352
353
  "input",
353
354
  {
354
355
  type: "checkbox",
355
- checked: Q,
356
- onChange: (e) => he(e.target.checked),
356
+ checked: M,
357
+ onChange: (e) => ge(e.target.checked),
357
358
  className: "h-3.5 w-3.5"
358
359
  }
359
360
  ),
@@ -361,7 +362,7 @@ function st({ className: r }) {
361
362
  ]
362
363
  }
363
364
  ),
364
- (U == null ? void 0 : U.sms_enabled) && /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
365
+ (G == null ? void 0 : G.sms_enabled) && /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
365
366
  /* @__PURE__ */ t(
366
367
  "input",
367
368
  {
@@ -373,14 +374,14 @@ function st({ className: r }) {
373
374
  ),
374
375
  "Text (SMS)"
375
376
  ] }),
376
- g && _ === "banner" && /* @__PURE__ */ a(ce, { children: [
377
+ g && S === "banner" && /* @__PURE__ */ a(Q, { children: [
377
378
  /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5 text-[12px] text-slate-600 dark:text-slate-300", children: [
378
379
  /* @__PURE__ */ t(
379
380
  "input",
380
381
  {
381
382
  type: "checkbox",
382
- checked: R,
383
- onChange: (e) => ge(e.target.checked),
383
+ checked: H,
384
+ onChange: (e) => ye(e.target.checked),
384
385
  className: "h-3.5 w-3.5"
385
386
  }
386
387
  ),
@@ -396,7 +397,7 @@ function st({ className: r }) {
396
397
  o === e ? "bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "text-slate-400 hover:text-slate-600"
397
398
  ),
398
399
  children: [
399
- /* @__PURE__ */ t("span", { className: y("h-1.5 w-1.5 rounded-full", ue[e]) }),
400
+ /* @__PURE__ */ t("span", { className: y("h-1.5 w-1.5 rounded-full", xe[e]) }),
400
401
  e
401
402
  ]
402
403
  },
@@ -408,8 +409,8 @@ function st({ className: r }) {
408
409
  "input",
409
410
  {
410
411
  type: "datetime-local",
411
- value: Z,
412
- onChange: (e) => fe(e.target.value),
412
+ value: W,
413
+ onChange: (e) => ke(e.target.value),
413
414
  className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
414
415
  }
415
416
  )
@@ -420,15 +421,15 @@ function st({ className: r }) {
420
421
  "input",
421
422
  {
422
423
  type: "datetime-local",
423
- value: J,
424
- onChange: (e) => ye(e.target.value),
424
+ value: X,
425
+ onChange: (e) => ve(e.target.value),
425
426
  className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
426
427
  }
427
428
  )
428
429
  ] })
429
430
  ] })
430
431
  ] }),
431
- g && _ === "banner" && /* @__PURE__ */ t("p", { className: "mt-1.5 text-[11px] text-slate-400", children: "Starts/Ends control only the banner's visibility window: it appears at Starts (empty = right away) and auto-expires at Ends for everyone who hasn't dismissed it (empty = stays up until each person dismisses it, or you turn it Off in history). Email, text, and inbox messages always send once, immediately — the window doesn't delay them." }),
432
+ g && S === "banner" && /* @__PURE__ */ t("p", { className: "mt-1.5 text-[11px] text-slate-400", children: "Starts/Ends control only the banner's visibility window: it appears at Starts (empty = right away) and auto-expires at Ends for everyone who hasn't dismissed it (empty = stays up until each person dismisses it, or you turn it Off in history). Email, text, and inbox messages always send once, immediately — the window doesn't delay them." }),
432
433
  /* @__PURE__ */ a("div", { className: "mt-4 flex flex-wrap items-center gap-3", children: [
433
434
  /* @__PURE__ */ a("label", { className: "flex items-center gap-1.5 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
434
435
  "Send later",
@@ -436,8 +437,8 @@ function st({ className: r }) {
436
437
  "input",
437
438
  {
438
439
  type: "datetime-local",
439
- value: M,
440
- onChange: (e) => H(e.target.value),
440
+ value: V,
441
+ onChange: (e) => U(e.target.value),
441
442
  title: "Leave empty to send immediately. With a time set, every channel (banner included) waits until then.",
442
443
  className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
443
444
  }
@@ -447,20 +448,20 @@ function st({ className: r }) {
447
448
  "button",
448
449
  {
449
450
  type: "button",
450
- disabled: !D || G.isPending,
451
+ disabled: !O || Y.isPending,
451
452
  onClick: () => {
452
- q(null), G.mutate();
453
+ q(null), Y.mutate();
453
454
  },
454
455
  "data-tip": "Send this compose to YOURSELF over the picked channels first (#429)",
455
456
  className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] font-medium text-slate-600 hover:bg-muted disabled:opacity-50 dark:border-border dark:text-slate-300",
456
- children: G.isPending ? "Testing…" : "Test on me"
457
+ children: Y.isPending ? "Testing…" : "Test on me"
457
458
  }
458
459
  ),
459
460
  /* @__PURE__ */ t(
460
461
  "button",
461
462
  {
462
463
  type: "button",
463
- disabled: !D,
464
+ disabled: !O,
464
465
  onClick: () => {
465
466
  q(null), E(null), C.mutate(void 0);
466
467
  },
@@ -468,12 +469,12 @@ function st({ className: r }) {
468
469
  children: C.isPending ? "Sending…" : "Send"
469
470
  }
470
471
  ),
471
- Se ? /* @__PURE__ */ a("span", { className: "flex items-center gap-1", children: [
472
+ qe ? /* @__PURE__ */ a("span", { className: "flex items-center gap-1", children: [
472
473
  /* @__PURE__ */ t(
473
474
  "input",
474
475
  {
475
- value: B,
476
- onChange: (e) => le(e.target.value),
476
+ value: z,
477
+ onChange: (e) => ie(e.target.value),
477
478
  placeholder: "Template name…",
478
479
  className: "h-7 w-40 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
479
480
  }
@@ -482,9 +483,9 @@ function st({ className: r }) {
482
483
  "button",
483
484
  {
484
485
  type: "button",
485
- disabled: !B.trim() || de.isPending,
486
+ disabled: !z.trim() || oe.isPending,
486
487
  onClick: () => {
487
- de.mutate(B.trim()), oe(!1), le("");
488
+ oe.mutate(z.trim()), ce(!1), ie("");
488
489
  },
489
490
  className: "h-7 rounded-md border border-slate-200 px-2 text-[11.5px] hover:bg-muted dark:border-border",
490
491
  children: "Save"
@@ -495,29 +496,29 @@ function st({ className: r }) {
495
496
  {
496
497
  type: "button",
497
498
  disabled: !s.trim(),
498
- onClick: () => oe(!0),
499
+ onClick: () => ce(!0),
499
500
  "data-tip": "Save this compose (audience + channels + text) as a reusable template (#104)",
500
501
  className: "h-8 rounded-md border border-dashed border-slate-300 px-2.5 text-[11.5px] text-slate-500 hover:text-slate-700 disabled:opacity-40 dark:border-border",
501
502
  children: "☆ Save template"
502
503
  }
503
504
  ),
504
- !D && !C.isPending && /* @__PURE__ */ t("span", { className: "text-[11.5px] text-slate-400", children: "A message and at least one channel are required." }),
505
- W && /* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-emerald-600 dark:text-emerald-400", children: W })
505
+ !O && !C.isPending && /* @__PURE__ */ t("span", { className: "text-[11.5px] text-slate-400", children: "A message and at least one channel are required." }),
506
+ ee && /* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-emerald-600 dark:text-emerald-400", children: ee })
506
507
  ] }),
507
- ne && /* @__PURE__ */ t(
508
- Ee,
508
+ de && /* @__PURE__ */ t(
509
+ De,
509
510
  {
510
511
  className: "mt-3",
511
- preview: ne,
512
+ preview: de,
512
513
  busy: C.isPending,
513
514
  confirmLabel: "Confirm and send",
514
515
  onConfirm: () => C.mutate({ confirm: !0 }),
515
516
  onCancel: () => E(null)
516
517
  }
517
518
  ),
518
- _e && D && /* @__PURE__ */ a("p", { className: "mt-2 rounded-md bg-amber-50 px-3 py-1.5 text-[12px] text-amber-700 dark:bg-amber-400/10 dark:text-amber-400", children: [
519
+ Ce && O && /* @__PURE__ */ a("p", { className: "mt-2 rounded-md bg-amber-50 px-3 py-1.5 text-[12px] text-amber-700 dark:bg-amber-400/10 dark:text-amber-400", children: [
519
520
  "It's ",
520
- O >= 21 ? "late" : "early",
521
+ D >= 21 ? "late" : "early",
521
522
  " for most recipients — consider the schedule field so this lands in the morning instead of overnight.",
522
523
  " ",
523
524
  /* @__PURE__ */ t(
@@ -527,9 +528,9 @@ function st({ className: r }) {
527
528
  className: "font-medium underline underline-offset-2",
528
529
  onClick: () => {
529
530
  const e = /* @__PURE__ */ new Date();
530
- O >= 21 && e.setDate(e.getDate() + 1), e.setHours(8, 0, 0, 0);
531
+ D >= 21 && e.setDate(e.getDate() + 1), e.setHours(8, 0, 0, 0);
531
532
  const l = (f) => String(f).padStart(2, "0");
532
- H(
533
+ U(
533
534
  `${e.getFullYear()}-${l(e.getMonth() + 1)}-${l(e.getDate())}T${l(e.getHours())}:${l(e.getMinutes())}`
534
535
  );
535
536
  },
@@ -537,9 +538,9 @@ function st({ className: r }) {
537
538
  }
538
539
  )
539
540
  ] }),
540
- se.length > 0 && /* @__PURE__ */ a("div", { className: "mt-2 flex flex-wrap items-center gap-1.5", children: [
541
+ le.length > 0 && /* @__PURE__ */ a("div", { className: "mt-2 flex flex-wrap items-center gap-1.5", children: [
541
542
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "Templates:" }),
542
- se.map((e) => /* @__PURE__ */ t(
543
+ le.map((e) => /* @__PURE__ */ t(
543
544
  "span",
544
545
  {
545
546
  className: "inline-flex items-center overflow-hidden rounded-full border border-slate-200 dark:border-border",
@@ -547,7 +548,7 @@ function st({ className: r }) {
547
548
  "button",
548
549
  {
549
550
  type: "button",
550
- onClick: () => we(e),
551
+ onClick: () => Se(e),
551
552
  className: "px-2 py-0.5 text-[11.5px] text-slate-600 hover:bg-muted dark:text-slate-300",
552
553
  children: e.name
553
554
  }
@@ -559,25 +560,25 @@ function st({ className: r }) {
559
560
  ] }),
560
561
  /* @__PURE__ */ a("div", { className: "max-w-[760px] space-y-2", children: [
561
562
  /* @__PURE__ */ t("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "History" }),
562
- re.length === 0 && /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "Nothing sent yet." }),
563
- re.map((e) => /* @__PURE__ */ t(
564
- Re,
563
+ se.length === 0 && /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "Nothing sent yet." }),
564
+ se.map((e) => /* @__PURE__ */ t(
565
+ He,
565
566
  {
566
567
  broadcast: e,
567
- onPatch: qe.mutate,
568
- onRemove: Ce.mutate
568
+ onPatch: $e.mutate,
569
+ onRemove: Ae.mutate
569
570
  },
570
571
  e.id
571
572
  ))
572
573
  ] })
573
574
  ] });
574
575
  }
575
- function Re({
576
+ function He({
576
577
  broadcast: r,
577
578
  onPatch: i,
578
579
  onRemove: c
579
580
  }) {
580
- const b = I(), h = me(), [s, p] = u(!1), { data: o } = k({
581
+ const b = R(), h = pe(), [s, p] = u(!1), { data: o } = k({
581
582
  queryKey: ["broadcast-receipt-summary", r.id],
582
583
  queryFn: () => b.request(v(`/announcements/${r.id}/receipts/summary`)).then((d) => d.data),
583
584
  enabled: s,
@@ -589,7 +590,7 @@ function Re({
589
590
  onSuccess: () => {
590
591
  h.invalidateQueries({ queryKey: ["broadcast-receipt-summary", r.id] }), h.invalidateQueries({ queryKey: ["broadcast-receipts", r.id] });
591
592
  }
592
- }), m = Ke(4e3), { data: x } = k({
593
+ }), m = Ee(4e3), { data: x } = k({
593
594
  queryKey: ["broadcast-receipts", r.id],
594
595
  queryFn: () => b.request(v(`/announcements/${r.id}/receipts`)).then((d) => d.data),
595
596
  enabled: s,
@@ -600,7 +601,7 @@ function Re({
600
601
  });
601
602
  return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
602
603
  /* @__PURE__ */ a("div", { className: "flex items-start gap-3 px-4 py-3", children: [
603
- /* @__PURE__ */ t("span", { className: y("mt-1.5 h-2 w-2 shrink-0 rounded-full", ue[r.severity]) }),
604
+ /* @__PURE__ */ t("span", { className: y("mt-1.5 h-2 w-2 shrink-0 rounded-full", xe[r.severity]) }),
604
605
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
605
606
  r.subject && /* @__PURE__ */ t("p", { className: "text-[12.5px] font-medium text-slate-800 dark:text-foreground", children: r.subject }),
606
607
  /* @__PURE__ */ t("p", { className: "text-[12.5px] text-slate-600 dark:text-muted-foreground", children: r.message }),
@@ -611,7 +612,7 @@ function Re({
611
612
  r.scheduled_send_at && !r.sent_at && /* @__PURE__ */ a("p", { className: "mt-1 flex items-center gap-2 text-[11.5px]", children: [
612
613
  /* @__PURE__ */ a("span", { className: "rounded-full bg-amber-100 px-2 py-0.5 font-semibold text-amber-700 dark:bg-amber-500/15 dark:text-amber-400", children: [
613
614
  "Scheduled · ",
614
- new Date(r.scheduled_send_at).toLocaleString()
615
+ I(r.scheduled_send_at)
615
616
  ] }),
616
617
  /* @__PURE__ */ t(
617
618
  "button",
@@ -623,11 +624,18 @@ function Re({
623
624
  }
624
625
  )
625
626
  ] }),
626
- /* @__PURE__ */ a("p", { className: "mt-0.5 text-[11px] text-slate-400", children: [
627
+ /* @__PURE__ */ a("p", { className: "mt-0.5 text-[11px] text-slate-500 dark:text-slate-400", children: [
627
628
  (r.channels ?? []).join(" + "),
628
629
  r.delivered_count != null && ` · reached ${r.delivered_count}`,
629
- ` · seen by ${r.ack_count}`,
630
- r.created_at && ` · ${new Date(r.created_at).toLocaleString()}`,
630
+ r.opened_count != null && (r.channels ?? []).includes("message") && /* @__PURE__ */ a(Q, { children: [
631
+ " · inbox opened ",
632
+ /* @__PURE__ */ t(ue, { value: r.opened_count, className: "font-medium", children: r.opened_count })
633
+ ] }),
634
+ (r.channels ?? []).includes("banner") && /* @__PURE__ */ a(Q, { children: [
635
+ " · banner dismissed ",
636
+ /* @__PURE__ */ t(ue, { value: r.ack_count, className: "font-medium", children: r.ack_count })
637
+ ] }),
638
+ r.created_at && ` · ${I(r.created_at)}`,
631
639
  " · ",
632
640
  /* @__PURE__ */ a(
633
641
  "button",
@@ -664,7 +672,7 @@ function Re({
664
672
  {
665
673
  type: "button",
666
674
  onClick: () => c(r.id),
667
- className: "shrink-0 text-[13px] text-slate-300 transition-colors hover:text-red-500",
675
+ className: "shrink-0 text-[13px] text-slate-500 transition-colors hover:text-red-500 dark:text-muted-foreground",
668
676
  children: "✕"
669
677
  }
670
678
  )
@@ -744,7 +752,7 @@ function Re({
744
752
  x && x.acks.length === 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px] text-slate-400", children: "Nobody has dismissed it yet." }),
745
753
  x == null ? void 0 : x.acks.map((d, N) => /* @__PURE__ */ a("p", { className: "text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
746
754
  d.user_name || d.user_email || "Unknown",
747
- /* @__PURE__ */ t("span", { className: "text-slate-400", children: d.acked_at ? ` · ${new Date(d.acked_at).toLocaleString()}` : "" })
755
+ /* @__PURE__ */ t("span", { className: "text-slate-400", children: d.acked_at ? ` · ${I(d.acked_at)}` : "" })
748
756
  ] }, N))
749
757
  ] }),
750
758
  /* @__PURE__ */ a("div", { children: [
@@ -767,13 +775,13 @@ function Re({
767
775
  ]
768
776
  }
769
777
  ),
770
- /* @__PURE__ */ t("span", { className: "text-slate-400", children: d.delivered_at ? ` · ${new Date(d.delivered_at).toLocaleString()}` : "" })
778
+ /* @__PURE__ */ t("span", { className: "text-slate-400", children: d.delivered_at ? ` · ${I(d.delivered_at)}` : "" })
771
779
  ] }, N))
772
780
  ] })
773
781
  ] })
774
782
  ] });
775
783
  }
776
- function Me({
784
+ function Ve({
777
785
  index: r,
778
786
  group: i,
779
787
  dimensions: c,
@@ -790,7 +798,7 @@ function Me({
790
798
  ] }),
791
799
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2.5", children: [
792
800
  o && /* @__PURE__ */ t(
793
- pe,
801
+ he,
794
802
  {
795
803
  audience: { groups: [i] },
796
804
  everyone: !1,
@@ -815,7 +823,7 @@ function Me({
815
823
  return /* @__PURE__ */ a("div", { className: "flex flex-wrap items-start gap-2", children: [
816
824
  /* @__PURE__ */ t("span", { className: "mt-0.5 w-[110px] shrink-0 text-[11.5px] font-medium text-slate-600 dark:text-muted-foreground", children: (m == null ? void 0 : m.label) ?? n }),
817
825
  /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: m ? /* @__PURE__ */ t(
818
- He,
826
+ Ue,
819
827
  {
820
828
  dim: m,
821
829
  selected: i[n] ?? [],
@@ -828,7 +836,7 @@ function Me({
828
836
  ] }, n);
829
837
  }),
830
838
  p.length > 0 && /* @__PURE__ */ t("div", { className: "w-[200px]", children: /* @__PURE__ */ t(
831
- Qe,
839
+ Me,
832
840
  {
833
841
  value: "",
834
842
  onChange: (n) => {
@@ -841,12 +849,12 @@ function Me({
841
849
  ] })
842
850
  ] });
843
851
  }
844
- function He({
852
+ function Ue({
845
853
  dim: r,
846
854
  selected: i,
847
855
  onChange: c
848
856
  }) {
849
- const b = I(), { data: h = [] } = k({
857
+ const b = R(), { data: h = [] } = k({
850
858
  queryKey: ["broadcast-dim-options", r.target_collection],
851
859
  queryFn: () => b.request(
852
860
  v(`/items/${r.target_collection}`, { limit: 200 })
@@ -880,13 +888,13 @@ function He({
880
888
  })
881
889
  ] });
882
890
  }
883
- function pe({
891
+ function he({
884
892
  audience: r,
885
893
  everyone: i,
886
894
  label: c,
887
895
  compact: b
888
896
  }) {
889
- const h = I(), [s, p] = u(!1), o = JSON.stringify(r), { data: n } = k({
897
+ const h = R(), [s, p] = u(!1), o = JSON.stringify(r), { data: n } = k({
890
898
  queryKey: ["broadcast-audience-preview", o],
891
899
  queryFn: () => h.request(j("/announcements/preview-audience", { audience: r })).then((m) => m.data),
892
900
  enabled: !i,
@@ -896,7 +904,7 @@ function pe({
896
904
  c,
897
905
  ": ",
898
906
  /* @__PURE__ */ t("span", { className: "font-medium", children: "Everyone" })
899
- ] }) : /* @__PURE__ */ a(ce, { children: [
907
+ ] }) : /* @__PURE__ */ a(Q, { children: [
900
908
  /* @__PURE__ */ a(
901
909
  "button",
902
910
  {
@@ -914,7 +922,7 @@ function pe({
914
922
  }
915
923
  ),
916
924
  s && n && /* @__PURE__ */ t(
917
- Ve,
925
+ Be,
918
926
  {
919
927
  title: c === "Matches" ? "This group matches" : "Sending to",
920
928
  count: n.count,
@@ -925,7 +933,7 @@ function pe({
925
933
  )
926
934
  ] });
927
935
  }
928
- function Ve({
936
+ function Be({
929
937
  title: r,
930
938
  count: i,
931
939
  users: c,
@@ -933,7 +941,7 @@ function Ve({
933
941
  onClose: h
934
942
  }) {
935
943
  const [s, p] = u("");
936
- Ae(() => {
944
+ Fe(() => {
937
945
  const m = (x) => {
938
946
  x.key === "Escape" && h();
939
947
  };
@@ -942,7 +950,7 @@ function Ve({
942
950
  const o = s.trim().toLowerCase(), n = o ? c.filter(
943
951
  (m) => m.name.toLowerCase().includes(o) || (m.email ?? "").toLowerCase().includes(o)
944
952
  ) : c;
945
- return Te(
953
+ return je(
946
954
  /* @__PURE__ */ a("div", { className: "fixed inset-0 z-[100]", children: [
947
955
  /* @__PURE__ */ t("div", { className: "absolute inset-0 bg-black/30", onClick: h }),
948
956
  /* @__PURE__ */ a("div", { className: "absolute right-0 top-0 flex h-full w-[380px] max-w-[92vw] flex-col border-l border-slate-200 bg-white shadow-xl dark:border-border dark:bg-card", children: [
@@ -1004,5 +1012,5 @@ function Ve({
1004
1012
  );
1005
1013
  }
1006
1014
  export {
1007
- st as BroadcastView
1015
+ ot as BroadcastView
1008
1016
  };