react-semaphor 0.1.320 → 0.1.322

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 (48) hide show
  1. package/dist/brand-studio/index.cjs +1 -1
  2. package/dist/brand-studio/index.js +4 -4
  3. package/dist/briefings/index.cjs +1 -1
  4. package/dist/briefings/index.js +278 -208
  5. package/dist/chunks/{braces-NfG5hX2c.js → braces-C7BeIXvM.js} +1 -1
  6. package/dist/chunks/{braces-CDPz6CF2.js → braces-ZjRH2Kl7.js} +1 -1
  7. package/dist/chunks/{calendar-preferences-dialog-CFXQBJ4A.js → calendar-preferences-dialog-CZqePF6B.js} +1 -1
  8. package/dist/chunks/{calendar-preferences-dialog-B7Z8OnuZ.js → calendar-preferences-dialog-t0OOALVd.js} +3 -3
  9. package/dist/chunks/{chevrons-up-down-BsdQRmJL.js → chevrons-up-down-CA-XvN1o.js} +1 -1
  10. package/dist/chunks/{chevrons-up-down-DiWloubI.js → chevrons-up-down-Cuilz9aY.js} +1 -1
  11. package/dist/chunks/{dashboard-briefing-launcher-DB16djcj.js → dashboard-briefing-launcher-BYbnbZ9e.js} +933 -910
  12. package/dist/chunks/{dashboard-briefing-launcher-DjDpGyD7.js → dashboard-briefing-launcher-d1_fm91W.js} +17 -17
  13. package/dist/chunks/dashboard-controls-B3HHMRPC.js +52 -0
  14. package/dist/chunks/dashboard-controls-BuChCKDm.js +2246 -0
  15. package/dist/chunks/{dashboard-json-C8-kkiyT.js → dashboard-json-DgoYjD0O.js} +2 -2
  16. package/dist/chunks/{dashboard-json-2nyFJ_-w.js → dashboard-json-M5-VFCtZ.js} +1 -1
  17. package/dist/chunks/{edit-dashboard-visual-BP77bJFI.js → edit-dashboard-visual-BH8DP1qq.js} +1 -1
  18. package/dist/chunks/{edit-dashboard-visual-D6oiTlXr.js → edit-dashboard-visual-DP31ytwJ.js} +6 -6
  19. package/dist/chunks/{index-Clw0hJzi.js → index-ChmS5nsv.js} +28873 -28145
  20. package/dist/chunks/{index-D8eouWYC.js → index-CodH6sqg.js} +217 -212
  21. package/dist/chunks/{palette-CJTdBzJB.js → palette-CanPG11m.js} +1 -1
  22. package/dist/chunks/{palette-BlxLchHy.js → palette-D96DOM7E.js} +1 -1
  23. package/dist/chunks/resource-management-panel-D3vO68dH.js +6 -0
  24. package/dist/chunks/{resource-management-panel-HcRJRZHO.js → resource-management-panel-gt__S0Pb.js} +451 -369
  25. package/dist/chunks/{save-B8x5Vi0W.js → save-CqrBQKG6.js} +1 -1
  26. package/dist/chunks/{save-DVRQBMeb.js → save-DxkSzUTZ.js} +1 -1
  27. package/dist/chunks/{switch-DPaKnsb8.js → switch-BXICAlvS.js} +2 -2
  28. package/dist/chunks/{switch-sauemjyY.js → switch-Deo2Ltmj.js} +133 -133
  29. package/dist/chunks/{use-create-flow-overlay-state-CdCldE6J.js → use-create-flow-overlay-state-BZaSpL-c.js} +1 -1
  30. package/dist/chunks/{use-create-flow-overlay-state-75l5mrVp.js → use-create-flow-overlay-state-OA3iI54p.js} +104 -104
  31. package/dist/chunks/{use-visual-utils-CMdEUnM5.js → use-visual-utils-CMucAqbS.js} +1 -1
  32. package/dist/chunks/{use-visual-utils-Bd4Cf9_B.js → use-visual-utils-CsXS-Zeh.js} +20 -20
  33. package/dist/dashboard/index.cjs +1 -1
  34. package/dist/dashboard/index.js +1 -1
  35. package/dist/dashboard-authoring/index.cjs +3 -0
  36. package/dist/dashboard-authoring/index.js +532 -0
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +131 -130
  39. package/dist/style.css +1 -1
  40. package/dist/surfboard/index.cjs +1 -1
  41. package/dist/surfboard/index.js +2 -2
  42. package/dist/types/briefings.d.ts +15 -0
  43. package/dist/types/dashboard-authoring.d.ts +2703 -0
  44. package/dist/types/main.d.ts +145 -0
  45. package/package.json +6 -1
  46. package/dist/chunks/dashboard-controls-BisfskDD.js +0 -52
  47. package/dist/chunks/dashboard-controls-DPStW1kd.js +0 -1999
  48. package/dist/chunks/resource-management-panel-DTvY5OIq.js +0 -6
@@ -1,15 +1,15 @@
1
- import { jsx as e, jsxs as n, Fragment as le } from "react/jsx-runtime";
2
- import { c as je, u as ne, G as Fe, a as X, B as I, f as se, M as we, Q as ze, L as fe, a1 as ge, X as Be, Y as He, Z as Ke, _ as _e, a0 as Ge, a8 as Qe } from "./switch-sauemjyY.js";
3
- import Ye, { useState as w, useEffect as ae, useRef as qe } from "react";
4
- import { af as de, aj as Je, ak as We, al as ie, am as Xe, an as Ze, ao as $e, ap as ke, aq as W, ar as et, as as tt, at as nt, au as xe, av as ce, aw as at, ax as st, ay as Ne, az as be, aA as ot, H as ye, z as Ce, aB as ve, aC as Se, aD as Ee, aE as Ve, aF as Le, aG as Ae, aH as Oe, aI as Re, aJ as Te, aK as rt, aL as ue, aM as it, x as te, u as lt, aN as Ue, b as dt, c as ct, d as ut, e as ht, f as pt, n as mt, aO as ft, aP as De, aQ as gt, aR as xt } from "./index-Clw0hJzi.js";
5
- import { u as Ie } from "./use-visual-utils-Bd4Cf9_B.js";
1
+ import { jsx as e, jsxs as n, Fragment as oe } from "react/jsx-runtime";
2
+ import { c as _e, u as se, G as Ge, a as Z, B as A, f as te, M as be, Q as Ye, L as ie, a1 as de, X as ke, Y as Qe, Z as We, _ as Xe, a0 as Ze, ay as $e } from "./switch-Deo2Ltmj.js";
3
+ import qe, { useState as b, useEffect as ee, useRef as Je } from "react";
4
+ import { ag as ue, aK as et, aL as tt, aH as ce, aM as nt, aN as at, aO as st, aP as it, aQ as X, aR as ot, aS as rt, aT as lt, aU as xe, ay as he, aV as dt, aW as ct, aX as we, aY as Ne, aZ as ut, H as ye, z as Ce, a_ as ve, a$ as Se, b0 as Ee, b1 as Ve, b2 as Le, b3 as Oe, b4 as Ae, b5 as Te, b6 as Re, b7 as ht, b8 as pe, b9 as pt, x as ae, u as mt, ba as Ue, b as Ie, c as Me, d as Pe, e as ze, f as Fe, bb as ft, n as je, bc as gt, bd as De, be as xt } from "./index-ChmS5nsv.js";
5
+ import { u as Be } from "./use-visual-utils-CsXS-Zeh.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 Dt = je("FolderOpen", [
12
+ const Dt = _e("FolderOpen", [
13
13
  [
14
14
  "path",
15
15
  {
@@ -18,8 +18,8 @@ const Dt = je("FolderOpen", [
18
18
  }
19
19
  ]
20
20
  ]);
21
- function Me() {
22
- return /* @__PURE__ */ e("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((t, m) => /* @__PURE__ */ n(
21
+ function Ke() {
22
+ return /* @__PURE__ */ e("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((t, f) => /* @__PURE__ */ n(
23
23
  "div",
24
24
  {
25
25
  className: "flex animate-pulse items-start gap-3 rounded-xl border border-transparent px-2.5 py-2.5",
@@ -31,47 +31,47 @@ function Me() {
31
31
  ] })
32
32
  ]
33
33
  },
34
- m
34
+ f
35
35
  )) });
