react-semaphor 0.1.563 → 0.1.564

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