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