react-semaphor 0.1.522 → 0.1.524

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 (536) hide show
  1. package/dist/appearance-runtime/index.js +1 -1
  2. package/dist/brand-studio/index.js +1 -1
  3. package/dist/briefings/index.js +1 -1
  4. package/dist/chunks/{appearance-context-VJdrKi7r.js → appearance-context-DEYtWinQ.js} +0 -1
  5. package/dist/chunks/{appearance-runtime-provider-CC4HT2Gi.js → appearance-runtime-provider-B-M8gwlZ.js} +1 -1
  6. package/dist/chunks/{dashboard-briefing-launcher-BIRnsMqX.js → dashboard-briefing-launcher-CTEyh3FQ.js} +790 -800
  7. package/dist/chunks/dashboard-controls-C3KbYzz-.js +2146 -0
  8. package/dist/chunks/{dashboard-json-Dq5ibJr2.js → dashboard-json-Kc_M7nLP.js} +5 -5
  9. package/dist/chunks/edit-dashboard-visual-DqRmfRqN.js +22114 -0
  10. package/dist/chunks/{editor-action-buttons-DuxlCZYf.js → editor-action-buttons-s-ByVR9x.js} +740 -675
  11. package/dist/chunks/{index-krDPPQuA.js → index-D7GVxl4a.js} +41775 -42583
  12. package/dist/chunks/{index-B0KwXM6P.js → index-D9HDUSye.js} +186 -181
  13. package/dist/chunks/{report-preferences-dialog-BA9YJnPe.js → report-preferences-dialog-RAp0DAuw.js} +2 -2
  14. package/dist/chunks/{switch-evlnTA4t.js → switch-CWPcwAZ4.js} +4473 -5054
  15. package/dist/dashboard/index.js +1 -1
  16. package/dist/dashboard-assistant/index.js +1 -2
  17. package/dist/data-app-builder/index.js +2 -2
  18. package/dist/index.js +9 -9
  19. package/dist/style.css +1 -1
  20. package/dist/surfboard/index.js +2 -2
  21. package/dist/types/brand-studio/brand-studio-editor.d.ts +2 -1
  22. package/dist/types/briefings/index.d.ts +5 -0
  23. package/dist/types/components/ai/assistant-context-entity-controls.d.ts +1 -1
  24. package/dist/types/components/ai/assistant-message-components.d.ts +6 -6
  25. package/dist/types/components/ai/assistant-message.d.ts +1 -1
  26. package/dist/types/components/ai/assistant-virtualized-messages.d.ts +1 -1
  27. package/dist/types/components/ai/chat-custom-visual.d.ts +1 -1
  28. package/dist/types/components/ai/chat-visual-query-utils.d.ts +0 -27
  29. package/dist/types/components/ai/chat-visual.d.ts +1 -1
  30. package/dist/types/components/ai/clarification-card.d.ts +1 -1
  31. package/dist/types/components/ai/context-entity-display.d.ts +1 -1
  32. package/dist/types/components/ai/dashboard-assistant.d.ts +1 -4
  33. package/dist/types/components/ai/editor-assistant.d.ts +1 -1
  34. package/dist/types/components/ai/entity-mention-dropdown.d.ts +2 -1
  35. package/dist/types/components/ai/file-upload/file-preview.d.ts +3 -2
  36. package/dist/types/components/ai/file-upload/file-upload-button.d.ts +2 -1
  37. package/dist/types/components/ai/file-upload/file-upload-zone.d.ts +2 -2
  38. package/dist/types/components/ai/message-feedback-buttons.d.ts +1 -1
  39. package/dist/types/components/ai/pending-messages-display.d.ts +1 -1
  40. package/dist/types/components/ai/placeholders.d.ts +1 -1
  41. package/dist/types/components/ai/pre-block.d.ts +2 -2
  42. package/dist/types/components/ai/reasoning-effort-slider.d.ts +1 -1
  43. package/dist/types/components/ai/seed-questions.d.ts +1 -1
  44. package/dist/types/components/ai/tool-call-error.d.ts +1 -1
  45. package/dist/types/components/ai/tool-call.d.ts +1 -1
  46. package/dist/types/components/ai/tool-part-renderer.d.ts +1 -1
  47. package/dist/types/components/briefings/attachments/briefing-attachment-list.d.ts +1 -1
  48. package/dist/types/components/briefings/attachments/briefing-attachment-selector.d.ts +1 -1
  49. package/dist/types/components/briefings/attachments/briefing-attachment-settings-dialog.d.ts +1 -1
  50. package/dist/types/components/briefings/briefing-author/attachment-section.d.ts +1 -1
  51. package/dist/types/components/briefings/briefing-author/author-actions.d.ts +1 -1
  52. package/dist/types/components/briefings/briefing-author/content-composers.d.ts +2 -2
  53. package/dist/types/components/briefings/briefing-author/delivery-section.d.ts +1 -1
  54. package/dist/types/components/briefings/briefing-author/form-primitives.d.ts +3 -3
  55. package/dist/types/components/briefings/briefing-author/run-ui.d.ts +12 -12
  56. package/dist/types/components/briefings/briefing-author/schedule-section.d.ts +1 -1
  57. package/dist/types/components/briefings/briefing-author/schedule.d.ts +1 -1
  58. package/dist/types/components/briefings/briefing-author/scope-picker.d.ts +1 -1
  59. package/dist/types/components/briefings/briefing-author/slack-channel-picker.d.ts +1 -1
  60. package/dist/types/components/briefings/briefing-author-dialog.d.ts +1 -1
  61. package/dist/types/components/briefings/briefing-author.d.ts +1 -1
  62. package/dist/types/components/briefings/briefing-html-frame.d.ts +1 -1
  63. package/dist/types/components/briefings/briefing-recipient-field.d.ts +1 -1
  64. package/dist/types/components/briefings/briefing-ui-capabilities.d.ts +2 -2
  65. package/dist/types/components/briefings/dashboard-briefing-launcher-list.d.ts +1 -1
  66. package/dist/types/components/briefings/dashboard-briefing-launcher.d.ts +1 -1
  67. package/dist/types/components/briefings/dashboard-schedule-report-menu-item.d.ts +2 -2
  68. package/dist/types/components/briefings/watch-dashboard-button.d.ts +1 -1
  69. package/dist/types/components/calculated-fields/ai-compose-panel.d.ts +1 -1
  70. package/dist/types/components/calculated-fields/calculated-field-editor.d.ts +2 -1
  71. package/dist/types/components/calculated-fields/domain-definition-notice.d.ts +1 -1
  72. package/dist/types/components/calculated-fields/expression-validator.d.ts +1 -1
  73. package/dist/types/components/calculated-fields/field-picker-panel.d.ts +1 -1
  74. package/dist/types/components/calculated-fields/field-type-toggle.d.ts +1 -1
  75. package/dist/types/components/calculated-fields/insert-field-popover.d.ts +1 -1
  76. package/dist/types/components/calculated-fields/placeholder-field-picker.d.ts +1 -1
  77. package/dist/types/components/calculated-fields/summary-ribbon.d.ts +1 -1
  78. package/dist/types/components/calculated-fields/templates-menu.d.ts +1 -1
  79. package/dist/types/components/calculated-fields/validation-results.d.ts +1 -1
  80. package/dist/types/components/chart-selector/chart-icon.d.ts +3 -2
  81. package/dist/types/components/chart-selector/chart-selector-item.d.ts +7 -8
  82. package/dist/types/components/chart-selector/chart-selector.d.ts +9 -3
  83. package/dist/types/components/chart-selector/chart-type-picker.d.ts +1 -1
  84. package/dist/types/components/chart-selector/index.d.ts +0 -1
  85. package/dist/types/components/dashboard/ai-dashboard-create-dialog.d.ts +2 -2
  86. package/dist/types/components/dashboard/card-actions-menu.d.ts +1 -1
  87. package/dist/types/components/dashboard/card-selection-pill.d.ts +1 -1
  88. package/dist/types/components/dashboard/card-summary.d.ts +1 -1
  89. package/dist/types/components/dashboard/comparison-metadata-badge.d.ts +2 -2
  90. package/dist/types/components/dashboard/dashboard-card.d.ts +1 -1
  91. package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
  92. package/dist/types/components/dashboard/dashboard-error-state.d.ts +1 -1
  93. package/dist/types/components/dashboard/dashboard-export-dialog.d.ts +1 -1
  94. package/dist/types/components/dashboard/dashboard-frame-expand-dialog.d.ts +1 -1
  95. package/dist/types/components/dashboard/dashboard-frame.d.ts +1 -1
  96. package/dist/types/components/dashboard/dashboard-hub-row.d.ts +1 -1
  97. package/dist/types/components/dashboard/dashboard-hub.d.ts +1 -1
  98. package/dist/types/components/dashboard/dashboard-tabs.d.ts +1 -1
  99. package/dist/types/components/dashboard/dashboard-visual-error-state.d.ts +3 -3
  100. package/dist/types/components/dashboard/dashboard.d.ts +1 -1
  101. package/dist/types/components/dashboard/download-pdf.d.ts +1 -1
  102. package/dist/types/components/dashboard/drill-breadcrumb.d.ts +1 -1
  103. package/dist/types/components/dashboard/drill-navigation-controls.d.ts +1 -1
  104. package/dist/types/components/dashboard/inline-filter-bar.d.ts +2 -1
  105. package/dist/types/components/dashboard/inline-filter-component.d.ts +2 -1
  106. package/dist/types/components/dashboard/kpi-header.d.ts +1 -1
  107. package/dist/types/components/dashboard/sheet/delete-sheet-alert.d.ts +1 -1
  108. package/dist/types/components/dashboard/sheet/sheet-empty-state.d.ts +1 -1
  109. package/dist/types/components/dashboard/sheet/sheet-layout.d.ts +2 -1
  110. package/dist/types/components/dashboard/summary-card.d.ts +3 -3
  111. package/dist/types/components/dashboard/unconfigured-card-state.d.ts +1 -1
  112. package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +1 -1
  113. package/dist/types/components/document-sheet/document-control-options-resolver.d.ts +1 -1
  114. package/dist/types/components/document-sheet/document-control-toolbar-actions.d.ts +1 -1
  115. package/dist/types/components/document-sheet/document-controls-settings.d.ts +1 -1
  116. package/dist/types/components/document-sheet/document-input-bar.d.ts +1 -1
  117. package/dist/types/components/document-sheet/document-insert-picker.d.ts +2 -2
  118. package/dist/types/components/document-sheet/document-inspector-primitives.d.ts +2 -2
  119. package/dist/types/components/document-sheet/document-kpi-section.d.ts +1 -1
  120. package/dist/types/components/document-sheet/document-matrix-section.d.ts +1 -1
  121. package/dist/types/components/document-sheet/document-measure-layer.d.ts +1 -1
  122. package/dist/types/components/document-sheet/document-outline.d.ts +1 -1
  123. package/dist/types/components/document-sheet/document-page-navigation.d.ts +2 -2
  124. package/dist/types/components/document-sheet/document-page.d.ts +3 -3
  125. package/dist/types/components/document-sheet/document-panel/document-side-panel.d.ts +1 -1
  126. package/dist/types/components/document-sheet/document-panel/inputs-panel.d.ts +1 -1
  127. package/dist/types/components/document-sheet/document-panel/page-panel.d.ts +1 -1
  128. package/dist/types/components/document-sheet/document-panel/panel-controls.d.ts +2 -2
  129. package/dist/types/components/document-sheet/document-panel/region-panels.d.ts +2 -2
  130. package/dist/types/components/document-sheet/document-panel/section-panel.d.ts +2 -2
  131. package/dist/types/components/document-sheet/document-section-print-boundary.d.ts +1 -1
  132. package/dist/types/components/document-sheet/document-sheet.d.ts +2 -2
  133. package/dist/types/components/document-sheet/document-table-chrome.d.ts +5 -5
  134. package/dist/types/components/document-sheet/document-table-section.d.ts +1 -1
  135. package/dist/types/components/document-sheet/document-text-editor.d.ts +1 -1
  136. package/dist/types/components/editor/dashboard-json.d.ts +1 -1
  137. package/dist/types/components/editor/editable.d.ts +1 -1
  138. package/dist/types/components/editor/editor-main/advanced-mode-toggle.d.ts +1 -1
  139. package/dist/types/components/editor/editor-main/card-display-options-dropdown.d.ts +1 -1
  140. package/dist/types/components/editor/editor-main/card-tabs.d.ts +1 -1
  141. package/dist/types/components/editor/editor-main/chart-configuration-options.d.ts +1 -1
  142. package/dist/types/components/editor/editor-main/code-editors/expanded-query-editor-dialog.d.ts +1 -1
  143. package/dist/types/components/editor/editor-main/code-editors/json-editor-readonly.d.ts +1 -1
  144. package/dist/types/components/editor/editor-main/content-editable-text.d.ts +2 -1
  145. package/dist/types/components/editor/editor-main/context-hover-card.d.ts +2 -1
  146. package/dist/types/components/editor/editor-main/customize-visual/customize-visual-dialog.d.ts +1 -1
  147. package/dist/types/components/editor/editor-main/dashboard-filter-subscription-status.d.ts +1 -1
  148. package/dist/types/components/editor/editor-main/data-label-settings.d.ts +1 -1
  149. package/dist/types/components/editor/editor-main/edit-dashboard-visual.d.ts +2 -1
  150. package/dist/types/components/editor/editor-main/editor-action-buttons.d.ts +7 -7
  151. package/dist/types/components/editor/editor-main/editor-actions-biz-mode.d.ts +1 -1
  152. package/dist/types/components/editor/editor-main/editor-card.d.ts +1 -1
  153. package/dist/types/components/editor/editor-main/editor-main-component.d.ts +1 -1
  154. package/dist/types/components/editor/editor-main/editor-query-section.d.ts +3 -2
  155. package/dist/types/components/editor/editor-main/editor-visual-section.d.ts +3 -8
  156. package/dist/types/components/editor/editor-main/inline-query-writer/inline-query-writer.d.ts +1 -1
  157. package/dist/types/components/editor/editor-main/legend-popover.d.ts +1 -1
  158. package/dist/types/components/editor/editor-main/raw-output-table.d.ts +2 -1
  159. package/dist/types/components/editor/editor-main/realtime-popover.d.ts +1 -1
  160. package/dist/types/components/editor/editor-main/table-type-switcher.d.ts +1 -1
  161. package/dist/types/components/editor/editor-main/text-card-rich-editor.d.ts +2 -1
  162. package/dist/types/components/editor/editor-main/text-card.d.ts +2 -1
  163. package/dist/types/components/editor/editor-main/visual-aside.d.ts +1 -1
  164. package/dist/types/components/editor/editor-main/visual-editing-controls.d.ts +1 -1
  165. package/dist/types/components/editor/editor-main/visual-save-as-dialog.d.ts +2 -1
  166. package/dist/types/components/editor/editor-main/visual-settings.d.ts +1 -1
  167. package/dist/types/components/editor/editor.d.ts +1 -1
  168. package/dist/types/components/editor/mode-toggle.d.ts +2 -2
  169. package/dist/types/components/editor/query-feedback/query-card-details.d.ts +2 -2
  170. package/dist/types/components/editor/query-feedback/query-error.d.ts +2 -2
  171. package/dist/types/components/editor/query-feedback/query-feedback-layout.d.ts +3 -3
  172. package/dist/types/components/editor/query-feedback/query-info.d.ts +1 -1
  173. package/dist/types/components/editor/query-feedback/query-sql-preview.d.ts +1 -1
  174. package/dist/types/components/editor/query-feedback/visual-query-error-state.d.ts +1 -1
  175. package/dist/types/components/error-fallbacks/fallback.d.ts +4 -4
  176. package/dist/types/components/explorer/chart-configuration/area-series-config-section.d.ts +1 -1
  177. package/dist/types/components/explorer/chart-configuration/axis-config-section.d.ts +1 -1
  178. package/dist/types/components/explorer/chart-configuration/bar-series-config-section.d.ts +1 -1
  179. package/dist/types/components/explorer/chart-configuration/bar-style-config-section.d.ts +1 -1
  180. package/dist/types/components/explorer/chart-configuration/bubble-scatter-config-section.d.ts +1 -1
  181. package/dist/types/components/explorer/chart-configuration/bullet-config-section.d.ts +1 -1
  182. package/dist/types/components/explorer/chart-configuration/chart-config-sections.d.ts +1 -1
  183. package/dist/types/components/explorer/chart-configuration/chart-configuration-panel.d.ts +1 -1
  184. package/dist/types/components/explorer/chart-configuration/chart-fields-configuration.d.ts +2 -2
  185. package/dist/types/components/explorer/chart-configuration/chart-type-row.d.ts +2 -2
  186. package/dist/types/components/explorer/chart-configuration/color-config-section.d.ts +1 -1
  187. package/dist/types/components/explorer/chart-configuration/combo-series-config-section.d.ts +1 -1
  188. package/dist/types/components/explorer/chart-configuration/comparison-config-section.d.ts +2 -2
  189. package/dist/types/components/explorer/chart-configuration/custom-color-picker.d.ts +1 -1
  190. package/dist/types/components/explorer/chart-configuration/data-labels-config-section.d.ts +1 -1
  191. package/dist/types/components/explorer/chart-configuration/data-labels-fields.d.ts +1 -1
  192. package/dist/types/components/explorer/chart-configuration/funnel-config-section.d.ts +1 -1
  193. package/dist/types/components/explorer/chart-configuration/heatmap-color-config-section.d.ts +1 -1
  194. package/dist/types/components/explorer/chart-configuration/kpi-format-config-section.d.ts +1 -1
  195. package/dist/types/components/explorer/chart-configuration/legend-config-section.d.ts +1 -1
  196. package/dist/types/components/explorer/chart-configuration/line-series-config-section.d.ts +1 -1
  197. package/dist/types/components/explorer/chart-configuration/line-style-config-section.d.ts +1 -1
  198. package/dist/types/components/explorer/chart-configuration/matrix-authoring-controls.d.ts +5 -5
  199. package/dist/types/components/explorer/chart-configuration/matrix-authoring-panel.d.ts +1 -1
  200. package/dist/types/components/explorer/chart-configuration/matrix-editor-settings.d.ts +1 -1
  201. package/dist/types/components/explorer/chart-configuration/metric-format-editor.d.ts +1 -1
  202. package/dist/types/components/explorer/chart-configuration/number-format-config.d.ts +2 -1
  203. package/dist/types/components/explorer/chart-configuration/stacked-sort-section.d.ts +1 -1
  204. package/dist/types/components/explorer/chart-configuration/summary-config-section.d.ts +1 -1
  205. package/dist/types/components/explorer/chart-configuration/tooltip-format-config-section.d.ts +1 -1
  206. package/dist/types/components/explorer/chart-configuration/treemap-color-mode-section.d.ts +1 -1
  207. package/dist/types/components/explorer/data-source/add-data-picker.d.ts +1 -1
  208. package/dist/types/components/explorer/data-source/data-source-panel.d.ts +1 -1
  209. package/dist/types/components/explorer/data-source/dataset-selector-popover.d.ts +1 -1
  210. package/dist/types/components/explorer/data-source/db-schema-selector.d.ts +1 -1
  211. package/dist/types/components/explorer/data-source/direct-source-tree.d.ts +1 -1
  212. package/dist/types/components/explorer/data-source/entity-tooltip.d.ts +2 -2
  213. package/dist/types/components/explorer/data-source/file-upload-manager.d.ts +1 -1
  214. package/dist/types/components/explorer/data-source/select-data-dialog.d.ts +1 -1
  215. package/dist/types/components/explorer/data-source/selected-entities-summary.d.ts +1 -1
  216. package/dist/types/components/explorer/data-source/semantic-domain-tree.d.ts +2 -2
  217. package/dist/types/components/explorer/data-source/url-source-manager.d.ts +1 -1
  218. package/dist/types/components/explorer/drag-and-drop/attribute-filter-dialog.d.ts +1 -1
  219. package/dist/types/components/explorer/drag-and-drop/data-concept-tooltip.d.ts +1 -1
  220. package/dist/types/components/explorer/drag-and-drop/drag-overlay.d.ts +1 -1
  221. package/dist/types/components/explorer/drag-and-drop/draggable-field-shell.d.ts +1 -1
  222. package/dist/types/components/explorer/drag-and-drop/draggable-field.d.ts +1 -1
  223. package/dist/types/components/explorer/drag-and-drop/droppable-zone.d.ts +1 -1
  224. package/dist/types/components/explorer/drag-and-drop/inline-edit-field.d.ts +2 -1
  225. package/dist/types/components/explorer/drag-and-drop/matrix-draggable-field.d.ts +1 -1
  226. package/dist/types/components/explorer/drag-and-drop/pivot-alias-template-editor.d.ts +1 -1
  227. package/dist/types/components/explorer/drag-and-drop/pivot-value-aliases-editor.d.ts +1 -1
  228. package/dist/types/components/explorer/fields/field-option-list.d.ts +1 -1
  229. package/dist/types/components/explorer/fields/icon-for-field-type.d.ts +1 -1
  230. package/dist/types/components/explorer/fields/numeric-popover.d.ts +1 -1
  231. package/dist/types/components/explorer/fields/source-field.d.ts +3 -3
  232. package/dist/types/components/explorer/fields/type-glyph.d.ts +1 -1
  233. package/dist/types/components/explorer/filters/card-date-filter.d.ts +1 -1
  234. package/dist/types/components/explorer/filters/card-filter-builder.d.ts +2 -1
  235. package/dist/types/components/explorer/filters/card-filter-manager.d.ts +1 -1
  236. package/dist/types/components/explorer/filters/field-multi-select.d.ts +2 -1
  237. package/dist/types/components/explorer/filters/field-single-select.d.ts +2 -1
  238. package/dist/types/components/explorer/filters/searchable-field-combobox.d.ts +2 -1
  239. package/dist/types/components/explorer/join-configuration/auto-join-info.d.ts +1 -1
  240. package/dist/types/components/explorer/join-configuration/join-conditions-builder.d.ts +1 -1
  241. package/dist/types/components/explorer/join-configuration/join-dialog.d.ts +1 -1
  242. package/dist/types/components/explorer/join-configuration/join-manager.d.ts +1 -1
  243. package/dist/types/components/explorer/join-configuration/join-tooltip-content.d.ts +1 -1
  244. package/dist/types/components/explorer/main/explorer.d.ts +1 -1
  245. package/dist/types/components/explorer/main/view-tabs.d.ts +1 -1
  246. package/dist/types/components/explorer/visualization/chart-settings-panel.d.ts +2 -1
  247. package/dist/types/components/explorer/visualization/chart-split-view.d.ts +1 -3
  248. package/dist/types/components/explorer/visualization/feedback-dialog.d.ts +2 -1
  249. package/dist/types/components/explorer/visualization/row-limit-selector.d.ts +1 -1
  250. package/dist/types/components/explorer/visualization/visualization-panel.d.ts +1 -1
  251. package/dist/types/components/icons/bullet-chart-icon.d.ts +1 -1
  252. package/dist/types/components/interactions/applied-filters-display.d.ts +1 -1
  253. package/dist/types/components/interactions/card-renderer.d.ts +1 -1
  254. package/dist/types/components/interactions/click-to-filter-review-dialog.d.ts +2 -1
  255. package/dist/types/components/interactions/dashboard-drill-host.d.ts +1 -1
  256. package/dist/types/components/interactions/drill-config/hierarchy-steps-display.d.ts +1 -1
  257. package/dist/types/components/interactions/drill-config/hierarchy-templates.d.ts +1 -1
  258. package/dist/types/components/interactions/drill-config/sortable-step.d.ts +1 -1
  259. package/dist/types/components/interactions/drill-config/step-configuration-popup.d.ts +1 -1
  260. package/dist/types/components/interactions/drill-hierarchy-modal.d.ts +1 -1
  261. package/dist/types/components/interactions/drill-to-url-modal.d.ts +1 -1
  262. package/dist/types/components/interactions/filter-badge-tooltip.d.ts +1 -1
  263. package/dist/types/components/interactions/insight-modal.d.ts +1 -1
  264. package/dist/types/components/interactions/insight-viewer.d.ts +1 -1
  265. package/dist/types/components/interactions/interactions-sheet.d.ts +2 -1
  266. package/dist/types/components/interactions/panels/click-to-filter-panel.d.ts +1 -1
  267. package/dist/types/components/interactions/panels/drill-down-panel.d.ts +2 -1
  268. package/dist/types/components/interactions/panels/drill-to-dashboard-panel.d.ts +1 -1
  269. package/dist/types/components/interactions/panels/drill-to-insight-panel.d.ts +1 -1
  270. package/dist/types/components/interactions/panels/drill-to-url-panel-v2.d.ts +1 -1
  271. package/dist/types/components/interactions/panels/dynamic-drill-panel.d.ts +1 -1
  272. package/dist/types/components/interactions/panels/panel-field.d.ts +1 -1
  273. package/dist/types/components/interactions/pickers/dashboard-picker.d.ts +1 -1
  274. package/dist/types/components/interactions/pickers/insight-picker.d.ts +1 -1
  275. package/dist/types/components/interactions/replaced-card-wrapper.d.ts +1 -1
  276. package/dist/types/components/interactions/reusable/field-combobox.d.ts +2 -1
  277. package/dist/types/components/interactions/reusable/field-selector.d.ts +1 -1
  278. package/dist/types/components/interactions/reusable/inline-field-selector.d.ts +1 -1
  279. package/dist/types/components/interactions/sheet/action-editor.d.ts +1 -1
  280. package/dist/types/components/interactions/sheet/action-picker.d.ts +1 -1
  281. package/dist/types/components/interactions/sheet/click-outcome-preview.d.ts +1 -1
  282. package/dist/types/components/interactions/sheet/interactions-home.d.ts +1 -1
  283. package/dist/types/components/interactions/sheet/sheet-parts.d.ts +4 -4
  284. package/dist/types/components/kpi-visual-v2/country-selector.d.ts +1 -1
  285. package/dist/types/components/kpi-visual-v2/kpi-card-explorer.d.ts +1 -1
  286. package/dist/types/components/kpi-visual-v2/kpi-settings.d.ts +1 -1
  287. package/dist/types/components/kpi-visual-v2/kpi-tooltip-components.d.ts +4 -4
  288. package/dist/types/components/kpi-visual-v2/kpi-tooltip.d.ts +2 -1
  289. package/dist/types/components/kpi-visual-v2/metric-comparison-indicator.d.ts +2 -1
  290. package/dist/types/components/kpi-visual-v2/metric-comparison-kpi.d.ts +1 -1
  291. package/dist/types/components/notifications/export-notification-item.d.ts +2 -1
  292. package/dist/types/components/notifications/export-notification-list.d.ts +2 -1
  293. package/dist/types/components/notifications/notification-bell.d.ts +2 -1
  294. package/dist/types/components/providers/appearance-runtime-provider.d.ts +2 -2
  295. package/dist/types/components/providers/dashboard-matrix-execution-provider.d.ts +1 -1
  296. package/dist/types/components/providers/dashboard-preferences-provider.d.ts +1 -1
  297. package/dist/types/components/providers/display-preferences-provider.d.ts +1 -1
  298. package/dist/types/components/providers/semaphor-context-provider.d.ts +1 -1
  299. package/dist/types/components/providers/semaphor-query-provider.d.ts +1 -1
  300. package/dist/types/components/providers/theme-provider.d.ts +1 -1
  301. package/dist/types/components/providers/ux-provider.d.ts +1 -1
  302. package/dist/types/components/semaphor/code-block.d.ts +1 -1
  303. package/dist/types/components/shared/unsaved-changes/unsaved-changes-alert.d.ts +1 -1
  304. package/dist/types/components/sharing-and-management/common-loading-skeleton.d.ts +1 -1
  305. package/dist/types/components/sharing-and-management/create-dashboard-dialog.d.ts +1 -1
  306. package/dist/types/components/sharing-and-management/create-visual-dialog.d.ts +1 -1
  307. package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
  308. package/dist/types/components/sharing-and-management/group-management-dialog.d.ts +1 -1
  309. package/dist/types/components/sharing-and-management/resource-edit-dialog.d.ts +2 -1
  310. package/dist/types/components/sharing-and-management/resource-share-dialog/index.d.ts +1 -1
  311. package/dist/types/components/sharing-and-management/resource-share-dialog/unified/access-list.d.ts +1 -1
  312. package/dist/types/components/sharing-and-management/resource-share-dialog/unified/invite-combobox.d.ts +1 -1
  313. package/dist/types/components/sharing-and-management/resource-share-dialog/unified/primitives.d.ts +3 -3
  314. package/dist/types/components/sharing-and-management/resource-share-dialog/unified/share-shape.d.ts +1 -1
  315. package/dist/types/components/sharing-and-management/resource-share-dialog/unified/shell.d.ts +1 -1
  316. package/dist/types/components/sharing-and-management/resource-share-dialog/unified/status-bar.d.ts +1 -1
  317. package/dist/types/components/sharing-and-management/visuals-library-dialog.d.ts +1 -1
  318. package/dist/types/components/surfboard/card-controls-toolbar.d.ts +1 -1
  319. package/dist/types/components/surfboard/controls/card-runtime-controls.d.ts +1 -1
  320. package/dist/types/components/surfboard/controls/control-binding-list-editor.d.ts +1 -1
  321. package/dist/types/components/surfboard/controls/control-definition-editor-sections.d.ts +9 -9
  322. package/dist/types/components/surfboard/controls/control-definition-list-editor.d.ts +1 -1
  323. package/dist/types/components/surfboard/controls/control-toolbar-item.d.ts +1 -1
  324. package/dist/types/components/surfboard/controls/control-toolbar-settings-form.d.ts +1 -1
  325. package/dist/types/components/surfboard/controls/control-toolbar-settings-shell.d.ts +2 -2
  326. package/dist/types/components/surfboard/controls/dashboard-control-delete-dialog.d.ts +1 -1
  327. package/dist/types/components/surfboard/controls/dashboard-control-toolbar-popover.d.ts +1 -1
  328. package/dist/types/components/surfboard/controls/dashboard-controls-settings.d.ts +1 -1
  329. package/dist/types/components/surfboard/controls/dashboard-filter-controls-button.d.ts +1 -1
  330. package/dist/types/components/surfboard/controls/dashboard-filter-controls-launcher.d.ts +1 -1
  331. package/dist/types/components/surfboard/controls/dashboard-runtime-controls.d.ts +1 -1
  332. package/dist/types/components/surfboard/controls/matrix-structural-targets.d.ts +1 -1
  333. package/dist/types/components/surfboard/controls/presentation-currency-binding-editor.d.ts +1 -1
  334. package/dist/types/components/surfboard/controls/runtime-control-input.d.ts +1 -1
  335. package/dist/types/components/surfboard/controls/runtime-controls-group.d.ts +1 -1
  336. package/dist/types/components/surfboard/controls/sortable-control-toolbar-item.d.ts +1 -1
  337. package/dist/types/components/surfboard/dashboard-controls.d.ts +1 -1
  338. package/dist/types/components/surfboard/dashboard-plus-main.d.ts +1 -1
  339. package/dist/types/components/surfboard/dashboard-plus.d.ts +1 -1
  340. package/dist/types/components/surfboard/expanded-card-view.d.ts +2 -1
  341. package/dist/types/components/surfboard/export-dialog.d.ts +2 -1
  342. package/dist/types/components/surfboard/filter/apply-filters-check-box.d.ts +1 -1
  343. package/dist/types/components/surfboard/filter/custom-filter/custom-filter-selector.d.ts +1 -1
  344. package/dist/types/components/surfboard/filter/custom-filter/dashboard-custom-filter.d.ts +1 -1
  345. package/dist/types/components/surfboard/filter/custom-filter-popover.d.ts +1 -1
  346. package/dist/types/components/surfboard/filter/dashboard-filter-info-group.d.ts +1 -1
  347. package/dist/types/components/surfboard/filter/dashboard-filter-mapping-panel.d.ts +3 -3
  348. package/dist/types/components/surfboard/filter/date-comparison-controls.d.ts +1 -1
  349. package/dist/types/components/surfboard/filter/date-range-filter-v2.d.ts +1 -1
  350. package/dist/types/components/surfboard/filter/date-range-filter.d.ts +1 -1
  351. package/dist/types/components/surfboard/filter/day-picker.d.ts +2 -1
  352. package/dist/types/components/surfboard/filter/field-date-filter.d.ts +1 -1
  353. package/dist/types/components/surfboard/filter/filter-actions-popover-content.d.ts +1 -1
  354. package/dist/types/components/surfboard/filter/filter-aside.d.ts +1 -1
  355. package/dist/types/components/surfboard/filter/filter-component.d.ts +2 -1
  356. package/dist/types/components/surfboard/filter/filter-configuration-panel.d.ts +7 -7
  357. package/dist/types/components/surfboard/filter/filter-default-values-picker.d.ts +1 -1
  358. package/dist/types/components/surfboard/filter/filter-error-state.d.ts +1 -1
  359. package/dist/types/components/surfboard/filter/filter-header.d.ts +1 -1
  360. package/dist/types/components/surfboard/filter/filter-info.d.ts +1 -1
  361. package/dist/types/components/surfboard/filter/filter-option-dependencies-settings.d.ts +2 -1
  362. package/dist/types/components/surfboard/filter/filter-option-list.d.ts +1 -1
  363. package/dist/types/components/surfboard/filter/filter-option-source-settings.d.ts +2 -1
  364. package/dist/types/components/surfboard/filter/filter-picker-popover-content.d.ts +1 -1
  365. package/dist/types/components/surfboard/filter/filter-popover-parts.d.ts +3 -3
  366. package/dist/types/components/surfboard/filter/filter-scope-config.d.ts +1 -1
  367. package/dist/types/components/surfboard/filter/filter-settings-popover.d.ts +1 -1
  368. package/dist/types/components/surfboard/filter/filter-toolbar-item.d.ts +2 -1
  369. package/dist/types/components/surfboard/filter/filter-toolbar.d.ts +1 -1
  370. package/dist/types/components/surfboard/filter/global-date-comparison-footer.d.ts +1 -1
  371. package/dist/types/components/surfboard/filter/global-date-filter.d.ts +1 -1
  372. package/dist/types/components/surfboard/filter/hidden-filters.d.ts +1 -1
  373. package/dist/types/components/surfboard/filter/month-picker.d.ts +2 -1
  374. package/dist/types/components/surfboard/filter/multi-select-filter.d.ts +2 -2
  375. package/dist/types/components/surfboard/filter/multi-select-inline-content.d.ts +1 -1
  376. package/dist/types/components/surfboard/filter/numeric-filter-input.d.ts +1 -1
  377. package/dist/types/components/surfboard/filter/radio-button-filter.d.ts +1 -1
  378. package/dist/types/components/surfboard/filter/selection-chip.d.ts +1 -1
  379. package/dist/types/components/surfboard/filter/selection-filter-section.d.ts +1 -1
  380. package/dist/types/components/surfboard/filter/sortable-filter-toolbar-item.d.ts +1 -1
  381. package/dist/types/components/surfboard/filter/tabs-filter.d.ts +1 -1
  382. package/dist/types/components/surfboard/inline-options-error-state.d.ts +1 -1
  383. package/dist/types/components/surfboard/input-chip-row.d.ts +1 -1
  384. package/dist/types/components/surfboard/preferences/calendar-preferences-panel.d.ts +2 -1
  385. package/dist/types/components/surfboard/preferences/display-format-preferences-fields.d.ts +1 -1
  386. package/dist/types/components/surfboard/preferences/display-format-preferences-panel.d.ts +1 -1
  387. package/dist/types/components/surfboard/preferences/report-preferences-dialog.d.ts +1 -1
  388. package/dist/types/components/surfboard/toolbar-item-shell.d.ts +1 -1
  389. package/dist/types/components/text-variables/variable-chip-plugin.d.ts +2 -2
  390. package/dist/types/components/text-variables/variable-picker.d.ts +2 -2
  391. package/dist/types/components/ui/alert-dialog.d.ts +2 -2
  392. package/dist/types/components/ui/audience-type-badge.d.ts +1 -1
  393. package/dist/types/components/ui/calendar.d.ts +2 -2
  394. package/dist/types/components/ui/command.d.ts +2 -2
  395. package/dist/types/components/ui/context-menu.d.ts +1 -1
  396. package/dist/types/components/ui/dialog.d.ts +2 -2
  397. package/dist/types/components/ui/dropdown-menu.d.ts +1 -1
  398. package/dist/types/components/ui/resizable.d.ts +2 -2
  399. package/dist/types/components/ui/sheet.d.ts +2 -2
  400. package/dist/types/components/ui/skeleton.d.ts +1 -1
  401. package/dist/types/components/ui/sonner.d.ts +1 -1
  402. package/dist/types/components/ui-custom/color-field.d.ts +2 -1
  403. package/dist/types/components/ui-custom/column-search.d.ts +2 -1
  404. package/dist/types/components/ui-custom/combo-box-2.d.ts +1 -1
  405. package/dist/types/components/ui-custom/combo-box.d.ts +1 -1
  406. package/dist/types/components/ui-custom/copy-button.d.ts +1 -1
  407. package/dist/types/components/ui-custom/copy-on-click.d.ts +1 -1
  408. package/dist/types/components/ui-custom/date-range-picker.d.ts +1 -1
  409. package/dist/types/components/ui-custom/date-range-popover.d.ts +1 -1
  410. package/dist/types/components/ui-custom/details.d.ts +1 -1
  411. package/dist/types/components/ui-custom/editable-text.d.ts +2 -1
  412. package/dist/types/components/ui-custom/load-on-scroll-status.d.ts +1 -1
  413. package/dist/types/components/ui-custom/loading-dots.d.ts +1 -1
  414. package/dist/types/components/ui-custom/local-blur-input.d.ts +1 -1
  415. package/dist/types/components/ui-custom/option-search-input.d.ts +1 -1
  416. package/dist/types/components/ui-custom/overflow-div.d.ts +1 -1
  417. package/dist/types/components/ui-custom/overflow-span.d.ts +1 -1
  418. package/dist/types/components/ui-custom/pre-tag.d.ts +1 -1
  419. package/dist/types/components/ui-custom/radio-indicator.d.ts +1 -1
  420. package/dist/types/components/ui-custom/resizable-handle-custom.d.ts +1 -1
  421. package/dist/types/components/ui-custom/reusable-select.d.ts +1 -1
  422. package/dist/types/components/ui-custom/visual-badge.d.ts +1 -1
  423. package/dist/types/components/visual/aggregated-table/aggregate-table.d.ts +2 -1
  424. package/dist/types/components/visual/aggregated-table/columns/column-cell-components.d.ts +2 -1
  425. package/dist/types/components/visual/aggregated-table/columns/column-header-components.d.ts +3 -2
  426. package/dist/types/components/visual/aggregated-table/components/aggregate-table-body.d.ts +1 -1
  427. package/dist/types/components/visual/aggregated-table/components/grand-total-footer.d.ts +2 -1
  428. package/dist/types/components/visual/chartjs-visual.d.ts +1 -1
  429. package/dist/types/components/visual/custom-visual/component-combo-box.d.ts +2 -1
  430. package/dist/types/components/visual/custom-visual/custom-visual-settings.d.ts +1 -1
  431. package/dist/types/components/visual/custom-visual/dashboard-custom-visual.d.ts +1 -1
  432. package/dist/types/components/visual/custom-visual/editor-custom-visual.d.ts +1 -1
  433. package/dist/types/components/visual/custom-visual/multi-input-empty-renderer.d.ts +1 -1
  434. package/dist/types/components/visual/data-table/column-resize-handle.d.ts +1 -1
  435. package/dist/types/components/visual/data-table/copyable-cell.d.ts +1 -1
  436. package/dist/types/components/visual/data-table/data-table-column-settings.d.ts +1 -1
  437. package/dist/types/components/visual/data-table/data-table-conditional-formatting-settings.d.ts +1 -1
  438. package/dist/types/components/visual/data-table/data-table-pagination.d.ts +1 -1
  439. package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
  440. package/dist/types/components/visual/data-table/data-table.d.ts +1 -1
  441. package/dist/types/components/visual/data-table/overflow-cell.d.ts +1 -1
  442. package/dist/types/components/visual/data-table/table-settings-toolbar-button.d.ts +1 -1
  443. package/dist/types/components/visual/data-table/table-skeleton.d.ts +1 -1
  444. package/dist/types/components/visual/data-table/table-visual.d.ts +1 -1
  445. package/dist/types/components/visual/info-hover.d.ts +2 -1
  446. package/dist/types/components/visual/kpi-visual/format-number-setting.d.ts +1 -1
  447. package/dist/types/components/visual/kpi-visual/kpi-card-with-info.d.ts +1 -1
  448. package/dist/types/components/visual/kpi-visual/kpi-card.d.ts +3 -3
  449. package/dist/types/components/visual/kpi-visual/kpi-editor-ownership-badge.d.ts +1 -1
  450. package/dist/types/components/visual/matrix-table/matrix-axis-menu.d.ts +1 -1
  451. package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +1 -1
  452. package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +2 -2
  453. package/dist/types/components/visual/matrix-table/matrix-loading-skeleton.d.ts +2 -2
  454. package/dist/types/components/visual/matrix-table/matrix-window-viewer.d.ts +1 -1
  455. package/dist/types/components/visual/pivot-table/aggregation-menu.d.ts +1 -1
  456. package/dist/types/components/visual/pivot-table/components/pivot-table-body.d.ts +1 -1
  457. package/dist/types/components/visual/pivot-table/components/pivot-table-footer.d.ts +2 -1
  458. package/dist/types/components/visual/pivot-table/hooks/use-pivot-column-headers.d.ts +1 -1
  459. package/dist/types/components/visual/pivot-table/pivot-table-tanstack.d.ts +1 -1
  460. package/dist/types/components/visual/settings/axis-mapping.d.ts +2 -2
  461. package/dist/types/components/visual/settings/chart-documentation.d.ts +3 -3
  462. package/dist/types/components/visual/settings/chart-orientation.d.ts +1 -1
  463. package/dist/types/components/visual/settings/color-format.d.ts +2 -1
  464. package/dist/types/components/visual/settings/controls-settings.d.ts +2 -1
  465. package/dist/types/components/visual/settings/dataset-label-popover.d.ts +2 -1
  466. package/dist/types/components/visual/settings/display-labels.d.ts +2 -1
  467. package/dist/types/components/visual/settings/filter-on-click-columns.d.ts +1 -1
  468. package/dist/types/components/visual/settings/frame-filters.d.ts +3 -2
  469. package/dist/types/components/visual/settings/inline-filters-settings.d.ts +2 -1
  470. package/dist/types/components/visual/settings/kpi-settings.d.ts +1 -1
  471. package/dist/types/components/visual/settings/map-chart-settings.d.ts +1 -1
  472. package/dist/types/components/visual/settings/scale-options.d.ts +1 -1
  473. package/dist/types/components/visual/settings/table-column-visibility-settings.d.ts +1 -1
  474. package/dist/types/components/visual/settings/table-presentation-settings.d.ts +4 -4
  475. package/dist/types/components/visual/settings/table-visual-settings.d.ts +1 -1
  476. package/dist/types/components/visual/settings/text-settings.d.ts +1 -1
  477. package/dist/types/components/visual/settings/text-type-radio.d.ts +2 -1
  478. package/dist/types/components/visual/visual-error-state.d.ts +1 -1
  479. package/dist/types/components/visual/visual.d.ts +1 -1
  480. package/dist/types/dashboard-assistant/index.d.ts +4 -25
  481. package/dist/types/data-app-builder/data-app-builder.d.ts +1 -1
  482. package/dist/types/data-app-sdk/devtools/index.d.ts +1 -1
  483. package/dist/types/data-app-sdk/provider.d.ts +1 -1
  484. package/dist/types/lib/charts/types.d.ts +1 -1
  485. package/dist/types/lib/contexts/interactions-popover-context.d.ts +1 -1
  486. package/dist/types/lib/dashboard-inputs/dashboard-input-snapshot.d.ts +26 -6
  487. package/dist/types/lib/document/document-generated-at.d.ts +13 -0
  488. package/dist/types/lib/download-pdf.d.ts +3 -0
  489. package/dist/types/lib/hooks/ai/use-dashboard-assistant.d.ts +1 -5
  490. package/dist/types/lib/hooks/semaphor-ready-indicator.d.ts +1 -1
  491. package/dist/types/lib/hooks/use-card-render-context.d.ts +14 -0
  492. package/dist/types/lib/hooks/use-dashboard-query.d.ts +0 -8
  493. package/dist/types/lib/hooks/use-dashboard.d.ts +3 -5
  494. package/dist/types/lib/hooks/use-is-dashboard-ready.d.ts +3 -0
  495. package/dist/types/lib/matrix-table/matrix-execution-provider.d.ts +1 -1
  496. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +21 -0
  497. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +8 -1
  498. package/dist/types/lib/matrix-table/use-matrix.d.ts +1 -0
  499. package/dist/types/lib/print/print-holds.d.ts +15 -0
  500. package/dist/types/lib/print/print-inputs.d.ts +104 -0
  501. package/dist/types/lib/print/print-sheets.d.ts +16 -0
  502. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
  503. package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +0 -1
  504. package/dist/types/lib/stores/dashboard-store.d.ts +9 -5
  505. package/dist/types/lib/stores/editor-store.d.ts +1 -3
  506. package/dist/types/lib/types/common-types.d.ts +6 -51
  507. package/dist/types/lib/types/token-types.d.ts +3 -3
  508. package/dist/types/lib/utils/build-saved-editor-card.d.ts +15 -0
  509. package/dist/types/lib/utils/dashboard-controls-visibility.d.ts +1 -2
  510. package/dist/types/lib/utils/entity-icon-utils.d.ts +1 -1
  511. package/dist/types/lib/utils/field-icon-utils.d.ts +1 -1
  512. package/dist/types/lib/utils.d.ts +0 -4
  513. package/package.json +7 -6
  514. package/dist/chunks/dashboard-controls-D6Z6ws11.js +0 -2432
  515. package/dist/chunks/edit-dashboard-visual-CYZLUQlx.js +0 -23585
  516. package/dist/types/components/ai/dynamic-visual-host.d.ts +0 -23
  517. package/dist/types/components/ai/persisted-dynamic-visual.d.ts +0 -15
  518. package/dist/types/components/chart-selector/star-button.d.ts +0 -13
  519. package/dist/types/components/editor/dynamic-visualization-menu-items.d.ts +0 -3
  520. package/dist/types/components/editor/editor-main/dynamic-visual-editor.d.ts +0 -13
  521. package/dist/types/components/explorer/chart-configuration/chart-quick-selector.d.ts +0 -19
  522. package/dist/types/components/explorer/spreadsheet/column-header.d.ts +0 -11
  523. package/dist/types/components/explorer/spreadsheet/editor-panel.d.ts +0 -7
  524. package/dist/types/components/explorer/spreadsheet/formula-bar.d.ts +0 -11
  525. package/dist/types/components/explorer/spreadsheet/index.d.ts +0 -5
  526. package/dist/types/components/explorer/spreadsheet/spreadsheet-table.d.ts +0 -10
  527. package/dist/types/components/explorer/spreadsheet/spreadsheet-view.d.ts +0 -5
  528. package/dist/types/components/surfboard/lens/add-lens-dialog.d.ts +0 -9
  529. package/dist/types/components/surfboard/lens/default-lens-checkbox.d.ts +0 -1
  530. package/dist/types/components/surfboard/lens/lens-dropdown.d.ts +0 -10
  531. package/dist/types/components/surfboard/lens/lens-utils.d.ts +0 -21
  532. package/dist/types/lib/ai/dynamic-visual-card-utils.d.ts +0 -70
  533. package/dist/types/lib/ai/dynamic-visual-theme.d.ts +0 -11
  534. package/dist/types/lib/hooks/use-dynamic-fallback-render-context.d.ts +0 -12
  535. package/dist/types/lib/hooks/use-starred-charts.d.ts +0 -1
  536. package/dist/types/lib/stores/starred-charts-store.d.ts +0 -27
