react-semaphor 0.1.501 → 0.1.502

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