react-semaphor 0.1.501 → 0.1.503

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 (33) hide show
  1. package/dist/brand-studio/index.cjs +1 -1
  2. package/dist/brand-studio/index.js +1 -1
  3. package/dist/chunks/dashboard-briefing-launcher-CHMQi0pU.cjs +21 -0
  4. package/dist/chunks/{dashboard-briefing-launcher-DfC-k5P3.js → dashboard-briefing-launcher-COqlnnQ2.js} +1201 -1160
  5. package/dist/chunks/{dashboard-controls-CUQUph1I.js → dashboard-controls-Bp6XzVvx.js} +665 -654
  6. package/dist/chunks/{dashboard-controls-DQt2D99m.cjs → dashboard-controls-D8z05ZfX.cjs} +10 -10
  7. package/dist/chunks/{dashboard-json-H9GxGLRA.cjs → dashboard-json-DcvkxkL3.cjs} +1 -1
  8. package/dist/chunks/{dashboard-json-BHZYDA2F.js → dashboard-json-Dw7kHCe5.js} +2 -2
  9. package/dist/chunks/{edit-dashboard-visual-hYQMdpjN.js → edit-dashboard-visual-D5vvLzkS.js} +3 -3
  10. package/dist/chunks/{edit-dashboard-visual-B8p6XTig.cjs → edit-dashboard-visual-olfXEK5D.cjs} +1 -1
  11. package/dist/chunks/{editor-action-buttons-DiRpbCIR.cjs → editor-action-buttons-BsWibSiV.cjs} +1 -1
  12. package/dist/chunks/{editor-action-buttons-DjVEnfLQ.js → editor-action-buttons-DYiJr5u3.js} +2 -2
  13. package/dist/chunks/index-C3rUIii0.cjs +1417 -0
  14. package/dist/chunks/{index-D-UGbMFA.js → index-ZKSLtc9_.js} +30214 -29909
  15. package/dist/chunks/{report-preferences-dialog-B4pIkowU.js → report-preferences-dialog-BXaILrOK.js} +2 -2
  16. package/dist/chunks/{report-preferences-dialog-DwBFTNNN.cjs → report-preferences-dialog-BZvi_3DV.cjs} +1 -1
  17. package/dist/chunks/{switch-B4wVqV4L.js → switch-DWM8d-UR.js} +6 -0
  18. package/dist/chunks/{switch-DVjKkt22.cjs → switch-Dej7zCoP.cjs} +1 -1
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/data-app-builder/index.cjs +1 -1
  22. package/dist/data-app-builder/index.js +2 -2
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +97 -96
  25. package/dist/surfboard/index.cjs +1 -1
  26. package/dist/surfboard/index.js +2 -2
  27. package/dist/types/dashboard.d.ts +11 -0
  28. package/dist/types/main.d.ts +21 -1
  29. package/dist/types/surfboard.d.ts +11 -0
  30. package/dist/types/types.d.ts +11 -0
  31. package/package.json +1 -1
  32. package/dist/chunks/dashboard-briefing-launcher-D6z_n26J.cjs +0 -21
  33. package/dist/chunks/index-se8e2QhO.cjs +0 -1417
@@ -1,30 +1,30 @@
1
1
  import { jsx as e, jsxs as o, Fragment as T } from "react/jsx-runtime";
2
- import { u as S, B as R, aB as mt, z as sr, O as na, Z as sa, c as oe, aC as oa, aD as ia, aE as ot, a4 as C, aF as xe, aG as pt, aH as or, L as Be, aI as ir, aJ as da, D as $t, Q as Gt, V as Bt, W as Ht, Y as zt, X as la, i as ca, aK as ua } from "./switch-B4wVqV4L.js";
3
- import { bw as ma, bx as pa, ay as q, aF as dr, by as ha, aX as K, aG as lr, aH as fa, aI as it, aJ as dt, aE as ga, bz as be, bA as Ge, bB as ba, bC as jt, bD as cr, bE as ur, bF as xa, bG as ht, bH as va, bI as ya, bJ as wa, bK as Na, bL as Sa, bM as Da, b6 as ve, bN as ye, bO as Ca, bP as mr, bk as ft, bQ as ka, bR as Ea, bS as pr, bT as La, bU as hr, bV as V, bW as Ia, ao as Ma, bX as Aa, bY as Pa, bZ as Oa, b_ as _a, m as Ra, u as Fe, s as Ua, n as rt, b$ as Va, c0 as Ta, c1 as Fa, c2 as $a, L as Ga, c3 as Ba, c4 as Ha, I as qt, c5 as za, c6 as ja, c7 as qa, c8 as Ka, c9 as Kt, ca as Qt, cb as Wt, cc as Qa, cd as Wa, ce as Ja, cf as Xa, a$ as Jt, cg as Ya, ch as Za, ci as en, r as tn, cj as rn, aN as an, aQ as nn, aR as sn, aS as on, aT as dn, aU as ln, aV as cn, aW as Xt } from "./index-D-UGbMFA.js";
4
- import { c as ee, X as fr, C as un } from "./x-CXDkqdur.js";
2
+ import { u as S, B as U, aB as lt, z as nr, O as aa, Z as na, c as ie, aC as sa, aD as oa, aE as nt, a4 as C, aF as ye, aG as ut, aH as sr, L as Be, aI as or, aJ as ia, D as Ft, Q as $t, V as Gt, W as Bt, Y as Ht, X as da, i as ca, aK as la } from "./switch-DWM8d-UR.js";
3
+ import { bw as ua, bx as ma, ay as q, aF as ir, by as pa, aX as Q, aG as dr, aH as ha, aI as st, aJ as ot, aE as fa, bz as ve, bA as Ge, bB as ga, bC as zt, bD as cr, bE as lr, bF as ba, bG as mt, bH as xa, bI as va, bJ as ya, bK as wa, bL as Na, bM as Sa, b6 as we, bN as Ne, bO as Da, bP as ur, bk as pt, bQ as Ca, bR as ka, bS as mr, bT as Ea, bU as pr, bV as V, bW as La, ao as Ia, bX as Ma, bY as Aa, bZ as Pa, b_ as Oa, m as _a, u as Fe, s as Ra, n as tt, b$ as Ua, c0 as Va, c1 as Ta, c2 as Fa, L as $a, c3 as Ga, c4 as Ba, I as jt, c5 as Ha, c6 as za, c7 as ja, c8 as qa, c9 as qt, ca as Kt, cb as Qt, cc as Ka, cd as Qa, ce as Wa, cf as Ja, a$ as Wt, cg as Xa, ch as Ya, ci as Za, r as en, cj as tn, aN as rn, aQ as an, aR as nn, aS as sn, aT as on, aU as dn, aV as cn, aW as Jt } from "./index-ZKSLtc9_.js";
4
+ import { c as te, X as hr, C as ln } from "./x-CXDkqdur.js";
5
5
  import "./constants-CTRduy1g.js";
6
6
  import "./validators-CHlnnHuS.js";
7
7
  import "./matrix-operation-contract-CPgckXxm.js";
8
8
  import "../value-format-preferences/index.js";
9
- import * as I from "react";
10
- import gr, { useState as N, useMemo as Z, useEffect as He, useRef as Yt, useLayoutEffect as mn, useCallback as pn } from "react";
9
+ import * as M from "react";
10
+ import fr, { useState as N, useMemo as ee, useEffect as He, useRef as Xt, useLayoutEffect as un } from "react";
11
11
  import "./appearance-context-XviHOhWJ.js";
12
12
  import "./index-C9KXfCkC.js";
13
13
  import "./field-aggregations-tLaXZ2VJ.js";
14
14
  import "zod";
15
15
  import "./matrix-continuation-C4sRcjZU.js";
16
16
  import "./color-CJvdlFM_.js";
17
- import { createPortal as hn } from "react-dom";
17
+ import { createPortal as mn } from "react-dom";
18
18
  import "./index-BVIet238.js";
19
19
  import "./appearance-runtime-provider-D0xVQWnH.js";
20
- import { c as fn, u as gn, A as bn, a as xn, f as vn, V as yn, N as wn, g as Nn, U as Sn } from "./dashboard-briefing-launcher-DfC-k5P3.js";
21
- import { S as Dn, C as Cn } from "./search-BHsQIWBV.js";
22
- import { d as br } from "./semantic-format-PKQt2EAz.js";
23
- import { c as lt } from "./calculated-field-identity-BC2NViZZ.js";
24
- import { R as kn } from "./report-preferences-dialog-B4pIkowU.js";
25
- import { u as En } from "./use-debounced-dirty-check-BwAbnX_5.js";
26
- import { s as at } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
27
- import { S as Zt } from "./save-DgMfP0j8.js";
20
+ import { d as pn, c as hn, u as fn, A as gn, a as bn, g as xn, V as vn, N as yn, h as wn, U as Nn } from "./dashboard-briefing-launcher-COqlnnQ2.js";
21
+ import { S as Sn, C as Dn } from "./search-BHsQIWBV.js";
22
+ import { d as gr } from "./semantic-format-PKQt2EAz.js";
23
+ import { c as it } from "./calculated-field-identity-BC2NViZZ.js";
24
+ import { R as Cn } from "./report-preferences-dialog-BXaILrOK.js";
25
+ import { u as kn } from "./use-debounced-dirty-check-BwAbnX_5.js";
26
+ import { s as En } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
27
+ import { S as Yt } from "./save-DgMfP0j8.js";
28
28
  import { P as Ln } from "./palette-Cp1hqZtm.js";
29
29
  import { B as In } from "./braces-8TRlDwDw.js";
30
30
  /**
@@ -33,7 +33,7 @@ import { B as In } from "./braces-8TRlDwDw.js";
33
33
  * This source code is licensed under the ISC license.
34
34
  * See the LICENSE file in the root directory of this source tree.
35
35
  */
