react-semaphor 0.1.216 → 0.1.217
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.
- package/dist/chunks/{dashboard-controls-CE14Z5GT.js → dashboard-controls-DLjwyISu.js} +546 -469
- package/dist/chunks/dashboard-controls-p-PLTBKo.js +47 -0
- package/dist/chunks/{dashboard-json-BlcehrzA.js → dashboard-json-DC8Hr2u7.js} +1 -1
- package/dist/chunks/{dashboard-json-CB-PjFQp.js → dashboard-json-Dy8OL7sx.js} +5 -5
- package/dist/chunks/{dashboard-summary-settings-dialog-95pmx2I6.js → dashboard-summary-settings-dialog-CQISZPzc.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-ZzGDw_NF.js → dashboard-summary-settings-dialog-Dlzv-d9Z.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DE2g9so9.js → edit-dashboard-visual-DAiqFH7i.js} +9 -9
- package/dist/chunks/{edit-dashboard-visual-BCzL8qte.js → edit-dashboard-visual-DkZya-OV.js} +2649 -2653
- package/dist/chunks/{editor-action-buttons-BkCIjblw.js → editor-action-buttons-4-UuoSZc.js} +1 -1
- package/dist/chunks/{editor-action-buttons-CL_G2bSD.js → editor-action-buttons-BQtxnqBZ.js} +2 -2
- package/dist/chunks/index-CRJ97-41.js +1098 -0
- package/dist/chunks/{index-C0uTSIns.js → index-Cr-d0ray.js} +27061 -27643
- package/dist/chunks/{notification-bell-ym2iwJpw.js → notification-bell-CyZx_uZ1.js} +1 -1
- package/dist/chunks/{notification-bell-DZukXqhn.js → notification-bell-_OADjyy7.js} +37 -37
- package/dist/chunks/{resource-management-panel-BVKxC2EW.js → resource-management-panel-Bq9zRYsk.js} +1 -1
- package/dist/chunks/{resource-management-panel-DGVVs8UM.js → resource-management-panel-rmEMdbbS.js} +33 -33
- package/dist/chunks/{use-role-aware-display-preferences-c-dmtisM.js → use-role-aware-display-preferences-1U-ed07h.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-v3z-8Fyh.js → use-role-aware-display-preferences-DOA8kcfK.js} +1 -1
- package/dist/chunks/{use-visual-utils-CaYg_mFN.js → use-visual-utils-DX-4Hwoe.js} +1 -1
- package/dist/chunks/{use-visual-utils-Ba5nPP3L.js → use-visual-utils-DxigSU7y.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +9 -4
- package/dist/types/main.d.ts +17 -8
- package/dist/types/shared.d.ts +9 -4
- package/dist/types/surfboard.d.ts +9 -4
- package/dist/types/types.d.ts +9 -4
- package/package.json +2 -1
- package/dist/chunks/dashboard-controls-AyLbHPY7.js +0 -47
- package/dist/chunks/index-BL3sySXQ.js +0 -1109
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as a, jsx as e, Fragment as
|
|
2
|
-
import { bS as Z, cS as Na, u as w, c8 as
|
|
3
|
-
import * as
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { bS as Z, cS as Na, u as w, c8 as ze, c9 as Be, B as L, cb as Ke, cc as H, cT as Qe, Z as xs, l as G, m as We, cU as Sa, c7 as Je, n as Xe, o as Ze, p as Ye, q as Ds, L as Ue, Q as oe, G as wa, ac as j, cV as xa, cg as Da, cW as Ca, cX as vs, cY as Cs, c as X, cZ as Ls, U as be, c_ as ye, I as A, c$ as Es, cH as La, d0 as Ea, H as q, cf as V, d1 as ka, d2 as Aa, d3 as Re, d4 as Ma, d5 as Oa, d6 as ks, d7 as As, d8 as ge, d9 as ve, cD as Ge, cm as Fe, da as je, ch as Ms, db as He, dc as Os, e as Is, dd as Ia, cp as Ts, cq as _s, cr as Ps, cs as Us, ct as Rs, cu as Gs, cv as Fs, cw as qe, c6 as Ta, de as _a, ai as Pa, a1 as bs, ah as pe, df as Ua, ao as Ra, aj as Ie, dg as Ga, dh as Fa, di as ja, aD as Ha, dj as qa, dk as Va, bZ as $a, b_ as za, b$ as Ba, dl as Ka, c1 as Qa, cd as Wa, av as Ja, dm as Xa, dn as Za, dp as Ya, dq as et, dr as st, ds as at, ca as tt, ae as nt, cj as rt, dt as ot, an as it, af as lt, au as ct } from "./index-Cr-d0ray.js";
|
|
3
|
+
import * as E from "react";
|
|
4
4
|
import js, { useState as S, useMemo as fe, useEffect as dt, useCallback as ut } from "react";
|
|
5
5
|
import "react-dom";
|
|
6
|
-
import { b as mt, u as ht, c as pt, A as ft, V as gt, N as vt, U as bt } from "./notification-bell-
|
|
7
|
-
import { u as yt } from "./use-role-aware-display-preferences-
|
|
6
|
+
import { b as mt, u as ht, c as pt, A as ft, V as gt, N as vt, U as bt } from "./notification-bell-_OADjyy7.js";
|
|
7
|
+
import { u as yt } from "./use-role-aware-display-preferences-DOA8kcfK.js";
|
|
8
8
|
import { d as Nt } from "./date-formatter-Y8Za1ib3.js";
|
|
9
|
-
import { C as St, D as wt } from "./dashboard-summary-settings-dialog-
|
|
9
|
+
import { C as St, D as wt } from "./dashboard-summary-settings-dialog-CQISZPzc.js";
|
|
10
10
|
import { u as xt } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
11
11
|
import { s as Te } from "./normalize-dashboard-for-dirty-check-Bn27S0PN.js";
|
|
12
|
-
import { S as ys } from "./editor-action-buttons-
|
|
12
|
+
import { S as ys } from "./editor-action-buttons-BQtxnqBZ.js";
|
|
13
13
|
/**
|
|
14
14
|
* @license lucide-react v0.453.0 - ISC
|
|
15
15
|
*
|
|
@@ -60,7 +60,7 @@ const Et = Z("Moon", [
|
|
|
60
60
|
* This source code is licensed under the ISC license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
62
|
*/
|
|
63
|
-
const
|
|
63
|
+
const kt = Z("ShieldX", [
|
|
64
64
|
[
|
|
65
65
|
"path",
|
|
66
66
|
{
|
|
@@ -77,7 +77,7 @@ const At = Z("ShieldX", [
|
|
|
77
77
|
* This source code is licensed under the ISC license.
|
|
78
78
|
* See the LICENSE file in the root directory of this source tree.
|
|
79
79
|
*/
|
|
80
|
-
const
|
|
80
|
+
const At = Z("Sun", [
|
|
81
81
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
82
82
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
83
83
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -103,43 +103,43 @@ function Mt() {
|
|
|
103
103
|
if (Ns) return _e;
|
|
104
104
|
Ns = 1;
|
|
105
105
|
var s = js;
|
|
106
|
-
function
|
|
107
|
-
return d ===
|
|
106
|
+
function n(d, h) {
|
|
107
|
+
return d === h && (d !== 0 || 1 / d === 1 / h) || d !== d && h !== h;
|
|
108
108
|
}
|
|
109
|
-
var t = typeof Object.is == "function" ? Object.is :
|
|
110
|
-
function
|
|
111
|
-
var
|
|
112
|
-
return
|
|
109
|
+
var t = typeof Object.is == "function" ? Object.is : n, r = s.useState, l = s.useEffect, i = s.useLayoutEffect, u = s.useDebugValue;
|
|
110
|
+
function m(d, h) {
|
|
111
|
+
var p = h(), g = r({ inst: { value: p, getSnapshot: h } }), y = g[0].inst, N = g[1];
|
|
112
|
+
return i(
|
|
113
113
|
function() {
|
|
114
|
-
y.value =
|
|
114
|
+
y.value = p, y.getSnapshot = h, f(y) && N({ inst: y });
|
|
115
115
|
},
|
|
116
|
-
[d,
|
|
116
|
+
[d, p, h]
|
|
117
117
|
), l(
|
|
118
118
|
function() {
|
|
119
|
-
return
|
|
120
|
-
|
|
119
|
+
return f(y) && N({ inst: y }), d(function() {
|
|
120
|
+
f(y) && N({ inst: y });
|
|
121
121
|
});
|
|
122
122
|
},
|
|
123
123
|
[d]
|
|
124
|
-
), u(
|
|
124
|
+
), u(p), p;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
var
|
|
126
|
+
function f(d) {
|
|
127
|
+
var h = d.getSnapshot;
|
|
128
128
|
d = d.value;
|
|
129
129
|
try {
|
|
130
|
-
var
|
|
131
|
-
return !t(d,
|
|
130
|
+
var p = h();
|
|
131
|
+
return !t(d, p);
|
|
132
132
|
} catch {
|
|
133
133
|
return !0;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
return
|
|
136
|
+
function b(d, h) {
|
|
137
|
+
return h();
|
|
138
138
|
}
|
|
139
|
-
var
|
|
140
|
-
return _e.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore :
|
|
139
|
+
var c = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? b : m;
|
|
140
|
+
return _e.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : c, _e;
|
|
141
141
|
}
|
|
142
|
-
var
|
|
142
|
+
var Pe = {};
|
|
143
143
|
/**
|
|
144
144
|
* @license React
|
|
145
145
|
* use-sync-external-store-shim.development.js
|
|
@@ -152,66 +152,66 @@ var Ue = {};
|
|
|
152
152
|
var Ss;
|
|
153
153
|
function Ot() {
|
|
154
154
|
return Ss || (Ss = 1, process.env.NODE_ENV !== "production" && function() {
|
|
155
|
-
function s(
|
|
156
|
-
return
|
|
155
|
+
function s(p, g) {
|
|
156
|
+
return p === g && (p !== 0 || 1 / p === 1 / g) || p !== p && g !== g;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
|
|
158
|
+
function n(p, g) {
|
|
159
|
+
c || l.startTransition === void 0 || (c = !0, console.error(
|
|
160
160
|
"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."
|
|
161
161
|
));
|
|
162
|
-
var y =
|
|
162
|
+
var y = g();
|
|
163
163
|
if (!d) {
|
|
164
|
-
var N =
|
|
165
|
-
|
|
164
|
+
var N = g();
|
|
165
|
+
i(y, N) || (console.error(
|
|
166
166
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
167
167
|
), d = !0);
|
|
168
168
|
}
|
|
169
169
|
N = u({
|
|
170
|
-
inst: { value: y, getSnapshot:
|
|
170
|
+
inst: { value: y, getSnapshot: g }
|
|
171
171
|
});
|
|
172
|
-
var
|
|
173
|
-
return
|
|
172
|
+
var k = N[0].inst, T = N[1];
|
|
173
|
+
return f(
|
|
174
174
|
function() {
|
|
175
|
-
|
|
175
|
+
k.value = y, k.getSnapshot = g, t(k) && T({ inst: k });
|
|
176
176
|
},
|
|
177
|
-
[
|
|
178
|
-
),
|
|
177
|
+
[p, y, g]
|
|
178
|
+
), m(
|
|
179
179
|
function() {
|
|
180
|
-
return t(
|
|
181
|
-
t(
|
|
180
|
+
return t(k) && T({ inst: k }), p(function() {
|
|
181
|
+
t(k) && T({ inst: k });
|
|
182
182
|
});
|
|
183
183
|
},
|
|
184
|
-
[
|
|
185
|
-
),
|
|
184
|
+
[p]
|
|
185
|
+
), b(y), y;
|
|
186
186
|
}
|
|
187
|
-
function t(
|
|
188
|
-
var
|
|
189
|
-
|
|
187
|
+
function t(p) {
|
|
188
|
+
var g = p.getSnapshot;
|
|
189
|
+
p = p.value;
|
|
190
190
|
try {
|
|
191
|
-
var y =
|
|
192
|
-
return !
|
|
191
|
+
var y = g();
|
|
192
|
+
return !i(p, y);
|
|
193
193
|
} catch {
|
|
194
194
|
return !0;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
function r(
|
|
198
|
-
return
|
|
197
|
+
function r(p, g) {
|
|
198
|
+
return g();
|
|
199
199
|
}
|
|
200
200
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
201
|
-
var l = js,
|
|
202
|
-
|
|
203
|
-
}()),
|
|
201
|
+
var l = js, i = typeof Object.is == "function" ? Object.is : s, u = l.useState, m = l.useEffect, f = l.useLayoutEffect, b = l.useDebugValue, c = !1, d = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
|
|
202
|
+
Pe.useSyncExternalStore = l.useSyncExternalStore !== void 0 ? l.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
203
|
+
}()), Pe;
|
|
204
204
|
}
|
|
205
205
|
process.env.NODE_ENV === "production" ? Ve.exports = Mt() : Ve.exports = Ot();
|
|
206
206
|
var It = Ve.exports;
|
|
207
207
|
function Tt() {
|
|
208
|
-
const { setTheme: s } = Na(),
|
|
208
|
+
const { setTheme: s } = Na(), n = w(
|
|
209
209
|
(t) => t.actions.setDashboardTheme
|
|
210
210
|
);
|
|
211
|
-
return /* @__PURE__ */ a(
|
|
211
|
+
return /* @__PURE__ */ a(ze, { children: [
|
|
212
212
|
/* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ a(L, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
|
|
213
213
|
/* @__PURE__ */ e(
|
|
214
|
-
|
|
214
|
+
At,
|
|
215
215
|
{
|
|
216
216
|
strokeWidth: 1.5,
|
|
217
217
|
className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
|
|
@@ -231,7 +231,7 @@ function Tt() {
|
|
|
231
231
|
H,
|
|
232
232
|
{
|
|
233
233
|
onClick: () => {
|
|
234
|
-
s("light"),
|
|
234
|
+
s("light"), n("light");
|
|
235
235
|
},
|
|
236
236
|
children: "Light"
|
|
237
237
|
}
|
|
@@ -240,7 +240,7 @@ function Tt() {
|
|
|
240
240
|
H,
|
|
241
241
|
{
|
|
242
242
|
onClick: () => {
|
|
243
|
-
s("dark"),
|
|
243
|
+
s("dark"), n("dark");
|
|
244
244
|
},
|
|
245
245
|
children: "Dark"
|
|
246
246
|
}
|
|
@@ -249,7 +249,7 @@ function Tt() {
|
|
|
249
249
|
H,
|
|
250
250
|
{
|
|
251
251
|
onClick: () => {
|
|
252
|
-
s("system"),
|
|
252
|
+
s("system"), n("system");
|
|
253
253
|
},
|
|
254
254
|
children: "System"
|
|
255
255
|
}
|
|
@@ -257,53 +257,53 @@ function Tt() {
|
|
|
257
257
|
] })
|
|
258
258
|
] });
|
|
259
259
|
}
|
|
260
|
-
async function _t(s,
|
|
260
|
+
async function _t(s, n, t, r, l) {
|
|
261
261
|
if (!l)
|
|
262
262
|
return null;
|
|
263
|
-
const
|
|
263
|
+
const i = JSON.stringify(t), u = `${s}/v1/lens`;
|
|
264
264
|
return await Qe(u, l, {
|
|
265
|
-
name:
|
|
266
|
-
template:
|
|
265
|
+
name: n,
|
|
266
|
+
template: i,
|
|
267
267
|
filterValues: r,
|
|
268
268
|
operation: "create"
|
|
269
269
|
});
|
|
270
270
|
}
|
|
271
|
-
async function
|
|
271
|
+
async function $e(s, n, t) {
|
|
272
272
|
if (!t)
|
|
273
273
|
return null;
|
|
274
|
-
const { id: r, template: l, filterValues:
|
|
275
|
-
return await Qe(
|
|
274
|
+
const { id: r, template: l, filterValues: i, isDefault: u, shared: m } = n, f = `${s}/v1/lens`;
|
|
275
|
+
return await Qe(f, t, {
|
|
276
276
|
lensId: r,
|
|
277
277
|
template: l,
|
|
278
|
-
filterValues:
|
|
278
|
+
filterValues: i,
|
|
279
279
|
isDefault: u,
|
|
280
|
-
shared:
|
|
280
|
+
shared: m,
|
|
281
281
|
operation: "update"
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
|
-
async function
|
|
284
|
+
async function Pt(s, n, t) {
|
|
285
285
|
if (!t)
|
|
286
286
|
return null;
|
|
287
287
|
const r = `${s}/v1/lens`;
|
|
288
288
|
return await Qe(r, t, {
|
|
289
289
|
operation: "delete",
|
|
290
|
-
lensId:
|
|
290
|
+
lensId: n
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
const [s,
|
|
293
|
+
function Ut() {
|
|
294
|
+
const [s, n] = S(""), [t, r] = S(!1), l = w((N) => N.lenses), { setLenses: i, setSelectedLensId: u } = xs(), [m, f] = S(!1), [b, c] = S(!1), d = w((N) => N.dashboard), h = w((N) => N.filterValues), { authToken: p, tokenProps: g } = G();
|
|
295
295
|
async function y() {
|
|
296
|
-
|
|
296
|
+
f(!0);
|
|
297
297
|
const N = await _t(
|
|
298
|
-
|
|
298
|
+
g.apiServiceUrl,
|
|
299
299
|
s,
|
|
300
300
|
d,
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
h,
|
|
302
|
+
p == null ? void 0 : p.accessToken
|
|
303
303
|
);
|
|
304
|
-
N && (
|
|
304
|
+
N && (i([...l || [], N]), u(N.id), c(!1)), f(!1);
|
|
305
305
|
}
|
|
306
|
-
return /* @__PURE__ */ a(We, { open:
|
|
306
|
+
return /* @__PURE__ */ a(We, { open: b, onOpenChange: c, children: [
|
|
307
307
|
/* @__PURE__ */ e(Sa, { asChild: !0, children: /* @__PURE__ */ a(
|
|
308
308
|
L,
|
|
309
309
|
{
|
|
@@ -322,13 +322,13 @@ function Gt() {
|
|
|
322
322
|
/* @__PURE__ */ e(Ds, { children: "Lenses are private by default and are only visible to you." })
|
|
323
323
|
] }),
|
|
324
324
|
/* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ a("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
325
|
-
/* @__PURE__ */ e(
|
|
325
|
+
/* @__PURE__ */ e(Ue, { className: "text-right", children: "Name" }),
|
|
326
326
|
/* @__PURE__ */ e(
|
|
327
327
|
oe,
|
|
328
328
|
{
|
|
329
329
|
value: s,
|
|
330
330
|
onChange: (N) => {
|
|
331
|
-
|
|
331
|
+
n(N.target.value);
|
|
332
332
|
},
|
|
333
333
|
id: "name",
|
|
334
334
|
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
@@ -343,48 +343,48 @@ function Gt() {
|
|
|
343
343
|
variant: "outline",
|
|
344
344
|
type: "submit",
|
|
345
345
|
onClick: y,
|
|
346
|
-
disabled:
|
|
347
|
-
children:
|
|
346
|
+
disabled: m,
|
|
347
|
+
children: m ? "Creating..." : "Add"
|
|
348
348
|
}
|
|
349
349
|
) })
|
|
350
350
|
] })
|
|
351
351
|
] });
|
|
352
352
|
}
|
|
353
353
|
function Rt() {
|
|
354
|
-
const [s,
|
|
355
|
-
async function
|
|
356
|
-
|
|
354
|
+
const [s, n] = S(!1), t = w((d) => d.lenses), r = w((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: i } = xs(), { authToken: u, tokenProps: m } = G();
|
|
355
|
+
async function f(d) {
|
|
356
|
+
i(d);
|
|
357
357
|
}
|
|
358
|
-
async function
|
|
359
|
-
if (await
|
|
360
|
-
const
|
|
361
|
-
l(
|
|
358
|
+
async function b(d) {
|
|
359
|
+
if (await Pt(m.apiServiceUrl, d, u == null ? void 0 : u.accessToken)) {
|
|
360
|
+
const p = t == null ? void 0 : t.filter((g) => g.id !== d);
|
|
361
|
+
l(p || []), i("original");
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
async function
|
|
365
|
-
const
|
|
364
|
+
async function c(d) {
|
|
365
|
+
const h = t == null ? void 0 : t.map((y) => y.id === d.id ? {
|
|
366
366
|
...y,
|
|
367
367
|
isDefault: !d.isDefault
|
|
368
368
|
} : {
|
|
369
369
|
...y,
|
|
370
370
|
isDefault: !1
|
|
371
371
|
});
|
|
372
|
-
l(
|
|
373
|
-
const
|
|
372
|
+
l(h || []);
|
|
373
|
+
const p = {
|
|
374
374
|
...d,
|
|
375
375
|
isDefault: !d.isDefault
|
|
376
376
|
};
|
|
377
|
-
await
|
|
378
|
-
const
|
|
379
|
-
if (
|
|
377
|
+
await $e(m.apiServiceUrl, p, u == null ? void 0 : u.accessToken);
|
|
378
|
+
const g = t == null ? void 0 : t.find((y) => y.isDefault);
|
|
379
|
+
if (g && g.id !== d.id) {
|
|
380
380
|
const y = {
|
|
381
|
-
...
|
|
381
|
+
...g,
|
|
382
382
|
isDefault: !1
|
|
383
383
|
};
|
|
384
|
-
await
|
|
384
|
+
await $e(m.apiServiceUrl, y, u == null ? void 0 : u.accessToken);
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
|
-
return /* @__PURE__ */ a(
|
|
387
|
+
return /* @__PURE__ */ a(ze, { open: s, onOpenChange: n, children: [
|
|
388
388
|
/* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(j, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Ct, { className: "h-4 w-4" }) }) }),
|
|
389
389
|
/* @__PURE__ */ a(Ke, { align: "end", className: "w-60", children: [
|
|
390
390
|
/* @__PURE__ */ e(xa, { className: "px-3", children: "Lenses" }),
|
|
@@ -393,7 +393,7 @@ function Rt() {
|
|
|
393
393
|
Ca,
|
|
394
394
|
{
|
|
395
395
|
value: r,
|
|
396
|
-
onValueChange:
|
|
396
|
+
onValueChange: f,
|
|
397
397
|
children: [
|
|
398
398
|
/* @__PURE__ */ e(vs, { value: "original", children: "Original" }),
|
|
399
399
|
t == null ? void 0 : t.map((d) => /* @__PURE__ */ a(
|
|
@@ -407,8 +407,8 @@ function Rt() {
|
|
|
407
407
|
/* @__PURE__ */ e(
|
|
408
408
|
Cs,
|
|
409
409
|
{
|
|
410
|
-
onClick: (
|
|
411
|
-
|
|
410
|
+
onClick: (h) => {
|
|
411
|
+
h.preventDefault(), c(d);
|
|
412
412
|
},
|
|
413
413
|
className: X(
|
|
414
414
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
@@ -423,8 +423,8 @@ function Rt() {
|
|
|
423
423
|
/* @__PURE__ */ e(
|
|
424
424
|
Ls,
|
|
425
425
|
{
|
|
426
|
-
onClick: (
|
|
427
|
-
|
|
426
|
+
onClick: (h) => {
|
|
427
|
+
h.preventDefault(), b(d.id);
|
|
428
428
|
},
|
|
429
429
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
430
430
|
strokeWidth: 1.5
|
|
@@ -441,98 +441,98 @@ function Rt() {
|
|
|
441
441
|
] })
|
|
442
442
|
] });
|
|
443
443
|
}
|
|
444
|
-
const
|
|
444
|
+
const Gt = async (s, n, t) => {
|
|
445
445
|
const r = `${s}/management/v1/groups`;
|
|
446
|
-
return await Es(r,
|
|
447
|
-
}, Ft = async (s,
|
|
446
|
+
return await Es(r, n, t);
|
|
447
|
+
}, Ft = async (s, n, t) => {
|
|
448
448
|
const r = `${s}/management/v1/groups/${t}`, l = await fetch(r, {
|
|
449
449
|
method: "DELETE",
|
|
450
450
|
headers: {
|
|
451
|
-
Authorization: `Bearer ${
|
|
451
|
+
Authorization: `Bearer ${n}`
|
|
452
452
|
}
|
|
453
453
|
});
|
|
454
454
|
if (!l.ok) {
|
|
455
|
-
const
|
|
456
|
-
throw new Error(
|
|
455
|
+
const i = await l.text();
|
|
456
|
+
throw new Error(i || "Failed to delete group");
|
|
457
457
|
}
|
|
458
|
-
}, jt = async (s,
|
|
458
|
+
}, jt = async (s, n, t, r) => {
|
|
459
459
|
const l = `${s}/management/v1/groups/${t}/members`;
|
|
460
|
-
return await Es(l,
|
|
461
|
-
}, Ht = async (s,
|
|
462
|
-
const l = `${s}/management/v1/groups/${t}/members`,
|
|
460
|
+
return await Es(l, n, r);
|
|
461
|
+
}, Ht = async (s, n, t, r) => {
|
|
462
|
+
const l = `${s}/management/v1/groups/${t}/members`, i = await fetch(l, {
|
|
463
463
|
method: "DELETE",
|
|
464
464
|
headers: {
|
|
465
465
|
"Content-Type": "application/json",
|
|
466
|
-
Authorization: `Bearer ${
|
|
466
|
+
Authorization: `Bearer ${n}`
|
|
467
467
|
},
|
|
468
468
|
body: JSON.stringify(r)
|
|
469
469
|
});
|
|
470
|
-
if (!
|
|
471
|
-
const u = await
|
|
470
|
+
if (!i.ok) {
|
|
471
|
+
const u = await i.text();
|
|
472
472
|
throw new Error(u || "Failed to remove group members");
|
|
473
473
|
}
|
|
474
474
|
};
|
|
475
475
|
function qt() {
|
|
476
|
-
const { authToken: s, tokenProps:
|
|
476
|
+
const { authToken: s, tokenProps: n } = G(), t = be();
|
|
477
477
|
return ye({
|
|
478
|
-
mutationFn: (r) =>
|
|
478
|
+
mutationFn: (r) => Gt(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r),
|
|
479
479
|
onSuccess: () => {
|
|
480
|
-
t.invalidateQueries({ queryKey: ["groups"] }),
|
|
480
|
+
t.invalidateQueries({ queryKey: ["groups"] }), A.success("Group created successfully");
|
|
481
481
|
},
|
|
482
482
|
onError: (r) => {
|
|
483
|
-
console.error("Failed to create group:", r),
|
|
483
|
+
console.error("Failed to create group:", r), A.error("Failed to create group", {
|
|
484
484
|
description: r.message
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
489
|
function Vt() {
|
|
490
|
-
const { authToken: s, tokenProps:
|
|
490
|
+
const { authToken: s, tokenProps: n } = G(), t = be();
|
|
491
491
|
return ye({
|
|
492
|
-
mutationFn: (r) => Ft(
|
|
492
|
+
mutationFn: (r) => Ft(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r),
|
|
493
493
|
onSuccess: (r, l) => {
|
|
494
|
-
t.invalidateQueries({ queryKey: ["groups"] }), t.removeQueries({ queryKey: ["group", l] }),
|
|
494
|
+
t.invalidateQueries({ queryKey: ["groups"] }), t.removeQueries({ queryKey: ["group", l] }), A.success("Group deleted successfully");
|
|
495
495
|
},
|
|
496
496
|
onError: (r) => {
|
|
497
|
-
console.error("Failed to delete group:", r),
|
|
497
|
+
console.error("Failed to delete group:", r), A.error("Failed to delete group", {
|
|
498
498
|
description: r.message
|
|
499
499
|
});
|
|
500
500
|
}
|
|
501
501
|
});
|
|
502
502
|
}
|
|
503
|
-
function
|
|
504
|
-
const { authToken: s, tokenProps:
|
|
503
|
+
function $t() {
|
|
504
|
+
const { authToken: s, tokenProps: n } = G(), t = be();
|
|
505
505
|
return ye({
|
|
506
506
|
mutationFn: ({
|
|
507
507
|
groupId: r,
|
|
508
508
|
data: l
|
|
509
|
-
}) => jt(
|
|
509
|
+
}) => jt(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r, l),
|
|
510
510
|
onSuccess: (r, l) => {
|
|
511
511
|
t.invalidateQueries({ queryKey: ["group", l.groupId] }), t.invalidateQueries({
|
|
512
512
|
queryKey: ["group-members", l.groupId]
|
|
513
|
-
}), t.invalidateQueries({ queryKey: ["groups"] }),
|
|
513
|
+
}), t.invalidateQueries({ queryKey: ["groups"] }), A.success("Members added successfully");
|
|
514
514
|
},
|
|
515
515
|
onError: (r) => {
|
|
516
|
-
console.error("Failed to add group members:", r),
|
|
516
|
+
console.error("Failed to add group members:", r), A.error("Failed to add members", {
|
|
517
517
|
description: r.message
|
|
518
518
|
});
|
|
519
519
|
}
|
|
520
520
|
});
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
const { authToken: s, tokenProps:
|
|
522
|
+
function zt() {
|
|
523
|
+
const { authToken: s, tokenProps: n } = G(), t = be();
|
|
524
524
|
return ye({
|
|
525
525
|
mutationFn: ({
|
|
526
526
|
groupId: r,
|
|
527
527
|
data: l
|
|
528
|
-
}) => Ht(
|
|
528
|
+
}) => Ht(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r, l),
|
|
529
529
|
onSuccess: (r, l) => {
|
|
530
530
|
t.invalidateQueries({ queryKey: ["group", l.groupId] }), t.invalidateQueries({
|
|
531
531
|
queryKey: ["group-members", l.groupId]
|
|
532
|
-
}), t.invalidateQueries({ queryKey: ["groups"] }),
|
|
532
|
+
}), t.invalidateQueries({ queryKey: ["groups"] }), A.success("Members removed successfully");
|
|
533
533
|
},
|
|
534
534
|
onError: (r) => {
|
|
535
|
-
console.error("Failed to remove group members:", r),
|
|
535
|
+
console.error("Failed to remove group members:", r), A.error("Failed to remove members", {
|
|
536
536
|
description: r.message
|
|
537
537
|
});
|
|
538
538
|
}
|
|
@@ -540,30 +540,30 @@ function $t() {
|
|
|
540
540
|
}
|
|
541
541
|
function Bt({
|
|
542
542
|
onSuccess: s,
|
|
543
|
-
tenantId:
|
|
543
|
+
tenantId: n,
|
|
544
544
|
isTenantUser: t
|
|
545
545
|
}) {
|
|
546
|
-
const [r, l] = S(""), [
|
|
547
|
-
const
|
|
548
|
-
return r.trim() ? r.length < 3 ?
|
|
546
|
+
const [r, l] = S(""), [i, u] = S(""), [m, f] = S({}), b = qt(), c = () => {
|
|
547
|
+
const h = {};
|
|
548
|
+
return r.trim() ? r.length < 3 ? h.name = "Group name must be at least 3 characters" : r.length > 50 && (h.name = "Group name must be less than 50 characters") : h.name = "Group name is required", i && i.length > 200 && (h.description = "Description must be less than 200 characters"), f(h), Object.keys(h).length === 0;
|
|
549
549
|
};
|
|
550
|
-
return /* @__PURE__ */ a("form", { onSubmit: async (
|
|
551
|
-
if (
|
|
552
|
-
const
|
|
550
|
+
return /* @__PURE__ */ a("form", { onSubmit: async (h) => {
|
|
551
|
+
if (h.preventDefault(), !c()) return;
|
|
552
|
+
const p = {
|
|
553
553
|
name: r.trim(),
|
|
554
|
-
description:
|
|
554
|
+
description: i.trim() || void 0,
|
|
555
555
|
type: t ? "TENANT_GROUP" : "ORG_GROUP",
|
|
556
|
-
...t &&
|
|
556
|
+
...t && n ? { tenantId: n } : {}
|
|
557
557
|
};
|
|
558
558
|
try {
|
|
559
|
-
await
|
|
560
|
-
} catch (
|
|
561
|
-
console.error("Failed to create group:",
|
|
559
|
+
await b.mutateAsync(p), l(""), u(""), f({}), s();
|
|
560
|
+
} catch (g) {
|
|
561
|
+
console.error("Failed to create group:", g);
|
|
562
562
|
}
|
|
563
563
|
}, className: "space-y-6", children: [
|
|
564
564
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
565
565
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
566
|
-
/* @__PURE__ */ a(
|
|
566
|
+
/* @__PURE__ */ a(Ue, { htmlFor: "group-name", children: [
|
|
567
567
|
"Group Name ",
|
|
568
568
|
/* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
|
|
569
569
|
] }),
|
|
@@ -573,17 +573,17 @@ function Bt({
|
|
|
573
573
|
id: "group-name",
|
|
574
574
|
placeholder: "e.g., Marketing Team, Engineering Squad",
|
|
575
575
|
value: r,
|
|
576
|
-
onChange: (
|
|
577
|
-
l(
|
|
576
|
+
onChange: (h) => {
|
|
577
|
+
l(h.target.value), m.name && f((p) => ({ ...p, name: "" }));
|
|
578
578
|
},
|
|
579
|
-
className:
|
|
580
|
-
disabled:
|
|
579
|
+
className: m.name ? "border-destructive" : "",
|
|
580
|
+
disabled: b.isPending
|
|
581
581
|
}
|
|
582
582
|
),
|
|
583
|
-
|
|
583
|
+
m.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.name })
|
|
584
584
|
] }),
|
|
585
585
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
586
|
-
/* @__PURE__ */ a(
|
|
586
|
+
/* @__PURE__ */ a(Ue, { htmlFor: "group-description", children: [
|
|
587
587
|
"Description",
|
|
588
588
|
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
|
|
589
589
|
] }),
|
|
@@ -592,18 +592,18 @@ function Bt({
|
|
|
592
592
|
{
|
|
593
593
|
id: "group-description",
|
|
594
594
|
placeholder: "Describe the purpose of this group...",
|
|
595
|
-
value:
|
|
596
|
-
onChange: (
|
|
597
|
-
u(
|
|
595
|
+
value: i,
|
|
596
|
+
onChange: (h) => {
|
|
597
|
+
u(h.target.value), m.description && f((p) => ({ ...p, description: "" }));
|
|
598
598
|
},
|
|
599
|
-
className:
|
|
600
|
-
disabled:
|
|
599
|
+
className: m.description ? "border-destructive" : "",
|
|
600
|
+
disabled: b.isPending,
|
|
601
601
|
rows: 3
|
|
602
602
|
}
|
|
603
603
|
),
|
|
604
|
-
|
|
604
|
+
m.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.description }),
|
|
605
605
|
/* @__PURE__ */ a("p", { className: "text-xs text-muted-foreground", children: [
|
|
606
|
-
|
|
606
|
+
i.length,
|
|
607
607
|
"/200 characters"
|
|
608
608
|
] })
|
|
609
609
|
] }),
|
|
@@ -619,9 +619,9 @@ function Bt({
|
|
|
619
619
|
type: "button",
|
|
620
620
|
variant: "outline",
|
|
621
621
|
onClick: () => {
|
|
622
|
-
l(""), u(""),
|
|
622
|
+
l(""), u(""), f({});
|
|
623
623
|
},
|
|
624
|
-
disabled:
|
|
624
|
+
disabled: b.isPending,
|
|
625
625
|
children: "Clear"
|
|
626
626
|
}
|
|
627
627
|
),
|
|
@@ -629,11 +629,11 @@ function Bt({
|
|
|
629
629
|
L,
|
|
630
630
|
{
|
|
631
631
|
type: "submit",
|
|
632
|
-
disabled:
|
|
633
|
-
children:
|
|
632
|
+
disabled: b.isPending || !r.trim(),
|
|
633
|
+
children: b.isPending ? /* @__PURE__ */ a(M, { children: [
|
|
634
634
|
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
635
635
|
"Creating..."
|
|
636
|
-
] }) : /* @__PURE__ */ a(
|
|
636
|
+
] }) : /* @__PURE__ */ a(M, { children: [
|
|
637
637
|
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4" }),
|
|
638
638
|
"Create Group"
|
|
639
639
|
] })
|
|
@@ -642,78 +642,155 @@ function Bt({
|
|
|
642
642
|
] })
|
|
643
643
|
] });
|
|
644
644
|
}
|
|
645
|
-
function Kt() {
|
|
645
|
+
function Kt(s, n = []) {
|
|
646
|
+
let t = [];
|
|
647
|
+
function r(i, u) {
|
|
648
|
+
const m = E.createContext(u);
|
|
649
|
+
m.displayName = i + "Context";
|
|
650
|
+
const f = t.length;
|
|
651
|
+
t = [...t, u];
|
|
652
|
+
const b = (d) => {
|
|
653
|
+
var k;
|
|
654
|
+
const { scope: h, children: p, ...g } = d, y = ((k = h == null ? void 0 : h[s]) == null ? void 0 : k[f]) || m, N = E.useMemo(() => g, Object.values(g));
|
|
655
|
+
return /* @__PURE__ */ e(y.Provider, { value: N, children: p });
|
|
656
|
+
};
|
|
657
|
+
b.displayName = i + "Provider";
|
|
658
|
+
function c(d, h) {
|
|
659
|
+
var y;
|
|
660
|
+
const p = ((y = h == null ? void 0 : h[s]) == null ? void 0 : y[f]) || m, g = E.useContext(p);
|
|
661
|
+
if (g) return g;
|
|
662
|
+
if (u !== void 0) return u;
|
|
663
|
+
throw new Error(`\`${d}\` must be used within \`${i}\``);
|
|
664
|
+
}
|
|
665
|
+
return [b, c];
|
|
666
|
+
}
|
|
667
|
+
const l = () => {
|
|
668
|
+
const i = t.map((u) => E.createContext(u));
|
|
669
|
+
return function(m) {
|
|
670
|
+
const f = (m == null ? void 0 : m[s]) || i;
|
|
671
|
+
return E.useMemo(
|
|
672
|
+
() => ({ [`__scope${s}`]: { ...m, [s]: f } }),
|
|
673
|
+
[m, f]
|
|
674
|
+
);
|
|
675
|
+
};
|
|
676
|
+
};
|
|
677
|
+
return l.scopeName = s, [r, Qt(l, ...n)];
|
|
678
|
+
}
|
|
679
|
+
function Qt(...s) {
|
|
680
|
+
const n = s[0];
|
|
681
|
+
if (s.length === 1) return n;
|
|
682
|
+
const t = () => {
|
|
683
|
+
const r = s.map((l) => ({
|
|
684
|
+
useScope: l(),
|
|
685
|
+
scopeName: l.scopeName
|
|
686
|
+
}));
|
|
687
|
+
return function(i) {
|
|
688
|
+
const u = r.reduce((m, { useScope: f, scopeName: b }) => {
|
|
689
|
+
const d = f(i)[`__scope${b}`];
|
|
690
|
+
return { ...m, ...d };
|
|
691
|
+
}, {});
|
|
692
|
+
return E.useMemo(() => ({ [`__scope${n.scopeName}`]: u }), [u]);
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
return t.scopeName = n.scopeName, t;
|
|
696
|
+
}
|
|
697
|
+
var Wt = [
|
|
698
|
+
"a",
|
|
699
|
+
"button",
|
|
700
|
+
"div",
|
|
701
|
+
"form",
|
|
702
|
+
"h2",
|
|
703
|
+
"h3",
|
|
704
|
+
"img",
|
|
705
|
+
"input",
|
|
706
|
+
"label",
|
|
707
|
+
"li",
|
|
708
|
+
"nav",
|
|
709
|
+
"ol",
|
|
710
|
+
"p",
|
|
711
|
+
"select",
|
|
712
|
+
"span",
|
|
713
|
+
"svg",
|
|
714
|
+
"ul"
|
|
715
|
+
], es = Wt.reduce((s, n) => {
|
|
716
|
+
const t = ka(`Primitive.${n}`), r = E.forwardRef((l, i) => {
|
|
717
|
+
const { asChild: u, ...m } = l, f = u ? t : n;
|
|
718
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(f, { ...m, ref: i });
|
|
719
|
+
});
|
|
720
|
+
return r.displayName = `Primitive.${n}`, { ...s, [n]: r };
|
|
721
|
+
}, {});
|
|
722
|
+
function Jt() {
|
|
646
723
|
return It.useSyncExternalStore(
|
|
647
|
-
|
|
724
|
+
Xt,
|
|
648
725
|
() => !0,
|
|
649
726
|
() => !1
|
|
650
727
|
);
|
|
651
728
|
}
|
|
652
|
-
function
|
|
729
|
+
function Xt() {
|
|
653
730
|
return () => {
|
|
654
731
|
};
|
|
655
732
|
}
|
|
656
|
-
var ss = "Avatar", [
|
|
657
|
-
(s,
|
|
658
|
-
const { __scopeAvatar: t, ...r } = s, [l,
|
|
733
|
+
var ss = "Avatar", [Zt] = Kt(ss), [Yt, Hs] = Zt(ss), qs = E.forwardRef(
|
|
734
|
+
(s, n) => {
|
|
735
|
+
const { __scopeAvatar: t, ...r } = s, [l, i] = E.useState("idle");
|
|
659
736
|
return /* @__PURE__ */ e(
|
|
660
|
-
|
|
737
|
+
Yt,
|
|
661
738
|
{
|
|
662
739
|
scope: t,
|
|
663
740
|
imageLoadingStatus: l,
|
|
664
|
-
onImageLoadingStatusChange:
|
|
665
|
-
children: /* @__PURE__ */ e(es.span, { ...r, ref:
|
|
741
|
+
onImageLoadingStatusChange: i,
|
|
742
|
+
children: /* @__PURE__ */ e(es.span, { ...r, ref: n })
|
|
666
743
|
}
|
|
667
744
|
);
|
|
668
745
|
}
|
|
669
746
|
);
|
|
670
747
|
qs.displayName = ss;
|
|
671
|
-
var Vs = "AvatarImage",
|
|
672
|
-
(s,
|
|
748
|
+
var Vs = "AvatarImage", $s = E.forwardRef(
|
|
749
|
+
(s, n) => {
|
|
673
750
|
const { __scopeAvatar: t, src: r, onLoadingStatusChange: l = () => {
|
|
674
|
-
}, ...
|
|
675
|
-
l(
|
|
751
|
+
}, ...i } = s, u = Hs(Vs, t), m = en(r, i), f = Aa((b) => {
|
|
752
|
+
l(b), u.onImageLoadingStatusChange(b);
|
|
676
753
|
});
|
|
677
754
|
return Re(() => {
|
|
678
|
-
|
|
679
|
-
}, [
|
|
755
|
+
m !== "idle" && f(m);
|
|
756
|
+
}, [m, f]), m === "loaded" ? /* @__PURE__ */ e(es.img, { ...i, ref: n, src: r }) : null;
|
|
680
757
|
}
|
|
681
758
|
);
|
|
682
|
-
|
|
683
|
-
var
|
|
684
|
-
(s,
|
|
685
|
-
const { __scopeAvatar: t, delayMs: r, ...l } = s,
|
|
686
|
-
return
|
|
759
|
+
$s.displayName = Vs;
|
|
760
|
+
var zs = "AvatarFallback", Bs = E.forwardRef(
|
|
761
|
+
(s, n) => {
|
|
762
|
+
const { __scopeAvatar: t, delayMs: r, ...l } = s, i = Hs(zs, t), [u, m] = E.useState(r === void 0);
|
|
763
|
+
return E.useEffect(() => {
|
|
687
764
|
if (r !== void 0) {
|
|
688
|
-
const
|
|
689
|
-
return () => window.clearTimeout(
|
|
765
|
+
const f = window.setTimeout(() => m(!0), r);
|
|
766
|
+
return () => window.clearTimeout(f);
|
|
690
767
|
}
|
|
691
|
-
}, [r]), u &&
|
|
768
|
+
}, [r]), u && i.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(es.span, { ...l, ref: n }) : null;
|
|
692
769
|
}
|
|
693
770
|
);
|
|
694
|
-
Bs.displayName =
|
|
695
|
-
function ws(s,
|
|
696
|
-
return s ?
|
|
771
|
+
Bs.displayName = zs;
|
|
772
|
+
function ws(s, n) {
|
|
773
|
+
return s ? n ? (s.src !== n && (s.src = n), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
697
774
|
}
|
|
698
|
-
function
|
|
699
|
-
const r =
|
|
700
|
-
() => ws(
|
|
775
|
+
function en(s, { referrerPolicy: n, crossOrigin: t }) {
|
|
776
|
+
const r = Jt(), l = E.useRef(null), i = r ? (l.current || (l.current = new window.Image()), l.current) : null, [u, m] = E.useState(
|
|
777
|
+
() => ws(i, s)
|
|
701
778
|
);
|
|
702
779
|
return Re(() => {
|
|
703
|
-
|
|
704
|
-
}, [
|
|
705
|
-
const
|
|
706
|
-
|
|
780
|
+
m(ws(i, s));
|
|
781
|
+
}, [i, s]), Re(() => {
|
|
782
|
+
const f = (d) => () => {
|
|
783
|
+
m(d);
|
|
707
784
|
};
|
|
708
|
-
if (!
|
|
709
|
-
const
|
|
710
|
-
return
|
|
711
|
-
|
|
785
|
+
if (!i) return;
|
|
786
|
+
const b = f("loaded"), c = f("error");
|
|
787
|
+
return i.addEventListener("load", b), i.addEventListener("error", c), n && (i.referrerPolicy = n), typeof t == "string" && (i.crossOrigin = t), () => {
|
|
788
|
+
i.removeEventListener("load", b), i.removeEventListener("error", c);
|
|
712
789
|
};
|
|
713
|
-
}, [
|
|
790
|
+
}, [i, t, n]), u;
|
|
714
791
|
}
|
|
715
|
-
var Ks = qs, Qs =
|
|
716
|
-
const as =
|
|
792
|
+
var Ks = qs, Qs = $s, Ws = Bs;
|
|
793
|
+
const as = E.forwardRef(({ className: s, ...n }, t) => /* @__PURE__ */ e(
|
|
717
794
|
Ks,
|
|
718
795
|
{
|
|
719
796
|
ref: t,
|
|
@@ -721,20 +798,20 @@ const as = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
|
|
|
721
798
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
722
799
|
s
|
|
723
800
|
),
|
|
724
|
-
...
|
|
801
|
+
...n
|
|
725
802
|
}
|
|
726
803
|
));
|
|
727
804
|
as.displayName = Ks.displayName;
|
|
728
|
-
const
|
|
805
|
+
const sn = E.forwardRef(({ className: s, ...n }, t) => /* @__PURE__ */ e(
|
|
729
806
|
Qs,
|
|
730
807
|
{
|
|
731
808
|
ref: t,
|
|
732
809
|
className: X("aspect-square h-full w-full", s),
|
|
733
|
-
...
|
|
810
|
+
...n
|
|
734
811
|
}
|
|
735
812
|
));
|
|
736
|
-
|
|
737
|
-
const ts =
|
|
813
|
+
sn.displayName = Qs.displayName;
|
|
814
|
+
const ts = E.forwardRef(({ className: s, ...n }, t) => /* @__PURE__ */ e(
|
|
738
815
|
Ws,
|
|
739
816
|
{
|
|
740
817
|
ref: t,
|
|
@@ -742,80 +819,80 @@ const ts = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
|
|
|
742
819
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
743
820
|
s
|
|
744
821
|
),
|
|
745
|
-
...
|
|
822
|
+
...n
|
|
746
823
|
}
|
|
747
824
|
));
|
|
748
825
|
ts.displayName = Ws.displayName;
|
|
749
|
-
function
|
|
826
|
+
function an({
|
|
750
827
|
open: s,
|
|
751
|
-
onOpenChange:
|
|
828
|
+
onOpenChange: n,
|
|
752
829
|
group: t,
|
|
753
830
|
onUpdate: r
|
|
754
831
|
}) {
|
|
755
|
-
const [l,
|
|
832
|
+
const [l, i] = S("members"), [u, m] = S(""), [f, b] = S([]), [c, d] = S([]), { data: h, isLoading: p, refetch: g } = Ma(t.id), y = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: N, isLoading: k } = Oa({
|
|
756
833
|
type: y,
|
|
757
834
|
tenantId: t.tenantId || void 0,
|
|
758
835
|
active: !0,
|
|
759
836
|
limit: 100
|
|
760
|
-
}),
|
|
837
|
+
}), T = $t(), P = zt(), O = (h == null ? void 0 : h.members) || [], $ = fe(() => new Set(O.map((v) => v.userId)), [O]), R = fe(() => N.filter((v) => !$.has(v.id)), [N, $]), z = fe(() => {
|
|
761
838
|
if (!u) return R;
|
|
762
|
-
const
|
|
839
|
+
const v = u.toLowerCase();
|
|
763
840
|
return R.filter(
|
|
764
841
|
(C) => {
|
|
765
|
-
var
|
|
766
|
-
return ((
|
|
842
|
+
var _, F;
|
|
843
|
+
return ((_ = C.name) == null ? void 0 : _.toLowerCase().includes(v)) || ((F = C.email) == null ? void 0 : F.toLowerCase().includes(v));
|
|
767
844
|
}
|
|
768
845
|
);
|
|
769
846
|
}, [R, u]), x = fe(() => {
|
|
770
|
-
if (!u) return
|
|
771
|
-
const
|
|
772
|
-
return
|
|
847
|
+
if (!u) return O;
|
|
848
|
+
const v = u.toLowerCase();
|
|
849
|
+
return O.filter(
|
|
773
850
|
(C) => {
|
|
774
|
-
var
|
|
775
|
-
return ((F = (
|
|
851
|
+
var _, F, ie, D;
|
|
852
|
+
return ((F = (_ = C.user) == null ? void 0 : _.name) == null ? void 0 : F.toLowerCase().includes(v)) || ((D = (ie = C.user) == null ? void 0 : ie.email) == null ? void 0 : D.toLowerCase().includes(v));
|
|
776
853
|
}
|
|
777
854
|
);
|
|
778
|
-
}, [
|
|
779
|
-
if (
|
|
855
|
+
}, [O, u]), B = async () => {
|
|
856
|
+
if (f.length !== 0)
|
|
780
857
|
try {
|
|
781
|
-
await
|
|
858
|
+
await T.mutateAsync({
|
|
782
859
|
groupId: t.id,
|
|
783
860
|
data: {
|
|
784
|
-
userIds:
|
|
861
|
+
userIds: f,
|
|
785
862
|
userType: y === "tenant" ? "tenant" : "org"
|
|
786
863
|
}
|
|
787
|
-
}),
|
|
788
|
-
} catch (
|
|
789
|
-
console.error("Failed to add members:",
|
|
864
|
+
}), b([]), i("members"), g(), r == null || r();
|
|
865
|
+
} catch (v) {
|
|
866
|
+
console.error("Failed to add members:", v);
|
|
790
867
|
}
|
|
791
868
|
}, K = async () => {
|
|
792
|
-
if (
|
|
869
|
+
if (c.length !== 0)
|
|
793
870
|
try {
|
|
794
|
-
await
|
|
871
|
+
await P.mutateAsync({
|
|
795
872
|
groupId: t.id,
|
|
796
873
|
data: {
|
|
797
|
-
userIds:
|
|
874
|
+
userIds: c
|
|
798
875
|
}
|
|
799
|
-
}), d([]),
|
|
800
|
-
} catch (
|
|
801
|
-
console.error("Failed to remove members:",
|
|
876
|
+
}), d([]), g(), r == null || r();
|
|
877
|
+
} catch (v) {
|
|
878
|
+
console.error("Failed to remove members:", v);
|
|
802
879
|
}
|
|
803
|
-
}, Q = (
|
|
804
|
-
|
|
805
|
-
(C) => C.includes(
|
|
880
|
+
}, Q = (v) => {
|
|
881
|
+
b(
|
|
882
|
+
(C) => C.includes(v) ? C.filter((_) => _ !== v) : [...C, v]
|
|
806
883
|
);
|
|
807
|
-
}, W = (
|
|
884
|
+
}, W = (v) => {
|
|
808
885
|
d(
|
|
809
|
-
(C) => C.includes(
|
|
886
|
+
(C) => C.includes(v) ? C.filter((_) => _ !== v) : [...C, v]
|
|
810
887
|
);
|
|
811
888
|
};
|
|
812
|
-
return /* @__PURE__ */ e(
|
|
889
|
+
return /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(We, { open: s, onOpenChange: n, children: /* @__PURE__ */ a(Xe, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
813
890
|
/* @__PURE__ */ a(Ze, { children: [
|
|
814
891
|
/* @__PURE__ */ e(Ye, { children: t.name }),
|
|
815
892
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ a("p", { className: "text-sm text-muted-foreground", children: [
|
|
816
|
-
|
|
893
|
+
O.length,
|
|
817
894
|
" ",
|
|
818
|
-
|
|
895
|
+
O.length === 1 ? "member" : "members"
|
|
819
896
|
] }) }),
|
|
820
897
|
/* @__PURE__ */ a("p", { id: "group-members-description", className: "sr-only", children: [
|
|
821
898
|
"Add or remove members from the ",
|
|
@@ -823,44 +900,44 @@ function Yt({
|
|
|
823
900
|
" group"
|
|
824
901
|
] })
|
|
825
902
|
] }),
|
|
826
|
-
/* @__PURE__ */ a(
|
|
827
|
-
|
|
903
|
+
/* @__PURE__ */ a(ks, { value: l, onValueChange: (v) => {
|
|
904
|
+
i(v), m(""), d([]);
|
|
828
905
|
}, className: "mt-4", children: [
|
|
829
|
-
/* @__PURE__ */ a(
|
|
906
|
+
/* @__PURE__ */ a(As, { className: "grid w-full grid-cols-2", children: [
|
|
830
907
|
/* @__PURE__ */ e(ge, { value: "members", children: "Current Members" }),
|
|
831
908
|
/* @__PURE__ */ e(ge, { value: "add", children: "Add Members" })
|
|
832
909
|
] }),
|
|
833
910
|
/* @__PURE__ */ a(ve, { value: "members", className: "mt-4 space-y-4", children: [
|
|
834
911
|
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
835
|
-
/* @__PURE__ */ e(
|
|
912
|
+
/* @__PURE__ */ e(Ge, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
836
913
|
/* @__PURE__ */ e(
|
|
837
914
|
oe,
|
|
838
915
|
{
|
|
839
916
|
placeholder: "Search members...",
|
|
840
917
|
value: u,
|
|
841
|
-
onChange: (
|
|
918
|
+
onChange: (v) => m(v.target.value),
|
|
842
919
|
className: "pl-10"
|
|
843
920
|
}
|
|
844
921
|
)
|
|
845
922
|
] }),
|
|
846
|
-
/* @__PURE__ */ e(Fe, { className:
|
|
923
|
+
/* @__PURE__ */ e(Fe, { className: c.length > 0 ? "h-[300px]" : "h-[350px]", children: p ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((v) => /* @__PURE__ */ e(je, { className: "h-16 w-full" }, v)) }) : x.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
847
924
|
/* @__PURE__ */ e(V, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
848
925
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: u ? "No members found" : "No members yet" }),
|
|
849
926
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
|
|
850
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: x.map((
|
|
851
|
-
|
|
927
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: x.map((v) => /* @__PURE__ */ e(
|
|
928
|
+
tn,
|
|
852
929
|
{
|
|
853
|
-
member:
|
|
854
|
-
selected:
|
|
855
|
-
onToggle: () => W(
|
|
930
|
+
member: v,
|
|
931
|
+
selected: c.includes(v.userId),
|
|
932
|
+
onToggle: () => W(v.userId)
|
|
856
933
|
},
|
|
857
|
-
|
|
934
|
+
v.id
|
|
858
935
|
)) }) }),
|
|
859
|
-
|
|
936
|
+
c.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
860
937
|
/* @__PURE__ */ a("span", { className: "text-sm text-muted-foreground", children: [
|
|
861
|
-
|
|
938
|
+
c.length,
|
|
862
939
|
" member",
|
|
863
|
-
|
|
940
|
+
c.length !== 1 ? "s" : "",
|
|
864
941
|
" selected"
|
|
865
942
|
] }),
|
|
866
943
|
/* @__PURE__ */ e(
|
|
@@ -869,11 +946,11 @@ function Yt({
|
|
|
869
946
|
variant: "destructive",
|
|
870
947
|
size: "sm",
|
|
871
948
|
onClick: K,
|
|
872
|
-
disabled:
|
|
873
|
-
children:
|
|
949
|
+
disabled: P.isPending,
|
|
950
|
+
children: P.isPending ? /* @__PURE__ */ a(M, { children: [
|
|
874
951
|
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
875
952
|
"Removing..."
|
|
876
|
-
] }) : /* @__PURE__ */ a(
|
|
953
|
+
] }) : /* @__PURE__ */ a(M, { children: [
|
|
877
954
|
/* @__PURE__ */ e(Ms, { className: "mr-2 h-4 w-4" }),
|
|
878
955
|
"Remove Selected"
|
|
879
956
|
] })
|
|
@@ -883,46 +960,46 @@ function Yt({
|
|
|
883
960
|
] }),
|
|
884
961
|
/* @__PURE__ */ a(ve, { value: "add", className: "mt-4 space-y-4", children: [
|
|
885
962
|
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
886
|
-
/* @__PURE__ */ e(
|
|
963
|
+
/* @__PURE__ */ e(Ge, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
887
964
|
/* @__PURE__ */ e(
|
|
888
965
|
oe,
|
|
889
966
|
{
|
|
890
967
|
placeholder: "Search users to add...",
|
|
891
968
|
value: u,
|
|
892
|
-
onChange: (
|
|
969
|
+
onChange: (v) => m(v.target.value),
|
|
893
970
|
className: "pl-10"
|
|
894
971
|
}
|
|
895
972
|
)
|
|
896
973
|
] }),
|
|
897
|
-
/* @__PURE__ */ e(Fe, { className: "h-[300px]", children:
|
|
974
|
+
/* @__PURE__ */ e(Fe, { className: "h-[300px]", children: k ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((v) => /* @__PURE__ */ e(je, { className: "h-16 w-full" }, v)) }) : z.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
898
975
|
/* @__PURE__ */ e(He, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
899
976
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
900
977
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : "All eligible users are already members" })
|
|
901
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children:
|
|
902
|
-
|
|
978
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: z.map((v) => /* @__PURE__ */ e(
|
|
979
|
+
nn,
|
|
903
980
|
{
|
|
904
|
-
user:
|
|
905
|
-
selected:
|
|
906
|
-
onToggle: () => Q(
|
|
981
|
+
user: v,
|
|
982
|
+
selected: f.includes(v.id),
|
|
983
|
+
onToggle: () => Q(v.id)
|
|
907
984
|
},
|
|
908
|
-
|
|
985
|
+
v.id
|
|
909
986
|
)) }) }),
|
|
910
|
-
|
|
987
|
+
f.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
911
988
|
/* @__PURE__ */ a("span", { className: "text-sm text-muted-foreground", children: [
|
|
912
|
-
|
|
989
|
+
f.length,
|
|
913
990
|
" user",
|
|
914
|
-
|
|
991
|
+
f.length !== 1 ? "s" : "",
|
|
915
992
|
" selected"
|
|
916
993
|
] }),
|
|
917
994
|
/* @__PURE__ */ e(
|
|
918
995
|
L,
|
|
919
996
|
{
|
|
920
997
|
onClick: B,
|
|
921
|
-
disabled:
|
|
922
|
-
children:
|
|
998
|
+
disabled: T.isPending,
|
|
999
|
+
children: T.isPending ? /* @__PURE__ */ a(M, { children: [
|
|
923
1000
|
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
924
1001
|
"Adding..."
|
|
925
|
-
] }) : /* @__PURE__ */ a(
|
|
1002
|
+
] }) : /* @__PURE__ */ a(M, { children: [
|
|
926
1003
|
/* @__PURE__ */ e(He, { className: "mr-2 h-4 w-4" }),
|
|
927
1004
|
"Add Members"
|
|
928
1005
|
] })
|
|
@@ -933,43 +1010,43 @@ function Yt({
|
|
|
933
1010
|
] })
|
|
934
1011
|
] }) }) });
|
|
935
1012
|
}
|
|
936
|
-
function
|
|
1013
|
+
function tn({
|
|
937
1014
|
member: s,
|
|
938
|
-
selected:
|
|
1015
|
+
selected: n,
|
|
939
1016
|
onToggle: t
|
|
940
1017
|
}) {
|
|
941
|
-
var l,
|
|
942
|
-
const r = ((
|
|
1018
|
+
var l, i, u, m;
|
|
1019
|
+
const r = ((i = (l = s.user) == null ? void 0 : l.name) == null ? void 0 : i.split(" ").map((f) => f[0]).join("").toUpperCase()) || "?";
|
|
943
1020
|
return /* @__PURE__ */ a(
|
|
944
1021
|
"div",
|
|
945
1022
|
{
|
|
946
1023
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
947
1024
|
onClick: t,
|
|
948
1025
|
children: [
|
|
949
|
-
/* @__PURE__ */ e(Os, { checked:
|
|
1026
|
+
/* @__PURE__ */ e(Os, { checked: n }),
|
|
950
1027
|
/* @__PURE__ */ e(as, { className: "h-8 w-8", children: /* @__PURE__ */ e(ts, { className: "text-xs", children: r }) }),
|
|
951
1028
|
/* @__PURE__ */ a("div", { className: "flex-1", children: [
|
|
952
1029
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((u = s.user) == null ? void 0 : u.name) || "Unknown User" }),
|
|
953
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (
|
|
1030
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (m = s.user) == null ? void 0 : m.email })
|
|
954
1031
|
] })
|
|
955
1032
|
]
|
|
956
1033
|
}
|
|
957
1034
|
);
|
|
958
1035
|
}
|
|
959
|
-
function
|
|
1036
|
+
function nn({
|
|
960
1037
|
user: s,
|
|
961
|
-
selected:
|
|
1038
|
+
selected: n,
|
|
962
1039
|
onToggle: t
|
|
963
1040
|
}) {
|
|
964
1041
|
var l;
|
|
965
|
-
const r = ((l = s.name) == null ? void 0 : l.split(" ").map((
|
|
1042
|
+
const r = ((l = s.name) == null ? void 0 : l.split(" ").map((i) => i[0]).join("").toUpperCase()) || "?";
|
|
966
1043
|
return /* @__PURE__ */ a(
|
|
967
1044
|
"div",
|
|
968
1045
|
{
|
|
969
1046
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
970
1047
|
onClick: t,
|
|
971
1048
|
children: [
|
|
972
|
-
/* @__PURE__ */ e(Os, { checked:
|
|
1049
|
+
/* @__PURE__ */ e(Os, { checked: n }),
|
|
973
1050
|
/* @__PURE__ */ e(as, { className: "h-8 w-8", children: /* @__PURE__ */ e(ts, { className: "text-xs", children: r }) }),
|
|
974
1051
|
/* @__PURE__ */ a("div", { className: "flex-1", children: [
|
|
975
1052
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s.name }),
|
|
@@ -979,33 +1056,33 @@ function sr({
|
|
|
979
1056
|
}
|
|
980
1057
|
);
|
|
981
1058
|
}
|
|
982
|
-
function
|
|
1059
|
+
function rn({
|
|
983
1060
|
open: s,
|
|
984
|
-
onOpenChange:
|
|
1061
|
+
onOpenChange: n
|
|
985
1062
|
}) {
|
|
986
|
-
const [t, r] = S("groups"), [l,
|
|
1063
|
+
const [t, r] = S("groups"), [l, i] = S(""), [u, m] = S(null), [f, b] = S(!1), [c, d] = S(null), { tokenProps: h } = G(), { currentUser: p } = Is(), g = Vt(), y = (p == null ? void 0 : p.type) === "tenant", N = h == null ? void 0 : h.tenantId, { groups: k, isLoading: T, refetch: P } = Ia({
|
|
987
1064
|
type: y ? "TENANT_GROUP" : "all",
|
|
988
1065
|
tenantId: y ? N : void 0,
|
|
989
1066
|
includeMembers: !1
|
|
990
|
-
}),
|
|
1067
|
+
}), O = k.filter(
|
|
991
1068
|
(x) => {
|
|
992
1069
|
var B;
|
|
993
1070
|
return x.name.toLowerCase().includes(l.toLowerCase()) || ((B = x.description) == null ? void 0 : B.toLowerCase().includes(l.toLowerCase()));
|
|
994
1071
|
}
|
|
995
|
-
),
|
|
996
|
-
if (
|
|
1072
|
+
), $ = async () => {
|
|
1073
|
+
if (c)
|
|
997
1074
|
try {
|
|
998
|
-
await
|
|
1075
|
+
await g.mutateAsync(c.id), d(null), P();
|
|
999
1076
|
} catch (x) {
|
|
1000
1077
|
console.error("Failed to delete group:", x);
|
|
1001
1078
|
}
|
|
1002
1079
|
}, R = (x) => {
|
|
1003
|
-
|
|
1004
|
-
},
|
|
1005
|
-
r("groups"),
|
|
1080
|
+
m(x), b(!0);
|
|
1081
|
+
}, z = () => {
|
|
1082
|
+
r("groups"), P();
|
|
1006
1083
|
};
|
|
1007
|
-
return /* @__PURE__ */ a(
|
|
1008
|
-
/* @__PURE__ */ e(We, { open: s, onOpenChange:
|
|
1084
|
+
return /* @__PURE__ */ a(M, { children: [
|
|
1085
|
+
/* @__PURE__ */ e(We, { open: s, onOpenChange: n, children: /* @__PURE__ */ a(Xe, { className: "max-w-4xl max-h-[80vh]", children: [
|
|
1009
1086
|
/* @__PURE__ */ a(Ze, { children: [
|
|
1010
1087
|
/* @__PURE__ */ a(Ye, { className: "flex items-center gap-2", children: [
|
|
1011
1088
|
/* @__PURE__ */ e(V, { className: "h-5 w-5" }),
|
|
@@ -1013,8 +1090,8 @@ function ar({
|
|
|
1013
1090
|
] }),
|
|
1014
1091
|
/* @__PURE__ */ e(Ds, { children: "Manage your groups, create new groups, and control group membership" })
|
|
1015
1092
|
] }),
|
|
1016
|
-
/* @__PURE__ */ a(
|
|
1017
|
-
/* @__PURE__ */ a(
|
|
1093
|
+
/* @__PURE__ */ a(ks, { value: t, onValueChange: r, className: "mt-4", children: [
|
|
1094
|
+
/* @__PURE__ */ a(As, { className: "grid w-full grid-cols-2", children: [
|
|
1018
1095
|
/* @__PURE__ */ a(ge, { value: "groups", className: "flex items-center gap-2", children: [
|
|
1019
1096
|
/* @__PURE__ */ e(V, { className: "h-4 w-4" }),
|
|
1020
1097
|
"Groups"
|
|
@@ -1026,28 +1103,28 @@ function ar({
|
|
|
1026
1103
|
] }),
|
|
1027
1104
|
/* @__PURE__ */ e(ve, { value: "groups", className: "mt-4", children: /* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
1028
1105
|
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
1029
|
-
/* @__PURE__ */ e(
|
|
1106
|
+
/* @__PURE__ */ e(Ge, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
1030
1107
|
/* @__PURE__ */ e(
|
|
1031
1108
|
oe,
|
|
1032
1109
|
{
|
|
1033
1110
|
placeholder: "Search groups...",
|
|
1034
1111
|
value: l,
|
|
1035
|
-
onChange: (x) =>
|
|
1112
|
+
onChange: (x) => i(x.target.value),
|
|
1036
1113
|
className: "pl-10"
|
|
1037
1114
|
}
|
|
1038
1115
|
)
|
|
1039
1116
|
] }),
|
|
1040
|
-
/* @__PURE__ */ e(Fe, { className: "h-[400px]", children:
|
|
1117
|
+
/* @__PURE__ */ e(Fe, { className: "h-[400px]", children: T ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((x) => /* @__PURE__ */ e(je, { className: "h-24 w-full" }, x)) }) : O.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
1041
1118
|
/* @__PURE__ */ e(V, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
1042
1119
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
|
|
1043
1120
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
|
|
1044
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
1045
|
-
|
|
1121
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: O.map((x) => /* @__PURE__ */ e(
|
|
1122
|
+
on,
|
|
1046
1123
|
{
|
|
1047
1124
|
group: x,
|
|
1048
1125
|
onManageMembers: () => R(x),
|
|
1049
1126
|
onDelete: () => d(x),
|
|
1050
|
-
currentUserId:
|
|
1127
|
+
currentUserId: p == null ? void 0 : p.id
|
|
1051
1128
|
},
|
|
1052
1129
|
x.id
|
|
1053
1130
|
)) }) })
|
|
@@ -1055,7 +1132,7 @@ function ar({
|
|
|
1055
1132
|
/* @__PURE__ */ e(ve, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1056
1133
|
Bt,
|
|
1057
1134
|
{
|
|
1058
|
-
onSuccess:
|
|
1135
|
+
onSuccess: z,
|
|
1059
1136
|
tenantId: N,
|
|
1060
1137
|
isTenantUser: y
|
|
1061
1138
|
}
|
|
@@ -1063,37 +1140,37 @@ function ar({
|
|
|
1063
1140
|
] })
|
|
1064
1141
|
] }) }),
|
|
1065
1142
|
u && /* @__PURE__ */ e(
|
|
1066
|
-
|
|
1143
|
+
an,
|
|
1067
1144
|
{
|
|
1068
|
-
open:
|
|
1069
|
-
onOpenChange:
|
|
1145
|
+
open: f,
|
|
1146
|
+
onOpenChange: b,
|
|
1070
1147
|
group: u,
|
|
1071
|
-
onUpdate: () =>
|
|
1148
|
+
onUpdate: () => P()
|
|
1072
1149
|
}
|
|
1073
1150
|
),
|
|
1074
1151
|
/* @__PURE__ */ e(
|
|
1075
1152
|
Ts,
|
|
1076
1153
|
{
|
|
1077
|
-
open: !!
|
|
1154
|
+
open: !!c,
|
|
1078
1155
|
onOpenChange: () => d(null),
|
|
1079
1156
|
children: /* @__PURE__ */ a(_s, { children: [
|
|
1080
|
-
/* @__PURE__ */ a(
|
|
1081
|
-
/* @__PURE__ */ e(
|
|
1157
|
+
/* @__PURE__ */ a(Ps, { children: [
|
|
1158
|
+
/* @__PURE__ */ e(Us, { children: "Delete Group" }),
|
|
1082
1159
|
/* @__PURE__ */ a(Rs, { children: [
|
|
1083
1160
|
'Are you sure you want to delete "',
|
|
1084
|
-
|
|
1161
|
+
c == null ? void 0 : c.name,
|
|
1085
1162
|
'"? This action cannot be undone and will remove all members from the group.'
|
|
1086
1163
|
] })
|
|
1087
1164
|
] }),
|
|
1088
|
-
/* @__PURE__ */ a(
|
|
1165
|
+
/* @__PURE__ */ a(Gs, { children: [
|
|
1089
1166
|
/* @__PURE__ */ e(Fs, { children: "Cancel" }),
|
|
1090
1167
|
/* @__PURE__ */ e(
|
|
1091
1168
|
qe,
|
|
1092
1169
|
{
|
|
1093
|
-
onClick:
|
|
1094
|
-
disabled:
|
|
1170
|
+
onClick: $,
|
|
1171
|
+
disabled: g.isPending,
|
|
1095
1172
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1096
|
-
children:
|
|
1173
|
+
children: g.isPending ? /* @__PURE__ */ a(M, { children: [
|
|
1097
1174
|
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1098
1175
|
"Deleting..."
|
|
1099
1176
|
] }) : "Delete Group"
|
|
@@ -1105,9 +1182,9 @@ function ar({
|
|
|
1105
1182
|
)
|
|
1106
1183
|
] });
|
|
1107
1184
|
}
|
|
1108
|
-
function
|
|
1185
|
+
function on({
|
|
1109
1186
|
group: s,
|
|
1110
|
-
onManageMembers:
|
|
1187
|
+
onManageMembers: n,
|
|
1111
1188
|
onDelete: t,
|
|
1112
1189
|
currentUserId: r
|
|
1113
1190
|
}) {
|
|
@@ -1137,7 +1214,7 @@ function tr({
|
|
|
1137
1214
|
{
|
|
1138
1215
|
variant: "ghost",
|
|
1139
1216
|
size: "sm",
|
|
1140
|
-
onClick:
|
|
1217
|
+
onClick: n,
|
|
1141
1218
|
title: "Manage members",
|
|
1142
1219
|
children: /* @__PURE__ */ e(He, { className: "h-4 w-4" })
|
|
1143
1220
|
}
|
|
@@ -1156,105 +1233,105 @@ function tr({
|
|
|
1156
1233
|
] })
|
|
1157
1234
|
] }) });
|
|
1158
1235
|
}
|
|
1159
|
-
function
|
|
1236
|
+
function yn() {
|
|
1160
1237
|
var hs, ps, fs, gs;
|
|
1161
1238
|
mt(), ht();
|
|
1162
1239
|
const {
|
|
1163
1240
|
authToken: s,
|
|
1164
|
-
tokenProps:
|
|
1241
|
+
tokenProps: n,
|
|
1165
1242
|
id: t
|
|
1166
|
-
} =
|
|
1167
|
-
w((
|
|
1168
|
-
const
|
|
1169
|
-
w((
|
|
1243
|
+
} = G(), { isLocalDev: r } = Ta(), { permissions: l } = yt(), i = _a(), { isLoading: u } = Pa();
|
|
1244
|
+
w((o) => o.theme);
|
|
1245
|
+
const m = w((o) => o.lenses), f = w((o) => o.selectedLensId), b = m == null ? void 0 : m.find((o) => o.id === f), c = w((o) => o.dashboard);
|
|
1246
|
+
w((o) => o.selectedSheetId);
|
|
1170
1247
|
const d = w(
|
|
1171
|
-
(
|
|
1172
|
-
), { setDashboardTitle:
|
|
1173
|
-
(
|
|
1174
|
-
), ie = w((
|
|
1175
|
-
bs((
|
|
1248
|
+
(o) => o.isDashboardEditing
|
|
1249
|
+
), { setDashboardTitle: h } = w((o) => o.actions), [p, g] = S(!1), [y, N] = S(!1), [k, T] = S(!1), [P, O] = S(!1), [$, R] = S(!1), [z, x] = S(!1), [B, K] = S(!1), [Q, W] = S(null), [v, C] = S(!1), _ = w((o) => o.isDashboardPanelOpen), F = w(
|
|
1250
|
+
(o) => o.actions.setIsDashboardPanelOpen
|
|
1251
|
+
), ie = w((o) => o.filterValues), D = w((o) => o.isVisualEditing);
|
|
1252
|
+
bs((o) => o.card);
|
|
1176
1253
|
const Y = pe(
|
|
1177
|
-
(
|
|
1254
|
+
(o) => o.selectedDashboard
|
|
1178
1255
|
), le = pe(
|
|
1179
|
-
(
|
|
1256
|
+
(o) => o.initialDashboard
|
|
1180
1257
|
);
|
|
1181
|
-
pe((
|
|
1182
|
-
const ce = Y ? (ps = Y == null ? void 0 : Y.permissions) == null ? void 0 : ps.canEdit : (hs = le == null ? void 0 : le.permissions) == null ? void 0 : hs.canEdit, Ne = w((
|
|
1183
|
-
(
|
|
1184
|
-
), Se = w((
|
|
1185
|
-
(
|
|
1186
|
-
), { setIsDashboardEditing:
|
|
1187
|
-
(
|
|
1258
|
+
pe((o) => o.selectedVisual), w((o) => o.selectedFrameId), bs((o) => o.frame);
|
|
1259
|
+
const ce = Y ? (ps = Y == null ? void 0 : Y.permissions) == null ? void 0 : ps.canEdit : (hs = le == null ? void 0 : le.permissions) == null ? void 0 : hs.canEdit, Ne = w((o) => o.showFilters), Js = Ua((o) => o.setPanelOpen), Xs = w(
|
|
1260
|
+
(o) => o.showDashboardJSON
|
|
1261
|
+
), Se = w((o) => o.onSaveFunction), Zs = w(
|
|
1262
|
+
(o) => o.actions.setShowFilters
|
|
1263
|
+
), { setIsDashboardEditing: ns, setShowDashboardJSON: rs } = w(
|
|
1264
|
+
(o) => o.actions
|
|
1188
1265
|
), { setInitialDashboard: os, clearSelectedDashboard: we } = pe(
|
|
1189
|
-
(
|
|
1190
|
-
), { resources: de } = Ra(Ie.DASHBOARD), { data: xe } =
|
|
1266
|
+
(o) => o.actions
|
|
1267
|
+
), { resources: de } = Ra(Ie.DASHBOARD), { data: xe } = Ga(), Ys = ((fs = xe == null ? void 0 : xe.preference) == null ? void 0 : fs.defaultDashboardId) || null, { mutate: ea, isPending: sa } = Fa(), { currentUser: aa } = Is(), ta = ja(aa), J = Y || le, is = J ? {
|
|
1191
1268
|
id: J.id,
|
|
1192
|
-
title: (
|
|
1193
|
-
} : null, { handleAddNewFrame:
|
|
1269
|
+
title: (c == null ? void 0 : c.title) || J.title || "Dashboard"
|
|
1270
|
+
} : null, { handleAddNewFrame: na } = Ha(), [De, Ce] = S(!1), [ra, ee] = S(!1), [se, ue] = S("close"), ae = qa(Ie.DASHBOARD), [U, Le] = S(
|
|
1194
1271
|
null
|
|
1195
|
-
), oa = async (
|
|
1196
|
-
if (!(
|
|
1272
|
+
), oa = async (o, I) => {
|
|
1273
|
+
if (!(c != null && c.id)) {
|
|
1197
1274
|
console.log("No dashboard ID found");
|
|
1198
1275
|
return;
|
|
1199
1276
|
}
|
|
1200
1277
|
console.log("Updating dashboard title:", {
|
|
1201
|
-
dashboardId:
|
|
1202
|
-
newTitle:
|
|
1203
|
-
previousTitle:
|
|
1278
|
+
dashboardId: c.id,
|
|
1279
|
+
newTitle: o,
|
|
1280
|
+
previousTitle: I
|
|
1204
1281
|
}), ae.mutate(
|
|
1205
1282
|
{
|
|
1206
|
-
resourceId:
|
|
1207
|
-
data: { title:
|
|
1283
|
+
resourceId: c.id,
|
|
1284
|
+
data: { title: o }
|
|
1208
1285
|
},
|
|
1209
1286
|
{
|
|
1210
1287
|
onSuccess: () => {
|
|
1211
|
-
console.log("Dashboard title updated successfully"),
|
|
1288
|
+
console.log("Dashboard title updated successfully"), A.success("Dashboard title updated");
|
|
1212
1289
|
},
|
|
1213
|
-
onError: (
|
|
1214
|
-
console.error("Failed to update dashboard title:",
|
|
1290
|
+
onError: (re) => {
|
|
1291
|
+
console.error("Failed to update dashboard title:", re), A.error("Failed to update dashboard title"), h(I);
|
|
1215
1292
|
}
|
|
1216
1293
|
}
|
|
1217
1294
|
);
|
|
1218
1295
|
};
|
|
1219
1296
|
dt(() => {
|
|
1220
1297
|
if (de && de.length > 0) {
|
|
1221
|
-
const
|
|
1222
|
-
if (
|
|
1223
|
-
const
|
|
1224
|
-
(
|
|
1298
|
+
const o = c == null ? void 0 : c.id;
|
|
1299
|
+
if (o) {
|
|
1300
|
+
const I = de.find(
|
|
1301
|
+
(re) => re.id === o
|
|
1225
1302
|
);
|
|
1226
|
-
|
|
1303
|
+
I && os(I);
|
|
1227
1304
|
}
|
|
1228
1305
|
}
|
|
1229
|
-
}, [de,
|
|
1230
|
-
const me =
|
|
1231
|
-
|
|
1232
|
-
},
|
|
1233
|
-
|
|
1306
|
+
}, [de, c == null ? void 0 : c.id, os]);
|
|
1307
|
+
const me = n.orgUserId || n.tenantId, ls = d && !D && me && ce, { setDashboard: Ee } = w((o) => o.actions), ia = () => {
|
|
1308
|
+
ns(!0);
|
|
1309
|
+
}, ke = () => {
|
|
1310
|
+
ns(!1), rs(!1), Le(null);
|
|
1234
1311
|
};
|
|
1235
1312
|
pt(
|
|
1236
1313
|
d,
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
(
|
|
1314
|
+
c,
|
|
1315
|
+
U,
|
|
1316
|
+
(o) => Le(o)
|
|
1240
1317
|
);
|
|
1241
1318
|
const { isDirty: cs, isDirtyPending: la, resetDirty: he } = xt(
|
|
1242
|
-
|
|
1243
|
-
|
|
1319
|
+
c,
|
|
1320
|
+
U,
|
|
1244
1321
|
300,
|
|
1245
1322
|
1e3,
|
|
1246
1323
|
Te
|
|
1247
|
-
), ds = ut(() =>
|
|
1248
|
-
ds() ? (ue("close"), ee(!0)) : (
|
|
1324
|
+
), ds = ut(() => U ? Te(c) !== Te(U) : !1, [c, U]), Ae = cs || la, te = De || ae.isPending, ca = () => {
|
|
1325
|
+
ds() ? (ue("close"), ee(!0)) : (ke(), he());
|
|
1249
1326
|
}, da = async () => {
|
|
1250
1327
|
await Me({
|
|
1251
1328
|
closeAfterSave: !0,
|
|
1252
1329
|
navigateHomeAfterSave: se === "home"
|
|
1253
1330
|
});
|
|
1254
1331
|
}, ua = () => {
|
|
1255
|
-
|
|
1332
|
+
U && Ee(U), ke(), se === "home" && we(), ue("close"), ee(!1), he();
|
|
1256
1333
|
}, ma = () => {
|
|
1257
|
-
|
|
1334
|
+
U && (Ee(U), he());
|
|
1258
1335
|
}, ha = () => {
|
|
1259
1336
|
if (d && ds()) {
|
|
1260
1337
|
ue("home"), ee(!0);
|
|
@@ -1262,52 +1339,52 @@ function fr() {
|
|
|
1262
1339
|
}
|
|
1263
1340
|
we();
|
|
1264
1341
|
};
|
|
1265
|
-
async function Me(
|
|
1266
|
-
const
|
|
1267
|
-
C(
|
|
1268
|
-
const ba = ct(
|
|
1342
|
+
async function Me(o) {
|
|
1343
|
+
const I = (o == null ? void 0 : o.closeAfterSave) ?? v, re = (o == null ? void 0 : o.navigateHomeAfterSave) ?? !1;
|
|
1344
|
+
C(I), I && ee(!1);
|
|
1345
|
+
const ba = ct(c);
|
|
1269
1346
|
K(!0), W(null), Ce(!0);
|
|
1270
1347
|
const ya = {
|
|
1271
|
-
template:
|
|
1348
|
+
template: c
|
|
1272
1349
|
};
|
|
1273
1350
|
ae.mutate(
|
|
1274
1351
|
{
|
|
1275
|
-
resourceId:
|
|
1352
|
+
resourceId: c.id,
|
|
1276
1353
|
data: ya
|
|
1277
1354
|
},
|
|
1278
1355
|
{
|
|
1279
1356
|
onSuccess: () => {
|
|
1280
|
-
Ce(!1),
|
|
1357
|
+
Ce(!1), A.success("Dashboard saved!"), Le(ba), K(!1), C(!1), I && (ke(), he(), re && we()), ue("close");
|
|
1281
1358
|
},
|
|
1282
1359
|
onError: () => {
|
|
1283
|
-
Ce(!1), W("Failed to save dashboard. Please try again."),
|
|
1360
|
+
Ce(!1), W("Failed to save dashboard. Please try again."), A.error("Failed to save dashboard");
|
|
1284
1361
|
}
|
|
1285
1362
|
}
|
|
1286
1363
|
);
|
|
1287
1364
|
}
|
|
1288
1365
|
async function pa() {
|
|
1289
|
-
if (
|
|
1290
|
-
const
|
|
1291
|
-
...
|
|
1292
|
-
template:
|
|
1366
|
+
if (g(!0), !f || !b) return;
|
|
1367
|
+
const o = JSON.stringify(c), I = {
|
|
1368
|
+
...b,
|
|
1369
|
+
template: o,
|
|
1293
1370
|
filterValues: ie
|
|
1294
1371
|
};
|
|
1295
|
-
await
|
|
1296
|
-
|
|
1297
|
-
|
|
1372
|
+
await $e(
|
|
1373
|
+
n.apiServiceUrl,
|
|
1374
|
+
I,
|
|
1298
1375
|
s == null ? void 0 : s.accessToken
|
|
1299
|
-
),
|
|
1376
|
+
), A.success("Lens saved"), Se == null || Se(c), g(!1);
|
|
1300
1377
|
}
|
|
1301
|
-
const us = (
|
|
1378
|
+
const us = (b == null ? void 0 : b.name) || c.title;
|
|
1302
1379
|
ae.isPending && console.log("Title during update:", {
|
|
1303
1380
|
title: us,
|
|
1304
|
-
dashboardStateTitle:
|
|
1305
|
-
dashboardId:
|
|
1306
|
-
currentLensName:
|
|
1381
|
+
dashboardStateTitle: c.title,
|
|
1382
|
+
dashboardId: c == null ? void 0 : c.id,
|
|
1383
|
+
currentLensName: b == null ? void 0 : b.name
|
|
1307
1384
|
});
|
|
1308
|
-
const ms =
|
|
1309
|
-
|
|
1310
|
-
dashboardId: Oe ? null :
|
|
1385
|
+
const ms = n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail, fa = !!ms && !!(s != null && s.accessToken) && !!(n != null && n.apiServiceUrl), ga = i, ne = (c == null ? void 0 : c.id) || null, Oe = !!ne && Ys === ne, va = () => {
|
|
1386
|
+
ne && ea({
|
|
1387
|
+
dashboardId: Oe ? null : ne
|
|
1311
1388
|
});
|
|
1312
1389
|
};
|
|
1313
1390
|
return /* @__PURE__ */ a(
|
|
@@ -1317,14 +1394,14 @@ function fr() {
|
|
|
1317
1394
|
role: "dashboard-controls",
|
|
1318
1395
|
children: [
|
|
1319
1396
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
1320
|
-
ms && /* @__PURE__ */ a(
|
|
1397
|
+
ms && /* @__PURE__ */ a(M, { children: [
|
|
1321
1398
|
/* @__PURE__ */ e(
|
|
1322
1399
|
j,
|
|
1323
1400
|
{
|
|
1324
1401
|
"aria-label": "Manage Dashboards",
|
|
1325
1402
|
tooltip: "Manage Dashboards",
|
|
1326
1403
|
onClick: () => {
|
|
1327
|
-
F(!
|
|
1404
|
+
F(!_);
|
|
1328
1405
|
},
|
|
1329
1406
|
className: "h-7 p-2",
|
|
1330
1407
|
children: /* @__PURE__ */ e(Lt, { className: "h-4 w-4" })
|
|
@@ -1341,38 +1418,38 @@ function fr() {
|
|
|
1341
1418
|
}
|
|
1342
1419
|
)
|
|
1343
1420
|
] }),
|
|
1344
|
-
!D &&
|
|
1421
|
+
!D && i && (u ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
1345
1422
|
/* @__PURE__ */ e(q, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
|
|
1346
1423
|
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
|
|
1347
|
-
] }) : /* @__PURE__ */ a(
|
|
1424
|
+
] }) : /* @__PURE__ */ a(M, { children: [
|
|
1348
1425
|
/* @__PURE__ */ e(
|
|
1349
1426
|
Va,
|
|
1350
1427
|
{
|
|
1351
1428
|
value: us || "Untitled Dashboard",
|
|
1352
|
-
onSave: (
|
|
1429
|
+
onSave: (o) => {
|
|
1353
1430
|
console.log("EditableText onSave called:", {
|
|
1354
|
-
newTitle:
|
|
1431
|
+
newTitle: o,
|
|
1355
1432
|
canEditDashboard: ce,
|
|
1356
|
-
dashboardId:
|
|
1433
|
+
dashboardId: c == null ? void 0 : c.id
|
|
1357
1434
|
});
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1435
|
+
const I = (c == null ? void 0 : c.title) || "";
|
|
1436
|
+
h(o), oa(o, I);
|
|
1360
1437
|
},
|
|
1361
|
-
isEditable: ce && !
|
|
1438
|
+
isEditable: ce && !b,
|
|
1362
1439
|
displayClassName: "text-sm font-medium",
|
|
1363
1440
|
inputClassName: "text-sm font-medium",
|
|
1364
1441
|
placeholder: "Dashboard Title",
|
|
1365
1442
|
isPending: ae.isPending
|
|
1366
1443
|
}
|
|
1367
1444
|
),
|
|
1368
|
-
fa &&
|
|
1445
|
+
fa && ne && /* @__PURE__ */ e($a, { children: /* @__PURE__ */ a(za, { children: [
|
|
1369
1446
|
/* @__PURE__ */ e(Ba, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1370
1447
|
L,
|
|
1371
1448
|
{
|
|
1372
1449
|
variant: "ghost",
|
|
1373
1450
|
size: "icon",
|
|
1374
1451
|
onClick: va,
|
|
1375
|
-
disabled: sa || !(s != null && s.accessToken) || !(
|
|
1452
|
+
disabled: sa || !(s != null && s.accessToken) || !(n != null && n.apiServiceUrl),
|
|
1376
1453
|
className: "h-7 w-7",
|
|
1377
1454
|
children: /* @__PURE__ */ e(
|
|
1378
1455
|
Ka,
|
|
@@ -1390,18 +1467,18 @@ function fr() {
|
|
|
1390
1467
|
] }))
|
|
1391
1468
|
] }),
|
|
1392
1469
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
1393
|
-
D && /* @__PURE__ */ a(
|
|
1470
|
+
D && /* @__PURE__ */ a(M, { children: [
|
|
1394
1471
|
/* @__PURE__ */ e(ft, { className: "mr-2" }),
|
|
1395
1472
|
/* @__PURE__ */ e(gt, { className: "h-7" })
|
|
1396
1473
|
] }),
|
|
1397
|
-
r && !D && /* @__PURE__ */ a(
|
|
1474
|
+
r && !D && /* @__PURE__ */ a(M, { children: [
|
|
1398
1475
|
/* @__PURE__ */ e(
|
|
1399
1476
|
j,
|
|
1400
1477
|
{
|
|
1401
1478
|
tooltip: "Copy Token",
|
|
1402
1479
|
onClick: () => {
|
|
1403
|
-
var
|
|
1404
|
-
s != null && s.accessToken && ((
|
|
1480
|
+
var o;
|
|
1481
|
+
s != null && s.accessToken && ((o = navigator == null ? void 0 : navigator.clipboard) != null && o.writeText ? navigator.clipboard.writeText(s.accessToken).then(() => A.success("Token copied to clipboard")).catch(() => A.error("Unable to copy token")) : A.error("Clipboard not available"));
|
|
1405
1482
|
},
|
|
1406
1483
|
className: "h-7 p-2",
|
|
1407
1484
|
children: /* @__PURE__ */ e(Wa, { className: "h-4 w-4" })
|
|
@@ -1411,15 +1488,15 @@ function fr() {
|
|
|
1411
1488
|
j,
|
|
1412
1489
|
{
|
|
1413
1490
|
tooltip: "Invalidate Token",
|
|
1414
|
-
onClick: () => Ja(
|
|
1491
|
+
onClick: () => Ja(n.apiServiceUrl),
|
|
1415
1492
|
className: "h-7 p-2",
|
|
1416
|
-
children: /* @__PURE__ */ e(
|
|
1493
|
+
children: /* @__PURE__ */ e(kt, { className: "h-4 w-4" })
|
|
1417
1494
|
}
|
|
1418
1495
|
)
|
|
1419
1496
|
] }),
|
|
1420
|
-
!D &&
|
|
1421
|
-
!D &&
|
|
1422
|
-
!D &&
|
|
1497
|
+
!D && i && /* @__PURE__ */ e(Xa, {}),
|
|
1498
|
+
!D && i && /* @__PURE__ */ e(vt, {}),
|
|
1499
|
+
!D && i && ((gs = J == null ? void 0 : J.permissions) == null ? void 0 : gs.canShare) && /* @__PURE__ */ e(
|
|
1423
1500
|
j,
|
|
1424
1501
|
{
|
|
1425
1502
|
tooltip: "Share Dashboard",
|
|
@@ -1428,7 +1505,7 @@ function fr() {
|
|
|
1428
1505
|
children: /* @__PURE__ */ e(Za, { className: "h-4 w-4" })
|
|
1429
1506
|
}
|
|
1430
1507
|
),
|
|
1431
|
-
!D && d && l.canUseFilters &&
|
|
1508
|
+
!D && d && l.canUseFilters && i && /* @__PURE__ */ a(
|
|
1432
1509
|
L,
|
|
1433
1510
|
{
|
|
1434
1511
|
className: "h-7 px-2",
|
|
@@ -1443,14 +1520,14 @@ function fr() {
|
|
|
1443
1520
|
]
|
|
1444
1521
|
}
|
|
1445
1522
|
),
|
|
1446
|
-
d && !D && me && r &&
|
|
1447
|
-
!D && me && r &&
|
|
1448
|
-
d && !D && me &&
|
|
1523
|
+
d && !D && me && r && i && /* @__PURE__ */ e(Ut, {}),
|
|
1524
|
+
!D && me && r && i && /* @__PURE__ */ e(Rt, {}),
|
|
1525
|
+
d && !D && me && b && r && i && /* @__PURE__ */ a(
|
|
1449
1526
|
L,
|
|
1450
1527
|
{
|
|
1451
1528
|
className: "h-7 p-2",
|
|
1452
1529
|
variant: "secondary",
|
|
1453
|
-
disabled:
|
|
1530
|
+
disabled: p,
|
|
1454
1531
|
onClick: pa,
|
|
1455
1532
|
size: "sm",
|
|
1456
1533
|
children: [
|
|
@@ -1459,21 +1536,21 @@ function fr() {
|
|
|
1459
1536
|
]
|
|
1460
1537
|
}
|
|
1461
1538
|
),
|
|
1462
|
-
d && !D &&
|
|
1539
|
+
d && !D && i && /* @__PURE__ */ a(
|
|
1463
1540
|
L,
|
|
1464
1541
|
{
|
|
1465
1542
|
variant: "outline",
|
|
1466
1543
|
className: "h-7 p-2",
|
|
1467
1544
|
size: "sm",
|
|
1468
1545
|
disabled: !d,
|
|
1469
|
-
onClick: () =>
|
|
1546
|
+
onClick: () => na(),
|
|
1470
1547
|
children: [
|
|
1471
1548
|
/* @__PURE__ */ e(Je, { className: "mr-2 h-4 w-4" }),
|
|
1472
1549
|
"Visual"
|
|
1473
1550
|
]
|
|
1474
1551
|
}
|
|
1475
1552
|
),
|
|
1476
|
-
!D && !d && ce &&
|
|
1553
|
+
!D && !d && ce && i && /* @__PURE__ */ a(
|
|
1477
1554
|
L,
|
|
1478
1555
|
{
|
|
1479
1556
|
variant: "outline",
|
|
@@ -1486,7 +1563,7 @@ function fr() {
|
|
|
1486
1563
|
]
|
|
1487
1564
|
}
|
|
1488
1565
|
),
|
|
1489
|
-
ls &&
|
|
1566
|
+
ls && i && cs && /* @__PURE__ */ a(
|
|
1490
1567
|
L,
|
|
1491
1568
|
{
|
|
1492
1569
|
variant: "outline",
|
|
@@ -1500,12 +1577,12 @@ function fr() {
|
|
|
1500
1577
|
]
|
|
1501
1578
|
}
|
|
1502
1579
|
),
|
|
1503
|
-
ls &&
|
|
1580
|
+
ls && i && /* @__PURE__ */ a("div", { className: "relative inline-flex", children: [
|
|
1504
1581
|
/* @__PURE__ */ a(
|
|
1505
1582
|
L,
|
|
1506
1583
|
{
|
|
1507
|
-
className: X("h-7 p-2", !
|
|
1508
|
-
disabled: te || !
|
|
1584
|
+
className: X("h-7 p-2", !Ae && "opacity-60"),
|
|
1585
|
+
disabled: te || !Ae,
|
|
1509
1586
|
onClick: () => Me(),
|
|
1510
1587
|
size: "sm",
|
|
1511
1588
|
children: [
|
|
@@ -1514,7 +1591,7 @@ function fr() {
|
|
|
1514
1591
|
]
|
|
1515
1592
|
}
|
|
1516
1593
|
),
|
|
1517
|
-
|
|
1594
|
+
Ae && !te && /* @__PURE__ */ e(
|
|
1518
1595
|
"span",
|
|
1519
1596
|
{
|
|
1520
1597
|
"aria-hidden": "true",
|
|
@@ -1522,18 +1599,18 @@ function fr() {
|
|
|
1522
1599
|
}
|
|
1523
1600
|
)
|
|
1524
1601
|
] }),
|
|
1525
|
-
!D && d && r &&
|
|
1602
|
+
!D && d && r && i && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
|
|
1526
1603
|
L,
|
|
1527
1604
|
{
|
|
1528
1605
|
className: "h-7 p-2",
|
|
1529
|
-
onClick: () =>
|
|
1606
|
+
onClick: () => rs(!Xs),
|
|
1530
1607
|
size: "sm",
|
|
1531
1608
|
variant: "ghost",
|
|
1532
1609
|
children: /* @__PURE__ */ e(at, { className: "h-4 w-4" })
|
|
1533
1610
|
}
|
|
1534
1611
|
) }),
|
|
1535
1612
|
!D && r && /* @__PURE__ */ e(Tt, {}),
|
|
1536
|
-
d && !D &&
|
|
1613
|
+
d && !D && i && /* @__PURE__ */ a(
|
|
1537
1614
|
L,
|
|
1538
1615
|
{
|
|
1539
1616
|
variant: "outline",
|
|
@@ -1545,19 +1622,19 @@ function fr() {
|
|
|
1545
1622
|
]
|
|
1546
1623
|
}
|
|
1547
1624
|
),
|
|
1548
|
-
!D &&
|
|
1625
|
+
!D && i && /* @__PURE__ */ a(ze, { children: [
|
|
1549
1626
|
/* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(j, { tooltip: "More Options", className: "h-7 p-2", children: /* @__PURE__ */ e(tt, { className: "h-4 w-4" }) }) }),
|
|
1550
1627
|
/* @__PURE__ */ a(Ke, { align: "end", children: [
|
|
1551
|
-
/* @__PURE__ */ a(H, { onClick: () =>
|
|
1552
|
-
/* @__PURE__ */ e(
|
|
1628
|
+
/* @__PURE__ */ a(H, { onClick: () => O(!0), children: [
|
|
1629
|
+
/* @__PURE__ */ e(nt, { className: "mr-2 h-4 w-4" }),
|
|
1553
1630
|
"Schedule Dashboard"
|
|
1554
1631
|
] }),
|
|
1555
|
-
ta && /* @__PURE__ */ a(H, { onClick: () =>
|
|
1632
|
+
ta && /* @__PURE__ */ a(H, { onClick: () => T(!0), children: [
|
|
1556
1633
|
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4" }),
|
|
1557
1634
|
"Manage Groups"
|
|
1558
1635
|
] }),
|
|
1559
1636
|
/* @__PURE__ */ a(H, { onClick: () => R(!0), children: [
|
|
1560
|
-
/* @__PURE__ */ e(
|
|
1637
|
+
/* @__PURE__ */ e(rt, { className: "mr-2 h-4 w-4" }),
|
|
1561
1638
|
"Calendar Preferences"
|
|
1562
1639
|
] }),
|
|
1563
1640
|
/* @__PURE__ */ a(H, { onClick: () => x(!0), children: [
|
|
@@ -1575,38 +1652,38 @@ function fr() {
|
|
|
1575
1652
|
}
|
|
1576
1653
|
),
|
|
1577
1654
|
/* @__PURE__ */ e(
|
|
1578
|
-
|
|
1655
|
+
rn,
|
|
1579
1656
|
{
|
|
1580
|
-
open:
|
|
1581
|
-
onOpenChange:
|
|
1657
|
+
open: k,
|
|
1658
|
+
onOpenChange: T
|
|
1582
1659
|
}
|
|
1583
1660
|
),
|
|
1584
|
-
(
|
|
1661
|
+
(c == null ? void 0 : c.id) && /* @__PURE__ */ e(
|
|
1585
1662
|
lt,
|
|
1586
1663
|
{
|
|
1587
|
-
open:
|
|
1588
|
-
onOpenChange:
|
|
1589
|
-
dashboardId:
|
|
1590
|
-
dashboardName:
|
|
1664
|
+
open: P,
|
|
1665
|
+
onOpenChange: O,
|
|
1666
|
+
dashboardId: c.id,
|
|
1667
|
+
dashboardName: c == null ? void 0 : c.title
|
|
1591
1668
|
}
|
|
1592
1669
|
),
|
|
1593
1670
|
/* @__PURE__ */ e(
|
|
1594
1671
|
St,
|
|
1595
1672
|
{
|
|
1596
|
-
open:
|
|
1673
|
+
open: $,
|
|
1597
1674
|
onOpenChange: R
|
|
1598
1675
|
}
|
|
1599
1676
|
),
|
|
1600
1677
|
/* @__PURE__ */ e(
|
|
1601
1678
|
wt,
|
|
1602
1679
|
{
|
|
1603
|
-
open:
|
|
1680
|
+
open: z,
|
|
1604
1681
|
onOpenChange: x,
|
|
1605
|
-
dashboard:
|
|
1682
|
+
dashboard: c,
|
|
1606
1683
|
disabled: !d,
|
|
1607
|
-
onApply: (
|
|
1608
|
-
...
|
|
1609
|
-
summary:
|
|
1684
|
+
onApply: (o) => Ee({
|
|
1685
|
+
...c,
|
|
1686
|
+
summary: o
|
|
1610
1687
|
})
|
|
1611
1688
|
}
|
|
1612
1689
|
),
|
|
@@ -1614,15 +1691,15 @@ function fr() {
|
|
|
1614
1691
|
Ts,
|
|
1615
1692
|
{
|
|
1616
1693
|
open: B,
|
|
1617
|
-
onOpenChange: (
|
|
1618
|
-
!
|
|
1694
|
+
onOpenChange: (o) => {
|
|
1695
|
+
!o && De && !Q || (K(o), o || (W(null), C(!1)));
|
|
1619
1696
|
},
|
|
1620
1697
|
children: /* @__PURE__ */ a(_s, { className: "max-w-sm", children: [
|
|
1621
|
-
/* @__PURE__ */ a(
|
|
1622
|
-
/* @__PURE__ */ e(
|
|
1698
|
+
/* @__PURE__ */ a(Ps, { children: [
|
|
1699
|
+
/* @__PURE__ */ e(Us, { children: Q ? "Save failed" : "Saving dashboard" }),
|
|
1623
1700
|
/* @__PURE__ */ e(Rs, { className: "pt-2", children: Q ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
|
|
1624
1701
|
] }),
|
|
1625
|
-
/* @__PURE__ */ e(
|
|
1702
|
+
/* @__PURE__ */ e(Gs, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: Q ? /* @__PURE__ */ a(M, { children: [
|
|
1626
1703
|
/* @__PURE__ */ e(
|
|
1627
1704
|
Fs,
|
|
1628
1705
|
{
|
|
@@ -1637,7 +1714,7 @@ function fr() {
|
|
|
1637
1714
|
qe,
|
|
1638
1715
|
{
|
|
1639
1716
|
onClick: () => Me({
|
|
1640
|
-
closeAfterSave:
|
|
1717
|
+
closeAfterSave: v,
|
|
1641
1718
|
navigateHomeAfterSave: se === "home"
|
|
1642
1719
|
}),
|
|
1643
1720
|
className: "m-0",
|
|
@@ -1661,9 +1738,9 @@ function fr() {
|
|
|
1661
1738
|
/* @__PURE__ */ e(
|
|
1662
1739
|
bt,
|
|
1663
1740
|
{
|
|
1664
|
-
open:
|
|
1665
|
-
onOpenChange: (
|
|
1666
|
-
ee(
|
|
1741
|
+
open: ra,
|
|
1742
|
+
onOpenChange: (o) => {
|
|
1743
|
+
ee(o);
|
|
1667
1744
|
},
|
|
1668
1745
|
onSave: da,
|
|
1669
1746
|
onDiscard: ua,
|
|
@@ -1678,5 +1755,5 @@ function fr() {
|
|
|
1678
1755
|
);
|
|
1679
1756
|
}
|
|
1680
1757
|
export {
|
|
1681
|
-
|
|
1758
|
+
yn as default
|
|
1682
1759
|
};
|