react-semaphor 0.1.176 → 0.1.178
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-00cjSeD7.js +42 -0
- package/dist/chunks/dashboard-controls-C9IWIFfW.js +1624 -0
- package/dist/chunks/{dashboard-json-BnCOeWny.js → dashboard-json--ke9XK9p.js} +1 -1
- package/dist/chunks/{dashboard-json-CY8Vbmi5.js → dashboard-json-BDjl-3ej.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BXBPQpCA.js → edit-dashboard-visual-BBsC9feJ.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-BX-hJR3k.js → edit-dashboard-visual-BroCdmtP.js} +1 -1
- package/dist/chunks/{editor-action-buttons-DUp8ZHiE.js → editor-action-buttons-CHoiNw7F.js} +2 -2
- package/dist/chunks/{editor-action-buttons-B-m2BOfh.js → editor-action-buttons-JE9t84-4.js} +1 -1
- package/dist/chunks/{index-D9Vg4Ioz.js → index-CdfFCbJb.js} +194 -225
- package/dist/chunks/{index-Cskof6E0.js → index-DZjcALSv.js} +16075 -16385
- package/dist/chunks/{resource-management-panel-DxRvAR5Q.js → resource-management-panel-C96ElLa5.js} +1 -1
- package/dist/chunks/{resource-management-panel-N2ZpMRwr.js → resource-management-panel-DE8DnPSl.js} +3 -3
- package/dist/chunks/{schedule-dashboard-Cd9H79qL.js → schedule-dashboard-BFa0Uljc.js} +3 -3
- package/dist/chunks/{schedule-dashboard-CmpnXuyb.js → schedule-dashboard-CzU0ziLB.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-0BX-GN_0.js → use-role-aware-display-preferences-Dovp_VmV.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-Cl52AceY.js → use-role-aware-display-preferences-Rd1BhDG4.js} +1 -1
- package/dist/chunks/{use-visual-utils-DsrKjvLV.js → use-visual-utils-BkRr5LoD.js} +1 -1
- package/dist/chunks/{use-visual-utils-Czmg35Mw.js → use-visual-utils-Cnju2tnE.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 +6 -3
- package/package.json +2 -2
- package/dist/chunks/dashboard-controls-BtrmT5hV.js +0 -1509
- package/dist/chunks/dashboard-controls-DR6ruxzW.js +0 -26
|
@@ -0,0 +1,1624 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { l as J, bE as Bs, u as x, aS as es, aT as ss, B as M, aV as as, aW as ve, bF as ke, o as ts, aA as U, aF as Oe, bG as Qs, bc as Ie, aG as _e, aH as Te, aI as Ge, aJ as ns, aK as Se, bH as W, aO as Ws, K as $, bI as Js, bg as Xs, bJ as Ys, bK as Qe, bL as rs, c as ie, bM as os, p as le, bN as ce, t as A, bO as is, aM as Zs, bP as ea, L as V, bf as j, bQ as sa, bR as aa, bS as xe, bT as ta, bU as na, bV as ls, bW as cs, bX as re, bY as oe, bB as we, bm as Ce, bZ as De, bh as ds, b_ as Le, aN as us, e as ms, b$ as ra, a_ as hs, a$ as ps, b0 as fs, b2 as gs, b3 as vs, b4 as bs, b5 as ys, b6 as Ee, c0 as oa, ba as ia, c1 as la, T as ca, n as We, R as te, c2 as da, $ as ua, V as be, c3 as ma, c4 as ha, c5 as pa, c6 as fa, bd as ga, a6 as va, c7 as ba, c8 as ya, c9 as Na, ca as Sa, cb as xa, _ as wa, a5 as Ca } from "./index-DZjcALSv.js";
|
|
3
|
+
import * as L from "react";
|
|
4
|
+
import Ns, { useState as S, useMemo as ne, useEffect as Da } from "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
import { u as La, A as Ea, V as Aa, S as Ma, U as ka } from "./schedule-dashboard-BFa0Uljc.js";
|
|
7
|
+
import { u as Oa } from "./use-role-aware-display-preferences-Dovp_VmV.js";
|
|
8
|
+
import { S as Je } from "./editor-action-buttons-CHoiNw7F.js";
|
|
9
|
+
/**
|
|
10
|
+
* @license lucide-react v0.453.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
const Ia = J("Glasses", [
|
|
16
|
+
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
17
|
+
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
18
|
+
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
19
|
+
["path", { d: "M2.5 13 5 7c.7-1.3 1.4-2 3-2", key: "1hm1gs" }],
|
|
20
|
+
["path", { d: "M21.5 13 19 7c-.7-1.3-1.5-2-3-2", key: "1r31ai" }]
|
|
21
|
+
]);
|
|
22
|
+
/**
|
|
23
|
+
* @license lucide-react v0.453.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/
|
|
28
|
+
const _a = J("Menu", [
|
|
29
|
+
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
30
|
+
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
31
|
+
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
32
|
+
]);
|
|
33
|
+
/**
|
|
34
|
+
* @license lucide-react v0.453.0 - ISC
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the ISC license.
|
|
37
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/
|
|
39
|
+
const Ta = J("Moon", [
|
|
40
|
+
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
41
|
+
]);
|
|
42
|
+
/**
|
|
43
|
+
* @license lucide-react v0.453.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/
|
|
48
|
+
const Ga = J("ShieldX", [
|
|
49
|
+
[
|
|
50
|
+
"path",
|
|
51
|
+
{
|
|
52
|
+
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
53
|
+
key: "oel41y"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
["path", { d: "m14.5 9.5-5 5", key: "17q4r4" }],
|
|
57
|
+
["path", { d: "m9.5 9.5 5 5", key: "18nt4w" }]
|
|
58
|
+
]);
|
|
59
|
+
/**
|
|
60
|
+
* @license lucide-react v0.453.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/
|
|
65
|
+
const Ra = J("Sun", [
|
|
66
|
+
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
67
|
+
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
68
|
+
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
69
|
+
["path", { d: "m4.93 4.93 1.41 1.41", key: "149t6j" }],
|
|
70
|
+
["path", { d: "m17.66 17.66 1.41 1.41", key: "ptbguv" }],
|
|
71
|
+
["path", { d: "M2 12h2", key: "1t8f8n" }],
|
|
72
|
+
["path", { d: "M20 12h2", key: "1q8mjw" }],
|
|
73
|
+
["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
|
|
74
|
+
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
|
|
75
|
+
]);
|
|
76
|
+
var Ae = { exports: {} }, ye = {};
|
|
77
|
+
/**
|
|
78
|
+
* @license React
|
|
79
|
+
* use-sync-external-store-shim.production.js
|
|
80
|
+
*
|
|
81
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the MIT license found in the
|
|
84
|
+
* LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/
|
|
86
|
+
var Xe;
|
|
87
|
+
function Pa() {
|
|
88
|
+
if (Xe) return ye;
|
|
89
|
+
Xe = 1;
|
|
90
|
+
var s = Ns;
|
|
91
|
+
function r(c, h) {
|
|
92
|
+
return c === h && (c !== 0 || 1 / c === 1 / h) || c !== c && h !== h;
|
|
93
|
+
}
|
|
94
|
+
var a = typeof Object.is == "function" ? Object.is : r, t = s.useState, o = s.useEffect, i = s.useLayoutEffect, u = s.useDebugValue;
|
|
95
|
+
function m(c, h) {
|
|
96
|
+
var p = h(), v = t({ inst: { value: p, getSnapshot: h } }), y = v[0].inst, N = v[1];
|
|
97
|
+
return i(
|
|
98
|
+
function() {
|
|
99
|
+
y.value = p, y.getSnapshot = h, f(y) && N({ inst: y });
|
|
100
|
+
},
|
|
101
|
+
[c, p, h]
|
|
102
|
+
), o(
|
|
103
|
+
function() {
|
|
104
|
+
return f(y) && N({ inst: y }), c(function() {
|
|
105
|
+
f(y) && N({ inst: y });
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
[c]
|
|
109
|
+
), u(p), p;
|
|
110
|
+
}
|
|
111
|
+
function f(c) {
|
|
112
|
+
var h = c.getSnapshot;
|
|
113
|
+
c = c.value;
|
|
114
|
+
try {
|
|
115
|
+
var p = h();
|
|
116
|
+
return !a(c, p);
|
|
117
|
+
} catch {
|
|
118
|
+
return !0;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function b(c, h) {
|
|
122
|
+
return h();
|
|
123
|
+
}
|
|
124
|
+
var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? b : m;
|
|
125
|
+
return ye.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : d, ye;
|
|
126
|
+
}
|
|
127
|
+
var Ne = {};
|
|
128
|
+
/**
|
|
129
|
+
* @license React
|
|
130
|
+
* use-sync-external-store-shim.development.js
|
|
131
|
+
*
|
|
132
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the MIT license found in the
|
|
135
|
+
* LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/
|
|
137
|
+
var Ye;
|
|
138
|
+
function Ua() {
|
|
139
|
+
return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
|
|
140
|
+
function s(p, v) {
|
|
141
|
+
return p === v && (p !== 0 || 1 / p === 1 / v) || p !== p && v !== v;
|
|
142
|
+
}
|
|
143
|
+
function r(p, v) {
|
|
144
|
+
d || o.startTransition === void 0 || (d = !0, console.error(
|
|
145
|
+
"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."
|
|
146
|
+
));
|
|
147
|
+
var y = v();
|
|
148
|
+
if (!c) {
|
|
149
|
+
var N = v();
|
|
150
|
+
i(y, N) || (console.error(
|
|
151
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
152
|
+
), c = !0);
|
|
153
|
+
}
|
|
154
|
+
N = u({
|
|
155
|
+
inst: { value: y, getSnapshot: v }
|
|
156
|
+
});
|
|
157
|
+
var E = N[0].inst, T = N[1];
|
|
158
|
+
return f(
|
|
159
|
+
function() {
|
|
160
|
+
E.value = y, E.getSnapshot = v, a(E) && T({ inst: E });
|
|
161
|
+
},
|
|
162
|
+
[p, y, v]
|
|
163
|
+
), m(
|
|
164
|
+
function() {
|
|
165
|
+
return a(E) && T({ inst: E }), p(function() {
|
|
166
|
+
a(E) && T({ inst: E });
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
[p]
|
|
170
|
+
), b(y), y;
|
|
171
|
+
}
|
|
172
|
+
function a(p) {
|
|
173
|
+
var v = p.getSnapshot;
|
|
174
|
+
p = p.value;
|
|
175
|
+
try {
|
|
176
|
+
var y = v();
|
|
177
|
+
return !i(p, y);
|
|
178
|
+
} catch {
|
|
179
|
+
return !0;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function t(p, v) {
|
|
183
|
+
return v();
|
|
184
|
+
}
|
|
185
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
186
|
+
var o = Ns, i = typeof Object.is == "function" ? Object.is : s, u = o.useState, m = o.useEffect, f = o.useLayoutEffect, b = o.useDebugValue, d = !1, c = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t : r;
|
|
187
|
+
Ne.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
188
|
+
}()), Ne;
|
|
189
|
+
}
|
|
190
|
+
process.env.NODE_ENV === "production" ? Ae.exports = Pa() : Ae.exports = Ua();
|
|
191
|
+
var Fa = Ae.exports;
|
|
192
|
+
function $a() {
|
|
193
|
+
const { setTheme: s } = Bs(), r = x(
|
|
194
|
+
(a) => a.actions.setDashboardTheme
|
|
195
|
+
);
|
|
196
|
+
return /* @__PURE__ */ n(es, { children: [
|
|
197
|
+
/* @__PURE__ */ e(ss, { asChild: !0, children: /* @__PURE__ */ n(M, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
|
|
198
|
+
/* @__PURE__ */ e(
|
|
199
|
+
Ra,
|
|
200
|
+
{
|
|
201
|
+
strokeWidth: 1.5,
|
|
202
|
+
className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ e(
|
|
206
|
+
Ta,
|
|
207
|
+
{
|
|
208
|
+
strokeWidth: 1.5,
|
|
209
|
+
className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
|
|
213
|
+
] }) }),
|
|
214
|
+
/* @__PURE__ */ n(as, { align: "end", children: [
|
|
215
|
+
/* @__PURE__ */ e(
|
|
216
|
+
ve,
|
|
217
|
+
{
|
|
218
|
+
onClick: () => {
|
|
219
|
+
s("light"), r("light");
|
|
220
|
+
},
|
|
221
|
+
children: "Light"
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
/* @__PURE__ */ e(
|
|
225
|
+
ve,
|
|
226
|
+
{
|
|
227
|
+
onClick: () => {
|
|
228
|
+
s("dark"), r("dark");
|
|
229
|
+
},
|
|
230
|
+
children: "Dark"
|
|
231
|
+
}
|
|
232
|
+
),
|
|
233
|
+
/* @__PURE__ */ e(
|
|
234
|
+
ve,
|
|
235
|
+
{
|
|
236
|
+
onClick: () => {
|
|
237
|
+
s("system"), r("system");
|
|
238
|
+
},
|
|
239
|
+
children: "System"
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
] })
|
|
243
|
+
] });
|
|
244
|
+
}
|
|
245
|
+
async function Va(s, r, a, t, o) {
|
|
246
|
+
if (!o)
|
|
247
|
+
return null;
|
|
248
|
+
const i = JSON.stringify(a), u = `${s}/v1/lens`;
|
|
249
|
+
return await ke(u, o, {
|
|
250
|
+
name: r,
|
|
251
|
+
template: i,
|
|
252
|
+
filterValues: t,
|
|
253
|
+
operation: "create"
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
async function Me(s, r, a) {
|
|
257
|
+
if (!a)
|
|
258
|
+
return null;
|
|
259
|
+
const { id: t, template: o, filterValues: i, isDefault: u, shared: m } = r, f = `${s}/v1/lens`;
|
|
260
|
+
return await ke(f, a, {
|
|
261
|
+
lensId: t,
|
|
262
|
+
template: o,
|
|
263
|
+
filterValues: i,
|
|
264
|
+
isDefault: u,
|
|
265
|
+
shared: m,
|
|
266
|
+
operation: "update"
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
async function ja(s, r, a) {
|
|
270
|
+
if (!a)
|
|
271
|
+
return null;
|
|
272
|
+
const t = `${s}/v1/lens`;
|
|
273
|
+
return await ke(t, a, {
|
|
274
|
+
operation: "delete",
|
|
275
|
+
lensId: r
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
function qa() {
|
|
279
|
+
const [s, r] = S(""), [a, t] = S(!1), o = x((N) => N.lenses), { setLenses: i, setSelectedLensId: u } = ts(), [m, f] = S(!1), [b, d] = S(!1), c = x((N) => N.dashboard), h = x((N) => N.filterValues), { authToken: p, tokenProps: v } = U();
|
|
280
|
+
async function y() {
|
|
281
|
+
f(!0);
|
|
282
|
+
const N = await Va(
|
|
283
|
+
v.apiServiceUrl,
|
|
284
|
+
s,
|
|
285
|
+
c,
|
|
286
|
+
h,
|
|
287
|
+
p == null ? void 0 : p.accessToken
|
|
288
|
+
);
|
|
289
|
+
N && (i([...o || [], N]), u(N.id), d(!1)), f(!1);
|
|
290
|
+
}
|
|
291
|
+
return /* @__PURE__ */ n(Oe, { open: b, onOpenChange: d, children: [
|
|
292
|
+
/* @__PURE__ */ e(Qs, { asChild: !0, children: /* @__PURE__ */ n(
|
|
293
|
+
M,
|
|
294
|
+
{
|
|
295
|
+
variant: "secondary",
|
|
296
|
+
className: "h-7 p-2",
|
|
297
|
+
size: "sm",
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ e(Ie, { className: "mr-2 h-4 w-4" }),
|
|
300
|
+
"Lens"
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
) }),
|
|
304
|
+
/* @__PURE__ */ n(_e, { className: "sm:max-w-[425px]", children: [
|
|
305
|
+
/* @__PURE__ */ n(Te, { children: [
|
|
306
|
+
/* @__PURE__ */ e(Ge, { children: "Create Lens" }),
|
|
307
|
+
/* @__PURE__ */ e(ns, { children: "Lenses are private by default and are only visible to you." })
|
|
308
|
+
] }),
|
|
309
|
+
/* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ n("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
310
|
+
/* @__PURE__ */ e(Se, { className: "text-right", children: "Name" }),
|
|
311
|
+
/* @__PURE__ */ e(
|
|
312
|
+
W,
|
|
313
|
+
{
|
|
314
|
+
value: s,
|
|
315
|
+
onChange: (N) => {
|
|
316
|
+
r(N.target.value);
|
|
317
|
+
},
|
|
318
|
+
id: "name",
|
|
319
|
+
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
320
|
+
}
|
|
321
|
+
)
|
|
322
|
+
] }) }),
|
|
323
|
+
a && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
324
|
+
/* @__PURE__ */ e(Ws, { children: /* @__PURE__ */ e(
|
|
325
|
+
M,
|
|
326
|
+
{
|
|
327
|
+
size: "sm",
|
|
328
|
+
variant: "outline",
|
|
329
|
+
type: "submit",
|
|
330
|
+
onClick: y,
|
|
331
|
+
disabled: m,
|
|
332
|
+
children: m ? "Creating..." : "Add"
|
|
333
|
+
}
|
|
334
|
+
) })
|
|
335
|
+
] })
|
|
336
|
+
] });
|
|
337
|
+
}
|
|
338
|
+
function za() {
|
|
339
|
+
const [s, r] = S(!1), a = x((c) => c.lenses), t = x((c) => c.selectedLensId), { setLenses: o, setSelectedLensId: i } = ts(), { authToken: u, tokenProps: m } = U();
|
|
340
|
+
async function f(c) {
|
|
341
|
+
i(c);
|
|
342
|
+
}
|
|
343
|
+
async function b(c) {
|
|
344
|
+
if (await ja(m.apiServiceUrl, c, u == null ? void 0 : u.accessToken)) {
|
|
345
|
+
const p = a == null ? void 0 : a.filter((v) => v.id !== c);
|
|
346
|
+
o(p || []), i("original");
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
async function d(c) {
|
|
350
|
+
const h = a == null ? void 0 : a.map((y) => y.id === c.id ? {
|
|
351
|
+
...y,
|
|
352
|
+
isDefault: !c.isDefault
|
|
353
|
+
} : {
|
|
354
|
+
...y,
|
|
355
|
+
isDefault: !1
|
|
356
|
+
});
|
|
357
|
+
o(h || []);
|
|
358
|
+
const p = {
|
|
359
|
+
...c,
|
|
360
|
+
isDefault: !c.isDefault
|
|
361
|
+
};
|
|
362
|
+
await Me(m.apiServiceUrl, p, u == null ? void 0 : u.accessToken);
|
|
363
|
+
const v = a == null ? void 0 : a.find((y) => y.isDefault);
|
|
364
|
+
if (v && v.id !== c.id) {
|
|
365
|
+
const y = {
|
|
366
|
+
...v,
|
|
367
|
+
isDefault: !1
|
|
368
|
+
};
|
|
369
|
+
await Me(m.apiServiceUrl, y, u == null ? void 0 : u.accessToken);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return /* @__PURE__ */ n(es, { open: s, onOpenChange: r, children: [
|
|
373
|
+
/* @__PURE__ */ e(ss, { asChild: !0, children: /* @__PURE__ */ e($, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Ia, { className: "h-4 w-4" }) }) }),
|
|
374
|
+
/* @__PURE__ */ n(as, { align: "end", className: "w-60", children: [
|
|
375
|
+
/* @__PURE__ */ e(Js, { className: "px-3", children: "Lenses" }),
|
|
376
|
+
/* @__PURE__ */ e(Xs, {}),
|
|
377
|
+
/* @__PURE__ */ n(
|
|
378
|
+
Ys,
|
|
379
|
+
{
|
|
380
|
+
value: t,
|
|
381
|
+
onValueChange: f,
|
|
382
|
+
children: [
|
|
383
|
+
/* @__PURE__ */ e(Qe, { value: "original", children: "Original" }),
|
|
384
|
+
a == null ? void 0 : a.map((c) => /* @__PURE__ */ n(
|
|
385
|
+
Qe,
|
|
386
|
+
{
|
|
387
|
+
className: "group flex justify-between gap-2",
|
|
388
|
+
value: c.id,
|
|
389
|
+
children: [
|
|
390
|
+
/* @__PURE__ */ e("p", { children: c.name }),
|
|
391
|
+
/* @__PURE__ */ n("span", { className: "flex items-center gap-3", children: [
|
|
392
|
+
/* @__PURE__ */ e(
|
|
393
|
+
rs,
|
|
394
|
+
{
|
|
395
|
+
onClick: (h) => {
|
|
396
|
+
h.preventDefault(), d(c);
|
|
397
|
+
},
|
|
398
|
+
className: ie(
|
|
399
|
+
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
400
|
+
{
|
|
401
|
+
invisible: !c.isDefault,
|
|
402
|
+
"text-green-500": c.isDefault
|
|
403
|
+
}
|
|
404
|
+
),
|
|
405
|
+
strokeWidth: 1.5
|
|
406
|
+
}
|
|
407
|
+
),
|
|
408
|
+
/* @__PURE__ */ e(
|
|
409
|
+
os,
|
|
410
|
+
{
|
|
411
|
+
onClick: (h) => {
|
|
412
|
+
h.preventDefault(), b(c.id);
|
|
413
|
+
},
|
|
414
|
+
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
415
|
+
strokeWidth: 1.5
|
|
416
|
+
}
|
|
417
|
+
)
|
|
418
|
+
] })
|
|
419
|
+
]
|
|
420
|
+
},
|
|
421
|
+
c.id
|
|
422
|
+
))
|
|
423
|
+
]
|
|
424
|
+
}
|
|
425
|
+
)
|
|
426
|
+
] })
|
|
427
|
+
] });
|
|
428
|
+
}
|
|
429
|
+
const Ha = async (s, r, a) => {
|
|
430
|
+
const t = `${s}/management/v1/groups`;
|
|
431
|
+
return await is(t, r, a);
|
|
432
|
+
}, Ka = async (s, r, a) => {
|
|
433
|
+
const t = `${s}/management/v1/groups/${a}`, o = await fetch(t, {
|
|
434
|
+
method: "DELETE",
|
|
435
|
+
headers: {
|
|
436
|
+
Authorization: `Bearer ${r}`
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
if (!o.ok) {
|
|
440
|
+
const i = await o.text();
|
|
441
|
+
throw new Error(i || "Failed to delete group");
|
|
442
|
+
}
|
|
443
|
+
}, Ba = async (s, r, a, t) => {
|
|
444
|
+
const o = `${s}/management/v1/groups/${a}/members`;
|
|
445
|
+
return await is(o, r, t);
|
|
446
|
+
}, Qa = async (s, r, a, t) => {
|
|
447
|
+
const o = `${s}/management/v1/groups/${a}/members`, i = await fetch(o, {
|
|
448
|
+
method: "DELETE",
|
|
449
|
+
headers: {
|
|
450
|
+
"Content-Type": "application/json",
|
|
451
|
+
Authorization: `Bearer ${r}`
|
|
452
|
+
},
|
|
453
|
+
body: JSON.stringify(t)
|
|
454
|
+
});
|
|
455
|
+
if (!i.ok) {
|
|
456
|
+
const u = await i.text();
|
|
457
|
+
throw new Error(u || "Failed to remove group members");
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
function Wa() {
|
|
461
|
+
const { authToken: s, tokenProps: r } = U(), a = le();
|
|
462
|
+
return ce({
|
|
463
|
+
mutationFn: (t) => Ha(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
464
|
+
onSuccess: () => {
|
|
465
|
+
a.invalidateQueries({ queryKey: ["groups"] }), A.success("Group created successfully");
|
|
466
|
+
},
|
|
467
|
+
onError: (t) => {
|
|
468
|
+
console.error("Failed to create group:", t), A.error("Failed to create group", {
|
|
469
|
+
description: t.message
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
function Ja() {
|
|
475
|
+
const { authToken: s, tokenProps: r } = U(), a = le();
|
|
476
|
+
return ce({
|
|
477
|
+
mutationFn: (t) => Ka(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
478
|
+
onSuccess: (t, o) => {
|
|
479
|
+
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", o] }), A.success("Group deleted successfully");
|
|
480
|
+
},
|
|
481
|
+
onError: (t) => {
|
|
482
|
+
console.error("Failed to delete group:", t), A.error("Failed to delete group", {
|
|
483
|
+
description: t.message
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
function Xa() {
|
|
489
|
+
const { authToken: s, tokenProps: r } = U(), a = le();
|
|
490
|
+
return ce({
|
|
491
|
+
mutationFn: ({
|
|
492
|
+
groupId: t,
|
|
493
|
+
data: o
|
|
494
|
+
}) => Ba(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, o),
|
|
495
|
+
onSuccess: (t, o) => {
|
|
496
|
+
a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
|
|
497
|
+
queryKey: ["group-members", o.groupId]
|
|
498
|
+
}), a.invalidateQueries({ queryKey: ["groups"] }), A.success("Members added successfully");
|
|
499
|
+
},
|
|
500
|
+
onError: (t) => {
|
|
501
|
+
console.error("Failed to add group members:", t), A.error("Failed to add members", {
|
|
502
|
+
description: t.message
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
function Ya() {
|
|
508
|
+
const { authToken: s, tokenProps: r } = U(), a = le();
|
|
509
|
+
return ce({
|
|
510
|
+
mutationFn: ({
|
|
511
|
+
groupId: t,
|
|
512
|
+
data: o
|
|
513
|
+
}) => Qa(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, o),
|
|
514
|
+
onSuccess: (t, o) => {
|
|
515
|
+
a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
|
|
516
|
+
queryKey: ["group-members", o.groupId]
|
|
517
|
+
}), a.invalidateQueries({ queryKey: ["groups"] }), A.success("Members removed successfully");
|
|
518
|
+
},
|
|
519
|
+
onError: (t) => {
|
|
520
|
+
console.error("Failed to remove group members:", t), A.error("Failed to remove members", {
|
|
521
|
+
description: t.message
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
function Za({
|
|
527
|
+
onSuccess: s,
|
|
528
|
+
tenantId: r,
|
|
529
|
+
isTenantUser: a
|
|
530
|
+
}) {
|
|
531
|
+
const [t, o] = S(""), [i, u] = S(""), [m, f] = S({}), b = Wa(), d = () => {
|
|
532
|
+
const h = {};
|
|
533
|
+
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", i && i.length > 200 && (h.description = "Description must be less than 200 characters"), f(h), Object.keys(h).length === 0;
|
|
534
|
+
};
|
|
535
|
+
return /* @__PURE__ */ n("form", { onSubmit: async (h) => {
|
|
536
|
+
if (h.preventDefault(), !d()) return;
|
|
537
|
+
const p = {
|
|
538
|
+
name: t.trim(),
|
|
539
|
+
description: i.trim() || void 0,
|
|
540
|
+
type: a ? "TENANT_GROUP" : "ORG_GROUP",
|
|
541
|
+
...a && r ? { tenantId: r } : {}
|
|
542
|
+
};
|
|
543
|
+
try {
|
|
544
|
+
await b.mutateAsync(p), o(""), u(""), f({}), s();
|
|
545
|
+
} catch (v) {
|
|
546
|
+
console.error("Failed to create group:", v);
|
|
547
|
+
}
|
|
548
|
+
}, className: "space-y-6", children: [
|
|
549
|
+
/* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
550
|
+
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
551
|
+
/* @__PURE__ */ n(Se, { htmlFor: "group-name", children: [
|
|
552
|
+
"Group Name ",
|
|
553
|
+
/* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
|
|
554
|
+
] }),
|
|
555
|
+
/* @__PURE__ */ e(
|
|
556
|
+
W,
|
|
557
|
+
{
|
|
558
|
+
id: "group-name",
|
|
559
|
+
placeholder: "e.g., Marketing Team, Engineering Squad",
|
|
560
|
+
value: t,
|
|
561
|
+
onChange: (h) => {
|
|
562
|
+
o(h.target.value), m.name && f((p) => ({ ...p, name: "" }));
|
|
563
|
+
},
|
|
564
|
+
className: m.name ? "border-destructive" : "",
|
|
565
|
+
disabled: b.isPending
|
|
566
|
+
}
|
|
567
|
+
),
|
|
568
|
+
m.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.name })
|
|
569
|
+
] }),
|
|
570
|
+
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
571
|
+
/* @__PURE__ */ n(Se, { htmlFor: "group-description", children: [
|
|
572
|
+
"Description",
|
|
573
|
+
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
|
|
574
|
+
] }),
|
|
575
|
+
/* @__PURE__ */ e(
|
|
576
|
+
Zs,
|
|
577
|
+
{
|
|
578
|
+
id: "group-description",
|
|
579
|
+
placeholder: "Describe the purpose of this group...",
|
|
580
|
+
value: i,
|
|
581
|
+
onChange: (h) => {
|
|
582
|
+
u(h.target.value), m.description && f((p) => ({ ...p, description: "" }));
|
|
583
|
+
},
|
|
584
|
+
className: m.description ? "border-destructive" : "",
|
|
585
|
+
disabled: b.isPending,
|
|
586
|
+
rows: 3
|
|
587
|
+
}
|
|
588
|
+
),
|
|
589
|
+
m.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.description }),
|
|
590
|
+
/* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground", children: [
|
|
591
|
+
i.length,
|
|
592
|
+
"/200 characters"
|
|
593
|
+
] })
|
|
594
|
+
] }),
|
|
595
|
+
/* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ n("div", { className: "flex gap-3", children: [
|
|
596
|
+
/* @__PURE__ */ e(ea, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
|
|
597
|
+
/* @__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." })
|
|
598
|
+
] }) })
|
|
599
|
+
] }),
|
|
600
|
+
/* @__PURE__ */ n("div", { className: "flex justify-end gap-3", children: [
|
|
601
|
+
/* @__PURE__ */ e(
|
|
602
|
+
M,
|
|
603
|
+
{
|
|
604
|
+
type: "button",
|
|
605
|
+
variant: "outline",
|
|
606
|
+
onClick: () => {
|
|
607
|
+
o(""), u(""), f({});
|
|
608
|
+
},
|
|
609
|
+
disabled: b.isPending,
|
|
610
|
+
children: "Clear"
|
|
611
|
+
}
|
|
612
|
+
),
|
|
613
|
+
/* @__PURE__ */ e(
|
|
614
|
+
M,
|
|
615
|
+
{
|
|
616
|
+
type: "submit",
|
|
617
|
+
disabled: b.isPending || !t.trim(),
|
|
618
|
+
children: b.isPending ? /* @__PURE__ */ n(_, { children: [
|
|
619
|
+
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
620
|
+
"Creating..."
|
|
621
|
+
] }) : /* @__PURE__ */ n(_, { children: [
|
|
622
|
+
/* @__PURE__ */ e(j, { className: "mr-2 h-4 w-4" }),
|
|
623
|
+
"Create Group"
|
|
624
|
+
] })
|
|
625
|
+
}
|
|
626
|
+
)
|
|
627
|
+
] })
|
|
628
|
+
] });
|
|
629
|
+
}
|
|
630
|
+
function et(s, r = []) {
|
|
631
|
+
let a = [];
|
|
632
|
+
function t(i, u) {
|
|
633
|
+
const m = L.createContext(u);
|
|
634
|
+
m.displayName = i + "Context";
|
|
635
|
+
const f = a.length;
|
|
636
|
+
a = [...a, u];
|
|
637
|
+
const b = (c) => {
|
|
638
|
+
var E;
|
|
639
|
+
const { scope: h, children: p, ...v } = c, y = ((E = h == null ? void 0 : h[s]) == null ? void 0 : E[f]) || m, N = L.useMemo(() => v, Object.values(v));
|
|
640
|
+
return /* @__PURE__ */ e(y.Provider, { value: N, children: p });
|
|
641
|
+
};
|
|
642
|
+
b.displayName = i + "Provider";
|
|
643
|
+
function d(c, h) {
|
|
644
|
+
var y;
|
|
645
|
+
const p = ((y = h == null ? void 0 : h[s]) == null ? void 0 : y[f]) || m, v = L.useContext(p);
|
|
646
|
+
if (v) return v;
|
|
647
|
+
if (u !== void 0) return u;
|
|
648
|
+
throw new Error(`\`${c}\` must be used within \`${i}\``);
|
|
649
|
+
}
|
|
650
|
+
return [b, d];
|
|
651
|
+
}
|
|
652
|
+
const o = () => {
|
|
653
|
+
const i = a.map((u) => L.createContext(u));
|
|
654
|
+
return function(m) {
|
|
655
|
+
const f = (m == null ? void 0 : m[s]) || i;
|
|
656
|
+
return L.useMemo(
|
|
657
|
+
() => ({ [`__scope${s}`]: { ...m, [s]: f } }),
|
|
658
|
+
[m, f]
|
|
659
|
+
);
|
|
660
|
+
};
|
|
661
|
+
};
|
|
662
|
+
return o.scopeName = s, [t, st(o, ...r)];
|
|
663
|
+
}
|
|
664
|
+
function st(...s) {
|
|
665
|
+
const r = s[0];
|
|
666
|
+
if (s.length === 1) return r;
|
|
667
|
+
const a = () => {
|
|
668
|
+
const t = s.map((o) => ({
|
|
669
|
+
useScope: o(),
|
|
670
|
+
scopeName: o.scopeName
|
|
671
|
+
}));
|
|
672
|
+
return function(i) {
|
|
673
|
+
const u = t.reduce((m, { useScope: f, scopeName: b }) => {
|
|
674
|
+
const c = f(i)[`__scope${b}`];
|
|
675
|
+
return { ...m, ...c };
|
|
676
|
+
}, {});
|
|
677
|
+
return L.useMemo(() => ({ [`__scope${r.scopeName}`]: u }), [u]);
|
|
678
|
+
};
|
|
679
|
+
};
|
|
680
|
+
return a.scopeName = r.scopeName, a;
|
|
681
|
+
}
|
|
682
|
+
var at = [
|
|
683
|
+
"a",
|
|
684
|
+
"button",
|
|
685
|
+
"div",
|
|
686
|
+
"form",
|
|
687
|
+
"h2",
|
|
688
|
+
"h3",
|
|
689
|
+
"img",
|
|
690
|
+
"input",
|
|
691
|
+
"label",
|
|
692
|
+
"li",
|
|
693
|
+
"nav",
|
|
694
|
+
"ol",
|
|
695
|
+
"p",
|
|
696
|
+
"select",
|
|
697
|
+
"span",
|
|
698
|
+
"svg",
|
|
699
|
+
"ul"
|
|
700
|
+
], Re = at.reduce((s, r) => {
|
|
701
|
+
const a = sa(`Primitive.${r}`), t = L.forwardRef((o, i) => {
|
|
702
|
+
const { asChild: u, ...m } = o, f = u ? a : r;
|
|
703
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(f, { ...m, ref: i });
|
|
704
|
+
});
|
|
705
|
+
return t.displayName = `Primitive.${r}`, { ...s, [r]: t };
|
|
706
|
+
}, {});
|
|
707
|
+
function tt() {
|
|
708
|
+
return Fa.useSyncExternalStore(
|
|
709
|
+
nt,
|
|
710
|
+
() => !0,
|
|
711
|
+
() => !1
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
function nt() {
|
|
715
|
+
return () => {
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
var Pe = "Avatar", [rt] = et(Pe), [ot, Ss] = rt(Pe), xs = L.forwardRef(
|
|
719
|
+
(s, r) => {
|
|
720
|
+
const { __scopeAvatar: a, ...t } = s, [o, i] = L.useState("idle");
|
|
721
|
+
return /* @__PURE__ */ e(
|
|
722
|
+
ot,
|
|
723
|
+
{
|
|
724
|
+
scope: a,
|
|
725
|
+
imageLoadingStatus: o,
|
|
726
|
+
onImageLoadingStatusChange: i,
|
|
727
|
+
children: /* @__PURE__ */ e(Re.span, { ...t, ref: r })
|
|
728
|
+
}
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
);
|
|
732
|
+
xs.displayName = Pe;
|
|
733
|
+
var ws = "AvatarImage", Cs = L.forwardRef(
|
|
734
|
+
(s, r) => {
|
|
735
|
+
const { __scopeAvatar: a, src: t, onLoadingStatusChange: o = () => {
|
|
736
|
+
}, ...i } = s, u = Ss(ws, a), m = it(t, i), f = aa((b) => {
|
|
737
|
+
o(b), u.onImageLoadingStatusChange(b);
|
|
738
|
+
});
|
|
739
|
+
return xe(() => {
|
|
740
|
+
m !== "idle" && f(m);
|
|
741
|
+
}, [m, f]), m === "loaded" ? /* @__PURE__ */ e(Re.img, { ...i, ref: r, src: t }) : null;
|
|
742
|
+
}
|
|
743
|
+
);
|
|
744
|
+
Cs.displayName = ws;
|
|
745
|
+
var Ds = "AvatarFallback", Ls = L.forwardRef(
|
|
746
|
+
(s, r) => {
|
|
747
|
+
const { __scopeAvatar: a, delayMs: t, ...o } = s, i = Ss(Ds, a), [u, m] = L.useState(t === void 0);
|
|
748
|
+
return L.useEffect(() => {
|
|
749
|
+
if (t !== void 0) {
|
|
750
|
+
const f = window.setTimeout(() => m(!0), t);
|
|
751
|
+
return () => window.clearTimeout(f);
|
|
752
|
+
}
|
|
753
|
+
}, [t]), u && i.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Re.span, { ...o, ref: r }) : null;
|
|
754
|
+
}
|
|
755
|
+
);
|
|
756
|
+
Ls.displayName = Ds;
|
|
757
|
+
function Ze(s, r) {
|
|
758
|
+
return s ? r ? (s.src !== r && (s.src = r), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
759
|
+
}
|
|
760
|
+
function it(s, { referrerPolicy: r, crossOrigin: a }) {
|
|
761
|
+
const t = tt(), o = L.useRef(null), i = t ? (o.current || (o.current = new window.Image()), o.current) : null, [u, m] = L.useState(
|
|
762
|
+
() => Ze(i, s)
|
|
763
|
+
);
|
|
764
|
+
return xe(() => {
|
|
765
|
+
m(Ze(i, s));
|
|
766
|
+
}, [i, s]), xe(() => {
|
|
767
|
+
const f = (c) => () => {
|
|
768
|
+
m(c);
|
|
769
|
+
};
|
|
770
|
+
if (!i) return;
|
|
771
|
+
const b = f("loaded"), d = f("error");
|
|
772
|
+
return i.addEventListener("load", b), i.addEventListener("error", d), r && (i.referrerPolicy = r), typeof a == "string" && (i.crossOrigin = a), () => {
|
|
773
|
+
i.removeEventListener("load", b), i.removeEventListener("error", d);
|
|
774
|
+
};
|
|
775
|
+
}, [i, a, r]), u;
|
|
776
|
+
}
|
|
777
|
+
var Es = xs, As = Cs, Ms = Ls;
|
|
778
|
+
const Ue = L.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
|
|
779
|
+
Es,
|
|
780
|
+
{
|
|
781
|
+
ref: a,
|
|
782
|
+
className: ie(
|
|
783
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
784
|
+
s
|
|
785
|
+
),
|
|
786
|
+
...r
|
|
787
|
+
}
|
|
788
|
+
));
|
|
789
|
+
Ue.displayName = Es.displayName;
|
|
790
|
+
const lt = L.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
|
|
791
|
+
As,
|
|
792
|
+
{
|
|
793
|
+
ref: a,
|
|
794
|
+
className: ie("aspect-square h-full w-full", s),
|
|
795
|
+
...r
|
|
796
|
+
}
|
|
797
|
+
));
|
|
798
|
+
lt.displayName = As.displayName;
|
|
799
|
+
const Fe = L.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
|
|
800
|
+
Ms,
|
|
801
|
+
{
|
|
802
|
+
ref: a,
|
|
803
|
+
className: ie(
|
|
804
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
805
|
+
s
|
|
806
|
+
),
|
|
807
|
+
...r
|
|
808
|
+
}
|
|
809
|
+
));
|
|
810
|
+
Fe.displayName = Ms.displayName;
|
|
811
|
+
function ct({
|
|
812
|
+
open: s,
|
|
813
|
+
onOpenChange: r,
|
|
814
|
+
group: a,
|
|
815
|
+
onUpdate: t
|
|
816
|
+
}) {
|
|
817
|
+
const [o, i] = S("members"), [u, m] = S(""), [f, b] = S([]), [d, c] = S([]), { data: h, isLoading: p, refetch: v } = ta(a.id), y = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: N, isLoading: E } = na({
|
|
818
|
+
type: y,
|
|
819
|
+
tenantId: a.tenantId || void 0,
|
|
820
|
+
active: !0,
|
|
821
|
+
limit: 100
|
|
822
|
+
}), T = Xa(), R = Ya(), k = (h == null ? void 0 : h.members) || [], P = ne(() => new Set(k.map((g) => g.userId)), [k]), G = ne(() => N.filter((g) => !P.has(g.id)), [N, P]), q = ne(() => {
|
|
823
|
+
if (!u) return G;
|
|
824
|
+
const g = u.toLowerCase();
|
|
825
|
+
return G.filter(
|
|
826
|
+
(D) => {
|
|
827
|
+
var O, F;
|
|
828
|
+
return ((O = D.name) == null ? void 0 : O.toLowerCase().includes(g)) || ((F = D.email) == null ? void 0 : F.toLowerCase().includes(g));
|
|
829
|
+
}
|
|
830
|
+
);
|
|
831
|
+
}, [G, u]), w = ne(() => {
|
|
832
|
+
if (!u) return k;
|
|
833
|
+
const g = u.toLowerCase();
|
|
834
|
+
return k.filter(
|
|
835
|
+
(D) => {
|
|
836
|
+
var O, F, X, Y;
|
|
837
|
+
return ((F = (O = D.user) == null ? void 0 : O.name) == null ? void 0 : F.toLowerCase().includes(g)) || ((Y = (X = D.user) == null ? void 0 : X.email) == null ? void 0 : Y.toLowerCase().includes(g));
|
|
838
|
+
}
|
|
839
|
+
);
|
|
840
|
+
}, [k, u]), z = async () => {
|
|
841
|
+
if (f.length !== 0)
|
|
842
|
+
try {
|
|
843
|
+
await T.mutateAsync({
|
|
844
|
+
groupId: a.id,
|
|
845
|
+
data: {
|
|
846
|
+
userIds: f,
|
|
847
|
+
userType: y === "tenant" ? "tenant" : "org"
|
|
848
|
+
}
|
|
849
|
+
}), b([]), i("members"), v(), t == null || t();
|
|
850
|
+
} catch (g) {
|
|
851
|
+
console.error("Failed to add members:", g);
|
|
852
|
+
}
|
|
853
|
+
}, de = async () => {
|
|
854
|
+
if (d.length !== 0)
|
|
855
|
+
try {
|
|
856
|
+
await R.mutateAsync({
|
|
857
|
+
groupId: a.id,
|
|
858
|
+
data: {
|
|
859
|
+
userIds: d
|
|
860
|
+
}
|
|
861
|
+
}), c([]), v(), t == null || t();
|
|
862
|
+
} catch (g) {
|
|
863
|
+
console.error("Failed to remove members:", g);
|
|
864
|
+
}
|
|
865
|
+
}, ue = (g) => {
|
|
866
|
+
b(
|
|
867
|
+
(D) => D.includes(g) ? D.filter((O) => O !== g) : [...D, g]
|
|
868
|
+
);
|
|
869
|
+
}, C = (g) => {
|
|
870
|
+
c(
|
|
871
|
+
(D) => D.includes(g) ? D.filter((O) => O !== g) : [...D, g]
|
|
872
|
+
);
|
|
873
|
+
};
|
|
874
|
+
return /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(Oe, { open: s, onOpenChange: r, children: /* @__PURE__ */ n(_e, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
875
|
+
/* @__PURE__ */ n(Te, { children: [
|
|
876
|
+
/* @__PURE__ */ e(Ge, { children: a.name }),
|
|
877
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ n("p", { className: "text-sm text-muted-foreground", children: [
|
|
878
|
+
k.length,
|
|
879
|
+
" ",
|
|
880
|
+
k.length === 1 ? "member" : "members"
|
|
881
|
+
] }) }),
|
|
882
|
+
/* @__PURE__ */ n("p", { id: "group-members-description", className: "sr-only", children: [
|
|
883
|
+
"Add or remove members from the ",
|
|
884
|
+
a.name,
|
|
885
|
+
" group"
|
|
886
|
+
] })
|
|
887
|
+
] }),
|
|
888
|
+
/* @__PURE__ */ n(ls, { value: o, onValueChange: (g) => {
|
|
889
|
+
i(g), m(""), c([]);
|
|
890
|
+
}, className: "mt-4", children: [
|
|
891
|
+
/* @__PURE__ */ n(cs, { className: "grid w-full grid-cols-2", children: [
|
|
892
|
+
/* @__PURE__ */ e(re, { value: "members", children: "Current Members" }),
|
|
893
|
+
/* @__PURE__ */ e(re, { value: "add", children: "Add Members" })
|
|
894
|
+
] }),
|
|
895
|
+
/* @__PURE__ */ n(oe, { value: "members", className: "mt-4 space-y-4", children: [
|
|
896
|
+
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
897
|
+
/* @__PURE__ */ e(we, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
898
|
+
/* @__PURE__ */ e(
|
|
899
|
+
W,
|
|
900
|
+
{
|
|
901
|
+
placeholder: "Search members...",
|
|
902
|
+
value: u,
|
|
903
|
+
onChange: (g) => m(g.target.value),
|
|
904
|
+
className: "pl-10"
|
|
905
|
+
}
|
|
906
|
+
)
|
|
907
|
+
] }),
|
|
908
|
+
/* @__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__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
909
|
+
/* @__PURE__ */ e(j, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
910
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: u ? "No members found" : "No members yet" }),
|
|
911
|
+
/* @__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' })
|
|
912
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: w.map((g) => /* @__PURE__ */ e(
|
|
913
|
+
dt,
|
|
914
|
+
{
|
|
915
|
+
member: g,
|
|
916
|
+
selected: d.includes(g.userId),
|
|
917
|
+
onToggle: () => C(g.userId)
|
|
918
|
+
},
|
|
919
|
+
g.id
|
|
920
|
+
)) }) }),
|
|
921
|
+
d.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
922
|
+
/* @__PURE__ */ n("span", { className: "text-sm text-muted-foreground", children: [
|
|
923
|
+
d.length,
|
|
924
|
+
" member",
|
|
925
|
+
d.length !== 1 ? "s" : "",
|
|
926
|
+
" selected"
|
|
927
|
+
] }),
|
|
928
|
+
/* @__PURE__ */ e(
|
|
929
|
+
M,
|
|
930
|
+
{
|
|
931
|
+
variant: "destructive",
|
|
932
|
+
size: "sm",
|
|
933
|
+
onClick: de,
|
|
934
|
+
disabled: R.isPending,
|
|
935
|
+
children: R.isPending ? /* @__PURE__ */ n(_, { children: [
|
|
936
|
+
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
937
|
+
"Removing..."
|
|
938
|
+
] }) : /* @__PURE__ */ n(_, { children: [
|
|
939
|
+
/* @__PURE__ */ e(ds, { className: "mr-2 h-4 w-4" }),
|
|
940
|
+
"Remove Selected"
|
|
941
|
+
] })
|
|
942
|
+
}
|
|
943
|
+
)
|
|
944
|
+
] })
|
|
945
|
+
] }),
|
|
946
|
+
/* @__PURE__ */ n(oe, { value: "add", className: "mt-4 space-y-4", children: [
|
|
947
|
+
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
948
|
+
/* @__PURE__ */ e(we, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
949
|
+
/* @__PURE__ */ e(
|
|
950
|
+
W,
|
|
951
|
+
{
|
|
952
|
+
placeholder: "Search users to add...",
|
|
953
|
+
value: u,
|
|
954
|
+
onChange: (g) => m(g.target.value),
|
|
955
|
+
className: "pl-10"
|
|
956
|
+
}
|
|
957
|
+
)
|
|
958
|
+
] }),
|
|
959
|
+
/* @__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)) }) : q.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
960
|
+
/* @__PURE__ */ e(Le, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
961
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
962
|
+
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : "All eligible users are already members" })
|
|
963
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: q.map((g) => /* @__PURE__ */ e(
|
|
964
|
+
ut,
|
|
965
|
+
{
|
|
966
|
+
user: g,
|
|
967
|
+
selected: f.includes(g.id),
|
|
968
|
+
onToggle: () => ue(g.id)
|
|
969
|
+
},
|
|
970
|
+
g.id
|
|
971
|
+
)) }) }),
|
|
972
|
+
f.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
973
|
+
/* @__PURE__ */ n("span", { className: "text-sm text-muted-foreground", children: [
|
|
974
|
+
f.length,
|
|
975
|
+
" user",
|
|
976
|
+
f.length !== 1 ? "s" : "",
|
|
977
|
+
" selected"
|
|
978
|
+
] }),
|
|
979
|
+
/* @__PURE__ */ e(
|
|
980
|
+
M,
|
|
981
|
+
{
|
|
982
|
+
onClick: z,
|
|
983
|
+
disabled: T.isPending,
|
|
984
|
+
children: T.isPending ? /* @__PURE__ */ n(_, { children: [
|
|
985
|
+
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
986
|
+
"Adding..."
|
|
987
|
+
] }) : /* @__PURE__ */ n(_, { children: [
|
|
988
|
+
/* @__PURE__ */ e(Le, { className: "mr-2 h-4 w-4" }),
|
|
989
|
+
"Add Members"
|
|
990
|
+
] })
|
|
991
|
+
}
|
|
992
|
+
)
|
|
993
|
+
] })
|
|
994
|
+
] })
|
|
995
|
+
] })
|
|
996
|
+
] }) }) });
|
|
997
|
+
}
|
|
998
|
+
function dt({
|
|
999
|
+
member: s,
|
|
1000
|
+
selected: r,
|
|
1001
|
+
onToggle: a
|
|
1002
|
+
}) {
|
|
1003
|
+
var o, i, u, m;
|
|
1004
|
+
const t = ((i = (o = s.user) == null ? void 0 : o.name) == null ? void 0 : i.split(" ").map((f) => f[0]).join("").toUpperCase()) || "?";
|
|
1005
|
+
return /* @__PURE__ */ n(
|
|
1006
|
+
"div",
|
|
1007
|
+
{
|
|
1008
|
+
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1009
|
+
onClick: a,
|
|
1010
|
+
children: [
|
|
1011
|
+
/* @__PURE__ */ e(us, { checked: r }),
|
|
1012
|
+
/* @__PURE__ */ e(Ue, { className: "h-8 w-8", children: /* @__PURE__ */ e(Fe, { className: "text-xs", children: t }) }),
|
|
1013
|
+
/* @__PURE__ */ n("div", { className: "flex-1", children: [
|
|
1014
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((u = s.user) == null ? void 0 : u.name) || "Unknown User" }),
|
|
1015
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (m = s.user) == null ? void 0 : m.email })
|
|
1016
|
+
] })
|
|
1017
|
+
]
|
|
1018
|
+
}
|
|
1019
|
+
);
|
|
1020
|
+
}
|
|
1021
|
+
function ut({
|
|
1022
|
+
user: s,
|
|
1023
|
+
selected: r,
|
|
1024
|
+
onToggle: a
|
|
1025
|
+
}) {
|
|
1026
|
+
var o;
|
|
1027
|
+
const t = ((o = s.name) == null ? void 0 : o.split(" ").map((i) => i[0]).join("").toUpperCase()) || "?";
|
|
1028
|
+
return /* @__PURE__ */ n(
|
|
1029
|
+
"div",
|
|
1030
|
+
{
|
|
1031
|
+
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1032
|
+
onClick: a,
|
|
1033
|
+
children: [
|
|
1034
|
+
/* @__PURE__ */ e(us, { checked: r }),
|
|
1035
|
+
/* @__PURE__ */ e(Ue, { className: "h-8 w-8", children: /* @__PURE__ */ e(Fe, { className: "text-xs", children: t }) }),
|
|
1036
|
+
/* @__PURE__ */ n("div", { className: "flex-1", children: [
|
|
1037
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s.name }),
|
|
1038
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s.email })
|
|
1039
|
+
] })
|
|
1040
|
+
]
|
|
1041
|
+
}
|
|
1042
|
+
);
|
|
1043
|
+
}
|
|
1044
|
+
function mt({
|
|
1045
|
+
open: s,
|
|
1046
|
+
onOpenChange: r
|
|
1047
|
+
}) {
|
|
1048
|
+
const [a, t] = S("groups"), [o, i] = S(""), [u, m] = S(null), [f, b] = S(!1), [d, c] = S(null), { tokenProps: h } = U(), { currentUser: p } = ms(), v = Ja(), y = (p == null ? void 0 : p.type) === "tenant", N = h == null ? void 0 : h.tenantId, { groups: E, isLoading: T, refetch: R } = ra({
|
|
1049
|
+
type: y ? "TENANT_GROUP" : "all",
|
|
1050
|
+
tenantId: y ? N : void 0,
|
|
1051
|
+
includeMembers: !1
|
|
1052
|
+
}), k = E.filter(
|
|
1053
|
+
(w) => {
|
|
1054
|
+
var z;
|
|
1055
|
+
return w.name.toLowerCase().includes(o.toLowerCase()) || ((z = w.description) == null ? void 0 : z.toLowerCase().includes(o.toLowerCase()));
|
|
1056
|
+
}
|
|
1057
|
+
), P = async () => {
|
|
1058
|
+
if (d)
|
|
1059
|
+
try {
|
|
1060
|
+
await v.mutateAsync(d.id), c(null), R();
|
|
1061
|
+
} catch (w) {
|
|
1062
|
+
console.error("Failed to delete group:", w);
|
|
1063
|
+
}
|
|
1064
|
+
}, G = (w) => {
|
|
1065
|
+
m(w), b(!0);
|
|
1066
|
+
}, q = () => {
|
|
1067
|
+
t("groups"), R();
|
|
1068
|
+
};
|
|
1069
|
+
return /* @__PURE__ */ n(_, { children: [
|
|
1070
|
+
/* @__PURE__ */ e(Oe, { open: s, onOpenChange: r, children: /* @__PURE__ */ n(_e, { className: "max-w-4xl max-h-[80vh]", children: [
|
|
1071
|
+
/* @__PURE__ */ n(Te, { children: [
|
|
1072
|
+
/* @__PURE__ */ n(Ge, { className: "flex items-center gap-2", children: [
|
|
1073
|
+
/* @__PURE__ */ e(j, { className: "h-5 w-5" }),
|
|
1074
|
+
"Group Management"
|
|
1075
|
+
] }),
|
|
1076
|
+
/* @__PURE__ */ e(ns, { children: "Manage your groups, create new groups, and control group membership" })
|
|
1077
|
+
] }),
|
|
1078
|
+
/* @__PURE__ */ n(ls, { value: a, onValueChange: t, className: "mt-4", children: [
|
|
1079
|
+
/* @__PURE__ */ n(cs, { className: "grid w-full grid-cols-2", children: [
|
|
1080
|
+
/* @__PURE__ */ n(re, { value: "groups", className: "flex items-center gap-2", children: [
|
|
1081
|
+
/* @__PURE__ */ e(j, { className: "h-4 w-4" }),
|
|
1082
|
+
"Groups"
|
|
1083
|
+
] }),
|
|
1084
|
+
/* @__PURE__ */ n(re, { value: "create", className: "flex items-center gap-2", children: [
|
|
1085
|
+
/* @__PURE__ */ e(Ie, { className: "h-4 w-4" }),
|
|
1086
|
+
"Create Group"
|
|
1087
|
+
] })
|
|
1088
|
+
] }),
|
|
1089
|
+
/* @__PURE__ */ e(oe, { value: "groups", className: "mt-4", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
1090
|
+
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
1091
|
+
/* @__PURE__ */ e(we, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
1092
|
+
/* @__PURE__ */ e(
|
|
1093
|
+
W,
|
|
1094
|
+
{
|
|
1095
|
+
placeholder: "Search groups...",
|
|
1096
|
+
value: o,
|
|
1097
|
+
onChange: (w) => i(w.target.value),
|
|
1098
|
+
className: "pl-10"
|
|
1099
|
+
}
|
|
1100
|
+
)
|
|
1101
|
+
] }),
|
|
1102
|
+
/* @__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__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
1103
|
+
/* @__PURE__ */ e(j, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
1104
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
|
|
1105
|
+
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: o ? "Try a different search" : "Create your first group to get started" })
|
|
1106
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: k.map((w) => /* @__PURE__ */ e(
|
|
1107
|
+
ht,
|
|
1108
|
+
{
|
|
1109
|
+
group: w,
|
|
1110
|
+
onManageMembers: () => G(w),
|
|
1111
|
+
onDelete: () => c(w),
|
|
1112
|
+
currentUserId: p == null ? void 0 : p.id
|
|
1113
|
+
},
|
|
1114
|
+
w.id
|
|
1115
|
+
)) }) })
|
|
1116
|
+
] }) }),
|
|
1117
|
+
/* @__PURE__ */ e(oe, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1118
|
+
Za,
|
|
1119
|
+
{
|
|
1120
|
+
onSuccess: q,
|
|
1121
|
+
tenantId: N,
|
|
1122
|
+
isTenantUser: y
|
|
1123
|
+
}
|
|
1124
|
+
) })
|
|
1125
|
+
] })
|
|
1126
|
+
] }) }),
|
|
1127
|
+
u && /* @__PURE__ */ e(
|
|
1128
|
+
ct,
|
|
1129
|
+
{
|
|
1130
|
+
open: f,
|
|
1131
|
+
onOpenChange: b,
|
|
1132
|
+
group: u,
|
|
1133
|
+
onUpdate: () => R()
|
|
1134
|
+
}
|
|
1135
|
+
),
|
|
1136
|
+
/* @__PURE__ */ e(
|
|
1137
|
+
hs,
|
|
1138
|
+
{
|
|
1139
|
+
open: !!d,
|
|
1140
|
+
onOpenChange: () => c(null),
|
|
1141
|
+
children: /* @__PURE__ */ n(ps, { children: [
|
|
1142
|
+
/* @__PURE__ */ n(fs, { children: [
|
|
1143
|
+
/* @__PURE__ */ e(gs, { children: "Delete Group" }),
|
|
1144
|
+
/* @__PURE__ */ n(vs, { children: [
|
|
1145
|
+
'Are you sure you want to delete "',
|
|
1146
|
+
d == null ? void 0 : d.name,
|
|
1147
|
+
'"? This action cannot be undone and will remove all members from the group.'
|
|
1148
|
+
] })
|
|
1149
|
+
] }),
|
|
1150
|
+
/* @__PURE__ */ n(bs, { children: [
|
|
1151
|
+
/* @__PURE__ */ e(ys, { children: "Cancel" }),
|
|
1152
|
+
/* @__PURE__ */ e(
|
|
1153
|
+
Ee,
|
|
1154
|
+
{
|
|
1155
|
+
onClick: P,
|
|
1156
|
+
disabled: v.isPending,
|
|
1157
|
+
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1158
|
+
children: v.isPending ? /* @__PURE__ */ n(_, { children: [
|
|
1159
|
+
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1160
|
+
"Deleting..."
|
|
1161
|
+
] }) : "Delete Group"
|
|
1162
|
+
}
|
|
1163
|
+
)
|
|
1164
|
+
] })
|
|
1165
|
+
] })
|
|
1166
|
+
}
|
|
1167
|
+
)
|
|
1168
|
+
] });
|
|
1169
|
+
}
|
|
1170
|
+
function ht({
|
|
1171
|
+
group: s,
|
|
1172
|
+
onManageMembers: r,
|
|
1173
|
+
onDelete: a,
|
|
1174
|
+
currentUserId: t
|
|
1175
|
+
}) {
|
|
1176
|
+
const o = s.createdBy === t;
|
|
1177
|
+
return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-3", children: [
|
|
1178
|
+
/* @__PURE__ */ n("div", { className: "flex-1 space-y-2", children: [
|
|
1179
|
+
/* @__PURE__ */ n("div", { children: [
|
|
1180
|
+
/* @__PURE__ */ e("h4", { className: "font-medium", children: s.name }),
|
|
1181
|
+
s.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mt-1", children: s.description })
|
|
1182
|
+
] }),
|
|
1183
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
|
|
1184
|
+
/* @__PURE__ */ n("span", { className: "flex items-center gap-1", children: [
|
|
1185
|
+
/* @__PURE__ */ e(j, { className: "h-3 w-3" }),
|
|
1186
|
+
s.memberCount,
|
|
1187
|
+
" ",
|
|
1188
|
+
s.memberCount === 1 ? "member" : "members"
|
|
1189
|
+
] }),
|
|
1190
|
+
/* @__PURE__ */ n("span", { children: [
|
|
1191
|
+
"Created ",
|
|
1192
|
+
oa(new Date(s.createdAt), "MMM d, yyyy")
|
|
1193
|
+
] })
|
|
1194
|
+
] })
|
|
1195
|
+
] }),
|
|
1196
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
|
|
1197
|
+
/* @__PURE__ */ e(
|
|
1198
|
+
M,
|
|
1199
|
+
{
|
|
1200
|
+
variant: "ghost",
|
|
1201
|
+
size: "sm",
|
|
1202
|
+
onClick: r,
|
|
1203
|
+
title: "Manage members",
|
|
1204
|
+
children: /* @__PURE__ */ e(Le, { className: "h-4 w-4" })
|
|
1205
|
+
}
|
|
1206
|
+
),
|
|
1207
|
+
o && /* @__PURE__ */ e(
|
|
1208
|
+
M,
|
|
1209
|
+
{
|
|
1210
|
+
variant: "ghost",
|
|
1211
|
+
size: "sm",
|
|
1212
|
+
onClick: a,
|
|
1213
|
+
title: "Delete group",
|
|
1214
|
+
className: "text-destructive hover:text-destructive",
|
|
1215
|
+
children: /* @__PURE__ */ e(ds, { className: "h-4 w-4" })
|
|
1216
|
+
}
|
|
1217
|
+
)
|
|
1218
|
+
] })
|
|
1219
|
+
] }) });
|
|
1220
|
+
}
|
|
1221
|
+
function xt() {
|
|
1222
|
+
var He, Ke, Be;
|
|
1223
|
+
const {
|
|
1224
|
+
authToken: s,
|
|
1225
|
+
tokenProps: r,
|
|
1226
|
+
id: a
|
|
1227
|
+
} = U(), { isLocalDev: t } = ia(), { permissions: o } = Oa(), i = la(), { isLoading: u } = ca();
|
|
1228
|
+
x((l) => l.theme);
|
|
1229
|
+
const m = x((l) => l.lenses), f = x((l) => l.selectedLensId), b = m == null ? void 0 : m.find((l) => l.id === f), d = x((l) => l.dashboard);
|
|
1230
|
+
x((l) => l.selectedSheetId);
|
|
1231
|
+
const c = x(
|
|
1232
|
+
(l) => l.isDashboardEditing
|
|
1233
|
+
), { setDashboardTitle: h } = x((l) => l.actions), [p, v] = S(!1), [y, N] = S(!1), [E, T] = S(!1), [R, k] = S(!1), [P, G] = S(null), [q, w] = S(!1), z = x((l) => l.isDashboardPanelOpen), de = x(
|
|
1234
|
+
(l) => l.actions.setIsDashboardPanelOpen
|
|
1235
|
+
), ue = x((l) => l.filterValues), C = x((l) => l.isVisualEditing);
|
|
1236
|
+
We((l) => l.card);
|
|
1237
|
+
const g = te(
|
|
1238
|
+
(l) => l.selectedDashboard
|
|
1239
|
+
), D = te(
|
|
1240
|
+
(l) => l.initialDashboard
|
|
1241
|
+
);
|
|
1242
|
+
te((l) => l.selectedVisual), x((l) => l.selectedFrameId), We((l) => l.frame);
|
|
1243
|
+
const O = g ? (Ke = g == null ? void 0 : g.permissions) == null ? void 0 : Ke.canEdit : (He = D == null ? void 0 : D.permissions) == null ? void 0 : He.canEdit, F = x((l) => l.showFilters), X = da((l) => l.setPanelOpen), Y = x(
|
|
1244
|
+
(l) => l.showDashboardJSON
|
|
1245
|
+
), me = x((l) => l.onSaveFunction), ks = x(
|
|
1246
|
+
(l) => l.actions.setShowFilters
|
|
1247
|
+
), { setIsDashboardEditing: $e, setShowDashboardJSON: Ve } = x(
|
|
1248
|
+
(l) => l.actions
|
|
1249
|
+
), { setInitialDashboard: je, clearSelectedDashboard: Os } = te(
|
|
1250
|
+
(l) => l.actions
|
|
1251
|
+
), { resources: Z } = ua(be.DASHBOARD), { currentUser: Is } = ms(), _s = ma(Is), H = g || D, qe = H ? {
|
|
1252
|
+
id: H.id,
|
|
1253
|
+
title: (d == null ? void 0 : d.title) || H.title || "Dashboard"
|
|
1254
|
+
} : null, { handleAddNewFrame: Ts } = ha(), [K, he] = S(!1), [Gs, ee] = S(!1), se = pa(be.DASHBOARD), [B, pe] = S(
|
|
1255
|
+
null
|
|
1256
|
+
), Rs = async (l, I) => {
|
|
1257
|
+
if (!(d != null && d.id)) {
|
|
1258
|
+
console.log("No dashboard ID found");
|
|
1259
|
+
return;
|
|
1260
|
+
}
|
|
1261
|
+
console.log("Updating dashboard title:", {
|
|
1262
|
+
dashboardId: d.id,
|
|
1263
|
+
newTitle: l,
|
|
1264
|
+
previousTitle: I
|
|
1265
|
+
}), se.mutate(
|
|
1266
|
+
{
|
|
1267
|
+
resourceId: d.id,
|
|
1268
|
+
data: { title: l }
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
onSuccess: () => {
|
|
1272
|
+
console.log("Dashboard title updated successfully"), A.success("Dashboard title updated");
|
|
1273
|
+
},
|
|
1274
|
+
onError: (Q) => {
|
|
1275
|
+
console.error("Failed to update dashboard title:", Q), A.error("Failed to update dashboard title"), h(I);
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
);
|
|
1279
|
+
};
|
|
1280
|
+
Da(() => {
|
|
1281
|
+
if (Z && Z.length > 0) {
|
|
1282
|
+
const l = d == null ? void 0 : d.id;
|
|
1283
|
+
if (l) {
|
|
1284
|
+
const I = Z.find(
|
|
1285
|
+
(Q) => Q.id === l
|
|
1286
|
+
);
|
|
1287
|
+
I && je(I);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
}, [Z, d == null ? void 0 : d.id, je]);
|
|
1291
|
+
const ae = r.orgUserId || r.tenantId, Ps = c && !C && ae && O, { setDashboard: Us } = x((l) => l.actions), Fs = () => {
|
|
1292
|
+
$e(!0);
|
|
1293
|
+
}, fe = () => {
|
|
1294
|
+
$e(!1), Ve(!1), pe(null);
|
|
1295
|
+
};
|
|
1296
|
+
La(
|
|
1297
|
+
c,
|
|
1298
|
+
d,
|
|
1299
|
+
B,
|
|
1300
|
+
(l) => pe(l)
|
|
1301
|
+
);
|
|
1302
|
+
const $s = () => B ? JSON.stringify(d) !== JSON.stringify(B) : !1, Vs = () => {
|
|
1303
|
+
$s() ? ee(!0) : fe();
|
|
1304
|
+
}, js = async () => {
|
|
1305
|
+
await ge({ closeAfterSave: !0 });
|
|
1306
|
+
}, qs = () => {
|
|
1307
|
+
B && Us(B), fe(), ee(!1);
|
|
1308
|
+
};
|
|
1309
|
+
async function ge(l) {
|
|
1310
|
+
const I = (l == null ? void 0 : l.closeAfterSave) ?? q;
|
|
1311
|
+
w(I), I && ee(!1);
|
|
1312
|
+
const Q = Ca(d);
|
|
1313
|
+
k(!0), G(null), he(!0);
|
|
1314
|
+
const Ks = {
|
|
1315
|
+
template: d
|
|
1316
|
+
};
|
|
1317
|
+
se.mutate(
|
|
1318
|
+
{
|
|
1319
|
+
resourceId: d.id,
|
|
1320
|
+
data: Ks
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
onSuccess: () => {
|
|
1324
|
+
he(!1), A.success("Dashboard saved!"), pe(Q), k(!1), w(!1), I && fe();
|
|
1325
|
+
},
|
|
1326
|
+
onError: () => {
|
|
1327
|
+
he(!1), G("Failed to save dashboard. Please try again."), A.error("Failed to save dashboard");
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
);
|
|
1331
|
+
}
|
|
1332
|
+
async function zs() {
|
|
1333
|
+
if (v(!0), !f || !b) return;
|
|
1334
|
+
const l = JSON.stringify(d), I = {
|
|
1335
|
+
...b,
|
|
1336
|
+
template: l,
|
|
1337
|
+
filterValues: ue
|
|
1338
|
+
};
|
|
1339
|
+
await Me(
|
|
1340
|
+
r.apiServiceUrl,
|
|
1341
|
+
I,
|
|
1342
|
+
s == null ? void 0 : s.accessToken
|
|
1343
|
+
), A.success("Lens saved"), me == null || me(d), v(!1);
|
|
1344
|
+
}
|
|
1345
|
+
const ze = (b == null ? void 0 : b.name) || d.title;
|
|
1346
|
+
se.isPending && console.log("Title during update:", {
|
|
1347
|
+
title: ze,
|
|
1348
|
+
dashboardStateTitle: d.title,
|
|
1349
|
+
dashboardId: d == null ? void 0 : d.id,
|
|
1350
|
+
currentLensName: b == null ? void 0 : b.name
|
|
1351
|
+
});
|
|
1352
|
+
const Hs = r.orgUserId || r.tenantId && r.endUserId && r.endUserEmail;
|
|
1353
|
+
return /* @__PURE__ */ n(
|
|
1354
|
+
"div",
|
|
1355
|
+
{
|
|
1356
|
+
className: "flex h-11 shrink-0 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-2",
|
|
1357
|
+
role: "dashboard-controls",
|
|
1358
|
+
children: [
|
|
1359
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1360
|
+
Hs && /* @__PURE__ */ n(_, { children: [
|
|
1361
|
+
/* @__PURE__ */ e(
|
|
1362
|
+
$,
|
|
1363
|
+
{
|
|
1364
|
+
"aria-label": "Manage Dashboards",
|
|
1365
|
+
tooltip: "Manage Dashboards",
|
|
1366
|
+
onClick: () => {
|
|
1367
|
+
de(!z);
|
|
1368
|
+
},
|
|
1369
|
+
className: "h-7 p-2",
|
|
1370
|
+
children: /* @__PURE__ */ e(_a, { className: "h-4 w-4" })
|
|
1371
|
+
}
|
|
1372
|
+
),
|
|
1373
|
+
i && !C && /* @__PURE__ */ e(
|
|
1374
|
+
$,
|
|
1375
|
+
{
|
|
1376
|
+
"aria-label": "Dashboard Hub",
|
|
1377
|
+
tooltip: "Dashboard Hub",
|
|
1378
|
+
onClick: () => Os(),
|
|
1379
|
+
className: "h-7 p-2",
|
|
1380
|
+
children: /* @__PURE__ */ e(rs, { className: "h-4 w-4" })
|
|
1381
|
+
}
|
|
1382
|
+
)
|
|
1383
|
+
] }),
|
|
1384
|
+
!C && i && (u ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1385
|
+
/* @__PURE__ */ e(V, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
|
|
1386
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
|
|
1387
|
+
] }) : /* @__PURE__ */ e(
|
|
1388
|
+
fa,
|
|
1389
|
+
{
|
|
1390
|
+
value: ze || "Untitled Dashboard",
|
|
1391
|
+
onSave: (l) => {
|
|
1392
|
+
console.log("EditableText onSave called:", {
|
|
1393
|
+
newTitle: l,
|
|
1394
|
+
canEditDashboard: O,
|
|
1395
|
+
dashboardId: d == null ? void 0 : d.id
|
|
1396
|
+
});
|
|
1397
|
+
const I = (d == null ? void 0 : d.title) || "";
|
|
1398
|
+
h(l), Rs(l, I);
|
|
1399
|
+
},
|
|
1400
|
+
isEditable: O && !b,
|
|
1401
|
+
displayClassName: "text-sm font-medium",
|
|
1402
|
+
inputClassName: "text-sm font-medium",
|
|
1403
|
+
placeholder: "Dashboard Title",
|
|
1404
|
+
isPending: se.isPending
|
|
1405
|
+
}
|
|
1406
|
+
))
|
|
1407
|
+
] }),
|
|
1408
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1409
|
+
C && /* @__PURE__ */ n(_, { children: [
|
|
1410
|
+
/* @__PURE__ */ e(Ea, { className: "mr-2" }),
|
|
1411
|
+
/* @__PURE__ */ e(Aa, { className: "h-7" })
|
|
1412
|
+
] }),
|
|
1413
|
+
t && !C && /* @__PURE__ */ n(_, { children: [
|
|
1414
|
+
/* @__PURE__ */ e(
|
|
1415
|
+
$,
|
|
1416
|
+
{
|
|
1417
|
+
tooltip: "Copy Token",
|
|
1418
|
+
onClick: () => {
|
|
1419
|
+
var l;
|
|
1420
|
+
s != null && s.accessToken && ((l = navigator == null ? void 0 : navigator.clipboard) != null && l.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"));
|
|
1421
|
+
},
|
|
1422
|
+
className: "h-7 p-2",
|
|
1423
|
+
children: /* @__PURE__ */ e(ga, { className: "h-4 w-4" })
|
|
1424
|
+
}
|
|
1425
|
+
),
|
|
1426
|
+
/* @__PURE__ */ e(
|
|
1427
|
+
$,
|
|
1428
|
+
{
|
|
1429
|
+
tooltip: "Invalidate Token",
|
|
1430
|
+
onClick: () => va(r.apiServiceUrl),
|
|
1431
|
+
className: "h-7 p-2",
|
|
1432
|
+
children: /* @__PURE__ */ e(Ga, { className: "h-4 w-4" })
|
|
1433
|
+
}
|
|
1434
|
+
)
|
|
1435
|
+
] }),
|
|
1436
|
+
!C && i && /* @__PURE__ */ e(ba, {}),
|
|
1437
|
+
!C && i && /* @__PURE__ */ e(Ma, {}),
|
|
1438
|
+
!C && i && _s && /* @__PURE__ */ e(
|
|
1439
|
+
$,
|
|
1440
|
+
{
|
|
1441
|
+
tooltip: "Manage Groups",
|
|
1442
|
+
onClick: () => T(!0),
|
|
1443
|
+
className: "h-7 p-2",
|
|
1444
|
+
children: /* @__PURE__ */ e(j, { className: "h-4 w-4" })
|
|
1445
|
+
}
|
|
1446
|
+
),
|
|
1447
|
+
!C && i && ((Be = H == null ? void 0 : H.permissions) == null ? void 0 : Be.canShare) && /* @__PURE__ */ e(
|
|
1448
|
+
$,
|
|
1449
|
+
{
|
|
1450
|
+
tooltip: "Share Dashboard",
|
|
1451
|
+
onClick: () => N(!0),
|
|
1452
|
+
className: "h-7 p-2",
|
|
1453
|
+
children: /* @__PURE__ */ e(ya, { className: "h-4 w-4" })
|
|
1454
|
+
}
|
|
1455
|
+
),
|
|
1456
|
+
!F && !C && c && o.canUseFilters && i && /* @__PURE__ */ e(
|
|
1457
|
+
M,
|
|
1458
|
+
{
|
|
1459
|
+
className: "h-7 p-2",
|
|
1460
|
+
variant: "outline",
|
|
1461
|
+
onClick: () => {
|
|
1462
|
+
X("dashboard", !1), ks(!0);
|
|
1463
|
+
},
|
|
1464
|
+
size: "sm",
|
|
1465
|
+
children: /* @__PURE__ */ e(Na, { className: "h-4 w-4" })
|
|
1466
|
+
}
|
|
1467
|
+
),
|
|
1468
|
+
c && !C && ae && t && i && /* @__PURE__ */ e(qa, {}),
|
|
1469
|
+
!C && ae && t && i && /* @__PURE__ */ e(za, {}),
|
|
1470
|
+
c && !C && ae && b && t && i && /* @__PURE__ */ n(
|
|
1471
|
+
M,
|
|
1472
|
+
{
|
|
1473
|
+
className: "h-7 p-2",
|
|
1474
|
+
variant: "secondary",
|
|
1475
|
+
disabled: p,
|
|
1476
|
+
onClick: zs,
|
|
1477
|
+
size: "sm",
|
|
1478
|
+
children: [
|
|
1479
|
+
/* @__PURE__ */ e(Je, { className: "mr-2 h-4 w-4" }),
|
|
1480
|
+
"Save Lens"
|
|
1481
|
+
]
|
|
1482
|
+
}
|
|
1483
|
+
),
|
|
1484
|
+
c && !C && i && /* @__PURE__ */ n(
|
|
1485
|
+
M,
|
|
1486
|
+
{
|
|
1487
|
+
variant: "outline",
|
|
1488
|
+
className: "h-7 p-2",
|
|
1489
|
+
size: "sm",
|
|
1490
|
+
disabled: !c,
|
|
1491
|
+
onClick: () => Ts(),
|
|
1492
|
+
children: [
|
|
1493
|
+
/* @__PURE__ */ e(Ie, { className: "mr-2 h-4 w-4" }),
|
|
1494
|
+
"Visual"
|
|
1495
|
+
]
|
|
1496
|
+
}
|
|
1497
|
+
),
|
|
1498
|
+
!C && !c && O && i && /* @__PURE__ */ n(
|
|
1499
|
+
M,
|
|
1500
|
+
{
|
|
1501
|
+
variant: "outline",
|
|
1502
|
+
className: "h-7 p-2",
|
|
1503
|
+
onClick: Fs,
|
|
1504
|
+
size: "sm",
|
|
1505
|
+
children: [
|
|
1506
|
+
/* @__PURE__ */ e(Sa, { className: "mr-2 h-4 w-4" }),
|
|
1507
|
+
"Edit"
|
|
1508
|
+
]
|
|
1509
|
+
}
|
|
1510
|
+
),
|
|
1511
|
+
Ps && i && /* @__PURE__ */ n(
|
|
1512
|
+
M,
|
|
1513
|
+
{
|
|
1514
|
+
className: "h-7 p-2",
|
|
1515
|
+
disabled: K,
|
|
1516
|
+
onClick: () => ge(),
|
|
1517
|
+
size: "sm",
|
|
1518
|
+
children: [
|
|
1519
|
+
K ? /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Je, { className: "mr-2 h-4 w-4" }),
|
|
1520
|
+
K ? "Saving..." : "Save"
|
|
1521
|
+
]
|
|
1522
|
+
}
|
|
1523
|
+
),
|
|
1524
|
+
!C && c && t && i && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
|
|
1525
|
+
M,
|
|
1526
|
+
{
|
|
1527
|
+
className: "h-7 p-2",
|
|
1528
|
+
onClick: () => Ve(!Y),
|
|
1529
|
+
size: "sm",
|
|
1530
|
+
variant: "ghost",
|
|
1531
|
+
children: /* @__PURE__ */ e(xa, { className: "h-4 w-4" })
|
|
1532
|
+
}
|
|
1533
|
+
) }),
|
|
1534
|
+
!C && t && /* @__PURE__ */ e($a, {}),
|
|
1535
|
+
c && !C && i && /* @__PURE__ */ n(
|
|
1536
|
+
M,
|
|
1537
|
+
{
|
|
1538
|
+
variant: "outline",
|
|
1539
|
+
className: "h-7 p-2",
|
|
1540
|
+
onClick: Vs,
|
|
1541
|
+
children: [
|
|
1542
|
+
/* @__PURE__ */ e(os, { className: "mr-2 h-4 w-4" }),
|
|
1543
|
+
"Close"
|
|
1544
|
+
]
|
|
1545
|
+
}
|
|
1546
|
+
),
|
|
1547
|
+
y && qe && /* @__PURE__ */ e(
|
|
1548
|
+
wa,
|
|
1549
|
+
{
|
|
1550
|
+
resource: qe,
|
|
1551
|
+
resourceType: be.DASHBOARD,
|
|
1552
|
+
onClose: () => N(!1)
|
|
1553
|
+
}
|
|
1554
|
+
),
|
|
1555
|
+
/* @__PURE__ */ e(
|
|
1556
|
+
mt,
|
|
1557
|
+
{
|
|
1558
|
+
open: E,
|
|
1559
|
+
onOpenChange: T
|
|
1560
|
+
}
|
|
1561
|
+
),
|
|
1562
|
+
/* @__PURE__ */ e(
|
|
1563
|
+
hs,
|
|
1564
|
+
{
|
|
1565
|
+
open: R,
|
|
1566
|
+
onOpenChange: (l) => {
|
|
1567
|
+
!l && K && !P || (k(l), l || (G(null), w(!1)));
|
|
1568
|
+
},
|
|
1569
|
+
children: /* @__PURE__ */ n(ps, { className: "max-w-sm", children: [
|
|
1570
|
+
/* @__PURE__ */ n(fs, { children: [
|
|
1571
|
+
/* @__PURE__ */ e(gs, { children: P ? "Save failed" : "Saving dashboard" }),
|
|
1572
|
+
/* @__PURE__ */ e(vs, { className: "pt-2", children: P ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
|
|
1573
|
+
] }),
|
|
1574
|
+
/* @__PURE__ */ e(bs, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: P ? /* @__PURE__ */ n(_, { children: [
|
|
1575
|
+
/* @__PURE__ */ e(
|
|
1576
|
+
ys,
|
|
1577
|
+
{
|
|
1578
|
+
onClick: () => {
|
|
1579
|
+
k(!1), G(null), w(!1);
|
|
1580
|
+
},
|
|
1581
|
+
className: "m-0",
|
|
1582
|
+
children: "Close"
|
|
1583
|
+
}
|
|
1584
|
+
),
|
|
1585
|
+
/* @__PURE__ */ e(
|
|
1586
|
+
Ee,
|
|
1587
|
+
{
|
|
1588
|
+
onClick: () => ge(),
|
|
1589
|
+
className: "m-0",
|
|
1590
|
+
children: "Retry"
|
|
1591
|
+
}
|
|
1592
|
+
)
|
|
1593
|
+
] }) : /* @__PURE__ */ n(
|
|
1594
|
+
Ee,
|
|
1595
|
+
{
|
|
1596
|
+
disabled: !0,
|
|
1597
|
+
className: "m-0 cursor-default",
|
|
1598
|
+
children: [
|
|
1599
|
+
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1600
|
+
"Saving..."
|
|
1601
|
+
]
|
|
1602
|
+
}
|
|
1603
|
+
) })
|
|
1604
|
+
] })
|
|
1605
|
+
}
|
|
1606
|
+
),
|
|
1607
|
+
/* @__PURE__ */ e(
|
|
1608
|
+
ka,
|
|
1609
|
+
{
|
|
1610
|
+
open: Gs,
|
|
1611
|
+
onOpenChange: ee,
|
|
1612
|
+
onSave: js,
|
|
1613
|
+
onDiscard: qs,
|
|
1614
|
+
isSaving: K
|
|
1615
|
+
}
|
|
1616
|
+
)
|
|
1617
|
+
] })
|
|
1618
|
+
]
|
|
1619
|
+
}
|
|
1620
|
+
);
|
|
1621
|
+
}
|
|
1622
|
+
export {
|
|
1623
|
+
xt as default
|
|
1624
|
+
};
|