react-semaphor 0.0.295 → 0.0.297

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.
@@ -1,4 +1,4 @@
1
- import { c as q, p as hs, u as k, n as Fs, o as Oe, q as e, r as Ts, s as Is, t as O, j as Ds, v as Ms, w as Ls, x as Es, y as As, L as H, z as re, A as oa, E as ca, H as da, J as ua, K as rt, M as it, N as ot, O as Ys, Q as W, R as Je, V as ct, F as ha, W as We, Y as Ye, Z as Vs, _ as ma, $ as qs, a0 as fe, a1 as ge, a2 as je, a3 as be, a4 as ke, a5 as ye, a6 as J, T as Rs, a7 as d, a8 as _s, a9 as Hs, aa as $s, ab as xa, ac as pa, ad as xe, ae as dt, af as ut, ag as fa, ah as ht, C as mt, ai as xt, aj as ga, B as pt, ak as Ps, al as ft, am as Xs, an as ja, ao as Ns, ap as me, aq as we, ar as de, as as ms, at as ba, au as gt, av as jt, aw as ya, ax as bt, ay as yt, az as vt, aA as Ct, aB as Nt, aC as qe, aD as Ss, aE as St, a as wt, aF as Ke, aG as ws, aH as Ve, aI as ks, aJ as kt, aK as zt, aL as Ot, aM as Ft, aN as Tt, aO as It, aP as Cs, aQ as Dt, aR as Zs, aS as Mt, aT as ea, aU as Lt, aV as Et, aW as At, aX as va, aY as ce, aZ as Bs, a_ as Ca, a$ as Vt, b0 as qt, b1 as rs, b2 as Rt, b3 as _t, b4 as Ht, b5 as $t, b6 as Pt, b7 as Bt, b8 as Ut, l as Gt, b9 as xs, ba as Na, bb as Sa, bc as wa, bd as is, be as ka, bf as os, bg as sa, bh as Kt, bi as Qt, bj as ps, bk as fs, bl as gs, bm as Jt, bn as Wt, X as za, bo as Yt, bp as Xt, bq as Zt, br as js, bs as Ie, f as en, bt as Ge, bu as Oa, bv as sn, bw as an, bx as cs, by as tn, bz as nn, bA as ln, bB as aa, bC as rn, bD as on, bE as cn, bF as dn, bG as un, bH as hn, bI as mn, bJ as xn, bK as De, bL as U, bM as G, bN as Us, bO as K, bP as pn, bQ as Fa, bR as fn, bS as gn, bT as jn, bU as bn, bV as yn, bW as vn, bX as Cn, bY as Nn, bZ as Sn } from "./index-Ax3VyGG8.js";
1
+ import { c as q, p as hs, u as z, n as Fs, o as Oe, q as e, r as Is, s as Ts, t as F, j as Ds, v as Ms, w as Ls, x as Es, y as As, L as H, z as re, A as oa, E as ca, H as da, J as ua, K as rt, M as it, N as ot, O as Ys, Q as W, R as Je, V as u, W as ct, F as ha, Y as We, Z as Ye, _ as Vs, $ as ma, a0 as qs, a1 as fe, a2 as ge, a3 as je, a4 as be, a5 as ke, a6 as ye, a7 as Q, T as Rs, a8 as _s, a9 as Hs, aa as $s, ab as xa, ac as pa, ad as xe, ae as dt, af as ut, ag as fa, ah as ht, C as mt, ai as xt, aj as ga, B as pt, ak as Ps, al as ft, am as Xs, an as ja, ao as Ns, ap as me, aq as we, ar as de, as as ms, at as ba, au as gt, av as jt, aw as ya, ax as bt, ay as yt, az as vt, aA as Ct, aB as Nt, aC as qe, aD as Ss, aE as St, a as wt, aF as Ke, aG as ws, aH as Ve, aI as ks, aJ as kt, aK as zt, aL as Ot, aM as Ft, aN as It, aO as Tt, aP as Cs, aQ as Dt, aR as Zs, aS as Mt, aT as ea, aU as Lt, aV as Et, aW as At, aX as va, aY as ce, aZ as Bs, a_ as Ca, a$ as Vt, b0 as qt, b1 as rs, b2 as Rt, b3 as _t, b4 as Ht, b5 as $t, b6 as Pt, b7 as Bt, b8 as Ut, l as Gt, b9 as xs, ba as Na, bb as Sa, bc as wa, bd as is, be as ka, bf as os, bg as sa, bh as Kt, bi as Qt, bj as ps, bk as fs, bl as gs, bm as Jt, bn as Wt, X as za, bo as Yt, bp as Xt, bq as Zt, br as js, bs as Te, f as en, bt as Ge, bu as Oa, bv as sn, bw as an, bx as cs, by as tn, bz as nn, bA as ln, bB as aa, bC as rn, bD as on, bE as cn, bF as dn, bG as un, bH as hn, bI as mn, bJ as xn, bK as De, bL as U, bM as G, bN as Us, bO as K, bP as pn, bQ as Fa, bR as fn, bS as gn, bT as jn, bU as bn, bV as yn, bW as vn, bX as Cn, bY as Nn, bZ as Sn } from "./index-D9JU1xVZ.js";
2
2
  import * as ta from "react";
3
3
  import ze, { useState as R, useMemo as zs, useEffect as Z, useRef as Xe, Suspense as wn } from "react";
4
4
  import "react-dom";
