react-semaphor 0.0.428 → 0.0.429

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1023,13 +1023,13 @@ function jl() {
1023
1023
  u(!0);
1024
1024
  const h = Hn(
1025
1025
  y
1026
- ), b = await Rl(
1026
+ ), N = await Rl(
1027
1027
  t,
1028
1028
  h,
1029
1029
  g,
1030
1030
  d == null ? void 0 : d.accessToken
1031
1031
  );
1032
- b && (o([...l || [], b]), i(b.id), m(!1)), u(!1);
1032
+ N && (o([...l || [], N]), i(N.id), m(!1)), u(!1);
1033
1033
  }
1034
1034
  return /* @__PURE__ */ r(Fa, { open: p, onOpenChange: m, children: [
1035
1035
  /* @__PURE__ */ e(Aa, { asChild: !0, children: /* @__PURE__ */ r(
@@ -1421,12 +1421,12 @@ function Gl() {
1421
1421
  const [t, n] = U("idle"), [a, s] = U(""), [l, o] = U(null), i = _((k) => k.authToken), c = _((k) => k.dashboard.id), u = _((k) => k.dashboard.title), { endUserId: p } = Ja((i == null ? void 0 : i.accessToken) || ""), m = "https://semaphor.cloud/api/v1/subscriptions/get", y = {
1422
1422
  dashboardId: c,
1423
1423
  endUserId: p
1424
- }, { data: g, isLoading: d, isError: v, isFetching: h, refetch: b } = Te({
1424
+ }, { data: g, isLoading: d, isError: v, isFetching: h, refetch: N } = Te({
1425
1425
  queryKey: ["subscriptions", c, p],
1426
1426
  queryFn: () => Ve(m, (i == null ? void 0 : i.accessToken) || "", y),
1427
1427
  enabled: !!(i != null && i.accessToken) && !!c && !!p
1428
1428
  });
1429
- async function C({
1429
+ async function b({
1430
1430
  email: k,
1431
1431
  subject: z,
1432
1432
  frequency: S,
@@ -1453,7 +1453,7 @@ function Gl() {
1453
1453
  ...w
1454
1454
  }
1455
1455
  );
1456
- n("success"), s(""), b(), setTimeout(() => {
1456
+ n("success"), s(""), N(), setTimeout(() => {
1457
1457
  n("idle");
1458
1458
  }, 2e3);
1459
1459
  } catch (L) {
@@ -1464,7 +1464,7 @@ function Gl() {
1464
1464
  const z = "https://semaphor.cloud/api/v1/subscriptions/delete";
1465
1465
  o(k);
1466
1466
  try {
1467
- await xa(z, (i == null ? void 0 : i.accessToken) || "", { id: k }), b(), setTimeout(() => {
1467
+ await xa(z, (i == null ? void 0 : i.accessToken) || "", { id: k }), N(), setTimeout(() => {
1468
1468
  o(null);
1469
1469
  }, 2e3);
1470
1470
  } catch (S) {
@@ -1477,8 +1477,8 @@ function Gl() {
1477
1477
  isFetching: h,
1478
1478
  isError: v,
1479
1479
  isDeleting: l,
1480
- refetch: b,
1481
- handleScheduleSubscription: C,
1480
+ refetch: N,
1481
+ handleScheduleSubscription: b,
1482
1482
  handleDeleteSubscription: O,
1483
1483
  status: t,
1484
1484
  error: a
@@ -1501,7 +1501,7 @@ function $l() {
1501
1501
  (w) => w.actions.setShowFilters
1502
1502
  ), { addFrame: v, setSelectedFrameId: h } = _(
1503
1503
  (w) => w.actions
1504
- ), { getSelectedSheet: b, setIsDashboardEditing: C, setShowDashboardJSON: O } = _((w) => w.actions), k = b(), { tenantId: z, endUserId: S } = Qe(
1504
+ ), { getSelectedSheet: N, setIsDashboardEditing: b, setShowDashboardJSON: O } = _((w) => w.actions), k = N(), { tenantId: z, endUserId: S } = Qe(
1505
1505
  () => Ja(t == null ? void 0 : t.accessToken),
1506
1506
  [t == null ? void 0 : t.accessToken]
1507
1507
  ), A = Qe(() => z || S, [z, S]), B = () => {
@@ -1529,7 +1529,7 @@ function $l() {
1529
1529
  };
1530
1530
  v(k.id, D), h(D.id);
1531
1531
  }, P = () => {
1532
- C(!0);
1532
+ b(!0);
1533
1533
  };
1534
1534
  async function Z() {
1535
1535
  if (u(!0), !a || !s) return;
@@ -1584,7 +1584,7 @@ function $l() {
1584
1584
  {
1585
1585
  className: "h-7 p-2",
1586
1586
  onClick: () => {
1587
- C(!1), O(!1);
1587
+ b(!1), O(!1);
1588
1588
  },
1589
1589
  children: /* @__PURE__ */ e(Yt, { className: "h-4 w-4" })
1590
1590
  }
@@ -1633,11 +1633,11 @@ function Jl({
1633
1633
  $e.useLayoutEffect(() => {
1634
1634
  m.current && v(m.current.offsetWidth);
1635
1635
  }, []);
1636
- function b() {
1636
+ function N() {
1637
1637
  var O;
1638
1638
  return l ? "Loading..." : o ? "Error" : a ? (O = n == null ? void 0 : n.find((k) => k.id === a)) == null ? void 0 : O.name : `Select ${t}`;
1639
1639
  }
1640
- function C(O, k) {
1640
+ function b(O, k) {
1641
1641
  s(k), g(!1);
1642
1642
  }
1643
1643
  return /* @__PURE__ */ r(Pe, { open: y, onOpenChange: g, children: [
@@ -1652,7 +1652,7 @@ function Jl({
1652
1652
  children: [
1653
1653
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1654
1654
  u && /* @__PURE__ */ e("div", { className: "mr-2", children: u }),
1655
- /* @__PURE__ */ e("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: b() })
1655
+ /* @__PURE__ */ e("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: N() })
1656
1656
  ] }),
1657
1657
  /* @__PURE__ */ e(Ka, { className: "size-4 opacity-50" })
1658
1658
  ]
@@ -1687,7 +1687,7 @@ function Jl({
1687
1687
  {
1688
1688
  className: "overflow-x-auto",
1689
1689
  value: O.name,
1690
- onSelect: (k) => C(k, O.id),
1690
+ onSelect: (k) => b(k, O.id),
1691
1691
  children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1692
1692
  /* @__PURE__ */ e(
1693
1693
  Xt,
@@ -1769,7 +1769,7 @@ function at({
1769
1769
  ] }),
1770
1770
  /* @__PURE__ */ r(ae, { children: [
1771
1771
  c && /* @__PURE__ */ e(oe, { value: "none", children: "None" }, "none"),
1772
- n && n.map((h, b) => /* @__PURE__ */ e(oe, { value: h.id, children: h.name }, b))
1772
+ n && n.map((h, N) => /* @__PURE__ */ e(oe, { value: h.id, children: h.name }, N))
1773
1773
  ] }),
1774
1774
  (s || l) && /* @__PURE__ */ e(oe, { value: y, children: y })
1775
1775
  ] }) })
@@ -1802,14 +1802,14 @@ function Ql({ column: t }) {
1802
1802
  ), i = f(
1803
1803
  (h) => h.selectedDatamodelId
1804
1804
  ), c = f((h) => h.sqlGen), { modelItems: u, connectionType: p } = Ce(), m = f((h) => h.actions.setSqlGen), y = f((h) => h.actions.setCardSql), g = f((h) => h.actions.setRunSql);
1805
- function d(h, b) {
1805
+ function d(h, N) {
1806
1806
  var z;
1807
- const C = rn(h, c, b), O = (z = u == null ? void 0 : u.find(
1807
+ const b = rn(h, c, N), O = (z = u == null ? void 0 : u.find(
1808
1808
  (S) => S.id === i
1809
1809
  )) == null ? void 0 : z.name;
1810
- m(C);
1810
+ m(b);
1811
1811
  const k = ln(
1812
- C,
1812
+ b,
1813
1813
  ve(l || ""),
1814
1814
  ve(s),
1815
1815
  O,
@@ -1997,28 +1997,28 @@ function Zl({
1997
1997
  columns: a,
1998
1998
  status: s
1999
1999
  }) {
2000
- const l = f((x) => x.sqlGen), o = f((x) => x.isDevMode), i = f(
2001
- (x) => x.selectedConnectionId
2000
+ const l = f((C) => C.sqlGen), o = f((C) => C.isDevMode), i = f(
2001
+ (C) => C.selectedConnectionId
2002
2002
  ), c = f(
2003
- (x) => x.selectedDatabaseName
2003
+ (C) => C.selectedDatabaseName
2004
2004
  ), u = f(
2005
- (x) => x.selectedSchemaName
2006
- ), p = f((x) => x.selectedTableName), m = f(
2007
- (x) => x.selectedDatamodelId
2005
+ (C) => C.selectedSchemaName
2006
+ ), p = f((C) => C.selectedTableName), m = f(
2007
+ (C) => C.selectedDatamodelId
2008
2008
  ), y = _(
2009
- (x) => x.dashboard.aiScopeTables
2009
+ (C) => C.dashboard.aiScopeTables
2010
2010
  ), { addToAIScope: g, removeFromAIScope: d } = Ye(), {
2011
2011
  addColumnToMetricColumns: v,
2012
2012
  addColumnToTrendByColumns: h,
2013
- setCardSql: b,
2014
- setRunSql: C,
2013
+ setCardSql: N,
2014
+ setRunSql: b,
2015
2015
  setSqlGen: O,
2016
2016
  setIsShowingVisual: k
2017
2017
  } = X(), { connectionType: z, modelItems: S, selectedDatamodelName: A } = Ce();
2018
- function B(x) {
2018
+ function B(C) {
2019
2019
  var R;
2020
2020
  if (o) {
2021
- const J = rn(x, l);
2021
+ const J = rn(C, l);
2022
2022
  O(J);
2023
2023
  const ee = (R = S == null ? void 0 : S.find(
2024
2024
  (I) => I.id === m
@@ -2030,47 +2030,47 @@ function Zl({
2030
2030
  z,
2031
2031
  c || ""
2032
2032
  );
2033
- H && (b(H), C(!0));
2033
+ H && (N(H), b(!0));
2034
2034
  }
2035
2035
  if (!o) {
2036
- if (st(x.data_type)) {
2036
+ if (st(C.data_type)) {
2037
2037
  const J = {
2038
- ...x,
2038
+ ...C,
2039
2039
  role: "metric",
2040
- id: qe(x.column_name),
2041
- name: x.column_name,
2042
- label: vt("COUNT", x.column_name),
2043
- type: x.data_type,
2040
+ id: qe(C.column_name),
2041
+ name: C.column_name,
2042
+ label: vt("COUNT", C.column_name),
2043
+ type: C.data_type,
2044
2044
  aggregate: "COUNT"
2045
2045
  };
2046
2046
  v(J);
2047
2047
  }
2048
- if (We(x.data_type)) {
2048
+ if (We(C.data_type)) {
2049
2049
  const J = {
2050
- ...x,
2050
+ ...C,
2051
2051
  role: "metric",
2052
- id: qe(x.column_name),
2053
- name: x.column_name,
2054
- label: vt("SUM", x.column_name),
2055
- type: x.data_type,
2052
+ id: qe(C.column_name),
2053
+ name: C.column_name,
2054
+ label: vt("SUM", C.column_name),
2055
+ type: C.data_type,
2056
2056
  aggregate: "SUM"
2057
2057
  };
2058
2058
  v(J);
2059
2059
  }
2060
- if (rt(x.data_type)) {
2060
+ if (rt(C.data_type)) {
2061
2061
  const J = {
2062
- ...x,
2062
+ ...C,
2063
2063
  role: "trendby",
2064
- id: qe(x.column_name),
2065
- name: x.column_name,
2066
- type: x.data_type
2064
+ id: qe(C.column_name),
2065
+ name: C.column_name,
2066
+ type: C.data_type
2067
2067
  };
2068
2068
  h(J);
2069
2069
  }
2070
2070
  }
2071
2071
  }
2072
- function P(x) {
2073
- x === !0 && (p || A) && i ? (g({
2072
+ function P(C) {
2073
+ C === !0 && (p || A) && i ? (g({
2074
2074
  connectionId: i,
2075
2075
  connectionType: z === "S3" || z === "API" ? "DuckDb" : z,
2076
2076
  databaseName: c || "",
@@ -2097,7 +2097,7 @@ function Zl({
2097
2097
  }));
2098
2098
  }
2099
2099
  function Z() {
2100
- const x = gt({
2100
+ const C = gt({
2101
2101
  schemaName: t,
2102
2102
  tableName: n,
2103
2103
  modelName: A,
@@ -2105,46 +2105,46 @@ function Zl({
2105
2105
  databaseName: c || ""
2106
2106
  });
2107
2107
  k(!1);
2108
- const R = z === "MSSQL" ? `SELECT top 10 * FROM ${x}` : `SELECT * FROM ${x} LIMIT 10`;
2109
- b(R), C(!0);
2108
+ const R = z === "MSSQL" ? `SELECT top 10 * FROM ${C}` : `SELECT * FROM ${C} LIMIT 10`;
2109
+ N(R), b(!0);
2110
2110
  }
2111
2111
  function w() {
2112
- const x = gt({
2112
+ const C = gt({
2113
2113
  schemaName: t,
2114
2114
  tableName: n,
2115
2115
  modelName: A,
2116
2116
  connectionType: z,
2117
2117
  databaseName: c || ""
2118
2118
  });
2119
- b(`SELECT COUNT(*) as count FROM ${x}`), C(!0);
2119
+ N(`SELECT COUNT(*) as count FROM ${C}`), b(!0);
2120
2120
  }
2121
2121
  function D() {
2122
2122
  return (y == null ? void 0 : y.find(
2123
- (x) => x.connectionId === i && (x.tableName === p || x.datamodelName === A)
2123
+ (C) => C.connectionId === i && (C.tableName === p || C.datamodelName === A)
2124
2124
  )) !== void 0;
2125
2125
  }
2126
- function L(x) {
2126
+ function L(C) {
2127
2127
  return o ? /* @__PURE__ */ r(
2128
2128
  "div",
2129
2129
  {
2130
2130
  className: "flex grow items-center justify-between space-x-2 rounded-md px-2 py-1",
2131
- onClick: () => B(x),
2131
+ onClick: () => B(C),
2132
2132
  children: [
2133
2133
  /* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
2134
- /* @__PURE__ */ e(ma, { column: x }),
2135
- /* @__PURE__ */ e("span", { children: x.column_name })
2134
+ /* @__PURE__ */ e(ma, { column: C }),
2135
+ /* @__PURE__ */ e("span", { children: C.column_name })
2136
2136
  ] }),
2137
2137
  /* @__PURE__ */ e(
2138
2138
  "div",
2139
2139
  {
2140
2140
  onClick: (R) => R.stopPropagation(),
2141
2141
  className: "flex items-center justify-end",
2142
- children: We(x.data_type) && /* @__PURE__ */ e(Ql, { column: x })
2142
+ children: We(C.data_type) && /* @__PURE__ */ e(Ql, { column: C })
2143
2143
  }
2144
2144
  )
2145
2145
  ]
2146
2146
  }
2147
- ) : /* @__PURE__ */ e(Wl, { onClick: B, column: x });
2147
+ ) : /* @__PURE__ */ e(Wl, { onClick: B, column: C });
2148
2148
  }
2149
2149
  function T() {
2150
2150
  return /* @__PURE__ */ r(ae, { children: [
@@ -2209,15 +2209,15 @@ function Zl({
2209
2209
  {
2210
2210
  className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted px-2 py-3",
2211
2211
  children: [
2212
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-1", children: a == null ? void 0 : a.map((x) => /* @__PURE__ */ e(
2212
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-1", children: a == null ? void 0 : a.map((C) => /* @__PURE__ */ e(
2213
2213
  "div",
2214
2214
  {
2215
2215
  className: Y(
2216
2216
  "mr-2 cursor-pointer rounded-md text-sm transition-colors hover:bg-muted"
2217
2217
  ),
2218
- children: L(x)
2218
+ children: L(C)
2219
2219
  },
2220
- x.column_name
2220
+ C.column_name
2221
2221
  )) }),
2222
2222
  /* @__PURE__ */ e(lt, { orientation: "vertical" }),
2223
2223
  /* @__PURE__ */ e(lt, { orientation: "horizontal" })
@@ -2226,71 +2226,71 @@ function Zl({
2226
2226
  )
2227
2227
  ] });
2228
2228
  }
2229
- function Gn() {
2230
- const t = _((c) => c.authToken), n = f(
2231
- (c) => c.selectedConnectionId
2229
+ function Gn(t) {
2230
+ const n = _((u) => u.authToken) || t, a = f(
2231
+ (u) => u.selectedConnectionId
2232
2232
  ), {
2233
- refetch: a,
2234
- data: s,
2235
- isLoading: l,
2236
- isError: o
2233
+ refetch: s,
2234
+ data: l,
2235
+ isLoading: o,
2236
+ isError: i
2237
2237
  } = Te({
2238
2238
  queryKey: ["connections"],
2239
2239
  queryFn: () => Ve(
2240
2240
  "https://semaphor.cloud/api/v1/connections",
2241
- (t == null ? void 0 : t.accessToken) || ""
2241
+ (n == null ? void 0 : n.accessToken) || ""
2242
2242
  ),
2243
- enabled: !!(t != null && t.accessToken)
2243
+ enabled: !!(n != null && n.accessToken)
2244
2244
  // Only fetch if authToken is present
2245
- }), i = s == null ? void 0 : s.connections.find(
2246
- (c) => c.id === n
2245
+ }), c = l == null ? void 0 : l.connections.find(
2246
+ (u) => u.id === a
2247
2247
  );
2248
2248
  return {
2249
- connectionsData: s,
2250
- isConnectionsLoading: l,
2251
- isConnectionsError: o,
2252
- refetchConnections: a,
2253
- currentConnection: i
2249
+ connectionsData: l,
2250
+ isConnectionsLoading: o,
2251
+ isConnectionsError: i,
2252
+ refetchConnections: s,
2253
+ currentConnection: c
2254
2254
  };
2255
2255
  }
2256
- function $n() {
2257
- var h;
2258
- const t = f(
2256
+ function $n(t) {
2257
+ var N;
2258
+ const n = _((b) => b.authToken) || t, a = f(
2259
2259
  (b) => b.selectedConnectionId
2260
- ), n = f(
2260
+ ), s = f(
2261
2261
  (b) => b.selectedDatabaseName
2262
- ), a = f(
2262
+ ), l = f(
2263
2263
  (b) => b.selectedDatamodelId
2264
- ), s = f(
2264
+ ), o = f(
2265
2265
  (b) => b.selectedSchemaName
2266
- ), l = f((b) => b.selectedTableName), o = _((b) => b.authToken), { currentConnection: i } = Gn(), c = i == null ? void 0 : i.type, {
2267
- data: u,
2268
- isLoading: p,
2269
- isFetching: m,
2270
- isError: y,
2271
- refetch: g
2266
+ ), i = f((b) => b.selectedTableName), { currentConnection: c } = Gn(), u = c == null ? void 0 : c.type, {
2267
+ data: p,
2268
+ isLoading: m,
2269
+ isFetching: y,
2270
+ isError: g,
2271
+ refetch: d
2272
2272
  } = Te({
2273
2273
  queryKey: [
2274
2274
  "columns",
2275
- t,
2276
- n,
2277
2275
  a,
2278
2276
  s,
2279
- l
2277
+ l,
2278
+ o,
2279
+ i
2280
2280
  ],
2281
2281
  queryFn: () => Ve(
2282
2282
  "https://semaphor.cloud/api/v1/columns",
2283
- (o == null ? void 0 : o.accessToken) || "",
2283
+ (n == null ? void 0 : n.accessToken) || "",
2284
2284
  {
2285
- connection_id: t,
2286
- datamodel_id: a || "",
2285
+ connection_id: a,
2286
+ datamodel_id: l || "",
2287
2287
  // don't pass undefined. Pass empty string
2288
- database_name: n,
2289
- schema_name: s,
2290
- table_name: l
2288
+ database_name: s,
2289
+ schema_name: o,
2290
+ table_name: i
2291
2291
  }
2292
2292
  ),
2293
- enabled: d(c)
2293
+ enabled: v(u)
2294
2294
  // (!!selectedConnectionId &&
2295
2295
  // !!selectedDatabaseName &&
2296
2296
  // !!selectedSchemaName &&
@@ -2299,21 +2299,21 @@ function $n() {
2299
2299
  //currentConnection?.type === 'API',
2300
2300
  // && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
2301
2301
  });
2302
- function d(b) {
2303
- return o != null && o.accessToken ? !!(t && n && n !== "NA" && s && l || t && (b === "S3" || b === "API") || a && a) : !1;
2302
+ function v(b) {
2303
+ return n != null && n.accessToken ? !!(a && s && s !== "NA" && o && i || a && (b === "S3" || b === "API") || l && l) : !1;
2304
2304
  }
2305
2305
  return {
2306
- columns: (h = u == null ? void 0 : u.columns) == null ? void 0 : h.map(
2306
+ columns: (N = p == null ? void 0 : p.columns) == null ? void 0 : N.map(
2307
2307
  (b) => ({
2308
2308
  ...b,
2309
2309
  data_type: b.data_type.toLowerCase()
2310
2310
  })
2311
2311
  ),
2312
2312
  // columnsData,
2313
- isColumnsLoading: p,
2314
- isColumnsFetching: m,
2315
- isColumnsError: y,
2316
- refetchColumns: g
2313
+ isColumnsLoading: m,
2314
+ isColumnsFetching: y,
2315
+ isColumnsError: g,
2316
+ refetchColumns: d
2317
2317
  };
2318
2318
  }
2319
2319
  function Ce(t, n) {
@@ -2346,11 +2346,11 @@ function Ce(t, n) {
2346
2346
  }
2347
2347
  const {
2348
2348
  refetchConnections: h,
2349
- connectionsData: b,
2350
- isConnectionsLoading: C,
2349
+ connectionsData: N,
2350
+ isConnectionsLoading: b,
2351
2351
  isConnectionsError: O,
2352
2352
  currentConnection: k
2353
- } = Gn(), {
2353
+ } = Gn(t), {
2354
2354
  refetch: z,
2355
2355
  data: S,
2356
2356
  isLoading: A,
@@ -2371,7 +2371,7 @@ function Ce(t, n) {
2371
2371
  isLoading: D,
2372
2372
  isFetching: L,
2373
2373
  isError: T,
2374
- refetch: x
2374
+ refetch: C
2375
2375
  } = Te({
2376
2376
  queryKey: ["databases", s],
2377
2377
  queryFn: () => Ve(
@@ -2402,7 +2402,7 @@ function Ce(t, n) {
2402
2402
  enabled: !!s && !!o && !Z && o !== "NA"
2403
2403
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
2404
2404
  }), {
2405
- data: N,
2405
+ data: x,
2406
2406
  isLoading: M,
2407
2407
  isFetching: F,
2408
2408
  isError: E,
@@ -2430,7 +2430,7 @@ function Ce(t, n) {
2430
2430
  isColumnsFetching: me,
2431
2431
  isColumnsError: ge,
2432
2432
  refetchColumns: ye
2433
- } = $n();
2433
+ } = $n(t);
2434
2434
  ce(() => {
2435
2435
  (P === "S3" || P === "API") && (m(""), y(""), p(""), P === "API" && g("api"));
2436
2436
  }, [
@@ -2454,7 +2454,7 @@ function Ce(t, n) {
2454
2454
  p(j === "none" ? "" : j), j !== "none" && j !== "" && m("");
2455
2455
  }
2456
2456
  w && ((ga = w == null ? void 0 : w.databases) == null ? void 0 : ga.length) > 0, R && ((ya = R == null ? void 0 : R.schemas) == null ? void 0 : ya.length) > 0;
2457
- const Tt = b == null ? void 0 : b.connections.map(
2457
+ const Tt = N == null ? void 0 : N.connections.map(
2458
2458
  (j) => ({
2459
2459
  id: j.id,
2460
2460
  name: j.name,
@@ -2469,7 +2469,7 @@ function Ce(t, n) {
2469
2469
  })), ot = R == null ? void 0 : R.schemas.map((j) => ({
2470
2470
  id: j.schema_name,
2471
2471
  name: j.schema_name
2472
- })), ne = N == null ? void 0 : N.tables.map((j) => ({
2472
+ })), ne = x == null ? void 0 : x.tables.map((j) => ({
2473
2473
  id: j.table_name,
2474
2474
  name: j.table_name
2475
2475
  })), be = (va = S == null ? void 0 : S.datamodels.find(
@@ -2484,7 +2484,7 @@ function Ce(t, n) {
2484
2484
  return {
2485
2485
  connectionItems: Tt,
2486
2486
  selectedConnectionId: s,
2487
- isConnectionsLoading: C,
2487
+ isConnectionsLoading: b,
2488
2488
  isConnectionsError: O,
2489
2489
  modelItems: Ot,
2490
2490
  selectedDatamodelId: l,
@@ -2513,7 +2513,7 @@ function Ce(t, n) {
2513
2513
  schemaName: te,
2514
2514
  refetchConnections: h,
2515
2515
  refetchModels: z,
2516
- refetchDatabases: x,
2516
+ refetchDatabases: C,
2517
2517
  refetchSchemas: I,
2518
2518
  refetchTables: W,
2519
2519
  refetchColumns: ye,
@@ -2540,8 +2540,8 @@ function Jn({
2540
2540
  connectionItems: d,
2541
2541
  modelItems: v,
2542
2542
  schemaItems: h,
2543
- databaseItems: b,
2544
- tableItems: C,
2543
+ databaseItems: N,
2544
+ tableItems: b,
2545
2545
  columns: O,
2546
2546
  isConnectionsLoading: k,
2547
2547
  isModelsLoading: z,
@@ -2554,13 +2554,13 @@ function Jn({
2554
2554
  isColumnsError: D,
2555
2555
  isColumnsLoadingOrFetching: L,
2556
2556
  isTableLoadingOrFetching: T,
2557
- isTableError: x,
2557
+ isTableError: C,
2558
2558
  connectionType: R,
2559
2559
  isNonDbConnection: J,
2560
2560
  refetchDatabases: ee,
2561
2561
  refetchModels: H,
2562
2562
  refetchSchemas: I,
2563
- refetchTables: N,
2563
+ refetchTables: x,
2564
2564
  refetchColumns: M,
2565
2565
  refetchConnections: F,
2566
2566
  handleConnectionChange: E,
@@ -2600,7 +2600,7 @@ function Jn({
2600
2600
  onChange: W,
2601
2601
  isError: P,
2602
2602
  isLoading: B,
2603
- items: b,
2603
+ items: N,
2604
2604
  value: i || "",
2605
2605
  title: "Database",
2606
2606
  type: "combobox"
@@ -2656,10 +2656,10 @@ function Jn({
2656
2656
  return ne() ? /* @__PURE__ */ e(
2657
2657
  at,
2658
2658
  {
2659
- refetch: N,
2659
+ refetch: x,
2660
2660
  onChange: m,
2661
- isError: x,
2662
- items: C,
2661
+ isError: C,
2662
+ items: b,
2663
2663
  isLoading: T,
2664
2664
  value: u || "",
2665
2665
  title: "Table",
@@ -2878,12 +2878,12 @@ function Zn(t) {
2878
2878
  if (m.current && i) {
2879
2879
  const h = m.current.getModel();
2880
2880
  h && (y.current[l.id] = h);
2881
- let b = y.current[o];
2882
- if (!b) {
2883
- const C = d();
2884
- b = i.editor.createModel(C, t), y.current[o] = b;
2881
+ let N = y.current[o];
2882
+ if (!N) {
2883
+ const b = d();
2884
+ N = i.editor.createModel(b, t), y.current[o] = N;
2885
2885
  }
2886
- m.current.setModel(b);
2886
+ m.current.setModel(N);
2887
2887
  }
2888
2888
  u(o, l), p(!0);
2889
2889
  }
@@ -2897,14 +2897,14 @@ function Zn(t) {
2897
2897
  d
2898
2898
  ]), ce(() => {
2899
2899
  if (!i) return;
2900
- const h = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", b = a === "system" ? h : a;
2900
+ const h = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", N = a === "system" ? h : a;
2901
2901
  i.editor.defineTheme("default", {
2902
2902
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
2903
- base: b === "light" ? "vs" : "vs-dark",
2903
+ base: N === "light" ? "vs" : "vs-dark",
2904
2904
  inherit: !0,
2905
2905
  rules: [],
2906
2906
  colors: {
2907
- "editor.background": b === "light" ? "#ffffff" : Is("240 10% 10%")
2907
+ "editor.background": N === "light" ? "#ffffff" : Is("240 10% 10%")
2908
2908
  // 'editor.background':
2909
2909
  // activeTheme === 'light'
2910
2910
  // ? '#ffffff'
@@ -2920,10 +2920,10 @@ function Zn(t) {
2920
2920
  }
2921
2921
  );
2922
2922
  }, [i, c, l]);
2923
- function v(h, b) {
2923
+ function v(h, N) {
2924
2924
  if (m.current = h, !y.current[l.id]) {
2925
- const C = h.getModel(), O = d();
2926
- y.current[l.id] = C || (b == null ? void 0 : b.editor.createModel(O, t)) || h.getModel();
2925
+ const b = h.getModel(), O = d();
2926
+ y.current[l.id] = b || (N == null ? void 0 : N.editor.createModel(O, t)) || h.getModel();
2927
2927
  }
2928
2928
  h.setModel(y.current[l.id]);
2929
2929
  }
@@ -3025,9 +3025,9 @@ function Yn(t) {
3025
3025
  (q) => q.actions.switchCardType
3026
3026
  ), y = f((q) => q.currentAssitantScope) || [], g = f((q) => q.userInputForAI), d = f((q) => q.triggerAIRun), v = f(
3027
3027
  (q) => q.selectedDatabaseName
3028
- ), h = f((q) => q.selectedTableName), b = f(
3028
+ ), h = f((q) => q.selectedTableName), N = f(
3029
3029
  (q) => q.selectedConnectionId
3030
- ), C = f(
3030
+ ), b = f(
3031
3031
  (q) => q.selectedSchemaName
3032
3032
  ), O = _(
3033
3033
  (q) => q.dashboard.aiScopeTables
@@ -3038,7 +3038,7 @@ function Yn(t) {
3038
3038
  error: D,
3039
3039
  append: L,
3040
3040
  input: T,
3041
- setInput: x,
3041
+ setInput: C,
3042
3042
  status: R,
3043
3043
  handleInputChange: J,
3044
3044
  handleSubmit: ee,
@@ -3055,7 +3055,7 @@ function Yn(t) {
3055
3055
  //maxToolRoundtrips: 5,
3056
3056
  onToolCall: I,
3057
3057
  onFinish(q, te) {
3058
- N(te.usage), a(""), te.finishReason === "stop" && a("");
3058
+ x(te.usage), a(""), te.finishReason === "stop" && a("");
3059
3059
  }
3060
3060
  });
3061
3061
  ce(() => {
@@ -3101,7 +3101,7 @@ function Yn(t) {
3101
3101
  a("Analyzing...");
3102
3102
  }
3103
3103
  }
3104
- function N(q) {
3104
+ function x(q) {
3105
3105
  l((te) => te ? {
3106
3106
  promptTokens: te.promptTokens + q.promptTokens,
3107
3107
  completionTokens: te.completionTokens + q.completionTokens,
@@ -3126,11 +3126,11 @@ function Yn(t) {
3126
3126
  function E() {
3127
3127
  const q = {
3128
3128
  databaseName: v || "",
3129
- schemaName: C || "",
3129
+ schemaName: b || "",
3130
3130
  tableName: h || "",
3131
3131
  datamodelId: B || "",
3132
3132
  datamodelName: ft(S),
3133
- connectionId: b || "",
3133
+ connectionId: N || "",
3134
3134
  connectionType: A || ""
3135
3135
  }, te = Na([...y, q]);
3136
3136
  F(te);
@@ -3138,10 +3138,10 @@ function Yn(t) {
3138
3138
  function W() {
3139
3139
  const q = {
3140
3140
  databaseName: v || "",
3141
- schemaName: C || "",
3141
+ schemaName: b || "",
3142
3142
  tableName: h || "",
3143
3143
  datamodelName: ft(S),
3144
- connectionId: b || "",
3144
+ connectionId: N || "",
3145
3145
  connectionType: A || "",
3146
3146
  datamodelId: B || ""
3147
3147
  };
@@ -3166,7 +3166,7 @@ function Yn(t) {
3166
3166
  reload: w,
3167
3167
  append: L,
3168
3168
  input: T,
3169
- setInput: x,
3169
+ setInput: C,
3170
3170
  isLoading: G,
3171
3171
  handleSetAIScope: W,
3172
3172
  handleAddCurrentTableToScope: E,
@@ -3225,13 +3225,13 @@ function Xn({
3225
3225
  sql: d,
3226
3226
  customCfg: p ? s.customCfg : null
3227
3227
  }, h = a.cards.map(
3228
- (C) => C.id === s.id ? v : C
3229
- ), b = {
3228
+ (b) => b.id === s.id ? v : b
3229
+ ), N = {
3230
3230
  ...a,
3231
3231
  cards: h,
3232
3232
  activeCardId: di(h, a.activeCardId)
3233
3233
  };
3234
- y == null || y(b);
3234
+ y == null || y(N);
3235
3235
  }
3236
3236
  return /* @__PURE__ */ r(
3237
3237
  Q,
@@ -3312,22 +3312,22 @@ function di(t, n) {
3312
3312
  }
3313
3313
  function ui() {
3314
3314
  const t = na(), [n, a] = U(!1), [s, l] = U(!1);
3315
- f((N) => N.frame);
3316
- const o = f((N) => N.card);
3317
- f((N) => N.isShowingVisual), f(
3318
- (N) => N.selectedConnectionId
3319
- ), f((N) => N.tempQueryData), f(
3320
- (N) => N.selectedDatabaseName
3315
+ f((x) => x.frame);
3316
+ const o = f((x) => x.card);
3317
+ f((x) => x.isShowingVisual), f(
3318
+ (x) => x.selectedConnectionId
3319
+ ), f((x) => x.tempQueryData), f(
3320
+ (x) => x.selectedDatabaseName
3321
3321
  ), f(
3322
- (N) => N.selectedDatamodelId
3322
+ (x) => x.selectedDatamodelId
3323
3323
  ), f(
3324
- (N) => N.selectedSchemaName
3324
+ (x) => x.selectedSchemaName
3325
3325
  );
3326
- const i = f((N) => N.showAIDialog);
3327
- f((N) => N.selectedTableName);
3328
- const c = f((N) => {
3326
+ const i = f((x) => x.showAIDialog);
3327
+ f((x) => x.selectedTableName);
3328
+ const c = f((x) => {
3329
3329
  var M;
3330
- return (M = N == null ? void 0 : N.card) == null ? void 0 : M.sql;
3330
+ return (M = x == null ? void 0 : x.card) == null ? void 0 : M.sql;
3331
3331
  }), { sheetFilterValues: u } = Ls(), {
3332
3332
  setCardCustomCfg: p,
3333
3333
  setQueryResultColumns: m,
@@ -3337,13 +3337,13 @@ function ui() {
3337
3337
  setPythonStdOut: d,
3338
3338
  setCardPreferences: v,
3339
3339
  setCardType: h,
3340
- setCardPython: b,
3341
- runAssistant: C,
3340
+ setCardPython: N,
3341
+ runAssistant: b,
3342
3342
  setShowAIDialog: O
3343
3343
  } = X();
3344
- f((N) => N.onSave), f((N) => N.onClose), f((N) => N.actions.setSqlGen);
3345
- const k = f((N) => N.runSql), z = f((N) => N.actions.setRunSql), S = f(
3346
- (N) => N.actions.setIsSqlRunning
3344
+ f((x) => x.onSave), f((x) => x.onClose), f((x) => x.actions.setSqlGen);
3345
+ const k = f((x) => x.runSql), z = f((x) => x.actions.setRunSql), S = f(
3346
+ (x) => x.actions.setIsSqlRunning
3347
3347
  ), {
3348
3348
  data: A,
3349
3349
  isLoading: B,
@@ -3353,15 +3353,15 @@ function ui() {
3353
3353
  error: D,
3354
3354
  queryKey: L,
3355
3355
  refetch: T,
3356
- errorMessage: x
3356
+ errorMessage: C
3357
3357
  } = fe(o), { handleSetAIScope: R } = Yn();
3358
3358
  ce(() => {
3359
3359
  if (A && (A.rowLimitExceeded && ht.error("Row limit (10,000) exceeded. Refine your query.", {
3360
3360
  position: "top-center",
3361
3361
  richColors: !0
3362
3362
  }), d((A == null ? void 0 : A.output) || ""), A.records.length > 0)) {
3363
- const { dimensionKeys: N } = Bt(A.records);
3364
- m(N);
3363
+ const { dimensionKeys: x } = Bt(A.records);
3364
+ m(x);
3365
3365
  }
3366
3366
  }, [A, m, d]), ce(() => {
3367
3367
  (B || P) && S(!0), (w || Z) && S(!1), w && (m([]), d(""));
@@ -3380,18 +3380,18 @@ function ui() {
3380
3380
  k && (t.getQueryData(L) || T(), z(!1));
3381
3381
  }, [k, T, z, L, t]);
3382
3382
  async function J() {
3383
- const N = `Can you help me debug this query in the current table scope?
3383
+ const x = `Can you help me debug this query in the current table scope?
3384
3384
 
3385
3385
  Error:
3386
3386
 
3387
- ${x}
3387
+ ${C}
3388
3388
 
3389
3389
  Query:
3390
3390
 
3391
3391
  ${c}
3392
3392
 
3393
3393
  `;
3394
- C(N);
3394
+ b(x);
3395
3395
  }
3396
3396
  function ee() {
3397
3397
  return /* @__PURE__ */ r(ae, { children: [
@@ -3502,7 +3502,7 @@ function ui() {
3502
3502
  Qn,
3503
3503
  {
3504
3504
  sql: A == null ? void 0 : A.sql,
3505
- error: x,
3505
+ error: C,
3506
3506
  onClick: J
3507
3507
  }
3508
3508
  ),
@@ -3511,7 +3511,7 @@ function ui() {
3511
3511
  on,
3512
3512
  {
3513
3513
  pressed: n,
3514
- onPressedChange: (N) => a(N),
3514
+ onPressedChange: (x) => a(x),
3515
3515
  className: "",
3516
3516
  size: "sm",
3517
3517
  children: /* @__PURE__ */ e(ri, { className: "size-4 text-foreground/70" })
@@ -3617,10 +3617,10 @@ function hi({ card: t }) {
3617
3617
  colors: ((k = (O = c == null ? void 0 : c.chart) == null ? void 0 : O.dataset) == null ? void 0 : k.backgroundColor) || []
3618
3618
  };
3619
3619
  (z = t.customCardPreferences) != null && z.inputData;
3620
- const { getCard: p } = dn(((S = t.customCardPreferences) == null ? void 0 : S.url) || ""), m = ((A = t.customCardPreferences) == null ? void 0 : A.visualType) || "single", y = f((T) => T.frame), { setCustomCardPreferences: g } = X(), { data: d } = fe(t), v = Mn((T, x) => {
3620
+ const { getCard: p } = dn(((S = t.customCardPreferences) == null ? void 0 : S.url) || ""), m = ((A = t.customCardPreferences) == null ? void 0 : A.visualType) || "single", y = f((T) => T.frame), { setCustomCardPreferences: g } = X(), { data: d } = fe(t), v = Mn((T, C) => {
3621
3621
  l((R) => ({
3622
3622
  ...R,
3623
- [T]: x
3623
+ [T]: C
3624
3624
  }));
3625
3625
  }, []);
3626
3626
  if (!((B = t.customCardPreferences) != null && B.componentName))
@@ -3628,14 +3628,14 @@ function hi({ card: t }) {
3628
3628
  const h = p(
3629
3629
  (P = t.customCardPreferences) == null ? void 0 : P.componentName
3630
3630
  );
3631
- function b(T) {
3631
+ function N(T) {
3632
3632
  a(T);
3633
3633
  }
3634
- const C = Object.keys(
3634
+ const b = Object.keys(
3635
3635
  ((Z = t.customCardPreferences) == null ? void 0 : Z.dataInputCardIds) || {}
3636
3636
  ).map((T) => {
3637
3637
  var J, ee, H;
3638
- const x = (ee = (J = t.customCardPreferences) == null ? void 0 : J.dataInputCardIds) == null ? void 0 : ee[T].cardId, R = (H = y == null ? void 0 : y.cards) == null ? void 0 : H.find((I) => I.id === x);
3638
+ const C = (ee = (J = t.customCardPreferences) == null ? void 0 : J.dataInputCardIds) == null ? void 0 : ee[T].cardId, R = (H = y == null ? void 0 : y.cards) == null ? void 0 : H.find((I) => I.id === C);
3639
3639
  return R || null;
3640
3640
  });
3641
3641
  return /* @__PURE__ */ e("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ r(
@@ -3658,14 +3658,14 @@ function hi({ card: t }) {
3658
3658
  ((D = t.customCardPreferences) == null ? void 0 : D.dataInputCardIds) || {}
3659
3659
  ).map((T) => {
3660
3660
  var J, ee, H;
3661
- const x = (ee = (J = t.customCardPreferences) == null ? void 0 : J.dataInputCardIds) == null ? void 0 : ee[T].cardId, R = (H = y == null ? void 0 : y.cards) == null ? void 0 : H.find(
3662
- (I) => I.id === x
3661
+ const C = (ee = (J = t.customCardPreferences) == null ? void 0 : J.dataInputCardIds) == null ? void 0 : ee[T].cardId, R = (H = y == null ? void 0 : y.cards) == null ? void 0 : H.find(
3662
+ (I) => I.id === C
3663
3663
  );
3664
3664
  if (R)
3665
3665
  return /* @__PURE__ */ e(
3666
3666
  $s,
3667
3667
  {
3668
- onLoadingStatus: b,
3668
+ onLoadingStatus: N,
3669
3669
  onDataChange: v,
3670
3670
  dataInputIndex: T,
3671
3671
  card: R
@@ -3678,13 +3678,13 @@ function hi({ card: t }) {
3678
3678
  {
3679
3679
  theme: u,
3680
3680
  onDataChange: v,
3681
- settings: C.map(
3681
+ settings: b.map(
3682
3682
  (T) => {
3683
- var x;
3684
- return (x = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : x.settings;
3683
+ var C;
3684
+ return (C = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : C.settings;
3685
3685
  }
3686
3686
  ),
3687
- data: C.map((T) => T != null && T.id ? s == null ? void 0 : s[T.id] : [])
3687
+ data: b.map((T) => T != null && T.id ? s == null ? void 0 : s[T.id] : [])
3688
3688
  }
3689
3689
  ) })
3690
3690
  ] })
@@ -3699,10 +3699,10 @@ function as({
3699
3699
  className: t,
3700
3700
  ...n
3701
3701
  }) {
3702
- var b;
3703
- const a = f((C) => C.card), s = ((b = a.customCardPreferences) == null ? void 0 : b.showCardHeader) ?? !0, l = f((C) => C.frame), o = _((C) => C.dashboard.filters);
3704
- f((C) => C.actions.setRunSql);
3705
- const { updateFilter: i } = Ye(), c = o == null ? void 0 : o.find((C) => C.id === l.filterId), { data: u, isLoading: p, isFetching: m } = fe(a), { setCard: y } = X(), { data: g } = sa(a), d = Qe(() => !a.id || !(u != null && u.records) ? null : un({
3702
+ var N;
3703
+ const a = f((b) => b.card), s = ((N = a.customCardPreferences) == null ? void 0 : N.showCardHeader) ?? !0, l = f((b) => b.frame), o = _((b) => b.dashboard.filters);
3704
+ f((b) => b.actions.setRunSql);
3705
+ const { updateFilter: i } = Ye(), c = o == null ? void 0 : o.find((b) => b.id === l.filterId), { data: u, isLoading: p, isFetching: m } = fe(a), { setCard: y } = X(), { data: g } = sa(a), d = Qe(() => !a.id || !(u != null && u.records) ? null : un({
3706
3706
  data: u == null ? void 0 : u.records,
3707
3707
  cardType: a.type,
3708
3708
  // cfg: card.cfg,
@@ -3718,8 +3718,8 @@ function as({
3718
3718
  a.preferences,
3719
3719
  g
3720
3720
  ]);
3721
- function v(C) {
3722
- return /* @__PURE__ */ e(hi, { card: C });
3721
+ function v(b) {
3722
+ return /* @__PURE__ */ e(hi, { card: b });
3723
3723
  }
3724
3724
  function h() {
3725
3725
  if (u != null && u.records && (u == null ? void 0 : u.records.length) === 0 && !p && !m)
@@ -3756,7 +3756,7 @@ function as({
3756
3756
  nt,
3757
3757
  {
3758
3758
  text: a.title,
3759
- onSave: (C) => y({ ...a, title: C }),
3759
+ onSave: (b) => y({ ...a, title: b }),
3760
3760
  children: /* @__PURE__ */ e("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e(Ks, { className: "text-base", children: a.title || "Edit title..." }) })
3761
3761
  },
3762
3762
  a.title
@@ -3765,7 +3765,7 @@ function as({
3765
3765
  nt,
3766
3766
  {
3767
3767
  text: a.description || "",
3768
- onSave: (C) => y({ ...a, description: C }),
3768
+ onSave: (b) => y({ ...a, description: b }),
3769
3769
  children: /* @__PURE__ */ e(Ws, { children: a.description || "Edit description..." })
3770
3770
  },
3771
3771
  a.description
@@ -3777,7 +3777,7 @@ function as({
3777
3777
  {
3778
3778
  className: "my-1",
3779
3779
  text: c.title || c.column,
3780
- onSave: (C) => i({ ...c, title: C }),
3780
+ onSave: (b) => i({ ...c, title: b }),
3781
3781
  children: /* @__PURE__ */ e($, { children: c.title })
3782
3782
  }
3783
3783
  ),
@@ -3902,7 +3902,7 @@ const Et = ({
3902
3902
  /* @__PURE__ */ e(Q, { onClick: l, variant: "outline", children: "Close" })
3903
3903
  ] });
3904
3904
  function yi() {
3905
- const [t, n] = U(!1), [a, s] = U(""), [l, o] = U(""), [i, c] = U(""), [u, p] = U(""), m = f((S) => S.card), y = f((S) => S.card.customCfg), g = y ? JSON.stringify(y, null, 2) : "", { data: d } = fe(m), { data: v } = sa(m), { setCardCustomCfg: h, setCustomVisualCode: b } = X(), C = (S) => {
3905
+ const [t, n] = U(!1), [a, s] = U(""), [l, o] = U(""), [i, c] = U(""), [u, p] = U(""), m = f((S) => S.card), y = f((S) => S.card.customCfg), g = y ? JSON.stringify(y, null, 2) : "", { data: d } = fe(m), { data: v } = sa(m), { setCardCustomCfg: h, setCustomVisualCode: N } = X(), b = (S) => {
3906
3906
  var A, B;
3907
3907
  return JSON.stringify(
3908
3908
  {
@@ -3929,13 +3929,13 @@ function yi() {
3929
3929
  topoJson: v
3930
3930
  });
3931
3931
  if (S) {
3932
- s(C(S)), c(((B = m.preferences) == null ? void 0 : B.customVisualCode) || "");
3932
+ s(b(S)), c(((B = m.preferences) == null ? void 0 : B.customVisualCode) || "");
3933
3933
  const P = ar(S, y);
3934
- o(C(P));
3934
+ o(b(P));
3935
3935
  }
3936
3936
  }, k = () => {
3937
3937
  try {
3938
- if (i && b(i), l) {
3938
+ if (i && N(i), l) {
3939
3939
  const S = JSON.parse(
3940
3940
  l
3941
3941
  ), A = nr(
@@ -4302,7 +4302,7 @@ function Oa(t, n) {
4302
4302
  return ((o = (l = (s = t == null ? void 0 : t.chartOptions) == null ? void 0 : s.scales) == null ? void 0 : l[a]) == null ? void 0 : o.type) || "linear";
4303
4303
  }
4304
4304
  function Si() {
4305
- var R, J, ee, H, I, N;
4305
+ var R, J, ee, H, I, x;
4306
4306
  const [t, n] = U(!1), a = f((M) => {
4307
4307
  var F;
4308
4308
  return (F = M.card) == null ? void 0 : F.preferences;
@@ -4311,8 +4311,8 @@ function Si() {
4311
4311
  ), [i, c] = U(
4312
4312
  ((ee = (J = (R = a == null ? void 0 : a.chartOptions) == null ? void 0 : R.scales) == null ? void 0 : J[s]) == null ? void 0 : ee.min) || ""
4313
4313
  ), [u, p] = U(
4314
- ((N = (I = (H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales) == null ? void 0 : I[s]) == null ? void 0 : N.max) || ""
4315
- ), [m, y] = U(i || u ? "custom" : "auto"), [g, d] = U(""), [v, h] = U(0), [b, C] = U(""), [O, k] = U(""), [z, S] = U(""), A = f(
4314
+ ((x = (I = (H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales) == null ? void 0 : I[s]) == null ? void 0 : x.max) || ""
4315
+ ), [m, y] = U(i || u ? "custom" : "auto"), [g, d] = U(""), [v, h] = U(0), [N, b] = U(""), [O, k] = U(""), [z, S] = U(""), A = f(
4316
4316
  (M) => M.actions.setCardPreferences
4317
4317
  ), { updateCardInFrame: B } = X(), P = f((M) => M.card), Z = f((M) => {
4318
4318
  var F;
@@ -4324,7 +4324,7 @@ function Si() {
4324
4324
  ((E = (F = (M = a == null ? void 0 : a.chartOptions) == null ? void 0 : M.scales) == null ? void 0 : F[s]) == null ? void 0 : E.min) === 0 ? 0 : ""
4325
4325
  ), p(((ie = (G = (W = a == null ? void 0 : a.chartOptions) == null ? void 0 : W.scales) == null ? void 0 : G[s]) == null ? void 0 : ie.max) || ""), d(
4326
4326
  ((q = (ye = (ge = (me = a == null ? void 0 : a.chartOptions) == null ? void 0 : me.scales) == null ? void 0 : ge[s]) == null ? void 0 : ye.ticks) == null ? void 0 : q.stepSize) || ""
4327
- ), h(((te = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : te.decimalPlaces) || 0), C(((he = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : he.suffix) || ""), k(((De = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : De.currency) || ""), S(((Ue = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ue.locale) || "");
4327
+ ), h(((te = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : te.decimalPlaces) || 0), b(((he = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : he.suffix) || ""), k(((De = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : De.currency) || ""), S(((Ue = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ue.locale) || "");
4328
4328
  }, [t, a, s]);
4329
4329
  function D(M, F) {
4330
4330
  return F === "" || /^[0-9\b]+$/.test(F) ? Number(F) : Number(M);
@@ -4430,7 +4430,7 @@ function Si() {
4430
4430
  ] })
4431
4431
  ] });
4432
4432
  }
4433
- function x() {
4433
+ function C() {
4434
4434
  var W;
4435
4435
  let M = {};
4436
4436
  m === "custom" && (M = {
@@ -4455,7 +4455,7 @@ function Si() {
4455
4455
  },
4456
4456
  numberAxisFormat: {
4457
4457
  decimalPlaces: v,
4458
- suffix: b,
4458
+ suffix: N,
4459
4459
  currency: O,
4460
4460
  locale: z
4461
4461
  }
@@ -4524,7 +4524,7 @@ function Si() {
4524
4524
  /* @__PURE__ */ e("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e(
4525
4525
  Q,
4526
4526
  {
4527
- onClick: x,
4527
+ onClick: C,
4528
4528
  variant: "secondary",
4529
4529
  className: "col-span-1 col-start-3 h-8 w-full",
4530
4530
  children: "Apply"
@@ -4724,8 +4724,8 @@ function dt() {
4724
4724
  var H;
4725
4725
  const t = f((I) => I.frame), n = f((I) => I.card), a = f((I) => I.isDevMode), s = f((I) => I.isShowingVisual), l = _((I) => I.isVisualEditing), o = f((I) => I.isSqlRunning), i = f((I) => I.pythonStdOut), c = f(
4726
4726
  (I) => {
4727
- var N;
4728
- return (N = I.card.preferences) == null ? void 0 : N.chartOptions;
4727
+ var x;
4728
+ return (x = I.card.preferences) == null ? void 0 : x.chartOptions;
4729
4729
  }
4730
4730
  ), u = f((I) => I.actions.setRunSql);
4731
4731
  yn(c);
@@ -4736,7 +4736,7 @@ function dt() {
4736
4736
  setActiveTabCardId: g,
4737
4737
  runAssistant: d,
4738
4738
  setChartGrid: v
4739
- } = X(), { data: h, isLoading: b, isFetching: C, error: O } = fe(n);
4739
+ } = X(), { data: h, isLoading: N, isFetching: b, error: O } = fe(n);
4740
4740
  if (!n) return /* @__PURE__ */ e(ae, { children: "No Active Card" });
4741
4741
  function k() {
4742
4742
  const I = {
@@ -4763,12 +4763,12 @@ function dt() {
4763
4763
  z(I);
4764
4764
  }
4765
4765
  function z(I) {
4766
- const N = {
4766
+ const x = {
4767
4767
  ...t,
4768
4768
  cards: [...t.cards, I],
4769
4769
  activeCardId: I.id
4770
4770
  };
4771
- p(N), m(I), g(I.id);
4771
+ p(x), m(I), g(I.id);
4772
4772
  }
4773
4773
  function S() {
4774
4774
  const I = {
@@ -4780,9 +4780,9 @@ function dt() {
4780
4780
  z(I);
4781
4781
  }
4782
4782
  function A(I) {
4783
- const N = t.cards.filter((E) => E.id !== I), M = N[0], F = {
4783
+ const x = t.cards.filter((E) => E.id !== I), M = x[0], F = {
4784
4784
  ...t,
4785
- cards: N,
4785
+ cards: x,
4786
4786
  // update the active card to the first card in the frame
4787
4787
  activeCardId: M.id
4788
4788
  };
@@ -4792,37 +4792,37 @@ function dt() {
4792
4792
  a || P(I), g(I);
4793
4793
  }
4794
4794
  function P(I) {
4795
- const N = {
4795
+ const x = {
4796
4796
  ...t,
4797
4797
  cards: t.cards.map((F) => F.id === n.id ? n : F),
4798
4798
  activeCardId: I
4799
4799
  };
4800
- p(N);
4801
- const M = N.cards.find((F) => F.id === I);
4800
+ p(x);
4801
+ const M = x.cards.find((F) => F.id === I);
4802
4802
  M.sql && u(!0), m(M);
4803
4803
  }
4804
- const Z = (I, N) => {
4805
- console.log("handleDragStart", N), I.dataTransfer.setData("tabIndex", N.toString());
4804
+ const Z = (I, x) => {
4805
+ console.log("handleDragStart", x), I.dataTransfer.setData("tabIndex", x.toString());
4806
4806
  }, w = (I) => {
4807
4807
  I.preventDefault();
4808
- }, D = (I, N) => {
4808
+ }, D = (I, x) => {
4809
4809
  const M = I.dataTransfer.getData("tabIndex");
4810
- if (M === N.toString()) return;
4810
+ if (M === x.toString()) return;
4811
4811
  const F = Array.from(t.cards), [E] = F.splice(parseInt(M), 1);
4812
- F.splice(N, 0, E), p({ ...t, cards: F });
4812
+ F.splice(x, 0, E), p({ ...t, cards: F });
4813
4813
  };
4814
- function L(I, N) {
4815
- return I.cards.length === 1 && (N.displayTab === !0 || N.displayTab === void 0) || I.activeCardId !== N.id && (N.displayTab === !0 || N.displayTab === void 0) ? null : /* @__PURE__ */ e(
4814
+ function L(I, x) {
4815
+ return I.cards.length === 1 && (x.displayTab === !0 || x.displayTab === void 0) || I.activeCardId !== x.id && (x.displayTab === !0 || x.displayTab === void 0) ? null : /* @__PURE__ */ e(
4816
4816
  "div",
4817
4817
  {
4818
4818
  onClick: () => {
4819
- const M = N.displayTab === void 0 ? !1 : !N.displayTab;
4820
- m({ ...N, displayTab: M }), y({
4821
- ...N,
4819
+ const M = x.displayTab === void 0 ? !1 : !x.displayTab;
4820
+ m({ ...x, displayTab: M }), y({
4821
+ ...x,
4822
4822
  displayTab: M
4823
4823
  });
4824
4824
  },
4825
- children: N.displayTab === !0 || N.displayTab === void 0 ? /* @__PURE__ */ e(ur, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e(dl, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
4825
+ children: x.displayTab === !0 || x.displayTab === void 0 ? /* @__PURE__ */ e(ur, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e(dl, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
4826
4826
  }
4827
4827
  );
4828
4828
  }
@@ -4834,9 +4834,9 @@ function dt() {
4834
4834
  value: t.activeCardId,
4835
4835
  className: "flex grow flex-col",
4836
4836
  children: [
4837
- t.cards.map((I) => /* @__PURE__ */ e(mt, { className: "mt-0 grow", value: I.id, children: x() }, I.id)),
4837
+ t.cards.map((I) => /* @__PURE__ */ e(mt, { className: "mt-0 grow", value: I.id, children: C() }, I.id)),
4838
4838
  /* @__PURE__ */ e(la, { className: "group mx-6 justify-between overflow-x-auto", children: /* @__PURE__ */ r("div", { className: "flex items-center", children: [
4839
- t.cards.map((I, N) => /* @__PURE__ */ e(
4839
+ t.cards.map((I, x) => /* @__PURE__ */ e(
4840
4840
  nt,
4841
4841
  {
4842
4842
  text: I.tabTitle || I.title,
@@ -4847,9 +4847,9 @@ function dt() {
4847
4847
  Je,
4848
4848
  {
4849
4849
  draggable: !0,
4850
- onDragStart: (M) => Z(M, N),
4850
+ onDragStart: (M) => Z(M, x),
4851
4851
  onDragOver: w,
4852
- onDrop: (M) => D(M, N),
4852
+ onDrop: (M) => D(M, x),
4853
4853
  className: "",
4854
4854
  value: I.id,
4855
4855
  children: [
@@ -4891,7 +4891,7 @@ function dt() {
4891
4891
  }
4892
4892
  );
4893
4893
  }
4894
- function x() {
4894
+ function C() {
4895
4895
  return n.type === "kpi" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(cr, { card: n, data: h == null ? void 0 : h.records }) }) }) : n.type === "text" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(Xe, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e(
4896
4896
  dr,
4897
4897
  {
@@ -4902,17 +4902,17 @@ function dt() {
4902
4902
  ) }) }) }) : /* @__PURE__ */ e(Dt, { FallbackComponent: hn, children: /* @__PURE__ */ e(as, { className: "grow border-none shadow-none" }) });
4903
4903
  }
4904
4904
  function R() {
4905
- const I = JSON.stringify(h == null ? void 0 : h.records, null, 2), N = new Blob([I], { type: "application/json" }), M = URL.createObjectURL(N), F = document.createElement("a");
4905
+ const I = JSON.stringify(h == null ? void 0 : h.records, null, 2), x = new Blob([I], { type: "application/json" }), M = URL.createObjectURL(x), F = document.createElement("a");
4906
4906
  F.href = M, F.download = `${n.title}.json`, F.click();
4907
4907
  }
4908
4908
  function J() {
4909
- const N = [
4909
+ const x = [
4910
4910
  Object.keys(
4911
4911
  h == null ? void 0 : h.records.reduce((W, G) => ({ ...W, ...G }), {})
4912
4912
  ).join(","),
4913
4913
  ...((h == null ? void 0 : h.records) || []).map((W) => Object.values(W).join(","))
4914
4914
  ].join(`
4915
- `), M = new Blob([N], { type: "text/csv" }), F = URL.createObjectURL(M), E = document.createElement("a");
4915
+ `), M = new Blob([x], { type: "text/csv" }), F = URL.createObjectURL(M), E = document.createElement("a");
4916
4916
  E.href = F, E.download = `${n.title}.csv`, E.click();
4917
4917
  }
4918
4918
  function ee() {
@@ -4924,7 +4924,7 @@ function dt() {
4924
4924
  {
4925
4925
  className: "relative isolate flex h-full flex-col py-3",
4926
4926
  children: [
4927
- (b || C) && /* @__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(je, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
4927
+ (N || b) && /* @__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(je, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
4928
4928
  /* @__PURE__ */ r(
4929
4929
  "div",
4930
4930
  {
@@ -5039,19 +5039,19 @@ function Ii() {
5039
5039
  ] });
5040
5040
  }
5041
5041
  function Ti() {
5042
- var h, b;
5042
+ var h, N;
5043
5043
  const t = f(
5044
- (C) => C.card.customCardPreferences
5045
- ), { data: n } = ss(), a = (n == null ? void 0 : n.plugins) || [], s = f((C) => C.card), l = f((C) => C.frame), o = (t == null ? void 0 : t.visualType) || "single", { setCustomCardPreferences: i } = X(), { components: c, manifest: u } = dn(
5044
+ (b) => b.card.customCardPreferences
5045
+ ), { data: n } = ss(), a = (n == null ? void 0 : n.plugins) || [], s = f((b) => b.card), l = f((b) => b.frame), o = (t == null ? void 0 : t.visualType) || "single", { setCustomCardPreferences: i } = X(), { components: c, manifest: u } = dn(
5046
5046
  (t == null ? void 0 : t.url) || ""
5047
5047
  ), p = (h = u == null ? void 0 : u.visuals) == null ? void 0 : h.find(
5048
- (C) => C.name === (t == null ? void 0 : t.componentName)
5048
+ (b) => b.name === (t == null ? void 0 : t.componentName)
5049
5049
  );
5050
- function m(C, O) {
5050
+ function m(b, O) {
5051
5051
  if (!t) return;
5052
5052
  const z = {
5053
5053
  ...(t == null ? void 0 : t.dataInputCardIds) || {},
5054
- [C]: {
5054
+ [b]: {
5055
5055
  cardId: O,
5056
5056
  hookRef: null
5057
5057
  }
@@ -5061,7 +5061,7 @@ function Ti() {
5061
5061
  dataInputCardIds: z
5062
5062
  });
5063
5063
  }
5064
- function y(C) {
5064
+ function y(b) {
5065
5065
  var k, z;
5066
5066
  const O = (k = l == null ? void 0 : l.cards) == null ? void 0 : k.filter((S) => {
5067
5067
  var A;
@@ -5070,7 +5070,7 @@ function Ti() {
5070
5070
  value: S.id,
5071
5071
  label: S.tabTitle || S.title
5072
5072
  }));
5073
- return /* @__PURE__ */ e("div", { className: "space-y-2", children: (z = C == null ? void 0 : C.dataInputs) == null ? void 0 : z.map((S, A) => {
5073
+ return /* @__PURE__ */ e("div", { className: "space-y-2", children: (z = b == null ? void 0 : b.dataInputs) == null ? void 0 : z.map((S, A) => {
5074
5074
  var B, P;
5075
5075
  return /* @__PURE__ */ r(
5076
5076
  "div",
@@ -5094,9 +5094,9 @@ function Ti() {
5094
5094
  );
5095
5095
  }) });
5096
5096
  }
5097
- function g(C, O, k = [], z = "") {
5097
+ function g(b, O, k = [], z = "") {
5098
5098
  var S, A;
5099
- return t ? C === "input" ? /* @__PURE__ */ e(
5099
+ return t ? b === "input" ? /* @__PURE__ */ e(
5100
5100
  ue,
5101
5101
  {
5102
5102
  className: `h-8 w-full ${Ie}`,
@@ -5112,7 +5112,7 @@ function Ti() {
5112
5112
  }
5113
5113
  },
5114
5114
  O
5115
- ) : C === "select" ? /* @__PURE__ */ e(
5115
+ ) : b === "select" ? /* @__PURE__ */ e(
5116
5116
  pe,
5117
5117
  {
5118
5118
  className: "h-8 w-full",
@@ -5128,8 +5128,8 @@ function Ti() {
5128
5128
  }
5129
5129
  ) : null : null;
5130
5130
  }
5131
- function d(C) {
5132
- const O = Object.entries((C == null ? void 0 : C.settings) || {});
5131
+ function d(b) {
5132
+ const O = Object.entries((b == null ? void 0 : b.settings) || {});
5133
5133
  return /* @__PURE__ */ e("div", { className: "space-y-3", children: O.map(([k, z]) => /* @__PURE__ */ r("div", { className: "space-y-1", children: [
5134
5134
  /* @__PURE__ */ e($, { children: z.title }),
5135
5135
  g(
@@ -5140,10 +5140,10 @@ function Ti() {
5140
5140
  )
5141
5141
  ] }, k)) });
5142
5142
  }
5143
- function v(C) {
5143
+ function v(b) {
5144
5144
  t && i({
5145
5145
  ...t,
5146
- visualType: C,
5146
+ visualType: b,
5147
5147
  componentName: ""
5148
5148
  });
5149
5149
  }
@@ -5166,12 +5166,12 @@ function Ti() {
5166
5166
  label: "Select Plugin",
5167
5167
  options: a,
5168
5168
  value: (t == null ? void 0 : t.url) || "",
5169
- onValueChange: (C) => i({
5169
+ onValueChange: (b) => i({
5170
5170
  ...t || {
5171
5171
  url: "",
5172
5172
  componentName: ""
5173
5173
  },
5174
- url: C
5174
+ url: b
5175
5175
  })
5176
5176
  }
5177
5177
  ),
@@ -5193,22 +5193,22 @@ function Ti() {
5193
5193
  icon: /* @__PURE__ */ e(ll, { className: "h-3.5 w-3.5" }),
5194
5194
  className: "h-9 w-full",
5195
5195
  label: "Select Component",
5196
- options: (c == null ? void 0 : c.filter((C) => C.type === o).map((C) => ({
5197
- value: C.name,
5198
- label: C.name
5196
+ options: (c == null ? void 0 : c.filter((b) => b.type === o).map((b) => ({
5197
+ value: b.name,
5198
+ label: b.name
5199
5199
  }))) || [],
5200
5200
  value: t.componentName,
5201
- onValueChange: (C) => {
5202
- console.log("changing value", C), i({
5201
+ onValueChange: (b) => {
5202
+ console.log("changing value", b), i({
5203
5203
  ...t,
5204
- componentName: C
5204
+ componentName: b
5205
5205
  });
5206
5206
  }
5207
5207
  }
5208
5208
  ) })
5209
5209
  ] }) })
5210
5210
  ] }),
5211
- ((b = s == null ? void 0 : s.customCardPreferences) == null ? void 0 : b.componentName) && /* @__PURE__ */ r(se, { className: "border-none", value: "component-settings", children: [
5211
+ ((N = s == null ? void 0 : s.customCardPreferences) == null ? void 0 : N.componentName) && /* @__PURE__ */ r(se, { className: "border-none", value: "component-settings", children: [
5212
5212
  /* @__PURE__ */ e(re, { children: "Settings" }),
5213
5213
  /* @__PURE__ */ r(le, { children: [
5214
5214
  p && p.dataInputs && /* @__PURE__ */ r("div", { className: "space-y-3", children: [
@@ -5560,19 +5560,19 @@ function ms() {
5560
5560
  const t = f((d) => d.selectedConnectionId), n = f((d) => d.selectedDatamodelId), a = f((d) => d.selectedDatabaseName), s = f((d) => d.selectedSchemaName), l = f((d) => d.selectedTableName), o = _((d) => d.dashboard.filters) || [], i = _((d) => d.actions.addFilter), c = _((d) => d.actions.removeFilter), { removeFilterValues: u } = Ye(), { modelItems: p, tableName: m, connectionType: y } = Ce();
5561
5561
  function g(d, v = "dashboard") {
5562
5562
  var B;
5563
- const h = ve(d.column_name), b = ve(a || ""), C = ve(s || ""), O = ve(m);
5563
+ const h = ve(d.column_name), N = ve(a || ""), b = ve(s || ""), O = ve(m);
5564
5564
  let k = fr({
5565
- schemaName: C,
5565
+ schemaName: b,
5566
5566
  tableName: O,
5567
5567
  connectionType: y,
5568
- databaseName: b
5568
+ databaseName: N
5569
5569
  }), z = `${k}.${h}`;
5570
5570
  const S = (B = p == null ? void 0 : p.find(
5571
5571
  (P) => P.id === n
5572
5572
  )) == null ? void 0 : B.name;
5573
5573
  n && n !== "none" && (z = `${ka}.${S}.${h}`, k = `${ka}.${S}`);
5574
5574
  const A = o == null ? void 0 : o.find(
5575
- (P) => P.column === z && P.table === O && (P.database === b || P.database === a)
5575
+ (P) => P.column === z && P.table === O && (P.database === N || P.database === a)
5576
5576
  );
5577
5577
  if (A)
5578
5578
  u(A.id), c(A.id);
@@ -6024,12 +6024,12 @@ function qi() {
6024
6024
  {
6025
6025
  value: s || "none",
6026
6026
  onValueChange: (d) => {
6027
- var v, h, b;
6027
+ var v, h, N;
6028
6028
  return a(
6029
6029
  ((v = t == null ? void 0 : t.formatNumber) == null ? void 0 : v.decimalPlaces) || 0,
6030
6030
  ((h = t == null ? void 0 : t.formatNumber) == null ? void 0 : h.currency) || "",
6031
6031
  d,
6032
- ((b = t == null ? void 0 : t.formatNumber) == null ? void 0 : b.suffix) || ""
6032
+ ((N = t == null ? void 0 : t.formatNumber) == null ? void 0 : N.suffix) || ""
6033
6033
  );
6034
6034
  },
6035
6035
  children: [
@@ -6050,12 +6050,12 @@ function qi() {
6050
6050
  {
6051
6051
  value: l || "none",
6052
6052
  onValueChange: (d) => {
6053
- var v, h, b;
6053
+ var v, h, N;
6054
6054
  console.log("currency", d), a(
6055
6055
  ((v = t == null ? void 0 : t.formatNumber) == null ? void 0 : v.decimalPlaces) || 0,
6056
6056
  d === "none" ? "" : d,
6057
6057
  ((h = t == null ? void 0 : t.formatNumber) == null ? void 0 : h.locale) || "",
6058
- ((b = t == null ? void 0 : t.formatNumber) == null ? void 0 : b.suffix) || ""
6058
+ ((N = t == null ? void 0 : t.formatNumber) == null ? void 0 : N.suffix) || ""
6059
6059
  );
6060
6060
  },
6061
6061
  children: [
@@ -6078,12 +6078,12 @@ function qi() {
6078
6078
  {
6079
6079
  value: ((y = (m = t == null ? void 0 : t.formatNumber) == null ? void 0 : m.decimalPlaces) == null ? void 0 : y.toString()) || "0",
6080
6080
  onValueChange: (d) => {
6081
- var v, h, b;
6081
+ var v, h, N;
6082
6082
  return a(
6083
6083
  Number(d),
6084
6084
  ((v = t == null ? void 0 : t.formatNumber) == null ? void 0 : v.currency) || "",
6085
6085
  ((h = t == null ? void 0 : t.formatNumber) == null ? void 0 : h.locale) || "",
6086
- ((b = t == null ? void 0 : t.formatNumber) == null ? void 0 : b.suffix) || ""
6086
+ ((N = t == null ? void 0 : t.formatNumber) == null ? void 0 : N.suffix) || ""
6087
6087
  );
6088
6088
  },
6089
6089
  children: [
@@ -6102,11 +6102,11 @@ function qi() {
6102
6102
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
6103
6103
  placeholder: "K, M, B, %",
6104
6104
  onChange: (d) => {
6105
- var v, h, b;
6105
+ var v, h, N;
6106
6106
  return a(
6107
6107
  ((v = t == null ? void 0 : t.formatNumber) == null ? void 0 : v.decimalPlaces) || 0,
6108
6108
  ((h = t == null ? void 0 : t.formatNumber) == null ? void 0 : h.currency) || "",
6109
- ((b = t == null ? void 0 : t.formatNumber) == null ? void 0 : b.locale) || "",
6109
+ ((N = t == null ? void 0 : t.formatNumber) == null ? void 0 : N.locale) || "",
6110
6110
  d.target.value
6111
6111
  );
6112
6112
  }
@@ -6279,7 +6279,7 @@ const Pi = [
6279
6279
  value: t
6280
6280
  }));
6281
6281
  function Ui() {
6282
- var u, p, m, y, g, d, v, h, b, C, O, k, z, S, A, B, P, Z;
6282
+ var u, p, m, y, g, d, v, h, N, b, O, k, z, S, A, B, P, Z;
6283
6283
  const t = f((w) => w.card), n = (p = (u = t == null ? void 0 : t.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : p.topoJsonUrl, [a, s] = U(
6284
6284
  ((y = (m = t == null ? void 0 : t.preferences) == null ? void 0 : m.mapVisualOptions) == null ? void 0 : y.customTopoJsonUrl) || ""
6285
6285
  ), { setCardPreferences: l } = X(), { data: o } = sa(t), i = Object.keys((o == null ? void 0 : o.objects) || {}).map((w) => ({
@@ -6394,7 +6394,7 @@ function Ui() {
6394
6394
  {
6395
6395
  className: "h-9",
6396
6396
  options: Hi,
6397
- value: ((C = (b = t.preferences) == null ? void 0 : b.mapVisualOptions) == null ? void 0 : C.colorScale) || "",
6397
+ value: ((b = (N = t.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : b.colorScale) || "",
6398
6398
  label: "Select Color Scale",
6399
6399
  onValueChange: (w) => {
6400
6400
  var D;
@@ -6441,14 +6441,14 @@ function Ui() {
6441
6441
  step: 10,
6442
6442
  value: ((A = (S = (z = t.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : S.projectionOffset) == null ? void 0 : A[0]) || 0,
6443
6443
  onChange: (w) => {
6444
- var D, L, T, x;
6444
+ var D, L, T, C;
6445
6445
  l({
6446
6446
  ...t.preferences,
6447
6447
  mapVisualOptions: {
6448
6448
  ...(D = t.preferences) == null ? void 0 : D.mapVisualOptions,
6449
6449
  projectionOffset: [
6450
6450
  Number(w.target.value),
6451
- ((x = (T = (L = t.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : T.projectionOffset) == null ? void 0 : x[1]) || 0
6451
+ ((C = (T = (L = t.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : T.projectionOffset) == null ? void 0 : C[1]) || 0
6452
6452
  ]
6453
6453
  }
6454
6454
  });
@@ -6464,13 +6464,13 @@ function Ui() {
6464
6464
  step: 10,
6465
6465
  value: ((Z = (P = (B = t.preferences) == null ? void 0 : B.mapVisualOptions) == null ? void 0 : P.projectionOffset) == null ? void 0 : Z[1]) || 0,
6466
6466
  onChange: (w) => {
6467
- var D, L, T, x;
6467
+ var D, L, T, C;
6468
6468
  l({
6469
6469
  ...t.preferences,
6470
6470
  mapVisualOptions: {
6471
6471
  ...(D = t.preferences) == null ? void 0 : D.mapVisualOptions,
6472
6472
  projectionOffset: [
6473
- ((x = (T = (L = t.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : T.projectionOffset) == null ? void 0 : x[0]) || 0,
6473
+ ((C = (T = (L = t.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : T.projectionOffset) == null ? void 0 : C[0]) || 0,
6474
6474
  Number(w.target.value)
6475
6475
  ]
6476
6476
  }
@@ -6826,7 +6826,7 @@ function Yi() {
6826
6826
  setMetricColumns: g,
6827
6827
  setTrendByColumns: d,
6828
6828
  setFilterColumns: v
6829
- } = X(), { columns: h } = $n(), { formattedTableName: b } = Ce(), C = xr(
6829
+ } = X(), { columns: h } = $n(), { formattedTableName: N } = Ce(), b = xr(
6830
6830
  Nr(Sr, {
6831
6831
  activationConstraint: {
6832
6832
  distance: 1
@@ -6834,11 +6834,11 @@ function Yi() {
6834
6834
  })
6835
6835
  // Add other sensors if needed
6836
6836
  ), O = (D) => {
6837
- var x;
6837
+ var C;
6838
6838
  const { active: L, over: T } = D;
6839
- if (((x = L.data.current) == null ? void 0 : x.type) === "column" && T) {
6839
+ if (((C = L.data.current) == null ? void 0 : C.type) === "column" && T) {
6840
6840
  const R = T.id, J = h.find(
6841
- (N) => N.column_name === L.id
6841
+ (x) => x.column_name === L.id
6842
6842
  );
6843
6843
  if (!J) return;
6844
6844
  const ee = We(J.data_type), H = st(J.data_type), I = rt(J.data_type);
@@ -6919,20 +6919,20 @@ function Yi() {
6919
6919
  return !l.some((L) => L.name === D.column_name);
6920
6920
  }
6921
6921
  function S(D, L = "SUM") {
6922
- const { column_name: T, data_type: x } = D, R = [...a], J = t !== null ? t : a.length, ee = {
6922
+ const { column_name: T, data_type: C } = D, R = [...a], J = t !== null ? t : a.length, ee = {
6923
6923
  ...D,
6924
6924
  id: qe(T),
6925
6925
  // Unique ID
6926
6926
  name: T,
6927
6927
  label: vt(L, T),
6928
- type: x,
6928
+ type: C,
6929
6929
  role: "metric",
6930
6930
  aggregate: L
6931
6931
  };
6932
6932
  R.splice(J, 0, ee), g(R);
6933
6933
  }
6934
6934
  function A(D) {
6935
- const L = [...n], T = t !== null ? t : n.length, x = {
6935
+ const L = [...n], T = t !== null ? t : n.length, C = {
6936
6936
  ...D,
6937
6937
  id: qe(D.column_name),
6938
6938
  // Unique ID
@@ -6940,10 +6940,10 @@ function Yi() {
6940
6940
  type: D.data_type,
6941
6941
  role: "groupby"
6942
6942
  };
6943
- L.splice(T, 0, x), y(L);
6943
+ L.splice(T, 0, C), y(L);
6944
6944
  }
6945
6945
  function B(D) {
6946
- const L = [...s], T = t !== null ? t : s.length, x = {
6946
+ const L = [...s], T = t !== null ? t : s.length, C = {
6947
6947
  ...D,
6948
6948
  id: qe(D.column_name),
6949
6949
  // Unique ID
@@ -6951,10 +6951,10 @@ function Yi() {
6951
6951
  type: D.data_type,
6952
6952
  role: "trendby"
6953
6953
  };
6954
- L.splice(T, 0, x), d(L);
6954
+ L.splice(T, 0, C), d(L);
6955
6955
  }
6956
6956
  function P(D) {
6957
- const L = [...l], T = t !== null ? t : l.length, x = {
6957
+ const L = [...l], T = t !== null ? t : l.length, C = {
6958
6958
  ...D,
6959
6959
  id: qe(D.column_name),
6960
6960
  // Unique ID
@@ -6962,17 +6962,17 @@ function Yi() {
6962
6962
  type: D.data_type,
6963
6963
  sql: Ht(
6964
6964
  D.data_type,
6965
- b,
6965
+ N,
6966
6966
  ve(D.column_name)
6967
6967
  ),
6968
6968
  role: "filter"
6969
6969
  };
6970
- L.splice(T, 0, x), v(L);
6970
+ L.splice(T, 0, C), v(L);
6971
6971
  }
6972
6972
  function Z(D) {
6973
- var R, J, ee, H, I, N, M, F;
6974
- const { active: L, over: T } = D, x = L.data.current;
6975
- if ((x == null ? void 0 : x.type) === "column" && T) {
6973
+ var R, J, ee, H, I, x, M, F;
6974
+ const { active: L, over: T } = D, C = L.data.current;
6975
+ if ((C == null ? void 0 : C.type) === "column" && T) {
6976
6976
  const E = h.find(
6977
6977
  (me) => me.column_name === L.id
6978
6978
  );
@@ -6989,7 +6989,7 @@ function Yi() {
6989
6989
  G.splice(W, 0, ie), y(G);
6990
6990
  }
6991
6991
  }
6992
- if (T && ((N = T.data.current) == null ? void 0 : N.type) === $t && a.some((E) => E.id === L.id)) {
6992
+ if (T && ((x = T.data.current) == null ? void 0 : x.type) === $t && a.some((E) => E.id === L.id)) {
6993
6993
  const E = a.findIndex((G) => G.id === L.id), W = a.findIndex((G) => G.id === T.id);
6994
6994
  if (E !== -1 && W !== -1 && E !== W) {
6995
6995
  const G = [...a], [ie] = G.splice(E, 1);
@@ -7020,7 +7020,7 @@ function Yi() {
7020
7020
  handleDragEnd: Z,
7021
7021
  handleDragStart: k,
7022
7022
  handleDragCancel: w,
7023
- sensors: C
7023
+ sensors: b
7024
7024
  };
7025
7025
  }
7026
7026
  const Ge = [
@@ -7414,11 +7414,11 @@ function so({
7414
7414
  };
7415
7415
  }) : [];
7416
7416
  }, [y, m.column]);
7417
- function b(O) {
7417
+ function N(O) {
7418
7418
  const k = O.map((z) => z.id);
7419
7419
  p(t.name, k);
7420
7420
  }
7421
- function C() {
7421
+ function b() {
7422
7422
  return g || d ? /* @__PURE__ */ e(
7423
7423
  wn,
7424
7424
  {
@@ -7431,7 +7431,7 @@ function so({
7431
7431
  wr,
7432
7432
  {
7433
7433
  options: h,
7434
- onChange: b,
7434
+ onChange: N,
7435
7435
  selectedOptions: u,
7436
7436
  selectAllChecked: !1,
7437
7437
  onSelectAllCheckedChange: () => {
@@ -7446,7 +7446,7 @@ function so({
7446
7446
  id: t.id,
7447
7447
  sortableType: n,
7448
7448
  column: t,
7449
- children: C()
7449
+ children: b()
7450
7450
  }
7451
7451
  );
7452
7452
  }
@@ -7464,17 +7464,17 @@ function ro({
7464
7464
  title: "",
7465
7465
  // not needed
7466
7466
  dataType: t.type
7467
- }, { isLoading: u, isFetching: p, isError: m, data: y } = Sn(c), g = y == null ? void 0 : y.records, { dateRange: d, setDateRange: v, initialDateRange: h } = kr(g), { updateEditorFilterValue: b } = X();
7468
- function C(z) {
7467
+ }, { isLoading: u, isFetching: p, isError: m, data: y } = Sn(c), g = y == null ? void 0 : y.records, { dateRange: d, setDateRange: v, initialDateRange: h } = kr(g), { updateEditorFilterValue: N } = X();
7468
+ function b(z) {
7469
7469
  var A, B;
7470
7470
  const S = {
7471
7471
  gte: (A = z == null ? void 0 : z.from) == null ? void 0 : A.toISOString(),
7472
7472
  lte: (B = z == null ? void 0 : z.to) == null ? void 0 : B.toISOString()
7473
7473
  };
7474
- b(t.name, S);
7474
+ N(t.name, S);
7475
7475
  }
7476
7476
  function O() {
7477
- b(t.name, null, !0), v(h);
7477
+ N(t.name, null, !0), v(h);
7478
7478
  }
7479
7479
  function k() {
7480
7480
  return u || p ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(wn, { className: "h-8 w-72 bg-foreground/10" }) }) : m ? /* @__PURE__ */ e("div", { className: "h-8 w-72 bg-muted px-2", children: "Error" }) : g ? /* @__PURE__ */ e(
@@ -7486,7 +7486,7 @@ function ro({
7486
7486
  setOpen: s,
7487
7487
  dateRange: d,
7488
7488
  setDateRange: v,
7489
- onApply: C,
7489
+ onApply: b,
7490
7490
  onClear: O
7491
7491
  }
7492
7492
  ) : /* @__PURE__ */ e($, { className: "flex h-8 w-72 items-center bg-muted px-2", children: "No Data" });
@@ -7707,8 +7707,8 @@ function ho() {
7707
7707
  setMessages: d,
7708
7708
  reload: v,
7709
7709
  append: h,
7710
- input: b,
7711
- setInput: C,
7710
+ input: N,
7711
+ setInput: b,
7712
7712
  isLoading: O,
7713
7713
  handleAddCurrentTableToScope: k,
7714
7714
  removeFromCurrentSelections: z,
@@ -7732,7 +7732,7 @@ function ho() {
7732
7732
  function T(H) {
7733
7733
  u(H), p(!0);
7734
7734
  }
7735
- function x(H) {
7735
+ function C(H) {
7736
7736
  const I = {
7737
7737
  role: "user",
7738
7738
  content: H.title + " " + H.subtitle
@@ -7818,7 +7818,7 @@ function ho() {
7818
7818
  ] })
7819
7819
  ] });
7820
7820
  }
7821
- const ee = (b == null ? void 0 : b.length) === 0 && (g == null ? void 0 : g.filter((H) => H.role === "user").length) === 0;
7821
+ const ee = (N == null ? void 0 : N.length) === 0 && (g == null ? void 0 : g.filter((H) => H.role === "user").length) === 0;
7822
7822
  return /* @__PURE__ */ r(
7823
7823
  "div",
7824
7824
  {
@@ -7890,7 +7890,7 @@ function ho() {
7890
7890
  ee && /* @__PURE__ */ e(
7891
7891
  Fr,
7892
7892
  {
7893
- onClick: x,
7893
+ onClick: C,
7894
7894
  placeholders: mo
7895
7895
  }
7896
7896
  ),
@@ -7902,8 +7902,8 @@ function ho() {
7902
7902
  },
7903
7903
  stop: P,
7904
7904
  ref: n,
7905
- setInput: C,
7906
- input: b,
7905
+ setInput: b,
7906
+ input: N,
7907
7907
  handleInputChange: A,
7908
7908
  handleSubmit: B,
7909
7909
  isLoading: O
@@ -7926,7 +7926,7 @@ function ho() {
7926
7926
  );
7927
7927
  }
7928
7928
  function po({ authToken: t, onSave: n, onClose: a }) {
7929
- const s = Ze(null), l = f((b) => b.showAIDialog), { setAuthToken: o } = Ye(), { setShowAIDialog: i, setOnSave: c, setOnClose: u } = X(), {
7929
+ const s = Ze(null), l = f((N) => N.showAIDialog), { setAuthToken: o } = Ye(), { setShowAIDialog: i, setOnSave: c, setOnClose: u } = X(), {
7930
7930
  handleDragOver: p,
7931
7931
  handleDragEnd: m,
7932
7932
  handleDragStart: y,
@@ -7938,11 +7938,11 @@ function po({ authToken: t, onSave: n, onClose: a }) {
7938
7938
  }, [n, c, a, u]), ce(() => {
7939
7939
  t && t.accessToken && o(t);
7940
7940
  }, [t, o]), ce(() => {
7941
- var b, C;
7942
- l ? ((b = s.current) == null || b.resize(40), i(!0)) : (i(!1), (C = s.current) == null || C.resize(0));
7941
+ var N, b;
7942
+ l ? ((N = s.current) == null || N.resize(40), i(!0)) : (i(!1), (b = s.current) == null || b.resize(0));
7943
7943
  }, [l, i]);
7944
- function v(b) {
7945
- b < 1 ? i(!1) : l || i(!0);
7944
+ function v(N) {
7945
+ N < 1 ? i(!1) : l || i(!0);
7946
7946
  }
7947
7947
  function h() {
7948
7948
  return /* @__PURE__ */ r(