react-semaphor 0.1.179 → 0.1.180
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-CeT5saB7.js → dashboard-controls-Baw7eUyM.js} +3 -3
- package/dist/chunks/{dashboard-controls-O2Vl2SaH.js → dashboard-controls-CS3pAVZi.js} +339 -337
- package/dist/chunks/{dashboard-json--jGkpREU.js → dashboard-json-ClalWYi4.js} +1 -1
- package/dist/chunks/{dashboard-json-d1qZ8OYo.js → dashboard-json-Cz4bNnCC.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-ViDNkE8Q.js → edit-dashboard-visual-BMElXt-n.js} +30 -35
- package/dist/chunks/{edit-dashboard-visual-BsP87bZV.js → edit-dashboard-visual-DFJ5FJ7y.js} +11 -22
- package/dist/chunks/editor-action-buttons-DVWnnC_r.js +11 -0
- package/dist/chunks/{editor-action-buttons-F4_UU-Mk.js → editor-action-buttons-MtNYw1Bb.js} +57 -45
- package/dist/chunks/{index-v6ayK5K2.js → index-CAeKp6K8.js} +22589 -22037
- package/dist/chunks/{index-CFWw2cJ5.js → index-CfPKTeUk.js} +232 -227
- package/dist/chunks/notification-bell-2dZI5OV0.js +21 -0
- package/dist/chunks/notification-bell-YZ8VqdwA.js +870 -0
- package/dist/chunks/{resource-management-panel-Cn1aOr6L.js → resource-management-panel-Buhi-kvP.js} +1 -1
- package/dist/chunks/{resource-management-panel-CApVr9Vd.js → resource-management-panel-pxL28GXq.js} +133 -133
- package/dist/chunks/{use-role-aware-display-preferences-C-N0-Iik.js → use-role-aware-display-preferences-B_i2f9tn.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-Bxp6i8c7.js → use-role-aware-display-preferences-JljRcjrP.js} +1 -1
- package/dist/chunks/{use-visual-utils-D9lMGeVv.js → use-visual-utils-D3HjbsKO.js} +38 -38
- package/dist/chunks/{use-visual-utils-D19qzwzI.js → use-visual-utils-DPEHcmFT.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -6
- package/dist/index.js +133 -126
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +262 -0
- package/package.json +1 -1
- package/dist/chunks/editor-action-buttons-DseT424l.js +0 -6
- package/dist/chunks/schedule-dashboard-B4KUKLfW.js +0 -416
- package/dist/chunks/schedule-dashboard-vvFw8B1E.js +0 -6
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { aF as J, bU as Ks, u as x, aV as es, aW as ss, B as M, aY as as, aZ as ve, bV as ke, as as ts, aN as U, bu as Oe, bW as Qs, a_ as Ie, bv as _e, bw as Te, bx as Ge, by as rs, bz as Se, bX as W, bB as Ws, I as j, bY as Js, b2 as Ys, bZ as Xs, b_ as Qe, b$ as ns, c as ie, c0 as os, aH as ce, c1 as le, aL as A, c2 as is, bG as Zs, c3 as ea, aG as $, b1 as q, c4 as sa, c5 as aa, c6 as xe, c7 as ta, c8 as ra, c9 as cs, ca as ls, cb as ne, cc as oe, bD as we, b8 as Ce, cd as De, b3 as ds, ce as Le, bH as us, e as ms, cf as na, bb as hs, bc as ps, bd as fs, be as gs, bf as vs, bg as bs, bh as ys, bi as Ee, aT as oa, cg as ia, G as ca, au as We, A as te, ch as la, M as da, R as be, ci as ua, cj as ma, ck as ha, cl as pa, a$ as fa, Y as ga, cm as va, cn as ba, co as ya, cp as Na, cq as Sa, L as xa, W as wa } from "./index-CAeKp6K8.js";
|
|
3
3
|
import * as L from "react";
|
|
4
4
|
import Ns, { useState as S, useMemo as re, useEffect as Ca } from "react";
|
|
5
5
|
import "react-dom";
|
|
6
|
-
import {
|
|
7
|
-
import { u as
|
|
8
|
-
import { b as
|
|
9
|
-
import { S as Je } from "./editor-action-buttons-
|
|
6
|
+
import { b as Da, u as La, c as Ea, A as Aa, V as Ma, S as ka, N as Oa, U as Ia } from "./notification-bell-YZ8VqdwA.js";
|
|
7
|
+
import { u as _a } from "./use-role-aware-display-preferences-B_i2f9tn.js";
|
|
8
|
+
import { b as Ta } from "./index-B4EhQdS9.js";
|
|
9
|
+
import { S as Je } from "./editor-action-buttons-MtNYw1Bb.js";
|
|
10
10
|
/**
|
|
11
11
|
* @license lucide-react v0.453.0 - ISC
|
|
12
12
|
*
|
|
13
13
|
* This source code is licensed under the ISC license.
|
|
14
14
|
* See the LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
const
|
|
16
|
+
const Ga = J("Glasses", [
|
|
17
17
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
18
18
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
19
19
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -26,7 +26,7 @@ const Ia = J("Glasses", [
|
|
|
26
26
|
* This source code is licensed under the ISC license.
|
|
27
27
|
* See the LICENSE file in the root directory of this source tree.
|
|
28
28
|
*/
|
|
29
|
-
const
|
|
29
|
+
const Ra = J("Menu", [
|
|
30
30
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
31
31
|
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
32
32
|
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
@@ -37,7 +37,7 @@ const _a = J("Menu", [
|
|
|
37
37
|
* This source code is licensed under the ISC license.
|
|
38
38
|
* See the LICENSE file in the root directory of this source tree.
|
|
39
39
|
*/
|
|
40
|
-
const
|
|
40
|
+
const Pa = J("Moon", [
|
|
41
41
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
42
42
|
]);
|
|
43
43
|
/**
|
|
@@ -46,7 +46,7 @@ const Ta = J("Moon", [
|
|
|
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
|
|
49
|
+
const Ua = J("ShieldX", [
|
|
50
50
|
[
|
|
51
51
|
"path",
|
|
52
52
|
{
|
|
@@ -63,7 +63,7 @@ const Ga = J("ShieldX", [
|
|
|
63
63
|
* This source code is licensed under the ISC license.
|
|
64
64
|
* See the LICENSE file in the root directory of this source tree.
|
|
65
65
|
*/
|
|
66
|
-
const
|
|
66
|
+
const Fa = J("Sun", [
|
|
67
67
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
68
68
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
69
69
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -84,42 +84,42 @@ var Ae = { exports: {} }, ye = {};
|
|
|
84
84
|
* This source code is licensed under the MIT license found in the
|
|
85
85
|
* LICENSE file in the root directory of this source tree.
|
|
86
86
|
*/
|
|
87
|
-
var
|
|
88
|
-
function
|
|
89
|
-
if (
|
|
90
|
-
|
|
87
|
+
var Ye;
|
|
88
|
+
function ja() {
|
|
89
|
+
if (Ye) return ye;
|
|
90
|
+
Ye = 1;
|
|
91
91
|
var s = Ns;
|
|
92
|
-
function n(
|
|
93
|
-
return
|
|
92
|
+
function n(l, h) {
|
|
93
|
+
return l === h && (l !== 0 || 1 / l === 1 / h) || l !== l && h !== h;
|
|
94
94
|
}
|
|
95
|
-
var a = typeof Object.is == "function" ? Object.is : n, t = s.useState,
|
|
96
|
-
function m(
|
|
95
|
+
var a = typeof Object.is == "function" ? Object.is : n, t = s.useState, i = s.useEffect, o = s.useLayoutEffect, u = s.useDebugValue;
|
|
96
|
+
function m(l, h) {
|
|
97
97
|
var p = h(), v = t({ inst: { value: p, getSnapshot: h } }), y = v[0].inst, N = v[1];
|
|
98
|
-
return
|
|
98
|
+
return o(
|
|
99
99
|
function() {
|
|
100
100
|
y.value = p, y.getSnapshot = h, f(y) && N({ inst: y });
|
|
101
101
|
},
|
|
102
|
-
[
|
|
103
|
-
),
|
|
102
|
+
[l, p, h]
|
|
103
|
+
), i(
|
|
104
104
|
function() {
|
|
105
|
-
return f(y) && N({ inst: y }),
|
|
105
|
+
return f(y) && N({ inst: y }), l(function() {
|
|
106
106
|
f(y) && N({ inst: y });
|
|
107
107
|
});
|
|
108
108
|
},
|
|
109
|
-
[
|
|
109
|
+
[l]
|
|
110
110
|
), u(p), p;
|
|
111
111
|
}
|
|
112
|
-
function f(
|
|
113
|
-
var h =
|
|
114
|
-
|
|
112
|
+
function f(l) {
|
|
113
|
+
var h = l.getSnapshot;
|
|
114
|
+
l = l.value;
|
|
115
115
|
try {
|
|
116
116
|
var p = h();
|
|
117
|
-
return !a(
|
|
117
|
+
return !a(l, p);
|
|
118
118
|
} catch {
|
|
119
119
|
return !0;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
function b(
|
|
122
|
+
function b(l, h) {
|
|
123
123
|
return h();
|
|
124
124
|
}
|
|
125
125
|
var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? b : m;
|
|
@@ -135,22 +135,22 @@ var Ne = {};
|
|
|
135
135
|
* This source code is licensed under the MIT license found in the
|
|
136
136
|
* LICENSE file in the root directory of this source tree.
|
|
137
137
|
*/
|
|
138
|
-
var
|
|
139
|
-
function
|
|
140
|
-
return
|
|
138
|
+
var Xe;
|
|
139
|
+
function $a() {
|
|
140
|
+
return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
141
141
|
function s(p, v) {
|
|
142
142
|
return p === v && (p !== 0 || 1 / p === 1 / v) || p !== p && v !== v;
|
|
143
143
|
}
|
|
144
144
|
function n(p, v) {
|
|
145
|
-
d ||
|
|
145
|
+
d || i.startTransition === void 0 || (d = !0, console.error(
|
|
146
146
|
"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."
|
|
147
147
|
));
|
|
148
148
|
var y = v();
|
|
149
|
-
if (!
|
|
149
|
+
if (!l) {
|
|
150
150
|
var N = v();
|
|
151
|
-
|
|
151
|
+
o(y, N) || (console.error(
|
|
152
152
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
153
|
-
),
|
|
153
|
+
), l = !0);
|
|
154
154
|
}
|
|
155
155
|
N = u({
|
|
156
156
|
inst: { value: y, getSnapshot: v }
|
|
@@ -175,7 +175,7 @@ function Ua() {
|
|
|
175
175
|
p = p.value;
|
|
176
176
|
try {
|
|
177
177
|
var y = v();
|
|
178
|
-
return !
|
|
178
|
+
return !o(p, y);
|
|
179
179
|
} catch {
|
|
180
180
|
return !0;
|
|
181
181
|
}
|
|
@@ -184,27 +184,27 @@ function Ua() {
|
|
|
184
184
|
return v();
|
|
185
185
|
}
|
|
186
186
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
187
|
-
var
|
|
188
|
-
Ne.useSyncExternalStore =
|
|
187
|
+
var i = Ns, o = typeof Object.is == "function" ? Object.is : s, u = i.useState, m = i.useEffect, f = i.useLayoutEffect, b = i.useDebugValue, d = !1, l = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t : n;
|
|
188
|
+
Ne.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
189
189
|
}()), Ne;
|
|
190
190
|
}
|
|
191
|
-
process.env.NODE_ENV === "production" ? Ae.exports =
|
|
192
|
-
var
|
|
193
|
-
function
|
|
194
|
-
const { setTheme: s } =
|
|
191
|
+
process.env.NODE_ENV === "production" ? Ae.exports = ja() : Ae.exports = $a();
|
|
192
|
+
var qa = Ae.exports;
|
|
193
|
+
function Va() {
|
|
194
|
+
const { setTheme: s } = Ks(), n = x(
|
|
195
195
|
(a) => a.actions.setDashboardTheme
|
|
196
196
|
);
|
|
197
197
|
return /* @__PURE__ */ r(es, { children: [
|
|
198
198
|
/* @__PURE__ */ e(ss, { asChild: !0, children: /* @__PURE__ */ r(M, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
|
|
199
199
|
/* @__PURE__ */ e(
|
|
200
|
-
|
|
200
|
+
Fa,
|
|
201
201
|
{
|
|
202
202
|
strokeWidth: 1.5,
|
|
203
203
|
className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
|
|
204
204
|
}
|
|
205
205
|
),
|
|
206
206
|
/* @__PURE__ */ e(
|
|
207
|
-
|
|
207
|
+
Pa,
|
|
208
208
|
{
|
|
209
209
|
strokeWidth: 1.5,
|
|
210
210
|
className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
|
|
@@ -243,13 +243,13 @@ function $a() {
|
|
|
243
243
|
] })
|
|
244
244
|
] });
|
|
245
245
|
}
|
|
246
|
-
async function
|
|
247
|
-
if (!
|
|
246
|
+
async function za(s, n, a, t, i) {
|
|
247
|
+
if (!i)
|
|
248
248
|
return null;
|
|
249
|
-
const
|
|
250
|
-
return await ke(u,
|
|
249
|
+
const o = JSON.stringify(a), u = `${s}/v1/lens`;
|
|
250
|
+
return await ke(u, i, {
|
|
251
251
|
name: n,
|
|
252
|
-
template:
|
|
252
|
+
template: o,
|
|
253
253
|
filterValues: t,
|
|
254
254
|
operation: "create"
|
|
255
255
|
});
|
|
@@ -257,17 +257,17 @@ async function Va(s, n, a, t, o) {
|
|
|
257
257
|
async function Me(s, n, a) {
|
|
258
258
|
if (!a)
|
|
259
259
|
return null;
|
|
260
|
-
const { id: t, template:
|
|
260
|
+
const { id: t, template: i, filterValues: o, isDefault: u, shared: m } = n, f = `${s}/v1/lens`;
|
|
261
261
|
return await ke(f, a, {
|
|
262
262
|
lensId: t,
|
|
263
|
-
template:
|
|
264
|
-
filterValues:
|
|
263
|
+
template: i,
|
|
264
|
+
filterValues: o,
|
|
265
265
|
isDefault: u,
|
|
266
266
|
shared: m,
|
|
267
267
|
operation: "update"
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
|
-
async function
|
|
270
|
+
async function Ha(s, n, a) {
|
|
271
271
|
if (!a)
|
|
272
272
|
return null;
|
|
273
273
|
const t = `${s}/v1/lens`;
|
|
@@ -276,18 +276,18 @@ async function ja(s, n, a) {
|
|
|
276
276
|
lensId: n
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
const [s, n] = S(""), [a, t] = S(!1),
|
|
279
|
+
function Ba() {
|
|
280
|
+
const [s, n] = S(""), [a, t] = S(!1), i = x((N) => N.lenses), { setLenses: o, setSelectedLensId: u } = ts(), [m, f] = S(!1), [b, d] = S(!1), l = x((N) => N.dashboard), h = x((N) => N.filterValues), { authToken: p, tokenProps: v } = U();
|
|
281
281
|
async function y() {
|
|
282
282
|
f(!0);
|
|
283
|
-
const N = await
|
|
283
|
+
const N = await za(
|
|
284
284
|
v.apiServiceUrl,
|
|
285
285
|
s,
|
|
286
|
-
|
|
286
|
+
l,
|
|
287
287
|
h,
|
|
288
288
|
p == null ? void 0 : p.accessToken
|
|
289
289
|
);
|
|
290
|
-
N && (
|
|
290
|
+
N && (o([...i || [], N]), u(N.id), d(!1)), f(!1);
|
|
291
291
|
}
|
|
292
292
|
return /* @__PURE__ */ r(Oe, { open: b, onOpenChange: d, children: [
|
|
293
293
|
/* @__PURE__ */ e(Qs, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -336,33 +336,33 @@ function qa() {
|
|
|
336
336
|
] })
|
|
337
337
|
] });
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
const [s, n] = S(!1), a = x((
|
|
341
|
-
async function f(
|
|
342
|
-
|
|
339
|
+
function Ka() {
|
|
340
|
+
const [s, n] = S(!1), a = x((l) => l.lenses), t = x((l) => l.selectedLensId), { setLenses: i, setSelectedLensId: o } = ts(), { authToken: u, tokenProps: m } = U();
|
|
341
|
+
async function f(l) {
|
|
342
|
+
o(l);
|
|
343
343
|
}
|
|
344
|
-
async function b(
|
|
345
|
-
if (await
|
|
346
|
-
const p = a == null ? void 0 : a.filter((v) => v.id !==
|
|
347
|
-
|
|
344
|
+
async function b(l) {
|
|
345
|
+
if (await Ha(m.apiServiceUrl, l, u == null ? void 0 : u.accessToken)) {
|
|
346
|
+
const p = a == null ? void 0 : a.filter((v) => v.id !== l);
|
|
347
|
+
i(p || []), o("original");
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
async function d(
|
|
351
|
-
const h = a == null ? void 0 : a.map((y) => y.id ===
|
|
350
|
+
async function d(l) {
|
|
351
|
+
const h = a == null ? void 0 : a.map((y) => y.id === l.id ? {
|
|
352
352
|
...y,
|
|
353
|
-
isDefault: !
|
|
353
|
+
isDefault: !l.isDefault
|
|
354
354
|
} : {
|
|
355
355
|
...y,
|
|
356
356
|
isDefault: !1
|
|
357
357
|
});
|
|
358
|
-
|
|
358
|
+
i(h || []);
|
|
359
359
|
const p = {
|
|
360
|
-
...
|
|
361
|
-
isDefault: !
|
|
360
|
+
...l,
|
|
361
|
+
isDefault: !l.isDefault
|
|
362
362
|
};
|
|
363
363
|
await Me(m.apiServiceUrl, p, u == null ? void 0 : u.accessToken);
|
|
364
364
|
const v = a == null ? void 0 : a.find((y) => y.isDefault);
|
|
365
|
-
if (v && v.id !==
|
|
365
|
+
if (v && v.id !== l.id) {
|
|
366
366
|
const y = {
|
|
367
367
|
...v,
|
|
368
368
|
isDefault: !1
|
|
@@ -371,36 +371,36 @@ function za() {
|
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
return /* @__PURE__ */ r(es, { open: s, onOpenChange: n, children: [
|
|
374
|
-
/* @__PURE__ */ e(ss, { asChild: !0, children: /* @__PURE__ */ e(
|
|
374
|
+
/* @__PURE__ */ e(ss, { asChild: !0, children: /* @__PURE__ */ e(j, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Ga, { className: "h-4 w-4" }) }) }),
|
|
375
375
|
/* @__PURE__ */ r(as, { align: "end", className: "w-60", children: [
|
|
376
376
|
/* @__PURE__ */ e(Js, { className: "px-3", children: "Lenses" }),
|
|
377
|
-
/* @__PURE__ */ e(
|
|
377
|
+
/* @__PURE__ */ e(Ys, {}),
|
|
378
378
|
/* @__PURE__ */ r(
|
|
379
|
-
|
|
379
|
+
Xs,
|
|
380
380
|
{
|
|
381
381
|
value: t,
|
|
382
382
|
onValueChange: f,
|
|
383
383
|
children: [
|
|
384
384
|
/* @__PURE__ */ e(Qe, { value: "original", children: "Original" }),
|
|
385
|
-
a == null ? void 0 : a.map((
|
|
385
|
+
a == null ? void 0 : a.map((l) => /* @__PURE__ */ r(
|
|
386
386
|
Qe,
|
|
387
387
|
{
|
|
388
388
|
className: "group flex justify-between gap-2",
|
|
389
|
-
value:
|
|
389
|
+
value: l.id,
|
|
390
390
|
children: [
|
|
391
|
-
/* @__PURE__ */ e("p", { children:
|
|
391
|
+
/* @__PURE__ */ e("p", { children: l.name }),
|
|
392
392
|
/* @__PURE__ */ r("span", { className: "flex items-center gap-3", children: [
|
|
393
393
|
/* @__PURE__ */ e(
|
|
394
394
|
ns,
|
|
395
395
|
{
|
|
396
396
|
onClick: (h) => {
|
|
397
|
-
h.preventDefault(), d(
|
|
397
|
+
h.preventDefault(), d(l);
|
|
398
398
|
},
|
|
399
399
|
className: ie(
|
|
400
400
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
401
401
|
{
|
|
402
|
-
invisible: !
|
|
403
|
-
"text-green-500":
|
|
402
|
+
invisible: !l.isDefault,
|
|
403
|
+
"text-green-500": l.isDefault
|
|
404
404
|
}
|
|
405
405
|
),
|
|
406
406
|
strokeWidth: 1.5
|
|
@@ -410,7 +410,7 @@ function za() {
|
|
|
410
410
|
os,
|
|
411
411
|
{
|
|
412
412
|
onClick: (h) => {
|
|
413
|
-
h.preventDefault(), b(
|
|
413
|
+
h.preventDefault(), b(l.id);
|
|
414
414
|
},
|
|
415
415
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
416
416
|
strokeWidth: 1.5
|
|
@@ -419,7 +419,7 @@ function za() {
|
|
|
419
419
|
] })
|
|
420
420
|
]
|
|
421
421
|
},
|
|
422
|
-
|
|
422
|
+
l.id
|
|
423
423
|
))
|
|
424
424
|
]
|
|
425
425
|
}
|
|
@@ -427,25 +427,25 @@ function za() {
|
|
|
427
427
|
] })
|
|
428
428
|
] });
|
|
429
429
|
}
|
|
430
|
-
const
|
|
430
|
+
const Qa = async (s, n, a) => {
|
|
431
431
|
const t = `${s}/management/v1/groups`;
|
|
432
432
|
return await is(t, n, a);
|
|
433
|
-
},
|
|
434
|
-
const t = `${s}/management/v1/groups/${a}`,
|
|
433
|
+
}, Wa = async (s, n, a) => {
|
|
434
|
+
const t = `${s}/management/v1/groups/${a}`, i = await fetch(t, {
|
|
435
435
|
method: "DELETE",
|
|
436
436
|
headers: {
|
|
437
437
|
Authorization: `Bearer ${n}`
|
|
438
438
|
}
|
|
439
439
|
});
|
|
440
|
-
if (!
|
|
441
|
-
const
|
|
442
|
-
throw new Error(
|
|
440
|
+
if (!i.ok) {
|
|
441
|
+
const o = await i.text();
|
|
442
|
+
throw new Error(o || "Failed to delete group");
|
|
443
443
|
}
|
|
444
|
-
},
|
|
445
|
-
const
|
|
446
|
-
return await is(
|
|
447
|
-
},
|
|
448
|
-
const
|
|
444
|
+
}, Ja = async (s, n, a, t) => {
|
|
445
|
+
const i = `${s}/management/v1/groups/${a}/members`;
|
|
446
|
+
return await is(i, n, t);
|
|
447
|
+
}, Ya = async (s, n, a, t) => {
|
|
448
|
+
const i = `${s}/management/v1/groups/${a}/members`, o = await fetch(i, {
|
|
449
449
|
method: "DELETE",
|
|
450
450
|
headers: {
|
|
451
451
|
"Content-Type": "application/json",
|
|
@@ -453,15 +453,15 @@ const Ha = async (s, n, a) => {
|
|
|
453
453
|
},
|
|
454
454
|
body: JSON.stringify(t)
|
|
455
455
|
});
|
|
456
|
-
if (!
|
|
457
|
-
const u = await
|
|
456
|
+
if (!o.ok) {
|
|
457
|
+
const u = await o.text();
|
|
458
458
|
throw new Error(u || "Failed to remove group members");
|
|
459
459
|
}
|
|
460
460
|
};
|
|
461
|
-
function
|
|
462
|
-
const { authToken: s, tokenProps: n } = U(), a =
|
|
463
|
-
return
|
|
464
|
-
mutationFn: (t) =>
|
|
461
|
+
function Xa() {
|
|
462
|
+
const { authToken: s, tokenProps: n } = U(), a = ce();
|
|
463
|
+
return le({
|
|
464
|
+
mutationFn: (t) => Qa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
465
465
|
onSuccess: () => {
|
|
466
466
|
a.invalidateQueries({ queryKey: ["groups"] }), A.success("Group created successfully");
|
|
467
467
|
},
|
|
@@ -472,12 +472,12 @@ function Wa() {
|
|
|
472
472
|
}
|
|
473
473
|
});
|
|
474
474
|
}
|
|
475
|
-
function
|
|
476
|
-
const { authToken: s, tokenProps: n } = U(), a =
|
|
477
|
-
return
|
|
478
|
-
mutationFn: (t) =>
|
|
479
|
-
onSuccess: (t,
|
|
480
|
-
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group",
|
|
475
|
+
function Za() {
|
|
476
|
+
const { authToken: s, tokenProps: n } = U(), a = ce();
|
|
477
|
+
return le({
|
|
478
|
+
mutationFn: (t) => Wa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
479
|
+
onSuccess: (t, i) => {
|
|
480
|
+
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", i] }), A.success("Group deleted successfully");
|
|
481
481
|
},
|
|
482
482
|
onError: (t) => {
|
|
483
483
|
console.error("Failed to delete group:", t), A.error("Failed to delete group", {
|
|
@@ -486,16 +486,16 @@ function Ja() {
|
|
|
486
486
|
}
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
const { authToken: s, tokenProps: n } = U(), a =
|
|
491
|
-
return
|
|
489
|
+
function et() {
|
|
490
|
+
const { authToken: s, tokenProps: n } = U(), a = ce();
|
|
491
|
+
return le({
|
|
492
492
|
mutationFn: ({
|
|
493
493
|
groupId: t,
|
|
494
|
-
data:
|
|
495
|
-
}) =>
|
|
496
|
-
onSuccess: (t,
|
|
497
|
-
a.invalidateQueries({ queryKey: ["group",
|
|
498
|
-
queryKey: ["group-members",
|
|
494
|
+
data: i
|
|
495
|
+
}) => Ja(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
|
|
496
|
+
onSuccess: (t, i) => {
|
|
497
|
+
a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
|
|
498
|
+
queryKey: ["group-members", i.groupId]
|
|
499
499
|
}), a.invalidateQueries({ queryKey: ["groups"] }), A.success("Members added successfully");
|
|
500
500
|
},
|
|
501
501
|
onError: (t) => {
|
|
@@ -505,16 +505,16 @@ function Xa() {
|
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
507
|
}
|
|
508
|
-
function
|
|
509
|
-
const { authToken: s, tokenProps: n } = U(), a =
|
|
510
|
-
return
|
|
508
|
+
function st() {
|
|
509
|
+
const { authToken: s, tokenProps: n } = U(), a = ce();
|
|
510
|
+
return le({
|
|
511
511
|
mutationFn: ({
|
|
512
512
|
groupId: t,
|
|
513
|
-
data:
|
|
514
|
-
}) =>
|
|
515
|
-
onSuccess: (t,
|
|
516
|
-
a.invalidateQueries({ queryKey: ["group",
|
|
517
|
-
queryKey: ["group-members",
|
|
513
|
+
data: i
|
|
514
|
+
}) => Ya(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
|
|
515
|
+
onSuccess: (t, i) => {
|
|
516
|
+
a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
|
|
517
|
+
queryKey: ["group-members", i.groupId]
|
|
518
518
|
}), a.invalidateQueries({ queryKey: ["groups"] }), A.success("Members removed successfully");
|
|
519
519
|
},
|
|
520
520
|
onError: (t) => {
|
|
@@ -524,25 +524,25 @@ function Ya() {
|
|
|
524
524
|
}
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function at({
|
|
528
528
|
onSuccess: s,
|
|
529
529
|
tenantId: n,
|
|
530
530
|
isTenantUser: a
|
|
531
531
|
}) {
|
|
532
|
-
const [t,
|
|
532
|
+
const [t, i] = S(""), [o, u] = S(""), [m, f] = S({}), b = Xa(), d = () => {
|
|
533
533
|
const h = {};
|
|
534
|
-
return t.trim() ? t.length < 3 ? h.name = "Group name must be at least 3 characters" : t.length > 50 && (h.name = "Group name must be less than 50 characters") : h.name = "Group name is required",
|
|
534
|
+
return t.trim() ? t.length < 3 ? h.name = "Group name must be at least 3 characters" : t.length > 50 && (h.name = "Group name must be less than 50 characters") : h.name = "Group name is required", o && o.length > 200 && (h.description = "Description must be less than 200 characters"), f(h), Object.keys(h).length === 0;
|
|
535
535
|
};
|
|
536
536
|
return /* @__PURE__ */ r("form", { onSubmit: async (h) => {
|
|
537
537
|
if (h.preventDefault(), !d()) return;
|
|
538
538
|
const p = {
|
|
539
539
|
name: t.trim(),
|
|
540
|
-
description:
|
|
540
|
+
description: o.trim() || void 0,
|
|
541
541
|
type: a ? "TENANT_GROUP" : "ORG_GROUP",
|
|
542
542
|
...a && n ? { tenantId: n } : {}
|
|
543
543
|
};
|
|
544
544
|
try {
|
|
545
|
-
await b.mutateAsync(p),
|
|
545
|
+
await b.mutateAsync(p), i(""), u(""), f({}), s();
|
|
546
546
|
} catch (v) {
|
|
547
547
|
console.error("Failed to create group:", v);
|
|
548
548
|
}
|
|
@@ -560,7 +560,7 @@ function Za({
|
|
|
560
560
|
placeholder: "e.g., Marketing Team, Engineering Squad",
|
|
561
561
|
value: t,
|
|
562
562
|
onChange: (h) => {
|
|
563
|
-
|
|
563
|
+
i(h.target.value), m.name && f((p) => ({ ...p, name: "" }));
|
|
564
564
|
},
|
|
565
565
|
className: m.name ? "border-destructive" : "",
|
|
566
566
|
disabled: b.isPending
|
|
@@ -578,7 +578,7 @@ function Za({
|
|
|
578
578
|
{
|
|
579
579
|
id: "group-description",
|
|
580
580
|
placeholder: "Describe the purpose of this group...",
|
|
581
|
-
value:
|
|
581
|
+
value: o,
|
|
582
582
|
onChange: (h) => {
|
|
583
583
|
u(h.target.value), m.description && f((p) => ({ ...p, description: "" }));
|
|
584
584
|
},
|
|
@@ -589,7 +589,7 @@ function Za({
|
|
|
589
589
|
),
|
|
590
590
|
m.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.description }),
|
|
591
591
|
/* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: [
|
|
592
|
-
|
|
592
|
+
o.length,
|
|
593
593
|
"/200 characters"
|
|
594
594
|
] })
|
|
595
595
|
] }),
|
|
@@ -605,7 +605,7 @@ function Za({
|
|
|
605
605
|
type: "button",
|
|
606
606
|
variant: "outline",
|
|
607
607
|
onClick: () => {
|
|
608
|
-
|
|
608
|
+
i(""), u(""), f({});
|
|
609
609
|
},
|
|
610
610
|
disabled: b.isPending,
|
|
611
611
|
children: "Clear"
|
|
@@ -617,10 +617,10 @@ function Za({
|
|
|
617
617
|
type: "submit",
|
|
618
618
|
disabled: b.isPending || !t.trim(),
|
|
619
619
|
children: b.isPending ? /* @__PURE__ */ r(_, { children: [
|
|
620
|
-
/* @__PURE__ */ e(
|
|
620
|
+
/* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
621
621
|
"Creating..."
|
|
622
622
|
] }) : /* @__PURE__ */ r(_, { children: [
|
|
623
|
-
/* @__PURE__ */ e(
|
|
623
|
+
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4" }),
|
|
624
624
|
"Create Group"
|
|
625
625
|
] })
|
|
626
626
|
}
|
|
@@ -628,59 +628,59 @@ function Za({
|
|
|
628
628
|
] })
|
|
629
629
|
] });
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function tt(s, n = []) {
|
|
632
632
|
let a = [];
|
|
633
|
-
function t(
|
|
633
|
+
function t(o, u) {
|
|
634
634
|
const m = L.createContext(u);
|
|
635
|
-
m.displayName =
|
|
635
|
+
m.displayName = o + "Context";
|
|
636
636
|
const f = a.length;
|
|
637
637
|
a = [...a, u];
|
|
638
|
-
const b = (
|
|
638
|
+
const b = (l) => {
|
|
639
639
|
var E;
|
|
640
|
-
const { scope: h, children: p, ...v } =
|
|
640
|
+
const { scope: h, children: p, ...v } = l, y = ((E = h == null ? void 0 : h[s]) == null ? void 0 : E[f]) || m, N = L.useMemo(() => v, Object.values(v));
|
|
641
641
|
return /* @__PURE__ */ e(y.Provider, { value: N, children: p });
|
|
642
642
|
};
|
|
643
|
-
b.displayName =
|
|
644
|
-
function d(
|
|
643
|
+
b.displayName = o + "Provider";
|
|
644
|
+
function d(l, h) {
|
|
645
645
|
var y;
|
|
646
646
|
const p = ((y = h == null ? void 0 : h[s]) == null ? void 0 : y[f]) || m, v = L.useContext(p);
|
|
647
647
|
if (v) return v;
|
|
648
648
|
if (u !== void 0) return u;
|
|
649
|
-
throw new Error(`\`${
|
|
649
|
+
throw new Error(`\`${l}\` must be used within \`${o}\``);
|
|
650
650
|
}
|
|
651
651
|
return [b, d];
|
|
652
652
|
}
|
|
653
|
-
const
|
|
654
|
-
const
|
|
653
|
+
const i = () => {
|
|
654
|
+
const o = a.map((u) => L.createContext(u));
|
|
655
655
|
return function(m) {
|
|
656
|
-
const f = (m == null ? void 0 : m[s]) ||
|
|
656
|
+
const f = (m == null ? void 0 : m[s]) || o;
|
|
657
657
|
return L.useMemo(
|
|
658
658
|
() => ({ [`__scope${s}`]: { ...m, [s]: f } }),
|
|
659
659
|
[m, f]
|
|
660
660
|
);
|
|
661
661
|
};
|
|
662
662
|
};
|
|
663
|
-
return
|
|
663
|
+
return i.scopeName = s, [t, rt(i, ...n)];
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function rt(...s) {
|
|
666
666
|
const n = s[0];
|
|
667
667
|
if (s.length === 1) return n;
|
|
668
668
|
const a = () => {
|
|
669
|
-
const t = s.map((
|
|
670
|
-
useScope:
|
|
671
|
-
scopeName:
|
|
669
|
+
const t = s.map((i) => ({
|
|
670
|
+
useScope: i(),
|
|
671
|
+
scopeName: i.scopeName
|
|
672
672
|
}));
|
|
673
|
-
return function(
|
|
673
|
+
return function(o) {
|
|
674
674
|
const u = t.reduce((m, { useScope: f, scopeName: b }) => {
|
|
675
|
-
const
|
|
676
|
-
return { ...m, ...
|
|
675
|
+
const l = f(o)[`__scope${b}`];
|
|
676
|
+
return { ...m, ...l };
|
|
677
677
|
}, {});
|
|
678
678
|
return L.useMemo(() => ({ [`__scope${n.scopeName}`]: u }), [u]);
|
|
679
679
|
};
|
|
680
680
|
};
|
|
681
681
|
return a.scopeName = n.scopeName, a;
|
|
682
682
|
}
|
|
683
|
-
var
|
|
683
|
+
var nt = [
|
|
684
684
|
"a",
|
|
685
685
|
"button",
|
|
686
686
|
"div",
|
|
@@ -698,33 +698,33 @@ var at = [
|
|
|
698
698
|
"span",
|
|
699
699
|
"svg",
|
|
700
700
|
"ul"
|
|
701
|
-
], Re =
|
|
702
|
-
const a = sa(`Primitive.${n}`), t = L.forwardRef((
|
|
703
|
-
const { asChild: u, ...m } =
|
|
704
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(f, { ...m, ref:
|
|
701
|
+
], Re = nt.reduce((s, n) => {
|
|
702
|
+
const a = sa(`Primitive.${n}`), t = L.forwardRef((i, o) => {
|
|
703
|
+
const { asChild: u, ...m } = i, f = u ? a : n;
|
|
704
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(f, { ...m, ref: o });
|
|
705
705
|
});
|
|
706
706
|
return t.displayName = `Primitive.${n}`, { ...s, [n]: t };
|
|
707
707
|
}, {});
|
|
708
|
-
function
|
|
709
|
-
return
|
|
710
|
-
|
|
708
|
+
function ot() {
|
|
709
|
+
return qa.useSyncExternalStore(
|
|
710
|
+
it,
|
|
711
711
|
() => !0,
|
|
712
712
|
() => !1
|
|
713
713
|
);
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function it() {
|
|
716
716
|
return () => {
|
|
717
717
|
};
|
|
718
718
|
}
|
|
719
|
-
var Pe = "Avatar", [
|
|
719
|
+
var Pe = "Avatar", [ct] = tt(Pe), [lt, Ss] = ct(Pe), xs = L.forwardRef(
|
|
720
720
|
(s, n) => {
|
|
721
|
-
const { __scopeAvatar: a, ...t } = s, [
|
|
721
|
+
const { __scopeAvatar: a, ...t } = s, [i, o] = L.useState("idle");
|
|
722
722
|
return /* @__PURE__ */ e(
|
|
723
|
-
|
|
723
|
+
lt,
|
|
724
724
|
{
|
|
725
725
|
scope: a,
|
|
726
|
-
imageLoadingStatus:
|
|
727
|
-
onImageLoadingStatusChange:
|
|
726
|
+
imageLoadingStatus: i,
|
|
727
|
+
onImageLoadingStatusChange: o,
|
|
728
728
|
children: /* @__PURE__ */ e(Re.span, { ...t, ref: n })
|
|
729
729
|
}
|
|
730
730
|
);
|
|
@@ -733,47 +733,47 @@ var Pe = "Avatar", [nt] = et(Pe), [ot, Ss] = nt(Pe), xs = L.forwardRef(
|
|
|
733
733
|
xs.displayName = Pe;
|
|
734
734
|
var ws = "AvatarImage", Cs = L.forwardRef(
|
|
735
735
|
(s, n) => {
|
|
736
|
-
const { __scopeAvatar: a, src: t, onLoadingStatusChange:
|
|
737
|
-
}, ...
|
|
738
|
-
|
|
736
|
+
const { __scopeAvatar: a, src: t, onLoadingStatusChange: i = () => {
|
|
737
|
+
}, ...o } = s, u = Ss(ws, a), m = dt(t, o), f = aa((b) => {
|
|
738
|
+
i(b), u.onImageLoadingStatusChange(b);
|
|
739
739
|
});
|
|
740
740
|
return xe(() => {
|
|
741
741
|
m !== "idle" && f(m);
|
|
742
|
-
}, [m, f]), m === "loaded" ? /* @__PURE__ */ e(Re.img, { ...
|
|
742
|
+
}, [m, f]), m === "loaded" ? /* @__PURE__ */ e(Re.img, { ...o, ref: n, src: t }) : null;
|
|
743
743
|
}
|
|
744
744
|
);
|
|
745
745
|
Cs.displayName = ws;
|
|
746
746
|
var Ds = "AvatarFallback", Ls = L.forwardRef(
|
|
747
747
|
(s, n) => {
|
|
748
|
-
const { __scopeAvatar: a, delayMs: t, ...
|
|
748
|
+
const { __scopeAvatar: a, delayMs: t, ...i } = s, o = Ss(Ds, a), [u, m] = L.useState(t === void 0);
|
|
749
749
|
return L.useEffect(() => {
|
|
750
750
|
if (t !== void 0) {
|
|
751
751
|
const f = window.setTimeout(() => m(!0), t);
|
|
752
752
|
return () => window.clearTimeout(f);
|
|
753
753
|
}
|
|
754
|
-
}, [t]), u &&
|
|
754
|
+
}, [t]), u && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Re.span, { ...i, ref: n }) : null;
|
|
755
755
|
}
|
|
756
756
|
);
|
|
757
757
|
Ls.displayName = Ds;
|
|
758
758
|
function Ze(s, n) {
|
|
759
759
|
return s ? n ? (s.src !== n && (s.src = n), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
760
760
|
}
|
|
761
|
-
function
|
|
762
|
-
const t =
|
|
763
|
-
() => Ze(
|
|
761
|
+
function dt(s, { referrerPolicy: n, crossOrigin: a }) {
|
|
762
|
+
const t = ot(), i = L.useRef(null), o = t ? (i.current || (i.current = new window.Image()), i.current) : null, [u, m] = L.useState(
|
|
763
|
+
() => Ze(o, s)
|
|
764
764
|
);
|
|
765
765
|
return xe(() => {
|
|
766
|
-
m(Ze(
|
|
767
|
-
}, [
|
|
768
|
-
const f = (
|
|
769
|
-
m(
|
|
766
|
+
m(Ze(o, s));
|
|
767
|
+
}, [o, s]), xe(() => {
|
|
768
|
+
const f = (l) => () => {
|
|
769
|
+
m(l);
|
|
770
770
|
};
|
|
771
|
-
if (!
|
|
771
|
+
if (!o) return;
|
|
772
772
|
const b = f("loaded"), d = f("error");
|
|
773
|
-
return
|
|
774
|
-
|
|
773
|
+
return o.addEventListener("load", b), o.addEventListener("error", d), n && (o.referrerPolicy = n), typeof a == "string" && (o.crossOrigin = a), () => {
|
|
774
|
+
o.removeEventListener("load", b), o.removeEventListener("error", d);
|
|
775
775
|
};
|
|
776
|
-
}, [
|
|
776
|
+
}, [o, a, n]), u;
|
|
777
777
|
}
|
|
778
778
|
var Es = xs, As = Cs, Ms = Ls;
|
|
779
779
|
const Ue = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
@@ -788,7 +788,7 @@ const Ue = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
|
788
788
|
}
|
|
789
789
|
));
|
|
790
790
|
Ue.displayName = Es.displayName;
|
|
791
|
-
const
|
|
791
|
+
const ut = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
792
792
|
As,
|
|
793
793
|
{
|
|
794
794
|
ref: a,
|
|
@@ -796,7 +796,7 @@ const lt = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
|
796
796
|
...n
|
|
797
797
|
}
|
|
798
798
|
));
|
|
799
|
-
|
|
799
|
+
ut.displayName = As.displayName;
|
|
800
800
|
const Fe = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
801
801
|
Ms,
|
|
802
802
|
{
|
|
@@ -809,18 +809,18 @@ const Fe = L.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
|
809
809
|
}
|
|
810
810
|
));
|
|
811
811
|
Fe.displayName = Ms.displayName;
|
|
812
|
-
function
|
|
812
|
+
function mt({
|
|
813
813
|
open: s,
|
|
814
814
|
onOpenChange: n,
|
|
815
815
|
group: a,
|
|
816
816
|
onUpdate: t
|
|
817
817
|
}) {
|
|
818
|
-
const [
|
|
818
|
+
const [i, o] = S("members"), [u, m] = S(""), [f, b] = S([]), [d, l] = S([]), { data: h, isLoading: p, refetch: v } = ta(a.id), y = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: N, isLoading: E } = ra({
|
|
819
819
|
type: y,
|
|
820
820
|
tenantId: a.tenantId || void 0,
|
|
821
821
|
active: !0,
|
|
822
822
|
limit: 100
|
|
823
|
-
}), T =
|
|
823
|
+
}), T = et(), R = st(), k = (h == null ? void 0 : h.members) || [], P = re(() => new Set(k.map((g) => g.userId)), [k]), G = re(() => N.filter((g) => !P.has(g.id)), [N, P]), V = re(() => {
|
|
824
824
|
if (!u) return G;
|
|
825
825
|
const g = u.toLowerCase();
|
|
826
826
|
return G.filter(
|
|
@@ -834,8 +834,8 @@ function ct({
|
|
|
834
834
|
const g = u.toLowerCase();
|
|
835
835
|
return k.filter(
|
|
836
836
|
(D) => {
|
|
837
|
-
var O, F,
|
|
838
|
-
return ((F = (O = D.user) == null ? void 0 : O.name) == null ? void 0 : F.toLowerCase().includes(g)) || ((
|
|
837
|
+
var O, F, Y, X;
|
|
838
|
+
return ((F = (O = D.user) == null ? void 0 : O.name) == null ? void 0 : F.toLowerCase().includes(g)) || ((X = (Y = D.user) == null ? void 0 : Y.email) == null ? void 0 : X.toLowerCase().includes(g));
|
|
839
839
|
}
|
|
840
840
|
);
|
|
841
841
|
}, [k, u]), z = async () => {
|
|
@@ -847,7 +847,7 @@ function ct({
|
|
|
847
847
|
userIds: f,
|
|
848
848
|
userType: y === "tenant" ? "tenant" : "org"
|
|
849
849
|
}
|
|
850
|
-
}), b([]),
|
|
850
|
+
}), b([]), o("members"), v(), t == null || t();
|
|
851
851
|
} catch (g) {
|
|
852
852
|
console.error("Failed to add members:", g);
|
|
853
853
|
}
|
|
@@ -859,7 +859,7 @@ function ct({
|
|
|
859
859
|
data: {
|
|
860
860
|
userIds: d
|
|
861
861
|
}
|
|
862
|
-
}),
|
|
862
|
+
}), l([]), v(), t == null || t();
|
|
863
863
|
} catch (g) {
|
|
864
864
|
console.error("Failed to remove members:", g);
|
|
865
865
|
}
|
|
@@ -868,7 +868,7 @@ function ct({
|
|
|
868
868
|
(D) => D.includes(g) ? D.filter((O) => O !== g) : [...D, g]
|
|
869
869
|
);
|
|
870
870
|
}, C = (g) => {
|
|
871
|
-
|
|
871
|
+
l(
|
|
872
872
|
(D) => D.includes(g) ? D.filter((O) => O !== g) : [...D, g]
|
|
873
873
|
);
|
|
874
874
|
};
|
|
@@ -886,10 +886,10 @@ function ct({
|
|
|
886
886
|
" group"
|
|
887
887
|
] })
|
|
888
888
|
] }),
|
|
889
|
-
/* @__PURE__ */ r(
|
|
890
|
-
|
|
889
|
+
/* @__PURE__ */ r(cs, { value: i, onValueChange: (g) => {
|
|
890
|
+
o(g), m(""), l([]);
|
|
891
891
|
}, className: "mt-4", children: [
|
|
892
|
-
/* @__PURE__ */ r(
|
|
892
|
+
/* @__PURE__ */ r(ls, { className: "grid w-full grid-cols-2", children: [
|
|
893
893
|
/* @__PURE__ */ e(ne, { value: "members", children: "Current Members" }),
|
|
894
894
|
/* @__PURE__ */ e(ne, { value: "add", children: "Add Members" })
|
|
895
895
|
] }),
|
|
@@ -907,11 +907,11 @@ function ct({
|
|
|
907
907
|
)
|
|
908
908
|
] }),
|
|
909
909
|
/* @__PURE__ */ e(Ce, { className: d.length > 0 ? "h-[300px]" : "h-[350px]", children: p ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(De, { className: "h-16 w-full" }, g)) }) : w.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
910
|
-
/* @__PURE__ */ e(
|
|
910
|
+
/* @__PURE__ */ e(q, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
911
911
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: u ? "No members found" : "No members yet" }),
|
|
912
912
|
/* @__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' })
|
|
913
913
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: w.map((g) => /* @__PURE__ */ e(
|
|
914
|
-
|
|
914
|
+
ht,
|
|
915
915
|
{
|
|
916
916
|
member: g,
|
|
917
917
|
selected: d.includes(g.userId),
|
|
@@ -934,7 +934,7 @@ function ct({
|
|
|
934
934
|
onClick: de,
|
|
935
935
|
disabled: R.isPending,
|
|
936
936
|
children: R.isPending ? /* @__PURE__ */ r(_, { children: [
|
|
937
|
-
/* @__PURE__ */ e(
|
|
937
|
+
/* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
938
938
|
"Removing..."
|
|
939
939
|
] }) : /* @__PURE__ */ r(_, { children: [
|
|
940
940
|
/* @__PURE__ */ e(ds, { className: "mr-2 h-4 w-4" }),
|
|
@@ -957,12 +957,12 @@ function ct({
|
|
|
957
957
|
}
|
|
958
958
|
)
|
|
959
959
|
] }),
|
|
960
|
-
/* @__PURE__ */ e(Ce, { className: "h-[300px]", children: E ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(De, { className: "h-16 w-full" }, g)) }) :
|
|
960
|
+
/* @__PURE__ */ e(Ce, { className: "h-[300px]", children: E ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(De, { className: "h-16 w-full" }, g)) }) : V.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
961
961
|
/* @__PURE__ */ e(Le, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
962
962
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
963
963
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : "All eligible users are already members" })
|
|
964
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children:
|
|
965
|
-
|
|
964
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: V.map((g) => /* @__PURE__ */ e(
|
|
965
|
+
pt,
|
|
966
966
|
{
|
|
967
967
|
user: g,
|
|
968
968
|
selected: f.includes(g.id),
|
|
@@ -983,7 +983,7 @@ function ct({
|
|
|
983
983
|
onClick: z,
|
|
984
984
|
disabled: T.isPending,
|
|
985
985
|
children: T.isPending ? /* @__PURE__ */ r(_, { children: [
|
|
986
|
-
/* @__PURE__ */ e(
|
|
986
|
+
/* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
987
987
|
"Adding..."
|
|
988
988
|
] }) : /* @__PURE__ */ r(_, { children: [
|
|
989
989
|
/* @__PURE__ */ e(Le, { className: "mr-2 h-4 w-4" }),
|
|
@@ -996,13 +996,13 @@ function ct({
|
|
|
996
996
|
] })
|
|
997
997
|
] }) }) });
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function ht({
|
|
1000
1000
|
member: s,
|
|
1001
1001
|
selected: n,
|
|
1002
1002
|
onToggle: a
|
|
1003
1003
|
}) {
|
|
1004
|
-
var
|
|
1005
|
-
const t = ((
|
|
1004
|
+
var i, o, u, m;
|
|
1005
|
+
const t = ((o = (i = s.user) == null ? void 0 : i.name) == null ? void 0 : o.split(" ").map((f) => f[0]).join("").toUpperCase()) || "?";
|
|
1006
1006
|
return /* @__PURE__ */ r(
|
|
1007
1007
|
"div",
|
|
1008
1008
|
{
|
|
@@ -1019,13 +1019,13 @@ function dt({
|
|
|
1019
1019
|
}
|
|
1020
1020
|
);
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function pt({
|
|
1023
1023
|
user: s,
|
|
1024
1024
|
selected: n,
|
|
1025
1025
|
onToggle: a
|
|
1026
1026
|
}) {
|
|
1027
|
-
var
|
|
1028
|
-
const t = ((
|
|
1027
|
+
var i;
|
|
1028
|
+
const t = ((i = s.name) == null ? void 0 : i.split(" ").map((o) => o[0]).join("").toUpperCase()) || "?";
|
|
1029
1029
|
return /* @__PURE__ */ r(
|
|
1030
1030
|
"div",
|
|
1031
1031
|
{
|
|
@@ -1042,44 +1042,44 @@ function ut({
|
|
|
1042
1042
|
}
|
|
1043
1043
|
);
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1045
|
+
function ft({
|
|
1046
1046
|
open: s,
|
|
1047
1047
|
onOpenChange: n
|
|
1048
1048
|
}) {
|
|
1049
|
-
const [a, t] = S("groups"), [
|
|
1049
|
+
const [a, t] = S("groups"), [i, o] = S(""), [u, m] = S(null), [f, b] = S(!1), [d, l] = S(null), { tokenProps: h } = U(), { currentUser: p } = ms(), v = Za(), y = (p == null ? void 0 : p.type) === "tenant", N = h == null ? void 0 : h.tenantId, { groups: E, isLoading: T, refetch: R } = na({
|
|
1050
1050
|
type: y ? "TENANT_GROUP" : "all",
|
|
1051
1051
|
tenantId: y ? N : void 0,
|
|
1052
1052
|
includeMembers: !1
|
|
1053
1053
|
}), k = E.filter(
|
|
1054
1054
|
(w) => {
|
|
1055
1055
|
var z;
|
|
1056
|
-
return w.name.toLowerCase().includes(
|
|
1056
|
+
return w.name.toLowerCase().includes(i.toLowerCase()) || ((z = w.description) == null ? void 0 : z.toLowerCase().includes(i.toLowerCase()));
|
|
1057
1057
|
}
|
|
1058
1058
|
), P = async () => {
|
|
1059
1059
|
if (d)
|
|
1060
1060
|
try {
|
|
1061
|
-
await v.mutateAsync(d.id),
|
|
1061
|
+
await v.mutateAsync(d.id), l(null), R();
|
|
1062
1062
|
} catch (w) {
|
|
1063
1063
|
console.error("Failed to delete group:", w);
|
|
1064
1064
|
}
|
|
1065
1065
|
}, G = (w) => {
|
|
1066
1066
|
m(w), b(!0);
|
|
1067
|
-
},
|
|
1067
|
+
}, V = () => {
|
|
1068
1068
|
t("groups"), R();
|
|
1069
1069
|
};
|
|
1070
1070
|
return /* @__PURE__ */ r(_, { children: [
|
|
1071
1071
|
/* @__PURE__ */ e(Oe, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(_e, { className: "max-w-4xl max-h-[80vh]", children: [
|
|
1072
1072
|
/* @__PURE__ */ r(Te, { children: [
|
|
1073
1073
|
/* @__PURE__ */ r(Ge, { className: "flex items-center gap-2", children: [
|
|
1074
|
-
/* @__PURE__ */ e(
|
|
1074
|
+
/* @__PURE__ */ e(q, { className: "h-5 w-5" }),
|
|
1075
1075
|
"Group Management"
|
|
1076
1076
|
] }),
|
|
1077
1077
|
/* @__PURE__ */ e(rs, { children: "Manage your groups, create new groups, and control group membership" })
|
|
1078
1078
|
] }),
|
|
1079
|
-
/* @__PURE__ */ r(
|
|
1080
|
-
/* @__PURE__ */ r(
|
|
1079
|
+
/* @__PURE__ */ r(cs, { value: a, onValueChange: t, className: "mt-4", children: [
|
|
1080
|
+
/* @__PURE__ */ r(ls, { className: "grid w-full grid-cols-2", children: [
|
|
1081
1081
|
/* @__PURE__ */ r(ne, { value: "groups", className: "flex items-center gap-2", children: [
|
|
1082
|
-
/* @__PURE__ */ e(
|
|
1082
|
+
/* @__PURE__ */ e(q, { className: "h-4 w-4" }),
|
|
1083
1083
|
"Groups"
|
|
1084
1084
|
] }),
|
|
1085
1085
|
/* @__PURE__ */ r(ne, { value: "create", className: "flex items-center gap-2", children: [
|
|
@@ -1094,31 +1094,31 @@ function mt({
|
|
|
1094
1094
|
W,
|
|
1095
1095
|
{
|
|
1096
1096
|
placeholder: "Search groups...",
|
|
1097
|
-
value:
|
|
1098
|
-
onChange: (w) =>
|
|
1097
|
+
value: i,
|
|
1098
|
+
onChange: (w) => o(w.target.value),
|
|
1099
1099
|
className: "pl-10"
|
|
1100
1100
|
}
|
|
1101
1101
|
)
|
|
1102
1102
|
] }),
|
|
1103
1103
|
/* @__PURE__ */ e(Ce, { className: "h-[400px]", children: T ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((w) => /* @__PURE__ */ e(De, { className: "h-24 w-full" }, w)) }) : k.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
1104
|
-
/* @__PURE__ */ e(
|
|
1104
|
+
/* @__PURE__ */ e(q, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
1105
1105
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
|
|
1106
|
-
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children:
|
|
1106
|
+
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: i ? "Try a different search" : "Create your first group to get started" })
|
|
1107
1107
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: k.map((w) => /* @__PURE__ */ e(
|
|
1108
|
-
|
|
1108
|
+
gt,
|
|
1109
1109
|
{
|
|
1110
1110
|
group: w,
|
|
1111
1111
|
onManageMembers: () => G(w),
|
|
1112
|
-
onDelete: () =>
|
|
1112
|
+
onDelete: () => l(w),
|
|
1113
1113
|
currentUserId: p == null ? void 0 : p.id
|
|
1114
1114
|
},
|
|
1115
1115
|
w.id
|
|
1116
1116
|
)) }) })
|
|
1117
1117
|
] }) }),
|
|
1118
1118
|
/* @__PURE__ */ e(oe, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1119
|
-
|
|
1119
|
+
at,
|
|
1120
1120
|
{
|
|
1121
|
-
onSuccess:
|
|
1121
|
+
onSuccess: V,
|
|
1122
1122
|
tenantId: N,
|
|
1123
1123
|
isTenantUser: y
|
|
1124
1124
|
}
|
|
@@ -1126,7 +1126,7 @@ function mt({
|
|
|
1126
1126
|
] })
|
|
1127
1127
|
] }) }),
|
|
1128
1128
|
u && /* @__PURE__ */ e(
|
|
1129
|
-
|
|
1129
|
+
mt,
|
|
1130
1130
|
{
|
|
1131
1131
|
open: f,
|
|
1132
1132
|
onOpenChange: b,
|
|
@@ -1138,7 +1138,7 @@ function mt({
|
|
|
1138
1138
|
hs,
|
|
1139
1139
|
{
|
|
1140
1140
|
open: !!d,
|
|
1141
|
-
onOpenChange: () =>
|
|
1141
|
+
onOpenChange: () => l(null),
|
|
1142
1142
|
children: /* @__PURE__ */ r(ps, { children: [
|
|
1143
1143
|
/* @__PURE__ */ r(fs, { children: [
|
|
1144
1144
|
/* @__PURE__ */ e(gs, { children: "Delete Group" }),
|
|
@@ -1157,7 +1157,7 @@ function mt({
|
|
|
1157
1157
|
disabled: v.isPending,
|
|
1158
1158
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1159
1159
|
children: v.isPending ? /* @__PURE__ */ r(_, { children: [
|
|
1160
|
-
/* @__PURE__ */ e(
|
|
1160
|
+
/* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1161
1161
|
"Deleting..."
|
|
1162
1162
|
] }) : "Delete Group"
|
|
1163
1163
|
}
|
|
@@ -1168,13 +1168,13 @@ function mt({
|
|
|
1168
1168
|
)
|
|
1169
1169
|
] });
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function gt({
|
|
1172
1172
|
group: s,
|
|
1173
1173
|
onManageMembers: n,
|
|
1174
1174
|
onDelete: a,
|
|
1175
1175
|
currentUserId: t
|
|
1176
1176
|
}) {
|
|
1177
|
-
const
|
|
1177
|
+
const i = s.createdBy === t;
|
|
1178
1178
|
return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */ r("div", { className: "flex items-start justify-between gap-3", children: [
|
|
1179
1179
|
/* @__PURE__ */ r("div", { className: "flex-1 space-y-2", children: [
|
|
1180
1180
|
/* @__PURE__ */ r("div", { children: [
|
|
@@ -1183,14 +1183,14 @@ function ht({
|
|
|
1183
1183
|
] }),
|
|
1184
1184
|
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
|
|
1185
1185
|
/* @__PURE__ */ r("span", { className: "flex items-center gap-1", children: [
|
|
1186
|
-
/* @__PURE__ */ e(
|
|
1186
|
+
/* @__PURE__ */ e(q, { className: "h-3 w-3" }),
|
|
1187
1187
|
s.memberCount,
|
|
1188
1188
|
" ",
|
|
1189
1189
|
s.memberCount === 1 ? "member" : "members"
|
|
1190
1190
|
] }),
|
|
1191
1191
|
/* @__PURE__ */ r("span", { children: [
|
|
1192
1192
|
"Created ",
|
|
1193
|
-
|
|
1193
|
+
Ta(new Date(s.createdAt), "MMM d, yyyy")
|
|
1194
1194
|
] })
|
|
1195
1195
|
] })
|
|
1196
1196
|
] }),
|
|
@@ -1205,7 +1205,7 @@ function ht({
|
|
|
1205
1205
|
children: /* @__PURE__ */ e(Le, { className: "h-4 w-4" })
|
|
1206
1206
|
}
|
|
1207
1207
|
),
|
|
1208
|
-
|
|
1208
|
+
i && /* @__PURE__ */ e(
|
|
1209
1209
|
M,
|
|
1210
1210
|
{
|
|
1211
1211
|
variant: "ghost",
|
|
@@ -1219,54 +1219,55 @@ function ht({
|
|
|
1219
1219
|
] })
|
|
1220
1220
|
] }) });
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1223
|
-
var He,
|
|
1222
|
+
function Lt() {
|
|
1223
|
+
var He, Be, Ke;
|
|
1224
|
+
Da(), La();
|
|
1224
1225
|
const {
|
|
1225
1226
|
authToken: s,
|
|
1226
1227
|
tokenProps: n,
|
|
1227
1228
|
id: a
|
|
1228
|
-
} = U(), { isLocalDev: t } = oa(), { permissions:
|
|
1229
|
-
x((
|
|
1230
|
-
const m = x((
|
|
1231
|
-
x((
|
|
1232
|
-
const
|
|
1233
|
-
(
|
|
1234
|
-
), { setDashboardTitle: h } = x((
|
|
1235
|
-
(
|
|
1236
|
-
), ue = x((
|
|
1237
|
-
We((
|
|
1229
|
+
} = U(), { isLocalDev: t } = oa(), { permissions: i } = _a(), o = ia(), { isLoading: u } = ca();
|
|
1230
|
+
x((c) => c.theme);
|
|
1231
|
+
const m = x((c) => c.lenses), f = x((c) => c.selectedLensId), b = m == null ? void 0 : m.find((c) => c.id === f), d = x((c) => c.dashboard);
|
|
1232
|
+
x((c) => c.selectedSheetId);
|
|
1233
|
+
const l = x(
|
|
1234
|
+
(c) => c.isDashboardEditing
|
|
1235
|
+
), { setDashboardTitle: h } = x((c) => c.actions), [p, v] = S(!1), [y, N] = S(!1), [E, T] = S(!1), [R, k] = S(!1), [P, G] = S(null), [V, w] = S(!1), z = x((c) => c.isDashboardPanelOpen), de = x(
|
|
1236
|
+
(c) => c.actions.setIsDashboardPanelOpen
|
|
1237
|
+
), ue = x((c) => c.filterValues), C = x((c) => c.isVisualEditing);
|
|
1238
|
+
We((c) => c.card);
|
|
1238
1239
|
const g = te(
|
|
1239
|
-
(
|
|
1240
|
+
(c) => c.selectedDashboard
|
|
1240
1241
|
), D = te(
|
|
1241
|
-
(
|
|
1242
|
+
(c) => c.initialDashboard
|
|
1242
1243
|
);
|
|
1243
|
-
te((
|
|
1244
|
-
const O = g ? (
|
|
1245
|
-
(
|
|
1246
|
-
), me = x((
|
|
1247
|
-
(
|
|
1248
|
-
), { setIsDashboardEditing:
|
|
1249
|
-
(
|
|
1250
|
-
), { setInitialDashboard:
|
|
1251
|
-
(
|
|
1252
|
-
), { resources: Z } = da(be.DASHBOARD), { currentUser: Is } = ms(), _s = ua(Is), H = g || D,
|
|
1244
|
+
te((c) => c.selectedVisual), x((c) => c.selectedFrameId), We((c) => c.frame);
|
|
1245
|
+
const O = g ? (Be = g == null ? void 0 : g.permissions) == null ? void 0 : Be.canEdit : (He = D == null ? void 0 : D.permissions) == null ? void 0 : He.canEdit, F = x((c) => c.showFilters), Y = la((c) => c.setPanelOpen), X = x(
|
|
1246
|
+
(c) => c.showDashboardJSON
|
|
1247
|
+
), me = x((c) => c.onSaveFunction), ks = x(
|
|
1248
|
+
(c) => c.actions.setShowFilters
|
|
1249
|
+
), { setIsDashboardEditing: je, setShowDashboardJSON: $e } = x(
|
|
1250
|
+
(c) => c.actions
|
|
1251
|
+
), { setInitialDashboard: qe, clearSelectedDashboard: Os } = te(
|
|
1252
|
+
(c) => c.actions
|
|
1253
|
+
), { resources: Z } = da(be.DASHBOARD), { currentUser: Is } = ms(), _s = ua(Is), H = g || D, Ve = H ? {
|
|
1253
1254
|
id: H.id,
|
|
1254
1255
|
title: (d == null ? void 0 : d.title) || H.title || "Dashboard"
|
|
1255
|
-
} : null, { handleAddNewFrame: Ts } = ma(), [
|
|
1256
|
+
} : null, { handleAddNewFrame: Ts } = ma(), [B, he] = S(!1), [Gs, ee] = S(!1), se = ha(be.DASHBOARD), [K, pe] = S(
|
|
1256
1257
|
null
|
|
1257
|
-
), Rs = async (
|
|
1258
|
+
), Rs = async (c, I) => {
|
|
1258
1259
|
if (!(d != null && d.id)) {
|
|
1259
1260
|
console.log("No dashboard ID found");
|
|
1260
1261
|
return;
|
|
1261
1262
|
}
|
|
1262
1263
|
console.log("Updating dashboard title:", {
|
|
1263
1264
|
dashboardId: d.id,
|
|
1264
|
-
newTitle:
|
|
1265
|
+
newTitle: c,
|
|
1265
1266
|
previousTitle: I
|
|
1266
1267
|
}), se.mutate(
|
|
1267
1268
|
{
|
|
1268
1269
|
resourceId: d.id,
|
|
1269
|
-
data: { title:
|
|
1270
|
+
data: { title: c }
|
|
1270
1271
|
},
|
|
1271
1272
|
{
|
|
1272
1273
|
onSuccess: () => {
|
|
@@ -1280,45 +1281,45 @@ function wt() {
|
|
|
1280
1281
|
};
|
|
1281
1282
|
Ca(() => {
|
|
1282
1283
|
if (Z && Z.length > 0) {
|
|
1283
|
-
const
|
|
1284
|
-
if (
|
|
1284
|
+
const c = d == null ? void 0 : d.id;
|
|
1285
|
+
if (c) {
|
|
1285
1286
|
const I = Z.find(
|
|
1286
|
-
(Q) => Q.id ===
|
|
1287
|
+
(Q) => Q.id === c
|
|
1287
1288
|
);
|
|
1288
|
-
I &&
|
|
1289
|
+
I && qe(I);
|
|
1289
1290
|
}
|
|
1290
1291
|
}
|
|
1291
|
-
}, [Z, d == null ? void 0 : d.id,
|
|
1292
|
-
const ae = n.orgUserId || n.tenantId, Ps =
|
|
1293
|
-
|
|
1292
|
+
}, [Z, d == null ? void 0 : d.id, qe]);
|
|
1293
|
+
const ae = n.orgUserId || n.tenantId, Ps = l && !C && ae && O, { setDashboard: Us } = x((c) => c.actions), Fs = () => {
|
|
1294
|
+
je(!0);
|
|
1294
1295
|
}, fe = () => {
|
|
1295
|
-
|
|
1296
|
+
je(!1), $e(!1), pe(null);
|
|
1296
1297
|
};
|
|
1297
|
-
|
|
1298
|
-
|
|
1298
|
+
Ea(
|
|
1299
|
+
l,
|
|
1299
1300
|
d,
|
|
1300
|
-
|
|
1301
|
-
(
|
|
1301
|
+
K,
|
|
1302
|
+
(c) => pe(c)
|
|
1302
1303
|
);
|
|
1303
|
-
const
|
|
1304
|
-
|
|
1305
|
-
},
|
|
1304
|
+
const js = () => K ? JSON.stringify(d) !== JSON.stringify(K) : !1, $s = () => {
|
|
1305
|
+
js() ? ee(!0) : fe();
|
|
1306
|
+
}, qs = async () => {
|
|
1306
1307
|
await ge({ closeAfterSave: !0 });
|
|
1307
|
-
},
|
|
1308
|
-
|
|
1308
|
+
}, Vs = () => {
|
|
1309
|
+
K && Us(K), fe(), ee(!1);
|
|
1309
1310
|
};
|
|
1310
|
-
async function ge(
|
|
1311
|
-
const I = (
|
|
1311
|
+
async function ge(c) {
|
|
1312
|
+
const I = (c == null ? void 0 : c.closeAfterSave) ?? V;
|
|
1312
1313
|
w(I), I && ee(!1);
|
|
1313
1314
|
const Q = wa(d);
|
|
1314
1315
|
k(!0), G(null), he(!0);
|
|
1315
|
-
const
|
|
1316
|
+
const Bs = {
|
|
1316
1317
|
template: d
|
|
1317
1318
|
};
|
|
1318
1319
|
se.mutate(
|
|
1319
1320
|
{
|
|
1320
1321
|
resourceId: d.id,
|
|
1321
|
-
data:
|
|
1322
|
+
data: Bs
|
|
1322
1323
|
},
|
|
1323
1324
|
{
|
|
1324
1325
|
onSuccess: () => {
|
|
@@ -1332,9 +1333,9 @@ function wt() {
|
|
|
1332
1333
|
}
|
|
1333
1334
|
async function zs() {
|
|
1334
1335
|
if (v(!0), !f || !b) return;
|
|
1335
|
-
const
|
|
1336
|
+
const c = JSON.stringify(d), I = {
|
|
1336
1337
|
...b,
|
|
1337
|
-
template:
|
|
1338
|
+
template: c,
|
|
1338
1339
|
filterValues: ue
|
|
1339
1340
|
};
|
|
1340
1341
|
await Me(
|
|
@@ -1360,7 +1361,7 @@ function wt() {
|
|
|
1360
1361
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1361
1362
|
Hs && /* @__PURE__ */ r(_, { children: [
|
|
1362
1363
|
/* @__PURE__ */ e(
|
|
1363
|
-
|
|
1364
|
+
j,
|
|
1364
1365
|
{
|
|
1365
1366
|
"aria-label": "Manage Dashboards",
|
|
1366
1367
|
tooltip: "Manage Dashboards",
|
|
@@ -1368,11 +1369,11 @@ function wt() {
|
|
|
1368
1369
|
de(!z);
|
|
1369
1370
|
},
|
|
1370
1371
|
className: "h-7 p-2",
|
|
1371
|
-
children: /* @__PURE__ */ e(
|
|
1372
|
+
children: /* @__PURE__ */ e(Ra, { className: "h-4 w-4" })
|
|
1372
1373
|
}
|
|
1373
1374
|
),
|
|
1374
|
-
|
|
1375
|
-
|
|
1375
|
+
o && !C && /* @__PURE__ */ e(
|
|
1376
|
+
j,
|
|
1376
1377
|
{
|
|
1377
1378
|
"aria-label": "Dashboard Hub",
|
|
1378
1379
|
tooltip: "Dashboard Hub",
|
|
@@ -1382,21 +1383,21 @@ function wt() {
|
|
|
1382
1383
|
}
|
|
1383
1384
|
)
|
|
1384
1385
|
] }),
|
|
1385
|
-
!C &&
|
|
1386
|
-
/* @__PURE__ */ e(
|
|
1386
|
+
!C && o && (u ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1387
|
+
/* @__PURE__ */ e($, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
|
|
1387
1388
|
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
|
|
1388
1389
|
] }) : /* @__PURE__ */ e(
|
|
1389
1390
|
pa,
|
|
1390
1391
|
{
|
|
1391
1392
|
value: ze || "Untitled Dashboard",
|
|
1392
|
-
onSave: (
|
|
1393
|
+
onSave: (c) => {
|
|
1393
1394
|
console.log("EditableText onSave called:", {
|
|
1394
|
-
newTitle:
|
|
1395
|
+
newTitle: c,
|
|
1395
1396
|
canEditDashboard: O,
|
|
1396
1397
|
dashboardId: d == null ? void 0 : d.id
|
|
1397
1398
|
});
|
|
1398
1399
|
const I = (d == null ? void 0 : d.title) || "";
|
|
1399
|
-
h(
|
|
1400
|
+
h(c), Rs(c, I);
|
|
1400
1401
|
},
|
|
1401
1402
|
isEditable: O && !b,
|
|
1402
1403
|
displayClassName: "text-sm font-medium",
|
|
@@ -1408,45 +1409,46 @@ function wt() {
|
|
|
1408
1409
|
] }),
|
|
1409
1410
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1410
1411
|
C && /* @__PURE__ */ r(_, { children: [
|
|
1411
|
-
/* @__PURE__ */ e(
|
|
1412
|
-
/* @__PURE__ */ e(
|
|
1412
|
+
/* @__PURE__ */ e(Aa, { className: "mr-2" }),
|
|
1413
|
+
/* @__PURE__ */ e(Ma, { className: "h-7" })
|
|
1413
1414
|
] }),
|
|
1414
1415
|
t && !C && /* @__PURE__ */ r(_, { children: [
|
|
1415
1416
|
/* @__PURE__ */ e(
|
|
1416
|
-
|
|
1417
|
+
j,
|
|
1417
1418
|
{
|
|
1418
1419
|
tooltip: "Copy Token",
|
|
1419
1420
|
onClick: () => {
|
|
1420
|
-
var
|
|
1421
|
-
s != null && s.accessToken && ((
|
|
1421
|
+
var c;
|
|
1422
|
+
s != null && s.accessToken && ((c = navigator == null ? void 0 : navigator.clipboard) != null && c.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"));
|
|
1422
1423
|
},
|
|
1423
1424
|
className: "h-7 p-2",
|
|
1424
1425
|
children: /* @__PURE__ */ e(fa, { className: "h-4 w-4" })
|
|
1425
1426
|
}
|
|
1426
1427
|
),
|
|
1427
1428
|
/* @__PURE__ */ e(
|
|
1428
|
-
|
|
1429
|
+
j,
|
|
1429
1430
|
{
|
|
1430
1431
|
tooltip: "Invalidate Token",
|
|
1431
1432
|
onClick: () => ga(n.apiServiceUrl),
|
|
1432
1433
|
className: "h-7 p-2",
|
|
1433
|
-
children: /* @__PURE__ */ e(
|
|
1434
|
+
children: /* @__PURE__ */ e(Ua, { className: "h-4 w-4" })
|
|
1434
1435
|
}
|
|
1435
1436
|
)
|
|
1436
1437
|
] }),
|
|
1437
|
-
!C &&
|
|
1438
|
-
!C &&
|
|
1439
|
-
!C &&
|
|
1440
|
-
|
|
1438
|
+
!C && o && /* @__PURE__ */ e(va, {}),
|
|
1439
|
+
!C && o && /* @__PURE__ */ e(ka, {}),
|
|
1440
|
+
!C && o && /* @__PURE__ */ e(Oa, {}),
|
|
1441
|
+
!C && o && _s && /* @__PURE__ */ e(
|
|
1442
|
+
j,
|
|
1441
1443
|
{
|
|
1442
1444
|
tooltip: "Manage Groups",
|
|
1443
1445
|
onClick: () => T(!0),
|
|
1444
1446
|
className: "h-7 p-2",
|
|
1445
|
-
children: /* @__PURE__ */ e(
|
|
1447
|
+
children: /* @__PURE__ */ e(q, { className: "h-4 w-4" })
|
|
1446
1448
|
}
|
|
1447
1449
|
),
|
|
1448
|
-
!C &&
|
|
1449
|
-
|
|
1450
|
+
!C && o && ((Ke = H == null ? void 0 : H.permissions) == null ? void 0 : Ke.canShare) && /* @__PURE__ */ e(
|
|
1451
|
+
j,
|
|
1450
1452
|
{
|
|
1451
1453
|
tooltip: "Share Dashboard",
|
|
1452
1454
|
onClick: () => N(!0),
|
|
@@ -1454,21 +1456,21 @@ function wt() {
|
|
|
1454
1456
|
children: /* @__PURE__ */ e(ba, { className: "h-4 w-4" })
|
|
1455
1457
|
}
|
|
1456
1458
|
),
|
|
1457
|
-
!F && !C &&
|
|
1459
|
+
!F && !C && l && i.canUseFilters && o && /* @__PURE__ */ e(
|
|
1458
1460
|
M,
|
|
1459
1461
|
{
|
|
1460
1462
|
className: "h-7 p-2",
|
|
1461
1463
|
variant: "outline",
|
|
1462
1464
|
onClick: () => {
|
|
1463
|
-
|
|
1465
|
+
Y("dashboard", !1), ks(!0);
|
|
1464
1466
|
},
|
|
1465
1467
|
size: "sm",
|
|
1466
1468
|
children: /* @__PURE__ */ e(ya, { className: "h-4 w-4" })
|
|
1467
1469
|
}
|
|
1468
1470
|
),
|
|
1469
|
-
|
|
1470
|
-
!C && ae && t &&
|
|
1471
|
-
|
|
1471
|
+
l && !C && ae && t && o && /* @__PURE__ */ e(Ba, {}),
|
|
1472
|
+
!C && ae && t && o && /* @__PURE__ */ e(Ka, {}),
|
|
1473
|
+
l && !C && ae && b && t && o && /* @__PURE__ */ r(
|
|
1472
1474
|
M,
|
|
1473
1475
|
{
|
|
1474
1476
|
className: "h-7 p-2",
|
|
@@ -1482,13 +1484,13 @@ function wt() {
|
|
|
1482
1484
|
]
|
|
1483
1485
|
}
|
|
1484
1486
|
),
|
|
1485
|
-
|
|
1487
|
+
l && !C && o && /* @__PURE__ */ r(
|
|
1486
1488
|
M,
|
|
1487
1489
|
{
|
|
1488
1490
|
variant: "outline",
|
|
1489
1491
|
className: "h-7 p-2",
|
|
1490
1492
|
size: "sm",
|
|
1491
|
-
disabled: !
|
|
1493
|
+
disabled: !l,
|
|
1492
1494
|
onClick: () => Ts(),
|
|
1493
1495
|
children: [
|
|
1494
1496
|
/* @__PURE__ */ e(Ie, { className: "mr-2 h-4 w-4" }),
|
|
@@ -1496,7 +1498,7 @@ function wt() {
|
|
|
1496
1498
|
]
|
|
1497
1499
|
}
|
|
1498
1500
|
),
|
|
1499
|
-
!C && !
|
|
1501
|
+
!C && !l && O && o && /* @__PURE__ */ r(
|
|
1500
1502
|
M,
|
|
1501
1503
|
{
|
|
1502
1504
|
variant: "outline",
|
|
@@ -1509,52 +1511,52 @@ function wt() {
|
|
|
1509
1511
|
]
|
|
1510
1512
|
}
|
|
1511
1513
|
),
|
|
1512
|
-
Ps &&
|
|
1514
|
+
Ps && o && /* @__PURE__ */ r(
|
|
1513
1515
|
M,
|
|
1514
1516
|
{
|
|
1515
1517
|
className: "h-7 p-2",
|
|
1516
|
-
disabled:
|
|
1518
|
+
disabled: B,
|
|
1517
1519
|
onClick: () => ge(),
|
|
1518
1520
|
size: "sm",
|
|
1519
1521
|
children: [
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
+
B ? /* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Je, { className: "mr-2 h-4 w-4" }),
|
|
1523
|
+
B ? "Saving..." : "Save"
|
|
1522
1524
|
]
|
|
1523
1525
|
}
|
|
1524
1526
|
),
|
|
1525
|
-
!C &&
|
|
1527
|
+
!C && l && t && o && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
|
|
1526
1528
|
M,
|
|
1527
1529
|
{
|
|
1528
1530
|
className: "h-7 p-2",
|
|
1529
|
-
onClick: () =>
|
|
1531
|
+
onClick: () => $e(!X),
|
|
1530
1532
|
size: "sm",
|
|
1531
1533
|
variant: "ghost",
|
|
1532
1534
|
children: /* @__PURE__ */ e(Sa, { className: "h-4 w-4" })
|
|
1533
1535
|
}
|
|
1534
1536
|
) }),
|
|
1535
|
-
!C && t && /* @__PURE__ */ e(
|
|
1536
|
-
|
|
1537
|
+
!C && t && /* @__PURE__ */ e(Va, {}),
|
|
1538
|
+
l && !C && o && /* @__PURE__ */ r(
|
|
1537
1539
|
M,
|
|
1538
1540
|
{
|
|
1539
1541
|
variant: "outline",
|
|
1540
1542
|
className: "h-7 p-2",
|
|
1541
|
-
onClick:
|
|
1543
|
+
onClick: $s,
|
|
1542
1544
|
children: [
|
|
1543
1545
|
/* @__PURE__ */ e(os, { className: "mr-2 h-4 w-4" }),
|
|
1544
1546
|
"Close"
|
|
1545
1547
|
]
|
|
1546
1548
|
}
|
|
1547
1549
|
),
|
|
1548
|
-
y &&
|
|
1550
|
+
y && Ve && /* @__PURE__ */ e(
|
|
1549
1551
|
xa,
|
|
1550
1552
|
{
|
|
1551
|
-
resource:
|
|
1553
|
+
resource: Ve,
|
|
1552
1554
|
resourceType: be.DASHBOARD,
|
|
1553
1555
|
onClose: () => N(!1)
|
|
1554
1556
|
}
|
|
1555
1557
|
),
|
|
1556
1558
|
/* @__PURE__ */ e(
|
|
1557
|
-
|
|
1559
|
+
ft,
|
|
1558
1560
|
{
|
|
1559
1561
|
open: E,
|
|
1560
1562
|
onOpenChange: T
|
|
@@ -1564,8 +1566,8 @@ function wt() {
|
|
|
1564
1566
|
hs,
|
|
1565
1567
|
{
|
|
1566
1568
|
open: R,
|
|
1567
|
-
onOpenChange: (
|
|
1568
|
-
!
|
|
1569
|
+
onOpenChange: (c) => {
|
|
1570
|
+
!c && B && !P || (k(c), c || (G(null), w(!1)));
|
|
1569
1571
|
},
|
|
1570
1572
|
children: /* @__PURE__ */ r(ps, { className: "max-w-sm", children: [
|
|
1571
1573
|
/* @__PURE__ */ r(fs, { children: [
|
|
@@ -1597,7 +1599,7 @@ function wt() {
|
|
|
1597
1599
|
disabled: !0,
|
|
1598
1600
|
className: "m-0 cursor-default",
|
|
1599
1601
|
children: [
|
|
1600
|
-
/* @__PURE__ */ e(
|
|
1602
|
+
/* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1601
1603
|
"Saving..."
|
|
1602
1604
|
]
|
|
1603
1605
|
}
|
|
@@ -1606,13 +1608,13 @@ function wt() {
|
|
|
1606
1608
|
}
|
|
1607
1609
|
),
|
|
1608
1610
|
/* @__PURE__ */ e(
|
|
1609
|
-
|
|
1611
|
+
Ia,
|
|
1610
1612
|
{
|
|
1611
1613
|
open: Gs,
|
|
1612
1614
|
onOpenChange: ee,
|
|
1613
|
-
onSave:
|
|
1614
|
-
onDiscard:
|
|
1615
|
-
isSaving:
|
|
1615
|
+
onSave: qs,
|
|
1616
|
+
onDiscard: Vs,
|
|
1617
|
+
isSaving: B
|
|
1616
1618
|
}
|
|
1617
1619
|
)
|
|
1618
1620
|
] })
|
|
@@ -1621,5 +1623,5 @@ function wt() {
|
|
|
1621
1623
|
);
|
|
1622
1624
|
}
|
|
1623
1625
|
export {
|
|
1624
|
-
|
|
1626
|
+
Lt as default
|
|
1625
1627
|
};
|