react-semaphor 0.1.295 → 0.1.296

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 (40) hide show
  1. package/dist/chunks/{braces-BdoTYzuj.js → braces-BNXseceK.js} +1 -1
  2. package/dist/chunks/{braces-DWldEFn5.js → braces-DVrX_3Q_.js} +1 -1
  3. package/dist/chunks/dashboard-controls-CKKZcVA5.js +2219 -0
  4. package/dist/chunks/dashboard-controls-DS2xJxHU.js +47 -0
  5. package/dist/chunks/dashboard-filter-controls-button-nqfmscB7.js +11 -0
  6. package/dist/chunks/{dashboard-filter-controls-button-XwenlcXw.js → dashboard-filter-controls-button-xPaIlNHP.js} +501 -495
  7. package/dist/chunks/{dashboard-json-CU55qPXj.js → dashboard-json-cuj9vYY9.js} +1 -1
  8. package/dist/chunks/{dashboard-json-V6m6lJ_c.js → dashboard-json-ovQyHWw6.js} +1 -1
  9. package/dist/chunks/{dashboard-summary-settings-dialog-DRLPzp1P.js → dashboard-summary-settings-dialog-BUg3Qyhh.js} +1 -1
  10. package/dist/chunks/{dashboard-summary-settings-dialog-0CIiWsKc.js → dashboard-summary-settings-dialog-DF076HeJ.js} +1 -1
  11. package/dist/chunks/{edit-dashboard-visual-8ha6EM_g.js → edit-dashboard-visual-32TAM00c.js} +5331 -5303
  12. package/dist/chunks/edit-dashboard-visual-BtiMcO-L.js +183 -0
  13. package/dist/chunks/{index-14M0TnH6.js → index-BDeJH9hO.js} +103265 -88338
  14. package/dist/chunks/index-Dbrs96G8.js +1533 -0
  15. package/dist/chunks/{resource-management-panel-CcDAn86l.js → resource-management-panel-2qcXsKwg.js} +2 -2
  16. package/dist/chunks/{resource-management-panel-BL5-5ouC.js → resource-management-panel-C4qoxy_g.js} +31 -30
  17. package/dist/chunks/use-create-flow-overlay-state-BMD3YRzU.js +21 -0
  18. package/dist/chunks/{use-create-flow-overlay-state-D3PxfjYv.js → use-create-flow-overlay-state-CHeppRNE.js} +572 -568
  19. package/dist/chunks/{use-visual-utils-CdIOq4nt.js → use-visual-utils-BIHLaVwh.js} +70 -68
  20. package/dist/chunks/use-visual-utils-dOYWf6nM.js +1 -0
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +113 -112
  25. package/dist/style.css +1 -1
  26. package/dist/surfboard/index.cjs +1 -1
  27. package/dist/surfboard/index.js +2 -2
  28. package/dist/types/dashboard.d.ts +235 -1
  29. package/dist/types/main.d.ts +288 -1
  30. package/dist/types/shared.d.ts +204 -1
  31. package/dist/types/surfboard.d.ts +235 -1
  32. package/dist/types/types.d.ts +235 -1
  33. package/package.json +7 -1
  34. package/dist/chunks/dashboard-controls-B3lrnI_r.js +0 -47
  35. package/dist/chunks/dashboard-controls-D7U6E1sB.js +0 -2014
  36. package/dist/chunks/dashboard-filter-controls-button-D0AsV28-.js +0 -11
  37. package/dist/chunks/edit-dashboard-visual-sSLAkmgf.js +0 -183
  38. package/dist/chunks/index-Ze8VskG1.js +0 -1435
  39. package/dist/chunks/use-create-flow-overlay-state-BbQVNDCj.js +0 -21
  40. package/dist/chunks/use-visual-utils-kh8p2QFm.js +0 -1
@@ -1,16 +1,16 @@
1
- import De, { useState as L, useRef as H, useCallback as z, useEffect as V, useContext as Ee } from "react";
2
- import { c as ne, d as W, aE as M, bL as q, bH as ie, bI as Q, aF as le, bG as Ae, e as de, f as ce, g as ue, h as me, i as he, L as Z, I as Se, db as Ie, w as Fe, B as A, x as J, W as j, M as Le, u as P, N as Te, Q as K, b_ as pe, dc as ke, dd as ee, y as T, c1 as fe, c0 as G, ai as Pe, cF as ve, cG as ge, a9 as be, cI as xe, cJ as B, t as Ue, cN as Ve, cw as Me, O as Be, de as Oe, b as O, df as Y, dg as ze, cV as Re, cW as _e, cX as $e, cY as He, cZ as je, c_ as Xe, c$ as Ge, bN as We, X as qe, dh as Qe, di as Je, cC as Ke, bJ as te, ab as Ye, aH as Ze, P as we, k as ye, dj as et, m as Ce, dk as tt, dl as at, dm as st, dn as rt, dp as ot, dq as ae, dr as nt } from "./index-14M0TnH6.js";
3
- import { jsx as t, jsxs as s, Fragment as R } from "react/jsx-runtime";
4
- import { V as it, E as lt, a as dt, b as ct, L as ut, c as mt, d as ht, C as pt, u as ft, e as vt } from "./use-create-flow-overlay-state-D3PxfjYv.js";
5
- import { u as Ne } from "./use-visual-utils-CdIOq4nt.js";
6
- import { k as se } from "./date-formatter-vkCj9Ct-.js";
1
+ import Se, { useState as T, useRef as X, useCallback as _, useEffect as B, useContext as Ae } from "react";
2
+ import { c as le, d as K, aF as z, bM as W, bI as de, bJ as q, aG as ce, bH as Ie, e as ue, f as me, g as he, h as pe, i as fe, L as Z, I as Fe, dc as Le, w as Te, B as A, x as Q, W as j, M as ke, u as O, N as Pe, Q as J, c0 as ve, dd as Ue, de as ee, y as P, c2 as ge, c1 as G, ai as Me, cG as be, cH as xe, a9 as ye, cJ as we, cK as R, t as Ve, cO as Oe, cx as Be, O as ze, df as Re, b as $, dg as Y, dh as $e, cW as _e, cX as He, cY as je, cZ as Xe, c_ as Ge, c$ as Ke, d0 as We, bO as qe, X as Qe, di as Je, dj as Ye, cD as Ze, bK as te, ab as et, aI as tt, P as Ce, k as Ne, dk as at, m as De, dl as st, dm as rt, dn as ot, dp as nt, dq as it, dr as ae, ds as lt } from "./index-BDeJH9hO.js";
3
+ import { jsx as t, jsxs as s, Fragment as H } from "react/jsx-runtime";
4
+ import { V as dt, E as se, a as re, b as ct, c as ut, L as mt, d as ht, C as pt, u as ft, e as vt } from "./use-create-flow-overlay-state-CHeppRNE.js";
5
+ import { u as Ee } from "./use-visual-utils-BIHLaVwh.js";
6
+ import { k as oe } from "./date-formatter-vkCj9Ct-.js";
7
7
  /**
8
8
  * @license lucide-react v0.453.0 - ISC
9
9
  *
10
10
  * This source code is licensed under the ISC license.
11
11
  * See the LICENSE file in the root directory of this source tree.
12
12
  */
