react-semaphor 0.1.209 → 0.1.211

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