react-semaphor 0.1.284 → 0.1.286
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-controls-4pDdG3me.js → dashboard-controls-ItYogy_p.js} +4 -4
- package/dist/chunks/{dashboard-controls-Dhry2k8x.js → dashboard-controls-L0PZjJCt.js} +318 -341
- package/dist/chunks/dashboard-filter-controls-button-BBM66Kjx.js +1107 -0
- package/dist/chunks/dashboard-filter-controls-button-C0aCuD2T.js +11 -0
- package/dist/chunks/{dashboard-json-CYnf5rdp.js → dashboard-json-BQ-vAiN1.js} +1 -1
- package/dist/chunks/{dashboard-json-D-KsLEGl.js → dashboard-json-DVGKEKGc.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-B4jsBFro.js → dashboard-summary-settings-dialog-DlXqW4ur.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-Cn4-fB2h.js → dashboard-summary-settings-dialog-jRhWndnZ.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BQnApBvr.js → edit-dashboard-visual-BFIX635s.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-BDIt_S2F.js → edit-dashboard-visual-DOyPqIRy.js} +4 -4
- package/dist/chunks/{index-DBuN9Zf6.js → index-5fuOmhsI.js} +170 -170
- package/dist/chunks/{index-y1uW2fuZ.js → index-BJLFSwZr.js} +10190 -10214
- package/dist/chunks/resource-management-panel-DMIhpLZ1.js +933 -0
- package/dist/chunks/resource-management-panel-DPJ6MzLA.js +6 -0
- package/dist/chunks/{use-create-flow-overlay-state-Cr9AFdXx.js → use-create-flow-overlay-state-BU00QaON.js} +142 -145
- package/dist/chunks/use-create-flow-overlay-state-CvuLpw1f.js +21 -0
- package/dist/chunks/{use-visual-utils-DNp8XO6G.js → use-visual-utils-DUV4E_sx.js} +1 -1
- package/dist/chunks/{use-visual-utils-Ccmzx7-m.js → use-visual-utils-DlwYqcbg.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/main.d.ts +18 -2
- package/package.json +1 -1
- package/dist/chunks/dashboard-filter-controls-button-BZXrmJP2.js +0 -1072
- package/dist/chunks/dashboard-filter-controls-button-DEUvxIWD.js +0 -11
- package/dist/chunks/resource-management-panel-BC-cvjI9.js +0 -920
- package/dist/chunks/resource-management-panel-PSvKnmq5.js +0 -6
- package/dist/chunks/use-create-flow-overlay-state-COe7Ekru.js +0 -21
|
@@ -1,1072 +0,0 @@
|
|
|
1
|
-
import ge, { useState as F, useRef as z, useCallback as V, useEffect as T, useContext as be } from "react";
|
|
2
|
-
import { bM as Z, b as $, aC as U, bJ as _, bF as ee, bG as j, aD as te, bE as Ce, d as ae, e as se, f as re, g as oe, h as ne, L as G, I as we, d8 as ye, v as xe, B as I, w as H, U as R, J as Ne, u as B, K as De, N as X, d9 as Ae, da as K, x as P, b_ as ie, af as Se, c as L, cC as le, cD as de, a6 as ce, cF as ue, cG as M, s as Ee, cK as Ie, ct as Le, M as Fe, db as Te, dc as ke, dd as Ue, cS as Me, cT as Ve, cU as Pe, cV as Be, cW as Oe, cX as ze, cY as Re, as as $e, bL as _e, X as je, de as He, df as Xe, cz as Ge, bH as W, a8 as Ke, aF as We, P as he, j as me, dg as qe, l as pe, dh as Je, di as Ye, dj as Qe, dk as Ze, dl as et, dm as fe, dn as q, dp as tt } from "./index-y1uW2fuZ.js";
|
|
3
|
-
import { jsx as t, jsxs as s, Fragment as O } from "react/jsx-runtime";
|
|
4
|
-
import { V as at, E as st, a as rt, b as ot, L as nt, c as it, d as lt, C as dt, u as ct, e as ut } from "./use-create-flow-overlay-state-Cr9AFdXx.js";
|
|
5
|
-
import { u as ve } from "./use-visual-utils-Ccmzx7-m.js";
|
|
6
|
-
import { k as J } from "./date-formatter-vkCj9Ct-.js";
|
|
7
|
-
/**
|
|
8
|
-
* @license lucide-react v0.453.0 - ISC
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the ISC license.
|
|
11
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/
|
|
13
|
-
const Y = Z("FileDown", [
|
|
14
|
-
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
15
|
-
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
16
|
-
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
17
|
-
["path", { d: "m9 15 3 3 3-3", key: "1npd3o" }]
|
|
18
|
-
]);
|
|
19
|
-
/**
|
|
20
|
-
* @license lucide-react v0.453.0 - ISC
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the ISC license.
|
|
23
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
|
-
const ht = Z("FilterX", [
|
|
26
|
-
["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
|
|
27
|
-
["path", { d: "m22 3-5 5", key: "12jva0" }],
|
|
28
|
-
["path", { d: "m17 3 5 5", key: "k36vhe" }]
|
|
29
|
-
]), mt = 1e4, pt = 15e3, ft = 3e4, vt = 3e4, gt = 12e4, Q = 2 * 60 * 60 * 1e3;
|
|
30
|
-
function bt(e) {
|
|
31
|
-
const a = Date.now() - e.getTime();
|
|
32
|
-
return a < vt ? mt : a < gt ? pt : ft;
|
|
33
|
-
}
|
|
34
|
-
function Tt() {
|
|
35
|
-
const { authToken: e, tokenProps: a } = $(), p = U((m) => m.activeExports), [d, c] = F(
|
|
36
|
-
typeof document < "u" ? !document.hidden : !0
|
|
37
|
-
), u = z(null), n = z(!1), l = z(void 0), h = a == null ? void 0 : a.apiServiceUrl, o = e == null ? void 0 : e.accessToken, v = V(() => {
|
|
38
|
-
const m = U.getState().activeExports;
|
|
39
|
-
return Array.from(m.values()).filter(
|
|
40
|
-
(C) => _(C.status)
|
|
41
|
-
);
|
|
42
|
-
}, []);
|
|
43
|
-
T(() => {
|
|
44
|
-
if (typeof document > "u") return;
|
|
45
|
-
const m = () => {
|
|
46
|
-
c(!document.hidden);
|
|
47
|
-
};
|
|
48
|
-
return document.addEventListener("visibilitychange", m), () => {
|
|
49
|
-
document.removeEventListener("visibilitychange", m);
|
|
50
|
-
};
|
|
51
|
-
}, []);
|
|
52
|
-
const b = V(async () => {
|
|
53
|
-
if (!h || !o) {
|
|
54
|
-
n.current = !1;
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const m = v();
|
|
58
|
-
if (m.length === 0) {
|
|
59
|
-
n.current = !1;
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const C = Date.now(), N = m.filter(
|
|
63
|
-
(r) => C - r.startedAt.getTime() > Q
|
|
64
|
-
);
|
|
65
|
-
if (N.length > 0) {
|
|
66
|
-
const { updateExport: r } = U.getState().actions;
|
|
67
|
-
for (const i of N)
|
|
68
|
-
r(i.id, {
|
|
69
|
-
status: "failed",
|
|
70
|
-
error: "Export timed out. Please try again or contact support.",
|
|
71
|
-
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
const f = m.filter(
|
|
75
|
-
(r) => C - r.startedAt.getTime() <= Q
|
|
76
|
-
);
|
|
77
|
-
if (f.length === 0) {
|
|
78
|
-
n.current = !1;
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const y = await Promise.allSettled(
|
|
82
|
-
f.map(async (r) => {
|
|
83
|
-
try {
|
|
84
|
-
const i = await ee(h, o, r.id);
|
|
85
|
-
let g;
|
|
86
|
-
if (i.status === "completed")
|
|
87
|
-
try {
|
|
88
|
-
g = await j(h, o, r.id);
|
|
89
|
-
} catch (E) {
|
|
90
|
-
console.error(
|
|
91
|
-
`[useExportPolling] Failed to get download URL for ${r.id}:`,
|
|
92
|
-
E
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
return {
|
|
96
|
-
id: r.id,
|
|
97
|
-
status: i.status,
|
|
98
|
-
progress: i.progress,
|
|
99
|
-
completedChunks: i.completedChunks,
|
|
100
|
-
completedAt: i.completedAt ? new Date(i.completedAt) : void 0,
|
|
101
|
-
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
102
|
-
fileSize: i.fileSize,
|
|
103
|
-
error: i.error,
|
|
104
|
-
downloadUrl: g
|
|
105
|
-
};
|
|
106
|
-
} catch (i) {
|
|
107
|
-
return console.error(
|
|
108
|
-
`[useExportPolling] Failed to poll export ${r.id}:`,
|
|
109
|
-
i
|
|
110
|
-
), null;
|
|
111
|
-
}
|
|
112
|
-
})
|
|
113
|
-
), { updateExport: S } = U.getState().actions;
|
|
114
|
-
for (const r of y)
|
|
115
|
-
r.status === "fulfilled" && r.value && S(r.value.id, r.value);
|
|
116
|
-
const w = v();
|
|
117
|
-
if (w.length > 0 && !document.hidden) {
|
|
118
|
-
const r = w.reduce(
|
|
119
|
-
(g, E) => E.startedAt < g ? E.startedAt : g,
|
|
120
|
-
w[0].startedAt
|
|
121
|
-
), i = bt(r);
|
|
122
|
-
u.current && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
123
|
-
var g;
|
|
124
|
-
(g = l.current) == null || g.call(l);
|
|
125
|
-
}, i);
|
|
126
|
-
} else
|
|
127
|
-
n.current = !1;
|
|
128
|
-
}, [h, o, v]);
|
|
129
|
-
return T(() => {
|
|
130
|
-
l.current = b;
|
|
131
|
-
}, [b]), T(() => {
|
|
132
|
-
var C;
|
|
133
|
-
v().length > 0 && d && !n.current && (n.current = !0, (C = l.current) == null || C.call(l));
|
|
134
|
-
}, [p, d, v]), T(() => {
|
|
135
|
-
var C;
|
|
136
|
-
const m = v();
|
|
137
|
-
d && m.length > 0 && !n.current && (n.current = !0, (C = l.current) == null || C.call(l));
|
|
138
|
-
}, [d, v]), T(() => {
|
|
139
|
-
!d && u.current && (clearTimeout(u.current), u.current = null, n.current = !1);
|
|
140
|
-
}, [d]), T(() => () => {
|
|
141
|
-
u.current && (clearTimeout(u.current), u.current = null);
|
|
142
|
-
}, []), {
|
|
143
|
-
isPolling: n.current,
|
|
144
|
-
isTabVisible: d,
|
|
145
|
-
inProgressCount: v().length
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
function kt() {
|
|
149
|
-
const { authToken: e, tokenProps: a } = $(), p = U((l) => l.activeExports), { addExport: d } = te(), c = z(!1), u = a == null ? void 0 : a.apiServiceUrl, n = e == null ? void 0 : e.accessToken;
|
|
150
|
-
T(() => {
|
|
151
|
-
if (c.current || !u || !n) return;
|
|
152
|
-
(async () => {
|
|
153
|
-
try {
|
|
154
|
-
const { exports: h } = await Ce(u, n, {
|
|
155
|
-
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
156
|
-
limit: 20
|
|
157
|
-
// Limit to recent exports
|
|
158
|
-
});
|
|
159
|
-
for (const o of h) {
|
|
160
|
-
if (p.has(o.id)) continue;
|
|
161
|
-
const v = o.totalChunks ? Math.round(o.completedChunks / o.totalChunks * 100) : 0;
|
|
162
|
-
let b;
|
|
163
|
-
if (o.status === "completed")
|
|
164
|
-
try {
|
|
165
|
-
b = await j(u, n, o.id);
|
|
166
|
-
} catch (C) {
|
|
167
|
-
console.error(
|
|
168
|
-
`[useExportRecovery] Failed to get download URL for ${o.id}:`,
|
|
169
|
-
C
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
const m = {
|
|
173
|
-
id: o.id,
|
|
174
|
-
status: o.status,
|
|
175
|
-
progress: v,
|
|
176
|
-
title: Ct(o),
|
|
177
|
-
totalRows: o.totalRows,
|
|
178
|
-
totalChunks: o.totalChunks,
|
|
179
|
-
completedChunks: o.completedChunks,
|
|
180
|
-
startedAt: new Date(o.createdAt),
|
|
181
|
-
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
182
|
-
completedAt: o.completedAt ? new Date(o.completedAt) : void 0,
|
|
183
|
-
fileSize: o.fileSize,
|
|
184
|
-
error: o.error,
|
|
185
|
-
expiresAt: new Date(o.expiresAt),
|
|
186
|
-
downloadUrl: b
|
|
187
|
-
};
|
|
188
|
-
d(m);
|
|
189
|
-
}
|
|
190
|
-
c.current = !0;
|
|
191
|
-
} catch (h) {
|
|
192
|
-
console.error("[useExportRecovery] Failed to recover exports:", h), c.current = !0;
|
|
193
|
-
}
|
|
194
|
-
})();
|
|
195
|
-
}, [u, n, d, p]);
|
|
196
|
-
}
|
|
197
|
-
function Ct(e) {
|
|
198
|
-
return e.title ? e.title : _(
|
|
199
|
-
e.status
|
|
200
|
-
) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
|
|
201
|
-
}
|
|
202
|
-
function wt({
|
|
203
|
-
open: e,
|
|
204
|
-
onOpenChange: a,
|
|
205
|
-
isLibraryVisual: p,
|
|
206
|
-
currentVisualName: d,
|
|
207
|
-
isSaving: c = !1,
|
|
208
|
-
destinationMode: u = "both",
|
|
209
|
-
onConfirm: n
|
|
210
|
-
}) {
|
|
211
|
-
const [l, h] = F(
|
|
212
|
-
p && d ? `Copy of ${d}` : d || ""
|
|
213
|
-
), [o, v] = F("");
|
|
214
|
-
ge.useEffect(() => {
|
|
215
|
-
e && (h(
|
|
216
|
-
p && d ? `Copy of ${d}` : d || ""
|
|
217
|
-
), v(""));
|
|
218
|
-
}, [e, p, d]);
|
|
219
|
-
const b = !!l.trim(), m = u === "local" ? {
|
|
220
|
-
saveToLibrary: !1,
|
|
221
|
-
saveToCurrentDashboard: !0,
|
|
222
|
-
badgeType: "local",
|
|
223
|
-
description: "Creates a local copy on the current dashboard.",
|
|
224
|
-
actionLabel: "Add to Dashboard (Local)"
|
|
225
|
-
} : u === "library" ? {
|
|
226
|
-
saveToLibrary: !0,
|
|
227
|
-
saveToCurrentDashboard: !1,
|
|
228
|
-
badgeType: "library",
|
|
229
|
-
description: "Creates a reusable visual in Visual Library.",
|
|
230
|
-
actionLabel: "Save as Library Visual"
|
|
231
|
-
} : {
|
|
232
|
-
saveToLibrary: !0,
|
|
233
|
-
saveToCurrentDashboard: !0,
|
|
234
|
-
badgeType: "linked",
|
|
235
|
-
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
236
|
-
actionLabel: "Save Copy as Linked Visual"
|
|
237
|
-
}, C = () => {
|
|
238
|
-
!b || c || n({
|
|
239
|
-
name: l.trim(),
|
|
240
|
-
description: o.trim() || void 0,
|
|
241
|
-
saveToLibrary: m.saveToLibrary,
|
|
242
|
-
saveToCurrentDashboard: m.saveToCurrentDashboard
|
|
243
|
-
});
|
|
244
|
-
};
|
|
245
|
-
return /* @__PURE__ */ t(ae, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(se, { className: "sm:max-w-[500px]", children: [
|
|
246
|
-
/* @__PURE__ */ s(re, { children: [
|
|
247
|
-
/* @__PURE__ */ s(oe, { className: "flex items-center gap-2", children: [
|
|
248
|
-
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
249
|
-
m.badgeType !== "local" && /* @__PURE__ */ t(
|
|
250
|
-
at,
|
|
251
|
-
{
|
|
252
|
-
type: m.badgeType,
|
|
253
|
-
showLabel: !0,
|
|
254
|
-
className: "px-2 py-0.5"
|
|
255
|
-
}
|
|
256
|
-
)
|
|
257
|
-
] }),
|
|
258
|
-
/* @__PURE__ */ t(ne, { children: m.description })
|
|
259
|
-
] }),
|
|
260
|
-
/* @__PURE__ */ s("div", { className: "grid gap-4 py-4", children: [
|
|
261
|
-
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
262
|
-
/* @__PURE__ */ t(G, { htmlFor: "name", children: "Name" }),
|
|
263
|
-
/* @__PURE__ */ t(
|
|
264
|
-
we,
|
|
265
|
-
{
|
|
266
|
-
id: "name",
|
|
267
|
-
value: l,
|
|
268
|
-
onChange: (N) => h(N.target.value),
|
|
269
|
-
placeholder: "Enter visual name",
|
|
270
|
-
disabled: c
|
|
271
|
-
}
|
|
272
|
-
)
|
|
273
|
-
] }),
|
|
274
|
-
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
275
|
-
/* @__PURE__ */ t(G, { htmlFor: "description", children: "Description (optional)" }),
|
|
276
|
-
/* @__PURE__ */ t(
|
|
277
|
-
ye,
|
|
278
|
-
{
|
|
279
|
-
id: "description",
|
|
280
|
-
value: o,
|
|
281
|
-
onChange: (N) => v(N.target.value),
|
|
282
|
-
placeholder: "Enter visual description",
|
|
283
|
-
rows: 3,
|
|
284
|
-
disabled: c
|
|
285
|
-
}
|
|
286
|
-
)
|
|
287
|
-
] })
|
|
288
|
-
] }),
|
|
289
|
-
/* @__PURE__ */ s(xe, { children: [
|
|
290
|
-
/* @__PURE__ */ t(
|
|
291
|
-
I,
|
|
292
|
-
{
|
|
293
|
-
variant: "outline",
|
|
294
|
-
onClick: () => a(!1),
|
|
295
|
-
disabled: c,
|
|
296
|
-
children: "Cancel"
|
|
297
|
-
}
|
|
298
|
-
),
|
|
299
|
-
/* @__PURE__ */ s(I, { onClick: C, disabled: !b || c, children: [
|
|
300
|
-
c && /* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
301
|
-
m.actionLabel
|
|
302
|
-
] })
|
|
303
|
-
] })
|
|
304
|
-
] }) });
|
|
305
|
-
}
|
|
306
|
-
function yt() {
|
|
307
|
-
const [e, a] = F(!1), [p, d] = F(!1), [c, u] = F(null), n = R((i) => i.frame), l = R((i) => i.card), h = Ne(), o = B((i) => i.selectedSheetId), v = B(
|
|
308
|
-
(i) => i.actions.setIsDashboardPanelOpen
|
|
309
|
-
), { getUpdatedFrame: b } = ve(), { selectVisual: m } = De(), { addFrame: C, setSelectedFrameId: N, setIsVisualEditing: f } = X(), y = !!(n != null && n.visualId), S = (() => {
|
|
310
|
-
var i, g;
|
|
311
|
-
return ((i = n == null ? void 0 : n.cards) == null ? void 0 : i.length) === 1 && ((g = n.cards[0]) != null && g.title) ? n.cards[0].title : h != null && h.title ? h.title : (l == null ? void 0 : l.title) || "Untitled Visual";
|
|
312
|
-
})(), w = Ae((i) => {
|
|
313
|
-
if (i != null && i.id) {
|
|
314
|
-
if (m(i), p && c && o) {
|
|
315
|
-
const g = {
|
|
316
|
-
...c,
|
|
317
|
-
id: K(),
|
|
318
|
-
visualId: i.id
|
|
319
|
-
// Link to the newly created library visual
|
|
320
|
-
};
|
|
321
|
-
C(o, g, "end"), N(g.id), d(!1), u(null), f(!1);
|
|
322
|
-
}
|
|
323
|
-
v(!0), a(!1);
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
return {
|
|
327
|
-
saveAsDialogOpen: e,
|
|
328
|
-
setSaveAsDialogOpen: a,
|
|
329
|
-
handleSaveAs: async (i) => {
|
|
330
|
-
if (!o) {
|
|
331
|
-
P.error("No sheet selected");
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
const g = b(), E = ie(g);
|
|
335
|
-
if (E) {
|
|
336
|
-
P.error(E);
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
const A = g.cards.length === 1 ? {
|
|
340
|
-
...g,
|
|
341
|
-
cards: g.cards.map((x) => ({
|
|
342
|
-
...x,
|
|
343
|
-
title: i.name
|
|
344
|
-
// Use visual name as card title
|
|
345
|
-
}))
|
|
346
|
-
} : g;
|
|
347
|
-
if (i.saveToLibrary) {
|
|
348
|
-
d(i.saveToCurrentDashboard), u(A);
|
|
349
|
-
const x = {
|
|
350
|
-
title: i.name,
|
|
351
|
-
description: i.description,
|
|
352
|
-
frameObject: A,
|
|
353
|
-
// Card title synced for single-card frames
|
|
354
|
-
isPrivate: !1
|
|
355
|
-
};
|
|
356
|
-
w.mutate(x);
|
|
357
|
-
} else if (i.saveToCurrentDashboard) {
|
|
358
|
-
const x = {
|
|
359
|
-
...A,
|
|
360
|
-
// Card title already synced
|
|
361
|
-
id: K(),
|
|
362
|
-
visualId: void 0
|
|
363
|
-
// Explicitly no visualId for local visuals
|
|
364
|
-
};
|
|
365
|
-
C(o, x, "end"), N(x.id), P.success("Visual saved to dashboard"), a(!1), f(!1);
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
|
-
isLibraryVisual: y,
|
|
369
|
-
currentVisualName: S,
|
|
370
|
-
isSaving: w.isPending
|
|
371
|
-
};
|
|
372
|
-
}
|
|
373
|
-
function Ut({
|
|
374
|
-
className: e
|
|
375
|
-
}) {
|
|
376
|
-
const a = R((D) => D.frame), p = Se((D) => D.selectedVisual), d = B((D) => D.selectedFrameId), c = B((D) => D.selectedSheetId), { setIsVisualEditing: u, updateFrame: n } = X(), [l, h] = F(!1), [o, v] = F("both"), b = !!(a != null && a.visualId || p != null && p.id), m = !!(a != null && a.visualId && d), C = b && !m, {
|
|
377
|
-
saveAsDialogOpen: N,
|
|
378
|
-
setSaveAsDialogOpen: f,
|
|
379
|
-
handleSaveAs: y,
|
|
380
|
-
isLibraryVisual: S,
|
|
381
|
-
currentVisualName: w,
|
|
382
|
-
isSaving: r
|
|
383
|
-
} = yt(), { getUpdatedFrame: i } = ve(), g = () => {
|
|
384
|
-
if (!c) {
|
|
385
|
-
P.error("No sheet selected");
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
if (l) return;
|
|
389
|
-
h(!0);
|
|
390
|
-
const D = i(), A = ie(D);
|
|
391
|
-
if (A) {
|
|
392
|
-
h(!1), P.error(A);
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
const x = {
|
|
396
|
-
...D,
|
|
397
|
-
visualId: void 0
|
|
398
|
-
};
|
|
399
|
-
n(c, x), setTimeout(() => {
|
|
400
|
-
h(!1), P.success("Changes applied. Visual is now local to this dashboard"), u(!1);
|
|
401
|
-
}, 300);
|
|
402
|
-
}, E = (D) => {
|
|
403
|
-
v(D), f(!0);
|
|
404
|
-
};
|
|
405
|
-
return /* @__PURE__ */ s(O, { children: [
|
|
406
|
-
/* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-md border border-input", children: [
|
|
407
|
-
!b && /* @__PURE__ */ t(
|
|
408
|
-
st,
|
|
409
|
-
{
|
|
410
|
-
className: L(e, "rounded-none border-0"),
|
|
411
|
-
variant: "default"
|
|
412
|
-
}
|
|
413
|
-
),
|
|
414
|
-
b && C && /* @__PURE__ */ t(
|
|
415
|
-
rt,
|
|
416
|
-
{
|
|
417
|
-
className: L(e, "rounded-none border-0"),
|
|
418
|
-
variant: "default"
|
|
419
|
-
}
|
|
420
|
-
),
|
|
421
|
-
b && m && /* @__PURE__ */ t(
|
|
422
|
-
ot,
|
|
423
|
-
{
|
|
424
|
-
className: L(e, "rounded-none border-0")
|
|
425
|
-
}
|
|
426
|
-
),
|
|
427
|
-
/* @__PURE__ */ s(le, { modal: !1, children: [
|
|
428
|
-
/* @__PURE__ */ t(de, { className: "h-8", asChild: !0, children: /* @__PURE__ */ t(
|
|
429
|
-
I,
|
|
430
|
-
{
|
|
431
|
-
variant: "default",
|
|
432
|
-
size: "sm",
|
|
433
|
-
className: L(
|
|
434
|
-
e,
|
|
435
|
-
"w-8 rounded-none border-0 border-l border-primary-foreground/30 px-2"
|
|
436
|
-
),
|
|
437
|
-
"aria-label": "Open visual save options",
|
|
438
|
-
disabled: r || l,
|
|
439
|
-
children: /* @__PURE__ */ t(ce, { className: "h-4 w-4" })
|
|
440
|
-
}
|
|
441
|
-
) }),
|
|
442
|
-
/* @__PURE__ */ s(ue, { align: "end", children: [
|
|
443
|
-
m && /* @__PURE__ */ s(O, { children: [
|
|
444
|
-
/* @__PURE__ */ s(
|
|
445
|
-
M,
|
|
446
|
-
{
|
|
447
|
-
onClick: g,
|
|
448
|
-
disabled: l,
|
|
449
|
-
children: [
|
|
450
|
-
/* @__PURE__ */ t(Ee, { className: "mr-2 h-4 w-4" }),
|
|
451
|
-
l ? "Applying..." : "Apply Locally"
|
|
452
|
-
]
|
|
453
|
-
}
|
|
454
|
-
),
|
|
455
|
-
/* @__PURE__ */ t(Ie, {})
|
|
456
|
-
] }),
|
|
457
|
-
/* @__PURE__ */ s(
|
|
458
|
-
M,
|
|
459
|
-
{
|
|
460
|
-
onClick: () => E("local"),
|
|
461
|
-
disabled: r,
|
|
462
|
-
children: [
|
|
463
|
-
/* @__PURE__ */ t(Le, { className: "mr-2 h-4 w-4" }),
|
|
464
|
-
"Add to Dashboard (Local)"
|
|
465
|
-
]
|
|
466
|
-
}
|
|
467
|
-
),
|
|
468
|
-
/* @__PURE__ */ s(
|
|
469
|
-
M,
|
|
470
|
-
{
|
|
471
|
-
onClick: () => E("library"),
|
|
472
|
-
disabled: r,
|
|
473
|
-
children: [
|
|
474
|
-
/* @__PURE__ */ t(nt, { className: "mr-2 h-4 w-4" }),
|
|
475
|
-
"Save as Library Visual"
|
|
476
|
-
]
|
|
477
|
-
}
|
|
478
|
-
),
|
|
479
|
-
/* @__PURE__ */ s(
|
|
480
|
-
M,
|
|
481
|
-
{
|
|
482
|
-
onClick: () => E("both"),
|
|
483
|
-
disabled: r,
|
|
484
|
-
children: [
|
|
485
|
-
/* @__PURE__ */ t(it, { className: "mr-2 h-4 w-4" }),
|
|
486
|
-
"Save Copy as Linked Visual"
|
|
487
|
-
]
|
|
488
|
-
}
|
|
489
|
-
)
|
|
490
|
-
] })
|
|
491
|
-
] })
|
|
492
|
-
] }),
|
|
493
|
-
/* @__PURE__ */ t(lt, { className: e }),
|
|
494
|
-
/* @__PURE__ */ t(
|
|
495
|
-
wt,
|
|
496
|
-
{
|
|
497
|
-
open: N,
|
|
498
|
-
onOpenChange: (D) => {
|
|
499
|
-
r || f(D);
|
|
500
|
-
},
|
|
501
|
-
isLibraryVisual: S,
|
|
502
|
-
currentVisualName: w,
|
|
503
|
-
isSaving: r,
|
|
504
|
-
destinationMode: o,
|
|
505
|
-
onConfirm: y
|
|
506
|
-
}
|
|
507
|
-
)
|
|
508
|
-
] });
|
|
509
|
-
}
|
|
510
|
-
function Mt({
|
|
511
|
-
className: e,
|
|
512
|
-
//labelClassName,
|
|
513
|
-
switchClassName: a
|
|
514
|
-
}) {
|
|
515
|
-
const p = R((l) => l.isDevMode), d = B((l) => l.isVisualEditing), { setIsDevMode: c } = Fe(), { config: u } = be(Te).tokenProps, n = (u == null ? void 0 : u.showAdvancedMode) !== !1;
|
|
516
|
-
return !d || !n ? null : /* @__PURE__ */ s("div", { className: L("flex items-center space-x-2", e), children: [
|
|
517
|
-
/* @__PURE__ */ t(
|
|
518
|
-
ke,
|
|
519
|
-
{
|
|
520
|
-
className: L("", a),
|
|
521
|
-
checked: p,
|
|
522
|
-
onCheckedChange: () => c(!p),
|
|
523
|
-
id: "advanced-mode",
|
|
524
|
-
icon: /* @__PURE__ */ t(Ue, { className: "h-4 w-4" }),
|
|
525
|
-
tooltip: "Advanced Mode"
|
|
526
|
-
}
|
|
527
|
-
),
|
|
528
|
-
/* @__PURE__ */ t("label", { htmlFor: "advanced-mode", className: "sr-only", children: "Advanced Mode" })
|
|
529
|
-
] });
|
|
530
|
-
}
|
|
531
|
-
function Vt({
|
|
532
|
-
open: e,
|
|
533
|
-
onOpenChange: a,
|
|
534
|
-
onSave: p,
|
|
535
|
-
onDiscard: d,
|
|
536
|
-
isSaving: c,
|
|
537
|
-
title: u = "Unsaved changes",
|
|
538
|
-
description: n = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
539
|
-
cancelLabel: l = "Cancel",
|
|
540
|
-
discardLabel: h = "Discard",
|
|
541
|
-
saveLabel: o = "Save"
|
|
542
|
-
}) {
|
|
543
|
-
return /* @__PURE__ */ t(Me, { open: e, onOpenChange: (b) => {
|
|
544
|
-
!b && c || a(b);
|
|
545
|
-
}, children: /* @__PURE__ */ s(Ve, { children: [
|
|
546
|
-
/* @__PURE__ */ s(Pe, { children: [
|
|
547
|
-
/* @__PURE__ */ t(Be, { children: u }),
|
|
548
|
-
/* @__PURE__ */ t(Oe, { children: n })
|
|
549
|
-
] }),
|
|
550
|
-
/* @__PURE__ */ s(ze, { children: [
|
|
551
|
-
/* @__PURE__ */ t(Re, { disabled: c, children: l }),
|
|
552
|
-
/* @__PURE__ */ t(
|
|
553
|
-
I,
|
|
554
|
-
{
|
|
555
|
-
type: "button",
|
|
556
|
-
onClick: d,
|
|
557
|
-
disabled: c,
|
|
558
|
-
variant: "destructive",
|
|
559
|
-
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
560
|
-
children: h
|
|
561
|
-
}
|
|
562
|
-
),
|
|
563
|
-
/* @__PURE__ */ t(I, { type: "button", onClick: p, disabled: c, children: c ? /* @__PURE__ */ s(O, { children: [
|
|
564
|
-
/* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
565
|
-
"Saving..."
|
|
566
|
-
] }) : o })
|
|
567
|
-
] })
|
|
568
|
-
] }) });
|
|
569
|
-
}
|
|
570
|
-
function Pt(e, a, p, d) {
|
|
571
|
-
T(() => {
|
|
572
|
-
e && !p && a && d($e(a));
|
|
573
|
-
}, [e, p, a, d]);
|
|
574
|
-
}
|
|
575
|
-
function xt({
|
|
576
|
-
export: e,
|
|
577
|
-
onRemove: a
|
|
578
|
-
}) {
|
|
579
|
-
const p = () => {
|
|
580
|
-
e.downloadUrl && window.open(e.downloadUrl, "_blank");
|
|
581
|
-
}, d = (l) => {
|
|
582
|
-
l.stopPropagation(), a == null || a(e.id);
|
|
583
|
-
}, c = () => {
|
|
584
|
-
switch (e.status) {
|
|
585
|
-
case "completed":
|
|
586
|
-
return /* @__PURE__ */ t(Ge, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
587
|
-
case "failed":
|
|
588
|
-
return /* @__PURE__ */ t(dt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
589
|
-
default:
|
|
590
|
-
return /* @__PURE__ */ t(H, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
591
|
-
}
|
|
592
|
-
}, u = _(e.status), n = (() => {
|
|
593
|
-
switch (e.status) {
|
|
594
|
-
case "pending":
|
|
595
|
-
return "Queued...";
|
|
596
|
-
case "processing":
|
|
597
|
-
return "Processing...";
|
|
598
|
-
case "chunking":
|
|
599
|
-
return "Processing...";
|
|
600
|
-
case "compacting":
|
|
601
|
-
return "Finalizing...";
|
|
602
|
-
default:
|
|
603
|
-
return "Processing...";
|
|
604
|
-
}
|
|
605
|
-
})();
|
|
606
|
-
return /* @__PURE__ */ s("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
|
|
607
|
-
/* @__PURE__ */ s("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
608
|
-
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
609
|
-
c(),
|
|
610
|
-
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
611
|
-
/* @__PURE__ */ t("h4", { className: "mb-1 truncate text-sm font-medium", children: e.title }),
|
|
612
|
-
e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
613
|
-
/* @__PURE__ */ s("span", { children: [
|
|
614
|
-
e.totalRows.toLocaleString(),
|
|
615
|
-
" rows"
|
|
616
|
-
] }),
|
|
617
|
-
e.fileSize && /* @__PURE__ */ s(O, { children: [
|
|
618
|
-
/* @__PURE__ */ t("span", { children: "•" }),
|
|
619
|
-
/* @__PURE__ */ t("span", { children: _e(e.fileSize) })
|
|
620
|
-
] })
|
|
621
|
-
] }),
|
|
622
|
-
u && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: n }),
|
|
623
|
-
e.status === "failed" && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-xs text-destructive", children: e.error || "Export failed" })
|
|
624
|
-
] })
|
|
625
|
-
] }),
|
|
626
|
-
/* @__PURE__ */ t(
|
|
627
|
-
I,
|
|
628
|
-
{
|
|
629
|
-
variant: "ghost",
|
|
630
|
-
size: "icon",
|
|
631
|
-
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
632
|
-
onClick: d,
|
|
633
|
-
"aria-label": "Remove notification",
|
|
634
|
-
children: /* @__PURE__ */ t(je, { className: "h-4 w-4" })
|
|
635
|
-
}
|
|
636
|
-
)
|
|
637
|
-
] }),
|
|
638
|
-
/* @__PURE__ */ s("div", { className: "ml-8", children: [
|
|
639
|
-
e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
640
|
-
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: J(e.startedAt, { addSuffix: !0 }) }),
|
|
641
|
-
e.downloadUrl && /* @__PURE__ */ s(
|
|
642
|
-
I,
|
|
643
|
-
{
|
|
644
|
-
size: "sm",
|
|
645
|
-
variant: "outline",
|
|
646
|
-
className: "h-8 bg-transparent",
|
|
647
|
-
onClick: p,
|
|
648
|
-
children: [
|
|
649
|
-
/* @__PURE__ */ t(He, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
650
|
-
"Download"
|
|
651
|
-
]
|
|
652
|
-
}
|
|
653
|
-
)
|
|
654
|
-
] }),
|
|
655
|
-
u && /* @__PURE__ */ s("div", { children: [
|
|
656
|
-
/* @__PURE__ */ t(Xe, { value: e.progress, className: "h-1.5" }),
|
|
657
|
-
/* @__PURE__ */ s("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
658
|
-
e.progress,
|
|
659
|
-
"% complete"
|
|
660
|
-
] })
|
|
661
|
-
] }),
|
|
662
|
-
e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: J(e.startedAt, { addSuffix: !0 }) })
|
|
663
|
-
] })
|
|
664
|
-
] });
|
|
665
|
-
}
|
|
666
|
-
function Nt() {
|
|
667
|
-
const { authToken: e, tokenProps: a } = $(), p = U((f) => f.activeExports), { clearCompleted: d, removeExport: c, updateExport: u } = te(), [n, l] = F(!1), [h, o] = F(!1), v = Array.from(p.values()).sort(
|
|
668
|
-
(f, y) => y.startedAt.getTime() - f.startedAt.getTime()
|
|
669
|
-
), b = v.some(
|
|
670
|
-
(f) => f.status === "completed" || f.status === "failed"
|
|
671
|
-
), m = V(async () => {
|
|
672
|
-
const f = a == null ? void 0 : a.apiServiceUrl, y = e == null ? void 0 : e.accessToken;
|
|
673
|
-
if (!(!f || !y)) {
|
|
674
|
-
l(!0);
|
|
675
|
-
try {
|
|
676
|
-
const S = Array.from(p.values());
|
|
677
|
-
await Promise.all(
|
|
678
|
-
S.map(async (w) => {
|
|
679
|
-
try {
|
|
680
|
-
const r = await ee(f, y, w.id);
|
|
681
|
-
let i;
|
|
682
|
-
if (r.status === "completed")
|
|
683
|
-
try {
|
|
684
|
-
i = await j(
|
|
685
|
-
f,
|
|
686
|
-
y,
|
|
687
|
-
w.id
|
|
688
|
-
);
|
|
689
|
-
} catch (g) {
|
|
690
|
-
console.error(`Failed to get download URL for ${w.id}:`, g);
|
|
691
|
-
}
|
|
692
|
-
u(w.id, {
|
|
693
|
-
status: r.status,
|
|
694
|
-
progress: r.progress,
|
|
695
|
-
completedChunks: r.completedChunks,
|
|
696
|
-
completedAt: r.completedAt ? new Date(r.completedAt) : void 0,
|
|
697
|
-
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
698
|
-
fileSize: r.fileSize,
|
|
699
|
-
error: r.error,
|
|
700
|
-
downloadUrl: i
|
|
701
|
-
});
|
|
702
|
-
} catch (r) {
|
|
703
|
-
console.error(`Failed to refresh export ${w.id}:`, r);
|
|
704
|
-
}
|
|
705
|
-
})
|
|
706
|
-
);
|
|
707
|
-
} finally {
|
|
708
|
-
l(!1);
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
}, [
|
|
712
|
-
p,
|
|
713
|
-
e == null ? void 0 : e.accessToken,
|
|
714
|
-
a == null ? void 0 : a.apiServiceUrl,
|
|
715
|
-
u
|
|
716
|
-
]), C = V(async () => {
|
|
717
|
-
const f = a == null ? void 0 : a.apiServiceUrl, y = e == null ? void 0 : e.accessToken;
|
|
718
|
-
if (!f || !y) {
|
|
719
|
-
d();
|
|
720
|
-
return;
|
|
721
|
-
}
|
|
722
|
-
o(!0);
|
|
723
|
-
try {
|
|
724
|
-
const S = v.filter(
|
|
725
|
-
(r) => r.status === "completed" || r.status === "failed"
|
|
726
|
-
), w = await Promise.allSettled(
|
|
727
|
-
S.map(async (r) => (await W(f, y, r.id), r.id))
|
|
728
|
-
);
|
|
729
|
-
for (const r of w)
|
|
730
|
-
r.status === "fulfilled" ? c(r.value) : console.error("Failed to delete export:", r.reason);
|
|
731
|
-
} finally {
|
|
732
|
-
o(!1);
|
|
733
|
-
}
|
|
734
|
-
}, [
|
|
735
|
-
v,
|
|
736
|
-
a == null ? void 0 : a.apiServiceUrl,
|
|
737
|
-
e == null ? void 0 : e.accessToken,
|
|
738
|
-
d,
|
|
739
|
-
c
|
|
740
|
-
]), N = V(
|
|
741
|
-
async (f) => {
|
|
742
|
-
const y = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
|
|
743
|
-
if (y && S)
|
|
744
|
-
try {
|
|
745
|
-
await W(y, S, f), c(f);
|
|
746
|
-
return;
|
|
747
|
-
} catch (w) {
|
|
748
|
-
console.error(`Failed to cancel export ${f}:`, w);
|
|
749
|
-
}
|
|
750
|
-
c(f);
|
|
751
|
-
},
|
|
752
|
-
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, c]
|
|
753
|
-
);
|
|
754
|
-
return v.length === 0 ? /* @__PURE__ */ s("div", { className: "p-6 text-center", children: [
|
|
755
|
-
/* @__PURE__ */ t(Y, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
|
|
756
|
-
/* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
|
|
757
|
-
/* @__PURE__ */ t("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
|
|
758
|
-
] }) : /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
|
|
759
|
-
/* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [
|
|
760
|
-
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
761
|
-
/* @__PURE__ */ t(Y, { className: "h-5 w-5 text-muted-foreground" }),
|
|
762
|
-
/* @__PURE__ */ t("h4", { className: "font-semibold", children: "Exports" })
|
|
763
|
-
] }),
|
|
764
|
-
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
765
|
-
/* @__PURE__ */ t(
|
|
766
|
-
I,
|
|
767
|
-
{
|
|
768
|
-
variant: "ghost",
|
|
769
|
-
size: "sm",
|
|
770
|
-
className: "h-7 w-7 p-0",
|
|
771
|
-
onClick: m,
|
|
772
|
-
disabled: n,
|
|
773
|
-
title: "Refresh status",
|
|
774
|
-
children: /* @__PURE__ */ t(
|
|
775
|
-
Ke,
|
|
776
|
-
{
|
|
777
|
-
className: `h-4 w-4 ${n ? "animate-spin" : ""}`
|
|
778
|
-
}
|
|
779
|
-
)
|
|
780
|
-
}
|
|
781
|
-
),
|
|
782
|
-
b && /* @__PURE__ */ t(
|
|
783
|
-
I,
|
|
784
|
-
{
|
|
785
|
-
variant: "ghost",
|
|
786
|
-
size: "sm",
|
|
787
|
-
className: "h-7 px-2 text-sm",
|
|
788
|
-
onClick: C,
|
|
789
|
-
disabled: h,
|
|
790
|
-
children: h ? "Clearing..." : "Clear all"
|
|
791
|
-
}
|
|
792
|
-
)
|
|
793
|
-
] })
|
|
794
|
-
] }),
|
|
795
|
-
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: v.map((f) => /* @__PURE__ */ t(
|
|
796
|
-
xt,
|
|
797
|
-
{
|
|
798
|
-
export: f,
|
|
799
|
-
onRemove: N
|
|
800
|
-
},
|
|
801
|
-
f.id
|
|
802
|
-
)) }) })
|
|
803
|
-
] });
|
|
804
|
-
}
|
|
805
|
-
function Bt({
|
|
806
|
-
variant: e
|
|
807
|
-
}) {
|
|
808
|
-
const a = U((h) => h.activeExports), p = We(), d = a.size > 0, c = Array.from(a.values()).some(
|
|
809
|
-
(h) => h.status === "completed" || h.status === "failed"
|
|
810
|
-
), n = p > 0 ? p > 9 ? "9+" : String(p) : null;
|
|
811
|
-
return /* @__PURE__ */ s(he, { children: [
|
|
812
|
-
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ s(
|
|
813
|
-
I,
|
|
814
|
-
{
|
|
815
|
-
variant: e ?? "ghost",
|
|
816
|
-
size: "icon",
|
|
817
|
-
className: "relative h-8 w-8",
|
|
818
|
-
"aria-label": "Export notifications",
|
|
819
|
-
children: [
|
|
820
|
-
/* @__PURE__ */ t(qe, { className: "h-4 w-4" }),
|
|
821
|
-
d && /* @__PURE__ */ t(
|
|
822
|
-
"span",
|
|
823
|
-
{
|
|
824
|
-
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${n ? "-right-0.5 -top-0.5 h-4 min-w-4 px-0.5 text-[10px] font-semibold" : "right-0.5 top-0.5 h-2 w-2"}`,
|
|
825
|
-
children: n
|
|
826
|
-
}
|
|
827
|
-
)
|
|
828
|
-
]
|
|
829
|
-
}
|
|
830
|
-
) }),
|
|
831
|
-
/* @__PURE__ */ t(pe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(Nt, {}) })
|
|
832
|
-
] });
|
|
833
|
-
}
|
|
834
|
-
function Dt(e) {
|
|
835
|
-
if (e)
|
|
836
|
-
return {
|
|
837
|
-
renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
|
|
838
|
-
removedControlId: e.type === "remove" ? e.controlId : void 0,
|
|
839
|
-
cardBindingsById: e.type === "add" || e.type === "update" ? e.cardBindingsById : void 0,
|
|
840
|
-
affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
|
|
841
|
-
};
|
|
842
|
-
}
|
|
843
|
-
function Ot({
|
|
844
|
-
open: e,
|
|
845
|
-
onOpenChange: a,
|
|
846
|
-
trigger: p,
|
|
847
|
-
showTrigger: d = !0,
|
|
848
|
-
initialMode: c = "manage"
|
|
849
|
-
}) {
|
|
850
|
-
const u = c === "create", {
|
|
851
|
-
forceClose: n,
|
|
852
|
-
handleOpenChange: l,
|
|
853
|
-
isCreateFlowActive: h,
|
|
854
|
-
preventPassiveDismissDuringCreate: o,
|
|
855
|
-
resolvedOpen: v,
|
|
856
|
-
setIsCreateFlowActive: b
|
|
857
|
-
} = ct({
|
|
858
|
-
open: e,
|
|
859
|
-
onOpenChange: a,
|
|
860
|
-
initialCreateFlowActive: c === "create",
|
|
861
|
-
// Dialog mode renders a built-in X close button — allow explicit
|
|
862
|
-
// closes through `handleOpenChange`. Popover mode has no X; its
|
|
863
|
-
// only close-via-trigger path is a re-click that would silently
|
|
864
|
-
// wipe the in-progress create flow, so block everything during
|
|
865
|
-
// create and make consumers use `forceClose()` from a dedicated
|
|
866
|
-
// button.
|
|
867
|
-
dismissMode: d ? "passive" : "explicit-only"
|
|
868
|
-
}), m = B((A) => A.dashboard), { setDashboardControlsModel: C } = X(), { participants: N } = Je(Ye(m)), f = Array.from(
|
|
869
|
-
new Map(
|
|
870
|
-
N.flatMap(
|
|
871
|
-
(A) => A.fieldChoices.map((x) => {
|
|
872
|
-
var k;
|
|
873
|
-
return [
|
|
874
|
-
x.value,
|
|
875
|
-
{
|
|
876
|
-
option: x,
|
|
877
|
-
target: (k = A.fieldTargetMap) == null ? void 0 : k[x.value]
|
|
878
|
-
}
|
|
879
|
-
];
|
|
880
|
-
})
|
|
881
|
-
)
|
|
882
|
-
).values()
|
|
883
|
-
), y = Array.from(
|
|
884
|
-
new Map(
|
|
885
|
-
N.flatMap(
|
|
886
|
-
(A) => A.metricChoices.map((x) => {
|
|
887
|
-
var k;
|
|
888
|
-
return [
|
|
889
|
-
x.value,
|
|
890
|
-
{
|
|
891
|
-
option: x,
|
|
892
|
-
target: (k = A.metricTargetMap) == null ? void 0 : k[x.value]
|
|
893
|
-
}
|
|
894
|
-
];
|
|
895
|
-
})
|
|
896
|
-
)
|
|
897
|
-
).values()
|
|
898
|
-
), S = Qe({
|
|
899
|
-
...m || {},
|
|
900
|
-
controls: []
|
|
901
|
-
}), w = Ze(m), r = (A, x, k) => {
|
|
902
|
-
C(
|
|
903
|
-
A,
|
|
904
|
-
x,
|
|
905
|
-
Dt(k)
|
|
906
|
-
);
|
|
907
|
-
}, i = V(() => {
|
|
908
|
-
if (u) {
|
|
909
|
-
n();
|
|
910
|
-
return;
|
|
911
|
-
}
|
|
912
|
-
b(!1);
|
|
913
|
-
}, [u, n, b]), g = /* @__PURE__ */ t(
|
|
914
|
-
ut,
|
|
915
|
-
{
|
|
916
|
-
scope: "dashboard",
|
|
917
|
-
controls: m.controls || [],
|
|
918
|
-
reservedControlIds: S,
|
|
919
|
-
defaultValues: m.defaultControlValues || {},
|
|
920
|
-
usageByControlId: et(m),
|
|
921
|
-
availableFieldChoices: f,
|
|
922
|
-
availableMetricChoices: y,
|
|
923
|
-
structuralParticipants: N,
|
|
924
|
-
structuralParticipantIdsByControlId: w,
|
|
925
|
-
initialCreateFlow: c === "create",
|
|
926
|
-
onCreateFlowActiveChange: b,
|
|
927
|
-
onCreateFlowComplete: i,
|
|
928
|
-
onChange: r,
|
|
929
|
-
emptyMessage: "No dashboard controls yet."
|
|
930
|
-
}
|
|
931
|
-
), E = h ? "Add dashboard control" : "Dashboard Controls", D = /* @__PURE__ */ s(O, { children: [
|
|
932
|
-
/* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
933
|
-
/* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
934
|
-
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
|
|
935
|
-
] }),
|
|
936
|
-
g
|
|
937
|
-
] });
|
|
938
|
-
return d ? /* @__PURE__ */ s(he, { open: v, onOpenChange: l, children: [
|
|
939
|
-
/* @__PURE__ */ t(me, { asChild: !0, children: p || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
940
|
-
/* @__PURE__ */ t(fe, { className: "mr-2 h-4 w-4" }),
|
|
941
|
-
"Controls"
|
|
942
|
-
] }) }),
|
|
943
|
-
/* @__PURE__ */ t(
|
|
944
|
-
pe,
|
|
945
|
-
{
|
|
946
|
-
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
947
|
-
align: "end",
|
|
948
|
-
onEscapeKeyDown: o,
|
|
949
|
-
onPointerDownOutside: o,
|
|
950
|
-
children: D
|
|
951
|
-
}
|
|
952
|
-
)
|
|
953
|
-
] }) : /* @__PURE__ */ t(ae, { open: v, onOpenChange: l, children: /* @__PURE__ */ s(
|
|
954
|
-
se,
|
|
955
|
-
{
|
|
956
|
-
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
957
|
-
onEscapeKeyDown: o,
|
|
958
|
-
onPointerDownOutside: o,
|
|
959
|
-
children: [
|
|
960
|
-
/* @__PURE__ */ s(
|
|
961
|
-
re,
|
|
962
|
-
{
|
|
963
|
-
className: h ? "space-y-0" : void 0,
|
|
964
|
-
children: [
|
|
965
|
-
/* @__PURE__ */ t(oe, { className: "text-[15px]", children: E }),
|
|
966
|
-
/* @__PURE__ */ t(
|
|
967
|
-
ne,
|
|
968
|
-
{
|
|
969
|
-
className: h ? "sr-only" : "text-[13px]",
|
|
970
|
-
children: h ? "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."
|
|
971
|
-
}
|
|
972
|
-
)
|
|
973
|
-
]
|
|
974
|
-
}
|
|
975
|
-
),
|
|
976
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: g })
|
|
977
|
-
]
|
|
978
|
-
}
|
|
979
|
-
) });
|
|
980
|
-
}
|
|
981
|
-
function zt({
|
|
982
|
-
showFilters: e,
|
|
983
|
-
onToggleFilters: a,
|
|
984
|
-
onAddFilter: p,
|
|
985
|
-
onAddControl: d,
|
|
986
|
-
onManageControls: c,
|
|
987
|
-
size: u = "default",
|
|
988
|
-
className: n,
|
|
989
|
-
primaryButtonClassName: l,
|
|
990
|
-
secondaryButtonClassName: h,
|
|
991
|
-
dropdownContentClassName: o
|
|
992
|
-
}) {
|
|
993
|
-
const v = u === "toolbar";
|
|
994
|
-
return /* @__PURE__ */ s(
|
|
995
|
-
"div",
|
|
996
|
-
{
|
|
997
|
-
className: L(
|
|
998
|
-
"relative inline-flex items-stretch overflow-visible rounded-md border border-input bg-background shadow-none",
|
|
999
|
-
n
|
|
1000
|
-
),
|
|
1001
|
-
children: [
|
|
1002
|
-
/* @__PURE__ */ s(
|
|
1003
|
-
I,
|
|
1004
|
-
{
|
|
1005
|
-
variant: "ghost",
|
|
1006
|
-
className: L(
|
|
1007
|
-
v ? "h-8" : "h-7",
|
|
1008
|
-
"rounded-none border-0 bg-transparent pl-3 pr-2 shadow-none hover:bg-accent/50",
|
|
1009
|
-
l
|
|
1010
|
-
),
|
|
1011
|
-
onClick: a,
|
|
1012
|
-
size: "sm",
|
|
1013
|
-
children: [
|
|
1014
|
-
e ? /* @__PURE__ */ t(ht, { className: "mr-2 h-4 w-4" }) : /* @__PURE__ */ t(q, { className: "mr-2 h-4 w-4" }),
|
|
1015
|
-
"Filter"
|
|
1016
|
-
]
|
|
1017
|
-
}
|
|
1018
|
-
),
|
|
1019
|
-
/* @__PURE__ */ s(le, { children: [
|
|
1020
|
-
/* @__PURE__ */ t(de, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1021
|
-
I,
|
|
1022
|
-
{
|
|
1023
|
-
className: L(
|
|
1024
|
-
v ? "h-8 w-8" : "h-7 w-8",
|
|
1025
|
-
"rounded-none border-0 bg-transparent px-1 shadow-none hover:bg-accent/50",
|
|
1026
|
-
h
|
|
1027
|
-
),
|
|
1028
|
-
variant: "ghost",
|
|
1029
|
-
size: "sm",
|
|
1030
|
-
"aria-label": "Filter and control actions",
|
|
1031
|
-
children: /* @__PURE__ */ t(ce, { className: "h-4 w-4" })
|
|
1032
|
-
}
|
|
1033
|
-
) }),
|
|
1034
|
-
/* @__PURE__ */ s(
|
|
1035
|
-
ue,
|
|
1036
|
-
{
|
|
1037
|
-
align: "start",
|
|
1038
|
-
className: L("rounded-xl border border-border/60 p-1 shadow-sm", o),
|
|
1039
|
-
children: [
|
|
1040
|
-
/* @__PURE__ */ s(M, { onSelect: p, children: [
|
|
1041
|
-
/* @__PURE__ */ t(q, { className: "mr-2 h-4 w-4" }),
|
|
1042
|
-
"Add filter"
|
|
1043
|
-
] }),
|
|
1044
|
-
/* @__PURE__ */ s(M, { onSelect: d, children: [
|
|
1045
|
-
/* @__PURE__ */ t(fe, { className: "mr-2 h-4 w-4" }),
|
|
1046
|
-
"Add control"
|
|
1047
|
-
] }),
|
|
1048
|
-
/* @__PURE__ */ s(M, { onSelect: c, children: [
|
|
1049
|
-
/* @__PURE__ */ t(tt, { className: "mr-2 h-4 w-4" }),
|
|
1050
|
-
"Manage controls"
|
|
1051
|
-
] })
|
|
1052
|
-
]
|
|
1053
|
-
}
|
|
1054
|
-
)
|
|
1055
|
-
] })
|
|
1056
|
-
]
|
|
1057
|
-
}
|
|
1058
|
-
);
|
|
1059
|
-
}
|
|
1060
|
-
export {
|
|
1061
|
-
Mt as A,
|
|
1062
|
-
Ot as D,
|
|
1063
|
-
Nt as E,
|
|
1064
|
-
Bt as N,
|
|
1065
|
-
Vt as U,
|
|
1066
|
-
Ut as V,
|
|
1067
|
-
xt as a,
|
|
1068
|
-
kt as b,
|
|
1069
|
-
zt as c,
|
|
1070
|
-
Pt as d,
|
|
1071
|
-
Tt as u
|
|
1072
|
-
};
|