react-semaphor 0.1.549 → 0.1.550
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/brand-studio/index.js +1 -1
- package/dist/chunks/{assistant-chat-CUSvuESS.js → assistant-chat-ClAvjeNe.js} +104 -104
- package/dist/chunks/{dashboard-Cm7WkARH.js → dashboard-DDQgKoss.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-X0HzNpS8.js → dashboard-briefing-launcher-CCYs8E4j.js} +1440 -1328
- package/dist/chunks/{dashboard-controls-BuX6TMNK.js → dashboard-controls-DfSkQBsk.js} +976 -929
- package/dist/chunks/{dashboard-json-Cc4u2xvy.js → dashboard-json-BPhyn9pl.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-DX2CzibK.js → edit-dashboard-visual-G7EmLuR0.js} +355 -355
- package/dist/chunks/{filter-reach-copy-Bc-Gei83.js → filter-reach-copy-8vnDYToV.js} +94 -92
- package/dist/chunks/{report-preferences-dialog-B9oYQ6OJ.js → report-preferences-dialog-D_fEDaS4.js} +849 -768
- package/dist/chunks/{semaphor-ready-indicator-wWkPH4ue.js → semaphor-ready-indicator-Bz5BxITW.js} +25706 -25429
- package/dist/chunks/{shelf-drop-preview-context-B86d8IZO.js → shelf-drop-preview-context-B8kNwpWQ.js} +2 -2
- package/dist/chunks/{switch-CEBOR4n7.js → switch-wJP6O7ZT.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-DPNjYyi3.js → use-create-flow-overlay-state-RzJa7G8S.js} +2 -2
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +2 -2
- package/dist/index.js +184 -169
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/components/assistant/assistant-entry-points.d.ts +4 -1
- package/dist/types/components/dashboard/favorites/dashboard-favorite-toggle.d.ts +11 -0
- package/dist/types/components/dashboard/favorites/favorite-star-button.d.ts +16 -0
- package/dist/types/components/index.d.ts +8 -0
- package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +16 -0
- package/dist/types/components/surfboard/toolbar/toolbar-context.d.ts +86 -0
- package/dist/types/components/surfboard/toolbar/toolbar-overflow.d.ts +14 -0
- package/dist/types/lib/dashboard-viewer/viewer-store-state.d.ts +7 -0
- package/dist/types/lib/hooks/use-dashboard-favorite.d.ts +24 -0
- package/dist/types/lib/hooks/use-dashboard-query.d.ts +2 -0
- package/dist/types/lib/hooks/use-default-dashboard-toggle.d.ts +12 -0
- package/dist/types/shared/dashboard-viewer/viewer-contract.d.ts +18 -0
- package/package.json +1 -1
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { B as I, l as De, q as st, L as re, j as
|
|
5
|
-
import { L as
|
|
6
|
-
import { c as fe, X as Xe, C as
|
|
1
|
+
import { jsx as t, jsxs as s, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import Vt, { useState as S, useEffect as xe, useCallback as Z, useMemo as te, useLayoutEffect as Dt, useRef as nt, useContext as Bt } from "react";
|
|
3
|
+
import { cE as ot, bL as Ie, bM as Te, bO as Le, cF as ta, b5 as it, b3 as Qe, cG as aa, cH as Ke, cI as lt, a7 as Ge, a4 as ce, u as w, cJ as ra, cK as na, bK as E, cL as sa, a6 as ee, bh as oa, cM as ia, cN as la, a_ as ve, cs as Pt, aR as $e, o as da, k as ca, cO as ua, cv as dt, cw as ct, cx as ut, cy as ht, cz as mt, cA as pt, cB as ft, cC as Mt, aP as gt, cP as ha, cQ as ma, cl as et, ci as Ve, cj as Be, cR as Ut, ck as Pe, c7 as G, ct as pa, co as We, cS as fa, c5 as ga, bN as bt, bP as xt, cT as ba, bJ as xa, cU as Ot, bx as vt, cV as va, by as ya, i as Ca, cW as wa, bs as Na, w as Sa, t as ka, cX as Da, cY as Aa, cZ as Fa, c_ as K, c$ as Ea, R as Rt, d0 as Ia, d1 as Ta, d2 as La, d3 as Va, aM as Ba, d4 as de, d5 as Pa, W as yt, d6 as Ma, d7 as Ua, d8 as Oa, d9 as Ra, da as za, db as _a, dc as ja, dd as zt, de as $a, df as Wa, dg as qa, dh as _t, di as Ha, dj as ze, dk as Qa, dl as Ka, dm as Ga, A as Xa, aB as Ya, aC as Za, ah as Ja, ag as er, af as tr, ae as ar, ab as rr, a9 as nr, dn as sr, dp as or, dq as ir, dr as lr, ds as dr, az as cr } from "./semaphor-ready-indicator-Bz5BxITW.js";
|
|
4
|
+
import { B as I, l as De, q as st, L as re, j as jt, c as Ct, i as ur, P as Ae, a0 as hr, b as Fe, a as qe, S as $t } from "./switch-wJP6O7ZT.js";
|
|
5
|
+
import { L as Ee } from "./layout-grid-Bgzth8vd.js";
|
|
6
|
+
import { c as fe, X as Xe, C as wt } from "./x-4f5U2XwU.js";
|
|
7
7
|
import "./index-CuHybtft.js";
|
|
8
|
-
import { o as
|
|
8
|
+
import { o as mr } from "./validators-C-aOQlTB.js";
|
|
9
9
|
import "./matrix-operation-contract-D6vYkZK4.js";
|
|
10
10
|
import "./analytics-base-schemas-BKs3flFS.js";
|
|
11
11
|
import "zod";
|
|
12
12
|
import "../value-format-preferences/index.js";
|
|
13
13
|
import { c as J } from "./_commonjsHelpers-DimLPMtv.js";
|
|
14
|
-
import { S as
|
|
15
|
-
import { s as
|
|
16
|
-
import { aL as
|
|
17
|
-
import { f as
|
|
18
|
-
import "react-dom";
|
|
14
|
+
import { S as pr } from "./selection-reducer-CJzkTZio.js";
|
|
15
|
+
import { s as _e } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
|
|
16
|
+
import { aL as fr, ay as gr, e1 as He, v as At, e2 as br, as as Nt, e3 as xr, dq as vr, dc as yr, bp as Cr, e4 as wr } from "./global-date-filter-utils-CnumW4j2.js";
|
|
17
|
+
import { f as Nr } from "./editor-draft-sync-BN5qYHPF.js";
|
|
18
|
+
import { createPortal as Sr } from "react-dom";
|
|
19
19
|
import "./pivot-result-lifecycle-pwq3b7LC.js";
|
|
20
20
|
import "./index-CtoK1Lgu.js";
|
|
21
|
-
import { I as
|
|
22
|
-
import { S as
|
|
23
|
-
import { V as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { g as
|
|
21
|
+
import { I as kr } from "./table-settings-WysCBj62.js";
|
|
22
|
+
import { S as Wt } from "./save-CfJpQQ68.js";
|
|
23
|
+
import { V as Dr, L as Ar, a as Fr, u as qt, C as Ht, F as Er, b as Ir } from "./use-create-flow-overlay-state-RzJa7G8S.js";
|
|
24
|
+
import { m as Tr, k as Qt, n as Kt } from "./report-preferences-dialog-D_fEDaS4.js";
|
|
25
|
+
import { q as Ft } from "./matrix-formatter-DWEeC0_c.js";
|
|
26
|
+
import { g as Lr, f as Vr } from "./document-dashboard-inputs-DPQ_wUGD.js";
|
|
27
|
+
import { g as le, d as Br, a as Pr } from "./index-DzsdV1o4.js";
|
|
27
28
|
/**
|
|
28
29
|
* @license lucide-react v0.453.0 - ISC
|
|
29
30
|
*
|
|
30
31
|
* This source code is licensed under the ISC license.
|
|
31
32
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
33
|
*/
|
|
33
|
-
const
|
|
34
|
+
const Mr = fe("ArrowUpRight", [
|
|
34
35
|
["path", { d: "M7 7h10v10", key: "1tivn9" }],
|
|
35
36
|
["path", { d: "M7 17 17 7", key: "1vkiza" }]
|
|
36
37
|
]);
|
|
@@ -40,7 +41,7 @@ const Nr = fe("ArrowUpRight", [
|
|
|
40
41
|
* This source code is licensed under the ISC license.
|
|
41
42
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
43
|
*/
|
|
43
|
-
const
|
|
44
|
+
const Et = fe("Bell", [
|
|
44
45
|
["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
|
|
45
46
|
["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }]
|
|
46
47
|
]);
|
|
@@ -50,7 +51,7 @@ const Sr = fe("Bell", [
|
|
|
50
51
|
* This source code is licensed under the ISC license.
|
|
51
52
|
* See the LICENSE file in the root directory of this source tree.
|
|
52
53
|
*/
|
|
53
|
-
const
|
|
54
|
+
const Ur = fe("CalendarRange", [
|
|
54
55
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
55
56
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
56
57
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
@@ -66,7 +67,7 @@ const kr = fe("CalendarRange", [
|
|
|
66
67
|
* This source code is licensed under the ISC license.
|
|
67
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
68
69
|
*/
|
|
69
|
-
const
|
|
70
|
+
const Or = fe("CodeXml", [
|
|
70
71
|
["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
|
|
71
72
|
["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
|
|
72
73
|
["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
|
|
@@ -77,7 +78,7 @@ const Dr = fe("CodeXml", [
|
|
|
77
78
|
* This source code is licensed under the ISC license.
|
|
78
79
|
* See the LICENSE file in the root directory of this source tree.
|
|
79
80
|
*/
|
|
80
|
-
const
|
|
81
|
+
const It = fe("MonitorSmartphone", [
|
|
81
82
|
["path", { d: "M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8", key: "10dyio" }],
|
|
82
83
|
["path", { d: "M10 19v-3.96 3.15", key: "1irgej" }],
|
|
83
84
|
["path", { d: "M7 19h5", key: "qswx4l" }],
|
|
@@ -89,7 +90,7 @@ const Ar = fe("MonitorSmartphone", [
|
|
|
89
90
|
* This source code is licensed under the ISC license.
|
|
90
91
|
* See the LICENSE file in the root directory of this source tree.
|
|
91
92
|
*/
|
|
92
|
-
const
|
|
93
|
+
const Rr = fe("MousePointer2", [
|
|
93
94
|
[
|
|
94
95
|
"path",
|
|
95
96
|
{
|
|
@@ -104,7 +105,7 @@ const Fr = fe("MousePointer2", [
|
|
|
104
105
|
* This source code is licensed under the ISC license.
|
|
105
106
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
107
|
*/
|
|
107
|
-
const
|
|
108
|
+
const zr = fe("Newspaper", [
|
|
108
109
|
[
|
|
109
110
|
"path",
|
|
110
111
|
{
|
|
@@ -116,53 +117,53 @@ const Er = fe("Newspaper", [
|
|
|
116
117
|
["path", { d: "M15 18h-5", key: "95g1m2" }],
|
|
117
118
|
["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
|
|
118
119
|
]);
|
|
119
|
-
function
|
|
120
|
-
return /* @__PURE__ */
|
|
120
|
+
function _r() {
|
|
121
|
+
return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((e, a) => /* @__PURE__ */ s(
|
|
121
122
|
"div",
|
|
122
123
|
{
|
|
123
124
|
className: "flex animate-pulse items-start gap-3 rounded-xl border border-transparent px-2.5 py-2.5",
|
|
124
125
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ t("div", { className: "mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60" }),
|
|
127
|
+
/* @__PURE__ */ s("div", { className: "flex-1 space-y-1.5", children: [
|
|
128
|
+
/* @__PURE__ */ t("div", { className: "h-4 w-3/5 rounded bg-muted/60" }),
|
|
129
|
+
/* @__PURE__ */ t("div", { className: "h-3 w-4/5 rounded bg-muted/40" })
|
|
129
130
|
] })
|
|
130
131
|
]
|
|
131
132
|
},
|
|
132
133
|
a
|
|
133
134
|
)) });
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
-
open:
|
|
136
|
+
function jr({
|
|
137
|
+
open: e,
|
|
137
138
|
onOpenChange: a,
|
|
138
139
|
onSubmit: o,
|
|
139
|
-
isCreating:
|
|
140
|
+
isCreating: n
|
|
140
141
|
}) {
|
|
141
|
-
const i = ot("interactive"), [
|
|
142
|
+
const i = ot("interactive"), [r, d] = S(""), [c, l] = S("");
|
|
142
143
|
xe(() => {
|
|
143
|
-
|
|
144
|
-
}, [
|
|
144
|
+
e || (d(""), l(""));
|
|
145
|
+
}, [e]);
|
|
145
146
|
const u = () => {
|
|
146
|
-
|
|
147
|
+
r.trim() && o({ title: r, description: c });
|
|
147
148
|
}, h = (m) => {
|
|
148
149
|
a(m);
|
|
149
150
|
};
|
|
150
|
-
return /* @__PURE__ */
|
|
151
|
-
|
|
151
|
+
return /* @__PURE__ */ t(Ie, { open: e, onOpenChange: h, children: /* @__PURE__ */ s(
|
|
152
|
+
Te,
|
|
152
153
|
{
|
|
153
154
|
showCloseButton: !1,
|
|
154
155
|
className: "flex max-w-lg grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
|
|
155
156
|
style: i.dialogStyle,
|
|
156
157
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
159
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
160
|
+
/* @__PURE__ */ t(Ee, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
161
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
162
|
+
/* @__PURE__ */ t(Le, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
|
|
163
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
|
|
163
164
|
] })
|
|
164
165
|
] }),
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ t(
|
|
166
167
|
I,
|
|
167
168
|
{
|
|
168
169
|
size: "xs",
|
|
@@ -170,64 +171,64 @@ function Lr({
|
|
|
170
171
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
171
172
|
onClick: () => h(!1),
|
|
172
173
|
"aria-label": "Close",
|
|
173
|
-
disabled:
|
|
174
|
-
children: /* @__PURE__ */
|
|
174
|
+
disabled: n,
|
|
175
|
+
children: /* @__PURE__ */ t(Xe, { className: "h-3.5 w-3.5" })
|
|
175
176
|
}
|
|
176
177
|
)
|
|
177
178
|
] }),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ s("div", { className: "space-y-3 px-4 py-3", children: [
|
|
180
|
+
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
|
|
181
|
+
/* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
|
|
182
|
+
/* @__PURE__ */ t(De, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
|
|
183
|
+
/* @__PURE__ */ t(
|
|
183
184
|
st,
|
|
184
185
|
{
|
|
185
186
|
id: "visual-title",
|
|
186
187
|
size: "sm",
|
|
187
188
|
placeholder: "Untitled visual",
|
|
188
|
-
value:
|
|
189
|
-
onChange: (m) =>
|
|
190
|
-
disabled:
|
|
189
|
+
value: r,
|
|
190
|
+
onChange: (m) => d(m.target.value),
|
|
191
|
+
disabled: n,
|
|
191
192
|
onKeyDown: (m) => {
|
|
192
193
|
m.key === "Enter" && !m.shiftKey && (m.preventDefault(), u());
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
196
|
)
|
|
196
197
|
] }),
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
|
|
199
|
+
/* @__PURE__ */ t(De, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
|
|
200
|
+
/* @__PURE__ */ t(
|
|
200
201
|
st,
|
|
201
202
|
{
|
|
202
203
|
id: "visual-description",
|
|
203
204
|
size: "sm",
|
|
204
205
|
placeholder: "Optional",
|
|
205
|
-
value:
|
|
206
|
+
value: c,
|
|
206
207
|
onChange: (m) => l(m.target.value),
|
|
207
|
-
disabled:
|
|
208
|
+
disabled: n
|
|
208
209
|
}
|
|
209
210
|
)
|
|
210
211
|
] })
|
|
211
212
|
] }),
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ s("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
|
|
214
|
+
/* @__PURE__ */ t(
|
|
214
215
|
I,
|
|
215
216
|
{
|
|
216
217
|
size: "xs",
|
|
217
218
|
variant: "outline",
|
|
218
219
|
onClick: () => h(!1),
|
|
219
|
-
disabled:
|
|
220
|
+
disabled: n,
|
|
220
221
|
children: "Cancel"
|
|
221
222
|
}
|
|
222
223
|
),
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ t(
|
|
224
225
|
I,
|
|
225
226
|
{
|
|
226
227
|
size: "xs",
|
|
227
228
|
onClick: u,
|
|
228
|
-
disabled: !
|
|
229
|
-
children:
|
|
230
|
-
/* @__PURE__ */
|
|
229
|
+
disabled: !r.trim() || n,
|
|
230
|
+
children: n ? /* @__PURE__ */ s(R, { children: [
|
|
231
|
+
/* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
231
232
|
"Creating..."
|
|
232
233
|
] }) : "Create library visual"
|
|
233
234
|
}
|
|
@@ -237,25 +238,25 @@ function Lr({
|
|
|
237
238
|
}
|
|
238
239
|
) });
|
|
239
240
|
}
|
|
240
|
-
function
|
|
241
|
-
const [a, o] =
|
|
241
|
+
function $r(e) {
|
|
242
|
+
const [a, o] = S(null), [n, i] = S(null), r = ta();
|
|
242
243
|
return xe(() => {
|
|
243
|
-
if (!
|
|
244
|
+
if (!e || e.trim() === "") {
|
|
244
245
|
o(null), i(null);
|
|
245
246
|
return;
|
|
246
247
|
}
|
|
247
|
-
if (!
|
|
248
|
+
if (!r)
|
|
248
249
|
return;
|
|
249
250
|
(async () => {
|
|
250
251
|
try {
|
|
251
|
-
if (!
|
|
252
|
-
throw new Error(`Invalid URL format: ${
|
|
252
|
+
if (!e.startsWith("http://") && !e.startsWith("https://"))
|
|
253
|
+
throw new Error(`Invalid URL format: ${e}`);
|
|
253
254
|
try {
|
|
254
|
-
new URL(
|
|
255
|
+
new URL(e);
|
|
255
256
|
} catch {
|
|
256
|
-
throw new Error(`Invalid URL: ${
|
|
257
|
+
throw new Error(`Invalid URL: ${e}`);
|
|
257
258
|
}
|
|
258
|
-
const l = `${
|
|
259
|
+
const l = `${e.endsWith("/") ? e : `${e}/`}index.js`;
|
|
259
260
|
try {
|
|
260
261
|
if (!(await fetch(l, { method: "HEAD" })).ok)
|
|
261
262
|
throw new Error(`Module not found at ${l}`);
|
|
@@ -269,54 +270,54 @@ function Vr(t) {
|
|
|
269
270
|
if (typeof u.useChartStore != "function")
|
|
270
271
|
throw new Error("useChartStore is not a function");
|
|
271
272
|
o(() => u.useChartStore), i(null);
|
|
272
|
-
} catch (
|
|
273
|
-
const l =
|
|
273
|
+
} catch (c) {
|
|
274
|
+
const l = c instanceof Error ? c.message : "Unknown error";
|
|
274
275
|
console.error("Failed to load remote chart store:", l), i(l), o(null);
|
|
275
276
|
}
|
|
276
277
|
})();
|
|
277
|
-
}, [
|
|
278
|
+
}, [e, r]), a;
|
|
278
279
|
}
|
|
279
|
-
function
|
|
280
|
-
if (
|
|
280
|
+
function Wr(e, a) {
|
|
281
|
+
if (e.length === 0)
|
|
281
282
|
return "";
|
|
282
|
-
const o =
|
|
283
|
-
(
|
|
284
|
-
var i,
|
|
285
|
-
return ((i =
|
|
283
|
+
const o = e.find(
|
|
284
|
+
(n) => {
|
|
285
|
+
var i, r;
|
|
286
|
+
return ((i = n.customCardPreferences) == null ? void 0 : i.visualType) === "multiple" || !!((r = n.customCardPreferences) != null && r.dataInputCardIds);
|
|
286
287
|
}
|
|
287
288
|
);
|
|
288
289
|
if (o)
|
|
289
290
|
return o.id;
|
|
290
291
|
if (a) {
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
293
|
-
const i =
|
|
292
|
+
const n = e.find((i) => i.id === a);
|
|
293
|
+
if (n) {
|
|
294
|
+
const i = n.tabTitle;
|
|
294
295
|
if (i == "All__Header")
|
|
295
|
-
return
|
|
296
|
+
return e[0].id;
|
|
296
297
|
if (i && i.endsWith("__Header")) {
|
|
297
|
-
const
|
|
298
|
-
(l) => l.tabTitle ===
|
|
298
|
+
const d = i.split("__")[0], c = e.find(
|
|
299
|
+
(l) => l.tabTitle === d
|
|
299
300
|
);
|
|
300
|
-
return
|
|
301
|
+
return c ? c.id : e[0].id;
|
|
301
302
|
}
|
|
302
303
|
return a;
|
|
303
304
|
}
|
|
304
305
|
}
|
|
305
|
-
return
|
|
306
|
+
return e[0].id;
|
|
306
307
|
}
|
|
307
|
-
async function
|
|
308
|
+
async function Tt(e, a, o, n, i = "Opening library visual...") {
|
|
308
309
|
if (!a || !o)
|
|
309
310
|
throw new Error("Missing auth token or visual ID");
|
|
310
|
-
const
|
|
311
|
-
if (
|
|
312
|
-
return console.log("Using cached visual data for:", o), { data:
|
|
311
|
+
const r = ["resource-by-id", "visual", o], d = n.getQueryData(r);
|
|
312
|
+
if (d)
|
|
313
|
+
return console.log("Using cached visual data for:", o), { data: d, fromCache: !0 };
|
|
313
314
|
console.log("Fetching visual data from network for:", o);
|
|
314
|
-
const
|
|
315
|
+
const c = E.loading(i, {
|
|
315
316
|
position: "top-center"
|
|
316
317
|
});
|
|
317
318
|
try {
|
|
318
319
|
const l = await fetch(
|
|
319
|
-
`${
|
|
320
|
+
`${e}/management/v1/visuals/${o}`,
|
|
320
321
|
{
|
|
321
322
|
headers: {
|
|
322
323
|
Authorization: `Bearer ${a}`
|
|
@@ -326,125 +327,125 @@ async function Ft(t, a, o, s, i = "Opening library visual...") {
|
|
|
326
327
|
if (!l.ok)
|
|
327
328
|
throw new Error("Failed to load visual");
|
|
328
329
|
const u = await l.json();
|
|
329
|
-
return
|
|
330
|
+
return n.setQueryData(r, u), E.dismiss(c), { data: u, fromCache: !1 };
|
|
330
331
|
} catch (l) {
|
|
331
|
-
throw E.dismiss(
|
|
332
|
+
throw E.dismiss(c), l;
|
|
332
333
|
}
|
|
333
334
|
}
|
|
334
|
-
function
|
|
335
|
-
if (typeof
|
|
336
|
-
return JSON.parse(
|
|
337
|
-
if (typeof
|
|
338
|
-
return
|
|
335
|
+
function Gt(e) {
|
|
336
|
+
if (typeof e == "string")
|
|
337
|
+
return JSON.parse(e);
|
|
338
|
+
if (typeof e == "object")
|
|
339
|
+
return e;
|
|
339
340
|
throw new Error("Invalid frame object format");
|
|
340
341
|
}
|
|
341
|
-
function
|
|
342
|
-
var
|
|
343
|
-
const o = (
|
|
342
|
+
function qr(e, a) {
|
|
343
|
+
var r, d;
|
|
344
|
+
const o = (e == null ? void 0 : e.frameObject) ?? ((r = e == null ? void 0 : e.visual) == null ? void 0 : r.frameObject);
|
|
344
345
|
if (!o)
|
|
345
346
|
return !1;
|
|
346
|
-
const
|
|
347
|
-
if (!(
|
|
347
|
+
const n = Gt(o);
|
|
348
|
+
if (!(n != null && n.cards) || n.cards.length === 0)
|
|
348
349
|
return !1;
|
|
349
|
-
const i = (
|
|
350
|
-
(
|
|
350
|
+
const i = (d = n.cards) == null ? void 0 : d.find(
|
|
351
|
+
(c) => c.id === n.activeCardId
|
|
351
352
|
);
|
|
352
|
-
return i ? (
|
|
353
|
+
return i ? (sa({
|
|
353
354
|
...a,
|
|
354
|
-
frame:
|
|
355
|
+
frame: n,
|
|
355
356
|
card: i,
|
|
356
|
-
visualId: (
|
|
357
|
+
visualId: (e == null ? void 0 : e.id) || n.visualId
|
|
357
358
|
}), !0) : !1;
|
|
358
359
|
}
|
|
359
|
-
function
|
|
360
|
-
const
|
|
361
|
-
(
|
|
360
|
+
function Hr() {
|
|
361
|
+
const e = ee(
|
|
362
|
+
(n) => {
|
|
362
363
|
var i;
|
|
363
|
-
return ((i =
|
|
364
|
+
return ((i = n.card.customCardPreferences) == null ? void 0 : i.url) || "";
|
|
364
365
|
}
|
|
365
|
-
), a =
|
|
366
|
-
return { getUpdatedFrame:
|
|
367
|
-
var
|
|
368
|
-
|
|
366
|
+
), a = $r(e);
|
|
367
|
+
return { getUpdatedFrame: Z(() => {
|
|
368
|
+
var g;
|
|
369
|
+
Nr();
|
|
369
370
|
const {
|
|
370
|
-
frame:
|
|
371
|
+
frame: n,
|
|
371
372
|
card: i,
|
|
372
|
-
isDevMode:
|
|
373
|
-
selectedSchemaName:
|
|
374
|
-
selectedDatabaseName:
|
|
373
|
+
isDevMode: r,
|
|
374
|
+
selectedSchemaName: d,
|
|
375
|
+
selectedDatabaseName: c,
|
|
375
376
|
selectedTableName: l,
|
|
376
377
|
selectedConnectionId: u
|
|
377
|
-
} =
|
|
378
|
-
isDevMode:
|
|
378
|
+
} = ee.getState(), h = i.sql, m = (g = a == null ? void 0 : a.getState()) == null ? void 0 : g.settings, p = fr(i, {
|
|
379
|
+
isDevMode: r,
|
|
379
380
|
cardSql: h,
|
|
380
|
-
selectedSchemaName:
|
|
381
|
-
selectedDatabaseName:
|
|
381
|
+
selectedSchemaName: d,
|
|
382
|
+
selectedDatabaseName: c,
|
|
382
383
|
selectedTableName: l,
|
|
383
384
|
selectedConnectionId: u,
|
|
384
385
|
remoteChartSettings: m,
|
|
385
|
-
stripConfig:
|
|
386
|
-
}),
|
|
386
|
+
stripConfig: gr
|
|
387
|
+
}), f = n.cards.map(
|
|
387
388
|
(v) => v.id === i.id ? p : v
|
|
388
389
|
);
|
|
389
390
|
return {
|
|
390
|
-
...
|
|
391
|
-
cards:
|
|
392
|
-
activeCardId:
|
|
391
|
+
...n,
|
|
392
|
+
cards: f,
|
|
393
|
+
activeCardId: Wr(f, n.activeCardId)
|
|
393
394
|
};
|
|
394
395
|
}, [a]) };
|
|
395
396
|
}
|
|
396
397
|
function ye() {
|
|
397
|
-
const { authToken:
|
|
398
|
-
setFrame:
|
|
399
|
-
setCard:
|
|
398
|
+
const { authToken: e, tokenProps: a } = it(), o = Qe(), n = aa(), i = Ke(), { selectVisual: r } = lt(), {
|
|
399
|
+
setFrame: d,
|
|
400
|
+
setCard: c,
|
|
400
401
|
setIsDevMode: l,
|
|
401
402
|
initializeModeDrafts: u,
|
|
402
403
|
setActiveTabCardId: h,
|
|
403
404
|
updateDataSource: m,
|
|
404
405
|
setQueryResultColumns: p,
|
|
405
|
-
setSelectedConnectionId:
|
|
406
|
-
setSelectedDatabaseName:
|
|
406
|
+
setSelectedConnectionId: f,
|
|
407
|
+
setSelectedDatabaseName: g,
|
|
407
408
|
setSelectedSchemaName: v,
|
|
408
|
-
setSelectedTableName:
|
|
409
|
-
setSelectedDatamodelId:
|
|
409
|
+
setSelectedTableName: k,
|
|
410
|
+
setSelectedDatamodelId: V,
|
|
410
411
|
setInlineFilterValuesMap: U,
|
|
411
412
|
setApplyFilters: M,
|
|
412
413
|
clearEditorContext: A
|
|
413
414
|
} = Ge(), {
|
|
414
|
-
setIsDashboardEditing:
|
|
415
|
+
setIsDashboardEditing: O,
|
|
415
416
|
setIsVisualEditing: b,
|
|
416
417
|
clearSelectedFrameId: F
|
|
417
|
-
} =
|
|
418
|
-
(
|
|
419
|
-
),
|
|
420
|
-
enabled: !!(i != null && i.id) && !!(
|
|
421
|
-
}),
|
|
422
|
-
async (
|
|
418
|
+
} = ce(), C = w((L) => L.selectedSheetId), D = w((L) => L.selectedFrameId), N = w((L) => L.dashboard), j = w(
|
|
419
|
+
(L) => L.inlineFilterValuesMap
|
|
420
|
+
), T = ra((i == null ? void 0 : i.id) || "", {
|
|
421
|
+
enabled: !!(i != null && i.id) && !!(e != null && e.accessToken)
|
|
422
|
+
}), z = Z(
|
|
423
|
+
async (L) => {
|
|
423
424
|
try {
|
|
424
|
-
|
|
425
|
-
const { data:
|
|
425
|
+
r(L), F(), A();
|
|
426
|
+
const { data: ae, fromCache: Y } = await Tt(
|
|
426
427
|
a.apiServiceUrl,
|
|
427
|
-
(
|
|
428
|
-
|
|
428
|
+
(e == null ? void 0 : e.accessToken) || "",
|
|
429
|
+
L.id,
|
|
429
430
|
o,
|
|
430
431
|
"Opening library visual..."
|
|
431
432
|
);
|
|
432
|
-
if (!
|
|
433
|
-
setFrame:
|
|
434
|
-
setCard:
|
|
433
|
+
if (!qr(ae, {
|
|
434
|
+
setFrame: d,
|
|
435
|
+
setCard: c,
|
|
435
436
|
setIsDevMode: l,
|
|
436
437
|
initializeModeDrafts: u,
|
|
437
438
|
setActiveTabCardId: h,
|
|
438
439
|
updateDataSource: m,
|
|
439
440
|
setQueryResultColumns: p,
|
|
440
|
-
setSelectedConnectionId:
|
|
441
|
-
setSelectedDatabaseName:
|
|
441
|
+
setSelectedConnectionId: f,
|
|
442
|
+
setSelectedDatabaseName: g,
|
|
442
443
|
setSelectedSchemaName: v,
|
|
443
|
-
setSelectedTableName:
|
|
444
|
-
setSelectedDatamodelId:
|
|
444
|
+
setSelectedTableName: k,
|
|
445
|
+
setSelectedDatamodelId: V,
|
|
445
446
|
setInlineFilterValuesMap: U,
|
|
446
447
|
setApplyFilters: M,
|
|
447
|
-
setIsDashboardEditing:
|
|
448
|
+
setIsDashboardEditing: O,
|
|
448
449
|
setIsVisualEditing: b,
|
|
449
450
|
dashboard: N,
|
|
450
451
|
selectedSheetId: C,
|
|
@@ -453,29 +454,29 @@ function ye() {
|
|
|
453
454
|
}))
|
|
454
455
|
throw new Error("Failed to setup editor with visual data");
|
|
455
456
|
return { success: !0, fromCache: Y };
|
|
456
|
-
} catch (
|
|
457
|
-
return console.error("Error editing visual:",
|
|
457
|
+
} catch (ae) {
|
|
458
|
+
return console.error("Error editing visual:", ae), { success: !1, error: "Failed to load visual for editing" };
|
|
458
459
|
}
|
|
459
460
|
},
|
|
460
461
|
[
|
|
461
|
-
|
|
462
|
+
e == null ? void 0 : e.accessToken,
|
|
462
463
|
a.apiServiceUrl,
|
|
463
464
|
o,
|
|
464
|
-
|
|
465
|
-
c,
|
|
465
|
+
r,
|
|
466
466
|
d,
|
|
467
|
-
|
|
467
|
+
c,
|
|
468
|
+
O,
|
|
468
469
|
b,
|
|
469
470
|
l,
|
|
470
471
|
u,
|
|
471
472
|
h,
|
|
472
473
|
m,
|
|
473
474
|
p,
|
|
474
|
-
g,
|
|
475
475
|
f,
|
|
476
|
+
g,
|
|
476
477
|
v,
|
|
477
|
-
|
|
478
|
-
|
|
478
|
+
k,
|
|
479
|
+
V,
|
|
479
480
|
U,
|
|
480
481
|
M,
|
|
481
482
|
A,
|
|
@@ -485,146 +486,146 @@ function ye() {
|
|
|
485
486
|
D,
|
|
486
487
|
j
|
|
487
488
|
]
|
|
488
|
-
), X =
|
|
489
|
-
async (
|
|
489
|
+
), X = Z(
|
|
490
|
+
async (L) => {
|
|
490
491
|
var Y;
|
|
491
|
-
const
|
|
492
|
+
const ae = (H) => (E.error(H), { success: !1, error: H });
|
|
492
493
|
try {
|
|
493
|
-
if (
|
|
494
|
-
return
|
|
495
|
-
const { data: H, fromCache: he } = await
|
|
494
|
+
if (r(L), !C)
|
|
495
|
+
return ae("No sheet selected. Please select a sheet first.");
|
|
496
|
+
const { data: H, fromCache: he } = await Tt(
|
|
496
497
|
a.apiServiceUrl,
|
|
497
|
-
(
|
|
498
|
-
|
|
498
|
+
(e == null ? void 0 : e.accessToken) || "",
|
|
499
|
+
L.id,
|
|
499
500
|
o,
|
|
500
501
|
"Adding visual to dashboard..."
|
|
501
502
|
), ge = (H == null ? void 0 : H.frameObject) ?? ((Y = H == null ? void 0 : H.visual) == null ? void 0 : Y.frameObject);
|
|
502
503
|
if (!ge)
|
|
503
|
-
return
|
|
504
|
-
const Q =
|
|
504
|
+
return ae("Visual has no frame data");
|
|
505
|
+
const Q = Gt(ge);
|
|
505
506
|
if (!(Q != null && Q.cards) || Q.cards.length === 0)
|
|
506
|
-
return
|
|
507
|
+
return ae("Visual frame is malformed");
|
|
507
508
|
const _ = {
|
|
508
|
-
...
|
|
509
|
-
visualId:
|
|
509
|
+
...na(Q),
|
|
510
|
+
visualId: L.id
|
|
510
511
|
// Link this frame to the library visual
|
|
511
512
|
};
|
|
512
|
-
return await
|
|
513
|
+
return await n(C, _), O(!0), { success: !0, fromCache: he };
|
|
513
514
|
} catch (H) {
|
|
514
|
-
return console.error("Error adding visual:", H),
|
|
515
|
+
return console.error("Error adding visual:", H), ae(
|
|
515
516
|
H instanceof Error ? H.message : "Failed to add visual to dashboard"
|
|
516
517
|
);
|
|
517
518
|
}
|
|
518
519
|
},
|
|
519
520
|
[
|
|
520
|
-
|
|
521
|
+
e == null ? void 0 : e.accessToken,
|
|
521
522
|
a.apiServiceUrl,
|
|
522
523
|
o,
|
|
523
|
-
|
|
524
|
+
r,
|
|
524
525
|
C,
|
|
525
|
-
|
|
526
|
-
|
|
526
|
+
O,
|
|
527
|
+
n
|
|
527
528
|
]
|
|
528
529
|
);
|
|
529
530
|
return {
|
|
530
|
-
visual:
|
|
531
|
-
isLoading:
|
|
532
|
-
isError:
|
|
533
|
-
error:
|
|
534
|
-
handleEditLibraryVisual:
|
|
531
|
+
visual: T.data,
|
|
532
|
+
isLoading: T.isLoading,
|
|
533
|
+
isError: T.isError,
|
|
534
|
+
error: T.error,
|
|
535
|
+
handleEditLibraryVisual: z,
|
|
535
536
|
handleAddLibraryVisual: X,
|
|
536
|
-
getUpdatedFrame:
|
|
537
|
-
refetch:
|
|
537
|
+
getUpdatedFrame: Hr().getUpdatedFrame,
|
|
538
|
+
refetch: T.refetch
|
|
538
539
|
};
|
|
539
540
|
}
|
|
540
|
-
function
|
|
541
|
-
return
|
|
541
|
+
function Xt(e) {
|
|
542
|
+
return e ? new Date(e).toLocaleDateString("en-US", {
|
|
542
543
|
month: "short",
|
|
543
544
|
day: "numeric",
|
|
544
545
|
year: "numeric"
|
|
545
546
|
}) : "Unknown";
|
|
546
547
|
}
|
|
547
|
-
function
|
|
548
|
-
var
|
|
549
|
-
const o = (
|
|
548
|
+
function Yt(e, a) {
|
|
549
|
+
var n;
|
|
550
|
+
const o = (n = e.ownership.createdBy) == null ? void 0 : n.type;
|
|
550
551
|
return o === "tenant" || o === "organization" && a;
|
|
551
552
|
}
|
|
552
|
-
function
|
|
553
|
-
var o,
|
|
554
|
-
return
|
|
553
|
+
function St(e, a) {
|
|
554
|
+
var o, n;
|
|
555
|
+
return Yt(e, a) ? ((o = e.ownership.createdBy) == null ? void 0 : o.name) || ((n = e.createdByTenantUserRel) == null ? void 0 : n.name) || e.lastModifiedBy || "Unknown" : "Organization";
|
|
555
556
|
}
|
|
556
|
-
function
|
|
557
|
-
return
|
|
557
|
+
function Qr(e, a) {
|
|
558
|
+
return St(e, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
|
|
558
559
|
}
|
|
559
|
-
function
|
|
560
|
-
const a = (
|
|
561
|
-
return a.includes("table") ?
|
|
560
|
+
function Kr(e) {
|
|
561
|
+
const a = (e || "").toLowerCase();
|
|
562
|
+
return a.includes("table") ? jt : a.includes("pie") || a.includes("donut") ? ha : a.includes("line") ? ma : a.includes("bar") ? ur : Ee;
|
|
562
563
|
}
|
|
563
|
-
function
|
|
564
|
-
const a =
|
|
565
|
-
return /* @__PURE__ */
|
|
564
|
+
function Gr({ visual: e }) {
|
|
565
|
+
const a = e.ownership.status === "public" ? "Public" : e.ownership.status === "shared" || e.ownership.sharedCount > 0 ? "Shared" : "Private";
|
|
566
|
+
return /* @__PURE__ */ t("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
|
|
566
567
|
}
|
|
567
|
-
function
|
|
568
|
-
open:
|
|
568
|
+
function hs({
|
|
569
|
+
open: e,
|
|
569
570
|
onOpenChange: a
|
|
570
571
|
}) {
|
|
571
|
-
const o = ot("interactive"), [
|
|
572
|
+
const o = ot("interactive"), [n, i] = S(""), [r, d] = S(/* @__PURE__ */ new Set()), [c, l] = S(!1), [u, h] = S(
|
|
572
573
|
null
|
|
573
|
-
), [m, p] =
|
|
574
|
+
), [m, p] = S(
|
|
574
575
|
null
|
|
575
|
-
), [
|
|
576
|
-
|
|
576
|
+
), [f, g] = S(!1), [v, k] = S(null), [V, U] = S(null), M = () => {
|
|
577
|
+
d(/* @__PURE__ */ new Set()), h(null), p(null), g(!1), k(null);
|
|
577
578
|
}, A = () => {
|
|
578
579
|
a(!1), M();
|
|
579
|
-
}, { selectVisual:
|
|
580
|
+
}, { selectVisual: O } = lt(), { handleAddLibraryVisual: b, handleEditLibraryVisual: F } = ye(), { isConsoleMode: C } = oa(), {
|
|
580
581
|
resources: D,
|
|
581
582
|
isLoading: N,
|
|
582
583
|
isError: j,
|
|
583
|
-
createResource:
|
|
584
|
-
updateResource:
|
|
584
|
+
createResource: T,
|
|
585
|
+
updateResource: z,
|
|
585
586
|
deleteResourceAsync: X,
|
|
586
|
-
duplicateResource:
|
|
587
|
-
isCreating:
|
|
587
|
+
duplicateResource: L,
|
|
588
|
+
isCreating: ae,
|
|
588
589
|
isDeleting: Y
|
|
589
|
-
} =
|
|
590
|
+
} = ia(
|
|
590
591
|
void 0,
|
|
591
592
|
(x) => {
|
|
592
|
-
l(!1), x && (
|
|
593
|
+
l(!1), x && (O(x), F(x), A());
|
|
593
594
|
}
|
|
594
595
|
), {
|
|
595
596
|
startUpdating: H,
|
|
596
597
|
stopUpdating: he,
|
|
597
598
|
isUpdating: ge
|
|
598
|
-
} =
|
|
599
|
-
const x =
|
|
599
|
+
} = la(), Q = D, _ = te(() => {
|
|
600
|
+
const x = n.trim().toLowerCase();
|
|
600
601
|
return x ? Q.filter(
|
|
601
602
|
(B) => {
|
|
602
|
-
var q, ie,
|
|
603
|
-
return ((q = B.title) == null ? void 0 : q.toLowerCase().includes(x)) || ((ie = B.description) == null ? void 0 : ie.toLowerCase().includes(x)) || ((
|
|
603
|
+
var q, ie, ue;
|
|
604
|
+
return ((q = B.title) == null ? void 0 : q.toLowerCase().includes(x)) || ((ie = B.description) == null ? void 0 : ie.toLowerCase().includes(x)) || ((ue = B.kind) == null ? void 0 : ue.toLowerCase().includes(x));
|
|
604
605
|
}
|
|
605
606
|
) : Q;
|
|
606
|
-
}, [
|
|
607
|
+
}, [n, Q]), oe = te(
|
|
607
608
|
() => Q.filter(
|
|
608
|
-
(x) =>
|
|
609
|
+
(x) => r.has(x.id)
|
|
609
610
|
),
|
|
610
|
-
[
|
|
611
|
+
[r, Q]
|
|
611
612
|
), me = oe.filter(
|
|
612
613
|
(x) => x.permissions.canDelete
|
|
613
614
|
), pe = oe.filter(
|
|
614
615
|
(x) => x.permissions.canShare
|
|
615
616
|
), Ce = _.length > 0 && _.every(
|
|
616
|
-
(x) =>
|
|
617
|
-
),
|
|
618
|
-
(x) =>
|
|
617
|
+
(x) => r.has(x.id)
|
|
618
|
+
), Me = _.some(
|
|
619
|
+
(x) => r.has(x.id)
|
|
619
620
|
), Ye = (x) => {
|
|
620
|
-
const B = new Set(
|
|
621
|
-
x(B),
|
|
621
|
+
const B = new Set(r);
|
|
622
|
+
x(B), d(B);
|
|
622
623
|
}, $ = (x) => {
|
|
623
624
|
Ye((B) => {
|
|
624
625
|
B.has(x) ? B.delete(x) : B.add(x);
|
|
625
626
|
});
|
|
626
627
|
}, W = () => {
|
|
627
|
-
|
|
628
|
+
d((x) => {
|
|
628
629
|
const B = new Set(x);
|
|
629
630
|
return Ce ? _.forEach(
|
|
630
631
|
(q) => B.delete(q.id)
|
|
@@ -644,29 +645,29 @@ function ts({
|
|
|
644
645
|
break;
|
|
645
646
|
}
|
|
646
647
|
B || A();
|
|
647
|
-
},
|
|
648
|
+
}, Ze = (x) => {
|
|
648
649
|
F(x), A();
|
|
649
650
|
}, be = (x) => {
|
|
650
|
-
U(x),
|
|
651
|
+
U(x), L(x, {
|
|
651
652
|
onSettled: () => U(null)
|
|
652
653
|
});
|
|
653
|
-
},
|
|
654
|
+
}, Ue = () => {
|
|
654
655
|
if (me.length === 0) {
|
|
655
656
|
E.error("Select a visual you can delete");
|
|
656
657
|
return;
|
|
657
658
|
}
|
|
658
|
-
|
|
659
|
-
},
|
|
659
|
+
k(null), g(!0);
|
|
660
|
+
}, Je = async () => {
|
|
660
661
|
const x = v ? [v] : me;
|
|
661
662
|
try {
|
|
662
663
|
for (const B of x)
|
|
663
664
|
await X(B.id);
|
|
664
|
-
|
|
665
|
+
d((B) => {
|
|
665
666
|
const q = new Set(B);
|
|
666
667
|
return x.forEach(
|
|
667
668
|
(ie) => q.delete(ie.id)
|
|
668
669
|
), q;
|
|
669
|
-
}),
|
|
670
|
+
}), g(!1), k(null);
|
|
670
671
|
} catch {
|
|
671
672
|
}
|
|
672
673
|
}, Ne = () => {
|
|
@@ -690,41 +691,41 @@ function ts({
|
|
|
690
691
|
p(null);
|
|
691
692
|
return;
|
|
692
693
|
}
|
|
693
|
-
const ie = Object.keys(q),
|
|
694
|
-
H(m.id,
|
|
694
|
+
const ie = Object.keys(q), ue = ie.length === 1 ? ie[0] : void 0;
|
|
695
|
+
H(m.id, ue), z(
|
|
695
696
|
{
|
|
696
697
|
resourceId: m.id,
|
|
697
698
|
data: q
|
|
698
699
|
},
|
|
699
700
|
{
|
|
700
701
|
onSuccess: () => {
|
|
701
|
-
he(m.id,
|
|
702
|
+
he(m.id, ue), p(null);
|
|
702
703
|
},
|
|
703
704
|
onError: () => {
|
|
704
|
-
he(m.id,
|
|
705
|
+
he(m.id, ue);
|
|
705
706
|
}
|
|
706
707
|
}
|
|
707
708
|
);
|
|
708
709
|
}, se = (x) => {
|
|
709
710
|
a(x), x || M();
|
|
710
711
|
}, ke = v ? 1 : me.length;
|
|
711
|
-
return /* @__PURE__ */
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
|
|
712
|
+
return /* @__PURE__ */ s(R, { children: [
|
|
713
|
+
/* @__PURE__ */ t(Ie, { open: e, onOpenChange: se, children: /* @__PURE__ */ s(
|
|
714
|
+
Te,
|
|
714
715
|
{
|
|
715
716
|
showCloseButton: !1,
|
|
716
717
|
className: "flex max-h-[80vh] w-[min(72rem,calc(100vw-2rem))] max-w-none grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
|
|
717
718
|
style: o.dialogStyle,
|
|
718
719
|
children: [
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
/* @__PURE__ */
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
721
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
722
|
+
/* @__PURE__ */ t(jt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
723
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
724
|
+
/* @__PURE__ */ t(Le, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
|
|
725
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
|
|
725
726
|
] })
|
|
726
727
|
] }),
|
|
727
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ t(
|
|
728
729
|
I,
|
|
729
730
|
{
|
|
730
731
|
size: "xs",
|
|
@@ -736,14 +737,14 @@ function ts({
|
|
|
736
737
|
}
|
|
737
738
|
)
|
|
738
739
|
] }),
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
742
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
|
|
741
|
+
/* @__PURE__ */ s("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
|
|
742
|
+
/* @__PURE__ */ t(pr, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
743
|
+
/* @__PURE__ */ t(
|
|
743
744
|
"input",
|
|
744
745
|
{
|
|
745
746
|
autoFocus: !0,
|
|
746
|
-
value:
|
|
747
|
+
value: n,
|
|
747
748
|
onChange: (x) => i(x.target.value),
|
|
748
749
|
placeholder: "Search visuals...",
|
|
749
750
|
className: "h-7 w-full rounded-control border border-input bg-background pl-7 pr-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-ring focus:outline-none",
|
|
@@ -751,7 +752,7 @@ function ts({
|
|
|
751
752
|
}
|
|
752
753
|
)
|
|
753
754
|
] }),
|
|
754
|
-
/* @__PURE__ */
|
|
755
|
+
/* @__PURE__ */ s(
|
|
755
756
|
I,
|
|
756
757
|
{
|
|
757
758
|
size: "xs",
|
|
@@ -759,55 +760,55 @@ function ts({
|
|
|
759
760
|
className: "ml-auto",
|
|
760
761
|
onClick: () => l(!0),
|
|
761
762
|
children: [
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ t(ve, { className: "h-3.5 w-3.5" }),
|
|
763
764
|
"New library visual"
|
|
764
765
|
]
|
|
765
766
|
}
|
|
766
767
|
)
|
|
767
768
|
] }),
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */
|
|
772
|
-
] }) : /* @__PURE__ */
|
|
773
|
-
|
|
769
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: N ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(_r, {}) }) : j ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ t("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : _.length === 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
770
|
+
/* @__PURE__ */ t(Ee, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
771
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
|
|
772
|
+
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
|
|
773
|
+
] }) : /* @__PURE__ */ t(
|
|
774
|
+
Xr,
|
|
774
775
|
{
|
|
775
776
|
visuals: _,
|
|
776
|
-
selectedIds:
|
|
777
|
+
selectedIds: r,
|
|
777
778
|
allFilteredSelected: Ce,
|
|
778
|
-
someFilteredSelected:
|
|
779
|
+
someFilteredSelected: Me,
|
|
779
780
|
onSelectAll: W,
|
|
780
781
|
onToggleSelection: $,
|
|
781
782
|
onAddVisual: ne,
|
|
782
|
-
onOpenVisual:
|
|
783
|
+
onOpenVisual: Ze,
|
|
783
784
|
onEditDetails: p,
|
|
784
785
|
onShareVisual: h,
|
|
785
786
|
onDeleteVisual: (x) => {
|
|
786
|
-
|
|
787
|
+
k(x), g(!0);
|
|
787
788
|
},
|
|
788
789
|
onDuplicateVisual: be,
|
|
789
|
-
duplicatingId:
|
|
790
|
+
duplicatingId: V,
|
|
790
791
|
isDeleting: Y,
|
|
791
792
|
isConsoleMode: C
|
|
792
793
|
}
|
|
793
794
|
) }),
|
|
794
|
-
/* @__PURE__ */
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ s("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
|
|
796
|
+
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: r.size > 0 && /* @__PURE__ */ s(R, { children: [
|
|
797
|
+
/* @__PURE__ */ s("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
798
|
+
/* @__PURE__ */ t("span", { className: "font-medium tabular-nums text-foreground", children: r.size }),
|
|
798
799
|
" ",
|
|
799
800
|
"selected"
|
|
800
801
|
] }),
|
|
801
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ t(
|
|
802
803
|
I,
|
|
803
804
|
{
|
|
804
805
|
size: "xs",
|
|
805
806
|
variant: "ghost",
|
|
806
|
-
onClick: () =>
|
|
807
|
+
onClick: () => d(/* @__PURE__ */ new Set()),
|
|
807
808
|
children: "Clear"
|
|
808
809
|
}
|
|
809
810
|
),
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ s(
|
|
811
812
|
I,
|
|
812
813
|
{
|
|
813
814
|
size: "xs",
|
|
@@ -815,29 +816,29 @@ function ts({
|
|
|
815
816
|
onClick: Ne,
|
|
816
817
|
disabled: oe.length !== 1 || pe.length !== 1,
|
|
817
818
|
children: [
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
+
/* @__PURE__ */ t(Pt, { className: "h-3.5 w-3.5" }),
|
|
819
820
|
"Share"
|
|
820
821
|
]
|
|
821
822
|
}
|
|
822
823
|
),
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
+
/* @__PURE__ */ s(
|
|
824
825
|
I,
|
|
825
826
|
{
|
|
826
827
|
size: "xs",
|
|
827
828
|
variant: "outline",
|
|
828
829
|
className: "text-destructive hover:text-destructive",
|
|
829
|
-
onClick:
|
|
830
|
+
onClick: Ue,
|
|
830
831
|
disabled: me.length === 0,
|
|
831
832
|
children: [
|
|
832
|
-
/* @__PURE__ */ e
|
|
833
|
+
/* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
|
|
833
834
|
"Delete ",
|
|
834
|
-
me.length ||
|
|
835
|
+
me.length || r.size
|
|
835
836
|
]
|
|
836
837
|
}
|
|
837
838
|
)
|
|
838
839
|
] }) }),
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
/* @__PURE__ */
|
|
840
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
841
|
+
/* @__PURE__ */ t(
|
|
841
842
|
I,
|
|
842
843
|
{
|
|
843
844
|
size: "xs",
|
|
@@ -846,15 +847,15 @@ function ts({
|
|
|
846
847
|
children: "Close"
|
|
847
848
|
}
|
|
848
849
|
),
|
|
849
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ s(
|
|
850
851
|
I,
|
|
851
852
|
{
|
|
852
853
|
size: "xs",
|
|
853
854
|
onClick: we,
|
|
854
|
-
disabled:
|
|
855
|
+
disabled: r.size === 0,
|
|
855
856
|
children: [
|
|
856
|
-
/* @__PURE__ */
|
|
857
|
-
|
|
857
|
+
/* @__PURE__ */ t(Ct, { className: "h-3.5 w-3.5" }),
|
|
858
|
+
r.size === 0 ? "Add to dashboard" : `Add ${r.size} visual${r.size === 1 ? "" : "s"}`
|
|
858
859
|
]
|
|
859
860
|
}
|
|
860
861
|
)
|
|
@@ -863,25 +864,25 @@ function ts({
|
|
|
863
864
|
]
|
|
864
865
|
}
|
|
865
866
|
) }),
|
|
866
|
-
/* @__PURE__ */
|
|
867
|
-
|
|
867
|
+
/* @__PURE__ */ t(
|
|
868
|
+
jr,
|
|
868
869
|
{
|
|
869
|
-
open:
|
|
870
|
+
open: c,
|
|
870
871
|
onOpenChange: l,
|
|
871
|
-
onSubmit:
|
|
872
|
-
isCreating:
|
|
872
|
+
onSubmit: T,
|
|
873
|
+
isCreating: ae
|
|
873
874
|
}
|
|
874
875
|
),
|
|
875
|
-
u && /* @__PURE__ */
|
|
876
|
-
|
|
876
|
+
u && /* @__PURE__ */ t(
|
|
877
|
+
da,
|
|
877
878
|
{
|
|
878
879
|
resource: u,
|
|
879
|
-
resourceType:
|
|
880
|
+
resourceType: ca.VISUAL,
|
|
880
881
|
onClose: () => h(null)
|
|
881
882
|
}
|
|
882
883
|
),
|
|
883
|
-
m && /* @__PURE__ */
|
|
884
|
-
|
|
884
|
+
m && /* @__PURE__ */ t(
|
|
885
|
+
ua,
|
|
885
886
|
{
|
|
886
887
|
open: !!m,
|
|
887
888
|
resourceLabel: "Visual",
|
|
@@ -892,35 +893,35 @@ function ts({
|
|
|
892
893
|
isSaving: ge(m.id)
|
|
893
894
|
}
|
|
894
895
|
),
|
|
895
|
-
/* @__PURE__ */
|
|
896
|
-
|
|
896
|
+
/* @__PURE__ */ t(
|
|
897
|
+
dt,
|
|
897
898
|
{
|
|
898
|
-
open:
|
|
899
|
+
open: f,
|
|
899
900
|
onOpenChange: (x) => {
|
|
900
|
-
!x && Y || (
|
|
901
|
+
!x && Y || (g(x), x || k(null));
|
|
901
902
|
},
|
|
902
|
-
children: /* @__PURE__ */
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
903
|
+
children: /* @__PURE__ */ s(ct, { children: [
|
|
904
|
+
/* @__PURE__ */ s(ut, { children: [
|
|
905
|
+
/* @__PURE__ */ s(ht, { children: [
|
|
905
906
|
"Delete ",
|
|
906
907
|
ke,
|
|
907
908
|
" visual",
|
|
908
909
|
ke === 1 ? "" : "s",
|
|
909
910
|
"?"
|
|
910
911
|
] }),
|
|
911
|
-
/* @__PURE__ */
|
|
912
|
+
/* @__PURE__ */ t(mt, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
912
913
|
] }),
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
|
|
914
|
+
/* @__PURE__ */ s(pt, { children: [
|
|
915
|
+
/* @__PURE__ */ t(ft, { disabled: Y, children: "Cancel" }),
|
|
916
|
+
/* @__PURE__ */ s(
|
|
917
|
+
Mt,
|
|
917
918
|
{
|
|
918
919
|
onClick: (x) => {
|
|
919
|
-
x.preventDefault(),
|
|
920
|
+
x.preventDefault(), Je();
|
|
920
921
|
},
|
|
921
922
|
disabled: Y || ke === 0,
|
|
922
923
|
children: [
|
|
923
|
-
Y ? /* @__PURE__ */
|
|
924
|
+
Y ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
|
|
924
925
|
Y ? "Deleting..." : "Delete"
|
|
925
926
|
]
|
|
926
927
|
}
|
|
@@ -931,79 +932,79 @@ function ts({
|
|
|
931
932
|
)
|
|
932
933
|
] });
|
|
933
934
|
}
|
|
934
|
-
function
|
|
935
|
-
visuals:
|
|
935
|
+
function Xr({
|
|
936
|
+
visuals: e,
|
|
936
937
|
selectedIds: a,
|
|
937
938
|
allFilteredSelected: o,
|
|
938
|
-
someFilteredSelected:
|
|
939
|
+
someFilteredSelected: n,
|
|
939
940
|
onSelectAll: i,
|
|
940
|
-
onToggleSelection:
|
|
941
|
-
onAddVisual:
|
|
942
|
-
onOpenVisual:
|
|
941
|
+
onToggleSelection: r,
|
|
942
|
+
onAddVisual: d,
|
|
943
|
+
onOpenVisual: c,
|
|
943
944
|
onEditDetails: l,
|
|
944
945
|
onShareVisual: u,
|
|
945
946
|
onDeleteVisual: h,
|
|
946
947
|
onDuplicateVisual: m,
|
|
947
948
|
duplicatingId: p,
|
|
948
|
-
isDeleting:
|
|
949
|
-
isConsoleMode:
|
|
949
|
+
isDeleting: f,
|
|
950
|
+
isConsoleMode: g
|
|
950
951
|
}) {
|
|
951
|
-
return /* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
/* @__PURE__ */
|
|
954
|
-
|
|
952
|
+
return /* @__PURE__ */ s("div", { className: "min-w-[48rem]", children: [
|
|
953
|
+
/* @__PURE__ */ s("div", { className: "grid h-9 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/60 px-3 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: [
|
|
954
|
+
/* @__PURE__ */ t(
|
|
955
|
+
gt,
|
|
955
956
|
{
|
|
956
|
-
checked: o ? !0 :
|
|
957
|
+
checked: o ? !0 : n ? "indeterminate" : !1,
|
|
957
958
|
onCheckedChange: i,
|
|
958
959
|
"aria-label": "Select all visuals"
|
|
959
960
|
}
|
|
960
961
|
),
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
/* @__PURE__ */
|
|
963
|
-
/* @__PURE__ */
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ t("span", { children: "Name" }),
|
|
963
|
+
/* @__PURE__ */ t("span", { children: "Created by" }),
|
|
964
|
+
/* @__PURE__ */ t("span", { children: "Updated" }),
|
|
965
|
+
/* @__PURE__ */ t("span", { children: "Visibility" }),
|
|
966
|
+
/* @__PURE__ */ t("span", { className: "text-right", children: "Shared" }),
|
|
967
|
+
/* @__PURE__ */ t("span", { className: "text-right", children: "Actions" })
|
|
967
968
|
] }),
|
|
968
|
-
|
|
969
|
-
|
|
969
|
+
e.map((v) => /* @__PURE__ */ t(
|
|
970
|
+
Yr,
|
|
970
971
|
{
|
|
971
972
|
visual: v,
|
|
972
973
|
selected: a.has(v.id),
|
|
973
|
-
onToggleSelection:
|
|
974
|
-
onAddVisual:
|
|
975
|
-
onOpenVisual:
|
|
974
|
+
onToggleSelection: r,
|
|
975
|
+
onAddVisual: d,
|
|
976
|
+
onOpenVisual: c,
|
|
976
977
|
onEditDetails: l,
|
|
977
978
|
onShareVisual: u,
|
|
978
979
|
onDeleteVisual: h,
|
|
979
980
|
onDuplicateVisual: m,
|
|
980
981
|
duplicatingId: p,
|
|
981
|
-
isDeleting:
|
|
982
|
-
isConsoleMode:
|
|
982
|
+
isDeleting: f,
|
|
983
|
+
isConsoleMode: g
|
|
983
984
|
},
|
|
984
985
|
v.id
|
|
985
986
|
))
|
|
986
987
|
] });
|
|
987
988
|
}
|
|
988
|
-
function
|
|
989
|
-
visual:
|
|
989
|
+
function Yr({
|
|
990
|
+
visual: e,
|
|
990
991
|
selected: a,
|
|
991
992
|
onToggleSelection: o,
|
|
992
|
-
onAddVisual:
|
|
993
|
+
onAddVisual: n,
|
|
993
994
|
onOpenVisual: i,
|
|
994
|
-
onEditDetails:
|
|
995
|
-
onShareVisual:
|
|
996
|
-
onDeleteVisual:
|
|
995
|
+
onEditDetails: r,
|
|
996
|
+
onShareVisual: d,
|
|
997
|
+
onDeleteVisual: c,
|
|
997
998
|
onDuplicateVisual: l,
|
|
998
999
|
duplicatingId: u,
|
|
999
1000
|
isDeleting: h,
|
|
1000
1001
|
isConsoleMode: m
|
|
1001
1002
|
}) {
|
|
1002
|
-
var
|
|
1003
|
-
const p =
|
|
1004
|
-
|
|
1003
|
+
var g;
|
|
1004
|
+
const p = Kr(e.kind), f = () => {
|
|
1005
|
+
n(e);
|
|
1005
1006
|
};
|
|
1006
|
-
return /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ s(
|
|
1007
1008
|
"div",
|
|
1008
1009
|
{
|
|
1009
1010
|
className: J(
|
|
@@ -1011,59 +1012,59 @@ function Or({
|
|
|
1011
1012
|
a && "bg-muted/70"
|
|
1012
1013
|
),
|
|
1013
1014
|
children: [
|
|
1014
|
-
/* @__PURE__ */
|
|
1015
|
-
|
|
1015
|
+
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
1016
|
+
gt,
|
|
1016
1017
|
{
|
|
1017
1018
|
checked: a,
|
|
1018
|
-
onCheckedChange: () => o(
|
|
1019
|
-
"aria-label": `Select ${
|
|
1019
|
+
onCheckedChange: () => o(e.id),
|
|
1020
|
+
"aria-label": `Select ${e.title || "visual"}`
|
|
1020
1021
|
}
|
|
1021
1022
|
) }),
|
|
1022
|
-
/* @__PURE__ */
|
|
1023
|
+
/* @__PURE__ */ s(
|
|
1023
1024
|
"button",
|
|
1024
1025
|
{
|
|
1025
1026
|
type: "button",
|
|
1026
1027
|
className: "flex min-w-0 items-center gap-2 rounded-[4px] text-left outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1027
|
-
onClick:
|
|
1028
|
-
"aria-label": `Add ${
|
|
1028
|
+
onClick: f,
|
|
1029
|
+
"aria-label": `Add ${e.title || "visual"} to dashboard`,
|
|
1029
1030
|
children: [
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1031
|
+
/* @__PURE__ */ t(p, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
1032
|
+
/* @__PURE__ */ s("div", { className: "min-w-0", children: [
|
|
1033
|
+
/* @__PURE__ */ t(
|
|
1033
1034
|
"div",
|
|
1034
1035
|
{
|
|
1035
1036
|
className: "truncate font-medium text-foreground",
|
|
1036
|
-
title:
|
|
1037
|
-
children:
|
|
1037
|
+
title: e.title || "Untitled Visual",
|
|
1038
|
+
children: e.title || "Untitled Visual"
|
|
1038
1039
|
}
|
|
1039
1040
|
),
|
|
1040
|
-
((
|
|
1041
|
+
((g = e.description) == null ? void 0 : g.trim()) && /* @__PURE__ */ t(
|
|
1041
1042
|
"div",
|
|
1042
1043
|
{
|
|
1043
1044
|
className: "truncate text-[11px] text-muted-foreground",
|
|
1044
|
-
title:
|
|
1045
|
-
children:
|
|
1045
|
+
title: e.description,
|
|
1046
|
+
children: e.description
|
|
1046
1047
|
}
|
|
1047
1048
|
)
|
|
1048
1049
|
] })
|
|
1049
1050
|
]
|
|
1050
1051
|
}
|
|
1051
1052
|
),
|
|
1052
|
-
/* @__PURE__ */
|
|
1053
|
-
/* @__PURE__ */
|
|
1054
|
-
/* @__PURE__ */
|
|
1053
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
1054
|
+
/* @__PURE__ */ t("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Qr(e, m) }),
|
|
1055
|
+
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: St(e, m) })
|
|
1055
1056
|
] }),
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
/* @__PURE__ */
|
|
1058
|
-
/* @__PURE__ */
|
|
1059
|
-
/* @__PURE__ */
|
|
1060
|
-
|
|
1057
|
+
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: Xt(e.updatedAt) }),
|
|
1058
|
+
/* @__PURE__ */ t(Gr, { visual: e }),
|
|
1059
|
+
/* @__PURE__ */ t("span", { className: "text-right tabular-nums text-muted-foreground", children: e.ownership.sharedCount > 0 ? e.ownership.sharedCount : "—" }),
|
|
1060
|
+
/* @__PURE__ */ t(
|
|
1061
|
+
Zr,
|
|
1061
1062
|
{
|
|
1062
|
-
visual:
|
|
1063
|
+
visual: e,
|
|
1063
1064
|
onOpenVisual: i,
|
|
1064
|
-
onEditDetails:
|
|
1065
|
-
onShareVisual:
|
|
1066
|
-
onDeleteVisual:
|
|
1065
|
+
onEditDetails: r,
|
|
1066
|
+
onShareVisual: d,
|
|
1067
|
+
onDeleteVisual: c,
|
|
1067
1068
|
onDuplicateVisual: l,
|
|
1068
1069
|
duplicatingId: u,
|
|
1069
1070
|
isDeleting: h,
|
|
@@ -1074,98 +1075,98 @@ function Or({
|
|
|
1074
1075
|
}
|
|
1075
1076
|
);
|
|
1076
1077
|
}
|
|
1077
|
-
function
|
|
1078
|
-
visual:
|
|
1078
|
+
function Zr({
|
|
1079
|
+
visual: e,
|
|
1079
1080
|
onOpenVisual: a,
|
|
1080
1081
|
onEditDetails: o,
|
|
1081
|
-
onShareVisual:
|
|
1082
|
+
onShareVisual: n,
|
|
1082
1083
|
onDeleteVisual: i,
|
|
1083
|
-
onDuplicateVisual:
|
|
1084
|
-
duplicatingId:
|
|
1085
|
-
isDeleting:
|
|
1084
|
+
onDuplicateVisual: r,
|
|
1085
|
+
duplicatingId: d,
|
|
1086
|
+
isDeleting: c,
|
|
1086
1087
|
isConsoleMode: l
|
|
1087
1088
|
}) {
|
|
1088
|
-
return /* @__PURE__ */
|
|
1089
|
+
return /* @__PURE__ */ s(
|
|
1089
1090
|
"div",
|
|
1090
1091
|
{
|
|
1091
1092
|
className: "flex items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
|
|
1092
1093
|
onClick: (u) => u.stopPropagation(),
|
|
1093
1094
|
children: [
|
|
1094
|
-
/* @__PURE__ */
|
|
1095
|
+
/* @__PURE__ */ t(
|
|
1095
1096
|
I,
|
|
1096
1097
|
{
|
|
1097
1098
|
size: "xs",
|
|
1098
1099
|
variant: "ghost",
|
|
1099
1100
|
className: "w-7 px-0",
|
|
1100
|
-
onClick: () => a(
|
|
1101
|
+
onClick: () => a(e),
|
|
1101
1102
|
"aria-label": "Edit visual",
|
|
1102
|
-
children: /* @__PURE__ */
|
|
1103
|
+
children: /* @__PURE__ */ t(et, { className: "h-3.5 w-3.5" })
|
|
1103
1104
|
}
|
|
1104
1105
|
),
|
|
1105
|
-
/* @__PURE__ */
|
|
1106
|
-
/* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ s(Ve, { modal: !1, children: [
|
|
1107
|
+
/* @__PURE__ */ t(Be, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1107
1108
|
I,
|
|
1108
1109
|
{
|
|
1109
1110
|
size: "xs",
|
|
1110
1111
|
variant: "ghost",
|
|
1111
1112
|
className: "w-7 px-0",
|
|
1112
1113
|
"aria-label": "More actions",
|
|
1113
|
-
children: /* @__PURE__ */
|
|
1114
|
+
children: /* @__PURE__ */ t(Ut, { className: "h-3.5 w-3.5" })
|
|
1114
1115
|
}
|
|
1115
1116
|
) }),
|
|
1116
|
-
/* @__PURE__ */
|
|
1117
|
-
|
|
1117
|
+
/* @__PURE__ */ s(
|
|
1118
|
+
Pe,
|
|
1118
1119
|
{
|
|
1119
1120
|
align: "end",
|
|
1120
1121
|
className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
1121
1122
|
children: [
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
/* @__PURE__ */
|
|
1123
|
+
/* @__PURE__ */ s(G, { onClick: () => a(e), children: [
|
|
1124
|
+
/* @__PURE__ */ t(et, { className: "h-3.5 w-3.5" }),
|
|
1124
1125
|
"Edit visual"
|
|
1125
1126
|
] }),
|
|
1126
|
-
/* @__PURE__ */
|
|
1127
|
+
/* @__PURE__ */ s(
|
|
1127
1128
|
G,
|
|
1128
1129
|
{
|
|
1129
|
-
onClick: () =>
|
|
1130
|
-
disabled:
|
|
1130
|
+
onClick: () => r(e.id),
|
|
1131
|
+
disabled: d === e.id,
|
|
1131
1132
|
children: [
|
|
1132
|
-
|
|
1133
|
-
|
|
1133
|
+
d === e.id ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(pa, { className: "h-3.5 w-3.5" }),
|
|
1134
|
+
d === e.id ? "Duplicating..." : "Duplicate"
|
|
1134
1135
|
]
|
|
1135
1136
|
}
|
|
1136
1137
|
),
|
|
1137
|
-
|
|
1138
|
-
/* @__PURE__ */
|
|
1138
|
+
e.permissions.canEdit && /* @__PURE__ */ s(G, { onClick: () => o(e), children: [
|
|
1139
|
+
/* @__PURE__ */ t(et, { className: "h-3.5 w-3.5" }),
|
|
1139
1140
|
"Edit details"
|
|
1140
1141
|
] }),
|
|
1141
|
-
|
|
1142
|
-
/* @__PURE__ */
|
|
1142
|
+
e.permissions.canShare && /* @__PURE__ */ s(G, { onClick: () => n(e), children: [
|
|
1143
|
+
/* @__PURE__ */ t(Pt, { className: "h-3.5 w-3.5" }),
|
|
1143
1144
|
"Share"
|
|
1144
1145
|
] }),
|
|
1145
|
-
|
|
1146
|
-
/* @__PURE__ */
|
|
1147
|
-
/* @__PURE__ */
|
|
1146
|
+
e.permissions.canDelete && /* @__PURE__ */ s(R, { children: [
|
|
1147
|
+
/* @__PURE__ */ t(We, {}),
|
|
1148
|
+
/* @__PURE__ */ s(
|
|
1148
1149
|
G,
|
|
1149
1150
|
{
|
|
1150
1151
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
1151
|
-
onClick: () => i(
|
|
1152
|
-
disabled:
|
|
1152
|
+
onClick: () => i(e),
|
|
1153
|
+
disabled: c,
|
|
1153
1154
|
children: [
|
|
1154
|
-
/* @__PURE__ */ e
|
|
1155
|
-
|
|
1155
|
+
/* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
|
|
1156
|
+
c ? "Deleting..." : "Delete"
|
|
1156
1157
|
]
|
|
1157
1158
|
}
|
|
1158
1159
|
)
|
|
1159
1160
|
] }),
|
|
1160
|
-
/* @__PURE__ */
|
|
1161
|
-
/* @__PURE__ */
|
|
1162
|
-
|
|
1163
|
-
/* @__PURE__ */
|
|
1164
|
-
/* @__PURE__ */
|
|
1161
|
+
/* @__PURE__ */ t(We, {}),
|
|
1162
|
+
/* @__PURE__ */ s("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
1163
|
+
Yt(e, l) && /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
|
|
1164
|
+
/* @__PURE__ */ t(fa, { className: "h-3 w-3" }),
|
|
1165
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: St(e, l) })
|
|
1165
1166
|
] }),
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
1168
|
-
/* @__PURE__ */
|
|
1167
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
|
|
1168
|
+
/* @__PURE__ */ t(ga, { className: "h-3 w-3" }),
|
|
1169
|
+
/* @__PURE__ */ t("span", { children: Xt(e.updatedAt) })
|
|
1169
1170
|
] })
|
|
1170
1171
|
] })
|
|
1171
1172
|
]
|
|
@@ -1176,69 +1177,69 @@ function _r({
|
|
|
1176
1177
|
}
|
|
1177
1178
|
);
|
|
1178
1179
|
}
|
|
1179
|
-
function
|
|
1180
|
-
const
|
|
1180
|
+
function ms(e, a, o = !1) {
|
|
1181
|
+
const n = w((u) => u.dashboard), i = w(
|
|
1181
1182
|
(u) => u.isDashboardEditing
|
|
1182
|
-
),
|
|
1183
|
+
), r = w(
|
|
1183
1184
|
(u) => u.onDashboardLifecycleEvent
|
|
1184
|
-
),
|
|
1185
|
+
), d = Z(() => {
|
|
1185
1186
|
const u = w.getState().dashboard;
|
|
1186
|
-
return a || !
|
|
1187
|
-
}, [
|
|
1188
|
-
|
|
1189
|
-
w.getState().checkUnsavedDashboardChanges ===
|
|
1190
|
-
}), [
|
|
1191
|
-
const
|
|
1192
|
-
dashboardId:
|
|
1193
|
-
dirty: i &&
|
|
1187
|
+
return a || !e || !u || u.id !== e.id ? !1 : _e(u) !== _e(e);
|
|
1188
|
+
}, [e, a]);
|
|
1189
|
+
Dt(() => (w.setState({ checkUnsavedDashboardChanges: d }), () => {
|
|
1190
|
+
w.getState().checkUnsavedDashboardChanges === d && w.setState({ checkUnsavedDashboardChanges: null });
|
|
1191
|
+
}), [d]);
|
|
1192
|
+
const c = te(() => !o || a || !n || i && (!e || n.id !== e.id) ? null : {
|
|
1193
|
+
dashboardId: n.id,
|
|
1194
|
+
dirty: i && e ? _e(n) !== _e(e) : !1
|
|
1194
1195
|
}, [
|
|
1195
1196
|
i,
|
|
1196
1197
|
a,
|
|
1197
1198
|
o,
|
|
1198
|
-
|
|
1199
|
-
|
|
1199
|
+
e,
|
|
1200
|
+
n
|
|
1200
1201
|
]), l = nt(null);
|
|
1201
|
-
return
|
|
1202
|
-
if (!
|
|
1202
|
+
return Dt(() => {
|
|
1203
|
+
if (!r || !c) {
|
|
1203
1204
|
l.current = null;
|
|
1204
1205
|
return;
|
|
1205
1206
|
}
|
|
1206
1207
|
const u = l.current;
|
|
1207
|
-
(u == null ? void 0 : u.callback) ===
|
|
1208
|
-
callback:
|
|
1209
|
-
dashboardId:
|
|
1210
|
-
dirty:
|
|
1211
|
-
},
|
|
1208
|
+
(u == null ? void 0 : u.callback) === r && u.dashboardId === c.dashboardId && u.dirty === c.dirty || (l.current = {
|
|
1209
|
+
callback: r,
|
|
1210
|
+
dashboardId: c.dashboardId,
|
|
1211
|
+
dirty: c.dirty
|
|
1212
|
+
}, r({
|
|
1212
1213
|
type: "dashboard:dirty-state",
|
|
1213
|
-
dashboardId:
|
|
1214
|
-
payload: { dirty:
|
|
1214
|
+
dashboardId: c.dashboardId,
|
|
1215
|
+
payload: { dirty: c.dirty }
|
|
1215
1216
|
}));
|
|
1216
|
-
}, [
|
|
1217
|
+
}, [c, r]), d;
|
|
1217
1218
|
}
|
|
1218
|
-
function
|
|
1219
|
-
open:
|
|
1219
|
+
function Jr({
|
|
1220
|
+
open: e,
|
|
1220
1221
|
onOpenChange: a,
|
|
1221
1222
|
isLibraryVisual: o,
|
|
1222
|
-
currentVisualName:
|
|
1223
|
+
currentVisualName: n,
|
|
1223
1224
|
isSaving: i = !1,
|
|
1224
|
-
destinationMode:
|
|
1225
|
-
onConfirm:
|
|
1225
|
+
destinationMode: r = "both",
|
|
1226
|
+
onConfirm: d
|
|
1226
1227
|
}) {
|
|
1227
|
-
const [
|
|
1228
|
-
o &&
|
|
1229
|
-
), [u, h] =
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
o &&
|
|
1228
|
+
const [c, l] = S(
|
|
1229
|
+
o && n ? `Copy of ${n}` : n || ""
|
|
1230
|
+
), [u, h] = S("");
|
|
1231
|
+
Vt.useEffect(() => {
|
|
1232
|
+
e && (l(
|
|
1233
|
+
o && n ? `Copy of ${n}` : n || ""
|
|
1233
1234
|
), h(""));
|
|
1234
|
-
}, [
|
|
1235
|
-
const m = !!
|
|
1235
|
+
}, [e, o, n]);
|
|
1236
|
+
const m = !!c.trim(), p = r === "local" ? {
|
|
1236
1237
|
saveToLibrary: !1,
|
|
1237
1238
|
saveToCurrentDashboard: !0,
|
|
1238
1239
|
badgeType: "local",
|
|
1239
1240
|
description: "Creates a local copy on the current dashboard.",
|
|
1240
1241
|
actionLabel: "Add to Dashboard (Local)"
|
|
1241
|
-
} :
|
|
1242
|
+
} : r === "library" ? {
|
|
1242
1243
|
saveToLibrary: !0,
|
|
1243
1244
|
saveToCurrentDashboard: !1,
|
|
1244
1245
|
badgeType: "library",
|
|
@@ -1250,20 +1251,20 @@ function jr({
|
|
|
1250
1251
|
badgeType: "linked",
|
|
1251
1252
|
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
1252
1253
|
actionLabel: "Save Copy as Linked Visual"
|
|
1253
|
-
},
|
|
1254
|
-
!m || i ||
|
|
1255
|
-
name:
|
|
1254
|
+
}, f = () => {
|
|
1255
|
+
!m || i || d({
|
|
1256
|
+
name: c.trim(),
|
|
1256
1257
|
description: u.trim() || void 0,
|
|
1257
1258
|
saveToLibrary: p.saveToLibrary,
|
|
1258
1259
|
saveToCurrentDashboard: p.saveToCurrentDashboard
|
|
1259
1260
|
});
|
|
1260
1261
|
};
|
|
1261
|
-
return /* @__PURE__ */
|
|
1262
|
-
/* @__PURE__ */
|
|
1263
|
-
/* @__PURE__ */
|
|
1264
|
-
/* @__PURE__ */
|
|
1265
|
-
p.badgeType !== "local" && /* @__PURE__ */
|
|
1266
|
-
|
|
1262
|
+
return /* @__PURE__ */ t(Ie, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(Te, { className: "sm:max-w-[500px]", children: [
|
|
1263
|
+
/* @__PURE__ */ s(bt, { children: [
|
|
1264
|
+
/* @__PURE__ */ s(Le, { className: "flex items-center gap-2", children: [
|
|
1265
|
+
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
1266
|
+
p.badgeType !== "local" && /* @__PURE__ */ t(
|
|
1267
|
+
Dr,
|
|
1267
1268
|
{
|
|
1268
1269
|
type: p.badgeType,
|
|
1269
1270
|
showLabel: !0,
|
|
@@ -1271,30 +1272,30 @@ function jr({
|
|
|
1271
1272
|
}
|
|
1272
1273
|
)
|
|
1273
1274
|
] }),
|
|
1274
|
-
/* @__PURE__ */
|
|
1275
|
+
/* @__PURE__ */ t(xt, { children: p.description })
|
|
1275
1276
|
] }),
|
|
1276
|
-
/* @__PURE__ */
|
|
1277
|
-
/* @__PURE__ */
|
|
1278
|
-
/* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ s("div", { className: "grid gap-4 py-4", children: [
|
|
1278
|
+
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
1279
|
+
/* @__PURE__ */ t(De, { htmlFor: "name", children: "Name" }),
|
|
1280
|
+
/* @__PURE__ */ t(
|
|
1280
1281
|
st,
|
|
1281
1282
|
{
|
|
1282
1283
|
id: "name",
|
|
1283
|
-
value:
|
|
1284
|
-
onChange: (
|
|
1284
|
+
value: c,
|
|
1285
|
+
onChange: (g) => l(g.target.value),
|
|
1285
1286
|
placeholder: "Enter visual name",
|
|
1286
1287
|
disabled: i
|
|
1287
1288
|
}
|
|
1288
1289
|
)
|
|
1289
1290
|
] }),
|
|
1290
|
-
/* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1292
|
-
/* @__PURE__ */
|
|
1293
|
-
|
|
1291
|
+
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
1292
|
+
/* @__PURE__ */ t(De, { htmlFor: "description", children: "Description (optional)" }),
|
|
1293
|
+
/* @__PURE__ */ t(
|
|
1294
|
+
ba,
|
|
1294
1295
|
{
|
|
1295
1296
|
id: "description",
|
|
1296
1297
|
value: u,
|
|
1297
|
-
onChange: (
|
|
1298
|
+
onChange: (g) => h(g.target.value),
|
|
1298
1299
|
placeholder: "Enter visual description",
|
|
1299
1300
|
rows: 3,
|
|
1300
1301
|
disabled: i
|
|
@@ -1302,8 +1303,8 @@ function jr({
|
|
|
1302
1303
|
)
|
|
1303
1304
|
] })
|
|
1304
1305
|
] }),
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */
|
|
1306
|
+
/* @__PURE__ */ s(xa, { children: [
|
|
1307
|
+
/* @__PURE__ */ t(
|
|
1307
1308
|
I,
|
|
1308
1309
|
{
|
|
1309
1310
|
variant: "outline",
|
|
@@ -1312,56 +1313,56 @@ function jr({
|
|
|
1312
1313
|
children: "Cancel"
|
|
1313
1314
|
}
|
|
1314
1315
|
),
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
i && /* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ s(I, { onClick: f, disabled: !m || i, children: [
|
|
1317
|
+
i && /* @__PURE__ */ t(re, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1317
1318
|
p.actionLabel
|
|
1318
1319
|
] })
|
|
1319
1320
|
] })
|
|
1320
1321
|
] }) });
|
|
1321
1322
|
}
|
|
1322
|
-
function
|
|
1323
|
+
function kt(e) {
|
|
1323
1324
|
var a;
|
|
1324
|
-
for (const o of
|
|
1325
|
-
if (o.type === "matrixTable" && !
|
|
1325
|
+
for (const o of e.cards)
|
|
1326
|
+
if (o.type === "matrixTable" && !mr.safeParse((a = o.config) == null ? void 0 : a.matrix).success)
|
|
1326
1327
|
return E.error("Matrix requires at least one row field, one metric, and valid settings."), !1;
|
|
1327
1328
|
return !0;
|
|
1328
1329
|
}
|
|
1329
1330
|
function tt({
|
|
1330
|
-
className:
|
|
1331
|
+
className: e,
|
|
1331
1332
|
variant: a = "outline"
|
|
1332
1333
|
}) {
|
|
1333
|
-
const o =
|
|
1334
|
+
const o = ee((r) => r.onSave), { getUpdatedFrame: n } = ye();
|
|
1334
1335
|
function i() {
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1336
|
+
const r = n();
|
|
1337
|
+
kt(r) && (o == null || o(r));
|
|
1337
1338
|
}
|
|
1338
|
-
return /* @__PURE__ */
|
|
1339
|
+
return /* @__PURE__ */ s(
|
|
1339
1340
|
I,
|
|
1340
1341
|
{
|
|
1341
1342
|
onClick: i,
|
|
1342
|
-
className:
|
|
1343
|
+
className: e,
|
|
1343
1344
|
size: "xs",
|
|
1344
1345
|
variant: a,
|
|
1345
1346
|
children: [
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
+
/* @__PURE__ */ t(Ct, { className: "h-3.5 w-3.5" }),
|
|
1347
1348
|
"Done"
|
|
1348
1349
|
]
|
|
1349
1350
|
}
|
|
1350
1351
|
);
|
|
1351
1352
|
}
|
|
1352
|
-
function
|
|
1353
|
-
className:
|
|
1353
|
+
function en({
|
|
1354
|
+
className: e,
|
|
1354
1355
|
variant: a = "default"
|
|
1355
1356
|
}) {
|
|
1356
|
-
const o = Qe(), [
|
|
1357
|
-
return /* @__PURE__ */
|
|
1357
|
+
const o = Qe(), [n, i] = S(!1), { setIsVisualEditing: r } = ce(), { getUpdatedFrame: d } = ye(), c = Ke(), l = ee((m) => m.frame), u = Ot();
|
|
1358
|
+
return /* @__PURE__ */ t(
|
|
1358
1359
|
I,
|
|
1359
1360
|
{
|
|
1360
1361
|
onClick: () => {
|
|
1361
|
-
const m =
|
|
1362
|
-
if (!
|
|
1362
|
+
const m = d();
|
|
1363
|
+
if (!kt(m))
|
|
1363
1364
|
return;
|
|
1364
|
-
const p = (l == null ? void 0 : l.visualId) || (
|
|
1365
|
+
const p = (l == null ? void 0 : l.visualId) || (c == null ? void 0 : c.id);
|
|
1365
1366
|
if (!p) {
|
|
1366
1367
|
E.error("No visual to save");
|
|
1367
1368
|
return;
|
|
@@ -1386,58 +1387,58 @@ function $r({
|
|
|
1386
1387
|
}
|
|
1387
1388
|
);
|
|
1388
1389
|
},
|
|
1389
|
-
className:
|
|
1390
|
+
className: e,
|
|
1390
1391
|
size: "xs",
|
|
1391
1392
|
variant: a,
|
|
1392
|
-
children:
|
|
1393
|
-
/* @__PURE__ */
|
|
1393
|
+
children: n ? /* @__PURE__ */ s(R, { children: [
|
|
1394
|
+
/* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1394
1395
|
"Saving"
|
|
1395
|
-
] }) : /* @__PURE__ */
|
|
1396
|
-
/* @__PURE__ */
|
|
1396
|
+
] }) : /* @__PURE__ */ s(R, { children: [
|
|
1397
|
+
/* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" }),
|
|
1397
1398
|
"Save to Library"
|
|
1398
1399
|
] })
|
|
1399
1400
|
}
|
|
1400
1401
|
);
|
|
1401
1402
|
}
|
|
1402
|
-
function
|
|
1403
|
-
className:
|
|
1403
|
+
function tn({
|
|
1404
|
+
className: e
|
|
1404
1405
|
}) {
|
|
1405
|
-
const a = Qe(), [o,
|
|
1406
|
-
return /* @__PURE__ */
|
|
1406
|
+
const a = Qe(), [o, n] = S(!1), i = Ke(), r = ee((g) => g.frame), d = w((g) => g.selectedSheetId), c = w((g) => g.dashboard), { updateFrame: l, setIsVisualEditing: u } = ce(), { getUpdatedFrame: h } = ye(), m = Ot(), p = vt();
|
|
1407
|
+
return /* @__PURE__ */ t(
|
|
1407
1408
|
I,
|
|
1408
1409
|
{
|
|
1409
1410
|
onClick: async () => {
|
|
1410
|
-
if (!
|
|
1411
|
+
if (!d) {
|
|
1411
1412
|
E.error("No sheet selected");
|
|
1412
1413
|
return;
|
|
1413
1414
|
}
|
|
1414
|
-
const
|
|
1415
|
-
if (!
|
|
1415
|
+
const g = (r == null ? void 0 : r.visualId) || (i == null ? void 0 : i.id);
|
|
1416
|
+
if (!g) {
|
|
1416
1417
|
E.error("No visual to update");
|
|
1417
1418
|
return;
|
|
1418
1419
|
}
|
|
1419
|
-
|
|
1420
|
+
n(!0);
|
|
1420
1421
|
try {
|
|
1421
1422
|
const v = h();
|
|
1422
|
-
if (!
|
|
1423
|
-
|
|
1423
|
+
if (!kt(v)) {
|
|
1424
|
+
n(!1);
|
|
1424
1425
|
return;
|
|
1425
1426
|
}
|
|
1426
|
-
const
|
|
1427
|
+
const k = {
|
|
1427
1428
|
...v,
|
|
1428
|
-
visualId:
|
|
1429
|
+
visualId: g
|
|
1429
1430
|
// Keep the link to library visual
|
|
1430
|
-
},
|
|
1431
|
-
previousFrame:
|
|
1431
|
+
}, V = He(c, k.id), U = await p(k, {
|
|
1432
|
+
previousFrame: V
|
|
1432
1433
|
});
|
|
1433
1434
|
await m.mutateAsync({
|
|
1434
|
-
visualId:
|
|
1435
|
+
visualId: g,
|
|
1435
1436
|
data: {
|
|
1436
1437
|
frameObject: v
|
|
1437
1438
|
}
|
|
1438
|
-
}), l(
|
|
1439
|
+
}), l(d, k, {
|
|
1439
1440
|
semanticExecutionPayload: U
|
|
1440
|
-
}), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual",
|
|
1441
|
+
}), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual", g] }), E.success("Saved to library and applied locally"), setTimeout(() => {
|
|
1441
1442
|
u(!1);
|
|
1442
1443
|
}, 300);
|
|
1443
1444
|
} catch (v) {
|
|
@@ -1445,62 +1446,62 @@ function Wr({
|
|
|
1445
1446
|
v instanceof Error ? v.message : "Failed to save and apply changes"
|
|
1446
1447
|
);
|
|
1447
1448
|
} finally {
|
|
1448
|
-
|
|
1449
|
+
n(!1);
|
|
1449
1450
|
}
|
|
1450
1451
|
},
|
|
1451
|
-
className:
|
|
1452
|
+
className: e,
|
|
1452
1453
|
size: "xs",
|
|
1453
1454
|
variant: "default",
|
|
1454
1455
|
disabled: o,
|
|
1455
|
-
children: o ? /* @__PURE__ */
|
|
1456
|
-
/* @__PURE__ */
|
|
1456
|
+
children: o ? /* @__PURE__ */ s(R, { children: [
|
|
1457
|
+
/* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1457
1458
|
"Saving..."
|
|
1458
|
-
] }) : /* @__PURE__ */
|
|
1459
|
-
/* @__PURE__ */
|
|
1459
|
+
] }) : /* @__PURE__ */ s(R, { children: [
|
|
1460
|
+
/* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" }),
|
|
1460
1461
|
"Save & Apply"
|
|
1461
1462
|
] })
|
|
1462
1463
|
}
|
|
1463
1464
|
);
|
|
1464
1465
|
}
|
|
1465
|
-
function at({ className:
|
|
1466
|
-
const { setTempQueryData: a, setSqlGen: o } = Ge(),
|
|
1467
|
-
function
|
|
1466
|
+
function at({ className: e }) {
|
|
1467
|
+
const { setTempQueryData: a, setSqlGen: o } = Ge(), n = Qe(), i = ee((c) => c.tempQueryData), r = ee((c) => c.onClose);
|
|
1468
|
+
function d() {
|
|
1468
1469
|
if (i) {
|
|
1469
|
-
const { queryKey:
|
|
1470
|
-
|
|
1470
|
+
const { queryKey: c, queryData: l } = i;
|
|
1471
|
+
c && l && n.setQueryData(c, l);
|
|
1471
1472
|
}
|
|
1472
|
-
o({}),
|
|
1473
|
+
o({}), r == null || r();
|
|
1473
1474
|
}
|
|
1474
|
-
return /* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ s(
|
|
1475
1476
|
I,
|
|
1476
1477
|
{
|
|
1477
|
-
onClick:
|
|
1478
|
-
className:
|
|
1478
|
+
onClick: d,
|
|
1479
|
+
className: e,
|
|
1479
1480
|
size: "xs",
|
|
1480
1481
|
variant: "outline",
|
|
1481
1482
|
children: [
|
|
1482
|
-
/* @__PURE__ */
|
|
1483
|
+
/* @__PURE__ */ t(Xe, { className: "h-3.5 w-3.5" }),
|
|
1483
1484
|
"Close"
|
|
1484
1485
|
]
|
|
1485
1486
|
}
|
|
1486
1487
|
);
|
|
1487
1488
|
}
|
|
1488
|
-
function
|
|
1489
|
-
const [
|
|
1489
|
+
function an() {
|
|
1490
|
+
const [e, a] = S(!1), [o, n] = S(!1), [i, r] = S(null), [d, c] = S(null), l = ee((b) => b.frame), u = ee((b) => b.card), h = Ke(), m = w((b) => b.selectedSheetId), p = w((b) => b.dashboard), { getUpdatedFrame: f } = ye(), { selectVisual: g } = lt(), { addFrame: v, setIsVisualEditing: k } = ce(), V = vt(), U = !!(l != null && l.visualId), M = (() => {
|
|
1490
1491
|
var b, F;
|
|
1491
1492
|
return ((b = l == null ? void 0 : l.cards) == null ? void 0 : b.length) === 1 && ((F = l.cards[0]) != null && F.title) ? l.cards[0].title : h != null && h.title ? h.title : (u == null ? void 0 : u.title) || "Untitled Visual";
|
|
1492
|
-
})(), A =
|
|
1493
|
-
b != null && b.id && (
|
|
1493
|
+
})(), A = va((b) => {
|
|
1494
|
+
b != null && b.id && (g(b), o && i && d && m && (async () => {
|
|
1494
1495
|
try {
|
|
1495
1496
|
const F = {
|
|
1496
1497
|
...i,
|
|
1497
|
-
id:
|
|
1498
|
+
id: At(),
|
|
1498
1499
|
visualId: b.id
|
|
1499
1500
|
// Link to the newly created library visual
|
|
1500
1501
|
};
|
|
1501
1502
|
v(m, F, {
|
|
1502
|
-
semanticExecutionPayload:
|
|
1503
|
-
}),
|
|
1503
|
+
semanticExecutionPayload: d
|
|
1504
|
+
}), n(!1), r(null), c(null), k(!1);
|
|
1504
1505
|
} catch (F) {
|
|
1505
1506
|
console.error(
|
|
1506
1507
|
"Failed to promote semantic metadata for saved visual:",
|
|
@@ -1512,14 +1513,14 @@ function qr() {
|
|
|
1512
1513
|
})(), a(!1));
|
|
1513
1514
|
});
|
|
1514
1515
|
return {
|
|
1515
|
-
saveAsDialogOpen:
|
|
1516
|
+
saveAsDialogOpen: e,
|
|
1516
1517
|
setSaveAsDialogOpen: a,
|
|
1517
1518
|
handleSaveAs: async (b) => {
|
|
1518
1519
|
if (!m) {
|
|
1519
1520
|
E.error("No sheet selected");
|
|
1520
1521
|
return;
|
|
1521
1522
|
}
|
|
1522
|
-
const F =
|
|
1523
|
+
const F = f(), D = F.cards.length === 1 ? {
|
|
1523
1524
|
...F,
|
|
1524
1525
|
cards: F.cards.map((N) => ({
|
|
1525
1526
|
...N,
|
|
@@ -1531,19 +1532,19 @@ function qr() {
|
|
|
1531
1532
|
let N = null;
|
|
1532
1533
|
if (b.saveToCurrentDashboard)
|
|
1533
1534
|
try {
|
|
1534
|
-
N = await
|
|
1535
|
+
N = await V(D, {
|
|
1535
1536
|
previousFrame: He(p, D.id)
|
|
1536
1537
|
});
|
|
1537
|
-
} catch (
|
|
1538
|
+
} catch (T) {
|
|
1538
1539
|
console.error(
|
|
1539
1540
|
"Failed to prepare semantic metadata before saving visual:",
|
|
1540
|
-
|
|
1541
|
+
T
|
|
1541
1542
|
), E.error(
|
|
1542
|
-
|
|
1543
|
+
T instanceof Error ? T.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1543
1544
|
);
|
|
1544
1545
|
return;
|
|
1545
1546
|
}
|
|
1546
|
-
|
|
1547
|
+
n(b.saveToCurrentDashboard), r(D), c(N);
|
|
1547
1548
|
const j = {
|
|
1548
1549
|
title: b.name,
|
|
1549
1550
|
description: b.description,
|
|
@@ -1556,17 +1557,17 @@ function qr() {
|
|
|
1556
1557
|
const N = {
|
|
1557
1558
|
...D,
|
|
1558
1559
|
// Card title already synced
|
|
1559
|
-
id:
|
|
1560
|
+
id: At(),
|
|
1560
1561
|
visualId: void 0
|
|
1561
1562
|
// Explicitly no visualId for local visuals
|
|
1562
1563
|
};
|
|
1563
1564
|
try {
|
|
1564
|
-
const j = await
|
|
1565
|
+
const j = await V(D, {
|
|
1565
1566
|
previousFrame: He(p, D.id)
|
|
1566
1567
|
});
|
|
1567
1568
|
v(m, N, {
|
|
1568
1569
|
semanticExecutionPayload: j
|
|
1569
|
-
}), E.success("Visual saved to dashboard"), a(!1),
|
|
1570
|
+
}), E.success("Visual saved to dashboard"), a(!1), k(!1);
|
|
1570
1571
|
} catch (j) {
|
|
1571
1572
|
console.error("Failed to save visual to dashboard:", j), E.error(
|
|
1572
1573
|
j instanceof Error ? j.message : "Failed to prepare semantic metadata for the visual"
|
|
@@ -1579,68 +1580,68 @@ function qr() {
|
|
|
1579
1580
|
isSaving: A.isPending
|
|
1580
1581
|
};
|
|
1581
1582
|
}
|
|
1582
|
-
function
|
|
1583
|
-
const { isInspectionMode: a } =
|
|
1583
|
+
function ps(e = {}) {
|
|
1584
|
+
const { isInspectionMode: a } = ya(), o = ee((T) => T.frame), n = ee((T) => T.editorContext), i = Ca((T) => T.selectedVisual), r = w((T) => T.selectedFrameId), d = w((T) => T.selectedSheetId), c = w((T) => T.dashboard), { setIsVisualEditing: l, updateFrame: u } = ce(), [h, m] = S(!1), [p, f] = S("both"), g = vt(), v = (n == null ? void 0 : n.type) === "documentSection", k = !!(o != null && o.visualId || i != null && i.id), V = !!(o != null && o.visualId && r), U = k && !V, {
|
|
1584
1585
|
saveAsDialogOpen: M,
|
|
1585
1586
|
setSaveAsDialogOpen: A,
|
|
1586
|
-
handleSaveAs:
|
|
1587
|
+
handleSaveAs: O,
|
|
1587
1588
|
isLibraryVisual: b,
|
|
1588
1589
|
currentVisualName: F,
|
|
1589
1590
|
isSaving: C
|
|
1590
|
-
} =
|
|
1591
|
+
} = an(), { getUpdatedFrame: D } = ye();
|
|
1591
1592
|
if (a)
|
|
1592
|
-
return /* @__PURE__ */
|
|
1593
|
-
/* @__PURE__ */
|
|
1593
|
+
return /* @__PURE__ */ s(R, { children: [
|
|
1594
|
+
/* @__PURE__ */ t(
|
|
1594
1595
|
tt,
|
|
1595
1596
|
{
|
|
1596
1597
|
className: "rounded-control",
|
|
1597
1598
|
variant: "default"
|
|
1598
1599
|
}
|
|
1599
1600
|
),
|
|
1600
|
-
/* @__PURE__ */
|
|
1601
|
+
/* @__PURE__ */ t(at, {})
|
|
1601
1602
|
] });
|
|
1602
1603
|
if (v)
|
|
1603
|
-
return /* @__PURE__ */
|
|
1604
|
-
/* @__PURE__ */
|
|
1605
|
-
/* @__PURE__ */
|
|
1604
|
+
return /* @__PURE__ */ s(R, { children: [
|
|
1605
|
+
/* @__PURE__ */ t(tt, { className: "rounded-control", variant: "default" }),
|
|
1606
|
+
/* @__PURE__ */ t(at, {})
|
|
1606
1607
|
] });
|
|
1607
1608
|
const N = async () => {
|
|
1608
|
-
if (!
|
|
1609
|
+
if (!d) {
|
|
1609
1610
|
E.error("No sheet selected");
|
|
1610
1611
|
return;
|
|
1611
1612
|
}
|
|
1612
1613
|
if (h) return;
|
|
1613
1614
|
m(!0);
|
|
1614
|
-
const
|
|
1615
|
+
const z = {
|
|
1615
1616
|
...D(),
|
|
1616
1617
|
visualId: void 0
|
|
1617
|
-
}, X = He(
|
|
1618
|
+
}, X = He(c, z.id);
|
|
1618
1619
|
try {
|
|
1619
|
-
const
|
|
1620
|
+
const L = await g(z, {
|
|
1620
1621
|
previousFrame: X
|
|
1621
1622
|
});
|
|
1622
|
-
u(
|
|
1623
|
-
semanticExecutionPayload:
|
|
1623
|
+
u(d, z, {
|
|
1624
|
+
semanticExecutionPayload: L
|
|
1624
1625
|
});
|
|
1625
|
-
} catch (
|
|
1626
|
-
console.error("Failed to apply local semantic metadata:",
|
|
1627
|
-
|
|
1626
|
+
} catch (L) {
|
|
1627
|
+
console.error("Failed to apply local semantic metadata:", L), m(!1), E.error(
|
|
1628
|
+
L instanceof Error ? L.message : "Failed to prepare semantic metadata for this visual"
|
|
1628
1629
|
);
|
|
1629
1630
|
return;
|
|
1630
1631
|
}
|
|
1631
1632
|
setTimeout(() => {
|
|
1632
1633
|
m(!1), E.success("Changes applied. Visual is now local to this dashboard"), l(!1);
|
|
1633
1634
|
}, 300);
|
|
1634
|
-
}, j = (
|
|
1635
|
-
|
|
1635
|
+
}, j = (T) => {
|
|
1636
|
+
f(T), A(!0);
|
|
1636
1637
|
};
|
|
1637
|
-
return /* @__PURE__ */
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
!
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
/* @__PURE__ */
|
|
1643
|
-
/* @__PURE__ */
|
|
1638
|
+
return /* @__PURE__ */ s(R, { children: [
|
|
1639
|
+
/* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
1640
|
+
!k && /* @__PURE__ */ t(tt, { className: "!rounded-none", variant: "default" }),
|
|
1641
|
+
k && U && /* @__PURE__ */ t(en, { className: "!rounded-none", variant: "default" }),
|
|
1642
|
+
k && V && /* @__PURE__ */ t(tn, { className: "!rounded-none" }),
|
|
1643
|
+
/* @__PURE__ */ s(Ve, { modal: !1, children: [
|
|
1644
|
+
/* @__PURE__ */ t(Be, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1644
1645
|
I,
|
|
1645
1646
|
{
|
|
1646
1647
|
variant: "default",
|
|
@@ -1648,58 +1649,58 @@ function rs(t = {}) {
|
|
|
1648
1649
|
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
1649
1650
|
"aria-label": "Open visual save options",
|
|
1650
1651
|
disabled: C || h,
|
|
1651
|
-
children: /* @__PURE__ */
|
|
1652
|
+
children: /* @__PURE__ */ t(wt, { className: "h-3.5 w-3.5" })
|
|
1652
1653
|
}
|
|
1653
1654
|
) }),
|
|
1654
|
-
/* @__PURE__ */
|
|
1655
|
-
|
|
1655
|
+
/* @__PURE__ */ s(
|
|
1656
|
+
Pe,
|
|
1656
1657
|
{
|
|
1657
1658
|
align: "end",
|
|
1658
1659
|
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
1659
1660
|
children: [
|
|
1660
|
-
|
|
1661
|
-
/* @__PURE__ */
|
|
1661
|
+
V && /* @__PURE__ */ s(R, { children: [
|
|
1662
|
+
/* @__PURE__ */ s(
|
|
1662
1663
|
G,
|
|
1663
1664
|
{
|
|
1664
1665
|
onClick: N,
|
|
1665
1666
|
disabled: h,
|
|
1666
1667
|
children: [
|
|
1667
|
-
/* @__PURE__ */
|
|
1668
|
+
/* @__PURE__ */ t(Ct, { className: "h-3.5 w-3.5" }),
|
|
1668
1669
|
h ? "Applying..." : "Apply Locally"
|
|
1669
1670
|
]
|
|
1670
1671
|
}
|
|
1671
1672
|
),
|
|
1672
|
-
/* @__PURE__ */
|
|
1673
|
+
/* @__PURE__ */ t(We, {})
|
|
1673
1674
|
] }),
|
|
1674
|
-
/* @__PURE__ */
|
|
1675
|
+
/* @__PURE__ */ s(
|
|
1675
1676
|
G,
|
|
1676
1677
|
{
|
|
1677
1678
|
onClick: () => j("local"),
|
|
1678
1679
|
disabled: C,
|
|
1679
1680
|
children: [
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ t(ve, { className: "h-3.5 w-3.5" }),
|
|
1681
1682
|
"Add to Dashboard (Local)"
|
|
1682
1683
|
]
|
|
1683
1684
|
}
|
|
1684
1685
|
),
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
+
/* @__PURE__ */ s(
|
|
1686
1687
|
G,
|
|
1687
1688
|
{
|
|
1688
1689
|
onClick: () => j("library"),
|
|
1689
1690
|
disabled: C,
|
|
1690
1691
|
children: [
|
|
1691
|
-
/* @__PURE__ */
|
|
1692
|
+
/* @__PURE__ */ t(Ar, { className: "h-3.5 w-3.5" }),
|
|
1692
1693
|
"Save as Library Visual"
|
|
1693
1694
|
]
|
|
1694
1695
|
}
|
|
1695
1696
|
),
|
|
1696
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ s(
|
|
1697
1698
|
G,
|
|
1698
1699
|
{
|
|
1699
1700
|
onClick: () => j("both"),
|
|
1700
1701
|
disabled: C,
|
|
1701
1702
|
children: [
|
|
1702
|
-
/* @__PURE__ */
|
|
1703
|
+
/* @__PURE__ */ t(Fr, { className: "h-3.5 w-3.5" }),
|
|
1703
1704
|
"Save Copy as Linked Visual"
|
|
1704
1705
|
]
|
|
1705
1706
|
}
|
|
@@ -1709,29 +1710,29 @@ function rs(t = {}) {
|
|
|
1709
1710
|
)
|
|
1710
1711
|
] })
|
|
1711
1712
|
] }),
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
|
|
1713
|
+
/* @__PURE__ */ t(at, {}),
|
|
1714
|
+
/* @__PURE__ */ t(
|
|
1715
|
+
Jr,
|
|
1715
1716
|
{
|
|
1716
1717
|
open: M,
|
|
1717
|
-
onOpenChange: (
|
|
1718
|
-
C || A(
|
|
1718
|
+
onOpenChange: (T) => {
|
|
1719
|
+
C || A(T);
|
|
1719
1720
|
},
|
|
1720
1721
|
isLibraryVisual: b,
|
|
1721
1722
|
currentVisualName: F,
|
|
1722
1723
|
isSaving: C,
|
|
1723
1724
|
destinationMode: p,
|
|
1724
|
-
onConfirm:
|
|
1725
|
+
onConfirm: O
|
|
1725
1726
|
}
|
|
1726
1727
|
)
|
|
1727
1728
|
] });
|
|
1728
1729
|
}
|
|
1729
|
-
function
|
|
1730
|
-
const a =
|
|
1731
|
-
if (!
|
|
1730
|
+
function fs({ className: e }) {
|
|
1731
|
+
const a = ee((h) => h.isDevMode), o = ee((h) => h.card.type), n = w((h) => h.isVisualEditing), { setIsDevMode: i } = Ge(), { config: r } = Bt(wa).tokenProps, d = (r == null ? void 0 : r.showAdvancedMode) !== !1;
|
|
1732
|
+
if (!n || !d || !br(o))
|
|
1732
1733
|
return null;
|
|
1733
|
-
const
|
|
1734
|
-
return /* @__PURE__ */
|
|
1734
|
+
const c = a ? Rr : Or, l = a ? "Visual editor" : "SQL editor", u = a ? "Switch to visual editor" : "Switch to SQL editor";
|
|
1735
|
+
return /* @__PURE__ */ s(
|
|
1735
1736
|
"button",
|
|
1736
1737
|
{
|
|
1737
1738
|
type: "button",
|
|
@@ -1740,182 +1741,259 @@ function ns({ className: t }) {
|
|
|
1740
1741
|
onClick: () => i(!a),
|
|
1741
1742
|
className: J(
|
|
1742
1743
|
"inline-flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 text-[12px] font-medium text-foreground transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:outline-none",
|
|
1743
|
-
|
|
1744
|
+
e
|
|
1744
1745
|
),
|
|
1745
1746
|
children: [
|
|
1746
|
-
/* @__PURE__ */
|
|
1747
|
+
/* @__PURE__ */ t(c, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1747
1748
|
l
|
|
1748
1749
|
]
|
|
1749
1750
|
}
|
|
1750
1751
|
);
|
|
1751
1752
|
}
|
|
1752
|
-
function
|
|
1753
|
-
const
|
|
1754
|
-
var
|
|
1755
|
-
const
|
|
1756
|
-
return
|
|
1757
|
-
}),
|
|
1758
|
-
if (!
|
|
1759
|
-
const
|
|
1760
|
-
const
|
|
1761
|
-
if (!
|
|
1762
|
-
E.error(
|
|
1753
|
+
function gs() {
|
|
1754
|
+
const e = Tr() === "sm", a = w((l) => l.isDashboardEditing), o = w((l) => l.isVisualEditing), n = w((l) => {
|
|
1755
|
+
var h;
|
|
1756
|
+
const u = ((h = l.dashboard) == null ? void 0 : h.sheets) ?? [];
|
|
1757
|
+
return u.find((m) => m.id === l.selectedSheetId) ?? u[0];
|
|
1758
|
+
}), i = w((l) => l.actions.arrangeSheet), r = w((l) => l.actions.undoArrange);
|
|
1759
|
+
if (!a || o || !n || Nt(n)) return null;
|
|
1760
|
+
const d = !(n.frames ?? []).length, c = (l) => {
|
|
1761
|
+
const u = i(n.id, { keepOrder: l });
|
|
1762
|
+
if (!u.ok) {
|
|
1763
|
+
E.error(u.reason === "not_a_grid" ? "This sheet has no grid to arrange." : "The dashboard can't be arranged right now.");
|
|
1763
1764
|
return;
|
|
1764
1765
|
}
|
|
1765
1766
|
E("Arranged", {
|
|
1766
1767
|
// Long enough to reach Undo after looking at the result; the default 4 seconds isn't.
|
|
1767
1768
|
duration: 1e4,
|
|
1768
|
-
description:
|
|
1769
|
+
description: l ? "Sizes and gaps fixed on every screen size, in your order." : "KPIs on top, charts in pairs, tables full width, on every screen size.",
|
|
1769
1770
|
action: {
|
|
1770
1771
|
label: "Undo",
|
|
1771
1772
|
onClick: () => {
|
|
1772
|
-
const
|
|
1773
|
-
!
|
|
1773
|
+
const h = r();
|
|
1774
|
+
!h.ok && h.reason === "changed_since" && E.info("The dashboard changed after Arrange, so it can't be undone from here.");
|
|
1774
1775
|
}
|
|
1775
1776
|
}
|
|
1776
1777
|
});
|
|
1777
1778
|
};
|
|
1778
|
-
return /* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1779
|
+
return /* @__PURE__ */ s("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
|
|
1780
|
+
/* @__PURE__ */ s(
|
|
1780
1781
|
I,
|
|
1781
1782
|
{
|
|
1782
1783
|
variant: "ghost",
|
|
1783
1784
|
size: "xs",
|
|
1784
|
-
disabled:
|
|
1785
|
-
title:
|
|
1785
|
+
disabled: d,
|
|
1786
|
+
title: d ? "This sheet has no cards to arrange" : "Lay out the cards by kind on every screen size",
|
|
1786
1787
|
onClick: () => c(!1),
|
|
1787
|
-
|
|
1788
|
+
"aria-label": e ? "Arrange" : void 0,
|
|
1789
|
+
className: `h-full rounded-none border-0 shadow-none hover:bg-accent${e ? " w-7 px-0" : ""}`,
|
|
1788
1790
|
children: [
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
"Arrange"
|
|
1791
|
+
/* @__PURE__ */ t(Ee, { className: "h-3.5 w-3.5" }),
|
|
1792
|
+
!e && "Arrange"
|
|
1791
1793
|
]
|
|
1792
1794
|
}
|
|
1793
1795
|
),
|
|
1794
|
-
/* @__PURE__ */
|
|
1795
|
-
/* @__PURE__ */
|
|
1796
|
+
/* @__PURE__ */ s(Ve, { modal: !1, children: [
|
|
1797
|
+
/* @__PURE__ */ t(Be, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1796
1798
|
I,
|
|
1797
1799
|
{
|
|
1798
1800
|
variant: "ghost",
|
|
1799
1801
|
size: "xs",
|
|
1800
|
-
disabled:
|
|
1802
|
+
disabled: d,
|
|
1801
1803
|
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
|
|
1802
1804
|
"aria-label": "Open arrange options",
|
|
1803
|
-
children: /* @__PURE__ */
|
|
1805
|
+
children: /* @__PURE__ */ t(wt, { className: "h-3.5 w-3.5" })
|
|
1804
1806
|
}
|
|
1805
1807
|
) }),
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
-
/* @__PURE__ */
|
|
1808
|
+
/* @__PURE__ */ t(Pe, { align: "end", className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm", children: /* @__PURE__ */ s(G, { onClick: () => c(!0), children: [
|
|
1809
|
+
/* @__PURE__ */ t(Ee, { className: "h-3.5 w-3.5" }),
|
|
1808
1810
|
"Keep my order"
|
|
1809
1811
|
] }) })
|
|
1810
1812
|
] })
|
|
1811
1813
|
] });
|
|
1812
1814
|
}
|
|
1813
|
-
function
|
|
1814
|
-
const
|
|
1815
|
-
var c,
|
|
1816
|
-
const
|
|
1817
|
-
return !!
|
|
1818
|
-
}), o = w((
|
|
1819
|
-
|
|
1815
|
+
function bs() {
|
|
1816
|
+
const e = w((i) => i.screenSizesOpen), a = w((i) => {
|
|
1817
|
+
var c, l;
|
|
1818
|
+
const r = ((c = i.dashboard) == null ? void 0 : c.sheets) ?? [], d = r.find((u) => u.id === i.selectedSheetId) ?? r[0];
|
|
1819
|
+
return !!d && !Nt(d) && !!((l = d.frames) != null && l.length);
|
|
1820
|
+
}), o = w((i) => i.actions.setScreenSizesOpen), n = Qt(
|
|
1821
|
+
"screen-sizes",
|
|
1822
|
+
"lg",
|
|
1823
|
+
a ? {
|
|
1824
|
+
label: "Screen sizes",
|
|
1825
|
+
icon: /* @__PURE__ */ t(It, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
1826
|
+
checked: e,
|
|
1827
|
+
order: 40,
|
|
1828
|
+
onSelect: () => o(!e)
|
|
1829
|
+
} : void 0
|
|
1830
|
+
);
|
|
1831
|
+
return !a || n.collapsed ? null : /* @__PURE__ */ t(
|
|
1820
1832
|
I,
|
|
1821
1833
|
{
|
|
1822
1834
|
type: "button",
|
|
1823
1835
|
size: "xs",
|
|
1824
|
-
variant:
|
|
1825
|
-
"aria-pressed":
|
|
1836
|
+
variant: e ? "secondary" : "ghost",
|
|
1837
|
+
"aria-pressed": e,
|
|
1826
1838
|
"aria-label": "Screen sizes",
|
|
1827
1839
|
title: "Screen sizes",
|
|
1828
|
-
onClick: () => o(!
|
|
1829
|
-
className: "px-
|
|
1830
|
-
children: /* @__PURE__ */
|
|
1840
|
+
onClick: () => o(!e),
|
|
1841
|
+
className: "w-7 px-0",
|
|
1842
|
+
children: /* @__PURE__ */ t(It, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
|
|
1843
|
+
}
|
|
1844
|
+
);
|
|
1845
|
+
}
|
|
1846
|
+
function xs({ dashboardId: e }) {
|
|
1847
|
+
const { openDashboardId: a, access: o, printMode: n, serverIsFavorite: i, fetchedAt: r } = w(
|
|
1848
|
+
Na((l) => {
|
|
1849
|
+
var u;
|
|
1850
|
+
return {
|
|
1851
|
+
openDashboardId: (u = l.dashboard) == null ? void 0 : u.id,
|
|
1852
|
+
access: l.viewer.access,
|
|
1853
|
+
printMode: l.viewer.printMode,
|
|
1854
|
+
serverIsFavorite: l.viewer.isFavorite,
|
|
1855
|
+
fetchedAt: l.viewer.fetchedAt
|
|
1856
|
+
};
|
|
1857
|
+
})
|
|
1858
|
+
), d = Sa(), c = d.isFavorite(e, i, r);
|
|
1859
|
+
return a !== e || n || o === "session-only" ? null : /* @__PURE__ */ t(
|
|
1860
|
+
ka,
|
|
1861
|
+
{
|
|
1862
|
+
variant: "toolbar",
|
|
1863
|
+
isFavorite: c,
|
|
1864
|
+
readOnly: o === "read-only",
|
|
1865
|
+
pending: d.isPending(e),
|
|
1866
|
+
onToggle: () => void d.setFavorite({ dashboardId: e, isFavorite: !c })
|
|
1867
|
+
}
|
|
1868
|
+
);
|
|
1869
|
+
}
|
|
1870
|
+
function vs({
|
|
1871
|
+
width: e,
|
|
1872
|
+
hasOverflowMenu: a = !0,
|
|
1873
|
+
children: o
|
|
1874
|
+
}) {
|
|
1875
|
+
const [n, i] = S(
|
|
1876
|
+
() => /* @__PURE__ */ new Map()
|
|
1877
|
+
), [r, d] = S(null), [c, l] = S(null), u = Z((m) => (i((p) => new Map(p).set(m.id, m)), () => i((p) => {
|
|
1878
|
+
if (p.get(m.id) !== m) return p;
|
|
1879
|
+
const f = new Map(p);
|
|
1880
|
+
return f.delete(m.id), f;
|
|
1881
|
+
})), []), h = te(
|
|
1882
|
+
() => ({
|
|
1883
|
+
width: e,
|
|
1884
|
+
hasOverflowMenu: a,
|
|
1885
|
+
overflowItems: [...n.values()].sort((m, p) => m.order - p.order),
|
|
1886
|
+
register: u,
|
|
1887
|
+
openOverflowId: r,
|
|
1888
|
+
setOpenOverflowId: d,
|
|
1889
|
+
anchorSlot: c,
|
|
1890
|
+
setAnchorSlot: l
|
|
1891
|
+
}),
|
|
1892
|
+
[c, a, n, r, u, e]
|
|
1893
|
+
);
|
|
1894
|
+
return /* @__PURE__ */ t(Kt.Provider, { value: h, children: o });
|
|
1895
|
+
}
|
|
1896
|
+
function ys() {
|
|
1897
|
+
const { setAnchorSlot: e } = Bt(Kt);
|
|
1898
|
+
return /* @__PURE__ */ t("span", { ref: e, "aria-hidden": !0, className: "relative -mr-1.5 block h-7 w-0" });
|
|
1899
|
+
}
|
|
1900
|
+
function Cs(e) {
|
|
1901
|
+
var l;
|
|
1902
|
+
const { authToken: a, tokenProps: o } = it(), { data: n } = Da(), { mutate: i, isPending: r } = Aa(), d = !!e && ((l = n == null ? void 0 : n.preference) == null ? void 0 : l.defaultDashboardId) === e, c = !n || r;
|
|
1903
|
+
return {
|
|
1904
|
+
available: !!e && !!(a != null && a.accessToken) && !!(o != null && o.apiServiceUrl),
|
|
1905
|
+
isDefault: d,
|
|
1906
|
+
disabled: c,
|
|
1907
|
+
toggle: () => {
|
|
1908
|
+
!e || c || i({ dashboardId: d ? null : e });
|
|
1831
1909
|
}
|
|
1832
|
-
|
|
1910
|
+
};
|
|
1833
1911
|
}
|
|
1834
|
-
function
|
|
1835
|
-
open:
|
|
1912
|
+
function ws({
|
|
1913
|
+
open: e,
|
|
1836
1914
|
onOpenChange: a,
|
|
1837
1915
|
onSave: o,
|
|
1838
|
-
onDiscard:
|
|
1916
|
+
onDiscard: n,
|
|
1839
1917
|
isSaving: i,
|
|
1840
|
-
title:
|
|
1841
|
-
description:
|
|
1842
|
-
cancelLabel:
|
|
1918
|
+
title: r = "Unsaved changes",
|
|
1919
|
+
description: d = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
1920
|
+
cancelLabel: c = "Cancel",
|
|
1843
1921
|
discardLabel: l = "Discard changes",
|
|
1844
1922
|
saveLabel: u = "Save"
|
|
1845
1923
|
}) {
|
|
1846
|
-
return /* @__PURE__ */
|
|
1924
|
+
return /* @__PURE__ */ t(dt, { open: e, onOpenChange: (m) => {
|
|
1847
1925
|
!m && i || a(m);
|
|
1848
|
-
}, children: /* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1850
|
-
/* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
1926
|
+
}, children: /* @__PURE__ */ s(ct, { children: [
|
|
1927
|
+
/* @__PURE__ */ s(ut, { children: [
|
|
1928
|
+
/* @__PURE__ */ t(ht, { children: r }),
|
|
1929
|
+
/* @__PURE__ */ t(mt, { children: d })
|
|
1852
1930
|
] }),
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
1931
|
+
/* @__PURE__ */ s(pt, { children: [
|
|
1932
|
+
/* @__PURE__ */ t(
|
|
1855
1933
|
I,
|
|
1856
1934
|
{
|
|
1857
1935
|
type: "button",
|
|
1858
1936
|
size: "xs",
|
|
1859
|
-
onClick:
|
|
1937
|
+
onClick: n,
|
|
1860
1938
|
disabled: i,
|
|
1861
1939
|
variant: "outline",
|
|
1862
1940
|
className: "mr-auto text-destructive hover:border-destructive/40 hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
|
|
1863
1941
|
children: l
|
|
1864
1942
|
}
|
|
1865
1943
|
),
|
|
1866
|
-
/* @__PURE__ */
|
|
1867
|
-
/* @__PURE__ */
|
|
1868
|
-
/* @__PURE__ */
|
|
1944
|
+
/* @__PURE__ */ t(ft, { disabled: i, children: c }),
|
|
1945
|
+
/* @__PURE__ */ t(I, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ s(R, { children: [
|
|
1946
|
+
/* @__PURE__ */ t(re, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1869
1947
|
"Saving..."
|
|
1870
1948
|
] }) : u })
|
|
1871
1949
|
] })
|
|
1872
1950
|
] }) });
|
|
1873
1951
|
}
|
|
1874
|
-
async function
|
|
1875
|
-
var
|
|
1876
|
-
const a = (
|
|
1952
|
+
async function Ns(e) {
|
|
1953
|
+
var r, d;
|
|
1954
|
+
const a = (d = (r = w.getState()) == null ? void 0 : r.authToken) == null ? void 0 : d.accessToken;
|
|
1877
1955
|
if (!a)
|
|
1878
1956
|
return;
|
|
1879
|
-
const o = `${
|
|
1957
|
+
const o = `${e}/v1/invalidate-token`, n = await fetch(o, {
|
|
1880
1958
|
method: "POST",
|
|
1881
1959
|
headers: {
|
|
1882
1960
|
Authorization: `Bearer ${a}`
|
|
1883
1961
|
}
|
|
1884
1962
|
});
|
|
1885
|
-
if (!
|
|
1963
|
+
if (!n.ok)
|
|
1886
1964
|
throw new Error("Failed to invalidate token");
|
|
1887
|
-
const i = await
|
|
1965
|
+
const i = await n.json();
|
|
1888
1966
|
return console.log("invalidateToken", i), i;
|
|
1889
1967
|
}
|
|
1890
|
-
function
|
|
1891
|
-
switch (
|
|
1968
|
+
function rn(e) {
|
|
1969
|
+
switch (e == null ? void 0 : e.kind) {
|
|
1892
1970
|
case "queued":
|
|
1893
1971
|
return { text: K.queued };
|
|
1894
1972
|
case "preparing":
|
|
1895
1973
|
return { text: K.preparing };
|
|
1896
1974
|
case "fetching":
|
|
1897
|
-
return { text: K.fetchingRows(
|
|
1975
|
+
return { text: K.fetchingRows(e.rowsProcessed) };
|
|
1898
1976
|
case "finalizing":
|
|
1899
1977
|
return { text: K.finalizing };
|
|
1900
1978
|
case "processing":
|
|
1901
|
-
return
|
|
1979
|
+
return e.percent === null ? { text: K.processing } : { text: K.processing, detail: K.percentComplete(e.percent), bar: e.percent };
|
|
1902
1980
|
default:
|
|
1903
1981
|
return { text: K.inProgress };
|
|
1904
1982
|
}
|
|
1905
1983
|
}
|
|
1906
|
-
function
|
|
1984
|
+
function nn(e) {
|
|
1907
1985
|
var o;
|
|
1908
|
-
const a =
|
|
1986
|
+
const a = e.item;
|
|
1909
1987
|
return a.kind === "export" ? {
|
|
1910
1988
|
title: a.title,
|
|
1911
1989
|
status: a.status,
|
|
1912
1990
|
startedAt: a.startedAt,
|
|
1913
1991
|
finishedAt: a.finishedAt,
|
|
1914
|
-
running:
|
|
1992
|
+
running: rn(a.stage),
|
|
1915
1993
|
finishedDetail: [
|
|
1916
1994
|
a.totalRows !== null ? `${a.totalRows.toLocaleString("en-US")} rows` : null,
|
|
1917
|
-
a.fileSize ?
|
|
1918
|
-
].filter((
|
|
1995
|
+
a.fileSize ? Ba(a.fileSize) : null
|
|
1996
|
+
].filter((n) => !!n),
|
|
1919
1997
|
failure: ((o = a.failure) == null ? void 0 : o.kind) === "export" ? a.failure.message : a.status === "failed" ? K.failedFallback : null,
|
|
1920
1998
|
note: null
|
|
1921
1999
|
} : {
|
|
@@ -1926,165 +2004,195 @@ function Qr(t) {
|
|
|
1926
2004
|
running: { text: a.stageLabel ?? K.inProgress },
|
|
1927
2005
|
finishedDetail: [],
|
|
1928
2006
|
failure: null,
|
|
1929
|
-
note: a.omittedAttachmentCount > 0 ?
|
|
2007
|
+
note: a.omittedAttachmentCount > 0 ? de.attachmentsLeftOut(a.omittedAttachmentCount) : null
|
|
1930
2008
|
};
|
|
1931
2009
|
}
|
|
1932
|
-
function
|
|
1933
|
-
const [
|
|
1934
|
-
if (!
|
|
2010
|
+
function sn({ row: e, now: a, api: o }) {
|
|
2011
|
+
const [n, i] = S("idle"), r = nn(e), d = Fa(e, o), c = async () => {
|
|
2012
|
+
if (!d) return;
|
|
1935
2013
|
i("working");
|
|
1936
|
-
const
|
|
1937
|
-
i(
|
|
1938
|
-
}, l =
|
|
1939
|
-
return /* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
1941
|
-
/* @__PURE__ */
|
|
1942
|
-
/* @__PURE__ */
|
|
1943
|
-
/* @__PURE__ */
|
|
1944
|
-
/* @__PURE__ */
|
|
1945
|
-
|
|
1946
|
-
|
|
2014
|
+
const g = await Pa(o, e, d);
|
|
2015
|
+
i(g === "done" ? "idle" : g);
|
|
2016
|
+
}, l = r.status === "ready" ? "bg-emerald-500" : r.status === "failed" ? "bg-destructive" : r.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", u = r.status === "ready" ? K.ready : r.status === "failed" ? K.failed : r.status === "cancelled" ? K.cancelled : K.inProgress, h = Date.parse(r.startedAt), m = Ft(Date.parse(r.finishedAt ?? r.startedAt), a, { addSuffix: !0 }), p = r.status === "running" && e.item.kind === "export" && a - h >= Ea, f = /* @__PURE__ */ t("span", { className: "text-muted-foreground/50", children: "·" });
|
|
2017
|
+
return /* @__PURE__ */ s("div", { className: "group flex items-start gap-2.5 px-3 py-2 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
2018
|
+
/* @__PURE__ */ t("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ t("span", { className: `h-1.5 w-1.5 rounded-full ${l}` }) }),
|
|
2019
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: u }),
|
|
2020
|
+
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
2021
|
+
/* @__PURE__ */ s("div", { className: "flex h-5 items-center gap-2", children: [
|
|
2022
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: r.title }),
|
|
2023
|
+
d && n === "working" && /* @__PURE__ */ t("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: /* @__PURE__ */ t(Rt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }) }),
|
|
2024
|
+
d && n !== "working" && /* @__PURE__ */ t(
|
|
1947
2025
|
"button",
|
|
1948
2026
|
{
|
|
1949
2027
|
type: "button",
|
|
1950
|
-
onClick: () => void
|
|
2028
|
+
onClick: () => void c(),
|
|
1951
2029
|
className: "shrink-0 text-[12px] font-medium text-foreground/80 underline-offset-2 hover:text-foreground hover:underline focus-visible:underline focus-visible:outline-none",
|
|
1952
|
-
children:
|
|
2030
|
+
children: Ia[d]
|
|
1953
2031
|
}
|
|
1954
2032
|
)
|
|
1955
2033
|
] }),
|
|
1956
|
-
|
|
1957
|
-
/* @__PURE__ */
|
|
1958
|
-
|
|
2034
|
+
r.status === "running" && r.running && /* @__PURE__ */ s("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
|
|
2035
|
+
/* @__PURE__ */ t("span", { className: "tabular-nums", children: r.running.text }),
|
|
2036
|
+
r.running.detail && /* @__PURE__ */ s(R, { children: [
|
|
1959
2037
|
" ",
|
|
1960
|
-
|
|
2038
|
+
f,
|
|
1961
2039
|
" ",
|
|
1962
|
-
/* @__PURE__ */
|
|
2040
|
+
/* @__PURE__ */ t("span", { className: "tabular-nums", children: r.running.detail })
|
|
1963
2041
|
] }),
|
|
1964
2042
|
" ",
|
|
1965
|
-
|
|
2043
|
+
f,
|
|
1966
2044
|
" ",
|
|
1967
|
-
/* @__PURE__ */
|
|
1968
|
-
|
|
1969
|
-
p && /* @__PURE__ */
|
|
2045
|
+
/* @__PURE__ */ t("span", { children: K.started(Ft(h, a)) }),
|
|
2046
|
+
r.running.bar !== void 0 && /* @__PURE__ */ t(Ta, { value: r.running.bar, className: "mt-1.5 h-1" }),
|
|
2047
|
+
p && /* @__PURE__ */ t("div", { className: "mt-1", children: K.longRunning })
|
|
1970
2048
|
] }),
|
|
1971
|
-
|
|
1972
|
-
|
|
2049
|
+
r.status !== "running" && /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
|
|
2050
|
+
r.status === "ready" && r.finishedDetail.length > 0 ? (
|
|
1973
2051
|
// Disclosed on hover or focus only; the time is what a reader scans.
|
|
1974
|
-
/* @__PURE__ */
|
|
1975
|
-
|
|
1976
|
-
v > 0 &&
|
|
1977
|
-
/* @__PURE__ */
|
|
2052
|
+
/* @__PURE__ */ s("span", { className: "hidden group-hover:contents group-focus-within:contents", children: [
|
|
2053
|
+
r.finishedDetail.map((g, v) => /* @__PURE__ */ s(Vt.Fragment, { children: [
|
|
2054
|
+
v > 0 && f,
|
|
2055
|
+
/* @__PURE__ */ t("span", { children: g })
|
|
1978
2056
|
] }, v)),
|
|
1979
|
-
|
|
2057
|
+
f
|
|
1980
2058
|
] })
|
|
1981
|
-
) :
|
|
1982
|
-
/* @__PURE__ */
|
|
1983
|
-
|
|
2059
|
+
) : r.status !== "ready" ? /* @__PURE__ */ s(R, { children: [
|
|
2060
|
+
/* @__PURE__ */ t("span", { children: u }),
|
|
2061
|
+
f
|
|
1984
2062
|
] }) : null,
|
|
1985
|
-
/* @__PURE__ */
|
|
2063
|
+
/* @__PURE__ */ t("span", { children: m })
|
|
1986
2064
|
] }),
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
(
|
|
1990
|
-
/* @__PURE__ */
|
|
1991
|
-
/* @__PURE__ */
|
|
2065
|
+
r.note && /* @__PURE__ */ t("div", { className: "text-[12px] leading-4 text-muted-foreground", children: r.note }),
|
|
2066
|
+
r.status === "failed" && r.failure && /* @__PURE__ */ t("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: r.failure }),
|
|
2067
|
+
(n === "denied" || n === "blocked") && /* @__PURE__ */ s("div", { role: "alert", className: "mt-1 flex items-start gap-1.5 text-[12px] leading-4 text-foreground", children: [
|
|
2068
|
+
/* @__PURE__ */ t(La, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
|
|
2069
|
+
/* @__PURE__ */ t("span", { children: Va(n) })
|
|
1992
2070
|
] })
|
|
1993
2071
|
] })
|
|
1994
2072
|
] });
|
|
1995
2073
|
}
|
|
1996
|
-
function
|
|
1997
|
-
const { snapshot: a, markSeen: o } =
|
|
1998
|
-
|
|
1999
|
-
|
|
2074
|
+
function Ss({ variant: e }) {
|
|
2075
|
+
const { snapshot: a, markSeen: o } = yt(), n = a.runningCount > 0 ? a.runningCount > 9 ? "9+" : String(a.runningCount) : a.hasUnseenFinished ? "" : null, i = Qt("activity", "md", {
|
|
2076
|
+
label: de.title,
|
|
2077
|
+
icon: /* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" }),
|
|
2078
|
+
hint: n || (n === "" ? "New" : void 0),
|
|
2079
|
+
order: 30,
|
|
2080
|
+
onOpen: o
|
|
2081
|
+
});
|
|
2082
|
+
return i.collapsed ? /* @__PURE__ */ s(
|
|
2083
|
+
Ae,
|
|
2084
|
+
{
|
|
2085
|
+
open: i.popoverOpen,
|
|
2086
|
+
onOpenChange: (r) => {
|
|
2087
|
+
i.setPopoverOpen(r), r && o();
|
|
2088
|
+
},
|
|
2089
|
+
children: [
|
|
2090
|
+
i.anchorSlot && Sr(
|
|
2091
|
+
/* @__PURE__ */ t(hr, { asChild: !0, children: /* @__PURE__ */ t("span", { className: "absolute right-0 top-0 h-7 w-px" }) }),
|
|
2092
|
+
i.anchorSlot
|
|
2093
|
+
),
|
|
2094
|
+
/* @__PURE__ */ t(
|
|
2095
|
+
Fe,
|
|
2096
|
+
{
|
|
2097
|
+
className: "w-80 p-0",
|
|
2098
|
+
align: "end",
|
|
2099
|
+
sideOffset: 8,
|
|
2100
|
+
onFocusOutside: (r) => r.preventDefault(),
|
|
2101
|
+
children: /* @__PURE__ */ t(Lt, {})
|
|
2102
|
+
}
|
|
2103
|
+
)
|
|
2104
|
+
]
|
|
2105
|
+
}
|
|
2106
|
+
) : /* @__PURE__ */ s(Ae, { onOpenChange: (r) => {
|
|
2107
|
+
r && o();
|
|
2000
2108
|
}, children: [
|
|
2001
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
2002
2110
|
I,
|
|
2003
2111
|
{
|
|
2004
|
-
variant:
|
|
2112
|
+
variant: e ?? "ghost",
|
|
2005
2113
|
size: "xs",
|
|
2006
|
-
className: "relative w-7 px-0
|
|
2007
|
-
"aria-label":
|
|
2008
|
-
title:
|
|
2114
|
+
className: "relative w-7 px-0",
|
|
2115
|
+
"aria-label": de.title,
|
|
2116
|
+
title: de.title,
|
|
2009
2117
|
children: [
|
|
2010
|
-
/* @__PURE__ */
|
|
2011
|
-
|
|
2118
|
+
/* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" }),
|
|
2119
|
+
n !== null && /* @__PURE__ */ t(
|
|
2012
2120
|
"span",
|
|
2013
2121
|
{
|
|
2014
|
-
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${
|
|
2015
|
-
children:
|
|
2122
|
+
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${n ? "-right-0.5 -top-0.5 h-3.5 min-w-3.5 px-0.5 text-[9px] font-semibold" : "right-1 top-1 h-1.5 w-1.5"}`,
|
|
2123
|
+
children: n
|
|
2016
2124
|
}
|
|
2017
2125
|
)
|
|
2018
2126
|
]
|
|
2019
2127
|
}
|
|
2020
2128
|
) }),
|
|
2021
|
-
/* @__PURE__ */
|
|
2129
|
+
/* @__PURE__ */ t(Fe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(Lt, {}) })
|
|
2022
2130
|
] });
|
|
2023
2131
|
}
|
|
2024
|
-
function
|
|
2025
|
-
const
|
|
2026
|
-
return o.length === 0 ? /* @__PURE__ */
|
|
2027
|
-
/* @__PURE__ */
|
|
2028
|
-
/* @__PURE__ */
|
|
2029
|
-
/* @__PURE__ */
|
|
2030
|
-
] }) : /* @__PURE__ */
|
|
2031
|
-
/* @__PURE__ */
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2035
|
-
i && /* @__PURE__ */
|
|
2132
|
+
function Lt() {
|
|
2133
|
+
const e = yt(), a = Ma(), { rows: o, activeTruncated: n } = e.snapshot, i = o.some((r) => Ua(r.item.status));
|
|
2134
|
+
return o.length === 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
|
|
2135
|
+
/* @__PURE__ */ t("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ t(Oa, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
|
|
2136
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: de.title }),
|
|
2137
|
+
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: de.empty })
|
|
2138
|
+
] }) : /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
|
|
2139
|
+
/* @__PURE__ */ s("div", { className: "flex h-8 items-center gap-2 border-b border-border px-3", children: [
|
|
2140
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: de.title }),
|
|
2141
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: o.length }),
|
|
2142
|
+
/* @__PURE__ */ s("div", { className: "ml-auto flex items-center gap-0.5", children: [
|
|
2143
|
+
i && /* @__PURE__ */ t(
|
|
2036
2144
|
I,
|
|
2037
2145
|
{
|
|
2038
2146
|
variant: "ghost",
|
|
2039
2147
|
size: "xs",
|
|
2040
2148
|
className: "h-6 px-1.5 text-[12px] text-muted-foreground hover:text-foreground",
|
|
2041
|
-
onClick:
|
|
2042
|
-
children:
|
|
2149
|
+
onClick: e.clearFinished,
|
|
2150
|
+
children: de.clear
|
|
2043
2151
|
}
|
|
2044
2152
|
),
|
|
2045
|
-
/* @__PURE__ */
|
|
2153
|
+
/* @__PURE__ */ t(
|
|
2046
2154
|
I,
|
|
2047
2155
|
{
|
|
2048
2156
|
variant: "ghost",
|
|
2049
2157
|
size: "xs",
|
|
2050
2158
|
className: "h-6 w-6 px-0 text-muted-foreground hover:text-foreground",
|
|
2051
|
-
onClick:
|
|
2159
|
+
onClick: e.refresh,
|
|
2052
2160
|
title: "Refresh status",
|
|
2053
2161
|
"aria-label": "Refresh status",
|
|
2054
|
-
children: /* @__PURE__ */
|
|
2162
|
+
children: /* @__PURE__ */ t(Rt, { strokeWidth: 1.75, className: "h-3.5 w-3.5" })
|
|
2055
2163
|
}
|
|
2056
2164
|
)
|
|
2057
2165
|
] })
|
|
2058
2166
|
] }),
|
|
2059
|
-
|
|
2060
|
-
/* @__PURE__ */
|
|
2167
|
+
n && /* @__PURE__ */ t("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children: de.truncated }),
|
|
2168
|
+
/* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y divide-border/70", children: o.map((r) => /* @__PURE__ */ t(sn, { row: r, now: a, api: e }, Ra(r))) }) })
|
|
2061
2169
|
] });
|
|
2062
2170
|
}
|
|
2063
|
-
function
|
|
2064
|
-
if (
|
|
2171
|
+
function on(e) {
|
|
2172
|
+
if (e)
|
|
2065
2173
|
return {
|
|
2066
|
-
renamed:
|
|
2067
|
-
removedControlId:
|
|
2068
|
-
cardBindingsById:
|
|
2069
|
-
affectedBindingControlIds:
|
|
2174
|
+
renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
|
|
2175
|
+
removedControlId: e.type === "remove" ? e.controlId : void 0,
|
|
2176
|
+
cardBindingsById: e.type === "add" || e.type === "update" ? e.cardBindingsById : void 0,
|
|
2177
|
+
affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
|
|
2070
2178
|
};
|
|
2071
2179
|
}
|
|
2072
|
-
function
|
|
2073
|
-
open:
|
|
2180
|
+
function ln({
|
|
2181
|
+
open: e,
|
|
2074
2182
|
onOpenChange: a,
|
|
2075
2183
|
trigger: o,
|
|
2076
|
-
showTrigger:
|
|
2184
|
+
showTrigger: n = !0,
|
|
2077
2185
|
initialMode: i = "manage"
|
|
2078
2186
|
}) {
|
|
2079
|
-
const
|
|
2080
|
-
forceClose:
|
|
2081
|
-
handleOpenChange:
|
|
2187
|
+
const r = i === "create", {
|
|
2188
|
+
forceClose: d,
|
|
2189
|
+
handleOpenChange: c,
|
|
2082
2190
|
isCreateFlowActive: l,
|
|
2083
2191
|
preventPassiveDismissDuringCreate: u,
|
|
2084
2192
|
resolvedOpen: h,
|
|
2085
2193
|
setIsCreateFlowActive: m
|
|
2086
|
-
} =
|
|
2087
|
-
open:
|
|
2194
|
+
} = qt({
|
|
2195
|
+
open: e,
|
|
2088
2196
|
onOpenChange: a,
|
|
2089
2197
|
initialCreateFlowActive: i === "create",
|
|
2090
2198
|
// Dialog mode renders a built-in X close button — allow explicit
|
|
@@ -2093,10 +2201,10 @@ function Yr({
|
|
|
2093
2201
|
// wipe the in-progress create flow, so block everything during
|
|
2094
2202
|
// create and make consumers use `forceClose()` from a dedicated
|
|
2095
2203
|
// button.
|
|
2096
|
-
dismissMode:
|
|
2097
|
-
}), p = w((C) => C.dashboard), { setDashboardControlsModel:
|
|
2204
|
+
dismissMode: n ? "passive" : "explicit-only"
|
|
2205
|
+
}), p = w((C) => C.dashboard), { setDashboardControlsModel: f } = ce(), { participants: g } = za(kr(p)), v = Array.from(
|
|
2098
2206
|
new Map(
|
|
2099
|
-
|
|
2207
|
+
g.flatMap(
|
|
2100
2208
|
(C) => C.fieldChoices.map((D) => {
|
|
2101
2209
|
var N;
|
|
2102
2210
|
return [
|
|
@@ -2109,9 +2217,9 @@ function Yr({
|
|
|
2109
2217
|
})
|
|
2110
2218
|
)
|
|
2111
2219
|
).values()
|
|
2112
|
-
),
|
|
2220
|
+
), k = Array.from(
|
|
2113
2221
|
new Map(
|
|
2114
|
-
|
|
2222
|
+
g.flatMap(
|
|
2115
2223
|
(C) => C.metricChoices.map((D) => {
|
|
2116
2224
|
var N;
|
|
2117
2225
|
return [
|
|
@@ -2124,32 +2232,32 @@ function Yr({
|
|
|
2124
2232
|
})
|
|
2125
2233
|
)
|
|
2126
2234
|
).values()
|
|
2127
|
-
),
|
|
2235
|
+
), V = xr({
|
|
2128
2236
|
...p || {},
|
|
2129
2237
|
controls: []
|
|
2130
|
-
}), U =
|
|
2131
|
-
|
|
2238
|
+
}), U = _a(p), M = (C, D, N) => {
|
|
2239
|
+
f(
|
|
2132
2240
|
C,
|
|
2133
2241
|
D,
|
|
2134
|
-
|
|
2242
|
+
on(N)
|
|
2135
2243
|
);
|
|
2136
|
-
}, A =
|
|
2137
|
-
if (
|
|
2138
|
-
|
|
2244
|
+
}, A = Z(() => {
|
|
2245
|
+
if (r) {
|
|
2246
|
+
d();
|
|
2139
2247
|
return;
|
|
2140
2248
|
}
|
|
2141
2249
|
m(!1);
|
|
2142
|
-
}, [
|
|
2143
|
-
|
|
2250
|
+
}, [r, d, m]), O = /* @__PURE__ */ t(
|
|
2251
|
+
Ht,
|
|
2144
2252
|
{
|
|
2145
2253
|
scope: "dashboard",
|
|
2146
2254
|
controls: p.controls || [],
|
|
2147
|
-
reservedControlIds:
|
|
2255
|
+
reservedControlIds: V,
|
|
2148
2256
|
defaultValues: p.defaultControlValues || {},
|
|
2149
|
-
usageByControlId:
|
|
2257
|
+
usageByControlId: ja(p),
|
|
2150
2258
|
availableFieldChoices: v,
|
|
2151
|
-
availableMetricChoices:
|
|
2152
|
-
structuralParticipants:
|
|
2259
|
+
availableMetricChoices: k,
|
|
2260
|
+
structuralParticipants: g,
|
|
2153
2261
|
structuralParticipantIdsByControlId: U,
|
|
2154
2262
|
initialCreateFlow: i === "create",
|
|
2155
2263
|
onCreateFlowActiveChange: m,
|
|
@@ -2157,20 +2265,20 @@ function Yr({
|
|
|
2157
2265
|
onChange: M,
|
|
2158
2266
|
emptyMessage: "No dashboard controls yet."
|
|
2159
2267
|
}
|
|
2160
|
-
), b = l ? "Add dashboard control" : "Dashboard Controls", F = /* @__PURE__ */
|
|
2161
|
-
/* @__PURE__ */
|
|
2162
|
-
/* @__PURE__ */
|
|
2163
|
-
/* @__PURE__ */
|
|
2268
|
+
), b = l ? "Add dashboard control" : "Dashboard Controls", F = /* @__PURE__ */ s(R, { children: [
|
|
2269
|
+
/* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
2270
|
+
/* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
2271
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
|
|
2164
2272
|
] }),
|
|
2165
|
-
|
|
2273
|
+
O
|
|
2166
2274
|
] });
|
|
2167
|
-
return
|
|
2168
|
-
/* @__PURE__ */
|
|
2169
|
-
/* @__PURE__ */
|
|
2275
|
+
return n ? /* @__PURE__ */ s(Ae, { open: h, onOpenChange: c, children: [
|
|
2276
|
+
/* @__PURE__ */ t(qe, { asChild: !0, children: o || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
2277
|
+
/* @__PURE__ */ t($t, { className: "mr-2 h-4 w-4" }),
|
|
2170
2278
|
"Controls"
|
|
2171
2279
|
] }) }),
|
|
2172
|
-
/* @__PURE__ */
|
|
2173
|
-
|
|
2280
|
+
/* @__PURE__ */ t(
|
|
2281
|
+
Fe,
|
|
2174
2282
|
{
|
|
2175
2283
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
2176
2284
|
align: "end",
|
|
@@ -2179,21 +2287,21 @@ function Yr({
|
|
|
2179
2287
|
children: F
|
|
2180
2288
|
}
|
|
2181
2289
|
)
|
|
2182
|
-
] }) : /* @__PURE__ */
|
|
2183
|
-
|
|
2290
|
+
] }) : /* @__PURE__ */ t(Ie, { open: h, onOpenChange: c, children: /* @__PURE__ */ s(
|
|
2291
|
+
Te,
|
|
2184
2292
|
{
|
|
2185
2293
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
2186
2294
|
onEscapeKeyDown: u,
|
|
2187
2295
|
onPointerDownOutside: u,
|
|
2188
2296
|
children: [
|
|
2189
|
-
/* @__PURE__ */
|
|
2190
|
-
|
|
2297
|
+
/* @__PURE__ */ s(
|
|
2298
|
+
bt,
|
|
2191
2299
|
{
|
|
2192
2300
|
className: l ? "space-y-0" : void 0,
|
|
2193
2301
|
children: [
|
|
2194
|
-
/* @__PURE__ */
|
|
2195
|
-
/* @__PURE__ */
|
|
2196
|
-
|
|
2302
|
+
/* @__PURE__ */ t(Le, { className: "text-[15px]", children: b }),
|
|
2303
|
+
/* @__PURE__ */ t(
|
|
2304
|
+
xt,
|
|
2197
2305
|
{
|
|
2198
2306
|
className: l ? "sr-only" : "text-[13px]",
|
|
2199
2307
|
children: l ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
|
|
@@ -2202,12 +2310,12 @@ function Yr({
|
|
|
2202
2310
|
]
|
|
2203
2311
|
}
|
|
2204
2312
|
),
|
|
2205
|
-
/* @__PURE__ */
|
|
2313
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: O })
|
|
2206
2314
|
]
|
|
2207
2315
|
}
|
|
2208
2316
|
) });
|
|
2209
2317
|
}
|
|
2210
|
-
const
|
|
2318
|
+
const dn = [
|
|
2211
2319
|
"enum",
|
|
2212
2320
|
"multi_enum",
|
|
2213
2321
|
"text",
|
|
@@ -2215,55 +2323,55 @@ const Jr = [
|
|
|
2215
2323
|
"boolean",
|
|
2216
2324
|
"date"
|
|
2217
2325
|
];
|
|
2218
|
-
function
|
|
2219
|
-
open:
|
|
2326
|
+
function cn({
|
|
2327
|
+
open: e,
|
|
2220
2328
|
onOpenChange: a,
|
|
2221
2329
|
initialMode: o = "manage"
|
|
2222
2330
|
}) {
|
|
2223
2331
|
var F;
|
|
2224
|
-
const
|
|
2332
|
+
const n = o === "create", {
|
|
2225
2333
|
forceClose: i,
|
|
2226
|
-
handleOpenChange:
|
|
2227
|
-
isCreateFlowActive:
|
|
2228
|
-
preventPassiveDismissDuringCreate:
|
|
2334
|
+
handleOpenChange: r,
|
|
2335
|
+
isCreateFlowActive: d,
|
|
2336
|
+
preventPassiveDismissDuringCreate: c,
|
|
2229
2337
|
resolvedOpen: l,
|
|
2230
2338
|
setIsCreateFlowActive: u
|
|
2231
|
-
} =
|
|
2232
|
-
open:
|
|
2339
|
+
} = qt({
|
|
2340
|
+
open: e,
|
|
2233
2341
|
onOpenChange: a,
|
|
2234
2342
|
initialCreateFlowActive: o === "create",
|
|
2235
2343
|
dismissMode: "explicit-only"
|
|
2236
|
-
}), h = w((C) => C.dashboard), m = w((C) => C.selectedSheetId), { setDashboardInputs: p } =
|
|
2344
|
+
}), h = w((C) => C.dashboard), m = w((C) => C.selectedSheetId), { setDashboardInputs: p } = ce(), f = (F = h.sheets) == null ? void 0 : F.find(
|
|
2237
2345
|
(C) => C.id === m
|
|
2238
|
-
),
|
|
2239
|
-
() =>
|
|
2240
|
-
[h,
|
|
2241
|
-
),
|
|
2346
|
+
), g = (f == null ? void 0 : f.kind) === "document" && !!f.document, v = te(
|
|
2347
|
+
() => g && (f != null && f.document) ? Lr(h, f.id) : [],
|
|
2348
|
+
[h, g, f == null ? void 0 : f.document, f == null ? void 0 : f.id]
|
|
2349
|
+
), k = te(
|
|
2242
2350
|
() => v.filter(
|
|
2243
2351
|
(C) => C.kind === "control"
|
|
2244
2352
|
),
|
|
2245
2353
|
[v]
|
|
2246
|
-
),
|
|
2247
|
-
() =>
|
|
2248
|
-
[
|
|
2249
|
-
), U =
|
|
2250
|
-
() =>
|
|
2251
|
-
[
|
|
2252
|
-
), M =
|
|
2253
|
-
() =>
|
|
2354
|
+
), V = te(
|
|
2355
|
+
() => k.map((C) => C.control),
|
|
2356
|
+
[k]
|
|
2357
|
+
), U = te(
|
|
2358
|
+
() => hn(V),
|
|
2359
|
+
[V]
|
|
2360
|
+
), M = te(
|
|
2361
|
+
() => un(h),
|
|
2254
2362
|
[h]
|
|
2255
|
-
), A =
|
|
2256
|
-
if (
|
|
2363
|
+
), A = Z(() => {
|
|
2364
|
+
if (n) {
|
|
2257
2365
|
i();
|
|
2258
2366
|
return;
|
|
2259
2367
|
}
|
|
2260
2368
|
u(!1);
|
|
2261
|
-
}, [
|
|
2369
|
+
}, [n, i, u]), O = Z(
|
|
2262
2370
|
(C, D, N) => {
|
|
2263
|
-
!
|
|
2264
|
-
|
|
2371
|
+
!g || !(f != null && f.document) || p(
|
|
2372
|
+
pn({
|
|
2265
2373
|
allInputs: h.inputs || [],
|
|
2266
|
-
documentSheetId:
|
|
2374
|
+
documentSheetId: f.id,
|
|
2267
2375
|
currentDocumentInputs: v,
|
|
2268
2376
|
nextControls: C,
|
|
2269
2377
|
nextDefaultValues: D,
|
|
@@ -2274,33 +2382,33 @@ function Zr({
|
|
|
2274
2382
|
[
|
|
2275
2383
|
h.inputs,
|
|
2276
2384
|
v,
|
|
2277
|
-
f,
|
|
2278
2385
|
g,
|
|
2386
|
+
f,
|
|
2279
2387
|
p
|
|
2280
2388
|
]
|
|
2281
2389
|
);
|
|
2282
|
-
return !
|
|
2283
|
-
|
|
2390
|
+
return !g || !(f != null && f.document) ? null : /* @__PURE__ */ t(Ie, { open: l, onOpenChange: r, children: /* @__PURE__ */ s(
|
|
2391
|
+
Te,
|
|
2284
2392
|
{
|
|
2285
2393
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
2286
|
-
onEscapeKeyDown:
|
|
2287
|
-
onPointerDownOutside:
|
|
2394
|
+
onEscapeKeyDown: c,
|
|
2395
|
+
onPointerDownOutside: c,
|
|
2288
2396
|
children: [
|
|
2289
|
-
/* @__PURE__ */
|
|
2290
|
-
/* @__PURE__ */
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
|
|
2397
|
+
/* @__PURE__ */ s(bt, { className: d ? "space-y-0" : void 0, children: [
|
|
2398
|
+
/* @__PURE__ */ t(Le, { className: "text-[15px]", children: d ? "Add document control" : "Document Controls" }),
|
|
2399
|
+
/* @__PURE__ */ t(
|
|
2400
|
+
xt,
|
|
2293
2401
|
{
|
|
2294
|
-
className:
|
|
2295
|
-
children:
|
|
2402
|
+
className: d ? "sr-only" : "text-[13px]",
|
|
2403
|
+
children: d ? "Configure and add a document-local control input." : "Add document-local control inputs. They are stored on this document sheet and are not dashboard controls."
|
|
2296
2404
|
}
|
|
2297
2405
|
)
|
|
2298
2406
|
] }),
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
|
|
2407
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ t(
|
|
2408
|
+
Ht,
|
|
2301
2409
|
{
|
|
2302
2410
|
scope: "dashboard",
|
|
2303
|
-
controls:
|
|
2411
|
+
controls: V,
|
|
2304
2412
|
reservedControlIds: M,
|
|
2305
2413
|
defaultValues: U,
|
|
2306
2414
|
usageByControlId: {},
|
|
@@ -2308,11 +2416,11 @@ function Zr({
|
|
|
2308
2416
|
availableMetricChoices: [],
|
|
2309
2417
|
structuralParticipants: [],
|
|
2310
2418
|
structuralParticipantIdsByControlId: {},
|
|
2311
|
-
allowedControlTypes:
|
|
2419
|
+
allowedControlTypes: dn,
|
|
2312
2420
|
initialCreateFlow: o === "create",
|
|
2313
2421
|
onCreateFlowActiveChange: u,
|
|
2314
2422
|
onCreateFlowComplete: A,
|
|
2315
|
-
onChange:
|
|
2423
|
+
onChange: O,
|
|
2316
2424
|
emptyMessage: "No document controls yet."
|
|
2317
2425
|
}
|
|
2318
2426
|
) })
|
|
@@ -2320,87 +2428,87 @@ function Zr({
|
|
|
2320
2428
|
}
|
|
2321
2429
|
) });
|
|
2322
2430
|
}
|
|
2323
|
-
function
|
|
2324
|
-
return (
|
|
2431
|
+
function un(e) {
|
|
2432
|
+
return (e.controls || []).map((a) => a.id);
|
|
2325
2433
|
}
|
|
2326
|
-
function
|
|
2434
|
+
function hn(e) {
|
|
2327
2435
|
const a = {};
|
|
2328
|
-
for (const o of
|
|
2436
|
+
for (const o of e)
|
|
2329
2437
|
o.defaultValue !== void 0 && (a[o.id] = o.defaultValue);
|
|
2330
2438
|
return a;
|
|
2331
2439
|
}
|
|
2332
|
-
function
|
|
2333
|
-
return a ? Object.prototype.hasOwnProperty.call(a,
|
|
2334
|
-
...
|
|
2335
|
-
defaultValue: a[
|
|
2336
|
-
} :
|
|
2440
|
+
function mn(e, a) {
|
|
2441
|
+
return a ? Object.prototype.hasOwnProperty.call(a, e.id) ? {
|
|
2442
|
+
...e,
|
|
2443
|
+
defaultValue: a[e.id]
|
|
2444
|
+
} : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 };
|
|
2337
2445
|
}
|
|
2338
|
-
function
|
|
2339
|
-
allInputs:
|
|
2446
|
+
function pn({
|
|
2447
|
+
allInputs: e,
|
|
2340
2448
|
documentSheetId: a,
|
|
2341
2449
|
currentDocumentInputs: o,
|
|
2342
|
-
nextControls:
|
|
2450
|
+
nextControls: n,
|
|
2343
2451
|
nextDefaultValues: i,
|
|
2344
|
-
change:
|
|
2452
|
+
change: r
|
|
2345
2453
|
}) {
|
|
2346
|
-
const
|
|
2347
|
-
|
|
2454
|
+
const d = new Map(
|
|
2455
|
+
n.map((p) => [
|
|
2348
2456
|
p.id,
|
|
2349
|
-
|
|
2457
|
+
mn(p, i)
|
|
2350
2458
|
])
|
|
2351
|
-
),
|
|
2459
|
+
), c = (r == null ? void 0 : r.type) === "rename" ? { oldId: r.oldId, newId: r.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
|
|
2352
2460
|
for (const p of o) {
|
|
2353
2461
|
if (p.kind !== "control") {
|
|
2354
2462
|
u.push(p);
|
|
2355
2463
|
continue;
|
|
2356
2464
|
}
|
|
2357
|
-
const
|
|
2358
|
-
if (!
|
|
2465
|
+
const f = d.get(p.control.id) || ((c == null ? void 0 : c.oldId) === p.control.id ? d.get(c.newId) : void 0);
|
|
2466
|
+
if (!f)
|
|
2359
2467
|
continue;
|
|
2360
|
-
l.add(
|
|
2361
|
-
const
|
|
2362
|
-
|
|
2363
|
-
[...
|
|
2364
|
-
(
|
|
2468
|
+
l.add(f.id);
|
|
2469
|
+
const g = vr(
|
|
2470
|
+
f.id,
|
|
2471
|
+
[...e, ...u].filter(
|
|
2472
|
+
(k) => k.id !== p.id
|
|
2365
2473
|
)
|
|
2366
|
-
), v =
|
|
2474
|
+
), v = f.id === g ? f : { ...f, id: g };
|
|
2367
2475
|
u.push({
|
|
2368
2476
|
...p,
|
|
2369
2477
|
label: v.label,
|
|
2370
|
-
variableName:
|
|
2478
|
+
variableName: g,
|
|
2371
2479
|
requiredAtExecution: v.requiredAtExecution,
|
|
2372
2480
|
control: v
|
|
2373
2481
|
});
|
|
2374
2482
|
}
|
|
2375
|
-
for (const p of
|
|
2483
|
+
for (const p of d.values())
|
|
2376
2484
|
l.has(p.id) || u.push(
|
|
2377
|
-
|
|
2485
|
+
Vr({
|
|
2378
2486
|
control: p,
|
|
2379
|
-
existingInputs: [...
|
|
2487
|
+
existingInputs: [...e, ...u],
|
|
2380
2488
|
sheetId: a
|
|
2381
2489
|
})
|
|
2382
2490
|
);
|
|
2383
2491
|
const h = new Set(
|
|
2384
2492
|
o.map((p) => p.id)
|
|
2385
2493
|
);
|
|
2386
|
-
return [...
|
|
2494
|
+
return [...e.filter(
|
|
2387
2495
|
(p) => !h.has(p.id)
|
|
2388
2496
|
), ...u];
|
|
2389
2497
|
}
|
|
2390
|
-
function
|
|
2391
|
-
showFilters:
|
|
2498
|
+
function fn({
|
|
2499
|
+
showFilters: e,
|
|
2392
2500
|
onShowFiltersChange: a,
|
|
2393
2501
|
pickerContent: o,
|
|
2394
|
-
settingsContent:
|
|
2502
|
+
settingsContent: n,
|
|
2395
2503
|
size: i = "default",
|
|
2396
|
-
className:
|
|
2397
|
-
primaryButtonClassName:
|
|
2398
|
-
secondaryButtonClassName:
|
|
2504
|
+
className: r,
|
|
2505
|
+
primaryButtonClassName: d,
|
|
2506
|
+
secondaryButtonClassName: c,
|
|
2399
2507
|
pickerContentClassName: l,
|
|
2400
2508
|
settingsContentClassName: u
|
|
2401
2509
|
}) {
|
|
2402
|
-
const h = i === "toolbar", [m, p] =
|
|
2403
|
-
return /* @__PURE__ */
|
|
2510
|
+
const h = i === "toolbar", [m, p] = S(!1), f = ot("interactive");
|
|
2511
|
+
return /* @__PURE__ */ s(
|
|
2404
2512
|
"div",
|
|
2405
2513
|
{
|
|
2406
2514
|
className: J(
|
|
@@ -2409,27 +2517,27 @@ function nn({
|
|
|
2409
2517
|
// stretch to fill via `h-full`.
|
|
2410
2518
|
"relative inline-flex items-stretch overflow-hidden rounded-control border border-input bg-background",
|
|
2411
2519
|
h ? "h-8" : "h-7",
|
|
2412
|
-
|
|
2520
|
+
r
|
|
2413
2521
|
),
|
|
2414
2522
|
children: [
|
|
2415
|
-
/* @__PURE__ */
|
|
2416
|
-
/* @__PURE__ */
|
|
2523
|
+
/* @__PURE__ */ s(Ae, { open: e, onOpenChange: a, children: [
|
|
2524
|
+
/* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
2417
2525
|
I,
|
|
2418
2526
|
{
|
|
2419
2527
|
variant: "ghost",
|
|
2420
2528
|
size: "xs",
|
|
2421
2529
|
className: J(
|
|
2422
2530
|
"h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
|
|
2423
|
-
|
|
2531
|
+
d
|
|
2424
2532
|
),
|
|
2425
2533
|
children: [
|
|
2426
|
-
|
|
2534
|
+
e ? /* @__PURE__ */ t(Er, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(zt, { className: "h-3.5 w-3.5" }),
|
|
2427
2535
|
"Filter"
|
|
2428
2536
|
]
|
|
2429
2537
|
}
|
|
2430
2538
|
) }),
|
|
2431
|
-
/* @__PURE__ */
|
|
2432
|
-
|
|
2539
|
+
/* @__PURE__ */ t(
|
|
2540
|
+
Fe,
|
|
2433
2541
|
{
|
|
2434
2542
|
align: "end",
|
|
2435
2543
|
sideOffset: 6,
|
|
@@ -2437,27 +2545,27 @@ function nn({
|
|
|
2437
2545
|
"w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
|
|
2438
2546
|
l
|
|
2439
2547
|
),
|
|
2440
|
-
style:
|
|
2548
|
+
style: f.contentStyle,
|
|
2441
2549
|
children: o
|
|
2442
2550
|
}
|
|
2443
2551
|
)
|
|
2444
2552
|
] }),
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */
|
|
2553
|
+
/* @__PURE__ */ s(Ae, { open: m, onOpenChange: p, children: [
|
|
2554
|
+
/* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2447
2555
|
I,
|
|
2448
2556
|
{
|
|
2449
2557
|
variant: "ghost",
|
|
2450
2558
|
size: "xs",
|
|
2451
2559
|
className: J(
|
|
2452
2560
|
"h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
|
|
2453
|
-
|
|
2561
|
+
c
|
|
2454
2562
|
),
|
|
2455
2563
|
"aria-label": "Filter and control actions",
|
|
2456
|
-
children: /* @__PURE__ */
|
|
2564
|
+
children: /* @__PURE__ */ t(wt, { className: "h-3.5 w-3.5" })
|
|
2457
2565
|
}
|
|
2458
2566
|
) }),
|
|
2459
|
-
/* @__PURE__ */
|
|
2460
|
-
|
|
2567
|
+
/* @__PURE__ */ t(
|
|
2568
|
+
Fe,
|
|
2461
2569
|
{
|
|
2462
2570
|
align: "end",
|
|
2463
2571
|
sideOffset: 6,
|
|
@@ -2465,8 +2573,8 @@ function nn({
|
|
|
2465
2573
|
"w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
|
|
2466
2574
|
u
|
|
2467
2575
|
),
|
|
2468
|
-
style:
|
|
2469
|
-
children:
|
|
2576
|
+
style: f.contentStyle,
|
|
2577
|
+
children: n(() => p(!1))
|
|
2470
2578
|
}
|
|
2471
2579
|
)
|
|
2472
2580
|
] })
|
|
@@ -2474,170 +2582,170 @@ function nn({
|
|
|
2474
2582
|
}
|
|
2475
2583
|
);
|
|
2476
2584
|
}
|
|
2477
|
-
function
|
|
2478
|
-
|
|
2479
|
-
const
|
|
2585
|
+
function gn() {
|
|
2586
|
+
Ir();
|
|
2587
|
+
const e = w((l) => l.selectedSheetId), a = w((l) => l.selectedFrameId), o = w((l) => l.dashboard), n = w((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = ce(), { setCard: r } = Ge(), d = ee((l) => l.card.dataSource);
|
|
2480
2588
|
return xe(() => {
|
|
2481
2589
|
var u, h;
|
|
2482
|
-
let l =
|
|
2590
|
+
let l = n();
|
|
2483
2591
|
if (!l) {
|
|
2484
|
-
const m = (u = o == null ? void 0 : o.sheets) == null ? void 0 : u.find((
|
|
2592
|
+
const m = (u = o == null ? void 0 : o.sheets) == null ? void 0 : u.find((f) => f.id === e), p = (h = m == null ? void 0 : m.frames) == null ? void 0 : h[0];
|
|
2485
2593
|
p && (i(p.id), l = p);
|
|
2486
2594
|
}
|
|
2487
2595
|
if (l) {
|
|
2488
2596
|
const m = l.cards.find((p) => p.id === l.activeCardId);
|
|
2489
|
-
m &&
|
|
2597
|
+
m && r(m);
|
|
2490
2598
|
}
|
|
2491
|
-
}, [
|
|
2492
|
-
hasEntities: !!(
|
|
2599
|
+
}, [n, e, a, o, i, r]), {
|
|
2600
|
+
hasEntities: !!(d != null && d.selectedEntities && d.selectedEntities.length > 0)
|
|
2493
2601
|
};
|
|
2494
2602
|
}
|
|
2495
|
-
function
|
|
2496
|
-
const
|
|
2603
|
+
function bn() {
|
|
2604
|
+
const e = w((l) => l.dashboard), a = w(
|
|
2497
2605
|
(l) => l.semanticExecutionPayload
|
|
2498
2606
|
), o = w(
|
|
2499
2607
|
(l) => l.actions.addFilterInput
|
|
2500
|
-
), { hasEntities:
|
|
2501
|
-
() =>
|
|
2502
|
-
[
|
|
2503
|
-
),
|
|
2504
|
-
return /* @__PURE__ */
|
|
2505
|
-
|
|
2608
|
+
), { hasEntities: n } = gn(), { isLoading: i } = $a(), r = te(
|
|
2609
|
+
() => yr(e, a),
|
|
2610
|
+
[e, a]
|
|
2611
|
+
), c = !Cr(e) && r.hasEligibleCards && !i;
|
|
2612
|
+
return /* @__PURE__ */ s("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
|
|
2613
|
+
c && /* @__PURE__ */ t("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ s(
|
|
2506
2614
|
"button",
|
|
2507
2615
|
{
|
|
2508
2616
|
type: "button",
|
|
2509
|
-
onClick: () => o(
|
|
2617
|
+
onClick: () => o(wr(), {
|
|
2510
2618
|
kind: "allSheets",
|
|
2511
2619
|
sheetKinds: ["dashboard"]
|
|
2512
2620
|
}),
|
|
2513
|
-
title: `Applies to ${
|
|
2621
|
+
title: `Applies to ${r.eligibleCardCount} of ${r.totalCardCount} date-aware cards`,
|
|
2514
2622
|
className: "flex w-full items-start gap-2 rounded-control px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border",
|
|
2515
2623
|
children: [
|
|
2516
|
-
/* @__PURE__ */
|
|
2517
|
-
/* @__PURE__ */
|
|
2518
|
-
/* @__PURE__ */
|
|
2519
|
-
/* @__PURE__ */
|
|
2624
|
+
/* @__PURE__ */ t(Ur, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
2625
|
+
/* @__PURE__ */ s("span", { className: "flex min-w-0 flex-col", children: [
|
|
2626
|
+
/* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
|
|
2627
|
+
/* @__PURE__ */ t("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
|
|
2520
2628
|
] })
|
|
2521
2629
|
]
|
|
2522
2630
|
}
|
|
2523
2631
|
) }),
|
|
2524
|
-
!
|
|
2525
|
-
/* @__PURE__ */
|
|
2526
|
-
/* @__PURE__ */
|
|
2527
|
-
/* @__PURE__ */
|
|
2632
|
+
!n && /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
|
|
2633
|
+
/* @__PURE__ */ t(Wa, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
|
|
2634
|
+
/* @__PURE__ */ t("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
|
|
2635
|
+
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
|
|
2528
2636
|
] }),
|
|
2529
|
-
|
|
2637
|
+
n && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(qa, { context: "filter" }) })
|
|
2530
2638
|
] });
|
|
2531
2639
|
}
|
|
2532
|
-
function
|
|
2533
|
-
onAddFilter:
|
|
2640
|
+
function xn({
|
|
2641
|
+
onAddFilter: e,
|
|
2534
2642
|
onAddControl: a,
|
|
2535
2643
|
onManageControls: o,
|
|
2536
|
-
onDismiss:
|
|
2644
|
+
onDismiss: n
|
|
2537
2645
|
}) {
|
|
2538
2646
|
const i = w(
|
|
2539
|
-
(
|
|
2540
|
-
), { setFilterLayout:
|
|
2541
|
-
return /* @__PURE__ */
|
|
2542
|
-
/* @__PURE__ */
|
|
2543
|
-
/* @__PURE__ */
|
|
2647
|
+
(c) => c.dashboard.filterLayout
|
|
2648
|
+
), { setFilterLayout: r } = ce(), d = (i == null ? void 0 : i.toolbarWrap) ?? !1;
|
|
2649
|
+
return /* @__PURE__ */ s("div", { className: "w-[300px]", children: [
|
|
2650
|
+
/* @__PURE__ */ s("div", { className: "p-1", children: [
|
|
2651
|
+
/* @__PURE__ */ t(
|
|
2544
2652
|
rt,
|
|
2545
2653
|
{
|
|
2546
|
-
icon:
|
|
2654
|
+
icon: zt,
|
|
2547
2655
|
label: "Add filter",
|
|
2548
2656
|
onClick: () => {
|
|
2549
|
-
|
|
2657
|
+
e(), n();
|
|
2550
2658
|
}
|
|
2551
2659
|
}
|
|
2552
2660
|
),
|
|
2553
|
-
/* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ t(
|
|
2554
2662
|
rt,
|
|
2555
2663
|
{
|
|
2556
|
-
icon:
|
|
2664
|
+
icon: $t,
|
|
2557
2665
|
label: "Add control",
|
|
2558
2666
|
onClick: () => {
|
|
2559
|
-
a(),
|
|
2667
|
+
a(), n();
|
|
2560
2668
|
}
|
|
2561
2669
|
}
|
|
2562
2670
|
),
|
|
2563
|
-
/* @__PURE__ */
|
|
2671
|
+
/* @__PURE__ */ t(
|
|
2564
2672
|
rt,
|
|
2565
2673
|
{
|
|
2566
|
-
icon:
|
|
2674
|
+
icon: _t,
|
|
2567
2675
|
label: "Manage controls",
|
|
2568
2676
|
onClick: () => {
|
|
2569
|
-
o(),
|
|
2677
|
+
o(), n();
|
|
2570
2678
|
}
|
|
2571
2679
|
}
|
|
2572
2680
|
)
|
|
2573
2681
|
] }),
|
|
2574
|
-
/* @__PURE__ */
|
|
2575
|
-
/* @__PURE__ */
|
|
2576
|
-
/* @__PURE__ */
|
|
2577
|
-
/* @__PURE__ */
|
|
2578
|
-
|
|
2682
|
+
/* @__PURE__ */ t("div", { className: "border-t border-border/60" }),
|
|
2683
|
+
/* @__PURE__ */ s("div", { className: "space-y-1 p-2", children: [
|
|
2684
|
+
/* @__PURE__ */ t("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
|
|
2685
|
+
/* @__PURE__ */ t(
|
|
2686
|
+
vn,
|
|
2579
2687
|
{
|
|
2580
2688
|
id: "filter-display-wrap",
|
|
2581
2689
|
label: "Wrap to multiple lines",
|
|
2582
|
-
checked:
|
|
2583
|
-
onCheckedChange: (
|
|
2690
|
+
checked: d,
|
|
2691
|
+
onCheckedChange: (c) => r({ toolbarWrap: c === !0 })
|
|
2584
2692
|
}
|
|
2585
2693
|
)
|
|
2586
2694
|
] })
|
|
2587
2695
|
] });
|
|
2588
2696
|
}
|
|
2589
2697
|
function rt({
|
|
2590
|
-
icon:
|
|
2698
|
+
icon: e,
|
|
2591
2699
|
label: a,
|
|
2592
2700
|
onClick: o
|
|
2593
2701
|
}) {
|
|
2594
|
-
return /* @__PURE__ */
|
|
2702
|
+
return /* @__PURE__ */ s(
|
|
2595
2703
|
"button",
|
|
2596
2704
|
{
|
|
2597
2705
|
type: "button",
|
|
2598
2706
|
onClick: o,
|
|
2599
2707
|
className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[13px] text-foreground outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40",
|
|
2600
2708
|
children: [
|
|
2601
|
-
/* @__PURE__ */ e
|
|
2709
|
+
/* @__PURE__ */ t(e, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
2602
2710
|
a
|
|
2603
2711
|
]
|
|
2604
2712
|
}
|
|
2605
2713
|
);
|
|
2606
2714
|
}
|
|
2607
|
-
function
|
|
2608
|
-
id:
|
|
2715
|
+
function vn({
|
|
2716
|
+
id: e,
|
|
2609
2717
|
label: a,
|
|
2610
2718
|
checked: o,
|
|
2611
|
-
onCheckedChange:
|
|
2719
|
+
onCheckedChange: n
|
|
2612
2720
|
}) {
|
|
2613
|
-
return /* @__PURE__ */
|
|
2614
|
-
/* @__PURE__ */
|
|
2615
|
-
/* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center gap-2 rounded-control px-1 py-1 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
2722
|
+
/* @__PURE__ */ t(gt, { id: e, checked: o, onCheckedChange: n }),
|
|
2723
|
+
/* @__PURE__ */ t(
|
|
2616
2724
|
De,
|
|
2617
2725
|
{
|
|
2618
|
-
htmlFor:
|
|
2726
|
+
htmlFor: e,
|
|
2619
2727
|
className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
|
|
2620
2728
|
children: a
|
|
2621
2729
|
}
|
|
2622
2730
|
)
|
|
2623
2731
|
] });
|
|
2624
2732
|
}
|
|
2625
|
-
function
|
|
2626
|
-
size:
|
|
2733
|
+
function ks({
|
|
2734
|
+
size: e,
|
|
2627
2735
|
className: a,
|
|
2628
2736
|
primaryButtonClassName: o,
|
|
2629
|
-
secondaryButtonClassName:
|
|
2737
|
+
secondaryButtonClassName: n,
|
|
2630
2738
|
pickerContentClassName: i,
|
|
2631
|
-
settingsContentClassName:
|
|
2739
|
+
settingsContentClassName: r
|
|
2632
2740
|
}) {
|
|
2633
|
-
var
|
|
2634
|
-
const [
|
|
2741
|
+
var O;
|
|
2742
|
+
const [d, c] = S(null), l = w((b) => b.dashboard), u = w((b) => b.selectedSheetId), h = w((b) => b.showFilters), m = w((b) => b.actions), { setDocumentPanelTarget: p, setShowFilters: f } = m, g = (O = l.sheets) == null ? void 0 : O.find(
|
|
2635
2743
|
(b) => b.id === u
|
|
2636
|
-
), v =
|
|
2744
|
+
), v = Nt(g), k = Z((b) => {
|
|
2637
2745
|
window.setTimeout(() => {
|
|
2638
|
-
|
|
2746
|
+
c(b);
|
|
2639
2747
|
}, 0);
|
|
2640
|
-
}, []),
|
|
2748
|
+
}, []), V = Z(
|
|
2641
2749
|
(b) => {
|
|
2642
2750
|
if (v && u) {
|
|
2643
2751
|
b && p(u, {
|
|
@@ -2646,30 +2754,30 @@ function cs({
|
|
|
2646
2754
|
});
|
|
2647
2755
|
return;
|
|
2648
2756
|
}
|
|
2649
|
-
|
|
2757
|
+
f(b);
|
|
2650
2758
|
},
|
|
2651
2759
|
[
|
|
2652
2760
|
v,
|
|
2653
2761
|
u,
|
|
2654
2762
|
p,
|
|
2655
|
-
|
|
2763
|
+
f
|
|
2656
2764
|
]
|
|
2657
|
-
), U =
|
|
2658
|
-
|
|
2659
|
-
}, [
|
|
2660
|
-
|
|
2661
|
-
}, [
|
|
2662
|
-
|
|
2663
|
-
}, [
|
|
2664
|
-
return /* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2666
|
-
|
|
2765
|
+
), U = Z(() => {
|
|
2766
|
+
V(!0);
|
|
2767
|
+
}, [V]), M = Z(() => {
|
|
2768
|
+
k("create");
|
|
2769
|
+
}, [k]), A = Z(() => {
|
|
2770
|
+
k("manage");
|
|
2771
|
+
}, [k]);
|
|
2772
|
+
return /* @__PURE__ */ s(R, { children: [
|
|
2773
|
+
/* @__PURE__ */ t(
|
|
2774
|
+
fn,
|
|
2667
2775
|
{
|
|
2668
2776
|
showFilters: v ? !1 : h,
|
|
2669
|
-
onShowFiltersChange:
|
|
2670
|
-
pickerContent: /* @__PURE__ */
|
|
2671
|
-
settingsContent: (b) => /* @__PURE__ */
|
|
2672
|
-
|
|
2777
|
+
onShowFiltersChange: V,
|
|
2778
|
+
pickerContent: /* @__PURE__ */ t(bn, {}),
|
|
2779
|
+
settingsContent: (b) => /* @__PURE__ */ t(
|
|
2780
|
+
xn,
|
|
2673
2781
|
{
|
|
2674
2782
|
onAddFilter: U,
|
|
2675
2783
|
onAddControl: M,
|
|
@@ -2677,122 +2785,122 @@ function cs({
|
|
|
2677
2785
|
onDismiss: b
|
|
2678
2786
|
}
|
|
2679
2787
|
),
|
|
2680
|
-
size:
|
|
2788
|
+
size: e,
|
|
2681
2789
|
className: a,
|
|
2682
2790
|
primaryButtonClassName: o,
|
|
2683
|
-
secondaryButtonClassName:
|
|
2791
|
+
secondaryButtonClassName: n,
|
|
2684
2792
|
pickerContentClassName: i,
|
|
2685
|
-
settingsContentClassName:
|
|
2793
|
+
settingsContentClassName: r
|
|
2686
2794
|
}
|
|
2687
2795
|
),
|
|
2688
|
-
|
|
2689
|
-
|
|
2796
|
+
d ? v ? /* @__PURE__ */ t(
|
|
2797
|
+
cn,
|
|
2690
2798
|
{
|
|
2691
2799
|
open: !0,
|
|
2692
2800
|
onOpenChange: (b) => {
|
|
2693
|
-
b ||
|
|
2801
|
+
b || c(null);
|
|
2694
2802
|
},
|
|
2695
|
-
initialMode:
|
|
2803
|
+
initialMode: d
|
|
2696
2804
|
}
|
|
2697
|
-
) : /* @__PURE__ */
|
|
2698
|
-
|
|
2805
|
+
) : /* @__PURE__ */ t(
|
|
2806
|
+
ln,
|
|
2699
2807
|
{
|
|
2700
2808
|
open: !0,
|
|
2701
2809
|
onOpenChange: (b) => {
|
|
2702
|
-
b ||
|
|
2810
|
+
b || c(null);
|
|
2703
2811
|
},
|
|
2704
2812
|
showTrigger: !1,
|
|
2705
|
-
initialMode:
|
|
2813
|
+
initialMode: d
|
|
2706
2814
|
}
|
|
2707
2815
|
) : null
|
|
2708
2816
|
] });
|
|
2709
2817
|
}
|
|
2710
|
-
function
|
|
2711
|
-
disabled:
|
|
2818
|
+
function yn({
|
|
2819
|
+
disabled: e,
|
|
2712
2820
|
briefingCount: a,
|
|
2713
2821
|
className: o,
|
|
2714
|
-
onClick:
|
|
2822
|
+
onClick: n
|
|
2715
2823
|
}) {
|
|
2716
2824
|
const i = typeof a == "number" && a > 0;
|
|
2717
|
-
return /* @__PURE__ */
|
|
2825
|
+
return /* @__PURE__ */ s(
|
|
2718
2826
|
I,
|
|
2719
2827
|
{
|
|
2720
2828
|
type: "button",
|
|
2721
2829
|
size: "xs",
|
|
2722
2830
|
variant: "outline",
|
|
2723
|
-
disabled:
|
|
2831
|
+
disabled: e,
|
|
2724
2832
|
className: J("gap-1.5", o),
|
|
2725
|
-
onClick:
|
|
2833
|
+
onClick: n,
|
|
2726
2834
|
"aria-label": "Reports & briefings",
|
|
2727
2835
|
children: [
|
|
2728
|
-
/* @__PURE__ */
|
|
2836
|
+
/* @__PURE__ */ t(zr, { className: "h-3.5 w-3.5" }),
|
|
2729
2837
|
"Reports & briefings",
|
|
2730
|
-
i ? /* @__PURE__ */
|
|
2838
|
+
i ? /* @__PURE__ */ t("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
|
|
2731
2839
|
]
|
|
2732
2840
|
}
|
|
2733
2841
|
);
|
|
2734
2842
|
}
|
|
2735
|
-
const
|
|
2736
|
-
function
|
|
2737
|
-
return
|
|
2843
|
+
const Cn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Zt = "inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", je = "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-3 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50";
|
|
2844
|
+
function wn(e) {
|
|
2845
|
+
return e === "dashboard" ? "This dashboard" : "Project";
|
|
2738
2846
|
}
|
|
2739
|
-
function
|
|
2740
|
-
if (!
|
|
2741
|
-
const a = new Date(
|
|
2847
|
+
function Nn(e) {
|
|
2848
|
+
if (!e) return "Never";
|
|
2849
|
+
const a = new Date(e);
|
|
2742
2850
|
if (Number.isNaN(a.getTime())) return "Unknown";
|
|
2743
|
-
const o = Date.now() - a.getTime(),
|
|
2744
|
-
if (
|
|
2745
|
-
if (
|
|
2746
|
-
const i = Math.round(
|
|
2851
|
+
const o = Date.now() - a.getTime(), n = Math.round(o / 6e4);
|
|
2852
|
+
if (n < 1) return "now";
|
|
2853
|
+
if (n < 60) return `${n}m ago`;
|
|
2854
|
+
const i = Math.round(n / 60);
|
|
2747
2855
|
if (i < 24) return `${i}h ago`;
|
|
2748
|
-
const
|
|
2749
|
-
if (
|
|
2750
|
-
const
|
|
2751
|
-
return
|
|
2752
|
-
}
|
|
2753
|
-
function
|
|
2754
|
-
return
|
|
2755
|
-
|
|
2756
|
-
|
|
2856
|
+
const r = Math.round(i / 24);
|
|
2857
|
+
if (r < 7) return `${r}d ago`;
|
|
2858
|
+
const d = Math.round(r / 7);
|
|
2859
|
+
return d < 5 ? `${d}w ago` : `${Math.round(r / 30)}mo ago`;
|
|
2860
|
+
}
|
|
2861
|
+
function Sn(e) {
|
|
2862
|
+
return e.scheduleExpr ? Br(
|
|
2863
|
+
e.scheduleExpr,
|
|
2864
|
+
e.timezone || "UTC"
|
|
2757
2865
|
) ?? "Invalid schedule" : "On demand";
|
|
2758
2866
|
}
|
|
2759
|
-
function
|
|
2760
|
-
if (
|
|
2761
|
-
const a =
|
|
2762
|
-
return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${
|
|
2867
|
+
function kn(e) {
|
|
2868
|
+
if (e.lastRunStatus) {
|
|
2869
|
+
const a = e.lastRunStatus.toString().toUpperCase();
|
|
2870
|
+
return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${e.lastRunStatus.toString().toLowerCase()}`;
|
|
2763
2871
|
}
|
|
2764
2872
|
return null;
|
|
2765
2873
|
}
|
|
2766
|
-
function
|
|
2767
|
-
return
|
|
2874
|
+
function Jt(e) {
|
|
2875
|
+
return e.hasActiveRun ? "Running" : e.lastRunStatus ? `Last run ${e.lastRunStatus.toString().toLowerCase()}` : "Idle";
|
|
2768
2876
|
}
|
|
2769
|
-
function
|
|
2770
|
-
return
|
|
2877
|
+
function Dn(e) {
|
|
2878
|
+
return e.source.type === "dashboard" ? "This dashboard" : "Project";
|
|
2771
2879
|
}
|
|
2772
|
-
function
|
|
2773
|
-
activeView:
|
|
2880
|
+
function An({
|
|
2881
|
+
activeView: e,
|
|
2774
2882
|
onChange: a
|
|
2775
2883
|
}) {
|
|
2776
|
-
return /* @__PURE__ */
|
|
2884
|
+
return /* @__PURE__ */ t(
|
|
2777
2885
|
"div",
|
|
2778
2886
|
{
|
|
2779
2887
|
className: "flex shrink-0 items-center gap-1 rounded-control bg-muted p-0.5",
|
|
2780
2888
|
role: "tablist",
|
|
2781
2889
|
"aria-label": "Briefing source view",
|
|
2782
2890
|
children: ["dashboard", "project"].map((o) => {
|
|
2783
|
-
const
|
|
2784
|
-
return /* @__PURE__ */
|
|
2891
|
+
const n = e === o;
|
|
2892
|
+
return /* @__PURE__ */ t(
|
|
2785
2893
|
"button",
|
|
2786
2894
|
{
|
|
2787
2895
|
type: "button",
|
|
2788
2896
|
role: "tab",
|
|
2789
|
-
"aria-selected":
|
|
2897
|
+
"aria-selected": n,
|
|
2790
2898
|
onClick: () => a(o),
|
|
2791
2899
|
className: J(
|
|
2792
2900
|
"h-6 rounded-[3px] px-2 text-[11px] transition-colors",
|
|
2793
|
-
|
|
2901
|
+
n ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
2794
2902
|
),
|
|
2795
|
-
children:
|
|
2903
|
+
children: wn(o)
|
|
2796
2904
|
},
|
|
2797
2905
|
o
|
|
2798
2906
|
);
|
|
@@ -2800,97 +2908,97 @@ function bn({
|
|
|
2800
2908
|
}
|
|
2801
2909
|
);
|
|
2802
2910
|
}
|
|
2803
|
-
function
|
|
2804
|
-
briefings:
|
|
2911
|
+
function Fn({
|
|
2912
|
+
briefings: e,
|
|
2805
2913
|
dashboardLabel: a,
|
|
2806
2914
|
sourceView: o,
|
|
2807
|
-
error:
|
|
2915
|
+
error: n,
|
|
2808
2916
|
loading: i,
|
|
2809
|
-
onSourceViewChange:
|
|
2810
|
-
onClose:
|
|
2811
|
-
onEdit:
|
|
2917
|
+
onSourceViewChange: r,
|
|
2918
|
+
onClose: d,
|
|
2919
|
+
onEdit: c,
|
|
2812
2920
|
onNew: l,
|
|
2813
2921
|
canCreate: u,
|
|
2814
2922
|
canCreateScheduledReport: h,
|
|
2815
2923
|
analyticalBriefingsEnabled: m,
|
|
2816
2924
|
onRunNow: p,
|
|
2817
|
-
onTogglePause:
|
|
2818
|
-
onDelete:
|
|
2925
|
+
onTogglePause: f,
|
|
2926
|
+
onDelete: g,
|
|
2819
2927
|
selectingId: v,
|
|
2820
|
-
busyId:
|
|
2821
|
-
manageBriefingsHref:
|
|
2928
|
+
busyId: k,
|
|
2929
|
+
manageBriefingsHref: V,
|
|
2822
2930
|
contentKind: U,
|
|
2823
2931
|
hideHeader: M = !1
|
|
2824
2932
|
}) {
|
|
2825
|
-
const A =
|
|
2826
|
-
return /* @__PURE__ */
|
|
2933
|
+
const A = e.length, O = e.filter((N) => N.status === "ACTIVE").length, b = U === "reports" ? A === 1 ? "report" : "reports" : U === "briefings" ? A === 1 ? "briefing" : "briefings" : A === 1 ? "item" : "items", F = e.find((N) => N.hasActiveRun) ?? null, C = U ?? "reports & briefings", D = o === "dashboard" ? a : `Project ${C}`;
|
|
2934
|
+
return /* @__PURE__ */ s(
|
|
2827
2935
|
"section",
|
|
2828
2936
|
{
|
|
2829
2937
|
"aria-label": `Dashboard ${C.replace("&", "and")}`,
|
|
2830
2938
|
className: "flex h-full min-h-0 flex-col bg-background text-foreground",
|
|
2831
2939
|
children: [
|
|
2832
|
-
M ? null : /* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
2940
|
+
M ? null : /* @__PURE__ */ s("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
2941
|
+
/* @__PURE__ */ s("div", { className: "min-w-0", children: [
|
|
2942
|
+
/* @__PURE__ */ t("div", { className: Cn, children: C }),
|
|
2943
|
+
/* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: D })
|
|
2836
2944
|
] }),
|
|
2837
|
-
/* @__PURE__ */
|
|
2945
|
+
/* @__PURE__ */ t(
|
|
2838
2946
|
"button",
|
|
2839
2947
|
{
|
|
2840
2948
|
type: "button",
|
|
2841
|
-
onClick:
|
|
2949
|
+
onClick: d,
|
|
2842
2950
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2843
2951
|
"aria-label": `Close ${C.replace("&", "and")} panel`,
|
|
2844
|
-
children: /* @__PURE__ */
|
|
2952
|
+
children: /* @__PURE__ */ t(Xe, { className: "h-3.5 w-3.5" })
|
|
2845
2953
|
}
|
|
2846
2954
|
)
|
|
2847
2955
|
] }),
|
|
2848
|
-
/* @__PURE__ */
|
|
2849
|
-
/* @__PURE__ */
|
|
2850
|
-
/* @__PURE__ */
|
|
2851
|
-
|
|
2956
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-3 border-b border-border px-4 py-2", children: [
|
|
2957
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
2958
|
+
/* @__PURE__ */ t(
|
|
2959
|
+
An,
|
|
2852
2960
|
{
|
|
2853
2961
|
activeView: o,
|
|
2854
|
-
onChange:
|
|
2962
|
+
onChange: r
|
|
2855
2963
|
}
|
|
2856
2964
|
),
|
|
2857
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && A === 0 ? /* @__PURE__ */ s("span", { children: [
|
|
2858
2966
|
"Loading ",
|
|
2859
2967
|
C,
|
|
2860
2968
|
"…"
|
|
2861
|
-
] }) : A === 0 ? /* @__PURE__ */
|
|
2969
|
+
] }) : A === 0 ? /* @__PURE__ */ s("span", { children: [
|
|
2862
2970
|
"No ",
|
|
2863
2971
|
C,
|
|
2864
2972
|
" yet"
|
|
2865
|
-
] }) : /* @__PURE__ */
|
|
2866
|
-
/* @__PURE__ */
|
|
2973
|
+
] }) : /* @__PURE__ */ s(R, { children: [
|
|
2974
|
+
/* @__PURE__ */ s("span", { className: "font-medium text-foreground/80", children: [
|
|
2867
2975
|
A,
|
|
2868
2976
|
" ",
|
|
2869
2977
|
b
|
|
2870
2978
|
] }),
|
|
2871
|
-
/* @__PURE__ */
|
|
2872
|
-
/* @__PURE__ */
|
|
2873
|
-
|
|
2979
|
+
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
2980
|
+
/* @__PURE__ */ s("span", { children: [
|
|
2981
|
+
O,
|
|
2874
2982
|
" active"
|
|
2875
2983
|
] })
|
|
2876
2984
|
] }) })
|
|
2877
2985
|
] }),
|
|
2878
|
-
/* @__PURE__ */
|
|
2986
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
|
|
2879
2987
|
i ? (
|
|
2880
2988
|
// Auto-refresh on open; surface a quiet spinner near the count
|
|
2881
2989
|
// when a manual reload is in flight, but don't show a separate
|
|
2882
2990
|
// refresh button — close+reopen handles the rare "stale list"
|
|
2883
2991
|
// case without crowding the toolbar.
|
|
2884
|
-
/* @__PURE__ */
|
|
2992
|
+
/* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
|
|
2885
2993
|
) : null,
|
|
2886
|
-
A > 0 && u ? m && h ? /* @__PURE__ */
|
|
2887
|
-
/* @__PURE__ */
|
|
2888
|
-
/* @__PURE__ */
|
|
2994
|
+
A > 0 && u ? m && h ? /* @__PURE__ */ s(Ve, { children: [
|
|
2995
|
+
/* @__PURE__ */ t(Be, { asChild: !0, children: /* @__PURE__ */ s("button", { className: je, children: [
|
|
2996
|
+
/* @__PURE__ */ t(ve, { className: "h-3 w-3" }),
|
|
2889
2997
|
" New"
|
|
2890
2998
|
] }) }),
|
|
2891
|
-
/* @__PURE__ */
|
|
2892
|
-
/* @__PURE__ */
|
|
2893
|
-
/* @__PURE__ */
|
|
2999
|
+
/* @__PURE__ */ s(Pe, { align: "end", children: [
|
|
3000
|
+
/* @__PURE__ */ t(G, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
|
|
3001
|
+
/* @__PURE__ */ t(
|
|
2894
3002
|
G,
|
|
2895
3003
|
{
|
|
2896
3004
|
onClick: () => l("analytical_briefing"),
|
|
@@ -2898,39 +3006,39 @@ function xn({
|
|
|
2898
3006
|
}
|
|
2899
3007
|
)
|
|
2900
3008
|
] })
|
|
2901
|
-
] }) : h ? /* @__PURE__ */
|
|
3009
|
+
] }) : h ? /* @__PURE__ */ s(
|
|
2902
3010
|
"button",
|
|
2903
3011
|
{
|
|
2904
3012
|
onClick: () => l("scheduled_report"),
|
|
2905
|
-
className:
|
|
3013
|
+
className: je,
|
|
2906
3014
|
children: [
|
|
2907
|
-
/* @__PURE__ */
|
|
3015
|
+
/* @__PURE__ */ t(ve, { className: "h-3 w-3" }),
|
|
2908
3016
|
" Schedule report"
|
|
2909
3017
|
]
|
|
2910
3018
|
}
|
|
2911
|
-
) : m ? /* @__PURE__ */
|
|
3019
|
+
) : m ? /* @__PURE__ */ s(
|
|
2912
3020
|
"button",
|
|
2913
3021
|
{
|
|
2914
3022
|
onClick: () => l("analytical_briefing"),
|
|
2915
|
-
className:
|
|
3023
|
+
className: je,
|
|
2916
3024
|
children: [
|
|
2917
|
-
/* @__PURE__ */
|
|
3025
|
+
/* @__PURE__ */ t(ve, { className: "h-3 w-3" }),
|
|
2918
3026
|
" New briefing"
|
|
2919
3027
|
]
|
|
2920
3028
|
}
|
|
2921
3029
|
) : null : null
|
|
2922
3030
|
] })
|
|
2923
3031
|
] }),
|
|
2924
|
-
F ? /* @__PURE__ */
|
|
2925
|
-
/* @__PURE__ */
|
|
2926
|
-
/* @__PURE__ */
|
|
2927
|
-
/* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
3032
|
+
F ? /* @__PURE__ */ s("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
|
|
3033
|
+
/* @__PURE__ */ t(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
|
|
3034
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: F.name }),
|
|
3035
|
+
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
3036
|
+
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: Jt(F) })
|
|
2929
3037
|
] }) : null,
|
|
2930
|
-
/* @__PURE__ */
|
|
2931
|
-
|
|
2932
|
-
!i &&
|
|
2933
|
-
|
|
3038
|
+
/* @__PURE__ */ s("div", { className: "flex-1 overflow-y-auto", children: [
|
|
3039
|
+
n ? /* @__PURE__ */ t("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: n }) : null,
|
|
3040
|
+
!i && e.length === 0 && !n ? /* @__PURE__ */ t(
|
|
3041
|
+
En,
|
|
2934
3042
|
{
|
|
2935
3043
|
onNew: l,
|
|
2936
3044
|
canCreate: u,
|
|
@@ -2939,28 +3047,28 @@ function xn({
|
|
|
2939
3047
|
contentKind: U
|
|
2940
3048
|
}
|
|
2941
3049
|
) : null,
|
|
2942
|
-
|
|
2943
|
-
|
|
3050
|
+
e.map((N) => /* @__PURE__ */ t(
|
|
3051
|
+
Tn,
|
|
2944
3052
|
{
|
|
2945
3053
|
briefing: N,
|
|
2946
3054
|
isOpening: v === N.id,
|
|
2947
|
-
isBusy:
|
|
2948
|
-
onOpen: () =>
|
|
3055
|
+
isBusy: k === N.id,
|
|
3056
|
+
onOpen: () => c(N.id),
|
|
2949
3057
|
onRunNow: () => p(N),
|
|
2950
|
-
onTogglePause: () =>
|
|
2951
|
-
onDelete: () =>
|
|
3058
|
+
onTogglePause: () => f(N),
|
|
3059
|
+
onDelete: () => g(N)
|
|
2952
3060
|
},
|
|
2953
3061
|
N.id
|
|
2954
3062
|
))
|
|
2955
3063
|
] }),
|
|
2956
|
-
|
|
3064
|
+
V ? /* @__PURE__ */ t("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ s(
|
|
2957
3065
|
"a",
|
|
2958
3066
|
{
|
|
2959
|
-
href:
|
|
2960
|
-
className: J(
|
|
3067
|
+
href: V,
|
|
3068
|
+
className: J(Zt, "h-6 px-1 text-[11px]"),
|
|
2961
3069
|
children: [
|
|
2962
3070
|
"Manage all reports & briefings",
|
|
2963
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ t(Mr, { className: "h-3 w-3" })
|
|
2964
3072
|
]
|
|
2965
3073
|
}
|
|
2966
3074
|
) }) : null
|
|
@@ -2968,49 +3076,49 @@ function xn({
|
|
|
2968
3076
|
}
|
|
2969
3077
|
);
|
|
2970
3078
|
}
|
|
2971
|
-
function
|
|
2972
|
-
onNew:
|
|
3079
|
+
function En({
|
|
3080
|
+
onNew: e,
|
|
2973
3081
|
canCreate: a,
|
|
2974
3082
|
canCreateScheduledReport: o,
|
|
2975
|
-
analyticalBriefingsEnabled:
|
|
3083
|
+
analyticalBriefingsEnabled: n,
|
|
2976
3084
|
contentKind: i
|
|
2977
3085
|
}) {
|
|
2978
|
-
const
|
|
3086
|
+
const r = i === "reports" ? {
|
|
2979
3087
|
title: "No reports yet",
|
|
2980
3088
|
description: "Schedule an emailed dashboard or visual report to see it here."
|
|
2981
3089
|
} : i === "briefings" ? {
|
|
2982
3090
|
title: "No briefings yet",
|
|
2983
3091
|
description: "Create an analytical briefing to monitor this dashboard and brief your team."
|
|
2984
3092
|
} : null;
|
|
2985
|
-
return /* @__PURE__ */
|
|
2986
|
-
/* @__PURE__ */
|
|
2987
|
-
/* @__PURE__ */
|
|
2988
|
-
/* @__PURE__ */
|
|
2989
|
-
a ? /* @__PURE__ */
|
|
2990
|
-
o ? /* @__PURE__ */
|
|
3093
|
+
return /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
|
|
3094
|
+
/* @__PURE__ */ t(In, { className: "mb-5 h-[88px] w-[112px] text-border" }),
|
|
3095
|
+
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: (r == null ? void 0 : r.title) ?? "Have an analyst brief your team" }),
|
|
3096
|
+
/* @__PURE__ */ t("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (r == null ? void 0 : r.description) ?? "Describe what to watch. An analyst digs into this dashboard and the data behind it, then briefs your team on the cadence you choose." }),
|
|
3097
|
+
a ? /* @__PURE__ */ s("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
|
|
3098
|
+
o ? /* @__PURE__ */ s(
|
|
2991
3099
|
"button",
|
|
2992
3100
|
{
|
|
2993
|
-
onClick: () =>
|
|
2994
|
-
className:
|
|
3101
|
+
onClick: () => e("scheduled_report"),
|
|
3102
|
+
className: je,
|
|
2995
3103
|
children: [
|
|
2996
|
-
/* @__PURE__ */
|
|
3104
|
+
/* @__PURE__ */ t(ve, { className: "h-3 w-3" }),
|
|
2997
3105
|
" Schedule a report"
|
|
2998
3106
|
]
|
|
2999
3107
|
}
|
|
3000
3108
|
) : null,
|
|
3001
|
-
|
|
3109
|
+
n ? /* @__PURE__ */ t(
|
|
3002
3110
|
"button",
|
|
3003
3111
|
{
|
|
3004
|
-
onClick: () =>
|
|
3005
|
-
className:
|
|
3112
|
+
onClick: () => e("analytical_briefing"),
|
|
3113
|
+
className: Zt,
|
|
3006
3114
|
children: "Create analytical briefing"
|
|
3007
3115
|
}
|
|
3008
3116
|
) : null
|
|
3009
3117
|
] }) : null
|
|
3010
3118
|
] });
|
|
3011
3119
|
}
|
|
3012
|
-
function
|
|
3013
|
-
return /* @__PURE__ */
|
|
3120
|
+
function In({ className: e }) {
|
|
3121
|
+
return /* @__PURE__ */ s(
|
|
3014
3122
|
"svg",
|
|
3015
3123
|
{
|
|
3016
3124
|
viewBox: "0 0 112 88",
|
|
@@ -3018,9 +3126,9 @@ function yn({ className: t }) {
|
|
|
3018
3126
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3019
3127
|
role: "presentation",
|
|
3020
3128
|
"aria-hidden": "true",
|
|
3021
|
-
className:
|
|
3129
|
+
className: e,
|
|
3022
3130
|
children: [
|
|
3023
|
-
/* @__PURE__ */
|
|
3131
|
+
/* @__PURE__ */ t(
|
|
3024
3132
|
"rect",
|
|
3025
3133
|
{
|
|
3026
3134
|
x: "22",
|
|
@@ -3032,7 +3140,7 @@ function yn({ className: t }) {
|
|
|
3032
3140
|
strokeWidth: "1.25"
|
|
3033
3141
|
}
|
|
3034
3142
|
),
|
|
3035
|
-
/* @__PURE__ */
|
|
3143
|
+
/* @__PURE__ */ t(
|
|
3036
3144
|
"line",
|
|
3037
3145
|
{
|
|
3038
3146
|
x1: "30",
|
|
@@ -3044,7 +3152,7 @@ function yn({ className: t }) {
|
|
|
3044
3152
|
strokeLinecap: "round"
|
|
3045
3153
|
}
|
|
3046
3154
|
),
|
|
3047
|
-
/* @__PURE__ */
|
|
3155
|
+
/* @__PURE__ */ t(
|
|
3048
3156
|
"line",
|
|
3049
3157
|
{
|
|
3050
3158
|
x1: "30",
|
|
@@ -3057,8 +3165,8 @@ function yn({ className: t }) {
|
|
|
3057
3165
|
opacity: "0.5"
|
|
3058
3166
|
}
|
|
3059
3167
|
),
|
|
3060
|
-
/* @__PURE__ */
|
|
3061
|
-
/* @__PURE__ */
|
|
3168
|
+
/* @__PURE__ */ t("circle", { cx: "31", cy: "32", r: "1", fill: "currentColor", opacity: "0.6" }),
|
|
3169
|
+
/* @__PURE__ */ t(
|
|
3062
3170
|
"line",
|
|
3063
3171
|
{
|
|
3064
3172
|
x1: "35",
|
|
@@ -3071,8 +3179,8 @@ function yn({ className: t }) {
|
|
|
3071
3179
|
strokeLinecap: "round"
|
|
3072
3180
|
}
|
|
3073
3181
|
),
|
|
3074
|
-
/* @__PURE__ */
|
|
3075
|
-
/* @__PURE__ */
|
|
3182
|
+
/* @__PURE__ */ t("circle", { cx: "31", cy: "38", r: "1", fill: "currentColor", opacity: "0.6" }),
|
|
3183
|
+
/* @__PURE__ */ t(
|
|
3076
3184
|
"line",
|
|
3077
3185
|
{
|
|
3078
3186
|
x1: "35",
|
|
@@ -3085,8 +3193,8 @@ function yn({ className: t }) {
|
|
|
3085
3193
|
strokeLinecap: "round"
|
|
3086
3194
|
}
|
|
3087
3195
|
),
|
|
3088
|
-
/* @__PURE__ */
|
|
3089
|
-
/* @__PURE__ */
|
|
3196
|
+
/* @__PURE__ */ t("circle", { cx: "31", cy: "44", r: "1", fill: "currentColor", opacity: "0.6" }),
|
|
3197
|
+
/* @__PURE__ */ t(
|
|
3090
3198
|
"line",
|
|
3091
3199
|
{
|
|
3092
3200
|
x1: "35",
|
|
@@ -3099,7 +3207,7 @@ function yn({ className: t }) {
|
|
|
3099
3207
|
strokeLinecap: "round"
|
|
3100
3208
|
}
|
|
3101
3209
|
),
|
|
3102
|
-
/* @__PURE__ */
|
|
3210
|
+
/* @__PURE__ */ t(
|
|
3103
3211
|
"rect",
|
|
3104
3212
|
{
|
|
3105
3213
|
x: "30",
|
|
@@ -3111,7 +3219,7 @@ function yn({ className: t }) {
|
|
|
3111
3219
|
opacity: "0.55"
|
|
3112
3220
|
}
|
|
3113
3221
|
),
|
|
3114
|
-
/* @__PURE__ */
|
|
3222
|
+
/* @__PURE__ */ t(
|
|
3115
3223
|
"rect",
|
|
3116
3224
|
{
|
|
3117
3225
|
x: "38",
|
|
@@ -3123,7 +3231,7 @@ function yn({ className: t }) {
|
|
|
3123
3231
|
opacity: "0.7"
|
|
3124
3232
|
}
|
|
3125
3233
|
),
|
|
3126
|
-
/* @__PURE__ */
|
|
3234
|
+
/* @__PURE__ */ t(
|
|
3127
3235
|
"rect",
|
|
3128
3236
|
{
|
|
3129
3237
|
x: "46",
|
|
@@ -3135,7 +3243,7 @@ function yn({ className: t }) {
|
|
|
3135
3243
|
opacity: "0.85"
|
|
3136
3244
|
}
|
|
3137
3245
|
),
|
|
3138
|
-
/* @__PURE__ */
|
|
3246
|
+
/* @__PURE__ */ t(
|
|
3139
3247
|
"rect",
|
|
3140
3248
|
{
|
|
3141
3249
|
x: "54",
|
|
@@ -3147,7 +3255,7 @@ function yn({ className: t }) {
|
|
|
3147
3255
|
opacity: "0.6"
|
|
3148
3256
|
}
|
|
3149
3257
|
),
|
|
3150
|
-
/* @__PURE__ */
|
|
3258
|
+
/* @__PURE__ */ t(
|
|
3151
3259
|
"rect",
|
|
3152
3260
|
{
|
|
3153
3261
|
x: "62",
|
|
@@ -3159,7 +3267,7 @@ function yn({ className: t }) {
|
|
|
3159
3267
|
opacity: "0.75"
|
|
3160
3268
|
}
|
|
3161
3269
|
),
|
|
3162
|
-
/* @__PURE__ */
|
|
3270
|
+
/* @__PURE__ */ t(
|
|
3163
3271
|
"circle",
|
|
3164
3272
|
{
|
|
3165
3273
|
cx: "86",
|
|
@@ -3170,7 +3278,7 @@ function yn({ className: t }) {
|
|
|
3170
3278
|
strokeWidth: "1.25"
|
|
3171
3279
|
}
|
|
3172
3280
|
),
|
|
3173
|
-
/* @__PURE__ */
|
|
3281
|
+
/* @__PURE__ */ t(
|
|
3174
3282
|
"line",
|
|
3175
3283
|
{
|
|
3176
3284
|
x1: "93.5",
|
|
@@ -3186,123 +3294,123 @@ function yn({ className: t }) {
|
|
|
3186
3294
|
}
|
|
3187
3295
|
);
|
|
3188
3296
|
}
|
|
3189
|
-
function
|
|
3190
|
-
briefing:
|
|
3297
|
+
function Tn({
|
|
3298
|
+
briefing: e,
|
|
3191
3299
|
isOpening: a,
|
|
3192
3300
|
isBusy: o,
|
|
3193
|
-
onOpen:
|
|
3301
|
+
onOpen: n,
|
|
3194
3302
|
onRunNow: i,
|
|
3195
|
-
onTogglePause:
|
|
3196
|
-
onDelete:
|
|
3303
|
+
onTogglePause: r,
|
|
3304
|
+
onDelete: d
|
|
3197
3305
|
}) {
|
|
3198
|
-
const
|
|
3199
|
-
return /* @__PURE__ */
|
|
3306
|
+
const c = e.status === "PAUSED", l = e.hasActiveRun, u = kn(e), h = Nn(e.lastRunAt), m = e.lastRunStatus, p = le(e), f = m === "SUCCESS" ? ze.success.dot : m === "FAILED" ? ze.danger.dot : m ? ze.warning.dot : ze.neutral.dot;
|
|
3307
|
+
return /* @__PURE__ */ s(
|
|
3200
3308
|
"div",
|
|
3201
3309
|
{
|
|
3202
3310
|
className: J(
|
|
3203
3311
|
"group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
|
|
3204
|
-
|
|
3312
|
+
c && "opacity-70"
|
|
3205
3313
|
),
|
|
3206
3314
|
children: [
|
|
3207
|
-
/* @__PURE__ */
|
|
3315
|
+
/* @__PURE__ */ s(
|
|
3208
3316
|
"div",
|
|
3209
3317
|
{
|
|
3210
3318
|
role: "button",
|
|
3211
3319
|
tabIndex: 0,
|
|
3212
|
-
onClick:
|
|
3213
|
-
onKeyDown: (
|
|
3214
|
-
(
|
|
3320
|
+
onClick: n,
|
|
3321
|
+
onKeyDown: (g) => {
|
|
3322
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), n());
|
|
3215
3323
|
},
|
|
3216
3324
|
className: "cursor-pointer pr-8",
|
|
3217
3325
|
children: [
|
|
3218
|
-
/* @__PURE__ */
|
|
3219
|
-
/* @__PURE__ */
|
|
3220
|
-
|
|
3326
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
3327
|
+
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.name }),
|
|
3328
|
+
c ? /* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
|
|
3221
3329
|
] }),
|
|
3222
|
-
/* @__PURE__ */
|
|
3223
|
-
/* @__PURE__ */
|
|
3224
|
-
/* @__PURE__ */
|
|
3225
|
-
/* @__PURE__ */
|
|
3226
|
-
/* @__PURE__ */
|
|
3227
|
-
/* @__PURE__ */
|
|
3228
|
-
/* @__PURE__ */
|
|
3229
|
-
|
|
3230
|
-
/* @__PURE__ */
|
|
3231
|
-
/* @__PURE__ */
|
|
3330
|
+
/* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
|
|
3331
|
+
/* @__PURE__ */ t("span", { children: p.typeLabel }),
|
|
3332
|
+
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
3333
|
+
/* @__PURE__ */ t("span", { children: Dn(e) }),
|
|
3334
|
+
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
3335
|
+
/* @__PURE__ */ t(Ha, { className: "h-3 w-3" }),
|
|
3336
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: Sn(e) }),
|
|
3337
|
+
e.lastRunAt ? /* @__PURE__ */ s(R, { children: [
|
|
3338
|
+
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
3339
|
+
/* @__PURE__ */ s("span", { children: [
|
|
3232
3340
|
"Last run ",
|
|
3233
3341
|
h
|
|
3234
3342
|
] })
|
|
3235
3343
|
] }) : null
|
|
3236
3344
|
] }),
|
|
3237
|
-
u || l ? /* @__PURE__ */
|
|
3238
|
-
l ? /* @__PURE__ */
|
|
3345
|
+
u || l ? /* @__PURE__ */ s("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
|
|
3346
|
+
l ? /* @__PURE__ */ t(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ t(
|
|
3239
3347
|
"span",
|
|
3240
3348
|
{
|
|
3241
3349
|
className: J(
|
|
3242
3350
|
"inline-block h-1.5 w-1.5 shrink-0 rounded-full",
|
|
3243
|
-
|
|
3351
|
+
f
|
|
3244
3352
|
)
|
|
3245
3353
|
}
|
|
3246
3354
|
),
|
|
3247
|
-
/* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: l ? Jt(e) : u })
|
|
3248
3356
|
] }) : null
|
|
3249
3357
|
]
|
|
3250
3358
|
}
|
|
3251
3359
|
),
|
|
3252
|
-
/* @__PURE__ */
|
|
3253
|
-
/* @__PURE__ */
|
|
3360
|
+
/* @__PURE__ */ t("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ s(Ve, { children: [
|
|
3361
|
+
/* @__PURE__ */ t(Be, { asChild: !0, children: /* @__PURE__ */ t(
|
|
3254
3362
|
"button",
|
|
3255
3363
|
{
|
|
3256
3364
|
type: "button",
|
|
3257
|
-
onClick: (
|
|
3365
|
+
onClick: (g) => g.stopPropagation(),
|
|
3258
3366
|
className: "inline-flex h-6 w-6 items-center justify-center rounded-control text-muted-foreground/70 opacity-60 hover:bg-muted hover:text-foreground/80 focus-visible:opacity-100 group-hover:opacity-100",
|
|
3259
3367
|
"aria-label": `${p.noun === "report" ? "Report" : "Briefing"} actions`,
|
|
3260
|
-
children: /* @__PURE__ */
|
|
3368
|
+
children: /* @__PURE__ */ t(Ut, { className: "h-3.5 w-3.5" })
|
|
3261
3369
|
}
|
|
3262
3370
|
) }),
|
|
3263
|
-
/* @__PURE__ */
|
|
3264
|
-
/* @__PURE__ */
|
|
3265
|
-
/* @__PURE__ */
|
|
3371
|
+
/* @__PURE__ */ s(Pe, { align: "end", className: "w-44", children: [
|
|
3372
|
+
/* @__PURE__ */ s(G, { onClick: n, children: [
|
|
3373
|
+
/* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5" }),
|
|
3266
3374
|
"Edit ",
|
|
3267
3375
|
p.noun
|
|
3268
3376
|
] }),
|
|
3269
|
-
/* @__PURE__ */
|
|
3377
|
+
/* @__PURE__ */ s(
|
|
3270
3378
|
G,
|
|
3271
3379
|
{
|
|
3272
|
-
onClick: (
|
|
3273
|
-
|
|
3380
|
+
onClick: (g) => {
|
|
3381
|
+
g.preventDefault(), i();
|
|
3274
3382
|
},
|
|
3275
3383
|
children: [
|
|
3276
|
-
/* @__PURE__ */
|
|
3384
|
+
/* @__PURE__ */ t(Qa, { className: "h-3.5 w-3.5" }),
|
|
3277
3385
|
"Run now"
|
|
3278
3386
|
]
|
|
3279
3387
|
}
|
|
3280
3388
|
),
|
|
3281
|
-
|
|
3389
|
+
e.scheduleExpr ? /* @__PURE__ */ t(
|
|
3282
3390
|
G,
|
|
3283
3391
|
{
|
|
3284
|
-
onClick: (
|
|
3285
|
-
|
|
3392
|
+
onClick: (g) => {
|
|
3393
|
+
g.preventDefault(), r();
|
|
3286
3394
|
},
|
|
3287
|
-
children:
|
|
3288
|
-
/* @__PURE__ */
|
|
3395
|
+
children: c ? /* @__PURE__ */ s(R, { children: [
|
|
3396
|
+
/* @__PURE__ */ t(Ka, { className: "h-3.5 w-3.5" }),
|
|
3289
3397
|
"Resume"
|
|
3290
|
-
] }) : /* @__PURE__ */
|
|
3291
|
-
/* @__PURE__ */
|
|
3398
|
+
] }) : /* @__PURE__ */ s(R, { children: [
|
|
3399
|
+
/* @__PURE__ */ t(Ga, { className: "h-3.5 w-3.5" }),
|
|
3292
3400
|
"Pause"
|
|
3293
3401
|
] })
|
|
3294
3402
|
}
|
|
3295
3403
|
) : null,
|
|
3296
|
-
/* @__PURE__ */
|
|
3297
|
-
/* @__PURE__ */
|
|
3404
|
+
/* @__PURE__ */ t(We, {}),
|
|
3405
|
+
/* @__PURE__ */ s(
|
|
3298
3406
|
G,
|
|
3299
3407
|
{
|
|
3300
|
-
onClick: (
|
|
3301
|
-
|
|
3408
|
+
onClick: (g) => {
|
|
3409
|
+
g.preventDefault(), d();
|
|
3302
3410
|
},
|
|
3303
3411
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
3304
3412
|
children: [
|
|
3305
|
-
/* @__PURE__ */ e
|
|
3413
|
+
/* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
|
|
3306
3414
|
"Delete ",
|
|
3307
3415
|
p.noun
|
|
3308
3416
|
]
|
|
@@ -3314,114 +3422,114 @@ function Cn({
|
|
|
3314
3422
|
}
|
|
3315
3423
|
);
|
|
3316
3424
|
}
|
|
3317
|
-
function
|
|
3318
|
-
return (
|
|
3425
|
+
function Ln(e) {
|
|
3426
|
+
return (e == null ? void 0 : e.trim()) || "This dashboard";
|
|
3319
3427
|
}
|
|
3320
|
-
function
|
|
3321
|
-
return
|
|
3428
|
+
function Vn(e) {
|
|
3429
|
+
return e === "This dashboard" ? "Watch this dashboard" : `Watch ${e}`;
|
|
3322
3430
|
}
|
|
3323
|
-
function
|
|
3324
|
-
return a !== "dashboard" ?
|
|
3325
|
-
(
|
|
3431
|
+
function Bn(e, a, o) {
|
|
3432
|
+
return a !== "dashboard" ? e : e.filter(
|
|
3433
|
+
(n) => n.source.type === "dashboard" && n.source.dashboardId === o
|
|
3326
3434
|
);
|
|
3327
3435
|
}
|
|
3328
|
-
async function
|
|
3436
|
+
async function Pn(e) {
|
|
3329
3437
|
const o = [];
|
|
3330
|
-
let
|
|
3331
|
-
for (; i <
|
|
3332
|
-
const
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
{ scope: "organization", page:
|
|
3438
|
+
let n = 1, i = 0, r = Number.POSITIVE_INFINITY;
|
|
3439
|
+
for (; i < r; ) {
|
|
3440
|
+
const d = await e.apiClient.listBriefings(
|
|
3441
|
+
e.apiServiceUrl,
|
|
3442
|
+
e.token,
|
|
3443
|
+
{ scope: "organization", page: n, pageSize: 100 }
|
|
3336
3444
|
);
|
|
3337
|
-
if (o.push(...
|
|
3338
|
-
|
|
3445
|
+
if (o.push(...d.briefings), i += d.briefings.length, r = d.total, d.briefings.length === 0 || i >= r) break;
|
|
3446
|
+
n += 1;
|
|
3339
3447
|
}
|
|
3340
3448
|
return o;
|
|
3341
3449
|
}
|
|
3342
|
-
const
|
|
3343
|
-
listBriefings:
|
|
3344
|
-
getBriefing:
|
|
3345
|
-
pauseBriefing:
|
|
3346
|
-
resumeBriefing:
|
|
3347
|
-
deleteBriefing:
|
|
3348
|
-
runBriefingNow:
|
|
3450
|
+
const Mn = {
|
|
3451
|
+
listBriefings: nr,
|
|
3452
|
+
getBriefing: rr,
|
|
3453
|
+
pauseBriefing: ar,
|
|
3454
|
+
resumeBriefing: tr,
|
|
3455
|
+
deleteBriefing: er,
|
|
3456
|
+
runBriefingNow: Ja
|
|
3349
3457
|
};
|
|
3350
|
-
function
|
|
3351
|
-
return /* @__PURE__ */
|
|
3458
|
+
function Ds(e) {
|
|
3459
|
+
return /* @__PURE__ */ t(Xa, { authToken: e.token ? { accessToken: e.token } : void 0, children: /* @__PURE__ */ t(Ya, { children: /* @__PURE__ */ t(Un, { ...e }) }) });
|
|
3352
3460
|
}
|
|
3353
|
-
function
|
|
3354
|
-
dashboardId:
|
|
3461
|
+
function Un({
|
|
3462
|
+
dashboardId: e,
|
|
3355
3463
|
dashboardTitle: a,
|
|
3356
3464
|
apiServiceUrl: o,
|
|
3357
|
-
token:
|
|
3465
|
+
token: n,
|
|
3358
3466
|
disabled: i,
|
|
3359
|
-
className:
|
|
3360
|
-
manageBriefingsHref:
|
|
3361
|
-
open:
|
|
3467
|
+
className: r,
|
|
3468
|
+
manageBriefingsHref: d,
|
|
3469
|
+
open: c,
|
|
3362
3470
|
onOpenChange: l,
|
|
3363
3471
|
hideTrigger: u = !1,
|
|
3364
3472
|
workflowIntent: h,
|
|
3365
3473
|
openRun: m,
|
|
3366
3474
|
client: p
|
|
3367
3475
|
}) {
|
|
3368
|
-
const { authToken:
|
|
3369
|
-
|
|
3370
|
-
}, [
|
|
3476
|
+
const { authToken: f, tokenProps: g } = it(), v = Za(), k = !h || v.canCreate && (h === "scheduled_report" || v.analyticalBriefingsEnabled), [V, U] = S(!1), M = c ?? V, A = (y) => {
|
|
3477
|
+
c === void 0 && U(y), l == null || l(y);
|
|
3478
|
+
}, [O, b] = S(
|
|
3371
3479
|
h ? "author" : "list"
|
|
3372
|
-
), [F, C] =
|
|
3480
|
+
), [F, C] = S(
|
|
3373
3481
|
h ?? "analytical_briefing"
|
|
3374
|
-
), [D, N] =
|
|
3482
|
+
), [D, N] = S("dashboard"), [j, T] = S(
|
|
3375
3483
|
[]
|
|
3376
|
-
), [
|
|
3484
|
+
), [z, X] = S(null), L = h && !k && !z ? "list" : O, [ae, Y] = S(!1), [H, he] = S(null), [ge, Q] = S(null), [_, oe] = S(
|
|
3377
3485
|
null
|
|
3378
|
-
), [me, pe] =
|
|
3486
|
+
), [me, pe] = S(null), Ce = nt(null), Me = nt(M);
|
|
3379
3487
|
xe(() => {
|
|
3380
|
-
const y = M && !
|
|
3381
|
-
|
|
3488
|
+
const y = M && !Me.current;
|
|
3489
|
+
Me.current = M, !(!y || !h) && (X(null), N("dashboard"), C(h), b("author"), pe(null));
|
|
3382
3490
|
}, [M, h]);
|
|
3383
|
-
const Ye =
|
|
3491
|
+
const Ye = yt(), $ = o ?? (g == null ? void 0 : g.apiServiceUrl), W = n ?? (f == null ? void 0 : f.accessToken), ne = te(() => ({ ...Mn, ...p }), [p]), [we, Ze] = S(null);
|
|
3384
3492
|
xe(() => {
|
|
3385
3493
|
if (!m || !$ || !W) return;
|
|
3386
3494
|
let y = !0;
|
|
3387
3495
|
return ne.getBriefing($, W, m.briefingId).then(({ briefing: P }) => {
|
|
3388
|
-
y && (X(P),
|
|
3496
|
+
y && (X(P), Ze(m), b("author"));
|
|
3389
3497
|
}, (P) => {
|
|
3390
3498
|
y && E.error(P instanceof Error ? P.message : "Could not open the run.");
|
|
3391
3499
|
}), () => {
|
|
3392
3500
|
y = !1;
|
|
3393
3501
|
};
|
|
3394
3502
|
}, [m, $, W, ne]);
|
|
3395
|
-
const be =
|
|
3396
|
-
const y =
|
|
3503
|
+
const be = Ln(a), Ue = te(() => {
|
|
3504
|
+
const y = Bn(
|
|
3397
3505
|
j,
|
|
3398
3506
|
D,
|
|
3399
|
-
|
|
3507
|
+
e
|
|
3400
3508
|
);
|
|
3401
3509
|
if (!h)
|
|
3402
3510
|
return y;
|
|
3403
3511
|
const P = h === "scheduled_report" ? "report" : "briefing";
|
|
3404
3512
|
return y.filter(
|
|
3405
|
-
(
|
|
3513
|
+
(Oe) => le(Oe).noun === P
|
|
3406
3514
|
);
|
|
3407
|
-
}, [
|
|
3408
|
-
source: { type: "dashboard", dashboardId:
|
|
3515
|
+
}, [e, j, D, h]), Je = te(() => D === "dashboard" ? {
|
|
3516
|
+
source: { type: "dashboard", dashboardId: e },
|
|
3409
3517
|
label: be,
|
|
3410
|
-
detail:
|
|
3518
|
+
detail: Vn(be)
|
|
3411
3519
|
} : {
|
|
3412
3520
|
source: { type: "project" },
|
|
3413
3521
|
label: "This project",
|
|
3414
3522
|
detail: "Use any data in this project."
|
|
3415
|
-
}, [
|
|
3523
|
+
}, [e, be, D]), Ne = !!($ && W), Se = Pr({
|
|
3416
3524
|
canCreate: v.canCreate,
|
|
3417
3525
|
analyticalBriefingsEnabled: v.analyticalBriefingsEnabled,
|
|
3418
3526
|
scheduledReportAvailable: D === "dashboard"
|
|
3419
|
-
}), se =
|
|
3527
|
+
}), se = Z(async () => {
|
|
3420
3528
|
if (!(!$ || !W)) {
|
|
3421
3529
|
Y(!0), pe(null);
|
|
3422
3530
|
try {
|
|
3423
|
-
|
|
3424
|
-
await
|
|
3531
|
+
T(
|
|
3532
|
+
await Pn({
|
|
3425
3533
|
apiClient: ne,
|
|
3426
3534
|
apiServiceUrl: $,
|
|
3427
3535
|
token: W
|
|
@@ -3437,8 +3545,8 @@ function An({
|
|
|
3437
3545
|
}
|
|
3438
3546
|
}, [ne, $, W]);
|
|
3439
3547
|
xe(() => {
|
|
3440
|
-
!M ||
|
|
3441
|
-
}, [Ne,
|
|
3548
|
+
!M || L !== "list" || !Ne || se();
|
|
3549
|
+
}, [Ne, L, se, M]);
|
|
3442
3550
|
const ke = () => {
|
|
3443
3551
|
X(null), N("dashboard"), b("list"), A(!0);
|
|
3444
3552
|
}, x = (y) => {
|
|
@@ -3469,7 +3577,7 @@ function An({
|
|
|
3469
3577
|
$,
|
|
3470
3578
|
W,
|
|
3471
3579
|
y.id,
|
|
3472
|
-
{ requestId:
|
|
3580
|
+
{ requestId: On() }
|
|
3473
3581
|
);
|
|
3474
3582
|
Ye.track({ kind: "briefing", id: P.run.id, title: y.name, briefingId: y.id }), se();
|
|
3475
3583
|
} catch (P) {
|
|
@@ -3482,10 +3590,10 @@ function An({
|
|
|
3482
3590
|
}
|
|
3483
3591
|
}, ie = async (y) => {
|
|
3484
3592
|
if (!$ || !W) return;
|
|
3485
|
-
const { noun: P } = le(y),
|
|
3593
|
+
const { noun: P } = le(y), Oe = P === "report" ? "Report" : "Briefing";
|
|
3486
3594
|
Q(y.id);
|
|
3487
3595
|
try {
|
|
3488
|
-
const
|
|
3596
|
+
const Re = y.status === "PAUSED" ? await ne.resumeBriefing(
|
|
3489
3597
|
$,
|
|
3490
3598
|
W,
|
|
3491
3599
|
y.id
|
|
@@ -3495,16 +3603,16 @@ function An({
|
|
|
3495
3603
|
y.id
|
|
3496
3604
|
);
|
|
3497
3605
|
E.success(
|
|
3498
|
-
|
|
3606
|
+
Re.briefing.status === "PAUSED" ? `${Oe} paused` : `${Oe} resumed`
|
|
3499
3607
|
), se();
|
|
3500
|
-
} catch (
|
|
3608
|
+
} catch (Re) {
|
|
3501
3609
|
E.error(
|
|
3502
|
-
|
|
3610
|
+
Re instanceof Error ? Re.message : `Could not update the ${P} status.`
|
|
3503
3611
|
);
|
|
3504
3612
|
} finally {
|
|
3505
3613
|
Q(null);
|
|
3506
3614
|
}
|
|
3507
|
-
},
|
|
3615
|
+
}, ue = async () => {
|
|
3508
3616
|
if (!_ || !$ || !W) return;
|
|
3509
3617
|
const y = _;
|
|
3510
3618
|
Q(y.id);
|
|
@@ -3523,19 +3631,19 @@ function An({
|
|
|
3523
3631
|
} finally {
|
|
3524
3632
|
Q(null);
|
|
3525
3633
|
}
|
|
3526
|
-
},
|
|
3527
|
-
return v.surfaceVisible ? /* @__PURE__ */
|
|
3528
|
-
u ? null : /* @__PURE__ */
|
|
3529
|
-
|
|
3634
|
+
}, ea = Ue.length;
|
|
3635
|
+
return v.surfaceVisible ? /* @__PURE__ */ s(sr, { open: M, onOpenChange: A, children: [
|
|
3636
|
+
u ? null : /* @__PURE__ */ t(
|
|
3637
|
+
yn,
|
|
3530
3638
|
{
|
|
3531
3639
|
disabled: i || !Ne,
|
|
3532
|
-
briefingCount:
|
|
3533
|
-
className:
|
|
3640
|
+
briefingCount: ea,
|
|
3641
|
+
className: r,
|
|
3534
3642
|
onClick: ke
|
|
3535
3643
|
}
|
|
3536
3644
|
),
|
|
3537
|
-
/* @__PURE__ */
|
|
3538
|
-
|
|
3645
|
+
/* @__PURE__ */ s(
|
|
3646
|
+
or,
|
|
3539
3647
|
{
|
|
3540
3648
|
ref: Ce,
|
|
3541
3649
|
side: "right",
|
|
@@ -3546,45 +3654,45 @@ function An({
|
|
|
3546
3654
|
y.preventDefault(), (P = Ce.current) == null || P.focus({ preventScroll: !0 });
|
|
3547
3655
|
},
|
|
3548
3656
|
children: [
|
|
3549
|
-
/* @__PURE__ */
|
|
3550
|
-
/* @__PURE__ */
|
|
3551
|
-
/* @__PURE__ */
|
|
3657
|
+
/* @__PURE__ */ s(ir, { className: "sr-only", children: [
|
|
3658
|
+
/* @__PURE__ */ t(lr, { children: "Reports & briefings" }),
|
|
3659
|
+
/* @__PURE__ */ t(dr, { children: "Manage reports and briefings for this dashboard." })
|
|
3552
3660
|
] }),
|
|
3553
|
-
h ? /* @__PURE__ */
|
|
3554
|
-
/* @__PURE__ */
|
|
3661
|
+
h ? /* @__PURE__ */ s("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
|
|
3662
|
+
/* @__PURE__ */ s(
|
|
3555
3663
|
"div",
|
|
3556
3664
|
{
|
|
3557
3665
|
className: "flex items-center gap-5",
|
|
3558
3666
|
role: "tablist",
|
|
3559
3667
|
"aria-label": h === "scheduled_report" ? "Email report workflow" : "Analytical briefing workflow",
|
|
3560
3668
|
children: [
|
|
3561
|
-
/* @__PURE__ */
|
|
3669
|
+
/* @__PURE__ */ t(
|
|
3562
3670
|
"button",
|
|
3563
3671
|
{
|
|
3564
3672
|
type: "button",
|
|
3565
3673
|
role: "tab",
|
|
3566
|
-
"aria-selected":
|
|
3567
|
-
disabled: !
|
|
3674
|
+
"aria-selected": L === "author",
|
|
3675
|
+
disabled: !k,
|
|
3568
3676
|
className: J(
|
|
3569
3677
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3570
|
-
|
|
3571
|
-
!
|
|
3678
|
+
L === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
|
|
3679
|
+
!k && "cursor-not-allowed opacity-50"
|
|
3572
3680
|
),
|
|
3573
3681
|
onClick: () => {
|
|
3574
|
-
|
|
3682
|
+
k && (X(null), C(h), N("dashboard"), b("author"));
|
|
3575
3683
|
},
|
|
3576
|
-
children:
|
|
3684
|
+
children: z ? `Edit ${le(z).noun}` : h === "scheduled_report" ? "Schedule report" : "Create briefing"
|
|
3577
3685
|
}
|
|
3578
3686
|
),
|
|
3579
|
-
/* @__PURE__ */
|
|
3687
|
+
/* @__PURE__ */ t(
|
|
3580
3688
|
"button",
|
|
3581
3689
|
{
|
|
3582
3690
|
type: "button",
|
|
3583
3691
|
role: "tab",
|
|
3584
|
-
"aria-selected":
|
|
3692
|
+
"aria-selected": L === "list",
|
|
3585
3693
|
className: J(
|
|
3586
3694
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3587
|
-
|
|
3695
|
+
L === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3588
3696
|
),
|
|
3589
3697
|
onClick: () => b("list"),
|
|
3590
3698
|
children: h === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
@@ -3593,25 +3701,25 @@ function An({
|
|
|
3593
3701
|
]
|
|
3594
3702
|
}
|
|
3595
3703
|
),
|
|
3596
|
-
/* @__PURE__ */
|
|
3704
|
+
/* @__PURE__ */ t(
|
|
3597
3705
|
"button",
|
|
3598
3706
|
{
|
|
3599
3707
|
type: "button",
|
|
3600
3708
|
onClick: () => A(!1),
|
|
3601
3709
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3602
3710
|
"aria-label": h === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
|
|
3603
|
-
children: /* @__PURE__ */
|
|
3711
|
+
children: /* @__PURE__ */ t(Xe, { className: "h-3.5 w-3.5" })
|
|
3604
3712
|
}
|
|
3605
3713
|
)
|
|
3606
3714
|
] }) : null,
|
|
3607
|
-
|
|
3608
|
-
|
|
3715
|
+
L === "list" ? /* @__PURE__ */ t(
|
|
3716
|
+
Fn,
|
|
3609
3717
|
{
|
|
3610
|
-
briefings:
|
|
3718
|
+
briefings: Ue,
|
|
3611
3719
|
dashboardLabel: be,
|
|
3612
3720
|
sourceView: D,
|
|
3613
3721
|
error: me,
|
|
3614
|
-
loading:
|
|
3722
|
+
loading: ae,
|
|
3615
3723
|
onSourceViewChange: N,
|
|
3616
3724
|
onClose: () => A(!1),
|
|
3617
3725
|
onEdit: (y) => {
|
|
@@ -3634,26 +3742,26 @@ function An({
|
|
|
3634
3742
|
onDelete: (y) => oe(y),
|
|
3635
3743
|
selectingId: H,
|
|
3636
3744
|
busyId: ge,
|
|
3637
|
-
manageBriefingsHref:
|
|
3745
|
+
manageBriefingsHref: d,
|
|
3638
3746
|
contentKind: h === "scheduled_report" ? "reports" : h === "analytical_briefing" ? "briefings" : void 0,
|
|
3639
3747
|
hideHeader: !!h
|
|
3640
3748
|
}
|
|
3641
|
-
) : /* @__PURE__ */
|
|
3642
|
-
|
|
3749
|
+
) : /* @__PURE__ */ t(
|
|
3750
|
+
cr,
|
|
3643
3751
|
{
|
|
3644
3752
|
apiServiceUrl: $,
|
|
3645
3753
|
token: W,
|
|
3646
|
-
briefing:
|
|
3647
|
-
initialRunId: we && (
|
|
3754
|
+
briefing: z,
|
|
3755
|
+
initialRunId: we && (z == null ? void 0 : z.id) === we.briefingId ? we.runId : void 0,
|
|
3648
3756
|
intent: F,
|
|
3649
|
-
sourceContext:
|
|
3650
|
-
title:
|
|
3757
|
+
sourceContext: z ? void 0 : Je,
|
|
3758
|
+
title: z ? `Edit ${le(z).noun}` : F === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
|
|
3651
3759
|
hideHeader: !!h,
|
|
3652
3760
|
className: "h-full min-h-0 max-w-none border-0 shadow-none",
|
|
3653
3761
|
onBack: h ? void 0 : () => b("list"),
|
|
3654
3762
|
onCancel: () => A(!1),
|
|
3655
3763
|
onDeleted: () => {
|
|
3656
|
-
const y =
|
|
3764
|
+
const y = z ? le(z).noun : "briefing";
|
|
3657
3765
|
E.success(`${y === "report" ? "Report" : "Briefing"} deleted`), X(null), b("list"), se();
|
|
3658
3766
|
},
|
|
3659
3767
|
onRunStarted: () => {
|
|
@@ -3669,34 +3777,34 @@ function An({
|
|
|
3669
3777
|
]
|
|
3670
3778
|
}
|
|
3671
3779
|
),
|
|
3672
|
-
/* @__PURE__ */
|
|
3673
|
-
|
|
3780
|
+
/* @__PURE__ */ t(
|
|
3781
|
+
dt,
|
|
3674
3782
|
{
|
|
3675
3783
|
open: !!_,
|
|
3676
3784
|
onOpenChange: (y) => {
|
|
3677
3785
|
y || oe(null);
|
|
3678
3786
|
},
|
|
3679
|
-
children: /* @__PURE__ */
|
|
3680
|
-
/* @__PURE__ */
|
|
3681
|
-
/* @__PURE__ */
|
|
3787
|
+
children: /* @__PURE__ */ s(ct, { children: [
|
|
3788
|
+
/* @__PURE__ */ s(ut, { children: [
|
|
3789
|
+
/* @__PURE__ */ s(ht, { children: [
|
|
3682
3790
|
"Delete",
|
|
3683
3791
|
" ",
|
|
3684
3792
|
_ ? le(_).noun : "briefing",
|
|
3685
3793
|
"?"
|
|
3686
3794
|
] }),
|
|
3687
|
-
/* @__PURE__ */
|
|
3795
|
+
/* @__PURE__ */ s(mt, { children: [
|
|
3688
3796
|
"This permanently deletes ",
|
|
3689
|
-
/* @__PURE__ */
|
|
3797
|
+
/* @__PURE__ */ t("strong", { children: _ == null ? void 0 : _.name }),
|
|
3690
3798
|
". Recipients will stop receiving it."
|
|
3691
3799
|
] })
|
|
3692
3800
|
] }),
|
|
3693
|
-
/* @__PURE__ */
|
|
3694
|
-
/* @__PURE__ */
|
|
3695
|
-
/* @__PURE__ */
|
|
3696
|
-
|
|
3801
|
+
/* @__PURE__ */ s(pt, { children: [
|
|
3802
|
+
/* @__PURE__ */ t(ft, { children: "Cancel" }),
|
|
3803
|
+
/* @__PURE__ */ s(
|
|
3804
|
+
Mt,
|
|
3697
3805
|
{
|
|
3698
3806
|
className: "bg-destructive/90 hover:bg-destructive",
|
|
3699
|
-
onClick:
|
|
3807
|
+
onClick: ue,
|
|
3700
3808
|
children: [
|
|
3701
3809
|
"Delete",
|
|
3702
3810
|
" ",
|
|
@@ -3710,23 +3818,27 @@ function An({
|
|
|
3710
3818
|
)
|
|
3711
3819
|
] }) : null;
|
|
3712
3820
|
}
|
|
3713
|
-
function
|
|
3821
|
+
function On() {
|
|
3714
3822
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
3715
3823
|
}
|
|
3716
3824
|
export {
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3825
|
+
fs as A,
|
|
3826
|
+
xs as D,
|
|
3827
|
+
bs as S,
|
|
3828
|
+
ys as T,
|
|
3829
|
+
ws as U,
|
|
3830
|
+
hs as V,
|
|
3831
|
+
yn as W,
|
|
3832
|
+
ps as a,
|
|
3833
|
+
gs as b,
|
|
3834
|
+
vs as c,
|
|
3835
|
+
Cs as d,
|
|
3836
|
+
Ss as e,
|
|
3837
|
+
ln as f,
|
|
3838
|
+
cn as g,
|
|
3839
|
+
fn as h,
|
|
3840
|
+
Ns as i,
|
|
3841
|
+
ks as j,
|
|
3842
|
+
Ds as k,
|
|
3843
|
+
ms as u
|
|
3732
3844
|
};
|