@@ -63,7 +63,7 @@ const Ks = q("ChartLine", [
63
63
  * This source code is licensed under the ISC license.
64
64
  * See the LICENSE file in the root directory of this source tree.
65
65
  */
66
- const Ta = q("ChartNoAxesGantt", [
66
+ const Ia = q("ChartNoAxesGantt", [
67
67
  ["path", { d: "M8 6h10", key: "9lnwnk" }],
68
68
  ["path", { d: "M6 12h9", key: "1g9pqf" }],
69
69
  ["path", { d: "M11 18h7", key: "c8dzvl" }]
@@ -74,7 +74,7 @@ const Ta = q("ChartNoAxesGantt", [
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
76
  */
77
- const Ia = q("ChartPie", [
77
+ const Ta = q("ChartPie", [
78
78
  [
79
79
  "path",
80
80
  {
@@ -127,7 +127,7 @@ const Fn = q("CopyPlus", [
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
129
  */
130
- const Tn = q("Database", [
130
+ const In = q("Database", [
131
131
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
132
132
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
133
133
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -149,7 +149,7 @@ const Ma = q("EllipsisVertical", [
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
151
  */
152
- const In = q("Eraser", [
152
+ const Tn = q("Eraser", [
153
153
  [
154
154
  "path",
155
155
  {
@@ -601,22 +601,22 @@ async function sl(s, t) {
601
601
  }) : null;
602
602
  }
603
603
  function al() {
604
- const [s, t] = R(""), [a, n] = R(!1), l = k((j) => j.lenses), { setLenses: i, setSelectedLensId: r } = Fs(), [c, o] = R(!1), [h, u] = R(!1), y = k((j) => j.dashboard), g = k((j) => j.filterValues), { authToken: x } = Oe();
605
- async function f() {
604
+ const [s, t] = R(""), [a, n] = R(!1), l = z((j) => j.lenses), { setLenses: i, setSelectedLensId: r } = Fs(), [c, o] = R(!1), [x, d] = R(!1), y = z((j) => j.dashboard), f = z((j) => j.filterValues), { authToken: m } = Oe();
605
+ async function g() {
606
606
  o(!0);
607
607
  const j = qa(
608
608
  y
609
- ), F = await el(
609
+ ), D = await el(
610
610
  s,
611
611
  j,
612
- g,
613
- x == null ? void 0 : x.accessToken
612
+ f,
613
+ m == null ? void 0 : m.accessToken
614
614
  );
615
- F && (i([...l || [], F]), r(F.id), u(!1)), o(!1);
615
+ D && (i([...l || [], D]), r(D.id), d(!1)), o(!1);
616
616
  }
617
- return /* @__PURE__ */ e.jsxs(Ts, { open: h, onOpenChange: u, children: [
618
- /* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
619
- O,
617
+ return /* @__PURE__ */ e.jsxs(Is, { open: x, onOpenChange: d, children: [
618
+ /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
619
+ F,
620
620
  {
621
621
  variant: "secondary",
622
622
  className: "h-7 p-2",
@@ -648,12 +648,12 @@ function al() {
648
648
  ] }) }),
649
649
  a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
650
650
  /* @__PURE__ */ e.jsx(oa, { children: /* @__PURE__ */ e.jsx(
651
- O,
651
+ F,
652
652
  {
653
653
  size: "sm",
654
654
  variant: "outline",
655
655
  type: "submit",
656
- onClick: f,
656
+ onClick: g,
657
657
  disabled: c,
658
658
  children: c ? "Creating..." : "Add"
659
659
  }
@@ -662,41 +662,41 @@ function al() {
662
662
  ] });
663
663
  }
664
664
  function tl() {
665
- const [s, t] = R(!1), a = k((u) => u.lenses), n = k((u) => u.selectedLensId), { setLenses: l, setSelectedLensId: i } = Fs(), { authToken: r } = Oe();
666
- async function c(u) {
667
- i(u);
665
+ const [s, t] = R(!1), a = z((d) => d.lenses), n = z((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: i } = Fs(), { authToken: r } = Oe();
666
+ async function c(d) {
667
+ i(d);
668
668
  }
669
- async function o(u) {
670
- if (await sl(u, r == null ? void 0 : r.accessToken)) {
671
- const g = a == null ? void 0 : a.filter((x) => x.id !== u);
672
- l(g || []), i("original");
669
+ async function o(d) {
670
+ if (await sl(d, r == null ? void 0 : r.accessToken)) {
671
+ const f = a == null ? void 0 : a.filter((m) => m.id !== d);
672
+ l(f || []), i("original");
673
673
  }
674
674
  }
675
- async function h(u) {
676
- const y = a == null ? void 0 : a.map((f) => f.id === u.id ? {
677
- ...f,
678
- isDefault: !u.isDefault
675
+ async function x(d) {
676
+ const y = a == null ? void 0 : a.map((g) => g.id === d.id ? {
677
+ ...g,
678
+ isDefault: !d.isDefault
679
679
  } : {
680
- ...f,
680
+ ...g,
681
681
  isDefault: !1
682
682
  });
683
683
  l(y || []);
684
- const g = {
685
- ...u,
686
- isDefault: !u.isDefault
684
+ const f = {
685
+ ...d,
686
+ isDefault: !d.isDefault
687
687
  };
688
- await Os(g, r == null ? void 0 : r.accessToken);
689
- const x = a == null ? void 0 : a.find((f) => f.isDefault);
690
- if (x && x.id !== u.id) {
691
- const f = {
692
- ...x,
688
+ await Os(f, r == null ? void 0 : r.accessToken);
689
+ const m = a == null ? void 0 : a.find((g) => g.isDefault);
690
+ if (m && m.id !== d.id) {
691
+ const g = {
692
+ ...m,
693
693
  isDefault: !1
694
694
  };
695
- await Os(f, r == null ? void 0 : r.accessToken);
695
+ await Os(g, r == null ? void 0 : r.accessToken);
696
696
  }
697
697
  }
698
698
  return /* @__PURE__ */ e.jsxs(ca, { open: s, onOpenChange: t, children: [
699
- /* @__PURE__ */ e.jsx(da, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Ln, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
699
+ /* @__PURE__ */ e.jsx(da, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Ln, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
700
700
  /* @__PURE__ */ e.jsxs(ua, { align: "end", className: "w-60", children: [
701
701
  /* @__PURE__ */ e.jsx(rt, { className: "px-3", children: "Lenses" }),
702
702
  /* @__PURE__ */ e.jsx(it, {}),
@@ -707,25 +707,25 @@ function tl() {
707
707
  onValueChange: c,
708
708
  children: [
709
709
  /* @__PURE__ */ e.jsx(Ys, { value: "original", children: "Original" }),
710
- a == null ? void 0 : a.map((u) => /* @__PURE__ */ e.jsxs(
710
+ a == null ? void 0 : a.map((d) => /* @__PURE__ */ e.jsxs(
711
711
  Ys,
712
712
  {
713
713
  className: "group flex justify-between gap-2",
714
- value: u.id,
714
+ value: d.id,
715
715
  children: [
716
- /* @__PURE__ */ e.jsx("p", { children: u.name }),
716
+ /* @__PURE__ */ e.jsx("p", { children: d.name }),
717
717
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
718
718
  /* @__PURE__ */ e.jsx(
719
719
  Vn,
720
720
  {
721
721
  onClick: (y) => {
722
- y.preventDefault(), h(u);
722
+ y.preventDefault(), x(d);
723
723
  },
724
724
  className: W(
725
725
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
726
726
  {
727
- invisible: !u.isDefault,
728
- "text-green-500": u.isDefault
727
+ invisible: !d.isDefault,
728
+ "text-green-500": d.isDefault
729
729
  }
730
730
  ),
731
731
  strokeWidth: 1.5
@@ -735,7 +735,7 @@ function tl() {
735
735
  Je,
736
736
  {
737
737
  onClick: (y) => {
738
- y.preventDefault(), o(u.id);
738
+ y.preventDefault(), o(d.id);
739
739
  },
740
740
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
741
741
  strokeWidth: 1.5
@@ -744,7 +744,7 @@ function tl() {
744
744
  ] })
745
745
  ]
746
746
  },
747
- u.id
747
+ d.id
748
748
  ))
749
749
  ]
750
750
  }
@@ -753,25 +753,28 @@ function tl() {
753
753
  ] });
754
754
  }
755
755
  function nl() {
756
- const { authToken: s } = Oe(), t = k((p) => p.lenses), a = k((p) => p.selectedLensId), n = t == null ? void 0 : t.find((p) => p.id === a), l = k((p) => p.dashboard);
757
- k((p) => p.selectedSheetId);
758
- const i = k(
756
+ const { authToken: s } = Oe(), t = z((p) => p.lenses), a = z((p) => p.selectedLensId), n = t == null ? void 0 : t.find((p) => p.id === a), l = z((p) => p.dashboard);
757
+ z((p) => p.selectedSheetId);
758
+ const i = z(
759
759
  (p) => p.isDashboardEditing
760
- ), [r, c] = R(!1), o = k((p) => p.filterValues), h = k((p) => p.isVisualEditing), u = k((p) => p.showFilters);
761
- k(
760
+ ), r = u(
761
+ (p) => p.selectedConnectionId
762
+ ), [c, o] = R(!1), x = z((p) => p.filterValues), d = z((p) => p.isVisualEditing), y = z((p) => p.showFilters);
763
+ z(
762
764
  (p) => p.showDashboardJSON
763
765
  );
764
- const y = k((p) => p.onSaveFunction), g = k(
766
+ const f = z((p) => p.onSaveFunction), m = z(
765
767
  (p) => p.actions.setShowFilters
766
- ), { addFrame: x, setSelectedFrameId: f } = k(
768
+ ), { addFrame: g, setSelectedFrameId: j } = z(
767
769
  (p) => p.actions
768
- ), { getSelectedSheet: j, setIsDashboardEditing: F, setShowDashboardJSON: N } = k((p) => p.actions), L = j(), { tenantId: T, endUserId: z } = zs(
770
+ ), { getSelectedSheet: D, setIsDashboardEditing: C, setShowDashboardJSON: L } = z((p) => p.actions), I = D(), { tenantId: O, endUserId: N } = zs(
769
771
  () => ct(s == null ? void 0 : s.accessToken),
770
772
  [s == null ? void 0 : s.accessToken]
771
- ), v = zs(() => T || z, [T, z]), D = () => {
772
- if (!i || !L)
773
+ ), T = zs(() => O || N, [O, N]), A = () => {
774
+ if (!i || !I)
773
775
  return;
774
776
  const p = {
777
+ connectionId: r,
775
778
  id: We(),
776
779
  title: "Title",
777
780
  description: "Description",
@@ -786,45 +789,45 @@ function nl() {
786
789
  type: "bar",
787
790
  sql: "select COUNT(*) from YOUR_TABLE",
788
791
  data: []
789
- }, C = {
792
+ }, k = {
790
793
  id: We(),
791
794
  cards: [p],
792
795
  activeCardId: p.id
793
796
  };
794
- x(L.id, C), f(C.id);
795
- }, A = () => {
796
- F(!0);
797
+ g(I.id, k), j(k.id);
798
+ }, h = () => {
799
+ C(!0);
797
800
  };
798
- async function m() {
799
- if (c(!0), !a || !n)
801
+ async function v() {
802
+ if (o(!0), !a || !n)
800
803
  return;
801
804
  const p = qa(
802
805
  l
803
- ), C = JSON.stringify(p), I = {
806
+ ), k = JSON.stringify(p), V = {
804
807
  ...n,
805
- template: C,
806
- filterValues: o
808
+ template: k,
809
+ filterValues: x
807
810
  };
808
- await Os(I, s == null ? void 0 : s.accessToken), Ye.success("Lens saved"), y == null || y(p), c(!1);
811
+ await Os(V, s == null ? void 0 : s.accessToken), Ye.success("Lens saved"), f == null || f(p), o(!1);
809
812
  }
810
- return h ? null : /* @__PURE__ */ e.jsxs(
813
+ return d ? null : /* @__PURE__ */ e.jsxs(
811
814
  "div",
812
815
  {
813
816
  className: "flex items-center justify-between gap-2 border-b bg-muted/50 py-2 pl-3 pr-2",
814
817
  role: "dashboard-controls",
815
818
  children: [
816
- !h && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: n == null ? void 0 : n.name }) }),
819
+ !d && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: n == null ? void 0 : n.name }) }),
817
820
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
818
- i && !h && v && /* @__PURE__ */ e.jsx(al, {}),
819
- !h && v && /* @__PURE__ */ e.jsx(tl, {}),
820
- i && !h && /* @__PURE__ */ e.jsxs(
821
- O,
821
+ i && !d && T && /* @__PURE__ */ e.jsx(al, {}),
822
+ !d && T && /* @__PURE__ */ e.jsx(tl, {}),
823
+ i && !d && /* @__PURE__ */ e.jsxs(
824
+ F,
822
825
  {
823
826
  variant: "secondary",
824
827
  className: "h-7 p-2",
825
828
  size: "sm",
826
829
  disabled: !i,
827
- onClick: D,
830
+ onClick: A,
828
831
  children: [
829
832
  /* @__PURE__ */ e.jsx(Ds, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
830
833
  "Frame"
@@ -832,51 +835,51 @@ function nl() {
832
835
  }
833
836
  ),
834
837
  !i && /* @__PURE__ */ e.jsx(
835
- O,
838
+ F,
836
839
  {
837
840
  variant: "ghost",
838
841
  className: "h-7 p-2",
839
- onClick: A,
842
+ onClick: h,
840
843
  size: "sm",
841
844
  children: /* @__PURE__ */ e.jsx(Aa, { className: "h-4 w-4", strokeWidth: 1.5 })
842
845
  }
843
846
  ),
844
- i && !h && /* @__PURE__ */ e.jsx(
845
- O,
847
+ i && !d && /* @__PURE__ */ e.jsx(
848
+ F,
846
849
  {
847
850
  variant: "ghost",
848
851
  role: "close",
849
852
  className: "h-7 p-2",
850
853
  onClick: () => {
851
- F(!1), N(!1);
854
+ C(!1), L(!1);
852
855
  },
853
856
  size: "sm",
854
857
  children: /* @__PURE__ */ e.jsx(Je, { className: "h-4 w-4", strokeWidth: 1.5 })
855
858
  }
856
859
  ),
857
- i && !h && v && /* @__PURE__ */ e.jsx(
858
- O,
860
+ i && !d && T && /* @__PURE__ */ e.jsx(
861
+ F,
859
862
  {
860
863
  className: "h-7 p-2",
861
864
  variant: "ghost",
862
- disabled: r,
863
- onClick: m,
865
+ disabled: c,
866
+ onClick: v,
864
867
  size: "sm",
865
868
  children: /* @__PURE__ */ e.jsx(Un, { className: "h-4 w-4", strokeWidth: 1.5 })
866
869
  }
867
870
  ),
868
- !u && !h && i && /* @__PURE__ */ e.jsx(
869
- O,
871
+ !y && !d && i && /* @__PURE__ */ e.jsx(
872
+ F,
870
873
  {
871
874
  className: "h-7 p-2",
872
875
  variant: "ghost",
873
- onClick: () => g(!0),
876
+ onClick: () => m(!0),
874
877
  size: "sm",
875
878
  children: /* @__PURE__ */ e.jsx(ha, { className: "h-4 w-4", strokeWidth: 1.5 })
876
879
  }
877
880
  ),
878
- !h && i && !1,
879
- !h && !1
881
+ !d && i && !1,
882
+ !d && !1
880
883
  ] })
881
884
  ]
882
885
  }
@@ -892,15 +895,15 @@ function Ue({
892
895
  onChange: r,
893
896
  showNone: c = !1,
894
897
  className: o,
895
- showIcon: h = !0,
896
- disabled: u = !1
898
+ showIcon: x = !0,
899
+ disabled: d = !1
897
900
  }) {
898
901
  const y = n ? "Loading..." : l ? "Error" : a;
899
- function g() {
902
+ function f() {
900
903
  if (s === "Connection")
901
904
  return /* @__PURE__ */ e.jsx(Bn, { className: "size-4 rotate-90" });
902
905
  if (s === "Database")
903
- return /* @__PURE__ */ e.jsx(Tn, { className: "size-4" });
906
+ return /* @__PURE__ */ e.jsx(In, { className: "size-4" });
904
907
  if (s === "Schema")
905
908
  return /* @__PURE__ */ e.jsx($n, { className: "size-4" });
906
909
  if (s === "Table")
@@ -909,11 +912,11 @@ function Ue({
909
912
  return /* @__PURE__ */ e.jsx(kn, { className: "size-4" });
910
913
  }
911
914
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
912
- h && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: i ? /* @__PURE__ */ e.jsxs(Vs, { children: [
913
- /* @__PURE__ */ e.jsx(ma, { children: g() }),
915
+ x && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: i ? /* @__PURE__ */ e.jsxs(Vs, { children: [
916
+ /* @__PURE__ */ e.jsx(ma, { children: f() }),
914
917
  /* @__PURE__ */ e.jsx(qs, { className: "text-xs", align: "start", children: i })
915
- ] }) : g() }),
916
- /* @__PURE__ */ e.jsxs(fe, { disabled: u, value: y, onValueChange: r, children: [
918
+ ] }) : f() }),
919
+ /* @__PURE__ */ e.jsxs(fe, { disabled: d, value: y, onValueChange: r, children: [
917
920
  /* @__PURE__ */ e.jsx(
918
921
  ge,
919
922
  {
@@ -932,35 +935,35 @@ function Ue({
932
935
  /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(ke, { children: [
933
936
  n ? /* @__PURE__ */ e.jsx(ye, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(ye, { children: s }),
934
937
  /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
935
- c && /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }, "none"),
936
- t && t.map((x, f) => /* @__PURE__ */ e.jsx(J, { value: x.id, children: x.name }, f))
938
+ c && /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
939
+ t && t.map((m, g) => /* @__PURE__ */ e.jsx(Q, { value: m.id, children: m.name }, g))
937
940
  ] }),
938
- (n || l) && /* @__PURE__ */ e.jsx(J, { value: y, children: y })
941
+ (n || l) && /* @__PURE__ */ e.jsx(Q, { value: y, children: y })
939
942
  ] }) })
940
943
  ] })
941
944
  ] });
942
945
  }
943
946
  function ll({ column: s }) {
944
- const [t, a] = R(!1), n = d((x) => x.selectedTableName), l = d(
945
- (x) => x.selectedSchemaName
946
- ), i = d(
947
- (x) => x.selectedDatamodelId
948
- ), r = d((x) => x.sqlGen), { modelItems: c } = Re(), o = d((x) => x.actions.setSqlGen), h = d((x) => x.actions.setCardSql), u = d((x) => x.actions.setRunSql);
949
- function y(x, f) {
947
+ const [t, a] = R(!1), n = u((m) => m.selectedTableName), l = u(
948
+ (m) => m.selectedSchemaName
949
+ ), i = u(
950
+ (m) => m.selectedDatamodelId
951
+ ), r = u((m) => m.sqlGen), { modelItems: c } = Re(), o = u((m) => m.actions.setSqlGen), x = u((m) => m.actions.setCardSql), d = u((m) => m.actions.setRunSql);
952
+ function y(m, g) {
950
953
  var L;
951
- const j = xa(x, r, f), F = (L = c == null ? void 0 : c.find(
952
- (T) => T.id === i
954
+ const j = xa(m, r, g), D = (L = c == null ? void 0 : c.find(
955
+ (I) => I.id === i
953
956
  )) == null ? void 0 : L.name;
954
957
  o(j);
955
- const N = pa(
958
+ const C = pa(
956
959
  j,
957
960
  xe(l || ""),
958
961
  xe(n),
959
- F
962
+ D
960
963
  );
961
- N && (h(N), u(!0)), a(!1);
964
+ C && (x(C), d(!0)), a(!1);
962
965
  }
963
- function g() {
966
+ function f() {
964
967
  return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
965
968
  /* @__PURE__ */ e.jsx(
966
969
  "li",
@@ -1011,7 +1014,7 @@ function ll({ column: s }) {
1011
1014
  {
1012
1015
  align: "center",
1013
1016
  className: "w-20 rounded-md p-0 shadow-none",
1014
- children: g()
1017
+ children: f()
1015
1018
  }
1016
1019
  )
1017
1020
  ] });
@@ -1034,108 +1037,108 @@ function rl({
1034
1037
  columns: a,
1035
1038
  status: n
1036
1039
  }) {
1037
- const l = d((m) => m.sqlGen), i = d(
1038
- (m) => m.selectedConnectionId
1039
- ), r = d(
1040
- (m) => m.selectedDatabaseName
1041
- ), c = d(
1042
- (m) => m.selectedSchemaName
1043
- ), o = d((m) => m.selectedTableName), h = d(
1044
- (m) => m.selectedDatamodelId
1045
- ), u = k(
1046
- (m) => m.dashboard.aiScopeTables
1047
- ), { setAIScopeTables: y } = k((m) => m.actions), g = d((m) => m.actions.setRunSql), x = d((m) => m.actions.setSqlGen), f = d(
1048
- (m) => m.actions.setIsShowingVisual
1049
- ), j = d((m) => m.actions.setCardSql), { connectionType: F, modelItems: N } = Re();
1050
- function L(m) {
1040
+ const l = u((h) => h.sqlGen), i = u(
1041
+ (h) => h.selectedConnectionId
1042
+ ), r = u(
1043
+ (h) => h.selectedDatabaseName
1044
+ ), c = u(
1045
+ (h) => h.selectedSchemaName
1046
+ ), o = u((h) => h.selectedTableName), x = u(
1047
+ (h) => h.selectedDatamodelId
1048
+ ), d = z(
1049
+ (h) => h.dashboard.aiScopeTables
1050
+ ), { setAIScopeTables: y } = z((h) => h.actions), f = u((h) => h.actions.setRunSql), m = u((h) => h.actions.setSqlGen), g = u(
1051
+ (h) => h.actions.setIsShowingVisual
1052
+ ), j = u((h) => h.actions.setCardSql), { connectionType: D, modelItems: C } = Re();
1053
+ function L(h) {
1051
1054
  var V;
1052
- const p = xa(m, l);
1053
- x(p);
1054
- const C = (V = N == null ? void 0 : N.find(
1055
- ($) => $.id === h
1056
- )) == null ? void 0 : V.name, I = pa(p, xe(s), xe(t), C);
1057
- I && (j(I), g(!0));
1055
+ const v = xa(h, l);
1056
+ m(v);
1057
+ const p = (V = C == null ? void 0 : C.find(
1058
+ ($) => $.id === x
1059
+ )) == null ? void 0 : V.name, k = pa(v, xe(s), xe(t), p);
1060
+ k && (j(k), f(!0));
1058
1061
  }
1059
- function T() {
1060
- return (u == null ? void 0 : u.find(
1061
- (m) => m.connectinonId === i && m.tableName === o
1062
+ function I() {
1063
+ return (d == null ? void 0 : d.find(
1064
+ (h) => h.connectinonId === i && h.tableName === o
1062
1065
  )) !== void 0;
1063
1066
  }
1064
- function z(m) {
1065
- if (m === !0 && o && i) {
1066
- const p = {
1067
+ function O(h) {
1068
+ if (h === !0 && o && i) {
1069
+ const v = {
1067
1070
  connectinonId: i,
1068
- connectionType: F,
1071
+ connectionType: D,
1069
1072
  databaseName: r,
1070
1073
  schemaName: c,
1071
1074
  tableName: o
1072
- }, I = [...u || [], p].filter(
1075
+ }, k = [...d || [], v].filter(
1073
1076
  (V, $, B) => B.findIndex(
1074
1077
  (Y) => Y.connectinonId === V.connectinonId && Y.tableName === V.tableName
1075
1078
  ) === $
1076
1079
  );
1077
- y(I), Ye.success(`Added '${o}' to AI Scope`, {
1080
+ y(k), Ye.success(`Added '${o}' to AI Scope`, {
1078
1081
  position: "top-right",
1079
1082
  duration: 2500,
1080
1083
  richColors: !0
1081
1084
  });
1082
1085
  } else {
1083
- const p = (u || []).filter(
1084
- (C) => C.connectinonId !== i && C.tableName !== o
1086
+ const v = (d || []).filter(
1087
+ (p) => p.connectinonId !== i && p.tableName !== o
1085
1088
  );
1086
- y(p), Ye(`Removed '${o}' from AI Scope`, {
1089
+ y(v), Ye(`Removed '${o}' from AI Scope`, {
1087
1090
  position: "top-right",
1088
1091
  duration: 2e3,
1089
1092
  richColors: !0
1090
1093
  });
1091
1094
  }
1092
1095
  }
1093
- function v() {
1096
+ function N() {
1094
1097
  var V;
1095
- let m = ja(s, t);
1096
- const p = (V = N == null ? void 0 : N.find(
1097
- ($) => $.id === h
1098
+ let h = ja(s, t);
1099
+ const v = (V = C == null ? void 0 : C.find(
1100
+ ($) => $.id === x
1098
1101
  )) == null ? void 0 : V.name;
1099
- console.log("modelName", p), h && h !== "none" && (m = `${Ns}.${p}`);
1100
- let C = m;
1101
- return (($) => /[A-Z]/.test($))(t) && (C = C.split(".").map((B) => `"${B}"`).join(".")), C;
1102
+ console.log("modelName", v), x && x !== "none" && (h = `${Ns}.${v}`);
1103
+ let p = h;
1104
+ return (($) => /[A-Z]/.test($))(t) && (p = p.split(".").map((B) => `"${B}"`).join(".")), p;
1102
1105
  }
1103
- function D() {
1104
- const m = v();
1105
- f(!1);
1106
- const p = F === "MSSQL" ? `SELECT top 10 * FROM ${m}` : `SELECT * FROM ${m} LIMIT 10`;
1107
- j(p), g(!0);
1106
+ function T() {
1107
+ const h = N();
1108
+ g(!1);
1109
+ const v = D === "MSSQL" ? `SELECT top 10 * FROM ${h}` : `SELECT * FROM ${h} LIMIT 10`;
1110
+ j(v), f(!0);
1108
1111
  }
1109
1112
  function A() {
1110
- const m = v();
1111
- j(`SELECT COUNT(*) as count FROM ${m}`), g(!0);
1113
+ const h = N();
1114
+ j(`SELECT COUNT(*) as count FROM ${h}`), f(!0);
1112
1115
  }
1113
1116
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
1114
1117
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
1115
1118
  /* @__PURE__ */ e.jsx(
1116
1119
  ga,
1117
1120
  {
1118
- title: `${T() ? "Remove from" : "Add to"} AI Scope`,
1119
- pressed: T(),
1120
- onPressedChange: z,
1121
+ title: `${I() ? "Remove from" : "Add to"} AI Scope`,
1122
+ pressed: I(),
1123
+ onPressedChange: O,
1121
1124
  variant: "outline",
1122
1125
  className: "h-9 px-2",
1123
1126
  children: /* @__PURE__ */ e.jsx(
1124
1127
  pt,
1125
1128
  {
1126
1129
  className: W("size-4", {
1127
- "text-primary": T(),
1128
- "text-muted-foreground": !T()
1130
+ "text-primary": I(),
1131
+ "text-muted-foreground": !I()
1129
1132
  })
1130
1133
  }
1131
1134
  )
1132
1135
  }
1133
1136
  ),
1134
1137
  /* @__PURE__ */ e.jsxs(
1135
- O,
1138
+ F,
1136
1139
  {
1137
1140
  disabled: n !== "Success",
1138
- onClick: D,
1141
+ onClick: T,
1139
1142
  size: "sm",
1140
1143
  variant: "secondary",
1141
1144
  className: "flex",
@@ -1146,7 +1149,7 @@ function rl({
1146
1149
  }
1147
1150
  ),
1148
1151
  /* @__PURE__ */ e.jsxs(
1149
- O,
1152
+ F,
1150
1153
  {
1151
1154
  disabled: n !== "Success",
1152
1155
  onClick: A,
@@ -1165,32 +1168,32 @@ function rl({
1165
1168
  {
1166
1169
  className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
1167
1170
  children: [
1168
- a == null ? void 0 : a.map((m) => /* @__PURE__ */ e.jsxs(
1171
+ a == null ? void 0 : a.map((h) => /* @__PURE__ */ e.jsxs(
1169
1172
  "div",
1170
1173
  {
1171
- onClick: () => L(m),
1174
+ onClick: () => L(h),
1172
1175
  className: W(
1173
1176
  "group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
1174
1177
  {
1175
- "bg-muted": ft(m, l)
1178
+ "bg-muted": ft(h, l)
1176
1179
  }
1177
1180
  ),
1178
1181
  children: [
1179
1182
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1180
- /* @__PURE__ */ e.jsx(Ra, { column: m }),
1181
- /* @__PURE__ */ e.jsx("span", { children: m.column_name })
1183
+ /* @__PURE__ */ e.jsx(Ra, { column: h }),
1184
+ /* @__PURE__ */ e.jsx("span", { children: h.column_name })
1182
1185
  ] }),
1183
1186
  /* @__PURE__ */ e.jsx(
1184
1187
  "div",
1185
1188
  {
1186
- onClick: (p) => p.stopPropagation(),
1189
+ onClick: (v) => v.stopPropagation(),
1187
1190
  className: "flex items-center justify-end",
1188
- children: fa.includes(m.data_type) && /* @__PURE__ */ e.jsx(ll, { column: m })
1191
+ children: fa.includes(h.data_type) && /* @__PURE__ */ e.jsx(ll, { column: h })
1189
1192
  }
1190
1193
  )
1191
1194
  ]
1192
1195
  },
1193
- m.column_name
1196
+ h.column_name
1194
1197
  )),
1195
1198
  /* @__PURE__ */ e.jsx(Xs, { orientation: "vertical" }),
1196
1199
  /* @__PURE__ */ e.jsx(Xs, { orientation: "horizontal" })
@@ -1202,40 +1205,40 @@ function rl({
1202
1205
  function Re(s, t) {
1203
1206
  var Pe, ss, as, ts, Be;
1204
1207
  let a = zs(() => [], []);
1205
- const n = Oe().authToken || s, l = d(
1208
+ const n = Oe().authToken || s, l = u(
1206
1209
  (S) => S.selectedConnectionId
1207
- ), i = d(
1210
+ ), i = u(
1208
1211
  (S) => S.selectedDatamodelId
1209
- ), r = d(
1212
+ ), r = u(
1210
1213
  (S) => S.selectedDatabaseName
1211
- ), c = d(
1214
+ ), c = u(
1212
1215
  (S) => S.selectedSchemaName
1213
- ), o = d((S) => S.selectedTableName), h = d(
1216
+ ), o = u((S) => S.selectedTableName), x = u(
1214
1217
  (S) => S.actions.setCurrentColumns
1215
- ), u = d(
1218
+ ), d = u(
1216
1219
  (S) => S.actions.setSelectedConnectionId
1217
- ), y = d(
1220
+ ), y = u(
1218
1221
  (S) => S.actions.setSelectedDatamodelId
1219
- ), g = d(
1222
+ ), f = u(
1220
1223
  (S) => S.actions.setSelectedDatabaseName
1221
- ), x = d(
1224
+ ), m = u(
1222
1225
  (S) => S.actions.setSelectedSchemaName
1223
- ), f = d(
1226
+ ), g = u(
1224
1227
  (S) => S.actions.setSelectedTableName
1225
- ), j = d((S) => S.actions.setCardSql);
1226
- function F(S) {
1228
+ ), j = u((S) => S.actions.setCardSql);
1229
+ function D(S) {
1227
1230
  return l && r && c && r !== "NA" ? !0 : l && S === "API" ? !1 : !!(l && S === "S3");
1228
1231
  }
1229
- function N(S) {
1232
+ function C(S) {
1230
1233
  return !!(l && r && r !== "NA" && c && o || l && (S === "S3" || S === "API") || i && i);
1231
1234
  }
1232
1235
  function L(S) {
1233
1236
  return l && S ? !(S === "API" || S === "S3") : !1;
1234
1237
  }
1235
1238
  const {
1236
- data: T,
1237
- isLoading: z,
1238
- isError: v
1239
+ data: I,
1240
+ isLoading: O,
1241
+ isError: N
1239
1242
  } = me({
1240
1243
  queryKey: ["connections"],
1241
1244
  queryFn: () => we(
@@ -1245,9 +1248,9 @@ function Re(s, t) {
1245
1248
  enabled: !!(n != null && n.accessToken)
1246
1249
  // Only fetch if authToken is present
1247
1250
  }), {
1248
- data: D,
1251
+ data: T,
1249
1252
  isLoading: A,
1250
- isError: m
1253
+ isError: h
1251
1254
  } = me({
1252
1255
  queryKey: ["models", l],
1253
1256
  queryFn: () => we(
@@ -1259,9 +1262,9 @@ function Re(s, t) {
1259
1262
  ),
1260
1263
  enabled: !!(n != null && n.accessToken) && !!l
1261
1264
  // Only fetch if authToken is present
1262
- }), p = T == null ? void 0 : T.connections.find(
1265
+ }), v = I == null ? void 0 : I.connections.find(
1263
1266
  (S) => S.id === l
1264
- ), C = p == null ? void 0 : p.type, I = (p == null ? void 0 : p.type) === "API" || (p == null ? void 0 : p.type) === "S3", {
1267
+ ), p = v == null ? void 0 : v.type, k = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
1265
1268
  data: V,
1266
1269
  isLoading: $,
1267
1270
  isFetching: B,
@@ -1276,10 +1279,10 @@ function Re(s, t) {
1276
1279
  connection_id: l
1277
1280
  }
1278
1281
  ),
1279
- enabled: L(C)
1282
+ enabled: L(p)
1280
1283
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1281
1284
  }), {
1282
- data: Q,
1285
+ data: J,
1283
1286
  isLoading: ne,
1284
1287
  isFetching: w,
1285
1288
  isError: _,
@@ -1294,7 +1297,7 @@ function Re(s, t) {
1294
1297
  database_name: r
1295
1298
  }
1296
1299
  ),
1297
- enabled: !!l && !!r && !I && r !== "NA"
1300
+ enabled: !!l && !!r && !k && r !== "NA"
1298
1301
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1299
1302
  }), {
1300
1303
  data: E,
@@ -1318,7 +1321,7 @@ function Re(s, t) {
1318
1321
  schema_name: c
1319
1322
  }
1320
1323
  ),
1321
- enabled: F(C)
1324
+ enabled: D(p)
1322
1325
  }), {
1323
1326
  data: ie,
1324
1327
  isLoading: Ce,
@@ -1345,7 +1348,7 @@ function Re(s, t) {
1345
1348
  table_name: o
1346
1349
  }
1347
1350
  ),
1348
- enabled: N(C)
1351
+ enabled: C(p)
1349
1352
  // (!!selectedConnectionId &&
1350
1353
  // !!selectedDatabaseName &&
1351
1354
  // !!selectedSchemaName &&
@@ -1355,46 +1358,46 @@ function Re(s, t) {
1355
1358
  // && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
1356
1359
  });
1357
1360
  Z(() => {
1358
- h(a);
1359
- }, [ie, h, a]), Z(() => {
1361
+ x(a);
1362
+ }, [ie, x, a]), Z(() => {
1360
1363
  }, [
1361
- I,
1364
+ k,
1362
1365
  j,
1363
- f,
1364
- x,
1365
1366
  g,
1366
- p
1367
+ m,
1368
+ f,
1369
+ v
1367
1370
  ]);
1368
- const Fe = (p == null ? void 0 : p.type) === "API" ? (Pe = p == null ? void 0 : p.type) == null ? void 0 : Pe.toLowerCase() : o || "", Se = I ? "" : c || "";
1371
+ const Fe = (v == null ? void 0 : v.type) === "API" ? (Pe = v == null ? void 0 : v.type) == null ? void 0 : Pe.toLowerCase() : o || "", Se = k ? "" : c || "";
1369
1372
  function ae(S) {
1370
- x(S), f("");
1373
+ m(S), g("");
1371
1374
  }
1372
1375
  function ue(S) {
1373
- g(S === "none" ? "" : S), x(""), f(""), S !== "none" && S !== "" && y("");
1376
+ f(S === "none" ? "" : S), m(""), g(""), S !== "none" && S !== "" && y("");
1374
1377
  }
1375
1378
  function he(S) {
1376
- u(S);
1379
+ d(S);
1377
1380
  }
1378
1381
  function es(S) {
1379
- y(S === "none" ? "" : S), S !== "none" && S !== "" && g("");
1382
+ y(S === "none" ? "" : S), S !== "none" && S !== "" && f("");
1380
1383
  }
1381
- V && ((ss = V == null ? void 0 : V.databases) == null ? void 0 : ss.length) > 0, Q && ((as = Q == null ? void 0 : Q.schemas) == null ? void 0 : as.length) > 0, ie && ((ts = ie == null ? void 0 : ie.columns) == null ? void 0 : ts.length) > 0 && (a = ie.columns.map((S) => ({
1384
+ V && ((ss = V == null ? void 0 : V.databases) == null ? void 0 : ss.length) > 0, J && ((as = J == null ? void 0 : J.schemas) == null ? void 0 : as.length) > 0, ie && ((ts = ie == null ? void 0 : ie.columns) == null ? void 0 : ts.length) > 0 && (a = ie.columns.map((S) => ({
1382
1385
  ...S,
1383
1386
  data_type: S.data_type.toLowerCase()
1384
- }))), Y && (a = []), (Ne || v) && (a = []);
1385
- const Ee = T == null ? void 0 : T.connections.map(
1387
+ }))), Y && (a = []), (Ne || N) && (a = []);
1388
+ const Ee = I == null ? void 0 : I.connections.map(
1386
1389
  (S) => ({
1387
1390
  id: S.id,
1388
1391
  name: S.name,
1389
1392
  type: S.type
1390
1393
  })
1391
- ), He = (Be = D == null ? void 0 : D.datamodels) == null ? void 0 : Be.map((S) => ({
1394
+ ), He = (Be = T == null ? void 0 : T.datamodels) == null ? void 0 : Be.map((S) => ({
1392
1395
  id: S.id,
1393
1396
  name: S.name
1394
1397
  })), $e = V == null ? void 0 : V.databases.map((S) => ({
1395
1398
  id: S.database_name,
1396
1399
  name: S.database_name
1397
- })), Ae = Q == null ? void 0 : Q.schemas.map((S) => ({
1400
+ })), Ae = J == null ? void 0 : J.schemas.map((S) => ({
1398
1401
  id: S.schema_name,
1399
1402
  name: S.schema_name
1400
1403
  })), ys = E == null ? void 0 : E.tables.map((S) => ({
@@ -1403,11 +1406,11 @@ function Re(s, t) {
1403
1406
  }));
1404
1407
  return {
1405
1408
  connectionItems: Ee,
1406
- isConnectionsLoading: z,
1407
- isConnectionsError: v,
1409
+ isConnectionsLoading: O,
1410
+ isConnectionsError: N,
1408
1411
  modelItems: He,
1409
1412
  isModelsLoading: A,
1410
- isModelsError: m,
1413
+ isModelsError: h,
1411
1414
  databaseItems: $e,
1412
1415
  isDatabasesLoadingOrFetching: $ || B,
1413
1416
  isDatabaseError: Y,
@@ -1420,8 +1423,8 @@ function Re(s, t) {
1420
1423
  columns: a,
1421
1424
  isColumnsLoadingOrFetching: Ce || Le,
1422
1425
  isColumnsError: Ne,
1423
- isNonDbConnection: I,
1424
- connectionType: C,
1426
+ isNonDbConnection: k,
1427
+ connectionType: p,
1425
1428
  tableName: Fe,
1426
1429
  schemaName: Se,
1427
1430
  handleConnectionChange: he,
@@ -1434,52 +1437,52 @@ function _a({
1434
1437
  ColumnsComponent: s
1435
1438
  }) {
1436
1439
  var se;
1437
- const t = d(
1440
+ const t = u(
1438
1441
  (P) => P.selectedConnectionId
1439
- ), a = d(
1442
+ ), a = u(
1440
1443
  (P) => P.selectedDatamodelId
1441
- ), n = d(
1444
+ ), n = u(
1442
1445
  (P) => P.selectedDatabaseName
1443
- ), l = d(
1446
+ ), l = u(
1444
1447
  (P) => P.selectedSchemaName
1445
- ), i = d((P) => P.selectedTableName), r = d(
1448
+ ), i = u((P) => P.selectedTableName), r = u(
1446
1449
  (P) => P.actions.setSelectedTableName
1447
1450
  ), {
1448
1451
  connectionItems: c,
1449
1452
  modelItems: o,
1450
- schemaItems: h,
1451
- databaseItems: u,
1453
+ schemaItems: x,
1454
+ databaseItems: d,
1452
1455
  tableItems: y,
1453
- columns: g,
1454
- isConnectionsLoading: x,
1455
- isModelsLoading: f,
1456
+ columns: f,
1457
+ isConnectionsLoading: m,
1458
+ isModelsLoading: g,
1456
1459
  isConnectionsError: j,
1457
- isModelsError: F,
1458
- isDatabasesLoadingOrFetching: N,
1460
+ isModelsError: D,
1461
+ isDatabasesLoadingOrFetching: C,
1459
1462
  isDatabaseError: L,
1460
- isSchemaLoadingOrFetching: T,
1461
- isSchemaError: z,
1462
- isColumnsError: v,
1463
- isColumnsLoadingOrFetching: D,
1463
+ isSchemaLoadingOrFetching: I,
1464
+ isSchemaError: O,
1465
+ isColumnsError: N,
1466
+ isColumnsLoadingOrFetching: T,
1464
1467
  isTableLoadingOrFetching: A,
1465
- isTableError: m,
1466
- connectionType: p,
1467
- isNonDbConnection: C,
1468
- handleConnectionChange: I,
1468
+ isTableError: h,
1469
+ connectionType: v,
1470
+ isNonDbConnection: p,
1471
+ handleConnectionChange: k,
1469
1472
  handleDatabaseChange: V,
1470
1473
  handleSchemaChange: $,
1471
1474
  handleDatamodelChange: B,
1472
1475
  tableName: Y,
1473
1476
  schemaName: le
1474
1477
  } = Re();
1475
- function Q() {
1476
- return s ? s(le, Y, g) : /* @__PURE__ */ e.jsx(
1478
+ function J() {
1479
+ return s ? s(le, Y, f) : /* @__PURE__ */ e.jsx(
1477
1480
  rl,
1478
1481
  {
1479
1482
  schemaName: le,
1480
1483
  tableName: Y,
1481
- columns: g,
1482
- status: D ? "Loading..." : v ? "Error" : "Success"
1484
+ columns: f,
1485
+ status: T ? "Loading..." : N ? "Error" : "Success"
1483
1486
  }
1484
1487
  );
1485
1488
  }
@@ -1487,7 +1490,7 @@ function _a({
1487
1490
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
1488
1491
  }
1489
1492
  function w() {
1490
- if (!t || p === "S3" || p === "API")
1493
+ if (!t || v === "S3" || v === "API")
1491
1494
  return null;
1492
1495
  if (!a || a === "none")
1493
1496
  return /* @__PURE__ */ e.jsx(
@@ -1496,15 +1499,15 @@ function _a({
1496
1499
  showNone: !0,
1497
1500
  onChange: V,
1498
1501
  isError: L,
1499
- isLoading: N,
1500
- items: u,
1502
+ isLoading: C,
1503
+ items: d,
1501
1504
  value: n || "",
1502
1505
  title: "Database"
1503
1506
  }
1504
1507
  );
1505
1508
  }
1506
1509
  function _() {
1507
- if (t && !C && (!n || n === "none") && (!a || a === "none"))
1510
+ if (t && !p && (!n || n === "none") && (!a || a === "none"))
1508
1511
  return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
1509
1512
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(de, {}) }),
1510
1513
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(H, { children: "OR" }) }),
@@ -1512,7 +1515,7 @@ function _a({
1512
1515
  ] });
1513
1516
  }
1514
1517
  function ee() {
1515
- if (!t || p === "S3" || p === "API")
1518
+ if (!t || v === "S3" || v === "API")
1516
1519
  return null;
1517
1520
  if (!n || n === "none")
1518
1521
  return /* @__PURE__ */ e.jsx(
@@ -1520,8 +1523,8 @@ function _a({
1520
1523
  {
1521
1524
  showNone: !0,
1522
1525
  onChange: B,
1523
- isError: F,
1524
- isLoading: f,
1526
+ isError: D,
1527
+ isLoading: g,
1525
1528
  items: o,
1526
1529
  value: a || "",
1527
1530
  title: "Model"
@@ -1529,13 +1532,13 @@ function _a({
1529
1532
  );
1530
1533
  }
1531
1534
  function E() {
1532
- return !t || p === "S3" || p === "API" || !n || n === "none" ? null : /* @__PURE__ */ e.jsx(
1535
+ return !t || v === "S3" || v === "API" || !n || n === "none" ? null : /* @__PURE__ */ e.jsx(
1533
1536
  Ue,
1534
1537
  {
1535
1538
  onChange: $,
1536
- isError: z,
1537
- isLoading: T,
1538
- items: h,
1539
+ isError: O,
1540
+ isLoading: I,
1541
+ items: x,
1539
1542
  value: l || "",
1540
1543
  title: "Schema"
1541
1544
  }
@@ -1544,13 +1547,13 @@ function _a({
1544
1547
  function M() {
1545
1548
  function P() {
1546
1549
  let X = !1;
1547
- return p === "API" ? (X = !1, X) : ((p === "S3" || t && n && n !== "none" && l) && (X = !0), X);
1550
+ return v === "API" ? (X = !1, X) : ((v === "S3" || t && n && n !== "none" && l) && (X = !0), X);
1548
1551
  }
1549
1552
  return P() ? /* @__PURE__ */ e.jsx(
1550
1553
  Ue,
1551
1554
  {
1552
1555
  onChange: r,
1553
- isError: m,
1556
+ isError: h,
1554
1557
  items: y,
1555
1558
  isLoading: A,
1556
1559
  value: i || "",
@@ -1566,8 +1569,8 @@ function _a({
1566
1569
  items: c,
1567
1570
  title: "Connection",
1568
1571
  value: t || "",
1569
- onChange: I,
1570
- isLoading: x,
1572
+ onChange: k,
1573
+ isLoading: m,
1571
1574
  isError: j,
1572
1575
  connectionTooltip: ((se = c == null ? void 0 : c.find(
1573
1576
  (P) => P.id === t
@@ -1580,9 +1583,9 @@ function _a({
1580
1583
  E(),
1581
1584
  M()
1582
1585
  ] }),
1583
- Q(),
1586
+ J(),
1584
1587
  /* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
1585
- O,
1588
+ F,
1586
1589
  {
1587
1590
  onClick: ne,
1588
1591
  size: "sm",
@@ -1619,11 +1622,11 @@ function ol({
1619
1622
  setTriggerAIRun: n
1620
1623
  }) {
1621
1624
  return /* @__PURE__ */ e.jsxs(_s, { openDelay: 0, children: [
1622
- /* @__PURE__ */ e.jsx(Hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(On, { className: "h-4 w-4 text-red-500" }) }) }),
1625
+ /* @__PURE__ */ e.jsx(Hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(On, { className: "h-4 w-4 text-red-500" }) }) }),
1623
1626
  /* @__PURE__ */ e.jsx($s, { align: "start", className: "min-w-fit max-w-[500px]", 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: [
1624
1627
  /* @__PURE__ */ e.jsx(Ps, { 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 }) }),
1625
1628
  /* @__PURE__ */ e.jsxs(
1626
- O,
1629
+ F,
1627
1630
  {
1628
1631
  onClick: () => {
1629
1632
  t(!0), a(s), n(!0);
@@ -1650,7 +1653,7 @@ function cl({
1650
1653
  ] });
1651
1654
  }
1652
1655
  function dl() {
1653
- const { authToken: s } = Oe(), t = d(
1656
+ const { authToken: s } = Oe(), t = u(
1654
1657
  (i) => i.selectedConnectionId
1655
1658
  ), { data: a } = me({
1656
1659
  queryKey: ["connections"],
@@ -1666,7 +1669,7 @@ function dl() {
1666
1669
  return n == null ? void 0 : n.type;
1667
1670
  }
1668
1671
  function ul() {
1669
- const { authToken: s } = Oe(), t = Xe(null), a = d((o) => o.applyFilters), [n, l] = R(""), i = d((o) => o.filterValues), r = d((o) => o.card.sql), c = dl();
1672
+ const { authToken: s } = Oe(), t = Xe(null), a = u((o) => o.applyFilters), [n, l] = R(""), i = u((o) => o.filterValues), r = u((o) => o.card.sql), c = dl();
1670
1673
  return /* @__PURE__ */ e.jsxs(
1671
1674
  _s,
1672
1675
  {
@@ -1675,7 +1678,7 @@ function ul() {
1675
1678
  if (!o)
1676
1679
  return;
1677
1680
  console.log("onOpenChange");
1678
- const h = await hs(
1681
+ const x = await hs(
1679
1682
  "https://semaphor.cloud/api/v1/filter-sql",
1680
1683
  (s == null ? void 0 : s.accessToken) || "",
1681
1684
  {
@@ -1684,7 +1687,7 @@ function ul() {
1684
1687
  connection_type: c
1685
1688
  }
1686
1689
  );
1687
- console.log(h), h.sql ? (console.log(h.records), l(h.sql)) : l("Error");
1690
+ console.log(x), x.sql ? (console.log(x.records), l(x.sql)) : l("Error");
1688
1691
  },
1689
1692
  children: [
1690
1693
  /* @__PURE__ */ e.jsx(Hs, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
@@ -1763,50 +1766,50 @@ function ml({
1763
1766
  triggerAIRun: l,
1764
1767
  setTriggerAIRun: i
1765
1768
  }) {
1766
- const r = Xe(null), c = Xe(null), { authToken: o } = Oe(), [h, u] = R(!1), y = d((w) => w.actions.setCardSql), g = k((w) => w.dashboard.baseQueries), x = d((w) => w.actions.setRunSql), f = d((w) => w.actions.setCardType), [j, F] = R([]), N = d((w) => w.currentColumns), L = d((w) => w.card.sql), T = d((w) => w.selectedTableName), z = `
1769
+ const r = Xe(null), c = Xe(null), { authToken: o } = Oe(), [x, d] = R(!1), y = u((w) => w.actions.setCardSql), f = z((w) => w.dashboard.baseQueries), m = u((w) => w.actions.setRunSql), g = u((w) => w.actions.setCardType), [j, D] = R([]), C = u((w) => w.currentColumns), L = u((w) => w.card.sql), I = u((w) => w.selectedTableName), O = `
1767
1770
  ${a}
1768
1771
 
1769
- Database Query Dialect: ${T === "api" || T === "s3" ? "DuckDb" : ""}
1770
- Table Name: ${T}
1771
- Table Columns: ${N == null ? void 0 : N.map((w) => `${w.column_name} | ${w.data_type}`).join(", ")}
1772
+ Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
1773
+ Table Name: ${I}
1774
+ Table Columns: ${C == null ? void 0 : C.map((w) => `${w.column_name} | ${w.data_type}`).join(", ")}
1772
1775
  User SQL: ${L}
1773
- ${g && `Base Queries: ${JSON.stringify(g)} `}`, v = ` 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.
1774
- Visual Query Syntax: ${hl}`, { data: D, isLoading: A, isFetching: m, isError: p, refetch: C } = me({
1776
+ ${f && `Base Queries: ${JSON.stringify(f)} `}`, 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.
1777
+ Visual Query Syntax: ${hl}`, { data: T, isLoading: A, isFetching: h, isError: v, refetch: p } = me({
1775
1778
  queryKey: ["ai-query"],
1776
1779
  queryFn: () => we(
1777
1780
  "https://semaphor.cloud/api/v1/ai",
1778
1781
  (o == null ? void 0 : o.accessToken) || "",
1779
1782
  {
1780
- user_content: `userContent: ${z} ${h ? v : ""}`
1783
+ user_content: `userContent: ${O} ${x ? N : ""}`
1781
1784
  }
1782
1785
  ),
1783
1786
  enabled: !1
1784
1787
  // Do not run by default.
1785
1788
  });
1786
- function I(w) {
1789
+ function k(w) {
1787
1790
  if (w.toLowerCase().includes("bar"))
1788
- f("bar");
1791
+ g("bar");
1789
1792
  else if (w.toLowerCase().includes("line"))
1790
- f("line");
1793
+ g("line");
1791
1794
  else if (w.toLowerCase().includes("bubble"))
1792
- f("bubble");
1795
+ g("bubble");
1793
1796
  else if (w.toLowerCase().includes("scatter"))
1794
- f("scatter");
1797
+ g("scatter");
1795
1798
  else if (w.toLowerCase().includes("stacked"))
1796
- f("stackedBar");
1799
+ g("stackedBar");
1797
1800
  else if (w.toLowerCase().includes("pie"))
1798
- f("pie");
1801
+ g("pie");
1799
1802
  else if (w.toLowerCase().includes("donut") || w.toLowerCase().includes("doughnut"))
1800
- f("doughnut");
1803
+ g("doughnut");
1801
1804
  else if (w.toLowerCase().includes("radar"))
1802
- f("radar");
1805
+ g("radar");
1803
1806
  else
1804
- return f("bar"), !1;
1807
+ return g("bar"), !1;
1805
1808
  return !0;
1806
1809
  }
1807
1810
  Z(() => {
1808
- D && F((w) => [...w, { role: "ai", content: D.response }]);
1809
- }, [D]), Z(() => {
1811
+ T && D((w) => [...w, { role: "ai", content: T.response }]);
1812
+ }, [T]), Z(() => {
1810
1813
  const w = setTimeout(() => {
1811
1814
  var _;
1812
1815
  c.current && (c.current.scroll({
@@ -1817,7 +1820,7 @@ function ml({
1817
1820
  return () => clearTimeout(w);
1818
1821
  }, [j]);
1819
1822
  function V() {
1820
- a && (F((w) => [...w, { role: "user", content: a }]), I(a) && u(!0), n(""), C());
1823
+ a && (D((w) => [...w, { role: "user", content: a }]), k(a) && d(!0), n(""), p());
1821
1824
  }
1822
1825
  Z(() => {
1823
1826
  l && (V(), i(!1));
@@ -1854,13 +1857,13 @@ function ml({
1854
1857
  pre: ({ node: w, ..._ }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: B, children: [
1855
1858
  /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: _.children }),
1856
1859
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1857
- /* @__PURE__ */ e.jsx(O, { onClick: Q, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ba, {}) }),
1860
+ /* @__PURE__ */ e.jsx(F, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ba, {}) }),
1858
1861
  /* @__PURE__ */ e.jsx(
1859
- O,
1862
+ F,
1860
1863
  {
1861
1864
  onClick: (ee) => {
1862
- const E = Q(ee);
1863
- E && (t(!1), y(E), x(!0));
1865
+ const E = J(ee);
1866
+ E && (t(!1), y(E), m(!0));
1864
1867
  },
1865
1868
  size: "sm",
1866
1869
  variant: "outline",
@@ -1872,7 +1875,7 @@ function ml({
1872
1875
  li: ({ node: w, ..._ }) => /* @__PURE__ */ e.jsx("li", { style: Y, ..._ })
1873
1876
  // You can add more overrides for other elements like h1, h2, etc.
1874
1877
  };
1875
- function Q(w) {
1878
+ function J(w) {
1876
1879
  const _ = w.currentTarget.closest("pre");
1877
1880
  if (!_)
1878
1881
  return;
@@ -1895,14 +1898,14 @@ function ml({
1895
1898
  {
1896
1899
  className: "w-full overflow-auto py-1",
1897
1900
  components: le,
1898
- children: D == null ? void 0 : D.response.replace(/DuckDB/gi, "Semaphor")
1901
+ children: T == null ? void 0 : T.response.replace(/DuckDB/gi, "Semaphor")
1899
1902
  },
1900
1903
  _
1901
1904
  ) : /* @__PURE__ */ e.jsx("div", {}, _));
1902
1905
  }
1903
- return /* @__PURE__ */ e.jsxs(Ts, { open: s, onOpenChange: t, children: [
1904
- /* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1905
- O,
1906
+ return /* @__PURE__ */ e.jsxs(Is, { open: s, onOpenChange: t, children: [
1907
+ /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1908
+ F,
1906
1909
  {
1907
1910
  size: "sm",
1908
1911
  className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
@@ -1947,20 +1950,20 @@ function ml({
1947
1950
  className: W(
1948
1951
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1949
1952
  ),
1950
- disabled: A || m,
1953
+ disabled: A || h,
1951
1954
  value: a,
1952
1955
  onChange: (w) => n(w.target.value)
1953
1956
  }
1954
1957
  ),
1955
1958
  " ",
1956
1959
  /* @__PURE__ */ e.jsx(
1957
- O,
1960
+ F,
1958
1961
  {
1959
1962
  className: "h-8",
1960
1963
  size: "sm",
1961
1964
  variant: "ghost",
1962
1965
  onClick: V,
1963
- children: !A && !m ? /* @__PURE__ */ e.jsx(bt, {}) : /* @__PURE__ */ e.jsx(Ze, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1966
+ children: !A && !h ? /* @__PURE__ */ e.jsx(bt, {}) : /* @__PURE__ */ e.jsx(Ze, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1964
1967
  }
1965
1968
  )
1966
1969
  ] })
@@ -2087,28 +2090,28 @@ function Cl() {
2087
2090
  const [s, t] = R({
2088
2091
  queryKey: [],
2089
2092
  queryData: null
2090
- }), { theme: a } = Ct(), n = Nt(), l = Xe(), i = Xe(), [r, c] = R(!1), [o, h] = R(!1), [u, y] = R(!1), [g, x] = R(""), [f, j] = R(!1), F = k((b) => b.selectedSheetId);
2091
- k((b) => b.dashboard.baseQueries);
2092
- const N = d((b) => b.card), L = k((b) => b.theme), T = d((b) => b.isShowingVisual);
2093
- k((b) => b.onAcceptChanges);
2094
- const z = d(
2093
+ }), { theme: a } = Ct(), n = Nt(), l = Xe(), i = Xe(), [r, c] = R(!1), [o, x] = R(!1), [d, y] = R(!1), [f, m] = R(""), [g, j] = R(!1), D = z((b) => b.selectedSheetId);
2094
+ z((b) => b.dashboard.baseQueries);
2095
+ const C = u((b) => b.card), L = z((b) => b.theme), I = u((b) => b.isShowingVisual);
2096
+ z((b) => b.onAcceptChanges);
2097
+ const O = u(
2095
2098
  (b) => b.selectedConnectionId
2096
- ), v = d(
2099
+ ), N = u(
2097
2100
  (b) => b.selectedDatabaseName
2098
- ), D = d(
2101
+ ), T = u(
2099
2102
  (b) => b.selectedDatamodelId
2100
- ), A = d(
2103
+ ), A = u(
2101
2104
  (b) => b.selectedSchemaName
2102
2105
  );
2103
- k(
2106
+ z(
2104
2107
  (b) => b.actions.updateFrameCard
2105
2108
  );
2106
- const m = d((b) => b.selectedTableName), p = d((b) => b.card.sql), C = d((b) => b.card.python), I = d((b) => b.frame), V = k((b) => b.dashboard.filters), $ = k((b) => b.filterValues), B = V == null ? void 0 : V.filter(
2107
- (b) => b.sheetId === F || !b.sheetId
2109
+ const h = u((b) => b.selectedTableName), v = u((b) => b.card.sql), p = u((b) => b.card.python), k = u((b) => b.frame), V = z((b) => b.dashboard.filters), $ = z((b) => b.filterValues), B = V == null ? void 0 : V.filter(
2110
+ (b) => b.sheetId === D || !b.sheetId
2108
2111
  ), Y = $ == null ? void 0 : $.filter(
2109
- (b) => (B == null ? void 0 : B.some((te) => te.id === b.filterId)) || b.filterId.endsWith(F)
2110
- ), le = d((b) => b.applyFilters), {
2111
- setCardCustomCfg: Q,
2112
+ (b) => (B == null ? void 0 : B.some((te) => te.id === b.filterId)) || b.filterId.endsWith(D)
2113
+ ), le = u((b) => b.applyFilters), {
2114
+ setCardCustomCfg: J,
2112
2115
  setQueryResultColumns: ne,
2113
2116
  setFilterValues: w,
2114
2117
  setCardSql: _,
@@ -2117,11 +2120,11 @@ function Cl() {
2117
2120
  setQueryError: M,
2118
2121
  setPythonStdOut: se,
2119
2122
  setCardPreferences: P
2120
- } = d((b) => b.actions), X = d((b) => b.onSave), ie = d(
2123
+ } = u((b) => b.actions), X = u((b) => b.onSave), ie = u(
2121
2124
  (b) => b.actions.setApplyFilters
2122
- ), Ce = d((b) => b.onClose), Le = d((b) => b.actions.setSqlGen), Ne = d((b) => b.runSql), Fe = d((b) => b.actions.setRunSql);
2123
- d((b) => b.actions.setCardCfg);
2124
- const Se = d(
2125
+ ), Ce = u((b) => b.onClose), Le = u((b) => b.actions.setSqlGen), Ne = u((b) => b.runSql), Fe = u((b) => b.actions.setRunSql);
2126
+ u((b) => b.actions.setCardCfg);
2127
+ const Se = u(
2125
2128
  (b) => b.actions.setIsSqlRunning
2126
2129
  ), {
2127
2130
  data: ae,
@@ -2132,7 +2135,7 @@ function Cl() {
2132
2135
  error: He,
2133
2136
  queryKey: $e,
2134
2137
  refetch: Ae
2135
- } = qe(N);
2138
+ } = qe(C);
2136
2139
  Z(() => {
2137
2140
  if (ae && (ae.rowLimitExceeded && Ye.error("Row limit (10,000) exceeded. Refine your query.", {
2138
2141
  position: "top-center",
@@ -2167,7 +2170,7 @@ function Cl() {
2167
2170
  s.queryData || t({
2168
2171
  queryKey: $e,
2169
2172
  queryData: b
2170
- }), n.setQueryData($e, null), _(""), Le({}), Q(""), P({});
2173
+ }), n.setQueryData($e, null), _(""), Le({}), J(""), P({});
2171
2174
  }
2172
2175
  const Pe = (b) => {
2173
2176
  i.current = b;
@@ -2176,9 +2179,9 @@ function Cl() {
2176
2179
  if (b.length === 0)
2177
2180
  return "";
2178
2181
  if (te) {
2179
- const Te = b.find((oe) => oe.id === te);
2180
- if (Te) {
2181
- const oe = Te.tabTitle;
2182
+ const Ie = b.find((oe) => oe.id === te);
2183
+ if (Ie) {
2184
+ const oe = Ie.tabTitle;
2182
2185
  if (oe == "All__Header")
2183
2186
  return b[0].id;
2184
2187
  if (oe && oe.endsWith("__Header")) {
@@ -2193,24 +2196,24 @@ function Cl() {
2193
2196
  return b[0].id;
2194
2197
  }
2195
2198
  function as() {
2196
- let b = p;
2197
- p && !p.includes("{{") && (b = il(p), _(b));
2199
+ let b = v;
2200
+ v && !v.includes("{{") && (b = il(v), _(b));
2198
2201
  const te = {
2199
- ...N,
2202
+ ...C,
2200
2203
  lastSelectedSchema: A,
2201
- lastSelectedDatamodelId: D,
2202
- lastSelectedDatabase: v,
2203
- lastSelectedTable: m,
2204
- connectionId: z,
2205
- type: T ? N.type : "table",
2204
+ lastSelectedDatamodelId: T,
2205
+ lastSelectedDatabase: N,
2206
+ lastSelectedTable: h,
2207
+ connectionId: O,
2208
+ type: I ? C.type : "table",
2206
2209
  sql: b,
2207
- customCfg: T ? N.customCfg : null
2208
- }, Te = I.cards.map(
2209
- (vs) => vs.id === N.id ? te : vs
2210
+ customCfg: I ? C.customCfg : null
2211
+ }, Ie = k.cards.map(
2212
+ (vs) => vs.id === C.id ? te : vs
2210
2213
  ), oe = {
2211
- ...I,
2212
- cards: Te,
2213
- activeCardId: ss(Te, I.activeCardId)
2214
+ ...k,
2215
+ cards: Ie,
2216
+ activeCardId: ss(Ie, k.activeCardId)
2214
2217
  };
2215
2218
  X == null || X(oe);
2216
2219
  }
@@ -2221,7 +2224,7 @@ function Cl() {
2221
2224
  Z(() => {
2222
2225
  const b = l.current, te = i.current;
2223
2226
  if (b) {
2224
- const Te = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", oe = L === "system" ? Te : L;
2227
+ const Ie = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", oe = L === "system" ? Ie : L;
2225
2228
  b.editor.defineTheme("default", {
2226
2229
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
2227
2230
  base: oe === "light" ? "vs" : "vs-dark",
@@ -2265,7 +2268,7 @@ function Cl() {
2265
2268
  Y && o && /* @__PURE__ */ e.jsx(
2266
2269
  Je,
2267
2270
  {
2268
- onClick: () => h(!1),
2271
+ onClick: () => x(!1),
2269
2272
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
2270
2273
  }
2271
2274
  )
@@ -2307,7 +2310,7 @@ function Cl() {
2307
2310
  Y && !o && /* @__PURE__ */ e.jsx(
2308
2311
  ha,
2309
2312
  {
2310
- onClick: () => h(!0),
2313
+ onClick: () => x(!0),
2311
2314
  className: W(
2312
2315
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
2313
2316
  {
@@ -2347,7 +2350,7 @@ function Cl() {
2347
2350
  onChange: (b) => {
2348
2351
  _(b);
2349
2352
  },
2350
- value: p,
2353
+ value: v,
2351
2354
  options: {
2352
2355
  minimap: {
2353
2356
  enabled: !1
@@ -2394,7 +2397,7 @@ function Cl() {
2394
2397
  onChange: (b) => {
2395
2398
  E(b && b.trim() || "");
2396
2399
  },
2397
- value: C || kt,
2400
+ value: p || kt,
2398
2401
  options: {
2399
2402
  minimap: {
2400
2403
  enabled: !1
@@ -2450,7 +2453,7 @@ function Cl() {
2450
2453
  children: [
2451
2454
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2452
2455
  /* @__PURE__ */ e.jsxs(
2453
- O,
2456
+ F,
2454
2457
  {
2455
2458
  title: "Shift + Enter",
2456
2459
  disabled: ue || he,
@@ -2472,18 +2475,18 @@ function Cl() {
2472
2475
  error: He.message,
2473
2476
  setShowAIDialog: y,
2474
2477
  setTriggerAIRun: j,
2475
- setUserInputforAI: x
2478
+ setUserInputforAI: m
2476
2479
  }
2477
2480
  ),
2478
2481
  /* @__PURE__ */ e.jsxs(
2479
- O,
2482
+ F,
2480
2483
  {
2481
2484
  onClick: ys,
2482
2485
  className: "",
2483
2486
  size: "sm",
2484
2487
  variant: "outline",
2485
2488
  children: [
2486
- /* @__PURE__ */ e.jsx(In, { className: "mr-2 size-4" }),
2489
+ /* @__PURE__ */ e.jsx(Tn, { className: "mr-2 size-4" }),
2487
2490
  "Clear"
2488
2491
  ]
2489
2492
  }
@@ -2502,18 +2505,18 @@ function Cl() {
2502
2505
  /* @__PURE__ */ e.jsx(
2503
2506
  ml,
2504
2507
  {
2505
- open: u,
2508
+ open: d,
2506
2509
  setOpen: y,
2507
- userInput: g,
2508
- triggerAIRun: f,
2510
+ userInput: f,
2511
+ triggerAIRun: g,
2509
2512
  setTriggerAIRun: j,
2510
- setUserInput: (b) => x(b)
2513
+ setUserInput: (b) => m(b)
2511
2514
  }
2512
2515
  )
2513
2516
  ] }),
2514
2517
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
2515
2518
  /* @__PURE__ */ e.jsxs(
2516
- O,
2519
+ F,
2517
2520
  {
2518
2521
  onClick: as,
2519
2522
  size: "sm",
@@ -2525,7 +2528,7 @@ function Cl() {
2525
2528
  }
2526
2529
  ),
2527
2530
  /* @__PURE__ */ e.jsxs(
2528
- O,
2531
+ F,
2529
2532
  {
2530
2533
  onClick: ts,
2531
2534
  className: "w-full",
@@ -2552,7 +2555,7 @@ function Nl({ data: s }) {
2552
2555
  // header: key,
2553
2556
  accessorKey: c,
2554
2557
  header: ({ column: o }) => {
2555
- const h = o.getIsSorted();
2558
+ const x = o.getIsSorted();
2556
2559
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
2557
2560
  "div",
2558
2561
  {
@@ -2560,7 +2563,7 @@ function Nl({ data: s }) {
2560
2563
  onClick: () => o.toggleSorting(o.getIsSorted() === "asc"),
2561
2564
  children: [
2562
2565
  c,
2563
- h === "asc" ? /* @__PURE__ */ e.jsx(zt, { className: "ml-2 h-5 w-5" }) : h === "desc" ? /* @__PURE__ */ e.jsx(Ot, { className: "ml-2 h-5 w-5" }) : null
2566
+ x === "asc" ? /* @__PURE__ */ e.jsx(zt, { className: "ml-2 h-5 w-5" }) : x === "desc" ? /* @__PURE__ */ e.jsx(Ot, { className: "ml-2 h-5 w-5" }) : null
2564
2567
  ]
2565
2568
  }
2566
2569
  ) });
@@ -2577,8 +2580,8 @@ function Nl({ data: s }) {
2577
2580
  sorting: t
2578
2581
  }
2579
2582
  });
2580
- return /* @__PURE__ */ e.jsxs(Tt, { children: [
2581
- /* @__PURE__ */ e.jsx(It, { children: i.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(Cs, { children: c.headers.map((o) => /* @__PURE__ */ e.jsx(Dt, { className: "sticky top-0 bg-muted", children: o.isPlaceholder ? null : Zs(
2583
+ return /* @__PURE__ */ e.jsxs(It, { children: [
2584
+ /* @__PURE__ */ e.jsx(Tt, { children: i.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(Cs, { children: c.headers.map((o) => /* @__PURE__ */ e.jsx(Dt, { className: "sticky top-0 bg-muted", children: o.isPlaceholder ? null : Zs(
2582
2585
  o.column.columnDef.header,
2583
2586
  o.getContext()
2584
2587
  ) }, o.id)) }, c.id)) }),
@@ -2594,26 +2597,26 @@ function Nl({ data: s }) {
2594
2597
  ] });
2595
2598
  }
2596
2599
  function Sl({ card: s }) {
2597
- var u, y, g, x, f, j, F, N, L, T;
2598
- const t = k((z) => z.themeStyle), a = {
2599
- colors: ((y = (u = t == null ? void 0 : t.chart) == null ? void 0 : u.dataset) == null ? void 0 : y.backgroundColor) || []
2600
+ var d, y, f, m, g, j, D, C, L, I;
2601
+ const t = z((O) => O.themeStyle), a = {
2602
+ colors: ((y = (d = t == null ? void 0 : t.chart) == null ? void 0 : d.dataset) == null ? void 0 : y.backgroundColor) || []
2600
2603
  };
2601
- (g = s.customCardPreferences) != null && g.inputData;
2602
- const { getCard: n } = va(((x = s.customCardPreferences) == null ? void 0 : x.url) || ""), l = ((f = s.customCardPreferences) == null ? void 0 : f.visualType) || "single", i = d((z) => z.frame);
2604
+ (f = s.customCardPreferences) != null && f.inputData;
2605
+ const { getCard: n } = va(((m = s.customCardPreferences) == null ? void 0 : m.url) || ""), l = ((g = s.customCardPreferences) == null ? void 0 : g.visualType) || "single", i = u((O) => O.frame);
2603
2606
  ce();
2604
2607
  const { data: r } = qe(s);
2605
2608
  if (!((j = s.customCardPreferences) != null && j.componentName))
2606
2609
  return null;
2607
2610
  const c = n(
2608
- (F = s.customCardPreferences) == null ? void 0 : F.componentName
2609
- ), o = (z) => {
2610
- console.log("data", z), s.customCardPreferences;
2611
- }, h = Object.keys(
2612
- ((N = s.customCardPreferences) == null ? void 0 : N.dataInputCardIds) || {}
2613
- ).map((z) => {
2614
- var A, m, p;
2615
- const v = (m = (A = s.customCardPreferences) == null ? void 0 : A.dataInputCardIds) == null ? void 0 : m[z].cardId, D = (p = i == null ? void 0 : i.cards) == null ? void 0 : p.find((C) => C.id === v);
2616
- return D || null;
2611
+ (D = s.customCardPreferences) == null ? void 0 : D.componentName
2612
+ ), o = (O) => {
2613
+ console.log("data", O), s.customCardPreferences;
2614
+ }, x = Object.keys(
2615
+ ((C = s.customCardPreferences) == null ? void 0 : C.dataInputCardIds) || {}
2616
+ ).map((O) => {
2617
+ var A, h, v;
2618
+ const N = (h = (A = s.customCardPreferences) == null ? void 0 : A.dataInputCardIds) == null ? void 0 : h[O].cardId, T = (v = i == null ? void 0 : i.cards) == null ? void 0 : v.find((p) => p.id === N);
2619
+ return T || null;
2617
2620
  });
2618
2621
  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(
2619
2622
  wn,
@@ -2634,18 +2637,18 @@ function Sl({ card: s }) {
2634
2637
  {
2635
2638
  theme: a,
2636
2639
  onDataChange: o,
2637
- settings: h.map(
2638
- (z) => {
2639
- var v;
2640
- return (v = z == null ? void 0 : z.customCardPreferences) == null ? void 0 : v.settings;
2640
+ settings: x.map(
2641
+ (O) => {
2642
+ var N;
2643
+ return (N = O == null ? void 0 : O.customCardPreferences) == null ? void 0 : N.settings;
2641
2644
  }
2642
2645
  ),
2643
- data: h.map((z) => (z == null ? void 0 : z.data) || [])
2646
+ data: x.map((O) => (O == null ? void 0 : O.data) || [])
2644
2647
  }
2645
2648
  ) })
2646
2649
  ]
2647
2650
  },
2648
- (T = s.customCardPreferences) == null ? void 0 : T.componentName
2651
+ (I = s.customCardPreferences) == null ? void 0 : I.componentName
2649
2652
  ) });
2650
2653
  }
2651
2654
  function Pa({
@@ -2654,10 +2657,10 @@ function Pa({
2654
2657
  className: s,
2655
2658
  ...t
2656
2659
  }) {
2657
- var x, f;
2658
- const a = d((j) => j.card), n = ((x = a.customCardPreferences) == null ? void 0 : x.showCardHeader) ?? !0, l = d((j) => j.frame), i = k((j) => j.dashboard.filters);
2659
- d((j) => j.actions.setRunSql);
2660
- const { updateFilter: r } = Fs(), c = i == null ? void 0 : i.find((j) => j.id === l.filterId), { data: o } = qe(a), { setCard: h } = ce(), { data: u } = Bs(a);
2660
+ var m, g;
2661
+ const a = u((j) => j.card), n = ((m = a.customCardPreferences) == null ? void 0 : m.showCardHeader) ?? !0, l = u((j) => j.frame), i = z((j) => j.dashboard.filters);
2662
+ u((j) => j.actions.setRunSql);
2663
+ const { updateFilter: r } = Fs(), c = i == null ? void 0 : i.find((j) => j.id === l.filterId), { data: o } = qe(a), { setCard: x } = ce(), { data: d } = Bs(a);
2661
2664
  if (!a.id)
2662
2665
  return null;
2663
2666
  let y;
@@ -2667,9 +2670,9 @@ function Pa({
2667
2670
  cfg: a.cfg,
2668
2671
  customCfg: a.customCfg,
2669
2672
  preferences: a.preferences,
2670
- topoJson: u
2673
+ topoJson: d
2671
2674
  }));
2672
- function g(j) {
2675
+ function f(j) {
2673
2676
  return /* @__PURE__ */ e.jsx(Sl, { card: j });
2674
2677
  }
2675
2678
  return /* @__PURE__ */ e.jsxs(
@@ -2685,7 +2688,7 @@ function Pa({
2685
2688
  rs,
2686
2689
  {
2687
2690
  text: a.title,
2688
- onSave: (j) => h({ ...a, title: j }),
2691
+ onSave: (j) => x({ ...a, title: j }),
2689
2692
  children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(Rt, { className: "text-base", children: a.title || "Edit title..." }) })
2690
2693
  },
2691
2694
  a.title
@@ -2694,7 +2697,7 @@ function Pa({
2694
2697
  rs,
2695
2698
  {
2696
2699
  text: a.description || "",
2697
- onSave: (j) => h({ ...a, description: j }),
2700
+ onSave: (j) => x({ ...a, description: j }),
2698
2701
  children: /* @__PURE__ */ e.jsx(_t, { children: a.description || "Edit description..." })
2699
2702
  },
2700
2703
  a.description
@@ -2714,14 +2717,14 @@ function Pa({
2714
2717
  ] })
2715
2718
  ] }),
2716
2719
  /* @__PURE__ */ e.jsxs($t, { className: "flex grow flex-col", children: [
2717
- a.type === "custom" && g(a),
2720
+ a.type === "custom" && f(a),
2718
2721
  !["table", "custom"].includes(a.type) && y && // <ChartJsVisual key={visualKey} cfg={cfg} />
2719
2722
  /* @__PURE__ */ e.jsx(
2720
2723
  Pt,
2721
2724
  {
2722
2725
  cfg: y
2723
2726
  },
2724
- JSON.stringify(y) + JSON.stringify(a.preferences) + ((f = a == null ? void 0 : a.preferences) == null ? void 0 : f.customVisualCode)
2727
+ JSON.stringify(y) + JSON.stringify(a.preferences) + ((g = a == null ? void 0 : a.preferences) == null ? void 0 : g.customVisualCode)
2725
2728
  ),
2726
2729
  a.type === "table" && (o == null ? void 0 : o.records) && (o == null ? void 0 : o.records.length) > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2727
2730
  /* @__PURE__ */ e.jsx(Bt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Ut, { card: a, data: o == null ? void 0 : o.records }) })
@@ -2731,61 +2734,61 @@ function Pa({
2731
2734
  );
2732
2735
  }
2733
2736
  function wl() {
2734
- const [s, t] = R(!1), [a, n] = R(""), [l, i] = R(""), [r, c] = R(""), [o, h] = R(""), u = d((v) => v.card), y = d(
2735
- (v) => v.card.customCfg
2736
- ), { data: g } = qe(u), { data: x } = Bs(u), { setCardCustomCfg: f, setCustomVisualCode: j } = ce();
2737
- function F(v) {
2738
- var m, p;
2739
- const D = {
2740
- ...v,
2737
+ const [s, t] = R(!1), [a, n] = R(""), [l, i] = R(""), [r, c] = R(""), [o, x] = R(""), d = u((N) => N.card), y = u(
2738
+ (N) => N.card.customCfg
2739
+ ), { data: f } = qe(d), { data: m } = Bs(d), { setCardCustomCfg: g, setCustomVisualCode: j } = ce();
2740
+ function D(N) {
2741
+ var h, v;
2742
+ const T = {
2743
+ ...N,
2741
2744
  data: {
2742
- ...v == null ? void 0 : v.data,
2743
- datasets: (p = (m = v == null ? void 0 : v.data) == null ? void 0 : m.datasets) == null ? void 0 : p.map((C) => ({
2744
- ...C,
2745
+ ...N == null ? void 0 : N.data,
2746
+ datasets: (v = (h = N == null ? void 0 : N.data) == null ? void 0 : h.datasets) == null ? void 0 : v.map((p) => ({
2747
+ ...p,
2745
2748
  data: []
2746
2749
  }))
2747
2750
  }
2748
2751
  };
2749
- return JSON.stringify(D, null, 1);
2752
+ return JSON.stringify(T, null, 1);
2750
2753
  }
2751
- function N() {
2752
- var D, A;
2753
- if (!(g != null && g.records) || (g == null ? void 0 : g.records.length) === 0)
2754
+ function C() {
2755
+ var T, A;
2756
+ if (!(f != null && f.records) || (f == null ? void 0 : f.records.length) === 0)
2754
2757
  return;
2755
- const v = Ca({
2756
- data: g == null ? void 0 : g.records,
2757
- cardType: u.type,
2758
- cfg: u.cfg,
2759
- preferences: u.preferences,
2760
- topoJson: x
2758
+ const N = Ca({
2759
+ data: f == null ? void 0 : f.records,
2760
+ cardType: d.type,
2761
+ cfg: d.cfg,
2762
+ preferences: d.preferences,
2763
+ topoJson: m
2761
2764
  });
2762
- v && (n(JSON.stringify(v, null, 1)), (D = u == null ? void 0 : u.preferences) != null && D.customVisualCode && c((A = u == null ? void 0 : u.preferences) == null ? void 0 : A.customVisualCode), y && i(JSON.stringify(y, null, 1)));
2765
+ N && (n(JSON.stringify(N, null, 1)), (T = d == null ? void 0 : d.preferences) != null && T.customVisualCode && c((A = d == null ? void 0 : d.preferences) == null ? void 0 : A.customVisualCode), y && i(JSON.stringify(y, null, 1)));
2763
2766
  }
2764
2767
  function L() {
2765
2768
  if (r && j(r), !!l)
2766
2769
  try {
2767
- const v = JSON.parse(l);
2768
- return v ? (f(v), h(""), i(""), v) : void 0;
2769
- } catch (v) {
2770
- console.log(v), h("Invalid JSON");
2770
+ const N = JSON.parse(l);
2771
+ return N ? (g(N), x(""), i(""), N) : void 0;
2772
+ } catch (N) {
2773
+ console.log(N), x("Invalid JSON");
2771
2774
  }
2772
2775
  }
2773
- function T() {
2774
- i(""), f(null);
2776
+ function I() {
2777
+ i(""), g(null);
2775
2778
  }
2776
- function z() {
2777
- let v;
2779
+ function O() {
2780
+ let N;
2778
2781
  if (y) {
2779
- const D = sa.cloneDeep(u.cfg), A = sa.merge(D, y);
2780
- return v = F(A), v;
2782
+ const T = sa.cloneDeep(d.cfg), A = sa.merge(T, y);
2783
+ return N = D(A), N;
2781
2784
  }
2782
- return a ? (v = F(JSON.parse(a)), v) : "";
2785
+ return a ? (N = D(JSON.parse(a)), N) : "";
2783
2786
  }
2784
- return /* @__PURE__ */ e.jsxs(Ts, { open: s, onOpenChange: t, children: [
2785
- /* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2786
- O,
2787
+ return /* @__PURE__ */ e.jsxs(Is, { open: s, onOpenChange: t, children: [
2788
+ /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2789
+ F,
2787
2790
  {
2788
- onClick: N,
2791
+ onClick: C,
2789
2792
  className: ` ${y && "border-foreground/50 dark:border-foreground/70"}`,
2790
2793
  size: "sm",
2791
2794
  variant: "outline",
@@ -2805,7 +2808,7 @@ function wl() {
2805
2808
  La,
2806
2809
  {
2807
2810
  onClick: () => {
2808
- navigator.clipboard.writeText(u.id);
2811
+ navigator.clipboard.writeText(d.id);
2809
2812
  },
2810
2813
  className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
2811
2814
  }
@@ -2875,8 +2878,8 @@ function wl() {
2875
2878
  renderLineHighlight: "none"
2876
2879
  },
2877
2880
  defaultLanguage: "json",
2878
- value: z(),
2879
- onChange: (v) => i(v)
2881
+ value: O(),
2882
+ onChange: (N) => i(N)
2880
2883
  }
2881
2884
  )
2882
2885
  }
@@ -2905,7 +2908,7 @@ function wl() {
2905
2908
  },
2906
2909
  defaultLanguage: "javascript",
2907
2910
  value: r,
2908
- onChange: (v) => c(v || "")
2911
+ onChange: (N) => c(N || "")
2909
2912
  }
2910
2913
  )
2911
2914
  }
@@ -2915,16 +2918,16 @@ function wl() {
2915
2918
  /* @__PURE__ */ e.jsxs(oa, { className: "flex items-center", children: [
2916
2919
  /* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children: o }),
2917
2920
  /* @__PURE__ */ e.jsx(
2918
- O,
2921
+ F,
2919
2922
  {
2920
2923
  disabled: !y,
2921
- onClick: T,
2924
+ onClick: I,
2922
2925
  variant: "outline",
2923
2926
  children: "Reset"
2924
2927
  }
2925
2928
  ),
2926
- /* @__PURE__ */ e.jsx(O, { onClick: L, variant: "outline", children: "Apply" }),
2927
- /* @__PURE__ */ e.jsx(O, { onClick: () => t(!1), variant: "outline", children: "Close" })
2929
+ /* @__PURE__ */ e.jsx(F, { onClick: L, variant: "outline", children: "Apply" }),
2930
+ /* @__PURE__ */ e.jsx(F, { onClick: () => t(!1), variant: "outline", children: "Close" })
2928
2931
  ] })
2929
2932
  ]
2930
2933
  }
@@ -2959,7 +2962,7 @@ function Xa(s) {
2959
2962
  const [t, a] = R(null);
2960
2963
  return Z(() => {
2961
2964
  s && (async () => {
2962
- const i = (await import("./lucide-react-lLTbaV0Q.js"))[s];
2965
+ const i = (await import("./lucide-react-i2jWfYYq.js"))[s];
2963
2966
  a(i);
2964
2967
  })();
2965
2968
  }, [s]), t;
@@ -3009,101 +3012,101 @@ const zl = ({
3009
3012
  onClick: a
3010
3013
  }) => {
3011
3014
  const n = Xa(t || ""), l = s.charAt(0).toUpperCase();
3012
- return /* @__PURE__ */ e.jsx(O, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
3015
+ return /* @__PURE__ */ e.jsx(F, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
3013
3016
  };
3014
3017
  function Ol() {
3015
- var u, y;
3016
- const [s, t] = R(!1), a = d((g) => g.card), n = a.type, { setCardType: l, setCardPreferences: i, setChartOrientation: r } = d((g) => g.actions), { setCardCustomCfg: c, setCustomCardPreferences: o } = ce();
3017
- function h(g, x) {
3018
- c(null), i({}), l(g), x && o({
3018
+ var d, y;
3019
+ const [s, t] = R(!1), a = u((f) => f.card), n = a.type, { setCardType: l, setCardPreferences: i, setChartOrientation: r } = u((f) => f.actions), { setCardCustomCfg: c, setCustomCardPreferences: o } = ce();
3020
+ function x(f, m) {
3021
+ c(null), i({}), l(f), m && o({
3019
3022
  type: "component",
3020
3023
  visualType: "single",
3021
- url: x.url,
3022
- componentName: x.name,
3023
- icon: x.icon
3024
+ url: m.url,
3025
+ componentName: m.name,
3026
+ icon: m.icon
3024
3027
  }), t(!1);
3025
3028
  }
3026
3029
  return /* @__PURE__ */ e.jsxs(ps, { open: s, onOpenChange: t, children: [
3027
- /* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3030
+ /* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3028
3031
  Fl,
3029
3032
  {
3030
3033
  className: "h-4 w-4",
3031
3034
  chartType: n,
3032
- customIcon: (u = a.customCardPreferences) == null ? void 0 : u.icon,
3035
+ customIcon: (d = a.customCardPreferences) == null ? void 0 : d.icon,
3033
3036
  componentName: (y = a.customCardPreferences) == null ? void 0 : y.componentName
3034
3037
  }
3035
3038
  ) }) }),
3036
3039
  /* @__PURE__ */ e.jsxs(gs, { className: "w-50", children: [
3037
3040
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-4 place-items-center", children: [
3038
3041
  /* @__PURE__ */ e.jsx(
3039
- O,
3042
+ F,
3040
3043
  {
3041
- onClick: () => h("bar"),
3044
+ onClick: () => x("bar"),
3042
3045
  className: "font-normal",
3043
3046
  variant: "ghost",
3044
3047
  children: /* @__PURE__ */ e.jsx(Gs, { className: "size-5" })
3045
3048
  }
3046
3049
  ),
3047
3050
  /* @__PURE__ */ e.jsx(
3048
- O,
3051
+ F,
3049
3052
  {
3050
- onClick: () => h("line"),
3053
+ onClick: () => x("line"),
3051
3054
  variant: "ghost",
3052
3055
  children: /* @__PURE__ */ e.jsx(Ks, { className: "size-5" })
3053
3056
  }
3054
3057
  ),
3055
3058
  /* @__PURE__ */ e.jsx(
3056
- O,
3059
+ F,
3057
3060
  {
3058
- onClick: () => h("stackedBar"),
3061
+ onClick: () => x("stackedBar"),
3059
3062
  variant: "ghost",
3060
3063
  children: /* @__PURE__ */ e.jsx(Ja, { className: "size-5", strokeWidth: 0 })
3061
3064
  }
3062
3065
  ),
3063
3066
  /* @__PURE__ */ e.jsx(
3064
- O,
3067
+ F,
3065
3068
  {
3066
- onClick: () => h("stackedLine"),
3069
+ onClick: () => x("stackedLine"),
3067
3070
  variant: "ghost",
3068
3071
  children: /* @__PURE__ */ e.jsx(Qa, { className: "size-5", strokeWidth: 0 })
3069
3072
  }
3070
3073
  ),
3071
3074
  /* @__PURE__ */ e.jsx(
3072
- O,
3075
+ F,
3073
3076
  {
3074
- onClick: () => h("scatter"),
3077
+ onClick: () => x("scatter"),
3075
3078
  variant: "ghost",
3076
3079
  children: /* @__PURE__ */ e.jsx(Da, { className: "size-5" })
3077
3080
  }
3078
3081
  ),
3079
3082
  /* @__PURE__ */ e.jsx(
3080
- O,
3083
+ F,
3081
3084
  {
3082
- onClick: () => h("bubble"),
3085
+ onClick: () => x("bubble"),
3083
3086
  variant: "ghost",
3084
3087
  children: /* @__PURE__ */ e.jsx(Ka, { className: "size-4" })
3085
3088
  }
3086
3089
  ),
3087
3090
  /* @__PURE__ */ e.jsx(
3088
- O,
3091
+ F,
3089
3092
  {
3090
- onClick: () => h("pie"),
3093
+ onClick: () => x("pie"),
3091
3094
  variant: "ghost",
3092
- children: /* @__PURE__ */ e.jsx(Ia, { className: "size-5" })
3095
+ children: /* @__PURE__ */ e.jsx(Ta, { className: "size-5" })
3093
3096
  }
3094
3097
  ),
3095
3098
  /* @__PURE__ */ e.jsx(
3096
- O,
3099
+ F,
3097
3100
  {
3098
- onClick: () => h("doughnut"),
3101
+ onClick: () => x("doughnut"),
3099
3102
  variant: "ghost",
3100
3103
  children: /* @__PURE__ */ e.jsx(Ua, { className: "size-5", strokeWidth: 1 })
3101
3104
  }
3102
3105
  ),
3103
3106
  /* @__PURE__ */ e.jsx(
3104
- O,
3107
+ F,
3105
3108
  {
3106
- onClick: () => h("radar"),
3109
+ onClick: () => x("radar"),
3107
3110
  variant: "ghost",
3108
3111
  children: /* @__PURE__ */ e.jsx(
3109
3112
  Ba,
@@ -3115,71 +3118,71 @@ function Ol() {
3115
3118
  }
3116
3119
  ),
3117
3120
  /* @__PURE__ */ e.jsx(
3118
- O,
3121
+ F,
3119
3122
  {
3120
- onClick: () => h("polarArea"),
3123
+ onClick: () => x("polarArea"),
3121
3124
  variant: "ghost",
3122
3125
  children: /* @__PURE__ */ e.jsx(Ga, { className: "size-5" })
3123
3126
  }
3124
3127
  ),
3125
3128
  /* @__PURE__ */ e.jsx(
3126
- O,
3129
+ F,
3127
3130
  {
3128
- onClick: () => h("pyramid"),
3131
+ onClick: () => x("pyramid"),
3129
3132
  variant: "ghost",
3130
3133
  children: /* @__PURE__ */ e.jsx(Ya, { className: "size-5" })
3131
3134
  }
3132
3135
  ),
3133
3136
  /* @__PURE__ */ e.jsx(
3134
- O,
3137
+ F,
3135
3138
  {
3136
- onClick: () => h("range"),
3139
+ onClick: () => x("range"),
3137
3140
  variant: "ghost",
3138
- children: /* @__PURE__ */ e.jsx(Ta, { className: "size-5" })
3141
+ children: /* @__PURE__ */ e.jsx(Ia, { className: "size-5" })
3139
3142
  }
3140
3143
  ),
3141
3144
  /* @__PURE__ */ e.jsx(
3142
- O,
3145
+ F,
3143
3146
  {
3144
- onClick: () => h("table"),
3147
+ onClick: () => x("table"),
3145
3148
  variant: "ghost",
3146
3149
  children: /* @__PURE__ */ e.jsx(Rs, { className: "size-5" })
3147
3150
  }
3148
3151
  ),
3149
3152
  /* @__PURE__ */ e.jsx(
3150
- O,
3153
+ F,
3151
3154
  {
3152
- onClick: () => h("kpi"),
3155
+ onClick: () => x("kpi"),
3153
3156
  variant: "ghost",
3154
3157
  children: /* @__PURE__ */ e.jsx(Wa, { className: "size-6" })
3155
3158
  }
3156
3159
  ),
3157
3160
  /* @__PURE__ */ e.jsx(
3158
- O,
3161
+ F,
3159
3162
  {
3160
- onClick: () => h("text"),
3163
+ onClick: () => x("text"),
3161
3164
  variant: "ghost",
3162
3165
  children: /* @__PURE__ */ e.jsx(Qs, { className: "size-4" })
3163
3166
  }
3164
3167
  ),
3165
3168
  /* @__PURE__ */ e.jsx(
3166
- O,
3169
+ F,
3167
3170
  {
3168
- onClick: () => h("map"),
3171
+ onClick: () => x("map"),
3169
3172
  variant: "ghost",
3170
3173
  children: /* @__PURE__ */ e.jsx(Ea, { className: "size-4" })
3171
3174
  }
3172
3175
  ),
3173
3176
  /* @__PURE__ */ e.jsx(
3174
- O,
3177
+ F,
3175
3178
  {
3176
- onClick: () => h("custom"),
3179
+ onClick: () => x("custom"),
3177
3180
  variant: "ghost",
3178
3181
  children: /* @__PURE__ */ e.jsx(Va, { className: "size-4" })
3179
3182
  }
3180
3183
  )
3181
3184
  ] }),
3182
- /* @__PURE__ */ e.jsx(kl, { onChartTypeChange: h })
3185
+ /* @__PURE__ */ e.jsx(kl, { onChartTypeChange: x })
3183
3186
  ] })
3184
3187
  ] });
3185
3188
  }
@@ -3196,7 +3199,7 @@ function Fl({
3196
3199
  case "line":
3197
3200
  return /* @__PURE__ */ e.jsx(Ks, { className: t });
3198
3201
  case "pie":
3199
- return /* @__PURE__ */ e.jsx(Ia, { className: t });
3202
+ return /* @__PURE__ */ e.jsx(Ta, { className: t });
3200
3203
  case "radar":
3201
3204
  return /* @__PURE__ */ e.jsx(Ba, { className: t });
3202
3205
  case "scatter":
@@ -3214,7 +3217,7 @@ function Fl({
3214
3217
  case "pyramid":
3215
3218
  return /* @__PURE__ */ e.jsx(Ya, { className: t });
3216
3219
  case "range":
3217
- return /* @__PURE__ */ e.jsx(Ta, { className: t });
3220
+ return /* @__PURE__ */ e.jsx(Ia, { className: t });
3218
3221
  case "kpi":
3219
3222
  return /* @__PURE__ */ e.jsx(Wa, { className: t });
3220
3223
  case "text":
@@ -3227,9 +3230,9 @@ function Fl({
3227
3230
  return /* @__PURE__ */ e.jsx(Rs, { className: t });
3228
3231
  }
3229
3232
  }
3230
- function Tl() {
3233
+ function Il() {
3231
3234
  var l;
3232
- const s = d((i) => i.card), t = ((l = s.customCardPreferences) == null ? void 0 : l.showCardHeader) ?? !0, { setCustomCardPreferences: a } = ce(), n = (i) => {
3235
+ const s = u((i) => i.card), t = ((l = s.customCardPreferences) == null ? void 0 : l.showCardHeader) ?? !0, { setCustomCardPreferences: a } = ce(), n = (i) => {
3233
3236
  s.customCardPreferences && a({
3234
3237
  ...s.customCardPreferences,
3235
3238
  showCardHeader: i === !0
@@ -3263,13 +3266,13 @@ function Tl() {
3263
3266
  ] });
3264
3267
  }
3265
3268
  function ra() {
3266
- const s = d((m) => m.frame), t = d((m) => m.card), a = d((m) => m.isShowingVisual), n = d((m) => m.isSqlRunning), l = d((m) => m.queryError), i = d((m) => m.pythonStdOut), r = d((m) => m.actions.setRunSql);
3267
- d((m) => m.onSave), d((m) => m.onClose), d((m) => m.actions.setCardSql), d((m) => m.actions.setCardType), d((m) => m.actions.setSqlGen);
3268
- const { setFrame: c, setCard: o, updateCardInFrame: h } = ce(), { data: u, isLoading: y, isFetching: g } = qe(t);
3269
+ const s = u((h) => h.frame), t = u((h) => h.card), a = u((h) => h.isShowingVisual), n = u((h) => h.isSqlRunning), l = u((h) => h.queryError), i = u((h) => h.pythonStdOut), r = u((h) => h.actions.setRunSql);
3270
+ u((h) => h.onSave), u((h) => h.onClose), u((h) => h.actions.setCardSql), u((h) => h.actions.setCardType), u((h) => h.actions.setSqlGen);
3271
+ const { setFrame: c, setCard: o, updateCardInFrame: x } = ce(), { data: d, isLoading: y, isFetching: f } = qe(t);
3269
3272
  if (!t)
3270
3273
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
3271
- function x() {
3272
- const m = {
3274
+ function m() {
3275
+ const h = {
3273
3276
  connectionId: t.connectionId,
3274
3277
  id: We(),
3275
3278
  title: "Title",
@@ -3286,123 +3289,123 @@ function ra() {
3286
3289
  sql: "",
3287
3290
  data: []
3288
3291
  };
3289
- f(m);
3292
+ g(h);
3290
3293
  }
3291
- function f(m) {
3292
- const p = {
3294
+ function g(h) {
3295
+ const v = {
3293
3296
  ...s,
3294
- cards: [...s.cards, m],
3295
- activeCardId: m.id
3297
+ cards: [...s.cards, h],
3298
+ activeCardId: h.id
3296
3299
  };
3297
- c(p), o(m);
3300
+ c(v), o(h);
3298
3301
  }
3299
3302
  function j() {
3300
- const m = {
3303
+ const h = {
3301
3304
  ...t,
3302
3305
  id: We(),
3303
3306
  title: `${t.title} Copy`,
3304
3307
  tabTitle: `${t.tabTitle} Copy`
3305
3308
  };
3306
- f(m);
3309
+ g(h);
3307
3310
  }
3308
- function F(m) {
3309
- const p = s.cards.filter((V) => V.id !== m), C = p[0], I = {
3311
+ function D(h) {
3312
+ const v = s.cards.filter((V) => V.id !== h), p = v[0], k = {
3310
3313
  ...s,
3311
- cards: p,
3314
+ cards: v,
3312
3315
  // update the active card to the first card in the frame
3313
- activeCardId: C.id
3316
+ activeCardId: p.id
3314
3317
  };
3315
- c(I), o(C);
3318
+ c(k), o(p);
3316
3319
  }
3317
- function N(m) {
3318
- const p = {
3320
+ function C(h) {
3321
+ const v = {
3319
3322
  ...s,
3320
- cards: s.cards.map((I) => I.id === t.id ? t : I),
3321
- activeCardId: m
3323
+ cards: s.cards.map((k) => k.id === t.id ? t : k),
3324
+ activeCardId: h
3322
3325
  };
3323
- c(p);
3324
- const C = p.cards.find((I) => I.id === m);
3325
- C.sql && r(!0), o(C);
3326
+ c(v);
3327
+ const p = v.cards.find((k) => k.id === h);
3328
+ p.sql && r(!0), o(p);
3326
3329
  }
3327
- const L = (m, p) => {
3328
- console.log("handleDragStart", p), m.dataTransfer.setData("tabIndex", p.toString());
3329
- }, T = (m) => {
3330
- m.preventDefault();
3331
- }, z = (m, p) => {
3332
- const C = m.dataTransfer.getData("tabIndex");
3333
- if (C === p.toString())
3330
+ const L = (h, v) => {
3331
+ console.log("handleDragStart", v), h.dataTransfer.setData("tabIndex", v.toString());
3332
+ }, I = (h) => {
3333
+ h.preventDefault();
3334
+ }, O = (h, v) => {
3335
+ const p = h.dataTransfer.getData("tabIndex");
3336
+ if (p === v.toString())
3334
3337
  return;
3335
- const I = Array.from(s.cards), [V] = I.splice(parseInt(C), 1);
3336
- I.splice(p, 0, V), c({ ...s, cards: I });
3338
+ const k = Array.from(s.cards), [V] = k.splice(parseInt(p), 1);
3339
+ k.splice(v, 0, V), c({ ...s, cards: k });
3337
3340
  };
3338
- function v(m, p) {
3339
- return m.cards.length === 1 && (p.displayTab === !0 || p.displayTab === void 0) || m.activeCardId !== p.id && (p.displayTab === !0 || p.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
3341
+ function N(h, v) {
3342
+ return h.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || h.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
3340
3343
  "div",
3341
3344
  {
3342
3345
  onClick: () => {
3343
- const C = p.displayTab === void 0 ? !1 : !p.displayTab;
3344
- o({ ...p, displayTab: C }), h({
3345
- ...p,
3346
- displayTab: C
3346
+ const p = v.displayTab === void 0 ? !1 : !v.displayTab;
3347
+ o({ ...v, displayTab: p }), x({
3348
+ ...v,
3349
+ displayTab: p
3347
3350
  });
3348
3351
  },
3349
- children: p.displayTab === !0 || p.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Mn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Dn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3352
+ children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Mn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Dn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3350
3353
  }
3351
3354
  );
3352
3355
  }
3353
- function D() {
3356
+ function T() {
3354
3357
  return /* @__PURE__ */ e.jsxs(
3355
3358
  Sa,
3356
3359
  {
3357
- onValueChange: N,
3360
+ onValueChange: C,
3358
3361
  value: s.activeCardId,
3359
3362
  className: "flex grow flex-col",
3360
3363
  children: [
3361
- s.cards.map((m) => /* @__PURE__ */ e.jsx(os, { className: "mt-0 grow", value: m.id, children: A() }, m.id)),
3364
+ s.cards.map((h) => /* @__PURE__ */ e.jsx(os, { className: "mt-0 grow", value: h.id, children: A() }, h.id)),
3362
3365
  /* @__PURE__ */ e.jsx(wa, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
3363
- s.cards.map((m, p) => /* @__PURE__ */ e.jsx(
3366
+ s.cards.map((h, v) => /* @__PURE__ */ e.jsx(
3364
3367
  rs,
3365
3368
  {
3366
- text: m.tabTitle || m.title,
3367
- onSave: (C) => {
3368
- o({ ...t, tabTitle: C }), h({ ...t, tabTitle: C });
3369
+ text: h.tabTitle || h.title,
3370
+ onSave: (p) => {
3371
+ o({ ...t, tabTitle: p }), x({ ...t, tabTitle: p });
3369
3372
  },
3370
3373
  children: /* @__PURE__ */ e.jsxs(
3371
3374
  is,
3372
3375
  {
3373
3376
  draggable: !0,
3374
- onDragStart: (C) => L(C, p),
3375
- onDragOver: T,
3376
- onDrop: (C) => z(C, p),
3377
+ onDragStart: (p) => L(p, v),
3378
+ onDragOver: I,
3379
+ onDrop: (p) => O(p, v),
3377
3380
  className: "",
3378
- value: m.id,
3381
+ value: h.id,
3379
3382
  children: [
3380
- v(s, m),
3381
- m.tabTitle || m.title,
3382
- s.activeCardId === m.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
3383
+ N(s, h),
3384
+ h.tabTitle || h.title,
3385
+ s.activeCardId === h.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
3383
3386
  za,
3384
3387
  {
3385
3388
  className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
3386
- onClick: () => F(m.id)
3389
+ onClick: () => D(h.id)
3387
3390
  }
3388
3391
  )
3389
3392
  ]
3390
3393
  }
3391
3394
  )
3392
3395
  },
3393
- m.id
3396
+ h.id
3394
3397
  )),
3395
3398
  /* @__PURE__ */ e.jsx(
3396
- O,
3399
+ F,
3397
3400
  {
3398
3401
  className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
3399
3402
  variant: "outline",
3400
- onClick: x,
3403
+ onClick: m,
3401
3404
  children: /* @__PURE__ */ e.jsx(Ds, { className: "h-4 w-4" })
3402
3405
  }
3403
3406
  ),
3404
3407
  /* @__PURE__ */ e.jsx(
3405
- O,
3408
+ F,
3406
3409
  {
3407
3410
  className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
3408
3411
  variant: "outline",
@@ -3416,34 +3419,34 @@ function ra() {
3416
3419
  );
3417
3420
  }
3418
3421
  function A() {
3419
- 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(Yt, { 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(
3422
+ 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(Yt, { card: t, data: d == null ? void 0 : d.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(
3420
3423
  Xt,
3421
3424
  {
3422
3425
  isLoading: n,
3423
3426
  card: t,
3424
- data: u == null ? void 0 : u.records
3427
+ data: d == null ? void 0 : d.records
3425
3428
  }
3426
3429
  ) }) }) : /* @__PURE__ */ e.jsx(xs, { FallbackComponent: Na, children: /* @__PURE__ */ e.jsx(Pa, { className: "grow border-none shadow-none" }) });
3427
3430
  }
3428
3431
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
3429
- (y || g) && /* @__PURE__ */ e.jsx(Ze, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3432
+ (y || f) && /* @__PURE__ */ e.jsx(Ze, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3430
3433
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
3431
3434
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
3432
3435
  /* @__PURE__ */ e.jsx(Ol, {}),
3433
3436
  !["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(wl, {}),
3434
- /* @__PURE__ */ e.jsx(Tl, {})
3437
+ /* @__PURE__ */ e.jsx(Il, {})
3435
3438
  ] }),
3436
3439
  /* @__PURE__ */ e.jsx(Dl, {})
3437
3440
  ] }),
3438
- a ? D() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
3439
- i && /* @__PURE__ */ e.jsx(Il, {}),
3440
- (u == null ? void 0 : u.records) && (u == null ? void 0 : u.records.length) > 0 && /* @__PURE__ */ e.jsx(Nl, { data: (u == null ? void 0 : u.records) || [] }),
3441
+ a ? T() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
3442
+ i && /* @__PURE__ */ e.jsx(Tl, {}),
3443
+ (d == null ? void 0 : d.records) && (d == null ? void 0 : d.records.length) > 0 && /* @__PURE__ */ e.jsx(Nl, { data: (d == null ? void 0 : d.records) || [] }),
3441
3444
  l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: l })
3442
3445
  ] })
3443
3446
  ] });
3444
3447
  }
3445
- function Il() {
3446
- const s = d((a) => a.pythonStdOut);
3448
+ function Tl() {
3449
+ const s = u((a) => a.pythonStdOut);
3447
3450
  if (!s)
3448
3451
  return null;
3449
3452
  const t = s.replace(/\n/g, "<br>");
@@ -3460,7 +3463,7 @@ function Il() {
3460
3463
  ] });
3461
3464
  }
3462
3465
  function Dl() {
3463
- const s = d((a) => a.isShowingVisual), t = d(
3466
+ const s = u((a) => a.isShowingVisual), t = u(
3464
3467
  (a) => a.actions.setIsShowingVisual
3465
3468
  );
3466
3469
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
@@ -3489,7 +3492,7 @@ function Ml({
3489
3492
  className: "flex gap-4",
3490
3493
  defaultValue: s[0].value,
3491
3494
  children: s.map((n) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3492
- /* @__PURE__ */ e.jsx(Ie, { value: n.value, id: n.value }),
3495
+ /* @__PURE__ */ e.jsx(Te, { value: n.value, id: n.value }),
3493
3496
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: n.value, children: n.label })
3494
3497
  ] }, n.value))
3495
3498
  }
@@ -3512,7 +3515,7 @@ function pe({
3512
3515
  ),
3513
3516
  /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(ke, { children: [
3514
3517
  /* @__PURE__ */ e.jsx(ye, { children: s }),
3515
- t.map((i) => /* @__PURE__ */ e.jsx(J, { value: i.value, children: i.label }, i.value))
3518
+ t.map((i) => /* @__PURE__ */ e.jsx(Q, { value: i.value, children: i.label }, i.value))
3516
3519
  ] }) })
3517
3520
  ] });
3518
3521
  }
@@ -3538,111 +3541,111 @@ function Qe({
3538
3541
  );
3539
3542
  }
3540
3543
  function Ll() {
3541
- var j, F;
3542
- const s = d(
3543
- (N) => N.card.customCardPreferences
3544
- ), { data: t } = Za(), a = (t == null ? void 0 : t.plugins) || [], n = d((N) => N.card), l = d((N) => N.frame), i = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: r } = ce(), { components: c, manifest: o } = va(
3544
+ var j, D;
3545
+ const s = u(
3546
+ (C) => C.card.customCardPreferences
3547
+ ), { data: t } = Za(), a = (t == null ? void 0 : t.plugins) || [], n = u((C) => C.card), l = u((C) => C.frame), i = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: r } = ce(), { components: c, manifest: o } = va(
3545
3548
  (s == null ? void 0 : s.url) || ""
3546
- ), h = (j = o == null ? void 0 : o.visuals) == null ? void 0 : j.find(
3547
- (N) => N.name === (s == null ? void 0 : s.componentName)
3549
+ ), x = (j = o == null ? void 0 : o.visuals) == null ? void 0 : j.find(
3550
+ (C) => C.name === (s == null ? void 0 : s.componentName)
3548
3551
  );
3549
- function u(N, L) {
3552
+ function d(C, L) {
3550
3553
  if (!s)
3551
3554
  return;
3552
- const z = {
3555
+ const O = {
3553
3556
  ...(s == null ? void 0 : s.dataInputCardIds) || {},
3554
- [N]: {
3557
+ [C]: {
3555
3558
  cardId: L,
3556
3559
  hookRef: null
3557
3560
  }
3558
3561
  };
3559
3562
  r({
3560
3563
  ...s,
3561
- dataInputCardIds: z
3564
+ dataInputCardIds: O
3562
3565
  });
3563
3566
  }
3564
- function y(N) {
3565
- var T, z;
3566
- const L = (T = l == null ? void 0 : l.cards) == null ? void 0 : T.filter((v) => {
3567
- var D;
3568
- return ((D = v == null ? void 0 : v.customCardPreferences) == null ? void 0 : D.visualType) !== "multiple";
3569
- }).map((v) => ({
3570
- value: v.id,
3571
- label: v.tabTitle || v.title
3567
+ function y(C) {
3568
+ var I, O;
3569
+ const L = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((N) => {
3570
+ var T;
3571
+ return ((T = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : T.visualType) !== "multiple";
3572
+ }).map((N) => ({
3573
+ value: N.id,
3574
+ label: N.tabTitle || N.title
3572
3575
  }));
3573
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (z = N == null ? void 0 : N.dataInputs) == null ? void 0 : z.map((v, D) => {
3574
- var A, m;
3576
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (O = C == null ? void 0 : C.dataInputs) == null ? void 0 : O.map((N, T) => {
3577
+ var A, h;
3575
3578
  return /* @__PURE__ */ e.jsxs(
3576
3579
  "div",
3577
3580
  {
3578
3581
  className: "grid grid-cols-10 gap-2",
3579
3582
  children: [
3580
- /* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: v }),
3583
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: N }),
3581
3584
  /* @__PURE__ */ e.jsx(
3582
3585
  pe,
3583
3586
  {
3584
3587
  className: "col-span-6 h-8 w-full justify-between",
3585
3588
  label: "",
3586
3589
  options: L || [],
3587
- value: ((m = (A = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : A[D]) == null ? void 0 : m.cardId) || "",
3588
- onValueChange: (p) => u(D, p)
3590
+ value: ((h = (A = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : A[T]) == null ? void 0 : h.cardId) || "",
3591
+ onValueChange: (v) => d(T, v)
3589
3592
  }
3590
3593
  )
3591
3594
  ]
3592
3595
  },
3593
- D + Math.random()
3596
+ T + Math.random()
3594
3597
  );
3595
3598
  }) });
3596
3599
  }
3597
- function g(N, L, T = []) {
3598
- var z, v;
3599
- return s ? N === "input" ? /* @__PURE__ */ e.jsx(
3600
+ function f(C, L, I = []) {
3601
+ var O, N;
3602
+ return s ? C === "input" ? /* @__PURE__ */ e.jsx(
3600
3603
  re,
3601
3604
  {
3602
3605
  className: `h-8 w-full ${Ge}`,
3603
- value: ((z = s == null ? void 0 : s.settings) == null ? void 0 : z[L]) || "",
3604
- onChange: (D) => {
3606
+ value: ((O = s == null ? void 0 : s.settings) == null ? void 0 : O[L]) || "",
3607
+ onChange: (T) => {
3605
3608
  r({
3606
3609
  ...s,
3607
3610
  settings: {
3608
3611
  ...s == null ? void 0 : s.settings,
3609
- [L]: D.target.value
3612
+ [L]: T.target.value
3610
3613
  }
3611
3614
  });
3612
3615
  }
3613
3616
  },
3614
3617
  L
3615
- ) : N === "select" ? /* @__PURE__ */ e.jsx(
3618
+ ) : C === "select" ? /* @__PURE__ */ e.jsx(
3616
3619
  pe,
3617
3620
  {
3618
3621
  className: "h-8 w-full",
3619
3622
  label: "",
3620
- options: T,
3621
- value: ((v = s == null ? void 0 : s.settings) == null ? void 0 : v[L]) || "",
3622
- onValueChange: (D) => {
3623
+ options: I,
3624
+ value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[L]) || "",
3625
+ onValueChange: (T) => {
3623
3626
  r({
3624
3627
  ...s,
3625
- settings: { ...s == null ? void 0 : s.settings, [L]: D }
3628
+ settings: { ...s == null ? void 0 : s.settings, [L]: T }
3626
3629
  });
3627
3630
  }
3628
3631
  }
3629
3632
  ) : null : null;
3630
3633
  }
3631
- function x(N) {
3632
- const L = Object.entries((N == null ? void 0 : N.settings) || {});
3633
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: L.map(([T, z]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3634
- /* @__PURE__ */ e.jsx(H, { children: z.title }),
3635
- g(
3636
- z.ui,
3637
- T,
3638
- z.options
3634
+ function m(C) {
3635
+ const L = Object.entries((C == null ? void 0 : C.settings) || {});
3636
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: L.map(([I, O]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3637
+ /* @__PURE__ */ e.jsx(H, { children: O.title }),
3638
+ f(
3639
+ O.ui,
3640
+ I,
3641
+ O.options
3639
3642
  )
3640
- ] }, T)) });
3643
+ ] }, I)) });
3641
3644
  }
3642
- function f(N) {
3645
+ function g(C) {
3643
3646
  s && r({
3644
3647
  ...s,
3645
- visualType: N,
3648
+ visualType: C,
3646
3649
  componentName: ""
3647
3650
  });
3648
3651
  }
@@ -3659,12 +3662,12 @@ function Ll() {
3659
3662
  label: "",
3660
3663
  options: a,
3661
3664
  value: (s == null ? void 0 : s.url) || "",
3662
- onValueChange: (N) => r({
3665
+ onValueChange: (C) => r({
3663
3666
  ...s || {
3664
3667
  url: "",
3665
3668
  componentName: ""
3666
3669
  },
3667
- url: N
3670
+ url: C
3668
3671
  })
3669
3672
  }
3670
3673
  ) }) }),
@@ -3676,7 +3679,7 @@ function Ll() {
3676
3679
  { value: "multiple", label: "Multi-Visual" }
3677
3680
  ],
3678
3681
  value: i,
3679
- onValueChange: f
3682
+ onValueChange: g
3680
3683
  }
3681
3684
  ),
3682
3685
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && s && /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
@@ -3687,16 +3690,16 @@ function Ll() {
3687
3690
  className: "h-8 w-full",
3688
3691
  label: "",
3689
3692
  options: (c == null ? void 0 : c.filter(
3690
- (N) => N.type === i
3691
- ).map((N) => ({
3692
- value: N.name,
3693
- label: N.name
3693
+ (C) => C.type === i
3694
+ ).map((C) => ({
3695
+ value: C.name,
3696
+ label: C.name
3694
3697
  }))) || [],
3695
3698
  value: s.componentName,
3696
- onValueChange: (N) => {
3697
- console.log("changing value", N), r({
3699
+ onValueChange: (C) => {
3700
+ console.log("changing value", C), r({
3698
3701
  ...s,
3699
- componentName: N
3702
+ componentName: C
3700
3703
  });
3701
3704
  }
3702
3705
  }
@@ -3704,12 +3707,12 @@ function Ll() {
3704
3707
  ] }) })
3705
3708
  ] }) }) }),
3706
3709
  /* @__PURE__ */ e.jsx(de, { className: "my-4" }),
3707
- ((F = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : F.componentName) && /* @__PURE__ */ e.jsxs(Qe, { summary: "Component Settings", children: [
3708
- h && h.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3710
+ ((D = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : D.componentName) && /* @__PURE__ */ e.jsxs(Qe, { summary: "Component Settings", children: [
3711
+ x && x.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3709
3712
  /* @__PURE__ */ e.jsx(H, { children: "Input Mapping" }),
3710
- /* @__PURE__ */ e.jsx("div", { className: "px-2", children: y(h) })
3713
+ /* @__PURE__ */ e.jsx("div", { className: "px-2", children: y(x) })
3711
3714
  ] }),
3712
- h && h.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: x(h) }) })
3715
+ x && x.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: m(x) }) })
3713
3716
  ] })
3714
3717
  ]
3715
3718
  }
@@ -3717,28 +3720,28 @@ function Ll() {
3717
3720
  }
3718
3721
  function Me() {
3719
3722
  const [s, t] = R([]);
3720
- d(
3721
- (u) => u.card.cfg
3723
+ u(
3724
+ (d) => d.card.cfg
3722
3725
  );
3723
- const a = d((u) => u.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: i } = d((u) => u.actions), r = d(
3724
- (u) => u.queryResultColumns
3726
+ const a = u((d) => d.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: i } = u((d) => d.actions), r = u(
3727
+ (d) => d.queryResultColumns
3725
3728
  );
3726
- d(
3727
- (u) => {
3729
+ u(
3730
+ (d) => {
3728
3731
  var y;
3729
- return (y = u.card.preferences) == null ? void 0 : y.filterOnClickColumnIndex;
3732
+ return (y = d.card.preferences) == null ? void 0 : y.filterOnClickColumnIndex;
3730
3733
  }
3731
3734
  ), Z(() => {
3732
3735
  r && t(new Array(r.length).fill(!1));
3733
3736
  }, [r]);
3734
- function c(u, y) {
3735
- var g, x;
3736
- y ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? i({
3737
+ function c(d, y) {
3738
+ var f, m;
3739
+ y ? a != null && a.onClickFilter && ((f = a == null ? void 0 : a.onClickFilter) == null ? void 0 : f.length) > 0 ? i({
3737
3740
  ...a,
3738
3741
  onClickFilter: [
3739
3742
  ...a.onClickFilter,
3740
3743
  {
3741
- columnIndex: u,
3744
+ columnIndex: d,
3742
3745
  expression: ""
3743
3746
  }
3744
3747
  ]
@@ -3746,39 +3749,39 @@ function Me() {
3746
3749
  ...a,
3747
3750
  onClickFilter: [
3748
3751
  {
3749
- columnIndex: u,
3752
+ columnIndex: d,
3750
3753
  expression: ""
3751
3754
  }
3752
3755
  ]
3753
3756
  }) : (i({
3754
3757
  ...a,
3755
- onClickFilter: (x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.filter(
3756
- (f) => f.columnIndex !== u
3758
+ onClickFilter: (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.filter(
3759
+ (g) => g.columnIndex !== d
3757
3760
  )
3758
- }), t((f) => {
3759
- const j = [...f];
3760
- return j[u] = !1, j;
3761
+ }), t((g) => {
3762
+ const j = [...g];
3763
+ return j[d] = !1, j;
3761
3764
  }));
3762
3765
  }
3763
- function o(u, y) {
3764
- var x;
3765
- const g = (x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.map((f) => f.columnIndex === u ? {
3766
- ...f,
3766
+ function o(d, y) {
3767
+ var m;
3768
+ const f = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.map((g) => g.columnIndex === d ? {
3769
+ ...g,
3767
3770
  expression: y.target.value
3768
- } : f);
3771
+ } : g);
3769
3772
  i({
3770
3773
  ...a,
3771
- onClickFilter: g
3774
+ onClickFilter: f
3772
3775
  });
3773
3776
  }
3774
- function h(u) {
3775
- var y, g, x, f;
3776
- if (s != null && s[u] || (g = (y = a == null ? void 0 : a.onClickFilter) == null ? void 0 : y.find((j) => j.columnIndex === u)) != null && g.expression)
3777
+ function x(d) {
3778
+ var y, f, m, g;
3779
+ if (s != null && s[d] || (f = (y = a == null ? void 0 : a.onClickFilter) == null ? void 0 : y.find((j) => j.columnIndex === d)) != null && f.expression)
3777
3780
  return /* @__PURE__ */ e.jsx(
3778
3781
  re,
3779
3782
  {
3780
- value: (f = (x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.find((j) => j.columnIndex === u)) == null ? void 0 : f.expression,
3781
- onChange: (j) => o(u, j),
3783
+ value: (g = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find((j) => j.columnIndex === d)) == null ? void 0 : g.expression,
3784
+ onChange: (j) => o(d, j),
3782
3785
  type: "text",
3783
3786
  className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3784
3787
  placeholder: "Expression"
@@ -3787,8 +3790,8 @@ function Me() {
3787
3790
  }
3788
3791
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3789
3792
  /* @__PURE__ */ e.jsx(H, { children: "On Click" }),
3790
- r == null ? void 0 : r.map((u, y) => {
3791
- var g, x;
3793
+ r == null ? void 0 : r.map((d, y) => {
3794
+ var f, m;
3792
3795
  return /* @__PURE__ */ e.jsx(
3793
3796
  "div",
3794
3797
  {
@@ -3798,50 +3801,50 @@ function Me() {
3798
3801
  /* @__PURE__ */ e.jsx(
3799
3802
  ms,
3800
3803
  {
3801
- checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
3802
- (f) => f.columnIndex === y
3804
+ checked: !!((f = a == null ? void 0 : a.onClickFilter) != null && f.find(
3805
+ (g) => g.columnIndex === y
3803
3806
  )),
3804
- onCheckedChange: (f) => c(y, f)
3807
+ onCheckedChange: (g) => c(y, g)
3805
3808
  }
3806
3809
  ),
3807
3810
  /* @__PURE__ */ e.jsx(
3808
3811
  "label",
3809
3812
  {
3810
3813
  className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
3811
- children: u
3814
+ children: d
3812
3815
  }
3813
3816
  ),
3814
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.find(
3815
- (f) => f.columnIndex === y
3817
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find(
3818
+ (g) => g.columnIndex === y
3816
3819
  )) && /* @__PURE__ */ e.jsx(
3817
3820
  Aa,
3818
3821
  {
3819
3822
  onClick: () => {
3820
- t((f) => {
3821
- const j = [...f];
3822
- return j[y] = !f[y], j;
3823
+ t((g) => {
3824
+ const j = [...g];
3825
+ return j[y] = !g[y], j;
3823
3826
  });
3824
3827
  },
3825
3828
  className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
3826
3829
  }
3827
3830
  ) })
3828
3831
  ] }),
3829
- h(y)
3832
+ x(y)
3830
3833
  ] })
3831
3834
  },
3832
- u
3835
+ d
3833
3836
  );
3834
3837
  })
3835
3838
  ] });
3836
3839
  }
3837
3840
  function bs() {
3838
3841
  var r, c, o;
3839
- const s = d((h) => h.card.preferences), t = d(
3840
- (h) => h.card.cfg
3841
- ), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = d((h) => h.actions);
3842
+ const s = u((x) => x.card.preferences), t = u(
3843
+ (x) => x.card.cfg
3844
+ ), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = u((x) => x.actions);
3842
3845
  (r = t == null ? void 0 : t.options) != null && r.indexAxis;
3843
- function i(h) {
3844
- l(h);
3846
+ function i(x) {
3847
+ l(x);
3845
3848
  }
3846
3849
  return /* @__PURE__ */ e.jsxs(
3847
3850
  js,
@@ -3852,11 +3855,11 @@ function bs() {
3852
3855
  defaultValue: "x",
3853
3856
  children: [
3854
3857
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3855
- /* @__PURE__ */ e.jsx(Ie, { value: "x", id: "r1" }),
3858
+ /* @__PURE__ */ e.jsx(Te, { value: "x", id: "r1" }),
3856
3859
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
3857
3860
  ] }),
3858
3861
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3859
- /* @__PURE__ */ e.jsx(Ie, { value: "y", id: "r2" }),
3862
+ /* @__PURE__ */ e.jsx(Te, { value: "y", id: "r2" }),
3860
3863
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
3861
3864
  ] })
3862
3865
  ]
@@ -3870,32 +3873,32 @@ function ia(s, t) {
3870
3873
  return ((i = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : i.type) || "linear";
3871
3874
  }
3872
3875
  function et() {
3873
- var le, Q, ne, w, _, ee;
3874
- const [s, t] = R(!1), a = d((E) => {
3876
+ var le, J, ne, w, _, ee;
3877
+ const [s, t] = R(!1), a = u((E) => {
3875
3878
  var M;
3876
3879
  return (M = E.card) == null ? void 0 : M.preferences;
3877
- }), n = d((E) => {
3880
+ }), n = u((E) => {
3878
3881
  var M;
3879
3882
  return (M = E.card) == null ? void 0 : M.cfg;
3880
3883
  }), l = Oa(a, n), [i, r] = R(
3881
3884
  ia(a)
3882
3885
  ), [c, o] = R(
3883
- ((ne = (Q = (le = a == null ? void 0 : a.chartOptions) == null ? void 0 : le.scales) == null ? void 0 : Q[l]) == null ? void 0 : ne.min) || ""
3884
- ), [h, u] = R(
3886
+ ((ne = (J = (le = a == null ? void 0 : a.chartOptions) == null ? void 0 : le.scales) == null ? void 0 : J[l]) == null ? void 0 : ne.min) || ""
3887
+ ), [x, d] = R(
3885
3888
  ((ee = (_ = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : _[l]) == null ? void 0 : ee.max) || ""
3886
- ), [y, g] = R(c || h ? "custom" : "auto"), [x, f] = R(""), [j, F] = R(0), [N, L] = R(""), [T, z] = R(""), [v, D] = R(""), A = d(
3889
+ ), [y, f] = R(c || x ? "custom" : "auto"), [m, g] = R(""), [j, D] = R(0), [C, L] = R(""), [I, O] = R(""), [N, T] = R(""), A = u(
3887
3890
  (E) => E.actions.setCardPreferences
3888
- ), { updateCardInFrame: m } = ce(), p = d((E) => E.card), C = d((E) => {
3891
+ ), { updateCardInFrame: h } = ce(), v = u((E) => E.card), p = u((E) => {
3889
3892
  var M;
3890
3893
  return (M = E.card) == null ? void 0 : M.type;
3891
- }), I = ["pie", "doughnut", "polarArea"].includes(C);
3894
+ }), k = ["pie", "doughnut", "polarArea"].includes(p);
3892
3895
  Z(() => {
3893
3896
  var E, M, se, P, X, ie, Ce, Le, Ne, Fe, Se, ae, ue, he;
3894
3897
  r(ia(a)), o(
3895
3898
  ((se = (M = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : M[l]) == null ? void 0 : se.min) === 0 ? 0 : ""
3896
- ), u(((ie = (X = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : X[l]) == null ? void 0 : ie.max) || ""), f(
3899
+ ), d(((ie = (X = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : X[l]) == null ? void 0 : ie.max) || ""), g(
3897
3900
  ((Fe = (Ne = (Le = (Ce = a == null ? void 0 : a.chartOptions) == null ? void 0 : Ce.scales) == null ? void 0 : Le[l]) == null ? void 0 : Ne.ticks) == null ? void 0 : Fe.stepSize) || ""
3898
- ), F(((Se = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Se.decimalPlaces) || 0), L(((ae = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ae.suffix) || ""), z(((ue = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ue.currency) || ""), D(((he = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : he.locale) || "");
3901
+ ), D(((Se = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Se.decimalPlaces) || 0), L(((ae = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ae.suffix) || ""), O(((ue = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ue.currency) || ""), T(((he = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : he.locale) || "");
3899
3902
  }, [s, a, l]);
3900
3903
  function V(E, M) {
3901
3904
  return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(E);
@@ -3924,19 +3927,19 @@ function et() {
3924
3927
  /* @__PURE__ */ e.jsxs(
3925
3928
  fe,
3926
3929
  {
3927
- value: T || "none",
3928
- onValueChange: (M) => z(M === "none" ? "" : M),
3930
+ value: I || "none",
3931
+ onValueChange: (M) => O(M === "none" ? "" : M),
3929
3932
  children: [
3930
3933
  /* @__PURE__ */ e.jsx(ge, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
3931
3934
  /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(ke, { children: [
3932
3935
  /* @__PURE__ */ e.jsx(ye, { children: "Currency" }),
3933
- /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }),
3934
- E.map((M) => /* @__PURE__ */ e.jsx(J, { value: M, children: M }, M))
3936
+ /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }),
3937
+ E.map((M) => /* @__PURE__ */ e.jsx(Q, { value: M, children: M }, M))
3935
3938
  ] }) })
3936
3939
  ]
3937
3940
  }
3938
3941
  ),
3939
- /* @__PURE__ */ e.jsxs(fe, { value: v, onValueChange: (M) => D(M), children: [
3942
+ /* @__PURE__ */ e.jsxs(fe, { value: N, onValueChange: (M) => T(M), children: [
3940
3943
  /* @__PURE__ */ e.jsx(
3941
3944
  ge,
3942
3945
  {
@@ -3946,7 +3949,7 @@ function et() {
3946
3949
  ),
3947
3950
  /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(ke, { children: [
3948
3951
  /* @__PURE__ */ e.jsx(ye, { children: "Locale" }),
3949
- cs.map((M) => /* @__PURE__ */ e.jsx(J, { value: M.locale, children: M.locale }, M.locale))
3952
+ cs.map((M) => /* @__PURE__ */ e.jsx(Q, { value: M.locale, children: M.locale }, M.locale))
3950
3953
  ] }) })
3951
3954
  ] })
3952
3955
  ] }),
@@ -3956,7 +3959,7 @@ function et() {
3956
3959
  re,
3957
3960
  {
3958
3961
  value: j,
3959
- onChange: (M) => F(Number(M.target.value)),
3962
+ onChange: (M) => D(Number(M.target.value)),
3960
3963
  id: "format",
3961
3964
  className: `col-span-6 h-8 w-full tracking-wide ${ns}`
3962
3965
  }
@@ -3980,8 +3983,8 @@ function et() {
3980
3983
  /* @__PURE__ */ e.jsx(
3981
3984
  re,
3982
3985
  {
3983
- value: h,
3984
- onChange: (E) => u((M) => V(M, E.target.value)),
3986
+ value: x,
3987
+ onChange: (E) => d((M) => V(M, E.target.value)),
3985
3988
  id: "max",
3986
3989
  className: `col-span-1 h-8 w-full ${ns}`
3987
3990
  }
@@ -3992,8 +3995,8 @@ function et() {
3992
3995
  /* @__PURE__ */ e.jsx(
3993
3996
  re,
3994
3997
  {
3995
- value: x,
3996
- onChange: (E) => f((M) => V(M, E.target.value)),
3998
+ value: m,
3999
+ onChange: (E) => g((M) => V(M, E.target.value)),
3997
4000
  id: "step-size",
3998
4001
  className: `col-span-1 h-8 w-full ${ns}`
3999
4002
  }
@@ -4006,9 +4009,9 @@ function et() {
4006
4009
  let E = {};
4007
4010
  y === "custom" && (E = {
4008
4011
  min: c,
4009
- max: h,
4012
+ max: x,
4010
4013
  ticks: {
4011
- stepSize: x
4014
+ stepSize: m
4012
4015
  }
4013
4016
  });
4014
4017
  const M = {
@@ -4026,17 +4029,17 @@ function et() {
4026
4029
  },
4027
4030
  numberAxisFormat: {
4028
4031
  decimalPlaces: j,
4029
- suffix: N,
4030
- currency: T,
4031
- locale: v
4032
+ suffix: C,
4033
+ currency: I,
4034
+ locale: N
4032
4035
  }
4033
4036
  };
4034
4037
  console.log(M), A(M);
4035
4038
  const se = {
4036
- ...p,
4039
+ ...v,
4037
4040
  preferences: M
4038
4041
  };
4039
- m(se);
4042
+ h(se);
4040
4043
  }
4041
4044
  return /* @__PURE__ */ e.jsxs(ps, { onOpenChange: (E) => t(E), children: [
4042
4045
  /* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(sn, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
@@ -4051,15 +4054,15 @@ function et() {
4051
4054
  /* @__PURE__ */ e.jsxs(
4052
4055
  fe,
4053
4056
  {
4054
- disabled: I,
4057
+ disabled: k,
4055
4058
  value: i,
4056
4059
  onValueChange: (E) => r(E),
4057
4060
  children: [
4058
4061
  /* @__PURE__ */ e.jsx(ge, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
4059
4062
  /* @__PURE__ */ e.jsx(be, { id: "type", children: /* @__PURE__ */ e.jsxs(ke, { children: [
4060
4063
  /* @__PURE__ */ e.jsx(ye, { children: "Option" }),
4061
- /* @__PURE__ */ e.jsx(J, { value: "linear", children: "Linear" }),
4062
- /* @__PURE__ */ e.jsx(J, { value: "logarithmic", children: "Logarithmic" })
4064
+ /* @__PURE__ */ e.jsx(Q, { value: "linear", children: "Linear" }),
4065
+ /* @__PURE__ */ e.jsx(Q, { value: "logarithmic", children: "Logarithmic" })
4063
4066
  ] }) })
4064
4067
  ]
4065
4068
  }
@@ -4070,19 +4073,19 @@ function et() {
4070
4073
  /* @__PURE__ */ e.jsxs(
4071
4074
  js,
4072
4075
  {
4073
- disabled: I,
4076
+ disabled: k,
4074
4077
  id: "scale-option",
4075
4078
  value: y,
4076
- onValueChange: (E) => g(E),
4079
+ onValueChange: (E) => f(E),
4077
4080
  className: "col-span-2 flex gap-3",
4078
4081
  defaultValue: "x",
4079
4082
  children: [
4080
4083
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4081
- /* @__PURE__ */ e.jsx(Ie, { value: "auto", id: "r1" }),
4084
+ /* @__PURE__ */ e.jsx(Te, { value: "auto", id: "r1" }),
4082
4085
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
4083
4086
  ] }),
4084
4087
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4085
- /* @__PURE__ */ e.jsx(Ie, { value: "custom", id: "r2" }),
4088
+ /* @__PURE__ */ e.jsx(Te, { value: "custom", id: "r2" }),
4086
4089
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
4087
4090
  ] })
4088
4091
  ]
@@ -4093,7 +4096,7 @@ function et() {
4093
4096
  $(),
4094
4097
  /* @__PURE__ */ e.jsx(an, {}),
4095
4098
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
4096
- O,
4099
+ F,
4097
4100
  {
4098
4101
  onClick: Y,
4099
4102
  variant: "secondary",
@@ -4107,20 +4110,20 @@ function et() {
4107
4110
  }
4108
4111
  function El({ idx: s }) {
4109
4112
  var c;
4110
- const t = d((o) => {
4111
- var h;
4112
- return (h = o.card) == null ? void 0 : h.preferences;
4113
- }), a = d(
4113
+ const t = u((o) => {
4114
+ var x;
4115
+ return (x = o.card) == null ? void 0 : x.preferences;
4116
+ }), a = u(
4114
4117
  (o) => {
4115
- var h;
4116
- return (h = o.card.preferences) == null ? void 0 : h.datasetOptions;
4118
+ var x;
4119
+ return (x = o.card.preferences) == null ? void 0 : x.datasetOptions;
4117
4120
  }
4118
- ), n = d(
4121
+ ), n = u(
4119
4122
  (o) => o.actions.setCardPreferences
4120
4123
  ), l = (c = t == null ? void 0 : t.chartOptions) == null ? void 0 : c.indexAxis, i = a == null ? void 0 : a.find((o) => o.idx === s);
4121
- function r(o, h) {
4124
+ function r(o, x) {
4122
4125
  (o === "end" || o === "start") && tn(nn());
4123
- const u = {
4126
+ const d = {
4124
4127
  display: o !== "none",
4125
4128
  align: o,
4126
4129
  anchor: o,
@@ -4132,20 +4135,20 @@ function El({ idx: s }) {
4132
4135
  datasetOptions: [
4133
4136
  ...a || [],
4134
4137
  {
4135
- idx: h,
4136
- datalabels: u
4138
+ idx: x,
4139
+ datalabels: d
4137
4140
  }
4138
4141
  ]
4139
4142
  });
4140
4143
  else {
4141
4144
  const y = { ...i };
4142
- y.datalabels = u;
4143
- const g = a == null ? void 0 : a.map(
4144
- (x) => x.idx === h ? y : x
4145
+ y.datalabels = d;
4146
+ const f = a == null ? void 0 : a.map(
4147
+ (m) => m.idx === x ? y : m
4145
4148
  );
4146
4149
  n({
4147
4150
  ...t,
4148
- datasetOptions: g
4151
+ datasetOptions: f
4149
4152
  });
4150
4153
  }
4151
4154
  }
@@ -4153,7 +4156,7 @@ function El({ idx: s }) {
4153
4156
  /* @__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" }) }),
4154
4157
  /* @__PURE__ */ e.jsx(gs, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
4155
4158
  /* @__PURE__ */ e.jsx(
4156
- O,
4159
+ F,
4157
4160
  {
4158
4161
  onClick: () => r("none", s),
4159
4162
  size: "sm",
@@ -4163,7 +4166,7 @@ function El({ idx: s }) {
4163
4166
  }
4164
4167
  ),
4165
4168
  /* @__PURE__ */ e.jsx(
4166
- O,
4169
+ F,
4167
4170
  {
4168
4171
  onClick: () => r("start", s),
4169
4172
  size: "sm",
@@ -4180,7 +4183,7 @@ function El({ idx: s }) {
4180
4183
  }
4181
4184
  ),
4182
4185
  /* @__PURE__ */ e.jsx(
4183
- O,
4186
+ F,
4184
4187
  {
4185
4188
  onClick: () => r("center", s),
4186
4189
  size: "sm",
@@ -4197,7 +4200,7 @@ function El({ idx: s }) {
4197
4200
  }
4198
4201
  ),
4199
4202
  /* @__PURE__ */ e.jsx(
4200
- O,
4203
+ F,
4201
4204
  {
4202
4205
  onClick: () => r("end", s),
4203
4206
  size: "sm",
@@ -4217,10 +4220,10 @@ function El({ idx: s }) {
4217
4220
  ] });
4218
4221
  }
4219
4222
  function st() {
4220
- const s = d((h) => h.card), t = d(
4221
- (h) => {
4222
- var u, y, g;
4223
- return (g = (y = (u = h == null ? void 0 : h.card) == null ? void 0 : u.preferences) == null ? void 0 : y.chartOptions) == null ? void 0 : g.indexAxis;
4223
+ const s = u((x) => x.card), t = u(
4224
+ (x) => {
4225
+ var d, y, f;
4226
+ return (f = (y = (d = x == null ? void 0 : x.card) == null ? void 0 : d.preferences) == null ? void 0 : y.chartOptions) == null ? void 0 : f.indexAxis;
4224
4227
  }
4225
4228
  ), { data: a } = qe(s), n = t === "y" ? "Y axis" : "X axis", l = t === "y" ? "X axis" : "Y axis", {
4226
4229
  keys: i,
@@ -4229,13 +4232,13 @@ function st() {
4229
4232
  } = Ss((a == null ? void 0 : a.records) || []);
4230
4233
  let o = r;
4231
4234
  if (["stackedBar", "stackedLine"].includes(s.type)) {
4232
- const h = ln({
4235
+ const x = ln({
4233
4236
  dataArray: (a == null ? void 0 : a.records) || [],
4234
4237
  groupKey: c[0],
4235
4238
  pivotKey: c[1],
4236
4239
  valueKey: o[0]
4237
- }), { metricKeys: u } = Ss(h);
4238
- o = u;
4240
+ }), { metricKeys: d } = Ss(x);
4241
+ o = d;
4239
4242
  }
4240
4243
  return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4241
4244
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
@@ -4247,20 +4250,20 @@ function st() {
4247
4250
  /* @__PURE__ */ e.jsx(H, { children: l }),
4248
4251
  /* @__PURE__ */ e.jsx(et, {})
4249
4252
  ] }),
4250
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: o.map((h, u) => /* @__PURE__ */ e.jsx(Al, { col: h, idx: u }, h)) })
4253
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: o.map((x, d) => /* @__PURE__ */ e.jsx(Al, { col: x, idx: d }, x)) })
4251
4254
  ] })
4252
4255
  ] });
4253
4256
  }
4254
4257
  function Al({ col: s, idx: t }) {
4255
- const a = d((c) => {
4258
+ const a = u((c) => {
4256
4259
  var o;
4257
4260
  return (o = c.card) == null ? void 0 : o.preferences;
4258
- }), n = d(
4261
+ }), n = u(
4259
4262
  (c) => {
4260
4263
  var o;
4261
4264
  return (o = c.card.preferences) == null ? void 0 : o.datasetOptions;
4262
4265
  }
4263
- ), l = n == null ? void 0 : n.find((c) => c.idx === t), { setCardPreferences: i } = d((c) => c.actions);
4266
+ ), l = n == null ? void 0 : n.find((c) => c.idx === t), { setCardPreferences: i } = u((c) => c.actions);
4264
4267
  function r(c) {
4265
4268
  if (!l)
4266
4269
  i({
@@ -4277,12 +4280,12 @@ function Al({ col: s, idx: t }) {
4277
4280
  else {
4278
4281
  const o = { ...l };
4279
4282
  o.type = c === "area" ? "line" : c, o.fill = c === "area" ? "origin" : "";
4280
- const h = n == null ? void 0 : n.map(
4281
- (u) => u.idx === t ? o : u
4283
+ const x = n == null ? void 0 : n.map(
4284
+ (d) => d.idx === t ? o : d
4282
4285
  );
4283
4286
  i({
4284
4287
  ...a,
4285
- datasetOptions: h
4288
+ datasetOptions: x
4286
4289
  });
4287
4290
  }
4288
4291
  }
@@ -4322,61 +4325,61 @@ function Al({ col: s, idx: t }) {
4322
4325
  ] });
4323
4326
  }
4324
4327
  function at() {
4325
- const s = d((g) => g.selectedConnectionId), t = d((g) => g.selectedDatamodelId), a = d((g) => g.selectedDatabaseName), n = d((g) => g.selectedSchemaName), l = d((g) => g.selectedTableName), i = k((g) => g.dashboard.filters) || [], r = k((g) => g.actions.addFilter), c = k((g) => g.actions.removeFilter), o = k(
4326
- (g) => g.actions.removeFilterValue
4327
- ), { modelItems: h, tableName: u } = Re();
4328
- function y(g, x = "dashboard") {
4329
- var D;
4330
- const f = xe(g.column_name), j = xe(a || ""), F = xe(n || ""), N = xe(u);
4328
+ const s = u((f) => f.selectedConnectionId), t = u((f) => f.selectedDatamodelId), a = u((f) => f.selectedDatabaseName), n = u((f) => f.selectedSchemaName), l = u((f) => f.selectedTableName), i = z((f) => f.dashboard.filters) || [], r = z((f) => f.actions.addFilter), c = z((f) => f.actions.removeFilter), o = z(
4329
+ (f) => f.actions.removeFilterValue
4330
+ ), { modelItems: x, tableName: d } = Re();
4331
+ function y(f, m = "dashboard") {
4332
+ var T;
4333
+ const g = xe(f.column_name), j = xe(a || ""), D = xe(n || ""), C = xe(d);
4331
4334
  let L = ja(
4332
- F,
4333
- N
4334
- ), T = `${L}.${f}`;
4335
- const z = (D = h == null ? void 0 : h.find(
4335
+ D,
4336
+ C
4337
+ ), I = `${L}.${g}`;
4338
+ const O = (T = x == null ? void 0 : x.find(
4336
4339
  (A) => A.id === t
4337
- )) == null ? void 0 : D.name;
4338
- t && t !== "none" && (T = `${Ns}.${z}.${f}`, L = `${Ns}.${z}`);
4339
- const v = i == null ? void 0 : i.find(
4340
- (A) => A.column === T && A.table === N && (A.database === j || A.database === a)
4340
+ )) == null ? void 0 : T.name;
4341
+ t && t !== "none" && (I = `${Ns}.${O}.${g}`, L = `${Ns}.${O}`);
4342
+ const N = i == null ? void 0 : i.find(
4343
+ (A) => A.column === I && A.table === C && (A.database === j || A.database === a)
4341
4344
  );
4342
- if (v)
4343
- o(v.id), c(v.id);
4345
+ if (N)
4346
+ o(N.id), c(N.id);
4344
4347
  else {
4345
4348
  const A = We();
4346
- return u === "api" && s ? (r({
4347
- location: x,
4349
+ return d === "api" && s ? (r({
4350
+ location: m,
4348
4351
  id: A,
4349
4352
  //uuidv4(),
4350
- column: T,
4351
- title: g.column_name,
4352
- dataType: g.data_type,
4353
+ column: I,
4354
+ title: f.column_name,
4355
+ dataType: f.data_type,
4353
4356
  table: "api",
4354
4357
  database: "",
4355
4358
  // database: 'NA',
4356
4359
  connectionId: s,
4357
4360
  operation: "in",
4358
4361
  sql: aa(
4359
- g.data_type,
4362
+ f.data_type,
4360
4363
  L,
4361
- f
4364
+ g
4362
4365
  )
4363
4366
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4364
4367
  }), A) : (r({
4365
4368
  id: A,
4366
4369
  //uuidv4(),
4367
- location: x,
4368
- column: T,
4370
+ location: m,
4371
+ column: I,
4369
4372
  //columnName, //`${qualifiedTableName}.${formattedColumnName}`,
4370
- title: g.column_name,
4371
- dataType: g.data_type,
4373
+ title: f.column_name,
4374
+ dataType: f.data_type,
4372
4375
  table: l || "",
4373
4376
  database: a || "",
4374
4377
  connectionId: s || "",
4375
4378
  operation: "in",
4376
4379
  sql: aa(
4377
- g.data_type,
4380
+ f.data_type,
4378
4381
  L,
4379
- f
4382
+ g
4380
4383
  )
4381
4384
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4382
4385
  }), A);
@@ -4385,9 +4388,9 @@ function at() {
4385
4388
  return { assignFilter: y };
4386
4389
  }
4387
4390
  function _e() {
4388
- const s = k(
4391
+ const s = z(
4389
4392
  (c) => c.dashboard.filters
4390
- ), t = d((c) => c.frame), { setFrame: a } = ce(), { columns: n } = Re(), { assignFilter: l } = at();
4393
+ ), t = u((c) => c.frame), { setFrame: a } = ce(), { columns: n } = Re(), { assignFilter: l } = at();
4391
4394
  function i(c) {
4392
4395
  const o = l(c, "frame");
4393
4396
  a({ ...t, filterId: o });
@@ -4407,7 +4410,7 @@ function Vl({
4407
4410
  const [a, n] = ta.useState(!1), [l, i] = ta.useState("");
4408
4411
  return /* @__PURE__ */ e.jsxs(ps, { open: a, onOpenChange: n, children: [
4409
4412
  /* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
4410
- O,
4413
+ F,
4411
4414
  {
4412
4415
  size: "sm",
4413
4416
  variant: "outline",
@@ -4429,8 +4432,8 @@ function Vl({
4429
4432
  {
4430
4433
  value: c.column_name,
4431
4434
  onSelect: (o) => {
4432
- const h = o === l ? "" : o;
4433
- i(h), n(!1), h && t(c);
4435
+ const x = o === l ? "" : o;
4436
+ i(x), n(!1), x && t(c);
4434
4437
  },
4435
4438
  children: [
4436
4439
  c.column_name,
@@ -4498,11 +4501,11 @@ function ql({
4498
4501
  }
4499
4502
  function Js() {
4500
4503
  var l, i, r;
4501
- const s = d(
4504
+ const s = u(
4502
4505
  (c) => c.card.cfg
4503
- ), t = d((c) => c.actions.setCardCfg), a = d((c) => c.card.type);
4506
+ ), t = u((c) => c.actions.setCardCfg), a = u((c) => c.card.type);
4504
4507
  function n(c) {
4505
- var u;
4508
+ var d;
4506
4509
  const o = {
4507
4510
  datalabels: {
4508
4511
  display: c !== "none",
@@ -4510,17 +4513,17 @@ function Js() {
4510
4513
  anchor: c,
4511
4514
  clamp: !0
4512
4515
  }
4513
- }, h = {
4516
+ }, x = {
4514
4517
  ...s,
4515
4518
  options: {
4516
4519
  ...s == null ? void 0 : s.options,
4517
4520
  plugins: {
4518
- ...(u = s == null ? void 0 : s.options) == null ? void 0 : u.plugins,
4521
+ ...(d = s == null ? void 0 : s.options) == null ? void 0 : d.plugins,
4519
4522
  ...o
4520
4523
  }
4521
4524
  }
4522
4525
  };
4523
- t(h), console.log(c);
4526
+ t(x), console.log(c);
4524
4527
  }
4525
4528
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4526
4529
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
@@ -4537,10 +4540,10 @@ function Js() {
4537
4540
  /* @__PURE__ */ e.jsx(ge, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, { placeholder: "Select position" }) }),
4538
4541
  /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(ke, { children: [
4539
4542
  /* @__PURE__ */ e.jsx(ye, { children: "Data Labels" }),
4540
- /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }),
4541
- a !== "pyramid" && /* @__PURE__ */ e.jsx(J, { value: "start", children: "Start" }),
4542
- /* @__PURE__ */ e.jsx(J, { value: "center", children: "Center" }),
4543
- a !== "pyramid" && /* @__PURE__ */ e.jsx(J, { value: "end", children: "End" })
4543
+ /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }),
4544
+ a !== "pyramid" && /* @__PURE__ */ e.jsx(Q, { value: "start", children: "Start" }),
4545
+ /* @__PURE__ */ e.jsx(Q, { value: "center", children: "Center" }),
4546
+ a !== "pyramid" && /* @__PURE__ */ e.jsx(Q, { value: "end", children: "End" })
4544
4547
  ] }) })
4545
4548
  ]
4546
4549
  }
@@ -4619,7 +4622,7 @@ const _l = {
4619
4622
  ]
4620
4623
  };
4621
4624
  function $l() {
4622
- const s = d((t) => t.card.type);
4625
+ const s = u((t) => t.card.type);
4623
4626
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
4624
4627
  /* @__PURE__ */ e.jsx(
4625
4628
  De,
@@ -4736,52 +4739,52 @@ function Pl(s) {
4736
4739
  ] }) });
4737
4740
  }
4738
4741
  function Bl() {
4739
- var o, h, u, y, g;
4740
- const s = d((x) => x.card.preferences), t = d(
4741
- (x) => x.actions.setCardPreferences
4742
- ), a = d(
4743
- (x) => x.actions.setNumberFormat
4742
+ var o, x, d, y, f;
4743
+ const s = u((m) => m.card.preferences), t = u(
4744
+ (m) => m.actions.setCardPreferences
4745
+ ), a = u(
4746
+ (m) => m.actions.setNumberFormat
4744
4747
  );
4745
- d(
4746
- (x) => {
4747
- var f, j;
4748
- return (j = (f = x.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : j.decimalPlaces;
4748
+ u(
4749
+ (m) => {
4750
+ var g, j;
4751
+ return (j = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : j.decimalPlaces;
4749
4752
  }
4750
4753
  );
4751
- const n = d(
4752
- (x) => {
4753
- var f, j;
4754
- return (j = (f = x.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : j.locale;
4754
+ const n = u(
4755
+ (m) => {
4756
+ var g, j;
4757
+ return (j = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : j.locale;
4755
4758
  }
4756
- ), l = d(
4757
- (x) => {
4758
- var f, j;
4759
- return (j = (f = x.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : j.currency;
4759
+ ), l = u(
4760
+ (m) => {
4761
+ var g, j;
4762
+ return (j = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : j.currency;
4760
4763
  }
4761
4764
  );
4762
- d(
4763
- (x) => x.actions.setFilterOnClickField
4765
+ u(
4766
+ (m) => m.actions.setFilterOnClickField
4764
4767
  );
4765
- const i = d(
4766
- (x) => {
4767
- var f, j;
4768
- return (j = (f = x.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : j.colorRanges;
4768
+ const i = u(
4769
+ (m) => {
4770
+ var g, j;
4771
+ return (j = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : j.colorRanges;
4769
4772
  }
4770
- ) || [], r = d(
4771
- (x) => x.actions.setColorRanges
4772
- ), c = [...new Set(cs.map((x) => x.currency))];
4773
+ ) || [], r = u(
4774
+ (m) => m.actions.setColorRanges
4775
+ ), c = [...new Set(cs.map((m) => m.currency))];
4773
4776
  return /* @__PURE__ */ e.jsxs("div", { children: [
4774
4777
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
4775
4778
  /* @__PURE__ */ e.jsx(
4776
4779
  ms,
4777
4780
  {
4778
4781
  checked: !!((o = s == null ? void 0 : s.formatNumber) != null && o.enabled),
4779
- onCheckedChange: (x) => {
4782
+ onCheckedChange: (m) => {
4780
4783
  t({
4781
4784
  ...s,
4782
4785
  formatNumber: {
4783
4786
  ...s == null ? void 0 : s.formatNumber,
4784
- enabled: x
4787
+ enabled: m
4785
4788
  }
4786
4789
  });
4787
4790
  }
@@ -4789,7 +4792,7 @@ function Bl() {
4789
4792
  ),
4790
4793
  /* @__PURE__ */ e.jsx(H, { children: "Format Number" })
4791
4794
  ] }),
4792
- ((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
4795
+ ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
4793
4796
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
4794
4797
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
4795
4798
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
@@ -4797,21 +4800,22 @@ function Bl() {
4797
4800
  /* @__PURE__ */ e.jsxs(
4798
4801
  fe,
4799
4802
  {
4800
- value: n || "en-US",
4801
- onValueChange: (x) => {
4802
- var f, j, F;
4803
+ value: n || "none",
4804
+ onValueChange: (m) => {
4805
+ var g, j, D;
4803
4806
  return a(
4804
- ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.decimalPlaces) || 0,
4807
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
4805
4808
  ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.currency) || "",
4806
- x || "en-US",
4807
- ((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.suffix) || ""
4809
+ m,
4810
+ ((D = s == null ? void 0 : s.formatNumber) == null ? void 0 : D.suffix) || ""
4808
4811
  );
4809
4812
  },
4810
4813
  children: [
4811
4814
  /* @__PURE__ */ e.jsx(ge, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
4812
4815
  /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(ke, { children: [
4813
4816
  /* @__PURE__ */ e.jsx(ye, { children: "Format" }),
4814
- cs.map((x) => /* @__PURE__ */ e.jsx(J, { value: x.locale, children: x.locale }, x.locale))
4817
+ /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
4818
+ cs.map((m) => /* @__PURE__ */ e.jsx(Q, { value: m.locale, children: m.locale }, m.locale))
4815
4819
  ] }) })
4816
4820
  ]
4817
4821
  }
@@ -4823,21 +4827,21 @@ function Bl() {
4823
4827
  fe,
4824
4828
  {
4825
4829
  value: l || "none",
4826
- onValueChange: (x) => {
4827
- var f, j, F;
4828
- return a(
4829
- ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.decimalPlaces) || 0,
4830
- x === "none" ? "" : x,
4830
+ onValueChange: (m) => {
4831
+ var g, j, D;
4832
+ console.log("currency", m), a(
4833
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
4834
+ m === "none" ? "" : m,
4831
4835
  ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.locale) || "",
4832
- ((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.suffix) || ""
4836
+ ((D = s == null ? void 0 : s.formatNumber) == null ? void 0 : D.suffix) || ""
4833
4837
  );
4834
4838
  },
4835
4839
  children: [
4836
4840
  /* @__PURE__ */ e.jsx(ge, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
4837
4841
  /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(ke, { children: [
4838
4842
  /* @__PURE__ */ e.jsx(ye, { children: "Currency" }),
4839
- /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }, "none"),
4840
- c.map((x) => /* @__PURE__ */ e.jsx(J, { value: x, children: x }, x))
4843
+ /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
4844
+ c.map((m) => /* @__PURE__ */ e.jsx(Q, { value: m, children: m }, m))
4841
4845
  ] }) })
4842
4846
  ]
4843
4847
  }
@@ -4850,19 +4854,19 @@ function Bl() {
4850
4854
  /* @__PURE__ */ e.jsxs(
4851
4855
  fe,
4852
4856
  {
4853
- value: ((y = (u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) == null ? void 0 : y.toString()) || "0",
4854
- onValueChange: (x) => {
4855
- var f, j, F;
4857
+ value: ((y = (d = s == null ? void 0 : s.formatNumber) == null ? void 0 : d.decimalPlaces) == null ? void 0 : y.toString()) || "0",
4858
+ onValueChange: (m) => {
4859
+ var g, j, D;
4856
4860
  return a(
4857
- Number(x),
4858
- ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.currency) || "",
4861
+ Number(m),
4862
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.currency) || "",
4859
4863
  ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.locale) || "",
4860
- ((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.suffix) || ""
4864
+ ((D = s == null ? void 0 : s.formatNumber) == null ? void 0 : D.suffix) || ""
4861
4865
  );
4862
4866
  },
4863
4867
  children: [
4864
4868
  /* @__PURE__ */ e.jsx(ge, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
4865
- /* @__PURE__ */ e.jsx(be, { children: ["0", "1", "2", "3", "4"].map((x) => /* @__PURE__ */ e.jsx(J, { value: x, children: x }, x)) })
4869
+ /* @__PURE__ */ e.jsx(be, { children: ["0", "1", "2", "3", "4"].map((m) => /* @__PURE__ */ e.jsx(Q, { value: m, children: m }, m)) })
4866
4870
  ]
4867
4871
  }
4868
4872
  )
@@ -4872,16 +4876,16 @@ function Bl() {
4872
4876
  /* @__PURE__ */ e.jsx(
4873
4877
  re,
4874
4878
  {
4875
- value: ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.suffix) || "",
4879
+ value: ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.suffix) || "",
4876
4880
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
4877
4881
  placeholder: "K, M, B, %",
4878
- onChange: (x) => {
4879
- var f, j, F;
4882
+ onChange: (m) => {
4883
+ var g, j, D;
4880
4884
  return a(
4881
- ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.decimalPlaces) || 0,
4885
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
4882
4886
  ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.currency) || "",
4883
- ((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.locale) || "",
4884
- x.target.value
4887
+ ((D = s == null ? void 0 : s.formatNumber) == null ? void 0 : D.locale) || "",
4888
+ m.target.value
4885
4889
  );
4886
4890
  }
4887
4891
  }
@@ -5032,12 +5036,12 @@ const Gl = [
5032
5036
  value: s
5033
5037
  }));
5034
5038
  function Jl() {
5035
- var o, h, u, y, g, x, f, j, F, N, L, T, z, v, D, A, m, p;
5036
- const s = d((C) => C.card), t = (h = (o = s == null ? void 0 : s.preferences) == null ? void 0 : o.mapVisualOptions) == null ? void 0 : h.topoJsonUrl, [a, n] = R(
5037
- ((y = (u = s == null ? void 0 : s.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : y.customTopoJsonUrl) || ""
5038
- ), { setCardPreferences: l } = ce(), { data: i } = Bs(s), r = Object.keys((i == null ? void 0 : i.objects) || {}).map((C) => ({
5039
- label: C,
5040
- value: C
5039
+ var o, x, d, y, f, m, g, j, D, C, L, I, O, N, T, A, h, v;
5040
+ const s = u((p) => p.card), t = (x = (o = s == null ? void 0 : s.preferences) == null ? void 0 : o.mapVisualOptions) == null ? void 0 : x.topoJsonUrl, [a, n] = R(
5041
+ ((y = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : y.customTopoJsonUrl) || ""
5042
+ ), { setCardPreferences: l } = ce(), { data: i } = Bs(s), r = Object.keys((i == null ? void 0 : i.objects) || {}).map((p) => ({
5043
+ label: p,
5044
+ value: p
5041
5045
  })) || [], c = [
5042
5046
  {
5043
5047
  label: "US States 10m",
@@ -5061,11 +5065,11 @@ function Jl() {
5061
5065
  {
5062
5066
  className: "h-9",
5063
5067
  options: c,
5064
- onValueChange: (C) => {
5065
- console.log("value", C), l({
5068
+ onValueChange: (p) => {
5069
+ console.log("value", p), l({
5066
5070
  ...s.preferences,
5067
5071
  mapVisualOptions: {
5068
- topoJsonUrl: C
5072
+ topoJsonUrl: p
5069
5073
  // customTopoJson: undefined,
5070
5074
  }
5071
5075
  });
@@ -5077,15 +5081,15 @@ function Jl() {
5077
5081
  t === "custom" && /* @__PURE__ */ e.jsx(
5078
5082
  re,
5079
5083
  {
5080
- onChange: (C) => {
5081
- n(C.target.value);
5084
+ onChange: (p) => {
5085
+ n(p.target.value);
5082
5086
  },
5083
5087
  onBlur: () => {
5084
- var C;
5088
+ var p;
5085
5089
  console.log("onBlur", a), l({
5086
5090
  ...s.preferences,
5087
5091
  mapVisualOptions: {
5088
- ...(C = s.preferences) == null ? void 0 : C.mapVisualOptions,
5092
+ ...(p = s.preferences) == null ? void 0 : p.mapVisualOptions,
5089
5093
  customTopoJsonUrl: a
5090
5094
  }
5091
5095
  });
@@ -5103,15 +5107,15 @@ function Jl() {
5103
5107
  {
5104
5108
  className: "h-9",
5105
5109
  options: r,
5106
- value: ((x = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : x.objectKey) || "",
5110
+ value: ((m = (f = s.preferences) == null ? void 0 : f.mapVisualOptions) == null ? void 0 : m.objectKey) || "",
5107
5111
  label: "Map Object",
5108
- onValueChange: (C) => {
5109
- var I;
5112
+ onValueChange: (p) => {
5113
+ var k;
5110
5114
  l({
5111
5115
  ...s.preferences,
5112
5116
  mapVisualOptions: {
5113
- ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5114
- objectKey: C
5117
+ ...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
5118
+ objectKey: p
5115
5119
  }
5116
5120
  });
5117
5121
  }
@@ -5125,15 +5129,15 @@ function Jl() {
5125
5129
  {
5126
5130
  className: "h-9",
5127
5131
  options: Gl,
5128
- value: ((j = (f = s.preferences) == null ? void 0 : f.mapVisualOptions) == null ? void 0 : j.projection) || "",
5132
+ value: ((j = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : j.projection) || "",
5129
5133
  label: "Projection",
5130
- onValueChange: (C) => {
5131
- var I;
5134
+ onValueChange: (p) => {
5135
+ var k;
5132
5136
  l({
5133
5137
  ...s.preferences,
5134
5138
  mapVisualOptions: {
5135
- ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5136
- projection: C
5139
+ ...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
5140
+ projection: p
5137
5141
  }
5138
5142
  });
5139
5143
  }
@@ -5147,15 +5151,15 @@ function Jl() {
5147
5151
  {
5148
5152
  className: "h-9",
5149
5153
  options: Ql,
5150
- value: ((N = (F = s.preferences) == null ? void 0 : F.mapVisualOptions) == null ? void 0 : N.colorScale) || "",
5154
+ value: ((C = (D = s.preferences) == null ? void 0 : D.mapVisualOptions) == null ? void 0 : C.colorScale) || "",
5151
5155
  label: "Select Color Scale",
5152
- onValueChange: (C) => {
5153
- var I;
5156
+ onValueChange: (p) => {
5157
+ var k;
5154
5158
  l({
5155
5159
  ...s.preferences,
5156
5160
  mapVisualOptions: {
5157
- ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5158
- colorScale: C
5161
+ ...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
5162
+ colorScale: p
5159
5163
  }
5160
5164
  });
5161
5165
  }
@@ -5172,14 +5176,14 @@ function Jl() {
5172
5176
  className: `h-9 w-full ${Ge}`,
5173
5177
  type: "number",
5174
5178
  step: 0.1,
5175
- value: ((T = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : T.projectionScale) || 1,
5176
- onChange: (C) => {
5177
- var I;
5179
+ value: ((I = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
5180
+ onChange: (p) => {
5181
+ var k;
5178
5182
  l({
5179
5183
  ...s.preferences,
5180
5184
  mapVisualOptions: {
5181
- ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5182
- projectionScale: Number(C.target.value)
5185
+ ...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
5186
+ projectionScale: Number(p.target.value)
5183
5187
  }
5184
5188
  });
5185
5189
  }
@@ -5192,15 +5196,15 @@ function Jl() {
5192
5196
  className: `h-9 w-full ${Ge}`,
5193
5197
  type: "number",
5194
5198
  step: 10,
5195
- value: ((D = (v = (z = s.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : v.projectionOffset) == null ? void 0 : D[0]) || 0,
5196
- onChange: (C) => {
5197
- var I, V, $, B;
5199
+ value: ((T = (N = (O = s.preferences) == null ? void 0 : O.mapVisualOptions) == null ? void 0 : N.projectionOffset) == null ? void 0 : T[0]) || 0,
5200
+ onChange: (p) => {
5201
+ var k, V, $, B;
5198
5202
  l({
5199
5203
  ...s.preferences,
5200
5204
  mapVisualOptions: {
5201
- ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5205
+ ...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
5202
5206
  projectionOffset: [
5203
- Number(C.target.value),
5207
+ Number(p.target.value),
5204
5208
  ((B = ($ = (V = s.preferences) == null ? void 0 : V.mapVisualOptions) == null ? void 0 : $.projectionOffset) == null ? void 0 : B[1]) || 0
5205
5209
  ]
5206
5210
  }
@@ -5215,16 +5219,16 @@ function Jl() {
5215
5219
  className: `h-9 w-full ${Ge}`,
5216
5220
  type: "number",
5217
5221
  step: 10,
5218
- value: ((p = (m = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : m.projectionOffset) == null ? void 0 : p[1]) || 0,
5219
- onChange: (C) => {
5220
- var I, V, $, B;
5222
+ value: ((v = (h = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : h.projectionOffset) == null ? void 0 : v[1]) || 0,
5223
+ onChange: (p) => {
5224
+ var k, V, $, B;
5221
5225
  l({
5222
5226
  ...s.preferences,
5223
5227
  mapVisualOptions: {
5224
- ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5228
+ ...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
5225
5229
  projectionOffset: [
5226
5230
  ((B = ($ = (V = s.preferences) == null ? void 0 : V.mapVisualOptions) == null ? void 0 : $.projectionOffset) == null ? void 0 : B[0]) || 0,
5227
- Number(C.target.value)
5231
+ Number(p.target.value)
5228
5232
  ]
5229
5233
  }
5230
5234
  });
@@ -5238,7 +5242,7 @@ function Jl() {
5238
5242
  }
5239
5243
  function Wl() {
5240
5244
  var n;
5241
- const s = d((l) => l.card.preferences), { setCardPreferences: t } = d((l) => l.actions);
5245
+ const s = u((l) => l.card.preferences), { setCardPreferences: t } = u((l) => l.actions);
5242
5246
  function a(l) {
5243
5247
  t({
5244
5248
  ...s,
@@ -5257,11 +5261,11 @@ function Wl() {
5257
5261
  defaultValue: "x",
5258
5262
  children: [
5259
5263
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5260
- /* @__PURE__ */ e.jsx(Ie, { value: "static", id: "r1" }),
5264
+ /* @__PURE__ */ e.jsx(Te, { value: "static", id: "r1" }),
5261
5265
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
5262
5266
  ] }),
5263
5267
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5264
- /* @__PURE__ */ e.jsx(Ie, { value: "dynamic", id: "r2" }),
5268
+ /* @__PURE__ */ e.jsx(Te, { value: "dynamic", id: "r2" }),
5265
5269
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
5266
5270
  ] })
5267
5271
  ]
@@ -5316,7 +5320,7 @@ function ls({
5316
5320
  ] }) });
5317
5321
  }
5318
5322
  function Yl() {
5319
- const s = d(
5323
+ const s = u(
5320
5324
  (n) => {
5321
5325
  var l, i;
5322
5326
  return (i = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : i.sortChart;
@@ -5396,10 +5400,10 @@ function Yl() {
5396
5400
  ] }) });
5397
5401
  }
5398
5402
  function Xl({}) {
5399
- const s = d((n) => {
5403
+ const s = u((n) => {
5400
5404
  var l;
5401
5405
  return (l = n.card) == null ? void 0 : l.preferences;
5402
- }), t = d(
5406
+ }), t = u(
5403
5407
  (n) => n.actions.setCardPreferences
5404
5408
  ), a = (n) => {
5405
5409
  t({
@@ -5478,7 +5482,7 @@ const Zl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5478
5482
  ] })
5479
5483
  ] });
5480
5484
  function ar() {
5481
- const s = d((a) => a.card.type);
5485
+ const s = u((a) => a.card.type);
5482
5486
  function t(a) {
5483
5487
  switch (a) {
5484
5488
  case "stackedBar":
@@ -5523,7 +5527,7 @@ function ar() {
5523
5527
  return /* @__PURE__ */ e.jsx(Ps, { className: "h-full w-full text-sm", children: t(s) });
5524
5528
  }
5525
5529
  function tr() {
5526
- const s = d((t) => t.isShowingVisual);
5530
+ const s = u((t) => t.isShowingVisual);
5527
5531
  return /* @__PURE__ */ e.jsxs(
5528
5532
  ws,
5529
5533
  {
@@ -5569,8 +5573,8 @@ function tr() {
5569
5573
  );
5570
5574
  }
5571
5575
  function nr({ authToken: s, onSave: t, onClose: a }) {
5572
- k((r) => r.themeStyle);
5573
- const n = d((r) => r.actions.setOnSave), l = d((r) => r.actions.setOnClose), i = k((r) => r.actions.setAuthToken);
5576
+ z((r) => r.themeStyle);
5577
+ const n = u((r) => r.actions.setOnSave), l = u((r) => r.actions.setOnClose), i = z((r) => r.actions.setAuthToken);
5574
5578
  return Z(() => {
5575
5579
  t && n(t), a && l(a);
5576
5580
  }, [t, n, a, l]), Z(() => {
@@ -5592,8 +5596,8 @@ function nr({ authToken: s, onSave: t, onClose: a }) {
5592
5596
  ) });
5593
5597
  }
5594
5598
  function lr() {
5595
- k((r) => r.selectedCardId);
5596
- const s = k((r) => r.selectedSheetId), { setIsVisualEditing: t } = k((r) => r.actions), a = k((r) => r.isVisualEditing), n = k((r) => r.actions.updateFrame);
5599
+ z((r) => r.selectedCardId);
5600
+ const s = z((r) => r.selectedSheetId), { setIsVisualEditing: t } = z((r) => r.actions), a = z((r) => r.isVisualEditing), n = z((r) => r.actions.updateFrame);
5597
5601
  function l(r) {
5598
5602
  s && (n(s, r), t(!1));
5599
5603
  }
@@ -5612,11 +5616,11 @@ function lr() {
5612
5616
  );
5613
5617
  }
5614
5618
  function rr() {
5615
- d((r) => r.selectedConnectionId), d((r) => r.selectedDatamodelId);
5616
- const s = d((r) => r.selectedDatabaseName);
5617
- d((r) => r.selectedSchemaName);
5618
- const t = d((r) => r.selectedTableName), a = k((r) => r.dashboard.filters) || [];
5619
- k((r) => r.actions.addFilter), k((r) => r.actions.removeFilter), k(
5619
+ u((r) => r.selectedConnectionId), u((r) => r.selectedDatamodelId);
5620
+ const s = u((r) => r.selectedDatabaseName);
5621
+ u((r) => r.selectedSchemaName);
5622
+ const t = u((r) => r.selectedTableName), a = z((r) => r.dashboard.filters) || [];
5623
+ z((r) => r.actions.addFilter), z((r) => r.actions.removeFilter), z(
5620
5624
  (r) => r.actions.removeFilterValue
5621
5625
  );
5622
5626
  const { modelItems: n, columns: l } = Re(), { assignFilter: i } = at();
@@ -5644,15 +5648,15 @@ function rr() {
5644
5648
  }) });
5645
5649
  }
5646
5650
  function ir() {
5647
- k((t) => t.showFilters);
5648
- const s = k(
5651
+ z((t) => t.showFilters);
5652
+ const s = z(
5649
5653
  (t) => t.actions.setShowFilters
5650
5654
  );
5651
5655
  return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
5652
5656
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
5653
5657
  /* @__PURE__ */ e.jsx(H, { className: "text-lg", children: "Filters" }),
5654
5658
  /* @__PURE__ */ e.jsx(
5655
- O,
5659
+ F,
5656
5660
  {
5657
5661
  onClick: () => s(!1),
5658
5662
  className: "h-7 w-7 p-0",
@@ -5676,7 +5680,7 @@ function ir() {
5676
5680
  ] });
5677
5681
  }
5678
5682
  function or() {
5679
- const s = k((a) => a.showFilters), t = k((a) => a.isVisualEditing);
5683
+ const s = z((a) => a.showFilters), t = z((a) => a.isVisualEditing);
5680
5684
  return /* @__PURE__ */ e.jsxs(
5681
5685
  "div",
5682
5686
  {
@@ -5693,10 +5697,10 @@ function or() {
5693
5697
  );
5694
5698
  }
5695
5699
  function cr() {
5696
- const s = k((n) => n.dashboard), t = k((n) => n.actions.setDashboard), a = k(
5700
+ const s = z((n) => n.dashboard), t = z((n) => n.actions.setDashboard), a = z(
5697
5701
  (n) => n.showDashboardJSON
5698
5702
  );
5699
- return k(
5703
+ return z(
5700
5704
  (n) => n.actions.setShowDashboardJSON
5701
5705
  ), /* @__PURE__ */ e.jsx(
5702
5706
  "div",
@@ -5773,13 +5777,13 @@ export {
5773
5777
  Yn as U,
5774
5778
  Gs as a,
5775
5779
  Ks as b,
5776
- Ta as c,
5777
- Ia as d,
5780
+ Ia as c,
5781
+ Ta as d,
5778
5782
  Da as e,
5779
5783
  On as f,
5780
5784
  Fn as g,
5781
- Tn as h,
5782
- In as i,
5785
+ In as h,
5786
+ Tn as i,
5783
5787
  Mn as j,
5784
5788
  Dn as k,
5785
5789
  An as l,