@@ -1,2432 +0,0 @@
1
- import { jsx as e, jsxs as o, Fragment as T } from "react/jsx-runtime";
2
- import { u as S, B as U, aB as lt, z as nr, O as aa, Z as na, c as ie, aC as sa, aD as oa, aE as nt, a4 as C, aF as ye, aG as ut, aH as sr, L as Be, aI as or, aJ as ia, D as Ft, Q as $t, V as Gt, W as Bt, Y as zt, X as da, i as ca, aK as la } from "./switch-evlnTA4t.js";
3
- import { bx as ua, by as ma, az as q, aG as ir, bz as pa, aY as W, aH as dr, aI as ha, aJ as st, aK as ot, aF as fa, bA as ve, bB as Ge, bC as ga, bD as Ht, bE as cr, bF as lr, bG as ba, bH as mt, bI as xa, bJ as va, bK as ya, bL as wa, bM as Na, bN as Sa, b7 as we, bO as Ne, bP as Da, bQ as ur, bl as pt, bR as Ca, bS as ka, bT as mr, bU as Ea, bV as pr, bW as V, bX as La, ap as Ia, bY as Ma, bZ as Aa, b_ as Oa, b$ as Pa, m as _a, u as Fe, s as Ra, n as tt, c0 as Ua, c1 as Va, c2 as Ta, c3 as Fa, L as $a, c4 as Ga, c5 as Ba, I as jt, c6 as za, c7 as Ha, c8 as ja, c9 as qa, ca as qt, cb as Kt, cc as Wt, cd as Ka, ce as Wa, cf as Qa, cg as Ja, b0 as Qt, ch as Ya, ci as Xa, cj as Za, r as en, ck as tn, aO as rn, aR as an, aS as nn, aT as sn, aU as on, aV as dn, aW as cn, aX as Jt } from "./index-krDPPQuA.js";
4
- import { c as te, X as hr, C as ln } from "./x-CXDkqdur.js";
5
- import "./card-config-utils-CAyjC5Tp.js";
6
- import "./validators-CsdOtZI6.js";
7
- import "./matrix-operation-contract-D32U2CSw.js";
8
- import "../value-format-preferences/index.js";
9
- import * as M from "react";
10
- import fr, { useState as N, useMemo as ee, useEffect as ze, useRef as Yt, useLayoutEffect as un } from "react";
11
- import "./appearance-context-VJdrKi7r.js";
12
- import "./index-CLIro-EG.js";
13
- import "./field-aggregations-BQjogiI1.js";
14
- import "zod";
15
- import "./matrix-continuation-C4sRcjZU.js";
16
- import "./color-CJvdlFM_.js";
17
- import { createPortal as mn } from "react-dom";
18
- import "./index-B0KwXM6P.js";
19
- import "./appearance-runtime-provider-CC4HT2Gi.js";
20
- import { d as pn, c as hn, u as fn, A as gn, a as bn, g as xn, V as vn, N as yn, h as wn, U as Nn } from "./dashboard-briefing-launcher-BIRnsMqX.js";
21
- import { S as Sn, C as Dn } from "./selection-reducer-CvCBQbl2.js";
22
- import { d as gr } from "./semantic-format-Baqp8kD_.js";
23
- import { c as it } from "./calculated-field-identity-Dy_WpDdo.js";
24
- import { R as Cn } from "./report-preferences-dialog-BA9YJnPe.js";
25
- import { u as kn } from "./use-debounced-dirty-check-BwAbnX_5.js";
26
- import { s as En } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
27
- import { S as Xt } from "./save-DgMfP0j8.js";
28
- import { P as Ln } from "./palette-Cp1hqZtm.js";
29
- import { B as In } from "./braces-8TRlDwDw.js";
30
- /**
31
- * @license lucide-react v0.453.0 - ISC
32
- *
33
- * This source code is licensed under the ISC license.
34
- * See the LICENSE file in the root directory of this source tree.
35
- */
36
- const Mn = te("Glasses", [
37
- ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
38
- ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
39
- ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
40
- ["path", { d: "M2.5 13 5 7c.7-1.3 1.4-2 3-2", key: "1hm1gs" }],
41
- ["path", { d: "M21.5 13 19 7c-.7-1.3-1.5-2-3-2", key: "1r31ai" }]
42
- ]);
43
- /**
44
- * @license lucide-react v0.453.0 - ISC
45
- *
46
- * This source code is licensed under the ISC license.
47
- * See the LICENSE file in the root directory of this source tree.
48
- */
49
- const An = te("Monitor", [
50
- ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
51
- ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
52
- ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
53
- ]);
54
- /**
55
- * @license lucide-react v0.453.0 - ISC
56
- *
57
- * This source code is licensed under the ISC license.
58
- * See the LICENSE file in the root directory of this source tree.
59
- */
60
- const On = te("Moon", [
61
- ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
62
- ]);
63
- /**
64
- * @license lucide-react v0.453.0 - ISC
65
- *
66
- * This source code is licensed under the ISC license.
67
- * See the LICENSE file in the root directory of this source tree.
68
- */
69
- const Pn = te("ShieldX", [
70
- [
71
- "path",
72
- {
73
- d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
74
- key: "oel41y"
75
- }
76
- ],
77
- ["path", { d: "m14.5 9.5-5 5", key: "17q4r4" }],
78
- ["path", { d: "m9.5 9.5 5 5", key: "18nt4w" }]
79
- ]);
80
- /**
81
- * @license lucide-react v0.453.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */
86
- const _n = te("Sun", [
87
- ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
88
- ["path", { d: "M12 2v2", key: "tus03m" }],
89
- ["path", { d: "M12 20v2", key: "1lh1kg" }],
90
- ["path", { d: "m4.93 4.93 1.41 1.41", key: "149t6j" }],
91
- ["path", { d: "m17.66 17.66 1.41 1.41", key: "ptbguv" }],
92
- ["path", { d: "M2 12h2", key: "1t8f8n" }],
93
- ["path", { d: "M20 12h2", key: "1q8mjw" }],
94
- ["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
95
- ["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
96
- ]);
97
- /**
98
- * @license lucide-react v0.453.0 - ISC
99
- *
100
- * This source code is licensed under the ISC license.
101
- * See the LICENSE file in the root directory of this source tree.
102
- */
103
- const Rn = te("UserPlus", [
104
- ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
105
- ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
106
- ["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
107
- ["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }]
108
- ]);
109
- /**
110
- * @license lucide-react v0.453.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */
115
- const br = te("UserRound", [
116
- ["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
117
- ["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
118
- ]);
119
- var dt = { exports: {} }, rt = {};
120
- /**
121
- * @license React
122
- * use-sync-external-store-shim.production.js
123
- *
124
- * Copyright (c) Meta Platforms, Inc. and affiliates.
125
- *
126
- * This source code is licensed under the MIT license found in the
127
- * LICENSE file in the root directory of this source tree.
128
- */
129
- var Zt;
130
- function Un() {
131
- if (Zt) return rt;
132
- Zt = 1;
133
- var t = fr;
134
- function n(l, f) {
135
- return l === f && (l !== 0 || 1 / l === 1 / f) || l !== l && f !== f;
136
- }
137
- var a = typeof Object.is == "function" ? Object.is : n, r = t.useState, s = t.useEffect, c = t.useLayoutEffect, m = t.useDebugValue;
138
- function h(l, f) {
139
- var i = f(), x = r({ inst: { value: i, getSnapshot: f } }), v = x[0].inst, w = x[1];
140
- return c(
141
- function() {
142
- v.value = i, v.getSnapshot = f, b(v) && w({ inst: v });
143
- },
144
- [l, i, f]
145
- ), s(
146
- function() {
147
- return b(v) && w({ inst: v }), l(function() {
148
- b(v) && w({ inst: v });
149
- });
150
- },
151
- [l]
152
- ), m(i), i;
153
- }
154
- function b(l) {
155
- var f = l.getSnapshot;
156
- l = l.value;
157
- try {
158
- var i = f();
159
- return !a(l, i);
160
- } catch {
161
- return !0;
162
- }
163
- }
164
- function g(l, f) {
165
- return f();
166
- }
167
- var u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? g : h;
168
- return rt.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : u, rt;
169
- }
170
- var at = {};
171
- /**
172
- * @license React
173
- * use-sync-external-store-shim.development.js
174
- *
175
- * Copyright (c) Meta Platforms, Inc. and affiliates.
176
- *
177
- * This source code is licensed under the MIT license found in the
178
- * LICENSE file in the root directory of this source tree.
179
- */
180
- var er;
181
- function Vn() {
182
- return er || (er = 1, process.env.NODE_ENV !== "production" && function() {
183
- function t(i, x) {
184
- return i === x && (i !== 0 || 1 / i === 1 / x) || i !== i && x !== x;
185
- }
186
- function n(i, x) {
187
- u || s.startTransition === void 0 || (u = !0, console.error(
188
- "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
189
- ));
190
- var v = x();
191
- if (!l) {
192
- var w = x();
193
- c(v, w) || (console.error(
194
- "The result of getSnapshot should be cached to avoid an infinite loop"
195
- ), l = !0);
196
- }
197
- w = m({
198
- inst: { value: v, getSnapshot: x }
199
- });
200
- var D = w[0].inst, E = w[1];
201
- return b(
202
- function() {
203
- D.value = v, D.getSnapshot = x, a(D) && E({ inst: D });
204
- },
205
- [i, v, x]
206
- ), h(
207
- function() {
208
- return a(D) && E({ inst: D }), i(function() {
209
- a(D) && E({ inst: D });
210
- });
211
- },
212
- [i]
213
- ), g(v), v;
214
- }
215
- function a(i) {
216
- var x = i.getSnapshot;
217
- i = i.value;
218
- try {
219
- var v = x();
220
- return !c(i, v);
221
- } catch {
222
- return !0;
223
- }
224
- }
225
- function r(i, x) {
226
- return x();
227
- }
228
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
229
- var s = fr, c = typeof Object.is == "function" ? Object.is : t, m = s.useState, h = s.useEffect, b = s.useLayoutEffect, g = s.useDebugValue, u = !1, l = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
230
- at.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
231
- }()), at;
232
- }
233
- process.env.NODE_ENV === "production" ? dt.exports = Un() : dt.exports = Vn();
234
- var Tn = dt.exports;
235
- const $e = ["light", "dark", "system"];
236
- function Fn() {
237
- const { theme: t, setTheme: n } = ua(), a = S(
238
- (m) => m.actions.setDashboardTheme
239
- );
240
- function r() {
241
- const m = $e.includes(t) ? t : "system", h = $e[($e.indexOf(m) + 1) % $e.length];
242
- n(h), a(h);
243
- }
244
- const s = t === "light" ? _n : t === "dark" ? On : An, c = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
245
- return /* @__PURE__ */ e(
246
- U,
247
- {
248
- type: "button",
249
- variant: "ghost",
250
- size: "xs",
251
- className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
252
- onClick: r,
253
- "aria-label": c,
254
- title: c,
255
- children: /* @__PURE__ */ e(s, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
256
- }
257
- );
258
- }
259
- function xr(t) {
260
- const n = (/* @__PURE__ */ new Date()).toISOString(), a = ma({
261
- dashboard: t.dashboard,
262
- sheetIds: (t.dashboard.sheets || []).filter((r) => r.kind !== "document").map((r) => r.id),
263
- sheetKind: "dashboard",
264
- mode: "dashboard",
265
- generatedAt: n,
266
- // A Lens persists the dashboard's own input values, never a session's carried state.
267
- transientContexts: void 0,
268
- runtimeValues: {
269
- dashboardInputValues: t.dashboardInputValues,
270
- filterValues: t.filterValues,
271
- controlValues: t.controlValues,
272
- inlineFilterValuesMap: t.inlineFilterValuesMap,
273
- cardControlValuesMap: t.cardControlValuesMap
274
- }
275
- }).snapshot;
276
- return {
277
- generatedAt: n,
278
- dashboardInputValues: a.dashboardInputValues
279
- };
280
- }
281
- async function $n(t, n, a, r, s, c) {
282
- if (!c)
283
- return null;
284
- const m = JSON.stringify(a), h = `${t}/v1/lens`;
285
- return await lt(h, c, {
286
- name: n,
287
- template: m,
288
- filterValues: r,
289
- inputValues: s,
290
- operation: "create"
291
- });
292
- }
293
- async function ct(t, n, a) {
294
- if (!a)
295
- return null;
296
- const {
297
- id: r,
298
- template: s,
299
- filterValues: c,
300
- inputValues: m,
301
- isDefault: h,
302
- shared: b
303
- } = n, g = `${t}/v1/lens`;
304
- return await lt(g, a, {
305
- lensId: r,
306
- template: s,
307
- filterValues: c,
308
- inputValues: m,
309
- isDefault: h,
310
- shared: b,
311
- operation: "update"
312
- });
313
- }
314
- async function Gn(t, n, a) {
315
- if (!a)
316
- return null;
317
- const r = `${t}/v1/lens`;
318
- return await lt(r, a, {
319
- operation: "delete",
320
- lensId: n
321
- });
322
- }
323
- const Bn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
324
- function zn({
325
- open: t,
326
- onOpenChange: n
327
- } = {}) {
328
- const [a, r] = N(""), [s, c] = N(!1), m = S((p) => p.lenses), { setLenses: h, setSelectedLensId: b } = nr(), [g, u] = N(!1), [l, f] = N(!1), i = t !== void 0, x = i ? t : l, v = (p) => {
329
- i || f(p), n == null || n(p);
330
- }, w = S((p) => p.dashboard), D = S((p) => p.filterValues), { authToken: E, tokenProps: $ } = q();
331
- async function I() {
332
- u(!0);
333
- const p = S.getState(), G = xr({
334
- dashboard: w,
335
- dashboardInputValues: p.dashboardInputValues,
336
- filterValues: D,
337
- controlValues: p.controlValues,
338
- inlineFilterValuesMap: p.inlineFilterValuesMap,
339
- cardControlValuesMap: p.cardControlValuesMap
340
- }), F = await $n(
341
- $.apiServiceUrl,
342
- a,
343
- w,
344
- D,
345
- G,
346
- E == null ? void 0 : E.accessToken
347
- );
348
- F && (h([...m || [], F]), b(F.id), v(!1)), u(!1);
349
- }
350
- return /* @__PURE__ */ o(ir, { open: x, onOpenChange: v, children: [
351
- i ? null : /* @__PURE__ */ e(pa, { asChild: !0, children: /* @__PURE__ */ o(U, { variant: "secondary", size: "xs", children: [
352
- /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" }),
353
- "Lens"
354
- ] }) }),
355
- /* @__PURE__ */ o(dr, { className: "rounded-control border-border/60 sm:max-w-[420px] sm:rounded-control", children: [
356
- /* @__PURE__ */ o(ha, { children: [
357
- /* @__PURE__ */ e(st, { className: "text-[15px]", children: "Create lens" }),
358
- /* @__PURE__ */ e(ot, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
359
- ] }),
360
- /* @__PURE__ */ o("div", { className: "space-y-1.5 py-1", children: [
361
- /* @__PURE__ */ e(aa, { htmlFor: "lens-name", className: Bn, children: "Name" }),
362
- /* @__PURE__ */ e(
363
- na,
364
- {
365
- id: "lens-name",
366
- size: "xs",
367
- value: a,
368
- placeholder: "Monthly review, West region, …",
369
- onChange: (p) => r(p.target.value)
370
- }
371
- ),
372
- s && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: "A lens with this name already exists. Pick a different one." })
373
- ] }),
374
- /* @__PURE__ */ o(fa, { children: [
375
- /* @__PURE__ */ e(U, { variant: "outline", size: "xs", onClick: () => v(!1), children: "Cancel" }),
376
- /* @__PURE__ */ e(
377
- U,
378
- {
379
- size: "xs",
380
- type: "submit",
381
- onClick: I,
382
- disabled: g || !a.trim(),
383
- children: g ? "Creating…" : "Create"
384
- }
385
- )
386
- ] })
387
- ] })
388
- ] });
389
- }
390
- function Hn({ includeLabel: t = !1 } = {}) {
391
- const n = S((u) => u.lenses), a = S((u) => u.selectedLensId), { setLenses: r, setSelectedLensId: s } = nr(), { authToken: c, tokenProps: m } = q();
392
- async function h(u) {
393
- s(u);
394
- }
395
- async function b(u) {
396
- if (await Gn(m.apiServiceUrl, u, c == null ? void 0 : c.accessToken)) {
397
- const f = n == null ? void 0 : n.filter((i) => i.id !== u);
398
- r(f || []), s("original");
399
- }
400
- }
401
- async function g(u) {
402
- const l = n == null ? void 0 : n.map((x) => x.id === u.id ? {
403
- ...x,
404
- isDefault: !u.isDefault
405
- } : {
406
- ...x,
407
- isDefault: !1
408
- });
409
- r(l || []);
410
- const f = {
411
- ...u,
412
- isDefault: !u.isDefault
413
- };
414
- await ct(m.apiServiceUrl, f, c == null ? void 0 : c.accessToken);
415
- const i = n == null ? void 0 : n.find((x) => x.isDefault);
416
- if (i && i.id !== u.id) {
417
- const x = {
418
- ...i,
419
- isDefault: !1
420
- };
421
- await ct(m.apiServiceUrl, x, c == null ? void 0 : c.accessToken);
422
- }
423
- }
424
- return /* @__PURE__ */ o(T, { children: [
425
- t ? /* @__PURE__ */ o(T, { children: [
426
- /* @__PURE__ */ e(ve, { className: "px-3", children: "Lenses" }),
427
- /* @__PURE__ */ e(Ge, {})
428
- ] }) : null,
429
- /* @__PURE__ */ o(
430
- ga,
431
- {
432
- value: a,
433
- onValueChange: h,
434
- children: [
435
- /* @__PURE__ */ e(Ht, { value: "original", children: "Original" }),
436
- n == null ? void 0 : n.map((u) => /* @__PURE__ */ o(
437
- Ht,
438
- {
439
- className: "group flex justify-between gap-2",
440
- value: u.id,
441
- children: [
442
- /* @__PURE__ */ e("p", { children: u.name }),
443
- /* @__PURE__ */ o("span", { className: "flex items-center gap-3", children: [
444
- /* @__PURE__ */ e(
445
- cr,
446
- {
447
- onClick: (l) => {
448
- l.preventDefault(), g(u);
449
- },
450
- className: ie(
451
- "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
452
- {
453
- invisible: !u.isDefault,
454
- "text-green-500": u.isDefault
455
- }
456
- ),
457
- strokeWidth: 1.5
458
- }
459
- ),
460
- /* @__PURE__ */ e(
461
- lr,
462
- {
463
- onClick: (l) => {
464
- l.preventDefault(), b(u.id);
465
- },
466
- className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
467
- strokeWidth: 1.5
468
- }
469
- )
470
- ] })
471
- ]
472
- },
473
- u.id
474
- ))
475
- ]
476
- }
477
- )
478
- ] });
479
- }
480
- function jn() {
481
- const { displayPreferences: t, shouldShowElement: n } = ba(), { currentUser: a, userContext: r } = mt(), s = ee(
482
- () => xa(a),
483
- [a]
484
- ), c = ee(() => (h) => s && s[h] !== void 0 && s[h] === !1 ? !1 : n(h), [s, n, t]), m = ee(
485
- () => {
486
- var h, b, g, u, l;
487
- return {
488
- canEdit: ((h = r == null ? void 0 : r.permissions) == null ? void 0 : h.canEdit) ?? Sa(a),
489
- canUseFilters: ((b = r == null ? void 0 : r.permissions) == null ? void 0 : b.canEdit) ?? Na(a),
490
- canManageDashboards: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canCreateDashboard) ?? wa(a),
491
- canCreateDashboards: ((u = r == null ? void 0 : r.permissions) == null ? void 0 : u.canCreateDashboard) ?? ya(a),
492
- canAccessVisuals: ((l = r == null ? void 0 : r.permissions) == null ? void 0 : l.canEdit) ?? va(a)
493
- };
494
- },
495
- [a, r]
496
- );
497
- return {
498
- displayPreferences: t,
499
- shouldShowElement: c,
500
- permissions: m,
501
- currentUser: a
502
- };
503
- }
504
- function qn(t, n = []) {
505
- let a = [];
506
- function r(c, m) {
507
- const h = M.createContext(m);
508
- h.displayName = c + "Context";
509
- const b = a.length;
510
- a = [...a, m];
511
- const g = (l) => {
512
- var D;
513
- const { scope: f, children: i, ...x } = l, v = ((D = f == null ? void 0 : f[t]) == null ? void 0 : D[b]) || h, w = M.useMemo(() => x, Object.values(x));
514
- return /* @__PURE__ */ e(v.Provider, { value: w, children: i });
515
- };
516
- g.displayName = c + "Provider";
517
- function u(l, f) {
518
- var v;
519
- const i = ((v = f == null ? void 0 : f[t]) == null ? void 0 : v[b]) || h, x = M.useContext(i);
520
- if (x) return x;
521
- if (m !== void 0) return m;
522
- throw new Error(`\`${l}\` must be used within \`${c}\``);
523
- }
524
- return [g, u];
525
- }
526
- const s = () => {
527
- const c = a.map((m) => M.createContext(m));
528
- return function(h) {
529
- const b = (h == null ? void 0 : h[t]) || c;
530
- return M.useMemo(
531
- () => ({ [`__scope${t}`]: { ...h, [t]: b } }),
532
- [h, b]
533
- );
534
- };
535
- };
536
- return s.scopeName = t, [r, Kn(s, ...n)];
537
- }
538
- function Kn(...t) {
539
- const n = t[0];
540
- if (t.length === 1) return n;
541
- const a = () => {
542
- const r = t.map((s) => ({
543
- useScope: s(),
544
- scopeName: s.scopeName
545
- }));
546
- return function(c) {
547
- const m = r.reduce((h, { useScope: b, scopeName: g }) => {
548
- const l = b(c)[`__scope${g}`];
549
- return { ...h, ...l };
550
- }, {});
551
- return M.useMemo(() => ({ [`__scope${n.scopeName}`]: m }), [m]);
552
- };
553
- };
554
- return a.scopeName = n.scopeName, a;
555
- }
556
- var Wn = [
557
- "a",
558
- "button",
559
- "div",
560
- "form",
561
- "h2",
562
- "h3",
563
- "img",
564
- "input",
565
- "label",
566
- "li",
567
- "nav",
568
- "ol",
569
- "p",
570
- "select",
571
- "span",
572
- "svg",
573
- "ul"
574
- ], ht = Wn.reduce((t, n) => {
575
- const a = sa(`Primitive.${n}`), r = M.forwardRef((s, c) => {
576
- const { asChild: m, ...h } = s, b = m ? a : n;
577
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(b, { ...h, ref: c });
578
- });
579
- return r.displayName = `Primitive.${n}`, { ...t, [n]: r };
580
- }, {});
581
- function Qn() {
582
- return Tn.useSyncExternalStore(
583
- Jn,
584
- () => !0,
585
- () => !1
586
- );
587
- }
588
- function Jn() {
589
- return () => {
590
- };
591
- }
592
- var ft = "Avatar", [Yn] = qn(ft), [Xn, vr] = Yn(ft), yr = M.forwardRef(
593
- (t, n) => {
594
- const { __scopeAvatar: a, ...r } = t, [s, c] = M.useState("idle");
595
- return /* @__PURE__ */ e(
596
- Xn,
597
- {
598
- scope: a,
599
- imageLoadingStatus: s,
600
- onImageLoadingStatusChange: c,
601
- children: /* @__PURE__ */ e(ht.span, { ...r, ref: n })
602
- }
603
- );
604
- }
605
- );
606
- yr.displayName = ft;
607
- var wr = "AvatarImage", Nr = M.forwardRef(
608
- (t, n) => {
609
- const { __scopeAvatar: a, src: r, onLoadingStatusChange: s = () => {
610
- }, ...c } = t, m = vr(wr, a), h = Zn(r, c), b = oa((g) => {
611
- s(g), m.onImageLoadingStatusChange(g);
612
- });
613
- return nt(() => {
614
- h !== "idle" && b(h);
615
- }, [h, b]), h === "loaded" ? /* @__PURE__ */ e(ht.img, { ...c, ref: n, src: r }) : null;
616
- }
617
- );
618
- Nr.displayName = wr;
619
- var Sr = "AvatarFallback", Dr = M.forwardRef(
620
- (t, n) => {
621
- const { __scopeAvatar: a, delayMs: r, ...s } = t, c = vr(Sr, a), [m, h] = M.useState(r === void 0);
622
- return M.useEffect(() => {
623
- if (r !== void 0) {
624
- const b = window.setTimeout(() => h(!0), r);
625
- return () => window.clearTimeout(b);
626
- }
627
- }, [r]), m && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(ht.span, { ...s, ref: n }) : null;
628
- }
629
- );
630
- Dr.displayName = Sr;
631
- function tr(t, n) {
632
- return t ? n ? (t.src !== n && (t.src = n), t.complete && t.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
633
- }
634
- function Zn(t, { referrerPolicy: n, crossOrigin: a }) {
635
- const r = Qn(), s = M.useRef(null), c = r ? (s.current || (s.current = new window.Image()), s.current) : null, [m, h] = M.useState(
636
- () => tr(c, t)
637
- );
638
- return nt(() => {
639
- h(tr(c, t));
640
- }, [c, t]), nt(() => {
641
- const b = (l) => () => {
642
- h(l);
643
- };
644
- if (!c) return;
645
- const g = b("loaded"), u = b("error");
646
- return c.addEventListener("load", g), c.addEventListener("error", u), n && (c.referrerPolicy = n), typeof a == "string" && (c.crossOrigin = a), () => {
647
- c.removeEventListener("load", g), c.removeEventListener("error", u);
648
- };
649
- }, [c, a, n]), m;
650
- }
651
- var Cr = yr, kr = Nr, Er = Dr;
652
- const Lr = M.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
653
- Cr,
654
- {
655
- ref: a,
656
- className: ie(
657
- "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
658
- t
659
- ),
660
- ...n
661
- }
662
- ));
663
- Lr.displayName = Cr.displayName;
664
- const es = M.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
665
- kr,
666
- {
667
- ref: a,
668
- className: ie("aspect-square h-full w-full", t),
669
- ...n
670
- }
671
- ));
672
- es.displayName = kr.displayName;
673
- const Ir = M.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
674
- Er,
675
- {
676
- ref: a,
677
- className: ie(
678
- "flex h-full w-full items-center justify-center rounded-full bg-muted",
679
- t
680
- ),
681
- ...n
682
- }
683
- ));
684
- Ir.displayName = Er.displayName;
685
- const ts = async (t, n, a) => {
686
- const r = `${t}/management/v1/groups`;
687
- return await sr(r, n, a);
688
- }, rs = async (t, n, a, r) => {
689
- const s = `${t}/management/v1/groups/${a}`;
690
- return ut(s, n, "PATCH", r);
691
- }, as = async (t, n, a) => {
692
- const r = `${t}/management/v1/groups/${a}`;
693
- await ut(r, n, "DELETE");
694
- }, ns = async (t, n, a, r) => {
695
- const s = `${t}/management/v1/groups/${a}/members`;
696
- return await sr(s, n, r);
697
- }, ss = async (t, n, a, r) => {
698
- const s = `${t}/management/v1/groups/${a}/members`;
699
- await ut(s, n, "DELETE", r);
700
- };
701
- function os() {
702
- const { authToken: t, tokenProps: n } = q(), a = we();
703
- return Ne({
704
- mutationFn: (r) => ts(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
705
- onSuccess: () => {
706
- a.invalidateQueries({ queryKey: ["groups"] }), C.success("Group created successfully");
707
- },
708
- onError: (r) => {
709
- console.error("Failed to create group:", r), C.error("Failed to create group", {
710
- description: ye(r, "Failed to create group")
711
- });
712
- }
713
- });
714
- }
715
- function is() {
716
- const { authToken: t, tokenProps: n } = q(), a = we();
717
- return Ne({
718
- mutationFn: ({
719
- groupId: r,
720
- data: s
721
- }) => rs(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
722
- onSuccess: (r, s) => {
723
- a.invalidateQueries({ queryKey: ["group", s.groupId] }), a.invalidateQueries({ queryKey: ["groups"] }), C.success("Group updated successfully");
724
- },
725
- onError: (r) => {
726
- console.error("Failed to update group:", r), C.error("Failed to update group", {
727
- description: ye(r, "Failed to update group")
728
- });
729
- }
730
- });
731
- }
732
- function ds() {
733
- const { authToken: t, tokenProps: n } = q(), a = we();
734
- return Ne({
735
- mutationFn: (r) => as(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
736
- onSuccess: (r, s) => {
737
- a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", s] }), C.success("Group deleted successfully");
738
- },
739
- onError: (r) => {
740
- console.error("Failed to delete group:", r), C.error("Failed to delete group", {
741
- description: ye(r, "Failed to delete group")
742
- });
743
- }
744
- });
745
- }
746
- function cs() {
747
- const { authToken: t, tokenProps: n } = q(), a = we();
748
- return Ne({
749
- mutationFn: ({
750
- groupId: r,
751
- data: s
752
- }) => ns(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
753
- onSuccess: (r, s) => {
754
- a.invalidateQueries({ queryKey: ["group", s.groupId] }), a.invalidateQueries({
755
- queryKey: ["group-members", s.groupId]
756
- }), a.invalidateQueries({ queryKey: ["groups"] }), C.success("Members added successfully");
757
- },
758
- onError: (r) => {
759
- console.error("Failed to add group members:", r), C.error("Failed to add members", {
760
- description: ye(r, "Failed to add members")
761
- });
762
- }
763
- });
764
- }
765
- function ls() {
766
- const { authToken: t, tokenProps: n } = q(), a = we();
767
- return Ne({
768
- mutationFn: ({
769
- groupId: r,
770
- data: s
771
- }) => ss(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
772
- onSuccess: (r, s) => {
773
- a.invalidateQueries({ queryKey: ["group", s.groupId] }), a.invalidateQueries({
774
- queryKey: ["group-members", s.groupId]
775
- }), a.invalidateQueries({ queryKey: ["groups"] }), C.success("Members removed successfully");
776
- },
777
- onError: (r) => {
778
- console.error("Failed to remove group members:", r), C.error("Failed to remove members", {
779
- description: ye(r, "Failed to remove members")
780
- });
781
- }
782
- });
783
- }
784
- const us = [];
785
- function ms({
786
- open: t,
787
- onOpenChange: n
788
- }) {
789
- var E, $, I;
790
- const { tokenProps: a } = q(), { currentUser: r } = mt(), s = (r == null ? void 0 : r.type) === "tenant", c = a == null ? void 0 : a.tenantId, {
791
- groups: m,
792
- isLoading: h,
793
- error: b,
794
- refetch: g
795
- } = Da({
796
- type: s ? "TENANT_GROUP" : "all",
797
- tenantId: s ? c : void 0,
798
- includeMembers: !1
799
- }), u = b ? Mr(b, "Unable to load groups.") : null, [l, f] = N({ kind: "list" }), [i, x] = N(null), v = ds();
800
- ze(() => {
801
- t || (f({ kind: "list" }), x(null));
802
- }, [t]);
803
- const w = l.kind === "members" && m.find((p) => p.id === l.groupId) || null, D = async () => {
804
- if (i)
805
- try {
806
- await v.mutateAsync(i.id), x(null), f({ kind: "list" }), g();
807
- } catch {
808
- }
809
- };
810
- return /* @__PURE__ */ e(ir, { open: t, onOpenChange: n, children: /* @__PURE__ */ o(dr, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
811
- l.kind === "list" ? /* @__PURE__ */ o("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
812
- /* @__PURE__ */ e(st, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
813
- /* @__PURE__ */ e(ot, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
814
- ] }) : l.kind === "create" ? /* @__PURE__ */ o("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
815
- /* @__PURE__ */ e(
816
- "button",
817
- {
818
- type: "button",
819
- onClick: () => f({ kind: "list" }),
820
- "aria-label": "Back",
821
- className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
822
- children: /* @__PURE__ */ e(ur, { className: "h-3.5 w-3.5" })
823
- }
824
- ),
825
- /* @__PURE__ */ e(st, { className: "truncate text-[13px] font-medium", children: "New group" }),
826
- /* @__PURE__ */ e(ot, { className: "sr-only", children: "Create a new group to organize members." })
827
- ] }) : null,
828
- l.kind === "list" && /* @__PURE__ */ e(
829
- ps,
830
- {
831
- groups: m,
832
- isLoading: h,
833
- errorMessage: u,
834
- onRetry: () => g(),
835
- currentUserId: r == null ? void 0 : r.id,
836
- onOpenGroup: (p) => f({ kind: "members", groupId: p }),
837
- onCreate: () => f({ kind: "create" }),
838
- onDeleteRequest: (p) => x(p)
839
- }
840
- ),
841
- l.kind === "members" && w && /* @__PURE__ */ e(
842
- gs,
843
- {
844
- group: w,
845
- isTenantViewer: s,
846
- canEdit: ((E = w.permissions) == null ? void 0 : E.canEdit) ?? w.createdBy === (r == null ? void 0 : r.id),
847
- canDelete: (($ = w.permissions) == null ? void 0 : $.canDelete) ?? w.createdBy === (r == null ? void 0 : r.id),
848
- canManageMembers: ((I = w.permissions) == null ? void 0 : I.canManageMembers) ?? w.createdBy === (r == null ? void 0 : r.id),
849
- onBack: () => f({ kind: "list" }),
850
- onMembersChanged: g,
851
- onUpdated: g,
852
- onRequestDelete: () => x(w)
853
- },
854
- w.id
855
- ),
856
- l.kind === "create" && /* @__PURE__ */ e(
857
- bs,
858
- {
859
- isTenantUser: s,
860
- tenantId: c,
861
- onCancel: () => f({ kind: "list" }),
862
- onCreated: (p) => {
863
- g(), f({ kind: "members", groupId: p });
864
- }
865
- }
866
- ),
867
- i && /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center justify-between gap-3 border-t border-border bg-muted/40 px-5 py-2.5", children: [
868
- /* @__PURE__ */ o("div", { className: "min-w-0 text-[12px] text-foreground", children: [
869
- "Delete ",
870
- /* @__PURE__ */ e("span", { className: "font-medium", children: i.name }),
871
- "?",
872
- /* @__PURE__ */ e("span", { className: "ml-2 text-muted-foreground", children: "Members lose any access granted via this group." })
873
- ] }),
874
- /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center gap-1.5", children: [
875
- /* @__PURE__ */ e(
876
- "button",
877
- {
878
- type: "button",
879
- onClick: () => x(null),
880
- disabled: v.isPending,
881
- className: "h-7 rounded-[5px] px-2.5 text-[12px] font-medium text-foreground/80 hover:bg-background",
882
- children: "Cancel"
883
- }
884
- ),
885
- /* @__PURE__ */ o(
886
- "button",
887
- {
888
- type: "button",
889
- onClick: D,
890
- disabled: v.isPending,
891
- className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-rose-600 px-2.5 text-[12px] font-medium text-white hover:bg-rose-700 disabled:opacity-60",
892
- children: [
893
- v.isPending ? /* @__PURE__ */ e(Be, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(pt, { className: "h-3 w-3" }),
894
- "Delete group"
895
- ]
896
- }
897
- )
898
- ] })
899
- ] })
900
- ] }) });
901
- }
902
- function ps({
903
- groups: t,
904
- isLoading: n,
905
- errorMessage: a,
906
- onRetry: r,
907
- currentUserId: s,
908
- onOpenGroup: c,
909
- onCreate: m,
910
- onDeleteRequest: h
911
- }) {
912
- const [b, g] = N(""), u = ee(
913
- () => t.filter(
914
- (l) => !b.trim() || l.name.toLowerCase().includes(b.toLowerCase()) || (l.description || "").toLowerCase().includes(b.toLowerCase())
915
- ),
916
- [t, b]
917
- );
918
- return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
919
- /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
920
- /* @__PURE__ */ o("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
921
- /* @__PURE__ */ e(Sn, { className: "h-3 w-3 text-muted-foreground" }),
922
- /* @__PURE__ */ e(
923
- "input",
924
- {
925
- value: b,
926
- onChange: (l) => g(l.target.value),
927
- placeholder: "Search groups…",
928
- className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none"
929
- }
930
- ),
931
- b && /* @__PURE__ */ e(
932
- "button",
933
- {
934
- type: "button",
935
- onClick: () => g(""),
936
- className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
937
- children: /* @__PURE__ */ e(hr, { className: "h-2.5 w-2.5" })
938
- }
939
- )
940
- ] }),
941
- /* @__PURE__ */ o(
942
- "button",
943
- {
944
- type: "button",
945
- onClick: m,
946
- className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90",
947
- children: [
948
- /* @__PURE__ */ e(W, { className: "h-3 w-3" }),
949
- "New group"
950
- ]
951
- }
952
- )
953
- ] }),
954
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: n ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((l) => /* @__PURE__ */ e(
955
- "div",
956
- {
957
- className: "h-12 animate-pulse rounded-[4px] bg-muted/60"
958
- },
959
- l
960
- )) }) : a ? /* @__PURE__ */ e(
961
- Ar,
962
- {
963
- title: "Can't load groups",
964
- message: a,
965
- onRetry: r
966
- }
967
- ) : u.length === 0 && t.length === 0 ? /* @__PURE__ */ e(fs, { onCreate: m }) : u.length === 0 ? /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
968
- /* @__PURE__ */ o("div", { className: "text-[12px] text-foreground", children: [
969
- 'No groups match "',
970
- b,
971
- '"'
972
- ] }),
973
- /* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: "Try a different search." })
974
- ] }) : u.map((l) => {
975
- var f;
976
- return /* @__PURE__ */ e(
977
- hs,
978
- {
979
- group: l,
980
- canDelete: ((f = l.permissions) == null ? void 0 : f.canDelete) ?? l.createdBy === s,
981
- onClick: () => c(l.id),
982
- onDelete: () => h(l)
983
- },
984
- l.id
985
- );
986
- }) })
987
- ] });
988
- }
989
- function hs({
990
- group: t,
991
- canDelete: n,
992
- onClick: a,
993
- onDelete: r
994
- }) {
995
- let s = "";
996
- try {
997
- s = gr(new Date(t.createdAt), "MMM d, yyyy");
998
- } catch {
999
- s = "";
1000
- }
1001
- return /* @__PURE__ */ o(
1002
- "button",
1003
- {
1004
- type: "button",
1005
- onClick: a,
1006
- className: "group flex w-full items-center gap-3 border-b border-border/60 px-5 py-2.5 text-left hover:bg-accent/40",
1007
- children: [
1008
- /* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(Ea, { className: "h-3.5 w-3.5" }) }),
1009
- /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
1010
- /* @__PURE__ */ e("div", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
1011
- /* @__PURE__ */ o("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
1012
- /* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1", children: [
1013
- /* @__PURE__ */ e(br, { className: "h-2.5 w-2.5" }),
1014
- t.memberCount,
1015
- " member",
1016
- t.memberCount === 1 ? "" : "s"
1017
- ] }),
1018
- s && /* @__PURE__ */ o(T, { children: [
1019
- /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
1020
- /* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1", children: [
1021
- /* @__PURE__ */ e(pr, { className: "h-2.5 w-2.5" }),
1022
- s
1023
- ] })
1024
- ] }),
1025
- t.description && /* @__PURE__ */ o(T, { children: [
1026
- /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
1027
- /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: t.description })
1028
- ] })
1029
- ] })
1030
- ] }),
1031
- /* @__PURE__ */ o("div", { className: "flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100", children: [
1032
- n && /* @__PURE__ */ e(
1033
- "span",
1034
- {
1035
- role: "button",
1036
- tabIndex: 0,
1037
- onClick: (c) => {
1038
- c.stopPropagation(), r();
1039
- },
1040
- onKeyDown: (c) => {
1041
- (c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.stopPropagation(), r());
1042
- },
1043
- "aria-label": `Delete ${t.name}`,
1044
- className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
1045
- children: /* @__PURE__ */ e(pt, { className: "h-3 w-3" })
1046
- }
1047
- ),
1048
- /* @__PURE__ */ e(Dn, { className: "h-3.5 w-3.5 text-muted-foreground" })
1049
- ] })
1050
- ]
1051
- }
1052
- );
1053
- }
1054
- function fs({ onCreate: t }) {
1055
- return /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
1056
- /* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(mr, { className: "h-4 w-4" }) }),
1057
- /* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
1058
- /* @__PURE__ */ e("div", { className: "max-w-[320px] text-[11.5px] leading-[1.55] text-muted-foreground", children: "Groups let you grant shared access to dashboards. Create one and add members." }),
1059
- /* @__PURE__ */ o(
1060
- "button",
1061
- {
1062
- type: "button",
1063
- onClick: t,
1064
- className: "mt-1 inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90",
1065
- children: [
1066
- /* @__PURE__ */ e(W, { className: "h-3 w-3" }),
1067
- "New group"
1068
- ]
1069
- }
1070
- )
1071
- ] });
1072
- }
1073
- function gs({
1074
- group: t,
1075
- isTenantViewer: n,
1076
- canEdit: a,
1077
- canDelete: r,
1078
- canManageMembers: s,
1079
- onBack: c,
1080
- onMembersChanged: m,
1081
- onUpdated: h,
1082
- onRequestDelete: b
1083
- }) {
1084
- const {
1085
- data: g,
1086
- isLoading: u,
1087
- error: l,
1088
- refetch: f
1089
- } = Ca(t.id), i = (g == null ? void 0 : g.members) ?? us, x = l ? Mr(l, "Unable to load members for this group.") : null, v = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w } = ka({
1090
- type: v,
1091
- tenantId: t.tenantId || void 0,
1092
- active: !0,
1093
- limit: 200
1094
- }), D = ee(
1095
- () => new Set(i.map((y) => y.userId)),
1096
- [i]
1097
- ), E = cs(), $ = ls(), I = is(), [p, G] = N(!1), [F, B] = N(t.name), [P, k] = N(!1), [re, ae] = N(t.description || ""), [Q, Se] = N(""), [De, Ce] = N(!1), ke = ee(() => {
1098
- const y = Q.trim().toLowerCase();
1099
- return w.filter((z) => !D.has(z.id)).filter(
1100
- (z) => !y || (z.name || "").toLowerCase().includes(y) || (z.email || "").toLowerCase().includes(y)
1101
- ).slice(0, 50);
1102
- }, [w, D, Q]), Ee = async () => {
1103
- const y = F.trim();
1104
- if (G(!1), y.length >= 3 && y !== t.name)
1105
- try {
1106
- await I.mutateAsync({
1107
- groupId: t.id,
1108
- data: { name: y }
1109
- }), h();
1110
- } catch {
1111
- }
1112
- }, de = async () => {
1113
- const y = re.trim();
1114
- if (k(!1), y !== (t.description || ""))
1115
- try {
1116
- await I.mutateAsync({
1117
- groupId: t.id,
1118
- data: { description: y }
1119
- }), h();
1120
- } catch {
1121
- }
1122
- }, Le = async (y) => {
1123
- if (s) {
1124
- Se(""), Ce(!1);
1125
- try {
1126
- await E.mutateAsync({
1127
- groupId: t.id,
1128
- data: {
1129
- userIds: [y.id],
1130
- userType: v === "tenant" ? "tenant" : "org"
1131
- }
1132
- }), f(), m();
1133
- } catch {
1134
- }
1135
- }
1136
- }, ce = async (y) => {
1137
- if (s)
1138
- try {
1139
- await $.mutateAsync({
1140
- groupId: t.id,
1141
- data: { userIds: [y] }
1142
- }), f(), m();
1143
- } catch {
1144
- }
1145
- };
1146
- let ne = "";
1147
- try {
1148
- ne = gr(new Date(t.createdAt), "MMM d, yyyy");
1149
- } catch {
1150
- ne = "";
1151
- }
1152
- return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
1153
- /* @__PURE__ */ o("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
1154
- /* @__PURE__ */ e(
1155
- "button",
1156
- {
1157
- type: "button",
1158
- onClick: c,
1159
- "aria-label": "Back",
1160
- className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
1161
- children: /* @__PURE__ */ e(ur, { className: "h-3.5 w-3.5" })
1162
- }
1163
- ),
1164
- p ? /* @__PURE__ */ e(
1165
- "input",
1166
- {
1167
- autoFocus: !0,
1168
- value: F,
1169
- onChange: (y) => B(y.target.value),
1170
- onBlur: Ee,
1171
- onKeyDown: (y) => {
1172
- y.key === "Enter" && Ee(), y.key === "Escape" && (B(t.name), G(!1));
1173
- },
1174
- className: "h-6 min-w-0 flex-1 rounded-[3px] border border-border bg-background px-1.5 text-[13px] font-medium text-foreground focus:border-foreground/40 focus:outline-none"
1175
- }
1176
- ) : /* @__PURE__ */ e(
1177
- "button",
1178
- {
1179
- type: "button",
1180
- onClick: () => {
1181
- a && (B(t.name), G(!0));
1182
- },
1183
- title: a ? "Click to rename" : t.name,
1184
- disabled: !a,
1185
- className: "truncate rounded-[3px] px-1 text-[13px] font-medium text-foreground enabled:hover:bg-accent disabled:cursor-default",
1186
- children: t.name
1187
- }
1188
- ),
1189
- /* @__PURE__ */ o("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
1190
- /* @__PURE__ */ e(br, { className: "h-2.5 w-2.5" }),
1191
- i.length,
1192
- " member",
1193
- i.length === 1 ? "" : "s"
1194
- ] })
1195
- ] }),
1196
- /* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: P ? /* @__PURE__ */ o("div", { children: [
1197
- /* @__PURE__ */ e(
1198
- "textarea",
1199
- {
1200
- autoFocus: !0,
1201
- rows: 2,
1202
- value: re,
1203
- onChange: (y) => ae(y.target.value),
1204
- maxLength: 200,
1205
- onKeyDown: (y) => {
1206
- y.key === "Escape" && (ae(t.description || ""), k(!1)), y.key === "Enter" && (y.metaKey || y.ctrlKey) && de();
1207
- },
1208
- placeholder: "What is this group for?",
1209
- className: "block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
1210
- }
1211
- ),
1212
- /* @__PURE__ */ o("div", { className: "mt-1.5 flex items-center justify-between", children: [
1213
- /* @__PURE__ */ o("span", { className: "text-[10.5px] text-muted-foreground", children: [
1214
- re.length,
1215
- "/200 · Esc to cancel · ⌘↩ to save"
1216
- ] }),
1217
- /* @__PURE__ */ o("div", { className: "flex items-center gap-1.5", children: [
1218
- /* @__PURE__ */ e(
1219
- "button",
1220
- {
1221
- type: "button",
1222
- onClick: () => {
1223
- ae(t.description || ""), k(!1);
1224
- },
1225
- className: "h-6 rounded-[5px] px-2 text-[11px] font-medium text-foreground/80 hover:bg-accent",
1226
- children: "Cancel"
1227
- }
1228
- ),
1229
- /* @__PURE__ */ e(
1230
- "button",
1231
- {
1232
- type: "button",
1233
- onClick: de,
1234
- className: "inline-flex h-6 items-center rounded-[5px] bg-foreground px-2 text-[11px] font-medium text-background hover:opacity-90",
1235
- children: "Save"
1236
- }
1237
- )
1238
- ] })
1239
- ] })
1240
- ] }) : /* @__PURE__ */ o(
1241
- "button",
1242
- {
1243
- type: "button",
1244
- onClick: () => {
1245
- a && (ae(t.description || ""), k(!0));
1246
- },
1247
- disabled: !a,
1248
- title: a ? "Click to edit description" : void 0,
1249
- className: "block w-full rounded-[3px] px-1 py-0.5 text-left enabled:hover:bg-accent/40 disabled:cursor-default",
1250
- children: [
1251
- t.description ? /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: t.description }) : /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: a ? "Add a description…" : "No description" }),
1252
- /* @__PURE__ */ o("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
1253
- ne ? `Created ${ne}` : "Recently created",
1254
- a ? " · You can edit this group" : ""
1255
- ] })
1256
- ]
1257
- }
1258
- ) }),
1259
- s && /* @__PURE__ */ e(
1260
- xs,
1261
- {
1262
- query: Q,
1263
- setQuery: Se,
1264
- open: De,
1265
- setOpen: Ce,
1266
- candidates: ke,
1267
- showKindChip: !n,
1268
- onAdd: Le,
1269
- busy: E.isPending
1270
- }
1271
- ),
1272
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: u ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((y) => /* @__PURE__ */ e(
1273
- "div",
1274
- {
1275
- className: "h-10 animate-pulse rounded-[4px] bg-muted/60"
1276
- },
1277
- y
1278
- )) }) : x ? /* @__PURE__ */ e(
1279
- Ar,
1280
- {
1281
- title: "Can't load members",
1282
- message: x,
1283
- onRetry: () => f()
1284
- }
1285
- ) : i.length === 0 ? /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
1286
- /* @__PURE__ */ e("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
1287
- /* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: s ? "Search above to add people to this group." : "This group does not have any members." })
1288
- ] }) : i.map((y) => {
1289
- var z, le, Ie, J, Y, X;
1290
- return /* @__PURE__ */ o(
1291
- "div",
1292
- {
1293
- className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
1294
- children: [
1295
- /* @__PURE__ */ e(Or, { name: ((z = y.user) == null ? void 0 : z.name) || ((le = y.user) == null ? void 0 : le.email) || "?" }),
1296
- /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
1297
- /* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((Ie = y.user) == null ? void 0 : Ie.name) || ((J = y.user) == null ? void 0 : J.email) || "Unknown" }),
1298
- ((Y = y.user) == null ? void 0 : Y.email) && y.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: y.user.email })
1299
- ] }),
1300
- !n && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: y.userType }),
1301
- /* @__PURE__ */ e(
1302
- "button",
1303
- {
1304
- type: "button",
1305
- onClick: () => ce(y.userId),
1306
- disabled: !s || $.isPending,
1307
- "aria-label": `Remove ${((X = y.user) == null ? void 0 : X.name) || "member"}`,
1308
- className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100 disabled:opacity-30",
1309
- children: /* @__PURE__ */ e(hr, { className: "h-3 w-3" })
1310
- }
1311
- )
1312
- ]
1313
- },
1314
- y.id
1315
- );
1316
- }) }),
1317
- r && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: /* @__PURE__ */ o(
1318
- "button",
1319
- {
1320
- type: "button",
1321
- onClick: b,
1322
- className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] border border-rose-200 bg-background px-2.5 text-[12px] font-medium text-rose-600 hover:bg-rose-50 dark:border-rose-900/60 dark:text-rose-400 dark:hover:bg-rose-950/30",
1323
- children: [
1324
- /* @__PURE__ */ e(pt, { className: "h-3 w-3" }),
1325
- "Delete group"
1326
- ]
1327
- }
1328
- ) })
1329
- ] });
1330
- }
1331
- function bs({
1332
- isTenantUser: t,
1333
- tenantId: n,
1334
- onCancel: a,
1335
- onCreated: r
1336
- }) {
1337
- const [s, c] = N(""), [m, h] = N(""), [b, g] = N(null), u = os(), l = s.trim().length >= 3 && s.trim().length <= 50, f = async () => {
1338
- if (!l) return;
1339
- g(null);
1340
- const i = {
1341
- name: s.trim(),
1342
- description: m.trim() || void 0,
1343
- type: t ? "TENANT_GROUP" : "ORG_GROUP",
1344
- ...t && n ? { tenantId: n } : {}
1345
- };
1346
- try {
1347
- const x = await u.mutateAsync(i), v = x == null ? void 0 : x.id;
1348
- v ? r(v) : a();
1349
- } catch (x) {
1350
- g(x instanceof Error ? x.message : "Failed to create group");
1351
- }
1352
- };
1353
- return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
1354
- /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
1355
- /* @__PURE__ */ e(rr, { children: "Name" }),
1356
- /* @__PURE__ */ e(
1357
- "input",
1358
- {
1359
- autoFocus: !0,
1360
- value: s,
1361
- onChange: (i) => c(i.target.value),
1362
- placeholder: "Marketing leads, North America sales, …",
1363
- maxLength: 50,
1364
- className: "mt-1 block h-7 w-full rounded-[5px] border border-border bg-background px-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
1365
- }
1366
- ),
1367
- /* @__PURE__ */ e("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
1368
- /* @__PURE__ */ o("div", { className: "mt-4", children: [
1369
- /* @__PURE__ */ e(rr, { children: "Description (optional)" }),
1370
- /* @__PURE__ */ e(
1371
- "textarea",
1372
- {
1373
- rows: 2,
1374
- value: m,
1375
- onChange: (i) => h(i.target.value),
1376
- maxLength: 200,
1377
- placeholder: "What is this group for?",
1378
- className: "mt-1 block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
1379
- }
1380
- ),
1381
- /* @__PURE__ */ o("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
1382
- m.length,
1383
- "/200"
1384
- ] })
1385
- ] }),
1386
- b && /* @__PURE__ */ e("div", { className: "mt-3 rounded-[5px] border border-rose-200 bg-rose-50 px-2 py-1.5 text-[11.5px] text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300", children: b })
1387
- ] }),
1388
- /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: [
1389
- /* @__PURE__ */ e(
1390
- "button",
1391
- {
1392
- type: "button",
1393
- onClick: a,
1394
- disabled: u.isPending,
1395
- className: "h-7 rounded-[5px] px-2.5 text-[12px] font-medium text-foreground/80 hover:bg-accent",
1396
- children: "Cancel"
1397
- }
1398
- ),
1399
- /* @__PURE__ */ e(
1400
- "button",
1401
- {
1402
- type: "button",
1403
- onClick: f,
1404
- disabled: !l || u.isPending,
1405
- className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
1406
- children: u.isPending ? /* @__PURE__ */ o(T, { children: [
1407
- /* @__PURE__ */ e(Be, { className: "h-3 w-3 animate-spin" }),
1408
- "Creating…"
1409
- ] }) : /* @__PURE__ */ o(T, { children: [
1410
- /* @__PURE__ */ e(W, { className: "h-3 w-3" }),
1411
- "Create group"
1412
- ] })
1413
- }
1414
- )
1415
- ] })
1416
- ] });
1417
- }
1418
- function xs({
1419
- query: t,
1420
- setQuery: n,
1421
- open: a,
1422
- setOpen: r,
1423
- candidates: s,
1424
- showKindChip: c,
1425
- onAdd: m,
1426
- busy: h
1427
- }) {
1428
- const b = Yt(null), g = Yt(null), [u, l] = N(null);
1429
- un(() => {
1430
- if (!a) {
1431
- l(null);
1432
- return;
1433
- }
1434
- const i = () => {
1435
- const x = b.current;
1436
- if (!x) return;
1437
- const v = x.getBoundingClientRect(), w = 240, E = window.innerHeight - v.bottom < w + 16 && v.top > w;
1438
- l({
1439
- left: v.left,
1440
- top: E ? v.top - 6 : v.bottom + 6,
1441
- width: v.width,
1442
- above: E
1443
- });
1444
- };
1445
- return i(), window.addEventListener("resize", i), window.addEventListener("scroll", i, !0), () => {
1446
- window.removeEventListener("resize", i), window.removeEventListener("scroll", i, !0);
1447
- };
1448
- }, [a, s.length]), ze(() => {
1449
- if (!a) return;
1450
- const i = (x) => {
1451
- var w, D;
1452
- const v = x.target;
1453
- (w = b.current) != null && w.contains(v) || (D = g.current) != null && D.contains(v) || r(!1);
1454
- };
1455
- return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
1456
- }, [a, r]);
1457
- const f = a && s.length > 0 && u;
1458
- return /* @__PURE__ */ o("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
1459
- /* @__PURE__ */ o(
1460
- "div",
1461
- {
1462
- ref: b,
1463
- className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40",
1464
- children: [
1465
- /* @__PURE__ */ e(Rn, { className: "h-3 w-3 text-muted-foreground" }),
1466
- /* @__PURE__ */ e(
1467
- "input",
1468
- {
1469
- value: t,
1470
- onChange: (i) => {
1471
- n(i.target.value), r(!0);
1472
- },
1473
- onFocus: () => r(!0),
1474
- placeholder: "Add a member by name or email…",
1475
- disabled: h,
1476
- className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed"
1477
- }
1478
- )
1479
- ]
1480
- }
1481
- ),
1482
- f && typeof document < "u" && mn(
1483
- /* @__PURE__ */ e(
1484
- "div",
1485
- {
1486
- ref: g,
1487
- style: {
1488
- position: "fixed",
1489
- left: u.left,
1490
- top: u.top,
1491
- width: u.width,
1492
- transform: u.above ? "translateY(-100%)" : void 0
1493
- },
1494
- className: "z-[60] max-h-[240px] overflow-y-auto rounded-[5px] border border-border bg-background shadow-[0_8px_24px_-12px_rgba(0,0,0,0.18)]",
1495
- children: s.map((i) => /* @__PURE__ */ o(
1496
- "button",
1497
- {
1498
- type: "button",
1499
- onClick: () => m(i),
1500
- className: "flex w-full items-center gap-2 border-b border-border/60 px-2.5 py-2 text-left last:border-b-0 hover:bg-accent",
1501
- children: [
1502
- /* @__PURE__ */ e(Or, { name: i.name || i.email || "?" }),
1503
- /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
1504
- /* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children: i.name || i.email || "Unknown" }),
1505
- i.email && i.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: i.email })
1506
- ] }),
1507
- c && i.type && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: i.type === "tenant" ? "tenant" : "org" })
1508
- ]
1509
- },
1510
- i.id
1511
- ))
1512
- }
1513
- ),
1514
- document.body
1515
- )
1516
- ] });
1517
- }
1518
- function Mr(t, n) {
1519
- if (!t) return n;
1520
- if (t instanceof Error) {
1521
- const a = t.message || "", r = a.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
1522
- return r ? r[1] : a || n;
1523
- }
1524
- return typeof t == "string" ? t : n;
1525
- }
1526
- function Ar({
1527
- title: t,
1528
- message: n,
1529
- onRetry: a
1530
- }) {
1531
- return /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-2 px-6 py-10 text-center", children: [
1532
- /* @__PURE__ */ e("div", { className: "text-[12.5px] font-medium text-foreground", children: t }),
1533
- /* @__PURE__ */ e("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children: n }),
1534
- a && /* @__PURE__ */ e(
1535
- "button",
1536
- {
1537
- type: "button",
1538
- onClick: a,
1539
- className: "mt-1 inline-flex h-7 items-center rounded-[5px] border border-border bg-background px-2.5 text-[11.5px] font-medium text-foreground hover:bg-accent",
1540
- children: "Try again"
1541
- }
1542
- )
1543
- ] });
1544
- }
1545
- function rr({ children: t }) {
1546
- return /* @__PURE__ */ e("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: t });
1547
- }
1548
- function Or({ name: t }) {
1549
- const n = t.split(" ").map((a) => a[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
1550
- return /* @__PURE__ */ e(Lr, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(Ir, { className: "text-[9px] font-semibold", children: n || "?" }) });
1551
- }
1552
- function be(t, n, a) {
1553
- var c, m;
1554
- const r = (t.controls || []).find(
1555
- (h) => h.id === a
1556
- );
1557
- if (r)
1558
- return r.label;
1559
- const s = (m = (c = or(t, n)) == null ? void 0 : c.controls) == null ? void 0 : m.find(
1560
- (h) => h.id === a
1561
- );
1562
- return (s == null ? void 0 : s.label) || a;
1563
- }
1564
- function xe(t, n) {
1565
- var a;
1566
- return ((a = or(t, n)) == null ? void 0 : a.title) || n;
1567
- }
1568
- function vs(t) {
1569
- const { errors: n, dashboard: a } = t;
1570
- if (!a)
1571
- return n;
1572
- const r = /* @__PURE__ */ new Map();
1573
- for (const s of n) {
1574
- const c = s.match(
1575
- /^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
1576
- );
1577
- if (c) {
1578
- const [, u, l] = c, f = `${u}:${l}:missing-metric`;
1579
- r.has(f) || r.set(
1580
- f,
1581
- `"${xe(a, u)}" has an outdated "${be(
1582
- a,
1583
- u,
1584
- l
1585
- )}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
1586
- );
1587
- continue;
1588
- }
1589
- const m = s.match(
1590
- /^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
1591
- );
1592
- if (m) {
1593
- const [, u, l] = m, f = `${u}:${l}:missing-group-by`;
1594
- r.has(f) || r.set(
1595
- f,
1596
- `"${xe(a, u)}" has an outdated "${be(
1597
- a,
1598
- u,
1599
- l
1600
- )}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
1601
- );
1602
- continue;
1603
- }
1604
- const h = s.match(
1605
- /^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
1606
- );
1607
- if (h) {
1608
- const [, u, l] = h, f = `${u}:${l}:invalid-metric`;
1609
- r.has(f) || r.set(
1610
- f,
1611
- `"${xe(a, u)}" has an invalid "${be(
1612
- a,
1613
- u,
1614
- l
1615
- )}" metric mapping. Open the card controls and choose a valid metric for each option.`
1616
- );
1617
- continue;
1618
- }
1619
- const b = s.match(
1620
- /^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
1621
- );
1622
- if (b) {
1623
- const [, u, l] = b, f = `${u}:${l}:invalid-group-by`;
1624
- r.has(f) || r.set(
1625
- f,
1626
- `"${xe(a, u)}" has an invalid "${be(
1627
- a,
1628
- u,
1629
- l
1630
- )}" field mapping. Open the card controls and choose a valid field for each option.`
1631
- );
1632
- continue;
1633
- }
1634
- const g = s.match(
1635
- /^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
1636
- );
1637
- if (g) {
1638
- const [, u, l] = g, f = `${u}:${l}:missing-temporal-group-by`;
1639
- r.has(f) || r.set(
1640
- f,
1641
- `"${xe(a, u)}" can no longer use "${be(
1642
- a,
1643
- u,
1644
- l
1645
- )}" for time grain because the card does not currently group by a date field.`
1646
- );
1647
- continue;
1648
- }
1649
- r.set(s, s);
1650
- }
1651
- return Array.from(r.values());
1652
- }
1653
- function ys({
1654
- visible: t,
1655
- onSelect: n
1656
- }) {
1657
- return t ? /* @__PURE__ */ o(V, { onSelect: n, children: [
1658
- /* @__PURE__ */ e(La, { className: "h-3.5 w-3.5" }),
1659
- "Schedule email report"
1660
- ] }) : null;
1661
- }
1662
- function ws({
1663
- scheduleReportVisible: t,
1664
- analyticalBriefingVisible: n,
1665
- onScheduleReport: a,
1666
- onCreateAnalyticalBriefing: r
1667
- }) {
1668
- return /* @__PURE__ */ o(T, { children: [
1669
- /* @__PURE__ */ e(
1670
- ys,
1671
- {
1672
- visible: t,
1673
- onSelect: a
1674
- }
1675
- ),
1676
- n ? /* @__PURE__ */ o(V, { onSelect: r, children: [
1677
- /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" }),
1678
- "Create analytical briefing"
1679
- ] }) : null
1680
- ] });
1681
- }
1682
- function ar(t, n) {
1683
- return {
1684
- dashboard: it(t),
1685
- semanticExecutionPayload: it(n)
1686
- };
1687
- }
1688
- function Ys() {
1689
- var Pt, _t, Rt, Ut, Vt;
1690
- pn(), hn();
1691
- const {
1692
- authToken: t,
1693
- tokenProps: n,
1694
- id: a,
1695
- showBriefings: r
1696
- } = q(), s = Ia(), { isLocalDev: c } = Ma(), {
1697
- canEditDashboard: m,
1698
- hasInspectionUser: h,
1699
- inspectionMessage: b,
1700
- isInspectionMode: g,
1701
- isInspectionSurface: u
1702
- } = Aa(), { openBrandStudioPreview: l } = Oa(), { permissions: f } = jn(), i = Pa(), { isLoading: x } = _a(), v = S((d) => d.theme), w = S((d) => d.isDownloadingPdf), D = S(
1703
- (d) => d.dashboardAssistantDraftScopeKey
1704
- ), E = S((d) => d.lenses), $ = S((d) => d.selectedLensId), I = E == null ? void 0 : E.find((d) => d.id === $), p = S((d) => d.dashboard), G = S((d) => d.selectedSheetId), F = (Pt = p == null ? void 0 : p.sheets) == null ? void 0 : Pt.find(
1705
- (d) => d.id === G
1706
- ), B = ia(F), P = B ? (_t = F == null ? void 0 : F.document) == null ? void 0 : _t.page : void 0, k = S(
1707
- (d) => d.isDashboardEditing
1708
- ), { setDashboardTitle: re } = S((d) => d.actions), [ae, Q] = N(!1), [Se, De] = N(!1), [Ce, ke] = N(!1), [Ee, de] = N(!1), [Le, ce] = N(null), [ne, y] = N(!1), [z, le] = N(!1), [Ie, J] = N(!1), [Y, X] = N(null), [gt, Me] = N([]), [bt, Ae] = N(!1), [Pr, xt] = N(!1), vt = S((d) => d.filterValues), _ = S((d) => d.isVisualEditing);
1709
- Ft((d) => d.card);
1710
- const _r = Fe(
1711
- (d) => d.selectedDashboard
1712
- ), Rr = Fe(
1713
- (d) => d.initialDashboard
1714
- );
1715
- Fe((d) => d.selectedVisual), S((d) => d.selectedFrameId), Ft((d) => d.frame);
1716
- const yt = S(
1717
- (d) => d.showDashboardJSON
1718
- ), He = S((d) => d.onSaveFunction), { setIsDashboardEditing: wt, setShowDashboardJSON: Nt } = S(
1719
- (d) => d.actions
1720
- ), { setInitialDashboard: St, clearSelectedDashboard: je } = Fe(
1721
- (d) => d.actions
1722
- ), ue = !!n.orgUserId || !!(n.tenantId && n.endUserId && n.endUserEmail), { resources: Oe } = Ra(tt.DASHBOARD), { data: qe } = Ua(), Ur = ((Rt = qe == null ? void 0 : qe.preference) == null ? void 0 : Rt.defaultDashboardId) || null, { mutate: Vr, isPending: Tr } = Va(), { currentUser: Fr } = mt(), $r = Ta(Fr), H = _r || Rr, se = Fa({
1723
- config: n.config,
1724
- canNavigateDashboardHub: ue,
1725
- canShareDashboard: ((Ut = H == null ? void 0 : H.permissions) == null ? void 0 : Ut.canShare) === !0,
1726
- canManageGroups: $r
1727
- }), Dt = H ? {
1728
- id: H.id,
1729
- title: (p == null ? void 0 : p.title) || H.title || "Dashboard"
1730
- } : null, { handleAddNewFrame: Gr } = $a(), [Ke, We] = N(!1), [Br, me] = N(!1), [Qe, Pe] = N("close"), pe = Ga(tt.DASHBOARD), [O, he] = N(null), zr = async (d, A) => {
1731
- if (!g) {
1732
- if (!(p != null && p.id)) {
1733
- console.log("No dashboard ID found");
1734
- return;
1735
- }
1736
- console.log("Updating dashboard title:", {
1737
- dashboardId: p.id,
1738
- newTitle: d,
1739
- previousTitle: A
1740
- }), pe.mutate(
1741
- {
1742
- resourceId: p.id,
1743
- data: { title: d }
1744
- },
1745
- {
1746
- onSuccess: () => {
1747
- he(
1748
- (L) => (L == null ? void 0 : L.dashboard.id) === p.id ? {
1749
- ...L,
1750
- dashboard: { ...L.dashboard, title: d }
1751
- } : L
1752
- ), C.success("Dashboard title updated");
1753
- },
1754
- onError: (L) => {
1755
- console.error("Failed to update dashboard title:", L), C.error("Failed to update dashboard title");
1756
- const K = S.getState().dashboard;
1757
- (K == null ? void 0 : K.id) === p.id && K.title === d && re(A);
1758
- }
1759
- }
1760
- );
1761
- }
1762
- };
1763
- ze(() => {
1764
- if (Oe && Oe.length > 0) {
1765
- const d = p == null ? void 0 : p.id;
1766
- if (d) {
1767
- const A = Oe.find(
1768
- (L) => L.id === d
1769
- );
1770
- A && St(A);
1771
- }
1772
- }
1773
- }, [Oe, p == null ? void 0 : p.id, St]);
1774
- const fe = n.orgUserId || n.tenantId, Je = ee(
1775
- () => Ns({
1776
- accessToken: t == null ? void 0 : t.accessToken,
1777
- dashboardId: (p == null ? void 0 : p.id) || a || n.dashboard_id,
1778
- selectedSheetId: B ? G : void 0,
1779
- pageSize: P == null ? void 0 : P.size,
1780
- orientation: P == null ? void 0 : P.orientation,
1781
- theme: v
1782
- }),
1783
- [
1784
- t == null ? void 0 : t.accessToken,
1785
- a,
1786
- p == null ? void 0 : p.id,
1787
- B,
1788
- P == null ? void 0 : P.orientation,
1789
- P == null ? void 0 : P.size,
1790
- G,
1791
- v,
1792
- n.dashboard_id
1793
- ]
1794
- ), Ct = k && !_ && !g && fe && m, { setDashboard: Ye } = S((d) => d.actions), kt = S(
1795
- (d) => d.semanticExecutionPayload
1796
- ), Hr = () => {
1797
- wt(!0);
1798
- }, _e = () => {
1799
- wt(!1), Nt(!1), he(null);
1800
- };
1801
- ze(() => {
1802
- if (!k) {
1803
- O && he(null);
1804
- return;
1805
- }
1806
- O || !p || x || he(
1807
- ar(
1808
- p,
1809
- kt
1810
- )
1811
- );
1812
- }, [
1813
- p,
1814
- O,
1815
- k,
1816
- x,
1817
- kt
1818
- ]);
1819
- const Et = (O == null ? void 0 : O.dashboard) ?? null, { isDirty: Lt, isDirtyPending: jr, resetDirty: ge } = kn(
1820
- p,
1821
- Et,
1822
- 300,
1823
- 1e3,
1824
- En
1825
- ), It = fn(
1826
- Et,
1827
- g,
1828
- m
1829
- ), Mt = Lt || jr, Re = Ke || pe.isPending, qr = () => {
1830
- if (g) {
1831
- O && Ye(O.dashboard, {
1832
- semanticExecutionPayload: O.semanticExecutionPayload
1833
- }), _e(), ge();
1834
- return;
1835
- }
1836
- It() ? (Pe("close"), me(!0)) : (_e(), ge());
1837
- }, Kr = async () => {
1838
- await Xe({
1839
- closeAfterSave: !0,
1840
- navigateHomeAfterSave: Qe === "home"
1841
- });
1842
- }, Wr = () => {
1843
- const d = Qe === "home" && !!ue;
1844
- O && Ye(O.dashboard, {
1845
- semanticExecutionPayload: O.semanticExecutionPayload
1846
- }), _e(), d && je(), Pe("close"), me(!1), ge();
1847
- }, Qr = () => {
1848
- O && (Ye(O.dashboard, {
1849
- semanticExecutionPayload: O.semanticExecutionPayload
1850
- }), ge());
1851
- }, Jr = () => {
1852
- if (ue) {
1853
- if (k && It()) {
1854
- Pe("home"), me(!0);
1855
- return;
1856
- }
1857
- je();
1858
- }
1859
- };
1860
- async function Xe(d) {
1861
- if (g)
1862
- return;
1863
- const A = S.getState().dashboard;
1864
- if (!A)
1865
- return;
1866
- const L = (d == null ? void 0 : d.closeAfterSave) ?? bt, K = (d == null ? void 0 : d.navigateHomeAfterSave) ?? !1;
1867
- Ae(L), L && me(!1);
1868
- const Ze = it(A);
1869
- J(!0), X(null), Me([]), We(!0);
1870
- const ra = {
1871
- template: A
1872
- };
1873
- pe.mutate(
1874
- {
1875
- resourceId: A.id,
1876
- data: ra
1877
- },
1878
- {
1879
- onSuccess: (R) => {
1880
- var Ue, Ve, Tt;
1881
- const Z = (R == null ? void 0 : R.id) || ((Ue = R == null ? void 0 : R.dashboard) == null ? void 0 : Ue.id) || ((Ve = R == null ? void 0 : R.resource) == null ? void 0 : Ve.id) || ((Tt = R == null ? void 0 : R.template) == null ? void 0 : Tt.id) || null;
1882
- if (!A.id && Z) {
1883
- const et = la.getState(), Te = et.pendingDashboardDraftMigration;
1884
- (Te == null ? void 0 : Te.scopeKey) === D ? et.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
1885
- Z
1886
- ) : Te && et.actions.clearPendingDashboardDraftMigration();
1887
- }
1888
- We(!1), C.success("Dashboard saved!"), he(
1889
- ar(
1890
- Ze,
1891
- S.getState().semanticExecutionPayload
1892
- )
1893
- ), J(!1), Ae(!1), L && (_e(), ge(), K && ue && je()), Pe("close");
1894
- },
1895
- onError: (R) => {
1896
- We(!1), X("Failed to save dashboard. Please try again.");
1897
- const Z = R.details, Ue = Array.isArray(
1898
- Z == null ? void 0 : Z.errors
1899
- ) ? (Z.errors || []).filter(
1900
- (Ve) => typeof Ve == "string"
1901
- ) : [];
1902
- Me(
1903
- vs({
1904
- errors: Ue,
1905
- dashboard: A || void 0
1906
- })
1907
- ), C.error("Failed to save dashboard");
1908
- }
1909
- }
1910
- );
1911
- }
1912
- async function Yr() {
1913
- if (g || (Q(!0), !$ || !I)) return;
1914
- const d = S.getState().dashboard;
1915
- if (!d) {
1916
- Q(!1);
1917
- return;
1918
- }
1919
- const A = JSON.stringify(d), L = S.getState(), K = xr({
1920
- dashboard: d,
1921
- dashboardInputValues: L.dashboardInputValues,
1922
- filterValues: vt,
1923
- controlValues: L.controlValues,
1924
- inlineFilterValuesMap: L.inlineFilterValuesMap,
1925
- cardControlValuesMap: L.cardControlValuesMap
1926
- }), Ze = {
1927
- ...I,
1928
- template: A,
1929
- filterValues: vt,
1930
- inputValues: K
1931
- };
1932
- await ct(
1933
- n.apiServiceUrl,
1934
- Ze,
1935
- t == null ? void 0 : t.accessToken
1936
- ), C.success("Lens saved"), He == null || He(d), Q(!1);
1937
- }
1938
- const At = (I == null ? void 0 : I.name) || p.title;
1939
- pe.isPending && console.log("Title during update:", {
1940
- title: At,
1941
- dashboardStateTitle: p.title,
1942
- dashboardId: p == null ? void 0 : p.id,
1943
- currentLensName: I == null ? void 0 : I.name
1944
- });
1945
- const Xr = ue && !!(t != null && t.accessToken) && !!(n != null && n.apiServiceUrl), Zr = !g && se.showDashboardHub && Xr, ea = !g && i && se.showDashboardHub, j = (p == null ? void 0 : p.id) || null, Ot = Ba(
1946
- (Vt = n.config) == null ? void 0 : Vt.showBriefings,
1947
- r
1948
- ), oe = !!j && Ur === j, ta = () => {
1949
- !j || g || Vr({
1950
- dashboardId: oe ? null : j
1951
- });
1952
- };
1953
- return !i && !_ ? null : /* @__PURE__ */ o(
1954
- "div",
1955
- {
1956
- className: "flex min-h-11 shrink-0 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-1.5",
1957
- role: "dashboard-controls",
1958
- children: [
1959
- /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
1960
- ea && !_ && /* @__PURE__ */ e(
1961
- jt,
1962
- {
1963
- "aria-label": "Dashboard Hub",
1964
- tooltip: "Dashboard Hub",
1965
- onClick: Jr,
1966
- className: "h-7 w-7 px-0",
1967
- buttonProps: { size: "xs" },
1968
- children: /* @__PURE__ */ e(za, { className: "h-3.5 w-3.5" })
1969
- }
1970
- ),
1971
- !_ && i && (x ? /* @__PURE__ */ e(
1972
- "div",
1973
- {
1974
- className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
1975
- "aria-label": "Loading dashboard title",
1976
- role: "status",
1977
- children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Loading dashboard title" })
1978
- }
1979
- ) : /* @__PURE__ */ o(T, { children: [
1980
- /* @__PURE__ */ e(
1981
- Ha,
1982
- {
1983
- value: At || "Untitled Dashboard",
1984
- onSave: (d) => {
1985
- console.log("EditableText onSave called:", {
1986
- newTitle: d,
1987
- canEditDashboard: m,
1988
- dashboardId: p == null ? void 0 : p.id
1989
- });
1990
- const A = (p == null ? void 0 : p.title) || "";
1991
- re(d), zr(d, A);
1992
- },
1993
- isEditable: ja({
1994
- isDashboardEditing: k,
1995
- canEditDashboard: m === !0 && !g,
1996
- hasCurrentLens: !!I
1997
- }),
1998
- displayClassName: "text-[13px] font-medium",
1999
- inputClassName: "text-[13px] font-medium",
2000
- placeholder: "Dashboard Title",
2001
- isPending: pe.isPending
2002
- }
2003
- ),
2004
- se.showDashboardHub && oe && /* @__PURE__ */ e(
2005
- "span",
2006
- {
2007
- className: "shrink-0 rounded-[4px] border border-border/60 px-1.5 py-px text-[10px] font-medium uppercase tracking-[0.06em] text-muted-foreground",
2008
- title: "Default dashboard",
2009
- children: "Default"
2010
- }
2011
- ),
2012
- Zr && j && /* @__PURE__ */ e($t, { children: /* @__PURE__ */ o(Gt, { children: [
2013
- /* @__PURE__ */ e(Bt, { asChild: !0, children: /* @__PURE__ */ e(
2014
- U,
2015
- {
2016
- variant: "ghost",
2017
- size: "xs",
2018
- onClick: ta,
2019
- disabled: Tr || !(t != null && t.accessToken) || !(n != null && n.apiServiceUrl),
2020
- className: ie(
2021
- "w-7 px-0",
2022
- oe ? "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary focus-visible:bg-primary/15" : "text-muted-foreground hover:text-foreground"
2023
- ),
2024
- "aria-pressed": oe,
2025
- "aria-label": oe ? "Remove as default dashboard" : "Set as default dashboard",
2026
- children: /* @__PURE__ */ e(cr, { className: "h-3.5 w-3.5" })
2027
- }
2028
- ) }),
2029
- /* @__PURE__ */ e(zt, { children: /* @__PURE__ */ e("p", { children: oe ? "Remove as default dashboard" : "Set as default dashboard" }) })
2030
- ] }) })
2031
- ] }))
2032
- ] }),
2033
- /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
2034
- _ && /* @__PURE__ */ o(T, { children: [
2035
- /* @__PURE__ */ e(gn, {}),
2036
- /* @__PURE__ */ e(bn, {})
2037
- ] }),
2038
- !_ && i && !g && se.showDashboardSharing && /* @__PURE__ */ o(
2039
- U,
2040
- {
2041
- variant: "outline",
2042
- size: "xs",
2043
- onClick: () => De(!0),
2044
- children: [
2045
- /* @__PURE__ */ e(qa, { className: "h-3.5 w-3.5" }),
2046
- "Share"
2047
- ]
2048
- }
2049
- ),
2050
- !_ && k && !g && f.canUseFilters && i && /* @__PURE__ */ e(xn, {}),
2051
- k && !_ && !g && fe && I && c && i && /* @__PURE__ */ o(
2052
- U,
2053
- {
2054
- variant: "secondary",
2055
- size: "xs",
2056
- disabled: ae,
2057
- onClick: Yr,
2058
- children: [
2059
- /* @__PURE__ */ e(Xt, { className: "h-3.5 w-3.5" }),
2060
- "Save Lens"
2061
- ]
2062
- }
2063
- ),
2064
- k && !_ && !g && i && !B && /* @__PURE__ */ o("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
2065
- /* @__PURE__ */ o(
2066
- U,
2067
- {
2068
- variant: "ghost",
2069
- size: "xs",
2070
- disabled: !k,
2071
- onClick: () => void Gr(),
2072
- className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
2073
- children: [
2074
- /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" }),
2075
- "Visual"
2076
- ]
2077
- }
2078
- ),
2079
- /* @__PURE__ */ o(qt, { modal: !1, children: [
2080
- /* @__PURE__ */ e(Kt, { asChild: !0, children: /* @__PURE__ */ e(
2081
- U,
2082
- {
2083
- variant: "ghost",
2084
- size: "xs",
2085
- className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
2086
- "aria-label": "Open visual options",
2087
- disabled: !k,
2088
- children: /* @__PURE__ */ e(ln, { className: "h-3.5 w-3.5" })
2089
- }
2090
- ) }),
2091
- /* @__PURE__ */ e(
2092
- Wt,
2093
- {
2094
- align: "end",
2095
- className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
2096
- children: /* @__PURE__ */ o(V, { onClick: () => xt(!0), children: [
2097
- /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" }),
2098
- "From library..."
2099
- ] })
2100
- }
2101
- )
2102
- ] }),
2103
- /* @__PURE__ */ e(
2104
- vn,
2105
- {
2106
- open: Pr,
2107
- onOpenChange: xt
2108
- }
2109
- )
2110
- ] }),
2111
- !_ && !k && (m || g) && (!u || !h || m !== void 0) && i && /* @__PURE__ */ o("div", { className: "inline-flex items-center gap-1", children: [
2112
- /* @__PURE__ */ o(U, { size: "xs", onClick: Hr, children: [
2113
- /* @__PURE__ */ e(Ka, { className: "h-3.5 w-3.5" }),
2114
- g ? "Inspect" : "Edit"
2115
- ] }),
2116
- b ? /* @__PURE__ */ e($t, { children: /* @__PURE__ */ o(Gt, { children: [
2117
- /* @__PURE__ */ e(Bt, { asChild: !0, children: /* @__PURE__ */ e(
2118
- "button",
2119
- {
2120
- type: "button",
2121
- "aria-label": b,
2122
- className: "inline-flex size-6 items-center justify-center rounded-control text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
2123
- children: /* @__PURE__ */ e(da, { "aria-hidden": "true", className: "size-3.5" })
2124
- }
2125
- ) }),
2126
- /* @__PURE__ */ e(zt, { children: /* @__PURE__ */ e("p", { children: b }) })
2127
- ] }) }) : null
2128
- ] }),
2129
- Ct && i && Lt && /* @__PURE__ */ o(
2130
- U,
2131
- {
2132
- variant: "outline",
2133
- size: "xs",
2134
- onClick: Qr,
2135
- disabled: Re,
2136
- children: [
2137
- /* @__PURE__ */ e(Wa, { className: "h-3.5 w-3.5" }),
2138
- "Undo"
2139
- ]
2140
- }
2141
- ),
2142
- Ct && i && /* @__PURE__ */ o(
2143
- U,
2144
- {
2145
- size: "xs",
2146
- className: ie(!Mt && "opacity-60"),
2147
- disabled: Re || !Mt,
2148
- onClick: () => Xe(),
2149
- children: [
2150
- Re ? /* @__PURE__ */ e(Be, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Xt, { className: "h-3.5 w-3.5" }),
2151
- Re ? "Saving..." : "Save"
2152
- ]
2153
- }
2154
- ),
2155
- k && !_ && i && /* @__PURE__ */ o(U, { variant: "outline", size: "xs", onClick: qr, children: [
2156
- /* @__PURE__ */ e(lr, { className: "h-3.5 w-3.5" }),
2157
- "Close"
2158
- ] }),
2159
- !_ && i && /* @__PURE__ */ e("div", { className: "ml-2 flex items-center", children: /* @__PURE__ */ e(yn, {}) }),
2160
- !_ && c && /* @__PURE__ */ e(Fn, {}),
2161
- !_ && i && !g && /* @__PURE__ */ o(qt, { children: [
2162
- /* @__PURE__ */ e(Kt, { asChild: !0, children: /* @__PURE__ */ e(
2163
- jt,
2164
- {
2165
- tooltip: "More Options",
2166
- className: "w-7 px-0 text-muted-foreground hover:text-foreground",
2167
- buttonProps: {
2168
- size: "xs",
2169
- variant: "ghost",
2170
- "aria-label": "More dashboard options"
2171
- },
2172
- children: /* @__PURE__ */ e(Qa, { className: "h-3.5 w-3.5" })
2173
- }
2174
- ) }),
2175
- /* @__PURE__ */ o(
2176
- Wt,
2177
- {
2178
- align: "end",
2179
- className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
2180
- children: [
2181
- /* @__PURE__ */ e(ve, { children: "Reports & briefings" }),
2182
- /* @__PURE__ */ o(
2183
- V,
2184
- {
2185
- disabled: w,
2186
- onSelect: () => le(!0),
2187
- children: [
2188
- /* @__PURE__ */ e(Ja, { className: "h-3.5 w-3.5" }),
2189
- "Export"
2190
- ]
2191
- }
2192
- ),
2193
- /* @__PURE__ */ e(
2194
- ws,
2195
- {
2196
- scheduleReportVisible: !!(Ot && s.surfaceVisible && j && !k),
2197
- analyticalBriefingVisible: !!(Ot && s.surfaceVisible && j && !k),
2198
- onScheduleReport: () => ce("scheduled_report"),
2199
- onCreateAnalyticalBriefing: () => ce("analytical_briefing")
2200
- }
2201
- ),
2202
- /* @__PURE__ */ e(Ge, {}),
2203
- se.showGroupManagement && /* @__PURE__ */ o(T, { children: [
2204
- /* @__PURE__ */ e(ve, { children: "Access" }),
2205
- /* @__PURE__ */ o(
2206
- V,
2207
- {
2208
- onClick: () => ke(!0),
2209
- children: [
2210
- /* @__PURE__ */ e(mr, { className: "h-3.5 w-3.5" }),
2211
- "Manage Groups"
2212
- ]
2213
- }
2214
- ),
2215
- /* @__PURE__ */ e(Ge, {})
2216
- ] }),
2217
- /* @__PURE__ */ e(ve, { children: "Preferences" }),
2218
- /* @__PURE__ */ o(V, { onClick: () => de(!0), children: [
2219
- /* @__PURE__ */ e(pr, { className: "h-3.5 w-3.5" }),
2220
- "Report preferences"
2221
- ] }),
2222
- c && i && /* @__PURE__ */ o(T, { children: [
2223
- /* @__PURE__ */ e(Ge, {}),
2224
- /* @__PURE__ */ e(ve, { children: "Developer" }),
2225
- /* @__PURE__ */ o(
2226
- V,
2227
- {
2228
- onSelect: () => {
2229
- var d;
2230
- t != null && t.accessToken && ((d = navigator == null ? void 0 : navigator.clipboard) != null && d.writeText ? navigator.clipboard.writeText(t.accessToken).then(
2231
- () => C.success("Token copied to clipboard")
2232
- ).catch(() => C.error("Unable to copy token")) : C.error("Clipboard not available"));
2233
- },
2234
- children: [
2235
- /* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
2236
- "Copy token"
2237
- ]
2238
- }
2239
- ),
2240
- B && /* @__PURE__ */ o(
2241
- V,
2242
- {
2243
- disabled: !Je,
2244
- onSelect: () => {
2245
- var d;
2246
- if (!Je) {
2247
- C.error(
2248
- "Open a document sheet with a token to copy the local PDF URL"
2249
- );
2250
- return;
2251
- }
2252
- (d = navigator == null ? void 0 : navigator.clipboard) != null && d.writeText ? navigator.clipboard.writeText(Je).then(
2253
- () => C.success(
2254
- "Local document PDF URL copied to clipboard"
2255
- )
2256
- ).catch(
2257
- () => C.error(
2258
- "Unable to copy local document PDF URL"
2259
- )
2260
- ) : C.error("Clipboard not available");
2261
- },
2262
- children: [
2263
- /* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
2264
- "Copy local document PDF URL"
2265
- ]
2266
- }
2267
- ),
2268
- /* @__PURE__ */ o(
2269
- V,
2270
- {
2271
- onSelect: () => ca(n.apiServiceUrl),
2272
- children: [
2273
- /* @__PURE__ */ e(Pn, { className: "h-3.5 w-3.5" }),
2274
- "Invalidate token"
2275
- ]
2276
- }
2277
- ),
2278
- /* @__PURE__ */ o(V, { onSelect: l, children: [
2279
- /* @__PURE__ */ e(Ln, { className: "h-3.5 w-3.5" }),
2280
- "Brand Studio"
2281
- ] }),
2282
- k && /* @__PURE__ */ o(
2283
- V,
2284
- {
2285
- onSelect: () => Nt(!yt),
2286
- children: [
2287
- /* @__PURE__ */ e(In, { className: "h-3.5 w-3.5" }),
2288
- yt ? "Hide dashboard JSON" : "Show dashboard JSON"
2289
- ]
2290
- }
2291
- ),
2292
- fe && k && /* @__PURE__ */ o(V, { onSelect: () => y(!0), children: [
2293
- /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" }),
2294
- "Add lens"
2295
- ] }),
2296
- fe && /* @__PURE__ */ o(Ya, { children: [
2297
- /* @__PURE__ */ o(Xa, { children: [
2298
- /* @__PURE__ */ e(Mn, { className: "h-3.5 w-3.5" }),
2299
- "Lenses"
2300
- ] }),
2301
- /* @__PURE__ */ e(Za, { className: "w-60", children: /* @__PURE__ */ e(Hn, {}) })
2302
- ] })
2303
- ] })
2304
- ]
2305
- }
2306
- )
2307
- ] }),
2308
- Se && Dt && /* @__PURE__ */ e(
2309
- en,
2310
- {
2311
- resource: Dt,
2312
- resourceType: tt.DASHBOARD,
2313
- onClose: () => De(!1)
2314
- }
2315
- ),
2316
- se.showGroupManagement && /* @__PURE__ */ e(
2317
- ms,
2318
- {
2319
- open: Ce,
2320
- onOpenChange: ke
2321
- }
2322
- ),
2323
- /* @__PURE__ */ e(
2324
- Cn,
2325
- {
2326
- open: Ee,
2327
- onOpenChange: de
2328
- }
2329
- ),
2330
- j && Le ? /* @__PURE__ */ e(
2331
- wn,
2332
- {
2333
- dashboardId: j,
2334
- dashboardTitle: (p == null ? void 0 : p.title) || (H == null ? void 0 : H.title),
2335
- open: !0,
2336
- onOpenChange: (d) => {
2337
- d || ce(null);
2338
- },
2339
- hideTrigger: !0,
2340
- workflowIntent: Le
2341
- }
2342
- ) : null,
2343
- c && fe && i && /* @__PURE__ */ e(zn, { open: ne, onOpenChange: y }),
2344
- i && /* @__PURE__ */ e(
2345
- tn,
2346
- {
2347
- open: z,
2348
- onOpenChange: le
2349
- }
2350
- ),
2351
- /* @__PURE__ */ e(
2352
- rn,
2353
- {
2354
- open: Ie,
2355
- onOpenChange: (d) => {
2356
- !d && Ke && !Y || (J(d), d || (X(null), Me([]), Ae(!1)));
2357
- },
2358
- children: /* @__PURE__ */ o(an, { className: "max-w-sm", children: [
2359
- /* @__PURE__ */ o(nn, { children: [
2360
- /* @__PURE__ */ e(sn, { children: Y ? "Save failed" : "Saving dashboard" }),
2361
- /* @__PURE__ */ e(on, { className: "pt-2", children: Y ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
2362
- gt.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
2363
- /* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
2364
- /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: gt.slice(0, 5).map((d) => /* @__PURE__ */ e("li", { children: d }, d)) })
2365
- ] })
2366
- ] }),
2367
- /* @__PURE__ */ e(dn, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: Y ? /* @__PURE__ */ o(T, { children: [
2368
- /* @__PURE__ */ e(
2369
- cn,
2370
- {
2371
- onClick: () => {
2372
- J(!1), X(null), Me([]), Ae(!1);
2373
- },
2374
- className: "m-0",
2375
- children: "Close"
2376
- }
2377
- ),
2378
- /* @__PURE__ */ e(
2379
- Jt,
2380
- {
2381
- onClick: () => Xe({
2382
- closeAfterSave: bt,
2383
- navigateHomeAfterSave: Qe === "home"
2384
- }),
2385
- className: "m-0",
2386
- children: "Retry"
2387
- }
2388
- )
2389
- ] }) : /* @__PURE__ */ o(Jt, { disabled: !0, className: "m-0 cursor-default", children: [
2390
- /* @__PURE__ */ e(Be, { className: "mr-2 h-4 w-4 animate-spin" }),
2391
- "Saving..."
2392
- ] }) })
2393
- ] })
2394
- }
2395
- ),
2396
- /* @__PURE__ */ e(
2397
- Nn,
2398
- {
2399
- open: Br,
2400
- onOpenChange: (d) => {
2401
- me(d);
2402
- },
2403
- onSave: Kr,
2404
- onDiscard: Wr,
2405
- isSaving: Ke,
2406
- saveLabel: "Save",
2407
- discardLabel: "Discard changes"
2408
- }
2409
- )
2410
- ] })
2411
- ]
2412
- }
2413
- );
2414
- }
2415
- function Ns({
2416
- accessToken: t,
2417
- dashboardId: n,
2418
- selectedSheetId: a,
2419
- pageSize: r,
2420
- orientation: s,
2421
- theme: c
2422
- }) {
2423
- if (!t || !a)
2424
- return null;
2425
- const m = new URL("http://localhost:5173/print-document");
2426
- m.searchParams.set("token", t), n && m.searchParams.set("dashboardId", n), m.searchParams.set("selectedSheetId", a), c && m.searchParams.set("theme", c);
2427
- const h = new URL("http://127.0.0.1:3002/");
2428
- return h.searchParams.set("pdfMode", "document"), h.searchParams.set("pageSize", r || "letter"), h.searchParams.set("orientation", s || "portrait"), h.searchParams.set("url", m.toString()), h.toString();
2429
- }
2430
- export {
2431
- Ys as default
2432
- };