react-semaphor 0.1.179 → 0.1.180

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 (30) hide show
  1. package/dist/chunks/{dashboard-controls-CeT5saB7.js → dashboard-controls-Baw7eUyM.js} +3 -3
  2. package/dist/chunks/{dashboard-controls-O2Vl2SaH.js → dashboard-controls-CS3pAVZi.js} +339 -337
  3. package/dist/chunks/{dashboard-json--jGkpREU.js → dashboard-json-ClalWYi4.js} +1 -1
  4. package/dist/chunks/{dashboard-json-d1qZ8OYo.js → dashboard-json-Cz4bNnCC.js} +1 -1
  5. package/dist/chunks/{edit-dashboard-visual-ViDNkE8Q.js → edit-dashboard-visual-BMElXt-n.js} +30 -35
  6. package/dist/chunks/{edit-dashboard-visual-BsP87bZV.js → edit-dashboard-visual-DFJ5FJ7y.js} +11 -22
  7. package/dist/chunks/editor-action-buttons-DVWnnC_r.js +11 -0
  8. package/dist/chunks/{editor-action-buttons-F4_UU-Mk.js → editor-action-buttons-MtNYw1Bb.js} +57 -45
  9. package/dist/chunks/{index-v6ayK5K2.js → index-CAeKp6K8.js} +22589 -22037
  10. package/dist/chunks/{index-CFWw2cJ5.js → index-CfPKTeUk.js} +232 -227
  11. package/dist/chunks/notification-bell-2dZI5OV0.js +21 -0
  12. package/dist/chunks/notification-bell-YZ8VqdwA.js +870 -0
  13. package/dist/chunks/{resource-management-panel-Cn1aOr6L.js → resource-management-panel-Buhi-kvP.js} +1 -1
  14. package/dist/chunks/{resource-management-panel-CApVr9Vd.js → resource-management-panel-pxL28GXq.js} +133 -133
  15. package/dist/chunks/{use-role-aware-display-preferences-C-N0-Iik.js → use-role-aware-display-preferences-B_i2f9tn.js} +1 -1
  16. package/dist/chunks/{use-role-aware-display-preferences-Bxp6i8c7.js → use-role-aware-display-preferences-JljRcjrP.js} +1 -1
  17. package/dist/chunks/{use-visual-utils-D9lMGeVv.js → use-visual-utils-D3HjbsKO.js} +38 -38
  18. package/dist/chunks/{use-visual-utils-D19qzwzI.js → use-visual-utils-DPEHcmFT.js} +1 -1
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/index.cjs +1 -6
  22. package/dist/index.js +133 -126
  23. package/dist/style.css +1 -1
  24. package/dist/surfboard/index.cjs +1 -1
  25. package/dist/surfboard/index.js +1 -1
  26. package/dist/types/main.d.ts +262 -0
  27. package/package.json +1 -1
  28. package/dist/chunks/editor-action-buttons-DseT424l.js +0 -6
  29. package/dist/chunks/schedule-dashboard-B4KUKLfW.js +0 -416
  30. package/dist/chunks/schedule-dashboard-vvFw8B1E.js +0 -6
@@ -1,19 +1,19 @@
1
1
  import { jsxs as r, jsx as e, Fragment as _ } from "react/jsx-runtime";
2
- import { l as J, bE as Bs, u as x, aS as es, aT as ss, B as M, aV as as, aW as ve, bF as ke, o as ts, aA as U, aF as Oe, bG as Qs, bc as Ie, aG as _e, aH as Te, aI as Ge, aJ as rs, aK as Se, bH as W, aO as Ws, K as $, bI as Js, bg as Xs, bJ as Ys, bK as Qe, bL as ns, c as ie, bM as os, p as le, bN as ce, t as A, bO as is, aM as Zs, bP as ea, L as V, bf as j, bQ as sa, bR as aa, bS as xe, bT as ta, bU as ra, bV as ls, bW as cs, bX as ne, bY as oe, bB as we, bm as Ce, bZ as De, bh as ds, b_ as Le, aN as us, e as ms, b$ as na, a_ as hs, a$ as ps, b0 as fs, b2 as gs, b3 as vs, b4 as bs, b5 as ys, b6 as Ee, ba as oa, c0 as ia, T as la, n as We, R as te, c1 as ca, $ as da, V as be, c2 as ua, c3 as ma, c4 as ha, c5 as pa, bd as fa, a6 as ga, c6 as va, c7 as ba, c8 as ya, c9 as Na, ca as Sa, _ as xa, a5 as wa } from "./index-v6ayK5K2.js";
2
+ import { aF as J, bU as Ks, u as x, aV as es, aW as ss, B as M, aY as as, aZ as ve, bV as ke, as as ts, aN as U, bu as Oe, bW as Qs, a_ as Ie, bv as _e, bw as Te, bx as Ge, by as rs, bz as Se, bX as W, bB as Ws, I as j, bY as Js, b2 as Ys, bZ as Xs, b_ as Qe, b$ as ns, c as ie, c0 as os, aH as ce, c1 as le, aL as A, c2 as is, bG as Zs, c3 as ea, aG as $, b1 as q, c4 as sa, c5 as aa, c6 as xe, c7 as ta, c8 as ra, c9 as cs, ca as ls, cb as ne, cc as oe, bD as we, b8 as Ce, cd as De, b3 as ds, ce as Le, bH as us, e as ms, cf as na, bb as hs, bc as ps, bd as fs, be as gs, bf as vs, bg as bs, bh as ys, bi as Ee, aT as oa, cg as ia, G as ca, au as We, A as te, ch as la, M as da, R as be, ci as ua, cj as ma, ck as ha, cl as pa, a$ as fa, Y as ga, cm as va, cn as ba, co as ya, cp as Na, cq as Sa, L as xa, W as wa } from "./index-CAeKp6K8.js";
3
3
  import * as L from "react";
4
4
  import Ns, { useState as S, useMemo as re, useEffect as Ca } from "react";
5
5
  import "react-dom";
6
- import { u as Da, A as La, V as Ea, S as Aa, U as Ma } from "./schedule-dashboard-B4KUKLfW.js";
7
- import { u as ka } from "./use-role-aware-display-preferences-C-N0-Iik.js";
8
- import { b as Oa } from "./index-B4EhQdS9.js";
9
- import { S as Je } from "./editor-action-buttons-F4_UU-Mk.js";
6
+ import { b as Da, u as La, c as Ea, A as Aa, V as Ma, S as ka, N as Oa, U as Ia } from "./notification-bell-YZ8VqdwA.js";
7
+ import { u as _a } from "./use-role-aware-display-preferences-B_i2f9tn.js";
8
+ import { b as Ta } from "./index-B4EhQdS9.js";
9
+ import { S as Je } from "./editor-action-buttons-MtNYw1Bb.js";
10
10
  /**
11
11
  * @license lucide-react v0.453.0 - ISC
12
12
  *
13
13
  * This source code is licensed under the ISC license.
14
14
  * See the LICENSE file in the root directory of this source tree.
15
15
  */
