@nivaro/react 0.2.53 → 0.2.55

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 (294) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +452 -4
  4. package/dist/index.js +644 -618
  5. package/dist/layout-editor.d.ts +252 -2
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/FormWhatsNew.js +60 -0
  10. package/dist/shared/components/ItemEditForm.js +3968 -3618
  11. package/dist/shared/components/JobsTray.js +100 -55
  12. package/dist/shared/components/MyWorkView.js +91 -89
  13. package/dist/shared/components/NotificationBell.js +80 -79
  14. package/dist/shared/components/ProfileView.js +568 -520
  15. package/dist/shared/components/RecordCompare.js +254 -0
  16. package/dist/shared/components/RecordReadView.js +598 -543
  17. package/dist/shared/components/ReportView.js +578 -543
  18. package/dist/shared/components/RowPresence.js +91 -0
  19. package/dist/shared/components/TipLayer.js +27 -27
  20. package/dist/shared/components/WidgetSlot.js +474 -458
  21. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  22. package/dist/shared/components/ai/AskPanel.js +139 -119
  23. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  24. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  25. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  26. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  27. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  28. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  29. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  30. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  31. package/dist/shared/components/chat/Composer.js +357 -303
  32. package/dist/shared/components/chat/MessageActions.js +92 -0
  33. package/dist/shared/components/chat/MessageFormat.js +290 -264
  34. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  35. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  36. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  37. package/dist/shared/components/chat/RoomParts.js +213 -274
  38. package/dist/shared/components/chat/ScreenClip.js +184 -0
  39. package/dist/shared/components/chat/chat-core.js +402 -483
  40. package/dist/shared/components/chat/chat-drafts.js +59 -0
  41. package/dist/shared/components/chat/chat-emoji.js +348 -0
  42. package/dist/shared/components/chat/chat-local-time.js +41 -0
  43. package/dist/shared/components/chat/chat-outbox.js +303 -0
  44. package/dist/shared/components/chat/chat-window.js +163 -0
  45. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  46. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  47. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  48. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  49. package/dist/shared/components/help-videos/api.js +80 -67
  50. package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
  51. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  52. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  53. package/dist/shared/components/item-edit/FieldAffordances.js +9 -8
  54. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  55. package/dist/shared/components/item-edit/FieldRow.js +382 -320
  56. package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
  57. package/dist/shared/components/item-edit/GroupSection.js +786 -639
  58. package/dist/shared/components/item-edit/HeaderTools.js +59 -56
  59. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  60. package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
  61. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  62. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  63. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  64. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  65. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  66. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  67. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  68. package/dist/shared/components/item-edit/lock-why.js +94 -0
  69. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  70. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  71. package/dist/shared/components/item-edit/useFormUsageBeacon.js +65 -0
  72. package/dist/shared/components/layout-editor/AddPanel.js +226 -151
  73. package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
  74. package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
  75. package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
  76. package/dist/shared/components/layout-editor/ChangeNote.js +147 -0
  77. package/dist/shared/components/layout-editor/CollabParts.js +175 -0
  78. package/dist/shared/components/layout-editor/DesignNode.js +311 -116
  79. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -26
  80. package/dist/shared/components/layout-editor/EditorTopBar.js +463 -175
  81. package/dist/shared/components/layout-editor/FindReplace.js +188 -0
  82. package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
  83. package/dist/shared/components/layout-editor/HistoryPanel.js +250 -109
  84. package/dist/shared/components/layout-editor/LayoutEditor.js +1196 -305
  85. package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
  86. package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
  87. package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
  88. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  89. package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
  90. package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
  91. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  92. package/dist/shared/components/layout-editor/StructureMenu.js +464 -0
  93. package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
  94. package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
  95. package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
  96. package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
  97. package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
  98. package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
  99. package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
  100. package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
  101. package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
  102. package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
  103. package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
  104. package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
  105. package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
  106. package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
  107. package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
  108. package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
  109. package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
  110. package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
  111. package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
  112. package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
  113. package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
  114. package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
  115. package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
  116. package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
  117. package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
  118. package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
  119. package/dist/shared/components/layout-editor/assist/jump.js +142 -0
  120. package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
  121. package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
  122. package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
  123. package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
  124. package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
  125. package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
  126. package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
  127. package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
  128. package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
  129. package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
  130. package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
  131. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +388 -0
  132. package/dist/shared/components/layout-editor/collab/collab-api.js +80 -0
  133. package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
  134. package/dist/shared/components/layout-editor/commands/intents.js +214 -0
  135. package/dist/shared/components/layout-editor/commands/parse.js +242 -0
  136. package/dist/shared/components/layout-editor/design-context.js +26 -6
  137. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +181 -164
  138. package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
  139. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  140. package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
  141. package/dist/shared/components/layout-editor/draft-recovery.js +131 -0
  142. package/dist/shared/components/layout-editor/editor-notes.js +78 -0
  143. package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
  144. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  145. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  146. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  147. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  148. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  149. package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
  150. package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
  151. package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
  152. package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
  153. package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
  154. package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
  155. package/dist/shared/components/layout-editor/field-zones.js +116 -0
  156. package/dist/shared/components/layout-editor/form-map.js +138 -0
  157. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  158. package/dist/shared/components/layout-editor/history-api.js +87 -0
  159. package/dist/shared/components/layout-editor/inheritance.js +55 -0
  160. package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
  161. package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
  162. package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
  163. package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
  164. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  165. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
  166. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +179 -0
  167. package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
  168. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +291 -141
  169. package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
  170. package/dist/shared/components/layout-editor/inspector/Inspector.js +282 -180
  171. package/dist/shared/components/layout-editor/inspector/LookTab.js +166 -109
  172. package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
  173. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  174. package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
  175. package/dist/shared/components/layout-editor/inspector/PickerTab.js +146 -118
  176. package/dist/shared/components/layout-editor/inspector/RulesTab.js +162 -111
  177. package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
  178. package/dist/shared/components/layout-editor/inspector/kit.js +71 -70
  179. package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
  180. package/dist/shared/components/layout-editor/is-typing.js +9 -0
  181. package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
  182. package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
  183. package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
  184. package/dist/shared/components/layout-editor/load-error.js +37 -0
  185. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
  186. package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
  187. package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
  188. package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
  189. package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
  190. package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
  191. package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
  192. package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
  193. package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
  194. package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
  195. package/dist/shared/components/layout-editor/nav/find.js +20 -0
  196. package/dist/shared/components/layout-editor/nav/tree.js +142 -0
  197. package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
  198. package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
  199. package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
  200. package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
  201. package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
  202. package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
  203. package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
  204. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  205. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  206. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  207. package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
  208. package/dist/shared/components/layout-editor/overview/describe-conditions.js +24 -14
  209. package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
  210. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  211. package/dist/shared/components/layout-editor/panel-style.js +8 -7
  212. package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
  213. package/dist/shared/components/layout-editor/pin.js +25 -0
  214. package/dist/shared/components/layout-editor/presence.js +111 -0
  215. package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
  216. package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
  217. package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
  218. package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
  219. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  220. package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
  221. package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
  222. package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
  223. package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
  224. package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
  225. package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
  226. package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
  227. package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
  228. package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
  229. package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
  230. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  231. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  232. package/dist/shared/components/layout-editor/settings/FormSettings.js +125 -103
  233. package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
  234. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  235. package/dist/shared/components/layout-editor/settings/ToolsSection.js +215 -105
  236. package/dist/shared/components/layout-editor/settings/WhoSection.js +139 -100
  237. package/dist/shared/components/layout-editor/settings/controls.js +8 -8
  238. package/dist/shared/components/layout-editor/settings/settings-registry.js +142 -21
  239. package/dist/shared/components/layout-editor/shortcuts.js +88 -0
  240. package/dist/shared/components/layout-editor/show-when.js +35 -0
  241. package/dist/shared/components/layout-editor/slot-names.js +4 -3
  242. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  243. package/dist/shared/components/layout-editor/structure-ops.js +403 -0
  244. package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
  245. package/dist/shared/components/layout-editor/testing/TestingPanels.js +556 -0
  246. package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
  247. package/dist/shared/components/layout-editor/testing/testing-model.js +406 -0
  248. package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
  249. package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
  250. package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
  251. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  252. package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
  253. package/dist/shared/components/layout-editor/usage/UsagePanel.js +232 -0
  254. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  255. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  256. package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
  257. package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
  258. package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -306
  259. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  260. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  261. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  262. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  263. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  264. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  265. package/dist/shared/components/support/SuggestFormChange.js +143 -0
  266. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  267. package/dist/shared/components/support/SupportView.js +75 -73
  268. package/dist/shared/lib/ai-fill.js +37 -0
  269. package/dist/shared/lib/background-runs.js +150 -0
  270. package/dist/shared/lib/delivery-ack.js +9 -0
  271. package/dist/shared/lib/entry-badge-style.js +13 -0
  272. package/dist/shared/lib/entry-config.js +71 -0
  273. package/dist/shared/lib/form-sections.js +64 -0
  274. package/dist/shared/lib/form-structure.js +99 -0
  275. package/dist/shared/lib/form-usage-beacon.js +133 -0
  276. package/dist/shared/lib/jobs-tray.js +25 -23
  277. package/dist/shared/lib/keyset-pager.js +37 -0
  278. package/dist/shared/lib/layout-i18n.js +66 -0
  279. package/dist/shared/lib/layout-lint.js +490 -0
  280. package/dist/shared/lib/layout-ops.js +116 -110
  281. package/dist/shared/lib/layout-resolve.js +113 -0
  282. package/dist/shared/lib/placement-behaviour.js +144 -0
  283. package/dist/shared/lib/prefetch.js +149 -0
  284. package/dist/shared/lib/presence-hooks.js +199 -0
  285. package/dist/shared/lib/record-outbox.js +82 -81
  286. package/dist/shared/lib/replay-socket.js +93 -0
  287. package/dist/shared/lib/request-gate.js +51 -50
  288. package/dist/shared/lib/room-gaps.js +96 -0
  289. package/dist/shared/lib/screenshot.js +54 -28
  290. package/dist/shared/lib/search-log.js +27 -0
  291. package/dist/shared/lib/socket-realtime.js +101 -80
  292. package/dist/shared/lib/visible-when.js +34 -0
  293. package/dist/shared/lib/worker-socket.js +200 -0
  294. package/package.json +1 -1