13
- const re = ne("FileDown", [
13
+ const ne = le("FileDown", [
14
14
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
15
15
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
16
16
  ["path", { d: "M12 18v-6", key: "17g6i2" }],
@@ -22,157 +22,157 @@ const re = ne("FileDown", [
22
22
  * This source code is licensed under the ISC license.
23
23
  * See the LICENSE file in the root directory of this source tree.
24
24
  */
25
- const gt = ne("FilterX", [
25
+ const gt = le("FilterX", [
26
26
  ["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
27
27
  ["path", { d: "m22 3-5 5", key: "12jva0" }],
28
28
  ["path", { d: "m17 3 5 5", key: "k36vhe" }]
29
- ]), bt = 1e4, xt = 15e3, wt = 3e4, yt = 3e4, Ct = 12e4, oe = 2 * 60 * 60 * 1e3;
29
+ ]), bt = 1e4, xt = 15e3, yt = 3e4, wt = 3e4, Ct = 12e4, ie = 2 * 60 * 60 * 1e3;
30
30
  function Nt(e) {
31
31
  const a = Date.now() - e.getTime();
32
- return a < yt ? bt : a < Ct ? xt : wt;
32
+ return a < wt ? bt : a < Ct ? xt : yt;
33
33
  }
34
- function Mt() {
35
- const { authToken: e, tokenProps: a } = W(), f = M((p) => p.activeExports), [d, i] = L(
34
+ function Vt() {
35
+ const { authToken: e, tokenProps: a } = K(), v = z((h) => h.activeExports), [l, n] = T(
36
36
  typeof document < "u" ? !document.hidden : !0
37
- ), m = H(null), c = H(!1), h = H(void 0), o = a == null ? void 0 : a.apiServiceUrl, r = e == null ? void 0 : e.accessToken, v = z(() => {
38
- const p = M.getState().activeExports;
39
- return Array.from(p.values()).filter(
40
- (b) => q(b.status)
37
+ ), c = X(null), d = X(!1), u = X(void 0), i = a == null ? void 0 : a.apiServiceUrl, r = e == null ? void 0 : e.accessToken, p = _(() => {
38
+ const h = z.getState().activeExports;
39
+ return Array.from(h.values()).filter(
40
+ (y) => W(y.status)
41
41
  );
42
42
  }, []);
43
- V(() => {
43
+ B(() => {
44
44
  if (typeof document > "u") return;
45
- const p = () => {
46
- i(!document.hidden);
45
+ const h = () => {
46
+ n(!document.hidden);
47
47
  };
48
- return document.addEventListener("visibilitychange", p), () => {
49
- document.removeEventListener("visibilitychange", p);
48
+ return document.addEventListener("visibilitychange", h), () => {
49
+ document.removeEventListener("visibilitychange", h);
50
50
  };
51
51
  }, []);
52
- const x = z(async () => {
53
- if (!o || !r) {
54
- c.current = !1;
52
+ const b = _(async () => {
53
+ if (!i || !r) {
54
+ d.current = !1;
55
55
  return;
56
56
  }
57
- const p = v();
58
- if (p.length === 0) {
59
- c.current = !1;
57
+ const h = p();
58
+ if (h.length === 0) {
59
+ d.current = !1;
60
60
  return;
61
61
  }
62
- const b = Date.now(), D = p.filter(
63
- (n) => b - n.startedAt.getTime() > oe
62
+ const y = Date.now(), E = h.filter(
63
+ (o) => y - o.startedAt.getTime() > ie
64
64
  );
65
- if (D.length > 0) {
66
- const { updateExport: n } = M.getState().actions;
67
- for (const w of D)
68
- n(w.id, {
65
+ if (E.length > 0) {
66
+ const { updateExport: o } = z.getState().actions;
67
+ for (const x of E)
68
+ o(x.id, {
69
69
  status: "failed",
70
70
  error: "Export timed out. Please try again or contact support.",
71
71
  lastUpdatedAt: /* @__PURE__ */ new Date()
72
72
  });
73
73
  }
74
- const g = p.filter(
75
- (n) => b - n.startedAt.getTime() <= oe
74
+ const f = h.filter(
75
+ (o) => y - o.startedAt.getTime() <= ie
76
76
  );
77
- if (g.length === 0) {
78
- c.current = !1;
77
+ if (f.length === 0) {
78
+ d.current = !1;
79
79
  return;
80
80
  }
81
- const C = await Promise.allSettled(
82
- g.map(async (n) => {
81
+ const w = await Promise.allSettled(
82
+ f.map(async (o) => {
83
83
  try {
84
- const w = await ie(o, r, n.id);
85
- let y;
86
- if (w.status === "completed")
84
+ const x = await de(i, r, o.id);
85
+ let D;
86
+ if (x.status === "completed")
87
87
  try {
88
- y = await Q(o, r, n.id);
88
+ D = await q(i, r, o.id);
89
89
  } catch (F) {
90
90
  console.error(
91
- `[useExportPolling] Failed to get download URL for ${n.id}:`,
91
+ `[useExportPolling] Failed to get download URL for ${o.id}:`,
92
92
  F
93
93
  );
94
94
  }
95
95
  return {
96
- id: n.id,
97
- status: w.status,
98
- progress: w.progress,
99
- completedChunks: w.completedChunks,
100
- completedAt: w.completedAt ? new Date(w.completedAt) : void 0,
96
+ id: o.id,
97
+ status: x.status,
98
+ progress: x.progress,
99
+ completedChunks: x.completedChunks,
100
+ completedAt: x.completedAt ? new Date(x.completedAt) : void 0,
101
101
  lastUpdatedAt: /* @__PURE__ */ new Date(),
102
- fileSize: w.fileSize,
103
- error: w.error,
104
- downloadUrl: y
102
+ fileSize: x.fileSize,
103
+ error: x.error,
104
+ downloadUrl: D
105
105
  };
106
- } catch (w) {
106
+ } catch (x) {
107
107
  return console.error(
108
- `[useExportPolling] Failed to poll export ${n.id}:`,
109
- w
108
+ `[useExportPolling] Failed to poll export ${o.id}:`,
109
+ x
110
110
  ), null;
111
111
  }
112
112
  })
113
- ), { updateExport: E } = M.getState().actions;
114
- for (const n of C)
115
- n.status === "fulfilled" && n.value && E(n.value.id, n.value);
116
- const N = v();
117
- if (N.length > 0 && !document.hidden) {
118
- const n = N.reduce(
119
- (y, F) => F.startedAt < y ? F.startedAt : y,
120
- N[0].startedAt
121
- ), w = Nt(n);
122
- m.current && clearTimeout(m.current), m.current = setTimeout(() => {
123
- var y;
124
- (y = h.current) == null || y.call(h);
125
- }, w);
113
+ ), { updateExport: S } = z.getState().actions;
114
+ for (const o of w)
115
+ o.status === "fulfilled" && o.value && S(o.value.id, o.value);
116
+ const C = p();
117
+ if (C.length > 0 && !document.hidden) {
118
+ const o = C.reduce(
119
+ (D, F) => F.startedAt < D ? F.startedAt : D,
120
+ C[0].startedAt
121
+ ), x = Nt(o);
122
+ c.current && clearTimeout(c.current), c.current = setTimeout(() => {
123
+ var D;
124
+ (D = u.current) == null || D.call(u);
125
+ }, x);
126
126
  } else
127
- c.current = !1;
128
- }, [o, r, v]);
129
- return V(() => {
130
- h.current = x;
131
- }, [x]), V(() => {
132
- var b;
133
- v().length > 0 && d && !c.current && (c.current = !0, (b = h.current) == null || b.call(h));
134
- }, [f, d, v]), V(() => {
135
- var b;
136
- const p = v();
137
- d && p.length > 0 && !c.current && (c.current = !0, (b = h.current) == null || b.call(h));
138
- }, [d, v]), V(() => {
139
- !d && m.current && (clearTimeout(m.current), m.current = null, c.current = !1);
140
- }, [d]), V(() => () => {
141
- m.current && (clearTimeout(m.current), m.current = null);
127
+ d.current = !1;
128
+ }, [i, r, p]);
129
+ return B(() => {
130
+ u.current = b;
131
+ }, [b]), B(() => {
132
+ var y;
133
+ p().length > 0 && l && !d.current && (d.current = !0, (y = u.current) == null || y.call(u));
134
+ }, [v, l, p]), B(() => {
135
+ var y;
136
+ const h = p();
137
+ l && h.length > 0 && !d.current && (d.current = !0, (y = u.current) == null || y.call(u));
138
+ }, [l, p]), B(() => {
139
+ !l && c.current && (clearTimeout(c.current), c.current = null, d.current = !1);
140
+ }, [l]), B(() => () => {
141
+ c.current && (clearTimeout(c.current), c.current = null);
142
142
  }, []), {
143
- isPolling: c.current,
144
- isTabVisible: d,
145
- inProgressCount: v().length
143
+ isPolling: d.current,
144
+ isTabVisible: l,
145
+ inProgressCount: p().length
146
146
  };
147
147
  }
148
- function Bt() {
149
- const { authToken: e, tokenProps: a } = W(), f = M((h) => h.activeExports), { addExport: d } = le(), i = H(!1), m = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken;
150
- V(() => {
151
- if (i.current || !m || !c) return;
148
+ function Ot() {
149
+ const { authToken: e, tokenProps: a } = K(), v = z((u) => u.activeExports), { addExport: l } = ce(), n = X(!1), c = a == null ? void 0 : a.apiServiceUrl, d = e == null ? void 0 : e.accessToken;
150
+ B(() => {
151
+ if (n.current || !c || !d) return;
152
152
  (async () => {
153
153
  try {
154
- const { exports: o } = await Ae(m, c, {
154
+ const { exports: i } = await Ie(c, d, {
155
155
  status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
156
156
  limit: 20
157
157
  // Limit to recent exports
158
158
  });
159
- for (const r of o) {
160
- if (f.has(r.id)) continue;
161
- const v = r.totalChunks ? Math.round(r.completedChunks / r.totalChunks * 100) : 0;
162
- let x;
159
+ for (const r of i) {
160
+ if (v.has(r.id)) continue;
161
+ const p = r.totalChunks ? Math.round(r.completedChunks / r.totalChunks * 100) : 0;
162
+ let b;
163
163
  if (r.status === "completed")
164
164
  try {
165
- x = await Q(m, c, r.id);
166
- } catch (b) {
165
+ b = await q(c, d, r.id);
166
+ } catch (y) {
167
167
  console.error(
168
168
  `[useExportRecovery] Failed to get download URL for ${r.id}:`,
169
- b
169
+ y
170
170
  );
171
171
  }
172
- const p = {
172
+ const h = {
173
173
  id: r.id,
174
174
  status: r.status,
175
- progress: v,
175
+ progress: p,
176
176
  title: Dt(r),
177
177
  totalRows: r.totalRows,
178
178
  totalChunks: r.totalChunks,
@@ -183,46 +183,46 @@ function Bt() {
183
183
  fileSize: r.fileSize,
184
184
  error: r.error,
185
185
  expiresAt: new Date(r.expiresAt),
186
- downloadUrl: x
186
+ downloadUrl: b
187
187
  };
188
- d(p);
188
+ l(h);
189
189
  }
190
- i.current = !0;
191
- } catch (o) {
192
- console.error("[useExportRecovery] Failed to recover exports:", o), i.current = !0;
190
+ n.current = !0;
191
+ } catch (i) {
192
+ console.error("[useExportRecovery] Failed to recover exports:", i), n.current = !0;
193
193
  }
194
194
  })();
195
- }, [m, c, d, f]);
195
+ }, [c, d, l, v]);
196
196
  }
197
197
  function Dt(e) {
198
- return e.title ? e.title : q(
198
+ return e.title ? e.title : W(
199
199
  e.status
200
200
  ) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
201
201
  }
202
202
  function Et({
203
203
  open: e,
204
204
  onOpenChange: a,
205
- isLibraryVisual: f,
206
- currentVisualName: d,
207
- isSaving: i = !1,
208
- destinationMode: m = "both",
209
- onConfirm: c
205
+ isLibraryVisual: v,
206
+ currentVisualName: l,
207
+ isSaving: n = !1,
208
+ destinationMode: c = "both",
209
+ onConfirm: d
210
210
  }) {
211
- const [h, o] = L(
212
- f && d ? `Copy of ${d}` : d || ""
213
- ), [r, v] = L("");
214
- De.useEffect(() => {
215
- e && (o(
216
- f && d ? `Copy of ${d}` : d || ""
217
- ), v(""));
218
- }, [e, f, d]);
219
- const x = !!h.trim(), p = m === "local" ? {
211
+ const [u, i] = T(
212
+ v && l ? `Copy of ${l}` : l || ""
213
+ ), [r, p] = T("");
214
+ Se.useEffect(() => {
215
+ e && (i(
216
+ v && l ? `Copy of ${l}` : l || ""
217
+ ), p(""));
218
+ }, [e, v, l]);
219
+ const b = !!u.trim(), h = c === "local" ? {
220
220
  saveToLibrary: !1,
221
221
  saveToCurrentDashboard: !0,
222
222
  badgeType: "local",
223
223
  description: "Creates a local copy on the current dashboard.",
224
224
  actionLabel: "Add to Dashboard (Local)"
225
- } : m === "library" ? {
225
+ } : c === "library" ? {
226
226
  saveToLibrary: !0,
227
227
  saveToCurrentDashboard: !1,
228
228
  badgeType: "library",
@@ -234,152 +234,152 @@ function Et({
234
234
  badgeType: "linked",
235
235
  description: "Creates a new library visual and adds a linked copy to this dashboard.",
236
236
  actionLabel: "Save Copy as Linked Visual"
237
- }, b = () => {
238
- !x || i || c({
239
- name: h.trim(),
237
+ }, y = () => {
238
+ !b || n || d({
239
+ name: u.trim(),
240
240
  description: r.trim() || void 0,
241
- saveToLibrary: p.saveToLibrary,
242
- saveToCurrentDashboard: p.saveToCurrentDashboard
241
+ saveToLibrary: h.saveToLibrary,
242
+ saveToCurrentDashboard: h.saveToCurrentDashboard
243
243
  });
244
244
  };
245
- return /* @__PURE__ */ t(de, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(ce, { className: "sm:max-w-[500px]", children: [
246
- /* @__PURE__ */ s(ue, { children: [
247
- /* @__PURE__ */ s(me, { className: "flex items-center gap-2", children: [
245
+ return /* @__PURE__ */ t(ue, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(me, { className: "sm:max-w-[500px]", children: [
246
+ /* @__PURE__ */ s(he, { children: [
247
+ /* @__PURE__ */ s(pe, { className: "flex items-center gap-2", children: [
248
248
  /* @__PURE__ */ t("span", { children: "Save Visual As" }),
249
- p.badgeType !== "local" && /* @__PURE__ */ t(
250
- it,
249
+ h.badgeType !== "local" && /* @__PURE__ */ t(
250
+ dt,
251
251
  {
252
- type: p.badgeType,
252
+ type: h.badgeType,
253
253
  showLabel: !0,
254
254
  className: "px-2 py-0.5"
255
255
  }
256
256
  )
257
257
  ] }),
258
- /* @__PURE__ */ t(he, { children: p.description })
258
+ /* @__PURE__ */ t(fe, { children: h.description })
259
259
  ] }),
260
260
  /* @__PURE__ */ s("div", { className: "grid gap-4 py-4", children: [
261
261
  /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
262
262
  /* @__PURE__ */ t(Z, { htmlFor: "name", children: "Name" }),
263
263
  /* @__PURE__ */ t(
264
- Se,
264
+ Fe,
265
265
  {
266
266
  id: "name",
267
- value: h,
268
- onChange: (D) => o(D.target.value),
267
+ value: u,
268
+ onChange: (E) => i(E.target.value),
269
269
  placeholder: "Enter visual name",
270
- disabled: i
270
+ disabled: n
271
271
  }
272
272
  )
273
273
  ] }),
274
274
  /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
275
275
  /* @__PURE__ */ t(Z, { htmlFor: "description", children: "Description (optional)" }),
276
276
  /* @__PURE__ */ t(
277
- Ie,
277
+ Le,
278
278
  {
279
279
  id: "description",
280
280
  value: r,
281
- onChange: (D) => v(D.target.value),
281
+ onChange: (E) => p(E.target.value),
282
282
  placeholder: "Enter visual description",
283
283
  rows: 3,
284
- disabled: i
284
+ disabled: n
285
285
  }
286
286
  )
287
287
  ] })
288
288
  ] }),
289
- /* @__PURE__ */ s(Fe, { children: [
289
+ /* @__PURE__ */ s(Te, { children: [
290
290
  /* @__PURE__ */ t(
291
291
  A,
292
292
  {
293
293
  variant: "outline",
294
294
  onClick: () => a(!1),
295
- disabled: i,
295
+ disabled: n,
296
296
  children: "Cancel"
297
297
  }
298
298
  ),
299
- /* @__PURE__ */ s(A, { onClick: b, disabled: !x || i, children: [
300
- i && /* @__PURE__ */ t(J, { className: "mr-2 h-4 w-4 animate-spin" }),
301
- p.actionLabel
299
+ /* @__PURE__ */ s(A, { onClick: y, disabled: !b || n, children: [
300
+ n && /* @__PURE__ */ t(Q, { className: "mr-2 h-4 w-4 animate-spin" }),
301
+ h.actionLabel
302
302
  ] })
303
303
  ] })
304
304
  ] }) });
305
305
  }
306
- function At() {
307
- const [e, a] = L(!1), [f, d] = L(!1), [i, m] = L(null), [c, h] = L(null), o = j((u) => u.frame), r = j((u) => u.card), v = Le(), x = P((u) => u.selectedSheetId), p = P((u) => u.dashboard), b = P(
308
- (u) => u.actions.setIsDashboardPanelOpen
309
- ), { getUpdatedFrame: D } = Ne(), { selectVisual: g } = Te(), { addFrame: C, setSelectedFrameId: E, setIsVisualEditing: N } = K(), n = pe(), w = !!(o != null && o.visualId), y = (() => {
310
- var u, l;
311
- return ((u = o == null ? void 0 : o.cards) == null ? void 0 : u.length) === 1 && ((l = o.cards[0]) != null && l.title) ? o.cards[0].title : v != null && v.title ? v.title : (r == null ? void 0 : r.title) || "Untitled Visual";
312
- })(), F = ke((u) => {
313
- u != null && u.id && (g(u), f && i && c && x && (async () => {
306
+ function St() {
307
+ const [e, a] = T(!1), [v, l] = T(!1), [n, c] = T(null), [d, u] = T(null), i = j((m) => m.frame), r = j((m) => m.card), p = ke(), b = O((m) => m.selectedSheetId), h = O((m) => m.dashboard), y = O(
308
+ (m) => m.actions.setIsDashboardPanelOpen
309
+ ), { getUpdatedFrame: E } = Ee(), { selectVisual: f } = Pe(), { addFrame: w, setSelectedFrameId: S, setIsVisualEditing: C } = J(), o = ve(), x = !!(i != null && i.visualId), D = (() => {
310
+ var m, g;
311
+ return ((m = i == null ? void 0 : i.cards) == null ? void 0 : m.length) === 1 && ((g = i.cards[0]) != null && g.title) ? i.cards[0].title : p != null && p.title ? p.title : (r == null ? void 0 : r.title) || "Untitled Visual";
312
+ })(), F = Ue((m) => {
313
+ m != null && m.id && (f(m), v && n && d && b && (async () => {
314
314
  try {
315
- const l = {
316
- ...i,
315
+ const g = {
316
+ ...n,
317
317
  id: ee(),
318
- visualId: u.id
318
+ visualId: m.id
319
319
  // Link to the newly created library visual
320
320
  };
321
- C(x, l, {
321
+ w(b, g, {
322
322
  position: "end",
323
- semanticExecutionPayload: c
324
- }), E(l.id), d(!1), m(null), h(null), N(!1);
325
- } catch (l) {
323
+ semanticExecutionPayload: d
324
+ }), S(g.id), l(!1), c(null), u(null), C(!1);
325
+ } catch (g) {
326
326
  console.error(
327
327
  "Failed to promote semantic metadata for saved visual:",
328
- l
329
- ), T.error(
330
- l instanceof Error ? l.message : "Failed to prepare semantic metadata for the saved visual"
328
+ g
329
+ ), P.error(
330
+ g instanceof Error ? g.message : "Failed to prepare semantic metadata for the saved visual"
331
331
  );
332
332
  }
333
- })(), b(!0), a(!1));
333
+ })(), y(!0), a(!1));
334
334
  });
335
335
  return {
336
336
  saveAsDialogOpen: e,
337
337
  setSaveAsDialogOpen: a,
338
- handleSaveAs: async (u) => {
339
- if (!x) {
340
- T.error("No sheet selected");
338
+ handleSaveAs: async (m) => {
339
+ if (!b) {
340
+ P.error("No sheet selected");
341
341
  return;
342
342
  }
343
- const l = D(), S = fe(l);
344
- if (S) {
345
- T.error(S);
343
+ const g = E(), I = ge(g);
344
+ if (I) {
345
+ P.error(I);
346
346
  return;
347
347
  }
348
- const k = l.cards.length === 1 ? {
349
- ...l,
350
- cards: l.cards.map((I) => ({
351
- ...I,
352
- title: u.name
348
+ const k = g.cards.length === 1 ? {
349
+ ...g,
350
+ cards: g.cards.map((L) => ({
351
+ ...L,
352
+ title: m.name
353
353
  // Use visual name as card title
354
354
  }))
355
- } : l;
356
- if (u.saveToLibrary) {
357
- let I = null;
358
- if (u.saveToCurrentDashboard)
355
+ } : g;
356
+ if (m.saveToLibrary) {
357
+ let L = null;
358
+ if (m.saveToCurrentDashboard)
359
359
  try {
360
- I = await n(k, {
361
- previousFrame: G(p, k.id)
360
+ L = await o(k, {
361
+ previousFrame: G(h, k.id)
362
362
  });
363
- } catch (X) {
363
+ } catch (V) {
364
364
  console.error(
365
365
  "Failed to prepare semantic metadata before saving visual:",
366
- X
367
- ), T.error(
368
- X instanceof Error ? X.message : "Failed to prepare semantic metadata for the saved visual"
366
+ V
367
+ ), P.error(
368
+ V instanceof Error ? V.message : "Failed to prepare semantic metadata for the saved visual"
369
369
  );
370
370
  return;
371
371
  }
372
- d(u.saveToCurrentDashboard), m(k), h(I);
373
- const U = {
374
- title: u.name,
375
- description: u.description,
372
+ l(m.saveToCurrentDashboard), c(k), u(L);
373
+ const M = {
374
+ title: m.name,
375
+ description: m.description,
376
376
  frameObject: k,
377
377
  // Card title synced for single-card frames
378
378
  isPrivate: !1
379
379
  };
380
- F.mutate(U);
381
- } else if (u.saveToCurrentDashboard) {
382
- const I = {
380
+ F.mutate(M);
381
+ } else if (m.saveToCurrentDashboard) {
382
+ const L = {
383
383
  ...k,
384
384
  // Card title already synced
385
385
  id: ee(),
@@ -387,146 +387,152 @@ function At() {
387
387
  // Explicitly no visualId for local visuals
388
388
  };
389
389
  try {
390
- const U = await n(k, {
391
- previousFrame: G(p, k.id)
390
+ const M = await o(k, {
391
+ previousFrame: G(h, k.id)
392
392
  });
393
- C(x, I, {
393
+ w(b, L, {
394
394
  position: "end",
395
- semanticExecutionPayload: U
396
- }), E(I.id), T.success("Visual saved to dashboard"), a(!1), N(!1);
397
- } catch (U) {
398
- console.error("Failed to save visual to dashboard:", U), T.error(
399
- U instanceof Error ? U.message : "Failed to prepare semantic metadata for the visual"
395
+ semanticExecutionPayload: M
396
+ }), S(L.id), P.success("Visual saved to dashboard"), a(!1), C(!1);
397
+ } catch (M) {
398
+ console.error("Failed to save visual to dashboard:", M), P.error(
399
+ M instanceof Error ? M.message : "Failed to prepare semantic metadata for the visual"
400
400
  );
401
401
  }
402
402
  }
403
403
  },
404
- isLibraryVisual: w,
405
- currentVisualName: y,
404
+ isLibraryVisual: x,
405
+ currentVisualName: D,
406
406
  isSaving: F.isPending
407
407
  };
408
408
  }
409
- function Ot(e = {}) {
410
- const a = j((l) => l.frame), f = Pe((l) => l.selectedVisual), d = P((l) => l.selectedFrameId), i = P((l) => l.selectedSheetId), m = P((l) => l.dashboard), { setIsVisualEditing: c, updateFrame: h } = K(), [o, r] = L(!1), [v, x] = L("both"), p = pe(), b = !!(a != null && a.visualId || f != null && f.id), D = !!(a != null && a.visualId && d), g = b && !D, {
409
+ function Bt(e = {}) {
410
+ const a = j((N) => N.frame), v = j((N) => N.editorContext), l = Me((N) => N.selectedVisual), n = O((N) => N.selectedFrameId), c = O((N) => N.selectedSheetId), d = O((N) => N.dashboard), { setIsVisualEditing: u, updateFrame: i } = J(), [r, p] = T(!1), [b, h] = T("both"), y = ve(), E = (v == null ? void 0 : v.type) === "documentSection", f = !!(a != null && a.visualId || l != null && l.id), w = !!(a != null && a.visualId && n), S = f && !w, {
411
411
  saveAsDialogOpen: C,
412
- setSaveAsDialogOpen: E,
413
- handleSaveAs: N,
414
- isLibraryVisual: n,
415
- currentVisualName: w,
416
- isSaving: y
417
- } = At(), { getUpdatedFrame: F } = Ne(), _ = async () => {
418
- if (!i) {
419
- T.error("No sheet selected");
412
+ setSaveAsDialogOpen: o,
413
+ handleSaveAs: x,
414
+ isLibraryVisual: D,
415
+ currentVisualName: F,
416
+ isSaving: U
417
+ } = St(), { getUpdatedFrame: m } = Ee();
418
+ if (E)
419
+ return /* @__PURE__ */ s(H, { children: [
420
+ /* @__PURE__ */ t(se, { className: "rounded-[5px]", variant: "default" }),
421
+ /* @__PURE__ */ t(re, {})
422
+ ] });
423
+ const g = async () => {
424
+ if (!c) {
425
+ P.error("No sheet selected");
420
426
  return;
421
427
  }
422
- if (o) return;
423
- r(!0);
424
- const l = F(), S = fe(l);
425
- if (S) {
426
- r(!1), T.error(S);
428
+ if (r) return;
429
+ p(!0);
430
+ const N = m(), k = ge(N);
431
+ if (k) {
432
+ p(!1), P.error(k);
427
433
  return;
428
434
  }
429
- const $ = {
430
- ...l,
435
+ const L = {
436
+ ...N,
431
437
  visualId: void 0
432
- }, k = G(m, $.id);
438
+ }, M = G(d, L.id);
433
439
  try {
434
- const I = await p($, {
435
- previousFrame: k
440
+ const V = await y(L, {
441
+ previousFrame: M
436
442
  });
437
- h(i, $, {
438
- semanticExecutionPayload: I
443
+ i(c, L, {
444
+ semanticExecutionPayload: V
439
445
  });
440
- } catch (I) {
441
- console.error("Failed to apply local semantic metadata:", I), r(!1), T.error(
442
- I instanceof Error ? I.message : "Failed to prepare semantic metadata for this visual"
446
+ } catch (V) {
447
+ console.error("Failed to apply local semantic metadata:", V), p(!1), P.error(
448
+ V instanceof Error ? V.message : "Failed to prepare semantic metadata for this visual"
443
449
  );
444
450
  return;
445
451
  }
446
452
  setTimeout(() => {
447
- r(!1), T.success("Changes applied. Visual is now local to this dashboard"), c(!1);
453
+ p(!1), P.success("Changes applied. Visual is now local to this dashboard"), u(!1);
448
454
  }, 300);
449
- }, u = (l) => {
450
- x(l), E(!0);
455
+ }, I = (N) => {
456
+ h(N), o(!0);
451
457
  };
452
- return /* @__PURE__ */ s(R, { children: [
458
+ return /* @__PURE__ */ s(H, { children: [
453
459
  /* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-[5px]", children: [
454
- !b && /* @__PURE__ */ t(
455
- lt,
460
+ !f && /* @__PURE__ */ t(
461
+ se,
456
462
  {
457
463
  className: "rounded-none",
458
464
  variant: "default"
459
465
  }
460
466
  ),
461
- b && g && /* @__PURE__ */ t(
462
- dt,
467
+ f && S && /* @__PURE__ */ t(
468
+ ct,
463
469
  {
464
470
  className: "rounded-none",
465
471
  variant: "default"
466
472
  }
467
473
  ),
468
- b && D && /* @__PURE__ */ t(ct, { className: "rounded-none" }),
469
- /* @__PURE__ */ s(ve, { modal: !1, children: [
470
- /* @__PURE__ */ t(ge, { asChild: !0, children: /* @__PURE__ */ t(
474
+ f && w && /* @__PURE__ */ t(ut, { className: "rounded-none" }),
475
+ /* @__PURE__ */ s(be, { modal: !1, children: [
476
+ /* @__PURE__ */ t(xe, { asChild: !0, children: /* @__PURE__ */ t(
471
477
  A,
472
478
  {
473
479
  variant: "default",
474
480
  size: "xs",
475
481
  className: "w-7 rounded-none border-l border-primary-foreground/20 px-0",
476
482
  "aria-label": "Open visual save options",
477
- disabled: y || o,
478
- children: /* @__PURE__ */ t(be, { className: "h-3.5 w-3.5" })
483
+ disabled: U || r,
484
+ children: /* @__PURE__ */ t(ye, { className: "h-3.5 w-3.5" })
479
485
  }
480
486
  ) }),
481
487
  /* @__PURE__ */ s(
482
- xe,
488
+ we,
483
489
  {
484
490
  align: "end",
485
491
  className: "min-w-[220px] rounded-[6px] border border-border/60 p-1 shadow-sm",
486
492
  children: [
487
- D && /* @__PURE__ */ s(R, { children: [
493
+ w && /* @__PURE__ */ s(H, { children: [
488
494
  /* @__PURE__ */ s(
489
- B,
495
+ R,
490
496
  {
491
- onClick: _,
492
- disabled: o,
497
+ onClick: g,
498
+ disabled: r,
493
499
  children: [
494
- /* @__PURE__ */ t(Ue, { className: "h-3.5 w-3.5" }),
495
- o ? "Applying..." : "Apply Locally"
500
+ /* @__PURE__ */ t(Ve, { className: "h-3.5 w-3.5" }),
501
+ r ? "Applying..." : "Apply Locally"
496
502
  ]
497
503
  }
498
504
  ),
499
- /* @__PURE__ */ t(Ve, {})
505
+ /* @__PURE__ */ t(Oe, {})
500
506
  ] }),
501
507
  /* @__PURE__ */ s(
502
- B,
508
+ R,
503
509
  {
504
- onClick: () => u("local"),
505
- disabled: y,
510
+ onClick: () => I("local"),
511
+ disabled: U,
506
512
  children: [
507
- /* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" }),
513
+ /* @__PURE__ */ t(Be, { className: "h-3.5 w-3.5" }),
508
514
  "Add to Dashboard (Local)"
509
515
  ]
510
516
  }
511
517
  ),
512
518
  /* @__PURE__ */ s(
513
- B,
519
+ R,
514
520
  {
515
- onClick: () => u("library"),
516
- disabled: y,
521
+ onClick: () => I("library"),
522
+ disabled: U,
517
523
  children: [
518
- /* @__PURE__ */ t(ut, { className: "h-3.5 w-3.5" }),
524
+ /* @__PURE__ */ t(mt, { className: "h-3.5 w-3.5" }),
519
525
  "Save as Library Visual"
520
526
  ]
521
527
  }
522
528
  ),
523
529
  /* @__PURE__ */ s(
524
- B,
530
+ R,
525
531
  {
526
- onClick: () => u("both"),
527
- disabled: y,
532
+ onClick: () => I("both"),
533
+ disabled: U,
528
534
  children: [
529
- /* @__PURE__ */ t(mt, { className: "h-3.5 w-3.5" }),
535
+ /* @__PURE__ */ t(ht, { className: "h-3.5 w-3.5" }),
530
536
  "Save Copy as Linked Visual"
531
537
  ]
532
538
  }
@@ -536,34 +542,34 @@ function Ot(e = {}) {
536
542
  )
537
543
  ] })
538
544
  ] }),
539
- /* @__PURE__ */ t(ht, {}),
545
+ /* @__PURE__ */ t(re, {}),
540
546
  /* @__PURE__ */ t(
541
547
  Et,
542
548
  {
543
549
  open: C,
544
- onOpenChange: (l) => {
545
- y || E(l);
550
+ onOpenChange: (N) => {
551
+ U || o(N);
546
552
  },
547
- isLibraryVisual: n,
548
- currentVisualName: w,
549
- isSaving: y,
550
- destinationMode: v,
551
- onConfirm: N
553
+ isLibraryVisual: D,
554
+ currentVisualName: F,
555
+ isSaving: U,
556
+ destinationMode: b,
557
+ onConfirm: x
552
558
  }
553
559
  )
554
560
  ] });
555
561
  }
556
562
  function zt({ className: e }) {
557
- const a = j((o) => o.isDevMode), f = P((o) => o.isVisualEditing), { setIsDevMode: d } = Be(), { config: i } = Ee(Oe).tokenProps, m = (i == null ? void 0 : i.showAdvancedMode) !== !1;
558
- if (!f || !m)
563
+ const a = j((i) => i.isDevMode), v = O((i) => i.isVisualEditing), { setIsDevMode: l } = ze(), { config: n } = Ae(Re).tokenProps, c = (n == null ? void 0 : n.showAdvancedMode) !== !1;
564
+ if (!v || !c)
559
565
  return null;
560
- const c = "h-full rounded-none border-0 bg-transparent px-2.5 shadow-none text-muted-foreground hover:bg-accent/50 hover:text-foreground", h = "bg-muted text-foreground hover:bg-muted";
566
+ const d = "h-full rounded-none border-0 bg-transparent px-2.5 shadow-none text-muted-foreground hover:bg-accent/50 hover:text-foreground", u = "bg-muted text-foreground hover:bg-muted";
561
567
  return /* @__PURE__ */ s(
562
568
  "div",
563
569
  {
564
570
  role: "radiogroup",
565
571
  "aria-label": "Editor mode",
566
- className: O(
572
+ className: $(
567
573
  "inline-flex h-7 items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
568
574
  e
569
575
  ),
@@ -576,8 +582,8 @@ function zt({ className: e }) {
576
582
  size: "xs",
577
583
  role: "radio",
578
584
  "aria-checked": !a,
579
- className: O(c, !a && h),
580
- onClick: () => d(!1),
585
+ className: $(d, !a && u),
586
+ onClick: () => l(!1),
581
587
  children: [
582
588
  /* @__PURE__ */ t(Y, { className: "h-3.5 w-3.5" }),
583
589
  "Drag & drop"
@@ -592,14 +598,14 @@ function zt({ className: e }) {
592
598
  size: "xs",
593
599
  role: "radio",
594
600
  "aria-checked": a,
595
- className: O(
596
- c,
601
+ className: $(
602
+ d,
597
603
  "border-l border-border/60",
598
- a && h
604
+ a && u
599
605
  ),
600
- onClick: () => d(!0),
606
+ onClick: () => l(!0),
601
607
  children: [
602
- /* @__PURE__ */ t(ze, { className: "h-3.5 w-3.5" }),
608
+ /* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
603
609
  "SQL"
604
610
  ]
605
611
  }
@@ -611,61 +617,61 @@ function zt({ className: e }) {
611
617
  function Rt({
612
618
  open: e,
613
619
  onOpenChange: a,
614
- onSave: f,
615
- onDiscard: d,
616
- isSaving: i,
617
- title: m = "Unsaved changes",
618
- description: c = "You have unsaved changes to this dashboard. What would you like to do?",
619
- cancelLabel: h = "Cancel",
620
- discardLabel: o = "Discard",
620
+ onSave: v,
621
+ onDiscard: l,
622
+ isSaving: n,
623
+ title: c = "Unsaved changes",
624
+ description: d = "You have unsaved changes to this dashboard. What would you like to do?",
625
+ cancelLabel: u = "Cancel",
626
+ discardLabel: i = "Discard",
621
627
  saveLabel: r = "Save"
622
628
  }) {
623
- return /* @__PURE__ */ t(Re, { open: e, onOpenChange: (x) => {
624
- !x && i || a(x);
625
- }, children: /* @__PURE__ */ s(_e, { children: [
626
- /* @__PURE__ */ s($e, { children: [
627
- /* @__PURE__ */ t(He, { children: m }),
628
- /* @__PURE__ */ t(je, { children: c })
629
+ return /* @__PURE__ */ t(_e, { open: e, onOpenChange: (b) => {
630
+ !b && n || a(b);
631
+ }, children: /* @__PURE__ */ s(He, { children: [
632
+ /* @__PURE__ */ s(je, { children: [
633
+ /* @__PURE__ */ t(Xe, { children: c }),
634
+ /* @__PURE__ */ t(Ge, { children: d })
629
635
  ] }),
630
- /* @__PURE__ */ s(Xe, { children: [
636
+ /* @__PURE__ */ s(Ke, { children: [
631
637
  /* @__PURE__ */ t(
632
638
  A,
633
639
  {
634
640
  type: "button",
635
641
  size: "xs",
636
- onClick: d,
637
- disabled: i,
642
+ onClick: l,
643
+ disabled: n,
638
644
  variant: "ghost",
639
645
  className: "mr-auto text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
640
- children: o
646
+ children: i
641
647
  }
642
648
  ),
643
- /* @__PURE__ */ t(Ge, { disabled: i, children: h }),
644
- /* @__PURE__ */ t(A, { type: "button", size: "xs", onClick: f, disabled: i, children: i ? /* @__PURE__ */ s(R, { children: [
645
- /* @__PURE__ */ t(J, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
649
+ /* @__PURE__ */ t(We, { disabled: n, children: u }),
650
+ /* @__PURE__ */ t(A, { type: "button", size: "xs", onClick: v, disabled: n, children: n ? /* @__PURE__ */ s(H, { children: [
651
+ /* @__PURE__ */ t(Q, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
646
652
  "Saving..."
647
653
  ] }) : r })
648
654
  ] })
649
655
  ] }) });
650
656
  }
651
- function St({
657
+ function At({
652
658
  export: e,
653
659
  onRemove: a
654
660
  }) {
655
- const f = () => {
661
+ const v = () => {
656
662
  e.downloadUrl && window.open(e.downloadUrl, "_blank");
657
- }, d = (h) => {
658
- h.stopPropagation(), a == null || a(e.id);
659
- }, i = () => {
663
+ }, l = (u) => {
664
+ u.stopPropagation(), a == null || a(e.id);
665
+ }, n = () => {
660
666
  switch (e.status) {
661
667
  case "completed":
662
- return /* @__PURE__ */ t(Ke, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
668
+ return /* @__PURE__ */ t(Ze, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
663
669
  case "failed":
664
670
  return /* @__PURE__ */ t(pt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
665
671
  default:
666
- return /* @__PURE__ */ t(J, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
672
+ return /* @__PURE__ */ t(Q, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
667
673
  }
668
- }, m = q(e.status), c = (() => {
674
+ }, c = W(e.status), d = (() => {
669
675
  switch (e.status) {
670
676
  case "pending":
671
677
  return "Queued...";
@@ -682,7 +688,7 @@ function St({
682
688
  return /* @__PURE__ */ s("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
683
689
  /* @__PURE__ */ s("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
684
690
  /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
685
- i(),
691
+ n(),
686
692
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
687
693
  /* @__PURE__ */ t("h4", { className: "mb-1 truncate text-sm font-medium", children: e.title }),
688
694
  e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
@@ -690,12 +696,12 @@ function St({
690
696
  e.totalRows.toLocaleString(),
691
697
  " rows"
692
698
  ] }),
693
- e.fileSize && /* @__PURE__ */ s(R, { children: [
699
+ e.fileSize && /* @__PURE__ */ s(H, { children: [
694
700
  /* @__PURE__ */ t("span", { children: "•" }),
695
- /* @__PURE__ */ t("span", { children: We(e.fileSize) })
701
+ /* @__PURE__ */ t("span", { children: qe(e.fileSize) })
696
702
  ] })
697
703
  ] }),
698
- m && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: c }),
704
+ c && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: d }),
699
705
  e.status === "failed" && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-xs text-destructive", children: e.error || "Export failed" })
700
706
  ] })
701
707
  ] }),
@@ -705,136 +711,136 @@ function St({
705
711
  variant: "ghost",
706
712
  size: "icon",
707
713
  className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
708
- onClick: d,
714
+ onClick: l,
709
715
  "aria-label": "Remove notification",
710
- children: /* @__PURE__ */ t(qe, { className: "h-4 w-4" })
716
+ children: /* @__PURE__ */ t(Qe, { className: "h-4 w-4" })
711
717
  }
712
718
  )
713
719
  ] }),
714
720
  /* @__PURE__ */ s("div", { className: "ml-8", children: [
715
721
  e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
716
- /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: se(e.startedAt, { addSuffix: !0 }) }),
722
+ /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: oe(e.startedAt, { addSuffix: !0 }) }),
717
723
  e.downloadUrl && /* @__PURE__ */ s(
718
724
  A,
719
725
  {
720
726
  size: "sm",
721
727
  variant: "outline",
722
728
  className: "h-8 bg-transparent",
723
- onClick: f,
729
+ onClick: v,
724
730
  children: [
725
- /* @__PURE__ */ t(Qe, { className: "mr-1.5 h-3.5 w-3.5" }),
731
+ /* @__PURE__ */ t(Je, { className: "mr-1.5 h-3.5 w-3.5" }),
726
732
  "Download"
727
733
  ]
728
734
  }
729
735
  )
730
736
  ] }),
731
- m && /* @__PURE__ */ s("div", { children: [
732
- /* @__PURE__ */ t(Je, { value: e.progress, className: "h-1.5" }),
737
+ c && /* @__PURE__ */ s("div", { children: [
738
+ /* @__PURE__ */ t(Ye, { value: e.progress, className: "h-1.5" }),
733
739
  /* @__PURE__ */ s("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
734
740
  e.progress,
735
741
  "% complete"
736
742
  ] })
737
743
  ] }),
738
- e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: se(e.startedAt, { addSuffix: !0 }) })
744
+ e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: oe(e.startedAt, { addSuffix: !0 }) })
739
745
  ] })
740
746
  ] });
741
747
  }
742
748
  function It() {
743
- const { authToken: e, tokenProps: a } = W(), f = M((g) => g.activeExports), { clearCompleted: d, removeExport: i, updateExport: m } = le(), [c, h] = L(!1), [o, r] = L(!1), v = Array.from(f.values()).sort(
744
- (g, C) => C.startedAt.getTime() - g.startedAt.getTime()
745
- ), x = v.some(
746
- (g) => g.status === "completed" || g.status === "failed"
747
- ), p = z(async () => {
748
- const g = a == null ? void 0 : a.apiServiceUrl, C = e == null ? void 0 : e.accessToken;
749
- if (!(!g || !C)) {
750
- h(!0);
749
+ const { authToken: e, tokenProps: a } = K(), v = z((f) => f.activeExports), { clearCompleted: l, removeExport: n, updateExport: c } = ce(), [d, u] = T(!1), [i, r] = T(!1), p = Array.from(v.values()).sort(
750
+ (f, w) => w.startedAt.getTime() - f.startedAt.getTime()
751
+ ), b = p.some(
752
+ (f) => f.status === "completed" || f.status === "failed"
753
+ ), h = _(async () => {
754
+ const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
755
+ if (!(!f || !w)) {
756
+ u(!0);
751
757
  try {
752
- const E = Array.from(f.values());
758
+ const S = Array.from(v.values());
753
759
  await Promise.all(
754
- E.map(async (N) => {
760
+ S.map(async (C) => {
755
761
  try {
756
- const n = await ie(g, C, N.id);
757
- let w;
758
- if (n.status === "completed")
762
+ const o = await de(f, w, C.id);
763
+ let x;
764
+ if (o.status === "completed")
759
765
  try {
760
- w = await Q(
761
- g,
762
- C,
763
- N.id
766
+ x = await q(
767
+ f,
768
+ w,
769
+ C.id
764
770
  );
765
- } catch (y) {
766
- console.error(`Failed to get download URL for ${N.id}:`, y);
771
+ } catch (D) {
772
+ console.error(`Failed to get download URL for ${C.id}:`, D);
767
773
  }
768
- m(N.id, {
769
- status: n.status,
770
- progress: n.progress,
771
- completedChunks: n.completedChunks,
772
- completedAt: n.completedAt ? new Date(n.completedAt) : void 0,
774
+ c(C.id, {
775
+ status: o.status,
776
+ progress: o.progress,
777
+ completedChunks: o.completedChunks,
778
+ completedAt: o.completedAt ? new Date(o.completedAt) : void 0,
773
779
  lastUpdatedAt: /* @__PURE__ */ new Date(),
774
- fileSize: n.fileSize,
775
- error: n.error,
776
- downloadUrl: w
780
+ fileSize: o.fileSize,
781
+ error: o.error,
782
+ downloadUrl: x
777
783
  });
778
- } catch (n) {
779
- console.error(`Failed to refresh export ${N.id}:`, n);
784
+ } catch (o) {
785
+ console.error(`Failed to refresh export ${C.id}:`, o);
780
786
  }
781
787
  })
782
788
  );
783
789
  } finally {
784
- h(!1);
790
+ u(!1);
785
791
  }
786
792
  }
787
793
  }, [
788
- f,
794
+ v,
789
795
  e == null ? void 0 : e.accessToken,
790
796
  a == null ? void 0 : a.apiServiceUrl,
791
- m
792
- ]), b = z(async () => {
793
- const g = a == null ? void 0 : a.apiServiceUrl, C = e == null ? void 0 : e.accessToken;
794
- if (!g || !C) {
795
- d();
797
+ c
798
+ ]), y = _(async () => {
799
+ const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
800
+ if (!f || !w) {
801
+ l();
796
802
  return;
797
803
  }
798
804
  r(!0);
799
805
  try {
800
- const E = v.filter(
801
- (n) => n.status === "completed" || n.status === "failed"
802
- ), N = await Promise.allSettled(
803
- E.map(async (n) => (await te(g, C, n.id), n.id))
806
+ const S = p.filter(
807
+ (o) => o.status === "completed" || o.status === "failed"
808
+ ), C = await Promise.allSettled(
809
+ S.map(async (o) => (await te(f, w, o.id), o.id))
804
810
  );
805
- for (const n of N)
806
- n.status === "fulfilled" ? i(n.value) : console.error("Failed to delete export:", n.reason);
811
+ for (const o of C)
812
+ o.status === "fulfilled" ? n(o.value) : console.error("Failed to delete export:", o.reason);
807
813
  } finally {
808
814
  r(!1);
809
815
  }
810
816
  }, [
811
- v,
817
+ p,
812
818
  a == null ? void 0 : a.apiServiceUrl,
813
819
  e == null ? void 0 : e.accessToken,
814
- d,
815
- i
816
- ]), D = z(
817
- async (g) => {
818
- const C = a == null ? void 0 : a.apiServiceUrl, E = e == null ? void 0 : e.accessToken;
819
- if (C && E)
820
+ l,
821
+ n
822
+ ]), E = _(
823
+ async (f) => {
824
+ const w = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
825
+ if (w && S)
820
826
  try {
821
- await te(C, E, g), i(g);
827
+ await te(w, S, f), n(f);
822
828
  return;
823
- } catch (N) {
824
- console.error(`Failed to cancel export ${g}:`, N);
829
+ } catch (C) {
830
+ console.error(`Failed to cancel export ${f}:`, C);
825
831
  }
826
- i(g);
832
+ n(f);
827
833
  },
828
- [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, i]
834
+ [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, n]
829
835
  );
830
- return v.length === 0 ? /* @__PURE__ */ s("div", { className: "p-6 text-center", children: [
831
- /* @__PURE__ */ t(re, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
836
+ return p.length === 0 ? /* @__PURE__ */ s("div", { className: "p-6 text-center", children: [
837
+ /* @__PURE__ */ t(ne, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
832
838
  /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
833
839
  /* @__PURE__ */ t("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
834
840
  ] }) : /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
835
841
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [
836
842
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
837
- /* @__PURE__ */ t(re, { className: "h-5 w-5 text-muted-foreground" }),
843
+ /* @__PURE__ */ t(ne, { className: "h-5 w-5 text-muted-foreground" }),
838
844
  /* @__PURE__ */ t("h4", { className: "font-semibold", children: "Exports" })
839
845
  ] }),
840
846
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
@@ -844,48 +850,48 @@ function It() {
844
850
  variant: "ghost",
845
851
  size: "sm",
846
852
  className: "h-7 w-7 p-0",
847
- onClick: p,
848
- disabled: c,
853
+ onClick: h,
854
+ disabled: d,
849
855
  title: "Refresh status",
850
856
  children: /* @__PURE__ */ t(
851
- Ye,
857
+ et,
852
858
  {
853
- className: `h-4 w-4 ${c ? "animate-spin" : ""}`
859
+ className: `h-4 w-4 ${d ? "animate-spin" : ""}`
854
860
  }
855
861
  )
856
862
  }
857
863
  ),
858
- x && /* @__PURE__ */ t(
864
+ b && /* @__PURE__ */ t(
859
865
  A,
860
866
  {
861
867
  variant: "ghost",
862
868
  size: "sm",
863
869
  className: "h-7 px-2 text-sm",
864
- onClick: b,
865
- disabled: o,
866
- children: o ? "Clearing..." : "Clear all"
870
+ onClick: y,
871
+ disabled: i,
872
+ children: i ? "Clearing..." : "Clear all"
867
873
  }
868
874
  )
869
875
  ] })
870
876
  ] }),
871
- /* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: v.map((g) => /* @__PURE__ */ t(
872
- St,
877
+ /* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: p.map((f) => /* @__PURE__ */ t(
878
+ At,
873
879
  {
874
- export: g,
875
- onRemove: D
880
+ export: f,
881
+ onRemove: E
876
882
  },
877
- g.id
883
+ f.id
878
884
  )) }) })
879
885
  ] });
880
886
  }
881
- function _t({
887
+ function $t({
882
888
  variant: e
883
889
  }) {
884
- const a = M((o) => o.activeExports), f = Ze(), d = a.size > 0, i = Array.from(a.values()).some(
885
- (o) => o.status === "completed" || o.status === "failed"
886
- ), c = f > 0 ? f > 9 ? "9+" : String(f) : null;
887
- return /* @__PURE__ */ s(we, { children: [
888
- /* @__PURE__ */ t(ye, { asChild: !0, children: /* @__PURE__ */ s(
890
+ const a = z((i) => i.activeExports), v = tt(), l = a.size > 0, n = Array.from(a.values()).some(
891
+ (i) => i.status === "completed" || i.status === "failed"
892
+ ), d = v > 0 ? v > 9 ? "9+" : String(v) : null;
893
+ return /* @__PURE__ */ s(Ce, { children: [
894
+ /* @__PURE__ */ t(Ne, { asChild: !0, children: /* @__PURE__ */ s(
889
895
  A,
890
896
  {
891
897
  variant: e ?? "ghost",
@@ -893,18 +899,18 @@ function _t({
893
899
  className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
894
900
  "aria-label": "Export notifications",
895
901
  children: [
896
- /* @__PURE__ */ t(et, { className: "h-3.5 w-3.5" }),
897
- d && /* @__PURE__ */ t(
902
+ /* @__PURE__ */ t(at, { className: "h-3.5 w-3.5" }),
903
+ l && /* @__PURE__ */ t(
898
904
  "span",
899
905
  {
900
- 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"}`,
901
- children: c
906
+ className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${d ? "-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"}`,
907
+ children: d
902
908
  }
903
909
  )
904
910
  ]
905
911
  }
906
912
  ) }),
907
- /* @__PURE__ */ t(Ce, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(It, {}) })
913
+ /* @__PURE__ */ t(De, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(It, {}) })
908
914
  ] });
909
915
  }
910
916
  function Ft(e) {
@@ -916,140 +922,140 @@ function Ft(e) {
916
922
  affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
917
923
  };
918
924
  }
919
- function $t({
925
+ function _t({
920
926
  open: e,
921
927
  onOpenChange: a,
922
- trigger: f,
923
- showTrigger: d = !0,
924
- initialMode: i = "manage"
928
+ trigger: v,
929
+ showTrigger: l = !0,
930
+ initialMode: n = "manage"
925
931
  }) {
926
- const m = i === "create", {
927
- forceClose: c,
928
- handleOpenChange: h,
929
- isCreateFlowActive: o,
932
+ const c = n === "create", {
933
+ forceClose: d,
934
+ handleOpenChange: u,
935
+ isCreateFlowActive: i,
930
936
  preventPassiveDismissDuringCreate: r,
931
- resolvedOpen: v,
932
- setIsCreateFlowActive: x
937
+ resolvedOpen: p,
938
+ setIsCreateFlowActive: b
933
939
  } = ft({
934
940
  open: e,
935
941
  onOpenChange: a,
936
- initialCreateFlowActive: i === "create",
942
+ initialCreateFlowActive: n === "create",
937
943
  // Dialog mode renders a built-in X close button — allow explicit
938
944
  // closes through `handleOpenChange`. Popover mode has no X; its
939
945
  // only close-via-trigger path is a re-click that would silently
940
946
  // wipe the in-progress create flow, so block everything during
941
947
  // create and make consumers use `forceClose()` from a dedicated
942
948
  // button.
943
- dismissMode: d ? "passive" : "explicit-only"
944
- }), p = P((u) => u.dashboard), { setDashboardControlsModel: b } = K(), { participants: D } = tt(at(p)), g = Array.from(
949
+ dismissMode: l ? "passive" : "explicit-only"
950
+ }), h = O((m) => m.dashboard), { setDashboardControlsModel: y } = J(), { participants: E } = st(rt(h)), f = Array.from(
945
951
  new Map(
946
- D.flatMap(
947
- (u) => u.fieldChoices.map((l) => {
948
- var S;
952
+ E.flatMap(
953
+ (m) => m.fieldChoices.map((g) => {
954
+ var I;
949
955
  return [
950
- l.value,
956
+ g.value,
951
957
  {
952
- option: l,
953
- target: (S = u.fieldTargetMap) == null ? void 0 : S[l.value]
958
+ option: g,
959
+ target: (I = m.fieldTargetMap) == null ? void 0 : I[g.value]
954
960
  }
955
961
  ];
956
962
  })
957
963
  )
958
964
  ).values()
959
- ), C = Array.from(
965
+ ), w = Array.from(
960
966
  new Map(
961
- D.flatMap(
962
- (u) => u.metricChoices.map((l) => {
963
- var S;
967
+ E.flatMap(
968
+ (m) => m.metricChoices.map((g) => {
969
+ var I;
964
970
  return [
965
- l.value,
971
+ g.value,
966
972
  {
967
- option: l,
968
- target: (S = u.metricTargetMap) == null ? void 0 : S[l.value]
973
+ option: g,
974
+ target: (I = m.metricTargetMap) == null ? void 0 : I[g.value]
969
975
  }
970
976
  ];
971
977
  })
972
978
  )
973
979
  ).values()
974
- ), E = st({
975
- ...p || {},
980
+ ), S = ot({
981
+ ...h || {},
976
982
  controls: []
977
- }), N = rt(p), n = (u, l, S) => {
978
- b(
979
- u,
980
- l,
981
- Ft(S)
983
+ }), C = nt(h), o = (m, g, I) => {
984
+ y(
985
+ m,
986
+ g,
987
+ Ft(I)
982
988
  );
983
- }, w = z(() => {
984
- if (m) {
985
- c();
989
+ }, x = _(() => {
990
+ if (c) {
991
+ d();
986
992
  return;
987
993
  }
988
- x(!1);
989
- }, [m, c, x]), y = /* @__PURE__ */ t(
994
+ b(!1);
995
+ }, [c, d, b]), D = /* @__PURE__ */ t(
990
996
  vt,
991
997
  {
992
998
  scope: "dashboard",
993
- controls: p.controls || [],
994
- reservedControlIds: E,
995
- defaultValues: p.defaultControlValues || {},
996
- usageByControlId: ot(p),
997
- availableFieldChoices: g,
998
- availableMetricChoices: C,
999
- structuralParticipants: D,
1000
- structuralParticipantIdsByControlId: N,
1001
- initialCreateFlow: i === "create",
1002
- onCreateFlowActiveChange: x,
1003
- onCreateFlowComplete: w,
1004
- onChange: n,
999
+ controls: h.controls || [],
1000
+ reservedControlIds: S,
1001
+ defaultValues: h.defaultControlValues || {},
1002
+ usageByControlId: it(h),
1003
+ availableFieldChoices: f,
1004
+ availableMetricChoices: w,
1005
+ structuralParticipants: E,
1006
+ structuralParticipantIdsByControlId: C,
1007
+ initialCreateFlow: n === "create",
1008
+ onCreateFlowActiveChange: b,
1009
+ onCreateFlowComplete: x,
1010
+ onChange: o,
1005
1011
  emptyMessage: "No dashboard controls yet."
1006
1012
  }
1007
- ), F = o ? "Add dashboard control" : "Dashboard Controls", _ = /* @__PURE__ */ s(R, { children: [
1013
+ ), F = i ? "Add dashboard control" : "Dashboard Controls", U = /* @__PURE__ */ s(H, { children: [
1008
1014
  /* @__PURE__ */ s("div", { className: "space-y-1", children: [
1009
1015
  /* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
1010
1016
  /* @__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." })
1011
1017
  ] }),
1012
- y
1018
+ D
1013
1019
  ] });
1014
- return d ? /* @__PURE__ */ s(we, { open: v, onOpenChange: h, children: [
1015
- /* @__PURE__ */ t(ye, { asChild: !0, children: f || /* @__PURE__ */ s(A, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
1020
+ return l ? /* @__PURE__ */ s(Ce, { open: p, onOpenChange: u, children: [
1021
+ /* @__PURE__ */ t(Ne, { asChild: !0, children: v || /* @__PURE__ */ s(A, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
1016
1022
  /* @__PURE__ */ t(Y, { className: "mr-2 h-4 w-4" }),
1017
1023
  "Controls"
1018
1024
  ] }) }),
1019
1025
  /* @__PURE__ */ t(
1020
- Ce,
1026
+ De,
1021
1027
  {
1022
1028
  className: "w-[620px] max-w-[95vw] space-y-4",
1023
1029
  align: "end",
1024
1030
  onEscapeKeyDown: r,
1025
1031
  onPointerDownOutside: r,
1026
- children: _
1032
+ children: U
1027
1033
  }
1028
1034
  )
1029
- ] }) : /* @__PURE__ */ t(de, { open: v, onOpenChange: h, children: /* @__PURE__ */ s(
1030
- ce,
1035
+ ] }) : /* @__PURE__ */ t(ue, { open: p, onOpenChange: u, children: /* @__PURE__ */ s(
1036
+ me,
1031
1037
  {
1032
1038
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
1033
1039
  onEscapeKeyDown: r,
1034
1040
  onPointerDownOutside: r,
1035
1041
  children: [
1036
1042
  /* @__PURE__ */ s(
1037
- ue,
1043
+ he,
1038
1044
  {
1039
- className: o ? "space-y-0" : void 0,
1045
+ className: i ? "space-y-0" : void 0,
1040
1046
  children: [
1041
- /* @__PURE__ */ t(me, { className: "text-[15px]", children: F }),
1047
+ /* @__PURE__ */ t(pe, { className: "text-[15px]", children: F }),
1042
1048
  /* @__PURE__ */ t(
1043
- he,
1049
+ fe,
1044
1050
  {
1045
- className: o ? "sr-only" : "text-[13px]",
1046
- children: o ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
1051
+ className: i ? "sr-only" : "text-[13px]",
1052
+ children: i ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
1047
1053
  }
1048
1054
  )
1049
1055
  ]
1050
1056
  }
1051
1057
  ),
1052
- /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: y })
1058
+ /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: D })
1053
1059
  ]
1054
1060
  }
1055
1061
  ) });
@@ -1057,26 +1063,26 @@ function $t({
1057
1063
  function Ht({
1058
1064
  showFilters: e,
1059
1065
  onToggleFilters: a,
1060
- onAddFilter: f,
1061
- onAddControl: d,
1062
- onManageControls: i,
1063
- size: m = "default",
1064
- className: c,
1065
- primaryButtonClassName: h,
1066
- secondaryButtonClassName: o,
1066
+ onAddFilter: v,
1067
+ onAddControl: l,
1068
+ onManageControls: n,
1069
+ size: c = "default",
1070
+ className: d,
1071
+ primaryButtonClassName: u,
1072
+ secondaryButtonClassName: i,
1067
1073
  dropdownContentClassName: r
1068
1074
  }) {
1069
1075
  return /* @__PURE__ */ s(
1070
1076
  "div",
1071
1077
  {
1072
- className: O(
1078
+ className: $(
1073
1079
  // Height lives on the shell so the outer border is part of the
1074
1080
  // h-7 box (matches regular `size="xs"` buttons). Inner buttons
1075
1081
  // stretch to fill via `h-full`, avoiding the 2px stack-up that
1076
1082
  // makes the combo taller than a sibling `<Button size="xs">`.
1077
1083
  "relative inline-flex items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
1078
- m === "toolbar" ? "h-8" : "h-7",
1079
- c
1084
+ c === "toolbar" ? "h-8" : "h-7",
1085
+ d
1080
1086
  ),
1081
1087
  children: [
1082
1088
  /* @__PURE__ */ s(
@@ -1084,9 +1090,9 @@ function Ht({
1084
1090
  {
1085
1091
  variant: "ghost",
1086
1092
  size: "xs",
1087
- className: O(
1093
+ className: $(
1088
1094
  "h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50",
1089
- h
1095
+ u
1090
1096
  ),
1091
1097
  onClick: a,
1092
1098
  children: [
@@ -1095,39 +1101,39 @@ function Ht({
1095
1101
  ]
1096
1102
  }
1097
1103
  ),
1098
- /* @__PURE__ */ s(ve, { children: [
1099
- /* @__PURE__ */ t(ge, { asChild: !0, children: /* @__PURE__ */ t(
1104
+ /* @__PURE__ */ s(be, { children: [
1105
+ /* @__PURE__ */ t(xe, { asChild: !0, children: /* @__PURE__ */ t(
1100
1106
  A,
1101
1107
  {
1102
1108
  variant: "ghost",
1103
1109
  size: "xs",
1104
- className: O(
1110
+ className: $(
1105
1111
  "h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50",
1106
- o
1112
+ i
1107
1113
  ),
1108
1114
  "aria-label": "Filter and control actions",
1109
- children: /* @__PURE__ */ t(be, { className: "h-3.5 w-3.5" })
1115
+ children: /* @__PURE__ */ t(ye, { className: "h-3.5 w-3.5" })
1110
1116
  }
1111
1117
  ) }),
1112
1118
  /* @__PURE__ */ s(
1113
- xe,
1119
+ we,
1114
1120
  {
1115
1121
  align: "start",
1116
- className: O(
1122
+ className: $(
1117
1123
  "min-w-[180px] rounded-[6px] border border-border/60 p-1 shadow-sm",
1118
1124
  r
1119
1125
  ),
1120
1126
  children: [
1121
- /* @__PURE__ */ s(B, { onSelect: f, children: [
1127
+ /* @__PURE__ */ s(R, { onSelect: v, children: [
1122
1128
  /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5" }),
1123
1129
  "Add filter"
1124
1130
  ] }),
1125
- /* @__PURE__ */ s(B, { onSelect: d, children: [
1131
+ /* @__PURE__ */ s(R, { onSelect: l, children: [
1126
1132
  /* @__PURE__ */ t(Y, { className: "h-3.5 w-3.5" }),
1127
1133
  "Add control"
1128
1134
  ] }),
1129
- /* @__PURE__ */ s(B, { onSelect: i, children: [
1130
- /* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
1135
+ /* @__PURE__ */ s(R, { onSelect: n, children: [
1136
+ /* @__PURE__ */ t(lt, { className: "h-3.5 w-3.5" }),
1131
1137
  "Manage controls"
1132
1138
  ] })
1133
1139
  ]
@@ -1140,13 +1146,13 @@ function Ht({
1140
1146
  }
1141
1147
  export {
1142
1148
  zt as A,
1143
- $t as D,
1149
+ _t as D,
1144
1150
  It as E,
1145
- _t as N,
1151
+ $t as N,
1146
1152
  Rt as U,
1147
- Ot as V,
1148
- St as a,
1149
- Bt as b,
1153
+ Bt as V,
1154
+ At as a,
1155
+ Ot as b,
1150
1156
  Ht as c,
1151
- Mt as u
1157
+ Vt as u
1152
1158
  };