react-semaphor 0.1.559 → 0.1.561

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 (168) hide show
  1. package/dist/analytics-protocol/index.js +389 -378
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +9 -9
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/analytics-base-schemas-CB3oFAXk.js +658 -0
  7. package/dist/chunks/{assistant-chat-B_4bVE6I.js → assistant-chat-DiVHY3Hw.js} +209 -211
  8. package/dist/chunks/bookmark-impact-CR09dpkn.js +75 -0
  9. package/dist/chunks/bookmark-state-BusLpkb7.js +743 -0
  10. package/dist/chunks/{braces-Rdxa3H-s.js → braces-u8VorWJc.js} +1 -1
  11. package/dist/chunks/{comparison-window-caption-CKzQ5LcF.js → comparison-window-caption-DDsIWJYT.js} +201 -201
  12. package/dist/chunks/{context-DVy4HOU0.js → context-TUjw9eqr.js} +1 -1
  13. package/dist/chunks/{custom-visual-inputs-zVa9wX_o.js → custom-visual-inputs-DfolidZ9.js} +1 -1
  14. package/dist/chunks/{dashboard-BziwOVpZ.js → dashboard-BRdZBPqr.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CbeNR-YI.js → dashboard-briefing-launcher-CgvTLndW.js} +1163 -1178
  16. package/dist/chunks/{dashboard-controls-RD6UJs1r.js → dashboard-controls-B4vfSzTF.js} +877 -941
  17. package/dist/chunks/{dashboard-json-DGpv17vL.js → dashboard-json-Y3MF59g7.js} +5 -5
  18. package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +1718 -0
  19. package/dist/chunks/{edit-dashboard-visual-AQ2pQkFp.js → edit-dashboard-visual-DwjZcxj-.js} +9080 -9354
  20. package/dist/chunks/filter-reach-copy-bijwf_-b.js +3596 -0
  21. package/dist/chunks/{filter-value-text-B4l-xqJT.js → filter-value-text-DFnhwuEW.js} +3 -3
  22. package/dist/chunks/global-date-filter-utils-BXgCpvQM.js +15142 -0
  23. package/dist/chunks/{index-B1Xr7W24.js → index-ClwbY3BL.js} +648 -674
  24. package/dist/chunks/{layout-grid-Bbz3zKif.js → layout-grid-CtvCBfOm.js} +1 -1
  25. package/dist/chunks/{list-filter-3sbH0Uy1.js → list-filter-BklYgciR.js} +1 -1
  26. package/dist/chunks/{matrix-analytical-definition-CEe3PGEo.js → matrix-analytical-definition-pU51-JmY.js} +4 -4
  27. package/dist/chunks/{matrix-card-BRNGb1C4.js → matrix-card-CUorIB7Q.js} +3 -3
  28. package/dist/chunks/{matrix-member-presentation-CEegvTqg.js → matrix-member-presentation-Df5UgCGN.js} +1 -1
  29. package/dist/chunks/{matrix-operation-contract-COxrfQTS.js → matrix-operation-contract-BSiGEXVC.js} +221 -214
  30. package/dist/chunks/{metric-comparison-DQx-uX__.js → metric-comparison-95aC0uEO.js} +6 -6
  31. package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-B5wQhg5G.js} +1 -1
  32. package/dist/chunks/{palette-DMJtp3Vn.js → palette-DTnMhipt.js} +1 -1
  33. package/dist/chunks/pivot-result-contract-expectations-Bo-86vwS.js +56 -0
  34. package/dist/chunks/{pivot-result-identity-CAj8SiRL.js → pivot-result-identity-olvXJoB9.js} +1 -1
  35. package/dist/chunks/{report-preferences-dialog-0sc8B1lh.js → report-preferences-dialog-C2YUIwKG.js} +55 -55
  36. package/dist/chunks/{report-runtime-context-bYoExeWr.js → report-runtime-context-DoIUr3MP.js} +2 -2
  37. package/dist/chunks/resolve-dashboard-input-context-q_iiNXE1.js +6503 -0
  38. package/dist/chunks/{save-DSb1jTtG.js → save-DH4RyrnG.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-BQWM3ldX.js → saved-dashboard-context-8jqfI7hI.js} +59 -59
  40. package/dist/chunks/{selection-reducer-DSzMWb4x.js → selection-reducer-CV7K4FI6.js} +1 -1
  41. package/dist/chunks/{semaphor-ready-indicator-Bz14Oma5.js → semaphor-ready-indicator-E2XWyibu.js} +40105 -41658
  42. package/dist/chunks/{shelf-drop-preview-context-DBHAkgch.js → shelf-drop-preview-context-C29EUzDp.js} +570 -570
  43. package/dist/chunks/{source-entity-resolution-BOrmNCEM.js → source-entity-resolution-BXI3nQ5Z.js} +1 -1
  44. package/dist/chunks/{switch-Dq8XPFpT.js → switch-balDSHc7.js} +3 -3
  45. package/dist/chunks/{table-export-sheet-C_RvEUyO.js → table-export-sheet-CK8tvh4d.js} +1 -1
  46. package/dist/chunks/temporal-input-presentation-B77JsAzU.js +5002 -0
  47. package/dist/chunks/{token-types-LCYMJ3pa.js → token-types-DhYH5YKb.js} +1 -1
  48. package/dist/chunks/{upload-Dr_WAxHQ.js → upload-Ufj8vjyn.js} +1 -1
  49. package/dist/chunks/{use-create-flow-overlay-state-BK3YFkfc.js → use-create-flow-overlay-state-9WsnzEO5.js} +6 -6
  50. package/dist/chunks/{validators-C87JPd-_.js → validators-BtaCFIEB.js} +1206 -1579
  51. package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-CGLVI40Q.js} +1 -1
  52. package/dist/dashboard/index.js +2 -2
  53. package/dist/dashboard-authoring/index.js +2713 -1459
  54. package/dist/data-app-sdk/index.js +20 -20
  55. package/dist/data-app-sdk-adapters/index.js +3 -3
  56. package/dist/data-app-sdk-validation/index.js +10 -10
  57. package/dist/format-utils/index.js +262 -256
  58. package/dist/index.js +214 -215
  59. package/dist/report-runtime-context/index.js +2 -2
  60. package/dist/style.css +1 -1
  61. package/dist/surfboard/index.js +2 -2
  62. package/dist/types/components/dashboard/summary-number-formatter.d.ts +6 -0
  63. package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
  64. package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
  65. package/dist/types/index.js +50 -51
  66. package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
  67. package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
  68. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
  69. package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
  70. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
  71. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  72. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
  73. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  74. package/dist/types/lib/stores/editor-store.d.ts +48 -10
  75. package/dist/types/lib/stores/table-actions.d.ts +9 -5
  76. package/dist/types/lib/table-formatting/index.d.ts +0 -2
  77. package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
  78. package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
  79. package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
  80. package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
  81. package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
  82. package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
  83. package/dist/types/lib/types/common-types.d.ts +40 -47
  84. package/dist/types/lib/types/explorer-types.d.ts +11 -43
  85. package/dist/types/lib/utils/card-config-utils.d.ts +8 -0
  86. package/dist/types/lib/utils/card-definition.d.ts +9 -187
  87. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +169 -513
  88. package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
  89. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
  90. package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
  91. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
  92. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
  93. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
  94. package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
  95. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
  96. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
  97. package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
  98. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
  99. package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
  100. package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
  101. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
  102. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
  103. package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
  104. package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
  105. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +52 -0
  106. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
  107. package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
  108. package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
  109. package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
  110. package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
  111. package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
  112. package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
  113. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +15 -0
  114. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +102 -0
  115. package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
  116. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
  117. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
  118. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +40 -0
  119. package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +28 -0
  120. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
  121. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
  122. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +555 -38
  123. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +27 -8
  124. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +25 -1
  125. package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
  126. package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
  127. package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
  128. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +7 -0
  129. package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
  130. package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
  131. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
  132. package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
  133. package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
  134. package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
  135. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
  136. package/dist/types/shared/dashboard-authoring/index.d.ts +8 -0
  137. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
  138. package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
  139. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
  140. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +21 -1
  141. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +10 -4
  142. package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
  143. package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
  144. package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
  145. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +13 -2
  146. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
  147. package/dist/types/shared/format-utils/index.d.ts +2 -0
  148. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
  149. package/dist/types/shared/format-utils/raw-temporal.d.ts +31 -1
  150. package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
  151. package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
  152. package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
  153. package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
  154. package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
  155. package/package.json +2 -2
  156. package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
  157. package/dist/chunks/bookmark-state-ssqrs5oP.js +0 -111
  158. package/dist/chunks/document-dashboard-inputs-ChVkcBuu.js +0 -3010
  159. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
  160. package/dist/chunks/filter-reach-copy-B5Y7FHzg.js +0 -3411
  161. package/dist/chunks/global-date-filter-utils-DBzEOX9M.js +0 -12222
  162. package/dist/chunks/pivot-result-contract-expectations-DOYhqeZb.js +0 -1926
  163. package/dist/chunks/raw-temporal-presentation-BmT7z6NH.js +0 -584
  164. package/dist/chunks/resolve-dashboard-input-context-B_C_VAJH.js +0 -5520
  165. package/dist/chunks/table-settings-DXj_zXwS.js +0 -637
  166. package/dist/chunks/temporal-input-presentation-AhLSkGPf.js +0 -2939
  167. package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
  168. package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
@@ -1,35 +1,33 @@
1
- import { jsx as t, jsxs as s, Fragment as z } from "react/jsx-runtime";
2
- import Vt, { useState as S, useEffect as xe, useCallback as J, useMemo as te, useLayoutEffect as Dt, useRef as nt, useContext as Bt } from "react";
3
- import { cD as ot, bI as Ie, bJ as Te, bL as Le, cE as ta, b6 as it, b4 as Qe, cF as aa, cG as Ke, cH as lt, a7 as Ge, a4 as ce, u as w, cI as ra, cJ as na, bH as E, cK as sa, a6 as ee, c8 as oa, cL as ia, cM as la, bB as da, a$ as ve, cs as Pt, aS as $e, o as ca, k as ua, cN as ha, cv as dt, cw as ct, cx as ut, cy as ht, cz as mt, cA as pt, cB as ft, cC as Mt, aP as gt, cO as ma, cP as pa, ck as et, ch as Ve, ci as Be, cQ as Ut, cj as Pe, c4 as G, ct as fa, co as We, cR as ga, c2 as ba, bK as bt, bM as xt, cS as xa, bG as va, cT as Ot, bs as vt, cU as ya, bt as Ca, i as wa, cV as Na, bn as Sa, w as ka, t as Da, cW as Aa, cX as Fa, cY as Ea, cZ as K, c_ as Ia, R as zt, c$ as Ta, d0 as La, d1 as Va, d2 as Ba, aM as Pa, d3 as de, d4 as Ma, W as yt, d5 as Ua, d6 as Oa, d7 as za, d8 as Ra, d9 as _a, da as ja, db as $a, dc as Rt, dd as Wa, de as qa, df as Ha, dg as _t, dh as Qa, di as Re, dj as Ka, dk as Ga, dl as Xa, A as Ya, aB as Ja, aC as Za, ah as er, ag as tr, af as ar, ae as rr, ab as nr, a9 as sr, dm as or, dn as ir, dp as lr, dq as dr, dr as cr, az as ur } from "./semaphor-ready-indicator-Bz14Oma5.js";
4
- import { c as fe, B as I, X as Xe, m as De, r as st, L as re, k as jt, d as Ct, j as hr, y as wt, P as Ae, a3 as mr, b as Fe, a as qe, S as $t } from "./switch-Dq8XPFpT.js";
5
- import { L as Ee } from "./layout-grid-Bbz3zKif.js";
1
+ import { jsx as e, jsxs as s, Fragment as R } from "react/jsx-runtime";
2
+ import Mt, { useState as D, useEffect as ve, useCallback as Y, useMemo as ee, useLayoutEffect as Dt, useRef as nt, useContext as Ut } from "react";
3
+ import { cF as ot, bK as Ie, bL as Te, bN as Le, cG as na, b8 as it, b5 as Qe, cH as sa, cI as Ke, cJ as lt, a7 as Ge, a4 as de, u as w, cK as oa, cL as ia, bJ as E, cM as la, a6 as Z, b3 as da, ca, cN as ua, cO as ha, bD as ma, a$ as xe, cu as Ot, aS as $e, o as pa, k as fa, cP as ga, cx as dt, cy as ct, cz as ut, cA as ht, cB as mt, cC as pt, cD as ft, cE as Rt, aP as gt, cQ as ba, cR as va, cm as et, cj as Ve, ck as Be, cS as zt, cl as Pe, c6 as K, cv as xa, cq as We, cT as ya, c4 as Ca, bM as bt, bO as vt, cU as wa, bI as Na, cV as _t, bu as xt, cW as Sa, bv as ka, i as Da, cX as Aa, bp as Fa, w as Ea, t as Ia, cY as Ta, cZ as La, c_ as Va, c$ as ue, d0 as Ba, R as jt, d1 as Pa, d2 as Ma, d3 as Ua, aM as Oa, d4 as Ra, d5 as le, d6 as za, W as yt, d7 as _a, d8 as ja, d9 as $a, da as Wa, db as qa, dc as Ha, dd as Qa, de as $t, df as Ka, dg as Ga, dh as Xa, di as Wt, dj as Ya, dk as ze, dl as Ja, dm as Za, dn as er, A as tr, aB as ar, aC as rr, ah as nr, ag as sr, af as or, ae as ir, ab as lr, a9 as dr, dp as cr, dq as ur, dr as hr, ds as mr, dt as pr, az as fr } from "./semaphor-ready-indicator-E2XWyibu.js";
4
+ import { c as fe, B as T, X as Xe, m as De, r as st, L as ae, k as qt, d as Ct, j as gr, y as wt, P as Ae, a3 as br, b as Fe, a as qe, S as Ht } from "./switch-balDSHc7.js";
5
+ import { L as Ee } from "./layout-grid-CtvCBfOm.js";
6
6
  import "./index-CuHybtft.js";
7
- import { o as pr } from "./validators-C87JPd-_.js";
8
- import "./matrix-operation-contract-COxrfQTS.js";
9
- import "./analytics-base-schemas-BUFUoO6G.js";
7
+ import { o as vr } from "./validators-BtaCFIEB.js";
8
+ import "./matrix-operation-contract-BSiGEXVC.js";
9
+ import "./analytics-base-schemas-CB3oFAXk.js";
10
10
  import "zod";
11
11
  import "../value-format-preferences/index.js";
12
- import { c as Z } from "./_commonjsHelpers-DimLPMtv.js";
12
+ import { c as J } from "./_commonjsHelpers-DimLPMtv.js";
13
13
  import { s as _e } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
14
- import { aL as fr, ay as gr, e3 as He, v as At, e4 as br, as as Nt, e5 as xr, dr as vr, dd as yr, bs as Cr, e6 as wr } from "./global-date-filter-utils-DBzEOX9M.js";
15
- import { f as Nr } from "./editor-draft-sync-BN5qYHPF.js";
16
- import { createPortal as Sr } from "react-dom";
17
- import "./temporal-input-presentation-AhLSkGPf.js";
14
+ import { bp as At, b1 as Ft, dJ as Et, f4 as xr, f5 as He, v as It, f6 as yr, aX as Nt, f7 as Cr, ee as wr, e0 as Nr, c9 as Sr, f8 as kr } from "./global-date-filter-utils-BXgCpvQM.js";
15
+ import { createPortal as Dr } from "react-dom";
16
+ import { aK as Tt } from "./temporal-input-presentation-B77JsAzU.js";
18
17
  import "./index-CJW5BdWT.js";
19
- import { J as kr } from "./table-settings-DXj_zXwS.js";
20
- import { S as Wt } from "./save-DSb1jTtG.js";
21
- import { V as Dr, L as Ar, a as Fr, u as qt, C as Ht, F as Er, b as Ir } from "./use-create-flow-overlay-state-BK3YFkfc.js";
22
- import { m as Tr, k as Qt, n as Kt } from "./report-preferences-dialog-0sc8B1lh.js";
23
- import { t as Ft } from "./pivot-result-contract-expectations-DOYhqeZb.js";
24
- import { g as Lr, f as Vr } from "./document-dashboard-inputs-ChVkcBuu.js";
25
- import { g as le, d as Br, a as Pr } from "./index-B1Xr7W24.js";
18
+ import { P as Ar } from "./bookmark-state-BusLpkb7.js";
19
+ import { S as Qt } from "./save-DH4RyrnG.js";
20
+ import { V as Fr, L as Er, a as Ir, u as Kt, C as Gt, F as Tr, b as Lr } from "./use-create-flow-overlay-state-9WsnzEO5.js";
21
+ import { m as Vr, k as Xt, n as Yt } from "./report-preferences-dialog-C2YUIwKG.js";
22
+ import { g as Br, d as Pr } from "./document-dashboard-inputs-CvBbFTUA.js";
23
+ import { g as ie, d as Mr, a as Ur } from "./index-ClwbY3BL.js";
26
24
  /**
27
25
  * @license lucide-react v0.453.0 - ISC
28
26
  *
29
27
  * This source code is licensed under the ISC license.
30
28
  * See the LICENSE file in the root directory of this source tree.
31
29
  */
