react-semaphor 0.1.208 → 0.1.210

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