semaphor 0.0.83 → 0.0.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{index-Ua4j6zM4.js → index-BnsJsevV.js} +11564 -11386
- package/dist/chunks/{index-CqZqAVTy.js → index-CILbzMWs.js} +105 -85
- package/dist/chunks/{index-CXcv9meF.js → index-DhjurnP9.js} +952 -909
- package/dist/chunks/index-VOC0bH2u.js +245 -0
- package/dist/chunks/{lucide-react-BsoLm7gj.js → lucide-react-BOL6diSu.js} +7585 -7648
- package/dist/chunks/{lucide-react-BGARrakO.js → lucide-react-D2-G_iA5.js} +1299 -1319
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +16 -16
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/dashboard.d.ts +21 -0
- package/dist/types/main.d.ts +21 -0
- package/dist/types/surfboard.d.ts +21 -0
- package/dist/types/types.d.ts +21 -0
- package/package.json +1 -1
- package/dist/chunks/index-BVCB1Ukm.js +0 -245
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as V,
|
|
1
|
+
import { c as V, q as Os, u as z, r as Fs, s as ze, t as e, v as Is, w as Ds, x as O, k as Ts, y as Ls, z as Ms, A as Es, E as As, H as R, J as le, K as la, M as ra, N as ia, O as oa, Q as st, R as at, V as tt, W as Ks, Y as Q, Z as Je, h as nt, _ as m, $ as lt, F as ca, a0 as Ke, a1 as We, a2 as da, a3 as rt, a4 as ua, a5 as me, a6 as he, a7 as xe, a8 as pe, a9 as Se, aa as fe, ab as K, T as Vs, ac as qs, ad as Rs, ae as _s, af as ma, ag as ha, ah as de, ai as it, aj as ot, ak as xa, al as ct, C as dt, am as ut, an as pa, B as mt, ao as De, ap as ht, aq as os, ar as fa, as as Ns, at as Ce, au as Ie, av as we, aw as ga, ax as xt, ay as pt, az as ft, aA as gt, I as jt, aB as bt, aC as yt, aD as vt, aE as Re, aF as Ss, aG as Ct, a as Nt, aH as Ge, aI as cs, aJ as Ne, aK as ds, aL as St, aM as wt, aN as kt, aO as zt, aP as Ot, aQ as Cs, aR as Ft, aS as Ws, aT as It, aU as Ys, aV as Dt, aW as Tt, aX as Lt, aY as Mt, aZ as ja, a_ as re, a$ as Hs, b0 as ba, b1 as Et, b2 as At, b3 as ls, b4 as Vt, b5 as qt, b6 as Rt, b7 as _t, o as Ht, b8 as $t, b9 as Pt, ba as Bt, n as Ut, bb as xs, bc as ya, bd as va, be as Ca, bf as rs, bg as Na, bh as is, bi as Xs, bj as Gt, bk as Qt, bl as ps, bm as fs, bn as gs, bo as Jt, X as Sa, bp as Kt, bq as Wt, br as Yt, bs as js, bt as Te, f as Xt, bu as Ue, bv as $s, bw as wa, bx as Zt, by as en, bz as us, bA as sn, bB as an, bC as tn, bD as Zs, bE as nn, bF as ln, bG as rn, bH as on, bI as cn, bJ as dn, bK as un, bL as mn, bM as Le, bN as B, bO as U, bP as Ps, bQ as G, bR as hn, bS as ka, bT as xn, bU as pn, bV as fn, bW as gn, bX as jn, bY as bn, bZ as yn, b_ as vn, b$ as Cn } from "./index-BnsJsevV.js";
|
|
2
2
|
import * as ea from "react";
|
|
3
|
-
import
|
|
3
|
+
import ke, { useState as q, useMemo as ws, useEffect as Z, useRef as ks, Suspense as Nn } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -41,7 +41,7 @@ const wn = V("ChartArea", [
|
|
|
41
41
|
* This source code is licensed under the ISC license.
|
|
42
42
|
* See the LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
const
|
|
44
|
+
const Bs = V("ChartColumnIncreasing", [
|
|
45
45
|
["path", { d: "M13 17V9", key: "1fwyjl" }],
|
|
46
46
|
["path", { d: "M18 17V5", key: "sfb6ij" }],
|
|
47
47
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
@@ -53,7 +53,7 @@ const Ps = V("ChartColumnIncreasing", [
|
|
|
53
53
|
* This source code is licensed under the ISC license.
|
|
54
54
|
* See the LICENSE file in the root directory of this source tree.
|
|
55
55
|
*/
|
|
56
|
-
const
|
|
56
|
+
const Us = V("ChartLine", [
|
|
57
57
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
58
58
|
["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
|
|
59
59
|
]);
|
|
@@ -305,7 +305,7 @@ const Rn = V("ListX", [
|
|
|
305
305
|
* This source code is licensed under the ISC license.
|
|
306
306
|
* See the LICENSE file in the root directory of this source tree.
|
|
307
307
|
*/
|
|
308
|
-
const
|
|
308
|
+
const qe = V("LoaderCircle", [
|
|
309
309
|
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
310
310
|
]);
|
|
311
311
|
/**
|
|
@@ -504,7 +504,7 @@ const Kn = V("ToggleLeft", [
|
|
|
504
504
|
* This source code is licensed under the ISC license.
|
|
505
505
|
* See the LICENSE file in the root directory of this source tree.
|
|
506
506
|
*/
|
|
507
|
-
const
|
|
507
|
+
const Gs = V("Type", [
|
|
508
508
|
["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
|
|
509
509
|
["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
|
|
510
510
|
["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
|
|
@@ -528,10 +528,10 @@ function Ma(s) {
|
|
|
528
528
|
return {
|
|
529
529
|
...a,
|
|
530
530
|
frames: (n = a.frames) == null ? void 0 : n.map((l) => {
|
|
531
|
-
var
|
|
531
|
+
var d;
|
|
532
532
|
return {
|
|
533
533
|
...l,
|
|
534
|
-
cards: (
|
|
534
|
+
cards: (d = l.cards) == null ? void 0 : d.map((r) => Yn(r))
|
|
535
535
|
};
|
|
536
536
|
})
|
|
537
537
|
};
|
|
@@ -547,8 +547,8 @@ function Yn(s) {
|
|
|
547
547
|
data: {
|
|
548
548
|
...(t = s.cfg) == null ? void 0 : t.data,
|
|
549
549
|
labels: [],
|
|
550
|
-
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((
|
|
551
|
-
...
|
|
550
|
+
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((d) => ({
|
|
551
|
+
...d,
|
|
552
552
|
data: []
|
|
553
553
|
}))
|
|
554
554
|
}
|
|
@@ -576,63 +576,63 @@ async function Zn(s, t, a, n) {
|
|
|
576
576
|
if (!n)
|
|
577
577
|
return null;
|
|
578
578
|
const l = JSON.stringify(t);
|
|
579
|
-
return await
|
|
579
|
+
return await Os("https://semaphor.cloud/api/v1/lens", n, {
|
|
580
580
|
name: s,
|
|
581
581
|
template: l,
|
|
582
582
|
filterValues: a,
|
|
583
583
|
operation: "create"
|
|
584
584
|
});
|
|
585
585
|
}
|
|
586
|
-
async function
|
|
586
|
+
async function zs(s, t) {
|
|
587
587
|
if (!t)
|
|
588
588
|
return null;
|
|
589
|
-
const { id: a, template: n, filterValues: l, isDefault:
|
|
590
|
-
return await
|
|
589
|
+
const { id: a, template: n, filterValues: l, isDefault: d, shared: r } = s;
|
|
590
|
+
return await Os("https://semaphor.cloud/api/v1/lens", t, {
|
|
591
591
|
lensId: a,
|
|
592
592
|
template: n,
|
|
593
593
|
filterValues: l,
|
|
594
|
-
isDefault:
|
|
594
|
+
isDefault: d,
|
|
595
595
|
shared: r,
|
|
596
596
|
operation: "update"
|
|
597
597
|
});
|
|
598
598
|
}
|
|
599
599
|
async function el(s, t) {
|
|
600
|
-
return t ? await
|
|
600
|
+
return t ? await Os("https://semaphor.cloud/api/v1/lens", t, {
|
|
601
601
|
operation: "delete",
|
|
602
602
|
lensId: s
|
|
603
603
|
}) : null;
|
|
604
604
|
}
|
|
605
605
|
function sl() {
|
|
606
|
-
const [s, t] = q(""), [a, n] = q(!1), l = z((
|
|
606
|
+
const [s, t] = q(""), [a, n] = q(!1), l = z((C) => C.lenses), { setLenses: d, setSelectedLensId: r } = Fs(), [o, c] = q(!1), [p, u] = q(!1), b = z((C) => C.dashboard), g = z((C) => C.filterValues), { authToken: h } = ze();
|
|
607
607
|
async function j() {
|
|
608
|
-
|
|
609
|
-
const
|
|
610
|
-
|
|
611
|
-
),
|
|
608
|
+
c(!0);
|
|
609
|
+
const C = Ma(
|
|
610
|
+
b
|
|
611
|
+
), F = await Zn(
|
|
612
612
|
s,
|
|
613
|
-
|
|
613
|
+
C,
|
|
614
614
|
g,
|
|
615
|
-
|
|
615
|
+
h == null ? void 0 : h.accessToken
|
|
616
616
|
);
|
|
617
|
-
|
|
617
|
+
F && (d([...l || [], F]), r(F.id), u(!1)), c(!1);
|
|
618
618
|
}
|
|
619
|
-
return /* @__PURE__ */ e.jsxs(
|
|
620
|
-
/* @__PURE__ */ e.jsx(
|
|
619
|
+
return /* @__PURE__ */ e.jsxs(Is, { open: p, onOpenChange: u, children: [
|
|
620
|
+
/* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
621
621
|
O,
|
|
622
622
|
{
|
|
623
623
|
variant: "secondary",
|
|
624
624
|
className: "h-7 p-2",
|
|
625
625
|
size: "sm",
|
|
626
626
|
children: [
|
|
627
|
-
/* @__PURE__ */ e.jsx(
|
|
627
|
+
/* @__PURE__ */ e.jsx(Ts, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
628
628
|
"Lens"
|
|
629
629
|
]
|
|
630
630
|
}
|
|
631
631
|
) }),
|
|
632
|
-
/* @__PURE__ */ e.jsxs(
|
|
633
|
-
/* @__PURE__ */ e.jsxs(
|
|
634
|
-
/* @__PURE__ */ e.jsx(
|
|
635
|
-
/* @__PURE__ */ e.jsx(
|
|
632
|
+
/* @__PURE__ */ e.jsxs(Ls, { className: "sm:max-w-[425px]", children: [
|
|
633
|
+
/* @__PURE__ */ e.jsxs(Ms, { children: [
|
|
634
|
+
/* @__PURE__ */ e.jsx(Es, { children: "Create Lens" }),
|
|
635
|
+
/* @__PURE__ */ e.jsx(As, { children: "Lenses are private by default and are only visible to you." })
|
|
636
636
|
] }),
|
|
637
637
|
/* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
638
638
|
/* @__PURE__ */ e.jsx(R, { className: "text-right", children: "Name" }),
|
|
@@ -640,8 +640,8 @@ function sl() {
|
|
|
640
640
|
le,
|
|
641
641
|
{
|
|
642
642
|
value: s,
|
|
643
|
-
onChange: (
|
|
644
|
-
t(
|
|
643
|
+
onChange: (C) => {
|
|
644
|
+
t(C.target.value);
|
|
645
645
|
},
|
|
646
646
|
id: "name",
|
|
647
647
|
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
@@ -664,37 +664,37 @@ function sl() {
|
|
|
664
664
|
] });
|
|
665
665
|
}
|
|
666
666
|
function al() {
|
|
667
|
-
const [s, t] = q(!1), a = z((u) => u.lenses), n = z((u) => u.selectedLensId), { setLenses: l, setSelectedLensId:
|
|
667
|
+
const [s, t] = q(!1), a = z((u) => u.lenses), n = z((u) => u.selectedLensId), { setLenses: l, setSelectedLensId: d } = Fs(), { authToken: r } = ze();
|
|
668
668
|
async function o(u) {
|
|
669
|
-
|
|
669
|
+
d(u);
|
|
670
670
|
}
|
|
671
|
-
async function
|
|
671
|
+
async function c(u) {
|
|
672
672
|
if (await el(u, r == null ? void 0 : r.accessToken)) {
|
|
673
|
-
const g = a == null ? void 0 : a.filter((
|
|
674
|
-
l(g || []),
|
|
673
|
+
const g = a == null ? void 0 : a.filter((h) => h.id !== u);
|
|
674
|
+
l(g || []), d("original");
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
677
|
async function p(u) {
|
|
678
|
-
const
|
|
678
|
+
const b = a == null ? void 0 : a.map((j) => j.id === u.id ? {
|
|
679
679
|
...j,
|
|
680
680
|
isDefault: !u.isDefault
|
|
681
681
|
} : {
|
|
682
682
|
...j,
|
|
683
683
|
isDefault: !1
|
|
684
684
|
});
|
|
685
|
-
l(
|
|
685
|
+
l(b || []);
|
|
686
686
|
const g = {
|
|
687
687
|
...u,
|
|
688
688
|
isDefault: !u.isDefault
|
|
689
689
|
};
|
|
690
|
-
await
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
690
|
+
await zs(g, r == null ? void 0 : r.accessToken);
|
|
691
|
+
const h = a == null ? void 0 : a.find((j) => j.isDefault);
|
|
692
|
+
if (h && h.id !== u.id) {
|
|
693
693
|
const j = {
|
|
694
|
-
...
|
|
694
|
+
...h,
|
|
695
695
|
isDefault: !1
|
|
696
696
|
};
|
|
697
|
-
await
|
|
697
|
+
await zs(j, r == null ? void 0 : r.accessToken);
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
700
|
return /* @__PURE__ */ e.jsxs(ra, { open: s, onOpenChange: t, children: [
|
|
@@ -708,9 +708,9 @@ function al() {
|
|
|
708
708
|
value: n,
|
|
709
709
|
onValueChange: o,
|
|
710
710
|
children: [
|
|
711
|
-
/* @__PURE__ */ e.jsx(
|
|
711
|
+
/* @__PURE__ */ e.jsx(Ks, { value: "original", children: "Original" }),
|
|
712
712
|
a == null ? void 0 : a.map((u) => /* @__PURE__ */ e.jsxs(
|
|
713
|
-
|
|
713
|
+
Ks,
|
|
714
714
|
{
|
|
715
715
|
className: "group flex justify-between gap-2",
|
|
716
716
|
value: u.id,
|
|
@@ -720,8 +720,8 @@ function al() {
|
|
|
720
720
|
/* @__PURE__ */ e.jsx(
|
|
721
721
|
En,
|
|
722
722
|
{
|
|
723
|
-
onClick: (
|
|
724
|
-
|
|
723
|
+
onClick: (b) => {
|
|
724
|
+
b.preventDefault(), p(u);
|
|
725
725
|
},
|
|
726
726
|
className: Q(
|
|
727
727
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
@@ -734,10 +734,10 @@ function al() {
|
|
|
734
734
|
}
|
|
735
735
|
),
|
|
736
736
|
/* @__PURE__ */ e.jsx(
|
|
737
|
-
|
|
737
|
+
Je,
|
|
738
738
|
{
|
|
739
|
-
onClick: (
|
|
740
|
-
|
|
739
|
+
onClick: (b) => {
|
|
740
|
+
b.preventDefault(), c(u.id);
|
|
741
741
|
},
|
|
742
742
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
743
743
|
strokeWidth: 1.5
|
|
@@ -757,19 +757,19 @@ function al() {
|
|
|
757
757
|
function tl({
|
|
758
758
|
iconClassName: s
|
|
759
759
|
}) {
|
|
760
|
-
const [t, a] = q(!1), { authToken: n } =
|
|
760
|
+
const [t, a] = q(!1), { authToken: n } = ze(), l = z((o) => o.theme), d = z((o) => o.filterValues);
|
|
761
761
|
async function r() {
|
|
762
762
|
{
|
|
763
763
|
a(!0);
|
|
764
764
|
const o = new URLSearchParams();
|
|
765
|
-
o.set("token", (n == null ? void 0 : n.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(
|
|
766
|
-
const
|
|
765
|
+
o.set("token", (n == null ? void 0 : n.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(d));
|
|
766
|
+
const c = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, u = await (await fetch(c, {
|
|
767
767
|
method: "GET",
|
|
768
768
|
headers: {
|
|
769
769
|
Authorization: `Bearer ${n == null ? void 0 : n.accessToken}`
|
|
770
770
|
}
|
|
771
|
-
})).blob(),
|
|
772
|
-
window.open(
|
|
771
|
+
})).blob(), b = URL.createObjectURL(u);
|
|
772
|
+
window.open(b, "_blank"), a(!1);
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
775
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -779,7 +779,7 @@ function tl({
|
|
|
779
779
|
className: "group h-7 p-2",
|
|
780
780
|
size: "sm",
|
|
781
781
|
onClick: r,
|
|
782
|
-
children: t ? /* @__PURE__ */ e.jsx(
|
|
782
|
+
children: t ? /* @__PURE__ */ e.jsx(qe, { className: Q("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
|
|
783
783
|
nt,
|
|
784
784
|
{
|
|
785
785
|
className: Q("size-3.5", s),
|
|
@@ -791,30 +791,30 @@ function tl({
|
|
|
791
791
|
}
|
|
792
792
|
function nl() {
|
|
793
793
|
q(!1);
|
|
794
|
-
const { authToken: s } =
|
|
794
|
+
const { authToken: s } = ze();
|
|
795
795
|
z((f) => f.theme);
|
|
796
796
|
const t = z((f) => f.lenses), a = z((f) => f.selectedLensId), n = t == null ? void 0 : t.find((f) => f.id === a), l = z((f) => f.dashboard);
|
|
797
797
|
z((f) => f.selectedSheetId);
|
|
798
|
-
const
|
|
798
|
+
const d = z(
|
|
799
799
|
(f) => f.isDashboardEditing
|
|
800
800
|
), r = m(
|
|
801
801
|
(f) => f.selectedConnectionId
|
|
802
|
-
), [o,
|
|
802
|
+
), [o, c] = q(!1), p = z((f) => f.filterValues), u = z((f) => f.isVisualEditing), b = z((f) => f.showFilters);
|
|
803
803
|
z(
|
|
804
804
|
(f) => f.showDashboardJSON
|
|
805
805
|
);
|
|
806
|
-
const g = z((f) => f.onSaveFunction),
|
|
806
|
+
const g = z((f) => f.onSaveFunction), h = z(
|
|
807
807
|
(f) => f.actions.setShowFilters
|
|
808
|
-
), { addFrame: j, setSelectedFrameId:
|
|
808
|
+
), { addFrame: j, setSelectedFrameId: C } = z(
|
|
809
809
|
(f) => f.actions
|
|
810
|
-
), { getSelectedSheet:
|
|
810
|
+
), { getSelectedSheet: F, setIsDashboardEditing: y, setShowDashboardJSON: T } = z((f) => f.actions), I = F(), { tenantId: A, endUserId: N } = ws(
|
|
811
811
|
() => lt(s == null ? void 0 : s.accessToken),
|
|
812
812
|
[s == null ? void 0 : s.accessToken]
|
|
813
|
-
), S =
|
|
814
|
-
if (!
|
|
813
|
+
), S = ws(() => A || N, [A, N]), L = () => {
|
|
814
|
+
if (!d || !I) return;
|
|
815
815
|
const f = {
|
|
816
816
|
connectionId: r,
|
|
817
|
-
id:
|
|
817
|
+
id: Ke(),
|
|
818
818
|
title: "Title",
|
|
819
819
|
description: "Description",
|
|
820
820
|
preferences: {
|
|
@@ -829,16 +829,16 @@ function nl() {
|
|
|
829
829
|
sql: "select COUNT(*) from YOUR_TABLE",
|
|
830
830
|
data: []
|
|
831
831
|
}, k = {
|
|
832
|
-
id:
|
|
832
|
+
id: Ke(),
|
|
833
833
|
cards: [f],
|
|
834
834
|
activeCardId: f.id
|
|
835
835
|
};
|
|
836
|
-
j(
|
|
837
|
-
},
|
|
838
|
-
|
|
836
|
+
j(I.id, k), C(k.id);
|
|
837
|
+
}, x = () => {
|
|
838
|
+
y(!0);
|
|
839
839
|
};
|
|
840
840
|
async function v() {
|
|
841
|
-
if (
|
|
841
|
+
if (c(!0), !a || !n) return;
|
|
842
842
|
const f = Ma(
|
|
843
843
|
l
|
|
844
844
|
), k = JSON.stringify(f), M = {
|
|
@@ -846,7 +846,7 @@ function nl() {
|
|
|
846
846
|
template: k,
|
|
847
847
|
filterValues: p
|
|
848
848
|
};
|
|
849
|
-
await
|
|
849
|
+
await zs(M, s == null ? void 0 : s.accessToken), We.success("Lens saved"), g == null || g(f), c(!1);
|
|
850
850
|
}
|
|
851
851
|
return u ? null : /* @__PURE__ */ e.jsxs(
|
|
852
852
|
"div",
|
|
@@ -857,46 +857,46 @@ function nl() {
|
|
|
857
857
|
!u && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(R, { children: n == null ? void 0 : n.name }) }),
|
|
858
858
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
859
859
|
/* @__PURE__ */ e.jsx(tl, {}),
|
|
860
|
-
|
|
860
|
+
d && !u && S && /* @__PURE__ */ e.jsx(sl, {}),
|
|
861
861
|
!u && S && /* @__PURE__ */ e.jsx(al, {}),
|
|
862
|
-
|
|
862
|
+
d && !u && /* @__PURE__ */ e.jsxs(
|
|
863
863
|
O,
|
|
864
864
|
{
|
|
865
865
|
variant: "secondary",
|
|
866
866
|
className: "h-7 p-2",
|
|
867
867
|
size: "sm",
|
|
868
|
-
disabled: !
|
|
868
|
+
disabled: !d,
|
|
869
869
|
onClick: L,
|
|
870
870
|
children: [
|
|
871
|
-
/* @__PURE__ */ e.jsx(
|
|
871
|
+
/* @__PURE__ */ e.jsx(Ts, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
872
872
|
"Frame"
|
|
873
873
|
]
|
|
874
874
|
}
|
|
875
875
|
),
|
|
876
|
-
!
|
|
876
|
+
!d && /* @__PURE__ */ e.jsx(
|
|
877
877
|
O,
|
|
878
878
|
{
|
|
879
879
|
variant: "ghost",
|
|
880
880
|
className: "h-7 p-2",
|
|
881
|
-
onClick:
|
|
881
|
+
onClick: x,
|
|
882
882
|
size: "sm",
|
|
883
883
|
children: /* @__PURE__ */ e.jsx(Ta, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
884
884
|
}
|
|
885
885
|
),
|
|
886
|
-
|
|
886
|
+
d && !u && /* @__PURE__ */ e.jsx(
|
|
887
887
|
O,
|
|
888
888
|
{
|
|
889
889
|
variant: "ghost",
|
|
890
890
|
role: "close",
|
|
891
891
|
className: "h-7 p-2",
|
|
892
892
|
onClick: () => {
|
|
893
|
-
|
|
893
|
+
y(!1), T(!1);
|
|
894
894
|
},
|
|
895
895
|
size: "sm",
|
|
896
|
-
children: /* @__PURE__ */ e.jsx(
|
|
896
|
+
children: /* @__PURE__ */ e.jsx(Je, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
897
897
|
}
|
|
898
898
|
),
|
|
899
|
-
|
|
899
|
+
d && !u && S && /* @__PURE__ */ e.jsx(
|
|
900
900
|
O,
|
|
901
901
|
{
|
|
902
902
|
className: "h-7 p-2",
|
|
@@ -907,37 +907,37 @@ function nl() {
|
|
|
907
907
|
children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
908
908
|
}
|
|
909
909
|
),
|
|
910
|
-
!
|
|
910
|
+
!b && !u && d && /* @__PURE__ */ e.jsx(
|
|
911
911
|
O,
|
|
912
912
|
{
|
|
913
913
|
className: "h-7 p-2",
|
|
914
914
|
variant: "ghost",
|
|
915
|
-
onClick: () =>
|
|
915
|
+
onClick: () => h(!0),
|
|
916
916
|
size: "sm",
|
|
917
917
|
children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
918
918
|
}
|
|
919
919
|
),
|
|
920
|
-
!u &&
|
|
920
|
+
!u && d && !1,
|
|
921
921
|
!u && !1
|
|
922
922
|
] })
|
|
923
923
|
]
|
|
924
924
|
}
|
|
925
925
|
);
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function Be({
|
|
928
928
|
title: s,
|
|
929
929
|
items: t,
|
|
930
930
|
value: a,
|
|
931
931
|
isLoading: n,
|
|
932
932
|
isError: l,
|
|
933
|
-
connectionTooltip:
|
|
933
|
+
connectionTooltip: d,
|
|
934
934
|
onChange: r,
|
|
935
935
|
showNone: o = !1,
|
|
936
|
-
className:
|
|
936
|
+
className: c,
|
|
937
937
|
showIcon: p = !0,
|
|
938
938
|
disabled: u = !1
|
|
939
939
|
}) {
|
|
940
|
-
const
|
|
940
|
+
const b = n ? "Loading..." : l ? "Error" : a;
|
|
941
941
|
function g() {
|
|
942
942
|
if (s === "Connection")
|
|
943
943
|
return /* @__PURE__ */ e.jsx(Pn, { className: "size-4 rotate-90" });
|
|
@@ -946,22 +946,22 @@ function Pe({
|
|
|
946
946
|
if (s === "Schema")
|
|
947
947
|
return /* @__PURE__ */ e.jsx(Hn, { className: "size-4" });
|
|
948
948
|
if (s === "Table")
|
|
949
|
-
return /* @__PURE__ */ e.jsx(
|
|
949
|
+
return /* @__PURE__ */ e.jsx(Vs, { className: "size-4" });
|
|
950
950
|
if (s === "Model")
|
|
951
951
|
return /* @__PURE__ */ e.jsx(Sn, { className: "size-4" });
|
|
952
952
|
}
|
|
953
953
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
954
|
-
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children:
|
|
954
|
+
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: d ? /* @__PURE__ */ e.jsxs(da, { children: [
|
|
955
955
|
/* @__PURE__ */ e.jsx(rt, { children: g() }),
|
|
956
|
-
/* @__PURE__ */ e.jsx(ua, { className: "text-xs", align: "start", children:
|
|
956
|
+
/* @__PURE__ */ e.jsx(ua, { className: "text-xs", align: "start", children: d })
|
|
957
957
|
] }) : g() }),
|
|
958
|
-
/* @__PURE__ */ e.jsxs(me, { disabled: u, value:
|
|
958
|
+
/* @__PURE__ */ e.jsxs(me, { disabled: u, value: b, onValueChange: r, children: [
|
|
959
959
|
/* @__PURE__ */ e.jsx(
|
|
960
960
|
he,
|
|
961
961
|
{
|
|
962
962
|
className: Q(
|
|
963
963
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
964
|
-
|
|
964
|
+
c
|
|
965
965
|
),
|
|
966
966
|
children: /* @__PURE__ */ e.jsx(
|
|
967
967
|
xe,
|
|
@@ -975,39 +975,39 @@ function Pe({
|
|
|
975
975
|
n ? /* @__PURE__ */ e.jsx(fe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(fe, { children: s }),
|
|
976
976
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
977
977
|
o && /* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
|
|
978
|
-
t && t.map((
|
|
978
|
+
t && t.map((h, j) => /* @__PURE__ */ e.jsx(K, { value: h.id, children: h.name }, j))
|
|
979
979
|
] }),
|
|
980
|
-
(n || l) && /* @__PURE__ */ e.jsx(K, { value:
|
|
980
|
+
(n || l) && /* @__PURE__ */ e.jsx(K, { value: b, children: b })
|
|
981
981
|
] }) })
|
|
982
982
|
] })
|
|
983
983
|
] });
|
|
984
984
|
}
|
|
985
985
|
function ll({ column: s }) {
|
|
986
|
-
const [t, a] = q(!1), n = m((
|
|
987
|
-
(
|
|
988
|
-
),
|
|
989
|
-
(
|
|
990
|
-
), r = m((
|
|
991
|
-
function
|
|
986
|
+
const [t, a] = q(!1), n = m((h) => h.selectedTableName), l = m(
|
|
987
|
+
(h) => h.selectedSchemaName
|
|
988
|
+
), d = m(
|
|
989
|
+
(h) => h.selectedDatamodelId
|
|
990
|
+
), r = m((h) => h.sqlGen), { modelItems: o } = _e(), c = m((h) => h.actions.setSqlGen), p = m((h) => h.actions.setCardSql), u = m((h) => h.actions.setRunSql);
|
|
991
|
+
function b(h, j) {
|
|
992
992
|
var T;
|
|
993
|
-
const
|
|
994
|
-
(
|
|
993
|
+
const C = ma(h, r, j), F = (T = o == null ? void 0 : o.find(
|
|
994
|
+
(I) => I.id === d
|
|
995
995
|
)) == null ? void 0 : T.name;
|
|
996
|
-
|
|
997
|
-
const
|
|
998
|
-
|
|
996
|
+
c(C);
|
|
997
|
+
const y = ha(
|
|
998
|
+
C,
|
|
999
999
|
de(l || ""),
|
|
1000
1000
|
de(n),
|
|
1001
|
-
|
|
1001
|
+
F
|
|
1002
1002
|
);
|
|
1003
|
-
|
|
1003
|
+
y && (p(y), u(!0)), a(!1);
|
|
1004
1004
|
}
|
|
1005
1005
|
function g() {
|
|
1006
1006
|
return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
|
|
1007
1007
|
/* @__PURE__ */ e.jsx(
|
|
1008
1008
|
"li",
|
|
1009
1009
|
{
|
|
1010
|
-
onClick: () =>
|
|
1010
|
+
onClick: () => b(s, "COUNT"),
|
|
1011
1011
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
1012
1012
|
children: "Count"
|
|
1013
1013
|
}
|
|
@@ -1015,7 +1015,7 @@ function ll({ column: s }) {
|
|
|
1015
1015
|
/* @__PURE__ */ e.jsx(
|
|
1016
1016
|
"li",
|
|
1017
1017
|
{
|
|
1018
|
-
onClick: () =>
|
|
1018
|
+
onClick: () => b(s, "AVG"),
|
|
1019
1019
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
1020
1020
|
children: "Avg"
|
|
1021
1021
|
}
|
|
@@ -1023,7 +1023,7 @@ function ll({ column: s }) {
|
|
|
1023
1023
|
/* @__PURE__ */ e.jsx(
|
|
1024
1024
|
"li",
|
|
1025
1025
|
{
|
|
1026
|
-
onClick: () =>
|
|
1026
|
+
onClick: () => b(s, "SUM"),
|
|
1027
1027
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
1028
1028
|
children: "Sum"
|
|
1029
1029
|
}
|
|
@@ -1031,7 +1031,7 @@ function ll({ column: s }) {
|
|
|
1031
1031
|
/* @__PURE__ */ e.jsx(
|
|
1032
1032
|
"li",
|
|
1033
1033
|
{
|
|
1034
|
-
onClick: () =>
|
|
1034
|
+
onClick: () => b(s, "MAX"),
|
|
1035
1035
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
1036
1036
|
children: "Max"
|
|
1037
1037
|
}
|
|
@@ -1039,17 +1039,17 @@ function ll({ column: s }) {
|
|
|
1039
1039
|
/* @__PURE__ */ e.jsx(
|
|
1040
1040
|
"li",
|
|
1041
1041
|
{
|
|
1042
|
-
onClick: () =>
|
|
1042
|
+
onClick: () => b(s, "MIN"),
|
|
1043
1043
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
1044
1044
|
children: "Min"
|
|
1045
1045
|
}
|
|
1046
1046
|
)
|
|
1047
1047
|
] });
|
|
1048
1048
|
}
|
|
1049
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1050
|
-
/* @__PURE__ */ e.jsx(
|
|
1049
|
+
return /* @__PURE__ */ e.jsxs(qs, { openDelay: 0, open: t, onOpenChange: a, children: [
|
|
1050
|
+
/* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ia, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
|
|
1051
1051
|
/* @__PURE__ */ e.jsx(
|
|
1052
|
-
|
|
1052
|
+
_s,
|
|
1053
1053
|
{
|
|
1054
1054
|
align: "center",
|
|
1055
1055
|
className: "w-20 rounded-md p-0 shadow-none",
|
|
@@ -1062,7 +1062,7 @@ function Ea({ column: s }) {
|
|
|
1062
1062
|
return /* @__PURE__ */ e.jsxs(da, { children: [
|
|
1063
1063
|
/* @__PURE__ */ e.jsx(it, { asChild: !0, children: ot.includes(s.data_type.toLowerCase()) ? (
|
|
1064
1064
|
// <span className=" font-thin">T</span>
|
|
1065
|
-
/* @__PURE__ */ e.jsx(
|
|
1065
|
+
/* @__PURE__ */ e.jsx(Gs, { className: "size-3" })
|
|
1066
1066
|
) : xa.includes(s.data_type.toLowerCase()) ? (
|
|
1067
1067
|
//
|
|
1068
1068
|
/* @__PURE__ */ e.jsx(Mn, { className: "size-3" })
|
|
@@ -1076,56 +1076,56 @@ function rl({
|
|
|
1076
1076
|
columns: a,
|
|
1077
1077
|
status: n
|
|
1078
1078
|
}) {
|
|
1079
|
-
const l = m((
|
|
1080
|
-
(
|
|
1079
|
+
const l = m((x) => x.sqlGen), d = m(
|
|
1080
|
+
(x) => x.selectedConnectionId
|
|
1081
1081
|
), r = m(
|
|
1082
|
-
(
|
|
1082
|
+
(x) => x.selectedDatabaseName
|
|
1083
1083
|
), o = m(
|
|
1084
|
-
(
|
|
1085
|
-
),
|
|
1086
|
-
(
|
|
1084
|
+
(x) => x.selectedSchemaName
|
|
1085
|
+
), c = m((x) => x.selectedTableName), p = m(
|
|
1086
|
+
(x) => x.selectedDatamodelId
|
|
1087
1087
|
), u = z(
|
|
1088
|
-
(
|
|
1089
|
-
), { setAIScopeTables:
|
|
1090
|
-
(
|
|
1091
|
-
),
|
|
1092
|
-
function T(
|
|
1088
|
+
(x) => x.dashboard.aiScopeTables
|
|
1089
|
+
), { setAIScopeTables: b } = z((x) => x.actions), g = m((x) => x.actions.setRunSql), h = m((x) => x.actions.setSqlGen), j = m(
|
|
1090
|
+
(x) => x.actions.setIsShowingVisual
|
|
1091
|
+
), C = m((x) => x.actions.setCardSql), { connectionType: F, modelItems: y } = _e();
|
|
1092
|
+
function T(x) {
|
|
1093
1093
|
var M;
|
|
1094
|
-
const v = ma(
|
|
1095
|
-
|
|
1096
|
-
const f = (M =
|
|
1094
|
+
const v = ma(x, l);
|
|
1095
|
+
h(v);
|
|
1096
|
+
const f = (M = y == null ? void 0 : y.find(
|
|
1097
1097
|
(H) => H.id === p
|
|
1098
1098
|
)) == null ? void 0 : M.name, k = ha(v, de(s), de(t), f);
|
|
1099
|
-
k && (
|
|
1099
|
+
k && (C(k), g(!0));
|
|
1100
1100
|
}
|
|
1101
|
-
function
|
|
1101
|
+
function I() {
|
|
1102
1102
|
return (u == null ? void 0 : u.find(
|
|
1103
|
-
(
|
|
1103
|
+
(x) => x.connectinonId === d && x.tableName === c
|
|
1104
1104
|
)) !== void 0;
|
|
1105
1105
|
}
|
|
1106
|
-
function A(
|
|
1107
|
-
if (
|
|
1106
|
+
function A(x) {
|
|
1107
|
+
if (x === !0 && c && d) {
|
|
1108
1108
|
const v = {
|
|
1109
|
-
connectinonId:
|
|
1110
|
-
connectionType:
|
|
1109
|
+
connectinonId: d,
|
|
1110
|
+
connectionType: F,
|
|
1111
1111
|
databaseName: r,
|
|
1112
1112
|
schemaName: o,
|
|
1113
|
-
tableName:
|
|
1113
|
+
tableName: c
|
|
1114
1114
|
}, k = [...u || [], v].filter(
|
|
1115
1115
|
(M, H, P) => P.findIndex(
|
|
1116
1116
|
(Y) => Y.connectinonId === M.connectinonId && Y.tableName === M.tableName
|
|
1117
1117
|
) === H
|
|
1118
1118
|
);
|
|
1119
|
-
|
|
1119
|
+
b(k), We.success(`Added '${c}' to AI Scope`, {
|
|
1120
1120
|
position: "top-right",
|
|
1121
1121
|
duration: 2500,
|
|
1122
1122
|
richColors: !0
|
|
1123
1123
|
});
|
|
1124
1124
|
} else {
|
|
1125
1125
|
const v = (u || []).filter(
|
|
1126
|
-
(f) => f.connectinonId !==
|
|
1126
|
+
(f) => f.connectinonId !== d && f.tableName !== c
|
|
1127
1127
|
);
|
|
1128
|
-
|
|
1128
|
+
b(v), We(`Removed '${c}' from AI Scope`, {
|
|
1129
1129
|
position: "top-right",
|
|
1130
1130
|
duration: 2e3,
|
|
1131
1131
|
richColors: !0
|
|
@@ -1134,31 +1134,31 @@ function rl({
|
|
|
1134
1134
|
}
|
|
1135
1135
|
function N() {
|
|
1136
1136
|
var M;
|
|
1137
|
-
let
|
|
1138
|
-
const v = (M =
|
|
1137
|
+
let x = fa(s, t);
|
|
1138
|
+
const v = (M = y == null ? void 0 : y.find(
|
|
1139
1139
|
(H) => H.id === p
|
|
1140
1140
|
)) == null ? void 0 : M.name;
|
|
1141
|
-
|
|
1142
|
-
let f =
|
|
1141
|
+
p && p !== "none" && (x = `${Ns}.${v}`);
|
|
1142
|
+
let f = x;
|
|
1143
1143
|
return ((H) => /[A-Z]/.test(H))(t) && (f = f.split(".").map((P) => `"${P}"`).join(".")), f;
|
|
1144
1144
|
}
|
|
1145
1145
|
function S() {
|
|
1146
|
-
const
|
|
1146
|
+
const x = N();
|
|
1147
1147
|
j(!1);
|
|
1148
|
-
const v =
|
|
1149
|
-
|
|
1148
|
+
const v = F === "MSSQL" ? `SELECT top 10 * FROM ${x}` : `SELECT * FROM ${x} LIMIT 10`;
|
|
1149
|
+
C(v), g(!0);
|
|
1150
1150
|
}
|
|
1151
1151
|
function L() {
|
|
1152
|
-
const
|
|
1153
|
-
|
|
1152
|
+
const x = N();
|
|
1153
|
+
C(`SELECT COUNT(*) as count FROM ${x}`), g(!0);
|
|
1154
1154
|
}
|
|
1155
1155
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
|
|
1156
1156
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
|
|
1157
1157
|
/* @__PURE__ */ e.jsx(
|
|
1158
1158
|
pa,
|
|
1159
1159
|
{
|
|
1160
|
-
title: `${
|
|
1161
|
-
pressed:
|
|
1160
|
+
title: `${I() ? "Remove from" : "Add to"} AI Scope`,
|
|
1161
|
+
pressed: I(),
|
|
1162
1162
|
onPressedChange: A,
|
|
1163
1163
|
variant: "outline",
|
|
1164
1164
|
className: "h-9 px-2",
|
|
@@ -1166,8 +1166,8 @@ function rl({
|
|
|
1166
1166
|
mt,
|
|
1167
1167
|
{
|
|
1168
1168
|
className: Q("size-4", {
|
|
1169
|
-
"text-primary":
|
|
1170
|
-
"text-muted-foreground": !
|
|
1169
|
+
"text-primary": I(),
|
|
1170
|
+
"text-muted-foreground": !I()
|
|
1171
1171
|
})
|
|
1172
1172
|
}
|
|
1173
1173
|
)
|
|
@@ -1182,7 +1182,7 @@ function rl({
|
|
|
1182
1182
|
variant: "secondary",
|
|
1183
1183
|
className: "flex",
|
|
1184
1184
|
children: [
|
|
1185
|
-
n !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
1185
|
+
n !== "Success" ? /* @__PURE__ */ e.jsx(qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Qn, { className: "mr-2 size-4" }),
|
|
1186
1186
|
"Top 10"
|
|
1187
1187
|
]
|
|
1188
1188
|
}
|
|
@@ -1196,91 +1196,91 @@ function rl({
|
|
|
1196
1196
|
variant: "secondary",
|
|
1197
1197
|
className: "flex",
|
|
1198
1198
|
children: [
|
|
1199
|
-
n !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
1199
|
+
n !== "Success" ? /* @__PURE__ */ e.jsx(qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Gn, { className: "mr-2 size-4" }),
|
|
1200
1200
|
"Count"
|
|
1201
1201
|
]
|
|
1202
1202
|
}
|
|
1203
1203
|
)
|
|
1204
1204
|
] }),
|
|
1205
1205
|
/* @__PURE__ */ e.jsxs(
|
|
1206
|
-
|
|
1206
|
+
De,
|
|
1207
1207
|
{
|
|
1208
1208
|
className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
|
|
1209
1209
|
children: [
|
|
1210
|
-
a == null ? void 0 : a.map((
|
|
1210
|
+
a == null ? void 0 : a.map((x) => /* @__PURE__ */ e.jsxs(
|
|
1211
1211
|
"div",
|
|
1212
1212
|
{
|
|
1213
|
-
onClick: () => T(
|
|
1213
|
+
onClick: () => T(x),
|
|
1214
1214
|
className: Q(
|
|
1215
1215
|
"group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
1216
1216
|
{
|
|
1217
|
-
"bg-muted": ht(
|
|
1217
|
+
"bg-muted": ht(x, l)
|
|
1218
1218
|
}
|
|
1219
1219
|
),
|
|
1220
1220
|
children: [
|
|
1221
1221
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1222
|
-
/* @__PURE__ */ e.jsx(Ea, { column:
|
|
1223
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
1222
|
+
/* @__PURE__ */ e.jsx(Ea, { column: x }),
|
|
1223
|
+
/* @__PURE__ */ e.jsx("span", { children: x.column_name })
|
|
1224
1224
|
] }),
|
|
1225
1225
|
/* @__PURE__ */ e.jsx(
|
|
1226
1226
|
"div",
|
|
1227
1227
|
{
|
|
1228
1228
|
onClick: (v) => v.stopPropagation(),
|
|
1229
1229
|
className: "flex items-center justify-end",
|
|
1230
|
-
children: xa.includes(
|
|
1230
|
+
children: xa.includes(x.data_type) && /* @__PURE__ */ e.jsx(ll, { column: x })
|
|
1231
1231
|
}
|
|
1232
1232
|
)
|
|
1233
1233
|
]
|
|
1234
1234
|
},
|
|
1235
|
-
|
|
1235
|
+
x.column_name
|
|
1236
1236
|
)),
|
|
1237
|
-
/* @__PURE__ */ e.jsx(
|
|
1238
|
-
/* @__PURE__ */ e.jsx(
|
|
1237
|
+
/* @__PURE__ */ e.jsx(os, { orientation: "vertical" }),
|
|
1238
|
+
/* @__PURE__ */ e.jsx(os, { orientation: "horizontal" })
|
|
1239
1239
|
]
|
|
1240
1240
|
}
|
|
1241
1241
|
)
|
|
1242
1242
|
] });
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1244
|
+
function _e(s, t) {
|
|
1245
1245
|
var Xe, Ze, es, ss, as;
|
|
1246
|
-
let a =
|
|
1247
|
-
const n =
|
|
1246
|
+
let a = ws(() => [], []);
|
|
1247
|
+
const n = ze().authToken || s, l = m(
|
|
1248
1248
|
(i) => i.selectedConnectionId
|
|
1249
|
-
),
|
|
1249
|
+
), d = m(
|
|
1250
1250
|
(i) => i.selectedDatamodelId
|
|
1251
1251
|
), r = m(
|
|
1252
1252
|
(i) => i.selectedDatabaseName
|
|
1253
1253
|
), o = m(
|
|
1254
1254
|
(i) => i.selectedSchemaName
|
|
1255
|
-
),
|
|
1255
|
+
), c = m((i) => i.selectedTableName), p = m(
|
|
1256
1256
|
(i) => i.actions.setCurrentColumns
|
|
1257
1257
|
), u = m(
|
|
1258
1258
|
(i) => i.actions.setSelectedConnectionId
|
|
1259
|
-
),
|
|
1259
|
+
), b = m(
|
|
1260
1260
|
(i) => i.actions.setSelectedDatamodelId
|
|
1261
1261
|
), g = m(
|
|
1262
1262
|
(i) => i.actions.setSelectedDatabaseName
|
|
1263
|
-
),
|
|
1263
|
+
), h = m(
|
|
1264
1264
|
(i) => i.actions.setSelectedSchemaName
|
|
1265
1265
|
), j = m(
|
|
1266
1266
|
(i) => i.actions.setSelectedTableName
|
|
1267
|
-
),
|
|
1268
|
-
function
|
|
1267
|
+
), C = m((i) => i.actions.setCardSql);
|
|
1268
|
+
function F(i) {
|
|
1269
1269
|
return l && r && o && r !== "NA" ? !0 : l && i === "API" ? !1 : !!(l && i === "S3");
|
|
1270
1270
|
}
|
|
1271
|
-
function
|
|
1272
|
-
return !!(l && r && r !== "NA" && o &&
|
|
1271
|
+
function y(i) {
|
|
1272
|
+
return !!(l && r && r !== "NA" && o && c || l && (i === "S3" || i === "API") || d && d);
|
|
1273
1273
|
}
|
|
1274
1274
|
function T(i) {
|
|
1275
1275
|
return l && i ? !(i === "API" || i === "S3") : !1;
|
|
1276
1276
|
}
|
|
1277
1277
|
const {
|
|
1278
|
-
data:
|
|
1278
|
+
data: I,
|
|
1279
1279
|
isLoading: A,
|
|
1280
1280
|
isError: N
|
|
1281
|
-
} =
|
|
1281
|
+
} = Ce({
|
|
1282
1282
|
queryKey: ["connections"],
|
|
1283
|
-
queryFn: () =>
|
|
1283
|
+
queryFn: () => Ie(
|
|
1284
1284
|
"https://semaphor.cloud/api/v1/connections",
|
|
1285
1285
|
(n == null ? void 0 : n.accessToken) || ""
|
|
1286
1286
|
),
|
|
@@ -1289,10 +1289,10 @@ function Re(s, t) {
|
|
|
1289
1289
|
}), {
|
|
1290
1290
|
data: S,
|
|
1291
1291
|
isLoading: L,
|
|
1292
|
-
isError:
|
|
1293
|
-
} =
|
|
1292
|
+
isError: x
|
|
1293
|
+
} = Ce({
|
|
1294
1294
|
queryKey: ["models", l],
|
|
1295
|
-
queryFn: () =>
|
|
1295
|
+
queryFn: () => Ie(
|
|
1296
1296
|
"https://semaphor.cloud/api/v1/datamodels",
|
|
1297
1297
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1298
1298
|
{
|
|
@@ -1301,7 +1301,7 @@ function Re(s, t) {
|
|
|
1301
1301
|
),
|
|
1302
1302
|
enabled: !!(n != null && n.accessToken) && !!l
|
|
1303
1303
|
// Only fetch if authToken is present
|
|
1304
|
-
}), v =
|
|
1304
|
+
}), v = I == null ? void 0 : I.connections.find(
|
|
1305
1305
|
(i) => i.id === l
|
|
1306
1306
|
), f = v == null ? void 0 : v.type, k = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
|
|
1307
1307
|
data: M,
|
|
@@ -1309,9 +1309,9 @@ function Re(s, t) {
|
|
|
1309
1309
|
isFetching: P,
|
|
1310
1310
|
isError: Y,
|
|
1311
1311
|
refetch: ie
|
|
1312
|
-
} =
|
|
1312
|
+
} = Ce({
|
|
1313
1313
|
queryKey: ["databases", l],
|
|
1314
|
-
queryFn: () =>
|
|
1314
|
+
queryFn: () => Ie(
|
|
1315
1315
|
"https://semaphor.cloud/api/v1/databases",
|
|
1316
1316
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1317
1317
|
{
|
|
@@ -1326,9 +1326,9 @@ function Re(s, t) {
|
|
|
1326
1326
|
isFetching: w,
|
|
1327
1327
|
isError: _,
|
|
1328
1328
|
refetch: ee
|
|
1329
|
-
} =
|
|
1329
|
+
} = Ce({
|
|
1330
1330
|
queryKey: ["schemas", l, r],
|
|
1331
|
-
queryFn: () =>
|
|
1331
|
+
queryFn: () => Ie(
|
|
1332
1332
|
"https://semaphor.cloud/api/v1/schemas",
|
|
1333
1333
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1334
1334
|
{
|
|
@@ -1344,14 +1344,14 @@ function Re(s, t) {
|
|
|
1344
1344
|
isFetching: se,
|
|
1345
1345
|
isError: $,
|
|
1346
1346
|
refetch: X
|
|
1347
|
-
} =
|
|
1347
|
+
} = Ce({
|
|
1348
1348
|
queryKey: [
|
|
1349
1349
|
"tables",
|
|
1350
1350
|
l,
|
|
1351
1351
|
r,
|
|
1352
1352
|
o
|
|
1353
1353
|
],
|
|
1354
|
-
queryFn: () =>
|
|
1354
|
+
queryFn: () => Ie(
|
|
1355
1355
|
"https://semaphor.cloud/api/v1/tables",
|
|
1356
1356
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1357
1357
|
{
|
|
@@ -1360,34 +1360,34 @@ function Re(s, t) {
|
|
|
1360
1360
|
schema_name: o
|
|
1361
1361
|
}
|
|
1362
1362
|
),
|
|
1363
|
-
enabled:
|
|
1363
|
+
enabled: F(f)
|
|
1364
1364
|
}), {
|
|
1365
1365
|
data: te,
|
|
1366
|
-
isLoading:
|
|
1367
|
-
isFetching:
|
|
1368
|
-
isError:
|
|
1369
|
-
} =
|
|
1366
|
+
isLoading: Ee,
|
|
1367
|
+
isFetching: Oe,
|
|
1368
|
+
isError: je
|
|
1369
|
+
} = Ce({
|
|
1370
1370
|
queryKey: [
|
|
1371
1371
|
"columns",
|
|
1372
1372
|
l,
|
|
1373
1373
|
r,
|
|
1374
|
-
|
|
1374
|
+
d,
|
|
1375
1375
|
o,
|
|
1376
|
-
|
|
1376
|
+
c
|
|
1377
1377
|
],
|
|
1378
|
-
queryFn: () =>
|
|
1378
|
+
queryFn: () => Ie(
|
|
1379
1379
|
"https://semaphor.cloud/api/v1/columns",
|
|
1380
1380
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1381
1381
|
{
|
|
1382
1382
|
connection_id: l,
|
|
1383
|
-
datamodel_id:
|
|
1383
|
+
datamodel_id: d || "",
|
|
1384
1384
|
// don't pass undefined. Pass empty string
|
|
1385
1385
|
database_name: r,
|
|
1386
1386
|
schema_name: o,
|
|
1387
|
-
table_name:
|
|
1387
|
+
table_name: c
|
|
1388
1388
|
}
|
|
1389
1389
|
),
|
|
1390
|
-
enabled:
|
|
1390
|
+
enabled: y(f)
|
|
1391
1391
|
// (!!selectedConnectionId &&
|
|
1392
1392
|
// !!selectedDatabaseName &&
|
|
1393
1393
|
// !!selectedSchemaName &&
|
|
@@ -1401,42 +1401,42 @@ function Re(s, t) {
|
|
|
1401
1401
|
}, [te, p, a]), Z(() => {
|
|
1402
1402
|
}, [
|
|
1403
1403
|
k,
|
|
1404
|
-
|
|
1404
|
+
C,
|
|
1405
1405
|
j,
|
|
1406
|
-
|
|
1406
|
+
h,
|
|
1407
1407
|
g,
|
|
1408
1408
|
v
|
|
1409
1409
|
]);
|
|
1410
|
-
const
|
|
1410
|
+
const be = (v == null ? void 0 : v.type) === "API" ? (Xe = v == null ? void 0 : v.type) == null ? void 0 : Xe.toLowerCase() : c || "", J = k ? "" : o || "";
|
|
1411
1411
|
function oe(i) {
|
|
1412
|
-
|
|
1412
|
+
h(i), j("");
|
|
1413
1413
|
}
|
|
1414
1414
|
function ce(i) {
|
|
1415
|
-
g(i === "none" ? "" : i),
|
|
1415
|
+
g(i === "none" ? "" : i), h(""), j(""), i !== "none" && i !== "" && b("");
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1417
|
+
function Fe(i) {
|
|
1418
1418
|
u(i);
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1421
|
-
|
|
1420
|
+
function Ae(i) {
|
|
1421
|
+
b(i === "none" ? "" : i), i !== "none" && i !== "" && g("");
|
|
1422
1422
|
}
|
|
1423
1423
|
M && ((Ze = M == null ? void 0 : M.databases) == null ? void 0 : Ze.length) > 0, W && ((es = W == null ? void 0 : W.schemas) == null ? void 0 : es.length) > 0, te && ((ss = te == null ? void 0 : te.columns) == null ? void 0 : ss.length) > 0 && (a = te.columns.map((i) => ({
|
|
1424
1424
|
...i,
|
|
1425
1425
|
data_type: i.data_type.toLowerCase()
|
|
1426
|
-
}))), Y && (a = []), (
|
|
1427
|
-
const
|
|
1426
|
+
}))), Y && (a = []), (je || N) && (a = []);
|
|
1427
|
+
const $e = I == null ? void 0 : I.connections.map(
|
|
1428
1428
|
(i) => ({
|
|
1429
1429
|
id: i.id,
|
|
1430
1430
|
name: i.name,
|
|
1431
1431
|
type: i.type
|
|
1432
1432
|
})
|
|
1433
|
-
),
|
|
1433
|
+
), Pe = (as = S == null ? void 0 : S.datamodels) == null ? void 0 : as.map((i) => ({
|
|
1434
1434
|
id: i.id,
|
|
1435
1435
|
name: i.name
|
|
1436
|
-
})),
|
|
1436
|
+
})), Ve = M == null ? void 0 : M.databases.map((i) => ({
|
|
1437
1437
|
id: i.database_name,
|
|
1438
1438
|
name: i.database_name
|
|
1439
|
-
})),
|
|
1439
|
+
})), ys = W == null ? void 0 : W.schemas.map((i) => ({
|
|
1440
1440
|
id: i.schema_name,
|
|
1441
1441
|
name: i.schema_name
|
|
1442
1442
|
})), Ye = E == null ? void 0 : E.tables.map((i) => ({
|
|
@@ -1444,30 +1444,30 @@ function Re(s, t) {
|
|
|
1444
1444
|
name: i.table_name
|
|
1445
1445
|
}));
|
|
1446
1446
|
return {
|
|
1447
|
-
connectionItems:
|
|
1447
|
+
connectionItems: $e,
|
|
1448
1448
|
isConnectionsLoading: A,
|
|
1449
1449
|
isConnectionsError: N,
|
|
1450
|
-
modelItems:
|
|
1450
|
+
modelItems: Pe,
|
|
1451
1451
|
isModelsLoading: L,
|
|
1452
|
-
isModelsError:
|
|
1453
|
-
databaseItems:
|
|
1452
|
+
isModelsError: x,
|
|
1453
|
+
databaseItems: Ve,
|
|
1454
1454
|
isDatabasesLoadingOrFetching: H || P,
|
|
1455
1455
|
isDatabaseError: Y,
|
|
1456
|
-
schemaItems:
|
|
1456
|
+
schemaItems: ys,
|
|
1457
1457
|
isSchemaLoadingOrFetching: ae || w,
|
|
1458
1458
|
isSchemaError: _,
|
|
1459
1459
|
tableItems: Ye,
|
|
1460
1460
|
isTableLoadingOrFetching: D || se,
|
|
1461
1461
|
isTableError: $,
|
|
1462
1462
|
columns: a,
|
|
1463
|
-
isColumnsLoadingOrFetching:
|
|
1464
|
-
isColumnsError:
|
|
1463
|
+
isColumnsLoadingOrFetching: Ee || Oe,
|
|
1464
|
+
isColumnsError: je,
|
|
1465
1465
|
isNonDbConnection: k,
|
|
1466
1466
|
connectionType: f,
|
|
1467
|
-
tableName:
|
|
1467
|
+
tableName: be,
|
|
1468
1468
|
schemaName: J,
|
|
1469
|
-
handleConnectionChange:
|
|
1470
|
-
handleDatamodelChange:
|
|
1469
|
+
handleConnectionChange: Fe,
|
|
1470
|
+
handleDatamodelChange: Ae,
|
|
1471
1471
|
handleDatabaseChange: ce,
|
|
1472
1472
|
handleSchemaChange: oe
|
|
1473
1473
|
};
|
|
@@ -1484,27 +1484,27 @@ function Aa({
|
|
|
1484
1484
|
($) => $.selectedDatabaseName
|
|
1485
1485
|
), l = m(
|
|
1486
1486
|
($) => $.selectedSchemaName
|
|
1487
|
-
),
|
|
1487
|
+
), d = m(($) => $.selectedTableName), r = m(
|
|
1488
1488
|
($) => $.actions.setSelectedTableName
|
|
1489
1489
|
), {
|
|
1490
1490
|
connectionItems: o,
|
|
1491
|
-
modelItems:
|
|
1491
|
+
modelItems: c,
|
|
1492
1492
|
schemaItems: p,
|
|
1493
1493
|
databaseItems: u,
|
|
1494
|
-
tableItems:
|
|
1494
|
+
tableItems: b,
|
|
1495
1495
|
columns: g,
|
|
1496
|
-
isConnectionsLoading:
|
|
1496
|
+
isConnectionsLoading: h,
|
|
1497
1497
|
isModelsLoading: j,
|
|
1498
|
-
isConnectionsError:
|
|
1499
|
-
isModelsError:
|
|
1500
|
-
isDatabasesLoadingOrFetching:
|
|
1498
|
+
isConnectionsError: C,
|
|
1499
|
+
isModelsError: F,
|
|
1500
|
+
isDatabasesLoadingOrFetching: y,
|
|
1501
1501
|
isDatabaseError: T,
|
|
1502
|
-
isSchemaLoadingOrFetching:
|
|
1502
|
+
isSchemaLoadingOrFetching: I,
|
|
1503
1503
|
isSchemaError: A,
|
|
1504
1504
|
isColumnsError: N,
|
|
1505
1505
|
isColumnsLoadingOrFetching: S,
|
|
1506
1506
|
isTableLoadingOrFetching: L,
|
|
1507
|
-
isTableError:
|
|
1507
|
+
isTableError: x,
|
|
1508
1508
|
connectionType: v,
|
|
1509
1509
|
isNonDbConnection: f,
|
|
1510
1510
|
handleConnectionChange: k,
|
|
@@ -1513,7 +1513,7 @@ function Aa({
|
|
|
1513
1513
|
handleDatamodelChange: P,
|
|
1514
1514
|
tableName: Y,
|
|
1515
1515
|
schemaName: ie
|
|
1516
|
-
} =
|
|
1516
|
+
} = _e();
|
|
1517
1517
|
function W() {
|
|
1518
1518
|
return s ? s(ie, Y, g) : /* @__PURE__ */ e.jsx(
|
|
1519
1519
|
rl,
|
|
@@ -1532,12 +1532,12 @@ function Aa({
|
|
|
1532
1532
|
if (!t || v === "S3" || v === "API") return null;
|
|
1533
1533
|
if (!a || a === "none")
|
|
1534
1534
|
return /* @__PURE__ */ e.jsx(
|
|
1535
|
-
|
|
1535
|
+
Be,
|
|
1536
1536
|
{
|
|
1537
1537
|
showNone: !0,
|
|
1538
1538
|
onChange: M,
|
|
1539
1539
|
isError: T,
|
|
1540
|
-
isLoading:
|
|
1540
|
+
isLoading: y,
|
|
1541
1541
|
items: u,
|
|
1542
1542
|
value: n || "",
|
|
1543
1543
|
title: "Database"
|
|
@@ -1547,22 +1547,22 @@ function Aa({
|
|
|
1547
1547
|
function _() {
|
|
1548
1548
|
if (t && !f && (!n || n === "none") && (!a || a === "none"))
|
|
1549
1549
|
return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
|
|
1550
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(
|
|
1550
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(we, {}) }),
|
|
1551
1551
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(R, { children: "OR" }) }),
|
|
1552
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(
|
|
1552
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(we, {}) })
|
|
1553
1553
|
] });
|
|
1554
1554
|
}
|
|
1555
1555
|
function ee() {
|
|
1556
1556
|
if (!t || v === "S3" || v === "API") return null;
|
|
1557
1557
|
if (!n || n === "none")
|
|
1558
1558
|
return /* @__PURE__ */ e.jsx(
|
|
1559
|
-
|
|
1559
|
+
Be,
|
|
1560
1560
|
{
|
|
1561
1561
|
showNone: !0,
|
|
1562
1562
|
onChange: P,
|
|
1563
|
-
isError:
|
|
1563
|
+
isError: F,
|
|
1564
1564
|
isLoading: j,
|
|
1565
|
-
items:
|
|
1565
|
+
items: c,
|
|
1566
1566
|
value: a || "",
|
|
1567
1567
|
title: "Model"
|
|
1568
1568
|
}
|
|
@@ -1570,11 +1570,11 @@ function Aa({
|
|
|
1570
1570
|
}
|
|
1571
1571
|
function E() {
|
|
1572
1572
|
return !t || v === "S3" || v === "API" || !n || n === "none" ? null : /* @__PURE__ */ e.jsx(
|
|
1573
|
-
|
|
1573
|
+
Be,
|
|
1574
1574
|
{
|
|
1575
1575
|
onChange: H,
|
|
1576
1576
|
isError: A,
|
|
1577
|
-
isLoading:
|
|
1577
|
+
isLoading: I,
|
|
1578
1578
|
items: p,
|
|
1579
1579
|
value: l || "",
|
|
1580
1580
|
title: "Schema"
|
|
@@ -1587,13 +1587,13 @@ function Aa({
|
|
|
1587
1587
|
return v === "API" ? (X = !1, X) : ((v === "S3" || t && n && n !== "none" && l) && (X = !0), X);
|
|
1588
1588
|
}
|
|
1589
1589
|
return $() ? /* @__PURE__ */ e.jsx(
|
|
1590
|
-
|
|
1590
|
+
Be,
|
|
1591
1591
|
{
|
|
1592
1592
|
onChange: r,
|
|
1593
|
-
isError:
|
|
1594
|
-
items:
|
|
1593
|
+
isError: x,
|
|
1594
|
+
items: b,
|
|
1595
1595
|
isLoading: L,
|
|
1596
|
-
value:
|
|
1596
|
+
value: d || "",
|
|
1597
1597
|
title: "Table"
|
|
1598
1598
|
}
|
|
1599
1599
|
) : null;
|
|
@@ -1601,14 +1601,14 @@ function Aa({
|
|
|
1601
1601
|
return /* @__PURE__ */ e.jsxs("aside", { className: "xbg-red-100 flex grow flex-col justify-between", children: [
|
|
1602
1602
|
/* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
|
|
1603
1603
|
/* @__PURE__ */ e.jsx(
|
|
1604
|
-
|
|
1604
|
+
Be,
|
|
1605
1605
|
{
|
|
1606
1606
|
items: o,
|
|
1607
1607
|
title: "Connection",
|
|
1608
1608
|
value: t || "",
|
|
1609
1609
|
onChange: k,
|
|
1610
|
-
isLoading:
|
|
1611
|
-
isError:
|
|
1610
|
+
isLoading: h,
|
|
1611
|
+
isError: C,
|
|
1612
1612
|
connectionTooltip: ((se = o == null ? void 0 : o.find(
|
|
1613
1613
|
($) => $.id === t
|
|
1614
1614
|
)) == null ? void 0 : se.type) || ""
|
|
@@ -1638,8 +1638,8 @@ function Aa({
|
|
|
1638
1638
|
}
|
|
1639
1639
|
function il(s) {
|
|
1640
1640
|
const t = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
|
|
1641
|
-
let
|
|
1642
|
-
if (l !== -1 && (
|
|
1641
|
+
let d = s.length;
|
|
1642
|
+
if (l !== -1 && (d = l), n !== -1 && n < d && (d = n), t !== -1) {
|
|
1643
1643
|
const r = s.substring(0, t), o = s.substring(t);
|
|
1644
1644
|
return `${r} {{ filters | where }} AND ${o.substring(
|
|
1645
1645
|
6
|
|
@@ -1648,7 +1648,7 @@ function il(s) {
|
|
|
1648
1648
|
const r = s.substring(0, a), o = s.substring(a);
|
|
1649
1649
|
return `${r} {{ filters | where }} ${o}`;
|
|
1650
1650
|
} else {
|
|
1651
|
-
const r = s.substring(0,
|
|
1651
|
+
const r = s.substring(0, d), o = s.substring(d);
|
|
1652
1652
|
return `${r} {{ filters | where }} ${o}`;
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
@@ -1658,15 +1658,15 @@ function ol({
|
|
|
1658
1658
|
setUserInputforAI: a,
|
|
1659
1659
|
setTriggerAIRun: n
|
|
1660
1660
|
}) {
|
|
1661
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1662
|
-
/* @__PURE__ */ e.jsx(
|
|
1661
|
+
return /* @__PURE__ */ e.jsxs(qs, { openDelay: 0, children: [
|
|
1662
|
+
/* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(kn, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1663
1663
|
/* @__PURE__ */ e.jsx(
|
|
1664
|
-
|
|
1664
|
+
_s,
|
|
1665
1665
|
{
|
|
1666
1666
|
align: "start",
|
|
1667
1667
|
className: "w-full min-w-fit max-w-[700px]",
|
|
1668
1668
|
children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-2", children: [
|
|
1669
|
-
/* @__PURE__ */ e.jsx(
|
|
1669
|
+
/* @__PURE__ */ e.jsx(De, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 text-xs leading-relaxed", children: s }) }),
|
|
1670
1670
|
/* @__PURE__ */ e.jsxs(
|
|
1671
1671
|
O,
|
|
1672
1672
|
{
|
|
@@ -1739,21 +1739,21 @@ function dl({
|
|
|
1739
1739
|
userInput: a,
|
|
1740
1740
|
setUserInput: n,
|
|
1741
1741
|
triggerAIRun: l,
|
|
1742
|
-
setTriggerAIRun:
|
|
1742
|
+
setTriggerAIRun: d
|
|
1743
1743
|
}) {
|
|
1744
|
-
const r =
|
|
1744
|
+
const r = ks(null), o = ks(null), { authToken: c } = ze(), [p, u] = q(!1), b = m((w) => w.actions.setCardSql), g = z((w) => w.dashboard.baseQueries), h = m((w) => w.actions.setRunSql), j = m((w) => w.actions.setCardType), [C, F] = q([]), y = m((w) => w.currentColumns), T = m((w) => w.card.sql), I = m((w) => w.selectedTableName), A = `
|
|
1745
1745
|
${a}
|
|
1746
1746
|
|
|
1747
|
-
Database Query Dialect: ${
|
|
1748
|
-
Table Name: ${
|
|
1749
|
-
Table Columns: ${
|
|
1747
|
+
Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
|
|
1748
|
+
Table Name: ${I}
|
|
1749
|
+
Table Columns: ${y == null ? void 0 : y.map((w) => `${w.column_name} | ${w.data_type}`).join(", ")}
|
|
1750
1750
|
User SQL: ${T}
|
|
1751
1751
|
${g && `Base Queries: ${JSON.stringify(g)} `}`, N = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
1752
|
-
Visual Query Syntax: ${cl}`, { data: S, isLoading: L, isFetching:
|
|
1752
|
+
Visual Query Syntax: ${cl}`, { data: S, isLoading: L, isFetching: x, isError: v, refetch: f } = Ce({
|
|
1753
1753
|
queryKey: ["ai-query"],
|
|
1754
|
-
queryFn: () =>
|
|
1754
|
+
queryFn: () => Ie(
|
|
1755
1755
|
"https://semaphor.cloud/api/v1/ai",
|
|
1756
|
-
(
|
|
1756
|
+
(c == null ? void 0 : c.accessToken) || "",
|
|
1757
1757
|
{
|
|
1758
1758
|
user_content: `userContent: ${A} ${p ? N : ""}`
|
|
1759
1759
|
}
|
|
@@ -1783,7 +1783,7 @@ function dl({
|
|
|
1783
1783
|
return !0;
|
|
1784
1784
|
}
|
|
1785
1785
|
Z(() => {
|
|
1786
|
-
S &&
|
|
1786
|
+
S && F((w) => [...w, { role: "ai", content: S.response }]);
|
|
1787
1787
|
}, [S]), Z(() => {
|
|
1788
1788
|
const w = setTimeout(() => {
|
|
1789
1789
|
var _;
|
|
@@ -1793,13 +1793,13 @@ function dl({
|
|
|
1793
1793
|
}), (_ = r.current) == null || _.focus());
|
|
1794
1794
|
}, 100);
|
|
1795
1795
|
return () => clearTimeout(w);
|
|
1796
|
-
}, [
|
|
1796
|
+
}, [C]);
|
|
1797
1797
|
function M() {
|
|
1798
|
-
a && (
|
|
1798
|
+
a && (F((w) => [...w, { role: "user", content: a }]), k(a) && u(!0), n(""), f());
|
|
1799
1799
|
}
|
|
1800
1800
|
Z(() => {
|
|
1801
|
-
l && (M(),
|
|
1802
|
-
}, [l,
|
|
1801
|
+
l && (M(), d(!1));
|
|
1802
|
+
}, [l, d]);
|
|
1803
1803
|
const H = {
|
|
1804
1804
|
//seleect a darker color
|
|
1805
1805
|
// color: '#000',
|
|
@@ -1838,7 +1838,7 @@ function dl({
|
|
|
1838
1838
|
{
|
|
1839
1839
|
onClick: (ee) => {
|
|
1840
1840
|
const E = W(ee);
|
|
1841
|
-
E && (t(!1),
|
|
1841
|
+
E && (t(!1), b(E), h(!0));
|
|
1842
1842
|
},
|
|
1843
1843
|
size: "sm",
|
|
1844
1844
|
variant: "outline",
|
|
@@ -1857,7 +1857,7 @@ function dl({
|
|
|
1857
1857
|
return navigator.clipboard.writeText(ee).then(() => console.log("Text copied to clipboard")).catch((E) => console.error("Error in copying text: ", E)), ee;
|
|
1858
1858
|
}
|
|
1859
1859
|
function ae() {
|
|
1860
|
-
return
|
|
1860
|
+
return C == null ? void 0 : C.map((w, _) => w.role === "user" ? /* @__PURE__ */ e.jsxs(
|
|
1861
1861
|
"div",
|
|
1862
1862
|
{
|
|
1863
1863
|
className: "flex items-start rounded-md bg-muted p-3 text-sm",
|
|
@@ -1877,8 +1877,8 @@ function dl({
|
|
|
1877
1877
|
_
|
|
1878
1878
|
) : /* @__PURE__ */ e.jsx("div", {}, _));
|
|
1879
1879
|
}
|
|
1880
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1881
|
-
/* @__PURE__ */ e.jsx(
|
|
1880
|
+
return /* @__PURE__ */ e.jsxs(Is, { open: s, onOpenChange: t, children: [
|
|
1881
|
+
/* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1882
1882
|
O,
|
|
1883
1883
|
{
|
|
1884
1884
|
size: "sm",
|
|
@@ -1888,13 +1888,13 @@ function dl({
|
|
|
1888
1888
|
}
|
|
1889
1889
|
) }),
|
|
1890
1890
|
/* @__PURE__ */ e.jsxs(
|
|
1891
|
-
|
|
1891
|
+
Ls,
|
|
1892
1892
|
{
|
|
1893
1893
|
className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
|
|
1894
1894
|
children: [
|
|
1895
|
-
/* @__PURE__ */ e.jsxs(
|
|
1896
|
-
/* @__PURE__ */ e.jsx(
|
|
1897
|
-
/* @__PURE__ */ e.jsx(
|
|
1895
|
+
/* @__PURE__ */ e.jsxs(Ms, { children: [
|
|
1896
|
+
/* @__PURE__ */ e.jsx(Es, { children: "Assistant" }),
|
|
1897
|
+
/* @__PURE__ */ e.jsx(As, { children: "What can I help you with?" })
|
|
1898
1898
|
] }),
|
|
1899
1899
|
/* @__PURE__ */ e.jsx(
|
|
1900
1900
|
"div",
|
|
@@ -1924,7 +1924,7 @@ function dl({
|
|
|
1924
1924
|
className: Q(
|
|
1925
1925
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1926
1926
|
),
|
|
1927
|
-
disabled: L ||
|
|
1927
|
+
disabled: L || x,
|
|
1928
1928
|
value: a,
|
|
1929
1929
|
onChange: (w) => n(w.target.value)
|
|
1930
1930
|
}
|
|
@@ -1937,7 +1937,7 @@ function dl({
|
|
|
1937
1937
|
size: "sm",
|
|
1938
1938
|
variant: "ghost",
|
|
1939
1939
|
onClick: M,
|
|
1940
|
-
children: !L && !
|
|
1940
|
+
children: !L && !x ? /* @__PURE__ */ e.jsx(xt, {}) : /* @__PURE__ */ e.jsx(qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1941
1941
|
}
|
|
1942
1942
|
)
|
|
1943
1943
|
] })
|
|
@@ -1954,14 +1954,14 @@ var Va = {
|
|
|
1954
1954
|
className: void 0,
|
|
1955
1955
|
style: void 0,
|
|
1956
1956
|
attr: void 0
|
|
1957
|
-
}, sa =
|
|
1957
|
+
}, sa = ke.createContext && /* @__PURE__ */ ke.createContext(Va), ul = ["attr", "size", "title"];
|
|
1958
1958
|
function ml(s, t) {
|
|
1959
1959
|
if (s == null) return {};
|
|
1960
1960
|
var a = hl(s, t), n, l;
|
|
1961
1961
|
if (Object.getOwnPropertySymbols) {
|
|
1962
|
-
var
|
|
1963
|
-
for (l = 0; l <
|
|
1964
|
-
n =
|
|
1962
|
+
var d = Object.getOwnPropertySymbols(s);
|
|
1963
|
+
for (l = 0; l < d.length; l++)
|
|
1964
|
+
n = d[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
|
|
1965
1965
|
}
|
|
1966
1966
|
return a;
|
|
1967
1967
|
}
|
|
@@ -1975,15 +1975,15 @@ function hl(s, t) {
|
|
|
1975
1975
|
}
|
|
1976
1976
|
return a;
|
|
1977
1977
|
}
|
|
1978
|
-
function
|
|
1979
|
-
return
|
|
1978
|
+
function ms() {
|
|
1979
|
+
return ms = Object.assign ? Object.assign.bind() : function(s) {
|
|
1980
1980
|
for (var t = 1; t < arguments.length; t++) {
|
|
1981
1981
|
var a = arguments[t];
|
|
1982
1982
|
for (var n in a)
|
|
1983
1983
|
Object.prototype.hasOwnProperty.call(a, n) && (s[n] = a[n]);
|
|
1984
1984
|
}
|
|
1985
1985
|
return s;
|
|
1986
|
-
},
|
|
1986
|
+
}, ms.apply(this, arguments);
|
|
1987
1987
|
}
|
|
1988
1988
|
function aa(s, t) {
|
|
1989
1989
|
var a = Object.keys(s);
|
|
@@ -1995,7 +1995,7 @@ function aa(s, t) {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
return a;
|
|
1997
1997
|
}
|
|
1998
|
-
function
|
|
1998
|
+
function hs(s) {
|
|
1999
1999
|
for (var t = 1; t < arguments.length; t++) {
|
|
2000
2000
|
var a = arguments[t] != null ? arguments[t] : {};
|
|
2001
2001
|
t % 2 ? aa(Object(a), !0).forEach(function(n) {
|
|
@@ -2024,13 +2024,13 @@ function fl(s, t) {
|
|
|
2024
2024
|
return (t === "string" ? String : Number)(s);
|
|
2025
2025
|
}
|
|
2026
2026
|
function qa(s) {
|
|
2027
|
-
return s && s.map((t, a) => /* @__PURE__ */
|
|
2027
|
+
return s && s.map((t, a) => /* @__PURE__ */ ke.createElement(t.tag, hs({
|
|
2028
2028
|
key: a
|
|
2029
2029
|
}, t.attr), qa(t.child)));
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2032
|
-
return (t) => /* @__PURE__ */
|
|
2033
|
-
attr:
|
|
2031
|
+
function ge(s) {
|
|
2032
|
+
return (t) => /* @__PURE__ */ ke.createElement(gl, ms({
|
|
2033
|
+
attr: hs({}, s.attr)
|
|
2034
2034
|
}, t), qa(s.child));
|
|
2035
2035
|
}
|
|
2036
2036
|
function gl(s) {
|
|
@@ -2038,38 +2038,38 @@ function gl(s) {
|
|
|
2038
2038
|
var {
|
|
2039
2039
|
attr: n,
|
|
2040
2040
|
size: l,
|
|
2041
|
-
title:
|
|
2042
|
-
} = s, r = ml(s, ul), o = l || a.size || "1em",
|
|
2043
|
-
return a.className && (
|
|
2041
|
+
title: d
|
|
2042
|
+
} = s, r = ml(s, ul), o = l || a.size || "1em", c;
|
|
2043
|
+
return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ ke.createElement("svg", ms({
|
|
2044
2044
|
stroke: "currentColor",
|
|
2045
2045
|
fill: "currentColor",
|
|
2046
2046
|
strokeWidth: "0"
|
|
2047
2047
|
}, a.attr, n, r, {
|
|
2048
|
-
className:
|
|
2049
|
-
style:
|
|
2048
|
+
className: c,
|
|
2049
|
+
style: hs(hs({
|
|
2050
2050
|
color: s.color || a.color
|
|
2051
2051
|
}, a.style), s.style),
|
|
2052
2052
|
height: o,
|
|
2053
2053
|
width: o,
|
|
2054
2054
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2055
|
-
}),
|
|
2055
|
+
}), d && /* @__PURE__ */ ke.createElement("title", null, d), s.children);
|
|
2056
2056
|
};
|
|
2057
|
-
return sa !== void 0 ? /* @__PURE__ */
|
|
2057
|
+
return sa !== void 0 ? /* @__PURE__ */ ke.createElement(sa.Consumer, null, (a) => t(a)) : t(Va);
|
|
2058
2058
|
}
|
|
2059
2059
|
function jl(s) {
|
|
2060
|
-
return
|
|
2060
|
+
return ge({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
|
|
2061
2061
|
}
|
|
2062
2062
|
function bl({ sql: s }) {
|
|
2063
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2064
|
-
/* @__PURE__ */ e.jsx(
|
|
2063
|
+
return /* @__PURE__ */ e.jsxs(qs, { children: [
|
|
2064
|
+
/* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(jt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
|
|
2065
2065
|
/* @__PURE__ */ e.jsx(
|
|
2066
|
-
|
|
2066
|
+
_s,
|
|
2067
2067
|
{
|
|
2068
2068
|
align: "end",
|
|
2069
2069
|
className: "w-full min-w-fit max-w-[700px] p-3 pt-2",
|
|
2070
2070
|
children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
2071
2071
|
/* @__PURE__ */ e.jsx(R, { className: "text-xs font-semibold", children: "Resolved Query" }),
|
|
2072
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex grow flex-col space-y-2", children: /* @__PURE__ */ e.jsx(
|
|
2072
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex grow flex-col space-y-2", children: /* @__PURE__ */ e.jsx(De, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 font-mono text-xs leading-relaxed", children: s }) }) })
|
|
2073
2073
|
] })
|
|
2074
2074
|
}
|
|
2075
2075
|
)
|
|
@@ -2079,9 +2079,9 @@ function yl() {
|
|
|
2079
2079
|
const [s, t] = q({
|
|
2080
2080
|
queryKey: [],
|
|
2081
2081
|
queryData: null
|
|
2082
|
-
}), { theme: a } = bt(), n = yt(), l =
|
|
2082
|
+
}), { theme: a } = bt(), n = yt(), l = ks(), d = vt(), [r, o] = q(!1), [c, p] = q(!1), [u, b] = q(!1), [g, h] = q(""), [j, C] = q(!1), F = z((i) => i.selectedSheetId);
|
|
2083
2083
|
z((i) => i.dashboard.baseQueries);
|
|
2084
|
-
const
|
|
2084
|
+
const y = m((i) => i.card), T = z((i) => i.theme), I = m((i) => i.isShowingVisual);
|
|
2085
2085
|
z((i) => i.onAcceptChanges);
|
|
2086
2086
|
const A = m(
|
|
2087
2087
|
(i) => i.selectedConnectionId
|
|
@@ -2095,10 +2095,10 @@ function yl() {
|
|
|
2095
2095
|
z(
|
|
2096
2096
|
(i) => i.actions.updateFrameCard
|
|
2097
2097
|
);
|
|
2098
|
-
const
|
|
2099
|
-
(i) => i.sheetId ===
|
|
2098
|
+
const x = m((i) => i.selectedTableName), v = m((i) => i.card.sql), f = m((i) => i.card.python), k = m((i) => i.frame), M = z((i) => i.dashboard.filters), H = z((i) => i.filterValues), P = M == null ? void 0 : M.filter(
|
|
2099
|
+
(i) => i.sheetId === F || !i.sheetId
|
|
2100
2100
|
), Y = H == null ? void 0 : H.filter(
|
|
2101
|
-
(i) => (P == null ? void 0 : P.some((ne) => ne.id === i.filterId)) || i.filterId.endsWith(
|
|
2101
|
+
(i) => (P == null ? void 0 : P.some((ne) => ne.id === i.filterId)) || i.filterId.endsWith(F)
|
|
2102
2102
|
), ie = m((i) => i.applyFilters), {
|
|
2103
2103
|
setCardCustomCfg: W,
|
|
2104
2104
|
setQueryResultColumns: ae,
|
|
@@ -2113,26 +2113,26 @@ function yl() {
|
|
|
2113
2113
|
m(
|
|
2114
2114
|
(i) => i.actions.setApplyFilters
|
|
2115
2115
|
);
|
|
2116
|
-
const te = m((i) => i.onClose),
|
|
2116
|
+
const te = m((i) => i.onClose), Ee = m((i) => i.actions.setSqlGen), Oe = m((i) => i.runSql), je = m((i) => i.actions.setRunSql);
|
|
2117
2117
|
m((i) => i.actions.setCardCfg);
|
|
2118
|
-
const
|
|
2118
|
+
const be = m(
|
|
2119
2119
|
(i) => i.actions.setIsSqlRunning
|
|
2120
2120
|
), {
|
|
2121
2121
|
data: J,
|
|
2122
2122
|
isLoading: oe,
|
|
2123
2123
|
isFetching: ce,
|
|
2124
|
-
isSuccess:
|
|
2125
|
-
isError:
|
|
2126
|
-
error:
|
|
2127
|
-
queryKey:
|
|
2128
|
-
refetch:
|
|
2129
|
-
} =
|
|
2124
|
+
isSuccess: Fe,
|
|
2125
|
+
isError: Ae,
|
|
2126
|
+
error: $e,
|
|
2127
|
+
queryKey: Pe,
|
|
2128
|
+
refetch: Ve
|
|
2129
|
+
} = Re(y);
|
|
2130
2130
|
Z(() => {
|
|
2131
|
-
if (J && (J.rowLimitExceeded &&
|
|
2131
|
+
if (J && (J.rowLimitExceeded && We.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
2132
2132
|
position: "top-center",
|
|
2133
2133
|
richColors: !0
|
|
2134
2134
|
}), se((J == null ? void 0 : J.output) || ""), J.records.length > 0)) {
|
|
2135
|
-
const { dimensionKeys: i } =
|
|
2135
|
+
const { dimensionKeys: i } = Ss(J.records);
|
|
2136
2136
|
ae(i);
|
|
2137
2137
|
}
|
|
2138
2138
|
}, [
|
|
@@ -2141,27 +2141,27 @@ function yl() {
|
|
|
2141
2141
|
ae,
|
|
2142
2142
|
se
|
|
2143
2143
|
]), Z(() => {
|
|
2144
|
-
(oe || ce) &&
|
|
2144
|
+
(oe || ce) && be(!0), (Ae || Fe) && be(!1), Ae ? (D($e.message), ae([]), se("")) : D("");
|
|
2145
2145
|
}, [
|
|
2146
2146
|
oe,
|
|
2147
2147
|
ce,
|
|
2148
2148
|
J,
|
|
2149
2149
|
se,
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2150
|
+
Ae,
|
|
2151
|
+
Fe,
|
|
2152
|
+
be,
|
|
2153
2153
|
ae,
|
|
2154
2154
|
D,
|
|
2155
|
-
|
|
2155
|
+
$e
|
|
2156
2156
|
]), Z(() => {
|
|
2157
|
-
|
|
2158
|
-
}, [
|
|
2159
|
-
function
|
|
2160
|
-
const i = n.getQueryData(
|
|
2157
|
+
Oe && (Ve(), je(!1));
|
|
2158
|
+
}, [Oe, Ve, je]);
|
|
2159
|
+
function ys() {
|
|
2160
|
+
const i = n.getQueryData(Pe);
|
|
2161
2161
|
s.queryData || t({
|
|
2162
|
-
queryKey:
|
|
2162
|
+
queryKey: Pe,
|
|
2163
2163
|
queryData: i
|
|
2164
|
-
}), n.setQueryData(
|
|
2164
|
+
}), n.setQueryData(Pe, null), _(""), Ee({}), W(""), $({});
|
|
2165
2165
|
}
|
|
2166
2166
|
const Ye = (i) => {
|
|
2167
2167
|
l.current = i;
|
|
@@ -2170,16 +2170,16 @@ function yl() {
|
|
|
2170
2170
|
if (i.length === 0)
|
|
2171
2171
|
return "";
|
|
2172
2172
|
if (ne) {
|
|
2173
|
-
const
|
|
2174
|
-
if (
|
|
2175
|
-
const
|
|
2176
|
-
if (
|
|
2173
|
+
const ye = i.find((ve) => ve.id === ne);
|
|
2174
|
+
if (ye) {
|
|
2175
|
+
const ve = ye.tabTitle;
|
|
2176
|
+
if (ve == "All__Header")
|
|
2177
2177
|
return i[0].id;
|
|
2178
|
-
if (
|
|
2179
|
-
const Za =
|
|
2178
|
+
if (ve && ve.endsWith("__Header")) {
|
|
2179
|
+
const Za = ve.split("__")[0], Js = i.find(
|
|
2180
2180
|
(et) => et.tabTitle === Za
|
|
2181
2181
|
);
|
|
2182
|
-
return
|
|
2182
|
+
return Js ? Js.id : i[0].id;
|
|
2183
2183
|
}
|
|
2184
2184
|
return ne;
|
|
2185
2185
|
}
|
|
@@ -2190,54 +2190,54 @@ function yl() {
|
|
|
2190
2190
|
let i = v;
|
|
2191
2191
|
v && !v.includes("{{") && (i = il(v), _(i));
|
|
2192
2192
|
const ne = {
|
|
2193
|
-
...
|
|
2193
|
+
...y,
|
|
2194
2194
|
lastSelectedSchema: L,
|
|
2195
2195
|
lastSelectedDatamodelId: S,
|
|
2196
2196
|
lastSelectedDatabase: N,
|
|
2197
|
-
lastSelectedTable:
|
|
2197
|
+
lastSelectedTable: x,
|
|
2198
2198
|
connectionId: A,
|
|
2199
|
-
type:
|
|
2199
|
+
type: I ? y.type : "table",
|
|
2200
2200
|
sql: i,
|
|
2201
|
-
customCfg:
|
|
2202
|
-
},
|
|
2203
|
-
(
|
|
2204
|
-
),
|
|
2201
|
+
customCfg: I ? y.customCfg : null
|
|
2202
|
+
}, ye = k.cards.map(
|
|
2203
|
+
(vs) => vs.id === y.id ? ne : vs
|
|
2204
|
+
), ve = {
|
|
2205
2205
|
...k,
|
|
2206
|
-
cards:
|
|
2207
|
-
activeCardId: Xe(
|
|
2206
|
+
cards: ye,
|
|
2207
|
+
activeCardId: Xe(ye, k.activeCardId)
|
|
2208
2208
|
};
|
|
2209
|
-
X == null || X(
|
|
2209
|
+
X == null || X(ve);
|
|
2210
2210
|
}
|
|
2211
2211
|
function es() {
|
|
2212
2212
|
const { queryKey: i, queryData: ne } = s;
|
|
2213
2213
|
i && ne && n.setQueryData(i, ne), te == null || te();
|
|
2214
2214
|
}
|
|
2215
2215
|
Z(() => {
|
|
2216
|
-
if (!
|
|
2217
|
-
const i = l.current, ne = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light",
|
|
2218
|
-
return
|
|
2216
|
+
if (!d) return;
|
|
2217
|
+
const i = l.current, ne = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ye = T === "system" ? ne : T;
|
|
2218
|
+
return d.editor.defineTheme("default", {
|
|
2219
2219
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
2220
|
-
base:
|
|
2220
|
+
base: ye === "light" ? "vs" : "vs-dark",
|
|
2221
2221
|
inherit: !0,
|
|
2222
2222
|
rules: [],
|
|
2223
2223
|
colors: {
|
|
2224
|
-
"editor.background":
|
|
2224
|
+
"editor.background": ye === "light" ? "#ffffff" : Ct("240 10% 10%")
|
|
2225
2225
|
// 'editor.background':
|
|
2226
2226
|
// activeTheme === 'light'
|
|
2227
2227
|
// ? '#ffffff'
|
|
2228
2228
|
// : getCssVariableValue('--semaphor-background'),
|
|
2229
2229
|
}
|
|
2230
|
-
}),
|
|
2231
|
-
|
|
2230
|
+
}), d.editor.setTheme("default"), i && d && i.addCommand(
|
|
2231
|
+
d.KeyMod.Shift | d.KeyCode.Enter,
|
|
2232
2232
|
function() {
|
|
2233
|
-
return
|
|
2233
|
+
return Ve(), !1;
|
|
2234
2234
|
}
|
|
2235
2235
|
), () => {
|
|
2236
2236
|
};
|
|
2237
|
-
}, [a, T,
|
|
2237
|
+
}, [a, T, d]);
|
|
2238
2238
|
function ss() {
|
|
2239
2239
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2240
|
-
|
|
2240
|
+
c && /* @__PURE__ */ e.jsx(
|
|
2241
2241
|
"div",
|
|
2242
2242
|
{
|
|
2243
2243
|
className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
|
|
@@ -2245,8 +2245,8 @@ function yl() {
|
|
|
2245
2245
|
children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
|
|
2246
2246
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
|
|
2247
2247
|
/* @__PURE__ */ e.jsx(R, { className: "ml-6 text-xs font-semibold", children: "Filters" }),
|
|
2248
|
-
Y &&
|
|
2249
|
-
|
|
2248
|
+
Y && c && /* @__PURE__ */ e.jsx(
|
|
2249
|
+
Je,
|
|
2250
2250
|
{
|
|
2251
2251
|
onClick: () => p(!1),
|
|
2252
2252
|
className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
|
|
@@ -2254,7 +2254,7 @@ function yl() {
|
|
|
2254
2254
|
)
|
|
2255
2255
|
] }),
|
|
2256
2256
|
/* @__PURE__ */ e.jsx(
|
|
2257
|
-
|
|
2257
|
+
Ge,
|
|
2258
2258
|
{
|
|
2259
2259
|
theme: "default",
|
|
2260
2260
|
onChange: (i) => {
|
|
@@ -2288,7 +2288,7 @@ function yl() {
|
|
|
2288
2288
|
] })
|
|
2289
2289
|
}
|
|
2290
2290
|
),
|
|
2291
|
-
Y && !
|
|
2291
|
+
Y && !c && /* @__PURE__ */ e.jsx(
|
|
2292
2292
|
ca,
|
|
2293
2293
|
{
|
|
2294
2294
|
onClick: () => p(!0),
|
|
@@ -2304,14 +2304,14 @@ function yl() {
|
|
|
2304
2304
|
}
|
|
2305
2305
|
function as() {
|
|
2306
2306
|
return /* @__PURE__ */ e.jsxs(
|
|
2307
|
-
|
|
2307
|
+
cs,
|
|
2308
2308
|
{
|
|
2309
2309
|
className: "flex grow pb-1",
|
|
2310
2310
|
direction: "vertical",
|
|
2311
2311
|
role: "editor-resizable-group",
|
|
2312
2312
|
children: [
|
|
2313
2313
|
/* @__PURE__ */ e.jsxs(
|
|
2314
|
-
|
|
2314
|
+
Ne,
|
|
2315
2315
|
{
|
|
2316
2316
|
id: "1",
|
|
2317
2317
|
order: 1,
|
|
@@ -2324,7 +2324,7 @@ function yl() {
|
|
|
2324
2324
|
role: "sql-container",
|
|
2325
2325
|
className: "relative flex w-[99%]",
|
|
2326
2326
|
children: /* @__PURE__ */ e.jsx(
|
|
2327
|
-
|
|
2327
|
+
Ge,
|
|
2328
2328
|
{
|
|
2329
2329
|
theme: "default",
|
|
2330
2330
|
className: "pt-3",
|
|
@@ -2355,9 +2355,9 @@ function yl() {
|
|
|
2355
2355
|
}
|
|
2356
2356
|
),
|
|
2357
2357
|
r && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2358
|
-
/* @__PURE__ */ e.jsx(
|
|
2358
|
+
/* @__PURE__ */ e.jsx(ds, { withHandle: !0, className: "border" }),
|
|
2359
2359
|
/* @__PURE__ */ e.jsxs(
|
|
2360
|
-
|
|
2360
|
+
Ne,
|
|
2361
2361
|
{
|
|
2362
2362
|
id: "2",
|
|
2363
2363
|
order: 2,
|
|
@@ -2370,7 +2370,7 @@ function yl() {
|
|
|
2370
2370
|
role: "python-container",
|
|
2371
2371
|
className: "relative flex w-[99%] pt-0",
|
|
2372
2372
|
children: /* @__PURE__ */ e.jsx(
|
|
2373
|
-
|
|
2373
|
+
Ge,
|
|
2374
2374
|
{
|
|
2375
2375
|
className: "pt-3",
|
|
2376
2376
|
theme: "default",
|
|
@@ -2437,30 +2437,30 @@ function yl() {
|
|
|
2437
2437
|
title: "Shift + Enter",
|
|
2438
2438
|
disabled: oe || ce,
|
|
2439
2439
|
onClick: () => {
|
|
2440
|
-
|
|
2440
|
+
Ve();
|
|
2441
2441
|
},
|
|
2442
2442
|
className: "shrink-0",
|
|
2443
2443
|
size: "sm",
|
|
2444
2444
|
variant: "outline",
|
|
2445
2445
|
children: [
|
|
2446
|
-
oe || ce ? /* @__PURE__ */ e.jsx(
|
|
2446
|
+
oe || ce ? /* @__PURE__ */ e.jsx(qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx($n, { className: "mr-2 h-4 w-4" }),
|
|
2447
2447
|
"Run"
|
|
2448
2448
|
]
|
|
2449
2449
|
}
|
|
2450
2450
|
),
|
|
2451
|
-
|
|
2451
|
+
Ae && /* @__PURE__ */ e.jsx(
|
|
2452
2452
|
ol,
|
|
2453
2453
|
{
|
|
2454
|
-
error:
|
|
2455
|
-
setShowAIDialog:
|
|
2456
|
-
setTriggerAIRun:
|
|
2457
|
-
setUserInputforAI:
|
|
2454
|
+
error: $e.message,
|
|
2455
|
+
setShowAIDialog: b,
|
|
2456
|
+
setTriggerAIRun: C,
|
|
2457
|
+
setUserInputforAI: h
|
|
2458
2458
|
}
|
|
2459
2459
|
),
|
|
2460
2460
|
/* @__PURE__ */ e.jsxs(
|
|
2461
2461
|
O,
|
|
2462
2462
|
{
|
|
2463
|
-
onClick:
|
|
2463
|
+
onClick: ys,
|
|
2464
2464
|
className: "",
|
|
2465
2465
|
size: "sm",
|
|
2466
2466
|
variant: "outline",
|
|
@@ -2485,11 +2485,11 @@ function yl() {
|
|
|
2485
2485
|
dl,
|
|
2486
2486
|
{
|
|
2487
2487
|
open: u,
|
|
2488
|
-
setOpen:
|
|
2488
|
+
setOpen: b,
|
|
2489
2489
|
userInput: g,
|
|
2490
2490
|
triggerAIRun: j,
|
|
2491
|
-
setTriggerAIRun:
|
|
2492
|
-
setUserInput: (i) =>
|
|
2491
|
+
setTriggerAIRun: C,
|
|
2492
|
+
setUserInput: (i) => h(i)
|
|
2493
2493
|
}
|
|
2494
2494
|
)
|
|
2495
2495
|
] }),
|
|
@@ -2503,7 +2503,7 @@ function yl() {
|
|
|
2503
2503
|
size: "sm",
|
|
2504
2504
|
variant: "outline",
|
|
2505
2505
|
children: [
|
|
2506
|
-
/* @__PURE__ */ e.jsx(
|
|
2506
|
+
/* @__PURE__ */ e.jsx(Je, { className: "mr-2 size-4" }),
|
|
2507
2507
|
"Close"
|
|
2508
2508
|
]
|
|
2509
2509
|
}
|
|
@@ -2531,16 +2531,16 @@ function yl() {
|
|
|
2531
2531
|
}
|
|
2532
2532
|
function vl({ data: s }) {
|
|
2533
2533
|
var r;
|
|
2534
|
-
const [t, a] =
|
|
2534
|
+
const [t, a] = ke.useState([]), l = Object.keys(s[0]).map((o) => ({
|
|
2535
2535
|
// header: key,
|
|
2536
2536
|
accessorKey: o,
|
|
2537
|
-
header: ({ column:
|
|
2538
|
-
const p =
|
|
2537
|
+
header: ({ column: c }) => {
|
|
2538
|
+
const p = c.getIsSorted();
|
|
2539
2539
|
return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
|
|
2540
2540
|
"div",
|
|
2541
2541
|
{
|
|
2542
2542
|
className: "flex cursor-pointer items-center",
|
|
2543
|
-
onClick: () =>
|
|
2543
|
+
onClick: () => c.toggleSorting(c.getIsSorted() === "asc"),
|
|
2544
2544
|
children: [
|
|
2545
2545
|
o,
|
|
2546
2546
|
p === "asc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : p === "desc" ? /* @__PURE__ */ e.jsx(kt, { className: "ml-2 h-5 w-5" }) : null
|
|
@@ -2548,55 +2548,62 @@ function vl({ data: s }) {
|
|
|
2548
2548
|
}
|
|
2549
2549
|
) });
|
|
2550
2550
|
}
|
|
2551
|
-
})),
|
|
2551
|
+
})), d = zt({
|
|
2552
2552
|
data: s,
|
|
2553
2553
|
columns: l,
|
|
2554
|
-
getCoreRowModel:
|
|
2555
|
-
getPaginationRowModel:
|
|
2554
|
+
getCoreRowModel: Dt(),
|
|
2555
|
+
getPaginationRowModel: Tt(),
|
|
2556
2556
|
onSortingChange: a,
|
|
2557
|
-
getSortedRowModel:
|
|
2557
|
+
getSortedRowModel: Lt(),
|
|
2558
2558
|
manualPagination: !0,
|
|
2559
2559
|
state: {
|
|
2560
2560
|
sorting: t
|
|
2561
2561
|
}
|
|
2562
2562
|
});
|
|
2563
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2564
|
-
/* @__PURE__ */ e.jsx(
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2563
|
+
return /* @__PURE__ */ e.jsx("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
|
|
2564
|
+
/* @__PURE__ */ e.jsx(Ot, { children: d.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(Cs, { children: o.headers.map((c) => /* @__PURE__ */ e.jsx(
|
|
2565
|
+
Ft,
|
|
2566
|
+
{
|
|
2567
|
+
className: "sticky top-0 h-11 bg-muted font-semibold",
|
|
2568
|
+
children: c.isPlaceholder ? null : Ws(
|
|
2569
|
+
c.column.columnDef.header,
|
|
2570
|
+
c.getContext()
|
|
2571
|
+
)
|
|
2572
|
+
},
|
|
2573
|
+
c.id
|
|
2574
|
+
)) }, o.id)) }),
|
|
2575
|
+
/* @__PURE__ */ e.jsx(It, { children: (r = d.getRowModel().rows) != null && r.length ? d.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
|
|
2576
|
+
Cs,
|
|
2570
2577
|
{
|
|
2571
2578
|
className: "whitespace-nowrap py-2",
|
|
2572
2579
|
"data-state": o.getIsSelected() && "selected",
|
|
2573
|
-
children: o.getVisibleCells().map((
|
|
2580
|
+
children: o.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(Ys, { className: "py-3", children: Ws(c.column.columnDef.cell, c.getContext()) }, c.id))
|
|
2574
2581
|
},
|
|
2575
2582
|
o.id
|
|
2576
|
-
)) : /* @__PURE__ */ e.jsx(
|
|
2577
|
-
] });
|
|
2583
|
+
)) : /* @__PURE__ */ e.jsx(Cs, { children: /* @__PURE__ */ e.jsx(Ys, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2584
|
+
] }) });
|
|
2578
2585
|
}
|
|
2579
2586
|
function Cl({ card: s }) {
|
|
2580
|
-
var g,
|
|
2581
|
-
const { authToken: t } =
|
|
2582
|
-
colors: ((
|
|
2587
|
+
var g, h, j, C, F, y, T, I, A, N;
|
|
2588
|
+
const { authToken: t } = ze(), a = Mt(t == null ? void 0 : t.accessToken), n = z((S) => S.themeStyle), l = {
|
|
2589
|
+
colors: ((h = (g = n == null ? void 0 : n.chart) == null ? void 0 : g.dataset) == null ? void 0 : h.backgroundColor) || []
|
|
2583
2590
|
};
|
|
2584
2591
|
(j = s.customCardPreferences) != null && j.inputData;
|
|
2585
|
-
const { getCard:
|
|
2592
|
+
const { getCard: d } = ja(((C = s.customCardPreferences) == null ? void 0 : C.url) || ""), r = ((F = s.customCardPreferences) == null ? void 0 : F.visualType) || "single", o = m((S) => S.frame);
|
|
2586
2593
|
re();
|
|
2587
|
-
const { data:
|
|
2588
|
-
if (!((
|
|
2594
|
+
const { data: c } = Re(s);
|
|
2595
|
+
if (!((y = s.customCardPreferences) != null && y.componentName))
|
|
2589
2596
|
return null;
|
|
2590
|
-
const p =
|
|
2597
|
+
const p = d(
|
|
2591
2598
|
(T = s.customCardPreferences) == null ? void 0 : T.componentName
|
|
2592
2599
|
), u = (S) => {
|
|
2593
2600
|
console.log("data", S), s.customCardPreferences;
|
|
2594
|
-
},
|
|
2595
|
-
((
|
|
2601
|
+
}, b = Object.keys(
|
|
2602
|
+
((I = s.customCardPreferences) == null ? void 0 : I.dataInputCardIds) || {}
|
|
2596
2603
|
).map((S) => {
|
|
2597
2604
|
var v, f, k;
|
|
2598
|
-
const L = (f = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : f[S].cardId,
|
|
2599
|
-
return
|
|
2605
|
+
const L = (f = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : f[S].cardId, x = (k = o == null ? void 0 : o.cards) == null ? void 0 : k.find((M) => M.id === L);
|
|
2606
|
+
return x || null;
|
|
2600
2607
|
});
|
|
2601
2608
|
return /* @__PURE__ */ e.jsx("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs(
|
|
2602
2609
|
Nn,
|
|
@@ -2610,7 +2617,7 @@ function Cl({ card: s }) {
|
|
|
2610
2617
|
theme: l,
|
|
2611
2618
|
settings: (A = s.customCardPreferences) == null ? void 0 : A.settings,
|
|
2612
2619
|
onDataChange: u,
|
|
2613
|
-
data: (
|
|
2620
|
+
data: (c == null ? void 0 : c.records) || []
|
|
2614
2621
|
}
|
|
2615
2622
|
),
|
|
2616
2623
|
p && r === "multiple" && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
|
|
@@ -2618,13 +2625,13 @@ function Cl({ card: s }) {
|
|
|
2618
2625
|
{
|
|
2619
2626
|
theme: l,
|
|
2620
2627
|
onDataChange: u,
|
|
2621
|
-
settings:
|
|
2628
|
+
settings: b.map(
|
|
2622
2629
|
(S) => {
|
|
2623
2630
|
var L;
|
|
2624
2631
|
return (L = S == null ? void 0 : S.customCardPreferences) == null ? void 0 : L.settings;
|
|
2625
2632
|
}
|
|
2626
2633
|
),
|
|
2627
|
-
data:
|
|
2634
|
+
data: b.map((S) => (S == null ? void 0 : S.data) || [])
|
|
2628
2635
|
}
|
|
2629
2636
|
) })
|
|
2630
2637
|
]
|
|
@@ -2638,38 +2645,58 @@ function Ra({
|
|
|
2638
2645
|
className: s,
|
|
2639
2646
|
...t
|
|
2640
2647
|
}) {
|
|
2641
|
-
var
|
|
2642
|
-
const a = m((
|
|
2643
|
-
m((
|
|
2644
|
-
const { updateFilter: r } =
|
|
2648
|
+
var F;
|
|
2649
|
+
const a = m((y) => y.card), n = ((F = a.customCardPreferences) == null ? void 0 : F.showCardHeader) ?? !0, l = m((y) => y.frame), d = z((y) => y.dashboard.filters);
|
|
2650
|
+
m((y) => y.actions.setRunSql);
|
|
2651
|
+
const { updateFilter: r } = Fs(), o = d == null ? void 0 : d.find((y) => y.id === l.filterId), { data: c, isLoading: p, isFetching: u } = Re(a), { setCard: b } = re(), { data: g } = Hs(a);
|
|
2645
2652
|
if (!a.id) return null;
|
|
2646
|
-
let
|
|
2647
|
-
|
|
2648
|
-
data:
|
|
2653
|
+
let h;
|
|
2654
|
+
c != null && c.records && (c == null ? void 0 : c.records.length) > 0 && (h = ba({
|
|
2655
|
+
data: c == null ? void 0 : c.records,
|
|
2649
2656
|
cardType: a.type,
|
|
2650
2657
|
cfg: a.cfg,
|
|
2651
2658
|
customCfg: a.customCfg,
|
|
2652
2659
|
preferences: a.preferences,
|
|
2653
|
-
topoJson:
|
|
2660
|
+
topoJson: g
|
|
2654
2661
|
}));
|
|
2655
|
-
function
|
|
2656
|
-
return /* @__PURE__ */ e.jsx(Cl, { card:
|
|
2662
|
+
function j(y) {
|
|
2663
|
+
return /* @__PURE__ */ e.jsx(Cl, { card: y });
|
|
2664
|
+
}
|
|
2665
|
+
function C() {
|
|
2666
|
+
var y;
|
|
2667
|
+
if (c != null && c.records && (c == null ? void 0 : c.records.length) === 0 && !p && !u)
|
|
2668
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
|
|
2669
|
+
/* @__PURE__ */ e.jsx(Ht, { className: "size-8 text-muted-foreground" }),
|
|
2670
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
|
|
2671
|
+
] });
|
|
2672
|
+
if (a.type === "custom")
|
|
2673
|
+
return j(a);
|
|
2674
|
+
if (!["table", "custom"].includes(a.type) && h)
|
|
2675
|
+
return /* @__PURE__ */ e.jsx(
|
|
2676
|
+
$t,
|
|
2677
|
+
{
|
|
2678
|
+
cfg: h
|
|
2679
|
+
},
|
|
2680
|
+
JSON.stringify(h) + JSON.stringify(a.preferences) + ((y = a == null ? void 0 : a.preferences) == null ? void 0 : y.customVisualCode)
|
|
2681
|
+
);
|
|
2682
|
+
if (a.type === "table" && (c != null && c.records) && (c == null ? void 0 : c.records.length) > 0)
|
|
2683
|
+
return /* @__PURE__ */ e.jsx(Pt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Bt, { card: a, data: c == null ? void 0 : c.records }) });
|
|
2657
2684
|
}
|
|
2658
2685
|
return /* @__PURE__ */ e.jsxs(
|
|
2659
|
-
|
|
2686
|
+
Et,
|
|
2660
2687
|
{
|
|
2661
2688
|
role: "editor-visual-card",
|
|
2662
2689
|
className: Q("relative flex h-full flex-col rounded-none", s),
|
|
2663
2690
|
...t,
|
|
2664
2691
|
children: [
|
|
2665
|
-
n && /* @__PURE__ */ e.jsxs(
|
|
2692
|
+
n && /* @__PURE__ */ e.jsxs(At, { className: "flex flex-row items-start justify-between py-4", children: [
|
|
2666
2693
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2667
2694
|
/* @__PURE__ */ e.jsx(
|
|
2668
2695
|
ls,
|
|
2669
2696
|
{
|
|
2670
2697
|
text: a.title,
|
|
2671
|
-
onSave: (
|
|
2672
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(
|
|
2698
|
+
onSave: (y) => b({ ...a, title: y }),
|
|
2699
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(Vt, { className: "text-base", children: a.title || "Edit title..." }) })
|
|
2673
2700
|
},
|
|
2674
2701
|
a.title
|
|
2675
2702
|
),
|
|
@@ -2677,8 +2704,8 @@ function Ra({
|
|
|
2677
2704
|
ls,
|
|
2678
2705
|
{
|
|
2679
2706
|
text: a.description || "",
|
|
2680
|
-
onSave: (
|
|
2681
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2707
|
+
onSave: (y) => b({ ...a, description: y }),
|
|
2708
|
+
children: /* @__PURE__ */ e.jsx(qt, { children: a.description || "Edit description..." })
|
|
2682
2709
|
},
|
|
2683
2710
|
a.description
|
|
2684
2711
|
)
|
|
@@ -2689,41 +2716,29 @@ function Ra({
|
|
|
2689
2716
|
{
|
|
2690
2717
|
className: "my-1",
|
|
2691
2718
|
text: o.title || o.column,
|
|
2692
|
-
onSave: (
|
|
2719
|
+
onSave: (y) => r({ ...o, title: y }),
|
|
2693
2720
|
children: /* @__PURE__ */ e.jsx(R, { children: o.title })
|
|
2694
2721
|
}
|
|
2695
2722
|
),
|
|
2696
|
-
/* @__PURE__ */ e.jsx(
|
|
2723
|
+
/* @__PURE__ */ e.jsx(Rt, { filter: o })
|
|
2697
2724
|
] })
|
|
2698
2725
|
] }),
|
|
2699
|
-
/* @__PURE__ */ e.
|
|
2700
|
-
a.type === "custom" && g(a),
|
|
2701
|
-
!["table", "custom"].includes(a.type) && y && // <ChartJsVisual key={visualKey} cfg={cfg} />
|
|
2702
|
-
/* @__PURE__ */ e.jsx(
|
|
2703
|
-
$t,
|
|
2704
|
-
{
|
|
2705
|
-
cfg: y
|
|
2706
|
-
},
|
|
2707
|
-
JSON.stringify(y) + JSON.stringify(a.preferences) + ((j = a == null ? void 0 : a.preferences) == null ? void 0 : j.customVisualCode)
|
|
2708
|
-
),
|
|
2709
|
-
a.type === "table" && (d == null ? void 0 : d.records) && (d == null ? void 0 : d.records.length) > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
|
|
2710
|
-
/* @__PURE__ */ e.jsx(Pt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Bt, { card: a, data: d == null ? void 0 : d.records }) })
|
|
2711
|
-
] })
|
|
2726
|
+
/* @__PURE__ */ e.jsx(_t, { className: "flex grow flex-col", children: C() })
|
|
2712
2727
|
]
|
|
2713
2728
|
}
|
|
2714
2729
|
);
|
|
2715
2730
|
}
|
|
2716
2731
|
function Nl() {
|
|
2717
|
-
const [s, t] = q(!1), [a, n] = q(""), [l,
|
|
2732
|
+
const [s, t] = q(!1), [a, n] = q(""), [l, d] = q(""), [r, o] = q(""), [c, p] = q(""), u = m((N) => N.card), b = m(
|
|
2718
2733
|
(N) => N.card.customCfg
|
|
2719
|
-
), { data: g } =
|
|
2720
|
-
function
|
|
2721
|
-
var
|
|
2734
|
+
), { data: g } = Re(u), { data: h } = Hs(u), { setCardCustomCfg: j, setCustomVisualCode: C } = re();
|
|
2735
|
+
function F(N) {
|
|
2736
|
+
var x, v;
|
|
2722
2737
|
const S = {
|
|
2723
2738
|
...N,
|
|
2724
2739
|
data: {
|
|
2725
2740
|
...N == null ? void 0 : N.data,
|
|
2726
|
-
datasets: (v = (
|
|
2741
|
+
datasets: (v = (x = N == null ? void 0 : N.data) == null ? void 0 : x.datasets) == null ? void 0 : v.map((f) => ({
|
|
2727
2742
|
...f,
|
|
2728
2743
|
data: []
|
|
2729
2744
|
}))
|
|
@@ -2731,7 +2746,7 @@ function Nl() {
|
|
|
2731
2746
|
};
|
|
2732
2747
|
return JSON.stringify(S, null, 1);
|
|
2733
2748
|
}
|
|
2734
|
-
function
|
|
2749
|
+
function y() {
|
|
2735
2750
|
var S, L;
|
|
2736
2751
|
if (!(g != null && g.records) || (g == null ? void 0 : g.records.length) === 0) return;
|
|
2737
2752
|
const N = ba({
|
|
@@ -2739,49 +2754,49 @@ function Nl() {
|
|
|
2739
2754
|
cardType: u.type,
|
|
2740
2755
|
cfg: u.cfg,
|
|
2741
2756
|
preferences: u.preferences,
|
|
2742
|
-
topoJson:
|
|
2757
|
+
topoJson: h
|
|
2743
2758
|
});
|
|
2744
|
-
N && (n(JSON.stringify(N, null, 1)), (S = u == null ? void 0 : u.preferences) != null && S.customVisualCode && o((L = u == null ? void 0 : u.preferences) == null ? void 0 : L.customVisualCode),
|
|
2759
|
+
N && (n(JSON.stringify(N, null, 1)), (S = u == null ? void 0 : u.preferences) != null && S.customVisualCode && o((L = u == null ? void 0 : u.preferences) == null ? void 0 : L.customVisualCode), b && d(JSON.stringify(b, null, 1)));
|
|
2745
2760
|
}
|
|
2746
2761
|
function T() {
|
|
2747
|
-
if (r &&
|
|
2762
|
+
if (r && C(r), !!l)
|
|
2748
2763
|
try {
|
|
2749
2764
|
const N = JSON.parse(l);
|
|
2750
|
-
return N ? (j(N), p(""),
|
|
2765
|
+
return N ? (j(N), p(""), d(""), N) : void 0;
|
|
2751
2766
|
} catch (N) {
|
|
2752
2767
|
console.log(N), p("Invalid JSON");
|
|
2753
2768
|
}
|
|
2754
2769
|
}
|
|
2755
|
-
function
|
|
2756
|
-
|
|
2770
|
+
function I() {
|
|
2771
|
+
d(""), j(null);
|
|
2757
2772
|
}
|
|
2758
2773
|
function A() {
|
|
2759
2774
|
let N;
|
|
2760
|
-
if (
|
|
2761
|
-
const S = Xs.cloneDeep(u.cfg), L = Xs.merge(S,
|
|
2762
|
-
return N =
|
|
2775
|
+
if (b) {
|
|
2776
|
+
const S = Xs.cloneDeep(u.cfg), L = Xs.merge(S, b);
|
|
2777
|
+
return N = F(L), N;
|
|
2763
2778
|
}
|
|
2764
|
-
return a ? (N =
|
|
2779
|
+
return a ? (N = F(JSON.parse(a)), N) : "";
|
|
2765
2780
|
}
|
|
2766
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2767
|
-
/* @__PURE__ */ e.jsx(
|
|
2781
|
+
return /* @__PURE__ */ e.jsxs(Is, { open: s, onOpenChange: t, children: [
|
|
2782
|
+
/* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2768
2783
|
O,
|
|
2769
2784
|
{
|
|
2770
|
-
onClick:
|
|
2771
|
-
className: ` ${
|
|
2785
|
+
onClick: y,
|
|
2786
|
+
className: ` ${b && "border-foreground/50 dark:border-foreground/70"}`,
|
|
2772
2787
|
size: "sm",
|
|
2773
2788
|
variant: "outline",
|
|
2774
2789
|
children: /* @__PURE__ */ e.jsx(Ut, { className: "h-4 w-4" })
|
|
2775
2790
|
}
|
|
2776
2791
|
) }),
|
|
2777
2792
|
/* @__PURE__ */ e.jsxs(
|
|
2778
|
-
|
|
2793
|
+
Ls,
|
|
2779
2794
|
{
|
|
2780
2795
|
className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
|
|
2781
2796
|
children: [
|
|
2782
|
-
/* @__PURE__ */ e.jsxs(
|
|
2783
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2784
|
-
/* @__PURE__ */ e.jsxs(
|
|
2797
|
+
/* @__PURE__ */ e.jsxs(Ms, { className: "", children: [
|
|
2798
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(Es, { children: "Customize Card" }) }),
|
|
2799
|
+
/* @__PURE__ */ e.jsxs(As, { children: [
|
|
2785
2800
|
"See the configuration options and documentation",
|
|
2786
2801
|
/* @__PURE__ */ e.jsx(
|
|
2787
2802
|
"a",
|
|
@@ -2795,12 +2810,12 @@ function Nl() {
|
|
|
2795
2810
|
] })
|
|
2796
2811
|
] }),
|
|
2797
2812
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
2798
|
-
/* @__PURE__ */ e.jsx(
|
|
2813
|
+
/* @__PURE__ */ e.jsx(xs, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(Ra, { className: "w-1/2 rounded shadow-none" }) }),
|
|
2799
2814
|
/* @__PURE__ */ e.jsxs(va, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2800
2815
|
/* @__PURE__ */ e.jsxs(Ca, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
2801
2816
|
/* @__PURE__ */ e.jsxs(rs, { value: "custom-config", children: [
|
|
2802
|
-
|
|
2803
|
-
|
|
2817
|
+
b && /* @__PURE__ */ e.jsx(Na, { className: "mr-1 h-5 w-5 text-green-600" }),
|
|
2818
|
+
b ? "Custom Config" : "Default Config"
|
|
2804
2819
|
] }),
|
|
2805
2820
|
/* @__PURE__ */ e.jsx(rs, { className: "", value: "output", children: "Output" }),
|
|
2806
2821
|
/* @__PURE__ */ e.jsx(rs, { className: "", value: "custom-code", children: "Custom Code" })
|
|
@@ -2826,7 +2841,7 @@ function Nl() {
|
|
|
2826
2841
|
className: "mt-0 grow rounded-b border border-t-0",
|
|
2827
2842
|
value: "custom-config",
|
|
2828
2843
|
children: /* @__PURE__ */ e.jsx(
|
|
2829
|
-
|
|
2844
|
+
Ge,
|
|
2830
2845
|
{
|
|
2831
2846
|
className: "h-full w-full overflow-hidden",
|
|
2832
2847
|
theme: "default",
|
|
@@ -2844,7 +2859,7 @@ function Nl() {
|
|
|
2844
2859
|
},
|
|
2845
2860
|
defaultLanguage: "json",
|
|
2846
2861
|
value: A(),
|
|
2847
|
-
onChange: (N) =>
|
|
2862
|
+
onChange: (N) => d(N)
|
|
2848
2863
|
}
|
|
2849
2864
|
)
|
|
2850
2865
|
}
|
|
@@ -2855,7 +2870,7 @@ function Nl() {
|
|
|
2855
2870
|
className: "mt-0 grow rounded-b border border-t-0",
|
|
2856
2871
|
value: "custom-code",
|
|
2857
2872
|
children: /* @__PURE__ */ e.jsx(
|
|
2858
|
-
|
|
2873
|
+
Ge,
|
|
2859
2874
|
{
|
|
2860
2875
|
className: "h-full w-full overflow-hidden",
|
|
2861
2876
|
theme: "default",
|
|
@@ -2881,12 +2896,12 @@ function Nl() {
|
|
|
2881
2896
|
] })
|
|
2882
2897
|
] }),
|
|
2883
2898
|
/* @__PURE__ */ e.jsxs(la, { className: "flex items-center", children: [
|
|
2884
|
-
/* @__PURE__ */ e.jsx(R, { className: "mr-2 text-red-500", children:
|
|
2899
|
+
/* @__PURE__ */ e.jsx(R, { className: "mr-2 text-red-500", children: c }),
|
|
2885
2900
|
/* @__PURE__ */ e.jsx(
|
|
2886
2901
|
O,
|
|
2887
2902
|
{
|
|
2888
|
-
disabled: !
|
|
2889
|
-
onClick:
|
|
2903
|
+
disabled: !b,
|
|
2904
|
+
onClick: I,
|
|
2890
2905
|
variant: "outline",
|
|
2891
2906
|
children: "Reset"
|
|
2892
2907
|
}
|
|
@@ -2900,40 +2915,40 @@ function Nl() {
|
|
|
2900
2915
|
] });
|
|
2901
2916
|
}
|
|
2902
2917
|
function _a(s) {
|
|
2903
|
-
return
|
|
2918
|
+
return ge({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
|
|
2904
2919
|
}
|
|
2905
2920
|
function Ha(s) {
|
|
2906
|
-
return
|
|
2921
|
+
return ge({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24a8,8,0,0,0-8,8V88a8,8,0,0,0,8,8,32,32,0,1,1-27.72,16,8,8,0,0,0-2.93-10.93l-48.5-28A8,8,0,0,0,37.92,76,104,104,0,1,0,128,24ZM48.09,91.1,83,111.26A48.09,48.09,0,0,0,80,128c0,1.53.08,3,.22,4.52L41.28,143A88.16,88.16,0,0,1,48.09,91.1Zm-2.67,67.31,39-10.44A48.1,48.1,0,0,0,120,175.32v40.31A88.2,88.2,0,0,1,45.42,158.41ZM136,215.63V175.32a48,48,0,0,0,0-94.65V40.36a88,88,0,0,1,0,175.27Z" }, child: [] }] })(s);
|
|
2907
2922
|
}
|
|
2908
2923
|
function $a(s) {
|
|
2909
|
-
return
|
|
2924
|
+
return ge({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
|
|
2910
2925
|
}
|
|
2911
2926
|
function Pa(s) {
|
|
2912
|
-
return
|
|
2927
|
+
return ge({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
|
|
2913
2928
|
}
|
|
2914
2929
|
function Ba(s) {
|
|
2915
|
-
return
|
|
2930
|
+
return ge({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
|
|
2916
2931
|
}
|
|
2917
2932
|
function Ua(s) {
|
|
2918
|
-
return
|
|
2933
|
+
return ge({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
|
|
2919
2934
|
}
|
|
2920
2935
|
function Ga(s) {
|
|
2921
|
-
return
|
|
2936
|
+
return ge({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(s);
|
|
2922
2937
|
}
|
|
2923
2938
|
function Qa(s) {
|
|
2924
|
-
return
|
|
2939
|
+
return ge({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
|
|
2925
2940
|
}
|
|
2926
2941
|
function Ja(s) {
|
|
2927
2942
|
const [t, a] = q(null);
|
|
2928
2943
|
return Z(() => {
|
|
2929
2944
|
s && (async () => {
|
|
2930
|
-
const
|
|
2931
|
-
a(
|
|
2945
|
+
const d = (await import("./lucide-react-BOL6diSu.js"))[s];
|
|
2946
|
+
a(d);
|
|
2932
2947
|
})();
|
|
2933
2948
|
}, [s]), t;
|
|
2934
2949
|
}
|
|
2935
2950
|
function Ka() {
|
|
2936
|
-
const { authToken: s } =
|
|
2951
|
+
const { authToken: s } = ze(), { data: t, isLoading: a, isFetching: n, isError: l } = Ce({
|
|
2937
2952
|
queryKey: ["plugins", s == null ? void 0 : s.accessToken],
|
|
2938
2953
|
queryFn: () => Gt(s == null ? void 0 : s.accessToken)
|
|
2939
2954
|
// staleTime: Infinity,
|
|
@@ -2946,28 +2961,28 @@ function Sl({
|
|
|
2946
2961
|
const [t, a] = q([]), { data: n } = Ka();
|
|
2947
2962
|
return Z(() => {
|
|
2948
2963
|
(async () => {
|
|
2949
|
-
var
|
|
2964
|
+
var d;
|
|
2950
2965
|
if (n) {
|
|
2951
2966
|
const o = (await Promise.all(
|
|
2952
|
-
(
|
|
2953
|
-
name:
|
|
2954
|
-
icon:
|
|
2955
|
-
url:
|
|
2967
|
+
(d = n == null ? void 0 : n.plugins) == null ? void 0 : d.map(async (c) => (await Qt(c.value)).visuals.map((b) => ({
|
|
2968
|
+
name: b.name,
|
|
2969
|
+
icon: b.icon,
|
|
2970
|
+
url: c.value
|
|
2956
2971
|
})))
|
|
2957
2972
|
)).flat();
|
|
2958
2973
|
a(o);
|
|
2959
2974
|
}
|
|
2960
2975
|
})();
|
|
2961
2976
|
}, [n]), t.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2962
|
-
/* @__PURE__ */ e.jsx(
|
|
2963
|
-
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l,
|
|
2977
|
+
/* @__PURE__ */ e.jsx(we, { className: "my-2" }),
|
|
2978
|
+
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, d) => /* @__PURE__ */ e.jsx(
|
|
2964
2979
|
wl,
|
|
2965
2980
|
{
|
|
2966
2981
|
text: l.name,
|
|
2967
2982
|
onClick: () => s("custom", l),
|
|
2968
2983
|
icon: l.icon
|
|
2969
2984
|
},
|
|
2970
|
-
l.url + l.name +
|
|
2985
|
+
l.url + l.name + d
|
|
2971
2986
|
)) })
|
|
2972
2987
|
] });
|
|
2973
2988
|
}
|
|
@@ -2980,28 +2995,28 @@ const wl = ({
|
|
|
2980
2995
|
return /* @__PURE__ */ e.jsx(O, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
|
|
2981
2996
|
};
|
|
2982
2997
|
function kl() {
|
|
2983
|
-
var u,
|
|
2984
|
-
const [s, t] = q(!1), a = m((g) => g.card), n = a.type, { setCardType: l, setCardPreferences:
|
|
2985
|
-
function p(g,
|
|
2986
|
-
o(null),
|
|
2998
|
+
var u, b;
|
|
2999
|
+
const [s, t] = q(!1), a = m((g) => g.card), n = a.type, { setCardType: l, setCardPreferences: d, setChartOrientation: r } = m((g) => g.actions), { setCardCustomCfg: o, setCustomCardPreferences: c } = re();
|
|
3000
|
+
function p(g, h) {
|
|
3001
|
+
o(null), d({}), l(g), h && c({
|
|
2987
3002
|
type: "component",
|
|
2988
3003
|
visualType: "single",
|
|
2989
|
-
url:
|
|
2990
|
-
componentName:
|
|
2991
|
-
icon:
|
|
3004
|
+
url: h.url,
|
|
3005
|
+
componentName: h.name,
|
|
3006
|
+
icon: h.icon
|
|
2992
3007
|
}), t(!1);
|
|
2993
3008
|
}
|
|
2994
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2995
|
-
/* @__PURE__ */ e.jsx(
|
|
3009
|
+
return /* @__PURE__ */ e.jsxs(ps, { open: s, onOpenChange: t, children: [
|
|
3010
|
+
/* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
|
|
2996
3011
|
zl,
|
|
2997
3012
|
{
|
|
2998
3013
|
className: "h-4 w-4",
|
|
2999
3014
|
chartType: n,
|
|
3000
3015
|
customIcon: (u = a.customCardPreferences) == null ? void 0 : u.icon,
|
|
3001
|
-
componentName: (
|
|
3016
|
+
componentName: (b = a.customCardPreferences) == null ? void 0 : b.componentName
|
|
3002
3017
|
}
|
|
3003
3018
|
) }) }),
|
|
3004
|
-
/* @__PURE__ */ e.jsxs(
|
|
3019
|
+
/* @__PURE__ */ e.jsxs(gs, { className: "w-50", children: [
|
|
3005
3020
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-4 place-items-center", children: [
|
|
3006
3021
|
/* @__PURE__ */ e.jsx(
|
|
3007
3022
|
O,
|
|
@@ -3009,7 +3024,7 @@ function kl() {
|
|
|
3009
3024
|
onClick: () => p("bar"),
|
|
3010
3025
|
className: "font-normal",
|
|
3011
3026
|
variant: "ghost",
|
|
3012
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3027
|
+
children: /* @__PURE__ */ e.jsx(Bs, { className: "size-5" })
|
|
3013
3028
|
}
|
|
3014
3029
|
),
|
|
3015
3030
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3017,7 +3032,7 @@ function kl() {
|
|
|
3017
3032
|
{
|
|
3018
3033
|
onClick: () => p("line"),
|
|
3019
3034
|
variant: "ghost",
|
|
3020
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3035
|
+
children: /* @__PURE__ */ e.jsx(Us, { className: "size-5" })
|
|
3021
3036
|
}
|
|
3022
3037
|
),
|
|
3023
3038
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3111,7 +3126,7 @@ function kl() {
|
|
|
3111
3126
|
{
|
|
3112
3127
|
onClick: () => p("table"),
|
|
3113
3128
|
variant: "ghost",
|
|
3114
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3129
|
+
children: /* @__PURE__ */ e.jsx(Vs, { className: "size-5" })
|
|
3115
3130
|
}
|
|
3116
3131
|
),
|
|
3117
3132
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3127,7 +3142,7 @@ function kl() {
|
|
|
3127
3142
|
{
|
|
3128
3143
|
onClick: () => p("text"),
|
|
3129
3144
|
variant: "ghost",
|
|
3130
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3145
|
+
children: /* @__PURE__ */ e.jsx(Gs, { className: "size-4" })
|
|
3131
3146
|
}
|
|
3132
3147
|
),
|
|
3133
3148
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3160,9 +3175,9 @@ function zl({
|
|
|
3160
3175
|
const l = Ja(a || "");
|
|
3161
3176
|
switch (s) {
|
|
3162
3177
|
case "bar":
|
|
3163
|
-
return /* @__PURE__ */ e.jsx(Ps, { className: t });
|
|
3164
|
-
case "line":
|
|
3165
3178
|
return /* @__PURE__ */ e.jsx(Bs, { className: t });
|
|
3179
|
+
case "line":
|
|
3180
|
+
return /* @__PURE__ */ e.jsx(Us, { className: t });
|
|
3166
3181
|
case "pie":
|
|
3167
3182
|
return /* @__PURE__ */ e.jsx(Oa, { className: t });
|
|
3168
3183
|
case "radar":
|
|
@@ -3186,13 +3201,13 @@ function zl({
|
|
|
3186
3201
|
case "kpi":
|
|
3187
3202
|
return /* @__PURE__ */ e.jsx(Ga, { className: t });
|
|
3188
3203
|
case "text":
|
|
3189
|
-
return /* @__PURE__ */ e.jsx(
|
|
3204
|
+
return /* @__PURE__ */ e.jsx(Gs, { className: t });
|
|
3190
3205
|
case "map":
|
|
3191
3206
|
return /* @__PURE__ */ e.jsx(Da, { className: t });
|
|
3192
3207
|
case "custom":
|
|
3193
3208
|
return a && l ? /* @__PURE__ */ e.jsx(l, { className: t }) : n ? n == null ? void 0 : n.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(La, { className: t });
|
|
3194
3209
|
default:
|
|
3195
|
-
return /* @__PURE__ */ e.jsx(
|
|
3210
|
+
return /* @__PURE__ */ e.jsx(Vs, { className: t });
|
|
3196
3211
|
}
|
|
3197
3212
|
}
|
|
3198
3213
|
function Ol() {
|
|
@@ -3204,7 +3219,7 @@ function Ol() {
|
|
|
3204
3219
|
Jt,
|
|
3205
3220
|
{
|
|
3206
3221
|
onClick: () => {
|
|
3207
|
-
navigator.clipboard.writeText(s.id),
|
|
3222
|
+
navigator.clipboard.writeText(s.id), We.success("Card ID copied to clipboard");
|
|
3208
3223
|
},
|
|
3209
3224
|
className: "cursor-pointer space-x-2",
|
|
3210
3225
|
children: [
|
|
@@ -3216,14 +3231,14 @@ function Ol() {
|
|
|
3216
3231
|
] });
|
|
3217
3232
|
}
|
|
3218
3233
|
function ta() {
|
|
3219
|
-
const s = m((
|
|
3220
|
-
m((
|
|
3221
|
-
const { setFrame: o, setCard:
|
|
3234
|
+
const s = m((x) => x.frame), t = m((x) => x.card), a = m((x) => x.isShowingVisual), n = m((x) => x.isSqlRunning), l = m((x) => x.queryError), d = m((x) => x.pythonStdOut), r = m((x) => x.actions.setRunSql);
|
|
3235
|
+
m((x) => x.onSave), m((x) => x.onClose), m((x) => x.actions.setCardSql), m((x) => x.actions.setCardType), m((x) => x.actions.setSqlGen);
|
|
3236
|
+
const { setFrame: o, setCard: c, updateCardInFrame: p } = re(), { data: u, isLoading: b, isFetching: g } = Re(t);
|
|
3222
3237
|
if (!t) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
3223
|
-
function
|
|
3224
|
-
const
|
|
3238
|
+
function h() {
|
|
3239
|
+
const x = {
|
|
3225
3240
|
connectionId: t.connectionId,
|
|
3226
|
-
id:
|
|
3241
|
+
id: Ke(),
|
|
3227
3242
|
title: "Title",
|
|
3228
3243
|
description: "Description",
|
|
3229
3244
|
preferences: {
|
|
@@ -3238,61 +3253,61 @@ function ta() {
|
|
|
3238
3253
|
sql: "",
|
|
3239
3254
|
data: []
|
|
3240
3255
|
};
|
|
3241
|
-
j(
|
|
3256
|
+
j(x);
|
|
3242
3257
|
}
|
|
3243
|
-
function j(
|
|
3258
|
+
function j(x) {
|
|
3244
3259
|
const v = {
|
|
3245
3260
|
...s,
|
|
3246
|
-
cards: [...s.cards,
|
|
3247
|
-
activeCardId:
|
|
3261
|
+
cards: [...s.cards, x],
|
|
3262
|
+
activeCardId: x.id
|
|
3248
3263
|
};
|
|
3249
|
-
o(v),
|
|
3264
|
+
o(v), c(x);
|
|
3250
3265
|
}
|
|
3251
|
-
function
|
|
3252
|
-
const
|
|
3266
|
+
function C() {
|
|
3267
|
+
const x = {
|
|
3253
3268
|
...t,
|
|
3254
|
-
id:
|
|
3269
|
+
id: Ke(),
|
|
3255
3270
|
title: `${t.title} Copy`,
|
|
3256
|
-
tabTitle: `${t.tabTitle} Copy`
|
|
3271
|
+
tabTitle: `${t.tabTitle || t.title} Copy`
|
|
3257
3272
|
};
|
|
3258
|
-
j(
|
|
3273
|
+
j(x);
|
|
3259
3274
|
}
|
|
3260
|
-
function
|
|
3261
|
-
const v = s.cards.filter((M) => M.id !==
|
|
3275
|
+
function F(x) {
|
|
3276
|
+
const v = s.cards.filter((M) => M.id !== x), f = v[0], k = {
|
|
3262
3277
|
...s,
|
|
3263
3278
|
cards: v,
|
|
3264
3279
|
// update the active card to the first card in the frame
|
|
3265
3280
|
activeCardId: f.id
|
|
3266
3281
|
};
|
|
3267
|
-
o(k),
|
|
3282
|
+
o(k), c(f);
|
|
3268
3283
|
}
|
|
3269
|
-
function
|
|
3284
|
+
function y(x) {
|
|
3270
3285
|
const v = {
|
|
3271
3286
|
...s,
|
|
3272
3287
|
cards: s.cards.map((k) => k.id === t.id ? t : k),
|
|
3273
|
-
activeCardId:
|
|
3288
|
+
activeCardId: x
|
|
3274
3289
|
};
|
|
3275
3290
|
o(v);
|
|
3276
|
-
const f = v.cards.find((k) => k.id ===
|
|
3277
|
-
f.sql && r(!0),
|
|
3291
|
+
const f = v.cards.find((k) => k.id === x);
|
|
3292
|
+
f.sql && r(!0), c(f);
|
|
3278
3293
|
}
|
|
3279
|
-
const T = (
|
|
3280
|
-
console.log("handleDragStart", v),
|
|
3281
|
-
},
|
|
3282
|
-
|
|
3283
|
-
}, A = (
|
|
3284
|
-
const f =
|
|
3294
|
+
const T = (x, v) => {
|
|
3295
|
+
console.log("handleDragStart", v), x.dataTransfer.setData("tabIndex", v.toString());
|
|
3296
|
+
}, I = (x) => {
|
|
3297
|
+
x.preventDefault();
|
|
3298
|
+
}, A = (x, v) => {
|
|
3299
|
+
const f = x.dataTransfer.getData("tabIndex");
|
|
3285
3300
|
if (f === v.toString()) return;
|
|
3286
3301
|
const k = Array.from(s.cards), [M] = k.splice(parseInt(f), 1);
|
|
3287
3302
|
k.splice(v, 0, M), o({ ...s, cards: k });
|
|
3288
3303
|
};
|
|
3289
|
-
function N(
|
|
3290
|
-
return
|
|
3304
|
+
function N(x, v) {
|
|
3305
|
+
return x.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || x.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
|
|
3291
3306
|
"div",
|
|
3292
3307
|
{
|
|
3293
3308
|
onClick: () => {
|
|
3294
3309
|
const f = v.displayTab === void 0 ? !1 : !v.displayTab;
|
|
3295
|
-
|
|
3310
|
+
c({ ...v, displayTab: f }), p({
|
|
3296
3311
|
...v,
|
|
3297
3312
|
displayTab: f
|
|
3298
3313
|
});
|
|
@@ -3305,51 +3320,51 @@ function ta() {
|
|
|
3305
3320
|
return /* @__PURE__ */ e.jsxs(
|
|
3306
3321
|
va,
|
|
3307
3322
|
{
|
|
3308
|
-
onValueChange:
|
|
3323
|
+
onValueChange: y,
|
|
3309
3324
|
value: s.activeCardId,
|
|
3310
3325
|
className: "flex grow flex-col",
|
|
3311
3326
|
children: [
|
|
3312
|
-
s.cards.map((
|
|
3327
|
+
s.cards.map((x) => /* @__PURE__ */ e.jsx(is, { className: "mt-0 grow", value: x.id, children: L() }, x.id)),
|
|
3313
3328
|
/* @__PURE__ */ e.jsx(Ca, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
3314
|
-
s.cards.map((
|
|
3329
|
+
s.cards.map((x, v) => /* @__PURE__ */ e.jsx(
|
|
3315
3330
|
ls,
|
|
3316
3331
|
{
|
|
3317
|
-
text:
|
|
3332
|
+
text: x.tabTitle || x.title,
|
|
3318
3333
|
onSave: (f) => {
|
|
3319
|
-
|
|
3334
|
+
c({ ...t, tabTitle: f }), p({ ...t, tabTitle: f });
|
|
3320
3335
|
},
|
|
3321
3336
|
children: /* @__PURE__ */ e.jsxs(
|
|
3322
3337
|
rs,
|
|
3323
3338
|
{
|
|
3324
3339
|
draggable: !0,
|
|
3325
3340
|
onDragStart: (f) => T(f, v),
|
|
3326
|
-
onDragOver:
|
|
3341
|
+
onDragOver: I,
|
|
3327
3342
|
onDrop: (f) => A(f, v),
|
|
3328
3343
|
className: "",
|
|
3329
|
-
value:
|
|
3344
|
+
value: x.id,
|
|
3330
3345
|
children: [
|
|
3331
|
-
N(s,
|
|
3332
|
-
|
|
3333
|
-
s.activeCardId ===
|
|
3346
|
+
N(s, x),
|
|
3347
|
+
x.tabTitle || x.title,
|
|
3348
|
+
s.activeCardId === x.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
|
|
3334
3349
|
Sa,
|
|
3335
3350
|
{
|
|
3336
3351
|
className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
|
|
3337
|
-
onClick: () =>
|
|
3352
|
+
onClick: () => F(x.id)
|
|
3338
3353
|
}
|
|
3339
3354
|
)
|
|
3340
3355
|
]
|
|
3341
3356
|
}
|
|
3342
3357
|
)
|
|
3343
3358
|
},
|
|
3344
|
-
|
|
3359
|
+
x.id
|
|
3345
3360
|
)),
|
|
3346
3361
|
/* @__PURE__ */ e.jsx(
|
|
3347
3362
|
O,
|
|
3348
3363
|
{
|
|
3349
3364
|
className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
|
|
3350
3365
|
variant: "outline",
|
|
3351
|
-
onClick:
|
|
3352
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3366
|
+
onClick: h,
|
|
3367
|
+
children: /* @__PURE__ */ e.jsx(Ts, { className: "h-4 w-4" })
|
|
3353
3368
|
}
|
|
3354
3369
|
),
|
|
3355
3370
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3357,7 +3372,7 @@ function ta() {
|
|
|
3357
3372
|
{
|
|
3358
3373
|
className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
|
|
3359
3374
|
variant: "outline",
|
|
3360
|
-
onClick:
|
|
3375
|
+
onClick: C,
|
|
3361
3376
|
children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4" })
|
|
3362
3377
|
}
|
|
3363
3378
|
)
|
|
@@ -3367,17 +3382,17 @@ function ta() {
|
|
|
3367
3382
|
);
|
|
3368
3383
|
}
|
|
3369
3384
|
function L() {
|
|
3370
|
-
return t.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Kt, { card: t, data: u == null ? void 0 : u.records }) }) }) : t.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(
|
|
3385
|
+
return t.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Kt, { card: t, data: u == null ? void 0 : u.records }) }) }) : t.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(De, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
|
|
3371
3386
|
Wt,
|
|
3372
3387
|
{
|
|
3373
3388
|
isLoading: n,
|
|
3374
3389
|
card: t,
|
|
3375
3390
|
data: u == null ? void 0 : u.records
|
|
3376
3391
|
}
|
|
3377
|
-
) }) }) }) : /* @__PURE__ */ e.jsx(
|
|
3392
|
+
) }) }) }) : /* @__PURE__ */ e.jsx(xs, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(Ra, { className: "grow border-none shadow-none" }) });
|
|
3378
3393
|
}
|
|
3379
3394
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
|
|
3380
|
-
(
|
|
3395
|
+
(b || g) && /* @__PURE__ */ e.jsx(qe, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
3381
3396
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
3382
3397
|
a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
3383
3398
|
/* @__PURE__ */ e.jsx(kl, {}),
|
|
@@ -3386,27 +3401,55 @@ function ta() {
|
|
|
3386
3401
|
] }),
|
|
3387
3402
|
/* @__PURE__ */ e.jsx(Il, {})
|
|
3388
3403
|
] }),
|
|
3389
|
-
a ? S() : /* @__PURE__ */ e.jsxs(
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3404
|
+
a ? S() : /* @__PURE__ */ e.jsxs(
|
|
3405
|
+
cs,
|
|
3406
|
+
{
|
|
3407
|
+
className: "px-6",
|
|
3408
|
+
direction: "horizontal",
|
|
3409
|
+
children: [
|
|
3410
|
+
d && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3411
|
+
/* @__PURE__ */ e.jsx(
|
|
3412
|
+
Ne,
|
|
3413
|
+
{
|
|
3414
|
+
id: "1",
|
|
3415
|
+
order: 1,
|
|
3416
|
+
defaultSize: 30,
|
|
3417
|
+
minSize: 10,
|
|
3418
|
+
className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
|
|
3419
|
+
children: d && /* @__PURE__ */ e.jsx(Fl, {})
|
|
3420
|
+
}
|
|
3421
|
+
),
|
|
3422
|
+
/* @__PURE__ */ e.jsx(ds, {})
|
|
3423
|
+
] }),
|
|
3424
|
+
/* @__PURE__ */ e.jsx(
|
|
3425
|
+
Ne,
|
|
3426
|
+
{
|
|
3427
|
+
id: "2",
|
|
3428
|
+
order: 2,
|
|
3429
|
+
minSize: 10,
|
|
3430
|
+
className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
|
|
3431
|
+
children: /* @__PURE__ */ e.jsxs(De, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
|
|
3432
|
+
(u == null ? void 0 : u.records) && (u == null ? void 0 : u.records.length) > 0 && /* @__PURE__ */ e.jsx(vl, { data: (u == null ? void 0 : u.records) || [] }),
|
|
3433
|
+
l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: l }),
|
|
3434
|
+
/* @__PURE__ */ e.jsx(os, { orientation: "horizontal" })
|
|
3435
|
+
] })
|
|
3436
|
+
}
|
|
3437
|
+
)
|
|
3438
|
+
]
|
|
3439
|
+
}
|
|
3440
|
+
)
|
|
3394
3441
|
] });
|
|
3395
3442
|
}
|
|
3396
3443
|
function Fl() {
|
|
3397
3444
|
const s = m((a) => a.pythonStdOut);
|
|
3398
3445
|
if (!s) return null;
|
|
3399
3446
|
const t = s.replace(/\n/g, "<br>");
|
|
3400
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3401
|
-
/* @__PURE__ */ e.jsx("
|
|
3402
|
-
/* @__PURE__ */ e.
|
|
3403
|
-
"div",
|
|
3404
|
-
{
|
|
3405
|
-
|
|
3406
|
-
className: "bg-muted p-2 font-mono text-sm"
|
|
3407
|
-
}
|
|
3408
|
-
),
|
|
3409
|
-
/* @__PURE__ */ e.jsx(ge, { className: "mb-2" })
|
|
3447
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex w-full flex-col border-r", children: [
|
|
3448
|
+
/* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex max-h-11 min-h-11 grow items-center border-b bg-muted px-3 font-mono text-xs font-semibold text-foreground/70", children: "Python Output" }),
|
|
3449
|
+
/* @__PURE__ */ e.jsxs(De, { className: "overflow-y-auto px-2 pt-1 font-mono text-xs text-foreground/90", children: [
|
|
3450
|
+
/* @__PURE__ */ e.jsx("div", { dangerouslySetInnerHTML: { __html: t } }),
|
|
3451
|
+
/* @__PURE__ */ e.jsx(os, { orientation: "horizontal" })
|
|
3452
|
+
] })
|
|
3410
3453
|
] });
|
|
3411
3454
|
}
|
|
3412
3455
|
function Il() {
|
|
@@ -3432,14 +3475,14 @@ function Dl({
|
|
|
3432
3475
|
onValueChange: a
|
|
3433
3476
|
}) {
|
|
3434
3477
|
return /* @__PURE__ */ e.jsx(
|
|
3435
|
-
|
|
3478
|
+
js,
|
|
3436
3479
|
{
|
|
3437
3480
|
value: t,
|
|
3438
3481
|
onValueChange: a,
|
|
3439
3482
|
className: "flex gap-4",
|
|
3440
3483
|
defaultValue: s[0].value,
|
|
3441
3484
|
children: s.map((n) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3442
|
-
/* @__PURE__ */ e.jsx(
|
|
3485
|
+
/* @__PURE__ */ e.jsx(Te, { value: n.value, id: n.value }),
|
|
3443
3486
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: n.value, children: n.label })
|
|
3444
3487
|
] }, n.value))
|
|
3445
3488
|
}
|
|
@@ -3462,11 +3505,11 @@ function ue({
|
|
|
3462
3505
|
),
|
|
3463
3506
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3464
3507
|
/* @__PURE__ */ e.jsx(fe, { children: s }),
|
|
3465
|
-
t.map((
|
|
3508
|
+
t.map((d) => /* @__PURE__ */ e.jsx(K, { value: d.value, children: d.label }, d.value))
|
|
3466
3509
|
] }) })
|
|
3467
3510
|
] });
|
|
3468
3511
|
}
|
|
3469
|
-
function
|
|
3512
|
+
function Qe({
|
|
3470
3513
|
children: s,
|
|
3471
3514
|
summary: t,
|
|
3472
3515
|
open: a,
|
|
@@ -3488,19 +3531,19 @@ function Ge({
|
|
|
3488
3531
|
);
|
|
3489
3532
|
}
|
|
3490
3533
|
function Tl() {
|
|
3491
|
-
var
|
|
3534
|
+
var C, F;
|
|
3492
3535
|
const s = m(
|
|
3493
|
-
(
|
|
3494
|
-
), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((
|
|
3536
|
+
(y) => y.card.customCardPreferences
|
|
3537
|
+
), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((y) => y.card), l = m((y) => y.frame), d = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: r } = re(), { components: o, manifest: c } = ja(
|
|
3495
3538
|
(s == null ? void 0 : s.url) || ""
|
|
3496
|
-
), p = (
|
|
3497
|
-
(
|
|
3539
|
+
), p = (C = c == null ? void 0 : c.visuals) == null ? void 0 : C.find(
|
|
3540
|
+
(y) => y.name === (s == null ? void 0 : s.componentName)
|
|
3498
3541
|
);
|
|
3499
|
-
function u(
|
|
3542
|
+
function u(y, T) {
|
|
3500
3543
|
if (!s) return;
|
|
3501
3544
|
const A = {
|
|
3502
3545
|
...(s == null ? void 0 : s.dataInputCardIds) || {},
|
|
3503
|
-
[
|
|
3546
|
+
[y]: {
|
|
3504
3547
|
cardId: T,
|
|
3505
3548
|
hookRef: null
|
|
3506
3549
|
}
|
|
@@ -3510,17 +3553,17 @@ function Tl() {
|
|
|
3510
3553
|
dataInputCardIds: A
|
|
3511
3554
|
});
|
|
3512
3555
|
}
|
|
3513
|
-
function y
|
|
3514
|
-
var
|
|
3515
|
-
const T = (
|
|
3556
|
+
function b(y) {
|
|
3557
|
+
var I, A;
|
|
3558
|
+
const T = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((N) => {
|
|
3516
3559
|
var S;
|
|
3517
3560
|
return ((S = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : S.visualType) !== "multiple";
|
|
3518
3561
|
}).map((N) => ({
|
|
3519
3562
|
value: N.id,
|
|
3520
3563
|
label: N.tabTitle || N.title
|
|
3521
3564
|
}));
|
|
3522
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (A =
|
|
3523
|
-
var L,
|
|
3565
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (A = y == null ? void 0 : y.dataInputs) == null ? void 0 : A.map((N, S) => {
|
|
3566
|
+
var L, x;
|
|
3524
3567
|
return /* @__PURE__ */ e.jsxs(
|
|
3525
3568
|
"div",
|
|
3526
3569
|
{
|
|
@@ -3533,7 +3576,7 @@ function Tl() {
|
|
|
3533
3576
|
className: "col-span-6 h-8 w-full justify-between",
|
|
3534
3577
|
label: "",
|
|
3535
3578
|
options: T || [],
|
|
3536
|
-
value: ((
|
|
3579
|
+
value: ((x = (L = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : L[S]) == null ? void 0 : x.cardId) || "",
|
|
3537
3580
|
onValueChange: (v) => u(S, v)
|
|
3538
3581
|
}
|
|
3539
3582
|
)
|
|
@@ -3543,12 +3586,12 @@ function Tl() {
|
|
|
3543
3586
|
);
|
|
3544
3587
|
}) });
|
|
3545
3588
|
}
|
|
3546
|
-
function g(
|
|
3589
|
+
function g(y, T, I = []) {
|
|
3547
3590
|
var A, N;
|
|
3548
|
-
return s ?
|
|
3591
|
+
return s ? y === "input" ? /* @__PURE__ */ e.jsx(
|
|
3549
3592
|
le,
|
|
3550
3593
|
{
|
|
3551
|
-
className: `h-8 w-full ${
|
|
3594
|
+
className: `h-8 w-full ${Ue}`,
|
|
3552
3595
|
value: ((A = s == null ? void 0 : s.settings) == null ? void 0 : A[T]) || "",
|
|
3553
3596
|
onChange: (S) => {
|
|
3554
3597
|
r({
|
|
@@ -3561,12 +3604,12 @@ function Tl() {
|
|
|
3561
3604
|
}
|
|
3562
3605
|
},
|
|
3563
3606
|
T
|
|
3564
|
-
) :
|
|
3607
|
+
) : y === "select" ? /* @__PURE__ */ e.jsx(
|
|
3565
3608
|
ue,
|
|
3566
3609
|
{
|
|
3567
3610
|
className: "h-8 w-full",
|
|
3568
3611
|
label: "",
|
|
3569
|
-
options:
|
|
3612
|
+
options: I,
|
|
3570
3613
|
value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[T]) || "",
|
|
3571
3614
|
onValueChange: (S) => {
|
|
3572
3615
|
r({
|
|
@@ -3577,21 +3620,21 @@ function Tl() {
|
|
|
3577
3620
|
}
|
|
3578
3621
|
) : null : null;
|
|
3579
3622
|
}
|
|
3580
|
-
function
|
|
3581
|
-
const T = Object.entries((
|
|
3582
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: T.map(([
|
|
3623
|
+
function h(y) {
|
|
3624
|
+
const T = Object.entries((y == null ? void 0 : y.settings) || {});
|
|
3625
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: T.map(([I, A]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3583
3626
|
/* @__PURE__ */ e.jsx(R, { children: A.title }),
|
|
3584
3627
|
g(
|
|
3585
3628
|
A.ui,
|
|
3586
|
-
|
|
3629
|
+
I,
|
|
3587
3630
|
A.options
|
|
3588
3631
|
)
|
|
3589
|
-
] },
|
|
3632
|
+
] }, I)) });
|
|
3590
3633
|
}
|
|
3591
|
-
function j(
|
|
3634
|
+
function j(y) {
|
|
3592
3635
|
s && r({
|
|
3593
3636
|
...s,
|
|
3594
|
-
visualType:
|
|
3637
|
+
visualType: y,
|
|
3595
3638
|
componentName: ""
|
|
3596
3639
|
});
|
|
3597
3640
|
}
|
|
@@ -3600,7 +3643,7 @@ function Tl() {
|
|
|
3600
3643
|
{
|
|
3601
3644
|
className: "p-6",
|
|
3602
3645
|
children: [
|
|
3603
|
-
/* @__PURE__ */ e.jsx(
|
|
3646
|
+
/* @__PURE__ */ e.jsx(Qe, { summary: "Plugin Settings", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 text-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 text-sm", children: [
|
|
3604
3647
|
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3605
3648
|
ue,
|
|
3606
3649
|
{
|
|
@@ -3608,12 +3651,12 @@ function Tl() {
|
|
|
3608
3651
|
label: "",
|
|
3609
3652
|
options: a,
|
|
3610
3653
|
value: (s == null ? void 0 : s.url) || "",
|
|
3611
|
-
onValueChange: (
|
|
3654
|
+
onValueChange: (y) => r({
|
|
3612
3655
|
...s || {
|
|
3613
3656
|
url: "",
|
|
3614
3657
|
componentName: ""
|
|
3615
3658
|
},
|
|
3616
|
-
url:
|
|
3659
|
+
url: y
|
|
3617
3660
|
})
|
|
3618
3661
|
}
|
|
3619
3662
|
) }) }),
|
|
@@ -3624,7 +3667,7 @@ function Tl() {
|
|
|
3624
3667
|
{ value: "single", label: "Single Visual" },
|
|
3625
3668
|
{ value: "multiple", label: "Multi-Visual" }
|
|
3626
3669
|
],
|
|
3627
|
-
value:
|
|
3670
|
+
value: d,
|
|
3628
3671
|
onValueChange: j
|
|
3629
3672
|
}
|
|
3630
3673
|
),
|
|
@@ -3636,53 +3679,53 @@ function Tl() {
|
|
|
3636
3679
|
className: "h-8 w-full",
|
|
3637
3680
|
label: "",
|
|
3638
3681
|
options: (o == null ? void 0 : o.filter(
|
|
3639
|
-
(
|
|
3640
|
-
).map((
|
|
3641
|
-
value:
|
|
3642
|
-
label:
|
|
3682
|
+
(y) => y.type === d
|
|
3683
|
+
).map((y) => ({
|
|
3684
|
+
value: y.name,
|
|
3685
|
+
label: y.name
|
|
3643
3686
|
}))) || [],
|
|
3644
3687
|
value: s.componentName,
|
|
3645
|
-
onValueChange: (
|
|
3646
|
-
console.log("changing value",
|
|
3688
|
+
onValueChange: (y) => {
|
|
3689
|
+
console.log("changing value", y), r({
|
|
3647
3690
|
...s,
|
|
3648
|
-
componentName:
|
|
3691
|
+
componentName: y
|
|
3649
3692
|
});
|
|
3650
3693
|
}
|
|
3651
3694
|
}
|
|
3652
3695
|
) })
|
|
3653
3696
|
] }) })
|
|
3654
3697
|
] }) }) }),
|
|
3655
|
-
/* @__PURE__ */ e.jsx(
|
|
3656
|
-
((
|
|
3698
|
+
/* @__PURE__ */ e.jsx(we, { className: "my-4" }),
|
|
3699
|
+
((F = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : F.componentName) && /* @__PURE__ */ e.jsxs(Qe, { summary: "Component Settings", children: [
|
|
3657
3700
|
p && p.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
3658
3701
|
/* @__PURE__ */ e.jsx(R, { children: "Input Mapping" }),
|
|
3659
|
-
/* @__PURE__ */ e.jsx("div", { className: "px-2", children:
|
|
3702
|
+
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: b(p) })
|
|
3660
3703
|
] }),
|
|
3661
|
-
p && p.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children:
|
|
3704
|
+
p && p.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: h(p) }) })
|
|
3662
3705
|
] })
|
|
3663
3706
|
]
|
|
3664
3707
|
}
|
|
3665
3708
|
);
|
|
3666
3709
|
}
|
|
3667
|
-
function
|
|
3710
|
+
function Me() {
|
|
3668
3711
|
const [s, t] = q([]);
|
|
3669
3712
|
m(
|
|
3670
3713
|
(u) => u.card.cfg
|
|
3671
3714
|
);
|
|
3672
|
-
const a = m((u) => u.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences:
|
|
3715
|
+
const a = m((u) => u.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: d } = m((u) => u.actions), r = m(
|
|
3673
3716
|
(u) => u.queryResultColumns
|
|
3674
3717
|
);
|
|
3675
3718
|
m(
|
|
3676
3719
|
(u) => {
|
|
3677
|
-
var
|
|
3678
|
-
return (
|
|
3720
|
+
var b;
|
|
3721
|
+
return (b = u.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
|
|
3679
3722
|
}
|
|
3680
3723
|
), Z(() => {
|
|
3681
3724
|
r && t(new Array(r.length).fill(!1));
|
|
3682
3725
|
}, [r]);
|
|
3683
|
-
function o(u,
|
|
3684
|
-
var g,
|
|
3685
|
-
|
|
3726
|
+
function o(u, b) {
|
|
3727
|
+
var g, h;
|
|
3728
|
+
b ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? d({
|
|
3686
3729
|
...a,
|
|
3687
3730
|
onClickFilter: [
|
|
3688
3731
|
...a.onClickFilter,
|
|
@@ -3691,7 +3734,7 @@ function Te() {
|
|
|
3691
3734
|
expression: ""
|
|
3692
3735
|
}
|
|
3693
3736
|
]
|
|
3694
|
-
}) :
|
|
3737
|
+
}) : d({
|
|
3695
3738
|
...a,
|
|
3696
3739
|
onClickFilter: [
|
|
3697
3740
|
{
|
|
@@ -3699,35 +3742,35 @@ function Te() {
|
|
|
3699
3742
|
expression: ""
|
|
3700
3743
|
}
|
|
3701
3744
|
]
|
|
3702
|
-
}) : (
|
|
3745
|
+
}) : (d({
|
|
3703
3746
|
...a,
|
|
3704
|
-
onClickFilter: (
|
|
3747
|
+
onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
|
|
3705
3748
|
(j) => j.columnIndex !== u
|
|
3706
3749
|
)
|
|
3707
3750
|
}), t((j) => {
|
|
3708
|
-
const
|
|
3709
|
-
return
|
|
3751
|
+
const C = [...j];
|
|
3752
|
+
return C[u] = !1, C;
|
|
3710
3753
|
}));
|
|
3711
3754
|
}
|
|
3712
|
-
function
|
|
3713
|
-
var
|
|
3714
|
-
const g = (
|
|
3755
|
+
function c(u, b) {
|
|
3756
|
+
var h;
|
|
3757
|
+
const g = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((j) => j.columnIndex === u ? {
|
|
3715
3758
|
...j,
|
|
3716
|
-
expression:
|
|
3759
|
+
expression: b.target.value
|
|
3717
3760
|
} : j);
|
|
3718
|
-
|
|
3761
|
+
d({
|
|
3719
3762
|
...a,
|
|
3720
3763
|
onClickFilter: g
|
|
3721
3764
|
});
|
|
3722
3765
|
}
|
|
3723
3766
|
function p(u) {
|
|
3724
|
-
var
|
|
3725
|
-
if (s != null && s[u] || (g = (
|
|
3767
|
+
var b, g, h, j;
|
|
3768
|
+
if (s != null && s[u] || (g = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((C) => C.columnIndex === u)) != null && g.expression)
|
|
3726
3769
|
return /* @__PURE__ */ e.jsx(
|
|
3727
3770
|
le,
|
|
3728
3771
|
{
|
|
3729
|
-
value: (j = (
|
|
3730
|
-
onChange: (
|
|
3772
|
+
value: (j = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find((C) => C.columnIndex === u)) == null ? void 0 : j.expression,
|
|
3773
|
+
onChange: (C) => c(u, C),
|
|
3731
3774
|
type: "text",
|
|
3732
3775
|
className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3733
3776
|
placeholder: "Expression"
|
|
@@ -3736,8 +3779,8 @@ function Te() {
|
|
|
3736
3779
|
}
|
|
3737
3780
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3738
3781
|
/* @__PURE__ */ e.jsx(R, { children: "On Click" }),
|
|
3739
|
-
r == null ? void 0 : r.map((u,
|
|
3740
|
-
var g,
|
|
3782
|
+
r == null ? void 0 : r.map((u, b) => {
|
|
3783
|
+
var g, h;
|
|
3741
3784
|
return /* @__PURE__ */ e.jsx(
|
|
3742
3785
|
"div",
|
|
3743
3786
|
{
|
|
@@ -3745,12 +3788,12 @@ function Te() {
|
|
|
3745
3788
|
children: /* @__PURE__ */ e.jsxs("div", { className: "grow", children: [
|
|
3746
3789
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2 py-2", children: [
|
|
3747
3790
|
/* @__PURE__ */ e.jsx(
|
|
3748
|
-
|
|
3791
|
+
$s,
|
|
3749
3792
|
{
|
|
3750
3793
|
checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
|
|
3751
|
-
(j) => j.columnIndex ===
|
|
3794
|
+
(j) => j.columnIndex === b
|
|
3752
3795
|
)),
|
|
3753
|
-
onCheckedChange: (j) => o(
|
|
3796
|
+
onCheckedChange: (j) => o(b, j)
|
|
3754
3797
|
}
|
|
3755
3798
|
),
|
|
3756
3799
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3760,22 +3803,22 @@ function Te() {
|
|
|
3760
3803
|
children: u
|
|
3761
3804
|
}
|
|
3762
3805
|
),
|
|
3763
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((
|
|
3764
|
-
(j) => j.columnIndex ===
|
|
3806
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
|
|
3807
|
+
(j) => j.columnIndex === b
|
|
3765
3808
|
)) && /* @__PURE__ */ e.jsx(
|
|
3766
3809
|
Ta,
|
|
3767
3810
|
{
|
|
3768
3811
|
onClick: () => {
|
|
3769
3812
|
t((j) => {
|
|
3770
|
-
const
|
|
3771
|
-
return b
|
|
3813
|
+
const C = [...j];
|
|
3814
|
+
return C[b] = !j[b], C;
|
|
3772
3815
|
});
|
|
3773
3816
|
},
|
|
3774
3817
|
className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
|
|
3775
3818
|
}
|
|
3776
3819
|
) })
|
|
3777
3820
|
] }),
|
|
3778
|
-
p(
|
|
3821
|
+
p(b)
|
|
3779
3822
|
] })
|
|
3780
3823
|
},
|
|
3781
3824
|
u
|
|
@@ -3783,29 +3826,29 @@ function Te() {
|
|
|
3783
3826
|
})
|
|
3784
3827
|
] });
|
|
3785
3828
|
}
|
|
3786
|
-
function
|
|
3787
|
-
var r, o,
|
|
3829
|
+
function bs() {
|
|
3830
|
+
var r, o, c;
|
|
3788
3831
|
const s = m((p) => p.card.preferences), t = m(
|
|
3789
3832
|
(p) => p.card.cfg
|
|
3790
3833
|
), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = m((p) => p.actions);
|
|
3791
3834
|
(r = t == null ? void 0 : t.options) != null && r.indexAxis;
|
|
3792
|
-
function
|
|
3835
|
+
function d(p) {
|
|
3793
3836
|
l(p);
|
|
3794
3837
|
}
|
|
3795
3838
|
return /* @__PURE__ */ e.jsxs(
|
|
3796
|
-
|
|
3839
|
+
js,
|
|
3797
3840
|
{
|
|
3798
|
-
value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((
|
|
3799
|
-
onValueChange:
|
|
3841
|
+
value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((c = t == null ? void 0 : t.options) == null ? void 0 : c.indexAxis) || "x",
|
|
3842
|
+
onValueChange: d,
|
|
3800
3843
|
className: "flex gap-3",
|
|
3801
3844
|
defaultValue: "x",
|
|
3802
3845
|
children: [
|
|
3803
3846
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3804
|
-
/* @__PURE__ */ e.jsx(
|
|
3847
|
+
/* @__PURE__ */ e.jsx(Te, { value: "x", id: "r1" }),
|
|
3805
3848
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
|
|
3806
3849
|
] }),
|
|
3807
3850
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3808
|
-
/* @__PURE__ */ e.jsx(
|
|
3851
|
+
/* @__PURE__ */ e.jsx(Te, { value: "y", id: "r2" }),
|
|
3809
3852
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
|
|
3810
3853
|
] })
|
|
3811
3854
|
]
|
|
@@ -3814,9 +3857,9 @@ function fs() {
|
|
|
3814
3857
|
}
|
|
3815
3858
|
const ts = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
3816
3859
|
function na(s, t) {
|
|
3817
|
-
var n, l,
|
|
3860
|
+
var n, l, d;
|
|
3818
3861
|
const a = wa(s, t);
|
|
3819
|
-
return ((
|
|
3862
|
+
return ((d = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : d.type) || "linear";
|
|
3820
3863
|
}
|
|
3821
3864
|
function Wa() {
|
|
3822
3865
|
var ie, W, ae, w, _, ee;
|
|
@@ -3826,32 +3869,32 @@ function Wa() {
|
|
|
3826
3869
|
}), n = m((E) => {
|
|
3827
3870
|
var D;
|
|
3828
3871
|
return (D = E.card) == null ? void 0 : D.cfg;
|
|
3829
|
-
}), l = wa(a, n), [
|
|
3872
|
+
}), l = wa(a, n), [d, r] = q(
|
|
3830
3873
|
na(a)
|
|
3831
|
-
), [o,
|
|
3874
|
+
), [o, c] = q(
|
|
3832
3875
|
((ae = (W = (ie = a == null ? void 0 : a.chartOptions) == null ? void 0 : ie.scales) == null ? void 0 : W[l]) == null ? void 0 : ae.min) || ""
|
|
3833
3876
|
), [p, u] = q(
|
|
3834
3877
|
((ee = (_ = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : _[l]) == null ? void 0 : ee.max) || ""
|
|
3835
|
-
), [
|
|
3878
|
+
), [b, g] = q(o || p ? "custom" : "auto"), [h, j] = q(""), [C, F] = q(0), [y, T] = q(""), [I, A] = q(""), [N, S] = q(""), L = m(
|
|
3836
3879
|
(E) => E.actions.setCardPreferences
|
|
3837
|
-
), { updateCardInFrame:
|
|
3880
|
+
), { updateCardInFrame: x } = re(), v = m((E) => E.card), f = m((E) => {
|
|
3838
3881
|
var D;
|
|
3839
3882
|
return (D = E.card) == null ? void 0 : D.type;
|
|
3840
3883
|
}), k = ["pie", "doughnut", "polarArea"].includes(f);
|
|
3841
3884
|
Z(() => {
|
|
3842
|
-
var E, D, se, $, X, te,
|
|
3843
|
-
r(na(a)),
|
|
3885
|
+
var E, D, se, $, X, te, Ee, Oe, je, be, J, oe, ce, Fe;
|
|
3886
|
+
r(na(a)), c(
|
|
3844
3887
|
((se = (D = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : D[l]) == null ? void 0 : se.min) === 0 ? 0 : ""
|
|
3845
3888
|
), u(((te = (X = ($ = a == null ? void 0 : a.chartOptions) == null ? void 0 : $.scales) == null ? void 0 : X[l]) == null ? void 0 : te.max) || ""), j(
|
|
3846
|
-
((
|
|
3847
|
-
),
|
|
3889
|
+
((be = (je = (Oe = (Ee = a == null ? void 0 : a.chartOptions) == null ? void 0 : Ee.scales) == null ? void 0 : Oe[l]) == null ? void 0 : je.ticks) == null ? void 0 : be.stepSize) || ""
|
|
3890
|
+
), F(((J = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : J.decimalPlaces) || 0), T(((oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : oe.suffix) || ""), A(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.currency) || ""), S(((Fe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Fe.locale) || "");
|
|
3848
3891
|
}, [s, a, l]);
|
|
3849
3892
|
function M(E, D) {
|
|
3850
3893
|
return D === "" || /^[0-9\b]+$/.test(D) ? Number(D) : Number(E);
|
|
3851
3894
|
}
|
|
3852
3895
|
function H() {
|
|
3853
3896
|
const E = [
|
|
3854
|
-
...new Set(
|
|
3897
|
+
...new Set(us.map((D) => D.currency))
|
|
3855
3898
|
];
|
|
3856
3899
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3857
3900
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
|
|
@@ -3873,7 +3916,7 @@ function Wa() {
|
|
|
3873
3916
|
/* @__PURE__ */ e.jsxs(
|
|
3874
3917
|
me,
|
|
3875
3918
|
{
|
|
3876
|
-
value:
|
|
3919
|
+
value: I || "none",
|
|
3877
3920
|
onValueChange: (D) => A(D === "none" ? "" : D),
|
|
3878
3921
|
children: [
|
|
3879
3922
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
@@ -3895,7 +3938,7 @@ function Wa() {
|
|
|
3895
3938
|
),
|
|
3896
3939
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3897
3940
|
/* @__PURE__ */ e.jsx(fe, { children: "Locale" }),
|
|
3898
|
-
|
|
3941
|
+
us.map((D) => /* @__PURE__ */ e.jsx(K, { value: D.locale, children: D.locale }, D.locale))
|
|
3899
3942
|
] }) })
|
|
3900
3943
|
] })
|
|
3901
3944
|
] }),
|
|
@@ -3904,8 +3947,8 @@ function Wa() {
|
|
|
3904
3947
|
/* @__PURE__ */ e.jsx(
|
|
3905
3948
|
le,
|
|
3906
3949
|
{
|
|
3907
|
-
value:
|
|
3908
|
-
onChange: (D) =>
|
|
3950
|
+
value: C,
|
|
3951
|
+
onChange: (D) => F(Number(D.target.value)),
|
|
3909
3952
|
id: "format",
|
|
3910
3953
|
className: `col-span-6 h-8 w-full tracking-wide ${ts}`
|
|
3911
3954
|
}
|
|
@@ -3922,7 +3965,7 @@ function Wa() {
|
|
|
3922
3965
|
{
|
|
3923
3966
|
id: "min",
|
|
3924
3967
|
value: o,
|
|
3925
|
-
onChange: (E) =>
|
|
3968
|
+
onChange: (E) => c((D) => M(D, E.target.value)),
|
|
3926
3969
|
className: `col-span-1 h-8 w-full ${ts}`
|
|
3927
3970
|
}
|
|
3928
3971
|
),
|
|
@@ -3941,7 +3984,7 @@ function Wa() {
|
|
|
3941
3984
|
/* @__PURE__ */ e.jsx(
|
|
3942
3985
|
le,
|
|
3943
3986
|
{
|
|
3944
|
-
value:
|
|
3987
|
+
value: h,
|
|
3945
3988
|
onChange: (E) => j((D) => M(D, E.target.value)),
|
|
3946
3989
|
id: "step-size",
|
|
3947
3990
|
className: `col-span-1 h-8 w-full ${ts}`
|
|
@@ -3953,11 +3996,11 @@ function Wa() {
|
|
|
3953
3996
|
function Y() {
|
|
3954
3997
|
var $;
|
|
3955
3998
|
let E = {};
|
|
3956
|
-
|
|
3999
|
+
b === "custom" && (E = {
|
|
3957
4000
|
min: o,
|
|
3958
4001
|
max: p,
|
|
3959
4002
|
ticks: {
|
|
3960
|
-
stepSize:
|
|
4003
|
+
stepSize: h
|
|
3961
4004
|
}
|
|
3962
4005
|
});
|
|
3963
4006
|
const D = {
|
|
@@ -3968,15 +4011,15 @@ function Wa() {
|
|
|
3968
4011
|
...($ = a == null ? void 0 : a.chartOptions) == null ? void 0 : $.scales,
|
|
3969
4012
|
[l]: {
|
|
3970
4013
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3971
|
-
type:
|
|
3972
|
-
...
|
|
4014
|
+
type: d,
|
|
4015
|
+
...d === "linear" ? E : {}
|
|
3973
4016
|
}
|
|
3974
4017
|
}
|
|
3975
4018
|
},
|
|
3976
4019
|
numberAxisFormat: {
|
|
3977
|
-
decimalPlaces:
|
|
3978
|
-
suffix:
|
|
3979
|
-
currency:
|
|
4020
|
+
decimalPlaces: C,
|
|
4021
|
+
suffix: y,
|
|
4022
|
+
currency: I,
|
|
3980
4023
|
locale: N
|
|
3981
4024
|
}
|
|
3982
4025
|
};
|
|
@@ -3985,11 +4028,11 @@ function Wa() {
|
|
|
3985
4028
|
...v,
|
|
3986
4029
|
preferences: D
|
|
3987
4030
|
};
|
|
3988
|
-
|
|
4031
|
+
x(se);
|
|
3989
4032
|
}
|
|
3990
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3991
|
-
/* @__PURE__ */ e.jsx(
|
|
3992
|
-
/* @__PURE__ */ e.jsx(
|
|
4033
|
+
return /* @__PURE__ */ e.jsxs(ps, { onOpenChange: (E) => t(E), children: [
|
|
4034
|
+
/* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Zt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
4035
|
+
/* @__PURE__ */ e.jsx(gs, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
3993
4036
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3994
4037
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
3995
4038
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
|
|
@@ -4001,7 +4044,7 @@ function Wa() {
|
|
|
4001
4044
|
me,
|
|
4002
4045
|
{
|
|
4003
4046
|
disabled: k,
|
|
4004
|
-
value:
|
|
4047
|
+
value: d,
|
|
4005
4048
|
onValueChange: (E) => r(E),
|
|
4006
4049
|
children: [
|
|
4007
4050
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
@@ -4014,31 +4057,31 @@ function Wa() {
|
|
|
4014
4057
|
}
|
|
4015
4058
|
)
|
|
4016
4059
|
] }),
|
|
4017
|
-
|
|
4060
|
+
d == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
4018
4061
|
/* @__PURE__ */ e.jsx(R, { htmlFor: "scale-option", children: "Setup" }),
|
|
4019
4062
|
/* @__PURE__ */ e.jsxs(
|
|
4020
|
-
|
|
4063
|
+
js,
|
|
4021
4064
|
{
|
|
4022
4065
|
disabled: k,
|
|
4023
4066
|
id: "scale-option",
|
|
4024
|
-
value:
|
|
4067
|
+
value: b,
|
|
4025
4068
|
onValueChange: (E) => g(E),
|
|
4026
4069
|
className: "col-span-2 flex gap-3",
|
|
4027
4070
|
defaultValue: "x",
|
|
4028
4071
|
children: [
|
|
4029
4072
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
4030
|
-
/* @__PURE__ */ e.jsx(
|
|
4073
|
+
/* @__PURE__ */ e.jsx(Te, { value: "auto", id: "r1" }),
|
|
4031
4074
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
|
|
4032
4075
|
] }),
|
|
4033
4076
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
4034
|
-
/* @__PURE__ */ e.jsx(
|
|
4077
|
+
/* @__PURE__ */ e.jsx(Te, { value: "custom", id: "r2" }),
|
|
4035
4078
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
|
|
4036
4079
|
] })
|
|
4037
4080
|
]
|
|
4038
4081
|
}
|
|
4039
4082
|
)
|
|
4040
4083
|
] }),
|
|
4041
|
-
|
|
4084
|
+
b === "custom" && d == "linear" && P(),
|
|
4042
4085
|
H(),
|
|
4043
4086
|
/* @__PURE__ */ e.jsx(en, {}),
|
|
4044
4087
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
@@ -4056,26 +4099,26 @@ function Wa() {
|
|
|
4056
4099
|
}
|
|
4057
4100
|
function Ll({ idx: s }) {
|
|
4058
4101
|
var o;
|
|
4059
|
-
const t = m((
|
|
4102
|
+
const t = m((c) => {
|
|
4060
4103
|
var p;
|
|
4061
|
-
return (p =
|
|
4104
|
+
return (p = c.card) == null ? void 0 : p.preferences;
|
|
4062
4105
|
}), a = m(
|
|
4063
|
-
(
|
|
4106
|
+
(c) => {
|
|
4064
4107
|
var p;
|
|
4065
|
-
return (p =
|
|
4108
|
+
return (p = c.card.preferences) == null ? void 0 : p.datasetOptions;
|
|
4066
4109
|
}
|
|
4067
4110
|
), n = m(
|
|
4068
|
-
(
|
|
4069
|
-
), l = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis,
|
|
4070
|
-
function r(
|
|
4071
|
-
(
|
|
4111
|
+
(c) => c.actions.setCardPreferences
|
|
4112
|
+
), l = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis, d = a == null ? void 0 : a.find((c) => c.idx === s);
|
|
4113
|
+
function r(c, p) {
|
|
4114
|
+
(c === "end" || c === "start") && sn(an());
|
|
4072
4115
|
const u = {
|
|
4073
|
-
display:
|
|
4074
|
-
align:
|
|
4075
|
-
anchor:
|
|
4116
|
+
display: c !== "none",
|
|
4117
|
+
align: c,
|
|
4118
|
+
anchor: c,
|
|
4076
4119
|
clamp: !0
|
|
4077
4120
|
};
|
|
4078
|
-
if (!
|
|
4121
|
+
if (!d)
|
|
4079
4122
|
n({
|
|
4080
4123
|
...t,
|
|
4081
4124
|
datasetOptions: [
|
|
@@ -4087,10 +4130,10 @@ function Ll({ idx: s }) {
|
|
|
4087
4130
|
]
|
|
4088
4131
|
});
|
|
4089
4132
|
else {
|
|
4090
|
-
const
|
|
4091
|
-
|
|
4133
|
+
const b = { ...d };
|
|
4134
|
+
b.datalabels = u;
|
|
4092
4135
|
const g = a == null ? void 0 : a.map(
|
|
4093
|
-
(
|
|
4136
|
+
(h) => h.idx === p ? b : h
|
|
4094
4137
|
);
|
|
4095
4138
|
n({
|
|
4096
4139
|
...t,
|
|
@@ -4098,9 +4141,9 @@ function Ll({ idx: s }) {
|
|
|
4098
4141
|
});
|
|
4099
4142
|
}
|
|
4100
4143
|
}
|
|
4101
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4102
|
-
/* @__PURE__ */ e.jsx(
|
|
4103
|
-
/* @__PURE__ */ e.jsx(
|
|
4144
|
+
return /* @__PURE__ */ e.jsxs(ps, { children: [
|
|
4145
|
+
/* @__PURE__ */ e.jsx(fs, { children: /* @__PURE__ */ e.jsx(Jn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
4146
|
+
/* @__PURE__ */ e.jsx(gs, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
4104
4147
|
/* @__PURE__ */ e.jsx(
|
|
4105
4148
|
O,
|
|
4106
4149
|
{
|
|
@@ -4168,25 +4211,25 @@ function Ll({ idx: s }) {
|
|
|
4168
4211
|
function Ya() {
|
|
4169
4212
|
const s = m((p) => p.card), t = m(
|
|
4170
4213
|
(p) => {
|
|
4171
|
-
var u,
|
|
4172
|
-
return (g = (
|
|
4214
|
+
var u, b, g;
|
|
4215
|
+
return (g = (b = (u = p == null ? void 0 : p.card) == null ? void 0 : u.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : g.indexAxis;
|
|
4173
4216
|
}
|
|
4174
|
-
), { data: a } =
|
|
4175
|
-
keys:
|
|
4217
|
+
), { data: a } = Re(s), n = t === "y" ? "Y axis" : "X axis", l = t === "y" ? "X axis" : "Y axis", {
|
|
4218
|
+
keys: d,
|
|
4176
4219
|
metricKeys: r,
|
|
4177
4220
|
dimensionKeys: o
|
|
4178
|
-
} =
|
|
4179
|
-
let
|
|
4221
|
+
} = Ss((a == null ? void 0 : a.records) || []);
|
|
4222
|
+
let c = r;
|
|
4180
4223
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
4181
4224
|
const p = tn({
|
|
4182
4225
|
dataArray: (a == null ? void 0 : a.records) || [],
|
|
4183
4226
|
groupKey: o[0],
|
|
4184
4227
|
pivotKey: o[1],
|
|
4185
|
-
valueKey:
|
|
4186
|
-
}), { metricKeys: u } =
|
|
4187
|
-
|
|
4228
|
+
valueKey: c[0]
|
|
4229
|
+
}), { metricKeys: u } = Ss(p);
|
|
4230
|
+
c = u;
|
|
4188
4231
|
}
|
|
4189
|
-
return
|
|
4232
|
+
return d.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4190
4233
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4191
4234
|
/* @__PURE__ */ e.jsx(R, { children: n }),
|
|
4192
4235
|
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: o[0] }) }) })
|
|
@@ -4196,23 +4239,23 @@ function Ya() {
|
|
|
4196
4239
|
/* @__PURE__ */ e.jsx(R, { children: l }),
|
|
4197
4240
|
/* @__PURE__ */ e.jsx(Wa, {})
|
|
4198
4241
|
] }),
|
|
4199
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children:
|
|
4242
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((p, u) => /* @__PURE__ */ e.jsx(Ml, { col: p, idx: u }, p)) })
|
|
4200
4243
|
] })
|
|
4201
4244
|
] });
|
|
4202
4245
|
}
|
|
4203
4246
|
function Ml({ col: s, idx: t }) {
|
|
4204
4247
|
const a = m((o) => {
|
|
4205
|
-
var
|
|
4206
|
-
return (
|
|
4248
|
+
var c;
|
|
4249
|
+
return (c = o.card) == null ? void 0 : c.preferences;
|
|
4207
4250
|
}), n = m(
|
|
4208
4251
|
(o) => {
|
|
4209
|
-
var
|
|
4210
|
-
return (
|
|
4252
|
+
var c;
|
|
4253
|
+
return (c = o.card.preferences) == null ? void 0 : c.datasetOptions;
|
|
4211
4254
|
}
|
|
4212
|
-
), l = n == null ? void 0 : n.find((o) => o.idx === t), { setCardPreferences:
|
|
4255
|
+
), l = n == null ? void 0 : n.find((o) => o.idx === t), { setCardPreferences: d } = m((o) => o.actions);
|
|
4213
4256
|
function r(o) {
|
|
4214
4257
|
if (!l)
|
|
4215
|
-
|
|
4258
|
+
d({
|
|
4216
4259
|
...a,
|
|
4217
4260
|
datasetOptions: [
|
|
4218
4261
|
...n || [],
|
|
@@ -4224,12 +4267,12 @@ function Ml({ col: s, idx: t }) {
|
|
|
4224
4267
|
]
|
|
4225
4268
|
});
|
|
4226
4269
|
else {
|
|
4227
|
-
const
|
|
4228
|
-
|
|
4270
|
+
const c = { ...l };
|
|
4271
|
+
c.type = o === "area" ? "line" : o, c.fill = o === "area" ? "origin" : "";
|
|
4229
4272
|
const p = n == null ? void 0 : n.map(
|
|
4230
|
-
(u) => u.idx === t ?
|
|
4273
|
+
(u) => u.idx === t ? c : u
|
|
4231
4274
|
);
|
|
4232
|
-
|
|
4275
|
+
d({
|
|
4233
4276
|
...a,
|
|
4234
4277
|
datasetOptions: p
|
|
4235
4278
|
});
|
|
@@ -4239,14 +4282,14 @@ function Ml({ col: s, idx: t }) {
|
|
|
4239
4282
|
/* @__PURE__ */ e.jsx("p", { children: s }),
|
|
4240
4283
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
4241
4284
|
/* @__PURE__ */ e.jsx(
|
|
4242
|
-
|
|
4285
|
+
Bs,
|
|
4243
4286
|
{
|
|
4244
4287
|
onClick: () => r("bar"),
|
|
4245
4288
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4246
4289
|
}
|
|
4247
4290
|
),
|
|
4248
4291
|
/* @__PURE__ */ e.jsx(
|
|
4249
|
-
|
|
4292
|
+
Us,
|
|
4250
4293
|
{
|
|
4251
4294
|
onClick: () => r("line"),
|
|
4252
4295
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
@@ -4264,32 +4307,32 @@ function Ml({ col: s, idx: t }) {
|
|
|
4264
4307
|
] });
|
|
4265
4308
|
}
|
|
4266
4309
|
function Xa() {
|
|
4267
|
-
const s = m((g) => g.selectedConnectionId), t = m((g) => g.selectedDatamodelId), a = m((g) => g.selectedDatabaseName), n = m((g) => g.selectedSchemaName), l = m((g) => g.selectedTableName),
|
|
4310
|
+
const s = m((g) => g.selectedConnectionId), t = m((g) => g.selectedDatamodelId), a = m((g) => g.selectedDatabaseName), n = m((g) => g.selectedSchemaName), l = m((g) => g.selectedTableName), d = z((g) => g.dashboard.filters) || [], r = z((g) => g.actions.addFilter), o = z((g) => g.actions.removeFilter), c = z(
|
|
4268
4311
|
(g) => g.actions.removeFilterValue
|
|
4269
|
-
), { modelItems: p, tableName: u } =
|
|
4270
|
-
function
|
|
4312
|
+
), { modelItems: p, tableName: u } = _e();
|
|
4313
|
+
function b(g, h = "dashboard") {
|
|
4271
4314
|
var S;
|
|
4272
|
-
const j = de(g.column_name),
|
|
4315
|
+
const j = de(g.column_name), C = de(a || ""), F = de(n || ""), y = de(u);
|
|
4273
4316
|
let T = fa(
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
),
|
|
4317
|
+
F,
|
|
4318
|
+
y
|
|
4319
|
+
), I = `${T}.${j}`;
|
|
4277
4320
|
const A = (S = p == null ? void 0 : p.find(
|
|
4278
4321
|
(L) => L.id === t
|
|
4279
4322
|
)) == null ? void 0 : S.name;
|
|
4280
|
-
t && t !== "none" && (
|
|
4281
|
-
const N =
|
|
4282
|
-
(L) => L.column ===
|
|
4323
|
+
t && t !== "none" && (I = `${Ns}.${A}.${j}`, T = `${Ns}.${A}`);
|
|
4324
|
+
const N = d == null ? void 0 : d.find(
|
|
4325
|
+
(L) => L.column === I && L.table === y && (L.database === C || L.database === a)
|
|
4283
4326
|
);
|
|
4284
4327
|
if (N)
|
|
4285
|
-
|
|
4328
|
+
c(N.id), o(N.id);
|
|
4286
4329
|
else {
|
|
4287
|
-
const L =
|
|
4330
|
+
const L = Ke();
|
|
4288
4331
|
return u === "api" && s ? (r({
|
|
4289
|
-
location:
|
|
4332
|
+
location: h,
|
|
4290
4333
|
id: L,
|
|
4291
4334
|
//uuidv4(),
|
|
4292
|
-
column:
|
|
4335
|
+
column: I,
|
|
4293
4336
|
title: g.column_name,
|
|
4294
4337
|
dataType: g.data_type,
|
|
4295
4338
|
table: "api",
|
|
@@ -4306,8 +4349,8 @@ function Xa() {
|
|
|
4306
4349
|
}), L) : (r({
|
|
4307
4350
|
id: L,
|
|
4308
4351
|
//uuidv4(),
|
|
4309
|
-
location:
|
|
4310
|
-
column:
|
|
4352
|
+
location: h,
|
|
4353
|
+
column: I,
|
|
4311
4354
|
//columnName, //`${qualifiedTableName}.${formattedColumnName}`,
|
|
4312
4355
|
title: g.column_name,
|
|
4313
4356
|
dataType: g.data_type,
|
|
@@ -4324,20 +4367,20 @@ function Xa() {
|
|
|
4324
4367
|
}), L);
|
|
4325
4368
|
}
|
|
4326
4369
|
}
|
|
4327
|
-
return { assignFilter:
|
|
4370
|
+
return { assignFilter: b };
|
|
4328
4371
|
}
|
|
4329
|
-
function
|
|
4372
|
+
function He() {
|
|
4330
4373
|
const s = z(
|
|
4331
4374
|
(o) => o.dashboard.filters
|
|
4332
|
-
), t = m((o) => o.frame), { setFrame: a } = re(), { columns: n } =
|
|
4333
|
-
function
|
|
4334
|
-
const
|
|
4335
|
-
a({ ...t, filterId:
|
|
4375
|
+
), t = m((o) => o.frame), { setFrame: a } = re(), { columns: n } = _e(), { assignFilter: l } = Xa();
|
|
4376
|
+
function d(o) {
|
|
4377
|
+
const c = l(o, "frame");
|
|
4378
|
+
a({ ...t, filterId: c });
|
|
4336
4379
|
}
|
|
4337
4380
|
const r = s == null ? void 0 : s.find((o) => o.id === t.filterId);
|
|
4338
4381
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
4339
4382
|
/* @__PURE__ */ e.jsx(R, { children: "Card Filter" }),
|
|
4340
|
-
/* @__PURE__ */ e.jsx(El, { onSelect:
|
|
4383
|
+
/* @__PURE__ */ e.jsx(El, { onSelect: d, columns: n }),
|
|
4341
4384
|
r && /* @__PURE__ */ e.jsx(nn, { filter: r })
|
|
4342
4385
|
] });
|
|
4343
4386
|
}
|
|
@@ -4346,9 +4389,9 @@ function El({
|
|
|
4346
4389
|
onSelect: t
|
|
4347
4390
|
}) {
|
|
4348
4391
|
var r;
|
|
4349
|
-
const [a, n] = ea.useState(!1), [l,
|
|
4350
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4351
|
-
/* @__PURE__ */ e.jsx(
|
|
4392
|
+
const [a, n] = ea.useState(!1), [l, d] = ea.useState("");
|
|
4393
|
+
return /* @__PURE__ */ e.jsxs(ps, { open: a, onOpenChange: n, children: [
|
|
4394
|
+
/* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
4352
4395
|
O,
|
|
4353
4396
|
{
|
|
4354
4397
|
size: "sm",
|
|
@@ -4362,7 +4405,7 @@ function El({
|
|
|
4362
4405
|
]
|
|
4363
4406
|
}
|
|
4364
4407
|
) }),
|
|
4365
|
-
/* @__PURE__ */ e.jsx(
|
|
4408
|
+
/* @__PURE__ */ e.jsx(gs, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(rn, { children: [
|
|
4366
4409
|
/* @__PURE__ */ e.jsx(on, { placeholder: "Search column", className: "h-9" }),
|
|
4367
4410
|
/* @__PURE__ */ e.jsxs(cn, { children: [
|
|
4368
4411
|
/* @__PURE__ */ e.jsx(dn, { children: "No framework found." }),
|
|
@@ -4370,9 +4413,9 @@ function El({
|
|
|
4370
4413
|
mn,
|
|
4371
4414
|
{
|
|
4372
4415
|
value: o.column_name,
|
|
4373
|
-
onSelect: (
|
|
4374
|
-
const p =
|
|
4375
|
-
|
|
4416
|
+
onSelect: (c) => {
|
|
4417
|
+
const p = c === l ? "" : c;
|
|
4418
|
+
d(p), n(!1), p && t(o);
|
|
4376
4419
|
},
|
|
4377
4420
|
children: [
|
|
4378
4421
|
o.column_name,
|
|
@@ -4396,9 +4439,9 @@ function El({
|
|
|
4396
4439
|
function Al({
|
|
4397
4440
|
cardType: s
|
|
4398
4441
|
}) {
|
|
4399
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
4442
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4400
4443
|
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
4401
|
-
/* @__PURE__ */ e.jsx(U, { children: `${
|
|
4444
|
+
/* @__PURE__ */ e.jsx(U, { children: `${Ps(s)} Chart` }),
|
|
4402
4445
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 font-mono text-xs", children: [
|
|
4403
4446
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
|
|
4404
4447
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -4425,27 +4468,27 @@ function Al({
|
|
|
4425
4468
|
/* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
|
|
4426
4469
|
/* @__PURE__ */ e.jsx(U, { children: "Settings" }),
|
|
4427
4470
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
4428
|
-
/* @__PURE__ */ e.jsx(
|
|
4471
|
+
/* @__PURE__ */ e.jsx(bs, {}),
|
|
4429
4472
|
/* @__PURE__ */ e.jsx(Ya, {})
|
|
4430
4473
|
] })
|
|
4431
4474
|
] }),
|
|
4432
4475
|
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
4433
4476
|
/* @__PURE__ */ e.jsx(U, { children: "Filters" }),
|
|
4434
4477
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
4435
|
-
/* @__PURE__ */ e.jsx(
|
|
4436
|
-
/* @__PURE__ */ e.jsx(
|
|
4478
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
4479
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
4437
4480
|
] })
|
|
4438
4481
|
] })
|
|
4439
4482
|
] }) });
|
|
4440
4483
|
}
|
|
4441
|
-
function
|
|
4442
|
-
var l,
|
|
4484
|
+
function Qs() {
|
|
4485
|
+
var l, d, r;
|
|
4443
4486
|
const s = m(
|
|
4444
4487
|
(o) => o.card.cfg
|
|
4445
4488
|
), t = m((o) => o.actions.setCardCfg), a = m((o) => o.card.type);
|
|
4446
4489
|
function n(o) {
|
|
4447
4490
|
var u;
|
|
4448
|
-
const
|
|
4491
|
+
const c = {
|
|
4449
4492
|
datalabels: {
|
|
4450
4493
|
display: o !== "none",
|
|
4451
4494
|
align: o,
|
|
@@ -4458,7 +4501,7 @@ function Gs() {
|
|
|
4458
4501
|
...s == null ? void 0 : s.options,
|
|
4459
4502
|
plugins: {
|
|
4460
4503
|
...(u = s == null ? void 0 : s.options) == null ? void 0 : u.plugins,
|
|
4461
|
-
...
|
|
4504
|
+
...c
|
|
4462
4505
|
}
|
|
4463
4506
|
}
|
|
4464
4507
|
};
|
|
@@ -4472,7 +4515,7 @@ function Gs() {
|
|
|
4472
4515
|
/* @__PURE__ */ e.jsxs(
|
|
4473
4516
|
me,
|
|
4474
4517
|
{
|
|
4475
|
-
value: (r = (
|
|
4518
|
+
value: (r = (d = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : d.datalabels) == null ? void 0 : r.anchor,
|
|
4476
4519
|
onValueChange: n,
|
|
4477
4520
|
defaultValue: "none",
|
|
4478
4521
|
children: [
|
|
@@ -4508,7 +4551,7 @@ function Vl({
|
|
|
4508
4551
|
"a",
|
|
4509
4552
|
{
|
|
4510
4553
|
target: "_blank",
|
|
4511
|
-
onClick: (
|
|
4554
|
+
onClick: (d) => d.stopPropagation(),
|
|
4512
4555
|
className: "text-blue-700",
|
|
4513
4556
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
4514
4557
|
children: "example"
|
|
@@ -4518,20 +4561,20 @@ function Vl({
|
|
|
4518
4561
|
] })
|
|
4519
4562
|
] });
|
|
4520
4563
|
}
|
|
4521
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
4564
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4522
4565
|
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
4523
|
-
/* @__PURE__ */ e.jsx(U, { children: `${
|
|
4566
|
+
/* @__PURE__ */ e.jsx(U, { children: `${Ps(s)} Chart` }),
|
|
4524
4567
|
/* @__PURE__ */ e.jsx(G, { className: "space-y-4 font-mono text-xs", children: t(s) })
|
|
4525
4568
|
] }),
|
|
4526
4569
|
/* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
|
|
4527
4570
|
/* @__PURE__ */ e.jsx(U, { children: "Settings" }),
|
|
4528
|
-
/* @__PURE__ */ e.jsx(G, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
4571
|
+
/* @__PURE__ */ e.jsx(G, { className: "px-2", children: /* @__PURE__ */ e.jsx(Qs, {}) })
|
|
4529
4572
|
] }),
|
|
4530
4573
|
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
4531
4574
|
/* @__PURE__ */ e.jsx(U, { children: "Filters" }),
|
|
4532
4575
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
4533
|
-
/* @__PURE__ */ e.jsx(
|
|
4534
|
-
/* @__PURE__ */ e.jsx(
|
|
4576
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
4577
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
4535
4578
|
] })
|
|
4536
4579
|
] })
|
|
4537
4580
|
] }) });
|
|
@@ -4563,7 +4606,7 @@ function _l() {
|
|
|
4563
4606
|
const s = m((t) => t.card.type);
|
|
4564
4607
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
4565
4608
|
/* @__PURE__ */ e.jsx(
|
|
4566
|
-
|
|
4609
|
+
Le,
|
|
4567
4610
|
{
|
|
4568
4611
|
className: " ",
|
|
4569
4612
|
type: "single",
|
|
@@ -4571,11 +4614,11 @@ function _l() {
|
|
|
4571
4614
|
children: Hl(s)
|
|
4572
4615
|
}
|
|
4573
4616
|
),
|
|
4574
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
4617
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(bs, {}) }),
|
|
4575
4618
|
!["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4576
|
-
/* @__PURE__ */ e.jsx(
|
|
4577
|
-
/* @__PURE__ */ e.jsx(
|
|
4578
|
-
/* @__PURE__ */ e.jsx(
|
|
4619
|
+
/* @__PURE__ */ e.jsx(Qs, {}),
|
|
4620
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
4621
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
4579
4622
|
] })
|
|
4580
4623
|
] });
|
|
4581
4624
|
}
|
|
@@ -4677,52 +4720,52 @@ function Hl(s) {
|
|
|
4677
4720
|
] }) });
|
|
4678
4721
|
}
|
|
4679
4722
|
function $l() {
|
|
4680
|
-
var
|
|
4681
|
-
const s = m((
|
|
4682
|
-
(
|
|
4723
|
+
var c, p, u, b, g;
|
|
4724
|
+
const s = m((h) => h.card.preferences), t = m(
|
|
4725
|
+
(h) => h.actions.setCardPreferences
|
|
4683
4726
|
), a = m(
|
|
4684
|
-
(
|
|
4727
|
+
(h) => h.actions.setNumberFormat
|
|
4685
4728
|
);
|
|
4686
4729
|
m(
|
|
4687
|
-
(
|
|
4688
|
-
var j,
|
|
4689
|
-
return (
|
|
4730
|
+
(h) => {
|
|
4731
|
+
var j, C;
|
|
4732
|
+
return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.decimalPlaces;
|
|
4690
4733
|
}
|
|
4691
4734
|
);
|
|
4692
4735
|
const n = m(
|
|
4693
|
-
(
|
|
4694
|
-
var j,
|
|
4695
|
-
return (
|
|
4736
|
+
(h) => {
|
|
4737
|
+
var j, C;
|
|
4738
|
+
return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.locale;
|
|
4696
4739
|
}
|
|
4697
4740
|
), l = m(
|
|
4698
|
-
(
|
|
4699
|
-
var j,
|
|
4700
|
-
return (
|
|
4741
|
+
(h) => {
|
|
4742
|
+
var j, C;
|
|
4743
|
+
return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.currency;
|
|
4701
4744
|
}
|
|
4702
4745
|
);
|
|
4703
4746
|
m(
|
|
4704
|
-
(
|
|
4747
|
+
(h) => h.actions.setFilterOnClickField
|
|
4705
4748
|
);
|
|
4706
|
-
const
|
|
4707
|
-
(
|
|
4708
|
-
var j,
|
|
4709
|
-
return (
|
|
4749
|
+
const d = m(
|
|
4750
|
+
(h) => {
|
|
4751
|
+
var j, C;
|
|
4752
|
+
return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.colorRanges;
|
|
4710
4753
|
}
|
|
4711
4754
|
) || [], r = m(
|
|
4712
|
-
(
|
|
4713
|
-
), o = [...new Set(
|
|
4755
|
+
(h) => h.actions.setColorRanges
|
|
4756
|
+
), o = [...new Set(us.map((h) => h.currency))];
|
|
4714
4757
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
4715
4758
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
4716
4759
|
/* @__PURE__ */ e.jsx(
|
|
4717
|
-
|
|
4760
|
+
$s,
|
|
4718
4761
|
{
|
|
4719
|
-
checked: !!((
|
|
4720
|
-
onCheckedChange: (
|
|
4762
|
+
checked: !!((c = s == null ? void 0 : s.formatNumber) != null && c.enabled),
|
|
4763
|
+
onCheckedChange: (h) => {
|
|
4721
4764
|
t({
|
|
4722
4765
|
...s,
|
|
4723
4766
|
formatNumber: {
|
|
4724
4767
|
...s == null ? void 0 : s.formatNumber,
|
|
4725
|
-
enabled:
|
|
4768
|
+
enabled: h
|
|
4726
4769
|
}
|
|
4727
4770
|
});
|
|
4728
4771
|
}
|
|
@@ -4739,13 +4782,13 @@ function $l() {
|
|
|
4739
4782
|
me,
|
|
4740
4783
|
{
|
|
4741
4784
|
value: n || "none",
|
|
4742
|
-
onValueChange: (
|
|
4743
|
-
var j,
|
|
4785
|
+
onValueChange: (h) => {
|
|
4786
|
+
var j, C, F;
|
|
4744
4787
|
return a(
|
|
4745
4788
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.decimalPlaces) || 0,
|
|
4746
|
-
((
|
|
4747
|
-
|
|
4748
|
-
((
|
|
4789
|
+
((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.currency) || "",
|
|
4790
|
+
h,
|
|
4791
|
+
((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.suffix) || ""
|
|
4749
4792
|
);
|
|
4750
4793
|
},
|
|
4751
4794
|
children: [
|
|
@@ -4753,7 +4796,7 @@ function $l() {
|
|
|
4753
4796
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4754
4797
|
/* @__PURE__ */ e.jsx(fe, { children: "Format" }),
|
|
4755
4798
|
/* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
|
|
4756
|
-
|
|
4799
|
+
us.map((h) => /* @__PURE__ */ e.jsx(K, { value: h.locale, children: h.locale }, h.locale))
|
|
4757
4800
|
] }) })
|
|
4758
4801
|
]
|
|
4759
4802
|
}
|
|
@@ -4765,13 +4808,13 @@ function $l() {
|
|
|
4765
4808
|
me,
|
|
4766
4809
|
{
|
|
4767
4810
|
value: l || "none",
|
|
4768
|
-
onValueChange: (
|
|
4769
|
-
var j,
|
|
4770
|
-
console.log("currency",
|
|
4811
|
+
onValueChange: (h) => {
|
|
4812
|
+
var j, C, F;
|
|
4813
|
+
console.log("currency", h), a(
|
|
4771
4814
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.decimalPlaces) || 0,
|
|
4772
|
-
|
|
4773
|
-
((
|
|
4774
|
-
((
|
|
4815
|
+
h === "none" ? "" : h,
|
|
4816
|
+
((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.locale) || "",
|
|
4817
|
+
((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.suffix) || ""
|
|
4775
4818
|
);
|
|
4776
4819
|
},
|
|
4777
4820
|
children: [
|
|
@@ -4779,7 +4822,7 @@ function $l() {
|
|
|
4779
4822
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4780
4823
|
/* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
|
|
4781
4824
|
/* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
|
|
4782
|
-
o.map((
|
|
4825
|
+
o.map((h) => /* @__PURE__ */ e.jsx(K, { value: h, children: h }, h))
|
|
4783
4826
|
] }) })
|
|
4784
4827
|
]
|
|
4785
4828
|
}
|
|
@@ -4792,19 +4835,19 @@ function $l() {
|
|
|
4792
4835
|
/* @__PURE__ */ e.jsxs(
|
|
4793
4836
|
me,
|
|
4794
4837
|
{
|
|
4795
|
-
value: ((
|
|
4796
|
-
onValueChange: (
|
|
4797
|
-
var j,
|
|
4838
|
+
value: ((b = (u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) == null ? void 0 : b.toString()) || "0",
|
|
4839
|
+
onValueChange: (h) => {
|
|
4840
|
+
var j, C, F;
|
|
4798
4841
|
return a(
|
|
4799
|
-
Number(
|
|
4842
|
+
Number(h),
|
|
4800
4843
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.currency) || "",
|
|
4801
|
-
((
|
|
4802
|
-
((
|
|
4844
|
+
((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.locale) || "",
|
|
4845
|
+
((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.suffix) || ""
|
|
4803
4846
|
);
|
|
4804
4847
|
},
|
|
4805
4848
|
children: [
|
|
4806
4849
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4807
|
-
/* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((
|
|
4850
|
+
/* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(K, { value: h, children: h }, h)) })
|
|
4808
4851
|
]
|
|
4809
4852
|
}
|
|
4810
4853
|
)
|
|
@@ -4817,13 +4860,13 @@ function $l() {
|
|
|
4817
4860
|
value: ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.suffix) || "",
|
|
4818
4861
|
className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
4819
4862
|
placeholder: "K, M, B, %",
|
|
4820
|
-
onChange: (
|
|
4821
|
-
var j,
|
|
4863
|
+
onChange: (h) => {
|
|
4864
|
+
var j, C, F;
|
|
4822
4865
|
return a(
|
|
4823
4866
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.decimalPlaces) || 0,
|
|
4824
|
-
((
|
|
4825
|
-
((
|
|
4826
|
-
|
|
4867
|
+
((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.currency) || "",
|
|
4868
|
+
((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.locale) || "",
|
|
4869
|
+
h.target.value
|
|
4827
4870
|
);
|
|
4828
4871
|
}
|
|
4829
4872
|
}
|
|
@@ -4831,11 +4874,11 @@ function $l() {
|
|
|
4831
4874
|
] })
|
|
4832
4875
|
] })
|
|
4833
4876
|
] }) }),
|
|
4834
|
-
/* @__PURE__ */ e.jsx(
|
|
4877
|
+
/* @__PURE__ */ e.jsx(we, { className: "my-3" }),
|
|
4835
4878
|
/* @__PURE__ */ e.jsx(
|
|
4836
4879
|
hn,
|
|
4837
4880
|
{
|
|
4838
|
-
colorRanges:
|
|
4881
|
+
colorRanges: d,
|
|
4839
4882
|
setColorRanges: r
|
|
4840
4883
|
}
|
|
4841
4884
|
)
|
|
@@ -4844,7 +4887,7 @@ function $l() {
|
|
|
4844
4887
|
}
|
|
4845
4888
|
function Pl() {
|
|
4846
4889
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
4847
|
-
/* @__PURE__ */ e.jsx(
|
|
4890
|
+
/* @__PURE__ */ e.jsx(Le, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
4848
4891
|
/* @__PURE__ */ e.jsx(U, { className: "", children: "KPI Query" }),
|
|
4849
4892
|
/* @__PURE__ */ e.jsxs(G, { className: "font-mono", children: [
|
|
4850
4893
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
@@ -4974,10 +5017,10 @@ const Bl = [
|
|
|
4974
5017
|
value: s
|
|
4975
5018
|
}));
|
|
4976
5019
|
function Ql() {
|
|
4977
|
-
var
|
|
4978
|
-
const s = m((f) => f.card), t = (p = (
|
|
4979
|
-
((
|
|
4980
|
-
), { setCardPreferences: l } = re(), { data:
|
|
5020
|
+
var c, p, u, b, g, h, j, C, F, y, T, I, A, N, S, L, x, v;
|
|
5021
|
+
const s = m((f) => f.card), t = (p = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : p.topoJsonUrl, [a, n] = q(
|
|
5022
|
+
((b = (u = s == null ? void 0 : s.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
|
|
5023
|
+
), { setCardPreferences: l } = re(), { data: d } = Hs(s), r = Object.keys((d == null ? void 0 : d.objects) || {}).map((f) => ({
|
|
4981
5024
|
label: f,
|
|
4982
5025
|
value: f
|
|
4983
5026
|
})) || [], o = [
|
|
@@ -4995,9 +5038,9 @@ function Ql() {
|
|
|
4995
5038
|
}
|
|
4996
5039
|
];
|
|
4997
5040
|
return /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
|
|
4998
|
-
/* @__PURE__ */ e.jsx(
|
|
4999
|
-
/* @__PURE__ */ e.jsx(
|
|
5000
|
-
/* @__PURE__ */ e.jsx(
|
|
5041
|
+
/* @__PURE__ */ e.jsx(Qe, { summary: "Map Query", children: /* @__PURE__ */ e.jsx("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
|
|
5042
|
+
/* @__PURE__ */ e.jsx(we, { className: "my-4" }),
|
|
5043
|
+
/* @__PURE__ */ e.jsx(Qe, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
|
|
5001
5044
|
/* @__PURE__ */ e.jsx(
|
|
5002
5045
|
ue,
|
|
5003
5046
|
{
|
|
@@ -5033,11 +5076,11 @@ function Ql() {
|
|
|
5033
5076
|
});
|
|
5034
5077
|
},
|
|
5035
5078
|
value: a,
|
|
5036
|
-
className: `h-9 w-full ${
|
|
5079
|
+
className: `h-9 w-full ${Ue}`,
|
|
5037
5080
|
placeholder: "Custom URL"
|
|
5038
5081
|
}
|
|
5039
5082
|
),
|
|
5040
|
-
|
|
5083
|
+
d && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
5041
5084
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
5042
5085
|
/* @__PURE__ */ e.jsx(R, { children: "Map Object" }),
|
|
5043
5086
|
/* @__PURE__ */ e.jsx(
|
|
@@ -5045,7 +5088,7 @@ function Ql() {
|
|
|
5045
5088
|
{
|
|
5046
5089
|
className: "h-9",
|
|
5047
5090
|
options: r,
|
|
5048
|
-
value: ((
|
|
5091
|
+
value: ((h = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : h.objectKey) || "",
|
|
5049
5092
|
label: "Map Object",
|
|
5050
5093
|
onValueChange: (f) => {
|
|
5051
5094
|
var k;
|
|
@@ -5067,7 +5110,7 @@ function Ql() {
|
|
|
5067
5110
|
{
|
|
5068
5111
|
className: "h-9",
|
|
5069
5112
|
options: Bl,
|
|
5070
|
-
value: ((
|
|
5113
|
+
value: ((C = (j = s.preferences) == null ? void 0 : j.mapVisualOptions) == null ? void 0 : C.projection) || "",
|
|
5071
5114
|
label: "Projection",
|
|
5072
5115
|
onValueChange: (f) => {
|
|
5073
5116
|
var k;
|
|
@@ -5089,7 +5132,7 @@ function Ql() {
|
|
|
5089
5132
|
{
|
|
5090
5133
|
className: "h-9",
|
|
5091
5134
|
options: Gl,
|
|
5092
|
-
value: ((
|
|
5135
|
+
value: ((y = (F = s.preferences) == null ? void 0 : F.mapVisualOptions) == null ? void 0 : y.colorScale) || "",
|
|
5093
5136
|
label: "Select Color Scale",
|
|
5094
5137
|
onValueChange: (f) => {
|
|
5095
5138
|
var k;
|
|
@@ -5106,15 +5149,15 @@ function Ql() {
|
|
|
5106
5149
|
] })
|
|
5107
5150
|
] })
|
|
5108
5151
|
] }) }),
|
|
5109
|
-
/* @__PURE__ */ e.jsx(
|
|
5110
|
-
/* @__PURE__ */ e.jsx(
|
|
5152
|
+
/* @__PURE__ */ e.jsx(we, { className: "my-4" }),
|
|
5153
|
+
/* @__PURE__ */ e.jsx(Qe, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5111
5154
|
/* @__PURE__ */ e.jsx(
|
|
5112
5155
|
le,
|
|
5113
5156
|
{
|
|
5114
|
-
className: `h-9 w-full ${
|
|
5157
|
+
className: `h-9 w-full ${Ue}`,
|
|
5115
5158
|
type: "number",
|
|
5116
5159
|
step: 0.1,
|
|
5117
|
-
value: ((
|
|
5160
|
+
value: ((I = (T = s.preferences) == null ? void 0 : T.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
|
|
5118
5161
|
onChange: (f) => {
|
|
5119
5162
|
var k;
|
|
5120
5163
|
l({
|
|
@@ -5131,7 +5174,7 @@ function Ql() {
|
|
|
5131
5174
|
/* @__PURE__ */ e.jsx(
|
|
5132
5175
|
le,
|
|
5133
5176
|
{
|
|
5134
|
-
className: `h-9 w-full ${
|
|
5177
|
+
className: `h-9 w-full ${Ue}`,
|
|
5135
5178
|
type: "number",
|
|
5136
5179
|
step: 10,
|
|
5137
5180
|
value: ((S = (N = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : N.projectionOffset) == null ? void 0 : S[0]) || 0,
|
|
@@ -5154,10 +5197,10 @@ function Ql() {
|
|
|
5154
5197
|
/* @__PURE__ */ e.jsx(
|
|
5155
5198
|
le,
|
|
5156
5199
|
{
|
|
5157
|
-
className: `h-9 w-full ${
|
|
5200
|
+
className: `h-9 w-full ${Ue}`,
|
|
5158
5201
|
type: "number",
|
|
5159
5202
|
step: 10,
|
|
5160
|
-
value: ((v = (
|
|
5203
|
+
value: ((v = (x = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : x.projectionOffset) == null ? void 0 : v[1]) || 0,
|
|
5161
5204
|
onChange: (f) => {
|
|
5162
5205
|
var k, M, H, P;
|
|
5163
5206
|
l({
|
|
@@ -5174,8 +5217,8 @@ function Ql() {
|
|
|
5174
5217
|
}
|
|
5175
5218
|
)
|
|
5176
5219
|
] }) }),
|
|
5177
|
-
/* @__PURE__ */ e.jsx(
|
|
5178
|
-
/* @__PURE__ */ e.jsx(
|
|
5220
|
+
/* @__PURE__ */ e.jsx(we, { className: "my-4" }),
|
|
5221
|
+
/* @__PURE__ */ e.jsx(Me, {})
|
|
5179
5222
|
] });
|
|
5180
5223
|
}
|
|
5181
5224
|
function Jl() {
|
|
@@ -5191,7 +5234,7 @@ function Jl() {
|
|
|
5191
5234
|
});
|
|
5192
5235
|
}
|
|
5193
5236
|
return /* @__PURE__ */ e.jsxs(
|
|
5194
|
-
|
|
5237
|
+
js,
|
|
5195
5238
|
{
|
|
5196
5239
|
value: (n = s == null ? void 0 : s.textVisualOptions) != null && n.isDynamicText ? "dynamic" : "static",
|
|
5197
5240
|
onValueChange: a,
|
|
@@ -5199,11 +5242,11 @@ function Jl() {
|
|
|
5199
5242
|
defaultValue: "x",
|
|
5200
5243
|
children: [
|
|
5201
5244
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
5202
|
-
/* @__PURE__ */ e.jsx(
|
|
5245
|
+
/* @__PURE__ */ e.jsx(Te, { value: "static", id: "r1" }),
|
|
5203
5246
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
|
|
5204
5247
|
] }),
|
|
5205
5248
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
5206
|
-
/* @__PURE__ */ e.jsx(
|
|
5249
|
+
/* @__PURE__ */ e.jsx(Te, { value: "dynamic", id: "r2" }),
|
|
5207
5250
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
|
|
5208
5251
|
] })
|
|
5209
5252
|
]
|
|
@@ -5216,9 +5259,9 @@ function ns({
|
|
|
5216
5259
|
suffix: a = "Chart"
|
|
5217
5260
|
}) {
|
|
5218
5261
|
let n = "pie-chart";
|
|
5219
|
-
return s === "radar" && (n = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
5262
|
+
return s === "radar" && (n = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
5220
5263
|
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
5221
|
-
/* @__PURE__ */ e.jsx(U, { children: `${
|
|
5264
|
+
/* @__PURE__ */ e.jsx(U, { children: `${Ps(s)} ${a}` }),
|
|
5222
5265
|
/* @__PURE__ */ e.jsx(G, { children: t || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5223
5266
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
|
|
5224
5267
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -5244,16 +5287,16 @@ function ns({
|
|
|
5244
5287
|
/* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
|
|
5245
5288
|
/* @__PURE__ */ e.jsx(U, { children: "Settings" }),
|
|
5246
5289
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
5247
|
-
s === "range" && /* @__PURE__ */ e.jsx(
|
|
5248
|
-
s !== "text" && /* @__PURE__ */ e.jsx(
|
|
5290
|
+
s === "range" && /* @__PURE__ */ e.jsx(bs, {}),
|
|
5291
|
+
s !== "text" && /* @__PURE__ */ e.jsx(Qs, {}),
|
|
5249
5292
|
s === "text" && /* @__PURE__ */ e.jsx(Jl, {})
|
|
5250
5293
|
] })
|
|
5251
5294
|
] }),
|
|
5252
5295
|
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
5253
5296
|
/* @__PURE__ */ e.jsx(U, { children: "Filters" }),
|
|
5254
5297
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
5255
|
-
/* @__PURE__ */ e.jsx(
|
|
5256
|
-
/* @__PURE__ */ e.jsx(
|
|
5298
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
5299
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
5257
5300
|
] })
|
|
5258
5301
|
] })
|
|
5259
5302
|
] }) });
|
|
@@ -5261,8 +5304,8 @@ function ns({
|
|
|
5261
5304
|
function Kl() {
|
|
5262
5305
|
const s = m(
|
|
5263
5306
|
(n) => {
|
|
5264
|
-
var l,
|
|
5265
|
-
return (
|
|
5307
|
+
var l, d;
|
|
5308
|
+
return (d = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : d.sortChart;
|
|
5266
5309
|
}
|
|
5267
5310
|
), { setSortChart: t } = re();
|
|
5268
5311
|
function a() {
|
|
@@ -5295,7 +5338,7 @@ function Kl() {
|
|
|
5295
5338
|
)
|
|
5296
5339
|
] });
|
|
5297
5340
|
}
|
|
5298
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
5341
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
5299
5342
|
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
5300
5343
|
/* @__PURE__ */ e.jsx(U, { children: "Stacked Chart" }),
|
|
5301
5344
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 font-mono text-xs", children: [
|
|
@@ -5324,7 +5367,7 @@ function Kl() {
|
|
|
5324
5367
|
/* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
|
|
5325
5368
|
/* @__PURE__ */ e.jsx(U, { children: "Settings" }),
|
|
5326
5369
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
5327
|
-
/* @__PURE__ */ e.jsx(
|
|
5370
|
+
/* @__PURE__ */ e.jsx(bs, {}),
|
|
5328
5371
|
a(),
|
|
5329
5372
|
/* @__PURE__ */ e.jsx(Ya, {})
|
|
5330
5373
|
] })
|
|
@@ -5332,8 +5375,8 @@ function Kl() {
|
|
|
5332
5375
|
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
5333
5376
|
/* @__PURE__ */ e.jsx(U, { children: "Filters" }),
|
|
5334
5377
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
5335
|
-
/* @__PURE__ */ e.jsx(
|
|
5336
|
-
/* @__PURE__ */ e.jsx(
|
|
5378
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
5379
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
5337
5380
|
] })
|
|
5338
5381
|
] })
|
|
5339
5382
|
] }) });
|
|
@@ -5351,15 +5394,15 @@ function Wl({}) {
|
|
|
5351
5394
|
});
|
|
5352
5395
|
};
|
|
5353
5396
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
5354
|
-
/* @__PURE__ */ e.jsx(
|
|
5397
|
+
/* @__PURE__ */ e.jsx(Le, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
5355
5398
|
/* @__PURE__ */ e.jsx(U, { children: "Filters" }),
|
|
5356
5399
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
5357
|
-
/* @__PURE__ */ e.jsx(
|
|
5358
|
-
/* @__PURE__ */ e.jsx(
|
|
5400
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
5401
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
5359
5402
|
] })
|
|
5360
5403
|
] }) }),
|
|
5361
5404
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
5362
|
-
/* @__PURE__ */ e.jsx(
|
|
5405
|
+
/* @__PURE__ */ e.jsx($s, { onCheckedChange: a, id: "allow-download" }),
|
|
5363
5406
|
/* @__PURE__ */ e.jsx(
|
|
5364
5407
|
"label",
|
|
5365
5408
|
{
|
|
@@ -5463,18 +5506,18 @@ function er() {
|
|
|
5463
5506
|
return /* @__PURE__ */ e.jsx(_l, {});
|
|
5464
5507
|
}
|
|
5465
5508
|
}
|
|
5466
|
-
return /* @__PURE__ */ e.jsx(
|
|
5509
|
+
return /* @__PURE__ */ e.jsx(De, { className: "h-full w-full text-sm", children: t(s) });
|
|
5467
5510
|
}
|
|
5468
5511
|
function sr() {
|
|
5469
5512
|
const s = m((t) => t.isShowingVisual);
|
|
5470
5513
|
return /* @__PURE__ */ e.jsxs(
|
|
5471
|
-
|
|
5514
|
+
cs,
|
|
5472
5515
|
{
|
|
5473
5516
|
direction: "vertical",
|
|
5474
5517
|
className: "min-h-[250px] min-w-full max-w-lg",
|
|
5475
5518
|
children: [
|
|
5476
5519
|
/* @__PURE__ */ e.jsx(
|
|
5477
|
-
|
|
5520
|
+
Ne,
|
|
5478
5521
|
{
|
|
5479
5522
|
role: "query-section",
|
|
5480
5523
|
className: "flex",
|
|
@@ -5483,17 +5526,17 @@ function sr() {
|
|
|
5483
5526
|
children: /* @__PURE__ */ e.jsx(yl, {})
|
|
5484
5527
|
}
|
|
5485
5528
|
),
|
|
5486
|
-
/* @__PURE__ */ e.jsx(
|
|
5529
|
+
/* @__PURE__ */ e.jsx(ds, { withHandle: !0, className: "border" }),
|
|
5487
5530
|
/* @__PURE__ */ e.jsx(
|
|
5488
|
-
|
|
5531
|
+
Ne,
|
|
5489
5532
|
{
|
|
5490
5533
|
className: "pb-1",
|
|
5491
5534
|
role: "visual-section",
|
|
5492
5535
|
minSize: 0,
|
|
5493
5536
|
defaultSize: 60,
|
|
5494
|
-
children: s ? /* @__PURE__ */ e.jsxs(
|
|
5537
|
+
children: s ? /* @__PURE__ */ e.jsxs(cs, { direction: "horizontal", children: [
|
|
5495
5538
|
/* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
5496
|
-
|
|
5539
|
+
Ne,
|
|
5497
5540
|
{
|
|
5498
5541
|
className: "flex min-w-[275px]",
|
|
5499
5542
|
minSize: 20,
|
|
@@ -5502,8 +5545,8 @@ function sr() {
|
|
|
5502
5545
|
children: /* @__PURE__ */ e.jsx(er, {})
|
|
5503
5546
|
}
|
|
5504
5547
|
) }),
|
|
5505
|
-
/* @__PURE__ */ e.jsx(
|
|
5506
|
-
/* @__PURE__ */ e.jsx(
|
|
5548
|
+
/* @__PURE__ */ e.jsx(ds, { className: "border" }),
|
|
5549
|
+
/* @__PURE__ */ e.jsx(Ne, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(ta, {}) })
|
|
5507
5550
|
] }) : /* @__PURE__ */ e.jsx(ta, {})
|
|
5508
5551
|
}
|
|
5509
5552
|
)
|
|
@@ -5513,12 +5556,12 @@ function sr() {
|
|
|
5513
5556
|
}
|
|
5514
5557
|
function ar({ authToken: s, onSave: t, onClose: a }) {
|
|
5515
5558
|
z((r) => r.themeStyle);
|
|
5516
|
-
const n = m((r) => r.actions.setOnSave), l = m((r) => r.actions.setOnClose),
|
|
5559
|
+
const n = m((r) => r.actions.setOnSave), l = m((r) => r.actions.setOnClose), d = z((r) => r.actions.setAuthToken);
|
|
5517
5560
|
return Z(() => {
|
|
5518
5561
|
t && n(t), a && l(a);
|
|
5519
5562
|
}, [t, n, a, l]), Z(() => {
|
|
5520
|
-
s && s.accessToken &&
|
|
5521
|
-
}, [s,
|
|
5563
|
+
s && s.accessToken && d(s);
|
|
5564
|
+
}, [s, d]), /* @__PURE__ */ e.jsx(xs, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(
|
|
5522
5565
|
xn,
|
|
5523
5566
|
{
|
|
5524
5567
|
style: {
|
|
@@ -5540,7 +5583,7 @@ function tr() {
|
|
|
5540
5583
|
function l(r) {
|
|
5541
5584
|
s && (n(s, r), t(!1));
|
|
5542
5585
|
}
|
|
5543
|
-
function
|
|
5586
|
+
function d() {
|
|
5544
5587
|
t(!1);
|
|
5545
5588
|
}
|
|
5546
5589
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -5550,7 +5593,7 @@ function tr() {
|
|
|
5550
5593
|
className: Q("flex grow", {
|
|
5551
5594
|
"max-h-0 overflow-hidden": !a
|
|
5552
5595
|
}),
|
|
5553
|
-
children: /* @__PURE__ */ e.jsx(ar, { onSave: l, onClose:
|
|
5596
|
+
children: /* @__PURE__ */ e.jsx(ar, { onSave: l, onClose: d })
|
|
5554
5597
|
}
|
|
5555
5598
|
);
|
|
5556
5599
|
}
|
|
@@ -5562,15 +5605,15 @@ function nr() {
|
|
|
5562
5605
|
z((r) => r.actions.addFilter), z((r) => r.actions.removeFilter), z(
|
|
5563
5606
|
(r) => r.actions.removeFilterValue
|
|
5564
5607
|
);
|
|
5565
|
-
const { modelItems: n, columns: l } =
|
|
5608
|
+
const { modelItems: n, columns: l } = _e(), { assignFilter: d } = Xa();
|
|
5566
5609
|
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: l == null ? void 0 : l.map((r) => {
|
|
5567
5610
|
const o = a == null ? void 0 : a.find(
|
|
5568
|
-
(
|
|
5611
|
+
(c) => c.column === de(r.column_name) && c.table === t && c.database === s
|
|
5569
5612
|
);
|
|
5570
5613
|
return /* @__PURE__ */ e.jsx(
|
|
5571
5614
|
"div",
|
|
5572
5615
|
{
|
|
5573
|
-
onClick: () =>
|
|
5616
|
+
onClick: () => d(r),
|
|
5574
5617
|
className: Q(
|
|
5575
5618
|
"group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
5576
5619
|
{
|
|
@@ -5600,7 +5643,7 @@ function lr() {
|
|
|
5600
5643
|
onClick: () => s(!1),
|
|
5601
5644
|
className: "h-7 w-7 p-0",
|
|
5602
5645
|
variant: "ghost",
|
|
5603
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5646
|
+
children: /* @__PURE__ */ e.jsx(Je, {})
|
|
5604
5647
|
}
|
|
5605
5648
|
)
|
|
5606
5649
|
] }),
|
|
@@ -5684,7 +5727,7 @@ function ur({
|
|
|
5684
5727
|
showFooter: t = !0,
|
|
5685
5728
|
...a
|
|
5686
5729
|
}) {
|
|
5687
|
-
return /* @__PURE__ */ e.jsx(
|
|
5730
|
+
return /* @__PURE__ */ e.jsx(xs, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(bn, { dashboardProps: a, children: [
|
|
5688
5731
|
/* @__PURE__ */ e.jsx(yn, {}),
|
|
5689
5732
|
/* @__PURE__ */ e.jsxs(vn, { children: [
|
|
5690
5733
|
/* @__PURE__ */ e.jsx(ir, {}),
|
|
@@ -5697,7 +5740,7 @@ function ur({
|
|
|
5697
5740
|
] }) });
|
|
5698
5741
|
}
|
|
5699
5742
|
export {
|
|
5700
|
-
|
|
5743
|
+
Be as A,
|
|
5701
5744
|
Sn as B,
|
|
5702
5745
|
wn as C,
|
|
5703
5746
|
ur as D,
|
|
@@ -5714,8 +5757,8 @@ export {
|
|
|
5714
5757
|
Bn as S,
|
|
5715
5758
|
Jn as T,
|
|
5716
5759
|
Wn as U,
|
|
5717
|
-
|
|
5718
|
-
|
|
5760
|
+
Bs as a,
|
|
5761
|
+
Us as b,
|
|
5719
5762
|
za as c,
|
|
5720
5763
|
Oa as d,
|
|
5721
5764
|
Fa as e,
|
|
@@ -5729,7 +5772,7 @@ export {
|
|
|
5729
5772
|
En as m,
|
|
5730
5773
|
qn as n,
|
|
5731
5774
|
Rn as o,
|
|
5732
|
-
|
|
5775
|
+
qe as p,
|
|
5733
5776
|
_n as q,
|
|
5734
5777
|
$n as r,
|
|
5735
5778
|
Pn as s,
|
|
@@ -5738,6 +5781,6 @@ export {
|
|
|
5738
5781
|
Gn as v,
|
|
5739
5782
|
Qn as w,
|
|
5740
5783
|
Kn as x,
|
|
5741
|
-
|
|
5742
|
-
|
|
5784
|
+
Gs as y,
|
|
5785
|
+
_e as z
|
|
5743
5786
|
};
|