react-semaphor 0.1.130 → 0.1.132

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 (25) hide show
  1. package/dist/chunks/{dashboard-controls-CyXjMFyG.js → dashboard-controls-CWG6EatR.js} +3 -3
  2. package/dist/chunks/{dashboard-controls-D0NNMMTV.js → dashboard-controls-DQMFJcPB.js} +1 -1
  3. package/dist/chunks/dashboard-export-dialog-CYRUEIF0.js +6 -0
  4. package/dist/chunks/{dashboard-export-dialog-QHSc2H4A.js → dashboard-export-dialog-DofqNYdv.js} +196 -195
  5. package/dist/chunks/{dashboard-json-CBKxJ8vr.js → dashboard-json-CfXtWYQo.js} +1 -1
  6. package/dist/chunks/{dashboard-json-B1EghOQb.js → dashboard-json-D5b7lskH.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-BbJWSwV8.js → edit-dashboard-visual-C4ur0h-P.js} +1 -1
  8. package/dist/chunks/{edit-dashboard-visual-hxtJTX_r.js → edit-dashboard-visual-CSfaO06L.js} +3 -3
  9. package/dist/chunks/{editor-action-buttons-DVUG-IfI.js → editor-action-buttons-7cxzFlCm.js} +2 -2
  10. package/dist/chunks/{editor-action-buttons-C-kNSpbT.js → editor-action-buttons-DWHiK2yJ.js} +1 -1
  11. package/dist/chunks/{index-Dv8xdR3_.js → index-B6RYfqnr.js} +105 -105
  12. package/dist/chunks/{index-BwqkWrot.js → index-CRA38qes.js} +6169 -6165
  13. package/dist/chunks/{resource-management-panel-BZsjvW6g.js → resource-management-panel-CC_r1yro.js} +1 -1
  14. package/dist/chunks/{resource-management-panel-DzZ_mzro.js → resource-management-panel-DnKFfVOc.js} +2 -2
  15. package/dist/chunks/{use-visual-utils-BWlOHrm7.js → use-visual-utils-B41g03Pc.js} +1 -1
  16. package/dist/chunks/{use-visual-utils-DtS7MAqv.js → use-visual-utils-CZNuwJRU.js} +1 -1
  17. package/dist/dashboard/index.cjs +1 -1
  18. package/dist/dashboard/index.js +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +4 -4
  21. package/dist/surfboard/index.cjs +1 -1
  22. package/dist/surfboard/index.js +1 -1
  23. package/dist/types/main.d.ts +1 -1
  24. package/package.json +1 -1
  25. package/dist/chunks/dashboard-export-dialog-74K44GrY.js +0 -6
@@ -1,8 +1,8 @@
1
1
  import { jsx as e, jsxs as a, Fragment as F } from "react/jsx-runtime";