36
- const Mn = ee("Glasses", [
36
+ const Mn = te("Glasses", [
37
37
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
38
38
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
39
39
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -46,7 +46,7 @@ const Mn = ee("Glasses", [
46
46
  * This source code is licensed under the ISC license.
47
47
  * See the LICENSE file in the root directory of this source tree.
48
48
  */
49
- const An = ee("Monitor", [
49
+ const An = te("Monitor", [
50
50
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
51
51
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
52
52
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
@@ -57,7 +57,7 @@ const An = ee("Monitor", [
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
59
  */
60
- const Pn = ee("Moon", [
60
+ const Pn = te("Moon", [
61
61
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
62
62
  ]);
63
63
  /**
@@ -66,7 +66,7 @@ const Pn = ee("Moon", [
66
66
  * This source code is licensed under the ISC license.
67
67
  * See the LICENSE file in the root directory of this source tree.
68
68
  */
69
- const On = ee("ShieldX", [
69
+ const On = te("ShieldX", [
70
70
  [
71
71
  "path",
72
72
  {
@@ -83,7 +83,7 @@ const On = ee("ShieldX", [
83
83
  * This source code is licensed under the ISC license.
84
84
  * See the LICENSE file in the root directory of this source tree.
85
85
  */
86
- const _n = ee("Sun", [
86
+ const _n = te("Sun", [
87
87
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
88
88
  ["path", { d: "M12 2v2", key: "tus03m" }],
89
89
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -100,7 +100,7 @@ const _n = ee("Sun", [
100
100
  * This source code is licensed under the ISC license.
101
101
  * See the LICENSE file in the root directory of this source tree.
102
102
  */
103
- const Rn = ee("UserPlus", [
103
+ const Rn = te("UserPlus", [
104
104
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
105
105
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
106
106
  ["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
@@ -112,11 +112,11 @@ const Rn = ee("UserPlus", [
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
114
  */
115
- const xr = ee("UserRound", [
115
+ const br = te("UserRound", [
116
116
  ["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
117
117
  ["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
118
118
  ]);
119
- var ct = { exports: {} }, nt = {};
119
+ var dt = { exports: {} }, rt = {};
120
120
  /**
121
121
  * @license React
122
122
  * use-sync-external-store-shim.production.js
@@ -126,48 +126,48 @@ var ct = { exports: {} }, nt = {};
126
126
  * This source code is licensed under the MIT license found in the
127
127
  * LICENSE file in the root directory of this source tree.
128
128
  */
129
- var er;
129
+ var Zt;
130
130
  function Un() {
131
- if (er) return nt;
132
- er = 1;
133
- var t = gr;
134
- function n(c, f) {
135
- return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f;
131
+ if (Zt) return rt;
132
+ Zt = 1;
133
+ var t = fr;
134
+ function n(l, f) {
135
+ return l === f && (l !== 0 || 1 / l === 1 / f) || l !== l && f !== f;
136
136
  }
137
- var a = typeof Object.is == "function" ? Object.is : n, r = t.useState, s = t.useEffect, l = t.useLayoutEffect, p = t.useDebugValue;
138
- function h(c, f) {
137
+ var a = typeof Object.is == "function" ? Object.is : n, r = t.useState, s = t.useEffect, c = t.useLayoutEffect, m = t.useDebugValue;
138
+ function h(l, f) {
139
139
  var i = f(), x = r({ inst: { value: i, getSnapshot: f } }), v = x[0].inst, w = x[1];
140
- return l(
140
+ return c(
141
141
  function() {
142
142
  v.value = i, v.getSnapshot = f, b(v) && w({ inst: v });
143
143
  },
144
- [c, i, f]
144
+ [l, i, f]
145
145
  ), s(
146
146
  function() {
147
- return b(v) && w({ inst: v }), c(function() {
147
+ return b(v) && w({ inst: v }), l(function() {
148
148
  b(v) && w({ inst: v });
149
149
  });
150
150
  },
151
- [c]
152
- ), p(i), i;
151
+ [l]
152
+ ), m(i), i;
153
153
  }
154
- function b(c) {
155
- var f = c.getSnapshot;
156
- c = c.value;
154
+ function b(l) {
155
+ var f = l.getSnapshot;
156
+ l = l.value;
157
157
  try {
158
158
  var i = f();
159
- return !a(c, i);
159
+ return !a(l, i);
160
160
  } catch {
161
161
  return !0;
162
162
  }
163
163
  }
164
- function g(c, f) {
164
+ function g(l, f) {
165
165
  return f();
166
166
  }
167
167
  var u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? g : h;
168
- return nt.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : u, nt;
168
+ return rt.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : u, rt;
169
169
  }
170
- var st = {};
170
+ var at = {};
171
171
  /**
172
172
  * @license React
173
173
  * use-sync-external-store-shim.development.js
@@ -177,9 +177,9 @@ var st = {};
177
177
  * This source code is licensed under the MIT license found in the
178
178
  * LICENSE file in the root directory of this source tree.
179
179
  */
180
- var tr;
180
+ var er;
181
181
  function Vn() {
182
- return tr || (tr = 1, process.env.NODE_ENV !== "production" && function() {
182
+ return er || (er = 1, process.env.NODE_ENV !== "production" && function() {
183
183
  function t(i, x) {
184
184
  return i === x && (i !== 0 || 1 / i === 1 / x) || i !== i && x !== x;
185
185
  }
@@ -188,13 +188,13 @@ function Vn() {
188
188
  "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."
189
189
  ));
190
190
  var v = x();
191
- if (!c) {
191
+ if (!l) {
192
192
  var w = x();
193
- l(v, w) || (console.error(
193
+ c(v, w) || (console.error(
194
194
  "The result of getSnapshot should be cached to avoid an infinite loop"
195
- ), c = !0);
195
+ ), l = !0);
196
196
  }
197
- w = p({
197
+ w = m({
198
198
  inst: { value: v, getSnapshot: x }
199
199
  });
200
200
  var D = w[0].inst, E = w[1];
@@ -217,7 +217,7 @@ function Vn() {
217
217
  i = i.value;
218
218
  try {
219
219
  var v = x();
220
- return !l(i, v);
220
+ return !c(i, v);
221
221
  } catch {
222
222
  return !0;
223
223
  }
@@ -226,38 +226,38 @@ function Vn() {
226
226
  return x();
227
227
  }
228
228
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
229
- var s = gr, l = typeof Object.is == "function" ? Object.is : t, p = s.useState, h = s.useEffect, b = s.useLayoutEffect, g = s.useDebugValue, u = !1, c = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
230
- st.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
231
- }()), st;
229
+ var s = fr, c = typeof Object.is == "function" ? Object.is : t, m = s.useState, h = s.useEffect, b = s.useLayoutEffect, g = s.useDebugValue, u = !1, l = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
230
+ at.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
231
+ }()), at;
232
232
  }
233
- process.env.NODE_ENV === "production" ? ct.exports = Un() : ct.exports = Vn();
234
- var Tn = ct.exports;
233
+ process.env.NODE_ENV === "production" ? dt.exports = Un() : dt.exports = Vn();
234
+ var Tn = dt.exports;
235
235
  const $e = ["light", "dark", "system"];
236
236
  function Fn() {
237
- const { theme: t, setTheme: n } = ma(), a = S(
238
- (p) => p.actions.setDashboardTheme
237
+ const { theme: t, setTheme: n } = ua(), a = S(
238
+ (m) => m.actions.setDashboardTheme
239
239
  );
240
240
  function r() {
241
- const p = $e.includes(t) ? t : "system", h = $e[($e.indexOf(p) + 1) % $e.length];
241
+ const m = $e.includes(t) ? t : "system", h = $e[($e.indexOf(m) + 1) % $e.length];
242
242
  n(h), a(h);
243
243
  }
244
- const s = t === "light" ? _n : t === "dark" ? Pn : An, l = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
244
+ const s = t === "light" ? _n : t === "dark" ? Pn : An, c = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
245
245
  return /* @__PURE__ */ e(
246
- R,
246
+ U,
247
247
  {
248
248
  type: "button",
249
249
  variant: "ghost",
250
250
  size: "xs",
251
251
  className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
252
252
  onClick: r,
253
- "aria-label": l,
254
- title: l,
253
+ "aria-label": c,
254
+ title: c,
255
255
  children: /* @__PURE__ */ e(s, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
256
256
  }
257
257
  );
258
258
  }
259
- function vr(t) {
260
- const n = (/* @__PURE__ */ new Date()).toISOString(), a = pa({
259
+ function xr(t) {
260
+ const n = (/* @__PURE__ */ new Date()).toISOString(), a = ma({
261
261
  dashboard: t.dashboard,
262
262
  sheetIds: (t.dashboard.sheets || []).filter((r) => r.kind !== "document").map((r) => r.id),
263
263
  sheetKind: "dashboard",
@@ -276,34 +276,34 @@ function vr(t) {
276
276
  dashboardInputValues: a.dashboardInputValues
277
277
  };
278
278
  }
279
- async function $n(t, n, a, r, s, l) {
280
- if (!l)
279
+ async function $n(t, n, a, r, s, c) {
280
+ if (!c)
281
281
  return null;
282
- const p = JSON.stringify(a), h = `${t}/v1/lens`;
283
- return await mt(h, l, {
282
+ const m = JSON.stringify(a), h = `${t}/v1/lens`;
283
+ return await lt(h, c, {
284
284
  name: n,
285
- template: p,
285
+ template: m,
286
286
  filterValues: r,
287
287
  inputValues: s,
288
288
  operation: "create"
289
289
  });
290
290
  }
291
- async function ut(t, n, a) {
291
+ async function ct(t, n, a) {
292
292
  if (!a)
293
293
  return null;
294
294
  const {
295
295
  id: r,
296
296
  template: s,
297
- filterValues: l,
298
- inputValues: p,
297
+ filterValues: c,
298
+ inputValues: m,
299
299
  isDefault: h,
300
300
  shared: b
301
301
  } = n, g = `${t}/v1/lens`;
302
- return await mt(g, a, {
302
+ return await lt(g, a, {
303
303
  lensId: r,
304
304
  template: s,
305
- filterValues: l,
306
- inputValues: p,
305
+ filterValues: c,
306
+ inputValues: m,
307
307
  isDefault: h,
308
308
  shared: b,
309
309
  operation: "update"
@@ -313,7 +313,7 @@ async function Gn(t, n, a) {
313
313
  if (!a)
314
314
  return null;
315
315
  const r = `${t}/v1/lens`;
316
- return await mt(r, a, {
316
+ return await lt(r, a, {
317
317
  operation: "delete",
318
318
  lensId: n
319
319
  });
@@ -323,18 +323,18 @@ function Hn({
323
323
  open: t,
324
324
  onOpenChange: n
325
325
  } = {}) {
326
- const [a, r] = N(""), [s, l] = N(!1), p = S((m) => m.lenses), { setLenses: h, setSelectedLensId: b } = sr(), [g, u] = N(!1), [c, f] = N(!1), i = t !== void 0, x = i ? t : c, v = (m) => {
327
- i || f(m), n == null || n(m);
328
- }, w = S((m) => m.dashboard), D = S((m) => m.filterValues), { authToken: E, tokenProps: $ } = q();
329
- async function L() {
326
+ const [a, r] = N(""), [s, c] = N(!1), m = S((p) => p.lenses), { setLenses: h, setSelectedLensId: b } = nr(), [g, u] = N(!1), [l, f] = N(!1), i = t !== void 0, x = i ? t : l, v = (p) => {
327
+ i || f(p), n == null || n(p);
328
+ }, w = S((p) => p.dashboard), D = S((p) => p.filterValues), { authToken: E, tokenProps: $ } = q();
329
+ async function I() {
330
330
  u(!0);
331
- const m = S.getState(), G = vr({
331
+ const p = S.getState(), G = xr({
332
332
  dashboard: w,
333
- dashboardInputValues: m.dashboardInputValues,
333
+ dashboardInputValues: p.dashboardInputValues,
334
334
  filterValues: D,
335
- controlValues: m.controlValues,
336
- inlineFilterValuesMap: m.inlineFilterValuesMap,
337
- cardControlValuesMap: m.cardControlValuesMap
335
+ controlValues: p.controlValues,
336
+ inlineFilterValuesMap: p.inlineFilterValuesMap,
337
+ cardControlValuesMap: p.cardControlValuesMap
338
338
  }), F = await $n(
339
339
  $.apiServiceUrl,
340
340
  a,
@@ -343,40 +343,40 @@ function Hn({
343
343
  G,
344
344
  E == null ? void 0 : E.accessToken
345
345
  );
346
- F && (h([...p || [], F]), b(F.id), v(!1)), u(!1);
346
+ F && (h([...m || [], F]), b(F.id), v(!1)), u(!1);
347
347
  }
348
- return /* @__PURE__ */ o(dr, { open: x, onOpenChange: v, children: [
349
- i ? null : /* @__PURE__ */ e(ha, { asChild: !0, children: /* @__PURE__ */ o(R, { variant: "secondary", size: "xs", children: [
350
- /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" }),
348
+ return /* @__PURE__ */ o(ir, { open: x, onOpenChange: v, children: [
349
+ i ? null : /* @__PURE__ */ e(pa, { asChild: !0, children: /* @__PURE__ */ o(U, { variant: "secondary", size: "xs", children: [
350
+ /* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5" }),
351
351
  "Lens"
352
352
  ] }) }),
353
- /* @__PURE__ */ o(lr, { className: "rounded-control border-border/60 sm:max-w-[420px] sm:rounded-control", children: [
354
- /* @__PURE__ */ o(fa, { children: [
355
- /* @__PURE__ */ e(it, { className: "text-[15px]", children: "Create lens" }),
356
- /* @__PURE__ */ e(dt, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
353
+ /* @__PURE__ */ o(dr, { className: "rounded-control border-border/60 sm:max-w-[420px] sm:rounded-control", children: [
354
+ /* @__PURE__ */ o(ha, { children: [
355
+ /* @__PURE__ */ e(st, { className: "text-[15px]", children: "Create lens" }),
356
+ /* @__PURE__ */ e(ot, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
357
357
  ] }),
358
358
  /* @__PURE__ */ o("div", { className: "space-y-1.5 py-1", children: [
359
- /* @__PURE__ */ e(na, { htmlFor: "lens-name", className: Bn, children: "Name" }),
359
+ /* @__PURE__ */ e(aa, { htmlFor: "lens-name", className: Bn, children: "Name" }),
360
360
  /* @__PURE__ */ e(
361
- sa,
361
+ na,
362
362
  {
363
363
  id: "lens-name",
364
364
  size: "xs",
365
365
  value: a,
366
366
  placeholder: "Monthly review, West region, …",
367
- onChange: (m) => r(m.target.value)
367
+ onChange: (p) => r(p.target.value)
368
368
  }
369
369
  ),
370
370
  s && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: "A lens with this name already exists. Pick a different one." })
371
371
  ] }),
372
- /* @__PURE__ */ o(ga, { children: [
373
- /* @__PURE__ */ e(R, { variant: "outline", size: "xs", onClick: () => v(!1), children: "Cancel" }),
372
+ /* @__PURE__ */ o(fa, { children: [
373
+ /* @__PURE__ */ e(U, { variant: "outline", size: "xs", onClick: () => v(!1), children: "Cancel" }),
374
374
  /* @__PURE__ */ e(
375
- R,
375
+ U,
376
376
  {
377
377
  size: "xs",
378
378
  type: "submit",
379
- onClick: L,
379
+ onClick: I,
380
380
  disabled: g || !a.trim(),
381
381
  children: g ? "Creating…" : "Create"
382
382
  }
@@ -386,53 +386,53 @@ function Hn({
386
386
  ] });
387
387
  }
388
388
  function zn({ includeLabel: t = !1 } = {}) {
389
- const n = S((u) => u.lenses), a = S((u) => u.selectedLensId), { setLenses: r, setSelectedLensId: s } = sr(), { authToken: l, tokenProps: p } = q();
389
+ const n = S((u) => u.lenses), a = S((u) => u.selectedLensId), { setLenses: r, setSelectedLensId: s } = nr(), { authToken: c, tokenProps: m } = q();
390
390
  async function h(u) {
391
391
  s(u);
392
392
  }
393
393
  async function b(u) {
394
- if (await Gn(p.apiServiceUrl, u, l == null ? void 0 : l.accessToken)) {
394
+ if (await Gn(m.apiServiceUrl, u, c == null ? void 0 : c.accessToken)) {
395
395
  const f = n == null ? void 0 : n.filter((i) => i.id !== u);
396
396
  r(f || []), s("original");
397
397
  }
398
398
  }
399
399
  async function g(u) {
400
- const c = n == null ? void 0 : n.map((x) => x.id === u.id ? {
400
+ const l = n == null ? void 0 : n.map((x) => x.id === u.id ? {
401
401
  ...x,
402
402
  isDefault: !u.isDefault
403
403
  } : {
404
404
  ...x,
405
405
  isDefault: !1
406
406
  });
407
- r(c || []);
407
+ r(l || []);
408
408
  const f = {
409
409
  ...u,
410
410
  isDefault: !u.isDefault
411
411
  };
412
- await ut(p.apiServiceUrl, f, l == null ? void 0 : l.accessToken);
412
+ await ct(m.apiServiceUrl, f, c == null ? void 0 : c.accessToken);
413
413
  const i = n == null ? void 0 : n.find((x) => x.isDefault);
414
414
  if (i && i.id !== u.id) {
415
415
  const x = {
416
416
  ...i,
417
417
  isDefault: !1
418
418
  };
419
- await ut(p.apiServiceUrl, x, l == null ? void 0 : l.accessToken);
419
+ await ct(m.apiServiceUrl, x, c == null ? void 0 : c.accessToken);
420
420
  }
421
421
  }
422
422
  return /* @__PURE__ */ o(T, { children: [
423
423
  t ? /* @__PURE__ */ o(T, { children: [
424
- /* @__PURE__ */ e(be, { className: "px-3", children: "Lenses" }),
424
+ /* @__PURE__ */ e(ve, { className: "px-3", children: "Lenses" }),
425
425
  /* @__PURE__ */ e(Ge, {})
426
426
  ] }) : null,
427
427
  /* @__PURE__ */ o(
428
- ba,
428
+ ga,
429
429
  {
430
430
  value: a,
431
431
  onValueChange: h,
432
432
  children: [
433
- /* @__PURE__ */ e(jt, { value: "original", children: "Original" }),
433
+ /* @__PURE__ */ e(zt, { value: "original", children: "Original" }),
434
434
  n == null ? void 0 : n.map((u) => /* @__PURE__ */ o(
435
- jt,
435
+ zt,
436
436
  {
437
437
  className: "group flex justify-between gap-2",
438
438
  value: u.id,
@@ -442,10 +442,10 @@ function zn({ includeLabel: t = !1 } = {}) {
442
442
  /* @__PURE__ */ e(
443
443
  cr,
444
444
  {
445
- onClick: (c) => {
446
- c.preventDefault(), g(u);
445
+ onClick: (l) => {
446
+ l.preventDefault(), g(u);
447
447
  },
448
- className: oe(
448
+ className: ie(
449
449
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
450
450
  {
451
451
  invisible: !u.isDefault,
@@ -456,10 +456,10 @@ function zn({ includeLabel: t = !1 } = {}) {
456
456
  }
457
457
  ),
458
458
  /* @__PURE__ */ e(
459
- ur,
459
+ lr,
460
460
  {
461
- onClick: (c) => {
462
- c.preventDefault(), b(u.id);
461
+ onClick: (l) => {
462
+ l.preventDefault(), b(u.id);
463
463
  },
464
464
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
465
465
  strokeWidth: 1.5
@@ -476,56 +476,56 @@ function zn({ includeLabel: t = !1 } = {}) {
476
476
  ] });
477
477
  }
478
478
  function jn() {
479
- const { displayPreferences: t, shouldShowElement: n } = xa(), { currentUser: a, userContext: r } = ht(), s = Z(
480
- () => va(a),
479
+ const { displayPreferences: t, shouldShowElement: n } = ba(), { currentUser: a, userContext: r } = mt(), s = ee(
480
+ () => xa(a),
481
481
  [a]
482
- ), l = Z(() => (h) => s && s[h] !== void 0 && s[h] === !1 ? !1 : n(h), [s, n, t]), p = Z(
482
+ ), c = ee(() => (h) => s && s[h] !== void 0 && s[h] === !1 ? !1 : n(h), [s, n, t]), m = ee(
483
483
  () => {
484
- var h, b, g, u, c;
484
+ var h, b, g, u, l;
485
485
  return {
486
- canEdit: ((h = r == null ? void 0 : r.permissions) == null ? void 0 : h.canEdit) ?? Da(a),
487
- canUseFilters: ((b = r == null ? void 0 : r.permissions) == null ? void 0 : b.canEdit) ?? Sa(a),
488
- canManageDashboards: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canCreateDashboard) ?? Na(a),
489
- canCreateDashboards: ((u = r == null ? void 0 : r.permissions) == null ? void 0 : u.canCreateDashboard) ?? wa(a),
490
- canAccessVisuals: ((c = r == null ? void 0 : r.permissions) == null ? void 0 : c.canEdit) ?? ya(a)
486
+ canEdit: ((h = r == null ? void 0 : r.permissions) == null ? void 0 : h.canEdit) ?? Sa(a),
487
+ canUseFilters: ((b = r == null ? void 0 : r.permissions) == null ? void 0 : b.canEdit) ?? Na(a),
488
+ canManageDashboards: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canCreateDashboard) ?? wa(a),
489
+ canCreateDashboards: ((u = r == null ? void 0 : r.permissions) == null ? void 0 : u.canCreateDashboard) ?? ya(a),
490
+ canAccessVisuals: ((l = r == null ? void 0 : r.permissions) == null ? void 0 : l.canEdit) ?? va(a)
491
491
  };
492
492
  },
493
493
  [a, r]
494
494
  );
495
495
  return {
496
496
  displayPreferences: t,
497
- shouldShowElement: l,
498
- permissions: p,
497
+ shouldShowElement: c,
498
+ permissions: m,
499
499
  currentUser: a
500
500
  };
501
501
  }
502
502
  function qn(t, n = []) {
503
503
  let a = [];
504
- function r(l, p) {
505
- const h = I.createContext(p);
506
- h.displayName = l + "Context";
504
+ function r(c, m) {
505
+ const h = M.createContext(m);
506
+ h.displayName = c + "Context";
507
507
  const b = a.length;
508
- a = [...a, p];
509
- const g = (c) => {
508
+ a = [...a, m];
509
+ const g = (l) => {
510
510
  var D;
511
- const { scope: f, children: i, ...x } = c, v = ((D = f == null ? void 0 : f[t]) == null ? void 0 : D[b]) || h, w = I.useMemo(() => x, Object.values(x));
511
+ const { scope: f, children: i, ...x } = l, v = ((D = f == null ? void 0 : f[t]) == null ? void 0 : D[b]) || h, w = M.useMemo(() => x, Object.values(x));
512
512
  return /* @__PURE__ */ e(v.Provider, { value: w, children: i });
513
513
  };
514
- g.displayName = l + "Provider";
515
- function u(c, f) {
514
+ g.displayName = c + "Provider";
515
+ function u(l, f) {
516
516
  var v;
517
- const i = ((v = f == null ? void 0 : f[t]) == null ? void 0 : v[b]) || h, x = I.useContext(i);
517
+ const i = ((v = f == null ? void 0 : f[t]) == null ? void 0 : v[b]) || h, x = M.useContext(i);
518
518
  if (x) return x;
519
- if (p !== void 0) return p;
520
- throw new Error(`\`${c}\` must be used within \`${l}\``);
519
+ if (m !== void 0) return m;
520
+ throw new Error(`\`${l}\` must be used within \`${c}\``);
521
521
  }
522
522
  return [g, u];
523
523
  }
524
524
  const s = () => {
525
- const l = a.map((p) => I.createContext(p));
525
+ const c = a.map((m) => M.createContext(m));
526
526
  return function(h) {
527
- const b = (h == null ? void 0 : h[t]) || l;
528
- return I.useMemo(
527
+ const b = (h == null ? void 0 : h[t]) || c;
528
+ return M.useMemo(
529
529
  () => ({ [`__scope${t}`]: { ...h, [t]: b } }),
530
530
  [h, b]
531
531
  );
@@ -541,12 +541,12 @@ function Kn(...t) {
541
541
  useScope: s(),
542
542
  scopeName: s.scopeName
543
543
  }));
544
- return function(l) {
545
- const p = r.reduce((h, { useScope: b, scopeName: g }) => {
546
- const c = b(l)[`__scope${g}`];
547
- return { ...h, ...c };
544
+ return function(c) {
545
+ const m = r.reduce((h, { useScope: b, scopeName: g }) => {
546
+ const l = b(c)[`__scope${g}`];
547
+ return { ...h, ...l };
548
548
  }, {});
549
- return I.useMemo(() => ({ [`__scope${n.scopeName}`]: p }), [p]);
549
+ return M.useMemo(() => ({ [`__scope${n.scopeName}`]: m }), [m]);
550
550
  };
551
551
  };
552
552
  return a.scopeName = n.scopeName, a;
@@ -569,10 +569,10 @@ var Qn = [
569
569
  "span",
570
570
  "svg",
571
571
  "ul"
572
- ], gt = Qn.reduce((t, n) => {
573
- const a = oa(`Primitive.${n}`), r = I.forwardRef((s, l) => {
574
- const { asChild: p, ...h } = s, b = p ? a : n;
575
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(b, { ...h, ref: l });
572
+ ], ht = Qn.reduce((t, n) => {
573
+ const a = sa(`Primitive.${n}`), r = M.forwardRef((s, c) => {
574
+ const { asChild: m, ...h } = s, b = m ? a : n;
575
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(b, { ...h, ref: c });
576
576
  });
577
577
  return r.displayName = `Primitive.${n}`, { ...t, [n]: r };
578
578
  }, {});
@@ -587,132 +587,132 @@ function Jn() {
587
587
  return () => {
588
588
  };
589
589
  }
590
- var bt = "Avatar", [Xn] = qn(bt), [Yn, yr] = Xn(bt), wr = I.forwardRef(
590
+ var ft = "Avatar", [Xn] = qn(ft), [Yn, vr] = Xn(ft), yr = M.forwardRef(
591
591
  (t, n) => {
592
- const { __scopeAvatar: a, ...r } = t, [s, l] = I.useState("idle");
592
+ const { __scopeAvatar: a, ...r } = t, [s, c] = M.useState("idle");
593
593
  return /* @__PURE__ */ e(
594
594
  Yn,
595
595
  {
596
596
  scope: a,
597
597
  imageLoadingStatus: s,
598
- onImageLoadingStatusChange: l,
599
- children: /* @__PURE__ */ e(gt.span, { ...r, ref: n })
598
+ onImageLoadingStatusChange: c,
599
+ children: /* @__PURE__ */ e(ht.span, { ...r, ref: n })
600
600
  }
601
601
  );
602
602
  }
603
603
  );
604
- wr.displayName = bt;
605
- var Nr = "AvatarImage", Sr = I.forwardRef(
604
+ yr.displayName = ft;
605
+ var wr = "AvatarImage", Nr = M.forwardRef(
606
606
  (t, n) => {
607
607
  const { __scopeAvatar: a, src: r, onLoadingStatusChange: s = () => {
608
- }, ...l } = t, p = yr(Nr, a), h = Zn(r, l), b = ia((g) => {
609
- s(g), p.onImageLoadingStatusChange(g);
608
+ }, ...c } = t, m = vr(wr, a), h = Zn(r, c), b = oa((g) => {
609
+ s(g), m.onImageLoadingStatusChange(g);
610
610
  });
611
- return ot(() => {
611
+ return nt(() => {
612
612
  h !== "idle" && b(h);
613
- }, [h, b]), h === "loaded" ? /* @__PURE__ */ e(gt.img, { ...l, ref: n, src: r }) : null;
613
+ }, [h, b]), h === "loaded" ? /* @__PURE__ */ e(ht.img, { ...c, ref: n, src: r }) : null;
614
614
  }
615
615
  );
616
- Sr.displayName = Nr;
617
- var Dr = "AvatarFallback", Cr = I.forwardRef(
616
+ Nr.displayName = wr;
617
+ var Sr = "AvatarFallback", Dr = M.forwardRef(
618
618
  (t, n) => {
619
- const { __scopeAvatar: a, delayMs: r, ...s } = t, l = yr(Dr, a), [p, h] = I.useState(r === void 0);
620
- return I.useEffect(() => {
619
+ const { __scopeAvatar: a, delayMs: r, ...s } = t, c = vr(Sr, a), [m, h] = M.useState(r === void 0);
620
+ return M.useEffect(() => {
621
621
  if (r !== void 0) {
622
622
  const b = window.setTimeout(() => h(!0), r);
623
623
  return () => window.clearTimeout(b);
624
624
  }
625
- }, [r]), p && l.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(gt.span, { ...s, ref: n }) : null;
625
+ }, [r]), m && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(ht.span, { ...s, ref: n }) : null;
626
626
  }
627
627
  );
628
- Cr.displayName = Dr;
629
- function rr(t, n) {
628
+ Dr.displayName = Sr;
629
+ function tr(t, n) {
630
630
  return t ? n ? (t.src !== n && (t.src = n), t.complete && t.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
631
631
  }
632
632
  function Zn(t, { referrerPolicy: n, crossOrigin: a }) {
633
- const r = Wn(), s = I.useRef(null), l = r ? (s.current || (s.current = new window.Image()), s.current) : null, [p, h] = I.useState(
634
- () => rr(l, t)
633
+ const r = Wn(), s = M.useRef(null), c = r ? (s.current || (s.current = new window.Image()), s.current) : null, [m, h] = M.useState(
634
+ () => tr(c, t)
635
635
  );
636
- return ot(() => {
637
- h(rr(l, t));
638
- }, [l, t]), ot(() => {
639
- const b = (c) => () => {
640
- h(c);
636
+ return nt(() => {
637
+ h(tr(c, t));
638
+ }, [c, t]), nt(() => {
639
+ const b = (l) => () => {
640
+ h(l);
641
641
  };
642
- if (!l) return;
642
+ if (!c) return;
643
643
  const g = b("loaded"), u = b("error");
644
- return l.addEventListener("load", g), l.addEventListener("error", u), n && (l.referrerPolicy = n), typeof a == "string" && (l.crossOrigin = a), () => {
645
- l.removeEventListener("load", g), l.removeEventListener("error", u);
644
+ return c.addEventListener("load", g), c.addEventListener("error", u), n && (c.referrerPolicy = n), typeof a == "string" && (c.crossOrigin = a), () => {
645
+ c.removeEventListener("load", g), c.removeEventListener("error", u);
646
646
  };
647
- }, [l, a, n]), p;
647
+ }, [c, a, n]), m;
648
648
  }
649
- var kr = wr, Er = Sr, Lr = Cr;
650
- const Ir = I.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
651
- kr,
649
+ var Cr = yr, kr = Nr, Er = Dr;
650
+ const Lr = M.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
651
+ Cr,
652
652
  {
653
653
  ref: a,
654
- className: oe(
654
+ className: ie(
655
655
  "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
656
656
  t
657
657
  ),
658
658
  ...n
659
659
  }
660
660
  ));
661
- Ir.displayName = kr.displayName;
662
- const es = I.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
663
- Er,
661
+ Lr.displayName = Cr.displayName;
662
+ const es = M.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
663
+ kr,
664
664
  {
665
665
  ref: a,
666
- className: oe("aspect-square h-full w-full", t),
666
+ className: ie("aspect-square h-full w-full", t),
667
667
  ...n
668
668
  }
669
669
  ));
670
- es.displayName = Er.displayName;
671
- const Mr = I.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
672
- Lr,
670
+ es.displayName = kr.displayName;
671
+ const Ir = M.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
672
+ Er,
673
673
  {
674
674
  ref: a,
675
- className: oe(
675
+ className: ie(
676
676
  "flex h-full w-full items-center justify-center rounded-full bg-muted",
677
677
  t
678
678
  ),
679
679
  ...n
680
680
  }
681
681
  ));
682
- Mr.displayName = Lr.displayName;
682
+ Ir.displayName = Er.displayName;
683
683
  const ts = async (t, n, a) => {
684
684
  const r = `${t}/management/v1/groups`;
685
- return await or(r, n, a);
685
+ return await sr(r, n, a);
686
686
  }, rs = async (t, n, a, r) => {
687
687
  const s = `${t}/management/v1/groups/${a}`;
688
- return pt(s, n, "PATCH", r);
688
+ return ut(s, n, "PATCH", r);
689
689
  }, as = async (t, n, a) => {
690
690
  const r = `${t}/management/v1/groups/${a}`;
691
- await pt(r, n, "DELETE");
691
+ await ut(r, n, "DELETE");
692
692
  }, ns = async (t, n, a, r) => {
693
693
  const s = `${t}/management/v1/groups/${a}/members`;
694
- return await or(s, n, r);
694
+ return await sr(s, n, r);
695
695
  }, ss = async (t, n, a, r) => {
696
696
  const s = `${t}/management/v1/groups/${a}/members`;
697
- await pt(s, n, "DELETE", r);
697
+ await ut(s, n, "DELETE", r);
698
698
  };
699
699
  function os() {
700
- const { authToken: t, tokenProps: n } = q(), a = ve();
701
- return ye({
700
+ const { authToken: t, tokenProps: n } = q(), a = we();
701
+ return Ne({
702
702
  mutationFn: (r) => ts(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
703
703
  onSuccess: () => {
704
704
  a.invalidateQueries({ queryKey: ["groups"] }), C.success("Group created successfully");
705
705
  },
706
706
  onError: (r) => {
707
707
  console.error("Failed to create group:", r), C.error("Failed to create group", {
708
- description: xe(r, "Failed to create group")
708
+ description: ye(r, "Failed to create group")
709
709
  });
710
710
  }
711
711
  });
712
712
  }
713
713
  function is() {
714
- const { authToken: t, tokenProps: n } = q(), a = ve();
715
- return ye({
714
+ const { authToken: t, tokenProps: n } = q(), a = we();
715
+ return Ne({
716
716
  mutationFn: ({
717
717
  groupId: r,
718
718
  data: s
@@ -722,28 +722,28 @@ function is() {
722
722
  },
723
723
  onError: (r) => {
724
724
  console.error("Failed to update group:", r), C.error("Failed to update group", {
725
- description: xe(r, "Failed to update group")
725
+ description: ye(r, "Failed to update group")
726
726
  });
727
727
  }
728
728
  });
729
729
  }
730
730
  function ds() {
731
- const { authToken: t, tokenProps: n } = q(), a = ve();
732
- return ye({
731
+ const { authToken: t, tokenProps: n } = q(), a = we();
732
+ return Ne({
733
733
  mutationFn: (r) => as(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
734
734
  onSuccess: (r, s) => {
735
735
  a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", s] }), C.success("Group deleted successfully");
736
736
  },
737
737
  onError: (r) => {
738
738
  console.error("Failed to delete group:", r), C.error("Failed to delete group", {
739
- description: xe(r, "Failed to delete group")
739
+ description: ye(r, "Failed to delete group")
740
740
  });
741
741
  }
742
742
  });
743
743
  }
744
- function ls() {
745
- const { authToken: t, tokenProps: n } = q(), a = ve();
746
- return ye({
744
+ function cs() {
745
+ const { authToken: t, tokenProps: n } = q(), a = we();
746
+ return Ne({
747
747
  mutationFn: ({
748
748
  groupId: r,
749
749
  data: s
@@ -755,14 +755,14 @@ function ls() {
755
755
  },
756
756
  onError: (r) => {
757
757
  console.error("Failed to add group members:", r), C.error("Failed to add members", {
758
- description: xe(r, "Failed to add members")
758
+ description: ye(r, "Failed to add members")
759
759
  });
760
760
  }
761
761
  });
762
762
  }
763
- function cs() {
764
- const { authToken: t, tokenProps: n } = q(), a = ve();
765
- return ye({
763
+ function ls() {
764
+ const { authToken: t, tokenProps: n } = q(), a = we();
765
+ return Ne({
766
766
  mutationFn: ({
767
767
  groupId: r,
768
768
  data: s
@@ -774,7 +774,7 @@ function cs() {
774
774
  },
775
775
  onError: (r) => {
776
776
  console.error("Failed to remove group members:", r), C.error("Failed to remove members", {
777
- description: xe(r, "Failed to remove members")
777
+ description: ye(r, "Failed to remove members")
778
778
  });
779
779
  }
780
780
  });
@@ -784,32 +784,32 @@ function ms({
784
784
  open: t,
785
785
  onOpenChange: n
786
786
  }) {
787
- var E, $, L;
788
- const { tokenProps: a } = q(), { currentUser: r } = ht(), s = (r == null ? void 0 : r.type) === "tenant", l = a == null ? void 0 : a.tenantId, {
789
- groups: p,
787
+ var E, $, I;
788
+ const { tokenProps: a } = q(), { currentUser: r } = mt(), s = (r == null ? void 0 : r.type) === "tenant", c = a == null ? void 0 : a.tenantId, {
789
+ groups: m,
790
790
  isLoading: h,
791
791
  error: b,
792
792
  refetch: g
793
- } = Ca({
793
+ } = Da({
794
794
  type: s ? "TENANT_GROUP" : "all",
795
- tenantId: s ? l : void 0,
795
+ tenantId: s ? c : void 0,
796
796
  includeMembers: !1
797
- }), u = b ? Ar(b, "Unable to load groups.") : null, [c, f] = N({ kind: "list" }), [i, x] = N(null), v = ds();
797
+ }), u = b ? Mr(b, "Unable to load groups.") : null, [l, f] = N({ kind: "list" }), [i, x] = N(null), v = ds();
798
798
  He(() => {
799
799
  t || (f({ kind: "list" }), x(null));
800
800
  }, [t]);
801
- const w = c.kind === "members" && p.find((m) => m.id === c.groupId) || null, D = async () => {
801
+ const w = l.kind === "members" && m.find((p) => p.id === l.groupId) || null, D = async () => {
802
802
  if (i)
803
803
  try {
804
804
  await v.mutateAsync(i.id), x(null), f({ kind: "list" }), g();
805
805
  } catch {
806
806
  }
807
807
  };
808
- return /* @__PURE__ */ e(dr, { open: t, onOpenChange: n, children: /* @__PURE__ */ o(lr, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
809
- c.kind === "list" ? /* @__PURE__ */ o("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
810
- /* @__PURE__ */ e(it, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
811
- /* @__PURE__ */ e(dt, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
812
- ] }) : c.kind === "create" ? /* @__PURE__ */ o("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
808
+ return /* @__PURE__ */ e(ir, { open: t, onOpenChange: n, children: /* @__PURE__ */ o(dr, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
809
+ l.kind === "list" ? /* @__PURE__ */ o("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
810
+ /* @__PURE__ */ e(st, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
811
+ /* @__PURE__ */ e(ot, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
812
+ ] }) : l.kind === "create" ? /* @__PURE__ */ o("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
813
813
  /* @__PURE__ */ e(
814
814
  "button",
815
815
  {
@@ -817,33 +817,33 @@ function ms({
817
817
  onClick: () => f({ kind: "list" }),
818
818
  "aria-label": "Back",
819
819
  className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
820
- children: /* @__PURE__ */ e(mr, { className: "h-3.5 w-3.5" })
820
+ children: /* @__PURE__ */ e(ur, { className: "h-3.5 w-3.5" })
821
821
  }
822
822
  ),
823
- /* @__PURE__ */ e(it, { className: "truncate text-[13px] font-medium", children: "New group" }),
824
- /* @__PURE__ */ e(dt, { className: "sr-only", children: "Create a new group to organize members." })
823
+ /* @__PURE__ */ e(st, { className: "truncate text-[13px] font-medium", children: "New group" }),
824
+ /* @__PURE__ */ e(ot, { className: "sr-only", children: "Create a new group to organize members." })
825
825
  ] }) : null,
826
- c.kind === "list" && /* @__PURE__ */ e(
826
+ l.kind === "list" && /* @__PURE__ */ e(
827
827
  ps,
828
828
  {
829
- groups: p,
829
+ groups: m,
830
830
  isLoading: h,
831
831
  errorMessage: u,
832
832
  onRetry: () => g(),
833
833
  currentUserId: r == null ? void 0 : r.id,
834
- onOpenGroup: (m) => f({ kind: "members", groupId: m }),
834
+ onOpenGroup: (p) => f({ kind: "members", groupId: p }),
835
835
  onCreate: () => f({ kind: "create" }),
836
- onDeleteRequest: (m) => x(m)
836
+ onDeleteRequest: (p) => x(p)
837
837
  }
838
838
  ),
839
- c.kind === "members" && w && /* @__PURE__ */ e(
839
+ l.kind === "members" && w && /* @__PURE__ */ e(
840
840
  gs,
841
841
  {
842
842
  group: w,
843
843
  isTenantViewer: s,
844
844
  canEdit: ((E = w.permissions) == null ? void 0 : E.canEdit) ?? w.createdBy === (r == null ? void 0 : r.id),
845
845
  canDelete: (($ = w.permissions) == null ? void 0 : $.canDelete) ?? w.createdBy === (r == null ? void 0 : r.id),
846
- canManageMembers: ((L = w.permissions) == null ? void 0 : L.canManageMembers) ?? w.createdBy === (r == null ? void 0 : r.id),
846
+ canManageMembers: ((I = w.permissions) == null ? void 0 : I.canManageMembers) ?? w.createdBy === (r == null ? void 0 : r.id),
847
847
  onBack: () => f({ kind: "list" }),
848
848
  onMembersChanged: g,
849
849
  onUpdated: g,
@@ -851,14 +851,14 @@ function ms({
851
851
  },
852
852
  w.id
853
853
  ),
854
- c.kind === "create" && /* @__PURE__ */ e(
854
+ l.kind === "create" && /* @__PURE__ */ e(
855
855
  bs,
856
856
  {
857
857
  isTenantUser: s,
858
- tenantId: l,
858
+ tenantId: c,
859
859
  onCancel: () => f({ kind: "list" }),
860
- onCreated: (m) => {
861
- g(), f({ kind: "members", groupId: m });
860
+ onCreated: (p) => {
861
+ g(), f({ kind: "members", groupId: p });
862
862
  }
863
863
  }
864
864
  ),
@@ -888,7 +888,7 @@ function ms({
888
888
  disabled: v.isPending,
889
889
  className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-rose-600 px-2.5 text-[12px] font-medium text-white hover:bg-rose-700 disabled:opacity-60",
890
890
  children: [
891
- v.isPending ? /* @__PURE__ */ e(Be, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(ft, { className: "h-3 w-3" }),
891
+ v.isPending ? /* @__PURE__ */ e(Be, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(pt, { className: "h-3 w-3" }),
892
892
  "Delete group"
893
893
  ]
894
894
  }
@@ -903,25 +903,25 @@ function ps({
903
903
  errorMessage: a,
904
904
  onRetry: r,
905
905
  currentUserId: s,
906
- onOpenGroup: l,
907
- onCreate: p,
906
+ onOpenGroup: c,
907
+ onCreate: m,
908
908
  onDeleteRequest: h
909
909
  }) {
910
- const [b, g] = N(""), u = Z(
910
+ const [b, g] = N(""), u = ee(
911
911
  () => t.filter(
912
- (c) => !b.trim() || c.name.toLowerCase().includes(b.toLowerCase()) || (c.description || "").toLowerCase().includes(b.toLowerCase())
912
+ (l) => !b.trim() || l.name.toLowerCase().includes(b.toLowerCase()) || (l.description || "").toLowerCase().includes(b.toLowerCase())
913
913
  ),
914
914
  [t, b]
915
915
  );
916
916
  return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
917
917
  /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
918
918
  /* @__PURE__ */ o("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
919
- /* @__PURE__ */ e(Dn, { className: "h-3 w-3 text-muted-foreground" }),
919
+ /* @__PURE__ */ e(Sn, { className: "h-3 w-3 text-muted-foreground" }),
920
920
  /* @__PURE__ */ e(
921
921
  "input",
922
922
  {
923
923
  value: b,
924
- onChange: (c) => g(c.target.value),
924
+ onChange: (l) => g(l.target.value),
925
925
  placeholder: "Search groups…",
926
926
  className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none"
927
927
  }
@@ -932,7 +932,7 @@ function ps({
932
932
  type: "button",
933
933
  onClick: () => g(""),
934
934
  className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
935
- children: /* @__PURE__ */ e(fr, { className: "h-2.5 w-2.5" })
935
+ children: /* @__PURE__ */ e(hr, { className: "h-2.5 w-2.5" })
936
936
  }
937
937
  )
938
938
  ] }),
@@ -940,46 +940,46 @@ function ps({
940
940
  "button",
941
941
  {
942
942
  type: "button",
943
- onClick: p,
943
+ onClick: m,
944
944
  className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90",
945
945
  children: [
946
- /* @__PURE__ */ e(K, { className: "h-3 w-3" }),
946
+ /* @__PURE__ */ e(Q, { className: "h-3 w-3" }),
947
947
  "New group"
948
948
  ]
949
949
  }
950
950
  )
951
951
  ] }),
952
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: n ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((c) => /* @__PURE__ */ e(
952
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: n ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((l) => /* @__PURE__ */ e(
953
953
  "div",
954
954
  {
955
955
  className: "h-12 animate-pulse rounded-[4px] bg-muted/60"
956
956
  },
957
- c
957
+ l
958
958
  )) }) : a ? /* @__PURE__ */ e(
959
- Pr,
959
+ Ar,
960
960
  {
961
961
  title: "Can't load groups",
962
962
  message: a,
963
963
  onRetry: r
964
964
  }
965
- ) : u.length === 0 && t.length === 0 ? /* @__PURE__ */ e(fs, { onCreate: p }) : u.length === 0 ? /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
965
+ ) : u.length === 0 && t.length === 0 ? /* @__PURE__ */ e(fs, { onCreate: m }) : u.length === 0 ? /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
966
966
  /* @__PURE__ */ o("div", { className: "text-[12px] text-foreground", children: [
967
967
  'No groups match "',
968
968
  b,
969
969
  '"'
970
970
  ] }),
971
971
  /* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: "Try a different search." })
972
- ] }) : u.map((c) => {
972
+ ] }) : u.map((l) => {
973
973
  var f;
974
974
  return /* @__PURE__ */ e(
975
975
  hs,
976
976
  {
977
- group: c,
978
- canDelete: ((f = c.permissions) == null ? void 0 : f.canDelete) ?? c.createdBy === s,
979
- onClick: () => l(c.id),
980
- onDelete: () => h(c)
977
+ group: l,
978
+ canDelete: ((f = l.permissions) == null ? void 0 : f.canDelete) ?? l.createdBy === s,
979
+ onClick: () => c(l.id),
980
+ onDelete: () => h(l)
981
981
  },
982
- c.id
982
+ l.id
983
983
  );
984
984
  }) })
985
985
  ] });
@@ -992,7 +992,7 @@ function hs({
992
992
  }) {
993
993
  let s = "";
994
994
  try {
995
- s = br(new Date(t.createdAt), "MMM d, yyyy");
995
+ s = gr(new Date(t.createdAt), "MMM d, yyyy");
996
996
  } catch {
997
997
  s = "";
998
998
  }
@@ -1003,12 +1003,12 @@ function hs({
1003
1003
  onClick: a,
1004
1004
  className: "group flex w-full items-center gap-3 border-b border-border/60 px-5 py-2.5 text-left hover:bg-accent/40",
1005
1005
  children: [
1006
- /* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(La, { className: "h-3.5 w-3.5" }) }),
1006
+ /* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(Ea, { className: "h-3.5 w-3.5" }) }),
1007
1007
  /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
1008
1008
  /* @__PURE__ */ e("div", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
1009
1009
  /* @__PURE__ */ o("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
1010
1010
  /* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1", children: [
1011
- /* @__PURE__ */ e(xr, { className: "h-2.5 w-2.5" }),
1011
+ /* @__PURE__ */ e(br, { className: "h-2.5 w-2.5" }),
1012
1012
  t.memberCount,
1013
1013
  " member",
1014
1014
  t.memberCount === 1 ? "" : "s"
@@ -1016,7 +1016,7 @@ function hs({
1016
1016
  s && /* @__PURE__ */ o(T, { children: [
1017
1017
  /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
1018
1018
  /* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1", children: [
1019
- /* @__PURE__ */ e(hr, { className: "h-2.5 w-2.5" }),
1019
+ /* @__PURE__ */ e(pr, { className: "h-2.5 w-2.5" }),
1020
1020
  s
1021
1021
  ] })
1022
1022
  ] }),
@@ -1032,18 +1032,18 @@ function hs({
1032
1032
  {
1033
1033
  role: "button",
1034
1034
  tabIndex: 0,
1035
- onClick: (l) => {
1036
- l.stopPropagation(), r();
1035
+ onClick: (c) => {
1036
+ c.stopPropagation(), r();
1037
1037
  },
1038
- onKeyDown: (l) => {
1039
- (l.key === "Enter" || l.key === " ") && (l.preventDefault(), l.stopPropagation(), r());
1038
+ onKeyDown: (c) => {
1039
+ (c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.stopPropagation(), r());
1040
1040
  },
1041
1041
  "aria-label": `Delete ${t.name}`,
1042
1042
  className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
1043
- children: /* @__PURE__ */ e(ft, { className: "h-3 w-3" })
1043
+ children: /* @__PURE__ */ e(pt, { className: "h-3 w-3" })
1044
1044
  }
1045
1045
  ),
1046
- /* @__PURE__ */ e(Cn, { className: "h-3.5 w-3.5 text-muted-foreground" })
1046
+ /* @__PURE__ */ e(Dn, { className: "h-3.5 w-3.5 text-muted-foreground" })
1047
1047
  ] })
1048
1048
  ]
1049
1049
  }
@@ -1051,7 +1051,7 @@ function hs({
1051
1051
  }
1052
1052
  function fs({ onCreate: t }) {
1053
1053
  return /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
1054
- /* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(pr, { className: "h-4 w-4" }) }),
1054
+ /* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(mr, { className: "h-4 w-4" }) }),
1055
1055
  /* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
1056
1056
  /* @__PURE__ */ e("div", { className: "max-w-[320px] text-[11.5px] leading-[1.55] text-muted-foreground", children: "Groups let you grant shared access to dashboards. Create one and add members." }),
1057
1057
  /* @__PURE__ */ o(
@@ -1061,7 +1061,7 @@ function fs({ onCreate: t }) {
1061
1061
  onClick: t,
1062
1062
  className: "mt-1 inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90",
1063
1063
  children: [
1064
- /* @__PURE__ */ e(K, { className: "h-3 w-3" }),
1064
+ /* @__PURE__ */ e(Q, { className: "h-3 w-3" }),
1065
1065
  "New group"
1066
1066
  ]
1067
1067
  }
@@ -1074,52 +1074,52 @@ function gs({
1074
1074
  canEdit: a,
1075
1075
  canDelete: r,
1076
1076
  canManageMembers: s,
1077
- onBack: l,
1078
- onMembersChanged: p,
1077
+ onBack: c,
1078
+ onMembersChanged: m,
1079
1079
  onUpdated: h,
1080
1080
  onRequestDelete: b
1081
1081
  }) {
1082
1082
  const {
1083
1083
  data: g,
1084
1084
  isLoading: u,
1085
- error: c,
1085
+ error: l,
1086
1086
  refetch: f
1087
- } = ka(t.id), i = (g == null ? void 0 : g.members) ?? us, x = c ? Ar(c, "Unable to load members for this group.") : null, v = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w } = Ea({
1087
+ } = Ca(t.id), i = (g == null ? void 0 : g.members) ?? us, x = l ? Mr(l, "Unable to load members for this group.") : null, v = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w } = ka({
1088
1088
  type: v,
1089
1089
  tenantId: t.tenantId || void 0,
1090
1090
  active: !0,
1091
1091
  limit: 200
1092
- }), D = Z(
1092
+ }), D = ee(
1093
1093
  () => new Set(i.map((y) => y.userId)),
1094
1094
  [i]
1095
- ), E = ls(), $ = cs(), L = is(), [m, G] = N(!1), [F, B] = N(t.name), [P, k] = N(!1), [te, re] = N(t.description || ""), [Q, we] = N(""), [Ne, Se] = N(!1), De = Z(() => {
1096
- const y = Q.trim().toLowerCase();
1095
+ ), E = cs(), $ = ls(), I = is(), [p, G] = N(!1), [F, B] = N(t.name), [O, k] = N(!1), [re, ae] = N(t.description || ""), [W, Se] = N(""), [De, Ce] = N(!1), ke = ee(() => {
1096
+ const y = W.trim().toLowerCase();
1097
1097
  return w.filter((H) => !D.has(H.id)).filter(
1098
1098
  (H) => !y || (H.name || "").toLowerCase().includes(y) || (H.email || "").toLowerCase().includes(y)
1099
1099
  ).slice(0, 50);
1100
- }, [w, D, Q]), Ce = async () => {
1100
+ }, [w, D, W]), Ee = async () => {
1101
1101
  const y = F.trim();
1102
1102
  if (G(!1), y.length >= 3 && y !== t.name)
1103
1103
  try {
1104
- await L.mutateAsync({
1104
+ await I.mutateAsync({
1105
1105
  groupId: t.id,
1106
1106
  data: { name: y }
1107
1107
  }), h();
1108
1108
  } catch {
1109
1109
  }
1110
- }, ie = async () => {
1111
- const y = te.trim();
1110
+ }, de = async () => {
1111
+ const y = re.trim();
1112
1112
  if (k(!1), y !== (t.description || ""))
1113
1113
  try {
1114
- await L.mutateAsync({
1114
+ await I.mutateAsync({
1115
1115
  groupId: t.id,
1116
1116
  data: { description: y }
1117
1117
  }), h();
1118
1118
  } catch {
1119
1119
  }
1120
- }, ke = async (y) => {
1120
+ }, Le = async (y) => {
1121
1121
  if (s) {
1122
- we(""), Se(!1);
1122
+ Se(""), Ce(!1);
1123
1123
  try {
1124
1124
  await E.mutateAsync({
1125
1125
  groupId: t.id,
@@ -1127,25 +1127,25 @@ function gs({
1127
1127
  userIds: [y.id],
1128
1128
  userType: v === "tenant" ? "tenant" : "org"
1129
1129
  }
1130
- }), f(), p();
1130
+ }), f(), m();
1131
1131
  } catch {
1132
1132
  }
1133
1133
  }
1134
- }, de = async (y) => {
1134
+ }, ce = async (y) => {
1135
1135
  if (s)
1136
1136
  try {
1137
1137
  await $.mutateAsync({
1138
1138
  groupId: t.id,
1139
1139
  data: { userIds: [y] }
1140
- }), f(), p();
1140
+ }), f(), m();
1141
1141
  } catch {
1142
1142
  }
1143
1143
  };
1144
- let ae = "";
1144
+ let ne = "";
1145
1145
  try {
1146
- ae = br(new Date(t.createdAt), "MMM d, yyyy");
1146
+ ne = gr(new Date(t.createdAt), "MMM d, yyyy");
1147
1147
  } catch {
1148
- ae = "";
1148
+ ne = "";
1149
1149
  }
1150
1150
  return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
1151
1151
  /* @__PURE__ */ o("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
@@ -1153,21 +1153,21 @@ function gs({
1153
1153
  "button",
1154
1154
  {
1155
1155
  type: "button",
1156
- onClick: l,
1156
+ onClick: c,
1157
1157
  "aria-label": "Back",
1158
1158
  className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
1159
- children: /* @__PURE__ */ e(mr, { className: "h-3.5 w-3.5" })
1159
+ children: /* @__PURE__ */ e(ur, { className: "h-3.5 w-3.5" })
1160
1160
  }
1161
1161
  ),
1162
- m ? /* @__PURE__ */ e(
1162
+ p ? /* @__PURE__ */ e(
1163
1163
  "input",
1164
1164
  {
1165
1165
  autoFocus: !0,
1166
1166
  value: F,
1167
1167
  onChange: (y) => B(y.target.value),
1168
- onBlur: Ce,
1168
+ onBlur: Ee,
1169
1169
  onKeyDown: (y) => {
1170
- y.key === "Enter" && Ce(), y.key === "Escape" && (B(t.name), G(!1));
1170
+ y.key === "Enter" && Ee(), y.key === "Escape" && (B(t.name), G(!1));
1171
1171
  },
1172
1172
  className: "h-6 min-w-0 flex-1 rounded-[3px] border border-border bg-background px-1.5 text-[13px] font-medium text-foreground focus:border-foreground/40 focus:outline-none"
1173
1173
  }
@@ -1185,23 +1185,23 @@ function gs({
1185
1185
  }
1186
1186
  ),
1187
1187
  /* @__PURE__ */ o("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
1188
- /* @__PURE__ */ e(xr, { className: "h-2.5 w-2.5" }),
1188
+ /* @__PURE__ */ e(br, { className: "h-2.5 w-2.5" }),
1189
1189
  i.length,
1190
1190
  " member",
1191
1191
  i.length === 1 ? "" : "s"
1192
1192
  ] })
1193
1193
  ] }),
1194
- /* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: P ? /* @__PURE__ */ o("div", { children: [
1194
+ /* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: O ? /* @__PURE__ */ o("div", { children: [
1195
1195
  /* @__PURE__ */ e(
1196
1196
  "textarea",
1197
1197
  {
1198
1198
  autoFocus: !0,
1199
1199
  rows: 2,
1200
- value: te,
1201
- onChange: (y) => re(y.target.value),
1200
+ value: re,
1201
+ onChange: (y) => ae(y.target.value),
1202
1202
  maxLength: 200,
1203
1203
  onKeyDown: (y) => {
1204
- y.key === "Escape" && (re(t.description || ""), k(!1)), y.key === "Enter" && (y.metaKey || y.ctrlKey) && ie();
1204
+ y.key === "Escape" && (ae(t.description || ""), k(!1)), y.key === "Enter" && (y.metaKey || y.ctrlKey) && de();
1205
1205
  },
1206
1206
  placeholder: "What is this group for?",
1207
1207
  className: "block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
@@ -1209,7 +1209,7 @@ function gs({
1209
1209
  ),
1210
1210
  /* @__PURE__ */ o("div", { className: "mt-1.5 flex items-center justify-between", children: [
1211
1211
  /* @__PURE__ */ o("span", { className: "text-[10.5px] text-muted-foreground", children: [
1212
- te.length,
1212
+ re.length,
1213
1213
  "/200 · Esc to cancel · ⌘↩ to save"
1214
1214
  ] }),
1215
1215
  /* @__PURE__ */ o("div", { className: "flex items-center gap-1.5", children: [
@@ -1218,7 +1218,7 @@ function gs({
1218
1218
  {
1219
1219
  type: "button",
1220
1220
  onClick: () => {
1221
- re(t.description || ""), k(!1);
1221
+ ae(t.description || ""), k(!1);
1222
1222
  },
1223
1223
  className: "h-6 rounded-[5px] px-2 text-[11px] font-medium text-foreground/80 hover:bg-accent",
1224
1224
  children: "Cancel"
@@ -1228,7 +1228,7 @@ function gs({
1228
1228
  "button",
1229
1229
  {
1230
1230
  type: "button",
1231
- onClick: ie,
1231
+ onClick: de,
1232
1232
  className: "inline-flex h-6 items-center rounded-[5px] bg-foreground px-2 text-[11px] font-medium text-background hover:opacity-90",
1233
1233
  children: "Save"
1234
1234
  }
@@ -1240,7 +1240,7 @@ function gs({
1240
1240
  {
1241
1241
  type: "button",
1242
1242
  onClick: () => {
1243
- a && (re(t.description || ""), k(!0));
1243
+ a && (ae(t.description || ""), k(!0));
1244
1244
  },
1245
1245
  disabled: !a,
1246
1246
  title: a ? "Click to edit description" : void 0,
@@ -1248,7 +1248,7 @@ function gs({
1248
1248
  children: [
1249
1249
  t.description ? /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: t.description }) : /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: a ? "Add a description…" : "No description" }),
1250
1250
  /* @__PURE__ */ o("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
1251
- ae ? `Created ${ae}` : "Recently created",
1251
+ ne ? `Created ${ne}` : "Recently created",
1252
1252
  a ? " · You can edit this group" : ""
1253
1253
  ] })
1254
1254
  ]
@@ -1257,13 +1257,13 @@ function gs({
1257
1257
  s && /* @__PURE__ */ e(
1258
1258
  xs,
1259
1259
  {
1260
- query: Q,
1261
- setQuery: we,
1262
- open: Ne,
1263
- setOpen: Se,
1264
- candidates: De,
1260
+ query: W,
1261
+ setQuery: Se,
1262
+ open: De,
1263
+ setOpen: Ce,
1264
+ candidates: ke,
1265
1265
  showKindChip: !n,
1266
- onAdd: ke,
1266
+ onAdd: Le,
1267
1267
  busy: E.isPending
1268
1268
  }
1269
1269
  ),
@@ -1274,7 +1274,7 @@ function gs({
1274
1274
  },
1275
1275
  y
1276
1276
  )) }) : x ? /* @__PURE__ */ e(
1277
- Pr,
1277
+ Ar,
1278
1278
  {
1279
1279
  title: "Can't load members",
1280
1280
  message: x,
@@ -1284,27 +1284,27 @@ function gs({
1284
1284
  /* @__PURE__ */ e("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
1285
1285
  /* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: s ? "Search above to add people to this group." : "This group does not have any members." })
1286
1286
  ] }) : i.map((y) => {
1287
- var H, le, Ee, W, J, X;
1287
+ var H, le, Ie, J, X, Y;
1288
1288
  return /* @__PURE__ */ o(
1289
1289
  "div",
1290
1290
  {
1291
1291
  className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
1292
1292
  children: [
1293
- /* @__PURE__ */ e(Or, { name: ((H = y.user) == null ? void 0 : H.name) || ((le = y.user) == null ? void 0 : le.email) || "?" }),
1293
+ /* @__PURE__ */ e(Pr, { name: ((H = y.user) == null ? void 0 : H.name) || ((le = y.user) == null ? void 0 : le.email) || "?" }),
1294
1294
  /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
1295
- /* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((Ee = y.user) == null ? void 0 : Ee.name) || ((W = y.user) == null ? void 0 : W.email) || "Unknown" }),
1296
- ((J = y.user) == null ? void 0 : J.email) && y.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: y.user.email })
1295
+ /* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((Ie = y.user) == null ? void 0 : Ie.name) || ((J = y.user) == null ? void 0 : J.email) || "Unknown" }),
1296
+ ((X = y.user) == null ? void 0 : X.email) && y.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: y.user.email })
1297
1297
  ] }),
1298
1298
  !n && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: y.userType }),
1299
1299
  /* @__PURE__ */ e(
1300
1300
  "button",
1301
1301
  {
1302
1302
  type: "button",
1303
- onClick: () => de(y.userId),
1303
+ onClick: () => ce(y.userId),
1304
1304
  disabled: !s || $.isPending,
1305
- "aria-label": `Remove ${((X = y.user) == null ? void 0 : X.name) || "member"}`,
1305
+ "aria-label": `Remove ${((Y = y.user) == null ? void 0 : Y.name) || "member"}`,
1306
1306
  className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100 disabled:opacity-30",
1307
- children: /* @__PURE__ */ e(fr, { className: "h-3 w-3" })
1307
+ children: /* @__PURE__ */ e(hr, { className: "h-3 w-3" })
1308
1308
  }
1309
1309
  )
1310
1310
  ]
@@ -1319,7 +1319,7 @@ function gs({
1319
1319
  onClick: b,
1320
1320
  className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] border border-rose-200 bg-background px-2.5 text-[12px] font-medium text-rose-600 hover:bg-rose-50 dark:border-rose-900/60 dark:text-rose-400 dark:hover:bg-rose-950/30",
1321
1321
  children: [
1322
- /* @__PURE__ */ e(ft, { className: "h-3 w-3" }),
1322
+ /* @__PURE__ */ e(pt, { className: "h-3 w-3" }),
1323
1323
  "Delete group"
1324
1324
  ]
1325
1325
  }
@@ -1332,12 +1332,12 @@ function bs({
1332
1332
  onCancel: a,
1333
1333
  onCreated: r
1334
1334
  }) {
1335
- const [s, l] = N(""), [p, h] = N(""), [b, g] = N(null), u = os(), c = s.trim().length >= 3 && s.trim().length <= 50, f = async () => {
1336
- if (!c) return;
1335
+ const [s, c] = N(""), [m, h] = N(""), [b, g] = N(null), u = os(), l = s.trim().length >= 3 && s.trim().length <= 50, f = async () => {
1336
+ if (!l) return;
1337
1337
  g(null);
1338
1338
  const i = {
1339
1339
  name: s.trim(),
1340
- description: p.trim() || void 0,
1340
+ description: m.trim() || void 0,
1341
1341
  type: t ? "TENANT_GROUP" : "ORG_GROUP",
1342
1342
  ...t && n ? { tenantId: n } : {}
1343
1343
  };
@@ -1350,13 +1350,13 @@ function bs({
1350
1350
  };
1351
1351
  return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
1352
1352
  /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
1353
- /* @__PURE__ */ e(ar, { children: "Name" }),
1353
+ /* @__PURE__ */ e(rr, { children: "Name" }),
1354
1354
  /* @__PURE__ */ e(
1355
1355
  "input",
1356
1356
  {
1357
1357
  autoFocus: !0,
1358
1358
  value: s,
1359
- onChange: (i) => l(i.target.value),
1359
+ onChange: (i) => c(i.target.value),
1360
1360
  placeholder: "Marketing leads, North America sales, …",
1361
1361
  maxLength: 50,
1362
1362
  className: "mt-1 block h-7 w-full rounded-[5px] border border-border bg-background px-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
@@ -1364,12 +1364,12 @@ function bs({
1364
1364
  ),
1365
1365
  /* @__PURE__ */ e("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
1366
1366
  /* @__PURE__ */ o("div", { className: "mt-4", children: [
1367
- /* @__PURE__ */ e(ar, { children: "Description (optional)" }),
1367
+ /* @__PURE__ */ e(rr, { children: "Description (optional)" }),
1368
1368
  /* @__PURE__ */ e(
1369
1369
  "textarea",
1370
1370
  {
1371
1371
  rows: 2,
1372
- value: p,
1372
+ value: m,
1373
1373
  onChange: (i) => h(i.target.value),
1374
1374
  maxLength: 200,
1375
1375
  placeholder: "What is this group for?",
@@ -1377,7 +1377,7 @@ function bs({
1377
1377
  }
1378
1378
  ),
1379
1379
  /* @__PURE__ */ o("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
1380
- p.length,
1380
+ m.length,
1381
1381
  "/200"
1382
1382
  ] })
1383
1383
  ] }),
@@ -1399,13 +1399,13 @@ function bs({
1399
1399
  {
1400
1400
  type: "button",
1401
1401
  onClick: f,
1402
- disabled: !c || u.isPending,
1402
+ disabled: !l || u.isPending,
1403
1403
  className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
1404
1404
  children: u.isPending ? /* @__PURE__ */ o(T, { children: [
1405
1405
  /* @__PURE__ */ e(Be, { className: "h-3 w-3 animate-spin" }),
1406
1406
  "Creating…"
1407
1407
  ] }) : /* @__PURE__ */ o(T, { children: [
1408
- /* @__PURE__ */ e(K, { className: "h-3 w-3" }),
1408
+ /* @__PURE__ */ e(Q, { className: "h-3 w-3" }),
1409
1409
  "Create group"
1410
1410
  ] })
1411
1411
  }
@@ -1419,21 +1419,21 @@ function xs({
1419
1419
  open: a,
1420
1420
  setOpen: r,
1421
1421
  candidates: s,
1422
- showKindChip: l,
1423
- onAdd: p,
1422
+ showKindChip: c,
1423
+ onAdd: m,
1424
1424
  busy: h
1425
1425
  }) {
1426
- const b = Yt(null), g = Yt(null), [u, c] = N(null);
1427
- mn(() => {
1426
+ const b = Xt(null), g = Xt(null), [u, l] = N(null);
1427
+ un(() => {
1428
1428
  if (!a) {
1429
- c(null);
1429
+ l(null);
1430
1430
  return;
1431
1431
  }
1432
1432
  const i = () => {
1433
1433
  const x = b.current;
1434
1434
  if (!x) return;
1435
1435
  const v = x.getBoundingClientRect(), w = 240, E = window.innerHeight - v.bottom < w + 16 && v.top > w;
1436
- c({
1436
+ l({
1437
1437
  left: v.left,
1438
1438
  top: E ? v.top - 6 : v.bottom + 6,
1439
1439
  width: v.width,
@@ -1477,7 +1477,7 @@ function xs({
1477
1477
  ]
1478
1478
  }
1479
1479
  ),
1480
- f && typeof document < "u" && hn(
1480
+ f && typeof document < "u" && mn(
1481
1481
  /* @__PURE__ */ e(
1482
1482
  "div",
1483
1483
  {
@@ -1494,15 +1494,15 @@ function xs({
1494
1494
  "button",
1495
1495
  {
1496
1496
  type: "button",
1497
- onClick: () => p(i),
1497
+ onClick: () => m(i),
1498
1498
  className: "flex w-full items-center gap-2 border-b border-border/60 px-2.5 py-2 text-left last:border-b-0 hover:bg-accent",
1499
1499
  children: [
1500
- /* @__PURE__ */ e(Or, { name: i.name || i.email || "?" }),
1500
+ /* @__PURE__ */ e(Pr, { name: i.name || i.email || "?" }),
1501
1501
  /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
1502
1502
  /* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children: i.name || i.email || "Unknown" }),
1503
1503
  i.email && i.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: i.email })
1504
1504
  ] }),
1505
- l && i.type && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: i.type === "tenant" ? "tenant" : "org" })
1505
+ c && i.type && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: i.type === "tenant" ? "tenant" : "org" })
1506
1506
  ]
1507
1507
  },
1508
1508
  i.id
@@ -1513,7 +1513,7 @@ function xs({
1513
1513
  )
1514
1514
  ] });
1515
1515
  }
1516
- function Ar(t, n) {
1516
+ function Mr(t, n) {
1517
1517
  if (!t) return n;
1518
1518
  if (t instanceof Error) {
1519
1519
  const a = t.message || "", r = a.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
@@ -1521,7 +1521,7 @@ function Ar(t, n) {
1521
1521
  }
1522
1522
  return typeof t == "string" ? t : n;
1523
1523
  }
1524
- function Pr({
1524
+ function Ar({
1525
1525
  title: t,
1526
1526
  message: n,
1527
1527
  onRetry: a
@@ -1540,28 +1540,28 @@ function Pr({
1540
1540
  )
1541
1541
  ] });
1542
1542
  }
1543
- function ar({ children: t }) {
1543
+ function rr({ children: t }) {
1544
1544
  return /* @__PURE__ */ e("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: t });
1545
1545
  }
1546
- function Or({ name: t }) {
1546
+ function Pr({ name: t }) {
1547
1547
  const n = t.split(" ").map((a) => a[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
1548
- return /* @__PURE__ */ e(Ir, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(Mr, { className: "text-[9px] font-semibold", children: n || "?" }) });
1548
+ return /* @__PURE__ */ e(Lr, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(Ir, { className: "text-[9px] font-semibold", children: n || "?" }) });
1549
1549
  }
1550
- function fe(t, n, a) {
1551
- var l, p;
1550
+ function be(t, n, a) {
1551
+ var c, m;
1552
1552
  const r = (t.controls || []).find(
1553
1553
  (h) => h.id === a
1554
1554
  );
1555
1555
  if (r)
1556
1556
  return r.label;
1557
- const s = (p = (l = ir(t, n)) == null ? void 0 : l.controls) == null ? void 0 : p.find(
1557
+ const s = (m = (c = or(t, n)) == null ? void 0 : c.controls) == null ? void 0 : m.find(
1558
1558
  (h) => h.id === a
1559
1559
  );
1560
1560
  return (s == null ? void 0 : s.label) || a;
1561
1561
  }
1562
- function ge(t, n) {
1562
+ function xe(t, n) {
1563
1563
  var a;
1564
- return ((a = ir(t, n)) == null ? void 0 : a.title) || n;
1564
+ return ((a = or(t, n)) == null ? void 0 : a.title) || n;
1565
1565
  }
1566
1566
  function vs(t) {
1567
1567
  const { errors: n, dashboard: a } = t;
@@ -1569,32 +1569,32 @@ function vs(t) {
1569
1569
  return n;
1570
1570
  const r = /* @__PURE__ */ new Map();
1571
1571
  for (const s of n) {
1572
- const l = s.match(
1572
+ const c = s.match(
1573
1573
  /^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
1574
1574
  );
1575
- if (l) {
1576
- const [, u, c] = l, f = `${u}:${c}:missing-metric`;
1575
+ if (c) {
1576
+ const [, u, l] = c, f = `${u}:${l}:missing-metric`;
1577
1577
  r.has(f) || r.set(
1578
1578
  f,
1579
- `"${ge(a, u)}" has an outdated "${fe(
1579
+ `"${xe(a, u)}" has an outdated "${be(
1580
1580
  a,
1581
1581
  u,
1582
- c
1582
+ l
1583
1583
  )}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
1584
1584
  );
1585
1585
  continue;
1586
1586
  }
1587
- const p = s.match(
1587
+ const m = s.match(
1588
1588
  /^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
1589
1589
  );
1590
- if (p) {
1591
- const [, u, c] = p, f = `${u}:${c}:missing-group-by`;
1590
+ if (m) {
1591
+ const [, u, l] = m, f = `${u}:${l}:missing-group-by`;
1592
1592
  r.has(f) || r.set(
1593
1593
  f,
1594
- `"${ge(a, u)}" has an outdated "${fe(
1594
+ `"${xe(a, u)}" has an outdated "${be(
1595
1595
  a,
1596
1596
  u,
1597
- c
1597
+ l
1598
1598
  )}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
1599
1599
  );
1600
1600
  continue;
@@ -1603,13 +1603,13 @@ function vs(t) {
1603
1603
  /^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
1604
1604
  );
1605
1605
  if (h) {
1606
- const [, u, c] = h, f = `${u}:${c}:invalid-metric`;
1606
+ const [, u, l] = h, f = `${u}:${l}:invalid-metric`;
1607
1607
  r.has(f) || r.set(
1608
1608
  f,
1609
- `"${ge(a, u)}" has an invalid "${fe(
1609
+ `"${xe(a, u)}" has an invalid "${be(
1610
1610
  a,
1611
1611
  u,
1612
- c
1612
+ l
1613
1613
  )}" metric mapping. Open the card controls and choose a valid metric for each option.`
1614
1614
  );
1615
1615
  continue;
@@ -1618,13 +1618,13 @@ function vs(t) {
1618
1618
  /^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
1619
1619
  );
1620
1620
  if (b) {
1621
- const [, u, c] = b, f = `${u}:${c}:invalid-group-by`;
1621
+ const [, u, l] = b, f = `${u}:${l}:invalid-group-by`;
1622
1622
  r.has(f) || r.set(
1623
1623
  f,
1624
- `"${ge(a, u)}" has an invalid "${fe(
1624
+ `"${xe(a, u)}" has an invalid "${be(
1625
1625
  a,
1626
1626
  u,
1627
- c
1627
+ l
1628
1628
  )}" field mapping. Open the card controls and choose a valid field for each option.`
1629
1629
  );
1630
1630
  continue;
@@ -1633,13 +1633,13 @@ function vs(t) {
1633
1633
  /^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
1634
1634
  );
1635
1635
  if (g) {
1636
- const [, u, c] = g, f = `${u}:${c}:missing-temporal-group-by`;
1636
+ const [, u, l] = g, f = `${u}:${l}:missing-temporal-group-by`;
1637
1637
  r.has(f) || r.set(
1638
1638
  f,
1639
- `"${ge(a, u)}" can no longer use "${fe(
1639
+ `"${xe(a, u)}" can no longer use "${be(
1640
1640
  a,
1641
1641
  u,
1642
- c
1642
+ l
1643
1643
  )}" for time grain because the card does not currently group by a date field.`
1644
1644
  );
1645
1645
  continue;
@@ -1653,7 +1653,7 @@ function ys({
1653
1653
  onSelect: n
1654
1654
  }) {
1655
1655
  return t ? /* @__PURE__ */ o(V, { onSelect: n, children: [
1656
- /* @__PURE__ */ e(Ia, { className: "h-3.5 w-3.5" }),
1656
+ /* @__PURE__ */ e(La, { className: "h-3.5 w-3.5" }),
1657
1657
  "Schedule email report"
1658
1658
  ] }) : null;
1659
1659
  }
@@ -1672,173 +1672,184 @@ function ws({
1672
1672
  }
1673
1673
  ),
1674
1674
  n ? /* @__PURE__ */ o(V, { onSelect: r, children: [
1675
- /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" }),
1675
+ /* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5" }),
1676
1676
  "Create analytical briefing"
1677
1677
  ] }) : null
1678
1678
  ] });
1679
1679
  }
1680
- function nr(t, n) {
1680
+ function ar(t, n) {
1681
1681
  return {
1682
- dashboard: lt(t),
1683
- semanticExecutionPayload: lt(n)
1682
+ dashboard: it(t),
1683
+ semanticExecutionPayload: it(n)
1684
1684
  };
1685
1685
  }
1686
1686
  function Xs() {
1687
- var _t, Rt, Ut, Vt, Tt;
1688
- fn(), gn();
1687
+ var Ot, _t, Rt, Ut, Vt;
1688
+ pn(), hn();
1689
1689
  const {
1690
1690
  authToken: t,
1691
1691
  tokenProps: n,
1692
1692
  id: a,
1693
1693
  showBriefings: r
1694
- } = q(), s = Ma(), { isLocalDev: l } = Aa(), {
1695
- canEditDashboard: p,
1694
+ } = q(), s = Ia(), { isLocalDev: c } = Ma(), {
1695
+ canEditDashboard: m,
1696
1696
  hasInspectionUser: h,
1697
1697
  inspectionMessage: b,
1698
1698
  isInspectionMode: g,
1699
1699
  isInspectionSurface: u
1700
- } = Pa(), { openBrandStudioPreview: c } = Oa(), { permissions: f } = jn(), i = _a(), { isLoading: x } = Ra(), v = S((d) => d.theme), w = S((d) => d.isDownloadingPdf), D = S(
1700
+ } = Aa(), { openBrandStudioPreview: l } = Pa(), { permissions: f } = jn(), i = Oa(), { isLoading: x } = _a(), v = S((d) => d.theme), w = S((d) => d.isDownloadingPdf), D = S(
1701
1701
  (d) => d.dashboardAssistantDraftScopeKey
1702
- ), E = S((d) => d.lenses), $ = S((d) => d.selectedLensId), L = E == null ? void 0 : E.find((d) => d.id === $), m = S((d) => d.dashboard), G = S((d) => d.selectedSheetId), F = (_t = m == null ? void 0 : m.sheets) == null ? void 0 : _t.find(
1702
+ ), E = S((d) => d.lenses), $ = S((d) => d.selectedLensId), I = E == null ? void 0 : E.find((d) => d.id === $), p = S((d) => d.dashboard), G = S((d) => d.selectedSheetId), F = (Ot = p == null ? void 0 : p.sheets) == null ? void 0 : Ot.find(
1703
1703
  (d) => d.id === G
1704
- ), B = da(F), P = B ? (Rt = F == null ? void 0 : F.document) == null ? void 0 : Rt.page : void 0, k = S(
1704
+ ), B = ia(F), O = B ? (_t = F == null ? void 0 : F.document) == null ? void 0 : _t.page : void 0, k = S(
1705
1705
  (d) => d.isDashboardEditing
1706
- ), { setDashboardTitle: te } = S((d) => d.actions), [re, Q] = N(!1), [we, Ne] = N(!1), [Se, De] = N(!1), [Ce, ie] = N(!1), [ke, de] = N(null), [ae, y] = N(!1), [H, le] = N(!1), [Ee, W] = N(!1), [J, X] = N(null), [xt, Le] = N([]), [vt, Ie] = N(!1), [_r, yt] = N(!1), wt = S((d) => d.filterValues), O = S((d) => d.isVisualEditing);
1707
- $t((d) => d.card);
1708
- const Rr = Fe(
1706
+ ), { setDashboardTitle: re } = S((d) => d.actions), [ae, W] = N(!1), [Se, De] = N(!1), [Ce, ke] = N(!1), [Ee, de] = N(!1), [Le, ce] = N(null), [ne, y] = N(!1), [H, le] = N(!1), [Ie, J] = N(!1), [X, Y] = N(null), [gt, Me] = N([]), [bt, Ae] = N(!1), [Or, xt] = N(!1), vt = S((d) => d.filterValues), _ = S((d) => d.isVisualEditing);
1707
+ Ft((d) => d.card);
1708
+ const _r = Fe(
1709
1709
  (d) => d.selectedDashboard
1710
- ), Ur = Fe(
1710
+ ), Rr = Fe(
1711
1711
  (d) => d.initialDashboard
1712
1712
  );
1713
- Fe((d) => d.selectedVisual), S((d) => d.selectedFrameId), $t((d) => d.frame);
1714
- const Nt = S(
1713
+ Fe((d) => d.selectedVisual), S((d) => d.selectedFrameId), Ft((d) => d.frame);
1714
+ const yt = S(
1715
1715
  (d) => d.showDashboardJSON
1716
- ), ze = S((d) => d.onSaveFunction), { setIsDashboardEditing: St, setShowDashboardJSON: Dt } = S(
1716
+ ), ze = S((d) => d.onSaveFunction), { setIsDashboardEditing: wt, setShowDashboardJSON: Nt } = S(
1717
1717
  (d) => d.actions
1718
- ), { setInitialDashboard: Ct, clearSelectedDashboard: je } = Fe(
1718
+ ), { setInitialDashboard: St, clearSelectedDashboard: je } = Fe(
1719
1719
  (d) => d.actions
1720
- ), ce = !!n.orgUserId || !!(n.tenantId && n.endUserId && n.endUserEmail), { resources: Me } = Ua(rt.DASHBOARD), { data: qe } = Va(), Vr = ((Ut = qe == null ? void 0 : qe.preference) == null ? void 0 : Ut.defaultDashboardId) || null, { mutate: Tr, isPending: Fr } = Ta(), { currentUser: $r } = ht(), Gr = Fa($r), z = Rr || Ur, ne = $a({
1720
+ ), ue = !!n.orgUserId || !!(n.tenantId && n.endUserId && n.endUserEmail), { resources: Pe } = Ra(tt.DASHBOARD), { data: qe } = Ua(), Ur = ((Rt = qe == null ? void 0 : qe.preference) == null ? void 0 : Rt.defaultDashboardId) || null, { mutate: Vr, isPending: Tr } = Va(), { currentUser: Fr } = mt(), $r = Ta(Fr), z = _r || Rr, se = Fa({
1721
1721
  config: n.config,
1722
- canNavigateDashboardHub: ce,
1723
- canShareDashboard: ((Vt = z == null ? void 0 : z.permissions) == null ? void 0 : Vt.canShare) === !0,
1724
- canManageGroups: Gr
1725
- }), kt = z ? {
1722
+ canNavigateDashboardHub: ue,
1723
+ canShareDashboard: ((Ut = z == null ? void 0 : z.permissions) == null ? void 0 : Ut.canShare) === !0,
1724
+ canManageGroups: $r
1725
+ }), Dt = z ? {
1726
1726
  id: z.id,
1727
- title: (m == null ? void 0 : m.title) || z.title || "Dashboard"
1728
- } : null, { handleAddNewFrame: Br } = Ga(), [Ke, Qe] = N(!1), [Hr, ue] = N(!1), [We, Ae] = N("close"), me = Ba(rt.DASHBOARD), [A, Pe] = N(null), zr = async (d, M) => {
1727
+ title: (p == null ? void 0 : p.title) || z.title || "Dashboard"
1728
+ } : null, { handleAddNewFrame: Gr } = $a(), [Ke, Qe] = N(!1), [Br, me] = N(!1), [We, Oe] = N("close"), pe = Ga(tt.DASHBOARD), [P, he] = N(null), Hr = async (d, A) => {
1729
1729
  if (!g) {
1730
- if (!(m != null && m.id)) {
1730
+ if (!(p != null && p.id)) {
1731
1731
  console.log("No dashboard ID found");
1732
1732
  return;
1733
1733
  }
1734
1734
  console.log("Updating dashboard title:", {
1735
- dashboardId: m.id,
1735
+ dashboardId: p.id,
1736
1736
  newTitle: d,
1737
- previousTitle: M
1738
- }), me.mutate(
1737
+ previousTitle: A
1738
+ }), pe.mutate(
1739
1739
  {
1740
- resourceId: m.id,
1740
+ resourceId: p.id,
1741
1741
  data: { title: d }
1742
1742
  },
1743
1743
  {
1744
1744
  onSuccess: () => {
1745
- console.log("Dashboard title updated successfully"), C.success("Dashboard title updated");
1745
+ he(
1746
+ (L) => (L == null ? void 0 : L.dashboard.id) === p.id ? {
1747
+ ...L,
1748
+ dashboard: { ...L.dashboard, title: d }
1749
+ } : L
1750
+ ), C.success("Dashboard title updated");
1746
1751
  },
1747
- onError: (U) => {
1748
- console.error("Failed to update dashboard title:", U), C.error("Failed to update dashboard title"), te(M);
1752
+ onError: (L) => {
1753
+ console.error("Failed to update dashboard title:", L), C.error("Failed to update dashboard title");
1754
+ const K = S.getState().dashboard;
1755
+ (K == null ? void 0 : K.id) === p.id && K.title === d && re(A);
1749
1756
  }
1750
1757
  }
1751
1758
  );
1752
1759
  }
1753
1760
  };
1754
1761
  He(() => {
1755
- if (Me && Me.length > 0) {
1756
- const d = m == null ? void 0 : m.id;
1762
+ if (Pe && Pe.length > 0) {
1763
+ const d = p == null ? void 0 : p.id;
1757
1764
  if (d) {
1758
- const M = Me.find(
1759
- (U) => U.id === d
1765
+ const A = Pe.find(
1766
+ (L) => L.id === d
1760
1767
  );
1761
- M && Ct(M);
1768
+ A && St(A);
1762
1769
  }
1763
1770
  }
1764
- }, [Me, m == null ? void 0 : m.id, Ct]);
1765
- const pe = n.orgUserId || n.tenantId, Je = Z(
1771
+ }, [Pe, p == null ? void 0 : p.id, St]);
1772
+ const fe = n.orgUserId || n.tenantId, Je = ee(
1766
1773
  () => Ns({
1767
1774
  accessToken: t == null ? void 0 : t.accessToken,
1768
- dashboardId: (m == null ? void 0 : m.id) || a || n.dashboard_id,
1775
+ dashboardId: (p == null ? void 0 : p.id) || a || n.dashboard_id,
1769
1776
  selectedSheetId: B ? G : void 0,
1770
- pageSize: P == null ? void 0 : P.size,
1771
- orientation: P == null ? void 0 : P.orientation,
1777
+ pageSize: O == null ? void 0 : O.size,
1778
+ orientation: O == null ? void 0 : O.orientation,
1772
1779
  theme: v
1773
1780
  }),
1774
1781
  [
1775
1782
  t == null ? void 0 : t.accessToken,
1776
1783
  a,
1777
- m == null ? void 0 : m.id,
1784
+ p == null ? void 0 : p.id,
1778
1785
  B,
1779
- P == null ? void 0 : P.orientation,
1780
- P == null ? void 0 : P.size,
1786
+ O == null ? void 0 : O.orientation,
1787
+ O == null ? void 0 : O.size,
1781
1788
  G,
1782
1789
  v,
1783
1790
  n.dashboard_id
1784
1791
  ]
1785
- ), Et = k && !O && !g && pe && p, { setDashboard: Xe } = S((d) => d.actions), Lt = S(
1792
+ ), Ct = k && !_ && !g && fe && m, { setDashboard: Xe } = S((d) => d.actions), kt = S(
1786
1793
  (d) => d.semanticExecutionPayload
1787
- ), jr = () => {
1788
- St(!0);
1789
- }, Oe = () => {
1790
- St(!1), Dt(!1), Pe(null);
1794
+ ), zr = () => {
1795
+ wt(!0);
1796
+ }, _e = () => {
1797
+ wt(!1), Nt(!1), he(null);
1791
1798
  };
1792
1799
  He(() => {
1793
1800
  if (!k) {
1794
- A && Pe(null);
1801
+ P && he(null);
1795
1802
  return;
1796
1803
  }
1797
- A || !m || x || Pe(
1798
- nr(
1799
- m,
1800
- Lt
1804
+ P || !p || x || he(
1805
+ ar(
1806
+ p,
1807
+ kt
1801
1808
  )
1802
1809
  );
1803
1810
  }, [
1804
- m,
1805
- A,
1811
+ p,
1812
+ P,
1806
1813
  k,
1807
1814
  x,
1808
- Lt
1815
+ kt
1809
1816
  ]);
1810
- const _e = (A == null ? void 0 : A.dashboard) ?? null, { isDirty: It, isDirtyPending: qr, resetDirty: he } = En(
1811
- m,
1812
- _e,
1817
+ const Et = (P == null ? void 0 : P.dashboard) ?? null, { isDirty: Lt, isDirtyPending: jr, resetDirty: ge } = kn(
1818
+ p,
1819
+ Et,
1813
1820
  300,
1814
1821
  1e3,
1815
- at
1816
- ), Mt = pn(() => _e ? at(m) !== at(_e) : !1, [m, _e]), At = It || qr, Re = Ke || me.isPending, Kr = () => {
1822
+ En
1823
+ ), It = fn(
1824
+ Et,
1825
+ g,
1826
+ m
1827
+ ), Mt = Lt || jr, Re = Ke || pe.isPending, qr = () => {
1817
1828
  if (g) {
1818
- A && Xe(A.dashboard, {
1819
- semanticExecutionPayload: A.semanticExecutionPayload
1820
- }), Oe(), he();
1829
+ P && Xe(P.dashboard, {
1830
+ semanticExecutionPayload: P.semanticExecutionPayload
1831
+ }), _e(), ge();
1821
1832
  return;
1822
1833
  }
1823
- Mt() ? (Ae("close"), ue(!0)) : (Oe(), he());
1824
- }, Qr = async () => {
1834
+ It() ? (Oe("close"), me(!0)) : (_e(), ge());
1835
+ }, Kr = async () => {
1825
1836
  await Ye({
1826
1837
  closeAfterSave: !0,
1827
1838
  navigateHomeAfterSave: We === "home"
1828
1839
  });
1840
+ }, Qr = () => {
1841
+ const d = We === "home" && !!ue;
1842
+ P && Xe(P.dashboard, {
1843
+ semanticExecutionPayload: P.semanticExecutionPayload
1844
+ }), _e(), d && je(), Oe("close"), me(!1), ge();
1829
1845
  }, Wr = () => {
1830
- const d = We === "home" && !!ce;
1831
- A && Xe(A.dashboard, {
1832
- semanticExecutionPayload: A.semanticExecutionPayload
1833
- }), Oe(), d && je(), Ae("close"), ue(!1), he();
1846
+ P && (Xe(P.dashboard, {
1847
+ semanticExecutionPayload: P.semanticExecutionPayload
1848
+ }), ge());
1834
1849
  }, Jr = () => {
1835
- A && (Xe(A.dashboard, {
1836
- semanticExecutionPayload: A.semanticExecutionPayload
1837
- }), he());
1838
- }, Xr = () => {
1839
- if (ce) {
1840
- if (k && Mt()) {
1841
- Ae("home"), ue(!0);
1850
+ if (ue) {
1851
+ if (k && It()) {
1852
+ Oe("home"), me(!0);
1842
1853
  return;
1843
1854
  }
1844
1855
  je();
@@ -1847,115 +1858,115 @@ function Xs() {
1847
1858
  async function Ye(d) {
1848
1859
  if (g)
1849
1860
  return;
1850
- const M = S.getState().dashboard;
1851
- if (!M)
1861
+ const A = S.getState().dashboard;
1862
+ if (!A)
1852
1863
  return;
1853
- const U = (d == null ? void 0 : d.closeAfterSave) ?? vt, Ze = (d == null ? void 0 : d.navigateHomeAfterSave) ?? !1;
1854
- Ie(U), U && ue(!1);
1855
- const et = lt(M);
1856
- W(!0), X(null), Le([]), Qe(!0);
1857
- const aa = {
1858
- template: M
1864
+ const L = (d == null ? void 0 : d.closeAfterSave) ?? bt, K = (d == null ? void 0 : d.navigateHomeAfterSave) ?? !1;
1865
+ Ae(L), L && me(!1);
1866
+ const Ze = it(A);
1867
+ J(!0), Y(null), Me([]), Qe(!0);
1868
+ const ra = {
1869
+ template: A
1859
1870
  };
1860
- me.mutate(
1871
+ pe.mutate(
1861
1872
  {
1862
- resourceId: M.id,
1863
- data: aa
1873
+ resourceId: A.id,
1874
+ data: ra
1864
1875
  },
1865
1876
  {
1866
- onSuccess: (_) => {
1867
- var Ue, Ve, Ft;
1868
- const Y = (_ == null ? void 0 : _.id) || ((Ue = _ == null ? void 0 : _.dashboard) == null ? void 0 : Ue.id) || ((Ve = _ == null ? void 0 : _.resource) == null ? void 0 : Ve.id) || ((Ft = _ == null ? void 0 : _.template) == null ? void 0 : Ft.id) || null;
1869
- if (!M.id && Y) {
1870
- const tt = ua.getState(), Te = tt.pendingDashboardDraftMigration;
1871
- (Te == null ? void 0 : Te.scopeKey) === D ? tt.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
1872
- Y
1873
- ) : Te && tt.actions.clearPendingDashboardDraftMigration();
1877
+ onSuccess: (R) => {
1878
+ var Ue, Ve, Tt;
1879
+ const Z = (R == null ? void 0 : R.id) || ((Ue = R == null ? void 0 : R.dashboard) == null ? void 0 : Ue.id) || ((Ve = R == null ? void 0 : R.resource) == null ? void 0 : Ve.id) || ((Tt = R == null ? void 0 : R.template) == null ? void 0 : Tt.id) || null;
1880
+ if (!A.id && Z) {
1881
+ const et = la.getState(), Te = et.pendingDashboardDraftMigration;
1882
+ (Te == null ? void 0 : Te.scopeKey) === D ? et.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
1883
+ Z
1884
+ ) : Te && et.actions.clearPendingDashboardDraftMigration();
1874
1885
  }
1875
- Qe(!1), C.success("Dashboard saved!"), Pe(
1876
- nr(
1877
- et,
1886
+ Qe(!1), C.success("Dashboard saved!"), he(
1887
+ ar(
1888
+ Ze,
1878
1889
  S.getState().semanticExecutionPayload
1879
1890
  )
1880
- ), W(!1), Ie(!1), U && (Oe(), he(), Ze && ce && je()), Ae("close");
1891
+ ), J(!1), Ae(!1), L && (_e(), ge(), K && ue && je()), Oe("close");
1881
1892
  },
1882
- onError: (_) => {
1883
- Qe(!1), X("Failed to save dashboard. Please try again.");
1884
- const Y = _.details, Ue = Array.isArray(
1885
- Y == null ? void 0 : Y.errors
1886
- ) ? (Y.errors || []).filter(
1893
+ onError: (R) => {
1894
+ Qe(!1), Y("Failed to save dashboard. Please try again.");
1895
+ const Z = R.details, Ue = Array.isArray(
1896
+ Z == null ? void 0 : Z.errors
1897
+ ) ? (Z.errors || []).filter(
1887
1898
  (Ve) => typeof Ve == "string"
1888
1899
  ) : [];
1889
- Le(
1900
+ Me(
1890
1901
  vs({
1891
1902
  errors: Ue,
1892
- dashboard: M || void 0
1903
+ dashboard: A || void 0
1893
1904
  })
1894
1905
  ), C.error("Failed to save dashboard");
1895
1906
  }
1896
1907
  }
1897
1908
  );
1898
1909
  }
1899
- async function Yr() {
1900
- if (g || (Q(!0), !$ || !L)) return;
1910
+ async function Xr() {
1911
+ if (g || (W(!0), !$ || !I)) return;
1901
1912
  const d = S.getState().dashboard;
1902
1913
  if (!d) {
1903
- Q(!1);
1914
+ W(!1);
1904
1915
  return;
1905
1916
  }
1906
- const M = JSON.stringify(d), U = S.getState(), Ze = vr({
1917
+ const A = JSON.stringify(d), L = S.getState(), K = xr({
1907
1918
  dashboard: d,
1908
- dashboardInputValues: U.dashboardInputValues,
1909
- filterValues: wt,
1910
- controlValues: U.controlValues,
1911
- inlineFilterValuesMap: U.inlineFilterValuesMap,
1912
- cardControlValuesMap: U.cardControlValuesMap
1913
- }), et = {
1914
- ...L,
1915
- template: M,
1916
- filterValues: wt,
1917
- inputValues: Ze
1919
+ dashboardInputValues: L.dashboardInputValues,
1920
+ filterValues: vt,
1921
+ controlValues: L.controlValues,
1922
+ inlineFilterValuesMap: L.inlineFilterValuesMap,
1923
+ cardControlValuesMap: L.cardControlValuesMap
1924
+ }), Ze = {
1925
+ ...I,
1926
+ template: A,
1927
+ filterValues: vt,
1928
+ inputValues: K
1918
1929
  };
1919
- await ut(
1930
+ await ct(
1920
1931
  n.apiServiceUrl,
1921
- et,
1932
+ Ze,
1922
1933
  t == null ? void 0 : t.accessToken
1923
- ), C.success("Lens saved"), ze == null || ze(d), Q(!1);
1934
+ ), C.success("Lens saved"), ze == null || ze(d), W(!1);
1924
1935
  }
1925
- const Pt = (L == null ? void 0 : L.name) || m.title;
1926
- me.isPending && console.log("Title during update:", {
1927
- title: Pt,
1928
- dashboardStateTitle: m.title,
1929
- dashboardId: m == null ? void 0 : m.id,
1930
- currentLensName: L == null ? void 0 : L.name
1936
+ const At = (I == null ? void 0 : I.name) || p.title;
1937
+ pe.isPending && console.log("Title during update:", {
1938
+ title: At,
1939
+ dashboardStateTitle: p.title,
1940
+ dashboardId: p == null ? void 0 : p.id,
1941
+ currentLensName: I == null ? void 0 : I.name
1931
1942
  });
1932
- const Zr = ce && !!(t != null && t.accessToken) && !!(n != null && n.apiServiceUrl), ea = !g && ne.showDashboardHub && Zr, ta = !g && i && ne.showDashboardHub, j = (m == null ? void 0 : m.id) || null, Ot = Ha(
1933
- (Tt = n.config) == null ? void 0 : Tt.showBriefings,
1943
+ const Yr = ue && !!(t != null && t.accessToken) && !!(n != null && n.apiServiceUrl), Zr = !g && se.showDashboardHub && Yr, ea = !g && i && se.showDashboardHub, j = (p == null ? void 0 : p.id) || null, Pt = Ba(
1944
+ (Vt = n.config) == null ? void 0 : Vt.showBriefings,
1934
1945
  r
1935
- ), se = !!j && Vr === j, ra = () => {
1936
- !j || g || Tr({
1937
- dashboardId: se ? null : j
1946
+ ), oe = !!j && Ur === j, ta = () => {
1947
+ !j || g || Vr({
1948
+ dashboardId: oe ? null : j
1938
1949
  });
1939
1950
  };
1940
- return !i && !O ? null : /* @__PURE__ */ o(
1951
+ return !i && !_ ? null : /* @__PURE__ */ o(
1941
1952
  "div",
1942
1953
  {
1943
1954
  className: "flex min-h-11 shrink-0 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-1.5",
1944
1955
  role: "dashboard-controls",
1945
1956
  children: [
1946
1957
  /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
1947
- ta && !O && /* @__PURE__ */ e(
1948
- qt,
1958
+ ea && !_ && /* @__PURE__ */ e(
1959
+ jt,
1949
1960
  {
1950
1961
  "aria-label": "Dashboard Hub",
1951
1962
  tooltip: "Dashboard Hub",
1952
- onClick: Xr,
1963
+ onClick: Jr,
1953
1964
  className: "h-7 w-7 px-0",
1954
1965
  buttonProps: { size: "xs" },
1955
- children: /* @__PURE__ */ e(za, { className: "h-3.5 w-3.5" })
1966
+ children: /* @__PURE__ */ e(Ha, { className: "h-3.5 w-3.5" })
1956
1967
  }
1957
1968
  ),
1958
- !O && i && (x ? /* @__PURE__ */ e(
1969
+ !_ && i && (x ? /* @__PURE__ */ e(
1959
1970
  "div",
1960
1971
  {
1961
1972
  className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
@@ -1965,30 +1976,30 @@ function Xs() {
1965
1976
  }
1966
1977
  ) : /* @__PURE__ */ o(T, { children: [
1967
1978
  /* @__PURE__ */ e(
1968
- ja,
1979
+ za,
1969
1980
  {
1970
- value: Pt || "Untitled Dashboard",
1981
+ value: At || "Untitled Dashboard",
1971
1982
  onSave: (d) => {
1972
1983
  console.log("EditableText onSave called:", {
1973
1984
  newTitle: d,
1974
- canEditDashboard: p,
1975
- dashboardId: m == null ? void 0 : m.id
1985
+ canEditDashboard: m,
1986
+ dashboardId: p == null ? void 0 : p.id
1976
1987
  });
1977
- const M = (m == null ? void 0 : m.title) || "";
1978
- te(d), zr(d, M);
1988
+ const A = (p == null ? void 0 : p.title) || "";
1989
+ re(d), Hr(d, A);
1979
1990
  },
1980
- isEditable: qa({
1991
+ isEditable: ja({
1981
1992
  isDashboardEditing: k,
1982
- canEditDashboard: p === !0 && !g,
1983
- hasCurrentLens: !!L
1993
+ canEditDashboard: m === !0 && !g,
1994
+ hasCurrentLens: !!I
1984
1995
  }),
1985
1996
  displayClassName: "text-[13px] font-medium",
1986
1997
  inputClassName: "text-[13px] font-medium",
1987
1998
  placeholder: "Dashboard Title",
1988
- isPending: me.isPending
1999
+ isPending: pe.isPending
1989
2000
  }
1990
2001
  ),
1991
- ne.showDashboardHub && se && /* @__PURE__ */ e(
2002
+ se.showDashboardHub && oe && /* @__PURE__ */ e(
1992
2003
  "span",
1993
2004
  {
1994
2005
  className: "shrink-0 rounded-[4px] border border-border/60 px-1.5 py-px text-[10px] font-medium uppercase tracking-[0.06em] text-muted-foreground",
@@ -1996,158 +2007,158 @@ function Xs() {
1996
2007
  children: "Default"
1997
2008
  }
1998
2009
  ),
1999
- ea && j && /* @__PURE__ */ e(Gt, { children: /* @__PURE__ */ o(Bt, { children: [
2000
- /* @__PURE__ */ e(Ht, { asChild: !0, children: /* @__PURE__ */ e(
2001
- R,
2010
+ Zr && j && /* @__PURE__ */ e($t, { children: /* @__PURE__ */ o(Gt, { children: [
2011
+ /* @__PURE__ */ e(Bt, { asChild: !0, children: /* @__PURE__ */ e(
2012
+ U,
2002
2013
  {
2003
2014
  variant: "ghost",
2004
2015
  size: "xs",
2005
- onClick: ra,
2006
- disabled: Fr || !(t != null && t.accessToken) || !(n != null && n.apiServiceUrl),
2007
- className: oe(
2016
+ onClick: ta,
2017
+ disabled: Tr || !(t != null && t.accessToken) || !(n != null && n.apiServiceUrl),
2018
+ className: ie(
2008
2019
  "w-7 px-0",
2009
- se ? "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary focus-visible:bg-primary/15" : "text-muted-foreground hover:text-foreground"
2020
+ oe ? "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary focus-visible:bg-primary/15" : "text-muted-foreground hover:text-foreground"
2010
2021
  ),
2011
- "aria-pressed": se,
2012
- "aria-label": se ? "Remove as default dashboard" : "Set as default dashboard",
2022
+ "aria-pressed": oe,
2023
+ "aria-label": oe ? "Remove as default dashboard" : "Set as default dashboard",
2013
2024
  children: /* @__PURE__ */ e(cr, { className: "h-3.5 w-3.5" })
2014
2025
  }
2015
2026
  ) }),
2016
- /* @__PURE__ */ e(zt, { children: /* @__PURE__ */ e("p", { children: se ? "Remove as default dashboard" : "Set as default dashboard" }) })
2027
+ /* @__PURE__ */ e(Ht, { children: /* @__PURE__ */ e("p", { children: oe ? "Remove as default dashboard" : "Set as default dashboard" }) })
2017
2028
  ] }) })
2018
2029
  ] }))
2019
2030
  ] }),
2020
2031
  /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
2021
- O && /* @__PURE__ */ o(T, { children: [
2022
- /* @__PURE__ */ e(bn, {}),
2023
- /* @__PURE__ */ e(xn, {})
2032
+ _ && /* @__PURE__ */ o(T, { children: [
2033
+ /* @__PURE__ */ e(gn, {}),
2034
+ /* @__PURE__ */ e(bn, {})
2024
2035
  ] }),
2025
- !O && i && !g && ne.showDashboardSharing && /* @__PURE__ */ o(
2026
- R,
2036
+ !_ && i && !g && se.showDashboardSharing && /* @__PURE__ */ o(
2037
+ U,
2027
2038
  {
2028
2039
  variant: "outline",
2029
2040
  size: "xs",
2030
- onClick: () => Ne(!0),
2041
+ onClick: () => De(!0),
2031
2042
  children: [
2032
- /* @__PURE__ */ e(Ka, { className: "h-3.5 w-3.5" }),
2043
+ /* @__PURE__ */ e(qa, { className: "h-3.5 w-3.5" }),
2033
2044
  "Share"
2034
2045
  ]
2035
2046
  }
2036
2047
  ),
2037
- !O && k && !g && f.canUseFilters && i && /* @__PURE__ */ e(vn, {}),
2038
- k && !O && !g && pe && L && l && i && /* @__PURE__ */ o(
2039
- R,
2048
+ !_ && k && !g && f.canUseFilters && i && /* @__PURE__ */ e(xn, {}),
2049
+ k && !_ && !g && fe && I && c && i && /* @__PURE__ */ o(
2050
+ U,
2040
2051
  {
2041
2052
  variant: "secondary",
2042
2053
  size: "xs",
2043
- disabled: re,
2044
- onClick: Yr,
2054
+ disabled: ae,
2055
+ onClick: Xr,
2045
2056
  children: [
2046
- /* @__PURE__ */ e(Zt, { className: "h-3.5 w-3.5" }),
2057
+ /* @__PURE__ */ e(Yt, { className: "h-3.5 w-3.5" }),
2047
2058
  "Save Lens"
2048
2059
  ]
2049
2060
  }
2050
2061
  ),
2051
- k && !O && !g && i && !B && /* @__PURE__ */ o("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
2062
+ k && !_ && !g && i && !B && /* @__PURE__ */ o("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
2052
2063
  /* @__PURE__ */ o(
2053
- R,
2064
+ U,
2054
2065
  {
2055
2066
  variant: "ghost",
2056
2067
  size: "xs",
2057
2068
  disabled: !k,
2058
- onClick: () => void Br(),
2069
+ onClick: () => void Gr(),
2059
2070
  className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
2060
2071
  children: [
2061
- /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" }),
2072
+ /* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5" }),
2062
2073
  "Visual"
2063
2074
  ]
2064
2075
  }
2065
2076
  ),
2066
- /* @__PURE__ */ o(Kt, { modal: !1, children: [
2067
- /* @__PURE__ */ e(Qt, { asChild: !0, children: /* @__PURE__ */ e(
2068
- R,
2077
+ /* @__PURE__ */ o(qt, { modal: !1, children: [
2078
+ /* @__PURE__ */ e(Kt, { asChild: !0, children: /* @__PURE__ */ e(
2079
+ U,
2069
2080
  {
2070
2081
  variant: "ghost",
2071
2082
  size: "xs",
2072
2083
  className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
2073
2084
  "aria-label": "Open visual options",
2074
2085
  disabled: !k,
2075
- children: /* @__PURE__ */ e(un, { className: "h-3.5 w-3.5" })
2086
+ children: /* @__PURE__ */ e(ln, { className: "h-3.5 w-3.5" })
2076
2087
  }
2077
2088
  ) }),
2078
2089
  /* @__PURE__ */ e(
2079
- Wt,
2090
+ Qt,
2080
2091
  {
2081
2092
  align: "end",
2082
2093
  className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
2083
- children: /* @__PURE__ */ o(V, { onClick: () => yt(!0), children: [
2084
- /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" }),
2094
+ children: /* @__PURE__ */ o(V, { onClick: () => xt(!0), children: [
2095
+ /* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5" }),
2085
2096
  "From library..."
2086
2097
  ] })
2087
2098
  }
2088
2099
  )
2089
2100
  ] }),
2090
2101
  /* @__PURE__ */ e(
2091
- yn,
2102
+ vn,
2092
2103
  {
2093
- open: _r,
2094
- onOpenChange: yt
2104
+ open: Or,
2105
+ onOpenChange: xt
2095
2106
  }
2096
2107
  )
2097
2108
  ] }),
2098
- !O && !k && (p || g) && (!u || !h || p !== void 0) && i && /* @__PURE__ */ o("div", { className: "inline-flex items-center gap-1", children: [
2099
- /* @__PURE__ */ o(R, { size: "xs", onClick: jr, children: [
2100
- /* @__PURE__ */ e(Qa, { className: "h-3.5 w-3.5" }),
2109
+ !_ && !k && (m || g) && (!u || !h || m !== void 0) && i && /* @__PURE__ */ o("div", { className: "inline-flex items-center gap-1", children: [
2110
+ /* @__PURE__ */ o(U, { size: "xs", onClick: zr, children: [
2111
+ /* @__PURE__ */ e(Ka, { className: "h-3.5 w-3.5" }),
2101
2112
  g ? "Inspect" : "Edit"
2102
2113
  ] }),
2103
- b ? /* @__PURE__ */ e(Gt, { children: /* @__PURE__ */ o(Bt, { children: [
2104
- /* @__PURE__ */ e(Ht, { asChild: !0, children: /* @__PURE__ */ e(
2114
+ b ? /* @__PURE__ */ e($t, { children: /* @__PURE__ */ o(Gt, { children: [
2115
+ /* @__PURE__ */ e(Bt, { asChild: !0, children: /* @__PURE__ */ e(
2105
2116
  "button",
2106
2117
  {
2107
2118
  type: "button",
2108
2119
  "aria-label": b,
2109
2120
  className: "inline-flex size-6 items-center justify-center rounded-control text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
2110
- children: /* @__PURE__ */ e(la, { "aria-hidden": "true", className: "size-3.5" })
2121
+ children: /* @__PURE__ */ e(da, { "aria-hidden": "true", className: "size-3.5" })
2111
2122
  }
2112
2123
  ) }),
2113
- /* @__PURE__ */ e(zt, { children: /* @__PURE__ */ e("p", { children: b }) })
2124
+ /* @__PURE__ */ e(Ht, { children: /* @__PURE__ */ e("p", { children: b }) })
2114
2125
  ] }) }) : null
2115
2126
  ] }),
2116
- Et && i && It && /* @__PURE__ */ o(
2117
- R,
2127
+ Ct && i && Lt && /* @__PURE__ */ o(
2128
+ U,
2118
2129
  {
2119
2130
  variant: "outline",
2120
2131
  size: "xs",
2121
- onClick: Jr,
2132
+ onClick: Wr,
2122
2133
  disabled: Re,
2123
2134
  children: [
2124
- /* @__PURE__ */ e(Wa, { className: "h-3.5 w-3.5" }),
2135
+ /* @__PURE__ */ e(Qa, { className: "h-3.5 w-3.5" }),
2125
2136
  "Undo"
2126
2137
  ]
2127
2138
  }
2128
2139
  ),
2129
- Et && i && /* @__PURE__ */ o(
2130
- R,
2140
+ Ct && i && /* @__PURE__ */ o(
2141
+ U,
2131
2142
  {
2132
2143
  size: "xs",
2133
- className: oe(!At && "opacity-60"),
2134
- disabled: Re || !At,
2144
+ className: ie(!Mt && "opacity-60"),
2145
+ disabled: Re || !Mt,
2135
2146
  onClick: () => Ye(),
2136
2147
  children: [
2137
- Re ? /* @__PURE__ */ e(Be, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Zt, { className: "h-3.5 w-3.5" }),
2148
+ Re ? /* @__PURE__ */ e(Be, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Yt, { className: "h-3.5 w-3.5" }),
2138
2149
  Re ? "Saving..." : "Save"
2139
2150
  ]
2140
2151
  }
2141
2152
  ),
2142
- k && !O && i && /* @__PURE__ */ o(R, { variant: "outline", size: "xs", onClick: Kr, children: [
2143
- /* @__PURE__ */ e(ur, { className: "h-3.5 w-3.5" }),
2153
+ k && !_ && i && /* @__PURE__ */ o(U, { variant: "outline", size: "xs", onClick: qr, children: [
2154
+ /* @__PURE__ */ e(lr, { className: "h-3.5 w-3.5" }),
2144
2155
  "Close"
2145
2156
  ] }),
2146
- !O && i && /* @__PURE__ */ e("div", { className: "ml-2 flex items-center", children: /* @__PURE__ */ e(wn, {}) }),
2147
- !O && l && /* @__PURE__ */ e(Fn, {}),
2148
- !O && i && !g && /* @__PURE__ */ o(Kt, { children: [
2149
- /* @__PURE__ */ e(Qt, { asChild: !0, children: /* @__PURE__ */ e(
2150
- qt,
2157
+ !_ && i && /* @__PURE__ */ e("div", { className: "ml-2 flex items-center", children: /* @__PURE__ */ e(yn, {}) }),
2158
+ !_ && c && /* @__PURE__ */ e(Fn, {}),
2159
+ !_ && i && !g && /* @__PURE__ */ o(qt, { children: [
2160
+ /* @__PURE__ */ e(Kt, { asChild: !0, children: /* @__PURE__ */ e(
2161
+ jt,
2151
2162
  {
2152
2163
  tooltip: "More Options",
2153
2164
  className: "w-7 px-0 text-muted-foreground hover:text-foreground",
@@ -2156,23 +2167,23 @@ function Xs() {
2156
2167
  variant: "ghost",
2157
2168
  "aria-label": "More dashboard options"
2158
2169
  },
2159
- children: /* @__PURE__ */ e(Ja, { className: "h-3.5 w-3.5" })
2170
+ children: /* @__PURE__ */ e(Wa, { className: "h-3.5 w-3.5" })
2160
2171
  }
2161
2172
  ) }),
2162
2173
  /* @__PURE__ */ o(
2163
- Wt,
2174
+ Qt,
2164
2175
  {
2165
2176
  align: "end",
2166
2177
  className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
2167
2178
  children: [
2168
- /* @__PURE__ */ e(be, { children: "Reports & briefings" }),
2179
+ /* @__PURE__ */ e(ve, { children: "Reports & briefings" }),
2169
2180
  /* @__PURE__ */ o(
2170
2181
  V,
2171
2182
  {
2172
2183
  disabled: w,
2173
2184
  onSelect: () => le(!0),
2174
2185
  children: [
2175
- /* @__PURE__ */ e(Xa, { className: "h-3.5 w-3.5" }),
2186
+ /* @__PURE__ */ e(Ja, { className: "h-3.5 w-3.5" }),
2176
2187
  "Export"
2177
2188
  ]
2178
2189
  }
@@ -2180,35 +2191,35 @@ function Xs() {
2180
2191
  /* @__PURE__ */ e(
2181
2192
  ws,
2182
2193
  {
2183
- scheduleReportVisible: !!(Ot && s.surfaceVisible && j && !k),
2184
- analyticalBriefingVisible: !!(Ot && s.surfaceVisible && j && !k),
2185
- onScheduleReport: () => de("scheduled_report"),
2186
- onCreateAnalyticalBriefing: () => de("analytical_briefing")
2194
+ scheduleReportVisible: !!(Pt && s.surfaceVisible && j && !k),
2195
+ analyticalBriefingVisible: !!(Pt && s.surfaceVisible && j && !k),
2196
+ onScheduleReport: () => ce("scheduled_report"),
2197
+ onCreateAnalyticalBriefing: () => ce("analytical_briefing")
2187
2198
  }
2188
2199
  ),
2189
2200
  /* @__PURE__ */ e(Ge, {}),
2190
- ne.showGroupManagement && /* @__PURE__ */ o(T, { children: [
2191
- /* @__PURE__ */ e(be, { children: "Access" }),
2201
+ se.showGroupManagement && /* @__PURE__ */ o(T, { children: [
2202
+ /* @__PURE__ */ e(ve, { children: "Access" }),
2192
2203
  /* @__PURE__ */ o(
2193
2204
  V,
2194
2205
  {
2195
- onClick: () => De(!0),
2206
+ onClick: () => ke(!0),
2196
2207
  children: [
2197
- /* @__PURE__ */ e(pr, { className: "h-3.5 w-3.5" }),
2208
+ /* @__PURE__ */ e(mr, { className: "h-3.5 w-3.5" }),
2198
2209
  "Manage Groups"
2199
2210
  ]
2200
2211
  }
2201
2212
  ),
2202
2213
  /* @__PURE__ */ e(Ge, {})
2203
2214
  ] }),
2204
- /* @__PURE__ */ e(be, { children: "Preferences" }),
2205
- /* @__PURE__ */ o(V, { onClick: () => ie(!0), children: [
2206
- /* @__PURE__ */ e(hr, { className: "h-3.5 w-3.5" }),
2215
+ /* @__PURE__ */ e(ve, { children: "Preferences" }),
2216
+ /* @__PURE__ */ o(V, { onClick: () => de(!0), children: [
2217
+ /* @__PURE__ */ e(pr, { className: "h-3.5 w-3.5" }),
2207
2218
  "Report preferences"
2208
2219
  ] }),
2209
- l && i && /* @__PURE__ */ o(T, { children: [
2220
+ c && i && /* @__PURE__ */ o(T, { children: [
2210
2221
  /* @__PURE__ */ e(Ge, {}),
2211
- /* @__PURE__ */ e(be, { children: "Developer" }),
2222
+ /* @__PURE__ */ e(ve, { children: "Developer" }),
2212
2223
  /* @__PURE__ */ o(
2213
2224
  V,
2214
2225
  {
@@ -2219,7 +2230,7 @@ function Xs() {
2219
2230
  ).catch(() => C.error("Unable to copy token")) : C.error("Clipboard not available"));
2220
2231
  },
2221
2232
  children: [
2222
- /* @__PURE__ */ e(Jt, { className: "h-3.5 w-3.5" }),
2233
+ /* @__PURE__ */ e(Wt, { className: "h-3.5 w-3.5" }),
2223
2234
  "Copy token"
2224
2235
  ]
2225
2236
  }
@@ -2247,7 +2258,7 @@ function Xs() {
2247
2258
  ) : C.error("Clipboard not available");
2248
2259
  },
2249
2260
  children: [
2250
- /* @__PURE__ */ e(Jt, { className: "h-3.5 w-3.5" }),
2261
+ /* @__PURE__ */ e(Wt, { className: "h-3.5 w-3.5" }),
2251
2262
  "Copy local document PDF URL"
2252
2263
  ]
2253
2264
  }
@@ -2262,118 +2273,118 @@ function Xs() {
2262
2273
  ]
2263
2274
  }
2264
2275
  ),
2265
- /* @__PURE__ */ o(V, { onSelect: c, children: [
2276
+ /* @__PURE__ */ o(V, { onSelect: l, children: [
2266
2277
  /* @__PURE__ */ e(Ln, { className: "h-3.5 w-3.5" }),
2267
2278
  "Brand Studio"
2268
2279
  ] }),
2269
2280
  k && /* @__PURE__ */ o(
2270
2281
  V,
2271
2282
  {
2272
- onSelect: () => Dt(!Nt),
2283
+ onSelect: () => Nt(!yt),
2273
2284
  children: [
2274
2285
  /* @__PURE__ */ e(In, { className: "h-3.5 w-3.5" }),
2275
- Nt ? "Hide dashboard JSON" : "Show dashboard JSON"
2286
+ yt ? "Hide dashboard JSON" : "Show dashboard JSON"
2276
2287
  ]
2277
2288
  }
2278
2289
  ),
2279
- pe && k && /* @__PURE__ */ o(V, { onSelect: () => y(!0), children: [
2280
- /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" }),
2290
+ fe && k && /* @__PURE__ */ o(V, { onSelect: () => y(!0), children: [
2291
+ /* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5" }),
2281
2292
  "Add lens"
2282
2293
  ] }),
2283
- pe && /* @__PURE__ */ o(Ya, { children: [
2284
- /* @__PURE__ */ o(Za, { children: [
2294
+ fe && /* @__PURE__ */ o(Xa, { children: [
2295
+ /* @__PURE__ */ o(Ya, { children: [
2285
2296
  /* @__PURE__ */ e(Mn, { className: "h-3.5 w-3.5" }),
2286
2297
  "Lenses"
2287
2298
  ] }),
2288
- /* @__PURE__ */ e(en, { className: "w-60", children: /* @__PURE__ */ e(zn, {}) })
2299
+ /* @__PURE__ */ e(Za, { className: "w-60", children: /* @__PURE__ */ e(zn, {}) })
2289
2300
  ] })
2290
2301
  ] })
2291
2302
  ]
2292
2303
  }
2293
2304
  )
2294
2305
  ] }),
2295
- we && kt && /* @__PURE__ */ e(
2296
- tn,
2306
+ Se && Dt && /* @__PURE__ */ e(
2307
+ en,
2297
2308
  {
2298
- resource: kt,
2299
- resourceType: rt.DASHBOARD,
2300
- onClose: () => Ne(!1)
2309
+ resource: Dt,
2310
+ resourceType: tt.DASHBOARD,
2311
+ onClose: () => De(!1)
2301
2312
  }
2302
2313
  ),
2303
- ne.showGroupManagement && /* @__PURE__ */ e(
2314
+ se.showGroupManagement && /* @__PURE__ */ e(
2304
2315
  ms,
2305
2316
  {
2306
- open: Se,
2307
- onOpenChange: De
2317
+ open: Ce,
2318
+ onOpenChange: ke
2308
2319
  }
2309
2320
  ),
2310
2321
  /* @__PURE__ */ e(
2311
- kn,
2322
+ Cn,
2312
2323
  {
2313
- open: Ce,
2314
- onOpenChange: ie
2324
+ open: Ee,
2325
+ onOpenChange: de
2315
2326
  }
2316
2327
  ),
2317
- j && ke ? /* @__PURE__ */ e(
2318
- Nn,
2328
+ j && Le ? /* @__PURE__ */ e(
2329
+ wn,
2319
2330
  {
2320
2331
  dashboardId: j,
2321
- dashboardTitle: (m == null ? void 0 : m.title) || (z == null ? void 0 : z.title),
2332
+ dashboardTitle: (p == null ? void 0 : p.title) || (z == null ? void 0 : z.title),
2322
2333
  open: !0,
2323
2334
  onOpenChange: (d) => {
2324
- d || de(null);
2335
+ d || ce(null);
2325
2336
  },
2326
2337
  hideTrigger: !0,
2327
- workflowIntent: ke
2338
+ workflowIntent: Le
2328
2339
  }
2329
2340
  ) : null,
2330
- l && pe && i && /* @__PURE__ */ e(Hn, { open: ae, onOpenChange: y }),
2341
+ c && fe && i && /* @__PURE__ */ e(Hn, { open: ne, onOpenChange: y }),
2331
2342
  i && /* @__PURE__ */ e(
2332
- rn,
2343
+ tn,
2333
2344
  {
2334
2345
  open: H,
2335
2346
  onOpenChange: le
2336
2347
  }
2337
2348
  ),
2338
2349
  /* @__PURE__ */ e(
2339
- an,
2350
+ rn,
2340
2351
  {
2341
- open: Ee,
2352
+ open: Ie,
2342
2353
  onOpenChange: (d) => {
2343
- !d && Ke && !J || (W(d), d || (X(null), Le([]), Ie(!1)));
2354
+ !d && Ke && !X || (J(d), d || (Y(null), Me([]), Ae(!1)));
2344
2355
  },
2345
- children: /* @__PURE__ */ o(nn, { className: "max-w-sm", children: [
2346
- /* @__PURE__ */ o(sn, { children: [
2347
- /* @__PURE__ */ e(on, { children: J ? "Save failed" : "Saving dashboard" }),
2348
- /* @__PURE__ */ e(dn, { className: "pt-2", children: J ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
2349
- xt.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
2356
+ children: /* @__PURE__ */ o(an, { className: "max-w-sm", children: [
2357
+ /* @__PURE__ */ o(nn, { children: [
2358
+ /* @__PURE__ */ e(sn, { children: X ? "Save failed" : "Saving dashboard" }),
2359
+ /* @__PURE__ */ e(on, { className: "pt-2", children: X ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
2360
+ gt.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
2350
2361
  /* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
2351
- /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: xt.slice(0, 5).map((d) => /* @__PURE__ */ e("li", { children: d }, d)) })
2362
+ /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: gt.slice(0, 5).map((d) => /* @__PURE__ */ e("li", { children: d }, d)) })
2352
2363
  ] })
2353
2364
  ] }),
2354
- /* @__PURE__ */ e(ln, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: J ? /* @__PURE__ */ o(T, { children: [
2365
+ /* @__PURE__ */ e(dn, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: X ? /* @__PURE__ */ o(T, { children: [
2355
2366
  /* @__PURE__ */ e(
2356
2367
  cn,
2357
2368
  {
2358
2369
  onClick: () => {
2359
- W(!1), X(null), Le([]), Ie(!1);
2370
+ J(!1), Y(null), Me([]), Ae(!1);
2360
2371
  },
2361
2372
  className: "m-0",
2362
2373
  children: "Close"
2363
2374
  }
2364
2375
  ),
2365
2376
  /* @__PURE__ */ e(
2366
- Xt,
2377
+ Jt,
2367
2378
  {
2368
2379
  onClick: () => Ye({
2369
- closeAfterSave: vt,
2380
+ closeAfterSave: bt,
2370
2381
  navigateHomeAfterSave: We === "home"
2371
2382
  }),
2372
2383
  className: "m-0",
2373
2384
  children: "Retry"
2374
2385
  }
2375
2386
  )
2376
- ] }) : /* @__PURE__ */ o(Xt, { disabled: !0, className: "m-0 cursor-default", children: [
2387
+ ] }) : /* @__PURE__ */ o(Jt, { disabled: !0, className: "m-0 cursor-default", children: [
2377
2388
  /* @__PURE__ */ e(Be, { className: "mr-2 h-4 w-4 animate-spin" }),
2378
2389
  "Saving..."
2379
2390
  ] }) })
@@ -2381,17 +2392,17 @@ function Xs() {
2381
2392
  }
2382
2393
  ),
2383
2394
  /* @__PURE__ */ e(
2384
- Sn,
2395
+ Nn,
2385
2396
  {
2386
- open: Hr,
2397
+ open: Br,
2387
2398
  onOpenChange: (d) => {
2388
- ue(d);
2399
+ me(d);
2389
2400
  },
2390
- onSave: Qr,
2391
- onDiscard: Wr,
2401
+ onSave: Kr,
2402
+ onDiscard: Qr,
2392
2403
  isSaving: Ke,
2393
2404
  saveLabel: "Save",
2394
- discardLabel: "Discard"
2405
+ discardLabel: "Discard changes"
2395
2406
  }
2396
2407
  )
2397
2408
  ] })
@@ -2405,14 +2416,14 @@ function Ns({
2405
2416
  selectedSheetId: a,
2406
2417
  pageSize: r,
2407
2418
  orientation: s,
2408
- theme: l
2419
+ theme: c
2409
2420
  }) {
2410
2421
  if (!t || !a)
2411
2422
  return null;
2412
- const p = new URL("http://localhost:5173/print-document");
2413
- p.searchParams.set("token", t), n && p.searchParams.set("dashboardId", n), p.searchParams.set("selectedSheetId", a), l && p.searchParams.set("theme", l);
2423
+ const m = new URL("http://localhost:5173/print-document");
2424
+ m.searchParams.set("token", t), n && m.searchParams.set("dashboardId", n), m.searchParams.set("selectedSheetId", a), c && m.searchParams.set("theme", c);
2414
2425
  const h = new URL("http://127.0.0.1:3002/");
2415
- return h.searchParams.set("pdfMode", "document"), h.searchParams.set("pageSize", r || "letter"), h.searchParams.set("orientation", s || "portrait"), h.searchParams.set("url", p.toString()), h.toString();
2426
+ return h.searchParams.set("pdfMode", "document"), h.searchParams.set("pageSize", r || "letter"), h.searchParams.set("orientation", s || "portrait"), h.searchParams.set("url", m.toString()), h.toString();
2416
2427
  }
2417
2428
  export {
2418
2429
  Xs as default