32
- const Mr = fe("ArrowUpRight", [
30
+ const Or = fe("ArrowUpRight", [
33
31
  ["path", { d: "M7 7h10v10", key: "1tivn9" }],
34
32
  ["path", { d: "M7 17 17 7", key: "1vkiza" }]
35
33
  ]);
@@ -39,7 +37,7 @@ const Mr = fe("ArrowUpRight", [
39
37
  * This source code is licensed under the ISC license.
40
38
  * See the LICENSE file in the root directory of this source tree.
41
39
  */
42
- const Et = fe("Bell", [
40
+ const Lt = fe("Bell", [
43
41
  ["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
44
42
  ["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }]
45
43
  ]);
@@ -49,7 +47,7 @@ const Et = fe("Bell", [
49
47
  * This source code is licensed under the ISC license.
50
48
  * See the LICENSE file in the root directory of this source tree.
51
49
  */
52
- const Ur = fe("CalendarRange", [
50
+ const Rr = fe("CalendarRange", [
53
51
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
54
52
  ["path", { d: "M16 2v4", key: "4m81vk" }],
55
53
  ["path", { d: "M3 10h18", key: "8toen8" }],
@@ -65,7 +63,7 @@ const Ur = fe("CalendarRange", [
65
63
  * This source code is licensed under the ISC license.
66
64
  * See the LICENSE file in the root directory of this source tree.
67
65
  */
68
- const Or = fe("CodeXml", [
66
+ const zr = fe("CodeXml", [
69
67
  ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
70
68
  ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
71
69
  ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
@@ -76,7 +74,7 @@ const Or = fe("CodeXml", [
76
74
  * This source code is licensed under the ISC license.
77
75
  * See the LICENSE file in the root directory of this source tree.
78
76
  */
79
- const It = fe("MonitorSmartphone", [
77
+ const Vt = fe("MonitorSmartphone", [
80
78
  ["path", { d: "M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8", key: "10dyio" }],
81
79
  ["path", { d: "M10 19v-3.96 3.15", key: "1irgej" }],
82
80
  ["path", { d: "M7 19h5", key: "qswx4l" }],
@@ -88,7 +86,7 @@ const It = fe("MonitorSmartphone", [
88
86
  * This source code is licensed under the ISC license.
89
87
  * See the LICENSE file in the root directory of this source tree.
90
88
  */
91
- const zr = fe("MousePointer2", [
89
+ const _r = fe("MousePointer2", [
92
90
  [
93
91
  "path",
94
92
  {
@@ -103,7 +101,7 @@ const zr = fe("MousePointer2", [
103
101
  * This source code is licensed under the ISC license.
104
102
  * See the LICENSE file in the root directory of this source tree.
105
103
  */
106
- const Rr = fe("Newspaper", [
104
+ const jr = fe("Newspaper", [
107
105
  [
108
106
  "path",
109
107
  {
@@ -115,38 +113,38 @@ const Rr = fe("Newspaper", [
115
113
  ["path", { d: "M15 18h-5", key: "95g1m2" }],
116
114
  ["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
117
115
  ]);
118
- function _r() {
119
- return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((e, a) => /* @__PURE__ */ s(
116
+ function $r() {
117
+ return /* @__PURE__ */ e("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((t, a) => /* @__PURE__ */ s(
120
118
  "div",
121
119
  {
122
120
  className: "flex animate-pulse items-start gap-3 rounded-xl border border-transparent px-2.5 py-2.5",
123
121
  children: [
124
- /* @__PURE__ */ t("div", { className: "mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60" }),
122
+ /* @__PURE__ */ e("div", { className: "mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60" }),
125
123
  /* @__PURE__ */ s("div", { className: "flex-1 space-y-1.5", children: [
126
- /* @__PURE__ */ t("div", { className: "h-4 w-3/5 rounded bg-muted/60" }),
127
- /* @__PURE__ */ t("div", { className: "h-3 w-4/5 rounded bg-muted/40" })
124
+ /* @__PURE__ */ e("div", { className: "h-4 w-3/5 rounded bg-muted/60" }),
125
+ /* @__PURE__ */ e("div", { className: "h-3 w-4/5 rounded bg-muted/40" })
128
126
  ] })
129
127
  ]
130
128
  },
131
129
  a
132
130
  )) });
133
131
  }
134
- function jr({
135
- open: e,
132
+ function Wr({
133
+ open: t,
136
134
  onOpenChange: a,
137
135
  onSubmit: o,
138
136
  isCreating: n
139
137
  }) {
140
- const i = ot("interactive"), [r, d] = S(""), [c, l] = S("");
141
- xe(() => {
142
- e || (d(""), l(""));
143
- }, [e]);
138
+ const i = ot("interactive"), [r, d] = D(""), [c, l] = D("");
139
+ ve(() => {
140
+ t || (d(""), l(""));
141
+ }, [t]);
144
142
  const u = () => {
145
143
  r.trim() && o({ title: r, description: c });
146
144
  }, h = (m) => {
147
145
  a(m);
148
146
  };
149
- return /* @__PURE__ */ t(Ie, { open: e, onOpenChange: h, children: /* @__PURE__ */ s(
147
+ return /* @__PURE__ */ e(Ie, { open: t, onOpenChange: h, children: /* @__PURE__ */ s(
150
148
  Te,
151
149
  {
152
150
  showCloseButton: !1,
@@ -155,14 +153,14 @@ function jr({
155
153
  children: [
156
154
  /* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
157
155
  /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
158
- /* @__PURE__ */ t(Ee, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
156
+ /* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
159
157
  /* @__PURE__ */ s("div", { className: "flex min-w-0 items-baseline gap-2", children: [
160
- /* @__PURE__ */ t(Le, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
161
- /* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
158
+ /* @__PURE__ */ e(Le, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
159
+ /* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
162
160
  ] })
163
161
  ] }),
164
- /* @__PURE__ */ t(
165
- I,
162
+ /* @__PURE__ */ e(
163
+ T,
166
164
  {
167
165
  size: "xs",
168
166
  variant: "ghost",
@@ -170,15 +168,15 @@ function jr({
170
168
  onClick: () => h(!1),
171
169
  "aria-label": "Close",
172
170
  disabled: n,
173
- children: /* @__PURE__ */ t(Xe, { className: "h-3.5 w-3.5" })
171
+ children: /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" })
174
172
  }
175
173
  )
176
174
  ] }),
177
175
  /* @__PURE__ */ s("div", { className: "space-y-3 px-4 py-3", children: [
178
- /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
176
+ /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
179
177
  /* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
180
- /* @__PURE__ */ t(De, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
181
- /* @__PURE__ */ t(
178
+ /* @__PURE__ */ e(De, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
179
+ /* @__PURE__ */ e(
182
180
  st,
183
181
  {
184
182
  id: "visual-title",
@@ -194,8 +192,8 @@ function jr({
194
192
  )
195
193
  ] }),
196
194
  /* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
197
- /* @__PURE__ */ t(De, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
198
- /* @__PURE__ */ t(
195
+ /* @__PURE__ */ e(De, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
196
+ /* @__PURE__ */ e(
199
197
  st,
200
198
  {
201
199
  id: "visual-description",
@@ -209,8 +207,8 @@ function jr({
209
207
  ] })
210
208
  ] }),
211
209
  /* @__PURE__ */ s("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
212
- /* @__PURE__ */ t(
213
- I,
210
+ /* @__PURE__ */ e(
211
+ T,
214
212
  {
215
213
  size: "xs",
216
214
  variant: "outline",
@@ -219,14 +217,14 @@ function jr({
219
217
  children: "Cancel"
220
218
  }
221
219
  ),
222
- /* @__PURE__ */ t(
223
- I,
220
+ /* @__PURE__ */ e(
221
+ T,
224
222
  {
225
223
  size: "xs",
226
224
  onClick: u,
227
225
  disabled: !r.trim() || n,
228
- children: n ? /* @__PURE__ */ s(z, { children: [
229
- /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }),
226
+ children: n ? /* @__PURE__ */ s(R, { children: [
227
+ /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }),
230
228
  "Creating..."
231
229
  ] }) : "Create library visual"
232
230
  }
@@ -236,10 +234,10 @@ function jr({
236
234
  }
237
235
  ) });
238
236
  }
239
- function $r(e) {
240
- const [a, o] = S(null), [n, i] = S(null), r = ta();
241
- return xe(() => {
242
- if (!e || e.trim() === "") {
237
+ function qr(t) {
238
+ const [a, o] = D(null), [n, i] = D(null), r = na();
239
+ return ve(() => {
240
+ if (!t || t.trim() === "") {
243
241
  o(null), i(null);
244
242
  return;
245
243
  }
@@ -247,14 +245,14 @@ function $r(e) {
247
245
  return;
248
246
  (async () => {
249
247
  try {
250
- if (!e.startsWith("http://") && !e.startsWith("https://"))
251
- throw new Error(`Invalid URL format: ${e}`);
248
+ if (!t.startsWith("http://") && !t.startsWith("https://"))
249
+ throw new Error(`Invalid URL format: ${t}`);
252
250
  try {
253
- new URL(e);
251
+ new URL(t);
254
252
  } catch {
255
- throw new Error(`Invalid URL: ${e}`);
253
+ throw new Error(`Invalid URL: ${t}`);
256
254
  }
257
- const l = `${e.endsWith("/") ? e : `${e}/`}index.js`;
255
+ const l = `${t.endsWith("/") ? t : `${t}/`}index.js`;
258
256
  try {
259
257
  if (!(await fetch(l, { method: "HEAD" })).ok)
260
258
  throw new Error(`Module not found at ${l}`);
@@ -273,12 +271,12 @@ function $r(e) {
273
271
  console.error("Failed to load remote chart store:", l), i(l), o(null);
274
272
  }
275
273
  })();
276
- }, [e, r]), a;
274
+ }, [t, r]), a;
277
275
  }
278
- function Wr(e, a) {
279
- if (e.length === 0)
276
+ function Hr(t, a) {
277
+ if (t.length === 0)
280
278
  return "";
281
- const o = e.find(
279
+ const o = t.find(
282
280
  (n) => {
283
281
  var i, r;
284
282
  return ((i = n.customCardPreferences) == null ? void 0 : i.visualType) === "multiple" || !!((r = n.customCardPreferences) != null && r.dataInputCardIds);
@@ -287,23 +285,23 @@ function Wr(e, a) {
287
285
  if (o)
288
286
  return o.id;
289
287
  if (a) {
290
- const n = e.find((i) => i.id === a);
288
+ const n = t.find((i) => i.id === a);
291
289
  if (n) {
292
290
  const i = n.tabTitle;
293
291
  if (i == "All__Header")
294
- return e[0].id;
292
+ return t[0].id;
295
293
  if (i && i.endsWith("__Header")) {
296
- const d = i.split("__")[0], c = e.find(
294
+ const d = i.split("__")[0], c = t.find(
297
295
  (l) => l.tabTitle === d
298
296
  );
299
- return c ? c.id : e[0].id;
297
+ return c ? c.id : t[0].id;
300
298
  }
301
299
  return a;
302
300
  }
303
301
  }
304
- return e[0].id;
302
+ return t[0].id;
305
303
  }
306
- async function Tt(e, a, o, n, i = "Opening library visual...") {
304
+ async function Bt(t, a, o, n, i = "Opening library visual...") {
307
305
  if (!a || !o)
308
306
  throw new Error("Missing auth token or visual ID");
309
307
  const r = ["resource-by-id", "visual", o], d = n.getQueryData(r);
@@ -315,7 +313,7 @@ async function Tt(e, a, o, n, i = "Opening library visual...") {
315
313
  });
316
314
  try {
317
315
  const l = await fetch(
318
- `${e}/management/v1/visuals/${o}`,
316
+ `${t}/management/v1/visuals/${o}`,
319
317
  {
320
318
  headers: {
321
319
  Authorization: `Bearer ${a}`
@@ -330,41 +328,41 @@ async function Tt(e, a, o, n, i = "Opening library visual...") {
330
328
  throw E.dismiss(c), l;
331
329
  }
332
330
  }
333
- function Gt(e) {
334
- if (typeof e == "string")
335
- return JSON.parse(e);
336
- if (typeof e == "object")
337
- return e;
331
+ function Jt(t) {
332
+ if (typeof t == "string")
333
+ return JSON.parse(t);
334
+ if (typeof t == "object")
335
+ return t;
338
336
  throw new Error("Invalid frame object format");
339
337
  }
340
- function qr(e, a) {
338
+ function Qr(t, a) {
341
339
  var r, d;
342
- const o = (e == null ? void 0 : e.frameObject) ?? ((r = e == null ? void 0 : e.visual) == null ? void 0 : r.frameObject);
340
+ const o = (t == null ? void 0 : t.frameObject) ?? ((r = t == null ? void 0 : t.visual) == null ? void 0 : r.frameObject);
343
341
  if (!o)
344
342
  return !1;
345
- const n = Gt(o);
343
+ const n = Jt(o);
346
344
  if (!(n != null && n.cards) || n.cards.length === 0)
347
345
  return !1;
348
346
  const i = (d = n.cards) == null ? void 0 : d.find(
349
347
  (c) => c.id === n.activeCardId
350
348
  );
351
- return i ? (sa({
349
+ return i ? (la({
352
350
  ...a,
353
351
  frame: n,
354
352
  card: i,
355
- visualId: (e == null ? void 0 : e.id) || n.visualId
353
+ visualId: (t == null ? void 0 : t.id) || n.visualId
356
354
  }), !0) : !1;
357
355
  }
358
- function Hr() {
359
- const e = ee(
356
+ function Kr() {
357
+ const t = Z(
360
358
  (n) => {
361
359
  var i;
362
360
  return ((i = n.card.customCardPreferences) == null ? void 0 : i.url) || "";
363
361
  }
364
- ), a = $r(e);
365
- return { getUpdatedFrame: J(() => {
366
- var g;
367
- Nr();
362
+ ), a = qr(t);
363
+ return { getUpdatedFrame: Y(() => {
364
+ var N;
365
+ da();
368
366
  const {
369
367
  frame: n,
370
368
  card: i,
@@ -373,7 +371,7 @@ function Hr() {
373
371
  selectedDatabaseName: c,
374
372
  selectedTableName: l,
375
373
  selectedConnectionId: u
376
- } = ee.getState(), h = i.sql, m = (g = a == null ? void 0 : a.getState()) == null ? void 0 : g.settings, p = fr(i, {
374
+ } = Z.getState(), h = i.sql, m = (N = a == null ? void 0 : a.getState()) == null ? void 0 : N.settings, p = At(i, {
377
375
  isDevMode: r,
378
376
  cardSql: h,
379
377
  selectedSchemaName: d,
@@ -381,21 +379,27 @@ function Hr() {
381
379
  selectedTableName: l,
382
380
  selectedConnectionId: u,
383
381
  remoteChartSettings: m,
384
- stripConfig: gr
385
- }), f = n.cards.map(
386
- (v) => v.id === i.id ? p : v
387
- );
382
+ stripConfig: Ft
383
+ }), f = n.cards.map((S) => {
384
+ if (S.id === i.id) return Et({ before: i, after: p });
385
+ const M = xr(S) ? At(S, { isDevMode: !0, cardSql: S.sql, stripConfig: Ft }) : S;
386
+ return Et({ before: S, after: M });
387
+ }), g = f.flatMap((S) => S.dropped);
388
+ g.length && E.info("Some conditional formatting rules were removed", {
389
+ description: `Their column isn't in the saved visual: ${g.map((S) => S.name || "an unnamed rule").join(", ")}.`
390
+ });
391
+ const x = f.map((S) => S.card);
388
392
  return {
389
393
  ...n,
390
- cards: f,
391
- activeCardId: Wr(f, n.activeCardId)
394
+ cards: x,
395
+ activeCardId: Hr(x, n.activeCardId)
392
396
  };
393
397
  }, [a]) };
394
398
  }
395
399
  function ye() {
396
- const { authToken: e, tokenProps: a } = it(), o = Qe(), n = aa(), i = Ke(), { selectVisual: r } = lt(), {
400
+ const { authToken: t, tokenProps: a } = it(), o = Qe(), n = sa(), i = Ke(), { selectVisual: r } = lt(), {
397
401
  setFrame: d,
398
- setCard: c,
402
+ loadCard: c,
399
403
  setIsDevMode: l,
400
404
  initializeModeDrafts: u,
401
405
  setActiveTabCardId: h,
@@ -403,34 +407,34 @@ function ye() {
403
407
  setQueryResultColumns: p,
404
408
  setSelectedConnectionId: f,
405
409
  setSelectedDatabaseName: g,
406
- setSelectedSchemaName: v,
407
- setSelectedTableName: k,
408
- setSelectedDatamodelId: V,
409
- setInlineFilterValuesMap: U,
410
- setApplyFilters: M,
411
- clearEditorContext: A
410
+ setSelectedSchemaName: x,
411
+ setSelectedTableName: N,
412
+ setSelectedDatamodelId: S,
413
+ setInlineFilterValuesMap: M,
414
+ setApplyFilters: U,
415
+ clearEditorContext: F
412
416
  } = Ge(), {
413
417
  setIsDashboardEditing: O,
414
418
  setIsVisualEditing: b,
415
- clearSelectedFrameId: F
416
- } = ce(), C = w((L) => L.selectedSheetId), D = w((L) => L.selectedFrameId), N = w((L) => L.dashboard), j = w(
417
- (L) => L.inlineFilterValuesMap
418
- ), T = ra((i == null ? void 0 : i.id) || "", {
419
- enabled: !!(i != null && i.id) && !!(e != null && e.accessToken)
420
- }), R = J(
421
- async (L) => {
419
+ clearSelectedFrameId: I
420
+ } = de(), C = w((V) => V.selectedSheetId), A = w((V) => V.selectedFrameId), k = w((V) => V.dashboard), j = w(
421
+ (V) => V.inlineFilterValuesMap
422
+ ), L = oa((i == null ? void 0 : i.id) || "", {
423
+ enabled: !!(i != null && i.id) && !!(t != null && t.accessToken)
424
+ }), z = Y(
425
+ async (V) => {
422
426
  try {
423
- r(L), F(), A();
424
- const { data: ae, fromCache: Y } = await Tt(
427
+ r(V), I(), F();
428
+ const { data: te, fromCache: X } = await Bt(
425
429
  a.apiServiceUrl,
426
- (e == null ? void 0 : e.accessToken) || "",
427
- L.id,
430
+ (t == null ? void 0 : t.accessToken) || "",
431
+ V.id,
428
432
  o,
429
433
  "Opening library visual..."
430
434
  );
431
- if (!qr(ae, {
435
+ if (!Qr(te, {
432
436
  setFrame: d,
433
- setCard: c,
437
+ loadCard: c,
434
438
  setIsDevMode: l,
435
439
  initializeModeDrafts: u,
436
440
  setActiveTabCardId: h,
@@ -438,26 +442,26 @@ function ye() {
438
442
  setQueryResultColumns: p,
439
443
  setSelectedConnectionId: f,
440
444
  setSelectedDatabaseName: g,
441
- setSelectedSchemaName: v,
442
- setSelectedTableName: k,
443
- setSelectedDatamodelId: V,
444
- setInlineFilterValuesMap: U,
445
- setApplyFilters: M,
445
+ setSelectedSchemaName: x,
446
+ setSelectedTableName: N,
447
+ setSelectedDatamodelId: S,
448
+ setInlineFilterValuesMap: M,
449
+ setApplyFilters: U,
446
450
  setIsDashboardEditing: O,
447
451
  setIsVisualEditing: b,
448
- dashboard: N,
452
+ dashboard: k,
449
453
  selectedSheetId: C,
450
- selectedFrameId: D,
454
+ selectedFrameId: A,
451
455
  inlineFilterValuesMap: j
452
456
  }))
453
457
  throw new Error("Failed to setup editor with visual data");
454
- return { success: !0, fromCache: Y };
455
- } catch (ae) {
456
- return console.error("Error editing visual:", ae), { success: !1, error: "Failed to load visual for editing" };
458
+ return { success: !0, fromCache: X };
459
+ } catch (te) {
460
+ return console.error("Error editing visual:", te), { success: !1, error: "Failed to load visual for editing" };
457
461
  }
458
462
  },
459
463
  [
460
- e == null ? void 0 : e.accessToken,
464
+ t == null ? void 0 : t.accessToken,
461
465
  a.apiServiceUrl,
462
466
  o,
463
467
  r,
@@ -472,51 +476,51 @@ function ye() {
472
476
  p,
473
477
  f,
474
478
  g,
475
- v,
476
- k,
477
- V,
478
- U,
479
+ x,
480
+ N,
481
+ S,
479
482
  M,
480
- A,
483
+ U,
481
484
  F,
482
- N,
485
+ I,
486
+ k,
483
487
  C,
484
- D,
488
+ A,
485
489
  j
486
490
  ]
487
- ), X = J(
488
- async (L) => {
489
- var Y;
490
- const ae = (H) => (E.error(H), { success: !1, error: H });
491
+ ), G = Y(
492
+ async (V) => {
493
+ var X;
494
+ const te = (H) => (E.error(H), { success: !1, error: H });
491
495
  try {
492
- if (r(L), !C)
493
- return ae("No sheet selected. Please select a sheet first.");
494
- const { data: H, fromCache: he } = await Tt(
496
+ if (r(V), !C)
497
+ return te("No sheet selected. Please select a sheet first.");
498
+ const { data: H, fromCache: he } = await Bt(
495
499
  a.apiServiceUrl,
496
- (e == null ? void 0 : e.accessToken) || "",
497
- L.id,
500
+ (t == null ? void 0 : t.accessToken) || "",
501
+ V.id,
498
502
  o,
499
503
  "Adding visual to dashboard..."
500
- ), ge = (H == null ? void 0 : H.frameObject) ?? ((Y = H == null ? void 0 : H.visual) == null ? void 0 : Y.frameObject);
504
+ ), ge = (H == null ? void 0 : H.frameObject) ?? ((X = H == null ? void 0 : H.visual) == null ? void 0 : X.frameObject);
501
505
  if (!ge)
502
- return ae("Visual has no frame data");
503
- const Q = Gt(ge);
506
+ return te("Visual has no frame data");
507
+ const Q = Jt(ge);
504
508
  if (!(Q != null && Q.cards) || Q.cards.length === 0)
505
- return ae("Visual frame is malformed");
509
+ return te("Visual frame is malformed");
506
510
  const _ = {
507
- ...na(Q),
508
- visualId: L.id
511
+ ...ia(Q),
512
+ visualId: V.id
509
513
  // Link this frame to the library visual
510
514
  };
511
515
  return await n(C, _), O(!0), { success: !0, fromCache: he };
512
516
  } catch (H) {
513
- return console.error("Error adding visual:", H), ae(
517
+ return console.error("Error adding visual:", H), te(
514
518
  H instanceof Error ? H.message : "Failed to add visual to dashboard"
515
519
  );
516
520
  }
517
521
  },
518
522
  [
519
- e == null ? void 0 : e.accessToken,
523
+ t == null ? void 0 : t.accessToken,
520
524
  a.apiServiceUrl,
521
525
  o,
522
526
  r,
@@ -526,189 +530,189 @@ function ye() {
526
530
  ]
527
531
  );
528
532
  return {
529
- visual: T.data,
530
- isLoading: T.isLoading,
531
- isError: T.isError,
532
- error: T.error,
533
- handleEditLibraryVisual: R,
534
- handleAddLibraryVisual: X,
535
- getUpdatedFrame: Hr().getUpdatedFrame,
536
- refetch: T.refetch
533
+ visual: L.data,
534
+ isLoading: L.isLoading,
535
+ isError: L.isError,
536
+ error: L.error,
537
+ handleEditLibraryVisual: z,
538
+ handleAddLibraryVisual: G,
539
+ getUpdatedFrame: Kr().getUpdatedFrame,
540
+ refetch: L.refetch
537
541
  };
538
542
  }
539
- function Xt(e) {
540
- return e ? new Date(e).toLocaleDateString("en-US", {
543
+ function Zt(t) {
544
+ return t ? new Date(t).toLocaleDateString("en-US", {
541
545
  month: "short",
542
546
  day: "numeric",
543
547
  year: "numeric"
544
548
  }) : "Unknown";
545
549
  }
546
- function Yt(e, a) {
550
+ function ea(t, a) {
547
551
  var n;
548
- const o = (n = e.ownership.createdBy) == null ? void 0 : n.type;
552
+ const o = (n = t.ownership.createdBy) == null ? void 0 : n.type;
549
553
  return o === "tenant" || o === "organization" && a;
550
554
  }
551
- function St(e, a) {
555
+ function St(t, a) {
552
556
  var o, n;
553
- return Yt(e, a) ? ((o = e.ownership.createdBy) == null ? void 0 : o.name) || ((n = e.createdByTenantUserRel) == null ? void 0 : n.name) || e.lastModifiedBy || "Unknown" : "Organization";
557
+ return ea(t, a) ? ((o = t.ownership.createdBy) == null ? void 0 : o.name) || ((n = t.createdByTenantUserRel) == null ? void 0 : n.name) || t.lastModifiedBy || "Unknown" : "Organization";
554
558
  }
555
- function Qr(e, a) {
556
- return St(e, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
559
+ function Gr(t, a) {
560
+ return St(t, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
557
561
  }
558
- function Kr(e) {
559
- const a = (e || "").toLowerCase();
560
- return a.includes("table") ? jt : a.includes("pie") || a.includes("donut") ? ma : a.includes("line") ? pa : a.includes("bar") ? hr : Ee;
562
+ function Xr(t) {
563
+ const a = (t || "").toLowerCase();
564
+ return a.includes("table") ? qt : a.includes("pie") || a.includes("donut") ? ba : a.includes("line") ? va : a.includes("bar") ? gr : Ee;
561
565
  }
562
- function Gr({ visual: e }) {
563
- const a = e.ownership.status === "public" ? "Public" : e.ownership.status === "shared" || e.ownership.sharedCount > 0 ? "Shared" : "Private";
564
- return /* @__PURE__ */ t("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
566
+ function Yr({ visual: t }) {
567
+ const a = t.ownership.status === "public" ? "Public" : t.ownership.status === "shared" || t.ownership.sharedCount > 0 ? "Shared" : "Private";
568
+ return /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
565
569
  }
566
- function cs({
567
- open: e,
570
+ function ds({
571
+ open: t,
568
572
  onOpenChange: a
569
573
  }) {
570
- const o = ot("interactive"), [n, i] = S(""), [r, d] = S(/* @__PURE__ */ new Set()), [c, l] = S(!1), [u, h] = S(
574
+ const o = ot("interactive"), [n, i] = D(""), [r, d] = D(/* @__PURE__ */ new Set()), [c, l] = D(!1), [u, h] = D(
571
575
  null
572
- ), [m, p] = S(
576
+ ), [m, p] = D(
573
577
  null
574
- ), [f, g] = S(!1), [v, k] = S(null), [V, U] = S(null), M = () => {
575
- d(/* @__PURE__ */ new Set()), h(null), p(null), g(!1), k(null);
576
- }, A = () => {
577
- a(!1), M();
578
- }, { selectVisual: O } = lt(), { handleAddLibraryVisual: b, handleEditLibraryVisual: F } = ye(), { isConsoleMode: C } = oa(), {
579
- resources: D,
580
- isLoading: N,
578
+ ), [f, g] = D(!1), [x, N] = D(null), [S, M] = D(null), U = () => {
579
+ d(/* @__PURE__ */ new Set()), h(null), p(null), g(!1), N(null);
580
+ }, F = () => {
581
+ a(!1), U();
582
+ }, { selectVisual: O } = lt(), { handleAddLibraryVisual: b, handleEditLibraryVisual: I } = ye(), { isConsoleMode: C } = ca(), {
583
+ resources: A,
584
+ isLoading: k,
581
585
  isError: j,
582
- createResource: T,
583
- updateResource: R,
584
- deleteResourceAsync: X,
585
- duplicateResource: L,
586
- isCreating: ae,
587
- isDeleting: Y
588
- } = ia(
586
+ createResource: L,
587
+ updateResource: z,
588
+ deleteResourceAsync: G,
589
+ duplicateResource: V,
590
+ isCreating: te,
591
+ isDeleting: X
592
+ } = ua(
589
593
  void 0,
590
- (x) => {
591
- l(!1), x && (O(x), F(x), A());
594
+ (v) => {
595
+ l(!1), v && (O(v), I(v), F());
592
596
  }
593
597
  ), {
594
598
  startUpdating: H,
595
599
  stopUpdating: he,
596
600
  isUpdating: ge
597
- } = la(), Q = D, _ = te(() => {
598
- const x = n.trim().toLowerCase();
599
- return x ? Q.filter(
601
+ } = ha(), Q = A, _ = ee(() => {
602
+ const v = n.trim().toLowerCase();
603
+ return v ? Q.filter(
600
604
  (B) => {
601
- var q, ie, ue;
602
- return ((q = B.title) == null ? void 0 : q.toLowerCase().includes(x)) || ((ie = B.description) == null ? void 0 : ie.toLowerCase().includes(x)) || ((ue = B.kind) == null ? void 0 : ue.toLowerCase().includes(x));
605
+ var q, oe, ce;
606
+ return ((q = B.title) == null ? void 0 : q.toLowerCase().includes(v)) || ((oe = B.description) == null ? void 0 : oe.toLowerCase().includes(v)) || ((ce = B.kind) == null ? void 0 : ce.toLowerCase().includes(v));
603
607
  }
604
608
  ) : Q;
605
- }, [n, Q]), oe = te(
609
+ }, [n, Q]), se = ee(
606
610
  () => Q.filter(
607
- (x) => r.has(x.id)
611
+ (v) => r.has(v.id)
608
612
  ),
609
613
  [r, Q]
610
- ), me = oe.filter(
611
- (x) => x.permissions.canDelete
612
- ), pe = oe.filter(
613
- (x) => x.permissions.canShare
614
+ ), me = se.filter(
615
+ (v) => v.permissions.canDelete
616
+ ), pe = se.filter(
617
+ (v) => v.permissions.canShare
614
618
  ), Ce = _.length > 0 && _.every(
615
- (x) => r.has(x.id)
619
+ (v) => r.has(v.id)
616
620
  ), Me = _.some(
617
- (x) => r.has(x.id)
618
- ), Ye = (x) => {
621
+ (v) => r.has(v.id)
622
+ ), Ye = (v) => {
619
623
  const B = new Set(r);
620
- x(B), d(B);
621
- }, $ = (x) => {
624
+ v(B), d(B);
625
+ }, $ = (v) => {
622
626
  Ye((B) => {
623
- B.has(x) ? B.delete(x) : B.add(x);
627
+ B.has(v) ? B.delete(v) : B.add(v);
624
628
  });
625
629
  }, W = () => {
626
- d((x) => {
627
- const B = new Set(x);
630
+ d((v) => {
631
+ const B = new Set(v);
628
632
  return Ce ? _.forEach(
629
633
  (q) => B.delete(q.id)
630
634
  ) : _.forEach(
631
635
  (q) => B.add(q.id)
632
636
  ), B;
633
637
  });
634
- }, ne = async (x) => {
635
- (await b(x)).success && A();
638
+ }, re = async (v) => {
639
+ (await b(v)).success && F();
636
640
  }, we = async () => {
637
- const x = oe;
638
- if (x.length === 0) return;
641
+ const v = se;
642
+ if (v.length === 0) return;
639
643
  let B = !1;
640
- for (const q of x)
644
+ for (const q of v)
641
645
  if (!(await b(q)).success) {
642
646
  B = !0;
643
647
  break;
644
648
  }
645
- B || A();
646
- }, Je = (x) => {
647
- F(x), A();
648
- }, be = (x) => {
649
- U(x), L(x, {
650
- onSettled: () => U(null)
649
+ B || F();
650
+ }, Je = (v) => {
651
+ I(v), F();
652
+ }, be = (v) => {
653
+ M(v), V(v, {
654
+ onSettled: () => M(null)
651
655
  });
652
656
  }, Ue = () => {
653
657
  if (me.length === 0) {
654
658
  E.error("Select a visual you can delete");
655
659
  return;
656
660
  }
657
- k(null), g(!0);
661
+ N(null), g(!0);
658
662
  }, Ze = async () => {
659
- const x = v ? [v] : me;
663
+ const v = x ? [x] : me;
660
664
  try {
661
- for (const B of x)
662
- await X(B.id);
665
+ for (const B of v)
666
+ await G(B.id);
663
667
  d((B) => {
664
668
  const q = new Set(B);
665
- return x.forEach(
666
- (ie) => q.delete(ie.id)
669
+ return v.forEach(
670
+ (oe) => q.delete(oe.id)
667
671
  ), q;
668
- }), g(!1), k(null);
672
+ }), g(!1), N(null);
669
673
  } catch {
670
674
  }
671
675
  }, Ne = () => {
672
- if (oe.length !== 1) {
676
+ if (se.length !== 1) {
673
677
  E.error("Select one visual to share");
674
678
  return;
675
679
  }
676
- const [x] = oe;
677
- if (!x.permissions.canShare) {
680
+ const [v] = se;
681
+ if (!v.permissions.canShare) {
678
682
  E.error("You do not have permission to share this visual");
679
683
  return;
680
684
  }
681
- h(x);
685
+ h(v);
682
686
  }, Se = ({
683
- title: x,
687
+ title: v,
684
688
  description: B
685
689
  }) => {
686
690
  if (!m) return;
687
691
  const q = {};
688
- if (x !== m.title && (q.title = x), (m.description || "") !== B && (q.description = B), Object.keys(q).length === 0) {
692
+ if (v !== m.title && (q.title = v), (m.description || "") !== B && (q.description = B), Object.keys(q).length === 0) {
689
693
  p(null);
690
694
  return;
691
695
  }
692
- const ie = Object.keys(q), ue = ie.length === 1 ? ie[0] : void 0;
693
- H(m.id, ue), R(
696
+ const oe = Object.keys(q), ce = oe.length === 1 ? oe[0] : void 0;
697
+ H(m.id, ce), z(
694
698
  {
695
699
  resourceId: m.id,
696
700
  data: q
697
701
  },
698
702
  {
699
703
  onSuccess: () => {
700
- he(m.id, ue), p(null);
704
+ he(m.id, ce), p(null);
701
705
  },
702
706
  onError: () => {
703
- he(m.id, ue);
707
+ he(m.id, ce);
704
708
  }
705
709
  }
706
710
  );
707
- }, se = (x) => {
708
- a(x), x || M();
709
- }, ke = v ? 1 : me.length;
710
- return /* @__PURE__ */ s(z, { children: [
711
- /* @__PURE__ */ t(Ie, { open: e, onOpenChange: se, children: /* @__PURE__ */ s(
711
+ }, ne = (v) => {
712
+ a(v), v || U();
713
+ }, ke = x ? 1 : me.length;
714
+ return /* @__PURE__ */ s(R, { children: [
715
+ /* @__PURE__ */ e(Ie, { open: t, onOpenChange: ne, children: /* @__PURE__ */ s(
712
716
  Te,
713
717
  {
714
718
  showCloseButton: !1,
@@ -717,19 +721,19 @@ function cs({
717
721
  children: [
718
722
  /* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
719
723
  /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
720
- /* @__PURE__ */ t(jt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
724
+ /* @__PURE__ */ e(qt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
721
725
  /* @__PURE__ */ s("div", { className: "flex min-w-0 items-baseline gap-2", children: [
722
- /* @__PURE__ */ t(Le, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
723
- /* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
726
+ /* @__PURE__ */ e(Le, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
727
+ /* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
724
728
  ] })
725
729
  ] }),
726
- /* @__PURE__ */ t(
727
- I,
730
+ /* @__PURE__ */ e(
731
+ T,
728
732
  {
729
733
  size: "xs",
730
734
  variant: "ghost",
731
735
  className: "w-7 px-0 text-muted-foreground hover:text-foreground",
732
- onClick: () => se(!1),
736
+ onClick: () => ne(!1),
733
737
  "aria-label": "Close visuals library",
734
738
  children: "×"
735
739
  }
@@ -737,13 +741,13 @@ function cs({
737
741
  ] }),
738
742
  /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
739
743
  /* @__PURE__ */ s("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
740
- /* @__PURE__ */ t(da, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
741
- /* @__PURE__ */ t(
744
+ /* @__PURE__ */ e(ma, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
745
+ /* @__PURE__ */ e(
742
746
  "input",
743
747
  {
744
748
  autoFocus: !0,
745
749
  value: n,
746
- onChange: (x) => i(x.target.value),
750
+ onChange: (v) => i(v.target.value),
747
751
  placeholder: "Search visuals...",
748
752
  className: "h-7 w-full rounded-control border border-input bg-background pl-7 pr-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-ring focus:outline-none",
749
753
  "aria-label": "Search visuals"
@@ -751,25 +755,25 @@ function cs({
751
755
  )
752
756
  ] }),
753
757
  /* @__PURE__ */ s(
754
- I,
758
+ T,
755
759
  {
756
760
  size: "xs",
757
761
  variant: "outline",
758
762
  className: "ml-auto",
759
763
  onClick: () => l(!0),
760
764
  children: [
761
- /* @__PURE__ */ t(ve, { className: "h-3.5 w-3.5" }),
765
+ /* @__PURE__ */ e(xe, { className: "h-3.5 w-3.5" }),
762
766
  "New library visual"
763
767
  ]
764
768
  }
765
769
  )
766
770
  ] }),
767
- /* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: N ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(_r, {}) }) : j ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ t("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : _.length === 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
768
- /* @__PURE__ */ t(Ee, { className: "h-5 w-5 text-muted-foreground/60" }),
769
- /* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
770
- /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
771
- ] }) : /* @__PURE__ */ t(
772
- Xr,
771
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: k ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e($r, {}) }) : j ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ e("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : _.length === 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
772
+ /* @__PURE__ */ e(Ee, { className: "h-5 w-5 text-muted-foreground/60" }),
773
+ /* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
774
+ /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
775
+ ] }) : /* @__PURE__ */ e(
776
+ Jr,
773
777
  {
774
778
  visuals: _,
775
779
  selectedIds: r,
@@ -777,28 +781,28 @@ function cs({
777
781
  someFilteredSelected: Me,
778
782
  onSelectAll: W,
779
783
  onToggleSelection: $,
780
- onAddVisual: ne,
784
+ onAddVisual: re,
781
785
  onOpenVisual: Je,
782
786
  onEditDetails: p,
783
787
  onShareVisual: h,
784
- onDeleteVisual: (x) => {
785
- k(x), g(!0);
788
+ onDeleteVisual: (v) => {
789
+ N(v), g(!0);
786
790
  },
787
791
  onDuplicateVisual: be,
788
- duplicatingId: V,
789
- isDeleting: Y,
792
+ duplicatingId: S,
793
+ isDeleting: X,
790
794
  isConsoleMode: C
791
795
  }
792
796
  ) }),
793
797
  /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
794
- /* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: r.size > 0 && /* @__PURE__ */ s(z, { children: [
798
+ /* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children: r.size > 0 && /* @__PURE__ */ s(R, { children: [
795
799
  /* @__PURE__ */ s("span", { className: "text-[12px] text-muted-foreground", children: [
796
- /* @__PURE__ */ t("span", { className: "font-medium tabular-nums text-foreground", children: r.size }),
800
+ /* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children: r.size }),
797
801
  " ",
798
802
  "selected"
799
803
  ] }),
800
- /* @__PURE__ */ t(
801
- I,
804
+ /* @__PURE__ */ e(
805
+ T,
802
806
  {
803
807
  size: "xs",
804
808
  variant: "ghost",
@@ -807,20 +811,20 @@ function cs({
807
811
  }
808
812
  ),
809
813
  /* @__PURE__ */ s(
810
- I,
814
+ T,
811
815
  {
812
816
  size: "xs",
813
817
  variant: "outline",
814
818
  onClick: Ne,
815
- disabled: oe.length !== 1 || pe.length !== 1,
819
+ disabled: se.length !== 1 || pe.length !== 1,
816
820
  children: [
817
- /* @__PURE__ */ t(Pt, { className: "h-3.5 w-3.5" }),
821
+ /* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5" }),
818
822
  "Share"
819
823
  ]
820
824
  }
821
825
  ),
822
826
  /* @__PURE__ */ s(
823
- I,
827
+ T,
824
828
  {
825
829
  size: "xs",
826
830
  variant: "outline",
@@ -828,7 +832,7 @@ function cs({
828
832
  onClick: Ue,
829
833
  disabled: me.length === 0,
830
834
  children: [
831
- /* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
835
+ /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5" }),
832
836
  "Delete ",
833
837
  me.length || r.size
834
838
  ]
@@ -836,23 +840,23 @@ function cs({
836
840
  )
837
841
  ] }) }),
838
842
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
839
- /* @__PURE__ */ t(
840
- I,
843
+ /* @__PURE__ */ e(
844
+ T,
841
845
  {
842
846
  size: "xs",
843
847
  variant: "outline",
844
- onClick: () => se(!1),
848
+ onClick: () => ne(!1),
845
849
  children: "Close"
846
850
  }
847
851
  ),
848
852
  /* @__PURE__ */ s(
849
- I,
853
+ T,
850
854
  {
851
855
  size: "xs",
852
856
  onClick: we,
853
857
  disabled: r.size === 0,
854
858
  children: [
855
- /* @__PURE__ */ t(Ct, { className: "h-3.5 w-3.5" }),
859
+ /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" }),
856
860
  r.size === 0 ? "Add to dashboard" : `Add ${r.size} visual${r.size === 1 ? "" : "s"}`
857
861
  ]
858
862
  }
@@ -862,25 +866,25 @@ function cs({
862
866
  ]
863
867
  }
864
868
  ) }),
865
- /* @__PURE__ */ t(
866
- jr,
869
+ /* @__PURE__ */ e(
870
+ Wr,
867
871
  {
868
872
  open: c,
869
873
  onOpenChange: l,
870
- onSubmit: T,
871
- isCreating: ae
874
+ onSubmit: L,
875
+ isCreating: te
872
876
  }
873
877
  ),
874
- u && /* @__PURE__ */ t(
875
- ca,
878
+ u && /* @__PURE__ */ e(
879
+ pa,
876
880
  {
877
881
  resource: u,
878
- resourceType: ua.VISUAL,
882
+ resourceType: fa.VISUAL,
879
883
  onClose: () => h(null)
880
884
  }
881
885
  ),
882
- m && /* @__PURE__ */ t(
883
- ha,
886
+ m && /* @__PURE__ */ e(
887
+ ga,
884
888
  {
885
889
  open: !!m,
886
890
  resourceLabel: "Visual",
@@ -891,12 +895,12 @@ function cs({
891
895
  isSaving: ge(m.id)
892
896
  }
893
897
  ),
894
- /* @__PURE__ */ t(
898
+ /* @__PURE__ */ e(
895
899
  dt,
896
900
  {
897
901
  open: f,
898
- onOpenChange: (x) => {
899
- !x && Y || (g(x), x || k(null));
902
+ onOpenChange: (v) => {
903
+ !v && X || (g(v), v || N(null));
900
904
  },
901
905
  children: /* @__PURE__ */ s(ct, { children: [
902
906
  /* @__PURE__ */ s(ut, { children: [
@@ -907,20 +911,20 @@ function cs({
907
911
  ke === 1 ? "" : "s",
908
912
  "?"
909
913
  ] }),
910
- /* @__PURE__ */ t(mt, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
914
+ /* @__PURE__ */ e(mt, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
911
915
  ] }),
912
916
  /* @__PURE__ */ s(pt, { children: [
913
- /* @__PURE__ */ t(ft, { disabled: Y, children: "Cancel" }),
917
+ /* @__PURE__ */ e(ft, { disabled: X, children: "Cancel" }),
914
918
  /* @__PURE__ */ s(
915
- Mt,
919
+ Rt,
916
920
  {
917
- onClick: (x) => {
918
- x.preventDefault(), Ze();
921
+ onClick: (v) => {
922
+ v.preventDefault(), Ze();
919
923
  },
920
- disabled: Y || ke === 0,
924
+ disabled: X || ke === 0,
921
925
  children: [
922
- Y ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
923
- Y ? "Deleting..." : "Delete"
926
+ X ? /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5" }),
927
+ X ? "Deleting..." : "Delete"
924
928
  ]
925
929
  }
926
930
  )
@@ -930,8 +934,8 @@ function cs({
930
934
  )
931
935
  ] });
932
936
  }
933
- function Xr({
934
- visuals: e,
937
+ function Jr({
938
+ visuals: t,
935
939
  selectedIds: a,
936
940
  allFilteredSelected: o,
937
941
  someFilteredSelected: n,
@@ -949,7 +953,7 @@ function Xr({
949
953
  }) {
950
954
  return /* @__PURE__ */ s("div", { className: "min-w-[48rem]", children: [
951
955
  /* @__PURE__ */ s("div", { className: "grid h-9 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/60 px-3 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: [
952
- /* @__PURE__ */ t(
956
+ /* @__PURE__ */ e(
953
957
  gt,
954
958
  {
955
959
  checked: o ? !0 : n ? "indeterminate" : !1,
@@ -957,18 +961,18 @@ function Xr({
957
961
  "aria-label": "Select all visuals"
958
962
  }
959
963
  ),
960
- /* @__PURE__ */ t("span", { children: "Name" }),
961
- /* @__PURE__ */ t("span", { children: "Created by" }),
962
- /* @__PURE__ */ t("span", { children: "Updated" }),
963
- /* @__PURE__ */ t("span", { children: "Visibility" }),
964
- /* @__PURE__ */ t("span", { className: "text-right", children: "Shared" }),
965
- /* @__PURE__ */ t("span", { className: "text-right", children: "Actions" })
964
+ /* @__PURE__ */ e("span", { children: "Name" }),
965
+ /* @__PURE__ */ e("span", { children: "Created by" }),
966
+ /* @__PURE__ */ e("span", { children: "Updated" }),
967
+ /* @__PURE__ */ e("span", { children: "Visibility" }),
968
+ /* @__PURE__ */ e("span", { className: "text-right", children: "Shared" }),
969
+ /* @__PURE__ */ e("span", { className: "text-right", children: "Actions" })
966
970
  ] }),
967
- e.map((v) => /* @__PURE__ */ t(
968
- Yr,
971
+ t.map((x) => /* @__PURE__ */ e(
972
+ Zr,
969
973
  {
970
- visual: v,
971
- selected: a.has(v.id),
974
+ visual: x,
975
+ selected: a.has(x.id),
972
976
  onToggleSelection: r,
973
977
  onAddVisual: d,
974
978
  onOpenVisual: c,
@@ -980,12 +984,12 @@ function Xr({
980
984
  isDeleting: f,
981
985
  isConsoleMode: g
982
986
  },
983
- v.id
987
+ x.id
984
988
  ))
985
989
  ] });
986
990
  }
987
- function Yr({
988
- visual: e,
991
+ function Zr({
992
+ visual: t,
989
993
  selected: a,
990
994
  onToggleSelection: o,
991
995
  onAddVisual: n,
@@ -999,23 +1003,23 @@ function Yr({
999
1003
  isConsoleMode: m
1000
1004
  }) {
1001
1005
  var g;
1002
- const p = Kr(e.kind), f = () => {
1003
- n(e);
1006
+ const p = Xr(t.kind), f = () => {
1007
+ n(t);
1004
1008
  };
1005
1009
  return /* @__PURE__ */ s(
1006
1010
  "div",
1007
1011
  {
1008
- className: Z(
1012
+ className: J(
1009
1013
  "group grid min-h-12 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/50 px-3 text-[13px] hover:bg-muted/50",
1010
1014
  a && "bg-muted/70"
1011
1015
  ),
1012
1016
  children: [
1013
- /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
1017
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
1014
1018
  gt,
1015
1019
  {
1016
1020
  checked: a,
1017
- onCheckedChange: () => o(e.id),
1018
- "aria-label": `Select ${e.title || "visual"}`
1021
+ onCheckedChange: () => o(t.id),
1022
+ "aria-label": `Select ${t.title || "visual"}`
1019
1023
  }
1020
1024
  ) }),
1021
1025
  /* @__PURE__ */ s(
@@ -1024,24 +1028,24 @@ function Yr({
1024
1028
  type: "button",
1025
1029
  className: "flex min-w-0 items-center gap-2 rounded-[4px] text-left outline-none focus-visible:ring-1 focus-visible:ring-ring",
1026
1030
  onClick: f,
1027
- "aria-label": `Add ${e.title || "visual"} to dashboard`,
1031
+ "aria-label": `Add ${t.title || "visual"} to dashboard`,
1028
1032
  children: [
1029
- /* @__PURE__ */ t(p, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
1033
+ /* @__PURE__ */ e(p, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
1030
1034
  /* @__PURE__ */ s("div", { className: "min-w-0", children: [
1031
- /* @__PURE__ */ t(
1035
+ /* @__PURE__ */ e(
1032
1036
  "div",
1033
1037
  {
1034
1038
  className: "truncate font-medium text-foreground",
1035
- title: e.title || "Untitled Visual",
1036
- children: e.title || "Untitled Visual"
1039
+ title: t.title || "Untitled Visual",
1040
+ children: t.title || "Untitled Visual"
1037
1041
  }
1038
1042
  ),
1039
- ((g = e.description) == null ? void 0 : g.trim()) && /* @__PURE__ */ t(
1043
+ ((g = t.description) == null ? void 0 : g.trim()) && /* @__PURE__ */ e(
1040
1044
  "div",
1041
1045
  {
1042
1046
  className: "truncate text-[11px] text-muted-foreground",
1043
- title: e.description,
1044
- children: e.description
1047
+ title: t.description,
1048
+ children: t.description
1045
1049
  }
1046
1050
  )
1047
1051
  ] })
@@ -1049,16 +1053,16 @@ function Yr({
1049
1053
  }
1050
1054
  ),
1051
1055
  /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
1052
- /* @__PURE__ */ t("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Qr(e, m) }),
1053
- /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: St(e, m) })
1056
+ /* @__PURE__ */ e("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Gr(t, m) }),
1057
+ /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: St(t, m) })
1054
1058
  ] }),
1055
- /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: Xt(e.updatedAt) }),
1056
- /* @__PURE__ */ t(Gr, { visual: e }),
1057
- /* @__PURE__ */ t("span", { className: "text-right tabular-nums text-muted-foreground", children: e.ownership.sharedCount > 0 ? e.ownership.sharedCount : "—" }),
1058
- /* @__PURE__ */ t(
1059
- Jr,
1059
+ /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: Zt(t.updatedAt) }),
1060
+ /* @__PURE__ */ e(Yr, { visual: t }),
1061
+ /* @__PURE__ */ e("span", { className: "text-right tabular-nums text-muted-foreground", children: t.ownership.sharedCount > 0 ? t.ownership.sharedCount : "—" }),
1062
+ /* @__PURE__ */ e(
1063
+ en,
1060
1064
  {
1061
- visual: e,
1065
+ visual: t,
1062
1066
  onOpenVisual: i,
1063
1067
  onEditDetails: r,
1064
1068
  onShareVisual: d,
@@ -1073,8 +1077,8 @@ function Yr({
1073
1077
  }
1074
1078
  );
1075
1079
  }
1076
- function Jr({
1077
- visual: e,
1080
+ function en({
1081
+ visual: t,
1078
1082
  onOpenVisual: a,
1079
1083
  onEditDetails: o,
1080
1084
  onShareVisual: n,
@@ -1090,26 +1094,26 @@ function Jr({
1090
1094
  className: "flex items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
1091
1095
  onClick: (u) => u.stopPropagation(),
1092
1096
  children: [
1093
- /* @__PURE__ */ t(
1094
- I,
1097
+ /* @__PURE__ */ e(
1098
+ T,
1095
1099
  {
1096
1100
  size: "xs",
1097
1101
  variant: "ghost",
1098
1102
  className: "w-7 px-0",
1099
- onClick: () => a(e),
1103
+ onClick: () => a(t),
1100
1104
  "aria-label": "Edit visual",
1101
- children: /* @__PURE__ */ t(et, { className: "h-3.5 w-3.5" })
1105
+ children: /* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" })
1102
1106
  }
1103
1107
  ),
1104
1108
  /* @__PURE__ */ s(Ve, { modal: !1, children: [
1105
- /* @__PURE__ */ t(Be, { asChild: !0, children: /* @__PURE__ */ t(
1106
- I,
1109
+ /* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(
1110
+ T,
1107
1111
  {
1108
1112
  size: "xs",
1109
1113
  variant: "ghost",
1110
1114
  className: "w-7 px-0",
1111
1115
  "aria-label": "More actions",
1112
- children: /* @__PURE__ */ t(Ut, { className: "h-3.5 w-3.5" })
1116
+ children: /* @__PURE__ */ e(zt, { className: "h-3.5 w-3.5" })
1113
1117
  }
1114
1118
  ) }),
1115
1119
  /* @__PURE__ */ s(
@@ -1118,53 +1122,53 @@ function Jr({
1118
1122
  align: "end",
1119
1123
  className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
1120
1124
  children: [
1121
- /* @__PURE__ */ s(G, { onClick: () => a(e), children: [
1122
- /* @__PURE__ */ t(et, { className: "h-3.5 w-3.5" }),
1125
+ /* @__PURE__ */ s(K, { onClick: () => a(t), children: [
1126
+ /* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
1123
1127
  "Edit visual"
1124
1128
  ] }),
1125
1129
  /* @__PURE__ */ s(
1126
- G,
1130
+ K,
1127
1131
  {
1128
- onClick: () => r(e.id),
1129
- disabled: d === e.id,
1132
+ onClick: () => r(t.id),
1133
+ disabled: d === t.id,
1130
1134
  children: [
1131
- d === e.id ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(fa, { className: "h-3.5 w-3.5" }),
1132
- d === e.id ? "Duplicating..." : "Duplicate"
1135
+ d === t.id ? /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(xa, { className: "h-3.5 w-3.5" }),
1136
+ d === t.id ? "Duplicating..." : "Duplicate"
1133
1137
  ]
1134
1138
  }
1135
1139
  ),
1136
- e.permissions.canEdit && /* @__PURE__ */ s(G, { onClick: () => o(e), children: [
1137
- /* @__PURE__ */ t(et, { className: "h-3.5 w-3.5" }),
1140
+ t.permissions.canEdit && /* @__PURE__ */ s(K, { onClick: () => o(t), children: [
1141
+ /* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
1138
1142
  "Edit details"
1139
1143
  ] }),
1140
- e.permissions.canShare && /* @__PURE__ */ s(G, { onClick: () => n(e), children: [
1141
- /* @__PURE__ */ t(Pt, { className: "h-3.5 w-3.5" }),
1144
+ t.permissions.canShare && /* @__PURE__ */ s(K, { onClick: () => n(t), children: [
1145
+ /* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5" }),
1142
1146
  "Share"
1143
1147
  ] }),
1144
- e.permissions.canDelete && /* @__PURE__ */ s(z, { children: [
1145
- /* @__PURE__ */ t(We, {}),
1148
+ t.permissions.canDelete && /* @__PURE__ */ s(R, { children: [
1149
+ /* @__PURE__ */ e(We, {}),
1146
1150
  /* @__PURE__ */ s(
1147
- G,
1151
+ K,
1148
1152
  {
1149
1153
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
1150
- onClick: () => i(e),
1154
+ onClick: () => i(t),
1151
1155
  disabled: c,
1152
1156
  children: [
1153
- /* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
1157
+ /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5" }),
1154
1158
  c ? "Deleting..." : "Delete"
1155
1159
  ]
1156
1160
  }
1157
1161
  )
1158
1162
  ] }),
1159
- /* @__PURE__ */ t(We, {}),
1163
+ /* @__PURE__ */ e(We, {}),
1160
1164
  /* @__PURE__ */ s("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
1161
- Yt(e, l) && /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
1162
- /* @__PURE__ */ t(ga, { className: "h-3 w-3" }),
1163
- /* @__PURE__ */ t("span", { className: "truncate", children: St(e, l) })
1165
+ ea(t, l) && /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
1166
+ /* @__PURE__ */ e(ya, { className: "h-3 w-3" }),
1167
+ /* @__PURE__ */ e("span", { className: "truncate", children: St(t, l) })
1164
1168
  ] }),
1165
1169
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
1166
- /* @__PURE__ */ t(ba, { className: "h-3 w-3" }),
1167
- /* @__PURE__ */ t("span", { children: Xt(e.updatedAt) })
1170
+ /* @__PURE__ */ e(Ca, { className: "h-3 w-3" }),
1171
+ /* @__PURE__ */ e("span", { children: Zt(t.updatedAt) })
1168
1172
  ] })
1169
1173
  ] })
1170
1174
  ]
@@ -1175,26 +1179,26 @@ function Jr({
1175
1179
  }
1176
1180
  );
1177
1181
  }
1178
- function us(e, a, o = !1) {
1182
+ function cs(t, a, o = !1) {
1179
1183
  const n = w((u) => u.dashboard), i = w(
1180
1184
  (u) => u.isDashboardEditing
1181
1185
  ), r = w(
1182
1186
  (u) => u.onDashboardLifecycleEvent
1183
- ), d = J(() => {
1187
+ ), d = Y(() => {
1184
1188
  const u = w.getState().dashboard;
1185
- return a || !e || !u || u.id !== e.id ? !1 : _e(u) !== _e(e);
1186
- }, [e, a]);
1189
+ return a || !t || !u || u.id !== t.id ? !1 : _e(u) !== _e(t);
1190
+ }, [t, a]);
1187
1191
  Dt(() => (w.setState({ checkUnsavedDashboardChanges: d }), () => {
1188
1192
  w.getState().checkUnsavedDashboardChanges === d && w.setState({ checkUnsavedDashboardChanges: null });
1189
1193
  }), [d]);
1190
- const c = te(() => !o || a || !n || i && (!e || n.id !== e.id) ? null : {
1194
+ const c = ee(() => !o || a || !n || i && (!t || n.id !== t.id) ? null : {
1191
1195
  dashboardId: n.id,
1192
- dirty: i && e ? _e(n) !== _e(e) : !1
1196
+ dirty: i && t ? _e(n) !== _e(t) : !1
1193
1197
  }, [
1194
1198
  i,
1195
1199
  a,
1196
1200
  o,
1197
- e,
1201
+ t,
1198
1202
  n
1199
1203
  ]), l = nt(null);
1200
1204
  return Dt(() => {
@@ -1214,8 +1218,8 @@ function us(e, a, o = !1) {
1214
1218
  }));
1215
1219
  }, [c, r]), d;
1216
1220
  }
1217
- function Zr({
1218
- open: e,
1221
+ function tn({
1222
+ open: t,
1219
1223
  onOpenChange: a,
1220
1224
  isLibraryVisual: o,
1221
1225
  currentVisualName: n,
@@ -1223,14 +1227,14 @@ function Zr({
1223
1227
  destinationMode: r = "both",
1224
1228
  onConfirm: d
1225
1229
  }) {
1226
- const [c, l] = S(
1230
+ const [c, l] = D(
1227
1231
  o && n ? `Copy of ${n}` : n || ""
1228
- ), [u, h] = S("");
1229
- Vt.useEffect(() => {
1230
- e && (l(
1232
+ ), [u, h] = D("");
1233
+ Mt.useEffect(() => {
1234
+ t && (l(
1231
1235
  o && n ? `Copy of ${n}` : n || ""
1232
1236
  ), h(""));
1233
- }, [e, o, n]);
1237
+ }, [t, o, n]);
1234
1238
  const m = !!c.trim(), p = r === "local" ? {
1235
1239
  saveToLibrary: !1,
1236
1240
  saveToCurrentDashboard: !0,
@@ -1257,12 +1261,12 @@ function Zr({
1257
1261
  saveToCurrentDashboard: p.saveToCurrentDashboard
1258
1262
  });
1259
1263
  };
1260
- return /* @__PURE__ */ t(Ie, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(Te, { className: "sm:max-w-[500px]", children: [
1264
+ return /* @__PURE__ */ e(Ie, { open: t, onOpenChange: a, children: /* @__PURE__ */ s(Te, { className: "sm:max-w-[500px]", children: [
1261
1265
  /* @__PURE__ */ s(bt, { children: [
1262
1266
  /* @__PURE__ */ s(Le, { className: "flex items-center gap-2", children: [
1263
- /* @__PURE__ */ t("span", { children: "Save Visual As" }),
1264
- p.badgeType !== "local" && /* @__PURE__ */ t(
1265
- Dr,
1267
+ /* @__PURE__ */ e("span", { children: "Save Visual As" }),
1268
+ p.badgeType !== "local" && /* @__PURE__ */ e(
1269
+ Fr,
1266
1270
  {
1267
1271
  type: p.badgeType,
1268
1272
  showLabel: !0,
@@ -1270,12 +1274,12 @@ function Zr({
1270
1274
  }
1271
1275
  )
1272
1276
  ] }),
1273
- /* @__PURE__ */ t(xt, { children: p.description })
1277
+ /* @__PURE__ */ e(vt, { children: p.description })
1274
1278
  ] }),
1275
1279
  /* @__PURE__ */ s("div", { className: "grid gap-4 py-4", children: [
1276
1280
  /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
1277
- /* @__PURE__ */ t(De, { htmlFor: "name", children: "Name" }),
1278
- /* @__PURE__ */ t(
1281
+ /* @__PURE__ */ e(De, { htmlFor: "name", children: "Name" }),
1282
+ /* @__PURE__ */ e(
1279
1283
  st,
1280
1284
  {
1281
1285
  id: "name",
@@ -1287,9 +1291,9 @@ function Zr({
1287
1291
  )
1288
1292
  ] }),
1289
1293
  /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
1290
- /* @__PURE__ */ t(De, { htmlFor: "description", children: "Description (optional)" }),
1291
- /* @__PURE__ */ t(
1292
- xa,
1294
+ /* @__PURE__ */ e(De, { htmlFor: "description", children: "Description (optional)" }),
1295
+ /* @__PURE__ */ e(
1296
+ wa,
1293
1297
  {
1294
1298
  id: "description",
1295
1299
  value: u,
@@ -1301,9 +1305,9 @@ function Zr({
1301
1305
  )
1302
1306
  ] })
1303
1307
  ] }),
1304
- /* @__PURE__ */ s(va, { children: [
1305
- /* @__PURE__ */ t(
1306
- I,
1308
+ /* @__PURE__ */ s(Na, { children: [
1309
+ /* @__PURE__ */ e(
1310
+ T,
1307
1311
  {
1308
1312
  variant: "outline",
1309
1313
  onClick: () => a(!1),
@@ -1311,50 +1315,50 @@ function Zr({
1311
1315
  children: "Cancel"
1312
1316
  }
1313
1317
  ),
1314
- /* @__PURE__ */ s(I, { onClick: f, disabled: !m || i, children: [
1315
- i && /* @__PURE__ */ t(re, { className: "mr-2 h-4 w-4 animate-spin" }),
1318
+ /* @__PURE__ */ s(T, { onClick: f, disabled: !m || i, children: [
1319
+ i && /* @__PURE__ */ e(ae, { className: "mr-2 h-4 w-4 animate-spin" }),
1316
1320
  p.actionLabel
1317
1321
  ] })
1318
1322
  ] })
1319
1323
  ] }) });
1320
1324
  }
1321
- function kt(e) {
1325
+ function kt(t) {
1322
1326
  var a;
1323
- for (const o of e.cards)
1324
- if (o.type === "matrixTable" && !pr.safeParse((a = o.config) == null ? void 0 : a.matrix).success)
1327
+ for (const o of t.cards)
1328
+ if (o.type === "matrixTable" && !vr.safeParse((a = o.config) == null ? void 0 : a.matrix).success)
1325
1329
  return E.error("Matrix requires at least one row field, one metric, and valid settings."), !1;
1326
1330
  return !0;
1327
1331
  }
1328
1332
  function tt({
1329
- className: e,
1333
+ className: t,
1330
1334
  variant: a = "outline"
1331
1335
  }) {
1332
- const o = ee((r) => r.onSave), { getUpdatedFrame: n } = ye();
1336
+ const o = Z((r) => r.onSave), { getUpdatedFrame: n } = ye();
1333
1337
  function i() {
1334
1338
  const r = n();
1335
1339
  kt(r) && (o == null || o(r));
1336
1340
  }
1337
1341
  return /* @__PURE__ */ s(
1338
- I,
1342
+ T,
1339
1343
  {
1340
1344
  onClick: i,
1341
- className: e,
1345
+ className: t,
1342
1346
  size: "xs",
1343
1347
  variant: a,
1344
1348
  children: [
1345
- /* @__PURE__ */ t(Ct, { className: "h-3.5 w-3.5" }),
1349
+ /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" }),
1346
1350
  "Done"
1347
1351
  ]
1348
1352
  }
1349
1353
  );
1350
1354
  }
1351
- function en({
1352
- className: e,
1355
+ function an({
1356
+ className: t,
1353
1357
  variant: a = "default"
1354
1358
  }) {
1355
- const o = Qe(), [n, i] = S(!1), { setIsVisualEditing: r } = ce(), { getUpdatedFrame: d } = ye(), c = Ke(), l = ee((m) => m.frame), u = Ot();
1356
- return /* @__PURE__ */ t(
1357
- I,
1359
+ const o = Qe(), [n, i] = D(!1), { setIsVisualEditing: r } = de(), { getUpdatedFrame: d } = ye(), c = Ke(), l = Z((m) => m.frame), u = _t();
1360
+ return /* @__PURE__ */ e(
1361
+ T,
1358
1362
  {
1359
1363
  onClick: () => {
1360
1364
  const m = d();
@@ -1385,25 +1389,25 @@ function en({
1385
1389
  }
1386
1390
  );
1387
1391
  },
1388
- className: e,
1392
+ className: t,
1389
1393
  size: "xs",
1390
1394
  variant: a,
1391
- children: n ? /* @__PURE__ */ s(z, { children: [
1392
- /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }),
1395
+ children: n ? /* @__PURE__ */ s(R, { children: [
1396
+ /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }),
1393
1397
  "Saving"
1394
- ] }) : /* @__PURE__ */ s(z, { children: [
1395
- /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" }),
1398
+ ] }) : /* @__PURE__ */ s(R, { children: [
1399
+ /* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
1396
1400
  "Save to Library"
1397
1401
  ] })
1398
1402
  }
1399
1403
  );
1400
1404
  }
1401
- function tn({
1402
- className: e
1405
+ function rn({
1406
+ className: t
1403
1407
  }) {
1404
- const a = Qe(), [o, n] = S(!1), i = Ke(), r = ee((g) => g.frame), d = w((g) => g.selectedSheetId), c = w((g) => g.dashboard), { updateFrame: l, setIsVisualEditing: u } = ce(), { getUpdatedFrame: h } = ye(), m = Ot(), p = vt();
1405
- return /* @__PURE__ */ t(
1406
- I,
1408
+ const a = Qe(), [o, n] = D(!1), i = Ke(), r = Z((g) => g.frame), d = w((g) => g.selectedSheetId), c = w((g) => g.dashboard), { updateFrame: l, setIsVisualEditing: u } = de(), { getUpdatedFrame: h } = ye(), m = _t(), p = xt();
1409
+ return /* @__PURE__ */ e(
1410
+ T,
1407
1411
  {
1408
1412
  onClick: async () => {
1409
1413
  if (!d) {
@@ -1417,52 +1421,52 @@ function tn({
1417
1421
  }
1418
1422
  n(!0);
1419
1423
  try {
1420
- const v = h();
1421
- if (!kt(v)) {
1424
+ const x = h();
1425
+ if (!kt(x)) {
1422
1426
  n(!1);
1423
1427
  return;
1424
1428
  }
1425
- const k = {
1426
- ...v,
1429
+ const N = {
1430
+ ...x,
1427
1431
  visualId: g
1428
1432
  // Keep the link to library visual
1429
- }, V = He(c, k.id), U = await p(k, {
1430
- previousFrame: V
1433
+ }, S = He(c, N.id), M = await p(N, {
1434
+ previousFrame: S
1431
1435
  });
1432
1436
  await m.mutateAsync({
1433
1437
  visualId: g,
1434
1438
  data: {
1435
- frameObject: v
1439
+ frameObject: x
1436
1440
  }
1437
- }), l(d, k, {
1438
- semanticExecutionPayload: U
1441
+ }), l(d, N, {
1442
+ semanticExecutionPayload: M
1439
1443
  }), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual", g] }), E.success("Saved to library and applied locally"), setTimeout(() => {
1440
1444
  u(!1);
1441
1445
  }, 300);
1442
- } catch (v) {
1443
- console.error("Failed to save and apply:", v), E.error(
1444
- v instanceof Error ? v.message : "Failed to save and apply changes"
1446
+ } catch (x) {
1447
+ console.error("Failed to save and apply:", x), E.error(
1448
+ x instanceof Error ? x.message : "Failed to save and apply changes"
1445
1449
  );
1446
1450
  } finally {
1447
1451
  n(!1);
1448
1452
  }
1449
1453
  },
1450
- className: e,
1454
+ className: t,
1451
1455
  size: "xs",
1452
1456
  variant: "default",
1453
1457
  disabled: o,
1454
- children: o ? /* @__PURE__ */ s(z, { children: [
1455
- /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }),
1458
+ children: o ? /* @__PURE__ */ s(R, { children: [
1459
+ /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }),
1456
1460
  "Saving..."
1457
- ] }) : /* @__PURE__ */ s(z, { children: [
1458
- /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" }),
1461
+ ] }) : /* @__PURE__ */ s(R, { children: [
1462
+ /* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
1459
1463
  "Save & Apply"
1460
1464
  ] })
1461
1465
  }
1462
1466
  );
1463
1467
  }
1464
- function at({ className: e }) {
1465
- const { setTempQueryData: a, setSqlGen: o } = Ge(), n = Qe(), i = ee((c) => c.tempQueryData), r = ee((c) => c.onClose);
1468
+ function at({ className: t }) {
1469
+ const { setTempQueryData: a, setSqlGen: o } = Ge(), n = Qe(), i = Z((c) => c.tempQueryData), r = Z((c) => c.onClose);
1466
1470
  function d() {
1467
1471
  if (i) {
1468
1472
  const { queryKey: c, queryData: l } = i;
@@ -1471,101 +1475,101 @@ function at({ className: e }) {
1471
1475
  o({}), r == null || r();
1472
1476
  }
1473
1477
  return /* @__PURE__ */ s(
1474
- I,
1478
+ T,
1475
1479
  {
1476
1480
  onClick: d,
1477
- className: e,
1481
+ className: t,
1478
1482
  size: "xs",
1479
1483
  variant: "outline",
1480
1484
  children: [
1481
- /* @__PURE__ */ t(Xe, { className: "h-3.5 w-3.5" }),
1485
+ /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" }),
1482
1486
  "Close"
1483
1487
  ]
1484
1488
  }
1485
1489
  );
1486
1490
  }
1487
- function an() {
1488
- const [e, a] = S(!1), [o, n] = S(!1), [i, r] = S(null), [d, c] = S(null), l = ee((b) => b.frame), u = ee((b) => b.card), h = Ke(), m = w((b) => b.selectedSheetId), p = w((b) => b.dashboard), { getUpdatedFrame: f } = ye(), { selectVisual: g } = lt(), { addFrame: v, setIsVisualEditing: k } = ce(), V = vt(), U = !!(l != null && l.visualId), M = (() => {
1489
- var b, F;
1490
- return ((b = l == null ? void 0 : l.cards) == null ? void 0 : b.length) === 1 && ((F = l.cards[0]) != null && F.title) ? l.cards[0].title : h != null && h.title ? h.title : (u == null ? void 0 : u.title) || "Untitled Visual";
1491
- })(), A = ya((b) => {
1491
+ function nn() {
1492
+ const [t, a] = D(!1), [o, n] = D(!1), [i, r] = D(null), [d, c] = D(null), l = Z((b) => b.frame), u = Z((b) => b.card), h = Ke(), m = w((b) => b.selectedSheetId), p = w((b) => b.dashboard), { getUpdatedFrame: f } = ye(), { selectVisual: g } = lt(), { addFrame: x, setIsVisualEditing: N } = de(), S = xt(), M = !!(l != null && l.visualId), U = (() => {
1493
+ var b, I;
1494
+ return ((b = l == null ? void 0 : l.cards) == null ? void 0 : b.length) === 1 && ((I = l.cards[0]) != null && I.title) ? l.cards[0].title : h != null && h.title ? h.title : (u == null ? void 0 : u.title) || "Untitled Visual";
1495
+ })(), F = Sa((b) => {
1492
1496
  b != null && b.id && (g(b), o && i && d && m && (async () => {
1493
1497
  try {
1494
- const F = {
1498
+ const I = {
1495
1499
  ...i,
1496
- id: At(),
1500
+ id: It(),
1497
1501
  visualId: b.id
1498
1502
  // Link to the newly created library visual
1499
1503
  };
1500
- v(m, F, {
1504
+ x(m, I, {
1501
1505
  semanticExecutionPayload: d
1502
- }), n(!1), r(null), c(null), k(!1);
1503
- } catch (F) {
1506
+ }), n(!1), r(null), c(null), N(!1);
1507
+ } catch (I) {
1504
1508
  console.error(
1505
1509
  "Failed to promote semantic metadata for saved visual:",
1506
- F
1510
+ I
1507
1511
  ), E.error(
1508
- F instanceof Error ? F.message : "Failed to prepare semantic metadata for the saved visual"
1512
+ I instanceof Error ? I.message : "Failed to prepare semantic metadata for the saved visual"
1509
1513
  );
1510
1514
  }
1511
1515
  })(), a(!1));
1512
1516
  });
1513
1517
  return {
1514
- saveAsDialogOpen: e,
1518
+ saveAsDialogOpen: t,
1515
1519
  setSaveAsDialogOpen: a,
1516
1520
  handleSaveAs: async (b) => {
1517
1521
  if (!m) {
1518
1522
  E.error("No sheet selected");
1519
1523
  return;
1520
1524
  }
1521
- const F = f(), D = F.cards.length === 1 ? {
1522
- ...F,
1523
- cards: F.cards.map((N) => ({
1524
- ...N,
1525
+ const I = f(), A = I.cards.length === 1 ? {
1526
+ ...I,
1527
+ cards: I.cards.map((k) => ({
1528
+ ...k,
1525
1529
  title: b.name
1526
1530
  // Use visual name as card title
1527
1531
  }))
1528
- } : F;
1532
+ } : I;
1529
1533
  if (b.saveToLibrary) {
1530
- let N = null;
1534
+ let k = null;
1531
1535
  if (b.saveToCurrentDashboard)
1532
1536
  try {
1533
- N = await V(D, {
1534
- previousFrame: He(p, D.id)
1537
+ k = await S(A, {
1538
+ previousFrame: He(p, A.id)
1535
1539
  });
1536
- } catch (T) {
1540
+ } catch (L) {
1537
1541
  console.error(
1538
1542
  "Failed to prepare semantic metadata before saving visual:",
1539
- T
1543
+ L
1540
1544
  ), E.error(
1541
- T instanceof Error ? T.message : "Failed to prepare semantic metadata for the saved visual"
1545
+ L instanceof Error ? L.message : "Failed to prepare semantic metadata for the saved visual"
1542
1546
  );
1543
1547
  return;
1544
1548
  }
1545
- n(b.saveToCurrentDashboard), r(D), c(N);
1549
+ n(b.saveToCurrentDashboard), r(A), c(k);
1546
1550
  const j = {
1547
1551
  title: b.name,
1548
1552
  description: b.description,
1549
- frameObject: D,
1553
+ frameObject: A,
1550
1554
  // Card title synced for single-card frames
1551
1555
  isPrivate: !1
1552
1556
  };
1553
- A.mutate(j);
1557
+ F.mutate(j);
1554
1558
  } else if (b.saveToCurrentDashboard) {
1555
- const N = {
1556
- ...D,
1559
+ const k = {
1560
+ ...A,
1557
1561
  // Card title already synced
1558
- id: At(),
1562
+ id: It(),
1559
1563
  visualId: void 0
1560
1564
  // Explicitly no visualId for local visuals
1561
1565
  };
1562
1566
  try {
1563
- const j = await V(D, {
1564
- previousFrame: He(p, D.id)
1567
+ const j = await S(A, {
1568
+ previousFrame: He(p, A.id)
1565
1569
  });
1566
- v(m, N, {
1570
+ x(m, k, {
1567
1571
  semanticExecutionPayload: j
1568
- }), E.success("Visual saved to dashboard"), a(!1), k(!1);
1572
+ }), E.success("Visual saved to dashboard"), a(!1), N(!1);
1569
1573
  } catch (j) {
1570
1574
  console.error("Failed to save visual to dashboard:", j), E.error(
1571
1575
  j instanceof Error ? j.message : "Failed to prepare semantic metadata for the visual"
@@ -1573,81 +1577,81 @@ function an() {
1573
1577
  }
1574
1578
  }
1575
1579
  },
1576
- isLibraryVisual: U,
1577
- currentVisualName: M,
1578
- isSaving: A.isPending
1580
+ isLibraryVisual: M,
1581
+ currentVisualName: U,
1582
+ isSaving: F.isPending
1579
1583
  };
1580
1584
  }
1581
- function hs(e = {}) {
1582
- const { isInspectionMode: a } = Ca(), o = ee((T) => T.frame), n = ee((T) => T.editorContext), i = wa((T) => T.selectedVisual), r = w((T) => T.selectedFrameId), d = w((T) => T.selectedSheetId), c = w((T) => T.dashboard), { setIsVisualEditing: l, updateFrame: u } = ce(), [h, m] = S(!1), [p, f] = S("both"), g = vt(), v = (n == null ? void 0 : n.type) === "documentSection", k = !!(o != null && o.visualId || i != null && i.id), V = !!(o != null && o.visualId && r), U = k && !V, {
1583
- saveAsDialogOpen: M,
1584
- setSaveAsDialogOpen: A,
1585
+ function us(t = {}) {
1586
+ const { isInspectionMode: a } = ka(), o = Z((L) => L.frame), n = Z((L) => L.editorContext), i = Da((L) => L.selectedVisual), r = w((L) => L.selectedFrameId), d = w((L) => L.selectedSheetId), c = w((L) => L.dashboard), { setIsVisualEditing: l, updateFrame: u } = de(), [h, m] = D(!1), [p, f] = D("both"), g = xt(), x = (n == null ? void 0 : n.type) === "documentSection", N = !!(o != null && o.visualId || i != null && i.id), S = !!(o != null && o.visualId && r), M = N && !S, {
1587
+ saveAsDialogOpen: U,
1588
+ setSaveAsDialogOpen: F,
1585
1589
  handleSaveAs: O,
1586
1590
  isLibraryVisual: b,
1587
- currentVisualName: F,
1591
+ currentVisualName: I,
1588
1592
  isSaving: C
1589
- } = an(), { getUpdatedFrame: D } = ye();
1593
+ } = nn(), { getUpdatedFrame: A } = ye();
1590
1594
  if (a)
1591
- return /* @__PURE__ */ s(z, { children: [
1592
- /* @__PURE__ */ t(
1595
+ return /* @__PURE__ */ s(R, { children: [
1596
+ /* @__PURE__ */ e(
1593
1597
  tt,
1594
1598
  {
1595
1599
  className: "rounded-control",
1596
1600
  variant: "default"
1597
1601
  }
1598
1602
  ),
1599
- /* @__PURE__ */ t(at, {})
1603
+ /* @__PURE__ */ e(at, {})
1600
1604
  ] });
1601
- if (v)
1602
- return /* @__PURE__ */ s(z, { children: [
1603
- /* @__PURE__ */ t(tt, { className: "rounded-control", variant: "default" }),
1604
- /* @__PURE__ */ t(at, {})
1605
+ if (x)
1606
+ return /* @__PURE__ */ s(R, { children: [
1607
+ /* @__PURE__ */ e(tt, { className: "rounded-control", variant: "default" }),
1608
+ /* @__PURE__ */ e(at, {})
1605
1609
  ] });
1606
- const N = async () => {
1610
+ const k = async () => {
1607
1611
  if (!d) {
1608
1612
  E.error("No sheet selected");
1609
1613
  return;
1610
1614
  }
1611
1615
  if (h) return;
1612
1616
  m(!0);
1613
- const R = {
1614
- ...D(),
1617
+ const z = {
1618
+ ...A(),
1615
1619
  visualId: void 0
1616
- }, X = He(c, R.id);
1620
+ }, G = He(c, z.id);
1617
1621
  try {
1618
- const L = await g(R, {
1619
- previousFrame: X
1622
+ const V = await g(z, {
1623
+ previousFrame: G
1620
1624
  });
1621
- u(d, R, {
1622
- semanticExecutionPayload: L
1625
+ u(d, z, {
1626
+ semanticExecutionPayload: V
1623
1627
  });
1624
- } catch (L) {
1625
- console.error("Failed to apply local semantic metadata:", L), m(!1), E.error(
1626
- L instanceof Error ? L.message : "Failed to prepare semantic metadata for this visual"
1628
+ } catch (V) {
1629
+ console.error("Failed to apply local semantic metadata:", V), m(!1), E.error(
1630
+ V instanceof Error ? V.message : "Failed to prepare semantic metadata for this visual"
1627
1631
  );
1628
1632
  return;
1629
1633
  }
1630
1634
  setTimeout(() => {
1631
1635
  m(!1), E.success("Changes applied. Visual is now local to this dashboard"), l(!1);
1632
1636
  }, 300);
1633
- }, j = (T) => {
1634
- f(T), A(!0);
1637
+ }, j = (L) => {
1638
+ f(L), F(!0);
1635
1639
  };
1636
- return /* @__PURE__ */ s(z, { children: [
1640
+ return /* @__PURE__ */ s(R, { children: [
1637
1641
  /* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
1638
- !k && /* @__PURE__ */ t(tt, { className: "!rounded-none", variant: "default" }),
1639
- k && U && /* @__PURE__ */ t(en, { className: "!rounded-none", variant: "default" }),
1640
- k && V && /* @__PURE__ */ t(tn, { className: "!rounded-none" }),
1642
+ !N && /* @__PURE__ */ e(tt, { className: "!rounded-none", variant: "default" }),
1643
+ N && M && /* @__PURE__ */ e(an, { className: "!rounded-none", variant: "default" }),
1644
+ N && S && /* @__PURE__ */ e(rn, { className: "!rounded-none" }),
1641
1645
  /* @__PURE__ */ s(Ve, { modal: !1, children: [
1642
- /* @__PURE__ */ t(Be, { asChild: !0, children: /* @__PURE__ */ t(
1643
- I,
1646
+ /* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(
1647
+ T,
1644
1648
  {
1645
1649
  variant: "default",
1646
1650
  size: "xs",
1647
1651
  className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
1648
1652
  "aria-label": "Open visual save options",
1649
1653
  disabled: C || h,
1650
- children: /* @__PURE__ */ t(wt, { className: "h-3.5 w-3.5" })
1654
+ children: /* @__PURE__ */ e(wt, { className: "h-3.5 w-3.5" })
1651
1655
  }
1652
1656
  ) }),
1653
1657
  /* @__PURE__ */ s(
@@ -1656,49 +1660,49 @@ function hs(e = {}) {
1656
1660
  align: "end",
1657
1661
  className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
1658
1662
  children: [
1659
- V && /* @__PURE__ */ s(z, { children: [
1663
+ S && /* @__PURE__ */ s(R, { children: [
1660
1664
  /* @__PURE__ */ s(
1661
- G,
1665
+ K,
1662
1666
  {
1663
- onClick: N,
1667
+ onClick: k,
1664
1668
  disabled: h,
1665
1669
  children: [
1666
- /* @__PURE__ */ t(Ct, { className: "h-3.5 w-3.5" }),
1670
+ /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" }),
1667
1671
  h ? "Applying..." : "Apply Locally"
1668
1672
  ]
1669
1673
  }
1670
1674
  ),
1671
- /* @__PURE__ */ t(We, {})
1675
+ /* @__PURE__ */ e(We, {})
1672
1676
  ] }),
1673
1677
  /* @__PURE__ */ s(
1674
- G,
1678
+ K,
1675
1679
  {
1676
1680
  onClick: () => j("local"),
1677
1681
  disabled: C,
1678
1682
  children: [
1679
- /* @__PURE__ */ t(ve, { className: "h-3.5 w-3.5" }),
1683
+ /* @__PURE__ */ e(xe, { className: "h-3.5 w-3.5" }),
1680
1684
  "Add to Dashboard (Local)"
1681
1685
  ]
1682
1686
  }
1683
1687
  ),
1684
1688
  /* @__PURE__ */ s(
1685
- G,
1689
+ K,
1686
1690
  {
1687
1691
  onClick: () => j("library"),
1688
1692
  disabled: C,
1689
1693
  children: [
1690
- /* @__PURE__ */ t(Ar, { className: "h-3.5 w-3.5" }),
1694
+ /* @__PURE__ */ e(Er, { className: "h-3.5 w-3.5" }),
1691
1695
  "Save as Library Visual"
1692
1696
  ]
1693
1697
  }
1694
1698
  ),
1695
1699
  /* @__PURE__ */ s(
1696
- G,
1700
+ K,
1697
1701
  {
1698
1702
  onClick: () => j("both"),
1699
1703
  disabled: C,
1700
1704
  children: [
1701
- /* @__PURE__ */ t(Fr, { className: "h-3.5 w-3.5" }),
1705
+ /* @__PURE__ */ e(Ir, { className: "h-3.5 w-3.5" }),
1702
1706
  "Save Copy as Linked Visual"
1703
1707
  ]
1704
1708
  }
@@ -1708,16 +1712,16 @@ function hs(e = {}) {
1708
1712
  )
1709
1713
  ] })
1710
1714
  ] }),
1711
- /* @__PURE__ */ t(at, {}),
1712
- /* @__PURE__ */ t(
1713
- Zr,
1715
+ /* @__PURE__ */ e(at, {}),
1716
+ /* @__PURE__ */ e(
1717
+ tn,
1714
1718
  {
1715
- open: M,
1716
- onOpenChange: (T) => {
1717
- C || A(T);
1719
+ open: U,
1720
+ onOpenChange: (L) => {
1721
+ C || F(L);
1718
1722
  },
1719
1723
  isLibraryVisual: b,
1720
- currentVisualName: F,
1724
+ currentVisualName: I,
1721
1725
  isSaving: C,
1722
1726
  destinationMode: p,
1723
1727
  onConfirm: O
@@ -1725,11 +1729,11 @@ function hs(e = {}) {
1725
1729
  )
1726
1730
  ] });
1727
1731
  }
1728
- function ms({ className: e }) {
1729
- const a = ee((h) => h.isDevMode), o = ee((h) => h.card.type), n = w((h) => h.isVisualEditing), { setIsDevMode: i } = Ge(), { config: r } = Bt(Na).tokenProps, d = (r == null ? void 0 : r.showAdvancedMode) !== !1;
1730
- if (!n || !d || !br(o))
1732
+ function hs({ className: t }) {
1733
+ const a = Z((h) => h.isDevMode), o = Z((h) => h.card.type), n = w((h) => h.isVisualEditing), { setIsDevMode: i } = Ge(), { config: r } = Ut(Aa).tokenProps, d = (r == null ? void 0 : r.showAdvancedMode) !== !1;
1734
+ if (!n || !d || !yr(o))
1731
1735
  return null;
1732
- const c = a ? zr : Or, l = a ? "Visual editor" : "SQL editor", u = a ? "Switch to visual editor" : "Switch to SQL editor";
1736
+ const c = a ? _r : zr, l = a ? "Visual editor" : "SQL editor", u = a ? "Switch to visual editor" : "Switch to SQL editor";
1733
1737
  return /* @__PURE__ */ s(
1734
1738
  "button",
1735
1739
  {
@@ -1737,19 +1741,19 @@ function ms({ className: e }) {
1737
1741
  "aria-label": u,
1738
1742
  title: u,
1739
1743
  onClick: () => i(!a),
1740
- className: Z(
1744
+ className: J(
1741
1745
  "inline-flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 text-[12px] font-medium text-foreground transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:outline-none",
1742
- e
1746
+ t
1743
1747
  ),
1744
1748
  children: [
1745
- /* @__PURE__ */ t(c, { className: "h-3 w-3 text-muted-foreground" }),
1749
+ /* @__PURE__ */ e(c, { className: "h-3 w-3 text-muted-foreground" }),
1746
1750
  l
1747
1751
  ]
1748
1752
  }
1749
1753
  );
1750
1754
  }
1751
- function ps() {
1752
- const e = Tr() === "sm", a = w((l) => l.isDashboardEditing), o = w((l) => l.isVisualEditing), n = w((l) => {
1755
+ function ms() {
1756
+ const t = Vr() === "sm", a = w((l) => l.isDashboardEditing), o = w((l) => l.isVisualEditing), n = w((l) => {
1753
1757
  var h;
1754
1758
  const u = ((h = l.dashboard) == null ? void 0 : h.sheets) ?? [];
1755
1759
  return u.find((m) => m.id === l.selectedSheetId) ?? u[0];
@@ -1776,74 +1780,74 @@ function ps() {
1776
1780
  };
1777
1781
  return /* @__PURE__ */ s("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
1778
1782
  /* @__PURE__ */ s(
1779
- I,
1783
+ T,
1780
1784
  {
1781
1785
  variant: "ghost",
1782
1786
  size: "xs",
1783
1787
  disabled: d,
1784
1788
  title: d ? "This sheet has no cards to arrange" : "Lay out the cards by kind on every screen size",
1785
1789
  onClick: () => c(!1),
1786
- "aria-label": e ? "Arrange" : void 0,
1787
- className: `h-full rounded-none border-0 shadow-none hover:bg-accent${e ? " w-7 px-0" : ""}`,
1790
+ "aria-label": t ? "Arrange" : void 0,
1791
+ className: `h-full rounded-none border-0 shadow-none hover:bg-accent${t ? " w-7 px-0" : ""}`,
1788
1792
  children: [
1789
- /* @__PURE__ */ t(Ee, { className: "h-3.5 w-3.5" }),
1790
- !e && "Arrange"
1793
+ /* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5" }),
1794
+ !t && "Arrange"
1791
1795
  ]
1792
1796
  }
1793
1797
  ),
1794
1798
  /* @__PURE__ */ s(Ve, { modal: !1, children: [
1795
- /* @__PURE__ */ t(Be, { asChild: !0, children: /* @__PURE__ */ t(
1796
- I,
1799
+ /* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(
1800
+ T,
1797
1801
  {
1798
1802
  variant: "ghost",
1799
1803
  size: "xs",
1800
1804
  disabled: d,
1801
1805
  className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
1802
1806
  "aria-label": "Open arrange options",
1803
- children: /* @__PURE__ */ t(wt, { className: "h-3.5 w-3.5" })
1807
+ children: /* @__PURE__ */ e(wt, { className: "h-3.5 w-3.5" })
1804
1808
  }
1805
1809
  ) }),
1806
- /* @__PURE__ */ t(Pe, { align: "end", className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm", children: /* @__PURE__ */ s(G, { onClick: () => c(!0), children: [
1807
- /* @__PURE__ */ t(Ee, { className: "h-3.5 w-3.5" }),
1810
+ /* @__PURE__ */ e(Pe, { align: "end", className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm", children: /* @__PURE__ */ s(K, { onClick: () => c(!0), children: [
1811
+ /* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5" }),
1808
1812
  "Keep my order"
1809
1813
  ] }) })
1810
1814
  ] })
1811
1815
  ] });
1812
1816
  }
1813
- function fs() {
1814
- const e = w((i) => i.screenSizesOpen), a = w((i) => {
1817
+ function ps() {
1818
+ const t = w((i) => i.screenSizesOpen), a = w((i) => {
1815
1819
  var c, l;
1816
1820
  const r = ((c = i.dashboard) == null ? void 0 : c.sheets) ?? [], d = r.find((u) => u.id === i.selectedSheetId) ?? r[0];
1817
1821
  return !!d && !Nt(d) && !!((l = d.frames) != null && l.length);
1818
- }), o = w((i) => i.actions.setScreenSizesOpen), n = Qt(
1822
+ }), o = w((i) => i.actions.setScreenSizesOpen), n = Xt(
1819
1823
  "screen-sizes",
1820
1824
  "lg",
1821
1825
  a ? {
1822
1826
  label: "Screen sizes",
1823
- icon: /* @__PURE__ */ t(It, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
1824
- checked: e,
1827
+ icon: /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
1828
+ checked: t,
1825
1829
  order: 40,
1826
- onSelect: () => o(!e)
1830
+ onSelect: () => o(!t)
1827
1831
  } : void 0
1828
1832
  );
1829
- return !a || n.collapsed ? null : /* @__PURE__ */ t(
1830
- I,
1833
+ return !a || n.collapsed ? null : /* @__PURE__ */ e(
1834
+ T,
1831
1835
  {
1832
1836
  type: "button",
1833
1837
  size: "xs",
1834
- variant: e ? "secondary" : "ghost",
1835
- "aria-pressed": e,
1838
+ variant: t ? "secondary" : "ghost",
1839
+ "aria-pressed": t,
1836
1840
  "aria-label": "Screen sizes",
1837
1841
  title: "Screen sizes",
1838
- onClick: () => o(!e),
1842
+ onClick: () => o(!t),
1839
1843
  className: "w-7 px-0",
1840
- children: /* @__PURE__ */ t(It, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
1844
+ children: /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
1841
1845
  }
1842
1846
  );
1843
1847
  }
1844
- function gs({ dashboardId: e }) {
1848
+ function fs({ dashboardId: t }) {
1845
1849
  const { openDashboardId: a, access: o, printMode: n, serverIsFavorite: i, fetchedAt: r } = w(
1846
- Sa((l) => {
1850
+ Fa((l) => {
1847
1851
  var u;
1848
1852
  return {
1849
1853
  openDashboardId: (u = l.dashboard) == null ? void 0 : u.id,
@@ -1853,32 +1857,32 @@ function gs({ dashboardId: e }) {
1853
1857
  fetchedAt: l.viewer.fetchedAt
1854
1858
  };
1855
1859
  })
1856
- ), d = ka(), c = d.isFavorite(e, i, r);
1857
- return a !== e || n || o === "session-only" ? null : /* @__PURE__ */ t(
1858
- Da,
1860
+ ), d = Ea(), c = d.isFavorite(t, i, r);
1861
+ return a !== t || n || o === "session-only" ? null : /* @__PURE__ */ e(
1862
+ Ia,
1859
1863
  {
1860
1864
  variant: "toolbar",
1861
1865
  isFavorite: c,
1862
1866
  readOnly: o === "read-only",
1863
- pending: d.isPending(e),
1864
- onToggle: () => void d.setFavorite({ dashboardId: e, isFavorite: !c })
1867
+ pending: d.isPending(t),
1868
+ onToggle: () => void d.setFavorite({ dashboardId: t, isFavorite: !c })
1865
1869
  }
1866
1870
  );
1867
1871
  }
1868
- function bs({
1869
- width: e,
1872
+ function gs({
1873
+ width: t,
1870
1874
  hasOverflowMenu: a = !0,
1871
1875
  children: o
1872
1876
  }) {
1873
- const [n, i] = S(
1877
+ const [n, i] = D(
1874
1878
  () => /* @__PURE__ */ new Map()
1875
- ), [r, d] = S(null), [c, l] = S(null), u = J((m) => (i((p) => new Map(p).set(m.id, m)), () => i((p) => {
1879
+ ), [r, d] = D(null), [c, l] = D(null), u = Y((m) => (i((p) => new Map(p).set(m.id, m)), () => i((p) => {
1876
1880
  if (p.get(m.id) !== m) return p;
1877
1881
  const f = new Map(p);
1878
1882
  return f.delete(m.id), f;
1879
- })), []), h = te(
1883
+ })), []), h = ee(
1880
1884
  () => ({
1881
- width: e,
1885
+ width: t,
1882
1886
  hasOverflowMenu: a,
1883
1887
  overflowItems: [...n.values()].sort((m, p) => m.order - p.order),
1884
1888
  register: u,
@@ -1887,28 +1891,28 @@ function bs({
1887
1891
  anchorSlot: c,
1888
1892
  setAnchorSlot: l
1889
1893
  }),
1890
- [c, a, n, r, u, e]
1894
+ [c, a, n, r, u, t]
1891
1895
  );
1892
- return /* @__PURE__ */ t(Kt.Provider, { value: h, children: o });
1896
+ return /* @__PURE__ */ e(Yt.Provider, { value: h, children: o });
1893
1897
  }
1894
- function xs() {
1895
- const { setAnchorSlot: e } = Bt(Kt);
1896
- return /* @__PURE__ */ t("span", { ref: e, "aria-hidden": !0, className: "relative -mr-1.5 block h-7 w-0" });
1898
+ function bs() {
1899
+ const { setAnchorSlot: t } = Ut(Yt);
1900
+ return /* @__PURE__ */ e("span", { ref: t, "aria-hidden": !0, className: "relative -mr-1.5 block h-7 w-0" });
1897
1901
  }
1898
- function vs(e) {
1902
+ function vs(t) {
1899
1903
  var l;
1900
- const { authToken: a, tokenProps: o } = it(), { data: n } = Aa(), { mutate: i, isPending: r } = Fa(), d = !!e && ((l = n == null ? void 0 : n.preference) == null ? void 0 : l.defaultDashboardId) === e, c = !n || r;
1904
+ const { authToken: a, tokenProps: o } = it(), { data: n } = Ta(), { mutate: i, isPending: r } = La(), d = !!t && ((l = n == null ? void 0 : n.preference) == null ? void 0 : l.defaultDashboardId) === t, c = !n || r;
1901
1905
  return {
1902
- available: !!e && !!(a != null && a.accessToken) && !!(o != null && o.apiServiceUrl),
1906
+ available: !!t && !!(a != null && a.accessToken) && !!(o != null && o.apiServiceUrl),
1903
1907
  isDefault: d,
1904
1908
  disabled: c,
1905
1909
  toggle: () => {
1906
- !e || c || i({ dashboardId: d ? null : e });
1910
+ !t || c || i({ dashboardId: d ? null : t });
1907
1911
  }
1908
1912
  };
1909
1913
  }
1910
- function ys({
1911
- open: e,
1914
+ function xs({
1915
+ open: t,
1912
1916
  onOpenChange: a,
1913
1917
  onSave: o,
1914
1918
  onDiscard: n,
@@ -1919,16 +1923,16 @@ function ys({
1919
1923
  discardLabel: l = "Discard changes",
1920
1924
  saveLabel: u = "Save"
1921
1925
  }) {
1922
- return /* @__PURE__ */ t(dt, { open: e, onOpenChange: (m) => {
1926
+ return /* @__PURE__ */ e(dt, { open: t, onOpenChange: (m) => {
1923
1927
  !m && i || a(m);
1924
1928
  }, children: /* @__PURE__ */ s(ct, { children: [
1925
1929
  /* @__PURE__ */ s(ut, { children: [
1926
- /* @__PURE__ */ t(ht, { children: r }),
1927
- /* @__PURE__ */ t(mt, { children: d })
1930
+ /* @__PURE__ */ e(ht, { children: r }),
1931
+ /* @__PURE__ */ e(mt, { children: d })
1928
1932
  ] }),
1929
1933
  /* @__PURE__ */ s(pt, { children: [
1930
- /* @__PURE__ */ t(
1931
- I,
1934
+ /* @__PURE__ */ e(
1935
+ T,
1932
1936
  {
1933
1937
  type: "button",
1934
1938
  size: "xs",
@@ -1939,20 +1943,20 @@ function ys({
1939
1943
  children: l
1940
1944
  }
1941
1945
  ),
1942
- /* @__PURE__ */ t(ft, { disabled: i, children: c }),
1943
- /* @__PURE__ */ t(I, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ s(z, { children: [
1944
- /* @__PURE__ */ t(re, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
1946
+ /* @__PURE__ */ e(ft, { disabled: i, children: c }),
1947
+ /* @__PURE__ */ e(T, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ s(R, { children: [
1948
+ /* @__PURE__ */ e(ae, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
1945
1949
  "Saving..."
1946
1950
  ] }) : u })
1947
1951
  ] })
1948
1952
  ] }) });
1949
1953
  }
1950
- async function Cs(e) {
1954
+ async function ys(t) {
1951
1955
  var r, d;
1952
1956
  const a = (d = (r = w.getState()) == null ? void 0 : r.authToken) == null ? void 0 : d.accessToken;
1953
1957
  if (!a)
1954
1958
  return;
1955
- const o = `${e}/v1/invalidate-token`, n = await fetch(o, {
1959
+ const o = `${t}/v1/invalidate-token`, n = await fetch(o, {
1956
1960
  method: "POST",
1957
1961
  headers: {
1958
1962
  Authorization: `Bearer ${a}`
@@ -1963,116 +1967,97 @@ async function Cs(e) {
1963
1967
  const i = await n.json();
1964
1968
  return console.log("invalidateToken", i), i;
1965
1969
  }
1966
- function rn(e) {
1967
- switch (e == null ? void 0 : e.kind) {
1968
- case "queued":
1969
- return { text: K.queued };
1970
- case "preparing":
1971
- return { text: K.preparing };
1972
- case "fetching":
1973
- return { text: K.fetchingRows(e.rowsProcessed) };
1974
- case "finalizing":
1975
- return { text: K.finalizing };
1976
- case "processing":
1977
- return e.percent === null ? { text: K.processing } : { text: K.processing, detail: K.percentComplete(e.percent), bar: e.percent };
1978
- default:
1979
- return { text: K.inProgress };
1980
- }
1981
- }
1982
- function nn(e) {
1970
+ function sn(t) {
1983
1971
  var o;
1984
- const a = e.item;
1972
+ const a = t.item;
1985
1973
  return a.kind === "export" ? {
1986
1974
  title: a.title,
1987
1975
  status: a.status,
1988
1976
  startedAt: a.startedAt,
1989
1977
  finishedAt: a.finishedAt,
1990
- running: rn(a.stage),
1978
+ running: Ra(a.stage),
1991
1979
  finishedDetail: [
1992
1980
  a.totalRows !== null ? `${a.totalRows.toLocaleString("en-US")} rows` : null,
1993
- a.fileSize ? Pa(a.fileSize) : null
1981
+ a.fileSize ? Oa(a.fileSize) : null
1994
1982
  ].filter((n) => !!n),
1995
- failure: ((o = a.failure) == null ? void 0 : o.kind) === "export" ? a.failure.message : a.status === "failed" ? K.failedFallback : null,
1983
+ failure: ((o = a.failure) == null ? void 0 : o.kind) === "export" ? a.failure.message : a.status === "failed" ? ue.failedFallback : null,
1996
1984
  note: null
1997
1985
  } : {
1998
1986
  title: a.title,
1999
1987
  status: a.status,
2000
1988
  startedAt: a.startedAt,
2001
1989
  finishedAt: a.finishedAt,
2002
- running: { text: a.stageLabel ?? K.inProgress },
1990
+ running: { text: a.stageLabel ?? ue.inProgress },
2003
1991
  finishedDetail: [],
2004
1992
  failure: null,
2005
- note: a.omittedAttachmentCount > 0 ? de.attachmentsLeftOut(a.omittedAttachmentCount) : null
1993
+ note: a.omittedAttachmentCount > 0 ? le.attachmentsLeftOut(a.omittedAttachmentCount) : null
2006
1994
  };
2007
1995
  }
2008
- function sn({ row: e, now: a, api: o }) {
2009
- const [n, i] = S("idle"), r = nn(e), d = Ea(e, o), c = async () => {
1996
+ function on({ row: t, now: a, api: o }) {
1997
+ const [n, i] = D("idle"), r = sn(t), d = Va(t, o), c = async () => {
2010
1998
  if (!d) return;
2011
1999
  i("working");
2012
- const g = await Ma(o, e, d);
2000
+ const g = await za(o, t, d);
2013
2001
  i(g === "done" ? "idle" : g);
2014
- }, l = r.status === "ready" ? "bg-emerald-500" : r.status === "failed" ? "bg-destructive" : r.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", u = r.status === "ready" ? K.ready : r.status === "failed" ? K.failed : r.status === "cancelled" ? K.cancelled : K.inProgress, h = Date.parse(r.startedAt), m = Ft(Date.parse(r.finishedAt ?? r.startedAt), a, { addSuffix: !0 }), p = r.status === "running" && e.item.kind === "export" && a - h >= Ia, f = /* @__PURE__ */ t("span", { className: "text-muted-foreground/50", children: "·" });
2002
+ }, l = r.status === "ready" ? "bg-emerald-500" : r.status === "failed" ? "bg-destructive" : r.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", u = r.status === "ready" ? ue.ready : r.status === "failed" ? ue.failed : r.status === "cancelled" ? ue.cancelled : ue.inProgress, h = Date.parse(r.startedAt), m = Tt(Date.parse(r.finishedAt ?? r.startedAt), a, { addSuffix: !0 }), p = r.status === "running" && t.item.kind === "export" && a - h >= Ba, f = /* @__PURE__ */ e("span", { className: "text-muted-foreground/50", children: "·" });
2015
2003
  return /* @__PURE__ */ s("div", { className: "group flex items-start gap-2.5 px-3 py-2 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
2016
- /* @__PURE__ */ t("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ t("span", { className: `h-1.5 w-1.5 rounded-full ${l}` }) }),
2017
- /* @__PURE__ */ t("span", { className: "sr-only", children: u }),
2004
+ /* @__PURE__ */ e("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ e("span", { className: `h-1.5 w-1.5 rounded-full ${l}` }) }),
2005
+ /* @__PURE__ */ e("span", { className: "sr-only", children: u }),
2018
2006
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
2019
2007
  /* @__PURE__ */ s("div", { className: "flex h-5 items-center gap-2", children: [
2020
- /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: r.title }),
2021
- d && n === "working" && /* @__PURE__ */ t("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: /* @__PURE__ */ t(zt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }) }),
2022
- d && n !== "working" && /* @__PURE__ */ t(
2008
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: r.title }),
2009
+ d && n === "working" && /* @__PURE__ */ e("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: /* @__PURE__ */ e(jt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }) }),
2010
+ d && n !== "working" && /* @__PURE__ */ e(
2023
2011
  "button",
2024
2012
  {
2025
2013
  type: "button",
2026
2014
  onClick: () => void c(),
2027
2015
  className: "shrink-0 text-[12px] font-medium text-foreground/80 underline-offset-2 hover:text-foreground hover:underline focus-visible:underline focus-visible:outline-none",
2028
- children: Ta[d]
2016
+ children: Pa[d]
2029
2017
  }
2030
2018
  )
2031
2019
  ] }),
2032
2020
  r.status === "running" && r.running && /* @__PURE__ */ s("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
2033
- /* @__PURE__ */ t("span", { className: "tabular-nums", children: r.running.text }),
2034
- r.running.detail && /* @__PURE__ */ s(z, { children: [
2021
+ /* @__PURE__ */ e("span", { className: "tabular-nums", children: r.running.text }),
2022
+ r.running.detail && /* @__PURE__ */ s(R, { children: [
2035
2023
  " ",
2036
2024
  f,
2037
2025
  " ",
2038
- /* @__PURE__ */ t("span", { className: "tabular-nums", children: r.running.detail })
2026
+ /* @__PURE__ */ e("span", { className: "tabular-nums", children: r.running.detail })
2039
2027
  ] }),
2040
2028
  " ",
2041
2029
  f,
2042
2030
  " ",
2043
- /* @__PURE__ */ t("span", { children: K.started(Ft(h, a)) }),
2044
- r.running.bar !== void 0 && /* @__PURE__ */ t(La, { value: r.running.bar, className: "mt-1.5 h-1" }),
2045
- p && /* @__PURE__ */ t("div", { className: "mt-1", children: K.longRunning })
2031
+ /* @__PURE__ */ e("span", { children: ue.started(Tt(h, a)) }),
2032
+ r.running.percent !== void 0 && /* @__PURE__ */ e(Ma, { value: r.running.percent, className: "mt-1.5 h-1" }),
2033
+ p && /* @__PURE__ */ e("div", { className: "mt-1", children: ue.longRunning })
2046
2034
  ] }),
2047
2035
  r.status !== "running" && /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
2048
2036
  r.status === "ready" && r.finishedDetail.length > 0 ? (
2049
2037
  // Disclosed on hover or focus only; the time is what a reader scans.
2050
2038
  /* @__PURE__ */ s("span", { className: "hidden group-hover:contents group-focus-within:contents", children: [
2051
- r.finishedDetail.map((g, v) => /* @__PURE__ */ s(Vt.Fragment, { children: [
2052
- v > 0 && f,
2053
- /* @__PURE__ */ t("span", { children: g })
2054
- ] }, v)),
2039
+ r.finishedDetail.map((g, x) => /* @__PURE__ */ s(Mt.Fragment, { children: [
2040
+ x > 0 && f,
2041
+ /* @__PURE__ */ e("span", { children: g })
2042
+ ] }, x)),
2055
2043
  f
2056
2044
  ] })
2057
- ) : r.status !== "ready" ? /* @__PURE__ */ s(z, { children: [
2058
- /* @__PURE__ */ t("span", { children: u }),
2045
+ ) : r.status !== "ready" ? /* @__PURE__ */ s(R, { children: [
2046
+ /* @__PURE__ */ e("span", { children: u }),
2059
2047
  f
2060
2048
  ] }) : null,
2061
- /* @__PURE__ */ t("span", { children: m })
2049
+ /* @__PURE__ */ e("span", { children: m })
2062
2050
  ] }),
2063
- r.note && /* @__PURE__ */ t("div", { className: "text-[12px] leading-4 text-muted-foreground", children: r.note }),
2064
- r.status === "failed" && r.failure && /* @__PURE__ */ t("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: r.failure }),
2065
- (n === "denied" || n === "blocked") && /* @__PURE__ */ s("div", { role: "alert", className: "mt-1 flex items-start gap-1.5 text-[12px] leading-4 text-foreground", children: [
2066
- /* @__PURE__ */ t(Va, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
2067
- /* @__PURE__ */ t("span", { children: Ba(n) })
2068
- ] })
2051
+ r.note && /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-muted-foreground", children: r.note }),
2052
+ r.status === "failed" && r.failure && /* @__PURE__ */ e("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: r.failure }),
2053
+ (n === "denied" || n === "blocked") && /* @__PURE__ */ e(Ua, { problem: n, className: "mt-1" })
2069
2054
  ] })
2070
2055
  ] });
2071
2056
  }
2072
- function ws({ variant: e }) {
2073
- const { snapshot: a, markSeen: o } = yt(), n = a.runningCount > 0 ? a.runningCount > 9 ? "9+" : String(a.runningCount) : a.hasUnseenFinished ? "" : null, i = Qt("activity", "md", {
2074
- label: de.title,
2075
- icon: /* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" }),
2057
+ function Cs({ variant: t }) {
2058
+ const { snapshot: a, markSeen: o } = yt(), n = a.runningCount > 0 ? a.runningCount > 9 ? "9+" : String(a.runningCount) : a.hasUnseenFinished ? "" : null, i = Xt("activity", "md", {
2059
+ label: le.title,
2060
+ icon: /* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5" }),
2076
2061
  hint: n || (n === "" ? "New" : void 0),
2077
2062
  order: 30,
2078
2063
  onOpen: o
@@ -2085,18 +2070,18 @@ function ws({ variant: e }) {
2085
2070
  i.setPopoverOpen(r), r && o();
2086
2071
  },
2087
2072
  children: [
2088
- i.anchorSlot && Sr(
2089
- /* @__PURE__ */ t(mr, { asChild: !0, children: /* @__PURE__ */ t("span", { className: "absolute right-0 top-0 h-7 w-px" }) }),
2073
+ i.anchorSlot && Dr(
2074
+ /* @__PURE__ */ e(br, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "absolute right-0 top-0 h-7 w-px" }) }),
2090
2075
  i.anchorSlot
2091
2076
  ),
2092
- /* @__PURE__ */ t(
2077
+ /* @__PURE__ */ e(
2093
2078
  Fe,
2094
2079
  {
2095
2080
  className: "w-80 p-0",
2096
2081
  align: "end",
2097
2082
  sideOffset: 8,
2098
2083
  onFocusOutside: (r) => r.preventDefault(),
2099
- children: /* @__PURE__ */ t(Lt, {})
2084
+ children: /* @__PURE__ */ e(Pt, {})
2100
2085
  }
2101
2086
  )
2102
2087
  ]
@@ -2104,17 +2089,17 @@ function ws({ variant: e }) {
2104
2089
  ) : /* @__PURE__ */ s(Ae, { onOpenChange: (r) => {
2105
2090
  r && o();
2106
2091
  }, children: [
2107
- /* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ s(
2108
- I,
2092
+ /* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ s(
2093
+ T,
2109
2094
  {
2110
- variant: e ?? "ghost",
2095
+ variant: t ?? "ghost",
2111
2096
  size: "xs",
2112
2097
  className: "relative w-7 px-0",
2113
- "aria-label": de.title,
2114
- title: de.title,
2098
+ "aria-label": le.title,
2099
+ title: le.title,
2115
2100
  children: [
2116
- /* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" }),
2117
- n !== null && /* @__PURE__ */ t(
2101
+ /* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5" }),
2102
+ n !== null && /* @__PURE__ */ e(
2118
2103
  "span",
2119
2104
  {
2120
2105
  className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${n ? "-right-0.5 -top-0.5 h-3.5 min-w-3.5 px-0.5 text-[9px] font-semibold" : "right-1 top-1 h-1.5 w-1.5"}`,
@@ -2124,59 +2109,59 @@ function ws({ variant: e }) {
2124
2109
  ]
2125
2110
  }
2126
2111
  ) }),
2127
- /* @__PURE__ */ t(Fe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(Lt, {}) })
2112
+ /* @__PURE__ */ e(Fe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ e(Pt, {}) })
2128
2113
  ] });
2129
2114
  }
2130
- function Lt() {
2131
- const e = yt(), a = Ua(), { rows: o, activeTruncated: n } = e.snapshot, i = o.some((r) => Oa(r.item.status));
2115
+ function Pt() {
2116
+ const t = yt(), a = _a(), { rows: o, activeTruncated: n } = t.snapshot, i = o.some((r) => ja(r.item.status));
2132
2117
  return o.length === 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
2133
- /* @__PURE__ */ t("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ t(za, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
2134
- /* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: de.title }),
2135
- /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: de.empty })
2118
+ /* @__PURE__ */ e("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ e($a, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
2119
+ /* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: le.title }),
2120
+ /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: le.empty })
2136
2121
  ] }) : /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
2137
2122
  /* @__PURE__ */ s("div", { className: "flex h-8 items-center gap-2 border-b border-border px-3", children: [
2138
- /* @__PURE__ */ t("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: de.title }),
2139
- /* @__PURE__ */ t("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: o.length }),
2123
+ /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: le.title }),
2124
+ /* @__PURE__ */ e("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: o.length }),
2140
2125
  /* @__PURE__ */ s("div", { className: "ml-auto flex items-center gap-0.5", children: [
2141
- i && /* @__PURE__ */ t(
2142
- I,
2126
+ i && /* @__PURE__ */ e(
2127
+ T,
2143
2128
  {
2144
2129
  variant: "ghost",
2145
2130
  size: "xs",
2146
2131
  className: "h-6 px-1.5 text-[12px] text-muted-foreground hover:text-foreground",
2147
- onClick: e.clearFinished,
2148
- children: de.clear
2132
+ onClick: t.clearFinished,
2133
+ children: le.clear
2149
2134
  }
2150
2135
  ),
2151
- /* @__PURE__ */ t(
2152
- I,
2136
+ /* @__PURE__ */ e(
2137
+ T,
2153
2138
  {
2154
2139
  variant: "ghost",
2155
2140
  size: "xs",
2156
2141
  className: "h-6 w-6 px-0 text-muted-foreground hover:text-foreground",
2157
- onClick: e.refresh,
2142
+ onClick: t.refresh,
2158
2143
  title: "Refresh status",
2159
2144
  "aria-label": "Refresh status",
2160
- children: /* @__PURE__ */ t(zt, { strokeWidth: 1.75, className: "h-3.5 w-3.5" })
2145
+ children: /* @__PURE__ */ e(jt, { strokeWidth: 1.75, className: "h-3.5 w-3.5" })
2161
2146
  }
2162
2147
  )
2163
2148
  ] })
2164
2149
  ] }),
2165
- n && /* @__PURE__ */ t("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children: de.truncated }),
2166
- /* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y divide-border/70", children: o.map((r) => /* @__PURE__ */ t(sn, { row: r, now: a, api: e }, Ra(r))) }) })
2150
+ n && /* @__PURE__ */ e("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children: le.truncated }),
2151
+ /* @__PURE__ */ e("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y divide-border/70", children: o.map((r) => /* @__PURE__ */ e(on, { row: r, now: a, api: t }, Wa(r))) }) })
2167
2152
  ] });
2168
2153
  }
2169
- function on(e) {
2170
- if (e)
2154
+ function ln(t) {
2155
+ if (t)
2171
2156
  return {
2172
- renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
2173
- removedControlId: e.type === "remove" ? e.controlId : void 0,
2174
- cardBindingsById: e.type === "add" || e.type === "update" ? e.cardBindingsById : void 0,
2175
- affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
2157
+ renamed: t.type === "rename" ? { oldId: t.oldId, newId: t.newId } : void 0,
2158
+ removedControlId: t.type === "remove" ? t.controlId : void 0,
2159
+ cardBindingsById: t.type === "add" || t.type === "update" ? t.cardBindingsById : void 0,
2160
+ affectedBindingControlIds: t.type === "add" || t.type === "update" ? t.affectedBindingControlIds : void 0
2176
2161
  };
2177
2162
  }
2178
- function ln({
2179
- open: e,
2163
+ function dn({
2164
+ open: t,
2180
2165
  onOpenChange: a,
2181
2166
  trigger: o,
2182
2167
  showTrigger: n = !0,
@@ -2189,8 +2174,8 @@ function ln({
2189
2174
  preventPassiveDismissDuringCreate: u,
2190
2175
  resolvedOpen: h,
2191
2176
  setIsCreateFlowActive: m
2192
- } = qt({
2193
- open: e,
2177
+ } = Kt({
2178
+ open: t,
2194
2179
  onOpenChange: a,
2195
2180
  initialCreateFlowActive: i === "create",
2196
2181
  // Dialog mode renders a built-in X close button — allow explicit
@@ -2200,92 +2185,92 @@ function ln({
2200
2185
  // create and make consumers use `forceClose()` from a dedicated
2201
2186
  // button.
2202
2187
  dismissMode: n ? "passive" : "explicit-only"
2203
- }), p = w((C) => C.dashboard), { setDashboardControlsModel: f } = ce(), { participants: g } = _a(kr(p)), v = Array.from(
2188
+ }), p = w((C) => C.dashboard), { setDashboardControlsModel: f } = de(), { participants: g } = qa(Ar(p)), x = Array.from(
2204
2189
  new Map(
2205
2190
  g.flatMap(
2206
- (C) => C.fieldChoices.map((D) => {
2207
- var N;
2191
+ (C) => C.fieldChoices.map((A) => {
2192
+ var k;
2208
2193
  return [
2209
- D.value,
2194
+ A.value,
2210
2195
  {
2211
- option: D,
2212
- target: (N = C.fieldTargetMap) == null ? void 0 : N[D.value]
2196
+ option: A,
2197
+ target: (k = C.fieldTargetMap) == null ? void 0 : k[A.value]
2213
2198
  }
2214
2199
  ];
2215
2200
  })
2216
2201
  )
2217
2202
  ).values()
2218
- ), k = Array.from(
2203
+ ), N = Array.from(
2219
2204
  new Map(
2220
2205
  g.flatMap(
2221
- (C) => C.metricChoices.map((D) => {
2222
- var N;
2206
+ (C) => C.metricChoices.map((A) => {
2207
+ var k;
2223
2208
  return [
2224
- D.value,
2209
+ A.value,
2225
2210
  {
2226
- option: D,
2227
- target: (N = C.metricTargetMap) == null ? void 0 : N[D.value]
2211
+ option: A,
2212
+ target: (k = C.metricTargetMap) == null ? void 0 : k[A.value]
2228
2213
  }
2229
2214
  ];
2230
2215
  })
2231
2216
  )
2232
2217
  ).values()
2233
- ), V = xr({
2218
+ ), S = Cr({
2234
2219
  ...p || {},
2235
2220
  controls: []
2236
- }), U = ja(p), M = (C, D, N) => {
2221
+ }), M = Ha(p), U = (C, A, k) => {
2237
2222
  f(
2238
2223
  C,
2239
- D,
2240
- on(N)
2224
+ A,
2225
+ ln(k)
2241
2226
  );
2242
- }, A = J(() => {
2227
+ }, F = Y(() => {
2243
2228
  if (r) {
2244
2229
  d();
2245
2230
  return;
2246
2231
  }
2247
2232
  m(!1);
2248
- }, [r, d, m]), O = /* @__PURE__ */ t(
2249
- Ht,
2233
+ }, [r, d, m]), O = /* @__PURE__ */ e(
2234
+ Gt,
2250
2235
  {
2251
2236
  scope: "dashboard",
2252
2237
  controls: p.controls || [],
2253
- reservedControlIds: V,
2238
+ reservedControlIds: S,
2254
2239
  defaultValues: p.defaultControlValues || {},
2255
- usageByControlId: $a(p),
2256
- availableFieldChoices: v,
2257
- availableMetricChoices: k,
2240
+ usageByControlId: Qa(p),
2241
+ availableFieldChoices: x,
2242
+ availableMetricChoices: N,
2258
2243
  structuralParticipants: g,
2259
- structuralParticipantIdsByControlId: U,
2244
+ structuralParticipantIdsByControlId: M,
2260
2245
  initialCreateFlow: i === "create",
2261
2246
  onCreateFlowActiveChange: m,
2262
- onCreateFlowComplete: A,
2263
- onChange: M,
2247
+ onCreateFlowComplete: F,
2248
+ onChange: U,
2264
2249
  emptyMessage: "No dashboard controls yet."
2265
2250
  }
2266
- ), b = l ? "Add dashboard control" : "Dashboard Controls", F = /* @__PURE__ */ s(z, { children: [
2251
+ ), b = l ? "Add dashboard control" : "Dashboard Controls", I = /* @__PURE__ */ s(R, { children: [
2267
2252
  /* @__PURE__ */ s("div", { className: "space-y-1", children: [
2268
- /* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
2269
- /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
2253
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
2254
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
2270
2255
  ] }),
2271
2256
  O
2272
2257
  ] });
2273
2258
  return n ? /* @__PURE__ */ s(Ae, { open: h, onOpenChange: c, children: [
2274
- /* @__PURE__ */ t(qe, { asChild: !0, children: o || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
2275
- /* @__PURE__ */ t($t, { className: "mr-2 h-4 w-4" }),
2259
+ /* @__PURE__ */ e(qe, { asChild: !0, children: o || /* @__PURE__ */ s(T, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
2260
+ /* @__PURE__ */ e(Ht, { className: "mr-2 h-4 w-4" }),
2276
2261
  "Controls"
2277
2262
  ] }) }),
2278
- /* @__PURE__ */ t(
2263
+ /* @__PURE__ */ e(
2279
2264
  Fe,
2280
2265
  {
2281
2266
  className: "w-[620px] max-w-[95vw] space-y-4",
2282
2267
  align: "end",
2283
2268
  onEscapeKeyDown: u,
2284
2269
  onPointerDownOutside: u,
2285
- children: F
2270
+ children: I
2286
2271
  }
2287
2272
  )
2288
- ] }) : /* @__PURE__ */ t(Ie, { open: h, onOpenChange: c, children: /* @__PURE__ */ s(
2273
+ ] }) : /* @__PURE__ */ e(Ie, { open: h, onOpenChange: c, children: /* @__PURE__ */ s(
2289
2274
  Te,
2290
2275
  {
2291
2276
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
@@ -2297,9 +2282,9 @@ function ln({
2297
2282
  {
2298
2283
  className: l ? "space-y-0" : void 0,
2299
2284
  children: [
2300
- /* @__PURE__ */ t(Le, { className: "text-[15px]", children: b }),
2301
- /* @__PURE__ */ t(
2302
- xt,
2285
+ /* @__PURE__ */ e(Le, { className: "text-[15px]", children: b }),
2286
+ /* @__PURE__ */ e(
2287
+ vt,
2303
2288
  {
2304
2289
  className: l ? "sr-only" : "text-[13px]",
2305
2290
  children: l ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
@@ -2308,12 +2293,12 @@ function ln({
2308
2293
  ]
2309
2294
  }
2310
2295
  ),
2311
- /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: O })
2296
+ /* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: O })
2312
2297
  ]
2313
2298
  }
2314
2299
  ) });
2315
2300
  }
2316
- const dn = [
2301
+ const cn = [
2317
2302
  "enum",
2318
2303
  "multi_enum",
2319
2304
  "text",
@@ -2321,12 +2306,12 @@ const dn = [
2321
2306
  "boolean",
2322
2307
  "date"
2323
2308
  ];
2324
- function cn({
2325
- open: e,
2309
+ function un({
2310
+ open: t,
2326
2311
  onOpenChange: a,
2327
2312
  initialMode: o = "manage"
2328
2313
  }) {
2329
- var F;
2314
+ var I;
2330
2315
  const n = o === "create", {
2331
2316
  forceClose: i,
2332
2317
  handleOpenChange: r,
@@ -2334,58 +2319,58 @@ function cn({
2334
2319
  preventPassiveDismissDuringCreate: c,
2335
2320
  resolvedOpen: l,
2336
2321
  setIsCreateFlowActive: u
2337
- } = qt({
2338
- open: e,
2322
+ } = Kt({
2323
+ open: t,
2339
2324
  onOpenChange: a,
2340
2325
  initialCreateFlowActive: o === "create",
2341
2326
  dismissMode: "explicit-only"
2342
- }), h = w((C) => C.dashboard), m = w((C) => C.selectedSheetId), { setDashboardInputs: p } = ce(), f = (F = h.sheets) == null ? void 0 : F.find(
2327
+ }), h = w((C) => C.dashboard), m = w((C) => C.selectedSheetId), { setDashboardInputs: p } = de(), f = (I = h.sheets) == null ? void 0 : I.find(
2343
2328
  (C) => C.id === m
2344
- ), g = (f == null ? void 0 : f.kind) === "document" && !!f.document, v = te(
2345
- () => g && (f != null && f.document) ? Lr(h, f.id) : [],
2329
+ ), g = (f == null ? void 0 : f.kind) === "document" && !!f.document, x = ee(
2330
+ () => g && (f != null && f.document) ? Br(h, f.id) : [],
2346
2331
  [h, g, f == null ? void 0 : f.document, f == null ? void 0 : f.id]
2347
- ), k = te(
2348
- () => v.filter(
2332
+ ), N = ee(
2333
+ () => x.filter(
2349
2334
  (C) => C.kind === "control"
2350
2335
  ),
2351
- [v]
2352
- ), V = te(
2353
- () => k.map((C) => C.control),
2354
- [k]
2355
- ), U = te(
2356
- () => hn(V),
2357
- [V]
2358
- ), M = te(
2359
- () => un(h),
2336
+ [x]
2337
+ ), S = ee(
2338
+ () => N.map((C) => C.control),
2339
+ [N]
2340
+ ), M = ee(
2341
+ () => mn(S),
2342
+ [S]
2343
+ ), U = ee(
2344
+ () => hn(h),
2360
2345
  [h]
2361
- ), A = J(() => {
2346
+ ), F = Y(() => {
2362
2347
  if (n) {
2363
2348
  i();
2364
2349
  return;
2365
2350
  }
2366
2351
  u(!1);
2367
- }, [n, i, u]), O = J(
2368
- (C, D, N) => {
2352
+ }, [n, i, u]), O = Y(
2353
+ (C, A, k) => {
2369
2354
  !g || !(f != null && f.document) || p(
2370
- pn({
2355
+ fn({
2371
2356
  allInputs: h.inputs || [],
2372
2357
  documentSheetId: f.id,
2373
- currentDocumentInputs: v,
2358
+ currentDocumentInputs: x,
2374
2359
  nextControls: C,
2375
- nextDefaultValues: D,
2376
- change: N
2360
+ nextDefaultValues: A,
2361
+ change: k
2377
2362
  })
2378
2363
  );
2379
2364
  },
2380
2365
  [
2381
2366
  h.inputs,
2382
- v,
2367
+ x,
2383
2368
  g,
2384
2369
  f,
2385
2370
  p
2386
2371
  ]
2387
2372
  );
2388
- return !g || !(f != null && f.document) ? null : /* @__PURE__ */ t(Ie, { open: l, onOpenChange: r, children: /* @__PURE__ */ s(
2373
+ return !g || !(f != null && f.document) ? null : /* @__PURE__ */ e(Ie, { open: l, onOpenChange: r, children: /* @__PURE__ */ s(
2389
2374
  Te,
2390
2375
  {
2391
2376
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
@@ -2393,31 +2378,31 @@ function cn({
2393
2378
  onPointerDownOutside: c,
2394
2379
  children: [
2395
2380
  /* @__PURE__ */ s(bt, { className: d ? "space-y-0" : void 0, children: [
2396
- /* @__PURE__ */ t(Le, { className: "text-[15px]", children: d ? "Add document control" : "Document Controls" }),
2397
- /* @__PURE__ */ t(
2398
- xt,
2381
+ /* @__PURE__ */ e(Le, { className: "text-[15px]", children: d ? "Add document control" : "Document Controls" }),
2382
+ /* @__PURE__ */ e(
2383
+ vt,
2399
2384
  {
2400
2385
  className: d ? "sr-only" : "text-[13px]",
2401
2386
  children: d ? "Configure and add a document-local control input." : "Add document-local control inputs. They are stored on this document sheet and are not dashboard controls."
2402
2387
  }
2403
2388
  )
2404
2389
  ] }),
2405
- /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ t(
2406
- Ht,
2390
+ /* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ e(
2391
+ Gt,
2407
2392
  {
2408
2393
  scope: "dashboard",
2409
- controls: V,
2410
- reservedControlIds: M,
2411
- defaultValues: U,
2394
+ controls: S,
2395
+ reservedControlIds: U,
2396
+ defaultValues: M,
2412
2397
  usageByControlId: {},
2413
2398
  availableFieldChoices: [],
2414
2399
  availableMetricChoices: [],
2415
2400
  structuralParticipants: [],
2416
2401
  structuralParticipantIdsByControlId: {},
2417
- allowedControlTypes: dn,
2402
+ allowedControlTypes: cn,
2418
2403
  initialCreateFlow: o === "create",
2419
2404
  onCreateFlowActiveChange: u,
2420
- onCreateFlowComplete: A,
2405
+ onCreateFlowComplete: F,
2421
2406
  onChange: O,
2422
2407
  emptyMessage: "No document controls yet."
2423
2408
  }
@@ -2426,23 +2411,23 @@ function cn({
2426
2411
  }
2427
2412
  ) });
2428
2413
  }
2429
- function un(e) {
2430
- return (e.controls || []).map((a) => a.id);
2414
+ function hn(t) {
2415
+ return (t.controls || []).map((a) => a.id);
2431
2416
  }
2432
- function hn(e) {
2417
+ function mn(t) {
2433
2418
  const a = {};
2434
- for (const o of e)
2419
+ for (const o of t)
2435
2420
  o.defaultValue !== void 0 && (a[o.id] = o.defaultValue);
2436
2421
  return a;
2437
2422
  }
2438
- function mn(e, a) {
2439
- return a ? Object.prototype.hasOwnProperty.call(a, e.id) ? {
2440
- ...e,
2441
- defaultValue: a[e.id]
2442
- } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 };
2423
+ function pn(t, a) {
2424
+ return a ? Object.prototype.hasOwnProperty.call(a, t.id) ? {
2425
+ ...t,
2426
+ defaultValue: a[t.id]
2427
+ } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 };
2443
2428
  }
2444
- function pn({
2445
- allInputs: e,
2429
+ function fn({
2430
+ allInputs: t,
2446
2431
  documentSheetId: a,
2447
2432
  currentDocumentInputs: o,
2448
2433
  nextControls: n,
@@ -2452,7 +2437,7 @@ function pn({
2452
2437
  const d = new Map(
2453
2438
  n.map((p) => [
2454
2439
  p.id,
2455
- mn(p, i)
2440
+ pn(p, i)
2456
2441
  ])
2457
2442
  ), c = (r == null ? void 0 : r.type) === "rename" ? { oldId: r.oldId, newId: r.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
2458
2443
  for (const p of o) {
@@ -2464,37 +2449,37 @@ function pn({
2464
2449
  if (!f)
2465
2450
  continue;
2466
2451
  l.add(f.id);
2467
- const g = vr(
2452
+ const g = wr(
2468
2453
  f.id,
2469
- [...e, ...u].filter(
2470
- (k) => k.id !== p.id
2454
+ [...t, ...u].filter(
2455
+ (N) => N.id !== p.id
2471
2456
  )
2472
- ), v = f.id === g ? f : { ...f, id: g };
2457
+ ), x = f.id === g ? f : { ...f, id: g };
2473
2458
  u.push({
2474
2459
  ...p,
2475
- label: v.label,
2460
+ label: x.label,
2476
2461
  variableName: g,
2477
- requiredAtExecution: v.requiredAtExecution,
2478
- control: v
2462
+ requiredAtExecution: x.requiredAtExecution,
2463
+ control: x
2479
2464
  });
2480
2465
  }
2481
2466
  for (const p of d.values())
2482
2467
  l.has(p.id) || u.push(
2483
- Vr({
2468
+ Pr({
2484
2469
  control: p,
2485
- existingInputs: [...e, ...u],
2470
+ existingInputs: [...t, ...u],
2486
2471
  sheetId: a
2487
2472
  })
2488
2473
  );
2489
2474
  const h = new Set(
2490
2475
  o.map((p) => p.id)
2491
2476
  );
2492
- return [...e.filter(
2477
+ return [...t.filter(
2493
2478
  (p) => !h.has(p.id)
2494
2479
  ), ...u];
2495
2480
  }
2496
- function fn({
2497
- showFilters: e,
2481
+ function gn({
2482
+ showFilters: t,
2498
2483
  onShowFiltersChange: a,
2499
2484
  pickerContent: o,
2500
2485
  settingsContent: n,
@@ -2505,11 +2490,11 @@ function fn({
2505
2490
  pickerContentClassName: l,
2506
2491
  settingsContentClassName: u
2507
2492
  }) {
2508
- const h = i === "toolbar", [m, p] = S(!1), f = ot("interactive");
2493
+ const h = i === "toolbar", [m, p] = D(!1), f = ot("interactive");
2509
2494
  return /* @__PURE__ */ s(
2510
2495
  "div",
2511
2496
  {
2512
- className: Z(
2497
+ className: J(
2513
2498
  // Height lives on the shell so the outer border is part of the
2514
2499
  // h-7 box (matches regular `size="xs"` buttons). Inner triggers
2515
2500
  // stretch to fill via `h-full`.
@@ -2518,28 +2503,28 @@ function fn({
2518
2503
  r
2519
2504
  ),
2520
2505
  children: [
2521
- /* @__PURE__ */ s(Ae, { open: e, onOpenChange: a, children: [
2522
- /* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ s(
2523
- I,
2506
+ /* @__PURE__ */ s(Ae, { open: t, onOpenChange: a, children: [
2507
+ /* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ s(
2508
+ T,
2524
2509
  {
2525
2510
  variant: "ghost",
2526
2511
  size: "xs",
2527
- className: Z(
2512
+ className: J(
2528
2513
  "h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
2529
2514
  d
2530
2515
  ),
2531
2516
  children: [
2532
- e ? /* @__PURE__ */ t(Er, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Rt, { className: "h-3.5 w-3.5" }),
2517
+ t ? /* @__PURE__ */ e(Tr, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e($t, { className: "h-3.5 w-3.5" }),
2533
2518
  "Filter"
2534
2519
  ]
2535
2520
  }
2536
2521
  ) }),
2537
- /* @__PURE__ */ t(
2522
+ /* @__PURE__ */ e(
2538
2523
  Fe,
2539
2524
  {
2540
2525
  align: "end",
2541
2526
  sideOffset: 6,
2542
- className: Z(
2527
+ className: J(
2543
2528
  "w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
2544
2529
  l
2545
2530
  ),
@@ -2549,25 +2534,25 @@ function fn({
2549
2534
  )
2550
2535
  ] }),
2551
2536
  /* @__PURE__ */ s(Ae, { open: m, onOpenChange: p, children: [
2552
- /* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ t(
2553
- I,
2537
+ /* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ e(
2538
+ T,
2554
2539
  {
2555
2540
  variant: "ghost",
2556
2541
  size: "xs",
2557
- className: Z(
2542
+ className: J(
2558
2543
  "h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
2559
2544
  c
2560
2545
  ),
2561
2546
  "aria-label": "Filter and control actions",
2562
- children: /* @__PURE__ */ t(wt, { className: "h-3.5 w-3.5" })
2547
+ children: /* @__PURE__ */ e(wt, { className: "h-3.5 w-3.5" })
2563
2548
  }
2564
2549
  ) }),
2565
- /* @__PURE__ */ t(
2550
+ /* @__PURE__ */ e(
2566
2551
  Fe,
2567
2552
  {
2568
2553
  align: "end",
2569
2554
  sideOffset: 6,
2570
- className: Z(
2555
+ className: J(
2571
2556
  "w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
2572
2557
  u
2573
2558
  ),
@@ -2580,96 +2565,96 @@ function fn({
2580
2565
  }
2581
2566
  );
2582
2567
  }
2583
- function gn() {
2584
- Ir();
2585
- const e = w((l) => l.selectedSheetId), a = w((l) => l.selectedFrameId), o = w((l) => l.dashboard), n = w((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = ce(), { setCard: r } = Ge(), d = ee((l) => l.card.dataSource);
2586
- return xe(() => {
2568
+ function bn() {
2569
+ Lr();
2570
+ const t = w((l) => l.selectedSheetId), a = w((l) => l.selectedFrameId), o = w((l) => l.dashboard), n = w((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = de(), { setCard: r } = Ge(), d = Z((l) => l.card.dataSource);
2571
+ return ve(() => {
2587
2572
  var u, h;
2588
2573
  let l = n();
2589
2574
  if (!l) {
2590
- const m = (u = o == null ? void 0 : o.sheets) == null ? void 0 : u.find((f) => f.id === e), p = (h = m == null ? void 0 : m.frames) == null ? void 0 : h[0];
2575
+ const m = (u = o == null ? void 0 : o.sheets) == null ? void 0 : u.find((f) => f.id === t), p = (h = m == null ? void 0 : m.frames) == null ? void 0 : h[0];
2591
2576
  p && (i(p.id), l = p);
2592
2577
  }
2593
2578
  if (l) {
2594
2579
  const m = l.cards.find((p) => p.id === l.activeCardId);
2595
2580
  m && r(m);
2596
2581
  }
2597
- }, [n, e, a, o, i, r]), {
2582
+ }, [n, t, a, o, i, r]), {
2598
2583
  hasEntities: !!(d != null && d.selectedEntities && d.selectedEntities.length > 0)
2599
2584
  };
2600
2585
  }
2601
- function bn() {
2602
- const e = w((l) => l.dashboard), a = w(
2586
+ function vn() {
2587
+ const t = w((l) => l.dashboard), a = w(
2603
2588
  (l) => l.semanticExecutionPayload
2604
2589
  ), o = w(
2605
2590
  (l) => l.actions.addFilterInput
2606
- ), { hasEntities: n } = gn(), { isLoading: i } = Wa(), r = te(
2607
- () => yr(e, a),
2608
- [e, a]
2609
- ), c = !Cr(e) && r.hasEligibleCards && !i;
2591
+ ), { hasEntities: n } = bn(), { isLoading: i } = Ka(), r = ee(
2592
+ () => Nr(t, a),
2593
+ [t, a]
2594
+ ), c = !Sr(t) && r.hasEligibleCards && !i;
2610
2595
  return /* @__PURE__ */ s("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
2611
- c && /* @__PURE__ */ t("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ s(
2596
+ c && /* @__PURE__ */ e("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ s(
2612
2597
  "button",
2613
2598
  {
2614
2599
  type: "button",
2615
- onClick: () => o(wr(), {
2600
+ onClick: () => o(kr(), {
2616
2601
  kind: "allSheets",
2617
2602
  sheetKinds: ["dashboard"]
2618
2603
  }),
2619
2604
  title: `Applies to ${r.eligibleCardCount} of ${r.totalCardCount} date-aware cards`,
2620
2605
  className: "flex w-full items-start gap-2 rounded-control px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border",
2621
2606
  children: [
2622
- /* @__PURE__ */ t(Ur, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2607
+ /* @__PURE__ */ e(Rr, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2623
2608
  /* @__PURE__ */ s("span", { className: "flex min-w-0 flex-col", children: [
2624
- /* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
2625
- /* @__PURE__ */ t("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
2609
+ /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
2610
+ /* @__PURE__ */ e("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
2626
2611
  ] })
2627
2612
  ]
2628
2613
  }
2629
2614
  ) }),
2630
2615
  !n && /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
2631
- /* @__PURE__ */ t(qa, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
2632
- /* @__PURE__ */ t("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
2633
- /* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
2616
+ /* @__PURE__ */ e(Ga, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
2617
+ /* @__PURE__ */ e("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
2618
+ /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
2634
2619
  ] }),
2635
- n && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(Ha, { context: "filter" }) })
2620
+ n && /* @__PURE__ */ e("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ e(Xa, { context: "filter" }) })
2636
2621
  ] });
2637
2622
  }
2638
2623
  function xn({
2639
- onAddFilter: e,
2624
+ onAddFilter: t,
2640
2625
  onAddControl: a,
2641
2626
  onManageControls: o,
2642
2627
  onDismiss: n
2643
2628
  }) {
2644
2629
  const i = w(
2645
2630
  (c) => c.dashboard.filterLayout
2646
- ), { setFilterLayout: r } = ce(), d = (i == null ? void 0 : i.toolbarWrap) ?? !1;
2631
+ ), { setFilterLayout: r } = de(), d = (i == null ? void 0 : i.toolbarWrap) ?? !1;
2647
2632
  return /* @__PURE__ */ s("div", { className: "w-[300px]", children: [
2648
2633
  /* @__PURE__ */ s("div", { className: "p-1", children: [
2649
- /* @__PURE__ */ t(
2634
+ /* @__PURE__ */ e(
2650
2635
  rt,
2651
2636
  {
2652
- icon: Rt,
2637
+ icon: $t,
2653
2638
  label: "Add filter",
2654
2639
  onClick: () => {
2655
- e(), n();
2640
+ t(), n();
2656
2641
  }
2657
2642
  }
2658
2643
  ),
2659
- /* @__PURE__ */ t(
2644
+ /* @__PURE__ */ e(
2660
2645
  rt,
2661
2646
  {
2662
- icon: $t,
2647
+ icon: Ht,
2663
2648
  label: "Add control",
2664
2649
  onClick: () => {
2665
2650
  a(), n();
2666
2651
  }
2667
2652
  }
2668
2653
  ),
2669
- /* @__PURE__ */ t(
2654
+ /* @__PURE__ */ e(
2670
2655
  rt,
2671
2656
  {
2672
- icon: _t,
2657
+ icon: Wt,
2673
2658
  label: "Manage controls",
2674
2659
  onClick: () => {
2675
2660
  o(), n();
@@ -2677,11 +2662,11 @@ function xn({
2677
2662
  }
2678
2663
  )
2679
2664
  ] }),
2680
- /* @__PURE__ */ t("div", { className: "border-t border-border/60" }),
2665
+ /* @__PURE__ */ e("div", { className: "border-t border-border/60" }),
2681
2666
  /* @__PURE__ */ s("div", { className: "space-y-1 p-2", children: [
2682
- /* @__PURE__ */ t("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
2683
- /* @__PURE__ */ t(
2684
- vn,
2667
+ /* @__PURE__ */ e("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
2668
+ /* @__PURE__ */ e(
2669
+ yn,
2685
2670
  {
2686
2671
  id: "filter-display-wrap",
2687
2672
  label: "Wrap to multiple lines",
@@ -2693,7 +2678,7 @@ function xn({
2693
2678
  ] });
2694
2679
  }
2695
2680
  function rt({
2696
- icon: e,
2681
+ icon: t,
2697
2682
  label: a,
2698
2683
  onClick: o
2699
2684
  }) {
@@ -2704,32 +2689,32 @@ function rt({
2704
2689
  onClick: o,
2705
2690
  className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[13px] text-foreground outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40",
2706
2691
  children: [
2707
- /* @__PURE__ */ t(e, { className: "h-3.5 w-3.5 text-muted-foreground" }),
2692
+ /* @__PURE__ */ e(t, { className: "h-3.5 w-3.5 text-muted-foreground" }),
2708
2693
  a
2709
2694
  ]
2710
2695
  }
2711
2696
  );
2712
2697
  }
2713
- function vn({
2714
- id: e,
2698
+ function yn({
2699
+ id: t,
2715
2700
  label: a,
2716
2701
  checked: o,
2717
2702
  onCheckedChange: n
2718
2703
  }) {
2719
2704
  return /* @__PURE__ */ s("div", { className: "flex items-center gap-2 rounded-control px-1 py-1 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
2720
- /* @__PURE__ */ t(gt, { id: e, checked: o, onCheckedChange: n }),
2721
- /* @__PURE__ */ t(
2705
+ /* @__PURE__ */ e(gt, { id: t, checked: o, onCheckedChange: n }),
2706
+ /* @__PURE__ */ e(
2722
2707
  De,
2723
2708
  {
2724
- htmlFor: e,
2709
+ htmlFor: t,
2725
2710
  className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
2726
2711
  children: a
2727
2712
  }
2728
2713
  )
2729
2714
  ] });
2730
2715
  }
2731
- function Ns({
2732
- size: e,
2716
+ function ws({
2717
+ size: t,
2733
2718
  className: a,
2734
2719
  primaryButtonClassName: o,
2735
2720
  secondaryButtonClassName: n,
@@ -2737,15 +2722,15 @@ function Ns({
2737
2722
  settingsContentClassName: r
2738
2723
  }) {
2739
2724
  var O;
2740
- const [d, c] = S(null), l = w((b) => b.dashboard), u = w((b) => b.selectedSheetId), h = w((b) => b.showFilters), m = w((b) => b.actions), { setDocumentPanelTarget: p, setShowFilters: f } = m, g = (O = l.sheets) == null ? void 0 : O.find(
2725
+ const [d, c] = D(null), l = w((b) => b.dashboard), u = w((b) => b.selectedSheetId), h = w((b) => b.showFilters), m = w((b) => b.actions), { setDocumentPanelTarget: p, setShowFilters: f } = m, g = (O = l.sheets) == null ? void 0 : O.find(
2741
2726
  (b) => b.id === u
2742
- ), v = Nt(g), k = J((b) => {
2727
+ ), x = Nt(g), N = Y((b) => {
2743
2728
  window.setTimeout(() => {
2744
2729
  c(b);
2745
2730
  }, 0);
2746
- }, []), V = J(
2731
+ }, []), S = Y(
2747
2732
  (b) => {
2748
- if (v && u) {
2733
+ if (x && u) {
2749
2734
  b && p(u, {
2750
2735
  kind: "document",
2751
2736
  group: "inputs"
@@ -2755,35 +2740,35 @@ function Ns({
2755
2740
  f(b);
2756
2741
  },
2757
2742
  [
2758
- v,
2743
+ x,
2759
2744
  u,
2760
2745
  p,
2761
2746
  f
2762
2747
  ]
2763
- ), U = J(() => {
2764
- V(!0);
2765
- }, [V]), M = J(() => {
2766
- k("create");
2767
- }, [k]), A = J(() => {
2768
- k("manage");
2769
- }, [k]);
2770
- return /* @__PURE__ */ s(z, { children: [
2771
- /* @__PURE__ */ t(
2772
- fn,
2748
+ ), M = Y(() => {
2749
+ S(!0);
2750
+ }, [S]), U = Y(() => {
2751
+ N("create");
2752
+ }, [N]), F = Y(() => {
2753
+ N("manage");
2754
+ }, [N]);
2755
+ return /* @__PURE__ */ s(R, { children: [
2756
+ /* @__PURE__ */ e(
2757
+ gn,
2773
2758
  {
2774
- showFilters: v ? !1 : h,
2775
- onShowFiltersChange: V,
2776
- pickerContent: /* @__PURE__ */ t(bn, {}),
2777
- settingsContent: (b) => /* @__PURE__ */ t(
2759
+ showFilters: x ? !1 : h,
2760
+ onShowFiltersChange: S,
2761
+ pickerContent: /* @__PURE__ */ e(vn, {}),
2762
+ settingsContent: (b) => /* @__PURE__ */ e(
2778
2763
  xn,
2779
2764
  {
2780
- onAddFilter: U,
2781
- onAddControl: M,
2782
- onManageControls: A,
2765
+ onAddFilter: M,
2766
+ onAddControl: U,
2767
+ onManageControls: F,
2783
2768
  onDismiss: b
2784
2769
  }
2785
2770
  ),
2786
- size: e,
2771
+ size: t,
2787
2772
  className: a,
2788
2773
  primaryButtonClassName: o,
2789
2774
  secondaryButtonClassName: n,
@@ -2791,8 +2776,8 @@ function Ns({
2791
2776
  settingsContentClassName: r
2792
2777
  }
2793
2778
  ),
2794
- d ? v ? /* @__PURE__ */ t(
2795
- cn,
2779
+ d ? x ? /* @__PURE__ */ e(
2780
+ un,
2796
2781
  {
2797
2782
  open: !0,
2798
2783
  onOpenChange: (b) => {
@@ -2800,8 +2785,8 @@ function Ns({
2800
2785
  },
2801
2786
  initialMode: d
2802
2787
  }
2803
- ) : /* @__PURE__ */ t(
2804
- ln,
2788
+ ) : /* @__PURE__ */ e(
2789
+ dn,
2805
2790
  {
2806
2791
  open: !0,
2807
2792
  onOpenChange: (b) => {
@@ -2813,38 +2798,38 @@ function Ns({
2813
2798
  ) : null
2814
2799
  ] });
2815
2800
  }
2816
- function yn({
2817
- disabled: e,
2801
+ function Cn({
2802
+ disabled: t,
2818
2803
  briefingCount: a,
2819
2804
  className: o,
2820
2805
  onClick: n
2821
2806
  }) {
2822
2807
  const i = typeof a == "number" && a > 0;
2823
2808
  return /* @__PURE__ */ s(
2824
- I,
2809
+ T,
2825
2810
  {
2826
2811
  type: "button",
2827
2812
  size: "xs",
2828
2813
  variant: "outline",
2829
- disabled: e,
2830
- className: Z("gap-1.5", o),
2814
+ disabled: t,
2815
+ className: J("gap-1.5", o),
2831
2816
  onClick: n,
2832
2817
  "aria-label": "Reports & briefings",
2833
2818
  children: [
2834
- /* @__PURE__ */ t(Rr, { className: "h-3.5 w-3.5" }),
2819
+ /* @__PURE__ */ e(jr, { className: "h-3.5 w-3.5" }),
2835
2820
  "Reports & briefings",
2836
- i ? /* @__PURE__ */ t("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
2821
+ i ? /* @__PURE__ */ e("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
2837
2822
  ]
2838
2823
  }
2839
2824
  );
2840
2825
  }
2841
- const Cn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Jt = "inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", je = "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-3 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50";
2842
- function wn(e) {
2843
- return e === "dashboard" ? "This dashboard" : "Project";
2826
+ const wn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", ta = "inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", je = "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-3 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50";
2827
+ function Nn(t) {
2828
+ return t === "dashboard" ? "This dashboard" : "Project";
2844
2829
  }
2845
- function Nn(e) {
2846
- if (!e) return "Never";
2847
- const a = new Date(e);
2830
+ function Sn(t) {
2831
+ if (!t) return "Never";
2832
+ const a = new Date(t);
2848
2833
  if (Number.isNaN(a.getTime())) return "Unknown";
2849
2834
  const o = Date.now() - a.getTime(), n = Math.round(o / 6e4);
2850
2835
  if (n < 1) return "now";
@@ -2856,49 +2841,49 @@ function Nn(e) {
2856
2841
  const d = Math.round(r / 7);
2857
2842
  return d < 5 ? `${d}w ago` : `${Math.round(r / 30)}mo ago`;
2858
2843
  }
2859
- function Sn(e) {
2860
- return e.scheduleExpr ? Br(
2861
- e.scheduleExpr,
2862
- e.timezone || "UTC"
2844
+ function kn(t) {
2845
+ return t.scheduleExpr ? Mr(
2846
+ t.scheduleExpr,
2847
+ t.timezone || "UTC"
2863
2848
  ) ?? "Invalid schedule" : "On demand";
2864
2849
  }
2865
- function kn(e) {
2866
- if (e.lastRunStatus) {
2867
- const a = e.lastRunStatus.toString().toUpperCase();
2868
- return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${e.lastRunStatus.toString().toLowerCase()}`;
2850
+ function Dn(t) {
2851
+ if (t.lastRunStatus) {
2852
+ const a = t.lastRunStatus.toString().toUpperCase();
2853
+ return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${t.lastRunStatus.toString().toLowerCase()}`;
2869
2854
  }
2870
2855
  return null;
2871
2856
  }
2872
- function Zt(e) {
2873
- return e.hasActiveRun ? "Running" : e.lastRunStatus ? `Last run ${e.lastRunStatus.toString().toLowerCase()}` : "Idle";
2857
+ function aa(t) {
2858
+ return t.hasActiveRun ? "Running" : t.lastRunStatus ? `Last run ${t.lastRunStatus.toString().toLowerCase()}` : "Idle";
2874
2859
  }
2875
- function Dn(e) {
2876
- return e.source.type === "dashboard" ? "This dashboard" : "Project";
2860
+ function An(t) {
2861
+ return t.source.type === "dashboard" ? "This dashboard" : "Project";
2877
2862
  }
2878
- function An({
2879
- activeView: e,
2863
+ function Fn({
2864
+ activeView: t,
2880
2865
  onChange: a
2881
2866
  }) {
2882
- return /* @__PURE__ */ t(
2867
+ return /* @__PURE__ */ e(
2883
2868
  "div",
2884
2869
  {
2885
2870
  className: "flex shrink-0 items-center gap-1 rounded-control bg-muted p-0.5",
2886
2871
  role: "tablist",
2887
2872
  "aria-label": "Briefing source view",
2888
2873
  children: ["dashboard", "project"].map((o) => {
2889
- const n = e === o;
2890
- return /* @__PURE__ */ t(
2874
+ const n = t === o;
2875
+ return /* @__PURE__ */ e(
2891
2876
  "button",
2892
2877
  {
2893
2878
  type: "button",
2894
2879
  role: "tab",
2895
2880
  "aria-selected": n,
2896
2881
  onClick: () => a(o),
2897
- className: Z(
2882
+ className: J(
2898
2883
  "h-6 rounded-[3px] px-2 text-[11px] transition-colors",
2899
2884
  n ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
2900
2885
  ),
2901
- children: wn(o)
2886
+ children: Nn(o)
2902
2887
  },
2903
2888
  o
2904
2889
  );
@@ -2906,8 +2891,8 @@ function An({
2906
2891
  }
2907
2892
  );
2908
2893
  }
2909
- function Fn({
2910
- briefings: e,
2894
+ function En({
2895
+ briefings: t,
2911
2896
  dashboardLabel: a,
2912
2897
  sourceView: o,
2913
2898
  error: n,
@@ -2922,59 +2907,59 @@ function Fn({
2922
2907
  onRunNow: p,
2923
2908
  onTogglePause: f,
2924
2909
  onDelete: g,
2925
- selectingId: v,
2926
- busyId: k,
2927
- manageBriefingsHref: V,
2928
- contentKind: U,
2929
- hideHeader: M = !1
2910
+ selectingId: x,
2911
+ busyId: N,
2912
+ manageBriefingsHref: S,
2913
+ contentKind: M,
2914
+ hideHeader: U = !1
2930
2915
  }) {
2931
- const A = e.length, O = e.filter((N) => N.status === "ACTIVE").length, b = U === "reports" ? A === 1 ? "report" : "reports" : U === "briefings" ? A === 1 ? "briefing" : "briefings" : A === 1 ? "item" : "items", F = e.find((N) => N.hasActiveRun) ?? null, C = U ?? "reports & briefings", D = o === "dashboard" ? a : `Project ${C}`;
2916
+ const F = t.length, O = t.filter((k) => k.status === "ACTIVE").length, b = M === "reports" ? F === 1 ? "report" : "reports" : M === "briefings" ? F === 1 ? "briefing" : "briefings" : F === 1 ? "item" : "items", I = t.find((k) => k.hasActiveRun) ?? null, C = M ?? "reports & briefings", A = o === "dashboard" ? a : `Project ${C}`;
2932
2917
  return /* @__PURE__ */ s(
2933
2918
  "section",
2934
2919
  {
2935
2920
  "aria-label": `Dashboard ${C.replace("&", "and")}`,
2936
2921
  className: "flex h-full min-h-0 flex-col bg-background text-foreground",
2937
2922
  children: [
2938
- M ? null : /* @__PURE__ */ s("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
2923
+ U ? null : /* @__PURE__ */ s("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
2939
2924
  /* @__PURE__ */ s("div", { className: "min-w-0", children: [
2940
- /* @__PURE__ */ t("div", { className: Cn, children: C }),
2941
- /* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: D })
2925
+ /* @__PURE__ */ e("div", { className: wn, children: C }),
2926
+ /* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: A })
2942
2927
  ] }),
2943
- /* @__PURE__ */ t(
2928
+ /* @__PURE__ */ e(
2944
2929
  "button",
2945
2930
  {
2946
2931
  type: "button",
2947
2932
  onClick: d,
2948
2933
  className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
2949
2934
  "aria-label": `Close ${C.replace("&", "and")} panel`,
2950
- children: /* @__PURE__ */ t(Xe, { className: "h-3.5 w-3.5" })
2935
+ children: /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" })
2951
2936
  }
2952
2937
  )
2953
2938
  ] }),
2954
2939
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-3 border-b border-border px-4 py-2", children: [
2955
2940
  /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-3", children: [
2956
- /* @__PURE__ */ t(
2957
- An,
2941
+ /* @__PURE__ */ e(
2942
+ Fn,
2958
2943
  {
2959
2944
  activeView: o,
2960
2945
  onChange: r
2961
2946
  }
2962
2947
  ),
2963
- /* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && A === 0 ? /* @__PURE__ */ s("span", { children: [
2948
+ /* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && F === 0 ? /* @__PURE__ */ s("span", { children: [
2964
2949
  "Loading ",
2965
2950
  C,
2966
2951
  "…"
2967
- ] }) : A === 0 ? /* @__PURE__ */ s("span", { children: [
2952
+ ] }) : F === 0 ? /* @__PURE__ */ s("span", { children: [
2968
2953
  "No ",
2969
2954
  C,
2970
2955
  " yet"
2971
- ] }) : /* @__PURE__ */ s(z, { children: [
2956
+ ] }) : /* @__PURE__ */ s(R, { children: [
2972
2957
  /* @__PURE__ */ s("span", { className: "font-medium text-foreground/80", children: [
2973
- A,
2958
+ F,
2974
2959
  " ",
2975
2960
  b
2976
2961
  ] }),
2977
- /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2962
+ /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2978
2963
  /* @__PURE__ */ s("span", { children: [
2979
2964
  O,
2980
2965
  " active"
@@ -2987,17 +2972,17 @@ function Fn({
2987
2972
  // when a manual reload is in flight, but don't show a separate
2988
2973
  // refresh button — close+reopen handles the rare "stale list"
2989
2974
  // case without crowding the toolbar.
2990
- /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
2975
+ /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
2991
2976
  ) : null,
2992
- A > 0 && u ? m && h ? /* @__PURE__ */ s(Ve, { children: [
2993
- /* @__PURE__ */ t(Be, { asChild: !0, children: /* @__PURE__ */ s("button", { className: je, children: [
2994
- /* @__PURE__ */ t(ve, { className: "h-3 w-3" }),
2977
+ F > 0 && u ? m && h ? /* @__PURE__ */ s(Ve, { children: [
2978
+ /* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ s("button", { className: je, children: [
2979
+ /* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
2995
2980
  " New"
2996
2981
  ] }) }),
2997
2982
  /* @__PURE__ */ s(Pe, { align: "end", children: [
2998
- /* @__PURE__ */ t(G, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
2999
- /* @__PURE__ */ t(
3000
- G,
2983
+ /* @__PURE__ */ e(K, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
2984
+ /* @__PURE__ */ e(
2985
+ K,
3001
2986
  {
3002
2987
  onClick: () => l("analytical_briefing"),
3003
2988
  children: "Create analytical briefing"
@@ -3010,7 +2995,7 @@ function Fn({
3010
2995
  onClick: () => l("scheduled_report"),
3011
2996
  className: je,
3012
2997
  children: [
3013
- /* @__PURE__ */ t(ve, { className: "h-3 w-3" }),
2998
+ /* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
3014
2999
  " Schedule report"
3015
3000
  ]
3016
3001
  }
@@ -3020,53 +3005,53 @@ function Fn({
3020
3005
  onClick: () => l("analytical_briefing"),
3021
3006
  className: je,
3022
3007
  children: [
3023
- /* @__PURE__ */ t(ve, { className: "h-3 w-3" }),
3008
+ /* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
3024
3009
  " New briefing"
3025
3010
  ]
3026
3011
  }
3027
3012
  ) : null : null
3028
3013
  ] })
3029
3014
  ] }),
3030
- F ? /* @__PURE__ */ s("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
3031
- /* @__PURE__ */ t(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
3032
- /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: F.name }),
3033
- /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
3034
- /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: Zt(F) })
3015
+ I ? /* @__PURE__ */ s("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
3016
+ /* @__PURE__ */ e(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
3017
+ /* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: I.name }),
3018
+ /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
3019
+ /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: aa(I) })
3035
3020
  ] }) : null,
3036
3021
  /* @__PURE__ */ s("div", { className: "flex-1 overflow-y-auto", children: [
3037
- n ? /* @__PURE__ */ t("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: n }) : null,
3038
- !i && e.length === 0 && !n ? /* @__PURE__ */ t(
3039
- En,
3022
+ n ? /* @__PURE__ */ e("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: n }) : null,
3023
+ !i && t.length === 0 && !n ? /* @__PURE__ */ e(
3024
+ In,
3040
3025
  {
3041
3026
  onNew: l,
3042
3027
  canCreate: u,
3043
3028
  canCreateScheduledReport: h,
3044
3029
  analyticalBriefingsEnabled: m,
3045
- contentKind: U
3030
+ contentKind: M
3046
3031
  }
3047
3032
  ) : null,
3048
- e.map((N) => /* @__PURE__ */ t(
3049
- Tn,
3033
+ t.map((k) => /* @__PURE__ */ e(
3034
+ Ln,
3050
3035
  {
3051
- briefing: N,
3052
- isOpening: v === N.id,
3053
- isBusy: k === N.id,
3054
- onOpen: () => c(N.id),
3055
- onRunNow: () => p(N),
3056
- onTogglePause: () => f(N),
3057
- onDelete: () => g(N)
3036
+ briefing: k,
3037
+ isOpening: x === k.id,
3038
+ isBusy: N === k.id,
3039
+ onOpen: () => c(k.id),
3040
+ onRunNow: () => p(k),
3041
+ onTogglePause: () => f(k),
3042
+ onDelete: () => g(k)
3058
3043
  },
3059
- N.id
3044
+ k.id
3060
3045
  ))
3061
3046
  ] }),
3062
- V ? /* @__PURE__ */ t("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ s(
3047
+ S ? /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ s(
3063
3048
  "a",
3064
3049
  {
3065
- href: V,
3066
- className: Z(Jt, "h-6 px-1 text-[11px]"),
3050
+ href: S,
3051
+ className: J(ta, "h-6 px-1 text-[11px]"),
3067
3052
  children: [
3068
3053
  "Manage all reports & briefings",
3069
- /* @__PURE__ */ t(Mr, { className: "h-3 w-3" })
3054
+ /* @__PURE__ */ e(Or, { className: "h-3 w-3" })
3070
3055
  ]
3071
3056
  }
3072
3057
  ) }) : null
@@ -3074,8 +3059,8 @@ function Fn({
3074
3059
  }
3075
3060
  );
3076
3061
  }
3077
- function En({
3078
- onNew: e,
3062
+ function In({
3063
+ onNew: t,
3079
3064
  canCreate: a,
3080
3065
  canCreateScheduledReport: o,
3081
3066
  analyticalBriefingsEnabled: n,
@@ -3089,33 +3074,33 @@ function En({
3089
3074
  description: "Create an analytical briefing to monitor this dashboard and brief your team."
3090
3075
  } : null;
3091
3076
  return /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
3092
- /* @__PURE__ */ t(In, { className: "mb-5 h-[88px] w-[112px] text-border" }),
3093
- /* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: (r == null ? void 0 : r.title) ?? "Have an analyst brief your team" }),
3094
- /* @__PURE__ */ t("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (r == null ? void 0 : r.description) ?? "Describe what to watch. An analyst digs into this dashboard and the data behind it, then briefs your team on the cadence you choose." }),
3077
+ /* @__PURE__ */ e(Tn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
3078
+ /* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: (r == null ? void 0 : r.title) ?? "Have an analyst brief your team" }),
3079
+ /* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (r == null ? void 0 : r.description) ?? "Describe what to watch. An analyst digs into this dashboard and the data behind it, then briefs your team on the cadence you choose." }),
3095
3080
  a ? /* @__PURE__ */ s("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
3096
3081
  o ? /* @__PURE__ */ s(
3097
3082
  "button",
3098
3083
  {
3099
- onClick: () => e("scheduled_report"),
3084
+ onClick: () => t("scheduled_report"),
3100
3085
  className: je,
3101
3086
  children: [
3102
- /* @__PURE__ */ t(ve, { className: "h-3 w-3" }),
3087
+ /* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
3103
3088
  " Schedule a report"
3104
3089
  ]
3105
3090
  }
3106
3091
  ) : null,
3107
- n ? /* @__PURE__ */ t(
3092
+ n ? /* @__PURE__ */ e(
3108
3093
  "button",
3109
3094
  {
3110
- onClick: () => e("analytical_briefing"),
3111
- className: Jt,
3095
+ onClick: () => t("analytical_briefing"),
3096
+ className: ta,
3112
3097
  children: "Create analytical briefing"
3113
3098
  }
3114
3099
  ) : null
3115
3100
  ] }) : null
3116
3101
  ] });
3117
3102
  }
3118
- function In({ className: e }) {
3103
+ function Tn({ className: t }) {
3119
3104
  return /* @__PURE__ */ s(
3120
3105
  "svg",
3121
3106
  {
@@ -3124,9 +3109,9 @@ function In({ className: e }) {
3124
3109
  xmlns: "http://www.w3.org/2000/svg",
3125
3110
  role: "presentation",
3126
3111
  "aria-hidden": "true",
3127
- className: e,
3112
+ className: t,
3128
3113
  children: [
3129
- /* @__PURE__ */ t(
3114
+ /* @__PURE__ */ e(
3130
3115
  "rect",
3131
3116
  {
3132
3117
  x: "22",
@@ -3138,7 +3123,7 @@ function In({ className: e }) {
3138
3123
  strokeWidth: "1.25"
3139
3124
  }
3140
3125
  ),
3141
- /* @__PURE__ */ t(
3126
+ /* @__PURE__ */ e(
3142
3127
  "line",
3143
3128
  {
3144
3129
  x1: "30",
@@ -3150,7 +3135,7 @@ function In({ className: e }) {
3150
3135
  strokeLinecap: "round"
3151
3136
  }
3152
3137
  ),
3153
- /* @__PURE__ */ t(
3138
+ /* @__PURE__ */ e(
3154
3139
  "line",
3155
3140
  {
3156
3141
  x1: "30",
@@ -3163,8 +3148,8 @@ function In({ className: e }) {
3163
3148
  opacity: "0.5"
3164
3149
  }
3165
3150
  ),
3166
- /* @__PURE__ */ t("circle", { cx: "31", cy: "32", r: "1", fill: "currentColor", opacity: "0.6" }),
3167
- /* @__PURE__ */ t(
3151
+ /* @__PURE__ */ e("circle", { cx: "31", cy: "32", r: "1", fill: "currentColor", opacity: "0.6" }),
3152
+ /* @__PURE__ */ e(
3168
3153
  "line",
3169
3154
  {
3170
3155
  x1: "35",
@@ -3177,8 +3162,8 @@ function In({ className: e }) {
3177
3162
  strokeLinecap: "round"
3178
3163
  }
3179
3164
  ),
3180
- /* @__PURE__ */ t("circle", { cx: "31", cy: "38", r: "1", fill: "currentColor", opacity: "0.6" }),
3181
- /* @__PURE__ */ t(
3165
+ /* @__PURE__ */ e("circle", { cx: "31", cy: "38", r: "1", fill: "currentColor", opacity: "0.6" }),
3166
+ /* @__PURE__ */ e(
3182
3167
  "line",
3183
3168
  {
3184
3169
  x1: "35",
@@ -3191,8 +3176,8 @@ function In({ className: e }) {
3191
3176
  strokeLinecap: "round"
3192
3177
  }
3193
3178
  ),
3194
- /* @__PURE__ */ t("circle", { cx: "31", cy: "44", r: "1", fill: "currentColor", opacity: "0.6" }),
3195
- /* @__PURE__ */ t(
3179
+ /* @__PURE__ */ e("circle", { cx: "31", cy: "44", r: "1", fill: "currentColor", opacity: "0.6" }),
3180
+ /* @__PURE__ */ e(
3196
3181
  "line",
3197
3182
  {
3198
3183
  x1: "35",
@@ -3205,7 +3190,7 @@ function In({ className: e }) {
3205
3190
  strokeLinecap: "round"
3206
3191
  }
3207
3192
  ),
3208
- /* @__PURE__ */ t(
3193
+ /* @__PURE__ */ e(
3209
3194
  "rect",
3210
3195
  {
3211
3196
  x: "30",
@@ -3217,7 +3202,7 @@ function In({ className: e }) {
3217
3202
  opacity: "0.55"
3218
3203
  }
3219
3204
  ),
3220
- /* @__PURE__ */ t(
3205
+ /* @__PURE__ */ e(
3221
3206
  "rect",
3222
3207
  {
3223
3208
  x: "38",
@@ -3229,7 +3214,7 @@ function In({ className: e }) {
3229
3214
  opacity: "0.7"
3230
3215
  }
3231
3216
  ),
3232
- /* @__PURE__ */ t(
3217
+ /* @__PURE__ */ e(
3233
3218
  "rect",
3234
3219
  {
3235
3220
  x: "46",
@@ -3241,7 +3226,7 @@ function In({ className: e }) {
3241
3226
  opacity: "0.85"
3242
3227
  }
3243
3228
  ),
3244
- /* @__PURE__ */ t(
3229
+ /* @__PURE__ */ e(
3245
3230
  "rect",
3246
3231
  {
3247
3232
  x: "54",
@@ -3253,7 +3238,7 @@ function In({ className: e }) {
3253
3238
  opacity: "0.6"
3254
3239
  }
3255
3240
  ),
3256
- /* @__PURE__ */ t(
3241
+ /* @__PURE__ */ e(
3257
3242
  "rect",
3258
3243
  {
3259
3244
  x: "62",
@@ -3265,7 +3250,7 @@ function In({ className: e }) {
3265
3250
  opacity: "0.75"
3266
3251
  }
3267
3252
  ),
3268
- /* @__PURE__ */ t(
3253
+ /* @__PURE__ */ e(
3269
3254
  "circle",
3270
3255
  {
3271
3256
  cx: "86",
@@ -3276,7 +3261,7 @@ function In({ className: e }) {
3276
3261
  strokeWidth: "1.25"
3277
3262
  }
3278
3263
  ),
3279
- /* @__PURE__ */ t(
3264
+ /* @__PURE__ */ e(
3280
3265
  "line",
3281
3266
  {
3282
3267
  x1: "93.5",
@@ -3292,8 +3277,8 @@ function In({ className: e }) {
3292
3277
  }
3293
3278
  );
3294
3279
  }
3295
- function Tn({
3296
- briefing: e,
3280
+ function Ln({
3281
+ briefing: t,
3297
3282
  isOpening: a,
3298
3283
  isBusy: o,
3299
3284
  onOpen: n,
@@ -3301,11 +3286,11 @@ function Tn({
3301
3286
  onTogglePause: r,
3302
3287
  onDelete: d
3303
3288
  }) {
3304
- const c = e.status === "PAUSED", l = e.hasActiveRun, u = kn(e), h = Nn(e.lastRunAt), m = e.lastRunStatus, p = le(e), f = m === "SUCCESS" ? Re.success.dot : m === "FAILED" ? Re.danger.dot : m ? Re.warning.dot : Re.neutral.dot;
3289
+ const c = t.status === "PAUSED", l = t.hasActiveRun, u = Dn(t), h = Sn(t.lastRunAt), m = t.lastRunStatus, p = ie(t), f = m === "SUCCESS" ? ze.success.dot : m === "FAILED" ? ze.danger.dot : m ? ze.warning.dot : ze.neutral.dot;
3305
3290
  return /* @__PURE__ */ s(
3306
3291
  "div",
3307
3292
  {
3308
- className: Z(
3293
+ className: J(
3309
3294
  "group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
3310
3295
  c && "opacity-70"
3311
3296
  ),
@@ -3322,18 +3307,18 @@ function Tn({
3322
3307
  className: "cursor-pointer pr-8",
3323
3308
  children: [
3324
3309
  /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
3325
- /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.name }),
3326
- c ? /* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
3310
+ /* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
3311
+ c ? /* @__PURE__ */ e("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
3327
3312
  ] }),
3328
3313
  /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
3329
- /* @__PURE__ */ t("span", { children: p.typeLabel }),
3330
- /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
3331
- /* @__PURE__ */ t("span", { children: Dn(e) }),
3332
- /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
3333
- /* @__PURE__ */ t(Qa, { className: "h-3 w-3" }),
3334
- /* @__PURE__ */ t("span", { className: "truncate", children: Sn(e) }),
3335
- e.lastRunAt ? /* @__PURE__ */ s(z, { children: [
3336
- /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
3314
+ /* @__PURE__ */ e("span", { children: p.typeLabel }),
3315
+ /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
3316
+ /* @__PURE__ */ e("span", { children: An(t) }),
3317
+ /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
3318
+ /* @__PURE__ */ e(Ya, { className: "h-3 w-3" }),
3319
+ /* @__PURE__ */ e("span", { className: "truncate", children: kn(t) }),
3320
+ t.lastRunAt ? /* @__PURE__ */ s(R, { children: [
3321
+ /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
3337
3322
  /* @__PURE__ */ s("span", { children: [
3338
3323
  "Last run ",
3339
3324
  h
@@ -3341,74 +3326,74 @@ function Tn({
3341
3326
  ] }) : null
3342
3327
  ] }),
3343
3328
  u || l ? /* @__PURE__ */ s("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
3344
- l ? /* @__PURE__ */ t(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ t(
3329
+ l ? /* @__PURE__ */ e(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ e(
3345
3330
  "span",
3346
3331
  {
3347
- className: Z(
3332
+ className: J(
3348
3333
  "inline-block h-1.5 w-1.5 shrink-0 rounded-full",
3349
3334
  f
3350
3335
  )
3351
3336
  }
3352
3337
  ),
3353
- /* @__PURE__ */ t("span", { className: "truncate", children: l ? Zt(e) : u })
3338
+ /* @__PURE__ */ e("span", { className: "truncate", children: l ? aa(t) : u })
3354
3339
  ] }) : null
3355
3340
  ]
3356
3341
  }
3357
3342
  ),
3358
- /* @__PURE__ */ t("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ s(Ve, { children: [
3359
- /* @__PURE__ */ t(Be, { asChild: !0, children: /* @__PURE__ */ t(
3343
+ /* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ s(Ve, { children: [
3344
+ /* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(
3360
3345
  "button",
3361
3346
  {
3362
3347
  type: "button",
3363
3348
  onClick: (g) => g.stopPropagation(),
3364
3349
  className: "inline-flex h-6 w-6 items-center justify-center rounded-control text-muted-foreground/70 opacity-60 hover:bg-muted hover:text-foreground/80 focus-visible:opacity-100 group-hover:opacity-100",
3365
3350
  "aria-label": `${p.noun === "report" ? "Report" : "Briefing"} actions`,
3366
- children: /* @__PURE__ */ t(Ut, { className: "h-3.5 w-3.5" })
3351
+ children: /* @__PURE__ */ e(zt, { className: "h-3.5 w-3.5" })
3367
3352
  }
3368
3353
  ) }),
3369
3354
  /* @__PURE__ */ s(Pe, { align: "end", className: "w-44", children: [
3370
- /* @__PURE__ */ s(G, { onClick: n, children: [
3371
- /* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5" }),
3355
+ /* @__PURE__ */ s(K, { onClick: n, children: [
3356
+ /* @__PURE__ */ e(Wt, { className: "h-3.5 w-3.5" }),
3372
3357
  "Edit ",
3373
3358
  p.noun
3374
3359
  ] }),
3375
3360
  /* @__PURE__ */ s(
3376
- G,
3361
+ K,
3377
3362
  {
3378
3363
  onClick: (g) => {
3379
3364
  g.preventDefault(), i();
3380
3365
  },
3381
3366
  children: [
3382
- /* @__PURE__ */ t(Ka, { className: "h-3.5 w-3.5" }),
3367
+ /* @__PURE__ */ e(Ja, { className: "h-3.5 w-3.5" }),
3383
3368
  "Run now"
3384
3369
  ]
3385
3370
  }
3386
3371
  ),
3387
- e.scheduleExpr ? /* @__PURE__ */ t(
3388
- G,
3372
+ t.scheduleExpr ? /* @__PURE__ */ e(
3373
+ K,
3389
3374
  {
3390
3375
  onClick: (g) => {
3391
3376
  g.preventDefault(), r();
3392
3377
  },
3393
- children: c ? /* @__PURE__ */ s(z, { children: [
3394
- /* @__PURE__ */ t(Ga, { className: "h-3.5 w-3.5" }),
3378
+ children: c ? /* @__PURE__ */ s(R, { children: [
3379
+ /* @__PURE__ */ e(Za, { className: "h-3.5 w-3.5" }),
3395
3380
  "Resume"
3396
- ] }) : /* @__PURE__ */ s(z, { children: [
3397
- /* @__PURE__ */ t(Xa, { className: "h-3.5 w-3.5" }),
3381
+ ] }) : /* @__PURE__ */ s(R, { children: [
3382
+ /* @__PURE__ */ e(er, { className: "h-3.5 w-3.5" }),
3398
3383
  "Pause"
3399
3384
  ] })
3400
3385
  }
3401
3386
  ) : null,
3402
- /* @__PURE__ */ t(We, {}),
3387
+ /* @__PURE__ */ e(We, {}),
3403
3388
  /* @__PURE__ */ s(
3404
- G,
3389
+ K,
3405
3390
  {
3406
3391
  onClick: (g) => {
3407
3392
  g.preventDefault(), d();
3408
3393
  },
3409
3394
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
3410
3395
  children: [
3411
- /* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
3396
+ /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5" }),
3412
3397
  "Delete ",
3413
3398
  p.noun
3414
3399
  ]
@@ -3420,24 +3405,24 @@ function Tn({
3420
3405
  }
3421
3406
  );
3422
3407
  }
3423
- function Ln(e) {
3424
- return (e == null ? void 0 : e.trim()) || "This dashboard";
3408
+ function Vn(t) {
3409
+ return (t == null ? void 0 : t.trim()) || "This dashboard";
3425
3410
  }
3426
- function Vn(e) {
3427
- return e === "This dashboard" ? "Watch this dashboard" : `Watch ${e}`;
3411
+ function Bn(t) {
3412
+ return t === "This dashboard" ? "Watch this dashboard" : `Watch ${t}`;
3428
3413
  }
3429
- function Bn(e, a, o) {
3430
- return a !== "dashboard" ? e : e.filter(
3414
+ function Pn(t, a, o) {
3415
+ return a !== "dashboard" ? t : t.filter(
3431
3416
  (n) => n.source.type === "dashboard" && n.source.dashboardId === o
3432
3417
  );
3433
3418
  }
3434
- async function Pn(e) {
3419
+ async function Mn(t) {
3435
3420
  const o = [];
3436
3421
  let n = 1, i = 0, r = Number.POSITIVE_INFINITY;
3437
3422
  for (; i < r; ) {
3438
- const d = await e.apiClient.listBriefings(
3439
- e.apiServiceUrl,
3440
- e.token,
3423
+ const d = await t.apiClient.listBriefings(
3424
+ t.apiServiceUrl,
3425
+ t.token,
3441
3426
  { scope: "organization", page: n, pageSize: 100 }
3442
3427
  );
3443
3428
  if (o.push(...d.briefings), i += d.briefings.length, r = d.total, d.briefings.length === 0 || i >= r) break;
@@ -3445,19 +3430,19 @@ async function Pn(e) {
3445
3430
  }
3446
3431
  return o;
3447
3432
  }
3448
- const Mn = {
3449
- listBriefings: sr,
3450
- getBriefing: nr,
3451
- pauseBriefing: rr,
3452
- resumeBriefing: ar,
3453
- deleteBriefing: tr,
3454
- runBriefingNow: er
3433
+ const Un = {
3434
+ listBriefings: dr,
3435
+ getBriefing: lr,
3436
+ pauseBriefing: ir,
3437
+ resumeBriefing: or,
3438
+ deleteBriefing: sr,
3439
+ runBriefingNow: nr
3455
3440
  };
3456
- function Ss(e) {
3457
- return /* @__PURE__ */ t(Ya, { authToken: e.token ? { accessToken: e.token } : void 0, children: /* @__PURE__ */ t(Ja, { children: /* @__PURE__ */ t(Un, { ...e }) }) });
3441
+ function Ns(t) {
3442
+ return /* @__PURE__ */ e(tr, { authToken: t.token ? { accessToken: t.token } : void 0, children: /* @__PURE__ */ e(ar, { children: /* @__PURE__ */ e(On, { ...t }) }) });
3458
3443
  }
3459
- function Un({
3460
- dashboardId: e,
3444
+ function On({
3445
+ dashboardId: t,
3461
3446
  dashboardTitle: a,
3462
3447
  apiServiceUrl: o,
3463
3448
  token: n,
@@ -3471,64 +3456,64 @@ function Un({
3471
3456
  openRun: m,
3472
3457
  client: p
3473
3458
  }) {
3474
- const { authToken: f, tokenProps: g } = it(), v = Za(), k = !h || v.canCreate && (h === "scheduled_report" || v.analyticalBriefingsEnabled), [V, U] = S(!1), M = c ?? V, A = (y) => {
3475
- c === void 0 && U(y), l == null || l(y);
3476
- }, [O, b] = S(
3459
+ const { authToken: f, tokenProps: g } = it(), x = rr(), N = !h || x.canCreate && (h === "scheduled_report" || x.analyticalBriefingsEnabled), [S, M] = D(!1), U = c ?? S, F = (y) => {
3460
+ c === void 0 && M(y), l == null || l(y);
3461
+ }, [O, b] = D(
3477
3462
  h ? "author" : "list"
3478
- ), [F, C] = S(
3463
+ ), [I, C] = D(
3479
3464
  h ?? "analytical_briefing"
3480
- ), [D, N] = S("dashboard"), [j, T] = S(
3465
+ ), [A, k] = D("dashboard"), [j, L] = D(
3481
3466
  []
3482
- ), [R, X] = S(null), L = h && !k && !R ? "list" : O, [ae, Y] = S(!1), [H, he] = S(null), [ge, Q] = S(null), [_, oe] = S(
3467
+ ), [z, G] = D(null), V = h && !N && !z ? "list" : O, [te, X] = D(!1), [H, he] = D(null), [ge, Q] = D(null), [_, se] = D(
3483
3468
  null
3484
- ), [me, pe] = S(null), Ce = nt(null), Me = nt(M);
3485
- xe(() => {
3486
- const y = M && !Me.current;
3487
- Me.current = M, !(!y || !h) && (X(null), N("dashboard"), C(h), b("author"), pe(null));
3488
- }, [M, h]);
3489
- const Ye = yt(), $ = o ?? (g == null ? void 0 : g.apiServiceUrl), W = n ?? (f == null ? void 0 : f.accessToken), ne = te(() => ({ ...Mn, ...p }), [p]), [we, Je] = S(null);
3490
- xe(() => {
3469
+ ), [me, pe] = D(null), Ce = nt(null), Me = nt(U);
3470
+ ve(() => {
3471
+ const y = U && !Me.current;
3472
+ Me.current = U, !(!y || !h) && (G(null), k("dashboard"), C(h), b("author"), pe(null));
3473
+ }, [U, h]);
3474
+ const Ye = yt(), $ = o ?? (g == null ? void 0 : g.apiServiceUrl), W = n ?? (f == null ? void 0 : f.accessToken), re = ee(() => ({ ...Un, ...p }), [p]), [we, Je] = D(null);
3475
+ ve(() => {
3491
3476
  if (!m || !$ || !W) return;
3492
3477
  let y = !0;
3493
- return ne.getBriefing($, W, m.briefingId).then(({ briefing: P }) => {
3494
- y && (X(P), Je(m), b("author"));
3478
+ return re.getBriefing($, W, m.briefingId).then(({ briefing: P }) => {
3479
+ y && (G(P), Je(m), b("author"));
3495
3480
  }, (P) => {
3496
3481
  y && E.error(P instanceof Error ? P.message : "Could not open the run.");
3497
3482
  }), () => {
3498
3483
  y = !1;
3499
3484
  };
3500
- }, [m, $, W, ne]);
3501
- const be = Ln(a), Ue = te(() => {
3502
- const y = Bn(
3485
+ }, [m, $, W, re]);
3486
+ const be = Vn(a), Ue = ee(() => {
3487
+ const y = Pn(
3503
3488
  j,
3504
- D,
3505
- e
3489
+ A,
3490
+ t
3506
3491
  );
3507
3492
  if (!h)
3508
3493
  return y;
3509
3494
  const P = h === "scheduled_report" ? "report" : "briefing";
3510
3495
  return y.filter(
3511
- (Oe) => le(Oe).noun === P
3496
+ (Oe) => ie(Oe).noun === P
3512
3497
  );
3513
- }, [e, j, D, h]), Ze = te(() => D === "dashboard" ? {
3514
- source: { type: "dashboard", dashboardId: e },
3498
+ }, [t, j, A, h]), Ze = ee(() => A === "dashboard" ? {
3499
+ source: { type: "dashboard", dashboardId: t },
3515
3500
  label: be,
3516
- detail: Vn(be)
3501
+ detail: Bn(be)
3517
3502
  } : {
3518
3503
  source: { type: "project" },
3519
3504
  label: "This project",
3520
3505
  detail: "Use any data in this project."
3521
- }, [e, be, D]), Ne = !!($ && W), Se = Pr({
3522
- canCreate: v.canCreate,
3523
- analyticalBriefingsEnabled: v.analyticalBriefingsEnabled,
3524
- scheduledReportAvailable: D === "dashboard"
3525
- }), se = J(async () => {
3506
+ }, [t, be, A]), Ne = !!($ && W), Se = Ur({
3507
+ canCreate: x.canCreate,
3508
+ analyticalBriefingsEnabled: x.analyticalBriefingsEnabled,
3509
+ scheduledReportAvailable: A === "dashboard"
3510
+ }), ne = Y(async () => {
3526
3511
  if (!(!$ || !W)) {
3527
- Y(!0), pe(null);
3512
+ X(!0), pe(null);
3528
3513
  try {
3529
- T(
3530
- await Pn({
3531
- apiClient: ne,
3514
+ L(
3515
+ await Mn({
3516
+ apiClient: re,
3532
3517
  apiServiceUrl: $,
3533
3518
  token: W
3534
3519
  })
@@ -3538,27 +3523,27 @@ function Un({
3538
3523
  y instanceof Error ? y.message : "Could not load briefings."
3539
3524
  );
3540
3525
  } finally {
3541
- Y(!1);
3526
+ X(!1);
3542
3527
  }
3543
3528
  }
3544
- }, [ne, $, W]);
3545
- xe(() => {
3546
- !M || L !== "list" || !Ne || se();
3547
- }, [Ne, L, se, M]);
3529
+ }, [re, $, W]);
3530
+ ve(() => {
3531
+ !U || V !== "list" || !Ne || ne();
3532
+ }, [Ne, V, ne, U]);
3548
3533
  const ke = () => {
3549
- X(null), N("dashboard"), b("list"), A(!0);
3550
- }, x = (y) => {
3551
- X(null), C(y), b("author");
3534
+ G(null), k("dashboard"), b("list"), F(!0);
3535
+ }, v = (y) => {
3536
+ G(null), C(y), b("author");
3552
3537
  }, B = async (y) => {
3553
3538
  if (!(!$ || !W)) {
3554
3539
  he(y), pe(null);
3555
3540
  try {
3556
- const P = await ne.getBriefing(
3541
+ const P = await re.getBriefing(
3557
3542
  $,
3558
3543
  W,
3559
3544
  y
3560
3545
  );
3561
- X(P.briefing), b("author");
3546
+ G(P.briefing), b("author");
3562
3547
  } catch (P) {
3563
3548
  pe(
3564
3549
  P instanceof Error ? P.message : "Could not open briefing."
@@ -3571,13 +3556,13 @@ function Un({
3571
3556
  if (!(!$ || !W)) {
3572
3557
  Q(y.id);
3573
3558
  try {
3574
- const P = await ne.runBriefingNow(
3559
+ const P = await re.runBriefingNow(
3575
3560
  $,
3576
3561
  W,
3577
3562
  y.id,
3578
- { requestId: On() }
3563
+ { requestId: Rn() }
3579
3564
  );
3580
- Ye.track({ kind: "briefing", id: P.run.id, title: y.name, briefingId: y.id }), se();
3565
+ Ye.track({ kind: "briefing", id: P.run.id, title: y.name, briefingId: y.id }), ne();
3581
3566
  } catch (P) {
3582
3567
  E.error(
3583
3568
  P instanceof Error ? P.message : "Could not start the run."
@@ -3586,42 +3571,42 @@ function Un({
3586
3571
  Q(null);
3587
3572
  }
3588
3573
  }
3589
- }, ie = async (y) => {
3574
+ }, oe = async (y) => {
3590
3575
  if (!$ || !W) return;
3591
- const { noun: P } = le(y), Oe = P === "report" ? "Report" : "Briefing";
3576
+ const { noun: P } = ie(y), Oe = P === "report" ? "Report" : "Briefing";
3592
3577
  Q(y.id);
3593
3578
  try {
3594
- const ze = y.status === "PAUSED" ? await ne.resumeBriefing(
3579
+ const Re = y.status === "PAUSED" ? await re.resumeBriefing(
3595
3580
  $,
3596
3581
  W,
3597
3582
  y.id
3598
- ) : await ne.pauseBriefing(
3583
+ ) : await re.pauseBriefing(
3599
3584
  $,
3600
3585
  W,
3601
3586
  y.id
3602
3587
  );
3603
3588
  E.success(
3604
- ze.briefing.status === "PAUSED" ? `${Oe} paused` : `${Oe} resumed`
3605
- ), se();
3606
- } catch (ze) {
3589
+ Re.briefing.status === "PAUSED" ? `${Oe} paused` : `${Oe} resumed`
3590
+ ), ne();
3591
+ } catch (Re) {
3607
3592
  E.error(
3608
- ze instanceof Error ? ze.message : `Could not update the ${P} status.`
3593
+ Re instanceof Error ? Re.message : `Could not update the ${P} status.`
3609
3594
  );
3610
3595
  } finally {
3611
3596
  Q(null);
3612
3597
  }
3613
- }, ue = async () => {
3598
+ }, ce = async () => {
3614
3599
  if (!_ || !$ || !W) return;
3615
3600
  const y = _;
3616
3601
  Q(y.id);
3617
3602
  try {
3618
- await ne.deleteBriefing(
3603
+ await re.deleteBriefing(
3619
3604
  $,
3620
3605
  W,
3621
3606
  y.id
3622
3607
  );
3623
- const { noun: P } = le(y);
3624
- E.success(`${P === "report" ? "Report" : "Briefing"} deleted`), oe(null), se();
3608
+ const { noun: P } = ie(y);
3609
+ E.success(`${P === "report" ? "Report" : "Briefing"} deleted`), se(null), ne();
3625
3610
  } catch (P) {
3626
3611
  E.error(
3627
3612
  P instanceof Error ? P.message : "Could not delete the briefing."
@@ -3629,19 +3614,19 @@ function Un({
3629
3614
  } finally {
3630
3615
  Q(null);
3631
3616
  }
3632
- }, ea = Ue.length;
3633
- return v.surfaceVisible ? /* @__PURE__ */ s(or, { open: M, onOpenChange: A, children: [
3634
- u ? null : /* @__PURE__ */ t(
3635
- yn,
3617
+ }, ra = Ue.length;
3618
+ return x.surfaceVisible ? /* @__PURE__ */ s(cr, { open: U, onOpenChange: F, children: [
3619
+ u ? null : /* @__PURE__ */ e(
3620
+ Cn,
3636
3621
  {
3637
3622
  disabled: i || !Ne,
3638
- briefingCount: ea,
3623
+ briefingCount: ra,
3639
3624
  className: r,
3640
3625
  onClick: ke
3641
3626
  }
3642
3627
  ),
3643
3628
  /* @__PURE__ */ s(
3644
- ir,
3629
+ ur,
3645
3630
  {
3646
3631
  ref: Ce,
3647
3632
  side: "right",
@@ -3652,9 +3637,9 @@ function Un({
3652
3637
  y.preventDefault(), (P = Ce.current) == null || P.focus({ preventScroll: !0 });
3653
3638
  },
3654
3639
  children: [
3655
- /* @__PURE__ */ s(lr, { className: "sr-only", children: [
3656
- /* @__PURE__ */ t(dr, { children: "Reports & briefings" }),
3657
- /* @__PURE__ */ t(cr, { children: "Manage reports and briefings for this dashboard." })
3640
+ /* @__PURE__ */ s(hr, { className: "sr-only", children: [
3641
+ /* @__PURE__ */ e(mr, { children: "Reports & briefings" }),
3642
+ /* @__PURE__ */ e(pr, { children: "Manage reports and briefings for this dashboard." })
3658
3643
  ] }),
3659
3644
  h ? /* @__PURE__ */ s("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
3660
3645
  /* @__PURE__ */ s(
@@ -3664,33 +3649,33 @@ function Un({
3664
3649
  role: "tablist",
3665
3650
  "aria-label": h === "scheduled_report" ? "Email report workflow" : "Analytical briefing workflow",
3666
3651
  children: [
3667
- /* @__PURE__ */ t(
3652
+ /* @__PURE__ */ e(
3668
3653
  "button",
3669
3654
  {
3670
3655
  type: "button",
3671
3656
  role: "tab",
3672
- "aria-selected": L === "author",
3673
- disabled: !k,
3674
- className: Z(
3657
+ "aria-selected": V === "author",
3658
+ disabled: !N,
3659
+ className: J(
3675
3660
  "-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
3676
- L === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
3677
- !k && "cursor-not-allowed opacity-50"
3661
+ V === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
3662
+ !N && "cursor-not-allowed opacity-50"
3678
3663
  ),
3679
3664
  onClick: () => {
3680
- k && (X(null), C(h), N("dashboard"), b("author"));
3665
+ N && (G(null), C(h), k("dashboard"), b("author"));
3681
3666
  },
3682
- children: R ? `Edit ${le(R).noun}` : h === "scheduled_report" ? "Schedule report" : "Create briefing"
3667
+ children: z ? `Edit ${ie(z).noun}` : h === "scheduled_report" ? "Schedule report" : "Create briefing"
3683
3668
  }
3684
3669
  ),
3685
- /* @__PURE__ */ t(
3670
+ /* @__PURE__ */ e(
3686
3671
  "button",
3687
3672
  {
3688
3673
  type: "button",
3689
3674
  role: "tab",
3690
- "aria-selected": L === "list",
3691
- className: Z(
3675
+ "aria-selected": V === "list",
3676
+ className: J(
3692
3677
  "-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
3693
- L === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
3678
+ V === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
3694
3679
  ),
3695
3680
  onClick: () => b("list"),
3696
3681
  children: h === "scheduled_report" ? "Manage reports" : "Manage briefings"
@@ -3699,31 +3684,31 @@ function Un({
3699
3684
  ]
3700
3685
  }
3701
3686
  ),
3702
- /* @__PURE__ */ t(
3687
+ /* @__PURE__ */ e(
3703
3688
  "button",
3704
3689
  {
3705
3690
  type: "button",
3706
- onClick: () => A(!1),
3691
+ onClick: () => F(!1),
3707
3692
  className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
3708
3693
  "aria-label": h === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
3709
- children: /* @__PURE__ */ t(Xe, { className: "h-3.5 w-3.5" })
3694
+ children: /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" })
3710
3695
  }
3711
3696
  )
3712
3697
  ] }) : null,
3713
- L === "list" ? /* @__PURE__ */ t(
3714
- Fn,
3698
+ V === "list" ? /* @__PURE__ */ e(
3699
+ En,
3715
3700
  {
3716
3701
  briefings: Ue,
3717
3702
  dashboardLabel: be,
3718
- sourceView: D,
3703
+ sourceView: A,
3719
3704
  error: me,
3720
- loading: ae,
3721
- onSourceViewChange: N,
3722
- onClose: () => A(!1),
3705
+ loading: te,
3706
+ onSourceViewChange: k,
3707
+ onClose: () => F(!1),
3723
3708
  onEdit: (y) => {
3724
3709
  B(y);
3725
3710
  },
3726
- onNew: x,
3711
+ onNew: v,
3727
3712
  canCreate: !h && Se.length > 0,
3728
3713
  canCreateScheduledReport: Se.includes(
3729
3714
  "scheduled_report"
@@ -3735,78 +3720,78 @@ function Un({
3735
3720
  q(y);
3736
3721
  },
3737
3722
  onTogglePause: (y) => {
3738
- ie(y);
3723
+ oe(y);
3739
3724
  },
3740
- onDelete: (y) => oe(y),
3725
+ onDelete: (y) => se(y),
3741
3726
  selectingId: H,
3742
3727
  busyId: ge,
3743
3728
  manageBriefingsHref: d,
3744
3729
  contentKind: h === "scheduled_report" ? "reports" : h === "analytical_briefing" ? "briefings" : void 0,
3745
3730
  hideHeader: !!h
3746
3731
  }
3747
- ) : /* @__PURE__ */ t(
3748
- ur,
3732
+ ) : /* @__PURE__ */ e(
3733
+ fr,
3749
3734
  {
3750
3735
  apiServiceUrl: $,
3751
3736
  token: W,
3752
- briefing: R,
3753
- initialRunId: we && (R == null ? void 0 : R.id) === we.briefingId ? we.runId : void 0,
3754
- intent: F,
3755
- sourceContext: R ? void 0 : Ze,
3756
- title: R ? `Edit ${le(R).noun}` : F === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
3737
+ briefing: z,
3738
+ initialRunId: we && (z == null ? void 0 : z.id) === we.briefingId ? we.runId : void 0,
3739
+ intent: I,
3740
+ sourceContext: z ? void 0 : Ze,
3741
+ title: z ? `Edit ${ie(z).noun}` : I === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
3757
3742
  hideHeader: !!h,
3758
3743
  className: "h-full min-h-0 max-w-none border-0 shadow-none",
3759
3744
  onBack: h ? void 0 : () => b("list"),
3760
- onCancel: () => A(!1),
3745
+ onCancel: () => F(!1),
3761
3746
  onDeleted: () => {
3762
- const y = R ? le(R).noun : "briefing";
3763
- E.success(`${y === "report" ? "Report" : "Briefing"} deleted`), X(null), b("list"), se();
3747
+ const y = z ? ie(z).noun : "briefing";
3748
+ E.success(`${y === "report" ? "Report" : "Briefing"} deleted`), G(null), b("list"), ne();
3764
3749
  },
3765
3750
  onRunStarted: () => {
3766
3751
  },
3767
3752
  onSaved: (y) => {
3768
- X(y), se();
3753
+ G(y), ne();
3769
3754
  },
3770
3755
  onMinimizeRun: () => {
3771
- A(!1);
3756
+ F(!1);
3772
3757
  }
3773
3758
  }
3774
3759
  )
3775
3760
  ]
3776
3761
  }
3777
3762
  ),
3778
- /* @__PURE__ */ t(
3763
+ /* @__PURE__ */ e(
3779
3764
  dt,
3780
3765
  {
3781
3766
  open: !!_,
3782
3767
  onOpenChange: (y) => {
3783
- y || oe(null);
3768
+ y || se(null);
3784
3769
  },
3785
3770
  children: /* @__PURE__ */ s(ct, { children: [
3786
3771
  /* @__PURE__ */ s(ut, { children: [
3787
3772
  /* @__PURE__ */ s(ht, { children: [
3788
3773
  "Delete",
3789
3774
  " ",
3790
- _ ? le(_).noun : "briefing",
3775
+ _ ? ie(_).noun : "briefing",
3791
3776
  "?"
3792
3777
  ] }),
3793
3778
  /* @__PURE__ */ s(mt, { children: [
3794
3779
  "This permanently deletes ",
3795
- /* @__PURE__ */ t("strong", { children: _ == null ? void 0 : _.name }),
3780
+ /* @__PURE__ */ e("strong", { children: _ == null ? void 0 : _.name }),
3796
3781
  ". Recipients will stop receiving it."
3797
3782
  ] })
3798
3783
  ] }),
3799
3784
  /* @__PURE__ */ s(pt, { children: [
3800
- /* @__PURE__ */ t(ft, { children: "Cancel" }),
3785
+ /* @__PURE__ */ e(ft, { children: "Cancel" }),
3801
3786
  /* @__PURE__ */ s(
3802
- Mt,
3787
+ Rt,
3803
3788
  {
3804
3789
  className: "bg-destructive/90 hover:bg-destructive",
3805
- onClick: ue,
3790
+ onClick: ce,
3806
3791
  children: [
3807
3792
  "Delete",
3808
3793
  " ",
3809
- _ ? le(_).noun : "briefing"
3794
+ _ ? ie(_).noun : "briefing"
3810
3795
  ]
3811
3796
  }
3812
3797
  )
@@ -3816,27 +3801,27 @@ function Un({
3816
3801
  )
3817
3802
  ] }) : null;
3818
3803
  }
3819
- function On() {
3804
+ function Rn() {
3820
3805
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
3821
3806
  }
3822
3807
  export {
3823
- ms as A,
3824
- gs as D,
3825
- fs as S,
3826
- xs as T,
3827
- ys as U,
3828
- cs as V,
3829
- yn as W,
3830
- hs as a,
3831
- ps as b,
3832
- bs as c,
3808
+ hs as A,
3809
+ fs as D,
3810
+ ps as S,
3811
+ bs as T,
3812
+ xs as U,
3813
+ ds as V,
3814
+ Cn as W,
3815
+ us as a,
3816
+ ms as b,
3817
+ gs as c,
3833
3818
  vs as d,
3834
- ws as e,
3835
- ln as f,
3836
- cn as g,
3837
- fn as h,
3838
- Cs as i,
3839
- Ns as j,
3840
- Ss as k,
3841
- us as u
3819
+ Cs as e,
3820
+ dn as f,
3821
+ un as g,
3822
+ gn as h,
3823
+ ys as i,
3824
+ ws as j,
3825
+ Ns as k,
3826
+ cs as u
3842
3827
  };