2
- import { b as q, ar as $, as as H, at as W, au as _, av as K, aw as S, ax as J, ay as Z, az as V, aA as Q, B as A, L as T, f as E, i as ee, u as x, an as ae, g as X, aB as se, aC as O, l as g, aD as te, aE as re, c as k, aF as B, aG as L, aH as z, aI as U, aJ as G, e as oe, aK as le, aL as ne, aM as de, aN as ie, aO as ce, aP as he, aQ as ue, aR as me, aS as pe, aT as fe, aU as ve, aV as ge, Q as be, I as Ce, aW as we, aX as xe, am as De, aY as ye, aZ as R, a_ as Ne, a$ as Se, b0 as Ae, b1 as Pe, b2 as Fe, b3 as Ie, V as ke } from "./index-BwqkWrot.js";
3
- import { E as Ee, V as Me, a as Ve, b as Te, S as j, c as Oe } from "./editor-action-buttons-DVUG-IfI.js";
4
- import Be, { useState as D, useContext as Le, useEffect as ze } from "react";
5
- import { a as Y } from "./use-visual-utils-DtS7MAqv.js";
2
+ import { b as q, ar as $, as as H, at as W, au as _, av as K, aw as A, ax as J, ay as Z, az as V, aA as Q, B as P, L as T, f as E, i as ee, u as b, an as ae, g as X, aB as se, aC as O, l as v, aD as te, aE as re, c as I, aF as B, aG as L, aH as z, aI as U, aJ as G, e as oe, aK as le, aL as ne, aM as de, aN as ie, aO as ce, aP as he, aQ as ue, aR as me, aS as pe, aT as fe, aU as ve, aV as ge, Q as be, I as Ce, aW as we, aX as xe, am as De, aY as ye, aZ as R, a_ as Ne, a$ as Se, b0 as Ae, b1 as Pe, b2 as Fe, b3 as ke, V as Ie } from "./index-CRA38qes.js";
3
+ import { E as Ee, V as Me, a as Ve, b as Te, S as j, c as Oe } from "./editor-action-buttons-7cxzFlCm.js";
4
+ import Be, { useState as C, useContext as Le, useEffect as ze } from "react";
5
+ import { a as Y } from "./use-visual-utils-CZNuwJRU.js";
6
6
  /**
7
7
  * @license lucide-react v0.453.0 - ISC
8
8
  *
@@ -17,71 +17,71 @@ const Ue = q("CirclePlus", [
17
17
  function Ge({
18
18
  open: c,
19
19
  onOpenChange: i,
20
- isLibraryVisual: t,
21
- currentVisualName: r,
22
- isSaving: n = !1,
23
- onConfirm: u
20
+ isLibraryVisual: r,
21
+ currentVisualName: o,
22
+ isSaving: d = !1,
23
+ onConfirm: m
24
24
  }) {
25
- const [s, o] = D(
26
- t && r ? `Copy of ${r}` : r || ""
27
- ), [l, f] = D(""), [b, v] = D(!t), [C, w] = D(!0);
25
+ const [s, l] = C(
26
+ r && o ? `Copy of ${o}` : o || ""
27
+ ), [n, f] = C(""), [g, w] = C(!r), [p, N] = C(!0);
28
28
  Be.useEffect(() => {
29
- c && (o(
30
- t && r ? `Copy of ${r}` : r || ""
31
- ), f(""), v(!t), w(!0));
32
- }, [c, t, r]);
33
- const N = () => {
34
- s.trim() && (!b && !C || u({
29
+ c && (l(
30
+ r && o ? `Copy of ${o}` : o || ""
31
+ ), f(""), w(!r), N(!0));
32
+ }, [c, r, o]);
33
+ const x = () => {
34
+ s.trim() && (!g && !p || m({
35
35
  name: s.trim(),
36
- description: l.trim() || void 0,
37
- saveToLibrary: b,
38
- saveToCurrentDashboard: C
36
+ description: n.trim() || void 0,
37
+ saveToLibrary: g,
38
+ saveToCurrentDashboard: p
39
39
  }));
40
- }, d = s.trim() && (b || C);
40
+ }, D = s.trim() && (g || p);
41
41
  return /* @__PURE__ */ e($, { open: c, onOpenChange: i, children: /* @__PURE__ */ a(H, { className: "sm:max-w-[425px]", children: [
42
42
  /* @__PURE__ */ a(W, { children: [
43
43
  /* @__PURE__ */ e(_, { children: "Save Visual As" }),
44
- /* @__PURE__ */ e(K, { children: t ? "Create a copy of this visual with a new name" : "Save this visual to make it reusable" })
44
+ /* @__PURE__ */ e(K, { children: r ? "Create a copy of this visual with a new name" : "Save this visual to make it reusable" })
45
45
  ] }),
46
46
  /* @__PURE__ */ a("div", { className: "grid gap-4 py-4", children: [
47
47
  /* @__PURE__ */ a("div", { className: "grid gap-2", children: [
48
- /* @__PURE__ */ e(S, { htmlFor: "name", children: "Name" }),
48
+ /* @__PURE__ */ e(A, { htmlFor: "name", children: "Name" }),
49
49
  /* @__PURE__ */ e(
50
50
  J,
51
51
  {
52
52
  id: "name",
53
53
  value: s,
54
- onChange: (p) => o(p.target.value),
54
+ onChange: (t) => l(t.target.value),
55
55
  placeholder: "Enter visual name",
56
- disabled: n
56
+ disabled: d
57
57
  }
58
58
  )
59
59
  ] }),
60
60
  /* @__PURE__ */ a("div", { className: "grid gap-2", children: [
61
- /* @__PURE__ */ e(S, { htmlFor: "description", children: "Description (optional)" }),
61
+ /* @__PURE__ */ e(A, { htmlFor: "description", children: "Description (optional)" }),
62
62
  /* @__PURE__ */ e(
63
63
  Z,
64
64
  {
65
65
  id: "description",
66
- value: l,
67
- onChange: (p) => f(p.target.value),
66
+ value: n,
67
+ onChange: (t) => f(t.target.value),
68
68
  placeholder: "Enter visual description",
69
69
  rows: 3,
70
- disabled: n
70
+ disabled: d
71
71
  }
72
72
  )
73
73
  ] }),
74
74
  /* @__PURE__ */ a("div", { className: "space-y-4", children: [
75
- /* @__PURE__ */ e(S, { children: "Save to:" }),
75
+ /* @__PURE__ */ e(A, { children: "Save to:" }),
76
76
  /* @__PURE__ */ a("div", { className: "space-y-2", children: [
77
77
  /* @__PURE__ */ a("div", { className: "flex items-center space-x-2", children: [
78
78
  /* @__PURE__ */ e(
79
79
  V,
80
80
  {
81
81
  id: "save-to-dashboard",
82
- checked: C,
83
- onCheckedChange: (p) => w(!!p),
84
- disabled: n
82
+ checked: p,
83
+ onCheckedChange: (t) => N(!!t),
84
+ disabled: d
85
85
  }
86
86
  ),
87
87
  /* @__PURE__ */ a(
@@ -91,7 +91,7 @@ function Ge({
91
91
  className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
92
92
  children: [
93
93
  "Current Dashboard",
94
- /* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: t ? "(add copy to this dashboard)" : "(keep as local visual)" })
94
+ /* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: r ? "(add copy to this dashboard)" : "(keep as local visual)" })
95
95
  ]
96
96
  }
97
97
  )
@@ -101,9 +101,9 @@ function Ge({
101
101
  V,
102
102
  {
103
103
  id: "save-to-library",
104
- checked: b,
105
- onCheckedChange: (p) => v(!!p),
106
- disabled: n
104
+ checked: g,
105
+ onCheckedChange: (t) => w(!!t),
106
+ disabled: d
107
107
  }
108
108
  ),
109
109
  /* @__PURE__ */ a(
@@ -113,125 +113,125 @@ function Ge({
113
113
  className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
114
114
  children: [
115
115
  "Visual Library",
116
- /* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: t ? "(save as new reusable visual)" : "(make available to all dashboards)" })
116
+ /* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: r ? "(save as new reusable visual)" : "(make available to all dashboards)" })
117
117
  ]
118
118
  }
119
119
  )
120
120
  ] })
121
121
  ] }),
122
- !b && !C && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Please select at least one destination" })
122
+ !g && !p && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Please select at least one destination" })
123
123
  ] })
124
124
  ] }),
125
125
  /* @__PURE__ */ a(Q, { children: [
126
126
  /* @__PURE__ */ e(
127
- A,
127
+ P,
128
128
  {
129
129
  variant: "outline",
130
130
  onClick: () => i(!1),
131
- disabled: n,
131
+ disabled: d,
132
132
  children: "Cancel"
133
133
  }
134
134
  ),
135
- /* @__PURE__ */ a(A, { onClick: N, disabled: !d || n, children: [
136
- n && /* @__PURE__ */ e(T, { className: "mr-2 h-4 w-4 animate-spin" }),
137
- n ? "Saving..." : "Save"
135
+ /* @__PURE__ */ a(P, { onClick: x, disabled: !D || d, children: [
136
+ d && /* @__PURE__ */ e(T, { className: "mr-2 h-4 w-4 animate-spin" }),
137
+ d ? "Saving..." : "Save"
138
138
  ] })
139
139
  ] })
140
140
  ] }) });
141
141
  }
142
142
  function Re() {
143
- const [c, i] = D(!1), [t, r] = D(!1), [n, u] = D(null), s = E((h) => h.frame), o = E((h) => h.card), l = ee(), f = x((h) => h.selectedSheetId), b = x(
144
- (h) => h.actions.setIsDashboardPanelOpen
145
- ), { getUpdatedFrame: v } = Y(), { selectVisual: C } = ae(), { addFrame: w, setSelectedFrameId: N, setIsVisualEditing: d } = X(), p = !!(s != null && s.visualId), P = (() => {
146
- var h, y;
147
- return ((h = s == null ? void 0 : s.cards) == null ? void 0 : h.length) === 1 && ((y = s.cards[0]) != null && y.title) ? s.cards[0].title : l != null && l.title ? l.title : (o == null ? void 0 : o.title) || "Untitled Visual";
148
- })(), m = se((h) => {
149
- if (h != null && h.id) {
150
- if (C(h), t && n && f) {
143
+ const [c, i] = C(!1), [r, o] = C(!1), [d, m] = C(null), s = E((u) => u.frame), l = E((u) => u.card), n = ee(), f = b((u) => u.selectedSheetId), g = b(
144
+ (u) => u.actions.setIsDashboardPanelOpen
145
+ ), { getUpdatedFrame: w } = Y(), { selectVisual: p } = ae(), { addFrame: N, setSelectedFrameId: x, setIsVisualEditing: D } = X(), t = !!(s != null && s.visualId), S = (() => {
146
+ var u, y;
147
+ return ((u = s == null ? void 0 : s.cards) == null ? void 0 : u.length) === 1 && ((y = s.cards[0]) != null && y.title) ? s.cards[0].title : n != null && n.title ? n.title : (l == null ? void 0 : l.title) || "Untitled Visual";
148
+ })(), h = se((u) => {
149
+ if (u != null && u.id) {
150
+ if (p(u), r && d && f) {
151
151
  const y = {
152
- ...n,
152
+ ...d,
153
153
  id: O(),
154
- visualId: h.id
154
+ visualId: u.id
155
155
  // Link to the newly created library visual
156
156
  };
157
- w(f, y, "end"), N(y.id), r(!1), u(null), d(!1);
157
+ N(f, y, "end"), x(y.id), o(!1), m(null), D(!1);
158
158
  }
159
- b(!0), i(!1);
159
+ g(!0), i(!1);
160
160
  }
161
161
  });
162
162
  return {
163
163
  saveAsDialogOpen: c,
164
164
  setSaveAsDialogOpen: i,
165
- handleSaveAs: async (h) => {
165
+ handleSaveAs: async (u) => {
166
166
  if (!f) {
167
- g.error("No sheet selected");
167
+ v.error("No sheet selected");
168
168
  return;
169
169
  }
170
- const y = v(), M = y.cards.length === 1 ? {
170
+ const y = w(), M = y.cards.length === 1 ? {
171
171
  ...y,
172
- cards: y.cards.map((I) => ({
173
- ...I,
174
- title: h.name
172
+ cards: y.cards.map((k) => ({
173
+ ...k,
174
+ title: u.name
175
175
  // Use visual name as card title
176
176
  }))
177
177
  } : y;
178
- if (h.saveToLibrary) {
179
- r(h.saveToCurrentDashboard), u(M);
180
- const I = {
181
- title: h.name,
182
- description: h.description,
178
+ if (u.saveToLibrary) {
179
+ o(u.saveToCurrentDashboard), m(M);
180
+ const k = {
181
+ title: u.name,
182
+ description: u.description,
183
183
  frameObject: M,
184
184
  // Card title synced for single-card frames
185
185
  isPrivate: !1
186
186
  };
187
- m.mutate(I);
188
- } else if (h.saveToCurrentDashboard) {
189
- const I = {
187
+ h.mutate(k);
188
+ } else if (u.saveToCurrentDashboard) {
189
+ const k = {
190
190
  ...M,
191
191
  // Card title already synced
192
192
  id: O(),
193
193
  visualId: void 0
194
194
  // Explicitly no visualId for local visuals
195
195
  };
196
- w(f, I, "end"), N(I.id), g.success("Visual saved to dashboard"), i(!1), d(!1);
196
+ N(f, k, "end"), x(k.id), v.success("Visual saved to dashboard"), i(!1), D(!1);
197
197
  }
198
198
  },
199
- isLibraryVisual: p,
200
- currentVisualName: P,
201
- isSaving: m.isPending
199
+ isLibraryVisual: t,
200
+ currentVisualName: S,
201
+ isSaving: h.isPending
202
202
  };
203
203
  }
204
204
  function Xe({
205
205
  className: c
206
206
  }) {
207
- const i = E((m) => m.frame), t = E((m) => m.card), r = te((m) => m.selectedVisual), n = x((m) => m.selectedFrameId), u = x((m) => m.selectedSheetId), { setIsVisualEditing: s } = X(), o = !!(i != null && i.visualId || r != null && r.id), l = !!(i != null && i.visualId && n), f = o && !l, {
208
- saveAsDialogOpen: b,
209
- setSaveAsDialogOpen: v,
210
- handleSaveAs: C,
211
- isLibraryVisual: w,
212
- currentVisualName: N,
213
- isSaving: d
214
- } = Re(), { handleAddLibraryVisual: p } = Y(), P = async () => {
215
- if (!u) {
216
- g.error("No dashboard sheet selected");
207
+ const i = E((h) => h.frame), r = E((h) => h.card), o = te((h) => h.selectedVisual), d = b((h) => h.selectedFrameId), m = b((h) => h.selectedSheetId), { setIsVisualEditing: s } = X(), l = !!(i != null && i.visualId || o != null && o.id), n = !!(i != null && i.visualId && d), f = l && !n, {
208
+ saveAsDialogOpen: g,
209
+ setSaveAsDialogOpen: w,
210
+ handleSaveAs: p,
211
+ isLibraryVisual: N,
212
+ currentVisualName: x,
213
+ isSaving: D
214
+ } = Re(), { handleAddLibraryVisual: t } = Y(), S = async () => {
215
+ if (!m) {
216
+ v.error("No dashboard sheet selected");
217
217
  return;
218
218
  }
219
- if (!r) {
220
- g.error("No visual selected");
219
+ if (!o) {
220
+ v.error("No visual selected");
221
221
  return;
222
222
  }
223
- const m = await p(r);
224
- m.success ? (g.success("Visual added to dashboard"), s(!1)) : g.error(m.error || "Failed to add visual to dashboard");
223
+ const h = await t(o);
224
+ h.success ? (v.success("Visual added to dashboard"), s(!1)) : v.error(h.error || "Failed to add visual to dashboard");
225
225
  };
226
226
  return /* @__PURE__ */ a(F, { children: [
227
- !o && /* @__PURE__ */ e(Ee, { className: c, variant: "default" }),
228
- o && /* @__PURE__ */ a(F, { children: [
229
- l && /* @__PURE__ */ e(Me, { className: c }),
230
- f && u && t && (t.sql || re(t.config)) && /* @__PURE__ */ a(
231
- A,
227
+ !l && /* @__PURE__ */ e(Ee, { className: c, variant: "default" }),
228
+ l && /* @__PURE__ */ a(F, { children: [
229
+ n && /* @__PURE__ */ e(Me, { className: c }),
230
+ f && m && r && (r.sql || re(r.config)) && /* @__PURE__ */ a(
231
+ P,
232
232
  {
233
- onClick: P,
234
- className: k(c),
233
+ onClick: S,
234
+ className: I(c),
235
235
  size: "sm",
236
236
  variant: "outline",
237
237
  children: [
@@ -241,22 +241,22 @@ function Xe({
241
241
  }
242
242
  ),
243
243
  f && /* @__PURE__ */ e(Ve, { className: c, variant: "default" }),
244
- l && /* @__PURE__ */ e(Te, { className: c }),
244
+ n && /* @__PURE__ */ e(Te, { className: c }),
245
245
  /* @__PURE__ */ a(B, { modal: !1, children: [
246
246
  /* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(
247
- A,
247
+ P,
248
248
  {
249
249
  variant: "outline",
250
250
  size: "sm",
251
- className: k(c, "w-8 p-0"),
251
+ className: I(c, "w-8 p-0"),
252
252
  children: /* @__PURE__ */ e(z, { className: "h-4 w-4" })
253
253
  }
254
254
  ) }),
255
255
  /* @__PURE__ */ e(U, { align: "end", children: /* @__PURE__ */ a(
256
256
  G,
257
257
  {
258
- onClick: (m) => {
259
- m.stopPropagation(), v(!0);
258
+ onClick: (h) => {
259
+ h.stopPropagation(), w(!0);
260
260
  },
261
261
  children: [
262
262
  /* @__PURE__ */ e(j, { className: "mr-2 h-4 w-4" }),
@@ -266,17 +266,17 @@ function Xe({
266
266
  ) })
267
267
  ] })
268
268
  ] }),
269
- !o && /* @__PURE__ */ a(B, { modal: !1, children: [
269
+ !l && /* @__PURE__ */ a(B, { modal: !1, children: [
270
270
  /* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(
271
- A,
271
+ P,
272
272
  {
273
273
  variant: "outline",
274
274
  size: "sm",
275
- className: k(c, "w-8 p-0"),
275
+ className: I(c, "w-8 p-0"),
276
276
  children: /* @__PURE__ */ e(z, { className: "h-4 w-4" })
277
277
  }
278
278
  ) }),
279
- /* @__PURE__ */ e(U, { align: "end", children: /* @__PURE__ */ a(G, { onClick: () => v(!0), children: [
279
+ /* @__PURE__ */ e(U, { align: "end", children: /* @__PURE__ */ a(G, { onClick: () => w(!0), children: [
280
280
  /* @__PURE__ */ e(j, { className: "mr-2 h-4 w-4" }),
281
281
  "Save As..."
282
282
  ] }) })
@@ -285,14 +285,14 @@ function Xe({
285
285
  /* @__PURE__ */ e(
286
286
  Ge,
287
287
  {
288
- open: b,
289
- onOpenChange: (m) => {
290
- d || v(m);
288
+ open: g,
289
+ onOpenChange: (h) => {
290
+ D || w(h);
291
291
  },
292
- isLibraryVisual: w,
293
- currentVisualName: N,
294
- isSaving: d,
295
- onConfirm: C
292
+ isLibraryVisual: N,
293
+ currentVisualName: x,
294
+ isSaving: D,
295
+ onConfirm: p
296
296
  }
297
297
  )
298
298
  ] });
@@ -302,17 +302,17 @@ function Ye({
302
302
  //labelClassName,
303
303
  switchClassName: i
304
304
  }) {
305
- const t = E((o) => o.isDevMode), r = x((o) => o.isVisualEditing), { setIsDevMode: n } = oe(), { config: u } = Le(le).tokenProps, s = (u == null ? void 0 : u.showAdvancedMode) !== !1;
306
- return !r || !s ? null : /* @__PURE__ */ a("div", { className: k("flex items-center space-x-2", c), children: [
305
+ const r = E((l) => l.isDevMode), o = b((l) => l.isVisualEditing), { setIsDevMode: d } = oe(), { config: m } = Le(le).tokenProps, s = (m == null ? void 0 : m.showAdvancedMode) !== !1;
306
+ return !o || !s ? null : /* @__PURE__ */ a("div", { className: I("flex items-center space-x-2", c), children: [
307
307
  /* @__PURE__ */ e(
308
308
  ne,
309
309
  {
310
- className: k("", i),
311
- checked: t,
312
- onCheckedChange: () => n(!t),
310
+ className: I("", i),
311
+ checked: r,
312
+ onCheckedChange: () => d(!r),
313
313
  id: "advanced-mode",
314
314
  icon: /* @__PURE__ */ e(de, { className: "h-4 w-4" }),
315
- tooltip: t ? "Standard Mode" : "Advanced Mode"
315
+ tooltip: r ? "Standard Mode" : "Advanced Mode"
316
316
  }
317
317
  ),
318
318
  /* @__PURE__ */ e("label", { htmlFor: "advanced-mode", className: "sr-only", children: "Advanced Mode" })
@@ -321,12 +321,12 @@ function Ye({
321
321
  function qe({
322
322
  open: c,
323
323
  onOpenChange: i,
324
- onSave: t,
325
- onDiscard: r,
326
- isSaving: n
324
+ onSave: r,
325
+ onDiscard: o,
326
+ isSaving: d
327
327
  }) {
328
328
  return /* @__PURE__ */ e(ie, { open: c, onOpenChange: (s) => {
329
- !s && n || i(s);
329
+ !s && d || i(s);
330
330
  }, children: /* @__PURE__ */ a(ce, { className: "max-w-md", children: [
331
331
  /* @__PURE__ */ a(he, { children: [
332
332
  /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
@@ -339,7 +339,7 @@ function qe({
339
339
  /* @__PURE__ */ e(
340
340
  ve,
341
341
  {
342
- disabled: n,
342
+ disabled: d,
343
343
  className: "order-1 m-0 border-border/50 sm:order-1",
344
344
  children: "Cancel"
345
345
  }
@@ -347,8 +347,8 @@ function qe({
347
347
  /* @__PURE__ */ e(
348
348
  "button",
349
349
  {
350
- onClick: r,
351
- disabled: n,
350
+ onClick: o,
351
+ disabled: d,
352
352
  className: "order-2 rounded-md border border-destructive/20 bg-destructive/10 px-4 py-2 text-sm font-medium text-destructive transition-colors hover:bg-destructive/20 disabled:pointer-events-none disabled:opacity-50 sm:order-2",
353
353
  children: "Discard"
354
354
  }
@@ -356,10 +356,10 @@ function qe({
356
356
  /* @__PURE__ */ e(
357
357
  ge,
358
358
  {
359
- onClick: t,
360
- disabled: n,
359
+ onClick: r,
360
+ disabled: d,
361
361
  className: "order-3 m-0 bg-primary text-primary-foreground hover:bg-primary/90 sm:order-3",
362
- children: n ? /* @__PURE__ */ a(F, { children: [
362
+ children: d ? /* @__PURE__ */ a(F, { children: [
363
363
  /* @__PURE__ */ e(T, { className: "mr-2 h-4 w-4 animate-spin" }),
364
364
  "Saving..."
365
365
  ] }) : "Save & Close"
@@ -368,31 +368,31 @@ function qe({
368
368
  ] })
369
369
  ] }) });
370
370
  }
371
- function Je(c, i, t, r) {
371
+ function Je(c, i, r, o) {
372
372
  ze(() => {
373
- c && !t && i && r(be(i));
374
- }, [c, t, i, r]);
373
+ c && !r && i && o(be(i));
374
+ }, [c, r, i, o]);
375
375
  }
376
376
  function Ze({
377
377
  triggerButtonClassName: c
378
378
  }) {
379
- const [i, t] = D(!1), r = x((o) => {
380
- var l;
381
- return (l = o.dashboard) == null ? void 0 : l.id;
382
- }), n = x((o) => {
383
- var l;
384
- return (l = o.dashboard) == null ? void 0 : l.title;
385
- }), u = x((o) => {
386
- var l;
387
- return (l = o.dashboard) == null ? void 0 : l.sheets;
388
- }), s = x((o) => o.selectedSheetId);
389
- return u == null || u.find((o) => o.id === s), r ? /* @__PURE__ */ a(F, { children: [
379
+ const [i, r] = C(!1), o = b((l) => {
380
+ var n;
381
+ return (n = l.dashboard) == null ? void 0 : n.id;
382
+ }), d = b((l) => {
383
+ var n;
384
+ return (n = l.dashboard) == null ? void 0 : n.title;
385
+ }), m = b((l) => {
386
+ var n;
387
+ return (n = l.dashboard) == null ? void 0 : n.sheets;
388
+ }), s = b((l) => l.selectedSheetId);
389
+ return m == null || m.find((l) => l.id === s), o ? /* @__PURE__ */ a(F, { children: [
390
390
  /* @__PURE__ */ e(
391
391
  Ce,
392
392
  {
393
393
  tooltip: "Schedule Dashboard",
394
- className: k("h-7 p-2", c),
395
- onClick: () => t(!0),
394
+ className: I("h-7 p-2", c),
395
+ onClick: () => r(!0),
396
396
  children: /* @__PURE__ */ e(we, { className: "size-4" })
397
397
  }
398
398
  ),
@@ -400,9 +400,9 @@ function Ze({
400
400
  xe,
401
401
  {
402
402
  open: i,
403
- onOpenChange: t,
404
- dashboardId: r,
405
- dashboardName: n
403
+ onOpenChange: r,
404
+ dashboardId: o,
405
+ dashboardName: d
406
406
  }
407
407
  )
408
408
  ] }) : null;
@@ -411,53 +411,54 @@ function ea({
411
411
  open: c,
412
412
  onOpenChange: i
413
413
  }) {
414
- const [t, r] = D(!1), [n, u] = D(!1), [s, o] = D({
414
+ const [r, o] = C(!1), [d, m] = C(!1), [s, l] = C({
415
415
  sheetSelection: "current",
416
416
  protectPdf: !1,
417
417
  password: ""
418
- }), l = x((d) => {
419
- var p;
420
- return (p = d.dashboard) == null ? void 0 : p.sheets;
421
- }), f = x((d) => d.selectedSheetId), { tokenProps: b } = De(), v = l == null ? void 0 : l.find((d) => d.id === f), C = ((l == null ? void 0 : l.length) || 0) > 1, w = () => {
422
- o({
418
+ }), n = b((t) => {
419
+ var S;
420
+ return (S = t.dashboard) == null ? void 0 : S.sheets;
421
+ }), f = b((t) => t.selectedSheetId), { authToken: g, tokenProps: w } = De(), p = n == null ? void 0 : n.find((t) => t.id === f), N = ((n == null ? void 0 : n.length) || 0) > 1, x = () => {
422
+ l({
423
423
  sheetSelection: "current",
424
424
  protectPdf: !1,
425
425
  password: ""
426
- }), r(!1), i(!1);
426
+ }), o(!1), i(!1);
427
427
  };
428
- async function N() {
428
+ async function D() {
429
429
  if (s.protectPdf && !s.password) {
430
- g.error("Please enter a password to protect the PDF");
430
+ v.error("Please enter a password to protect the PDF");
431
431
  return;
432
432
  }
433
- u(!0);
434
- const d = s.sheetSelection === "all" ? "Generating PDF for all sheets... This may take a while." : s.protectPdf ? "Generating protected PDF... may take up to 60 seconds" : "Generating PDF... may take up to 60 seconds", p = g.loading(d);
433
+ m(!0);
434
+ const t = s.sheetSelection === "all" ? "Generating PDF for all sheets... This may take a while." : s.protectPdf ? "Generating protected PDF... may take up to 60 seconds" : "Generating PDF... may take up to 60 seconds", S = v.loading(t);
435
435
  try {
436
- await ke(
437
- b.apiServiceUrl,
436
+ await Ie(
437
+ w.apiServiceUrl,
438
+ g,
438
439
  s.protectPdf ? s.password : void 0,
439
440
  s.sheetSelection
440
- ), g.dismiss(p);
441
- const P = s.sheetSelection === "all" ? "All sheets PDF downloaded successfully!" : s.protectPdf ? "Protected PDF downloaded successfully!" : "PDF downloaded successfully!";
442
- g.success(P, {
441
+ ), v.dismiss(S);
442
+ const h = s.sheetSelection === "all" ? "All sheets PDF downloaded successfully!" : s.protectPdf ? "Protected PDF downloaded successfully!" : "PDF downloaded successfully!";
443
+ v.success(h, {
443
444
  duration: 2e3
444
- }), w();
445
- } catch (P) {
446
- g.dismiss(p), g.error("Failed to download PDF", {
445
+ }), x();
446
+ } catch (h) {
447
+ v.dismiss(S), v.error("Failed to download PDF", {
447
448
  description: "Please try again or contact support.",
448
449
  richColors: !0
449
- }), console.error("PDF download error:", P);
450
+ }), console.error("PDF download error:", h);
450
451
  } finally {
451
- u(!1);
452
+ m(!1);
452
453
  }
453
454
  }
454
455
  return /* @__PURE__ */ e(
455
456
  $,
456
457
  {
457
458
  open: c,
458
- onOpenChange: (d) => {
459
- if (!d) {
460
- w();
459
+ onOpenChange: (t) => {
460
+ if (!t) {
461
+ x();
461
462
  return;
462
463
  }
463
464
  i(!0);
@@ -468,28 +469,28 @@ function ea({
468
469
  /* @__PURE__ */ e(K, { children: "Export your dashboard as a PDF document." })
469
470
  ] }),
470
471
  /* @__PURE__ */ a("div", { className: "space-y-4 py-4", children: [
471
- C && /* @__PURE__ */ a(F, { children: [
472
+ N && /* @__PURE__ */ a(F, { children: [
472
473
  /* @__PURE__ */ a("div", { className: "space-y-3", children: [
473
- /* @__PURE__ */ e(S, { children: "Export Scope" }),
474
+ /* @__PURE__ */ e(A, { children: "Export Scope" }),
474
475
  /* @__PURE__ */ a(
475
476
  ye,
476
477
  {
477
478
  value: s.sheetSelection,
478
- onValueChange: (d) => o({
479
+ onValueChange: (t) => l({
479
480
  ...s,
480
- sheetSelection: d
481
+ sheetSelection: t
481
482
  }),
482
483
  children: [
483
484
  /* @__PURE__ */ a("div", { className: "flex items-center space-x-2", children: [
484
485
  /* @__PURE__ */ e(R, { value: "current", id: "scope-current" }),
485
486
  /* @__PURE__ */ a(
486
- S,
487
+ A,
487
488
  {
488
489
  htmlFor: "scope-current",
489
490
  className: "cursor-pointer font-normal",
490
491
  children: [
491
492
  "This sheet (",
492
- (v == null ? void 0 : v.title) || "Current",
493
+ (p == null ? void 0 : p.title) || "Current",
493
494
  ")"
494
495
  ]
495
496
  }
@@ -498,13 +499,13 @@ function ea({
498
499
  /* @__PURE__ */ a("div", { className: "flex items-center space-x-2", children: [
499
500
  /* @__PURE__ */ e(R, { value: "all", id: "scope-all" }),
500
501
  /* @__PURE__ */ a(
501
- S,
502
+ A,
502
503
  {
503
504
  htmlFor: "scope-all",
504
505
  className: "cursor-pointer font-normal",
505
506
  children: [
506
507
  "All sheets (",
507
- l == null ? void 0 : l.length,
508
+ n == null ? void 0 : n.length,
508
509
  " sheets)"
509
510
  ]
510
511
  }
@@ -523,17 +524,17 @@ function ea({
523
524
  {
524
525
  id: "protect-pdf",
525
526
  checked: s.protectPdf,
526
- onCheckedChange: (d) => {
527
- o({
527
+ onCheckedChange: (t) => {
528
+ l({
528
529
  ...s,
529
- protectPdf: d,
530
- password: d ? s.password : ""
531
- }), d || r(!1);
530
+ protectPdf: t,
531
+ password: t ? s.password : ""
532
+ }), t || o(!1);
532
533
  }
533
534
  }
534
535
  ),
535
536
  /* @__PURE__ */ a(
536
- S,
537
+ A,
537
538
  {
538
539
  htmlFor: "protect-pdf",
539
540
  className: "flex cursor-pointer items-center text-sm font-normal",
@@ -545,31 +546,31 @@ function ea({
545
546
  )
546
547
  ] }),
547
548
  s.protectPdf && /* @__PURE__ */ a("div", { className: "ml-6 space-y-2", children: [
548
- /* @__PURE__ */ e(S, { htmlFor: "pdf-password", className: "text-sm", children: "Password" }),
549
+ /* @__PURE__ */ e(A, { htmlFor: "pdf-password", className: "text-sm", children: "Password" }),
549
550
  /* @__PURE__ */ a("div", { className: "relative", children: [
550
551
  /* @__PURE__ */ e(
551
552
  Ae,
552
553
  {
553
554
  id: "pdf-password",
554
- type: t ? "text" : "password",
555
+ type: r ? "text" : "password",
555
556
  value: s.password,
556
- onChange: (d) => o({ ...s, password: d.target.value }),
557
+ onChange: (t) => l({ ...s, password: t.target.value }),
557
558
  placeholder: "Enter password",
558
559
  className: "pr-10",
559
- onKeyDown: (d) => {
560
- d.key === "Enter" && s.password && N();
560
+ onKeyDown: (t) => {
561
+ t.key === "Enter" && s.password && D();
561
562
  }
562
563
  }
563
564
  ),
564
565
  /* @__PURE__ */ e(
565
- A,
566
+ P,
566
567
  {
567
568
  type: "button",
568
569
  variant: "ghost",
569
570
  size: "sm",
570
571
  className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
571
- onClick: () => r(!t),
572
- children: t ? /* @__PURE__ */ e(Pe, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ e(Fe, { className: "h-4 w-4 text-muted-foreground" })
572
+ onClick: () => o(!r),
573
+ children: r ? /* @__PURE__ */ e(Pe, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ e(Fe, { className: "h-4 w-4 text-muted-foreground" })
573
574
  }
574
575
  )
575
576
  ] }),
@@ -578,12 +579,12 @@ function ea({
578
579
  ] })
579
580
  ] }),
580
581
  /* @__PURE__ */ a(Q, { children: [
581
- /* @__PURE__ */ e(A, { variant: "outline", onClick: w, disabled: n, children: "Cancel" }),
582
- /* @__PURE__ */ e(A, { onClick: N, disabled: n, children: n ? /* @__PURE__ */ a(F, { children: [
582
+ /* @__PURE__ */ e(P, { variant: "outline", onClick: x, disabled: d, children: "Cancel" }),
583
+ /* @__PURE__ */ e(P, { onClick: D, disabled: d, children: d ? /* @__PURE__ */ a(F, { children: [
583
584
  /* @__PURE__ */ e(T, { className: "mr-2 h-4 w-4 animate-spin" }),
584
585
  "Exporting..."
585
586
  ] }) : /* @__PURE__ */ a(F, { children: [
586
- /* @__PURE__ */ e(Ie, { className: "mr-2 h-4 w-4" }),
587
+ /* @__PURE__ */ e(ke, { className: "mr-2 h-4 w-4" }),
587
588
  "Export"
588
589
  ] }) })
589
590
  ] })