react-semaphor 0.1.142 → 0.1.144

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 (28) hide show
  1. package/dist/chunks/{dashboard-controls-BMLlOkS9.js → dashboard-controls-BG6qR7N2.js} +3 -3
  2. package/dist/chunks/{dashboard-controls-BdQcYRkf.js → dashboard-controls-_rTkbfKU.js} +1 -1
  3. package/dist/chunks/{dashboard-export-dialog-BpNaUA5x.js → dashboard-export-dialog-BXuJmTUR.js} +1 -1
  4. package/dist/chunks/{dashboard-export-dialog-CbMcLZvW.js → dashboard-export-dialog-iH6sg1-y.js} +3 -3
  5. package/dist/chunks/{dashboard-json-DD-d9gYu.js → dashboard-json-CV6LkrYw.js} +1 -1
  6. package/dist/chunks/{dashboard-json-DgQozDAv.js → dashboard-json-DZkwc1co.js} +1 -1
  7. package/dist/chunks/edit-dashboard-visual-TG6Ezk2J.js +195 -0
  8. package/dist/chunks/{edit-dashboard-visual-CRMhXxdG.js → edit-dashboard-visual-tCgjsYbu.js} +4402 -4786
  9. package/dist/chunks/{editor-action-buttons-CNQtSzD5.js → editor-action-buttons-Cvg5mWPC.js} +2 -2
  10. package/dist/chunks/{editor-action-buttons-DYrSZQhJ.js → editor-action-buttons-Czzj0JBw.js} +1 -1
  11. package/dist/chunks/{index-CReqnEJI.js → index-CPBGb2zs.js} +210 -205
  12. package/dist/chunks/{index-QdSI9E0a.js → index-Do9K-YLk.js} +15834 -15584
  13. package/dist/chunks/{resource-management-panel-CBXn6QHi.js → resource-management-panel-Chc6oyIG.js} +274 -263
  14. package/dist/chunks/resource-management-panel-DyeJEtOT.js +6 -0
  15. package/dist/chunks/{use-visual-utils-BnCl386t.js → use-visual-utils-Bf6l2e8y.js} +1 -1
  16. package/dist/chunks/{use-visual-utils-BDuNB0Iz.js → use-visual-utils-Dtg1I8ku.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/style.css +1 -1
  22. package/dist/surfboard/index.cjs +1 -1
  23. package/dist/surfboard/index.js +1 -1
  24. package/package.json +1 -1
  25. package/dist/chunks/edit-dashboard-visual-CR3NqJ7m.js +0 -200
  26. package/dist/chunks/resource-management-panel-CXSx9QhW.js +0 -6
  27. package/dist/chunks/use-click-outside-B9T3lmcw.js +0 -1
  28. package/dist/chunks/use-click-outside-CMeO_QFI.js +0 -16
@@ -1,15 +1,14 @@
1
1
  import { jsx as e, jsxs as a, Fragment as me } from "react/jsx-runtime";
2
- import { b as We, u as de, f as qe, ao as ne, b5 as Je, b6 as Qe, c as ee, b7 as Ye, aG as Xe, aH as Ze, B as G, aI as $e, aJ as ke, aK as Q, b8 as ce, L as ie, b9 as et, ba as tt, bb as st, bc as Ne, bd as pe, be as at, bf as nt, I as it, bg as we, bh as re, bi as ye, bj as Ce, bk as rt, K as ve, R as Se, bl as Ve, aO as Ee, aP as Le, aQ as Te, aS as Ae, aT as Oe, aU as Pe, aV as Re, aW as Ie, bm as ot, bn as lt, bo as Ue, bp as je, bq as Me, br as dt, bs as Fe, bt as ct, aE as ae, an as ut, bu as ht, bv as Be, bw as mt, bx as pt, as as ft, at as gt, au as Dt, av as xt, aw as Nt, ax as be, ay as ue, aB as bt, by as wt, bz as yt, bA as Ct, bB as vt } from "./index-QdSI9E0a.js";
3
- import St, { useState as g, useEffect as he } from "react";
4
- import { a as ze } from "./use-visual-utils-BnCl386t.js";
5
- import { u as Vt } from "./use-click-outside-CMeO_QFI.js";
2
+ import { b as We, u as ce, f as qe, ao as ie, b5 as Je, b6 as Qe, c as ee, b7 as Ye, aG as Xe, aH as Ze, B as G, aI as $e, aJ as ke, aK as Q, b8 as ue, L as re, b9 as et, ba as tt, bb as st, bc as Ne, bd as pe, be as at, bf as nt, I as it, bg as we, bh as oe, bi as ve, bj as ye, bk as rt, K as Ce, R as Se, bl as Ee, aO as Ve, aP as Le, aQ as Ae, aS as Te, aT as Oe, aU as Re, aV as Pe, aW as Ie, bm as ot, bn as lt, bo as Ue, bp as je, bq as Me, br as dt, bs as Fe, bt as ct, aE as ae, an as ut, bu as ht, bv as Be, bw as mt, bx as pt, as as ft, at as gt, au as Dt, av as xt, aw as Nt, ax as be, ay as he, aB as bt, by as wt, bz as vt, bA as yt, bB as Ct } from "./index-Do9K-YLk.js";
3
+ import St, { useRef as Et, useEffect as ne, useState as x } from "react";
4
+ import { a as ze } from "./use-visual-utils-Bf6l2e8y.js";
6
5
  /**
7
6
  * @license lucide-react v0.453.0 - ISC
8
7
  *
9
8
  * This source code is licensed under the ISC license.
10
9
  * See the LICENSE file in the root directory of this source tree.
11
10
  */
12
- const Et = We("FolderOpen", [
11
+ const Vt = We("FolderOpen", [
13
12
  [
14
13
  "path",
15
14
  {
@@ -18,6 +17,18 @@ const Et = We("FolderOpen", [
18
17
  }
19
18
  ]
20
19
  ]);
20
+ function Lt(t, f = {}) {
21
+ const { enabled: m = !0, eventType: r = "mousedown" } = f, o = Et(null);
22
+ return ne(() => {
23
+ const g = (D) => {
24
+ const i = D.target;
25
+ o.current && o.current.contains(i) || i instanceof Element && (i.closest("[data-radix-popper-content-wrapper]") || i.closest("[data-radix-select-content]") || i.closest("[data-radix-popover-content]") || i.closest("[data-radix-dropdown-menu-content]") || i.closest("[data-radix-tooltip-content]") || i.closest('[role="listbox"]') || i.closest('[role="option"]') || i.closest('[role="combobox"]')) || i instanceof Element && i.hasAttribute("data-radix-") || t();
26
+ };
27
+ return m && document.addEventListener(r, g), () => {
28
+ document.removeEventListener(r, g);
29
+ };
30
+ }, [t, m, r]), o;
31
+ }
21
32
  function He() {
22
33
  return /* @__PURE__ */ e("div", { className: "space-y-1 px-2 py-2", children: [...Array(5)].map((t, f) => /* @__PURE__ */ a(
23
34
  "div",
@@ -34,43 +45,43 @@ function He() {
34
45
  f
35
46
  )) });
36
47
  }
37
- const Lt = (t) => {
38
- const f = de((r) => r.isVisualEditing), p = de((r) => r.selectedFrameId), i = qe((r) => r.frame);
39
- return !!(f && p && (i == null ? void 0 : i.visualId) === t);
48
+ const At = (t) => {
49
+ const f = ce((o) => o.isVisualEditing), m = ce((o) => o.selectedFrameId), r = qe((o) => o.frame);
50
+ return !!(f && m && (r == null ? void 0 : r.visualId) === t);
40
51
  };
41
52
  function Tt({
42
53
  visual: t,
43
54
  isDeleting: f,
44
- isDuplicating: p,
45
- onAddVisual: i,
46
- onOpenVisual: r,
47
- onEditDetails: D,
48
- onDeleteClick: x,
49
- onDuplicateVisual: m,
55
+ isDuplicating: m,
56
+ onAddVisual: r,
57
+ onOpenVisual: o,
58
+ onEditDetails: g,
59
+ onDeleteClick: D,
60
+ onDuplicateVisual: i,
50
61
  // onTogglePrivacy,
51
62
  onShareVisual: N,
52
- formatDate: S
63
+ formatDate: C
53
64
  }) {
54
- var P, v, y, A;
55
- const { selectVisual: l } = ne(), d = Je(t.id), h = Lt(t.id), { isConsoleMode: V } = Qe(), E = St.useRef(null), [b, C] = g(!1), [L, T] = g(!1);
56
- he(() => {
57
- p ? (C(!0), T(!0)) : L && (C(!1), T(!1));
58
- }, [p, L]), he(() => {
59
- h && E.current && E.current.scrollIntoView({
65
+ var R, S, v, T;
66
+ const { selectVisual: d } = ie(), c = Je(t.id), p = At(t.id), { isConsoleMode: E } = Qe(), V = St.useRef(null), [b, y] = x(!1), [L, A] = x(!1);
67
+ ne(() => {
68
+ m ? (y(!0), A(!0)) : L && (y(!1), A(!1));
69
+ }, [m, L]), ne(() => {
70
+ p && V.current && V.current.scrollIntoView({
60
71
  behavior: "smooth",
61
72
  block: "center"
62
73
  });
63
- }, [h]);
74
+ }, [p]);
64
75
  const I = () => {
65
- l(t), r == null || r(t);
76
+ d(t), o == null || o(t);
66
77
  };
67
78
  return /* @__PURE__ */ a(
68
79
  "div",
69
80
  {
70
- ref: E,
81
+ ref: V,
71
82
  className: ee(
72
83
  "group flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition-colors hover:bg-muted",
73
- h ? "bg-purple-500/10" : d && "bg-muted/80"
84
+ p ? "bg-purple-500/10" : c && "bg-muted/80"
74
85
  ),
75
86
  onClick: I,
76
87
  children: [
@@ -90,7 +101,7 @@ function Tt({
90
101
  {
91
102
  className: "truncate text-xs text-muted-foreground",
92
103
  title: t.description || "No description",
93
- children: (P = t.description) != null && P.trim() ? t.description : "No description"
104
+ children: (R = t.description) != null && R.trim() ? t.description : "No description"
94
105
  }
95
106
  )
96
107
  ] }),
@@ -98,25 +109,25 @@ function Tt({
98
109
  "div",
99
110
  {
100
111
  className: "flex flex-shrink-0 items-center gap-1",
101
- onClick: (c) => c.stopPropagation(),
112
+ onClick: (u) => u.stopPropagation(),
102
113
  children: [
103
114
  /* @__PURE__ */ e("div", { className: "opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ a(
104
115
  Xe,
105
116
  {
106
117
  modal: !1,
107
118
  open: b,
108
- onOpenChange: C,
119
+ onOpenChange: y,
109
120
  children: [
110
121
  /* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(G, { size: "sm", variant: "ghost", className: "h-6 w-6 p-0", children: /* @__PURE__ */ e($e, { className: "h-3 w-3" }) }) }),
111
122
  /* @__PURE__ */ a(ke, { align: "end", className: "z-[51] w-40", children: [
112
123
  /* @__PURE__ */ a(
113
124
  Q,
114
125
  {
115
- onClick: (c) => {
116
- c.stopPropagation(), i(t);
126
+ onClick: (u) => {
127
+ u.stopPropagation(), r(t);
117
128
  },
118
129
  children: [
119
- /* @__PURE__ */ e(ce, { className: "mr-2 h-3 w-3" }),
130
+ /* @__PURE__ */ e(ue, { className: "mr-2 h-3 w-3" }),
120
131
  "Add"
121
132
  ]
122
133
  }
@@ -124,11 +135,11 @@ function Tt({
124
135
  /* @__PURE__ */ a(
125
136
  Q,
126
137
  {
127
- onClick: (c) => {
128
- c.stopPropagation(), r == null || r(t);
138
+ onClick: (u) => {
139
+ u.stopPropagation(), o == null || o(t);
129
140
  },
130
141
  children: [
131
- /* @__PURE__ */ e(Et, { className: "mr-2 h-3 w-3" }),
142
+ /* @__PURE__ */ e(Vt, { className: "mr-2 h-3 w-3" }),
132
143
  "Open"
133
144
  ]
134
145
  }
@@ -136,13 +147,13 @@ function Tt({
136
147
  /* @__PURE__ */ a(
137
148
  Q,
138
149
  {
139
- onClick: (c) => {
140
- c.preventDefault(), c.stopPropagation(), m(t.id);
150
+ onClick: (u) => {
151
+ u.preventDefault(), u.stopPropagation(), i(t.id);
141
152
  },
142
- disabled: p,
153
+ disabled: m,
143
154
  children: [
144
- p ? /* @__PURE__ */ e(ie, { className: "mr-2 h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(et, { className: "mr-2 h-3 w-3" }),
145
- p ? "Duplicating..." : "Duplicate"
155
+ m ? /* @__PURE__ */ e(re, { className: "mr-2 h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(et, { className: "mr-2 h-3 w-3" }),
156
+ m ? "Duplicating..." : "Duplicate"
146
157
  ]
147
158
  }
148
159
  ),
@@ -150,8 +161,8 @@ function Tt({
150
161
  /* @__PURE__ */ a(
151
162
  Q,
152
163
  {
153
- onClick: (c) => {
154
- c.stopPropagation(), D == null || D(t);
164
+ onClick: (u) => {
165
+ u.stopPropagation(), g == null || g(t);
155
166
  },
156
167
  children: [
157
168
  /* @__PURE__ */ e(tt, { className: "mr-2 h-3 w-3" }),
@@ -162,8 +173,8 @@ function Tt({
162
173
  /* @__PURE__ */ a(
163
174
  Q,
164
175
  {
165
- onClick: (c) => {
166
- c.stopPropagation(), N(t);
176
+ onClick: (u) => {
177
+ u.stopPropagation(), N(t);
167
178
  },
168
179
  children: [
169
180
  /* @__PURE__ */ e(st, { className: "mr-2 h-3 w-3" }),
@@ -175,8 +186,8 @@ function Tt({
175
186
  /* @__PURE__ */ a(
176
187
  Q,
177
188
  {
178
- onClick: (c) => {
179
- c.stopPropagation(), x(t);
189
+ onClick: (u) => {
190
+ u.stopPropagation(), D(t);
180
191
  },
181
192
  className: "text-destructive",
182
193
  disabled: f,
@@ -189,13 +200,13 @@ function Tt({
189
200
  ] }),
190
201
  /* @__PURE__ */ e(Ne, {}),
191
202
  /* @__PURE__ */ a("div", { className: "space-y-1 px-2 py-2 text-xs text-slate-500 dark:text-slate-400", children: [
192
- (((v = t.ownership.createdBy) == null ? void 0 : v.type) === "tenant" || ((y = t.ownership.createdBy) == null ? void 0 : y.type) === "organization" && V) && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
203
+ (((S = t.ownership.createdBy) == null ? void 0 : S.type) === "tenant" || ((v = t.ownership.createdBy) == null ? void 0 : v.type) === "organization" && E) && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
193
204
  /* @__PURE__ */ e(at, { className: "h-3 w-3" }),
194
- /* @__PURE__ */ e("span", { children: ((A = t.ownership.createdBy) == null ? void 0 : A.name) || "Unknown" })
205
+ /* @__PURE__ */ e("span", { children: ((T = t.ownership.createdBy) == null ? void 0 : T.name) || "Unknown" })
195
206
  ] }),
196
207
  /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
197
208
  /* @__PURE__ */ e(nt, { className: "h-3 w-3" }),
198
- /* @__PURE__ */ e("span", { children: S(t.lastModified) })
209
+ /* @__PURE__ */ e("span", { children: C(t.lastModified) })
199
210
  ] })
200
211
  ] })
201
212
  ] })
@@ -209,12 +220,12 @@ function Tt({
209
220
  buttonProps: {
210
221
  variant: "ghost",
211
222
  size: "sm",
212
- onClick: (c) => {
213
- c.stopPropagation(), i(t);
223
+ onClick: (u) => {
224
+ u.stopPropagation(), r(t);
214
225
  }
215
226
  },
216
227
  className: "h-6 w-6 p-0",
217
- children: /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" })
228
+ children: /* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5" })
218
229
  }
219
230
  )
220
231
  ]
@@ -226,47 +237,47 @@ function Tt({
226
237
  t.id
227
238
  );
228
239
  }
229
- function At({ searchQuery: t }) {
230
- const [f, p] = g(!1), [i, r] = g(
240
+ function Ot({ searchQuery: t }) {
241
+ const [f, m] = x(!1), [r, o] = x(
231
242
  null
232
- ), [D, x] = g(!1), [m, N] = g(null), [S, l] = g(null), [d, h] = g(
243
+ ), [g, D] = x(!1), [i, N] = x(null), [C, d] = x(null), [c, p] = x(
233
244
  null
234
- ), { selectVisual: V } = ne(), { handleEditLibraryVisual: E, handleAddLibraryVisual: b } = ze(), {
235
- resources: C,
245
+ ), { selectVisual: E } = ie(), { handleEditLibraryVisual: V, handleAddLibraryVisual: b } = ze(), {
246
+ resources: y,
236
247
  isLoading: L,
237
- isError: T,
248
+ isError: A,
238
249
  updateResource: I,
239
- deleteResource: P,
240
- duplicateResource: v,
241
- isDeleting: y
250
+ deleteResource: R,
251
+ duplicateResource: S,
252
+ isDeleting: v
242
253
  } = we(() => {
243
- x(!1), N(null);
254
+ D(!1), N(null);
244
255
  });
245
- re();
246
- const A = C.filter(
256
+ oe();
257
+ const T = y.filter(
247
258
  (n) => {
248
- var O, o;
249
- return ((O = n == null ? void 0 : n.title) == null ? void 0 : O.toLowerCase().includes(t.toLowerCase())) || ((o = n == null ? void 0 : n.description) == null ? void 0 : o.toLowerCase().includes(t.toLowerCase()));
259
+ var O, l;
260
+ return ((O = n == null ? void 0 : n.title) == null ? void 0 : O.toLowerCase().includes(t.toLowerCase())) || ((l = n == null ? void 0 : n.description) == null ? void 0 : l.toLowerCase().includes(t.toLowerCase()));
250
261
  }
251
- ), c = (n) => new Date(n).toLocaleDateString("en-US", {
262
+ ), u = (n) => new Date(n).toLocaleDateString("en-US", {
252
263
  month: "short",
253
264
  day: "numeric",
254
265
  year: "numeric"
255
266
  }), M = (n) => {
256
- N(n), x(!0);
267
+ N(n), D(!0);
257
268
  }, Y = () => {
258
- m && P(m.id);
269
+ i && R(i.id);
259
270
  }, {
260
271
  startUpdating: F,
261
272
  stopUpdating: W,
262
- isUpdating: R
263
- } = ye(), B = (n, O, o) => {
273
+ isUpdating: P
274
+ } = ve(), B = (n, O, l) => {
264
275
  var se;
265
276
  const J = Object.fromEntries(
266
277
  Object.entries(O).filter(([, j]) => j !== void 0)
267
278
  );
268
279
  if (Object.keys(J).length === 0) {
269
- (se = o == null ? void 0 : o.onSuccess) == null || se.call(o);
280
+ (se = l == null ? void 0 : l.onSuccess) == null || se.call(l);
270
281
  return;
271
282
  }
272
283
  const te = Object.keys(J), k = te.length === 1 ? te[0] : void 0;
@@ -278,24 +289,24 @@ function At({ searchQuery: t }) {
278
289
  {
279
290
  onSuccess: () => {
280
291
  var j;
281
- W(n, k), (j = o == null ? void 0 : o.onSuccess) == null || j.call(o);
292
+ W(n, k), (j = l == null ? void 0 : l.onSuccess) == null || j.call(l);
282
293
  },
283
294
  onError: () => {
284
295
  var j;
285
- W(n, k), (j = o == null ? void 0 : o.onError) == null || j.call(o);
296
+ W(n, k), (j = l == null ? void 0 : l.onError) == null || j.call(l);
286
297
  }
287
298
  }
288
299
  );
289
300
  }, z = (n) => {
290
- l(n), v(n, {
291
- onSettled: () => l(null)
301
+ d(n), S(n, {
302
+ onSettled: () => d(null)
292
303
  });
293
304
  }, X = (n) => {
294
- E(n);
305
+ V(n);
295
306
  }, H = (n) => {
296
307
  b(n);
297
308
  }, Z = (n) => {
298
- const O = C.find((o) => o.id === n);
309
+ const O = y.find((l) => l.id === n);
299
310
  O && I({
300
311
  resourceId: n,
301
312
  data: {
@@ -303,25 +314,25 @@ function At({ searchQuery: t }) {
303
314
  }
304
315
  });
305
316
  }, _ = (n) => {
306
- r(n), p(!0);
317
+ o(n), m(!0);
307
318
  }, q = (n) => {
308
- h(n);
319
+ p(n);
309
320
  }, w = () => {
310
- h(null);
321
+ p(null);
311
322
  }, $ = ({
312
323
  title: n,
313
324
  description: O
314
325
  }) => {
315
- if (!d)
326
+ if (!c)
316
327
  return;
317
- const o = {};
318
- n !== d.title && (o.title = n), (d.description || "") !== O && (o.description = O), B(d.id, o, {
328
+ const l = {};
329
+ n !== c.title && (l.title = n), (c.description || "") !== O && (l.description = O), B(c.id, l, {
319
330
  onSuccess: () => {
320
- h(null);
331
+ p(null);
321
332
  }
322
333
  });
323
334
  };
324
- return L ? /* @__PURE__ */ e(He, {}) : T ? /* @__PURE__ */ e(Ce, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
335
+ return L ? /* @__PURE__ */ e(He, {}) : A ? /* @__PURE__ */ e(ye, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
325
336
  /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load visuals" }),
326
337
  /* @__PURE__ */ e(
327
338
  G,
@@ -334,11 +345,11 @@ function At({ searchQuery: t }) {
334
345
  }
335
346
  )
336
347
  ] }) }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
337
- /* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: A.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
348
+ /* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: T.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
338
349
  /* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(rt, { className: "mx-auto h-12 w-12 text-muted-foreground/50" }) }),
339
350
  /* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: t ? "No visuals found" : "No visuals yet" }),
340
351
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t ? "Try adjusting your search" : 'Click "Create" above to add your first visual' })
341
- ] }) : A.map((n) => /* @__PURE__ */ e(
352
+ ] }) : T.map((n) => /* @__PURE__ */ e(
342
353
  Tt,
343
354
  {
344
355
  visual: n,
@@ -349,52 +360,52 @@ function At({ searchQuery: t }) {
349
360
  onDuplicateVisual: z,
350
361
  onTogglePrivacy: Z,
351
362
  onShareVisual: _,
352
- isDeleting: y,
353
- isDuplicating: S === n.id,
354
- formatDate: c
363
+ isDeleting: v,
364
+ isDuplicating: C === n.id,
365
+ formatDate: u
355
366
  },
356
367
  n.id
357
368
  )) }),
358
- f && i && /* @__PURE__ */ e(
359
- ve,
369
+ f && r && /* @__PURE__ */ e(
370
+ Ce,
360
371
  {
361
- resource: i,
372
+ resource: r,
362
373
  resourceType: Se.VISUAL,
363
374
  onClose: () => {
364
- p(!1), r(null);
375
+ m(!1), o(null);
365
376
  }
366
377
  }
367
378
  ),
368
- d && /* @__PURE__ */ e(
369
- Ve,
379
+ c && /* @__PURE__ */ e(
380
+ Ee,
370
381
  {
371
- open: !!d,
382
+ open: !!c,
372
383
  resourceLabel: "Visual",
373
- initialTitle: d.title || "",
374
- initialDescription: d.description || "",
384
+ initialTitle: c.title || "",
385
+ initialDescription: c.description || "",
375
386
  onClose: w,
376
387
  onSave: $,
377
- isSaving: R(d.id)
388
+ isSaving: P(c.id)
378
389
  }
379
390
  ),
380
391
  /* @__PURE__ */ e(
381
- Ee,
392
+ Ve,
382
393
  {
383
- open: D,
394
+ open: g,
384
395
  onOpenChange: (n) => {
385
- !n && y || (x(n), n || N(null));
396
+ !n && v || (D(n), n || N(null));
386
397
  },
387
398
  children: /* @__PURE__ */ a(Le, { children: [
388
- /* @__PURE__ */ a(Te, { children: [
389
- /* @__PURE__ */ e(Ae, { children: "Delete Visual" }),
399
+ /* @__PURE__ */ a(Ae, { children: [
400
+ /* @__PURE__ */ e(Te, { children: "Delete Visual" }),
390
401
  /* @__PURE__ */ a(Oe, { children: [
391
402
  'Are you sure you want to delete "',
392
- m == null ? void 0 : m.title,
403
+ i == null ? void 0 : i.title,
393
404
  '"? This action cannot be undone.'
394
405
  ] })
395
406
  ] }),
396
- /* @__PURE__ */ a(Pe, { children: [
397
- /* @__PURE__ */ e(Re, { disabled: y, children: "Cancel" }),
407
+ /* @__PURE__ */ a(Re, { children: [
408
+ /* @__PURE__ */ e(Pe, { disabled: v, children: "Cancel" }),
398
409
  /* @__PURE__ */ a(
399
410
  Ie,
400
411
  {
@@ -402,10 +413,10 @@ function At({ searchQuery: t }) {
402
413
  n.preventDefault(), n.stopPropagation(), Y();
403
414
  },
404
415
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
405
- disabled: y,
416
+ disabled: v,
406
417
  children: [
407
- y ? /* @__PURE__ */ e(ie, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(pe, { className: "mr-2 h-3.5 w-3.5" }),
408
- y ? "Deleting..." : "Delete"
418
+ v ? /* @__PURE__ */ e(re, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(pe, { className: "mr-2 h-3.5 w-3.5" }),
419
+ v ? "Deleting..." : "Delete"
409
420
  ]
410
421
  }
411
422
  )
@@ -415,33 +426,33 @@ function At({ searchQuery: t }) {
415
426
  )
416
427
  ] });
417
428
  }
418
- function Ot({
429
+ function Rt({
419
430
  dashboard: t,
420
431
  isDeleting: f,
421
- isDuplicating: p,
422
- isDefault: i,
423
- onLoadDashboard: r,
424
- onEditDetails: D,
425
- onDeleteClick: x,
426
- onDuplicateDashboard: m,
432
+ isDuplicating: m,
433
+ isDefault: r,
434
+ onLoadDashboard: o,
435
+ onEditDetails: g,
436
+ onDeleteClick: D,
437
+ onDuplicateDashboard: i,
427
438
  onShareDashboard: N,
428
- formatDate: S,
429
- onDashboardItemClick: l
439
+ formatDate: C,
440
+ onDashboardItemClick: d
430
441
  }) {
431
- var P, v;
432
- const { selectDashboard: d } = ne(), h = ot(t.id), { userContext: V, isLoading: E } = re(), { mutate: b } = lt(), C = ((P = V == null ? void 0 : V.permissions) == null ? void 0 : P.canEdit) ?? !1, L = E || !C, T = () => {
433
- d(t), r(t.id), l == null || l(t.id);
434
- }, I = (y) => {
435
- y.stopPropagation(), b({ dashboardId: i ? null : t.id });
442
+ var R, S;
443
+ const { selectDashboard: c } = ie(), p = ot(t.id), { userContext: E, isLoading: V } = oe(), { mutate: b } = lt(), y = ((R = E == null ? void 0 : E.permissions) == null ? void 0 : R.canEdit) ?? !1, L = V || !y, A = () => {
444
+ c(t), o(t.id), d == null || d(t.id);
445
+ }, I = (v) => {
446
+ v.stopPropagation(), b({ dashboardId: r ? null : t.id });
436
447
  };
437
448
  return /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ a(
438
449
  "div",
439
450
  {
440
451
  className: ee(
441
452
  "group flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition-colors hover:bg-muted",
442
- h && "bg-muted/80"
453
+ p && "bg-muted/80"
443
454
  ),
444
- onClick: T,
455
+ onClick: A,
445
456
  children: [
446
457
  /* @__PURE__ */ a(je, { children: [
447
458
  /* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e(
@@ -454,13 +465,13 @@ function Ot({
454
465
  {
455
466
  className: ee(
456
467
  "h-4 w-4 transition-colors",
457
- i ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground/40 hover:text-yellow-400"
468
+ r ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground/40 hover:text-yellow-400"
458
469
  )
459
470
  }
460
471
  )
461
472
  }
462
473
  ) }),
463
- /* @__PURE__ */ e(Fe, { side: "right", className: "text-xs", children: i ? "Remove as default" : "Set as default" })
474
+ /* @__PURE__ */ e(Fe, { side: "right", className: "text-xs", children: r ? "Remove as default" : "Set as default" })
464
475
  ] }),
465
476
  /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-2", children: [
466
477
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
@@ -477,7 +488,7 @@ function Ot({
477
488
  {
478
489
  className: "truncate text-xs text-muted-foreground",
479
490
  title: t.description || "No description",
480
- children: (v = t.description) != null && v.trim() ? t.description : "No description"
491
+ children: (S = t.description) != null && S.trim() ? t.description : "No description"
481
492
  }
482
493
  )
483
494
  ] }),
@@ -486,13 +497,13 @@ function Ot({
486
497
  {
487
498
  dashboard: t,
488
499
  isDeleting: f,
489
- isDuplicating: p,
500
+ isDuplicating: m,
490
501
  shouldHideActions: L,
491
- onEditDetails: D,
492
- onDeleteClick: x,
493
- onDuplicateDashboard: m,
502
+ onEditDetails: g,
503
+ onDeleteClick: D,
504
+ onDuplicateDashboard: i,
494
505
  onShareDashboard: N,
495
- formatDate: S
506
+ formatDate: C
496
507
  }
497
508
  ) })
498
509
  ] }) })
@@ -502,89 +513,89 @@ function Ot({
502
513
  ) });
503
514
  }
504
515
  function Pt({ onRetry: t }) {
505
- return /* @__PURE__ */ e(Ce, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
516
+ return /* @__PURE__ */ e(ye, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
506
517
  /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load dashboards" }),
507
518
  /* @__PURE__ */ e(G, { variant: "outline", size: "sm", className: "mt-2", onClick: t, children: "Retry" })
508
519
  ] }) });
509
520
  }
510
- function Rt(t) {
521
+ function It(t) {
511
522
  var fe, ge;
512
- const { searchQuery: f, onLoadDashboard: p, onEditDashboard: i, onDashboardItemClick: r } = t, [D, x] = g(!1), [m, N] = g(
523
+ const { searchQuery: f, onLoadDashboard: m, onEditDashboard: r, onDashboardItemClick: o } = t, [g, D] = x(!1), [i, N] = x(
513
524
  null
514
- ), [S, l] = g(!1), [d, h] = g(null), [V, E] = g(null), [b, C] = g(null), L = ae(
525
+ ), [C, d] = x(!1), [c, p] = x(null), [E, V] = x(null), [b, y] = x(null), L = ae(
515
526
  (s) => s.lastSelectedDashboard
516
- ), T = ae(
527
+ ), A = ae(
517
528
  (s) => s.selectedDashboard
518
529
  ), I = ae(
519
530
  (s) => s.actions.selectDashboard
520
- ), P = ae(
531
+ ), R = ae(
521
532
  (s) => s.actions.clearSelectedDashboard
522
- ), { tokenProps: v, id: y } = ut();
533
+ ), { tokenProps: S, id: v } = ut();
523
534
  ht();
524
535
  const {
525
- resources: A,
526
- isLoading: c,
536
+ resources: T,
537
+ isLoading: u,
527
538
  isError: M,
528
539
  updateResource: Y,
529
540
  deleteResource: F,
530
541
  duplicateResource: W,
531
- isDeleting: R
542
+ isDeleting: P
532
543
  } = Be(() => {
533
- l(!1);
534
- const s = d == null ? void 0 : d.id;
535
- h(null), (T == null ? void 0 : T.id) === s && (!(v != null && v.dashboard_id) && !y ? P() : L && L.id !== s && I(L));
536
- }), { currentUser: B, userContext: z } = re(), X = ((fe = z == null ? void 0 : z.permissions) == null ? void 0 : fe.canCreateDashboard) ?? !1, { data: H } = mt(), Z = ((ge = H == null ? void 0 : H.preference) == null ? void 0 : ge.defaultDashboardId) || null, _ = A.filter(
544
+ d(!1);
545
+ const s = c == null ? void 0 : c.id;
546
+ p(null), (A == null ? void 0 : A.id) === s && (!(S != null && S.dashboard_id) && !v ? R() : L && L.id !== s && I(L));
547
+ }), { currentUser: B, userContext: z } = oe(), X = ((fe = z == null ? void 0 : z.permissions) == null ? void 0 : fe.canCreateDashboard) ?? !1, { data: H } = mt(), Z = ((ge = H == null ? void 0 : H.preference) == null ? void 0 : ge.defaultDashboardId) || null, _ = T.filter(
537
548
  (s) => {
538
- var U, u;
539
- return ((U = s == null ? void 0 : s.title) == null ? void 0 : U.toLowerCase().includes(f.toLowerCase())) || ((u = s == null ? void 0 : s.description) == null ? void 0 : u.toLowerCase().includes(f.toLowerCase()));
549
+ var U, h;
550
+ return ((U = s == null ? void 0 : s.title) == null ? void 0 : U.toLowerCase().includes(f.toLowerCase())) || ((h = s == null ? void 0 : s.description) == null ? void 0 : h.toLowerCase().includes(f.toLowerCase()));
540
551
  }
541
552
  ), q = (s) => new Date(s).toLocaleDateString("en-US", {
542
553
  month: "short",
543
554
  day: "numeric",
544
555
  year: "numeric"
545
556
  }), w = (s) => {
546
- p == null || p(s);
557
+ m == null || m(s);
547
558
  }, $ = (s) => {
548
- h(s), l(!0);
559
+ p(s), d(!0);
549
560
  }, n = () => {
550
- d && F(d.id);
561
+ c && F(c.id);
551
562
  }, O = (s) => {
552
- E(s), W(s, {
553
- onSettled: () => E(null)
563
+ V(s), W(s, {
564
+ onSettled: () => V(null)
554
565
  });
555
566
  }, {
556
- startUpdating: o,
567
+ startUpdating: l,
557
568
  stopUpdating: J,
558
569
  isUpdating: te
559
- } = ye(), k = (s, U, u) => {
570
+ } = ve(), k = (s, U, h) => {
560
571
  var xe;
561
- const oe = Object.fromEntries(
572
+ const le = Object.fromEntries(
562
573
  Object.entries(U).filter(([, K]) => K !== void 0)
563
574
  );
564
- if (Object.keys(oe).length === 0) {
565
- (xe = u == null ? void 0 : u.onSuccess) == null || xe.call(u);
575
+ if (Object.keys(le).length === 0) {
576
+ (xe = h == null ? void 0 : h.onSuccess) == null || xe.call(h);
566
577
  return;
567
578
  }
568
- const De = Object.keys(oe), le = De.length === 1 ? De[0] : void 0;
569
- o(s, le), Y(
579
+ const De = Object.keys(le), de = De.length === 1 ? De[0] : void 0;
580
+ l(s, de), Y(
570
581
  {
571
582
  resourceId: s,
572
- data: oe
583
+ data: le
573
584
  },
574
585
  {
575
586
  onSuccess: () => {
576
587
  var K;
577
- J(s, le), (K = u == null ? void 0 : u.onSuccess) == null || K.call(u);
588
+ J(s, de), (K = h == null ? void 0 : h.onSuccess) == null || K.call(h);
578
589
  },
579
590
  onError: () => {
580
591
  var K;
581
- J(s, le), (K = u == null ? void 0 : u.onError) == null || K.call(u);
592
+ J(s, de), (K = h == null ? void 0 : h.onError) == null || K.call(h);
582
593
  }
583
594
  }
584
595
  );
585
596
  }, se = (s) => {
586
- const U = A.find(
587
- (u) => u.id === s
597
+ const U = T.find(
598
+ (h) => h.id === s
588
599
  );
589
600
  U && Y({
590
601
  resourceId: s,
@@ -593,35 +604,35 @@ function Rt(t) {
593
604
  }
594
605
  });
595
606
  }, j = (s) => {
596
- N(s), B == null || B.type, x(!0);
607
+ N(s), B == null || B.type, D(!0);
597
608
  }, _e = (s) => {
598
- i == null || i(s.id), C(s);
609
+ r == null || r(s.id), y(s);
599
610
  }, Ke = () => {
600
- C(null);
611
+ y(null);
601
612
  }, Ge = ({
602
613
  title: s,
603
614
  description: U
604
615
  }) => {
605
616
  if (!b)
606
617
  return;
607
- const u = {};
608
- s !== b.title && (u.title = s), (b.description || "") !== U && (u.description = U), k(b.id, u, {
618
+ const h = {};
619
+ s !== b.title && (h.title = s), (b.description || "") !== U && (h.description = U), k(b.id, h, {
609
620
  onSuccess: () => {
610
- C(null);
621
+ y(null);
611
622
  }
612
623
  });
613
624
  };
614
- return c ? /* @__PURE__ */ e(He, {}) : M ? /* @__PURE__ */ e(Pt, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
625
+ return u ? /* @__PURE__ */ e(He, {}) : M ? /* @__PURE__ */ e(Pt, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
615
626
  /* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: _.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
616
627
  /* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(pt, { className: "mx-auto h-12 w-12 text-muted-foreground/50" }) }),
617
628
  /* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: f ? "No dashboards found" : "No dashboards yet" }),
618
629
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: f ? "Try adjusting your search" : X ? 'Click "Create" above to add your first dashboard' : "No dashboards have been shared with you yet" })
619
630
  ] }) : _.map((s) => /* @__PURE__ */ e(
620
- Ot,
631
+ Rt,
621
632
  {
622
633
  dashboard: s,
623
- isDeleting: R,
624
- isDuplicating: V === s.id,
634
+ isDeleting: P,
635
+ isDuplicating: E === s.id,
625
636
  isDefault: s.id === Z,
626
637
  onLoadDashboard: w,
627
638
  onEditDetails: _e,
@@ -630,38 +641,38 @@ function Rt(t) {
630
641
  onTogglePrivacy: se,
631
642
  onShareDashboard: j,
632
643
  formatDate: q,
633
- onDashboardItemClick: r
644
+ onDashboardItemClick: o
634
645
  },
635
646
  s.id
636
647
  )) }),
637
- D && m && /* @__PURE__ */ e(
638
- ve,
648
+ g && i && /* @__PURE__ */ e(
649
+ Ce,
639
650
  {
640
- resource: m,
651
+ resource: i,
641
652
  resourceType: Se.DASHBOARD,
642
653
  onClose: () => {
643
- x(!1), N(null);
654
+ D(!1), N(null);
644
655
  }
645
656
  }
646
657
  ),
647
658
  /* @__PURE__ */ e(
648
- Ee,
659
+ Ve,
649
660
  {
650
- open: S,
661
+ open: C,
651
662
  onOpenChange: (s) => {
652
- !s && R || (l(s), s || h(null));
663
+ !s && P || (d(s), s || p(null));
653
664
  },
654
665
  children: /* @__PURE__ */ a(Le, { children: [
655
- /* @__PURE__ */ a(Te, { children: [
656
- /* @__PURE__ */ e(Ae, { children: "Delete Dashboard" }),
666
+ /* @__PURE__ */ a(Ae, { children: [
667
+ /* @__PURE__ */ e(Te, { children: "Delete Dashboard" }),
657
668
  /* @__PURE__ */ a(Oe, { children: [
658
669
  'Are you sure you want to delete "',
659
- d == null ? void 0 : d.title,
670
+ c == null ? void 0 : c.title,
660
671
  '"? This action cannot be undone.'
661
672
  ] })
662
673
  ] }),
663
- /* @__PURE__ */ a(Pe, { children: [
664
- /* @__PURE__ */ e(Re, { disabled: R, children: "Cancel" }),
674
+ /* @__PURE__ */ a(Re, { children: [
675
+ /* @__PURE__ */ e(Pe, { disabled: P, children: "Cancel" }),
665
676
  /* @__PURE__ */ a(
666
677
  Ie,
667
678
  {
@@ -669,10 +680,10 @@ function Rt(t) {
669
680
  s.preventDefault(), s.stopPropagation(), n();
670
681
  },
671
682
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
672
- disabled: R,
683
+ disabled: P,
673
684
  children: [
674
- R ? /* @__PURE__ */ e(ie, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(pe, { className: "mr-2 h-3.5 w-3.5" }),
675
- R ? "Deleting..." : "Delete"
685
+ P ? /* @__PURE__ */ e(re, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(pe, { className: "mr-2 h-3.5 w-3.5" }),
686
+ P ? "Deleting..." : "Delete"
676
687
  ]
677
688
  }
678
689
  )
@@ -681,7 +692,7 @@ function Rt(t) {
681
692
  }
682
693
  ),
683
694
  b && /* @__PURE__ */ e(
684
- Ve,
695
+ Ee,
685
696
  {
686
697
  open: !!b,
687
698
  resourceLabel: "Dashboard",
@@ -694,22 +705,22 @@ function Rt(t) {
694
705
  )
695
706
  ] });
696
707
  }
697
- function It({
708
+ function Ut({
698
709
  open: t,
699
710
  onOpenChange: f,
700
- onSubmit: p,
701
- isCreating: i
711
+ onSubmit: m,
712
+ isCreating: r
702
713
  }) {
703
- const [r, D] = g(""), [x, m] = g("");
704
- he(() => {
705
- t || (D(""), m(""));
714
+ const [o, g] = x(""), [D, i] = x("");
715
+ ne(() => {
716
+ t || (g(""), i(""));
706
717
  }, [t]);
707
718
  const N = () => {
708
- r.trim() && p({ title: r, description: x });
709
- }, S = (l) => {
710
- f(l);
719
+ o.trim() && m({ title: o, description: D });
720
+ }, C = (d) => {
721
+ f(d);
711
722
  };
712
- return /* @__PURE__ */ e(ft, { open: t, onOpenChange: S, children: /* @__PURE__ */ a(gt, { children: [
723
+ return /* @__PURE__ */ e(ft, { open: t, onOpenChange: C, children: /* @__PURE__ */ a(gt, { children: [
713
724
  /* @__PURE__ */ a(Dt, { children: [
714
725
  /* @__PURE__ */ e(xt, { children: "Create New Visual" }),
715
726
  /* @__PURE__ */ e(Nt, { children: "Add a new visual to your library. You can configure it after creation." })
@@ -718,15 +729,15 @@ function It({
718
729
  /* @__PURE__ */ a("div", { className: "space-y-2", children: [
719
730
  /* @__PURE__ */ e(be, { htmlFor: "title", children: "Visual Title" }),
720
731
  /* @__PURE__ */ e(
721
- ue,
732
+ he,
722
733
  {
723
734
  id: "title",
724
735
  placeholder: "Enter visual title...",
725
- value: r,
726
- onChange: (l) => D(l.target.value),
727
- disabled: i,
728
- onKeyDown: (l) => {
729
- l.key === "Enter" && !l.shiftKey && (l.preventDefault(), N());
736
+ value: o,
737
+ onChange: (d) => g(d.target.value),
738
+ disabled: r,
739
+ onKeyDown: (d) => {
740
+ d.key === "Enter" && !d.shiftKey && (d.preventDefault(), N());
730
741
  }
731
742
  }
732
743
  )
@@ -734,13 +745,13 @@ function It({
734
745
  /* @__PURE__ */ a("div", { className: "space-y-2", children: [
735
746
  /* @__PURE__ */ e(be, { htmlFor: "description", children: "Description (optional)" }),
736
747
  /* @__PURE__ */ e(
737
- ue,
748
+ he,
738
749
  {
739
750
  id: "description",
740
751
  placeholder: "Enter visual description...",
741
- value: x,
742
- onChange: (l) => m(l.target.value),
743
- disabled: i
752
+ value: D,
753
+ onChange: (d) => i(d.target.value),
754
+ disabled: r
744
755
  }
745
756
  )
746
757
  ] })
@@ -750,8 +761,8 @@ function It({
750
761
  G,
751
762
  {
752
763
  variant: "outline",
753
- onClick: () => S(!1),
754
- disabled: i,
764
+ onClick: () => C(!1),
765
+ disabled: r,
755
766
  children: "Cancel"
756
767
  }
757
768
  ),
@@ -759,9 +770,9 @@ function It({
759
770
  G,
760
771
  {
761
772
  onClick: N,
762
- disabled: !r.trim() || i,
763
- children: i ? /* @__PURE__ */ a(me, { children: [
764
- /* @__PURE__ */ e(ie, { className: "mr-2 h-4 w-4 animate-spin" }),
773
+ disabled: !o.trim() || r,
774
+ children: r ? /* @__PURE__ */ a(me, { children: [
775
+ /* @__PURE__ */ e(re, { className: "mr-2 h-4 w-4 animate-spin" }),
765
776
  "Creating..."
766
777
  ] }) : "Create Visual"
767
778
  }
@@ -772,118 +783,118 @@ function It({
772
783
  function zt({
773
784
  isOpen: t,
774
785
  onClose: f,
775
- className: p,
776
- onDashboardItemClick: i,
777
- variant: r = "inline"
786
+ className: m,
787
+ onDashboardItemClick: r,
788
+ variant: o = "inline"
778
789
  }) {
779
790
  var _, q;
780
- const D = de(
791
+ const g = ce(
781
792
  (w) => w.isDashboardEditing
782
- ), [x, m] = g(!1), [N, S] = g(""), [l, d] = g(!1), { currentUser: h, userContext: V } = re(), E = ((_ = V == null ? void 0 : V.permissions) == null ? void 0 : _.canCreateDashboard) ?? !1, { onCreateSuccess: b } = wt({
783
- onDashboardSelect: i
784
- }), { selectVisual: C } = ne(), { handleEditLibraryVisual: L } = ze(), {
785
- createResource: T,
793
+ ), [D, i] = x(!1), [N, C] = x(""), [d, c] = x(!1), { currentUser: p, userContext: E } = oe(), V = ((_ = E == null ? void 0 : E.permissions) == null ? void 0 : _.canCreateDashboard) ?? !1, { onCreateSuccess: b } = wt({
794
+ onDashboardSelect: r
795
+ }), { selectVisual: y } = ie(), { handleEditLibraryVisual: L } = ze(), {
796
+ createResource: A,
786
797
  isCreating: I,
787
- refetch: P
788
- } = Be(), { createResource: v, isCreating: y } = we(
798
+ refetch: R
799
+ } = Be(), { createResource: S, isCreating: v } = we(
789
800
  void 0,
790
801
  // onDeleteSuccess (not needed here)
791
802
  (w) => {
792
- m(!1), w && (C(w), L(w));
803
+ i(!1), w && (y(w), L(w));
793
804
  }
794
- ), A = r === "overlay", c = ((h == null ? void 0 : h.name) ?? "").trim(), M = ((h == null ? void 0 : h.email) ?? "").trim(), F = c && c.toLowerCase() !== "undefined" ? c : M || "Current user", W = ((q = F.charAt(0)) == null ? void 0 : q.toUpperCase()) || "?", R = M && M.toLowerCase() !== "undefined" ? M : "", B = Vt(f, {
795
- enabled: t && A
805
+ ), T = o === "overlay", u = ((p == null ? void 0 : p.name) ?? "").trim(), M = ((p == null ? void 0 : p.email) ?? "").trim(), F = u && u.toLowerCase() !== "undefined" ? u : M || "Current user", W = ((q = F.charAt(0)) == null ? void 0 : q.toUpperCase()) || "?", P = M && M.toLowerCase() !== "undefined" ? M : "", B = Lt(f, {
806
+ enabled: t && T
796
807
  }), z = ee(
797
808
  "flex h-full flex-col border-r bg-background",
798
- A ? ee(
809
+ T ? ee(
799
810
  "absolute inset-y-0 left-0 z-[51] w-60 shadow-lg transition-transform duration-300 ease-in-out",
800
811
  t ? "translate-x-0" : "pointer-events-none -translate-x-full"
801
812
  ) : "w-full max-w-[17rem] min-w-[11rem] overflow-hidden shadow-sm",
802
- p
813
+ m
803
814
  ), X = (w) => {
804
815
  }, H = (w) => {
805
816
  console.log("Editing dashboard:", w);
806
817
  }, Z = (w) => {
807
- T(w, {
818
+ A(w, {
808
819
  onSuccess: ($) => {
809
- m(!1), b($, P);
820
+ i(!1), b($, R);
810
821
  }
811
822
  });
812
823
  };
813
- return /* @__PURE__ */ e(me, { children: (!A || t) && /* @__PURE__ */ a("div", { ref: B, className: z, children: [
824
+ return /* @__PURE__ */ e(me, { children: (!T || t) && /* @__PURE__ */ a("div", { ref: B, className: z, children: [
814
825
  /* @__PURE__ */ a("div", { className: "border-b border-border", children: [
815
826
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-1.5", children: [
816
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e("h2", { className: "whitespace-nowrap text-sm font-semibold", children: D ? "Visuals" : "Dashboards" }) }),
827
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e("h2", { className: "whitespace-nowrap text-sm font-semibold", children: g ? "Visuals" : "Dashboards" }) }),
817
828
  /* @__PURE__ */ a("div", { className: "flex items-center gap-0", children: [
818
829
  /* @__PURE__ */ e(
819
830
  G,
820
831
  {
821
832
  size: "sm",
822
833
  variant: "ghost",
823
- onClick: () => d(!l),
834
+ onClick: () => c(!d),
824
835
  className: "h-8 w-8 p-0",
825
- children: /* @__PURE__ */ e(yt, { className: "h-3.5 w-3.5" })
836
+ children: /* @__PURE__ */ e(vt, { className: "h-3.5 w-3.5" })
826
837
  }
827
838
  ),
828
- (D || E) && /* @__PURE__ */ e(
839
+ (g || V) && /* @__PURE__ */ e(
829
840
  G,
830
841
  {
831
842
  size: "sm",
832
843
  variant: "ghost",
833
844
  className: "h-8 w-8 whitespace-nowrap p-0",
834
- onClick: () => m(!0),
835
- children: /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" })
845
+ onClick: () => i(!0),
846
+ children: /* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5" })
836
847
  }
837
848
  )
838
849
  ] })
839
850
  ] }),
840
- l && /* @__PURE__ */ e("div", { className: "bg-muted/30 px-4 pb-3", children: /* @__PURE__ */ e(
841
- ue,
851
+ d && /* @__PURE__ */ e("div", { className: "bg-muted/30 px-4 pb-3", children: /* @__PURE__ */ e(
852
+ he,
842
853
  {
843
854
  placeholder: "Search...",
844
855
  value: N,
845
- onChange: (w) => S(w.target.value),
856
+ onChange: (w) => C(w.target.value),
846
857
  className: "h-8 border-muted-foreground/20 bg-background text-sm focus-visible:border-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0",
847
858
  autoFocus: !0
848
859
  }
849
860
  ) })
850
861
  ] }),
851
- /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children: D ? /* @__PURE__ */ e(At, { searchQuery: N }) : /* @__PURE__ */ e(
852
- Rt,
862
+ /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children: g ? /* @__PURE__ */ e(Ot, { searchQuery: N }) : /* @__PURE__ */ e(
863
+ It,
853
864
  {
854
865
  searchQuery: N,
855
866
  onLoadDashboard: X,
856
867
  onEditDashboard: H,
857
- onDashboardItemClick: i
868
+ onDashboardItemClick: r
858
869
  }
859
870
  ) }),
860
- h && /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
871
+ p && /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
861
872
  /* @__PURE__ */ a(je, { children: [
862
873
  /* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex h-6 w-6 cursor-default items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-primary", children: W }) }) }),
863
874
  /* @__PURE__ */ e(Fe, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: [
864
875
  /* @__PURE__ */ e("div", { className: "font-medium", children: F }),
865
- R && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: R }),
866
- h.role && /* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground", children: [
876
+ P && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: P }),
877
+ p.role && /* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground", children: [
867
878
  "Role: ",
868
- Ct(h.role.replace(/_/g, " "))
879
+ yt(p.role.replace(/_/g, " "))
869
880
  ] })
870
881
  ] }) })
871
882
  ] }),
872
883
  /* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children: F })
873
884
  ] }) }) }),
874
- D ? /* @__PURE__ */ e(
875
- It,
885
+ g ? /* @__PURE__ */ e(
886
+ Ut,
876
887
  {
877
- open: x,
878
- onOpenChange: m,
879
- onSubmit: v,
880
- isCreating: y
888
+ open: D,
889
+ onOpenChange: i,
890
+ onSubmit: S,
891
+ isCreating: v
881
892
  }
882
893
  ) : /* @__PURE__ */ e(
883
- vt,
894
+ Ct,
884
895
  {
885
- open: x,
886
- onOpenChange: m,
896
+ open: D,
897
+ onOpenChange: i,
887
898
  onSubmit: Z,
888
899
  isCreating: I
889
900
  }