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