react-semaphor 0.0.522 → 0.0.523

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.
@@ -1055,7 +1055,7 @@ async function ho(t, a) {
1055
1055
  }) : null;
1056
1056
  }
1057
1057
  function po() {
1058
- const [t, a] = B(""), [n, r] = B(!1), i = G((f) => f.lenses), { setLenses: l, setSelectedLensId: c } = Dt(), [d, o] = B(!1), [h, u] = B(!1), m = G((f) => f.dashboard), x = G((f) => f.filterValues), { authToken: N } = rt();
1058
+ const [t, a] = B(""), [n, r] = B(!1), i = G((f) => f.lenses), { setLenses: l, setSelectedLensId: c } = Dt(), [d, o] = B(!1), [h, u] = B(!1), m = G((f) => f.dashboard), v = G((f) => f.filterValues), { authToken: N } = rt();
1059
1059
  async function w() {
1060
1060
  o(!0);
1061
1061
  const f = Ks(
@@ -1063,7 +1063,7 @@ function po() {
1063
1063
  ), I = await mo(
1064
1064
  t,
1065
1065
  f,
1066
- x,
1066
+ v,
1067
1067
  N == null ? void 0 : N.accessToken
1068
1068
  );
1069
1069
  I && (l([...i || [], I]), c(I.id), u(!1)), o(!1);
@@ -1122,8 +1122,8 @@ function fo() {
1122
1122
  }
1123
1123
  async function o(u) {
1124
1124
  if (await ho(u, c == null ? void 0 : c.accessToken)) {
1125
- const x = n == null ? void 0 : n.filter((N) => N.id !== u);
1126
- i(x || []), l("original");
1125
+ const v = n == null ? void 0 : n.filter((N) => N.id !== u);
1126
+ i(v || []), l("original");
1127
1127
  }
1128
1128
  }
1129
1129
  async function h(u) {
@@ -1135,11 +1135,11 @@ function fo() {
1135
1135
  isDefault: !1
1136
1136
  });
1137
1137
  i(m || []);
1138
- const x = {
1138
+ const v = {
1139
1139
  ...u,
1140
1140
  isDefault: !u.isDefault
1141
1141
  };
1142
- await Gn(x, c == null ? void 0 : c.accessToken);
1142
+ await Gn(v, c == null ? void 0 : c.accessToken);
1143
1143
  const N = n == null ? void 0 : n.find((w) => w.isDefault);
1144
1144
  if (N && N.id !== u.id) {
1145
1145
  const w = {
@@ -1232,8 +1232,8 @@ async function go() {
1232
1232
  }
1233
1233
  })).json()).url, m = document.createElement("a");
1234
1234
  m.href = u;
1235
- const x = `${i}-${(/* @__PURE__ */ new Date()).toISOString()}.pdf`;
1236
- m.download = x, m.click(), G.setState({ isDownloadingPdf: !1 });
1235
+ const v = `${i}-${(/* @__PURE__ */ new Date()).toISOString()}.pdf`;
1236
+ m.download = v, m.click(), G.setState({ isDownloadingPdf: !1 });
1237
1237
  }
1238
1238
  function yo({
1239
1239
  iconClassName: t
@@ -1308,7 +1308,7 @@ function xo({
1308
1308
  status: i,
1309
1309
  error: l,
1310
1310
  isDeleting: c
1311
- } = vo(), [d, o] = B(""), [h, u] = B(Ja[0].value), [m, x] = B("06:00"), [N, w] = B("");
1311
+ } = vo(), [d, o] = B(""), [h, u] = B(Ja[0].value), [m, v] = B("06:00"), [N, w] = B("");
1312
1312
  return /* @__PURE__ */ e(rs, { delayDuration: 0, children: /* @__PURE__ */ s(Je, { children: [
1313
1313
  /* @__PURE__ */ e(He, { asChild: !0, children: /* @__PURE__ */ e(
1314
1314
  ae,
@@ -1372,7 +1372,7 @@ function xo({
1372
1372
  id: "time",
1373
1373
  type: "time",
1374
1374
  value: m,
1375
- onChange: (f) => x(f.target.value),
1375
+ onChange: (f) => v(f.target.value),
1376
1376
  className: `col-span-2 h-8 ${We}`
1377
1377
  }
1378
1378
  )
@@ -1386,7 +1386,7 @@ function xo({
1386
1386
  frequency: h,
1387
1387
  time: m,
1388
1388
  subject: N
1389
- }), x("00:00"), o(""), w("");
1389
+ }), v("00:00"), o(""), w("");
1390
1390
  },
1391
1391
  className: "h-8 p-2",
1392
1392
  disabled: i === "loading" || !d,
@@ -1459,7 +1459,7 @@ function vo() {
1459
1459
  const [t, a] = B("idle"), [n, r] = B(""), [i, l] = B(null), c = G((F) => F.authToken), d = G((F) => F.dashboard.id), o = G((F) => F.dashboard.title), { endUserId: h } = ls((c == null ? void 0 : c.accessToken) || ""), u = "https://semaphor.cloud/api/v1/subscriptions/get", m = {
1460
1460
  dashboardId: d,
1461
1461
  endUserId: h
1462
- }, { data: x, isLoading: N, isError: w, isFetching: f, refetch: I } = Wn({
1462
+ }, { data: v, isLoading: N, isError: w, isFetching: f, refetch: I } = Wn({
1463
1463
  queryKey: ["subscriptions", d, h],
1464
1464
  queryFn: () => jr(u, (c == null ? void 0 : c.accessToken) || "", m),
1465
1465
  enabled: !!(c != null && c.accessToken) && !!d && !!h
@@ -1498,7 +1498,7 @@ function vo() {
1498
1498
  console.error(L), a("error"), r(L.message);
1499
1499
  }
1500
1500
  }
1501
- async function v(F) {
1501
+ async function x(F) {
1502
1502
  const E = "https://semaphor.cloud/api/v1/subscriptions/delete";
1503
1503
  l(F);
1504
1504
  try {
@@ -1510,14 +1510,14 @@ function vo() {
1510
1510
  }
1511
1511
  }
1512
1512
  return {
1513
- data: x,
1513
+ data: v,
1514
1514
  isLoading: N,
1515
1515
  isFetching: f,
1516
1516
  isError: w,
1517
1517
  isDeleting: i,
1518
1518
  refetch: I,
1519
1519
  handleScheduleSubscription: g,
1520
- handleDeleteSubscription: v,
1520
+ handleDeleteSubscription: x,
1521
1521
  status: t,
1522
1522
  error: n
1523
1523
  };
@@ -1535,11 +1535,11 @@ function bo() {
1535
1535
  G(
1536
1536
  (y) => y.showDashboardJSON
1537
1537
  );
1538
- const x = G((y) => y.onSaveFunction), N = G(
1538
+ const v = G((y) => y.onSaveFunction), N = G(
1539
1539
  (y) => y.actions.setShowFilters
1540
1540
  ), { addFrame: w, setSelectedFrameId: f } = G(
1541
1541
  (y) => y.actions
1542
- ), { getSelectedSheet: I, setIsDashboardEditing: g, setShowDashboardJSON: v } = G((y) => y.actions), F = I(), { tenantId: E, endUserId: D } = at(
1542
+ ), { getSelectedSheet: I, setIsDashboardEditing: g, setShowDashboardJSON: x } = G((y) => y.actions), F = I(), { tenantId: E, endUserId: D } = at(
1543
1543
  () => ls(t == null ? void 0 : t.accessToken),
1544
1544
  [t == null ? void 0 : t.accessToken]
1545
1545
  ), C = at(() => E || D, [E, D]), k = () => {
@@ -1579,7 +1579,7 @@ function bo() {
1579
1579
  template: p,
1580
1580
  filterValues: h
1581
1581
  };
1582
- await Gn(L, t == null ? void 0 : t.accessToken), Lt.success("Lens saved"), x == null || x(y), o(!1);
1582
+ await Gn(L, t == null ? void 0 : t.accessToken), Lt.success("Lens saved"), v == null || v(y), o(!1);
1583
1583
  }
1584
1584
  return u ? null : /* @__PURE__ */ s(
1585
1585
  "div",
@@ -1623,7 +1623,7 @@ function bo() {
1623
1623
  {
1624
1624
  className: "h-7 p-2",
1625
1625
  onClick: () => {
1626
- g(!1), v(!1);
1626
+ g(!1), x(!1);
1627
1627
  },
1628
1628
  children: /* @__PURE__ */ e(Un, { className: "h-4 w-4" })
1629
1629
  }
@@ -1668,18 +1668,18 @@ function No({
1668
1668
  icon: o,
1669
1669
  showNone: h = !1
1670
1670
  }) {
1671
- const u = ct.useRef(null), [m, x] = ct.useState(!1), [N, w] = ct.useState("100%"), f = h ? [...a || [], { id: "none", name: "None" }] : a;
1671
+ const u = ct.useRef(null), [m, v] = ct.useState(!1), [N, w] = ct.useState("100%"), f = h ? [...a || [], { id: "none", name: "None" }] : a;
1672
1672
  ct.useLayoutEffect(() => {
1673
1673
  u.current && w(u.current.offsetWidth);
1674
1674
  }, []);
1675
1675
  function I() {
1676
- var v;
1677
- return i ? "Loading..." : l ? "Error" : n ? (v = a == null ? void 0 : a.find((F) => F.id === n)) == null ? void 0 : v.name : `Select ${t}`;
1676
+ var x;
1677
+ return i ? "Loading..." : l ? "Error" : n ? (x = a == null ? void 0 : a.find((F) => F.id === n)) == null ? void 0 : x.name : `Select ${t}`;
1678
1678
  }
1679
- function g(v, F) {
1680
- r(F), x(!1);
1679
+ function g(x, F) {
1680
+ r(F), v(!1);
1681
1681
  }
1682
- return /* @__PURE__ */ s(Je, { open: m, onOpenChange: x, children: [
1682
+ return /* @__PURE__ */ s(Je, { open: m, onOpenChange: v, children: [
1683
1683
  /* @__PURE__ */ e(He, { asChild: !0, children: /* @__PURE__ */ s(
1684
1684
  q,
1685
1685
  {
@@ -1721,26 +1721,26 @@ function No({
1721
1721
  t == null ? void 0 : t.toLowerCase(),
1722
1722
  " found."
1723
1723
  ] }),
1724
- /* @__PURE__ */ e(pn, { children: f == null ? void 0 : f.map((v) => /* @__PURE__ */ e(
1724
+ /* @__PURE__ */ e(pn, { children: f == null ? void 0 : f.map((x) => /* @__PURE__ */ e(
1725
1725
  fn,
1726
1726
  {
1727
1727
  className: "overflow-x-auto",
1728
- value: v.name,
1729
- onSelect: (F) => g(F, v.id),
1728
+ value: x.name,
1729
+ onSelect: (F) => g(F, x.id),
1730
1730
  children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
1731
1731
  /* @__PURE__ */ e(
1732
1732
  gt,
1733
1733
  {
1734
1734
  className: R(
1735
1735
  "size-4",
1736
- n === v.id ? "opacity-100" : "opacity-0"
1736
+ n === x.id ? "opacity-100" : "opacity-0"
1737
1737
  )
1738
1738
  }
1739
1739
  ),
1740
- /* @__PURE__ */ e("div", { title: v.name, children: v.name })
1740
+ /* @__PURE__ */ e("div", { title: x.name, children: x.name })
1741
1741
  ] })
1742
1742
  },
1743
- v.id
1743
+ x.id
1744
1744
  )) })
1745
1745
  ] })
1746
1746
  ] })
@@ -1763,7 +1763,7 @@ function zt({
1763
1763
  type: u = "combobox"
1764
1764
  }) {
1765
1765
  const m = r ? "Loading..." : i ? "Error" : n;
1766
- function x() {
1766
+ function v() {
1767
1767
  if (t === "Connection")
1768
1768
  return /* @__PURE__ */ e(to, { className: "size-4" });
1769
1769
  if (t === "Database")
@@ -1818,7 +1818,7 @@ function zt({
1818
1818
  return /* @__PURE__ */ e(
1819
1819
  No,
1820
1820
  {
1821
- icon: x(),
1821
+ icon: v(),
1822
1822
  items: a,
1823
1823
  value: m,
1824
1824
  onChange: c || (() => {
@@ -1840,10 +1840,10 @@ function Co({ column: t }) {
1840
1840
  (f) => f.selectedDatabaseName
1841
1841
  ), c = S(
1842
1842
  (f) => f.selectedDatamodelId
1843
- ), d = S((f) => f.sqlGen), { modelItems: o, connectionType: h } = Ve(), u = S((f) => f.actions.setSqlGen), m = S((f) => f.actions.setCardSql), x = S((f) => f.actions.setRunSql);
1843
+ ), d = S((f) => f.sqlGen), { modelItems: o, connectionType: h } = Ve(), u = S((f) => f.actions.setSqlGen), m = S((f) => f.actions.setCardSql), v = S((f) => f.actions.setRunSql);
1844
1844
  function N(f, I) {
1845
1845
  var E;
1846
- const g = hs(f, d, I), v = (E = o == null ? void 0 : o.find(
1846
+ const g = hs(f, d, I), x = (E = o == null ? void 0 : o.find(
1847
1847
  (D) => D.id === c
1848
1848
  )) == null ? void 0 : E.name;
1849
1849
  u(g);
@@ -1851,11 +1851,11 @@ function Co({ column: t }) {
1851
1851
  g,
1852
1852
  Le(i || ""),
1853
1853
  Le(r),
1854
- v || "",
1854
+ x || "",
1855
1855
  h,
1856
1856
  l || ""
1857
1857
  );
1858
- F && (m(F), x(!0)), n(!1);
1858
+ F && (m(F), v(!0)), n(!1);
1859
1859
  }
1860
1860
  function w() {
1861
1861
  return /* @__PURE__ */ s("ul", { className: "text-xs", children: [
@@ -2070,12 +2070,12 @@ function So() {
2070
2070
  setPreviewFilterColumns: u,
2071
2071
  setPreviewPivotColumns: m
2072
2072
  } = $r(), {
2073
- setGroupByColumns: x,
2073
+ setGroupByColumns: v,
2074
2074
  setMetricColumns: N,
2075
2075
  setFilterColumns: w,
2076
2076
  setOrderByColumns: f,
2077
2077
  setPivotByColumns: I
2078
- } = X(), { columns: g } = ys(), { formattedTableName: v } = Ve(), F = jt(
2078
+ } = X(), { columns: g } = ys(), { formattedTableName: x } = Ve(), F = jt(
2079
2079
  Ze(Gr, {
2080
2080
  activationConstraint: {
2081
2081
  distance: 1
@@ -2226,7 +2226,7 @@ function So() {
2226
2226
  role: "groupby",
2227
2227
  label: Mt(O.column_name, "month"),
2228
2228
  granularity: "month"
2229
- }, A.splice(V, 0, P), x(A);
2229
+ }, A.splice(V, 0, P), v(A);
2230
2230
  }
2231
2231
  function y(O) {
2232
2232
  const b = [...r], A = t !== null ? t : r.length, V = {
@@ -2237,7 +2237,7 @@ function So() {
2237
2237
  type: O.data_type,
2238
2238
  sql: Bn(
2239
2239
  O.data_type,
2240
- v,
2240
+ x,
2241
2241
  Le(O.column_name)
2242
2242
  ),
2243
2243
  role: "filter"
@@ -2261,7 +2261,7 @@ function So() {
2261
2261
  ), W = a.findIndex((Z) => Z.id === A.id);
2262
2262
  if (Q !== -1 && W !== -1 && Q !== W) {
2263
2263
  const Z = [...a], [ge] = Z.splice(Q, 1);
2264
- Z.splice(W, 0, ge), x(Z);
2264
+ Z.splice(W, 0, ge), v(Z);
2265
2265
  }
2266
2266
  }
2267
2267
  if (A && ((H = A.data.current) == null ? void 0 : H.type) === tn && l.some((Q) => Q.id === b.id)) {
@@ -2378,13 +2378,13 @@ function Mo({
2378
2378
  (b) => b.selectedSchemaName
2379
2379
  ), u = S((b) => b.selectedTableName), m = S(
2380
2380
  (b) => b.selectedDatamodelId
2381
- ), x = G(
2381
+ ), v = G(
2382
2382
  (b) => b.dashboard.aiScopeTables
2383
2383
  ), { addToAIScope: N, removeFromAIScope: w } = Dt(), {
2384
2384
  addColumnToMetricColumns: f,
2385
2385
  addColumnToGroupBy: I,
2386
2386
  setCardSql: g,
2387
- setRunSql: v,
2387
+ setRunSql: x,
2388
2388
  setSqlGen: F,
2389
2389
  setIsShowingVisual: E
2390
2390
  } = X(), { connectionType: D, modelItems: C, selectedDatamodelName: k } = Ve();
@@ -2403,7 +2403,7 @@ function Mo({
2403
2403
  D,
2404
2404
  o || ""
2405
2405
  );
2406
- J && (g(J), v(!0));
2406
+ J && (g(J), x(!0));
2407
2407
  }
2408
2408
  if (!l) {
2409
2409
  if (Pe(b.data_type))
@@ -2491,7 +2491,7 @@ function Mo({
2491
2491
  });
2492
2492
  E(!1);
2493
2493
  const A = D === "MSSQL" ? `SELECT top 10 * FROM ${b}` : `SELECT * FROM ${b} LIMIT 10`;
2494
- g(A), v(!0);
2494
+ g(A), x(!0);
2495
2495
  }
2496
2496
  function p() {
2497
2497
  const b = La({
@@ -2501,10 +2501,10 @@ function Mo({
2501
2501
  connectionType: D,
2502
2502
  databaseName: o || ""
2503
2503
  });
2504
- g(`SELECT COUNT(*) as count FROM ${b}`), v(!0);
2504
+ g(`SELECT COUNT(*) as count FROM ${b}`), x(!0);
2505
2505
  }
2506
2506
  function L() {
2507
- return (x == null ? void 0 : x.find(
2507
+ return (v == null ? void 0 : v.find(
2508
2508
  (b) => b.connectionId === c && (b.tableName === u || b.datamodelName === k)
2509
2509
  )) !== void 0;
2510
2510
  }
@@ -2629,13 +2629,13 @@ function Ws({
2629
2629
  (le) => le.selectedDatabaseName
2630
2630
  ), d = S(
2631
2631
  (le) => le.selectedSchemaName
2632
- ), o = S((le) => le.selectedTableName), h = S((le) => le.isDevMode), { setSelectedTableName: u, setIsDevMode: m, setCardSql: x } = X(), {
2632
+ ), o = S((le) => le.selectedTableName), h = S((le) => le.isDevMode), { setSelectedTableName: u, setIsDevMode: m, setCardSql: v } = X(), {
2633
2633
  connectionItems: N,
2634
2634
  modelItems: w,
2635
2635
  schemaItems: f,
2636
2636
  databaseItems: I,
2637
2637
  tableItems: g,
2638
- columns: v,
2638
+ columns: x,
2639
2639
  isConnectionsLoading: F,
2640
2640
  isModelsLoading: E,
2641
2641
  isConnectionsError: D,
@@ -2665,12 +2665,12 @@ function Ws({
2665
2665
  schemaName: ge
2666
2666
  } = Ve(), { data: Ie, refetch: Ae } = Se(n);
2667
2667
  function Ye() {
2668
- return t ? t(ge, Z, v) : /* @__PURE__ */ e(
2668
+ return t ? t(ge, Z, x) : /* @__PURE__ */ e(
2669
2669
  Mo,
2670
2670
  {
2671
2671
  schemaName: ge,
2672
2672
  tableName: Z,
2673
- columns: v,
2673
+ columns: x,
2674
2674
  status: L ? "Loading..." : p ? "Error" : "Success"
2675
2675
  }
2676
2676
  );
@@ -2679,9 +2679,9 @@ function Ws({
2679
2679
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
2680
2680
  }
2681
2681
  function Ke(le) {
2682
- le === !0 ? Ie && (x(Ie.userSql), setTimeout(() => {
2682
+ le === !0 ? Ie && (v(Ie.userSql), setTimeout(() => {
2683
2683
  Ae();
2684
- }, 100)) : x(""), m(le);
2684
+ }, 100)) : v(""), m(le);
2685
2685
  }
2686
2686
  function Be() {
2687
2687
  if (!r || b === "S3" || b === "API") return null;
@@ -2836,13 +2836,13 @@ function Zs({
2836
2836
  function o() {
2837
2837
  t && !d.current && navigator.clipboard.writeText(t);
2838
2838
  }
2839
- function h(x) {
2840
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), o());
2839
+ function h(v) {
2840
+ (v.key === "Enter" || v.key === " ") && (v.preventDefault(), o());
2841
2841
  }
2842
2842
  function u() {
2843
- const x = window.getSelection();
2844
- if (x && x.toString().trim() !== "") {
2845
- const N = x.toString();
2843
+ const v = window.getSelection();
2844
+ if (v && v.toString().trim() !== "") {
2845
+ const N = v.toString();
2846
2846
  navigator.clipboard.writeText(N), l(!0), d.current = !0, setTimeout(() => {
2847
2847
  l(!1), d.current = !1;
2848
2848
  }, 1e3);
@@ -3048,10 +3048,10 @@ function Fo(t) {
3048
3048
  return Nt({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(t);
3049
3049
  }
3050
3050
  function ar(t) {
3051
- const { theme: a } = Kr(), n = G((f) => f.theme), r = S((f) => f.frame), i = S((f) => f.card), l = S((f) => f.activeTabCardId), c = Ur(), { refetch: d } = Se(i), { updateCardTab: o, setRunSql: h } = X(), u = Ge(), m = Ge({}), x = r.cards.find((f) => f.id === l), N = fe(() => {
3051
+ const { theme: a } = Kr(), n = G((f) => f.theme), r = S((f) => f.frame), i = S((f) => f.card), l = S((f) => f.activeTabCardId), c = Ur(), { refetch: d } = Se(i), { updateCardTab: o, setRunSql: h } = X(), u = Ge(), m = Ge({}), v = r.cards.find((f) => f.id === l), N = fe(() => {
3052
3052
  let f = "";
3053
- return t === "python" && (f = (x == null ? void 0 : x.python) || Ns), t === "sql" && (f = (x == null ? void 0 : x.sql) || ""), f;
3054
- }, [t, x]);
3053
+ return t === "python" && (f = (v == null ? void 0 : v.python) || Ns), t === "sql" && (f = (v == null ? void 0 : v.sql) || ""), f;
3054
+ }, [t, v]);
3055
3055
  xe(() => {
3056
3056
  if (l && i.id && i.id !== l) {
3057
3057
  if (u.current && c) {
@@ -3101,8 +3101,8 @@ function ar(t) {
3101
3101
  }, [c, d, i]);
3102
3102
  function w(f, I) {
3103
3103
  if (u.current = f, !m.current[i.id]) {
3104
- const g = f.getModel(), v = N();
3105
- m.current[i.id] = g || (I == null ? void 0 : I.editor.createModel(v, t)) || f.getModel();
3104
+ const g = f.getModel(), x = N();
3105
+ m.current[i.id] = g || (I == null ? void 0 : I.editor.createModel(x, t)) || f.getModel();
3106
3106
  }
3107
3107
  f.setModel(m.current[i.id]);
3108
3108
  }
@@ -3219,14 +3219,14 @@ function Bo() {
3219
3219
  }), { sheetFilterValues: h } = Xr(), {
3220
3220
  setCardCustomCfg: u,
3221
3221
  setQueryResultColumns: m,
3222
- setCardSql: x,
3222
+ setCardSql: v,
3223
3223
  setTempQueryData: N,
3224
3224
  // setQueryError,
3225
3225
  setPythonStdOut: w,
3226
3226
  setCardPreferences: f,
3227
3227
  setCardType: I,
3228
3228
  setCardPython: g,
3229
- runAssistant: v,
3229
+ runAssistant: x,
3230
3230
  setShowAIDialog: F
3231
3231
  } = X();
3232
3232
  S((j) => j.onSave), S((j) => j.onClose), S((j) => j.actions.setSqlGen);
@@ -3281,7 +3281,7 @@ function Bo() {
3281
3281
  ${o ? `Python:
3282
3282
  ${o}` : ""}
3283
3283
  `;
3284
- v(j);
3284
+ x(j);
3285
3285
  }
3286
3286
  function V() {
3287
3287
  return /* @__PURE__ */ s(ne, { children: [
@@ -3503,14 +3503,14 @@ function Po({ data: t }) {
3503
3503
  ] });
3504
3504
  }
3505
3505
  function Ro({ card: t }) {
3506
- var v, F, E, D, C, k, M, T, y, p, L;
3506
+ var x, F, E, D, C, k, M, T, y, p, L;
3507
3507
  const [a, n] = B(!1), [r, i] = B(
3508
3508
  []
3509
3509
  ), { authToken: l } = rt(), c = di(l == null ? void 0 : l.accessToken), d = G((z) => z.themeStyle), o = {
3510
- colors: ((F = (v = d == null ? void 0 : d.chart) == null ? void 0 : v.dataset) == null ? void 0 : F.backgroundColor) || []
3510
+ colors: ((F = (x = d == null ? void 0 : d.chart) == null ? void 0 : x.dataset) == null ? void 0 : F.backgroundColor) || []
3511
3511
  };
3512
3512
  (E = t.customCardPreferences) != null && E.inputData;
3513
- const { getCard: h } = ks(((D = t.customCardPreferences) == null ? void 0 : D.url) || ""), u = ((C = t.customCardPreferences) == null ? void 0 : C.visualType) || "single", m = S((z) => z.frame), { setCustomCardPreferences: x } = X(), { data: N } = Se(t), w = fe((z, O) => {
3513
+ const { getCard: h } = ks(((D = t.customCardPreferences) == null ? void 0 : D.url) || ""), u = ((C = t.customCardPreferences) == null ? void 0 : C.visualType) || "single", m = S((z) => z.frame), { setCustomCardPreferences: v } = X(), { data: N } = Se(t), w = fe((z, O) => {
3514
3514
  i((b) => ({
3515
3515
  ...b,
3516
3516
  [z]: O
@@ -3593,9 +3593,9 @@ function sr({
3593
3593
  ...a
3594
3594
  }) {
3595
3595
  var g;
3596
- const n = S((v) => v.card), r = ((g = n.customCardPreferences) == null ? void 0 : g.showCardHeader) ?? !0, i = S((v) => v.frame), l = G((v) => v.dashboard.filters);
3597
- S((v) => v.actions.setRunSql);
3598
- const { updateFilter: c } = Dt(), d = l == null ? void 0 : l.find((v) => v.id === i.filterId), { data: o, isLoading: h, isFetching: u, errorMessage: m } = Se(n), { setCard: x } = X(), { data: N } = ta(n), w = at(() => !n.id || !(o != null && o.records) ? null : Ss({
3596
+ const n = S((x) => x.card), r = ((g = n.customCardPreferences) == null ? void 0 : g.showCardHeader) ?? !0, i = S((x) => x.frame), l = G((x) => x.dashboard.filters);
3597
+ S((x) => x.actions.setRunSql);
3598
+ const { updateFilter: c } = Dt(), d = l == null ? void 0 : l.find((x) => x.id === i.filterId), { data: o, isLoading: h, isFetching: u, errorMessage: m } = Se(n), { setCard: v } = X(), { data: N } = ta(n), w = at(() => !n.id || !(o != null && o.records) ? null : Ss({
3599
3599
  card: n,
3600
3600
  data: o == null ? void 0 : o.records,
3601
3601
  cardType: n.type,
@@ -3613,8 +3613,8 @@ function sr({
3613
3613
  n.preferences,
3614
3614
  N
3615
3615
  ]);
3616
- function f(v) {
3617
- return /* @__PURE__ */ e(Ro, { card: v });
3616
+ function f(x) {
3617
+ return /* @__PURE__ */ e(Ro, { card: x });
3618
3618
  }
3619
3619
  function I() {
3620
3620
  if (o != null && o.records && (o == null ? void 0 : o.records.length) === 0 && !h && !u)
@@ -3652,7 +3652,7 @@ function sr({
3652
3652
  {
3653
3653
  enabled: !0,
3654
3654
  text: n.title,
3655
- onSave: (v) => x({ ...n, title: v }),
3655
+ onSave: (x) => v({ ...n, title: x }),
3656
3656
  children: /* @__PURE__ */ e("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e(Ds, { className: "text-base", children: n.title || "Add title" }) })
3657
3657
  },
3658
3658
  n.title
@@ -3662,7 +3662,7 @@ function sr({
3662
3662
  {
3663
3663
  enabled: !0,
3664
3664
  text: n.description || "",
3665
- onSave: (v) => x({ ...n, description: v }),
3665
+ onSave: (x) => v({ ...n, description: x }),
3666
3666
  children: /* @__PURE__ */ e(mi, { children: n.description || "Add description" })
3667
3667
  },
3668
3668
  n.description
@@ -3675,7 +3675,7 @@ function sr({
3675
3675
  enabled: !0,
3676
3676
  className: "my-1",
3677
3677
  text: d.title || d.column,
3678
- onSave: (v) => c({ ...d, title: v }),
3678
+ onSave: (x) => c({ ...d, title: x }),
3679
3679
  children: /* @__PURE__ */ e(K, { children: d.title })
3680
3680
  }
3681
3681
  ),
@@ -3800,7 +3800,7 @@ const Fn = ({
3800
3800
  /* @__PURE__ */ e(q, { onClick: i, variant: "outline", children: "Close" })
3801
3801
  ] });
3802
3802
  function Go() {
3803
- const [t, a] = B(!1), [n, r] = B(""), [i, l] = B(""), [c, d] = B(""), [o, h] = B(""), u = S((D) => D.card), m = S((D) => D.card.customCfg), x = m ? JSON.stringify(m, null, 2) : "", { data: N } = Se(u), { data: w } = ta(u), { setCardCustomCfg: f, setCustomVisualCode: I } = X(), g = (D) => {
3803
+ const [t, a] = B(!1), [n, r] = B(""), [i, l] = B(""), [c, d] = B(""), [o, h] = B(""), u = S((D) => D.card), m = S((D) => D.card.customCfg), v = m ? JSON.stringify(m, null, 2) : "", { data: N } = Se(u), { data: w } = ta(u), { setCardCustomCfg: f, setCustomVisualCode: I } = X(), g = (D) => {
3804
3804
  var C, k;
3805
3805
  return JSON.stringify(
3806
3806
  {
@@ -3816,7 +3816,7 @@ function Go() {
3816
3816
  null,
3817
3817
  2
3818
3818
  );
3819
- }, v = () => {
3819
+ }, x = () => {
3820
3820
  var C, k;
3821
3821
  if (!((C = N == null ? void 0 : N.records) != null && C.length)) return;
3822
3822
  const D = Ss({
@@ -3853,7 +3853,7 @@ function Go() {
3853
3853
  ae,
3854
3854
  {
3855
3855
  tooltip: "Customize Visual",
3856
- onClick: v,
3856
+ onClick: x,
3857
3857
  className: E ? "" : "text-green-600 hover:text-green-700",
3858
3858
  children: /* @__PURE__ */ e(Os, { className: "h-4 w-4" })
3859
3859
  }
@@ -3866,7 +3866,7 @@ function Go() {
3866
3866
  _o,
3867
3867
  {
3868
3868
  customCode: c,
3869
- cardCustomCfgString: x,
3869
+ cardCustomCfgString: v,
3870
3870
  mergedConfig: i,
3871
3871
  onConfigChange: (D) => l(D ?? ""),
3872
3872
  onCodeChange: (D) => d(D ?? "")
@@ -3922,14 +3922,14 @@ function Jo({
3922
3922
  (async () => {
3923
3923
  var u;
3924
3924
  if (d) {
3925
- const x = (await Promise.all(
3925
+ const v = (await Promise.all(
3926
3926
  (u = d == null ? void 0 : d.plugins) == null ? void 0 : u.map(async (N) => (await vi(N.value)).visuals.map((I) => ({
3927
3927
  name: I.name,
3928
3928
  icon: I.icon,
3929
3929
  url: N.value
3930
3930
  })))
3931
3931
  )).flat();
3932
- n(x);
3932
+ n(v);
3933
3933
  }
3934
3934
  })();
3935
3935
  }, [d]), a.length === 0 ? null : /* @__PURE__ */ s(ne, { children: [
@@ -4276,7 +4276,7 @@ function Uo() {
4276
4276
  ((P = (V = (A = n == null ? void 0 : n.chartOptions) == null ? void 0 : A.scales) == null ? void 0 : V[i]) == null ? void 0 : P.min) || ""
4277
4277
  ), [h, u] = B(
4278
4278
  ((re = (j = (J = n == null ? void 0 : n.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : j[i]) == null ? void 0 : re.max) || ""
4279
- ), [m, x] = B(d || h ? "custom" : "auto"), [N, w] = B(""), [f, I] = B(0), [g, v] = B(""), [F, E] = B(""), [D, C] = B(""), k = S(
4279
+ ), [m, v] = B(d || h ? "custom" : "auto"), [N, w] = B(""), [f, I] = B(0), [g, x] = B(""), [F, E] = B(""), [D, C] = B(""), k = S(
4280
4280
  ($) => $.actions.setCardPreferences
4281
4281
  ), { updateCardInFrame: M } = X(), T = S(($) => $.card), y = ["pie", "doughnut", "polarArea", "funnel"].includes(
4282
4282
  r
@@ -4287,7 +4287,7 @@ function Uo() {
4287
4287
  ((ee = (H = ($ = n == null ? void 0 : n.chartOptions) == null ? void 0 : $.scales) == null ? void 0 : H[i]) == null ? void 0 : ee.min) === 0 ? 0 : ""
4288
4288
  ), u(((W = (Q = (ie = n == null ? void 0 : n.chartOptions) == null ? void 0 : ie.scales) == null ? void 0 : Q[i]) == null ? void 0 : W.max) || ""), w(
4289
4289
  ((Ae = (Ie = (ge = (Z = n == null ? void 0 : n.chartOptions) == null ? void 0 : Z.scales) == null ? void 0 : ge[i]) == null ? void 0 : Ie.ticks) == null ? void 0 : Ae.stepSize) || ""
4290
- ), I(((Ye = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : Ye.decimalPlaces) || 0), v(((je = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : je.suffix) || ""), E(((Ke = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : Ke.currency) || ""), C(((Be = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : Be.locale) || "");
4290
+ ), I(((Ye = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : Ye.decimalPlaces) || 0), x(((je = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : je.suffix) || ""), E(((Ke = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : Ke.currency) || ""), C(((Be = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : Be.locale) || "");
4291
4291
  }, [t, n, i, r]);
4292
4292
  function p($, H) {
4293
4293
  return H === "" || /^[0-9\b]+$/.test(H) ? Number(H) : Number($);
@@ -4387,7 +4387,7 @@ function Uo() {
4387
4387
  disabled: y,
4388
4388
  id: "scale-option",
4389
4389
  value: m,
4390
- onValueChange: ($) => x($),
4390
+ onValueChange: ($) => v($),
4391
4391
  className: "col-span-2 flex gap-3",
4392
4392
  defaultValue: "x",
4393
4393
  children: [
@@ -4716,11 +4716,11 @@ function Zo() {
4716
4716
  }, o = (w, f) => {
4717
4717
  const I = w.dataTransfer.getData("tabIndex");
4718
4718
  if (I === f.toString()) return;
4719
- const g = Array.from(t.cards), [v] = g.splice(parseInt(I), 1);
4720
- g.splice(f, 0, v), n({ ...t, cards: g });
4719
+ const g = Array.from(t.cards), [x] = g.splice(parseInt(I), 1);
4720
+ g.splice(f, 0, x), n({ ...t, cards: g });
4721
4721
  };
4722
4722
  function h(w) {
4723
- const f = t.cards.filter((v) => v.id !== w), I = f[0], g = {
4723
+ const f = t.cards.filter((x) => x.id !== w), I = f[0], g = {
4724
4724
  ...t,
4725
4725
  cards: f,
4726
4726
  // update the active card to the first card in the frame
@@ -4745,7 +4745,7 @@ function Zo() {
4745
4745
  };
4746
4746
  u(a, w);
4747
4747
  }
4748
- function x(w) {
4748
+ function v(w) {
4749
4749
  const f = {
4750
4750
  connectionId: w.connectionId,
4751
4751
  lastSelectedDatabase: w.lastSelectedDatabase,
@@ -4824,7 +4824,7 @@ function Zo() {
4824
4824
  {
4825
4825
  className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
4826
4826
  variant: "outline",
4827
- onClick: () => x(a),
4827
+ onClick: () => v(a),
4828
4828
  children: /* @__PURE__ */ e(ke, { className: "h-4 w-4" })
4829
4829
  }
4830
4830
  ),
@@ -4841,7 +4841,7 @@ function Zo() {
4841
4841
  }
4842
4842
  function dr() {
4843
4843
  const t = S((f) => f.frame), a = S((f) => f.card), n = S((f) => f.isSqlRunning), r = S((f) => f.isDevMode), { setFrame: i, setActiveTabCardId: l, setCard: c, setIsDevMode: d, setRunSql: o } = X(), { data: h, isLoading: u, isFetching: m } = Se(a);
4844
- function x(f) {
4844
+ function v(f) {
4845
4845
  const I = t.cards.find((g) => g.id === f);
4846
4846
  if (I != null && I.sql) {
4847
4847
  r || d(!0), l(f);
@@ -4856,11 +4856,11 @@ function dr() {
4856
4856
  function N(f) {
4857
4857
  const I = {
4858
4858
  ...t,
4859
- cards: t.cards.map((v) => v.id === a.id ? a : v),
4859
+ cards: t.cards.map((x) => x.id === a.id ? a : x),
4860
4860
  activeCardId: f
4861
4861
  };
4862
4862
  i(I);
4863
- const g = I.cards.find((v) => v.id === f);
4863
+ const g = I.cards.find((x) => x.id === f);
4864
4864
  g.sql && o(!0), c(g);
4865
4865
  }
4866
4866
  function w() {
@@ -4876,7 +4876,7 @@ function dr() {
4876
4876
  return /* @__PURE__ */ s(
4877
4877
  _t,
4878
4878
  {
4879
- onValueChange: x,
4879
+ onValueChange: v,
4880
4880
  value: t.activeCardId,
4881
4881
  className: "flex grow flex-col",
4882
4882
  children: [
@@ -4889,12 +4889,12 @@ function dr() {
4889
4889
  function Jt({
4890
4890
  children: t
4891
4891
  }) {
4892
- S((v) => v.frame);
4893
- const a = S((v) => v.card), n = S((v) => v.isDevMode), r = S((v) => v.isShowingVisual), i = G((v) => v.isVisualEditing), l = S((v) => v.pythonStdOut);
4894
- S((v) => v.actions.setRunSql);
4895
- const { setFrame: c, setCard: d, setActiveTabCardId: o, runAssistant: h, setIsDevMode: u } = X(), { data: m, isLoading: x, isFetching: N, errorMessage: w } = Se(a);
4892
+ S((x) => x.frame);
4893
+ const a = S((x) => x.card), n = S((x) => x.isDevMode), r = S((x) => x.isShowingVisual), i = G((x) => x.isVisualEditing), l = S((x) => x.pythonStdOut);
4894
+ S((x) => x.actions.setRunSql);
4895
+ const { setFrame: c, setCard: d, setActiveTabCardId: o, runAssistant: h, setIsDevMode: u } = X(), { data: m, isLoading: v, isFetching: N, errorMessage: w } = Se(a);
4896
4896
  function f() {
4897
- const v = JSON.stringify(m == null ? void 0 : m.records, null, 2), F = new Blob([v], { type: "application/json" }), E = URL.createObjectURL(F), D = document.createElement("a");
4897
+ const x = JSON.stringify(m == null ? void 0 : m.records, null, 2), F = new Blob([x], { type: "application/json" }), E = URL.createObjectURL(F), D = document.createElement("a");
4898
4898
  D.href = E, D.download = `${a.title}.json`, D.click();
4899
4899
  }
4900
4900
  function I() {
@@ -4908,15 +4908,15 @@ function Jt({
4908
4908
  C.href = D, C.download = `${a.title}.csv`, C.click();
4909
4909
  }
4910
4910
  function g() {
4911
- const v = `Can you get the documentation for ${a.type} chart?`;
4912
- h(v);
4911
+ const x = `Can you get the documentation for ${a.type} chart?`;
4912
+ h(x);
4913
4913
  }
4914
4914
  return a ? /* @__PURE__ */ s(
4915
4915
  "div",
4916
4916
  {
4917
4917
  className: "relative isolate flex h-full flex-col py-2 pb-3",
4918
4918
  children: [
4919
- (x || N) && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto flex h-10 w-10 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ e(Te, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
4919
+ (v || N) && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto flex h-10 w-10 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ e(Te, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
4920
4920
  /* @__PURE__ */ s(
4921
4921
  "div",
4922
4922
  {
@@ -5042,12 +5042,12 @@ function tc() {
5042
5042
  ), h = (f = o == null ? void 0 : o.visuals) == null ? void 0 : f.find(
5043
5043
  (g) => g.name === (t == null ? void 0 : t.componentName)
5044
5044
  );
5045
- function u(g, v) {
5045
+ function u(g, x) {
5046
5046
  if (!t) return;
5047
5047
  const E = {
5048
5048
  ...(t == null ? void 0 : t.dataInputCardIds) || {},
5049
5049
  [g]: {
5050
- cardId: v,
5050
+ cardId: x,
5051
5051
  hookRef: null
5052
5052
  }
5053
5053
  };
@@ -5058,7 +5058,7 @@ function tc() {
5058
5058
  }
5059
5059
  function m(g) {
5060
5060
  var F, E;
5061
- const v = (F = i == null ? void 0 : i.cards) == null ? void 0 : F.filter((D) => {
5061
+ const x = (F = i == null ? void 0 : i.cards) == null ? void 0 : F.filter((D) => {
5062
5062
  var C;
5063
5063
  return ((C = D == null ? void 0 : D.customCardPreferences) == null ? void 0 : C.visualType) !== "multiple";
5064
5064
  }).map((D) => ({
@@ -5078,7 +5078,7 @@ function tc() {
5078
5078
  {
5079
5079
  className: "col-span-6 h-8 w-full justify-between",
5080
5080
  label: "",
5081
- options: v || [],
5081
+ options: x || [],
5082
5082
  value: ((M = (k = t == null ? void 0 : t.dataInputCardIds) == null ? void 0 : k[C]) == null ? void 0 : M.cardId) || "",
5083
5083
  onValueChange: (T) => u(C, T)
5084
5084
  }
@@ -5089,45 +5089,45 @@ function tc() {
5089
5089
  );
5090
5090
  }) });
5091
5091
  }
5092
- function x(g, v, F = [], E = "") {
5092
+ function v(g, x, F = [], E = "") {
5093
5093
  var D, C;
5094
5094
  return t ? g === "input" ? /* @__PURE__ */ e(
5095
5095
  we,
5096
5096
  {
5097
5097
  className: `h-8 w-full ${We}`,
5098
- value: ((D = t == null ? void 0 : t.settings) == null ? void 0 : D[v]) || E,
5098
+ value: ((D = t == null ? void 0 : t.settings) == null ? void 0 : D[x]) || E,
5099
5099
  onChange: (k) => {
5100
5100
  c({
5101
5101
  ...t,
5102
5102
  settings: {
5103
5103
  ...t == null ? void 0 : t.settings,
5104
- [v]: k.target.value
5104
+ [x]: k.target.value
5105
5105
  }
5106
5106
  });
5107
5107
  }
5108
5108
  },
5109
- v
5109
+ x
5110
5110
  ) : g === "select" ? /* @__PURE__ */ e(
5111
5111
  Oe,
5112
5112
  {
5113
5113
  className: "h-8 w-full",
5114
5114
  label: "",
5115
5115
  options: F,
5116
- value: ((C = t == null ? void 0 : t.settings) == null ? void 0 : C[v]) || E,
5116
+ value: ((C = t == null ? void 0 : t.settings) == null ? void 0 : C[x]) || E,
5117
5117
  onValueChange: (k) => {
5118
5118
  c({
5119
5119
  ...t,
5120
- settings: { ...t == null ? void 0 : t.settings, [v]: k }
5120
+ settings: { ...t == null ? void 0 : t.settings, [x]: k }
5121
5121
  });
5122
5122
  }
5123
5123
  }
5124
5124
  ) : null : null;
5125
5125
  }
5126
5126
  function N(g) {
5127
- const v = Object.entries((g == null ? void 0 : g.settings) || {});
5128
- return /* @__PURE__ */ e("div", { className: "space-y-3", children: v.map(([F, E]) => /* @__PURE__ */ s("div", { className: "space-y-1", children: [
5127
+ const x = Object.entries((g == null ? void 0 : g.settings) || {});
5128
+ return /* @__PURE__ */ e("div", { className: "space-y-3", children: x.map(([F, E]) => /* @__PURE__ */ s("div", { className: "space-y-1", children: [
5129
5129
  /* @__PURE__ */ e(K, { children: E.title }),
5130
- x(
5130
+ v(
5131
5131
  E.ui,
5132
5132
  F,
5133
5133
  E.options,
@@ -5232,7 +5232,7 @@ function Ct() {
5232
5232
  l && a(new Array(l.length).fill(!1));
5233
5233
  }, [l]);
5234
5234
  function c(h, u) {
5235
- var m, x;
5235
+ var m, v;
5236
5236
  u ? n != null && n.onClickFilter && ((m = n == null ? void 0 : n.onClickFilter) == null ? void 0 : m.length) > 0 ? i({
5237
5237
  ...n,
5238
5238
  onClickFilter: [
@@ -5252,7 +5252,7 @@ function Ct() {
5252
5252
  ]
5253
5253
  }) : (i({
5254
5254
  ...n,
5255
- onClickFilter: (x = n == null ? void 0 : n.onClickFilter) == null ? void 0 : x.filter(
5255
+ onClickFilter: (v = n == null ? void 0 : n.onClickFilter) == null ? void 0 : v.filter(
5256
5256
  (N) => N.columnIndex !== h
5257
5257
  )
5258
5258
  }), a((N) => {
@@ -5261,8 +5261,8 @@ function Ct() {
5261
5261
  }));
5262
5262
  }
5263
5263
  function d(h, u) {
5264
- var x;
5265
- const m = (x = n == null ? void 0 : n.onClickFilter) == null ? void 0 : x.map((N) => N.columnIndex === h ? {
5264
+ var v;
5265
+ const m = (v = n == null ? void 0 : n.onClickFilter) == null ? void 0 : v.map((N) => N.columnIndex === h ? {
5266
5266
  ...N,
5267
5267
  expression: u.target.value
5268
5268
  } : N);
@@ -5272,12 +5272,12 @@ function Ct() {
5272
5272
  });
5273
5273
  }
5274
5274
  function o(h) {
5275
- var u, m, x, N;
5275
+ var u, m, v, N;
5276
5276
  if (t != null && t[h] || (m = (u = n == null ? void 0 : n.onClickFilter) == null ? void 0 : u.find((w) => w.columnIndex === h)) != null && m.expression)
5277
5277
  return /* @__PURE__ */ e(
5278
5278
  we,
5279
5279
  {
5280
- value: (N = (x = n == null ? void 0 : n.onClickFilter) == null ? void 0 : x.find((w) => w.columnIndex === h)) == null ? void 0 : N.expression,
5280
+ value: (N = (v = n == null ? void 0 : n.onClickFilter) == null ? void 0 : v.find((w) => w.columnIndex === h)) == null ? void 0 : N.expression,
5281
5281
  onChange: (w) => d(h, w),
5282
5282
  type: "text",
5283
5283
  className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
@@ -5288,7 +5288,7 @@ function Ct() {
5288
5288
  return /* @__PURE__ */ s("div", { className: "max-h-[150px] space-y-2 overflow-y-auto", children: [
5289
5289
  /* @__PURE__ */ e(K, { children: "On Click" }),
5290
5290
  l == null ? void 0 : l.map((h, u) => {
5291
- var m, x;
5291
+ var m, v;
5292
5292
  return /* @__PURE__ */ e(
5293
5293
  "div",
5294
5294
  {
@@ -5311,7 +5311,7 @@ function Ct() {
5311
5311
  children: h
5312
5312
  }
5313
5313
  ),
5314
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: ((x = n == null ? void 0 : n.onClickFilter) == null ? void 0 : x.find(
5314
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: ((v = n == null ? void 0 : n.onClickFilter) == null ? void 0 : v.find(
5315
5315
  (N) => N.columnIndex === u
5316
5316
  )) && /* @__PURE__ */ e(
5317
5317
  os,
@@ -5369,12 +5369,12 @@ function nc({ idx: t }) {
5369
5369
  else {
5370
5370
  const m = { ...l };
5371
5371
  m.datalabels = u;
5372
- const x = n == null ? void 0 : n.map(
5372
+ const v = n == null ? void 0 : n.map(
5373
5373
  (N) => N.idx === h ? m : N
5374
5374
  );
5375
5375
  r({
5376
5376
  ...a,
5377
- datasetOptions: x
5377
+ datasetOptions: v
5378
5378
  });
5379
5379
  }
5380
5380
  }
@@ -5525,8 +5525,8 @@ function hr({
5525
5525
  return (m = u.card) == null ? void 0 : m.preferences;
5526
5526
  }), c = S(
5527
5527
  (u) => {
5528
- var m, x;
5529
- return (x = (m = u.card) == null ? void 0 : m.preferences) == null ? void 0 : x.datasetOptions;
5528
+ var m, v;
5529
+ return (v = (m = u.card) == null ? void 0 : m.preferences) == null ? void 0 : v.datasetOptions;
5530
5530
  }
5531
5531
  ), d = c == null ? void 0 : c.find((u) => u.idx === a), { setCardPreferences: o } = S((u) => u.actions);
5532
5532
  function h(u) {
@@ -5545,12 +5545,12 @@ function hr({
5545
5545
  else {
5546
5546
  const m = { ...d };
5547
5547
  m.type = u === "area" ? "line" : u, m.fill = u === "area" ? "origin" : "";
5548
- const x = c == null ? void 0 : c.map(
5548
+ const v = c == null ? void 0 : c.map(
5549
5549
  (N) => N.idx === a ? m : N
5550
5550
  );
5551
5551
  o({
5552
5552
  ...l,
5553
- datasetOptions: x
5553
+ datasetOptions: v
5554
5554
  });
5555
5555
  }
5556
5556
  }
@@ -5602,12 +5602,12 @@ function hr({
5602
5602
  }
5603
5603
  function pr() {
5604
5604
  const t = S((N) => N.selectedConnectionId), a = S((N) => N.selectedDatamodelId), n = S((N) => N.selectedDatabaseName), r = S((N) => N.selectedSchemaName), i = S((N) => N.selectedTableName), l = G((N) => N.dashboard.filters) || [], c = G((N) => N.actions.addFilter), d = G((N) => N.actions.removeFilter), { removeFilterValues: o } = Dt(), { modelItems: h, tableName: u, connectionType: m } = Ve();
5605
- function x(N, w = "dashboard") {
5605
+ function v(N, w = "dashboard") {
5606
5606
  var k;
5607
- const f = Le(N.column_name), I = Le(n || ""), g = Le(r || ""), v = Le(u);
5607
+ const f = Le(N.column_name), I = Le(n || ""), g = Le(r || ""), x = Le(u);
5608
5608
  let F = Ti({
5609
5609
  schemaName: g,
5610
- tableName: v,
5610
+ tableName: x,
5611
5611
  connectionType: m,
5612
5612
  databaseName: I
5613
5613
  }), E = `${F}.${f}`;
@@ -5616,7 +5616,7 @@ function pr() {
5616
5616
  )) == null ? void 0 : k.name;
5617
5617
  a && a !== "none" && (E = `${Pa}.${D}.${f}`, F = `${Pa}.${D}`);
5618
5618
  const C = l == null ? void 0 : l.find(
5619
- (M) => M.column === E && M.table === v && (M.database === I || M.database === n)
5619
+ (M) => M.column === E && M.table === x && (M.database === I || M.database === n)
5620
5620
  );
5621
5621
  if (C)
5622
5622
  o(C.id), d(C.id);
@@ -5661,7 +5661,7 @@ function pr() {
5661
5661
  }), M);
5662
5662
  }
5663
5663
  }
5664
- return { assignFilter: x };
5664
+ return { assignFilter: v };
5665
5665
  }
5666
5666
  function At() {
5667
5667
  const t = G(
@@ -6180,7 +6180,7 @@ const mc = [
6180
6180
  value: t
6181
6181
  }));
6182
6182
  function fc() {
6183
- var o, h, u, m, x, N, w, f, I, g, v, F, E, D, C, k, M, T;
6183
+ var o, h, u, m, v, N, w, f, I, g, x, F, E, D, C, k, M, T;
6184
6184
  const t = S((y) => y.card), a = (h = (o = t == null ? void 0 : t.preferences) == null ? void 0 : o.mapVisualOptions) == null ? void 0 : h.topoJsonUrl, [n, r] = B(
6185
6185
  ((m = (u = t == null ? void 0 : t.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : m.customTopoJsonUrl) || ""
6186
6186
  ), { setCardPreferences: i } = X(), { data: l } = ta(t), c = Object.keys((l == null ? void 0 : l.objects) || {}).map((y) => ({
@@ -6251,7 +6251,7 @@ function fc() {
6251
6251
  {
6252
6252
  className: "h-9",
6253
6253
  options: c,
6254
- value: ((N = (x = t.preferences) == null ? void 0 : x.mapVisualOptions) == null ? void 0 : N.objectKey) || "",
6254
+ value: ((N = (v = t.preferences) == null ? void 0 : v.mapVisualOptions) == null ? void 0 : N.objectKey) || "",
6255
6255
  label: "Map Object",
6256
6256
  onValueChange: (y) => {
6257
6257
  var p;
@@ -6320,7 +6320,7 @@ function fc() {
6320
6320
  className: `h-9 w-full ${We}`,
6321
6321
  type: "number",
6322
6322
  step: 0.1,
6323
- value: ((F = (v = t.preferences) == null ? void 0 : v.mapVisualOptions) == null ? void 0 : F.projectionScale) || 1,
6323
+ value: ((F = (x = t.preferences) == null ? void 0 : x.mapVisualOptions) == null ? void 0 : F.projectionScale) || 1,
6324
6324
  onChange: (y) => {
6325
6325
  var p;
6326
6326
  i({
@@ -6889,12 +6889,12 @@ function Tc({
6889
6889
  attributes: h,
6890
6890
  listeners: u,
6891
6891
  setNodeRef: m,
6892
- transform: x,
6892
+ transform: v,
6893
6893
  transition: N,
6894
6894
  isDragging: w
6895
- } = Ot({ id: t.id, data: { type: a } }), f = x ? {
6895
+ } = Ot({ id: t.id, data: { type: a } }), f = v ? {
6896
6896
  opacity: w ? 0.5 : void 0,
6897
- transform: st.Translate.toString(x),
6897
+ transform: st.Translate.toString(v),
6898
6898
  transition: N
6899
6899
  } : void 0, I = Pe(t.type);
6900
6900
  function g(C) {
@@ -6960,7 +6960,7 @@ function Tc({
6960
6960
  d(t.id, p);
6961
6961
  }
6962
6962
  }
6963
- function v() {
6963
+ function x() {
6964
6964
  if (r === ht)
6965
6965
  return /* @__PURE__ */ e(
6966
6966
  "div",
@@ -7027,7 +7027,7 @@ function Tc({
7027
7027
  F(),
7028
7028
  E()
7029
7029
  ] }),
7030
- i && v()
7030
+ i && x()
7031
7031
  ] }),
7032
7032
  /* @__PURE__ */ e(
7033
7033
  "div",
@@ -7055,11 +7055,11 @@ function Vn({
7055
7055
  const { setNodeRef: c, isOver: d, over: o } = ia({
7056
7056
  id: t
7057
7057
  }), h = nt((g) => g.activeId), u = S((g) => {
7058
- var v;
7059
- return (v = g.card) == null ? void 0 : v.type;
7060
- }), m = d || ((I = (f = o == null ? void 0 : o.data) == null ? void 0 : f.current) == null ? void 0 : I.type) === i, x = h ? r : n, N = i === en ? "Rows" : i === tn ? "Pivot Columns" : "Columns";
7058
+ var x;
7059
+ return (x = g.card) == null ? void 0 : x.type;
7060
+ }), m = d || ((I = (f = o == null ? void 0 : o.data) == null ? void 0 : f.current) == null ? void 0 : I.type) === i, v = h ? r : n, N = i === en ? "Rows" : i === tn ? "Pivot Columns" : "Columns";
7061
7061
  function w() {
7062
- if (!x || x.length === 0)
7062
+ if (!v || v.length === 0)
7063
7063
  return /* @__PURE__ */ e("div", { className: "mr-5 flex h-8 grow items-center space-x-2 rounded-md border border-dashed border-muted-foreground/80 bg-background px-2 py-1 text-sm text-muted-foreground", children: /* @__PURE__ */ e("span", { className: "invisible text-muted-foreground/70 group-hover:visible", children: "Drag here" }) });
7064
7064
  }
7065
7065
  return /* @__PURE__ */ e($e, { items: n == null ? void 0 : n.map((g) => g.id), children: /* @__PURE__ */ s(
@@ -7077,7 +7077,7 @@ function Vn({
7077
7077
  u !== "table" && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground/50", children: N })
7078
7078
  ] }),
7079
7079
  w(),
7080
- /* @__PURE__ */ e("div", { className: "space-y-2", children: x == null ? void 0 : x.map(
7080
+ /* @__PURE__ */ e("div", { className: "space-y-2", children: v == null ? void 0 : v.map(
7081
7081
  (g) => g.id === Qs.id ? /* @__PURE__ */ e(Ic, {}, g.id) : /* @__PURE__ */ e(
7082
7082
  Tc,
7083
7083
  {
@@ -7113,36 +7113,36 @@ function yr({ children: t, id: a, type: n }) {
7113
7113
  }
7114
7114
  function Oc() {
7115
7115
  const t = S((g) => {
7116
- var v;
7117
- return (v = g.card.queryConfig) == null ? void 0 : v.orderBy;
7116
+ var x;
7117
+ return (x = g.card.queryConfig) == null ? void 0 : x.orderBy;
7118
7118
  }) || [], a = S((g) => {
7119
- var v;
7120
- return (v = g.card.queryConfig) == null ? void 0 : v.groupByColumns;
7119
+ var x;
7120
+ return (x = g.card.queryConfig) == null ? void 0 : x.groupByColumns;
7121
7121
  }) || [], n = S((g) => {
7122
- var v;
7123
- return (v = g.card.queryConfig) == null ? void 0 : v.metricColumns;
7122
+ var x;
7123
+ return (x = g.card.queryConfig) == null ? void 0 : x.metricColumns;
7124
7124
  }) || [], { addOrderByColumn: r, removeOrderByColumn: i, updateOrderByColumn: l } = X(), c = [...a, ...n];
7125
7125
  if (c.length === 0)
7126
7126
  return /* @__PURE__ */ e(ne, {});
7127
- const d = /* @__PURE__ */ e(kl, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), o = /* @__PURE__ */ e(vl, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), h = /* @__PURE__ */ e(wl, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), u = /* @__PURE__ */ e(xl, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), m = c == null ? void 0 : c.filter((g) => !t.some((v) => v.columnId === g.id)).map((g) => ({
7127
+ const d = /* @__PURE__ */ e(kl, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), o = /* @__PURE__ */ e(vl, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), h = /* @__PURE__ */ e(wl, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), u = /* @__PURE__ */ e(xl, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), m = c == null ? void 0 : c.filter((g) => !t.some((x) => x.columnId === g.id)).map((g) => ({
7128
7128
  id: g.id,
7129
7129
  value: g.label || g.name
7130
7130
  }));
7131
- function x(g, v) {
7131
+ function v(g, x) {
7132
7132
  const F = N(g);
7133
- return F ? F.role === "metric" ? v === "asc" ? h : u : v === "asc" ? d : o : null;
7133
+ return F ? F.role === "metric" ? x === "asc" ? h : u : x === "asc" ? d : o : null;
7134
7134
  }
7135
7135
  function N(g) {
7136
- return c.find((v) => v.id === g);
7136
+ return c.find((x) => x.id === g);
7137
7137
  }
7138
7138
  function w(g) {
7139
- const v = t.find(
7139
+ const x = t.find(
7140
7140
  (F) => F.columnId === g
7141
7141
  );
7142
- if (v) {
7142
+ if (x) {
7143
7143
  const F = {
7144
- ...v,
7145
- direction: v.direction === "asc" ? "desc" : "asc"
7144
+ ...x,
7145
+ direction: x.direction === "asc" ? "desc" : "asc"
7146
7146
  };
7147
7147
  l(F);
7148
7148
  }
@@ -7154,10 +7154,10 @@ function Oc() {
7154
7154
  });
7155
7155
  };
7156
7156
  function I(g) {
7157
- const v = t.find(
7157
+ const x = t.find(
7158
7158
  (F) => F.columnId === g
7159
7159
  );
7160
- v && i(v);
7160
+ x && i(x);
7161
7161
  }
7162
7162
  return /* @__PURE__ */ e(
7163
7163
  $e,
@@ -7179,7 +7179,7 @@ function Oc() {
7179
7179
  }
7180
7180
  ) }),
7181
7181
  t.map((g) => {
7182
- var v, F;
7182
+ var x, F;
7183
7183
  return /* @__PURE__ */ e(
7184
7184
  yr,
7185
7185
  {
@@ -7193,7 +7193,7 @@ function Oc() {
7193
7193
  /* @__PURE__ */ s("div", { className: "flex h-full grow items-center justify-between gap-2 rounded-sm bg-muted px-2", children: [
7194
7194
  /* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
7195
7195
  /* @__PURE__ */ e(_s, { className: "size-3 cursor-move text-muted-foreground hover:text-foreground" }),
7196
- /* @__PURE__ */ e(Ma, { className: "w-[175px] text-sm", children: ((v = N(g.columnId)) == null ? void 0 : v.label) || ((F = N(g.columnId)) == null ? void 0 : F.name) })
7196
+ /* @__PURE__ */ e(Ma, { className: "w-[175px] text-sm", children: ((x = N(g.columnId)) == null ? void 0 : x.label) || ((F = N(g.columnId)) == null ? void 0 : F.name) })
7197
7197
  ] }),
7198
7198
  /* @__PURE__ */ e(
7199
7199
  "button",
@@ -7201,7 +7201,7 @@ function Oc() {
7201
7201
  title: g.direction === "asc" ? "Ascending" : "Descending",
7202
7202
  onClick: () => w(g.columnId),
7203
7203
  className: "rounded-sm p-0",
7204
- children: x(g.columnId, g.direction)
7204
+ children: v(g.columnId, g.direction)
7205
7205
  }
7206
7206
  )
7207
7207
  ] }),
@@ -7259,7 +7259,7 @@ function Ec() {
7259
7259
  function m(I) {
7260
7260
  o(I);
7261
7261
  }
7262
- function x(I) {
7262
+ function v(I) {
7263
7263
  h(I);
7264
7264
  }
7265
7265
  let N = "Group By", w = "Metrics", f = "Stack By";
@@ -7281,7 +7281,7 @@ function Ec() {
7281
7281
  /* @__PURE__ */ e(
7282
7282
  Vn,
7283
7283
  {
7284
- onRemoveColumn: x,
7284
+ onRemoveColumn: v,
7285
7285
  sortableType: tn,
7286
7286
  id: pt,
7287
7287
  label: f,
@@ -7315,8 +7315,8 @@ function Da({
7315
7315
  }) {
7316
7316
  const [l, c] = B(!1), { removeEditorFilter: d, clearEditorFilter: o } = X(), h = S(
7317
7317
  (m) => {
7318
- var x, N;
7319
- return (N = (x = m.card.queryConfig) == null ? void 0 : x.filters) == null ? void 0 : N.some(
7318
+ var v, N;
7319
+ return (N = (v = m.card.queryConfig) == null ? void 0 : v.filters) == null ? void 0 : N.some(
7320
7320
  (w) => w.filterColumnName === a.name
7321
7321
  );
7322
7322
  }
@@ -7410,9 +7410,9 @@ function Ac({
7410
7410
  connectionId: l,
7411
7411
  // not needed
7412
7412
  dataType: t.type
7413
- }, { data: x, isLoading: N, isFetching: w, isError: f } = js(m), I = at(() => {
7413
+ }, { data: v, isLoading: N, isFetching: w, isError: f } = js(m), I = at(() => {
7414
7414
  var E;
7415
- return m.column ? (E = x == null ? void 0 : x.records) == null ? void 0 : E.map((D) => {
7415
+ return m.column ? (E = v == null ? void 0 : v.records) == null ? void 0 : E.map((D) => {
7416
7416
  let C = m.column.split(".").slice(-1)[0].replace(/"/g, "");
7417
7417
  return D[C] === void 0 && (C = C.toLowerCase()), {
7418
7418
  id: D[C],
@@ -7421,12 +7421,12 @@ function Ac({
7421
7421
  // this is needed if
7422
7422
  };
7423
7423
  }) : [];
7424
- }, [x, m.column]);
7424
+ }, [v, m.column]);
7425
7425
  function g(F) {
7426
7426
  const E = F.map((D) => D.id);
7427
7427
  u(t.name, E);
7428
7428
  }
7429
- function v() {
7429
+ function x() {
7430
7430
  return N || w ? /* @__PURE__ */ e(
7431
7431
  Xn,
7432
7432
  {
@@ -7456,7 +7456,7 @@ function Ac({
7456
7456
  id: t.id,
7457
7457
  sortableType: a,
7458
7458
  column: t,
7459
- children: v()
7459
+ children: x()
7460
7460
  }
7461
7461
  );
7462
7462
  }
@@ -7500,7 +7500,7 @@ function Fc({
7500
7500
  title: "",
7501
7501
  // not needed
7502
7502
  dataType: t.type
7503
- }, { isLoading: o, isFetching: h, isError: u, data: m } = js(d), x = m == null ? void 0 : m.records, { dateRange: N, setDateRange: w, initialDateRange: f } = zi(x), { updateEditorFilterValue: I } = X();
7503
+ }, { isLoading: o, isFetching: h, isError: u, data: m } = js(d), v = m == null ? void 0 : m.records, { dateRange: N, setDateRange: w, initialDateRange: f } = zi(v), { updateEditorFilterValue: I } = X();
7504
7504
  function g(E) {
7505
7505
  var C, k;
7506
7506
  const D = {
@@ -7509,11 +7509,11 @@ function Fc({
7509
7509
  };
7510
7510
  I(t.name, D);
7511
7511
  }
7512
- function v() {
7512
+ function x() {
7513
7513
  I(t.name, null, !0), w(f);
7514
7514
  }
7515
7515
  function F() {
7516
- return o || h ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(Xn, { className: "h-8 w-72 bg-foreground/10" }) }) : u ? /* @__PURE__ */ e("div", { className: "h-8 w-72 bg-muted px-2", children: "Error" }) : x ? /* @__PURE__ */ e(
7516
+ return o || h ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(Xn, { className: "h-8 w-72 bg-foreground/10" }) }) : u ? /* @__PURE__ */ e("div", { className: "h-8 w-72 bg-muted px-2", children: "Error" }) : v ? /* @__PURE__ */ e(
7517
7517
  Fi,
7518
7518
  {
7519
7519
  title: d.title,
@@ -7523,7 +7523,7 @@ function Fc({
7523
7523
  dateRange: N,
7524
7524
  setDateRange: w,
7525
7525
  onApply: g,
7526
- onClear: v
7526
+ onClear: x
7527
7527
  }
7528
7528
  ) : /* @__PURE__ */ e(K, { className: "flex h-8 w-72 items-center bg-muted px-2", children: "No Data" });
7529
7529
  }
@@ -7555,7 +7555,7 @@ function Lc({
7555
7555
  if (!N || N.length === 0)
7556
7556
  return /* @__PURE__ */ e("div", { className: "flex h-8 grow items-center space-x-2 rounded-md border border-dashed border-muted-foreground/80 bg-background px-2 py-1 text-sm text-muted-foreground", children: /* @__PURE__ */ e("span", { className: "invisible text-muted-foreground/70 group-hover:visible", children: "Drag here" }) });
7557
7557
  }
7558
- function x(I) {
7558
+ function v(I) {
7559
7559
  const g = Re(I.type);
7560
7560
  return I.id === Qs.id ? /* @__PURE__ */ e(
7561
7561
  Da,
@@ -7597,7 +7597,7 @@ function Lc({
7597
7597
  children: [
7598
7598
  /* @__PURE__ */ e(K, { className: "text-sm", children: a }),
7599
7599
  m(),
7600
- /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-4", children: N == null ? void 0 : N.map((I) => x(I)) })
7600
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-4", children: N == null ? void 0 : N.map((I) => v(I)) })
7601
7601
  ]
7602
7602
  }
7603
7603
  ) });
@@ -7757,10 +7757,10 @@ function Rc(t) {
7757
7757
  }), {
7758
7758
  setCardPython: u,
7759
7759
  setCardSql: m,
7760
- setRunSql: x,
7760
+ setRunSql: v,
7761
7761
  switchCardType: N,
7762
7762
  setQueryConfig: w
7763
- } = X(), f = S((Y) => Y.currentAssitantScope) || [], I = S((Y) => Y.userInputForAI), g = S((Y) => Y.triggerAIRun), v = S((Y) => Y.card), F = S(
7763
+ } = X(), f = S((Y) => Y.currentAssitantScope) || [], I = S((Y) => Y.userInputForAI), g = S((Y) => Y.triggerAIRun), x = S((Y) => Y.card), F = S(
7764
7764
  (Y) => Y.selectedDatabaseName
7765
7765
  ), E = S((Y) => Y.selectedTableName), D = S(
7766
7766
  (Y) => Y.selectedConnectionId
@@ -7772,7 +7772,7 @@ function Rc(t) {
7772
7772
  errorMessage: M,
7773
7773
  refetch: T,
7774
7774
  data: y
7775
- } = Se(v), { setTriggerAIRun: p, setCurrentAssitantScope: L, setCardConfig: z } = X(), { selectedDatamodelName: O, connectionType: b, selectedDatamodelId: A } = Ve(), {
7775
+ } = Se(x), { setTriggerAIRun: p, setCurrentAssitantScope: L, setCardConfig: z } = X(), { selectedDatamodelName: O, connectionType: b, selectedDatamodelId: A } = Ve(), {
7776
7776
  messages: V,
7777
7777
  setMessages: P,
7778
7778
  reload: J,
@@ -7817,7 +7817,7 @@ function Rc(t) {
7817
7817
  var se, ze, Ue, ot;
7818
7818
  if (["createChartFromSql", "createForecast"].includes(Y.toolName)) {
7819
7819
  const le = Y.args.sql, be = Y.args.python, Ne = Y.args.chartType;
7820
- return N(Ne), m(le), u(be), x(!0), {
7820
+ return N(Ne), m(le), u(be), v(!0), {
7821
7821
  status: "success",
7822
7822
  message: "Let the user know that chart is created"
7823
7823
  // query: sql,
@@ -7955,9 +7955,9 @@ const qc = [
7955
7955
  }
7956
7956
  ];
7957
7957
  function Qa() {
7958
- const t = Ge(null), a = Ge(null), [n, r] = B(!1), [i, l] = B(is), [c, d] = B(!1), [o, h] = B(!1), u = qi(), { setCurrentAIContext: m } = _i(), x = G((W) => W.dashboard.aiContext), N = S((W) => W.card.dataSource), w = S((W) => W.actions.setCardSql), f = S((W) => W.actions.setRunSql), I = S((W) => W.showAIDialog), g = G(
7958
+ const t = Ge(null), a = Ge(null), [n, r] = B(!1), [i, l] = B(is), [c, d] = B(!1), [o, h] = B(!1), u = qi(), { setCurrentAIContext: m } = _i(), v = G((W) => W.dashboard.aiContext), N = S((W) => W.card.dataSource), w = S((W) => W.actions.setCardSql), f = S((W) => W.actions.setRunSql), I = S((W) => W.showAIDialog), g = G(
7959
7959
  (W) => W.handleOpenAssistantProfile
7960
- ), { setShowAIDialog: v, setCardPython: F } = X(), { setDataSource: E } = X(), { assistantProfile: D } = $i(), {
7960
+ ), { setShowAIDialog: x, setCardPython: F } = X(), { setDataSource: E } = X(), { assistantProfile: D } = $i(), {
7961
7961
  messages: C,
7962
7962
  setMessages: k,
7963
7963
  reload: M,
@@ -7987,11 +7987,11 @@ function Qa() {
7987
7987
  }
7988
7988
  function j() {
7989
7989
  var W;
7990
- (W = x == null ? void 0 : x.selectedEntities) == null || W[0], h(!0);
7990
+ (W = v == null ? void 0 : v.selectedEntities) == null || W[0], h(!0);
7991
7991
  }
7992
7992
  function re() {
7993
7993
  u.selectedEntities.length === 0 && m({
7994
- selectedEntities: (x == null ? void 0 : x.selectedEntities) || []
7994
+ selectedEntities: (v == null ? void 0 : v.selectedEntities) || []
7995
7995
  });
7996
7996
  }
7997
7997
  function $(W) {
@@ -8097,7 +8097,7 @@ function Qa() {
8097
8097
  className: "h-8",
8098
8098
  size: "sm",
8099
8099
  onClick: () => {
8100
- v(!1);
8100
+ x(!1);
8101
8101
  },
8102
8102
  children: /* @__PURE__ */ e(Hi, { className: "size-4" })
8103
8103
  }
@@ -8201,7 +8201,7 @@ function _c({ field: t }) {
8201
8201
  } = Ot({ id: t.id }), [d, o] = B(!1), h = {
8202
8202
  transform: st.Transform.toString(i),
8203
8203
  transition: l
8204
- }, u = qe(t.dataType), x = ((N) => {
8204
+ }, u = qe(t.dataType), v = ((N) => {
8205
8205
  const w = (N || "").toLowerCase();
8206
8206
  switch (qe(w)) {
8207
8207
  case "number":
@@ -8235,7 +8235,7 @@ function _c({ field: t }) {
8235
8235
  children: [
8236
8236
  /* @__PURE__ */ e("div", { className: "flex-shrink-0 hover:cursor-grab active:cursor-grabbing", children: /* @__PURE__ */ e(Et, { className: "invisible size-3.5 text-gray-400 group-hover/container:visible" }) }),
8237
8237
  /* @__PURE__ */ e(
8238
- x,
8238
+ v,
8239
8239
  {
8240
8240
  className: R(
8241
8241
  "size-3.5 flex-shrink-0 text-gray-500",
@@ -8274,7 +8274,7 @@ function _c({ field: t }) {
8274
8274
  ] }),
8275
8275
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2.5", children: [
8276
8276
  /* @__PURE__ */ e(
8277
- x,
8277
+ v,
8278
8278
  {
8279
8279
  className: R(
8280
8280
  "size-3 flex-shrink-0 text-gray-500",
@@ -8377,8 +8377,8 @@ function Gc() {
8377
8377
  error: u
8378
8378
  } = Cn(), m = d.filter(
8379
8379
  (E) => E.name.toLowerCase().includes(t.toLowerCase()) || E.dataType.toLowerCase().includes(t.toLowerCase()) || E.qualifiedEntityName && E.qualifiedEntityName.toLowerCase().includes(t.toLowerCase())
8380
- ), x = (E) => E.dataType === "number" || E.dataType === "integer" || E.dataType === "float" || E.dataType === "decimal" || E.dataType === "currency" ? "metrics" : "dimensions", w = (i === "all" ? m : m.filter(
8381
- (E) => x(E) === i
8380
+ ), v = (E) => E.dataType === "number" || E.dataType === "integer" || E.dataType === "float" || E.dataType === "decimal" || E.dataType === "currency" ? "metrics" : "dimensions", w = (i === "all" ? m : m.filter(
8381
+ (E) => v(E) === i
8382
8382
  )).reduce((E, D) => {
8383
8383
  const C = D.qualifiedEntityName || "Other Fields";
8384
8384
  return E[C] || (E[C] = {
@@ -8394,11 +8394,11 @@ function Gc() {
8394
8394
  const D = new Set(n);
8395
8395
  D.has(E) ? D.delete(E) : D.add(E), r(D);
8396
8396
  }, I = m.filter(
8397
- (E) => x(E) === "dimensions"
8397
+ (E) => v(E) === "dimensions"
8398
8398
  ).length, g = m.filter(
8399
- (E) => x(E) === "metrics"
8400
- ).length, v = m.filter(
8401
- (E) => x(E) === "calculated"
8399
+ (E) => v(E) === "metrics"
8400
+ ).length, x = m.filter(
8401
+ (E) => v(E) === "calculated"
8402
8402
  ).length, F = m.length > 0;
8403
8403
  return h ? /* @__PURE__ */ s("div", { className: "flex h-[calc(100vh-200px)] w-[290px] flex-col items-center justify-center", children: [
8404
8404
  /* @__PURE__ */ e(Te, { className: "h-8 w-8 animate-spin text-gray-400" }),
@@ -8444,7 +8444,7 @@ function Gc() {
8444
8444
  ] }),
8445
8445
  /* @__PURE__ */ s(Me, { value: "calculated", className: "text-xs", children: [
8446
8446
  /* @__PURE__ */ e(Il, { className: "size-4 shrink-0" }),
8447
- /* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children: v })
8447
+ /* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children: x })
8448
8448
  ] })
8449
8449
  ] })
8450
8450
  }
@@ -8772,13 +8772,13 @@ function Yc({
8772
8772
  setJoinPlan: h,
8773
8773
  addJoin: u,
8774
8774
  removeJoin: m,
8775
- updateJoin: x,
8775
+ updateJoin: v,
8776
8776
  moveJoinUp: N,
8777
8777
  moveJoinDown: w,
8778
8778
  toggleJoinExpansion: f,
8779
8779
  getAvailableSourceEntities: I,
8780
8780
  getAvailableTargetEntities: g,
8781
- addJoinKeyGroup: v,
8781
+ addJoinKeyGroup: x,
8782
8782
  updateGroupOperator: F,
8783
8783
  removeJoinKeyGroup: E,
8784
8784
  addJoinKey: D,
@@ -8927,7 +8927,7 @@ function Yc({
8927
8927
  const A = a.find(
8928
8928
  (V) => V.name === b
8929
8929
  );
8930
- x(p.id, {
8930
+ v(p.id, {
8931
8931
  source: {
8932
8932
  connectionId: (A == null ? void 0 : A.connectionId) || "",
8933
8933
  connectionType: (A == null ? void 0 : A.connectionType) || "none",
@@ -8971,7 +8971,7 @@ function Yc({
8971
8971
  oe,
8972
8972
  {
8973
8973
  value: p.joinType,
8974
- onValueChange: (b) => x(p.id, {
8974
+ onValueChange: (b) => v(p.id, {
8975
8975
  joinType: b
8976
8976
  }),
8977
8977
  children: [
@@ -9024,7 +9024,7 @@ function Yc({
9024
9024
  const A = a.find(
9025
9025
  (V) => V.name === b
9026
9026
  );
9027
- x(p.id, {
9027
+ v(p.id, {
9028
9028
  target: {
9029
9029
  connectionId: (A == null ? void 0 : A.connectionId) || "",
9030
9030
  connectionType: (A == null ? void 0 : A.connectionType) || "none",
@@ -9081,7 +9081,7 @@ function Yc({
9081
9081
  type: "button",
9082
9082
  variant: "outline",
9083
9083
  size: "sm",
9084
- onClick: () => v(p.id),
9084
+ onClick: () => x(p.id),
9085
9085
  children: [
9086
9086
  /* @__PURE__ */ e(ke, { className: "mr-1 h-3 w-3" }),
9087
9087
  " Add Condition Group"
@@ -9118,7 +9118,14 @@ function Yc({
9118
9118
  children: [
9119
9119
  /* @__PURE__ */ e(ce, { className: "w-[100px]", children: /* @__PURE__ */ e(de, {}) }),
9120
9120
  /* @__PURE__ */ s(ue, { children: [
9121
- /* @__PURE__ */ e(U, { value: "AND", children: "AND" }),
9121
+ /* @__PURE__ */ e(
9122
+ U,
9123
+ {
9124
+ className: "hover:bg-muted",
9125
+ value: "AND",
9126
+ children: "AND"
9127
+ }
9128
+ ),
9122
9129
  /* @__PURE__ */ e(U, { value: "OR", children: "OR" })
9123
9130
  ] })
9124
9131
  ]
@@ -9164,6 +9171,7 @@ function Yc({
9164
9171
  ).map((J) => /* @__PURE__ */ e(
9165
9172
  U,
9166
9173
  {
9174
+ className: "hover:bg-muted",
9167
9175
  value: J.name,
9168
9176
  children: /* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between", children: [
9169
9177
  /* @__PURE__ */ e("span", { children: J.name }),
@@ -9196,11 +9204,46 @@ function Yc({
9196
9204
  children: [
9197
9205
  /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ e(de, {}) }),
9198
9206
  /* @__PURE__ */ s(ue, { children: [
9199
- /* @__PURE__ */ e(U, { value: "=", children: "=" }),
9200
- /* @__PURE__ */ e(U, { value: "<", children: "<" }),
9201
- /* @__PURE__ */ e(U, { value: ">", children: ">" }),
9202
- /* @__PURE__ */ e(U, { value: "<=", children: "<=" }),
9203
- /* @__PURE__ */ e(U, { value: ">=", children: ">=" })
9207
+ /* @__PURE__ */ e(
9208
+ U,
9209
+ {
9210
+ className: "hover:bg-muted",
9211
+ value: "=",
9212
+ children: "="
9213
+ }
9214
+ ),
9215
+ /* @__PURE__ */ e(
9216
+ U,
9217
+ {
9218
+ className: "hover:bg-muted",
9219
+ value: "<",
9220
+ children: "<"
9221
+ }
9222
+ ),
9223
+ /* @__PURE__ */ e(
9224
+ U,
9225
+ {
9226
+ className: "hover:bg-muted",
9227
+ value: ">",
9228
+ children: ">"
9229
+ }
9230
+ ),
9231
+ /* @__PURE__ */ e(
9232
+ U,
9233
+ {
9234
+ className: "hover:bg-muted",
9235
+ value: "<=",
9236
+ children: "<="
9237
+ }
9238
+ ),
9239
+ /* @__PURE__ */ e(
9240
+ U,
9241
+ {
9242
+ className: "hover:bg-muted",
9243
+ value: ">=",
9244
+ children: ">="
9245
+ }
9246
+ )
9204
9247
  ] })
9205
9248
  ]
9206
9249
  }
@@ -9223,8 +9266,9 @@ function Yc({
9223
9266
  ).map((J) => /* @__PURE__ */ e(
9224
9267
  U,
9225
9268
  {
9269
+ className: "hover:bg-muted",
9226
9270
  value: J.name,
9227
- children: /* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between", children: [
9271
+ children: /* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between hover:bg-muted", children: [
9228
9272
  /* @__PURE__ */ e("span", { children: J.name }),
9229
9273
  /* @__PURE__ */ e(
9230
9274
  ye,
@@ -9426,8 +9470,8 @@ function Kc({
9426
9470
  }
9427
9471
  function Uc() {
9428
9472
  var u, m;
9429
- const t = S((x) => x.card), a = S(
9430
- (x) => x.actions.updateCardConfig
9473
+ const t = S((v) => v.card), a = S(
9474
+ (v) => v.actions.updateCardConfig
9431
9475
  ), n = ((u = t == null ? void 0 : t.config) == null ? void 0 : u.joinPlan) || {
9432
9476
  baseEntity: {
9433
9477
  type: "table",
@@ -9439,10 +9483,10 @@ function Uc() {
9439
9483
  dialect: "none"
9440
9484
  },
9441
9485
  joins: []
9442
- }, [r, i] = B(!1), l = ((m = t == null ? void 0 : t.dataSource) == null ? void 0 : m.selectedEntities) || [], c = (x) => {
9486
+ }, [r, i] = B(!1), l = ((m = t == null ? void 0 : t.dataSource) == null ? void 0 : m.selectedEntities) || [], c = (v) => {
9443
9487
  a(t.id, {
9444
9488
  ...t == null ? void 0 : t.config,
9445
- joinPlan: x
9489
+ joinPlan: v
9446
9490
  }), i(!1);
9447
9491
  }, d = () => {
9448
9492
  a(t.id, {
@@ -9452,14 +9496,14 @@ function Uc() {
9452
9496
  }, o = () => {
9453
9497
  i(!1);
9454
9498
  }, h = () => {
9455
- const x = [...n.joins].sort(
9499
+ const v = [...n.joins].sort(
9456
9500
  (f, I) => f.sequence - I.sequence
9457
9501
  ), N = n.baseEntity;
9458
9502
  if (!N.name)
9459
9503
  return "SELECT * FROM table -- Please select a base entity";
9460
9504
  let w = `SELECT *
9461
9505
  FROM ${N.name}`;
9462
- return x.forEach((f) => {
9506
+ return v.forEach((f) => {
9463
9507
  const I = l.find(
9464
9508
  (F) => F.name === f.target.name
9465
9509
  );
@@ -9474,10 +9518,10 @@ FROM ${N.name}`;
9474
9518
  (D) => `${D.source.entityName}.${D.source.name} ${D.operator} ${D.target.entityName}.${D.target.name}`
9475
9519
  );
9476
9520
  return E.length > 1 ? `(${E.join(` ${F.operator} `)})` : E[0];
9477
- }).filter(Boolean), v = g.length > 1 ? g.join(" OR ") : g[0] || "condition_here";
9521
+ }).filter(Boolean), x = g.length > 1 ? g.join(" OR ") : g[0] || "condition_here";
9478
9522
  w += `
9479
9523
  ${f.joinType} JOIN ${I.name}
9480
- ON ${v}`;
9524
+ ON ${x}`;
9481
9525
  }), w;
9482
9526
  };
9483
9527
  return l.length < 2 ? null : /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e("div", { className: "space-y-4", children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
@@ -9635,7 +9679,7 @@ function Qc() {
9635
9679
  onClick: (u) => {
9636
9680
  u.stopPropagation();
9637
9681
  const m = d.selectedEntities.filter(
9638
- (x) => !(x.name === o.name && x.type === o.type)
9682
+ (v) => !(v.name === o.name && v.type === o.type)
9639
9683
  );
9640
9684
  l({
9641
9685
  ...c,
@@ -9859,16 +9903,16 @@ function td({
9859
9903
  const [n, r] = B(null), [i, l] = B(""), [c, d] = B(""), o = () => {
9860
9904
  a({ ...t, "": "" });
9861
9905
  }, h = (m) => {
9862
- const x = { ...t };
9863
- delete x[m], a(x);
9906
+ const v = { ...t };
9907
+ delete v[m], a(v);
9864
9908
  }, u = (m) => {
9865
- const x = { ...t };
9866
- delete x[m], x[i] = c, a(x), r(null);
9909
+ const v = { ...t };
9910
+ delete v[m], v[i] = c, a(v), r(null);
9867
9911
  };
9868
9912
  return /* @__PURE__ */ s("div", { className: "space-y-1", children: [
9869
9913
  /* @__PURE__ */ e(K, { className: "text-xs font-medium text-muted-foreground", children: "Pivot Value Aliases" }),
9870
9914
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
9871
- Object.entries(t).map(([m, x], N) => /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: n === m ? /* @__PURE__ */ s(ne, { children: [
9915
+ Object.entries(t).map(([m, v], N) => /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: n === m ? /* @__PURE__ */ s(ne, { children: [
9872
9916
  /* @__PURE__ */ e(
9873
9917
  De,
9874
9918
  {
@@ -9928,7 +9972,7 @@ function td({
9928
9972
  className: "h-8 w-24 text-xs",
9929
9973
  readOnly: !0,
9930
9974
  onClick: () => {
9931
- r(m), l(m), d(x);
9975
+ r(m), l(m), d(v);
9932
9976
  },
9933
9977
  "aria-label": "Edit value alias key"
9934
9978
  }
@@ -9937,11 +9981,11 @@ function td({
9937
9981
  De,
9938
9982
  {
9939
9983
  placeholder: "Alias label",
9940
- value: x,
9984
+ value: v,
9941
9985
  className: "h-8 w-24 text-xs",
9942
9986
  readOnly: !0,
9943
9987
  onClick: () => {
9944
- r(m), l(m), d(x);
9988
+ r(m), l(m), d(v);
9945
9989
  },
9946
9990
  "aria-label": "Edit value alias label"
9947
9991
  }
@@ -9988,7 +10032,7 @@ const br = (t) => {
9988
10032
  removeMetricColumn: d,
9989
10033
  removePivotByColumn: o,
9990
10034
  removeSortByColumn: h
9991
- } = X(), u = S((y) => y.card.type), m = t == null ? void 0 : t.id, x = fe(
10035
+ } = X(), u = S((y) => y.card.type), m = t == null ? void 0 : t.id, v = fe(
9992
10036
  (y) => {
9993
10037
  if (!(t != null && t.config)) return [];
9994
10038
  switch (y) {
@@ -10084,7 +10128,7 @@ const br = (t) => {
10084
10128
  ), w = fe(
10085
10129
  (y, p, L) => {
10086
10130
  if (!m) return;
10087
- const O = x(y)[p];
10131
+ const O = v(y)[p];
10088
10132
  if (O)
10089
10133
  switch (y) {
10090
10134
  case "groupBy":
@@ -10103,7 +10147,7 @@ const br = (t) => {
10103
10147
  },
10104
10148
  [
10105
10149
  m,
10106
- x,
10150
+ v,
10107
10151
  n,
10108
10152
  r,
10109
10153
  i,
@@ -10112,7 +10156,7 @@ const br = (t) => {
10112
10156
  ), f = fe(
10113
10157
  (y, p) => {
10114
10158
  if (!m) return;
10115
- const z = x("metrics")[y];
10159
+ const z = v("metrics")[y];
10116
10160
  z && r(m, z.id, {
10117
10161
  aggregate: p,
10118
10162
  label: vr(
@@ -10121,46 +10165,46 @@ const br = (t) => {
10121
10165
  )
10122
10166
  });
10123
10167
  },
10124
- [m, x, r]
10168
+ [m, v, r]
10125
10169
  ), I = fe(
10126
10170
  (y, p, L) => {
10127
10171
  if (!m) return;
10128
- const O = x("groupBy")[y];
10172
+ const O = v("groupBy")[y];
10129
10173
  if (!O) return;
10130
10174
  const b = {
10131
10175
  dateFormat: p
10132
10176
  };
10133
10177
  p === "custom" && L ? b.customFormat = L : b.customFormat = void 0, n(m, O.id, b);
10134
10178
  },
10135
- [m, x, n]
10179
+ [m, v, n]
10136
10180
  ), g = fe(
10137
10181
  (y, p) => {
10138
10182
  if (!m) return;
10139
- const z = x("groupBy")[y];
10183
+ const z = v("groupBy")[y];
10140
10184
  z && n(m, z.id, {
10141
10185
  granularity: p
10142
10186
  });
10143
10187
  },
10144
- [m, x, n]
10145
- ), v = fe(
10188
+ [m, v, n]
10189
+ ), x = fe(
10146
10190
  (y, p) => {
10147
10191
  if (!m) return;
10148
- const z = x("metrics")[y];
10192
+ const z = v("metrics")[y];
10149
10193
  z && r(m, z.id, {
10150
10194
  aliasTemplate: p
10151
10195
  });
10152
10196
  },
10153
- [m, x, r]
10197
+ [m, v, r]
10154
10198
  ), F = fe(
10155
10199
  (y, p) => {
10156
10200
  if (console.log("handleValueAliasesChange", y, p), !m) return;
10157
10201
  console.log("handleValueAliasesChange", y, p);
10158
- const z = x("metrics")[y];
10202
+ const z = v("metrics")[y];
10159
10203
  z && (console.log("handleValueAliasesChange", p), r(m, z.id, {
10160
10204
  valueAliases: p
10161
10205
  }));
10162
10206
  },
10163
- [m, x, r]
10207
+ [m, v, r]
10164
10208
  ), E = fe(
10165
10209
  (y) => {
10166
10210
  m && a(m, { comparisonType: y });
@@ -10189,10 +10233,10 @@ const br = (t) => {
10189
10233
  ), T = fe(
10190
10234
  (y, p) => {
10191
10235
  if (!m) return;
10192
- const z = x(y)[p];
10236
+ const z = v(y)[p];
10193
10237
  if (z) {
10194
10238
  if (y !== "sortBy") {
10195
- const O = x("sortBy"), b = O.filter(
10239
+ const O = v("sortBy"), b = O.filter(
10196
10240
  (A) => !(A.name === z.name && A.qualifiedEntityName === z.qualifiedEntityName)
10197
10241
  );
10198
10242
  b.length !== O.length && a(m, {
@@ -10217,7 +10261,7 @@ const br = (t) => {
10217
10261
  },
10218
10262
  [
10219
10263
  m,
10220
- x,
10264
+ v,
10221
10265
  c,
10222
10266
  d,
10223
10267
  o,
@@ -10226,13 +10270,13 @@ const br = (t) => {
10226
10270
  ]
10227
10271
  );
10228
10272
  return {
10229
- getFieldsForContainer: x,
10273
+ getFieldsForContainer: v,
10230
10274
  setFieldsForContainer: N,
10231
10275
  updateLabel: w,
10232
10276
  handleAggregationChange: f,
10233
10277
  handleDateFormatChange: I,
10234
10278
  handleGranularityChange: g,
10235
- handleAliasTemplateChange: v,
10279
+ handleAliasTemplateChange: x,
10236
10280
  handleValueAliasesChange: F,
10237
10281
  removeField: T,
10238
10282
  // KPI-specific handlers
@@ -10261,13 +10305,13 @@ function nd({
10261
10305
  setNodeRef: h,
10262
10306
  transform: u,
10263
10307
  transition: m,
10264
- isDragging: x
10308
+ isDragging: v
10265
10309
  } = Ot({ id: t.id }), N = S((te) => te.card), {
10266
10310
  updateLabel: w,
10267
10311
  handleAggregationChange: f,
10268
10312
  handleDateFormatChange: I,
10269
10313
  handleGranularityChange: g,
10270
- handleAliasTemplateChange: v,
10314
+ handleAliasTemplateChange: x,
10271
10315
  handleValueAliasesChange: F,
10272
10316
  removeField: E,
10273
10317
  handleKpiComparisonTypeChange: D,
@@ -10292,7 +10336,7 @@ function nd({
10292
10336
  }, Z = (te) => {
10293
10337
  J(te), a === "groupBy" && g(n, te);
10294
10338
  }, ge = (te) => {
10295
- re(te), a === "metrics" && v(n, te);
10339
+ re(te), a === "metrics" && x(n, te);
10296
10340
  }, Ie = (te) => {
10297
10341
  H(te), a === "metrics" && F(n, te);
10298
10342
  }, Ae = (te) => {
@@ -10515,7 +10559,7 @@ function nd({
10515
10559
  style: Ke,
10516
10560
  ...d,
10517
10561
  ...o,
10518
- className: `group mx-auto flex w-full max-w-[300px] flex-col gap-2 rounded border border-border bg-background p-2 transition-all hover:shadow-sm dark:border-gray-800 ${x ? "z-50 scale-95 opacity-50" : "border-slate-200"} ${a === "filters" ? "cursor-default" : "cursor-move"}`,
10562
+ className: `group mx-auto flex w-full max-w-[300px] flex-col gap-2 rounded border border-border bg-background p-2 transition-all hover:shadow-sm dark:border-gray-800 ${v ? "z-50 scale-95 opacity-50" : "border-slate-200"} ${a === "filters" ? "cursor-default" : "cursor-move"}`,
10519
10563
  children: [
10520
10564
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
10521
10565
  /* @__PURE__ */ e(Et, { className: "h-3 w-3" }),
@@ -10682,10 +10726,10 @@ function Yt({
10682
10726
  }) {
10683
10727
  const { isOver: c, setNodeRef: d } = ia({
10684
10728
  id: t
10685
- }), { updateSortByColumn: o } = X(), h = S((w) => w.card), u = S((w) => w.card.type), m = a.length > 0, x = (w, f) => {
10729
+ }), { updateSortByColumn: o } = X(), h = S((w) => w.card), u = S((w) => w.card.type), m = a.length > 0, v = (w, f) => {
10686
10730
  var g;
10687
10731
  !((g = h.config) != null && g.sortByColumns) || h.config.sortByColumns.findIndex(
10688
- (v) => v.id === w
10732
+ (x) => x.id === w
10689
10733
  ) === -1 || o(h.id, w, { direction: f });
10690
10734
  };
10691
10735
  if (t === "sortBy" && i === !1)
@@ -10697,9 +10741,9 @@ function Yt({
10697
10741
  K,
10698
10742
  {
10699
10743
  className: R("block text-sm font-medium", {
10700
- "text-green-600": t === "metrics",
10701
- "text-blue-600": t === "groupBy",
10702
- "text-purple-600": t === "pivotBy"
10744
+ // 'text-green-600': zone === 'metrics',
10745
+ // 'text-blue-600': zone === 'groupBy',
10746
+ // 'text-purple-600': zone === 'pivotBy',
10703
10747
  }),
10704
10748
  children: n
10705
10749
  }
@@ -10732,7 +10776,7 @@ function Yt({
10732
10776
  zone: t,
10733
10777
  index: f,
10734
10778
  sortDirection: g,
10735
- onSortDirectionChange: (v) => x(w.id, v),
10779
+ onSortDirectionChange: (x) => v(w.id, x),
10736
10780
  hasPivotColumns: l,
10737
10781
  cardType: u
10738
10782
  }
@@ -10839,7 +10883,7 @@ function rd({
10839
10883
  className: "h-8",
10840
10884
  size: "sm",
10841
10885
  children: [
10842
- /* @__PURE__ */ e(io, { className: "mr-2 size-4 text-brand" }),
10886
+ /* @__PURE__ */ e(io, { className: "mr-2 size-4" }),
10843
10887
  "AI"
10844
10888
  ]
10845
10889
  }
@@ -10944,7 +10988,7 @@ function id({
10944
10988
  groups: M.groups.map(k)
10945
10989
  };
10946
10990
  r(k(n));
10947
- }, x = (D, C) => {
10991
+ }, v = (D, C) => {
10948
10992
  const k = (M) => M.id === D ? {
10949
10993
  ...M,
10950
10994
  groups: M.groups.filter((T) => T.id !== C)
@@ -11005,7 +11049,7 @@ function id({
11005
11049
  groups: T.groups.map(M)
11006
11050
  };
11007
11051
  r(M(n));
11008
- }, v = (D, C, k) => {
11052
+ }, x = (D, C, k) => {
11009
11053
  const M = (T) => T.id === D ? {
11010
11054
  ...T,
11011
11055
  groups: qn(T.groups, C, k)
@@ -11063,13 +11107,13 @@ function id({
11063
11107
  addCondition: h,
11064
11108
  addGroup: u,
11065
11109
  removeCondition: m,
11066
- removeGroup: x,
11110
+ removeGroup: v,
11067
11111
  updateCondition: N,
11068
11112
  updateConditionFields: w,
11069
11113
  updateGroupOperator: f,
11070
11114
  updateGroupNegate: I,
11071
11115
  reorderConditions: g,
11072
- reorderGroups: v,
11116
+ reorderGroups: x,
11073
11117
  generateSQLPreview: F,
11074
11118
  hasAnyFilters: E
11075
11119
  };
@@ -11164,12 +11208,12 @@ function dd({
11164
11208
  od(m[0].entityType),
11165
11209
  /* @__PURE__ */ e("span", { children: m[0].entityName })
11166
11210
  ] }),
11167
- m.map((x, N) => /* @__PURE__ */ s(
11211
+ m.map((v, N) => /* @__PURE__ */ s(
11168
11212
  fn,
11169
11213
  {
11170
- value: x.id,
11214
+ value: v.id,
11171
11215
  onSelect: () => {
11172
- a(x), c(!1);
11216
+ a(v), c(!1);
11173
11217
  },
11174
11218
  className: "overflow-x-auto",
11175
11219
  children: [
@@ -11178,27 +11222,17 @@ function dd({
11178
11222
  {
11179
11223
  className: R(
11180
11224
  "mr-2 h-4 w-4",
11181
- (t == null ? void 0 : t.id) === x.id ? "opacity-100" : "opacity-0"
11225
+ (t == null ? void 0 : t.id) === v.id ? "opacity-100" : "opacity-0"
11182
11226
  )
11183
11227
  }
11184
11228
  ),
11185
11229
  /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 flex-col", children: [
11186
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e("span", { className: "", children: x.name }) }),
11187
- /* @__PURE__ */ s("div", { className: "flex items-center gap-2 text-xs text-gray-500", children: [
11188
- /* @__PURE__ */ e("span", { children: x.dataType }),
11189
- x.description && /* @__PURE__ */ s("span", { children: [
11190
- "• ",
11191
- x.description
11192
- ] }),
11193
- x.customFormat && /* @__PURE__ */ s("span", { children: [
11194
- "• ",
11195
- x.customFormat
11196
- ] })
11197
- ] })
11230
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e("span", { className: "", children: v.name }) }),
11231
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2 text-xs text-gray-500", children: v.description && /* @__PURE__ */ e("span", { children: v.description }) })
11198
11232
  ] })
11199
11233
  ]
11200
11234
  },
11201
- x.id + N
11235
+ v.id + N
11202
11236
  ))
11203
11237
  ] }, `${o}-${u}`))
11204
11238
  },
@@ -11230,7 +11264,7 @@ function Ta(t) {
11230
11264
  groupByColumns: [l],
11231
11265
  metricColumns: [c],
11232
11266
  sortByColumns: [d]
11233
- }, h = ((w = a.dataSource) == null ? void 0 : w.connectionId) || a.connectionId, { data: u, isPending: m, error: x } = Wn({
11267
+ }, h = ((w = a.dataSource) == null ? void 0 : w.connectionId) || a.connectionId, { data: u, isPending: m, error: v } = Wn({
11234
11268
  queryKey: [
11235
11269
  "filterValues",
11236
11270
  t.entityId,
@@ -11262,7 +11296,7 @@ function Ta(t) {
11262
11296
  value: f[t.name] || "BLANK",
11263
11297
  count: (f == null ? void 0 : f.count) || 0
11264
11298
  })
11265
- ), isPending: m, error: x };
11299
+ ), isPending: m, error: v };
11266
11300
  }
11267
11301
  function ud({
11268
11302
  field: t,
@@ -11288,21 +11322,21 @@ function ud({
11288
11322
  className: "h-auto min-h-10 w-full justify-between p-2",
11289
11323
  children: [
11290
11324
  /* @__PURE__ */ e("div", { className: "flex flex-1 flex-wrap gap-1", children: a.length > 0 ? a.map((u) => {
11291
- const m = d.find((x) => x.value === u);
11325
+ const m = d.find((v) => v.value === u);
11292
11326
  return /* @__PURE__ */ s(ye, { variant: "secondary", className: "text-xs", children: [
11293
11327
  m == null ? void 0 : m.label,
11294
11328
  /* @__PURE__ */ e(
11295
11329
  "div",
11296
11330
  {
11297
11331
  className: "ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",
11298
- onKeyDown: (x) => {
11299
- x.key === "Enter" && o(u);
11332
+ onKeyDown: (v) => {
11333
+ v.key === "Enter" && o(u);
11300
11334
  },
11301
- onMouseDown: (x) => {
11302
- x.preventDefault(), x.stopPropagation();
11335
+ onMouseDown: (v) => {
11336
+ v.preventDefault(), v.stopPropagation();
11303
11337
  },
11304
- onClick: (x) => {
11305
- x.stopPropagation(), o(u);
11338
+ onClick: (v) => {
11339
+ v.stopPropagation(), o(u);
11306
11340
  },
11307
11341
  children: /* @__PURE__ */ e(ve, { className: "h-3 w-3 text-muted-foreground hover:text-foreground" })
11308
11342
  }
@@ -11442,13 +11476,13 @@ function Cr({
11442
11476
  attributes: h,
11443
11477
  listeners: u,
11444
11478
  setNodeRef: m,
11445
- transform: x,
11479
+ transform: v,
11446
11480
  transition: N,
11447
11481
  isDragging: w
11448
11482
  } = Ot({ id: t.id }), { isPending: f, error: I } = Ta(
11449
11483
  t.field
11450
11484
  ), g = {
11451
- transform: st.Transform.toString(x),
11485
+ transform: st.Transform.toString(v),
11452
11486
  transition: N
11453
11487
  };
11454
11488
  return /* @__PURE__ */ s(
@@ -11471,7 +11505,7 @@ function Cr({
11471
11505
  oe,
11472
11506
  {
11473
11507
  value: r,
11474
- onValueChange: (v) => c(n, v),
11508
+ onValueChange: (x) => c(n, x),
11475
11509
  children: [
11476
11510
  /* @__PURE__ */ e(ce, { className: "w-24", children: /* @__PURE__ */ e(de, {}) }),
11477
11511
  /* @__PURE__ */ s(ue, { children: [
@@ -11486,9 +11520,9 @@ function Cr({
11486
11520
  dd,
11487
11521
  {
11488
11522
  value: t.field,
11489
- onValueChange: (v) => {
11523
+ onValueChange: (x) => {
11490
11524
  o(n, t.id, {
11491
- field: v,
11525
+ field: x,
11492
11526
  value: ""
11493
11527
  });
11494
11528
  },
@@ -11501,19 +11535,19 @@ function Cr({
11501
11535
  oe,
11502
11536
  {
11503
11537
  value: t.operator,
11504
- onValueChange: (v) => {
11505
- v === "in" || v === "not in" ? o(n, t.id, {
11506
- operator: v,
11538
+ onValueChange: (x) => {
11539
+ x === "in" || x === "not in" ? o(n, t.id, {
11540
+ operator: x,
11507
11541
  value: []
11508
11542
  }) : o(n, t.id, {
11509
- operator: v,
11543
+ operator: x,
11510
11544
  value: ""
11511
11545
  });
11512
11546
  },
11513
11547
  children: [
11514
11548
  /* @__PURE__ */ e(ce, { className: "w-28", children: /* @__PURE__ */ e(de, {}) }),
11515
11549
  /* @__PURE__ */ e(ue, { children: xd(qe(t.field.dataType)).map(
11516
- (v) => /* @__PURE__ */ e(U, { className: "hover:bg-muted", value: v, children: v }, v)
11550
+ (x) => /* @__PURE__ */ e(U, { className: "hover:bg-muted", value: x, children: x }, x)
11517
11551
  ) })
11518
11552
  ]
11519
11553
  }
@@ -11525,9 +11559,9 @@ function Cr({
11525
11559
  ud,
11526
11560
  {
11527
11561
  field: t.field,
11528
- selected: Array.isArray(t.value) && t.value.every((v) => typeof v == "string") ? t.value : [],
11529
- onChange: (v) => o(n, t.id, {
11530
- value: v
11562
+ selected: Array.isArray(t.value) && t.value.every((x) => typeof x == "string") ? t.value : [],
11563
+ onChange: (x) => o(n, t.id, {
11564
+ value: x
11531
11565
  }),
11532
11566
  placeholder: `Select values for ${t.operator}...`,
11533
11567
  className: "flex-1"
@@ -11538,8 +11572,8 @@ function Cr({
11538
11572
  De,
11539
11573
  {
11540
11574
  value: typeof t.value == "string" ? t.value : "",
11541
- onChange: (v) => o(n, t.id, {
11542
- value: v.target.value
11575
+ onChange: (x) => o(n, t.id, {
11576
+ value: x.target.value
11543
11577
  }),
11544
11578
  className: "flex-1",
11545
11579
  placeholder: t.operator.charAt(0).toUpperCase() + t.operator.slice(1) + "..."
@@ -11549,7 +11583,7 @@ function Cr({
11549
11583
  {
11550
11584
  field: t.field,
11551
11585
  value: typeof t.value == "string" ? t.value : "",
11552
- onChange: (v) => o(n, t.id, { value: v }),
11586
+ onChange: (x) => o(n, t.id, { value: x }),
11553
11587
  placeholder: "Select value...",
11554
11588
  className: "flex-1"
11555
11589
  }
@@ -11557,8 +11591,8 @@ function Cr({
11557
11591
  oe,
11558
11592
  {
11559
11593
  value: typeof t.value == "boolean" ? String(t.value) : "",
11560
- onValueChange: (v) => o(n, t.id, {
11561
- value: v === "true"
11594
+ onValueChange: (x) => o(n, t.id, {
11595
+ value: x === "true"
11562
11596
  }),
11563
11597
  children: [
11564
11598
  /* @__PURE__ */ e(ce, { className: "flex-1", children: /* @__PURE__ */ e(de, { placeholder: "Select value..." }) }),
@@ -11572,7 +11606,7 @@ function Cr({
11572
11606
  De,
11573
11607
  {
11574
11608
  value: typeof t.value == "string" || typeof t.value == "number" ? t.value : "",
11575
- onChange: (v) => i(n, t.id, "value", v.target.value),
11609
+ onChange: (x) => i(n, t.id, "value", x.target.value),
11576
11610
  className: "flex-1",
11577
11611
  placeholder: t.operator === "in" || t.operator === "not in" ? "value1, value2, value3" : "Value"
11578
11612
  }
@@ -11604,7 +11638,7 @@ function vd({
11604
11638
  onReorderConditions: h,
11605
11639
  onReorderGroups: u,
11606
11640
  onAddCondition: m,
11607
- onAddGroup: x,
11641
+ onAddGroup: v,
11608
11642
  availableFields: N,
11609
11643
  renderFilterGroup: w,
11610
11644
  updateConditionFields: f
@@ -11612,7 +11646,7 @@ function vd({
11612
11646
  const {
11613
11647
  attributes: I,
11614
11648
  listeners: g,
11615
- setNodeRef: v,
11649
+ setNodeRef: x,
11616
11650
  transform: F,
11617
11651
  transition: E,
11618
11652
  isDragging: D
@@ -11639,7 +11673,7 @@ function vd({
11639
11673
  return /* @__PURE__ */ s(
11640
11674
  "div",
11641
11675
  {
11642
- ref: v,
11676
+ ref: x,
11643
11677
  style: C,
11644
11678
  className: `rounded-lg ${a > 0 ? "mt-2 border border-border" : ""} ${D ? "z-50 opacity-50" : ""}`,
11645
11679
  children: [
@@ -11771,7 +11805,7 @@ function vd({
11771
11805
  variant: "outline",
11772
11806
  size: "sm",
11773
11807
  className: "h-7 text-xs",
11774
- onClick: () => x(t.id),
11808
+ onClick: () => v(t.id),
11775
11809
  children: [
11776
11810
  /* @__PURE__ */ e(ke, { className: "mr-1 h-3 w-3" }),
11777
11811
  "Add Group"
@@ -11799,13 +11833,13 @@ function bd({
11799
11833
  addGroup: h,
11800
11834
  removeCondition: u,
11801
11835
  removeGroup: m,
11802
- updateCondition: x,
11836
+ updateCondition: v,
11803
11837
  updateConditionFields: N,
11804
11838
  updateGroupOperator: w,
11805
11839
  updateGroupNegate: f,
11806
11840
  reorderConditions: I,
11807
11841
  reorderGroups: g,
11808
- generateSQLPreview: v,
11842
+ generateSQLPreview: x,
11809
11843
  hasAnyFilters: F,
11810
11844
  setCurrentFilters: E
11811
11845
  } = id({
@@ -11858,7 +11892,7 @@ function bd({
11858
11892
  index: b,
11859
11893
  groupId: p.id,
11860
11894
  groupLogicalOperator: p.logicalOperator,
11861
- onUpdateCondition: x,
11895
+ onUpdateCondition: v,
11862
11896
  onUpdateField: M,
11863
11897
  onRemoveCondition: u,
11864
11898
  onUpdateGroupOperator: w,
@@ -11936,7 +11970,7 @@ function bd({
11936
11970
  onUpdateGroupOperator: w,
11937
11971
  onUpdateGroupNegate: f,
11938
11972
  onRemoveGroup: m,
11939
- onUpdateCondition: x,
11973
+ onUpdateCondition: v,
11940
11974
  onUpdateField: M,
11941
11975
  onRemoveCondition: u,
11942
11976
  onReorderConditions: I,
@@ -11975,7 +12009,7 @@ function bd({
11975
12009
  ] }) }),
11976
12010
  F && /* @__PURE__ */ s("div", { className: "mt-4 border-t border-border pt-4", children: [
11977
12011
  /* @__PURE__ */ e("div", { className: "mb-2 text-xs font-medium text-muted-foreground", children: "SQL WHERE Clause Preview" }),
11978
- /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-md border bg-muted p-3", children: /* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap font-mono text-xs text-muted-foreground", children: v(l) }) })
12012
+ /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-md border bg-muted p-3", children: /* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap font-mono text-xs text-muted-foreground", children: x(l) }) })
11979
12013
  ] })
11980
12014
  ] }) }) }),
11981
12015
  /* @__PURE__ */ s("div", { className: "flex justify-end gap-2", children: [
@@ -12051,16 +12085,16 @@ function Cd({
12051
12085
  ...n("metrics"),
12052
12086
  ...n("sortBy")
12053
12087
  ], h = fe(
12054
- (g) => g.startsWith("card-") ? null : g.startsWith("source-") || a.find((v) => v.id === g) ? "source" : n("groupBy").find((v) => v.id === g) ? "groupBy" : n("metrics").find((v) => v.id === g) ? "metrics" : n("pivotBy").find((v) => v.id === g) ? "pivotBy" : n("sortBy").find((v) => v.id === g) ? "sortBy" : null,
12088
+ (g) => g.startsWith("card-") ? null : g.startsWith("source-") || a.find((x) => x.id === g) ? "source" : n("groupBy").find((x) => x.id === g) ? "groupBy" : n("metrics").find((x) => x.id === g) ? "metrics" : n("pivotBy").find((x) => x.id === g) ? "pivotBy" : n("sortBy").find((x) => x.id === g) ? "sortBy" : null,
12055
12089
  [a, n]
12056
12090
  ), u = fe(
12057
- (g, v) => {
12091
+ (g, x) => {
12058
12092
  var F;
12059
- return !d || !((F = d.baseEntity) != null && F.name) || !d.joins ? !1 : g === v || g === d.baseEntity.name || v === d.baseEntity.name ? !0 : d.joins.some((E) => {
12093
+ return !d || !((F = d.baseEntity) != null && F.name) || !d.joins ? !1 : g === x || g === d.baseEntity.name || x === d.baseEntity.name ? !0 : d.joins.some((E) => {
12060
12094
  const D = _a(E.source), C = _a(E.target);
12061
12095
  return console.log(D, C), console.log(
12062
- D === g && C === v || D === v && C === g
12063
- ), D === g && C === v || D === v && C === g;
12096
+ D === g && C === x || D === x && C === g
12097
+ ), D === g && C === x || D === x && C === g;
12064
12098
  });
12065
12099
  },
12066
12100
  [d]
@@ -12071,8 +12105,8 @@ function Cd({
12071
12105
  position: "top-center",
12072
12106
  duration: 4e3
12073
12107
  });
12074
- }, []), x = (g, v) => {
12075
- const F = wr(v, g), E = qe(g.dataType), D = E === "date", C = {
12108
+ }, []), v = (g, x) => {
12109
+ const F = wr(x, g), E = qe(g.dataType), D = E === "date", C = {
12076
12110
  id: F,
12077
12111
  name: g.name,
12078
12112
  dataType: g.dataType,
@@ -12082,7 +12116,7 @@ function Cd({
12082
12116
  entityName: g.entityName,
12083
12117
  entityType: g.entityType
12084
12118
  };
12085
- if (v === "metrics") {
12119
+ if (x === "metrics") {
12086
12120
  const k = E === "number" ? "SUM" : "COUNT", M = vr(g.label, k);
12087
12121
  return {
12088
12122
  ...C,
@@ -12091,16 +12125,16 @@ function Cd({
12091
12125
  aggregate: k
12092
12126
  };
12093
12127
  }
12094
- return v === "groupBy" ? {
12128
+ return x === "groupBy" ? {
12095
12129
  ...C,
12096
12130
  role: "groupby",
12097
12131
  ...D && {
12098
12132
  granularity: "month"
12099
12133
  }
12100
- } : v === "pivotBy" ? {
12134
+ } : x === "pivotBy" ? {
12101
12135
  ...C,
12102
12136
  role: "pivotby"
12103
- } : v === "sortBy" ? {
12137
+ } : x === "sortBy" ? {
12104
12138
  ...C,
12105
12139
  role: "sortby",
12106
12140
  label: g.label,
@@ -12110,12 +12144,12 @@ function Cd({
12110
12144
  l(g.active.id);
12111
12145
  }, []), w = fe(
12112
12146
  (g) => {
12113
- const { active: v, over: F } = g;
12147
+ const { active: x, over: F } = g;
12114
12148
  if (!F || !t) {
12115
12149
  l(null);
12116
12150
  return;
12117
12151
  }
12118
- const E = v.id, D = F.id, C = h(E), k = h(D) || D;
12152
+ const E = x.id, D = F.id, C = h(E), k = h(D) || D;
12119
12153
  if (C === "source" && k === "sortBy") {
12120
12154
  l(null);
12121
12155
  return;
@@ -12159,7 +12193,7 @@ function Cd({
12159
12193
  l(null);
12160
12194
  return;
12161
12195
  }
12162
- const L = x(M, k);
12196
+ const L = v(M, k);
12163
12197
  l(null), r(k, [...y, L]);
12164
12198
  return;
12165
12199
  }
@@ -12169,7 +12203,7 @@ function Cd({
12169
12203
  l(null);
12170
12204
  return;
12171
12205
  }
12172
- const p = x(y, k);
12206
+ const p = v(y, k);
12173
12207
  if (l(null), k === "sortBy") {
12174
12208
  if (C === "pivotBy") {
12175
12209
  l(null);
@@ -12310,7 +12344,7 @@ function Md({
12310
12344
  activeCard: h,
12311
12345
  columns: u,
12312
12346
  columnsLoading: m,
12313
- columnsError: x
12347
+ columnsError: v
12314
12348
  // cards,
12315
12349
  // activeCardId,
12316
12350
  // addCard,
@@ -12319,7 +12353,7 @@ function Md({
12319
12353
  var T;
12320
12354
  const N = S((y) => y.card), w = G((y) => y.filterValues), { updateCardConfig: f } = X(), I = S((y) => y.showAIDialog), {
12321
12355
  data: g,
12322
- errorMessage: v,
12356
+ errorMessage: x,
12323
12357
  isPending: F,
12324
12358
  isLoading: E,
12325
12359
  isFetching: D
@@ -12344,7 +12378,7 @@ function Md({
12344
12378
  u.length,
12345
12379
  ")"
12346
12380
  ] }),
12347
- /* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs", children: m ? "Loading..." : x ? "Error loading columns" : JSON.stringify(u.slice(0, 5), null, 2) })
12381
+ /* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs", children: m ? "Loading..." : v ? "Error loading columns" : JSON.stringify(u.slice(0, 5), null, 2) })
12348
12382
  ] })
12349
12383
  ] }) });
12350
12384
  }
@@ -12445,7 +12479,7 @@ function Md({
12445
12479
  ] }),
12446
12480
  t === "sql" && /* @__PURE__ */ e("div", { className: "p-6", children: /* @__PURE__ */ s("div", { className: "rounded-md border bg-background p-4", children: [
12447
12481
  (g == null ? void 0 : g.sql) && /* @__PURE__ */ e("h3", { className: "mb-3 text-sm font-medium", children: "Generated SQL Query" }),
12448
- /* @__PURE__ */ e(Xs, { sql: g == null ? void 0 : g.sql, error: v })
12482
+ /* @__PURE__ */ e(Xs, { sql: g == null ? void 0 : g.sql, error: x })
12449
12483
  ] }) })
12450
12484
  ] })
12451
12485
  ] })
@@ -12507,7 +12541,7 @@ function Id() {
12507
12541
  console.log("Clear clicked - would reset all configurations");
12508
12542
  }, m = () => {
12509
12543
  console.log("Advanced mode toggled");
12510
- }, x = () => {
12544
+ }, v = () => {
12511
12545
  l(!0);
12512
12546
  }, N = ($) => {
12513
12547
  d($);
@@ -12515,7 +12549,7 @@ function Id() {
12515
12549
  S(($) => $.activeTabCardId), S(
12516
12550
  ($) => $.actions.getAvailableFields
12517
12551
  );
12518
- const { addCard: I, removeCard: g, updateCard: v, setActiveCard: F, updateFilters: E } = X(), {
12552
+ const { addCard: I, removeCard: g, updateCard: x, setActiveCard: F, updateFilters: E } = X(), {
12519
12553
  columns: D = [],
12520
12554
  isLoading: C,
12521
12555
  error: k
@@ -12537,7 +12571,7 @@ function Id() {
12537
12571
  H && E($, H);
12538
12572
  }, A = ($) => {
12539
12573
  var H;
12540
- v($, {
12574
+ x($, {
12541
12575
  config: {
12542
12576
  ...(H = w.cards.find((ee) => ee.id === $)) == null ? void 0 : H.config,
12543
12577
  filters: void 0
@@ -12582,7 +12616,7 @@ function Id() {
12582
12616
  onAccept: h,
12583
12617
  onClear: u,
12584
12618
  onAdvancedToggle: m,
12585
- onFiltersClick: x,
12619
+ onFiltersClick: v,
12586
12620
  filterCount: J,
12587
12621
  activeCard: T,
12588
12622
  dataSourceState: f.dataSource || Rn,
@@ -12615,10 +12649,10 @@ function Id() {
12615
12649
  );
12616
12650
  }
12617
12651
  function Od({ authToken: t, onSave: a, onClose: n }) {
12618
- const r = Ge(null), i = S((v) => v.showAIDialog), l = S((v) => v.isDevMode), { setAuthToken: c } = Dt(), { setShowAIDialog: d, setOnSave: o, setOnClose: h } = X(), {
12652
+ const r = Ge(null), i = S((x) => x.showAIDialog), l = S((x) => x.isDevMode), { setAuthToken: c } = Dt(), { setShowAIDialog: d, setOnSave: o, setOnClose: h } = X(), {
12619
12653
  handleDragOver: u,
12620
12654
  handleDragEnd: m,
12621
- handleDragStart: x,
12655
+ handleDragStart: v,
12622
12656
  handleDragCancel: N,
12623
12657
  sensors: w
12624
12658
  } = So();
@@ -12627,11 +12661,11 @@ function Od({ authToken: t, onSave: a, onClose: n }) {
12627
12661
  }, [a, o, n, h]), xe(() => {
12628
12662
  t && t.accessToken && c(t);
12629
12663
  }, [t, c]), xe(() => {
12630
- var v, F;
12631
- i ? ((v = r.current) == null || v.resize(40), d(!0)) : (d(!1), (F = r.current) == null || F.resize(0));
12664
+ var x, F;
12665
+ i ? ((x = r.current) == null || x.resize(40), d(!0)) : (d(!1), (F = r.current) == null || F.resize(0));
12632
12666
  }, [i, d]);
12633
- function f(v) {
12634
- v < 1 ? d(!1) : i || d(!0);
12667
+ function f(x) {
12668
+ x < 1 ? d(!1) : i || d(!0);
12635
12669
  }
12636
12670
  function I() {
12637
12671
  return /* @__PURE__ */ s(ne, { children: [
@@ -12688,7 +12722,7 @@ function Od({ authToken: t, onSave: a, onClose: n }) {
12688
12722
  St,
12689
12723
  {
12690
12724
  sensors: w,
12691
- onDragStart: x,
12725
+ onDragStart: v,
12692
12726
  onDragEnd: m,
12693
12727
  onDragOver: u,
12694
12728
  onDragCancel: N,