react-semaphor 0.1.150 → 0.1.151
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-CrWp_eW0.js → dashboard-controls-C9vPPAA5.js} +295 -303
- package/dist/chunks/dashboard-controls-R0Ll84Gl.js +26 -0
- package/dist/chunks/{dashboard-export-dialog-CTDWnL2v.js → dashboard-export-dialog-CzMFzBse.js} +3 -3
- package/dist/chunks/{dashboard-export-dialog-Bdt-TnlL.js → dashboard-export-dialog-DYniVga5.js} +1 -1
- package/dist/chunks/{dashboard-json-CKQPyk-T.js → dashboard-json-3GJosjZ1.js} +1 -1
- package/dist/chunks/{dashboard-json-BvV_dByo.js → dashboard-json-D_Ew5v58.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-JmSJtVAb.js → edit-dashboard-visual-DVgTTLJA.js} +304 -304
- package/dist/chunks/{edit-dashboard-visual-DKx_Fd1g.js → edit-dashboard-visual-DxpnXWrq.js} +1 -1
- package/dist/chunks/{editor-action-buttons-D98KnvrV.js → editor-action-buttons-BGRGrvil.js} +1 -1
- package/dist/chunks/{editor-action-buttons-BrlrQ2Xg.js → editor-action-buttons-nOqTm8Zx.js} +2 -2
- package/dist/chunks/index-C39yXWHP.js +1354 -0
- package/dist/chunks/{index-DHIYxVk4.js → index-CClisLGZ.js} +65080 -64485
- package/dist/chunks/{resource-management-panel-QHQGFqsL.js → resource-management-panel-CpxLsJ42.js} +2 -2
- package/dist/chunks/{resource-management-panel-B5efhyg2.js → resource-management-panel-XGVGu9yZ.js} +1 -1
- package/dist/chunks/{use-visual-utils-CuQz3wl2.js → use-visual-utils-BgJnVTRi.js} +1 -1
- package/dist/chunks/{use-visual-utils-B8vSKgmQ.js → use-visual-utils-D4_F3SrQ.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 +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +16 -26
- package/package.json +8 -4
- package/dist/chunks/dashboard-controls-Hw3sWZQd.js +0 -26
- package/dist/chunks/index-zUMoYWue.js +0 -1339
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { b as X, bC as qs, bD as _s, u as y, aG as Ke, aH as Je, B as k, aJ as We, aK as fe, bE as Me, g as Xe, ao as U, at as ke, bF as $s, b8 as
|
|
3
|
-
import * as
|
|
4
|
-
import { useState as b, useMemo as ne, useEffect as
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { b as X, bC as qs, bD as _s, u as y, aG as Ke, aH as Je, B as k, aJ as We, aK as fe, bE as Me, g as Xe, ao as U, at as ke, bF as $s, b8 as Ae, au as Le, av as Ie, aw as Ee, ax as Ye, ay as be, b1 as W, aC as js, I as q, bG as Vs, bc as Qs, bH as Hs, bI as Ve, bJ as Ze, c as Y, bK as es, b4 as Bs, h as le, bL as ce, l as A, bM as ss, aA as Ks, bN as Js, L as _, bb as $, bO as Ws, bP as Xs, bQ as Ne, bR as Ys, bS as Zs, bT as as, bU as ts, bV as oe, bW as ie, bz as ye, bj as we, bX as xe, bd as rs, bY as Ce, aB as ns, bh as os, bZ as ea, aO as is, aP as ls, aQ as cs, aS as ds, aT as us, aU as ms, aV as hs, aW as De, b_ as sa, b6 as aa, bu as ta, b$ as ra, G as na, f as Qe, A as re, c0 as oa, R as ve, c1 as ia, c2 as la, c3 as ca, c4 as da, b9 as ua, W as ma, c5 as ha, c6 as pa, c7 as ga, c8 as fa, M as va, V as ba } from "./index-CClisLGZ.js";
|
|
3
|
+
import * as M from "react";
|
|
4
|
+
import { useState as b, useMemo as ne, useEffect as Na } from "react";
|
|
5
5
|
import "react-dom";
|
|
6
|
-
import { D as
|
|
7
|
-
import { S as He } from "./editor-action-buttons-
|
|
6
|
+
import { D as ya, u as wa, A as xa, V as Ca, S as Da, U as Sa } from "./dashboard-export-dialog-CzMFzBse.js";
|
|
7
|
+
import { S as He } from "./editor-action-buttons-nOqTm8Zx.js";
|
|
8
8
|
/**
|
|
9
9
|
* @license lucide-react v0.453.0 - ISC
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the ISC license.
|
|
12
12
|
* See the LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
|
-
const
|
|
14
|
+
const Ma = X("Glasses", [
|
|
15
15
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
16
16
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
17
17
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -24,7 +24,7 @@ const Sa = X("Glasses", [
|
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
26
|
*/
|
|
27
|
-
const
|
|
27
|
+
const ka = X("Menu", [
|
|
28
28
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
29
29
|
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
30
30
|
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
@@ -35,7 +35,7 @@ const Ma = X("Menu", [
|
|
|
35
35
|
* This source code is licensed under the ISC license.
|
|
36
36
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
37
|
*/
|
|
38
|
-
const
|
|
38
|
+
const Aa = X("Moon", [
|
|
39
39
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
40
40
|
]);
|
|
41
41
|
/**
|
|
@@ -61,7 +61,7 @@ const La = X("ShieldX", [
|
|
|
61
61
|
* This source code is licensed under the ISC license.
|
|
62
62
|
* See the LICENSE file in the root directory of this source tree.
|
|
63
63
|
*/
|
|
64
|
-
const
|
|
64
|
+
const Ia = X("Sun", [
|
|
65
65
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
66
66
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
67
67
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -72,22 +72,22 @@ const Aa = X("Sun", [
|
|
|
72
72
|
["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
|
|
73
73
|
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
|
|
74
74
|
]);
|
|
75
|
-
var
|
|
76
|
-
function
|
|
77
|
-
const { setTheme: s } = _s(),
|
|
75
|
+
var Ea = qs();
|
|
76
|
+
function Ta() {
|
|
77
|
+
const { setTheme: s } = _s(), n = y(
|
|
78
78
|
(a) => a.actions.setDashboardTheme
|
|
79
79
|
);
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */ e(Je, { asChild: !0, children: /* @__PURE__ */
|
|
80
|
+
return /* @__PURE__ */ r(Ke, { children: [
|
|
81
|
+
/* @__PURE__ */ e(Je, { asChild: !0, children: /* @__PURE__ */ r(k, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
|
|
82
82
|
/* @__PURE__ */ e(
|
|
83
|
-
|
|
83
|
+
Ia,
|
|
84
84
|
{
|
|
85
85
|
strokeWidth: 1.5,
|
|
86
86
|
className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
89
|
/* @__PURE__ */ e(
|
|
90
|
-
|
|
90
|
+
Aa,
|
|
91
91
|
{
|
|
92
92
|
strokeWidth: 1.5,
|
|
93
93
|
className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
|
|
@@ -95,12 +95,12 @@ function Ea() {
|
|
|
95
95
|
),
|
|
96
96
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
|
|
97
97
|
] }) }),
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ r(We, { align: "end", children: [
|
|
99
99
|
/* @__PURE__ */ e(
|
|
100
100
|
fe,
|
|
101
101
|
{
|
|
102
102
|
onClick: () => {
|
|
103
|
-
s("light"),
|
|
103
|
+
s("light"), n("light");
|
|
104
104
|
},
|
|
105
105
|
children: "Light"
|
|
106
106
|
}
|
|
@@ -109,7 +109,7 @@ function Ea() {
|
|
|
109
109
|
fe,
|
|
110
110
|
{
|
|
111
111
|
onClick: () => {
|
|
112
|
-
s("dark"),
|
|
112
|
+
s("dark"), n("dark");
|
|
113
113
|
},
|
|
114
114
|
children: "Dark"
|
|
115
115
|
}
|
|
@@ -118,7 +118,7 @@ function Ea() {
|
|
|
118
118
|
fe,
|
|
119
119
|
{
|
|
120
120
|
onClick: () => {
|
|
121
|
-
s("system"),
|
|
121
|
+
s("system"), n("system");
|
|
122
122
|
},
|
|
123
123
|
children: "System"
|
|
124
124
|
}
|
|
@@ -126,21 +126,21 @@ function Ea() {
|
|
|
126
126
|
] })
|
|
127
127
|
] });
|
|
128
128
|
}
|
|
129
|
-
async function
|
|
129
|
+
async function Pa(s, n, a, t, l) {
|
|
130
130
|
if (!l)
|
|
131
131
|
return null;
|
|
132
132
|
const o = JSON.stringify(a), c = `${s}/v1/lens`;
|
|
133
133
|
return await Me(c, l, {
|
|
134
|
-
name:
|
|
134
|
+
name: n,
|
|
135
135
|
template: o,
|
|
136
136
|
filterValues: t,
|
|
137
137
|
operation: "create"
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
-
async function
|
|
140
|
+
async function Se(s, n, a) {
|
|
141
141
|
if (!a)
|
|
142
142
|
return null;
|
|
143
|
-
const { id: t, template: l, filterValues: o, isDefault: c, shared: u } =
|
|
143
|
+
const { id: t, template: l, filterValues: o, isDefault: c, shared: u } = n, p = `${s}/v1/lens`;
|
|
144
144
|
return await Me(p, a, {
|
|
145
145
|
lensId: t,
|
|
146
146
|
template: l,
|
|
@@ -150,20 +150,20 @@ async function De(s, r, a) {
|
|
|
150
150
|
operation: "update"
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function Ga(s, n, a) {
|
|
154
154
|
if (!a)
|
|
155
155
|
return null;
|
|
156
156
|
const t = `${s}/v1/lens`;
|
|
157
157
|
return await Me(t, a, {
|
|
158
158
|
operation: "delete",
|
|
159
|
-
lensId:
|
|
159
|
+
lensId: n
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
const [s,
|
|
162
|
+
function Fa() {
|
|
163
|
+
const [s, n] = b(""), [a, t] = b(!1), l = y((C) => C.lenses), { setLenses: o, setSelectedLensId: c } = Xe(), [u, p] = b(!1), [f, d] = b(!1), m = y((C) => C.dashboard), g = y((C) => C.filterValues), { authToken: v, tokenProps: N } = U();
|
|
164
164
|
async function w() {
|
|
165
165
|
p(!0);
|
|
166
|
-
const C = await
|
|
166
|
+
const C = await Pa(
|
|
167
167
|
N.apiServiceUrl,
|
|
168
168
|
s,
|
|
169
169
|
m,
|
|
@@ -172,32 +172,32 @@ function Ga() {
|
|
|
172
172
|
);
|
|
173
173
|
C && (o([...l || [], C]), c(C.id), d(!1)), p(!1);
|
|
174
174
|
}
|
|
175
|
-
return /* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */ e($s, { asChild: !0, children: /* @__PURE__ */
|
|
175
|
+
return /* @__PURE__ */ r(ke, { open: f, onOpenChange: d, children: [
|
|
176
|
+
/* @__PURE__ */ e($s, { asChild: !0, children: /* @__PURE__ */ r(
|
|
177
177
|
k,
|
|
178
178
|
{
|
|
179
179
|
variant: "secondary",
|
|
180
180
|
className: "h-7 p-2",
|
|
181
181
|
size: "sm",
|
|
182
182
|
children: [
|
|
183
|
-
/* @__PURE__ */ e(
|
|
183
|
+
/* @__PURE__ */ e(Ae, { className: "mr-2 h-4 w-4" }),
|
|
184
184
|
"Lens"
|
|
185
185
|
]
|
|
186
186
|
}
|
|
187
187
|
) }),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ r(Le, { className: "sm:max-w-[425px]", children: [
|
|
189
|
+
/* @__PURE__ */ r(Ie, { children: [
|
|
190
190
|
/* @__PURE__ */ e(Ee, { children: "Create Lens" }),
|
|
191
191
|
/* @__PURE__ */ e(Ye, { children: "Lenses are private by default and are only visible to you." })
|
|
192
192
|
] }),
|
|
193
|
-
/* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ r("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
194
194
|
/* @__PURE__ */ e(be, { className: "text-right", children: "Name" }),
|
|
195
195
|
/* @__PURE__ */ e(
|
|
196
196
|
W,
|
|
197
197
|
{
|
|
198
198
|
value: s,
|
|
199
199
|
onChange: (C) => {
|
|
200
|
-
|
|
200
|
+
n(C.target.value);
|
|
201
201
|
},
|
|
202
202
|
id: "name",
|
|
203
203
|
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
@@ -219,13 +219,13 @@ function Ga() {
|
|
|
219
219
|
] })
|
|
220
220
|
] });
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
const [s,
|
|
222
|
+
function Oa() {
|
|
223
|
+
const [s, n] = b(!1), a = y((m) => m.lenses), t = y((m) => m.selectedLensId), { setLenses: l, setSelectedLensId: o } = Xe(), { authToken: c, tokenProps: u } = U();
|
|
224
224
|
async function p(m) {
|
|
225
225
|
o(m);
|
|
226
226
|
}
|
|
227
227
|
async function f(m) {
|
|
228
|
-
if (await
|
|
228
|
+
if (await Ga(u.apiServiceUrl, m, c == null ? void 0 : c.accessToken)) {
|
|
229
229
|
const v = a == null ? void 0 : a.filter((N) => N.id !== m);
|
|
230
230
|
l(v || []), o("original");
|
|
231
231
|
}
|
|
@@ -243,36 +243,36 @@ function Fa() {
|
|
|
243
243
|
...m,
|
|
244
244
|
isDefault: !m.isDefault
|
|
245
245
|
};
|
|
246
|
-
await
|
|
246
|
+
await Se(u.apiServiceUrl, v, c == null ? void 0 : c.accessToken);
|
|
247
247
|
const N = a == null ? void 0 : a.find((w) => w.isDefault);
|
|
248
248
|
if (N && N.id !== m.id) {
|
|
249
249
|
const w = {
|
|
250
250
|
...N,
|
|
251
251
|
isDefault: !1
|
|
252
252
|
};
|
|
253
|
-
await
|
|
253
|
+
await Se(u.apiServiceUrl, w, c == null ? void 0 : c.accessToken);
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
return /* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */ e(Je, { asChild: !0, children: /* @__PURE__ */ e(q, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(
|
|
258
|
-
/* @__PURE__ */
|
|
256
|
+
return /* @__PURE__ */ r(Ke, { open: s, onOpenChange: n, children: [
|
|
257
|
+
/* @__PURE__ */ e(Je, { asChild: !0, children: /* @__PURE__ */ e(q, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Ma, { className: "h-4 w-4" }) }) }),
|
|
258
|
+
/* @__PURE__ */ r(We, { align: "end", className: "w-60", children: [
|
|
259
259
|
/* @__PURE__ */ e(Vs, { className: "px-3", children: "Lenses" }),
|
|
260
260
|
/* @__PURE__ */ e(Qs, {}),
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ r(
|
|
262
262
|
Hs,
|
|
263
263
|
{
|
|
264
264
|
value: t,
|
|
265
265
|
onValueChange: p,
|
|
266
266
|
children: [
|
|
267
267
|
/* @__PURE__ */ e(Ve, { value: "original", children: "Original" }),
|
|
268
|
-
a == null ? void 0 : a.map((m) => /* @__PURE__ */
|
|
268
|
+
a == null ? void 0 : a.map((m) => /* @__PURE__ */ r(
|
|
269
269
|
Ve,
|
|
270
270
|
{
|
|
271
271
|
className: "group flex justify-between gap-2",
|
|
272
272
|
value: m.id,
|
|
273
273
|
children: [
|
|
274
274
|
/* @__PURE__ */ e("p", { children: m.name }),
|
|
275
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ r("span", { className: "flex items-center gap-3", children: [
|
|
276
276
|
/* @__PURE__ */ e(
|
|
277
277
|
Ze,
|
|
278
278
|
{
|
|
@@ -310,11 +310,11 @@ function Fa() {
|
|
|
310
310
|
] })
|
|
311
311
|
] });
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function Ra({
|
|
314
314
|
iconClassName: s
|
|
315
315
|
}) {
|
|
316
|
-
const [
|
|
317
|
-
return /* @__PURE__ */
|
|
316
|
+
const [n, a] = b(!1), t = y((l) => l.isDownloadingPdf);
|
|
317
|
+
return /* @__PURE__ */ r(I, { children: [
|
|
318
318
|
/* @__PURE__ */ e(
|
|
319
319
|
k,
|
|
320
320
|
{
|
|
@@ -327,37 +327,37 @@ function Oa({
|
|
|
327
327
|
}
|
|
328
328
|
),
|
|
329
329
|
/* @__PURE__ */ e(
|
|
330
|
-
|
|
330
|
+
ya,
|
|
331
331
|
{
|
|
332
|
-
open:
|
|
332
|
+
open: n,
|
|
333
333
|
onOpenChange: a
|
|
334
334
|
}
|
|
335
335
|
)
|
|
336
336
|
] });
|
|
337
337
|
}
|
|
338
|
-
const
|
|
338
|
+
const Ua = async (s, n, a) => {
|
|
339
339
|
const t = `${s}/management/v1/groups`;
|
|
340
|
-
return await ss(t,
|
|
341
|
-
},
|
|
340
|
+
return await ss(t, n, a);
|
|
341
|
+
}, za = async (s, n, a) => {
|
|
342
342
|
const t = `${s}/management/v1/groups/${a}`, l = await fetch(t, {
|
|
343
343
|
method: "DELETE",
|
|
344
344
|
headers: {
|
|
345
|
-
Authorization: `Bearer ${
|
|
345
|
+
Authorization: `Bearer ${n}`
|
|
346
346
|
}
|
|
347
347
|
});
|
|
348
348
|
if (!l.ok) {
|
|
349
349
|
const o = await l.text();
|
|
350
350
|
throw new Error(o || "Failed to delete group");
|
|
351
351
|
}
|
|
352
|
-
},
|
|
352
|
+
}, qa = async (s, n, a, t) => {
|
|
353
353
|
const l = `${s}/management/v1/groups/${a}/members`;
|
|
354
|
-
return await ss(l,
|
|
355
|
-
},
|
|
354
|
+
return await ss(l, n, t);
|
|
355
|
+
}, _a = async (s, n, a, t) => {
|
|
356
356
|
const l = `${s}/management/v1/groups/${a}/members`, o = await fetch(l, {
|
|
357
357
|
method: "DELETE",
|
|
358
358
|
headers: {
|
|
359
359
|
"Content-Type": "application/json",
|
|
360
|
-
Authorization: `Bearer ${
|
|
360
|
+
Authorization: `Bearer ${n}`
|
|
361
361
|
},
|
|
362
362
|
body: JSON.stringify(t)
|
|
363
363
|
});
|
|
@@ -366,88 +366,88 @@ const Ra = async (s, r, a) => {
|
|
|
366
366
|
throw new Error(c || "Failed to remove group members");
|
|
367
367
|
}
|
|
368
368
|
};
|
|
369
|
-
function
|
|
370
|
-
const { authToken: s, tokenProps:
|
|
369
|
+
function $a() {
|
|
370
|
+
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
371
371
|
return ce({
|
|
372
|
-
mutationFn: (t) =>
|
|
372
|
+
mutationFn: (t) => Ua(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
373
373
|
onSuccess: () => {
|
|
374
|
-
a.invalidateQueries({ queryKey: ["groups"] }),
|
|
374
|
+
a.invalidateQueries({ queryKey: ["groups"] }), A.success("Group created successfully");
|
|
375
375
|
},
|
|
376
376
|
onError: (t) => {
|
|
377
|
-
console.error("Failed to create group:", t),
|
|
377
|
+
console.error("Failed to create group:", t), A.error("Failed to create group", {
|
|
378
378
|
description: t.message
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
});
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
const { authToken: s, tokenProps:
|
|
383
|
+
function ja() {
|
|
384
|
+
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
385
385
|
return ce({
|
|
386
|
-
mutationFn: (t) =>
|
|
386
|
+
mutationFn: (t) => za(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
387
387
|
onSuccess: (t, l) => {
|
|
388
|
-
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", l] }),
|
|
388
|
+
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", l] }), A.success("Group deleted successfully");
|
|
389
389
|
},
|
|
390
390
|
onError: (t) => {
|
|
391
|
-
console.error("Failed to delete group:", t),
|
|
391
|
+
console.error("Failed to delete group:", t), A.error("Failed to delete group", {
|
|
392
392
|
description: t.message
|
|
393
393
|
});
|
|
394
394
|
}
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
-
function
|
|
398
|
-
const { authToken: s, tokenProps:
|
|
397
|
+
function Va() {
|
|
398
|
+
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
399
399
|
return ce({
|
|
400
400
|
mutationFn: ({
|
|
401
401
|
groupId: t,
|
|
402
402
|
data: l
|
|
403
|
-
}) =>
|
|
403
|
+
}) => qa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
|
|
404
404
|
onSuccess: (t, l) => {
|
|
405
405
|
a.invalidateQueries({ queryKey: ["group", l.groupId] }), a.invalidateQueries({
|
|
406
406
|
queryKey: ["group-members", l.groupId]
|
|
407
|
-
}), a.invalidateQueries({ queryKey: ["groups"] }),
|
|
407
|
+
}), a.invalidateQueries({ queryKey: ["groups"] }), A.success("Members added successfully");
|
|
408
408
|
},
|
|
409
409
|
onError: (t) => {
|
|
410
|
-
console.error("Failed to add group members:", t),
|
|
410
|
+
console.error("Failed to add group members:", t), A.error("Failed to add members", {
|
|
411
411
|
description: t.message
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
|
-
function
|
|
417
|
-
const { authToken: s, tokenProps:
|
|
416
|
+
function Qa() {
|
|
417
|
+
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
418
418
|
return ce({
|
|
419
419
|
mutationFn: ({
|
|
420
420
|
groupId: t,
|
|
421
421
|
data: l
|
|
422
|
-
}) =>
|
|
422
|
+
}) => _a(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
|
|
423
423
|
onSuccess: (t, l) => {
|
|
424
424
|
a.invalidateQueries({ queryKey: ["group", l.groupId] }), a.invalidateQueries({
|
|
425
425
|
queryKey: ["group-members", l.groupId]
|
|
426
|
-
}), a.invalidateQueries({ queryKey: ["groups"] }),
|
|
426
|
+
}), a.invalidateQueries({ queryKey: ["groups"] }), A.success("Members removed successfully");
|
|
427
427
|
},
|
|
428
428
|
onError: (t) => {
|
|
429
|
-
console.error("Failed to remove group members:", t),
|
|
429
|
+
console.error("Failed to remove group members:", t), A.error("Failed to remove members", {
|
|
430
430
|
description: t.message
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function Ha({
|
|
436
436
|
onSuccess: s,
|
|
437
|
-
tenantId:
|
|
437
|
+
tenantId: n,
|
|
438
438
|
isTenantUser: a
|
|
439
439
|
}) {
|
|
440
|
-
const [t, l] = b(""), [o, c] = b(""), [u, p] = b({}), f =
|
|
440
|
+
const [t, l] = b(""), [o, c] = b(""), [u, p] = b({}), f = $a(), d = () => {
|
|
441
441
|
const g = {};
|
|
442
442
|
return t.trim() ? t.length < 3 ? g.name = "Group name must be at least 3 characters" : t.length > 50 && (g.name = "Group name must be less than 50 characters") : g.name = "Group name is required", o && o.length > 200 && (g.description = "Description must be less than 200 characters"), p(g), Object.keys(g).length === 0;
|
|
443
443
|
};
|
|
444
|
-
return /* @__PURE__ */
|
|
444
|
+
return /* @__PURE__ */ r("form", { onSubmit: async (g) => {
|
|
445
445
|
if (g.preventDefault(), !d()) return;
|
|
446
446
|
const v = {
|
|
447
447
|
name: t.trim(),
|
|
448
448
|
description: o.trim() || void 0,
|
|
449
449
|
type: a ? "TENANT_GROUP" : "ORG_GROUP",
|
|
450
|
-
...a &&
|
|
450
|
+
...a && n ? { tenantId: n } : {}
|
|
451
451
|
};
|
|
452
452
|
try {
|
|
453
453
|
await f.mutateAsync(v), l(""), c(""), p({}), s();
|
|
@@ -455,9 +455,9 @@ function Qa({
|
|
|
455
455
|
console.error("Failed to create group:", N);
|
|
456
456
|
}
|
|
457
457
|
}, className: "space-y-6", children: [
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
459
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
460
|
+
/* @__PURE__ */ r(be, { htmlFor: "group-name", children: [
|
|
461
461
|
"Group Name ",
|
|
462
462
|
/* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
|
|
463
463
|
] }),
|
|
@@ -476,8 +476,8 @@ function Qa({
|
|
|
476
476
|
),
|
|
477
477
|
u.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.name })
|
|
478
478
|
] }),
|
|
479
|
-
/* @__PURE__ */
|
|
480
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
480
|
+
/* @__PURE__ */ r(be, { htmlFor: "group-description", children: [
|
|
481
481
|
"Description",
|
|
482
482
|
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
|
|
483
483
|
] }),
|
|
@@ -496,17 +496,17 @@ function Qa({
|
|
|
496
496
|
}
|
|
497
497
|
),
|
|
498
498
|
u.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.description }),
|
|
499
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: [
|
|
500
500
|
o.length,
|
|
501
501
|
"/200 characters"
|
|
502
502
|
] })
|
|
503
503
|
] }),
|
|
504
|
-
/* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ r("div", { className: "flex gap-3", children: [
|
|
505
505
|
/* @__PURE__ */ e(Js, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
|
|
506
506
|
/* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground", children: "This group will be accessible to users in your workspace. You can add members after creating the group." })
|
|
507
507
|
] }) })
|
|
508
508
|
] }),
|
|
509
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ r("div", { className: "flex justify-end gap-3", children: [
|
|
510
510
|
/* @__PURE__ */ e(
|
|
511
511
|
k,
|
|
512
512
|
{
|
|
@@ -524,10 +524,10 @@ function Qa({
|
|
|
524
524
|
{
|
|
525
525
|
type: "submit",
|
|
526
526
|
disabled: f.isPending || !t.trim(),
|
|
527
|
-
children: f.isPending ? /* @__PURE__ */
|
|
527
|
+
children: f.isPending ? /* @__PURE__ */ r(I, { children: [
|
|
528
528
|
/* @__PURE__ */ e(_, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
529
529
|
"Creating..."
|
|
530
|
-
] }) : /* @__PURE__ */
|
|
530
|
+
] }) : /* @__PURE__ */ r(I, { children: [
|
|
531
531
|
/* @__PURE__ */ e($, { className: "mr-2 h-4 w-4" }),
|
|
532
532
|
"Create Group"
|
|
533
533
|
] })
|
|
@@ -536,20 +536,22 @@ function Qa({
|
|
|
536
536
|
] })
|
|
537
537
|
] });
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function Ba(s, n = []) {
|
|
540
540
|
let a = [];
|
|
541
541
|
function t(o, c) {
|
|
542
|
-
const u =
|
|
542
|
+
const u = M.createContext(c);
|
|
543
|
+
u.displayName = o + "Context";
|
|
544
|
+
const p = a.length;
|
|
543
545
|
a = [...a, c];
|
|
544
546
|
const f = (m) => {
|
|
545
547
|
var O;
|
|
546
|
-
const { scope: g, children: v, ...N } = m, w = ((O = g == null ? void 0 : g[s]) == null ? void 0 : O[p]) || u, C =
|
|
548
|
+
const { scope: g, children: v, ...N } = m, w = ((O = g == null ? void 0 : g[s]) == null ? void 0 : O[p]) || u, C = M.useMemo(() => N, Object.values(N));
|
|
547
549
|
return /* @__PURE__ */ e(w.Provider, { value: C, children: v });
|
|
548
550
|
};
|
|
549
551
|
f.displayName = o + "Provider";
|
|
550
552
|
function d(m, g) {
|
|
551
553
|
var w;
|
|
552
|
-
const v = ((w = g == null ? void 0 : g[s]) == null ? void 0 : w[p]) || u, N =
|
|
554
|
+
const v = ((w = g == null ? void 0 : g[s]) == null ? void 0 : w[p]) || u, N = M.useContext(v);
|
|
553
555
|
if (N) return N;
|
|
554
556
|
if (c !== void 0) return c;
|
|
555
557
|
throw new Error(`\`${m}\` must be used within \`${o}\``);
|
|
@@ -557,20 +559,20 @@ function Ha(s, r = []) {
|
|
|
557
559
|
return [f, d];
|
|
558
560
|
}
|
|
559
561
|
const l = () => {
|
|
560
|
-
const o = a.map((c) =>
|
|
562
|
+
const o = a.map((c) => M.createContext(c));
|
|
561
563
|
return function(u) {
|
|
562
564
|
const p = (u == null ? void 0 : u[s]) || o;
|
|
563
|
-
return
|
|
565
|
+
return M.useMemo(
|
|
564
566
|
() => ({ [`__scope${s}`]: { ...u, [s]: p } }),
|
|
565
567
|
[u, p]
|
|
566
568
|
);
|
|
567
569
|
};
|
|
568
570
|
};
|
|
569
|
-
return l.scopeName = s, [t,
|
|
571
|
+
return l.scopeName = s, [t, Ka(l, ...n)];
|
|
570
572
|
}
|
|
571
|
-
function
|
|
572
|
-
const
|
|
573
|
-
if (s.length === 1) return
|
|
573
|
+
function Ka(...s) {
|
|
574
|
+
const n = s[0];
|
|
575
|
+
if (s.length === 1) return n;
|
|
574
576
|
const a = () => {
|
|
575
577
|
const t = s.map((l) => ({
|
|
576
578
|
useScope: l(),
|
|
@@ -581,22 +583,12 @@ function Ba(...s) {
|
|
|
581
583
|
const m = p(o)[`__scope${f}`];
|
|
582
584
|
return { ...u, ...m };
|
|
583
585
|
}, {});
|
|
584
|
-
return
|
|
586
|
+
return M.useMemo(() => ({ [`__scope${n.scopeName}`]: c }), [c]);
|
|
585
587
|
};
|
|
586
588
|
};
|
|
587
|
-
return a.scopeName =
|
|
589
|
+
return a.scopeName = n.scopeName, a;
|
|
588
590
|
}
|
|
589
|
-
|
|
590
|
-
const r = D.useRef(s);
|
|
591
|
-
return D.useEffect(() => {
|
|
592
|
-
r.current = s;
|
|
593
|
-
}), D.useMemo(() => (...a) => {
|
|
594
|
-
var t;
|
|
595
|
-
return (t = r.current) == null ? void 0 : t.call(r, ...a);
|
|
596
|
-
}, []);
|
|
597
|
-
}
|
|
598
|
-
var Se = globalThis != null && globalThis.document ? D.useLayoutEffect : () => {
|
|
599
|
-
}, Ja = [
|
|
591
|
+
var Ja = [
|
|
600
592
|
"a",
|
|
601
593
|
"button",
|
|
602
594
|
"div",
|
|
@@ -614,15 +606,15 @@ var Se = globalThis != null && globalThis.document ? D.useLayoutEffect : () => {
|
|
|
614
606
|
"span",
|
|
615
607
|
"svg",
|
|
616
608
|
"ul"
|
|
617
|
-
], Te = Ja.reduce((s,
|
|
618
|
-
const a = Ws(`Primitive.${
|
|
619
|
-
const { asChild: c, ...u } = l, p = c ? a :
|
|
609
|
+
], Te = Ja.reduce((s, n) => {
|
|
610
|
+
const a = Ws(`Primitive.${n}`), t = M.forwardRef((l, o) => {
|
|
611
|
+
const { asChild: c, ...u } = l, p = c ? a : n;
|
|
620
612
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...u, ref: o });
|
|
621
613
|
});
|
|
622
|
-
return t.displayName = `Primitive.${
|
|
614
|
+
return t.displayName = `Primitive.${n}`, { ...s, [n]: t };
|
|
623
615
|
}, {});
|
|
624
616
|
function Wa() {
|
|
625
|
-
return
|
|
617
|
+
return Ea.useSyncExternalStore(
|
|
626
618
|
Xa,
|
|
627
619
|
() => !0,
|
|
628
620
|
() => !1
|
|
@@ -632,67 +624,67 @@ function Xa() {
|
|
|
632
624
|
return () => {
|
|
633
625
|
};
|
|
634
626
|
}
|
|
635
|
-
var Pe = "Avatar", [Ya] =
|
|
636
|
-
(s,
|
|
637
|
-
const { __scopeAvatar: a, ...t } = s, [l, o] =
|
|
627
|
+
var Pe = "Avatar", [Ya] = Ba(Pe), [Za, ps] = Ya(Pe), gs = M.forwardRef(
|
|
628
|
+
(s, n) => {
|
|
629
|
+
const { __scopeAvatar: a, ...t } = s, [l, o] = M.useState("idle");
|
|
638
630
|
return /* @__PURE__ */ e(
|
|
639
631
|
Za,
|
|
640
632
|
{
|
|
641
633
|
scope: a,
|
|
642
634
|
imageLoadingStatus: l,
|
|
643
635
|
onImageLoadingStatusChange: o,
|
|
644
|
-
children: /* @__PURE__ */ e(Te.span, { ...t, ref:
|
|
636
|
+
children: /* @__PURE__ */ e(Te.span, { ...t, ref: n })
|
|
645
637
|
}
|
|
646
638
|
);
|
|
647
639
|
}
|
|
648
640
|
);
|
|
649
641
|
gs.displayName = Pe;
|
|
650
|
-
var fs = "AvatarImage", vs =
|
|
651
|
-
(s,
|
|
642
|
+
var fs = "AvatarImage", vs = M.forwardRef(
|
|
643
|
+
(s, n) => {
|
|
652
644
|
const { __scopeAvatar: a, src: t, onLoadingStatusChange: l = () => {
|
|
653
|
-
}, ...o } = s, c = ps(fs, a), u = et(t, o), p =
|
|
645
|
+
}, ...o } = s, c = ps(fs, a), u = et(t, o), p = Xs((f) => {
|
|
654
646
|
l(f), c.onImageLoadingStatusChange(f);
|
|
655
647
|
});
|
|
656
|
-
return
|
|
648
|
+
return Ne(() => {
|
|
657
649
|
u !== "idle" && p(u);
|
|
658
|
-
}, [u, p]), u === "loaded" ? /* @__PURE__ */ e(Te.img, { ...o, ref:
|
|
650
|
+
}, [u, p]), u === "loaded" ? /* @__PURE__ */ e(Te.img, { ...o, ref: n, src: t }) : null;
|
|
659
651
|
}
|
|
660
652
|
);
|
|
661
653
|
vs.displayName = fs;
|
|
662
|
-
var bs = "AvatarFallback", Ns =
|
|
663
|
-
(s,
|
|
664
|
-
const { __scopeAvatar: a, delayMs: t, ...l } = s, o = ps(bs, a), [c, u] =
|
|
665
|
-
return
|
|
654
|
+
var bs = "AvatarFallback", Ns = M.forwardRef(
|
|
655
|
+
(s, n) => {
|
|
656
|
+
const { __scopeAvatar: a, delayMs: t, ...l } = s, o = ps(bs, a), [c, u] = M.useState(t === void 0);
|
|
657
|
+
return M.useEffect(() => {
|
|
666
658
|
if (t !== void 0) {
|
|
667
659
|
const p = window.setTimeout(() => u(!0), t);
|
|
668
660
|
return () => window.clearTimeout(p);
|
|
669
661
|
}
|
|
670
|
-
}, [t]), c && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Te.span, { ...l, ref:
|
|
662
|
+
}, [t]), c && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Te.span, { ...l, ref: n }) : null;
|
|
671
663
|
}
|
|
672
664
|
);
|
|
673
665
|
Ns.displayName = bs;
|
|
674
|
-
function Be(s,
|
|
675
|
-
return s ?
|
|
666
|
+
function Be(s, n) {
|
|
667
|
+
return s ? n ? (s.src !== n && (s.src = n), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
676
668
|
}
|
|
677
|
-
function et(s, { referrerPolicy:
|
|
678
|
-
const t = Wa(), l =
|
|
669
|
+
function et(s, { referrerPolicy: n, crossOrigin: a }) {
|
|
670
|
+
const t = Wa(), l = M.useRef(null), o = t ? (l.current || (l.current = new window.Image()), l.current) : null, [c, u] = M.useState(
|
|
679
671
|
() => Be(o, s)
|
|
680
672
|
);
|
|
681
|
-
return
|
|
673
|
+
return Ne(() => {
|
|
682
674
|
u(Be(o, s));
|
|
683
|
-
}, [o, s]),
|
|
675
|
+
}, [o, s]), Ne(() => {
|
|
684
676
|
const p = (m) => () => {
|
|
685
677
|
u(m);
|
|
686
678
|
};
|
|
687
679
|
if (!o) return;
|
|
688
680
|
const f = p("loaded"), d = p("error");
|
|
689
|
-
return o.addEventListener("load", f), o.addEventListener("error", d),
|
|
681
|
+
return o.addEventListener("load", f), o.addEventListener("error", d), n && (o.referrerPolicy = n), typeof a == "string" && (o.crossOrigin = a), () => {
|
|
690
682
|
o.removeEventListener("load", f), o.removeEventListener("error", d);
|
|
691
683
|
};
|
|
692
|
-
}, [o, a,
|
|
684
|
+
}, [o, a, n]), c;
|
|
693
685
|
}
|
|
694
686
|
var ys = gs, ws = vs, xs = Ns;
|
|
695
|
-
const Ge =
|
|
687
|
+
const Ge = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
696
688
|
ys,
|
|
697
689
|
{
|
|
698
690
|
ref: a,
|
|
@@ -700,20 +692,20 @@ const Ge = D.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
|
|
|
700
692
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
701
693
|
s
|
|
702
694
|
),
|
|
703
|
-
...
|
|
695
|
+
...n
|
|
704
696
|
}
|
|
705
697
|
));
|
|
706
698
|
Ge.displayName = ys.displayName;
|
|
707
|
-
const st =
|
|
699
|
+
const st = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
708
700
|
ws,
|
|
709
701
|
{
|
|
710
702
|
ref: a,
|
|
711
703
|
className: Y("aspect-square h-full w-full", s),
|
|
712
|
-
...
|
|
704
|
+
...n
|
|
713
705
|
}
|
|
714
706
|
));
|
|
715
707
|
st.displayName = ws.displayName;
|
|
716
|
-
const Fe =
|
|
708
|
+
const Fe = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
717
709
|
xs,
|
|
718
710
|
{
|
|
719
711
|
ref: a,
|
|
@@ -721,40 +713,40 @@ const Fe = D.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
|
|
|
721
713
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
722
714
|
s
|
|
723
715
|
),
|
|
724
|
-
...
|
|
716
|
+
...n
|
|
725
717
|
}
|
|
726
718
|
));
|
|
727
719
|
Fe.displayName = xs.displayName;
|
|
728
720
|
function at({
|
|
729
721
|
open: s,
|
|
730
|
-
onOpenChange:
|
|
722
|
+
onOpenChange: n,
|
|
731
723
|
group: a,
|
|
732
724
|
onUpdate: t
|
|
733
725
|
}) {
|
|
734
|
-
const [l, o] = b("members"), [c, u] = b(""), [p, f] = b([]), [d, m] = b([]), { data: g, isLoading: v, refetch: N } =
|
|
726
|
+
const [l, o] = b("members"), [c, u] = b(""), [p, f] = b([]), [d, m] = b([]), { data: g, isLoading: v, refetch: N } = Ys(a.id), w = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: C, isLoading: O } = Zs({
|
|
735
727
|
type: w,
|
|
736
728
|
tenantId: a.tenantId || void 0,
|
|
737
729
|
active: !0,
|
|
738
730
|
limit: 100
|
|
739
|
-
}), R =
|
|
731
|
+
}), R = Va(), G = Qa(), L = (g == null ? void 0 : g.members) || [], F = ne(() => new Set(L.map((h) => h.userId)), [L]), P = ne(() => C.filter((h) => !F.has(h.id)), [C, F]), j = ne(() => {
|
|
740
732
|
if (!c) return P;
|
|
741
733
|
const h = c.toLowerCase();
|
|
742
734
|
return P.filter(
|
|
743
|
-
(
|
|
735
|
+
(S) => {
|
|
744
736
|
var E, z;
|
|
745
|
-
return ((E =
|
|
737
|
+
return ((E = S.name) == null ? void 0 : E.toLowerCase().includes(h)) || ((z = S.email) == null ? void 0 : z.toLowerCase().includes(h));
|
|
746
738
|
}
|
|
747
739
|
);
|
|
748
740
|
}, [P, c]), x = ne(() => {
|
|
749
|
-
if (!c) return
|
|
741
|
+
if (!c) return L;
|
|
750
742
|
const h = c.toLowerCase();
|
|
751
|
-
return
|
|
752
|
-
(
|
|
743
|
+
return L.filter(
|
|
744
|
+
(S) => {
|
|
753
745
|
var E, z, Z, Q;
|
|
754
|
-
return ((z = (E =
|
|
746
|
+
return ((z = (E = S.user) == null ? void 0 : E.name) == null ? void 0 : z.toLowerCase().includes(h)) || ((Q = (Z = S.user) == null ? void 0 : Z.email) == null ? void 0 : Q.toLowerCase().includes(h));
|
|
755
747
|
}
|
|
756
748
|
);
|
|
757
|
-
}, [
|
|
749
|
+
}, [L, c]), V = async () => {
|
|
758
750
|
if (p.length !== 0)
|
|
759
751
|
try {
|
|
760
752
|
await R.mutateAsync({
|
|
@@ -781,37 +773,37 @@ function at({
|
|
|
781
773
|
}
|
|
782
774
|
}, ue = (h) => {
|
|
783
775
|
f(
|
|
784
|
-
(
|
|
776
|
+
(S) => S.includes(h) ? S.filter((E) => E !== h) : [...S, h]
|
|
785
777
|
);
|
|
786
|
-
},
|
|
778
|
+
}, D = (h) => {
|
|
787
779
|
m(
|
|
788
|
-
(
|
|
780
|
+
(S) => S.includes(h) ? S.filter((E) => E !== h) : [...S, h]
|
|
789
781
|
);
|
|
790
782
|
};
|
|
791
|
-
return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(ke, { open: s, onOpenChange:
|
|
792
|
-
/* @__PURE__ */
|
|
783
|
+
return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(ke, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(Le, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
784
|
+
/* @__PURE__ */ r(Ie, { children: [
|
|
793
785
|
/* @__PURE__ */ e(Ee, { children: a.name }),
|
|
794
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */
|
|
795
|
-
|
|
786
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: [
|
|
787
|
+
L.length,
|
|
796
788
|
" ",
|
|
797
|
-
|
|
789
|
+
L.length === 1 ? "member" : "members"
|
|
798
790
|
] }) }),
|
|
799
|
-
/* @__PURE__ */
|
|
791
|
+
/* @__PURE__ */ r("p", { id: "group-members-description", className: "sr-only", children: [
|
|
800
792
|
"Add or remove members from the ",
|
|
801
793
|
a.name,
|
|
802
794
|
" group"
|
|
803
795
|
] })
|
|
804
796
|
] }),
|
|
805
|
-
/* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ r(as, { value: l, onValueChange: (h) => {
|
|
806
798
|
o(h), u(""), m([]);
|
|
807
799
|
}, className: "mt-4", children: [
|
|
808
|
-
/* @__PURE__ */
|
|
800
|
+
/* @__PURE__ */ r(ts, { className: "grid w-full grid-cols-2", children: [
|
|
809
801
|
/* @__PURE__ */ e(oe, { value: "members", children: "Current Members" }),
|
|
810
802
|
/* @__PURE__ */ e(oe, { value: "add", children: "Add Members" })
|
|
811
803
|
] }),
|
|
812
|
-
/* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
-
/* @__PURE__ */ e(
|
|
804
|
+
/* @__PURE__ */ r(ie, { value: "members", className: "mt-4 space-y-4", children: [
|
|
805
|
+
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
806
|
+
/* @__PURE__ */ e(ye, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
815
807
|
/* @__PURE__ */ e(
|
|
816
808
|
W,
|
|
817
809
|
{
|
|
@@ -822,7 +814,7 @@ function at({
|
|
|
822
814
|
}
|
|
823
815
|
)
|
|
824
816
|
] }),
|
|
825
|
-
/* @__PURE__ */ e(
|
|
817
|
+
/* @__PURE__ */ e(we, { className: d.length > 0 ? "h-[300px]" : "h-[350px]", children: v ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((h) => /* @__PURE__ */ e(xe, { className: "h-16 w-full" }, h)) }) : x.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
826
818
|
/* @__PURE__ */ e($, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
827
819
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: c ? "No members found" : "No members yet" }),
|
|
828
820
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: c ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
|
|
@@ -831,12 +823,12 @@ function at({
|
|
|
831
823
|
{
|
|
832
824
|
member: h,
|
|
833
825
|
selected: d.includes(h.userId),
|
|
834
|
-
onToggle: () =>
|
|
826
|
+
onToggle: () => D(h.userId)
|
|
835
827
|
},
|
|
836
828
|
h.id
|
|
837
829
|
)) }) }),
|
|
838
|
-
d.length > 0 && /* @__PURE__ */
|
|
839
|
-
/* @__PURE__ */
|
|
830
|
+
d.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
831
|
+
/* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
|
|
840
832
|
d.length,
|
|
841
833
|
" member",
|
|
842
834
|
d.length !== 1 ? "s" : "",
|
|
@@ -849,10 +841,10 @@ function at({
|
|
|
849
841
|
size: "sm",
|
|
850
842
|
onClick: de,
|
|
851
843
|
disabled: G.isPending,
|
|
852
|
-
children: G.isPending ? /* @__PURE__ */
|
|
844
|
+
children: G.isPending ? /* @__PURE__ */ r(I, { children: [
|
|
853
845
|
/* @__PURE__ */ e(_, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
854
846
|
"Removing..."
|
|
855
|
-
] }) : /* @__PURE__ */
|
|
847
|
+
] }) : /* @__PURE__ */ r(I, { children: [
|
|
856
848
|
/* @__PURE__ */ e(rs, { className: "mr-2 h-4 w-4" }),
|
|
857
849
|
"Remove Selected"
|
|
858
850
|
] })
|
|
@@ -860,9 +852,9 @@ function at({
|
|
|
860
852
|
)
|
|
861
853
|
] })
|
|
862
854
|
] }),
|
|
863
|
-
/* @__PURE__ */
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
/* @__PURE__ */ e(
|
|
855
|
+
/* @__PURE__ */ r(ie, { value: "add", className: "mt-4 space-y-4", children: [
|
|
856
|
+
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
857
|
+
/* @__PURE__ */ e(ye, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
866
858
|
/* @__PURE__ */ e(
|
|
867
859
|
W,
|
|
868
860
|
{
|
|
@@ -873,8 +865,8 @@ function at({
|
|
|
873
865
|
}
|
|
874
866
|
)
|
|
875
867
|
] }),
|
|
876
|
-
/* @__PURE__ */ e(
|
|
877
|
-
/* @__PURE__ */ e(
|
|
868
|
+
/* @__PURE__ */ e(we, { className: "h-[300px]", children: O ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((h) => /* @__PURE__ */ e(xe, { className: "h-16 w-full" }, h)) }) : j.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
869
|
+
/* @__PURE__ */ e(Ce, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
878
870
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
879
871
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: c ? "Try a different search" : "All eligible users are already members" })
|
|
880
872
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: j.map((h) => /* @__PURE__ */ e(
|
|
@@ -886,8 +878,8 @@ function at({
|
|
|
886
878
|
},
|
|
887
879
|
h.id
|
|
888
880
|
)) }) }),
|
|
889
|
-
p.length > 0 && /* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
881
|
+
p.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
882
|
+
/* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
|
|
891
883
|
p.length,
|
|
892
884
|
" user",
|
|
893
885
|
p.length !== 1 ? "s" : "",
|
|
@@ -898,11 +890,11 @@ function at({
|
|
|
898
890
|
{
|
|
899
891
|
onClick: V,
|
|
900
892
|
disabled: R.isPending,
|
|
901
|
-
children: R.isPending ? /* @__PURE__ */
|
|
893
|
+
children: R.isPending ? /* @__PURE__ */ r(I, { children: [
|
|
902
894
|
/* @__PURE__ */ e(_, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
903
895
|
"Adding..."
|
|
904
|
-
] }) : /* @__PURE__ */
|
|
905
|
-
/* @__PURE__ */ e(
|
|
896
|
+
] }) : /* @__PURE__ */ r(I, { children: [
|
|
897
|
+
/* @__PURE__ */ e(Ce, { className: "mr-2 h-4 w-4" }),
|
|
906
898
|
"Add Members"
|
|
907
899
|
] })
|
|
908
900
|
}
|
|
@@ -914,20 +906,20 @@ function at({
|
|
|
914
906
|
}
|
|
915
907
|
function tt({
|
|
916
908
|
member: s,
|
|
917
|
-
selected:
|
|
909
|
+
selected: n,
|
|
918
910
|
onToggle: a
|
|
919
911
|
}) {
|
|
920
912
|
var l, o, c, u;
|
|
921
913
|
const t = ((o = (l = s.user) == null ? void 0 : l.name) == null ? void 0 : o.split(" ").map((p) => p[0]).join("").toUpperCase()) || "?";
|
|
922
|
-
return /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ r(
|
|
923
915
|
"div",
|
|
924
916
|
{
|
|
925
917
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
926
918
|
onClick: a,
|
|
927
919
|
children: [
|
|
928
|
-
/* @__PURE__ */ e(ns, { checked:
|
|
920
|
+
/* @__PURE__ */ e(ns, { checked: n }),
|
|
929
921
|
/* @__PURE__ */ e(Ge, { className: "h-8 w-8", children: /* @__PURE__ */ e(Fe, { className: "text-xs", children: t }) }),
|
|
930
|
-
/* @__PURE__ */
|
|
922
|
+
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
931
923
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((c = s.user) == null ? void 0 : c.name) || "Unknown User" }),
|
|
932
924
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (u = s.user) == null ? void 0 : u.email })
|
|
933
925
|
] })
|
|
@@ -937,20 +929,20 @@ function tt({
|
|
|
937
929
|
}
|
|
938
930
|
function rt({
|
|
939
931
|
user: s,
|
|
940
|
-
selected:
|
|
932
|
+
selected: n,
|
|
941
933
|
onToggle: a
|
|
942
934
|
}) {
|
|
943
935
|
var l;
|
|
944
936
|
const t = ((l = s.name) == null ? void 0 : l.split(" ").map((o) => o[0]).join("").toUpperCase()) || "?";
|
|
945
|
-
return /* @__PURE__ */
|
|
937
|
+
return /* @__PURE__ */ r(
|
|
946
938
|
"div",
|
|
947
939
|
{
|
|
948
940
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
949
941
|
onClick: a,
|
|
950
942
|
children: [
|
|
951
|
-
/* @__PURE__ */ e(ns, { checked:
|
|
943
|
+
/* @__PURE__ */ e(ns, { checked: n }),
|
|
952
944
|
/* @__PURE__ */ e(Ge, { className: "h-8 w-8", children: /* @__PURE__ */ e(Fe, { className: "text-xs", children: t }) }),
|
|
953
|
-
/* @__PURE__ */
|
|
945
|
+
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
954
946
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s.name }),
|
|
955
947
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s.email })
|
|
956
948
|
] })
|
|
@@ -960,13 +952,13 @@ function rt({
|
|
|
960
952
|
}
|
|
961
953
|
function nt({
|
|
962
954
|
open: s,
|
|
963
|
-
onOpenChange:
|
|
955
|
+
onOpenChange: n
|
|
964
956
|
}) {
|
|
965
|
-
const [a, t] = b("groups"), [l, o] = b(""), [c, u] = b(null), [p, f] = b(!1), [d, m] = b(null), { tokenProps: g } = U(), { currentUser: v } = os(), N =
|
|
957
|
+
const [a, t] = b("groups"), [l, o] = b(""), [c, u] = b(null), [p, f] = b(!1), [d, m] = b(null), { tokenProps: g } = U(), { currentUser: v } = os(), N = ja(), w = (v == null ? void 0 : v.type) === "tenant", C = g == null ? void 0 : g.tenantId, { groups: O, isLoading: R, refetch: G } = ea({
|
|
966
958
|
type: w ? "TENANT_GROUP" : "all",
|
|
967
959
|
tenantId: w ? C : void 0,
|
|
968
960
|
includeMembers: !1
|
|
969
|
-
}),
|
|
961
|
+
}), L = O.filter(
|
|
970
962
|
(x) => {
|
|
971
963
|
var V;
|
|
972
964
|
return x.name.toLowerCase().includes(l.toLowerCase()) || ((V = x.description) == null ? void 0 : V.toLowerCase().includes(l.toLowerCase()));
|
|
@@ -983,29 +975,29 @@ function nt({
|
|
|
983
975
|
}, j = () => {
|
|
984
976
|
t("groups"), G();
|
|
985
977
|
};
|
|
986
|
-
return /* @__PURE__ */
|
|
987
|
-
/* @__PURE__ */ e(ke, { open: s, onOpenChange:
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
/* @__PURE__ */
|
|
978
|
+
return /* @__PURE__ */ r(I, { children: [
|
|
979
|
+
/* @__PURE__ */ e(ke, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(Le, { className: "max-w-4xl max-h-[80vh]", children: [
|
|
980
|
+
/* @__PURE__ */ r(Ie, { children: [
|
|
981
|
+
/* @__PURE__ */ r(Ee, { className: "flex items-center gap-2", children: [
|
|
990
982
|
/* @__PURE__ */ e($, { className: "h-5 w-5" }),
|
|
991
983
|
"Group Management"
|
|
992
984
|
] }),
|
|
993
985
|
/* @__PURE__ */ e(Ye, { children: "Manage your groups, create new groups, and control group membership" })
|
|
994
986
|
] }),
|
|
995
|
-
/* @__PURE__ */
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ r(as, { value: a, onValueChange: t, className: "mt-4", children: [
|
|
988
|
+
/* @__PURE__ */ r(ts, { className: "grid w-full grid-cols-2", children: [
|
|
989
|
+
/* @__PURE__ */ r(oe, { value: "groups", className: "flex items-center gap-2", children: [
|
|
998
990
|
/* @__PURE__ */ e($, { className: "h-4 w-4" }),
|
|
999
991
|
"Groups"
|
|
1000
992
|
] }),
|
|
1001
|
-
/* @__PURE__ */
|
|
1002
|
-
/* @__PURE__ */ e(
|
|
993
|
+
/* @__PURE__ */ r(oe, { value: "create", className: "flex items-center gap-2", children: [
|
|
994
|
+
/* @__PURE__ */ e(Ae, { className: "h-4 w-4" }),
|
|
1003
995
|
"Create Group"
|
|
1004
996
|
] })
|
|
1005
997
|
] }),
|
|
1006
|
-
/* @__PURE__ */ e(ie, { value: "groups", className: "mt-4", children: /* @__PURE__ */
|
|
1007
|
-
/* @__PURE__ */
|
|
1008
|
-
/* @__PURE__ */ e(
|
|
998
|
+
/* @__PURE__ */ e(ie, { value: "groups", className: "mt-4", children: /* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
999
|
+
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
1000
|
+
/* @__PURE__ */ e(ye, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
1009
1001
|
/* @__PURE__ */ e(
|
|
1010
1002
|
W,
|
|
1011
1003
|
{
|
|
@@ -1016,11 +1008,11 @@ function nt({
|
|
|
1016
1008
|
}
|
|
1017
1009
|
)
|
|
1018
1010
|
] }),
|
|
1019
|
-
/* @__PURE__ */ e(
|
|
1011
|
+
/* @__PURE__ */ e(we, { className: "h-[400px]", children: R ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((x) => /* @__PURE__ */ e(xe, { className: "h-24 w-full" }, x)) }) : L.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
1020
1012
|
/* @__PURE__ */ e($, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
1021
1013
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
|
|
1022
1014
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
|
|
1023
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
1015
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: L.map((x) => /* @__PURE__ */ e(
|
|
1024
1016
|
ot,
|
|
1025
1017
|
{
|
|
1026
1018
|
group: x,
|
|
@@ -1032,7 +1024,7 @@ function nt({
|
|
|
1032
1024
|
)) }) })
|
|
1033
1025
|
] }) }),
|
|
1034
1026
|
/* @__PURE__ */ e(ie, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1035
|
-
|
|
1027
|
+
Ha,
|
|
1036
1028
|
{
|
|
1037
1029
|
onSuccess: j,
|
|
1038
1030
|
tenantId: C,
|
|
@@ -1055,24 +1047,24 @@ function nt({
|
|
|
1055
1047
|
{
|
|
1056
1048
|
open: !!d,
|
|
1057
1049
|
onOpenChange: () => m(null),
|
|
1058
|
-
children: /* @__PURE__ */
|
|
1059
|
-
/* @__PURE__ */
|
|
1050
|
+
children: /* @__PURE__ */ r(ls, { children: [
|
|
1051
|
+
/* @__PURE__ */ r(cs, { children: [
|
|
1060
1052
|
/* @__PURE__ */ e(ds, { children: "Delete Group" }),
|
|
1061
|
-
/* @__PURE__ */
|
|
1053
|
+
/* @__PURE__ */ r(us, { children: [
|
|
1062
1054
|
'Are you sure you want to delete "',
|
|
1063
1055
|
d == null ? void 0 : d.name,
|
|
1064
1056
|
'"? This action cannot be undone and will remove all members from the group.'
|
|
1065
1057
|
] })
|
|
1066
1058
|
] }),
|
|
1067
|
-
/* @__PURE__ */
|
|
1059
|
+
/* @__PURE__ */ r(ms, { children: [
|
|
1068
1060
|
/* @__PURE__ */ e(hs, { children: "Cancel" }),
|
|
1069
1061
|
/* @__PURE__ */ e(
|
|
1070
|
-
|
|
1062
|
+
De,
|
|
1071
1063
|
{
|
|
1072
1064
|
onClick: F,
|
|
1073
1065
|
disabled: N.isPending,
|
|
1074
1066
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1075
|
-
children: N.isPending ? /* @__PURE__ */
|
|
1067
|
+
children: N.isPending ? /* @__PURE__ */ r(I, { children: [
|
|
1076
1068
|
/* @__PURE__ */ e(_, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1077
1069
|
"Deleting..."
|
|
1078
1070
|
] }) : "Delete Group"
|
|
@@ -1086,39 +1078,39 @@ function nt({
|
|
|
1086
1078
|
}
|
|
1087
1079
|
function ot({
|
|
1088
1080
|
group: s,
|
|
1089
|
-
onManageMembers:
|
|
1081
|
+
onManageMembers: n,
|
|
1090
1082
|
onDelete: a,
|
|
1091
1083
|
currentUserId: t
|
|
1092
1084
|
}) {
|
|
1093
1085
|
const l = s.createdBy === t;
|
|
1094
|
-
return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */
|
|
1095
|
-
/* @__PURE__ */
|
|
1096
|
-
/* @__PURE__ */
|
|
1086
|
+
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: [
|
|
1087
|
+
/* @__PURE__ */ r("div", { className: "flex-1 space-y-2", children: [
|
|
1088
|
+
/* @__PURE__ */ r("div", { children: [
|
|
1097
1089
|
/* @__PURE__ */ e("h4", { className: "font-medium", children: s.name }),
|
|
1098
1090
|
s.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mt-1", children: s.description })
|
|
1099
1091
|
] }),
|
|
1100
|
-
/* @__PURE__ */
|
|
1101
|
-
/* @__PURE__ */
|
|
1092
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
|
|
1093
|
+
/* @__PURE__ */ r("span", { className: "flex items-center gap-1", children: [
|
|
1102
1094
|
/* @__PURE__ */ e($, { className: "h-3 w-3" }),
|
|
1103
1095
|
s.memberCount,
|
|
1104
1096
|
" ",
|
|
1105
1097
|
s.memberCount === 1 ? "member" : "members"
|
|
1106
1098
|
] }),
|
|
1107
|
-
/* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ r("span", { children: [
|
|
1108
1100
|
"Created ",
|
|
1109
|
-
|
|
1101
|
+
sa(new Date(s.createdAt), "MMM d, yyyy")
|
|
1110
1102
|
] })
|
|
1111
1103
|
] })
|
|
1112
1104
|
] }),
|
|
1113
|
-
/* @__PURE__ */
|
|
1105
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
1114
1106
|
/* @__PURE__ */ e(
|
|
1115
1107
|
k,
|
|
1116
1108
|
{
|
|
1117
1109
|
variant: "ghost",
|
|
1118
1110
|
size: "sm",
|
|
1119
|
-
onClick:
|
|
1111
|
+
onClick: n,
|
|
1120
1112
|
title: "Manage members",
|
|
1121
|
-
children: /* @__PURE__ */ e(
|
|
1113
|
+
children: /* @__PURE__ */ e(Ce, { className: "h-4 w-4" })
|
|
1122
1114
|
}
|
|
1123
1115
|
),
|
|
1124
1116
|
l && /* @__PURE__ */ e(
|
|
@@ -1139,25 +1131,25 @@ function pt() {
|
|
|
1139
1131
|
var _e, $e, je;
|
|
1140
1132
|
const {
|
|
1141
1133
|
authToken: s,
|
|
1142
|
-
tokenProps:
|
|
1134
|
+
tokenProps: n,
|
|
1143
1135
|
id: a
|
|
1144
|
-
} = U(), { isLocalDev: t } =
|
|
1136
|
+
} = U(), { isLocalDev: t } = aa(), { permissions: l } = ta(), o = ra(), { isLoading: c } = na();
|
|
1145
1137
|
y((i) => i.theme);
|
|
1146
1138
|
const u = y((i) => i.lenses), p = y((i) => i.selectedLensId), f = u == null ? void 0 : u.find((i) => i.id === p), d = y((i) => i.dashboard);
|
|
1147
1139
|
y((i) => i.selectedSheetId);
|
|
1148
1140
|
const m = y(
|
|
1149
1141
|
(i) => i.isDashboardEditing
|
|
1150
|
-
), { setDashboardTitle: g } = y((i) => i.actions), [v, N] = b(!1), [w, C] = b(!1), [O, R] = b(!1), [G,
|
|
1142
|
+
), { setDashboardTitle: g } = y((i) => i.actions), [v, N] = b(!1), [w, C] = b(!1), [O, R] = b(!1), [G, L] = b(!1), [F, P] = b(null), [j, x] = b(!1), V = y((i) => i.isDashboardPanelOpen), de = y(
|
|
1151
1143
|
(i) => i.actions.setIsDashboardPanelOpen
|
|
1152
|
-
), ue = y((i) => i.filterValues),
|
|
1144
|
+
), ue = y((i) => i.filterValues), D = y((i) => i.isVisualEditing);
|
|
1153
1145
|
Qe((i) => i.card);
|
|
1154
1146
|
const h = re(
|
|
1155
1147
|
(i) => i.selectedDashboard
|
|
1156
|
-
),
|
|
1148
|
+
), S = re(
|
|
1157
1149
|
(i) => i.initialDashboard
|
|
1158
1150
|
);
|
|
1159
1151
|
re((i) => i.selectedVisual), y((i) => i.selectedFrameId), Qe((i) => i.frame);
|
|
1160
|
-
const E = h ? ($e = h == null ? void 0 : h.permissions) == null ? void 0 : $e.canEdit : (_e =
|
|
1152
|
+
const E = h ? ($e = h == null ? void 0 : h.permissions) == null ? void 0 : $e.canEdit : (_e = S == null ? void 0 : S.permissions) == null ? void 0 : _e.canEdit, z = y((i) => i.showFilters), Z = y(
|
|
1161
1153
|
(i) => i.showDashboardJSON
|
|
1162
1154
|
), Q = y((i) => i.onSaveFunction), Cs = y(
|
|
1163
1155
|
(i) => i.actions.setShowFilters
|
|
@@ -1165,12 +1157,12 @@ function pt() {
|
|
|
1165
1157
|
(i) => i.actions
|
|
1166
1158
|
), { setInitialDashboard: Ue, clearSelectedDashboard: Ds } = re(
|
|
1167
1159
|
(i) => i.actions
|
|
1168
|
-
), { resources: ee } =
|
|
1160
|
+
), { resources: ee } = oa(ve.DASHBOARD), { currentUser: Ss } = os(), Ms = ia(Ss), H = h || S, ze = H ? {
|
|
1169
1161
|
id: H.id,
|
|
1170
1162
|
title: (d == null ? void 0 : d.title) || H.title || "Dashboard"
|
|
1171
|
-
} : null, { handleAddNewFrame: ks } =
|
|
1163
|
+
} : null, { handleAddNewFrame: ks } = la(), [B, me] = b(!1), [As, se] = b(!1), ae = ca(ve.DASHBOARD), [K, he] = b(
|
|
1172
1164
|
null
|
|
1173
|
-
),
|
|
1165
|
+
), Ls = async (i, T) => {
|
|
1174
1166
|
if (!(d != null && d.id)) {
|
|
1175
1167
|
console.log("No dashboard ID found");
|
|
1176
1168
|
return;
|
|
@@ -1186,15 +1178,15 @@ function pt() {
|
|
|
1186
1178
|
},
|
|
1187
1179
|
{
|
|
1188
1180
|
onSuccess: () => {
|
|
1189
|
-
console.log("Dashboard title updated successfully"),
|
|
1181
|
+
console.log("Dashboard title updated successfully"), A.success("Dashboard title updated");
|
|
1190
1182
|
},
|
|
1191
1183
|
onError: (J) => {
|
|
1192
|
-
console.error("Failed to update dashboard title:", J),
|
|
1184
|
+
console.error("Failed to update dashboard title:", J), A.error("Failed to update dashboard title"), g(T);
|
|
1193
1185
|
}
|
|
1194
1186
|
}
|
|
1195
1187
|
);
|
|
1196
1188
|
};
|
|
1197
|
-
|
|
1189
|
+
Na(() => {
|
|
1198
1190
|
if (ee && ee.length > 0) {
|
|
1199
1191
|
const i = d == null ? void 0 : d.id;
|
|
1200
1192
|
if (i) {
|
|
@@ -1205,12 +1197,12 @@ function pt() {
|
|
|
1205
1197
|
}
|
|
1206
1198
|
}
|
|
1207
1199
|
}, [ee, d == null ? void 0 : d.id, Ue]);
|
|
1208
|
-
const te =
|
|
1200
|
+
const te = n.orgUserId || n.tenantId, Is = m && !D && te && E, { setDashboard: Es } = y((i) => i.actions), Ts = () => {
|
|
1209
1201
|
Oe(!0);
|
|
1210
1202
|
}, pe = () => {
|
|
1211
1203
|
Oe(!1), Re(!1), he(null);
|
|
1212
1204
|
};
|
|
1213
|
-
|
|
1205
|
+
wa(
|
|
1214
1206
|
m,
|
|
1215
1207
|
d,
|
|
1216
1208
|
K,
|
|
@@ -1226,8 +1218,8 @@ function pt() {
|
|
|
1226
1218
|
async function ge(i) {
|
|
1227
1219
|
const T = (i == null ? void 0 : i.closeAfterSave) ?? j;
|
|
1228
1220
|
x(T), T && se(!1);
|
|
1229
|
-
const J =
|
|
1230
|
-
|
|
1221
|
+
const J = ba(d);
|
|
1222
|
+
L(!0), P(null), me(!0);
|
|
1231
1223
|
const zs = {
|
|
1232
1224
|
template: d
|
|
1233
1225
|
};
|
|
@@ -1238,10 +1230,10 @@ function pt() {
|
|
|
1238
1230
|
},
|
|
1239
1231
|
{
|
|
1240
1232
|
onSuccess: () => {
|
|
1241
|
-
me(!1),
|
|
1233
|
+
me(!1), A.success("Dashboard saved!"), he(J), L(!1), x(!1), T && pe();
|
|
1242
1234
|
},
|
|
1243
1235
|
onError: () => {
|
|
1244
|
-
me(!1), P("Failed to save dashboard. Please try again."),
|
|
1236
|
+
me(!1), P("Failed to save dashboard. Please try again."), A.error("Failed to save dashboard");
|
|
1245
1237
|
}
|
|
1246
1238
|
}
|
|
1247
1239
|
);
|
|
@@ -1253,11 +1245,11 @@ function pt() {
|
|
|
1253
1245
|
template: i,
|
|
1254
1246
|
filterValues: ue
|
|
1255
1247
|
};
|
|
1256
|
-
await
|
|
1257
|
-
|
|
1248
|
+
await Se(
|
|
1249
|
+
n.apiServiceUrl,
|
|
1258
1250
|
T,
|
|
1259
1251
|
s == null ? void 0 : s.accessToken
|
|
1260
|
-
),
|
|
1252
|
+
), A.success("Lens saved"), Q == null || Q(d), N(!1);
|
|
1261
1253
|
}
|
|
1262
1254
|
const qe = (f == null ? void 0 : f.name) || d.title;
|
|
1263
1255
|
ae.isPending && console.log("Title during update:", {
|
|
@@ -1266,15 +1258,15 @@ function pt() {
|
|
|
1266
1258
|
dashboardId: d == null ? void 0 : d.id,
|
|
1267
1259
|
currentLensName: f == null ? void 0 : f.name
|
|
1268
1260
|
});
|
|
1269
|
-
const Us =
|
|
1270
|
-
return /* @__PURE__ */
|
|
1261
|
+
const Us = n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail;
|
|
1262
|
+
return /* @__PURE__ */ r(
|
|
1271
1263
|
"div",
|
|
1272
1264
|
{
|
|
1273
1265
|
className: "flex h-11 items-center justify-between gap-2 border-b px-4 py-2",
|
|
1274
1266
|
role: "dashboard-controls",
|
|
1275
1267
|
children: [
|
|
1276
|
-
/* @__PURE__ */
|
|
1277
|
-
Us && /* @__PURE__ */
|
|
1268
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1269
|
+
Us && /* @__PURE__ */ r(I, { children: [
|
|
1278
1270
|
/* @__PURE__ */ e(
|
|
1279
1271
|
q,
|
|
1280
1272
|
{
|
|
@@ -1284,10 +1276,10 @@ function pt() {
|
|
|
1284
1276
|
de(!V);
|
|
1285
1277
|
},
|
|
1286
1278
|
className: "h-7 p-2",
|
|
1287
|
-
children: /* @__PURE__ */ e(
|
|
1279
|
+
children: /* @__PURE__ */ e(ka, { className: "h-4 w-4" })
|
|
1288
1280
|
}
|
|
1289
1281
|
),
|
|
1290
|
-
o && !
|
|
1282
|
+
o && !D && /* @__PURE__ */ e(
|
|
1291
1283
|
q,
|
|
1292
1284
|
{
|
|
1293
1285
|
"aria-label": "Dashboard Hub",
|
|
@@ -1298,11 +1290,11 @@ function pt() {
|
|
|
1298
1290
|
}
|
|
1299
1291
|
)
|
|
1300
1292
|
] }),
|
|
1301
|
-
!
|
|
1293
|
+
!D && o && (c ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1302
1294
|
/* @__PURE__ */ e(_, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
|
|
1303
1295
|
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
|
|
1304
1296
|
] }) : /* @__PURE__ */ e(
|
|
1305
|
-
|
|
1297
|
+
da,
|
|
1306
1298
|
{
|
|
1307
1299
|
value: qe || "Untitled Dashboard",
|
|
1308
1300
|
onSave: (i) => {
|
|
@@ -1312,7 +1304,7 @@ function pt() {
|
|
|
1312
1304
|
dashboardId: d == null ? void 0 : d.id
|
|
1313
1305
|
});
|
|
1314
1306
|
const T = (d == null ? void 0 : d.title) || "";
|
|
1315
|
-
g(i),
|
|
1307
|
+
g(i), Ls(i, T);
|
|
1316
1308
|
},
|
|
1317
1309
|
isEditable: E && !f,
|
|
1318
1310
|
displayClassName: "text-sm font-medium",
|
|
@@ -1322,37 +1314,37 @@ function pt() {
|
|
|
1322
1314
|
}
|
|
1323
1315
|
))
|
|
1324
1316
|
] }),
|
|
1325
|
-
/* @__PURE__ */
|
|
1326
|
-
|
|
1327
|
-
/* @__PURE__ */ e(
|
|
1328
|
-
/* @__PURE__ */ e(
|
|
1317
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1318
|
+
D && /* @__PURE__ */ r(I, { children: [
|
|
1319
|
+
/* @__PURE__ */ e(xa, { className: "mr-2" }),
|
|
1320
|
+
/* @__PURE__ */ e(Ca, { className: "h-7" })
|
|
1329
1321
|
] }),
|
|
1330
|
-
t && !
|
|
1322
|
+
t && !D && /* @__PURE__ */ r(I, { children: [
|
|
1331
1323
|
/* @__PURE__ */ e(
|
|
1332
1324
|
q,
|
|
1333
1325
|
{
|
|
1334
1326
|
tooltip: "Copy Token",
|
|
1335
1327
|
onClick: () => {
|
|
1336
1328
|
var i;
|
|
1337
|
-
s != null && s.accessToken && ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(s.accessToken).then(() =>
|
|
1329
|
+
s != null && s.accessToken && ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.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"));
|
|
1338
1330
|
},
|
|
1339
1331
|
className: "h-7 p-2",
|
|
1340
|
-
children: /* @__PURE__ */ e(
|
|
1332
|
+
children: /* @__PURE__ */ e(ua, { className: "h-4 w-4" })
|
|
1341
1333
|
}
|
|
1342
1334
|
),
|
|
1343
1335
|
/* @__PURE__ */ e(
|
|
1344
1336
|
q,
|
|
1345
1337
|
{
|
|
1346
1338
|
tooltip: "Invalidate Token",
|
|
1347
|
-
onClick: () =>
|
|
1339
|
+
onClick: () => ma(n.apiServiceUrl),
|
|
1348
1340
|
className: "h-7 p-2",
|
|
1349
1341
|
children: /* @__PURE__ */ e(La, { className: "h-4 w-4" })
|
|
1350
1342
|
}
|
|
1351
1343
|
)
|
|
1352
1344
|
] }),
|
|
1353
|
-
!
|
|
1354
|
-
!
|
|
1355
|
-
!
|
|
1345
|
+
!D && o && /* @__PURE__ */ e(Ra, {}),
|
|
1346
|
+
!D && o && /* @__PURE__ */ e(Da, {}),
|
|
1347
|
+
!D && o && Ms && /* @__PURE__ */ e(
|
|
1356
1348
|
q,
|
|
1357
1349
|
{
|
|
1358
1350
|
tooltip: "Manage Groups",
|
|
@@ -1361,28 +1353,28 @@ function pt() {
|
|
|
1361
1353
|
children: /* @__PURE__ */ e($, { className: "h-4 w-4" })
|
|
1362
1354
|
}
|
|
1363
1355
|
),
|
|
1364
|
-
!
|
|
1356
|
+
!D && o && ((je = H == null ? void 0 : H.permissions) == null ? void 0 : je.canShare) && /* @__PURE__ */ e(
|
|
1365
1357
|
q,
|
|
1366
1358
|
{
|
|
1367
1359
|
tooltip: "Share Dashboard",
|
|
1368
1360
|
onClick: () => C(!0),
|
|
1369
1361
|
className: "h-7 p-2",
|
|
1370
|
-
children: /* @__PURE__ */ e(
|
|
1362
|
+
children: /* @__PURE__ */ e(ha, { className: "h-4 w-4" })
|
|
1371
1363
|
}
|
|
1372
1364
|
),
|
|
1373
|
-
!z && !
|
|
1365
|
+
!z && !D && m && l.canUseFilters && o && /* @__PURE__ */ e(
|
|
1374
1366
|
k,
|
|
1375
1367
|
{
|
|
1376
1368
|
className: "h-7 p-2",
|
|
1377
1369
|
variant: "outline",
|
|
1378
1370
|
onClick: () => Cs(!0),
|
|
1379
1371
|
size: "sm",
|
|
1380
|
-
children: /* @__PURE__ */ e(
|
|
1372
|
+
children: /* @__PURE__ */ e(pa, { className: "h-4 w-4" })
|
|
1381
1373
|
}
|
|
1382
1374
|
),
|
|
1383
|
-
m && !
|
|
1384
|
-
!
|
|
1385
|
-
m && !
|
|
1375
|
+
m && !D && te && t && o && /* @__PURE__ */ e(Fa, {}),
|
|
1376
|
+
!D && te && t && o && /* @__PURE__ */ e(Oa, {}),
|
|
1377
|
+
m && !D && te && f && t && o && /* @__PURE__ */ r(
|
|
1386
1378
|
k,
|
|
1387
1379
|
{
|
|
1388
1380
|
className: "h-7 p-2",
|
|
@@ -1396,7 +1388,7 @@ function pt() {
|
|
|
1396
1388
|
]
|
|
1397
1389
|
}
|
|
1398
1390
|
),
|
|
1399
|
-
m && !
|
|
1391
|
+
m && !D && o && /* @__PURE__ */ r(
|
|
1400
1392
|
k,
|
|
1401
1393
|
{
|
|
1402
1394
|
variant: "outline",
|
|
@@ -1405,12 +1397,12 @@ function pt() {
|
|
|
1405
1397
|
disabled: !m,
|
|
1406
1398
|
onClick: () => ks(),
|
|
1407
1399
|
children: [
|
|
1408
|
-
/* @__PURE__ */ e(
|
|
1400
|
+
/* @__PURE__ */ e(Ae, { className: "mr-2 h-4 w-4" }),
|
|
1409
1401
|
"Visual"
|
|
1410
1402
|
]
|
|
1411
1403
|
}
|
|
1412
1404
|
),
|
|
1413
|
-
!
|
|
1405
|
+
!D && !m && l.canEdit && o && /* @__PURE__ */ r(
|
|
1414
1406
|
k,
|
|
1415
1407
|
{
|
|
1416
1408
|
variant: "outline",
|
|
@@ -1418,12 +1410,12 @@ function pt() {
|
|
|
1418
1410
|
onClick: Ts,
|
|
1419
1411
|
size: "sm",
|
|
1420
1412
|
children: [
|
|
1421
|
-
/* @__PURE__ */ e(
|
|
1413
|
+
/* @__PURE__ */ e(ga, { className: "mr-2 h-4 w-4" }),
|
|
1422
1414
|
"Edit"
|
|
1423
1415
|
]
|
|
1424
1416
|
}
|
|
1425
1417
|
),
|
|
1426
|
-
Is && o && /* @__PURE__ */
|
|
1418
|
+
Is && o && /* @__PURE__ */ r(
|
|
1427
1419
|
k,
|
|
1428
1420
|
{
|
|
1429
1421
|
className: "h-7 p-2",
|
|
@@ -1436,18 +1428,18 @@ function pt() {
|
|
|
1436
1428
|
]
|
|
1437
1429
|
}
|
|
1438
1430
|
),
|
|
1439
|
-
!
|
|
1431
|
+
!D && m && t && o && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
|
|
1440
1432
|
k,
|
|
1441
1433
|
{
|
|
1442
1434
|
className: "h-7 p-2",
|
|
1443
1435
|
onClick: () => Re(!Z),
|
|
1444
1436
|
size: "sm",
|
|
1445
1437
|
variant: "ghost",
|
|
1446
|
-
children: /* @__PURE__ */ e(
|
|
1438
|
+
children: /* @__PURE__ */ e(fa, { className: "h-4 w-4" })
|
|
1447
1439
|
}
|
|
1448
1440
|
) }),
|
|
1449
|
-
!
|
|
1450
|
-
m && !
|
|
1441
|
+
!D && t && /* @__PURE__ */ e(Ta, {}),
|
|
1442
|
+
m && !D && o && /* @__PURE__ */ r(
|
|
1451
1443
|
k,
|
|
1452
1444
|
{
|
|
1453
1445
|
variant: "outline",
|
|
@@ -1460,7 +1452,7 @@ function pt() {
|
|
|
1460
1452
|
}
|
|
1461
1453
|
),
|
|
1462
1454
|
w && ze && /* @__PURE__ */ e(
|
|
1463
|
-
|
|
1455
|
+
va,
|
|
1464
1456
|
{
|
|
1465
1457
|
resource: ze,
|
|
1466
1458
|
resourceType: ve.DASHBOARD,
|
|
@@ -1479,34 +1471,34 @@ function pt() {
|
|
|
1479
1471
|
{
|
|
1480
1472
|
open: G,
|
|
1481
1473
|
onOpenChange: (i) => {
|
|
1482
|
-
!i && B && !F || (
|
|
1474
|
+
!i && B && !F || (L(i), i || (P(null), x(!1)));
|
|
1483
1475
|
},
|
|
1484
|
-
children: /* @__PURE__ */
|
|
1485
|
-
/* @__PURE__ */
|
|
1476
|
+
children: /* @__PURE__ */ r(ls, { className: "max-w-sm", children: [
|
|
1477
|
+
/* @__PURE__ */ r(cs, { children: [
|
|
1486
1478
|
/* @__PURE__ */ e(ds, { children: F ? "Save failed" : "Saving dashboard" }),
|
|
1487
1479
|
/* @__PURE__ */ e(us, { className: "pt-2", children: F ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
|
|
1488
1480
|
] }),
|
|
1489
|
-
/* @__PURE__ */ e(ms, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: F ? /* @__PURE__ */
|
|
1481
|
+
/* @__PURE__ */ e(ms, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: F ? /* @__PURE__ */ r(I, { children: [
|
|
1490
1482
|
/* @__PURE__ */ e(
|
|
1491
1483
|
hs,
|
|
1492
1484
|
{
|
|
1493
1485
|
onClick: () => {
|
|
1494
|
-
|
|
1486
|
+
L(!1), P(null), x(!1);
|
|
1495
1487
|
},
|
|
1496
1488
|
className: "m-0",
|
|
1497
1489
|
children: "Close"
|
|
1498
1490
|
}
|
|
1499
1491
|
),
|
|
1500
1492
|
/* @__PURE__ */ e(
|
|
1501
|
-
|
|
1493
|
+
De,
|
|
1502
1494
|
{
|
|
1503
1495
|
onClick: () => ge(),
|
|
1504
1496
|
className: "m-0",
|
|
1505
1497
|
children: "Retry"
|
|
1506
1498
|
}
|
|
1507
1499
|
)
|
|
1508
|
-
] }) : /* @__PURE__ */
|
|
1509
|
-
|
|
1500
|
+
] }) : /* @__PURE__ */ r(
|
|
1501
|
+
De,
|
|
1510
1502
|
{
|
|
1511
1503
|
disabled: !0,
|
|
1512
1504
|
className: "m-0 cursor-default",
|
|
@@ -1520,9 +1512,9 @@ function pt() {
|
|
|
1520
1512
|
}
|
|
1521
1513
|
),
|
|
1522
1514
|
/* @__PURE__ */ e(
|
|
1523
|
-
|
|
1515
|
+
Sa,
|
|
1524
1516
|
{
|
|
1525
|
-
open:
|
|
1517
|
+
open: As,
|
|
1526
1518
|
onOpenChange: se,
|
|
1527
1519
|
onSave: Fs,
|
|
1528
1520
|
onDiscard: Os,
|