react-semaphor 0.1.560 → 0.1.561
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/analytics-protocol/index.js +353 -349
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +9 -9
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{analytics-base-schemas-CHLxsPfX.js → analytics-base-schemas-CB3oFAXk.js} +199 -171
- package/dist/chunks/{assistant-chat-Bu2fFm_I.js → assistant-chat-DiVHY3Hw.js} +27 -28
- package/dist/chunks/bookmark-impact-CR09dpkn.js +75 -0
- package/dist/chunks/bookmark-state-BusLpkb7.js +743 -0
- package/dist/chunks/{braces-Da41xfUd.js → braces-u8VorWJc.js} +1 -1
- package/dist/chunks/{comparison-window-caption-4FNkMrzE.js → comparison-window-caption-DDsIWJYT.js} +108 -108
- package/dist/chunks/{context-BgPDzLHZ.js → context-TUjw9eqr.js} +1 -1
- package/dist/chunks/{custom-visual-inputs-Dz-enUNR.js → custom-visual-inputs-DfolidZ9.js} +1 -1
- package/dist/chunks/{dashboard-_MeBuy67.js → dashboard-BRdZBPqr.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CEi4Pr_v.js → dashboard-briefing-launcher-CgvTLndW.js} +161 -162
- package/dist/chunks/{dashboard-controls-Bi7fyG-4.js → dashboard-controls-B4vfSzTF.js} +881 -945
- package/dist/chunks/{dashboard-json-B1mU_OMa.js → dashboard-json-Y3MF59g7.js} +5 -5
- package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +1718 -0
- package/dist/chunks/{edit-dashboard-visual-0CJN31Y3.js → edit-dashboard-visual-DwjZcxj-.js} +6112 -6146
- package/dist/chunks/{filter-reach-copy-BF4w4kI2.js → filter-reach-copy-bijwf_-b.js} +1250 -1392
- package/dist/chunks/{filter-value-text-CRC-K_l_.js → filter-value-text-DFnhwuEW.js} +3 -3
- package/dist/chunks/global-date-filter-utils-BXgCpvQM.js +15142 -0
- package/dist/chunks/{index-DtHidOPV.js → index-ClwbY3BL.js} +197 -198
- package/dist/chunks/{layout-grid-BvsH4RY2.js → layout-grid-CtvCBfOm.js} +1 -1
- package/dist/chunks/{list-filter-Dg0otx5E.js → list-filter-BklYgciR.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CM18W8w6.js → matrix-analytical-definition-pU51-JmY.js} +4 -4
- package/dist/chunks/{matrix-card-HPskLaPy.js → matrix-card-CUorIB7Q.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-Bbrfrke4.js → matrix-member-presentation-Df5UgCGN.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-WPv4R-H_.js → matrix-operation-contract-BSiGEXVC.js} +255 -248
- package/dist/chunks/{metric-comparison-ljMKYZKa.js → metric-comparison-95aC0uEO.js} +6 -6
- package/dist/chunks/{model-change-Ccn1zaxl.js → model-change-B5wQhg5G.js} +1 -1
- package/dist/chunks/{palette-Bsh376zO.js → palette-DTnMhipt.js} +1 -1
- package/dist/chunks/pivot-result-contract-expectations-Bo-86vwS.js +56 -0
- package/dist/chunks/{pivot-result-identity-vS9TSh4f.js → pivot-result-identity-olvXJoB9.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-BV8L0SeS.js → report-preferences-dialog-C2YUIwKG.js} +14 -14
- package/dist/chunks/{report-runtime-context-BZQh9ywy.js → report-runtime-context-DoIUr3MP.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-q_iiNXE1.js +6503 -0
- package/dist/chunks/{save-B5EAsgQF.js → save-DH4RyrnG.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-n2Wn11cV.js → saved-dashboard-context-8jqfI7hI.js} +12 -12
- package/dist/chunks/{selection-reducer-D0YnaAD9.js → selection-reducer-CV7K4FI6.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-XLBLOJ2V.js → semaphor-ready-indicator-E2XWyibu.js} +30253 -31076
- package/dist/chunks/{shelf-drop-preview-context-DHMa54a-.js → shelf-drop-preview-context-C29EUzDp.js} +7 -7
- package/dist/chunks/{source-entity-resolution-dUG5VWRm.js → source-entity-resolution-BXI3nQ5Z.js} +1 -1
- package/dist/chunks/{switch-ByxH4M7t.js → switch-balDSHc7.js} +3 -3
- package/dist/chunks/{table-export-sheet-C_GdeTYU.js → table-export-sheet-CK8tvh4d.js} +1 -1
- package/dist/chunks/temporal-input-presentation-B77JsAzU.js +5002 -0
- package/dist/chunks/{token-types-CQtXUVMy.js → token-types-DhYH5YKb.js} +1 -1
- package/dist/chunks/{upload-wbR-NVzq.js → upload-Ufj8vjyn.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CEBaLOKC.js → use-create-flow-overlay-state-9WsnzEO5.js} +6 -6
- package/dist/chunks/{validators-CXTneCA4.js → validators-BtaCFIEB.js} +37 -37
- package/dist/chunks/{zoned-wall-clock-B1n_WjW3.js → zoned-wall-clock-CGLVI40Q.js} +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2400 -1856
- package/dist/data-app-sdk/index.js +20 -20
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +10 -10
- package/dist/format-utils/index.js +257 -256
- package/dist/index.js +214 -215
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/dashboard/summary-number-formatter.d.ts +6 -0
- package/dist/types/index.js +50 -51
- package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
- package/dist/types/lib/stores/editor-store.d.ts +9 -1
- package/dist/types/lib/stores/table-actions.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +10 -0
- package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +52 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +102 -0
- package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +539 -22
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +27 -8
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +25 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +1 -8
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/index.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +21 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +10 -4
- package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +8 -1
- package/dist/types/shared/format-utils/raw-temporal.d.ts +16 -0
- package/package.json +2 -2
- package/dist/chunks/bookmark-state-BFY9oNmr.js +0 -111
- package/dist/chunks/document-dashboard-inputs-CkWfDB8c.js +0 -3010
- package/dist/chunks/global-date-filter-utils-D8365uPH.js +0 -12889
- package/dist/chunks/pivot-result-contract-expectations-Bl5suy4-.js +0 -1832
- package/dist/chunks/raw-temporal-presentation-BHm7s-hz.js +0 -540
- package/dist/chunks/resolve-dashboard-input-context-CAMiWvyR.js +0 -5280
- package/dist/chunks/table-settings-Imz0FgWi.js +0 -637
- package/dist/chunks/temporal-input-presentation-uvNK_tM0.js +0 -3228
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsx as e, jsxs as o, Fragment as
|
|
2
|
-
import { bP as
|
|
3
|
-
import { c as we, B as G, a0 as
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { bP as _r, u as D, bQ as Rr, bR as Tr, bS as nt, bT as Ur, bU as Br, bV as Fr, bW as $r, bX as Gr, bY as Vr, b8 as J, b5 as ve, bZ as ye, bJ as k, b_ as jr, bK as Tt, bL as Ut, bN as Ze, bO as et, b$ as Bt, aS as st, bD as Hr, a$ as re, c0 as qr, c1 as zr, c2 as Ft, c3 as Kr, c4 as $t, aR as Qr, bM as Wr, c5 as Yr, c6 as O, c7 as Jr, c8 as Xr, c9 as Zr, aC as ea, ca as ta, bv as ra, cb as aa, bw as na, j as sa, W as oa, a6 as Dt, i as Pe, p as ia, k as Ye, cc as da, cd as ca, Q as la, ce as ua, s as ma, cf as ha, cg as pa, ch as fa, ci as ga, cj as kt, ck as Ct, cl as Et, cm as ba, bx as xa, cn as va, co as ya, cp as wa, cq as ge, cr as _e, cs as Na, ct as Sa, cu as Da, cv as At, o as ka, cw as Ca, cx as Ea, cy as Aa, cz as Ia, cA as Ma, cB as La, cC as Oa, cD as Pa, cE as It } from "./semaphor-ready-indicator-E2XWyibu.js";
|
|
3
|
+
import { c as we, B as G, a0 as _a, a1 as Ra, a2 as tt, L as Te, X as Gt, m as Ta, s as Ua, t as Ba, u as Fa, v as $a, w as Ga, P as Va, a as ja, b as Ha, y as qa, n as za, o as Ka, p as Qa, I as Wa, q as Ya, d as Vt } from "./switch-balDSHc7.js";
|
|
4
|
+
import * as E from "react";
|
|
5
|
+
import jt, { useMemo as V, useState as N, useEffect as be, useRef as Mt, useLayoutEffect as Ja } from "react";
|
|
6
6
|
import "./index-CuHybtft.js";
|
|
7
|
-
import "./validators-
|
|
8
|
-
import "./matrix-operation-contract-
|
|
9
|
-
import "./analytics-base-schemas-
|
|
7
|
+
import "./validators-BtaCFIEB.js";
|
|
8
|
+
import "./matrix-operation-contract-BSiGEXVC.js";
|
|
9
|
+
import "./analytics-base-schemas-CB3oFAXk.js";
|
|
10
10
|
import "zod";
|
|
11
11
|
import "../value-format-preferences/index.js";
|
|
12
12
|
import { c as xe } from "./_commonjsHelpers-DimLPMtv.js";
|
|
13
|
-
import { u as
|
|
14
|
-
import { I as
|
|
15
|
-
import { u as
|
|
16
|
-
import { createPortal as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { r as
|
|
21
|
-
import { u as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { S as
|
|
25
|
-
import { P as
|
|
26
|
-
import { B as
|
|
13
|
+
import { u as Xa, d as Za, c as en, D as tn, A as rn, a as an, j as nn, V as sn, b as on, e as dn, S as cn, T as ln, i as un, k as mn, U as hn } from "./dashboard-briefing-launcher-CgvTLndW.js";
|
|
14
|
+
import { I as pn } from "./use-create-flow-overlay-state-9WsnzEO5.js";
|
|
15
|
+
import { u as fn, h as gn, R as bn, l as xn } from "./report-preferences-dialog-C2YUIwKG.js";
|
|
16
|
+
import { createPortal as vn } from "react-dom";
|
|
17
|
+
import { eg as Ne, eh as ot, ei as Ht, aX as yn } from "./global-date-filter-utils-BXgCpvQM.js";
|
|
18
|
+
import { aH as qt } from "./temporal-input-presentation-B77JsAzU.js";
|
|
19
|
+
import { j as rt } from "./resolve-dashboard-input-context-q_iiNXE1.js";
|
|
20
|
+
import { r as wn } from "./export-file-format-C-tJsxsf.js";
|
|
21
|
+
import { u as Nn, s as Sn } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
|
|
22
|
+
import { y as zt } from "./bookmark-state-BusLpkb7.js";
|
|
23
|
+
import { d as Dn, a as kn } from "./bookmark-impact-CR09dpkn.js";
|
|
24
|
+
import { S as Cn } from "./save-DH4RyrnG.js";
|
|
25
|
+
import { P as En } from "./palette-DTnMhipt.js";
|
|
26
|
+
import { B as An } from "./braces-u8VorWJc.js";
|
|
27
27
|
/**
|
|
28
28
|
* @license lucide-react v0.453.0 - ISC
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the ISC license.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
32
|
*/
|
|
33
|
-
const
|
|
33
|
+
const In = we("Moon", [
|
|
34
34
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
35
35
|
]);
|
|
36
36
|
/**
|
|
@@ -39,7 +39,7 @@ const Tn = we("Moon", [
|
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
41
|
*/
|
|
42
|
-
const
|
|
42
|
+
const Mn = we("ShieldX", [
|
|
43
43
|
[
|
|
44
44
|
"path",
|
|
45
45
|
{
|
|
@@ -56,7 +56,7 @@ const Rn = we("ShieldX", [
|
|
|
56
56
|
* This source code is licensed under the ISC license.
|
|
57
57
|
* See the LICENSE file in the root directory of this source tree.
|
|
58
58
|
*/
|
|
59
|
-
const
|
|
59
|
+
const Ln = we("Sun", [
|
|
60
60
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
61
61
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
62
62
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -73,7 +73,7 @@ const Un = we("Sun", [
|
|
|
73
73
|
* This source code is licensed under the ISC license.
|
|
74
74
|
* See the LICENSE file in the root directory of this source tree.
|
|
75
75
|
*/
|
|
76
|
-
const
|
|
76
|
+
const On = we("UserPlus", [
|
|
77
77
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
78
78
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
79
79
|
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
@@ -85,11 +85,11 @@ const $n = we("UserPlus", [
|
|
|
85
85
|
* This source code is licensed under the ISC license.
|
|
86
86
|
* See the LICENSE file in the root directory of this source tree.
|
|
87
87
|
*/
|
|
88
|
-
const
|
|
88
|
+
const Kt = we("UserRound", [
|
|
89
89
|
["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
|
|
90
90
|
["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
|
|
91
91
|
]);
|
|
92
|
-
var
|
|
92
|
+
var at = { exports: {} }, Je = {};
|
|
93
93
|
/**
|
|
94
94
|
* @license React
|
|
95
95
|
* use-sync-external-store-shim.production.js
|
|
@@ -99,48 +99,48 @@ var nt = { exports: {} }, Xe = {};
|
|
|
99
99
|
* This source code is licensed under the MIT license found in the
|
|
100
100
|
* LICENSE file in the root directory of this source tree.
|
|
101
101
|
*/
|
|
102
|
-
var
|
|
103
|
-
function
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
var t =
|
|
107
|
-
function
|
|
108
|
-
return c ===
|
|
102
|
+
var Lt;
|
|
103
|
+
function Pn() {
|
|
104
|
+
if (Lt) return Je;
|
|
105
|
+
Lt = 1;
|
|
106
|
+
var t = jt;
|
|
107
|
+
function n(c, f) {
|
|
108
|
+
return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f;
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
112
|
-
var
|
|
110
|
+
var a = typeof Object.is == "function" ? Object.is : n, r = t.useState, s = t.useEffect, d = t.useLayoutEffect, h = t.useDebugValue;
|
|
111
|
+
function u(c, f) {
|
|
112
|
+
var m = f(), p = r({ inst: { value: m, getSnapshot: f } }), x = p[0].inst, w = p[1];
|
|
113
113
|
return d(
|
|
114
114
|
function() {
|
|
115
|
-
x.value =
|
|
115
|
+
x.value = m, x.getSnapshot = f, b(x) && w({ inst: x });
|
|
116
116
|
},
|
|
117
|
-
[c,
|
|
117
|
+
[c, m, f]
|
|
118
118
|
), s(
|
|
119
119
|
function() {
|
|
120
|
-
return
|
|
121
|
-
|
|
120
|
+
return b(x) && w({ inst: x }), c(function() {
|
|
121
|
+
b(x) && w({ inst: x });
|
|
122
122
|
});
|
|
123
123
|
},
|
|
124
124
|
[c]
|
|
125
|
-
),
|
|
125
|
+
), h(m), m;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
var
|
|
127
|
+
function b(c) {
|
|
128
|
+
var f = c.getSnapshot;
|
|
129
129
|
c = c.value;
|
|
130
130
|
try {
|
|
131
|
-
var
|
|
132
|
-
return !
|
|
131
|
+
var m = f();
|
|
132
|
+
return !a(c, m);
|
|
133
133
|
} catch {
|
|
134
134
|
return !0;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
function v(c,
|
|
138
|
-
return
|
|
137
|
+
function v(c, f) {
|
|
138
|
+
return f();
|
|
139
139
|
}
|
|
140
|
-
var
|
|
141
|
-
return
|
|
140
|
+
var l = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : u;
|
|
141
|
+
return Je.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : l, Je;
|
|
142
142
|
}
|
|
143
|
-
var
|
|
143
|
+
var Xe = {};
|
|
144
144
|
/**
|
|
145
145
|
* @license React
|
|
146
146
|
* use-sync-external-store-shim.development.js
|
|
@@ -150,14 +150,14 @@ var Ze = {};
|
|
|
150
150
|
* This source code is licensed under the MIT license found in the
|
|
151
151
|
* LICENSE file in the root directory of this source tree.
|
|
152
152
|
*/
|
|
153
|
-
var
|
|
154
|
-
function
|
|
155
|
-
return
|
|
156
|
-
function t(
|
|
157
|
-
return
|
|
153
|
+
var Ot;
|
|
154
|
+
function _n() {
|
|
155
|
+
return Ot || (Ot = 1, process.env.NODE_ENV !== "production" && function() {
|
|
156
|
+
function t(m, p) {
|
|
157
|
+
return m === p && (m !== 0 || 1 / m === 1 / p) || m !== m && p !== p;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
|
|
159
|
+
function n(m, p) {
|
|
160
|
+
l || s.startTransition === void 0 || (l = !0, console.error(
|
|
161
161
|
"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."
|
|
162
162
|
));
|
|
163
163
|
var x = p();
|
|
@@ -167,54 +167,54 @@ function Fn() {
|
|
|
167
167
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
168
168
|
), c = !0);
|
|
169
169
|
}
|
|
170
|
-
w =
|
|
170
|
+
w = h({
|
|
171
171
|
inst: { value: x, getSnapshot: p }
|
|
172
172
|
});
|
|
173
|
-
var S = w[0].inst,
|
|
174
|
-
return
|
|
173
|
+
var S = w[0].inst, g = w[1];
|
|
174
|
+
return b(
|
|
175
175
|
function() {
|
|
176
|
-
S.value = x, S.getSnapshot = p,
|
|
176
|
+
S.value = x, S.getSnapshot = p, a(S) && g({ inst: S });
|
|
177
177
|
},
|
|
178
|
-
[
|
|
179
|
-
),
|
|
178
|
+
[m, x, p]
|
|
179
|
+
), u(
|
|
180
180
|
function() {
|
|
181
|
-
return
|
|
182
|
-
|
|
181
|
+
return a(S) && g({ inst: S }), m(function() {
|
|
182
|
+
a(S) && g({ inst: S });
|
|
183
183
|
});
|
|
184
184
|
},
|
|
185
|
-
[
|
|
185
|
+
[m]
|
|
186
186
|
), v(x), x;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
var p =
|
|
190
|
-
|
|
188
|
+
function a(m) {
|
|
189
|
+
var p = m.getSnapshot;
|
|
190
|
+
m = m.value;
|
|
191
191
|
try {
|
|
192
192
|
var x = p();
|
|
193
|
-
return !d(
|
|
193
|
+
return !d(m, x);
|
|
194
194
|
} catch {
|
|
195
195
|
return !0;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
function r(
|
|
198
|
+
function r(m, p) {
|
|
199
199
|
return p();
|
|
200
200
|
}
|
|
201
201
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
202
|
-
var s =
|
|
203
|
-
|
|
204
|
-
}()),
|
|
202
|
+
var s = jt, d = typeof Object.is == "function" ? Object.is : t, h = s.useState, u = s.useEffect, b = s.useLayoutEffect, v = s.useDebugValue, l = !1, c = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
|
|
203
|
+
Xe.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
204
|
+
}()), Xe;
|
|
205
205
|
}
|
|
206
|
-
process.env.NODE_ENV === "production" ?
|
|
207
|
-
var
|
|
208
|
-
const
|
|
209
|
-
function
|
|
210
|
-
const { theme: t, setTheme:
|
|
211
|
-
(
|
|
206
|
+
process.env.NODE_ENV === "production" ? at.exports = Pn() : at.exports = _n();
|
|
207
|
+
var Rn = at.exports;
|
|
208
|
+
const Re = ["light", "dark", "system"];
|
|
209
|
+
function Tn() {
|
|
210
|
+
const { theme: t, setTheme: n } = _r(), a = D(
|
|
211
|
+
(h) => h.actions.setDashboardTheme
|
|
212
212
|
);
|
|
213
213
|
function r() {
|
|
214
|
-
const
|
|
215
|
-
|
|
214
|
+
const h = Re.includes(t) ? t : "system", u = Re[(Re.indexOf(h) + 1) % Re.length];
|
|
215
|
+
n(u), a(u);
|
|
216
216
|
}
|
|
217
|
-
const s = t === "light" ?
|
|
217
|
+
const s = t === "light" ? Ln : t === "dark" ? In : Rr, d = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
|
|
218
218
|
return /* @__PURE__ */ e(
|
|
219
219
|
G,
|
|
220
220
|
{
|
|
@@ -229,83 +229,83 @@ function jn() {
|
|
|
229
229
|
}
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
const { displayPreferences: t, shouldShowElement:
|
|
234
|
-
() =>
|
|
235
|
-
[
|
|
236
|
-
), d =
|
|
232
|
+
function Un() {
|
|
233
|
+
const { displayPreferences: t, shouldShowElement: n } = Tr(), { currentUser: a, userContext: r } = nt(), s = V(
|
|
234
|
+
() => Ur(a),
|
|
235
|
+
[a]
|
|
236
|
+
), d = V(() => (u) => s && s[u] !== void 0 && s[u] === !1 ? !1 : n(u), [s, n, t]), h = V(
|
|
237
237
|
() => {
|
|
238
|
-
var
|
|
238
|
+
var u, b, v, l, c;
|
|
239
239
|
return {
|
|
240
|
-
canEdit: ((
|
|
241
|
-
canUseFilters: ((
|
|
242
|
-
canManageDashboards: ((v = r == null ? void 0 : r.permissions) == null ? void 0 : v.canCreateDashboard) ??
|
|
243
|
-
canCreateDashboards: ((
|
|
244
|
-
canAccessVisuals: ((c = r == null ? void 0 : r.permissions) == null ? void 0 : c.canEdit) ??
|
|
240
|
+
canEdit: ((u = r == null ? void 0 : r.permissions) == null ? void 0 : u.canEdit) ?? Vr(a),
|
|
241
|
+
canUseFilters: ((b = r == null ? void 0 : r.permissions) == null ? void 0 : b.canEdit) ?? Gr(a),
|
|
242
|
+
canManageDashboards: ((v = r == null ? void 0 : r.permissions) == null ? void 0 : v.canCreateDashboard) ?? $r(a),
|
|
243
|
+
canCreateDashboards: ((l = r == null ? void 0 : r.permissions) == null ? void 0 : l.canCreateDashboard) ?? Fr(a),
|
|
244
|
+
canAccessVisuals: ((c = r == null ? void 0 : r.permissions) == null ? void 0 : c.canEdit) ?? Br(a)
|
|
245
245
|
};
|
|
246
246
|
},
|
|
247
|
-
[
|
|
247
|
+
[a, r]
|
|
248
248
|
);
|
|
249
249
|
return {
|
|
250
250
|
displayPreferences: t,
|
|
251
251
|
shouldShowElement: d,
|
|
252
|
-
permissions:
|
|
253
|
-
currentUser:
|
|
252
|
+
permissions: h,
|
|
253
|
+
currentUser: a
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
let
|
|
258
|
-
function r(d,
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
const
|
|
262
|
-
|
|
256
|
+
function Bn(t, n = []) {
|
|
257
|
+
let a = [];
|
|
258
|
+
function r(d, h) {
|
|
259
|
+
const u = E.createContext(h);
|
|
260
|
+
u.displayName = d + "Context";
|
|
261
|
+
const b = a.length;
|
|
262
|
+
a = [...a, h];
|
|
263
263
|
const v = (c) => {
|
|
264
264
|
var S;
|
|
265
|
-
const { scope:
|
|
266
|
-
return /* @__PURE__ */ e(x.Provider, { value: w, children:
|
|
265
|
+
const { scope: f, children: m, ...p } = c, x = ((S = f == null ? void 0 : f[t]) == null ? void 0 : S[b]) || u, w = E.useMemo(() => p, Object.values(p));
|
|
266
|
+
return /* @__PURE__ */ e(x.Provider, { value: w, children: m });
|
|
267
267
|
};
|
|
268
268
|
v.displayName = d + "Provider";
|
|
269
|
-
function
|
|
269
|
+
function l(c, f) {
|
|
270
270
|
var x;
|
|
271
|
-
const
|
|
271
|
+
const m = ((x = f == null ? void 0 : f[t]) == null ? void 0 : x[b]) || u, p = E.useContext(m);
|
|
272
272
|
if (p) return p;
|
|
273
|
-
if (
|
|
273
|
+
if (h !== void 0) return h;
|
|
274
274
|
throw new Error(`\`${c}\` must be used within \`${d}\``);
|
|
275
275
|
}
|
|
276
|
-
return [v,
|
|
276
|
+
return [v, l];
|
|
277
277
|
}
|
|
278
278
|
const s = () => {
|
|
279
|
-
const d =
|
|
280
|
-
return function(
|
|
281
|
-
const
|
|
282
|
-
return
|
|
283
|
-
() => ({ [`__scope${t}`]: { ...
|
|
284
|
-
[
|
|
279
|
+
const d = a.map((h) => E.createContext(h));
|
|
280
|
+
return function(u) {
|
|
281
|
+
const b = (u == null ? void 0 : u[t]) || d;
|
|
282
|
+
return E.useMemo(
|
|
283
|
+
() => ({ [`__scope${t}`]: { ...u, [t]: b } }),
|
|
284
|
+
[u, b]
|
|
285
285
|
);
|
|
286
286
|
};
|
|
287
287
|
};
|
|
288
|
-
return s.scopeName = t, [r,
|
|
288
|
+
return s.scopeName = t, [r, Fn(s, ...n)];
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
const
|
|
292
|
-
if (t.length === 1) return
|
|
293
|
-
const
|
|
290
|
+
function Fn(...t) {
|
|
291
|
+
const n = t[0];
|
|
292
|
+
if (t.length === 1) return n;
|
|
293
|
+
const a = () => {
|
|
294
294
|
const r = t.map((s) => ({
|
|
295
295
|
useScope: s(),
|
|
296
296
|
scopeName: s.scopeName
|
|
297
297
|
}));
|
|
298
298
|
return function(d) {
|
|
299
|
-
const
|
|
300
|
-
const c =
|
|
301
|
-
return { ...
|
|
299
|
+
const h = r.reduce((u, { useScope: b, scopeName: v }) => {
|
|
300
|
+
const c = b(d)[`__scope${v}`];
|
|
301
|
+
return { ...u, ...c };
|
|
302
302
|
}, {});
|
|
303
|
-
return
|
|
303
|
+
return E.useMemo(() => ({ [`__scope${n.scopeName}`]: h }), [h]);
|
|
304
304
|
};
|
|
305
305
|
};
|
|
306
|
-
return
|
|
306
|
+
return a.scopeName = n.scopeName, a;
|
|
307
307
|
}
|
|
308
|
-
var
|
|
308
|
+
var $n = [
|
|
309
309
|
"a",
|
|
310
310
|
"button",
|
|
311
311
|
"div",
|
|
@@ -323,282 +323,282 @@ var zn = [
|
|
|
323
323
|
"span",
|
|
324
324
|
"svg",
|
|
325
325
|
"ul"
|
|
326
|
-
],
|
|
327
|
-
const
|
|
328
|
-
const { asChild:
|
|
329
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(
|
|
326
|
+
], it = $n.reduce((t, n) => {
|
|
327
|
+
const a = _a(`Primitive.${n}`), r = E.forwardRef((s, d) => {
|
|
328
|
+
const { asChild: h, ...u } = s, b = h ? a : n;
|
|
329
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(b, { ...u, ref: d });
|
|
330
330
|
});
|
|
331
|
-
return r.displayName = `Primitive.${
|
|
331
|
+
return r.displayName = `Primitive.${n}`, { ...t, [n]: r };
|
|
332
332
|
}, {});
|
|
333
|
-
function
|
|
334
|
-
return
|
|
335
|
-
|
|
333
|
+
function Gn() {
|
|
334
|
+
return Rn.useSyncExternalStore(
|
|
335
|
+
Vn,
|
|
336
336
|
() => !0,
|
|
337
337
|
() => !1
|
|
338
338
|
);
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function Vn() {
|
|
341
341
|
return () => {
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
|
-
var
|
|
345
|
-
(t,
|
|
346
|
-
const { __scopeAvatar:
|
|
344
|
+
var dt = "Avatar", [jn] = Bn(dt), [Hn, Qt] = jn(dt), Wt = E.forwardRef(
|
|
345
|
+
(t, n) => {
|
|
346
|
+
const { __scopeAvatar: a, ...r } = t, [s, d] = E.useState("idle");
|
|
347
347
|
return /* @__PURE__ */ e(
|
|
348
|
-
|
|
348
|
+
Hn,
|
|
349
349
|
{
|
|
350
|
-
scope:
|
|
350
|
+
scope: a,
|
|
351
351
|
imageLoadingStatus: s,
|
|
352
352
|
onImageLoadingStatusChange: d,
|
|
353
|
-
children: /* @__PURE__ */ e(
|
|
353
|
+
children: /* @__PURE__ */ e(it.span, { ...r, ref: n })
|
|
354
354
|
}
|
|
355
355
|
);
|
|
356
356
|
}
|
|
357
357
|
);
|
|
358
|
-
|
|
359
|
-
var
|
|
360
|
-
(t,
|
|
361
|
-
const { __scopeAvatar:
|
|
362
|
-
}, ...d } = t,
|
|
363
|
-
s(v),
|
|
358
|
+
Wt.displayName = dt;
|
|
359
|
+
var Yt = "AvatarImage", Jt = E.forwardRef(
|
|
360
|
+
(t, n) => {
|
|
361
|
+
const { __scopeAvatar: a, src: r, onLoadingStatusChange: s = () => {
|
|
362
|
+
}, ...d } = t, h = Qt(Yt, a), u = qn(r, d), b = Ra((v) => {
|
|
363
|
+
s(v), h.onImageLoadingStatusChange(v);
|
|
364
364
|
});
|
|
365
|
-
return
|
|
366
|
-
|
|
367
|
-
}, [
|
|
365
|
+
return tt(() => {
|
|
366
|
+
u !== "idle" && b(u);
|
|
367
|
+
}, [u, b]), u === "loaded" ? /* @__PURE__ */ e(it.img, { ...d, ref: n, src: r }) : null;
|
|
368
368
|
}
|
|
369
369
|
);
|
|
370
|
-
|
|
371
|
-
var
|
|
372
|
-
(t,
|
|
373
|
-
const { __scopeAvatar:
|
|
374
|
-
return
|
|
370
|
+
Jt.displayName = Yt;
|
|
371
|
+
var Xt = "AvatarFallback", Zt = E.forwardRef(
|
|
372
|
+
(t, n) => {
|
|
373
|
+
const { __scopeAvatar: a, delayMs: r, ...s } = t, d = Qt(Xt, a), [h, u] = E.useState(r === void 0);
|
|
374
|
+
return E.useEffect(() => {
|
|
375
375
|
if (r !== void 0) {
|
|
376
|
-
const
|
|
377
|
-
return () => window.clearTimeout(
|
|
376
|
+
const b = window.setTimeout(() => u(!0), r);
|
|
377
|
+
return () => window.clearTimeout(b);
|
|
378
378
|
}
|
|
379
|
-
}, [r]),
|
|
379
|
+
}, [r]), h && d.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(it.span, { ...s, ref: n }) : null;
|
|
380
380
|
}
|
|
381
381
|
);
|
|
382
|
-
|
|
383
|
-
function
|
|
384
|
-
return t ?
|
|
382
|
+
Zt.displayName = Xt;
|
|
383
|
+
function Pt(t, n) {
|
|
384
|
+
return t ? n ? (t.src !== n && (t.src = n), t.complete && t.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
const r =
|
|
388
|
-
() =>
|
|
386
|
+
function qn(t, { referrerPolicy: n, crossOrigin: a }) {
|
|
387
|
+
const r = Gn(), s = E.useRef(null), d = r ? (s.current || (s.current = new window.Image()), s.current) : null, [h, u] = E.useState(
|
|
388
|
+
() => Pt(d, t)
|
|
389
389
|
);
|
|
390
|
-
return
|
|
391
|
-
|
|
392
|
-
}, [d, t]),
|
|
393
|
-
const
|
|
394
|
-
|
|
390
|
+
return tt(() => {
|
|
391
|
+
u(Pt(d, t));
|
|
392
|
+
}, [d, t]), tt(() => {
|
|
393
|
+
const b = (c) => () => {
|
|
394
|
+
u(c);
|
|
395
395
|
};
|
|
396
396
|
if (!d) return;
|
|
397
|
-
const v =
|
|
398
|
-
return d.addEventListener("load", v), d.addEventListener("error",
|
|
399
|
-
d.removeEventListener("load", v), d.removeEventListener("error",
|
|
397
|
+
const v = b("loaded"), l = b("error");
|
|
398
|
+
return d.addEventListener("load", v), d.addEventListener("error", l), n && (d.referrerPolicy = n), typeof a == "string" && (d.crossOrigin = a), () => {
|
|
399
|
+
d.removeEventListener("load", v), d.removeEventListener("error", l);
|
|
400
400
|
};
|
|
401
|
-
}, [d,
|
|
401
|
+
}, [d, a, n]), h;
|
|
402
402
|
}
|
|
403
|
-
var
|
|
404
|
-
const
|
|
405
|
-
|
|
403
|
+
var er = Wt, tr = Jt, rr = Zt;
|
|
404
|
+
const ar = E.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
|
|
405
|
+
er,
|
|
406
406
|
{
|
|
407
|
-
ref:
|
|
407
|
+
ref: a,
|
|
408
408
|
className: xe(
|
|
409
409
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
410
410
|
t
|
|
411
411
|
),
|
|
412
|
-
...
|
|
412
|
+
...n
|
|
413
413
|
}
|
|
414
414
|
));
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
|
|
415
|
+
ar.displayName = er.displayName;
|
|
416
|
+
const zn = E.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
|
|
417
|
+
tr,
|
|
418
418
|
{
|
|
419
|
-
ref:
|
|
419
|
+
ref: a,
|
|
420
420
|
className: xe("aspect-square h-full w-full", t),
|
|
421
|
-
...
|
|
421
|
+
...n
|
|
422
422
|
}
|
|
423
423
|
));
|
|
424
|
-
|
|
425
|
-
const
|
|
426
|
-
|
|
424
|
+
zn.displayName = tr.displayName;
|
|
425
|
+
const nr = E.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
|
|
426
|
+
rr,
|
|
427
427
|
{
|
|
428
|
-
ref:
|
|
428
|
+
ref: a,
|
|
429
429
|
className: xe(
|
|
430
430
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
431
431
|
t
|
|
432
432
|
),
|
|
433
|
-
...
|
|
433
|
+
...n
|
|
434
434
|
}
|
|
435
435
|
));
|
|
436
|
-
|
|
437
|
-
const
|
|
436
|
+
nr.displayName = rr.displayName;
|
|
437
|
+
const Kn = async (t, n, a) => {
|
|
438
438
|
const r = `${t}/management/v1/groups`;
|
|
439
|
-
return await
|
|
440
|
-
},
|
|
441
|
-
const s = `${t}/management/v1/groups/${
|
|
442
|
-
return
|
|
443
|
-
},
|
|
444
|
-
const r = `${t}/management/v1/groups/${
|
|
445
|
-
await
|
|
446
|
-
},
|
|
447
|
-
const s = `${t}/management/v1/groups/${
|
|
448
|
-
return await
|
|
449
|
-
},
|
|
450
|
-
const s = `${t}/management/v1/groups/${
|
|
451
|
-
await
|
|
439
|
+
return await Ht(r, n, a);
|
|
440
|
+
}, Qn = async (t, n, a, r) => {
|
|
441
|
+
const s = `${t}/management/v1/groups/${a}`;
|
|
442
|
+
return ot(s, n, "PATCH", r);
|
|
443
|
+
}, Wn = async (t, n, a) => {
|
|
444
|
+
const r = `${t}/management/v1/groups/${a}`;
|
|
445
|
+
await ot(r, n, "DELETE");
|
|
446
|
+
}, Yn = async (t, n, a, r) => {
|
|
447
|
+
const s = `${t}/management/v1/groups/${a}/members`;
|
|
448
|
+
return await Ht(s, n, r);
|
|
449
|
+
}, Jn = async (t, n, a, r) => {
|
|
450
|
+
const s = `${t}/management/v1/groups/${a}/members`;
|
|
451
|
+
await ot(s, n, "DELETE", r);
|
|
452
452
|
};
|
|
453
|
-
function
|
|
454
|
-
const { authToken: t, tokenProps:
|
|
453
|
+
function Xn() {
|
|
454
|
+
const { authToken: t, tokenProps: n } = J(), a = ve();
|
|
455
455
|
return ye({
|
|
456
|
-
mutationFn: (r) =>
|
|
456
|
+
mutationFn: (r) => Kn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
|
|
457
457
|
onSuccess: () => {
|
|
458
|
-
|
|
458
|
+
a.invalidateQueries({ queryKey: ["groups"] }), k.success("Group created successfully");
|
|
459
459
|
},
|
|
460
460
|
onError: (r) => {
|
|
461
|
-
console.error("Failed to create group:", r),
|
|
461
|
+
console.error("Failed to create group:", r), k.error("Failed to create group", {
|
|
462
462
|
description: Ne(r, "Failed to create group")
|
|
463
463
|
});
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
|
-
function
|
|
468
|
-
const { authToken: t, tokenProps:
|
|
467
|
+
function Zn() {
|
|
468
|
+
const { authToken: t, tokenProps: n } = J(), a = ve();
|
|
469
469
|
return ye({
|
|
470
470
|
mutationFn: ({
|
|
471
471
|
groupId: r,
|
|
472
472
|
data: s
|
|
473
|
-
}) =>
|
|
473
|
+
}) => Qn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
|
|
474
474
|
onSuccess: (r, s) => {
|
|
475
|
-
|
|
475
|
+
a.invalidateQueries({ queryKey: ["group", s.groupId] }), a.invalidateQueries({ queryKey: ["groups"] }), k.success("Group updated successfully");
|
|
476
476
|
},
|
|
477
477
|
onError: (r) => {
|
|
478
|
-
console.error("Failed to update group:", r),
|
|
478
|
+
console.error("Failed to update group:", r), k.error("Failed to update group", {
|
|
479
479
|
description: Ne(r, "Failed to update group")
|
|
480
480
|
});
|
|
481
481
|
}
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
const { authToken: t, tokenProps:
|
|
484
|
+
function es() {
|
|
485
|
+
const { authToken: t, tokenProps: n } = J(), a = ve();
|
|
486
486
|
return ye({
|
|
487
|
-
mutationFn: (r) =>
|
|
487
|
+
mutationFn: (r) => Wn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
|
|
488
488
|
onSuccess: (r, s) => {
|
|
489
|
-
|
|
489
|
+
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", s] }), k.success("Group deleted successfully");
|
|
490
490
|
},
|
|
491
491
|
onError: (r) => {
|
|
492
|
-
console.error("Failed to delete group:", r),
|
|
492
|
+
console.error("Failed to delete group:", r), k.error("Failed to delete group", {
|
|
493
493
|
description: Ne(r, "Failed to delete group")
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
|
-
function
|
|
499
|
-
const { authToken: t, tokenProps:
|
|
498
|
+
function ts() {
|
|
499
|
+
const { authToken: t, tokenProps: n } = J(), a = ve();
|
|
500
500
|
return ye({
|
|
501
501
|
mutationFn: ({
|
|
502
502
|
groupId: r,
|
|
503
503
|
data: s
|
|
504
|
-
}) =>
|
|
504
|
+
}) => Yn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
|
|
505
505
|
onSuccess: (r, s) => {
|
|
506
|
-
|
|
506
|
+
a.invalidateQueries({ queryKey: ["group", s.groupId] }), a.invalidateQueries({
|
|
507
507
|
queryKey: ["group-members", s.groupId]
|
|
508
|
-
}),
|
|
508
|
+
}), a.invalidateQueries({ queryKey: ["groups"] }), k.success("Members added successfully");
|
|
509
509
|
},
|
|
510
510
|
onError: (r) => {
|
|
511
|
-
console.error("Failed to add group members:", r),
|
|
511
|
+
console.error("Failed to add group members:", r), k.error("Failed to add members", {
|
|
512
512
|
description: Ne(r, "Failed to add members")
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
const { authToken: t, tokenProps:
|
|
517
|
+
function rs() {
|
|
518
|
+
const { authToken: t, tokenProps: n } = J(), a = ve();
|
|
519
519
|
return ye({
|
|
520
520
|
mutationFn: ({
|
|
521
521
|
groupId: r,
|
|
522
522
|
data: s
|
|
523
|
-
}) =>
|
|
523
|
+
}) => Jn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
|
|
524
524
|
onSuccess: (r, s) => {
|
|
525
|
-
|
|
525
|
+
a.invalidateQueries({ queryKey: ["group", s.groupId] }), a.invalidateQueries({
|
|
526
526
|
queryKey: ["group-members", s.groupId]
|
|
527
|
-
}),
|
|
527
|
+
}), a.invalidateQueries({ queryKey: ["groups"] }), k.success("Members removed successfully");
|
|
528
528
|
},
|
|
529
529
|
onError: (r) => {
|
|
530
|
-
console.error("Failed to remove group members:", r),
|
|
530
|
+
console.error("Failed to remove group members:", r), k.error("Failed to remove members", {
|
|
531
531
|
description: Ne(r, "Failed to remove members")
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
|
-
const
|
|
537
|
-
function
|
|
536
|
+
const as = [];
|
|
537
|
+
function ns({
|
|
538
538
|
open: t,
|
|
539
|
-
onOpenChange:
|
|
539
|
+
onOpenChange: n
|
|
540
540
|
}) {
|
|
541
|
-
var
|
|
542
|
-
const { tokenProps:
|
|
543
|
-
groups:
|
|
544
|
-
isLoading:
|
|
545
|
-
error:
|
|
541
|
+
var g, B, U;
|
|
542
|
+
const { tokenProps: a } = J(), { currentUser: r } = nt(), s = (r == null ? void 0 : r.type) === "tenant", d = a == null ? void 0 : a.tenantId, {
|
|
543
|
+
groups: h,
|
|
544
|
+
isLoading: u,
|
|
545
|
+
error: b,
|
|
546
546
|
refetch: v
|
|
547
|
-
} =
|
|
547
|
+
} = jr({
|
|
548
548
|
type: s ? "TENANT_GROUP" : "all",
|
|
549
549
|
tenantId: s ? d : void 0,
|
|
550
550
|
includeMembers: !1
|
|
551
|
-
}),
|
|
552
|
-
|
|
553
|
-
t || (
|
|
551
|
+
}), l = b ? sr(b, "Unable to load groups.") : null, [c, f] = N({ kind: "list" }), [m, p] = N(null), x = es();
|
|
552
|
+
be(() => {
|
|
553
|
+
t || (f({ kind: "list" }), p(null));
|
|
554
554
|
}, [t]);
|
|
555
|
-
const w = c.kind === "members" &&
|
|
556
|
-
if (
|
|
555
|
+
const w = c.kind === "members" && h.find((M) => M.id === c.groupId) || null, S = async () => {
|
|
556
|
+
if (m)
|
|
557
557
|
try {
|
|
558
|
-
await x.mutateAsync(
|
|
558
|
+
await x.mutateAsync(m.id), p(null), f({ kind: "list" }), v();
|
|
559
559
|
} catch {
|
|
560
560
|
}
|
|
561
561
|
};
|
|
562
|
-
return /* @__PURE__ */ e(
|
|
562
|
+
return /* @__PURE__ */ e(Tt, { open: t, onOpenChange: n, children: /* @__PURE__ */ o(Ut, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
|
|
563
563
|
c.kind === "list" ? /* @__PURE__ */ o("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
|
|
564
|
-
/* @__PURE__ */ e(
|
|
565
|
-
/* @__PURE__ */ e(
|
|
564
|
+
/* @__PURE__ */ e(Ze, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
|
|
565
|
+
/* @__PURE__ */ e(et, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
|
|
566
566
|
] }) : c.kind === "create" ? /* @__PURE__ */ o("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
567
567
|
/* @__PURE__ */ e(
|
|
568
568
|
"button",
|
|
569
569
|
{
|
|
570
570
|
type: "button",
|
|
571
|
-
onClick: () =>
|
|
571
|
+
onClick: () => f({ kind: "list" }),
|
|
572
572
|
"aria-label": "Back",
|
|
573
573
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
574
|
-
children: /* @__PURE__ */ e(
|
|
574
|
+
children: /* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" })
|
|
575
575
|
}
|
|
576
576
|
),
|
|
577
|
-
/* @__PURE__ */ e(
|
|
578
|
-
/* @__PURE__ */ e(
|
|
577
|
+
/* @__PURE__ */ e(Ze, { className: "truncate text-[13px] font-medium", children: "New group" }),
|
|
578
|
+
/* @__PURE__ */ e(et, { className: "sr-only", children: "Create a new group to organize members." })
|
|
579
579
|
] }) : null,
|
|
580
580
|
c.kind === "list" && /* @__PURE__ */ e(
|
|
581
|
-
|
|
581
|
+
ss,
|
|
582
582
|
{
|
|
583
|
-
groups:
|
|
584
|
-
isLoading:
|
|
585
|
-
errorMessage:
|
|
583
|
+
groups: h,
|
|
584
|
+
isLoading: u,
|
|
585
|
+
errorMessage: l,
|
|
586
586
|
onRetry: () => v(),
|
|
587
587
|
currentUserId: r == null ? void 0 : r.id,
|
|
588
|
-
onOpenGroup: (
|
|
589
|
-
onCreate: () =>
|
|
590
|
-
onDeleteRequest: (
|
|
588
|
+
onOpenGroup: (M) => f({ kind: "members", groupId: M }),
|
|
589
|
+
onCreate: () => f({ kind: "create" }),
|
|
590
|
+
onDeleteRequest: (M) => p(M)
|
|
591
591
|
}
|
|
592
592
|
),
|
|
593
593
|
c.kind === "members" && w && /* @__PURE__ */ e(
|
|
594
|
-
|
|
594
|
+
ds,
|
|
595
595
|
{
|
|
596
596
|
group: w,
|
|
597
597
|
isTenantViewer: s,
|
|
598
|
-
canEdit: ((
|
|
599
|
-
canDelete: ((
|
|
600
|
-
canManageMembers: ((
|
|
601
|
-
onBack: () =>
|
|
598
|
+
canEdit: ((g = w.permissions) == null ? void 0 : g.canEdit) ?? w.createdBy === (r == null ? void 0 : r.id),
|
|
599
|
+
canDelete: ((B = w.permissions) == null ? void 0 : B.canDelete) ?? w.createdBy === (r == null ? void 0 : r.id),
|
|
600
|
+
canManageMembers: ((U = w.permissions) == null ? void 0 : U.canManageMembers) ?? w.createdBy === (r == null ? void 0 : r.id),
|
|
601
|
+
onBack: () => f({ kind: "list" }),
|
|
602
602
|
onMembersChanged: v,
|
|
603
603
|
onUpdated: v,
|
|
604
604
|
onRequestDelete: () => p(w)
|
|
@@ -606,20 +606,20 @@ function ls({
|
|
|
606
606
|
w.id
|
|
607
607
|
),
|
|
608
608
|
c.kind === "create" && /* @__PURE__ */ e(
|
|
609
|
-
|
|
609
|
+
cs,
|
|
610
610
|
{
|
|
611
611
|
isTenantUser: s,
|
|
612
612
|
tenantId: d,
|
|
613
|
-
onCancel: () =>
|
|
614
|
-
onCreated: (
|
|
615
|
-
v(),
|
|
613
|
+
onCancel: () => f({ kind: "list" }),
|
|
614
|
+
onCreated: (M) => {
|
|
615
|
+
v(), f({ kind: "members", groupId: M });
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
618
|
),
|
|
619
|
-
|
|
619
|
+
m && /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center justify-between gap-3 border-t border-border bg-muted/40 px-5 py-2.5", children: [
|
|
620
620
|
/* @__PURE__ */ o("div", { className: "min-w-0 text-[12px] text-foreground", children: [
|
|
621
621
|
"Delete ",
|
|
622
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children:
|
|
622
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: m.name }),
|
|
623
623
|
"?",
|
|
624
624
|
/* @__PURE__ */ e("span", { className: "ml-2 text-muted-foreground", children: "Members lose any access granted via this group." })
|
|
625
625
|
] }),
|
|
@@ -642,7 +642,7 @@ function ls({
|
|
|
642
642
|
disabled: x.isPending,
|
|
643
643
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-rose-600 px-2.5 text-[12px] font-medium text-white hover:bg-rose-700 disabled:opacity-60",
|
|
644
644
|
children: [
|
|
645
|
-
x.isPending ? /* @__PURE__ */ e(
|
|
645
|
+
x.isPending ? /* @__PURE__ */ e(Te, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(st, { className: "h-3 w-3" }),
|
|
646
646
|
"Delete group"
|
|
647
647
|
]
|
|
648
648
|
}
|
|
@@ -651,42 +651,42 @@ function ls({
|
|
|
651
651
|
] })
|
|
652
652
|
] }) });
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function ss({
|
|
655
655
|
groups: t,
|
|
656
|
-
isLoading:
|
|
657
|
-
errorMessage:
|
|
656
|
+
isLoading: n,
|
|
657
|
+
errorMessage: a,
|
|
658
658
|
onRetry: r,
|
|
659
659
|
currentUserId: s,
|
|
660
660
|
onOpenGroup: d,
|
|
661
|
-
onCreate:
|
|
662
|
-
onDeleteRequest:
|
|
661
|
+
onCreate: h,
|
|
662
|
+
onDeleteRequest: u
|
|
663
663
|
}) {
|
|
664
|
-
const [
|
|
664
|
+
const [b, v] = N(""), l = V(
|
|
665
665
|
() => t.filter(
|
|
666
|
-
(c) => !
|
|
666
|
+
(c) => !b.trim() || c.name.toLowerCase().includes(b.toLowerCase()) || (c.description || "").toLowerCase().includes(b.toLowerCase())
|
|
667
667
|
),
|
|
668
|
-
[t,
|
|
668
|
+
[t, b]
|
|
669
669
|
);
|
|
670
670
|
return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
671
671
|
/* @__PURE__ */ o("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
|
|
672
672
|
/* @__PURE__ */ o("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
|
|
673
|
-
/* @__PURE__ */ e(
|
|
673
|
+
/* @__PURE__ */ e(Hr, { className: "h-3 w-3 text-muted-foreground" }),
|
|
674
674
|
/* @__PURE__ */ e(
|
|
675
675
|
"input",
|
|
676
676
|
{
|
|
677
|
-
value:
|
|
677
|
+
value: b,
|
|
678
678
|
onChange: (c) => v(c.target.value),
|
|
679
679
|
placeholder: "Search groups…",
|
|
680
680
|
className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none"
|
|
681
681
|
}
|
|
682
682
|
),
|
|
683
|
-
|
|
683
|
+
b && /* @__PURE__ */ e(
|
|
684
684
|
"button",
|
|
685
685
|
{
|
|
686
686
|
type: "button",
|
|
687
687
|
onClick: () => v(""),
|
|
688
688
|
className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
689
|
-
children: /* @__PURE__ */ e(
|
|
689
|
+
children: /* @__PURE__ */ e(Gt, { className: "h-2.5 w-2.5" })
|
|
690
690
|
}
|
|
691
691
|
)
|
|
692
692
|
] }),
|
|
@@ -694,7 +694,7 @@ function us({
|
|
|
694
694
|
"button",
|
|
695
695
|
{
|
|
696
696
|
type: "button",
|
|
697
|
-
onClick:
|
|
697
|
+
onClick: h,
|
|
698
698
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90",
|
|
699
699
|
children: [
|
|
700
700
|
/* @__PURE__ */ e(re, { className: "h-3 w-3" }),
|
|
@@ -703,50 +703,50 @@ function us({
|
|
|
703
703
|
}
|
|
704
704
|
)
|
|
705
705
|
] }),
|
|
706
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children:
|
|
706
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: n ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((c) => /* @__PURE__ */ e(
|
|
707
707
|
"div",
|
|
708
708
|
{
|
|
709
709
|
className: "h-12 animate-pulse rounded-[4px] bg-muted/60"
|
|
710
710
|
},
|
|
711
711
|
c
|
|
712
|
-
)) }) :
|
|
713
|
-
|
|
712
|
+
)) }) : a ? /* @__PURE__ */ e(
|
|
713
|
+
or,
|
|
714
714
|
{
|
|
715
715
|
title: "Can't load groups",
|
|
716
|
-
message:
|
|
716
|
+
message: a,
|
|
717
717
|
onRetry: r
|
|
718
718
|
}
|
|
719
|
-
) :
|
|
719
|
+
) : l.length === 0 && t.length === 0 ? /* @__PURE__ */ e(is, { onCreate: h }) : l.length === 0 ? /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
720
720
|
/* @__PURE__ */ o("div", { className: "text-[12px] text-foreground", children: [
|
|
721
721
|
'No groups match "',
|
|
722
|
-
|
|
722
|
+
b,
|
|
723
723
|
'"'
|
|
724
724
|
] }),
|
|
725
725
|
/* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: "Try a different search." })
|
|
726
|
-
] }) :
|
|
727
|
-
var
|
|
726
|
+
] }) : l.map((c) => {
|
|
727
|
+
var f;
|
|
728
728
|
return /* @__PURE__ */ e(
|
|
729
|
-
|
|
729
|
+
os,
|
|
730
730
|
{
|
|
731
731
|
group: c,
|
|
732
|
-
canDelete: ((
|
|
732
|
+
canDelete: ((f = c.permissions) == null ? void 0 : f.canDelete) ?? c.createdBy === s,
|
|
733
733
|
onClick: () => d(c.id),
|
|
734
|
-
onDelete: () =>
|
|
734
|
+
onDelete: () => u(c)
|
|
735
735
|
},
|
|
736
736
|
c.id
|
|
737
737
|
);
|
|
738
738
|
}) })
|
|
739
739
|
] });
|
|
740
740
|
}
|
|
741
|
-
function
|
|
741
|
+
function os({
|
|
742
742
|
group: t,
|
|
743
|
-
canDelete:
|
|
744
|
-
onClick:
|
|
743
|
+
canDelete: n,
|
|
744
|
+
onClick: a,
|
|
745
745
|
onDelete: r
|
|
746
746
|
}) {
|
|
747
747
|
let s = "";
|
|
748
748
|
try {
|
|
749
|
-
s =
|
|
749
|
+
s = qt(new Date(t.createdAt), "MMM d, yyyy");
|
|
750
750
|
} catch {
|
|
751
751
|
s = "";
|
|
752
752
|
}
|
|
@@ -754,34 +754,34 @@ function ms({
|
|
|
754
754
|
"button",
|
|
755
755
|
{
|
|
756
756
|
type: "button",
|
|
757
|
-
onClick:
|
|
757
|
+
onClick: a,
|
|
758
758
|
className: "group flex w-full items-center gap-3 border-b border-border/60 px-5 py-2.5 text-left hover:bg-accent/40",
|
|
759
759
|
children: [
|
|
760
|
-
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(
|
|
760
|
+
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(Kr, { className: "h-3.5 w-3.5" }) }),
|
|
761
761
|
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
762
762
|
/* @__PURE__ */ e("div", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
|
|
763
763
|
/* @__PURE__ */ o("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
764
764
|
/* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1", children: [
|
|
765
|
-
/* @__PURE__ */ e(
|
|
765
|
+
/* @__PURE__ */ e(Kt, { className: "h-2.5 w-2.5" }),
|
|
766
766
|
t.memberCount,
|
|
767
767
|
" member",
|
|
768
768
|
t.memberCount === 1 ? "" : "s"
|
|
769
769
|
] }),
|
|
770
|
-
s && /* @__PURE__ */ o(
|
|
770
|
+
s && /* @__PURE__ */ o(T, { children: [
|
|
771
771
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
772
772
|
/* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1", children: [
|
|
773
|
-
/* @__PURE__ */ e(
|
|
773
|
+
/* @__PURE__ */ e($t, { className: "h-2.5 w-2.5" }),
|
|
774
774
|
s
|
|
775
775
|
] })
|
|
776
776
|
] }),
|
|
777
|
-
t.description && /* @__PURE__ */ o(
|
|
777
|
+
t.description && /* @__PURE__ */ o(T, { children: [
|
|
778
778
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
779
779
|
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: t.description })
|
|
780
780
|
] })
|
|
781
781
|
] })
|
|
782
782
|
] }),
|
|
783
783
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100", children: [
|
|
784
|
-
|
|
784
|
+
n && /* @__PURE__ */ e(
|
|
785
785
|
"span",
|
|
786
786
|
{
|
|
787
787
|
role: "button",
|
|
@@ -794,18 +794,18 @@ function ms({
|
|
|
794
794
|
},
|
|
795
795
|
"aria-label": `Delete ${t.name}`,
|
|
796
796
|
className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
797
|
-
children: /* @__PURE__ */ e(
|
|
797
|
+
children: /* @__PURE__ */ e(st, { className: "h-3 w-3" })
|
|
798
798
|
}
|
|
799
799
|
),
|
|
800
|
-
/* @__PURE__ */ e(
|
|
800
|
+
/* @__PURE__ */ e(Qr, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
801
801
|
] })
|
|
802
802
|
]
|
|
803
803
|
}
|
|
804
804
|
);
|
|
805
805
|
}
|
|
806
|
-
function
|
|
806
|
+
function is({ onCreate: t }) {
|
|
807
807
|
return /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
|
|
808
|
-
/* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(
|
|
808
|
+
/* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(Ft, { className: "h-4 w-4" }) }),
|
|
809
809
|
/* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
|
|
810
810
|
/* @__PURE__ */ e("div", { className: "max-w-[320px] text-[11.5px] leading-[1.55] text-muted-foreground", children: "Groups let you grant shared access to dashboards. Create one and add members." }),
|
|
811
811
|
/* @__PURE__ */ o(
|
|
@@ -822,82 +822,82 @@ function hs({ onCreate: t }) {
|
|
|
822
822
|
)
|
|
823
823
|
] });
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function ds({
|
|
826
826
|
group: t,
|
|
827
|
-
isTenantViewer:
|
|
828
|
-
canEdit:
|
|
827
|
+
isTenantViewer: n,
|
|
828
|
+
canEdit: a,
|
|
829
829
|
canDelete: r,
|
|
830
830
|
canManageMembers: s,
|
|
831
831
|
onBack: d,
|
|
832
|
-
onMembersChanged:
|
|
833
|
-
onUpdated:
|
|
834
|
-
onRequestDelete:
|
|
832
|
+
onMembersChanged: h,
|
|
833
|
+
onUpdated: u,
|
|
834
|
+
onRequestDelete: b
|
|
835
835
|
}) {
|
|
836
836
|
const {
|
|
837
837
|
data: v,
|
|
838
|
-
isLoading:
|
|
838
|
+
isLoading: l,
|
|
839
839
|
error: c,
|
|
840
|
-
refetch:
|
|
841
|
-
} =
|
|
840
|
+
refetch: f
|
|
841
|
+
} = qr(t.id), m = (v == null ? void 0 : v.members) ?? as, p = c ? sr(c, "Unable to load members for this group.") : null, x = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w } = zr({
|
|
842
842
|
type: x,
|
|
843
843
|
tenantId: t.tenantId || void 0,
|
|
844
844
|
active: !0,
|
|
845
845
|
limit: 200
|
|
846
|
-
}), S =
|
|
847
|
-
() => new Set(
|
|
848
|
-
[
|
|
849
|
-
),
|
|
846
|
+
}), S = V(
|
|
847
|
+
() => new Set(m.map((y) => y.userId)),
|
|
848
|
+
[m]
|
|
849
|
+
), g = ts(), B = rs(), U = Zn(), [M, A] = N(!1), [C, X] = N(t.name), [Ue, j] = N(!1), [ae, H] = N(t.description || ""), [ne, se] = N(""), [Be, oe] = N(!1), Se = V(() => {
|
|
850
850
|
const y = ne.trim().toLowerCase();
|
|
851
|
-
return w.filter((
|
|
852
|
-
(
|
|
851
|
+
return w.filter((F) => !S.has(F.id)).filter(
|
|
852
|
+
(F) => !y || (F.name || "").toLowerCase().includes(y) || (F.email || "").toLowerCase().includes(y)
|
|
853
853
|
).slice(0, 50);
|
|
854
854
|
}, [w, S, ne]), Z = async () => {
|
|
855
|
-
const y =
|
|
856
|
-
if (
|
|
855
|
+
const y = C.trim();
|
|
856
|
+
if (A(!1), y.length >= 3 && y !== t.name)
|
|
857
857
|
try {
|
|
858
|
-
await
|
|
858
|
+
await U.mutateAsync({
|
|
859
859
|
groupId: t.id,
|
|
860
860
|
data: { name: y }
|
|
861
|
-
}),
|
|
861
|
+
}), u();
|
|
862
862
|
} catch {
|
|
863
863
|
}
|
|
864
864
|
}, ie = async () => {
|
|
865
865
|
const y = ae.trim();
|
|
866
|
-
if (
|
|
866
|
+
if (j(!1), y !== (t.description || ""))
|
|
867
867
|
try {
|
|
868
|
-
await
|
|
868
|
+
await U.mutateAsync({
|
|
869
869
|
groupId: t.id,
|
|
870
870
|
data: { description: y }
|
|
871
|
-
}),
|
|
871
|
+
}), u();
|
|
872
872
|
} catch {
|
|
873
873
|
}
|
|
874
|
-
},
|
|
874
|
+
}, De = async (y) => {
|
|
875
875
|
if (s) {
|
|
876
876
|
se(""), oe(!1);
|
|
877
877
|
try {
|
|
878
|
-
await
|
|
878
|
+
await g.mutateAsync({
|
|
879
879
|
groupId: t.id,
|
|
880
880
|
data: {
|
|
881
881
|
userIds: [y.id],
|
|
882
882
|
userType: x === "tenant" ? "tenant" : "org"
|
|
883
883
|
}
|
|
884
|
-
}),
|
|
884
|
+
}), f(), h();
|
|
885
885
|
} catch {
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
|
-
},
|
|
888
|
+
}, ke = async (y) => {
|
|
889
889
|
if (s)
|
|
890
890
|
try {
|
|
891
|
-
await
|
|
891
|
+
await B.mutateAsync({
|
|
892
892
|
groupId: t.id,
|
|
893
893
|
data: { userIds: [y] }
|
|
894
|
-
}),
|
|
894
|
+
}), f(), h();
|
|
895
895
|
} catch {
|
|
896
896
|
}
|
|
897
897
|
};
|
|
898
898
|
let ee = "";
|
|
899
899
|
try {
|
|
900
|
-
ee =
|
|
900
|
+
ee = qt(new Date(t.createdAt), "MMM d, yyyy");
|
|
901
901
|
} catch {
|
|
902
902
|
ee = "";
|
|
903
903
|
}
|
|
@@ -910,18 +910,18 @@ function ps({
|
|
|
910
910
|
onClick: d,
|
|
911
911
|
"aria-label": "Back",
|
|
912
912
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
913
|
-
children: /* @__PURE__ */ e(
|
|
913
|
+
children: /* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" })
|
|
914
914
|
}
|
|
915
915
|
),
|
|
916
|
-
|
|
916
|
+
M ? /* @__PURE__ */ e(
|
|
917
917
|
"input",
|
|
918
918
|
{
|
|
919
919
|
autoFocus: !0,
|
|
920
|
-
value:
|
|
920
|
+
value: C,
|
|
921
921
|
onChange: (y) => X(y.target.value),
|
|
922
922
|
onBlur: Z,
|
|
923
923
|
onKeyDown: (y) => {
|
|
924
|
-
y.key === "Enter" && Z(), y.key === "Escape" && (X(t.name),
|
|
924
|
+
y.key === "Enter" && Z(), y.key === "Escape" && (X(t.name), A(!1));
|
|
925
925
|
},
|
|
926
926
|
className: "h-6 min-w-0 flex-1 rounded-[3px] border border-border bg-background px-1.5 text-[13px] font-medium text-foreground focus:border-foreground/40 focus:outline-none"
|
|
927
927
|
}
|
|
@@ -930,32 +930,32 @@ function ps({
|
|
|
930
930
|
{
|
|
931
931
|
type: "button",
|
|
932
932
|
onClick: () => {
|
|
933
|
-
|
|
933
|
+
a && (X(t.name), A(!0));
|
|
934
934
|
},
|
|
935
|
-
title:
|
|
936
|
-
disabled: !
|
|
935
|
+
title: a ? "Click to rename" : t.name,
|
|
936
|
+
disabled: !a,
|
|
937
937
|
className: "truncate rounded-[3px] px-1 text-[13px] font-medium text-foreground enabled:hover:bg-accent disabled:cursor-default",
|
|
938
938
|
children: t.name
|
|
939
939
|
}
|
|
940
940
|
),
|
|
941
941
|
/* @__PURE__ */ o("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
|
|
942
|
-
/* @__PURE__ */ e(
|
|
943
|
-
|
|
942
|
+
/* @__PURE__ */ e(Kt, { className: "h-2.5 w-2.5" }),
|
|
943
|
+
m.length,
|
|
944
944
|
" member",
|
|
945
|
-
|
|
945
|
+
m.length === 1 ? "" : "s"
|
|
946
946
|
] })
|
|
947
947
|
] }),
|
|
948
|
-
/* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children:
|
|
948
|
+
/* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: Ue ? /* @__PURE__ */ o("div", { children: [
|
|
949
949
|
/* @__PURE__ */ e(
|
|
950
950
|
"textarea",
|
|
951
951
|
{
|
|
952
952
|
autoFocus: !0,
|
|
953
953
|
rows: 2,
|
|
954
954
|
value: ae,
|
|
955
|
-
onChange: (y) =>
|
|
955
|
+
onChange: (y) => H(y.target.value),
|
|
956
956
|
maxLength: 200,
|
|
957
957
|
onKeyDown: (y) => {
|
|
958
|
-
y.key === "Escape" && (
|
|
958
|
+
y.key === "Escape" && (H(t.description || ""), j(!1)), y.key === "Enter" && (y.metaKey || y.ctrlKey) && ie();
|
|
959
959
|
},
|
|
960
960
|
placeholder: "What is this group for?",
|
|
961
961
|
className: "block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
@@ -972,7 +972,7 @@ function ps({
|
|
|
972
972
|
{
|
|
973
973
|
type: "button",
|
|
974
974
|
onClick: () => {
|
|
975
|
-
|
|
975
|
+
H(t.description || ""), j(!1);
|
|
976
976
|
},
|
|
977
977
|
className: "h-6 rounded-[5px] px-2 text-[11px] font-medium text-foreground/80 hover:bg-accent",
|
|
978
978
|
children: "Cancel"
|
|
@@ -994,71 +994,71 @@ function ps({
|
|
|
994
994
|
{
|
|
995
995
|
type: "button",
|
|
996
996
|
onClick: () => {
|
|
997
|
-
|
|
997
|
+
a && (H(t.description || ""), j(!0));
|
|
998
998
|
},
|
|
999
|
-
disabled: !
|
|
1000
|
-
title:
|
|
999
|
+
disabled: !a,
|
|
1000
|
+
title: a ? "Click to edit description" : void 0,
|
|
1001
1001
|
className: "block w-full rounded-[3px] px-1 py-0.5 text-left enabled:hover:bg-accent/40 disabled:cursor-default",
|
|
1002
1002
|
children: [
|
|
1003
|
-
t.description ? /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: t.description }) : /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children:
|
|
1003
|
+
t.description ? /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: t.description }) : /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: a ? "Add a description…" : "No description" }),
|
|
1004
1004
|
/* @__PURE__ */ o("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
|
|
1005
1005
|
ee ? `Created ${ee}` : "Recently created",
|
|
1006
|
-
|
|
1006
|
+
a ? " · You can edit this group" : ""
|
|
1007
1007
|
] })
|
|
1008
1008
|
]
|
|
1009
1009
|
}
|
|
1010
1010
|
) }),
|
|
1011
1011
|
s && /* @__PURE__ */ e(
|
|
1012
|
-
|
|
1012
|
+
ls,
|
|
1013
1013
|
{
|
|
1014
1014
|
query: ne,
|
|
1015
1015
|
setQuery: se,
|
|
1016
1016
|
open: Be,
|
|
1017
1017
|
setOpen: oe,
|
|
1018
1018
|
candidates: Se,
|
|
1019
|
-
showKindChip: !
|
|
1020
|
-
onAdd:
|
|
1021
|
-
busy:
|
|
1019
|
+
showKindChip: !n,
|
|
1020
|
+
onAdd: De,
|
|
1021
|
+
busy: g.isPending
|
|
1022
1022
|
}
|
|
1023
1023
|
),
|
|
1024
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children:
|
|
1024
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: l ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((y) => /* @__PURE__ */ e(
|
|
1025
1025
|
"div",
|
|
1026
1026
|
{
|
|
1027
1027
|
className: "h-10 animate-pulse rounded-[4px] bg-muted/60"
|
|
1028
1028
|
},
|
|
1029
1029
|
y
|
|
1030
1030
|
)) }) : p ? /* @__PURE__ */ e(
|
|
1031
|
-
|
|
1031
|
+
or,
|
|
1032
1032
|
{
|
|
1033
1033
|
title: "Can't load members",
|
|
1034
1034
|
message: p,
|
|
1035
|
-
onRetry: () =>
|
|
1035
|
+
onRetry: () => f()
|
|
1036
1036
|
}
|
|
1037
|
-
) :
|
|
1037
|
+
) : m.length === 0 ? /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
1038
1038
|
/* @__PURE__ */ e("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
|
|
1039
1039
|
/* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: s ? "Search above to add people to this group." : "This group does not have any members." })
|
|
1040
|
-
] }) :
|
|
1041
|
-
var
|
|
1040
|
+
] }) : m.map((y) => {
|
|
1041
|
+
var F, q, z, K, de, Q;
|
|
1042
1042
|
return /* @__PURE__ */ o(
|
|
1043
1043
|
"div",
|
|
1044
1044
|
{
|
|
1045
1045
|
className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
|
|
1046
1046
|
children: [
|
|
1047
|
-
/* @__PURE__ */ e(
|
|
1047
|
+
/* @__PURE__ */ e(ir, { name: ((F = y.user) == null ? void 0 : F.name) || ((q = y.user) == null ? void 0 : q.email) || "?" }),
|
|
1048
1048
|
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
1049
1049
|
/* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((z = y.user) == null ? void 0 : z.name) || ((K = y.user) == null ? void 0 : K.email) || "Unknown" }),
|
|
1050
1050
|
((de = y.user) == null ? void 0 : de.email) && y.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: y.user.email })
|
|
1051
1051
|
] }),
|
|
1052
|
-
!
|
|
1052
|
+
!n && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: y.userType }),
|
|
1053
1053
|
/* @__PURE__ */ e(
|
|
1054
1054
|
"button",
|
|
1055
1055
|
{
|
|
1056
1056
|
type: "button",
|
|
1057
|
-
onClick: () =>
|
|
1058
|
-
disabled: !s ||
|
|
1057
|
+
onClick: () => ke(y.userId),
|
|
1058
|
+
disabled: !s || B.isPending,
|
|
1059
1059
|
"aria-label": `Remove ${((Q = y.user) == null ? void 0 : Q.name) || "member"}`,
|
|
1060
1060
|
className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100 disabled:opacity-30",
|
|
1061
|
-
children: /* @__PURE__ */ e(
|
|
1061
|
+
children: /* @__PURE__ */ e(Gt, { className: "h-3 w-3" })
|
|
1062
1062
|
}
|
|
1063
1063
|
)
|
|
1064
1064
|
]
|
|
@@ -1070,47 +1070,47 @@ function ps({
|
|
|
1070
1070
|
"button",
|
|
1071
1071
|
{
|
|
1072
1072
|
type: "button",
|
|
1073
|
-
onClick:
|
|
1073
|
+
onClick: b,
|
|
1074
1074
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] border border-rose-200 bg-background px-2.5 text-[12px] font-medium text-rose-600 hover:bg-rose-50 dark:border-rose-900/60 dark:text-rose-400 dark:hover:bg-rose-950/30",
|
|
1075
1075
|
children: [
|
|
1076
|
-
/* @__PURE__ */ e(
|
|
1076
|
+
/* @__PURE__ */ e(st, { className: "h-3 w-3" }),
|
|
1077
1077
|
"Delete group"
|
|
1078
1078
|
]
|
|
1079
1079
|
}
|
|
1080
1080
|
) })
|
|
1081
1081
|
] });
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function cs({
|
|
1084
1084
|
isTenantUser: t,
|
|
1085
|
-
tenantId:
|
|
1086
|
-
onCancel:
|
|
1085
|
+
tenantId: n,
|
|
1086
|
+
onCancel: a,
|
|
1087
1087
|
onCreated: r
|
|
1088
1088
|
}) {
|
|
1089
|
-
const [s, d] = N(""), [
|
|
1089
|
+
const [s, d] = N(""), [h, u] = N(""), [b, v] = N(null), l = Xn(), c = s.trim().length >= 3 && s.trim().length <= 50, f = async () => {
|
|
1090
1090
|
if (!c) return;
|
|
1091
1091
|
v(null);
|
|
1092
|
-
const
|
|
1092
|
+
const m = {
|
|
1093
1093
|
name: s.trim(),
|
|
1094
|
-
description:
|
|
1094
|
+
description: h.trim() || void 0,
|
|
1095
1095
|
type: t ? "TENANT_GROUP" : "ORG_GROUP",
|
|
1096
|
-
...t &&
|
|
1096
|
+
...t && n ? { tenantId: n } : {}
|
|
1097
1097
|
};
|
|
1098
1098
|
try {
|
|
1099
|
-
const p = await
|
|
1100
|
-
x ? r(x) :
|
|
1099
|
+
const p = await l.mutateAsync(m), x = p == null ? void 0 : p.id;
|
|
1100
|
+
x ? r(x) : a();
|
|
1101
1101
|
} catch (p) {
|
|
1102
1102
|
v(p instanceof Error ? p.message : "Failed to create group");
|
|
1103
1103
|
}
|
|
1104
1104
|
};
|
|
1105
1105
|
return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
1106
1106
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
|
|
1107
|
-
/* @__PURE__ */ e(
|
|
1107
|
+
/* @__PURE__ */ e(_t, { children: "Name" }),
|
|
1108
1108
|
/* @__PURE__ */ e(
|
|
1109
1109
|
"input",
|
|
1110
1110
|
{
|
|
1111
1111
|
autoFocus: !0,
|
|
1112
1112
|
value: s,
|
|
1113
|
-
onChange: (
|
|
1113
|
+
onChange: (m) => d(m.target.value),
|
|
1114
1114
|
placeholder: "Marketing leads, North America sales, …",
|
|
1115
1115
|
maxLength: 50,
|
|
1116
1116
|
className: "mt-1 block h-7 w-full rounded-[5px] border border-border bg-background px-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
@@ -1118,32 +1118,32 @@ function fs({
|
|
|
1118
1118
|
),
|
|
1119
1119
|
/* @__PURE__ */ e("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
|
|
1120
1120
|
/* @__PURE__ */ o("div", { className: "mt-4", children: [
|
|
1121
|
-
/* @__PURE__ */ e(
|
|
1121
|
+
/* @__PURE__ */ e(_t, { children: "Description (optional)" }),
|
|
1122
1122
|
/* @__PURE__ */ e(
|
|
1123
1123
|
"textarea",
|
|
1124
1124
|
{
|
|
1125
1125
|
rows: 2,
|
|
1126
|
-
value:
|
|
1127
|
-
onChange: (
|
|
1126
|
+
value: h,
|
|
1127
|
+
onChange: (m) => u(m.target.value),
|
|
1128
1128
|
maxLength: 200,
|
|
1129
1129
|
placeholder: "What is this group for?",
|
|
1130
1130
|
className: "mt-1 block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
1131
1131
|
}
|
|
1132
1132
|
),
|
|
1133
1133
|
/* @__PURE__ */ o("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
|
|
1134
|
-
|
|
1134
|
+
h.length,
|
|
1135
1135
|
"/200"
|
|
1136
1136
|
] })
|
|
1137
1137
|
] }),
|
|
1138
|
-
|
|
1138
|
+
b && /* @__PURE__ */ e("div", { className: "mt-3 rounded-[5px] border border-rose-200 bg-rose-50 px-2 py-1.5 text-[11.5px] text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300", children: b })
|
|
1139
1139
|
] }),
|
|
1140
1140
|
/* @__PURE__ */ o("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: [
|
|
1141
1141
|
/* @__PURE__ */ e(
|
|
1142
1142
|
"button",
|
|
1143
1143
|
{
|
|
1144
1144
|
type: "button",
|
|
1145
|
-
onClick:
|
|
1146
|
-
disabled:
|
|
1145
|
+
onClick: a,
|
|
1146
|
+
disabled: l.isPending,
|
|
1147
1147
|
className: "h-7 rounded-[5px] px-2.5 text-[12px] font-medium text-foreground/80 hover:bg-accent",
|
|
1148
1148
|
children: "Cancel"
|
|
1149
1149
|
}
|
|
@@ -1152,13 +1152,13 @@ function fs({
|
|
|
1152
1152
|
"button",
|
|
1153
1153
|
{
|
|
1154
1154
|
type: "button",
|
|
1155
|
-
onClick:
|
|
1156
|
-
disabled: !c ||
|
|
1155
|
+
onClick: f,
|
|
1156
|
+
disabled: !c || l.isPending,
|
|
1157
1157
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
|
|
1158
|
-
children:
|
|
1159
|
-
/* @__PURE__ */ e(
|
|
1158
|
+
children: l.isPending ? /* @__PURE__ */ o(T, { children: [
|
|
1159
|
+
/* @__PURE__ */ e(Te, { className: "h-3 w-3 animate-spin" }),
|
|
1160
1160
|
"Creating…"
|
|
1161
|
-
] }) : /* @__PURE__ */ o(
|
|
1161
|
+
] }) : /* @__PURE__ */ o(T, { children: [
|
|
1162
1162
|
/* @__PURE__ */ e(re, { className: "h-3 w-3" }),
|
|
1163
1163
|
"Create group"
|
|
1164
1164
|
] })
|
|
@@ -1167,99 +1167,99 @@ function fs({
|
|
|
1167
1167
|
] })
|
|
1168
1168
|
] });
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function ls({
|
|
1171
1171
|
query: t,
|
|
1172
|
-
setQuery:
|
|
1173
|
-
open:
|
|
1172
|
+
setQuery: n,
|
|
1173
|
+
open: a,
|
|
1174
1174
|
setOpen: r,
|
|
1175
1175
|
candidates: s,
|
|
1176
1176
|
showKindChip: d,
|
|
1177
|
-
onAdd:
|
|
1178
|
-
busy:
|
|
1177
|
+
onAdd: h,
|
|
1178
|
+
busy: u
|
|
1179
1179
|
}) {
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1182
|
-
if (!
|
|
1180
|
+
const b = Mt(null), v = Mt(null), [l, c] = N(null);
|
|
1181
|
+
Ja(() => {
|
|
1182
|
+
if (!a) {
|
|
1183
1183
|
c(null);
|
|
1184
1184
|
return;
|
|
1185
1185
|
}
|
|
1186
|
-
const
|
|
1187
|
-
const p =
|
|
1186
|
+
const m = () => {
|
|
1187
|
+
const p = b.current;
|
|
1188
1188
|
if (!p) return;
|
|
1189
|
-
const x = p.getBoundingClientRect(), w = 240,
|
|
1189
|
+
const x = p.getBoundingClientRect(), w = 240, g = window.innerHeight - x.bottom < w + 16 && x.top > w;
|
|
1190
1190
|
c({
|
|
1191
1191
|
left: x.left,
|
|
1192
|
-
top:
|
|
1192
|
+
top: g ? x.top - 6 : x.bottom + 6,
|
|
1193
1193
|
width: x.width,
|
|
1194
|
-
above:
|
|
1194
|
+
above: g
|
|
1195
1195
|
});
|
|
1196
1196
|
};
|
|
1197
|
-
return
|
|
1198
|
-
window.removeEventListener("resize",
|
|
1197
|
+
return m(), window.addEventListener("resize", m), window.addEventListener("scroll", m, !0), () => {
|
|
1198
|
+
window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0);
|
|
1199
1199
|
};
|
|
1200
|
-
}, [
|
|
1201
|
-
if (!
|
|
1202
|
-
const
|
|
1200
|
+
}, [a, s.length]), be(() => {
|
|
1201
|
+
if (!a) return;
|
|
1202
|
+
const m = (p) => {
|
|
1203
1203
|
var w, S;
|
|
1204
1204
|
const x = p.target;
|
|
1205
|
-
(w =
|
|
1205
|
+
(w = b.current) != null && w.contains(x) || (S = v.current) != null && S.contains(x) || r(!1);
|
|
1206
1206
|
};
|
|
1207
|
-
return document.addEventListener("mousedown",
|
|
1208
|
-
}, [
|
|
1209
|
-
const
|
|
1207
|
+
return document.addEventListener("mousedown", m), () => document.removeEventListener("mousedown", m);
|
|
1208
|
+
}, [a, r]);
|
|
1209
|
+
const f = a && s.length > 0 && l;
|
|
1210
1210
|
return /* @__PURE__ */ o("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
|
|
1211
1211
|
/* @__PURE__ */ o(
|
|
1212
1212
|
"div",
|
|
1213
1213
|
{
|
|
1214
|
-
ref:
|
|
1214
|
+
ref: b,
|
|
1215
1215
|
className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40",
|
|
1216
1216
|
children: [
|
|
1217
|
-
/* @__PURE__ */ e(
|
|
1217
|
+
/* @__PURE__ */ e(On, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1218
1218
|
/* @__PURE__ */ e(
|
|
1219
1219
|
"input",
|
|
1220
1220
|
{
|
|
1221
1221
|
value: t,
|
|
1222
|
-
onChange: (
|
|
1223
|
-
|
|
1222
|
+
onChange: (m) => {
|
|
1223
|
+
n(m.target.value), r(!0);
|
|
1224
1224
|
},
|
|
1225
1225
|
onFocus: () => r(!0),
|
|
1226
1226
|
placeholder: "Add a member by name or email…",
|
|
1227
|
-
disabled:
|
|
1227
|
+
disabled: u,
|
|
1228
1228
|
className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed"
|
|
1229
1229
|
}
|
|
1230
1230
|
)
|
|
1231
1231
|
]
|
|
1232
1232
|
}
|
|
1233
1233
|
),
|
|
1234
|
-
|
|
1234
|
+
f && typeof document < "u" && vn(
|
|
1235
1235
|
/* @__PURE__ */ e(
|
|
1236
1236
|
"div",
|
|
1237
1237
|
{
|
|
1238
1238
|
ref: v,
|
|
1239
1239
|
style: {
|
|
1240
1240
|
position: "fixed",
|
|
1241
|
-
left:
|
|
1242
|
-
top:
|
|
1243
|
-
width:
|
|
1244
|
-
transform:
|
|
1241
|
+
left: l.left,
|
|
1242
|
+
top: l.top,
|
|
1243
|
+
width: l.width,
|
|
1244
|
+
transform: l.above ? "translateY(-100%)" : void 0
|
|
1245
1245
|
},
|
|
1246
1246
|
className: "z-[60] max-h-[240px] overflow-y-auto rounded-[5px] border border-border bg-background shadow-[0_8px_24px_-12px_rgba(0,0,0,0.18)]",
|
|
1247
|
-
children: s.map((
|
|
1247
|
+
children: s.map((m) => /* @__PURE__ */ o(
|
|
1248
1248
|
"button",
|
|
1249
1249
|
{
|
|
1250
1250
|
type: "button",
|
|
1251
|
-
onClick: () =>
|
|
1251
|
+
onClick: () => h(m),
|
|
1252
1252
|
className: "flex w-full items-center gap-2 border-b border-border/60 px-2.5 py-2 text-left last:border-b-0 hover:bg-accent",
|
|
1253
1253
|
children: [
|
|
1254
|
-
/* @__PURE__ */ e(
|
|
1254
|
+
/* @__PURE__ */ e(ir, { name: m.name || m.email || "?" }),
|
|
1255
1255
|
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
1256
|
-
/* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children:
|
|
1257
|
-
|
|
1256
|
+
/* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children: m.name || m.email || "Unknown" }),
|
|
1257
|
+
m.email && m.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: m.email })
|
|
1258
1258
|
] }),
|
|
1259
|
-
d &&
|
|
1259
|
+
d && m.type && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: m.type === "tenant" ? "tenant" : "org" })
|
|
1260
1260
|
]
|
|
1261
1261
|
},
|
|
1262
|
-
|
|
1262
|
+
m.id
|
|
1263
1263
|
))
|
|
1264
1264
|
}
|
|
1265
1265
|
),
|
|
@@ -1267,153 +1267,153 @@ function bs({
|
|
|
1267
1267
|
)
|
|
1268
1268
|
] });
|
|
1269
1269
|
}
|
|
1270
|
-
function
|
|
1271
|
-
if (!t) return
|
|
1270
|
+
function sr(t, n) {
|
|
1271
|
+
if (!t) return n;
|
|
1272
1272
|
if (t instanceof Error) {
|
|
1273
|
-
const
|
|
1274
|
-
return r ? r[1] :
|
|
1273
|
+
const a = t.message || "", r = a.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
|
|
1274
|
+
return r ? r[1] : a || n;
|
|
1275
1275
|
}
|
|
1276
|
-
return typeof t == "string" ? t :
|
|
1276
|
+
return typeof t == "string" ? t : n;
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1278
|
+
function or({
|
|
1279
1279
|
title: t,
|
|
1280
|
-
message:
|
|
1281
|
-
onRetry:
|
|
1280
|
+
message: n,
|
|
1281
|
+
onRetry: a
|
|
1282
1282
|
}) {
|
|
1283
1283
|
return /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-2 px-6 py-10 text-center", children: [
|
|
1284
1284
|
/* @__PURE__ */ e("div", { className: "text-[12.5px] font-medium text-foreground", children: t }),
|
|
1285
|
-
/* @__PURE__ */ e("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children:
|
|
1286
|
-
|
|
1285
|
+
/* @__PURE__ */ e("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children: n }),
|
|
1286
|
+
a && /* @__PURE__ */ e(
|
|
1287
1287
|
"button",
|
|
1288
1288
|
{
|
|
1289
1289
|
type: "button",
|
|
1290
|
-
onClick:
|
|
1290
|
+
onClick: a,
|
|
1291
1291
|
className: "mt-1 inline-flex h-7 items-center rounded-[5px] border border-border bg-background px-2.5 text-[11.5px] font-medium text-foreground hover:bg-accent",
|
|
1292
1292
|
children: "Try again"
|
|
1293
1293
|
}
|
|
1294
1294
|
)
|
|
1295
1295
|
] });
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function _t({ children: t }) {
|
|
1298
1298
|
return /* @__PURE__ */ e("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: t });
|
|
1299
1299
|
}
|
|
1300
|
-
function
|
|
1301
|
-
const
|
|
1302
|
-
return /* @__PURE__ */ e(
|
|
1300
|
+
function ir({ name: t }) {
|
|
1301
|
+
const n = t.split(" ").map((a) => a[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
1302
|
+
return /* @__PURE__ */ e(ar, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(nr, { className: "text-[9px] font-semibold", children: n || "?" }) });
|
|
1303
1303
|
}
|
|
1304
|
-
const
|
|
1305
|
-
function
|
|
1304
|
+
const us = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
1305
|
+
function ms({
|
|
1306
1306
|
open: t,
|
|
1307
|
-
onOpenChange:
|
|
1307
|
+
onOpenChange: n
|
|
1308
1308
|
}) {
|
|
1309
|
-
const
|
|
1309
|
+
const a = D(
|
|
1310
1310
|
(s) => {
|
|
1311
|
-
var d,
|
|
1312
|
-
return
|
|
1313
|
-
dashboardDefault: (
|
|
1311
|
+
var d, h;
|
|
1312
|
+
return wn({
|
|
1313
|
+
dashboardDefault: (h = (d = s.dashboard) == null ? void 0 : d.exportDefaults) == null ? void 0 : h.csvEncoding
|
|
1314
1314
|
});
|
|
1315
1315
|
}
|
|
1316
|
-
), { setDashboardExportDefaults: r } =
|
|
1316
|
+
), { setDashboardExportDefaults: r } = D(
|
|
1317
1317
|
(s) => s.actions
|
|
1318
1318
|
);
|
|
1319
|
-
return /* @__PURE__ */ e(
|
|
1320
|
-
/* @__PURE__ */ o(
|
|
1321
|
-
/* @__PURE__ */ e(
|
|
1322
|
-
/* @__PURE__ */ e(
|
|
1319
|
+
return /* @__PURE__ */ e(Tt, { open: t, onOpenChange: n, children: /* @__PURE__ */ o(Ut, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
|
|
1320
|
+
/* @__PURE__ */ o(Wr, { children: [
|
|
1321
|
+
/* @__PURE__ */ e(Ze, { className: "text-[15px]", children: "Download settings" }),
|
|
1322
|
+
/* @__PURE__ */ e(et, { className: "text-[13px] leading-5", children: "Applies to every CSV downloaded or delivered from this dashboard. People can still change it for a single download." })
|
|
1323
1323
|
] }),
|
|
1324
1324
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
1325
|
-
/* @__PURE__ */ e(
|
|
1325
|
+
/* @__PURE__ */ e(Ta, { htmlFor: "dashboard-csv-encoding", className: us, children: "CSV encoding" }),
|
|
1326
1326
|
/* @__PURE__ */ o(
|
|
1327
|
-
|
|
1327
|
+
Ua,
|
|
1328
1328
|
{
|
|
1329
|
-
value:
|
|
1329
|
+
value: a,
|
|
1330
1330
|
onValueChange: (s) => r({ csvEncoding: s }),
|
|
1331
1331
|
children: [
|
|
1332
|
-
/* @__PURE__ */ e(
|
|
1333
|
-
/* @__PURE__ */ e(
|
|
1332
|
+
/* @__PURE__ */ e(Ba, { id: "dashboard-csv-encoding", size: "sm", children: /* @__PURE__ */ e(Fa, {}) }),
|
|
1333
|
+
/* @__PURE__ */ e($a, { children: Yr.map((s) => /* @__PURE__ */ e(Ga, { value: s.value, children: s.label }, s.value)) })
|
|
1334
1334
|
]
|
|
1335
1335
|
}
|
|
1336
1336
|
)
|
|
1337
1337
|
] })
|
|
1338
1338
|
] }) });
|
|
1339
1339
|
}
|
|
1340
|
-
function pe(t,
|
|
1341
|
-
var d,
|
|
1340
|
+
function pe(t, n, a) {
|
|
1341
|
+
var d, h;
|
|
1342
1342
|
const r = (t.controls || []).find(
|
|
1343
|
-
(
|
|
1343
|
+
(u) => u.id === a
|
|
1344
1344
|
);
|
|
1345
1345
|
if (r)
|
|
1346
1346
|
return r.label;
|
|
1347
|
-
const s = (
|
|
1348
|
-
(
|
|
1347
|
+
const s = (h = (d = zt(t, n)) == null ? void 0 : d.controls) == null ? void 0 : h.find(
|
|
1348
|
+
(u) => u.id === a
|
|
1349
1349
|
);
|
|
1350
|
-
return (s == null ? void 0 : s.label) ||
|
|
1350
|
+
return (s == null ? void 0 : s.label) || a;
|
|
1351
1351
|
}
|
|
1352
|
-
function fe(t,
|
|
1353
|
-
var
|
|
1354
|
-
return ((
|
|
1352
|
+
function fe(t, n) {
|
|
1353
|
+
var a;
|
|
1354
|
+
return ((a = zt(t, n)) == null ? void 0 : a.title) || n;
|
|
1355
1355
|
}
|
|
1356
|
-
function
|
|
1357
|
-
const { errors:
|
|
1358
|
-
if (!
|
|
1359
|
-
return
|
|
1356
|
+
function hs(t) {
|
|
1357
|
+
const { errors: n, dashboard: a } = t;
|
|
1358
|
+
if (!a)
|
|
1359
|
+
return n;
|
|
1360
1360
|
const r = /* @__PURE__ */ new Map();
|
|
1361
|
-
for (const s of
|
|
1361
|
+
for (const s of n) {
|
|
1362
1362
|
const d = s.match(
|
|
1363
1363
|
/^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
|
|
1364
1364
|
);
|
|
1365
1365
|
if (d) {
|
|
1366
|
-
const [,
|
|
1367
|
-
r.has(
|
|
1368
|
-
|
|
1369
|
-
`"${fe(
|
|
1370
|
-
|
|
1371
|
-
|
|
1366
|
+
const [, l, c] = d, f = `${l}:${c}:missing-metric`;
|
|
1367
|
+
r.has(f) || r.set(
|
|
1368
|
+
f,
|
|
1369
|
+
`"${fe(a, l)}" has an outdated "${pe(
|
|
1370
|
+
a,
|
|
1371
|
+
l,
|
|
1372
1372
|
c
|
|
1373
1373
|
)}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1374
1374
|
);
|
|
1375
1375
|
continue;
|
|
1376
1376
|
}
|
|
1377
|
-
const
|
|
1377
|
+
const h = s.match(
|
|
1378
1378
|
/^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
|
|
1379
1379
|
);
|
|
1380
|
-
if (
|
|
1381
|
-
const [,
|
|
1382
|
-
r.has(
|
|
1383
|
-
|
|
1384
|
-
`"${fe(
|
|
1385
|
-
|
|
1386
|
-
|
|
1380
|
+
if (h) {
|
|
1381
|
+
const [, l, c] = h, f = `${l}:${c}:missing-group-by`;
|
|
1382
|
+
r.has(f) || r.set(
|
|
1383
|
+
f,
|
|
1384
|
+
`"${fe(a, l)}" has an outdated "${pe(
|
|
1385
|
+
a,
|
|
1386
|
+
l,
|
|
1387
1387
|
c
|
|
1388
1388
|
)}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1389
1389
|
);
|
|
1390
1390
|
continue;
|
|
1391
1391
|
}
|
|
1392
|
-
const
|
|
1392
|
+
const u = s.match(
|
|
1393
1393
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
|
|
1394
1394
|
);
|
|
1395
|
-
if (
|
|
1396
|
-
const [,
|
|
1397
|
-
r.has(
|
|
1398
|
-
|
|
1399
|
-
`"${fe(
|
|
1400
|
-
|
|
1401
|
-
|
|
1395
|
+
if (u) {
|
|
1396
|
+
const [, l, c] = u, f = `${l}:${c}:invalid-metric`;
|
|
1397
|
+
r.has(f) || r.set(
|
|
1398
|
+
f,
|
|
1399
|
+
`"${fe(a, l)}" has an invalid "${pe(
|
|
1400
|
+
a,
|
|
1401
|
+
l,
|
|
1402
1402
|
c
|
|
1403
1403
|
)}" metric mapping. Open the card controls and choose a valid metric for each option.`
|
|
1404
1404
|
);
|
|
1405
1405
|
continue;
|
|
1406
1406
|
}
|
|
1407
|
-
const
|
|
1407
|
+
const b = s.match(
|
|
1408
1408
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
|
|
1409
1409
|
);
|
|
1410
|
-
if (
|
|
1411
|
-
const [,
|
|
1412
|
-
r.has(
|
|
1413
|
-
|
|
1414
|
-
`"${fe(
|
|
1415
|
-
|
|
1416
|
-
|
|
1410
|
+
if (b) {
|
|
1411
|
+
const [, l, c] = b, f = `${l}:${c}:invalid-group-by`;
|
|
1412
|
+
r.has(f) || r.set(
|
|
1413
|
+
f,
|
|
1414
|
+
`"${fe(a, l)}" has an invalid "${pe(
|
|
1415
|
+
a,
|
|
1416
|
+
l,
|
|
1417
1417
|
c
|
|
1418
1418
|
)}" field mapping. Open the card controls and choose a valid field for each option.`
|
|
1419
1419
|
);
|
|
@@ -1423,12 +1423,12 @@ function vs(t) {
|
|
|
1423
1423
|
/^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
|
|
1424
1424
|
);
|
|
1425
1425
|
if (v) {
|
|
1426
|
-
const [,
|
|
1427
|
-
r.has(
|
|
1428
|
-
|
|
1429
|
-
`"${fe(
|
|
1430
|
-
|
|
1431
|
-
|
|
1426
|
+
const [, l, c] = v, f = `${l}:${c}:missing-temporal-group-by`;
|
|
1427
|
+
r.has(f) || r.set(
|
|
1428
|
+
f,
|
|
1429
|
+
`"${fe(a, l)}" can no longer use "${pe(
|
|
1430
|
+
a,
|
|
1431
|
+
l,
|
|
1432
1432
|
c
|
|
1433
1433
|
)}" for time grain because the card does not currently group by a date field.`
|
|
1434
1434
|
);
|
|
@@ -1438,132 +1438,68 @@ function vs(t) {
|
|
|
1438
1438
|
}
|
|
1439
1439
|
return Array.from(r.values());
|
|
1440
1440
|
}
|
|
1441
|
-
function
|
|
1441
|
+
function ps({
|
|
1442
1442
|
visible: t,
|
|
1443
|
-
onSelect:
|
|
1443
|
+
onSelect: n
|
|
1444
1444
|
}) {
|
|
1445
|
-
return t ? /* @__PURE__ */ o(
|
|
1446
|
-
/* @__PURE__ */ e(
|
|
1445
|
+
return t ? /* @__PURE__ */ o(O, { onSelect: n, children: [
|
|
1446
|
+
/* @__PURE__ */ e(Jr, { className: "h-3.5 w-3.5" }),
|
|
1447
1447
|
"Schedule email report"
|
|
1448
1448
|
] }) : null;
|
|
1449
1449
|
}
|
|
1450
|
-
function
|
|
1450
|
+
function fs({
|
|
1451
1451
|
scheduleReportVisible: t,
|
|
1452
|
-
analyticalBriefingVisible:
|
|
1453
|
-
onScheduleReport:
|
|
1452
|
+
analyticalBriefingVisible: n,
|
|
1453
|
+
onScheduleReport: a,
|
|
1454
1454
|
onCreateAnalyticalBriefing: r
|
|
1455
1455
|
}) {
|
|
1456
|
-
return /* @__PURE__ */ o(
|
|
1456
|
+
return /* @__PURE__ */ o(T, { children: [
|
|
1457
1457
|
/* @__PURE__ */ e(
|
|
1458
|
-
|
|
1458
|
+
ps,
|
|
1459
1459
|
{
|
|
1460
1460
|
visible: t,
|
|
1461
|
-
onSelect:
|
|
1461
|
+
onSelect: a
|
|
1462
1462
|
}
|
|
1463
1463
|
),
|
|
1464
|
-
|
|
1464
|
+
n ? /* @__PURE__ */ o(O, { onSelect: r, children: [
|
|
1465
1465
|
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
|
|
1466
1466
|
"Create analytical briefing"
|
|
1467
1467
|
] }) : null
|
|
1468
1468
|
] });
|
|
1469
1469
|
}
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
!l || !_t(a, u) || _t(n, u) || s.push({
|
|
1475
|
-
target: "input",
|
|
1476
|
-
id: u,
|
|
1477
|
-
label: On(a, d, u),
|
|
1478
|
-
bookmarks: l,
|
|
1479
|
-
remembered: 0
|
|
1480
|
-
});
|
|
1481
|
-
const f = new Set((n.sheets ?? []).map((u) => u.id));
|
|
1482
|
-
for (const u of a.sheets ?? []) {
|
|
1483
|
-
const l = r.sheets[u.id] ?? 0;
|
|
1484
|
-
!l || f.has(u.id) || s.push({
|
|
1485
|
-
target: "sheet",
|
|
1486
|
-
id: u.id,
|
|
1487
|
-
label: ((v = u.title) == null ? void 0 : v.trim()) || "Untitled sheet",
|
|
1488
|
-
bookmarks: l,
|
|
1489
|
-
remembered: 0
|
|
1490
|
-
});
|
|
1491
|
-
}
|
|
1492
|
-
const h = Pt(a), g = Pt(n);
|
|
1493
|
-
for (const [u, l] of Object.entries(r.tables)) {
|
|
1494
|
-
if (!h.has(u)) continue;
|
|
1495
|
-
const p = Ue(a, u), x = ((m = p == null ? void 0 : p.title) == null ? void 0 : m.trim()) || "Untitled table";
|
|
1496
|
-
if (!g.has(u)) {
|
|
1497
|
-
s.push({
|
|
1498
|
-
target: "table",
|
|
1499
|
-
id: u,
|
|
1500
|
-
label: x,
|
|
1501
|
-
bookmarks: l.bookmarks,
|
|
1502
|
-
remembered: l.remembered
|
|
1503
|
-
});
|
|
1504
|
-
continue;
|
|
1505
|
-
}
|
|
1506
|
-
const w = p ? Mt(p) : void 0, S = Ue(n, u), b = S ? Mt(S) : void 0;
|
|
1507
|
-
if (!(!p || !w || !b))
|
|
1508
|
-
for (const [O, M] of Object.entries(l.columns)) {
|
|
1509
|
-
if (!(M.bookmarks || M.remembered) || Cn(O) || !w.has(O) || b.has(O))
|
|
1510
|
-
continue;
|
|
1511
|
-
const k = Dn(p, O), E = ((c = k == null ? void 0 : k.label) == null ? void 0 : c.trim()) || (k == null ? void 0 : k.name);
|
|
1512
|
-
s.push({
|
|
1513
|
-
target: "column",
|
|
1514
|
-
id: O,
|
|
1515
|
-
cardId: u,
|
|
1516
|
-
label: E ? `${E} in ${x}` : `A column in ${x}`,
|
|
1517
|
-
bookmarks: M.bookmarks,
|
|
1518
|
-
remembered: M.remembered
|
|
1519
|
-
});
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
return s;
|
|
1523
|
-
}
|
|
1524
|
-
const Ss = "dashboard-bookmark-usage";
|
|
1525
|
-
function ks(t) {
|
|
1526
|
-
var g;
|
|
1527
|
-
const a = C((v) => v.viewerStateClient), n = (g = t.saved) == null ? void 0 : g.id, s = ra({
|
|
1470
|
+
const gs = "dashboard-bookmark-usage";
|
|
1471
|
+
function bs(t) {
|
|
1472
|
+
var b;
|
|
1473
|
+
const n = D((v) => v.viewerStateClient), a = (b = t.saved) == null ? void 0 : b.id, s = Xr({
|
|
1528
1474
|
// Keyed by the viewer, never by the client object (TanStack drops functions when hashing).
|
|
1529
|
-
queryKey: [
|
|
1530
|
-
queryFn: () =>
|
|
1531
|
-
enabled: t.enabled && !!
|
|
1475
|
+
queryKey: [gs, (n == null ? void 0 : n.viewerKey) ?? null],
|
|
1476
|
+
queryFn: () => n.bookmarks.usage(),
|
|
1477
|
+
enabled: t.enabled && !!n && !!a,
|
|
1532
1478
|
staleTime: 5 * 6e4,
|
|
1533
1479
|
retry: !1
|
|
1534
|
-
}).data, { saved: d, draft:
|
|
1535
|
-
return
|
|
1536
|
-
}
|
|
1537
|
-
function Bt(t, a, n) {
|
|
1538
|
-
return `${t} ${t === 1 ? a : n}`;
|
|
1480
|
+
}).data, { saved: d, draft: h, enabled: u } = t;
|
|
1481
|
+
return V(() => !u || !d || !s ? [] : !s.bookmarks && !Object.keys(s.tables).length ? [] : Dn({ saved: d, draft: h, usage: s }), [h, u, d, s]);
|
|
1539
1482
|
}
|
|
1540
|
-
function
|
|
1541
|
-
const a = [
|
|
1542
|
-
t.bookmarks ? Bt(t.bookmarks, "bookmark", "bookmarks") : null,
|
|
1543
|
-
t.remembered ? Bt(t.remembered, "remembered layout", "remembered layouts") : null
|
|
1544
|
-
].filter(Boolean).join(", ");
|
|
1545
|
-
return t.target === "sheet" ? { name: `${t.label} sheet`, uses: a } : t.target === "table" ? { name: `${t.label} table`, uses: a } : { name: t.label, uses: a };
|
|
1546
|
-
}
|
|
1547
|
-
function Ds({
|
|
1483
|
+
function xs({
|
|
1548
1484
|
saved: t,
|
|
1549
|
-
draft:
|
|
1550
|
-
enabled:
|
|
1485
|
+
draft: n,
|
|
1486
|
+
enabled: a
|
|
1551
1487
|
}) {
|
|
1552
|
-
const r =
|
|
1553
|
-
return r.length ? /* @__PURE__ */ o(
|
|
1554
|
-
/* @__PURE__ */ e(
|
|
1488
|
+
const r = bs({ saved: t, draft: n, enabled: a });
|
|
1489
|
+
return r.length ? /* @__PURE__ */ o(Va, { children: [
|
|
1490
|
+
/* @__PURE__ */ e(ja, { asChild: !0, children: /* @__PURE__ */ o(
|
|
1555
1491
|
G,
|
|
1556
1492
|
{
|
|
1557
1493
|
variant: "ghost",
|
|
1558
1494
|
size: "xs",
|
|
1559
1495
|
className: "gap-1 text-muted-foreground hover:text-foreground",
|
|
1560
1496
|
children: [
|
|
1561
|
-
/* @__PURE__ */ e(
|
|
1497
|
+
/* @__PURE__ */ e(Zr, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
1562
1498
|
"Affects saved views"
|
|
1563
1499
|
]
|
|
1564
1500
|
}
|
|
1565
1501
|
) }),
|
|
1566
|
-
/* @__PURE__ */ o(
|
|
1502
|
+
/* @__PURE__ */ o(Ha, { align: "end", className: "w-[320px] p-3 text-[12px]", children: [
|
|
1567
1503
|
/* @__PURE__ */ e("p", { className: "text-foreground", children: "This edit removes parts of the dashboard that viewers saved. Their views still open, with a note about what no longer applies." }),
|
|
1568
1504
|
/* @__PURE__ */ e(
|
|
1569
1505
|
"ul",
|
|
@@ -1571,14 +1507,14 @@ function Ds({
|
|
|
1571
1507
|
"aria-label": "Affected saved views",
|
|
1572
1508
|
className: "mt-2 grid gap-1 border-t border-border/60 pt-2",
|
|
1573
1509
|
children: r.map((s) => {
|
|
1574
|
-
const { name: d, uses:
|
|
1510
|
+
const { name: d, uses: h } = kn(s);
|
|
1575
1511
|
return /* @__PURE__ */ o(
|
|
1576
1512
|
"li",
|
|
1577
1513
|
{
|
|
1578
1514
|
className: "flex items-baseline justify-between gap-3",
|
|
1579
1515
|
children: [
|
|
1580
1516
|
/* @__PURE__ */ e("span", { className: "min-w-0 truncate text-foreground", children: d }),
|
|
1581
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-[11.5px] text-muted-foreground", children:
|
|
1517
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-[11.5px] text-muted-foreground", children: h })
|
|
1582
1518
|
]
|
|
1583
1519
|
},
|
|
1584
1520
|
`${s.target}:${s.cardId ?? ""}:${s.id}`
|
|
@@ -1589,265 +1525,265 @@ function Ds({
|
|
|
1589
1525
|
] })
|
|
1590
1526
|
] }) : null;
|
|
1591
1527
|
}
|
|
1592
|
-
function
|
|
1528
|
+
function Rt(t, n) {
|
|
1593
1529
|
return {
|
|
1594
|
-
dashboard:
|
|
1595
|
-
semanticExecutionPayload:
|
|
1530
|
+
dashboard: rt(t),
|
|
1531
|
+
semanticExecutionPayload: rt(n)
|
|
1596
1532
|
};
|
|
1597
1533
|
}
|
|
1598
|
-
function
|
|
1599
|
-
var wt, Nt, St
|
|
1534
|
+
function zs() {
|
|
1535
|
+
var yt, wt, Nt, St;
|
|
1600
1536
|
const {
|
|
1601
1537
|
authToken: t,
|
|
1602
|
-
tokenProps:
|
|
1603
|
-
id:
|
|
1538
|
+
tokenProps: n,
|
|
1539
|
+
id: a,
|
|
1604
1540
|
showBriefings: r
|
|
1605
|
-
} = J(), s =
|
|
1606
|
-
canEditDashboard:
|
|
1607
|
-
hasInspectionUser:
|
|
1541
|
+
} = J(), s = ea(), { isLocalDev: d, isConsoleMode: h } = ta(), {
|
|
1542
|
+
canEditDashboard: u,
|
|
1543
|
+
hasInspectionUser: b,
|
|
1608
1544
|
inspectionMessage: v,
|
|
1609
|
-
isInspectionMode:
|
|
1545
|
+
isInspectionMode: l,
|
|
1610
1546
|
isInspectionSurface: c
|
|
1611
|
-
} =
|
|
1612
|
-
(i) => i.id ===
|
|
1613
|
-
),
|
|
1547
|
+
} = ra(), { openBrandStudioPreview: f } = aa(), { permissions: m } = Un(), p = na(), { isLoading: x } = sa(), w = D((i) => i.theme), S = D((i) => i.isDownloadingPdf), g = D((i) => i.dashboard), B = D((i) => i.selectedSheetId), U = (yt = g == null ? void 0 : g.sheets) == null ? void 0 : yt.find(
|
|
1548
|
+
(i) => i.id === B
|
|
1549
|
+
), M = yn(U), A = M ? (wt = U == null ? void 0 : U.document) == null ? void 0 : wt.page : void 0, C = D(
|
|
1614
1550
|
(i) => i.isDashboardEditing
|
|
1615
|
-
), { setDashboardTitle: X } =
|
|
1616
|
-
|
|
1617
|
-
() =>
|
|
1618
|
-
[
|
|
1551
|
+
), { setDashboardTitle: X } = D((i) => i.actions), [Ue, j] = N(!1), [ae, H] = N(!1), [ne, se] = N(!1), [Be, oe] = N(!1), [Se, Z] = N(null), [ie, De] = N(null), { registerBriefingViewer: ke } = oa();
|
|
1552
|
+
be(
|
|
1553
|
+
() => ke((i) => De(i)),
|
|
1554
|
+
[ke]
|
|
1619
1555
|
);
|
|
1620
|
-
const [ee, y] = N(!1), [
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1556
|
+
const [ee, y] = N(!1), [F, q] = N(!1), [z, K] = N(null), [de, Q] = N([]), [ct, Ce] = N(!1), [dr, lt] = N(!1), R = D((i) => i.isVisualEditing);
|
|
1557
|
+
Dt((i) => i.card);
|
|
1558
|
+
const cr = Pe(
|
|
1623
1559
|
(i) => i.selectedDashboard
|
|
1624
|
-
),
|
|
1560
|
+
), lr = Pe(
|
|
1625
1561
|
(i) => i.initialDashboard
|
|
1626
1562
|
);
|
|
1627
|
-
Pe((i) => i.selectedVisual),
|
|
1628
|
-
const
|
|
1563
|
+
Pe((i) => i.selectedVisual), D((i) => i.selectedFrameId), Dt((i) => i.frame);
|
|
1564
|
+
const ut = D(
|
|
1629
1565
|
(i) => i.showDashboardJSON
|
|
1630
1566
|
);
|
|
1631
|
-
|
|
1632
|
-
const { setIsDashboardEditing:
|
|
1567
|
+
D((i) => i.onSaveFunction);
|
|
1568
|
+
const { setIsDashboardEditing: mt, setShowDashboardJSON: ht, markDashboardSaved: ur } = D(
|
|
1633
1569
|
(i) => i.actions
|
|
1634
|
-
), { setInitialDashboard:
|
|
1570
|
+
), { setInitialDashboard: pt, clearSelectedDashboard: Fe } = Pe(
|
|
1635
1571
|
(i) => i.actions
|
|
1636
|
-
), ce = !!
|
|
1637
|
-
config:
|
|
1572
|
+
), ce = !!n.orgUserId || !!(n.tenantId && n.endUserId && n.endUserEmail), { resources: Ee } = ia(Ye.DASHBOARD), I = fn(), { currentUser: mr } = nt(), hr = da(mr), $ = cr || lr, W = ca({
|
|
1573
|
+
config: n.config,
|
|
1638
1574
|
canNavigateDashboardHub: ce,
|
|
1639
|
-
canShareDashboard: ((
|
|
1640
|
-
canManageGroups:
|
|
1641
|
-
}),
|
|
1642
|
-
id:
|
|
1643
|
-
title: (
|
|
1644
|
-
} : null, { handleAddNewFrame:
|
|
1645
|
-
if (!
|
|
1646
|
-
if (!(
|
|
1575
|
+
canShareDashboard: ((Nt = $ == null ? void 0 : $.permissions) == null ? void 0 : Nt.canShare) === !0,
|
|
1576
|
+
canManageGroups: hr
|
|
1577
|
+
}), ft = $ ? {
|
|
1578
|
+
id: $.id,
|
|
1579
|
+
title: (g == null ? void 0 : g.title) || $.title || "Dashboard"
|
|
1580
|
+
} : null, { handleAddNewFrame: pr } = la(), [$e, Ge] = N(!1), [fr, le] = N(!1), [Ve, Ae] = N("close"), ue = ua(Ye.DASHBOARD), [L, me] = N(null), gr = async (i, _) => {
|
|
1581
|
+
if (!l) {
|
|
1582
|
+
if (!(g != null && g.id)) {
|
|
1647
1583
|
console.log("No dashboard ID found");
|
|
1648
1584
|
return;
|
|
1649
1585
|
}
|
|
1650
1586
|
console.log("Updating dashboard title:", {
|
|
1651
|
-
dashboardId:
|
|
1587
|
+
dashboardId: g.id,
|
|
1652
1588
|
newTitle: i,
|
|
1653
|
-
previousTitle:
|
|
1589
|
+
previousTitle: _
|
|
1654
1590
|
}), ue.mutate(
|
|
1655
1591
|
{
|
|
1656
|
-
resourceId:
|
|
1592
|
+
resourceId: g.id,
|
|
1657
1593
|
data: { title: i }
|
|
1658
1594
|
},
|
|
1659
1595
|
{
|
|
1660
1596
|
onSuccess: () => {
|
|
1661
1597
|
me(
|
|
1662
|
-
(
|
|
1663
|
-
...
|
|
1664
|
-
dashboard: { ...
|
|
1665
|
-
} :
|
|
1666
|
-
),
|
|
1598
|
+
(P) => (P == null ? void 0 : P.dashboard.id) === g.id ? {
|
|
1599
|
+
...P,
|
|
1600
|
+
dashboard: { ...P.dashboard, title: i }
|
|
1601
|
+
} : P
|
|
1602
|
+
), k.success("Dashboard title updated");
|
|
1667
1603
|
},
|
|
1668
|
-
onError: (
|
|
1669
|
-
console.error("Failed to update dashboard title:",
|
|
1670
|
-
const te =
|
|
1671
|
-
(te == null ? void 0 : te.id) ===
|
|
1604
|
+
onError: (P) => {
|
|
1605
|
+
console.error("Failed to update dashboard title:", P), k.error("Failed to update dashboard title");
|
|
1606
|
+
const te = D.getState().dashboard;
|
|
1607
|
+
(te == null ? void 0 : te.id) === g.id && te.title === i && X(_);
|
|
1672
1608
|
}
|
|
1673
1609
|
}
|
|
1674
1610
|
);
|
|
1675
1611
|
}
|
|
1676
1612
|
};
|
|
1677
|
-
|
|
1613
|
+
be(() => {
|
|
1678
1614
|
if (Ee && Ee.length > 0) {
|
|
1679
|
-
const i =
|
|
1615
|
+
const i = g == null ? void 0 : g.id;
|
|
1680
1616
|
if (i) {
|
|
1681
|
-
const
|
|
1682
|
-
(
|
|
1617
|
+
const _ = Ee.find(
|
|
1618
|
+
(P) => P.id === i
|
|
1683
1619
|
);
|
|
1684
|
-
|
|
1620
|
+
_ && pt(_);
|
|
1685
1621
|
}
|
|
1686
1622
|
}
|
|
1687
|
-
}, [Ee,
|
|
1688
|
-
const
|
|
1689
|
-
() =>
|
|
1623
|
+
}, [Ee, g == null ? void 0 : g.id, pt]);
|
|
1624
|
+
const br = n.orgUserId || n.tenantId, je = V(
|
|
1625
|
+
() => ys({
|
|
1690
1626
|
accessToken: t == null ? void 0 : t.accessToken,
|
|
1691
|
-
dashboardId: (
|
|
1692
|
-
selectedSheetId:
|
|
1693
|
-
pageSize:
|
|
1694
|
-
orientation:
|
|
1627
|
+
dashboardId: (g == null ? void 0 : g.id) || a || n.dashboard_id,
|
|
1628
|
+
selectedSheetId: M ? B : void 0,
|
|
1629
|
+
pageSize: A == null ? void 0 : A.size,
|
|
1630
|
+
orientation: A == null ? void 0 : A.orientation,
|
|
1695
1631
|
theme: w
|
|
1696
1632
|
}),
|
|
1697
1633
|
[
|
|
1698
1634
|
t == null ? void 0 : t.accessToken,
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1635
|
+
a,
|
|
1636
|
+
g == null ? void 0 : g.id,
|
|
1637
|
+
M,
|
|
1638
|
+
A == null ? void 0 : A.orientation,
|
|
1639
|
+
A == null ? void 0 : A.size,
|
|
1640
|
+
B,
|
|
1705
1641
|
w,
|
|
1706
|
-
|
|
1642
|
+
n.dashboard_id
|
|
1707
1643
|
]
|
|
1708
|
-
), He =
|
|
1644
|
+
), He = C && !R && !l && br && u, { setDashboard: qe } = D((i) => i.actions), xr = D(
|
|
1709
1645
|
(i) => i.semanticExecutionPayload
|
|
1710
|
-
),
|
|
1711
|
-
|
|
1712
|
-
},
|
|
1713
|
-
|
|
1646
|
+
), vr = () => {
|
|
1647
|
+
mt(!0);
|
|
1648
|
+
}, Ie = () => {
|
|
1649
|
+
mt(!1), ht(!1), me(null);
|
|
1714
1650
|
};
|
|
1715
|
-
|
|
1716
|
-
if (!
|
|
1717
|
-
|
|
1651
|
+
be(() => {
|
|
1652
|
+
if (!C) {
|
|
1653
|
+
L && me(null);
|
|
1718
1654
|
return;
|
|
1719
1655
|
}
|
|
1720
|
-
if (
|
|
1656
|
+
if (L || !g || x)
|
|
1721
1657
|
return;
|
|
1722
|
-
const i =
|
|
1658
|
+
const i = ma(D.getState());
|
|
1723
1659
|
me(
|
|
1724
|
-
|
|
1660
|
+
Rt(i.dashboard, i.semanticExecutionPayload)
|
|
1725
1661
|
);
|
|
1726
1662
|
}, [
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1663
|
+
g,
|
|
1664
|
+
L,
|
|
1665
|
+
C,
|
|
1730
1666
|
x,
|
|
1731
|
-
|
|
1667
|
+
xr
|
|
1732
1668
|
]);
|
|
1733
|
-
const
|
|
1734
|
-
|
|
1735
|
-
|
|
1669
|
+
const ze = (L == null ? void 0 : L.dashboard) ?? null, { isDirty: Ke, isDirtyPending: yr, resetDirty: he } = Nn(
|
|
1670
|
+
g,
|
|
1671
|
+
ze,
|
|
1736
1672
|
300,
|
|
1737
1673
|
1e3,
|
|
1738
|
-
|
|
1739
|
-
), gt =
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
),
|
|
1744
|
-
if (
|
|
1745
|
-
|
|
1746
|
-
semanticExecutionPayload:
|
|
1747
|
-
}),
|
|
1674
|
+
Sn
|
|
1675
|
+
), gt = Xa(
|
|
1676
|
+
ze,
|
|
1677
|
+
l,
|
|
1678
|
+
u
|
|
1679
|
+
), bt = Ke || yr, Me = $e || ue.isPending, wr = () => {
|
|
1680
|
+
if (l) {
|
|
1681
|
+
L && qe(L.dashboard, {
|
|
1682
|
+
semanticExecutionPayload: L.semanticExecutionPayload
|
|
1683
|
+
}), Ie(), he();
|
|
1748
1684
|
return;
|
|
1749
1685
|
}
|
|
1750
|
-
gt() ? (
|
|
1751
|
-
},
|
|
1752
|
-
await
|
|
1686
|
+
gt() ? (Ae("close"), le(!0)) : (Ie(), he());
|
|
1687
|
+
}, Nr = async () => {
|
|
1688
|
+
await Qe({
|
|
1753
1689
|
closeAfterSave: !0,
|
|
1754
1690
|
navigateHomeAfterSave: Ve === "home"
|
|
1755
1691
|
});
|
|
1756
|
-
},
|
|
1692
|
+
}, Sr = () => {
|
|
1757
1693
|
const i = Ve === "home" && !!ce;
|
|
1758
|
-
|
|
1759
|
-
semanticExecutionPayload:
|
|
1760
|
-
}),
|
|
1761
|
-
},
|
|
1762
|
-
|
|
1763
|
-
semanticExecutionPayload:
|
|
1694
|
+
L && qe(L.dashboard, {
|
|
1695
|
+
semanticExecutionPayload: L.semanticExecutionPayload
|
|
1696
|
+
}), Ie(), i && Fe(), Ae("close"), le(!1), he();
|
|
1697
|
+
}, Dr = () => {
|
|
1698
|
+
L && (qe(L.dashboard, {
|
|
1699
|
+
semanticExecutionPayload: L.semanticExecutionPayload
|
|
1764
1700
|
}), he());
|
|
1765
|
-
},
|
|
1701
|
+
}, kr = () => {
|
|
1766
1702
|
if (ce) {
|
|
1767
|
-
if (
|
|
1768
|
-
|
|
1703
|
+
if (C && gt()) {
|
|
1704
|
+
Ae("home"), le(!0);
|
|
1769
1705
|
return;
|
|
1770
1706
|
}
|
|
1771
1707
|
Fe();
|
|
1772
1708
|
}
|
|
1773
1709
|
};
|
|
1774
|
-
async function
|
|
1775
|
-
if (
|
|
1710
|
+
async function Qe(i) {
|
|
1711
|
+
if (l)
|
|
1776
1712
|
return;
|
|
1777
|
-
const
|
|
1778
|
-
if (!
|
|
1713
|
+
const _ = D.getState().dashboard;
|
|
1714
|
+
if (!_)
|
|
1779
1715
|
return;
|
|
1780
|
-
const
|
|
1781
|
-
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1784
|
-
const
|
|
1785
|
-
template:
|
|
1716
|
+
const P = (i == null ? void 0 : i.closeAfterSave) ?? ct, te = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
|
|
1717
|
+
Ce(P), P && le(!1);
|
|
1718
|
+
const Ir = rt(_);
|
|
1719
|
+
q(!0), K(null), Q([]), Ge(!0);
|
|
1720
|
+
const Mr = {
|
|
1721
|
+
template: _
|
|
1786
1722
|
};
|
|
1787
1723
|
ue.mutate(
|
|
1788
1724
|
{
|
|
1789
|
-
resourceId:
|
|
1790
|
-
data:
|
|
1725
|
+
resourceId: _.id,
|
|
1726
|
+
data: Mr
|
|
1791
1727
|
},
|
|
1792
1728
|
{
|
|
1793
1729
|
onSuccess: () => {
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1730
|
+
Ge(!1), ur(), k.success("Dashboard saved!"), me(
|
|
1731
|
+
Rt(
|
|
1732
|
+
Ir,
|
|
1733
|
+
D.getState().semanticExecutionPayload
|
|
1798
1734
|
)
|
|
1799
|
-
),
|
|
1735
|
+
), q(!1), Ce(!1), P && (Ie(), he(), te && ce && Fe()), Ae("close");
|
|
1800
1736
|
},
|
|
1801
|
-
onError: (
|
|
1802
|
-
|
|
1803
|
-
const
|
|
1804
|
-
|
|
1805
|
-
) ? (
|
|
1806
|
-
(
|
|
1737
|
+
onError: (Lr) => {
|
|
1738
|
+
Ge(!1), K("Failed to save dashboard. Please try again.");
|
|
1739
|
+
const Oe = Lr.details, Or = Array.isArray(
|
|
1740
|
+
Oe == null ? void 0 : Oe.errors
|
|
1741
|
+
) ? (Oe.errors || []).filter(
|
|
1742
|
+
(Pr) => typeof Pr == "string"
|
|
1807
1743
|
) : [];
|
|
1808
1744
|
Q(
|
|
1809
|
-
|
|
1810
|
-
errors:
|
|
1811
|
-
dashboard:
|
|
1745
|
+
hs({
|
|
1746
|
+
errors: Or,
|
|
1747
|
+
dashboard: _ || void 0
|
|
1812
1748
|
})
|
|
1813
|
-
),
|
|
1749
|
+
), k.error("Failed to save dashboard");
|
|
1814
1750
|
}
|
|
1815
1751
|
}
|
|
1816
1752
|
);
|
|
1817
1753
|
}
|
|
1818
|
-
const
|
|
1754
|
+
const xt = g.title;
|
|
1819
1755
|
ue.isPending && console.log("Title during update:", {
|
|
1820
|
-
title:
|
|
1821
|
-
dashboardStateTitle:
|
|
1822
|
-
dashboardId:
|
|
1756
|
+
title: xt,
|
|
1757
|
+
dashboardStateTitle: g.title,
|
|
1758
|
+
dashboardId: g == null ? void 0 : g.id
|
|
1823
1759
|
});
|
|
1824
|
-
const
|
|
1825
|
-
(
|
|
1760
|
+
const Cr = ce && !!(t != null && t.accessToken) && !!(n != null && n.apiServiceUrl), Er = !l && W.showDashboardHub && Cr, Ar = !l && p && W.showDashboardHub, Y = (g == null ? void 0 : g.id) || null, vt = ha(
|
|
1761
|
+
(St = n.config) == null ? void 0 : St.showBriefings,
|
|
1826
1762
|
r
|
|
1827
|
-
),
|
|
1828
|
-
if (!p && !
|
|
1763
|
+
), Le = Za(Y);
|
|
1764
|
+
if (!p && !R)
|
|
1829
1765
|
return null;
|
|
1830
|
-
const
|
|
1831
|
-
return /* @__PURE__ */ e(
|
|
1766
|
+
const We = !R && p && !l;
|
|
1767
|
+
return /* @__PURE__ */ e(en, { width: I.width, hasOverflowMenu: We, children: /* @__PURE__ */ o(
|
|
1832
1768
|
"div",
|
|
1833
1769
|
{
|
|
1834
|
-
ref:
|
|
1770
|
+
ref: I.measure,
|
|
1835
1771
|
className: "flex min-h-11 shrink-0 items-center gap-2 border-b px-3 py-1.5",
|
|
1836
1772
|
role: "dashboard-controls",
|
|
1837
1773
|
children: [
|
|
1838
1774
|
/* @__PURE__ */ o("div", { className: "flex min-w-[80px] flex-1 items-center gap-2", children: [
|
|
1839
|
-
|
|
1840
|
-
|
|
1775
|
+
Ar && !R && /* @__PURE__ */ e(
|
|
1776
|
+
pn,
|
|
1841
1777
|
{
|
|
1842
1778
|
"aria-label": "Dashboard Hub",
|
|
1843
1779
|
tooltip: "Dashboard Hub",
|
|
1844
|
-
onClick:
|
|
1780
|
+
onClick: kr,
|
|
1845
1781
|
className: "h-7 w-7 px-0",
|
|
1846
1782
|
buttonProps: { size: "xs" },
|
|
1847
|
-
children: /* @__PURE__ */ e(
|
|
1783
|
+
children: /* @__PURE__ */ e(pa, { className: "h-3.5 w-3.5" })
|
|
1848
1784
|
}
|
|
1849
1785
|
),
|
|
1850
|
-
!
|
|
1786
|
+
!R && p && (x ? /* @__PURE__ */ e(
|
|
1851
1787
|
"div",
|
|
1852
1788
|
{
|
|
1853
1789
|
className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
|
|
@@ -1857,21 +1793,21 @@ function eo() {
|
|
|
1857
1793
|
}
|
|
1858
1794
|
) : /* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
1859
1795
|
/* @__PURE__ */ e(
|
|
1860
|
-
|
|
1796
|
+
fa,
|
|
1861
1797
|
{
|
|
1862
|
-
value:
|
|
1798
|
+
value: xt || "Untitled Dashboard",
|
|
1863
1799
|
onSave: (i) => {
|
|
1864
1800
|
console.log("EditableText onSave called:", {
|
|
1865
1801
|
newTitle: i,
|
|
1866
|
-
canEditDashboard:
|
|
1867
|
-
dashboardId:
|
|
1802
|
+
canEditDashboard: u,
|
|
1803
|
+
dashboardId: g == null ? void 0 : g.id
|
|
1868
1804
|
});
|
|
1869
|
-
const
|
|
1870
|
-
X(i),
|
|
1805
|
+
const _ = (g == null ? void 0 : g.title) || "";
|
|
1806
|
+
X(i), gr(i, _);
|
|
1871
1807
|
},
|
|
1872
|
-
isEditable:
|
|
1873
|
-
isDashboardEditing:
|
|
1874
|
-
canEditDashboard:
|
|
1808
|
+
isEditable: ga({
|
|
1809
|
+
isDashboardEditing: C,
|
|
1810
|
+
canEditDashboard: u === !0 && !l
|
|
1875
1811
|
}),
|
|
1876
1812
|
displayClassName: "text-[13px] font-medium",
|
|
1877
1813
|
inputClassName: "text-[13px] font-medium",
|
|
@@ -1879,55 +1815,55 @@ function eo() {
|
|
|
1879
1815
|
isPending: ue.isPending
|
|
1880
1816
|
}
|
|
1881
1817
|
),
|
|
1882
|
-
!
|
|
1818
|
+
!l && Y && /* @__PURE__ */ e(tn, { dashboardId: Y })
|
|
1883
1819
|
] }))
|
|
1884
1820
|
] }),
|
|
1885
1821
|
/* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
1886
1822
|
/* @__PURE__ */ o("div", { className: "-m-1 flex min-w-0 items-center gap-1.5 overflow-x-auto p-1 [scrollbar-width:thin] [&>*]:shrink-0", children: [
|
|
1887
|
-
|
|
1888
|
-
/* @__PURE__ */ e(
|
|
1889
|
-
/* @__PURE__ */ e(
|
|
1823
|
+
R && /* @__PURE__ */ o(T, { children: [
|
|
1824
|
+
/* @__PURE__ */ e(rn, {}),
|
|
1825
|
+
/* @__PURE__ */ e(an, {})
|
|
1890
1826
|
] }),
|
|
1891
|
-
p && !
|
|
1892
|
-
!
|
|
1893
|
-
|
|
1827
|
+
p && !l && /* @__PURE__ */ e(gn, {}),
|
|
1828
|
+
!R && C && !l && m.canUseFilters && p && /* @__PURE__ */ e(nn, {}),
|
|
1829
|
+
C && !R && !l && p && !M && /* @__PURE__ */ o("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
|
|
1894
1830
|
/* @__PURE__ */ o(
|
|
1895
1831
|
G,
|
|
1896
1832
|
{
|
|
1897
1833
|
variant: "ghost",
|
|
1898
1834
|
size: "xs",
|
|
1899
|
-
disabled: !
|
|
1900
|
-
onClick: () => void
|
|
1901
|
-
"aria-label":
|
|
1902
|
-
title:
|
|
1835
|
+
disabled: !C,
|
|
1836
|
+
onClick: () => void pr(),
|
|
1837
|
+
"aria-label": I.width === "sm" ? "Add visual" : void 0,
|
|
1838
|
+
title: I.width === "sm" ? "Add visual" : void 0,
|
|
1903
1839
|
className: xe(
|
|
1904
1840
|
"h-full rounded-none border-0 shadow-none hover:bg-accent",
|
|
1905
|
-
|
|
1841
|
+
I.width === "sm" && "w-7 px-0"
|
|
1906
1842
|
),
|
|
1907
1843
|
children: [
|
|
1908
1844
|
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
|
|
1909
|
-
|
|
1845
|
+
I.width !== "sm" && "Visual"
|
|
1910
1846
|
]
|
|
1911
1847
|
}
|
|
1912
1848
|
),
|
|
1913
|
-
/* @__PURE__ */ o(
|
|
1914
|
-
/* @__PURE__ */ e(
|
|
1849
|
+
/* @__PURE__ */ o(kt, { modal: !1, children: [
|
|
1850
|
+
/* @__PURE__ */ e(Ct, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1915
1851
|
G,
|
|
1916
1852
|
{
|
|
1917
1853
|
variant: "ghost",
|
|
1918
1854
|
size: "xs",
|
|
1919
1855
|
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
|
|
1920
1856
|
"aria-label": "Open visual options",
|
|
1921
|
-
disabled: !
|
|
1922
|
-
children: /* @__PURE__ */ e(
|
|
1857
|
+
disabled: !C,
|
|
1858
|
+
children: /* @__PURE__ */ e(qa, { className: "h-3.5 w-3.5" })
|
|
1923
1859
|
}
|
|
1924
1860
|
) }),
|
|
1925
1861
|
/* @__PURE__ */ e(
|
|
1926
|
-
|
|
1862
|
+
Et,
|
|
1927
1863
|
{
|
|
1928
1864
|
align: "end",
|
|
1929
1865
|
className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
1930
|
-
children: /* @__PURE__ */ o(
|
|
1866
|
+
children: /* @__PURE__ */ o(O, { onClick: () => lt(!0), children: [
|
|
1931
1867
|
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
|
|
1932
1868
|
"From library..."
|
|
1933
1869
|
] })
|
|
@@ -1935,63 +1871,63 @@ function eo() {
|
|
|
1935
1871
|
)
|
|
1936
1872
|
] }),
|
|
1937
1873
|
/* @__PURE__ */ e(
|
|
1938
|
-
|
|
1874
|
+
sn,
|
|
1939
1875
|
{
|
|
1940
|
-
open:
|
|
1941
|
-
onOpenChange:
|
|
1876
|
+
open: dr,
|
|
1877
|
+
onOpenChange: lt
|
|
1942
1878
|
}
|
|
1943
1879
|
)
|
|
1944
1880
|
] }),
|
|
1945
|
-
!
|
|
1946
|
-
!
|
|
1881
|
+
!l && p && /* @__PURE__ */ e(on, {}),
|
|
1882
|
+
!R && !C && (u || l) && (!c || !b || u !== void 0) && p && /* @__PURE__ */ o("div", { className: "inline-flex items-center gap-1", children: [
|
|
1947
1883
|
/* @__PURE__ */ o(
|
|
1948
1884
|
G,
|
|
1949
1885
|
{
|
|
1950
1886
|
size: "xs",
|
|
1951
|
-
onClick:
|
|
1952
|
-
"aria-label":
|
|
1953
|
-
title:
|
|
1954
|
-
className:
|
|
1887
|
+
onClick: vr,
|
|
1888
|
+
"aria-label": l ? "Inspect" : "Edit",
|
|
1889
|
+
title: I.width === "sm" ? l ? "Inspect" : "Edit" : void 0,
|
|
1890
|
+
className: I.width === "sm" ? "w-7 px-0" : void 0,
|
|
1955
1891
|
children: [
|
|
1956
|
-
/* @__PURE__ */ e(
|
|
1957
|
-
|
|
1892
|
+
/* @__PURE__ */ e(ba, { className: "h-3.5 w-3.5" }),
|
|
1893
|
+
I.width !== "sm" && (l ? "Inspect" : "Edit")
|
|
1958
1894
|
]
|
|
1959
1895
|
}
|
|
1960
1896
|
),
|
|
1961
|
-
v ? /* @__PURE__ */ e(
|
|
1962
|
-
/* @__PURE__ */ e(
|
|
1897
|
+
v ? /* @__PURE__ */ e(za, { children: /* @__PURE__ */ o(Ka, { children: [
|
|
1898
|
+
/* @__PURE__ */ e(Qa, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1963
1899
|
"button",
|
|
1964
1900
|
{
|
|
1965
1901
|
type: "button",
|
|
1966
1902
|
"aria-label": v,
|
|
1967
1903
|
className: "inline-flex size-6 items-center justify-center rounded-control text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
1968
|
-
children: /* @__PURE__ */ e(
|
|
1904
|
+
children: /* @__PURE__ */ e(Wa, { "aria-hidden": "true", className: "size-3.5" })
|
|
1969
1905
|
}
|
|
1970
1906
|
) }),
|
|
1971
|
-
/* @__PURE__ */ e(
|
|
1907
|
+
/* @__PURE__ */ e(Ya, { children: /* @__PURE__ */ e("p", { children: v }) })
|
|
1972
1908
|
] }) }) : null
|
|
1973
1909
|
] }),
|
|
1974
|
-
He && p &&
|
|
1975
|
-
|
|
1910
|
+
He && p && Ke && /* @__PURE__ */ e(
|
|
1911
|
+
xs,
|
|
1976
1912
|
{
|
|
1977
|
-
saved:
|
|
1978
|
-
draft:
|
|
1979
|
-
enabled:
|
|
1913
|
+
saved: ze,
|
|
1914
|
+
draft: g,
|
|
1915
|
+
enabled: C && !l
|
|
1980
1916
|
}
|
|
1981
1917
|
),
|
|
1982
|
-
He && p &&
|
|
1918
|
+
He && p && Ke && /* @__PURE__ */ o(
|
|
1983
1919
|
G,
|
|
1984
1920
|
{
|
|
1985
1921
|
variant: "outline",
|
|
1986
1922
|
size: "xs",
|
|
1987
|
-
onClick:
|
|
1988
|
-
disabled:
|
|
1923
|
+
onClick: Dr,
|
|
1924
|
+
disabled: Me,
|
|
1989
1925
|
"aria-label": "Undo",
|
|
1990
|
-
title:
|
|
1991
|
-
className:
|
|
1926
|
+
title: I.width === "sm" ? "Undo" : void 0,
|
|
1927
|
+
className: I.width === "sm" ? "w-7 px-0" : void 0,
|
|
1992
1928
|
children: [
|
|
1993
|
-
/* @__PURE__ */ e(
|
|
1994
|
-
|
|
1929
|
+
/* @__PURE__ */ e(xa, { className: "h-3.5 w-3.5" }),
|
|
1930
|
+
I.width !== "sm" && "Undo"
|
|
1995
1931
|
]
|
|
1996
1932
|
}
|
|
1997
1933
|
),
|
|
@@ -1999,136 +1935,136 @@ function eo() {
|
|
|
1999
1935
|
G,
|
|
2000
1936
|
{
|
|
2001
1937
|
size: "xs",
|
|
2002
|
-
className: xe(!
|
|
2003
|
-
disabled:
|
|
2004
|
-
onClick: () =>
|
|
1938
|
+
className: xe(!bt && "opacity-60"),
|
|
1939
|
+
disabled: Me || !bt,
|
|
1940
|
+
onClick: () => Qe(),
|
|
2005
1941
|
children: [
|
|
2006
|
-
|
|
2007
|
-
|
|
1942
|
+
Me ? /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Cn, { className: "h-3.5 w-3.5" }),
|
|
1943
|
+
Me ? "Saving..." : "Save"
|
|
2008
1944
|
]
|
|
2009
1945
|
}
|
|
2010
1946
|
),
|
|
2011
|
-
|
|
1947
|
+
C && !R && p && /* @__PURE__ */ o(
|
|
2012
1948
|
G,
|
|
2013
1949
|
{
|
|
2014
1950
|
variant: "outline",
|
|
2015
1951
|
size: "xs",
|
|
2016
|
-
onClick:
|
|
1952
|
+
onClick: wr,
|
|
2017
1953
|
"aria-label": "Close",
|
|
2018
|
-
title:
|
|
2019
|
-
className:
|
|
1954
|
+
title: I.width === "sm" ? "Close" : void 0,
|
|
1955
|
+
className: I.width === "sm" ? "w-7 px-0" : void 0,
|
|
2020
1956
|
children: [
|
|
2021
|
-
/* @__PURE__ */ e(
|
|
2022
|
-
|
|
1957
|
+
/* @__PURE__ */ e(va, { className: "h-3.5 w-3.5" }),
|
|
1958
|
+
I.width !== "sm" && "Close"
|
|
2023
1959
|
]
|
|
2024
1960
|
}
|
|
2025
1961
|
)
|
|
2026
1962
|
] }),
|
|
2027
|
-
!
|
|
2028
|
-
/* @__PURE__ */ e(
|
|
2029
|
-
|
|
1963
|
+
!R && p && /* @__PURE__ */ o(T, { children: [
|
|
1964
|
+
/* @__PURE__ */ e(dn, {}),
|
|
1965
|
+
h && u === !0 && !l && /* @__PURE__ */ e(cn, {})
|
|
2030
1966
|
] }),
|
|
2031
|
-
!
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
/* @__PURE__ */ e(
|
|
1967
|
+
!R && d && I.width === "lg" && /* @__PURE__ */ e(Tn, {}),
|
|
1968
|
+
We && /* @__PURE__ */ e(ln, {}),
|
|
1969
|
+
We && /* @__PURE__ */ o(kt, { children: [
|
|
1970
|
+
/* @__PURE__ */ e(Ct, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2035
1971
|
G,
|
|
2036
1972
|
{
|
|
2037
1973
|
variant: "ghost",
|
|
2038
1974
|
size: "xs",
|
|
2039
1975
|
className: "w-7 px-0",
|
|
2040
1976
|
"aria-label": "More dashboard options",
|
|
2041
|
-
children: /* @__PURE__ */ e(
|
|
1977
|
+
children: /* @__PURE__ */ e(ya, { className: "h-3.5 w-3.5" })
|
|
2042
1978
|
}
|
|
2043
1979
|
) }),
|
|
2044
1980
|
/* @__PURE__ */ o(
|
|
2045
|
-
|
|
1981
|
+
Et,
|
|
2046
1982
|
{
|
|
2047
1983
|
align: "end",
|
|
2048
1984
|
className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
|
|
2049
1985
|
children: [
|
|
2050
|
-
/* @__PURE__ */ e(
|
|
2051
|
-
|
|
1986
|
+
/* @__PURE__ */ e(vs, {}),
|
|
1987
|
+
Le.available && Er && /* @__PURE__ */ o(T, { children: [
|
|
2052
1988
|
/* @__PURE__ */ o(
|
|
2053
|
-
|
|
1989
|
+
O,
|
|
2054
1990
|
{
|
|
2055
|
-
disabled:
|
|
2056
|
-
onSelect:
|
|
1991
|
+
disabled: Le.disabled,
|
|
1992
|
+
onSelect: Le.toggle,
|
|
2057
1993
|
children: [
|
|
2058
|
-
/* @__PURE__ */ e(
|
|
1994
|
+
/* @__PURE__ */ e(wa, { className: "h-3.5 w-3.5" }),
|
|
2059
1995
|
/* @__PURE__ */ e("span", { className: "flex-1", children: "Default dashboard" }),
|
|
2060
|
-
|
|
1996
|
+
Le.isDefault && /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5" })
|
|
2061
1997
|
]
|
|
2062
1998
|
}
|
|
2063
1999
|
),
|
|
2064
|
-
/* @__PURE__ */ e(
|
|
2000
|
+
/* @__PURE__ */ e(ge, {})
|
|
2065
2001
|
] }),
|
|
2066
2002
|
/* @__PURE__ */ e(_e, { children: "Reports & briefings" }),
|
|
2067
2003
|
/* @__PURE__ */ o(
|
|
2068
|
-
|
|
2004
|
+
O,
|
|
2069
2005
|
{
|
|
2070
2006
|
disabled: S,
|
|
2071
2007
|
onSelect: () => y(!0),
|
|
2072
2008
|
children: [
|
|
2073
|
-
/* @__PURE__ */ e(
|
|
2009
|
+
/* @__PURE__ */ e(Na, { className: "h-3.5 w-3.5" }),
|
|
2074
2010
|
"Export"
|
|
2075
2011
|
]
|
|
2076
2012
|
}
|
|
2077
2013
|
),
|
|
2078
2014
|
/* @__PURE__ */ e(
|
|
2079
|
-
|
|
2015
|
+
fs,
|
|
2080
2016
|
{
|
|
2081
|
-
scheduleReportVisible: !!(
|
|
2082
|
-
analyticalBriefingVisible: !!(
|
|
2017
|
+
scheduleReportVisible: !!(vt && s.surfaceVisible && Y && !C),
|
|
2018
|
+
analyticalBriefingVisible: !!(vt && s.surfaceVisible && Y && !C),
|
|
2083
2019
|
onScheduleReport: () => Z("scheduled_report"),
|
|
2084
2020
|
onCreateAnalyticalBriefing: () => Z("analytical_briefing")
|
|
2085
2021
|
}
|
|
2086
2022
|
),
|
|
2087
|
-
|
|
2088
|
-
|
|
2023
|
+
C && /* @__PURE__ */ o(
|
|
2024
|
+
O,
|
|
2089
2025
|
{
|
|
2090
2026
|
onSelect: () => oe(!0),
|
|
2091
2027
|
children: [
|
|
2092
|
-
/* @__PURE__ */ e(
|
|
2028
|
+
/* @__PURE__ */ e(Sa, { className: "h-3.5 w-3.5" }),
|
|
2093
2029
|
"Download settings"
|
|
2094
2030
|
]
|
|
2095
2031
|
}
|
|
2096
2032
|
),
|
|
2097
|
-
/* @__PURE__ */ e(
|
|
2098
|
-
(W.showDashboardSharing || W.showGroupManagement) && /* @__PURE__ */ o(
|
|
2033
|
+
/* @__PURE__ */ e(ge, {}),
|
|
2034
|
+
(W.showDashboardSharing || W.showGroupManagement) && /* @__PURE__ */ o(T, { children: [
|
|
2099
2035
|
/* @__PURE__ */ e(_e, { children: "Access" }),
|
|
2100
|
-
W.showDashboardSharing && /* @__PURE__ */ o(
|
|
2101
|
-
/* @__PURE__ */ e(
|
|
2036
|
+
W.showDashboardSharing && /* @__PURE__ */ o(O, { onSelect: () => j(!0), children: [
|
|
2037
|
+
/* @__PURE__ */ e(Da, { className: "h-3.5 w-3.5" }),
|
|
2102
2038
|
"Share"
|
|
2103
2039
|
] }),
|
|
2104
2040
|
W.showGroupManagement && /* @__PURE__ */ o(
|
|
2105
|
-
|
|
2041
|
+
O,
|
|
2106
2042
|
{
|
|
2107
|
-
onClick: () =>
|
|
2043
|
+
onClick: () => H(!0),
|
|
2108
2044
|
children: [
|
|
2109
|
-
/* @__PURE__ */ e(
|
|
2045
|
+
/* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5" }),
|
|
2110
2046
|
"Manage Groups"
|
|
2111
2047
|
]
|
|
2112
2048
|
}
|
|
2113
2049
|
),
|
|
2114
|
-
/* @__PURE__ */ e(
|
|
2050
|
+
/* @__PURE__ */ e(ge, {})
|
|
2115
2051
|
] }),
|
|
2116
2052
|
/* @__PURE__ */ e(_e, { children: "Preferences" }),
|
|
2117
|
-
/* @__PURE__ */ o(
|
|
2118
|
-
/* @__PURE__ */ e(
|
|
2053
|
+
/* @__PURE__ */ o(O, { onClick: () => se(!0), children: [
|
|
2054
|
+
/* @__PURE__ */ e($t, { className: "h-3.5 w-3.5" }),
|
|
2119
2055
|
"Report preferences"
|
|
2120
2056
|
] }),
|
|
2121
|
-
d && p && /* @__PURE__ */ o(
|
|
2122
|
-
/* @__PURE__ */ e(
|
|
2057
|
+
d && p && /* @__PURE__ */ o(T, { children: [
|
|
2058
|
+
/* @__PURE__ */ e(ge, {}),
|
|
2123
2059
|
/* @__PURE__ */ e(_e, { children: "Developer" }),
|
|
2124
2060
|
/* @__PURE__ */ o(
|
|
2125
|
-
|
|
2061
|
+
O,
|
|
2126
2062
|
{
|
|
2127
2063
|
onSelect: () => {
|
|
2128
2064
|
var i;
|
|
2129
2065
|
t != null && t.accessToken && ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(t.accessToken).then(
|
|
2130
|
-
() =>
|
|
2131
|
-
).catch(() =>
|
|
2066
|
+
() => k.success("Token copied to clipboard")
|
|
2067
|
+
).catch(() => k.error("Unable to copy token")) : k.error("Clipboard not available"));
|
|
2132
2068
|
},
|
|
2133
2069
|
children: [
|
|
2134
2070
|
/* @__PURE__ */ e(At, { className: "h-3.5 w-3.5" }),
|
|
@@ -2136,27 +2072,27 @@ function eo() {
|
|
|
2136
2072
|
]
|
|
2137
2073
|
}
|
|
2138
2074
|
),
|
|
2139
|
-
|
|
2140
|
-
|
|
2075
|
+
M && /* @__PURE__ */ o(
|
|
2076
|
+
O,
|
|
2141
2077
|
{
|
|
2142
|
-
disabled: !
|
|
2078
|
+
disabled: !je,
|
|
2143
2079
|
onSelect: () => {
|
|
2144
2080
|
var i;
|
|
2145
|
-
if (!
|
|
2146
|
-
|
|
2081
|
+
if (!je) {
|
|
2082
|
+
k.error(
|
|
2147
2083
|
"Open a document sheet with a token to copy the local PDF URL"
|
|
2148
2084
|
);
|
|
2149
2085
|
return;
|
|
2150
2086
|
}
|
|
2151
|
-
(i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(
|
|
2152
|
-
() =>
|
|
2087
|
+
(i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(je).then(
|
|
2088
|
+
() => k.success(
|
|
2153
2089
|
"Local document PDF URL copied to clipboard"
|
|
2154
2090
|
)
|
|
2155
2091
|
).catch(
|
|
2156
|
-
() =>
|
|
2092
|
+
() => k.error(
|
|
2157
2093
|
"Unable to copy local document PDF URL"
|
|
2158
2094
|
)
|
|
2159
|
-
) :
|
|
2095
|
+
) : k.error("Clipboard not available");
|
|
2160
2096
|
},
|
|
2161
2097
|
children: [
|
|
2162
2098
|
/* @__PURE__ */ e(At, { className: "h-3.5 w-3.5" }),
|
|
@@ -2165,26 +2101,26 @@ function eo() {
|
|
|
2165
2101
|
}
|
|
2166
2102
|
),
|
|
2167
2103
|
/* @__PURE__ */ o(
|
|
2168
|
-
|
|
2104
|
+
O,
|
|
2169
2105
|
{
|
|
2170
|
-
onSelect: () =>
|
|
2106
|
+
onSelect: () => un(n.apiServiceUrl),
|
|
2171
2107
|
children: [
|
|
2172
|
-
/* @__PURE__ */ e(
|
|
2108
|
+
/* @__PURE__ */ e(Mn, { className: "h-3.5 w-3.5" }),
|
|
2173
2109
|
"Invalidate token"
|
|
2174
2110
|
]
|
|
2175
2111
|
}
|
|
2176
2112
|
),
|
|
2177
|
-
/* @__PURE__ */ o(
|
|
2178
|
-
/* @__PURE__ */ e(
|
|
2113
|
+
/* @__PURE__ */ o(O, { onSelect: f, children: [
|
|
2114
|
+
/* @__PURE__ */ e(En, { className: "h-3.5 w-3.5" }),
|
|
2179
2115
|
"Brand Studio"
|
|
2180
2116
|
] }),
|
|
2181
|
-
|
|
2182
|
-
|
|
2117
|
+
C && /* @__PURE__ */ o(
|
|
2118
|
+
O,
|
|
2183
2119
|
{
|
|
2184
|
-
onSelect: () =>
|
|
2120
|
+
onSelect: () => ht(!ut),
|
|
2185
2121
|
children: [
|
|
2186
|
-
/* @__PURE__ */ e(
|
|
2187
|
-
|
|
2122
|
+
/* @__PURE__ */ e(An, { className: "h-3.5 w-3.5" }),
|
|
2123
|
+
ut ? "Hide dashboard JSON" : "Show dashboard JSON"
|
|
2188
2124
|
]
|
|
2189
2125
|
}
|
|
2190
2126
|
)
|
|
@@ -2193,43 +2129,43 @@ function eo() {
|
|
|
2193
2129
|
}
|
|
2194
2130
|
)
|
|
2195
2131
|
] }),
|
|
2196
|
-
|
|
2197
|
-
|
|
2132
|
+
Ue && ft && /* @__PURE__ */ e(
|
|
2133
|
+
ka,
|
|
2198
2134
|
{
|
|
2199
|
-
resource:
|
|
2200
|
-
resourceType:
|
|
2201
|
-
onClose: () =>
|
|
2135
|
+
resource: ft,
|
|
2136
|
+
resourceType: Ye.DASHBOARD,
|
|
2137
|
+
onClose: () => j(!1)
|
|
2202
2138
|
}
|
|
2203
2139
|
),
|
|
2204
2140
|
W.showGroupManagement && /* @__PURE__ */ e(
|
|
2205
|
-
|
|
2141
|
+
ns,
|
|
2206
2142
|
{
|
|
2207
2143
|
open: ae,
|
|
2208
|
-
onOpenChange:
|
|
2144
|
+
onOpenChange: H
|
|
2209
2145
|
}
|
|
2210
2146
|
),
|
|
2211
2147
|
/* @__PURE__ */ e(
|
|
2212
|
-
|
|
2148
|
+
bn,
|
|
2213
2149
|
{
|
|
2214
2150
|
open: ne,
|
|
2215
2151
|
onOpenChange: se
|
|
2216
2152
|
}
|
|
2217
2153
|
),
|
|
2218
2154
|
/* @__PURE__ */ e(
|
|
2219
|
-
|
|
2155
|
+
ms,
|
|
2220
2156
|
{
|
|
2221
2157
|
open: Be,
|
|
2222
2158
|
onOpenChange: oe
|
|
2223
2159
|
}
|
|
2224
2160
|
),
|
|
2225
2161
|
Y && (Se || ie) ? /* @__PURE__ */ e(
|
|
2226
|
-
|
|
2162
|
+
mn,
|
|
2227
2163
|
{
|
|
2228
2164
|
dashboardId: Y,
|
|
2229
|
-
dashboardTitle: (
|
|
2165
|
+
dashboardTitle: (g == null ? void 0 : g.title) || ($ == null ? void 0 : $.title),
|
|
2230
2166
|
open: !0,
|
|
2231
2167
|
onOpenChange: (i) => {
|
|
2232
|
-
i || (Z(null),
|
|
2168
|
+
i || (Z(null), De(null));
|
|
2233
2169
|
},
|
|
2234
2170
|
hideTrigger: !0,
|
|
2235
2171
|
workflowIntent: Se ?? void 0,
|
|
@@ -2237,67 +2173,67 @@ function eo() {
|
|
|
2237
2173
|
}
|
|
2238
2174
|
) : null,
|
|
2239
2175
|
p && /* @__PURE__ */ e(
|
|
2240
|
-
|
|
2176
|
+
Ca,
|
|
2241
2177
|
{
|
|
2242
2178
|
open: ee,
|
|
2243
2179
|
onOpenChange: y
|
|
2244
2180
|
}
|
|
2245
2181
|
),
|
|
2246
2182
|
/* @__PURE__ */ e(
|
|
2247
|
-
|
|
2183
|
+
Ea,
|
|
2248
2184
|
{
|
|
2249
|
-
open:
|
|
2185
|
+
open: F,
|
|
2250
2186
|
onOpenChange: (i) => {
|
|
2251
|
-
!i &&
|
|
2187
|
+
!i && $e && !z || (q(i), i || (K(null), Q([]), Ce(!1)));
|
|
2252
2188
|
},
|
|
2253
|
-
children: /* @__PURE__ */ o(
|
|
2254
|
-
/* @__PURE__ */ o(
|
|
2255
|
-
/* @__PURE__ */ e(
|
|
2256
|
-
/* @__PURE__ */ e(
|
|
2189
|
+
children: /* @__PURE__ */ o(Aa, { className: "max-w-sm", children: [
|
|
2190
|
+
/* @__PURE__ */ o(Ia, { children: [
|
|
2191
|
+
/* @__PURE__ */ e(Ma, { children: z ? "Save failed" : "Saving dashboard" }),
|
|
2192
|
+
/* @__PURE__ */ e(La, { className: "pt-2", children: z ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
2257
2193
|
de.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
2258
2194
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
2259
2195
|
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: de.slice(0, 5).map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
|
|
2260
2196
|
] })
|
|
2261
2197
|
] }),
|
|
2262
|
-
/* @__PURE__ */ e(
|
|
2198
|
+
/* @__PURE__ */ e(Oa, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: z ? /* @__PURE__ */ o(T, { children: [
|
|
2263
2199
|
/* @__PURE__ */ e(
|
|
2264
|
-
|
|
2200
|
+
Pa,
|
|
2265
2201
|
{
|
|
2266
2202
|
onClick: () => {
|
|
2267
|
-
|
|
2203
|
+
q(!1), K(null), Q([]), Ce(!1);
|
|
2268
2204
|
},
|
|
2269
2205
|
className: "m-0",
|
|
2270
2206
|
children: "Close"
|
|
2271
2207
|
}
|
|
2272
2208
|
),
|
|
2273
2209
|
/* @__PURE__ */ e(
|
|
2274
|
-
|
|
2210
|
+
It,
|
|
2275
2211
|
{
|
|
2276
|
-
onClick: () =>
|
|
2277
|
-
closeAfterSave:
|
|
2212
|
+
onClick: () => Qe({
|
|
2213
|
+
closeAfterSave: ct,
|
|
2278
2214
|
navigateHomeAfterSave: Ve === "home"
|
|
2279
2215
|
}),
|
|
2280
2216
|
className: "m-0",
|
|
2281
2217
|
children: "Retry"
|
|
2282
2218
|
}
|
|
2283
2219
|
)
|
|
2284
|
-
] }) : /* @__PURE__ */ o(
|
|
2285
|
-
/* @__PURE__ */ e(
|
|
2220
|
+
] }) : /* @__PURE__ */ o(It, { disabled: !0, className: "m-0 cursor-default", children: [
|
|
2221
|
+
/* @__PURE__ */ e(Te, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2286
2222
|
"Saving..."
|
|
2287
2223
|
] }) })
|
|
2288
2224
|
] })
|
|
2289
2225
|
}
|
|
2290
2226
|
),
|
|
2291
2227
|
/* @__PURE__ */ e(
|
|
2292
|
-
|
|
2228
|
+
hn,
|
|
2293
2229
|
{
|
|
2294
|
-
open:
|
|
2230
|
+
open: fr,
|
|
2295
2231
|
onOpenChange: (i) => {
|
|
2296
2232
|
le(i);
|
|
2297
2233
|
},
|
|
2298
|
-
onSave:
|
|
2299
|
-
onDiscard:
|
|
2300
|
-
isSaving:
|
|
2234
|
+
onSave: Nr,
|
|
2235
|
+
onDiscard: Sr,
|
|
2236
|
+
isSaving: $e,
|
|
2301
2237
|
saveLabel: "Save",
|
|
2302
2238
|
discardLabel: "Discard changes"
|
|
2303
2239
|
}
|
|
@@ -2307,33 +2243,33 @@ function eo() {
|
|
|
2307
2243
|
}
|
|
2308
2244
|
) });
|
|
2309
2245
|
}
|
|
2310
|
-
function
|
|
2311
|
-
const t =
|
|
2312
|
-
return t.length === 0 ? null : /* @__PURE__ */ o(
|
|
2313
|
-
t.map((
|
|
2314
|
-
|
|
2315
|
-
/* @__PURE__ */ e("span", { className: "flex-1", children:
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
] },
|
|
2319
|
-
/* @__PURE__ */ e(
|
|
2246
|
+
function vs() {
|
|
2247
|
+
const t = xn();
|
|
2248
|
+
return t.length === 0 ? null : /* @__PURE__ */ o(T, { children: [
|
|
2249
|
+
t.map((n) => /* @__PURE__ */ o(O, { onSelect: n.onSelect, children: [
|
|
2250
|
+
n.icon,
|
|
2251
|
+
/* @__PURE__ */ e("span", { className: "flex-1", children: n.label }),
|
|
2252
|
+
n.hint && /* @__PURE__ */ e("span", { className: "text-[11px] text-muted-foreground", children: n.hint }),
|
|
2253
|
+
n.checked && /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5" })
|
|
2254
|
+
] }, n.id)),
|
|
2255
|
+
/* @__PURE__ */ e(ge, {})
|
|
2320
2256
|
] });
|
|
2321
2257
|
}
|
|
2322
|
-
function
|
|
2258
|
+
function ys({
|
|
2323
2259
|
accessToken: t,
|
|
2324
|
-
dashboardId:
|
|
2325
|
-
selectedSheetId:
|
|
2260
|
+
dashboardId: n,
|
|
2261
|
+
selectedSheetId: a,
|
|
2326
2262
|
pageSize: r,
|
|
2327
2263
|
orientation: s,
|
|
2328
2264
|
theme: d
|
|
2329
2265
|
}) {
|
|
2330
|
-
if (!t || !
|
|
2266
|
+
if (!t || !a)
|
|
2331
2267
|
return null;
|
|
2332
|
-
const
|
|
2333
|
-
|
|
2334
|
-
const
|
|
2335
|
-
return
|
|
2268
|
+
const h = new URL("http://localhost:5173/print-document");
|
|
2269
|
+
h.searchParams.set("token", t), n && h.searchParams.set("dashboardId", n), h.searchParams.set("selectedSheetId", a), d && h.searchParams.set("theme", d);
|
|
2270
|
+
const u = new URL("http://127.0.0.1:3002/");
|
|
2271
|
+
return u.searchParams.set("pdfMode", "document"), u.searchParams.set("pageSize", r || "letter"), u.searchParams.set("orientation", s || "portrait"), u.searchParams.set("url", h.toString()), u.toString();
|
|
2336
2272
|
}
|
|
2337
2273
|
export {
|
|
2338
|
-
|
|
2274
|
+
zs as default
|
|
2339
2275
|
};
|