react-semaphor 0.1.205 → 0.1.207
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-DekrQ0yg.js → dashboard-controls-CwMm9_ki.js} +1 -1
- package/dist/chunks/{dashboard-controls-n5_oB_dp.js → dashboard-controls-HlEsqiRq.js} +5 -5
- package/dist/chunks/{dashboard-json-VG8uFdaU.js → dashboard-json-CI8wIOzY.js} +1 -1
- package/dist/chunks/{dashboard-json-B5YyWsMv.js → dashboard-json-DoYcT7tI.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-DnfxWTj2.js → dashboard-summary-settings-dialog-eQcHYcAI.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-B7_fbNYb.js → dashboard-summary-settings-dialog-ioe7ZyFE.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-bl33bktZ.js → edit-dashboard-visual-BotbTTiL.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-BxDQKLvc.js → edit-dashboard-visual-Cl_qfIV_.js} +1 -1
- package/dist/chunks/{editor-action-buttons-DngVSXyw.js → editor-action-buttons-B0-mScSZ.js} +2 -2
- package/dist/chunks/{editor-action-buttons-BUAzU5tX.js → editor-action-buttons-CcXUQDy4.js} +1 -1
- package/dist/chunks/{index-em2ecoK3.js → index-CqOQuBxB.js} +9028 -9078
- package/dist/chunks/{index-CtLqMYAL.js → index-plgMsXq1.js} +215 -220
- package/dist/chunks/{notification-bell-Ck-SNMez.js → notification-bell-BI-XywDI.js} +271 -272
- package/dist/chunks/notification-bell-BSBRPw38.js +11 -0
- package/dist/chunks/{resource-management-panel-Ji1DZtnk.js → resource-management-panel-D0q51oXw.js} +1 -1
- package/dist/chunks/{resource-management-panel-BGJ4XMn5.js → resource-management-panel-Z8x52dx2.js} +3 -3
- package/dist/chunks/{use-role-aware-display-preferences-C0-SK5cT.js → use-role-aware-display-preferences-BWghO18e.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-DEkMGyx9.js → use-role-aware-display-preferences-C-m9KEuJ.js} +1 -1
- package/dist/chunks/{use-visual-utils-BYBat4tj.js → use-visual-utils-BbVM0bck.js} +1 -1
- package/dist/chunks/{use-visual-utils-BLdGPBdR.js → use-visual-utils-DHmGIepC.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 +13 -1
- package/package.json +1 -1
- package/dist/chunks/notification-bell-BWh1ZNB4.js +0 -11
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import oe, { useState as A, useRef as L, useCallback as P, useEffect as
|
|
2
|
-
import { bI as te, l as R, bC as
|
|
1
|
+
import oe, { useState as A, useRef as L, useCallback as P, useEffect as S, useContext as ie } from "react";
|
|
2
|
+
import { bI as te, l as R, bC as D, aW as B, aH as se, aG as $, bB as ae, aI as le, m as ce, n as de, o as ue, p as me, q as he, L as O, cA as pe, cF as fe, cG as _, G as ge, B as E, H, bA as M, bQ as ve, u as I, bU as xe, bs as re, cH as be, cI as j, I as U, bE as we, cJ as Ce, c as T, b$ as G, c0 as q, c1 as X, c2 as Q, c3 as W, by as Ne, cK as ye, cL as Ae, cM as Ee, ch as Se, ci as De, cj as Ie, cN as ke, ck as Ue, cl as Te, cm as Fe, cn as Pe, co as Me, am as Ve, a2 as Le, cO as ze, cP as Oe, aw as Re, X as Be, cQ as $e, cR as He, cS as _e, al as J, a3 as je, bD as Ge, P as qe, s as Xe, cT as Qe, t as We } from "./index-CqOQuBxB.js";
|
|
3
3
|
import { jsx as t, jsxs as r, Fragment as V } from "react/jsx-runtime";
|
|
4
|
-
import { E as Je, V as Ke, a as Ye, b as Ze, S as K, c as et, C as tt } from "./editor-action-buttons-
|
|
5
|
-
import { a as ne } from "./use-visual-utils-
|
|
4
|
+
import { E as Je, V as Ke, a as Ye, b as Ze, S as K, c as et, C as tt } from "./editor-action-buttons-B0-mScSZ.js";
|
|
5
|
+
import { a as ne } from "./use-visual-utils-BbVM0bck.js";
|
|
6
6
|
import { c as Y } from "./date-formatter-Y8Za1ib3.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -32,68 +32,68 @@ function lt(e) {
|
|
|
32
32
|
return s < ot ? at : s < it ? rt : nt;
|
|
33
33
|
}
|
|
34
34
|
function wt() {
|
|
35
|
-
const { authToken: e, tokenProps: s } = R(),
|
|
35
|
+
const { authToken: e, tokenProps: s } = R(), m = D((f) => f.activeExports), [o, c] = A(
|
|
36
36
|
typeof document < "u" ? !document.hidden : !0
|
|
37
|
-
),
|
|
38
|
-
const
|
|
39
|
-
return Array.from(
|
|
37
|
+
), d = L(null), a = L(!1), n = L(void 0), x = s == null ? void 0 : s.apiServiceUrl, u = e == null ? void 0 : e.accessToken, g = P(() => {
|
|
38
|
+
const f = D.getState().activeExports;
|
|
39
|
+
return Array.from(f.values()).filter(
|
|
40
40
|
(b) => B(b.status)
|
|
41
41
|
);
|
|
42
42
|
}, []);
|
|
43
|
-
|
|
43
|
+
S(() => {
|
|
44
44
|
if (typeof document > "u") return;
|
|
45
|
-
const
|
|
46
|
-
|
|
45
|
+
const f = () => {
|
|
46
|
+
c(!document.hidden);
|
|
47
47
|
};
|
|
48
|
-
return document.addEventListener("visibilitychange",
|
|
49
|
-
document.removeEventListener("visibilitychange",
|
|
48
|
+
return document.addEventListener("visibilitychange", f), () => {
|
|
49
|
+
document.removeEventListener("visibilitychange", f);
|
|
50
50
|
};
|
|
51
51
|
}, []);
|
|
52
52
|
const C = P(async () => {
|
|
53
|
-
if (!
|
|
54
|
-
|
|
53
|
+
if (!x || !u) {
|
|
54
|
+
a.current = !1;
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
|
|
57
|
+
const f = g();
|
|
58
|
+
if (f.length === 0) {
|
|
59
|
+
a.current = !1;
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const b = Date.now(), y =
|
|
63
|
-
(
|
|
62
|
+
const b = Date.now(), y = f.filter(
|
|
63
|
+
(l) => b - l.startedAt.getTime() > ee
|
|
64
64
|
);
|
|
65
65
|
if (y.length > 0) {
|
|
66
|
-
const { updateExport:
|
|
66
|
+
const { updateExport: l } = D.getState().actions;
|
|
67
67
|
for (const i of y)
|
|
68
|
-
|
|
68
|
+
l(i.id, {
|
|
69
69
|
status: "failed",
|
|
70
70
|
error: "Export timed out. Please try again or contact support.",
|
|
71
71
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
(
|
|
74
|
+
const p = f.filter(
|
|
75
|
+
(l) => b - l.startedAt.getTime() <= ee
|
|
76
76
|
);
|
|
77
|
-
if (
|
|
78
|
-
|
|
77
|
+
if (p.length === 0) {
|
|
78
|
+
a.current = !1;
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
|
|
81
|
+
const v = await Promise.allSettled(
|
|
82
|
+
p.map(async (l) => {
|
|
83
83
|
try {
|
|
84
|
-
const i = await se(
|
|
84
|
+
const i = await se(x, u, l.id);
|
|
85
85
|
let w;
|
|
86
86
|
if (i.status === "completed")
|
|
87
87
|
try {
|
|
88
|
-
w = await $(
|
|
88
|
+
w = await $(x, u, l.id);
|
|
89
89
|
} catch (F) {
|
|
90
90
|
console.error(
|
|
91
|
-
`[useExportPolling] Failed to get download URL for ${
|
|
91
|
+
`[useExportPolling] Failed to get download URL for ${l.id}:`,
|
|
92
92
|
F
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
return {
|
|
96
|
-
id:
|
|
96
|
+
id: l.id,
|
|
97
97
|
status: i.status,
|
|
98
98
|
progress: i.progress,
|
|
99
99
|
completedChunks: i.completedChunks,
|
|
@@ -105,94 +105,94 @@ function wt() {
|
|
|
105
105
|
};
|
|
106
106
|
} catch (i) {
|
|
107
107
|
return console.error(
|
|
108
|
-
`[useExportPolling] Failed to poll export ${
|
|
108
|
+
`[useExportPolling] Failed to poll export ${l.id}:`,
|
|
109
109
|
i
|
|
110
110
|
), null;
|
|
111
111
|
}
|
|
112
112
|
})
|
|
113
|
-
), { updateExport: N } =
|
|
114
|
-
for (const
|
|
115
|
-
|
|
116
|
-
const h =
|
|
113
|
+
), { updateExport: N } = D.getState().actions;
|
|
114
|
+
for (const l of v)
|
|
115
|
+
l.status === "fulfilled" && l.value && N(l.value.id, l.value);
|
|
116
|
+
const h = g();
|
|
117
117
|
if (h.length > 0 && !document.hidden) {
|
|
118
|
-
const
|
|
118
|
+
const l = h.reduce(
|
|
119
119
|
(w, F) => F.startedAt < w ? F.startedAt : w,
|
|
120
120
|
h[0].startedAt
|
|
121
|
-
), i = lt(
|
|
122
|
-
|
|
121
|
+
), i = lt(l);
|
|
122
|
+
d.current && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
123
123
|
var w;
|
|
124
|
-
(w =
|
|
124
|
+
(w = n.current) == null || w.call(n);
|
|
125
125
|
}, i);
|
|
126
126
|
} else
|
|
127
|
-
|
|
128
|
-
}, [
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
}, [C]),
|
|
127
|
+
a.current = !1;
|
|
128
|
+
}, [x, u, g]);
|
|
129
|
+
return S(() => {
|
|
130
|
+
n.current = C;
|
|
131
|
+
}, [C]), S(() => {
|
|
132
132
|
var b;
|
|
133
|
-
|
|
134
|
-
}, [
|
|
133
|
+
g().length > 0 && o && !a.current && (a.current = !0, (b = n.current) == null || b.call(n));
|
|
134
|
+
}, [m, o, g]), S(() => {
|
|
135
135
|
var b;
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
}, [
|
|
139
|
-
!
|
|
140
|
-
}, [
|
|
141
|
-
|
|
136
|
+
const f = g();
|
|
137
|
+
o && f.length > 0 && !a.current && (a.current = !0, (b = n.current) == null || b.call(n));
|
|
138
|
+
}, [o, g]), S(() => {
|
|
139
|
+
!o && d.current && (clearTimeout(d.current), d.current = null, a.current = !1);
|
|
140
|
+
}, [o]), S(() => () => {
|
|
141
|
+
d.current && (clearTimeout(d.current), d.current = null);
|
|
142
142
|
}, []), {
|
|
143
|
-
isPolling:
|
|
144
|
-
isTabVisible:
|
|
145
|
-
inProgressCount:
|
|
143
|
+
isPolling: a.current,
|
|
144
|
+
isTabVisible: o,
|
|
145
|
+
inProgressCount: g().length
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
function Ct() {
|
|
149
|
-
const { authToken: e, tokenProps: s } = R(),
|
|
150
|
-
|
|
151
|
-
if (
|
|
149
|
+
const { authToken: e, tokenProps: s } = R(), m = D((n) => n.activeExports), { addExport: o } = ae(), c = L(!1), d = s == null ? void 0 : s.apiServiceUrl, a = e == null ? void 0 : e.accessToken;
|
|
150
|
+
S(() => {
|
|
151
|
+
if (c.current || !d || !a) return;
|
|
152
152
|
(async () => {
|
|
153
153
|
try {
|
|
154
|
-
const { exports:
|
|
154
|
+
const { exports: x } = await le(d, a, {
|
|
155
155
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
156
156
|
limit: 20
|
|
157
157
|
// Limit to recent exports
|
|
158
158
|
});
|
|
159
|
-
for (const
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
159
|
+
for (const u of x) {
|
|
160
|
+
if (m.has(u.id)) continue;
|
|
161
|
+
const g = u.totalChunks ? Math.round(u.completedChunks / u.totalChunks * 100) : 0;
|
|
162
162
|
let C;
|
|
163
|
-
if (
|
|
163
|
+
if (u.status === "completed")
|
|
164
164
|
try {
|
|
165
|
-
C = await $(
|
|
165
|
+
C = await $(d, a, u.id);
|
|
166
166
|
} catch (b) {
|
|
167
167
|
console.error(
|
|
168
|
-
`[useExportRecovery] Failed to get download URL for ${
|
|
168
|
+
`[useExportRecovery] Failed to get download URL for ${u.id}:`,
|
|
169
169
|
b
|
|
170
170
|
);
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
id:
|
|
174
|
-
status:
|
|
175
|
-
progress:
|
|
176
|
-
title: ct(
|
|
177
|
-
totalRows:
|
|
178
|
-
totalChunks:
|
|
179
|
-
completedChunks:
|
|
180
|
-
startedAt: new Date(
|
|
172
|
+
const f = {
|
|
173
|
+
id: u.id,
|
|
174
|
+
status: u.status,
|
|
175
|
+
progress: g,
|
|
176
|
+
title: ct(u),
|
|
177
|
+
totalRows: u.totalRows,
|
|
178
|
+
totalChunks: u.totalChunks,
|
|
179
|
+
completedChunks: u.completedChunks,
|
|
180
|
+
startedAt: new Date(u.createdAt),
|
|
181
181
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
182
|
-
completedAt:
|
|
183
|
-
fileSize:
|
|
184
|
-
error:
|
|
185
|
-
expiresAt: new Date(
|
|
182
|
+
completedAt: u.completedAt ? new Date(u.completedAt) : void 0,
|
|
183
|
+
fileSize: u.fileSize,
|
|
184
|
+
error: u.error,
|
|
185
|
+
expiresAt: new Date(u.expiresAt),
|
|
186
186
|
downloadUrl: C
|
|
187
187
|
};
|
|
188
|
-
|
|
188
|
+
o(f);
|
|
189
189
|
}
|
|
190
|
-
|
|
191
|
-
} catch (
|
|
192
|
-
console.error("[useExportRecovery] Failed to recover exports:",
|
|
190
|
+
c.current = !0;
|
|
191
|
+
} catch (x) {
|
|
192
|
+
console.error("[useExportRecovery] Failed to recover exports:", x), c.current = !0;
|
|
193
193
|
}
|
|
194
194
|
})();
|
|
195
|
-
}, [
|
|
195
|
+
}, [d, a, o, m]);
|
|
196
196
|
}
|
|
197
197
|
function ct(e) {
|
|
198
198
|
return e.title ? e.title : B(
|
|
@@ -202,31 +202,31 @@ function ct(e) {
|
|
|
202
202
|
function dt({
|
|
203
203
|
open: e,
|
|
204
204
|
onOpenChange: s,
|
|
205
|
-
isLibraryVisual:
|
|
206
|
-
currentVisualName:
|
|
207
|
-
isSaving:
|
|
208
|
-
onConfirm:
|
|
205
|
+
isLibraryVisual: m,
|
|
206
|
+
currentVisualName: o,
|
|
207
|
+
isSaving: c = !1,
|
|
208
|
+
onConfirm: d
|
|
209
209
|
}) {
|
|
210
|
-
const [
|
|
211
|
-
|
|
212
|
-
), [
|
|
210
|
+
const [a, n] = A(
|
|
211
|
+
m && o ? `Copy of ${o}` : o || ""
|
|
212
|
+
), [x, u] = A(""), [g, C] = A(!m), [f, b] = A(!0);
|
|
213
213
|
oe.useEffect(() => {
|
|
214
|
-
e && (
|
|
215
|
-
|
|
216
|
-
),
|
|
217
|
-
}, [e,
|
|
214
|
+
e && (n(
|
|
215
|
+
m && o ? `Copy of ${o}` : o || ""
|
|
216
|
+
), u(""), C(!m), b(!0));
|
|
217
|
+
}, [e, m, o]);
|
|
218
218
|
const y = () => {
|
|
219
|
-
|
|
220
|
-
name:
|
|
221
|
-
description:
|
|
222
|
-
saveToLibrary:
|
|
223
|
-
saveToCurrentDashboard:
|
|
219
|
+
a.trim() && (!g && !f || d({
|
|
220
|
+
name: a.trim(),
|
|
221
|
+
description: x.trim() || void 0,
|
|
222
|
+
saveToLibrary: g,
|
|
223
|
+
saveToCurrentDashboard: f
|
|
224
224
|
}));
|
|
225
|
-
},
|
|
225
|
+
}, p = a.trim() && (g || f);
|
|
226
226
|
return /* @__PURE__ */ t(ce, { open: e, onOpenChange: s, children: /* @__PURE__ */ r(de, { className: "sm:max-w-[425px]", children: [
|
|
227
227
|
/* @__PURE__ */ r(ue, { children: [
|
|
228
228
|
/* @__PURE__ */ t(me, { children: "Save Visual As" }),
|
|
229
|
-
/* @__PURE__ */ t(he, { children:
|
|
229
|
+
/* @__PURE__ */ t(he, { children: m ? "Create a copy of this visual with a new name" : "Save this visual to make it reusable" })
|
|
230
230
|
] }),
|
|
231
231
|
/* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
|
|
232
232
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
@@ -235,10 +235,10 @@ function dt({
|
|
|
235
235
|
pe,
|
|
236
236
|
{
|
|
237
237
|
id: "name",
|
|
238
|
-
value:
|
|
239
|
-
onChange: (
|
|
238
|
+
value: a,
|
|
239
|
+
onChange: (v) => n(v.target.value),
|
|
240
240
|
placeholder: "Enter visual name",
|
|
241
|
-
disabled:
|
|
241
|
+
disabled: c
|
|
242
242
|
}
|
|
243
243
|
)
|
|
244
244
|
] }),
|
|
@@ -248,11 +248,11 @@ function dt({
|
|
|
248
248
|
fe,
|
|
249
249
|
{
|
|
250
250
|
id: "description",
|
|
251
|
-
value:
|
|
252
|
-
onChange: (
|
|
251
|
+
value: x,
|
|
252
|
+
onChange: (v) => u(v.target.value),
|
|
253
253
|
placeholder: "Enter visual description",
|
|
254
254
|
rows: 3,
|
|
255
|
-
disabled:
|
|
255
|
+
disabled: c
|
|
256
256
|
}
|
|
257
257
|
)
|
|
258
258
|
] }),
|
|
@@ -264,9 +264,9 @@ function dt({
|
|
|
264
264
|
_,
|
|
265
265
|
{
|
|
266
266
|
id: "save-to-dashboard",
|
|
267
|
-
checked:
|
|
268
|
-
onCheckedChange: (
|
|
269
|
-
disabled:
|
|
267
|
+
checked: f,
|
|
268
|
+
onCheckedChange: (v) => b(!!v),
|
|
269
|
+
disabled: c
|
|
270
270
|
}
|
|
271
271
|
),
|
|
272
272
|
/* @__PURE__ */ r(
|
|
@@ -276,7 +276,7 @@ function dt({
|
|
|
276
276
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
277
277
|
children: [
|
|
278
278
|
"Current Dashboard",
|
|
279
|
-
/* @__PURE__ */ t("span", { className: "ml-2 text-xs text-muted-foreground", children:
|
|
279
|
+
/* @__PURE__ */ t("span", { className: "ml-2 text-xs text-muted-foreground", children: m ? "(add copy to this dashboard)" : "(keep as local visual)" })
|
|
280
280
|
]
|
|
281
281
|
}
|
|
282
282
|
)
|
|
@@ -286,9 +286,9 @@ function dt({
|
|
|
286
286
|
_,
|
|
287
287
|
{
|
|
288
288
|
id: "save-to-library",
|
|
289
|
-
checked:
|
|
290
|
-
onCheckedChange: (
|
|
291
|
-
disabled:
|
|
289
|
+
checked: g,
|
|
290
|
+
onCheckedChange: (v) => C(!!v),
|
|
291
|
+
disabled: c
|
|
292
292
|
}
|
|
293
293
|
),
|
|
294
294
|
/* @__PURE__ */ r(
|
|
@@ -298,57 +298,57 @@ function dt({
|
|
|
298
298
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
299
299
|
children: [
|
|
300
300
|
"Visual Library",
|
|
301
|
-
/* @__PURE__ */ t("span", { className: "ml-2 text-xs text-muted-foreground", children:
|
|
301
|
+
/* @__PURE__ */ t("span", { className: "ml-2 text-xs text-muted-foreground", children: m ? "(save as new reusable visual)" : "(make available to all dashboards)" })
|
|
302
302
|
]
|
|
303
303
|
}
|
|
304
304
|
)
|
|
305
305
|
] })
|
|
306
306
|
] }),
|
|
307
|
-
!
|
|
307
|
+
!g && !f && /* @__PURE__ */ t("p", { className: "text-sm text-destructive", children: "Please select at least one destination" })
|
|
308
308
|
] })
|
|
309
309
|
] }),
|
|
310
310
|
/* @__PURE__ */ r(ge, { children: [
|
|
311
311
|
/* @__PURE__ */ t(
|
|
312
|
-
|
|
312
|
+
E,
|
|
313
313
|
{
|
|
314
314
|
variant: "outline",
|
|
315
315
|
onClick: () => s(!1),
|
|
316
|
-
disabled:
|
|
316
|
+
disabled: c,
|
|
317
317
|
children: "Cancel"
|
|
318
318
|
}
|
|
319
319
|
),
|
|
320
|
-
/* @__PURE__ */ r(
|
|
321
|
-
|
|
322
|
-
|
|
320
|
+
/* @__PURE__ */ r(E, { onClick: y, disabled: !p || c, children: [
|
|
321
|
+
c && /* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
322
|
+
c ? "Saving..." : "Save"
|
|
323
323
|
] })
|
|
324
324
|
] })
|
|
325
325
|
] }) });
|
|
326
326
|
}
|
|
327
327
|
function ut() {
|
|
328
|
-
const [e, s] = A(!1), [
|
|
328
|
+
const [e, s] = A(!1), [m, o] = A(!1), [c, d] = A(null), a = M((i) => i.frame), n = M((i) => i.card), x = ve(), u = I((i) => i.selectedSheetId), g = I(
|
|
329
329
|
(i) => i.actions.setIsDashboardPanelOpen
|
|
330
|
-
), { getUpdatedFrame: C } = ne(), { selectVisual:
|
|
330
|
+
), { getUpdatedFrame: C } = ne(), { selectVisual: f } = xe(), { addFrame: b, setSelectedFrameId: y, setIsVisualEditing: p } = re(), v = !!(a != null && a.visualId), N = (() => {
|
|
331
331
|
var i, w;
|
|
332
|
-
return ((i =
|
|
332
|
+
return ((i = a == null ? void 0 : a.cards) == null ? void 0 : i.length) === 1 && ((w = a.cards[0]) != null && w.title) ? a.cards[0].title : x != null && x.title ? x.title : (n == null ? void 0 : n.title) || "Untitled Visual";
|
|
333
333
|
})(), h = be((i) => {
|
|
334
334
|
if (i != null && i.id) {
|
|
335
|
-
if (
|
|
335
|
+
if (f(i), m && c && u) {
|
|
336
336
|
const w = {
|
|
337
|
-
...
|
|
337
|
+
...c,
|
|
338
338
|
id: j(),
|
|
339
339
|
visualId: i.id
|
|
340
340
|
// Link to the newly created library visual
|
|
341
341
|
};
|
|
342
|
-
b(
|
|
342
|
+
b(u, w, "end"), y(w.id), o(!1), d(null), p(!1);
|
|
343
343
|
}
|
|
344
|
-
|
|
344
|
+
g(!0), s(!1);
|
|
345
345
|
}
|
|
346
346
|
});
|
|
347
347
|
return {
|
|
348
348
|
saveAsDialogOpen: e,
|
|
349
349
|
setSaveAsDialogOpen: s,
|
|
350
350
|
handleSaveAs: async (i) => {
|
|
351
|
-
if (!
|
|
351
|
+
if (!u) {
|
|
352
352
|
U.error("No sheet selected");
|
|
353
353
|
return;
|
|
354
354
|
}
|
|
@@ -361,7 +361,7 @@ function ut() {
|
|
|
361
361
|
}))
|
|
362
362
|
} : w;
|
|
363
363
|
if (i.saveToLibrary) {
|
|
364
|
-
|
|
364
|
+
o(i.saveToCurrentDashboard), d(z);
|
|
365
365
|
const k = {
|
|
366
366
|
title: i.name,
|
|
367
367
|
description: i.description,
|
|
@@ -378,10 +378,10 @@ function ut() {
|
|
|
378
378
|
visualId: void 0
|
|
379
379
|
// Explicitly no visualId for local visuals
|
|
380
380
|
};
|
|
381
|
-
b(
|
|
381
|
+
b(u, k, "end"), y(k.id), U.success("Visual saved to dashboard"), s(!1), p(!1);
|
|
382
382
|
}
|
|
383
383
|
},
|
|
384
|
-
isLibraryVisual:
|
|
384
|
+
isLibraryVisual: v,
|
|
385
385
|
currentVisualName: N,
|
|
386
386
|
isSaving: h.isPending
|
|
387
387
|
};
|
|
@@ -389,31 +389,31 @@ function ut() {
|
|
|
389
389
|
function Nt({
|
|
390
390
|
className: e
|
|
391
391
|
}) {
|
|
392
|
-
const s = M((h) => h.frame),
|
|
393
|
-
saveAsDialogOpen:
|
|
392
|
+
const s = M((h) => h.frame), m = M((h) => h.card), o = we((h) => h.selectedVisual), c = I((h) => h.selectedFrameId), d = I((h) => h.selectedSheetId), { setIsVisualEditing: a } = re(), n = !!(s != null && s.visualId || o != null && o.id), x = !!(s != null && s.visualId && c), u = n && !x, {
|
|
393
|
+
saveAsDialogOpen: g,
|
|
394
394
|
setSaveAsDialogOpen: C,
|
|
395
|
-
handleSaveAs:
|
|
395
|
+
handleSaveAs: f,
|
|
396
396
|
isLibraryVisual: b,
|
|
397
397
|
currentVisualName: y,
|
|
398
|
-
isSaving:
|
|
399
|
-
} = ut(), { handleAddLibraryVisual:
|
|
400
|
-
if (!
|
|
398
|
+
isSaving: p
|
|
399
|
+
} = ut(), { handleAddLibraryVisual: v } = ne(), N = async () => {
|
|
400
|
+
if (!d) {
|
|
401
401
|
U.error("No dashboard sheet selected");
|
|
402
402
|
return;
|
|
403
403
|
}
|
|
404
|
-
if (!
|
|
404
|
+
if (!o) {
|
|
405
405
|
U.error("No visual selected");
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
const h = await
|
|
409
|
-
h.success ? (U.success("Visual added to dashboard"),
|
|
408
|
+
const h = await v(o);
|
|
409
|
+
h.success ? (U.success("Visual added to dashboard"), a(!1)) : U.error(h.error || "Failed to add visual to dashboard");
|
|
410
410
|
};
|
|
411
411
|
return /* @__PURE__ */ r(V, { children: [
|
|
412
|
-
!
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
412
|
+
!n && /* @__PURE__ */ t(Je, { className: e, variant: "default" }),
|
|
413
|
+
n && /* @__PURE__ */ r(V, { children: [
|
|
414
|
+
x && /* @__PURE__ */ t(Ke, { className: e }),
|
|
415
|
+
u && d && m && (m.sql || Ce(m.config)) && /* @__PURE__ */ r(
|
|
416
|
+
E,
|
|
417
417
|
{
|
|
418
418
|
onClick: N,
|
|
419
419
|
className: T(e),
|
|
@@ -425,11 +425,11 @@ function Nt({
|
|
|
425
425
|
]
|
|
426
426
|
}
|
|
427
427
|
),
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
u && /* @__PURE__ */ t(Ye, { className: e, variant: "default" }),
|
|
429
|
+
x && /* @__PURE__ */ t(Ze, { className: e }),
|
|
430
430
|
/* @__PURE__ */ r(G, { modal: !1, children: [
|
|
431
431
|
/* @__PURE__ */ t(q, { asChild: !0, children: /* @__PURE__ */ t(
|
|
432
|
-
|
|
432
|
+
E,
|
|
433
433
|
{
|
|
434
434
|
variant: "outline",
|
|
435
435
|
size: "sm",
|
|
@@ -451,9 +451,9 @@ function Nt({
|
|
|
451
451
|
) })
|
|
452
452
|
] })
|
|
453
453
|
] }),
|
|
454
|
-
!
|
|
454
|
+
!n && /* @__PURE__ */ r(G, { modal: !1, children: [
|
|
455
455
|
/* @__PURE__ */ t(q, { asChild: !0, children: /* @__PURE__ */ t(
|
|
456
|
-
|
|
456
|
+
E,
|
|
457
457
|
{
|
|
458
458
|
variant: "outline",
|
|
459
459
|
size: "sm",
|
|
@@ -470,14 +470,14 @@ function Nt({
|
|
|
470
470
|
/* @__PURE__ */ t(
|
|
471
471
|
dt,
|
|
472
472
|
{
|
|
473
|
-
open:
|
|
473
|
+
open: g,
|
|
474
474
|
onOpenChange: (h) => {
|
|
475
|
-
|
|
475
|
+
p || C(h);
|
|
476
476
|
},
|
|
477
477
|
isLibraryVisual: b,
|
|
478
478
|
currentVisualName: y,
|
|
479
|
-
isSaving:
|
|
480
|
-
onConfirm:
|
|
479
|
+
isSaving: p,
|
|
480
|
+
onConfirm: f
|
|
481
481
|
}
|
|
482
482
|
)
|
|
483
483
|
] });
|
|
@@ -487,16 +487,16 @@ function yt({
|
|
|
487
487
|
//labelClassName,
|
|
488
488
|
switchClassName: s
|
|
489
489
|
}) {
|
|
490
|
-
const
|
|
491
|
-
return !
|
|
490
|
+
const m = M((n) => n.isDevMode), o = I((n) => n.isVisualEditing), { setIsDevMode: c } = Ne(), { config: d } = ie(ye).tokenProps, a = (d == null ? void 0 : d.showAdvancedMode) !== !1;
|
|
491
|
+
return !o || !a ? null : /* @__PURE__ */ r("div", { className: T("flex items-center space-x-2", e), children: [
|
|
492
492
|
/* @__PURE__ */ t(
|
|
493
493
|
Ae,
|
|
494
494
|
{
|
|
495
495
|
className: T("", s),
|
|
496
|
-
checked:
|
|
497
|
-
onCheckedChange: () =>
|
|
496
|
+
checked: m,
|
|
497
|
+
onCheckedChange: () => c(!m),
|
|
498
498
|
id: "advanced-mode",
|
|
499
|
-
icon: /* @__PURE__ */ t(
|
|
499
|
+
icon: /* @__PURE__ */ t(Ee, { className: "h-4 w-4" }),
|
|
500
500
|
tooltip: "Advanced Mode"
|
|
501
501
|
}
|
|
502
502
|
),
|
|
@@ -506,12 +506,12 @@ function yt({
|
|
|
506
506
|
function At({
|
|
507
507
|
open: e,
|
|
508
508
|
onOpenChange: s,
|
|
509
|
-
onSave:
|
|
510
|
-
onDiscard:
|
|
511
|
-
isSaving:
|
|
509
|
+
onSave: m,
|
|
510
|
+
onDiscard: o,
|
|
511
|
+
isSaving: c
|
|
512
512
|
}) {
|
|
513
|
-
return /* @__PURE__ */ t(
|
|
514
|
-
!
|
|
513
|
+
return /* @__PURE__ */ t(Se, { open: e, onOpenChange: (a) => {
|
|
514
|
+
!a && c || s(a);
|
|
515
515
|
}, children: /* @__PURE__ */ r(De, { className: "max-w-md", children: [
|
|
516
516
|
/* @__PURE__ */ r(Ie, { children: [
|
|
517
517
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
|
|
@@ -524,7 +524,7 @@ function At({
|
|
|
524
524
|
/* @__PURE__ */ t(
|
|
525
525
|
Pe,
|
|
526
526
|
{
|
|
527
|
-
disabled:
|
|
527
|
+
disabled: c,
|
|
528
528
|
className: "order-1 m-0 border-border/50 sm:order-1",
|
|
529
529
|
children: "Cancel"
|
|
530
530
|
}
|
|
@@ -532,8 +532,8 @@ function At({
|
|
|
532
532
|
/* @__PURE__ */ t(
|
|
533
533
|
"button",
|
|
534
534
|
{
|
|
535
|
-
onClick:
|
|
536
|
-
disabled:
|
|
535
|
+
onClick: o,
|
|
536
|
+
disabled: c,
|
|
537
537
|
className: "order-2 rounded-md border border-destructive/20 bg-destructive/10 px-4 py-2 text-sm font-medium text-destructive transition-colors hover:bg-destructive/20 disabled:pointer-events-none disabled:opacity-50 sm:order-2",
|
|
538
538
|
children: "Discard"
|
|
539
539
|
}
|
|
@@ -541,10 +541,10 @@ function At({
|
|
|
541
541
|
/* @__PURE__ */ t(
|
|
542
542
|
Me,
|
|
543
543
|
{
|
|
544
|
-
onClick:
|
|
545
|
-
disabled:
|
|
544
|
+
onClick: m,
|
|
545
|
+
disabled: c,
|
|
546
546
|
className: "order-3 m-0 bg-primary text-primary-foreground hover:bg-primary/90 sm:order-3",
|
|
547
|
-
children:
|
|
547
|
+
children: c ? /* @__PURE__ */ r(V, { children: [
|
|
548
548
|
/* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
549
549
|
"Saving..."
|
|
550
550
|
] }) : "Save & Close"
|
|
@@ -553,41 +553,40 @@ function At({
|
|
|
553
553
|
] })
|
|
554
554
|
] }) });
|
|
555
555
|
}
|
|
556
|
-
function
|
|
557
|
-
|
|
558
|
-
e && !
|
|
559
|
-
}, [e,
|
|
556
|
+
function Et(e, s, m, o) {
|
|
557
|
+
S(() => {
|
|
558
|
+
e && !m && s && o(Ve(s));
|
|
559
|
+
}, [e, m, s, o]);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
562
|
-
triggerButtonClassName: e
|
|
561
|
+
function St({
|
|
562
|
+
triggerButtonClassName: e,
|
|
563
|
+
variant: s = "ghost"
|
|
563
564
|
}) {
|
|
564
|
-
const [
|
|
565
|
-
var
|
|
566
|
-
return (
|
|
567
|
-
}),
|
|
568
|
-
var
|
|
569
|
-
return (
|
|
570
|
-
})
|
|
571
|
-
|
|
572
|
-
return (p = a.dashboard) == null ? void 0 : p.sheets;
|
|
573
|
-
}), o = E((a) => a.selectedSheetId);
|
|
574
|
-
return l == null || l.find((a) => a.id === o), n ? /* @__PURE__ */ r(V, { children: [
|
|
565
|
+
const [m, o] = A(!1), c = I((a) => {
|
|
566
|
+
var n;
|
|
567
|
+
return (n = a.dashboard) == null ? void 0 : n.id;
|
|
568
|
+
}), d = I((a) => {
|
|
569
|
+
var n;
|
|
570
|
+
return (n = a.dashboard) == null ? void 0 : n.title;
|
|
571
|
+
});
|
|
572
|
+
return c ? /* @__PURE__ */ r(V, { children: [
|
|
575
573
|
/* @__PURE__ */ t(
|
|
576
574
|
Le,
|
|
577
575
|
{
|
|
578
576
|
tooltip: "Schedule Dashboard",
|
|
579
577
|
className: T("h-7 p-2", e),
|
|
580
|
-
|
|
578
|
+
buttonProps: { variant: s },
|
|
579
|
+
onClick: () => o(!0),
|
|
581
580
|
children: /* @__PURE__ */ t(ze, { className: "size-4" })
|
|
582
581
|
}
|
|
583
582
|
),
|
|
584
583
|
/* @__PURE__ */ t(
|
|
585
584
|
Oe,
|
|
586
585
|
{
|
|
587
|
-
open:
|
|
588
|
-
onOpenChange:
|
|
589
|
-
dashboardId:
|
|
590
|
-
dashboardName:
|
|
586
|
+
open: m,
|
|
587
|
+
onOpenChange: o,
|
|
588
|
+
dashboardId: c,
|
|
589
|
+
dashboardName: d
|
|
591
590
|
}
|
|
592
591
|
)
|
|
593
592
|
] }) : null;
|
|
@@ -596,11 +595,11 @@ function mt({
|
|
|
596
595
|
export: e,
|
|
597
596
|
onRemove: s
|
|
598
597
|
}) {
|
|
599
|
-
const
|
|
598
|
+
const m = () => {
|
|
600
599
|
e.downloadUrl && window.open(e.downloadUrl, "_blank");
|
|
601
|
-
},
|
|
602
|
-
|
|
603
|
-
},
|
|
600
|
+
}, o = (n) => {
|
|
601
|
+
n.stopPropagation(), s == null || s(e.id);
|
|
602
|
+
}, c = () => {
|
|
604
603
|
switch (e.status) {
|
|
605
604
|
case "completed":
|
|
606
605
|
return /* @__PURE__ */ t(_e, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
@@ -609,7 +608,7 @@ function mt({
|
|
|
609
608
|
default:
|
|
610
609
|
return /* @__PURE__ */ t(H, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
611
610
|
}
|
|
612
|
-
},
|
|
611
|
+
}, d = B(e.status), a = (() => {
|
|
613
612
|
switch (e.status) {
|
|
614
613
|
case "pending":
|
|
615
614
|
return "Queued...";
|
|
@@ -626,7 +625,7 @@ function mt({
|
|
|
626
625
|
return /* @__PURE__ */ r("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
|
|
627
626
|
/* @__PURE__ */ r("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
628
627
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
629
|
-
|
|
628
|
+
c(),
|
|
630
629
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
631
630
|
/* @__PURE__ */ t("h4", { className: "mb-1 truncate text-sm font-medium", children: e.title }),
|
|
632
631
|
e.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
@@ -639,17 +638,17 @@ function mt({
|
|
|
639
638
|
/* @__PURE__ */ t("span", { children: Re(e.fileSize) })
|
|
640
639
|
] })
|
|
641
640
|
] }),
|
|
642
|
-
|
|
641
|
+
d && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: a }),
|
|
643
642
|
e.status === "failed" && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-xs text-destructive", children: e.error || "Export failed" })
|
|
644
643
|
] })
|
|
645
644
|
] }),
|
|
646
645
|
/* @__PURE__ */ t(
|
|
647
|
-
|
|
646
|
+
E,
|
|
648
647
|
{
|
|
649
648
|
variant: "ghost",
|
|
650
649
|
size: "icon",
|
|
651
650
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
652
|
-
onClick:
|
|
651
|
+
onClick: o,
|
|
653
652
|
"aria-label": "Remove notification",
|
|
654
653
|
children: /* @__PURE__ */ t(Be, { className: "h-4 w-4" })
|
|
655
654
|
}
|
|
@@ -659,12 +658,12 @@ function mt({
|
|
|
659
658
|
e.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
660
659
|
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: Y(e.startedAt, { addSuffix: !0 }) }),
|
|
661
660
|
e.downloadUrl && /* @__PURE__ */ r(
|
|
662
|
-
|
|
661
|
+
E,
|
|
663
662
|
{
|
|
664
663
|
size: "sm",
|
|
665
664
|
variant: "outline",
|
|
666
665
|
className: "h-8 bg-transparent",
|
|
667
|
-
onClick:
|
|
666
|
+
onClick: m,
|
|
668
667
|
children: [
|
|
669
668
|
/* @__PURE__ */ t($e, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
670
669
|
"Download"
|
|
@@ -672,7 +671,7 @@ function mt({
|
|
|
672
671
|
}
|
|
673
672
|
)
|
|
674
673
|
] }),
|
|
675
|
-
|
|
674
|
+
d && /* @__PURE__ */ r("div", { children: [
|
|
676
675
|
/* @__PURE__ */ t(He, { value: e.progress, className: "h-1.5" }),
|
|
677
676
|
/* @__PURE__ */ r("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
678
677
|
e.progress,
|
|
@@ -684,94 +683,94 @@ function mt({
|
|
|
684
683
|
] });
|
|
685
684
|
}
|
|
686
685
|
function ht() {
|
|
687
|
-
const { authToken: e, tokenProps: s } = R(),
|
|
688
|
-
(
|
|
689
|
-
), C =
|
|
690
|
-
(
|
|
691
|
-
),
|
|
692
|
-
const
|
|
693
|
-
if (!(!
|
|
694
|
-
|
|
686
|
+
const { authToken: e, tokenProps: s } = R(), m = D((p) => p.activeExports), { clearCompleted: o, removeExport: c, updateExport: d } = ae(), [a, n] = A(!1), [x, u] = A(!1), g = Array.from(m.values()).sort(
|
|
687
|
+
(p, v) => v.startedAt.getTime() - p.startedAt.getTime()
|
|
688
|
+
), C = g.some(
|
|
689
|
+
(p) => p.status === "completed" || p.status === "failed"
|
|
690
|
+
), f = P(async () => {
|
|
691
|
+
const p = s == null ? void 0 : s.apiServiceUrl, v = e == null ? void 0 : e.accessToken;
|
|
692
|
+
if (!(!p || !v)) {
|
|
693
|
+
n(!0);
|
|
695
694
|
try {
|
|
696
|
-
const N = Array.from(
|
|
695
|
+
const N = Array.from(m.values());
|
|
697
696
|
await Promise.all(
|
|
698
697
|
N.map(async (h) => {
|
|
699
698
|
try {
|
|
700
|
-
const
|
|
699
|
+
const l = await se(p, v, h.id);
|
|
701
700
|
let i;
|
|
702
|
-
if (
|
|
701
|
+
if (l.status === "completed")
|
|
703
702
|
try {
|
|
704
703
|
i = await $(
|
|
705
|
-
|
|
706
|
-
|
|
704
|
+
p,
|
|
705
|
+
v,
|
|
707
706
|
h.id
|
|
708
707
|
);
|
|
709
708
|
} catch (w) {
|
|
710
709
|
console.error(`Failed to get download URL for ${h.id}:`, w);
|
|
711
710
|
}
|
|
712
|
-
|
|
713
|
-
status:
|
|
714
|
-
progress:
|
|
715
|
-
completedChunks:
|
|
716
|
-
completedAt:
|
|
711
|
+
d(h.id, {
|
|
712
|
+
status: l.status,
|
|
713
|
+
progress: l.progress,
|
|
714
|
+
completedChunks: l.completedChunks,
|
|
715
|
+
completedAt: l.completedAt ? new Date(l.completedAt) : void 0,
|
|
717
716
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
718
|
-
fileSize:
|
|
719
|
-
error:
|
|
717
|
+
fileSize: l.fileSize,
|
|
718
|
+
error: l.error,
|
|
720
719
|
downloadUrl: i
|
|
721
720
|
});
|
|
722
|
-
} catch (
|
|
723
|
-
console.error(`Failed to refresh export ${h.id}:`,
|
|
721
|
+
} catch (l) {
|
|
722
|
+
console.error(`Failed to refresh export ${h.id}:`, l);
|
|
724
723
|
}
|
|
725
724
|
})
|
|
726
725
|
);
|
|
727
726
|
} finally {
|
|
728
|
-
|
|
727
|
+
n(!1);
|
|
729
728
|
}
|
|
730
729
|
}
|
|
731
730
|
}, [
|
|
732
|
-
|
|
731
|
+
m,
|
|
733
732
|
e == null ? void 0 : e.accessToken,
|
|
734
733
|
s == null ? void 0 : s.apiServiceUrl,
|
|
735
|
-
|
|
734
|
+
d
|
|
736
735
|
]), b = P(async () => {
|
|
737
|
-
const
|
|
738
|
-
if (!
|
|
739
|
-
|
|
736
|
+
const p = s == null ? void 0 : s.apiServiceUrl, v = e == null ? void 0 : e.accessToken;
|
|
737
|
+
if (!p || !v) {
|
|
738
|
+
o();
|
|
740
739
|
return;
|
|
741
740
|
}
|
|
742
|
-
|
|
741
|
+
u(!0);
|
|
743
742
|
try {
|
|
744
|
-
const N =
|
|
745
|
-
(
|
|
743
|
+
const N = g.filter(
|
|
744
|
+
(l) => l.status === "completed" || l.status === "failed"
|
|
746
745
|
), h = await Promise.allSettled(
|
|
747
|
-
N.map(async (
|
|
746
|
+
N.map(async (l) => (await J(p, v, l.id), l.id))
|
|
748
747
|
);
|
|
749
|
-
for (const
|
|
750
|
-
|
|
748
|
+
for (const l of h)
|
|
749
|
+
l.status === "fulfilled" ? c(l.value) : console.error("Failed to delete export:", l.reason);
|
|
751
750
|
} finally {
|
|
752
|
-
|
|
751
|
+
u(!1);
|
|
753
752
|
}
|
|
754
753
|
}, [
|
|
755
|
-
|
|
754
|
+
g,
|
|
756
755
|
s == null ? void 0 : s.apiServiceUrl,
|
|
757
756
|
e == null ? void 0 : e.accessToken,
|
|
758
|
-
|
|
759
|
-
|
|
757
|
+
o,
|
|
758
|
+
c
|
|
760
759
|
]), y = P(
|
|
761
|
-
async (
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
760
|
+
async (p) => {
|
|
761
|
+
const v = s == null ? void 0 : s.apiServiceUrl, N = e == null ? void 0 : e.accessToken;
|
|
762
|
+
if (v && N)
|
|
764
763
|
try {
|
|
765
|
-
await J(
|
|
764
|
+
await J(v, N, p), c(p);
|
|
766
765
|
return;
|
|
767
766
|
} catch (h) {
|
|
768
|
-
console.error(`Failed to cancel export ${
|
|
767
|
+
console.error(`Failed to cancel export ${p}:`, h);
|
|
769
768
|
}
|
|
770
|
-
|
|
769
|
+
c(p);
|
|
771
770
|
},
|
|
772
|
-
[s == null ? void 0 : s.apiServiceUrl, e == null ? void 0 : e.accessToken,
|
|
771
|
+
[s == null ? void 0 : s.apiServiceUrl, e == null ? void 0 : e.accessToken, c]
|
|
773
772
|
);
|
|
774
|
-
return
|
|
773
|
+
return g.length === 0 ? /* @__PURE__ */ r("div", { className: "p-6 text-center", children: [
|
|
775
774
|
/* @__PURE__ */ t(Z, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
|
|
776
775
|
/* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
|
|
777
776
|
/* @__PURE__ */ t("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
|
|
@@ -783,52 +782,52 @@ function ht() {
|
|
|
783
782
|
] }),
|
|
784
783
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
785
784
|
/* @__PURE__ */ t(
|
|
786
|
-
|
|
785
|
+
E,
|
|
787
786
|
{
|
|
788
787
|
variant: "ghost",
|
|
789
788
|
size: "sm",
|
|
790
789
|
className: "h-7 w-7 p-0",
|
|
791
|
-
onClick:
|
|
792
|
-
disabled:
|
|
790
|
+
onClick: f,
|
|
791
|
+
disabled: a,
|
|
793
792
|
title: "Refresh status",
|
|
794
793
|
children: /* @__PURE__ */ t(
|
|
795
794
|
je,
|
|
796
795
|
{
|
|
797
|
-
className: `h-4 w-4 ${
|
|
796
|
+
className: `h-4 w-4 ${a ? "animate-spin" : ""}`
|
|
798
797
|
}
|
|
799
798
|
)
|
|
800
799
|
}
|
|
801
800
|
),
|
|
802
801
|
C && /* @__PURE__ */ t(
|
|
803
|
-
|
|
802
|
+
E,
|
|
804
803
|
{
|
|
805
804
|
variant: "ghost",
|
|
806
805
|
size: "sm",
|
|
807
806
|
className: "h-7 px-2 text-sm",
|
|
808
807
|
onClick: b,
|
|
809
|
-
disabled:
|
|
810
|
-
children:
|
|
808
|
+
disabled: x,
|
|
809
|
+
children: x ? "Clearing..." : "Clear all"
|
|
811
810
|
}
|
|
812
811
|
)
|
|
813
812
|
] })
|
|
814
813
|
] }),
|
|
815
|
-
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children:
|
|
814
|
+
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: g.map((p) => /* @__PURE__ */ t(
|
|
816
815
|
mt,
|
|
817
816
|
{
|
|
818
|
-
export:
|
|
817
|
+
export: p,
|
|
819
818
|
onRemove: y
|
|
820
819
|
},
|
|
821
|
-
|
|
820
|
+
p.id
|
|
822
821
|
)) }) })
|
|
823
822
|
] });
|
|
824
823
|
}
|
|
825
824
|
function Dt() {
|
|
826
|
-
const e =
|
|
827
|
-
(
|
|
828
|
-
),
|
|
825
|
+
const e = D((n) => n.activeExports), s = Ge(), m = e.size > 0, o = Array.from(e.values()).some(
|
|
826
|
+
(n) => n.status === "completed" || n.status === "failed"
|
|
827
|
+
), d = s > 0 ? s > 9 ? "9+" : String(s) : null;
|
|
829
828
|
return /* @__PURE__ */ r(qe, { children: [
|
|
830
829
|
/* @__PURE__ */ t(Xe, { asChild: !0, children: /* @__PURE__ */ r(
|
|
831
|
-
|
|
830
|
+
E,
|
|
832
831
|
{
|
|
833
832
|
variant: "ghost",
|
|
834
833
|
size: "icon",
|
|
@@ -836,11 +835,11 @@ function Dt() {
|
|
|
836
835
|
"aria-label": "Export notifications",
|
|
837
836
|
children: [
|
|
838
837
|
/* @__PURE__ */ t(Qe, { className: "h-4 w-4" }),
|
|
839
|
-
|
|
838
|
+
m && /* @__PURE__ */ t(
|
|
840
839
|
"span",
|
|
841
840
|
{
|
|
842
|
-
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${
|
|
843
|
-
children:
|
|
841
|
+
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${d ? "-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"}`,
|
|
842
|
+
children: d
|
|
844
843
|
}
|
|
845
844
|
)
|
|
846
845
|
]
|
|
@@ -853,11 +852,11 @@ export {
|
|
|
853
852
|
yt as A,
|
|
854
853
|
mt as E,
|
|
855
854
|
Dt as N,
|
|
856
|
-
|
|
855
|
+
St as S,
|
|
857
856
|
At as U,
|
|
858
857
|
Nt as V,
|
|
859
858
|
ht as a,
|
|
860
859
|
Ct as b,
|
|
861
|
-
|
|
860
|
+
Et as c,
|
|
862
861
|
wt as u
|
|
863
862
|
};
|