react-semaphor 0.1.461 → 0.1.462
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/chunks/{dashboard-briefing-launcher-3owMxX5K.js → dashboard-briefing-launcher-C6ePN5_I.js} +1246 -1244
- package/dist/chunks/dashboard-briefing-launcher-Qto0i-Gl.cjs +26 -0
- package/dist/chunks/{dashboard-controls-Bpm_xOXQ.cjs → dashboard-controls--Wg8-58g.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-B4GvjGr1.js → dashboard-controls-CJcvFl2B.js} +3 -3
- package/dist/chunks/{dashboard-json-DzyxoBp-.js → dashboard-json-DFhvCpHL.js} +1 -1
- package/dist/chunks/{dashboard-json-yLM01xK4.cjs → dashboard-json-DXrlNlUM.cjs} +1 -1
- package/dist/chunks/{edit-dashboard-visual-1T278Nr_.cjs → edit-dashboard-visual-D2JLKep9.cjs} +2 -2
- package/dist/chunks/{edit-dashboard-visual-nwSasO_j.js → edit-dashboard-visual-Dhx5wAKM.js} +893 -893
- package/dist/chunks/{editor-action-buttons-CX1Pken3.cjs → editor-action-buttons-Ba8M_DAF.cjs} +1 -1
- package/dist/chunks/{editor-action-buttons-Dqw0asfA.js → editor-action-buttons-C_wg1zTn.js} +1 -1
- package/dist/chunks/{index-B1qplNxl.cjs → index-BAN1CQ6R.cjs} +185 -185
- package/dist/chunks/{index-DazD5k0F.js → index-HMTOcZOr.js} +24309 -24305
- package/dist/chunks/{report-preferences-dialog-DKPyjiCt.cjs → report-preferences-dialog-BaVeLREU.cjs} +1 -1
- package/dist/chunks/{report-preferences-dialog-Dv3vCCFt.js → report-preferences-dialog-Ditwc9JX.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/dashboard-briefing-launcher-xuGrw8H3.cjs +0 -26
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as W } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { B, O as
|
|
5
|
-
import { L as
|
|
6
|
-
import { c as
|
|
7
|
-
import { u as
|
|
8
|
-
import { v as
|
|
2
|
+
import Wt, { useState as E, useEffect as Q, useMemo as ee, useContext as Ht, useRef as he, useCallback as K } from "react";
|
|
3
|
+
import { cm as et, aH as De, aI as ke, aK as Ae, bb as wt, bY as Gt, cn as Kt, co as qt, aZ as fe, ca as Nt, bl as Pe, s as Xt, o as Zt, cp as Qt, aP as tt, aS as rt, aT as at, aU as nt, aV as st, aW as ot, aX as it, aY as St, bk as lt, aG as O, cq as Yt, cr as Jt, cs as qe, cb as $e, cc as je, ct as Dt, cd as We, bW as G, b1 as er, bB as Me, cu as tr, bV as rr, aJ as ct, aL as dt, cv as ar, aF as nr, ba as sr, bw as kt, cw as or, bZ as ir, u as lr, aM as cr, b3 as dr, az as He, O as ue, aw as ut, as as At, at as ht, P as Et, ar as ur, ay as hr, ch as mr, cx as pr, bu as fr, au as gt, R as gr, T as br, cy as xr, cz as vr, cA as yr, cB as Cr, cC as wr, cD as Nr, cE as It, cF as Sr, b4 as Dr, cG as kr, ce as Ft, cH as Ar, cI as Er, cJ as Re, cK as Ir, cL as Fr, cM as Lr, an as Br, ap as Tr, a3 as Vr, a2 as Rr, a1 as Ur, a0 as Pr, Z as Mr, X as Or, cN as _r, cO as zr, cP as $r, cQ as jr, cR as Wr, al as Hr, cS as Gr, cT as Kr, a9 as qr, cU as Xr, cV as Zr, cW as Qr } from "./index-HMTOcZOr.js";
|
|
4
|
+
import { B, O as Se, Z as Ye, L as te, M as Lt, d as Bt, c as q, K as Yr, D as ge, u as P, z as be, aw as Tt, av as Je, E as Vt, P as Oe, a as _e, b as ze, aH as Jr, aI as ea, S as Rt, aJ as ta, aK as ra, aL as aa, aM as na, aF as sa } from "./switch-kPUJEC1A.js";
|
|
5
|
+
import { L as mt } from "./layout-grid-CiubineE.js";
|
|
6
|
+
import { c as Ee, X as Ge, C as Ut } from "./x-CXDkqdur.js";
|
|
7
|
+
import { u as pt, V as oa, E as Xe, a as Ze, b as ia, c as la, L as ca, d as da, e as Pt, C as Mt, F as ua, f as ha } from "./editor-action-buttons-C_wg1zTn.js";
|
|
8
|
+
import { v as bt } from "./saved-temporal-bucket-format-Dd2eixTH.js";
|
|
9
9
|
import "./validators-DVd8s3qY.js";
|
|
10
10
|
import "./analyze-result-contract-DROq4vgY.js";
|
|
11
11
|
import "../value-format-preferences/index.js";
|
|
12
12
|
import { S as ma } from "./search-BHsQIWBV.js";
|
|
13
13
|
import { M as pa } from "./mouse-pointer-2-BZvGk45-.js";
|
|
14
|
-
import { u as
|
|
14
|
+
import { u as xt } from "./pivot-header-presentation-DW0gKG8g.js";
|
|
15
15
|
import "./index-DSKR3nKn.js";
|
|
16
16
|
import "./temporal-bucket-authoring-1fZuPAVb.js";
|
|
17
17
|
import "./color-CJvdlFM_.js";
|
|
@@ -23,7 +23,7 @@ import { g as se, d as fa, a as ga } from "./index-De_7nrwb.js";
|
|
|
23
23
|
* This source code is licensed under the ISC license.
|
|
24
24
|
* See the LICENSE file in the root directory of this source tree.
|
|
25
25
|
*/
|
|
26
|
-
const ba =
|
|
26
|
+
const ba = Ee("ArrowUpRight", [
|
|
27
27
|
["path", { d: "M7 7h10v10", key: "1tivn9" }],
|
|
28
28
|
["path", { d: "M7 17 17 7", key: "1vkiza" }]
|
|
29
29
|
]);
|
|
@@ -33,7 +33,7 @@ const ba = Ae("ArrowUpRight", [
|
|
|
33
33
|
* This source code is licensed under the ISC license.
|
|
34
34
|
* See the LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
const xa =
|
|
36
|
+
const xa = Ee("CalendarRange", [
|
|
37
37
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
38
38
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
39
39
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
@@ -49,7 +49,7 @@ const xa = Ae("CalendarRange", [
|
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
51
|
*/
|
|
52
|
-
const va =
|
|
52
|
+
const va = Ee("CircleX", [
|
|
53
53
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
54
54
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
55
55
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -60,7 +60,7 @@ const va = Ae("CircleX", [
|
|
|
60
60
|
* This source code is licensed under the ISC license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
62
|
*/
|
|
63
|
-
const
|
|
63
|
+
const vt = Ee("FileDown", [
|
|
64
64
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
65
65
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
66
66
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
@@ -72,7 +72,7 @@ const bt = Ae("FileDown", [
|
|
|
72
72
|
* This source code is licensed under the ISC license.
|
|
73
73
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
74
|
*/
|
|
75
|
-
const ya =
|
|
75
|
+
const ya = Ee("Newspaper", [
|
|
76
76
|
[
|
|
77
77
|
"path",
|
|
78
78
|
{
|
|
@@ -103,29 +103,30 @@ function Ca() {
|
|
|
103
103
|
function wa({
|
|
104
104
|
open: t,
|
|
105
105
|
onOpenChange: a,
|
|
106
|
-
onSubmit:
|
|
107
|
-
isCreating:
|
|
106
|
+
onSubmit: o,
|
|
107
|
+
isCreating: n
|
|
108
108
|
}) {
|
|
109
|
-
const [
|
|
110
|
-
|
|
111
|
-
t || (
|
|
109
|
+
const i = et("interactive"), [s, d] = E(""), [p, l] = E("");
|
|
110
|
+
Q(() => {
|
|
111
|
+
t || (d(""), l(""));
|
|
112
112
|
}, [t]);
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
a(
|
|
113
|
+
const u = () => {
|
|
114
|
+
s.trim() && o({ title: s, description: p });
|
|
115
|
+
}, c = (m) => {
|
|
116
|
+
a(m);
|
|
117
117
|
};
|
|
118
|
-
return /* @__PURE__ */ e(
|
|
119
|
-
|
|
118
|
+
return /* @__PURE__ */ e(De, { open: t, onOpenChange: c, children: /* @__PURE__ */ r(
|
|
119
|
+
ke,
|
|
120
120
|
{
|
|
121
121
|
showCloseButton: !1,
|
|
122
|
-
className: "flex max-w-lg grid-cols-none flex-col gap-0 overflow-hidden rounded-
|
|
122
|
+
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",
|
|
123
|
+
style: i.dialogStyle,
|
|
123
124
|
children: [
|
|
124
125
|
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
125
126
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
126
|
-
/* @__PURE__ */ e(
|
|
127
|
+
/* @__PURE__ */ e(mt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
127
128
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
128
|
-
/* @__PURE__ */ e(
|
|
129
|
+
/* @__PURE__ */ e(Ae, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
|
|
129
130
|
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
|
|
130
131
|
] })
|
|
131
132
|
] }),
|
|
@@ -135,43 +136,43 @@ function wa({
|
|
|
135
136
|
size: "xs",
|
|
136
137
|
variant: "ghost",
|
|
137
138
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
138
|
-
onClick: () =>
|
|
139
|
+
onClick: () => c(!1),
|
|
139
140
|
"aria-label": "Close",
|
|
140
|
-
disabled:
|
|
141
|
-
children: /* @__PURE__ */ e(
|
|
141
|
+
disabled: n,
|
|
142
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-3.5 w-3.5" })
|
|
142
143
|
}
|
|
143
144
|
)
|
|
144
145
|
] }),
|
|
145
146
|
/* @__PURE__ */ r("div", { className: "space-y-3 px-4 py-3", children: [
|
|
146
147
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
|
|
147
148
|
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
148
|
-
/* @__PURE__ */ e(
|
|
149
|
+
/* @__PURE__ */ e(Se, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
|
|
149
150
|
/* @__PURE__ */ e(
|
|
150
|
-
|
|
151
|
+
Ye,
|
|
151
152
|
{
|
|
152
153
|
id: "visual-title",
|
|
153
154
|
size: "sm",
|
|
154
155
|
placeholder: "Untitled visual",
|
|
155
|
-
value:
|
|
156
|
-
onChange: (
|
|
157
|
-
disabled:
|
|
158
|
-
onKeyDown: (
|
|
159
|
-
|
|
156
|
+
value: s,
|
|
157
|
+
onChange: (m) => d(m.target.value),
|
|
158
|
+
disabled: n,
|
|
159
|
+
onKeyDown: (m) => {
|
|
160
|
+
m.key === "Enter" && !m.shiftKey && (m.preventDefault(), u());
|
|
160
161
|
}
|
|
161
162
|
}
|
|
162
163
|
)
|
|
163
164
|
] }),
|
|
164
165
|
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
165
|
-
/* @__PURE__ */ e(
|
|
166
|
+
/* @__PURE__ */ e(Se, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
|
|
166
167
|
/* @__PURE__ */ e(
|
|
167
|
-
|
|
168
|
+
Ye,
|
|
168
169
|
{
|
|
169
170
|
id: "visual-description",
|
|
170
171
|
size: "sm",
|
|
171
172
|
placeholder: "Optional",
|
|
172
|
-
value:
|
|
173
|
-
onChange: (
|
|
174
|
-
disabled:
|
|
173
|
+
value: p,
|
|
174
|
+
onChange: (m) => l(m.target.value),
|
|
175
|
+
disabled: n
|
|
175
176
|
}
|
|
176
177
|
)
|
|
177
178
|
] })
|
|
@@ -182,8 +183,8 @@ function wa({
|
|
|
182
183
|
{
|
|
183
184
|
size: "xs",
|
|
184
185
|
variant: "outline",
|
|
185
|
-
onClick: () =>
|
|
186
|
-
disabled:
|
|
186
|
+
onClick: () => c(!1),
|
|
187
|
+
disabled: n,
|
|
187
188
|
children: "Cancel"
|
|
188
189
|
}
|
|
189
190
|
),
|
|
@@ -191,9 +192,9 @@ function wa({
|
|
|
191
192
|
B,
|
|
192
193
|
{
|
|
193
194
|
size: "xs",
|
|
194
|
-
onClick:
|
|
195
|
-
disabled: !
|
|
196
|
-
children:
|
|
195
|
+
onClick: u,
|
|
196
|
+
disabled: !s.trim() || n,
|
|
197
|
+
children: n ? /* @__PURE__ */ r(W, { children: [
|
|
197
198
|
/* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
198
199
|
"Creating..."
|
|
199
200
|
] }) : "Create library visual"
|
|
@@ -204,189 +205,190 @@ function wa({
|
|
|
204
205
|
}
|
|
205
206
|
) });
|
|
206
207
|
}
|
|
207
|
-
function
|
|
208
|
+
function Ot(t) {
|
|
208
209
|
return t ? new Date(t).toLocaleDateString("en-US", {
|
|
209
210
|
month: "short",
|
|
210
211
|
day: "numeric",
|
|
211
212
|
year: "numeric"
|
|
212
213
|
}) : "Unknown";
|
|
213
214
|
}
|
|
214
|
-
function
|
|
215
|
-
var
|
|
216
|
-
const
|
|
217
|
-
return
|
|
215
|
+
function _t(t, a) {
|
|
216
|
+
var n;
|
|
217
|
+
const o = (n = t.ownership.createdBy) == null ? void 0 : n.type;
|
|
218
|
+
return o === "tenant" || o === "organization" && a;
|
|
218
219
|
}
|
|
219
|
-
function
|
|
220
|
-
var
|
|
221
|
-
return
|
|
220
|
+
function ft(t, a) {
|
|
221
|
+
var o, n;
|
|
222
|
+
return _t(t, a) ? ((o = t.ownership.createdBy) == null ? void 0 : o.name) || ((n = t.createdByTenantUserRel) == null ? void 0 : n.name) || t.lastModifiedBy || "Unknown" : "Organization";
|
|
222
223
|
}
|
|
223
224
|
function Na(t, a) {
|
|
224
|
-
return
|
|
225
|
+
return ft(t, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
|
|
225
226
|
}
|
|
226
227
|
function Sa(t) {
|
|
227
228
|
const a = (t || "").toLowerCase();
|
|
228
|
-
return a.includes("table") ?
|
|
229
|
+
return a.includes("table") ? Lt : a.includes("pie") || a.includes("donut") ? Yt : a.includes("line") ? Jt : a.includes("bar") ? Yr : mt;
|
|
229
230
|
}
|
|
230
231
|
function Da({ visual: t }) {
|
|
231
232
|
const a = t.ownership.status === "public" ? "Public" : t.ownership.status === "shared" || t.ownership.sharedCount > 0 ? "Shared" : "Private";
|
|
232
233
|
return /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
|
|
233
234
|
}
|
|
234
|
-
function
|
|
235
|
+
function zn({
|
|
235
236
|
open: t,
|
|
236
237
|
onOpenChange: a
|
|
237
238
|
}) {
|
|
238
|
-
const [
|
|
239
|
+
const o = et("interactive"), [n, i] = E(""), [s, d] = E(/* @__PURE__ */ new Set()), [p, l] = E(!1), [u, c] = E(
|
|
239
240
|
null
|
|
240
|
-
), [
|
|
241
|
+
), [m, h] = E(
|
|
241
242
|
null
|
|
242
|
-
), [
|
|
243
|
-
|
|
244
|
-
},
|
|
245
|
-
a(!1),
|
|
246
|
-
}, { selectVisual:
|
|
247
|
-
resources:
|
|
248
|
-
isLoading:
|
|
249
|
-
isError:
|
|
250
|
-
createResource:
|
|
251
|
-
updateResource:
|
|
252
|
-
deleteResourceAsync:
|
|
253
|
-
duplicateResource:
|
|
254
|
-
isCreating:
|
|
255
|
-
isDeleting:
|
|
256
|
-
} =
|
|
243
|
+
), [f, x] = E(!1), [C, N] = E(null), [I, D] = E(null), b = () => {
|
|
244
|
+
d(/* @__PURE__ */ new Set()), c(null), h(null), x(!1), N(null);
|
|
245
|
+
}, S = () => {
|
|
246
|
+
a(!1), b();
|
|
247
|
+
}, { selectVisual: A } = wt(), { handleAddLibraryVisual: U, handleEditLibraryVisual: g } = pt(), { isConsoleMode: v } = Gt(), {
|
|
248
|
+
resources: T,
|
|
249
|
+
isLoading: F,
|
|
250
|
+
isError: H,
|
|
251
|
+
createResource: k,
|
|
252
|
+
updateResource: V,
|
|
253
|
+
deleteResourceAsync: $,
|
|
254
|
+
duplicateResource: xe,
|
|
255
|
+
isCreating: re,
|
|
256
|
+
isDeleting: oe
|
|
257
|
+
} = Kt(
|
|
257
258
|
void 0,
|
|
258
|
-
(
|
|
259
|
-
|
|
259
|
+
(y) => {
|
|
260
|
+
l(!1), y && (A(y), g(y), S());
|
|
260
261
|
}
|
|
261
262
|
), {
|
|
262
|
-
startUpdating:
|
|
263
|
-
stopUpdating:
|
|
264
|
-
isUpdating:
|
|
265
|
-
} =
|
|
266
|
-
const
|
|
267
|
-
return
|
|
263
|
+
startUpdating: Ie,
|
|
264
|
+
stopUpdating: Fe,
|
|
265
|
+
isUpdating: ie
|
|
266
|
+
} = qt(), j = T, Y = ee(() => {
|
|
267
|
+
const y = n.trim().toLowerCase();
|
|
268
|
+
return y ? j.filter(
|
|
268
269
|
(L) => {
|
|
269
|
-
var M, ae,
|
|
270
|
-
return ((M = L.title) == null ? void 0 : M.toLowerCase().includes(
|
|
270
|
+
var M, ae, ce;
|
|
271
|
+
return ((M = L.title) == null ? void 0 : M.toLowerCase().includes(y)) || ((ae = L.description) == null ? void 0 : ae.toLowerCase().includes(y)) || ((ce = L.kind) == null ? void 0 : ce.toLowerCase().includes(y));
|
|
271
272
|
}
|
|
272
|
-
) :
|
|
273
|
-
}, [
|
|
274
|
-
() =>
|
|
275
|
-
(
|
|
273
|
+
) : j;
|
|
274
|
+
}, [n, j]), le = ee(
|
|
275
|
+
() => j.filter(
|
|
276
|
+
(y) => s.has(y.id)
|
|
276
277
|
),
|
|
277
|
-
[
|
|
278
|
-
),
|
|
279
|
-
(
|
|
280
|
-
),
|
|
281
|
-
(
|
|
282
|
-
),
|
|
283
|
-
(
|
|
284
|
-
),
|
|
285
|
-
(
|
|
286
|
-
),
|
|
287
|
-
const L = new Set(
|
|
288
|
-
|
|
289
|
-
},
|
|
290
|
-
|
|
291
|
-
L.has(
|
|
278
|
+
[s, j]
|
|
279
|
+
), J = le.filter(
|
|
280
|
+
(y) => y.permissions.canDelete
|
|
281
|
+
), Le = le.filter(
|
|
282
|
+
(y) => y.permissions.canShare
|
|
283
|
+
), ve = Y.length > 0 && Y.every(
|
|
284
|
+
(y) => s.has(y.id)
|
|
285
|
+
), de = Y.some(
|
|
286
|
+
(y) => s.has(y.id)
|
|
287
|
+
), me = (y) => {
|
|
288
|
+
const L = new Set(s);
|
|
289
|
+
y(L), d(L);
|
|
290
|
+
}, Z = (y) => {
|
|
291
|
+
me((L) => {
|
|
292
|
+
L.has(y) ? L.delete(y) : L.add(y);
|
|
292
293
|
});
|
|
293
|
-
},
|
|
294
|
-
|
|
295
|
-
const L = new Set(
|
|
296
|
-
return
|
|
294
|
+
}, ye = () => {
|
|
295
|
+
d((y) => {
|
|
296
|
+
const L = new Set(y);
|
|
297
|
+
return ve ? Y.forEach(
|
|
297
298
|
(M) => L.delete(M.id)
|
|
298
|
-
) :
|
|
299
|
+
) : Y.forEach(
|
|
299
300
|
(M) => L.add(M.id)
|
|
300
301
|
), L;
|
|
301
302
|
});
|
|
302
|
-
},
|
|
303
|
-
(await
|
|
304
|
-
},
|
|
305
|
-
const
|
|
306
|
-
if (
|
|
303
|
+
}, _ = async (y) => {
|
|
304
|
+
(await U(y)).success && S();
|
|
305
|
+
}, z = async () => {
|
|
306
|
+
const y = le;
|
|
307
|
+
if (y.length === 0) return;
|
|
307
308
|
let L = !1;
|
|
308
|
-
for (const M of
|
|
309
|
-
if (!(await
|
|
309
|
+
for (const M of y)
|
|
310
|
+
if (!(await U(M)).success) {
|
|
310
311
|
L = !0;
|
|
311
312
|
break;
|
|
312
313
|
}
|
|
313
|
-
L ||
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
onSettled: () =>
|
|
314
|
+
L || S();
|
|
315
|
+
}, ne = (y) => {
|
|
316
|
+
g(y), S();
|
|
317
|
+
}, pe = (y) => {
|
|
318
|
+
D(y), xe(y, {
|
|
319
|
+
onSettled: () => D(null)
|
|
319
320
|
});
|
|
320
|
-
},
|
|
321
|
-
if (
|
|
321
|
+
}, Be = () => {
|
|
322
|
+
if (J.length === 0) {
|
|
322
323
|
O.error("Select a visual you can delete");
|
|
323
324
|
return;
|
|
324
325
|
}
|
|
325
|
-
|
|
326
|
-
},
|
|
327
|
-
const
|
|
326
|
+
N(null), x(!0);
|
|
327
|
+
}, Ke = async () => {
|
|
328
|
+
const y = C ? [C] : J;
|
|
328
329
|
try {
|
|
329
|
-
for (const L of
|
|
330
|
-
await
|
|
331
|
-
|
|
330
|
+
for (const L of y)
|
|
331
|
+
await $(L.id);
|
|
332
|
+
d((L) => {
|
|
332
333
|
const M = new Set(L);
|
|
333
|
-
return
|
|
334
|
+
return y.forEach(
|
|
334
335
|
(ae) => M.delete(ae.id)
|
|
335
336
|
), M;
|
|
336
|
-
}),
|
|
337
|
+
}), x(!1), N(null);
|
|
337
338
|
} catch {
|
|
338
339
|
}
|
|
339
|
-
},
|
|
340
|
-
if (
|
|
340
|
+
}, Ce = () => {
|
|
341
|
+
if (le.length !== 1) {
|
|
341
342
|
O.error("Select one visual to share");
|
|
342
343
|
return;
|
|
343
344
|
}
|
|
344
|
-
const [
|
|
345
|
-
if (!
|
|
345
|
+
const [y] = le;
|
|
346
|
+
if (!y.permissions.canShare) {
|
|
346
347
|
O.error("You do not have permission to share this visual");
|
|
347
348
|
return;
|
|
348
349
|
}
|
|
349
|
-
|
|
350
|
+
c(y);
|
|
350
351
|
}, we = ({
|
|
351
|
-
title:
|
|
352
|
+
title: y,
|
|
352
353
|
description: L
|
|
353
354
|
}) => {
|
|
354
|
-
if (!
|
|
355
|
+
if (!m) return;
|
|
355
356
|
const M = {};
|
|
356
|
-
if (
|
|
357
|
-
|
|
357
|
+
if (y !== m.title && (M.title = y), (m.description || "") !== L && (M.description = L), Object.keys(M).length === 0) {
|
|
358
|
+
h(null);
|
|
358
359
|
return;
|
|
359
360
|
}
|
|
360
|
-
const ae = Object.keys(M),
|
|
361
|
-
|
|
361
|
+
const ae = Object.keys(M), ce = ae.length === 1 ? ae[0] : void 0;
|
|
362
|
+
Ie(m.id, ce), V(
|
|
362
363
|
{
|
|
363
|
-
resourceId:
|
|
364
|
+
resourceId: m.id,
|
|
364
365
|
data: M
|
|
365
366
|
},
|
|
366
367
|
{
|
|
367
368
|
onSuccess: () => {
|
|
368
|
-
|
|
369
|
+
Fe(m.id, ce), h(null);
|
|
369
370
|
},
|
|
370
371
|
onError: () => {
|
|
371
|
-
|
|
372
|
+
Fe(m.id, ce);
|
|
372
373
|
}
|
|
373
374
|
}
|
|
374
375
|
);
|
|
375
|
-
},
|
|
376
|
-
a(
|
|
377
|
-
},
|
|
376
|
+
}, X = (y) => {
|
|
377
|
+
a(y), y || b();
|
|
378
|
+
}, Ne = C ? 1 : J.length;
|
|
378
379
|
return /* @__PURE__ */ r(W, { children: [
|
|
379
|
-
/* @__PURE__ */ e(
|
|
380
|
-
|
|
380
|
+
/* @__PURE__ */ e(De, { open: t, onOpenChange: X, children: /* @__PURE__ */ r(
|
|
381
|
+
ke,
|
|
381
382
|
{
|
|
382
383
|
showCloseButton: !1,
|
|
383
|
-
className: "flex max-h-[80vh] w-[min(72rem,calc(100vw-2rem))] max-w-none grid-cols-none flex-col gap-0 overflow-hidden rounded-
|
|
384
|
+
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",
|
|
385
|
+
style: o.dialogStyle,
|
|
384
386
|
children: [
|
|
385
387
|
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
386
388
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
387
|
-
/* @__PURE__ */ e(
|
|
389
|
+
/* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
388
390
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
389
|
-
/* @__PURE__ */ e(
|
|
391
|
+
/* @__PURE__ */ e(Ae, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
|
|
390
392
|
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
|
|
391
393
|
] })
|
|
392
394
|
] }),
|
|
@@ -396,7 +398,7 @@ function _n({
|
|
|
396
398
|
size: "xs",
|
|
397
399
|
variant: "ghost",
|
|
398
400
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
399
|
-
onClick: () =>
|
|
401
|
+
onClick: () => X(!1),
|
|
400
402
|
"aria-label": "Close visuals library",
|
|
401
403
|
children: "×"
|
|
402
404
|
}
|
|
@@ -409,8 +411,8 @@ function _n({
|
|
|
409
411
|
"input",
|
|
410
412
|
{
|
|
411
413
|
autoFocus: !0,
|
|
412
|
-
value:
|
|
413
|
-
onChange: (
|
|
414
|
+
value: n,
|
|
415
|
+
onChange: (y) => i(y.target.value),
|
|
414
416
|
placeholder: "Search visuals...",
|
|
415
417
|
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",
|
|
416
418
|
"aria-label": "Search visuals"
|
|
@@ -423,7 +425,7 @@ function _n({
|
|
|
423
425
|
size: "xs",
|
|
424
426
|
variant: "outline",
|
|
425
427
|
className: "ml-auto",
|
|
426
|
-
onClick: () =>
|
|
428
|
+
onClick: () => l(!0),
|
|
427
429
|
children: [
|
|
428
430
|
/* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" }),
|
|
429
431
|
"New library visual"
|
|
@@ -431,36 +433,36 @@ function _n({
|
|
|
431
433
|
}
|
|
432
434
|
)
|
|
433
435
|
] }),
|
|
434
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children:
|
|
435
|
-
/* @__PURE__ */ e(
|
|
436
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children:
|
|
437
|
-
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children:
|
|
436
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: F ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(Ca, {}) }) : H ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ e("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : Y.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
437
|
+
/* @__PURE__ */ e(mt, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
438
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
|
|
439
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
|
|
438
440
|
] }) : /* @__PURE__ */ e(
|
|
439
441
|
ka,
|
|
440
442
|
{
|
|
441
|
-
visuals:
|
|
442
|
-
selectedIds:
|
|
443
|
-
allFilteredSelected:
|
|
444
|
-
someFilteredSelected:
|
|
445
|
-
onSelectAll:
|
|
446
|
-
onToggleSelection:
|
|
447
|
-
onAddVisual:
|
|
448
|
-
onOpenVisual:
|
|
449
|
-
onEditDetails:
|
|
450
|
-
onShareVisual:
|
|
451
|
-
onDeleteVisual: (
|
|
452
|
-
y
|
|
443
|
+
visuals: Y,
|
|
444
|
+
selectedIds: s,
|
|
445
|
+
allFilteredSelected: ve,
|
|
446
|
+
someFilteredSelected: de,
|
|
447
|
+
onSelectAll: ye,
|
|
448
|
+
onToggleSelection: Z,
|
|
449
|
+
onAddVisual: _,
|
|
450
|
+
onOpenVisual: ne,
|
|
451
|
+
onEditDetails: h,
|
|
452
|
+
onShareVisual: c,
|
|
453
|
+
onDeleteVisual: (y) => {
|
|
454
|
+
N(y), x(!0);
|
|
453
455
|
},
|
|
454
|
-
onDuplicateVisual:
|
|
455
|
-
duplicatingId:
|
|
456
|
-
isDeleting:
|
|
457
|
-
isConsoleMode:
|
|
456
|
+
onDuplicateVisual: pe,
|
|
457
|
+
duplicatingId: I,
|
|
458
|
+
isDeleting: oe,
|
|
459
|
+
isConsoleMode: v
|
|
458
460
|
}
|
|
459
461
|
) }),
|
|
460
462
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
|
|
461
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children:
|
|
463
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children: s.size > 0 && /* @__PURE__ */ r(W, { children: [
|
|
462
464
|
/* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
463
|
-
/* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children:
|
|
465
|
+
/* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children: s.size }),
|
|
464
466
|
" ",
|
|
465
467
|
"selected"
|
|
466
468
|
] }),
|
|
@@ -469,7 +471,7 @@ function _n({
|
|
|
469
471
|
{
|
|
470
472
|
size: "xs",
|
|
471
473
|
variant: "ghost",
|
|
472
|
-
onClick: () =>
|
|
474
|
+
onClick: () => d(/* @__PURE__ */ new Set()),
|
|
473
475
|
children: "Clear"
|
|
474
476
|
}
|
|
475
477
|
),
|
|
@@ -478,10 +480,10 @@ function _n({
|
|
|
478
480
|
{
|
|
479
481
|
size: "xs",
|
|
480
482
|
variant: "outline",
|
|
481
|
-
onClick:
|
|
482
|
-
disabled:
|
|
483
|
+
onClick: Ce,
|
|
484
|
+
disabled: le.length !== 1 || Le.length !== 1,
|
|
483
485
|
children: [
|
|
484
|
-
/* @__PURE__ */ e(
|
|
486
|
+
/* @__PURE__ */ e(Nt, { className: "h-3.5 w-3.5" }),
|
|
485
487
|
"Share"
|
|
486
488
|
]
|
|
487
489
|
}
|
|
@@ -492,12 +494,12 @@ function _n({
|
|
|
492
494
|
size: "xs",
|
|
493
495
|
variant: "outline",
|
|
494
496
|
className: "text-destructive hover:text-destructive",
|
|
495
|
-
onClick:
|
|
496
|
-
disabled:
|
|
497
|
+
onClick: Be,
|
|
498
|
+
disabled: J.length === 0,
|
|
497
499
|
children: [
|
|
498
|
-
/* @__PURE__ */ e(
|
|
500
|
+
/* @__PURE__ */ e(Pe, { className: "h-3.5 w-3.5" }),
|
|
499
501
|
"Delete ",
|
|
500
|
-
|
|
502
|
+
J.length || s.size
|
|
501
503
|
]
|
|
502
504
|
}
|
|
503
505
|
)
|
|
@@ -508,7 +510,7 @@ function _n({
|
|
|
508
510
|
{
|
|
509
511
|
size: "xs",
|
|
510
512
|
variant: "outline",
|
|
511
|
-
onClick: () =>
|
|
513
|
+
onClick: () => X(!1),
|
|
512
514
|
children: "Close"
|
|
513
515
|
}
|
|
514
516
|
),
|
|
@@ -516,11 +518,11 @@ function _n({
|
|
|
516
518
|
B,
|
|
517
519
|
{
|
|
518
520
|
size: "xs",
|
|
519
|
-
onClick:
|
|
520
|
-
disabled:
|
|
521
|
+
onClick: z,
|
|
522
|
+
disabled: s.size === 0,
|
|
521
523
|
children: [
|
|
522
|
-
/* @__PURE__ */ e(
|
|
523
|
-
|
|
524
|
+
/* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" }),
|
|
525
|
+
s.size === 0 ? "Add to dashboard" : `Add ${s.size} visual${s.size === 1 ? "" : "s"}`
|
|
524
526
|
]
|
|
525
527
|
}
|
|
526
528
|
)
|
|
@@ -532,62 +534,62 @@ function _n({
|
|
|
532
534
|
/* @__PURE__ */ e(
|
|
533
535
|
wa,
|
|
534
536
|
{
|
|
535
|
-
open:
|
|
536
|
-
onOpenChange:
|
|
537
|
-
onSubmit:
|
|
538
|
-
isCreating:
|
|
537
|
+
open: p,
|
|
538
|
+
onOpenChange: l,
|
|
539
|
+
onSubmit: k,
|
|
540
|
+
isCreating: re
|
|
539
541
|
}
|
|
540
542
|
),
|
|
541
|
-
|
|
542
|
-
|
|
543
|
+
u && /* @__PURE__ */ e(
|
|
544
|
+
Xt,
|
|
543
545
|
{
|
|
544
|
-
resource:
|
|
545
|
-
resourceType:
|
|
546
|
-
onClose: () =>
|
|
546
|
+
resource: u,
|
|
547
|
+
resourceType: Zt.VISUAL,
|
|
548
|
+
onClose: () => c(null)
|
|
547
549
|
}
|
|
548
550
|
),
|
|
549
|
-
|
|
550
|
-
|
|
551
|
+
m && /* @__PURE__ */ e(
|
|
552
|
+
Qt,
|
|
551
553
|
{
|
|
552
|
-
open: !!
|
|
554
|
+
open: !!m,
|
|
553
555
|
resourceLabel: "Visual",
|
|
554
|
-
initialTitle:
|
|
555
|
-
initialDescription:
|
|
556
|
-
onClose: () =>
|
|
556
|
+
initialTitle: m.title || "",
|
|
557
|
+
initialDescription: m.description || "",
|
|
558
|
+
onClose: () => h(null),
|
|
557
559
|
onSave: we,
|
|
558
|
-
isSaving:
|
|
560
|
+
isSaving: ie(m.id)
|
|
559
561
|
}
|
|
560
562
|
),
|
|
561
563
|
/* @__PURE__ */ e(
|
|
562
|
-
|
|
564
|
+
tt,
|
|
563
565
|
{
|
|
564
|
-
open:
|
|
565
|
-
onOpenChange: (
|
|
566
|
-
!
|
|
566
|
+
open: f,
|
|
567
|
+
onOpenChange: (y) => {
|
|
568
|
+
!y && oe || (x(y), y || N(null));
|
|
567
569
|
},
|
|
568
|
-
children: /* @__PURE__ */ r(
|
|
569
|
-
/* @__PURE__ */ r(
|
|
570
|
-
/* @__PURE__ */ r(
|
|
570
|
+
children: /* @__PURE__ */ r(rt, { children: [
|
|
571
|
+
/* @__PURE__ */ r(at, { children: [
|
|
572
|
+
/* @__PURE__ */ r(nt, { children: [
|
|
571
573
|
"Delete ",
|
|
572
|
-
|
|
574
|
+
Ne,
|
|
573
575
|
" visual",
|
|
574
|
-
|
|
576
|
+
Ne === 1 ? "" : "s",
|
|
575
577
|
"?"
|
|
576
578
|
] }),
|
|
577
|
-
/* @__PURE__ */ e(
|
|
579
|
+
/* @__PURE__ */ e(st, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
578
580
|
] }),
|
|
579
|
-
/* @__PURE__ */ r(
|
|
580
|
-
/* @__PURE__ */ e(
|
|
581
|
+
/* @__PURE__ */ r(ot, { children: [
|
|
582
|
+
/* @__PURE__ */ e(it, { disabled: oe, children: "Cancel" }),
|
|
581
583
|
/* @__PURE__ */ r(
|
|
582
|
-
|
|
584
|
+
St,
|
|
583
585
|
{
|
|
584
|
-
onClick: (
|
|
585
|
-
|
|
586
|
+
onClick: (y) => {
|
|
587
|
+
y.preventDefault(), Ke();
|
|
586
588
|
},
|
|
587
|
-
disabled:
|
|
589
|
+
disabled: oe || Ne === 0,
|
|
588
590
|
children: [
|
|
589
|
-
|
|
590
|
-
|
|
591
|
+
oe ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-3.5 w-3.5" }),
|
|
592
|
+
oe ? "Deleting..." : "Delete"
|
|
591
593
|
]
|
|
592
594
|
}
|
|
593
595
|
)
|
|
@@ -600,27 +602,27 @@ function _n({
|
|
|
600
602
|
function ka({
|
|
601
603
|
visuals: t,
|
|
602
604
|
selectedIds: a,
|
|
603
|
-
allFilteredSelected:
|
|
604
|
-
someFilteredSelected:
|
|
605
|
-
onSelectAll:
|
|
606
|
-
onToggleSelection:
|
|
607
|
-
onAddVisual:
|
|
608
|
-
onOpenVisual:
|
|
605
|
+
allFilteredSelected: o,
|
|
606
|
+
someFilteredSelected: n,
|
|
607
|
+
onSelectAll: i,
|
|
608
|
+
onToggleSelection: s,
|
|
609
|
+
onAddVisual: d,
|
|
610
|
+
onOpenVisual: p,
|
|
609
611
|
onEditDetails: l,
|
|
610
|
-
onShareVisual:
|
|
611
|
-
onDeleteVisual:
|
|
612
|
-
onDuplicateVisual:
|
|
612
|
+
onShareVisual: u,
|
|
613
|
+
onDeleteVisual: c,
|
|
614
|
+
onDuplicateVisual: m,
|
|
613
615
|
duplicatingId: h,
|
|
614
|
-
isDeleting:
|
|
615
|
-
isConsoleMode:
|
|
616
|
+
isDeleting: f,
|
|
617
|
+
isConsoleMode: x
|
|
616
618
|
}) {
|
|
617
619
|
return /* @__PURE__ */ r("div", { className: "min-w-[48rem]", children: [
|
|
618
620
|
/* @__PURE__ */ r("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: [
|
|
619
621
|
/* @__PURE__ */ e(
|
|
620
|
-
|
|
622
|
+
lt,
|
|
621
623
|
{
|
|
622
|
-
checked:
|
|
623
|
-
onCheckedChange:
|
|
624
|
+
checked: o ? !0 : n ? "indeterminate" : !1,
|
|
625
|
+
onCheckedChange: i,
|
|
624
626
|
"aria-label": "Select all visuals"
|
|
625
627
|
}
|
|
626
628
|
),
|
|
@@ -631,57 +633,57 @@ function ka({
|
|
|
631
633
|
/* @__PURE__ */ e("span", { className: "text-right", children: "Shared" }),
|
|
632
634
|
/* @__PURE__ */ e("span", { className: "text-right", children: "Actions" })
|
|
633
635
|
] }),
|
|
634
|
-
t.map((
|
|
636
|
+
t.map((C) => /* @__PURE__ */ e(
|
|
635
637
|
Aa,
|
|
636
638
|
{
|
|
637
|
-
visual:
|
|
638
|
-
selected: a.has(
|
|
639
|
-
onToggleSelection:
|
|
640
|
-
onAddVisual:
|
|
641
|
-
onOpenVisual:
|
|
639
|
+
visual: C,
|
|
640
|
+
selected: a.has(C.id),
|
|
641
|
+
onToggleSelection: s,
|
|
642
|
+
onAddVisual: d,
|
|
643
|
+
onOpenVisual: p,
|
|
642
644
|
onEditDetails: l,
|
|
643
|
-
onShareVisual:
|
|
644
|
-
onDeleteVisual:
|
|
645
|
-
onDuplicateVisual:
|
|
645
|
+
onShareVisual: u,
|
|
646
|
+
onDeleteVisual: c,
|
|
647
|
+
onDuplicateVisual: m,
|
|
646
648
|
duplicatingId: h,
|
|
647
|
-
isDeleting:
|
|
648
|
-
isConsoleMode:
|
|
649
|
+
isDeleting: f,
|
|
650
|
+
isConsoleMode: x
|
|
649
651
|
},
|
|
650
|
-
|
|
652
|
+
C.id
|
|
651
653
|
))
|
|
652
654
|
] });
|
|
653
655
|
}
|
|
654
656
|
function Aa({
|
|
655
657
|
visual: t,
|
|
656
658
|
selected: a,
|
|
657
|
-
onToggleSelection:
|
|
658
|
-
onAddVisual:
|
|
659
|
-
onOpenVisual:
|
|
660
|
-
onEditDetails:
|
|
661
|
-
onShareVisual:
|
|
662
|
-
onDeleteVisual:
|
|
659
|
+
onToggleSelection: o,
|
|
660
|
+
onAddVisual: n,
|
|
661
|
+
onOpenVisual: i,
|
|
662
|
+
onEditDetails: s,
|
|
663
|
+
onShareVisual: d,
|
|
664
|
+
onDeleteVisual: p,
|
|
663
665
|
onDuplicateVisual: l,
|
|
664
|
-
duplicatingId:
|
|
665
|
-
isDeleting:
|
|
666
|
-
isConsoleMode:
|
|
666
|
+
duplicatingId: u,
|
|
667
|
+
isDeleting: c,
|
|
668
|
+
isConsoleMode: m
|
|
667
669
|
}) {
|
|
668
|
-
var
|
|
669
|
-
const h = Sa(t.kind),
|
|
670
|
-
|
|
670
|
+
var x;
|
|
671
|
+
const h = Sa(t.kind), f = () => {
|
|
672
|
+
n(t);
|
|
671
673
|
};
|
|
672
674
|
return /* @__PURE__ */ r(
|
|
673
675
|
"div",
|
|
674
676
|
{
|
|
675
|
-
className:
|
|
677
|
+
className: q(
|
|
676
678
|
"group grid min-h-12 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/50 px-3 text-[13px] hover:bg-muted/50",
|
|
677
679
|
a && "bg-muted/70"
|
|
678
680
|
),
|
|
679
681
|
children: [
|
|
680
682
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
681
|
-
|
|
683
|
+
lt,
|
|
682
684
|
{
|
|
683
685
|
checked: a,
|
|
684
|
-
onCheckedChange: () =>
|
|
686
|
+
onCheckedChange: () => o(t.id),
|
|
685
687
|
"aria-label": `Select ${t.title || "visual"}`
|
|
686
688
|
}
|
|
687
689
|
) }),
|
|
@@ -690,7 +692,7 @@ function Aa({
|
|
|
690
692
|
{
|
|
691
693
|
type: "button",
|
|
692
694
|
className: "flex min-w-0 items-center gap-2 rounded-[4px] text-left outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
693
|
-
onClick:
|
|
695
|
+
onClick: f,
|
|
694
696
|
"aria-label": `Add ${t.title || "visual"} to dashboard`,
|
|
695
697
|
children: [
|
|
696
698
|
/* @__PURE__ */ e(h, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
@@ -703,7 +705,7 @@ function Aa({
|
|
|
703
705
|
children: t.title || "Untitled Visual"
|
|
704
706
|
}
|
|
705
707
|
),
|
|
706
|
-
((
|
|
708
|
+
((x = t.description) == null ? void 0 : x.trim()) && /* @__PURE__ */ e(
|
|
707
709
|
"div",
|
|
708
710
|
{
|
|
709
711
|
className: "truncate text-[11px] text-muted-foreground",
|
|
@@ -716,24 +718,24 @@ function Aa({
|
|
|
716
718
|
}
|
|
717
719
|
),
|
|
718
720
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
719
|
-
/* @__PURE__ */ e("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: Na(t,
|
|
720
|
-
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children:
|
|
721
|
+
/* @__PURE__ */ e("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: Na(t, m) }),
|
|
722
|
+
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: ft(t, m) })
|
|
721
723
|
] }),
|
|
722
|
-
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children:
|
|
724
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: Ot(t.updatedAt) }),
|
|
723
725
|
/* @__PURE__ */ e(Da, { visual: t }),
|
|
724
726
|
/* @__PURE__ */ e("span", { className: "text-right tabular-nums text-muted-foreground", children: t.ownership.sharedCount > 0 ? t.ownership.sharedCount : "—" }),
|
|
725
727
|
/* @__PURE__ */ e(
|
|
726
728
|
Ea,
|
|
727
729
|
{
|
|
728
730
|
visual: t,
|
|
729
|
-
onOpenVisual:
|
|
730
|
-
onEditDetails:
|
|
731
|
-
onShareVisual:
|
|
732
|
-
onDeleteVisual:
|
|
731
|
+
onOpenVisual: i,
|
|
732
|
+
onEditDetails: s,
|
|
733
|
+
onShareVisual: d,
|
|
734
|
+
onDeleteVisual: p,
|
|
733
735
|
onDuplicateVisual: l,
|
|
734
|
-
duplicatingId:
|
|
735
|
-
isDeleting:
|
|
736
|
-
isConsoleMode:
|
|
736
|
+
duplicatingId: u,
|
|
737
|
+
isDeleting: c,
|
|
738
|
+
isConsoleMode: m
|
|
737
739
|
}
|
|
738
740
|
)
|
|
739
741
|
]
|
|
@@ -743,19 +745,19 @@ function Aa({
|
|
|
743
745
|
function Ea({
|
|
744
746
|
visual: t,
|
|
745
747
|
onOpenVisual: a,
|
|
746
|
-
onEditDetails:
|
|
747
|
-
onShareVisual:
|
|
748
|
-
onDeleteVisual:
|
|
749
|
-
onDuplicateVisual:
|
|
750
|
-
duplicatingId:
|
|
751
|
-
isDeleting:
|
|
748
|
+
onEditDetails: o,
|
|
749
|
+
onShareVisual: n,
|
|
750
|
+
onDeleteVisual: i,
|
|
751
|
+
onDuplicateVisual: s,
|
|
752
|
+
duplicatingId: d,
|
|
753
|
+
isDeleting: p,
|
|
752
754
|
isConsoleMode: l
|
|
753
755
|
}) {
|
|
754
756
|
return /* @__PURE__ */ r(
|
|
755
757
|
"div",
|
|
756
758
|
{
|
|
757
759
|
className: "flex items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
|
|
758
|
-
onClick: (
|
|
760
|
+
onClick: (u) => u.stopPropagation(),
|
|
759
761
|
children: [
|
|
760
762
|
/* @__PURE__ */ e(
|
|
761
763
|
B,
|
|
@@ -765,73 +767,73 @@ function Ea({
|
|
|
765
767
|
className: "w-7 px-0",
|
|
766
768
|
onClick: () => a(t),
|
|
767
769
|
"aria-label": "Edit visual",
|
|
768
|
-
children: /* @__PURE__ */ e(
|
|
770
|
+
children: /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" })
|
|
769
771
|
}
|
|
770
772
|
),
|
|
771
|
-
/* @__PURE__ */ r(
|
|
772
|
-
/* @__PURE__ */ e(
|
|
773
|
+
/* @__PURE__ */ r($e, { modal: !1, children: [
|
|
774
|
+
/* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
|
|
773
775
|
B,
|
|
774
776
|
{
|
|
775
777
|
size: "xs",
|
|
776
778
|
variant: "ghost",
|
|
777
779
|
className: "w-7 px-0",
|
|
778
780
|
"aria-label": "More actions",
|
|
779
|
-
children: /* @__PURE__ */ e(
|
|
781
|
+
children: /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" })
|
|
780
782
|
}
|
|
781
783
|
) }),
|
|
782
784
|
/* @__PURE__ */ r(
|
|
783
|
-
|
|
785
|
+
We,
|
|
784
786
|
{
|
|
785
787
|
align: "end",
|
|
786
788
|
className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
787
789
|
children: [
|
|
788
|
-
/* @__PURE__ */ r(
|
|
789
|
-
/* @__PURE__ */ e(
|
|
790
|
+
/* @__PURE__ */ r(G, { onClick: () => a(t), children: [
|
|
791
|
+
/* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" }),
|
|
790
792
|
"Edit visual"
|
|
791
793
|
] }),
|
|
792
794
|
/* @__PURE__ */ r(
|
|
793
|
-
|
|
795
|
+
G,
|
|
794
796
|
{
|
|
795
|
-
onClick: () =>
|
|
796
|
-
disabled:
|
|
797
|
+
onClick: () => s(t.id),
|
|
798
|
+
disabled: d === t.id,
|
|
797
799
|
children: [
|
|
798
|
-
|
|
799
|
-
|
|
800
|
+
d === t.id ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(er, { className: "h-3.5 w-3.5" }),
|
|
801
|
+
d === t.id ? "Duplicating..." : "Duplicate"
|
|
800
802
|
]
|
|
801
803
|
}
|
|
802
804
|
),
|
|
803
|
-
t.permissions.canEdit && /* @__PURE__ */ r(
|
|
804
|
-
/* @__PURE__ */ e(
|
|
805
|
+
t.permissions.canEdit && /* @__PURE__ */ r(G, { onClick: () => o(t), children: [
|
|
806
|
+
/* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" }),
|
|
805
807
|
"Edit details"
|
|
806
808
|
] }),
|
|
807
|
-
t.permissions.canShare && /* @__PURE__ */ r(
|
|
808
|
-
/* @__PURE__ */ e(
|
|
809
|
+
t.permissions.canShare && /* @__PURE__ */ r(G, { onClick: () => n(t), children: [
|
|
810
|
+
/* @__PURE__ */ e(Nt, { className: "h-3.5 w-3.5" }),
|
|
809
811
|
"Share"
|
|
810
812
|
] }),
|
|
811
813
|
t.permissions.canDelete && /* @__PURE__ */ r(W, { children: [
|
|
812
|
-
/* @__PURE__ */ e(
|
|
814
|
+
/* @__PURE__ */ e(Me, {}),
|
|
813
815
|
/* @__PURE__ */ r(
|
|
814
|
-
|
|
816
|
+
G,
|
|
815
817
|
{
|
|
816
818
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
817
|
-
onClick: () =>
|
|
818
|
-
disabled:
|
|
819
|
+
onClick: () => i(t),
|
|
820
|
+
disabled: p,
|
|
819
821
|
children: [
|
|
820
|
-
/* @__PURE__ */ e(
|
|
821
|
-
|
|
822
|
+
/* @__PURE__ */ e(Pe, { className: "h-3.5 w-3.5" }),
|
|
823
|
+
p ? "Deleting..." : "Delete"
|
|
822
824
|
]
|
|
823
825
|
}
|
|
824
826
|
)
|
|
825
827
|
] }),
|
|
826
|
-
/* @__PURE__ */ e(
|
|
828
|
+
/* @__PURE__ */ e(Me, {}),
|
|
827
829
|
/* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
828
|
-
|
|
829
|
-
/* @__PURE__ */ e(
|
|
830
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
830
|
+
_t(t, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
831
|
+
/* @__PURE__ */ e(tr, { className: "h-3 w-3" }),
|
|
832
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: ft(t, l) })
|
|
831
833
|
] }),
|
|
832
834
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
833
|
-
/* @__PURE__ */ e(
|
|
834
|
-
/* @__PURE__ */ e("span", { children:
|
|
835
|
+
/* @__PURE__ */ e(rr, { className: "h-3 w-3" }),
|
|
836
|
+
/* @__PURE__ */ e("span", { children: Ot(t.updatedAt) })
|
|
835
837
|
] })
|
|
836
838
|
] })
|
|
837
839
|
]
|
|
@@ -845,27 +847,27 @@ function Ea({
|
|
|
845
847
|
function Ia({
|
|
846
848
|
open: t,
|
|
847
849
|
onOpenChange: a,
|
|
848
|
-
isLibraryVisual:
|
|
849
|
-
currentVisualName:
|
|
850
|
-
isSaving:
|
|
851
|
-
destinationMode:
|
|
852
|
-
onConfirm:
|
|
850
|
+
isLibraryVisual: o,
|
|
851
|
+
currentVisualName: n,
|
|
852
|
+
isSaving: i = !1,
|
|
853
|
+
destinationMode: s = "both",
|
|
854
|
+
onConfirm: d
|
|
853
855
|
}) {
|
|
854
|
-
const [
|
|
855
|
-
|
|
856
|
-
), [
|
|
857
|
-
|
|
856
|
+
const [p, l] = E(
|
|
857
|
+
o && n ? `Copy of ${n}` : n || ""
|
|
858
|
+
), [u, c] = E("");
|
|
859
|
+
Wt.useEffect(() => {
|
|
858
860
|
t && (l(
|
|
859
|
-
|
|
860
|
-
),
|
|
861
|
-
}, [t,
|
|
862
|
-
const
|
|
861
|
+
o && n ? `Copy of ${n}` : n || ""
|
|
862
|
+
), c(""));
|
|
863
|
+
}, [t, o, n]);
|
|
864
|
+
const m = !!p.trim(), h = s === "local" ? {
|
|
863
865
|
saveToLibrary: !1,
|
|
864
866
|
saveToCurrentDashboard: !0,
|
|
865
867
|
badgeType: "local",
|
|
866
868
|
description: "Creates a local copy on the current dashboard.",
|
|
867
869
|
actionLabel: "Add to Dashboard (Local)"
|
|
868
|
-
} :
|
|
870
|
+
} : s === "library" ? {
|
|
869
871
|
saveToLibrary: !0,
|
|
870
872
|
saveToCurrentDashboard: !1,
|
|
871
873
|
badgeType: "library",
|
|
@@ -877,17 +879,17 @@ function Ia({
|
|
|
877
879
|
badgeType: "linked",
|
|
878
880
|
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
879
881
|
actionLabel: "Save Copy as Linked Visual"
|
|
880
|
-
},
|
|
881
|
-
!
|
|
882
|
-
name:
|
|
883
|
-
description:
|
|
882
|
+
}, f = () => {
|
|
883
|
+
!m || i || d({
|
|
884
|
+
name: p.trim(),
|
|
885
|
+
description: u.trim() || void 0,
|
|
884
886
|
saveToLibrary: h.saveToLibrary,
|
|
885
887
|
saveToCurrentDashboard: h.saveToCurrentDashboard
|
|
886
888
|
});
|
|
887
889
|
};
|
|
888
|
-
return /* @__PURE__ */ e(
|
|
889
|
-
/* @__PURE__ */ r(
|
|
890
|
-
/* @__PURE__ */ r(
|
|
890
|
+
return /* @__PURE__ */ e(De, { open: t, onOpenChange: a, children: /* @__PURE__ */ r(ke, { className: "sm:max-w-[500px]", children: [
|
|
891
|
+
/* @__PURE__ */ r(ct, { children: [
|
|
892
|
+
/* @__PURE__ */ r(Ae, { className: "flex items-center gap-2", children: [
|
|
891
893
|
/* @__PURE__ */ e("span", { children: "Save Visual As" }),
|
|
892
894
|
h.badgeType !== "local" && /* @__PURE__ */ e(
|
|
893
895
|
oa,
|
|
@@ -898,77 +900,77 @@ function Ia({
|
|
|
898
900
|
}
|
|
899
901
|
)
|
|
900
902
|
] }),
|
|
901
|
-
/* @__PURE__ */ e(
|
|
903
|
+
/* @__PURE__ */ e(dt, { children: h.description })
|
|
902
904
|
] }),
|
|
903
905
|
/* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
|
|
904
906
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
905
|
-
/* @__PURE__ */ e(
|
|
907
|
+
/* @__PURE__ */ e(Se, { htmlFor: "name", children: "Name" }),
|
|
906
908
|
/* @__PURE__ */ e(
|
|
907
|
-
|
|
909
|
+
Ye,
|
|
908
910
|
{
|
|
909
911
|
id: "name",
|
|
910
|
-
value:
|
|
911
|
-
onChange: (
|
|
912
|
+
value: p,
|
|
913
|
+
onChange: (x) => l(x.target.value),
|
|
912
914
|
placeholder: "Enter visual name",
|
|
913
|
-
disabled:
|
|
915
|
+
disabled: i
|
|
914
916
|
}
|
|
915
917
|
)
|
|
916
918
|
] }),
|
|
917
919
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
918
|
-
/* @__PURE__ */ e(
|
|
920
|
+
/* @__PURE__ */ e(Se, { htmlFor: "description", children: "Description (optional)" }),
|
|
919
921
|
/* @__PURE__ */ e(
|
|
920
|
-
|
|
922
|
+
ar,
|
|
921
923
|
{
|
|
922
924
|
id: "description",
|
|
923
|
-
value:
|
|
924
|
-
onChange: (
|
|
925
|
+
value: u,
|
|
926
|
+
onChange: (x) => c(x.target.value),
|
|
925
927
|
placeholder: "Enter visual description",
|
|
926
928
|
rows: 3,
|
|
927
|
-
disabled:
|
|
929
|
+
disabled: i
|
|
928
930
|
}
|
|
929
931
|
)
|
|
930
932
|
] })
|
|
931
933
|
] }),
|
|
932
|
-
/* @__PURE__ */ r(
|
|
934
|
+
/* @__PURE__ */ r(nr, { children: [
|
|
933
935
|
/* @__PURE__ */ e(
|
|
934
936
|
B,
|
|
935
937
|
{
|
|
936
938
|
variant: "outline",
|
|
937
939
|
onClick: () => a(!1),
|
|
938
|
-
disabled:
|
|
940
|
+
disabled: i,
|
|
939
941
|
children: "Cancel"
|
|
940
942
|
}
|
|
941
943
|
),
|
|
942
|
-
/* @__PURE__ */ r(B, { onClick:
|
|
943
|
-
|
|
944
|
+
/* @__PURE__ */ r(B, { onClick: f, disabled: !m || i, children: [
|
|
945
|
+
i && /* @__PURE__ */ e(te, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
944
946
|
h.actionLabel
|
|
945
947
|
] })
|
|
946
948
|
] })
|
|
947
949
|
] }) });
|
|
948
950
|
}
|
|
949
951
|
function Fa() {
|
|
950
|
-
const [t, a] = E(!1), [
|
|
951
|
-
var
|
|
952
|
-
return ((
|
|
953
|
-
})(),
|
|
954
|
-
|
|
952
|
+
const [t, a] = E(!1), [o, n] = E(!1), [i, s] = E(null), [d, p] = E(null), l = ge((g) => g.frame), u = ge((g) => g.card), c = sr(), m = P((g) => g.selectedSheetId), h = P((g) => g.dashboard), { getUpdatedFrame: f } = pt(), { selectVisual: x } = wt(), { addFrame: C, setSelectedFrameId: N, setIsVisualEditing: I } = be(), D = kt(), b = !!(l != null && l.visualId), S = (() => {
|
|
953
|
+
var g, v;
|
|
954
|
+
return ((g = l == null ? void 0 : l.cards) == null ? void 0 : g.length) === 1 && ((v = l.cards[0]) != null && v.title) ? l.cards[0].title : c != null && c.title ? c.title : (u == null ? void 0 : u.title) || "Untitled Visual";
|
|
955
|
+
})(), A = or((g) => {
|
|
956
|
+
g != null && g.id && (x(g), o && i && d && m && (async () => {
|
|
955
957
|
try {
|
|
956
|
-
const
|
|
957
|
-
...
|
|
958
|
-
id:
|
|
959
|
-
visualId:
|
|
958
|
+
const v = {
|
|
959
|
+
...i,
|
|
960
|
+
id: bt(),
|
|
961
|
+
visualId: g.id
|
|
960
962
|
// Link to the newly created library visual
|
|
961
963
|
};
|
|
962
|
-
|
|
964
|
+
C(m, v, {
|
|
963
965
|
position: "end",
|
|
964
|
-
semanticExecutionPayload:
|
|
965
|
-
}),
|
|
966
|
-
} catch (
|
|
966
|
+
semanticExecutionPayload: d
|
|
967
|
+
}), N(v.id), n(!1), s(null), p(null), I(!1);
|
|
968
|
+
} catch (v) {
|
|
967
969
|
console.error(
|
|
968
970
|
"Failed to promote semantic metadata for saved visual:",
|
|
969
|
-
|
|
971
|
+
v
|
|
970
972
|
), O.error(
|
|
971
|
-
|
|
973
|
+
v instanceof Error ? v.message : "Failed to prepare semantic metadata for the saved visual"
|
|
972
974
|
);
|
|
973
975
|
}
|
|
974
976
|
})(), a(!1));
|
|
@@ -976,65 +978,65 @@ function Fa() {
|
|
|
976
978
|
return {
|
|
977
979
|
saveAsDialogOpen: t,
|
|
978
980
|
setSaveAsDialogOpen: a,
|
|
979
|
-
handleSaveAs: async (
|
|
980
|
-
if (!
|
|
981
|
+
handleSaveAs: async (g) => {
|
|
982
|
+
if (!m) {
|
|
981
983
|
O.error("No sheet selected");
|
|
982
984
|
return;
|
|
983
985
|
}
|
|
984
|
-
const
|
|
986
|
+
const v = f(), T = Tt(v);
|
|
985
987
|
if (T) {
|
|
986
988
|
O.error(T);
|
|
987
989
|
return;
|
|
988
990
|
}
|
|
989
|
-
const H =
|
|
990
|
-
...
|
|
991
|
-
cards:
|
|
992
|
-
...
|
|
993
|
-
title:
|
|
991
|
+
const H = v.cards.length === 1 ? {
|
|
992
|
+
...v,
|
|
993
|
+
cards: v.cards.map((k) => ({
|
|
994
|
+
...k,
|
|
995
|
+
title: g.name
|
|
994
996
|
// Use visual name as card title
|
|
995
997
|
}))
|
|
996
|
-
} :
|
|
997
|
-
if (
|
|
998
|
-
let
|
|
999
|
-
if (
|
|
998
|
+
} : v;
|
|
999
|
+
if (g.saveToLibrary) {
|
|
1000
|
+
let k = null;
|
|
1001
|
+
if (g.saveToCurrentDashboard)
|
|
1000
1002
|
try {
|
|
1001
|
-
|
|
1002
|
-
previousFrame:
|
|
1003
|
+
k = await D(H, {
|
|
1004
|
+
previousFrame: Je(h, H.id)
|
|
1003
1005
|
});
|
|
1004
|
-
} catch (
|
|
1006
|
+
} catch ($) {
|
|
1005
1007
|
console.error(
|
|
1006
1008
|
"Failed to prepare semantic metadata before saving visual:",
|
|
1007
|
-
|
|
1009
|
+
$
|
|
1008
1010
|
), O.error(
|
|
1009
|
-
|
|
1011
|
+
$ instanceof Error ? $.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1010
1012
|
);
|
|
1011
1013
|
return;
|
|
1012
1014
|
}
|
|
1013
|
-
|
|
1015
|
+
n(g.saveToCurrentDashboard), s(H), p(k);
|
|
1014
1016
|
const V = {
|
|
1015
|
-
title:
|
|
1016
|
-
description:
|
|
1017
|
+
title: g.name,
|
|
1018
|
+
description: g.description,
|
|
1017
1019
|
frameObject: H,
|
|
1018
1020
|
// Card title synced for single-card frames
|
|
1019
1021
|
isPrivate: !1
|
|
1020
1022
|
};
|
|
1021
|
-
|
|
1022
|
-
} else if (
|
|
1023
|
-
const
|
|
1023
|
+
A.mutate(V);
|
|
1024
|
+
} else if (g.saveToCurrentDashboard) {
|
|
1025
|
+
const k = {
|
|
1024
1026
|
...H,
|
|
1025
1027
|
// Card title already synced
|
|
1026
|
-
id:
|
|
1028
|
+
id: bt(),
|
|
1027
1029
|
visualId: void 0
|
|
1028
1030
|
// Explicitly no visualId for local visuals
|
|
1029
1031
|
};
|
|
1030
1032
|
try {
|
|
1031
|
-
const V = await
|
|
1032
|
-
previousFrame:
|
|
1033
|
+
const V = await D(H, {
|
|
1034
|
+
previousFrame: Je(h, H.id)
|
|
1033
1035
|
});
|
|
1034
|
-
|
|
1036
|
+
C(m, k, {
|
|
1035
1037
|
position: "end",
|
|
1036
1038
|
semanticExecutionPayload: V
|
|
1037
|
-
}),
|
|
1039
|
+
}), N(k.id), O.success("Visual saved to dashboard"), a(!1), I(!1);
|
|
1038
1040
|
} catch (V) {
|
|
1039
1041
|
console.error("Failed to save visual to dashboard:", V), O.error(
|
|
1040
1042
|
V instanceof Error ? V.message : "Failed to prepare semantic metadata for the visual"
|
|
@@ -1042,113 +1044,113 @@ function Fa() {
|
|
|
1042
1044
|
}
|
|
1043
1045
|
}
|
|
1044
1046
|
},
|
|
1045
|
-
isLibraryVisual:
|
|
1047
|
+
isLibraryVisual: b,
|
|
1046
1048
|
currentVisualName: S,
|
|
1047
|
-
isSaving:
|
|
1049
|
+
isSaving: A.isPending
|
|
1048
1050
|
};
|
|
1049
1051
|
}
|
|
1050
1052
|
function $n(t = {}) {
|
|
1051
|
-
const { isInspectionMode: a } =
|
|
1052
|
-
saveAsDialogOpen:
|
|
1053
|
+
const { isInspectionMode: a } = ir(), o = ge((k) => k.frame), n = ge((k) => k.editorContext), i = lr((k) => k.selectedVisual), s = P((k) => k.selectedFrameId), d = P((k) => k.selectedSheetId), p = P((k) => k.dashboard), { setIsVisualEditing: l, updateFrame: u } = be(), [c, m] = E(!1), [h, f] = E("both"), x = kt(), C = (n == null ? void 0 : n.type) === "documentSection", N = !!(o != null && o.visualId || i != null && i.id), I = !!(o != null && o.visualId && s), D = N && !I, {
|
|
1054
|
+
saveAsDialogOpen: b,
|
|
1053
1055
|
setSaveAsDialogOpen: S,
|
|
1054
|
-
handleSaveAs:
|
|
1056
|
+
handleSaveAs: A,
|
|
1055
1057
|
isLibraryVisual: U,
|
|
1056
|
-
currentVisualName:
|
|
1057
|
-
isSaving:
|
|
1058
|
-
} = Fa(), { getUpdatedFrame: T } =
|
|
1058
|
+
currentVisualName: g,
|
|
1059
|
+
isSaving: v
|
|
1060
|
+
} = Fa(), { getUpdatedFrame: T } = pt();
|
|
1059
1061
|
if (a)
|
|
1060
1062
|
return /* @__PURE__ */ r(W, { children: [
|
|
1061
1063
|
/* @__PURE__ */ e(
|
|
1062
|
-
|
|
1064
|
+
Xe,
|
|
1063
1065
|
{
|
|
1064
1066
|
className: "rounded-control",
|
|
1065
1067
|
variant: "default"
|
|
1066
1068
|
}
|
|
1067
1069
|
),
|
|
1068
|
-
/* @__PURE__ */ e(
|
|
1070
|
+
/* @__PURE__ */ e(Ze, {})
|
|
1069
1071
|
] });
|
|
1070
|
-
if (
|
|
1072
|
+
if (C)
|
|
1071
1073
|
return /* @__PURE__ */ r(W, { children: [
|
|
1072
|
-
/* @__PURE__ */ e(
|
|
1073
|
-
/* @__PURE__ */ e(
|
|
1074
|
+
/* @__PURE__ */ e(Xe, { className: "rounded-control", variant: "default" }),
|
|
1075
|
+
/* @__PURE__ */ e(Ze, {})
|
|
1074
1076
|
] });
|
|
1075
1077
|
const F = async () => {
|
|
1076
|
-
if (!
|
|
1078
|
+
if (!d) {
|
|
1077
1079
|
O.error("No sheet selected");
|
|
1078
1080
|
return;
|
|
1079
1081
|
}
|
|
1080
|
-
if (
|
|
1081
|
-
|
|
1082
|
-
const
|
|
1082
|
+
if (c) return;
|
|
1083
|
+
m(!0);
|
|
1084
|
+
const k = T(), V = Tt(k);
|
|
1083
1085
|
if (V) {
|
|
1084
|
-
|
|
1086
|
+
m(!1), O.error(V);
|
|
1085
1087
|
return;
|
|
1086
1088
|
}
|
|
1087
|
-
const
|
|
1088
|
-
...
|
|
1089
|
+
const $ = {
|
|
1090
|
+
...k,
|
|
1089
1091
|
visualId: void 0
|
|
1090
|
-
}, xe =
|
|
1092
|
+
}, xe = Je(p, $.id);
|
|
1091
1093
|
try {
|
|
1092
|
-
const
|
|
1094
|
+
const re = await x($, {
|
|
1093
1095
|
previousFrame: xe
|
|
1094
1096
|
});
|
|
1095
|
-
d
|
|
1096
|
-
semanticExecutionPayload:
|
|
1097
|
+
u(d, $, {
|
|
1098
|
+
semanticExecutionPayload: re
|
|
1097
1099
|
});
|
|
1098
|
-
} catch (
|
|
1099
|
-
console.error("Failed to apply local semantic metadata:",
|
|
1100
|
-
|
|
1100
|
+
} catch (re) {
|
|
1101
|
+
console.error("Failed to apply local semantic metadata:", re), m(!1), O.error(
|
|
1102
|
+
re instanceof Error ? re.message : "Failed to prepare semantic metadata for this visual"
|
|
1101
1103
|
);
|
|
1102
1104
|
return;
|
|
1103
1105
|
}
|
|
1104
1106
|
setTimeout(() => {
|
|
1105
|
-
|
|
1107
|
+
m(!1), O.success("Changes applied. Visual is now local to this dashboard"), l(!1);
|
|
1106
1108
|
}, 300);
|
|
1107
|
-
}, H = (
|
|
1108
|
-
|
|
1109
|
+
}, H = (k) => {
|
|
1110
|
+
f(k), S(!0);
|
|
1109
1111
|
};
|
|
1110
1112
|
return /* @__PURE__ */ r(W, { children: [
|
|
1111
1113
|
/* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
1112
|
-
!
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
/* @__PURE__ */ r(
|
|
1116
|
-
/* @__PURE__ */ e(
|
|
1114
|
+
!N && /* @__PURE__ */ e(Xe, { className: "!rounded-none", variant: "default" }),
|
|
1115
|
+
N && D && /* @__PURE__ */ e(ia, { className: "!rounded-none", variant: "default" }),
|
|
1116
|
+
N && I && /* @__PURE__ */ e(la, { className: "!rounded-none" }),
|
|
1117
|
+
/* @__PURE__ */ r($e, { modal: !1, children: [
|
|
1118
|
+
/* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1117
1119
|
B,
|
|
1118
1120
|
{
|
|
1119
1121
|
variant: "default",
|
|
1120
1122
|
size: "xs",
|
|
1121
1123
|
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
1122
1124
|
"aria-label": "Open visual save options",
|
|
1123
|
-
disabled:
|
|
1124
|
-
children: /* @__PURE__ */ e(
|
|
1125
|
+
disabled: v || c,
|
|
1126
|
+
children: /* @__PURE__ */ e(Ut, { className: "h-3.5 w-3.5" })
|
|
1125
1127
|
}
|
|
1126
1128
|
) }),
|
|
1127
1129
|
/* @__PURE__ */ r(
|
|
1128
|
-
|
|
1130
|
+
We,
|
|
1129
1131
|
{
|
|
1130
1132
|
align: "end",
|
|
1131
1133
|
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
1132
1134
|
children: [
|
|
1133
1135
|
I && /* @__PURE__ */ r(W, { children: [
|
|
1134
1136
|
/* @__PURE__ */ r(
|
|
1135
|
-
|
|
1137
|
+
G,
|
|
1136
1138
|
{
|
|
1137
1139
|
onClick: F,
|
|
1138
|
-
disabled:
|
|
1140
|
+
disabled: c,
|
|
1139
1141
|
children: [
|
|
1140
|
-
/* @__PURE__ */ e(
|
|
1141
|
-
|
|
1142
|
+
/* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" }),
|
|
1143
|
+
c ? "Applying..." : "Apply Locally"
|
|
1142
1144
|
]
|
|
1143
1145
|
}
|
|
1144
1146
|
),
|
|
1145
|
-
/* @__PURE__ */ e(
|
|
1147
|
+
/* @__PURE__ */ e(Me, {})
|
|
1146
1148
|
] }),
|
|
1147
1149
|
/* @__PURE__ */ r(
|
|
1148
|
-
|
|
1150
|
+
G,
|
|
1149
1151
|
{
|
|
1150
1152
|
onClick: () => H("local"),
|
|
1151
|
-
disabled:
|
|
1153
|
+
disabled: v,
|
|
1152
1154
|
children: [
|
|
1153
1155
|
/* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" }),
|
|
1154
1156
|
"Add to Dashboard (Local)"
|
|
@@ -1156,10 +1158,10 @@ function $n(t = {}) {
|
|
|
1156
1158
|
}
|
|
1157
1159
|
),
|
|
1158
1160
|
/* @__PURE__ */ r(
|
|
1159
|
-
|
|
1161
|
+
G,
|
|
1160
1162
|
{
|
|
1161
1163
|
onClick: () => H("library"),
|
|
1162
|
-
disabled:
|
|
1164
|
+
disabled: v,
|
|
1163
1165
|
children: [
|
|
1164
1166
|
/* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" }),
|
|
1165
1167
|
"Save as Library Visual"
|
|
@@ -1167,10 +1169,10 @@ function $n(t = {}) {
|
|
|
1167
1169
|
}
|
|
1168
1170
|
),
|
|
1169
1171
|
/* @__PURE__ */ r(
|
|
1170
|
-
|
|
1172
|
+
G,
|
|
1171
1173
|
{
|
|
1172
1174
|
onClick: () => H("both"),
|
|
1173
|
-
disabled:
|
|
1175
|
+
disabled: v,
|
|
1174
1176
|
children: [
|
|
1175
1177
|
/* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" }),
|
|
1176
1178
|
"Save Copy as Linked Visual"
|
|
@@ -1182,42 +1184,42 @@ function $n(t = {}) {
|
|
|
1182
1184
|
)
|
|
1183
1185
|
] })
|
|
1184
1186
|
] }),
|
|
1185
|
-
/* @__PURE__ */ e(
|
|
1187
|
+
/* @__PURE__ */ e(Ze, {}),
|
|
1186
1188
|
/* @__PURE__ */ e(
|
|
1187
1189
|
Ia,
|
|
1188
1190
|
{
|
|
1189
|
-
open:
|
|
1190
|
-
onOpenChange: (
|
|
1191
|
-
|
|
1191
|
+
open: b,
|
|
1192
|
+
onOpenChange: (k) => {
|
|
1193
|
+
v || S(k);
|
|
1192
1194
|
},
|
|
1193
1195
|
isLibraryVisual: U,
|
|
1194
|
-
currentVisualName:
|
|
1195
|
-
isSaving:
|
|
1196
|
+
currentVisualName: g,
|
|
1197
|
+
isSaving: v,
|
|
1196
1198
|
destinationMode: h,
|
|
1197
|
-
onConfirm:
|
|
1199
|
+
onConfirm: A
|
|
1198
1200
|
}
|
|
1199
1201
|
)
|
|
1200
1202
|
] });
|
|
1201
1203
|
}
|
|
1202
1204
|
function jn({ className: t }) {
|
|
1203
|
-
const a = ge((
|
|
1204
|
-
if (!
|
|
1205
|
+
const a = ge((u) => u.isDevMode), o = P((u) => u.isVisualEditing), { setIsDevMode: n } = Vt(), { config: i } = Ht(cr).tokenProps, s = (i == null ? void 0 : i.showAdvancedMode) !== !1;
|
|
1206
|
+
if (!o || !s)
|
|
1205
1207
|
return null;
|
|
1206
|
-
const
|
|
1208
|
+
const d = a ? pa : dr, p = a ? "Visual editor" : "SQL editor", l = a ? "Switch to visual editor" : "Switch to SQL editor";
|
|
1207
1209
|
return /* @__PURE__ */ r(
|
|
1208
1210
|
"button",
|
|
1209
1211
|
{
|
|
1210
1212
|
type: "button",
|
|
1211
1213
|
"aria-label": l,
|
|
1212
1214
|
title: l,
|
|
1213
|
-
onClick: () =>
|
|
1214
|
-
className:
|
|
1215
|
+
onClick: () => n(!a),
|
|
1216
|
+
className: q(
|
|
1215
1217
|
"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",
|
|
1216
1218
|
t
|
|
1217
1219
|
),
|
|
1218
1220
|
children: [
|
|
1219
|
-
/* @__PURE__ */ e(
|
|
1220
|
-
|
|
1221
|
+
/* @__PURE__ */ e(d, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1222
|
+
p
|
|
1221
1223
|
]
|
|
1222
1224
|
}
|
|
1223
1225
|
);
|
|
@@ -1225,111 +1227,111 @@ function jn({ className: t }) {
|
|
|
1225
1227
|
function Wn({
|
|
1226
1228
|
open: t,
|
|
1227
1229
|
onOpenChange: a,
|
|
1228
|
-
onSave:
|
|
1229
|
-
onDiscard:
|
|
1230
|
-
isSaving:
|
|
1231
|
-
title:
|
|
1232
|
-
description:
|
|
1233
|
-
cancelLabel:
|
|
1230
|
+
onSave: o,
|
|
1231
|
+
onDiscard: n,
|
|
1232
|
+
isSaving: i,
|
|
1233
|
+
title: s = "Unsaved changes",
|
|
1234
|
+
description: d = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
1235
|
+
cancelLabel: p = "Cancel",
|
|
1234
1236
|
discardLabel: l = "Discard",
|
|
1235
|
-
saveLabel:
|
|
1237
|
+
saveLabel: u = "Save"
|
|
1236
1238
|
}) {
|
|
1237
|
-
return /* @__PURE__ */ e(
|
|
1238
|
-
!
|
|
1239
|
-
}, children: /* @__PURE__ */ r(
|
|
1240
|
-
/* @__PURE__ */ r(
|
|
1241
|
-
/* @__PURE__ */ e(
|
|
1242
|
-
/* @__PURE__ */ e(
|
|
1239
|
+
return /* @__PURE__ */ e(tt, { open: t, onOpenChange: (m) => {
|
|
1240
|
+
!m && i || a(m);
|
|
1241
|
+
}, children: /* @__PURE__ */ r(rt, { children: [
|
|
1242
|
+
/* @__PURE__ */ r(at, { children: [
|
|
1243
|
+
/* @__PURE__ */ e(nt, { children: s }),
|
|
1244
|
+
/* @__PURE__ */ e(st, { children: d })
|
|
1243
1245
|
] }),
|
|
1244
|
-
/* @__PURE__ */ r(
|
|
1246
|
+
/* @__PURE__ */ r(ot, { children: [
|
|
1245
1247
|
/* @__PURE__ */ e(
|
|
1246
1248
|
B,
|
|
1247
1249
|
{
|
|
1248
1250
|
type: "button",
|
|
1249
1251
|
size: "xs",
|
|
1250
|
-
onClick:
|
|
1251
|
-
disabled:
|
|
1252
|
+
onClick: n,
|
|
1253
|
+
disabled: i,
|
|
1252
1254
|
variant: "ghost",
|
|
1253
1255
|
className: "mr-auto text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
|
|
1254
1256
|
children: l
|
|
1255
1257
|
}
|
|
1256
1258
|
),
|
|
1257
|
-
/* @__PURE__ */ e(
|
|
1258
|
-
/* @__PURE__ */ e(B, { type: "button", size: "xs", onClick:
|
|
1259
|
+
/* @__PURE__ */ e(it, { disabled: i, children: p }),
|
|
1260
|
+
/* @__PURE__ */ e(B, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ r(W, { children: [
|
|
1259
1261
|
/* @__PURE__ */ e(te, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1260
1262
|
"Saving..."
|
|
1261
|
-
] }) :
|
|
1263
|
+
] }) : u })
|
|
1262
1264
|
] })
|
|
1263
1265
|
] }) });
|
|
1264
1266
|
}
|
|
1265
|
-
const La = 1e4, Ba = 15e3, Ta = 3e4, Va = 3e4, Ra = 12e4,
|
|
1267
|
+
const La = 1e4, Ba = 15e3, Ta = 3e4, Va = 3e4, Ra = 12e4, yt = 2 * 60 * 60 * 1e3;
|
|
1266
1268
|
function Ua(t) {
|
|
1267
1269
|
const a = Date.now() - t.getTime();
|
|
1268
1270
|
return a < Va ? La : a < Ra ? Ba : Ta;
|
|
1269
1271
|
}
|
|
1270
1272
|
function Hn() {
|
|
1271
|
-
const { authToken: t, tokenProps: a } =
|
|
1273
|
+
const { authToken: t, tokenProps: a } = He(), o = ue((h) => h.activeExports), [n, i] = E(
|
|
1272
1274
|
typeof document < "u" ? !document.hidden : !0
|
|
1273
|
-
),
|
|
1275
|
+
), s = he(null), d = he(!1), p = he(void 0), l = a == null ? void 0 : a.apiServiceUrl, u = t == null ? void 0 : t.accessToken, c = K(() => {
|
|
1274
1276
|
const h = ue.getState().activeExports;
|
|
1275
1277
|
return Array.from(h.values()).filter(
|
|
1276
|
-
(
|
|
1278
|
+
(f) => ut(f.status)
|
|
1277
1279
|
);
|
|
1278
1280
|
}, []);
|
|
1279
|
-
|
|
1281
|
+
Q(() => {
|
|
1280
1282
|
if (typeof document > "u") return;
|
|
1281
1283
|
const h = () => {
|
|
1282
|
-
|
|
1284
|
+
i(!document.hidden);
|
|
1283
1285
|
};
|
|
1284
1286
|
return document.addEventListener("visibilitychange", h), () => {
|
|
1285
1287
|
document.removeEventListener("visibilitychange", h);
|
|
1286
1288
|
};
|
|
1287
1289
|
}, []);
|
|
1288
|
-
const
|
|
1289
|
-
if (!l || !
|
|
1290
|
-
|
|
1290
|
+
const m = K(async () => {
|
|
1291
|
+
if (!l || !u) {
|
|
1292
|
+
d.current = !1;
|
|
1291
1293
|
return;
|
|
1292
1294
|
}
|
|
1293
|
-
const h =
|
|
1295
|
+
const h = c();
|
|
1294
1296
|
if (h.length === 0) {
|
|
1295
|
-
|
|
1297
|
+
d.current = !1;
|
|
1296
1298
|
return;
|
|
1297
1299
|
}
|
|
1298
|
-
const
|
|
1299
|
-
(
|
|
1300
|
+
const f = Date.now(), x = h.filter(
|
|
1301
|
+
(b) => f - b.startedAt.getTime() > yt
|
|
1300
1302
|
);
|
|
1301
|
-
if (
|
|
1302
|
-
const { updateExport:
|
|
1303
|
-
for (const S of
|
|
1304
|
-
|
|
1303
|
+
if (x.length > 0) {
|
|
1304
|
+
const { updateExport: b } = ue.getState().actions;
|
|
1305
|
+
for (const S of x)
|
|
1306
|
+
b(S.id, {
|
|
1305
1307
|
status: "failed",
|
|
1306
1308
|
error: "Export timed out. Please try again or contact support.",
|
|
1307
1309
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
1308
1310
|
});
|
|
1309
1311
|
}
|
|
1310
|
-
const
|
|
1311
|
-
(
|
|
1312
|
+
const C = h.filter(
|
|
1313
|
+
(b) => f - b.startedAt.getTime() <= yt
|
|
1312
1314
|
);
|
|
1313
|
-
if (
|
|
1314
|
-
|
|
1315
|
+
if (C.length === 0) {
|
|
1316
|
+
d.current = !1;
|
|
1315
1317
|
return;
|
|
1316
1318
|
}
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1319
|
+
const N = await Promise.allSettled(
|
|
1320
|
+
C.map(async (b) => {
|
|
1319
1321
|
try {
|
|
1320
|
-
const S = await
|
|
1321
|
-
let
|
|
1322
|
+
const S = await At(l, u, b.id);
|
|
1323
|
+
let A;
|
|
1322
1324
|
if (S.status === "completed")
|
|
1323
1325
|
try {
|
|
1324
|
-
|
|
1326
|
+
A = await ht(l, u, b.id);
|
|
1325
1327
|
} catch (U) {
|
|
1326
1328
|
console.error(
|
|
1327
|
-
`[useExportPolling] Failed to get download URL for ${
|
|
1329
|
+
`[useExportPolling] Failed to get download URL for ${b.id}:`,
|
|
1328
1330
|
U
|
|
1329
1331
|
);
|
|
1330
1332
|
}
|
|
1331
1333
|
return {
|
|
1332
|
-
id:
|
|
1334
|
+
id: b.id,
|
|
1333
1335
|
status: S.status,
|
|
1334
1336
|
progress: S.progress,
|
|
1335
1337
|
completedChunks: S.completedChunks,
|
|
@@ -1337,101 +1339,101 @@ function Hn() {
|
|
|
1337
1339
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
1338
1340
|
fileSize: S.fileSize,
|
|
1339
1341
|
error: S.error,
|
|
1340
|
-
downloadUrl:
|
|
1342
|
+
downloadUrl: A
|
|
1341
1343
|
};
|
|
1342
1344
|
} catch (S) {
|
|
1343
1345
|
return console.error(
|
|
1344
|
-
`[useExportPolling] Failed to poll export ${
|
|
1346
|
+
`[useExportPolling] Failed to poll export ${b.id}:`,
|
|
1345
1347
|
S
|
|
1346
1348
|
), null;
|
|
1347
1349
|
}
|
|
1348
1350
|
})
|
|
1349
1351
|
), { updateExport: I } = ue.getState().actions;
|
|
1350
|
-
for (const
|
|
1351
|
-
|
|
1352
|
-
const
|
|
1353
|
-
if (
|
|
1354
|
-
const
|
|
1355
|
-
(
|
|
1356
|
-
|
|
1357
|
-
), S = Ua(
|
|
1358
|
-
|
|
1359
|
-
var
|
|
1360
|
-
(
|
|
1352
|
+
for (const b of N)
|
|
1353
|
+
b.status === "fulfilled" && b.value && I(b.value.id, b.value);
|
|
1354
|
+
const D = c();
|
|
1355
|
+
if (D.length > 0 && !document.hidden) {
|
|
1356
|
+
const b = D.reduce(
|
|
1357
|
+
(A, U) => U.startedAt < A ? U.startedAt : A,
|
|
1358
|
+
D[0].startedAt
|
|
1359
|
+
), S = Ua(b);
|
|
1360
|
+
s.current && clearTimeout(s.current), s.current = setTimeout(() => {
|
|
1361
|
+
var A;
|
|
1362
|
+
(A = p.current) == null || A.call(p);
|
|
1361
1363
|
}, S);
|
|
1362
1364
|
} else
|
|
1363
|
-
|
|
1364
|
-
}, [l,
|
|
1365
|
-
return
|
|
1366
|
-
|
|
1367
|
-
}, [
|
|
1368
|
-
var
|
|
1369
|
-
|
|
1370
|
-
}, [
|
|
1371
|
-
var
|
|
1372
|
-
const h =
|
|
1373
|
-
|
|
1374
|
-
}, [
|
|
1375
|
-
!
|
|
1376
|
-
}, [
|
|
1377
|
-
|
|
1365
|
+
d.current = !1;
|
|
1366
|
+
}, [l, u, c]);
|
|
1367
|
+
return Q(() => {
|
|
1368
|
+
p.current = m;
|
|
1369
|
+
}, [m]), Q(() => {
|
|
1370
|
+
var f;
|
|
1371
|
+
c().length > 0 && n && !d.current && (d.current = !0, (f = p.current) == null || f.call(p));
|
|
1372
|
+
}, [o, n, c]), Q(() => {
|
|
1373
|
+
var f;
|
|
1374
|
+
const h = c();
|
|
1375
|
+
n && h.length > 0 && !d.current && (d.current = !0, (f = p.current) == null || f.call(p));
|
|
1376
|
+
}, [n, c]), Q(() => {
|
|
1377
|
+
!n && s.current && (clearTimeout(s.current), s.current = null, d.current = !1);
|
|
1378
|
+
}, [n]), Q(() => () => {
|
|
1379
|
+
s.current && (clearTimeout(s.current), s.current = null);
|
|
1378
1380
|
}, []), {
|
|
1379
|
-
isPolling:
|
|
1380
|
-
isTabVisible:
|
|
1381
|
-
inProgressCount:
|
|
1381
|
+
isPolling: d.current,
|
|
1382
|
+
isTabVisible: n,
|
|
1383
|
+
inProgressCount: c().length
|
|
1382
1384
|
};
|
|
1383
1385
|
}
|
|
1384
1386
|
function Gn() {
|
|
1385
|
-
const { authToken: t, tokenProps: a } =
|
|
1386
|
-
|
|
1387
|
-
if (
|
|
1387
|
+
const { authToken: t, tokenProps: a } = He(), o = ue((p) => p.activeExports), { addExport: n } = Et(), i = he(!1), s = a == null ? void 0 : a.apiServiceUrl, d = t == null ? void 0 : t.accessToken;
|
|
1388
|
+
Q(() => {
|
|
1389
|
+
if (i.current || !s || !d) return;
|
|
1388
1390
|
(async () => {
|
|
1389
1391
|
try {
|
|
1390
|
-
const { exports: l } = await
|
|
1392
|
+
const { exports: l } = await ur(s, d, {
|
|
1391
1393
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
1392
1394
|
limit: 20
|
|
1393
1395
|
// Limit to recent exports
|
|
1394
1396
|
});
|
|
1395
|
-
for (const
|
|
1396
|
-
if (
|
|
1397
|
-
const
|
|
1398
|
-
let
|
|
1399
|
-
if (
|
|
1397
|
+
for (const u of l) {
|
|
1398
|
+
if (o.has(u.id)) continue;
|
|
1399
|
+
const c = u.totalChunks ? Math.round(u.completedChunks / u.totalChunks * 100) : 0;
|
|
1400
|
+
let m;
|
|
1401
|
+
if (u.status === "completed")
|
|
1400
1402
|
try {
|
|
1401
|
-
|
|
1402
|
-
} catch (
|
|
1403
|
+
m = await ht(s, d, u.id);
|
|
1404
|
+
} catch (f) {
|
|
1403
1405
|
console.error(
|
|
1404
|
-
`[useExportRecovery] Failed to get download URL for ${
|
|
1405
|
-
|
|
1406
|
+
`[useExportRecovery] Failed to get download URL for ${u.id}:`,
|
|
1407
|
+
f
|
|
1406
1408
|
);
|
|
1407
1409
|
}
|
|
1408
1410
|
const h = {
|
|
1409
|
-
id:
|
|
1410
|
-
status:
|
|
1411
|
-
progress:
|
|
1412
|
-
title: Pa(
|
|
1413
|
-
totalRows:
|
|
1414
|
-
totalChunks:
|
|
1415
|
-
completedChunks:
|
|
1416
|
-
startedAt: new Date(
|
|
1411
|
+
id: u.id,
|
|
1412
|
+
status: u.status,
|
|
1413
|
+
progress: c,
|
|
1414
|
+
title: Pa(u),
|
|
1415
|
+
totalRows: u.totalRows,
|
|
1416
|
+
totalChunks: u.totalChunks,
|
|
1417
|
+
completedChunks: u.completedChunks,
|
|
1418
|
+
startedAt: new Date(u.createdAt),
|
|
1417
1419
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
1418
|
-
completedAt:
|
|
1419
|
-
fileSize:
|
|
1420
|
-
error:
|
|
1421
|
-
expiresAt: new Date(
|
|
1422
|
-
downloadUrl:
|
|
1420
|
+
completedAt: u.completedAt ? new Date(u.completedAt) : void 0,
|
|
1421
|
+
fileSize: u.fileSize,
|
|
1422
|
+
error: u.error,
|
|
1423
|
+
expiresAt: new Date(u.expiresAt),
|
|
1424
|
+
downloadUrl: m
|
|
1423
1425
|
};
|
|
1424
|
-
|
|
1426
|
+
n(h);
|
|
1425
1427
|
}
|
|
1426
|
-
|
|
1428
|
+
i.current = !0;
|
|
1427
1429
|
} catch (l) {
|
|
1428
|
-
console.error("[useExportRecovery] Failed to recover exports:", l),
|
|
1430
|
+
console.error("[useExportRecovery] Failed to recover exports:", l), i.current = !0;
|
|
1429
1431
|
}
|
|
1430
1432
|
})();
|
|
1431
|
-
}, [
|
|
1433
|
+
}, [s, d, n, o]);
|
|
1432
1434
|
}
|
|
1433
1435
|
function Pa(t) {
|
|
1434
|
-
return t.title ? t.title :
|
|
1436
|
+
return t.title ? t.title : ut(
|
|
1435
1437
|
t.status
|
|
1436
1438
|
) ? "Export in progress..." : t.status === "completed" ? "Export completed" : t.status === "failed" ? "Export failed" : "Export";
|
|
1437
1439
|
}
|
|
@@ -1439,20 +1441,20 @@ function Ma({
|
|
|
1439
1441
|
export: t,
|
|
1440
1442
|
onRemove: a
|
|
1441
1443
|
}) {
|
|
1442
|
-
const
|
|
1444
|
+
const o = () => {
|
|
1443
1445
|
t.downloadUrl && window.open(t.downloadUrl, "_blank");
|
|
1444
|
-
},
|
|
1445
|
-
|
|
1446
|
-
},
|
|
1446
|
+
}, n = (p) => {
|
|
1447
|
+
p.stopPropagation(), a == null || a(t.id);
|
|
1448
|
+
}, i = () => {
|
|
1447
1449
|
switch (t.status) {
|
|
1448
1450
|
case "completed":
|
|
1449
|
-
return /* @__PURE__ */ e(
|
|
1451
|
+
return /* @__PURE__ */ e(fr, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
1450
1452
|
case "failed":
|
|
1451
1453
|
return /* @__PURE__ */ e(va, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
1452
1454
|
default:
|
|
1453
1455
|
return /* @__PURE__ */ e(te, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
1454
1456
|
}
|
|
1455
|
-
},
|
|
1457
|
+
}, s = ut(t.status), d = (() => {
|
|
1456
1458
|
switch (t.status) {
|
|
1457
1459
|
case "pending":
|
|
1458
1460
|
return "Queued...";
|
|
@@ -1469,7 +1471,7 @@ function Ma({
|
|
|
1469
1471
|
return /* @__PURE__ */ r("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
|
|
1470
1472
|
/* @__PURE__ */ r("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
1471
1473
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
1472
|
-
|
|
1474
|
+
i(),
|
|
1473
1475
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
1474
1476
|
/* @__PURE__ */ e("h4", { className: "mb-1 truncate text-sm font-medium", children: t.title }),
|
|
1475
1477
|
t.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
@@ -1479,10 +1481,10 @@ function Ma({
|
|
|
1479
1481
|
] }),
|
|
1480
1482
|
t.fileSize && /* @__PURE__ */ r(W, { children: [
|
|
1481
1483
|
/* @__PURE__ */ e("span", { children: "•" }),
|
|
1482
|
-
/* @__PURE__ */ e("span", { children:
|
|
1484
|
+
/* @__PURE__ */ e("span", { children: hr(t.fileSize) })
|
|
1483
1485
|
] })
|
|
1484
1486
|
] }),
|
|
1485
|
-
|
|
1487
|
+
s && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: d }),
|
|
1486
1488
|
t.status === "failed" && /* @__PURE__ */ e("div", { className: "line-clamp-2 text-xs text-destructive", children: t.error || "Export failed" })
|
|
1487
1489
|
] })
|
|
1488
1490
|
] }),
|
|
@@ -1492,136 +1494,136 @@ function Ma({
|
|
|
1492
1494
|
variant: "ghost",
|
|
1493
1495
|
size: "icon",
|
|
1494
1496
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
1495
|
-
onClick:
|
|
1497
|
+
onClick: n,
|
|
1496
1498
|
"aria-label": "Remove notification",
|
|
1497
|
-
children: /* @__PURE__ */ e(
|
|
1499
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-4 w-4" })
|
|
1498
1500
|
}
|
|
1499
1501
|
)
|
|
1500
1502
|
] }),
|
|
1501
1503
|
/* @__PURE__ */ r("div", { className: "ml-8", children: [
|
|
1502
1504
|
t.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
1503
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children:
|
|
1505
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: xt(t.startedAt, { addSuffix: !0 }) }),
|
|
1504
1506
|
t.downloadUrl && /* @__PURE__ */ r(
|
|
1505
1507
|
B,
|
|
1506
1508
|
{
|
|
1507
1509
|
size: "sm",
|
|
1508
1510
|
variant: "outline",
|
|
1509
1511
|
className: "h-8 bg-transparent",
|
|
1510
|
-
onClick:
|
|
1512
|
+
onClick: o,
|
|
1511
1513
|
children: [
|
|
1512
|
-
/* @__PURE__ */ e(
|
|
1514
|
+
/* @__PURE__ */ e(mr, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
1513
1515
|
"Download"
|
|
1514
1516
|
]
|
|
1515
1517
|
}
|
|
1516
1518
|
)
|
|
1517
1519
|
] }),
|
|
1518
|
-
|
|
1519
|
-
/* @__PURE__ */ e(
|
|
1520
|
+
s && /* @__PURE__ */ r("div", { children: [
|
|
1521
|
+
/* @__PURE__ */ e(pr, { value: t.progress, className: "h-1.5" }),
|
|
1520
1522
|
/* @__PURE__ */ r("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
1521
1523
|
t.progress,
|
|
1522
1524
|
"% complete"
|
|
1523
1525
|
] })
|
|
1524
1526
|
] }),
|
|
1525
|
-
t.status === "failed" && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children:
|
|
1527
|
+
t.status === "failed" && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: xt(t.startedAt, { addSuffix: !0 }) })
|
|
1526
1528
|
] })
|
|
1527
1529
|
] });
|
|
1528
1530
|
}
|
|
1529
1531
|
function Oa() {
|
|
1530
|
-
const { authToken: t, tokenProps: a } =
|
|
1531
|
-
(
|
|
1532
|
-
),
|
|
1533
|
-
(
|
|
1534
|
-
), h =
|
|
1535
|
-
const
|
|
1536
|
-
if (!(!
|
|
1537
|
-
|
|
1532
|
+
const { authToken: t, tokenProps: a } = He(), o = ue((C) => C.activeExports), { clearCompleted: n, removeExport: i, updateExport: s } = Et(), [d, p] = E(!1), [l, u] = E(!1), c = Array.from(o.values()).sort(
|
|
1533
|
+
(C, N) => N.startedAt.getTime() - C.startedAt.getTime()
|
|
1534
|
+
), m = c.some(
|
|
1535
|
+
(C) => C.status === "completed" || C.status === "failed"
|
|
1536
|
+
), h = K(async () => {
|
|
1537
|
+
const C = a == null ? void 0 : a.apiServiceUrl, N = t == null ? void 0 : t.accessToken;
|
|
1538
|
+
if (!(!C || !N)) {
|
|
1539
|
+
p(!0);
|
|
1538
1540
|
try {
|
|
1539
|
-
const I = Array.from(
|
|
1541
|
+
const I = Array.from(o.values());
|
|
1540
1542
|
await Promise.all(
|
|
1541
|
-
I.map(async (
|
|
1543
|
+
I.map(async (D) => {
|
|
1542
1544
|
try {
|
|
1543
|
-
const
|
|
1545
|
+
const b = await At(C, N, D.id);
|
|
1544
1546
|
let S;
|
|
1545
|
-
if (
|
|
1547
|
+
if (b.status === "completed")
|
|
1546
1548
|
try {
|
|
1547
|
-
S = await
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1549
|
+
S = await ht(
|
|
1550
|
+
C,
|
|
1551
|
+
N,
|
|
1552
|
+
D.id
|
|
1551
1553
|
);
|
|
1552
|
-
} catch (
|
|
1553
|
-
console.error(`Failed to get download URL for ${
|
|
1554
|
+
} catch (A) {
|
|
1555
|
+
console.error(`Failed to get download URL for ${D.id}:`, A);
|
|
1554
1556
|
}
|
|
1555
|
-
|
|
1556
|
-
status:
|
|
1557
|
-
progress:
|
|
1558
|
-
completedChunks:
|
|
1559
|
-
completedAt:
|
|
1557
|
+
s(D.id, {
|
|
1558
|
+
status: b.status,
|
|
1559
|
+
progress: b.progress,
|
|
1560
|
+
completedChunks: b.completedChunks,
|
|
1561
|
+
completedAt: b.completedAt ? new Date(b.completedAt) : void 0,
|
|
1560
1562
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
1561
|
-
fileSize:
|
|
1562
|
-
error:
|
|
1563
|
+
fileSize: b.fileSize,
|
|
1564
|
+
error: b.error,
|
|
1563
1565
|
downloadUrl: S
|
|
1564
1566
|
});
|
|
1565
|
-
} catch (
|
|
1566
|
-
console.error(`Failed to refresh export ${
|
|
1567
|
+
} catch (b) {
|
|
1568
|
+
console.error(`Failed to refresh export ${D.id}:`, b);
|
|
1567
1569
|
}
|
|
1568
1570
|
})
|
|
1569
1571
|
);
|
|
1570
1572
|
} finally {
|
|
1571
|
-
|
|
1573
|
+
p(!1);
|
|
1572
1574
|
}
|
|
1573
1575
|
}
|
|
1574
1576
|
}, [
|
|
1575
|
-
|
|
1577
|
+
o,
|
|
1576
1578
|
t == null ? void 0 : t.accessToken,
|
|
1577
1579
|
a == null ? void 0 : a.apiServiceUrl,
|
|
1578
|
-
|
|
1579
|
-
]),
|
|
1580
|
-
const
|
|
1581
|
-
if (!
|
|
1582
|
-
|
|
1580
|
+
s
|
|
1581
|
+
]), f = K(async () => {
|
|
1582
|
+
const C = a == null ? void 0 : a.apiServiceUrl, N = t == null ? void 0 : t.accessToken;
|
|
1583
|
+
if (!C || !N) {
|
|
1584
|
+
n();
|
|
1583
1585
|
return;
|
|
1584
1586
|
}
|
|
1585
|
-
|
|
1587
|
+
u(!0);
|
|
1586
1588
|
try {
|
|
1587
|
-
const I =
|
|
1588
|
-
(
|
|
1589
|
-
),
|
|
1590
|
-
I.map(async (
|
|
1589
|
+
const I = c.filter(
|
|
1590
|
+
(b) => b.status === "completed" || b.status === "failed"
|
|
1591
|
+
), D = await Promise.allSettled(
|
|
1592
|
+
I.map(async (b) => (await gt(C, N, b.id), b.id))
|
|
1591
1593
|
);
|
|
1592
|
-
for (const
|
|
1593
|
-
|
|
1594
|
+
for (const b of D)
|
|
1595
|
+
b.status === "fulfilled" ? i(b.value) : console.error("Failed to delete export:", b.reason);
|
|
1594
1596
|
} finally {
|
|
1595
|
-
|
|
1597
|
+
u(!1);
|
|
1596
1598
|
}
|
|
1597
1599
|
}, [
|
|
1598
|
-
|
|
1600
|
+
c,
|
|
1599
1601
|
a == null ? void 0 : a.apiServiceUrl,
|
|
1600
1602
|
t == null ? void 0 : t.accessToken,
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
]),
|
|
1604
|
-
async (
|
|
1605
|
-
const
|
|
1606
|
-
if (
|
|
1603
|
+
n,
|
|
1604
|
+
i
|
|
1605
|
+
]), x = K(
|
|
1606
|
+
async (C) => {
|
|
1607
|
+
const N = a == null ? void 0 : a.apiServiceUrl, I = t == null ? void 0 : t.accessToken;
|
|
1608
|
+
if (N && I)
|
|
1607
1609
|
try {
|
|
1608
|
-
await
|
|
1610
|
+
await gt(N, I, C), i(C);
|
|
1609
1611
|
return;
|
|
1610
|
-
} catch (
|
|
1611
|
-
console.error(`Failed to cancel export ${
|
|
1612
|
+
} catch (D) {
|
|
1613
|
+
console.error(`Failed to cancel export ${C}:`, D);
|
|
1612
1614
|
}
|
|
1613
|
-
|
|
1615
|
+
i(C);
|
|
1614
1616
|
},
|
|
1615
|
-
[a == null ? void 0 : a.apiServiceUrl, t == null ? void 0 : t.accessToken,
|
|
1617
|
+
[a == null ? void 0 : a.apiServiceUrl, t == null ? void 0 : t.accessToken, i]
|
|
1616
1618
|
);
|
|
1617
|
-
return
|
|
1618
|
-
/* @__PURE__ */ e(
|
|
1619
|
+
return c.length === 0 ? /* @__PURE__ */ r("div", { className: "p-6 text-center", children: [
|
|
1620
|
+
/* @__PURE__ */ e(vt, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
|
|
1619
1621
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
|
|
1620
1622
|
/* @__PURE__ */ e("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
|
|
1621
1623
|
] }) : /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
1622
1624
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [
|
|
1623
1625
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1624
|
-
/* @__PURE__ */ e(
|
|
1626
|
+
/* @__PURE__ */ e(vt, { className: "h-5 w-5 text-muted-foreground" }),
|
|
1625
1627
|
/* @__PURE__ */ e("h4", { className: "font-semibold", children: "Exports" })
|
|
1626
1628
|
] }),
|
|
1627
1629
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
@@ -1632,47 +1634,47 @@ function Oa() {
|
|
|
1632
1634
|
size: "sm",
|
|
1633
1635
|
className: "h-7 w-7 p-0",
|
|
1634
1636
|
onClick: h,
|
|
1635
|
-
disabled:
|
|
1637
|
+
disabled: d,
|
|
1636
1638
|
title: "Refresh status",
|
|
1637
1639
|
children: /* @__PURE__ */ e(
|
|
1638
|
-
|
|
1640
|
+
gr,
|
|
1639
1641
|
{
|
|
1640
|
-
className: `h-4 w-4 ${
|
|
1642
|
+
className: `h-4 w-4 ${d ? "animate-spin" : ""}`
|
|
1641
1643
|
}
|
|
1642
1644
|
)
|
|
1643
1645
|
}
|
|
1644
1646
|
),
|
|
1645
|
-
|
|
1647
|
+
m && /* @__PURE__ */ e(
|
|
1646
1648
|
B,
|
|
1647
1649
|
{
|
|
1648
1650
|
variant: "ghost",
|
|
1649
1651
|
size: "sm",
|
|
1650
1652
|
className: "h-7 px-2 text-sm",
|
|
1651
|
-
onClick:
|
|
1653
|
+
onClick: f,
|
|
1652
1654
|
disabled: l,
|
|
1653
1655
|
children: l ? "Clearing..." : "Clear all"
|
|
1654
1656
|
}
|
|
1655
1657
|
)
|
|
1656
1658
|
] })
|
|
1657
1659
|
] }),
|
|
1658
|
-
/* @__PURE__ */ e("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y", children:
|
|
1660
|
+
/* @__PURE__ */ e("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y", children: c.map((C) => /* @__PURE__ */ e(
|
|
1659
1661
|
Ma,
|
|
1660
1662
|
{
|
|
1661
|
-
export:
|
|
1662
|
-
onRemove:
|
|
1663
|
+
export: C,
|
|
1664
|
+
onRemove: x
|
|
1663
1665
|
},
|
|
1664
|
-
|
|
1666
|
+
C.id
|
|
1665
1667
|
)) }) })
|
|
1666
1668
|
] });
|
|
1667
1669
|
}
|
|
1668
1670
|
function Kn({
|
|
1669
1671
|
variant: t
|
|
1670
1672
|
}) {
|
|
1671
|
-
const a = ue((l) => l.activeExports),
|
|
1673
|
+
const a = ue((l) => l.activeExports), o = br(), n = a.size > 0, i = Array.from(a.values()).some(
|
|
1672
1674
|
(l) => l.status === "completed" || l.status === "failed"
|
|
1673
|
-
),
|
|
1674
|
-
return /* @__PURE__ */ r(
|
|
1675
|
-
/* @__PURE__ */ e(
|
|
1675
|
+
), d = o > 0 ? o > 9 ? "9+" : String(o) : null;
|
|
1676
|
+
return /* @__PURE__ */ r(Oe, { children: [
|
|
1677
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ r(
|
|
1676
1678
|
B,
|
|
1677
1679
|
{
|
|
1678
1680
|
variant: t ?? "ghost",
|
|
@@ -1680,21 +1682,21 @@ function Kn({
|
|
|
1680
1682
|
className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
1681
1683
|
"aria-label": "Export notifications",
|
|
1682
1684
|
children: [
|
|
1683
|
-
/* @__PURE__ */ e(
|
|
1684
|
-
|
|
1685
|
+
/* @__PURE__ */ e(xr, { className: "h-3.5 w-3.5" }),
|
|
1686
|
+
n && /* @__PURE__ */ e(
|
|
1685
1687
|
"span",
|
|
1686
1688
|
{
|
|
1687
|
-
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${
|
|
1688
|
-
children:
|
|
1689
|
+
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${d ? "-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"}`,
|
|
1690
|
+
children: d
|
|
1689
1691
|
}
|
|
1690
1692
|
)
|
|
1691
1693
|
]
|
|
1692
1694
|
}
|
|
1693
1695
|
) }),
|
|
1694
|
-
/* @__PURE__ */ e(
|
|
1696
|
+
/* @__PURE__ */ e(ze, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ e(Oa, {}) })
|
|
1695
1697
|
] });
|
|
1696
1698
|
}
|
|
1697
|
-
function
|
|
1699
|
+
function _a(t) {
|
|
1698
1700
|
if (t)
|
|
1699
1701
|
return {
|
|
1700
1702
|
renamed: t.type === "rename" ? { oldId: t.oldId, newId: t.newId } : void 0,
|
|
@@ -1703,56 +1705,56 @@ function za(t) {
|
|
|
1703
1705
|
affectedBindingControlIds: t.type === "add" || t.type === "update" ? t.affectedBindingControlIds : void 0
|
|
1704
1706
|
};
|
|
1705
1707
|
}
|
|
1706
|
-
function
|
|
1708
|
+
function za({
|
|
1707
1709
|
open: t,
|
|
1708
1710
|
onOpenChange: a,
|
|
1709
|
-
trigger:
|
|
1710
|
-
showTrigger:
|
|
1711
|
-
initialMode:
|
|
1711
|
+
trigger: o,
|
|
1712
|
+
showTrigger: n = !0,
|
|
1713
|
+
initialMode: i = "manage"
|
|
1712
1714
|
}) {
|
|
1713
|
-
const
|
|
1714
|
-
forceClose:
|
|
1715
|
-
handleOpenChange:
|
|
1715
|
+
const s = i === "create", {
|
|
1716
|
+
forceClose: d,
|
|
1717
|
+
handleOpenChange: p,
|
|
1716
1718
|
isCreateFlowActive: l,
|
|
1717
|
-
preventPassiveDismissDuringCreate:
|
|
1718
|
-
resolvedOpen:
|
|
1719
|
-
setIsCreateFlowActive:
|
|
1720
|
-
} =
|
|
1719
|
+
preventPassiveDismissDuringCreate: u,
|
|
1720
|
+
resolvedOpen: c,
|
|
1721
|
+
setIsCreateFlowActive: m
|
|
1722
|
+
} = Pt({
|
|
1721
1723
|
open: t,
|
|
1722
1724
|
onOpenChange: a,
|
|
1723
|
-
initialCreateFlowActive:
|
|
1725
|
+
initialCreateFlowActive: i === "create",
|
|
1724
1726
|
// Dialog mode renders a built-in X close button — allow explicit
|
|
1725
1727
|
// closes through `handleOpenChange`. Popover mode has no X; its
|
|
1726
1728
|
// only close-via-trigger path is a re-click that would silently
|
|
1727
1729
|
// wipe the in-progress create flow, so block everything during
|
|
1728
1730
|
// create and make consumers use `forceClose()` from a dedicated
|
|
1729
1731
|
// button.
|
|
1730
|
-
dismissMode:
|
|
1731
|
-
}), h = P((
|
|
1732
|
+
dismissMode: n ? "passive" : "explicit-only"
|
|
1733
|
+
}), h = P((v) => v.dashboard), { setDashboardControlsModel: f } = be(), { participants: x } = vr(Jr(h)), C = Array.from(
|
|
1732
1734
|
new Map(
|
|
1733
|
-
|
|
1734
|
-
(
|
|
1735
|
+
x.flatMap(
|
|
1736
|
+
(v) => v.fieldChoices.map((T) => {
|
|
1735
1737
|
var F;
|
|
1736
1738
|
return [
|
|
1737
1739
|
T.value,
|
|
1738
1740
|
{
|
|
1739
1741
|
option: T,
|
|
1740
|
-
target: (F =
|
|
1742
|
+
target: (F = v.fieldTargetMap) == null ? void 0 : F[T.value]
|
|
1741
1743
|
}
|
|
1742
1744
|
];
|
|
1743
1745
|
})
|
|
1744
1746
|
)
|
|
1745
1747
|
).values()
|
|
1746
|
-
),
|
|
1748
|
+
), N = Array.from(
|
|
1747
1749
|
new Map(
|
|
1748
|
-
|
|
1749
|
-
(
|
|
1750
|
+
x.flatMap(
|
|
1751
|
+
(v) => v.metricChoices.map((T) => {
|
|
1750
1752
|
var F;
|
|
1751
1753
|
return [
|
|
1752
1754
|
T.value,
|
|
1753
1755
|
{
|
|
1754
1756
|
option: T,
|
|
1755
|
-
target: (F =
|
|
1757
|
+
target: (F = v.metricTargetMap) == null ? void 0 : F[T.value]
|
|
1756
1758
|
}
|
|
1757
1759
|
];
|
|
1758
1760
|
})
|
|
@@ -1761,73 +1763,73 @@ function _a({
|
|
|
1761
1763
|
), I = ea({
|
|
1762
1764
|
...h || {},
|
|
1763
1765
|
controls: []
|
|
1764
|
-
}),
|
|
1765
|
-
|
|
1766
|
-
|
|
1766
|
+
}), D = yr(h), b = (v, T, F) => {
|
|
1767
|
+
f(
|
|
1768
|
+
v,
|
|
1767
1769
|
T,
|
|
1768
|
-
|
|
1770
|
+
_a(F)
|
|
1769
1771
|
);
|
|
1770
|
-
}, S =
|
|
1771
|
-
if (
|
|
1772
|
-
|
|
1772
|
+
}, S = K(() => {
|
|
1773
|
+
if (s) {
|
|
1774
|
+
d();
|
|
1773
1775
|
return;
|
|
1774
1776
|
}
|
|
1775
|
-
|
|
1776
|
-
}, [
|
|
1777
|
-
|
|
1777
|
+
m(!1);
|
|
1778
|
+
}, [s, d, m]), A = /* @__PURE__ */ e(
|
|
1779
|
+
Mt,
|
|
1778
1780
|
{
|
|
1779
1781
|
scope: "dashboard",
|
|
1780
1782
|
controls: h.controls || [],
|
|
1781
1783
|
reservedControlIds: I,
|
|
1782
1784
|
defaultValues: h.defaultControlValues || {},
|
|
1783
|
-
usageByControlId:
|
|
1784
|
-
availableFieldChoices:
|
|
1785
|
-
availableMetricChoices:
|
|
1786
|
-
structuralParticipants:
|
|
1787
|
-
structuralParticipantIdsByControlId:
|
|
1788
|
-
initialCreateFlow:
|
|
1789
|
-
onCreateFlowActiveChange:
|
|
1785
|
+
usageByControlId: Cr(h),
|
|
1786
|
+
availableFieldChoices: C,
|
|
1787
|
+
availableMetricChoices: N,
|
|
1788
|
+
structuralParticipants: x,
|
|
1789
|
+
structuralParticipantIdsByControlId: D,
|
|
1790
|
+
initialCreateFlow: i === "create",
|
|
1791
|
+
onCreateFlowActiveChange: m,
|
|
1790
1792
|
onCreateFlowComplete: S,
|
|
1791
|
-
onChange:
|
|
1793
|
+
onChange: b,
|
|
1792
1794
|
emptyMessage: "No dashboard controls yet."
|
|
1793
1795
|
}
|
|
1794
|
-
), U = l ? "Add dashboard control" : "Dashboard Controls",
|
|
1796
|
+
), U = l ? "Add dashboard control" : "Dashboard Controls", g = /* @__PURE__ */ r(W, { children: [
|
|
1795
1797
|
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
1796
1798
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
1797
1799
|
/* @__PURE__ */ e("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." })
|
|
1798
1800
|
] }),
|
|
1799
|
-
|
|
1801
|
+
A
|
|
1800
1802
|
] });
|
|
1801
|
-
return
|
|
1802
|
-
/* @__PURE__ */ e(
|
|
1803
|
-
/* @__PURE__ */ e(
|
|
1803
|
+
return n ? /* @__PURE__ */ r(Oe, { open: c, onOpenChange: p, children: [
|
|
1804
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: o || /* @__PURE__ */ r(B, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
1805
|
+
/* @__PURE__ */ e(Rt, { className: "mr-2 h-4 w-4" }),
|
|
1804
1806
|
"Controls"
|
|
1805
1807
|
] }) }),
|
|
1806
1808
|
/* @__PURE__ */ e(
|
|
1807
|
-
|
|
1809
|
+
ze,
|
|
1808
1810
|
{
|
|
1809
1811
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
1810
1812
|
align: "end",
|
|
1811
|
-
onEscapeKeyDown:
|
|
1812
|
-
onPointerDownOutside:
|
|
1813
|
-
children:
|
|
1813
|
+
onEscapeKeyDown: u,
|
|
1814
|
+
onPointerDownOutside: u,
|
|
1815
|
+
children: g
|
|
1814
1816
|
}
|
|
1815
1817
|
)
|
|
1816
|
-
] }) : /* @__PURE__ */ e(
|
|
1817
|
-
|
|
1818
|
+
] }) : /* @__PURE__ */ e(De, { open: c, onOpenChange: p, children: /* @__PURE__ */ r(
|
|
1819
|
+
ke,
|
|
1818
1820
|
{
|
|
1819
1821
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1820
|
-
onEscapeKeyDown:
|
|
1821
|
-
onPointerDownOutside:
|
|
1822
|
+
onEscapeKeyDown: u,
|
|
1823
|
+
onPointerDownOutside: u,
|
|
1822
1824
|
children: [
|
|
1823
1825
|
/* @__PURE__ */ r(
|
|
1824
|
-
|
|
1826
|
+
ct,
|
|
1825
1827
|
{
|
|
1826
1828
|
className: l ? "space-y-0" : void 0,
|
|
1827
1829
|
children: [
|
|
1828
|
-
/* @__PURE__ */ e(
|
|
1830
|
+
/* @__PURE__ */ e(Ae, { className: "text-[15px]", children: U }),
|
|
1829
1831
|
/* @__PURE__ */ e(
|
|
1830
|
-
|
|
1832
|
+
dt,
|
|
1831
1833
|
{
|
|
1832
1834
|
className: l ? "sr-only" : "text-[13px]",
|
|
1833
1835
|
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."
|
|
@@ -1836,7 +1838,7 @@ function _a({
|
|
|
1836
1838
|
]
|
|
1837
1839
|
}
|
|
1838
1840
|
),
|
|
1839
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children:
|
|
1841
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: A })
|
|
1840
1842
|
]
|
|
1841
1843
|
}
|
|
1842
1844
|
) });
|
|
@@ -1852,101 +1854,101 @@ const $a = [
|
|
|
1852
1854
|
function ja({
|
|
1853
1855
|
open: t,
|
|
1854
1856
|
onOpenChange: a,
|
|
1855
|
-
initialMode:
|
|
1857
|
+
initialMode: o = "manage"
|
|
1856
1858
|
}) {
|
|
1857
|
-
var
|
|
1858
|
-
const
|
|
1859
|
-
forceClose:
|
|
1860
|
-
handleOpenChange:
|
|
1861
|
-
isCreateFlowActive:
|
|
1862
|
-
preventPassiveDismissDuringCreate:
|
|
1859
|
+
var g;
|
|
1860
|
+
const n = o === "create", {
|
|
1861
|
+
forceClose: i,
|
|
1862
|
+
handleOpenChange: s,
|
|
1863
|
+
isCreateFlowActive: d,
|
|
1864
|
+
preventPassiveDismissDuringCreate: p,
|
|
1863
1865
|
resolvedOpen: l,
|
|
1864
|
-
setIsCreateFlowActive:
|
|
1865
|
-
} =
|
|
1866
|
+
setIsCreateFlowActive: u
|
|
1867
|
+
} = Pt({
|
|
1866
1868
|
open: t,
|
|
1867
1869
|
onOpenChange: a,
|
|
1868
|
-
initialCreateFlowActive:
|
|
1870
|
+
initialCreateFlowActive: o === "create",
|
|
1869
1871
|
dismissMode: "explicit-only"
|
|
1870
|
-
}),
|
|
1871
|
-
(
|
|
1872
|
-
),
|
|
1873
|
-
() =>
|
|
1874
|
-
[
|
|
1875
|
-
),
|
|
1876
|
-
() =>
|
|
1877
|
-
(
|
|
1872
|
+
}), c = P((v) => v.dashboard), m = P((v) => v.selectedSheetId), { setDashboardInputs: h } = be(), f = (g = c.sheets) == null ? void 0 : g.find(
|
|
1873
|
+
(v) => v.id === m
|
|
1874
|
+
), x = (f == null ? void 0 : f.kind) === "document" && !!f.document, C = ee(
|
|
1875
|
+
() => x && (f != null && f.document) ? wr(c, f.id) : [],
|
|
1876
|
+
[c, x, f == null ? void 0 : f.document, f == null ? void 0 : f.id]
|
|
1877
|
+
), N = ee(
|
|
1878
|
+
() => C.filter(
|
|
1879
|
+
(v) => v.kind === "control"
|
|
1878
1880
|
),
|
|
1879
|
-
[
|
|
1881
|
+
[C]
|
|
1880
1882
|
), I = ee(
|
|
1881
|
-
() =>
|
|
1882
|
-
[
|
|
1883
|
-
),
|
|
1883
|
+
() => N.map((v) => v.control),
|
|
1884
|
+
[N]
|
|
1885
|
+
), D = ee(
|
|
1884
1886
|
() => Ha(I),
|
|
1885
1887
|
[I]
|
|
1886
|
-
),
|
|
1887
|
-
() => Wa(
|
|
1888
|
-
[
|
|
1889
|
-
), S =
|
|
1890
|
-
if (
|
|
1891
|
-
|
|
1888
|
+
), b = ee(
|
|
1889
|
+
() => Wa(c),
|
|
1890
|
+
[c]
|
|
1891
|
+
), S = K(() => {
|
|
1892
|
+
if (n) {
|
|
1893
|
+
i();
|
|
1892
1894
|
return;
|
|
1893
1895
|
}
|
|
1894
|
-
|
|
1895
|
-
}, [
|
|
1896
|
-
(
|
|
1897
|
-
!
|
|
1896
|
+
u(!1);
|
|
1897
|
+
}, [n, i, u]), A = K(
|
|
1898
|
+
(v, T, F) => {
|
|
1899
|
+
!x || !(f != null && f.document) || h(
|
|
1898
1900
|
Ka({
|
|
1899
|
-
allInputs:
|
|
1900
|
-
documentSheetId:
|
|
1901
|
-
currentDocumentInputs:
|
|
1902
|
-
nextControls:
|
|
1901
|
+
allInputs: c.inputs || [],
|
|
1902
|
+
documentSheetId: f.id,
|
|
1903
|
+
currentDocumentInputs: C,
|
|
1904
|
+
nextControls: v,
|
|
1903
1905
|
nextDefaultValues: T,
|
|
1904
1906
|
change: F
|
|
1905
1907
|
})
|
|
1906
1908
|
);
|
|
1907
1909
|
},
|
|
1908
1910
|
[
|
|
1909
|
-
|
|
1910
|
-
y,
|
|
1911
|
+
c.inputs,
|
|
1911
1912
|
C,
|
|
1912
|
-
|
|
1913
|
+
x,
|
|
1914
|
+
f,
|
|
1913
1915
|
h
|
|
1914
1916
|
]
|
|
1915
1917
|
);
|
|
1916
|
-
return !
|
|
1917
|
-
|
|
1918
|
+
return !x || !(f != null && f.document) ? null : /* @__PURE__ */ e(De, { open: l, onOpenChange: s, children: /* @__PURE__ */ r(
|
|
1919
|
+
ke,
|
|
1918
1920
|
{
|
|
1919
1921
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1920
|
-
onEscapeKeyDown:
|
|
1921
|
-
onPointerDownOutside:
|
|
1922
|
+
onEscapeKeyDown: p,
|
|
1923
|
+
onPointerDownOutside: p,
|
|
1922
1924
|
children: [
|
|
1923
|
-
/* @__PURE__ */ r(
|
|
1924
|
-
/* @__PURE__ */ e(
|
|
1925
|
+
/* @__PURE__ */ r(ct, { className: d ? "space-y-0" : void 0, children: [
|
|
1926
|
+
/* @__PURE__ */ e(Ae, { className: "text-[15px]", children: d ? "Add document control" : "Document Controls" }),
|
|
1925
1927
|
/* @__PURE__ */ e(
|
|
1926
|
-
|
|
1928
|
+
dt,
|
|
1927
1929
|
{
|
|
1928
|
-
className:
|
|
1929
|
-
children:
|
|
1930
|
+
className: d ? "sr-only" : "text-[13px]",
|
|
1931
|
+
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."
|
|
1930
1932
|
}
|
|
1931
1933
|
)
|
|
1932
1934
|
] }),
|
|
1933
1935
|
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ e(
|
|
1934
|
-
|
|
1936
|
+
Mt,
|
|
1935
1937
|
{
|
|
1936
1938
|
scope: "dashboard",
|
|
1937
1939
|
controls: I,
|
|
1938
|
-
reservedControlIds:
|
|
1939
|
-
defaultValues:
|
|
1940
|
+
reservedControlIds: b,
|
|
1941
|
+
defaultValues: D,
|
|
1940
1942
|
usageByControlId: {},
|
|
1941
1943
|
availableFieldChoices: [],
|
|
1942
1944
|
availableMetricChoices: [],
|
|
1943
1945
|
structuralParticipants: [],
|
|
1944
1946
|
structuralParticipantIdsByControlId: {},
|
|
1945
1947
|
allowedControlTypes: $a,
|
|
1946
|
-
initialCreateFlow:
|
|
1947
|
-
onCreateFlowActiveChange:
|
|
1948
|
+
initialCreateFlow: o === "create",
|
|
1949
|
+
onCreateFlowActiveChange: u,
|
|
1948
1950
|
onCreateFlowComplete: S,
|
|
1949
|
-
onChange:
|
|
1951
|
+
onChange: A,
|
|
1950
1952
|
emptyMessage: "No document controls yet."
|
|
1951
1953
|
}
|
|
1952
1954
|
) })
|
|
@@ -1959,8 +1961,8 @@ function Wa(t) {
|
|
|
1959
1961
|
}
|
|
1960
1962
|
function Ha(t) {
|
|
1961
1963
|
const a = {};
|
|
1962
|
-
for (const
|
|
1963
|
-
|
|
1964
|
+
for (const o of t)
|
|
1965
|
+
o.defaultValue !== void 0 && (a[o.id] = o.defaultValue);
|
|
1964
1966
|
return a;
|
|
1965
1967
|
}
|
|
1966
1968
|
function Ga(t, a) {
|
|
@@ -1972,135 +1974,135 @@ function Ga(t, a) {
|
|
|
1972
1974
|
function Ka({
|
|
1973
1975
|
allInputs: t,
|
|
1974
1976
|
documentSheetId: a,
|
|
1975
|
-
currentDocumentInputs:
|
|
1976
|
-
nextControls:
|
|
1977
|
-
nextDefaultValues:
|
|
1978
|
-
change:
|
|
1977
|
+
currentDocumentInputs: o,
|
|
1978
|
+
nextControls: n,
|
|
1979
|
+
nextDefaultValues: i,
|
|
1980
|
+
change: s
|
|
1979
1981
|
}) {
|
|
1980
|
-
const
|
|
1981
|
-
|
|
1982
|
+
const d = new Map(
|
|
1983
|
+
n.map((h) => [
|
|
1982
1984
|
h.id,
|
|
1983
|
-
Ga(h,
|
|
1985
|
+
Ga(h, i)
|
|
1984
1986
|
])
|
|
1985
|
-
),
|
|
1986
|
-
for (const h of
|
|
1987
|
+
), p = (s == null ? void 0 : s.type) === "rename" ? { oldId: s.oldId, newId: s.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
|
|
1988
|
+
for (const h of o) {
|
|
1987
1989
|
if (h.kind !== "control") {
|
|
1988
|
-
|
|
1990
|
+
u.push(h);
|
|
1989
1991
|
continue;
|
|
1990
1992
|
}
|
|
1991
|
-
const
|
|
1992
|
-
if (!
|
|
1993
|
+
const f = d.get(h.control.id) || ((p == null ? void 0 : p.oldId) === h.control.id ? d.get(p.newId) : void 0);
|
|
1994
|
+
if (!f)
|
|
1993
1995
|
continue;
|
|
1994
|
-
l.add(
|
|
1995
|
-
const
|
|
1996
|
-
|
|
1997
|
-
[...t, ...
|
|
1998
|
-
(
|
|
1996
|
+
l.add(f.id);
|
|
1997
|
+
const x = ta(
|
|
1998
|
+
f.id,
|
|
1999
|
+
[...t, ...u].filter(
|
|
2000
|
+
(N) => N.id !== h.id
|
|
1999
2001
|
)
|
|
2000
|
-
),
|
|
2001
|
-
|
|
2002
|
+
), C = f.id === x ? f : { ...f, id: x };
|
|
2003
|
+
u.push({
|
|
2002
2004
|
...h,
|
|
2003
|
-
label:
|
|
2004
|
-
variableName:
|
|
2005
|
-
requiredAtExecution:
|
|
2006
|
-
control:
|
|
2005
|
+
label: C.label,
|
|
2006
|
+
variableName: x,
|
|
2007
|
+
requiredAtExecution: C.requiredAtExecution,
|
|
2008
|
+
control: C
|
|
2007
2009
|
});
|
|
2008
2010
|
}
|
|
2009
|
-
for (const h of
|
|
2010
|
-
l.has(h.id) ||
|
|
2011
|
-
|
|
2011
|
+
for (const h of d.values())
|
|
2012
|
+
l.has(h.id) || u.push(
|
|
2013
|
+
Nr({
|
|
2012
2014
|
control: h,
|
|
2013
|
-
existingInputs: [...t, ...
|
|
2015
|
+
existingInputs: [...t, ...u],
|
|
2014
2016
|
sheetId: a
|
|
2015
2017
|
})
|
|
2016
2018
|
);
|
|
2017
|
-
const
|
|
2018
|
-
|
|
2019
|
+
const c = new Set(
|
|
2020
|
+
o.map((h) => h.id)
|
|
2019
2021
|
);
|
|
2020
2022
|
return [...t.filter(
|
|
2021
|
-
(h) => !
|
|
2022
|
-
), ...
|
|
2023
|
+
(h) => !c.has(h.id)
|
|
2024
|
+
), ...u];
|
|
2023
2025
|
}
|
|
2024
2026
|
function qa({
|
|
2025
2027
|
showFilters: t,
|
|
2026
2028
|
onShowFiltersChange: a,
|
|
2027
|
-
pickerContent:
|
|
2028
|
-
settingsContent:
|
|
2029
|
-
size:
|
|
2030
|
-
className:
|
|
2031
|
-
primaryButtonClassName:
|
|
2032
|
-
secondaryButtonClassName:
|
|
2029
|
+
pickerContent: o,
|
|
2030
|
+
settingsContent: n,
|
|
2031
|
+
size: i = "default",
|
|
2032
|
+
className: s,
|
|
2033
|
+
primaryButtonClassName: d,
|
|
2034
|
+
secondaryButtonClassName: p,
|
|
2033
2035
|
pickerContentClassName: l,
|
|
2034
|
-
settingsContentClassName:
|
|
2036
|
+
settingsContentClassName: u
|
|
2035
2037
|
}) {
|
|
2036
|
-
const
|
|
2038
|
+
const c = i === "toolbar", [m, h] = E(!1), f = et("interactive");
|
|
2037
2039
|
return /* @__PURE__ */ r(
|
|
2038
2040
|
"div",
|
|
2039
2041
|
{
|
|
2040
|
-
className:
|
|
2042
|
+
className: q(
|
|
2041
2043
|
// Height lives on the shell so the outer border is part of the
|
|
2042
2044
|
// h-7 box (matches regular `size="xs"` buttons). Inner triggers
|
|
2043
2045
|
// stretch to fill via `h-full`.
|
|
2044
2046
|
"relative inline-flex items-stretch overflow-hidden rounded-control border border-input bg-background",
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
+
c ? "h-8" : "h-7",
|
|
2048
|
+
s
|
|
2047
2049
|
),
|
|
2048
2050
|
children: [
|
|
2049
|
-
/* @__PURE__ */ r(
|
|
2050
|
-
/* @__PURE__ */ e(
|
|
2051
|
+
/* @__PURE__ */ r(Oe, { open: t, onOpenChange: a, children: [
|
|
2052
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2051
2053
|
B,
|
|
2052
2054
|
{
|
|
2053
2055
|
variant: "ghost",
|
|
2054
2056
|
size: "xs",
|
|
2055
|
-
className:
|
|
2057
|
+
className: q(
|
|
2056
2058
|
"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",
|
|
2057
|
-
|
|
2059
|
+
d
|
|
2058
2060
|
),
|
|
2059
2061
|
children: [
|
|
2060
|
-
t ? /* @__PURE__ */ e(ua, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(
|
|
2062
|
+
t ? /* @__PURE__ */ e(ua, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(It, { className: "h-3.5 w-3.5" }),
|
|
2061
2063
|
"Filter"
|
|
2062
2064
|
]
|
|
2063
2065
|
}
|
|
2064
2066
|
) }),
|
|
2065
2067
|
/* @__PURE__ */ e(
|
|
2066
|
-
|
|
2068
|
+
ze,
|
|
2067
2069
|
{
|
|
2068
2070
|
align: "end",
|
|
2069
2071
|
sideOffset: 6,
|
|
2070
|
-
className:
|
|
2071
|
-
"w-auto rounded-card border border-border/60 p-0 shadow-
|
|
2072
|
+
className: q(
|
|
2073
|
+
"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)]",
|
|
2072
2074
|
l
|
|
2073
2075
|
),
|
|
2074
|
-
style:
|
|
2075
|
-
children:
|
|
2076
|
+
style: f.contentStyle,
|
|
2077
|
+
children: o
|
|
2076
2078
|
}
|
|
2077
2079
|
)
|
|
2078
2080
|
] }),
|
|
2079
|
-
/* @__PURE__ */ r(
|
|
2080
|
-
/* @__PURE__ */ e(
|
|
2081
|
+
/* @__PURE__ */ r(Oe, { open: m, onOpenChange: h, children: [
|
|
2082
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2081
2083
|
B,
|
|
2082
2084
|
{
|
|
2083
2085
|
variant: "ghost",
|
|
2084
2086
|
size: "xs",
|
|
2085
|
-
className:
|
|
2087
|
+
className: q(
|
|
2086
2088
|
"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",
|
|
2087
|
-
|
|
2089
|
+
p
|
|
2088
2090
|
),
|
|
2089
2091
|
"aria-label": "Filter and control actions",
|
|
2090
|
-
children: /* @__PURE__ */ e(
|
|
2092
|
+
children: /* @__PURE__ */ e(Ut, { className: "h-3.5 w-3.5" })
|
|
2091
2093
|
}
|
|
2092
2094
|
) }),
|
|
2093
2095
|
/* @__PURE__ */ e(
|
|
2094
|
-
|
|
2096
|
+
ze,
|
|
2095
2097
|
{
|
|
2096
2098
|
align: "end",
|
|
2097
2099
|
sideOffset: 6,
|
|
2098
|
-
className:
|
|
2099
|
-
"w-auto rounded-card border border-border/60 p-0 shadow-
|
|
2100
|
-
|
|
2100
|
+
className: q(
|
|
2101
|
+
"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)]",
|
|
2102
|
+
u
|
|
2101
2103
|
),
|
|
2102
|
-
style:
|
|
2103
|
-
children:
|
|
2104
|
+
style: f.contentStyle,
|
|
2105
|
+
children: n(() => h(!1))
|
|
2104
2106
|
}
|
|
2105
2107
|
)
|
|
2106
2108
|
] })
|
|
@@ -2110,37 +2112,37 @@ function qa({
|
|
|
2110
2112
|
}
|
|
2111
2113
|
function Xa() {
|
|
2112
2114
|
ha();
|
|
2113
|
-
const t = P((l) => l.selectedSheetId), a = P((l) => l.selectedFrameId),
|
|
2114
|
-
return
|
|
2115
|
-
var
|
|
2116
|
-
let l =
|
|
2115
|
+
const t = P((l) => l.selectedSheetId), a = P((l) => l.selectedFrameId), o = P((l) => l.dashboard), n = P((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = be(), { setCard: s } = Vt(), d = ge((l) => l.card.dataSource);
|
|
2116
|
+
return Q(() => {
|
|
2117
|
+
var u, c;
|
|
2118
|
+
let l = n();
|
|
2117
2119
|
if (!l) {
|
|
2118
|
-
const
|
|
2119
|
-
h && (
|
|
2120
|
+
const m = (u = o == null ? void 0 : o.sheets) == null ? void 0 : u.find((f) => f.id === t), h = (c = m == null ? void 0 : m.frames) == null ? void 0 : c[0];
|
|
2121
|
+
h && (i(h.id), l = h);
|
|
2120
2122
|
}
|
|
2121
2123
|
if (l) {
|
|
2122
|
-
const
|
|
2123
|
-
|
|
2124
|
+
const m = l.cards.find((h) => h.id === l.activeCardId);
|
|
2125
|
+
m && s(m);
|
|
2124
2126
|
}
|
|
2125
|
-
}, [
|
|
2126
|
-
hasEntities: !!(
|
|
2127
|
+
}, [n, t, a, o, i, s]), {
|
|
2128
|
+
hasEntities: !!(d != null && d.selectedEntities && d.selectedEntities.length > 0)
|
|
2127
2129
|
};
|
|
2128
2130
|
}
|
|
2129
2131
|
function Za() {
|
|
2130
2132
|
const t = P((l) => l.dashboard), a = P(
|
|
2131
2133
|
(l) => l.semanticExecutionPayload
|
|
2132
|
-
),
|
|
2134
|
+
), o = P((l) => l.actions.addFilter), { hasEntities: n } = Xa(), { isLoading: i } = Sr(), s = ee(
|
|
2133
2135
|
() => ra(t, a),
|
|
2134
2136
|
[t, a]
|
|
2135
|
-
),
|
|
2137
|
+
), p = !aa(t.filters) && s.hasEligibleCards && !i;
|
|
2136
2138
|
return /* @__PURE__ */ r("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
|
|
2137
|
-
|
|
2139
|
+
p && /* @__PURE__ */ e("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
|
|
2138
2140
|
"button",
|
|
2139
2141
|
{
|
|
2140
2142
|
type: "button",
|
|
2141
|
-
onClick: () =>
|
|
2142
|
-
title: `Applies to ${
|
|
2143
|
-
className: "flex w-full items-start gap-2 rounded-
|
|
2143
|
+
onClick: () => o(na()),
|
|
2144
|
+
title: `Applies to ${s.eligibleCardCount} of ${s.totalCardCount} date-aware cards`,
|
|
2145
|
+
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",
|
|
2144
2146
|
children: [
|
|
2145
2147
|
/* @__PURE__ */ e(xa, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
2146
2148
|
/* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col", children: [
|
|
@@ -2150,55 +2152,55 @@ function Za() {
|
|
|
2150
2152
|
]
|
|
2151
2153
|
}
|
|
2152
2154
|
) }),
|
|
2153
|
-
!
|
|
2155
|
+
!n && /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
|
|
2154
2156
|
/* @__PURE__ */ e(Dr, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
|
|
2155
2157
|
/* @__PURE__ */ e("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
|
|
2156
2158
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
|
|
2157
2159
|
] }),
|
|
2158
|
-
|
|
2160
|
+
n && /* @__PURE__ */ e("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ e(kr, { context: "filter" }) })
|
|
2159
2161
|
] });
|
|
2160
2162
|
}
|
|
2161
|
-
const
|
|
2163
|
+
const Ct = !1;
|
|
2162
2164
|
function Qa({
|
|
2163
2165
|
onAddFilter: t,
|
|
2164
2166
|
onAddControl: a,
|
|
2165
|
-
onManageControls:
|
|
2166
|
-
onDismiss:
|
|
2167
|
+
onManageControls: o,
|
|
2168
|
+
onDismiss: n
|
|
2167
2169
|
}) {
|
|
2168
|
-
const
|
|
2169
|
-
(
|
|
2170
|
-
), { setFilterLayout:
|
|
2171
|
-
|
|
2172
|
-
const
|
|
2173
|
-
return
|
|
2170
|
+
const i = P(
|
|
2171
|
+
(p) => p.dashboard.filterLayout
|
|
2172
|
+
), { setFilterLayout: s } = be();
|
|
2173
|
+
i != null && i.displayMode;
|
|
2174
|
+
const d = (i == null ? void 0 : i.toolbarWrap) ?? !1;
|
|
2175
|
+
return i == null || i.showDownloadButton, /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
|
|
2174
2176
|
/* @__PURE__ */ r("div", { className: "p-1", children: [
|
|
2175
2177
|
/* @__PURE__ */ e(
|
|
2176
|
-
|
|
2178
|
+
Qe,
|
|
2177
2179
|
{
|
|
2178
|
-
icon:
|
|
2180
|
+
icon: It,
|
|
2179
2181
|
label: "Add filter",
|
|
2180
2182
|
onClick: () => {
|
|
2181
|
-
t(),
|
|
2183
|
+
t(), n();
|
|
2182
2184
|
}
|
|
2183
2185
|
}
|
|
2184
2186
|
),
|
|
2185
2187
|
/* @__PURE__ */ e(
|
|
2186
|
-
|
|
2188
|
+
Qe,
|
|
2187
2189
|
{
|
|
2188
|
-
icon:
|
|
2190
|
+
icon: Rt,
|
|
2189
2191
|
label: "Add control",
|
|
2190
2192
|
onClick: () => {
|
|
2191
|
-
a(),
|
|
2193
|
+
a(), n();
|
|
2192
2194
|
}
|
|
2193
2195
|
}
|
|
2194
2196
|
),
|
|
2195
2197
|
/* @__PURE__ */ e(
|
|
2196
|
-
|
|
2198
|
+
Qe,
|
|
2197
2199
|
{
|
|
2198
|
-
icon:
|
|
2200
|
+
icon: Ft,
|
|
2199
2201
|
label: "Manage controls",
|
|
2200
2202
|
onClick: () => {
|
|
2201
|
-
|
|
2203
|
+
o(), n();
|
|
2202
2204
|
}
|
|
2203
2205
|
}
|
|
2204
2206
|
)
|
|
@@ -2206,31 +2208,31 @@ function Qa({
|
|
|
2206
2208
|
/* @__PURE__ */ e("div", { className: "border-t border-border/60" }),
|
|
2207
2209
|
/* @__PURE__ */ r("div", { className: "space-y-1 p-2", children: [
|
|
2208
2210
|
/* @__PURE__ */ e("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
|
|
2209
|
-
|
|
2211
|
+
Ct,
|
|
2210
2212
|
/* @__PURE__ */ e(
|
|
2211
2213
|
Ya,
|
|
2212
2214
|
{
|
|
2213
2215
|
id: "filter-display-wrap",
|
|
2214
2216
|
label: "Wrap to multiple lines",
|
|
2215
|
-
checked:
|
|
2216
|
-
onCheckedChange: (
|
|
2217
|
+
checked: d,
|
|
2218
|
+
onCheckedChange: (p) => s({ toolbarWrap: p === !0 })
|
|
2217
2219
|
}
|
|
2218
2220
|
),
|
|
2219
|
-
|
|
2221
|
+
Ct
|
|
2220
2222
|
] })
|
|
2221
2223
|
] });
|
|
2222
2224
|
}
|
|
2223
|
-
function
|
|
2225
|
+
function Qe({
|
|
2224
2226
|
icon: t,
|
|
2225
2227
|
label: a,
|
|
2226
|
-
onClick:
|
|
2228
|
+
onClick: o
|
|
2227
2229
|
}) {
|
|
2228
2230
|
return /* @__PURE__ */ r(
|
|
2229
2231
|
"button",
|
|
2230
2232
|
{
|
|
2231
2233
|
type: "button",
|
|
2232
|
-
onClick:
|
|
2233
|
-
className: "flex w-full items-center gap-2 rounded-
|
|
2234
|
+
onClick: o,
|
|
2235
|
+
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",
|
|
2234
2236
|
children: [
|
|
2235
2237
|
/* @__PURE__ */ e(t, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
2236
2238
|
a
|
|
@@ -2241,13 +2243,13 @@ function Ze({
|
|
|
2241
2243
|
function Ya({
|
|
2242
2244
|
id: t,
|
|
2243
2245
|
label: a,
|
|
2244
|
-
checked:
|
|
2245
|
-
onCheckedChange:
|
|
2246
|
+
checked: o,
|
|
2247
|
+
onCheckedChange: n
|
|
2246
2248
|
}) {
|
|
2247
|
-
return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-
|
|
2248
|
-
/* @__PURE__ */ e(
|
|
2249
|
+
return /* @__PURE__ */ r("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: [
|
|
2250
|
+
/* @__PURE__ */ e(lt, { id: t, checked: o, onCheckedChange: n }),
|
|
2249
2251
|
/* @__PURE__ */ e(
|
|
2250
|
-
|
|
2252
|
+
Se,
|
|
2251
2253
|
{
|
|
2252
2254
|
htmlFor: t,
|
|
2253
2255
|
className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
|
|
@@ -2259,82 +2261,82 @@ function Ya({
|
|
|
2259
2261
|
function qn({
|
|
2260
2262
|
size: t,
|
|
2261
2263
|
className: a,
|
|
2262
|
-
primaryButtonClassName:
|
|
2263
|
-
secondaryButtonClassName:
|
|
2264
|
-
pickerContentClassName:
|
|
2265
|
-
settingsContentClassName:
|
|
2264
|
+
primaryButtonClassName: o,
|
|
2265
|
+
secondaryButtonClassName: n,
|
|
2266
|
+
pickerContentClassName: i,
|
|
2267
|
+
settingsContentClassName: s
|
|
2266
2268
|
}) {
|
|
2267
2269
|
var U;
|
|
2268
|
-
const [
|
|
2269
|
-
(
|
|
2270
|
-
),
|
|
2270
|
+
const [d, p] = E(null), l = P((g) => g.dashboard), u = P((g) => g.selectedSheetId), c = P((g) => g.showFilters), m = Ar((g) => g.setPanelOpen), h = P((g) => g.actions), { setDocumentInspectorTab: f, setShowFilters: x } = h, C = (U = l.sheets) == null ? void 0 : U.find(
|
|
2271
|
+
(g) => g.id === u
|
|
2272
|
+
), N = sa(C), I = K((g) => {
|
|
2271
2273
|
window.setTimeout(() => {
|
|
2272
|
-
|
|
2274
|
+
p(g);
|
|
2273
2275
|
}, 0);
|
|
2274
|
-
}, []),
|
|
2275
|
-
(
|
|
2276
|
-
if (
|
|
2277
|
-
|
|
2276
|
+
}, []), D = K(
|
|
2277
|
+
(g) => {
|
|
2278
|
+
if (N && u) {
|
|
2279
|
+
g && f(u, "inputs");
|
|
2278
2280
|
return;
|
|
2279
2281
|
}
|
|
2280
|
-
|
|
2282
|
+
g && m("dashboard", !1), x(g);
|
|
2281
2283
|
},
|
|
2282
2284
|
[
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
p,
|
|
2285
|
+
N,
|
|
2286
|
+
u,
|
|
2286
2287
|
f,
|
|
2287
|
-
|
|
2288
|
+
m,
|
|
2289
|
+
x
|
|
2288
2290
|
]
|
|
2289
|
-
),
|
|
2290
|
-
|
|
2291
|
-
}, [
|
|
2291
|
+
), b = K(() => {
|
|
2292
|
+
D(!0);
|
|
2293
|
+
}, [D]), S = K(() => {
|
|
2292
2294
|
I("create");
|
|
2293
|
-
}, [I]),
|
|
2295
|
+
}, [I]), A = K(() => {
|
|
2294
2296
|
I("manage");
|
|
2295
2297
|
}, [I]);
|
|
2296
2298
|
return /* @__PURE__ */ r(W, { children: [
|
|
2297
2299
|
/* @__PURE__ */ e(
|
|
2298
2300
|
qa,
|
|
2299
2301
|
{
|
|
2300
|
-
showFilters:
|
|
2301
|
-
onShowFiltersChange:
|
|
2302
|
+
showFilters: N ? !1 : c,
|
|
2303
|
+
onShowFiltersChange: D,
|
|
2302
2304
|
pickerContent: /* @__PURE__ */ e(Za, {}),
|
|
2303
|
-
settingsContent: (
|
|
2305
|
+
settingsContent: (g) => /* @__PURE__ */ e(
|
|
2304
2306
|
Qa,
|
|
2305
2307
|
{
|
|
2306
|
-
onAddFilter:
|
|
2308
|
+
onAddFilter: b,
|
|
2307
2309
|
onAddControl: S,
|
|
2308
|
-
onManageControls:
|
|
2309
|
-
onDismiss:
|
|
2310
|
+
onManageControls: A,
|
|
2311
|
+
onDismiss: g
|
|
2310
2312
|
}
|
|
2311
2313
|
),
|
|
2312
2314
|
size: t,
|
|
2313
2315
|
className: a,
|
|
2314
|
-
primaryButtonClassName:
|
|
2315
|
-
secondaryButtonClassName:
|
|
2316
|
-
pickerContentClassName:
|
|
2317
|
-
settingsContentClassName:
|
|
2316
|
+
primaryButtonClassName: o,
|
|
2317
|
+
secondaryButtonClassName: n,
|
|
2318
|
+
pickerContentClassName: i,
|
|
2319
|
+
settingsContentClassName: s
|
|
2318
2320
|
}
|
|
2319
2321
|
),
|
|
2320
|
-
|
|
2322
|
+
d ? N ? /* @__PURE__ */ e(
|
|
2321
2323
|
ja,
|
|
2322
2324
|
{
|
|
2323
2325
|
open: !0,
|
|
2324
|
-
onOpenChange: (
|
|
2325
|
-
|
|
2326
|
+
onOpenChange: (g) => {
|
|
2327
|
+
g || p(null);
|
|
2326
2328
|
},
|
|
2327
|
-
initialMode:
|
|
2329
|
+
initialMode: d
|
|
2328
2330
|
}
|
|
2329
2331
|
) : /* @__PURE__ */ e(
|
|
2330
|
-
|
|
2332
|
+
za,
|
|
2331
2333
|
{
|
|
2332
2334
|
open: !0,
|
|
2333
|
-
onOpenChange: (
|
|
2334
|
-
|
|
2335
|
+
onOpenChange: (g) => {
|
|
2336
|
+
g || p(null);
|
|
2335
2337
|
},
|
|
2336
2338
|
showTrigger: !1,
|
|
2337
|
-
initialMode:
|
|
2339
|
+
initialMode: d
|
|
2338
2340
|
}
|
|
2339
2341
|
) : null
|
|
2340
2342
|
] });
|
|
@@ -2342,10 +2344,10 @@ function qn({
|
|
|
2342
2344
|
function Ja({
|
|
2343
2345
|
disabled: t,
|
|
2344
2346
|
briefingCount: a,
|
|
2345
|
-
className:
|
|
2346
|
-
onClick:
|
|
2347
|
+
className: o,
|
|
2348
|
+
onClick: n
|
|
2347
2349
|
}) {
|
|
2348
|
-
const
|
|
2350
|
+
const i = typeof a == "number" && a > 0;
|
|
2349
2351
|
return /* @__PURE__ */ r(
|
|
2350
2352
|
B,
|
|
2351
2353
|
{
|
|
@@ -2353,18 +2355,18 @@ function Ja({
|
|
|
2353
2355
|
size: "xs",
|
|
2354
2356
|
variant: "outline",
|
|
2355
2357
|
disabled: t,
|
|
2356
|
-
className:
|
|
2357
|
-
onClick:
|
|
2358
|
+
className: q("gap-1.5", o),
|
|
2359
|
+
onClick: n,
|
|
2358
2360
|
"aria-label": "Reports & briefings",
|
|
2359
2361
|
children: [
|
|
2360
2362
|
/* @__PURE__ */ e(ya, { className: "h-3.5 w-3.5" }),
|
|
2361
2363
|
"Reports & briefings",
|
|
2362
|
-
|
|
2364
|
+
i ? /* @__PURE__ */ e("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
|
|
2363
2365
|
]
|
|
2364
2366
|
}
|
|
2365
2367
|
);
|
|
2366
2368
|
}
|
|
2367
|
-
const en = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",
|
|
2369
|
+
const en = "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", Ue = "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";
|
|
2368
2370
|
function tn(t) {
|
|
2369
2371
|
return t === "dashboard" ? "This dashboard" : "Project";
|
|
2370
2372
|
}
|
|
@@ -2372,15 +2374,15 @@ function rn(t) {
|
|
|
2372
2374
|
if (!t) return "Never";
|
|
2373
2375
|
const a = new Date(t);
|
|
2374
2376
|
if (Number.isNaN(a.getTime())) return "Unknown";
|
|
2375
|
-
const
|
|
2376
|
-
if (
|
|
2377
|
-
if (
|
|
2378
|
-
const
|
|
2379
|
-
if (
|
|
2380
|
-
const
|
|
2381
|
-
if (
|
|
2382
|
-
const
|
|
2383
|
-
return
|
|
2377
|
+
const o = Date.now() - a.getTime(), n = Math.round(o / 6e4);
|
|
2378
|
+
if (n < 1) return "now";
|
|
2379
|
+
if (n < 60) return `${n}m ago`;
|
|
2380
|
+
const i = Math.round(n / 60);
|
|
2381
|
+
if (i < 24) return `${i}h ago`;
|
|
2382
|
+
const s = Math.round(i / 24);
|
|
2383
|
+
if (s < 7) return `${s}d ago`;
|
|
2384
|
+
const d = Math.round(s / 7);
|
|
2385
|
+
return d < 5 ? `${d}w ago` : `${Math.round(s / 30)}mo ago`;
|
|
2384
2386
|
}
|
|
2385
2387
|
function an(t) {
|
|
2386
2388
|
return t.scheduleExpr ? fa(
|
|
@@ -2395,7 +2397,7 @@ function nn(t) {
|
|
|
2395
2397
|
}
|
|
2396
2398
|
return null;
|
|
2397
2399
|
}
|
|
2398
|
-
function
|
|
2400
|
+
function $t(t) {
|
|
2399
2401
|
return t.hasActiveRun ? "Running" : t.lastRunStatus ? `Last run ${t.lastRunStatus.toString().toLowerCase()}` : "Idle";
|
|
2400
2402
|
}
|
|
2401
2403
|
function sn(t) {
|
|
@@ -2411,22 +2413,22 @@ function on({
|
|
|
2411
2413
|
className: "flex shrink-0 items-center gap-1 rounded-control bg-muted p-0.5",
|
|
2412
2414
|
role: "tablist",
|
|
2413
2415
|
"aria-label": "Briefing source view",
|
|
2414
|
-
children: ["dashboard", "project"].map((
|
|
2415
|
-
const
|
|
2416
|
+
children: ["dashboard", "project"].map((o) => {
|
|
2417
|
+
const n = t === o;
|
|
2416
2418
|
return /* @__PURE__ */ e(
|
|
2417
2419
|
"button",
|
|
2418
2420
|
{
|
|
2419
2421
|
type: "button",
|
|
2420
2422
|
role: "tab",
|
|
2421
|
-
"aria-selected":
|
|
2422
|
-
onClick: () => a(
|
|
2423
|
-
className:
|
|
2423
|
+
"aria-selected": n,
|
|
2424
|
+
onClick: () => a(o),
|
|
2425
|
+
className: q(
|
|
2424
2426
|
"h-6 rounded-[3px] px-2 text-[11px] transition-colors",
|
|
2425
|
-
|
|
2427
|
+
n ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
2426
2428
|
),
|
|
2427
|
-
children: tn(
|
|
2429
|
+
children: tn(o)
|
|
2428
2430
|
},
|
|
2429
|
-
|
|
2431
|
+
o
|
|
2430
2432
|
);
|
|
2431
2433
|
})
|
|
2432
2434
|
}
|
|
@@ -2435,45 +2437,45 @@ function on({
|
|
|
2435
2437
|
function ln({
|
|
2436
2438
|
briefings: t,
|
|
2437
2439
|
dashboardLabel: a,
|
|
2438
|
-
sourceView:
|
|
2439
|
-
error:
|
|
2440
|
-
loading:
|
|
2441
|
-
onSourceViewChange:
|
|
2442
|
-
onClose:
|
|
2443
|
-
onEdit:
|
|
2440
|
+
sourceView: o,
|
|
2441
|
+
error: n,
|
|
2442
|
+
loading: i,
|
|
2443
|
+
onSourceViewChange: s,
|
|
2444
|
+
onClose: d,
|
|
2445
|
+
onEdit: p,
|
|
2444
2446
|
onNew: l,
|
|
2445
|
-
canCreate:
|
|
2446
|
-
canCreateScheduledReport:
|
|
2447
|
-
analyticalBriefingsEnabled:
|
|
2447
|
+
canCreate: u,
|
|
2448
|
+
canCreateScheduledReport: c,
|
|
2449
|
+
analyticalBriefingsEnabled: m,
|
|
2448
2450
|
onRunNow: h,
|
|
2449
|
-
onTogglePause:
|
|
2450
|
-
onDelete:
|
|
2451
|
-
selectingId:
|
|
2452
|
-
busyId:
|
|
2451
|
+
onTogglePause: f,
|
|
2452
|
+
onDelete: x,
|
|
2453
|
+
selectingId: C,
|
|
2454
|
+
busyId: N,
|
|
2453
2455
|
manageBriefingsHref: I,
|
|
2454
|
-
contentKind:
|
|
2455
|
-
hideHeader:
|
|
2456
|
+
contentKind: D,
|
|
2457
|
+
hideHeader: b = !1
|
|
2456
2458
|
}) {
|
|
2457
|
-
const S = t.length,
|
|
2459
|
+
const S = t.length, A = t.filter((F) => F.status === "ACTIVE").length, U = D === "reports" ? S === 1 ? "report" : "reports" : D === "briefings" ? S === 1 ? "briefing" : "briefings" : S === 1 ? "item" : "items", g = t.find((F) => F.hasActiveRun) ?? null, v = D ?? "reports & briefings", T = o === "dashboard" ? a : `Project ${v}`;
|
|
2458
2460
|
return /* @__PURE__ */ r(
|
|
2459
2461
|
"section",
|
|
2460
2462
|
{
|
|
2461
|
-
"aria-label": `Dashboard ${
|
|
2463
|
+
"aria-label": `Dashboard ${v.replace("&", "and")}`,
|
|
2462
2464
|
className: "flex h-full min-h-0 flex-col bg-background text-foreground",
|
|
2463
2465
|
children: [
|
|
2464
|
-
|
|
2466
|
+
b ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
2465
2467
|
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
2466
|
-
/* @__PURE__ */ e("div", { className: en, children:
|
|
2468
|
+
/* @__PURE__ */ e("div", { className: en, children: v }),
|
|
2467
2469
|
/* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: T })
|
|
2468
2470
|
] }),
|
|
2469
2471
|
/* @__PURE__ */ e(
|
|
2470
2472
|
"button",
|
|
2471
2473
|
{
|
|
2472
2474
|
type: "button",
|
|
2473
|
-
onClick:
|
|
2475
|
+
onClick: d,
|
|
2474
2476
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2475
|
-
"aria-label": `Close ${
|
|
2476
|
-
children: /* @__PURE__ */ e(
|
|
2477
|
+
"aria-label": `Close ${v.replace("&", "and")} panel`,
|
|
2478
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-3.5 w-3.5" })
|
|
2477
2479
|
}
|
|
2478
2480
|
)
|
|
2479
2481
|
] }),
|
|
@@ -2482,17 +2484,17 @@ function ln({
|
|
|
2482
2484
|
/* @__PURE__ */ e(
|
|
2483
2485
|
on,
|
|
2484
2486
|
{
|
|
2485
|
-
activeView:
|
|
2486
|
-
onChange:
|
|
2487
|
+
activeView: o,
|
|
2488
|
+
onChange: s
|
|
2487
2489
|
}
|
|
2488
2490
|
),
|
|
2489
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children:
|
|
2491
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && S === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
2490
2492
|
"Loading ",
|
|
2491
|
-
|
|
2493
|
+
v,
|
|
2492
2494
|
"…"
|
|
2493
2495
|
] }) : S === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
2494
2496
|
"No ",
|
|
2495
|
-
|
|
2497
|
+
v,
|
|
2496
2498
|
" yet"
|
|
2497
2499
|
] }) : /* @__PURE__ */ r(W, { children: [
|
|
2498
2500
|
/* @__PURE__ */ r("span", { className: "font-medium text-foreground/80", children: [
|
|
@@ -2502,49 +2504,49 @@ function ln({
|
|
|
2502
2504
|
] }),
|
|
2503
2505
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2504
2506
|
/* @__PURE__ */ r("span", { children: [
|
|
2505
|
-
|
|
2507
|
+
A,
|
|
2506
2508
|
" active"
|
|
2507
2509
|
] })
|
|
2508
2510
|
] }) })
|
|
2509
2511
|
] }),
|
|
2510
2512
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
2511
|
-
|
|
2513
|
+
i ? (
|
|
2512
2514
|
// Auto-refresh on open; surface a quiet spinner near the count
|
|
2513
2515
|
// when a manual reload is in flight, but don't show a separate
|
|
2514
2516
|
// refresh button — close+reopen handles the rare "stale list"
|
|
2515
2517
|
// case without crowding the toolbar.
|
|
2516
2518
|
/* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
|
|
2517
2519
|
) : null,
|
|
2518
|
-
S > 0 &&
|
|
2519
|
-
/* @__PURE__ */ e(
|
|
2520
|
+
S > 0 && u ? m && c ? /* @__PURE__ */ r($e, { children: [
|
|
2521
|
+
/* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Ue, children: [
|
|
2520
2522
|
/* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
|
|
2521
2523
|
" New"
|
|
2522
2524
|
] }) }),
|
|
2523
|
-
/* @__PURE__ */ r(
|
|
2524
|
-
/* @__PURE__ */ e(
|
|
2525
|
+
/* @__PURE__ */ r(We, { align: "end", children: [
|
|
2526
|
+
/* @__PURE__ */ e(G, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
|
|
2525
2527
|
/* @__PURE__ */ e(
|
|
2526
|
-
|
|
2528
|
+
G,
|
|
2527
2529
|
{
|
|
2528
2530
|
onClick: () => l("analytical_briefing"),
|
|
2529
2531
|
children: "Create analytical briefing"
|
|
2530
2532
|
}
|
|
2531
2533
|
)
|
|
2532
2534
|
] })
|
|
2533
|
-
] }) :
|
|
2535
|
+
] }) : c ? /* @__PURE__ */ r(
|
|
2534
2536
|
"button",
|
|
2535
2537
|
{
|
|
2536
2538
|
onClick: () => l("scheduled_report"),
|
|
2537
|
-
className:
|
|
2539
|
+
className: Ue,
|
|
2538
2540
|
children: [
|
|
2539
2541
|
/* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
|
|
2540
2542
|
" Schedule report"
|
|
2541
2543
|
]
|
|
2542
2544
|
}
|
|
2543
|
-
) :
|
|
2545
|
+
) : m ? /* @__PURE__ */ r(
|
|
2544
2546
|
"button",
|
|
2545
2547
|
{
|
|
2546
2548
|
onClick: () => l("analytical_briefing"),
|
|
2547
|
-
className:
|
|
2549
|
+
className: Ue,
|
|
2548
2550
|
children: [
|
|
2549
2551
|
/* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
|
|
2550
2552
|
" New briefing"
|
|
@@ -2553,34 +2555,34 @@ function ln({
|
|
|
2553
2555
|
) : null : null
|
|
2554
2556
|
] })
|
|
2555
2557
|
] }),
|
|
2556
|
-
|
|
2558
|
+
g ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
|
|
2557
2559
|
/* @__PURE__ */ e(te, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
|
|
2558
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children:
|
|
2560
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: g.name }),
|
|
2559
2561
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2560
|
-
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children:
|
|
2562
|
+
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: $t(g) })
|
|
2561
2563
|
] }) : null,
|
|
2562
2564
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
|
|
2563
|
-
|
|
2564
|
-
!
|
|
2565
|
+
n ? /* @__PURE__ */ e("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: n }) : null,
|
|
2566
|
+
!i && t.length === 0 && !n ? /* @__PURE__ */ e(
|
|
2565
2567
|
cn,
|
|
2566
2568
|
{
|
|
2567
2569
|
onNew: l,
|
|
2568
|
-
canCreate:
|
|
2569
|
-
canCreateScheduledReport:
|
|
2570
|
-
analyticalBriefingsEnabled:
|
|
2571
|
-
contentKind:
|
|
2570
|
+
canCreate: u,
|
|
2571
|
+
canCreateScheduledReport: c,
|
|
2572
|
+
analyticalBriefingsEnabled: m,
|
|
2573
|
+
contentKind: D
|
|
2572
2574
|
}
|
|
2573
2575
|
) : null,
|
|
2574
2576
|
t.map((F) => /* @__PURE__ */ e(
|
|
2575
2577
|
un,
|
|
2576
2578
|
{
|
|
2577
2579
|
briefing: F,
|
|
2578
|
-
isOpening:
|
|
2579
|
-
isBusy:
|
|
2580
|
-
onOpen: () =>
|
|
2580
|
+
isOpening: C === F.id,
|
|
2581
|
+
isBusy: N === F.id,
|
|
2582
|
+
onOpen: () => p(F.id),
|
|
2581
2583
|
onRunNow: () => h(F),
|
|
2582
|
-
onTogglePause: () =>
|
|
2583
|
-
onDelete: () =>
|
|
2584
|
+
onTogglePause: () => f(F),
|
|
2585
|
+
onDelete: () => x(F)
|
|
2584
2586
|
},
|
|
2585
2587
|
F.id
|
|
2586
2588
|
))
|
|
@@ -2589,7 +2591,7 @@ function ln({
|
|
|
2589
2591
|
"a",
|
|
2590
2592
|
{
|
|
2591
2593
|
href: I,
|
|
2592
|
-
className:
|
|
2594
|
+
className: q(zt, "h-6 px-1 text-[11px]"),
|
|
2593
2595
|
children: [
|
|
2594
2596
|
"Manage all reports & briefings",
|
|
2595
2597
|
/* @__PURE__ */ e(ba, { className: "h-3 w-3" })
|
|
@@ -2603,38 +2605,38 @@ function ln({
|
|
|
2603
2605
|
function cn({
|
|
2604
2606
|
onNew: t,
|
|
2605
2607
|
canCreate: a,
|
|
2606
|
-
canCreateScheduledReport:
|
|
2607
|
-
analyticalBriefingsEnabled:
|
|
2608
|
-
contentKind:
|
|
2608
|
+
canCreateScheduledReport: o,
|
|
2609
|
+
analyticalBriefingsEnabled: n,
|
|
2610
|
+
contentKind: i
|
|
2609
2611
|
}) {
|
|
2610
|
-
const
|
|
2612
|
+
const s = i === "reports" ? {
|
|
2611
2613
|
title: "No reports yet",
|
|
2612
2614
|
description: "Schedule an emailed dashboard or visual report to see it here."
|
|
2613
|
-
} :
|
|
2615
|
+
} : i === "briefings" ? {
|
|
2614
2616
|
title: "No briefings yet",
|
|
2615
2617
|
description: "Create an analytical briefing to monitor this dashboard and brief your team."
|
|
2616
2618
|
} : null;
|
|
2617
2619
|
return /* @__PURE__ */ r("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
|
|
2618
2620
|
/* @__PURE__ */ e(dn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
|
|
2619
|
-
/* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: (
|
|
2620
|
-
/* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (
|
|
2621
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: (s == null ? void 0 : s.title) ?? "Have an analyst brief your team" }),
|
|
2622
|
+
/* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (s == null ? void 0 : s.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." }),
|
|
2621
2623
|
a ? /* @__PURE__ */ r("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
|
|
2622
|
-
|
|
2624
|
+
o ? /* @__PURE__ */ r(
|
|
2623
2625
|
"button",
|
|
2624
2626
|
{
|
|
2625
2627
|
onClick: () => t("scheduled_report"),
|
|
2626
|
-
className:
|
|
2628
|
+
className: Ue,
|
|
2627
2629
|
children: [
|
|
2628
2630
|
/* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
|
|
2629
2631
|
" Schedule a report"
|
|
2630
2632
|
]
|
|
2631
2633
|
}
|
|
2632
2634
|
) : null,
|
|
2633
|
-
|
|
2635
|
+
n ? /* @__PURE__ */ e(
|
|
2634
2636
|
"button",
|
|
2635
2637
|
{
|
|
2636
2638
|
onClick: () => t("analytical_briefing"),
|
|
2637
|
-
className:
|
|
2639
|
+
className: zt,
|
|
2638
2640
|
children: "Create analytical briefing"
|
|
2639
2641
|
}
|
|
2640
2642
|
) : null
|
|
@@ -2821,19 +2823,19 @@ function dn({ className: t }) {
|
|
|
2821
2823
|
function un({
|
|
2822
2824
|
briefing: t,
|
|
2823
2825
|
isOpening: a,
|
|
2824
|
-
isBusy:
|
|
2825
|
-
onOpen:
|
|
2826
|
-
onRunNow:
|
|
2827
|
-
onTogglePause:
|
|
2828
|
-
onDelete:
|
|
2826
|
+
isBusy: o,
|
|
2827
|
+
onOpen: n,
|
|
2828
|
+
onRunNow: i,
|
|
2829
|
+
onTogglePause: s,
|
|
2830
|
+
onDelete: d
|
|
2829
2831
|
}) {
|
|
2830
|
-
const
|
|
2832
|
+
const p = t.status === "PAUSED", l = t.hasActiveRun, u = nn(t), c = rn(t.lastRunAt), m = t.lastRunStatus, h = se(t), f = m === "SUCCESS" ? Re.success.dot : m === "FAILED" ? Re.danger.dot : m ? Re.warning.dot : Re.neutral.dot;
|
|
2831
2833
|
return /* @__PURE__ */ r(
|
|
2832
2834
|
"div",
|
|
2833
2835
|
{
|
|
2834
|
-
className:
|
|
2836
|
+
className: q(
|
|
2835
2837
|
"group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
|
|
2836
|
-
|
|
2838
|
+
p && "opacity-70"
|
|
2837
2839
|
),
|
|
2838
2840
|
children: [
|
|
2839
2841
|
/* @__PURE__ */ r(
|
|
@@ -2841,15 +2843,15 @@ function un({
|
|
|
2841
2843
|
{
|
|
2842
2844
|
role: "button",
|
|
2843
2845
|
tabIndex: 0,
|
|
2844
|
-
onClick:
|
|
2845
|
-
onKeyDown: (
|
|
2846
|
-
(
|
|
2846
|
+
onClick: n,
|
|
2847
|
+
onKeyDown: (x) => {
|
|
2848
|
+
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), n());
|
|
2847
2849
|
},
|
|
2848
2850
|
className: "cursor-pointer pr-8",
|
|
2849
2851
|
children: [
|
|
2850
2852
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2851
2853
|
/* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
|
|
2852
|
-
|
|
2854
|
+
p ? /* @__PURE__ */ e("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
|
|
2853
2855
|
] }),
|
|
2854
2856
|
/* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
|
|
2855
2857
|
/* @__PURE__ */ e("span", { children: h.typeLabel }),
|
|
@@ -2862,47 +2864,47 @@ function un({
|
|
|
2862
2864
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2863
2865
|
/* @__PURE__ */ r("span", { children: [
|
|
2864
2866
|
"Last run ",
|
|
2865
|
-
|
|
2867
|
+
c
|
|
2866
2868
|
] })
|
|
2867
2869
|
] }) : null
|
|
2868
2870
|
] }),
|
|
2869
|
-
|
|
2871
|
+
u || l ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
|
|
2870
2872
|
l ? /* @__PURE__ */ e(te, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ e(
|
|
2871
2873
|
"span",
|
|
2872
2874
|
{
|
|
2873
|
-
className:
|
|
2875
|
+
className: q(
|
|
2874
2876
|
"inline-block h-1.5 w-1.5 shrink-0 rounded-full",
|
|
2875
|
-
|
|
2877
|
+
f
|
|
2876
2878
|
)
|
|
2877
2879
|
}
|
|
2878
2880
|
),
|
|
2879
|
-
/* @__PURE__ */ e("span", { className: "truncate", children: l ?
|
|
2881
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: l ? $t(t) : u })
|
|
2880
2882
|
] }) : null
|
|
2881
2883
|
]
|
|
2882
2884
|
}
|
|
2883
2885
|
),
|
|
2884
|
-
/* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children:
|
|
2885
|
-
/* @__PURE__ */ e(
|
|
2886
|
+
/* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r($e, { children: [
|
|
2887
|
+
/* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2886
2888
|
"button",
|
|
2887
2889
|
{
|
|
2888
2890
|
type: "button",
|
|
2889
|
-
onClick: (
|
|
2891
|
+
onClick: (x) => x.stopPropagation(),
|
|
2890
2892
|
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",
|
|
2891
2893
|
"aria-label": `${h.noun === "report" ? "Report" : "Briefing"} actions`,
|
|
2892
|
-
children: /* @__PURE__ */ e(
|
|
2894
|
+
children: /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" })
|
|
2893
2895
|
}
|
|
2894
2896
|
) }),
|
|
2895
|
-
/* @__PURE__ */ r(
|
|
2896
|
-
/* @__PURE__ */ r(
|
|
2897
|
-
/* @__PURE__ */ e(
|
|
2897
|
+
/* @__PURE__ */ r(We, { align: "end", className: "w-44", children: [
|
|
2898
|
+
/* @__PURE__ */ r(G, { onClick: n, children: [
|
|
2899
|
+
/* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5" }),
|
|
2898
2900
|
"Edit ",
|
|
2899
2901
|
h.noun
|
|
2900
2902
|
] }),
|
|
2901
2903
|
/* @__PURE__ */ r(
|
|
2902
|
-
|
|
2904
|
+
G,
|
|
2903
2905
|
{
|
|
2904
|
-
onClick: (
|
|
2905
|
-
|
|
2906
|
+
onClick: (x) => {
|
|
2907
|
+
x.preventDefault(), i();
|
|
2906
2908
|
},
|
|
2907
2909
|
children: [
|
|
2908
2910
|
/* @__PURE__ */ e(Ir, { className: "h-3.5 w-3.5" }),
|
|
@@ -2911,12 +2913,12 @@ function un({
|
|
|
2911
2913
|
}
|
|
2912
2914
|
),
|
|
2913
2915
|
t.scheduleExpr ? /* @__PURE__ */ e(
|
|
2914
|
-
|
|
2916
|
+
G,
|
|
2915
2917
|
{
|
|
2916
|
-
onClick: (
|
|
2917
|
-
|
|
2918
|
+
onClick: (x) => {
|
|
2919
|
+
x.preventDefault(), s();
|
|
2918
2920
|
},
|
|
2919
|
-
children:
|
|
2921
|
+
children: p ? /* @__PURE__ */ r(W, { children: [
|
|
2920
2922
|
/* @__PURE__ */ e(Fr, { className: "h-3.5 w-3.5" }),
|
|
2921
2923
|
"Resume"
|
|
2922
2924
|
] }) : /* @__PURE__ */ r(W, { children: [
|
|
@@ -2925,16 +2927,16 @@ function un({
|
|
|
2925
2927
|
] })
|
|
2926
2928
|
}
|
|
2927
2929
|
) : null,
|
|
2928
|
-
/* @__PURE__ */ e(
|
|
2930
|
+
/* @__PURE__ */ e(Me, {}),
|
|
2929
2931
|
/* @__PURE__ */ r(
|
|
2930
|
-
|
|
2932
|
+
G,
|
|
2931
2933
|
{
|
|
2932
|
-
onClick: (
|
|
2933
|
-
|
|
2934
|
+
onClick: (x) => {
|
|
2935
|
+
x.preventDefault(), d();
|
|
2934
2936
|
},
|
|
2935
2937
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
2936
2938
|
children: [
|
|
2937
|
-
/* @__PURE__ */ e(
|
|
2939
|
+
/* @__PURE__ */ e(Pe, { className: "h-3.5 w-3.5" }),
|
|
2938
2940
|
"Delete ",
|
|
2939
2941
|
h.noun
|
|
2940
2942
|
]
|
|
@@ -2953,24 +2955,24 @@ function pn(t) {
|
|
|
2953
2955
|
function fn(t) {
|
|
2954
2956
|
return t === "This dashboard" ? "Watch this dashboard" : `Watch ${t}`;
|
|
2955
2957
|
}
|
|
2956
|
-
function gn(t, a,
|
|
2958
|
+
function gn(t, a, o) {
|
|
2957
2959
|
return a !== "dashboard" ? t : t.filter(
|
|
2958
|
-
(
|
|
2960
|
+
(n) => n.source.type === "dashboard" && n.source.dashboardId === o
|
|
2959
2961
|
);
|
|
2960
2962
|
}
|
|
2961
2963
|
async function bn(t) {
|
|
2962
|
-
const
|
|
2963
|
-
let
|
|
2964
|
-
for (;
|
|
2965
|
-
const
|
|
2964
|
+
const o = [];
|
|
2965
|
+
let n = 1, i = 0, s = Number.POSITIVE_INFINITY;
|
|
2966
|
+
for (; i < s; ) {
|
|
2967
|
+
const d = await t.apiClient.listBriefings(
|
|
2966
2968
|
t.apiServiceUrl,
|
|
2967
2969
|
t.token,
|
|
2968
|
-
{ scope: "organization", page:
|
|
2970
|
+
{ scope: "organization", page: n, pageSize: 100 }
|
|
2969
2971
|
);
|
|
2970
|
-
if (
|
|
2971
|
-
|
|
2972
|
+
if (o.push(...d.briefings), i += d.briefings.length, s = d.total, d.briefings.length === 0 || i >= s) break;
|
|
2973
|
+
n += 1;
|
|
2972
2974
|
}
|
|
2973
|
-
return
|
|
2975
|
+
return o;
|
|
2974
2976
|
}
|
|
2975
2977
|
const xn = {
|
|
2976
2978
|
listBriefings: Or,
|
|
@@ -2983,35 +2985,35 @@ const xn = {
|
|
|
2983
2985
|
function vn({
|
|
2984
2986
|
briefingId: t,
|
|
2985
2987
|
initialRun: a,
|
|
2986
|
-
apiServiceUrl:
|
|
2987
|
-
token:
|
|
2988
|
-
onTerminal:
|
|
2989
|
-
onTimeout:
|
|
2990
|
-
onExpand:
|
|
2988
|
+
apiServiceUrl: o,
|
|
2989
|
+
token: n,
|
|
2990
|
+
onTerminal: i,
|
|
2991
|
+
onTimeout: s,
|
|
2992
|
+
onExpand: d
|
|
2991
2993
|
}) {
|
|
2992
|
-
const [
|
|
2993
|
-
apiServiceUrl:
|
|
2994
|
-
token:
|
|
2994
|
+
const [p, l] = E(a), { startRun: u } = Kr({
|
|
2995
|
+
apiServiceUrl: o,
|
|
2996
|
+
token: n,
|
|
2995
2997
|
intervalMs: hn,
|
|
2996
2998
|
timeoutMs: mn,
|
|
2997
2999
|
fetchRun: ({
|
|
2998
|
-
apiServiceUrl:
|
|
3000
|
+
apiServiceUrl: m,
|
|
2999
3001
|
token: h,
|
|
3000
|
-
runId:
|
|
3001
|
-
}) => qr(
|
|
3002
|
-
onRun: (
|
|
3003
|
-
l(
|
|
3002
|
+
runId: f
|
|
3003
|
+
}) => qr(m, h, t, f),
|
|
3004
|
+
onRun: (m) => {
|
|
3005
|
+
l(m);
|
|
3004
3006
|
},
|
|
3005
|
-
onTerminalRun: (
|
|
3006
|
-
|
|
3007
|
+
onTerminalRun: (m) => {
|
|
3008
|
+
i(m);
|
|
3007
3009
|
},
|
|
3008
3010
|
onTimeout: () => {
|
|
3009
|
-
|
|
3011
|
+
s();
|
|
3010
3012
|
}
|
|
3011
|
-
}),
|
|
3012
|
-
return
|
|
3013
|
-
|
|
3014
|
-
}, [a,
|
|
3013
|
+
}), c = he(!1);
|
|
3014
|
+
return Q(() => {
|
|
3015
|
+
c.current || (c.current = !0, Xr(a.status) ? u(a) : Zr(a.status) && i(a));
|
|
3016
|
+
}, [a, i, u]), /* @__PURE__ */ e(Qr, { run: p, onExpand: d });
|
|
3015
3017
|
}
|
|
3016
3018
|
function Xn(t) {
|
|
3017
3019
|
return /* @__PURE__ */ e(Br, { children: /* @__PURE__ */ e(yn, { ...t }) });
|
|
@@ -3019,47 +3021,47 @@ function Xn(t) {
|
|
|
3019
3021
|
function yn({
|
|
3020
3022
|
dashboardId: t,
|
|
3021
3023
|
dashboardTitle: a,
|
|
3022
|
-
apiServiceUrl:
|
|
3023
|
-
token:
|
|
3024
|
-
disabled:
|
|
3025
|
-
className:
|
|
3026
|
-
manageBriefingsHref:
|
|
3027
|
-
open:
|
|
3024
|
+
apiServiceUrl: o,
|
|
3025
|
+
token: n,
|
|
3026
|
+
disabled: i,
|
|
3027
|
+
className: s,
|
|
3028
|
+
manageBriefingsHref: d,
|
|
3029
|
+
open: p,
|
|
3028
3030
|
onOpenChange: l,
|
|
3029
|
-
hideTrigger:
|
|
3030
|
-
workflowIntent:
|
|
3031
|
-
client:
|
|
3031
|
+
hideTrigger: u = !1,
|
|
3032
|
+
workflowIntent: c,
|
|
3033
|
+
client: m
|
|
3032
3034
|
}) {
|
|
3033
|
-
const { authToken: h, tokenProps:
|
|
3034
|
-
|
|
3035
|
-
}, [S,
|
|
3036
|
-
|
|
3037
|
-
), [U,
|
|
3038
|
-
|
|
3039
|
-
), [
|
|
3035
|
+
const { authToken: h, tokenProps: f } = He(), x = Tr(), C = !c || x.canCreate && (c === "scheduled_report" || x.analyticalBriefingsEnabled), [N, I] = E(!1), D = p ?? N, b = (w) => {
|
|
3036
|
+
p === void 0 && I(w), l == null || l(w);
|
|
3037
|
+
}, [S, A] = E(
|
|
3038
|
+
c ? "author" : "list"
|
|
3039
|
+
), [U, g] = E(
|
|
3040
|
+
c ?? "analytical_briefing"
|
|
3041
|
+
), [v, T] = E("dashboard"), [F, H] = E(
|
|
3040
3042
|
[]
|
|
3041
|
-
), [
|
|
3043
|
+
), [k, V] = E(null), $ = c && !C && !k ? "list" : S, [xe, re] = E(!1), [oe, Ie] = E(null), [Fe, ie] = E(null), [j, Y] = E(
|
|
3042
3044
|
null
|
|
3043
|
-
), [
|
|
3044
|
-
|
|
3045
|
-
const w =
|
|
3046
|
-
|
|
3047
|
-
}, [
|
|
3048
|
-
const [
|
|
3045
|
+
), [le, J] = E(null), Le = he(null), ve = he(D);
|
|
3046
|
+
Q(() => {
|
|
3047
|
+
const w = D && !ve.current;
|
|
3048
|
+
ve.current = D, !(!w || !c) && (V(null), T("dashboard"), g(c), A("author"), J(null));
|
|
3049
|
+
}, [D, c]);
|
|
3050
|
+
const [de, me] = E(
|
|
3049
3051
|
null
|
|
3050
|
-
), [
|
|
3052
|
+
), [Z, ye] = E(null), _ = o ?? (f == null ? void 0 : f.apiServiceUrl), z = n ?? (h == null ? void 0 : h.accessToken), ne = ee(() => ({ ...xn, ...m }), [m]), pe = pn(a), Be = ee(() => {
|
|
3051
3053
|
const w = gn(
|
|
3052
3054
|
F,
|
|
3053
|
-
|
|
3055
|
+
v,
|
|
3054
3056
|
t
|
|
3055
3057
|
);
|
|
3056
|
-
if (!
|
|
3058
|
+
if (!c)
|
|
3057
3059
|
return w;
|
|
3058
|
-
const R =
|
|
3060
|
+
const R = c === "scheduled_report" ? "report" : "briefing";
|
|
3059
3061
|
return w.filter(
|
|
3060
|
-
(
|
|
3062
|
+
(Te) => se(Te).noun === R
|
|
3061
3063
|
);
|
|
3062
|
-
}, [t, F,
|
|
3064
|
+
}, [t, F, v, c]), Ke = ee(() => v === "dashboard" ? {
|
|
3063
3065
|
source: { type: "dashboard", dashboardId: t },
|
|
3064
3066
|
label: pe,
|
|
3065
3067
|
detail: fn(pe)
|
|
@@ -3067,167 +3069,167 @@ function yn({
|
|
|
3067
3069
|
source: { type: "project" },
|
|
3068
3070
|
label: "This project",
|
|
3069
3071
|
detail: "Use any data in this project."
|
|
3070
|
-
}, [t, pe,
|
|
3071
|
-
canCreate:
|
|
3072
|
-
analyticalBriefingsEnabled:
|
|
3073
|
-
scheduledReportAvailable:
|
|
3074
|
-
}),
|
|
3075
|
-
if (!(!_ ||
|
|
3076
|
-
|
|
3072
|
+
}, [t, pe, v]), Ce = !!(_ && z), we = ga({
|
|
3073
|
+
canCreate: x.canCreate,
|
|
3074
|
+
analyticalBriefingsEnabled: x.analyticalBriefingsEnabled,
|
|
3075
|
+
scheduledReportAvailable: v === "dashboard"
|
|
3076
|
+
}), X = K(async () => {
|
|
3077
|
+
if (!(!_ || !z)) {
|
|
3078
|
+
re(!0), J(null);
|
|
3077
3079
|
try {
|
|
3078
3080
|
H(
|
|
3079
3081
|
await bn({
|
|
3080
3082
|
apiClient: ne,
|
|
3081
3083
|
apiServiceUrl: _,
|
|
3082
|
-
token:
|
|
3084
|
+
token: z
|
|
3083
3085
|
})
|
|
3084
3086
|
);
|
|
3085
3087
|
} catch (w) {
|
|
3086
|
-
|
|
3088
|
+
J(
|
|
3087
3089
|
w instanceof Error ? w.message : "Could not load briefings."
|
|
3088
3090
|
);
|
|
3089
3091
|
} finally {
|
|
3090
|
-
|
|
3092
|
+
re(!1);
|
|
3091
3093
|
}
|
|
3092
3094
|
}
|
|
3093
|
-
}, [ne, _,
|
|
3094
|
-
|
|
3095
|
-
!
|
|
3096
|
-
}, [
|
|
3097
|
-
const
|
|
3098
|
-
V(null), T("dashboard"),
|
|
3099
|
-
},
|
|
3100
|
-
V(null),
|
|
3101
|
-
},
|
|
3102
|
-
if (!(!_ ||
|
|
3103
|
-
|
|
3095
|
+
}, [ne, _, z]);
|
|
3096
|
+
Q(() => {
|
|
3097
|
+
!D || $ !== "list" || !Ce || X();
|
|
3098
|
+
}, [Ce, $, X, D]);
|
|
3099
|
+
const Ne = () => {
|
|
3100
|
+
V(null), T("dashboard"), A("list"), b(!0);
|
|
3101
|
+
}, y = (w) => {
|
|
3102
|
+
V(null), g(w), A("author");
|
|
3103
|
+
}, L = async (w) => {
|
|
3104
|
+
if (!(!_ || !z)) {
|
|
3105
|
+
Ie(w), J(null);
|
|
3104
3106
|
try {
|
|
3105
3107
|
const R = await ne.getBriefing(
|
|
3106
3108
|
_,
|
|
3107
|
-
|
|
3109
|
+
z,
|
|
3108
3110
|
w
|
|
3109
3111
|
);
|
|
3110
|
-
V(R.briefing),
|
|
3112
|
+
V(R.briefing), A("author");
|
|
3111
3113
|
} catch (R) {
|
|
3112
|
-
|
|
3114
|
+
J(
|
|
3113
3115
|
R instanceof Error ? R.message : "Could not open briefing."
|
|
3114
3116
|
);
|
|
3115
3117
|
} finally {
|
|
3116
|
-
|
|
3118
|
+
Ie(null);
|
|
3117
3119
|
}
|
|
3118
3120
|
}
|
|
3119
|
-
},
|
|
3120
|
-
if (!(!_ ||
|
|
3121
|
-
|
|
3121
|
+
}, M = async (w) => {
|
|
3122
|
+
if (!(!_ || !z)) {
|
|
3123
|
+
ie(w.id);
|
|
3122
3124
|
try {
|
|
3123
3125
|
await ne.runBriefingNow(
|
|
3124
3126
|
_,
|
|
3125
|
-
|
|
3127
|
+
z,
|
|
3126
3128
|
w.id,
|
|
3127
3129
|
{ requestId: Cn() }
|
|
3128
|
-
),
|
|
3130
|
+
), X();
|
|
3129
3131
|
} catch (R) {
|
|
3130
3132
|
O.error(
|
|
3131
3133
|
R instanceof Error ? R.message : "Could not start the run."
|
|
3132
3134
|
);
|
|
3133
3135
|
} finally {
|
|
3134
|
-
|
|
3136
|
+
ie(null);
|
|
3135
3137
|
}
|
|
3136
3138
|
}
|
|
3137
|
-
},
|
|
3138
|
-
if (!_ ||
|
|
3139
|
-
const { noun: R } = se(w),
|
|
3140
|
-
|
|
3139
|
+
}, ae = async (w) => {
|
|
3140
|
+
if (!_ || !z) return;
|
|
3141
|
+
const { noun: R } = se(w), Te = R === "report" ? "Report" : "Briefing";
|
|
3142
|
+
ie(w.id);
|
|
3141
3143
|
try {
|
|
3142
|
-
const
|
|
3144
|
+
const Ve = w.status === "PAUSED" ? await ne.resumeBriefing(
|
|
3143
3145
|
_,
|
|
3144
|
-
|
|
3146
|
+
z,
|
|
3145
3147
|
w.id
|
|
3146
3148
|
) : await ne.pauseBriefing(
|
|
3147
3149
|
_,
|
|
3148
|
-
|
|
3150
|
+
z,
|
|
3149
3151
|
w.id
|
|
3150
3152
|
);
|
|
3151
3153
|
O.success(
|
|
3152
|
-
|
|
3153
|
-
),
|
|
3154
|
-
} catch (
|
|
3154
|
+
Ve.briefing.status === "PAUSED" ? `${Te} paused` : `${Te} resumed`
|
|
3155
|
+
), X();
|
|
3156
|
+
} catch (Ve) {
|
|
3155
3157
|
O.error(
|
|
3156
|
-
|
|
3158
|
+
Ve instanceof Error ? Ve.message : `Could not update the ${R} status.`
|
|
3157
3159
|
);
|
|
3158
3160
|
} finally {
|
|
3159
|
-
|
|
3161
|
+
ie(null);
|
|
3160
3162
|
}
|
|
3161
|
-
},
|
|
3162
|
-
if (!
|
|
3163
|
-
const w =
|
|
3164
|
-
|
|
3163
|
+
}, ce = async () => {
|
|
3164
|
+
if (!j || !_ || !z) return;
|
|
3165
|
+
const w = j;
|
|
3166
|
+
ie(w.id);
|
|
3165
3167
|
try {
|
|
3166
3168
|
await ne.deleteBriefing(
|
|
3167
3169
|
_,
|
|
3168
|
-
|
|
3170
|
+
z,
|
|
3169
3171
|
w.id
|
|
3170
3172
|
);
|
|
3171
3173
|
const { noun: R } = se(w);
|
|
3172
|
-
O.success(`${R === "report" ? "Report" : "Briefing"} deleted`),
|
|
3174
|
+
O.success(`${R === "report" ? "Report" : "Briefing"} deleted`), Y(null), X();
|
|
3173
3175
|
} catch (R) {
|
|
3174
3176
|
O.error(
|
|
3175
3177
|
R instanceof Error ? R.message : "Could not delete the briefing."
|
|
3176
3178
|
);
|
|
3177
3179
|
} finally {
|
|
3178
|
-
|
|
3180
|
+
ie(null);
|
|
3179
3181
|
}
|
|
3180
|
-
},
|
|
3181
|
-
return
|
|
3182
|
-
|
|
3182
|
+
}, jt = Be.length;
|
|
3183
|
+
return x.surfaceVisible ? /* @__PURE__ */ r(_r, { open: D, onOpenChange: b, children: [
|
|
3184
|
+
u ? null : /* @__PURE__ */ e(
|
|
3183
3185
|
Ja,
|
|
3184
3186
|
{
|
|
3185
|
-
disabled:
|
|
3186
|
-
briefingCount:
|
|
3187
|
-
className:
|
|
3188
|
-
onClick:
|
|
3187
|
+
disabled: i || !Ce,
|
|
3188
|
+
briefingCount: jt,
|
|
3189
|
+
className: s,
|
|
3190
|
+
onClick: Ne
|
|
3189
3191
|
}
|
|
3190
3192
|
),
|
|
3191
3193
|
/* @__PURE__ */ r(
|
|
3192
|
-
|
|
3194
|
+
zr,
|
|
3193
3195
|
{
|
|
3194
|
-
ref:
|
|
3196
|
+
ref: Le,
|
|
3195
3197
|
side: "right",
|
|
3196
3198
|
hideClose: !0,
|
|
3197
3199
|
className: "flex h-full w-full flex-col overflow-hidden p-0 outline-none sm:max-w-[560px]",
|
|
3198
3200
|
onOpenAutoFocus: (w) => {
|
|
3199
3201
|
var R;
|
|
3200
|
-
w.preventDefault(), (R =
|
|
3202
|
+
w.preventDefault(), (R = Le.current) == null || R.focus({ preventScroll: !0 });
|
|
3201
3203
|
},
|
|
3202
3204
|
children: [
|
|
3203
3205
|
/* @__PURE__ */ r($r, { className: "sr-only", children: [
|
|
3204
3206
|
/* @__PURE__ */ e(jr, { children: "Reports & briefings" }),
|
|
3205
3207
|
/* @__PURE__ */ e(Wr, { children: "Manage reports and briefings for this dashboard." })
|
|
3206
3208
|
] }),
|
|
3207
|
-
|
|
3209
|
+
c ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
|
|
3208
3210
|
/* @__PURE__ */ r(
|
|
3209
3211
|
"div",
|
|
3210
3212
|
{
|
|
3211
3213
|
className: "flex items-center gap-5",
|
|
3212
3214
|
role: "tablist",
|
|
3213
|
-
"aria-label":
|
|
3215
|
+
"aria-label": c === "scheduled_report" ? "Email report workflow" : "Analytical briefing workflow",
|
|
3214
3216
|
children: [
|
|
3215
3217
|
/* @__PURE__ */ e(
|
|
3216
3218
|
"button",
|
|
3217
3219
|
{
|
|
3218
3220
|
type: "button",
|
|
3219
3221
|
role: "tab",
|
|
3220
|
-
"aria-selected":
|
|
3221
|
-
disabled: !
|
|
3222
|
-
className:
|
|
3222
|
+
"aria-selected": $ === "author",
|
|
3223
|
+
disabled: !C,
|
|
3224
|
+
className: q(
|
|
3223
3225
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3224
|
-
|
|
3225
|
-
!
|
|
3226
|
+
$ === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
|
|
3227
|
+
!C && "cursor-not-allowed opacity-50"
|
|
3226
3228
|
),
|
|
3227
3229
|
onClick: () => {
|
|
3228
|
-
|
|
3230
|
+
C && (V(null), g(c), T("dashboard"), A("author"));
|
|
3229
3231
|
},
|
|
3230
|
-
children:
|
|
3232
|
+
children: k ? `Edit ${se(k).noun}` : c === "scheduled_report" ? "Schedule report" : "Create briefing"
|
|
3231
3233
|
}
|
|
3232
3234
|
),
|
|
3233
3235
|
/* @__PURE__ */ e(
|
|
@@ -3235,13 +3237,13 @@ function yn({
|
|
|
3235
3237
|
{
|
|
3236
3238
|
type: "button",
|
|
3237
3239
|
role: "tab",
|
|
3238
|
-
"aria-selected":
|
|
3239
|
-
className:
|
|
3240
|
+
"aria-selected": $ === "list",
|
|
3241
|
+
className: q(
|
|
3240
3242
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3241
|
-
|
|
3243
|
+
$ === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3242
3244
|
),
|
|
3243
|
-
onClick: () =>
|
|
3244
|
-
children:
|
|
3245
|
+
onClick: () => A("list"),
|
|
3246
|
+
children: c === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
3245
3247
|
}
|
|
3246
3248
|
)
|
|
3247
3249
|
]
|
|
@@ -3251,147 +3253,147 @@ function yn({
|
|
|
3251
3253
|
"button",
|
|
3252
3254
|
{
|
|
3253
3255
|
type: "button",
|
|
3254
|
-
onClick: () =>
|
|
3256
|
+
onClick: () => b(!1),
|
|
3255
3257
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3256
|
-
"aria-label":
|
|
3257
|
-
children: /* @__PURE__ */ e(
|
|
3258
|
+
"aria-label": c === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
|
|
3259
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-3.5 w-3.5" })
|
|
3258
3260
|
}
|
|
3259
3261
|
)
|
|
3260
3262
|
] }) : null,
|
|
3261
|
-
|
|
3263
|
+
$ === "list" ? /* @__PURE__ */ e(
|
|
3262
3264
|
ln,
|
|
3263
3265
|
{
|
|
3264
|
-
briefings:
|
|
3266
|
+
briefings: Be,
|
|
3265
3267
|
dashboardLabel: pe,
|
|
3266
|
-
sourceView:
|
|
3267
|
-
error:
|
|
3268
|
+
sourceView: v,
|
|
3269
|
+
error: le,
|
|
3268
3270
|
loading: xe,
|
|
3269
3271
|
onSourceViewChange: T,
|
|
3270
|
-
onClose: () =>
|
|
3272
|
+
onClose: () => b(!1),
|
|
3271
3273
|
onEdit: (w) => {
|
|
3272
|
-
|
|
3274
|
+
L(w);
|
|
3273
3275
|
},
|
|
3274
|
-
onNew:
|
|
3275
|
-
canCreate: !
|
|
3276
|
-
canCreateScheduledReport:
|
|
3276
|
+
onNew: y,
|
|
3277
|
+
canCreate: !c && we.length > 0,
|
|
3278
|
+
canCreateScheduledReport: we.includes(
|
|
3277
3279
|
"scheduled_report"
|
|
3278
3280
|
),
|
|
3279
|
-
analyticalBriefingsEnabled:
|
|
3281
|
+
analyticalBriefingsEnabled: we.includes(
|
|
3280
3282
|
"analytical_briefing"
|
|
3281
3283
|
),
|
|
3282
3284
|
onRunNow: (w) => {
|
|
3283
|
-
|
|
3285
|
+
M(w);
|
|
3284
3286
|
},
|
|
3285
3287
|
onTogglePause: (w) => {
|
|
3286
|
-
|
|
3288
|
+
ae(w);
|
|
3287
3289
|
},
|
|
3288
|
-
onDelete: (w) =>
|
|
3289
|
-
selectingId:
|
|
3290
|
-
busyId:
|
|
3291
|
-
manageBriefingsHref:
|
|
3292
|
-
contentKind:
|
|
3293
|
-
hideHeader: !!
|
|
3290
|
+
onDelete: (w) => Y(w),
|
|
3291
|
+
selectingId: oe,
|
|
3292
|
+
busyId: Fe,
|
|
3293
|
+
manageBriefingsHref: d,
|
|
3294
|
+
contentKind: c === "scheduled_report" ? "reports" : c === "analytical_briefing" ? "briefings" : void 0,
|
|
3295
|
+
hideHeader: !!c
|
|
3294
3296
|
}
|
|
3295
3297
|
) : /* @__PURE__ */ e(
|
|
3296
3298
|
Hr,
|
|
3297
3299
|
{
|
|
3298
3300
|
apiServiceUrl: _,
|
|
3299
|
-
token:
|
|
3300
|
-
briefing:
|
|
3301
|
+
token: z,
|
|
3302
|
+
briefing: k,
|
|
3301
3303
|
intent: U,
|
|
3302
|
-
sourceContext:
|
|
3303
|
-
title:
|
|
3304
|
-
hideHeader: !!
|
|
3304
|
+
sourceContext: k ? void 0 : Ke,
|
|
3305
|
+
title: k ? `Edit ${se(k).noun}` : U === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
|
|
3306
|
+
hideHeader: !!c,
|
|
3305
3307
|
className: "h-full min-h-0 max-w-none border-0 shadow-none",
|
|
3306
|
-
onBack:
|
|
3307
|
-
onCancel: () =>
|
|
3308
|
+
onBack: c ? void 0 : () => A("list"),
|
|
3309
|
+
onCancel: () => b(!1),
|
|
3308
3310
|
onDeleted: () => {
|
|
3309
|
-
const w =
|
|
3310
|
-
O.success(`${w === "report" ? "Report" : "Briefing"} deleted`), V(null),
|
|
3311
|
+
const w = k ? se(k).noun : "briefing";
|
|
3312
|
+
O.success(`${w === "report" ? "Report" : "Briefing"} deleted`), V(null), A("list"), X();
|
|
3311
3313
|
},
|
|
3312
3314
|
onRunStarted: () => {
|
|
3313
3315
|
},
|
|
3314
3316
|
onSaved: (w) => {
|
|
3315
|
-
V(w),
|
|
3317
|
+
V(w), X();
|
|
3316
3318
|
},
|
|
3317
3319
|
onMinimizeRun: ({ briefing: w, run: R }) => {
|
|
3318
|
-
me({ briefing: w, run: R }),
|
|
3320
|
+
me({ briefing: w, run: R }), b(!1);
|
|
3319
3321
|
}
|
|
3320
3322
|
}
|
|
3321
3323
|
)
|
|
3322
3324
|
]
|
|
3323
3325
|
}
|
|
3324
3326
|
),
|
|
3325
|
-
|
|
3327
|
+
de && _ && z ? /* @__PURE__ */ e(
|
|
3326
3328
|
vn,
|
|
3327
3329
|
{
|
|
3328
|
-
briefingId:
|
|
3329
|
-
initialRun:
|
|
3330
|
+
briefingId: de.briefing.id,
|
|
3331
|
+
initialRun: de.run,
|
|
3330
3332
|
apiServiceUrl: _,
|
|
3331
|
-
token:
|
|
3333
|
+
token: z,
|
|
3332
3334
|
onTerminal: (w) => {
|
|
3333
|
-
|
|
3334
|
-
briefing:
|
|
3335
|
+
ye({
|
|
3336
|
+
briefing: de.briefing,
|
|
3335
3337
|
run: w
|
|
3336
|
-
}), me(null),
|
|
3338
|
+
}), me(null), X();
|
|
3337
3339
|
},
|
|
3338
3340
|
onTimeout: () => {
|
|
3339
|
-
me(null),
|
|
3341
|
+
me(null), X();
|
|
3340
3342
|
},
|
|
3341
3343
|
onExpand: () => {
|
|
3342
|
-
V(
|
|
3344
|
+
V(de.briefing), A("author"), me(null), b(!0);
|
|
3343
3345
|
}
|
|
3344
3346
|
}
|
|
3345
3347
|
) : null,
|
|
3346
|
-
|
|
3348
|
+
Z ? /* @__PURE__ */ e("div", { className: "fixed bottom-4 right-4 z-50 w-[360px]", children: /* @__PURE__ */ e(
|
|
3347
3349
|
Gr,
|
|
3348
3350
|
{
|
|
3349
|
-
title:
|
|
3350
|
-
durationSeconds:
|
|
3351
|
+
title: Z.run.status === "SUCCESS" ? `${Z.briefing.name} is ready` : `${Z.briefing.name} run failed`,
|
|
3352
|
+
durationSeconds: Z.run.startedAt && Z.run.completedAt ? Math.max(
|
|
3351
3353
|
0,
|
|
3352
3354
|
Math.floor(
|
|
3353
|
-
(new Date(
|
|
3355
|
+
(new Date(Z.run.completedAt).getTime() - new Date(Z.run.startedAt).getTime()) / 1e3
|
|
3354
3356
|
)
|
|
3355
3357
|
) : null,
|
|
3356
|
-
status:
|
|
3358
|
+
status: Z.run.status === "SUCCESS" ? "success" : "failed",
|
|
3357
3359
|
onView: () => {
|
|
3358
|
-
V(
|
|
3360
|
+
V(Z.briefing), A("author"), ye(null), b(!0);
|
|
3359
3361
|
},
|
|
3360
|
-
onDismiss: () =>
|
|
3362
|
+
onDismiss: () => ye(null)
|
|
3361
3363
|
}
|
|
3362
3364
|
) }) : null,
|
|
3363
3365
|
/* @__PURE__ */ e(
|
|
3364
|
-
|
|
3366
|
+
tt,
|
|
3365
3367
|
{
|
|
3366
|
-
open: !!
|
|
3368
|
+
open: !!j,
|
|
3367
3369
|
onOpenChange: (w) => {
|
|
3368
|
-
w ||
|
|
3370
|
+
w || Y(null);
|
|
3369
3371
|
},
|
|
3370
|
-
children: /* @__PURE__ */ r(
|
|
3371
|
-
/* @__PURE__ */ r(
|
|
3372
|
-
/* @__PURE__ */ r(
|
|
3372
|
+
children: /* @__PURE__ */ r(rt, { children: [
|
|
3373
|
+
/* @__PURE__ */ r(at, { children: [
|
|
3374
|
+
/* @__PURE__ */ r(nt, { children: [
|
|
3373
3375
|
"Delete",
|
|
3374
3376
|
" ",
|
|
3375
|
-
|
|
3377
|
+
j ? se(j).noun : "briefing",
|
|
3376
3378
|
"?"
|
|
3377
3379
|
] }),
|
|
3378
|
-
/* @__PURE__ */ r(
|
|
3380
|
+
/* @__PURE__ */ r(st, { children: [
|
|
3379
3381
|
"This permanently deletes ",
|
|
3380
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3382
|
+
/* @__PURE__ */ e("strong", { children: j == null ? void 0 : j.name }),
|
|
3381
3383
|
". Recipients will stop receiving it."
|
|
3382
3384
|
] })
|
|
3383
3385
|
] }),
|
|
3384
|
-
/* @__PURE__ */ r(
|
|
3385
|
-
/* @__PURE__ */ e(
|
|
3386
|
+
/* @__PURE__ */ r(ot, { children: [
|
|
3387
|
+
/* @__PURE__ */ e(it, { children: "Cancel" }),
|
|
3386
3388
|
/* @__PURE__ */ r(
|
|
3387
|
-
|
|
3389
|
+
St,
|
|
3388
3390
|
{
|
|
3389
3391
|
className: "bg-destructive/90 hover:bg-destructive",
|
|
3390
|
-
onClick:
|
|
3392
|
+
onClick: ce,
|
|
3391
3393
|
children: [
|
|
3392
3394
|
"Delete",
|
|
3393
3395
|
" ",
|
|
3394
|
-
|
|
3396
|
+
j ? se(j).noun : "briefing"
|
|
3395
3397
|
]
|
|
3396
3398
|
}
|
|
3397
3399
|
)
|
|
@@ -3406,11 +3408,11 @@ function Cn() {
|
|
|
3406
3408
|
}
|
|
3407
3409
|
export {
|
|
3408
3410
|
jn as A,
|
|
3409
|
-
|
|
3411
|
+
za as D,
|
|
3410
3412
|
Oa as E,
|
|
3411
3413
|
Kn as N,
|
|
3412
3414
|
Wn as U,
|
|
3413
|
-
|
|
3415
|
+
zn as V,
|
|
3414
3416
|
Ja as W,
|
|
3415
3417
|
$n as a,
|
|
3416
3418
|
Ma as b,
|