react-semaphor 0.1.116 → 0.1.118

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 (23) hide show
  1. package/dist/chunks/{dashboard-controls-CRc6gw-F.js → dashboard-controls-BKmKHD1C.js} +2 -2
  2. package/dist/chunks/{dashboard-controls-CqcS1J54.js → dashboard-controls-BsYwgzzV.js} +179 -178
  3. package/dist/chunks/{dashboard-json-BOlcQgKG.js → dashboard-json-BZoDNa7d.js} +1 -1
  4. package/dist/chunks/{dashboard-json-D-75FAgQ.js → dashboard-json-Ch63XtMS.js} +1 -1
  5. package/dist/chunks/{edit-dashboard-visual-COf6UbOg.js → edit-dashboard-visual-BaBGOIuS.js} +3 -3
  6. package/dist/chunks/{edit-dashboard-visual-tRQ806YP.js → edit-dashboard-visual-BlHtM8Mg.js} +1 -1
  7. package/dist/chunks/{editor-action-buttons-Bh-TPwiy.js → editor-action-buttons-DZJpRL7F.js} +2 -2
  8. package/dist/chunks/{editor-action-buttons-2B96j5tL.js → editor-action-buttons-HssR_HsW.js} +1 -1
  9. package/dist/chunks/{index-CRDKevb0.js → index-Bdmyshtr.js} +356 -362
  10. package/dist/chunks/{index-F4v-XjnM.js → index-BkHCymuV.js} +13 -13
  11. package/dist/chunks/{resource-management-panel-DtwM8NVN.js → resource-management-panel-BU4mYxms.js} +2 -2
  12. package/dist/chunks/{resource-management-panel-CwGyO8S9.js → resource-management-panel-Dd1hffVe.js} +1 -1
  13. package/dist/chunks/{schedule-dashboard-CtXspopT.js → schedule-dashboard-BNDsKqRE.js} +3 -3
  14. package/dist/chunks/{schedule-dashboard-DWh6NWL5.js → schedule-dashboard-Dzcd5W6f.js} +1 -1
  15. package/dist/chunks/{use-visual-utils-DyKq-_On.js → use-visual-utils-B7AakQrT.js} +1 -1
  16. package/dist/chunks/{use-visual-utils-Ce0Sq8Hn.js → use-visual-utils-ca50n3Fh.js} +1 -1
  17. package/dist/dashboard/index.cjs +1 -1
  18. package/dist/dashboard/index.js +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +4 -4
  21. package/dist/surfboard/index.cjs +1 -1
  22. package/dist/surfboard/index.js +1 -1
  23. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  import { jsxs as r, jsx as e, Fragment as P } from "react/jsx-runtime";
2
- import { b as J, bp as vs, bq as Ns, u as y, aC as Ce, aD as Se, B as M, aF as ke, aG as W, br as Me, g as Qe, aj as R, ao as oe, bs as ys, aP as Le, ap as ie, aq as le, ar as ce, as as Pe, at as te, bt as V, ax as Ve, I as _, bu as ws, aT as xs, bv as Ds, bw as qe, bx as He, c as X, by as Be, bz as Cs, bA as Ss, bB as ks, bC as Ms, bD as Ls, l as w, O as ze, h as de, bE as ue, bF as Ke, av as Ps, bG as As, L as H, aS as $, bH as Is, bI as Es, bJ as Fs, bK as We, bL as Je, bM as re, bN as ne, bm as be, a_ as ve, bO as Ne, aU as Xe, bP as ye, aw as Ye, aY as Ze, bQ as Ts, b1 as Gs, b2 as Rs, b3 as Os, b4 as Us, b5 as qs, b6 as zs, b7 as _s, b8 as $s, bR as js, aN as Qs, bh as Vs, bS as Hs, bT as Bs, f as _e, aA as se, bU as Ks, R as fe, bV as Ws, bW as Js, bX as Xs, bY as Ys, aQ as Zs, N as ea, bZ as sa, b_ as aa, b$ as ta, c0 as ra, J as na } from "./index-CRDKevb0.js";
2
+ import { b as J, bp as vs, bq as Ns, u as w, aC as Ce, aD as Se, B as M, aF as ke, aG as W, br as Me, g as Qe, aj as R, ao as oe, bs as ys, aP as Le, ap as ie, aq as le, ar as ce, as as Pe, at as te, bt as V, ax as Ve, I as _, bu as ws, aT as xs, bv as Ds, bw as qe, bx as He, c as X, by as Be, bz as Cs, bA as Ss, bB as ks, bC as Ms, bD as Ls, l as v, O as ze, h as de, bE as ue, bF as Ke, av as Ps, bG as As, L as H, aS as $, bH as Is, bI as Es, bJ as Fs, bK as We, bL as Je, bM as re, bN as ne, bm as be, a_ as ve, bO as Ne, aU as Xe, bP as ye, aw as Ye, aY as Ze, bQ as Ts, b1 as Gs, b2 as Rs, b3 as Os, b4 as Us, b5 as qs, b6 as zs, b7 as _s, b8 as $s, bR as js, aN as Qs, bh as Vs, bS as Hs, bT as Bs, f as _e, aA as se, bU as Ks, R as fe, bV as Ws, bW as Js, bX as Xs, bY as Ys, aQ as Zs, N as ea, bZ as sa, b_ as aa, b$ as ta, c0 as ra, J as na } from "./index-Bdmyshtr.js";
3
3
  import * as S from "react";
4
4
  import { useState as x, useMemo as ae, useEffect as oa } from "react";
5
5
  import "react-dom";