@@ -1,86 +1,87 @@
1
- import { jsx as t, jsxs as g, Fragment as he } from "react/jsx-runtime";
2
- import { useQueryClient as Pe, useQuery as We } from "@tanstack/react-query";
3
- import { RefreshCw as De, MoreVertical as Me, MoreHorizontal as He, Clipboard as Be, Copy as Fe, Clock as Ve, Calendar as Je, Paperclip as ze, Folder as Ke, File as Qe, FileText as Ge, Bell as Xe, Phone as Ye, MessageSquare as Ze, Mail as et, UserCheck as tt, UserPlus as rt, Users as nt, User as lt, Activity as at, Zap as it, Power as st, Search as ot, Filter as ct, Sliders as dt, Settings as ut, RotateCcw as pt, Pause as ft, Play as mt, HelpCircle as ht, Info as gt, AlertTriangle as yt, AlertCircle as xt, Flag as wt, Bookmark as bt, Heart as vt, Star as _t, Unlock as Nt, Lock as kt, EyeOff as St, Eye as Lt, Send as Rt, Upload as $t, Download as Ct, Save as Et, Trash2 as jt, Edit2 as It, Edit as Tt, Minus as Ot, Plus as Dt, XCircle as Ut, X as At, CheckCircle as qt, Check as Pt, Share2 as Wt, Link as Mt, ExternalLink as Ht, ArrowUpRight as Bt, ArrowDown as Ft, ArrowUp as Vt, ArrowLeft as Jt, ArrowRight as zt } from "lucide-react";
4
- import { useState as M, useRef as ne, useCallback as Kt, useEffect as te, useMemo as $e } from "react";
5
- import { useApiFetchConfig as ge, useDrilldown as Qt, useOptionalNivaroClient as Gt } from "../context.js";
6
- import { useDebounced as Xt } from "../hooks/useDebounced.js";
7
- import { get as Yt, post as Zt } from "../lib/commands.js";
8
- import { HEADER_CELL_DENSE as er, HEADER_CELL_LIST as tr, HEADER_LABEL as rr, HEADER_VALUE_LINE as nr, HEADER_VALUE_HERO as lr, HEADER_VALUE as ar } from "../lib/header-strip.js";
9
- import { affixesFor as le, formatWidgetValue as ae } from "../lib/widget-value-format.js";
10
- import { cacheStampTip as ir, CacheStamp as sr } from "./CacheStamp.js";
11
- import { useStagedRelations as or } from "./item-edit/O2MStagingContext.js";
12
- import { QueryTable as cr } from "./QueryTable.js";
13
- import { Button as re } from "./ui/button.js";
14
- import { DropdownMenu as Ce, DropdownMenuTrigger as Ee, DropdownMenuContent as je, DropdownMenuItem as Ie } from "./ui/dropdown-menu.js";
15
- import { reportSlotScalar as dr, ReportSlotWidget as ur } from "./widgets/ReportSlotWidget.js";
16
- import { ReviewListWidget as pr } from "./widgets/ReviewListWidget.js";
17
- import { RollupWidget as fr } from "./widgets/RollupWidget.js";
1
+ import { jsx as t, jsxs as y, Fragment as ye } from "react/jsx-runtime";
2
+ import { useQueryClient as Be, useQuery as He } from "@tanstack/react-query";
3
+ import { RefreshCw as Ae, MoreVertical as Fe, MoreHorizontal as Ve, Clipboard as Je, Copy as ze, Clock as Ke, Calendar as Qe, Paperclip as Ge, Folder as Xe, File as Ye, FileText as Ze, Bell as et, Phone as tt, MessageSquare as rt, Mail as nt, UserCheck as lt, UserPlus as at, Users as it, User as st, Activity as ot, Zap as ct, Power as dt, Search as ut, Filter as pt, Sliders as ft, Settings as mt, RotateCcw as ht, Pause as gt, Play as yt, HelpCircle as xt, Info as wt, AlertTriangle as bt, AlertCircle as vt, Flag as _t, Bookmark as Nt, Heart as kt, Star as St, Unlock as Rt, Lock as Lt, EyeOff as $t, Eye as Ct, Send as Et, Upload as jt, Download as Tt, Save as It, Trash2 as Ot, Edit2 as qt, Edit as Dt, Minus as Ut, Plus as At, XCircle as Pt, X as Wt, CheckCircle as Mt, Check as Bt, Share2 as Ht, Link as Ft, ExternalLink as Vt, ArrowUpRight as Jt, ArrowDown as zt, ArrowUp as Kt, ArrowLeft as Qt, ArrowRight as Gt } from "lucide-react";
4
+ import { useState as P, useRef as le, useCallback as Xt, useEffect as re, useMemo as je } from "react";
5
+ import { useApiFetchConfig as xe, useDrilldown as Yt, useOptionalNivaroClient as Zt } from "../context.js";
6
+ import { useDebounced as er } from "../hooks/useDebounced.js";
7
+ import { get as tr, post as rr } from "../lib/commands.js";
8
+ import { HEADER_CELL_DENSE as nr, HEADER_CELL_LIST as lr, HEADER_LABEL as ar, HEADER_VALUE_LINE as ir, HEADER_VALUE_HERO as sr, HEADER_VALUE as or } from "../lib/header-strip.js";
9
+ import { affixesFor as ae, formatWidgetValue as ie } from "../lib/widget-value-format.js";
10
+ import { BackgroundRunOffer as cr } from "./BackgroundRunOffer.js";
11
+ import { cacheStampTip as dr, CacheStamp as ur } from "./CacheStamp.js";
12
+ import { useStagedRelations as pr } from "./item-edit/O2MStagingContext.js";
13
+ import { QueryTable as fr } from "./QueryTable.js";
14
+ import { Button as ne } from "./ui/button.js";
15
+ import { DropdownMenu as Te, DropdownMenuTrigger as Ie, DropdownMenuContent as Oe, DropdownMenuItem as qe } from "./ui/dropdown-menu.js";
16
+ import { reportSlotScalar as mr, ReportSlotWidget as hr } from "./widgets/ReportSlotWidget.js";
17
+ import { ReviewListWidget as gr } from "./widgets/ReviewListWidget.js";
18
+ import { RollupWidget as yr } from "./widgets/RollupWidget.js";
18
19
  const Q = {
19
- ArrowRight: zt,
20
- ArrowLeft: Jt,
21
- ArrowUp: Vt,
22
- ArrowDown: Ft,
23
- ArrowUpRight: Bt,
24
- ExternalLink: Ht,
25
- Link: Mt,
26
- Share2: Wt,
27
- Check: Pt,
28
- CheckCircle: qt,
29
- X: At,
30
- XCircle: Ut,
31
- Plus: Dt,
32
- Minus: Ot,
33
- Edit: Tt,
34
- Edit2: It,
35
- Trash2: jt,
36
- Save: Et,
37
- Download: Ct,
38
- Upload: $t,
39
- Send: Rt,
40
- Eye: Lt,
41
- EyeOff: St,
42
- Lock: kt,
43
- Unlock: Nt,
44
- Star: _t,
45
- Heart: vt,
46
- Bookmark: bt,
47
- Flag: wt,
48
- AlertCircle: xt,
49
- AlertTriangle: yt,
50
- Info: gt,
51
- HelpCircle: ht,
52
- Play: mt,
53
- Pause: ft,
54
- RefreshCw: De,
55
- RotateCcw: pt,
56
- Settings: ut,
57
- Sliders: dt,
58
- Filter: ct,
59
- Search: ot,
60
- Power: st,
61
- Zap: it,
62
- Activity: at,
63
- User: lt,
64
- Users: nt,
65
- UserPlus: rt,
66
- UserCheck: tt,
67
- Mail: et,
68
- MessageSquare: Ze,
69
- Phone: Ye,
70
- Bell: Xe,
71
- FileText: Ge,
72
- File: Qe,
73
- Folder: Ke,
74
- Paperclip: ze,
75
- Calendar: Je,
76
- Clock: Ve,
77
- Copy: Fe,
78
- Clipboard: Be,
79
- MoreHorizontal: He,
80
- MoreVertical: Me
20
+ ArrowRight: Gt,
21
+ ArrowLeft: Qt,
22
+ ArrowUp: Kt,
23
+ ArrowDown: zt,
24
+ ArrowUpRight: Jt,
25
+ ExternalLink: Vt,
26
+ Link: Ft,
27
+ Share2: Ht,
28
+ Check: Bt,
29
+ CheckCircle: Mt,
30
+ X: Wt,
31
+ XCircle: Pt,
32
+ Plus: At,
33
+ Minus: Ut,
34
+ Edit: Dt,
35
+ Edit2: qt,
36
+ Trash2: Ot,
37
+ Save: It,
38
+ Download: Tt,
39
+ Upload: jt,
40
+ Send: Et,
41
+ Eye: Ct,
42
+ EyeOff: $t,
43
+ Lock: Lt,
44
+ Unlock: Rt,
45
+ Star: St,
46
+ Heart: kt,
47
+ Bookmark: Nt,
48
+ Flag: _t,
49
+ AlertCircle: vt,
50
+ AlertTriangle: bt,
51
+ Info: wt,
52
+ HelpCircle: xt,
53
+ Play: yt,
54
+ Pause: gt,
55
+ RefreshCw: Ae,
56
+ RotateCcw: ht,
57
+ Settings: mt,
58
+ Sliders: ft,
59
+ Filter: pt,
60
+ Search: ut,
61
+ Power: dt,
62
+ Zap: ct,
63
+ Activity: ot,
64
+ User: st,
65
+ Users: it,
66
+ UserPlus: at,
67
+ UserCheck: lt,
68
+ Mail: nt,
69
+ MessageSquare: rt,
70
+ Phone: tt,
71
+ Bell: et,
72
+ FileText: Ze,
73
+ File: Ye,
74
+ Folder: Xe,
75
+ Paperclip: Ge,
76
+ Calendar: Qe,
77
+ Clock: Ke,
78
+ Copy: ze,
79
+ Clipboard: Je,
80
+ MoreHorizontal: Ve,
81
+ MoreVertical: Fe
81
82
  };