16
- const Ia = J("Glasses", [
16
+ const Ga = J("Glasses", [
17
17
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
18
18
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
19
19
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -26,7 +26,7 @@ const Ia = J("Glasses", [
26
26
  * This source code is licensed under the ISC license.
27
27
  * See the LICENSE file in the root directory of this source tree.
28
28
  */
29
- const _a = J("Menu", [
29
+ const Ra = J("Menu", [
30
30
  ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
31
31
  ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
32
32
  ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
@@ -37,7 +37,7 @@ const _a = J("Menu", [
37
37
  * This source code is licensed under the ISC license.
38
38
  * See the LICENSE file in the root directory of this source tree.
39
39
  */
40
- const Ta = J("Moon", [
40
+ const Pa = J("Moon", [
41
41
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
42
42
  ]);
43
43
  /**
@@ -46,7 +46,7 @@ const Ta = J("Moon", [
46
46
  * This source code is licensed under the ISC license.
47
47
  * See the LICENSE file in the root directory of this source tree.
48
48
  */
49
- const Ga = J("ShieldX", [
49
+ const Ua = J("ShieldX", [
50
50
  [
51
51
  "path",
52
52
  {
@@ -63,7 +63,7 @@ const Ga = J("ShieldX", [
63
63
  * This source code is licensed under the ISC license.
64
64
  * See the LICENSE file in the root directory of this source tree.
65
65
  */
66
- const Ra = J("Sun", [
66
+ const Fa = J("Sun", [
67
67
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
68
68
  ["path", { d: "M12 2v2", key: "tus03m" }],
69
69
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -84,42 +84,42 @@ var Ae = { exports: {} }, ye = {};
84
84
  * This source code is licensed under the MIT license found in the
85
85
  * LICENSE file in the root directory of this source tree.
86
86
  */
87
- var Xe;
88
- function Pa() {
89
- if (Xe) return ye;
90
- Xe = 1;
87
+ var Ye;
88
+ function ja() {
89
+ if (Ye) return ye;
90
+ Ye = 1;
91
91
  var s = Ns;
92
- function n(c, h) {
93
- return c === h && (c !== 0 || 1 / c === 1 / h) || c !== c && h !== h;
92
+ function n(l, h) {
93
+ return l === h && (l !== 0 || 1 / l === 1 / h) || l !== l && h !== h;
94
94
  }
95
- var a = typeof Object.is == "function" ? Object.is : n, t = s.useState, o = s.useEffect, i = s.useLayoutEffect, u = s.useDebugValue;
96
- function m(c, h) {
95
+ var a = typeof Object.is == "function" ? Object.is : n, t = s.useState, i = s.useEffect, o = s.useLayoutEffect, u = s.useDebugValue;
96
+ function m(l, h) {
97
97
  var p = h(), v = t({ inst: { value: p, getSnapshot: h } }), y = v[0].inst, N = v[1];
98
- return i(
98
+ return o(
99
99
  function() {
100
100
  y.value = p, y.getSnapshot = h, f(y) && N({ inst: y });
101
101
  },
102
- [c, p, h]
103
- ), o(
102
+ [l, p, h]
103
+ ), i(
104
104
  function() {
105
- return f(y) && N({ inst: y }), c(function() {
105
+ return f(y) && N({ inst: y }), l(function() {
106
106
  f(y) && N({ inst: y });
107
107
  });
108
108
  },
109
- [c]
109
+ [l]
110
110
  ), u(p), p;
111
111
  }
112
- function f(c) {
113
- var h = c.getSnapshot;
114
- c = c.value;
112
+ function f(l) {
113
+ var h = l.getSnapshot;
114
+ l = l.value;
115
115
  try {
116
116
  var p = h();
117
- return !a(c, p);
117
+ return !a(l, p);
118
118
  } catch {
119
119
  return !0;
120
120
  }
121
121
  }
122
- function b(c, h) {
122
+ function b(l, h) {
123
123
  return h();
124
124
  }
125
125
  var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? b : m;
@@ -135,22 +135,22 @@ var Ne = {};
135
135
  * This source code is licensed under the MIT license found in the
136
136
  * LICENSE file in the root directory of this source tree.
137
137
  */
138
- var Ye;
139
- function Ua() {
140
- return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
138
+ var Xe;
139
+ function $a() {
140
+ return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && function() {
141
141
  function s(p, v) {
142
142
  return p === v && (p !== 0 || 1 / p === 1 / v) || p !== p && v !== v;
143
143
  }
144
144
  function n(p, v) {
145
- d || o.startTransition === void 0 || (d = !0, console.error(
145
+ d || i.startTransition === void 0 || (d = !0, console.error(
146
146
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
147
147
  ));
148
148
  var y = v();
149
- if (!c) {
149
+ if (!l) {
150
150
  var N = v();
151
- i(y, N) || (console.error(
151
+ o(y, N) || (console.error(
152
152
  "The result of getSnapshot should be cached to avoid an infinite loop"
153
- ), c = !0);
153
+ ), l = !0);
154
154
  }
155
155
  N = u({
156
156
  inst: { value: y, getSnapshot: v }
@@ -175,7 +175,7 @@ function Ua() {
175
175
  p = p.value;
176
176
  try {
177
177
  var y = v();
178
- return !i(p, y);
178
+ return !o(p, y);
179
179
  } catch {
180
180
  return !0;
181
181
  }
@@ -184,27 +184,27 @@ function Ua() {
184
184
  return v();
185
185
  }
186
186
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
187
- var o = Ns, i = typeof Object.is == "function" ? Object.is : s, u = o.useState, m = o.useEffect, f = o.useLayoutEffect, b = o.useDebugValue, d = !1, c = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t : n;
188
- Ne.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
187
+ var i = Ns, o = typeof Object.is == "function" ? Object.is : s, u = i.useState, m = i.useEffect, f = i.useLayoutEffect, b = i.useDebugValue, d = !1, l = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t : n;
188
+ Ne.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
189
189
  }()), Ne;
190
190
  }
191
- process.env.NODE_ENV === "production" ? Ae.exports = Pa() : Ae.exports = Ua();
192
- var Fa = Ae.exports;
193
- function $a() {
194
- const { setTheme: s } = Bs(), n = x(
191
+ process.env.NODE_ENV === "production" ? Ae.exports = ja() : Ae.exports = $a();
192
+ var qa = Ae.exports;
193
+ function Va() {
194
+ const { setTheme: s } = Ks(), n = x(
195
195
  (a) => a.actions.setDashboardTheme
196
196
  );
197
197
  return /* @__PURE__ */ r(es, { children: [
198
198
  /* @__PURE__ */ e(ss, { asChild: !0, children: /* @__PURE__ */ r(M, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
199
199
  /* @__PURE__ */ e(
200
- Ra,
200
+ Fa,
201
201
  {
202
202
  strokeWidth: 1.5,
203
203
  className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
204
204
  }
205
205
  ),
206
206
  /* @__PURE__ */ e(
207
- Ta,
207
+ Pa,
208
208
  {
209
209
  strokeWidth: 1.5,
210
210
  className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
@@ -243,13 +243,13 @@ function $a() {
243
243
  ] })
244
244
  ] });
245
245
  }
246
- async function Va(s, n, a, t, o) {
247
- if (!o)
246
+ async function za(s, n, a, t, i) {
247
+ if (!i)
248
248
  return null;
249
- const i = JSON.stringify(a), u = `${s}/v1/lens`;
250
- return await ke(u, o, {
249
+ const o = JSON.stringify(a), u = `${s}/v1/lens`;
250
+ return await ke(u, i, {
251
251
  name: n,
252
- template: i,
252
+ template: o,
253
253
  filterValues: t,
254
254
  operation: "create"
255
255
  });
@@ -257,17 +257,17 @@ async function Va(s, n, a, t, o) {
257
257
  async function Me(s, n, a) {
258
258
  if (!a)
259
259
  return null;
260
- const { id: t, template: o, filterValues: i, isDefault: u, shared: m } = n, f = `${s}/v1/lens`;
260
+ const { id: t, template: i, filterValues: o, isDefault: u, shared: m } = n, f = `${s}/v1/lens`;
261
261
  return await ke(f, a, {
262
262
  lensId: t,
263
- template: o,
264
- filterValues: i,
263
+ template: i,
264
+ filterValues: o,
265
265
  isDefault: u,
266
266
  shared: m,
267
267
  operation: "update"
268
268
  });
269
269
  }
270
- async function ja(s, n, a) {
270
+ async function Ha(s, n, a) {
271
271
  if (!a)
272
272
  return null;
273
273
  const t = `${s}/v1/lens`;
@@ -276,18 +276,18 @@ async function ja(s, n, a) {
276
276
  lensId: n
277
277
  });
278
278
  }
279
- function qa() {
280
- const [s, n] = S(""), [a, t] = S(!1), o = x((N) => N.lenses), { setLenses: i, setSelectedLensId: u } = ts(), [m, f] = S(!1), [b, d] = S(!1), c = x((N) => N.dashboard), h = x((N) => N.filterValues), { authToken: p, tokenProps: v } = U();
279
+ function Ba() {
280
+ const [s, n] = S(""), [a, t] = S(!1), i = x((N) => N.lenses), { setLenses: o, setSelectedLensId: u } = ts(), [m, f] = S(!1), [b, d] = S(!1), l = x((N) => N.dashboard), h = x((N) => N.filterValues), { authToken: p, tokenProps: v } = U();
281
281
  async function y() {
282
282
  f(!0);
283
- const N = await Va(
283
+ const N = await za(
284
284
  v.apiServiceUrl,
285
285
  s,
286
- c,
286
+ l,
287
287
  h,
288
288
  p == null ? void 0 : p.accessToken
289
289
  );
290
- N && (i([...o || [], N]), u(N.id), d(!1)), f(!1);
290
+ N && (o([...i || [], N]), u(N.id), d(!1)), f(!1);
291
291
  }
292
292
  return /* @__PURE__ */ r(Oe, { open: b, onOpenChange: d, children: [
293
293
  /* @__PURE__ */ e(Qs, { asChild: !0, children: /* @__PURE__ */ r(
@@ -336,33 +336,33 @@ function qa() {
336
336
  ] })
337
337
  ] });
338
338
  }
339
- function za() {
340
- const [s, n] = S(!1), a = x((c) => c.lenses), t = x((c) => c.selectedLensId), { setLenses: o, setSelectedLensId: i } = ts(), { authToken: u, tokenProps: m } = U();
341
- async function f(c) {
342
- i(c);
339
+ function Ka() {
340
+ const [s, n] = S(!1), a = x((l) => l.lenses), t = x((l) => l.selectedLensId), { setLenses: i, setSelectedLensId: o } = ts(), { authToken: u, tokenProps: m } = U();
341
+ async function f(l) {
342
+ o(l);
343
343
  }
344
- async function b(c) {
345
- if (await ja(m.apiServiceUrl, c, u == null ? void 0 : u.accessToken)) {
346
- const p = a == null ? void 0 : a.filter((v) => v.id !== c);
347
- o(p || []), i("original");
344
+ async function b(l) {
345
+ if (await Ha(m.apiServiceUrl, l, u == null ? void 0 : u.accessToken)) {
346
+ const p = a == null ? void 0 : a.filter((v) => v.id !== l);
347
+ i(p || []), o("original");
348
348
  }
349
349
  }
350
- async function d(c) {
351
- const h = a == null ? void 0 : a.map((y) => y.id === c.id ? {
350
+ async function d(l) {
351
+ const h = a == null ? void 0 : a.map((y) => y.id === l.id ? {
352
352
  ...y,
353
- isDefault: !c.isDefault
353
+ isDefault: !l.isDefault
354
354
  } : {
355
355
  ...y,
356
356
  isDefault: !1
357
357
  });
358
- o(h || []);
358
+ i(h || []);
359
359
  const p = {
360
- ...c,
361
- isDefault: !c.isDefault
360
+ ...l,
361
+ isDefault: !l.isDefault
362
362
  };
363
363
  await Me(m.apiServiceUrl, p, u == null ? void 0 : u.accessToken);
364
364
  const v = a == null ? void 0 : a.find((y) => y.isDefault);
365
- if (v && v.id !== c.id) {
365
+ if (v && v.id !== l.id) {
366
366
  const y = {
367
367
  ...v,
368
368
  isDefault: !1
@@ -371,36 +371,36 @@ function za() {
371
371
  }
372
372
  }
373
373
  return /* @__PURE__ */ r(es, { open: s, onOpenChange: n, children: [
374
- /* @__PURE__ */ e(ss, { asChild: !0, children: /* @__PURE__ */ e($, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Ia, { className: "h-4 w-4" }) }) }),
374
+ /* @__PURE__ */ e(ss, { asChild: !0, children: /* @__PURE__ */ e(j, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Ga, { className: "h-4 w-4" }) }) }),
375
375
  /* @__PURE__ */ r(as, { align: "end", className: "w-60", children: [
376
376
  /* @__PURE__ */ e(Js, { className: "px-3", children: "Lenses" }),
377
- /* @__PURE__ */ e(Xs, {}),
377
+ /* @__PURE__ */ e(Ys, {}),
378
378
  /* @__PURE__ */ r(
379
- Ys,
379
+ Xs,
380
380
  {
381
381
  value: t,
382
382
  onValueChange: f,
383
383
  children: [
384
384
  /* @__PURE__ */ e(Qe, { value: "original", children: "Original" }),
385
- a == null ? void 0 : a.map((c) => /* @__PURE__ */ r(
385
+ a == null ? void 0 : a.map((l) => /* @__PURE__ */ r(
386
386
  Qe,
387
387
  {
388
388
  className: "group flex justify-between gap-2",
389
- value: c.id,
389
+ value: l.id,
390
390
  children: [
391
- /* @__PURE__ */ e("p", { children: c.name }),
391
+ /* @__PURE__ */ e("p", { children: l.name }),
392
392
  /* @__PURE__ */ r("span", { className: "flex items-center gap-3", children: [
393
393
  /* @__PURE__ */ e(
394
394
  ns,
395
395
  {
396
396
  onClick: (h) => {
397
- h.preventDefault(), d(c);
397
+ h.preventDefault(), d(l);
398
398
  },
399
399
  className: ie(
400
400
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
401
401
  {
402
- invisible: !c.isDefault,
403
- "text-green-500": c.isDefault
402
+ invisible: !l.isDefault,
403
+ "text-green-500": l.isDefault
404
404
  }
405
405
  ),
406
406
  strokeWidth: 1.5
@@ -410,7 +410,7 @@ function za() {
410
410
  os,
411
411
  {
412
412
  onClick: (h) => {
413
- h.preventDefault(), b(c.id);
413
+ h.preventDefault(), b(l.id);
414
414
  },
415
415
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
416
416
  strokeWidth: 1.5
@@ -419,7 +419,7 @@ function za() {
419
419
  ] })
420
420
  ]
421
421
  },
422
- c.id
422
+ l.id
423
423
  ))
424
424
  ]
425
425
  }
@@ -427,25 +427,25 @@ function za() {
427
427
  ] })
428
428
  ] });
429
429
  }
430
- const Ha = async (s, n, a) => {
430
+ const Qa = async (s, n, a) => {
431
431
  const t = `${s}/management/v1/groups`;
432
432
  return await is(t, n, a);
433
- }, Ka = async (s, n, a) => {
434
- const t = `${s}/management/v1/groups/${a}`, o = await fetch(t, {
433
+ }, Wa = async (s, n, a) => {
434
+ const t = `${s}/management/v1/groups/${a}`, i = await fetch(t, {
435
435
  method: "DELETE",
436
436
  headers: {
437
437
  Authorization: `Bearer ${n}`
438
438
  }
439
439
  });
440
- if (!o.ok) {
441
- const i = await o.text();
442
- throw new Error(i || "Failed to delete group");
440
+ if (!i.ok) {
441
+ const o = await i.text();
442
+ throw new Error(o || "Failed to delete group");
443
443
  }
444
- }, Ba = async (s, n, a, t) => {
445
- const o = `${s}/management/v1/groups/${a}/members`;
446
- return await is(o, n, t);
447
- }, Qa = async (s, n, a, t) => {
448
- const o = `${s}/management/v1/groups/${a}/members`, i = await fetch(o, {
444
+ }, Ja = async (s, n, a, t) => {
445
+ const i = `${s}/management/v1/groups/${a}/members`;
446
+ return await is(i, n, t);
447
+ }, Ya = async (s, n, a, t) => {
448
+ const i = `${s}/management/v1/groups/${a}/members`, o = await fetch(i, {
449
449
  method: "DELETE",
450
450
  headers: {
451
451
  "Content-Type": "application/json",
@@ -453,15 +453,15 @@ const Ha = async (s, n, a) => {
453
453
  },
454
454
  body: JSON.stringify(t)
455
455
  });
456
- if (!i.ok) {
457
- const u = await i.text();
456
+ if (!o.ok) {
457
+ const u = await o.text();
458
458
  throw new Error(u || "Failed to remove group members");
459
459
  }
460
460
  };
461
- function Wa() {
462
- const { authToken: s, tokenProps: n } = U(), a = le();
463
- return ce({
464
- mutationFn: (t) => Ha(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
461
+ function Xa() {
462
+ const { authToken: s, tokenProps: n } = U(), a = ce();
463
+ return le({
464
+ mutationFn: (t) => Qa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
465
465
  onSuccess: () => {
466
466
  a.invalidateQueries({ queryKey: ["groups"] }), A.success("Group created successfully");
467
467
  },
@@ -472,12 +472,12 @@ function Wa() {
472
472
  }
473
473
  });
474
474
  }
475
- function Ja() {
476
- const { authToken: s, tokenProps: n } = U(), a = le();
477
- return ce({
478
- mutationFn: (t) => Ka(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
479
- onSuccess: (t, o) => {
480
- a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", o] }), A.success("Group deleted successfully");
475
+ function Za() {
476
+ const { authToken: s, tokenProps: n } = U(), a = ce();
477
+ return le({
478
+ mutationFn: (t) => Wa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
479
+ onSuccess: (t, i) => {
480
+ a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", i] }), A.success("Group deleted successfully");
481
481
  },
482
482
  onError: (t) => {
483
483
  console.error("Failed to delete group:", t), A.error("Failed to delete group", {
@@ -486,16 +486,16 @@ function Ja() {
486
486
  }
487
487
  });
488
488
  }
489
- function Xa() {
490
- const { authToken: s, tokenProps: n } = U(), a = le();
491
- return ce({
489
+ function et() {
490
+ const { authToken: s, tokenProps: n } = U(), a = ce();
491
+ return le({
492
492
  mutationFn: ({
493
493
  groupId: t,
494
- data: o
495
- }) => Ba(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, o),
496
- onSuccess: (t, o) => {
497
- a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
498
- queryKey: ["group-members", o.groupId]
494
+ data: i
495
+ }) => Ja(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
496
+ onSuccess: (t, i) => {
497
+ a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
498
+ queryKey: ["group-members", i.groupId]
499
499
  }), a.invalidateQueries({ queryKey: ["groups"] }), A.success("Members added successfully");
500
500
  },
501
501
  onError: (t) => {
@@ -505,16 +505,16 @@ function Xa() {
505
505
  }
506
506
  });
507
507
  }
508
- function Ya() {
509
- const { authToken: s, tokenProps: n } = U(), a = le();
510
- return ce({
508
+ function st() {
509
+ const { authToken: s, tokenProps: n } = U(), a = ce();
510
+ return le({
511
511
  mutationFn: ({
512
512
  groupId: t,
513
- data: o
514
- }) => Qa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, o),
515
- onSuccess: (t, o) => {
516
- a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
517
- queryKey: ["group-members", o.groupId]
513
+ data: i
514
+ }) => Ya(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
515
+ onSuccess: (t, i) => {
516
+ a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
517
+ queryKey: ["group-members", i.groupId]
518
518
  }), a.invalidateQueries({ queryKey: ["groups"] }), A.success("Members removed successfully");
519
519
  },
520
520
  onError: (t) => {
@@ -524,25 +524,25 @@ function Ya() {
524
524
  }
525
525
  });
526
526
  }
527
- function Za({
527
+ function at({
528
528
  onSuccess: s,
529
529
  tenantId: n,
530
530
  isTenantUser: a
531
531
  }) {
532
- const [t, o] = S(""), [i, u] = S(""), [m, f] = S({}), b = Wa(), d = () => {
532
+ const [t, i] = S(""), [o, u] = S(""), [m, f] = S({}), b = Xa(), d = () => {
533
533
  const h = {};
534
- return t.trim() ? t.length < 3 ? h.name = "Group name must be at least 3 characters" : t.length > 50 && (h.name = "Group name must be less than 50 characters") : h.name = "Group name is required", i && i.length > 200 && (h.description = "Description must be less than 200 characters"), f(h), Object.keys(h).length === 0;
534
+ return t.trim() ? t.length < 3 ? h.name = "Group name must be at least 3 characters" : t.length > 50 && (h.name = "Group name must be less than 50 characters") : h.name = "Group name is required", o && o.length > 200 && (h.description = "Description must be less than 200 characters"), f(h), Object.keys(h).length === 0;
535
535
  };
536
536
  return /* @__PURE__ */ r("form", { onSubmit: async (h) => {
537
537
  if (h.preventDefault(), !d()) return;
538
538
  const p = {
539
539
  name: t.trim(),
540
- description: i.trim() || void 0,
540
+ description: o.trim() || void 0,
541
541
  type: a ? "TENANT_GROUP" : "ORG_GROUP",
542
542
  ...a && n ? { tenantId: n } : {}
543
543
  };
544
544
  try {
545
- await b.mutateAsync(p), o(""), u(""), f({}), s();
545
+ await b.mutateAsync(p), i(""), u(""), f({}), s();
546
546
  } catch (v) {
547
547
  console.error("Failed to create group:", v);
548
548
  }
@@ -560,7 +560,7 @@ function Za({
560
560
  placeholder: "e.g., Marketing Team, Engineering Squad",
561
561
  value: t,
562
562
  onChange: (h) => {
563
- o(h.target.value), m.name && f((p) => ({ ...p, name: "" }));
563
+ i(h.target.value), m.name && f((p) => ({ ...p, name: "" }));
564
564
  },
565
565
  className: m.name ? "border-destructive" : "",
566
566
  disabled: b.isPending
@@ -578,7 +578,7 @@ function Za({
578
578
  {
579
579
  id: "group-description",
580
580
  placeholder: "Describe the purpose of this group...",
581
- value: i,
581
+ value: o,
582
582
  onChange: (h) => {
583
583
  u(h.target.value), m.description && f((p) => ({ ...p, description: "" }));
584
584
  },
@@ -589,7 +589,7 @@ function Za({
589
589
  ),
590
590
  m.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.description }),
591
591
  /* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: [
592
- i.length,
592
+ o.length,
593
593
  "/200 characters"
594
594
  ] })
595
595
  ] }),
@@ -605,7 +605,7 @@ function Za({
605
605
  type: "button",
606
606
  variant: "outline",
607
607
  onClick: () => {
608
- o(""), u(""), f({});
608
+ i(""), u(""), f({});
609
609
  },
610
610
  disabled: b.isPending,
611
611
  children: "Clear"
@@ -617,10 +617,10 @@ function Za({
617
617
  type: "submit",
618
618
  disabled: b.isPending || !t.trim(),
619
619
  children: b.isPending ? /* @__PURE__ */ r(_, { children: [
620
- /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
620
+ /* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
621
621
  "Creating..."
622
622
  ] }) : /* @__PURE__ */ r(_, { children: [
623
- /* @__PURE__ */ e(j, { className: "mr-2 h-4 w-4" }),
623
+ /* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4" }),
624
624
  "Create Group"
625
625
  ] })
626
626
  }
@@ -628,59 +628,59 @@ function Za({
628
628
  ] })
629
629
  ] });
630
630
  }
631
- function et(s, n = []) {
631
+ function tt(s, n = []) {
632
632
  let a = [];
633
- function t(i, u) {
633
+ function t(o, u) {
634
634
  const m = L.createContext(u);
635
- m.displayName = i + "Context";
635
+ m.displayName = o + "Context";
636
636
  const f = a.length;
637
637
  a = [...a, u];
638
- const b = (c) => {
638
+ const b = (l) => {
639
639
  var E;
640
- const { scope: h, children: p, ...v } = c, y = ((E = h == null ? void 0 : h[s]) == null ? void 0 : E[f]) || m, N = L.useMemo(() => v, Object.values(v));
640
+ const { scope: h, children: p, ...v } = l, y = ((E = h == null ? void 0 : h[s]) == null ? void 0 : E[f]) || m, N = L.useMemo(() => v, Object.values(v));
641
641
  return /* @__PURE__ */ e(y.Provider, { value: N, children: p });
642
642
  };
643
- b.displayName = i + "Provider";
644
- function d(c, h) {
643
+ b.displayName = o + "Provider";
644
+ function d(l, h) {
645
645
  var y;
646
646
  const p = ((y = h == null ? void 0 : h[s]) == null ? void 0 : y[f]) || m, v = L.useContext(p);
647
647
  if (v) return v;
648
648
  if (u !== void 0) return u;
649
- throw new Error(`\`${c}\` must be used within \`${i}\``);
649
+ throw new Error(`\`${l}\` must be used within \`${o}\``);
650
650
  }
651
651
  return [b, d];
652
652
  }
653
- const o = () => {
654
- const i = a.map((u) => L.createContext(u));
653
+ const i = () => {
654
+ const o = a.map((u) => L.createContext(u));
655
655
  return function(m) {
656
- const f = (m == null ? void 0 : m[s]) || i;
656
+ const f = (m == null ? void 0 : m[s]) || o;
657
657
  return L.useMemo(
658
658
  () => ({ [`__scope${s}`]: { ...m, [s]: f } }),
659
659
  [m, f]
660
660
  );
661
661
  };
662
662
  };
663
- return o.scopeName = s, [t, st(o, ...n)];
663
+ return i.scopeName = s, [t, rt(i, ...n)];
664
664
  }
665
- function st(...s) {
665
+ function rt(...s) {
666
666
  const n = s[0];
667
667
  if (s.length === 1) return n;
668
668
  const a = () => {
669
- const t = s.map((o) => ({
670
- useScope: o(),
671
- scopeName: o.scopeName
669
+ const t = s.map((i) => ({
670
+ useScope: i(),
671
+ scopeName: i.scopeName
672
672
  }));
673
- return function(i) {
673
+ return function(o) {
674
674
  const u = t.reduce((m, { useScope: f, scopeName: b }) => {
675
- const c = f(i)[`__scope${b}`];
676
- return { ...m, ...c };
675
+ const l = f(o)[`__scope${b}`];
676
+ return { ...m, ...l };
677
677
  }, {});
678
678
  return L.useMemo(() => ({ [`__scope${n.scopeName}`]: u }), [u]);
679
679
  };
680
680
  };
681
681
  return a.scopeName = n.scopeName, a;
682
682
  }
683
- var at = [
683
+ var nt = [
684
684
  "a",
685
685
  "button",
686
686
  "div",
@@ -698,33 +698,33 @@ var at = [
698
698
  "span",
699
699
  "svg",
700
700
  "ul"
701
- ], Re = at.reduce((s, n) => {
702
- const a = sa(`Primitive.${n}`), t = L.forwardRef((o, i) => {
703
- const { asChild: u, ...m } = o, f = u ? a : n;
704
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(f, { ...m, ref: i });
701
+ ], Re = nt.reduce((s, n) => {
702
+ const a = sa(`Primitive.${n}`), t = L.forwardRef((i, o) => {
703
+ const { asChild: u, ...m } = i, f = u ? a : n;
704
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(f, { ...m, ref: o });
705
705
  });
706
706
  return t.displayName = `Primitive.${n}`, { ...s, [n]: t };
707
707
  }, {});
708
- function tt() {
709
- return Fa.useSyncExternalStore(
710
- rt,
708
+ function ot() {
709
+ return qa.useSyncExternalStore(
710
+ it,
711
711
  () => !0,
712
712
  () => !1
713
713
  );
714
714
  }
715
- function rt() {
715
+ function it() {
716
716
  return () => {
717
717
  };
718
718
  }
719
- var Pe = "Avatar", [nt] = et(Pe), [ot, Ss] = nt(Pe), xs = L.forwardRef(
719
+ var Pe = "Avatar", [ct] = tt(Pe), [lt, Ss] = ct(Pe), xs = L.forwardRef(
720
720
  (s, n) => {
721
- const { __scopeAvatar: a, ...t } = s, [o, i] = L.useState("idle");
721
+ const { __scopeAvatar: a, ...t } = s, [i, o] = L.useState("idle");
722
722
  return /* @__PURE__ */ e(
723
- ot,
723
+ lt,
724
724
  {
725
725
  scope: a,
726
- imageLoadingStatus: o,
727
- onImageLoadingStatusChange: i,
726
+ imageLoadingStatus: i,
727
+ onImageLoadingStatusChange: o,
728
728
  children: /* @__PURE__ */ e(Re.span, { ...t, ref: n })
729
729
  }
730
730
  );
@@ -733,47 +733,47 @@ var Pe = "Avatar", [nt] = et(Pe), [ot, Ss] = nt(Pe), xs = L.forwardRef(
733
733
  xs.displayName = Pe;
734
734
  var ws = "AvatarImage", Cs = L.forwardRef(
735
735
  (s, n) => {
736
- const { __scopeAvatar: a, src: t, onLoadingStatusChange: o = () => {
737
- }, ...i } = s, u = Ss(ws, a), m = it(t, i), f = aa((b) => {
738
- o(b), u.onImageLoadingStatusChange(b);
736
+ const { __scopeAvatar: a, src: t, onLoadingStatusChange: i = () => {
737
+ }, ...o } = s, u = Ss(ws, a), m = dt(t, o), f = aa((b) => {
738
+ i(b), u.onImageLoadingStatusChange(b);
739
739
  });
740
740
  return xe(() => {
741
741
  m !== "idle" && f(m);
742
- }, [m, f]), m === "loaded" ? /* @__PURE__ */ e(Re.img, { ...i, ref: n, src: t }) : null;
742
+ }, [m, f]), m === "loaded" ? /* @__PURE__ */ e(Re.img, { ...o, ref: n, src: t }) : null;
743
743
  }
744
744
  );
745
745
  Cs.displayName = ws;
746
746
  var Ds = "AvatarFallback", Ls = L.forwardRef(
747
747
  (s, n) => {
748
- const { __scopeAvatar: a, delayMs: t, ...o } = s, i = Ss(Ds, a), [u, m] = L.useState(t === void 0);
748
+ const { __scopeAvatar: a, delayMs: t, ...i } = s, o = Ss(Ds, a), [u, m] = L.useState(t === void 0);
749
749
  return L.useEffect(() => {
750
750
  if (t !== void 0) {
751
751
  const f = window.setTimeout(() => m(!0), t);
752
752
  return () => window.clearTimeout(f);
753
753
  }
754
- }, [t]), u && i.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Re.span, { ...o, ref: n }) : null;
754
+ }, [t]), u && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Re.span, { ...i, ref: n }) : null;
755
755
  }
756
756
  );
757
757
  Ls.displayName = Ds;
758
758
  function Ze(s, n) {
759
759
  return s ? n ? (s.src !== n && (s.src = n), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
760
760
  }
761
- function it(s, { referrerPolicy: n, crossOrigin: a }) {
762
- const t = tt(), o = L.useRef(null), i = t ? (o.current || (o.current = new window.Image()), o.current) : null, [u, m] = L.useState(
763
- () => Ze(i, s)
761
+ function dt(s, { referrerPolicy: n, crossOrigin: a }) {
762
+ const t = ot(), i = L.useRef(null), o = t ? (i.current || (i.current = new window.Image()), i.current) : null, [u, m] = L.useState(
763
+ () => Ze(o, s)
764
764
  );
765
765
  return xe(() => {
766
- m(Ze(i, s));
767
- }, [i, s]), xe(() => {
768
- const f = (c) => () => {
769
- m(c);
766
+ m(Ze(o, s));
767
+ }, [o, s]), xe(() => {
768
+ const f = (l) => () => {
769
+ m(l);
770
770
  };
771
- if (!i) return;
771
+ if (!o) return;
772
772
  const b = f("loaded"), d = f("error");
773
- return i.addEventListener("load", b), i.addEventListener("error", d), n && (i.referrerPolicy = n), typeof a == "string" && (i.crossOrigin = a), () => {
774
- i.removeEventListener("load", b), i.removeEventListener("error", d);
773
+ return o.addEventListener("load", b), o.addEventListener("error", d), n && (o.referrerPolicy = n), typeof a == "string" && (o.crossOrigin = a), () => {
774
+ o.removeEventListener("load", b), o.removeEventListener("error", d);
775
775
  };
776
- }, [i, a, n]), u;
776
+ }, [o, a, n]), u;
777
777
  }
778
778
  var Es = xs, As = Cs, Ms = Ls;
779
779
  const Ue = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
@@ -788,7 +788,7 @@ const Ue = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
788
788
  }
789
789
  ));
790
790
  Ue.displayName = Es.displayName;
791
- const lt = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
791
+ const ut = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
792
792
  As,
793
793
  {
794
794
  ref: a,
@@ -796,7 +796,7 @@ const lt = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
796
796
  ...n
797
797
  }
798
798
  ));
799
- lt.displayName = As.displayName;
799
+ ut.displayName = As.displayName;
800
800
  const Fe = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
801
801
  Ms,
802
802
  {
@@ -809,18 +809,18 @@ const Fe = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
809
809
  }
810
810
  ));
811
811
  Fe.displayName = Ms.displayName;
812
- function ct({
812
+ function mt({
813
813
  open: s,
814
814
  onOpenChange: n,
815
815
  group: a,
816
816
  onUpdate: t
817
817
  }) {
818
- const [o, i] = S("members"), [u, m] = S(""), [f, b] = S([]), [d, c] = S([]), { data: h, isLoading: p, refetch: v } = ta(a.id), y = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: N, isLoading: E } = ra({
818
+ const [i, o] = S("members"), [u, m] = S(""), [f, b] = S([]), [d, l] = S([]), { data: h, isLoading: p, refetch: v } = ta(a.id), y = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: N, isLoading: E } = ra({
819
819
  type: y,
820
820
  tenantId: a.tenantId || void 0,
821
821
  active: !0,
822
822
  limit: 100
823
- }), T = Xa(), R = Ya(), k = (h == null ? void 0 : h.members) || [], P = re(() => new Set(k.map((g) => g.userId)), [k]), G = re(() => N.filter((g) => !P.has(g.id)), [N, P]), q = re(() => {
823
+ }), T = et(), R = st(), k = (h == null ? void 0 : h.members) || [], P = re(() => new Set(k.map((g) => g.userId)), [k]), G = re(() => N.filter((g) => !P.has(g.id)), [N, P]), V = re(() => {
824
824
  if (!u) return G;
825
825
  const g = u.toLowerCase();
826
826
  return G.filter(
@@ -834,8 +834,8 @@ function ct({
834
834
  const g = u.toLowerCase();
835
835
  return k.filter(
836
836
  (D) => {
837
- var O, F, X, Y;
838
- return ((F = (O = D.user) == null ? void 0 : O.name) == null ? void 0 : F.toLowerCase().includes(g)) || ((Y = (X = D.user) == null ? void 0 : X.email) == null ? void 0 : Y.toLowerCase().includes(g));
837
+ var O, F, Y, X;
838
+ return ((F = (O = D.user) == null ? void 0 : O.name) == null ? void 0 : F.toLowerCase().includes(g)) || ((X = (Y = D.user) == null ? void 0 : Y.email) == null ? void 0 : X.toLowerCase().includes(g));
839
839
  }
840
840
  );
841
841
  }, [k, u]), z = async () => {
@@ -847,7 +847,7 @@ function ct({
847
847
  userIds: f,
848
848
  userType: y === "tenant" ? "tenant" : "org"
849
849
  }
850
- }), b([]), i("members"), v(), t == null || t();
850
+ }), b([]), o("members"), v(), t == null || t();
851
851
  } catch (g) {
852
852
  console.error("Failed to add members:", g);
853
853
  }
@@ -859,7 +859,7 @@ function ct({
859
859
  data: {
860
860
  userIds: d
861
861
  }
862
- }), c([]), v(), t == null || t();
862
+ }), l([]), v(), t == null || t();
863
863
  } catch (g) {
864
864
  console.error("Failed to remove members:", g);
865
865
  }
@@ -868,7 +868,7 @@ function ct({
868
868
  (D) => D.includes(g) ? D.filter((O) => O !== g) : [...D, g]
869
869
  );
870
870
  }, C = (g) => {
871
- c(
871
+ l(
872
872
  (D) => D.includes(g) ? D.filter((O) => O !== g) : [...D, g]
873
873
  );
874
874
  };
@@ -886,10 +886,10 @@ function ct({
886
886
  " group"
887
887
  ] })
888
888
  ] }),
889
- /* @__PURE__ */ r(ls, { value: o, onValueChange: (g) => {
890
- i(g), m(""), c([]);
889
+ /* @__PURE__ */ r(cs, { value: i, onValueChange: (g) => {
890
+ o(g), m(""), l([]);
891
891
  }, className: "mt-4", children: [
892
- /* @__PURE__ */ r(cs, { className: "grid w-full grid-cols-2", children: [
892
+ /* @__PURE__ */ r(ls, { className: "grid w-full grid-cols-2", children: [
893
893
  /* @__PURE__ */ e(ne, { value: "members", children: "Current Members" }),
894
894
  /* @__PURE__ */ e(ne, { value: "add", children: "Add Members" })
895
895
  ] }),
@@ -907,11 +907,11 @@ function ct({
907
907
  )
908
908
  ] }),
909
909
  /* @__PURE__ */ e(Ce, { className: d.length > 0 ? "h-[300px]" : "h-[350px]", children: p ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(De, { className: "h-16 w-full" }, g)) }) : w.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
910
- /* @__PURE__ */ e(j, { className: "h-12 w-12 mb-3 opacity-50" }),
910
+ /* @__PURE__ */ e(q, { className: "h-12 w-12 mb-3 opacity-50" }),
911
911
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: u ? "No members found" : "No members yet" }),
912
912
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
913
913
  ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: w.map((g) => /* @__PURE__ */ e(
914
- dt,
914
+ ht,
915
915
  {
916
916
  member: g,
917
917
  selected: d.includes(g.userId),
@@ -934,7 +934,7 @@ function ct({
934
934
  onClick: de,
935
935
  disabled: R.isPending,
936
936
  children: R.isPending ? /* @__PURE__ */ r(_, { children: [
937
- /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
937
+ /* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
938
938
  "Removing..."
939
939
  ] }) : /* @__PURE__ */ r(_, { children: [
940
940
  /* @__PURE__ */ e(ds, { className: "mr-2 h-4 w-4" }),
@@ -957,12 +957,12 @@ function ct({
957
957
  }
958
958
  )
959
959
  ] }),
960
- /* @__PURE__ */ e(Ce, { className: "h-[300px]", children: E ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(De, { className: "h-16 w-full" }, g)) }) : q.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
960
+ /* @__PURE__ */ e(Ce, { className: "h-[300px]", children: E ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(De, { className: "h-16 w-full" }, g)) }) : V.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
961
961
  /* @__PURE__ */ e(Le, { className: "h-12 w-12 mb-3 opacity-50" }),
962
962
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
963
963
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : "All eligible users are already members" })
964
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: q.map((g) => /* @__PURE__ */ e(
965
- ut,
964
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: V.map((g) => /* @__PURE__ */ e(
965
+ pt,
966
966
  {
967
967
  user: g,
968
968
  selected: f.includes(g.id),
@@ -983,7 +983,7 @@ function ct({
983
983
  onClick: z,
984
984
  disabled: T.isPending,
985
985
  children: T.isPending ? /* @__PURE__ */ r(_, { children: [
986
- /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
986
+ /* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
987
987
  "Adding..."
988
988
  ] }) : /* @__PURE__ */ r(_, { children: [
989
989
  /* @__PURE__ */ e(Le, { className: "mr-2 h-4 w-4" }),
@@ -996,13 +996,13 @@ function ct({
996
996
  ] })
997
997
  ] }) }) });
998
998
  }
999
- function dt({
999
+ function ht({
1000
1000
  member: s,
1001
1001
  selected: n,
1002
1002
  onToggle: a
1003
1003
  }) {
1004
- var o, i, u, m;
1005
- const t = ((i = (o = s.user) == null ? void 0 : o.name) == null ? void 0 : i.split(" ").map((f) => f[0]).join("").toUpperCase()) || "?";
1004
+ var i, o, u, m;
1005
+ const t = ((o = (i = s.user) == null ? void 0 : i.name) == null ? void 0 : o.split(" ").map((f) => f[0]).join("").toUpperCase()) || "?";
1006
1006
  return /* @__PURE__ */ r(
1007
1007
  "div",
1008
1008
  {
@@ -1019,13 +1019,13 @@ function dt({
1019
1019
  }
1020
1020
  );
1021
1021
  }
1022
- function ut({
1022
+ function pt({
1023
1023
  user: s,
1024
1024
  selected: n,
1025
1025
  onToggle: a
1026
1026
  }) {
1027
- var o;
1028
- const t = ((o = s.name) == null ? void 0 : o.split(" ").map((i) => i[0]).join("").toUpperCase()) || "?";
1027
+ var i;
1028
+ const t = ((i = s.name) == null ? void 0 : i.split(" ").map((o) => o[0]).join("").toUpperCase()) || "?";
1029
1029
  return /* @__PURE__ */ r(
1030
1030
  "div",
1031
1031
  {
@@ -1042,44 +1042,44 @@ function ut({
1042
1042
  }
1043
1043
  );
1044
1044
  }
1045
- function mt({
1045
+ function ft({
1046
1046
  open: s,
1047
1047
  onOpenChange: n
1048
1048
  }) {
1049
- const [a, t] = S("groups"), [o, i] = S(""), [u, m] = S(null), [f, b] = S(!1), [d, c] = S(null), { tokenProps: h } = U(), { currentUser: p } = ms(), v = Ja(), y = (p == null ? void 0 : p.type) === "tenant", N = h == null ? void 0 : h.tenantId, { groups: E, isLoading: T, refetch: R } = na({
1049
+ const [a, t] = S("groups"), [i, o] = S(""), [u, m] = S(null), [f, b] = S(!1), [d, l] = S(null), { tokenProps: h } = U(), { currentUser: p } = ms(), v = Za(), y = (p == null ? void 0 : p.type) === "tenant", N = h == null ? void 0 : h.tenantId, { groups: E, isLoading: T, refetch: R } = na({
1050
1050
  type: y ? "TENANT_GROUP" : "all",
1051
1051
  tenantId: y ? N : void 0,
1052
1052
  includeMembers: !1
1053
1053
  }), k = E.filter(
1054
1054
  (w) => {
1055
1055
  var z;
1056
- return w.name.toLowerCase().includes(o.toLowerCase()) || ((z = w.description) == null ? void 0 : z.toLowerCase().includes(o.toLowerCase()));
1056
+ return w.name.toLowerCase().includes(i.toLowerCase()) || ((z = w.description) == null ? void 0 : z.toLowerCase().includes(i.toLowerCase()));
1057
1057
  }
1058
1058
  ), P = async () => {
1059
1059
  if (d)
1060
1060
  try {
1061
- await v.mutateAsync(d.id), c(null), R();
1061
+ await v.mutateAsync(d.id), l(null), R();
1062
1062
  } catch (w) {
1063
1063
  console.error("Failed to delete group:", w);
1064
1064
  }
1065
1065
  }, G = (w) => {
1066
1066
  m(w), b(!0);
1067
- }, q = () => {
1067
+ }, V = () => {
1068
1068
  t("groups"), R();
1069
1069
  };
1070
1070
  return /* @__PURE__ */ r(_, { children: [
1071
1071
  /* @__PURE__ */ e(Oe, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(_e, { className: "max-w-4xl max-h-[80vh]", children: [
1072
1072
  /* @__PURE__ */ r(Te, { children: [
1073
1073
  /* @__PURE__ */ r(Ge, { className: "flex items-center gap-2", children: [
1074
- /* @__PURE__ */ e(j, { className: "h-5 w-5" }),
1074
+ /* @__PURE__ */ e(q, { className: "h-5 w-5" }),
1075
1075
  "Group Management"
1076
1076
  ] }),
1077
1077
  /* @__PURE__ */ e(rs, { children: "Manage your groups, create new groups, and control group membership" })
1078
1078
  ] }),
1079
- /* @__PURE__ */ r(ls, { value: a, onValueChange: t, className: "mt-4", children: [
1080
- /* @__PURE__ */ r(cs, { className: "grid w-full grid-cols-2", children: [
1079
+ /* @__PURE__ */ r(cs, { value: a, onValueChange: t, className: "mt-4", children: [
1080
+ /* @__PURE__ */ r(ls, { className: "grid w-full grid-cols-2", children: [
1081
1081
  /* @__PURE__ */ r(ne, { value: "groups", className: "flex items-center gap-2", children: [
1082
- /* @__PURE__ */ e(j, { className: "h-4 w-4" }),
1082
+ /* @__PURE__ */ e(q, { className: "h-4 w-4" }),
1083
1083
  "Groups"
1084
1084
  ] }),
1085
1085
  /* @__PURE__ */ r(ne, { value: "create", className: "flex items-center gap-2", children: [
@@ -1094,31 +1094,31 @@ function mt({
1094
1094
  W,
1095
1095
  {
1096
1096
  placeholder: "Search groups...",
1097
- value: o,
1098
- onChange: (w) => i(w.target.value),
1097
+ value: i,
1098
+ onChange: (w) => o(w.target.value),
1099
1099
  className: "pl-10"
1100
1100
  }
1101
1101
  )
1102
1102
  ] }),
1103
1103
  /* @__PURE__ */ e(Ce, { className: "h-[400px]", children: T ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((w) => /* @__PURE__ */ e(De, { className: "h-24 w-full" }, w)) }) : k.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1104
- /* @__PURE__ */ e(j, { className: "h-12 w-12 mb-3 opacity-50" }),
1104
+ /* @__PURE__ */ e(q, { className: "h-12 w-12 mb-3 opacity-50" }),
1105
1105
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
1106
- /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: o ? "Try a different search" : "Create your first group to get started" })
1106
+ /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: i ? "Try a different search" : "Create your first group to get started" })
1107
1107
  ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: k.map((w) => /* @__PURE__ */ e(
1108
- ht,
1108
+ gt,
1109
1109
  {
1110
1110
  group: w,
1111
1111
  onManageMembers: () => G(w),
1112
- onDelete: () => c(w),
1112
+ onDelete: () => l(w),
1113
1113
  currentUserId: p == null ? void 0 : p.id
1114
1114
  },
1115
1115
  w.id
1116
1116
  )) }) })
1117
1117
  ] }) }),
1118
1118
  /* @__PURE__ */ e(oe, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
1119
- Za,
1119
+ at,
1120
1120
  {
1121
- onSuccess: q,
1121
+ onSuccess: V,
1122
1122
  tenantId: N,
1123
1123
  isTenantUser: y
1124
1124
  }
@@ -1126,7 +1126,7 @@ function mt({
1126
1126
  ] })
1127
1127
  ] }) }),
1128
1128
  u && /* @__PURE__ */ e(
1129
- ct,
1129
+ mt,
1130
1130
  {
1131
1131
  open: f,
1132
1132
  onOpenChange: b,
@@ -1138,7 +1138,7 @@ function mt({
1138
1138
  hs,
1139
1139
  {
1140
1140
  open: !!d,
1141
- onOpenChange: () => c(null),
1141
+ onOpenChange: () => l(null),
1142
1142
  children: /* @__PURE__ */ r(ps, { children: [
1143
1143
  /* @__PURE__ */ r(fs, { children: [
1144
1144
  /* @__PURE__ */ e(gs, { children: "Delete Group" }),
@@ -1157,7 +1157,7 @@ function mt({
1157
1157
  disabled: v.isPending,
1158
1158
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1159
1159
  children: v.isPending ? /* @__PURE__ */ r(_, { children: [
1160
- /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
1160
+ /* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
1161
1161
  "Deleting..."
1162
1162
  ] }) : "Delete Group"
1163
1163
  }
@@ -1168,13 +1168,13 @@ function mt({
1168
1168
  )
1169
1169
  ] });
1170
1170
  }
1171
- function ht({
1171
+ function gt({
1172
1172
  group: s,
1173
1173
  onManageMembers: n,
1174
1174
  onDelete: a,
1175
1175
  currentUserId: t
1176
1176
  }) {
1177
- const o = s.createdBy === t;
1177
+ const i = s.createdBy === t;
1178
1178
  return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */ r("div", { className: "flex items-start justify-between gap-3", children: [
1179
1179
  /* @__PURE__ */ r("div", { className: "flex-1 space-y-2", children: [
1180
1180
  /* @__PURE__ */ r("div", { children: [
@@ -1183,14 +1183,14 @@ function ht({
1183
1183
  ] }),
1184
1184
  /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
1185
1185
  /* @__PURE__ */ r("span", { className: "flex items-center gap-1", children: [
1186
- /* @__PURE__ */ e(j, { className: "h-3 w-3" }),
1186
+ /* @__PURE__ */ e(q, { className: "h-3 w-3" }),
1187
1187
  s.memberCount,
1188
1188
  " ",
1189
1189
  s.memberCount === 1 ? "member" : "members"
1190
1190
  ] }),
1191
1191
  /* @__PURE__ */ r("span", { children: [
1192
1192
  "Created ",
1193
- Oa(new Date(s.createdAt), "MMM d, yyyy")
1193
+ Ta(new Date(s.createdAt), "MMM d, yyyy")
1194
1194
  ] })
1195
1195
  ] })
1196
1196
  ] }),
@@ -1205,7 +1205,7 @@ function ht({
1205
1205
  children: /* @__PURE__ */ e(Le, { className: "h-4 w-4" })
1206
1206
  }
1207
1207
  ),
1208
- o && /* @__PURE__ */ e(
1208
+ i && /* @__PURE__ */ e(
1209
1209
  M,
1210
1210
  {
1211
1211
  variant: "ghost",
@@ -1219,54 +1219,55 @@ function ht({
1219
1219
  ] })
1220
1220
  ] }) });
1221
1221
  }
1222
- function wt() {
1223
- var He, Ke, Be;
1222
+ function Lt() {
1223
+ var He, Be, Ke;
1224
+ Da(), La();
1224
1225
  const {
1225
1226
  authToken: s,
1226
1227
  tokenProps: n,
1227
1228
  id: a
1228
- } = U(), { isLocalDev: t } = oa(), { permissions: o } = ka(), i = ia(), { isLoading: u } = la();
1229
- x((l) => l.theme);
1230
- const m = x((l) => l.lenses), f = x((l) => l.selectedLensId), b = m == null ? void 0 : m.find((l) => l.id === f), d = x((l) => l.dashboard);
1231
- x((l) => l.selectedSheetId);
1232
- const c = x(
1233
- (l) => l.isDashboardEditing
1234
- ), { setDashboardTitle: h } = x((l) => l.actions), [p, v] = S(!1), [y, N] = S(!1), [E, T] = S(!1), [R, k] = S(!1), [P, G] = S(null), [q, w] = S(!1), z = x((l) => l.isDashboardPanelOpen), de = x(
1235
- (l) => l.actions.setIsDashboardPanelOpen
1236
- ), ue = x((l) => l.filterValues), C = x((l) => l.isVisualEditing);
1237
- We((l) => l.card);
1229
+ } = U(), { isLocalDev: t } = oa(), { permissions: i } = _a(), o = ia(), { isLoading: u } = ca();
1230
+ x((c) => c.theme);
1231
+ const m = x((c) => c.lenses), f = x((c) => c.selectedLensId), b = m == null ? void 0 : m.find((c) => c.id === f), d = x((c) => c.dashboard);
1232
+ x((c) => c.selectedSheetId);
1233
+ const l = x(
1234
+ (c) => c.isDashboardEditing
1235
+ ), { setDashboardTitle: h } = x((c) => c.actions), [p, v] = S(!1), [y, N] = S(!1), [E, T] = S(!1), [R, k] = S(!1), [P, G] = S(null), [V, w] = S(!1), z = x((c) => c.isDashboardPanelOpen), de = x(
1236
+ (c) => c.actions.setIsDashboardPanelOpen
1237
+ ), ue = x((c) => c.filterValues), C = x((c) => c.isVisualEditing);
1238
+ We((c) => c.card);
1238
1239
  const g = te(
1239
- (l) => l.selectedDashboard
1240
+ (c) => c.selectedDashboard
1240
1241
  ), D = te(
1241
- (l) => l.initialDashboard
1242
+ (c) => c.initialDashboard
1242
1243
  );
1243
- te((l) => l.selectedVisual), x((l) => l.selectedFrameId), We((l) => l.frame);
1244
- const O = g ? (Ke = g == null ? void 0 : g.permissions) == null ? void 0 : Ke.canEdit : (He = D == null ? void 0 : D.permissions) == null ? void 0 : He.canEdit, F = x((l) => l.showFilters), X = ca((l) => l.setPanelOpen), Y = x(
1245
- (l) => l.showDashboardJSON
1246
- ), me = x((l) => l.onSaveFunction), ks = x(
1247
- (l) => l.actions.setShowFilters
1248
- ), { setIsDashboardEditing: $e, setShowDashboardJSON: Ve } = x(
1249
- (l) => l.actions
1250
- ), { setInitialDashboard: je, clearSelectedDashboard: Os } = te(
1251
- (l) => l.actions
1252
- ), { resources: Z } = da(be.DASHBOARD), { currentUser: Is } = ms(), _s = ua(Is), H = g || D, qe = H ? {
1244
+ te((c) => c.selectedVisual), x((c) => c.selectedFrameId), We((c) => c.frame);
1245
+ const O = g ? (Be = g == null ? void 0 : g.permissions) == null ? void 0 : Be.canEdit : (He = D == null ? void 0 : D.permissions) == null ? void 0 : He.canEdit, F = x((c) => c.showFilters), Y = la((c) => c.setPanelOpen), X = x(
1246
+ (c) => c.showDashboardJSON
1247
+ ), me = x((c) => c.onSaveFunction), ks = x(
1248
+ (c) => c.actions.setShowFilters
1249
+ ), { setIsDashboardEditing: je, setShowDashboardJSON: $e } = x(
1250
+ (c) => c.actions
1251
+ ), { setInitialDashboard: qe, clearSelectedDashboard: Os } = te(
1252
+ (c) => c.actions
1253
+ ), { resources: Z } = da(be.DASHBOARD), { currentUser: Is } = ms(), _s = ua(Is), H = g || D, Ve = H ? {
1253
1254
  id: H.id,
1254
1255
  title: (d == null ? void 0 : d.title) || H.title || "Dashboard"
1255
- } : null, { handleAddNewFrame: Ts } = ma(), [K, he] = S(!1), [Gs, ee] = S(!1), se = ha(be.DASHBOARD), [B, pe] = S(
1256
+ } : null, { handleAddNewFrame: Ts } = ma(), [B, he] = S(!1), [Gs, ee] = S(!1), se = ha(be.DASHBOARD), [K, pe] = S(
1256
1257
  null
1257
- ), Rs = async (l, I) => {
1258
+ ), Rs = async (c, I) => {
1258
1259
  if (!(d != null && d.id)) {
1259
1260
  console.log("No dashboard ID found");
1260
1261
  return;
1261
1262
  }
1262
1263
  console.log("Updating dashboard title:", {
1263
1264
  dashboardId: d.id,
1264
- newTitle: l,
1265
+ newTitle: c,
1265
1266
  previousTitle: I
1266
1267
  }), se.mutate(
1267
1268
  {
1268
1269
  resourceId: d.id,
1269
- data: { title: l }
1270
+ data: { title: c }
1270
1271
  },
1271
1272
  {
1272
1273
  onSuccess: () => {
@@ -1280,45 +1281,45 @@ function wt() {
1280
1281
  };
1281
1282
  Ca(() => {
1282
1283
  if (Z && Z.length > 0) {
1283
- const l = d == null ? void 0 : d.id;
1284
- if (l) {
1284
+ const c = d == null ? void 0 : d.id;
1285
+ if (c) {
1285
1286
  const I = Z.find(
1286
- (Q) => Q.id === l
1287
+ (Q) => Q.id === c
1287
1288
  );
1288
- I && je(I);
1289
+ I && qe(I);
1289
1290
  }
1290
1291
  }
1291
- }, [Z, d == null ? void 0 : d.id, je]);
1292
- const ae = n.orgUserId || n.tenantId, Ps = c && !C && ae && O, { setDashboard: Us } = x((l) => l.actions), Fs = () => {
1293
- $e(!0);
1292
+ }, [Z, d == null ? void 0 : d.id, qe]);
1293
+ const ae = n.orgUserId || n.tenantId, Ps = l && !C && ae && O, { setDashboard: Us } = x((c) => c.actions), Fs = () => {
1294
+ je(!0);
1294
1295
  }, fe = () => {
1295
- $e(!1), Ve(!1), pe(null);
1296
+ je(!1), $e(!1), pe(null);
1296
1297
  };
1297
- Da(
1298
- c,
1298
+ Ea(
1299
+ l,
1299
1300
  d,
1300
- B,
1301
- (l) => pe(l)
1301
+ K,
1302
+ (c) => pe(c)
1302
1303
  );
1303
- const $s = () => B ? JSON.stringify(d) !== JSON.stringify(B) : !1, Vs = () => {
1304
- $s() ? ee(!0) : fe();
1305
- }, js = async () => {
1304
+ const js = () => K ? JSON.stringify(d) !== JSON.stringify(K) : !1, $s = () => {
1305
+ js() ? ee(!0) : fe();
1306
+ }, qs = async () => {
1306
1307
  await ge({ closeAfterSave: !0 });
1307
- }, qs = () => {
1308
- B && Us(B), fe(), ee(!1);
1308
+ }, Vs = () => {
1309
+ K && Us(K), fe(), ee(!1);
1309
1310
  };
1310
- async function ge(l) {
1311
- const I = (l == null ? void 0 : l.closeAfterSave) ?? q;
1311
+ async function ge(c) {
1312
+ const I = (c == null ? void 0 : c.closeAfterSave) ?? V;
1312
1313
  w(I), I && ee(!1);
1313
1314
  const Q = wa(d);
1314
1315
  k(!0), G(null), he(!0);
1315
- const Ks = {
1316
+ const Bs = {
1316
1317
  template: d
1317
1318
  };
1318
1319
  se.mutate(
1319
1320
  {
1320
1321
  resourceId: d.id,
1321
- data: Ks
1322
+ data: Bs
1322
1323
  },
1323
1324
  {
1324
1325
  onSuccess: () => {
@@ -1332,9 +1333,9 @@ function wt() {
1332
1333
  }
1333
1334
  async function zs() {
1334
1335
  if (v(!0), !f || !b) return;
1335
- const l = JSON.stringify(d), I = {
1336
+ const c = JSON.stringify(d), I = {
1336
1337
  ...b,
1337
- template: l,
1338
+ template: c,
1338
1339
  filterValues: ue
1339
1340
  };
1340
1341
  await Me(
@@ -1360,7 +1361,7 @@ function wt() {
1360
1361
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1361
1362
  Hs && /* @__PURE__ */ r(_, { children: [
1362
1363
  /* @__PURE__ */ e(
1363
- $,
1364
+ j,
1364
1365
  {
1365
1366
  "aria-label": "Manage Dashboards",
1366
1367
  tooltip: "Manage Dashboards",
@@ -1368,11 +1369,11 @@ function wt() {
1368
1369
  de(!z);
1369
1370
  },
1370
1371
  className: "h-7 p-2",
1371
- children: /* @__PURE__ */ e(_a, { className: "h-4 w-4" })
1372
+ children: /* @__PURE__ */ e(Ra, { className: "h-4 w-4" })
1372
1373
  }
1373
1374
  ),
1374
- i && !C && /* @__PURE__ */ e(
1375
- $,
1375
+ o && !C && /* @__PURE__ */ e(
1376
+ j,
1376
1377
  {
1377
1378
  "aria-label": "Dashboard Hub",
1378
1379
  tooltip: "Dashboard Hub",
@@ -1382,21 +1383,21 @@ function wt() {
1382
1383
  }
1383
1384
  )
1384
1385
  ] }),
1385
- !C && i && (u ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1386
- /* @__PURE__ */ e(V, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
1386
+ !C && o && (u ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1387
+ /* @__PURE__ */ e($, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
1387
1388
  /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
1388
1389
  ] }) : /* @__PURE__ */ e(
1389
1390
  pa,
1390
1391
  {
1391
1392
  value: ze || "Untitled Dashboard",
1392
- onSave: (l) => {
1393
+ onSave: (c) => {
1393
1394
  console.log("EditableText onSave called:", {
1394
- newTitle: l,
1395
+ newTitle: c,
1395
1396
  canEditDashboard: O,
1396
1397
  dashboardId: d == null ? void 0 : d.id
1397
1398
  });
1398
1399
  const I = (d == null ? void 0 : d.title) || "";
1399
- h(l), Rs(l, I);
1400
+ h(c), Rs(c, I);
1400
1401
  },
1401
1402
  isEditable: O && !b,
1402
1403
  displayClassName: "text-sm font-medium",
@@ -1408,45 +1409,46 @@ function wt() {
1408
1409
  ] }),
1409
1410
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1410
1411
  C && /* @__PURE__ */ r(_, { children: [
1411
- /* @__PURE__ */ e(La, { className: "mr-2" }),
1412
- /* @__PURE__ */ e(Ea, { className: "h-7" })
1412
+ /* @__PURE__ */ e(Aa, { className: "mr-2" }),
1413
+ /* @__PURE__ */ e(Ma, { className: "h-7" })
1413
1414
  ] }),
1414
1415
  t && !C && /* @__PURE__ */ r(_, { children: [
1415
1416
  /* @__PURE__ */ e(
1416
- $,
1417
+ j,
1417
1418
  {
1418
1419
  tooltip: "Copy Token",
1419
1420
  onClick: () => {
1420
- var l;
1421
- s != null && s.accessToken && ((l = navigator == null ? void 0 : navigator.clipboard) != null && l.writeText ? navigator.clipboard.writeText(s.accessToken).then(() => A.success("Token copied to clipboard")).catch(() => A.error("Unable to copy token")) : A.error("Clipboard not available"));
1421
+ var c;
1422
+ s != null && s.accessToken && ((c = navigator == null ? void 0 : navigator.clipboard) != null && c.writeText ? navigator.clipboard.writeText(s.accessToken).then(() => A.success("Token copied to clipboard")).catch(() => A.error("Unable to copy token")) : A.error("Clipboard not available"));
1422
1423
  },
1423
1424
  className: "h-7 p-2",
1424
1425
  children: /* @__PURE__ */ e(fa, { className: "h-4 w-4" })
1425
1426
  }
1426
1427
  ),
1427
1428
  /* @__PURE__ */ e(
1428
- $,
1429
+ j,
1429
1430
  {
1430
1431
  tooltip: "Invalidate Token",
1431
1432
  onClick: () => ga(n.apiServiceUrl),
1432
1433
  className: "h-7 p-2",
1433
- children: /* @__PURE__ */ e(Ga, { className: "h-4 w-4" })
1434
+ children: /* @__PURE__ */ e(Ua, { className: "h-4 w-4" })
1434
1435
  }
1435
1436
  )
1436
1437
  ] }),
1437
- !C && i && /* @__PURE__ */ e(va, {}),
1438
- !C && i && /* @__PURE__ */ e(Aa, {}),
1439
- !C && i && _s && /* @__PURE__ */ e(
1440
- $,
1438
+ !C && o && /* @__PURE__ */ e(va, {}),
1439
+ !C && o && /* @__PURE__ */ e(ka, {}),
1440
+ !C && o && /* @__PURE__ */ e(Oa, {}),
1441
+ !C && o && _s && /* @__PURE__ */ e(
1442
+ j,
1441
1443
  {
1442
1444
  tooltip: "Manage Groups",
1443
1445
  onClick: () => T(!0),
1444
1446
  className: "h-7 p-2",
1445
- children: /* @__PURE__ */ e(j, { className: "h-4 w-4" })
1447
+ children: /* @__PURE__ */ e(q, { className: "h-4 w-4" })
1446
1448
  }
1447
1449
  ),
1448
- !C && i && ((Be = H == null ? void 0 : H.permissions) == null ? void 0 : Be.canShare) && /* @__PURE__ */ e(
1449
- $,
1450
+ !C && o && ((Ke = H == null ? void 0 : H.permissions) == null ? void 0 : Ke.canShare) && /* @__PURE__ */ e(
1451
+ j,
1450
1452
  {
1451
1453
  tooltip: "Share Dashboard",
1452
1454
  onClick: () => N(!0),
@@ -1454,21 +1456,21 @@ function wt() {
1454
1456
  children: /* @__PURE__ */ e(ba, { className: "h-4 w-4" })
1455
1457
  }
1456
1458
  ),
1457
- !F && !C && c && o.canUseFilters && i && /* @__PURE__ */ e(
1459
+ !F && !C && l && i.canUseFilters && o && /* @__PURE__ */ e(
1458
1460
  M,
1459
1461
  {
1460
1462
  className: "h-7 p-2",
1461
1463
  variant: "outline",
1462
1464
  onClick: () => {
1463
- X("dashboard", !1), ks(!0);
1465
+ Y("dashboard", !1), ks(!0);
1464
1466
  },
1465
1467
  size: "sm",
1466
1468
  children: /* @__PURE__ */ e(ya, { className: "h-4 w-4" })
1467
1469
  }
1468
1470
  ),
1469
- c && !C && ae && t && i && /* @__PURE__ */ e(qa, {}),
1470
- !C && ae && t && i && /* @__PURE__ */ e(za, {}),
1471
- c && !C && ae && b && t && i && /* @__PURE__ */ r(
1471
+ l && !C && ae && t && o && /* @__PURE__ */ e(Ba, {}),
1472
+ !C && ae && t && o && /* @__PURE__ */ e(Ka, {}),
1473
+ l && !C && ae && b && t && o && /* @__PURE__ */ r(
1472
1474
  M,
1473
1475
  {
1474
1476
  className: "h-7 p-2",
@@ -1482,13 +1484,13 @@ function wt() {
1482
1484
  ]
1483
1485
  }
1484
1486
  ),
1485
- c && !C && i && /* @__PURE__ */ r(
1487
+ l && !C && o && /* @__PURE__ */ r(
1486
1488
  M,
1487
1489
  {
1488
1490
  variant: "outline",
1489
1491
  className: "h-7 p-2",
1490
1492
  size: "sm",
1491
- disabled: !c,
1493
+ disabled: !l,
1492
1494
  onClick: () => Ts(),
1493
1495
  children: [
1494
1496
  /* @__PURE__ */ e(Ie, { className: "mr-2 h-4 w-4" }),
@@ -1496,7 +1498,7 @@ function wt() {
1496
1498
  ]
1497
1499
  }
1498
1500
  ),
1499
- !C && !c && O && i && /* @__PURE__ */ r(
1501
+ !C && !l && O && o && /* @__PURE__ */ r(
1500
1502
  M,
1501
1503
  {
1502
1504
  variant: "outline",
@@ -1509,52 +1511,52 @@ function wt() {
1509
1511
  ]
1510
1512
  }
1511
1513
  ),
1512
- Ps && i && /* @__PURE__ */ r(
1514
+ Ps && o && /* @__PURE__ */ r(
1513
1515
  M,
1514
1516
  {
1515
1517
  className: "h-7 p-2",
1516
- disabled: K,
1518
+ disabled: B,
1517
1519
  onClick: () => ge(),
1518
1520
  size: "sm",
1519
1521
  children: [
1520
- K ? /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Je, { className: "mr-2 h-4 w-4" }),
1521
- K ? "Saving..." : "Save"
1522
+ B ? /* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Je, { className: "mr-2 h-4 w-4" }),
1523
+ B ? "Saving..." : "Save"
1522
1524
  ]
1523
1525
  }
1524
1526
  ),
1525
- !C && c && t && i && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1527
+ !C && l && t && o && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1526
1528
  M,
1527
1529
  {
1528
1530
  className: "h-7 p-2",
1529
- onClick: () => Ve(!Y),
1531
+ onClick: () => $e(!X),
1530
1532
  size: "sm",
1531
1533
  variant: "ghost",
1532
1534
  children: /* @__PURE__ */ e(Sa, { className: "h-4 w-4" })
1533
1535
  }
1534
1536
  ) }),
1535
- !C && t && /* @__PURE__ */ e($a, {}),
1536
- c && !C && i && /* @__PURE__ */ r(
1537
+ !C && t && /* @__PURE__ */ e(Va, {}),
1538
+ l && !C && o && /* @__PURE__ */ r(
1537
1539
  M,
1538
1540
  {
1539
1541
  variant: "outline",
1540
1542
  className: "h-7 p-2",
1541
- onClick: Vs,
1543
+ onClick: $s,
1542
1544
  children: [
1543
1545
  /* @__PURE__ */ e(os, { className: "mr-2 h-4 w-4" }),
1544
1546
  "Close"
1545
1547
  ]
1546
1548
  }
1547
1549
  ),
1548
- y && qe && /* @__PURE__ */ e(
1550
+ y && Ve && /* @__PURE__ */ e(
1549
1551
  xa,
1550
1552
  {
1551
- resource: qe,
1553
+ resource: Ve,
1552
1554
  resourceType: be.DASHBOARD,
1553
1555
  onClose: () => N(!1)
1554
1556
  }
1555
1557
  ),
1556
1558
  /* @__PURE__ */ e(
1557
- mt,
1559
+ ft,
1558
1560
  {
1559
1561
  open: E,
1560
1562
  onOpenChange: T
@@ -1564,8 +1566,8 @@ function wt() {
1564
1566
  hs,
1565
1567
  {
1566
1568
  open: R,
1567
- onOpenChange: (l) => {
1568
- !l && K && !P || (k(l), l || (G(null), w(!1)));
1569
+ onOpenChange: (c) => {
1570
+ !c && B && !P || (k(c), c || (G(null), w(!1)));
1569
1571
  },
1570
1572
  children: /* @__PURE__ */ r(ps, { className: "max-w-sm", children: [
1571
1573
  /* @__PURE__ */ r(fs, { children: [
@@ -1597,7 +1599,7 @@ function wt() {
1597
1599
  disabled: !0,
1598
1600
  className: "m-0 cursor-default",
1599
1601
  children: [
1600
- /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
1602
+ /* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
1601
1603
  "Saving..."
1602
1604
  ]
1603
1605
  }
@@ -1606,13 +1608,13 @@ function wt() {
1606
1608
  }
1607
1609
  ),
1608
1610
  /* @__PURE__ */ e(
1609
- Ma,
1611
+ Ia,
1610
1612
  {
1611
1613
  open: Gs,
1612
1614
  onOpenChange: ee,
1613
- onSave: js,
1614
- onDiscard: qs,
1615
- isSaving: K
1615
+ onSave: qs,
1616
+ onDiscard: Vs,
1617
+ isSaving: B
1616
1618
  }
1617
1619
  )
1618
1620
  ] })
@@ -1621,5 +1623,5 @@ function wt() {
1621
1623
  );
1622
1624
  }
1623
1625
  export {
1624
- wt as default
1626
+ Lt as default
1625
1627
  };