6
- import { g as we, A as ia, V as la, S as ca } from "./schedule-dashboard-CtXspopT.js";
7
- import { S as $e } from "./editor-action-buttons-Bh-TPwiy.js";
6
+ import { g as we, A as ia, V as la, S as ca } from "./schedule-dashboard-BNDsKqRE.js";
7
+ import { S as $e } from "./editor-action-buttons-DZJpRL7F.js";
8
8
  /**
9
9
  * @license lucide-react v0.453.0 - ISC
10
10
  *
@@ -74,7 +74,7 @@ const pa = J("Sun", [
74
74
  ]);
75
75
  var ga = vs();
76
76
  function fa() {
77
- const { setTheme: s } = Ns(), n = y(
77
+ const { setTheme: s } = Ns(), n = w(
78
78
  (a) => a.actions.setDashboardTheme
79
79
  );
80
80
  return /* @__PURE__ */ r(Ce, { children: [
@@ -129,8 +129,8 @@ function fa() {
129
129
  async function ba(s, n, a, t, i) {
130
130
  if (!i)
131
131
  return null;
132
- const o = JSON.stringify(a), l = `${s}/v1/lens`;
133
- return await Me(l, i, {
132
+ const o = JSON.stringify(a), c = `${s}/v1/lens`;
133
+ return await Me(c, i, {
134
134
  name: n,
135
135
  template: o,
136
136
  filterValues: t,
@@ -140,12 +140,12 @@ async function ba(s, n, a, t, i) {
140
140
  async function xe(s, n, a) {
141
141
  if (!a)
142
142
  return null;
143
- const { id: t, template: i, filterValues: o, isDefault: l, shared: m } = n, h = `${s}/v1/lens`;
143
+ const { id: t, template: i, filterValues: o, isDefault: c, shared: m } = n, h = `${s}/v1/lens`;
144
144
  return await Me(h, a, {
145
145
  lensId: t,
146
146
  template: i,
147
147
  filterValues: o,
148
- isDefault: l,
148
+ isDefault: c,
149
149
  shared: m,
150
150
  operation: "update"
151
151
  });
@@ -160,19 +160,19 @@ async function va(s, n, a) {
160
160
  });
161
161
  }
162
162
  function Na() {
163
- const [s, n] = x(""), [a, t] = x(!1), i = y((k) => k.lenses), { setLenses: o, setSelectedLensId: l } = Qe(), [m, h] = x(!1), [f, u] = x(!1), c = y((k) => k.dashboard), p = y((k) => k.filterValues), { authToken: b, tokenProps: v } = R();
163
+ const [s, n] = x(""), [a, t] = x(!1), i = w((k) => k.lenses), { setLenses: o, setSelectedLensId: c } = Qe(), [m, h] = x(!1), [f, u] = x(!1), d = w((k) => k.dashboard), p = w((k) => k.filterValues), { authToken: b, tokenProps: N } = R();
164
164
  async function D() {
165
165
  h(!0);
166
166
  const k = we(
167
- c
167
+ d
168
168
  ), A = await ba(
169
- v.apiServiceUrl,
169
+ N.apiServiceUrl,
170
170
  s,
171
171
  k,
172
172
  p,
173
173
  b == null ? void 0 : b.accessToken
174
174
  );
175
- A && (o([...i || [], A]), l(A.id), u(!1)), h(!1);
175
+ A && (o([...i || [], A]), c(A.id), u(!1)), h(!1);
176
176
  }
177
177
  return /* @__PURE__ */ r(oe, { open: f, onOpenChange: u, children: [
178
178
  /* @__PURE__ */ e(ys, { asChild: !0, children: /* @__PURE__ */ r(
@@ -222,37 +222,37 @@ function Na() {
222
222
  ] });
223
223
  }
224
224
  function ya() {
225
- const [s, n] = x(!1), a = y((c) => c.lenses), t = y((c) => c.selectedLensId), { setLenses: i, setSelectedLensId: o } = Qe(), { authToken: l, tokenProps: m } = R();
226
- async function h(c) {
227
- o(c);
225
+ const [s, n] = x(!1), a = w((d) => d.lenses), t = w((d) => d.selectedLensId), { setLenses: i, setSelectedLensId: o } = Qe(), { authToken: c, tokenProps: m } = R();
226
+ async function h(d) {
227
+ o(d);
228
228
  }
229
- async function f(c) {
230
- if (await va(m.apiServiceUrl, c, l == null ? void 0 : l.accessToken)) {
231
- const b = a == null ? void 0 : a.filter((v) => v.id !== c);
229
+ async function f(d) {
230
+ if (await va(m.apiServiceUrl, d, c == null ? void 0 : c.accessToken)) {
231
+ const b = a == null ? void 0 : a.filter((N) => N.id !== d);
232
232
  i(b || []), o("original");
233
233
  }
234
234
  }
235
- async function u(c) {
236
- const p = a == null ? void 0 : a.map((D) => D.id === c.id ? {
235
+ async function u(d) {
236
+ const p = a == null ? void 0 : a.map((D) => D.id === d.id ? {
237
237
  ...D,
238
- isDefault: !c.isDefault
238
+ isDefault: !d.isDefault
239
239
  } : {
240
240
  ...D,
241
241
  isDefault: !1
242
242
  });
243
243
  i(p || []);
244
244
  const b = {
245
- ...c,
246
- isDefault: !c.isDefault
245
+ ...d,
246
+ isDefault: !d.isDefault
247
247
  };
248
- await xe(m.apiServiceUrl, b, l == null ? void 0 : l.accessToken);
249
- const v = a == null ? void 0 : a.find((D) => D.isDefault);
250
- if (v && v.id !== c.id) {
248
+ await xe(m.apiServiceUrl, b, c == null ? void 0 : c.accessToken);
249
+ const N = a == null ? void 0 : a.find((D) => D.isDefault);
250
+ if (N && N.id !== d.id) {
251
251
  const D = {
252
- ...v,
252
+ ...N,
253
253
  isDefault: !1
254
254
  };
255
- await xe(m.apiServiceUrl, D, l == null ? void 0 : l.accessToken);
255
+ await xe(m.apiServiceUrl, D, c == null ? void 0 : c.accessToken);
256
256
  }
257
257
  }
258
258
  return /* @__PURE__ */ r(Ce, { open: s, onOpenChange: n, children: [
@@ -267,25 +267,25 @@ function ya() {
267
267
  onValueChange: h,
268
268
  children: [
269
269
  /* @__PURE__ */ e(qe, { value: "original", children: "Original" }),
270
- a == null ? void 0 : a.map((c) => /* @__PURE__ */ r(
270
+ a == null ? void 0 : a.map((d) => /* @__PURE__ */ r(
271
271
  qe,
272
272
  {
273
273
  className: "group flex justify-between gap-2",
274
- value: c.id,
274
+ value: d.id,
275
275
  children: [
276
- /* @__PURE__ */ e("p", { children: c.name }),
276
+ /* @__PURE__ */ e("p", { children: d.name }),
277
277
  /* @__PURE__ */ r("span", { className: "flex items-center gap-3", children: [
278
278
  /* @__PURE__ */ e(
279
279
  He,
280
280
  {
281
281
  onClick: (p) => {
282
- p.preventDefault(), u(c);
282
+ p.preventDefault(), u(d);
283
283
  },
284
284
  className: X(
285
285
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
286
286
  {
287
- invisible: !c.isDefault,
288
- "text-green-500": c.isDefault
287
+ invisible: !d.isDefault,
288
+ "text-green-500": d.isDefault
289
289
  }
290
290
  ),
291
291
  strokeWidth: 1.5
@@ -295,7 +295,7 @@ function ya() {
295
295
  Be,
296
296
  {
297
297
  onClick: (p) => {
298
- p.preventDefault(), f(c.id);
298
+ p.preventDefault(), f(d.id);
299
299
  },
300
300
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
301
301
  strokeWidth: 1.5
@@ -304,7 +304,7 @@ function ya() {
304
304
  ] })
305
305
  ]
306
306
  },
307
- c.id
307
+ d.id
308
308
  ))
309
309
  ]
310
310
  }
@@ -315,17 +315,17 @@ function ya() {
315
315
  function wa({
316
316
  iconClassName: s
317
317
  }) {
318
- const [n, a] = x(!1), [t, i] = x(""), [o, l] = x(!1), m = y((c) => c.isDownloadingPdf), { tokenProps: h } = R();
318
+ const [n, a] = x(!1), [t, i] = x(""), [o, c] = x(!1), m = w((d) => d.isDownloadingPdf), { tokenProps: h } = R();
319
319
  async function f() {
320
- const c = w.loading(
320
+ const d = v.loading(
321
321
  "Generating PDF... may take up to 60 seconds"
322
322
  );
323
323
  try {
324
- await ze(h.apiServiceUrl), w.dismiss(c), w.success("PDF downloaded successfully!", {
324
+ await ze(h.apiServiceUrl), v.dismiss(d), v.success("PDF downloaded successfully!", {
325
325
  duration: 2e3
326
326
  });
327
327
  } catch (p) {
328
- w.dismiss(c), w.error("Failed to download PDF", {
328
+ v.dismiss(d), v.error("Failed to download PDF", {
329
329
  description: "Please try again or contact support.",
330
330
  richColors: !0
331
331
  }), console.error("PDF download error:", p);
@@ -333,17 +333,17 @@ function wa({
333
333
  }
334
334
  async function u() {
335
335
  if (!t) return;
336
- a(!1), i(""), l(!1);
337
- const c = w.loading(
336
+ a(!1), i(""), c(!1);
337
+ const d = v.loading(
338
338
  "Generating protected PDF... may take up to 60 seconds"
339
339
  );
340
340
  try {
341
- await ze(h.apiServiceUrl, t), w.dismiss(c), w.success("Protected PDF downloaded successfully!", {
341
+ await ze(h.apiServiceUrl, t), v.dismiss(d), v.success("Protected PDF downloaded successfully!", {
342
342
  duration: 2e3,
343
343
  position: "top-right"
344
344
  });
345
345
  } catch (p) {
346
- w.dismiss(c), w.error("Failed to download protected PDF. Please try again."), console.error("Protected PDF download error:", p);
346
+ v.dismiss(d), v.error("Failed to download protected PDF. Please try again."), console.error("Protected PDF download error:", p);
347
347
  }
348
348
  }
349
349
  return /* @__PURE__ */ r(P, { children: [
@@ -388,11 +388,11 @@ function wa({
388
388
  id: "password",
389
389
  type: o ? "text" : "password",
390
390
  value: t,
391
- onChange: (c) => i(c.target.value),
391
+ onChange: (d) => i(d.target.value),
392
392
  placeholder: "Enter password",
393
393
  className: "pr-10",
394
- onKeyDown: (c) => {
395
- c.key === "Enter" && t && u();
394
+ onKeyDown: (d) => {
395
+ d.key === "Enter" && t && u();
396
396
  }
397
397
  }
398
398
  ),
@@ -403,7 +403,7 @@ function wa({
403
403
  variant: "ghost",
404
404
  size: "sm",
405
405
  className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
406
- onClick: () => l(!o),
406
+ onClick: () => c(!o),
407
407
  children: o ? /* @__PURE__ */ e(Ms, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ e(Ls, { className: "h-4 w-4 text-muted-foreground" })
408
408
  }
409
409
  )
@@ -452,8 +452,8 @@ const xa = async (s, n, a) => {
452
452
  body: JSON.stringify(t)
453
453
  });
454
454
  if (!o.ok) {
455
- const l = await o.text();
456
- throw new Error(l || "Failed to remove group members");
455
+ const c = await o.text();
456
+ throw new Error(c || "Failed to remove group members");
457
457
  }
458
458
  };
459
459
  function ka() {
@@ -461,10 +461,10 @@ function ka() {
461
461
  return ue({
462
462
  mutationFn: (t) => xa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
463
463
  onSuccess: () => {
464
- a.invalidateQueries({ queryKey: ["groups"] }), w.success("Group created successfully");
464
+ a.invalidateQueries({ queryKey: ["groups"] }), v.success("Group created successfully");
465
465
  },
466
466
  onError: (t) => {
467
- console.error("Failed to create group:", t), w.error("Failed to create group", {
467
+ console.error("Failed to create group:", t), v.error("Failed to create group", {
468
468
  description: t.message
469
469
  });
470
470
  }
@@ -475,10 +475,10 @@ function Ma() {
475
475
  return ue({
476
476
  mutationFn: (t) => Da(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
477
477
  onSuccess: (t, i) => {
478
- a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", i] }), w.success("Group deleted successfully");
478
+ a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", i] }), v.success("Group deleted successfully");
479
479
  },
480
480
  onError: (t) => {
481
- console.error("Failed to delete group:", t), w.error("Failed to delete group", {
481
+ console.error("Failed to delete group:", t), v.error("Failed to delete group", {
482
482
  description: t.message
483
483
  });
484
484
  }
@@ -494,10 +494,10 @@ function La() {
494
494
  onSuccess: (t, i) => {
495
495
  a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
496
496
  queryKey: ["group-members", i.groupId]
497
- }), a.invalidateQueries({ queryKey: ["groups"] }), w.success("Members added successfully");
497
+ }), a.invalidateQueries({ queryKey: ["groups"] }), v.success("Members added successfully");
498
498
  },
499
499
  onError: (t) => {
500
- console.error("Failed to add group members:", t), w.error("Failed to add members", {
500
+ console.error("Failed to add group members:", t), v.error("Failed to add members", {
501
501
  description: t.message
502
502
  });
503
503
  }
@@ -513,10 +513,10 @@ function Pa() {
513
513
  onSuccess: (t, i) => {
514
514
  a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
515
515
  queryKey: ["group-members", i.groupId]
516
- }), a.invalidateQueries({ queryKey: ["groups"] }), w.success("Members removed successfully");
516
+ }), a.invalidateQueries({ queryKey: ["groups"] }), v.success("Members removed successfully");
517
517
  },
518
518
  onError: (t) => {
519
- console.error("Failed to remove group members:", t), w.error("Failed to remove members", {
519
+ console.error("Failed to remove group members:", t), v.error("Failed to remove members", {
520
520
  description: t.message
521
521
  });
522
522
  }
@@ -527,7 +527,7 @@ function Aa({
527
527
  tenantId: n,
528
528
  isTenantUser: a
529
529
  }) {
530
- const [t, i] = x(""), [o, l] = x(""), [m, h] = x({}), f = ka(), u = () => {
530
+ const [t, i] = x(""), [o, c] = x(""), [m, h] = x({}), f = ka(), u = () => {
531
531
  const p = {};
532
532
  return t.trim() ? t.length < 3 ? p.name = "Group name must be at least 3 characters" : t.length > 50 && (p.name = "Group name must be less than 50 characters") : p.name = "Group name is required", o && o.length > 200 && (p.description = "Description must be less than 200 characters"), h(p), Object.keys(p).length === 0;
533
533
  };
@@ -540,9 +540,9 @@ function Aa({
540
540
  ...a && n ? { tenantId: n } : {}
541
541
  };
542
542
  try {
543
- await f.mutateAsync(b), i(""), l(""), h({}), s();
544
- } catch (v) {
545
- console.error("Failed to create group:", v);
543
+ await f.mutateAsync(b), i(""), c(""), h({}), s();
544
+ } catch (N) {
545
+ console.error("Failed to create group:", N);
546
546
  }
547
547
  }, className: "space-y-6", children: [
548
548
  /* @__PURE__ */ r("div", { className: "space-y-4", children: [
@@ -578,7 +578,7 @@ function Aa({
578
578
  placeholder: "Describe the purpose of this group...",
579
579
  value: o,
580
580
  onChange: (p) => {
581
- l(p.target.value), m.description && h((b) => ({ ...b, description: "" }));
581
+ c(p.target.value), m.description && h((b) => ({ ...b, description: "" }));
582
582
  },
583
583
  className: m.description ? "border-destructive" : "",
584
584
  disabled: f.isPending,
@@ -603,7 +603,7 @@ function Aa({
603
603
  type: "button",
604
604
  variant: "outline",
605
605
  onClick: () => {
606
- i(""), l(""), h({});
606
+ i(""), c(""), h({});
607
607
  },
608
608
  disabled: f.isPending,
609
609
  children: "Clear"
@@ -628,26 +628,26 @@ function Aa({
628
628
  }
629
629
  function Ia(s, n = []) {
630
630
  let a = [];
631
- function t(o, l) {
632
- const m = S.createContext(l), h = a.length;
633
- a = [...a, l];
634
- const f = (c) => {
631
+ function t(o, c) {
632
+ const m = S.createContext(c), h = a.length;
633
+ a = [...a, c];
634
+ const f = (d) => {
635
635
  var A;
636
- const { scope: p, children: b, ...v } = c, D = ((A = p == null ? void 0 : p[s]) == null ? void 0 : A[h]) || m, k = S.useMemo(() => v, Object.values(v));
636
+ const { scope: p, children: b, ...N } = d, D = ((A = p == null ? void 0 : p[s]) == null ? void 0 : A[h]) || m, k = S.useMemo(() => N, Object.values(N));
637
637
  return /* @__PURE__ */ e(D.Provider, { value: k, children: b });
638
638
  };
639
639
  f.displayName = o + "Provider";
640
- function u(c, p) {
640
+ function u(d, p) {
641
641
  var D;
642
- const b = ((D = p == null ? void 0 : p[s]) == null ? void 0 : D[h]) || m, v = S.useContext(b);
643
- if (v) return v;
644
- if (l !== void 0) return l;
645
- throw new Error(`\`${c}\` must be used within \`${o}\``);
642
+ const b = ((D = p == null ? void 0 : p[s]) == null ? void 0 : D[h]) || m, N = S.useContext(b);
643
+ if (N) return N;
644
+ if (c !== void 0) return c;
645
+ throw new Error(`\`${d}\` must be used within \`${o}\``);
646
646
  }
647
647
  return [f, u];
648
648
  }
649
649
  const i = () => {
650
- const o = a.map((l) => S.createContext(l));
650
+ const o = a.map((c) => S.createContext(c));
651
651
  return function(m) {
652
652
  const h = (m == null ? void 0 : m[s]) || o;
653
653
  return S.useMemo(
@@ -667,11 +667,11 @@ function Ea(...s) {
667
667
  scopeName: i.scopeName
668
668
  }));
669
669
  return function(o) {
670
- const l = t.reduce((m, { useScope: h, scopeName: f }) => {
671
- const c = h(o)[`__scope${f}`];
672
- return { ...m, ...c };
670
+ const c = t.reduce((m, { useScope: h, scopeName: f }) => {
671
+ const d = h(o)[`__scope${f}`];
672
+ return { ...m, ...d };
673
673
  }, {});
674
- return S.useMemo(() => ({ [`__scope${n.scopeName}`]: l }), [l]);
674
+ return S.useMemo(() => ({ [`__scope${n.scopeName}`]: c }), [c]);
675
675
  };
676
676
  };
677
677
  return a.scopeName = n.scopeName, a;
@@ -706,7 +706,7 @@ var De = globalThis != null && globalThis.document ? S.useLayoutEffect : () => {
706
706
  "ul"
707
707
  ], Ae = Ta.reduce((s, n) => {
708
708
  const a = Is(`Primitive.${n}`), t = S.forwardRef((i, o) => {
709
- const { asChild: l, ...m } = i, h = l ? a : n;
709
+ const { asChild: c, ...m } = i, h = c ? a : n;
710
710
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(h, { ...m, ref: o });
711
711
  });
712
712
  return t.displayName = `Primitive.${n}`, { ...s, [n]: t };
@@ -740,8 +740,8 @@ ss.displayName = Ie;
740
740
  var as = "AvatarImage", ts = S.forwardRef(
741
741
  (s, n) => {
742
742
  const { __scopeAvatar: a, src: t, onLoadingStatusChange: i = () => {
743
- }, ...o } = s, l = es(as, a), m = qa(t, o), h = Fa((f) => {
744
- i(f), l.onImageLoadingStatusChange(f);
743
+ }, ...o } = s, c = es(as, a), m = qa(t, o), h = Fa((f) => {
744
+ i(f), c.onImageLoadingStatusChange(f);
745
745
  });
746
746
  return De(() => {
747
747
  m !== "idle" && h(m);
@@ -751,13 +751,13 @@ var as = "AvatarImage", ts = S.forwardRef(
751
751
  ts.displayName = as;
752
752
  var rs = "AvatarFallback", ns = S.forwardRef(
753
753
  (s, n) => {
754
- const { __scopeAvatar: a, delayMs: t, ...i } = s, o = es(rs, a), [l, m] = S.useState(t === void 0);
754
+ const { __scopeAvatar: a, delayMs: t, ...i } = s, o = es(rs, a), [c, m] = S.useState(t === void 0);
755
755
  return S.useEffect(() => {
756
756
  if (t !== void 0) {
757
757
  const h = window.setTimeout(() => m(!0), t);
758
758
  return () => window.clearTimeout(h);
759
759
  }
760
- }, [t]), l && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Ae.span, { ...i, ref: n }) : null;
760
+ }, [t]), c && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Ae.span, { ...i, ref: n }) : null;
761
761
  }
762
762
  );
763
763
  ns.displayName = rs;
@@ -765,21 +765,21 @@ function je(s, n) {
765
765
  return s ? n ? (s.src !== n && (s.src = n), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
766
766
  }
767
767
  function qa(s, { referrerPolicy: n, crossOrigin: a }) {
768
- const t = Ga(), i = S.useRef(null), o = t ? (i.current || (i.current = new window.Image()), i.current) : null, [l, m] = S.useState(
768
+ const t = Ga(), i = S.useRef(null), o = t ? (i.current || (i.current = new window.Image()), i.current) : null, [c, m] = S.useState(
769
769
  () => je(o, s)
770
770
  );
771
771
  return De(() => {
772
772
  m(je(o, s));
773
773
  }, [o, s]), De(() => {
774
- const h = (c) => () => {
775
- m(c);
774
+ const h = (d) => () => {
775
+ m(d);
776
776
  };
777
777
  if (!o) return;
778
778
  const f = h("loaded"), u = h("error");
779
779
  return o.addEventListener("load", f), o.addEventListener("error", u), n && (o.referrerPolicy = n), typeof a == "string" && (o.crossOrigin = a), () => {
780
780
  o.removeEventListener("load", f), o.removeEventListener("error", u);
781
781
  };
782
- }, [o, a, n]), l;
782
+ }, [o, a, n]), c;
783
783
  }
784
784
  var os = ss, is = ts, ls = ns;
785
785
  const Ee = S.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
@@ -821,30 +821,30 @@ function _a({
821
821
  group: a,
822
822
  onUpdate: t
823
823
  }) {
824
- const [i, o] = x("members"), [l, m] = x(""), [h, f] = x([]), [u, c] = x([]), { data: p, isLoading: b, refetch: v } = Es(a.id), D = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: k, isLoading: A } = Fs({
824
+ const [i, o] = x("members"), [c, m] = x(""), [h, f] = x([]), [u, d] = x([]), { data: p, isLoading: b, refetch: N } = Es(a.id), D = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: k, isLoading: A } = Fs({
825
825
  type: D,
826
826
  tenantId: a.tenantId || void 0,
827
827
  active: !0,
828
828
  limit: 100
829
- }), O = La(), G = Pa(), I = (p == null ? void 0 : p.members) || [], j = ae(() => new Set(I.map((g) => g.userId)), [I]), N = ae(() => k.filter((g) => !j.has(g.id)), [k, j]), T = ae(() => {
830
- if (!l) return N;
831
- const g = l.toLowerCase();
832
- return N.filter(
829
+ }), O = La(), G = Pa(), I = (p == null ? void 0 : p.members) || [], j = ae(() => new Set(I.map((g) => g.userId)), [I]), y = ae(() => k.filter((g) => !j.has(g.id)), [k, j]), T = ae(() => {
830
+ if (!c) return y;
831
+ const g = c.toLowerCase();
832
+ return y.filter(
833
833
  (L) => {
834
834
  var E, q;
835
835
  return ((E = L.name) == null ? void 0 : E.toLowerCase().includes(g)) || ((q = L.email) == null ? void 0 : q.toLowerCase().includes(g));
836
836
  }
837
837
  );
838
- }, [N, l]), C = ae(() => {
839
- if (!l) return I;
840
- const g = l.toLowerCase();
838
+ }, [y, c]), C = ae(() => {
839
+ if (!c) return I;
840
+ const g = c.toLowerCase();
841
841
  return I.filter(
842
842
  (L) => {
843
843
  var E, q, Y, z;
844
844
  return ((q = (E = L.user) == null ? void 0 : E.name) == null ? void 0 : q.toLowerCase().includes(g)) || ((z = (Y = L.user) == null ? void 0 : Y.email) == null ? void 0 : z.toLowerCase().includes(g));
845
845
  }
846
846
  );
847
- }, [I, l]), U = async () => {
847
+ }, [I, c]), U = async () => {
848
848
  if (h.length !== 0)
849
849
  try {
850
850
  await O.mutateAsync({
@@ -853,7 +853,7 @@ function _a({
853
853
  userIds: h,
854
854
  userType: D === "tenant" ? "tenant" : "org"
855
855
  }
856
- }), f([]), o("members"), v(), t == null || t();
856
+ }), f([]), o("members"), N(), t == null || t();
857
857
  } catch (g) {
858
858
  console.error("Failed to add members:", g);
859
859
  }
@@ -865,7 +865,7 @@ function _a({
865
865
  data: {
866
866
  userIds: u
867
867
  }
868
- }), c([]), v(), t == null || t();
868
+ }), d([]), N(), t == null || t();
869
869
  } catch (g) {
870
870
  console.error("Failed to remove members:", g);
871
871
  }
@@ -874,7 +874,7 @@ function _a({
874
874
  (L) => L.includes(g) ? L.filter((E) => E !== g) : [...L, g]
875
875
  );
876
876
  }, B = (g) => {
877
- c(
877
+ d(
878
878
  (L) => L.includes(g) ? L.filter((E) => E !== g) : [...L, g]
879
879
  );
880
880
  };
@@ -893,7 +893,7 @@ function _a({
893
893
  ] })
894
894
  ] }),
895
895
  /* @__PURE__ */ r(We, { value: i, onValueChange: (g) => {
896
- o(g), m(""), c([]);
896
+ o(g), m(""), d([]);
897
897
  }, className: "mt-4", children: [
898
898
  /* @__PURE__ */ r(Je, { className: "grid w-full grid-cols-2", children: [
899
899
  /* @__PURE__ */ e(re, { value: "members", children: "Current Members" }),
@@ -906,7 +906,7 @@ function _a({
906
906
  V,
907
907
  {
908
908
  placeholder: "Search members...",
909
- value: l,
909
+ value: c,
910
910
  onChange: (g) => m(g.target.value),
911
911
  className: "pl-10"
912
912
  }
@@ -914,8 +914,8 @@ function _a({
914
914
  ] }),
915
915
  /* @__PURE__ */ e(ve, { className: u.length > 0 ? "h-[300px]" : "h-[350px]", children: b ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ne, { className: "h-16 w-full" }, g)) }) : C.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
916
916
  /* @__PURE__ */ e($, { className: "h-12 w-12 mb-3 opacity-50" }),
917
- /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: l ? "No members found" : "No members yet" }),
918
- /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
917
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: c ? "No members found" : "No members yet" }),
918
+ /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: c ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
919
919
  ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: C.map((g) => /* @__PURE__ */ e(
920
920
  $a,
921
921
  {
@@ -957,7 +957,7 @@ function _a({
957
957
  V,
958
958
  {
959
959
  placeholder: "Search users to add...",
960
- value: l,
960
+ value: c,
961
961
  onChange: (g) => m(g.target.value),
962
962
  className: "pl-10"
963
963
  }
@@ -966,7 +966,7 @@ function _a({
966
966
  /* @__PURE__ */ e(ve, { className: "h-[300px]", children: A ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ne, { className: "h-16 w-full" }, g)) }) : T.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
967
967
  /* @__PURE__ */ e(ye, { className: "h-12 w-12 mb-3 opacity-50" }),
968
968
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
969
- /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "All eligible users are already members" })
969
+ /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: c ? "Try a different search" : "All eligible users are already members" })
970
970
  ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: T.map((g) => /* @__PURE__ */ e(
971
971
  ja,
972
972
  {
@@ -1007,7 +1007,7 @@ function $a({
1007
1007
  selected: n,
1008
1008
  onToggle: a
1009
1009
  }) {
1010
- var i, o, l, m;
1010
+ var i, o, c, m;
1011
1011
  const t = ((o = (i = s.user) == null ? void 0 : i.name) == null ? void 0 : o.split(" ").map((h) => h[0]).join("").toUpperCase()) || "?";
1012
1012
  return /* @__PURE__ */ r(
1013
1013
  "div",
@@ -1018,7 +1018,7 @@ function $a({
1018
1018
  /* @__PURE__ */ e(Ye, { checked: n }),
1019
1019
  /* @__PURE__ */ e(Ee, { className: "h-8 w-8", children: /* @__PURE__ */ e(Fe, { className: "text-xs", children: t }) }),
1020
1020
  /* @__PURE__ */ r("div", { className: "flex-1", children: [
1021
- /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((l = s.user) == null ? void 0 : l.name) || "Unknown User" }),
1021
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((c = s.user) == null ? void 0 : c.name) || "Unknown User" }),
1022
1022
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (m = s.user) == null ? void 0 : m.email })
1023
1023
  ] })
1024
1024
  ]
@@ -1052,7 +1052,7 @@ function Qa({
1052
1052
  open: s,
1053
1053
  onOpenChange: n
1054
1054
  }) {
1055
- const [a, t] = x("groups"), [i, o] = x(""), [l, m] = x(null), [h, f] = x(!1), [u, c] = x(null), { tokenProps: p } = R(), { currentUser: b } = Ze(), v = Ma(), D = (b == null ? void 0 : b.type) === "tenant", k = p == null ? void 0 : p.tenantId, { groups: A, isLoading: O, refetch: G } = Ts({
1055
+ const [a, t] = x("groups"), [i, o] = x(""), [c, m] = x(null), [h, f] = x(!1), [u, d] = x(null), { tokenProps: p } = R(), { currentUser: b } = Ze(), N = Ma(), D = (b == null ? void 0 : b.type) === "tenant", k = p == null ? void 0 : p.tenantId, { groups: A, isLoading: O, refetch: G } = Ts({
1056
1056
  type: D ? "TENANT_GROUP" : "all",
1057
1057
  tenantId: D ? k : void 0,
1058
1058
  includeMembers: !1
@@ -1064,11 +1064,11 @@ function Qa({
1064
1064
  ), j = async () => {
1065
1065
  if (u)
1066
1066
  try {
1067
- await v.mutateAsync(u.id), c(null), G();
1067
+ await N.mutateAsync(u.id), d(null), G();
1068
1068
  } catch (C) {
1069
1069
  console.error("Failed to delete group:", C);
1070
1070
  }
1071
- }, N = (C) => {
1071
+ }, y = (C) => {
1072
1072
  m(C), f(!0);
1073
1073
  }, T = () => {
1074
1074
  t("groups"), G();
@@ -1114,8 +1114,8 @@ function Qa({
1114
1114
  Va,
1115
1115
  {
1116
1116
  group: C,
1117
- onManageMembers: () => N(C),
1118
- onDelete: () => c(C),
1117
+ onManageMembers: () => y(C),
1118
+ onDelete: () => d(C),
1119
1119
  currentUserId: b == null ? void 0 : b.id
1120
1120
  },
1121
1121
  C.id
@@ -1131,12 +1131,12 @@ function Qa({
1131
1131
  ) })
1132
1132
  ] })
1133
1133
  ] }) }),
1134
- l && /* @__PURE__ */ e(
1134
+ c && /* @__PURE__ */ e(
1135
1135
  _a,
1136
1136
  {
1137
1137
  open: h,
1138
1138
  onOpenChange: f,
1139
- group: l,
1139
+ group: c,
1140
1140
  onUpdate: () => G()
1141
1141
  }
1142
1142
  ),
@@ -1144,7 +1144,7 @@ function Qa({
1144
1144
  Gs,
1145
1145
  {
1146
1146
  open: !!u,
1147
- onOpenChange: () => c(null),
1147
+ onOpenChange: () => d(null),
1148
1148
  children: /* @__PURE__ */ r(Rs, { children: [
1149
1149
  /* @__PURE__ */ r(Os, { children: [
1150
1150
  /* @__PURE__ */ e(Us, { children: "Delete Group" }),
@@ -1160,9 +1160,9 @@ function Qa({
1160
1160
  $s,
1161
1161
  {
1162
1162
  onClick: j,
1163
- disabled: v.isPending,
1163
+ disabled: N.isPending,
1164
1164
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1165
- children: v.isPending ? /* @__PURE__ */ r(P, { children: [
1165
+ children: N.isPending ? /* @__PURE__ */ r(P, { children: [
1166
1166
  /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
1167
1167
  "Deleting..."
1168
1168
  ] }) : "Delete Group"
@@ -1231,99 +1231,99 @@ function Za() {
1231
1231
  authToken: s,
1232
1232
  tokenProps: n,
1233
1233
  id: a
1234
- } = R(), { isLocalDev: t } = Qs(), { permissions: i } = Vs(), o = Hs(), { isLoading: l } = Bs();
1235
- y((d) => d.theme);
1236
- const m = y((d) => d.lenses), h = y((d) => d.selectedLensId), f = m == null ? void 0 : m.find((d) => d.id === h), u = y((d) => d.dashboard);
1237
- y((d) => d.selectedSheetId);
1238
- const c = y(
1239
- (d) => d.isDashboardEditing
1240
- ), { setDashboardTitle: p } = y((d) => d.actions), [b, v] = x(!1), [D, k] = x(!1), [A, O] = x(!1), G = y((d) => d.isDashboardPanelOpen), I = y(
1241
- (d) => d.actions.setIsDashboardPanelOpen
1242
- ), j = y((d) => d.filterValues), N = y((d) => d.isVisualEditing);
1243
- _e((d) => d.card);
1234
+ } = R(), { isLocalDev: t } = Qs(), { permissions: i } = Vs(), o = Hs(), { isLoading: c } = Bs();
1235
+ w((l) => l.theme);
1236
+ const m = w((l) => l.lenses), h = w((l) => l.selectedLensId), f = m == null ? void 0 : m.find((l) => l.id === h), u = w((l) => l.dashboard);
1237
+ w((l) => l.selectedSheetId);
1238
+ const d = w(
1239
+ (l) => l.isDashboardEditing
1240
+ ), { setDashboardTitle: p } = w((l) => l.actions), [b, N] = x(!1), [D, k] = x(!1), [A, O] = x(!1), G = w((l) => l.isDashboardPanelOpen), I = w(
1241
+ (l) => l.actions.setIsDashboardPanelOpen
1242
+ ), j = w((l) => l.filterValues), y = w((l) => l.isVisualEditing);
1243
+ _e((l) => l.card);
1244
1244
  const T = se(
1245
- (d) => d.selectedDashboard
1245
+ (l) => l.selectedDashboard
1246
1246
  ), C = se(
1247
- (d) => d.initialDashboard
1247
+ (l) => l.initialDashboard
1248
1248
  );
1249
- se((d) => d.selectedVisual), y((d) => d.selectedFrameId), _e((d) => d.frame);
1250
- const U = T ? (Oe = T == null ? void 0 : T.permissions) == null ? void 0 : Oe.canEdit : (Re = C == null ? void 0 : C.permissions) == null ? void 0 : Re.canEdit, me = y((d) => d.showFilters), he = y(
1251
- (d) => d.showDashboardJSON
1252
- ), B = y((d) => d.onSaveFunction), g = y(
1253
- (d) => d.actions.setShowFilters
1254
- ), { setIsDashboardEditing: L, setShowDashboardJSON: E } = y(
1255
- (d) => d.actions
1249
+ se((l) => l.selectedVisual), w((l) => l.selectedFrameId), _e((l) => l.frame);
1250
+ const U = T ? (Oe = T == null ? void 0 : T.permissions) == null ? void 0 : Oe.canEdit : (Re = C == null ? void 0 : C.permissions) == null ? void 0 : Re.canEdit, me = w((l) => l.showFilters), he = w(
1251
+ (l) => l.showDashboardJSON
1252
+ ), B = w((l) => l.onSaveFunction), g = w(
1253
+ (l) => l.actions.setShowFilters
1254
+ ), { setIsDashboardEditing: L, setShowDashboardJSON: E } = w(
1255
+ (l) => l.actions
1256
1256
  ), { setInitialDashboard: q, clearSelectedDashboard: Y } = se(
1257
- (d) => d.actions
1257
+ (l) => l.actions
1258
1258
  ), { resources: z } = Ks(fe.DASHBOARD), { currentUser: cs } = Ze(), ds = Ws(cs), Q = T || C, Te = Q ? {
1259
1259
  id: Q.id,
1260
1260
  title: (u == null ? void 0 : u.title) || Q.title || "Dashboard"
1261
- } : null, { handleAddNewFrame: us } = Js(), [pe, ge] = x(!1), Z = Xs(fe.DASHBOARD), ms = async (d, F) => {
1261
+ } : null, { handleAddNewFrame: us } = Js(), [pe, ge] = x(!1), Z = Xs(fe.DASHBOARD), ms = async (l, F) => {
1262
1262
  if (!(u != null && u.id)) {
1263
1263
  console.log("No dashboard ID found");
1264
1264
  return;
1265
1265
  }
1266
1266
  console.log("Updating dashboard title:", {
1267
1267
  dashboardId: u.id,
1268
- newTitle: d,
1268
+ newTitle: l,
1269
1269
  previousTitle: F
1270
1270
  }), Z.mutate(
1271
1271
  {
1272
1272
  resourceId: u.id,
1273
- data: { title: d }
1273
+ data: { title: l }
1274
1274
  },
1275
1275
  {
1276
1276
  onSuccess: () => {
1277
- console.log("Dashboard title updated successfully"), w.success("Dashboard title updated");
1277
+ console.log("Dashboard title updated successfully"), v.success("Dashboard title updated");
1278
1278
  },
1279
1279
  onError: (K) => {
1280
- console.error("Failed to update dashboard title:", K), w.error("Failed to update dashboard title"), p(F);
1280
+ console.error("Failed to update dashboard title:", K), v.error("Failed to update dashboard title"), p(F);
1281
1281
  }
1282
1282
  }
1283
1283
  );
1284
1284
  };
1285
1285
  oa(() => {
1286
1286
  if (z && z.length > 0) {
1287
- const d = u == null ? void 0 : u.id;
1288
- if (d) {
1287
+ const l = u == null ? void 0 : u.id;
1288
+ if (l) {
1289
1289
  const F = z.find(
1290
- (K) => K.id === d
1290
+ (K) => K.id === l
1291
1291
  );
1292
1292
  F && q(F);
1293
1293
  }
1294
1294
  }
1295
1295
  }, [z, u == null ? void 0 : u.id, q]);
1296
- const ee = n.orgUserId || n.tenantId, hs = c && !N && ee && U, ps = () => {
1296
+ const ee = n.orgUserId || n.tenantId, hs = d && !y && ee && U, ps = () => {
1297
1297
  L(!0);
1298
1298
  };
1299
1299
  async function gs() {
1300
- const d = we(
1300
+ const l = we(
1301
1301
  u
1302
1302
  );
1303
1303
  ge(!0);
1304
1304
  const F = {
1305
- template: d
1305
+ template: l
1306
1306
  };
1307
1307
  Z.mutate(
1308
1308
  {
1309
- resourceId: d.id,
1309
+ resourceId: l.id,
1310
1310
  data: F
1311
1311
  },
1312
1312
  {
1313
1313
  onSuccess: () => {
1314
- ge(!1), w.success("Dashboard saved!");
1314
+ ge(!1), v.success("Dashboard saved!");
1315
1315
  },
1316
1316
  onError: () => {
1317
- ge(!1), w.error("Failed to save dashboard");
1317
+ ge(!1), v.error("Failed to save dashboard");
1318
1318
  }
1319
1319
  }
1320
1320
  );
1321
1321
  }
1322
1322
  async function fs() {
1323
- if (v(!0), !h || !f) return;
1324
- const d = we(
1323
+ if (N(!0), !h || !f) return;
1324
+ const l = we(
1325
1325
  u
1326
- ), F = JSON.stringify(d), K = {
1326
+ ), F = JSON.stringify(l), K = {
1327
1327
  ...f,
1328
1328
  template: F,
1329
1329
  filterValues: j
@@ -1332,7 +1332,7 @@ function Za() {
1332
1332
  n.apiServiceUrl,
1333
1333
  K,
1334
1334
  s == null ? void 0 : s.accessToken
1335
- ), w.success("Lens saved"), B == null || B(d), v(!1);
1335
+ ), v.success("Lens saved"), B == null || B(l), N(!1);
1336
1336
  }
1337
1337
  const Ge = (f == null ? void 0 : f.name) || u.title;
1338
1338
  Z.isPending && console.log("Title during update:", {
@@ -1362,7 +1362,7 @@ function Za() {
1362
1362
  children: /* @__PURE__ */ e(ua, { className: "h-4 w-4" })
1363
1363
  }
1364
1364
  ),
1365
- o && !N && /* @__PURE__ */ e(
1365
+ o && !y && /* @__PURE__ */ e(
1366
1366
  _,
1367
1367
  {
1368
1368
  "aria-label": "Dashboard Hub",
@@ -1373,21 +1373,21 @@ function Za() {
1373
1373
  }
1374
1374
  )
1375
1375
  ] }),
1376
- !N && o && (l ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1376
+ !y && o && (c ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1377
1377
  /* @__PURE__ */ e(H, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
1378
1378
  /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
1379
1379
  ] }) : /* @__PURE__ */ e(
1380
1380
  Ys,
1381
1381
  {
1382
1382
  value: Ge || "Untitled Dashboard",
1383
- onSave: (d) => {
1383
+ onSave: (l) => {
1384
1384
  console.log("EditableText onSave called:", {
1385
- newTitle: d,
1385
+ newTitle: l,
1386
1386
  canEditDashboard: U,
1387
1387
  dashboardId: u == null ? void 0 : u.id
1388
1388
  });
1389
1389
  const F = (u == null ? void 0 : u.title) || "";
1390
- p(d), ms(d, F);
1390
+ p(l), ms(l, F);
1391
1391
  },
1392
1392
  isEditable: U && !f,
1393
1393
  displayClassName: "text-sm font-medium",
@@ -1398,17 +1398,18 @@ function Za() {
1398
1398
  ))
1399
1399
  ] }),
1400
1400
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1401
- N && /* @__PURE__ */ r(P, { children: [
1401
+ y && /* @__PURE__ */ r(P, { children: [
1402
1402
  /* @__PURE__ */ e(ia, { className: "mr-2" }),
1403
1403
  /* @__PURE__ */ e(la, { className: "h-7" })
1404
1404
  ] }),
1405
- t && !N && /* @__PURE__ */ r(P, { children: [
1405
+ t && !y && /* @__PURE__ */ r(P, { children: [
1406
1406
  /* @__PURE__ */ e(
1407
1407
  _,
1408
1408
  {
1409
1409
  tooltip: "Copy Token",
1410
1410
  onClick: () => {
1411
- s != null && s.accessToken && (navigator.clipboard.writeText(s.accessToken), w.success("Token copied to clipboard"));
1411
+ var l;
1412
+ s != null && s.accessToken && ((l = navigator == null ? void 0 : navigator.clipboard) != null && l.writeText ? navigator.clipboard.writeText(s.accessToken).then(() => v.success("Token copied to clipboard")).catch(() => v.error("Unable to copy token")) : v.error("Clipboard not available"));
1412
1413
  },
1413
1414
  className: "h-7 p-2",
1414
1415
  children: /* @__PURE__ */ e(Zs, { className: "h-4 w-4" })
@@ -1424,9 +1425,9 @@ function Za() {
1424
1425
  }
1425
1426
  )
1426
1427
  ] }),
1427
- !N && o && /* @__PURE__ */ e(wa, {}),
1428
- !N && o && /* @__PURE__ */ e(ca, {}),
1429
- !N && o && ds && /* @__PURE__ */ e(
1428
+ !y && o && /* @__PURE__ */ e(wa, {}),
1429
+ !y && o && /* @__PURE__ */ e(ca, {}),
1430
+ !y && o && ds && /* @__PURE__ */ e(
1430
1431
  _,
1431
1432
  {
1432
1433
  tooltip: "Manage Groups",
@@ -1435,7 +1436,7 @@ function Za() {
1435
1436
  children: /* @__PURE__ */ e($, { className: "h-4 w-4" })
1436
1437
  }
1437
1438
  ),
1438
- !N && o && ((Ue = Q == null ? void 0 : Q.permissions) == null ? void 0 : Ue.canShare) && /* @__PURE__ */ e(
1439
+ !y && o && ((Ue = Q == null ? void 0 : Q.permissions) == null ? void 0 : Ue.canShare) && /* @__PURE__ */ e(
1439
1440
  _,
1440
1441
  {
1441
1442
  tooltip: "Share Dashboard",
@@ -1444,7 +1445,7 @@ function Za() {
1444
1445
  children: /* @__PURE__ */ e(sa, { className: "h-4 w-4" })
1445
1446
  }
1446
1447
  ),
1447
- !me && !N && c && i.canUseFilters && o && /* @__PURE__ */ e(
1448
+ !me && !y && d && i.canUseFilters && o && /* @__PURE__ */ e(
1448
1449
  M,
1449
1450
  {
1450
1451
  className: "h-7 p-2",
@@ -1454,9 +1455,9 @@ function Za() {
1454
1455
  children: /* @__PURE__ */ e(aa, { className: "h-4 w-4" })
1455
1456
  }
1456
1457
  ),
1457
- c && !N && ee && t && o && /* @__PURE__ */ e(Na, {}),
1458
- !N && ee && t && o && /* @__PURE__ */ e(ya, {}),
1459
- c && !N && ee && f && t && o && /* @__PURE__ */ r(
1458
+ d && !y && ee && t && o && /* @__PURE__ */ e(Na, {}),
1459
+ !y && ee && t && o && /* @__PURE__ */ e(ya, {}),
1460
+ d && !y && ee && f && t && o && /* @__PURE__ */ r(
1460
1461
  M,
1461
1462
  {
1462
1463
  className: "h-7 p-2",
@@ -1470,13 +1471,13 @@ function Za() {
1470
1471
  ]
1471
1472
  }
1472
1473
  ),
1473
- c && !N && o && /* @__PURE__ */ r(
1474
+ d && !y && o && /* @__PURE__ */ r(
1474
1475
  M,
1475
1476
  {
1476
1477
  variant: "outline",
1477
1478
  className: "h-7 p-2",
1478
1479
  size: "sm",
1479
- disabled: !c,
1480
+ disabled: !d,
1480
1481
  onClick: () => us(),
1481
1482
  children: [
1482
1483
  /* @__PURE__ */ e(Le, { className: "mr-2 h-4 w-4" }),
@@ -1484,7 +1485,7 @@ function Za() {
1484
1485
  ]
1485
1486
  }
1486
1487
  ),
1487
- !N && !c && i.canEdit && o && /* @__PURE__ */ r(
1488
+ !y && !d && i.canEdit && o && /* @__PURE__ */ r(
1488
1489
  M,
1489
1490
  {
1490
1491
  variant: "outline",
@@ -1510,7 +1511,7 @@ function Za() {
1510
1511
  ]
1511
1512
  }
1512
1513
  ),
1513
- !N && c && t && o && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1514
+ !y && d && t && o && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1514
1515
  M,
1515
1516
  {
1516
1517
  className: "h-7 p-2",
@@ -1520,8 +1521,8 @@ function Za() {
1520
1521
  children: /* @__PURE__ */ e(ra, { className: "h-4 w-4" })
1521
1522
  }
1522
1523
  ) }),
1523
- !N && t && /* @__PURE__ */ e(fa, {}),
1524
- c && !N && o && /* @__PURE__ */ r(
1524
+ !y && t && /* @__PURE__ */ e(fa, {}),
1525
+ d && !y && o && /* @__PURE__ */ r(
1525
1526
  M,
1526
1527
  {
1527
1528
  variant: "outline",