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