36
36
  }
37
- const wt = (t) => {
38
- const m = ne((i) => i.isVisualEditing), p = ne((i) => i.selectedFrameId), l = Fe((i) => i.frame);
39
- return !!(m && p && (l == null ? void 0 : l.visualId) === t);
37
+ const bt = (t) => {
38
+ const f = se((o) => o.isVisualEditing), m = se((o) => o.selectedFrameId), r = Ge((o) => o.frame);
39
+ return !!(f && m && (r == null ? void 0 : r.visualId) === t);
40
40
  };
41
- function Nt({
41
+ function wt({
42
42
  visual: t,
43
- isDeleting: m,
44
- isDuplicating: p,
45
- onAddVisual: l,
46
- onOpenVisual: i,
43
+ isDeleting: f,
44
+ isDuplicating: m,
45
+ onAddVisual: r,
46
+ onOpenVisual: o,
47
47
  onEditDetails: h,
48
- onDeleteClick: N,
49
- onDuplicateVisual: o,
50
- onShareVisual: b,
51
- formatDate: y
48
+ onDeleteClick: x,
49
+ onDuplicateVisual: i,
50
+ onShareVisual: D,
51
+ formatDate: w
52
52
  }) {
53
- var M, U, j, F;
54
- const { selectVisual: f } = de(), d = Je(t.id), u = wt(t.id), A = ne((r) => r.isVisualEditing), { isConsoleMode: T } = We(), x = Ye.useRef(null), [S, E] = w(!1), [V, O] = w(!1);
55
- ae(() => {
56
- p ? (E(!0), O(!0)) : V && (E(!1), O(!1));
57
- }, [p, V]), ae(() => {
58
- u && x.current && x.current.scrollIntoView({
53
+ var M, I, z, F;
54
+ const { selectVisual: l } = ue(), c = et(t.id), p = bt(t.id), O = se((d) => d.isVisualEditing), { isConsoleMode: U } = tt(), N = qe.useRef(null), [S, E] = b(!1), [V, T] = b(!1);
55
+ ee(() => {
56
+ m ? (E(!0), T(!0)) : V && (E(!1), T(!1));
57
+ }, [m, V]), ee(() => {
58
+ p && N.current && N.current.scrollIntoView({
59
59
  behavior: "smooth",
60
60
  block: "center"
61
61
  });
62
- }, [u]);
62
+ }, [p]);
63
63
  const C = () => {
64
- f(t), i == null || i(t);
65
- }, v = (r) => {
66
- r.currentTarget === r.target && (r.key === "Enter" || r.key === " ") && (r.preventDefault(), C());
64
+ l(t), o == null || o(t);
65
+ }, v = (d) => {
66
+ d.currentTarget === d.target && (d.key === "Enter" || d.key === " ") && (d.preventDefault(), C());
67
67
  };
68
68
  return /* @__PURE__ */ n(
69
69
  "div",
70
70
  {
71
- ref: x,
72
- className: X(
71
+ ref: N,
72
+ className: Z(
73
73
  "group flex cursor-pointer items-start gap-1 rounded-[5px] px-2 py-1.5 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",
74
- u ? "bg-muted ring-1 ring-inset ring-foreground/20" : d && "bg-muted"
74
+ p ? "bg-muted ring-1 ring-inset ring-foreground/20" : c && "bg-muted"
75
75
  ),
76
76
  onClick: C,
77
77
  children: [
@@ -105,70 +105,70 @@ function Nt({
105
105
  /* @__PURE__ */ e(
106
106
  "div",
107
107
  {
108
- className: X(
108
+ className: Z(
109
109
  "flex shrink-0 items-center transition-opacity",
110
- d || u || S ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100"
110
+ c || p || S ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100"
111
111
  ),
112
- onClick: (r) => r.stopPropagation(),
112
+ onClick: (d) => d.stopPropagation(),
113
113
  children: /* @__PURE__ */ n("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-[5px] border border-border/60 bg-background", children: [
114
114
  /* @__PURE__ */ n(
115
- I,
115
+ A,
116
116
  {
117
117
  size: "xs",
118
118
  variant: "ghost",
119
119
  className: "h-full rounded-none border-0 shadow-none hover:bg-accent/50",
120
- disabled: A,
121
- onClick: (r) => {
122
- r.stopPropagation(), l(t);
120
+ disabled: O,
121
+ onClick: (d) => {
122
+ d.stopPropagation(), r(t);
123
123
  },
124
124
  "aria-label": `Add ${t.title || "visual"}`,
125
125
  children: [
126
- /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5" }),
126
+ /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }),
127
127
  "Add"
128
128
  ]
129
129
  }
130
130
  ),
131
131
  /* @__PURE__ */ n(
132
- Xe,
132
+ nt,
133
133
  {
134
134
  modal: !1,
135
135
  open: S,
136
136
  onOpenChange: E,
137
137
  children: [
138
- /* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(
139
- I,
138
+ /* @__PURE__ */ e(at, { asChild: !0, children: /* @__PURE__ */ e(
139
+ A,
140
140
  {
141
141
  size: "xs",
142
142
  variant: "ghost",
143
143
  className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent/50",
144
144
  "aria-label": "Open visual actions",
145
- children: /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5" })
145
+ children: /* @__PURE__ */ e(st, { className: "h-3.5 w-3.5" })
146
146
  }
147
147
  ) }),
148
148
  /* @__PURE__ */ n(
149
- ke,
149
+ it,
150
150
  {
151
151
  align: "end",
152
152
  className: "z-[51] w-44 rounded-[6px] border border-border/60 p-1 shadow-sm",
153
153
  children: [
154
154
  /* @__PURE__ */ n(
155
- W,
155
+ X,
156
156
  {
157
- onClick: (r) => {
158
- r.stopPropagation(), l(t);
157
+ onClick: (d) => {
158
+ d.stopPropagation(), r(t);
159
159
  },
160
- disabled: A,
160
+ disabled: O,
161
161
  children: [
162
- /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5" }),
162
+ /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }),
163
163
  "Add"
164
164
  ]
165
165
  }
166
166
  ),
167
167
  /* @__PURE__ */ n(
168
- W,
168
+ X,
169
169
  {
170
- onClick: (r) => {
171
- r.stopPropagation(), i == null || i(t);
170
+ onClick: (d) => {
171
+ d.stopPropagation(), o == null || o(t);
172
172
  },
173
173
  children: [
174
174
  /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" }),
@@ -177,68 +177,68 @@ function Nt({
177
177
  }
178
178
  ),
179
179
  /* @__PURE__ */ n(
180
- W,
180
+ X,
181
181
  {
182
- onClick: (r) => {
183
- r.preventDefault(), r.stopPropagation(), o(t.id);
182
+ onClick: (d) => {
183
+ d.preventDefault(), d.stopPropagation(), i(t.id);
184
184
  },
185
- disabled: p,
185
+ disabled: m,
186
186
  children: [
187
- p ? /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
188
- p ? "Duplicating…" : "Duplicate"
187
+ m ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(ot, { className: "h-3.5 w-3.5" }),
188
+ m ? "Duplicating…" : "Duplicate"
189
189
  ]
190
190
  }
191
191
  ),
192
- t.ownership.isOwner && /* @__PURE__ */ n(le, { children: [
192
+ t.ownership.isOwner && /* @__PURE__ */ n(oe, { children: [
193
193
  /* @__PURE__ */ n(
194
- W,
194
+ X,
195
195
  {
196
- onClick: (r) => {
197
- r.stopPropagation(), h == null || h(t);
196
+ onClick: (d) => {
197
+ d.stopPropagation(), h == null || h(t);
198
198
  },
199
199
  children: [
200
- /* @__PURE__ */ e(tt, { className: "h-3.5 w-3.5" }),
200
+ /* @__PURE__ */ e(rt, { className: "h-3.5 w-3.5" }),
201
201
  "Edit details"
202
202
  ]
203
203
  }
204
204
  ),
205
205
  /* @__PURE__ */ n(
206
- W,
206
+ X,
207
207
  {
208
- onClick: (r) => {
209
- r.stopPropagation(), b(t);
208
+ onClick: (d) => {
209
+ d.stopPropagation(), D(t);
210
210
  },
211
211
  children: [
212
- /* @__PURE__ */ e(nt, { className: "h-3.5 w-3.5" }),
212
+ /* @__PURE__ */ e(lt, { className: "h-3.5 w-3.5" }),
213
213
  "Share"
214
214
  ]
215
215
  }
216
216
  ),
217
217
  /* @__PURE__ */ e(xe, {}),
218
218
  /* @__PURE__ */ n(
219
- W,
219
+ X,
220
220
  {
221
- onClick: (r) => {
222
- r.stopPropagation(), N(t);
221
+ onClick: (d) => {
222
+ d.stopPropagation(), x(t);
223
223
  },
224
224
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
225
- disabled: m,
225
+ disabled: f,
226
226
  children: [
227
- /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }),
228
- m ? "Deleting…" : "Delete"
227
+ /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" }),
228
+ f ? "Deleting…" : "Delete"
229
229
  ]
230
230
  }
231
231
  )
232
232
  ] }),
233
233
  /* @__PURE__ */ e(xe, {}),
234
234
  /* @__PURE__ */ n("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
235
- (((U = t.ownership.createdBy) == null ? void 0 : U.type) === "tenant" || ((j = t.ownership.createdBy) == null ? void 0 : j.type) === "organization" && T) && /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
236
- /* @__PURE__ */ e(at, { className: "h-3 w-3" }),
235
+ (((I = t.ownership.createdBy) == null ? void 0 : I.type) === "tenant" || ((z = t.ownership.createdBy) == null ? void 0 : z.type) === "organization" && U) && /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
236
+ /* @__PURE__ */ e(dt, { className: "h-3 w-3" }),
237
237
  /* @__PURE__ */ e("span", { children: ((F = t.ownership.createdBy) == null ? void 0 : F.name) || "Unknown" })
238
238
  ] }),
239
239
  /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
240
- /* @__PURE__ */ e(st, { className: "h-3 w-3" }),
241
- /* @__PURE__ */ e("span", { children: y(t.lastModified) })
240
+ /* @__PURE__ */ e(ct, { className: "h-3 w-3" }),
241
+ /* @__PURE__ */ e("span", { children: w(t.lastModified) })
242
242
  ] })
243
243
  ] })
244
244
  ]
@@ -254,95 +254,95 @@ function Nt({
254
254
  }
255
255
  );
256
256
  }
257
- function bt({ searchQuery: t }) {
258
- const [m, p] = w(!1), [l, i] = w(
257
+ function Nt({ searchQuery: t }) {
258
+ const [f, m] = b(!1), [r, o] = b(
259
259
  null
260
- ), [h, N] = w(!1), [o, b] = w(null), [y, f] = w(null), [d, u] = w(
260
+ ), [h, x] = b(!1), [i, D] = b(null), [w, l] = b(null), [c, p] = b(
261
261
  null
262
- ), { handleEditLibraryVisual: A, handleAddLibraryVisual: T } = Ie(), {
263
- resources: x,
262
+ ), { handleEditLibraryVisual: O, handleAddLibraryVisual: U } = Be(), {
263
+ resources: N,
264
264
  isLoading: S,
265
265
  isError: E,
266
266
  updateResource: V,
267
- deleteResource: O,
267
+ deleteResource: T,
268
268
  duplicateResource: C,
269
269
  isDeleting: v
270
- } = Ne(() => {
271
- N(!1), b(null);
272
- }), M = x.filter(
270
+ } = we(() => {
271
+ x(!1), D(null);
272
+ }), M = N.filter(
273
273
  (s) => {
274
- var R, c;
275
- return ((R = s == null ? void 0 : s.title) == null ? void 0 : R.toLowerCase().includes(t.toLowerCase())) || ((c = s == null ? void 0 : s.description) == null ? void 0 : c.toLowerCase().includes(t.toLowerCase()));
274
+ var R, u;
275
+ return ((R = s == null ? void 0 : s.title) == null ? void 0 : R.toLowerCase().includes(t.toLowerCase())) || ((u = s == null ? void 0 : s.description) == null ? void 0 : u.toLowerCase().includes(t.toLowerCase()));
276
276
  }
277
- ), U = (s) => new Date(s).toLocaleDateString("en-US", {
277
+ ), I = (s) => new Date(s).toLocaleDateString("en-US", {
278
278
  month: "short",
279
279
  day: "numeric",
280
280
  year: "numeric"
281
- }), j = (s) => {
282
- b(s), N(!0);
281
+ }), z = (s) => {
282
+ D(s), x(!0);
283
283
  }, F = () => {
284
- o && O(o.id);
284
+ i && T(i.id);
285
285
  }, {
286
- startUpdating: r,
287
- stopUpdating: Q,
286
+ startUpdating: d,
287
+ stopUpdating: Y,
288
288
  isUpdating: B
289
- } = be(), L = (s, R, c) => {
290
- var ee;
291
- const z = Object.fromEntries(
289
+ } = Ne(), L = (s, R, u) => {
290
+ var ne;
291
+ const j = Object.fromEntries(
292
292
  Object.entries(R).filter(([, P]) => P !== void 0)
293
293
  );
294
- if (Object.keys(z).length === 0) {
295
- (ee = c == null ? void 0 : c.onSuccess) == null || ee.call(c);
294
+ if (Object.keys(j).length === 0) {
295
+ (ne = u == null ? void 0 : u.onSuccess) == null || ne.call(u);
296
296
  return;
297
297
  }
298
- const D = Object.keys(z), K = D.length === 1 ? D[0] : void 0;
299
- r(s, K), V(
298
+ const y = Object.keys(j), H = y.length === 1 ? y[0] : void 0;
299
+ d(s, H), V(
300
300
  {
301
301
  resourceId: s,
302
- data: z
302
+ data: j
303
303
  },
304
304
  {
305
305
  onSuccess: () => {
306
306
  var P;
307
- Q(s, K), (P = c == null ? void 0 : c.onSuccess) == null || P.call(c);
307
+ Y(s, H), (P = u == null ? void 0 : u.onSuccess) == null || P.call(u);
308
308
  },
309
309
  onError: () => {
310
310
  var P;
311
- Q(s, K), (P = c == null ? void 0 : c.onError) == null || P.call(c);
311
+ Y(s, H), (P = u == null ? void 0 : u.onError) == null || P.call(u);
312
312
  }
313
313
  }
314
314
  );
315
- }, Y = (s) => {
316
- f(s), C(s, {
317
- onSettled: () => f(null)
315
+ }, k = (s) => {
316
+ l(s), C(s, {
317
+ onSettled: () => l(null)
318
318
  });
319
- }, H = (s) => {
320
- A(s);
321
- }, q = (s) => {
322
- T(s);
323
- }, J = (s) => {
324
- i(s), p(!0);
325
- }, Z = (s) => {
326
- u(s);
327
- }, $ = () => {
328
- u(null);
329
- }, k = ({
319
+ }, K = (s) => {
320
+ O(s);
321
+ }, Q = (s) => {
322
+ U(s);
323
+ }, W = (s) => {
324
+ o(s), m(!0);
325
+ }, $ = (s) => {
326
+ p(s);
327
+ }, q = () => {
328
+ p(null);
329
+ }, J = ({
330
330
  title: s,
331
331
  description: R
332
332
  }) => {
333
- if (!d)
333
+ if (!c)
334
334
  return;
335
- const c = {};
336
- s !== d.title && (c.title = s), (d.description || "") !== R && (c.description = R), L(d.id, c, {
335
+ const u = {};
336
+ s !== c.title && (u.title = s), (c.description || "") !== R && (u.description = R), L(c.id, u, {
337
337
  onSuccess: () => {
338
- u(null);
338
+ p(null);
339
339
  }
340
340
  });
341
341
  };
342
- return S ? /* @__PURE__ */ e(Me, {}) : E ? /* @__PURE__ */ e(we, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-1.5 px-4 py-10 text-center", children: [
342
+ return S ? /* @__PURE__ */ e(Ke, {}) : E ? /* @__PURE__ */ e(be, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-1.5 px-4 py-10 text-center", children: [
343
343
  /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: "Failed to load visuals" }),
344
344
  /* @__PURE__ */ e(
345
- I,
345
+ A,
346
346
  {
347
347
  variant: "outline",
348
348
  size: "xs",
@@ -352,45 +352,45 @@ function bt({ searchQuery: t }) {
352
352
  )
353
353
  ] }) }) : /* @__PURE__ */ n("div", { className: "flex h-full flex-1 flex-col", children: [
354
354
  /* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto", children: M.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-1.5 px-4 py-10 text-center", children: [
355
- /* @__PURE__ */ e(ot, { className: "h-5 w-5 text-muted-foreground/60" }),
355
+ /* @__PURE__ */ e(ut, { className: "h-5 w-5 text-muted-foreground/60" }),
356
356
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-medium text-foreground", children: t ? "No visuals found" : "No visuals yet" }),
357
357
  /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: t ? "Try adjusting your search." : 'Click "New" above to add your first visual.' })
358
358
  ] }) : M.map((s) => /* @__PURE__ */ e(
359
- Nt,
359
+ wt,
360
360
  {
361
361
  visual: s,
362
- onAddVisual: q,
363
- onOpenVisual: H,
364
- onEditDetails: Z,
365
- onDeleteClick: j,
366
- onDuplicateVisual: Y,
367
- onShareVisual: J,
362
+ onAddVisual: Q,
363
+ onOpenVisual: K,
364
+ onEditDetails: $,
365
+ onDeleteClick: z,
366
+ onDuplicateVisual: k,
367
+ onShareVisual: W,
368
368
  isDeleting: v,
369
- isDuplicating: y === s.id,
370
- formatDate: U
369
+ isDuplicating: w === s.id,
370
+ formatDate: I
371
371
  },
372
372
  s.id
373
373
  )) }),
374
- m && l && /* @__PURE__ */ e(
374
+ f && r && /* @__PURE__ */ e(
375
375
  ye,
376
376
  {
377
- resource: l,
377
+ resource: r,
378
378
  resourceType: Ce.VISUAL,
379
379
  onClose: () => {
380
- p(!1), i(null);
380
+ m(!1), o(null);
381
381
  }
382
382
  }
383
383
  ),
384
- d && /* @__PURE__ */ e(
384
+ c && /* @__PURE__ */ e(
385
385
  ve,
386
386
  {
387
- open: !!d,
387
+ open: !!c,
388
388
  resourceLabel: "Visual",
389
- initialTitle: d.title || "",
390
- initialDescription: d.description || "",
391
- onClose: $,
392
- onSave: k,
393
- isSaving: B(d.id)
389
+ initialTitle: c.title || "",
390
+ initialDescription: c.description || "",
391
+ onClose: q,
392
+ onSave: J,
393
+ isSaving: B(c.id)
394
394
  }
395
395
  ),
396
396
  /* @__PURE__ */ e(
@@ -398,28 +398,28 @@ function bt({ searchQuery: t }) {
398
398
  {
399
399
  open: h,
400
400
  onOpenChange: (s) => {
401
- !s && v || (N(s), s || b(null));
401
+ !s && v || (x(s), s || D(null));
402
402
  },
403
403
  children: /* @__PURE__ */ n(Ee, { children: [
404
404
  /* @__PURE__ */ n(Ve, { children: [
405
405
  /* @__PURE__ */ e(Le, { children: "Delete Visual" }),
406
- /* @__PURE__ */ n(Ae, { children: [
406
+ /* @__PURE__ */ n(Oe, { children: [
407
407
  'Are you sure you want to delete "',
408
- o == null ? void 0 : o.title,
408
+ i == null ? void 0 : i.title,
409
409
  '"? This action cannot be undone.'
410
410
  ] })
411
411
  ] }),
412
- /* @__PURE__ */ n(Oe, { children: [
413
- /* @__PURE__ */ e(Re, { disabled: v, children: "Cancel" }),
412
+ /* @__PURE__ */ n(Ae, { children: [
413
+ /* @__PURE__ */ e(Te, { disabled: v, children: "Cancel" }),
414
414
  /* @__PURE__ */ n(
415
- Te,
415
+ Re,
416
416
  {
417
417
  onClick: (s) => {
418
418
  s.preventDefault(), s.stopPropagation(), F();
419
419
  },
420
420
  disabled: v,
421
421
  children: [
422
- v ? /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }),
422
+ v ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" }),
423
423
  v ? "Deleting…" : "Delete"
424
424
  ]
425
425
  }
@@ -432,28 +432,28 @@ function bt({ searchQuery: t }) {
432
432
  }
433
433
  function yt({
434
434
  dashboard: t,
435
- isDeleting: m,
436
- isDuplicating: p,
437
- onLoadDashboard: l,
438
- onEditDetails: i,
435
+ isDeleting: f,
436
+ isDuplicating: m,
437
+ onLoadDashboard: r,
438
+ onEditDetails: o,
439
439
  onDeleteClick: h,
440
- onDuplicateDashboard: N,
441
- onShareDashboard: o,
442
- formatDate: b,
443
- onDashboardItemClick: y
440
+ onDuplicateDashboard: x,
441
+ onShareDashboard: i,
442
+ formatDate: D,
443
+ onDashboardItemClick: w
444
444
  }) {
445
- var V, O;
446
- const { selectDashboard: f } = de(), d = rt(t.id), { userContext: u, isLoading: A } = ue(), T = ((V = u == null ? void 0 : u.permissions) == null ? void 0 : V.canEdit) ?? !1, x = A || !T, S = () => {
447
- f(t), l(t.id), y == null || y(t.id);
445
+ var V, T;
446
+ const { selectDashboard: l } = ue(), c = ht(t.id), { userContext: p, isLoading: O } = pe(), U = ((V = p == null ? void 0 : p.permissions) == null ? void 0 : V.canEdit) ?? !1, N = O || !U, S = () => {
447
+ l(t), r(t.id), w == null || w(t.id);
448
448
  }, E = (C) => {
449
449
  C.currentTarget === C.target && (C.key === "Enter" || C.key === " ") && (C.preventDefault(), S());
450
450
  };
451
451
  return /* @__PURE__ */ n(
452
452
  "div",
453
453
  {
454
- className: X(
454
+ className: Z(
455
455
  "group flex cursor-pointer items-start gap-1 rounded-[5px] px-2 py-1.5 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",
456
- d && "bg-muted"
456
+ c && "bg-muted"
457
457
  ),
458
458
  onClick: S,
459
459
  children: [
@@ -478,7 +478,7 @@ function yt({
478
478
  {
479
479
  className: "truncate text-[11px] leading-4 text-muted-foreground",
480
480
  title: t.description || "No description",
481
- children: (O = t.description) != null && O.trim() ? t.description : "No description"
481
+ children: (T = t.description) != null && T.trim() ? t.description : "No description"
482
482
  }
483
483
  )
484
484
  ]
@@ -487,22 +487,22 @@ function yt({
487
487
  /* @__PURE__ */ e(
488
488
  "div",
489
489
  {
490
- className: X(
490
+ className: Z(
491
491
  "shrink-0 transition-opacity",
492
- d ? "opacity-100" : "opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"
492
+ c ? "opacity-100" : "opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"
493
493
  ),
494
494
  children: /* @__PURE__ */ e(
495
- it,
495
+ pt,
496
496
  {
497
497
  dashboard: t,
498
- isDeleting: m,
499
- isDuplicating: p,
500
- shouldHideActions: x,
501
- onEditDetails: i,
498
+ isDeleting: f,
499
+ isDuplicating: m,
500
+ shouldHideActions: N,
501
+ onEditDetails: o,
502
502
  onDeleteClick: h,
503
- onDuplicateDashboard: N,
504
- onShareDashboard: o,
505
- formatDate: b
503
+ onDuplicateDashboard: x,
504
+ onShareDashboard: i,
505
+ formatDate: D
506
506
  }
507
507
  )
508
508
  }
@@ -512,161 +512,161 @@ function yt({
512
512
  );
513
513
  }
514
514
  function Ct({ onRetry: t }) {
515
- return /* @__PURE__ */ e(we, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ n("div", { className: "rounded-xl border border-dashed border-border/60 bg-muted/20 px-4 py-8 text-center text-muted-foreground", children: [
515
+ return /* @__PURE__ */ e(be, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ n("div", { className: "rounded-xl border border-dashed border-border/60 bg-muted/20 px-4 py-8 text-center text-muted-foreground", children: [
516
516
  /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load dashboards" }),
517
- /* @__PURE__ */ e(I, { variant: "outline", size: "sm", className: "mt-2", onClick: t, children: "Retry" })
517
+ /* @__PURE__ */ e(A, { variant: "outline", size: "sm", className: "mt-2", onClick: t, children: "Retry" })
518
518
  ] }) });
519
519
  }
520
520
  function vt(t) {
521
- var he;
522
- const { searchQuery: m, onLoadDashboard: p, onEditDashboard: l, onDashboardItemClick: i } = t, [h, N] = w(!1), [o, b] = w(
521
+ var me;
522
+ const { searchQuery: f, onLoadDashboard: m, onEditDashboard: r, onDashboardItemClick: o } = t, [h, x] = b(!1), [i, D] = b(
523
523
  null
524
- ), [y, f] = w(!1), [d, u] = w(null), [A, T] = w(null), [x, S] = w(null), E = te(
524
+ ), [w, l] = b(!1), [c, p] = b(null), [O, U] = b(null), [N, S] = b(null), E = ae(
525
525
  (a) => a.lastSelectedDashboard
526
- ), V = te(
526
+ ), V = ae(
527
527
  (a) => a.selectedDashboard
528
- ), O = te(
528
+ ), T = ae(
529
529
  (a) => a.actions.selectDashboard
530
- ), C = te(
530
+ ), C = ae(
531
531
  (a) => a.actions.clearSelectedDashboard
532
- ), { tokenProps: v, id: M } = lt(), {
533
- resources: U,
534
- isLoading: j,
532
+ ), { tokenProps: v, id: M } = mt(), {
533
+ resources: I,
534
+ isLoading: z,
535
535
  isError: F,
536
- updateResource: r,
537
- deleteResource: Q,
536
+ updateResource: d,
537
+ deleteResource: Y,
538
538
  duplicateResource: B,
539
539
  isDeleting: L
540
540
  } = Ue(() => {
541
- f(!1);
542
- const a = d == null ? void 0 : d.id;
543
- u(null), (V == null ? void 0 : V.id) === a && (!(v != null && v.dashboard_id) && !M ? C() : E && E.id !== a && O(E));
544
- }), { userContext: Y } = ue(), H = ((he = Y == null ? void 0 : Y.permissions) == null ? void 0 : he.canCreateDashboard) ?? !1, q = U.filter(
541
+ l(!1);
542
+ const a = c == null ? void 0 : c.id;
543
+ p(null), (V == null ? void 0 : V.id) === a && (!(v != null && v.dashboard_id) && !M ? C() : E && E.id !== a && T(E));
544
+ }), { userContext: k } = pe(), K = ((me = k == null ? void 0 : k.permissions) == null ? void 0 : me.canCreateDashboard) ?? !1, Q = I.filter(
545
545
  (a) => {
546
546
  var _, g;
547
- return ((_ = a == null ? void 0 : a.title) == null ? void 0 : _.toLowerCase().includes(m.toLowerCase())) || ((g = a == null ? void 0 : a.description) == null ? void 0 : g.toLowerCase().includes(m.toLowerCase()));
547
+ return ((_ = a == null ? void 0 : a.title) == null ? void 0 : _.toLowerCase().includes(f.toLowerCase())) || ((g = a == null ? void 0 : a.description) == null ? void 0 : g.toLowerCase().includes(f.toLowerCase()));
548
548
  }
549
- ), J = (a) => new Date(a).toLocaleDateString("en-US", {
549
+ ), W = (a) => new Date(a).toLocaleDateString("en-US", {
550
550
  month: "short",
551
551
  day: "numeric",
552
552
  year: "numeric"
553
- }), Z = (a) => {
554
- p == null || p(a);
555
- }, $ = (a) => {
556
- u(a), f(!0);
557
- }, k = () => {
558
- d && Q(d.id);
553
+ }), $ = (a) => {
554
+ m == null || m(a);
555
+ }, q = (a) => {
556
+ p(a), l(!0);
557
+ }, J = () => {
558
+ c && Y(c.id);
559
559
  }, s = (a) => {
560
- T(a), B(a, {
561
- onSettled: () => T(null)
560
+ U(a), B(a, {
561
+ onSettled: () => U(null)
562
562
  });
563
563
  }, {
564
564
  startUpdating: R,
565
- stopUpdating: c,
566
- isUpdating: z
567
- } = be(), D = (a, _, g) => {
568
- var me;
569
- const oe = Object.fromEntries(
565
+ stopUpdating: u,
566
+ isUpdating: j
567
+ } = Ne(), y = (a, _, g) => {
568
+ var ge;
569
+ const re = Object.fromEntries(
570
570
  Object.entries(_).filter(([, G]) => G !== void 0)
571
571
  );
572
- if (Object.keys(oe).length === 0) {
573
- (me = g == null ? void 0 : g.onSuccess) == null || me.call(g);
572
+ if (Object.keys(re).length === 0) {
573
+ (ge = g == null ? void 0 : g.onSuccess) == null || ge.call(g);
574
574
  return;
575
575
  }
576
- const pe = Object.keys(oe), re = pe.length === 1 ? pe[0] : void 0;
577
- R(a, re), r(
576
+ const fe = Object.keys(re), le = fe.length === 1 ? fe[0] : void 0;
577
+ R(a, le), d(
578
578
  {
579
579
  resourceId: a,
580
- data: oe
580
+ data: re
581
581
  },
582
582
  {
583
583
  onSuccess: () => {
584
584
  var G;
585
- c(a, re), (G = g == null ? void 0 : g.onSuccess) == null || G.call(g);
585
+ u(a, le), (G = g == null ? void 0 : g.onSuccess) == null || G.call(g);
586
586
  },
587
587
  onError: () => {
588
588
  var G;
589
- c(a, re), (G = g == null ? void 0 : g.onError) == null || G.call(g);
589
+ u(a, le), (G = g == null ? void 0 : g.onError) == null || G.call(g);
590
590
  }
591
591
  }
592
592
  );
593
- }, K = (a) => {
594
- b(a), N(!0);
595
- }, ee = (a) => {
596
- l == null || l(a.id), S(a);
593
+ }, H = (a) => {
594
+ D(a), x(!0);
595
+ }, ne = (a) => {
596
+ r == null || r(a.id), S(a);
597
597
  }, P = () => {
598
598
  S(null);
599
- }, Pe = ({
599
+ }, He = ({
600
600
  title: a,
601
601
  description: _
602
602
  }) => {
603
- if (!x)
603
+ if (!N)
604
604
  return;
605
605
  const g = {};
606
- a !== x.title && (g.title = a), (x.description || "") !== _ && (g.description = _), D(x.id, g, {
606
+ a !== N.title && (g.title = a), (N.description || "") !== _ && (g.description = _), y(N.id, g, {
607
607
  onSuccess: () => {
608
608
  S(null);
609
609
  }
610
610
  });
611
611
  };
612
- return j ? /* @__PURE__ */ e(Me, {}) : F ? /* @__PURE__ */ e(Ct, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ n("div", { className: "flex h-full flex-1 flex-col", children: [
613
- /* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto", children: q.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-1.5 px-4 py-10 text-center", children: [
614
- /* @__PURE__ */ e(ze, { className: "h-5 w-5 text-muted-foreground/60" }),
615
- /* @__PURE__ */ e("h3", { className: "text-[13px] font-medium text-foreground", children: m ? "No dashboards found" : "No dashboards yet" }),
616
- /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: m ? "Try adjusting your search." : H ? 'Click "New" above to add your first dashboard.' : "No dashboards have been shared with you yet." })
617
- ] }) : q.map((a) => /* @__PURE__ */ e(
612
+ return z ? /* @__PURE__ */ e(Ke, {}) : F ? /* @__PURE__ */ e(Ct, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ n("div", { className: "flex h-full flex-1 flex-col", children: [
613
+ /* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto", children: Q.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-1.5 px-4 py-10 text-center", children: [
614
+ /* @__PURE__ */ e(Ye, { className: "h-5 w-5 text-muted-foreground/60" }),
615
+ /* @__PURE__ */ e("h3", { className: "text-[13px] font-medium text-foreground", children: f ? "No dashboards found" : "No dashboards yet" }),
616
+ /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: f ? "Try adjusting your search." : K ? 'Click "New" above to add your first dashboard.' : "No dashboards have been shared with you yet." })
617
+ ] }) : Q.map((a) => /* @__PURE__ */ e(
618
618
  yt,
619
619
  {
620
620
  dashboard: a,
621
621
  isDeleting: L,
622
- isDuplicating: A === a.id,
623
- onLoadDashboard: Z,
624
- onEditDetails: ee,
625
- onDeleteClick: $,
622
+ isDuplicating: O === a.id,
623
+ onLoadDashboard: $,
624
+ onEditDetails: ne,
625
+ onDeleteClick: q,
626
626
  onDuplicateDashboard: s,
627
- onShareDashboard: K,
628
- formatDate: J,
629
- onDashboardItemClick: i
627
+ onShareDashboard: H,
628
+ formatDate: W,
629
+ onDashboardItemClick: o
630
630
  },
631
631
  a.id
632
632
  )) }),
633
- h && o && /* @__PURE__ */ e(
633
+ h && i && /* @__PURE__ */ e(
634
634
  ye,
635
635
  {
636
- resource: o,
636
+ resource: i,
637
637
  resourceType: Ce.DASHBOARD,
638
638
  onClose: () => {
639
- N(!1), b(null);
639
+ x(!1), D(null);
640
640
  }
641
641
  }
642
642
  ),
643
643
  /* @__PURE__ */ e(
644
644
  Se,
645
645
  {
646
- open: y,
646
+ open: w,
647
647
  onOpenChange: (a) => {
648
- !a && L || (f(a), a || u(null));
648
+ !a && L || (l(a), a || p(null));
649
649
  },
650
650
  children: /* @__PURE__ */ n(Ee, { children: [
651
651
  /* @__PURE__ */ n(Ve, { children: [
652
652
  /* @__PURE__ */ e(Le, { children: "Delete Dashboard" }),
653
- /* @__PURE__ */ n(Ae, { children: [
653
+ /* @__PURE__ */ n(Oe, { children: [
654
654
  'Are you sure you want to delete "',
655
- d == null ? void 0 : d.title,
655
+ c == null ? void 0 : c.title,
656
656
  '"? This action cannot be undone.'
657
657
  ] })
658
658
  ] }),
659
- /* @__PURE__ */ n(Oe, { children: [
660
- /* @__PURE__ */ e(Re, { disabled: L, children: "Cancel" }),
659
+ /* @__PURE__ */ n(Ae, { children: [
660
+ /* @__PURE__ */ e(Te, { disabled: L, children: "Cancel" }),
661
661
  /* @__PURE__ */ n(
662
- Te,
662
+ Re,
663
663
  {
664
664
  onClick: (a) => {
665
- a.preventDefault(), a.stopPropagation(), k();
665
+ a.preventDefault(), a.stopPropagation(), J();
666
666
  },
667
667
  disabled: L,
668
668
  children: [
669
- L ? /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }),
669
+ L ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" }),
670
670
  L ? "Deleting…" : "Delete"
671
671
  ]
672
672
  }
@@ -675,100 +675,182 @@ function vt(t) {
675
675
  ] })
676
676
  }
677
677
  ),
678
- x && /* @__PURE__ */ e(
678
+ N && /* @__PURE__ */ e(
679
679
  ve,
680
680
  {
681
- open: !!x,
681
+ open: !!N,
682
682
  resourceLabel: "Dashboard",
683
- initialTitle: x.title || "",
684
- initialDescription: x.description || "",
683
+ initialTitle: N.title || "",
684
+ initialDescription: N.description || "",
685
685
  onClose: P,
686
- onSave: Pe,
687
- isSaving: z(x.id)
686
+ onSave: He,
687
+ isSaving: j(N.id)
688
688
  }
689
689
  )
690
690
  ] });
691
691
  }
692
- function St(t, m = {}) {
693
- const { enabled: p = !0, eventType: l = "mousedown" } = m, i = qe(null);
694
- return ae(() => {
695
- const h = (N) => {
696
- const o = N.target;
697
- i.current && i.current.contains(o) || o instanceof Element && (o.closest("[data-radix-popper-content-wrapper]") || o.closest("[data-radix-select-content]") || o.closest("[data-radix-popover-content]") || o.closest("[data-radix-dropdown-menu-content]") || o.closest("[data-radix-tooltip-content]") || o.closest('[role="listbox"]') || o.closest('[role="option"]') || o.closest('[role="combobox"]')) || o instanceof Element && o.hasAttribute("data-radix-") || t();
692
+ function St(t, f = {}) {
693
+ const { enabled: m = !0, eventType: r = "mousedown" } = f, o = Je(null);
694
+ return ee(() => {
695
+ const h = (x) => {
696
+ const i = x.target;
697
+ 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();
698
698
  };
699
- return p && document.addEventListener(l, h), () => {
700
- document.removeEventListener(l, h);
699
+ return m && document.addEventListener(r, h), () => {
700
+ document.removeEventListener(r, h);
701
701
  };
702
- }, [t, p, l]), i;
702
+ }, [t, m, r]), o;
703
703
  }
704
704
  function Et({
705
705
  open: t,
706
- onOpenChange: m,
707
- onSubmit: p,
708
- isCreating: l
706
+ onOpenChange: f,
707
+ onSubmit: m,
708
+ isCreating: r
709
709
  }) {
710
- const [i, h] = w(""), [N, o] = w("");
711
- ae(() => {
712
- t || (h(""), o(""));
710
+ const [o, h] = b(""), [x, i] = b("");
711
+ ee(() => {
712
+ t || (h(""), i(""));
713
713
  }, [t]);
714
- const b = () => {
715
- i.trim() && p({ title: i, description: N });
716
- }, y = (f) => {
717
- m(f);
714
+ const D = () => {
715
+ o.trim() && m({ title: o, description: x });
716
+ }, w = (l) => {
717
+ f(l);
718
718
  };
719
- return /* @__PURE__ */ e(dt, { open: t, onOpenChange: y, children: /* @__PURE__ */ n(ct, { children: [
720
- /* @__PURE__ */ n(ut, { children: [
721
- /* @__PURE__ */ e(ht, { children: "Create New Visual" }),
722
- /* @__PURE__ */ e(pt, { children: "Add a new visual to your library. You can configure it after creation." })
719
+ return /* @__PURE__ */ e(Ie, { open: t, onOpenChange: w, children: /* @__PURE__ */ n(Me, { className: "sm:max-w-[480px]", children: [
720
+ /* @__PURE__ */ n(Pe, { children: [
721
+ /* @__PURE__ */ e(ze, { className: "text-[15px]", children: "New dashboard" }),
722
+ /* @__PURE__ */ e(Fe, { className: "text-[13px]", children: "Give it a name and an optional description." })
723
+ ] }),
724
+ /* @__PURE__ */ n("div", { className: "space-y-3", children: [
725
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-1.5", children: [
726
+ /* @__PURE__ */ e(ie, { htmlFor: "title", className: "text-[13px] font-medium", children: "Title" }),
727
+ /* @__PURE__ */ e(
728
+ de,
729
+ {
730
+ id: "title",
731
+ size: "xs",
732
+ placeholder: "e.g. Sales analytics, User engagement",
733
+ value: o,
734
+ onChange: (l) => h(l.target.value),
735
+ disabled: r,
736
+ onKeyDown: (l) => {
737
+ l.key === "Enter" && !l.shiftKey && (l.preventDefault(), D());
738
+ }
739
+ }
740
+ )
741
+ ] }),
742
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-1.5", children: [
743
+ /* @__PURE__ */ e(ie, { htmlFor: "description", className: "text-[13px] font-medium", children: "Description" }),
744
+ /* @__PURE__ */ e(
745
+ ft,
746
+ {
747
+ id: "description",
748
+ placeholder: "Optional — briefly describe what this dashboard tracks",
749
+ rows: 3,
750
+ value: x,
751
+ onChange: (l) => i(l.target.value),
752
+ disabled: r,
753
+ className: "resize-none text-[12px]"
754
+ }
755
+ )
756
+ ] })
757
+ ] }),
758
+ /* @__PURE__ */ n(je, { className: "gap-1.5", children: [
759
+ /* @__PURE__ */ e(
760
+ A,
761
+ {
762
+ type: "button",
763
+ variant: "outline",
764
+ size: "xs",
765
+ onClick: () => w(!1),
766
+ disabled: r,
767
+ children: "Cancel"
768
+ }
769
+ ),
770
+ /* @__PURE__ */ e(
771
+ A,
772
+ {
773
+ type: "button",
774
+ size: "xs",
775
+ onClick: D,
776
+ disabled: !o.trim() || r,
777
+ children: r ? /* @__PURE__ */ n(oe, { children: [
778
+ /* @__PURE__ */ e(te, { className: "h-3 w-3 animate-spin" }),
779
+ "Creating…"
780
+ ] }) : "Create dashboard"
781
+ }
782
+ )
783
+ ] })
784
+ ] }) });
785
+ }
786
+ function Vt({
787
+ open: t,
788
+ onOpenChange: f,
789
+ onSubmit: m,
790
+ isCreating: r
791
+ }) {
792
+ const [o, h] = b(""), [x, i] = b("");
793
+ ee(() => {
794
+ t || (h(""), i(""));
795
+ }, [t]);
796
+ const D = () => {
797
+ o.trim() && m({ title: o, description: x });
798
+ }, w = (l) => {
799
+ f(l);
800
+ };
801
+ return /* @__PURE__ */ e(Ie, { open: t, onOpenChange: w, children: /* @__PURE__ */ n(Me, { children: [
802
+ /* @__PURE__ */ n(Pe, { children: [
803
+ /* @__PURE__ */ e(ze, { children: "Create New Visual" }),
804
+ /* @__PURE__ */ e(Fe, { children: "Add a new visual to your library. You can configure it after creation." })
723
805
  ] }),
724
806
  /* @__PURE__ */ n("div", { className: "space-y-4 py-4", children: [
725
807
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
726
- /* @__PURE__ */ e(fe, { htmlFor: "title", children: "Visual Title" }),
808
+ /* @__PURE__ */ e(ie, { htmlFor: "title", children: "Visual Title" }),
727
809
  /* @__PURE__ */ e(
728
- ge,
810
+ de,
729
811
  {
730
812
  id: "title",
731
813
  placeholder: "Enter visual title...",
732
- value: i,
733
- onChange: (f) => h(f.target.value),
734
- disabled: l,
735
- onKeyDown: (f) => {
736
- f.key === "Enter" && !f.shiftKey && (f.preventDefault(), b());
814
+ value: o,
815
+ onChange: (l) => h(l.target.value),
816
+ disabled: r,
817
+ onKeyDown: (l) => {
818
+ l.key === "Enter" && !l.shiftKey && (l.preventDefault(), D());
737
819
  }
738
820
  }
739
821
  )
740
822
  ] }),
741
823
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
742
- /* @__PURE__ */ e(fe, { htmlFor: "description", children: "Description (optional)" }),
824
+ /* @__PURE__ */ e(ie, { htmlFor: "description", children: "Description (optional)" }),
743
825
  /* @__PURE__ */ e(
744
- ge,
826
+ de,
745
827
  {
746
828
  id: "description",
747
829
  placeholder: "Enter visual description...",
748
- value: N,
749
- onChange: (f) => o(f.target.value),
750
- disabled: l
830
+ value: x,
831
+ onChange: (l) => i(l.target.value),
832
+ disabled: r
751
833
  }
752
834
  )
753
835
  ] })
754
836
  ] }),
755
- /* @__PURE__ */ n(mt, { children: [
837
+ /* @__PURE__ */ n(je, { children: [
756
838
  /* @__PURE__ */ e(
757
- I,
839
+ A,
758
840
  {
759
841
  variant: "outline",
760
- onClick: () => y(!1),
761
- disabled: l,
842
+ onClick: () => w(!1),
843
+ disabled: r,
762
844
  children: "Cancel"
763
845
  }
764
846
  ),
765
847
  /* @__PURE__ */ e(
766
- I,
848
+ A,
767
849
  {
768
- onClick: b,
769
- disabled: !i.trim() || l,
770
- children: l ? /* @__PURE__ */ n(le, { children: [
771
- /* @__PURE__ */ e(se, { className: "mr-2 h-4 w-4 animate-spin" }),
850
+ onClick: D,
851
+ disabled: !o.trim() || r,
852
+ children: r ? /* @__PURE__ */ n(oe, { children: [
853
+ /* @__PURE__ */ e(te, { className: "mr-2 h-4 w-4 animate-spin" }),
772
854
  "Creating..."
773
855
  ] }) : "Create Visual"
774
856
  }
@@ -776,160 +858,160 @@ function Et({
776
858
  ] })
777
859
  ] }) });
778
860
  }
779
- function Tt({
861
+ function Ut({
780
862
  isOpen: t,
781
- onClose: m,
782
- className: p,
783
- onDashboardItemClick: l,
784
- variant: i = "inline"
863
+ onClose: f,
864
+ className: m,
865
+ onDashboardItemClick: r,
866
+ variant: o = "inline"
785
867
  }) {
786
- var c, z;
787
- const h = ne(
788
- (D) => D.isDashboardEditing
789
- ), [N, o] = w(!1), [b, y] = w(""), [f, d] = w(!1), { currentUser: u, userContext: A } = ue(), T = ((c = A == null ? void 0 : A.permissions) == null ? void 0 : c.canCreateDashboard) ?? !1, { onCreateSuccess: x } = ft({
790
- onDashboardSelect: l
791
- }), { selectVisual: S } = de(), { handleEditLibraryVisual: E } = Ie(), {
868
+ var u, j;
869
+ const h = se(
870
+ (y) => y.isDashboardEditing
871
+ ), [x, i] = b(!1), [D, w] = b(""), [l, c] = b(!1), { currentUser: p, userContext: O } = pe(), U = ((u = O == null ? void 0 : O.permissions) == null ? void 0 : u.canCreateDashboard) ?? !1, { onCreateSuccess: N } = gt({
872
+ onDashboardSelect: r
873
+ }), { selectVisual: S } = ue(), { handleEditLibraryVisual: E } = Be(), {
792
874
  createResource: V,
793
- isCreating: O,
875
+ isCreating: T,
794
876
  refetch: C
795
- } = Ue(), { createResource: v, isCreating: M } = Ne(
877
+ } = Ue(), { createResource: v, isCreating: M } = we(
796
878
  void 0,
797
879
  // onDeleteSuccess (not needed here)
798
- (D) => {
799
- o(!1), D && (S(D), E(D));
880
+ (y) => {
881
+ i(!1), y && (S(y), E(y));
800
882
  }
801
- ), U = i === "overlay", j = h ? "New Visual" : "New", F = h ? "New Visual" : "New Dashboard", r = h ? "Search visuals..." : "Search dashboards...", Q = h ? "Collapse visuals panel" : "Collapse dashboard panel", B = ((u == null ? void 0 : u.name) ?? "").trim(), L = ((u == null ? void 0 : u.email) ?? "").trim(), H = B && B.toLowerCase() !== "undefined" ? B : L || "Current user", q = ((z = H.charAt(0)) == null ? void 0 : z.toUpperCase()) || "?", J = L && L.toLowerCase() !== "undefined" ? L : "", Z = St(m, {
802
- enabled: t && U
803
- }), $ = X(
883
+ ), I = o === "overlay", z = h ? "New Visual" : "New", F = h ? "New Visual" : "New Dashboard", d = h ? "Search visuals..." : "Search dashboards...", Y = h ? "Collapse visuals panel" : "Collapse dashboard panel", B = ((p == null ? void 0 : p.name) ?? "").trim(), L = ((p == null ? void 0 : p.email) ?? "").trim(), K = B && B.toLowerCase() !== "undefined" ? B : L || "Current user", Q = ((j = K.charAt(0)) == null ? void 0 : j.toUpperCase()) || "?", W = L && L.toLowerCase() !== "undefined" ? L : "", $ = St(f, {
884
+ enabled: t && I
885
+ }), q = Z(
804
886
  "flex h-full flex-col border-r border-border/60 bg-background",
805
- U ? X(
887
+ I ? Z(
806
888
  "absolute inset-y-0 left-0 z-[51] w-60 overflow-hidden shadow-lg transition-transform duration-300 ease-in-out",
807
889
  t ? "translate-x-0" : "pointer-events-none -translate-x-full"
808
890
  ) : "w-full max-w-[17rem] min-w-[11rem] overflow-hidden",
809
- p
810
- ), k = (D) => {
811
- }, s = (D) => {
812
- console.log("Editing dashboard:", D);
813
- }, R = (D) => {
814
- V(D, {
815
- onSuccess: (K) => {
816
- o(!1), x(K, C);
891
+ m
892
+ ), J = (y) => {
893
+ }, s = (y) => {
894
+ console.log("Editing dashboard:", y);
895
+ }, R = (y) => {
896
+ V(y, {
897
+ onSuccess: (H) => {
898
+ i(!1), N(H, C);
817
899
  }
818
900
  });
819
901
  };
820
- return /* @__PURE__ */ e(le, { children: (!U || t) && /* @__PURE__ */ n("div", { ref: Z, className: $, children: [
821
- /* @__PURE__ */ e("div", { className: "border-b border-border/60 bg-background", children: f ? /* @__PURE__ */ n("div", { className: "flex h-10 items-center gap-1 px-3", children: [
902
+ return /* @__PURE__ */ e(oe, { children: (!I || t) && /* @__PURE__ */ n("div", { ref: $, className: q, children: [
903
+ /* @__PURE__ */ e("div", { className: "border-b border-border/60 bg-background", children: l ? /* @__PURE__ */ n("div", { className: "flex h-10 items-center gap-1 px-3", children: [
822
904
  /* @__PURE__ */ e(De, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
823
905
  /* @__PURE__ */ e(
824
906
  "input",
825
907
  {
826
908
  autoFocus: !0,
827
- value: b,
828
- onChange: (D) => y(D.target.value),
829
- onKeyDown: (D) => {
830
- D.key === "Escape" && (y(""), d(!1));
909
+ value: D,
910
+ onChange: (y) => w(y.target.value),
911
+ onKeyDown: (y) => {
912
+ y.key === "Escape" && (w(""), c(!1));
831
913
  },
832
- placeholder: r,
914
+ placeholder: d,
833
915
  className: "h-7 min-w-0 flex-1 bg-transparent text-[13px] text-foreground placeholder:text-muted-foreground focus:outline-none",
834
- "aria-label": r
916
+ "aria-label": d
835
917
  }
836
918
  ),
837
919
  /* @__PURE__ */ e(
838
- I,
920
+ A,
839
921
  {
840
922
  size: "xs",
841
923
  variant: "ghost",
842
924
  className: "w-7 shrink-0 px-0 text-muted-foreground hover:text-foreground",
843
925
  onClick: () => {
844
- y(""), d(!1);
926
+ w(""), c(!1);
845
927
  },
846
928
  "aria-label": "Close search",
847
- children: /* @__PURE__ */ e(Be, { className: "h-3.5 w-3.5" })
929
+ children: /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" })
848
930
  }
849
931
  )
850
932
  ] }) : /* @__PURE__ */ n("div", { className: "flex h-10 items-center justify-between gap-2 px-3", children: [
851
933
  /* @__PURE__ */ e("h2", { className: "whitespace-nowrap text-[13px] font-medium text-foreground", children: h ? "Visuals" : "Dashboards" }),
852
934
  /* @__PURE__ */ n("div", { className: "flex items-center gap-0.5", children: [
853
935
  /* @__PURE__ */ e(
854
- I,
936
+ A,
855
937
  {
856
938
  size: "xs",
857
939
  variant: "ghost",
858
- onClick: () => d(!0),
940
+ onClick: () => c(!0),
859
941
  className: "w-7 px-0 text-muted-foreground hover:text-foreground",
860
942
  "aria-label": "Search",
861
943
  children: /* @__PURE__ */ e(De, { className: "h-3.5 w-3.5" })
862
944
  }
863
945
  ),
864
- (h || T) && /* @__PURE__ */ n(
865
- I,
946
+ (h || U) && /* @__PURE__ */ n(
947
+ A,
866
948
  {
867
949
  size: "xs",
868
950
  variant: "outline",
869
- onClick: () => o(!0),
951
+ onClick: () => i(!0),
870
952
  "aria-label": F,
871
953
  children: [
872
- /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5" }),
873
- j
954
+ /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }),
955
+ z
874
956
  ]
875
957
  }
876
958
  ),
877
959
  /* @__PURE__ */ e(
878
- I,
960
+ A,
879
961
  {
880
962
  size: "xs",
881
963
  variant: "ghost",
882
964
  className: "w-7 px-0 text-muted-foreground hover:text-foreground",
883
- onClick: m,
884
- "aria-label": Q,
885
- children: /* @__PURE__ */ e(gt, { className: "h-3.5 w-3.5" })
965
+ onClick: f,
966
+ "aria-label": Y,
967
+ children: /* @__PURE__ */ e(xt, { className: "h-3.5 w-3.5" })
886
968
  }
887
969
  )
888
970
  ] })
889
971
  ] }) }),
890
- /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-1.5 py-2", children: h ? /* @__PURE__ */ e(bt, { searchQuery: b }) : /* @__PURE__ */ e(
972
+ /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-1.5 py-2", children: h ? /* @__PURE__ */ e(Nt, { searchQuery: D }) : /* @__PURE__ */ e(
891
973
  vt,
892
974
  {
893
- searchQuery: b,
894
- onLoadDashboard: k,
975
+ searchQuery: D,
976
+ onLoadDashboard: J,
895
977
  onEditDashboard: s,
896
- onDashboardItemClick: l
978
+ onDashboardItemClick: r
897
979
  }
898
980
  ) }),
899
- u && /* @__PURE__ */ e(He, { children: /* @__PURE__ */ e("div", { className: "border-t border-border/60 px-3 py-2", children: /* @__PURE__ */ n(Ke, { children: [
900
- /* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex cursor-default items-center gap-2", children: [
901
- /* @__PURE__ */ e("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-medium text-muted-foreground", children: q }),
902
- /* @__PURE__ */ e("span", { className: "truncate text-[12px] text-muted-foreground", children: H })
981
+ p && /* @__PURE__ */ e(Qe, { children: /* @__PURE__ */ e("div", { className: "border-t border-border/60 px-3 py-2", children: /* @__PURE__ */ n(We, { children: [
982
+ /* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex cursor-default items-center gap-2", children: [
983
+ /* @__PURE__ */ e("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-medium text-muted-foreground", children: Q }),
984
+ /* @__PURE__ */ e("span", { className: "truncate text-[12px] text-muted-foreground", children: K })
903
985
  ] }) }),
904
- /* @__PURE__ */ e(Ge, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ n("div", { className: "space-y-0.5", children: [
905
- /* @__PURE__ */ e("div", { className: "font-medium", children: H }),
906
- J && /* @__PURE__ */ e("div", { className: "text-[11px] opacity-80", children: J }),
907
- u.role && /* @__PURE__ */ n("div", { className: "text-[11px] opacity-80", children: [
986
+ /* @__PURE__ */ e(Ze, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ n("div", { className: "space-y-0.5", children: [
987
+ /* @__PURE__ */ e("div", { className: "font-medium", children: K }),
988
+ W && /* @__PURE__ */ e("div", { className: "text-[11px] opacity-80", children: W }),
989
+ p.role && /* @__PURE__ */ n("div", { className: "text-[11px] opacity-80", children: [
908
990
  "Role:",
909
991
  " ",
910
- Qe(u.role.replace(/_/g, " "))
992
+ $e(p.role.replace(/_/g, " "))
911
993
  ] })
912
994
  ] }) })
913
995
  ] }) }) }),
914
996
  h ? /* @__PURE__ */ e(
915
- Et,
997
+ Vt,
916
998
  {
917
- open: N,
918
- onOpenChange: o,
999
+ open: x,
1000
+ onOpenChange: i,
919
1001
  onSubmit: v,
920
1002
  isCreating: M
921
1003
  }
922
1004
  ) : /* @__PURE__ */ e(
923
- xt,
1005
+ Et,
924
1006
  {
925
- open: N,
926
- onOpenChange: o,
1007
+ open: x,
1008
+ onOpenChange: i,
927
1009
  onSubmit: R,
928
- isCreating: O
1010
+ isCreating: T
929
1011
  }
930
1012
  )
931
1013
  ] }) });
932
1014
  }
933
1015
  export {
934
- Tt as ResourceManagementPanel
1016
+ Ut as ResourceManagementPanel
935
1017
  };