react-semaphor 0.1.501 → 0.1.503

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/brand-studio/index.cjs +1 -1
  2. package/dist/brand-studio/index.js +1 -1
  3. package/dist/chunks/dashboard-briefing-launcher-CHMQi0pU.cjs +21 -0
  4. package/dist/chunks/{dashboard-briefing-launcher-DfC-k5P3.js → dashboard-briefing-launcher-COqlnnQ2.js} +1201 -1160
  5. package/dist/chunks/{dashboard-controls-CUQUph1I.js → dashboard-controls-Bp6XzVvx.js} +665 -654
  6. package/dist/chunks/{dashboard-controls-DQt2D99m.cjs → dashboard-controls-D8z05ZfX.cjs} +10 -10
  7. package/dist/chunks/{dashboard-json-H9GxGLRA.cjs → dashboard-json-DcvkxkL3.cjs} +1 -1
  8. package/dist/chunks/{dashboard-json-BHZYDA2F.js → dashboard-json-Dw7kHCe5.js} +2 -2
  9. package/dist/chunks/{edit-dashboard-visual-hYQMdpjN.js → edit-dashboard-visual-D5vvLzkS.js} +3 -3
  10. package/dist/chunks/{edit-dashboard-visual-B8p6XTig.cjs → edit-dashboard-visual-olfXEK5D.cjs} +1 -1
  11. package/dist/chunks/{editor-action-buttons-DiRpbCIR.cjs → editor-action-buttons-BsWibSiV.cjs} +1 -1
  12. package/dist/chunks/{editor-action-buttons-DjVEnfLQ.js → editor-action-buttons-DYiJr5u3.js} +2 -2
  13. package/dist/chunks/index-C3rUIii0.cjs +1417 -0
  14. package/dist/chunks/{index-D-UGbMFA.js → index-ZKSLtc9_.js} +30214 -29909
  15. package/dist/chunks/{report-preferences-dialog-B4pIkowU.js → report-preferences-dialog-BXaILrOK.js} +2 -2
  16. package/dist/chunks/{report-preferences-dialog-DwBFTNNN.cjs → report-preferences-dialog-BZvi_3DV.cjs} +1 -1
  17. package/dist/chunks/{switch-B4wVqV4L.js → switch-DWM8d-UR.js} +6 -0
  18. package/dist/chunks/{switch-DVjKkt22.cjs → switch-Dej7zCoP.cjs} +1 -1
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/data-app-builder/index.cjs +1 -1
  22. package/dist/data-app-builder/index.js +2 -2
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +97 -96
  25. package/dist/surfboard/index.cjs +1 -1
  26. package/dist/surfboard/index.js +2 -2
  27. package/dist/types/dashboard.d.ts +11 -0
  28. package/dist/types/main.d.ts +21 -1
  29. package/dist/types/surfboard.d.ts +11 -0
  30. package/dist/types/types.d.ts +11 -0
  31. package/package.json +1 -1
  32. package/dist/chunks/dashboard-briefing-launcher-D6z_n26J.cjs +0 -21
  33. package/dist/chunks/index-se8e2QhO.cjs +0 -1417
@@ -1,17 +1,18 @@
1
- import { jsx as e, jsxs as r, Fragment as j } from "react/jsx-runtime";
2
- import Ct, { useState as I, useEffect as Y, useMemo as ee, useContext as Ht, useRef as he, useCallback as G } from "react";
3
- import { B as T, O as Se, Z as Je, L as ae, M as wt, d as Nt, a4 as O, c as K, K as Gt, D as me, u as P, z as be, aA as St, az as et, E as Dt, P as Ue, a as Pe, b as Me, aL as qt, aM as Kt, S as kt, aN as Qt, aO as Yt, aP as Xt, aQ as Zt, aJ as Jt } from "./switch-B4wVqV4L.js";
4
- import { ck as tt, aF as De, aG as ke, aI as Ee, b9 as Et, bX as er, cl as tr, cm as rr, aX as ge, c8 as At, bk as Oe, r as ar, n as nr, cn as sr, aN as rt, aQ as at, aR as nt, aS as st, aT as ot, aU as it, aV as lt, aW as It, bi as dt, co as or, cp as ir, cq as Qe, c9 as $e, ca as je, cr as Ft, cb as We, bV as q, a$ as lr, bA as _e, cs as dr, bU as cr, aH as ct, aJ as ut, ct as ur, aE as hr, b8 as mr, bv as Lt, cu as pr, bY as fr, u as gr, aK as br, b1 as xr, ay as He, N as ue, av as ht, ar as Bt, as as ze, O as Tt, aq as vr, ax as yr, R as Vt, cv as Cr, cw as wr, at as bt, Q as Nr, cx as Sr, cy as Dr, cz as kr, cA as Er, cB as Ar, cC as Ir, cD as Rt, cE as Fr, b2 as Lr, cF as Br, cc as Ut, cG as Tr, cH as Vr, cI as Ve, cJ as Rr, cK as Ur, cL as Pr, am as Mr, ao as Or, a2 as _r, a1 as zr, a0 as $r, $ as jr, Y as Wr, W as Hr, cM as Gr, cN as qr, cO as Kr, cP as Qr, cQ as Yr, ak as Xr, cR as Zr, cS as Jr, a8 as ea, cT as ta, cU as ra, cV as aa } from "./index-D-UGbMFA.js";
5
- import { L as mt } from "./layout-grid-CiubineE.js";
6
- import { c as Ge, X as qe, C as Pt } from "./x-CXDkqdur.js";
7
- import { u as pt, V as na, E as Ye, a as Xe, b as sa, c as oa, L as ia, d as la, e as Mt, C as Ot, F as da, f as ca } from "./editor-action-buttons-DjVEnfLQ.js";
8
- import { v as xt, s as ua } from "./constants-CTRduy1g.js";
1
+ import { jsx as t, jsxs as r, Fragment as j } from "react/jsx-runtime";
2
+ import Nt, { useState as I, useEffect as Y, useMemo as Z, useCallback as H, useLayoutEffect as xt, useRef as ce, useContext as qt } from "react";
3
+ import { B as T, O as Se, Z as et, L as ae, M as St, d as Dt, a4 as O, c as K, K as Kt, u as L, D as me, z as be, aA as kt, az as tt, E as Et, P as Pe, a as Me, b as Oe, aL as Qt, aM as Yt, S as At, aN as Xt, aO as Zt, aP as Jt, aQ as er, aJ as tr } from "./switch-DWM8d-UR.js";
4
+ import { ck as rt, aF as De, aG as ke, aI as Ee, b9 as It, bX as rr, cl as ar, cm as nr, aX as ge, c8 as Ft, bk as _e, r as sr, n as or, cn as ir, aN as at, aQ as nt, aR as st, aS as ot, aT as it, aU as lt, aV as dt, aW as Lt, bi as ct, co as lr, cp as dr, cq as Ye, c9 as je, ca as We, cr as Bt, cb as He, bV as q, a$ as cr, bA as ze, cs as ur, bU as hr, aH as ut, aJ as ht, ct as mr, aE as pr, b8 as fr, bv as Ut, cu as gr, bY as br, u as xr, aK as vr, b1 as yr, ay as Ge, N as he, av as mt, ar as Tt, as as $e, O as Vt, aq as Cr, ax as wr, R as Rt, cv as Nr, cw as Sr, at as vt, Q as Dr, cx as kr, cy as Er, cz as Ar, cA as Ir, cB as Fr, cC as Lr, cD as Pt, cE as Br, b2 as Ur, cF as Tr, cc as Mt, cG as Vr, cH as Rr, cI as Te, cJ as Pr, cK as Mr, cL as Or, am as _r, ao as zr, a2 as $r, a1 as jr, a0 as Wr, $ as Hr, Y as Gr, W as qr, cM as Kr, cN as Qr, cO as Yr, cP as Xr, cQ as Zr, ak as Jr, cR as ea, cS as ta, a8 as ra, cT as aa, cU as na, cV as sa } from "./index-ZKSLtc9_.js";
5
+ import { L as pt } from "./layout-grid-CiubineE.js";
6
+ import { c as qe, X as Ke, C as Ot } from "./x-CXDkqdur.js";
7
+ import { u as ft, V as oa, E as Xe, a as Ze, b as ia, c as la, L as da, d as ca, e as _t, C as zt, F as ua, f as ha } from "./editor-action-buttons-DYiJr5u3.js";
8
+ import { v as yt, s as ma } from "./constants-CTRduy1g.js";
9
9
  import "./validators-CHlnnHuS.js";
10
10
  import "./matrix-operation-contract-CPgckXxm.js";
11
11
  import "../value-format-preferences/index.js";
12
- import { S as ha } from "./search-BHsQIWBV.js";
13
- import { M as ma } from "./mouse-pointer-2-BZvGk45-.js";
14
- import { l as pa } from "./matrix-formatter-BTPfthsa.js";
12
+ import { S as pa } from "./search-BHsQIWBV.js";
13
+ import { s as Ve } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
14
+ import { M as fa } from "./mouse-pointer-2-BZvGk45-.js";
15
+ import { l as ga } from "./matrix-formatter-BTPfthsa.js";
15
16
  import "./appearance-runtime-provider-D0xVQWnH.js";
16
17
  import "./appearance-context-XviHOhWJ.js";
17
18
  import "./index-C9KXfCkC.js";
@@ -20,14 +21,14 @@ import "zod";
20
21
  import "./matrix-continuation-C4sRcjZU.js";
21
22
  import "./color-CJvdlFM_.js";
22
23
  import "react-dom";
23
- import { g as se, d as fa, a as ga } from "./index-BVIet238.js";
24
+ import { g as se, d as ba, a as xa } from "./index-BVIet238.js";
24
25
  /**
25
26
  * @license lucide-react v0.453.0 - ISC
26
27
  *
27
28
  * This source code is licensed under the ISC license.
28
29
  * See the LICENSE file in the root directory of this source tree.
29
30
  */
