react-semaphor 0.1.207 → 0.1.209

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 (37) hide show
  1. package/dist/chunks/{dashboard-controls-HlEsqiRq.js → dashboard-controls-BNTI4r0_.js} +581 -553
  2. package/dist/chunks/{dashboard-controls-CwMm9_ki.js → dashboard-controls-Dcpx9_an.js} +8 -8
  3. package/dist/chunks/{dashboard-json-DoYcT7tI.js → dashboard-json-BjOqpGbW.js} +1 -1
  4. package/dist/chunks/{dashboard-json-CI8wIOzY.js → dashboard-json-kIoBtmBF.js} +1 -1
  5. package/dist/chunks/{dashboard-summary-settings-dialog-ioe7ZyFE.js → dashboard-summary-settings-dialog-BoX18wiA.js} +1 -1
  6. package/dist/chunks/{dashboard-summary-settings-dialog-eQcHYcAI.js → dashboard-summary-settings-dialog-CO1SwHHD.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-Cl_qfIV_.js → edit-dashboard-visual-B9HuGExj.js} +2 -2
  8. package/dist/chunks/{edit-dashboard-visual-BotbTTiL.js → edit-dashboard-visual-DG4VLoJF.js} +1108 -1122
  9. package/dist/chunks/editor-action-buttons-CDTIx_Jc.js +11 -0
  10. package/dist/chunks/editor-action-buttons-CszdZ4Fw.js +345 -0
  11. package/dist/chunks/{index-CqOQuBxB.js → index-D0TdW88i.js} +24716 -24254
  12. package/dist/chunks/index-DSA80lEg.js +1104 -0
  13. package/dist/chunks/{notification-bell-BSBRPw38.js → notification-bell-D2V1-ARa.js} +1 -1
  14. package/dist/chunks/{notification-bell-BI-XywDI.js → notification-bell-DFiRaeJQ.js} +52 -52
  15. package/dist/chunks/resource-management-panel-BhiWNPcw.js +6 -0
  16. package/dist/chunks/resource-management-panel-DS_WEv1x.js +902 -0
  17. package/dist/chunks/{use-role-aware-display-preferences-BWghO18e.js → use-role-aware-display-preferences-D8j5_cnK.js} +1 -1
  18. package/dist/chunks/{use-role-aware-display-preferences-C-m9KEuJ.js → use-role-aware-display-preferences-DfihB5pN.js} +1 -1
  19. package/dist/chunks/{use-visual-utils-BbVM0bck.js → use-visual-utils-BfLXO_vi.js} +34 -34
  20. package/dist/chunks/{use-visual-utils-DHmGIepC.js → use-visual-utils-CzcVz3zB.js} +1 -1
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +5 -5
  25. package/dist/style.css +1 -1
  26. package/dist/surfboard/index.cjs +1 -1
  27. package/dist/surfboard/index.js +2 -2
  28. package/dist/types/dashboard.d.ts +12 -1
  29. package/dist/types/main.d.ts +13 -1
  30. package/dist/types/surfboard.d.ts +12 -1
  31. package/dist/types/types.d.ts +12 -1
  32. package/package.json +1 -1
  33. package/dist/chunks/editor-action-buttons-B0-mScSZ.js +0 -340
  34. package/dist/chunks/editor-action-buttons-CcXUQDy4.js +0 -11
  35. package/dist/chunks/index-plgMsXq1.js +0 -1104
  36. package/dist/chunks/resource-management-panel-D0q51oXw.js +0 -6
  37. package/dist/chunks/resource-management-panel-Z8x52dx2.js +0 -914
@@ -1,20 +1,20 @@
1
- import { jsxs as a, jsx as e, Fragment as O } from "react/jsx-runtime";
2
- import { bI as ee, cU as Xs, u as x, b$ as Oe, c0 as Ie, B as L, c2 as Te, c3 as Y, cV as _e, bs as ns, l as j, m as Ge, cW as Ys, c4 as Re, n as Pe, o as Ue, p as Fe, q as os, L as we, Q as Z, G as Zs, a2 as F, cX as ea, c8 as sa, cY as aa, cZ as Ze, c_ as is, c as de, c$ as ls, bP as ue, d0 as me, I as D, d1 as cs, cF as ta, d2 as ra, H as V, c7 as z, d3 as je, d4 as na, d5 as oa, d6 as xe, d7 as ia, d8 as la, d9 as ds, da as us, db as le, dc as ce, cC as Ce, ce as De, dd as Le, c9 as ms, de as Ee, cG as hs, e as ps, df as ca, ch as fs, ci as gs, cj as vs, ck as ys, cl as bs, cm as Ns, cn as Ss, co as Ae, bZ as da, dg as ua, bu as ma, bA as es, bE as oe, dh as ha, bF as pa, ag as be, di as fa, dj as ga, dk as va, dl as ya, c5 as ba, aO as Na, dm as Sa, dn as wa, dp as xa, dq as Ca, dr as Da, c1 as La, cb as Ea, ds as Aa, ai as ka, am as Ma } from "./index-CqOQuBxB.js";
1
+ import { jsxs as a, jsx as e, Fragment as M } from "react/jsx-runtime";
2
+ import { bP as se, cR as ia, u as x, b_ as _e, b$ as Ge, B as C, c1 as Re, c2 as Z, cS as Pe, bs as ds, l as j, m as Ue, cT as la, c3 as Fe, n as je, o as qe, p as Ve, q as us, L as Ce, Q as ee, G as ca, a2 as F, cU as da, c7 as ua, cV as ma, cW as rs, cX as ms, c as ae, cY as hs, bJ as me, cZ as he, I as L, c_ as ps, cC as ha, c$ as pa, H as V, c6 as z, d0 as ze, d1 as fa, d2 as ga, d3 as Le, d4 as va, d5 as ba, d6 as fs, d7 as gs, d8 as de, d9 as ue, cu as Ee, cd as Ae, da as Me, c8 as vs, db as ke, cD as bs, e as ys, dc as ya, cg as Ns, ch as Ss, ci as ws, cj as xs, ck as Ds, cl as Cs, cm as Ls, cn as Oe, bZ as Na, dd as Sa, bu as wa, bA as ns, bE as le, de as xa, bF as Da, ag as we, df as Ca, dg as La, dh as Ea, di as Aa, dj as Ma, dk as ka, cw as Oa, cx as Ia, cy as Ta, dl as _a, cz as Ga, c4 as Ra, aO as Pa, dm as Ua, dn as Fa, dp as ja, dq as qa, dr as Va, c0 as za, ca as $a, ds as Ha, ai as Ba, am as Ka } from "./index-D0TdW88i.js";
3
3
  import * as _ from "react";
4
- import ws, { useState as S, useMemo as ie, useEffect as Oa } from "react";
4
+ import Es, { useState as S, useMemo as ce, useEffect as Qa } from "react";
5
5
  import "react-dom";
6
- import { b as Ia, u as Ta, c as _a, A as Ga, V as Ra, S as Pa, N as Ua, U as Fa } from "./notification-bell-BI-XywDI.js";
7
- import { u as ja } from "./use-role-aware-display-preferences-C-m9KEuJ.js";
8
- import { d as qa } from "./date-formatter-Y8Za1ib3.js";
9
- import { C as Va, D as za } from "./dashboard-summary-settings-dialog-eQcHYcAI.js";
10
- import { S as ss } from "./editor-action-buttons-B0-mScSZ.js";
6
+ import { b as Wa, u as Ja, c as Xa, A as Ya, V as Za, S as et, N as st, U as at } from "./notification-bell-DFiRaeJQ.js";
7
+ import { u as tt } from "./use-role-aware-display-preferences-DfihB5pN.js";
8
+ import { d as rt } from "./date-formatter-Y8Za1ib3.js";
9
+ import { C as nt, D as ot } from "./dashboard-summary-settings-dialog-CO1SwHHD.js";
10
+ import { S as os } from "./editor-action-buttons-CszdZ4Fw.js";
11
11
  /**
12
12
  * @license lucide-react v0.453.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
16
  */
