react-semaphor 0.1.546 → 0.1.548
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.js +71 -68
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/applied-constraints-DU-wndZ7.js +47 -0
- package/dist/chunks/{assistant-chat-BPXhulAx.js → assistant-chat-DCcWsoGm.js} +106 -106
- package/dist/chunks/{bookmark-state-C4vetoa0.js → bookmark-state-Cu-a5ie_.js} +2 -8
- package/dist/chunks/{custom-visual-inputs-CkJW9pBS.js → custom-visual-inputs-BTRnwsfd.js} +1 -1
- package/dist/chunks/{dashboard-C3CoKbGY.js → dashboard-BZHL9a-z.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Be4h-7My.js → dashboard-briefing-launcher-DML-cAzB.js} +528 -528
- package/dist/chunks/{dashboard-controls-bxPrlSyp.js → dashboard-controls-BGoBTPS7.js} +45 -45
- package/dist/chunks/{dashboard-json-BrjxIiRt.js → dashboard-json-iHPsdn3j.js} +1 -1
- package/dist/chunks/{document-dashboard-inputs-CRVHpIHp.js → document-dashboard-inputs-B2AqPfrq.js} +94 -94
- package/dist/chunks/{edit-dashboard-visual-DYYYDjY6.js → edit-dashboard-visual-CLEFFf2T.js} +281 -281
- package/dist/chunks/{column-catalog-BYnochWQ.js → filter-reach-copy-ByzGadUk.js} +978 -861
- package/dist/chunks/{global-date-filter-utils-9d6m9-FE.js → global-date-filter-utils-CeeFJ1CP.js} +4070 -3792
- package/dist/chunks/{index-DkQkMKa1.js → index-DeDHr3iz.js} +30 -30
- package/dist/chunks/{raw-temporal-presentation-CBzrDOjM.js → raw-temporal-presentation-CrUM2I_o.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-4QEZWe5U.js → report-preferences-dialog-CM7kXmXp.js} +59 -59
- package/dist/chunks/{resolve-dashboard-input-context-UpK_LBpL.js → resolve-dashboard-input-context-BmWF9hSl.js} +1511 -1612
- package/dist/chunks/{saved-dashboard-context-D_I3Lxk0.js → saved-dashboard-context-qtfzl9Eb.js} +5 -5
- package/dist/chunks/{semaphor-ready-indicator-4zpRHE-X.js → semaphor-ready-indicator-Ol6VcaR7.js} +36548 -35855
- package/dist/chunks/{shelf-drop-preview-context-Cfw7TRAx.js → shelf-drop-preview-context-C2SEC3I9.js} +80 -80
- package/dist/chunks/{source-entity-resolution-BIGRvtbG.js → source-entity-resolution-D195CrYS.js} +221 -192
- package/dist/chunks/{table-settings-CunhoDUi.js → table-settings-WysCBj62.js} +133 -124
- package/dist/chunks/{use-create-flow-overlay-state-DZBZiiD-.js → use-create-flow-overlay-state-CbGIjaVD.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1419 -1340
- package/dist/data-app-sdk-validation/index.js +1 -1
- package/dist/index.js +14 -14
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +7 -0
- package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -4
- package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +3 -0
- package/dist/types/index.js +2 -2
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +383 -22
- package/dist/types/lib/dashboard-inputs/dashboard-filter-value-identity.d.ts +65 -0
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +3 -3
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +9 -1
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +5 -1
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +83 -13
- package/dist/types/lib/stores/dashboard-store.d.ts +12 -0
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +57 -1
- package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +3 -3
- package/dist/types/shared/dashboard-authoring/dashboard-filter-automatic-target.d.ts +4 -4
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-types.d.ts +27 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-value-compatibility.d.ts +12 -3
- package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-preview.d.ts +97 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +26 -4
- package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +22 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as O } from "react/jsx-runtime";
|
|
2
2
|
import Et, { useState as D, useEffect as be, useCallback as ae, useMemo as re, useLayoutEffect as kt, useRef as nt, useContext as Kt } from "react";
|
|
3
|
-
import { cC as ot, bE as Fe, bF as Ee, bH as Ie, cD as Xt, b2 as It, b0 as Qe, cE as Yt, cF as Ge, cG as it, a4 as Ke, a1 as de, u as
|
|
3
|
+
import { cC as ot, bE as Fe, bF as Ee, bH as Ie, cD as Xt, b2 as It, b0 as Qe, cE as Yt, cF as Ge, cG as it, a4 as Ke, a1 as de, u as N, cH as Zt, cI as Jt, bD as F, cJ as ea, a3 as ee, be as ta, cK as aa, cL as ra, aX as xe, cr as Lt, aO as _e, o as na, k as sa, cM as oa, cu as lt, cv as dt, cw as ct, cx as ut, cy as ht, cz as mt, cA as pt, cB as Vt, aM as ft, cN as ia, cO as la, cj as et, cg as Le, ch as Ve, cP as Tt, ci as Te, c0 as X, cs as da, cq as je, cQ as ca, b_ as ua, bG as gt, bI as bt, cR as ha, bC as ma, cS as Bt, cT as xt, cU as pa, c4 as fa, i as ga, cV as ba, cW as xa, cX as K, cY as va, R as Pt, cZ as ya, c_ as Ca, c$ as wa, d0 as Na, aJ as Sa, d1 as he, d2 as ka, P as vt, d3 as Da, d4 as Aa, d5 as Fa, d6 as Ea, d7 as Ia, d8 as La, d9 as Va, da as Mt, db as Ta, dc as Ba, dd as Pa, de as Ut, df as Ma, dg as Re, dh as Ua, di as Ra, dj as za, A as Oa, ay as _a, az as ja, ae as $a, ad as Wa, ac as qa, ab as Ha, a8 as Qa, a6 as Ga, dk as Ka, dl as Xa, dm as Ya, dn as Za, dp as Ja, aw as er } from "./semaphor-ready-indicator-Ol6VcaR7.js";
|
|
4
4
|
import { B as L, l as De, q as st, L as ne, j as Rt, c as yt, i as tr, P as $e, a as We, b as qe, S as zt } from "./switch-CEBOR4n7.js";
|
|
5
5
|
import { L as Ae } from "./layout-grid-Bgzth8vd.js";
|
|
6
6
|
import { c as fe, X as Xe, C as Ct } from "./x-4f5U2XwU.js";
|
|
@@ -13,17 +13,17 @@ import "../value-format-preferences/index.js";
|
|
|
13
13
|
import { c as J } from "./_commonjsHelpers-DimLPMtv.js";
|
|
14
14
|
import { S as rr } from "./selection-reducer-CJzkTZio.js";
|
|
15
15
|
import { s as ze } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
|
|
16
|
-
import {
|
|
16
|
+
import { aL as nr, ay as sr, e1 as He, v as Dt, e2 as or, as as wt, e3 as ir, dq as lr, dc as dr, bp as cr, e4 as ur } from "./global-date-filter-utils-CeeFJ1CP.js";
|
|
17
17
|
import { f as hr } from "./editor-draft-sync-BN5qYHPF.js";
|
|
18
18
|
import "react-dom";
|
|
19
19
|
import "./pivot-result-lifecycle-pwq3b7LC.js";
|
|
20
20
|
import "./index-CtoK1Lgu.js";
|
|
21
|
-
import { I as mr } from "./table-settings-
|
|
22
|
-
import { S as
|
|
23
|
-
import { V as pr, L as fr, a as gr, u as
|
|
21
|
+
import { I as mr } from "./table-settings-WysCBj62.js";
|
|
22
|
+
import { S as Ot } from "./save-CfJpQQ68.js";
|
|
23
|
+
import { V as pr, L as fr, a as gr, u as _t, C as jt, F as br, b as xr } from "./use-create-flow-overlay-state-CbGIjaVD.js";
|
|
24
24
|
import { q as At } from "./matrix-formatter-DWEeC0_c.js";
|
|
25
|
-
import { g as vr, f as yr } from "./document-dashboard-inputs-
|
|
26
|
-
import { g as le, d as Cr, a as wr } from "./index-
|
|
25
|
+
import { g as vr, f as yr } from "./document-dashboard-inputs-B2AqPfrq.js";
|
|
26
|
+
import { g as le, d as Cr, a as wr } from "./index-DeDHr3iz.js";
|
|
27
27
|
/**
|
|
28
28
|
* @license lucide-react v0.453.0 - ISC
|
|
29
29
|
*
|
|
@@ -117,47 +117,47 @@ const Er = fe("Newspaper", [
|
|
|
117
117
|
["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
|
|
118
118
|
]);
|
|
119
119
|
function Ir() {
|
|
120
|
-
return /* @__PURE__ */ e("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((t,
|
|
120
|
+
return /* @__PURE__ */ e("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((t, a) => /* @__PURE__ */ r(
|
|
121
121
|
"div",
|
|
122
122
|
{
|
|
123
123
|
className: "flex animate-pulse items-start gap-3 rounded-xl border border-transparent px-2.5 py-2.5",
|
|
124
124
|
children: [
|
|
125
125
|
/* @__PURE__ */ e("div", { className: "mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60" }),
|
|
126
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ r("div", { className: "flex-1 space-y-1.5", children: [
|
|
127
127
|
/* @__PURE__ */ e("div", { className: "h-4 w-3/5 rounded bg-muted/60" }),
|
|
128
128
|
/* @__PURE__ */ e("div", { className: "h-3 w-4/5 rounded bg-muted/40" })
|
|
129
129
|
] })
|
|
130
130
|
]
|
|
131
131
|
},
|
|
132
|
-
|
|
132
|
+
a
|
|
133
133
|
)) });
|
|
134
134
|
}
|
|
135
135
|
function Lr({
|
|
136
136
|
open: t,
|
|
137
|
-
onOpenChange:
|
|
137
|
+
onOpenChange: a,
|
|
138
138
|
onSubmit: o,
|
|
139
139
|
isCreating: s
|
|
140
140
|
}) {
|
|
141
|
-
const i = ot("interactive"), [
|
|
141
|
+
const i = ot("interactive"), [n, c] = D(""), [d, l] = D("");
|
|
142
142
|
be(() => {
|
|
143
143
|
t || (c(""), l(""));
|
|
144
144
|
}, [t]);
|
|
145
145
|
const u = () => {
|
|
146
|
-
|
|
146
|
+
n.trim() && o({ title: n, description: d });
|
|
147
147
|
}, h = (m) => {
|
|
148
|
-
|
|
148
|
+
a(m);
|
|
149
149
|
};
|
|
150
|
-
return /* @__PURE__ */ e(Fe, { open: t, onOpenChange: h, children: /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ e(Fe, { open: t, onOpenChange: h, children: /* @__PURE__ */ r(
|
|
151
151
|
Ee,
|
|
152
152
|
{
|
|
153
153
|
showCloseButton: !1,
|
|
154
154
|
className: "flex max-w-lg grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
|
|
155
155
|
style: i.dialogStyle,
|
|
156
156
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
158
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
159
159
|
/* @__PURE__ */ e(Ae, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
161
161
|
/* @__PURE__ */ e(Ie, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
|
|
162
162
|
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
|
|
163
163
|
] })
|
|
@@ -175,9 +175,9 @@ function Lr({
|
|
|
175
175
|
}
|
|
176
176
|
)
|
|
177
177
|
] }),
|
|
178
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ r("div", { className: "space-y-3 px-4 py-3", children: [
|
|
179
179
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
|
|
180
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
181
181
|
/* @__PURE__ */ e(De, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
|
|
182
182
|
/* @__PURE__ */ e(
|
|
183
183
|
st,
|
|
@@ -185,7 +185,7 @@ function Lr({
|
|
|
185
185
|
id: "visual-title",
|
|
186
186
|
size: "sm",
|
|
187
187
|
placeholder: "Untitled visual",
|
|
188
|
-
value:
|
|
188
|
+
value: n,
|
|
189
189
|
onChange: (m) => c(m.target.value),
|
|
190
190
|
disabled: s,
|
|
191
191
|
onKeyDown: (m) => {
|
|
@@ -194,7 +194,7 @@ function Lr({
|
|
|
194
194
|
}
|
|
195
195
|
)
|
|
196
196
|
] }),
|
|
197
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
198
198
|
/* @__PURE__ */ e(De, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
|
|
199
199
|
/* @__PURE__ */ e(
|
|
200
200
|
st,
|
|
@@ -209,7 +209,7 @@ function Lr({
|
|
|
209
209
|
)
|
|
210
210
|
] })
|
|
211
211
|
] }),
|
|
212
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ r("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
|
|
213
213
|
/* @__PURE__ */ e(
|
|
214
214
|
L,
|
|
215
215
|
{
|
|
@@ -225,8 +225,8 @@ function Lr({
|
|
|
225
225
|
{
|
|
226
226
|
size: "xs",
|
|
227
227
|
onClick: u,
|
|
228
|
-
disabled: !
|
|
229
|
-
children: s ? /* @__PURE__ */
|
|
228
|
+
disabled: !n.trim() || s,
|
|
229
|
+
children: s ? /* @__PURE__ */ r(O, { children: [
|
|
230
230
|
/* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
231
231
|
"Creating..."
|
|
232
232
|
] }) : "Create library visual"
|
|
@@ -238,13 +238,13 @@ function Lr({
|
|
|
238
238
|
) });
|
|
239
239
|
}
|
|
240
240
|
function Vr(t) {
|
|
241
|
-
const [
|
|
241
|
+
const [a, o] = D(null), [s, i] = D(null), n = Xt();
|
|
242
242
|
return be(() => {
|
|
243
243
|
if (!t || t.trim() === "") {
|
|
244
244
|
o(null), i(null);
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
|
-
if (!
|
|
247
|
+
if (!n)
|
|
248
248
|
return;
|
|
249
249
|
(async () => {
|
|
250
250
|
try {
|
|
@@ -274,21 +274,21 @@ function Vr(t) {
|
|
|
274
274
|
console.error("Failed to load remote chart store:", l), i(l), o(null);
|
|
275
275
|
}
|
|
276
276
|
})();
|
|
277
|
-
}, [t,
|
|
277
|
+
}, [t, n]), a;
|
|
278
278
|
}
|
|
279
|
-
function Tr(t,
|
|
279
|
+
function Tr(t, a) {
|
|
280
280
|
if (t.length === 0)
|
|
281
281
|
return "";
|
|
282
282
|
const o = t.find(
|
|
283
283
|
(s) => {
|
|
284
|
-
var i,
|
|
285
|
-
return ((i = s.customCardPreferences) == null ? void 0 : i.visualType) === "multiple" || !!((
|
|
284
|
+
var i, n;
|
|
285
|
+
return ((i = s.customCardPreferences) == null ? void 0 : i.visualType) === "multiple" || !!((n = s.customCardPreferences) != null && n.dataInputCardIds);
|
|
286
286
|
}
|
|
287
287
|
);
|
|
288
288
|
if (o)
|
|
289
289
|
return o.id;
|
|
290
|
-
if (
|
|
291
|
-
const s = t.find((i) => i.id ===
|
|
290
|
+
if (a) {
|
|
291
|
+
const s = t.find((i) => i.id === a);
|
|
292
292
|
if (s) {
|
|
293
293
|
const i = s.tabTitle;
|
|
294
294
|
if (i == "All__Header")
|
|
@@ -299,15 +299,15 @@ function Tr(t, r) {
|
|
|
299
299
|
);
|
|
300
300
|
return d ? d.id : t[0].id;
|
|
301
301
|
}
|
|
302
|
-
return
|
|
302
|
+
return a;
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
return t[0].id;
|
|
306
306
|
}
|
|
307
|
-
async function Ft(t,
|
|
308
|
-
if (!
|
|
307
|
+
async function Ft(t, a, o, s, i = "Opening library visual...") {
|
|
308
|
+
if (!a || !o)
|
|
309
309
|
throw new Error("Missing auth token or visual ID");
|
|
310
|
-
const
|
|
310
|
+
const n = ["resource-by-id", "visual", o], c = s.getQueryData(n);
|
|
311
311
|
if (c)
|
|
312
312
|
return console.log("Using cached visual data for:", o), { data: c, fromCache: !0 };
|
|
313
313
|
console.log("Fetching visual data from network for:", o);
|
|
@@ -319,14 +319,14 @@ async function Ft(t, r, o, s, i = "Opening library visual...") {
|
|
|
319
319
|
`${t}/management/v1/visuals/${o}`,
|
|
320
320
|
{
|
|
321
321
|
headers: {
|
|
322
|
-
Authorization: `Bearer ${
|
|
322
|
+
Authorization: `Bearer ${a}`
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
);
|
|
326
326
|
if (!l.ok)
|
|
327
327
|
throw new Error("Failed to load visual");
|
|
328
328
|
const u = await l.json();
|
|
329
|
-
return s.setQueryData(
|
|
329
|
+
return s.setQueryData(n, u), F.dismiss(d), { data: u, fromCache: !1 };
|
|
330
330
|
} catch (l) {
|
|
331
331
|
throw F.dismiss(d), l;
|
|
332
332
|
}
|
|
@@ -338,9 +338,9 @@ function $t(t) {
|
|
|
338
338
|
return t;
|
|
339
339
|
throw new Error("Invalid frame object format");
|
|
340
340
|
}
|
|
341
|
-
function Br(t,
|
|
342
|
-
var
|
|
343
|
-
const o = (t == null ? void 0 : t.frameObject) ?? ((
|
|
341
|
+
function Br(t, a) {
|
|
342
|
+
var n, c;
|
|
343
|
+
const o = (t == null ? void 0 : t.frameObject) ?? ((n = t == null ? void 0 : t.visual) == null ? void 0 : n.frameObject);
|
|
344
344
|
if (!o)
|
|
345
345
|
return !1;
|
|
346
346
|
const s = $t(o);
|
|
@@ -350,7 +350,7 @@ function Br(t, r) {
|
|
|
350
350
|
(d) => d.id === s.activeCardId
|
|
351
351
|
);
|
|
352
352
|
return i ? (ea({
|
|
353
|
-
...
|
|
353
|
+
...a,
|
|
354
354
|
frame: s,
|
|
355
355
|
card: i,
|
|
356
356
|
visualId: (t == null ? void 0 : t.id) || s.visualId
|
|
@@ -362,20 +362,20 @@ function Pr() {
|
|
|
362
362
|
var i;
|
|
363
363
|
return ((i = s.card.customCardPreferences) == null ? void 0 : i.url) || "";
|
|
364
364
|
}
|
|
365
|
-
),
|
|
365
|
+
), a = Vr(t);
|
|
366
366
|
return { getUpdatedFrame: ae(() => {
|
|
367
367
|
var f;
|
|
368
368
|
hr();
|
|
369
369
|
const {
|
|
370
370
|
frame: s,
|
|
371
371
|
card: i,
|
|
372
|
-
isDevMode:
|
|
372
|
+
isDevMode: n,
|
|
373
373
|
selectedSchemaName: c,
|
|
374
374
|
selectedDatabaseName: d,
|
|
375
375
|
selectedTableName: l,
|
|
376
376
|
selectedConnectionId: u
|
|
377
|
-
} = ee.getState(), h = i.sql, m = (f =
|
|
378
|
-
isDevMode:
|
|
377
|
+
} = ee.getState(), h = i.sql, m = (f = a == null ? void 0 : a.getState()) == null ? void 0 : f.settings, p = nr(i, {
|
|
378
|
+
isDevMode: n,
|
|
379
379
|
cardSql: h,
|
|
380
380
|
selectedSchemaName: c,
|
|
381
381
|
selectedDatabaseName: d,
|
|
@@ -391,10 +391,10 @@ function Pr() {
|
|
|
391
391
|
cards: g,
|
|
392
392
|
activeCardId: Tr(g, s.activeCardId)
|
|
393
393
|
};
|
|
394
|
-
}, [
|
|
394
|
+
}, [a]) };
|
|
395
395
|
}
|
|
396
396
|
function ve() {
|
|
397
|
-
const { authToken: t, tokenProps:
|
|
397
|
+
const { authToken: t, tokenProps: a } = It(), o = Qe(), s = Yt(), i = Ge(), { selectVisual: n } = it(), {
|
|
398
398
|
setFrame: c,
|
|
399
399
|
setCard: d,
|
|
400
400
|
setIsDevMode: l,
|
|
@@ -412,19 +412,19 @@ function ve() {
|
|
|
412
412
|
clearEditorContext: A
|
|
413
413
|
} = Ke(), {
|
|
414
414
|
setIsDashboardEditing: z,
|
|
415
|
-
setIsVisualEditing:
|
|
416
|
-
setSelectedFrameId:
|
|
415
|
+
setIsVisualEditing: C,
|
|
416
|
+
setSelectedFrameId: w,
|
|
417
417
|
clearSelectedFrameId: x
|
|
418
|
-
} = de(), E =
|
|
418
|
+
} = de(), E = N((H) => H.selectedSheetId), S = N((H) => H.selectedFrameId), j = N((H) => H.dashboard), I = N(
|
|
419
419
|
(H) => H.inlineFilterValuesMap
|
|
420
420
|
), T = Zt((i == null ? void 0 : i.id) || "", {
|
|
421
421
|
enabled: !!(i != null && i.id) && !!(t != null && t.accessToken)
|
|
422
422
|
}), Z = ae(
|
|
423
423
|
async (H) => {
|
|
424
424
|
try {
|
|
425
|
-
|
|
425
|
+
n(H), x(), A();
|
|
426
426
|
const { data: Q, fromCache: ce } = await Ft(
|
|
427
|
-
|
|
427
|
+
a.apiServiceUrl,
|
|
428
428
|
(t == null ? void 0 : t.accessToken) || "",
|
|
429
429
|
H.id,
|
|
430
430
|
o,
|
|
@@ -446,7 +446,7 @@ function ve() {
|
|
|
446
446
|
setInlineFilterValuesMap: M,
|
|
447
447
|
setApplyFilters: U,
|
|
448
448
|
setIsDashboardEditing: z,
|
|
449
|
-
setIsVisualEditing:
|
|
449
|
+
setIsVisualEditing: C,
|
|
450
450
|
dashboard: j,
|
|
451
451
|
selectedSheetId: E,
|
|
452
452
|
selectedFrameId: S,
|
|
@@ -460,13 +460,13 @@ function ve() {
|
|
|
460
460
|
},
|
|
461
461
|
[
|
|
462
462
|
t == null ? void 0 : t.accessToken,
|
|
463
|
-
|
|
463
|
+
a.apiServiceUrl,
|
|
464
464
|
o,
|
|
465
|
-
|
|
465
|
+
n,
|
|
466
466
|
c,
|
|
467
467
|
d,
|
|
468
468
|
z,
|
|
469
|
-
|
|
469
|
+
C,
|
|
470
470
|
l,
|
|
471
471
|
u,
|
|
472
472
|
h,
|
|
@@ -489,17 +489,17 @@ function ve() {
|
|
|
489
489
|
), G = ae(
|
|
490
490
|
async (H) => {
|
|
491
491
|
var ce;
|
|
492
|
-
const Q = (
|
|
492
|
+
const Q = (_) => (F.error(_), { success: !1, error: _ });
|
|
493
493
|
try {
|
|
494
|
-
if (
|
|
494
|
+
if (n(H), !E)
|
|
495
495
|
return Q("No sheet selected. Please select a sheet first.");
|
|
496
|
-
const { data:
|
|
497
|
-
|
|
496
|
+
const { data: _, fromCache: ye } = await Ft(
|
|
497
|
+
a.apiServiceUrl,
|
|
498
498
|
(t == null ? void 0 : t.accessToken) || "",
|
|
499
499
|
H.id,
|
|
500
500
|
o,
|
|
501
501
|
"Adding visual to dashboard..."
|
|
502
|
-
), Y = (
|
|
502
|
+
), Y = (_ == null ? void 0 : _.frameObject) ?? ((ce = _ == null ? void 0 : _.visual) == null ? void 0 : ce.frameObject);
|
|
503
503
|
if (!Y)
|
|
504
504
|
return Q("Visual has no frame data");
|
|
505
505
|
const R = $t(Y);
|
|
@@ -510,21 +510,21 @@ function ve() {
|
|
|
510
510
|
visualId: H.id
|
|
511
511
|
// Link this frame to the library visual
|
|
512
512
|
};
|
|
513
|
-
return await s(E, te), z(!0),
|
|
514
|
-
} catch (
|
|
515
|
-
return console.error("Error adding visual:",
|
|
516
|
-
|
|
513
|
+
return await s(E, te), z(!0), w(te.id), { success: !0, fromCache: ye };
|
|
514
|
+
} catch (_) {
|
|
515
|
+
return console.error("Error adding visual:", _), Q(
|
|
516
|
+
_ instanceof Error ? _.message : "Failed to add visual to dashboard"
|
|
517
517
|
);
|
|
518
518
|
}
|
|
519
519
|
},
|
|
520
520
|
[
|
|
521
521
|
t == null ? void 0 : t.accessToken,
|
|
522
|
-
|
|
522
|
+
a.apiServiceUrl,
|
|
523
523
|
o,
|
|
524
|
-
|
|
524
|
+
n,
|
|
525
525
|
E,
|
|
526
526
|
z,
|
|
527
|
-
|
|
527
|
+
w,
|
|
528
528
|
s
|
|
529
529
|
]
|
|
530
530
|
);
|
|
@@ -546,39 +546,39 @@ function Wt(t) {
|
|
|
546
546
|
year: "numeric"
|
|
547
547
|
}) : "Unknown";
|
|
548
548
|
}
|
|
549
|
-
function qt(t,
|
|
549
|
+
function qt(t, a) {
|
|
550
550
|
var s;
|
|
551
551
|
const o = (s = t.ownership.createdBy) == null ? void 0 : s.type;
|
|
552
|
-
return o === "tenant" || o === "organization" &&
|
|
552
|
+
return o === "tenant" || o === "organization" && a;
|
|
553
553
|
}
|
|
554
|
-
function Nt(t,
|
|
554
|
+
function Nt(t, a) {
|
|
555
555
|
var o, s;
|
|
556
|
-
return qt(t,
|
|
556
|
+
return qt(t, a) ? ((o = t.ownership.createdBy) == null ? void 0 : o.name) || ((s = t.createdByTenantUserRel) == null ? void 0 : s.name) || t.lastModifiedBy || "Unknown" : "Organization";
|
|
557
557
|
}
|
|
558
|
-
function Mr(t,
|
|
559
|
-
return Nt(t,
|
|
558
|
+
function Mr(t, a) {
|
|
559
|
+
return Nt(t, a).split(/\s+/).filter(Boolean).slice(0, 2).map((s) => s.charAt(0).toUpperCase()).join("") || "?";
|
|
560
560
|
}
|
|
561
561
|
function Ur(t) {
|
|
562
|
-
const
|
|
563
|
-
return
|
|
562
|
+
const a = (t || "").toLowerCase();
|
|
563
|
+
return a.includes("table") ? Rt : a.includes("pie") || a.includes("donut") ? ia : a.includes("line") ? la : a.includes("bar") ? tr : Ae;
|
|
564
564
|
}
|
|
565
565
|
function Rr({ visual: t }) {
|
|
566
|
-
const
|
|
567
|
-
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:
|
|
566
|
+
const a = t.ownership.status === "public" ? "Public" : t.ownership.status === "shared" || t.ownership.sharedCount > 0 ? "Shared" : "Private";
|
|
567
|
+
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 });
|
|
568
568
|
}
|
|
569
569
|
function ts({
|
|
570
570
|
open: t,
|
|
571
|
-
onOpenChange:
|
|
571
|
+
onOpenChange: a
|
|
572
572
|
}) {
|
|
573
|
-
const o = ot("interactive"), [s, i] = D(""), [
|
|
573
|
+
const o = ot("interactive"), [s, i] = D(""), [n, c] = D(/* @__PURE__ */ new Set()), [d, l] = D(!1), [u, h] = D(
|
|
574
574
|
null
|
|
575
575
|
), [m, p] = D(
|
|
576
576
|
null
|
|
577
577
|
), [g, f] = D(!1), [v, k] = D(null), [V, M] = D(null), U = () => {
|
|
578
578
|
c(/* @__PURE__ */ new Set()), h(null), p(null), f(!1), k(null);
|
|
579
579
|
}, A = () => {
|
|
580
|
-
|
|
581
|
-
}, { selectVisual: z } = it(), { handleAddLibraryVisual:
|
|
580
|
+
a(!1), U();
|
|
581
|
+
}, { selectVisual: z } = it(), { handleAddLibraryVisual: C, handleEditLibraryVisual: w } = ve(), { isConsoleMode: x } = ta(), {
|
|
582
582
|
resources: E,
|
|
583
583
|
isLoading: S,
|
|
584
584
|
isError: j,
|
|
@@ -591,11 +591,11 @@ function ts({
|
|
|
591
591
|
} = aa(
|
|
592
592
|
void 0,
|
|
593
593
|
(b) => {
|
|
594
|
-
l(!1), b && (z(b),
|
|
594
|
+
l(!1), b && (z(b), w(b), A());
|
|
595
595
|
}
|
|
596
596
|
), {
|
|
597
597
|
startUpdating: ce,
|
|
598
|
-
stopUpdating:
|
|
598
|
+
stopUpdating: _,
|
|
599
599
|
isUpdating: ye
|
|
600
600
|
} = ra(), Y = E, R = re(() => {
|
|
601
601
|
const b = s.trim().toLowerCase();
|
|
@@ -607,19 +607,19 @@ function ts({
|
|
|
607
607
|
) : Y;
|
|
608
608
|
}, [s, Y]), te = re(
|
|
609
609
|
() => Y.filter(
|
|
610
|
-
(b) =>
|
|
610
|
+
(b) => n.has(b.id)
|
|
611
611
|
),
|
|
612
|
-
[
|
|
612
|
+
[n, Y]
|
|
613
613
|
), me = te.filter(
|
|
614
614
|
(b) => b.permissions.canDelete
|
|
615
615
|
), pe = te.filter(
|
|
616
616
|
(b) => b.permissions.canShare
|
|
617
617
|
), Ce = R.length > 0 && R.every(
|
|
618
|
-
(b) =>
|
|
618
|
+
(b) => n.has(b.id)
|
|
619
619
|
), Be = R.some(
|
|
620
|
-
(b) =>
|
|
620
|
+
(b) => n.has(b.id)
|
|
621
621
|
), Ye = (b) => {
|
|
622
|
-
const B = new Set(
|
|
622
|
+
const B = new Set(n);
|
|
623
623
|
b(B), c(B);
|
|
624
624
|
}, $ = (b) => {
|
|
625
625
|
Ye((B) => {
|
|
@@ -635,19 +635,19 @@ function ts({
|
|
|
635
635
|
), B;
|
|
636
636
|
});
|
|
637
637
|
}, se = async (b) => {
|
|
638
|
-
(await
|
|
638
|
+
(await C(b)).success && A();
|
|
639
639
|
}, we = async () => {
|
|
640
640
|
const b = te;
|
|
641
641
|
if (b.length === 0) return;
|
|
642
642
|
let B = !1;
|
|
643
643
|
for (const q of b)
|
|
644
|
-
if (!(await
|
|
644
|
+
if (!(await C(q)).success) {
|
|
645
645
|
B = !0;
|
|
646
646
|
break;
|
|
647
647
|
}
|
|
648
648
|
B || A();
|
|
649
649
|
}, Ze = (b) => {
|
|
650
|
-
|
|
650
|
+
w(b), A();
|
|
651
651
|
}, ge = (b) => {
|
|
652
652
|
M(b), G(b, {
|
|
653
653
|
onSettled: () => M(null)
|
|
@@ -700,28 +700,28 @@ function ts({
|
|
|
700
700
|
},
|
|
701
701
|
{
|
|
702
702
|
onSuccess: () => {
|
|
703
|
-
|
|
703
|
+
_(m.id, ue), p(null);
|
|
704
704
|
},
|
|
705
705
|
onError: () => {
|
|
706
|
-
|
|
706
|
+
_(m.id, ue);
|
|
707
707
|
}
|
|
708
708
|
}
|
|
709
709
|
);
|
|
710
710
|
}, oe = (b) => {
|
|
711
|
-
|
|
711
|
+
a(b), b || U();
|
|
712
712
|
}, ke = v ? 1 : me.length;
|
|
713
|
-
return /* @__PURE__ */
|
|
714
|
-
/* @__PURE__ */ e(Fe, { open: t, onOpenChange: oe, children: /* @__PURE__ */
|
|
713
|
+
return /* @__PURE__ */ r(O, { children: [
|
|
714
|
+
/* @__PURE__ */ e(Fe, { open: t, onOpenChange: oe, children: /* @__PURE__ */ r(
|
|
715
715
|
Ee,
|
|
716
716
|
{
|
|
717
717
|
showCloseButton: !1,
|
|
718
718
|
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",
|
|
719
719
|
style: o.dialogStyle,
|
|
720
720
|
children: [
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
722
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
723
723
|
/* @__PURE__ */ e(Rt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
724
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
725
725
|
/* @__PURE__ */ e(Ie, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
|
|
726
726
|
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
|
|
727
727
|
] })
|
|
@@ -738,8 +738,8 @@ function ts({
|
|
|
738
738
|
}
|
|
739
739
|
)
|
|
740
740
|
] }),
|
|
741
|
-
/* @__PURE__ */
|
|
742
|
-
/* @__PURE__ */
|
|
741
|
+
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
|
|
742
|
+
/* @__PURE__ */ r("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
|
|
743
743
|
/* @__PURE__ */ e(rr, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
744
744
|
/* @__PURE__ */ e(
|
|
745
745
|
"input",
|
|
@@ -753,7 +753,7 @@ function ts({
|
|
|
753
753
|
}
|
|
754
754
|
)
|
|
755
755
|
] }),
|
|
756
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ r(
|
|
757
757
|
L,
|
|
758
758
|
{
|
|
759
759
|
size: "xs",
|
|
@@ -767,7 +767,7 @@ function ts({
|
|
|
767
767
|
}
|
|
768
768
|
)
|
|
769
769
|
] }),
|
|
770
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: S ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(Ir, {}) }) : j ? /* @__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" }) }) : R.length === 0 ? /* @__PURE__ */
|
|
770
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: S ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(Ir, {}) }) : j ? /* @__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" }) }) : R.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
771
771
|
/* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
772
772
|
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: s ? "No visuals found" : "No visuals yet" }),
|
|
773
773
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: s ? "Try a different search." : "Create a saved visual to add it here." })
|
|
@@ -775,7 +775,7 @@ function ts({
|
|
|
775
775
|
zr,
|
|
776
776
|
{
|
|
777
777
|
visuals: R,
|
|
778
|
-
selectedIds:
|
|
778
|
+
selectedIds: n,
|
|
779
779
|
allFilteredSelected: Ce,
|
|
780
780
|
someFilteredSelected: Be,
|
|
781
781
|
onSelectAll: W,
|
|
@@ -793,10 +793,10 @@ function ts({
|
|
|
793
793
|
isConsoleMode: x
|
|
794
794
|
}
|
|
795
795
|
) }),
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children:
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children:
|
|
796
|
+
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
|
|
797
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children: n.size > 0 && /* @__PURE__ */ r(O, { children: [
|
|
798
|
+
/* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
799
|
+
/* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children: n.size }),
|
|
800
800
|
" ",
|
|
801
801
|
"selected"
|
|
802
802
|
] }),
|
|
@@ -809,7 +809,7 @@ function ts({
|
|
|
809
809
|
children: "Clear"
|
|
810
810
|
}
|
|
811
811
|
),
|
|
812
|
-
/* @__PURE__ */
|
|
812
|
+
/* @__PURE__ */ r(
|
|
813
813
|
L,
|
|
814
814
|
{
|
|
815
815
|
size: "xs",
|
|
@@ -822,7 +822,7 @@ function ts({
|
|
|
822
822
|
]
|
|
823
823
|
}
|
|
824
824
|
),
|
|
825
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ r(
|
|
826
826
|
L,
|
|
827
827
|
{
|
|
828
828
|
size: "xs",
|
|
@@ -831,14 +831,14 @@ function ts({
|
|
|
831
831
|
onClick: Pe,
|
|
832
832
|
disabled: me.length === 0,
|
|
833
833
|
children: [
|
|
834
|
-
/* @__PURE__ */ e(
|
|
834
|
+
/* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" }),
|
|
835
835
|
"Delete ",
|
|
836
|
-
me.length ||
|
|
836
|
+
me.length || n.size
|
|
837
837
|
]
|
|
838
838
|
}
|
|
839
839
|
)
|
|
840
840
|
] }) }),
|
|
841
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
842
842
|
/* @__PURE__ */ e(
|
|
843
843
|
L,
|
|
844
844
|
{
|
|
@@ -848,15 +848,15 @@ function ts({
|
|
|
848
848
|
children: "Close"
|
|
849
849
|
}
|
|
850
850
|
),
|
|
851
|
-
/* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ r(
|
|
852
852
|
L,
|
|
853
853
|
{
|
|
854
854
|
size: "xs",
|
|
855
855
|
onClick: we,
|
|
856
|
-
disabled:
|
|
856
|
+
disabled: n.size === 0,
|
|
857
857
|
children: [
|
|
858
858
|
/* @__PURE__ */ e(yt, { className: "h-3.5 w-3.5" }),
|
|
859
|
-
|
|
859
|
+
n.size === 0 ? "Add to dashboard" : `Add ${n.size} visual${n.size === 1 ? "" : "s"}`
|
|
860
860
|
]
|
|
861
861
|
}
|
|
862
862
|
)
|
|
@@ -901,9 +901,9 @@ function ts({
|
|
|
901
901
|
onOpenChange: (b) => {
|
|
902
902
|
!b && Q || (f(b), b || k(null));
|
|
903
903
|
},
|
|
904
|
-
children: /* @__PURE__ */
|
|
905
|
-
/* @__PURE__ */
|
|
906
|
-
/* @__PURE__ */
|
|
904
|
+
children: /* @__PURE__ */ r(dt, { children: [
|
|
905
|
+
/* @__PURE__ */ r(ct, { children: [
|
|
906
|
+
/* @__PURE__ */ r(ut, { children: [
|
|
907
907
|
"Delete ",
|
|
908
908
|
ke,
|
|
909
909
|
" visual",
|
|
@@ -912,9 +912,9 @@ function ts({
|
|
|
912
912
|
] }),
|
|
913
913
|
/* @__PURE__ */ e(ht, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
914
914
|
] }),
|
|
915
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ r(mt, { children: [
|
|
916
916
|
/* @__PURE__ */ e(pt, { disabled: Q, children: "Cancel" }),
|
|
917
|
-
/* @__PURE__ */
|
|
917
|
+
/* @__PURE__ */ r(
|
|
918
918
|
Vt,
|
|
919
919
|
{
|
|
920
920
|
onClick: (b) => {
|
|
@@ -922,7 +922,7 @@ function ts({
|
|
|
922
922
|
},
|
|
923
923
|
disabled: Q || ke === 0,
|
|
924
924
|
children: [
|
|
925
|
-
Q ? /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(
|
|
925
|
+
Q ? /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" }),
|
|
926
926
|
Q ? "Deleting..." : "Delete"
|
|
927
927
|
]
|
|
928
928
|
}
|
|
@@ -935,11 +935,11 @@ function ts({
|
|
|
935
935
|
}
|
|
936
936
|
function zr({
|
|
937
937
|
visuals: t,
|
|
938
|
-
selectedIds:
|
|
938
|
+
selectedIds: a,
|
|
939
939
|
allFilteredSelected: o,
|
|
940
940
|
someFilteredSelected: s,
|
|
941
941
|
onSelectAll: i,
|
|
942
|
-
onToggleSelection:
|
|
942
|
+
onToggleSelection: n,
|
|
943
943
|
onAddVisual: c,
|
|
944
944
|
onOpenVisual: d,
|
|
945
945
|
onEditDetails: l,
|
|
@@ -950,8 +950,8 @@ function zr({
|
|
|
950
950
|
isDeleting: g,
|
|
951
951
|
isConsoleMode: f
|
|
952
952
|
}) {
|
|
953
|
-
return /* @__PURE__ */
|
|
954
|
-
/* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ r("div", { className: "min-w-[48rem]", children: [
|
|
954
|
+
/* @__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: [
|
|
955
955
|
/* @__PURE__ */ e(
|
|
956
956
|
ft,
|
|
957
957
|
{
|
|
@@ -968,11 +968,11 @@ function zr({
|
|
|
968
968
|
/* @__PURE__ */ e("span", { className: "text-right", children: "Actions" })
|
|
969
969
|
] }),
|
|
970
970
|
t.map((v) => /* @__PURE__ */ e(
|
|
971
|
-
|
|
971
|
+
Or,
|
|
972
972
|
{
|
|
973
973
|
visual: v,
|
|
974
|
-
selected:
|
|
975
|
-
onToggleSelection:
|
|
974
|
+
selected: a.has(v.id),
|
|
975
|
+
onToggleSelection: n,
|
|
976
976
|
onAddVisual: c,
|
|
977
977
|
onOpenVisual: d,
|
|
978
978
|
onEditDetails: l,
|
|
@@ -987,13 +987,13 @@ function zr({
|
|
|
987
987
|
))
|
|
988
988
|
] });
|
|
989
989
|
}
|
|
990
|
-
function
|
|
990
|
+
function Or({
|
|
991
991
|
visual: t,
|
|
992
|
-
selected:
|
|
992
|
+
selected: a,
|
|
993
993
|
onToggleSelection: o,
|
|
994
994
|
onAddVisual: s,
|
|
995
995
|
onOpenVisual: i,
|
|
996
|
-
onEditDetails:
|
|
996
|
+
onEditDetails: n,
|
|
997
997
|
onShareVisual: c,
|
|
998
998
|
onDeleteVisual: d,
|
|
999
999
|
onDuplicateVisual: l,
|
|
@@ -1005,23 +1005,23 @@ function _r({
|
|
|
1005
1005
|
const p = Ur(t.kind), g = () => {
|
|
1006
1006
|
s(t);
|
|
1007
1007
|
};
|
|
1008
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ r(
|
|
1009
1009
|
"div",
|
|
1010
1010
|
{
|
|
1011
1011
|
className: J(
|
|
1012
1012
|
"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",
|
|
1013
|
-
|
|
1013
|
+
a && "bg-muted/70"
|
|
1014
1014
|
),
|
|
1015
1015
|
children: [
|
|
1016
1016
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
1017
1017
|
ft,
|
|
1018
1018
|
{
|
|
1019
|
-
checked:
|
|
1019
|
+
checked: a,
|
|
1020
1020
|
onCheckedChange: () => o(t.id),
|
|
1021
1021
|
"aria-label": `Select ${t.title || "visual"}`
|
|
1022
1022
|
}
|
|
1023
1023
|
) }),
|
|
1024
|
-
/* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ r(
|
|
1025
1025
|
"button",
|
|
1026
1026
|
{
|
|
1027
1027
|
type: "button",
|
|
@@ -1030,7 +1030,7 @@ function _r({
|
|
|
1030
1030
|
"aria-label": `Add ${t.title || "visual"} to dashboard`,
|
|
1031
1031
|
children: [
|
|
1032
1032
|
/* @__PURE__ */ e(p, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
1033
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
1034
1034
|
/* @__PURE__ */ e(
|
|
1035
1035
|
"div",
|
|
1036
1036
|
{
|
|
@@ -1051,7 +1051,7 @@ function _r({
|
|
|
1051
1051
|
]
|
|
1052
1052
|
}
|
|
1053
1053
|
),
|
|
1054
|
-
/* @__PURE__ */
|
|
1054
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
1055
1055
|
/* @__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: Mr(t, m) }),
|
|
1056
1056
|
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: Nt(t, m) })
|
|
1057
1057
|
] }),
|
|
@@ -1059,11 +1059,11 @@ function _r({
|
|
|
1059
1059
|
/* @__PURE__ */ e(Rr, { visual: t }),
|
|
1060
1060
|
/* @__PURE__ */ e("span", { className: "text-right tabular-nums text-muted-foreground", children: t.ownership.sharedCount > 0 ? t.ownership.sharedCount : "—" }),
|
|
1061
1061
|
/* @__PURE__ */ e(
|
|
1062
|
-
|
|
1062
|
+
_r,
|
|
1063
1063
|
{
|
|
1064
1064
|
visual: t,
|
|
1065
1065
|
onOpenVisual: i,
|
|
1066
|
-
onEditDetails:
|
|
1066
|
+
onEditDetails: n,
|
|
1067
1067
|
onShareVisual: c,
|
|
1068
1068
|
onDeleteVisual: d,
|
|
1069
1069
|
onDuplicateVisual: l,
|
|
@@ -1076,18 +1076,18 @@ function _r({
|
|
|
1076
1076
|
}
|
|
1077
1077
|
);
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function _r({
|
|
1080
1080
|
visual: t,
|
|
1081
|
-
onOpenVisual:
|
|
1081
|
+
onOpenVisual: a,
|
|
1082
1082
|
onEditDetails: o,
|
|
1083
1083
|
onShareVisual: s,
|
|
1084
1084
|
onDeleteVisual: i,
|
|
1085
|
-
onDuplicateVisual:
|
|
1085
|
+
onDuplicateVisual: n,
|
|
1086
1086
|
duplicatingId: c,
|
|
1087
1087
|
isDeleting: d,
|
|
1088
1088
|
isConsoleMode: l
|
|
1089
1089
|
}) {
|
|
1090
|
-
return /* @__PURE__ */
|
|
1090
|
+
return /* @__PURE__ */ r(
|
|
1091
1091
|
"div",
|
|
1092
1092
|
{
|
|
1093
1093
|
className: "flex items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
|
|
@@ -1099,12 +1099,12 @@ function Or({
|
|
|
1099
1099
|
size: "xs",
|
|
1100
1100
|
variant: "ghost",
|
|
1101
1101
|
className: "w-7 px-0",
|
|
1102
|
-
onClick: () =>
|
|
1102
|
+
onClick: () => a(t),
|
|
1103
1103
|
"aria-label": "Edit visual",
|
|
1104
1104
|
children: /* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" })
|
|
1105
1105
|
}
|
|
1106
1106
|
),
|
|
1107
|
-
/* @__PURE__ */
|
|
1107
|
+
/* @__PURE__ */ r(Le, { modal: !1, children: [
|
|
1108
1108
|
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1109
1109
|
L,
|
|
1110
1110
|
{
|
|
@@ -1115,20 +1115,20 @@ function Or({
|
|
|
1115
1115
|
children: /* @__PURE__ */ e(Tt, { className: "h-3.5 w-3.5" })
|
|
1116
1116
|
}
|
|
1117
1117
|
) }),
|
|
1118
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ r(
|
|
1119
1119
|
Te,
|
|
1120
1120
|
{
|
|
1121
1121
|
align: "end",
|
|
1122
1122
|
className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
1123
1123
|
children: [
|
|
1124
|
-
/* @__PURE__ */
|
|
1124
|
+
/* @__PURE__ */ r(X, { onClick: () => a(t), children: [
|
|
1125
1125
|
/* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
|
|
1126
1126
|
"Edit visual"
|
|
1127
1127
|
] }),
|
|
1128
|
-
/* @__PURE__ */
|
|
1128
|
+
/* @__PURE__ */ r(
|
|
1129
1129
|
X,
|
|
1130
1130
|
{
|
|
1131
|
-
onClick: () =>
|
|
1131
|
+
onClick: () => n(t.id),
|
|
1132
1132
|
disabled: c === t.id,
|
|
1133
1133
|
children: [
|
|
1134
1134
|
c === t.id ? /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" }),
|
|
@@ -1136,36 +1136,36 @@ function Or({
|
|
|
1136
1136
|
]
|
|
1137
1137
|
}
|
|
1138
1138
|
),
|
|
1139
|
-
t.permissions.canEdit && /* @__PURE__ */
|
|
1139
|
+
t.permissions.canEdit && /* @__PURE__ */ r(X, { onClick: () => o(t), children: [
|
|
1140
1140
|
/* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
|
|
1141
1141
|
"Edit details"
|
|
1142
1142
|
] }),
|
|
1143
|
-
t.permissions.canShare && /* @__PURE__ */
|
|
1143
|
+
t.permissions.canShare && /* @__PURE__ */ r(X, { onClick: () => s(t), children: [
|
|
1144
1144
|
/* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5" }),
|
|
1145
1145
|
"Share"
|
|
1146
1146
|
] }),
|
|
1147
|
-
t.permissions.canDelete && /* @__PURE__ */
|
|
1147
|
+
t.permissions.canDelete && /* @__PURE__ */ r(O, { children: [
|
|
1148
1148
|
/* @__PURE__ */ e(je, {}),
|
|
1149
|
-
/* @__PURE__ */
|
|
1149
|
+
/* @__PURE__ */ r(
|
|
1150
1150
|
X,
|
|
1151
1151
|
{
|
|
1152
1152
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
1153
1153
|
onClick: () => i(t),
|
|
1154
1154
|
disabled: d,
|
|
1155
1155
|
children: [
|
|
1156
|
-
/* @__PURE__ */ e(
|
|
1156
|
+
/* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" }),
|
|
1157
1157
|
d ? "Deleting..." : "Delete"
|
|
1158
1158
|
]
|
|
1159
1159
|
}
|
|
1160
1160
|
)
|
|
1161
1161
|
] }),
|
|
1162
1162
|
/* @__PURE__ */ e(je, {}),
|
|
1163
|
-
/* @__PURE__ */
|
|
1164
|
-
qt(t, l) && /* @__PURE__ */
|
|
1163
|
+
/* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
1164
|
+
qt(t, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
1165
1165
|
/* @__PURE__ */ e(ca, { className: "h-3 w-3" }),
|
|
1166
1166
|
/* @__PURE__ */ e("span", { className: "truncate", children: Nt(t, l) })
|
|
1167
1167
|
] }),
|
|
1168
|
-
/* @__PURE__ */
|
|
1168
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
1169
1169
|
/* @__PURE__ */ e(ua, { className: "h-3 w-3" }),
|
|
1170
1170
|
/* @__PURE__ */ e("span", { children: Wt(t.updatedAt) })
|
|
1171
1171
|
] })
|
|
@@ -1178,52 +1178,52 @@ function Or({
|
|
|
1178
1178
|
}
|
|
1179
1179
|
);
|
|
1180
1180
|
}
|
|
1181
|
-
function as(t,
|
|
1182
|
-
const s =
|
|
1181
|
+
function as(t, a, o = !1) {
|
|
1182
|
+
const s = N((u) => u.dashboard), i = N(
|
|
1183
1183
|
(u) => u.isDashboardEditing
|
|
1184
|
-
),
|
|
1184
|
+
), n = N(
|
|
1185
1185
|
(u) => u.onDashboardLifecycleEvent
|
|
1186
1186
|
), c = ae(() => {
|
|
1187
|
-
const u =
|
|
1188
|
-
return
|
|
1189
|
-
}, [t,
|
|
1190
|
-
kt(() => (
|
|
1191
|
-
|
|
1187
|
+
const u = N.getState().dashboard;
|
|
1188
|
+
return a || !t || !u || u.id !== t.id ? !1 : ze(u) !== ze(t);
|
|
1189
|
+
}, [t, a]);
|
|
1190
|
+
kt(() => (N.setState({ checkUnsavedDashboardChanges: c }), () => {
|
|
1191
|
+
N.getState().checkUnsavedDashboardChanges === c && N.setState({ checkUnsavedDashboardChanges: null });
|
|
1192
1192
|
}), [c]);
|
|
1193
|
-
const d = re(() => !o ||
|
|
1193
|
+
const d = re(() => !o || a || !s || i && (!t || s.id !== t.id) ? null : {
|
|
1194
1194
|
dashboardId: s.id,
|
|
1195
1195
|
dirty: i && t ? ze(s) !== ze(t) : !1
|
|
1196
1196
|
}, [
|
|
1197
1197
|
i,
|
|
1198
|
-
|
|
1198
|
+
a,
|
|
1199
1199
|
o,
|
|
1200
1200
|
t,
|
|
1201
1201
|
s
|
|
1202
1202
|
]), l = nt(null);
|
|
1203
1203
|
return kt(() => {
|
|
1204
|
-
if (!
|
|
1204
|
+
if (!n || !d) {
|
|
1205
1205
|
l.current = null;
|
|
1206
1206
|
return;
|
|
1207
1207
|
}
|
|
1208
1208
|
const u = l.current;
|
|
1209
|
-
(u == null ? void 0 : u.callback) ===
|
|
1210
|
-
callback:
|
|
1209
|
+
(u == null ? void 0 : u.callback) === n && u.dashboardId === d.dashboardId && u.dirty === d.dirty || (l.current = {
|
|
1210
|
+
callback: n,
|
|
1211
1211
|
dashboardId: d.dashboardId,
|
|
1212
1212
|
dirty: d.dirty
|
|
1213
|
-
},
|
|
1213
|
+
}, n({
|
|
1214
1214
|
type: "dashboard:dirty-state",
|
|
1215
1215
|
dashboardId: d.dashboardId,
|
|
1216
1216
|
payload: { dirty: d.dirty }
|
|
1217
1217
|
}));
|
|
1218
|
-
}, [d,
|
|
1218
|
+
}, [d, n]), c;
|
|
1219
1219
|
}
|
|
1220
1220
|
function jr({
|
|
1221
1221
|
open: t,
|
|
1222
|
-
onOpenChange:
|
|
1222
|
+
onOpenChange: a,
|
|
1223
1223
|
isLibraryVisual: o,
|
|
1224
1224
|
currentVisualName: s,
|
|
1225
1225
|
isSaving: i = !1,
|
|
1226
|
-
destinationMode:
|
|
1226
|
+
destinationMode: n = "both",
|
|
1227
1227
|
onConfirm: c
|
|
1228
1228
|
}) {
|
|
1229
1229
|
const [d, l] = D(
|
|
@@ -1234,13 +1234,13 @@ function jr({
|
|
|
1234
1234
|
o && s ? `Copy of ${s}` : s || ""
|
|
1235
1235
|
), h(""));
|
|
1236
1236
|
}, [t, o, s]);
|
|
1237
|
-
const m = !!d.trim(), p =
|
|
1237
|
+
const m = !!d.trim(), p = n === "local" ? {
|
|
1238
1238
|
saveToLibrary: !1,
|
|
1239
1239
|
saveToCurrentDashboard: !0,
|
|
1240
1240
|
badgeType: "local",
|
|
1241
1241
|
description: "Creates a local copy on the current dashboard.",
|
|
1242
1242
|
actionLabel: "Add to Dashboard (Local)"
|
|
1243
|
-
} :
|
|
1243
|
+
} : n === "library" ? {
|
|
1244
1244
|
saveToLibrary: !0,
|
|
1245
1245
|
saveToCurrentDashboard: !1,
|
|
1246
1246
|
badgeType: "library",
|
|
@@ -1260,9 +1260,9 @@ function jr({
|
|
|
1260
1260
|
saveToCurrentDashboard: p.saveToCurrentDashboard
|
|
1261
1261
|
});
|
|
1262
1262
|
};
|
|
1263
|
-
return /* @__PURE__ */ e(Fe, { open: t, onOpenChange:
|
|
1264
|
-
/* @__PURE__ */
|
|
1265
|
-
/* @__PURE__ */
|
|
1263
|
+
return /* @__PURE__ */ e(Fe, { open: t, onOpenChange: a, children: /* @__PURE__ */ r(Ee, { className: "sm:max-w-[500px]", children: [
|
|
1264
|
+
/* @__PURE__ */ r(gt, { children: [
|
|
1265
|
+
/* @__PURE__ */ r(Ie, { className: "flex items-center gap-2", children: [
|
|
1266
1266
|
/* @__PURE__ */ e("span", { children: "Save Visual As" }),
|
|
1267
1267
|
p.badgeType !== "local" && /* @__PURE__ */ e(
|
|
1268
1268
|
pr,
|
|
@@ -1275,8 +1275,8 @@ function jr({
|
|
|
1275
1275
|
] }),
|
|
1276
1276
|
/* @__PURE__ */ e(bt, { children: p.description })
|
|
1277
1277
|
] }),
|
|
1278
|
-
/* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1278
|
+
/* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
|
|
1279
|
+
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
1280
1280
|
/* @__PURE__ */ e(De, { htmlFor: "name", children: "Name" }),
|
|
1281
1281
|
/* @__PURE__ */ e(
|
|
1282
1282
|
st,
|
|
@@ -1289,7 +1289,7 @@ function jr({
|
|
|
1289
1289
|
}
|
|
1290
1290
|
)
|
|
1291
1291
|
] }),
|
|
1292
|
-
/* @__PURE__ */
|
|
1292
|
+
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
1293
1293
|
/* @__PURE__ */ e(De, { htmlFor: "description", children: "Description (optional)" }),
|
|
1294
1294
|
/* @__PURE__ */ e(
|
|
1295
1295
|
ha,
|
|
@@ -1304,17 +1304,17 @@ function jr({
|
|
|
1304
1304
|
)
|
|
1305
1305
|
] })
|
|
1306
1306
|
] }),
|
|
1307
|
-
/* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ r(ma, { children: [
|
|
1308
1308
|
/* @__PURE__ */ e(
|
|
1309
1309
|
L,
|
|
1310
1310
|
{
|
|
1311
1311
|
variant: "outline",
|
|
1312
|
-
onClick: () =>
|
|
1312
|
+
onClick: () => a(!1),
|
|
1313
1313
|
disabled: i,
|
|
1314
1314
|
children: "Cancel"
|
|
1315
1315
|
}
|
|
1316
1316
|
),
|
|
1317
|
-
/* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ r(L, { onClick: g, disabled: !m || i, children: [
|
|
1318
1318
|
i && /* @__PURE__ */ e(ne, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1319
1319
|
p.actionLabel
|
|
1320
1320
|
] })
|
|
@@ -1322,28 +1322,28 @@ function jr({
|
|
|
1322
1322
|
] }) });
|
|
1323
1323
|
}
|
|
1324
1324
|
function St(t) {
|
|
1325
|
-
var
|
|
1325
|
+
var a;
|
|
1326
1326
|
for (const o of t.cards)
|
|
1327
|
-
if (o.type === "matrixTable" && !ar.safeParse((
|
|
1327
|
+
if (o.type === "matrixTable" && !ar.safeParse((a = o.config) == null ? void 0 : a.matrix).success)
|
|
1328
1328
|
return F.error("Matrix requires at least one row field, one metric, and valid settings."), !1;
|
|
1329
1329
|
return !0;
|
|
1330
1330
|
}
|
|
1331
1331
|
function tt({
|
|
1332
1332
|
className: t,
|
|
1333
|
-
variant:
|
|
1333
|
+
variant: a = "outline"
|
|
1334
1334
|
}) {
|
|
1335
|
-
const o = ee((
|
|
1335
|
+
const o = ee((n) => n.onSave), { getUpdatedFrame: s } = ve();
|
|
1336
1336
|
function i() {
|
|
1337
|
-
const
|
|
1338
|
-
St(
|
|
1337
|
+
const n = s();
|
|
1338
|
+
St(n) && (o == null || o(n));
|
|
1339
1339
|
}
|
|
1340
|
-
return /* @__PURE__ */
|
|
1340
|
+
return /* @__PURE__ */ r(
|
|
1341
1341
|
L,
|
|
1342
1342
|
{
|
|
1343
1343
|
onClick: i,
|
|
1344
1344
|
className: t,
|
|
1345
1345
|
size: "xs",
|
|
1346
|
-
variant:
|
|
1346
|
+
variant: a,
|
|
1347
1347
|
children: [
|
|
1348
1348
|
/* @__PURE__ */ e(yt, { className: "h-3.5 w-3.5" }),
|
|
1349
1349
|
"Done"
|
|
@@ -1353,9 +1353,9 @@ function tt({
|
|
|
1353
1353
|
}
|
|
1354
1354
|
function $r({
|
|
1355
1355
|
className: t,
|
|
1356
|
-
variant:
|
|
1356
|
+
variant: a = "default"
|
|
1357
1357
|
}) {
|
|
1358
|
-
const o = Qe(), [s, i] = D(!1), { setIsVisualEditing:
|
|
1358
|
+
const o = Qe(), [s, i] = D(!1), { setIsVisualEditing: n } = de(), { getUpdatedFrame: c } = ve(), d = Ge(), l = ee((m) => m.frame), u = Bt();
|
|
1359
1359
|
return /* @__PURE__ */ e(
|
|
1360
1360
|
L,
|
|
1361
1361
|
{
|
|
@@ -1390,12 +1390,12 @@ function $r({
|
|
|
1390
1390
|
},
|
|
1391
1391
|
className: t,
|
|
1392
1392
|
size: "xs",
|
|
1393
|
-
variant:
|
|
1394
|
-
children: s ? /* @__PURE__ */
|
|
1393
|
+
variant: a,
|
|
1394
|
+
children: s ? /* @__PURE__ */ r(O, { children: [
|
|
1395
1395
|
/* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1396
1396
|
"Saving"
|
|
1397
|
-
] }) : /* @__PURE__ */
|
|
1398
|
-
/* @__PURE__ */ e(
|
|
1397
|
+
] }) : /* @__PURE__ */ r(O, { children: [
|
|
1398
|
+
/* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5" }),
|
|
1399
1399
|
"Save to Library"
|
|
1400
1400
|
] })
|
|
1401
1401
|
}
|
|
@@ -1404,7 +1404,7 @@ function $r({
|
|
|
1404
1404
|
function Wr({
|
|
1405
1405
|
className: t
|
|
1406
1406
|
}) {
|
|
1407
|
-
const
|
|
1407
|
+
const a = Qe(), [o, s] = D(!1), i = Ge(), n = ee((f) => f.frame), c = N((f) => f.selectedSheetId), d = N((f) => f.dashboard), { updateFrame: l, setIsVisualEditing: u } = de(), { getUpdatedFrame: h } = ve(), m = Bt(), p = xt();
|
|
1408
1408
|
return /* @__PURE__ */ e(
|
|
1409
1409
|
L,
|
|
1410
1410
|
{
|
|
@@ -1413,7 +1413,7 @@ function Wr({
|
|
|
1413
1413
|
F.error("No sheet selected");
|
|
1414
1414
|
return;
|
|
1415
1415
|
}
|
|
1416
|
-
const f = (
|
|
1416
|
+
const f = (n == null ? void 0 : n.visualId) || (i == null ? void 0 : i.id);
|
|
1417
1417
|
if (!f) {
|
|
1418
1418
|
F.error("No visual to update");
|
|
1419
1419
|
return;
|
|
@@ -1439,7 +1439,7 @@ function Wr({
|
|
|
1439
1439
|
}
|
|
1440
1440
|
}), l(c, k, {
|
|
1441
1441
|
semanticExecutionPayload: M
|
|
1442
|
-
}),
|
|
1442
|
+
}), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual", f] }), F.success("Saved to library and applied locally"), setTimeout(() => {
|
|
1443
1443
|
u(!1);
|
|
1444
1444
|
}, 300);
|
|
1445
1445
|
} catch (v) {
|
|
@@ -1454,26 +1454,26 @@ function Wr({
|
|
|
1454
1454
|
size: "xs",
|
|
1455
1455
|
variant: "default",
|
|
1456
1456
|
disabled: o,
|
|
1457
|
-
children: o ? /* @__PURE__ */
|
|
1457
|
+
children: o ? /* @__PURE__ */ r(O, { children: [
|
|
1458
1458
|
/* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1459
1459
|
"Saving..."
|
|
1460
|
-
] }) : /* @__PURE__ */
|
|
1461
|
-
/* @__PURE__ */ e(
|
|
1460
|
+
] }) : /* @__PURE__ */ r(O, { children: [
|
|
1461
|
+
/* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5" }),
|
|
1462
1462
|
"Save & Apply"
|
|
1463
1463
|
] })
|
|
1464
1464
|
}
|
|
1465
1465
|
);
|
|
1466
1466
|
}
|
|
1467
1467
|
function at({ className: t }) {
|
|
1468
|
-
const { setTempQueryData:
|
|
1468
|
+
const { setTempQueryData: a, setSqlGen: o } = Ke(), s = Qe(), i = ee((d) => d.tempQueryData), n = ee((d) => d.onClose);
|
|
1469
1469
|
function c() {
|
|
1470
1470
|
if (i) {
|
|
1471
1471
|
const { queryKey: d, queryData: l } = i;
|
|
1472
1472
|
d && l && s.setQueryData(d, l);
|
|
1473
1473
|
}
|
|
1474
|
-
o({}),
|
|
1474
|
+
o({}), n == null || n();
|
|
1475
1475
|
}
|
|
1476
|
-
return /* @__PURE__ */
|
|
1476
|
+
return /* @__PURE__ */ r(
|
|
1477
1477
|
L,
|
|
1478
1478
|
{
|
|
1479
1479
|
onClick: c,
|
|
@@ -1488,21 +1488,21 @@ function at({ className: t }) {
|
|
|
1488
1488
|
);
|
|
1489
1489
|
}
|
|
1490
1490
|
function qr() {
|
|
1491
|
-
const [t,
|
|
1492
|
-
var
|
|
1493
|
-
return ((
|
|
1494
|
-
})(), z = pa((
|
|
1495
|
-
|
|
1491
|
+
const [t, a] = D(!1), [o, s] = D(!1), [i, n] = D(null), [c, d] = D(null), l = ee((w) => w.frame), u = ee((w) => w.card), h = Ge(), m = N((w) => w.selectedSheetId), p = N((w) => w.dashboard), { getUpdatedFrame: g } = ve(), { selectVisual: f } = it(), { addFrame: v, setSelectedFrameId: k, setIsVisualEditing: V } = de(), M = xt(), U = !!(l != null && l.visualId), A = (() => {
|
|
1492
|
+
var w, x;
|
|
1493
|
+
return ((w = l == null ? void 0 : l.cards) == null ? void 0 : w.length) === 1 && ((x = l.cards[0]) != null && x.title) ? l.cards[0].title : h != null && h.title ? h.title : (u == null ? void 0 : u.title) || "Untitled Visual";
|
|
1494
|
+
})(), z = pa((w) => {
|
|
1495
|
+
w != null && w.id && (f(w), o && i && c && m && (async () => {
|
|
1496
1496
|
try {
|
|
1497
1497
|
const x = {
|
|
1498
1498
|
...i,
|
|
1499
1499
|
id: Dt(),
|
|
1500
|
-
visualId:
|
|
1500
|
+
visualId: w.id
|
|
1501
1501
|
// Link to the newly created library visual
|
|
1502
1502
|
};
|
|
1503
1503
|
v(m, x, {
|
|
1504
1504
|
semanticExecutionPayload: c
|
|
1505
|
-
}), k(x.id), s(!1),
|
|
1505
|
+
}), k(x.id), s(!1), n(null), d(null), V(!1);
|
|
1506
1506
|
} catch (x) {
|
|
1507
1507
|
console.error(
|
|
1508
1508
|
"Failed to promote semantic metadata for saved visual:",
|
|
@@ -1511,12 +1511,12 @@ function qr() {
|
|
|
1511
1511
|
x instanceof Error ? x.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1512
1512
|
);
|
|
1513
1513
|
}
|
|
1514
|
-
})(),
|
|
1514
|
+
})(), a(!1));
|
|
1515
1515
|
});
|
|
1516
1516
|
return {
|
|
1517
1517
|
saveAsDialogOpen: t,
|
|
1518
|
-
setSaveAsDialogOpen:
|
|
1519
|
-
handleSaveAs: async (
|
|
1518
|
+
setSaveAsDialogOpen: a,
|
|
1519
|
+
handleSaveAs: async (w) => {
|
|
1520
1520
|
if (!m) {
|
|
1521
1521
|
F.error("No sheet selected");
|
|
1522
1522
|
return;
|
|
@@ -1525,13 +1525,13 @@ function qr() {
|
|
|
1525
1525
|
...x,
|
|
1526
1526
|
cards: x.cards.map((j) => ({
|
|
1527
1527
|
...j,
|
|
1528
|
-
title:
|
|
1528
|
+
title: w.name
|
|
1529
1529
|
// Use visual name as card title
|
|
1530
1530
|
}))
|
|
1531
1531
|
} : x;
|
|
1532
|
-
if (
|
|
1532
|
+
if (w.saveToLibrary) {
|
|
1533
1533
|
let j = null;
|
|
1534
|
-
if (
|
|
1534
|
+
if (w.saveToCurrentDashboard)
|
|
1535
1535
|
try {
|
|
1536
1536
|
j = await M(S, {
|
|
1537
1537
|
previousFrame: He(p, S.id)
|
|
@@ -1545,16 +1545,16 @@ function qr() {
|
|
|
1545
1545
|
);
|
|
1546
1546
|
return;
|
|
1547
1547
|
}
|
|
1548
|
-
s(
|
|
1548
|
+
s(w.saveToCurrentDashboard), n(S), d(j);
|
|
1549
1549
|
const I = {
|
|
1550
|
-
title:
|
|
1551
|
-
description:
|
|
1550
|
+
title: w.name,
|
|
1551
|
+
description: w.description,
|
|
1552
1552
|
frameObject: S,
|
|
1553
1553
|
// Card title synced for single-card frames
|
|
1554
1554
|
isPrivate: !1
|
|
1555
1555
|
};
|
|
1556
1556
|
z.mutate(I);
|
|
1557
|
-
} else if (
|
|
1557
|
+
} else if (w.saveToCurrentDashboard) {
|
|
1558
1558
|
const j = {
|
|
1559
1559
|
...S,
|
|
1560
1560
|
// Card title already synced
|
|
@@ -1568,7 +1568,7 @@ function qr() {
|
|
|
1568
1568
|
});
|
|
1569
1569
|
v(m, j, {
|
|
1570
1570
|
semanticExecutionPayload: I
|
|
1571
|
-
}), k(j.id), F.success("Visual saved to dashboard"),
|
|
1571
|
+
}), k(j.id), F.success("Visual saved to dashboard"), a(!1), V(!1);
|
|
1572
1572
|
} catch (I) {
|
|
1573
1573
|
console.error("Failed to save visual to dashboard:", I), F.error(
|
|
1574
1574
|
I instanceof Error ? I.message : "Failed to prepare semantic metadata for the visual"
|
|
@@ -1582,16 +1582,16 @@ function qr() {
|
|
|
1582
1582
|
};
|
|
1583
1583
|
}
|
|
1584
1584
|
function rs(t = {}) {
|
|
1585
|
-
const { isInspectionMode:
|
|
1585
|
+
const { isInspectionMode: a } = fa(), o = ee((I) => I.frame), s = ee((I) => I.editorContext), i = ga((I) => I.selectedVisual), n = N((I) => I.selectedFrameId), c = N((I) => I.selectedSheetId), d = N((I) => I.dashboard), { setIsVisualEditing: l, updateFrame: u } = de(), [h, m] = D(!1), [p, g] = D("both"), f = xt(), v = (s == null ? void 0 : s.type) === "documentSection", k = !!(o != null && o.visualId || i != null && i.id), V = !!(o != null && o.visualId && n), M = k && !V, {
|
|
1586
1586
|
saveAsDialogOpen: U,
|
|
1587
1587
|
setSaveAsDialogOpen: A,
|
|
1588
1588
|
handleSaveAs: z,
|
|
1589
|
-
isLibraryVisual:
|
|
1590
|
-
currentVisualName:
|
|
1589
|
+
isLibraryVisual: C,
|
|
1590
|
+
currentVisualName: w,
|
|
1591
1591
|
isSaving: x
|
|
1592
1592
|
} = qr(), { getUpdatedFrame: E } = ve();
|
|
1593
|
-
if (
|
|
1594
|
-
return /* @__PURE__ */
|
|
1593
|
+
if (a)
|
|
1594
|
+
return /* @__PURE__ */ r(O, { children: [
|
|
1595
1595
|
/* @__PURE__ */ e(
|
|
1596
1596
|
tt,
|
|
1597
1597
|
{
|
|
@@ -1602,7 +1602,7 @@ function rs(t = {}) {
|
|
|
1602
1602
|
/* @__PURE__ */ e(at, {})
|
|
1603
1603
|
] });
|
|
1604
1604
|
if (v)
|
|
1605
|
-
return /* @__PURE__ */
|
|
1605
|
+
return /* @__PURE__ */ r(O, { children: [
|
|
1606
1606
|
/* @__PURE__ */ e(tt, { className: "rounded-control", variant: "default" }),
|
|
1607
1607
|
/* @__PURE__ */ e(at, {})
|
|
1608
1608
|
] });
|
|
@@ -1636,12 +1636,12 @@ function rs(t = {}) {
|
|
|
1636
1636
|
}, j = (I) => {
|
|
1637
1637
|
g(I), A(!0);
|
|
1638
1638
|
};
|
|
1639
|
-
return /* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1639
|
+
return /* @__PURE__ */ r(O, { children: [
|
|
1640
|
+
/* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
1641
1641
|
!k && /* @__PURE__ */ e(tt, { className: "!rounded-none", variant: "default" }),
|
|
1642
1642
|
k && M && /* @__PURE__ */ e($r, { className: "!rounded-none", variant: "default" }),
|
|
1643
1643
|
k && V && /* @__PURE__ */ e(Wr, { className: "!rounded-none" }),
|
|
1644
|
-
/* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ r(Le, { modal: !1, children: [
|
|
1645
1645
|
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1646
1646
|
L,
|
|
1647
1647
|
{
|
|
@@ -1653,14 +1653,14 @@ function rs(t = {}) {
|
|
|
1653
1653
|
children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" })
|
|
1654
1654
|
}
|
|
1655
1655
|
) }),
|
|
1656
|
-
/* @__PURE__ */
|
|
1656
|
+
/* @__PURE__ */ r(
|
|
1657
1657
|
Te,
|
|
1658
1658
|
{
|
|
1659
1659
|
align: "end",
|
|
1660
1660
|
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
1661
1661
|
children: [
|
|
1662
|
-
V && /* @__PURE__ */
|
|
1663
|
-
/* @__PURE__ */
|
|
1662
|
+
V && /* @__PURE__ */ r(O, { children: [
|
|
1663
|
+
/* @__PURE__ */ r(
|
|
1664
1664
|
X,
|
|
1665
1665
|
{
|
|
1666
1666
|
onClick: S,
|
|
@@ -1673,7 +1673,7 @@ function rs(t = {}) {
|
|
|
1673
1673
|
),
|
|
1674
1674
|
/* @__PURE__ */ e(je, {})
|
|
1675
1675
|
] }),
|
|
1676
|
-
/* @__PURE__ */
|
|
1676
|
+
/* @__PURE__ */ r(
|
|
1677
1677
|
X,
|
|
1678
1678
|
{
|
|
1679
1679
|
onClick: () => j("local"),
|
|
@@ -1684,7 +1684,7 @@ function rs(t = {}) {
|
|
|
1684
1684
|
]
|
|
1685
1685
|
}
|
|
1686
1686
|
),
|
|
1687
|
-
/* @__PURE__ */
|
|
1687
|
+
/* @__PURE__ */ r(
|
|
1688
1688
|
X,
|
|
1689
1689
|
{
|
|
1690
1690
|
onClick: () => j("library"),
|
|
@@ -1695,7 +1695,7 @@ function rs(t = {}) {
|
|
|
1695
1695
|
]
|
|
1696
1696
|
}
|
|
1697
1697
|
),
|
|
1698
|
-
/* @__PURE__ */
|
|
1698
|
+
/* @__PURE__ */ r(
|
|
1699
1699
|
X,
|
|
1700
1700
|
{
|
|
1701
1701
|
onClick: () => j("both"),
|
|
@@ -1719,8 +1719,8 @@ function rs(t = {}) {
|
|
|
1719
1719
|
onOpenChange: (I) => {
|
|
1720
1720
|
x || A(I);
|
|
1721
1721
|
},
|
|
1722
|
-
isLibraryVisual:
|
|
1723
|
-
currentVisualName:
|
|
1722
|
+
isLibraryVisual: C,
|
|
1723
|
+
currentVisualName: w,
|
|
1724
1724
|
isSaving: x,
|
|
1725
1725
|
destinationMode: p,
|
|
1726
1726
|
onConfirm: z
|
|
@@ -1729,17 +1729,17 @@ function rs(t = {}) {
|
|
|
1729
1729
|
] });
|
|
1730
1730
|
}
|
|
1731
1731
|
function ns({ className: t }) {
|
|
1732
|
-
const
|
|
1732
|
+
const a = ee((h) => h.isDevMode), o = ee((h) => h.card.type), s = N((h) => h.isVisualEditing), { setIsDevMode: i } = Ke(), { config: n } = Kt(ba).tokenProps, c = (n == null ? void 0 : n.showAdvancedMode) !== !1;
|
|
1733
1733
|
if (!s || !c || !or(o))
|
|
1734
1734
|
return null;
|
|
1735
|
-
const d =
|
|
1736
|
-
return /* @__PURE__ */
|
|
1735
|
+
const d = a ? Fr : Dr, l = a ? "Visual editor" : "SQL editor", u = a ? "Switch to visual editor" : "Switch to SQL editor";
|
|
1736
|
+
return /* @__PURE__ */ r(
|
|
1737
1737
|
"button",
|
|
1738
1738
|
{
|
|
1739
1739
|
type: "button",
|
|
1740
1740
|
"aria-label": u,
|
|
1741
1741
|
title: u,
|
|
1742
|
-
onClick: () => i(!
|
|
1742
|
+
onClick: () => i(!a),
|
|
1743
1743
|
className: J(
|
|
1744
1744
|
"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",
|
|
1745
1745
|
t
|
|
@@ -1752,13 +1752,13 @@ function ns({ className: t }) {
|
|
|
1752
1752
|
);
|
|
1753
1753
|
}
|
|
1754
1754
|
function ss() {
|
|
1755
|
-
const t =
|
|
1755
|
+
const t = N((d) => d.isDashboardEditing), a = N((d) => d.isVisualEditing), o = N((d) => {
|
|
1756
1756
|
var u;
|
|
1757
1757
|
const l = ((u = d.dashboard) == null ? void 0 : u.sheets) ?? [];
|
|
1758
1758
|
return l.find((h) => h.id === d.selectedSheetId) ?? l[0];
|
|
1759
|
-
}), s =
|
|
1760
|
-
if (!t ||
|
|
1761
|
-
const
|
|
1759
|
+
}), s = N((d) => d.actions.arrangeSheet), i = N((d) => d.actions.undoArrange);
|
|
1760
|
+
if (!t || a || !o || wt(o)) return null;
|
|
1761
|
+
const n = !(o.frames ?? []).length, c = (d) => {
|
|
1762
1762
|
const l = s(o.id, { keepOrder: d });
|
|
1763
1763
|
if (!l.ok) {
|
|
1764
1764
|
F.error(l.reason === "not_a_grid" ? "This sheet has no grid to arrange." : "The dashboard can't be arranged right now.");
|
|
@@ -1777,14 +1777,14 @@ function ss() {
|
|
|
1777
1777
|
}
|
|
1778
1778
|
});
|
|
1779
1779
|
};
|
|
1780
|
-
return /* @__PURE__ */
|
|
1781
|
-
/* @__PURE__ */
|
|
1780
|
+
return /* @__PURE__ */ r("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
|
|
1781
|
+
/* @__PURE__ */ r(
|
|
1782
1782
|
L,
|
|
1783
1783
|
{
|
|
1784
1784
|
variant: "ghost",
|
|
1785
1785
|
size: "xs",
|
|
1786
|
-
disabled:
|
|
1787
|
-
title:
|
|
1786
|
+
disabled: n,
|
|
1787
|
+
title: n ? "This sheet has no cards to arrange" : "Lay out the cards by kind on every screen size",
|
|
1788
1788
|
onClick: () => c(!1),
|
|
1789
1789
|
className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
|
|
1790
1790
|
children: [
|
|
@@ -1793,19 +1793,19 @@ function ss() {
|
|
|
1793
1793
|
]
|
|
1794
1794
|
}
|
|
1795
1795
|
),
|
|
1796
|
-
/* @__PURE__ */
|
|
1796
|
+
/* @__PURE__ */ r(Le, { modal: !1, children: [
|
|
1797
1797
|
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1798
1798
|
L,
|
|
1799
1799
|
{
|
|
1800
1800
|
variant: "ghost",
|
|
1801
1801
|
size: "xs",
|
|
1802
|
-
disabled:
|
|
1802
|
+
disabled: n,
|
|
1803
1803
|
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
|
|
1804
1804
|
"aria-label": "Open arrange options",
|
|
1805
1805
|
children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" })
|
|
1806
1806
|
}
|
|
1807
1807
|
) }),
|
|
1808
|
-
/* @__PURE__ */ e(Te, { align: "end", className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm", children: /* @__PURE__ */
|
|
1808
|
+
/* @__PURE__ */ e(Te, { align: "end", className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm", children: /* @__PURE__ */ r(X, { onClick: () => c(!0), children: [
|
|
1809
1809
|
/* @__PURE__ */ e(Ae, { className: "h-3.5 w-3.5" }),
|
|
1810
1810
|
"Keep my order"
|
|
1811
1811
|
] }) })
|
|
@@ -1813,46 +1813,46 @@ function ss() {
|
|
|
1813
1813
|
] });
|
|
1814
1814
|
}
|
|
1815
1815
|
function os() {
|
|
1816
|
-
const t =
|
|
1817
|
-
var
|
|
1818
|
-
const
|
|
1819
|
-
return !!
|
|
1820
|
-
}),
|
|
1821
|
-
return
|
|
1816
|
+
const t = N((s) => s.screenSizesOpen), a = N((s) => {
|
|
1817
|
+
var c, d;
|
|
1818
|
+
const i = ((c = s.dashboard) == null ? void 0 : c.sheets) ?? [], n = i.find((l) => l.id === s.selectedSheetId) ?? i[0];
|
|
1819
|
+
return !!n && !wt(n) && !!((d = n.frames) != null && d.length);
|
|
1820
|
+
}), o = N((s) => s.actions.setScreenSizesOpen);
|
|
1821
|
+
return a ? /* @__PURE__ */ e(
|
|
1822
1822
|
L,
|
|
1823
1823
|
{
|
|
1824
1824
|
type: "button",
|
|
1825
1825
|
size: "xs",
|
|
1826
|
-
variant:
|
|
1827
|
-
"aria-pressed":
|
|
1828
|
-
"aria-label": "
|
|
1829
|
-
title: "
|
|
1830
|
-
onClick: () =>
|
|
1826
|
+
variant: t ? "secondary" : "ghost",
|
|
1827
|
+
"aria-pressed": t,
|
|
1828
|
+
"aria-label": "Screen sizes",
|
|
1829
|
+
title: "Screen sizes",
|
|
1830
|
+
onClick: () => o(!t),
|
|
1831
1831
|
className: "px-1.5",
|
|
1832
1832
|
children: /* @__PURE__ */ e(Ar, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
|
|
1833
1833
|
}
|
|
1834
|
-
);
|
|
1834
|
+
) : null;
|
|
1835
1835
|
}
|
|
1836
1836
|
function is({
|
|
1837
1837
|
open: t,
|
|
1838
|
-
onOpenChange:
|
|
1838
|
+
onOpenChange: a,
|
|
1839
1839
|
onSave: o,
|
|
1840
1840
|
onDiscard: s,
|
|
1841
1841
|
isSaving: i,
|
|
1842
|
-
title:
|
|
1842
|
+
title: n = "Unsaved changes",
|
|
1843
1843
|
description: c = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
1844
1844
|
cancelLabel: d = "Cancel",
|
|
1845
1845
|
discardLabel: l = "Discard changes",
|
|
1846
1846
|
saveLabel: u = "Save"
|
|
1847
1847
|
}) {
|
|
1848
1848
|
return /* @__PURE__ */ e(lt, { open: t, onOpenChange: (m) => {
|
|
1849
|
-
!m && i ||
|
|
1850
|
-
}, children: /* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
1852
|
-
/* @__PURE__ */ e(ut, { children:
|
|
1849
|
+
!m && i || a(m);
|
|
1850
|
+
}, children: /* @__PURE__ */ r(dt, { children: [
|
|
1851
|
+
/* @__PURE__ */ r(ct, { children: [
|
|
1852
|
+
/* @__PURE__ */ e(ut, { children: n }),
|
|
1853
1853
|
/* @__PURE__ */ e(ht, { children: c })
|
|
1854
1854
|
] }),
|
|
1855
|
-
/* @__PURE__ */
|
|
1855
|
+
/* @__PURE__ */ r(mt, { children: [
|
|
1856
1856
|
/* @__PURE__ */ e(
|
|
1857
1857
|
L,
|
|
1858
1858
|
{
|
|
@@ -1866,7 +1866,7 @@ function is({
|
|
|
1866
1866
|
}
|
|
1867
1867
|
),
|
|
1868
1868
|
/* @__PURE__ */ e(pt, { disabled: i, children: d }),
|
|
1869
|
-
/* @__PURE__ */ e(L, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */
|
|
1869
|
+
/* @__PURE__ */ e(L, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ r(O, { children: [
|
|
1870
1870
|
/* @__PURE__ */ e(ne, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1871
1871
|
"Saving..."
|
|
1872
1872
|
] }) : u })
|
|
@@ -1874,14 +1874,14 @@ function is({
|
|
|
1874
1874
|
] }) });
|
|
1875
1875
|
}
|
|
1876
1876
|
async function ls(t) {
|
|
1877
|
-
var
|
|
1878
|
-
const
|
|
1879
|
-
if (!
|
|
1877
|
+
var n, c;
|
|
1878
|
+
const a = (c = (n = N.getState()) == null ? void 0 : n.authToken) == null ? void 0 : c.accessToken;
|
|
1879
|
+
if (!a)
|
|
1880
1880
|
return;
|
|
1881
1881
|
const o = `${t}/v1/invalidate-token`, s = await fetch(o, {
|
|
1882
1882
|
method: "POST",
|
|
1883
1883
|
headers: {
|
|
1884
|
-
Authorization: `Bearer ${
|
|
1884
|
+
Authorization: `Bearer ${a}`
|
|
1885
1885
|
}
|
|
1886
1886
|
});
|
|
1887
1887
|
if (!s.ok)
|
|
@@ -1907,43 +1907,43 @@ function Hr(t) {
|
|
|
1907
1907
|
}
|
|
1908
1908
|
function Qr(t) {
|
|
1909
1909
|
var o;
|
|
1910
|
-
const
|
|
1911
|
-
return
|
|
1912
|
-
title:
|
|
1913
|
-
status:
|
|
1914
|
-
startedAt:
|
|
1915
|
-
finishedAt:
|
|
1916
|
-
running: Hr(
|
|
1910
|
+
const a = t.item;
|
|
1911
|
+
return a.kind === "export" ? {
|
|
1912
|
+
title: a.title,
|
|
1913
|
+
status: a.status,
|
|
1914
|
+
startedAt: a.startedAt,
|
|
1915
|
+
finishedAt: a.finishedAt,
|
|
1916
|
+
running: Hr(a.stage),
|
|
1917
1917
|
finishedDetail: [
|
|
1918
|
-
|
|
1919
|
-
|
|
1918
|
+
a.totalRows !== null ? `${a.totalRows.toLocaleString("en-US")} rows` : null,
|
|
1919
|
+
a.fileSize ? Sa(a.fileSize) : null
|
|
1920
1920
|
].filter((s) => !!s),
|
|
1921
|
-
failure: ((o =
|
|
1921
|
+
failure: ((o = a.failure) == null ? void 0 : o.kind) === "export" ? a.failure.message : a.status === "failed" ? K.failedFallback : null,
|
|
1922
1922
|
note: null
|
|
1923
1923
|
} : {
|
|
1924
|
-
title:
|
|
1925
|
-
status:
|
|
1926
|
-
startedAt:
|
|
1927
|
-
finishedAt:
|
|
1928
|
-
running: { text:
|
|
1924
|
+
title: a.title,
|
|
1925
|
+
status: a.status,
|
|
1926
|
+
startedAt: a.startedAt,
|
|
1927
|
+
finishedAt: a.finishedAt,
|
|
1928
|
+
running: { text: a.stageLabel ?? K.inProgress },
|
|
1929
1929
|
finishedDetail: [],
|
|
1930
1930
|
failure: null,
|
|
1931
|
-
note:
|
|
1931
|
+
note: a.omittedAttachmentCount > 0 ? he.attachmentsLeftOut(a.omittedAttachmentCount) : null
|
|
1932
1932
|
};
|
|
1933
1933
|
}
|
|
1934
|
-
function Gr({ row: t, now:
|
|
1935
|
-
const [s, i] = D("idle"),
|
|
1934
|
+
function Gr({ row: t, now: a, api: o }) {
|
|
1935
|
+
const [s, i] = D("idle"), n = Qr(t), c = xa(t, o), d = async () => {
|
|
1936
1936
|
if (!c) return;
|
|
1937
1937
|
i("working");
|
|
1938
1938
|
const f = await ka(o, t, c);
|
|
1939
1939
|
i(f === "done" ? "idle" : f);
|
|
1940
|
-
}, l =
|
|
1941
|
-
return /* @__PURE__ */
|
|
1940
|
+
}, l = n.status === "ready" ? "bg-emerald-500" : n.status === "failed" ? "bg-destructive" : n.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", u = n.status === "ready" ? K.ready : n.status === "failed" ? K.failed : n.status === "cancelled" ? K.cancelled : K.inProgress, h = Date.parse(n.startedAt), m = At(Date.parse(n.finishedAt ?? n.startedAt), a, { addSuffix: !0 }), p = n.status === "running" && t.item.kind === "export" && a - h >= va, g = /* @__PURE__ */ e("span", { className: "text-muted-foreground/50", children: "·" });
|
|
1941
|
+
return /* @__PURE__ */ r("div", { className: "group flex items-start gap-2.5 px-3 py-2 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
1942
1942
|
/* @__PURE__ */ e("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ e("span", { className: `h-1.5 w-1.5 rounded-full ${l}` }) }),
|
|
1943
1943
|
/* @__PURE__ */ e("span", { className: "sr-only", children: u }),
|
|
1944
|
-
/* @__PURE__ */
|
|
1945
|
-
/* @__PURE__ */
|
|
1946
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children:
|
|
1944
|
+
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
1945
|
+
/* @__PURE__ */ r("div", { className: "flex h-5 items-center gap-2", children: [
|
|
1946
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: n.title }),
|
|
1947
1947
|
c && s === "working" && /* @__PURE__ */ e("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: /* @__PURE__ */ e(Pt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }) }),
|
|
1948
1948
|
c && s !== "working" && /* @__PURE__ */ e(
|
|
1949
1949
|
"button",
|
|
@@ -1955,40 +1955,40 @@ function Gr({ row: t, now: r, api: o }) {
|
|
|
1955
1955
|
}
|
|
1956
1956
|
)
|
|
1957
1957
|
] }),
|
|
1958
|
-
|
|
1959
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums", children:
|
|
1960
|
-
|
|
1958
|
+
n.status === "running" && n.running && /* @__PURE__ */ r("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
|
|
1959
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: n.running.text }),
|
|
1960
|
+
n.running.detail && /* @__PURE__ */ r(O, { children: [
|
|
1961
1961
|
" ",
|
|
1962
1962
|
g,
|
|
1963
1963
|
" ",
|
|
1964
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums", children:
|
|
1964
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: n.running.detail })
|
|
1965
1965
|
] }),
|
|
1966
1966
|
" ",
|
|
1967
1967
|
g,
|
|
1968
1968
|
" ",
|
|
1969
|
-
/* @__PURE__ */ e("span", { children: K.started(At(h,
|
|
1970
|
-
|
|
1969
|
+
/* @__PURE__ */ e("span", { children: K.started(At(h, a)) }),
|
|
1970
|
+
n.running.bar !== void 0 && /* @__PURE__ */ e(Ca, { value: n.running.bar, className: "mt-1.5 h-1" }),
|
|
1971
1971
|
p && /* @__PURE__ */ e("div", { className: "mt-1", children: K.longRunning })
|
|
1972
1972
|
] }),
|
|
1973
|
-
|
|
1974
|
-
|
|
1973
|
+
n.status !== "running" && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
|
|
1974
|
+
n.status === "ready" && n.finishedDetail.length > 0 ? (
|
|
1975
1975
|
// Disclosed on hover or focus only; the time is what a reader scans.
|
|
1976
|
-
/* @__PURE__ */
|
|
1977
|
-
|
|
1976
|
+
/* @__PURE__ */ r("span", { className: "hidden group-hover:contents group-focus-within:contents", children: [
|
|
1977
|
+
n.finishedDetail.map((f, v) => /* @__PURE__ */ r(Et.Fragment, { children: [
|
|
1978
1978
|
v > 0 && g,
|
|
1979
1979
|
/* @__PURE__ */ e("span", { children: f })
|
|
1980
1980
|
] }, v)),
|
|
1981
1981
|
g
|
|
1982
1982
|
] })
|
|
1983
|
-
) :
|
|
1983
|
+
) : n.status !== "ready" ? /* @__PURE__ */ r(O, { children: [
|
|
1984
1984
|
/* @__PURE__ */ e("span", { children: u }),
|
|
1985
1985
|
g
|
|
1986
1986
|
] }) : null,
|
|
1987
1987
|
/* @__PURE__ */ e("span", { children: m })
|
|
1988
1988
|
] }),
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
(s === "denied" || s === "blocked") && /* @__PURE__ */
|
|
1989
|
+
n.note && /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-muted-foreground", children: n.note }),
|
|
1990
|
+
n.status === "failed" && n.failure && /* @__PURE__ */ e("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: n.failure }),
|
|
1991
|
+
(s === "denied" || s === "blocked") && /* @__PURE__ */ r("div", { role: "alert", className: "mt-1 flex items-start gap-1.5 text-[12px] leading-4 text-foreground", children: [
|
|
1992
1992
|
/* @__PURE__ */ e(wa, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
|
|
1993
1993
|
/* @__PURE__ */ e("span", { children: Na(s) })
|
|
1994
1994
|
] })
|
|
@@ -1996,11 +1996,11 @@ function Gr({ row: t, now: r, api: o }) {
|
|
|
1996
1996
|
] });
|
|
1997
1997
|
}
|
|
1998
1998
|
function ds({ variant: t }) {
|
|
1999
|
-
const { snapshot:
|
|
2000
|
-
return /* @__PURE__ */
|
|
1999
|
+
const { snapshot: a, markSeen: o } = vt(), s = a.runningCount > 0 ? a.runningCount > 9 ? "9+" : String(a.runningCount) : a.hasUnseenFinished ? "" : null;
|
|
2000
|
+
return /* @__PURE__ */ r($e, { onOpenChange: (i) => {
|
|
2001
2001
|
i && o();
|
|
2002
2002
|
}, children: [
|
|
2003
|
-
/* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */
|
|
2003
|
+
/* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2004
2004
|
L,
|
|
2005
2005
|
{
|
|
2006
2006
|
variant: t ?? "ghost",
|
|
@@ -2024,16 +2024,16 @@ function ds({ variant: t }) {
|
|
|
2024
2024
|
] });
|
|
2025
2025
|
}
|
|
2026
2026
|
function Kr() {
|
|
2027
|
-
const t = vt(),
|
|
2028
|
-
return o.length === 0 ? /* @__PURE__ */
|
|
2027
|
+
const t = vt(), a = Da(), { rows: o, activeTruncated: s } = t.snapshot, i = o.some((n) => Aa(n.item.status));
|
|
2028
|
+
return o.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
|
|
2029
2029
|
/* @__PURE__ */ e("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ e(Fa, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
|
|
2030
2030
|
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: he.title }),
|
|
2031
2031
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: he.empty })
|
|
2032
|
-
] }) : /* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2032
|
+
] }) : /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
2033
|
+
/* @__PURE__ */ r("div", { className: "flex h-8 items-center gap-2 border-b border-border px-3", children: [
|
|
2034
2034
|
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: he.title }),
|
|
2035
2035
|
/* @__PURE__ */ e("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: o.length }),
|
|
2036
|
-
/* @__PURE__ */
|
|
2036
|
+
/* @__PURE__ */ r("div", { className: "ml-auto flex items-center gap-0.5", children: [
|
|
2037
2037
|
i && /* @__PURE__ */ e(
|
|
2038
2038
|
L,
|
|
2039
2039
|
{
|
|
@@ -2059,7 +2059,7 @@ function Kr() {
|
|
|
2059
2059
|
] })
|
|
2060
2060
|
] }),
|
|
2061
2061
|
s && /* @__PURE__ */ e("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children: he.truncated }),
|
|
2062
|
-
/* @__PURE__ */ e("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y divide-border/70", children: o.map((
|
|
2062
|
+
/* @__PURE__ */ e("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y divide-border/70", children: o.map((n) => /* @__PURE__ */ e(Gr, { row: n, now: a, api: t }, Ea(n))) }) })
|
|
2063
2063
|
] });
|
|
2064
2064
|
}
|
|
2065
2065
|
function Xr(t) {
|
|
@@ -2073,21 +2073,21 @@ function Xr(t) {
|
|
|
2073
2073
|
}
|
|
2074
2074
|
function Yr({
|
|
2075
2075
|
open: t,
|
|
2076
|
-
onOpenChange:
|
|
2076
|
+
onOpenChange: a,
|
|
2077
2077
|
trigger: o,
|
|
2078
2078
|
showTrigger: s = !0,
|
|
2079
2079
|
initialMode: i = "manage"
|
|
2080
2080
|
}) {
|
|
2081
|
-
const
|
|
2081
|
+
const n = i === "create", {
|
|
2082
2082
|
forceClose: c,
|
|
2083
2083
|
handleOpenChange: d,
|
|
2084
2084
|
isCreateFlowActive: l,
|
|
2085
2085
|
preventPassiveDismissDuringCreate: u,
|
|
2086
2086
|
resolvedOpen: h,
|
|
2087
2087
|
setIsCreateFlowActive: m
|
|
2088
|
-
} =
|
|
2088
|
+
} = _t({
|
|
2089
2089
|
open: t,
|
|
2090
|
-
onOpenChange:
|
|
2090
|
+
onOpenChange: a,
|
|
2091
2091
|
initialCreateFlowActive: i === "create",
|
|
2092
2092
|
// Dialog mode renders a built-in X close button — allow explicit
|
|
2093
2093
|
// closes through `handleOpenChange`. Popover mode has no X; its
|
|
@@ -2096,7 +2096,7 @@ function Yr({
|
|
|
2096
2096
|
// create and make consumers use `forceClose()` from a dedicated
|
|
2097
2097
|
// button.
|
|
2098
2098
|
dismissMode: s ? "passive" : "explicit-only"
|
|
2099
|
-
}), p =
|
|
2099
|
+
}), p = N((x) => x.dashboard), { setDashboardControlsModel: g } = de(), { participants: f } = Ia(mr(p)), v = Array.from(
|
|
2100
2100
|
new Map(
|
|
2101
2101
|
f.flatMap(
|
|
2102
2102
|
(x) => x.fieldChoices.map((E) => {
|
|
@@ -2136,12 +2136,12 @@ function Yr({
|
|
|
2136
2136
|
Xr(S)
|
|
2137
2137
|
);
|
|
2138
2138
|
}, A = ae(() => {
|
|
2139
|
-
if (
|
|
2139
|
+
if (n) {
|
|
2140
2140
|
c();
|
|
2141
2141
|
return;
|
|
2142
2142
|
}
|
|
2143
2143
|
m(!1);
|
|
2144
|
-
}, [
|
|
2144
|
+
}, [n, c, m]), z = /* @__PURE__ */ e(
|
|
2145
2145
|
jt,
|
|
2146
2146
|
{
|
|
2147
2147
|
scope: "dashboard",
|
|
@@ -2159,15 +2159,15 @@ function Yr({
|
|
|
2159
2159
|
onChange: U,
|
|
2160
2160
|
emptyMessage: "No dashboard controls yet."
|
|
2161
2161
|
}
|
|
2162
|
-
),
|
|
2163
|
-
/* @__PURE__ */
|
|
2162
|
+
), C = l ? "Add dashboard control" : "Dashboard Controls", w = /* @__PURE__ */ r(O, { children: [
|
|
2163
|
+
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
2164
2164
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
2165
2165
|
/* @__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." })
|
|
2166
2166
|
] }),
|
|
2167
2167
|
z
|
|
2168
2168
|
] });
|
|
2169
|
-
return s ? /* @__PURE__ */
|
|
2170
|
-
/* @__PURE__ */ e(We, { asChild: !0, children: o || /* @__PURE__ */
|
|
2169
|
+
return s ? /* @__PURE__ */ r($e, { open: h, onOpenChange: d, children: [
|
|
2170
|
+
/* @__PURE__ */ e(We, { asChild: !0, children: o || /* @__PURE__ */ r(L, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
2171
2171
|
/* @__PURE__ */ e(zt, { className: "mr-2 h-4 w-4" }),
|
|
2172
2172
|
"Controls"
|
|
2173
2173
|
] }) }),
|
|
@@ -2178,22 +2178,22 @@ function Yr({
|
|
|
2178
2178
|
align: "end",
|
|
2179
2179
|
onEscapeKeyDown: u,
|
|
2180
2180
|
onPointerDownOutside: u,
|
|
2181
|
-
children:
|
|
2181
|
+
children: w
|
|
2182
2182
|
}
|
|
2183
2183
|
)
|
|
2184
|
-
] }) : /* @__PURE__ */ e(Fe, { open: h, onOpenChange: d, children: /* @__PURE__ */
|
|
2184
|
+
] }) : /* @__PURE__ */ e(Fe, { open: h, onOpenChange: d, children: /* @__PURE__ */ r(
|
|
2185
2185
|
Ee,
|
|
2186
2186
|
{
|
|
2187
2187
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
2188
2188
|
onEscapeKeyDown: u,
|
|
2189
2189
|
onPointerDownOutside: u,
|
|
2190
2190
|
children: [
|
|
2191
|
-
/* @__PURE__ */
|
|
2191
|
+
/* @__PURE__ */ r(
|
|
2192
2192
|
gt,
|
|
2193
2193
|
{
|
|
2194
2194
|
className: l ? "space-y-0" : void 0,
|
|
2195
2195
|
children: [
|
|
2196
|
-
/* @__PURE__ */ e(Ie, { className: "text-[15px]", children:
|
|
2196
|
+
/* @__PURE__ */ e(Ie, { className: "text-[15px]", children: C }),
|
|
2197
2197
|
/* @__PURE__ */ e(
|
|
2198
2198
|
bt,
|
|
2199
2199
|
{
|
|
@@ -2219,23 +2219,23 @@ const Zr = [
|
|
|
2219
2219
|
];
|
|
2220
2220
|
function Jr({
|
|
2221
2221
|
open: t,
|
|
2222
|
-
onOpenChange:
|
|
2222
|
+
onOpenChange: a,
|
|
2223
2223
|
initialMode: o = "manage"
|
|
2224
2224
|
}) {
|
|
2225
|
-
var
|
|
2225
|
+
var w;
|
|
2226
2226
|
const s = o === "create", {
|
|
2227
2227
|
forceClose: i,
|
|
2228
|
-
handleOpenChange:
|
|
2228
|
+
handleOpenChange: n,
|
|
2229
2229
|
isCreateFlowActive: c,
|
|
2230
2230
|
preventPassiveDismissDuringCreate: d,
|
|
2231
2231
|
resolvedOpen: l,
|
|
2232
2232
|
setIsCreateFlowActive: u
|
|
2233
|
-
} =
|
|
2233
|
+
} = _t({
|
|
2234
2234
|
open: t,
|
|
2235
|
-
onOpenChange:
|
|
2235
|
+
onOpenChange: a,
|
|
2236
2236
|
initialCreateFlowActive: o === "create",
|
|
2237
2237
|
dismissMode: "explicit-only"
|
|
2238
|
-
}), h =
|
|
2238
|
+
}), h = N((x) => x.dashboard), m = N((x) => x.selectedSheetId), { setDashboardInputs: p } = de(), g = (w = h.sheets) == null ? void 0 : w.find(
|
|
2239
2239
|
(x) => x.id === m
|
|
2240
2240
|
), f = (g == null ? void 0 : g.kind) === "document" && !!g.document, v = re(
|
|
2241
2241
|
() => f && (g != null && g.document) ? vr(h, g.id) : [],
|
|
@@ -2281,14 +2281,14 @@ function Jr({
|
|
|
2281
2281
|
p
|
|
2282
2282
|
]
|
|
2283
2283
|
);
|
|
2284
|
-
return !f || !(g != null && g.document) ? null : /* @__PURE__ */ e(Fe, { open: l, onOpenChange:
|
|
2284
|
+
return !f || !(g != null && g.document) ? null : /* @__PURE__ */ e(Fe, { open: l, onOpenChange: n, children: /* @__PURE__ */ r(
|
|
2285
2285
|
Ee,
|
|
2286
2286
|
{
|
|
2287
2287
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
2288
2288
|
onEscapeKeyDown: d,
|
|
2289
2289
|
onPointerDownOutside: d,
|
|
2290
2290
|
children: [
|
|
2291
|
-
/* @__PURE__ */
|
|
2291
|
+
/* @__PURE__ */ r(gt, { className: c ? "space-y-0" : void 0, children: [
|
|
2292
2292
|
/* @__PURE__ */ e(Ie, { className: "text-[15px]", children: c ? "Add document control" : "Document Controls" }),
|
|
2293
2293
|
/* @__PURE__ */ e(
|
|
2294
2294
|
bt,
|
|
@@ -2323,34 +2323,34 @@ function Jr({
|
|
|
2323
2323
|
) });
|
|
2324
2324
|
}
|
|
2325
2325
|
function en(t) {
|
|
2326
|
-
return (t.controls || []).map((
|
|
2326
|
+
return (t.controls || []).map((a) => a.id);
|
|
2327
2327
|
}
|
|
2328
2328
|
function tn(t) {
|
|
2329
|
-
const
|
|
2329
|
+
const a = {};
|
|
2330
2330
|
for (const o of t)
|
|
2331
|
-
o.defaultValue !== void 0 && (
|
|
2332
|
-
return
|
|
2331
|
+
o.defaultValue !== void 0 && (a[o.id] = o.defaultValue);
|
|
2332
|
+
return a;
|
|
2333
2333
|
}
|
|
2334
|
-
function an(t,
|
|
2335
|
-
return
|
|
2334
|
+
function an(t, a) {
|
|
2335
|
+
return a ? Object.prototype.hasOwnProperty.call(a, t.id) ? {
|
|
2336
2336
|
...t,
|
|
2337
|
-
defaultValue:
|
|
2337
|
+
defaultValue: a[t.id]
|
|
2338
2338
|
} : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 };
|
|
2339
2339
|
}
|
|
2340
2340
|
function rn({
|
|
2341
2341
|
allInputs: t,
|
|
2342
|
-
documentSheetId:
|
|
2342
|
+
documentSheetId: a,
|
|
2343
2343
|
currentDocumentInputs: o,
|
|
2344
2344
|
nextControls: s,
|
|
2345
2345
|
nextDefaultValues: i,
|
|
2346
|
-
change:
|
|
2346
|
+
change: n
|
|
2347
2347
|
}) {
|
|
2348
2348
|
const c = new Map(
|
|
2349
2349
|
s.map((p) => [
|
|
2350
2350
|
p.id,
|
|
2351
2351
|
an(p, i)
|
|
2352
2352
|
])
|
|
2353
|
-
), d = (
|
|
2353
|
+
), d = (n == null ? void 0 : n.type) === "rename" ? { oldId: n.oldId, newId: n.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
|
|
2354
2354
|
for (const p of o) {
|
|
2355
2355
|
if (p.kind !== "control") {
|
|
2356
2356
|
u.push(p);
|
|
@@ -2379,7 +2379,7 @@ function rn({
|
|
|
2379
2379
|
yr({
|
|
2380
2380
|
control: p,
|
|
2381
2381
|
existingInputs: [...t, ...u],
|
|
2382
|
-
sheetId:
|
|
2382
|
+
sheetId: a
|
|
2383
2383
|
})
|
|
2384
2384
|
);
|
|
2385
2385
|
const h = new Set(
|
|
@@ -2391,18 +2391,18 @@ function rn({
|
|
|
2391
2391
|
}
|
|
2392
2392
|
function nn({
|
|
2393
2393
|
showFilters: t,
|
|
2394
|
-
onShowFiltersChange:
|
|
2394
|
+
onShowFiltersChange: a,
|
|
2395
2395
|
pickerContent: o,
|
|
2396
2396
|
settingsContent: s,
|
|
2397
2397
|
size: i = "default",
|
|
2398
|
-
className:
|
|
2398
|
+
className: n,
|
|
2399
2399
|
primaryButtonClassName: c,
|
|
2400
2400
|
secondaryButtonClassName: d,
|
|
2401
2401
|
pickerContentClassName: l,
|
|
2402
2402
|
settingsContentClassName: u
|
|
2403
2403
|
}) {
|
|
2404
2404
|
const h = i === "toolbar", [m, p] = D(!1), g = ot("interactive");
|
|
2405
|
-
return /* @__PURE__ */
|
|
2405
|
+
return /* @__PURE__ */ r(
|
|
2406
2406
|
"div",
|
|
2407
2407
|
{
|
|
2408
2408
|
className: J(
|
|
@@ -2411,11 +2411,11 @@ function nn({
|
|
|
2411
2411
|
// stretch to fill via `h-full`.
|
|
2412
2412
|
"relative inline-flex items-stretch overflow-hidden rounded-control border border-input bg-background",
|
|
2413
2413
|
h ? "h-8" : "h-7",
|
|
2414
|
-
|
|
2414
|
+
n
|
|
2415
2415
|
),
|
|
2416
2416
|
children: [
|
|
2417
|
-
/* @__PURE__ */
|
|
2418
|
-
/* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */
|
|
2417
|
+
/* @__PURE__ */ r($e, { open: t, onOpenChange: a, children: [
|
|
2418
|
+
/* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2419
2419
|
L,
|
|
2420
2420
|
{
|
|
2421
2421
|
variant: "ghost",
|
|
@@ -2444,7 +2444,7 @@ function nn({
|
|
|
2444
2444
|
}
|
|
2445
2445
|
)
|
|
2446
2446
|
] }),
|
|
2447
|
-
/* @__PURE__ */
|
|
2447
|
+
/* @__PURE__ */ r($e, { open: m, onOpenChange: p, children: [
|
|
2448
2448
|
/* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2449
2449
|
L,
|
|
2450
2450
|
{
|
|
@@ -2478,7 +2478,7 @@ function nn({
|
|
|
2478
2478
|
}
|
|
2479
2479
|
function sn() {
|
|
2480
2480
|
xr();
|
|
2481
|
-
const t =
|
|
2481
|
+
const t = N((l) => l.selectedSheetId), a = N((l) => l.selectedFrameId), o = N((l) => l.dashboard), s = N((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = de(), { setCard: n } = Ke(), c = ee((l) => l.card.dataSource);
|
|
2482
2482
|
return be(() => {
|
|
2483
2483
|
var u, h;
|
|
2484
2484
|
let l = s();
|
|
@@ -2488,23 +2488,23 @@ function sn() {
|
|
|
2488
2488
|
}
|
|
2489
2489
|
if (l) {
|
|
2490
2490
|
const m = l.cards.find((p) => p.id === l.activeCardId);
|
|
2491
|
-
m &&
|
|
2491
|
+
m && n(m);
|
|
2492
2492
|
}
|
|
2493
|
-
}, [s, t,
|
|
2493
|
+
}, [s, t, a, o, i, n]), {
|
|
2494
2494
|
hasEntities: !!(c != null && c.selectedEntities && c.selectedEntities.length > 0)
|
|
2495
2495
|
};
|
|
2496
2496
|
}
|
|
2497
2497
|
function on() {
|
|
2498
|
-
const t =
|
|
2498
|
+
const t = N((l) => l.dashboard), a = N(
|
|
2499
2499
|
(l) => l.semanticExecutionPayload
|
|
2500
|
-
), o =
|
|
2500
|
+
), o = N(
|
|
2501
2501
|
(l) => l.actions.addFilterInput
|
|
2502
|
-
), { hasEntities: s } = sn(), { isLoading: i } = Ta(),
|
|
2503
|
-
() => dr(t,
|
|
2504
|
-
[t,
|
|
2505
|
-
), d = !cr(t) &&
|
|
2506
|
-
return /* @__PURE__ */
|
|
2507
|
-
d && /* @__PURE__ */ e("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */
|
|
2502
|
+
), { hasEntities: s } = sn(), { isLoading: i } = Ta(), n = re(
|
|
2503
|
+
() => dr(t, a),
|
|
2504
|
+
[t, a]
|
|
2505
|
+
), d = !cr(t) && n.hasEligibleCards && !i;
|
|
2506
|
+
return /* @__PURE__ */ r("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
|
|
2507
|
+
d && /* @__PURE__ */ e("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
|
|
2508
2508
|
"button",
|
|
2509
2509
|
{
|
|
2510
2510
|
type: "button",
|
|
@@ -2512,18 +2512,18 @@ function on() {
|
|
|
2512
2512
|
kind: "allSheets",
|
|
2513
2513
|
sheetKinds: ["dashboard"]
|
|
2514
2514
|
}),
|
|
2515
|
-
title: `Applies to ${
|
|
2515
|
+
title: `Applies to ${n.eligibleCardCount} of ${n.totalCardCount} date-aware cards`,
|
|
2516
2516
|
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",
|
|
2517
2517
|
children: [
|
|
2518
2518
|
/* @__PURE__ */ e(kr, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
2519
|
-
/* @__PURE__ */
|
|
2519
|
+
/* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col", children: [
|
|
2520
2520
|
/* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
|
|
2521
2521
|
/* @__PURE__ */ e("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
|
|
2522
2522
|
] })
|
|
2523
2523
|
]
|
|
2524
2524
|
}
|
|
2525
2525
|
) }),
|
|
2526
|
-
!s && /* @__PURE__ */
|
|
2526
|
+
!s && /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
|
|
2527
2527
|
/* @__PURE__ */ e(Ba, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
|
|
2528
2528
|
/* @__PURE__ */ e("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
|
|
2529
2529
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
|
|
@@ -2533,15 +2533,15 @@ function on() {
|
|
|
2533
2533
|
}
|
|
2534
2534
|
function ln({
|
|
2535
2535
|
onAddFilter: t,
|
|
2536
|
-
onAddControl:
|
|
2536
|
+
onAddControl: a,
|
|
2537
2537
|
onManageControls: o,
|
|
2538
2538
|
onDismiss: s
|
|
2539
2539
|
}) {
|
|
2540
|
-
const i =
|
|
2540
|
+
const i = N(
|
|
2541
2541
|
(d) => d.dashboard.filterLayout
|
|
2542
|
-
), { setFilterLayout:
|
|
2543
|
-
return /* @__PURE__ */
|
|
2544
|
-
/* @__PURE__ */
|
|
2542
|
+
), { setFilterLayout: n } = de(), c = (i == null ? void 0 : i.toolbarWrap) ?? !1;
|
|
2543
|
+
return /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
|
|
2544
|
+
/* @__PURE__ */ r("div", { className: "p-1", children: [
|
|
2545
2545
|
/* @__PURE__ */ e(
|
|
2546
2546
|
rt,
|
|
2547
2547
|
{
|
|
@@ -2558,7 +2558,7 @@ function ln({
|
|
|
2558
2558
|
icon: zt,
|
|
2559
2559
|
label: "Add control",
|
|
2560
2560
|
onClick: () => {
|
|
2561
|
-
|
|
2561
|
+
a(), s();
|
|
2562
2562
|
}
|
|
2563
2563
|
}
|
|
2564
2564
|
),
|
|
@@ -2574,7 +2574,7 @@ function ln({
|
|
|
2574
2574
|
)
|
|
2575
2575
|
] }),
|
|
2576
2576
|
/* @__PURE__ */ e("div", { className: "border-t border-border/60" }),
|
|
2577
|
-
/* @__PURE__ */
|
|
2577
|
+
/* @__PURE__ */ r("div", { className: "space-y-1 p-2", children: [
|
|
2578
2578
|
/* @__PURE__ */ e("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
|
|
2579
2579
|
/* @__PURE__ */ e(
|
|
2580
2580
|
dn,
|
|
@@ -2582,7 +2582,7 @@ function ln({
|
|
|
2582
2582
|
id: "filter-display-wrap",
|
|
2583
2583
|
label: "Wrap to multiple lines",
|
|
2584
2584
|
checked: c,
|
|
2585
|
-
onCheckedChange: (d) =>
|
|
2585
|
+
onCheckedChange: (d) => n({ toolbarWrap: d === !0 })
|
|
2586
2586
|
}
|
|
2587
2587
|
)
|
|
2588
2588
|
] })
|
|
@@ -2590,10 +2590,10 @@ function ln({
|
|
|
2590
2590
|
}
|
|
2591
2591
|
function rt({
|
|
2592
2592
|
icon: t,
|
|
2593
|
-
label:
|
|
2593
|
+
label: a,
|
|
2594
2594
|
onClick: o
|
|
2595
2595
|
}) {
|
|
2596
|
-
return /* @__PURE__ */
|
|
2596
|
+
return /* @__PURE__ */ r(
|
|
2597
2597
|
"button",
|
|
2598
2598
|
{
|
|
2599
2599
|
type: "button",
|
|
@@ -2601,54 +2601,54 @@ function rt({
|
|
|
2601
2601
|
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",
|
|
2602
2602
|
children: [
|
|
2603
2603
|
/* @__PURE__ */ e(t, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
2604
|
-
|
|
2604
|
+
a
|
|
2605
2605
|
]
|
|
2606
2606
|
}
|
|
2607
2607
|
);
|
|
2608
2608
|
}
|
|
2609
2609
|
function dn({
|
|
2610
2610
|
id: t,
|
|
2611
|
-
label:
|
|
2611
|
+
label: a,
|
|
2612
2612
|
checked: o,
|
|
2613
2613
|
onCheckedChange: s
|
|
2614
2614
|
}) {
|
|
2615
|
-
return /* @__PURE__ */
|
|
2615
|
+
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: [
|
|
2616
2616
|
/* @__PURE__ */ e(ft, { id: t, checked: o, onCheckedChange: s }),
|
|
2617
2617
|
/* @__PURE__ */ e(
|
|
2618
2618
|
De,
|
|
2619
2619
|
{
|
|
2620
2620
|
htmlFor: t,
|
|
2621
2621
|
className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
|
|
2622
|
-
children:
|
|
2622
|
+
children: a
|
|
2623
2623
|
}
|
|
2624
2624
|
)
|
|
2625
2625
|
] });
|
|
2626
2626
|
}
|
|
2627
2627
|
function cs({
|
|
2628
2628
|
size: t,
|
|
2629
|
-
className:
|
|
2629
|
+
className: a,
|
|
2630
2630
|
primaryButtonClassName: o,
|
|
2631
2631
|
secondaryButtonClassName: s,
|
|
2632
2632
|
pickerContentClassName: i,
|
|
2633
|
-
settingsContentClassName:
|
|
2633
|
+
settingsContentClassName: n
|
|
2634
2634
|
}) {
|
|
2635
2635
|
var z;
|
|
2636
|
-
const [c, d] = D(null), l =
|
|
2637
|
-
(
|
|
2638
|
-
), v = wt(f), k = ae((
|
|
2636
|
+
const [c, d] = D(null), l = N((C) => C.dashboard), u = N((C) => C.selectedSheetId), h = N((C) => C.showFilters), m = N((C) => C.actions), { setDocumentPanelTarget: p, setShowFilters: g } = m, f = (z = l.sheets) == null ? void 0 : z.find(
|
|
2637
|
+
(C) => C.id === u
|
|
2638
|
+
), v = wt(f), k = ae((C) => {
|
|
2639
2639
|
window.setTimeout(() => {
|
|
2640
|
-
d(
|
|
2640
|
+
d(C);
|
|
2641
2641
|
}, 0);
|
|
2642
2642
|
}, []), V = ae(
|
|
2643
|
-
(
|
|
2643
|
+
(C) => {
|
|
2644
2644
|
if (v && u) {
|
|
2645
|
-
|
|
2645
|
+
C && p(u, {
|
|
2646
2646
|
kind: "document",
|
|
2647
2647
|
group: "inputs"
|
|
2648
2648
|
});
|
|
2649
2649
|
return;
|
|
2650
2650
|
}
|
|
2651
|
-
g(
|
|
2651
|
+
g(C);
|
|
2652
2652
|
},
|
|
2653
2653
|
[
|
|
2654
2654
|
v,
|
|
@@ -2663,36 +2663,36 @@ function cs({
|
|
|
2663
2663
|
}, [k]), A = ae(() => {
|
|
2664
2664
|
k("manage");
|
|
2665
2665
|
}, [k]);
|
|
2666
|
-
return /* @__PURE__ */
|
|
2666
|
+
return /* @__PURE__ */ r(O, { children: [
|
|
2667
2667
|
/* @__PURE__ */ e(
|
|
2668
2668
|
nn,
|
|
2669
2669
|
{
|
|
2670
2670
|
showFilters: v ? !1 : h,
|
|
2671
2671
|
onShowFiltersChange: V,
|
|
2672
2672
|
pickerContent: /* @__PURE__ */ e(on, {}),
|
|
2673
|
-
settingsContent: (
|
|
2673
|
+
settingsContent: (C) => /* @__PURE__ */ e(
|
|
2674
2674
|
ln,
|
|
2675
2675
|
{
|
|
2676
2676
|
onAddFilter: M,
|
|
2677
2677
|
onAddControl: U,
|
|
2678
2678
|
onManageControls: A,
|
|
2679
|
-
onDismiss:
|
|
2679
|
+
onDismiss: C
|
|
2680
2680
|
}
|
|
2681
2681
|
),
|
|
2682
2682
|
size: t,
|
|
2683
|
-
className:
|
|
2683
|
+
className: a,
|
|
2684
2684
|
primaryButtonClassName: o,
|
|
2685
2685
|
secondaryButtonClassName: s,
|
|
2686
2686
|
pickerContentClassName: i,
|
|
2687
|
-
settingsContentClassName:
|
|
2687
|
+
settingsContentClassName: n
|
|
2688
2688
|
}
|
|
2689
2689
|
),
|
|
2690
2690
|
c ? v ? /* @__PURE__ */ e(
|
|
2691
2691
|
Jr,
|
|
2692
2692
|
{
|
|
2693
2693
|
open: !0,
|
|
2694
|
-
onOpenChange: (
|
|
2695
|
-
|
|
2694
|
+
onOpenChange: (C) => {
|
|
2695
|
+
C || d(null);
|
|
2696
2696
|
},
|
|
2697
2697
|
initialMode: c
|
|
2698
2698
|
}
|
|
@@ -2700,8 +2700,8 @@ function cs({
|
|
|
2700
2700
|
Yr,
|
|
2701
2701
|
{
|
|
2702
2702
|
open: !0,
|
|
2703
|
-
onOpenChange: (
|
|
2704
|
-
|
|
2703
|
+
onOpenChange: (C) => {
|
|
2704
|
+
C || d(null);
|
|
2705
2705
|
},
|
|
2706
2706
|
showTrigger: !1,
|
|
2707
2707
|
initialMode: c
|
|
@@ -2711,12 +2711,12 @@ function cs({
|
|
|
2711
2711
|
}
|
|
2712
2712
|
function cn({
|
|
2713
2713
|
disabled: t,
|
|
2714
|
-
briefingCount:
|
|
2714
|
+
briefingCount: a,
|
|
2715
2715
|
className: o,
|
|
2716
2716
|
onClick: s
|
|
2717
2717
|
}) {
|
|
2718
|
-
const i = typeof
|
|
2719
|
-
return /* @__PURE__ */
|
|
2718
|
+
const i = typeof a == "number" && a > 0;
|
|
2719
|
+
return /* @__PURE__ */ r(
|
|
2720
2720
|
L,
|
|
2721
2721
|
{
|
|
2722
2722
|
type: "button",
|
|
@@ -2729,28 +2729,28 @@ function cn({
|
|
|
2729
2729
|
children: [
|
|
2730
2730
|
/* @__PURE__ */ e(Er, { className: "h-3.5 w-3.5" }),
|
|
2731
2731
|
"Reports & briefings",
|
|
2732
|
-
i ? /* @__PURE__ */ e("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children:
|
|
2732
|
+
i ? /* @__PURE__ */ e("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
|
|
2733
2733
|
]
|
|
2734
2734
|
}
|
|
2735
2735
|
);
|
|
2736
2736
|
}
|
|
2737
|
-
const un = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Ht = "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",
|
|
2737
|
+
const un = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Ht = "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", Oe = "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";
|
|
2738
2738
|
function hn(t) {
|
|
2739
2739
|
return t === "dashboard" ? "This dashboard" : "Project";
|
|
2740
2740
|
}
|
|
2741
2741
|
function mn(t) {
|
|
2742
2742
|
if (!t) return "Never";
|
|
2743
|
-
const
|
|
2744
|
-
if (Number.isNaN(
|
|
2745
|
-
const o = Date.now() -
|
|
2743
|
+
const a = new Date(t);
|
|
2744
|
+
if (Number.isNaN(a.getTime())) return "Unknown";
|
|
2745
|
+
const o = Date.now() - a.getTime(), s = Math.round(o / 6e4);
|
|
2746
2746
|
if (s < 1) return "now";
|
|
2747
2747
|
if (s < 60) return `${s}m ago`;
|
|
2748
2748
|
const i = Math.round(s / 60);
|
|
2749
2749
|
if (i < 24) return `${i}h ago`;
|
|
2750
|
-
const
|
|
2751
|
-
if (
|
|
2752
|
-
const c = Math.round(
|
|
2753
|
-
return c < 5 ? `${c}w ago` : `${Math.round(
|
|
2750
|
+
const n = Math.round(i / 24);
|
|
2751
|
+
if (n < 7) return `${n}d ago`;
|
|
2752
|
+
const c = Math.round(n / 7);
|
|
2753
|
+
return c < 5 ? `${c}w ago` : `${Math.round(n / 30)}mo ago`;
|
|
2754
2754
|
}
|
|
2755
2755
|
function pn(t) {
|
|
2756
2756
|
return t.scheduleExpr ? Cr(
|
|
@@ -2760,8 +2760,8 @@ function pn(t) {
|
|
|
2760
2760
|
}
|
|
2761
2761
|
function fn(t) {
|
|
2762
2762
|
if (t.lastRunStatus) {
|
|
2763
|
-
const
|
|
2764
|
-
return
|
|
2763
|
+
const a = t.lastRunStatus.toString().toUpperCase();
|
|
2764
|
+
return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${t.lastRunStatus.toString().toLowerCase()}`;
|
|
2765
2765
|
}
|
|
2766
2766
|
return null;
|
|
2767
2767
|
}
|
|
@@ -2773,7 +2773,7 @@ function gn(t) {
|
|
|
2773
2773
|
}
|
|
2774
2774
|
function bn({
|
|
2775
2775
|
activeView: t,
|
|
2776
|
-
onChange:
|
|
2776
|
+
onChange: a
|
|
2777
2777
|
}) {
|
|
2778
2778
|
return /* @__PURE__ */ e(
|
|
2779
2779
|
"div",
|
|
@@ -2789,7 +2789,7 @@ function bn({
|
|
|
2789
2789
|
type: "button",
|
|
2790
2790
|
role: "tab",
|
|
2791
2791
|
"aria-selected": s,
|
|
2792
|
-
onClick: () =>
|
|
2792
|
+
onClick: () => a(o),
|
|
2793
2793
|
className: J(
|
|
2794
2794
|
"h-6 rounded-[3px] px-2 text-[11px] transition-colors",
|
|
2795
2795
|
s ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
@@ -2804,11 +2804,11 @@ function bn({
|
|
|
2804
2804
|
}
|
|
2805
2805
|
function xn({
|
|
2806
2806
|
briefings: t,
|
|
2807
|
-
dashboardLabel:
|
|
2807
|
+
dashboardLabel: a,
|
|
2808
2808
|
sourceView: o,
|
|
2809
2809
|
error: s,
|
|
2810
2810
|
loading: i,
|
|
2811
|
-
onSourceViewChange:
|
|
2811
|
+
onSourceViewChange: n,
|
|
2812
2812
|
onClose: c,
|
|
2813
2813
|
onEdit: d,
|
|
2814
2814
|
onNew: l,
|
|
@@ -2824,15 +2824,15 @@ function xn({
|
|
|
2824
2824
|
contentKind: M,
|
|
2825
2825
|
hideHeader: U = !1
|
|
2826
2826
|
}) {
|
|
2827
|
-
const A = t.length, z = t.filter((S) => S.status === "ACTIVE").length,
|
|
2828
|
-
return /* @__PURE__ */
|
|
2827
|
+
const A = t.length, z = t.filter((S) => S.status === "ACTIVE").length, C = M === "reports" ? A === 1 ? "report" : "reports" : M === "briefings" ? A === 1 ? "briefing" : "briefings" : A === 1 ? "item" : "items", w = t.find((S) => S.hasActiveRun) ?? null, x = M ?? "reports & briefings", E = o === "dashboard" ? a : `Project ${x}`;
|
|
2828
|
+
return /* @__PURE__ */ r(
|
|
2829
2829
|
"section",
|
|
2830
2830
|
{
|
|
2831
2831
|
"aria-label": `Dashboard ${x.replace("&", "and")}`,
|
|
2832
2832
|
className: "flex h-full min-h-0 flex-col bg-background text-foreground",
|
|
2833
2833
|
children: [
|
|
2834
|
-
U ? null : /* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
2834
|
+
U ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
2835
|
+
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
2836
2836
|
/* @__PURE__ */ e("div", { className: un, children: x }),
|
|
2837
2837
|
/* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: E })
|
|
2838
2838
|
] }),
|
|
@@ -2847,37 +2847,37 @@ function xn({
|
|
|
2847
2847
|
}
|
|
2848
2848
|
)
|
|
2849
2849
|
] }),
|
|
2850
|
-
/* @__PURE__ */
|
|
2851
|
-
/* @__PURE__ */
|
|
2850
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 border-b border-border px-4 py-2", children: [
|
|
2851
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
2852
2852
|
/* @__PURE__ */ e(
|
|
2853
2853
|
bn,
|
|
2854
2854
|
{
|
|
2855
2855
|
activeView: o,
|
|
2856
|
-
onChange:
|
|
2856
|
+
onChange: n
|
|
2857
2857
|
}
|
|
2858
2858
|
),
|
|
2859
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && A === 0 ? /* @__PURE__ */
|
|
2859
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && A === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
2860
2860
|
"Loading ",
|
|
2861
2861
|
x,
|
|
2862
2862
|
"…"
|
|
2863
|
-
] }) : A === 0 ? /* @__PURE__ */
|
|
2863
|
+
] }) : A === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
2864
2864
|
"No ",
|
|
2865
2865
|
x,
|
|
2866
2866
|
" yet"
|
|
2867
|
-
] }) : /* @__PURE__ */
|
|
2868
|
-
/* @__PURE__ */
|
|
2867
|
+
] }) : /* @__PURE__ */ r(O, { children: [
|
|
2868
|
+
/* @__PURE__ */ r("span", { className: "font-medium text-foreground/80", children: [
|
|
2869
2869
|
A,
|
|
2870
2870
|
" ",
|
|
2871
|
-
|
|
2871
|
+
C
|
|
2872
2872
|
] }),
|
|
2873
2873
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2874
|
-
/* @__PURE__ */
|
|
2874
|
+
/* @__PURE__ */ r("span", { children: [
|
|
2875
2875
|
z,
|
|
2876
2876
|
" active"
|
|
2877
2877
|
] })
|
|
2878
2878
|
] }) })
|
|
2879
2879
|
] }),
|
|
2880
|
-
/* @__PURE__ */
|
|
2880
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
2881
2881
|
i ? (
|
|
2882
2882
|
// Auto-refresh on open; surface a quiet spinner near the count
|
|
2883
2883
|
// when a manual reload is in flight, but don't show a separate
|
|
@@ -2885,12 +2885,12 @@ function xn({
|
|
|
2885
2885
|
// case without crowding the toolbar.
|
|
2886
2886
|
/* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
|
|
2887
2887
|
) : null,
|
|
2888
|
-
A > 0 && u ? m && h ? /* @__PURE__ */
|
|
2889
|
-
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */
|
|
2888
|
+
A > 0 && u ? m && h ? /* @__PURE__ */ r(Le, { children: [
|
|
2889
|
+
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Oe, children: [
|
|
2890
2890
|
/* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
|
|
2891
2891
|
" New"
|
|
2892
2892
|
] }) }),
|
|
2893
|
-
/* @__PURE__ */
|
|
2893
|
+
/* @__PURE__ */ r(Te, { align: "end", children: [
|
|
2894
2894
|
/* @__PURE__ */ e(X, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
|
|
2895
2895
|
/* @__PURE__ */ e(
|
|
2896
2896
|
X,
|
|
@@ -2900,21 +2900,21 @@ function xn({
|
|
|
2900
2900
|
}
|
|
2901
2901
|
)
|
|
2902
2902
|
] })
|
|
2903
|
-
] }) : h ? /* @__PURE__ */
|
|
2903
|
+
] }) : h ? /* @__PURE__ */ r(
|
|
2904
2904
|
"button",
|
|
2905
2905
|
{
|
|
2906
2906
|
onClick: () => l("scheduled_report"),
|
|
2907
|
-
className:
|
|
2907
|
+
className: Oe,
|
|
2908
2908
|
children: [
|
|
2909
2909
|
/* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
|
|
2910
2910
|
" Schedule report"
|
|
2911
2911
|
]
|
|
2912
2912
|
}
|
|
2913
|
-
) : m ? /* @__PURE__ */
|
|
2913
|
+
) : m ? /* @__PURE__ */ r(
|
|
2914
2914
|
"button",
|
|
2915
2915
|
{
|
|
2916
2916
|
onClick: () => l("analytical_briefing"),
|
|
2917
|
-
className:
|
|
2917
|
+
className: Oe,
|
|
2918
2918
|
children: [
|
|
2919
2919
|
/* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
|
|
2920
2920
|
" New briefing"
|
|
@@ -2923,13 +2923,13 @@ function xn({
|
|
|
2923
2923
|
) : null : null
|
|
2924
2924
|
] })
|
|
2925
2925
|
] }),
|
|
2926
|
-
|
|
2926
|
+
w ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
|
|
2927
2927
|
/* @__PURE__ */ e(ne, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
|
|
2928
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children:
|
|
2928
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: w.name }),
|
|
2929
2929
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2930
|
-
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: Qt(
|
|
2930
|
+
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: Qt(w) })
|
|
2931
2931
|
] }) : null,
|
|
2932
|
-
/* @__PURE__ */
|
|
2932
|
+
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
|
|
2933
2933
|
s ? /* @__PURE__ */ e("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: s }) : null,
|
|
2934
2934
|
!i && t.length === 0 && !s ? /* @__PURE__ */ e(
|
|
2935
2935
|
vn,
|
|
@@ -2955,7 +2955,7 @@ function xn({
|
|
|
2955
2955
|
S.id
|
|
2956
2956
|
))
|
|
2957
2957
|
] }),
|
|
2958
|
-
V ? /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */
|
|
2958
|
+
V ? /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
|
|
2959
2959
|
"a",
|
|
2960
2960
|
{
|
|
2961
2961
|
href: V,
|
|
@@ -2972,28 +2972,28 @@ function xn({
|
|
|
2972
2972
|
}
|
|
2973
2973
|
function vn({
|
|
2974
2974
|
onNew: t,
|
|
2975
|
-
canCreate:
|
|
2975
|
+
canCreate: a,
|
|
2976
2976
|
canCreateScheduledReport: o,
|
|
2977
2977
|
analyticalBriefingsEnabled: s,
|
|
2978
2978
|
contentKind: i
|
|
2979
2979
|
}) {
|
|
2980
|
-
const
|
|
2980
|
+
const n = i === "reports" ? {
|
|
2981
2981
|
title: "No reports yet",
|
|
2982
2982
|
description: "Schedule an emailed dashboard or visual report to see it here."
|
|
2983
2983
|
} : i === "briefings" ? {
|
|
2984
2984
|
title: "No briefings yet",
|
|
2985
2985
|
description: "Create an analytical briefing to monitor this dashboard and brief your team."
|
|
2986
2986
|
} : null;
|
|
2987
|
-
return /* @__PURE__ */
|
|
2987
|
+
return /* @__PURE__ */ r("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
|
|
2988
2988
|
/* @__PURE__ */ e(yn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
|
|
2989
|
-
/* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: (
|
|
2990
|
-
/* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (
|
|
2991
|
-
|
|
2992
|
-
o ? /* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: (n == null ? void 0 : n.title) ?? "Have an analyst brief your team" }),
|
|
2990
|
+
/* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (n == null ? void 0 : n.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." }),
|
|
2991
|
+
a ? /* @__PURE__ */ r("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
|
|
2992
|
+
o ? /* @__PURE__ */ r(
|
|
2993
2993
|
"button",
|
|
2994
2994
|
{
|
|
2995
2995
|
onClick: () => t("scheduled_report"),
|
|
2996
|
-
className:
|
|
2996
|
+
className: Oe,
|
|
2997
2997
|
children: [
|
|
2998
2998
|
/* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
|
|
2999
2999
|
" Schedule a report"
|
|
@@ -3012,7 +3012,7 @@ function vn({
|
|
|
3012
3012
|
] });
|
|
3013
3013
|
}
|
|
3014
3014
|
function yn({ className: t }) {
|
|
3015
|
-
return /* @__PURE__ */
|
|
3015
|
+
return /* @__PURE__ */ r(
|
|
3016
3016
|
"svg",
|
|
3017
3017
|
{
|
|
3018
3018
|
viewBox: "0 0 112 88",
|
|
@@ -3190,15 +3190,15 @@ function yn({ className: t }) {
|
|
|
3190
3190
|
}
|
|
3191
3191
|
function Cn({
|
|
3192
3192
|
briefing: t,
|
|
3193
|
-
isOpening:
|
|
3193
|
+
isOpening: a,
|
|
3194
3194
|
isBusy: o,
|
|
3195
3195
|
onOpen: s,
|
|
3196
3196
|
onRunNow: i,
|
|
3197
|
-
onTogglePause:
|
|
3197
|
+
onTogglePause: n,
|
|
3198
3198
|
onDelete: c
|
|
3199
3199
|
}) {
|
|
3200
3200
|
const d = t.status === "PAUSED", l = t.hasActiveRun, u = fn(t), h = mn(t.lastRunAt), m = t.lastRunStatus, p = le(t), g = m === "SUCCESS" ? Re.success.dot : m === "FAILED" ? Re.danger.dot : m ? Re.warning.dot : Re.neutral.dot;
|
|
3201
|
-
return /* @__PURE__ */
|
|
3201
|
+
return /* @__PURE__ */ r(
|
|
3202
3202
|
"div",
|
|
3203
3203
|
{
|
|
3204
3204
|
className: J(
|
|
@@ -3206,7 +3206,7 @@ function Cn({
|
|
|
3206
3206
|
d && "opacity-70"
|
|
3207
3207
|
),
|
|
3208
3208
|
children: [
|
|
3209
|
-
/* @__PURE__ */
|
|
3209
|
+
/* @__PURE__ */ r(
|
|
3210
3210
|
"div",
|
|
3211
3211
|
{
|
|
3212
3212
|
role: "button",
|
|
@@ -3217,26 +3217,26 @@ function Cn({
|
|
|
3217
3217
|
},
|
|
3218
3218
|
className: "cursor-pointer pr-8",
|
|
3219
3219
|
children: [
|
|
3220
|
-
/* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
3221
3221
|
/* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
|
|
3222
3222
|
d ? /* @__PURE__ */ e("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
|
|
3223
3223
|
] }),
|
|
3224
|
-
/* @__PURE__ */
|
|
3224
|
+
/* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
|
|
3225
3225
|
/* @__PURE__ */ e("span", { children: p.typeLabel }),
|
|
3226
3226
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
3227
3227
|
/* @__PURE__ */ e("span", { children: gn(t) }),
|
|
3228
3228
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
3229
3229
|
/* @__PURE__ */ e(Ma, { className: "h-3 w-3" }),
|
|
3230
3230
|
/* @__PURE__ */ e("span", { className: "truncate", children: pn(t) }),
|
|
3231
|
-
t.lastRunAt ? /* @__PURE__ */
|
|
3231
|
+
t.lastRunAt ? /* @__PURE__ */ r(O, { children: [
|
|
3232
3232
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
3233
|
-
/* @__PURE__ */
|
|
3233
|
+
/* @__PURE__ */ r("span", { children: [
|
|
3234
3234
|
"Last run ",
|
|
3235
3235
|
h
|
|
3236
3236
|
] })
|
|
3237
3237
|
] }) : null
|
|
3238
3238
|
] }),
|
|
3239
|
-
u || l ? /* @__PURE__ */
|
|
3239
|
+
u || l ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
|
|
3240
3240
|
l ? /* @__PURE__ */ e(ne, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ e(
|
|
3241
3241
|
"span",
|
|
3242
3242
|
{
|
|
@@ -3251,7 +3251,7 @@ function Cn({
|
|
|
3251
3251
|
]
|
|
3252
3252
|
}
|
|
3253
3253
|
),
|
|
3254
|
-
/* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) :
|
|
3254
|
+
/* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r(Le, { children: [
|
|
3255
3255
|
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
|
|
3256
3256
|
"button",
|
|
3257
3257
|
{
|
|
@@ -3262,13 +3262,13 @@ function Cn({
|
|
|
3262
3262
|
children: /* @__PURE__ */ e(Tt, { className: "h-3.5 w-3.5" })
|
|
3263
3263
|
}
|
|
3264
3264
|
) }),
|
|
3265
|
-
/* @__PURE__ */
|
|
3266
|
-
/* @__PURE__ */
|
|
3265
|
+
/* @__PURE__ */ r(Te, { align: "end", className: "w-44", children: [
|
|
3266
|
+
/* @__PURE__ */ r(X, { onClick: s, children: [
|
|
3267
3267
|
/* @__PURE__ */ e(Ut, { className: "h-3.5 w-3.5" }),
|
|
3268
3268
|
"Edit ",
|
|
3269
3269
|
p.noun
|
|
3270
3270
|
] }),
|
|
3271
|
-
/* @__PURE__ */
|
|
3271
|
+
/* @__PURE__ */ r(
|
|
3272
3272
|
X,
|
|
3273
3273
|
{
|
|
3274
3274
|
onClick: (f) => {
|
|
@@ -3284,19 +3284,19 @@ function Cn({
|
|
|
3284
3284
|
X,
|
|
3285
3285
|
{
|
|
3286
3286
|
onClick: (f) => {
|
|
3287
|
-
f.preventDefault(),
|
|
3287
|
+
f.preventDefault(), n();
|
|
3288
3288
|
},
|
|
3289
|
-
children: d ? /* @__PURE__ */
|
|
3289
|
+
children: d ? /* @__PURE__ */ r(O, { children: [
|
|
3290
3290
|
/* @__PURE__ */ e(Ra, { className: "h-3.5 w-3.5" }),
|
|
3291
3291
|
"Resume"
|
|
3292
|
-
] }) : /* @__PURE__ */
|
|
3292
|
+
] }) : /* @__PURE__ */ r(O, { children: [
|
|
3293
3293
|
/* @__PURE__ */ e(za, { className: "h-3.5 w-3.5" }),
|
|
3294
3294
|
"Pause"
|
|
3295
3295
|
] })
|
|
3296
3296
|
}
|
|
3297
3297
|
) : null,
|
|
3298
3298
|
/* @__PURE__ */ e(je, {}),
|
|
3299
|
-
/* @__PURE__ */
|
|
3299
|
+
/* @__PURE__ */ r(
|
|
3300
3300
|
X,
|
|
3301
3301
|
{
|
|
3302
3302
|
onClick: (f) => {
|
|
@@ -3304,7 +3304,7 @@ function Cn({
|
|
|
3304
3304
|
},
|
|
3305
3305
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
3306
3306
|
children: [
|
|
3307
|
-
/* @__PURE__ */ e(
|
|
3307
|
+
/* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" }),
|
|
3308
3308
|
"Delete ",
|
|
3309
3309
|
p.noun
|
|
3310
3310
|
]
|
|
@@ -3322,21 +3322,21 @@ function wn(t) {
|
|
|
3322
3322
|
function Nn(t) {
|
|
3323
3323
|
return t === "This dashboard" ? "Watch this dashboard" : `Watch ${t}`;
|
|
3324
3324
|
}
|
|
3325
|
-
function Sn(t,
|
|
3326
|
-
return
|
|
3325
|
+
function Sn(t, a, o) {
|
|
3326
|
+
return a !== "dashboard" ? t : t.filter(
|
|
3327
3327
|
(s) => s.source.type === "dashboard" && s.source.dashboardId === o
|
|
3328
3328
|
);
|
|
3329
3329
|
}
|
|
3330
3330
|
async function kn(t) {
|
|
3331
3331
|
const o = [];
|
|
3332
|
-
let s = 1, i = 0,
|
|
3333
|
-
for (; i <
|
|
3332
|
+
let s = 1, i = 0, n = Number.POSITIVE_INFINITY;
|
|
3333
|
+
for (; i < n; ) {
|
|
3334
3334
|
const c = await t.apiClient.listBriefings(
|
|
3335
3335
|
t.apiServiceUrl,
|
|
3336
3336
|
t.token,
|
|
3337
3337
|
{ scope: "organization", page: s, pageSize: 100 }
|
|
3338
3338
|
);
|
|
3339
|
-
if (o.push(...c.briefings), i += c.briefings.length,
|
|
3339
|
+
if (o.push(...c.briefings), i += c.briefings.length, n = c.total, c.briefings.length === 0 || i >= n) break;
|
|
3340
3340
|
s += 1;
|
|
3341
3341
|
}
|
|
3342
3342
|
return o;
|
|
@@ -3350,15 +3350,15 @@ const Dn = {
|
|
|
3350
3350
|
runBriefingNow: $a
|
|
3351
3351
|
};
|
|
3352
3352
|
function us(t) {
|
|
3353
|
-
return /* @__PURE__ */ e(
|
|
3353
|
+
return /* @__PURE__ */ e(Oa, { authToken: t.token ? { accessToken: t.token } : void 0, children: /* @__PURE__ */ e(_a, { children: /* @__PURE__ */ e(An, { ...t }) }) });
|
|
3354
3354
|
}
|
|
3355
3355
|
function An({
|
|
3356
3356
|
dashboardId: t,
|
|
3357
|
-
dashboardTitle:
|
|
3357
|
+
dashboardTitle: a,
|
|
3358
3358
|
apiServiceUrl: o,
|
|
3359
3359
|
token: s,
|
|
3360
3360
|
disabled: i,
|
|
3361
|
-
className:
|
|
3361
|
+
className: n,
|
|
3362
3362
|
manageBriefingsHref: c,
|
|
3363
3363
|
open: d,
|
|
3364
3364
|
onOpenChange: l,
|
|
@@ -3369,32 +3369,32 @@ function An({
|
|
|
3369
3369
|
}) {
|
|
3370
3370
|
const { authToken: g, tokenProps: f } = It(), v = ja(), k = !h || v.canCreate && (h === "scheduled_report" || v.analyticalBriefingsEnabled), [V, M] = D(!1), U = d ?? V, A = (y) => {
|
|
3371
3371
|
d === void 0 && M(y), l == null || l(y);
|
|
3372
|
-
}, [z,
|
|
3372
|
+
}, [z, C] = D(
|
|
3373
3373
|
h ? "author" : "list"
|
|
3374
|
-
), [
|
|
3374
|
+
), [w, x] = D(
|
|
3375
3375
|
h ?? "analytical_briefing"
|
|
3376
3376
|
), [E, S] = D("dashboard"), [j, I] = D(
|
|
3377
3377
|
[]
|
|
3378
|
-
), [T, Z] = D(null), G = h && !k && !T ? "list" : z, [H, Q] = D(!1), [ce,
|
|
3378
|
+
), [T, Z] = D(null), G = h && !k && !T ? "list" : z, [H, Q] = D(!1), [ce, _] = D(null), [ye, Y] = D(null), [R, te] = D(
|
|
3379
3379
|
null
|
|
3380
3380
|
), [me, pe] = D(null), Ce = nt(null), Be = nt(U);
|
|
3381
3381
|
be(() => {
|
|
3382
3382
|
const y = U && !Be.current;
|
|
3383
|
-
Be.current = U, !(!y || !h) && (Z(null), S("dashboard"), x(h),
|
|
3383
|
+
Be.current = U, !(!y || !h) && (Z(null), S("dashboard"), x(h), C("author"), pe(null));
|
|
3384
3384
|
}, [U, h]);
|
|
3385
3385
|
const Ye = vt(), $ = o ?? (f == null ? void 0 : f.apiServiceUrl), W = s ?? (g == null ? void 0 : g.accessToken), se = re(() => ({ ...Dn, ...p }), [p]), [we, Ze] = D(null);
|
|
3386
3386
|
be(() => {
|
|
3387
3387
|
if (!m || !$ || !W) return;
|
|
3388
3388
|
let y = !0;
|
|
3389
3389
|
return se.getBriefing($, W, m.briefingId).then(({ briefing: P }) => {
|
|
3390
|
-
y && (Z(P), Ze(m),
|
|
3390
|
+
y && (Z(P), Ze(m), C("author"));
|
|
3391
3391
|
}, (P) => {
|
|
3392
3392
|
y && F.error(P instanceof Error ? P.message : "Could not open the run.");
|
|
3393
3393
|
}), () => {
|
|
3394
3394
|
y = !1;
|
|
3395
3395
|
};
|
|
3396
3396
|
}, [m, $, W, se]);
|
|
3397
|
-
const ge = wn(
|
|
3397
|
+
const ge = wn(a), Pe = re(() => {
|
|
3398
3398
|
const y = Sn(
|
|
3399
3399
|
j,
|
|
3400
3400
|
E,
|
|
@@ -3442,25 +3442,25 @@ function An({
|
|
|
3442
3442
|
!U || G !== "list" || !Ne || oe();
|
|
3443
3443
|
}, [Ne, G, oe, U]);
|
|
3444
3444
|
const ke = () => {
|
|
3445
|
-
Z(null), S("dashboard"),
|
|
3445
|
+
Z(null), S("dashboard"), C("list"), A(!0);
|
|
3446
3446
|
}, b = (y) => {
|
|
3447
|
-
Z(null), x(y),
|
|
3447
|
+
Z(null), x(y), C("author");
|
|
3448
3448
|
}, B = async (y) => {
|
|
3449
3449
|
if (!(!$ || !W)) {
|
|
3450
|
-
|
|
3450
|
+
_(y), pe(null);
|
|
3451
3451
|
try {
|
|
3452
3452
|
const P = await se.getBriefing(
|
|
3453
3453
|
$,
|
|
3454
3454
|
W,
|
|
3455
3455
|
y
|
|
3456
3456
|
);
|
|
3457
|
-
Z(P.briefing),
|
|
3457
|
+
Z(P.briefing), C("author");
|
|
3458
3458
|
} catch (P) {
|
|
3459
3459
|
pe(
|
|
3460
3460
|
P instanceof Error ? P.message : "Could not open briefing."
|
|
3461
3461
|
);
|
|
3462
3462
|
} finally {
|
|
3463
|
-
|
|
3463
|
+
_(null);
|
|
3464
3464
|
}
|
|
3465
3465
|
}
|
|
3466
3466
|
}, q = async (y) => {
|
|
@@ -3526,17 +3526,17 @@ function An({
|
|
|
3526
3526
|
Y(null);
|
|
3527
3527
|
}
|
|
3528
3528
|
}, Gt = Pe.length;
|
|
3529
|
-
return v.surfaceVisible ? /* @__PURE__ */
|
|
3529
|
+
return v.surfaceVisible ? /* @__PURE__ */ r(Ka, { open: U, onOpenChange: A, children: [
|
|
3530
3530
|
u ? null : /* @__PURE__ */ e(
|
|
3531
3531
|
cn,
|
|
3532
3532
|
{
|
|
3533
3533
|
disabled: i || !Ne,
|
|
3534
3534
|
briefingCount: Gt,
|
|
3535
|
-
className:
|
|
3535
|
+
className: n,
|
|
3536
3536
|
onClick: ke
|
|
3537
3537
|
}
|
|
3538
3538
|
),
|
|
3539
|
-
/* @__PURE__ */
|
|
3539
|
+
/* @__PURE__ */ r(
|
|
3540
3540
|
Xa,
|
|
3541
3541
|
{
|
|
3542
3542
|
ref: Ce,
|
|
@@ -3548,12 +3548,12 @@ function An({
|
|
|
3548
3548
|
y.preventDefault(), (P = Ce.current) == null || P.focus({ preventScroll: !0 });
|
|
3549
3549
|
},
|
|
3550
3550
|
children: [
|
|
3551
|
-
/* @__PURE__ */
|
|
3551
|
+
/* @__PURE__ */ r(Ya, { className: "sr-only", children: [
|
|
3552
3552
|
/* @__PURE__ */ e(Za, { children: "Reports & briefings" }),
|
|
3553
3553
|
/* @__PURE__ */ e(Ja, { children: "Manage reports and briefings for this dashboard." })
|
|
3554
3554
|
] }),
|
|
3555
|
-
h ? /* @__PURE__ */
|
|
3556
|
-
/* @__PURE__ */
|
|
3555
|
+
h ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
|
|
3556
|
+
/* @__PURE__ */ r(
|
|
3557
3557
|
"div",
|
|
3558
3558
|
{
|
|
3559
3559
|
className: "flex items-center gap-5",
|
|
@@ -3573,7 +3573,7 @@ function An({
|
|
|
3573
3573
|
!k && "cursor-not-allowed opacity-50"
|
|
3574
3574
|
),
|
|
3575
3575
|
onClick: () => {
|
|
3576
|
-
k && (Z(null), x(h), S("dashboard"),
|
|
3576
|
+
k && (Z(null), x(h), S("dashboard"), C("author"));
|
|
3577
3577
|
},
|
|
3578
3578
|
children: T ? `Edit ${le(T).noun}` : h === "scheduled_report" ? "Schedule report" : "Create briefing"
|
|
3579
3579
|
}
|
|
@@ -3588,7 +3588,7 @@ function An({
|
|
|
3588
3588
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3589
3589
|
G === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3590
3590
|
),
|
|
3591
|
-
onClick: () =>
|
|
3591
|
+
onClick: () => C("list"),
|
|
3592
3592
|
children: h === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
3593
3593
|
}
|
|
3594
3594
|
)
|
|
@@ -3647,16 +3647,16 @@ function An({
|
|
|
3647
3647
|
token: W,
|
|
3648
3648
|
briefing: T,
|
|
3649
3649
|
initialRunId: we && (T == null ? void 0 : T.id) === we.briefingId ? we.runId : void 0,
|
|
3650
|
-
intent:
|
|
3650
|
+
intent: w,
|
|
3651
3651
|
sourceContext: T ? void 0 : Je,
|
|
3652
|
-
title: T ? `Edit ${le(T).noun}` :
|
|
3652
|
+
title: T ? `Edit ${le(T).noun}` : w === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
|
|
3653
3653
|
hideHeader: !!h,
|
|
3654
3654
|
className: "h-full min-h-0 max-w-none border-0 shadow-none",
|
|
3655
|
-
onBack: h ? void 0 : () =>
|
|
3655
|
+
onBack: h ? void 0 : () => C("list"),
|
|
3656
3656
|
onCancel: () => A(!1),
|
|
3657
3657
|
onDeleted: () => {
|
|
3658
3658
|
const y = T ? le(T).noun : "briefing";
|
|
3659
|
-
F.success(`${y === "report" ? "Report" : "Briefing"} deleted`), Z(null),
|
|
3659
|
+
F.success(`${y === "report" ? "Report" : "Briefing"} deleted`), Z(null), C("list"), oe();
|
|
3660
3660
|
},
|
|
3661
3661
|
onRunStarted: () => {
|
|
3662
3662
|
},
|
|
@@ -3678,23 +3678,23 @@ function An({
|
|
|
3678
3678
|
onOpenChange: (y) => {
|
|
3679
3679
|
y || te(null);
|
|
3680
3680
|
},
|
|
3681
|
-
children: /* @__PURE__ */
|
|
3682
|
-
/* @__PURE__ */
|
|
3683
|
-
/* @__PURE__ */
|
|
3681
|
+
children: /* @__PURE__ */ r(dt, { children: [
|
|
3682
|
+
/* @__PURE__ */ r(ct, { children: [
|
|
3683
|
+
/* @__PURE__ */ r(ut, { children: [
|
|
3684
3684
|
"Delete",
|
|
3685
3685
|
" ",
|
|
3686
3686
|
R ? le(R).noun : "briefing",
|
|
3687
3687
|
"?"
|
|
3688
3688
|
] }),
|
|
3689
|
-
/* @__PURE__ */
|
|
3689
|
+
/* @__PURE__ */ r(ht, { children: [
|
|
3690
3690
|
"This permanently deletes ",
|
|
3691
3691
|
/* @__PURE__ */ e("strong", { children: R == null ? void 0 : R.name }),
|
|
3692
3692
|
". Recipients will stop receiving it."
|
|
3693
3693
|
] })
|
|
3694
3694
|
] }),
|
|
3695
|
-
/* @__PURE__ */
|
|
3695
|
+
/* @__PURE__ */ r(mt, { children: [
|
|
3696
3696
|
/* @__PURE__ */ e(pt, { children: "Cancel" }),
|
|
3697
|
-
/* @__PURE__ */
|
|
3697
|
+
/* @__PURE__ */ r(
|
|
3698
3698
|
Vt,
|
|
3699
3699
|
{
|
|
3700
3700
|
className: "bg-destructive/90 hover:bg-destructive",
|