30
- const ba = Ge("ArrowUpRight", [
31
+ const va = qe("ArrowUpRight", [
31
32
  ["path", { d: "M7 7h10v10", key: "1tivn9" }],
32
33
  ["path", { d: "M7 17 17 7", key: "1vkiza" }]
33
34
  ]);
@@ -37,7 +38,7 @@ const ba = Ge("ArrowUpRight", [
37
38
  * This source code is licensed under the ISC license.
38
39
  * See the LICENSE file in the root directory of this source tree.
39
40
  */
40
- const xa = Ge("CalendarRange", [
41
+ const ya = qe("CalendarRange", [
41
42
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
42
43
  ["path", { d: "M16 2v4", key: "4m81vk" }],
43
44
  ["path", { d: "M3 10h18", key: "8toen8" }],
@@ -53,7 +54,7 @@ const xa = Ge("CalendarRange", [
53
54
  * This source code is licensed under the ISC license.
54
55
  * See the LICENSE file in the root directory of this source tree.
55
56
  */
56
- const va = Ge("FileDown", [
57
+ const Ca = qe("FileDown", [
57
58
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
58
59
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
59
60
  ["path", { d: "M12 18v-6", key: "17g6i2" }],
@@ -65,7 +66,7 @@ const va = Ge("FileDown", [
65
66
  * This source code is licensed under the ISC license.
66
67
  * See the LICENSE file in the root directory of this source tree.
67
68
  */
68
- const ya = Ge("Newspaper", [
69
+ const wa = qe("Newspaper", [
69
70
  [
70
71
  "path",
71
72
  {
@@ -77,118 +78,118 @@ const ya = Ge("Newspaper", [
77
78
  ["path", { d: "M15 18h-5", key: "95g1m2" }],
78
79
  ["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
79
80
  ]);
80
- function Ca() {
81
- return /* @__PURE__ */ e("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((t, a) => /* @__PURE__ */ r(
81
+ function Na() {
82
+ return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((e, a) => /* @__PURE__ */ r(
82
83
  "div",
83
84
  {
84
85
  className: "flex animate-pulse items-start gap-3 rounded-xl border border-transparent px-2.5 py-2.5",
85
86
  children: [
86
- /* @__PURE__ */ e("div", { className: "mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60" }),
87
+ /* @__PURE__ */ t("div", { className: "mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60" }),
87
88
  /* @__PURE__ */ r("div", { className: "flex-1 space-y-1.5", children: [
88
- /* @__PURE__ */ e("div", { className: "h-4 w-3/5 rounded bg-muted/60" }),
89
- /* @__PURE__ */ e("div", { className: "h-3 w-4/5 rounded bg-muted/40" })
89
+ /* @__PURE__ */ t("div", { className: "h-4 w-3/5 rounded bg-muted/60" }),
90
+ /* @__PURE__ */ t("div", { className: "h-3 w-4/5 rounded bg-muted/40" })
90
91
  ] })
91
92
  ]
92
93
  },
93
94
  a
94
95
  )) });
95
96
  }
96
- function wa({
97
- open: t,
97
+ function Sa({
98
+ open: e,
98
99
  onOpenChange: a,
99
- onSubmit: i,
100
+ onSubmit: o,
100
101
  isCreating: n
101
102
  }) {
102
- const l = tt("interactive"), [s, c] = I(""), [p, d] = I("");
103
+ const i = rt("interactive"), [s, c] = I(""), [p, l] = I("");
103
104
  Y(() => {
104
- t || (c(""), d(""));
105
- }, [t]);
106
- const m = () => {
107
- s.trim() && i({ title: s, description: p });
108
- }, o = (h) => {
109
- a(h);
105
+ e || (c(""), l(""));
106
+ }, [e]);
107
+ const u = () => {
108
+ s.trim() && o({ title: s, description: p });
109
+ }, d = (m) => {
110
+ a(m);
110
111
  };
111
- return /* @__PURE__ */ e(De, { open: t, onOpenChange: o, children: /* @__PURE__ */ r(
112
+ return /* @__PURE__ */ t(De, { open: e, onOpenChange: d, children: /* @__PURE__ */ r(
112
113
  ke,
113
114
  {
114
115
  showCloseButton: !1,
115
116
  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",
116
- style: l.dialogStyle,
117
+ style: i.dialogStyle,
117
118
  children: [
118
119
  /* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
119
120
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
120
- /* @__PURE__ */ e(mt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
121
+ /* @__PURE__ */ t(pt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
121
122
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
122
- /* @__PURE__ */ e(Ee, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
123
- /* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
123
+ /* @__PURE__ */ t(Ee, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
124
+ /* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
124
125
  ] })
125
126
  ] }),
126
- /* @__PURE__ */ e(
127
+ /* @__PURE__ */ t(
127
128
  T,
128
129
  {
129
130
  size: "xs",
130
131
  variant: "ghost",
131
132
  className: "w-7 px-0 text-muted-foreground hover:text-foreground",
132
- onClick: () => o(!1),
133
+ onClick: () => d(!1),
133
134
  "aria-label": "Close",
134
135
  disabled: n,
135
- children: /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" })
136
+ children: /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" })
136
137
  }
137
138
  )
138
139
  ] }),
139
140
  /* @__PURE__ */ r("div", { className: "space-y-3 px-4 py-3", children: [
140
- /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
141
+ /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
141
142
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
142
- /* @__PURE__ */ e(Se, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
143
- /* @__PURE__ */ e(
144
- Je,
143
+ /* @__PURE__ */ t(Se, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
144
+ /* @__PURE__ */ t(
145
+ et,
145
146
  {
146
147
  id: "visual-title",
147
148
  size: "sm",
148
149
  placeholder: "Untitled visual",
149
150
  value: s,
150
- onChange: (h) => c(h.target.value),
151
+ onChange: (m) => c(m.target.value),
151
152
  disabled: n,
152
- onKeyDown: (h) => {
153
- h.key === "Enter" && !h.shiftKey && (h.preventDefault(), m());
153
+ onKeyDown: (m) => {
154
+ m.key === "Enter" && !m.shiftKey && (m.preventDefault(), u());
154
155
  }
155
156
  }
156
157
  )
157
158
  ] }),
158
159
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
159
- /* @__PURE__ */ e(Se, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
160
- /* @__PURE__ */ e(
161
- Je,
160
+ /* @__PURE__ */ t(Se, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
161
+ /* @__PURE__ */ t(
162
+ et,
162
163
  {
163
164
  id: "visual-description",
164
165
  size: "sm",
165
166
  placeholder: "Optional",
166
167
  value: p,
167
- onChange: (h) => d(h.target.value),
168
+ onChange: (m) => l(m.target.value),
168
169
  disabled: n
169
170
  }
170
171
  )
171
172
  ] })
172
173
  ] }),
173
174
  /* @__PURE__ */ r("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
174
- /* @__PURE__ */ e(
175
+ /* @__PURE__ */ t(
175
176
  T,
176
177
  {
177
178
  size: "xs",
178
179
  variant: "outline",
179
- onClick: () => o(!1),
180
+ onClick: () => d(!1),
180
181
  disabled: n,
181
182
  children: "Cancel"
182
183
  }
183
184
  ),
184
- /* @__PURE__ */ e(
185
+ /* @__PURE__ */ t(
185
186
  T,
186
187
  {
187
188
  size: "xs",
188
- onClick: m,
189
+ onClick: u,
189
190
  disabled: !s.trim() || n,
190
191
  children: n ? /* @__PURE__ */ r(j, { children: [
191
- /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }),
192
+ /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin" }),
192
193
  "Creating..."
193
194
  ] }) : "Create library visual"
194
195
  }
@@ -198,113 +199,113 @@ function wa({
198
199
  }
199
200
  ) });
200
201
  }
201
- function _t(t) {
202
- return t ? new Date(t).toLocaleDateString("en-US", {
202
+ function $t(e) {
203
+ return e ? new Date(e).toLocaleDateString("en-US", {
203
204
  month: "short",
204
205
  day: "numeric",
205
206
  year: "numeric"
206
207
  }) : "Unknown";
207
208
  }
208
- function zt(t, a) {
209
+ function jt(e, a) {
209
210
  var n;
210
- const i = (n = t.ownership.createdBy) == null ? void 0 : n.type;
211
- return i === "tenant" || i === "organization" && a;
211
+ const o = (n = e.ownership.createdBy) == null ? void 0 : n.type;
212
+ return o === "tenant" || o === "organization" && a;
212
213
  }
213
- function ft(t, a) {
214
- var i, n;
215
- return zt(t, a) ? ((i = t.ownership.createdBy) == null ? void 0 : i.name) || ((n = t.createdByTenantUserRel) == null ? void 0 : n.name) || t.lastModifiedBy || "Unknown" : "Organization";
214
+ function gt(e, a) {
215
+ var o, n;
216
+ return jt(e, a) ? ((o = e.ownership.createdBy) == null ? void 0 : o.name) || ((n = e.createdByTenantUserRel) == null ? void 0 : n.name) || e.lastModifiedBy || "Unknown" : "Organization";
216
217
  }
217
- function Na(t, a) {
218
- return ft(t, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
218
+ function Da(e, a) {
219
+ return gt(e, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
219
220
  }
220
- function Sa(t) {
221
- const a = (t || "").toLowerCase();
222
- return a.includes("table") ? wt : a.includes("pie") || a.includes("donut") ? or : a.includes("line") ? ir : a.includes("bar") ? Gt : mt;
221
+ function ka(e) {
222
+ const a = (e || "").toLowerCase();
223
+ return a.includes("table") ? St : a.includes("pie") || a.includes("donut") ? lr : a.includes("line") ? dr : a.includes("bar") ? Kt : pt;
223
224
  }
224
- function Da({ visual: t }) {
225
- const a = t.ownership.status === "public" ? "Public" : t.ownership.status === "shared" || t.ownership.sharedCount > 0 ? "Shared" : "Private";
226
- 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 });
225
+ function Ea({ visual: e }) {
226
+ const a = e.ownership.status === "public" ? "Public" : e.ownership.status === "shared" || e.ownership.sharedCount > 0 ? "Shared" : "Private";
227
+ 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 });
227
228
  }
228
- function Hn({
229
- open: t,
229
+ function Kn({
230
+ open: e,
230
231
  onOpenChange: a
231
232
  }) {
232
- const i = tt("interactive"), [n, l] = I(""), [s, c] = I(/* @__PURE__ */ new Set()), [p, d] = I(!1), [m, o] = I(
233
+ const o = rt("interactive"), [n, i] = I(""), [s, c] = I(/* @__PURE__ */ new Set()), [p, l] = I(!1), [u, d] = I(
233
234
  null
234
- ), [h, u] = I(
235
+ ), [m, h] = I(
235
236
  null
236
237
  ), [f, g] = I(!1), [k, x] = I(null), [D, S] = I(null), C = () => {
237
- c(/* @__PURE__ */ new Set()), o(null), u(null), g(!1), x(null);
238
+ c(/* @__PURE__ */ new Set()), d(null), h(null), g(!1), x(null);
238
239
  }, w = () => {
239
240
  a(!1), C();
240
- }, { selectVisual: E } = Et(), { handleAddLibraryVisual: V, handleEditLibraryVisual: b } = pt(), { isConsoleMode: v } = er(), {
241
- resources: B,
241
+ }, { selectVisual: E } = It(), { handleAddLibraryVisual: V, handleEditLibraryVisual: b } = ft(), { isConsoleMode: v } = rr(), {
242
+ resources: U,
242
243
  isLoading: F,
243
- isError: H,
244
+ isError: G,
244
245
  createResource: A,
245
246
  updateResource: R,
246
247
  deleteResourceAsync: $,
247
248
  duplicateResource: xe,
248
249
  isCreating: te,
249
250
  isDeleting: oe
250
- } = tr(
251
+ } = ar(
251
252
  void 0,
252
253
  (y) => {
253
- d(!1), y && (E(y), b(y), w());
254
+ l(!1), y && (E(y), b(y), w());
254
255
  }
255
256
  ), {
256
257
  startUpdating: Ae,
257
258
  stopUpdating: Ie,
258
259
  isUpdating: ie
259
- } = rr(), W = B, Z = ee(() => {
260
+ } = nr(), W = U, J = Z(() => {
260
261
  const y = n.trim().toLowerCase();
261
262
  return y ? W.filter(
262
- (L) => {
263
+ (B) => {
263
264
  var M, re, de;
264
- return ((M = L.title) == null ? void 0 : M.toLowerCase().includes(y)) || ((re = L.description) == null ? void 0 : re.toLowerCase().includes(y)) || ((de = L.kind) == null ? void 0 : de.toLowerCase().includes(y));
265
+ return ((M = B.title) == null ? void 0 : M.toLowerCase().includes(y)) || ((re = B.description) == null ? void 0 : re.toLowerCase().includes(y)) || ((de = B.kind) == null ? void 0 : de.toLowerCase().includes(y));
265
266
  }
266
267
  ) : W;
267
- }, [n, W]), le = ee(
268
+ }, [n, W]), le = Z(
268
269
  () => W.filter(
269
270
  (y) => s.has(y.id)
270
271
  ),
271
272
  [s, W]
272
- ), J = le.filter(
273
+ ), ee = le.filter(
273
274
  (y) => y.permissions.canDelete
274
275
  ), Fe = le.filter(
275
276
  (y) => y.permissions.canShare
276
- ), ve = Z.length > 0 && Z.every(
277
+ ), ve = J.length > 0 && J.every(
277
278
  (y) => s.has(y.id)
278
- ), ce = Z.some(
279
+ ), ue = J.some(
279
280
  (y) => s.has(y.id)
280
281
  ), pe = (y) => {
281
- const L = new Set(s);
282
- y(L), c(L);
282
+ const B = new Set(s);
283
+ y(B), c(B);
283
284
  }, X = (y) => {
284
- pe((L) => {
285
- L.has(y) ? L.delete(y) : L.add(y);
285
+ pe((B) => {
286
+ B.has(y) ? B.delete(y) : B.add(y);
286
287
  });
287
288
  }, ye = () => {
288
289
  c((y) => {
289
- const L = new Set(y);
290
- return ve ? Z.forEach(
291
- (M) => L.delete(M.id)
292
- ) : Z.forEach(
293
- (M) => L.add(M.id)
294
- ), L;
290
+ const B = new Set(y);
291
+ return ve ? J.forEach(
292
+ (M) => B.delete(M.id)
293
+ ) : J.forEach(
294
+ (M) => B.add(M.id)
295
+ ), B;
295
296
  });
296
297
  }, _ = async (y) => {
297
298
  (await V(y)).success && w();
298
299
  }, z = async () => {
299
300
  const y = le;
300
301
  if (y.length === 0) return;
301
- let L = !1;
302
+ let B = !1;
302
303
  for (const M of y)
303
304
  if (!(await V(M)).success) {
304
- L = !0;
305
+ B = !0;
305
306
  break;
306
307
  }
307
- L || w();
308
+ B || w();
308
309
  }, ne = (y) => {
309
310
  b(y), w();
310
311
  }, fe = (y) => {
@@ -312,18 +313,18 @@ function Hn({
312
313
  onSettled: () => S(null)
313
314
  });
314
315
  }, Le = () => {
315
- if (J.length === 0) {
316
+ if (ee.length === 0) {
316
317
  O.error("Select a visual you can delete");
317
318
  return;
318
319
  }
319
320
  x(null), g(!0);
320
- }, Ke = async () => {
321
- const y = k ? [k] : J;
321
+ }, Qe = async () => {
322
+ const y = k ? [k] : ee;
322
323
  try {
323
- for (const L of y)
324
- await $(L.id);
325
- c((L) => {
326
- const M = new Set(L);
324
+ for (const B of y)
325
+ await $(B.id);
326
+ c((B) => {
327
+ const M = new Set(B);
327
328
  return y.forEach(
328
329
  (re) => M.delete(re.id)
329
330
  ), M;
@@ -340,52 +341,52 @@ function Hn({
340
341
  O.error("You do not have permission to share this visual");
341
342
  return;
342
343
  }
343
- o(y);
344
+ d(y);
344
345
  }, we = ({
345
346
  title: y,
346
- description: L
347
+ description: B
347
348
  }) => {
348
- if (!h) return;
349
+ if (!m) return;
349
350
  const M = {};
350
- if (y !== h.title && (M.title = y), (h.description || "") !== L && (M.description = L), Object.keys(M).length === 0) {
351
- u(null);
351
+ if (y !== m.title && (M.title = y), (m.description || "") !== B && (M.description = B), Object.keys(M).length === 0) {
352
+ h(null);
352
353
  return;
353
354
  }
354
355
  const re = Object.keys(M), de = re.length === 1 ? re[0] : void 0;
355
- Ae(h.id, de), R(
356
+ Ae(m.id, de), R(
356
357
  {
357
- resourceId: h.id,
358
+ resourceId: m.id,
358
359
  data: M
359
360
  },
360
361
  {
361
362
  onSuccess: () => {
362
- Ie(h.id, de), u(null);
363
+ Ie(m.id, de), h(null);
363
364
  },
364
365
  onError: () => {
365
- Ie(h.id, de);
366
+ Ie(m.id, de);
366
367
  }
367
368
  }
368
369
  );
369
370
  }, Q = (y) => {
370
371
  a(y), y || C();
371
- }, Ne = k ? 1 : J.length;
372
+ }, Ne = k ? 1 : ee.length;
372
373
  return /* @__PURE__ */ r(j, { children: [
373
- /* @__PURE__ */ e(De, { open: t, onOpenChange: Q, children: /* @__PURE__ */ r(
374
+ /* @__PURE__ */ t(De, { open: e, onOpenChange: Q, children: /* @__PURE__ */ r(
374
375
  ke,
375
376
  {
376
377
  showCloseButton: !1,
377
378
  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",
378
- style: i.dialogStyle,
379
+ style: o.dialogStyle,
379
380
  children: [
380
381
  /* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
381
382
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
382
- /* @__PURE__ */ e(wt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
383
+ /* @__PURE__ */ t(St, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
383
384
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
384
- /* @__PURE__ */ e(Ee, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
385
- /* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
385
+ /* @__PURE__ */ t(Ee, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
386
+ /* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
386
387
  ] })
387
388
  ] }),
388
- /* @__PURE__ */ e(
389
+ /* @__PURE__ */ t(
389
390
  T,
390
391
  {
391
392
  size: "xs",
@@ -399,13 +400,13 @@ function Hn({
399
400
  ] }),
400
401
  /* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
401
402
  /* @__PURE__ */ r("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
402
- /* @__PURE__ */ e(ha, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
403
- /* @__PURE__ */ e(
403
+ /* @__PURE__ */ t(pa, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
404
+ /* @__PURE__ */ t(
404
405
  "input",
405
406
  {
406
407
  autoFocus: !0,
407
408
  value: n,
408
- onChange: (y) => l(y.target.value),
409
+ onChange: (y) => i(y.target.value),
409
410
  placeholder: "Search visuals...",
410
411
  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",
411
412
  "aria-label": "Search visuals"
@@ -418,31 +419,31 @@ function Hn({
418
419
  size: "xs",
419
420
  variant: "outline",
420
421
  className: "ml-auto",
421
- onClick: () => d(!0),
422
+ onClick: () => l(!0),
422
423
  children: [
423
- /* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5" }),
424
+ /* @__PURE__ */ t(ge, { className: "h-3.5 w-3.5" }),
424
425
  "New library visual"
425
426
  ]
426
427
  }
427
428
  )
428
429
  ] }),
429
- /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: F ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(Ca, {}) }) : H ? /* @__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" }) }) : Z.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
430
- /* @__PURE__ */ e(mt, { className: "h-5 w-5 text-muted-foreground/60" }),
431
- /* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
432
- /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
433
- ] }) : /* @__PURE__ */ e(
434
- ka,
430
+ /* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: F ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(Na, {}) }) : G ? /* @__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" }) }) : J.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
431
+ /* @__PURE__ */ t(pt, { className: "h-5 w-5 text-muted-foreground/60" }),
432
+ /* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
433
+ /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
434
+ ] }) : /* @__PURE__ */ t(
435
+ Aa,
435
436
  {
436
- visuals: Z,
437
+ visuals: J,
437
438
  selectedIds: s,
438
439
  allFilteredSelected: ve,
439
- someFilteredSelected: ce,
440
+ someFilteredSelected: ue,
440
441
  onSelectAll: ye,
441
442
  onToggleSelection: X,
442
443
  onAddVisual: _,
443
444
  onOpenVisual: ne,
444
- onEditDetails: u,
445
- onShareVisual: o,
445
+ onEditDetails: h,
446
+ onShareVisual: d,
446
447
  onDeleteVisual: (y) => {
447
448
  x(y), g(!0);
448
449
  },
@@ -453,13 +454,13 @@ function Hn({
453
454
  }
454
455
  ) }),
455
456
  /* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
456
- /* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children: s.size > 0 && /* @__PURE__ */ r(j, { children: [
457
+ /* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: s.size > 0 && /* @__PURE__ */ r(j, { children: [
457
458
  /* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: [
458
- /* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children: s.size }),
459
+ /* @__PURE__ */ t("span", { className: "font-medium tabular-nums text-foreground", children: s.size }),
459
460
  " ",
460
461
  "selected"
461
462
  ] }),
462
- /* @__PURE__ */ e(
463
+ /* @__PURE__ */ t(
463
464
  T,
464
465
  {
465
466
  size: "xs",
@@ -476,7 +477,7 @@ function Hn({
476
477
  onClick: Ce,
477
478
  disabled: le.length !== 1 || Fe.length !== 1,
478
479
  children: [
479
- /* @__PURE__ */ e(At, { className: "h-3.5 w-3.5" }),
480
+ /* @__PURE__ */ t(Ft, { className: "h-3.5 w-3.5" }),
480
481
  "Share"
481
482
  ]
482
483
  }
@@ -488,17 +489,17 @@ function Hn({
488
489
  variant: "outline",
489
490
  className: "text-destructive hover:text-destructive",
490
491
  onClick: Le,
491
- disabled: J.length === 0,
492
+ disabled: ee.length === 0,
492
493
  children: [
493
- /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }),
494
+ /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5" }),
494
495
  "Delete ",
495
- J.length || s.size
496
+ ee.length || s.size
496
497
  ]
497
498
  }
498
499
  )
499
500
  ] }) }),
500
501
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
501
- /* @__PURE__ */ e(
502
+ /* @__PURE__ */ t(
502
503
  T,
503
504
  {
504
505
  size: "xs",
@@ -514,7 +515,7 @@ function Hn({
514
515
  onClick: z,
515
516
  disabled: s.size === 0,
516
517
  children: [
517
- /* @__PURE__ */ e(Nt, { className: "h-3.5 w-3.5" }),
518
+ /* @__PURE__ */ t(Dt, { className: "h-3.5 w-3.5" }),
518
519
  s.size === 0 ? "Add to dashboard" : `Add ${s.size} visual${s.size === 1 ? "" : "s"}`
519
520
  ]
520
521
  }
@@ -524,64 +525,64 @@ function Hn({
524
525
  ]
525
526
  }
526
527
  ) }),
527
- /* @__PURE__ */ e(
528
- wa,
528
+ /* @__PURE__ */ t(
529
+ Sa,
529
530
  {
530
531
  open: p,
531
- onOpenChange: d,
532
+ onOpenChange: l,
532
533
  onSubmit: A,
533
534
  isCreating: te
534
535
  }
535
536
  ),
536
- m && /* @__PURE__ */ e(
537
- ar,
537
+ u && /* @__PURE__ */ t(
538
+ sr,
538
539
  {
539
- resource: m,
540
- resourceType: nr.VISUAL,
541
- onClose: () => o(null)
540
+ resource: u,
541
+ resourceType: or.VISUAL,
542
+ onClose: () => d(null)
542
543
  }
543
544
  ),
544
- h && /* @__PURE__ */ e(
545
- sr,
545
+ m && /* @__PURE__ */ t(
546
+ ir,
546
547
  {
547
- open: !!h,
548
+ open: !!m,
548
549
  resourceLabel: "Visual",
549
- initialTitle: h.title || "",
550
- initialDescription: h.description || "",
551
- onClose: () => u(null),
550
+ initialTitle: m.title || "",
551
+ initialDescription: m.description || "",
552
+ onClose: () => h(null),
552
553
  onSave: we,
553
- isSaving: ie(h.id)
554
+ isSaving: ie(m.id)
554
555
  }
555
556
  ),
556
- /* @__PURE__ */ e(
557
- rt,
557
+ /* @__PURE__ */ t(
558
+ at,
558
559
  {
559
560
  open: f,
560
561
  onOpenChange: (y) => {
561
562
  !y && oe || (g(y), y || x(null));
562
563
  },
563
- children: /* @__PURE__ */ r(at, { children: [
564
- /* @__PURE__ */ r(nt, { children: [
565
- /* @__PURE__ */ r(st, { children: [
564
+ children: /* @__PURE__ */ r(nt, { children: [
565
+ /* @__PURE__ */ r(st, { children: [
566
+ /* @__PURE__ */ r(ot, { children: [
566
567
  "Delete ",
567
568
  Ne,
568
569
  " visual",
569
570
  Ne === 1 ? "" : "s",
570
571
  "?"
571
572
  ] }),
572
- /* @__PURE__ */ e(ot, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
573
+ /* @__PURE__ */ t(it, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
573
574
  ] }),
574
- /* @__PURE__ */ r(it, { children: [
575
- /* @__PURE__ */ e(lt, { disabled: oe, children: "Cancel" }),
575
+ /* @__PURE__ */ r(lt, { children: [
576
+ /* @__PURE__ */ t(dt, { disabled: oe, children: "Cancel" }),
576
577
  /* @__PURE__ */ r(
577
- It,
578
+ Lt,
578
579
  {
579
580
  onClick: (y) => {
580
- y.preventDefault(), Ke();
581
+ y.preventDefault(), Qe();
581
582
  },
582
583
  disabled: oe || Ne === 0,
583
584
  children: [
584
- oe ? /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }),
585
+ oe ? /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5" }),
585
586
  oe ? "Deleting..." : "Delete"
586
587
  ]
587
588
  }
@@ -592,53 +593,53 @@ function Hn({
592
593
  )
593
594
  ] });
594
595
  }
595
- function ka({
596
- visuals: t,
596
+ function Aa({
597
+ visuals: e,
597
598
  selectedIds: a,
598
- allFilteredSelected: i,
599
+ allFilteredSelected: o,
599
600
  someFilteredSelected: n,
600
- onSelectAll: l,
601
+ onSelectAll: i,
601
602
  onToggleSelection: s,
602
603
  onAddVisual: c,
603
604
  onOpenVisual: p,
604
- onEditDetails: d,
605
- onShareVisual: m,
606
- onDeleteVisual: o,
607
- onDuplicateVisual: h,
608
- duplicatingId: u,
605
+ onEditDetails: l,
606
+ onShareVisual: u,
607
+ onDeleteVisual: d,
608
+ onDuplicateVisual: m,
609
+ duplicatingId: h,
609
610
  isDeleting: f,
610
611
  isConsoleMode: g
611
612
  }) {
612
613
  return /* @__PURE__ */ r("div", { className: "min-w-[48rem]", children: [
613
614
  /* @__PURE__ */ r("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: [
614
- /* @__PURE__ */ e(
615
- dt,
615
+ /* @__PURE__ */ t(
616
+ ct,
616
617
  {
617
- checked: i ? !0 : n ? "indeterminate" : !1,
618
- onCheckedChange: l,
618
+ checked: o ? !0 : n ? "indeterminate" : !1,
619
+ onCheckedChange: i,
619
620
  "aria-label": "Select all visuals"
620
621
  }
621
622
  ),
622
- /* @__PURE__ */ e("span", { children: "Name" }),
623
- /* @__PURE__ */ e("span", { children: "Created by" }),
624
- /* @__PURE__ */ e("span", { children: "Updated" }),
625
- /* @__PURE__ */ e("span", { children: "Visibility" }),
626
- /* @__PURE__ */ e("span", { className: "text-right", children: "Shared" }),
627
- /* @__PURE__ */ e("span", { className: "text-right", children: "Actions" })
623
+ /* @__PURE__ */ t("span", { children: "Name" }),
624
+ /* @__PURE__ */ t("span", { children: "Created by" }),
625
+ /* @__PURE__ */ t("span", { children: "Updated" }),
626
+ /* @__PURE__ */ t("span", { children: "Visibility" }),
627
+ /* @__PURE__ */ t("span", { className: "text-right", children: "Shared" }),
628
+ /* @__PURE__ */ t("span", { className: "text-right", children: "Actions" })
628
629
  ] }),
629
- t.map((k) => /* @__PURE__ */ e(
630
- Ea,
630
+ e.map((k) => /* @__PURE__ */ t(
631
+ Ia,
631
632
  {
632
633
  visual: k,
633
634
  selected: a.has(k.id),
634
635
  onToggleSelection: s,
635
636
  onAddVisual: c,
636
637
  onOpenVisual: p,
637
- onEditDetails: d,
638
- onShareVisual: m,
639
- onDeleteVisual: o,
640
- onDuplicateVisual: h,
641
- duplicatingId: u,
638
+ onEditDetails: l,
639
+ onShareVisual: u,
640
+ onDeleteVisual: d,
641
+ onDuplicateVisual: m,
642
+ duplicatingId: h,
642
643
  isDeleting: f,
643
644
  isConsoleMode: g
644
645
  },
@@ -646,23 +647,23 @@ function ka({
646
647
  ))
647
648
  ] });
648
649
  }
649
- function Ea({
650
- visual: t,
650
+ function Ia({
651
+ visual: e,
651
652
  selected: a,
652
- onToggleSelection: i,
653
+ onToggleSelection: o,
653
654
  onAddVisual: n,
654
- onOpenVisual: l,
655
+ onOpenVisual: i,
655
656
  onEditDetails: s,
656
657
  onShareVisual: c,
657
658
  onDeleteVisual: p,
658
- onDuplicateVisual: d,
659
- duplicatingId: m,
660
- isDeleting: o,
661
- isConsoleMode: h
659
+ onDuplicateVisual: l,
660
+ duplicatingId: u,
661
+ isDeleting: d,
662
+ isConsoleMode: m
662
663
  }) {
663
664
  var g;
664
- const u = Sa(t.kind), f = () => {
665
- n(t);
665
+ const h = ka(e.kind), f = () => {
666
+ n(e);
666
667
  };
667
668
  return /* @__PURE__ */ r(
668
669
  "div",
@@ -672,12 +673,12 @@ function Ea({
672
673
  a && "bg-muted/70"
673
674
  ),
674
675
  children: [
675
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
676
- dt,
676
+ /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
677
+ ct,
677
678
  {
678
679
  checked: a,
679
- onCheckedChange: () => i(t.id),
680
- "aria-label": `Select ${t.title || "visual"}`
680
+ onCheckedChange: () => o(e.id),
681
+ "aria-label": `Select ${e.title || "visual"}`
681
682
  }
682
683
  ) }),
683
684
  /* @__PURE__ */ r(
@@ -686,24 +687,24 @@ function Ea({
686
687
  type: "button",
687
688
  className: "flex min-w-0 items-center gap-2 rounded-[4px] text-left outline-none focus-visible:ring-1 focus-visible:ring-ring",
688
689
  onClick: f,
689
- "aria-label": `Add ${t.title || "visual"} to dashboard`,
690
+ "aria-label": `Add ${e.title || "visual"} to dashboard`,
690
691
  children: [
691
- /* @__PURE__ */ e(u, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
692
+ /* @__PURE__ */ t(h, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
692
693
  /* @__PURE__ */ r("div", { className: "min-w-0", children: [
693
- /* @__PURE__ */ e(
694
+ /* @__PURE__ */ t(
694
695
  "div",
695
696
  {
696
697
  className: "truncate font-medium text-foreground",
697
- title: t.title || "Untitled Visual",
698
- children: t.title || "Untitled Visual"
698
+ title: e.title || "Untitled Visual",
699
+ children: e.title || "Untitled Visual"
699
700
  }
700
701
  ),
701
- ((g = t.description) == null ? void 0 : g.trim()) && /* @__PURE__ */ e(
702
+ ((g = e.description) == null ? void 0 : g.trim()) && /* @__PURE__ */ t(
702
703
  "div",
703
704
  {
704
705
  className: "truncate text-[11px] text-muted-foreground",
705
- title: t.description,
706
- children: t.description
706
+ title: e.description,
707
+ children: e.description
707
708
  }
708
709
  )
709
710
  ] })
@@ -711,122 +712,122 @@ function Ea({
711
712
  }
712
713
  ),
713
714
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
714
- /* @__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: Na(t, h) }),
715
- /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: ft(t, h) })
715
+ /* @__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: Da(e, m) }),
716
+ /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: gt(e, m) })
716
717
  ] }),
717
- /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: _t(t.updatedAt) }),
718
- /* @__PURE__ */ e(Da, { visual: t }),
719
- /* @__PURE__ */ e("span", { className: "text-right tabular-nums text-muted-foreground", children: t.ownership.sharedCount > 0 ? t.ownership.sharedCount : "—" }),
720
- /* @__PURE__ */ e(
721
- Aa,
718
+ /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: $t(e.updatedAt) }),
719
+ /* @__PURE__ */ t(Ea, { visual: e }),
720
+ /* @__PURE__ */ t("span", { className: "text-right tabular-nums text-muted-foreground", children: e.ownership.sharedCount > 0 ? e.ownership.sharedCount : "—" }),
721
+ /* @__PURE__ */ t(
722
+ Fa,
722
723
  {
723
- visual: t,
724
- onOpenVisual: l,
724
+ visual: e,
725
+ onOpenVisual: i,
725
726
  onEditDetails: s,
726
727
  onShareVisual: c,
727
728
  onDeleteVisual: p,
728
- onDuplicateVisual: d,
729
- duplicatingId: m,
730
- isDeleting: o,
731
- isConsoleMode: h
729
+ onDuplicateVisual: l,
730
+ duplicatingId: u,
731
+ isDeleting: d,
732
+ isConsoleMode: m
732
733
  }
733
734
  )
734
735
  ]
735
736
  }
736
737
  );
737
738
  }
738
- function Aa({
739
- visual: t,
739
+ function Fa({
740
+ visual: e,
740
741
  onOpenVisual: a,
741
- onEditDetails: i,
742
+ onEditDetails: o,
742
743
  onShareVisual: n,
743
- onDeleteVisual: l,
744
+ onDeleteVisual: i,
744
745
  onDuplicateVisual: s,
745
746
  duplicatingId: c,
746
747
  isDeleting: p,
747
- isConsoleMode: d
748
+ isConsoleMode: l
748
749
  }) {
749
750
  return /* @__PURE__ */ r(
750
751
  "div",
751
752
  {
752
753
  className: "flex items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
753
- onClick: (m) => m.stopPropagation(),
754
+ onClick: (u) => u.stopPropagation(),
754
755
  children: [
755
- /* @__PURE__ */ e(
756
+ /* @__PURE__ */ t(
756
757
  T,
757
758
  {
758
759
  size: "xs",
759
760
  variant: "ghost",
760
761
  className: "w-7 px-0",
761
- onClick: () => a(t),
762
+ onClick: () => a(e),
762
763
  "aria-label": "Edit visual",
763
- children: /* @__PURE__ */ e(Qe, { className: "h-3.5 w-3.5" })
764
+ children: /* @__PURE__ */ t(Ye, { className: "h-3.5 w-3.5" })
764
765
  }
765
766
  ),
766
- /* @__PURE__ */ r($e, { modal: !1, children: [
767
- /* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
767
+ /* @__PURE__ */ r(je, { modal: !1, children: [
768
+ /* @__PURE__ */ t(We, { asChild: !0, children: /* @__PURE__ */ t(
768
769
  T,
769
770
  {
770
771
  size: "xs",
771
772
  variant: "ghost",
772
773
  className: "w-7 px-0",
773
774
  "aria-label": "More actions",
774
- children: /* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5" })
775
+ children: /* @__PURE__ */ t(Bt, { className: "h-3.5 w-3.5" })
775
776
  }
776
777
  ) }),
777
778
  /* @__PURE__ */ r(
778
- We,
779
+ He,
779
780
  {
780
781
  align: "end",
781
782
  className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
782
783
  children: [
783
- /* @__PURE__ */ r(q, { onClick: () => a(t), children: [
784
- /* @__PURE__ */ e(Qe, { className: "h-3.5 w-3.5" }),
784
+ /* @__PURE__ */ r(q, { onClick: () => a(e), children: [
785
+ /* @__PURE__ */ t(Ye, { className: "h-3.5 w-3.5" }),
785
786
  "Edit visual"
786
787
  ] }),
787
788
  /* @__PURE__ */ r(
788
789
  q,
789
790
  {
790
- onClick: () => s(t.id),
791
- disabled: c === t.id,
791
+ onClick: () => s(e.id),
792
+ disabled: c === e.id,
792
793
  children: [
793
- c === t.id ? /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(lr, { className: "h-3.5 w-3.5" }),
794
- c === t.id ? "Duplicating..." : "Duplicate"
794
+ c === e.id ? /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(cr, { className: "h-3.5 w-3.5" }),
795
+ c === e.id ? "Duplicating..." : "Duplicate"
795
796
  ]
796
797
  }
797
798
  ),
798
- t.permissions.canEdit && /* @__PURE__ */ r(q, { onClick: () => i(t), children: [
799
- /* @__PURE__ */ e(Qe, { className: "h-3.5 w-3.5" }),
799
+ e.permissions.canEdit && /* @__PURE__ */ r(q, { onClick: () => o(e), children: [
800
+ /* @__PURE__ */ t(Ye, { className: "h-3.5 w-3.5" }),
800
801
  "Edit details"
801
802
  ] }),
802
- t.permissions.canShare && /* @__PURE__ */ r(q, { onClick: () => n(t), children: [
803
- /* @__PURE__ */ e(At, { className: "h-3.5 w-3.5" }),
803
+ e.permissions.canShare && /* @__PURE__ */ r(q, { onClick: () => n(e), children: [
804
+ /* @__PURE__ */ t(Ft, { className: "h-3.5 w-3.5" }),
804
805
  "Share"
805
806
  ] }),
806
- t.permissions.canDelete && /* @__PURE__ */ r(j, { children: [
807
- /* @__PURE__ */ e(_e, {}),
807
+ e.permissions.canDelete && /* @__PURE__ */ r(j, { children: [
808
+ /* @__PURE__ */ t(ze, {}),
808
809
  /* @__PURE__ */ r(
809
810
  q,
810
811
  {
811
812
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
812
- onClick: () => l(t),
813
+ onClick: () => i(e),
813
814
  disabled: p,
814
815
  children: [
815
- /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }),
816
+ /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5" }),
816
817
  p ? "Deleting..." : "Delete"
817
818
  ]
818
819
  }
819
820
  )
820
821
  ] }),
821
- /* @__PURE__ */ e(_e, {}),
822
+ /* @__PURE__ */ t(ze, {}),
822
823
  /* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
823
- zt(t, d) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
824
- /* @__PURE__ */ e(dr, { className: "h-3 w-3" }),
825
- /* @__PURE__ */ e("span", { className: "truncate", children: ft(t, d) })
824
+ jt(e, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
825
+ /* @__PURE__ */ t(ur, { className: "h-3 w-3" }),
826
+ /* @__PURE__ */ t("span", { className: "truncate", children: gt(e, l) })
826
827
  ] }),
827
828
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
828
- /* @__PURE__ */ e(cr, { className: "h-3 w-3" }),
829
- /* @__PURE__ */ e("span", { children: _t(t.updatedAt) })
829
+ /* @__PURE__ */ t(hr, { className: "h-3 w-3" }),
830
+ /* @__PURE__ */ t("span", { children: $t(e.updatedAt) })
830
831
  ] })
831
832
  ] })
832
833
  ]
@@ -837,24 +838,63 @@ function Aa({
837
838
  }
838
839
  );
839
840
  }
840
- function Ia({
841
- open: t,
841
+ function Qn(e, a, o = !1) {
842
+ const n = L((u) => u.dashboard), i = L(
843
+ (u) => u.isDashboardEditing
844
+ ), s = L(
845
+ (u) => u.onDashboardLifecycleEvent
846
+ ), c = H(() => {
847
+ const u = L.getState().dashboard;
848
+ return a || !e || !u || u.id !== e.id ? !1 : Ve(u) !== Ve(e);
849
+ }, [e, a]);
850
+ xt(() => (L.setState({ checkUnsavedDashboardChanges: c }), () => {
851
+ L.getState().checkUnsavedDashboardChanges === c && L.setState({ checkUnsavedDashboardChanges: null });
852
+ }), [c]);
853
+ const p = Z(() => !o || a || !n || i && (!e || n.id !== e.id) ? null : {
854
+ dashboardId: n.id,
855
+ dirty: i && e ? Ve(n) !== Ve(e) : !1
856
+ }, [
857
+ i,
858
+ a,
859
+ o,
860
+ e,
861
+ n
862
+ ]), l = ce(null);
863
+ return xt(() => {
864
+ if (!s || !p) {
865
+ l.current = null;
866
+ return;
867
+ }
868
+ const u = l.current;
869
+ (u == null ? void 0 : u.callback) === s && u.dashboardId === p.dashboardId && u.dirty === p.dirty || (l.current = {
870
+ callback: s,
871
+ dashboardId: p.dashboardId,
872
+ dirty: p.dirty
873
+ }, s({
874
+ type: "dashboard:dirty-state",
875
+ dashboardId: p.dashboardId,
876
+ payload: { dirty: p.dirty }
877
+ }));
878
+ }, [p, s]), c;
879
+ }
880
+ function La({
881
+ open: e,
842
882
  onOpenChange: a,
843
- isLibraryVisual: i,
883
+ isLibraryVisual: o,
844
884
  currentVisualName: n,
845
- isSaving: l = !1,
885
+ isSaving: i = !1,
846
886
  destinationMode: s = "both",
847
887
  onConfirm: c
848
888
  }) {
849
- const [p, d] = I(
850
- i && n ? `Copy of ${n}` : n || ""
851
- ), [m, o] = I("");
852
- Ct.useEffect(() => {
853
- t && (d(
854
- i && n ? `Copy of ${n}` : n || ""
855
- ), o(""));
856
- }, [t, i, n]);
857
- const h = !!p.trim(), u = s === "local" ? {
889
+ const [p, l] = I(
890
+ o && n ? `Copy of ${n}` : n || ""
891
+ ), [u, d] = I("");
892
+ Nt.useEffect(() => {
893
+ e && (l(
894
+ o && n ? `Copy of ${n}` : n || ""
895
+ ), d(""));
896
+ }, [e, o, n]);
897
+ const m = !!p.trim(), h = s === "local" ? {
858
898
  saveToLibrary: !1,
859
899
  saveToCurrentDashboard: !0,
860
900
  badgeType: "local",
@@ -873,88 +913,88 @@ function Ia({
873
913
  description: "Creates a new library visual and adds a linked copy to this dashboard.",
874
914
  actionLabel: "Save Copy as Linked Visual"
875
915
  }, f = () => {
876
- !h || l || c({
916
+ !m || i || c({
877
917
  name: p.trim(),
878
- description: m.trim() || void 0,
879
- saveToLibrary: u.saveToLibrary,
880
- saveToCurrentDashboard: u.saveToCurrentDashboard
918
+ description: u.trim() || void 0,
919
+ saveToLibrary: h.saveToLibrary,
920
+ saveToCurrentDashboard: h.saveToCurrentDashboard
881
921
  });
882
922
  };
883
- return /* @__PURE__ */ e(De, { open: t, onOpenChange: a, children: /* @__PURE__ */ r(ke, { className: "sm:max-w-[500px]", children: [
884
- /* @__PURE__ */ r(ct, { children: [
923
+ return /* @__PURE__ */ t(De, { open: e, onOpenChange: a, children: /* @__PURE__ */ r(ke, { className: "sm:max-w-[500px]", children: [
924
+ /* @__PURE__ */ r(ut, { children: [
885
925
  /* @__PURE__ */ r(Ee, { className: "flex items-center gap-2", children: [
886
- /* @__PURE__ */ e("span", { children: "Save Visual As" }),
887
- u.badgeType !== "local" && /* @__PURE__ */ e(
888
- na,
926
+ /* @__PURE__ */ t("span", { children: "Save Visual As" }),
927
+ h.badgeType !== "local" && /* @__PURE__ */ t(
928
+ oa,
889
929
  {
890
- type: u.badgeType,
930
+ type: h.badgeType,
891
931
  showLabel: !0,
892
932
  className: "px-2 py-0.5"
893
933
  }
894
934
  )
895
935
  ] }),
896
- /* @__PURE__ */ e(ut, { children: u.description })
936
+ /* @__PURE__ */ t(ht, { children: h.description })
897
937
  ] }),
898
938
  /* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
899
939
  /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
900
- /* @__PURE__ */ e(Se, { htmlFor: "name", children: "Name" }),
901
- /* @__PURE__ */ e(
902
- Je,
940
+ /* @__PURE__ */ t(Se, { htmlFor: "name", children: "Name" }),
941
+ /* @__PURE__ */ t(
942
+ et,
903
943
  {
904
944
  id: "name",
905
945
  value: p,
906
- onChange: (g) => d(g.target.value),
946
+ onChange: (g) => l(g.target.value),
907
947
  placeholder: "Enter visual name",
908
- disabled: l
948
+ disabled: i
909
949
  }
910
950
  )
911
951
  ] }),
912
952
  /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
913
- /* @__PURE__ */ e(Se, { htmlFor: "description", children: "Description (optional)" }),
914
- /* @__PURE__ */ e(
915
- ur,
953
+ /* @__PURE__ */ t(Se, { htmlFor: "description", children: "Description (optional)" }),
954
+ /* @__PURE__ */ t(
955
+ mr,
916
956
  {
917
957
  id: "description",
918
- value: m,
919
- onChange: (g) => o(g.target.value),
958
+ value: u,
959
+ onChange: (g) => d(g.target.value),
920
960
  placeholder: "Enter visual description",
921
961
  rows: 3,
922
- disabled: l
962
+ disabled: i
923
963
  }
924
964
  )
925
965
  ] })
926
966
  ] }),
927
- /* @__PURE__ */ r(hr, { children: [
928
- /* @__PURE__ */ e(
967
+ /* @__PURE__ */ r(pr, { children: [
968
+ /* @__PURE__ */ t(
929
969
  T,
930
970
  {
931
971
  variant: "outline",
932
972
  onClick: () => a(!1),
933
- disabled: l,
973
+ disabled: i,
934
974
  children: "Cancel"
935
975
  }
936
976
  ),
937
- /* @__PURE__ */ r(T, { onClick: f, disabled: !h || l, children: [
938
- l && /* @__PURE__ */ e(ae, { className: "mr-2 h-4 w-4 animate-spin" }),
939
- u.actionLabel
977
+ /* @__PURE__ */ r(T, { onClick: f, disabled: !m || i, children: [
978
+ i && /* @__PURE__ */ t(ae, { className: "mr-2 h-4 w-4 animate-spin" }),
979
+ h.actionLabel
940
980
  ] })
941
981
  ] })
942
982
  ] }) });
943
983
  }
944
- function Fa() {
945
- const [t, a] = I(!1), [i, n] = I(!1), [l, s] = I(null), [c, p] = I(null), d = me((b) => b.frame), m = me((b) => b.card), o = mr(), h = P((b) => b.selectedSheetId), u = P((b) => b.dashboard), { getUpdatedFrame: f } = pt(), { selectVisual: g } = Et(), { addFrame: k, setSelectedFrameId: x, setIsVisualEditing: D } = be(), S = Lt(), C = !!(d != null && d.visualId), w = (() => {
984
+ function Ba() {
985
+ const [e, a] = I(!1), [o, n] = I(!1), [i, s] = I(null), [c, p] = I(null), l = me((b) => b.frame), u = me((b) => b.card), d = fr(), m = L((b) => b.selectedSheetId), h = L((b) => b.dashboard), { getUpdatedFrame: f } = ft(), { selectVisual: g } = It(), { addFrame: k, setSelectedFrameId: x, setIsVisualEditing: D } = be(), S = Ut(), C = !!(l != null && l.visualId), w = (() => {
946
986
  var b, v;
947
- return ((b = d == null ? void 0 : d.cards) == null ? void 0 : b.length) === 1 && ((v = d.cards[0]) != null && v.title) ? d.cards[0].title : o != null && o.title ? o.title : (m == null ? void 0 : m.title) || "Untitled Visual";
948
- })(), E = pr((b) => {
949
- b != null && b.id && (g(b), i && l && c && h && (async () => {
987
+ return ((b = l == null ? void 0 : l.cards) == null ? void 0 : b.length) === 1 && ((v = l.cards[0]) != null && v.title) ? l.cards[0].title : d != null && d.title ? d.title : (u == null ? void 0 : u.title) || "Untitled Visual";
988
+ })(), E = gr((b) => {
989
+ b != null && b.id && (g(b), o && i && c && m && (async () => {
950
990
  try {
951
991
  const v = {
952
- ...l,
953
- id: xt(),
992
+ ...i,
993
+ id: yt(),
954
994
  visualId: b.id
955
995
  // Link to the newly created library visual
956
996
  };
957
- k(h, v, {
997
+ k(m, v, {
958
998
  position: "end",
959
999
  semanticExecutionPayload: c
960
1000
  }), x(v.id), n(!1), s(null), p(null), D(!1);
@@ -969,19 +1009,19 @@ function Fa() {
969
1009
  })(), a(!1));
970
1010
  });
971
1011
  return {
972
- saveAsDialogOpen: t,
1012
+ saveAsDialogOpen: e,
973
1013
  setSaveAsDialogOpen: a,
974
1014
  handleSaveAs: async (b) => {
975
- if (!h) {
1015
+ if (!m) {
976
1016
  O.error("No sheet selected");
977
1017
  return;
978
1018
  }
979
- const v = f(), B = St(v);
980
- if (B) {
981
- O.error(B);
1019
+ const v = f(), U = kt(v);
1020
+ if (U) {
1021
+ O.error(U);
982
1022
  return;
983
1023
  }
984
- const H = v.cards.length === 1 ? {
1024
+ const G = v.cards.length === 1 ? {
985
1025
  ...v,
986
1026
  cards: v.cards.map((A) => ({
987
1027
  ...A,
@@ -993,8 +1033,8 @@ function Fa() {
993
1033
  let A = null;
994
1034
  if (b.saveToCurrentDashboard)
995
1035
  try {
996
- A = await S(H, {
997
- previousFrame: et(u, H.id)
1036
+ A = await S(G, {
1037
+ previousFrame: tt(h, G.id)
998
1038
  });
999
1039
  } catch ($) {
1000
1040
  console.error(
@@ -1005,28 +1045,28 @@ function Fa() {
1005
1045
  );
1006
1046
  return;
1007
1047
  }
1008
- n(b.saveToCurrentDashboard), s(H), p(A);
1048
+ n(b.saveToCurrentDashboard), s(G), p(A);
1009
1049
  const R = {
1010
1050
  title: b.name,
1011
1051
  description: b.description,
1012
- frameObject: H,
1052
+ frameObject: G,
1013
1053
  // Card title synced for single-card frames
1014
1054
  isPrivate: !1
1015
1055
  };
1016
1056
  E.mutate(R);
1017
1057
  } else if (b.saveToCurrentDashboard) {
1018
1058
  const A = {
1019
- ...H,
1059
+ ...G,
1020
1060
  // Card title already synced
1021
- id: xt(),
1061
+ id: yt(),
1022
1062
  visualId: void 0
1023
1063
  // Explicitly no visualId for local visuals
1024
1064
  };
1025
1065
  try {
1026
- const R = await S(H, {
1027
- previousFrame: et(u, H.id)
1066
+ const R = await S(G, {
1067
+ previousFrame: tt(h, G.id)
1028
1068
  });
1029
- k(h, A, {
1069
+ k(m, A, {
1030
1070
  position: "end",
1031
1071
  semanticExecutionPayload: R
1032
1072
  }), x(A.id), O.success("Visual saved to dashboard"), a(!1), D(!1);
@@ -1042,85 +1082,85 @@ function Fa() {
1042
1082
  isSaving: E.isPending
1043
1083
  };
1044
1084
  }
1045
- function Gn(t = {}) {
1046
- const { isInspectionMode: a } = fr(), i = me((A) => A.frame), n = me((A) => A.editorContext), l = gr((A) => A.selectedVisual), s = P((A) => A.selectedFrameId), c = P((A) => A.selectedSheetId), p = P((A) => A.dashboard), { setIsVisualEditing: d, updateFrame: m } = be(), [o, h] = I(!1), [u, f] = I("both"), g = Lt(), k = (n == null ? void 0 : n.type) === "documentSection", x = !!(i != null && i.visualId || l != null && l.id), D = !!(i != null && i.visualId && s), S = x && !D, {
1085
+ function Yn(e = {}) {
1086
+ const { isInspectionMode: a } = br(), o = me((A) => A.frame), n = me((A) => A.editorContext), i = xr((A) => A.selectedVisual), s = L((A) => A.selectedFrameId), c = L((A) => A.selectedSheetId), p = L((A) => A.dashboard), { setIsVisualEditing: l, updateFrame: u } = be(), [d, m] = I(!1), [h, f] = I("both"), g = Ut(), k = (n == null ? void 0 : n.type) === "documentSection", x = !!(o != null && o.visualId || i != null && i.id), D = !!(o != null && o.visualId && s), S = x && !D, {
1047
1087
  saveAsDialogOpen: C,
1048
1088
  setSaveAsDialogOpen: w,
1049
1089
  handleSaveAs: E,
1050
1090
  isLibraryVisual: V,
1051
1091
  currentVisualName: b,
1052
1092
  isSaving: v
1053
- } = Fa(), { getUpdatedFrame: B } = pt();
1093
+ } = Ba(), { getUpdatedFrame: U } = ft();
1054
1094
  if (a)
1055
1095
  return /* @__PURE__ */ r(j, { children: [
1056
- /* @__PURE__ */ e(
1057
- Ye,
1096
+ /* @__PURE__ */ t(
1097
+ Xe,
1058
1098
  {
1059
1099
  className: "rounded-control",
1060
1100
  variant: "default"
1061
1101
  }
1062
1102
  ),
1063
- /* @__PURE__ */ e(Xe, {})
1103
+ /* @__PURE__ */ t(Ze, {})
1064
1104
  ] });
1065
1105
  if (k)
1066
1106
  return /* @__PURE__ */ r(j, { children: [
1067
- /* @__PURE__ */ e(Ye, { className: "rounded-control", variant: "default" }),
1068
- /* @__PURE__ */ e(Xe, {})
1107
+ /* @__PURE__ */ t(Xe, { className: "rounded-control", variant: "default" }),
1108
+ /* @__PURE__ */ t(Ze, {})
1069
1109
  ] });
1070
1110
  const F = async () => {
1071
1111
  if (!c) {
1072
1112
  O.error("No sheet selected");
1073
1113
  return;
1074
1114
  }
1075
- if (o) return;
1076
- h(!0);
1077
- const A = B(), R = St(A);
1115
+ if (d) return;
1116
+ m(!0);
1117
+ const A = U(), R = kt(A);
1078
1118
  if (R) {
1079
- h(!1), O.error(R);
1119
+ m(!1), O.error(R);
1080
1120
  return;
1081
1121
  }
1082
1122
  const $ = {
1083
1123
  ...A,
1084
1124
  visualId: void 0
1085
- }, xe = et(p, $.id);
1125
+ }, xe = tt(p, $.id);
1086
1126
  try {
1087
1127
  const te = await g($, {
1088
1128
  previousFrame: xe
1089
1129
  });
1090
- m(c, $, {
1130
+ u(c, $, {
1091
1131
  semanticExecutionPayload: te
1092
1132
  });
1093
1133
  } catch (te) {
1094
- console.error("Failed to apply local semantic metadata:", te), h(!1), O.error(
1134
+ console.error("Failed to apply local semantic metadata:", te), m(!1), O.error(
1095
1135
  te instanceof Error ? te.message : "Failed to prepare semantic metadata for this visual"
1096
1136
  );
1097
1137
  return;
1098
1138
  }
1099
1139
  setTimeout(() => {
1100
- h(!1), O.success("Changes applied. Visual is now local to this dashboard"), d(!1);
1140
+ m(!1), O.success("Changes applied. Visual is now local to this dashboard"), l(!1);
1101
1141
  }, 300);
1102
- }, H = (A) => {
1142
+ }, G = (A) => {
1103
1143
  f(A), w(!0);
1104
1144
  };
1105
1145
  return /* @__PURE__ */ r(j, { children: [
1106
1146
  /* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
1107
- !x && /* @__PURE__ */ e(Ye, { className: "!rounded-none", variant: "default" }),
1108
- x && S && /* @__PURE__ */ e(sa, { className: "!rounded-none", variant: "default" }),
1109
- x && D && /* @__PURE__ */ e(oa, { className: "!rounded-none" }),
1110
- /* @__PURE__ */ r($e, { modal: !1, children: [
1111
- /* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
1147
+ !x && /* @__PURE__ */ t(Xe, { className: "!rounded-none", variant: "default" }),
1148
+ x && S && /* @__PURE__ */ t(ia, { className: "!rounded-none", variant: "default" }),
1149
+ x && D && /* @__PURE__ */ t(la, { className: "!rounded-none" }),
1150
+ /* @__PURE__ */ r(je, { modal: !1, children: [
1151
+ /* @__PURE__ */ t(We, { asChild: !0, children: /* @__PURE__ */ t(
1112
1152
  T,
1113
1153
  {
1114
1154
  variant: "default",
1115
1155
  size: "xs",
1116
1156
  className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
1117
1157
  "aria-label": "Open visual save options",
1118
- disabled: v || o,
1119
- children: /* @__PURE__ */ e(Pt, { className: "h-3.5 w-3.5" })
1158
+ disabled: v || d,
1159
+ children: /* @__PURE__ */ t(Ot, { className: "h-3.5 w-3.5" })
1120
1160
  }
1121
1161
  ) }),
1122
1162
  /* @__PURE__ */ r(
1123
- We,
1163
+ He,
1124
1164
  {
1125
1165
  align: "end",
1126
1166
  className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
@@ -1130,22 +1170,22 @@ function Gn(t = {}) {
1130
1170
  q,
1131
1171
  {
1132
1172
  onClick: F,
1133
- disabled: o,
1173
+ disabled: d,
1134
1174
  children: [
1135
- /* @__PURE__ */ e(Nt, { className: "h-3.5 w-3.5" }),
1136
- o ? "Applying..." : "Apply Locally"
1175
+ /* @__PURE__ */ t(Dt, { className: "h-3.5 w-3.5" }),
1176
+ d ? "Applying..." : "Apply Locally"
1137
1177
  ]
1138
1178
  }
1139
1179
  ),
1140
- /* @__PURE__ */ e(_e, {})
1180
+ /* @__PURE__ */ t(ze, {})
1141
1181
  ] }),
1142
1182
  /* @__PURE__ */ r(
1143
1183
  q,
1144
1184
  {
1145
- onClick: () => H("local"),
1185
+ onClick: () => G("local"),
1146
1186
  disabled: v,
1147
1187
  children: [
1148
- /* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5" }),
1188
+ /* @__PURE__ */ t(ge, { className: "h-3.5 w-3.5" }),
1149
1189
  "Add to Dashboard (Local)"
1150
1190
  ]
1151
1191
  }
@@ -1153,10 +1193,10 @@ function Gn(t = {}) {
1153
1193
  /* @__PURE__ */ r(
1154
1194
  q,
1155
1195
  {
1156
- onClick: () => H("library"),
1196
+ onClick: () => G("library"),
1157
1197
  disabled: v,
1158
1198
  children: [
1159
- /* @__PURE__ */ e(ia, { className: "h-3.5 w-3.5" }),
1199
+ /* @__PURE__ */ t(da, { className: "h-3.5 w-3.5" }),
1160
1200
  "Save as Library Visual"
1161
1201
  ]
1162
1202
  }
@@ -1164,10 +1204,10 @@ function Gn(t = {}) {
1164
1204
  /* @__PURE__ */ r(
1165
1205
  q,
1166
1206
  {
1167
- onClick: () => H("both"),
1207
+ onClick: () => G("both"),
1168
1208
  disabled: v,
1169
1209
  children: [
1170
- /* @__PURE__ */ e(la, { className: "h-3.5 w-3.5" }),
1210
+ /* @__PURE__ */ t(ca, { className: "h-3.5 w-3.5" }),
1171
1211
  "Save Copy as Linked Visual"
1172
1212
  ]
1173
1213
  }
@@ -1177,9 +1217,9 @@ function Gn(t = {}) {
1177
1217
  )
1178
1218
  ] })
1179
1219
  ] }),
1180
- /* @__PURE__ */ e(Xe, {}),
1181
- /* @__PURE__ */ e(
1182
- Ia,
1220
+ /* @__PURE__ */ t(Ze, {}),
1221
+ /* @__PURE__ */ t(
1222
+ La,
1183
1223
  {
1184
1224
  open: C,
1185
1225
  onOpenChange: (A) => {
@@ -1188,130 +1228,130 @@ function Gn(t = {}) {
1188
1228
  isLibraryVisual: V,
1189
1229
  currentVisualName: b,
1190
1230
  isSaving: v,
1191
- destinationMode: u,
1231
+ destinationMode: h,
1192
1232
  onConfirm: E
1193
1233
  }
1194
1234
  )
1195
1235
  ] });
1196
1236
  }
1197
- function qn({ className: t }) {
1198
- const a = me((o) => o.isDevMode), i = me((o) => o.card.type), n = P((o) => o.isVisualEditing), { setIsDevMode: l } = Dt(), { config: s } = Ht(br).tokenProps, c = (s == null ? void 0 : s.showAdvancedMode) !== !1;
1199
- if (!n || !c || !ua(i))
1237
+ function Xn({ className: e }) {
1238
+ const a = me((d) => d.isDevMode), o = me((d) => d.card.type), n = L((d) => d.isVisualEditing), { setIsDevMode: i } = Et(), { config: s } = qt(vr).tokenProps, c = (s == null ? void 0 : s.showAdvancedMode) !== !1;
1239
+ if (!n || !c || !ma(o))
1200
1240
  return null;
1201
- const p = a ? ma : xr, d = a ? "Visual editor" : "SQL editor", m = a ? "Switch to visual editor" : "Switch to SQL editor";
1241
+ const p = a ? fa : yr, l = a ? "Visual editor" : "SQL editor", u = a ? "Switch to visual editor" : "Switch to SQL editor";
1202
1242
  return /* @__PURE__ */ r(
1203
1243
  "button",
1204
1244
  {
1205
1245
  type: "button",
1206
- "aria-label": m,
1207
- title: m,
1208
- onClick: () => l(!a),
1246
+ "aria-label": u,
1247
+ title: u,
1248
+ onClick: () => i(!a),
1209
1249
  className: K(
1210
1250
  "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",
1211
- t
1251
+ e
1212
1252
  ),
1213
1253
  children: [
1214
- /* @__PURE__ */ e(p, { className: "h-3 w-3 text-muted-foreground" }),
1215
- d
1254
+ /* @__PURE__ */ t(p, { className: "h-3 w-3 text-muted-foreground" }),
1255
+ l
1216
1256
  ]
1217
1257
  }
1218
1258
  );
1219
1259
  }
1220
- function Kn({
1221
- open: t,
1260
+ function Zn({
1261
+ open: e,
1222
1262
  onOpenChange: a,
1223
- onSave: i,
1263
+ onSave: o,
1224
1264
  onDiscard: n,
1225
- isSaving: l,
1265
+ isSaving: i,
1226
1266
  title: s = "Unsaved changes",
1227
1267
  description: c = "You have unsaved changes to this dashboard. What would you like to do?",
1228
1268
  cancelLabel: p = "Cancel",
1229
- discardLabel: d = "Discard",
1230
- saveLabel: m = "Save"
1269
+ discardLabel: l = "Discard changes",
1270
+ saveLabel: u = "Save"
1231
1271
  }) {
1232
- return /* @__PURE__ */ e(rt, { open: t, onOpenChange: (h) => {
1233
- !h && l || a(h);
1234
- }, children: /* @__PURE__ */ r(at, { children: [
1235
- /* @__PURE__ */ r(nt, { children: [
1236
- /* @__PURE__ */ e(st, { children: s }),
1237
- /* @__PURE__ */ e(ot, { children: c })
1272
+ return /* @__PURE__ */ t(at, { open: e, onOpenChange: (m) => {
1273
+ !m && i || a(m);
1274
+ }, children: /* @__PURE__ */ r(nt, { children: [
1275
+ /* @__PURE__ */ r(st, { children: [
1276
+ /* @__PURE__ */ t(ot, { children: s }),
1277
+ /* @__PURE__ */ t(it, { children: c })
1238
1278
  ] }),
1239
- /* @__PURE__ */ r(it, { children: [
1240
- /* @__PURE__ */ e(
1279
+ /* @__PURE__ */ r(lt, { children: [
1280
+ /* @__PURE__ */ t(
1241
1281
  T,
1242
1282
  {
1243
1283
  type: "button",
1244
1284
  size: "xs",
1245
1285
  onClick: n,
1246
- disabled: l,
1247
- variant: "ghost",
1248
- className: "mr-auto text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
1249
- children: d
1286
+ disabled: i,
1287
+ variant: "outline",
1288
+ 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",
1289
+ children: l
1250
1290
  }
1251
1291
  ),
1252
- /* @__PURE__ */ e(lt, { disabled: l, children: p }),
1253
- /* @__PURE__ */ e(T, { type: "button", size: "xs", onClick: i, disabled: l, children: l ? /* @__PURE__ */ r(j, { children: [
1254
- /* @__PURE__ */ e(ae, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
1292
+ /* @__PURE__ */ t(dt, { disabled: i, children: p }),
1293
+ /* @__PURE__ */ t(T, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ r(j, { children: [
1294
+ /* @__PURE__ */ t(ae, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
1255
1295
  "Saving..."
1256
- ] }) : m })
1296
+ ] }) : u })
1257
1297
  ] })
1258
1298
  ] }) });
1259
1299
  }
1260
- function gt(t, a) {
1300
+ function bt(e, a) {
1261
1301
  return {
1262
- id: t.id,
1263
- status: t.status,
1264
- progress: t.progress !== void 0 ? t.progress : t.status === "completed" ? 100 : t.totalChunks === null ? null : t.totalChunks > 0 ? Math.round(t.completedChunks / t.totalChunks * 100) : 0,
1265
- totalRows: t.totalRows,
1266
- totalChunks: t.totalChunks,
1267
- rowsProcessed: t.processedRows,
1268
- completedChunks: t.completedChunks,
1269
- completedAt: t.completedAt ? new Date(t.completedAt) : void 0,
1302
+ id: e.id,
1303
+ status: e.status,
1304
+ progress: e.progress !== void 0 ? e.progress : e.status === "completed" ? 100 : e.totalChunks === null ? null : e.totalChunks > 0 ? Math.round(e.completedChunks / e.totalChunks * 100) : 0,
1305
+ totalRows: e.totalRows,
1306
+ totalChunks: e.totalChunks,
1307
+ rowsProcessed: e.processedRows,
1308
+ completedChunks: e.completedChunks,
1309
+ completedAt: e.completedAt ? new Date(e.completedAt) : void 0,
1270
1310
  lastUpdatedAt: /* @__PURE__ */ new Date(),
1271
- fileSize: t.fileSize,
1272
- error: t.error,
1311
+ fileSize: e.fileSize,
1312
+ error: e.error,
1273
1313
  // A refreshed result replaces prior authorization, including a failed URL fetch.
1274
1314
  downloadUrl: a
1275
1315
  };
1276
1316
  }
1277
- const La = 1e4, Ba = 15e3, Ta = 3e4, Va = 3e4, Ra = 12e4, vt = 2 * 60 * 60 * 1e3;
1278
- function Ua(t) {
1279
- const a = Date.now() - t.getTime();
1280
- return a < Va ? La : a < Ra ? Ba : Ta;
1317
+ const Ua = 1e4, Ta = 15e3, Va = 3e4, Ra = 3e4, Pa = 12e4, Ct = 2 * 60 * 60 * 1e3;
1318
+ function Ma(e) {
1319
+ const a = Date.now() - e.getTime();
1320
+ return a < Ra ? Ua : a < Pa ? Ta : Va;
1281
1321
  }
1282
- function Qn() {
1283
- const { authToken: t, tokenProps: a } = He(), i = ue((u) => u.activeExports), [n, l] = I(
1322
+ function Jn() {
1323
+ const { authToken: e, tokenProps: a } = Ge(), o = he((h) => h.activeExports), [n, i] = I(
1284
1324
  typeof document < "u" ? !document.hidden : !0
1285
- ), s = he(null), c = he(!1), p = he(void 0), d = a == null ? void 0 : a.apiServiceUrl, m = t == null ? void 0 : t.accessToken, o = G(() => {
1286
- const u = ue.getState().activeExports;
1287
- return Array.from(u.values()).filter(
1288
- (f) => ht(f.status)
1325
+ ), s = ce(null), c = ce(!1), p = ce(void 0), l = a == null ? void 0 : a.apiServiceUrl, u = e == null ? void 0 : e.accessToken, d = H(() => {
1326
+ const h = he.getState().activeExports;
1327
+ return Array.from(h.values()).filter(
1328
+ (f) => mt(f.status)
1289
1329
  );
1290
1330
  }, []);
1291
1331
  Y(() => {
1292
1332
  if (typeof document > "u") return;
1293
- const u = () => {
1294
- l(!document.hidden);
1333
+ const h = () => {
1334
+ i(!document.hidden);
1295
1335
  };
1296
- return document.addEventListener("visibilitychange", u), () => {
1297
- document.removeEventListener("visibilitychange", u);
1336
+ return document.addEventListener("visibilitychange", h), () => {
1337
+ document.removeEventListener("visibilitychange", h);
1298
1338
  };
1299
1339
  }, []);
1300
- const h = G(async () => {
1301
- if (!d || !m) {
1340
+ const m = H(async () => {
1341
+ if (!l || !u) {
1302
1342
  c.current = !1;
1303
1343
  return;
1304
1344
  }
1305
- const u = o();
1306
- if (u.length === 0) {
1345
+ const h = d();
1346
+ if (h.length === 0) {
1307
1347
  c.current = !1;
1308
1348
  return;
1309
1349
  }
1310
- const f = Date.now(), g = u.filter(
1311
- (C) => f - C.startedAt.getTime() > vt
1350
+ const f = Date.now(), g = h.filter(
1351
+ (C) => f - C.startedAt.getTime() > Ct
1312
1352
  );
1313
1353
  if (g.length > 0) {
1314
- const { updateExport: C } = ue.getState().actions;
1354
+ const { updateExport: C } = he.getState().actions;
1315
1355
  for (const w of g)
1316
1356
  C(w.id, {
1317
1357
  status: "failed",
@@ -1319,8 +1359,8 @@ function Qn() {
1319
1359
  lastUpdatedAt: /* @__PURE__ */ new Date()
1320
1360
  });
1321
1361
  }
1322
- const k = u.filter(
1323
- (C) => f - C.startedAt.getTime() <= vt
1362
+ const k = h.filter(
1363
+ (C) => f - C.startedAt.getTime() <= Ct
1324
1364
  );
1325
1365
  if (k.length === 0) {
1326
1366
  c.current = !1;
@@ -1329,18 +1369,18 @@ function Qn() {
1329
1369
  const x = await Promise.allSettled(
1330
1370
  k.map(async (C) => {
1331
1371
  try {
1332
- const w = await Bt(d, m, C.id);
1372
+ const w = await Tt(l, u, C.id);
1333
1373
  let E;
1334
1374
  if (w.status === "completed")
1335
1375
  try {
1336
- E = await ze(d, m, C.id);
1376
+ E = await $e(l, u, C.id);
1337
1377
  } catch (V) {
1338
1378
  console.error(
1339
1379
  `[useExportPolling] Failed to get download URL for ${C.id}:`,
1340
1380
  V
1341
1381
  );
1342
1382
  }
1343
- return gt(w, E);
1383
+ return bt(w, E);
1344
1384
  } catch (w) {
1345
1385
  return console.error(
1346
1386
  `[useExportPolling] Failed to poll export ${C.id}:`,
@@ -1348,105 +1388,105 @@ function Qn() {
1348
1388
  ), null;
1349
1389
  }
1350
1390
  })
1351
- ), { updateExport: D } = ue.getState().actions;
1391
+ ), { updateExport: D } = he.getState().actions;
1352
1392
  for (const C of x)
1353
1393
  C.status === "fulfilled" && C.value && D(C.value.id, C.value);
1354
- const S = o();
1394
+ const S = d();
1355
1395
  if (S.length > 0 && !document.hidden) {
1356
1396
  const C = S.reduce(
1357
1397
  (E, V) => V.startedAt < E ? V.startedAt : E,
1358
1398
  S[0].startedAt
1359
- ), w = Ua(C);
1399
+ ), w = Ma(C);
1360
1400
  s.current && clearTimeout(s.current), s.current = setTimeout(() => {
1361
1401
  var E;
1362
1402
  (E = p.current) == null || E.call(p);
1363
1403
  }, w);
1364
1404
  } else
1365
1405
  c.current = !1;
1366
- }, [d, m, o]);
1406
+ }, [l, u, d]);
1367
1407
  return Y(() => {
1368
- p.current = h;
1369
- }, [h]), Y(() => {
1408
+ p.current = m;
1409
+ }, [m]), Y(() => {
1370
1410
  var f;
1371
- o().length > 0 && n && !c.current && (c.current = !0, (f = p.current) == null || f.call(p));
1372
- }, [i, n, o]), Y(() => {
1411
+ d().length > 0 && n && !c.current && (c.current = !0, (f = p.current) == null || f.call(p));
1412
+ }, [o, n, d]), Y(() => {
1373
1413
  var f;
1374
- const u = o();
1375
- n && u.length > 0 && !c.current && (c.current = !0, (f = p.current) == null || f.call(p));
1376
- }, [n, o]), Y(() => {
1414
+ const h = d();
1415
+ n && h.length > 0 && !c.current && (c.current = !0, (f = p.current) == null || f.call(p));
1416
+ }, [n, d]), Y(() => {
1377
1417
  !n && s.current && (clearTimeout(s.current), s.current = null, c.current = !1);
1378
1418
  }, [n]), Y(() => () => {
1379
1419
  s.current && (clearTimeout(s.current), s.current = null);
1380
1420
  }, []), {
1381
1421
  isPolling: c.current,
1382
1422
  isTabVisible: n,
1383
- inProgressCount: o().length
1423
+ inProgressCount: d().length
1384
1424
  };
1385
1425
  }
1386
- function Yn() {
1387
- const { authToken: t, tokenProps: a } = He(), i = ue((p) => p.activeExports), { addExport: n } = Tt(), l = he(!1), s = a == null ? void 0 : a.apiServiceUrl, c = t == null ? void 0 : t.accessToken;
1426
+ function es() {
1427
+ const { authToken: e, tokenProps: a } = Ge(), o = he((p) => p.activeExports), { addExport: n } = Vt(), i = ce(!1), s = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken;
1388
1428
  Y(() => {
1389
- if (l.current || !s || !c) return;
1429
+ if (i.current || !s || !c) return;
1390
1430
  (async () => {
1391
1431
  try {
1392
- const { exports: d } = await vr(s, c, {
1432
+ const { exports: l } = await Cr(s, c, {
1393
1433
  status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
1394
1434
  limit: 20
1395
1435
  // Limit to recent exports
1396
1436
  });
1397
- for (const m of d) {
1398
- if (i.has(m.id)) continue;
1399
- let o;
1400
- if (m.status === "completed")
1437
+ for (const u of l) {
1438
+ if (o.has(u.id)) continue;
1439
+ let d;
1440
+ if (u.status === "completed")
1401
1441
  try {
1402
- o = await ze(s, c, m.id);
1403
- } catch (u) {
1442
+ d = await $e(s, c, u.id);
1443
+ } catch (h) {
1404
1444
  console.error(
1405
- `[useExportRecovery] Failed to get download URL for ${m.id}:`,
1406
- u
1445
+ `[useExportRecovery] Failed to get download URL for ${u.id}:`,
1446
+ h
1407
1447
  );
1408
1448
  }
1409
- const h = {
1410
- ...gt(m, o),
1411
- title: Pa(m),
1412
- startedAt: new Date(m.createdAt),
1413
- expiresAt: new Date(m.expiresAt)
1449
+ const m = {
1450
+ ...bt(u, d),
1451
+ title: Oa(u),
1452
+ startedAt: new Date(u.createdAt),
1453
+ expiresAt: new Date(u.expiresAt)
1414
1454
  };
1415
- n(h);
1455
+ n(m);
1416
1456
  }
1417
- l.current = !0;
1418
- } catch (d) {
1419
- console.error("[useExportRecovery] Failed to recover exports:", d), l.current = !0;
1457
+ i.current = !0;
1458
+ } catch (l) {
1459
+ console.error("[useExportRecovery] Failed to recover exports:", l), i.current = !0;
1420
1460
  }
1421
1461
  })();
1422
- }, [s, c, n, i]);
1462
+ }, [s, c, n, o]);
1423
1463
  }
1424
- function Pa(t) {
1425
- return t.title ? t.title : ht(
1426
- t.status
1427
- ) ? "Export in progress..." : t.status === "completed" ? "Export completed" : t.status === "failed" ? "Export failed" : "Export";
1464
+ function Oa(e) {
1465
+ return e.title ? e.title : mt(
1466
+ e.status
1467
+ ) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
1428
1468
  }
1429
- function Ma({
1430
- export: t,
1469
+ function _a({
1470
+ export: e,
1431
1471
  onRemove: a,
1432
- onDownload: i
1472
+ onDownload: o
1433
1473
  }) {
1434
- const [n, l] = I("idle");
1474
+ const [n, i] = I("idle");
1435
1475
  Y(() => {
1436
- t.downloadUrl && l("idle");
1437
- }, [t.downloadUrl]);
1476
+ e.downloadUrl && i("idle");
1477
+ }, [e.downloadUrl]);
1438
1478
  const s = async () => {
1439
- if (!i) {
1440
- t.downloadUrl && window.open(t.downloadUrl, "_blank");
1479
+ if (!o) {
1480
+ e.downloadUrl && window.open(e.downloadUrl, "_blank");
1441
1481
  return;
1442
1482
  }
1443
- l("preparing");
1444
- const g = await i(t);
1445
- l(g === "denied" ? "denied" : "idle");
1483
+ i("preparing");
1484
+ const g = await o(e);
1485
+ i(g === "denied" ? "denied" : "idle");
1446
1486
  }, c = (g) => {
1447
- g.stopPropagation(), a == null || a(t.id);
1448
- }, p = ht(t.status), d = (() => {
1449
- switch (t.status) {
1487
+ g.stopPropagation(), a == null || a(e.id);
1488
+ }, p = mt(e.status), l = (() => {
1489
+ switch (e.status) {
1450
1490
  case "pending":
1451
1491
  return "Queued...";
1452
1492
  case "compacting":
@@ -1454,21 +1494,21 @@ function Ma({
1454
1494
  default:
1455
1495
  return "Processing...";
1456
1496
  }
1457
- })(), m = t.status === "completed" ? "bg-emerald-500" : t.status === "failed" ? "bg-destructive" : t.status === "pending" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", o = t.status === "completed" ? "Ready" : t.status === "failed" ? "Failed" : "In progress", h = pa(t.startedAt, { addSuffix: !0 }), u = [
1458
- t.status === "completed" && t.totalRows !== null ? `${t.totalRows.toLocaleString()} rows` : null,
1459
- t.status === "completed" && t.fileSize ? yr(t.fileSize) : null
1460
- ].filter((g) => !!g), f = /* @__PURE__ */ e("span", { className: "text-muted-foreground/50", children: "·" });
1497
+ })(), u = e.status === "completed" ? "bg-emerald-500" : e.status === "failed" ? "bg-destructive" : e.status === "pending" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", d = e.status === "completed" ? "Ready" : e.status === "failed" ? "Failed" : "In progress", m = ga(e.startedAt, { addSuffix: !0 }), h = [
1498
+ e.status === "completed" && e.totalRows !== null ? `${e.totalRows.toLocaleString()} rows` : null,
1499
+ e.status === "completed" && e.fileSize ? wr(e.fileSize) : null
1500
+ ].filter((g) => !!g), f = /* @__PURE__ */ t("span", { className: "text-muted-foreground/50", children: "·" });
1461
1501
  return /* @__PURE__ */ r("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: [
1462
- /* @__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 ${m}` }) }),
1463
- /* @__PURE__ */ e("span", { className: "sr-only", children: o }),
1502
+ /* @__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 ${u}` }) }),
1503
+ /* @__PURE__ */ t("span", { className: "sr-only", children: d }),
1464
1504
  /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
1465
1505
  /* @__PURE__ */ r("div", { className: "flex h-5 items-center gap-2", children: [
1466
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: t.title }),
1467
- t.status === "completed" && n === "preparing" && /* @__PURE__ */ r("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: [
1468
- /* @__PURE__ */ e(Vt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }),
1506
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: e.title }),
1507
+ e.status === "completed" && n === "preparing" && /* @__PURE__ */ r("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: [
1508
+ /* @__PURE__ */ t(Rt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }),
1469
1509
  "Preparing"
1470
1510
  ] }),
1471
- t.status === "completed" && n !== "preparing" && /* @__PURE__ */ e(
1511
+ e.status === "completed" && n !== "preparing" && /* @__PURE__ */ t(
1472
1512
  "button",
1473
1513
  {
1474
1514
  type: "button",
@@ -1477,7 +1517,7 @@ function Ma({
1477
1517
  children: "Download"
1478
1518
  }
1479
1519
  ),
1480
- /* @__PURE__ */ e(
1520
+ /* @__PURE__ */ t(
1481
1521
  T,
1482
1522
  {
1483
1523
  variant: "ghost",
@@ -1486,65 +1526,65 @@ function Ma({
1486
1526
  onClick: c,
1487
1527
  "aria-label": "Remove notification",
1488
1528
  title: "Remove",
1489
- children: /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
1529
+ children: /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
1490
1530
  }
1491
1531
  )
1492
1532
  ] }),
1493
- !p && t.status !== "failed" && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
1494
- u.length > 0 && // Disclosed on hover or focus only; the time is what a reader scans.
1533
+ !p && e.status !== "failed" && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
1534
+ h.length > 0 && // Disclosed on hover or focus only; the time is what a reader scans.
1495
1535
  /* @__PURE__ */ r("span", { className: "hidden group-hover:contents group-focus-within:contents", children: [
1496
- u.map((g, k) => /* @__PURE__ */ r(Ct.Fragment, { children: [
1536
+ h.map((g, k) => /* @__PURE__ */ r(Nt.Fragment, { children: [
1497
1537
  k > 0 && f,
1498
- /* @__PURE__ */ e("span", { children: g })
1538
+ /* @__PURE__ */ t("span", { children: g })
1499
1539
  ] }, k)),
1500
1540
  f
1501
1541
  ] }),
1502
- /* @__PURE__ */ e("span", { children: h })
1542
+ /* @__PURE__ */ t("span", { children: m })
1503
1543
  ] }),
1504
- t.status === "completed" && n === "denied" && /* @__PURE__ */ r("div", { role: "alert", className: "mt-1 flex items-start gap-1.5 text-[12px] leading-4 text-foreground", children: [
1505
- /* @__PURE__ */ e(Cr, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
1506
- /* @__PURE__ */ e("span", { children: "This link expired. Refresh the tray to sign the file again." })
1544
+ e.status === "completed" && n === "denied" && /* @__PURE__ */ r("div", { role: "alert", className: "mt-1 flex items-start gap-1.5 text-[12px] leading-4 text-foreground", children: [
1545
+ /* @__PURE__ */ t(Nr, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
1546
+ /* @__PURE__ */ t("span", { children: "This link expired. Refresh the tray to sign the file again." })
1507
1547
  ] }),
1508
1548
  p && /* @__PURE__ */ r("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
1509
- d,
1510
- (t.progress !== null || t.rowsProcessed !== void 0) && /* @__PURE__ */ r(j, { children: [
1549
+ l,
1550
+ (e.progress !== null || e.rowsProcessed !== void 0) && /* @__PURE__ */ r(j, { children: [
1511
1551
  " ",
1512
1552
  f,
1513
1553
  " ",
1514
- /* @__PURE__ */ e("span", { className: "tabular-nums", children: t.progress === null ? `${t.rowsProcessed.toLocaleString()} rows processed` : `${t.progress}% complete` })
1554
+ /* @__PURE__ */ t("span", { className: "tabular-nums", children: e.progress === null ? `${e.rowsProcessed.toLocaleString()} rows processed` : `${e.progress}% complete` })
1515
1555
  ] }),
1516
- t.progress !== null && /* @__PURE__ */ e(wr, { value: t.progress, className: "mt-1.5 h-1" })
1556
+ e.progress !== null && /* @__PURE__ */ t(Sr, { value: e.progress, className: "mt-1.5 h-1" })
1517
1557
  ] }),
1518
- t.status === "failed" && /* @__PURE__ */ r(j, { children: [
1558
+ e.status === "failed" && /* @__PURE__ */ r(j, { children: [
1519
1559
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
1520
- /* @__PURE__ */ e("span", { children: "Failed" }),
1560
+ /* @__PURE__ */ t("span", { children: "Failed" }),
1521
1561
  f,
1522
- /* @__PURE__ */ e("span", { children: h })
1562
+ /* @__PURE__ */ t("span", { children: m })
1523
1563
  ] }),
1524
- /* @__PURE__ */ e("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: t.error || "Export failed" })
1564
+ /* @__PURE__ */ t("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: e.error || "Export failed" })
1525
1565
  ] })
1526
1566
  ] })
1527
1567
  ] });
1528
1568
  }
1529
- function Oa() {
1530
- const { authToken: t, tokenProps: a } = He(), i = ue((x) => x.activeExports), { clearCompleted: n, removeExport: l, updateExport: s } = Tt(), [c, p] = I(!1), [d, m] = I(!1), o = Array.from(i.values()).sort(
1569
+ function za() {
1570
+ const { authToken: e, tokenProps: a } = Ge(), o = he((x) => x.activeExports), { clearCompleted: n, removeExport: i, updateExport: s } = Vt(), [c, p] = I(!1), [l, u] = I(!1), d = Array.from(o.values()).sort(
1531
1571
  (x, D) => D.startedAt.getTime() - x.startedAt.getTime()
1532
- ), h = o.some(
1572
+ ), m = d.some(
1533
1573
  (x) => x.status === "completed" || x.status === "failed"
1534
- ), u = G(async () => {
1535
- const x = a == null ? void 0 : a.apiServiceUrl, D = t == null ? void 0 : t.accessToken;
1574
+ ), h = H(async () => {
1575
+ const x = a == null ? void 0 : a.apiServiceUrl, D = e == null ? void 0 : e.accessToken;
1536
1576
  if (!(!x || !D)) {
1537
1577
  p(!0);
1538
1578
  try {
1539
- const S = Array.from(i.values());
1579
+ const S = Array.from(o.values());
1540
1580
  await Promise.all(
1541
1581
  S.map(async (C) => {
1542
1582
  try {
1543
- const w = await Bt(x, D, C.id);
1583
+ const w = await Tt(x, D, C.id);
1544
1584
  let E;
1545
1585
  if (w.status === "completed")
1546
1586
  try {
1547
- E = await ze(
1587
+ E = await $e(
1548
1588
  x,
1549
1589
  D,
1550
1590
  C.id
@@ -1552,7 +1592,7 @@ function Oa() {
1552
1592
  } catch (V) {
1553
1593
  console.error(`Failed to get download URL for ${C.id}:`, V);
1554
1594
  }
1555
- s(C.id, gt(w, E));
1595
+ s(C.id, bt(w, E));
1556
1596
  } catch (w) {
1557
1597
  s(C.id, { downloadUrl: void 0 }), console.error(`Failed to refresh export ${C.id}:`, w);
1558
1598
  }
@@ -1563,94 +1603,94 @@ function Oa() {
1563
1603
  }
1564
1604
  }
1565
1605
  }, [
1566
- i,
1567
- t == null ? void 0 : t.accessToken,
1606
+ o,
1607
+ e == null ? void 0 : e.accessToken,
1568
1608
  a == null ? void 0 : a.apiServiceUrl,
1569
1609
  s
1570
- ]), f = G(async () => {
1571
- const x = a == null ? void 0 : a.apiServiceUrl, D = t == null ? void 0 : t.accessToken;
1610
+ ]), f = H(async () => {
1611
+ const x = a == null ? void 0 : a.apiServiceUrl, D = e == null ? void 0 : e.accessToken;
1572
1612
  if (!x || !D) {
1573
1613
  n();
1574
1614
  return;
1575
1615
  }
1576
- m(!0);
1616
+ u(!0);
1577
1617
  try {
1578
- const S = o.filter(
1618
+ const S = d.filter(
1579
1619
  (w) => w.status === "completed" || w.status === "failed"
1580
1620
  ), C = await Promise.allSettled(
1581
- S.map(async (w) => (await bt(x, D, w.id), w.id))
1621
+ S.map(async (w) => (await vt(x, D, w.id), w.id))
1582
1622
  );
1583
1623
  for (const w of C)
1584
- w.status === "fulfilled" ? l(w.value) : console.error("Failed to delete export:", w.reason);
1624
+ w.status === "fulfilled" ? i(w.value) : console.error("Failed to delete export:", w.reason);
1585
1625
  } finally {
1586
- m(!1);
1626
+ u(!1);
1587
1627
  }
1588
1628
  }, [
1589
- o,
1629
+ d,
1590
1630
  a == null ? void 0 : a.apiServiceUrl,
1591
- t == null ? void 0 : t.accessToken,
1631
+ e == null ? void 0 : e.accessToken,
1592
1632
  n,
1593
- l
1594
- ]), g = G(
1633
+ i
1634
+ ]), g = H(
1595
1635
  async (x) => {
1596
- const D = a == null ? void 0 : a.apiServiceUrl, S = t == null ? void 0 : t.accessToken;
1636
+ const D = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
1597
1637
  if (D && S)
1598
1638
  try {
1599
- await bt(D, S, x), l(x);
1639
+ await vt(D, S, x), i(x);
1600
1640
  return;
1601
1641
  } catch (C) {
1602
1642
  console.error(`Failed to cancel export ${x}:`, C);
1603
1643
  }
1604
- l(x);
1644
+ i(x);
1605
1645
  },
1606
- [a == null ? void 0 : a.apiServiceUrl, t == null ? void 0 : t.accessToken, l]
1607
- ), k = G(
1646
+ [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, i]
1647
+ ), k = H(
1608
1648
  async (x) => {
1609
1649
  if (x.downloadUrl)
1610
1650
  return window.open(x.downloadUrl, "_blank"), "opened";
1611
- const D = a == null ? void 0 : a.apiServiceUrl, S = t == null ? void 0 : t.accessToken;
1651
+ const D = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
1612
1652
  if (!D || !S) return "denied";
1613
1653
  try {
1614
- const C = await ze(D, S, x.id);
1654
+ const C = await $e(D, S, x.id);
1615
1655
  return s(x.id, { downloadUrl: C }), window.open(C, "_blank"), "opened";
1616
1656
  } catch (C) {
1617
1657
  return console.error(`Failed to get download URL for ${x.id}:`, C), s(x.id, { downloadUrl: void 0 }), "denied";
1618
1658
  }
1619
1659
  },
1620
- [a == null ? void 0 : a.apiServiceUrl, t == null ? void 0 : t.accessToken, s]
1660
+ [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, s]
1621
1661
  );
1622
- return o.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
1623
- /* @__PURE__ */ e("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ e(va, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
1624
- /* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: "No exports yet" }),
1625
- /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "Large exports run in the background and land here." })
1662
+ return d.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
1663
+ /* @__PURE__ */ t("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ t(Ca, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
1664
+ /* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: "No exports yet" }),
1665
+ /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Large exports run in the background and land here." })
1626
1666
  ] }) : /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
1627
1667
  /* @__PURE__ */ r("div", { className: "flex h-8 items-center gap-2 border-b border-border px-3", children: [
1628
- /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Exports" }),
1629
- /* @__PURE__ */ e("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: o.length }),
1668
+ /* @__PURE__ */ t("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Exports" }),
1669
+ /* @__PURE__ */ t("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: d.length }),
1630
1670
  /* @__PURE__ */ r("div", { className: "ml-auto flex items-center gap-0.5", children: [
1631
- h && /* @__PURE__ */ e(
1671
+ m && /* @__PURE__ */ t(
1632
1672
  T,
1633
1673
  {
1634
1674
  variant: "ghost",
1635
1675
  size: "xs",
1636
1676
  className: "h-6 px-1.5 text-[12px] text-muted-foreground hover:text-foreground",
1637
1677
  onClick: f,
1638
- disabled: d,
1639
- children: d ? "Clearing" : "Clear all"
1678
+ disabled: l,
1679
+ children: l ? "Clearing" : "Clear all"
1640
1680
  }
1641
1681
  ),
1642
- /* @__PURE__ */ e(
1682
+ /* @__PURE__ */ t(
1643
1683
  T,
1644
1684
  {
1645
1685
  variant: "ghost",
1646
1686
  size: "xs",
1647
1687
  className: "h-6 w-6 px-0 text-muted-foreground hover:text-foreground",
1648
- onClick: u,
1688
+ onClick: h,
1649
1689
  disabled: c,
1650
1690
  title: "Refresh status",
1651
1691
  "aria-label": "Refresh status",
1652
- children: /* @__PURE__ */ e(
1653
- Vt,
1692
+ children: /* @__PURE__ */ t(
1693
+ Rt,
1654
1694
  {
1655
1695
  strokeWidth: 1.75,
1656
1696
  className: `h-3.5 w-3.5 ${c ? "animate-spin" : ""}`
@@ -1660,8 +1700,8 @@ function Oa() {
1660
1700
  )
1661
1701
  ] })
1662
1702
  ] }),
1663
- /* @__PURE__ */ e("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y divide-border/70", children: o.map((x) => /* @__PURE__ */ e(
1664
- Ma,
1703
+ /* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y divide-border/70", children: d.map((x) => /* @__PURE__ */ t(
1704
+ _a,
1665
1705
  {
1666
1706
  export: x,
1667
1707
  onRemove: g,
@@ -1671,23 +1711,23 @@ function Oa() {
1671
1711
  )) }) })
1672
1712
  ] });
1673
1713
  }
1674
- function Xn({
1675
- variant: t
1714
+ function ts({
1715
+ variant: e
1676
1716
  }) {
1677
- const a = ue((d) => d.activeExports), i = Nr(), n = a.size > 0, l = Array.from(a.values()).some(
1678
- (d) => d.status === "completed" || d.status === "failed"
1679
- ), c = i > 0 ? i > 9 ? "9+" : String(i) : null;
1680
- return /* @__PURE__ */ r(Ue, { children: [
1681
- /* @__PURE__ */ e(Pe, { asChild: !0, children: /* @__PURE__ */ r(
1717
+ const a = he((l) => l.activeExports), o = Dr(), n = a.size > 0, i = Array.from(a.values()).some(
1718
+ (l) => l.status === "completed" || l.status === "failed"
1719
+ ), c = o > 0 ? o > 9 ? "9+" : String(o) : null;
1720
+ return /* @__PURE__ */ r(Pe, { children: [
1721
+ /* @__PURE__ */ t(Me, { asChild: !0, children: /* @__PURE__ */ r(
1682
1722
  T,
1683
1723
  {
1684
- variant: t ?? "ghost",
1724
+ variant: e ?? "ghost",
1685
1725
  size: "xs",
1686
1726
  className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
1687
1727
  "aria-label": "Export notifications",
1688
1728
  children: [
1689
- /* @__PURE__ */ e(Sr, { className: "h-3.5 w-3.5" }),
1690
- n && /* @__PURE__ */ e(
1729
+ /* @__PURE__ */ t(kr, { className: "h-3.5 w-3.5" }),
1730
+ n && /* @__PURE__ */ t(
1691
1731
  "span",
1692
1732
  {
1693
1733
  className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${c ? "-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"}`,
@@ -1697,36 +1737,36 @@ function Xn({
1697
1737
  ]
1698
1738
  }
1699
1739
  ) }),
1700
- /* @__PURE__ */ e(Me, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ e(Oa, {}) })
1740
+ /* @__PURE__ */ t(Oe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(za, {}) })
1701
1741
  ] });
1702
1742
  }
1703
- function _a(t) {
1704
- if (t)
1743
+ function $a(e) {
1744
+ if (e)
1705
1745
  return {
1706
- renamed: t.type === "rename" ? { oldId: t.oldId, newId: t.newId } : void 0,
1707
- removedControlId: t.type === "remove" ? t.controlId : void 0,
1708
- cardBindingsById: t.type === "add" || t.type === "update" ? t.cardBindingsById : void 0,
1709
- affectedBindingControlIds: t.type === "add" || t.type === "update" ? t.affectedBindingControlIds : void 0
1746
+ renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
1747
+ removedControlId: e.type === "remove" ? e.controlId : void 0,
1748
+ cardBindingsById: e.type === "add" || e.type === "update" ? e.cardBindingsById : void 0,
1749
+ affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
1710
1750
  };
1711
1751
  }
1712
- function za({
1713
- open: t,
1752
+ function ja({
1753
+ open: e,
1714
1754
  onOpenChange: a,
1715
- trigger: i,
1755
+ trigger: o,
1716
1756
  showTrigger: n = !0,
1717
- initialMode: l = "manage"
1757
+ initialMode: i = "manage"
1718
1758
  }) {
1719
- const s = l === "create", {
1759
+ const s = i === "create", {
1720
1760
  forceClose: c,
1721
1761
  handleOpenChange: p,
1722
- isCreateFlowActive: d,
1723
- preventPassiveDismissDuringCreate: m,
1724
- resolvedOpen: o,
1725
- setIsCreateFlowActive: h
1726
- } = Mt({
1727
- open: t,
1762
+ isCreateFlowActive: l,
1763
+ preventPassiveDismissDuringCreate: u,
1764
+ resolvedOpen: d,
1765
+ setIsCreateFlowActive: m
1766
+ } = _t({
1767
+ open: e,
1728
1768
  onOpenChange: a,
1729
- initialCreateFlowActive: l === "create",
1769
+ initialCreateFlowActive: i === "create",
1730
1770
  // Dialog mode renders a built-in X close button — allow explicit
1731
1771
  // closes through `handleOpenChange`. Popover mode has no X; its
1732
1772
  // only close-via-trigger path is a re-click that would silently
@@ -1734,16 +1774,16 @@ function za({
1734
1774
  // create and make consumers use `forceClose()` from a dedicated
1735
1775
  // button.
1736
1776
  dismissMode: n ? "passive" : "explicit-only"
1737
- }), u = P((v) => v.dashboard), { setDashboardControlsModel: f } = be(), { participants: g } = Dr(qt(u)), k = Array.from(
1777
+ }), h = L((v) => v.dashboard), { setDashboardControlsModel: f } = be(), { participants: g } = Er(Qt(h)), k = Array.from(
1738
1778
  new Map(
1739
1779
  g.flatMap(
1740
- (v) => v.fieldChoices.map((B) => {
1780
+ (v) => v.fieldChoices.map((U) => {
1741
1781
  var F;
1742
1782
  return [
1743
- B.value,
1783
+ U.value,
1744
1784
  {
1745
- option: B,
1746
- target: (F = v.fieldTargetMap) == null ? void 0 : F[B.value]
1785
+ option: U,
1786
+ target: (F = v.fieldTargetMap) == null ? void 0 : F[U.value]
1747
1787
  }
1748
1788
  ];
1749
1789
  })
@@ -1752,102 +1792,102 @@ function za({
1752
1792
  ), x = Array.from(
1753
1793
  new Map(
1754
1794
  g.flatMap(
1755
- (v) => v.metricChoices.map((B) => {
1795
+ (v) => v.metricChoices.map((U) => {
1756
1796
  var F;
1757
1797
  return [
1758
- B.value,
1798
+ U.value,
1759
1799
  {
1760
- option: B,
1761
- target: (F = v.metricTargetMap) == null ? void 0 : F[B.value]
1800
+ option: U,
1801
+ target: (F = v.metricTargetMap) == null ? void 0 : F[U.value]
1762
1802
  }
1763
1803
  ];
1764
1804
  })
1765
1805
  )
1766
1806
  ).values()
1767
- ), D = Kt({
1768
- ...u || {},
1807
+ ), D = Yt({
1808
+ ...h || {},
1769
1809
  controls: []
1770
- }), S = kr(u), C = (v, B, F) => {
1810
+ }), S = Ar(h), C = (v, U, F) => {
1771
1811
  f(
1772
1812
  v,
1773
- B,
1774
- _a(F)
1813
+ U,
1814
+ $a(F)
1775
1815
  );
1776
- }, w = G(() => {
1816
+ }, w = H(() => {
1777
1817
  if (s) {
1778
1818
  c();
1779
1819
  return;
1780
1820
  }
1781
- h(!1);
1782
- }, [s, c, h]), E = /* @__PURE__ */ e(
1783
- Ot,
1821
+ m(!1);
1822
+ }, [s, c, m]), E = /* @__PURE__ */ t(
1823
+ zt,
1784
1824
  {
1785
1825
  scope: "dashboard",
1786
- controls: u.controls || [],
1826
+ controls: h.controls || [],
1787
1827
  reservedControlIds: D,
1788
- defaultValues: u.defaultControlValues || {},
1789
- usageByControlId: Er(u),
1828
+ defaultValues: h.defaultControlValues || {},
1829
+ usageByControlId: Ir(h),
1790
1830
  availableFieldChoices: k,
1791
1831
  availableMetricChoices: x,
1792
1832
  structuralParticipants: g,
1793
1833
  structuralParticipantIdsByControlId: S,
1794
- initialCreateFlow: l === "create",
1795
- onCreateFlowActiveChange: h,
1834
+ initialCreateFlow: i === "create",
1835
+ onCreateFlowActiveChange: m,
1796
1836
  onCreateFlowComplete: w,
1797
1837
  onChange: C,
1798
1838
  emptyMessage: "No dashboard controls yet."
1799
1839
  }
1800
- ), V = d ? "Add dashboard control" : "Dashboard Controls", b = /* @__PURE__ */ r(j, { children: [
1840
+ ), V = l ? "Add dashboard control" : "Dashboard Controls", b = /* @__PURE__ */ r(j, { children: [
1801
1841
  /* @__PURE__ */ r("div", { className: "space-y-1", children: [
1802
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
1803
- /* @__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." })
1842
+ /* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
1843
+ /* @__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." })
1804
1844
  ] }),
1805
1845
  E
1806
1846
  ] });
1807
- return n ? /* @__PURE__ */ r(Ue, { open: o, onOpenChange: p, children: [
1808
- /* @__PURE__ */ e(Pe, { asChild: !0, children: i || /* @__PURE__ */ r(T, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
1809
- /* @__PURE__ */ e(kt, { className: "mr-2 h-4 w-4" }),
1847
+ return n ? /* @__PURE__ */ r(Pe, { open: d, onOpenChange: p, children: [
1848
+ /* @__PURE__ */ t(Me, { asChild: !0, children: o || /* @__PURE__ */ r(T, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
1849
+ /* @__PURE__ */ t(At, { className: "mr-2 h-4 w-4" }),
1810
1850
  "Controls"
1811
1851
  ] }) }),
1812
- /* @__PURE__ */ e(
1813
- Me,
1852
+ /* @__PURE__ */ t(
1853
+ Oe,
1814
1854
  {
1815
1855
  className: "w-[620px] max-w-[95vw] space-y-4",
1816
1856
  align: "end",
1817
- onEscapeKeyDown: m,
1818
- onPointerDownOutside: m,
1857
+ onEscapeKeyDown: u,
1858
+ onPointerDownOutside: u,
1819
1859
  children: b
1820
1860
  }
1821
1861
  )
1822
- ] }) : /* @__PURE__ */ e(De, { open: o, onOpenChange: p, children: /* @__PURE__ */ r(
1862
+ ] }) : /* @__PURE__ */ t(De, { open: d, onOpenChange: p, children: /* @__PURE__ */ r(
1823
1863
  ke,
1824
1864
  {
1825
1865
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
1826
- onEscapeKeyDown: m,
1827
- onPointerDownOutside: m,
1866
+ onEscapeKeyDown: u,
1867
+ onPointerDownOutside: u,
1828
1868
  children: [
1829
1869
  /* @__PURE__ */ r(
1830
- ct,
1870
+ ut,
1831
1871
  {
1832
- className: d ? "space-y-0" : void 0,
1872
+ className: l ? "space-y-0" : void 0,
1833
1873
  children: [
1834
- /* @__PURE__ */ e(Ee, { className: "text-[15px]", children: V }),
1835
- /* @__PURE__ */ e(
1836
- ut,
1874
+ /* @__PURE__ */ t(Ee, { className: "text-[15px]", children: V }),
1875
+ /* @__PURE__ */ t(
1876
+ ht,
1837
1877
  {
1838
- className: d ? "sr-only" : "text-[13px]",
1839
- children: d ? "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."
1878
+ className: l ? "sr-only" : "text-[13px]",
1879
+ 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."
1840
1880
  }
1841
1881
  )
1842
1882
  ]
1843
1883
  }
1844
1884
  ),
1845
- /* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: E })
1885
+ /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: E })
1846
1886
  ]
1847
1887
  }
1848
1888
  ) });
1849
1889
  }
1850
- const $a = [
1890
+ const Wa = [
1851
1891
  "enum",
1852
1892
  "multi_enum",
1853
1893
  "text",
@@ -1855,89 +1895,89 @@ const $a = [
1855
1895
  "boolean",
1856
1896
  "date"
1857
1897
  ];
1858
- function ja({
1859
- open: t,
1898
+ function Ha({
1899
+ open: e,
1860
1900
  onOpenChange: a,
1861
- initialMode: i = "manage"
1901
+ initialMode: o = "manage"
1862
1902
  }) {
1863
1903
  var b;
1864
- const n = i === "create", {
1865
- forceClose: l,
1904
+ const n = o === "create", {
1905
+ forceClose: i,
1866
1906
  handleOpenChange: s,
1867
1907
  isCreateFlowActive: c,
1868
1908
  preventPassiveDismissDuringCreate: p,
1869
- resolvedOpen: d,
1870
- setIsCreateFlowActive: m
1871
- } = Mt({
1872
- open: t,
1909
+ resolvedOpen: l,
1910
+ setIsCreateFlowActive: u
1911
+ } = _t({
1912
+ open: e,
1873
1913
  onOpenChange: a,
1874
- initialCreateFlowActive: i === "create",
1914
+ initialCreateFlowActive: o === "create",
1875
1915
  dismissMode: "explicit-only"
1876
- }), o = P((v) => v.dashboard), h = P((v) => v.selectedSheetId), { setDashboardInputs: u } = be(), f = (b = o.sheets) == null ? void 0 : b.find(
1877
- (v) => v.id === h
1878
- ), g = (f == null ? void 0 : f.kind) === "document" && !!f.document, k = ee(
1879
- () => g && (f != null && f.document) ? Ar(o, f.id) : [],
1880
- [o, g, f == null ? void 0 : f.document, f == null ? void 0 : f.id]
1881
- ), x = ee(
1916
+ }), d = L((v) => v.dashboard), m = L((v) => v.selectedSheetId), { setDashboardInputs: h } = be(), f = (b = d.sheets) == null ? void 0 : b.find(
1917
+ (v) => v.id === m
1918
+ ), g = (f == null ? void 0 : f.kind) === "document" && !!f.document, k = Z(
1919
+ () => g && (f != null && f.document) ? Fr(d, f.id) : [],
1920
+ [d, g, f == null ? void 0 : f.document, f == null ? void 0 : f.id]
1921
+ ), x = Z(
1882
1922
  () => k.filter(
1883
1923
  (v) => v.kind === "control"
1884
1924
  ),
1885
1925
  [k]
1886
- ), D = ee(
1926
+ ), D = Z(
1887
1927
  () => x.map((v) => v.control),
1888
1928
  [x]
1889
- ), S = ee(
1890
- () => Ha(D),
1929
+ ), S = Z(
1930
+ () => qa(D),
1891
1931
  [D]
1892
- ), C = ee(
1893
- () => Wa(o),
1894
- [o]
1895
- ), w = G(() => {
1932
+ ), C = Z(
1933
+ () => Ga(d),
1934
+ [d]
1935
+ ), w = H(() => {
1896
1936
  if (n) {
1897
- l();
1937
+ i();
1898
1938
  return;
1899
1939
  }
1900
- m(!1);
1901
- }, [n, l, m]), E = G(
1902
- (v, B, F) => {
1903
- !g || !(f != null && f.document) || u(
1904
- qa({
1905
- allInputs: o.inputs || [],
1940
+ u(!1);
1941
+ }, [n, i, u]), E = H(
1942
+ (v, U, F) => {
1943
+ !g || !(f != null && f.document) || h(
1944
+ Qa({
1945
+ allInputs: d.inputs || [],
1906
1946
  documentSheetId: f.id,
1907
1947
  currentDocumentInputs: k,
1908
1948
  nextControls: v,
1909
- nextDefaultValues: B,
1949
+ nextDefaultValues: U,
1910
1950
  change: F
1911
1951
  })
1912
1952
  );
1913
1953
  },
1914
1954
  [
1915
- o.inputs,
1955
+ d.inputs,
1916
1956
  k,
1917
1957
  g,
1918
1958
  f,
1919
- u
1959
+ h
1920
1960
  ]
1921
1961
  );
1922
- return !g || !(f != null && f.document) ? null : /* @__PURE__ */ e(De, { open: d, onOpenChange: s, children: /* @__PURE__ */ r(
1962
+ return !g || !(f != null && f.document) ? null : /* @__PURE__ */ t(De, { open: l, onOpenChange: s, children: /* @__PURE__ */ r(
1923
1963
  ke,
1924
1964
  {
1925
1965
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
1926
1966
  onEscapeKeyDown: p,
1927
1967
  onPointerDownOutside: p,
1928
1968
  children: [
1929
- /* @__PURE__ */ r(ct, { className: c ? "space-y-0" : void 0, children: [
1930
- /* @__PURE__ */ e(Ee, { className: "text-[15px]", children: c ? "Add document control" : "Document Controls" }),
1931
- /* @__PURE__ */ e(
1932
- ut,
1969
+ /* @__PURE__ */ r(ut, { className: c ? "space-y-0" : void 0, children: [
1970
+ /* @__PURE__ */ t(Ee, { className: "text-[15px]", children: c ? "Add document control" : "Document Controls" }),
1971
+ /* @__PURE__ */ t(
1972
+ ht,
1933
1973
  {
1934
1974
  className: c ? "sr-only" : "text-[13px]",
1935
1975
  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."
1936
1976
  }
1937
1977
  )
1938
1978
  ] }),
1939
- /* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ e(
1940
- Ot,
1979
+ /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ t(
1980
+ zt,
1941
1981
  {
1942
1982
  scope: "dashboard",
1943
1983
  controls: D,
@@ -1948,9 +1988,9 @@ function ja({
1948
1988
  availableMetricChoices: [],
1949
1989
  structuralParticipants: [],
1950
1990
  structuralParticipantIdsByControlId: {},
1951
- allowedControlTypes: $a,
1952
- initialCreateFlow: i === "create",
1953
- onCreateFlowActiveChange: m,
1991
+ allowedControlTypes: Wa,
1992
+ initialCreateFlow: o === "create",
1993
+ onCreateFlowActiveChange: u,
1954
1994
  onCreateFlowComplete: w,
1955
1995
  onChange: E,
1956
1996
  emptyMessage: "No document controls yet."
@@ -1960,86 +2000,86 @@ function ja({
1960
2000
  }
1961
2001
  ) });
1962
2002
  }
1963
- function Wa(t) {
1964
- return (t.controls || []).map((a) => a.id);
2003
+ function Ga(e) {
2004
+ return (e.controls || []).map((a) => a.id);
1965
2005
  }
1966
- function Ha(t) {
2006
+ function qa(e) {
1967
2007
  const a = {};
1968
- for (const i of t)
1969
- i.defaultValue !== void 0 && (a[i.id] = i.defaultValue);
2008
+ for (const o of e)
2009
+ o.defaultValue !== void 0 && (a[o.id] = o.defaultValue);
1970
2010
  return a;
1971
2011
  }
1972
- function Ga(t, a) {
1973
- return a ? Object.prototype.hasOwnProperty.call(a, t.id) ? {
1974
- ...t,
1975
- defaultValue: a[t.id]
1976
- } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 };
2012
+ function Ka(e, a) {
2013
+ return a ? Object.prototype.hasOwnProperty.call(a, e.id) ? {
2014
+ ...e,
2015
+ defaultValue: a[e.id]
2016
+ } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 };
1977
2017
  }
1978
- function qa({
1979
- allInputs: t,
2018
+ function Qa({
2019
+ allInputs: e,
1980
2020
  documentSheetId: a,
1981
- currentDocumentInputs: i,
2021
+ currentDocumentInputs: o,
1982
2022
  nextControls: n,
1983
- nextDefaultValues: l,
2023
+ nextDefaultValues: i,
1984
2024
  change: s
1985
2025
  }) {
1986
2026
  const c = new Map(
1987
- n.map((u) => [
1988
- u.id,
1989
- Ga(u, l)
2027
+ n.map((h) => [
2028
+ h.id,
2029
+ Ka(h, i)
1990
2030
  ])
1991
- ), p = (s == null ? void 0 : s.type) === "rename" ? { oldId: s.oldId, newId: s.newId } : null, d = /* @__PURE__ */ new Set(), m = [];
1992
- for (const u of i) {
1993
- if (u.kind !== "control") {
1994
- m.push(u);
2031
+ ), p = (s == null ? void 0 : s.type) === "rename" ? { oldId: s.oldId, newId: s.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
2032
+ for (const h of o) {
2033
+ if (h.kind !== "control") {
2034
+ u.push(h);
1995
2035
  continue;
1996
2036
  }
1997
- const f = c.get(u.control.id) || ((p == null ? void 0 : p.oldId) === u.control.id ? c.get(p.newId) : void 0);
2037
+ const f = c.get(h.control.id) || ((p == null ? void 0 : p.oldId) === h.control.id ? c.get(p.newId) : void 0);
1998
2038
  if (!f)
1999
2039
  continue;
2000
- d.add(f.id);
2001
- const g = Qt(
2040
+ l.add(f.id);
2041
+ const g = Xt(
2002
2042
  f.id,
2003
- [...t, ...m].filter(
2004
- (x) => x.id !== u.id
2043
+ [...e, ...u].filter(
2044
+ (x) => x.id !== h.id
2005
2045
  )
2006
2046
  ), k = f.id === g ? f : { ...f, id: g };
2007
- m.push({
2008
- ...u,
2047
+ u.push({
2048
+ ...h,
2009
2049
  label: k.label,
2010
2050
  variableName: g,
2011
2051
  requiredAtExecution: k.requiredAtExecution,
2012
2052
  control: k
2013
2053
  });
2014
2054
  }
2015
- for (const u of c.values())
2016
- d.has(u.id) || m.push(
2017
- Ir({
2018
- control: u,
2019
- existingInputs: [...t, ...m],
2055
+ for (const h of c.values())
2056
+ l.has(h.id) || u.push(
2057
+ Lr({
2058
+ control: h,
2059
+ existingInputs: [...e, ...u],
2020
2060
  sheetId: a
2021
2061
  })
2022
2062
  );
2023
- const o = new Set(
2024
- i.map((u) => u.id)
2063
+ const d = new Set(
2064
+ o.map((h) => h.id)
2025
2065
  );
2026
- return [...t.filter(
2027
- (u) => !o.has(u.id)
2028
- ), ...m];
2066
+ return [...e.filter(
2067
+ (h) => !d.has(h.id)
2068
+ ), ...u];
2029
2069
  }
2030
- function Ka({
2031
- showFilters: t,
2070
+ function Ya({
2071
+ showFilters: e,
2032
2072
  onShowFiltersChange: a,
2033
- pickerContent: i,
2073
+ pickerContent: o,
2034
2074
  settingsContent: n,
2035
- size: l = "default",
2075
+ size: i = "default",
2036
2076
  className: s,
2037
2077
  primaryButtonClassName: c,
2038
2078
  secondaryButtonClassName: p,
2039
- pickerContentClassName: d,
2040
- settingsContentClassName: m
2079
+ pickerContentClassName: l,
2080
+ settingsContentClassName: u
2041
2081
  }) {
2042
- const o = l === "toolbar", [h, u] = I(!1), f = tt("interactive");
2082
+ const d = i === "toolbar", [m, h] = I(!1), f = rt("interactive");
2043
2083
  return /* @__PURE__ */ r(
2044
2084
  "div",
2045
2085
  {
@@ -2048,12 +2088,12 @@ function Ka({
2048
2088
  // h-7 box (matches regular `size="xs"` buttons). Inner triggers
2049
2089
  // stretch to fill via `h-full`.
2050
2090
  "relative inline-flex items-stretch overflow-hidden rounded-control border border-input bg-background",
2051
- o ? "h-8" : "h-7",
2091
+ d ? "h-8" : "h-7",
2052
2092
  s
2053
2093
  ),
2054
2094
  children: [
2055
- /* @__PURE__ */ r(Ue, { open: t, onOpenChange: a, children: [
2056
- /* @__PURE__ */ e(Pe, { asChild: !0, children: /* @__PURE__ */ r(
2095
+ /* @__PURE__ */ r(Pe, { open: e, onOpenChange: a, children: [
2096
+ /* @__PURE__ */ t(Me, { asChild: !0, children: /* @__PURE__ */ r(
2057
2097
  T,
2058
2098
  {
2059
2099
  variant: "ghost",
@@ -2063,27 +2103,27 @@ function Ka({
2063
2103
  c
2064
2104
  ),
2065
2105
  children: [
2066
- t ? /* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(Rt, { className: "h-3.5 w-3.5" }),
2106
+ e ? /* @__PURE__ */ t(ua, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Pt, { className: "h-3.5 w-3.5" }),
2067
2107
  "Filter"
2068
2108
  ]
2069
2109
  }
2070
2110
  ) }),
2071
- /* @__PURE__ */ e(
2072
- Me,
2111
+ /* @__PURE__ */ t(
2112
+ Oe,
2073
2113
  {
2074
2114
  align: "end",
2075
2115
  sideOffset: 6,
2076
2116
  className: K(
2077
2117
  "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)]",
2078
- d
2118
+ l
2079
2119
  ),
2080
2120
  style: f.contentStyle,
2081
- children: i
2121
+ children: o
2082
2122
  }
2083
2123
  )
2084
2124
  ] }),
2085
- /* @__PURE__ */ r(Ue, { open: h, onOpenChange: u, children: [
2086
- /* @__PURE__ */ e(Pe, { asChild: !0, children: /* @__PURE__ */ e(
2125
+ /* @__PURE__ */ r(Pe, { open: m, onOpenChange: h, children: [
2126
+ /* @__PURE__ */ t(Me, { asChild: !0, children: /* @__PURE__ */ t(
2087
2127
  T,
2088
2128
  {
2089
2129
  variant: "ghost",
@@ -2093,20 +2133,20 @@ function Ka({
2093
2133
  p
2094
2134
  ),
2095
2135
  "aria-label": "Filter and control actions",
2096
- children: /* @__PURE__ */ e(Pt, { className: "h-3.5 w-3.5" })
2136
+ children: /* @__PURE__ */ t(Ot, { className: "h-3.5 w-3.5" })
2097
2137
  }
2098
2138
  ) }),
2099
- /* @__PURE__ */ e(
2100
- Me,
2139
+ /* @__PURE__ */ t(
2140
+ Oe,
2101
2141
  {
2102
2142
  align: "end",
2103
2143
  sideOffset: 6,
2104
2144
  className: K(
2105
2145
  "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)]",
2106
- m
2146
+ u
2107
2147
  ),
2108
2148
  style: f.contentStyle,
2109
- children: n(() => u(!1))
2149
+ children: n(() => h(!1))
2110
2150
  }
2111
2151
  )
2112
2152
  ] })
@@ -2114,107 +2154,107 @@ function Ka({
2114
2154
  }
2115
2155
  );
2116
2156
  }
2117
- function Qa() {
2118
- ca();
2119
- const t = P((d) => d.selectedSheetId), a = P((d) => d.selectedFrameId), i = P((d) => d.dashboard), n = P((d) => d.actions.getSelectedFrame), { setSelectedFrameId: l } = be(), { setCard: s } = Dt(), c = me((d) => d.card.dataSource);
2157
+ function Xa() {
2158
+ ha();
2159
+ const e = L((l) => l.selectedSheetId), a = L((l) => l.selectedFrameId), o = L((l) => l.dashboard), n = L((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = be(), { setCard: s } = Et(), c = me((l) => l.card.dataSource);
2120
2160
  return Y(() => {
2121
- var m, o;
2122
- let d = n();
2123
- if (!d) {
2124
- const h = (m = i == null ? void 0 : i.sheets) == null ? void 0 : m.find((f) => f.id === t), u = (o = h == null ? void 0 : h.frames) == null ? void 0 : o[0];
2125
- u && (l(u.id), d = u);
2161
+ var u, d;
2162
+ let l = n();
2163
+ if (!l) {
2164
+ const m = (u = o == null ? void 0 : o.sheets) == null ? void 0 : u.find((f) => f.id === e), h = (d = m == null ? void 0 : m.frames) == null ? void 0 : d[0];
2165
+ h && (i(h.id), l = h);
2126
2166
  }
2127
- if (d) {
2128
- const h = d.cards.find((u) => u.id === d.activeCardId);
2129
- h && s(h);
2167
+ if (l) {
2168
+ const m = l.cards.find((h) => h.id === l.activeCardId);
2169
+ m && s(m);
2130
2170
  }
2131
- }, [n, t, a, i, l, s]), {
2171
+ }, [n, e, a, o, i, s]), {
2132
2172
  hasEntities: !!(c != null && c.selectedEntities && c.selectedEntities.length > 0)
2133
2173
  };
2134
2174
  }
2135
- function Ya() {
2136
- const t = P((d) => d.dashboard), a = P(
2137
- (d) => d.semanticExecutionPayload
2138
- ), i = P((d) => d.actions.addFilter), { hasEntities: n } = Qa(), { isLoading: l } = Fr(), s = ee(
2139
- () => Yt(t, a),
2140
- [t, a]
2141
- ), p = !Xt(t.filters) && s.hasEligibleCards && !l;
2175
+ function Za() {
2176
+ const e = L((l) => l.dashboard), a = L(
2177
+ (l) => l.semanticExecutionPayload
2178
+ ), o = L((l) => l.actions.addFilter), { hasEntities: n } = Xa(), { isLoading: i } = Br(), s = Z(
2179
+ () => Zt(e, a),
2180
+ [e, a]
2181
+ ), p = !Jt(e.filters) && s.hasEligibleCards && !i;
2142
2182
  return /* @__PURE__ */ r("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
2143
- p && /* @__PURE__ */ e("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
2183
+ p && /* @__PURE__ */ t("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
2144
2184
  "button",
2145
2185
  {
2146
2186
  type: "button",
2147
- onClick: () => i(Zt()),
2187
+ onClick: () => o(er()),
2148
2188
  title: `Applies to ${s.eligibleCardCount} of ${s.totalCardCount} date-aware cards`,
2149
2189
  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",
2150
2190
  children: [
2151
- /* @__PURE__ */ e(xa, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2191
+ /* @__PURE__ */ t(ya, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2152
2192
  /* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col", children: [
2153
- /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
2154
- /* @__PURE__ */ e("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
2193
+ /* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
2194
+ /* @__PURE__ */ t("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
2155
2195
  ] })
2156
2196
  ]
2157
2197
  }
2158
2198
  ) }),
2159
2199
  !n && /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
2160
- /* @__PURE__ */ e(Lr, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
2161
- /* @__PURE__ */ e("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
2162
- /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
2200
+ /* @__PURE__ */ t(Ur, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
2201
+ /* @__PURE__ */ t("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
2202
+ /* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
2163
2203
  ] }),
2164
- n && /* @__PURE__ */ e("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ e(Br, { context: "filter" }) })
2204
+ n && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(Tr, { context: "filter" }) })
2165
2205
  ] });
2166
2206
  }
2167
- const yt = !1;
2168
- function Xa({
2169
- onAddFilter: t,
2207
+ const wt = !1;
2208
+ function Ja({
2209
+ onAddFilter: e,
2170
2210
  onAddControl: a,
2171
- onManageControls: i,
2211
+ onManageControls: o,
2172
2212
  onDismiss: n
2173
2213
  }) {
2174
- const l = P(
2214
+ const i = L(
2175
2215
  (p) => p.dashboard.filterLayout
2176
2216
  ), { setFilterLayout: s } = be();
2177
- l != null && l.displayMode;
2178
- const c = (l == null ? void 0 : l.toolbarWrap) ?? !1;
2179
- return l == null || l.showDownloadButton, /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
2217
+ i != null && i.displayMode;
2218
+ const c = (i == null ? void 0 : i.toolbarWrap) ?? !1;
2219
+ return i == null || i.showDownloadButton, /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
2180
2220
  /* @__PURE__ */ r("div", { className: "p-1", children: [
2181
- /* @__PURE__ */ e(
2182
- Ze,
2221
+ /* @__PURE__ */ t(
2222
+ Je,
2183
2223
  {
2184
- icon: Rt,
2224
+ icon: Pt,
2185
2225
  label: "Add filter",
2186
2226
  onClick: () => {
2187
- t(), n();
2227
+ e(), n();
2188
2228
  }
2189
2229
  }
2190
2230
  ),
2191
- /* @__PURE__ */ e(
2192
- Ze,
2231
+ /* @__PURE__ */ t(
2232
+ Je,
2193
2233
  {
2194
- icon: kt,
2234
+ icon: At,
2195
2235
  label: "Add control",
2196
2236
  onClick: () => {
2197
2237
  a(), n();
2198
2238
  }
2199
2239
  }
2200
2240
  ),
2201
- /* @__PURE__ */ e(
2202
- Ze,
2241
+ /* @__PURE__ */ t(
2242
+ Je,
2203
2243
  {
2204
- icon: Ut,
2244
+ icon: Mt,
2205
2245
  label: "Manage controls",
2206
2246
  onClick: () => {
2207
- i(), n();
2247
+ o(), n();
2208
2248
  }
2209
2249
  }
2210
2250
  )
2211
2251
  ] }),
2212
- /* @__PURE__ */ e("div", { className: "border-t border-border/60" }),
2252
+ /* @__PURE__ */ t("div", { className: "border-t border-border/60" }),
2213
2253
  /* @__PURE__ */ r("div", { className: "space-y-1 p-2", children: [
2214
- /* @__PURE__ */ e("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
2215
- yt,
2216
- /* @__PURE__ */ e(
2217
- Za,
2254
+ /* @__PURE__ */ t("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
2255
+ wt,
2256
+ /* @__PURE__ */ t(
2257
+ en,
2218
2258
  {
2219
2259
  id: "filter-display-wrap",
2220
2260
  label: "Wrap to multiple lines",
@@ -2222,92 +2262,92 @@ function Xa({
2222
2262
  onCheckedChange: (p) => s({ toolbarWrap: p === !0 })
2223
2263
  }
2224
2264
  ),
2225
- yt
2265
+ wt
2226
2266
  ] })
2227
2267
  ] });
2228
2268
  }
2229
- function Ze({
2230
- icon: t,
2269
+ function Je({
2270
+ icon: e,
2231
2271
  label: a,
2232
- onClick: i
2272
+ onClick: o
2233
2273
  }) {
2234
2274
  return /* @__PURE__ */ r(
2235
2275
  "button",
2236
2276
  {
2237
2277
  type: "button",
2238
- onClick: i,
2278
+ onClick: o,
2239
2279
  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",
2240
2280
  children: [
2241
- /* @__PURE__ */ e(t, { className: "h-3.5 w-3.5 text-muted-foreground" }),
2281
+ /* @__PURE__ */ t(e, { className: "h-3.5 w-3.5 text-muted-foreground" }),
2242
2282
  a
2243
2283
  ]
2244
2284
  }
2245
2285
  );
2246
2286
  }
2247
- function Za({
2248
- id: t,
2287
+ function en({
2288
+ id: e,
2249
2289
  label: a,
2250
- checked: i,
2290
+ checked: o,
2251
2291
  onCheckedChange: n
2252
2292
  }) {
2253
2293
  return /* @__PURE__ */ r("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: [
2254
- /* @__PURE__ */ e(dt, { id: t, checked: i, onCheckedChange: n }),
2255
- /* @__PURE__ */ e(
2294
+ /* @__PURE__ */ t(ct, { id: e, checked: o, onCheckedChange: n }),
2295
+ /* @__PURE__ */ t(
2256
2296
  Se,
2257
2297
  {
2258
- htmlFor: t,
2298
+ htmlFor: e,
2259
2299
  className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
2260
2300
  children: a
2261
2301
  }
2262
2302
  )
2263
2303
  ] });
2264
2304
  }
2265
- function Zn({
2266
- size: t,
2305
+ function rs({
2306
+ size: e,
2267
2307
  className: a,
2268
- primaryButtonClassName: i,
2308
+ primaryButtonClassName: o,
2269
2309
  secondaryButtonClassName: n,
2270
- pickerContentClassName: l,
2310
+ pickerContentClassName: i,
2271
2311
  settingsContentClassName: s
2272
2312
  }) {
2273
2313
  var V;
2274
- const [c, p] = I(null), d = P((b) => b.dashboard), m = P((b) => b.selectedSheetId), o = P((b) => b.showFilters), h = Tr((b) => b.setPanelOpen), u = P((b) => b.actions), { setDocumentInspectorTab: f, setShowFilters: g } = u, k = (V = d.sheets) == null ? void 0 : V.find(
2275
- (b) => b.id === m
2276
- ), x = Jt(k), D = G((b) => {
2314
+ const [c, p] = I(null), l = L((b) => b.dashboard), u = L((b) => b.selectedSheetId), d = L((b) => b.showFilters), m = Vr((b) => b.setPanelOpen), h = L((b) => b.actions), { setDocumentInspectorTab: f, setShowFilters: g } = h, k = (V = l.sheets) == null ? void 0 : V.find(
2315
+ (b) => b.id === u
2316
+ ), x = tr(k), D = H((b) => {
2277
2317
  window.setTimeout(() => {
2278
2318
  p(b);
2279
2319
  }, 0);
2280
- }, []), S = G(
2320
+ }, []), S = H(
2281
2321
  (b) => {
2282
- if (x && m) {
2283
- b && f(m, "inputs");
2322
+ if (x && u) {
2323
+ b && f(u, "inputs");
2284
2324
  return;
2285
2325
  }
2286
- b && h("dashboard", !1), g(b);
2326
+ b && m("dashboard", !1), g(b);
2287
2327
  },
2288
2328
  [
2289
2329
  x,
2290
- m,
2330
+ u,
2291
2331
  f,
2292
- h,
2332
+ m,
2293
2333
  g
2294
2334
  ]
2295
- ), C = G(() => {
2335
+ ), C = H(() => {
2296
2336
  S(!0);
2297
- }, [S]), w = G(() => {
2337
+ }, [S]), w = H(() => {
2298
2338
  D("create");
2299
- }, [D]), E = G(() => {
2339
+ }, [D]), E = H(() => {
2300
2340
  D("manage");
2301
2341
  }, [D]);
2302
2342
  return /* @__PURE__ */ r(j, { children: [
2303
- /* @__PURE__ */ e(
2304
- Ka,
2343
+ /* @__PURE__ */ t(
2344
+ Ya,
2305
2345
  {
2306
- showFilters: x ? !1 : o,
2346
+ showFilters: x ? !1 : d,
2307
2347
  onShowFiltersChange: S,
2308
- pickerContent: /* @__PURE__ */ e(Ya, {}),
2309
- settingsContent: (b) => /* @__PURE__ */ e(
2310
- Xa,
2348
+ pickerContent: /* @__PURE__ */ t(Za, {}),
2349
+ settingsContent: (b) => /* @__PURE__ */ t(
2350
+ Ja,
2311
2351
  {
2312
2352
  onAddFilter: C,
2313
2353
  onAddControl: w,
@@ -2315,16 +2355,16 @@ function Zn({
2315
2355
  onDismiss: b
2316
2356
  }
2317
2357
  ),
2318
- size: t,
2358
+ size: e,
2319
2359
  className: a,
2320
- primaryButtonClassName: i,
2360
+ primaryButtonClassName: o,
2321
2361
  secondaryButtonClassName: n,
2322
- pickerContentClassName: l,
2362
+ pickerContentClassName: i,
2323
2363
  settingsContentClassName: s
2324
2364
  }
2325
2365
  ),
2326
- c ? x ? /* @__PURE__ */ e(
2327
- ja,
2366
+ c ? x ? /* @__PURE__ */ t(
2367
+ Ha,
2328
2368
  {
2329
2369
  open: !0,
2330
2370
  onOpenChange: (b) => {
@@ -2332,8 +2372,8 @@ function Zn({
2332
2372
  },
2333
2373
  initialMode: c
2334
2374
  }
2335
- ) : /* @__PURE__ */ e(
2336
- za,
2375
+ ) : /* @__PURE__ */ t(
2376
+ ja,
2337
2377
  {
2338
2378
  open: !0,
2339
2379
  onOpenChange: (b) => {
@@ -2345,113 +2385,113 @@ function Zn({
2345
2385
  ) : null
2346
2386
  ] });
2347
2387
  }
2348
- function Ja({
2349
- disabled: t,
2388
+ function tn({
2389
+ disabled: e,
2350
2390
  briefingCount: a,
2351
- className: i,
2391
+ className: o,
2352
2392
  onClick: n
2353
2393
  }) {
2354
- const l = typeof a == "number" && a > 0;
2394
+ const i = typeof a == "number" && a > 0;
2355
2395
  return /* @__PURE__ */ r(
2356
2396
  T,
2357
2397
  {
2358
2398
  type: "button",
2359
2399
  size: "xs",
2360
2400
  variant: "outline",
2361
- disabled: t,
2362
- className: K("gap-1.5", i),
2401
+ disabled: e,
2402
+ className: K("gap-1.5", o),
2363
2403
  onClick: n,
2364
2404
  "aria-label": "Reports & briefings",
2365
2405
  children: [
2366
- /* @__PURE__ */ e(ya, { className: "h-3.5 w-3.5" }),
2406
+ /* @__PURE__ */ t(wa, { className: "h-3.5 w-3.5" }),
2367
2407
  "Reports & briefings",
2368
- l ? /* @__PURE__ */ e("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
2408
+ i ? /* @__PURE__ */ t("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
2369
2409
  ]
2370
2410
  }
2371
2411
  );
2372
2412
  }
2373
- const en = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", $t = "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", Re = "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";
2374
- function tn(t) {
2375
- return t === "dashboard" ? "This dashboard" : "Project";
2413
+ const rn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Wt = "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", Re = "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";
2414
+ function an(e) {
2415
+ return e === "dashboard" ? "This dashboard" : "Project";
2376
2416
  }
2377
- function rn(t) {
2378
- if (!t) return "Never";
2379
- const a = new Date(t);
2417
+ function nn(e) {
2418
+ if (!e) return "Never";
2419
+ const a = new Date(e);
2380
2420
  if (Number.isNaN(a.getTime())) return "Unknown";
2381
- const i = Date.now() - a.getTime(), n = Math.round(i / 6e4);
2421
+ const o = Date.now() - a.getTime(), n = Math.round(o / 6e4);
2382
2422
  if (n < 1) return "now";
2383
2423
  if (n < 60) return `${n}m ago`;
2384
- const l = Math.round(n / 60);
2385
- if (l < 24) return `${l}h ago`;
2386
- const s = Math.round(l / 24);
2424
+ const i = Math.round(n / 60);
2425
+ if (i < 24) return `${i}h ago`;
2426
+ const s = Math.round(i / 24);
2387
2427
  if (s < 7) return `${s}d ago`;
2388
2428
  const c = Math.round(s / 7);
2389
2429
  return c < 5 ? `${c}w ago` : `${Math.round(s / 30)}mo ago`;
2390
2430
  }
2391
- function an(t) {
2392
- return t.scheduleExpr ? fa(
2393
- t.scheduleExpr,
2394
- t.timezone || "UTC"
2431
+ function sn(e) {
2432
+ return e.scheduleExpr ? ba(
2433
+ e.scheduleExpr,
2434
+ e.timezone || "UTC"
2395
2435
  ) ?? "Invalid schedule" : "On demand";
2396
2436
  }
2397
- function nn(t) {
2398
- if (t.lastRunStatus) {
2399
- const a = t.lastRunStatus.toString().toUpperCase();
2400
- return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${t.lastRunStatus.toString().toLowerCase()}`;
2437
+ function on(e) {
2438
+ if (e.lastRunStatus) {
2439
+ const a = e.lastRunStatus.toString().toUpperCase();
2440
+ return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${e.lastRunStatus.toString().toLowerCase()}`;
2401
2441
  }
2402
2442
  return null;
2403
2443
  }
2404
- function jt(t) {
2405
- return t.hasActiveRun ? "Running" : t.lastRunStatus ? `Last run ${t.lastRunStatus.toString().toLowerCase()}` : "Idle";
2444
+ function Ht(e) {
2445
+ return e.hasActiveRun ? "Running" : e.lastRunStatus ? `Last run ${e.lastRunStatus.toString().toLowerCase()}` : "Idle";
2406
2446
  }
2407
- function sn(t) {
2408
- return t.source.type === "dashboard" ? "This dashboard" : "Project";
2447
+ function ln(e) {
2448
+ return e.source.type === "dashboard" ? "This dashboard" : "Project";
2409
2449
  }
2410
- function on({
2411
- activeView: t,
2450
+ function dn({
2451
+ activeView: e,
2412
2452
  onChange: a
2413
2453
  }) {
2414
- return /* @__PURE__ */ e(
2454
+ return /* @__PURE__ */ t(
2415
2455
  "div",
2416
2456
  {
2417
2457
  className: "flex shrink-0 items-center gap-1 rounded-control bg-muted p-0.5",
2418
2458
  role: "tablist",
2419
2459
  "aria-label": "Briefing source view",
2420
- children: ["dashboard", "project"].map((i) => {
2421
- const n = t === i;
2422
- return /* @__PURE__ */ e(
2460
+ children: ["dashboard", "project"].map((o) => {
2461
+ const n = e === o;
2462
+ return /* @__PURE__ */ t(
2423
2463
  "button",
2424
2464
  {
2425
2465
  type: "button",
2426
2466
  role: "tab",
2427
2467
  "aria-selected": n,
2428
- onClick: () => a(i),
2468
+ onClick: () => a(o),
2429
2469
  className: K(
2430
2470
  "h-6 rounded-[3px] px-2 text-[11px] transition-colors",
2431
2471
  n ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
2432
2472
  ),
2433
- children: tn(i)
2473
+ children: an(o)
2434
2474
  },
2435
- i
2475
+ o
2436
2476
  );
2437
2477
  })
2438
2478
  }
2439
2479
  );
2440
2480
  }
2441
- function ln({
2442
- briefings: t,
2481
+ function cn({
2482
+ briefings: e,
2443
2483
  dashboardLabel: a,
2444
- sourceView: i,
2484
+ sourceView: o,
2445
2485
  error: n,
2446
- loading: l,
2486
+ loading: i,
2447
2487
  onSourceViewChange: s,
2448
2488
  onClose: c,
2449
2489
  onEdit: p,
2450
- onNew: d,
2451
- canCreate: m,
2452
- canCreateScheduledReport: o,
2453
- analyticalBriefingsEnabled: h,
2454
- onRunNow: u,
2490
+ onNew: l,
2491
+ canCreate: u,
2492
+ canCreateScheduledReport: d,
2493
+ analyticalBriefingsEnabled: m,
2494
+ onRunNow: h,
2455
2495
  onTogglePause: f,
2456
2496
  onDelete: g,
2457
2497
  selectingId: k,
@@ -2460,7 +2500,7 @@ function ln({
2460
2500
  contentKind: S,
2461
2501
  hideHeader: C = !1
2462
2502
  }) {
2463
- const w = t.length, E = t.filter((F) => F.status === "ACTIVE").length, V = S === "reports" ? w === 1 ? "report" : "reports" : S === "briefings" ? w === 1 ? "briefing" : "briefings" : w === 1 ? "item" : "items", b = t.find((F) => F.hasActiveRun) ?? null, v = S ?? "reports & briefings", B = i === "dashboard" ? a : `Project ${v}`;
2503
+ const w = e.length, E = e.filter((F) => F.status === "ACTIVE").length, V = S === "reports" ? w === 1 ? "report" : "reports" : S === "briefings" ? w === 1 ? "briefing" : "briefings" : w === 1 ? "item" : "items", b = e.find((F) => F.hasActiveRun) ?? null, v = S ?? "reports & briefings", U = o === "dashboard" ? a : `Project ${v}`;
2464
2504
  return /* @__PURE__ */ r(
2465
2505
  "section",
2466
2506
  {
@@ -2469,30 +2509,30 @@ function ln({
2469
2509
  children: [
2470
2510
  C ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
2471
2511
  /* @__PURE__ */ r("div", { className: "min-w-0", children: [
2472
- /* @__PURE__ */ e("div", { className: en, children: v }),
2473
- /* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: B })
2512
+ /* @__PURE__ */ t("div", { className: rn, children: v }),
2513
+ /* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: U })
2474
2514
  ] }),
2475
- /* @__PURE__ */ e(
2515
+ /* @__PURE__ */ t(
2476
2516
  "button",
2477
2517
  {
2478
2518
  type: "button",
2479
2519
  onClick: c,
2480
2520
  className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
2481
2521
  "aria-label": `Close ${v.replace("&", "and")} panel`,
2482
- children: /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" })
2522
+ children: /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" })
2483
2523
  }
2484
2524
  )
2485
2525
  ] }),
2486
2526
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 border-b border-border px-4 py-2", children: [
2487
2527
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-3", children: [
2488
- /* @__PURE__ */ e(
2489
- on,
2528
+ /* @__PURE__ */ t(
2529
+ dn,
2490
2530
  {
2491
- activeView: i,
2531
+ activeView: o,
2492
2532
  onChange: s
2493
2533
  }
2494
2534
  ),
2495
- /* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: l && w === 0 ? /* @__PURE__ */ r("span", { children: [
2535
+ /* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && w === 0 ? /* @__PURE__ */ r("span", { children: [
2496
2536
  "Loading ",
2497
2537
  v,
2498
2538
  "…"
@@ -2506,7 +2546,7 @@ function ln({
2506
2546
  " ",
2507
2547
  V
2508
2548
  ] }),
2509
- /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2549
+ /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2510
2550
  /* @__PURE__ */ r("span", { children: [
2511
2551
  E,
2512
2552
  " active"
@@ -2514,45 +2554,45 @@ function ln({
2514
2554
  ] }) })
2515
2555
  ] }),
2516
2556
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
2517
- l ? (
2557
+ i ? (
2518
2558
  // Auto-refresh on open; surface a quiet spinner near the count
2519
2559
  // when a manual reload is in flight, but don't show a separate
2520
2560
  // refresh button — close+reopen handles the rare "stale list"
2521
2561
  // case without crowding the toolbar.
2522
- /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
2562
+ /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
2523
2563
  ) : null,
2524
- w > 0 && m ? h && o ? /* @__PURE__ */ r($e, { children: [
2525
- /* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Re, children: [
2526
- /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
2564
+ w > 0 && u ? m && d ? /* @__PURE__ */ r(je, { children: [
2565
+ /* @__PURE__ */ t(We, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Re, children: [
2566
+ /* @__PURE__ */ t(ge, { className: "h-3 w-3" }),
2527
2567
  " New"
2528
2568
  ] }) }),
2529
- /* @__PURE__ */ r(We, { align: "end", children: [
2530
- /* @__PURE__ */ e(q, { onClick: () => d("scheduled_report"), children: "Schedule a report" }),
2531
- /* @__PURE__ */ e(
2569
+ /* @__PURE__ */ r(He, { align: "end", children: [
2570
+ /* @__PURE__ */ t(q, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
2571
+ /* @__PURE__ */ t(
2532
2572
  q,
2533
2573
  {
2534
- onClick: () => d("analytical_briefing"),
2574
+ onClick: () => l("analytical_briefing"),
2535
2575
  children: "Create analytical briefing"
2536
2576
  }
2537
2577
  )
2538
2578
  ] })
2539
- ] }) : o ? /* @__PURE__ */ r(
2579
+ ] }) : d ? /* @__PURE__ */ r(
2540
2580
  "button",
2541
2581
  {
2542
- onClick: () => d("scheduled_report"),
2582
+ onClick: () => l("scheduled_report"),
2543
2583
  className: Re,
2544
2584
  children: [
2545
- /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
2585
+ /* @__PURE__ */ t(ge, { className: "h-3 w-3" }),
2546
2586
  " Schedule report"
2547
2587
  ]
2548
2588
  }
2549
- ) : h ? /* @__PURE__ */ r(
2589
+ ) : m ? /* @__PURE__ */ r(
2550
2590
  "button",
2551
2591
  {
2552
- onClick: () => d("analytical_briefing"),
2592
+ onClick: () => l("analytical_briefing"),
2553
2593
  className: Re,
2554
2594
  children: [
2555
- /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
2595
+ /* @__PURE__ */ t(ge, { className: "h-3 w-3" }),
2556
2596
  " New briefing"
2557
2597
  ]
2558
2598
  }
@@ -2560,45 +2600,45 @@ function ln({
2560
2600
  ] })
2561
2601
  ] }),
2562
2602
  b ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
2563
- /* @__PURE__ */ e(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
2564
- /* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: b.name }),
2565
- /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2566
- /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: jt(b) })
2603
+ /* @__PURE__ */ t(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
2604
+ /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: b.name }),
2605
+ /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2606
+ /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: Ht(b) })
2567
2607
  ] }) : null,
2568
2608
  /* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
2569
- 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,
2570
- !l && t.length === 0 && !n ? /* @__PURE__ */ e(
2571
- dn,
2609
+ n ? /* @__PURE__ */ t("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: n }) : null,
2610
+ !i && e.length === 0 && !n ? /* @__PURE__ */ t(
2611
+ un,
2572
2612
  {
2573
- onNew: d,
2574
- canCreate: m,
2575
- canCreateScheduledReport: o,
2576
- analyticalBriefingsEnabled: h,
2613
+ onNew: l,
2614
+ canCreate: u,
2615
+ canCreateScheduledReport: d,
2616
+ analyticalBriefingsEnabled: m,
2577
2617
  contentKind: S
2578
2618
  }
2579
2619
  ) : null,
2580
- t.map((F) => /* @__PURE__ */ e(
2581
- un,
2620
+ e.map((F) => /* @__PURE__ */ t(
2621
+ mn,
2582
2622
  {
2583
2623
  briefing: F,
2584
2624
  isOpening: k === F.id,
2585
2625
  isBusy: x === F.id,
2586
2626
  onOpen: () => p(F.id),
2587
- onRunNow: () => u(F),
2627
+ onRunNow: () => h(F),
2588
2628
  onTogglePause: () => f(F),
2589
2629
  onDelete: () => g(F)
2590
2630
  },
2591
2631
  F.id
2592
2632
  ))
2593
2633
  ] }),
2594
- D ? /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
2634
+ D ? /* @__PURE__ */ t("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
2595
2635
  "a",
2596
2636
  {
2597
2637
  href: D,
2598
- className: K($t, "h-6 px-1 text-[11px]"),
2638
+ className: K(Wt, "h-6 px-1 text-[11px]"),
2599
2639
  children: [
2600
2640
  "Manage all reports & briefings",
2601
- /* @__PURE__ */ e(ba, { className: "h-3 w-3" })
2641
+ /* @__PURE__ */ t(va, { className: "h-3 w-3" })
2602
2642
  ]
2603
2643
  }
2604
2644
  ) }) : null
@@ -2606,48 +2646,48 @@ function ln({
2606
2646
  }
2607
2647
  );
2608
2648
  }
2609
- function dn({
2610
- onNew: t,
2649
+ function un({
2650
+ onNew: e,
2611
2651
  canCreate: a,
2612
- canCreateScheduledReport: i,
2652
+ canCreateScheduledReport: o,
2613
2653
  analyticalBriefingsEnabled: n,
2614
- contentKind: l
2654
+ contentKind: i
2615
2655
  }) {
2616
- const s = l === "reports" ? {
2656
+ const s = i === "reports" ? {
2617
2657
  title: "No reports yet",
2618
2658
  description: "Schedule an emailed dashboard or visual report to see it here."
2619
- } : l === "briefings" ? {
2659
+ } : i === "briefings" ? {
2620
2660
  title: "No briefings yet",
2621
2661
  description: "Create an analytical briefing to monitor this dashboard and brief your team."
2622
2662
  } : null;
2623
2663
  return /* @__PURE__ */ r("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
2624
- /* @__PURE__ */ e(cn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
2625
- /* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: (s == null ? void 0 : s.title) ?? "Have an analyst brief your team" }),
2626
- /* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (s == null ? void 0 : s.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." }),
2664
+ /* @__PURE__ */ t(hn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
2665
+ /* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: (s == null ? void 0 : s.title) ?? "Have an analyst brief your team" }),
2666
+ /* @__PURE__ */ t("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (s == null ? void 0 : s.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." }),
2627
2667
  a ? /* @__PURE__ */ r("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
2628
- i ? /* @__PURE__ */ r(
2668
+ o ? /* @__PURE__ */ r(
2629
2669
  "button",
2630
2670
  {
2631
- onClick: () => t("scheduled_report"),
2671
+ onClick: () => e("scheduled_report"),
2632
2672
  className: Re,
2633
2673
  children: [
2634
- /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
2674
+ /* @__PURE__ */ t(ge, { className: "h-3 w-3" }),
2635
2675
  " Schedule a report"
2636
2676
  ]
2637
2677
  }
2638
2678
  ) : null,
2639
- n ? /* @__PURE__ */ e(
2679
+ n ? /* @__PURE__ */ t(
2640
2680
  "button",
2641
2681
  {
2642
- onClick: () => t("analytical_briefing"),
2643
- className: $t,
2682
+ onClick: () => e("analytical_briefing"),
2683
+ className: Wt,
2644
2684
  children: "Create analytical briefing"
2645
2685
  }
2646
2686
  ) : null
2647
2687
  ] }) : null
2648
2688
  ] });
2649
2689
  }
2650
- function cn({ className: t }) {
2690
+ function hn({ className: e }) {
2651
2691
  return /* @__PURE__ */ r(
2652
2692
  "svg",
2653
2693
  {
@@ -2656,9 +2696,9 @@ function cn({ className: t }) {
2656
2696
  xmlns: "http://www.w3.org/2000/svg",
2657
2697
  role: "presentation",
2658
2698
  "aria-hidden": "true",
2659
- className: t,
2699
+ className: e,
2660
2700
  children: [
2661
- /* @__PURE__ */ e(
2701
+ /* @__PURE__ */ t(
2662
2702
  "rect",
2663
2703
  {
2664
2704
  x: "22",
@@ -2670,7 +2710,7 @@ function cn({ className: t }) {
2670
2710
  strokeWidth: "1.25"
2671
2711
  }
2672
2712
  ),
2673
- /* @__PURE__ */ e(
2713
+ /* @__PURE__ */ t(
2674
2714
  "line",
2675
2715
  {
2676
2716
  x1: "30",
@@ -2682,7 +2722,7 @@ function cn({ className: t }) {
2682
2722
  strokeLinecap: "round"
2683
2723
  }
2684
2724
  ),
2685
- /* @__PURE__ */ e(
2725
+ /* @__PURE__ */ t(
2686
2726
  "line",
2687
2727
  {
2688
2728
  x1: "30",
@@ -2695,8 +2735,8 @@ function cn({ className: t }) {
2695
2735
  opacity: "0.5"
2696
2736
  }
2697
2737
  ),
2698
- /* @__PURE__ */ e("circle", { cx: "31", cy: "32", r: "1", fill: "currentColor", opacity: "0.6" }),
2699
- /* @__PURE__ */ e(
2738
+ /* @__PURE__ */ t("circle", { cx: "31", cy: "32", r: "1", fill: "currentColor", opacity: "0.6" }),
2739
+ /* @__PURE__ */ t(
2700
2740
  "line",
2701
2741
  {
2702
2742
  x1: "35",
@@ -2709,8 +2749,8 @@ function cn({ className: t }) {
2709
2749
  strokeLinecap: "round"
2710
2750
  }
2711
2751
  ),
2712
- /* @__PURE__ */ e("circle", { cx: "31", cy: "38", r: "1", fill: "currentColor", opacity: "0.6" }),
2713
- /* @__PURE__ */ e(
2752
+ /* @__PURE__ */ t("circle", { cx: "31", cy: "38", r: "1", fill: "currentColor", opacity: "0.6" }),
2753
+ /* @__PURE__ */ t(
2714
2754
  "line",
2715
2755
  {
2716
2756
  x1: "35",
@@ -2723,8 +2763,8 @@ function cn({ className: t }) {
2723
2763
  strokeLinecap: "round"
2724
2764
  }
2725
2765
  ),
2726
- /* @__PURE__ */ e("circle", { cx: "31", cy: "44", r: "1", fill: "currentColor", opacity: "0.6" }),
2727
- /* @__PURE__ */ e(
2766
+ /* @__PURE__ */ t("circle", { cx: "31", cy: "44", r: "1", fill: "currentColor", opacity: "0.6" }),
2767
+ /* @__PURE__ */ t(
2728
2768
  "line",
2729
2769
  {
2730
2770
  x1: "35",
@@ -2737,7 +2777,7 @@ function cn({ className: t }) {
2737
2777
  strokeLinecap: "round"
2738
2778
  }
2739
2779
  ),
2740
- /* @__PURE__ */ e(
2780
+ /* @__PURE__ */ t(
2741
2781
  "rect",
2742
2782
  {
2743
2783
  x: "30",
@@ -2749,7 +2789,7 @@ function cn({ className: t }) {
2749
2789
  opacity: "0.55"
2750
2790
  }
2751
2791
  ),
2752
- /* @__PURE__ */ e(
2792
+ /* @__PURE__ */ t(
2753
2793
  "rect",
2754
2794
  {
2755
2795
  x: "38",
@@ -2761,7 +2801,7 @@ function cn({ className: t }) {
2761
2801
  opacity: "0.7"
2762
2802
  }
2763
2803
  ),
2764
- /* @__PURE__ */ e(
2804
+ /* @__PURE__ */ t(
2765
2805
  "rect",
2766
2806
  {
2767
2807
  x: "46",
@@ -2773,7 +2813,7 @@ function cn({ className: t }) {
2773
2813
  opacity: "0.85"
2774
2814
  }
2775
2815
  ),
2776
- /* @__PURE__ */ e(
2816
+ /* @__PURE__ */ t(
2777
2817
  "rect",
2778
2818
  {
2779
2819
  x: "54",
@@ -2785,7 +2825,7 @@ function cn({ className: t }) {
2785
2825
  opacity: "0.6"
2786
2826
  }
2787
2827
  ),
2788
- /* @__PURE__ */ e(
2828
+ /* @__PURE__ */ t(
2789
2829
  "rect",
2790
2830
  {
2791
2831
  x: "62",
@@ -2797,7 +2837,7 @@ function cn({ className: t }) {
2797
2837
  opacity: "0.75"
2798
2838
  }
2799
2839
  ),
2800
- /* @__PURE__ */ e(
2840
+ /* @__PURE__ */ t(
2801
2841
  "circle",
2802
2842
  {
2803
2843
  cx: "86",
@@ -2808,7 +2848,7 @@ function cn({ className: t }) {
2808
2848
  strokeWidth: "1.25"
2809
2849
  }
2810
2850
  ),
2811
- /* @__PURE__ */ e(
2851
+ /* @__PURE__ */ t(
2812
2852
  "line",
2813
2853
  {
2814
2854
  x1: "93.5",
@@ -2824,16 +2864,16 @@ function cn({ className: t }) {
2824
2864
  }
2825
2865
  );
2826
2866
  }
2827
- function un({
2828
- briefing: t,
2867
+ function mn({
2868
+ briefing: e,
2829
2869
  isOpening: a,
2830
- isBusy: i,
2870
+ isBusy: o,
2831
2871
  onOpen: n,
2832
- onRunNow: l,
2872
+ onRunNow: i,
2833
2873
  onTogglePause: s,
2834
2874
  onDelete: c
2835
2875
  }) {
2836
- const p = t.status === "PAUSED", d = t.hasActiveRun, m = nn(t), o = rn(t.lastRunAt), h = t.lastRunStatus, u = se(t), f = h === "SUCCESS" ? Ve.success.dot : h === "FAILED" ? Ve.danger.dot : h ? Ve.warning.dot : Ve.neutral.dot;
2876
+ const p = e.status === "PAUSED", l = e.hasActiveRun, u = on(e), d = nn(e.lastRunAt), m = e.lastRunStatus, h = se(e), f = m === "SUCCESS" ? Te.success.dot : m === "FAILED" ? Te.danger.dot : m ? Te.warning.dot : Te.neutral.dot;
2837
2877
  return /* @__PURE__ */ r(
2838
2878
  "div",
2839
2879
  {
@@ -2854,26 +2894,26 @@ function un({
2854
2894
  className: "cursor-pointer pr-8",
2855
2895
  children: [
2856
2896
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
2857
- /* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
2858
- p ? /* @__PURE__ */ e("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
2897
+ /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.name }),
2898
+ p ? /* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
2859
2899
  ] }),
2860
2900
  /* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
2861
- /* @__PURE__ */ e("span", { children: u.typeLabel }),
2862
- /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2863
- /* @__PURE__ */ e("span", { children: sn(t) }),
2864
- /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2865
- /* @__PURE__ */ e(Vr, { className: "h-3 w-3" }),
2866
- /* @__PURE__ */ e("span", { className: "truncate", children: an(t) }),
2867
- t.lastRunAt ? /* @__PURE__ */ r(j, { children: [
2868
- /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2901
+ /* @__PURE__ */ t("span", { children: h.typeLabel }),
2902
+ /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2903
+ /* @__PURE__ */ t("span", { children: ln(e) }),
2904
+ /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2905
+ /* @__PURE__ */ t(Rr, { className: "h-3 w-3" }),
2906
+ /* @__PURE__ */ t("span", { className: "truncate", children: sn(e) }),
2907
+ e.lastRunAt ? /* @__PURE__ */ r(j, { children: [
2908
+ /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2869
2909
  /* @__PURE__ */ r("span", { children: [
2870
2910
  "Last run ",
2871
- o
2911
+ d
2872
2912
  ] })
2873
2913
  ] }) : null
2874
2914
  ] }),
2875
- m || d ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
2876
- d ? /* @__PURE__ */ e(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ e(
2915
+ u || l ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
2916
+ l ? /* @__PURE__ */ t(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ t(
2877
2917
  "span",
2878
2918
  {
2879
2919
  className: K(
@@ -2882,56 +2922,56 @@ function un({
2882
2922
  )
2883
2923
  }
2884
2924
  ),
2885
- /* @__PURE__ */ e("span", { className: "truncate", children: d ? jt(t) : m })
2925
+ /* @__PURE__ */ t("span", { className: "truncate", children: l ? Ht(e) : u })
2886
2926
  ] }) : null
2887
2927
  ]
2888
2928
  }
2889
2929
  ),
2890
- /* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: i ? /* @__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__ */ r($e, { children: [
2891
- /* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
2930
+ /* @__PURE__ */ t("div", { className: "absolute right-3 top-3", children: o ? /* @__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__ */ r(je, { children: [
2931
+ /* @__PURE__ */ t(We, { asChild: !0, children: /* @__PURE__ */ t(
2892
2932
  "button",
2893
2933
  {
2894
2934
  type: "button",
2895
2935
  onClick: (g) => g.stopPropagation(),
2896
2936
  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",
2897
- "aria-label": `${u.noun === "report" ? "Report" : "Briefing"} actions`,
2898
- children: /* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5" })
2937
+ "aria-label": `${h.noun === "report" ? "Report" : "Briefing"} actions`,
2938
+ children: /* @__PURE__ */ t(Bt, { className: "h-3.5 w-3.5" })
2899
2939
  }
2900
2940
  ) }),
2901
- /* @__PURE__ */ r(We, { align: "end", className: "w-44", children: [
2941
+ /* @__PURE__ */ r(He, { align: "end", className: "w-44", children: [
2902
2942
  /* @__PURE__ */ r(q, { onClick: n, children: [
2903
- /* @__PURE__ */ e(Ut, { className: "h-3.5 w-3.5" }),
2943
+ /* @__PURE__ */ t(Mt, { className: "h-3.5 w-3.5" }),
2904
2944
  "Edit ",
2905
- u.noun
2945
+ h.noun
2906
2946
  ] }),
2907
2947
  /* @__PURE__ */ r(
2908
2948
  q,
2909
2949
  {
2910
2950
  onClick: (g) => {
2911
- g.preventDefault(), l();
2951
+ g.preventDefault(), i();
2912
2952
  },
2913
2953
  children: [
2914
- /* @__PURE__ */ e(Rr, { className: "h-3.5 w-3.5" }),
2954
+ /* @__PURE__ */ t(Pr, { className: "h-3.5 w-3.5" }),
2915
2955
  "Run now"
2916
2956
  ]
2917
2957
  }
2918
2958
  ),
2919
- t.scheduleExpr ? /* @__PURE__ */ e(
2959
+ e.scheduleExpr ? /* @__PURE__ */ t(
2920
2960
  q,
2921
2961
  {
2922
2962
  onClick: (g) => {
2923
2963
  g.preventDefault(), s();
2924
2964
  },
2925
2965
  children: p ? /* @__PURE__ */ r(j, { children: [
2926
- /* @__PURE__ */ e(Ur, { className: "h-3.5 w-3.5" }),
2966
+ /* @__PURE__ */ t(Mr, { className: "h-3.5 w-3.5" }),
2927
2967
  "Resume"
2928
2968
  ] }) : /* @__PURE__ */ r(j, { children: [
2929
- /* @__PURE__ */ e(Pr, { className: "h-3.5 w-3.5" }),
2969
+ /* @__PURE__ */ t(Or, { className: "h-3.5 w-3.5" }),
2930
2970
  "Pause"
2931
2971
  ] })
2932
2972
  }
2933
2973
  ) : null,
2934
- /* @__PURE__ */ e(_e, {}),
2974
+ /* @__PURE__ */ t(ze, {}),
2935
2975
  /* @__PURE__ */ r(
2936
2976
  q,
2937
2977
  {
@@ -2940,9 +2980,9 @@ function un({
2940
2980
  },
2941
2981
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
2942
2982
  children: [
2943
- /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }),
2983
+ /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5" }),
2944
2984
  "Delete ",
2945
- u.noun
2985
+ h.noun
2946
2986
  ]
2947
2987
  }
2948
2988
  )
@@ -2952,144 +2992,144 @@ function un({
2952
2992
  }
2953
2993
  );
2954
2994
  }
2955
- const hn = 2e3, mn = 20 * 6e4;
2956
- function pn(t) {
2957
- return (t == null ? void 0 : t.trim()) || "This dashboard";
2995
+ const pn = 2e3, fn = 20 * 6e4;
2996
+ function gn(e) {
2997
+ return (e == null ? void 0 : e.trim()) || "This dashboard";
2958
2998
  }
2959
- function fn(t) {
2960
- return t === "This dashboard" ? "Watch this dashboard" : `Watch ${t}`;
2999
+ function bn(e) {
3000
+ return e === "This dashboard" ? "Watch this dashboard" : `Watch ${e}`;
2961
3001
  }
2962
- function gn(t, a, i) {
2963
- return a !== "dashboard" ? t : t.filter(
2964
- (n) => n.source.type === "dashboard" && n.source.dashboardId === i
3002
+ function xn(e, a, o) {
3003
+ return a !== "dashboard" ? e : e.filter(
3004
+ (n) => n.source.type === "dashboard" && n.source.dashboardId === o
2965
3005
  );
2966
3006
  }
2967
- async function bn(t) {
2968
- const i = [];
2969
- let n = 1, l = 0, s = Number.POSITIVE_INFINITY;
2970
- for (; l < s; ) {
2971
- const c = await t.apiClient.listBriefings(
2972
- t.apiServiceUrl,
2973
- t.token,
3007
+ async function vn(e) {
3008
+ const o = [];
3009
+ let n = 1, i = 0, s = Number.POSITIVE_INFINITY;
3010
+ for (; i < s; ) {
3011
+ const c = await e.apiClient.listBriefings(
3012
+ e.apiServiceUrl,
3013
+ e.token,
2974
3014
  { scope: "organization", page: n, pageSize: 100 }
2975
3015
  );
2976
- if (i.push(...c.briefings), l += c.briefings.length, s = c.total, c.briefings.length === 0 || l >= s) break;
3016
+ if (o.push(...c.briefings), i += c.briefings.length, s = c.total, c.briefings.length === 0 || i >= s) break;
2977
3017
  n += 1;
2978
3018
  }
2979
- return i;
3019
+ return o;
2980
3020
  }
2981
- const xn = {
2982
- listBriefings: Hr,
2983
- getBriefing: Wr,
2984
- pauseBriefing: jr,
2985
- resumeBriefing: $r,
2986
- deleteBriefing: zr,
2987
- runBriefingNow: _r
3021
+ const yn = {
3022
+ listBriefings: qr,
3023
+ getBriefing: Gr,
3024
+ pauseBriefing: Hr,
3025
+ resumeBriefing: Wr,
3026
+ deleteBriefing: jr,
3027
+ runBriefingNow: $r
2988
3028
  };
2989
- function vn({
2990
- briefingId: t,
3029
+ function Cn({
3030
+ briefingId: e,
2991
3031
  initialRun: a,
2992
- apiServiceUrl: i,
3032
+ apiServiceUrl: o,
2993
3033
  token: n,
2994
- onTerminal: l,
3034
+ onTerminal: i,
2995
3035
  onTimeout: s,
2996
3036
  onExpand: c
2997
3037
  }) {
2998
- const [p, d] = I(a), { startRun: m } = Jr({
2999
- apiServiceUrl: i,
3038
+ const [p, l] = I(a), { startRun: u } = ta({
3039
+ apiServiceUrl: o,
3000
3040
  token: n,
3001
- intervalMs: hn,
3002
- timeoutMs: mn,
3041
+ intervalMs: pn,
3042
+ timeoutMs: fn,
3003
3043
  fetchRun: ({
3004
- apiServiceUrl: h,
3005
- token: u,
3044
+ apiServiceUrl: m,
3045
+ token: h,
3006
3046
  runId: f
3007
- }) => ea(h, u, t, f),
3008
- onRun: (h) => {
3009
- d(h);
3047
+ }) => ra(m, h, e, f),
3048
+ onRun: (m) => {
3049
+ l(m);
3010
3050
  },
3011
- onTerminalRun: (h) => {
3012
- l(h);
3051
+ onTerminalRun: (m) => {
3052
+ i(m);
3013
3053
  },
3014
3054
  onTimeout: () => {
3015
3055
  s();
3016
3056
  }
3017
- }), o = he(!1);
3057
+ }), d = ce(!1);
3018
3058
  return Y(() => {
3019
- o.current || (o.current = !0, ta(a.status) ? m(a) : ra(a.status) && l(a));
3020
- }, [a, l, m]), /* @__PURE__ */ e(aa, { run: p, onExpand: c });
3059
+ d.current || (d.current = !0, aa(a.status) ? u(a) : na(a.status) && i(a));
3060
+ }, [a, i, u]), /* @__PURE__ */ t(sa, { run: p, onExpand: c });
3021
3061
  }
3022
- function Jn(t) {
3023
- return /* @__PURE__ */ e(Mr, { children: /* @__PURE__ */ e(yn, { ...t }) });
3062
+ function as(e) {
3063
+ return /* @__PURE__ */ t(_r, { children: /* @__PURE__ */ t(wn, { ...e }) });
3024
3064
  }
3025
- function yn({
3026
- dashboardId: t,
3065
+ function wn({
3066
+ dashboardId: e,
3027
3067
  dashboardTitle: a,
3028
- apiServiceUrl: i,
3068
+ apiServiceUrl: o,
3029
3069
  token: n,
3030
- disabled: l,
3070
+ disabled: i,
3031
3071
  className: s,
3032
3072
  manageBriefingsHref: c,
3033
3073
  open: p,
3034
- onOpenChange: d,
3035
- hideTrigger: m = !1,
3036
- workflowIntent: o,
3037
- client: h
3074
+ onOpenChange: l,
3075
+ hideTrigger: u = !1,
3076
+ workflowIntent: d,
3077
+ client: m
3038
3078
  }) {
3039
- const { authToken: u, tokenProps: f } = He(), g = Or(), k = !o || g.canCreate && (o === "scheduled_report" || g.analyticalBriefingsEnabled), [x, D] = I(!1), S = p ?? x, C = (N) => {
3040
- p === void 0 && D(N), d == null || d(N);
3079
+ const { authToken: h, tokenProps: f } = Ge(), g = zr(), k = !d || g.canCreate && (d === "scheduled_report" || g.analyticalBriefingsEnabled), [x, D] = I(!1), S = p ?? x, C = (N) => {
3080
+ p === void 0 && D(N), l == null || l(N);
3041
3081
  }, [w, E] = I(
3042
- o ? "author" : "list"
3082
+ d ? "author" : "list"
3043
3083
  ), [V, b] = I(
3044
- o ?? "analytical_briefing"
3045
- ), [v, B] = I("dashboard"), [F, H] = I(
3084
+ d ?? "analytical_briefing"
3085
+ ), [v, U] = I("dashboard"), [F, G] = I(
3046
3086
  []
3047
- ), [A, R] = I(null), $ = o && !k && !A ? "list" : w, [xe, te] = I(!1), [oe, Ae] = I(null), [Ie, ie] = I(null), [W, Z] = I(
3087
+ ), [A, R] = I(null), $ = d && !k && !A ? "list" : w, [xe, te] = I(!1), [oe, Ae] = I(null), [Ie, ie] = I(null), [W, J] = I(
3048
3088
  null
3049
- ), [le, J] = I(null), Fe = he(null), ve = he(S);
3089
+ ), [le, ee] = I(null), Fe = ce(null), ve = ce(S);
3050
3090
  Y(() => {
3051
3091
  const N = S && !ve.current;
3052
- ve.current = S, !(!N || !o) && (R(null), B("dashboard"), b(o), E("author"), J(null));
3053
- }, [S, o]);
3054
- const [ce, pe] = I(
3092
+ ve.current = S, !(!N || !d) && (R(null), U("dashboard"), b(d), E("author"), ee(null));
3093
+ }, [S, d]);
3094
+ const [ue, pe] = I(
3055
3095
  null
3056
- ), [X, ye] = I(null), _ = i ?? (f == null ? void 0 : f.apiServiceUrl), z = n ?? (u == null ? void 0 : u.accessToken), ne = ee(() => ({ ...xn, ...h }), [h]), fe = pn(a), Le = ee(() => {
3057
- const N = gn(
3096
+ ), [X, ye] = I(null), _ = o ?? (f == null ? void 0 : f.apiServiceUrl), z = n ?? (h == null ? void 0 : h.accessToken), ne = Z(() => ({ ...yn, ...m }), [m]), fe = gn(a), Le = Z(() => {
3097
+ const N = xn(
3058
3098
  F,
3059
3099
  v,
3060
- t
3100
+ e
3061
3101
  );
3062
- if (!o)
3102
+ if (!d)
3063
3103
  return N;
3064
- const U = o === "scheduled_report" ? "report" : "briefing";
3104
+ const P = d === "scheduled_report" ? "report" : "briefing";
3065
3105
  return N.filter(
3066
- (Be) => se(Be).noun === U
3106
+ (Be) => se(Be).noun === P
3067
3107
  );
3068
- }, [t, F, v, o]), Ke = ee(() => v === "dashboard" ? {
3069
- source: { type: "dashboard", dashboardId: t },
3108
+ }, [e, F, v, d]), Qe = Z(() => v === "dashboard" ? {
3109
+ source: { type: "dashboard", dashboardId: e },
3070
3110
  label: fe,
3071
- detail: fn(fe)
3111
+ detail: bn(fe)
3072
3112
  } : {
3073
3113
  source: { type: "project" },
3074
3114
  label: "This project",
3075
3115
  detail: "Use any data in this project."
3076
- }, [t, fe, v]), Ce = !!(_ && z), we = ga({
3116
+ }, [e, fe, v]), Ce = !!(_ && z), we = xa({
3077
3117
  canCreate: g.canCreate,
3078
3118
  analyticalBriefingsEnabled: g.analyticalBriefingsEnabled,
3079
3119
  scheduledReportAvailable: v === "dashboard"
3080
- }), Q = G(async () => {
3120
+ }), Q = H(async () => {
3081
3121
  if (!(!_ || !z)) {
3082
- te(!0), J(null);
3122
+ te(!0), ee(null);
3083
3123
  try {
3084
- H(
3085
- await bn({
3124
+ G(
3125
+ await vn({
3086
3126
  apiClient: ne,
3087
3127
  apiServiceUrl: _,
3088
3128
  token: z
3089
3129
  })
3090
3130
  );
3091
3131
  } catch (N) {
3092
- J(
3132
+ ee(
3093
3133
  N instanceof Error ? N.message : "Could not load briefings."
3094
3134
  );
3095
3135
  } finally {
@@ -3101,22 +3141,22 @@ function yn({
3101
3141
  !S || $ !== "list" || !Ce || Q();
3102
3142
  }, [Ce, $, Q, S]);
3103
3143
  const Ne = () => {
3104
- R(null), B("dashboard"), E("list"), C(!0);
3144
+ R(null), U("dashboard"), E("list"), C(!0);
3105
3145
  }, y = (N) => {
3106
3146
  R(null), b(N), E("author");
3107
- }, L = async (N) => {
3147
+ }, B = async (N) => {
3108
3148
  if (!(!_ || !z)) {
3109
- Ae(N), J(null);
3149
+ Ae(N), ee(null);
3110
3150
  try {
3111
- const U = await ne.getBriefing(
3151
+ const P = await ne.getBriefing(
3112
3152
  _,
3113
3153
  z,
3114
3154
  N
3115
3155
  );
3116
- R(U.briefing), E("author");
3117
- } catch (U) {
3118
- J(
3119
- U instanceof Error ? U.message : "Could not open briefing."
3156
+ R(P.briefing), E("author");
3157
+ } catch (P) {
3158
+ ee(
3159
+ P instanceof Error ? P.message : "Could not open briefing."
3120
3160
  );
3121
3161
  } finally {
3122
3162
  Ae(null);
@@ -3130,11 +3170,11 @@ function yn({
3130
3170
  _,
3131
3171
  z,
3132
3172
  N.id,
3133
- { requestId: Cn() }
3173
+ { requestId: Nn() }
3134
3174
  ), Q();
3135
- } catch (U) {
3175
+ } catch (P) {
3136
3176
  O.error(
3137
- U instanceof Error ? U.message : "Could not start the run."
3177
+ P instanceof Error ? P.message : "Could not start the run."
3138
3178
  );
3139
3179
  } finally {
3140
3180
  ie(null);
@@ -3142,10 +3182,10 @@ function yn({
3142
3182
  }
3143
3183
  }, re = async (N) => {
3144
3184
  if (!_ || !z) return;
3145
- const { noun: U } = se(N), Be = U === "report" ? "Report" : "Briefing";
3185
+ const { noun: P } = se(N), Be = P === "report" ? "Report" : "Briefing";
3146
3186
  ie(N.id);
3147
3187
  try {
3148
- const Te = N.status === "PAUSED" ? await ne.resumeBriefing(
3188
+ const Ue = N.status === "PAUSED" ? await ne.resumeBriefing(
3149
3189
  _,
3150
3190
  z,
3151
3191
  N.id
@@ -3155,11 +3195,11 @@ function yn({
3155
3195
  N.id
3156
3196
  );
3157
3197
  O.success(
3158
- Te.briefing.status === "PAUSED" ? `${Be} paused` : `${Be} resumed`
3198
+ Ue.briefing.status === "PAUSED" ? `${Be} paused` : `${Be} resumed`
3159
3199
  ), Q();
3160
- } catch (Te) {
3200
+ } catch (Ue) {
3161
3201
  O.error(
3162
- Te instanceof Error ? Te.message : `Could not update the ${U} status.`
3202
+ Ue instanceof Error ? Ue.message : `Could not update the ${P} status.`
3163
3203
  );
3164
3204
  } finally {
3165
3205
  ie(null);
@@ -3174,51 +3214,51 @@ function yn({
3174
3214
  z,
3175
3215
  N.id
3176
3216
  );
3177
- const { noun: U } = se(N);
3178
- O.success(`${U === "report" ? "Report" : "Briefing"} deleted`), Z(null), Q();
3179
- } catch (U) {
3217
+ const { noun: P } = se(N);
3218
+ O.success(`${P === "report" ? "Report" : "Briefing"} deleted`), J(null), Q();
3219
+ } catch (P) {
3180
3220
  O.error(
3181
- U instanceof Error ? U.message : "Could not delete the briefing."
3221
+ P instanceof Error ? P.message : "Could not delete the briefing."
3182
3222
  );
3183
3223
  } finally {
3184
3224
  ie(null);
3185
3225
  }
3186
- }, Wt = Le.length;
3187
- return g.surfaceVisible ? /* @__PURE__ */ r(Gr, { open: S, onOpenChange: C, children: [
3188
- m ? null : /* @__PURE__ */ e(
3189
- Ja,
3226
+ }, Gt = Le.length;
3227
+ return g.surfaceVisible ? /* @__PURE__ */ r(Kr, { open: S, onOpenChange: C, children: [
3228
+ u ? null : /* @__PURE__ */ t(
3229
+ tn,
3190
3230
  {
3191
- disabled: l || !Ce,
3192
- briefingCount: Wt,
3231
+ disabled: i || !Ce,
3232
+ briefingCount: Gt,
3193
3233
  className: s,
3194
3234
  onClick: Ne
3195
3235
  }
3196
3236
  ),
3197
3237
  /* @__PURE__ */ r(
3198
- qr,
3238
+ Qr,
3199
3239
  {
3200
3240
  ref: Fe,
3201
3241
  side: "right",
3202
3242
  hideClose: !0,
3203
3243
  className: "flex h-full w-full flex-col overflow-hidden p-0 outline-none sm:max-w-[560px]",
3204
3244
  onOpenAutoFocus: (N) => {
3205
- var U;
3206
- N.preventDefault(), (U = Fe.current) == null || U.focus({ preventScroll: !0 });
3245
+ var P;
3246
+ N.preventDefault(), (P = Fe.current) == null || P.focus({ preventScroll: !0 });
3207
3247
  },
3208
3248
  children: [
3209
- /* @__PURE__ */ r(Kr, { className: "sr-only", children: [
3210
- /* @__PURE__ */ e(Qr, { children: "Reports & briefings" }),
3211
- /* @__PURE__ */ e(Yr, { children: "Manage reports and briefings for this dashboard." })
3249
+ /* @__PURE__ */ r(Yr, { className: "sr-only", children: [
3250
+ /* @__PURE__ */ t(Xr, { children: "Reports & briefings" }),
3251
+ /* @__PURE__ */ t(Zr, { children: "Manage reports and briefings for this dashboard." })
3212
3252
  ] }),
3213
- o ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
3253
+ d ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
3214
3254
  /* @__PURE__ */ r(
3215
3255
  "div",
3216
3256
  {
3217
3257
  className: "flex items-center gap-5",
3218
3258
  role: "tablist",
3219
- "aria-label": o === "scheduled_report" ? "Email report workflow" : "Analytical briefing workflow",
3259
+ "aria-label": d === "scheduled_report" ? "Email report workflow" : "Analytical briefing workflow",
3220
3260
  children: [
3221
- /* @__PURE__ */ e(
3261
+ /* @__PURE__ */ t(
3222
3262
  "button",
3223
3263
  {
3224
3264
  type: "button",
@@ -3231,12 +3271,12 @@ function yn({
3231
3271
  !k && "cursor-not-allowed opacity-50"
3232
3272
  ),
3233
3273
  onClick: () => {
3234
- k && (R(null), b(o), B("dashboard"), E("author"));
3274
+ k && (R(null), b(d), U("dashboard"), E("author"));
3235
3275
  },
3236
- children: A ? `Edit ${se(A).noun}` : o === "scheduled_report" ? "Schedule report" : "Create briefing"
3276
+ children: A ? `Edit ${se(A).noun}` : d === "scheduled_report" ? "Schedule report" : "Create briefing"
3237
3277
  }
3238
3278
  ),
3239
- /* @__PURE__ */ e(
3279
+ /* @__PURE__ */ t(
3240
3280
  "button",
3241
3281
  {
3242
3282
  type: "button",
@@ -3247,38 +3287,38 @@ function yn({
3247
3287
  $ === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
3248
3288
  ),
3249
3289
  onClick: () => E("list"),
3250
- children: o === "scheduled_report" ? "Manage reports" : "Manage briefings"
3290
+ children: d === "scheduled_report" ? "Manage reports" : "Manage briefings"
3251
3291
  }
3252
3292
  )
3253
3293
  ]
3254
3294
  }
3255
3295
  ),
3256
- /* @__PURE__ */ e(
3296
+ /* @__PURE__ */ t(
3257
3297
  "button",
3258
3298
  {
3259
3299
  type: "button",
3260
3300
  onClick: () => C(!1),
3261
3301
  className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
3262
- "aria-label": o === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
3263
- children: /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" })
3302
+ "aria-label": d === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
3303
+ children: /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" })
3264
3304
  }
3265
3305
  )
3266
3306
  ] }) : null,
3267
- $ === "list" ? /* @__PURE__ */ e(
3268
- ln,
3307
+ $ === "list" ? /* @__PURE__ */ t(
3308
+ cn,
3269
3309
  {
3270
3310
  briefings: Le,
3271
3311
  dashboardLabel: fe,
3272
3312
  sourceView: v,
3273
3313
  error: le,
3274
3314
  loading: xe,
3275
- onSourceViewChange: B,
3315
+ onSourceViewChange: U,
3276
3316
  onClose: () => C(!1),
3277
3317
  onEdit: (N) => {
3278
- L(N);
3318
+ B(N);
3279
3319
  },
3280
3320
  onNew: y,
3281
- canCreate: !o && we.length > 0,
3321
+ canCreate: !d && we.length > 0,
3282
3322
  canCreateScheduledReport: we.includes(
3283
3323
  "scheduled_report"
3284
3324
  ),
@@ -3291,25 +3331,25 @@ function yn({
3291
3331
  onTogglePause: (N) => {
3292
3332
  re(N);
3293
3333
  },
3294
- onDelete: (N) => Z(N),
3334
+ onDelete: (N) => J(N),
3295
3335
  selectingId: oe,
3296
3336
  busyId: Ie,
3297
3337
  manageBriefingsHref: c,
3298
- contentKind: o === "scheduled_report" ? "reports" : o === "analytical_briefing" ? "briefings" : void 0,
3299
- hideHeader: !!o
3338
+ contentKind: d === "scheduled_report" ? "reports" : d === "analytical_briefing" ? "briefings" : void 0,
3339
+ hideHeader: !!d
3300
3340
  }
3301
- ) : /* @__PURE__ */ e(
3302
- Xr,
3341
+ ) : /* @__PURE__ */ t(
3342
+ Jr,
3303
3343
  {
3304
3344
  apiServiceUrl: _,
3305
3345
  token: z,
3306
3346
  briefing: A,
3307
3347
  intent: V,
3308
- sourceContext: A ? void 0 : Ke,
3348
+ sourceContext: A ? void 0 : Qe,
3309
3349
  title: A ? `Edit ${se(A).noun}` : V === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
3310
- hideHeader: !!o,
3350
+ hideHeader: !!d,
3311
3351
  className: "h-full min-h-0 max-w-none border-0 shadow-none",
3312
- onBack: o ? void 0 : () => E("list"),
3352
+ onBack: d ? void 0 : () => E("list"),
3313
3353
  onCancel: () => C(!1),
3314
3354
  onDeleted: () => {
3315
3355
  const N = A ? se(A).noun : "briefing";
@@ -3320,24 +3360,24 @@ function yn({
3320
3360
  onSaved: (N) => {
3321
3361
  R(N), Q();
3322
3362
  },
3323
- onMinimizeRun: ({ briefing: N, run: U }) => {
3324
- pe({ briefing: N, run: U }), C(!1);
3363
+ onMinimizeRun: ({ briefing: N, run: P }) => {
3364
+ pe({ briefing: N, run: P }), C(!1);
3325
3365
  }
3326
3366
  }
3327
3367
  )
3328
3368
  ]
3329
3369
  }
3330
3370
  ),
3331
- ce && _ && z ? /* @__PURE__ */ e(
3332
- vn,
3371
+ ue && _ && z ? /* @__PURE__ */ t(
3372
+ Cn,
3333
3373
  {
3334
- briefingId: ce.briefing.id,
3335
- initialRun: ce.run,
3374
+ briefingId: ue.briefing.id,
3375
+ initialRun: ue.run,
3336
3376
  apiServiceUrl: _,
3337
3377
  token: z,
3338
3378
  onTerminal: (N) => {
3339
3379
  ye({
3340
- briefing: ce.briefing,
3380
+ briefing: ue.briefing,
3341
3381
  run: N
3342
3382
  }), pe(null), Q();
3343
3383
  },
@@ -3345,12 +3385,12 @@ function yn({
3345
3385
  pe(null), Q();
3346
3386
  },
3347
3387
  onExpand: () => {
3348
- R(ce.briefing), E("author"), pe(null), C(!0);
3388
+ R(ue.briefing), E("author"), pe(null), C(!0);
3349
3389
  }
3350
3390
  }
3351
3391
  ) : null,
3352
- X ? /* @__PURE__ */ e("div", { className: "fixed bottom-4 right-4 z-50 w-[360px]", children: /* @__PURE__ */ e(
3353
- Zr,
3392
+ X ? /* @__PURE__ */ t("div", { className: "fixed bottom-4 right-4 z-50 w-[360px]", children: /* @__PURE__ */ t(
3393
+ ea,
3354
3394
  {
3355
3395
  title: X.run.status === "SUCCESS" ? `${X.briefing.name} is ready` : `${X.briefing.name} run failed`,
3356
3396
  durationSeconds: X.run.startedAt && X.run.completedAt ? Math.max(
@@ -3366,31 +3406,31 @@ function yn({
3366
3406
  onDismiss: () => ye(null)
3367
3407
  }
3368
3408
  ) }) : null,
3369
- /* @__PURE__ */ e(
3370
- rt,
3409
+ /* @__PURE__ */ t(
3410
+ at,
3371
3411
  {
3372
3412
  open: !!W,
3373
3413
  onOpenChange: (N) => {
3374
- N || Z(null);
3414
+ N || J(null);
3375
3415
  },
3376
- children: /* @__PURE__ */ r(at, { children: [
3377
- /* @__PURE__ */ r(nt, { children: [
3378
- /* @__PURE__ */ r(st, { children: [
3416
+ children: /* @__PURE__ */ r(nt, { children: [
3417
+ /* @__PURE__ */ r(st, { children: [
3418
+ /* @__PURE__ */ r(ot, { children: [
3379
3419
  "Delete",
3380
3420
  " ",
3381
3421
  W ? se(W).noun : "briefing",
3382
3422
  "?"
3383
3423
  ] }),
3384
- /* @__PURE__ */ r(ot, { children: [
3424
+ /* @__PURE__ */ r(it, { children: [
3385
3425
  "This permanently deletes ",
3386
- /* @__PURE__ */ e("strong", { children: W == null ? void 0 : W.name }),
3426
+ /* @__PURE__ */ t("strong", { children: W == null ? void 0 : W.name }),
3387
3427
  ". Recipients will stop receiving it."
3388
3428
  ] })
3389
3429
  ] }),
3390
- /* @__PURE__ */ r(it, { children: [
3391
- /* @__PURE__ */ e(lt, { children: "Cancel" }),
3430
+ /* @__PURE__ */ r(lt, { children: [
3431
+ /* @__PURE__ */ t(dt, { children: "Cancel" }),
3392
3432
  /* @__PURE__ */ r(
3393
- It,
3433
+ Lt,
3394
3434
  {
3395
3435
  className: "bg-destructive/90 hover:bg-destructive",
3396
3436
  onClick: de,
@@ -3407,23 +3447,24 @@ function yn({
3407
3447
  )
3408
3448
  ] }) : null;
3409
3449
  }
3410
- function Cn() {
3450
+ function Nn() {
3411
3451
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
3412
3452
  }
3413
3453
  export {
3414
- qn as A,
3415
- za as D,
3416
- Oa as E,
3417
- Xn as N,
3418
- Kn as U,
3419
- Hn as V,
3420
- Ja as W,
3421
- Gn as a,
3422
- Ma as b,
3423
- Yn as c,
3424
- ja as d,
3425
- Ka as e,
3426
- Zn as f,
3427
- Jn as g,
3454
+ Xn as A,
3455
+ ja as D,
3456
+ za as E,
3457
+ ts as N,
3458
+ Zn as U,
3459
+ Kn as V,
3460
+ tn as W,
3461
+ Yn as a,
3462
+ _a as b,
3463
+ Jn as c,
3464
+ es as d,
3465
+ Ha as e,
3466
+ Ya as f,
3467
+ rs as g,
3468
+ as as h,
3428
3469
  Qn as u
3429
3470
  };