17
- const $a = ee("Glasses", [
17
+ const it = se("Glasses", [
18
18
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
19
19
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
20
20
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -27,7 +27,7 @@ const $a = ee("Glasses", [
27
27
  * This source code is licensed under the ISC license.
28
28
  * See the LICENSE file in the root directory of this source tree.
29
29
  */
30
- const Ha = ee("Menu", [
30
+ const lt = se("Menu", [
31
31
  ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
32
32
  ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
33
33
  ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
@@ -38,7 +38,7 @@ const Ha = ee("Menu", [
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
40
40
  */
41
- const Ba = ee("Moon", [
41
+ const ct = se("Moon", [
42
42
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
43
43
  ]);
44
44
  /**
@@ -47,7 +47,7 @@ const Ba = ee("Moon", [
47
47
  * This source code is licensed under the ISC license.
48
48
  * See the LICENSE file in the root directory of this source tree.
49
49
  */
50
- const Ka = ee("ShieldX", [
50
+ const dt = se("ShieldX", [
51
51
  [
52
52
  "path",
53
53
  {
@@ -64,7 +64,7 @@ const Ka = ee("ShieldX", [
64
64
  * This source code is licensed under the ISC license.
65
65
  * See the LICENSE file in the root directory of this source tree.
66
66
  */
67
- const Qa = ee("Sun", [
67
+ const ut = se("Sun", [
68
68
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
69
69
  ["path", { d: "M12 2v2", key: "tus03m" }],
70
70
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -75,7 +75,7 @@ const Qa = ee("Sun", [
75
75
  ["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
76
76
  ["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
77
77
  ]);
78
- var ke = { exports: {} }, Ne = {};
78
+ var Ie = { exports: {} }, xe = {};
79
79
  /**
80
80
  * @license React
81
81
  * use-sync-external-store-shim.production.js
@@ -85,48 +85,48 @@ var ke = { exports: {} }, Ne = {};
85
85
  * This source code is licensed under the MIT license found in the
86
86
  * LICENSE file in the root directory of this source tree.
87
87
  */
88
- var as;
89
- function Wa() {
90
- if (as) return Ne;
91
- as = 1;
92
- var s = ws;
93
- function o(c, m) {
94
- return c === m && (c !== 0 || 1 / c === 1 / m) || c !== c && m !== m;
88
+ var is;
89
+ function mt() {
90
+ if (is) return xe;
91
+ is = 1;
92
+ var s = Es;
93
+ function n(d, m) {
94
+ return d === m && (d !== 0 || 1 / d === 1 / m) || d !== d && m !== m;
95
95
  }
96
- var t = typeof Object.is == "function" ? Object.is : o, r = s.useState, l = s.useEffect, i = s.useLayoutEffect, u = s.useDebugValue;
97
- function p(c, m) {
98
- var h = m(), y = r({ inst: { value: h, getSnapshot: m } }), b = y[0].inst, N = y[1];
96
+ var t = typeof Object.is == "function" ? Object.is : n, r = s.useState, l = s.useEffect, i = s.useLayoutEffect, u = s.useDebugValue;
97
+ function p(d, m) {
98
+ var h = m(), b = r({ inst: { value: h, getSnapshot: m } }), y = b[0].inst, N = b[1];
99
99
  return i(
100
100
  function() {
101
- b.value = h, b.getSnapshot = m, g(b) && N({ inst: b });
101
+ y.value = h, y.getSnapshot = m, g(y) && N({ inst: y });
102
102
  },
103
- [c, h, m]
103
+ [d, h, m]
104
104
  ), l(
105
105
  function() {
106
- return g(b) && N({ inst: b }), c(function() {
107
- g(b) && N({ inst: b });
106
+ return g(y) && N({ inst: y }), d(function() {
107
+ g(y) && N({ inst: y });
108
108
  });
109
109
  },
110
- [c]
110
+ [d]
111
111
  ), u(h), h;
112
112
  }
113
- function g(c) {
114
- var m = c.getSnapshot;
115
- c = c.value;
113
+ function g(d) {
114
+ var m = d.getSnapshot;
115
+ d = d.value;
116
116
  try {
117
117
  var h = m();
118
- return !t(c, h);
118
+ return !t(d, h);
119
119
  } catch {
120
120
  return !0;
121
121
  }
122
122
  }
123
- function v(c, m) {
123
+ function v(d, m) {
124
124
  return m();
125
125
  }
126
- var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : p;
127
- return Ne.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : d, Ne;
126
+ var c = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : p;
127
+ return xe.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : c, xe;
128
128
  }
129
- var Se = {};
129
+ var De = {};
130
130
  /**
131
131
  * @license React
132
132
  * use-sync-external-store-shim.development.js
@@ -136,32 +136,32 @@ var Se = {};
136
136
  * This source code is licensed under the MIT license found in the
137
137
  * LICENSE file in the root directory of this source tree.
138
138
  */
139
- var ts;
140
- function Ja() {
141
- return ts || (ts = 1, process.env.NODE_ENV !== "production" && function() {
142
- function s(h, y) {
143
- return h === y && (h !== 0 || 1 / h === 1 / y) || h !== h && y !== y;
139
+ var ls;
140
+ function ht() {
141
+ return ls || (ls = 1, process.env.NODE_ENV !== "production" && function() {
142
+ function s(h, b) {
143
+ return h === b && (h !== 0 || 1 / h === 1 / b) || h !== h && b !== b;
144
144
  }
145
- function o(h, y) {
146
- d || l.startTransition === void 0 || (d = !0, console.error(
145
+ function n(h, b) {
146
+ c || l.startTransition === void 0 || (c = !0, console.error(
147
147
  "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."
148
148
  ));
149
- var b = y();
150
- if (!c) {
151
- var N = y();
152
- i(b, N) || (console.error(
149
+ var y = b();
150
+ if (!d) {
151
+ var N = b();
152
+ i(y, N) || (console.error(
153
153
  "The result of getSnapshot should be cached to avoid an infinite loop"
154
- ), c = !0);
154
+ ), d = !0);
155
155
  }
156
156
  N = u({
157
- inst: { value: b, getSnapshot: y }
157
+ inst: { value: y, getSnapshot: b }
158
158
  });
159
159
  var A = N[0].inst, I = N[1];
160
160
  return g(
161
161
  function() {
162
- A.value = b, A.getSnapshot = y, t(A) && I({ inst: A });
162
+ A.value = y, A.getSnapshot = b, t(A) && I({ inst: A });
163
163
  },
164
- [h, b, y]
164
+ [h, y, b]
165
165
  ), p(
166
166
  function() {
167
167
  return t(A) && I({ inst: A }), h(function() {
@@ -169,43 +169,43 @@ function Ja() {
169
169
  });
170
170
  },
171
171
  [h]
172
- ), v(b), b;
172
+ ), v(y), y;
173
173
  }
174
174
  function t(h) {
175
- var y = h.getSnapshot;
175
+ var b = h.getSnapshot;
176
176
  h = h.value;
177
177
  try {
178
- var b = y();
179
- return !i(h, b);
178
+ var y = b();
179
+ return !i(h, y);
180
180
  } catch {
181
181
  return !0;
182
182
  }
183
183
  }
184
- function r(h, y) {
185
- return y();
184
+ function r(h, b) {
185
+ return b();
186
186
  }
187
187
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
188
- var l = ws, i = typeof Object.is == "function" ? Object.is : s, u = l.useState, p = l.useEffect, g = l.useLayoutEffect, v = l.useDebugValue, d = !1, c = !1, m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : o;
189
- Se.useSyncExternalStore = l.useSyncExternalStore !== void 0 ? l.useSyncExternalStore : m, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
190
- }()), Se;
188
+ var l = Es, i = typeof Object.is == "function" ? Object.is : s, u = l.useState, p = l.useEffect, g = l.useLayoutEffect, v = l.useDebugValue, c = !1, d = !1, m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
189
+ De.useSyncExternalStore = l.useSyncExternalStore !== void 0 ? l.useSyncExternalStore : m, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
190
+ }()), De;
191
191
  }
192
- process.env.NODE_ENV === "production" ? ke.exports = Wa() : ke.exports = Ja();
193
- var Xa = ke.exports;
194
- function Ya() {
195
- const { setTheme: s } = Xs(), o = x(
192
+ process.env.NODE_ENV === "production" ? Ie.exports = mt() : Ie.exports = ht();
193
+ var pt = Ie.exports;
194
+ function ft() {
195
+ const { setTheme: s } = ia(), n = x(
196
196
  (t) => t.actions.setDashboardTheme
197
197
  );
198
- return /* @__PURE__ */ a(Oe, { children: [
199
- /* @__PURE__ */ e(Ie, { asChild: !0, children: /* @__PURE__ */ a(L, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
198
+ return /* @__PURE__ */ a(_e, { children: [
199
+ /* @__PURE__ */ e(Ge, { asChild: !0, children: /* @__PURE__ */ a(C, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
200
200
  /* @__PURE__ */ e(
201
- Qa,
201
+ ut,
202
202
  {
203
203
  strokeWidth: 1.5,
204
204
  className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
205
205
  }
206
206
  ),
207
207
  /* @__PURE__ */ e(
208
- Ba,
208
+ ct,
209
209
  {
210
210
  strokeWidth: 1.5,
211
211
  className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
@@ -213,30 +213,30 @@ function Ya() {
213
213
  ),
214
214
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
215
215
  ] }) }),
216
- /* @__PURE__ */ a(Te, { align: "end", children: [
216
+ /* @__PURE__ */ a(Re, { align: "end", children: [
217
217
  /* @__PURE__ */ e(
218
- Y,
218
+ Z,
219
219
  {
220
220
  onClick: () => {
221
- s("light"), o("light");
221
+ s("light"), n("light");
222
222
  },
223
223
  children: "Light"
224
224
  }
225
225
  ),
226
226
  /* @__PURE__ */ e(
227
- Y,
227
+ Z,
228
228
  {
229
229
  onClick: () => {
230
- s("dark"), o("dark");
230
+ s("dark"), n("dark");
231
231
  },
232
232
  children: "Dark"
233
233
  }
234
234
  ),
235
235
  /* @__PURE__ */ e(
236
- Y,
236
+ Z,
237
237
  {
238
238
  onClick: () => {
239
- s("system"), o("system");
239
+ s("system"), n("system");
240
240
  },
241
241
  children: "System"
242
242
  }
@@ -244,22 +244,22 @@ function Ya() {
244
244
  ] })
245
245
  ] });
246
246
  }
247
- async function Za(s, o, t, r, l) {
247
+ async function gt(s, n, t, r, l) {
248
248
  if (!l)
249
249
  return null;
250
250
  const i = JSON.stringify(t), u = `${s}/v1/lens`;
251
- return await _e(u, l, {
252
- name: o,
251
+ return await Pe(u, l, {
252
+ name: n,
253
253
  template: i,
254
254
  filterValues: r,
255
255
  operation: "create"
256
256
  });
257
257
  }
258
- async function Me(s, o, t) {
258
+ async function Te(s, n, t) {
259
259
  if (!t)
260
260
  return null;
261
- const { id: r, template: l, filterValues: i, isDefault: u, shared: p } = o, g = `${s}/v1/lens`;
262
- return await _e(g, t, {
261
+ const { id: r, template: l, filterValues: i, isDefault: u, shared: p } = n, g = `${s}/v1/lens`;
262
+ return await Pe(g, t, {
263
263
  lensId: r,
264
264
  template: l,
265
265
  filterValues: i,
@@ -268,54 +268,54 @@ async function Me(s, o, t) {
268
268
  operation: "update"
269
269
  });
270
270
  }
271
- async function et(s, o, t) {
271
+ async function vt(s, n, t) {
272
272
  if (!t)
273
273
  return null;
274
274
  const r = `${s}/v1/lens`;
275
- return await _e(r, t, {
275
+ return await Pe(r, t, {
276
276
  operation: "delete",
277
- lensId: o
277
+ lensId: n
278
278
  });
279
279
  }
280
- function st() {
281
- const [s, o] = S(""), [t, r] = S(!1), l = x((N) => N.lenses), { setLenses: i, setSelectedLensId: u } = ns(), [p, g] = S(!1), [v, d] = S(!1), c = x((N) => N.dashboard), m = x((N) => N.filterValues), { authToken: h, tokenProps: y } = j();
282
- async function b() {
280
+ function bt() {
281
+ const [s, n] = S(""), [t, r] = S(!1), l = x((N) => N.lenses), { setLenses: i, setSelectedLensId: u } = ds(), [p, g] = S(!1), [v, c] = S(!1), d = x((N) => N.dashboard), m = x((N) => N.filterValues), { authToken: h, tokenProps: b } = j();
282
+ async function y() {
283
283
  g(!0);
284
- const N = await Za(
285
- y.apiServiceUrl,
284
+ const N = await gt(
285
+ b.apiServiceUrl,
286
286
  s,
287
- c,
287
+ d,
288
288
  m,
289
289
  h == null ? void 0 : h.accessToken
290
290
  );
291
- N && (i([...l || [], N]), u(N.id), d(!1)), g(!1);
291
+ N && (i([...l || [], N]), u(N.id), c(!1)), g(!1);
292
292
  }
293
- return /* @__PURE__ */ a(Ge, { open: v, onOpenChange: d, children: [
294
- /* @__PURE__ */ e(Ys, { asChild: !0, children: /* @__PURE__ */ a(
295
- L,
293
+ return /* @__PURE__ */ a(Ue, { open: v, onOpenChange: c, children: [
294
+ /* @__PURE__ */ e(la, { asChild: !0, children: /* @__PURE__ */ a(
295
+ C,
296
296
  {
297
297
  variant: "secondary",
298
298
  className: "h-7 p-2",
299
299
  size: "sm",
300
300
  children: [
301
- /* @__PURE__ */ e(Re, { className: "mr-2 h-4 w-4" }),
301
+ /* @__PURE__ */ e(Fe, { className: "mr-2 h-4 w-4" }),
302
302
  "Lens"
303
303
  ]
304
304
  }
305
305
  ) }),
306
- /* @__PURE__ */ a(Pe, { className: "sm:max-w-[425px]", children: [
307
- /* @__PURE__ */ a(Ue, { children: [
308
- /* @__PURE__ */ e(Fe, { children: "Create Lens" }),
309
- /* @__PURE__ */ e(os, { children: "Lenses are private by default and are only visible to you." })
306
+ /* @__PURE__ */ a(je, { className: "sm:max-w-[425px]", children: [
307
+ /* @__PURE__ */ a(qe, { children: [
308
+ /* @__PURE__ */ e(Ve, { children: "Create Lens" }),
309
+ /* @__PURE__ */ e(us, { children: "Lenses are private by default and are only visible to you." })
310
310
  ] }),
311
311
  /* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ a("div", { className: "grid grid-cols-8 items-center gap-4", children: [
312
- /* @__PURE__ */ e(we, { className: "text-right", children: "Name" }),
312
+ /* @__PURE__ */ e(Ce, { className: "text-right", children: "Name" }),
313
313
  /* @__PURE__ */ e(
314
- Z,
314
+ ee,
315
315
  {
316
316
  value: s,
317
317
  onChange: (N) => {
318
- o(N.target.value);
318
+ n(N.target.value);
319
319
  },
320
320
  id: "name",
321
321
  className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
@@ -323,13 +323,13 @@ function st() {
323
323
  )
324
324
  ] }) }),
325
325
  t && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
326
- /* @__PURE__ */ e(Zs, { children: /* @__PURE__ */ e(
327
- L,
326
+ /* @__PURE__ */ e(ca, { children: /* @__PURE__ */ e(
327
+ C,
328
328
  {
329
329
  size: "sm",
330
330
  variant: "outline",
331
331
  type: "submit",
332
- onClick: b,
332
+ onClick: y,
333
333
  disabled: p,
334
334
  children: p ? "Creating..." : "Add"
335
335
  }
@@ -337,81 +337,81 @@ function st() {
337
337
  ] })
338
338
  ] });
339
339
  }
340
- function at() {
341
- const [s, o] = S(!1), t = x((c) => c.lenses), r = x((c) => c.selectedLensId), { setLenses: l, setSelectedLensId: i } = ns(), { authToken: u, tokenProps: p } = j();
342
- async function g(c) {
343
- i(c);
340
+ function yt() {
341
+ const [s, n] = S(!1), t = x((d) => d.lenses), r = x((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: i } = ds(), { authToken: u, tokenProps: p } = j();
342
+ async function g(d) {
343
+ i(d);
344
344
  }
345
- async function v(c) {
346
- if (await et(p.apiServiceUrl, c, u == null ? void 0 : u.accessToken)) {
347
- const h = t == null ? void 0 : t.filter((y) => y.id !== c);
345
+ async function v(d) {
346
+ if (await vt(p.apiServiceUrl, d, u == null ? void 0 : u.accessToken)) {
347
+ const h = t == null ? void 0 : t.filter((b) => b.id !== d);
348
348
  l(h || []), i("original");
349
349
  }
350
350
  }
351
- async function d(c) {
352
- const m = t == null ? void 0 : t.map((b) => b.id === c.id ? {
353
- ...b,
354
- isDefault: !c.isDefault
351
+ async function c(d) {
352
+ const m = t == null ? void 0 : t.map((y) => y.id === d.id ? {
353
+ ...y,
354
+ isDefault: !d.isDefault
355
355
  } : {
356
- ...b,
356
+ ...y,
357
357
  isDefault: !1
358
358
  });
359
359
  l(m || []);
360
360
  const h = {
361
- ...c,
362
- isDefault: !c.isDefault
361
+ ...d,
362
+ isDefault: !d.isDefault
363
363
  };
364
- await Me(p.apiServiceUrl, h, u == null ? void 0 : u.accessToken);
365
- const y = t == null ? void 0 : t.find((b) => b.isDefault);
366
- if (y && y.id !== c.id) {
367
- const b = {
368
- ...y,
364
+ await Te(p.apiServiceUrl, h, u == null ? void 0 : u.accessToken);
365
+ const b = t == null ? void 0 : t.find((y) => y.isDefault);
366
+ if (b && b.id !== d.id) {
367
+ const y = {
368
+ ...b,
369
369
  isDefault: !1
370
370
  };
371
- await Me(p.apiServiceUrl, b, u == null ? void 0 : u.accessToken);
371
+ await Te(p.apiServiceUrl, y, u == null ? void 0 : u.accessToken);
372
372
  }
373
373
  }
374
- return /* @__PURE__ */ a(Oe, { open: s, onOpenChange: o, children: [
375
- /* @__PURE__ */ e(Ie, { asChild: !0, children: /* @__PURE__ */ e(F, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e($a, { className: "h-4 w-4" }) }) }),
376
- /* @__PURE__ */ a(Te, { align: "end", className: "w-60", children: [
377
- /* @__PURE__ */ e(ea, { className: "px-3", children: "Lenses" }),
378
- /* @__PURE__ */ e(sa, {}),
374
+ return /* @__PURE__ */ a(_e, { open: s, onOpenChange: n, children: [
375
+ /* @__PURE__ */ e(Ge, { asChild: !0, children: /* @__PURE__ */ e(F, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(it, { className: "h-4 w-4" }) }) }),
376
+ /* @__PURE__ */ a(Re, { align: "end", className: "w-60", children: [
377
+ /* @__PURE__ */ e(da, { className: "px-3", children: "Lenses" }),
378
+ /* @__PURE__ */ e(ua, {}),
379
379
  /* @__PURE__ */ a(
380
- aa,
380
+ ma,
381
381
  {
382
382
  value: r,
383
383
  onValueChange: g,
384
384
  children: [
385
- /* @__PURE__ */ e(Ze, { value: "original", children: "Original" }),
386
- t == null ? void 0 : t.map((c) => /* @__PURE__ */ a(
387
- Ze,
385
+ /* @__PURE__ */ e(rs, { value: "original", children: "Original" }),
386
+ t == null ? void 0 : t.map((d) => /* @__PURE__ */ a(
387
+ rs,
388
388
  {
389
389
  className: "group flex justify-between gap-2",
390
- value: c.id,
390
+ value: d.id,
391
391
  children: [
392
- /* @__PURE__ */ e("p", { children: c.name }),
392
+ /* @__PURE__ */ e("p", { children: d.name }),
393
393
  /* @__PURE__ */ a("span", { className: "flex items-center gap-3", children: [
394
394
  /* @__PURE__ */ e(
395
- is,
395
+ ms,
396
396
  {
397
397
  onClick: (m) => {
398
- m.preventDefault(), d(c);
398
+ m.preventDefault(), c(d);
399
399
  },
400
- className: de(
400
+ className: ae(
401
401
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
402
402
  {
403
- invisible: !c.isDefault,
404
- "text-green-500": c.isDefault
403
+ invisible: !d.isDefault,
404
+ "text-green-500": d.isDefault
405
405
  }
406
406
  ),
407
407
  strokeWidth: 1.5
408
408
  }
409
409
  ),
410
410
  /* @__PURE__ */ e(
411
- ls,
411
+ hs,
412
412
  {
413
413
  onClick: (m) => {
414
- m.preventDefault(), v(c.id);
414
+ m.preventDefault(), v(d.id);
415
415
  },
416
416
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
417
417
  strokeWidth: 1.5
@@ -420,7 +420,7 @@ function at() {
420
420
  ] })
421
421
  ]
422
422
  },
423
- c.id
423
+ d.id
424
424
  ))
425
425
  ]
426
426
  }
@@ -428,29 +428,29 @@ function at() {
428
428
  ] })
429
429
  ] });
430
430
  }
431
- const tt = async (s, o, t) => {
431
+ const Nt = async (s, n, t) => {
432
432
  const r = `${s}/management/v1/groups`;
433
- return await cs(r, o, t);
434
- }, rt = async (s, o, t) => {
433
+ return await ps(r, n, t);
434
+ }, St = async (s, n, t) => {
435
435
  const r = `${s}/management/v1/groups/${t}`, l = await fetch(r, {
436
436
  method: "DELETE",
437
437
  headers: {
438
- Authorization: `Bearer ${o}`
438
+ Authorization: `Bearer ${n}`
439
439
  }
440
440
  });
441
441
  if (!l.ok) {
442
442
  const i = await l.text();
443
443
  throw new Error(i || "Failed to delete group");
444
444
  }
445
- }, nt = async (s, o, t, r) => {
445
+ }, wt = async (s, n, t, r) => {
446
446
  const l = `${s}/management/v1/groups/${t}/members`;
447
- return await cs(l, o, r);
448
- }, ot = async (s, o, t, r) => {
447
+ return await ps(l, n, r);
448
+ }, xt = async (s, n, t, r) => {
449
449
  const l = `${s}/management/v1/groups/${t}/members`, i = await fetch(l, {
450
450
  method: "DELETE",
451
451
  headers: {
452
452
  "Content-Type": "application/json",
453
- Authorization: `Bearer ${o}`
453
+ Authorization: `Bearer ${n}`
454
454
  },
455
455
  body: JSON.stringify(r)
456
456
  });
@@ -459,103 +459,103 @@ const tt = async (s, o, t) => {
459
459
  throw new Error(u || "Failed to remove group members");
460
460
  }
461
461
  };
462
- function it() {
463
- const { authToken: s, tokenProps: o } = j(), t = ue();
464
- return me({
465
- mutationFn: (r) => tt(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r),
462
+ function Dt() {
463
+ const { authToken: s, tokenProps: n } = j(), t = me();
464
+ return he({
465
+ mutationFn: (r) => Nt(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r),
466
466
  onSuccess: () => {
467
- t.invalidateQueries({ queryKey: ["groups"] }), D.success("Group created successfully");
467
+ t.invalidateQueries({ queryKey: ["groups"] }), L.success("Group created successfully");
468
468
  },
469
469
  onError: (r) => {
470
- console.error("Failed to create group:", r), D.error("Failed to create group", {
470
+ console.error("Failed to create group:", r), L.error("Failed to create group", {
471
471
  description: r.message
472
472
  });
473
473
  }
474
474
  });
475
475
  }
476
- function lt() {
477
- const { authToken: s, tokenProps: o } = j(), t = ue();
478
- return me({
479
- mutationFn: (r) => rt(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r),
476
+ function Ct() {
477
+ const { authToken: s, tokenProps: n } = j(), t = me();
478
+ return he({
479
+ mutationFn: (r) => St(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r),
480
480
  onSuccess: (r, l) => {
481
- t.invalidateQueries({ queryKey: ["groups"] }), t.removeQueries({ queryKey: ["group", l] }), D.success("Group deleted successfully");
481
+ t.invalidateQueries({ queryKey: ["groups"] }), t.removeQueries({ queryKey: ["group", l] }), L.success("Group deleted successfully");
482
482
  },
483
483
  onError: (r) => {
484
- console.error("Failed to delete group:", r), D.error("Failed to delete group", {
484
+ console.error("Failed to delete group:", r), L.error("Failed to delete group", {
485
485
  description: r.message
486
486
  });
487
487
  }
488
488
  });
489
489
  }
490
- function ct() {
491
- const { authToken: s, tokenProps: o } = j(), t = ue();
492
- return me({
490
+ function Lt() {
491
+ const { authToken: s, tokenProps: n } = j(), t = me();
492
+ return he({
493
493
  mutationFn: ({
494
494
  groupId: r,
495
495
  data: l
496
- }) => nt(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r, l),
496
+ }) => wt(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r, l),
497
497
  onSuccess: (r, l) => {
498
498
  t.invalidateQueries({ queryKey: ["group", l.groupId] }), t.invalidateQueries({
499
499
  queryKey: ["group-members", l.groupId]
500
- }), t.invalidateQueries({ queryKey: ["groups"] }), D.success("Members added successfully");
500
+ }), t.invalidateQueries({ queryKey: ["groups"] }), L.success("Members added successfully");
501
501
  },
502
502
  onError: (r) => {
503
- console.error("Failed to add group members:", r), D.error("Failed to add members", {
503
+ console.error("Failed to add group members:", r), L.error("Failed to add members", {
504
504
  description: r.message
505
505
  });
506
506
  }
507
507
  });
508
508
  }
509
- function dt() {
510
- const { authToken: s, tokenProps: o } = j(), t = ue();
511
- return me({
509
+ function Et() {
510
+ const { authToken: s, tokenProps: n } = j(), t = me();
511
+ return he({
512
512
  mutationFn: ({
513
513
  groupId: r,
514
514
  data: l
515
- }) => ot(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r, l),
515
+ }) => xt(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r, l),
516
516
  onSuccess: (r, l) => {
517
517
  t.invalidateQueries({ queryKey: ["group", l.groupId] }), t.invalidateQueries({
518
518
  queryKey: ["group-members", l.groupId]
519
- }), t.invalidateQueries({ queryKey: ["groups"] }), D.success("Members removed successfully");
519
+ }), t.invalidateQueries({ queryKey: ["groups"] }), L.success("Members removed successfully");
520
520
  },
521
521
  onError: (r) => {
522
- console.error("Failed to remove group members:", r), D.error("Failed to remove members", {
522
+ console.error("Failed to remove group members:", r), L.error("Failed to remove members", {
523
523
  description: r.message
524
524
  });
525
525
  }
526
526
  });
527
527
  }
528
- function ut({
528
+ function At({
529
529
  onSuccess: s,
530
- tenantId: o,
530
+ tenantId: n,
531
531
  isTenantUser: t
532
532
  }) {
533
- const [r, l] = S(""), [i, u] = S(""), [p, g] = S({}), v = it(), d = () => {
533
+ const [r, l] = S(""), [i, u] = S(""), [p, g] = S({}), v = Dt(), c = () => {
534
534
  const m = {};
535
535
  return r.trim() ? r.length < 3 ? m.name = "Group name must be at least 3 characters" : r.length > 50 && (m.name = "Group name must be less than 50 characters") : m.name = "Group name is required", i && i.length > 200 && (m.description = "Description must be less than 200 characters"), g(m), Object.keys(m).length === 0;
536
536
  };
537
537
  return /* @__PURE__ */ a("form", { onSubmit: async (m) => {
538
- if (m.preventDefault(), !d()) return;
538
+ if (m.preventDefault(), !c()) return;
539
539
  const h = {
540
540
  name: r.trim(),
541
541
  description: i.trim() || void 0,
542
542
  type: t ? "TENANT_GROUP" : "ORG_GROUP",
543
- ...t && o ? { tenantId: o } : {}
543
+ ...t && n ? { tenantId: n } : {}
544
544
  };
545
545
  try {
546
546
  await v.mutateAsync(h), l(""), u(""), g({}), s();
547
- } catch (y) {
548
- console.error("Failed to create group:", y);
547
+ } catch (b) {
548
+ console.error("Failed to create group:", b);
549
549
  }
550
550
  }, className: "space-y-6", children: [
551
551
  /* @__PURE__ */ a("div", { className: "space-y-4", children: [
552
552
  /* @__PURE__ */ a("div", { className: "space-y-2", children: [
553
- /* @__PURE__ */ a(we, { htmlFor: "group-name", children: [
553
+ /* @__PURE__ */ a(Ce, { htmlFor: "group-name", children: [
554
554
  "Group Name ",
555
555
  /* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
556
556
  ] }),
557
557
  /* @__PURE__ */ e(
558
- Z,
558
+ ee,
559
559
  {
560
560
  id: "group-name",
561
561
  placeholder: "e.g., Marketing Team, Engineering Squad",
@@ -570,12 +570,12 @@ function ut({
570
570
  p.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: p.name })
571
571
  ] }),
572
572
  /* @__PURE__ */ a("div", { className: "space-y-2", children: [
573
- /* @__PURE__ */ a(we, { htmlFor: "group-description", children: [
573
+ /* @__PURE__ */ a(Ce, { htmlFor: "group-description", children: [
574
574
  "Description",
575
575
  /* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
576
576
  ] }),
577
577
  /* @__PURE__ */ e(
578
- ta,
578
+ ha,
579
579
  {
580
580
  id: "group-description",
581
581
  placeholder: "Describe the purpose of this group...",
@@ -595,13 +595,13 @@ function ut({
595
595
  ] })
596
596
  ] }),
597
597
  /* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ a("div", { className: "flex gap-3", children: [
598
- /* @__PURE__ */ e(ra, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
598
+ /* @__PURE__ */ e(pa, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
599
599
  /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground", children: "This group will be accessible to users in your workspace. You can add members after creating the group." })
600
600
  ] }) })
601
601
  ] }),
602
602
  /* @__PURE__ */ a("div", { className: "flex justify-end gap-3", children: [
603
603
  /* @__PURE__ */ e(
604
- L,
604
+ C,
605
605
  {
606
606
  type: "button",
607
607
  variant: "outline",
@@ -613,14 +613,14 @@ function ut({
613
613
  }
614
614
  ),
615
615
  /* @__PURE__ */ e(
616
- L,
616
+ C,
617
617
  {
618
618
  type: "submit",
619
619
  disabled: v.isPending || !r.trim(),
620
- children: v.isPending ? /* @__PURE__ */ a(O, { children: [
620
+ children: v.isPending ? /* @__PURE__ */ a(M, { children: [
621
621
  /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
622
622
  "Creating..."
623
- ] }) : /* @__PURE__ */ a(O, { children: [
623
+ ] }) : /* @__PURE__ */ a(M, { children: [
624
624
  /* @__PURE__ */ e(z, { className: "mr-2 h-4 w-4" }),
625
625
  "Create Group"
626
626
  ] })
@@ -629,122 +629,122 @@ function ut({
629
629
  ] })
630
630
  ] });
631
631
  }
632
- function mt() {
633
- return Xa.useSyncExternalStore(
634
- ht,
632
+ function Mt() {
633
+ return pt.useSyncExternalStore(
634
+ kt,
635
635
  () => !0,
636
636
  () => !1
637
637
  );
638
638
  }
639
- function ht() {
639
+ function kt() {
640
640
  return () => {
641
641
  };
642
642
  }
643
- var qe = "Avatar", [pt] = na(qe), [ft, xs] = pt(qe), Cs = _.forwardRef(
644
- (s, o) => {
643
+ var $e = "Avatar", [Ot] = fa($e), [It, As] = Ot($e), Ms = _.forwardRef(
644
+ (s, n) => {
645
645
  const { __scopeAvatar: t, ...r } = s, [l, i] = _.useState("idle");
646
646
  return /* @__PURE__ */ e(
647
- ft,
647
+ It,
648
648
  {
649
649
  scope: t,
650
650
  imageLoadingStatus: l,
651
651
  onImageLoadingStatusChange: i,
652
- children: /* @__PURE__ */ e(je.span, { ...r, ref: o })
652
+ children: /* @__PURE__ */ e(ze.span, { ...r, ref: n })
653
653
  }
654
654
  );
655
655
  }
656
656
  );
657
- Cs.displayName = qe;
658
- var Ds = "AvatarImage", Ls = _.forwardRef(
659
- (s, o) => {
657
+ Ms.displayName = $e;
658
+ var ks = "AvatarImage", Os = _.forwardRef(
659
+ (s, n) => {
660
660
  const { __scopeAvatar: t, src: r, onLoadingStatusChange: l = () => {
661
- }, ...i } = s, u = xs(Ds, t), p = gt(r, i), g = oa((v) => {
661
+ }, ...i } = s, u = As(ks, t), p = Tt(r, i), g = ga((v) => {
662
662
  l(v), u.onImageLoadingStatusChange(v);
663
663
  });
664
- return xe(() => {
664
+ return Le(() => {
665
665
  p !== "idle" && g(p);
666
- }, [p, g]), p === "loaded" ? /* @__PURE__ */ e(je.img, { ...i, ref: o, src: r }) : null;
666
+ }, [p, g]), p === "loaded" ? /* @__PURE__ */ e(ze.img, { ...i, ref: n, src: r }) : null;
667
667
  }
668
668
  );
669
- Ls.displayName = Ds;
670
- var Es = "AvatarFallback", As = _.forwardRef(
671
- (s, o) => {
672
- const { __scopeAvatar: t, delayMs: r, ...l } = s, i = xs(Es, t), [u, p] = _.useState(r === void 0);
669
+ Os.displayName = ks;
670
+ var Is = "AvatarFallback", Ts = _.forwardRef(
671
+ (s, n) => {
672
+ const { __scopeAvatar: t, delayMs: r, ...l } = s, i = As(Is, t), [u, p] = _.useState(r === void 0);
673
673
  return _.useEffect(() => {
674
674
  if (r !== void 0) {
675
675
  const g = window.setTimeout(() => p(!0), r);
676
676
  return () => window.clearTimeout(g);
677
677
  }
678
- }, [r]), u && i.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(je.span, { ...l, ref: o }) : null;
678
+ }, [r]), u && i.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(ze.span, { ...l, ref: n }) : null;
679
679
  }
680
680
  );
681
- As.displayName = Es;
682
- function rs(s, o) {
683
- return s ? o ? (s.src !== o && (s.src = o), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
681
+ Ts.displayName = Is;
682
+ function cs(s, n) {
683
+ return s ? n ? (s.src !== n && (s.src = n), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
684
684
  }
685
- function gt(s, { referrerPolicy: o, crossOrigin: t }) {
686
- const r = mt(), l = _.useRef(null), i = r ? (l.current || (l.current = new window.Image()), l.current) : null, [u, p] = _.useState(
687
- () => rs(i, s)
685
+ function Tt(s, { referrerPolicy: n, crossOrigin: t }) {
686
+ const r = Mt(), l = _.useRef(null), i = r ? (l.current || (l.current = new window.Image()), l.current) : null, [u, p] = _.useState(
687
+ () => cs(i, s)
688
688
  );
689
- return xe(() => {
690
- p(rs(i, s));
691
- }, [i, s]), xe(() => {
692
- const g = (c) => () => {
693
- p(c);
689
+ return Le(() => {
690
+ p(cs(i, s));
691
+ }, [i, s]), Le(() => {
692
+ const g = (d) => () => {
693
+ p(d);
694
694
  };
695
695
  if (!i) return;
696
- const v = g("loaded"), d = g("error");
697
- return i.addEventListener("load", v), i.addEventListener("error", d), o && (i.referrerPolicy = o), typeof t == "string" && (i.crossOrigin = t), () => {
698
- i.removeEventListener("load", v), i.removeEventListener("error", d);
696
+ const v = g("loaded"), c = g("error");
697
+ return i.addEventListener("load", v), i.addEventListener("error", c), n && (i.referrerPolicy = n), typeof t == "string" && (i.crossOrigin = t), () => {
698
+ i.removeEventListener("load", v), i.removeEventListener("error", c);
699
699
  };
700
- }, [i, t, o]), u;
700
+ }, [i, t, n]), u;
701
701
  }
702
- var ks = Cs, Ms = Ls, Os = As;
703
- const Ve = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
704
- ks,
702
+ var _s = Ms, Gs = Os, Rs = Ts;
703
+ const He = _.forwardRef(({ className: s, ...n }, t) => /* @__PURE__ */ e(
704
+ _s,
705
705
  {
706
706
  ref: t,
707
- className: de(
707
+ className: ae(
708
708
  "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
709
709
  s
710
710
  ),
711
- ...o
711
+ ...n
712
712
  }
713
713
  ));
714
- Ve.displayName = ks.displayName;
715
- const vt = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
716
- Ms,
714
+ He.displayName = _s.displayName;
715
+ const _t = _.forwardRef(({ className: s, ...n }, t) => /* @__PURE__ */ e(
716
+ Gs,
717
717
  {
718
718
  ref: t,
719
- className: de("aspect-square h-full w-full", s),
720
- ...o
719
+ className: ae("aspect-square h-full w-full", s),
720
+ ...n
721
721
  }
722
722
  ));
723
- vt.displayName = Ms.displayName;
724
- const ze = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
725
- Os,
723
+ _t.displayName = Gs.displayName;
724
+ const Be = _.forwardRef(({ className: s, ...n }, t) => /* @__PURE__ */ e(
725
+ Rs,
726
726
  {
727
727
  ref: t,
728
- className: de(
728
+ className: ae(
729
729
  "flex h-full w-full items-center justify-center rounded-full bg-muted",
730
730
  s
731
731
  ),
732
- ...o
732
+ ...n
733
733
  }
734
734
  ));
735
- ze.displayName = Os.displayName;
736
- function yt({
735
+ Be.displayName = Rs.displayName;
736
+ function Gt({
737
737
  open: s,
738
- onOpenChange: o,
738
+ onOpenChange: n,
739
739
  group: t,
740
740
  onUpdate: r
741
741
  }) {
742
- const [l, i] = S("members"), [u, p] = S(""), [g, v] = S([]), [d, c] = S([]), { data: m, isLoading: h, refetch: y } = ia(t.id), b = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: N, isLoading: A } = la({
743
- type: b,
742
+ const [l, i] = S("members"), [u, p] = S(""), [g, v] = S([]), [c, d] = S([]), { data: m, isLoading: h, refetch: b } = va(t.id), y = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: N, isLoading: A } = ba({
743
+ type: y,
744
744
  tenantId: t.tenantId || void 0,
745
745
  active: !0,
746
746
  limit: 100
747
- }), I = ct(), G = dt(), k = (m == null ? void 0 : m.members) || [], $ = ie(() => new Set(k.map((f) => f.userId)), [k]), P = ie(() => N.filter((f) => !$.has(f.id)), [N, $]), H = ie(() => {
747
+ }), I = Lt(), G = Et(), k = (m == null ? void 0 : m.members) || [], $ = ce(() => new Set(k.map((f) => f.userId)), [k]), P = ce(() => N.filter((f) => !$.has(f.id)), [N, $]), H = ce(() => {
748
748
  if (!u) return P;
749
749
  const f = u.toLowerCase();
750
750
  return P.filter(
@@ -753,7 +753,7 @@ function yt({
753
753
  return ((T = E.name) == null ? void 0 : T.toLowerCase().includes(f)) || ((w = E.email) == null ? void 0 : w.toLowerCase().includes(f));
754
754
  }
755
755
  );
756
- }, [P, u]), C = ie(() => {
756
+ }, [P, u]), D = ce(() => {
757
757
  if (!u) return k;
758
758
  const f = u.toLowerCase();
759
759
  return k.filter(
@@ -769,36 +769,36 @@ function yt({
769
769
  groupId: t.id,
770
770
  data: {
771
771
  userIds: g,
772
- userType: b === "tenant" ? "tenant" : "org"
772
+ userType: y === "tenant" ? "tenant" : "org"
773
773
  }
774
- }), v([]), i("members"), y(), r == null || r();
774
+ }), v([]), i("members"), b(), r == null || r();
775
775
  } catch (f) {
776
776
  console.error("Failed to add members:", f);
777
777
  }
778
778
  }, B = async () => {
779
- if (d.length !== 0)
779
+ if (c.length !== 0)
780
780
  try {
781
781
  await G.mutateAsync({
782
782
  groupId: t.id,
783
783
  data: {
784
- userIds: d
784
+ userIds: c
785
785
  }
786
- }), c([]), y(), r == null || r();
786
+ }), d([]), b(), r == null || r();
787
787
  } catch (f) {
788
788
  console.error("Failed to remove members:", f);
789
789
  }
790
- }, he = (f) => {
790
+ }, pe = (f) => {
791
791
  v(
792
792
  (E) => E.includes(f) ? E.filter((T) => T !== f) : [...E, f]
793
793
  );
794
794
  }, K = (f) => {
795
- c(
795
+ d(
796
796
  (E) => E.includes(f) ? E.filter((T) => T !== f) : [...E, f]
797
797
  );
798
798
  };
799
- return /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(Ge, { open: s, onOpenChange: o, children: /* @__PURE__ */ a(Pe, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
800
- /* @__PURE__ */ a(Ue, { children: [
801
- /* @__PURE__ */ e(Fe, { children: t.name }),
799
+ return /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(Ue, { open: s, onOpenChange: n, children: /* @__PURE__ */ a(je, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
800
+ /* @__PURE__ */ a(qe, { children: [
801
+ /* @__PURE__ */ e(Ve, { children: t.name }),
802
802
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ a("p", { className: "text-sm text-muted-foreground", children: [
803
803
  k.length,
804
804
  " ",
@@ -810,18 +810,18 @@ function yt({
810
810
  " group"
811
811
  ] })
812
812
  ] }),
813
- /* @__PURE__ */ a(ds, { value: l, onValueChange: (f) => {
814
- i(f), p(""), c([]);
813
+ /* @__PURE__ */ a(fs, { value: l, onValueChange: (f) => {
814
+ i(f), p(""), d([]);
815
815
  }, className: "mt-4", children: [
816
- /* @__PURE__ */ a(us, { className: "grid w-full grid-cols-2", children: [
817
- /* @__PURE__ */ e(le, { value: "members", children: "Current Members" }),
818
- /* @__PURE__ */ e(le, { value: "add", children: "Add Members" })
816
+ /* @__PURE__ */ a(gs, { className: "grid w-full grid-cols-2", children: [
817
+ /* @__PURE__ */ e(de, { value: "members", children: "Current Members" }),
818
+ /* @__PURE__ */ e(de, { value: "add", children: "Add Members" })
819
819
  ] }),
820
- /* @__PURE__ */ a(ce, { value: "members", className: "mt-4 space-y-4", children: [
820
+ /* @__PURE__ */ a(ue, { value: "members", className: "mt-4 space-y-4", children: [
821
821
  /* @__PURE__ */ a("div", { className: "relative", children: [
822
- /* @__PURE__ */ e(Ce, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
822
+ /* @__PURE__ */ e(Ee, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
823
823
  /* @__PURE__ */ e(
824
- Z,
824
+ ee,
825
825
  {
826
826
  placeholder: "Search members...",
827
827
  value: u,
@@ -830,49 +830,49 @@ function yt({
830
830
  }
831
831
  )
832
832
  ] }),
833
- /* @__PURE__ */ e(De, { className: d.length > 0 ? "h-[300px]" : "h-[350px]", children: h ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(Le, { className: "h-16 w-full" }, f)) }) : C.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
833
+ /* @__PURE__ */ e(Ae, { className: c.length > 0 ? "h-[300px]" : "h-[350px]", children: h ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(Me, { className: "h-16 w-full" }, f)) }) : D.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
834
834
  /* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
835
835
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: u ? "No members found" : "No members yet" }),
836
836
  /* @__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' })
837
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: C.map((f) => /* @__PURE__ */ e(
838
- bt,
837
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: D.map((f) => /* @__PURE__ */ e(
838
+ Rt,
839
839
  {
840
840
  member: f,
841
- selected: d.includes(f.userId),
841
+ selected: c.includes(f.userId),
842
842
  onToggle: () => K(f.userId)
843
843
  },
844
844
  f.id
845
845
  )) }) }),
846
- d.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between pt-4 border-t", children: [
846
+ c.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between pt-4 border-t", children: [
847
847
  /* @__PURE__ */ a("span", { className: "text-sm text-muted-foreground", children: [
848
- d.length,
848
+ c.length,
849
849
  " member",
850
- d.length !== 1 ? "s" : "",
850
+ c.length !== 1 ? "s" : "",
851
851
  " selected"
852
852
  ] }),
853
853
  /* @__PURE__ */ e(
854
- L,
854
+ C,
855
855
  {
856
856
  variant: "destructive",
857
857
  size: "sm",
858
858
  onClick: B,
859
859
  disabled: G.isPending,
860
- children: G.isPending ? /* @__PURE__ */ a(O, { children: [
860
+ children: G.isPending ? /* @__PURE__ */ a(M, { children: [
861
861
  /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
862
862
  "Removing..."
863
- ] }) : /* @__PURE__ */ a(O, { children: [
864
- /* @__PURE__ */ e(ms, { className: "mr-2 h-4 w-4" }),
863
+ ] }) : /* @__PURE__ */ a(M, { children: [
864
+ /* @__PURE__ */ e(vs, { className: "mr-2 h-4 w-4" }),
865
865
  "Remove Selected"
866
866
  ] })
867
867
  }
868
868
  )
869
869
  ] })
870
870
  ] }),
871
- /* @__PURE__ */ a(ce, { value: "add", className: "mt-4 space-y-4", children: [
871
+ /* @__PURE__ */ a(ue, { value: "add", className: "mt-4 space-y-4", children: [
872
872
  /* @__PURE__ */ a("div", { className: "relative", children: [
873
- /* @__PURE__ */ e(Ce, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
873
+ /* @__PURE__ */ e(Ee, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
874
874
  /* @__PURE__ */ e(
875
- Z,
875
+ ee,
876
876
  {
877
877
  placeholder: "Search users to add...",
878
878
  value: u,
@@ -881,16 +881,16 @@ function yt({
881
881
  }
882
882
  )
883
883
  ] }),
884
- /* @__PURE__ */ e(De, { className: "h-[300px]", children: A ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(Le, { className: "h-16 w-full" }, f)) }) : H.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
885
- /* @__PURE__ */ e(Ee, { className: "h-12 w-12 mb-3 opacity-50" }),
884
+ /* @__PURE__ */ e(Ae, { className: "h-[300px]", children: A ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(Me, { className: "h-16 w-full" }, f)) }) : H.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
885
+ /* @__PURE__ */ e(ke, { className: "h-12 w-12 mb-3 opacity-50" }),
886
886
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
887
887
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : "All eligible users are already members" })
888
888
  ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: H.map((f) => /* @__PURE__ */ e(
889
- Nt,
889
+ Pt,
890
890
  {
891
891
  user: f,
892
892
  selected: g.includes(f.id),
893
- onToggle: () => he(f.id)
893
+ onToggle: () => pe(f.id)
894
894
  },
895
895
  f.id
896
896
  )) }) }),
@@ -902,15 +902,15 @@ function yt({
902
902
  " selected"
903
903
  ] }),
904
904
  /* @__PURE__ */ e(
905
- L,
905
+ C,
906
906
  {
907
907
  onClick: R,
908
908
  disabled: I.isPending,
909
- children: I.isPending ? /* @__PURE__ */ a(O, { children: [
909
+ children: I.isPending ? /* @__PURE__ */ a(M, { children: [
910
910
  /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
911
911
  "Adding..."
912
- ] }) : /* @__PURE__ */ a(O, { children: [
913
- /* @__PURE__ */ e(Ee, { className: "mr-2 h-4 w-4" }),
912
+ ] }) : /* @__PURE__ */ a(M, { children: [
913
+ /* @__PURE__ */ e(ke, { className: "mr-2 h-4 w-4" }),
914
914
  "Add Members"
915
915
  ] })
916
916
  }
@@ -920,9 +920,9 @@ function yt({
920
920
  ] })
921
921
  ] }) }) });
922
922
  }
923
- function bt({
923
+ function Rt({
924
924
  member: s,
925
- selected: o,
925
+ selected: n,
926
926
  onToggle: t
927
927
  }) {
928
928
  var l, i, u, p;
@@ -933,8 +933,8 @@ function bt({
933
933
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
934
934
  onClick: t,
935
935
  children: [
936
- /* @__PURE__ */ e(hs, { checked: o }),
937
- /* @__PURE__ */ e(Ve, { className: "h-8 w-8", children: /* @__PURE__ */ e(ze, { className: "text-xs", children: r }) }),
936
+ /* @__PURE__ */ e(bs, { checked: n }),
937
+ /* @__PURE__ */ e(He, { className: "h-8 w-8", children: /* @__PURE__ */ e(Be, { className: "text-xs", children: r }) }),
938
938
  /* @__PURE__ */ a("div", { className: "flex-1", children: [
939
939
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((u = s.user) == null ? void 0 : u.name) || "Unknown User" }),
940
940
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (p = s.user) == null ? void 0 : p.email })
@@ -943,9 +943,9 @@ function bt({
943
943
  }
944
944
  );
945
945
  }
946
- function Nt({
946
+ function Pt({
947
947
  user: s,
948
- selected: o,
948
+ selected: n,
949
949
  onToggle: t
950
950
  }) {
951
951
  var l;
@@ -956,8 +956,8 @@ function Nt({
956
956
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
957
957
  onClick: t,
958
958
  children: [
959
- /* @__PURE__ */ e(hs, { checked: o }),
960
- /* @__PURE__ */ e(Ve, { className: "h-8 w-8", children: /* @__PURE__ */ e(ze, { className: "text-xs", children: r }) }),
959
+ /* @__PURE__ */ e(bs, { checked: n }),
960
+ /* @__PURE__ */ e(He, { className: "h-8 w-8", children: /* @__PURE__ */ e(Be, { className: "text-xs", children: r }) }),
961
961
  /* @__PURE__ */ a("div", { className: "flex-1", children: [
962
962
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s.name }),
963
963
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s.email })
@@ -966,91 +966,91 @@ function Nt({
966
966
  }
967
967
  );
968
968
  }
969
- function St({
969
+ function Ut({
970
970
  open: s,
971
- onOpenChange: o
971
+ onOpenChange: n
972
972
  }) {
973
- const [t, r] = S("groups"), [l, i] = S(""), [u, p] = S(null), [g, v] = S(!1), [d, c] = S(null), { tokenProps: m } = j(), { currentUser: h } = ps(), y = lt(), b = (h == null ? void 0 : h.type) === "tenant", N = m == null ? void 0 : m.tenantId, { groups: A, isLoading: I, refetch: G } = ca({
974
- type: b ? "TENANT_GROUP" : "all",
975
- tenantId: b ? N : void 0,
973
+ const [t, r] = S("groups"), [l, i] = S(""), [u, p] = S(null), [g, v] = S(!1), [c, d] = S(null), { tokenProps: m } = j(), { currentUser: h } = ys(), b = Ct(), y = (h == null ? void 0 : h.type) === "tenant", N = m == null ? void 0 : m.tenantId, { groups: A, isLoading: I, refetch: G } = ya({
974
+ type: y ? "TENANT_GROUP" : "all",
975
+ tenantId: y ? N : void 0,
976
976
  includeMembers: !1
977
977
  }), k = A.filter(
978
- (C) => {
978
+ (D) => {
979
979
  var R;
980
- return C.name.toLowerCase().includes(l.toLowerCase()) || ((R = C.description) == null ? void 0 : R.toLowerCase().includes(l.toLowerCase()));
980
+ return D.name.toLowerCase().includes(l.toLowerCase()) || ((R = D.description) == null ? void 0 : R.toLowerCase().includes(l.toLowerCase()));
981
981
  }
982
982
  ), $ = async () => {
983
- if (d)
983
+ if (c)
984
984
  try {
985
- await y.mutateAsync(d.id), c(null), G();
986
- } catch (C) {
987
- console.error("Failed to delete group:", C);
985
+ await b.mutateAsync(c.id), d(null), G();
986
+ } catch (D) {
987
+ console.error("Failed to delete group:", D);
988
988
  }
989
- }, P = (C) => {
990
- p(C), v(!0);
989
+ }, P = (D) => {
990
+ p(D), v(!0);
991
991
  }, H = () => {
992
992
  r("groups"), G();
993
993
  };
994
- return /* @__PURE__ */ a(O, { children: [
995
- /* @__PURE__ */ e(Ge, { open: s, onOpenChange: o, children: /* @__PURE__ */ a(Pe, { className: "max-w-4xl max-h-[80vh]", children: [
996
- /* @__PURE__ */ a(Ue, { children: [
997
- /* @__PURE__ */ a(Fe, { className: "flex items-center gap-2", children: [
994
+ return /* @__PURE__ */ a(M, { children: [
995
+ /* @__PURE__ */ e(Ue, { open: s, onOpenChange: n, children: /* @__PURE__ */ a(je, { className: "max-w-4xl max-h-[80vh]", children: [
996
+ /* @__PURE__ */ a(qe, { children: [
997
+ /* @__PURE__ */ a(Ve, { className: "flex items-center gap-2", children: [
998
998
  /* @__PURE__ */ e(z, { className: "h-5 w-5" }),
999
999
  "Group Management"
1000
1000
  ] }),
1001
- /* @__PURE__ */ e(os, { children: "Manage your groups, create new groups, and control group membership" })
1001
+ /* @__PURE__ */ e(us, { children: "Manage your groups, create new groups, and control group membership" })
1002
1002
  ] }),
1003
- /* @__PURE__ */ a(ds, { value: t, onValueChange: r, className: "mt-4", children: [
1004
- /* @__PURE__ */ a(us, { className: "grid w-full grid-cols-2", children: [
1005
- /* @__PURE__ */ a(le, { value: "groups", className: "flex items-center gap-2", children: [
1003
+ /* @__PURE__ */ a(fs, { value: t, onValueChange: r, className: "mt-4", children: [
1004
+ /* @__PURE__ */ a(gs, { className: "grid w-full grid-cols-2", children: [
1005
+ /* @__PURE__ */ a(de, { value: "groups", className: "flex items-center gap-2", children: [
1006
1006
  /* @__PURE__ */ e(z, { className: "h-4 w-4" }),
1007
1007
  "Groups"
1008
1008
  ] }),
1009
- /* @__PURE__ */ a(le, { value: "create", className: "flex items-center gap-2", children: [
1010
- /* @__PURE__ */ e(Re, { className: "h-4 w-4" }),
1009
+ /* @__PURE__ */ a(de, { value: "create", className: "flex items-center gap-2", children: [
1010
+ /* @__PURE__ */ e(Fe, { className: "h-4 w-4" }),
1011
1011
  "Create Group"
1012
1012
  ] })
1013
1013
  ] }),
1014
- /* @__PURE__ */ e(ce, { value: "groups", className: "mt-4", children: /* @__PURE__ */ a("div", { className: "space-y-4", children: [
1014
+ /* @__PURE__ */ e(ue, { value: "groups", className: "mt-4", children: /* @__PURE__ */ a("div", { className: "space-y-4", children: [
1015
1015
  /* @__PURE__ */ a("div", { className: "relative", children: [
1016
- /* @__PURE__ */ e(Ce, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
1016
+ /* @__PURE__ */ e(Ee, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
1017
1017
  /* @__PURE__ */ e(
1018
- Z,
1018
+ ee,
1019
1019
  {
1020
1020
  placeholder: "Search groups...",
1021
1021
  value: l,
1022
- onChange: (C) => i(C.target.value),
1022
+ onChange: (D) => i(D.target.value),
1023
1023
  className: "pl-10"
1024
1024
  }
1025
1025
  )
1026
1026
  ] }),
1027
- /* @__PURE__ */ e(De, { className: "h-[400px]", children: I ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((C) => /* @__PURE__ */ e(Le, { className: "h-24 w-full" }, C)) }) : k.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1027
+ /* @__PURE__ */ e(Ae, { className: "h-[400px]", children: I ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Me, { className: "h-24 w-full" }, D)) }) : k.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1028
1028
  /* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
1029
1029
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
1030
1030
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
1031
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: k.map((C) => /* @__PURE__ */ e(
1032
- wt,
1031
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: k.map((D) => /* @__PURE__ */ e(
1032
+ Ft,
1033
1033
  {
1034
- group: C,
1035
- onManageMembers: () => P(C),
1036
- onDelete: () => c(C),
1034
+ group: D,
1035
+ onManageMembers: () => P(D),
1036
+ onDelete: () => d(D),
1037
1037
  currentUserId: h == null ? void 0 : h.id
1038
1038
  },
1039
- C.id
1039
+ D.id
1040
1040
  )) }) })
1041
1041
  ] }) }),
1042
- /* @__PURE__ */ e(ce, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
1043
- ut,
1042
+ /* @__PURE__ */ e(ue, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
1043
+ At,
1044
1044
  {
1045
1045
  onSuccess: H,
1046
1046
  tenantId: N,
1047
- isTenantUser: b
1047
+ isTenantUser: y
1048
1048
  }
1049
1049
  ) })
1050
1050
  ] })
1051
1051
  ] }) }),
1052
1052
  u && /* @__PURE__ */ e(
1053
- yt,
1053
+ Gt,
1054
1054
  {
1055
1055
  open: g,
1056
1056
  onOpenChange: v,
@@ -1059,28 +1059,28 @@ function St({
1059
1059
  }
1060
1060
  ),
1061
1061
  /* @__PURE__ */ e(
1062
- fs,
1062
+ Ns,
1063
1063
  {
1064
- open: !!d,
1065
- onOpenChange: () => c(null),
1066
- children: /* @__PURE__ */ a(gs, { children: [
1067
- /* @__PURE__ */ a(vs, { children: [
1068
- /* @__PURE__ */ e(ys, { children: "Delete Group" }),
1069
- /* @__PURE__ */ a(bs, { children: [
1064
+ open: !!c,
1065
+ onOpenChange: () => d(null),
1066
+ children: /* @__PURE__ */ a(Ss, { children: [
1067
+ /* @__PURE__ */ a(ws, { children: [
1068
+ /* @__PURE__ */ e(xs, { children: "Delete Group" }),
1069
+ /* @__PURE__ */ a(Ds, { children: [
1070
1070
  'Are you sure you want to delete "',
1071
- d == null ? void 0 : d.name,
1071
+ c == null ? void 0 : c.name,
1072
1072
  '"? This action cannot be undone and will remove all members from the group.'
1073
1073
  ] })
1074
1074
  ] }),
1075
- /* @__PURE__ */ a(Ns, { children: [
1076
- /* @__PURE__ */ e(Ss, { children: "Cancel" }),
1075
+ /* @__PURE__ */ a(Cs, { children: [
1076
+ /* @__PURE__ */ e(Ls, { children: "Cancel" }),
1077
1077
  /* @__PURE__ */ e(
1078
- Ae,
1078
+ Oe,
1079
1079
  {
1080
1080
  onClick: $,
1081
- disabled: y.isPending,
1081
+ disabled: b.isPending,
1082
1082
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1083
- children: y.isPending ? /* @__PURE__ */ a(O, { children: [
1083
+ children: b.isPending ? /* @__PURE__ */ a(M, { children: [
1084
1084
  /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
1085
1085
  "Deleting..."
1086
1086
  ] }) : "Delete Group"
@@ -1092,9 +1092,9 @@ function St({
1092
1092
  )
1093
1093
  ] });
1094
1094
  }
1095
- function wt({
1095
+ function Ft({
1096
1096
  group: s,
1097
- onManageMembers: o,
1097
+ onManageMembers: n,
1098
1098
  onDelete: t,
1099
1099
  currentUserId: r
1100
1100
  }) {
@@ -1114,168 +1114,172 @@ function wt({
1114
1114
  ] }),
1115
1115
  /* @__PURE__ */ a("span", { children: [
1116
1116
  "Created ",
1117
- qa(new Date(s.createdAt), "MMM d, yyyy")
1117
+ rt(new Date(s.createdAt), "MMM d, yyyy")
1118
1118
  ] })
1119
1119
  ] })
1120
1120
  ] }),
1121
1121
  /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
1122
1122
  /* @__PURE__ */ e(
1123
- L,
1123
+ C,
1124
1124
  {
1125
1125
  variant: "ghost",
1126
1126
  size: "sm",
1127
- onClick: o,
1127
+ onClick: n,
1128
1128
  title: "Manage members",
1129
- children: /* @__PURE__ */ e(Ee, { className: "h-4 w-4" })
1129
+ children: /* @__PURE__ */ e(ke, { className: "h-4 w-4" })
1130
1130
  }
1131
1131
  ),
1132
1132
  l && /* @__PURE__ */ e(
1133
- L,
1133
+ C,
1134
1134
  {
1135
1135
  variant: "ghost",
1136
1136
  size: "sm",
1137
1137
  onClick: t,
1138
1138
  title: "Delete group",
1139
1139
  className: "text-destructive hover:text-destructive",
1140
- children: /* @__PURE__ */ e(ms, { className: "h-4 w-4" })
1140
+ children: /* @__PURE__ */ e(vs, { className: "h-4 w-4" })
1141
1141
  }
1142
1142
  )
1143
1143
  ] })
1144
1144
  ] }) });
1145
1145
  }
1146
- function Tt() {
1147
- var Je, Xe, Ye;
1148
- Ia(), Ta();
1146
+ function Wt() {
1147
+ var es, ss, as, ts;
1148
+ Wa(), Ja();
1149
1149
  const {
1150
1150
  authToken: s,
1151
- tokenProps: o,
1151
+ tokenProps: n,
1152
1152
  id: t
1153
- } = j(), { isLocalDev: r } = da(), { permissions: l } = ja(), i = ua(), { isLoading: u } = ma();
1154
- x((n) => n.theme);
1155
- const p = x((n) => n.lenses), g = x((n) => n.selectedLensId), v = p == null ? void 0 : p.find((n) => n.id === g), d = x((n) => n.dashboard);
1156
- x((n) => n.selectedSheetId);
1157
- const c = x(
1158
- (n) => n.isDashboardEditing
1159
- ), { setDashboardTitle: m } = x((n) => n.actions), [h, y] = S(!1), [b, N] = S(!1), [A, I] = S(!1), [G, k] = S(!1), [$, P] = S(!1), [H, C] = S(!1), [R, B] = S(null), [he, K] = S(!1), f = x((n) => n.isDashboardPanelOpen), E = x(
1160
- (n) => n.actions.setIsDashboardPanelOpen
1161
- ), T = x((n) => n.filterValues), w = x((n) => n.isVisualEditing);
1162
- es((n) => n.card);
1163
- const U = oe(
1164
- (n) => n.selectedDashboard
1165
- ), q = oe(
1166
- (n) => n.initialDashboard
1153
+ } = j(), { isLocalDev: r } = Na(), { permissions: l } = tt(), i = Sa(), { isLoading: u } = wa();
1154
+ x((o) => o.theme);
1155
+ const p = x((o) => o.lenses), g = x((o) => o.selectedLensId), v = p == null ? void 0 : p.find((o) => o.id === g), c = x((o) => o.dashboard);
1156
+ x((o) => o.selectedSheetId);
1157
+ const d = x(
1158
+ (o) => o.isDashboardEditing
1159
+ ), { setDashboardTitle: m } = x((o) => o.actions), [h, b] = S(!1), [y, N] = S(!1), [A, I] = S(!1), [G, k] = S(!1), [$, P] = S(!1), [H, D] = S(!1), [R, B] = S(null), [pe, K] = S(!1), f = x((o) => o.isDashboardPanelOpen), E = x(
1160
+ (o) => o.actions.setIsDashboardPanelOpen
1161
+ ), T = x((o) => o.filterValues), w = x((o) => o.isVisualEditing);
1162
+ ns((o) => o.card);
1163
+ const U = le(
1164
+ (o) => o.selectedDashboard
1165
+ ), q = le(
1166
+ (o) => o.initialDashboard
1167
1167
  );
1168
- oe((n) => n.selectedVisual), x((n) => n.selectedFrameId), es((n) => n.frame);
1169
- const se = U ? (Xe = U == null ? void 0 : U.permissions) == null ? void 0 : Xe.canEdit : (Je = q == null ? void 0 : q.permissions) == null ? void 0 : Je.canEdit, Is = x((n) => n.showFilters), Ts = ha((n) => n.setPanelOpen), _s = x(
1170
- (n) => n.showDashboardJSON
1171
- ), pe = x((n) => n.onSaveFunction), Gs = x(
1172
- (n) => n.actions.setShowFilters
1173
- ), { setIsDashboardEditing: $e, setShowDashboardJSON: He } = x(
1174
- (n) => n.actions
1175
- ), { setInitialDashboard: Be, clearSelectedDashboard: Rs } = oe(
1176
- (n) => n.actions
1177
- ), { resources: ae } = pa(be.DASHBOARD), { currentUser: Ps } = ps(), Us = fa(Ps), Q = U || q, Ke = Q ? {
1168
+ le((o) => o.selectedVisual), x((o) => o.selectedFrameId), ns((o) => o.frame);
1169
+ const te = U ? (ss = U == null ? void 0 : U.permissions) == null ? void 0 : ss.canEdit : (es = q == null ? void 0 : q.permissions) == null ? void 0 : es.canEdit, Ps = x((o) => o.showFilters), Us = xa((o) => o.setPanelOpen), Fs = x(
1170
+ (o) => o.showDashboardJSON
1171
+ ), fe = x((o) => o.onSaveFunction), js = x(
1172
+ (o) => o.actions.setShowFilters
1173
+ ), { setIsDashboardEditing: Ke, setShowDashboardJSON: Qe } = x(
1174
+ (o) => o.actions
1175
+ ), { setInitialDashboard: We, clearSelectedDashboard: qs } = le(
1176
+ (o) => o.actions
1177
+ ), { resources: re } = Da(we.DASHBOARD), { data: ge } = Ca(), Vs = ((as = ge == null ? void 0 : ge.preference) == null ? void 0 : as.defaultDashboardId) || null, { mutate: zs, isPending: $s } = La(), { currentUser: Hs } = ys(), Bs = Ea(Hs), Q = U || q, Je = Q ? {
1178
1178
  id: Q.id,
1179
- title: (d == null ? void 0 : d.title) || Q.title || "Dashboard"
1180
- } : null, { handleAddNewFrame: Fs } = ga(), [W, fe] = S(!1), [js, te] = S(!1), re = va(be.DASHBOARD), [J, ge] = S(
1179
+ title: (c == null ? void 0 : c.title) || Q.title || "Dashboard"
1180
+ } : null, { handleAddNewFrame: Ks } = Aa(), [W, ve] = S(!1), [Qs, ne] = S(!1), oe = Ma(we.DASHBOARD), [J, be] = S(
1181
1181
  null
1182
- ), qs = async (n, M) => {
1183
- if (!(d != null && d.id)) {
1182
+ ), Ws = async (o, O) => {
1183
+ if (!(c != null && c.id)) {
1184
1184
  console.log("No dashboard ID found");
1185
1185
  return;
1186
1186
  }
1187
1187
  console.log("Updating dashboard title:", {
1188
- dashboardId: d.id,
1189
- newTitle: n,
1190
- previousTitle: M
1191
- }), re.mutate(
1188
+ dashboardId: c.id,
1189
+ newTitle: o,
1190
+ previousTitle: O
1191
+ }), oe.mutate(
1192
1192
  {
1193
- resourceId: d.id,
1194
- data: { title: n }
1193
+ resourceId: c.id,
1194
+ data: { title: o }
1195
1195
  },
1196
1196
  {
1197
1197
  onSuccess: () => {
1198
- console.log("Dashboard title updated successfully"), D.success("Dashboard title updated");
1198
+ console.log("Dashboard title updated successfully"), L.success("Dashboard title updated");
1199
1199
  },
1200
- onError: (X) => {
1201
- console.error("Failed to update dashboard title:", X), D.error("Failed to update dashboard title"), m(M);
1200
+ onError: (Y) => {
1201
+ console.error("Failed to update dashboard title:", Y), L.error("Failed to update dashboard title"), m(O);
1202
1202
  }
1203
1203
  }
1204
1204
  );
1205
1205
  };
1206
- Oa(() => {
1207
- if (ae && ae.length > 0) {
1208
- const n = d == null ? void 0 : d.id;
1209
- if (n) {
1210
- const M = ae.find(
1211
- (X) => X.id === n
1206
+ Qa(() => {
1207
+ if (re && re.length > 0) {
1208
+ const o = c == null ? void 0 : c.id;
1209
+ if (o) {
1210
+ const O = re.find(
1211
+ (Y) => Y.id === o
1212
1212
  );
1213
- M && Be(M);
1213
+ O && We(O);
1214
1214
  }
1215
1215
  }
1216
- }, [ae, d == null ? void 0 : d.id, Be]);
1217
- const ne = o.orgUserId || o.tenantId, Vs = c && !w && ne && se, { setDashboard: Qe } = x((n) => n.actions), zs = () => {
1218
- $e(!0);
1219
- }, ve = () => {
1220
- $e(!1), He(!1), ge(null);
1216
+ }, [re, c == null ? void 0 : c.id, We]);
1217
+ const ie = n.orgUserId || n.tenantId, Js = d && !w && ie && te, { setDashboard: Xe } = x((o) => o.actions), Xs = () => {
1218
+ Ke(!0);
1219
+ }, ye = () => {
1220
+ Ke(!1), Qe(!1), be(null);
1221
1221
  };
1222
- _a(
1223
- c,
1222
+ Xa(
1224
1223
  d,
1224
+ c,
1225
1225
  J,
1226
- (n) => ge(n)
1226
+ (o) => be(o)
1227
1227
  );
1228
- const $s = () => J ? JSON.stringify(d) !== JSON.stringify(J) : !1, Hs = () => {
1229
- $s() ? te(!0) : ve();
1230
- }, Bs = async () => {
1231
- await ye({ closeAfterSave: !0 });
1232
- }, Ks = () => {
1233
- J && Qe(J), ve(), te(!1);
1228
+ const Ys = () => J ? JSON.stringify(c) !== JSON.stringify(J) : !1, Zs = () => {
1229
+ Ys() ? ne(!0) : ye();
1230
+ }, ea = async () => {
1231
+ await Ne({ closeAfterSave: !0 });
1232
+ }, sa = () => {
1233
+ J && Xe(J), ye(), ne(!1);
1234
1234
  };
1235
- async function ye(n) {
1236
- const M = (n == null ? void 0 : n.closeAfterSave) ?? he;
1237
- K(M), M && te(!1);
1238
- const X = Ma(d);
1239
- C(!0), B(null), fe(!0);
1240
- const Js = {
1241
- template: d
1235
+ async function Ne(o) {
1236
+ const O = (o == null ? void 0 : o.closeAfterSave) ?? pe;
1237
+ K(O), O && ne(!1);
1238
+ const Y = Ka(c);
1239
+ D(!0), B(null), ve(!0);
1240
+ const oa = {
1241
+ template: c
1242
1242
  };
1243
- re.mutate(
1243
+ oe.mutate(
1244
1244
  {
1245
- resourceId: d.id,
1246
- data: Js
1245
+ resourceId: c.id,
1246
+ data: oa
1247
1247
  },
1248
1248
  {
1249
1249
  onSuccess: () => {
1250
- fe(!1), D.success("Dashboard saved!"), ge(X), C(!1), K(!1), M && ve();
1250
+ ve(!1), L.success("Dashboard saved!"), be(Y), D(!1), K(!1), O && ye();
1251
1251
  },
1252
1252
  onError: () => {
1253
- fe(!1), B("Failed to save dashboard. Please try again."), D.error("Failed to save dashboard");
1253
+ ve(!1), B("Failed to save dashboard. Please try again."), L.error("Failed to save dashboard");
1254
1254
  }
1255
1255
  }
1256
1256
  );
1257
1257
  }
1258
- async function Qs() {
1259
- if (y(!0), !g || !v) return;
1260
- const n = JSON.stringify(d), M = {
1258
+ async function aa() {
1259
+ if (b(!0), !g || !v) return;
1260
+ const o = JSON.stringify(c), O = {
1261
1261
  ...v,
1262
- template: n,
1262
+ template: o,
1263
1263
  filterValues: T
1264
1264
  };
1265
- await Me(
1266
- o.apiServiceUrl,
1267
- M,
1265
+ await Te(
1266
+ n.apiServiceUrl,
1267
+ O,
1268
1268
  s == null ? void 0 : s.accessToken
1269
- ), D.success("Lens saved"), pe == null || pe(d), y(!1);
1269
+ ), L.success("Lens saved"), fe == null || fe(c), b(!1);
1270
1270
  }
1271
- const We = (v == null ? void 0 : v.name) || d.title;
1272
- re.isPending && console.log("Title during update:", {
1273
- title: We,
1274
- dashboardStateTitle: d.title,
1275
- dashboardId: d == null ? void 0 : d.id,
1271
+ const Ye = (v == null ? void 0 : v.name) || c.title;
1272
+ oe.isPending && console.log("Title during update:", {
1273
+ title: Ye,
1274
+ dashboardStateTitle: c.title,
1275
+ dashboardId: c == null ? void 0 : c.id,
1276
1276
  currentLensName: v == null ? void 0 : v.name
1277
1277
  });
1278
- const Ws = o.orgUserId || o.tenantId && o.endUserId && o.endUserEmail;
1278
+ const Ze = n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail, ta = !!Ze && !!(s != null && s.accessToken) && !!(n != null && n.apiServiceUrl), ra = i, X = (c == null ? void 0 : c.id) || null, Se = !!X && Vs === X, na = () => {
1279
+ X && zs({
1280
+ dashboardId: Se ? null : X
1281
+ });
1282
+ };
1279
1283
  return /* @__PURE__ */ a(
1280
1284
  "div",
1281
1285
  {
@@ -1283,7 +1287,7 @@ function Tt() {
1283
1287
  role: "dashboard-controls",
1284
1288
  children: [
1285
1289
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1286
- Ws && /* @__PURE__ */ a(O, { children: [
1290
+ Ze && /* @__PURE__ */ a(M, { children: [
1287
1291
  /* @__PURE__ */ e(
1288
1292
  F,
1289
1293
  {
@@ -1293,76 +1297,100 @@ function Tt() {
1293
1297
  E(!f);
1294
1298
  },
1295
1299
  className: "h-7 p-2",
1296
- children: /* @__PURE__ */ e(Ha, { className: "h-4 w-4" })
1300
+ children: /* @__PURE__ */ e(lt, { className: "h-4 w-4" })
1297
1301
  }
1298
1302
  ),
1299
- i && !w && /* @__PURE__ */ e(
1303
+ ra && !w && /* @__PURE__ */ e(
1300
1304
  F,
1301
1305
  {
1302
1306
  "aria-label": "Dashboard Hub",
1303
1307
  tooltip: "Dashboard Hub",
1304
- onClick: () => Rs(),
1308
+ onClick: () => qs(),
1305
1309
  className: "h-7 p-2",
1306
- children: /* @__PURE__ */ e(is, { className: "h-4 w-4" })
1310
+ children: /* @__PURE__ */ e(ms, { className: "h-4 w-4" })
1307
1311
  }
1308
1312
  )
1309
1313
  ] }),
1310
1314
  !w && i && (u ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1311
1315
  /* @__PURE__ */ e(V, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
1312
1316
  /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
1313
- ] }) : /* @__PURE__ */ e(
1314
- ya,
1315
- {
1316
- value: We || "Untitled Dashboard",
1317
- onSave: (n) => {
1318
- console.log("EditableText onSave called:", {
1319
- newTitle: n,
1320
- canEditDashboard: se,
1321
- dashboardId: d == null ? void 0 : d.id
1322
- });
1323
- const M = (d == null ? void 0 : d.title) || "";
1324
- m(n), qs(n, M);
1325
- },
1326
- isEditable: se && !v,
1327
- displayClassName: "text-sm font-medium",
1328
- inputClassName: "text-sm font-medium",
1329
- placeholder: "Dashboard Title",
1330
- isPending: re.isPending
1331
- }
1332
- ))
1317
+ ] }) : /* @__PURE__ */ a(M, { children: [
1318
+ /* @__PURE__ */ e(
1319
+ ka,
1320
+ {
1321
+ value: Ye || "Untitled Dashboard",
1322
+ onSave: (o) => {
1323
+ console.log("EditableText onSave called:", {
1324
+ newTitle: o,
1325
+ canEditDashboard: te,
1326
+ dashboardId: c == null ? void 0 : c.id
1327
+ });
1328
+ const O = (c == null ? void 0 : c.title) || "";
1329
+ m(o), Ws(o, O);
1330
+ },
1331
+ isEditable: te && !v,
1332
+ displayClassName: "text-sm font-medium",
1333
+ inputClassName: "text-sm font-medium",
1334
+ placeholder: "Dashboard Title",
1335
+ isPending: oe.isPending
1336
+ }
1337
+ ),
1338
+ ta && X && /* @__PURE__ */ e(Oa, { children: /* @__PURE__ */ a(Ia, { children: [
1339
+ /* @__PURE__ */ e(Ta, { asChild: !0, children: /* @__PURE__ */ e(
1340
+ C,
1341
+ {
1342
+ variant: "ghost",
1343
+ size: "icon",
1344
+ onClick: na,
1345
+ disabled: $s || !(s != null && s.accessToken) || !(n != null && n.apiServiceUrl),
1346
+ className: "h-7 w-7",
1347
+ children: /* @__PURE__ */ e(
1348
+ _a,
1349
+ {
1350
+ className: ae(
1351
+ "h-4 w-4 transition-colors",
1352
+ Se ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground hover:text-yellow-400"
1353
+ )
1354
+ }
1355
+ )
1356
+ }
1357
+ ) }),
1358
+ /* @__PURE__ */ e(Ga, { children: /* @__PURE__ */ e("p", { children: Se ? "Remove as default dashboard" : "Make this a default dashboard" }) })
1359
+ ] }) })
1360
+ ] }))
1333
1361
  ] }),
1334
1362
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1335
- w && /* @__PURE__ */ a(O, { children: [
1336
- /* @__PURE__ */ e(Ga, { className: "mr-2" }),
1337
- /* @__PURE__ */ e(Ra, { className: "h-7" })
1363
+ w && /* @__PURE__ */ a(M, { children: [
1364
+ /* @__PURE__ */ e(Ya, { className: "mr-2" }),
1365
+ /* @__PURE__ */ e(Za, { className: "h-7" })
1338
1366
  ] }),
1339
- r && !w && /* @__PURE__ */ a(O, { children: [
1367
+ r && !w && /* @__PURE__ */ a(M, { children: [
1340
1368
  /* @__PURE__ */ e(
1341
1369
  F,
1342
1370
  {
1343
1371
  tooltip: "Copy Token",
1344
1372
  onClick: () => {
1345
- var n;
1346
- s != null && s.accessToken && ((n = navigator == null ? void 0 : navigator.clipboard) != null && n.writeText ? navigator.clipboard.writeText(s.accessToken).then(() => D.success("Token copied to clipboard")).catch(() => D.error("Unable to copy token")) : D.error("Clipboard not available"));
1373
+ var o;
1374
+ s != null && s.accessToken && ((o = navigator == null ? void 0 : navigator.clipboard) != null && o.writeText ? navigator.clipboard.writeText(s.accessToken).then(() => L.success("Token copied to clipboard")).catch(() => L.error("Unable to copy token")) : L.error("Clipboard not available"));
1347
1375
  },
1348
1376
  className: "h-7 p-2",
1349
- children: /* @__PURE__ */ e(ba, { className: "h-4 w-4" })
1377
+ children: /* @__PURE__ */ e(Ra, { className: "h-4 w-4" })
1350
1378
  }
1351
1379
  ),
1352
1380
  /* @__PURE__ */ e(
1353
1381
  F,
1354
1382
  {
1355
1383
  tooltip: "Invalidate Token",
1356
- onClick: () => Na(o.apiServiceUrl),
1384
+ onClick: () => Pa(n.apiServiceUrl),
1357
1385
  className: "h-7 p-2",
1358
- children: /* @__PURE__ */ e(Ka, { className: "h-4 w-4" })
1386
+ children: /* @__PURE__ */ e(dt, { className: "h-4 w-4" })
1359
1387
  }
1360
1388
  )
1361
1389
  ] }),
1362
- !w && i && /* @__PURE__ */ e(Sa, {}),
1363
- !w && i && /* @__PURE__ */ e(Pa, {}),
1364
1390
  !w && i && /* @__PURE__ */ e(Ua, {}),
1365
- !w && i && Us && /* @__PURE__ */ e(
1391
+ !w && i && /* @__PURE__ */ e(et, {}),
1392
+ !w && i && /* @__PURE__ */ e(st, {}),
1393
+ !w && i && Bs && /* @__PURE__ */ e(
1366
1394
  F,
1367
1395
  {
1368
1396
  tooltip: "Manage Groups",
@@ -1371,187 +1399,187 @@ function Tt() {
1371
1399
  children: /* @__PURE__ */ e(z, { className: "h-4 w-4" })
1372
1400
  }
1373
1401
  ),
1374
- !w && i && ((Ye = Q == null ? void 0 : Q.permissions) == null ? void 0 : Ye.canShare) && /* @__PURE__ */ e(
1402
+ !w && i && ((ts = Q == null ? void 0 : Q.permissions) == null ? void 0 : ts.canShare) && /* @__PURE__ */ e(
1375
1403
  F,
1376
1404
  {
1377
1405
  tooltip: "Share Dashboard",
1378
1406
  onClick: () => N(!0),
1379
1407
  className: "h-7 p-2",
1380
- children: /* @__PURE__ */ e(wa, { className: "h-4 w-4" })
1408
+ children: /* @__PURE__ */ e(Fa, { className: "h-4 w-4" })
1381
1409
  }
1382
1410
  ),
1383
- !Is && !w && c && l.canUseFilters && i && /* @__PURE__ */ e(
1384
- L,
1411
+ !Ps && !w && d && l.canUseFilters && i && /* @__PURE__ */ e(
1412
+ C,
1385
1413
  {
1386
1414
  className: "h-7 p-2",
1387
1415
  variant: "outline",
1388
1416
  onClick: () => {
1389
- Ts("dashboard", !1), Gs(!0);
1417
+ Us("dashboard", !1), js(!0);
1390
1418
  },
1391
1419
  size: "sm",
1392
- children: /* @__PURE__ */ e(xa, { className: "h-4 w-4" })
1420
+ children: /* @__PURE__ */ e(ja, { className: "h-4 w-4" })
1393
1421
  }
1394
1422
  ),
1395
- c && !w && ne && r && i && /* @__PURE__ */ e(st, {}),
1396
- !w && ne && r && i && /* @__PURE__ */ e(at, {}),
1397
- c && !w && ne && v && r && i && /* @__PURE__ */ a(
1398
- L,
1423
+ d && !w && ie && r && i && /* @__PURE__ */ e(bt, {}),
1424
+ !w && ie && r && i && /* @__PURE__ */ e(yt, {}),
1425
+ d && !w && ie && v && r && i && /* @__PURE__ */ a(
1426
+ C,
1399
1427
  {
1400
1428
  className: "h-7 p-2",
1401
1429
  variant: "secondary",
1402
1430
  disabled: h,
1403
- onClick: Qs,
1431
+ onClick: aa,
1404
1432
  size: "sm",
1405
1433
  children: [
1406
- /* @__PURE__ */ e(ss, { className: "mr-2 h-4 w-4" }),
1434
+ /* @__PURE__ */ e(os, { className: "mr-2 h-4 w-4" }),
1407
1435
  "Save Lens"
1408
1436
  ]
1409
1437
  }
1410
1438
  ),
1411
- c && !w && i && /* @__PURE__ */ a(
1412
- L,
1439
+ d && !w && i && /* @__PURE__ */ a(
1440
+ C,
1413
1441
  {
1414
1442
  variant: "outline",
1415
1443
  className: "h-7 p-2",
1416
1444
  size: "sm",
1417
- disabled: !c,
1418
- onClick: () => Fs(),
1445
+ disabled: !d,
1446
+ onClick: () => Ks(),
1419
1447
  children: [
1420
- /* @__PURE__ */ e(Re, { className: "mr-2 h-4 w-4" }),
1448
+ /* @__PURE__ */ e(Fe, { className: "mr-2 h-4 w-4" }),
1421
1449
  "Visual"
1422
1450
  ]
1423
1451
  }
1424
1452
  ),
1425
- !w && !c && se && i && /* @__PURE__ */ a(
1426
- L,
1453
+ !w && !d && te && i && /* @__PURE__ */ a(
1454
+ C,
1427
1455
  {
1428
1456
  variant: "outline",
1429
1457
  className: "h-7 p-2",
1430
- onClick: zs,
1458
+ onClick: Xs,
1431
1459
  size: "sm",
1432
1460
  children: [
1433
- /* @__PURE__ */ e(Ca, { className: "mr-2 h-4 w-4" }),
1461
+ /* @__PURE__ */ e(qa, { className: "mr-2 h-4 w-4" }),
1434
1462
  "Edit"
1435
1463
  ]
1436
1464
  }
1437
1465
  ),
1438
- Vs && i && /* @__PURE__ */ a(
1439
- L,
1466
+ Js && i && /* @__PURE__ */ a(
1467
+ C,
1440
1468
  {
1441
1469
  className: "h-7 p-2",
1442
1470
  disabled: W,
1443
- onClick: () => ye(),
1471
+ onClick: () => Ne(),
1444
1472
  size: "sm",
1445
1473
  children: [
1446
- W ? /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(ss, { className: "mr-2 h-4 w-4" }),
1474
+ W ? /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(os, { className: "mr-2 h-4 w-4" }),
1447
1475
  W ? "Saving..." : "Save"
1448
1476
  ]
1449
1477
  }
1450
1478
  ),
1451
- !w && c && r && i && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1452
- L,
1479
+ !w && d && r && i && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1480
+ C,
1453
1481
  {
1454
1482
  className: "h-7 p-2",
1455
- onClick: () => He(!_s),
1483
+ onClick: () => Qe(!Fs),
1456
1484
  size: "sm",
1457
1485
  variant: "ghost",
1458
- children: /* @__PURE__ */ e(Da, { className: "h-4 w-4" })
1486
+ children: /* @__PURE__ */ e(Va, { className: "h-4 w-4" })
1459
1487
  }
1460
1488
  ) }),
1461
- !w && r && /* @__PURE__ */ e(Ya, {}),
1462
- c && !w && i && /* @__PURE__ */ a(
1463
- L,
1489
+ !w && r && /* @__PURE__ */ e(ft, {}),
1490
+ d && !w && i && /* @__PURE__ */ a(
1491
+ C,
1464
1492
  {
1465
1493
  variant: "outline",
1466
1494
  className: "h-7 p-2",
1467
- onClick: Hs,
1495
+ onClick: Zs,
1468
1496
  children: [
1469
- /* @__PURE__ */ e(ls, { className: "mr-2 h-4 w-4" }),
1497
+ /* @__PURE__ */ e(hs, { className: "mr-2 h-4 w-4" }),
1470
1498
  "Close"
1471
1499
  ]
1472
1500
  }
1473
1501
  ),
1474
- !w && i && /* @__PURE__ */ a(Oe, { children: [
1475
- /* @__PURE__ */ e(Ie, { asChild: !0, children: /* @__PURE__ */ e(F, { tooltip: "More Options", className: "h-7 p-2", children: /* @__PURE__ */ e(La, { className: "h-4 w-4" }) }) }),
1476
- /* @__PURE__ */ a(Te, { align: "end", children: [
1477
- /* @__PURE__ */ a(Y, { onClick: () => k(!0), children: [
1478
- /* @__PURE__ */ e(Ea, { className: "mr-2 h-4 w-4" }),
1502
+ !w && i && /* @__PURE__ */ a(_e, { children: [
1503
+ /* @__PURE__ */ e(Ge, { asChild: !0, children: /* @__PURE__ */ e(F, { tooltip: "More Options", className: "h-7 p-2", children: /* @__PURE__ */ e(za, { className: "h-4 w-4" }) }) }),
1504
+ /* @__PURE__ */ a(Re, { align: "end", children: [
1505
+ /* @__PURE__ */ a(Z, { onClick: () => k(!0), children: [
1506
+ /* @__PURE__ */ e($a, { className: "mr-2 h-4 w-4" }),
1479
1507
  "Calendar Preferences"
1480
1508
  ] }),
1481
- /* @__PURE__ */ a(Y, { onClick: () => P(!0), children: [
1482
- /* @__PURE__ */ e(Aa, { className: "mr-2 h-4 w-4" }),
1509
+ /* @__PURE__ */ a(Z, { onClick: () => P(!0), children: [
1510
+ /* @__PURE__ */ e(Ha, { className: "mr-2 h-4 w-4" }),
1483
1511
  "Summary Settings"
1484
1512
  ] })
1485
1513
  ] })
1486
1514
  ] }),
1487
- b && Ke && /* @__PURE__ */ e(
1488
- ka,
1515
+ y && Je && /* @__PURE__ */ e(
1516
+ Ba,
1489
1517
  {
1490
- resource: Ke,
1491
- resourceType: be.DASHBOARD,
1518
+ resource: Je,
1519
+ resourceType: we.DASHBOARD,
1492
1520
  onClose: () => N(!1)
1493
1521
  }
1494
1522
  ),
1495
1523
  /* @__PURE__ */ e(
1496
- St,
1524
+ Ut,
1497
1525
  {
1498
1526
  open: A,
1499
1527
  onOpenChange: I
1500
1528
  }
1501
1529
  ),
1502
1530
  /* @__PURE__ */ e(
1503
- Va,
1531
+ nt,
1504
1532
  {
1505
1533
  open: G,
1506
1534
  onOpenChange: k
1507
1535
  }
1508
1536
  ),
1509
1537
  /* @__PURE__ */ e(
1510
- za,
1538
+ ot,
1511
1539
  {
1512
1540
  open: $,
1513
1541
  onOpenChange: P,
1514
- dashboard: d,
1515
- disabled: !c,
1516
- onApply: (n) => Qe({
1517
- ...d,
1518
- summary: n
1542
+ dashboard: c,
1543
+ disabled: !d,
1544
+ onApply: (o) => Xe({
1545
+ ...c,
1546
+ summary: o
1519
1547
  })
1520
1548
  }
1521
1549
  ),
1522
1550
  /* @__PURE__ */ e(
1523
- fs,
1551
+ Ns,
1524
1552
  {
1525
1553
  open: H,
1526
- onOpenChange: (n) => {
1527
- !n && W && !R || (C(n), n || (B(null), K(!1)));
1554
+ onOpenChange: (o) => {
1555
+ !o && W && !R || (D(o), o || (B(null), K(!1)));
1528
1556
  },
1529
- children: /* @__PURE__ */ a(gs, { className: "max-w-sm", children: [
1530
- /* @__PURE__ */ a(vs, { children: [
1531
- /* @__PURE__ */ e(ys, { children: R ? "Save failed" : "Saving dashboard" }),
1532
- /* @__PURE__ */ e(bs, { className: "pt-2", children: R ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
1557
+ children: /* @__PURE__ */ a(Ss, { className: "max-w-sm", children: [
1558
+ /* @__PURE__ */ a(ws, { children: [
1559
+ /* @__PURE__ */ e(xs, { children: R ? "Save failed" : "Saving dashboard" }),
1560
+ /* @__PURE__ */ e(Ds, { className: "pt-2", children: R ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
1533
1561
  ] }),
1534
- /* @__PURE__ */ e(Ns, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: R ? /* @__PURE__ */ a(O, { children: [
1562
+ /* @__PURE__ */ e(Cs, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: R ? /* @__PURE__ */ a(M, { children: [
1535
1563
  /* @__PURE__ */ e(
1536
- Ss,
1564
+ Ls,
1537
1565
  {
1538
1566
  onClick: () => {
1539
- C(!1), B(null), K(!1);
1567
+ D(!1), B(null), K(!1);
1540
1568
  },
1541
1569
  className: "m-0",
1542
1570
  children: "Close"
1543
1571
  }
1544
1572
  ),
1545
1573
  /* @__PURE__ */ e(
1546
- Ae,
1574
+ Oe,
1547
1575
  {
1548
- onClick: () => ye(),
1576
+ onClick: () => Ne(),
1549
1577
  className: "m-0",
1550
1578
  children: "Retry"
1551
1579
  }
1552
1580
  )
1553
1581
  ] }) : /* @__PURE__ */ a(
1554
- Ae,
1582
+ Oe,
1555
1583
  {
1556
1584
  disabled: !0,
1557
1585
  className: "m-0 cursor-default",
@@ -1565,12 +1593,12 @@ function Tt() {
1565
1593
  }
1566
1594
  ),
1567
1595
  /* @__PURE__ */ e(
1568
- Fa,
1596
+ at,
1569
1597
  {
1570
- open: js,
1571
- onOpenChange: te,
1572
- onSave: Bs,
1573
- onDiscard: Ks,
1598
+ open: Qs,
1599
+ onOpenChange: ne,
1600
+ onSave: ea,
1601
+ onDiscard: sa,
1574
1602
  isSaving: W
1575
1603
  }
1576
1604
  )
@@ -1580,5 +1608,5 @@ function Tt() {
1580
1608
  );
1581
1609
  }
1582
1610
  export {
1583
- Tt as default
1611
+ Wt as default
1584
1612
  };