82
- function ye({ awaiting: n, dark: s }) {
83
- return /* @__PURE__ */ g(
83
+ function we({ awaiting: n, dark: s }) {
84
+ return /* @__PURE__ */ y(
84
85
  "span",
85
86
  {
86
87
  className: `text-[12px] font-normal italic ${s ? "text-slate-400" : "text-slate-400 dark:text-slate-500"}`,
@@ -93,34 +94,34 @@ function ye({ awaiting: n, dark: s }) {
93
94
  }
94
95
  );
95
96
  }
96
- function ue({
97
+ function fe({
97
98
  label: n,
98
99
  value: s,
99
100
  display: o,
100
- loading: l,
101
+ loading: a,
101
102
  awaiting: c
102
103
  }) {
103
- const { prefix: f, suffix: v } = le(s, o), w = l ? null : ae(s, o.format ?? "");
104
+ const { prefix: m, suffix: v } = ae(s, o), w = a ? null : ie(s, o.format ?? "");
104
105
  return (
105
106
  // Same label / value vocabulary as a field tile in the record sub-header
106
107
  // (lib/header-strip.ts) — the two kinds of cell read as one row.
107
- /* @__PURE__ */ g(
108
+ /* @__PURE__ */ y(
108
109
  "div",
109
110
  {
110
- className: `flex h-full min-w-0 flex-col justify-start gap-1 px-4 pt-[9px] pb-2 ${er} ${tr}`,
111
+ className: `flex h-full min-w-0 flex-col justify-start gap-1 px-4 pt-[9px] pb-2 ${nr} ${lr}`,
111
112
  children: [
112
- /* @__PURE__ */ t("span", { className: rr, "data-header-label": !0, children: n }),
113
+ /* @__PURE__ */ t("span", { className: ar, "data-header-label": !0, children: n }),
113
114
  /* @__PURE__ */ t(
114
115
  "span",
115
116
  {
116
117
  "data-header-value": !0,
117
- className: `${nr} max-w-[232px] items-baseline truncate leading-tight`,
118
- children: l ? /* @__PURE__ */ t("span", { className: "animate-pulse inline-block h-3.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : c && s == null ? /* @__PURE__ */ t(ye, { awaiting: c }) : /* @__PURE__ */ g(
118
+ className: `${ir} max-w-[232px] items-baseline truncate leading-tight`,
119
+ children: a ? /* @__PURE__ */ t("span", { className: "animate-pulse inline-block h-3.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : c && s == null ? /* @__PURE__ */ t(we, { awaiting: c }) : /* @__PURE__ */ y(
119
120
  "span",
120
121
  {
121
- className: String(o.format ?? "").startsWith("currency") || /^[$€£¥]/.test(f) ? lr : ar,
122
+ className: String(o.format ?? "").startsWith("currency") || /^[$€£¥]/.test(m) ? sr : or,
122
123
  children: [
123
- f,
124
+ m,
124
125
  w,
125
126
  v
126
127
  ]
@@ -133,18 +134,18 @@ function ue({
133
134
  )
134
135
  );
135
136
  }
136
- function mr({
137
+ function xr({
137
138
  data: n,
138
139
  label: s,
139
140
  loading: o,
140
- widgetConfig: l,
141
+ widgetConfig: a,
141
142
  awaiting: c
142
143
  }) {
143
- const f = "h-full flex items-stretch divide-x divide-slate-200 dark:divide-border [[data-header-list]_&]:w-full [[data-header-list]_&]:flex-col [[data-header-list]_&]:divide-x-0";
144
+ const m = "h-full flex items-stretch divide-x divide-slate-200 dark:divide-border [[data-header-list]_&]:w-full [[data-header-list]_&]:flex-col [[data-header-list]_&]:divide-x-0";
144
145
  if (n && "values" in n) {
145
146
  const w = n.values ?? [];
146
- return w.length === 0 ? null : /* @__PURE__ */ t("div", { className: f, children: w.map((_, L) => /* @__PURE__ */ t(
147
- ue,
147
+ return w.length === 0 ? null : /* @__PURE__ */ t("div", { className: m, children: w.map((_, R) => /* @__PURE__ */ t(
148
+ fe,
148
149
  {
149
150
  label: _.label,
150
151
  value: _.value,
@@ -152,16 +153,16 @@ function mr({
152
153
  loading: !1,
153
154
  awaiting: c
154
155
  },
155
- L
156
+ R
156
157
  )) });
157
158
  }
158
159
  if (o) {
159
- const w = (l == null ? void 0 : l.value_fields) ?? [], _ = w.length > 0 ? w : [{ label: s }];
160
- return /* @__PURE__ */ t("div", { className: f, children: _.map((L, $) => /* @__PURE__ */ t(
161
- ue,
160
+ const w = (a == null ? void 0 : a.value_fields) ?? [], _ = w.length > 0 ? w : [{ label: s }];
161
+ return /* @__PURE__ */ t("div", { className: m, children: _.map((R, $) => /* @__PURE__ */ t(
162
+ fe,
162
163
  {
163
- label: L.label ?? s,
164
- display: { prefix: L.prefix ?? "", suffix: L.suffix ?? "", format: L.format ?? "" },
164
+ label: R.label ?? s,
165
+ display: { prefix: R.prefix ?? "", suffix: R.suffix ?? "", format: R.format ?? "" },
165
166
  loading: !0
166
167
  },
167
168
  $
@@ -169,8 +170,8 @@ function mr({
169
170
  }
170
171
  if (!n) return null;
171
172
  const v = n.display ?? {};
172
- return /* @__PURE__ */ t("div", { className: f, children: /* @__PURE__ */ t(
173
- ue,
173
+ return /* @__PURE__ */ t("div", { className: m, children: /* @__PURE__ */ t(
174
+ fe,
174
175
  {
175
176
  label: s,
176
177
  value: n.value,
@@ -180,167 +181,167 @@ function mr({
180
181
  }
181
182
  ) });
182
183
  }
183
- function hr(n, s) {
184
+ function wr(n, s) {
184
185
  if (Object.hasOwn(n, s)) return n[s] ?? null;
185
186
  const o = s.split(".");
186
- let l = n;
187
+ let a = n;
187
188
  for (const c of o) {
188
- if (l == null || typeof l != "object") return l ?? null;
189
- l = l[c];
189
+ if (a == null || typeof a != "object") return a ?? null;
190
+ a = a[c];
190
191
  }
191
- return l ?? null;
192
+ return a ?? null;
192
193
  }
193
- function gr(n, s) {
194
+ function br(n, s) {
194
195
  const o = {};
195
- for (const l of n)
196
- if (l.binding_type === "item_field")
197
- o[l.key] = hr(s, l.binding_value);
198
- else if (l.binding_type === "static")
199
- o[l.key] = l.binding_value;
200
- else if (l.binding_type === "url_param" && typeof window < "u") {
196
+ for (const a of n)
197
+ if (a.binding_type === "item_field")
198
+ o[a.key] = wr(s, a.binding_value);
199
+ else if (a.binding_type === "static")
200
+ o[a.key] = a.binding_value;
201
+ else if (a.binding_type === "url_param" && typeof window < "u") {
201
202
  const c = new URLSearchParams(window.location.search);
202
- o[l.key] = c.get(l.binding_value) ?? null;
203
+ o[a.key] = c.get(a.binding_value) ?? null;
203
204
  }
204
205
  return o;
205
206
  }
206
- function pe({
207
+ function me({
207
208
  data: n,
208
209
  awaiting: s
209
210
  }) {
210
- if (s && n.value == null) return /* @__PURE__ */ t(ye, { awaiting: s });
211
- const o = n.display ?? {}, { prefix: l, suffix: c } = le(n.value, o), f = ae(n.value, o.format ?? "");
212
- return /* @__PURE__ */ g("div", { className: "flex items-baseline gap-1", children: [
213
- l && /* @__PURE__ */ t("span", { className: "text-[13px] text-slate-500", children: l }),
214
- /* @__PURE__ */ t("span", { className: "text-2xl font-semibold text-slate-900 dark:text-slate-100", children: f }),
211
+ if (s && n.value == null) return /* @__PURE__ */ t(we, { awaiting: s });
212
+ const o = n.display ?? {}, { prefix: a, suffix: c } = ae(n.value, o), m = ie(n.value, o.format ?? "");
213
+ return /* @__PURE__ */ y("div", { className: "flex items-baseline gap-1", children: [
214
+ a && /* @__PURE__ */ t("span", { className: "text-[13px] text-slate-500", children: a }),
215
+ /* @__PURE__ */ t("span", { className: "text-2xl font-semibold text-slate-900 dark:text-slate-100", children: m }),
215
216
  c && /* @__PURE__ */ t("span", { className: "text-[13px] text-slate-500", children: c })
216
217
  ] });
217
218
  }
218
- function fe({
219
+ function he({
219
220
  label: n,
220
221
  value: s,
221
222
  display: o,
222
- dark: l,
223
+ dark: a,
223
224
  loading: c,
224
- awaiting: f
225
+ awaiting: m
225
226
  }) {
226
- const { prefix: v, suffix: w } = le(s, o), _ = c ? null : ae(s, o.format ?? "");
227
- return /* @__PURE__ */ g("div", { className: "flex flex-col justify-center px-2.5 py-1 min-w-0 gap-0.5", children: [
227
+ const { prefix: v, suffix: w } = ae(s, o), _ = c ? null : ie(s, o.format ?? "");
228
+ return /* @__PURE__ */ y("div", { className: "flex flex-col justify-center px-2.5 py-1 min-w-0 gap-0.5", children: [
228
229
  /* @__PURE__ */ t(
229
230
  "span",
230
231
  {
231
- className: `text-[9px] font-medium uppercase tracking-wider leading-none truncate ${l ? "text-slate-500" : "text-slate-400"}`,
232
+ className: `text-[9px] font-medium uppercase tracking-wider leading-none truncate ${a ? "text-slate-500" : "text-slate-400"}`,
232
233
  children: n
233
234
  }
234
235
  ),
235
236
  /* @__PURE__ */ t(
236
237
  "span",
237
238
  {
238
- className: `flex items-baseline gap-0.5 text-[13px] font-semibold tabular-nums leading-none ${l ? "text-slate-100" : "text-slate-900"}`,
239
+ className: `flex items-baseline gap-0.5 text-[13px] font-semibold tabular-nums leading-none ${a ? "text-slate-100" : "text-slate-900"}`,
239
240
  children: c ? /* @__PURE__ */ t(
240
241
  "span",
241
242
  {
242
- className: `animate-pulse inline-block h-3 w-14 rounded ${l ? "bg-slate-600" : "bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]"}`
243
+ className: `animate-pulse inline-block h-3 w-14 rounded ${a ? "bg-slate-600" : "bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]"}`
243
244
  }
244
- ) : f && s == null ? /* @__PURE__ */ t(ye, { awaiting: f, dark: l }) : /* @__PURE__ */ g(he, { children: [
245
- v && /* @__PURE__ */ t("span", { className: `text-[10px] ${l ? "text-slate-400" : "text-slate-500"}`, children: v }),
245
+ ) : m && s == null ? /* @__PURE__ */ t(we, { awaiting: m, dark: a }) : /* @__PURE__ */ y(ye, { children: [
246
+ v && /* @__PURE__ */ t("span", { className: `text-[10px] ${a ? "text-slate-400" : "text-slate-500"}`, children: v }),
246
247
  _,
247
- w && /* @__PURE__ */ t("span", { className: `text-[10px] ${l ? "text-slate-400" : "text-slate-500"}`, children: w })
248
+ w && /* @__PURE__ */ t("span", { className: `text-[10px] ${a ? "text-slate-400" : "text-slate-500"}`, children: w })
248
249
  ] })
249
250
  }
250
251
  )
251
252
  ] });
252
253
  }
253
- function yr({
254
+ function vr({
254
255
  data: n,
255
256
  label: s,
256
257
  style: o,
257
- loading: l,
258
+ loading: a,
258
259
  widgetConfig: c,
259
- awaiting: f
260
+ awaiting: m
260
261
  }) {
261
262
  const v = o === "pill-dark", w = v ? "flex items-stretch divide-x divide-slate-700 rounded-md bg-slate-800/90 border border-slate-700 overflow-hidden" : "flex items-stretch divide-x divide-slate-200 rounded-md bg-white border border-slate-200 overflow-hidden dark:bg-card dark:border-border dark:divide-border";
262
263
  if (n && "values" in n) {
263
- const L = n.values ?? [];
264
- return L.length === 0 ? null : /* @__PURE__ */ t("div", { className: w, children: L.map(($, N) => /* @__PURE__ */ t(
265
- fe,
264
+ const R = n.values ?? [];
265
+ return R.length === 0 ? null : /* @__PURE__ */ t("div", { className: w, children: R.map(($, N) => /* @__PURE__ */ t(
266
+ he,
266
267
  {
267
268
  label: $.label,
268
269
  value: $.value,
269
270
  display: $.display ?? {},
270
271
  dark: v,
271
272
  loading: !1,
272
- awaiting: f
273
+ awaiting: m
273
274
  },
274
275
  N
275
276
  )) });
276
277
  }
277
- if (l) {
278
- const L = (c == null ? void 0 : c.value_fields) ?? [], $ = L.length > 0 ? L : [{ label: s }];
279
- return /* @__PURE__ */ t("div", { className: w, children: $.map((N, U) => /* @__PURE__ */ t(
280
- fe,
278
+ if (a) {
279
+ const R = (c == null ? void 0 : c.value_fields) ?? [], $ = R.length > 0 ? R : [{ label: s }];
280
+ return /* @__PURE__ */ t("div", { className: w, children: $.map((N, D) => /* @__PURE__ */ t(
281
+ he,
281
282
  {
282
283
  label: N.label ?? s,
283
284
  display: { prefix: N.prefix ?? "", suffix: N.suffix ?? "", format: N.format ?? "" },
284
285
  dark: v,
285
286
  loading: !0
286
287
  },
287
- U
288
+ D
288
289
  )) });
289
290
  }
290
291
  if (!n) return null;
291
292
  const _ = n.display ?? {};
292
293
  return /* @__PURE__ */ t("div", { className: w, children: /* @__PURE__ */ t(
293
- fe,
294
+ he,
294
295
  {
295
296
  label: s,
296
297
  value: n.value,
297
298
  display: _,
298
299
  dark: v,
299
300
  loading: !1,
300
- awaiting: f
301
+ awaiting: m
301
302
  }
302
303
  ) });
303
304
  }
304
- function Te({ data: n }) {
305
+ function De({ data: n }) {
305
306
  const s = n.values ?? [];
306
307
  return s.length === 0 ? /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "No values" }) : /* @__PURE__ */ t(
307
308
  "div",
308
309
  {
309
310
  className: "grid gap-3",
310
311
  style: { gridTemplateColumns: `repeat(${Math.min(s.length, 3)}, minmax(0, 1fr))` },
311
- children: s.map((o, l) => {
312
+ children: s.map((o, a) => {
312
313
  var w;
313
- const { prefix: c, suffix: f } = le(o.value, o.display), v = ((w = o.display) == null ? void 0 : w.format) ?? "";
314
- return /* @__PURE__ */ g("div", { className: "flex flex-col gap-0.5", children: [
314
+ const { prefix: c, suffix: m } = ae(o.value, o.display), v = ((w = o.display) == null ? void 0 : w.format) ?? "";
315
+ return /* @__PURE__ */ y("div", { className: "flex flex-col gap-0.5", children: [
315
316
  o.label && /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-slate-500", children: o.label }),
316
- /* @__PURE__ */ g("div", { className: "flex items-baseline gap-0.5", children: [
317
+ /* @__PURE__ */ y("div", { className: "flex items-baseline gap-0.5", children: [
317
318
  c && /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500", children: c }),
318
- /* @__PURE__ */ t("span", { className: "text-xl font-semibold text-slate-900 dark:text-slate-100", children: ae(o.value, v) }),
319
- f && /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500", children: f })
319
+ /* @__PURE__ */ t("span", { className: "text-xl font-semibold text-slate-900 dark:text-slate-100", children: ie(o.value, v) }),
320
+ m && /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500", children: m })
320
321
  ] })
321
- ] }, l);
322
+ ] }, a);
322
323
  })
323
324
  }
324
325
  );
325
326
  }
326
- function xr({ data: n }) {
327
+ function _r({ data: n }) {
327
328
  const s = n.rows ?? [], o = n.fields ?? [];
328
- return s.length === 0 ? /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "No items" }) : /* @__PURE__ */ t("div", { className: "overflow-x-auto", children: /* @__PURE__ */ g("table", { className: "w-full text-[12px]", children: [
329
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-slate-100", children: o.map((l) => /* @__PURE__ */ t("th", { className: "py-1 pr-3 text-left font-medium text-slate-500", children: l }, l)) }) }),
330
- /* @__PURE__ */ t("tbody", { children: s.map((l, c) => /* @__PURE__ */ t("tr", { className: "border-b border-slate-50", children: o.map((f) => /* @__PURE__ */ t("td", { className: "py-1 pr-3 text-slate-700", children: String(l[f] ?? "") }, f)) }, c)) })
329
+ return s.length === 0 ? /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "No items" }) : /* @__PURE__ */ t("div", { className: "overflow-x-auto", children: /* @__PURE__ */ y("table", { className: "w-full text-[12px]", children: [
330
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-slate-100", children: o.map((a) => /* @__PURE__ */ t("th", { className: "py-1 pr-3 text-left font-medium text-slate-500", children: a }, a)) }) }),
331
+ /* @__PURE__ */ t("tbody", { children: s.map((a, c) => /* @__PURE__ */ t("tr", { className: "border-b border-slate-50", children: o.map((m) => /* @__PURE__ */ t("td", { className: "py-1 pr-3 text-slate-700", children: String(a[m] ?? "") }, m)) }, c)) })
331
332
  ] }) });
332
333
  }
333
- function Oe({
334
+ function Ue({
334
335
  data: n,
335
336
  widgetId: s,
336
337
  inputs: o,
337
- apiBase: l,
338
+ apiBase: a,
338
339
  onAction: c
339
340
  }) {
340
- const f = n.buttons ?? [], [v, w] = M(null), _ = ge(), L = async ($) => {
341
+ const m = n.buttons ?? [], [v, w] = P(null), _ = xe(), R = async ($) => {
341
342
  w($);
342
343
  try {
343
- const N = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "", C = (await (await fetch(`${l}/widgets-internal/${s}/action`, {
344
+ const N = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "", C = (await (await fetch(`${a}/widgets-internal/${s}/action`, {
344
345
  method: "POST",
345
346
  headers: {
346
347
  "Content-Type": "application/json",
@@ -361,168 +362,168 @@ function Oe({
361
362
  w(null);
362
363
  }
363
364
  };
364
- return /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: f.map(($, N) => {
365
- const U = $.style ?? "secondary", D = "inline-flex items-center gap-1.5 rounded px-3 py-1.5 text-[12px] font-medium transition-colors disabled:opacity-50", C = U === "primary" ? `${D} bg-nvr-cyan text-white hover:bg-nvr-cyan/90` : U === "danger" ? `${D} bg-red-500 text-white hover:bg-red-600` : `${D} border border-slate-200 bg-white text-slate-700 hover:bg-slate-50`;
365
+ return /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: m.map(($, N) => {
366
+ const D = $.style ?? "secondary", q = "inline-flex items-center gap-1.5 rounded px-3 py-1.5 text-[12px] font-medium transition-colors disabled:opacity-50", C = D === "primary" ? `${q} bg-nvr-cyan text-white hover:bg-nvr-cyan/90` : D === "danger" ? `${q} bg-red-500 text-white hover:bg-red-600` : `${q} border border-slate-200 bg-white text-slate-700 hover:bg-slate-50`;
366
367
  return /* @__PURE__ */ t(
367
368
  "button",
368
369
  {
369
370
  type: "button",
370
371
  className: C,
371
372
  disabled: v !== null,
372
- onClick: () => L(N),
373
+ onClick: () => R(N),
373
374
  children: v === N ? "…" : String($.label ?? `Action ${N + 1}`)
374
375
  },
375
376
  N
376
377
  );
377
378
  }) });
378
379
  }
379
- const wr = /* @__PURE__ */ new Set(["navigate", "field-update", "flow", "toggle"]);
380
- function me({
380
+ const Nr = /* @__PURE__ */ new Set(["navigate", "field-update", "flow", "toggle"]);
381
+ function ge({
381
382
  buttons: n,
382
383
  layout: s,
383
384
  widgetId: o,
384
- inputs: l,
385
+ inputs: a,
385
386
  apiBase: c,
386
- onClientAction: f
387
+ onClientAction: m
387
388
  }) {
388
- const [v, w] = M(null), [_, L] = M(null), [$, N] = M({}), U = ne(null), D = ge();
389
+ const [v, w] = P(null), [_, R] = P(null), [$, N] = P({}), D = le(null), q = xe();
389
390
  function C(e) {
390
391
  return e === !0 || e === 1 ? "1" : e === !1 || e === 0 ? "0" : String(e ?? "");
391
392
  }
392
- function E(e, u) {
393
- const d = e.id ?? String(u);
394
- return $[d] !== void 0 ? $[d] : e.is_on !== void 0 ? e.is_on : C(l[e.toggle_input ?? ""]) === C(e.toggle_on_value ?? "1");
393
+ function E(e, p) {
394
+ const d = e.id ?? String(p);
395
+ return $[d] !== void 0 ? $[d] : e.is_on !== void 0 ? e.is_on : C(a[e.toggle_input ?? ""]) === C(e.toggle_on_value ?? "1");
395
396
  }
396
- function G(e, u) {
397
- if (e.action !== "toggle") return e.label ?? `Action ${u + 1}`;
398
- const d = e.action_config, m = e.toggle_input || (d == null ? void 0 : d.toggle_input) || (d == null ? void 0 : d.field) || "", O = m && m !== e.toggle_input ? { ...e, toggle_input: m } : e;
399
- return E(O, u) ? e.label_on || e.label || `Action ${u + 1}` : e.label_off || e.label || `Action ${u + 1}`;
397
+ function G(e, p) {
398
+ if (e.action !== "toggle") return e.label ?? `Action ${p + 1}`;
399
+ const d = e.action_config, f = e.toggle_input || (d == null ? void 0 : d.toggle_input) || (d == null ? void 0 : d.field) || "", j = f && f !== e.toggle_input ? { ...e, toggle_input: f } : e;
400
+ return E(j, p) ? e.label_on || e.label || `Action ${p + 1}` : e.label_off || e.label || `Action ${p + 1}`;
400
401
  }
401
- function ie(e) {
402
+ function se(e) {
402
403
  try {
403
404
  if (e.startsWith("/") && !e.startsWith("//")) return e;
404
- const u = new URL(e, window.location.origin);
405
- return ["http:", "https:"].includes(u.protocol) ? u.toString() : null;
405
+ const p = new URL(e, window.location.origin);
406
+ return ["http:", "https:"].includes(p.protocol) ? p.toString() : null;
406
407
  } catch {
407
408
  return null;
408
409
  }
409
410
  }
410
- async function r(e, u) {
411
- const d = e.id ?? String(u);
412
- L(d);
411
+ async function r(e, p) {
412
+ const d = e.id ?? String(p);
413
+ R(d);
413
414
  try {
414
- const m = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "", y = (await (await fetch(`${c}/widgets-internal/${o}/action`, {
415
+ const f = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "", x = (await (await fetch(`${c}/widgets-internal/${o}/action`, {
415
416
  method: "POST",
416
417
  headers: {
417
418
  "Content-Type": "application/json",
418
- ...D.authHeaders,
419
- ...m ? { "x-workspace": m } : {}
419
+ ...q.authHeaders,
420
+ ...f ? { "x-workspace": f } : {}
420
421
  },
421
- credentials: D.credentials,
422
- body: JSON.stringify({ button_index: u, inputs: l })
422
+ credentials: q.credentials,
423
+ body: JSON.stringify({ button_index: p, inputs: a })
423
424
  })).json()).data;
424
- if (y != null && y.redirect_url)
425
+ if (x != null && x.redirect_url)
425
426
  try {
426
- const R = new URL(y.redirect_url, window.location.origin);
427
- R.origin === window.location.origin && (window.location.href = R.toString());
427
+ const k = new URL(x.redirect_url, window.location.origin);
428
+ k.origin === window.location.origin && (window.location.href = k.toString());
428
429
  } catch {
429
430
  }
430
431
  } finally {
431
- L(null);
432
+ R(null);
432
433
  }
433
434
  }
434
- function V(e, u) {
435
+ function J(e, p) {
435
436
  const d = e.action ?? "open-url";
436
- if (wr.has(d)) {
437
+ if (Nr.has(d)) {
437
438
  if (d === "toggle") {
438
- const m = e.id ?? String(u);
439
- N((O) => ({ ...O, [m]: !E(e, u) }));
439
+ const f = e.id ?? String(p);
440
+ N((j) => ({ ...j, [f]: !E(e, p) }));
440
441
  }
441
- r(e, u);
442
+ r(e, p);
442
443
  return;
443
444
  }
444
445
  if (d === "open-url" && e.url) {
445
- const m = ie(e.url);
446
- if (!m) return;
447
- e.new_tab ? window.open(m, "_blank", "noopener,noreferrer") : window.location.href = m;
446
+ const f = se(e.url);
447
+ if (!f) return;
448
+ e.new_tab ? window.open(f, "_blank", "noopener,noreferrer") : window.location.href = f;
448
449
  } else if (d === "email") {
449
- const m = [];
450
- e.email_subject && m.push(`subject=${encodeURIComponent(e.email_subject)}`), e.email_body && m.push(`body=${encodeURIComponent(e.email_body)}`), window.location.href = `mailto:${e.email_to ?? ""}${m.length ? `?${m.join("&")}` : ""}`;
450
+ const f = [];
451
+ e.email_subject && f.push(`subject=${encodeURIComponent(e.email_subject)}`), e.email_body && f.push(`body=${encodeURIComponent(e.email_body)}`), window.location.href = `mailto:${e.email_to ?? ""}${f.length ? `?${f.join("&")}` : ""}`;
451
452
  } else if (d === "copy") {
452
- const m = e.copy_value ?? "";
453
- navigator.clipboard.writeText(m).then(() => {
454
- w(e.id ?? String(u)), U.current && clearTimeout(U.current), U.current = setTimeout(() => w(null), 1800);
453
+ const f = e.copy_value ?? "";
454
+ navigator.clipboard.writeText(f).then(() => {
455
+ w(e.id ?? String(p)), D.current && clearTimeout(D.current), D.current = setTimeout(() => w(null), 1800);
455
456
  });
456
- } else d === "open-sidebar" && e.sidebar_collection && e.sidebar_id && (f == null || f({
457
+ } else d === "open-sidebar" && e.sidebar_collection && e.sidebar_id && (m == null || m({
457
458
  type: "open-sidebar",
458
459
  collection: e.sidebar_collection,
459
460
  itemId: e.sidebar_id
460
461
  }));
461
462
  }
462
463
  function i(e) {
463
- const u = e.replace("#", "");
464
- if (u.length < 6) return !0;
465
- const d = parseInt(u.slice(0, 2), 16), m = parseInt(u.slice(2, 4), 16), O = parseInt(u.slice(4, 6), 16);
466
- return (d * 299 + m * 587 + O * 114) / 1e3 > 128;
464
+ const p = e.replace("#", "");
465
+ if (p.length < 6) return !0;
466
+ const d = parseInt(p.slice(0, 2), 16), f = parseInt(p.slice(2, 4), 16), j = parseInt(p.slice(4, 6), 16);
467
+ return (d * 299 + f * 587 + j * 114) / 1e3 > 128;
467
468
  }
468
- function se(e, u, d) {
469
- const m = e.id ?? String(u), O = v === m, A = _ === m;
470
- let y = e.label ?? "Button", R = e.variant ?? "secondary";
471
- const q = e.action_config, P = e.toggle_input || (q == null ? void 0 : q.toggle_input) || (q == null ? void 0 : q.field) || "";
469
+ function Y(e, p, d) {
470
+ const f = e.id ?? String(p), j = v === f, U = _ === f;
471
+ let x = e.label ?? "Button", k = e.variant ?? "secondary";
472
+ const W = e.action_config, A = e.toggle_input || (W == null ? void 0 : W.toggle_input) || (W == null ? void 0 : W.field) || "";
472
473
  if (e.action === "toggle") {
473
- const I = P && P !== e.toggle_input ? { ...e, toggle_input: P } : e, B = E(I, u);
474
- y = B ? e.label_on || y : e.label_off || y, R = B ? e.variant_on ?? R : e.variant_off ?? R;
474
+ const I = A && A !== e.toggle_input ? { ...e, toggle_input: A } : e, H = E(I, p);
475
+ x = H ? e.label_on || x : e.label_off || x, k = H ? e.variant_on ?? k : e.variant_off ?? k;
475
476
  }
476
- const H = e.icon ? Q[e.icon] : null, k = e.color ? {
477
+ const B = e.icon ? Q[e.icon] : null, L = e.color ? {
477
478
  backgroundColor: e.color,
478
479
  borderColor: e.color,
479
480
  color: i(e.color) ? "#1e293b" : "#ffffff"
480
481
  } : void 0;
481
- return /* @__PURE__ */ g(
482
- re,
482
+ return /* @__PURE__ */ y(
483
+ ne,
483
484
  {
484
485
  type: "button",
485
- variant: R,
486
+ variant: k,
486
487
  size: "sm",
487
488
  className: "h-7 gap-1.5 text-[12px]",
488
- style: k,
489
+ style: L,
489
490
  disabled: _ !== null,
490
- onClick: () => V(e, u),
491
+ onClick: () => J(e, p),
491
492
  children: [
492
- H && /* @__PURE__ */ t(H, { className: "h-3.5 w-3.5 shrink-0" }),
493
- A ? "…" : O ? "✓ Copied" : y
493
+ B && /* @__PURE__ */ t(B, { className: "h-3.5 w-3.5 shrink-0" }),
494
+ U ? "…" : j ? "✓ Copied" : x
494
495
  ]
495
496
  },
496
- m
497
+ f
497
498
  );
498
499
  }
499
500
  if (n.length === 0) return null;
500
501
  if (s === "split" && n.length > 1) {
501
- const [e, ...u] = n, d = e.id ?? "0", m = _ === d, O = e.action === "none" || !e.action;
502
- let A = e.label ?? "Button", y = e.variant ?? "default";
503
- const R = e.action_config, q = e.toggle_input || (R == null ? void 0 : R.toggle_input) || (R == null ? void 0 : R.field) || "";
504
- if (e.action === "toggle" && q) {
505
- const k = q !== e.toggle_input ? { ...e, toggle_input: q } : e, I = E(k, 0);
506
- A = I ? e.label_on || A : e.label_off || A, y = I ? e.variant_on ?? y : e.variant_off ?? y;
502
+ const [e, ...p] = n, d = e.id ?? "0", f = _ === d, j = e.action === "none" || !e.action;
503
+ let U = e.label ?? "Button", x = e.variant ?? "default";
504
+ const k = e.action_config, W = e.toggle_input || (k == null ? void 0 : k.toggle_input) || (k == null ? void 0 : k.field) || "";
505
+ if (e.action === "toggle" && W) {
506
+ const L = W !== e.toggle_input ? { ...e, toggle_input: W } : e, I = E(L, 0);
507
+ U = I ? e.label_on || U : e.label_off || U, x = I ? e.variant_on ?? x : e.variant_off ?? x;
507
508
  }
508
- const P = e.icon ? Q[e.icon] : null, H = e.color ? {
509
+ const A = e.icon ? Q[e.icon] : null, B = e.color ? {
509
510
  backgroundColor: e.color,
510
511
  borderColor: e.color,
511
512
  color: i(e.color) ? "#1e293b" : "#ffffff"
512
513
  } : void 0;
513
- return O ? /* @__PURE__ */ t("div", { className: "flex items-center", children: /* @__PURE__ */ g(Ce, { children: [
514
- /* @__PURE__ */ t(Ee, { asChild: !0, children: /* @__PURE__ */ g(
515
- re,
514
+ return j ? /* @__PURE__ */ t("div", { className: "flex items-center", children: /* @__PURE__ */ y(Te, { children: [
515
+ /* @__PURE__ */ t(Ie, { asChild: !0, children: /* @__PURE__ */ y(
516
+ ne,
516
517
  {
517
518
  type: "button",
518
- variant: y,
519
+ variant: x,
519
520
  size: "sm",
520
521
  className: "h-7 gap-1.5 text-[12px]",
521
- style: H,
522
+ style: B,
522
523
  disabled: _ !== null,
523
524
  children: [
524
- P && /* @__PURE__ */ t(P, { className: "h-3.5 w-3.5 shrink-0" }),
525
- A,
525
+ A && /* @__PURE__ */ t(A, { className: "h-3.5 w-3.5 shrink-0" }),
526
+ U,
526
527
  /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ t(
527
528
  "path",
528
529
  {
@@ -536,47 +537,47 @@ function me({
536
537
  ]
537
538
  }
538
539
  ) }),
539
- /* @__PURE__ */ t(je, { align: "end", className: "min-w-[140px]", children: u.map((k, I) => /* @__PURE__ */ g(
540
- Ie,
540
+ /* @__PURE__ */ t(Oe, { align: "end", className: "min-w-[140px]", children: p.map((L, I) => /* @__PURE__ */ y(
541
+ qe,
541
542
  {
542
543
  className: "cursor-pointer text-[12px]",
543
- onSelect: () => V(k, I + 1),
544
+ onSelect: () => J(L, I + 1),
544
545
  children: [
545
- k.icon && Q[k.icon] && (() => {
546
- const B = Q[k.icon];
547
- return /* @__PURE__ */ t(B, { className: "mr-1.5 h-3.5 w-3.5 shrink-0" });
546
+ L.icon && Q[L.icon] && (() => {
547
+ const H = Q[L.icon];
548
+ return /* @__PURE__ */ t(H, { className: "mr-1.5 h-3.5 w-3.5 shrink-0" });
548
549
  })(),
549
- G(k, I + 1)
550
+ G(L, I + 1)
550
551
  ]
551
552
  },
552
- k.id ?? I
553
+ L.id ?? I
553
554
  )) })
554
- ] }) }) : /* @__PURE__ */ g("div", { className: "flex items-center", children: [
555
- /* @__PURE__ */ g(
556
- re,
555
+ ] }) }) : /* @__PURE__ */ y("div", { className: "flex items-center", children: [
556
+ /* @__PURE__ */ y(
557
+ ne,
557
558
  {
558
559
  type: "button",
559
- variant: y,
560
+ variant: x,
560
561
  size: "sm",
561
562
  className: "h-7 rounded-r-none text-[12px] gap-1.5 border-r-0",
562
- style: H,
563
+ style: B,
563
564
  disabled: _ !== null,
564
- onClick: () => V(e, 0),
565
+ onClick: () => J(e, 0),
565
566
  children: [
566
- P && /* @__PURE__ */ t(P, { className: "h-3.5 w-3.5 shrink-0" }),
567
- m ? "…" : v === d ? "✓ Copied" : A
567
+ A && /* @__PURE__ */ t(A, { className: "h-3.5 w-3.5 shrink-0" }),
568
+ f ? "…" : v === d ? "✓ Copied" : U
568
569
  ]
569
570
  }
570
571
  ),
571
- /* @__PURE__ */ g(Ce, { children: [
572
- /* @__PURE__ */ t(Ee, { asChild: !0, children: /* @__PURE__ */ t(
573
- re,
572
+ /* @__PURE__ */ y(Te, { children: [
573
+ /* @__PURE__ */ t(Ie, { asChild: !0, children: /* @__PURE__ */ t(
574
+ ne,
574
575
  {
575
576
  type: "button",
576
- variant: y,
577
+ variant: x,
577
578
  size: "sm",
578
579
  className: "h-7 rounded-l-none px-1.5 text-[12px]",
579
- style: H,
580
+ style: B,
580
581
  disabled: _ !== null,
581
582
  "aria-label": "More actions",
582
583
  children: /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ t(
@@ -591,259 +592,259 @@ function me({
591
592
  ) })
592
593
  }
593
594
  ) }),
594
- /* @__PURE__ */ t(je, { align: "end", className: "min-w-[140px]", children: u.map((k, I) => /* @__PURE__ */ g(
595
- Ie,
595
+ /* @__PURE__ */ t(Oe, { align: "end", className: "min-w-[140px]", children: p.map((L, I) => /* @__PURE__ */ y(
596
+ qe,
596
597
  {
597
598
  className: "text-[12px]",
598
- onSelect: () => V(k, I + 1),
599
+ onSelect: () => J(L, I + 1),
599
600
  children: [
600
- k.icon && Q[k.icon] && (() => {
601
- const B = Q[k.icon];
602
- return /* @__PURE__ */ t(B, { className: "mr-1.5 h-3.5 w-3.5 shrink-0" });
601
+ L.icon && Q[L.icon] && (() => {
602
+ const H = Q[L.icon];
603
+ return /* @__PURE__ */ t(H, { className: "mr-1.5 h-3.5 w-3.5 shrink-0" });
603
604
  })(),
604
- G(k, I + 1)
605
+ G(L, I + 1)
605
606
  ]
606
607
  },
607
- k.id ?? I
608
+ L.id ?? I
608
609
  )) })
609
610
  ] })
610
611
  ] });
611
612
  }
612
- return /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: n.map((e, u) => se(e, u)) });
613
+ return /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: n.map((e, p) => Y(e, p)) });
613
614
  }
614
- function Ar({
615
+ function Br({
615
616
  widgetId: n,
616
617
  inputBindings: s = [],
617
618
  itemDraft: o = {},
618
- itemCollection: l,
619
+ itemCollection: a,
619
620
  ready: c = !0,
620
- label: f,
621
+ label: m,
621
622
  defaultExpanded: v = !0,
622
623
  frameless: w = !1,
623
624
  apiBase: _,
624
- compact: L = !1,
625
+ compact: R = !1,
625
626
  strip: $ = !1,
626
627
  onClientAction: N,
627
- onWidgetType: U,
628
- onContentChange: D
628
+ onWidgetType: D,
629
+ onContentChange: q
629
630
  }) {
630
- var Le, Re;
631
- const C = ge(), E = _ ?? C.apiBase, [G, ie] = M(v), [r, V] = M(null), [i, se] = M(null), [e, u] = M(!0), [d, m] = M(!0), [O, A] = M(!0), [y, R] = M(null), [q, P] = M(0), H = ne(!1), k = Kt(() => {
632
- H.current = !0, P((a) => a + 1);
633
- }, []), I = ne(null), B = ne(!1), xe = Pe();
634
- te(() => {
635
- const a = r == null ? void 0 : r.widget_type;
636
- if (a !== "rollup" && a !== "review_list" && a !== "custom-query") return;
637
- let p = null;
638
- const x = xe.getQueryCache().subscribe((S) => {
631
+ var Ce, Ee;
632
+ const C = xe(), E = _ ?? C.apiBase, [G, se] = P(v), [r, J] = P(null), [i, Y] = P(null), [e, p] = P(!0), [d, f] = P(!0), [j, U] = P(!0), [x, k] = P(null), [W, A] = P(0), [B, L] = P(null), I = le(!1), H = Xt(() => {
633
+ I.current = !0, A((l) => l + 1);
634
+ }, []), oe = le(null), ce = le(!1), be = Be();
635
+ re(() => {
636
+ const l = r == null ? void 0 : r.widget_type;
637
+ if (l !== "rollup" && l !== "review_list" && l !== "custom-query") return;
638
+ let u = null;
639
+ const g = be.getQueryCache().subscribe((S) => {
639
640
  var K;
640
641
  if (S.type !== "updated" || ((K = S.action) == null ? void 0 : K.type) !== "success") return;
641
- const b = S.query.queryKey, j = b == null ? void 0 : b[0];
642
- typeof j == "string" && (!j.startsWith("o2m-rows") && !j.startsWith("nested") && j !== "match-agg" && j !== "m2m-items" || S.query.state.dataUpdateCount <= 1 || j.startsWith("o2m-rows") && I.current != null && String(b[3]) !== String(I.current) || (p && clearTimeout(p), p = setTimeout(() => P((ee) => ee + 1), 400)));
642
+ const b = S.query.queryKey, T = b == null ? void 0 : b[0];
643
+ typeof T == "string" && (!T.startsWith("o2m-rows") && !T.startsWith("nested") && T !== "match-agg" && T !== "m2m-items" || S.query.state.dataUpdateCount <= 1 || T.startsWith("o2m-rows") && oe.current != null && String(b[3]) !== String(oe.current) || (u && clearTimeout(u), u = setTimeout(() => A((te) => te + 1), 400)));
643
644
  });
644
645
  return () => {
645
- p && clearTimeout(p), x();
646
+ u && clearTimeout(u), g();
646
647
  };
647
- }, [xe, r == null ? void 0 : r.widget_type]);
648
- const we = {};
649
- for (const [a, p] of Object.entries(o))
650
- a.includes(".") || (p == null || typeof p != "object") && (we[a] = p);
651
- const T = { ...we, ...gr(s, o) }, oe = or(), F = $e(() => {
652
- if ((r == null ? void 0 : r.widget_type) !== "rollup" || !oe) return null;
653
- const a = r.config, p = a == null ? void 0 : a.collection;
654
- if (!p) return null;
655
- const x = {
648
+ }, [be, r == null ? void 0 : r.widget_type]);
649
+ const ve = {};
650
+ for (const [l, u] of Object.entries(o))
651
+ l.includes(".") || (u == null || typeof u != "object") && (ve[l] = u);
652
+ const O = { ...ve, ...br(s, o) }, de = pr(), F = je(() => {
653
+ if ((r == null ? void 0 : r.widget_type) !== "rollup" || !de) return null;
654
+ const l = r.config, u = l == null ? void 0 : l.collection;
655
+ if (!u) return null;
656
+ const g = {
656
657
  created: [],
657
658
  updated: [],
658
659
  deleted: []
659
660
  };
660
- for (const S of oe.byGrid.values()) {
661
- const b = S[p];
662
- b && (x.created.push(...b.created), x.updated.push(...b.updated), x.deleted.push(...b.deleted));
661
+ for (const S of de.byGrid.values()) {
662
+ const b = S[u];
663
+ b && (g.created.push(...b.created), g.updated.push(...b.updated), g.deleted.push(...b.deleted));
663
664
  }
664
- return !x.created.length && !x.updated.length && !x.deleted.length ? null : x;
665
- }, [r, oe]), Ue = $e(
665
+ return !g.created.length && !g.updated.length && !g.deleted.length ? null : g;
666
+ }, [r, de]), Pe = je(
666
667
  () => F ? JSON.stringify(F) : "",
667
668
  [F]
668
- ), h = (Le = r == null ? void 0 : r.config) == null ? void 0 : Le.drilldown, X = Qt(), ce = h != null && h.id_input ? T[h.id_input] : null, de = !!X && !!(h != null && h.collection) && ce != null && ce !== "", be = async () => {
669
+ ), h = (Ce = r == null ? void 0 : r.config) == null ? void 0 : Ce.drilldown, Z = Yt(), ue = h != null && h.id_input ? O[h.id_input] : null, pe = !!Z && !!(h != null && h.collection) && ue != null && ue !== "", _e = async () => {
669
670
  var S, b;
670
- if (!de || !(h != null && h.collection)) return;
671
- const a = String(ce);
672
- let p = null;
673
- const x = (j) => fetch(`${E}${j}`, {
671
+ if (!pe || !(h != null && h.collection)) return;
672
+ const l = String(ue);
673
+ let u = null;
674
+ const g = (T) => fetch(`${E}${T}`, {
674
675
  credentials: C.credentials,
675
676
  headers: C.authHeaders
676
677
  });
677
678
  try {
678
679
  if (h.match_field) {
679
- const j = await x(
680
+ const T = await g(
680
681
  `/items/${h.collection}?filter=${encodeURIComponent(
681
- JSON.stringify({ [h.match_field]: { _eq: a } })
682
+ JSON.stringify({ [h.match_field]: { _eq: l } })
682
683
  )}&fields=id&limit=1`
683
684
  );
684
- if (j.ok) {
685
- const K = await j.json(), ee = (b = (S = K == null ? void 0 : K.data) == null ? void 0 : S[0]) == null ? void 0 : b.id;
686
- ee != null && (p = String(ee));
685
+ if (T.ok) {
686
+ const K = await T.json(), te = (b = (S = K == null ? void 0 : K.data) == null ? void 0 : S[0]) == null ? void 0 : b.id;
687
+ te != null && (u = String(te));
687
688
  }
688
689
  }
689
- p == null && (await x(`/items/${h.collection}/${encodeURIComponent(a)}?fields=id`)).ok && (p = a);
690
+ u == null && (await g(`/items/${h.collection}/${encodeURIComponent(l)}?fields=id`)).ok && (u = l);
690
691
  } catch {
691
692
  return;
692
693
  }
693
- p != null && (X == null || X.open({
694
+ u != null && (Z == null || Z.open({
694
695
  collection: h.collection,
695
- itemId: p,
696
+ itemId: u,
696
697
  layoutId: h.layout_id ?? null,
697
698
  width: h.width ?? "75%",
698
699
  title: h.title
699
700
  }));
700
701
  };
701
- if (T.record_id == null || T.record_id === "") {
702
- const a = o.id;
703
- a != null && a !== "" && (T.record_id = a);
702
+ if (O.record_id == null || O.record_id === "") {
703
+ const l = o.id;
704
+ l != null && l !== "" && (O.record_id = l);
704
705
  }
705
- I.current = o.id ?? null;
706
- const Ae = JSON.stringify(T) + (l ?? "") + Ue, qe = Xt(Ae, 400);
707
- function ve() {
708
- const a = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "";
706
+ oe.current = o.id ?? null;
707
+ const We = JSON.stringify(O) + (a ?? "") + Pe, Me = er(We, 400);
708
+ function Ne() {
709
+ const l = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "";
709
710
  return {
710
711
  "Content-Type": "application/json",
711
712
  ...C.authHeaders,
712
- ...a ? { "x-workspace": a } : {}
713
+ ...l ? { "x-workspace": l } : {}
713
714
  };
714
715
  }
715
- const Y = Gt(), J = We({
716
+ const X = Zt(), z = He({
716
717
  queryKey: ["nvr-widget-def", n],
717
718
  enabled: c,
718
719
  staleTime: 6e4,
719
720
  retry: !1,
720
721
  queryFn: async () => {
721
- if (Y)
722
- return (await Y.request(Yt(`/widgets-internal/${n}`))).data;
723
- const a = await fetch(`${E}/widgets-internal/${n}`, {
722
+ if (X)
723
+ return (await X.request(tr(`/widgets-internal/${n}`))).data;
724
+ const l = await fetch(`${E}/widgets-internal/${n}`, {
724
725
  credentials: C.credentials,
725
- headers: ve()
726
+ headers: Ne()
726
727
  });
727
- if (!a.ok) throw new Error("Widget not found");
728
- return (await a.json()).data;
728
+ if (!l.ok) throw new Error("Widget not found");
729
+ return (await l.json()).data;
729
730
  }
730
731
  });
731
- te(() => {
732
- c && (J.data ? (V(J.data), u(!1), R(null), U == null || U(J.data.widget_type)) : J.error && R("Widget not found"));
733
- }, [c, J.data, J.error]), te(() => {
732
+ re(() => {
733
+ c && (z.data ? (J(z.data), p(!1), k(null), D == null || D(z.data.widget_type)) : z.error && k("Widget not found"));
734
+ }, [c, z.data, z.error]), re(() => {
734
735
  if (!c || !r) return;
735
- const a = T.record_id == null || T.record_id === "";
736
- if (r.widget_type === "review_list" && a || r.widget_type === "rollup" && a && !F) return;
737
- let p = !1;
738
- return B.current || (m(!0), A(!0)), (async () => {
736
+ const l = O.record_id == null || O.record_id === "";
737
+ if (r.widget_type === "review_list" && l || r.widget_type === "rollup" && l && !F) return;
738
+ let u = !1;
739
+ return ce.current || (f(!0), U(!0)), (async () => {
739
740
  try {
740
- const x = {
741
- inputs: F ? { ...T, staged: F } : T,
741
+ const g = {
742
+ inputs: F ? { ...O, staged: F } : O,
742
743
  draft: o,
743
744
  bindings: s,
744
- item_collection: l
745
+ item_collection: a
745
746
  };
746
- H.current && (x.refresh = !0, H.current = !1);
747
+ I.current && (g.refresh = !0, I.current = !1), L(g);
747
748
  let S;
748
- if (Y)
749
- S = await Y.request(
750
- Zt(`/widgets-internal/${n}/render`, x)
749
+ if (X)
750
+ S = await X.request(
751
+ rr(`/widgets-internal/${n}/render`, g)
751
752
  );
752
753
  else {
753
754
  const b = await fetch(`${E}/widgets-internal/${n}/render`, {
754
755
  method: "POST",
755
756
  credentials: C.credentials,
756
- headers: ve(),
757
- body: JSON.stringify(x)
757
+ headers: Ne(),
758
+ body: JSON.stringify(g)
758
759
  });
759
760
  if (!b.ok) throw new Error("Render failed");
760
761
  S = await b.json();
761
762
  }
762
- if (p) return;
763
- p || (B.current = !0, se(S.data), m(!1), R(null));
764
- } catch (x) {
765
- p || R(String(x));
763
+ if (u) return;
764
+ u || (ce.current = !0, Y(S.data), f(!1), k(null));
765
+ } catch (g) {
766
+ u || k(String(g));
766
767
  } finally {
767
- p || A(!1);
768
+ u || U(!1);
768
769
  }
769
770
  })(), () => {
770
- p = !0;
771
+ u = !0;
771
772
  };
772
- }, [n, E, qe, c, q, r == null ? void 0 : r.widget_type]), te(() => {
773
- if (D) {
774
- if (y) {
775
- D(!0);
773
+ }, [n, E, Me, c, W, r == null ? void 0 : r.widget_type]), re(() => {
774
+ if (q) {
775
+ if (x) {
776
+ q(!0);
776
777
  return;
777
778
  }
778
779
  if (i) {
779
780
  if ((r == null ? void 0 : r.widget_type) === "review_list" || (r == null ? void 0 : r.widget_type) === "rollup") {
780
- const a = i.rows;
781
- D(Array.isArray(a) && a.length > 0);
781
+ const l = i.rows;
782
+ q(Array.isArray(l) && l.length > 0);
782
783
  return;
783
784
  }
784
785
  if ((r == null ? void 0 : r.widget_type) === "custom-query" && "rows" in i) {
785
- const a = i.rows;
786
- D(Array.isArray(a) && a.length > 0);
786
+ const l = i.rows;
787
+ q(Array.isArray(l) && l.length > 0);
787
788
  return;
788
789
  }
789
- D(!0);
790
+ q(!0);
790
791
  }
791
792
  }
792
- }, [i, y, r == null ? void 0 : r.widget_type, D]);
793
- const z = f || (r == null ? void 0 : r.name) || "", Z = (r == null ? void 0 : r.widget_type) === "report_widget" && i ? dr(i) : i, W = (() => {
794
- const a = i == null ? void 0 : i.awaiting;
795
- if (!Array.isArray(a) || a.length === 0) return null;
796
- const p = a.map((x) => {
797
- const S = s.find((j) => j.key === x && j.binding_type === "item_field");
798
- return String((S == null ? void 0 : S.binding_value) ?? x).split(".")[0].replace(/_id$/, "").replace(/_/g, " ").replace(/^\w/, (j) => j.toUpperCase());
793
+ }, [i, x, r == null ? void 0 : r.widget_type, q]);
794
+ const V = m || (r == null ? void 0 : r.name) || "", ee = (r == null ? void 0 : r.widget_type) === "report_widget" && i ? mr(i) : i, M = (() => {
795
+ const l = i == null ? void 0 : i.awaiting;
796
+ if (!Array.isArray(l) || l.length === 0) return null;
797
+ const u = l.map((g) => {
798
+ const S = s.find((T) => T.key === g && T.binding_type === "item_field");
799
+ return String((S == null ? void 0 : S.binding_value) ?? g).split(".")[0].replace(/_id$/, "").replace(/_/g, " ").replace(/^\w/, (T) => T.toUpperCase());
799
800
  });
800
- return [...new Set(p)].join(", ");
801
- })(), _e = T.record_id, Ne = _e == null || _e === "";
802
- if ((r == null ? void 0 : r.widget_type) === "review_list" && Ne || (r == null ? void 0 : r.widget_type) === "rollup" && Ne && !F) return null;
803
- if (L) {
804
- const a = ((Re = r == null ? void 0 : r.config) == null ? void 0 : Re.compact_style) ?? "default", p = a === "pill-dark" || a === "pill-light";
805
- if (y)
806
- return /* @__PURE__ */ t("span", { className: "text-[11px] text-red-400", title: y, children: "!" });
801
+ return [...new Set(u)].join(", ");
802
+ })(), ke = O.record_id, Se = ke == null || ke === "";
803
+ if ((r == null ? void 0 : r.widget_type) === "review_list" && Se || (r == null ? void 0 : r.widget_type) === "rollup" && Se && !F) return null;
804
+ if (R) {
805
+ const l = ((Ee = r == null ? void 0 : r.config) == null ? void 0 : Ee.compact_style) ?? "default", u = l === "pill-dark" || l === "pill-light";
806
+ if (x)
807
+ return /* @__PURE__ */ t("span", { className: "text-[11px] text-red-400", title: x, children: "!" });
807
808
  if ($) {
808
809
  if (e)
809
- return /* @__PURE__ */ g("div", { className: "flex h-full w-36 flex-col justify-center px-4 py-2.5", children: [
810
+ return /* @__PURE__ */ y("div", { className: "flex h-full w-36 flex-col justify-center px-4 py-2.5", children: [
810
811
  /* @__PURE__ */ t("span", { className: "animate-pulse h-2 w-10 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] mb-1" }),
811
812
  /* @__PURE__ */ t("span", { className: "animate-pulse h-3.5 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" })
812
813
  ] });
813
814
  if (r.widget_type === "button-group")
814
815
  return /* @__PURE__ */ t("div", { className: "h-full flex items-center px-3", children: d ? /* @__PURE__ */ t("div", { className: "animate-pulse h-7 w-24 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : i && /* @__PURE__ */ t(
815
- me,
816
+ ge,
816
817
  {
817
818
  buttons: i.buttons ?? [],
818
819
  layout: i.layout ?? "flat",
819
820
  widgetId: n,
820
- inputs: T,
821
+ inputs: O,
821
822
  apiBase: E,
822
823
  onClientAction: N
823
824
  }
824
825
  ) });
825
826
  {
826
- const x = /* @__PURE__ */ t(
827
- mr,
827
+ const g = /* @__PURE__ */ t(
828
+ xr,
828
829
  {
829
- data: d ? null : Z ?? null,
830
- label: f || r.name,
830
+ data: d ? null : ee ?? null,
831
+ label: m || r.name,
831
832
  loading: d,
832
833
  widgetConfig: r.config,
833
- awaiting: W
834
+ awaiting: M
834
835
  }
835
- ), S = de ? /* @__PURE__ */ t(
836
+ ), S = pe ? /* @__PURE__ */ t(
836
837
  "button",
837
838
  {
838
839
  type: "button",
839
- onClick: () => void be(),
840
+ onClick: () => void _e(),
840
841
  title: (h == null ? void 0 : h.title) ?? "Open details",
841
842
  className: "h-full w-full cursor-pointer text-left transition-colors hover:bg-nvr-cyan/5",
842
843
  "data-nvr-widget-drill": h == null ? void 0 : h.collection,
843
- children: x
844
+ children: g
844
845
  }
845
- ) : x, b = i == null ? void 0 : i.cache;
846
- return b != null && b.cache_ttl ? /* @__PURE__ */ g(
846
+ ) : g, b = i == null ? void 0 : i.cache;
847
+ return b != null && b.cache_ttl ? /* @__PURE__ */ y(
847
848
  "div",
848
849
  {
849
850
  className: "group/cache relative h-full w-full",
@@ -854,13 +855,13 @@ function Ar({
854
855
  "button",
855
856
  {
856
857
  type: "button",
857
- onClick: k,
858
+ onClick: H,
858
859
  disabled: d,
859
860
  "data-cache-refresh": !0,
860
861
  "aria-label": "Refresh this figure",
861
- "data-tip": ir(b),
862
+ "data-tip": dr(b),
862
863
  className: "absolute bottom-1 right-1 rounded p-0.5 text-muted-foreground opacity-0 transition-opacity hover:bg-muted group-hover/cache:opacity-100 focus-visible:opacity-100 disabled:opacity-50",
863
- children: /* @__PURE__ */ t(De, { className: `h-3 w-3 ${d ? "animate-spin" : ""}` })
864
+ children: /* @__PURE__ */ t(Ae, { className: `h-3 w-3 ${d ? "animate-spin" : ""}` })
864
865
  }
865
866
  )
866
867
  ]
@@ -868,171 +869,186 @@ function Ar({
868
869
  ) : S;
869
870
  }
870
871
  }
871
- if (p) {
872
+ if (u) {
872
873
  if (e)
873
874
  return /* @__PURE__ */ t(
874
875
  "div",
875
876
  {
876
- className: `animate-pulse h-8 w-36 rounded-md ${a === "pill-dark" ? "bg-slate-700 border border-slate-700" : "bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))] border border-slate-200"}`
877
+ className: `animate-pulse h-8 w-36 rounded-md ${l === "pill-dark" ? "bg-slate-700 border border-slate-700" : "bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))] border border-slate-200"}`
877
878
  }
878
879
  );
879
880
  {
880
- const x = /* @__PURE__ */ t(
881
- yr,
881
+ const g = /* @__PURE__ */ t(
882
+ vr,
882
883
  {
883
- data: d ? null : Z ?? null,
884
- label: f || r.name,
885
- style: a,
884
+ data: d ? null : ee ?? null,
885
+ label: m || r.name,
886
+ style: l,
886
887
  loading: d,
887
888
  widgetConfig: r.config,
888
- awaiting: W
889
+ awaiting: M
889
890
  }
890
891
  );
891
- return de ? /* @__PURE__ */ t(
892
+ return pe ? /* @__PURE__ */ t(
892
893
  "button",
893
894
  {
894
895
  type: "button",
895
- onClick: () => void be(),
896
+ onClick: () => void _e(),
896
897
  title: (h == null ? void 0 : h.title) ?? "Open details",
897
898
  className: "cursor-pointer text-left",
898
899
  "data-nvr-widget-drill": h == null ? void 0 : h.collection,
899
- children: x
900
+ children: g
900
901
  }
901
- ) : x;
902
+ ) : g;
902
903
  }
903
904
  }
904
- return e ? /* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: d ? /* @__PURE__ */ t("div", { className: "flex items-baseline gap-1", children: /* @__PURE__ */ t("div", { className: "animate-pulse h-5 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) }) : i && r && /* @__PURE__ */ g(he, { children: [
905
- (r.widget_type === "stat" || r.widget_type === "custom-query" && "value" in i) && /* @__PURE__ */ t(pe, { data: i, awaiting: W }),
906
- r.widget_type === "report_widget" && Z && /* @__PURE__ */ t(pe, { data: Z, awaiting: W }),
907
- r.widget_type === "custom-query" && "values" in i && /* @__PURE__ */ t(Te, { data: i }),
905
+ return e ? /* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: d ? /* @__PURE__ */ t("div", { className: "flex items-baseline gap-1", children: /* @__PURE__ */ t("div", { className: "animate-pulse h-5 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) }) : i && r && /* @__PURE__ */ y(ye, { children: [
906
+ (r.widget_type === "stat" || r.widget_type === "custom-query" && "value" in i) && /* @__PURE__ */ t(me, { data: i, awaiting: M }),
907
+ r.widget_type === "report_widget" && ee && /* @__PURE__ */ t(me, { data: ee, awaiting: M }),
908
+ r.widget_type === "custom-query" && "values" in i && /* @__PURE__ */ t(De, { data: i }),
908
909
  r.widget_type === "action-buttons" && /* @__PURE__ */ t(
909
- Oe,
910
+ Ue,
910
911
  {
911
912
  data: i,
912
913
  widgetId: n,
913
- inputs: T,
914
+ inputs: O,
914
915
  apiBase: E
915
916
  }
916
917
  ),
917
918
  r.widget_type === "button-group" && /* @__PURE__ */ t(
918
- me,
919
+ ge,
919
920
  {
920
921
  buttons: i.buttons ?? [],
921
922
  layout: i.layout ?? "flat",
922
923
  widgetId: n,
923
- inputs: T,
924
+ inputs: O,
924
925
  apiBase: E,
925
926
  onClientAction: N
926
927
  }
927
928
  )
928
929
  ] }) });
929
930
  }
930
- const ke = /* @__PURE__ */ g("div", { className: "space-y-2 py-0.5", children: [
931
+ const Re = /* @__PURE__ */ y("div", { className: "space-y-2 py-0.5", children: [
931
932
  /* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-2/3 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
932
933
  /* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-full rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
933
934
  /* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-5/6 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" })
934
- ] });
935
+ ] }), Le = X ? /* @__PURE__ */ t(
936
+ cr,
937
+ {
938
+ className: "mt-2",
939
+ pending: d && !!r,
940
+ request: B ? { method: "POST", url: `/widgets-internal/${n}/render`, body: B } : null,
941
+ label: V || "Widget",
942
+ onResult: (l) => {
943
+ const u = l == null ? void 0 : l.data;
944
+ u && (ce.current = !0, Y(u), f(!1), U(!1), k(null));
945
+ },
946
+ onGone: () => A((l) => l + 1)
947
+ }
948
+ ) : null;
935
949
  if (w)
936
- return /* @__PURE__ */ g("div", { children: [
937
- O && ke,
938
- y && /* @__PURE__ */ t("p", { className: "text-[12px] text-red-500", children: y }),
939
- !O && !y && i && r && Se()
950
+ return /* @__PURE__ */ y("div", { children: [
951
+ j && Re,
952
+ j && Le,
953
+ x && /* @__PURE__ */ t("p", { className: "text-[12px] text-red-500", children: x }),
954
+ !j && !x && i && r && $e()
940
955
  ] });
941
- return /* @__PURE__ */ g("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
942
- /* @__PURE__ */ g(
956
+ return /* @__PURE__ */ y("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
957
+ /* @__PURE__ */ y(
943
958
  "button",
944
959
  {
945
960
  type: "button",
946
961
  className: "flex w-full items-center justify-between px-4 py-3 text-left",
947
- onClick: () => ie((a) => !a),
962
+ onClick: () => se((l) => !l),
948
963
  children: [
949
- /* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: z || /* @__PURE__ */ t("span", { className: "inline-block h-3 w-28 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))] align-middle" }) }),
964
+ /* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: V || /* @__PURE__ */ t("span", { className: "inline-block h-3 w-28 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))] align-middle" }) }),
950
965
  /* @__PURE__ */ t("span", { className: `text-slate-400 transition-transform ${G ? "rotate-90" : ""}`, children: "›" })
951
966
  ]
952
967
  }
953
968
  ),
954
- G && /* @__PURE__ */ g("div", { className: "border-t border-slate-100 px-4 py-3 dark:border-border", children: [
955
- O && ke,
956
- y && /* @__PURE__ */ t("p", { className: "text-[12px] text-red-500", children: y }),
957
- !O && !y && i && r && Se()
969
+ G && /* @__PURE__ */ y("div", { className: "border-t border-slate-100 px-4 py-3 dark:border-border", children: [
970
+ j && Re,
971
+ j && Le,
972
+ x && /* @__PURE__ */ t("p", { className: "text-[12px] text-red-500", children: x }),
973
+ !j && !x && i && r && $e()
958
974
  ] })
959
975
  ] });
960
- function Se() {
961
- var a;
962
- return !i || !r ? null : /* @__PURE__ */ g(he, { children: [
963
- (r.widget_type === "stat" || r.widget_type === "custom-query" && "value" in i) && /* @__PURE__ */ t(pe, { data: i, awaiting: W }),
964
- r.widget_type === "custom-query" && "values" in i && (W ? /* @__PURE__ */ g(
976
+ function $e() {
977
+ var l;
978
+ return !i || !r ? null : /* @__PURE__ */ y(ye, { children: [
979
+ (r.widget_type === "stat" || r.widget_type === "custom-query" && "value" in i) && /* @__PURE__ */ t(me, { data: i, awaiting: M }),
980
+ r.widget_type === "custom-query" && "values" in i && (M ? /* @__PURE__ */ y(
965
981
  "p",
966
982
  {
967
983
  className: "text-[12px] text-slate-500 dark:text-slate-400",
968
- "data-widget-awaiting": W,
984
+ "data-widget-awaiting": M,
969
985
  children: [
970
986
  "Set ",
971
- W,
987
+ M,
972
988
  " on this record to see ",
973
- z || "this",
989
+ V || "this",
974
990
  "."
975
991
  ]
976
992
  }
977
- ) : /* @__PURE__ */ t(Te, { data: i })),
978
- r.widget_type === "list" && /* @__PURE__ */ t(xr, { data: i }),
979
- W && r.widget_type === "custom-query" && "rows" in i && /* @__PURE__ */ g(
993
+ ) : /* @__PURE__ */ t(De, { data: i })),
994
+ r.widget_type === "list" && /* @__PURE__ */ t(_r, { data: i }),
995
+ M && r.widget_type === "custom-query" && "rows" in i && /* @__PURE__ */ y(
980
996
  "p",
981
997
  {
982
998
  className: "text-[12px] text-slate-500 dark:text-slate-400",
983
- "data-widget-awaiting": W,
999
+ "data-widget-awaiting": M,
984
1000
  children: [
985
1001
  "Set ",
986
- W,
1002
+ M,
987
1003
  " on this record to see ",
988
- z || "this",
1004
+ V || "this",
989
1005
  "."
990
1006
  ]
991
1007
  }
992
1008
  ),
993
- !W && r.widget_type === "custom-query" && "rows" in i && /* @__PURE__ */ t(
994
- cr,
1009
+ !M && r.widget_type === "custom-query" && "rows" in i && /* @__PURE__ */ t(
1010
+ fr,
995
1011
  {
996
1012
  rows: i.rows ?? [],
997
- config: (a = r.config) == null ? void 0 : a.table,
998
- emptyLabel: z
1013
+ config: (l = r.config) == null ? void 0 : l.table,
1014
+ emptyLabel: V
999
1015
  }
1000
1016
  ),
1001
1017
  r.widget_type === "review_list" && /* @__PURE__ */ t(
1002
- pr,
1018
+ gr,
1003
1019
  {
1004
1020
  data: i,
1005
1021
  config: r.config ?? {},
1006
- onRefetch: () => P((p) => p + 1),
1007
- hostRecordId: T.record_id,
1008
- emptyLabel: z
1022
+ onRefetch: () => A((u) => u + 1),
1023
+ hostRecordId: O.record_id,
1024
+ emptyLabel: V
1009
1025
  }
1010
1026
  ),
1011
1027
  r.widget_type === "rollup" && /* @__PURE__ */ t(
1012
- fr,
1028
+ yr,
1013
1029
  {
1014
1030
  data: i,
1015
1031
  config: r.config ?? {},
1016
- emptyLabel: z
1032
+ emptyLabel: V
1017
1033
  }
1018
1034
  ),
1019
- r.widget_type === "report_widget" && /* @__PURE__ */ t(ur, { payload: i }),
1035
+ r.widget_type === "report_widget" && /* @__PURE__ */ t(hr, { payload: i }),
1020
1036
  r.widget_type === "action-buttons" && /* @__PURE__ */ t(
1021
- Oe,
1037
+ Ue,
1022
1038
  {
1023
1039
  data: i,
1024
1040
  widgetId: n,
1025
- inputs: T,
1041
+ inputs: O,
1026
1042
  apiBase: E
1027
1043
  }
1028
1044
  ),
1029
1045
  r.widget_type === "button-group" && /* @__PURE__ */ t(
1030
- me,
1046
+ ge,
1031
1047
  {
1032
1048
  buttons: i.buttons ?? [],
1033
1049
  layout: i.layout ?? "flat",
1034
1050
  widgetId: n,
1035
- inputs: T,
1051
+ inputs: O,
1036
1052
  apiBase: E,
1037
1053
  onClientAction: N
1038
1054
  }
@@ -1048,10 +1064,10 @@ function Ar({
1048
1064
  "report_widget"
1049
1065
  ].includes(r.widget_type) && /* @__PURE__ */ t("pre", { className: "whitespace-pre-wrap text-[11px] text-slate-500", children: JSON.stringify(i, null, 2) }),
1050
1066
  i.cache ? /* @__PURE__ */ t(
1051
- sr,
1067
+ ur,
1052
1068
  {
1053
1069
  envelope: i.cache,
1054
- onRefresh: k,
1070
+ onRefresh: H,
1055
1071
  refreshing: d,
1056
1072
  className: "mt-2 justify-end"
1057
1073
  }
@@ -1060,5 +1076,5 @@ function Ar({
1060
1076
  }
1061
1077
  }
1062
1078
  export {
1063
- Ar as WidgetSlot
1079
+ Br as WidgetSlot
1064
1080
  };