react-semaphor 0.1.159 → 0.1.162

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