react-semaphor 0.1.302 → 0.1.304
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/appearance/index.cjs +1 -1
- package/dist/appearance/index.js +1 -1
- package/dist/brand-studio/index.cjs +5 -5
- package/dist/brand-studio/index.js +334 -385
- package/dist/chunks/common-types-C6cAQgyh.js +9 -0
- package/dist/chunks/common-types-nBuCd3u2.js +1 -0
- package/dist/chunks/{dashboard-controls-CZuC_QjN.js → dashboard-controls-CyFZfGaN.js} +800 -776
- package/dist/chunks/dashboard-controls-DCZnUFI0.js +47 -0
- package/dist/chunks/{dashboard-filter-controls-button-kfb_T18o.js → dashboard-filter-controls-button-DI7XUgZK.js} +142 -142
- package/dist/chunks/{dashboard-filter-controls-button-2I1ltWQ9.js → dashboard-filter-controls-button-YQZ-oeN5.js} +3 -3
- package/dist/chunks/{dashboard-json-Df6v2Jem.js → dashboard-json-C6R2qixD.js} +3 -3
- package/dist/chunks/{dashboard-json-C3v6rBdp.js → dashboard-json-Z8jz16Yj.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-DKAaWq-G.js → dashboard-summary-settings-dialog-BlD77h63.js} +2 -2
- package/dist/chunks/{dashboard-summary-settings-dialog-BBALEHJQ.js → dashboard-summary-settings-dialog-DJyY-PB9.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CGBYahAK.js → edit-dashboard-visual-CNGc1zcN.js} +33 -33
- package/dist/chunks/{edit-dashboard-visual-D8L0cl_U.js → edit-dashboard-visual-CfRJXwDR.js} +167 -168
- package/dist/chunks/{index-uRJmUpof.js → index-CJdxSyQq.js} +679 -656
- package/dist/chunks/index-D2vz3gvd.js +1360 -0
- package/dist/chunks/index-DRlMUglg.js +4 -0
- package/dist/chunks/{index-BmoR3VQT.js → index-GHhvGdF9.js} +42745 -40322
- package/dist/chunks/{palette-326-dgn0.js → palette-BqJlrRto.js} +7 -2
- package/dist/chunks/{palette-jd7xiGTg.js → palette-DD-i7bNS.js} +23 -3
- package/dist/chunks/{resource-management-panel-C_c-BwrC.js → resource-management-panel-7Y4ITzGH.js} +65 -65
- package/dist/chunks/{resource-management-panel-DrcEEARD.js → resource-management-panel-Bdus73Iu.js} +1 -1
- package/dist/chunks/{rotate-ccw-BugHcM1w.js → rotate-ccw-CdGW8Rxm.js} +1 -1
- package/dist/chunks/{rotate-ccw-yFwqBFJZ.js → rotate-ccw-X8MbX_hF.js} +1 -1
- package/dist/chunks/{save-CaybXtdd.js → save-CFBIhbHD.js} +1 -1
- package/dist/chunks/{save-DU0FXUlM.js → save-j-clxFtx.js} +1 -1
- package/dist/chunks/{switch-CZtMtqEj.js → switch-BFhVVwh9.js} +4285 -3275
- package/dist/chunks/switch-BH17qlxH.js +163 -0
- package/dist/chunks/use-create-flow-overlay-state-CSytlf2H.js +16 -0
- package/dist/chunks/{use-create-flow-overlay-state-84Xe8VrP.js → use-create-flow-overlay-state-CllZvyvE.js} +318 -316
- package/dist/chunks/{use-visual-utils-lp5DfmvL.js → use-visual-utils-CDO4kVX5.js} +1 -1
- package/dist/chunks/{use-visual-utils-z3ifg6Fd.js → use-visual-utils-CyjLzcDG.js} +2 -2
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +5 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +61 -60
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +6 -6
- package/dist/types/dashboard.d.ts +168 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +8 -11
- package/dist/types/main.d.ts +195 -2
- package/dist/types/shared.d.ts +120 -0
- package/dist/types/surfboard.d.ts +168 -0
- package/dist/types/types.d.ts +168 -0
- package/package.json +1 -1
- package/dist/chunks/braces-CpOcaBNm.js +0 -6
- package/dist/chunks/braces-TYclg8Hl.js +0 -23
- package/dist/chunks/dashboard-controls-BkuB9TQX.js +0 -47
- package/dist/chunks/index-Cxb9UUro.js +0 -4
- package/dist/chunks/index-eM6MU4q_.js +0 -1361
- package/dist/chunks/switch-AmoR1YIA.js +0 -163
- package/dist/chunks/use-create-flow-overlay-state-CiKVJGWF.js +0 -16
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { jsx as e, jsxs as c, Fragment as T } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import Ea, { useState as
|
|
6
|
-
import "./index-
|
|
2
|
+
import { c as X, u as S, B as L, aH as Nt, m as St, L as dt, I as ue, a as J, aI as Re, aJ as da, aK as ua, E as ls, f as Y, aL as ds, aM as us, aN as ut, T as ma, q as ha, r as _e, t as Ue, s as mt, aO as pa, aP as ms, n as ta, z as hs, A as ps, D as fs, F as gs, K as vs, aQ as bs } from "./switch-BFhVVwh9.js";
|
|
3
|
+
import { c5 as ys, u as j, b as Ge, c6 as xs, bl as ht, c as $e, d as Ve, e as ze, f as wt, o as Ns, c7 as de, by as Te, c8 as Ss, c9 as aa, ca as fa, cb as ga, cc as ws, bO as Dt, cd as Ds, ce as Cs, cf as Es, cg as Is, ch as As, ci as Ls, r as qe, z as Be, p as A, bV as Ms, cj as Os, ck as ks, bS as pt, cl as ft, bx as Ct, bc as va, cm as gt, ba, cn as Ps, bF as ya, bG as xa, bH as Na, bI as Sa, bJ as wa, bK as Da, bL as Ca, bM as vt, co as Ts, cp as _s, cq as Us, bp as Fs, cr as Rs, cs as Gs, X as $s, W as ke, ct as Vs, a1 as zs, Y as nt, cu as qs, cv as Bs, cw as Hs, ad as js, cx as Ks, L as rt, cy as Qs, cz as Ws, cA as Js, c4 as Ys, cB as Xs, bq as Zs, br as en, bs as tn, bt as an, bu as $, bZ as sn, N as nn, bA as rn, cC as on, bv as sa, cD as cn, cE as ln, cF as dn, a0 as un, O as mn, cG as hn, K as bt } from "./index-GHhvGdF9.js";
|
|
4
|
+
import * as M from "react";
|
|
5
|
+
import Ea, { useState as N, useMemo as F, useCallback as Fe, useEffect as ot } from "react";
|
|
6
|
+
import "./index-CJdxSyQq.js";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
import { b as
|
|
9
|
-
import { d as
|
|
10
|
-
import { C as
|
|
11
|
-
import { u as
|
|
8
|
+
import { b as pn, u as fn, A as gn, V as vn, c as bn, D as yn, N as xn, U as Nn } from "./dashboard-filter-controls-button-DI7XUgZK.js";
|
|
9
|
+
import { d as Sn } from "./index-DFOb_6HB.js";
|
|
10
|
+
import { C as wn, D as Dn } from "./dashboard-summary-settings-dialog-BlD77h63.js";
|
|
11
|
+
import { u as Cn } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
12
12
|
import { s as it } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
13
|
-
import { u as
|
|
14
|
-
import { S as na } from "./save-
|
|
15
|
-
import { P as
|
|
16
|
-
import { B as In } from "./braces-TYclg8Hl.js";
|
|
13
|
+
import { u as En, e as In } from "./use-create-flow-overlay-state-CllZvyvE.js";
|
|
14
|
+
import { S as na } from "./save-j-clxFtx.js";
|
|
15
|
+
import { P as An, B as Ln } from "./palette-DD-i7bNS.js";
|
|
17
16
|
/**
|
|
18
17
|
* @license lucide-react v0.453.0 - ISC
|
|
19
18
|
*
|
|
20
19
|
* This source code is licensed under the ISC license.
|
|
21
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
22
21
|
*/
|
|
23
|
-
const Mn =
|
|
22
|
+
const Mn = X("Glasses", [
|
|
24
23
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
25
24
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
26
25
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -33,7 +32,7 @@ const Mn = Z("Glasses", [
|
|
|
33
32
|
* This source code is licensed under the ISC license.
|
|
34
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
35
34
|
*/
|
|
36
|
-
const
|
|
35
|
+
const On = X("Menu", [
|
|
37
36
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
38
37
|
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
39
38
|
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
@@ -44,7 +43,7 @@ const An = Z("Menu", [
|
|
|
44
43
|
* This source code is licensed under the ISC license.
|
|
45
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
45
|
*/
|
|
47
|
-
const
|
|
46
|
+
const kn = X("Monitor", [
|
|
48
47
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
49
48
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
50
49
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
@@ -55,7 +54,7 @@ const Ln = Z("Monitor", [
|
|
|
55
54
|
* This source code is licensed under the ISC license.
|
|
56
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
57
56
|
*/
|
|
58
|
-
const
|
|
57
|
+
const Pn = X("Moon", [
|
|
59
58
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
60
59
|
]);
|
|
61
60
|
/**
|
|
@@ -64,7 +63,7 @@ const On = Z("Moon", [
|
|
|
64
63
|
* This source code is licensed under the ISC license.
|
|
65
64
|
* See the LICENSE file in the root directory of this source tree.
|
|
66
65
|
*/
|
|
67
|
-
const
|
|
66
|
+
const Tn = X("ShieldX", [
|
|
68
67
|
[
|
|
69
68
|
"path",
|
|
70
69
|
{
|
|
@@ -81,7 +80,7 @@ const kn = Z("ShieldX", [
|
|
|
81
80
|
* This source code is licensed under the ISC license.
|
|
82
81
|
* See the LICENSE file in the root directory of this source tree.
|
|
83
82
|
*/
|
|
84
|
-
const
|
|
83
|
+
const _n = X("Sun", [
|
|
85
84
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
86
85
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
87
86
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -103,45 +102,45 @@ var yt = { exports: {} }, ct = {};
|
|
|
103
102
|
* LICENSE file in the root directory of this source tree.
|
|
104
103
|
*/
|
|
105
104
|
var ra;
|
|
106
|
-
function
|
|
105
|
+
function Un() {
|
|
107
106
|
if (ra) return ct;
|
|
108
107
|
ra = 1;
|
|
109
108
|
var t = Ea;
|
|
110
|
-
function
|
|
111
|
-
return
|
|
109
|
+
function a(f, h) {
|
|
110
|
+
return f === h && (f !== 0 || 1 / f === 1 / h) || f !== f && h !== h;
|
|
112
111
|
}
|
|
113
|
-
var n = typeof Object.is == "function" ? Object.is :
|
|
114
|
-
function
|
|
115
|
-
var
|
|
116
|
-
return
|
|
112
|
+
var n = typeof Object.is == "function" ? Object.is : a, s = t.useState, i = t.useEffect, u = t.useLayoutEffect, l = t.useDebugValue;
|
|
113
|
+
function p(f, h) {
|
|
114
|
+
var d = h(), r = s({ inst: { value: d, getSnapshot: h } }), b = r[0].inst, D = r[1];
|
|
115
|
+
return u(
|
|
117
116
|
function() {
|
|
118
|
-
b.value =
|
|
117
|
+
b.value = d, b.getSnapshot = h, g(b) && D({ inst: b });
|
|
119
118
|
},
|
|
120
|
-
[
|
|
121
|
-
),
|
|
119
|
+
[f, d, h]
|
|
120
|
+
), i(
|
|
122
121
|
function() {
|
|
123
|
-
return
|
|
124
|
-
|
|
122
|
+
return g(b) && D({ inst: b }), f(function() {
|
|
123
|
+
g(b) && D({ inst: b });
|
|
125
124
|
});
|
|
126
125
|
},
|
|
127
|
-
[
|
|
128
|
-
), l(
|
|
126
|
+
[f]
|
|
127
|
+
), l(d), d;
|
|
129
128
|
}
|
|
130
|
-
function f
|
|
131
|
-
var
|
|
132
|
-
|
|
129
|
+
function g(f) {
|
|
130
|
+
var h = f.getSnapshot;
|
|
131
|
+
f = f.value;
|
|
133
132
|
try {
|
|
134
|
-
var
|
|
135
|
-
return !n(
|
|
133
|
+
var d = h();
|
|
134
|
+
return !n(f, d);
|
|
136
135
|
} catch {
|
|
137
136
|
return !0;
|
|
138
137
|
}
|
|
139
138
|
}
|
|
140
|
-
function v(
|
|
141
|
-
return
|
|
139
|
+
function v(f, h) {
|
|
140
|
+
return h();
|
|
142
141
|
}
|
|
143
|
-
var
|
|
144
|
-
return ct.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore :
|
|
142
|
+
var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : p;
|
|
143
|
+
return ct.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : m, ct;
|
|
145
144
|
}
|
|
146
145
|
var lt = {};
|
|
147
146
|
/**
|
|
@@ -154,138 +153,138 @@ var lt = {};
|
|
|
154
153
|
* LICENSE file in the root directory of this source tree.
|
|
155
154
|
*/
|
|
156
155
|
var oa;
|
|
157
|
-
function
|
|
156
|
+
function Fn() {
|
|
158
157
|
return oa || (oa = 1, process.env.NODE_ENV !== "production" && function() {
|
|
159
|
-
function t(
|
|
160
|
-
return
|
|
158
|
+
function t(d, r) {
|
|
159
|
+
return d === r && (d !== 0 || 1 / d === 1 / r) || d !== d && r !== r;
|
|
161
160
|
}
|
|
162
|
-
function
|
|
163
|
-
|
|
161
|
+
function a(d, r) {
|
|
162
|
+
m || i.startTransition === void 0 || (m = !0, console.error(
|
|
164
163
|
"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."
|
|
165
164
|
));
|
|
166
|
-
var b =
|
|
167
|
-
if (!
|
|
168
|
-
var
|
|
169
|
-
|
|
165
|
+
var b = r();
|
|
166
|
+
if (!f) {
|
|
167
|
+
var D = r();
|
|
168
|
+
u(b, D) || (console.error(
|
|
170
169
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
171
|
-
),
|
|
170
|
+
), f = !0);
|
|
172
171
|
}
|
|
173
|
-
|
|
174
|
-
inst: { value: b, getSnapshot:
|
|
172
|
+
D = l({
|
|
173
|
+
inst: { value: b, getSnapshot: r }
|
|
175
174
|
});
|
|
176
|
-
var w =
|
|
177
|
-
return
|
|
175
|
+
var w = D[0].inst, C = D[1];
|
|
176
|
+
return g(
|
|
178
177
|
function() {
|
|
179
|
-
w.value = b, w.getSnapshot =
|
|
178
|
+
w.value = b, w.getSnapshot = r, n(w) && C({ inst: w });
|
|
180
179
|
},
|
|
181
|
-
[
|
|
182
|
-
),
|
|
180
|
+
[d, b, r]
|
|
181
|
+
), p(
|
|
183
182
|
function() {
|
|
184
|
-
return n(w) &&
|
|
185
|
-
n(w) &&
|
|
183
|
+
return n(w) && C({ inst: w }), d(function() {
|
|
184
|
+
n(w) && C({ inst: w });
|
|
186
185
|
});
|
|
187
186
|
},
|
|
188
|
-
[
|
|
187
|
+
[d]
|
|
189
188
|
), v(b), b;
|
|
190
189
|
}
|
|
191
|
-
function n(
|
|
192
|
-
var
|
|
193
|
-
|
|
190
|
+
function n(d) {
|
|
191
|
+
var r = d.getSnapshot;
|
|
192
|
+
d = d.value;
|
|
194
193
|
try {
|
|
195
|
-
var b =
|
|
196
|
-
return !d
|
|
194
|
+
var b = r();
|
|
195
|
+
return !u(d, b);
|
|
197
196
|
} catch {
|
|
198
197
|
return !0;
|
|
199
198
|
}
|
|
200
199
|
}
|
|
201
|
-
function
|
|
202
|
-
return
|
|
200
|
+
function s(d, r) {
|
|
201
|
+
return r();
|
|
203
202
|
}
|
|
204
203
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
205
|
-
var
|
|
206
|
-
lt.useSyncExternalStore =
|
|
204
|
+
var i = Ea, u = typeof Object.is == "function" ? Object.is : t, l = i.useState, p = i.useEffect, g = i.useLayoutEffect, v = i.useDebugValue, m = !1, f = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? s : a;
|
|
205
|
+
lt.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
207
206
|
}()), lt;
|
|
208
207
|
}
|
|
209
|
-
process.env.NODE_ENV === "production" ? yt.exports =
|
|
210
|
-
var
|
|
208
|
+
process.env.NODE_ENV === "production" ? yt.exports = Un() : yt.exports = Fn();
|
|
209
|
+
var Rn = yt.exports;
|
|
211
210
|
const Pe = ["light", "dark", "system"];
|
|
212
|
-
function
|
|
213
|
-
const { theme: t, setTheme:
|
|
211
|
+
function Gn() {
|
|
212
|
+
const { theme: t, setTheme: a } = ys(), n = S(
|
|
214
213
|
(l) => l.actions.setDashboardTheme
|
|
215
214
|
);
|
|
216
|
-
function
|
|
217
|
-
const l = Pe.includes(t) ? t : "system",
|
|
218
|
-
|
|
215
|
+
function s() {
|
|
216
|
+
const l = Pe.includes(t) ? t : "system", p = Pe[(Pe.indexOf(l) + 1) % Pe.length];
|
|
217
|
+
a(p), n(p);
|
|
219
218
|
}
|
|
220
|
-
const
|
|
219
|
+
const i = t === "light" ? _n : t === "dark" ? Pn : kn, u = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
|
|
221
220
|
return /* @__PURE__ */ e(
|
|
222
|
-
|
|
221
|
+
L,
|
|
223
222
|
{
|
|
224
223
|
type: "button",
|
|
225
224
|
variant: "ghost",
|
|
226
225
|
size: "xs",
|
|
227
226
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
|
|
228
|
-
onClick:
|
|
229
|
-
"aria-label":
|
|
230
|
-
title:
|
|
231
|
-
children: /* @__PURE__ */ e(
|
|
227
|
+
onClick: s,
|
|
228
|
+
"aria-label": u,
|
|
229
|
+
title: u,
|
|
230
|
+
children: /* @__PURE__ */ e(i, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
|
|
232
231
|
}
|
|
233
232
|
);
|
|
234
233
|
}
|
|
235
|
-
async function
|
|
236
|
-
if (!
|
|
234
|
+
async function $n(t, a, n, s, i) {
|
|
235
|
+
if (!i)
|
|
237
236
|
return null;
|
|
238
|
-
const
|
|
239
|
-
return await
|
|
240
|
-
name:
|
|
241
|
-
template:
|
|
242
|
-
filterValues:
|
|
237
|
+
const u = JSON.stringify(n), l = `${t}/v1/lens`;
|
|
238
|
+
return await Nt(l, i, {
|
|
239
|
+
name: a,
|
|
240
|
+
template: u,
|
|
241
|
+
filterValues: s,
|
|
243
242
|
operation: "create"
|
|
244
243
|
});
|
|
245
244
|
}
|
|
246
|
-
async function xt(t,
|
|
245
|
+
async function xt(t, a, n) {
|
|
247
246
|
if (!n)
|
|
248
247
|
return null;
|
|
249
|
-
const { id:
|
|
250
|
-
return await
|
|
251
|
-
lensId:
|
|
252
|
-
template:
|
|
253
|
-
filterValues:
|
|
248
|
+
const { id: s, template: i, filterValues: u, isDefault: l, shared: p } = a, g = `${t}/v1/lens`;
|
|
249
|
+
return await Nt(g, n, {
|
|
250
|
+
lensId: s,
|
|
251
|
+
template: i,
|
|
252
|
+
filterValues: u,
|
|
254
253
|
isDefault: l,
|
|
255
|
-
shared:
|
|
254
|
+
shared: p,
|
|
256
255
|
operation: "update"
|
|
257
256
|
});
|
|
258
257
|
}
|
|
259
|
-
async function
|
|
258
|
+
async function Vn(t, a, n) {
|
|
260
259
|
if (!n)
|
|
261
260
|
return null;
|
|
262
|
-
const
|
|
263
|
-
return await
|
|
261
|
+
const s = `${t}/v1/lens`;
|
|
262
|
+
return await Nt(s, n, {
|
|
264
263
|
operation: "delete",
|
|
265
|
-
lensId:
|
|
264
|
+
lensId: a
|
|
266
265
|
});
|
|
267
266
|
}
|
|
268
|
-
const
|
|
269
|
-
function
|
|
267
|
+
const zn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
268
|
+
function qn({
|
|
270
269
|
open: t,
|
|
271
|
-
onOpenChange:
|
|
270
|
+
onOpenChange: a
|
|
272
271
|
} = {}) {
|
|
273
|
-
const [n,
|
|
274
|
-
|
|
275
|
-
},
|
|
272
|
+
const [n, s] = N(""), [i, u] = N(!1), l = S((I) => I.lenses), { setLenses: p, setSelectedLensId: g } = St(), [v, m] = N(!1), [f, h] = N(!1), d = t !== void 0, r = d ? t : f, b = (I) => {
|
|
273
|
+
d || h(I), a == null || a(I);
|
|
274
|
+
}, D = S((I) => I.dashboard), w = S((I) => I.filterValues), { authToken: C, tokenProps: E } = j();
|
|
276
275
|
async function O() {
|
|
277
|
-
|
|
278
|
-
const I = await
|
|
276
|
+
m(!0);
|
|
277
|
+
const I = await $n(
|
|
279
278
|
E.apiServiceUrl,
|
|
280
279
|
n,
|
|
281
|
-
|
|
280
|
+
D,
|
|
282
281
|
w,
|
|
283
|
-
|
|
282
|
+
C == null ? void 0 : C.accessToken
|
|
284
283
|
);
|
|
285
|
-
I && (
|
|
284
|
+
I && (p([...l || [], I]), g(I.id), b(!1)), m(!1);
|
|
286
285
|
}
|
|
287
|
-
return /* @__PURE__ */ c(Ge, { open:
|
|
288
|
-
|
|
286
|
+
return /* @__PURE__ */ c(Ge, { open: r, onOpenChange: b, children: [
|
|
287
|
+
d ? null : /* @__PURE__ */ e(xs, { asChild: !0, children: /* @__PURE__ */ c(L, { variant: "secondary", size: "xs", children: [
|
|
289
288
|
/* @__PURE__ */ e(ht, { className: "h-3.5 w-3.5" }),
|
|
290
289
|
"Lens"
|
|
291
290
|
] }) }),
|
|
@@ -295,7 +294,7 @@ function Vn({
|
|
|
295
294
|
/* @__PURE__ */ e(wt, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
|
|
296
295
|
] }),
|
|
297
296
|
/* @__PURE__ */ c("div", { className: "space-y-1.5 py-1", children: [
|
|
298
|
-
/* @__PURE__ */ e(dt, { htmlFor: "lens-name", className:
|
|
297
|
+
/* @__PURE__ */ e(dt, { htmlFor: "lens-name", className: zn, children: "Name" }),
|
|
299
298
|
/* @__PURE__ */ e(
|
|
300
299
|
ue,
|
|
301
300
|
{
|
|
@@ -303,15 +302,15 @@ function Vn({
|
|
|
303
302
|
size: "xs",
|
|
304
303
|
value: n,
|
|
305
304
|
placeholder: "Monthly review, West region, …",
|
|
306
|
-
onChange: (I) =>
|
|
305
|
+
onChange: (I) => s(I.target.value)
|
|
307
306
|
}
|
|
308
307
|
),
|
|
309
|
-
|
|
308
|
+
i && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: "A lens with this name already exists. Pick a different one." })
|
|
310
309
|
] }),
|
|
311
|
-
/* @__PURE__ */ c(
|
|
312
|
-
/* @__PURE__ */ e(
|
|
310
|
+
/* @__PURE__ */ c(Ns, { children: [
|
|
311
|
+
/* @__PURE__ */ e(L, { variant: "outline", size: "xs", onClick: () => b(!1), children: "Cancel" }),
|
|
313
312
|
/* @__PURE__ */ e(
|
|
314
|
-
|
|
313
|
+
L,
|
|
315
314
|
{
|
|
316
315
|
size: "xs",
|
|
317
316
|
type: "submit",
|
|
@@ -324,38 +323,38 @@ function Vn({
|
|
|
324
323
|
] })
|
|
325
324
|
] });
|
|
326
325
|
}
|
|
327
|
-
function
|
|
328
|
-
const
|
|
329
|
-
async function
|
|
330
|
-
|
|
326
|
+
function Bn({ includeLabel: t = !1 } = {}) {
|
|
327
|
+
const a = S((m) => m.lenses), n = S((m) => m.selectedLensId), { setLenses: s, setSelectedLensId: i } = St(), { authToken: u, tokenProps: l } = j();
|
|
328
|
+
async function p(m) {
|
|
329
|
+
i(m);
|
|
331
330
|
}
|
|
332
|
-
async function
|
|
333
|
-
if (await
|
|
334
|
-
const
|
|
335
|
-
|
|
331
|
+
async function g(m) {
|
|
332
|
+
if (await Vn(l.apiServiceUrl, m, u == null ? void 0 : u.accessToken)) {
|
|
333
|
+
const h = a == null ? void 0 : a.filter((d) => d.id !== m);
|
|
334
|
+
s(h || []), i("original");
|
|
336
335
|
}
|
|
337
336
|
}
|
|
338
|
-
async function v(
|
|
339
|
-
const
|
|
340
|
-
...
|
|
341
|
-
isDefault: !
|
|
337
|
+
async function v(m) {
|
|
338
|
+
const f = a == null ? void 0 : a.map((r) => r.id === m.id ? {
|
|
339
|
+
...r,
|
|
340
|
+
isDefault: !m.isDefault
|
|
342
341
|
} : {
|
|
343
|
-
...
|
|
342
|
+
...r,
|
|
344
343
|
isDefault: !1
|
|
345
344
|
});
|
|
346
|
-
|
|
347
|
-
const
|
|
348
|
-
...
|
|
349
|
-
isDefault: !
|
|
345
|
+
s(f || []);
|
|
346
|
+
const h = {
|
|
347
|
+
...m,
|
|
348
|
+
isDefault: !m.isDefault
|
|
350
349
|
};
|
|
351
|
-
await xt(l.apiServiceUrl,
|
|
352
|
-
const
|
|
353
|
-
if (
|
|
354
|
-
const
|
|
355
|
-
...
|
|
350
|
+
await xt(l.apiServiceUrl, h, u == null ? void 0 : u.accessToken);
|
|
351
|
+
const d = a == null ? void 0 : a.find((r) => r.isDefault);
|
|
352
|
+
if (d && d.id !== m.id) {
|
|
353
|
+
const r = {
|
|
354
|
+
...d,
|
|
356
355
|
isDefault: !1
|
|
357
356
|
};
|
|
358
|
-
await xt(l.apiServiceUrl,
|
|
357
|
+
await xt(l.apiServiceUrl, r, u == null ? void 0 : u.accessToken);
|
|
359
358
|
}
|
|
360
359
|
}
|
|
361
360
|
return /* @__PURE__ */ c(T, { children: [
|
|
@@ -364,31 +363,31 @@ function zn({ includeLabel: t = !1 } = {}) {
|
|
|
364
363
|
/* @__PURE__ */ e(Te, {})
|
|
365
364
|
] }) : null,
|
|
366
365
|
/* @__PURE__ */ c(
|
|
367
|
-
|
|
366
|
+
Ss,
|
|
368
367
|
{
|
|
369
368
|
value: n,
|
|
370
|
-
onValueChange:
|
|
369
|
+
onValueChange: p,
|
|
371
370
|
children: [
|
|
372
371
|
/* @__PURE__ */ e(aa, { value: "original", children: "Original" }),
|
|
373
|
-
|
|
372
|
+
a == null ? void 0 : a.map((m) => /* @__PURE__ */ c(
|
|
374
373
|
aa,
|
|
375
374
|
{
|
|
376
375
|
className: "group flex justify-between gap-2",
|
|
377
|
-
value:
|
|
376
|
+
value: m.id,
|
|
378
377
|
children: [
|
|
379
|
-
/* @__PURE__ */ e("p", { children:
|
|
378
|
+
/* @__PURE__ */ e("p", { children: m.name }),
|
|
380
379
|
/* @__PURE__ */ c("span", { className: "flex items-center gap-3", children: [
|
|
381
380
|
/* @__PURE__ */ e(
|
|
382
381
|
fa,
|
|
383
382
|
{
|
|
384
|
-
onClick: (
|
|
385
|
-
|
|
383
|
+
onClick: (f) => {
|
|
384
|
+
f.preventDefault(), v(m);
|
|
386
385
|
},
|
|
387
|
-
className:
|
|
386
|
+
className: J(
|
|
388
387
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
389
388
|
{
|
|
390
|
-
invisible: !
|
|
391
|
-
"text-green-500":
|
|
389
|
+
invisible: !m.isDefault,
|
|
390
|
+
"text-green-500": m.isDefault
|
|
392
391
|
}
|
|
393
392
|
),
|
|
394
393
|
strokeWidth: 1.5
|
|
@@ -397,8 +396,8 @@ function zn({ includeLabel: t = !1 } = {}) {
|
|
|
397
396
|
/* @__PURE__ */ e(
|
|
398
397
|
ga,
|
|
399
398
|
{
|
|
400
|
-
onClick: (
|
|
401
|
-
|
|
399
|
+
onClick: (f) => {
|
|
400
|
+
f.preventDefault(), g(m.id);
|
|
402
401
|
},
|
|
403
402
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
404
403
|
strokeWidth: 1.5
|
|
@@ -407,138 +406,138 @@ function zn({ includeLabel: t = !1 } = {}) {
|
|
|
407
406
|
] })
|
|
408
407
|
]
|
|
409
408
|
},
|
|
410
|
-
|
|
409
|
+
m.id
|
|
411
410
|
))
|
|
412
411
|
]
|
|
413
412
|
}
|
|
414
413
|
)
|
|
415
414
|
] });
|
|
416
415
|
}
|
|
417
|
-
function
|
|
418
|
-
const { displayPreferences: t, shouldShowElement:
|
|
416
|
+
function Hn() {
|
|
417
|
+
const { displayPreferences: t, shouldShowElement: a } = ws(), { currentUser: n, userContext: s } = Dt(), i = F(
|
|
419
418
|
() => Ds(n),
|
|
420
419
|
[n]
|
|
421
|
-
),
|
|
420
|
+
), u = F(() => (p) => i && i[p] !== void 0 && i[p] === !1 ? !1 : a(p), [i, a, t]), l = F(
|
|
422
421
|
() => {
|
|
423
|
-
var
|
|
422
|
+
var p, g, v, m, f;
|
|
424
423
|
return {
|
|
425
|
-
canEdit: ((
|
|
426
|
-
canUseFilters: ((
|
|
427
|
-
canManageDashboards: ((v =
|
|
428
|
-
canCreateDashboards: ((
|
|
429
|
-
canAccessVisuals: ((
|
|
424
|
+
canEdit: ((p = s == null ? void 0 : s.permissions) == null ? void 0 : p.canEdit) ?? Ls(n),
|
|
425
|
+
canUseFilters: ((g = s == null ? void 0 : s.permissions) == null ? void 0 : g.canEdit) ?? As(n),
|
|
426
|
+
canManageDashboards: ((v = s == null ? void 0 : s.permissions) == null ? void 0 : v.canCreateDashboard) ?? Is(n),
|
|
427
|
+
canCreateDashboards: ((m = s == null ? void 0 : s.permissions) == null ? void 0 : m.canCreateDashboard) ?? Es(n),
|
|
428
|
+
canAccessVisuals: ((f = s == null ? void 0 : s.permissions) == null ? void 0 : f.canEdit) ?? Cs(n)
|
|
430
429
|
};
|
|
431
430
|
},
|
|
432
|
-
[n,
|
|
431
|
+
[n, s]
|
|
433
432
|
);
|
|
434
433
|
return {
|
|
435
434
|
displayPreferences: t,
|
|
436
|
-
shouldShowElement:
|
|
435
|
+
shouldShowElement: u,
|
|
437
436
|
permissions: l,
|
|
438
437
|
currentUser: n
|
|
439
438
|
};
|
|
440
439
|
}
|
|
441
|
-
const
|
|
442
|
-
const
|
|
443
|
-
return await ua(
|
|
444
|
-
},
|
|
445
|
-
const
|
|
446
|
-
await da(
|
|
447
|
-
},
|
|
448
|
-
const
|
|
449
|
-
return await ua(
|
|
450
|
-
},
|
|
451
|
-
const
|
|
452
|
-
await da(
|
|
440
|
+
const jn = async (t, a, n) => {
|
|
441
|
+
const s = `${t}/management/v1/groups`;
|
|
442
|
+
return await ua(s, a, n);
|
|
443
|
+
}, Kn = async (t, a, n) => {
|
|
444
|
+
const s = `${t}/management/v1/groups/${n}`;
|
|
445
|
+
await da(s, a, "DELETE");
|
|
446
|
+
}, Qn = async (t, a, n, s) => {
|
|
447
|
+
const i = `${t}/management/v1/groups/${n}/members`;
|
|
448
|
+
return await ua(i, a, s);
|
|
449
|
+
}, Wn = async (t, a, n, s) => {
|
|
450
|
+
const i = `${t}/management/v1/groups/${n}/members`;
|
|
451
|
+
await da(i, a, "DELETE", s);
|
|
453
452
|
};
|
|
454
|
-
function
|
|
455
|
-
const { authToken: t, tokenProps:
|
|
453
|
+
function Jn() {
|
|
454
|
+
const { authToken: t, tokenProps: a } = j(), n = qe();
|
|
456
455
|
return Be({
|
|
457
|
-
mutationFn: (
|
|
456
|
+
mutationFn: (s) => jn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s),
|
|
458
457
|
onSuccess: () => {
|
|
459
|
-
n.invalidateQueries({ queryKey: ["groups"] }),
|
|
458
|
+
n.invalidateQueries({ queryKey: ["groups"] }), A.success("Group created successfully");
|
|
460
459
|
},
|
|
461
|
-
onError: (
|
|
462
|
-
console.error("Failed to create group:",
|
|
463
|
-
description: Re(
|
|
460
|
+
onError: (s) => {
|
|
461
|
+
console.error("Failed to create group:", s), A.error("Failed to create group", {
|
|
462
|
+
description: Re(s, "Failed to create group")
|
|
464
463
|
});
|
|
465
464
|
}
|
|
466
465
|
});
|
|
467
466
|
}
|
|
468
|
-
function
|
|
469
|
-
const { authToken: t, tokenProps:
|
|
467
|
+
function Yn() {
|
|
468
|
+
const { authToken: t, tokenProps: a } = j(), n = qe();
|
|
470
469
|
return Be({
|
|
471
|
-
mutationFn: (
|
|
472
|
-
onSuccess: (
|
|
473
|
-
n.invalidateQueries({ queryKey: ["groups"] }), n.removeQueries({ queryKey: ["group",
|
|
470
|
+
mutationFn: (s) => Kn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s),
|
|
471
|
+
onSuccess: (s, i) => {
|
|
472
|
+
n.invalidateQueries({ queryKey: ["groups"] }), n.removeQueries({ queryKey: ["group", i] }), A.success("Group deleted successfully");
|
|
474
473
|
},
|
|
475
|
-
onError: (
|
|
476
|
-
console.error("Failed to delete group:",
|
|
477
|
-
description: Re(
|
|
474
|
+
onError: (s) => {
|
|
475
|
+
console.error("Failed to delete group:", s), A.error("Failed to delete group", {
|
|
476
|
+
description: Re(s, "Failed to delete group")
|
|
478
477
|
});
|
|
479
478
|
}
|
|
480
479
|
});
|
|
481
480
|
}
|
|
482
|
-
function
|
|
483
|
-
const { authToken: t, tokenProps:
|
|
481
|
+
function Xn() {
|
|
482
|
+
const { authToken: t, tokenProps: a } = j(), n = qe();
|
|
484
483
|
return Be({
|
|
485
484
|
mutationFn: ({
|
|
486
|
-
groupId:
|
|
487
|
-
data:
|
|
488
|
-
}) =>
|
|
489
|
-
onSuccess: (
|
|
490
|
-
n.invalidateQueries({ queryKey: ["group",
|
|
491
|
-
queryKey: ["group-members",
|
|
492
|
-
}), n.invalidateQueries({ queryKey: ["groups"] }),
|
|
485
|
+
groupId: s,
|
|
486
|
+
data: i
|
|
487
|
+
}) => Qn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s, i),
|
|
488
|
+
onSuccess: (s, i) => {
|
|
489
|
+
n.invalidateQueries({ queryKey: ["group", i.groupId] }), n.invalidateQueries({
|
|
490
|
+
queryKey: ["group-members", i.groupId]
|
|
491
|
+
}), n.invalidateQueries({ queryKey: ["groups"] }), A.success("Members added successfully");
|
|
493
492
|
},
|
|
494
|
-
onError: (
|
|
495
|
-
console.error("Failed to add group members:",
|
|
496
|
-
description: Re(
|
|
493
|
+
onError: (s) => {
|
|
494
|
+
console.error("Failed to add group members:", s), A.error("Failed to add members", {
|
|
495
|
+
description: Re(s, "Failed to add members")
|
|
497
496
|
});
|
|
498
497
|
}
|
|
499
498
|
});
|
|
500
499
|
}
|
|
501
|
-
function
|
|
502
|
-
const { authToken: t, tokenProps:
|
|
500
|
+
function Zn() {
|
|
501
|
+
const { authToken: t, tokenProps: a } = j(), n = qe();
|
|
503
502
|
return Be({
|
|
504
503
|
mutationFn: ({
|
|
505
|
-
groupId:
|
|
506
|
-
data:
|
|
507
|
-
}) =>
|
|
508
|
-
onSuccess: (
|
|
509
|
-
n.invalidateQueries({ queryKey: ["group",
|
|
510
|
-
queryKey: ["group-members",
|
|
511
|
-
}), n.invalidateQueries({ queryKey: ["groups"] }),
|
|
504
|
+
groupId: s,
|
|
505
|
+
data: i
|
|
506
|
+
}) => Wn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s, i),
|
|
507
|
+
onSuccess: (s, i) => {
|
|
508
|
+
n.invalidateQueries({ queryKey: ["group", i.groupId] }), n.invalidateQueries({
|
|
509
|
+
queryKey: ["group-members", i.groupId]
|
|
510
|
+
}), n.invalidateQueries({ queryKey: ["groups"] }), A.success("Members removed successfully");
|
|
512
511
|
},
|
|
513
|
-
onError: (
|
|
514
|
-
console.error("Failed to remove group members:",
|
|
515
|
-
description: Re(
|
|
512
|
+
onError: (s) => {
|
|
513
|
+
console.error("Failed to remove group members:", s), A.error("Failed to remove members", {
|
|
514
|
+
description: Re(s, "Failed to remove members")
|
|
516
515
|
});
|
|
517
516
|
}
|
|
518
517
|
});
|
|
519
518
|
}
|
|
520
519
|
const ia = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
521
|
-
function
|
|
520
|
+
function er({
|
|
522
521
|
onSuccess: t,
|
|
523
|
-
tenantId:
|
|
522
|
+
tenantId: a,
|
|
524
523
|
isTenantUser: n
|
|
525
524
|
}) {
|
|
526
|
-
const [
|
|
527
|
-
const
|
|
528
|
-
return
|
|
525
|
+
const [s, i] = N(""), [u, l] = N(""), [p, g] = N({}), v = Jn(), m = () => {
|
|
526
|
+
const h = {};
|
|
527
|
+
return s.trim() ? s.length < 3 ? h.name = "Group name must be at least 3 characters" : s.length > 50 && (h.name = "Group name must be less than 50 characters") : h.name = "Group name is required", u && u.length > 200 && (h.description = "Description must be less than 200 characters"), g(h), Object.keys(h).length === 0;
|
|
529
528
|
};
|
|
530
|
-
return /* @__PURE__ */ c("form", { onSubmit: async (
|
|
531
|
-
if (
|
|
532
|
-
const
|
|
533
|
-
name:
|
|
534
|
-
description:
|
|
529
|
+
return /* @__PURE__ */ c("form", { onSubmit: async (h) => {
|
|
530
|
+
if (h.preventDefault(), !m()) return;
|
|
531
|
+
const d = {
|
|
532
|
+
name: s.trim(),
|
|
533
|
+
description: u.trim() || void 0,
|
|
535
534
|
type: n ? "TENANT_GROUP" : "ORG_GROUP",
|
|
536
|
-
...n &&
|
|
535
|
+
...n && a ? { tenantId: a } : {}
|
|
537
536
|
};
|
|
538
537
|
try {
|
|
539
|
-
await v.mutateAsync(
|
|
540
|
-
} catch (
|
|
541
|
-
console.error("Failed to create group:",
|
|
538
|
+
await v.mutateAsync(d), i(""), l(""), g({}), t();
|
|
539
|
+
} catch (r) {
|
|
540
|
+
console.error("Failed to create group:", r);
|
|
542
541
|
}
|
|
543
542
|
}, className: "space-y-4", children: [
|
|
544
543
|
/* @__PURE__ */ c("div", { className: "space-y-1.5", children: [
|
|
@@ -552,34 +551,34 @@ function Xn({
|
|
|
552
551
|
id: "group-name",
|
|
553
552
|
size: "xs",
|
|
554
553
|
placeholder: "e.g., Marketing Team, Engineering Squad",
|
|
555
|
-
value:
|
|
556
|
-
onChange: (
|
|
557
|
-
|
|
554
|
+
value: s,
|
|
555
|
+
onChange: (h) => {
|
|
556
|
+
i(h.target.value), p.name && g((d) => ({ ...d, name: "" }));
|
|
558
557
|
},
|
|
559
|
-
className:
|
|
558
|
+
className: p.name ? "border-destructive" : "",
|
|
560
559
|
disabled: v.isPending
|
|
561
560
|
}
|
|
562
561
|
),
|
|
563
|
-
|
|
562
|
+
p.name && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: p.name })
|
|
564
563
|
] }),
|
|
565
564
|
/* @__PURE__ */ c("div", { className: "space-y-1.5", children: [
|
|
566
565
|
/* @__PURE__ */ e(dt, { htmlFor: "group-description", className: ia, children: "Description (optional)" }),
|
|
567
566
|
/* @__PURE__ */ e(
|
|
568
|
-
|
|
567
|
+
Ms,
|
|
569
568
|
{
|
|
570
569
|
id: "group-description",
|
|
571
570
|
placeholder: "Describe the purpose of this group…",
|
|
572
|
-
value:
|
|
573
|
-
onChange: (
|
|
574
|
-
l(
|
|
571
|
+
value: u,
|
|
572
|
+
onChange: (h) => {
|
|
573
|
+
l(h.target.value), p.description && g((d) => ({ ...d, description: "" }));
|
|
575
574
|
},
|
|
576
|
-
className: `text-[13px] ${
|
|
575
|
+
className: `text-[13px] ${p.description ? "border-destructive" : ""}`,
|
|
577
576
|
disabled: v.isPending,
|
|
578
577
|
rows: 3
|
|
579
578
|
}
|
|
580
579
|
),
|
|
581
|
-
|
|
582
|
-
|
|
580
|
+
p.description ? /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: p.description }) : /* @__PURE__ */ c("p", { className: "text-[11px] text-muted-foreground", children: [
|
|
581
|
+
u.length,
|
|
583
582
|
"/200"
|
|
584
583
|
] })
|
|
585
584
|
] }),
|
|
@@ -589,26 +588,26 @@ function Xn({
|
|
|
589
588
|
] }),
|
|
590
589
|
/* @__PURE__ */ c("div", { className: "flex justify-end gap-1.5 pt-1", children: [
|
|
591
590
|
/* @__PURE__ */ e(
|
|
592
|
-
|
|
591
|
+
L,
|
|
593
592
|
{
|
|
594
593
|
type: "button",
|
|
595
594
|
variant: "outline",
|
|
596
595
|
size: "xs",
|
|
597
596
|
onClick: () => {
|
|
598
|
-
|
|
597
|
+
i(""), l(""), g({});
|
|
599
598
|
},
|
|
600
599
|
disabled: v.isPending,
|
|
601
600
|
children: "Clear"
|
|
602
601
|
}
|
|
603
602
|
),
|
|
604
603
|
/* @__PURE__ */ e(
|
|
605
|
-
|
|
604
|
+
L,
|
|
606
605
|
{
|
|
607
606
|
type: "submit",
|
|
608
607
|
size: "xs",
|
|
609
|
-
disabled: v.isPending || !
|
|
608
|
+
disabled: v.isPending || !s.trim(),
|
|
610
609
|
children: v.isPending ? /* @__PURE__ */ c(T, { children: [
|
|
611
|
-
/* @__PURE__ */ e(
|
|
610
|
+
/* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
612
611
|
"Creating…"
|
|
613
612
|
] }) : "Create group"
|
|
614
613
|
}
|
|
@@ -616,59 +615,59 @@ function Xn({
|
|
|
616
615
|
] })
|
|
617
616
|
] });
|
|
618
617
|
}
|
|
619
|
-
function
|
|
618
|
+
function tr(t, a = []) {
|
|
620
619
|
let n = [];
|
|
621
|
-
function
|
|
622
|
-
const
|
|
623
|
-
|
|
624
|
-
const
|
|
620
|
+
function s(u, l) {
|
|
621
|
+
const p = M.createContext(l);
|
|
622
|
+
p.displayName = u + "Context";
|
|
623
|
+
const g = n.length;
|
|
625
624
|
n = [...n, l];
|
|
626
|
-
const v = (
|
|
625
|
+
const v = (f) => {
|
|
627
626
|
var w;
|
|
628
|
-
const { scope:
|
|
629
|
-
return /* @__PURE__ */ e(b.Provider, { value:
|
|
627
|
+
const { scope: h, children: d, ...r } = f, b = ((w = h == null ? void 0 : h[t]) == null ? void 0 : w[g]) || p, D = M.useMemo(() => r, Object.values(r));
|
|
628
|
+
return /* @__PURE__ */ e(b.Provider, { value: D, children: d });
|
|
630
629
|
};
|
|
631
|
-
v.displayName =
|
|
632
|
-
function
|
|
630
|
+
v.displayName = u + "Provider";
|
|
631
|
+
function m(f, h) {
|
|
633
632
|
var b;
|
|
634
|
-
const
|
|
635
|
-
if (
|
|
633
|
+
const d = ((b = h == null ? void 0 : h[t]) == null ? void 0 : b[g]) || p, r = M.useContext(d);
|
|
634
|
+
if (r) return r;
|
|
636
635
|
if (l !== void 0) return l;
|
|
637
|
-
throw new Error(`\`${
|
|
636
|
+
throw new Error(`\`${f}\` must be used within \`${u}\``);
|
|
638
637
|
}
|
|
639
|
-
return [v,
|
|
638
|
+
return [v, m];
|
|
640
639
|
}
|
|
641
|
-
const
|
|
642
|
-
const
|
|
643
|
-
return function(
|
|
644
|
-
const
|
|
645
|
-
return
|
|
646
|
-
() => ({ [`__scope${t}`]: { ...
|
|
647
|
-
[
|
|
640
|
+
const i = () => {
|
|
641
|
+
const u = n.map((l) => M.createContext(l));
|
|
642
|
+
return function(p) {
|
|
643
|
+
const g = (p == null ? void 0 : p[t]) || u;
|
|
644
|
+
return M.useMemo(
|
|
645
|
+
() => ({ [`__scope${t}`]: { ...p, [t]: g } }),
|
|
646
|
+
[p, g]
|
|
648
647
|
);
|
|
649
648
|
};
|
|
650
649
|
};
|
|
651
|
-
return
|
|
650
|
+
return i.scopeName = t, [s, ar(i, ...a)];
|
|
652
651
|
}
|
|
653
|
-
function
|
|
654
|
-
const
|
|
655
|
-
if (t.length === 1) return
|
|
652
|
+
function ar(...t) {
|
|
653
|
+
const a = t[0];
|
|
654
|
+
if (t.length === 1) return a;
|
|
656
655
|
const n = () => {
|
|
657
|
-
const
|
|
658
|
-
useScope:
|
|
659
|
-
scopeName:
|
|
656
|
+
const s = t.map((i) => ({
|
|
657
|
+
useScope: i(),
|
|
658
|
+
scopeName: i.scopeName
|
|
660
659
|
}));
|
|
661
|
-
return function(
|
|
662
|
-
const l =
|
|
663
|
-
const
|
|
664
|
-
return { ...
|
|
660
|
+
return function(u) {
|
|
661
|
+
const l = s.reduce((p, { useScope: g, scopeName: v }) => {
|
|
662
|
+
const f = g(u)[`__scope${v}`];
|
|
663
|
+
return { ...p, ...f };
|
|
665
664
|
}, {});
|
|
666
|
-
return
|
|
665
|
+
return M.useMemo(() => ({ [`__scope${a.scopeName}`]: l }), [l]);
|
|
667
666
|
};
|
|
668
667
|
};
|
|
669
|
-
return n.scopeName =
|
|
668
|
+
return n.scopeName = a.scopeName, n;
|
|
670
669
|
}
|
|
671
|
-
var
|
|
670
|
+
var sr = [
|
|
672
671
|
"a",
|
|
673
672
|
"button",
|
|
674
673
|
"div",
|
|
@@ -686,135 +685,135 @@ var tr = [
|
|
|
686
685
|
"span",
|
|
687
686
|
"svg",
|
|
688
687
|
"ul"
|
|
689
|
-
], Et =
|
|
690
|
-
const n = ds(`Primitive.${
|
|
691
|
-
const { asChild: l, ...
|
|
692
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(
|
|
688
|
+
], Et = sr.reduce((t, a) => {
|
|
689
|
+
const n = ds(`Primitive.${a}`), s = M.forwardRef((i, u) => {
|
|
690
|
+
const { asChild: l, ...p } = i, g = l ? n : a;
|
|
691
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(g, { ...p, ref: u });
|
|
693
692
|
});
|
|
694
|
-
return
|
|
693
|
+
return s.displayName = `Primitive.${a}`, { ...t, [a]: s };
|
|
695
694
|
}, {});
|
|
696
|
-
function
|
|
697
|
-
return
|
|
698
|
-
|
|
695
|
+
function nr() {
|
|
696
|
+
return Rn.useSyncExternalStore(
|
|
697
|
+
rr,
|
|
699
698
|
() => !0,
|
|
700
699
|
() => !1
|
|
701
700
|
);
|
|
702
701
|
}
|
|
703
|
-
function
|
|
702
|
+
function rr() {
|
|
704
703
|
return () => {
|
|
705
704
|
};
|
|
706
705
|
}
|
|
707
|
-
var It = "Avatar", [
|
|
708
|
-
(t,
|
|
709
|
-
const { __scopeAvatar: n, ...
|
|
706
|
+
var It = "Avatar", [or] = tr(It), [ir, Ia] = or(It), Aa = M.forwardRef(
|
|
707
|
+
(t, a) => {
|
|
708
|
+
const { __scopeAvatar: n, ...s } = t, [i, u] = M.useState("idle");
|
|
710
709
|
return /* @__PURE__ */ e(
|
|
711
|
-
|
|
710
|
+
ir,
|
|
712
711
|
{
|
|
713
712
|
scope: n,
|
|
714
|
-
imageLoadingStatus:
|
|
715
|
-
onImageLoadingStatusChange:
|
|
716
|
-
children: /* @__PURE__ */ e(Et.span, { ...
|
|
713
|
+
imageLoadingStatus: i,
|
|
714
|
+
onImageLoadingStatusChange: u,
|
|
715
|
+
children: /* @__PURE__ */ e(Et.span, { ...s, ref: a })
|
|
717
716
|
}
|
|
718
717
|
);
|
|
719
718
|
}
|
|
720
719
|
);
|
|
721
|
-
|
|
722
|
-
var
|
|
723
|
-
(t,
|
|
724
|
-
const { __scopeAvatar: n, src:
|
|
725
|
-
}, ...
|
|
726
|
-
|
|
720
|
+
Aa.displayName = It;
|
|
721
|
+
var La = "AvatarImage", Ma = M.forwardRef(
|
|
722
|
+
(t, a) => {
|
|
723
|
+
const { __scopeAvatar: n, src: s, onLoadingStatusChange: i = () => {
|
|
724
|
+
}, ...u } = t, l = Ia(La, n), p = cr(s, u), g = us((v) => {
|
|
725
|
+
i(v), l.onImageLoadingStatusChange(v);
|
|
727
726
|
});
|
|
728
727
|
return ut(() => {
|
|
729
|
-
|
|
730
|
-
}, [
|
|
728
|
+
p !== "idle" && g(p);
|
|
729
|
+
}, [p, g]), p === "loaded" ? /* @__PURE__ */ e(Et.img, { ...u, ref: a, src: s }) : null;
|
|
731
730
|
}
|
|
732
731
|
);
|
|
733
|
-
|
|
734
|
-
var Oa = "AvatarFallback", ka =
|
|
735
|
-
(t,
|
|
736
|
-
const { __scopeAvatar: n, delayMs:
|
|
737
|
-
return
|
|
738
|
-
if (
|
|
739
|
-
const
|
|
740
|
-
return () => window.clearTimeout(
|
|
732
|
+
Ma.displayName = La;
|
|
733
|
+
var Oa = "AvatarFallback", ka = M.forwardRef(
|
|
734
|
+
(t, a) => {
|
|
735
|
+
const { __scopeAvatar: n, delayMs: s, ...i } = t, u = Ia(Oa, n), [l, p] = M.useState(s === void 0);
|
|
736
|
+
return M.useEffect(() => {
|
|
737
|
+
if (s !== void 0) {
|
|
738
|
+
const g = window.setTimeout(() => p(!0), s);
|
|
739
|
+
return () => window.clearTimeout(g);
|
|
741
740
|
}
|
|
742
|
-
}, [
|
|
741
|
+
}, [s]), l && u.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Et.span, { ...i, ref: a }) : null;
|
|
743
742
|
}
|
|
744
743
|
);
|
|
745
744
|
ka.displayName = Oa;
|
|
746
|
-
function ca(t,
|
|
747
|
-
return t ?
|
|
745
|
+
function ca(t, a) {
|
|
746
|
+
return t ? a ? (t.src !== a && (t.src = a), t.complete && t.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
748
747
|
}
|
|
749
|
-
function
|
|
750
|
-
const
|
|
751
|
-
() => ca(
|
|
748
|
+
function cr(t, { referrerPolicy: a, crossOrigin: n }) {
|
|
749
|
+
const s = nr(), i = M.useRef(null), u = s ? (i.current || (i.current = new window.Image()), i.current) : null, [l, p] = M.useState(
|
|
750
|
+
() => ca(u, t)
|
|
752
751
|
);
|
|
753
752
|
return ut(() => {
|
|
754
|
-
|
|
755
|
-
}, [
|
|
756
|
-
const
|
|
757
|
-
|
|
753
|
+
p(ca(u, t));
|
|
754
|
+
}, [u, t]), ut(() => {
|
|
755
|
+
const g = (f) => () => {
|
|
756
|
+
p(f);
|
|
758
757
|
};
|
|
759
|
-
if (!
|
|
760
|
-
const v =
|
|
761
|
-
return
|
|
762
|
-
|
|
758
|
+
if (!u) return;
|
|
759
|
+
const v = g("loaded"), m = g("error");
|
|
760
|
+
return u.addEventListener("load", v), u.addEventListener("error", m), a && (u.referrerPolicy = a), typeof n == "string" && (u.crossOrigin = n), () => {
|
|
761
|
+
u.removeEventListener("load", v), u.removeEventListener("error", m);
|
|
763
762
|
};
|
|
764
|
-
}, [
|
|
763
|
+
}, [u, n, a]), l;
|
|
765
764
|
}
|
|
766
|
-
var Pa =
|
|
767
|
-
const
|
|
765
|
+
var Pa = Aa, Ta = Ma, _a = ka;
|
|
766
|
+
const At = M.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
768
767
|
Pa,
|
|
769
768
|
{
|
|
770
769
|
ref: n,
|
|
771
|
-
className:
|
|
770
|
+
className: J(
|
|
772
771
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
773
772
|
t
|
|
774
773
|
),
|
|
775
|
-
...
|
|
774
|
+
...a
|
|
776
775
|
}
|
|
777
776
|
));
|
|
778
|
-
|
|
779
|
-
const
|
|
777
|
+
At.displayName = Pa.displayName;
|
|
778
|
+
const lr = M.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
780
779
|
Ta,
|
|
781
780
|
{
|
|
782
781
|
ref: n,
|
|
783
|
-
className:
|
|
784
|
-
...
|
|
782
|
+
className: J("aspect-square h-full w-full", t),
|
|
783
|
+
...a
|
|
785
784
|
}
|
|
786
785
|
));
|
|
787
|
-
|
|
788
|
-
const
|
|
786
|
+
lr.displayName = Ta.displayName;
|
|
787
|
+
const Lt = M.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
789
788
|
_a,
|
|
790
789
|
{
|
|
791
790
|
ref: n,
|
|
792
|
-
className:
|
|
791
|
+
className: J(
|
|
793
792
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
794
793
|
t
|
|
795
794
|
),
|
|
796
|
-
...
|
|
795
|
+
...a
|
|
797
796
|
}
|
|
798
797
|
));
|
|
799
|
-
|
|
800
|
-
function
|
|
798
|
+
Lt.displayName = _a.displayName;
|
|
799
|
+
function dr({
|
|
801
800
|
open: t,
|
|
802
|
-
onOpenChange:
|
|
801
|
+
onOpenChange: a,
|
|
803
802
|
group: n,
|
|
804
|
-
onUpdate:
|
|
803
|
+
onUpdate: s
|
|
805
804
|
}) {
|
|
806
|
-
const [
|
|
805
|
+
const [i, u] = N("members"), [l, p] = N(""), [g, v] = N([]), [m, f] = N([]), { data: h, isLoading: d, refetch: r } = Os(n.id), b = n.type === "TENANT_GROUP" ? "tenant" : "organization", { users: D, isLoading: w } = ks({
|
|
807
806
|
type: b,
|
|
808
807
|
tenantId: n.tenantId || void 0,
|
|
809
808
|
active: !0,
|
|
810
809
|
limit: 100
|
|
811
|
-
}),
|
|
810
|
+
}), C = Xn(), E = Zn(), O = (h == null ? void 0 : h.members) || [], I = F(() => new Set(O.map((y) => y.userId)), [O]), V = F(() => D.filter((y) => !I.has(y.id)), [D, I]), z = F(() => {
|
|
812
811
|
if (!l) return V;
|
|
813
812
|
const y = l.toLowerCase();
|
|
814
813
|
return V.filter(
|
|
815
814
|
(k) => {
|
|
816
|
-
var G,
|
|
817
|
-
return ((G = k.name) == null ? void 0 : G.toLowerCase().includes(y)) || ((
|
|
815
|
+
var G, H;
|
|
816
|
+
return ((G = k.name) == null ? void 0 : G.toLowerCase().includes(y)) || ((H = k.email) == null ? void 0 : H.toLowerCase().includes(y));
|
|
818
817
|
}
|
|
819
818
|
);
|
|
820
819
|
}, [V, l]), x = F(() => {
|
|
@@ -822,45 +821,45 @@ function cr({
|
|
|
822
821
|
const y = l.toLowerCase();
|
|
823
822
|
return O.filter(
|
|
824
823
|
(k) => {
|
|
825
|
-
var G,
|
|
826
|
-
return ((
|
|
824
|
+
var G, H, me, te;
|
|
825
|
+
return ((H = (G = k.user) == null ? void 0 : G.name) == null ? void 0 : H.toLowerCase().includes(y)) || ((te = (me = k.user) == null ? void 0 : me.email) == null ? void 0 : te.toLowerCase().includes(y));
|
|
827
826
|
}
|
|
828
827
|
);
|
|
829
828
|
}, [O, l]), B = async () => {
|
|
830
|
-
if (
|
|
829
|
+
if (g.length !== 0)
|
|
831
830
|
try {
|
|
832
|
-
await
|
|
831
|
+
await C.mutateAsync({
|
|
833
832
|
groupId: n.id,
|
|
834
833
|
data: {
|
|
835
|
-
userIds:
|
|
834
|
+
userIds: g,
|
|
836
835
|
userType: b === "tenant" ? "tenant" : "org"
|
|
837
836
|
}
|
|
838
|
-
}), v([]),
|
|
837
|
+
}), v([]), u("members"), r(), s == null || s();
|
|
839
838
|
} catch (y) {
|
|
840
839
|
console.error("Failed to add members:", y);
|
|
841
840
|
}
|
|
842
|
-
},
|
|
843
|
-
if (
|
|
841
|
+
}, Q = async () => {
|
|
842
|
+
if (m.length !== 0)
|
|
844
843
|
try {
|
|
845
844
|
await E.mutateAsync({
|
|
846
845
|
groupId: n.id,
|
|
847
846
|
data: {
|
|
848
|
-
userIds:
|
|
847
|
+
userIds: m
|
|
849
848
|
}
|
|
850
|
-
}),
|
|
849
|
+
}), f([]), r(), s == null || s();
|
|
851
850
|
} catch (y) {
|
|
852
851
|
console.error("Failed to remove members:", y);
|
|
853
852
|
}
|
|
854
|
-
},
|
|
853
|
+
}, Z = (y) => {
|
|
855
854
|
v(
|
|
856
855
|
(k) => k.includes(y) ? k.filter((G) => G !== y) : [...k, y]
|
|
857
856
|
);
|
|
858
857
|
}, ee = (y) => {
|
|
859
|
-
|
|
858
|
+
f(
|
|
860
859
|
(k) => k.includes(y) ? k.filter((G) => G !== y) : [...k, y]
|
|
861
860
|
);
|
|
862
861
|
};
|
|
863
|
-
return /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(Ge, { open: t, onOpenChange:
|
|
862
|
+
return /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(Ge, { open: t, onOpenChange: a, children: /* @__PURE__ */ c($e, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
864
863
|
/* @__PURE__ */ c(Ve, { children: [
|
|
865
864
|
/* @__PURE__ */ e(ze, { children: n.name }),
|
|
866
865
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: [
|
|
@@ -874,8 +873,8 @@ function cr({
|
|
|
874
873
|
" group"
|
|
875
874
|
] })
|
|
876
875
|
] }),
|
|
877
|
-
/* @__PURE__ */ c(ma, { value:
|
|
878
|
-
|
|
876
|
+
/* @__PURE__ */ c(ma, { value: i, onValueChange: (y) => {
|
|
877
|
+
u(y), p(""), f([]);
|
|
879
878
|
}, className: "mt-4", children: [
|
|
880
879
|
/* @__PURE__ */ c(ha, { className: "grid w-full grid-cols-2", children: [
|
|
881
880
|
/* @__PURE__ */ e(_e, { value: "members", children: "Current Members" }),
|
|
@@ -889,40 +888,40 @@ function cr({
|
|
|
889
888
|
{
|
|
890
889
|
placeholder: "Search members...",
|
|
891
890
|
value: l,
|
|
892
|
-
onChange: (y) =>
|
|
891
|
+
onChange: (y) => p(y.target.value),
|
|
893
892
|
className: "pl-10"
|
|
894
893
|
}
|
|
895
894
|
)
|
|
896
895
|
] }),
|
|
897
|
-
/* @__PURE__ */ e(mt, { className:
|
|
896
|
+
/* @__PURE__ */ e(mt, { className: m.length > 0 ? "h-[300px]" : "h-[350px]", children: d ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((y) => /* @__PURE__ */ e(ft, { className: "h-16 w-full" }, y)) }) : x.length === 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
898
897
|
/* @__PURE__ */ e(Ct, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
899
898
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: l ? "No members found" : "No members yet" }),
|
|
900
899
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
|
|
901
900
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: x.map((y) => /* @__PURE__ */ e(
|
|
902
|
-
|
|
901
|
+
ur,
|
|
903
902
|
{
|
|
904
903
|
member: y,
|
|
905
|
-
selected:
|
|
904
|
+
selected: m.includes(y.userId),
|
|
906
905
|
onToggle: () => ee(y.userId)
|
|
907
906
|
},
|
|
908
907
|
y.id
|
|
909
908
|
)) }) }),
|
|
910
|
-
|
|
909
|
+
m.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
911
910
|
/* @__PURE__ */ c("span", { className: "text-sm text-muted-foreground", children: [
|
|
912
|
-
|
|
911
|
+
m.length,
|
|
913
912
|
" member",
|
|
914
|
-
|
|
913
|
+
m.length !== 1 ? "s" : "",
|
|
915
914
|
" selected"
|
|
916
915
|
] }),
|
|
917
916
|
/* @__PURE__ */ e(
|
|
918
|
-
|
|
917
|
+
L,
|
|
919
918
|
{
|
|
920
919
|
variant: "destructive",
|
|
921
920
|
size: "sm",
|
|
922
|
-
onClick:
|
|
921
|
+
onClick: Q,
|
|
923
922
|
disabled: E.isPending,
|
|
924
923
|
children: E.isPending ? /* @__PURE__ */ c(T, { children: [
|
|
925
|
-
/* @__PURE__ */ e(
|
|
924
|
+
/* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
926
925
|
"Removing..."
|
|
927
926
|
] }) : /* @__PURE__ */ c(T, { children: [
|
|
928
927
|
/* @__PURE__ */ e(va, { className: "mr-2 h-4 w-4" }),
|
|
@@ -940,7 +939,7 @@ function cr({
|
|
|
940
939
|
{
|
|
941
940
|
placeholder: "Search users to add...",
|
|
942
941
|
value: l,
|
|
943
|
-
onChange: (y) =>
|
|
942
|
+
onChange: (y) => p(y.target.value),
|
|
944
943
|
className: "pl-10"
|
|
945
944
|
}
|
|
946
945
|
)
|
|
@@ -950,28 +949,28 @@ function cr({
|
|
|
950
949
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
951
950
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "All eligible users are already members" })
|
|
952
951
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: z.map((y) => /* @__PURE__ */ e(
|
|
953
|
-
|
|
952
|
+
mr,
|
|
954
953
|
{
|
|
955
954
|
user: y,
|
|
956
|
-
selected:
|
|
957
|
-
onToggle: () =>
|
|
955
|
+
selected: g.includes(y.id),
|
|
956
|
+
onToggle: () => Z(y.id)
|
|
958
957
|
},
|
|
959
958
|
y.id
|
|
960
959
|
)) }) }),
|
|
961
|
-
|
|
960
|
+
g.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
962
961
|
/* @__PURE__ */ c("span", { className: "text-sm text-muted-foreground", children: [
|
|
963
|
-
|
|
962
|
+
g.length,
|
|
964
963
|
" user",
|
|
965
|
-
|
|
964
|
+
g.length !== 1 ? "s" : "",
|
|
966
965
|
" selected"
|
|
967
966
|
] }),
|
|
968
967
|
/* @__PURE__ */ e(
|
|
969
|
-
|
|
968
|
+
L,
|
|
970
969
|
{
|
|
971
970
|
onClick: B,
|
|
972
|
-
disabled:
|
|
973
|
-
children:
|
|
974
|
-
/* @__PURE__ */ e(
|
|
971
|
+
disabled: C.isPending,
|
|
972
|
+
children: C.isPending ? /* @__PURE__ */ c(T, { children: [
|
|
973
|
+
/* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
975
974
|
"Adding..."
|
|
976
975
|
] }) : /* @__PURE__ */ c(T, { children: [
|
|
977
976
|
/* @__PURE__ */ e(gt, { className: "mr-2 h-4 w-4" }),
|
|
@@ -984,44 +983,44 @@ function cr({
|
|
|
984
983
|
] })
|
|
985
984
|
] }) }) });
|
|
986
985
|
}
|
|
987
|
-
function
|
|
986
|
+
function ur({
|
|
988
987
|
member: t,
|
|
989
|
-
selected:
|
|
988
|
+
selected: a,
|
|
990
989
|
onToggle: n
|
|
991
990
|
}) {
|
|
992
|
-
var
|
|
993
|
-
const
|
|
991
|
+
var i, u, l, p;
|
|
992
|
+
const s = ((u = (i = t.user) == null ? void 0 : i.name) == null ? void 0 : u.split(" ").map((g) => g[0]).join("").toUpperCase()) || "?";
|
|
994
993
|
return /* @__PURE__ */ c(
|
|
995
994
|
"div",
|
|
996
995
|
{
|
|
997
996
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
998
997
|
onClick: n,
|
|
999
998
|
children: [
|
|
1000
|
-
/* @__PURE__ */ e(ba, { checked:
|
|
1001
|
-
/* @__PURE__ */ e(
|
|
999
|
+
/* @__PURE__ */ e(ba, { checked: a }),
|
|
1000
|
+
/* @__PURE__ */ e(At, { className: "h-8 w-8", children: /* @__PURE__ */ e(Lt, { className: "text-xs", children: s }) }),
|
|
1002
1001
|
/* @__PURE__ */ c("div", { className: "flex-1", children: [
|
|
1003
1002
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((l = t.user) == null ? void 0 : l.name) || "Unknown User" }),
|
|
1004
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (
|
|
1003
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (p = t.user) == null ? void 0 : p.email })
|
|
1005
1004
|
] })
|
|
1006
1005
|
]
|
|
1007
1006
|
}
|
|
1008
1007
|
);
|
|
1009
1008
|
}
|
|
1010
|
-
function
|
|
1009
|
+
function mr({
|
|
1011
1010
|
user: t,
|
|
1012
|
-
selected:
|
|
1011
|
+
selected: a,
|
|
1013
1012
|
onToggle: n
|
|
1014
1013
|
}) {
|
|
1015
|
-
var
|
|
1016
|
-
const
|
|
1014
|
+
var i;
|
|
1015
|
+
const s = ((i = t.name) == null ? void 0 : i.split(" ").map((u) => u[0]).join("").toUpperCase()) || "?";
|
|
1017
1016
|
return /* @__PURE__ */ c(
|
|
1018
1017
|
"div",
|
|
1019
1018
|
{
|
|
1020
1019
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1021
1020
|
onClick: n,
|
|
1022
1021
|
children: [
|
|
1023
|
-
/* @__PURE__ */ e(ba, { checked:
|
|
1024
|
-
/* @__PURE__ */ e(
|
|
1022
|
+
/* @__PURE__ */ e(ba, { checked: a }),
|
|
1023
|
+
/* @__PURE__ */ e(At, { className: "h-8 w-8", children: /* @__PURE__ */ e(Lt, { className: "text-xs", children: s }) }),
|
|
1025
1024
|
/* @__PURE__ */ c("div", { className: "flex-1", children: [
|
|
1026
1025
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: t.name }),
|
|
1027
1026
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: t.email })
|
|
@@ -1030,33 +1029,33 @@ function dr({
|
|
|
1030
1029
|
}
|
|
1031
1030
|
);
|
|
1032
1031
|
}
|
|
1033
|
-
function
|
|
1032
|
+
function hr({
|
|
1034
1033
|
open: t,
|
|
1035
|
-
onOpenChange:
|
|
1034
|
+
onOpenChange: a
|
|
1036
1035
|
}) {
|
|
1037
|
-
const [n,
|
|
1036
|
+
const [n, s] = N("groups"), [i, u] = N(""), [l, p] = N(null), [g, v] = N(!1), [m, f] = N(null), { tokenProps: h } = j(), { currentUser: d } = Dt(), r = Yn(), b = (d == null ? void 0 : d.type) === "tenant", D = h == null ? void 0 : h.tenantId, { groups: w, isLoading: C, refetch: E } = Ps({
|
|
1038
1037
|
type: b ? "TENANT_GROUP" : "all",
|
|
1039
|
-
tenantId: b ?
|
|
1038
|
+
tenantId: b ? D : void 0,
|
|
1040
1039
|
includeMembers: !1
|
|
1041
1040
|
}), O = w.filter(
|
|
1042
1041
|
(x) => {
|
|
1043
1042
|
var B;
|
|
1044
|
-
return x.name.toLowerCase().includes(
|
|
1043
|
+
return x.name.toLowerCase().includes(i.toLowerCase()) || ((B = x.description) == null ? void 0 : B.toLowerCase().includes(i.toLowerCase()));
|
|
1045
1044
|
}
|
|
1046
1045
|
), I = async () => {
|
|
1047
|
-
if (
|
|
1046
|
+
if (m)
|
|
1048
1047
|
try {
|
|
1049
|
-
await
|
|
1048
|
+
await r.mutateAsync(m.id), f(null), E();
|
|
1050
1049
|
} catch (x) {
|
|
1051
1050
|
console.error("Failed to delete group:", x);
|
|
1052
1051
|
}
|
|
1053
1052
|
}, V = (x) => {
|
|
1054
|
-
|
|
1053
|
+
p(x), v(!0);
|
|
1055
1054
|
}, z = () => {
|
|
1056
|
-
|
|
1055
|
+
s("groups"), E();
|
|
1057
1056
|
};
|
|
1058
1057
|
return /* @__PURE__ */ c(T, { children: [
|
|
1059
|
-
/* @__PURE__ */ e(Ge, { open: t, onOpenChange:
|
|
1058
|
+
/* @__PURE__ */ e(Ge, { open: t, onOpenChange: a, children: /* @__PURE__ */ c($e, { className: "max-h-[80vh] max-w-3xl rounded-[6px] border-border/60 sm:rounded-[6px]", children: [
|
|
1060
1059
|
/* @__PURE__ */ c(Ve, { children: [
|
|
1061
1060
|
/* @__PURE__ */ e(ze, { className: "text-[15px]", children: "Group management" }),
|
|
1062
1061
|
/* @__PURE__ */ e(wt, { className: "text-[13px] leading-5", children: "Manage groups, create new ones, and control membership." })
|
|
@@ -1065,7 +1064,7 @@ function ur({
|
|
|
1065
1064
|
ma,
|
|
1066
1065
|
{
|
|
1067
1066
|
value: n,
|
|
1068
|
-
onValueChange:
|
|
1067
|
+
onValueChange: s,
|
|
1069
1068
|
className: "mt-2",
|
|
1070
1069
|
children: [
|
|
1071
1070
|
/* @__PURE__ */ c(ha, { className: "h-8 w-full justify-start gap-1 bg-transparent p-0 border-b border-border/60 rounded-none", children: [
|
|
@@ -1094,13 +1093,13 @@ function ur({
|
|
|
1094
1093
|
{
|
|
1095
1094
|
size: "xs",
|
|
1096
1095
|
placeholder: "Search groups…",
|
|
1097
|
-
value:
|
|
1098
|
-
onChange: (x) =>
|
|
1096
|
+
value: i,
|
|
1097
|
+
onChange: (x) => u(x.target.value),
|
|
1099
1098
|
className: "pl-7"
|
|
1100
1099
|
}
|
|
1101
1100
|
)
|
|
1102
1101
|
] }),
|
|
1103
|
-
/* @__PURE__ */ e(mt, { className: "h-[400px]", children:
|
|
1102
|
+
/* @__PURE__ */ e(mt, { className: "h-[400px]", children: C ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((x) => /* @__PURE__ */ e(
|
|
1104
1103
|
ft,
|
|
1105
1104
|
{
|
|
1106
1105
|
className: "h-16 w-full rounded-[6px]"
|
|
@@ -1108,23 +1107,23 @@ function ur({
|
|
|
1108
1107
|
x
|
|
1109
1108
|
)) }) : O.length === 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
1110
1109
|
/* @__PURE__ */ e("p", { className: "text-[13px]", children: "No groups found." }),
|
|
1111
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-[12px]", children:
|
|
1110
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-[12px]", children: i ? "Try a different search." : "Create your first group to get started." })
|
|
1112
1111
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2 pr-2", children: O.map((x) => /* @__PURE__ */ e(
|
|
1113
|
-
|
|
1112
|
+
pr,
|
|
1114
1113
|
{
|
|
1115
1114
|
group: x,
|
|
1116
1115
|
onManageMembers: () => V(x),
|
|
1117
|
-
onDelete: () =>
|
|
1118
|
-
currentUserId:
|
|
1116
|
+
onDelete: () => f(x),
|
|
1117
|
+
currentUserId: d == null ? void 0 : d.id
|
|
1119
1118
|
},
|
|
1120
1119
|
x.id
|
|
1121
1120
|
)) }) })
|
|
1122
1121
|
] }) }),
|
|
1123
1122
|
/* @__PURE__ */ e(Ue, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1124
|
-
|
|
1123
|
+
er,
|
|
1125
1124
|
{
|
|
1126
1125
|
onSuccess: z,
|
|
1127
|
-
tenantId:
|
|
1126
|
+
tenantId: D,
|
|
1128
1127
|
isTenantUser: b
|
|
1129
1128
|
}
|
|
1130
1129
|
) })
|
|
@@ -1133,9 +1132,9 @@ function ur({
|
|
|
1133
1132
|
)
|
|
1134
1133
|
] }) }),
|
|
1135
1134
|
l && /* @__PURE__ */ e(
|
|
1136
|
-
|
|
1135
|
+
dr,
|
|
1137
1136
|
{
|
|
1138
|
-
open:
|
|
1137
|
+
open: g,
|
|
1139
1138
|
onOpenChange: v,
|
|
1140
1139
|
group: l,
|
|
1141
1140
|
onUpdate: () => E()
|
|
@@ -1144,14 +1143,14 @@ function ur({
|
|
|
1144
1143
|
/* @__PURE__ */ e(
|
|
1145
1144
|
ya,
|
|
1146
1145
|
{
|
|
1147
|
-
open: !!
|
|
1148
|
-
onOpenChange: () =>
|
|
1146
|
+
open: !!m,
|
|
1147
|
+
onOpenChange: () => f(null),
|
|
1149
1148
|
children: /* @__PURE__ */ c(xa, { children: [
|
|
1150
|
-
/* @__PURE__ */ c(
|
|
1151
|
-
/* @__PURE__ */ e(
|
|
1149
|
+
/* @__PURE__ */ c(Na, { children: [
|
|
1150
|
+
/* @__PURE__ */ e(Sa, { children: "Delete group" }),
|
|
1152
1151
|
/* @__PURE__ */ c(wa, { children: [
|
|
1153
1152
|
'Delete "',
|
|
1154
|
-
|
|
1153
|
+
m == null ? void 0 : m.name,
|
|
1155
1154
|
`"? This removes all members and can't be undone.`
|
|
1156
1155
|
] })
|
|
1157
1156
|
] }),
|
|
@@ -1161,10 +1160,10 @@ function ur({
|
|
|
1161
1160
|
vt,
|
|
1162
1161
|
{
|
|
1163
1162
|
onClick: I,
|
|
1164
|
-
disabled:
|
|
1163
|
+
disabled: r.isPending,
|
|
1165
1164
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1166
|
-
children:
|
|
1167
|
-
/* @__PURE__ */ e(
|
|
1165
|
+
children: r.isPending ? /* @__PURE__ */ c(T, { children: [
|
|
1166
|
+
/* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1168
1167
|
"Deleting…"
|
|
1169
1168
|
] }) : "Delete group"
|
|
1170
1169
|
}
|
|
@@ -1175,13 +1174,13 @@ function ur({
|
|
|
1175
1174
|
)
|
|
1176
1175
|
] });
|
|
1177
1176
|
}
|
|
1178
|
-
function
|
|
1177
|
+
function pr({
|
|
1179
1178
|
group: t,
|
|
1180
|
-
onManageMembers:
|
|
1179
|
+
onManageMembers: a,
|
|
1181
1180
|
onDelete: n,
|
|
1182
|
-
currentUserId:
|
|
1181
|
+
currentUserId: s
|
|
1183
1182
|
}) {
|
|
1184
|
-
const
|
|
1183
|
+
const i = t.createdBy === s;
|
|
1185
1184
|
return /* @__PURE__ */ e("div", { className: "rounded-[6px] border border-border/60 bg-card px-3 py-2.5 transition-colors hover:bg-muted/30", children: /* @__PURE__ */ c("div", { className: "flex items-start justify-between gap-2", children: [
|
|
1186
1185
|
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
1187
1186
|
/* @__PURE__ */ e("h4", { className: "text-[13px] font-medium text-foreground", children: t.name }),
|
|
@@ -1195,25 +1194,25 @@ function mr({
|
|
|
1195
1194
|
] }),
|
|
1196
1195
|
/* @__PURE__ */ c("span", { children: [
|
|
1197
1196
|
"Created ",
|
|
1198
|
-
|
|
1197
|
+
Sn(new Date(t.createdAt), "MMM d, yyyy")
|
|
1199
1198
|
] })
|
|
1200
1199
|
] })
|
|
1201
1200
|
] }),
|
|
1202
1201
|
/* @__PURE__ */ c("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
1203
1202
|
/* @__PURE__ */ e(
|
|
1204
|
-
|
|
1203
|
+
L,
|
|
1205
1204
|
{
|
|
1206
1205
|
variant: "ghost",
|
|
1207
1206
|
size: "xs",
|
|
1208
1207
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
|
|
1209
|
-
onClick:
|
|
1208
|
+
onClick: a,
|
|
1210
1209
|
title: "Manage members",
|
|
1211
1210
|
"aria-label": "Manage members",
|
|
1212
1211
|
children: /* @__PURE__ */ e(gt, { className: "h-3.5 w-3.5" })
|
|
1213
1212
|
}
|
|
1214
1213
|
),
|
|
1215
|
-
|
|
1216
|
-
|
|
1214
|
+
i && /* @__PURE__ */ e(
|
|
1215
|
+
L,
|
|
1217
1216
|
{
|
|
1218
1217
|
variant: "ghost",
|
|
1219
1218
|
size: "xs",
|
|
@@ -1227,108 +1226,108 @@ function mr({
|
|
|
1227
1226
|
] })
|
|
1228
1227
|
] }) });
|
|
1229
1228
|
}
|
|
1230
|
-
function ce(t,
|
|
1231
|
-
var
|
|
1232
|
-
const
|
|
1233
|
-
(
|
|
1229
|
+
function ce(t, a, n) {
|
|
1230
|
+
var u, l;
|
|
1231
|
+
const s = (t.controls || []).find(
|
|
1232
|
+
(p) => p.id === n
|
|
1234
1233
|
);
|
|
1235
|
-
if (
|
|
1236
|
-
return
|
|
1237
|
-
const
|
|
1238
|
-
(
|
|
1234
|
+
if (s)
|
|
1235
|
+
return s.label;
|
|
1236
|
+
const i = (l = (u = pa(t, a)) == null ? void 0 : u.controls) == null ? void 0 : l.find(
|
|
1237
|
+
(p) => p.id === n
|
|
1239
1238
|
);
|
|
1240
|
-
return (
|
|
1239
|
+
return (i == null ? void 0 : i.label) || n;
|
|
1241
1240
|
}
|
|
1242
|
-
function le(t,
|
|
1241
|
+
function le(t, a) {
|
|
1243
1242
|
var n;
|
|
1244
|
-
return ((n = pa(t,
|
|
1243
|
+
return ((n = pa(t, a)) == null ? void 0 : n.title) || a;
|
|
1245
1244
|
}
|
|
1246
|
-
function
|
|
1247
|
-
const { errors:
|
|
1245
|
+
function fr(t) {
|
|
1246
|
+
const { errors: a, dashboard: n } = t;
|
|
1248
1247
|
if (!n)
|
|
1249
|
-
return
|
|
1250
|
-
const
|
|
1251
|
-
for (const
|
|
1252
|
-
const
|
|
1248
|
+
return a;
|
|
1249
|
+
const s = /* @__PURE__ */ new Map();
|
|
1250
|
+
for (const i of a) {
|
|
1251
|
+
const u = i.match(
|
|
1253
1252
|
/^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
|
|
1254
1253
|
);
|
|
1255
|
-
if (
|
|
1256
|
-
const [,
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
`"${le(n,
|
|
1254
|
+
if (u) {
|
|
1255
|
+
const [, m, f] = u, h = `${m}:${f}:missing-metric`;
|
|
1256
|
+
s.has(h) || s.set(
|
|
1257
|
+
h,
|
|
1258
|
+
`"${le(n, m)}" has an outdated "${ce(
|
|
1260
1259
|
n,
|
|
1261
|
-
|
|
1262
|
-
|
|
1260
|
+
m,
|
|
1261
|
+
f
|
|
1263
1262
|
)}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1264
1263
|
);
|
|
1265
1264
|
continue;
|
|
1266
1265
|
}
|
|
1267
|
-
const l =
|
|
1266
|
+
const l = i.match(
|
|
1268
1267
|
/^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
|
|
1269
1268
|
);
|
|
1270
1269
|
if (l) {
|
|
1271
|
-
const [,
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
`"${le(n,
|
|
1270
|
+
const [, m, f] = l, h = `${m}:${f}:missing-group-by`;
|
|
1271
|
+
s.has(h) || s.set(
|
|
1272
|
+
h,
|
|
1273
|
+
`"${le(n, m)}" has an outdated "${ce(
|
|
1275
1274
|
n,
|
|
1276
|
-
|
|
1277
|
-
|
|
1275
|
+
m,
|
|
1276
|
+
f
|
|
1278
1277
|
)}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1279
1278
|
);
|
|
1280
1279
|
continue;
|
|
1281
1280
|
}
|
|
1282
|
-
const
|
|
1281
|
+
const p = i.match(
|
|
1283
1282
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
|
|
1284
1283
|
);
|
|
1285
|
-
if (
|
|
1286
|
-
const [,
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
`"${le(n,
|
|
1284
|
+
if (p) {
|
|
1285
|
+
const [, m, f] = p, h = `${m}:${f}:invalid-metric`;
|
|
1286
|
+
s.has(h) || s.set(
|
|
1287
|
+
h,
|
|
1288
|
+
`"${le(n, m)}" has an invalid "${ce(
|
|
1290
1289
|
n,
|
|
1291
|
-
|
|
1292
|
-
|
|
1290
|
+
m,
|
|
1291
|
+
f
|
|
1293
1292
|
)}" metric mapping. Open the card controls and choose a valid metric for each option.`
|
|
1294
1293
|
);
|
|
1295
1294
|
continue;
|
|
1296
1295
|
}
|
|
1297
|
-
const
|
|
1296
|
+
const g = i.match(
|
|
1298
1297
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
|
|
1299
1298
|
);
|
|
1300
|
-
if (
|
|
1301
|
-
const [,
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
`"${le(n,
|
|
1299
|
+
if (g) {
|
|
1300
|
+
const [, m, f] = g, h = `${m}:${f}:invalid-group-by`;
|
|
1301
|
+
s.has(h) || s.set(
|
|
1302
|
+
h,
|
|
1303
|
+
`"${le(n, m)}" has an invalid "${ce(
|
|
1305
1304
|
n,
|
|
1306
|
-
|
|
1307
|
-
|
|
1305
|
+
m,
|
|
1306
|
+
f
|
|
1308
1307
|
)}" field mapping. Open the card controls and choose a valid field for each option.`
|
|
1309
1308
|
);
|
|
1310
1309
|
continue;
|
|
1311
1310
|
}
|
|
1312
|
-
const v =
|
|
1311
|
+
const v = i.match(
|
|
1313
1312
|
/^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
|
|
1314
1313
|
);
|
|
1315
1314
|
if (v) {
|
|
1316
|
-
const [,
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
`"${le(n,
|
|
1315
|
+
const [, m, f] = v, h = `${m}:${f}:missing-temporal-group-by`;
|
|
1316
|
+
s.has(h) || s.set(
|
|
1317
|
+
h,
|
|
1318
|
+
`"${le(n, m)}" can no longer use "${ce(
|
|
1320
1319
|
n,
|
|
1321
|
-
|
|
1322
|
-
|
|
1320
|
+
m,
|
|
1321
|
+
f
|
|
1323
1322
|
)}" for time grain because the card does not currently group by a date field.`
|
|
1324
1323
|
);
|
|
1325
1324
|
continue;
|
|
1326
1325
|
}
|
|
1327
|
-
|
|
1326
|
+
s.set(i, i);
|
|
1328
1327
|
}
|
|
1329
|
-
return Array.from(
|
|
1328
|
+
return Array.from(s.values());
|
|
1330
1329
|
}
|
|
1331
|
-
const
|
|
1330
|
+
const gr = [
|
|
1332
1331
|
"enum",
|
|
1333
1332
|
"multi_enum",
|
|
1334
1333
|
"text",
|
|
@@ -1336,69 +1335,76 @@ const pr = [
|
|
|
1336
1335
|
"boolean",
|
|
1337
1336
|
"date"
|
|
1338
1337
|
];
|
|
1339
|
-
function
|
|
1338
|
+
function vr({
|
|
1340
1339
|
open: t,
|
|
1341
|
-
onOpenChange:
|
|
1340
|
+
onOpenChange: a,
|
|
1342
1341
|
initialMode: n = "manage"
|
|
1343
1342
|
}) {
|
|
1344
1343
|
var z;
|
|
1345
|
-
const
|
|
1346
|
-
forceClose:
|
|
1347
|
-
handleOpenChange:
|
|
1344
|
+
const s = n === "create", {
|
|
1345
|
+
forceClose: i,
|
|
1346
|
+
handleOpenChange: u,
|
|
1348
1347
|
isCreateFlowActive: l,
|
|
1349
|
-
preventPassiveDismissDuringCreate:
|
|
1350
|
-
resolvedOpen:
|
|
1348
|
+
preventPassiveDismissDuringCreate: p,
|
|
1349
|
+
resolvedOpen: g,
|
|
1351
1350
|
setIsCreateFlowActive: v
|
|
1352
|
-
} =
|
|
1351
|
+
} = En({
|
|
1353
1352
|
open: t,
|
|
1354
|
-
onOpenChange:
|
|
1353
|
+
onOpenChange: a,
|
|
1355
1354
|
initialCreateFlowActive: n === "create",
|
|
1356
1355
|
dismissMode: "explicit-only"
|
|
1357
|
-
}),
|
|
1358
|
-
(x) => x.id ===
|
|
1359
|
-
),
|
|
1360
|
-
() =>
|
|
1361
|
-
[
|
|
1362
|
-
),
|
|
1356
|
+
}), m = S((x) => x.dashboard), f = S((x) => x.selectedSheetId), { setDashboardInputs: h } = St(), d = (z = m.sheets) == null ? void 0 : z.find(
|
|
1357
|
+
(x) => x.id === f
|
|
1358
|
+
), r = (d == null ? void 0 : d.kind) === "document" && !!d.document, b = F(
|
|
1359
|
+
() => r && (d != null && d.document) ? Ts(m, d.id) : [],
|
|
1360
|
+
[m, r, d == null ? void 0 : d.document, d == null ? void 0 : d.id]
|
|
1361
|
+
), D = F(
|
|
1363
1362
|
() => b.filter(
|
|
1364
1363
|
(x) => x.kind === "control"
|
|
1365
1364
|
),
|
|
1366
1365
|
[b]
|
|
1367
1366
|
), w = F(
|
|
1368
|
-
() =>
|
|
1369
|
-
[
|
|
1370
|
-
),
|
|
1371
|
-
() =>
|
|
1367
|
+
() => D.map((x) => x.control),
|
|
1368
|
+
[D]
|
|
1369
|
+
), C = F(
|
|
1370
|
+
() => yr(w),
|
|
1372
1371
|
[w]
|
|
1373
1372
|
), E = F(
|
|
1374
|
-
() =>
|
|
1375
|
-
[
|
|
1373
|
+
() => br(m),
|
|
1374
|
+
[m]
|
|
1376
1375
|
), O = Fe(() => {
|
|
1377
|
-
if (
|
|
1378
|
-
|
|
1376
|
+
if (s) {
|
|
1377
|
+
i();
|
|
1379
1378
|
return;
|
|
1380
1379
|
}
|
|
1381
1380
|
v(!1);
|
|
1382
|
-
}, [
|
|
1383
|
-
(x, B,
|
|
1384
|
-
!
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1381
|
+
}, [s, i, v]), I = Fe(
|
|
1382
|
+
(x, B, Q) => {
|
|
1383
|
+
!r || !(d != null && d.document) || h(
|
|
1384
|
+
Nr({
|
|
1385
|
+
allInputs: m.inputs || [],
|
|
1386
|
+
documentSheetId: d.id,
|
|
1387
|
+
currentDocumentInputs: b,
|
|
1388
1388
|
nextControls: x,
|
|
1389
1389
|
nextDefaultValues: B,
|
|
1390
|
-
change:
|
|
1390
|
+
change: Q
|
|
1391
1391
|
})
|
|
1392
|
-
|
|
1392
|
+
);
|
|
1393
1393
|
},
|
|
1394
|
-
[
|
|
1394
|
+
[
|
|
1395
|
+
m.inputs,
|
|
1396
|
+
b,
|
|
1397
|
+
r,
|
|
1398
|
+
d,
|
|
1399
|
+
h
|
|
1400
|
+
]
|
|
1395
1401
|
);
|
|
1396
|
-
return !
|
|
1402
|
+
return !r || !(d != null && d.document) ? null : /* @__PURE__ */ e(Ge, { open: g, onOpenChange: u, children: /* @__PURE__ */ c(
|
|
1397
1403
|
$e,
|
|
1398
1404
|
{
|
|
1399
1405
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1400
|
-
onEscapeKeyDown:
|
|
1401
|
-
onPointerDownOutside:
|
|
1406
|
+
onEscapeKeyDown: p,
|
|
1407
|
+
onPointerDownOutside: p,
|
|
1402
1408
|
children: [
|
|
1403
1409
|
/* @__PURE__ */ c(Ve, { className: l ? "space-y-0" : void 0, children: [
|
|
1404
1410
|
/* @__PURE__ */ e(ze, { className: "text-[15px]", children: l ? "Add document control" : "Document Controls" }),
|
|
@@ -1411,18 +1417,18 @@ function fr({
|
|
|
1411
1417
|
)
|
|
1412
1418
|
] }),
|
|
1413
1419
|
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ e(
|
|
1414
|
-
|
|
1420
|
+
In,
|
|
1415
1421
|
{
|
|
1416
1422
|
scope: "dashboard",
|
|
1417
1423
|
controls: w,
|
|
1418
1424
|
reservedControlIds: E,
|
|
1419
|
-
defaultValues:
|
|
1425
|
+
defaultValues: C,
|
|
1420
1426
|
usageByControlId: {},
|
|
1421
1427
|
availableFieldChoices: [],
|
|
1422
1428
|
availableMetricChoices: [],
|
|
1423
1429
|
structuralParticipants: [],
|
|
1424
1430
|
structuralParticipantIdsByControlId: {},
|
|
1425
|
-
allowedControlTypes:
|
|
1431
|
+
allowedControlTypes: gr,
|
|
1426
1432
|
initialCreateFlow: n === "create",
|
|
1427
1433
|
onCreateFlowActiveChange: v,
|
|
1428
1434
|
onCreateFlowComplete: O,
|
|
@@ -1434,158 +1440,176 @@ function fr({
|
|
|
1434
1440
|
}
|
|
1435
1441
|
) });
|
|
1436
1442
|
}
|
|
1437
|
-
function
|
|
1438
|
-
return (t.controls || []).map((
|
|
1443
|
+
function br(t) {
|
|
1444
|
+
return (t.controls || []).map((a) => a.id);
|
|
1439
1445
|
}
|
|
1440
|
-
function
|
|
1441
|
-
const
|
|
1446
|
+
function yr(t) {
|
|
1447
|
+
const a = {};
|
|
1442
1448
|
for (const n of t)
|
|
1443
|
-
n.defaultValue !== void 0 && (
|
|
1444
|
-
return
|
|
1449
|
+
n.defaultValue !== void 0 && (a[n.id] = n.defaultValue);
|
|
1450
|
+
return a;
|
|
1445
1451
|
}
|
|
1446
|
-
function
|
|
1447
|
-
return
|
|
1452
|
+
function xr(t, a) {
|
|
1453
|
+
return a ? Object.prototype.hasOwnProperty.call(a, t.id) ? {
|
|
1448
1454
|
...t,
|
|
1449
|
-
defaultValue:
|
|
1455
|
+
defaultValue: a[t.id]
|
|
1450
1456
|
} : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 };
|
|
1451
1457
|
}
|
|
1452
|
-
function
|
|
1453
|
-
|
|
1458
|
+
function Nr({
|
|
1459
|
+
allInputs: t,
|
|
1460
|
+
documentSheetId: a,
|
|
1461
|
+
currentDocumentInputs: n,
|
|
1454
1462
|
nextControls: s,
|
|
1455
|
-
nextDefaultValues:
|
|
1456
|
-
change:
|
|
1463
|
+
nextDefaultValues: i,
|
|
1464
|
+
change: u
|
|
1457
1465
|
}) {
|
|
1458
|
-
const
|
|
1459
|
-
s.map((
|
|
1460
|
-
|
|
1461
|
-
|
|
1466
|
+
const l = new Map(
|
|
1467
|
+
s.map((h) => [
|
|
1468
|
+
h.id,
|
|
1469
|
+
xr(h, i)
|
|
1462
1470
|
])
|
|
1463
|
-
),
|
|
1464
|
-
for (const
|
|
1465
|
-
if (
|
|
1466
|
-
|
|
1471
|
+
), p = (u == null ? void 0 : u.type) === "rename" ? { oldId: u.oldId, newId: u.newId } : null, g = /* @__PURE__ */ new Set(), v = [];
|
|
1472
|
+
for (const h of n) {
|
|
1473
|
+
if (h.kind !== "control") {
|
|
1474
|
+
v.push(h);
|
|
1467
1475
|
continue;
|
|
1468
1476
|
}
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1477
|
+
const d = l.get(h.control.id) || ((p == null ? void 0 : p.oldId) === h.control.id ? l.get(p.newId) : void 0);
|
|
1478
|
+
if (!d)
|
|
1479
|
+
continue;
|
|
1480
|
+
g.add(d.id);
|
|
1481
|
+
const r = _s(
|
|
1482
|
+
d.id,
|
|
1483
|
+
[...t, ...v].filter(
|
|
1484
|
+
(D) => D.id !== h.id
|
|
1485
|
+
)
|
|
1486
|
+
), b = d.id === r ? d : { ...d, id: r };
|
|
1487
|
+
v.push({
|
|
1488
|
+
...h,
|
|
1489
|
+
label: b.label,
|
|
1490
|
+
variableName: r,
|
|
1491
|
+
requiredAtExecution: b.requiredAtExecution,
|
|
1492
|
+
control: b
|
|
1493
|
+
});
|
|
1476
1494
|
}
|
|
1477
|
-
for (const
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
control:
|
|
1481
|
-
existingInputs:
|
|
1495
|
+
for (const h of l.values())
|
|
1496
|
+
g.has(h.id) || v.push(
|
|
1497
|
+
Us({
|
|
1498
|
+
control: h,
|
|
1499
|
+
existingInputs: [...t, ...v],
|
|
1500
|
+
sheetId: a
|
|
1482
1501
|
})
|
|
1483
1502
|
);
|
|
1484
|
-
|
|
1503
|
+
const m = new Set(
|
|
1504
|
+
n.map((h) => h.id)
|
|
1505
|
+
);
|
|
1506
|
+
return [...t.filter(
|
|
1507
|
+
(h) => !m.has(h.id)
|
|
1508
|
+
), ...v];
|
|
1485
1509
|
}
|
|
1486
|
-
function la(t,
|
|
1510
|
+
function la(t, a) {
|
|
1487
1511
|
return {
|
|
1488
1512
|
dashboard: bt(t),
|
|
1489
|
-
semanticExecutionPayload: bt(
|
|
1513
|
+
semanticExecutionPayload: bt(a)
|
|
1490
1514
|
};
|
|
1491
1515
|
}
|
|
1492
|
-
function
|
|
1516
|
+
function Fr() {
|
|
1493
1517
|
var Qt, Wt, Jt, Yt, Xt, Zt;
|
|
1494
|
-
|
|
1518
|
+
pn(), fn();
|
|
1495
1519
|
const {
|
|
1496
1520
|
authToken: t,
|
|
1497
|
-
tokenProps:
|
|
1521
|
+
tokenProps: a,
|
|
1498
1522
|
id: n
|
|
1499
|
-
} =
|
|
1500
|
-
(
|
|
1501
|
-
),
|
|
1502
|
-
(
|
|
1503
|
-
), w = ms(
|
|
1504
|
-
(
|
|
1505
|
-
), { setDashboardTitle: O } =
|
|
1506
|
-
(
|
|
1507
|
-
), $a =
|
|
1508
|
-
ta((
|
|
1523
|
+
} = j(), { isLocalDev: s } = Fs(), { openBrandStudioPreview: i } = Rs(), { permissions: u } = Hn(), l = Gs(), { isLoading: p } = $s(), g = S((o) => o.theme), v = S((o) => o.isDownloadingPdf), m = S(
|
|
1524
|
+
(o) => o.dashboardAssistantDraftScopeKey
|
|
1525
|
+
), f = S((o) => o.lenses), h = S((o) => o.selectedLensId), d = f == null ? void 0 : f.find((o) => o.id === h), r = S((o) => o.dashboard), b = S((o) => o.selectedSheetId), D = (Qt = r == null ? void 0 : r.sheets) == null ? void 0 : Qt.find(
|
|
1526
|
+
(o) => o.id === b
|
|
1527
|
+
), w = ms(D), C = w ? (Wt = D == null ? void 0 : D.document) == null ? void 0 : Wt.page : void 0, E = S(
|
|
1528
|
+
(o) => o.isDashboardEditing
|
|
1529
|
+
), { setDashboardTitle: O } = S((o) => o.actions), [I, V] = N(!1), [z, x] = N(!1), [B, Q] = N(!1), [Z, ee] = N(!1), [y, k] = N(!1), [G, H] = N(!1), [me, te] = N(!1), [Ua, Mt] = N(!1), [He, he] = N(null), [Fa, pe] = N(!1), [fe, ge] = N(null), [Ot, ve] = N([]), [kt, be] = N(!1), Ra = S((o) => o.isDashboardPanelOpen), Ga = S(
|
|
1530
|
+
(o) => o.actions.setIsDashboardPanelOpen
|
|
1531
|
+
), $a = S((o) => o.filterValues), _ = S((o) => o.isVisualEditing);
|
|
1532
|
+
ta((o) => o.card);
|
|
1509
1533
|
const ae = ke(
|
|
1510
|
-
(
|
|
1534
|
+
(o) => o.selectedDashboard
|
|
1511
1535
|
), ye = ke(
|
|
1512
|
-
(
|
|
1536
|
+
(o) => o.initialDashboard
|
|
1513
1537
|
);
|
|
1514
|
-
ke((
|
|
1515
|
-
const xe = ae ? (Yt = ae == null ? void 0 : ae.permissions) == null ? void 0 : Yt.canEdit : (Jt = ye == null ? void 0 : ye.permissions) == null ? void 0 : Jt.canEdit,
|
|
1516
|
-
(
|
|
1517
|
-
), je =
|
|
1518
|
-
(
|
|
1538
|
+
ke((o) => o.selectedVisual), S((o) => o.selectedFrameId), ta((o) => o.frame);
|
|
1539
|
+
const xe = ae ? (Yt = ae == null ? void 0 : ae.permissions) == null ? void 0 : Yt.canEdit : (Jt = ye == null ? void 0 : ye.permissions) == null ? void 0 : Jt.canEdit, Ne = S((o) => o.showFilters), Pt = Vs((o) => o.setPanelOpen), Tt = S(
|
|
1540
|
+
(o) => o.showDashboardJSON
|
|
1541
|
+
), je = S((o) => o.onSaveFunction), _t = S(
|
|
1542
|
+
(o) => o.actions.setShowFilters
|
|
1519
1543
|
), {
|
|
1520
1544
|
setDocumentInspectorTab: Ut,
|
|
1521
1545
|
setIsDashboardEditing: Ft,
|
|
1522
1546
|
setShowDashboardJSON: Rt
|
|
1523
|
-
} =
|
|
1524
|
-
(
|
|
1525
|
-
), { resources:
|
|
1526
|
-
id:
|
|
1527
|
-
title: (
|
|
1528
|
-
} : null, { handleAddNewFrame: ja } =
|
|
1547
|
+
} = S((o) => o.actions), { setInitialDashboard: Gt, clearSelectedDashboard: Ke } = ke(
|
|
1548
|
+
(o) => o.actions
|
|
1549
|
+
), { resources: Se } = zs(nt.DASHBOARD), { data: Qe } = qs(), Va = ((Xt = Qe == null ? void 0 : Qe.preference) == null ? void 0 : Xt.defaultDashboardId) || null, { mutate: za, isPending: qa } = Bs(), { currentUser: Ba } = Dt(), Ha = Hs(Ba), W = ae || ye, $t = W ? {
|
|
1550
|
+
id: W.id,
|
|
1551
|
+
title: (r == null ? void 0 : r.title) || W.title || "Dashboard"
|
|
1552
|
+
} : null, { handleAddNewFrame: ja } = js(), [We, Je] = N(!1), [Ka, se] = N(!1), [Ye, we] = N("close"), ne = Ks(nt.DASHBOARD), [R, De] = N(null), Vt = Fe((o) => {
|
|
1529
1553
|
window.setTimeout(() => {
|
|
1530
|
-
he(
|
|
1554
|
+
he(o);
|
|
1531
1555
|
}, 0);
|
|
1532
|
-
}, []), Qa = async (
|
|
1533
|
-
if (!(
|
|
1556
|
+
}, []), Qa = async (o, P) => {
|
|
1557
|
+
if (!(r != null && r.id)) {
|
|
1534
1558
|
console.log("No dashboard ID found");
|
|
1535
1559
|
return;
|
|
1536
1560
|
}
|
|
1537
1561
|
console.log("Updating dashboard title:", {
|
|
1538
|
-
dashboardId:
|
|
1539
|
-
newTitle:
|
|
1562
|
+
dashboardId: r.id,
|
|
1563
|
+
newTitle: o,
|
|
1540
1564
|
previousTitle: P
|
|
1541
1565
|
}), ne.mutate(
|
|
1542
1566
|
{
|
|
1543
|
-
resourceId:
|
|
1544
|
-
data: { title:
|
|
1567
|
+
resourceId: r.id,
|
|
1568
|
+
data: { title: o }
|
|
1545
1569
|
},
|
|
1546
1570
|
{
|
|
1547
1571
|
onSuccess: () => {
|
|
1548
|
-
console.log("Dashboard title updated successfully"),
|
|
1572
|
+
console.log("Dashboard title updated successfully"), A.success("Dashboard title updated");
|
|
1549
1573
|
},
|
|
1550
1574
|
onError: (q) => {
|
|
1551
|
-
console.error("Failed to update dashboard title:", q),
|
|
1575
|
+
console.error("Failed to update dashboard title:", q), A.error("Failed to update dashboard title"), O(P);
|
|
1552
1576
|
}
|
|
1553
1577
|
}
|
|
1554
1578
|
);
|
|
1555
1579
|
};
|
|
1556
1580
|
ot(() => {
|
|
1557
|
-
if (
|
|
1558
|
-
const
|
|
1559
|
-
if (
|
|
1560
|
-
const P =
|
|
1561
|
-
(q) => q.id ===
|
|
1581
|
+
if (Se && Se.length > 0) {
|
|
1582
|
+
const o = r == null ? void 0 : r.id;
|
|
1583
|
+
if (o) {
|
|
1584
|
+
const P = Se.find(
|
|
1585
|
+
(q) => q.id === o
|
|
1562
1586
|
);
|
|
1563
1587
|
P && Gt(P);
|
|
1564
1588
|
}
|
|
1565
1589
|
}
|
|
1566
|
-
}, [
|
|
1567
|
-
const re =
|
|
1568
|
-
() =>
|
|
1590
|
+
}, [Se, r == null ? void 0 : r.id, Gt]);
|
|
1591
|
+
const re = a.orgUserId || a.tenantId, Xe = F(
|
|
1592
|
+
() => Sr({
|
|
1569
1593
|
accessToken: t == null ? void 0 : t.accessToken,
|
|
1570
|
-
dashboardId: (
|
|
1594
|
+
dashboardId: (r == null ? void 0 : r.id) || n || a.dashboard_id,
|
|
1571
1595
|
selectedSheetId: w ? b : void 0,
|
|
1572
|
-
pageSize:
|
|
1573
|
-
orientation:
|
|
1574
|
-
theme:
|
|
1596
|
+
pageSize: C == null ? void 0 : C.size,
|
|
1597
|
+
orientation: C == null ? void 0 : C.orientation,
|
|
1598
|
+
theme: g
|
|
1575
1599
|
}),
|
|
1576
1600
|
[
|
|
1577
1601
|
t == null ? void 0 : t.accessToken,
|
|
1578
1602
|
n,
|
|
1579
|
-
|
|
1603
|
+
r == null ? void 0 : r.id,
|
|
1580
1604
|
w,
|
|
1581
|
-
|
|
1582
|
-
|
|
1605
|
+
C == null ? void 0 : C.orientation,
|
|
1606
|
+
C == null ? void 0 : C.size,
|
|
1583
1607
|
b,
|
|
1584
|
-
|
|
1585
|
-
|
|
1608
|
+
g,
|
|
1609
|
+
a.dashboard_id
|
|
1586
1610
|
]
|
|
1587
|
-
), zt = E && !_ && re && xe, { setDashboard: Ze } =
|
|
1588
|
-
(
|
|
1611
|
+
), zt = E && !_ && re && xe, { setDashboard: Ze } = S((o) => o.actions), et = S(
|
|
1612
|
+
(o) => o.semanticExecutionPayload
|
|
1589
1613
|
), Wa = () => {
|
|
1590
1614
|
Ft(!0);
|
|
1591
1615
|
}, tt = () => {
|
|
@@ -1596,26 +1620,26 @@ function Ur() {
|
|
|
1596
1620
|
R && De(null);
|
|
1597
1621
|
return;
|
|
1598
1622
|
}
|
|
1599
|
-
R || !
|
|
1623
|
+
R || !r || p || De(
|
|
1600
1624
|
la(
|
|
1601
|
-
|
|
1625
|
+
r,
|
|
1602
1626
|
et
|
|
1603
1627
|
)
|
|
1604
1628
|
);
|
|
1605
1629
|
}, [
|
|
1606
|
-
|
|
1630
|
+
r,
|
|
1607
1631
|
R,
|
|
1608
1632
|
E,
|
|
1609
|
-
|
|
1633
|
+
p,
|
|
1610
1634
|
et
|
|
1611
1635
|
]);
|
|
1612
|
-
const Ce = (R == null ? void 0 : R.dashboard) ?? null, { isDirty: qt, isDirtyPending: Ja, resetDirty: Ee } =
|
|
1613
|
-
|
|
1636
|
+
const Ce = (R == null ? void 0 : R.dashboard) ?? null, { isDirty: qt, isDirtyPending: Ja, resetDirty: Ee } = Cn(
|
|
1637
|
+
r,
|
|
1614
1638
|
Ce,
|
|
1615
1639
|
300,
|
|
1616
1640
|
1e3,
|
|
1617
1641
|
it
|
|
1618
|
-
), Bt = Fe(() => Ce ? it(
|
|
1642
|
+
), Bt = Fe(() => Ce ? it(r) !== it(Ce) : !1, [r, Ce]), Ht = qt || Ja, Ie = We || ne.isPending, Ya = () => {
|
|
1619
1643
|
Bt() ? (we("close"), se(!0)) : (tt(), Ee());
|
|
1620
1644
|
}, Xa = async () => {
|
|
1621
1645
|
await at({
|
|
@@ -1637,11 +1661,11 @@ function Ur() {
|
|
|
1637
1661
|
}
|
|
1638
1662
|
Ke();
|
|
1639
1663
|
};
|
|
1640
|
-
async function at(
|
|
1641
|
-
const P =
|
|
1664
|
+
async function at(o) {
|
|
1665
|
+
const P = S.getState().dashboard;
|
|
1642
1666
|
if (!P)
|
|
1643
1667
|
return;
|
|
1644
|
-
const q = (
|
|
1668
|
+
const q = (o == null ? void 0 : o.closeAfterSave) ?? kt, os = (o == null ? void 0 : o.navigateHomeAfterSave) ?? !1;
|
|
1645
1669
|
be(q), q && se(!1);
|
|
1646
1670
|
const is = bt(P);
|
|
1647
1671
|
pe(!0), ge(null), ve([]), Je(!0);
|
|
@@ -1655,70 +1679,70 @@ function Ur() {
|
|
|
1655
1679
|
},
|
|
1656
1680
|
{
|
|
1657
1681
|
onSuccess: (U) => {
|
|
1658
|
-
var
|
|
1659
|
-
const
|
|
1660
|
-
if (!P.id &&
|
|
1682
|
+
var Le, Me, ea;
|
|
1683
|
+
const K = (U == null ? void 0 : U.id) || ((Le = U == null ? void 0 : U.dashboard) == null ? void 0 : Le.id) || ((Me = U == null ? void 0 : U.resource) == null ? void 0 : Me.id) || ((ea = U == null ? void 0 : U.template) == null ? void 0 : ea.id) || null;
|
|
1684
|
+
if (!P.id && K) {
|
|
1661
1685
|
const st = bs.getState(), Oe = st.pendingDashboardDraftMigration;
|
|
1662
|
-
(Oe == null ? void 0 : Oe.scopeKey) ===
|
|
1663
|
-
|
|
1686
|
+
(Oe == null ? void 0 : Oe.scopeKey) === m ? st.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
|
|
1687
|
+
K
|
|
1664
1688
|
) : Oe && st.actions.clearPendingDashboardDraftMigration();
|
|
1665
1689
|
}
|
|
1666
|
-
Je(!1),
|
|
1690
|
+
Je(!1), A.success("Dashboard saved!"), De(
|
|
1667
1691
|
la(
|
|
1668
1692
|
is,
|
|
1669
|
-
|
|
1693
|
+
S.getState().semanticExecutionPayload
|
|
1670
1694
|
)
|
|
1671
1695
|
), pe(!1), be(!1), q && (tt(), Ee(), os && Ke()), we("close");
|
|
1672
1696
|
},
|
|
1673
1697
|
onError: (U) => {
|
|
1674
1698
|
Je(!1), ge("Failed to save dashboard. Please try again.");
|
|
1675
|
-
const
|
|
1676
|
-
|
|
1677
|
-
) ? (
|
|
1678
|
-
(
|
|
1699
|
+
const K = U.details, Le = Array.isArray(
|
|
1700
|
+
K == null ? void 0 : K.errors
|
|
1701
|
+
) ? (K.errors || []).filter(
|
|
1702
|
+
(Me) => typeof Me == "string"
|
|
1679
1703
|
) : [];
|
|
1680
1704
|
ve(
|
|
1681
|
-
|
|
1682
|
-
errors:
|
|
1705
|
+
fr({
|
|
1706
|
+
errors: Le,
|
|
1683
1707
|
dashboard: P || void 0
|
|
1684
1708
|
})
|
|
1685
|
-
),
|
|
1709
|
+
), A.error("Failed to save dashboard");
|
|
1686
1710
|
}
|
|
1687
1711
|
}
|
|
1688
1712
|
);
|
|
1689
1713
|
}
|
|
1690
1714
|
async function as() {
|
|
1691
|
-
if (V(!0), !
|
|
1692
|
-
const
|
|
1693
|
-
if (!
|
|
1715
|
+
if (V(!0), !h || !d) return;
|
|
1716
|
+
const o = S.getState().dashboard;
|
|
1717
|
+
if (!o) {
|
|
1694
1718
|
V(!1);
|
|
1695
1719
|
return;
|
|
1696
1720
|
}
|
|
1697
|
-
const P = JSON.stringify(
|
|
1698
|
-
...
|
|
1721
|
+
const P = JSON.stringify(o), q = {
|
|
1722
|
+
...d,
|
|
1699
1723
|
template: P,
|
|
1700
1724
|
filterValues: $a
|
|
1701
1725
|
};
|
|
1702
1726
|
await xt(
|
|
1703
|
-
|
|
1727
|
+
a.apiServiceUrl,
|
|
1704
1728
|
q,
|
|
1705
1729
|
t == null ? void 0 : t.accessToken
|
|
1706
|
-
),
|
|
1730
|
+
), A.success("Lens saved"), je == null || je(o), V(!1);
|
|
1707
1731
|
}
|
|
1708
|
-
const jt = (
|
|
1732
|
+
const jt = (d == null ? void 0 : d.name) || r.title, oe = !!(r != null && r.id);
|
|
1709
1733
|
ne.isPending && console.log("Title during update:", {
|
|
1710
1734
|
title: jt,
|
|
1711
|
-
dashboardStateTitle:
|
|
1712
|
-
dashboardId:
|
|
1713
|
-
currentLensName:
|
|
1735
|
+
dashboardStateTitle: r.title,
|
|
1736
|
+
dashboardId: r == null ? void 0 : r.id,
|
|
1737
|
+
currentLensName: d == null ? void 0 : d.name
|
|
1714
1738
|
});
|
|
1715
|
-
const Kt =
|
|
1739
|
+
const Kt = a.orgUserId || a.tenantId && a.endUserId && a.endUserEmail, ss = !!Kt && !!(t != null && t.accessToken) && !!(a != null && a.apiServiceUrl);
|
|
1716
1740
|
ot(() => {
|
|
1717
|
-
!oe &&
|
|
1718
|
-
}, [oe,
|
|
1719
|
-
const ns = l, ie = (
|
|
1741
|
+
!oe && Z && ee(!1);
|
|
1742
|
+
}, [oe, Z]);
|
|
1743
|
+
const ns = l, ie = (r == null ? void 0 : r.id) || null, Ae = !!ie && Va === ie, rs = () => {
|
|
1720
1744
|
ie && za({
|
|
1721
|
-
dashboardId:
|
|
1745
|
+
dashboardId: Ae ? null : ie
|
|
1722
1746
|
});
|
|
1723
1747
|
};
|
|
1724
1748
|
return /* @__PURE__ */ c(
|
|
@@ -1739,7 +1763,7 @@ function Ur() {
|
|
|
1739
1763
|
},
|
|
1740
1764
|
className: "h-7 w-7 px-0",
|
|
1741
1765
|
buttonProps: { size: "xs" },
|
|
1742
|
-
children: /* @__PURE__ */ e(
|
|
1766
|
+
children: /* @__PURE__ */ e(On, { className: "h-3.5 w-3.5" })
|
|
1743
1767
|
}
|
|
1744
1768
|
),
|
|
1745
1769
|
ns && !_ && /* @__PURE__ */ e(
|
|
@@ -1754,7 +1778,7 @@ function Ur() {
|
|
|
1754
1778
|
}
|
|
1755
1779
|
)
|
|
1756
1780
|
] }),
|
|
1757
|
-
!_ && l && (
|
|
1781
|
+
!_ && l && (p ? /* @__PURE__ */ e(
|
|
1758
1782
|
"div",
|
|
1759
1783
|
{
|
|
1760
1784
|
className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
|
|
@@ -1764,19 +1788,19 @@ function Ur() {
|
|
|
1764
1788
|
}
|
|
1765
1789
|
) : /* @__PURE__ */ c(T, { children: [
|
|
1766
1790
|
/* @__PURE__ */ e(
|
|
1767
|
-
|
|
1791
|
+
Qs,
|
|
1768
1792
|
{
|
|
1769
1793
|
value: jt || "Untitled Dashboard",
|
|
1770
|
-
onSave: (
|
|
1794
|
+
onSave: (o) => {
|
|
1771
1795
|
console.log("EditableText onSave called:", {
|
|
1772
|
-
newTitle:
|
|
1796
|
+
newTitle: o,
|
|
1773
1797
|
canEditDashboard: xe,
|
|
1774
|
-
dashboardId:
|
|
1798
|
+
dashboardId: r == null ? void 0 : r.id
|
|
1775
1799
|
});
|
|
1776
|
-
const P = (
|
|
1777
|
-
O(
|
|
1800
|
+
const P = (r == null ? void 0 : r.title) || "";
|
|
1801
|
+
O(o), Qa(o, P);
|
|
1778
1802
|
},
|
|
1779
|
-
isEditable: xe && !
|
|
1803
|
+
isEditable: xe && !d,
|
|
1780
1804
|
displayClassName: "text-[13px] font-medium",
|
|
1781
1805
|
inputClassName: "text-[13px] font-medium",
|
|
1782
1806
|
placeholder: "Dashboard Title",
|
|
@@ -1785,63 +1809,63 @@ function Ur() {
|
|
|
1785
1809
|
),
|
|
1786
1810
|
ss && ie && /* @__PURE__ */ e(hs, { children: /* @__PURE__ */ c(ps, { children: [
|
|
1787
1811
|
/* @__PURE__ */ e(fs, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1788
|
-
|
|
1812
|
+
L,
|
|
1789
1813
|
{
|
|
1790
1814
|
variant: "ghost",
|
|
1791
1815
|
size: "xs",
|
|
1792
1816
|
onClick: rs,
|
|
1793
|
-
disabled: qa || !(t != null && t.accessToken) || !(
|
|
1817
|
+
disabled: qa || !(t != null && t.accessToken) || !(a != null && a.apiServiceUrl),
|
|
1794
1818
|
className: "w-7 px-0",
|
|
1795
|
-
"aria-label":
|
|
1819
|
+
"aria-label": Ae ? "Remove as default dashboard" : "Make this a default dashboard",
|
|
1796
1820
|
children: /* @__PURE__ */ e(
|
|
1797
|
-
|
|
1821
|
+
Ws,
|
|
1798
1822
|
{
|
|
1799
|
-
className:
|
|
1823
|
+
className: J(
|
|
1800
1824
|
"h-3.5 w-3.5 transition-colors",
|
|
1801
|
-
|
|
1825
|
+
Ae ? "fill-foreground text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
1802
1826
|
)
|
|
1803
1827
|
}
|
|
1804
1828
|
)
|
|
1805
1829
|
}
|
|
1806
1830
|
) }),
|
|
1807
|
-
/* @__PURE__ */ e(gs, { children: /* @__PURE__ */ e("p", { children:
|
|
1831
|
+
/* @__PURE__ */ e(gs, { children: /* @__PURE__ */ e("p", { children: Ae ? "Remove as default dashboard" : "Make this a default dashboard" }) })
|
|
1808
1832
|
] }) })
|
|
1809
1833
|
] }))
|
|
1810
1834
|
] }),
|
|
1811
1835
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1812
1836
|
_ && /* @__PURE__ */ c(T, { children: [
|
|
1813
|
-
/* @__PURE__ */ e(
|
|
1814
|
-
/* @__PURE__ */ e(
|
|
1837
|
+
/* @__PURE__ */ e(gn, {}),
|
|
1838
|
+
/* @__PURE__ */ e(vn, {})
|
|
1815
1839
|
] }),
|
|
1816
|
-
!_ && l && ((Zt =
|
|
1817
|
-
|
|
1840
|
+
!_ && l && ((Zt = W == null ? void 0 : W.permissions) == null ? void 0 : Zt.canShare) && /* @__PURE__ */ c(
|
|
1841
|
+
L,
|
|
1818
1842
|
{
|
|
1819
1843
|
variant: "outline",
|
|
1820
1844
|
size: "xs",
|
|
1821
1845
|
onClick: () => x(!0),
|
|
1822
1846
|
children: [
|
|
1823
|
-
/* @__PURE__ */ e(
|
|
1847
|
+
/* @__PURE__ */ e(Js, { className: "h-3.5 w-3.5" }),
|
|
1824
1848
|
"Share"
|
|
1825
1849
|
]
|
|
1826
1850
|
}
|
|
1827
1851
|
),
|
|
1828
|
-
!_ && E &&
|
|
1829
|
-
|
|
1852
|
+
!_ && E && u.canUseFilters && l && /* @__PURE__ */ e(
|
|
1853
|
+
bn,
|
|
1830
1854
|
{
|
|
1831
|
-
showFilters: w ? !1 :
|
|
1855
|
+
showFilters: w ? !1 : Ne,
|
|
1832
1856
|
onToggleFilters: () => {
|
|
1833
1857
|
if (w && b) {
|
|
1834
1858
|
Ut(b, "inputs");
|
|
1835
1859
|
return;
|
|
1836
1860
|
}
|
|
1837
|
-
|
|
1861
|
+
Ne || Pt("dashboard", !1), _t(!Ne);
|
|
1838
1862
|
},
|
|
1839
1863
|
onAddFilter: () => {
|
|
1840
1864
|
if (w && b) {
|
|
1841
1865
|
Ut(b, "inputs");
|
|
1842
1866
|
return;
|
|
1843
1867
|
}
|
|
1844
|
-
|
|
1868
|
+
Ne || (Pt("dashboard", !1), _t(!0));
|
|
1845
1869
|
},
|
|
1846
1870
|
onAddControl: () => {
|
|
1847
1871
|
Vt("create");
|
|
@@ -1850,27 +1874,27 @@ function Ur() {
|
|
|
1850
1874
|
}
|
|
1851
1875
|
),
|
|
1852
1876
|
E && !_ && l && He ? w ? /* @__PURE__ */ e(
|
|
1853
|
-
|
|
1877
|
+
vr,
|
|
1854
1878
|
{
|
|
1855
1879
|
open: !0,
|
|
1856
|
-
onOpenChange: (
|
|
1857
|
-
|
|
1880
|
+
onOpenChange: (o) => {
|
|
1881
|
+
o || he(null);
|
|
1858
1882
|
},
|
|
1859
1883
|
initialMode: He
|
|
1860
1884
|
}
|
|
1861
1885
|
) : /* @__PURE__ */ e(
|
|
1862
|
-
|
|
1886
|
+
yn,
|
|
1863
1887
|
{
|
|
1864
1888
|
open: !0,
|
|
1865
|
-
onOpenChange: (
|
|
1866
|
-
|
|
1889
|
+
onOpenChange: (o) => {
|
|
1890
|
+
o || he(null);
|
|
1867
1891
|
},
|
|
1868
1892
|
showTrigger: !1,
|
|
1869
1893
|
initialMode: He
|
|
1870
1894
|
}
|
|
1871
1895
|
) : null,
|
|
1872
|
-
E && !_ && re &&
|
|
1873
|
-
|
|
1896
|
+
E && !_ && re && d && s && l && /* @__PURE__ */ c(
|
|
1897
|
+
L,
|
|
1874
1898
|
{
|
|
1875
1899
|
variant: "secondary",
|
|
1876
1900
|
size: "xs",
|
|
@@ -1883,7 +1907,7 @@ function Ur() {
|
|
|
1883
1907
|
}
|
|
1884
1908
|
),
|
|
1885
1909
|
E && !_ && l && !w && /* @__PURE__ */ c(
|
|
1886
|
-
|
|
1910
|
+
L,
|
|
1887
1911
|
{
|
|
1888
1912
|
variant: "outline",
|
|
1889
1913
|
size: "xs",
|
|
@@ -1895,44 +1919,44 @@ function Ur() {
|
|
|
1895
1919
|
]
|
|
1896
1920
|
}
|
|
1897
1921
|
),
|
|
1898
|
-
!_ && !E && xe && l && /* @__PURE__ */ c(
|
|
1899
|
-
/* @__PURE__ */ e(
|
|
1922
|
+
!_ && !E && xe && l && /* @__PURE__ */ c(L, { size: "xs", onClick: Wa, children: [
|
|
1923
|
+
/* @__PURE__ */ e(Ys, { className: "h-3.5 w-3.5" }),
|
|
1900
1924
|
"Edit"
|
|
1901
1925
|
] }),
|
|
1902
1926
|
zt && l && qt && /* @__PURE__ */ c(
|
|
1903
|
-
|
|
1927
|
+
L,
|
|
1904
1928
|
{
|
|
1905
1929
|
variant: "outline",
|
|
1906
1930
|
size: "xs",
|
|
1907
1931
|
onClick: es,
|
|
1908
1932
|
disabled: Ie,
|
|
1909
1933
|
children: [
|
|
1910
|
-
/* @__PURE__ */ e(
|
|
1934
|
+
/* @__PURE__ */ e(Xs, { className: "h-3.5 w-3.5" }),
|
|
1911
1935
|
"Undo"
|
|
1912
1936
|
]
|
|
1913
1937
|
}
|
|
1914
1938
|
),
|
|
1915
1939
|
zt && l && /* @__PURE__ */ c(
|
|
1916
|
-
|
|
1940
|
+
L,
|
|
1917
1941
|
{
|
|
1918
1942
|
size: "xs",
|
|
1919
|
-
className:
|
|
1943
|
+
className: J(!Ht && "opacity-60"),
|
|
1920
1944
|
disabled: Ie || !Ht,
|
|
1921
1945
|
onClick: () => at(),
|
|
1922
1946
|
children: [
|
|
1923
|
-
Ie ? /* @__PURE__ */ e(
|
|
1947
|
+
Ie ? /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(na, { className: "h-3.5 w-3.5" }),
|
|
1924
1948
|
Ie ? "Saving..." : "Save"
|
|
1925
1949
|
]
|
|
1926
1950
|
}
|
|
1927
1951
|
),
|
|
1928
|
-
E && !_ && l && /* @__PURE__ */ c(
|
|
1952
|
+
E && !_ && l && /* @__PURE__ */ c(L, { variant: "outline", size: "xs", onClick: Ya, children: [
|
|
1929
1953
|
/* @__PURE__ */ e(ga, { className: "h-3.5 w-3.5" }),
|
|
1930
1954
|
"Close"
|
|
1931
1955
|
] }),
|
|
1932
|
-
!_ && l && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(
|
|
1933
|
-
!_ &&
|
|
1934
|
-
!_ && l && /* @__PURE__ */ c(
|
|
1935
|
-
/* @__PURE__ */ e(
|
|
1956
|
+
!_ && l && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(xn, {}) }),
|
|
1957
|
+
!_ && s && /* @__PURE__ */ e(Gn, {}),
|
|
1958
|
+
!_ && l && /* @__PURE__ */ c(Zs, { children: [
|
|
1959
|
+
/* @__PURE__ */ e(en, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1936
1960
|
rt,
|
|
1937
1961
|
{
|
|
1938
1962
|
tooltip: "More Options",
|
|
@@ -1942,11 +1966,11 @@ function Ur() {
|
|
|
1942
1966
|
variant: "ghost",
|
|
1943
1967
|
"aria-label": "More dashboard options"
|
|
1944
1968
|
},
|
|
1945
|
-
children: /* @__PURE__ */ e(
|
|
1969
|
+
children: /* @__PURE__ */ e(tn, { className: "h-3.5 w-3.5" })
|
|
1946
1970
|
}
|
|
1947
1971
|
) }),
|
|
1948
1972
|
/* @__PURE__ */ c(
|
|
1949
|
-
|
|
1973
|
+
an,
|
|
1950
1974
|
{
|
|
1951
1975
|
align: "end",
|
|
1952
1976
|
className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
|
|
@@ -1956,9 +1980,9 @@ function Ur() {
|
|
|
1956
1980
|
$,
|
|
1957
1981
|
{
|
|
1958
1982
|
disabled: v,
|
|
1959
|
-
onSelect: () =>
|
|
1983
|
+
onSelect: () => Mt(!0),
|
|
1960
1984
|
children: [
|
|
1961
|
-
/* @__PURE__ */ e(
|
|
1985
|
+
/* @__PURE__ */ e(sn, { className: "h-3.5 w-3.5" }),
|
|
1962
1986
|
"Export"
|
|
1963
1987
|
]
|
|
1964
1988
|
}
|
|
@@ -1971,7 +1995,7 @@ function Ur() {
|
|
|
1971
1995
|
oe && ee(!0);
|
|
1972
1996
|
},
|
|
1973
1997
|
children: [
|
|
1974
|
-
/* @__PURE__ */ e(
|
|
1998
|
+
/* @__PURE__ */ e(nn, { className: "h-3.5 w-3.5" }),
|
|
1975
1999
|
"Schedule"
|
|
1976
2000
|
]
|
|
1977
2001
|
}
|
|
@@ -1982,7 +2006,7 @@ function Ur() {
|
|
|
1982
2006
|
/* @__PURE__ */ c(
|
|
1983
2007
|
$,
|
|
1984
2008
|
{
|
|
1985
|
-
onClick: () =>
|
|
2009
|
+
onClick: () => Q(!0),
|
|
1986
2010
|
children: [
|
|
1987
2011
|
/* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" }),
|
|
1988
2012
|
"Manage Groups"
|
|
@@ -1993,24 +2017,24 @@ function Ur() {
|
|
|
1993
2017
|
] }),
|
|
1994
2018
|
/* @__PURE__ */ e(de, { children: "Preferences" }),
|
|
1995
2019
|
/* @__PURE__ */ c($, { onClick: () => k(!0), children: [
|
|
1996
|
-
/* @__PURE__ */ e(
|
|
2020
|
+
/* @__PURE__ */ e(rn, { className: "h-3.5 w-3.5" }),
|
|
1997
2021
|
"Calendar Preferences"
|
|
1998
2022
|
] }),
|
|
1999
|
-
/* @__PURE__ */ c($, { onClick: () =>
|
|
2000
|
-
/* @__PURE__ */ e(
|
|
2023
|
+
/* @__PURE__ */ c($, { onClick: () => H(!0), children: [
|
|
2024
|
+
/* @__PURE__ */ e(on, { className: "h-3.5 w-3.5" }),
|
|
2001
2025
|
"Summary Settings"
|
|
2002
2026
|
] }),
|
|
2003
|
-
|
|
2027
|
+
s && l && /* @__PURE__ */ c(T, { children: [
|
|
2004
2028
|
/* @__PURE__ */ e(Te, {}),
|
|
2005
2029
|
/* @__PURE__ */ e(de, { children: "Developer" }),
|
|
2006
2030
|
/* @__PURE__ */ c(
|
|
2007
2031
|
$,
|
|
2008
2032
|
{
|
|
2009
2033
|
onSelect: () => {
|
|
2010
|
-
var
|
|
2011
|
-
t != null && t.accessToken && ((
|
|
2012
|
-
() =>
|
|
2013
|
-
).catch(() =>
|
|
2034
|
+
var o;
|
|
2035
|
+
t != null && t.accessToken && ((o = navigator == null ? void 0 : navigator.clipboard) != null && o.writeText ? navigator.clipboard.writeText(t.accessToken).then(
|
|
2036
|
+
() => A.success("Token copied to clipboard")
|
|
2037
|
+
).catch(() => A.error("Unable to copy token")) : A.error("Clipboard not available"));
|
|
2014
2038
|
},
|
|
2015
2039
|
children: [
|
|
2016
2040
|
/* @__PURE__ */ e(sa, { className: "h-3.5 w-3.5" }),
|
|
@@ -2023,22 +2047,22 @@ function Ur() {
|
|
|
2023
2047
|
{
|
|
2024
2048
|
disabled: !Xe,
|
|
2025
2049
|
onSelect: () => {
|
|
2026
|
-
var
|
|
2050
|
+
var o;
|
|
2027
2051
|
if (!Xe) {
|
|
2028
|
-
|
|
2052
|
+
A.error(
|
|
2029
2053
|
"Open a document sheet with a token to copy the local PDF URL"
|
|
2030
2054
|
);
|
|
2031
2055
|
return;
|
|
2032
2056
|
}
|
|
2033
|
-
(
|
|
2034
|
-
() =>
|
|
2057
|
+
(o = navigator == null ? void 0 : navigator.clipboard) != null && o.writeText ? navigator.clipboard.writeText(Xe).then(
|
|
2058
|
+
() => A.success(
|
|
2035
2059
|
"Local document PDF URL copied to clipboard"
|
|
2036
2060
|
)
|
|
2037
2061
|
).catch(
|
|
2038
|
-
() =>
|
|
2062
|
+
() => A.error(
|
|
2039
2063
|
"Unable to copy local document PDF URL"
|
|
2040
2064
|
)
|
|
2041
|
-
) :
|
|
2065
|
+
) : A.error("Clipboard not available");
|
|
2042
2066
|
},
|
|
2043
2067
|
children: [
|
|
2044
2068
|
/* @__PURE__ */ e(sa, { className: "h-3.5 w-3.5" }),
|
|
@@ -2049,15 +2073,15 @@ function Ur() {
|
|
|
2049
2073
|
/* @__PURE__ */ c(
|
|
2050
2074
|
$,
|
|
2051
2075
|
{
|
|
2052
|
-
onSelect: () => vs(
|
|
2076
|
+
onSelect: () => vs(a.apiServiceUrl),
|
|
2053
2077
|
children: [
|
|
2054
|
-
/* @__PURE__ */ e(
|
|
2078
|
+
/* @__PURE__ */ e(Tn, { className: "h-3.5 w-3.5" }),
|
|
2055
2079
|
"Invalidate token"
|
|
2056
2080
|
]
|
|
2057
2081
|
}
|
|
2058
2082
|
),
|
|
2059
|
-
/* @__PURE__ */ c($, { onSelect:
|
|
2060
|
-
/* @__PURE__ */ e(
|
|
2083
|
+
/* @__PURE__ */ c($, { onSelect: i, children: [
|
|
2084
|
+
/* @__PURE__ */ e(An, { className: "h-3.5 w-3.5" }),
|
|
2061
2085
|
"Brand Studio"
|
|
2062
2086
|
] }),
|
|
2063
2087
|
E && /* @__PURE__ */ c(
|
|
@@ -2065,7 +2089,7 @@ function Ur() {
|
|
|
2065
2089
|
{
|
|
2066
2090
|
onSelect: () => Rt(!Tt),
|
|
2067
2091
|
children: [
|
|
2068
|
-
/* @__PURE__ */ e(
|
|
2092
|
+
/* @__PURE__ */ e(Ln, { className: "h-3.5 w-3.5" }),
|
|
2069
2093
|
Tt ? "Hide dashboard JSON" : "Show dashboard JSON"
|
|
2070
2094
|
]
|
|
2071
2095
|
}
|
|
@@ -2074,12 +2098,12 @@ function Ur() {
|
|
|
2074
2098
|
/* @__PURE__ */ e(ht, { className: "h-3.5 w-3.5" }),
|
|
2075
2099
|
"Add lens"
|
|
2076
2100
|
] }),
|
|
2077
|
-
re && /* @__PURE__ */ c(
|
|
2078
|
-
/* @__PURE__ */ c(
|
|
2101
|
+
re && /* @__PURE__ */ c(cn, { children: [
|
|
2102
|
+
/* @__PURE__ */ c(ln, { children: [
|
|
2079
2103
|
/* @__PURE__ */ e(Mn, { className: "h-3.5 w-3.5" }),
|
|
2080
2104
|
"Lenses"
|
|
2081
2105
|
] }),
|
|
2082
|
-
/* @__PURE__ */ e(
|
|
2106
|
+
/* @__PURE__ */ e(dn, { className: "w-60", children: /* @__PURE__ */ e(Bn, {}) })
|
|
2083
2107
|
] })
|
|
2084
2108
|
] })
|
|
2085
2109
|
]
|
|
@@ -2087,7 +2111,7 @@ function Ur() {
|
|
|
2087
2111
|
)
|
|
2088
2112
|
] }),
|
|
2089
2113
|
z && $t && /* @__PURE__ */ e(
|
|
2090
|
-
|
|
2114
|
+
un,
|
|
2091
2115
|
{
|
|
2092
2116
|
resource: $t,
|
|
2093
2117
|
resourceType: nt.DASHBOARD,
|
|
@@ -2095,39 +2119,39 @@ function Ur() {
|
|
|
2095
2119
|
}
|
|
2096
2120
|
),
|
|
2097
2121
|
/* @__PURE__ */ e(
|
|
2098
|
-
|
|
2122
|
+
hr,
|
|
2099
2123
|
{
|
|
2100
2124
|
open: B,
|
|
2101
|
-
onOpenChange:
|
|
2125
|
+
onOpenChange: Q
|
|
2102
2126
|
}
|
|
2103
2127
|
),
|
|
2104
|
-
oe && (
|
|
2105
|
-
|
|
2128
|
+
oe && (r == null ? void 0 : r.id) && /* @__PURE__ */ e(
|
|
2129
|
+
mn,
|
|
2106
2130
|
{
|
|
2107
|
-
open:
|
|
2131
|
+
open: Z,
|
|
2108
2132
|
onOpenChange: ee,
|
|
2109
|
-
dashboardId:
|
|
2110
|
-
dashboardName:
|
|
2133
|
+
dashboardId: r.id,
|
|
2134
|
+
dashboardName: r == null ? void 0 : r.title
|
|
2111
2135
|
}
|
|
2112
2136
|
),
|
|
2113
2137
|
/* @__PURE__ */ e(
|
|
2114
|
-
|
|
2138
|
+
wn,
|
|
2115
2139
|
{
|
|
2116
2140
|
open: y,
|
|
2117
2141
|
onOpenChange: k
|
|
2118
2142
|
}
|
|
2119
2143
|
),
|
|
2120
2144
|
/* @__PURE__ */ e(
|
|
2121
|
-
|
|
2145
|
+
Dn,
|
|
2122
2146
|
{
|
|
2123
2147
|
open: G,
|
|
2124
|
-
onOpenChange:
|
|
2125
|
-
dashboard:
|
|
2148
|
+
onOpenChange: H,
|
|
2149
|
+
dashboard: r,
|
|
2126
2150
|
disabled: !E,
|
|
2127
|
-
onApply: (
|
|
2151
|
+
onApply: (o) => Ze(
|
|
2128
2152
|
{
|
|
2129
|
-
...
|
|
2130
|
-
summary:
|
|
2153
|
+
...r,
|
|
2154
|
+
summary: o
|
|
2131
2155
|
},
|
|
2132
2156
|
{
|
|
2133
2157
|
semanticExecutionPayload: et
|
|
@@ -2135,28 +2159,28 @@ function Ur() {
|
|
|
2135
2159
|
)
|
|
2136
2160
|
}
|
|
2137
2161
|
),
|
|
2138
|
-
|
|
2162
|
+
s && re && l && /* @__PURE__ */ e(qn, { open: me, onOpenChange: te }),
|
|
2139
2163
|
l && /* @__PURE__ */ e(
|
|
2140
|
-
|
|
2164
|
+
hn,
|
|
2141
2165
|
{
|
|
2142
2166
|
open: Ua,
|
|
2143
|
-
onOpenChange:
|
|
2167
|
+
onOpenChange: Mt
|
|
2144
2168
|
}
|
|
2145
2169
|
),
|
|
2146
2170
|
/* @__PURE__ */ e(
|
|
2147
2171
|
ya,
|
|
2148
2172
|
{
|
|
2149
2173
|
open: Fa,
|
|
2150
|
-
onOpenChange: (
|
|
2151
|
-
!
|
|
2174
|
+
onOpenChange: (o) => {
|
|
2175
|
+
!o && We && !fe || (pe(o), o || (ge(null), ve([]), be(!1)));
|
|
2152
2176
|
},
|
|
2153
2177
|
children: /* @__PURE__ */ c(xa, { className: "max-w-sm", children: [
|
|
2154
|
-
/* @__PURE__ */ c(
|
|
2155
|
-
/* @__PURE__ */ e(
|
|
2178
|
+
/* @__PURE__ */ c(Na, { children: [
|
|
2179
|
+
/* @__PURE__ */ e(Sa, { children: fe ? "Save failed" : "Saving dashboard" }),
|
|
2156
2180
|
/* @__PURE__ */ e(wa, { className: "pt-2", children: fe ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
2157
2181
|
Ot.length > 0 && /* @__PURE__ */ c("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
2158
2182
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
2159
|
-
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: Ot.slice(0, 5).map((
|
|
2183
|
+
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: Ot.slice(0, 5).map((o) => /* @__PURE__ */ e("li", { children: o }, o)) })
|
|
2160
2184
|
] })
|
|
2161
2185
|
] }),
|
|
2162
2186
|
/* @__PURE__ */ e(Da, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: fe ? /* @__PURE__ */ c(T, { children: [
|
|
@@ -2182,18 +2206,18 @@ function Ur() {
|
|
|
2182
2206
|
}
|
|
2183
2207
|
)
|
|
2184
2208
|
] }) : /* @__PURE__ */ c(vt, { disabled: !0, className: "m-0 cursor-default", children: [
|
|
2185
|
-
/* @__PURE__ */ e(
|
|
2209
|
+
/* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2186
2210
|
"Saving..."
|
|
2187
2211
|
] }) })
|
|
2188
2212
|
] })
|
|
2189
2213
|
}
|
|
2190
2214
|
),
|
|
2191
2215
|
/* @__PURE__ */ e(
|
|
2192
|
-
|
|
2216
|
+
Nn,
|
|
2193
2217
|
{
|
|
2194
2218
|
open: Ka,
|
|
2195
|
-
onOpenChange: (
|
|
2196
|
-
se(
|
|
2219
|
+
onOpenChange: (o) => {
|
|
2220
|
+
se(o);
|
|
2197
2221
|
},
|
|
2198
2222
|
onSave: Xa,
|
|
2199
2223
|
onDiscard: Za,
|
|
@@ -2207,21 +2231,21 @@ function Ur() {
|
|
|
2207
2231
|
}
|
|
2208
2232
|
);
|
|
2209
2233
|
}
|
|
2210
|
-
function
|
|
2234
|
+
function Sr({
|
|
2211
2235
|
accessToken: t,
|
|
2212
|
-
dashboardId:
|
|
2236
|
+
dashboardId: a,
|
|
2213
2237
|
selectedSheetId: n,
|
|
2214
|
-
pageSize:
|
|
2215
|
-
orientation:
|
|
2216
|
-
theme:
|
|
2238
|
+
pageSize: s,
|
|
2239
|
+
orientation: i,
|
|
2240
|
+
theme: u
|
|
2217
2241
|
}) {
|
|
2218
2242
|
if (!t || !n)
|
|
2219
2243
|
return null;
|
|
2220
2244
|
const l = new URL("http://localhost:5173/print-document");
|
|
2221
|
-
l.searchParams.set("token", t),
|
|
2222
|
-
const
|
|
2223
|
-
return
|
|
2245
|
+
l.searchParams.set("token", t), a && l.searchParams.set("dashboardId", a), l.searchParams.set("selectedSheetId", n), u && l.searchParams.set("theme", u);
|
|
2246
|
+
const p = new URL("http://127.0.0.1:3002/");
|
|
2247
|
+
return p.searchParams.set("pdfMode", "document"), p.searchParams.set("pageSize", s || "letter"), p.searchParams.set("orientation", i || "portrait"), p.searchParams.set("url", l.toString()), p.toString();
|
|
2224
2248
|
}
|
|
2225
2249
|
export {
|
|
2226
|
-
|
|
2250
|
+
Fr as default
|
|
2227
2251
|
};
|