react-semaphor 0.1.36 → 0.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { jsxs as a, jsx as e, Fragment as q } from "react/jsx-runtime";
2
- import { c as ce, a2 as Ys, u as Q, a3 as St, a4 as kt, B as z, a5 as Dt, a6 as He, a7 as qs, _ as pt, a8 as Ze, a9 as lt, aa as El, ab as Ke, ac as rt, ad as it, ae as ot, af as gt, ag as $, ah as Ae, ai as Tt, I as ge, aj as Ks, ak as Xt, al as pi, am as Qn, an as Js, f as B, ao as Ws, ap as fi, aq as Al, ar as gi, as as vi, at as ma, au as re, w as Hn, av as xi, aw as yi, ax as Zt, ay as Ye, az as ne, aA as Ee, aB as Ct, aC as Ue, aD as Na, aE as sa, aF as ba, aG as Ni, aH as na, aI as vt, aJ as Je, aK as We, aL as Ca, aM as Xe, aN as Me, aO as tt, aP as Qs, aQ as Xa, aR as ha, aS as jt, aT as Ut, aU as Hs, aV as Xs, aW as bi, aX as Oa, aY as Zs, aZ as en, a_ as tn, a$ as an, R as Ot, b0 as Il, b1 as Ci, b2 as sn, b3 as Ra, b4 as nn, b5 as ln, b6 as wa, b7 as Sa, b8 as ka, b9 as rn, ba as os, bb as on, bc as Ol, bd as Rl, be as cn, bf as me, bg as he, bh as pe, bi as fe, bj as H, bk as Fl, bl as Pl, bm as wi, bn as Si, bo as Rt, bp as ki, bq as Di, br as Ft, bs as Pt, bt as Ve, bu as dt, bv as bt, a0 as O, bw as Mt, bx as cs, by as ds, bz as dn, bA as Ti, bB as mt, bC as Rs, bD as $t, bE as Fs, bF as Ll, bG as zl, bH as Mi, bI as un, bJ as mn, bK as hn, bL as pn, bM as fn, bN as gn, bO as vn, bP as xn, bQ as Ei, bR as us, bS as Fa, a1 as oe, bT as Ai, bU as wt, bV as Ii, o as la, bW as Vl, bX as $e, bY as Oi, bZ as Pa, b_ as Za, b$ as yn, c0 as Ka, c1 as La, c2 as Nn, c3 as Ri, c4 as Fi, c5 as Pi, c6 as Li, c7 as zi, v as Vi, c8 as es, c9 as _l, ca as ms, cb as _i, cc as st, cd as ji, ce as Ui, cf as Ja, cg as $i, ch as Wa, ci as Qa, cj as hs, W as za, A as Xn, Q as Zn, K as jl, J as Ul, y as zt, z as Gi, G as Bi, T as Yi, ck as el, cl as tl, cm as ps, cn as fs, co as gs, cp as Va, cq as qi, cr as ts, cs as _t, ct as $l, cu as vs, cv as Gl, cw as ht, cx as Se, cy as ke, cz as De, cA as Bl, cB as Ma, cC as Yl, cD as ql, cE as _a, g as Gt, cF as al, cG as Kl, cH as Ki, cI as Ps, cJ as Jl, cK as bn, cL as Wl, cM as Ea, cN as sl, cO as Ji, cP as Wi, cQ as Qi, cR as Ql, cS as Hi, cT as Xi, cU as Hl, cV as Zi, cW as xs, cX as eo, cY as to, cZ as Ls, c_ as ea, c$ as nt, d0 as ta, d1 as ao, d2 as so, d3 as ys, d4 as no, d5 as Cn, d6 as lo, d7 as wn, d8 as ro, d9 as Xl, da as Ha, db as Zl, dc as io, dd as oo, de as co, df as Sn, dg as uo, dh as mo, di as nl, dj as ho, E as ja, b as kn, dk as po, dl as fo, dm as go, dn as vo, dp as xo, dq as yo, dr as er, ds as Dn, dt as tr, du as ar, dv as sr, dw as nr, dx as lr, dy as Tn, dz as Mn, dA as rr, dB as ir, dC as or, dD as En, dE as Ns, dF as bs, dG as No, P as Bt, e as Yt, dH as bo, dI as Wt, dJ as Co, dK as wo, dL as So, dM as ko, dN as Do, dO as To, dP as cr, dQ as ut, dR as Aa, dS as as, dT as Vt, h as ra, dU as Mo, dV as Eo, dW as Ao, dX as Io, dY as Oo, dZ as dr, d_ as Ro, i as Cs, j as ws, k as Ss, l as ks, m as ua, n as Ua, d$ as Fo, e0 as ft, e1 as Ga, e2 as ll, e3 as Po, e4 as rl, e5 as Lo, e6 as zo, e7 as Vo, e8 as _o, e9 as il, ea as jo, eb as Uo, ec as $o, ed as Go, ee as Bo, ef as Yo, O as ol, eg as cl, eh as qo, ei as Ko, ej as ur, ek as Jo, el as mr, em as Wo, en as Qo, eo as Ho, ep as Xo, eq as Zo, er as ec, es as tc, et as ac, eu as sc, ev as nc, ew as lc, ex as rc, ey as ic, ez as oc, eA as cc, eB as dc, eC as hr, eD as Ms, eE as An, eF as uc, eG as mc, eH as hc, eI as pc, eJ as pa, eK as fa, eL as fc, eM as pr, eN as gc, eO as zs, eP as vc, eQ as xc, eR as yc, eS as ss, eT as Qt, eU as Vs, eV as _s, eW as ns, eX as fr, eY as ga, eZ as va, e_ as In, e$ as Nc, f0 as bc, f1 as Cc, f2 as wc, f3 as Sc, f4 as kc, f5 as Dc, f6 as Tc, f7 as Es, f8 as Mc, f9 as Ec, fa as Ac, F as gr, fb as Ic, fc as Oc, fd as Rc, fe as vr, ff as xr, fg as Fc, fh as yr, fi as Pc, fj as Lc, fk as zc, fl as Vc, fm as _c, S as jc, fn as Uc, U as $c, fo as Gc, C as Bc } from "./index-YGRINjKM.js";
2
+ import { c as ce, a2 as Ys, u as Q, a3 as St, a4 as kt, B as z, a5 as Dt, a6 as He, a7 as qs, _ as pt, a8 as Ze, a9 as lt, aa as El, ab as Ke, ac as rt, ad as it, ae as ot, af as gt, ag as $, ah as Ae, ai as Tt, I as ge, aj as Ks, ak as Xt, al as pi, am as Qn, an as Js, f as B, ao as Ws, ap as fi, aq as Al, ar as gi, as as vi, at as ma, au as re, w as Hn, av as xi, aw as yi, ax as Zt, ay as Ye, az as ne, aA as Ee, aB as Ct, aC as Ue, aD as Na, aE as sa, aF as ba, aG as Ni, aH as na, aI as vt, aJ as Je, aK as We, aL as Ca, aM as Xe, aN as Me, aO as tt, aP as Qs, aQ as Xa, aR as ha, aS as jt, aT as Ut, aU as Hs, aV as Xs, aW as bi, aX as Oa, aY as Zs, aZ as en, a_ as tn, a$ as an, R as Ot, b0 as Il, b1 as Ci, b2 as sn, b3 as Ra, b4 as nn, b5 as ln, b6 as wa, b7 as Sa, b8 as ka, b9 as rn, ba as os, bb as on, bc as Ol, bd as Rl, be as cn, bf as me, bg as he, bh as pe, bi as fe, bj as H, bk as Fl, bl as Pl, bm as wi, bn as Si, bo as Rt, bp as ki, bq as Di, br as Ft, bs as Pt, bt as Ve, bu as dt, bv as bt, a0 as O, bw as Mt, bx as cs, by as ds, bz as dn, bA as Ti, bB as mt, bC as Rs, bD as $t, bE as Fs, bF as Ll, bG as zl, bH as Mi, bI as un, bJ as mn, bK as hn, bL as pn, bM as fn, bN as gn, bO as vn, bP as xn, bQ as Ei, bR as us, bS as Fa, a1 as oe, bT as Ai, bU as wt, bV as Ii, o as la, bW as Vl, bX as $e, bY as Oi, bZ as Pa, b_ as Za, b$ as yn, c0 as Ka, c1 as La, c2 as Nn, c3 as Ri, c4 as Fi, c5 as Pi, c6 as Li, c7 as zi, v as Vi, c8 as es, c9 as _l, ca as ms, cb as _i, cc as st, cd as ji, ce as Ui, cf as Ja, cg as $i, ch as Wa, ci as Qa, cj as hs, W as za, A as Xn, Q as Zn, K as jl, J as Ul, y as zt, z as Gi, G as Bi, T as Yi, ck as el, cl as tl, cm as ps, cn as fs, co as gs, cp as Va, cq as qi, cr as ts, cs as _t, ct as $l, cu as vs, cv as Gl, cw as ht, cx as Se, cy as ke, cz as De, cA as Bl, cB as Ma, cC as Yl, cD as ql, cE as _a, g as Gt, cF as al, cG as Kl, cH as Ki, cI as Ps, cJ as Jl, cK as bn, cL as Wl, cM as Ea, cN as sl, cO as Ji, cP as Wi, cQ as Qi, cR as Ql, cS as Hi, cT as Xi, cU as Hl, cV as Zi, cW as xs, cX as eo, cY as to, cZ as Ls, c_ as ea, c$ as nt, d0 as ta, d1 as ao, d2 as so, d3 as ys, d4 as no, d5 as Cn, d6 as lo, d7 as wn, d8 as ro, d9 as Xl, da as Ha, db as Zl, dc as io, dd as oo, de as co, df as Sn, dg as uo, dh as mo, di as nl, dj as ho, E as ja, b as kn, dk as po, dl as fo, dm as go, dn as vo, dp as xo, dq as yo, dr as er, ds as Dn, dt as tr, du as ar, dv as sr, dw as nr, dx as lr, dy as Tn, dz as Mn, dA as rr, dB as ir, dC as or, dD as En, dE as Ns, dF as bs, dG as No, P as Bt, e as Yt, dH as bo, dI as Wt, dJ as Co, dK as wo, dL as So, dM as ko, dN as Do, dO as To, dP as cr, dQ as ut, dR as Aa, dS as as, dT as Vt, h as ra, dU as Mo, dV as Eo, dW as Ao, dX as Io, dY as Oo, dZ as dr, d_ as Ro, i as Cs, j as ws, k as Ss, l as ks, m as ua, n as Ua, d$ as Fo, e0 as ft, e1 as Ga, e2 as ll, e3 as Po, e4 as rl, e5 as Lo, e6 as zo, e7 as Vo, e8 as _o, e9 as il, ea as jo, eb as Uo, ec as $o, ed as Go, ee as Bo, ef as Yo, O as ol, eg as cl, eh as qo, ei as Ko, ej as ur, ek as Jo, el as mr, em as Wo, en as Qo, eo as Ho, ep as Xo, eq as Zo, er as ec, es as tc, et as ac, eu as sc, ev as nc, ew as lc, ex as rc, ey as ic, ez as oc, eA as cc, eB as dc, eC as hr, eD as Ms, eE as An, eF as uc, eG as mc, eH as hc, eI as pc, eJ as pa, eK as fa, eL as fc, eM as pr, eN as gc, eO as zs, eP as vc, eQ as xc, eR as yc, eS as ss, eT as Qt, eU as Vs, eV as _s, eW as ns, eX as fr, eY as ga, eZ as va, e_ as In, e$ as Nc, f0 as bc, f1 as Cc, f2 as wc, f3 as Sc, f4 as kc, f5 as Dc, f6 as Tc, f7 as Es, f8 as Mc, f9 as Ec, fa as Ac, F as gr, fb as Ic, fc as Oc, fd as Rc, fe as vr, ff as xr, fg as Fc, fh as yr, fi as Pc, fj as Lc, fk as zc, fl as Vc, fm as _c, S as jc, fn as Uc, U as $c, fo as Gc, C as Bc } from "./index-s15_8jgm.js";
3
3
  import * as js from "react";
4
4
  import qe, { useState as _, useRef as yt, useEffect as ye, useMemo as et, useCallback as Ce, useContext as On, Suspense as Nr } from "react";
5
5
  import { createPortal as Yc } from "react-dom";
@@ -879,13 +879,13 @@ async function Id(t, n, s) {
879
879
  });
880
880
  }
881
881
  function Od() {
882
- const [t, n] = _(""), [s, l] = _(!1), r = Q((x) => x.lenses), { setLenses: c, setSelectedLensId: d } = pt(), [i, o] = _(!1), [u, m] = _(!1), p = Q((x) => x.dashboard), h = Q((x) => x.filterValues), { authToken: f, tokenProps: y } = Ze();
882
+ const [t, n] = _(""), [s, l] = _(!1), r = Q((x) => x.lenses), { setLenses: c, setSelectedLensId: d } = pt(), [i, o] = _(!1), [u, m] = _(!1), p = Q((x) => x.dashboard), h = Q((x) => x.filterValues), { authToken: f, tokenProps: N } = Ze();
883
883
  async function g() {
884
884
  o(!0);
885
885
  const x = Us(
886
886
  p
887
887
  ), C = await Ad(
888
- y.apiServiceUrl,
888
+ N.apiServiceUrl,
889
889
  t,
890
890
  x,
891
891
  h,
@@ -947,7 +947,7 @@ function Rd() {
947
947
  }
948
948
  async function u(p) {
949
949
  if (await Id(i.apiServiceUrl, p, d == null ? void 0 : d.accessToken)) {
950
- const f = s == null ? void 0 : s.filter((y) => y.id !== p);
950
+ const f = s == null ? void 0 : s.filter((N) => N.id !== p);
951
951
  r(f || []), c("original");
952
952
  }
953
953
  }
@@ -965,10 +965,10 @@ function Rd() {
965
965
  isDefault: !p.isDefault
966
966
  };
967
967
  await $s(i.apiServiceUrl, f, d == null ? void 0 : d.accessToken);
968
- const y = s == null ? void 0 : s.find((g) => g.isDefault);
969
- if (y && y.id !== p.id) {
968
+ const N = s == null ? void 0 : s.find((g) => g.isDefault);
969
+ if (N && N.id !== p.id) {
970
970
  const g = {
971
- ...y,
971
+ ...N,
972
972
  isDefault: !1
973
973
  };
974
974
  await $s(i.apiServiceUrl, g, d == null ? void 0 : d.accessToken);
@@ -1515,7 +1515,7 @@ function $d({
1515
1515
  /* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-1", children: [
1516
1516
  i.slice(0, 3).map((h, f) => {
1517
1517
  var C, w;
1518
- const y = ((C = n.find(
1518
+ const N = ((C = n.find(
1519
1519
  (F) => F.id === h.orgUserId
1520
1520
  )) == null ? void 0 : C.name) || "Unknown User", g = ((w = n.find(
1521
1521
  (F) => F.id === h.orgUserId
@@ -1528,7 +1528,7 @@ function $d({
1528
1528
  {
1529
1529
  className: "flex items-center justify-between text-xs",
1530
1530
  children: [
1531
- /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: y }),
1531
+ /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: N }),
1532
1532
  /* @__PURE__ */ e(
1533
1533
  ne,
1534
1534
  {
@@ -1558,7 +1558,7 @@ function $d({
1558
1558
  /* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-1", children: [
1559
1559
  o.slice(0, 3).map((h, f) => {
1560
1560
  var C, w;
1561
- const y = ((C = n.find(
1561
+ const N = ((C = n.find(
1562
1562
  (F) => F.id === h.tenantUserId
1563
1563
  )) == null ? void 0 : C.name) || "Unknown User", g = ((w = n.find(
1564
1564
  (F) => F.id === h.tenantUserId
@@ -1571,7 +1571,7 @@ function $d({
1571
1571
  {
1572
1572
  className: "flex items-center justify-between text-xs",
1573
1573
  children: [
1574
- /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: y }),
1574
+ /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: N }),
1575
1575
  /* @__PURE__ */ e(
1576
1576
  ne,
1577
1577
  {
@@ -1595,7 +1595,7 @@ function $d({
1595
1595
  u.length > 0 && /* @__PURE__ */ a("div", { className: "space-y-1", children: [
1596
1596
  /* @__PURE__ */ e("div", { className: "text-xs font-medium text-purple-600", children: "All Org Users" }),
1597
1597
  /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-1", children: u.map((h, f) => {
1598
- const y = Nt(
1598
+ const N = Nt(
1599
1599
  h.role,
1600
1600
  s("")
1601
1601
  );
@@ -1610,7 +1610,7 @@ function $d({
1610
1610
  {
1611
1611
  variant: "outline",
1612
1612
  className: "ml-2 shrink-0 px-2 py-0.5 text-xs",
1613
- children: y
1613
+ children: N
1614
1614
  }
1615
1615
  )
1616
1616
  ]
@@ -1622,7 +1622,7 @@ function $d({
1622
1622
  m.length > 0 && /* @__PURE__ */ a("div", { className: "space-y-1", children: [
1623
1623
  /* @__PURE__ */ e("div", { className: "text-xs font-medium text-orange-600", children: "Org Users Only" }),
1624
1624
  /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-1", children: m.map((h, f) => {
1625
- const y = Nt(
1625
+ const N = Nt(
1626
1626
  h.role,
1627
1627
  s("")
1628
1628
  );
@@ -1637,7 +1637,7 @@ function $d({
1637
1637
  {
1638
1638
  variant: "outline",
1639
1639
  className: "ml-2 shrink-0 px-2 py-0.5 text-xs",
1640
- children: y
1640
+ children: N
1641
1641
  }
1642
1642
  )
1643
1643
  ]
@@ -1649,7 +1649,7 @@ function $d({
1649
1649
  p.length > 0 && /* @__PURE__ */ a("div", { className: "space-y-1", children: [
1650
1650
  /* @__PURE__ */ e("div", { className: "text-xs font-medium text-indigo-600", children: "All Tenants" }),
1651
1651
  /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-1", children: p.map((h, f) => {
1652
- const y = Nt(
1652
+ const N = Nt(
1653
1653
  h.role,
1654
1654
  s("")
1655
1655
  );
@@ -1664,7 +1664,7 @@ function $d({
1664
1664
  {
1665
1665
  variant: "outline",
1666
1666
  className: "ml-2 shrink-0 px-2 py-0.5 text-xs",
1667
- children: y
1667
+ children: N
1668
1668
  }
1669
1669
  )
1670
1670
  ]
@@ -1689,12 +1689,12 @@ function $d({
1689
1689
  ] }),
1690
1690
  /* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-1", children: [
1691
1691
  d.slice(0, 3).map((o, u) => {
1692
- var f, y;
1692
+ var f, N;
1693
1693
  const m = ((f = n.find(
1694
1694
  (g) => g.id === o.tenantUserId
1695
- )) == null ? void 0 : f.name) || "Unknown User", p = ((y = n.find(
1695
+ )) == null ? void 0 : f.name) || "Unknown User", p = ((N = n.find(
1696
1696
  (g) => g.id === o.tenantUserId
1697
- )) == null ? void 0 : y.type) || "", h = Nt(
1697
+ )) == null ? void 0 : N.type) || "", h = Nt(
1698
1698
  o.role,
1699
1699
  s(p)
1700
1700
  );
@@ -1770,9 +1770,9 @@ function $d({
1770
1770
  c.slice(0, 3).map((i, o) => {
1771
1771
  var h, f;
1772
1772
  const u = ((h = n.find(
1773
- (y) => y.id === i.tenantUserId
1773
+ (N) => N.id === i.tenantUserId
1774
1774
  )) == null ? void 0 : h.name) || "Unknown User", m = ((f = n.find(
1775
- (y) => y.id === i.tenantUserId
1775
+ (N) => N.id === i.tenantUserId
1776
1776
  )) == null ? void 0 : f.type) || "", p = Nt(
1777
1777
  i.role,
1778
1778
  s(m)
@@ -1889,7 +1889,7 @@ function Bd({
1889
1889
  aa,
1890
1890
  {
1891
1891
  currentRole: n == null ? void 0 : n.role,
1892
- onRoleChange: (y) => h(t.id, n.role, y),
1892
+ onRoleChange: (N) => h(t.id, n.role, N),
1893
1893
  roleOptions: i,
1894
1894
  disabled: !1,
1895
1895
  allowDropdown: !0
@@ -1905,11 +1905,11 @@ function Bd({
1905
1905
  handleUpdateAccess: h
1906
1906
  }
1907
1907
  ),
1908
- c && !r && /* @__PURE__ */ e("div", { onClick: (y) => y.stopPropagation(), children: /* @__PURE__ */ e(
1908
+ c && !r && /* @__PURE__ */ e("div", { onClick: (N) => N.stopPropagation(), children: /* @__PURE__ */ e(
1909
1909
  aa,
1910
1910
  {
1911
1911
  currentRole: (d == null ? void 0 : d.role) || "VIEWER",
1912
- onRoleChange: (y) => f(t.id, y),
1912
+ onRoleChange: (N) => f(t.id, N),
1913
1913
  roleOptions: i,
1914
1914
  disabled: !1
1915
1915
  }
@@ -1953,11 +1953,11 @@ function Ir({
1953
1953
  handleRemoveAccess: o,
1954
1954
  handleUpdateAccess: u
1955
1955
  }) {
1956
- const m = Na(), p = sa(), h = ba(), f = Ni(), y = na(), g = d || ((k) => {
1956
+ const m = Na(), p = sa(), h = ba(), f = Ni(), N = na(), g = d || ((k) => {
1957
1957
  const D = m.some((b) => b.id === k), v = p.includes(k);
1958
- D ? y.removeSelectedUser(k) : v ? y.removeUserFromRemove(k) : y.addSelectedUser({ id: k, role: "VIEWER" });
1959
- }), x = i || y.updateSelectedUserRole, C = o || y.addUserToRemove, w = u || ((k, D, v) => {
1960
- y.addUserToUpdate({ id: k, currentRole: D, newRole: v });
1958
+ D ? N.removeSelectedUser(k) : v ? N.removeUserFromRemove(k) : N.addSelectedUser({ id: k, role: "VIEWER" });
1959
+ }), x = i || N.updateSelectedUserRole, C = o || N.addUserToRemove, w = u || ((k, D, v) => {
1960
+ N.addUserToUpdate({ id: k, currentRole: D, newRole: v });
1961
1961
  }), F = r.filter((k) => k.id !== (c == null ? void 0 : c.id)), A = p;
1962
1962
  return /* @__PURE__ */ a("div", { className: "space-y-2", children: [
1963
1963
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
@@ -1986,7 +1986,7 @@ function Ir({
1986
1986
  variant: "ghost",
1987
1987
  size: "sm",
1988
1988
  onClick: () => {
1989
- m.length === F.length ? y.setSelectedUsers([]) : y.setSelectedUsers(
1989
+ m.length === F.length ? N.setSelectedUsers([]) : N.setSelectedUsers(
1990
1990
  F.map((k) => ({ id: k.id, role: "VIEWER" }))
1991
1991
  );
1992
1992
  },
@@ -2006,7 +2006,7 @@ function Ir({
2006
2006
  }
2007
2007
  ),
2008
2008
  !n && !s && (F == null ? void 0 : F.length) > 0 && F.map((k) => {
2009
- const D = t ? zd(k, t, c) : void 0, v = A.includes(k.id), b = !!D, N = b && !v, R = m.some(
2009
+ const D = t ? zd(k, t, c) : void 0, v = A.includes(k.id), b = !!D, y = b && !v, R = m.some(
2010
2010
  (E) => E.id === k.id
2011
2011
  ), S = m.find(
2012
2012
  (E) => E.id === k.id
@@ -2017,7 +2017,7 @@ function Ir({
2017
2017
  user: k,
2018
2018
  userShare: D,
2019
2019
  isUserRemoving: v,
2020
- hasAccess: N,
2020
+ hasAccess: y,
2021
2021
  hasAccessFromAPI: b,
2022
2022
  isSelected: R,
2023
2023
  selectedUser: S,
@@ -2109,7 +2109,7 @@ function Yd({
2109
2109
  }) {
2110
2110
  const o = jt(), u = xt().filter(
2111
2111
  (w) => w.value === "VIEWER" || w.value === "EDITOR" || w.value === "CONTRIBUTOR"
2112
- ), m = n.role !== "NONE" ? n.role : "NONE", p = r ? r.newRole : m, h = n.role !== "NONE" && !c && (!r || r.newRole === m), f = r !== null && r.newRole !== m, y = c, g = m === "NONE" || !m, x = (w) => {
2112
+ ), m = n.role !== "NONE" ? n.role : "NONE", p = r ? r.newRole : m, h = n.role !== "NONE" && !c && (!r || r.newRole === m), f = r !== null && r.newRole !== m, N = c, g = m === "NONE" || !m, x = (w) => {
2113
2113
  switch (w) {
2114
2114
  case "VIEWER":
2115
2115
  return /* @__PURE__ */ e(ma, { className: "h-4 w-4" });
@@ -2128,7 +2128,7 @@ function Yd({
2128
2128
  {
2129
2129
  className: B(
2130
2130
  "pb-6",
2131
- f && !y && !g ? "border-orange-300 bg-orange-50" : h ? "border-green-300 bg-green-50" : y || g ? "border-destructive bg-destructive/10" : ""
2131
+ f && !N && !g ? "border-orange-300 bg-orange-50" : h ? "border-green-300 bg-green-50" : N || g ? "border-destructive bg-destructive/10" : ""
2132
2132
  ),
2133
2133
  children: [
2134
2134
  /* @__PURE__ */ a(Hs, { children: [
@@ -2155,9 +2155,9 @@ function Yd({
2155
2155
  children: "Pending Update"
2156
2156
  }
2157
2157
  ),
2158
- (y || g) && /* @__PURE__ */ e(ne, { variant: "destructive", className: "ml-2", children: "No Access" })
2158
+ (N || g) && /* @__PURE__ */ e(ne, { variant: "destructive", className: "ml-2", children: "No Access" })
2159
2159
  ] }),
2160
- /* @__PURE__ */ e(bi, { children: y || g ? "No access for all users." : "This will share the dashboard with all users in your " + ((t == null ? void 0 : t.type) === "organization" ? "organization" : "tenant") + ". Select an access level below." })
2160
+ /* @__PURE__ */ e(bi, { children: N || g ? "No access for all users." : "This will share the dashboard with all users in your " + ((t == null ? void 0 : t.type) === "organization" ? "organization" : "tenant") + ". Select an access level below." })
2161
2161
  ] }),
2162
2162
  /* @__PURE__ */ e(Oa, { className: "space-y-4", children: /* @__PURE__ */ a("div", { className: "space-y-3", children: [
2163
2163
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
@@ -2297,7 +2297,7 @@ function qd({
2297
2297
  isRemoving: d = !1
2298
2298
  }) {
2299
2299
  var G, le;
2300
- const i = sn(), o = Ra(), { searchQuery: u, setSearchQuery: m, debouncedSearchQuery: p } = nn(), h = Na(), f = sa(), y = ba(), g = jt(), x = ln(), C = na(), [w, F] = qe.useState("specific_users"), A = () => {
2300
+ const i = sn(), o = Ra(), { searchQuery: u, setSearchQuery: m, debouncedSearchQuery: p } = nn(), h = Na(), f = sa(), N = ba(), g = jt(), x = ln(), C = na(), [w, F] = qe.useState("specific_users"), A = () => {
2301
2301
  if (i === "org") return "organization";
2302
2302
  if (i === "tenant") return "tenant";
2303
2303
  }, k = () => {
@@ -2315,7 +2315,7 @@ function qd({
2315
2315
  w === "all_users" ? "allOrgUsers" : "specificOrgUsers"
2316
2316
  );
2317
2317
  }, [C, w]);
2318
- const N = (se) => {
2318
+ const y = (se) => {
2319
2319
  var xe, Ie;
2320
2320
  const ve = se;
2321
2321
  if (F(ve), l == null || l(ve), C.setCurrentContext("org-tab"), ve === "specific_users")
@@ -2357,7 +2357,7 @@ function qd({
2357
2357
  Fn,
2358
2358
  {
2359
2359
  shareType: w,
2360
- onShareTypeChange: N,
2360
+ onShareTypeChange: y,
2361
2361
  currentUser: s,
2362
2362
  options: [
2363
2363
  {
@@ -2404,7 +2404,7 @@ function qd({
2404
2404
  /* @__PURE__ */ e(
2405
2405
  Mr,
2406
2406
  {
2407
- usersToUpdate: y,
2407
+ usersToUpdate: N,
2408
2408
  allUsers: R,
2409
2409
  onRemove: L,
2410
2410
  getRoleOptions: xt
@@ -2482,7 +2482,7 @@ function Rr({
2482
2482
  handleRemoveAccess: o,
2483
2483
  handleUpdateAccess: u
2484
2484
  }) {
2485
- const m = wa(), p = Sa(), h = ka(), f = na(), y = r(c == null ? void 0 : c.type);
2485
+ const m = wa(), p = Sa(), h = ka(), f = na(), N = r(c == null ? void 0 : c.type);
2486
2486
  return s ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-6", children: /* @__PURE__ */ e(Me, { className: "h-6 w-6 animate-spin" }) }) : t.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-sm text-muted-foreground", children: "No groups available to share with" }) : /* @__PURE__ */ a("div", { className: "space-y-2", children: [
2487
2487
  /* @__PURE__ */ e($, { children: "Available Groups" }),
2488
2488
  /* @__PURE__ */ e("div", { className: "max-h-[300px] space-y-2 overflow-y-auto rounded-md border p-3", children: t.map((g) => {
@@ -2554,7 +2554,7 @@ function Rr({
2554
2554
  onRoleChange: (v) => {
2555
2555
  x && v !== x.role && (u == null || u(g.id, x.role, v));
2556
2556
  },
2557
- roleOptions: y,
2557
+ roleOptions: N,
2558
2558
  disabled: !1,
2559
2559
  allowDropdown: !0,
2560
2560
  className: F ? "border-orange-300 bg-orange-100" : ""
@@ -2566,7 +2566,7 @@ function Rr({
2566
2566
  {
2567
2567
  currentRole: D,
2568
2568
  onRoleChange: (v) => i == null ? void 0 : i(g.id, v),
2569
- roleOptions: y,
2569
+ roleOptions: N,
2570
2570
  disabled: !1
2571
2571
  }
2572
2572
  )
@@ -2678,12 +2678,12 @@ function pl({
2678
2678
  isRemoving: d = !1
2679
2679
  }) {
2680
2680
  var J;
2681
- const { searchQuery: i, debouncedSearchQuery: o, setSearchQuery: u } = nn(), m = Na(), p = sa(), h = ba(), f = wa(), y = Sa(), g = ka(), x = jt(), C = os(), w = on(), F = Ra(), A = na(), { data: k, isLoading: D } = Ol({
2681
+ const { searchQuery: i, debouncedSearchQuery: o, setSearchQuery: u } = nn(), m = Na(), p = sa(), h = ba(), f = wa(), N = Sa(), g = ka(), x = jt(), C = os(), w = on(), F = Ra(), A = na(), { data: k, isLoading: D } = Ol({
2682
2682
  enabled: (s == null ? void 0 : s.type) === "organization"
2683
2683
  }), { groups: v, isLoading: b } = Rl(
2684
2684
  "tenant",
2685
2685
  (s == null ? void 0 : s.tenantId) || F
2686
- ), [N, R] = _(
2686
+ ), [y, R] = _(
2687
2687
  (s == null ? void 0 : s.type) === "organization" ? "all_tenants" : "specific_tenant_users"
2688
2688
  );
2689
2689
  qe.useEffect(() => {
@@ -2735,27 +2735,27 @@ function pl({
2735
2735
  }, se = (U, de, Te) => {
2736
2736
  A.addUserToUpdate({ id: U, currentRole: de, newRole: Te });
2737
2737
  }, ve = (U, de) => {
2738
- N === "all_tenant_users" ? A.setTenantWideRole(de) : N === "all_tenants" && A.setAllTenantsRole(de);
2738
+ y === "all_tenant_users" ? A.setTenantWideRole(de) : y === "all_tenants" && A.setAllTenantsRole(de);
2739
2739
  }, xe = () => {
2740
- N === "all_tenant_users" ? A.setTenantWideRole("VIEWER") : N === "all_tenants" && A.setAllTenantsRole("VIEWER");
2740
+ y === "all_tenant_users" ? A.setTenantWideRole("VIEWER") : y === "all_tenants" && A.setAllTenantsRole("VIEWER");
2741
2741
  }, te = (() => {
2742
2742
  var U, de, Te, Fe;
2743
2743
  return x === "allTenants" ? (de = (U = T == null ? void 0 : T.shares) == null ? void 0 : U.allTenantsOnly) == null ? void 0 : de[0] : x === "allTenantUsers" ? (Fe = (Te = T == null ? void 0 : T.shares) == null ? void 0 : Te.tenantWide) == null ? void 0 : Fe[0] : null;
2744
2744
  })();
2745
2745
  qe.useEffect(() => {
2746
2746
  var U, de, Te, Fe;
2747
- if (N === "all_tenant_users") {
2747
+ if (y === "all_tenant_users") {
2748
2748
  const be = (de = (U = T == null ? void 0 : T.shares) == null ? void 0 : U.tenantWide) == null ? void 0 : de[0];
2749
2749
  be && be.role !== void 0 && A.setTenantWideRole(be.role);
2750
- } else if (N === "all_tenants") {
2750
+ } else if (y === "all_tenants") {
2751
2751
  const be = (Fe = (Te = T == null ? void 0 : T.shares) == null ? void 0 : Te.allTenantsOnly) == null ? void 0 : Fe[0];
2752
2752
  be && be.role !== void 0 && A.setAllTenantsRole(be.role);
2753
2753
  }
2754
- }, [N, T, A]);
2754
+ }, [y, T, A]);
2755
2755
  const K = E.filter(
2756
2756
  (U) => m.some((de) => de.id === U.id)
2757
2757
  ), Ne = (U) => {
2758
- const de = f.some((be) => be.id === U), Te = y.includes(U), Fe = ie == null ? void 0 : ie.some(
2758
+ const de = f.some((be) => be.id === U), Te = N.includes(U), Fe = ie == null ? void 0 : ie.some(
2759
2759
  (be) => be.groupId === U
2760
2760
  );
2761
2761
  de ? A.removeSelectedGroup(U) : Te ? A.removeGroupFromRemove(U) : Fe || A.addSelectedGroup({ id: U, role: "VIEWER" });
@@ -2767,7 +2767,7 @@ function pl({
2767
2767
  A.addGroupToUpdate({ id: U, currentRole: de, newRole: Te });
2768
2768
  }, Pe = v.filter(
2769
2769
  (U) => f.some((de) => de.id === U.id)
2770
- ), Y = qe.useMemo(() => N !== "groups" ? [] : v.filter((U) => U.type !== "TENANT_GROUP" ? !1 : U.name.toLowerCase().includes(i.toLowerCase()) || U.description && U.description.toLowerCase().includes(i.toLowerCase())), [v, N, i]), ie = qe.useMemo(() => {
2770
+ ), Y = qe.useMemo(() => y !== "groups" ? [] : v.filter((U) => U.type !== "TENANT_GROUP" ? !1 : U.name.toLowerCase().includes(i.toLowerCase()) || U.description && U.description.toLowerCase().includes(i.toLowerCase())), [v, y, i]), ie = qe.useMemo(() => {
2771
2771
  var de, Te;
2772
2772
  const U = ((de = T == null ? void 0 : T.shares) == null ? void 0 : de.specificGroups) || ((Te = T == null ? void 0 : T.shares) == null ? void 0 : Te.groups) || [];
2773
2773
  return !U || U.length === 0 ? [] : U.filter(
@@ -2776,7 +2776,7 @@ function pl({
2776
2776
  return (be == null ? void 0 : be.type) === "TENANT_GROUP";
2777
2777
  }
2778
2778
  );
2779
- }, [T, v]), _e = I || M || N === "groups" && b, Re = L || V, ee = () => (s == null ? void 0 : s.type) === "tenant" || N === "all_tenants" || N === "groups" ? !0 : F && (N === "specific_tenant_users" || N === "all_tenant_users");
2779
+ }, [T, v]), _e = I || M || y === "groups" && b, Re = L || V, ee = () => (s == null ? void 0 : s.type) === "tenant" || y === "all_tenants" || y === "groups" ? !0 : F && (y === "specific_tenant_users" || y === "all_tenant_users");
2780
2780
  return /* @__PURE__ */ a(q, { children: [
2781
2781
  Re && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
2782
2782
  /* @__PURE__ */ e(cn, { className: "mx-auto mb-2 h-8 w-8 text-destructive" }),
@@ -2795,7 +2795,7 @@ function pl({
2795
2795
  /* @__PURE__ */ e(
2796
2796
  Fn,
2797
2797
  {
2798
- shareType: N,
2798
+ shareType: y,
2799
2799
  onShareTypeChange: S,
2800
2800
  currentUser: s,
2801
2801
  options: (s == null ? void 0 : s.type) === "tenant" ? [
@@ -2839,7 +2839,7 @@ function pl({
2839
2839
  ]
2840
2840
  }
2841
2841
  ),
2842
- (s == null ? void 0 : s.type) === "organization" && (N === "specific_tenant_users" || N === "all_tenant_users") && /* @__PURE__ */ a("div", { className: "mt-4", children: [
2842
+ (s == null ? void 0 : s.type) === "organization" && (y === "specific_tenant_users" || y === "all_tenant_users") && /* @__PURE__ */ a("div", { className: "mt-4", children: [
2843
2843
  /* @__PURE__ */ e($, { className: "mb-1 block text-sm font-medium", children: "Select Tenant" }),
2844
2844
  /* @__PURE__ */ a(
2845
2845
  me,
@@ -2859,7 +2859,7 @@ function pl({
2859
2859
  }
2860
2860
  )
2861
2861
  ] }),
2862
- ee() ? /* @__PURE__ */ e(q, { children: N === "specific_tenant_users" ? /* @__PURE__ */ a("div", { className: "space-y-4", children: [
2862
+ ee() ? /* @__PURE__ */ e(q, { children: y === "specific_tenant_users" ? /* @__PURE__ */ a("div", { className: "space-y-4", children: [
2863
2863
  /* @__PURE__ */ e(
2864
2864
  is,
2865
2865
  {
@@ -2912,7 +2912,7 @@ function pl({
2912
2912
  handleUpdateAccess: se
2913
2913
  }
2914
2914
  )
2915
- ] }) : N === "groups" ? /* @__PURE__ */ a("div", { className: "space-y-4", children: [
2915
+ ] }) : y === "groups" ? /* @__PURE__ */ a("div", { className: "space-y-4", children: [
2916
2916
  /* @__PURE__ */ e(
2917
2917
  is,
2918
2918
  {
@@ -2931,10 +2931,10 @@ function pl({
2931
2931
  getRoleOptions: xt
2932
2932
  }
2933
2933
  ),
2934
- y.length > 0 && /* @__PURE__ */ a("div", { className: "space-y-1", children: [
2934
+ N.length > 0 && /* @__PURE__ */ a("div", { className: "space-y-1", children: [
2935
2935
  /* @__PURE__ */ a("div", { className: "text-sm font-medium text-destructive", children: [
2936
2936
  "Groups to Remove (",
2937
- y.length,
2937
+ N.length,
2938
2938
  ")"
2939
2939
  ] }),
2940
2940
  /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: "These groups will lose access when you save" })
@@ -2962,7 +2962,7 @@ function pl({
2962
2962
  handleUpdateAccess: Oe
2963
2963
  }
2964
2964
  )
2965
- ] }) : N === "all_tenant_users" || N === "all_tenants" ? /* @__PURE__ */ e("div", { className: "mt-6", children: /* @__PURE__ */ e(
2965
+ ] }) : y === "all_tenant_users" || y === "all_tenants" ? /* @__PURE__ */ e("div", { className: "mt-6", children: /* @__PURE__ */ e(
2966
2966
  Or,
2967
2967
  {
2968
2968
  currentUser: s,
@@ -2980,7 +2980,7 @@ function pl({
2980
2980
  }
2981
2981
  ) }) : null }) : (
2982
2982
  /* Show message for org users when no tenant is selected */
2983
- (s == null ? void 0 : s.type) === "organization" && (N === "specific_tenant_users" || N === "all_tenant_users") && /* @__PURE__ */ e("div", { className: "mt-6 flex items-center justify-center py-8", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
2983
+ (s == null ? void 0 : s.type) === "organization" && (y === "specific_tenant_users" || y === "all_tenant_users") && /* @__PURE__ */ e("div", { className: "mt-6 flex items-center justify-center py-8", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
2984
2984
  /* @__PURE__ */ e(dl, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
2985
2985
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Please select a tenant to continue" })
2986
2986
  ] }) })
@@ -2998,7 +2998,7 @@ function Wd({
2998
2998
  isRemoving: d = !1
2999
2999
  }) {
3000
3000
  var L, M;
3001
- const { searchQuery: i, setSearchQuery: o } = nn(), u = wa(), m = Sa(), p = ka(), h = na(), [f, y] = qe.useState("org_groups"), [g, x] = qe.useState(""), { data: C, isLoading: w } = Ol({
3001
+ const { searchQuery: i, setSearchQuery: o } = nn(), u = wa(), m = Sa(), p = ka(), h = na(), [f, N] = qe.useState("org_groups"), [g, x] = qe.useState(""), { data: C, isLoading: w } = Ol({
3002
3002
  enabled: (s == null ? void 0 : s.type) === "organization" && f === "tenant_groups"
3003
3003
  }), F = Array.isArray(C) ? C : (C == null ? void 0 : C.tenants) || [], A = () => {
3004
3004
  if ((s == null ? void 0 : s.type) === "organization") return "organization";
@@ -3010,19 +3010,19 @@ function Wd({
3010
3010
  debouncedSearchQuery: "",
3011
3011
  resourceId: (t == null ? void 0 : t.id) || "",
3012
3012
  resourceType: n
3013
- }), b = k.filter((V) => f === "org_groups" && V.type !== "ORG_GROUP" || f === "tenant_groups" && V.type !== "TENANT_GROUP" || f === "tenant_groups" && (s == null ? void 0 : s.type) === "organization" && (!g || V.tenantId && V.tenantId !== g) ? !1 : V.name.toLowerCase().includes(i.toLowerCase()) || V.description && V.description.toLowerCase().includes(i.toLowerCase())), N = ((L = v == null ? void 0 : v.shares) == null ? void 0 : L.specificGroups) || ((M = v == null ? void 0 : v.shares) == null ? void 0 : M.groups) || [];
3013
+ }), b = k.filter((V) => f === "org_groups" && V.type !== "ORG_GROUP" || f === "tenant_groups" && V.type !== "TENANT_GROUP" || f === "tenant_groups" && (s == null ? void 0 : s.type) === "organization" && (!g || V.tenantId && V.tenantId !== g) ? !1 : V.name.toLowerCase().includes(i.toLowerCase()) || V.description && V.description.toLowerCase().includes(i.toLowerCase())), y = ((L = v == null ? void 0 : v.shares) == null ? void 0 : L.specificGroups) || ((M = v == null ? void 0 : v.shares) == null ? void 0 : M.groups) || [];
3014
3014
  qe.useEffect(() => {
3015
3015
  h.setCurrentContext("group-share"), h.setCurrentMode("specificGroups");
3016
3016
  }, [h]);
3017
3017
  const R = (V) => {
3018
3018
  const j = V;
3019
- y(j), j === "org_groups" && x(""), l == null || l(
3019
+ N(j), j === "org_groups" && x(""), l == null || l(
3020
3020
  j === "org_groups" ? "specific_groups" : "all_groups"
3021
3021
  ), h.setCurrentContext("group-share"), h.setCurrentMode("specificGroups");
3022
3022
  }, S = k.filter(
3023
3023
  (V) => u.some((j) => j.id === V.id)
3024
3024
  ), P = (V) => {
3025
- const j = u.some((G) => G.id === V), X = m.includes(V), Z = N == null ? void 0 : N.some(
3025
+ const j = u.some((G) => G.id === V), X = m.includes(V), Z = y == null ? void 0 : y.some(
3026
3026
  (G) => G.groupId === V
3027
3027
  );
3028
3028
  j ? h.removeSelectedGroup(V) : X ? h.removeGroupFromRemove(V) : Z || h.addSelectedGroup({ id: V, role: "VIEWER" });
@@ -3123,7 +3123,7 @@ function Wd({
3123
3123
  Rr,
3124
3124
  {
3125
3125
  groups: b,
3126
- existingGroupShares: N,
3126
+ existingGroupShares: y,
3127
3127
  isLoading: D,
3128
3128
  resource: t,
3129
3129
  getRoleOptions: xt,
@@ -3165,7 +3165,7 @@ const Pr = () => {
3165
3165
  m,
3166
3166
  p,
3167
3167
  h
3168
- ]), y = et(() => (x) => Si(x), []), g = et(() => {
3168
+ ]), N = et(() => (x) => Si(x), []), g = et(() => {
3169
3169
  if (!t || !n)
3170
3170
  return !1;
3171
3171
  switch (t) {
@@ -3196,7 +3196,7 @@ const Pr = () => {
3196
3196
  ]);
3197
3197
  return {
3198
3198
  buildShareData: f,
3199
- validateShareData: y,
3199
+ validateShareData: N,
3200
3200
  isCurrentStateValid: g,
3201
3201
  currentContext: t,
3202
3202
  currentMode: n,
@@ -3221,7 +3221,7 @@ function fl({
3221
3221
  currentAllUsersShare: o,
3222
3222
  onRemoveAccess: u
3223
3223
  }) {
3224
- const m = Na(), p = sa(), h = ba(), f = Ra(), y = ln(), g = on(), x = os(), { buildShareData: C, validateShareData: w, isCurrentStateValid: F } = Pr(), A = s || l || r, k = () => {
3224
+ const m = Na(), p = sa(), h = ba(), f = Ra(), N = ln(), g = on(), x = os(), { buildShareData: C, validateShareData: w, isCurrentStateValid: F } = Pr(), A = s || l || r, k = () => {
3225
3225
  var R, S, P, E;
3226
3226
  if (A) return "Updating...";
3227
3227
  if (i === "specific_users") {
@@ -3233,7 +3233,7 @@ function fl({
3233
3233
  if (!o || o.role === void 0)
3234
3234
  return "Share with All Users";
3235
3235
  const T = o.role;
3236
- return y === T ? "Remove Access" : "Update Access";
3236
+ return N === T ? "Remove Access" : "Update Access";
3237
3237
  } else if (i === "all_tenants") {
3238
3238
  const T = (S = (R = n == null ? void 0 : n.shares) == null ? void 0 : R.allTenantsOnly) == null ? void 0 : S[0];
3239
3239
  if (!T || T.role === void 0)
@@ -3264,7 +3264,7 @@ function fl({
3264
3264
  T && w(T) && c(T);
3265
3265
  } else {
3266
3266
  const T = o.role;
3267
- if (y === T)
3267
+ if (N === T)
3268
3268
  u == null || u();
3269
3269
  else {
3270
3270
  const L = C();
@@ -3318,13 +3318,13 @@ function fl({
3318
3318
  }
3319
3319
  }
3320
3320
  }
3321
- }, N = () => {
3321
+ }, y = () => {
3322
3322
  var R, S, P, E;
3323
3323
  if (i === "all_users") {
3324
3324
  if (!o || o.role === void 0)
3325
3325
  return "default";
3326
3326
  const T = o.role;
3327
- return y === T ? "destructive" : "default";
3327
+ return N === T ? "destructive" : "default";
3328
3328
  } else if (i === "all_tenants") {
3329
3329
  const T = (S = (R = n == null ? void 0 : n.shares) == null ? void 0 : R.allTenantsOnly) == null ? void 0 : S[0];
3330
3330
  if (!T || T.role === void 0)
@@ -3365,7 +3365,7 @@ function fl({
3365
3365
  {
3366
3366
  onClick: b,
3367
3367
  disabled: D(),
3368
- variant: N(),
3368
+ variant: y(),
3369
3369
  children: [
3370
3370
  A ? /* @__PURE__ */ a(q, { children: [
3371
3371
  /* @__PURE__ */ e(Me, { className: "mr-2 h-4 w-4 animate-spin" }),
@@ -3389,40 +3389,40 @@ function Qd({
3389
3389
  }) {
3390
3390
  const o = Na(), u = sa(), m = ba(), p = wa(), h = Sa(), f = ka();
3391
3391
  jt(), Fl();
3392
- const y = os();
3392
+ const N = os();
3393
3393
  Ra();
3394
3394
  const { buildShareData: g, validateShareData: x, isCurrentStateValid: C } = Pr(), w = n || s || l, F = () => {
3395
3395
  if (w) return "Updating...";
3396
3396
  if (d === "specific_users") {
3397
3397
  if (o.length === 0 && u.length === 0 && m.length === 0)
3398
3398
  return "Select users to share with";
3399
- const N = o.length + u.length + m.length;
3400
- return N === 0 ? "Select users to share with" : o.length > 0 && u.length > 0 ? `Update access for ${N} user${N !== 1 ? "s" : ""}` : u.length > 0 && o.length === 0 && m.length === 0 ? `Remove access for ${u.length} user${u.length !== 1 ? "s" : ""}` : o.length > 0 && u.length === 0 && m.length === 0 ? `Share with ${o.length} user${o.length !== 1 ? "s" : ""}` : m.length > 0 && o.length === 0 && u.length === 0 ? `Update access for ${m.length} user${m.length !== 1 ? "s" : ""}` : `Update access for ${N} user${N !== 1 ? "s" : ""}`;
3399
+ const y = o.length + u.length + m.length;
3400
+ return y === 0 ? "Select users to share with" : o.length > 0 && u.length > 0 ? `Update access for ${y} user${y !== 1 ? "s" : ""}` : u.length > 0 && o.length === 0 && m.length === 0 ? `Remove access for ${u.length} user${u.length !== 1 ? "s" : ""}` : o.length > 0 && u.length === 0 && m.length === 0 ? `Share with ${o.length} user${o.length !== 1 ? "s" : ""}` : m.length > 0 && o.length === 0 && u.length === 0 ? `Update access for ${m.length} user${m.length !== 1 ? "s" : ""}` : `Update access for ${y} user${y !== 1 ? "s" : ""}`;
3401
3401
  } else if (d === "groups") {
3402
3402
  if (p.length === 0 && h.length === 0 && f.length === 0)
3403
3403
  return "Select groups to share with";
3404
- const N = p.length + h.length + f.length;
3405
- return N === 0 ? "Select groups to share with" : p.length > 0 && h.length > 0 ? `Update access for ${N} group${N !== 1 ? "s" : ""}` : h.length > 0 && p.length === 0 && f.length === 0 ? `Remove access for ${h.length} group${h.length !== 1 ? "s" : ""}` : p.length > 0 && h.length === 0 && f.length === 0 ? `Share with ${p.length} group${p.length !== 1 ? "s" : ""}` : f.length > 0 && p.length === 0 && h.length === 0 ? `Update access for ${f.length} group${f.length !== 1 ? "s" : ""}` : `Update access for ${N} group${N !== 1 ? "s" : ""}`;
3404
+ const y = p.length + h.length + f.length;
3405
+ return y === 0 ? "Select groups to share with" : p.length > 0 && h.length > 0 ? `Update access for ${y} group${y !== 1 ? "s" : ""}` : h.length > 0 && p.length === 0 && f.length === 0 ? `Remove access for ${h.length} group${h.length !== 1 ? "s" : ""}` : p.length > 0 && h.length === 0 && f.length === 0 ? `Share with ${p.length} group${p.length !== 1 ? "s" : ""}` : f.length > 0 && p.length === 0 && h.length === 0 ? `Update access for ${f.length} group${f.length !== 1 ? "s" : ""}` : `Update access for ${y} group${y !== 1 ? "s" : ""}`;
3406
3406
  } else if (d === "all_users") {
3407
3407
  if (!i || i.role === "NONE")
3408
3408
  return "Share with All Users";
3409
- const N = i.role;
3410
- return y === N ? "Remove Access" : "Update Access";
3409
+ const y = i.role;
3410
+ return N === y ? "Remove Access" : "Update Access";
3411
3411
  }
3412
3412
  return "Share";
3413
3413
  }, A = () => w || !t ? !0 : !C, k = () => {
3414
- const N = g();
3415
- N && x(N) && r(N);
3414
+ const y = g();
3415
+ y && x(y) && r(y);
3416
3416
  }, D = () => {
3417
- const N = g();
3418
- N && x(N) && r(N);
3417
+ const y = g();
3418
+ y && x(y) && r(y);
3419
3419
  }, v = () => {
3420
3420
  if (!i || i.role === "NONE") {
3421
- const N = g();
3422
- N && x(N) && r(N);
3421
+ const y = g();
3422
+ y && x(y) && r(y);
3423
3423
  } else {
3424
- const N = i.role;
3425
- if (y === N) {
3424
+ const y = i.role;
3425
+ if (N === y) {
3426
3426
  const S = g();
3427
3427
  if (S && x(S)) {
3428
3428
  const P = {
@@ -3519,7 +3519,7 @@ function Hd({
3519
3519
  groupsToRemove: p,
3520
3520
  groupsToUpdate: h
3521
3521
  });
3522
- }, y = () => m.length > 0 || p.length > 0 || h.length > 0, g = () => p.length > 0 && m.length === 0 && h.length === 0 ? "Remove Access" : h.length > 0 && m.length === 0 && p.length === 0 ? "Update Access" : "Share with Groups", x = s || l || r;
3522
+ }, N = () => m.length > 0 || p.length > 0 || h.length > 0, g = () => p.length > 0 && m.length === 0 && h.length === 0 ? "Remove Access" : h.length > 0 && m.length === 0 && p.length === 0 ? "Update Access" : "Share with Groups", x = s || l || r;
3523
3523
  return /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
3524
3524
  /* @__PURE__ */ a("div", { className: "text-sm text-muted-foreground", children: [
3525
3525
  m.length > 0 && /* @__PURE__ */ a("span", { children: [
@@ -3543,7 +3543,7 @@ function Hd({
3543
3543
  z,
3544
3544
  {
3545
3545
  onClick: f,
3546
- disabled: !y() || x,
3546
+ disabled: !N() || x,
3547
3547
  children: [
3548
3548
  x && /* @__PURE__ */ e(Me, { className: "mr-2 h-4 w-4 animate-spin" }),
3549
3549
  g()
@@ -3615,13 +3615,13 @@ function Xd(t, n, s) {
3615
3615
  r,
3616
3616
  m.map((f) => {
3617
3617
  var g, x;
3618
- const y = (x = (g = i == null ? void 0 : i.shares) == null ? void 0 : g.specificOrgUsers) == null ? void 0 : x.find(
3618
+ const N = (x = (g = i == null ? void 0 : i.shares) == null ? void 0 : g.specificOrgUsers) == null ? void 0 : x.find(
3619
3619
  (C) => C.orgUserId === f
3620
3620
  );
3621
3621
  return {
3622
3622
  scope: "specific_org_user",
3623
3623
  orgUserId: f,
3624
- role: (y == null ? void 0 : y.role) || "VIEWER"
3624
+ role: (N == null ? void 0 : N.role) || "VIEWER"
3625
3625
  };
3626
3626
  })
3627
3627
  );
@@ -3679,14 +3679,14 @@ function Xd(t, n, s) {
3679
3679
  const f = Et(
3680
3680
  l,
3681
3681
  r,
3682
- m.map((y) => {
3682
+ m.map((N) => {
3683
3683
  var x, C;
3684
3684
  const g = (C = (x = i == null ? void 0 : i.shares) == null ? void 0 : x.specificTenantUsers) == null ? void 0 : C.find(
3685
- (w) => w.tenantUserId === y
3685
+ (w) => w.tenantUserId === N
3686
3686
  );
3687
3687
  return {
3688
3688
  scope: "specific_tenant_user",
3689
- tenantUserId: y,
3689
+ tenantUserId: N,
3690
3690
  tenantId: h,
3691
3691
  role: (g == null ? void 0 : g.role) || "VIEWER"
3692
3692
  };
@@ -3699,7 +3699,7 @@ function Xd(t, n, s) {
3699
3699
  });
3700
3700
  }
3701
3701
  if (p && p.length > 0 && p.forEach((f) => {
3702
- const y = ct(l, r, [
3702
+ const N = ct(l, r, [
3703
3703
  {
3704
3704
  scope: "specific_tenant_user",
3705
3705
  tenantUserId: f.id,
@@ -3707,7 +3707,7 @@ function Xd(t, n, s) {
3707
3707
  role: f.newRole
3708
3708
  }
3709
3709
  ]);
3710
- c(y, {
3710
+ c(N, {
3711
3711
  onSuccess: () => {
3712
3712
  o();
3713
3713
  }
@@ -3716,11 +3716,11 @@ function Xd(t, n, s) {
3716
3716
  const f = ct(
3717
3717
  l,
3718
3718
  r,
3719
- u.map((y) => ({
3719
+ u.map((N) => ({
3720
3720
  scope: "specific_tenant_user",
3721
- tenantUserId: y.id,
3721
+ tenantUserId: N.id,
3722
3722
  tenantId: h,
3723
- role: y.role
3723
+ role: N.role
3724
3724
  }))
3725
3725
  );
3726
3726
  c(f, {
@@ -3797,13 +3797,13 @@ function Xd(t, n, s) {
3797
3797
  r,
3798
3798
  m.map((f) => {
3799
3799
  var g, x;
3800
- const y = (x = (g = i == null ? void 0 : i.shares) == null ? void 0 : g.specificTenantUsers) == null ? void 0 : x.find(
3800
+ const N = (x = (g = i == null ? void 0 : i.shares) == null ? void 0 : g.specificTenantUsers) == null ? void 0 : x.find(
3801
3801
  (C) => C.tenantUserId === f
3802
3802
  );
3803
3803
  return {
3804
3804
  scope: "specific_tenant_user",
3805
3805
  tenantUserId: f,
3806
- role: (y == null ? void 0 : y.role) || "VIEWER"
3806
+ role: (N == null ? void 0 : N.role) || "VIEWER"
3807
3807
  };
3808
3808
  })
3809
3809
  );
@@ -3880,8 +3880,8 @@ function Xd(t, n, s) {
3880
3880
  ]);
3881
3881
  c(f, {
3882
3882
  onSuccess: () => {
3883
- var y;
3884
- o(), (y = n.resetGroupSelections) == null || y.call(n), re.success(
3883
+ var N;
3884
+ o(), (N = n.resetGroupSelections) == null || N.call(n), re.success(
3885
3885
  "Updated access for group"
3886
3886
  );
3887
3887
  }
@@ -3892,7 +3892,7 @@ function Xd(t, n, s) {
3892
3892
  }
3893
3893
  }
3894
3894
  function Zd(t, n, s, l) {
3895
- var u, m, p, h, f, y;
3895
+ var u, m, p, h, f, N;
3896
3896
  const {
3897
3897
  resourceType: r,
3898
3898
  resourceId: c,
@@ -3964,7 +3964,7 @@ function Zd(t, n, s, l) {
3964
3964
  });
3965
3965
  }
3966
3966
  } else {
3967
- const C = (y = (f = i == null ? void 0 : i.shares) == null ? void 0 : f.orgUsersOnly) == null ? void 0 : y[0];
3967
+ const C = (N = (f = i == null ? void 0 : i.shares) == null ? void 0 : f.orgUsersOnly) == null ? void 0 : N[0];
3968
3968
  if (C) {
3969
3969
  const w = Et(r, c, [
3970
3970
  {
@@ -3997,7 +3997,7 @@ function eu(t, n, s) {
3997
3997
  }, [l]), p = Ce(
3998
3998
  (f) => {
3999
3999
  if (!t) return;
4000
- const y = {
4000
+ const N = {
4001
4001
  resourceType: Ot.DASHBOARD,
4002
4002
  resourceId: t,
4003
4003
  shareMutation: n,
@@ -4006,7 +4006,7 @@ function eu(t, n, s) {
4006
4006
  resetUserSelections: u,
4007
4007
  resetGroupSelections: m
4008
4008
  };
4009
- Xd(f, y, i);
4009
+ Xd(f, N, i);
4010
4010
  },
4011
4011
  [
4012
4012
  t,
@@ -4056,7 +4056,7 @@ function Pn({
4056
4056
  onRemoveSuccess: r
4057
4057
  }) {
4058
4058
  var E, T, I, L, M, V, j, X;
4059
- const { currentUser: c } = Rt(), [d, i] = qe.useState("specific_users"), [o, u] = qe.useState("specific_users"), [m, p] = qe.useState("specific_groups"), h = na(), f = sn(), y = jt(), g = ki(), x = Di(), { handleShareSubmit: C, handleRemoveAccess: w } = eu(
4059
+ const { currentUser: c } = Rt(), [d, i] = qe.useState("specific_users"), [o, u] = qe.useState("specific_users"), [m, p] = qe.useState("specific_groups"), h = na(), f = sn(), N = jt(), g = ki(), x = Di(), { handleShareSubmit: C, handleRemoveAccess: w } = eu(
4060
4060
  t.id,
4061
4061
  (Z, G) => {
4062
4062
  g.mutate(Z, {
@@ -4086,10 +4086,10 @@ function Pn({
4086
4086
  resourceId: (t == null ? void 0 : t.id) || "",
4087
4087
  resourceType: n,
4088
4088
  userType: "organization"
4089
- }), b = (T = (E = D == null ? void 0 : D.shares) == null ? void 0 : E.tenantWide) == null ? void 0 : T[0], N = (L = (I = v == null ? void 0 : v.shares) == null ? void 0 : I.orgUsersOnly) == null ? void 0 : L[0], R = () => {
4089
+ }), b = (T = (E = D == null ? void 0 : D.shares) == null ? void 0 : E.tenantWide) == null ? void 0 : T[0], y = (L = (I = v == null ? void 0 : v.shares) == null ? void 0 : I.orgUsersOnly) == null ? void 0 : L[0], R = () => {
4090
4090
  if (f === "org")
4091
4091
  return o;
4092
- switch (y) {
4092
+ switch (N) {
4093
4093
  case "specificTenantUsers":
4094
4094
  return "specific_tenant_users";
4095
4095
  case "allTenantUsers":
@@ -4212,7 +4212,7 @@ function Pn({
4212
4212
  onShare: C,
4213
4213
  onClose: s,
4214
4214
  shareTabType: o,
4215
- currentAllUsersShare: N,
4215
+ currentAllUsersShare: y,
4216
4216
  onRemoveAccess: w
4217
4217
  }
4218
4218
  ) : f === "tenant" ? (
@@ -4427,8 +4427,8 @@ function du({
4427
4427
  };
4428
4428
  try {
4429
4429
  await u.mutateAsync(f), r(""), d(""), o({}), t();
4430
- } catch (y) {
4431
- console.error("Failed to create group:", y);
4430
+ } catch (N) {
4431
+ console.error("Failed to create group:", N);
4432
4432
  }
4433
4433
  }, className: "space-y-6", children: [
4434
4434
  /* @__PURE__ */ a("div", { className: "space-y-4", children: [
@@ -4518,7 +4518,7 @@ function uu({
4518
4518
  group: s,
4519
4519
  onUpdate: l
4520
4520
  }) {
4521
- const [r, c] = _("members"), [d, i] = _(""), [o, u] = _([]), [m, p] = _([]), { data: h, isLoading: f, refetch: y } = Ti(s.id), g = s.type === "TENANT_GROUP" ? "tenant" : "organization", { users: x, isLoading: C } = Il({
4521
+ const [r, c] = _("members"), [d, i] = _(""), [o, u] = _([]), [m, p] = _([]), { data: h, isLoading: f, refetch: N } = Ti(s.id), g = s.type === "TENANT_GROUP" ? "tenant" : "organization", { users: x, isLoading: C } = Il({
4522
4522
  type: g,
4523
4523
  tenantId: s.tenantId || void 0,
4524
4524
  active: !0,
@@ -4541,7 +4541,7 @@ function uu({
4541
4541
  return ((L = (I = T.user) == null ? void 0 : I.name) == null ? void 0 : L.toLowerCase().includes(E)) || ((V = (M = T.user) == null ? void 0 : M.email) == null ? void 0 : V.toLowerCase().includes(E));
4542
4542
  }
4543
4543
  );
4544
- }, [A, d]), N = async () => {
4544
+ }, [A, d]), y = async () => {
4545
4545
  if (o.length !== 0)
4546
4546
  try {
4547
4547
  await w.mutateAsync({
@@ -4550,7 +4550,7 @@ function uu({
4550
4550
  userIds: o,
4551
4551
  userType: g === "tenant" ? "tenant" : "org"
4552
4552
  }
4553
- }), u([]), c("members"), y(), l == null || l();
4553
+ }), u([]), c("members"), N(), l == null || l();
4554
4554
  } catch (E) {
4555
4555
  console.error("Failed to add members:", E);
4556
4556
  }
@@ -4562,7 +4562,7 @@ function uu({
4562
4562
  data: {
4563
4563
  userIds: m
4564
4564
  }
4565
- }), p([]), y(), l == null || l();
4565
+ }), p([]), N(), l == null || l();
4566
4566
  } catch (E) {
4567
4567
  console.error("Failed to remove members:", E);
4568
4568
  }
@@ -4683,7 +4683,7 @@ function uu({
4683
4683
  /* @__PURE__ */ e(
4684
4684
  z,
4685
4685
  {
4686
- onClick: N,
4686
+ onClick: y,
4687
4687
  disabled: w.isPending,
4688
4688
  children: w.isPending ? /* @__PURE__ */ a(q, { children: [
4689
4689
  /* @__PURE__ */ e(Me, { className: "mr-2 h-4 w-4 animate-spin" }),
@@ -4749,19 +4749,19 @@ function pu({
4749
4749
  open: t,
4750
4750
  onOpenChange: n
4751
4751
  }) {
4752
- const [s, l] = _("groups"), [r, c] = _(""), [d, i] = _(null), [o, u] = _(!1), [m, p] = _(null), { tokenProps: h } = Ze(), { currentUser: f } = Rt(), y = iu(), g = (f == null ? void 0 : f.type) === "tenant", x = h == null ? void 0 : h.tenantId, { groups: C, isLoading: w, refetch: F } = Mi({
4752
+ const [s, l] = _("groups"), [r, c] = _(""), [d, i] = _(null), [o, u] = _(!1), [m, p] = _(null), { tokenProps: h } = Ze(), { currentUser: f } = Rt(), N = iu(), g = (f == null ? void 0 : f.type) === "tenant", x = h == null ? void 0 : h.tenantId, { groups: C, isLoading: w, refetch: F } = Mi({
4753
4753
  type: g ? "TENANT_GROUP" : "all",
4754
4754
  tenantId: g ? x : void 0,
4755
4755
  includeMembers: !1
4756
4756
  }), A = C.filter(
4757
4757
  (b) => {
4758
- var N;
4759
- return b.name.toLowerCase().includes(r.toLowerCase()) || ((N = b.description) == null ? void 0 : N.toLowerCase().includes(r.toLowerCase()));
4758
+ var y;
4759
+ return b.name.toLowerCase().includes(r.toLowerCase()) || ((y = b.description) == null ? void 0 : y.toLowerCase().includes(r.toLowerCase()));
4760
4760
  }
4761
4761
  ), k = async () => {
4762
4762
  if (m)
4763
4763
  try {
4764
- await y.mutateAsync(m.id), p(null), F();
4764
+ await N.mutateAsync(m.id), p(null), F();
4765
4765
  } catch (b) {
4766
4766
  console.error("Failed to delete group:", b);
4767
4767
  }
@@ -4857,9 +4857,9 @@ function pu({
4857
4857
  xn,
4858
4858
  {
4859
4859
  onClick: k,
4860
- disabled: y.isPending,
4860
+ disabled: N.isPending,
4861
4861
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
4862
- children: y.isPending ? /* @__PURE__ */ a(q, { children: [
4862
+ children: N.isPending ? /* @__PURE__ */ a(q, { children: [
4863
4863
  /* @__PURE__ */ e(Me, { className: "mr-2 h-4 w-4 animate-spin" }),
4864
4864
  "Deleting..."
4865
4865
  ] }) : "Delete Group"
@@ -5064,7 +5064,7 @@ function yu() {
5064
5064
  var C;
5065
5065
  let f = m;
5066
5066
  m && !m.includes("{{") && (f = gu(m), t(f));
5067
- const y = (C = l == null ? void 0 : l.getState()) == null ? void 0 : C.settings, g = {
5067
+ const N = (C = l == null ? void 0 : l.getState()) == null ? void 0 : C.settings, g = {
5068
5068
  ...s,
5069
5069
  dataSource: s.dataSource || { mode: "directSource" },
5070
5070
  lastSelectedSchema: r,
@@ -5077,10 +5077,10 @@ function yu() {
5077
5077
  customCfg: u ? s.customCfg : null,
5078
5078
  preferences: s.preferences,
5079
5079
  // Preserve all preferences including column sizing
5080
- ...y && {
5080
+ ...N && {
5081
5081
  customCardPreferences: {
5082
5082
  ...s.customCardPreferences,
5083
- settings: y
5083
+ settings: N
5084
5084
  }
5085
5085
  }
5086
5086
  }, x = n.cards.map(
@@ -5116,7 +5116,7 @@ function ia() {
5116
5116
  setSelectedConnectionId: p,
5117
5117
  setSelectedDatabaseName: h,
5118
5118
  setSelectedSchemaName: f,
5119
- setSelectedTableName: y,
5119
+ setSelectedTableName: N,
5120
5120
  setSelectedDatamodelId: g,
5121
5121
  setFilterValues: x,
5122
5122
  setApplyFilters: C
@@ -5127,7 +5127,7 @@ function ia() {
5127
5127
  clearSelectedFrameId: k,
5128
5128
  addFrame: D,
5129
5129
  setIsDashboardPanelOpen: v
5130
- } = pt(), b = Q((I) => I.selectedSheetId), N = Q((I) => I.selectedFrameId), R = Q((I) => I.dashboard), S = Q((I) => I.filterValues), P = Ai((l == null ? void 0 : l.id) || "", {
5130
+ } = pt(), b = Q((I) => I.selectedSheetId), y = Q((I) => I.selectedFrameId), R = Q((I) => I.dashboard), S = Q((I) => I.filterValues), P = Ai((l == null ? void 0 : l.id) || "", {
5131
5131
  enabled: !!(l != null && l.id) && !!(t != null && t.accessToken)
5132
5132
  }), E = Ce(
5133
5133
  async (I) => {
@@ -5149,7 +5149,7 @@ function ia() {
5149
5149
  setSelectedConnectionId: p,
5150
5150
  setSelectedDatabaseName: h,
5151
5151
  setSelectedSchemaName: f,
5152
- setSelectedTableName: y,
5152
+ setSelectedTableName: N,
5153
5153
  setSelectedDatamodelId: g,
5154
5154
  setFilterValues: x,
5155
5155
  setApplyFilters: C,
@@ -5157,7 +5157,7 @@ function ia() {
5157
5157
  setIsVisualEditing: F,
5158
5158
  dashboard: R,
5159
5159
  selectedSheetId: b,
5160
- selectedFrameId: N,
5160
+ selectedFrameId: y,
5161
5161
  filterValues: S
5162
5162
  }))
5163
5163
  throw new Error("Failed to setup editor with visual data");
@@ -5182,14 +5182,14 @@ function ia() {
5182
5182
  p,
5183
5183
  h,
5184
5184
  f,
5185
- y,
5185
+ N,
5186
5186
  g,
5187
5187
  x,
5188
5188
  C,
5189
5189
  k,
5190
5190
  R,
5191
5191
  b,
5192
- N,
5192
+ y,
5193
5193
  S
5194
5194
  ]
5195
5195
  ), T = Ce(
@@ -5262,7 +5262,7 @@ function Nu({
5262
5262
  s && l ? `Copy of ${l}` : l || ""
5263
5263
  ), u(""), p(!s), f(!0));
5264
5264
  }, [t, s, l]);
5265
- const y = () => {
5265
+ const N = () => {
5266
5266
  d.trim() && (!m && !h || c({
5267
5267
  name: d.trim(),
5268
5268
  description: o.trim() || void 0,
@@ -5364,7 +5364,7 @@ function Nu({
5364
5364
  children: "Cancel"
5365
5365
  }
5366
5366
  ),
5367
- /* @__PURE__ */ a(z, { onClick: y, disabled: !g || r, children: [
5367
+ /* @__PURE__ */ a(z, { onClick: N, disabled: !g || r, children: [
5368
5368
  r && /* @__PURE__ */ e(Me, { className: "mr-2 h-4 w-4 animate-spin" }),
5369
5369
  r ? "Saving..." : "Save"
5370
5370
  ] })
@@ -5487,12 +5487,12 @@ function wu({
5487
5487
  frameObject: f
5488
5488
  }
5489
5489
  });
5490
- const y = {
5490
+ const N = {
5491
5491
  ...f,
5492
5492
  visualId: h
5493
5493
  // Keep the link to library visual
5494
5494
  };
5495
- i(d, y), n.invalidateQueries({ queryKey: ["visuals"] }), n.invalidateQueries({ queryKey: ["visual", h] }), re.success("Saved to library and applied locally"), setTimeout(() => {
5495
+ i(d, N), n.invalidateQueries({ queryKey: ["visuals"] }), n.invalidateQueries({ queryKey: ["visual", h] }), re.success("Saved to library and applied locally"), setTimeout(() => {
5496
5496
  o(!1);
5497
5497
  }, 300);
5498
5498
  } catch (f) {
@@ -5590,7 +5590,7 @@ function zn() {
5590
5590
  setCardConfig: h,
5591
5591
  setCardType: f
5592
5592
  } = oe();
5593
- function y() {
5593
+ function N() {
5594
5594
  const g = n.getQueryData(r);
5595
5595
  s != null && s.queryData || t({
5596
5596
  queryKey: r,
@@ -5600,7 +5600,7 @@ function zn() {
5600
5600
  return /* @__PURE__ */ a(
5601
5601
  z,
5602
5602
  {
5603
- onClick: y,
5603
+ onClick: N,
5604
5604
  className: "h-8",
5605
5605
  size: "sm",
5606
5606
  variant: "secondary",
@@ -5614,7 +5614,7 @@ function zn() {
5614
5614
  function Du() {
5615
5615
  const [t, n] = _(!1), [s, l] = _(!1), [r, c] = _(null), d = O((A) => A.frame), i = O((A) => A.card), o = us(), u = Q((A) => A.selectedSheetId), m = Q(
5616
5616
  (A) => A.actions.setIsDashboardPanelOpen
5617
- ), { getUpdatedFrame: p } = ia(), { selectVisual: h } = Fa(), { addFrame: f, setSelectedFrameId: y, setIsVisualEditing: g } = pt(), x = !!(d != null && d.visualId), C = (o == null ? void 0 : o.title) || (i == null ? void 0 : i.title) || "Untitled Visual", w = Oi((A) => {
5617
+ ), { getUpdatedFrame: p } = ia(), { selectVisual: h } = Fa(), { addFrame: f, setSelectedFrameId: N, setIsVisualEditing: g } = pt(), x = !!(d != null && d.visualId), C = (o == null ? void 0 : o.title) || (i == null ? void 0 : i.title) || "Untitled Visual", w = Oi((A) => {
5618
5618
  if (A != null && A.id) {
5619
5619
  if (h(A), s && r && u) {
5620
5620
  const k = {
@@ -5623,7 +5623,7 @@ function Du() {
5623
5623
  visualId: A.id
5624
5624
  // Link to the newly created library visual
5625
5625
  };
5626
- f(u, k, "end"), y(k.id), l(!1), c(null), g(!1);
5626
+ f(u, k, "end"), N(k.id), l(!1), c(null), g(!1);
5627
5627
  }
5628
5628
  m(!0), n(!1);
5629
5629
  }
@@ -5657,7 +5657,7 @@ function Du() {
5657
5657
  title: v.id === i.id ? A.name : v.title
5658
5658
  }))
5659
5659
  };
5660
- f(u, D, "end"), y(D.id), re.success("Visual saved to dashboard"), n(!1), g(!1);
5660
+ f(u, D, "end"), N(D.id), re.success("Visual saved to dashboard"), n(!1), g(!1);
5661
5661
  }
5662
5662
  },
5663
5663
  isLibraryVisual: x,
@@ -5673,7 +5673,7 @@ function Tu({
5673
5673
  setSaveAsDialogOpen: p,
5674
5674
  handleSaveAs: h,
5675
5675
  isLibraryVisual: f,
5676
- currentVisualName: y,
5676
+ currentVisualName: N,
5677
5677
  isSaving: g
5678
5678
  } = Du(), { handleAddLibraryVisual: x } = ia(), C = async () => {
5679
5679
  if (!c) {
@@ -5754,7 +5754,7 @@ function Tu({
5754
5754
  g || p(w);
5755
5755
  },
5756
5756
  isLibraryVisual: f,
5757
- currentVisualName: y,
5757
+ currentVisualName: N,
5758
5758
  isSaving: g,
5759
5759
  onConfirm: h
5760
5760
  }
@@ -5799,13 +5799,13 @@ function Eu() {
5799
5799
  Q((J) => J.selectedSheetId);
5800
5800
  const p = Q(
5801
5801
  (J) => J.isDashboardEditing
5802
- ), [h, f] = _(!1), [y, g] = _(!1), [x, C] = _(!1), w = Q((J) => J.isDashboardPanelOpen), F = Q(
5802
+ ), [h, f] = _(!1), [N, g] = _(!1), [x, C] = _(!1), w = Q((J) => J.isDashboardPanelOpen), F = Q(
5803
5803
  (J) => J.actions.setIsDashboardPanelOpen
5804
5804
  ), A = Q((J) => J.filterValues), k = Q((J) => J.isVisualEditing), D = O((J) => J.card), v = bt(
5805
5805
  (J) => J.selectedDashboard
5806
5806
  ), b = bt(
5807
5807
  (J) => J.initialDashboard
5808
- ), N = bt((J) => J.selectedVisual);
5808
+ ), y = bt((J) => J.selectedVisual);
5809
5809
  Q((J) => J.selectedFrameId), O((J) => J.frame);
5810
5810
  const R = v ? (Re = v == null ? void 0 : v.permissions) == null ? void 0 : Re.canEdit : (_e = b == null ? void 0 : b.permissions) == null ? void 0 : _e.canEdit, S = Q((J) => J.showFilters), P = Q(
5811
5811
  (J) => J.showDashboardJSON
@@ -5905,7 +5905,7 @@ function Eu() {
5905
5905
  ] }),
5906
5906
  !k && d && /* @__PURE__ */ e($, { children: Oe }),
5907
5907
  k && /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
5908
- /* @__PURE__ */ e($, { className: "text-sm font-medium", children: (N == null ? void 0 : N.title) || (D == null ? void 0 : D.title) || "Untitled Visual" }),
5908
+ /* @__PURE__ */ e($, { className: "text-sm font-medium", children: (y == null ? void 0 : y.title) || (D == null ? void 0 : D.title) || "Untitled Visual" }),
5909
5909
  /* @__PURE__ */ e(tu, {})
5910
5910
  ] })
5911
5911
  ] }),
@@ -6034,7 +6034,7 @@ function Eu() {
6034
6034
  ]
6035
6035
  }
6036
6036
  ),
6037
- y && le && /* @__PURE__ */ e(
6037
+ N && le && /* @__PURE__ */ e(
6038
6038
  Pn,
6039
6039
  {
6040
6040
  resource: le,
@@ -6115,7 +6115,7 @@ const _n = (t) => {
6115
6115
  removeMetricColumn: u,
6116
6116
  removePivotByColumn: m,
6117
6117
  removeSortByColumn: p
6118
- } = oe(), h = O((T) => T.card.type), f = t == null ? void 0 : t.id, y = Ce(
6118
+ } = oe(), h = O((T) => T.card.type), f = t == null ? void 0 : t.id, N = Ce(
6119
6119
  (T) => {
6120
6120
  if (!(t != null && t.config)) return [];
6121
6121
  switch (T) {
@@ -6211,7 +6211,7 @@ const _n = (t) => {
6211
6211
  ), x = Ce(
6212
6212
  (T, I, L) => {
6213
6213
  if (!f) return;
6214
- const V = y(T)[I];
6214
+ const V = N(T)[I];
6215
6215
  if (V)
6216
6216
  switch (T) {
6217
6217
  case "groupBy":
@@ -6230,7 +6230,7 @@ const _n = (t) => {
6230
6230
  },
6231
6231
  [
6232
6232
  f,
6233
- y,
6233
+ N,
6234
6234
  r,
6235
6235
  c,
6236
6236
  d,
@@ -6239,7 +6239,7 @@ const _n = (t) => {
6239
6239
  ), C = Ce(
6240
6240
  (T, I) => {
6241
6241
  if (!f) return;
6242
- const M = y("metrics")[T];
6242
+ const M = N("metrics")[T];
6243
6243
  M && c(f, M.id, {
6244
6244
  aggregate: I,
6245
6245
  label: ji(
@@ -6248,50 +6248,50 @@ const _n = (t) => {
6248
6248
  )
6249
6249
  });
6250
6250
  },
6251
- [f, y, c]
6251
+ [f, N, c]
6252
6252
  ), w = Ce(
6253
6253
  (T, I, L) => {
6254
6254
  if (!f) return;
6255
- const V = y("groupBy")[T];
6255
+ const V = N("groupBy")[T];
6256
6256
  if (!V) return;
6257
6257
  const j = {
6258
6258
  dateFormat: I
6259
6259
  };
6260
6260
  I === "custom" && L ? j.customFormat = L : j.customFormat = void 0, r(f, V.id, j);
6261
6261
  },
6262
- [f, y, r]
6262
+ [f, N, r]
6263
6263
  ), F = Ce(
6264
6264
  (T, I) => {
6265
6265
  if (!f) return;
6266
- const M = y("groupBy")[T];
6266
+ const M = N("groupBy")[T];
6267
6267
  M && r(f, M.id, {
6268
6268
  granularity: I
6269
6269
  });
6270
6270
  },
6271
- [f, y, r]
6271
+ [f, N, r]
6272
6272
  ), A = Ce(
6273
6273
  (T, I) => {
6274
6274
  if (!f) return;
6275
- const M = y("metrics")[T];
6275
+ const M = N("metrics")[T];
6276
6276
  M && c(f, M.id, {
6277
6277
  aliasTemplate: I
6278
6278
  });
6279
6279
  },
6280
- [f, y, c]
6280
+ [f, N, c]
6281
6281
  ), k = Ce(
6282
6282
  (T, I) => {
6283
6283
  if (console.log("handleValueAliasesChange", T, I), !f) return;
6284
6284
  console.log("handleValueAliasesChange", T, I);
6285
- const M = y("metrics")[T];
6285
+ const M = N("metrics")[T];
6286
6286
  M && (console.log("handleValueAliasesChange", I), c(f, M.id, {
6287
6287
  valueAliases: I
6288
6288
  }));
6289
6289
  },
6290
- [f, y, c]
6290
+ [f, N, c]
6291
6291
  ), D = Ce(
6292
6292
  (T) => {
6293
6293
  if (!f) return;
6294
- if (y("metrics").length === 0) {
6294
+ if (N("metrics").length === 0) {
6295
6295
  re.error("Add Metric First", {
6296
6296
  description: "Please add a metric field before selecting a comparison type",
6297
6297
  position: "top-center",
@@ -6301,7 +6301,7 @@ const _n = (t) => {
6301
6301
  }
6302
6302
  l(f, { comparisonType: T });
6303
6303
  },
6304
- [f, l, y]
6304
+ [f, l, N]
6305
6305
  ), v = Ce(
6306
6306
  (T) => {
6307
6307
  f && l(f, { showTrendline: T });
@@ -6312,7 +6312,7 @@ const _n = (t) => {
6312
6312
  f && l(f, { trendlineWindow: T });
6313
6313
  },
6314
6314
  [f, l]
6315
- ), N = Ce(
6315
+ ), y = Ce(
6316
6316
  (T) => {
6317
6317
  f && l(f, { trendlineGranularity: T });
6318
6318
  },
@@ -6327,10 +6327,10 @@ const _n = (t) => {
6327
6327
  var Z;
6328
6328
  if (!f) return;
6329
6329
  const I = [
6330
- ...y("groupBy"),
6331
- ...y("pivotBy"),
6332
- ...y("metrics"),
6333
- ...y("sortBy")
6330
+ ...N("groupBy"),
6331
+ ...N("pivotBy"),
6332
+ ...N("metrics"),
6333
+ ...N("sortBy")
6334
6334
  ], L = Ui(T, I, {
6335
6335
  joinPlan: (Z = t == null ? void 0 : t.config) == null ? void 0 : Z.joinPlan,
6336
6336
  joinabilityMap: s == null ? void 0 : s.joinabilityMap,
@@ -6367,7 +6367,7 @@ const _n = (t) => {
6367
6367
  });
6368
6368
  return;
6369
6369
  }
6370
- const j = y(M);
6370
+ const j = N(M);
6371
6371
  if (Wa(T, j)) return;
6372
6372
  const X = Qa(T, M, j);
6373
6373
  if (X) {
@@ -6385,7 +6385,7 @@ const _n = (t) => {
6385
6385
  [
6386
6386
  f,
6387
6387
  t == null ? void 0 : t.config,
6388
- y,
6388
+ N,
6389
6389
  g,
6390
6390
  n,
6391
6391
  s,
@@ -6395,10 +6395,10 @@ const _n = (t) => {
6395
6395
  ), P = Ce(
6396
6396
  (T, I) => {
6397
6397
  if (!f) return;
6398
- const M = y(T)[I];
6398
+ const M = N(T)[I];
6399
6399
  if (M) {
6400
6400
  if (T !== "sortBy") {
6401
- const V = y("sortBy"), j = V.filter(
6401
+ const V = N("sortBy"), j = V.filter(
6402
6402
  (X) => !(X.name === M.name && X.qualifiedEntityName === M.qualifiedEntityName)
6403
6403
  );
6404
6404
  j.length !== V.length && l(f, {
@@ -6423,7 +6423,7 @@ const _n = (t) => {
6423
6423
  },
6424
6424
  [
6425
6425
  f,
6426
- y,
6426
+ N,
6427
6427
  o,
6428
6428
  u,
6429
6429
  m,
@@ -6432,7 +6432,7 @@ const _n = (t) => {
6432
6432
  ]
6433
6433
  );
6434
6434
  return {
6435
- getFieldsForContainer: y,
6435
+ getFieldsForContainer: N,
6436
6436
  setFieldsForContainer: g,
6437
6437
  updateLabel: x,
6438
6438
  handleAggregationChange: C,
@@ -6446,7 +6446,7 @@ const _n = (t) => {
6446
6446
  handleKpiComparisonTypeChange: D,
6447
6447
  handleKpiShowTrendlineChange: v,
6448
6448
  handleKpiTrendlineWindowChange: b,
6449
- handleKpiTrendlineGranularityChange: N,
6449
+ handleKpiTrendlineGranularityChange: y,
6450
6450
  handleKpiTargetValueChange: R,
6451
6451
  // Card type for conditional rendering
6452
6452
  cardType: h
@@ -6527,7 +6527,7 @@ function Vr() {
6527
6527
  setCardSql: p,
6528
6528
  setRunSql: h,
6529
6529
  setSqlGen: f,
6530
- setIsShowingVisual: y
6530
+ setIsShowingVisual: N
6531
6531
  } = oe(), { connectionType: g, modelItems: x, selectedDatamodelName: C } = za(), w = (D) => ({
6532
6532
  column_name: D.name,
6533
6533
  data_type: D.dataType,
@@ -6540,12 +6540,12 @@ function Vr() {
6540
6540
  if (!n) return;
6541
6541
  const v = w(D);
6542
6542
  if (n && i && r) {
6543
- const N = jl(v, t);
6544
- f(N);
6543
+ const y = jl(v, t);
6544
+ f(y);
6545
6545
  const R = (b = x == null ? void 0 : x.find(
6546
6546
  (P) => P.id === o
6547
6547
  )) == null ? void 0 : b.name, S = Ul(
6548
- N,
6548
+ y,
6549
6549
  zt(c || ""),
6550
6550
  zt(r),
6551
6551
  R || "",
@@ -6556,16 +6556,16 @@ function Vr() {
6556
6556
  } else if (!n) {
6557
6557
  if (Gi(v.data_type))
6558
6558
  if (l && l.length > 0) {
6559
- const N = {
6559
+ const y = {
6560
6560
  ...v,
6561
6561
  role: "groupby",
6562
6562
  id: Ba(v.column_name),
6563
6563
  name: v.column_name,
6564
6564
  type: v.data_type
6565
6565
  };
6566
- m(N);
6566
+ m(y);
6567
6567
  } else {
6568
- const N = {
6568
+ const y = {
6569
6569
  ...v,
6570
6570
  role: "metric",
6571
6571
  id: Ba(v.column_name),
@@ -6574,10 +6574,10 @@ function Vr() {
6574
6574
  type: v.data_type,
6575
6575
  aggregate: "COUNT"
6576
6576
  };
6577
- u(N);
6577
+ u(y);
6578
6578
  }
6579
6579
  if (Bi(v.data_type)) {
6580
- const N = {
6580
+ const y = {
6581
6581
  ...v,
6582
6582
  role: "groupby",
6583
6583
  id: Ba(v.column_name),
@@ -6586,10 +6586,10 @@ function Vr() {
6586
6586
  label: Au(v.column_name, "month"),
6587
6587
  granularity: "month"
6588
6588
  };
6589
- m(N);
6589
+ m(y);
6590
6590
  }
6591
6591
  if (Xn(v.data_type)) {
6592
- const N = {
6592
+ const y = {
6593
6593
  ...v,
6594
6594
  role: "metric",
6595
6595
  id: Ba(v.column_name),
@@ -6598,7 +6598,7 @@ function Vr() {
6598
6598
  type: v.data_type,
6599
6599
  aggregate: "SUM"
6600
6600
  };
6601
- u(N);
6601
+ u(y);
6602
6602
  }
6603
6603
  }
6604
6604
  },
@@ -6614,7 +6614,7 @@ function Vr() {
6614
6614
  connectionType: g,
6615
6615
  databaseName: d || ""
6616
6616
  });
6617
- y(!1);
6617
+ N(!1);
6618
6618
  const v = g === "MSSQL" ? `SELECT top 10 * FROM ${D}` : `SELECT * FROM ${D} LIMIT 10`;
6619
6619
  p(v), h(!0);
6620
6620
  },
@@ -6637,7 +6637,7 @@ function Vr() {
6637
6637
  }
6638
6638
  function _r() {
6639
6639
  const t = O((f) => f.selectedConnectionId), n = O((f) => f.selectedDatamodelId), s = O((f) => f.selectedDatabaseName), l = O((f) => f.selectedSchemaName), r = O((f) => f.selectedTableName), c = Q((f) => f.dashboard.filters) || [], d = Q((f) => f.actions.addFilter), i = Q((f) => f.actions.removeFilter), { removeFilterValues: o } = pt(), { modelItems: u, tableName: m, connectionType: p } = za();
6640
- function h(f, y = "dashboard", g) {
6640
+ function h(f, N = "dashboard", g) {
6641
6641
  var b;
6642
6642
  const x = zt(f.column_name), C = zt(s || ""), w = zt(l || ""), F = zt(m);
6643
6643
  let A = Yi({
@@ -6647,19 +6647,19 @@ function _r() {
6647
6647
  databaseName: C
6648
6648
  }), k = `${A}.${x}`;
6649
6649
  const D = (b = u == null ? void 0 : u.find(
6650
- (N) => N.id === n
6650
+ (y) => y.id === n
6651
6651
  )) == null ? void 0 : b.name;
6652
6652
  n && n !== "none" && (k = `${tl}.${D}.${x}`, A = `${tl}.${D}`), g != null && g.qualifiedFieldName && (k = g.qualifiedFieldName), g != null && g.entityName && (A = g.entityName);
6653
6653
  const v = c == null ? void 0 : c.find(
6654
- (N) => N.column === k && N.table === F && (N.database === C || N.database === s)
6654
+ (y) => y.column === k && y.table === F && (y.database === C || y.database === s)
6655
6655
  );
6656
6656
  if (v)
6657
6657
  o(v.id), i(v.id);
6658
6658
  else {
6659
- const N = wt();
6659
+ const y = wt();
6660
6660
  return m === "api" && t ? (d({
6661
- location: y,
6662
- id: N,
6661
+ location: N,
6662
+ id: y,
6663
6663
  //uuidv4(),
6664
6664
  column: k,
6665
6665
  title: f.column_name,
@@ -6675,10 +6675,10 @@ function _r() {
6675
6675
  x
6676
6676
  )
6677
6677
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
6678
- }), N) : (d({
6679
- id: N,
6678
+ }), y) : (d({
6679
+ id: y,
6680
6680
  //uuidv4(),
6681
- location: y,
6681
+ location: N,
6682
6682
  column: k,
6683
6683
  //columnName, //`${qualifiedTableName}.${formattedColumnName}`,
6684
6684
  title: f.column_name,
@@ -6693,7 +6693,7 @@ function _r() {
6693
6693
  x
6694
6694
  )
6695
6695
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
6696
- }), N);
6696
+ }), y);
6697
6697
  }
6698
6698
  }
6699
6699
  return { assignFilter: h };
@@ -6701,10 +6701,10 @@ function _r() {
6701
6701
  function Iu({ column: t }) {
6702
6702
  const [n, s] = _(!1), l = O((C) => C.card.dataSource), { tableName: r, schemaName: c, databaseName: d } = jn(l), i = O(
6703
6703
  (C) => C.selectedDatamodelId
6704
- ), o = O((C) => C.sqlGen), { modelItems: u, connectionType: m } = za(), p = O((C) => C.actions.setSqlGen), h = O((C) => C.actions.setCardSql), f = O((C) => C.actions.setRunSql), y = zr(l);
6704
+ ), o = O((C) => C.sqlGen), { modelItems: u, connectionType: m } = za(), p = O((C) => C.actions.setSqlGen), h = O((C) => C.actions.setCardSql), f = O((C) => C.actions.setRunSql), N = zr(l);
6705
6705
  function g(C, w) {
6706
6706
  var D;
6707
- if (!y || !r) {
6707
+ if (!N || !r) {
6708
6708
  console.warn("Cannot generate SQL: missing table metadata");
6709
6709
  return;
6710
6710
  }
@@ -6766,7 +6766,7 @@ function Iu({ column: t }) {
6766
6766
  )
6767
6767
  ] });
6768
6768
  }
6769
- return y ? /* @__PURE__ */ a(Zs, { openDelay: 0, open: n, onOpenChange: s, children: [
6769
+ return N ? /* @__PURE__ */ a(Zs, { openDelay: 0, open: n, onOpenChange: s, children: [
6770
6770
  /* @__PURE__ */ e(en, { asChild: !0, children: /* @__PURE__ */ e(Za, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover/container:visible" }) }),
6771
6771
  /* @__PURE__ */ e(
6772
6772
  tn,
@@ -6806,7 +6806,7 @@ function Ru({
6806
6806
  setNodeRef: p,
6807
6807
  transform: h,
6808
6808
  transition: f,
6809
- isDragging: y
6809
+ isDragging: N
6810
6810
  } = ps({
6811
6811
  id: t.id,
6812
6812
  disabled: c
@@ -6828,7 +6828,7 @@ function Ru({
6828
6828
  }, v = {
6829
6829
  transform: fs.Transform.toString(h),
6830
6830
  transition: f
6831
- }, N = (() => {
6831
+ }, y = (() => {
6832
6832
  if (!s || r) return {};
6833
6833
  const P = {
6834
6834
  base: {
@@ -6882,17 +6882,17 @@ function Ru({
6882
6882
  ...c ? {} : m,
6883
6883
  className: B(
6884
6884
  "group/container max-w-[265px] overflow-hidden rounded-lg transition-all",
6885
- y && "scale-95 opacity-50",
6886
- !y && "border",
6885
+ N && "scale-95 opacity-50",
6886
+ !N && "border",
6887
6887
  // Default: plain border and background (clean UI)
6888
- N.borderColor || "border-transparent",
6889
- N.bgColor || "",
6888
+ y.borderColor || "border-transparent",
6889
+ y.bgColor || "",
6890
6890
  // Hover: show state-specific colors
6891
- N.hoverBorderColor,
6892
- N.hoverBgColor || "hover:bg-muted",
6891
+ y.hoverBorderColor,
6892
+ y.hoverBgColor || "hover:bg-muted",
6893
6893
  // Unreachable field states (always visible)
6894
- N.opacity,
6895
- N.cursor,
6894
+ y.opacity,
6895
+ y.cursor,
6896
6896
  // Active filter highlighting
6897
6897
  o && "bg-accent border-accent-foreground/20",
6898
6898
  // Cursor styling
@@ -6974,7 +6974,7 @@ function Fu({ context: t = "editor" } = {}) {
6974
6974
  columnGroups: p = [],
6975
6975
  isLoading: h,
6976
6976
  error: f
6977
- } = Va(), y = (d == null ? void 0 : d.mode) === "semanticDomain" ? d.semanticDomainId : void 0, { data: g } = Vn(y), x = [
6977
+ } = Va(), N = (d == null ? void 0 : d.mode) === "semanticDomain" ? d.semanticDomainId : void 0, { data: g } = Vn(N), x = [
6978
6978
  ...(i == null ? void 0 : i.groupByColumns) || [],
6979
6979
  ...(i == null ? void 0 : i.metricColumns) || []
6980
6980
  ];
@@ -6994,7 +6994,7 @@ function Fu({ context: t = "editor" } = {}) {
6994
6994
  label: qi(V.entityName),
6995
6995
  fields: []
6996
6996
  }), M[j].fields.push(V), M;
6997
- }, {}), b = Object.keys(D), N = F.filter(
6997
+ }, {}), b = Object.keys(D), y = F.filter(
6998
6998
  (M) => A(M) === "dimensions"
6999
6999
  ).length, R = F.filter(
7000
7000
  (M) => A(M) === "metrics"
@@ -7077,7 +7077,7 @@ function Fu({ context: t = "editor" } = {}) {
7077
7077
  ] }),
7078
7078
  /* @__PURE__ */ a(Ve, { value: "dimensions", className: "text-xs", children: [
7079
7079
  /* @__PURE__ */ e($l, { className: "size-4 shrink-0" }),
7080
- /* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children: N })
7080
+ /* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children: y })
7081
7081
  ] }),
7082
7082
  /* @__PURE__ */ a(Ve, { value: "metrics", className: "text-xs", children: [
7083
7083
  /* @__PURE__ */ e(vs, { className: "size-4 shrink-0" }),
@@ -7219,19 +7219,19 @@ function Pu({
7219
7219
  var S, P;
7220
7220
  const b = s.joins.find((E) => E.id === D);
7221
7221
  if (!b) return;
7222
- const N = { ...b, ...v }, R = s.joins.map(
7223
- (E) => E.id === D ? N : E
7222
+ const y = { ...b, ...v }, R = s.joins.map(
7223
+ (E) => E.id === D ? y : E
7224
7224
  );
7225
- if ((S = N.source) != null && S.name && ((P = N.target) != null && P.name) && N.joinKeyGroups[0].keys.length === 0) {
7225
+ if ((S = y.source) != null && S.name && ((P = y.target) != null && P.name) && y.joinKeyGroups[0].keys.length === 0) {
7226
7226
  const E = n.find(
7227
7227
  (M) => {
7228
7228
  var V;
7229
- return M.name === ((V = N.source) == null ? void 0 : V.name);
7229
+ return M.name === ((V = y.source) == null ? void 0 : V.name);
7230
7230
  }
7231
7231
  ), T = n.find(
7232
7232
  (M) => {
7233
7233
  var V;
7234
- return M.name === ((V = N.target) == null ? void 0 : V.name);
7234
+ return M.name === ((V = y.target) == null ? void 0 : V.name);
7235
7235
  }
7236
7236
  ), I = {
7237
7237
  id: `key-${Date.now()}`,
@@ -7256,11 +7256,11 @@ function Pu({
7256
7256
  entityType: (T == null ? void 0 : T.type) || "table"
7257
7257
  },
7258
7258
  operator: "="
7259
- }, L = [...N.joinKeyGroups];
7259
+ }, L = [...y.joinKeyGroups];
7260
7260
  L[0] = {
7261
7261
  ...L[0],
7262
7262
  keys: [I]
7263
- }, N.joinKeyGroups = L, R[R.findIndex((M) => M.id === D)] = N;
7263
+ }, y.joinKeyGroups = L, R[R.findIndex((M) => M.id === D)] = y;
7264
7264
  }
7265
7265
  l({
7266
7266
  ...s,
@@ -7277,8 +7277,8 @@ function Pu({
7277
7277
  moveJoinUp: (D) => {
7278
7278
  const v = s.joins.findIndex((b) => b.id === D);
7279
7279
  if (v > 0) {
7280
- const b = [...s.joins], N = { ...b[v] }, R = { ...b[v - 1] };
7281
- b[v] = R, b[v - 1] = N, b.forEach((P, E) => {
7280
+ const b = [...s.joins], y = { ...b[v] }, R = { ...b[v - 1] };
7281
+ b[v] = R, b[v - 1] = y, b.forEach((P, E) => {
7282
7282
  P.sequence = E + 1;
7283
7283
  });
7284
7284
  const S = {
@@ -7291,8 +7291,8 @@ function Pu({
7291
7291
  moveJoinDown: (D) => {
7292
7292
  const v = s.joins.findIndex((b) => b.id === D);
7293
7293
  if (v < s.joins.length - 1) {
7294
- const b = [...s.joins], N = { ...b[v] }, R = { ...b[v + 1] };
7295
- b[v] = R, b[v + 1] = N, b.forEach((P, E) => {
7294
+ const b = [...s.joins], y = { ...b[v] }, R = { ...b[v + 1] };
7295
+ b[v] = R, b[v + 1] = y, b.forEach((P, E) => {
7296
7296
  P.sequence = E + 1;
7297
7297
  });
7298
7298
  const S = {
@@ -7309,17 +7309,20 @@ function Pu({
7309
7309
  getAvailableSourceEntities: (D) => {
7310
7310
  if (s.joins.length === 0) return n;
7311
7311
  const v = s.joins.findIndex(
7312
- (N) => N.id === D
7312
+ (y) => y.id === D
7313
7313
  );
7314
- if (v === 0) return n;
7314
+ if (v === 0)
7315
+ return n.filter(
7316
+ (y) => y.name === s.baseEntity.name
7317
+ );
7315
7318
  const b = /* @__PURE__ */ new Set();
7316
- return s.baseEntity.name && b.add(s.baseEntity.name), s.joins.slice(0, v).forEach((N) => {
7317
- b.add(N.source.name), b.add(N.target.name);
7318
- }), n.filter((N) => b.has(N.name));
7319
+ return s.baseEntity.name && b.add(s.baseEntity.name), s.joins.slice(0, v).forEach((y) => {
7320
+ b.add(y.source.name), b.add(y.target.name);
7321
+ }), n.filter((y) => b.has(y.name));
7319
7322
  },
7320
7323
  getAvailableTargetEntities: (D) => n.filter((v) => v.name !== D),
7321
7324
  addJoinKeyGroup: (D) => {
7322
- const v = s.joins.find((N) => N.id === D);
7325
+ const v = s.joins.find((y) => y.id === D);
7323
7326
  if (!v) return;
7324
7327
  const b = [
7325
7328
  ...v.joinKeyGroups,
@@ -7332,21 +7335,21 @@ function Pu({
7332
7335
  o(D, { joinKeyGroups: b });
7333
7336
  },
7334
7337
  updateGroupOperator: (D, v, b) => {
7335
- const N = s.joins.find((S) => S.id === D);
7336
- if (!N) return;
7337
- const R = [...N.joinKeyGroups];
7338
+ const y = s.joins.find((S) => S.id === D);
7339
+ if (!y) return;
7340
+ const R = [...y.joinKeyGroups];
7338
7341
  R[v] = { ...R[v], operator: b }, o(D, { joinKeyGroups: R });
7339
7342
  },
7340
7343
  removeJoinKeyGroup: (D, v) => {
7341
7344
  const b = s.joins.find((R) => R.id === D);
7342
7345
  if (!b) return;
7343
- const N = [...b.joinKeyGroups];
7344
- N.splice(v, 1), o(D, { joinKeyGroups: N });
7346
+ const y = [...b.joinKeyGroups];
7347
+ y.splice(v, 1), o(D, { joinKeyGroups: y });
7345
7348
  },
7346
7349
  addJoinKey: (D, v) => {
7347
7350
  const b = s.joins.find((E) => E.id === D);
7348
7351
  if (!b) return;
7349
- const N = n.find(
7352
+ const y = n.find(
7350
7353
  (E) => E.name === b.source.name
7351
7354
  ), R = n.find(
7352
7355
  (E) => E.name === b.target.name
@@ -7358,9 +7361,9 @@ function Pu({
7358
7361
  dataType: "",
7359
7362
  label: "",
7360
7363
  qualifiedFieldName: "",
7361
- entityId: (N == null ? void 0 : N.name) || "",
7362
- entityName: (N == null ? void 0 : N.name) || "",
7363
- entityType: (N == null ? void 0 : N.type) || "table"
7364
+ entityId: (y == null ? void 0 : y.name) || "",
7365
+ entityName: (y == null ? void 0 : y.name) || "",
7366
+ entityType: (y == null ? void 0 : y.type) || "table"
7364
7367
  },
7365
7368
  target: {
7366
7369
  id: `target-${Date.now()}`,
@@ -7379,7 +7382,7 @@ function Pu({
7379
7382
  keys: [...S[v].keys, P]
7380
7383
  }, o(D, { joinKeyGroups: S });
7381
7384
  },
7382
- updateJoinKey: (D, v, b, N, R) => {
7385
+ updateJoinKey: (D, v, b, y, R) => {
7383
7386
  const S = s.joins.find((L) => L.id === D);
7384
7387
  if (!S) return;
7385
7388
  const P = n.find(
@@ -7387,43 +7390,43 @@ function Pu({
7387
7390
  ), E = n.find(
7388
7391
  (L) => L.name === S.target.name
7389
7392
  ), T = [...S.joinKeyGroups], I = T[v].keys[b];
7390
- N === "sourceColumnName" && P ? T[v].keys[b] = {
7393
+ y === "sourceColumnName" && P ? T[v].keys[b] = {
7391
7394
  ...I,
7392
7395
  source: {
7393
7396
  ...I.source,
7394
7397
  name: R
7395
7398
  }
7396
- } : N === "targetColumnName" && E ? T[v].keys[b] = {
7399
+ } : y === "targetColumnName" && E ? T[v].keys[b] = {
7397
7400
  ...I,
7398
7401
  target: {
7399
7402
  ...I.target,
7400
7403
  name: R
7401
7404
  }
7402
- } : N === "operator" && (T[v].keys[b] = {
7405
+ } : y === "operator" && (T[v].keys[b] = {
7403
7406
  ...I,
7404
7407
  operator: R
7405
7408
  }), o(D, { joinKeyGroups: T });
7406
7409
  },
7407
7410
  removeJoinKey: (D, v, b) => {
7408
- const N = s.joins.find((S) => S.id === D);
7409
- if (!N) return;
7410
- const R = [...N.joinKeyGroups];
7411
+ const y = s.joins.find((S) => S.id === D);
7412
+ if (!y) return;
7413
+ const R = [...y.joinKeyGroups];
7411
7414
  R[v].keys.splice(b, 1), o(D, { joinKeyGroups: R });
7412
7415
  },
7413
7416
  generateSQLPreview: () => {
7414
7417
  const D = [...s.joins].sort(
7415
- (N, R) => N.sequence - R.sequence
7418
+ (y, R) => y.sequence - R.sequence
7416
7419
  ), v = s.baseEntity;
7417
7420
  if (!v.name)
7418
7421
  return "SELECT * FROM table -- Please select a base entity";
7419
7422
  let b = `SELECT *
7420
7423
  FROM ${v.name}`;
7421
- return D.forEach((N) => {
7424
+ return D.forEach((y) => {
7422
7425
  const R = n.find(
7423
- (E) => E.name === N.target.name
7426
+ (E) => E.name === y.target.name
7424
7427
  );
7425
7428
  if (!R) return;
7426
- const S = N.joinKeyGroups.filter((E) => E.keys && E.keys.length > 0).map((E) => {
7429
+ const S = y.joinKeyGroups.filter((E) => E.keys && E.keys.length > 0).map((E) => {
7427
7430
  const T = E.keys.filter(
7428
7431
  (I) => {
7429
7432
  var L, M, V, j;
@@ -7435,16 +7438,16 @@ FROM ${v.name}`;
7435
7438
  return T.length > 1 ? `(${T.join(` ${E.operator} `)})` : T[0];
7436
7439
  }).filter(Boolean), P = S.length > 1 ? S.join(" OR ") : S[0] || "condition_here";
7437
7440
  b += `
7438
- ${N.joinType} JOIN ${R.name}
7441
+ ${y.joinType} JOIN ${R.name}
7439
7442
  ON ${P}`;
7440
7443
  }), b;
7441
7444
  },
7442
7445
  isValidConfiguration: () => !(!s.baseEntity.name || s.joins.some(
7443
- (N) => !N.source.name || !N.target.name
7446
+ (y) => !y.source.name || !y.target.name
7444
7447
  ) || s.joins.some(
7445
- (N) => N.joinKeyGroups.some((R) => R.keys.length === 0)
7448
+ (y) => y.joinKeyGroups.some((R) => R.keys.length === 0)
7446
7449
  ) || s.joins.some(
7447
- (N) => N.joinKeyGroups.some(
7450
+ (y) => y.joinKeyGroups.some(
7448
7451
  (R) => R.keys.some(
7449
7452
  (S) => !S.source.name || !S.target.name || !S.operator
7450
7453
  )
@@ -7469,7 +7472,7 @@ function Lu({
7469
7472
  removeJoin: p,
7470
7473
  updateJoin: h,
7471
7474
  moveJoinUp: f,
7472
- moveJoinDown: y,
7475
+ moveJoinDown: N,
7473
7476
  toggleJoinExpansion: g,
7474
7477
  getAvailableSourceEntities: x,
7475
7478
  getAvailableTargetEntities: C,
@@ -7480,7 +7483,7 @@ function Lu({
7480
7483
  updateJoinKey: D,
7481
7484
  removeJoinKey: v,
7482
7485
  generateSQLPreview: b,
7483
- isValidConfiguration: N
7486
+ isValidConfiguration: y
7484
7487
  } = Pu({
7485
7488
  initialJoinPlan: t,
7486
7489
  availableDataSources: n
@@ -7585,7 +7588,7 @@ function Lu({
7585
7588
  {
7586
7589
  variant: "ghost",
7587
7590
  size: "sm",
7588
- onClick: () => y(S.id),
7591
+ onClick: () => N(S.id),
7589
7592
  disabled: S.sequence === i.joins.length,
7590
7593
  children: /* @__PURE__ */ e(ql, { className: "h-4 w-4" })
7591
7594
  }
@@ -8039,7 +8042,7 @@ function Lu({
8039
8042
  z,
8040
8043
  {
8041
8044
  onClick: () => s(i),
8042
- disabled: !N(),
8045
+ disabled: !y(),
8043
8046
  children: "Save"
8044
8047
  }
8045
8048
  )
@@ -8193,11 +8196,11 @@ function Vu() {
8193
8196
  }, m = () => {
8194
8197
  const f = [...l.joins].sort(
8195
8198
  (x, C) => x.sequence - C.sequence
8196
- ), y = l.baseEntity;
8197
- if (!y.name)
8199
+ ), N = l.baseEntity;
8200
+ if (!N.name)
8198
8201
  return "SELECT * FROM table -- Please select a base entity";
8199
8202
  let g = `SELECT *
8200
- FROM ${y.name}`;
8203
+ FROM ${N.name}`;
8201
8204
  return f.forEach((x) => {
8202
8205
  const C = d.find(
8203
8206
  (A) => A.name === x.target.name
@@ -8206,8 +8209,8 @@ FROM ${y.name}`;
8206
8209
  const w = x.joinKeyGroups.filter((A) => A.keys && A.keys.length > 0).map((A) => {
8207
8210
  const k = A.keys.filter(
8208
8211
  (D) => {
8209
- var v, b, N, R;
8210
- return ((v = D.source) == null ? void 0 : v.name) && ((b = D.target) == null ? void 0 : b.name) && ((N = D.source) == null ? void 0 : N.entityName) && ((R = D.target) == null ? void 0 : R.entityName);
8212
+ var v, b, y, R;
8213
+ return ((v = D.source) == null ? void 0 : v.name) && ((b = D.target) == null ? void 0 : b.name) && ((y = D.source) == null ? void 0 : y.entityName) && ((R = D.target) == null ? void 0 : R.entityName);
8211
8214
  }
8212
8215
  ).map(
8213
8216
  (D) => `${D.source.entityName}.${D.source.name} ${D.operator} ${D.target.entityName}.${D.target.name}`
@@ -8279,14 +8282,14 @@ ${x.joinType} JOIN ${C.name}
8279
8282
  /* @__PURE__ */ e(Xe, { side: "right", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: [
8280
8283
  /* @__PURE__ */ e("p", { className: "text-xs font-medium", children: "Auto-resolved using relationships:" }),
8281
8284
  /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: n.relationshipsUsed.map(
8282
- (f, y) => /* @__PURE__ */ e(
8285
+ (f, N) => /* @__PURE__ */ e(
8283
8286
  ne,
8284
8287
  {
8285
8288
  variant: "outline",
8286
8289
  className: "text-xs",
8287
8290
  children: f
8288
8291
  },
8289
- y
8292
+ N
8290
8293
  )
8291
8294
  ) })
8292
8295
  ] }) })
@@ -8383,7 +8386,7 @@ function _u({
8383
8386
  return g.description;
8384
8387
  const x = [];
8385
8388
  return g.database && x.push(g.database), g.schema && x.push(g.schema), g.name && x.push(g.name), x.join(".");
8386
- }, y = (g) => s.some(
8389
+ }, N = (g) => s.some(
8387
8390
  (x) => x.name === g.name && x.type === g.type
8388
8391
  );
8389
8392
  return d.length === 0 ? /* @__PURE__ */ e(lt, { open: t, onOpenChange: n, children: /* @__PURE__ */ a(rt, { className: "max-w-md", children: [
@@ -8434,13 +8437,13 @@ function _u({
8434
8437
  {
8435
8438
  className: B(
8436
8439
  "flex items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-muted/50",
8437
- y(g) && "border-primary bg-primary/5"
8440
+ N(g) && "border-primary bg-primary/5"
8438
8441
  ),
8439
8442
  children: [
8440
8443
  /* @__PURE__ */ e(
8441
8444
  tt,
8442
8445
  {
8443
- checked: y(g),
8446
+ checked: N(g),
8444
8447
  onCheckedChange: () => i(g)
8445
8448
  }
8446
8449
  ),
@@ -8635,8 +8638,8 @@ function $r({
8635
8638
  /* @__PURE__ */ e(
8636
8639
  "button",
8637
8640
  {
8638
- onClick: (y) => {
8639
- y.stopPropagation();
8641
+ onClick: (N) => {
8642
+ N.stopPropagation();
8640
8643
  const g = p.selectedEntities.filter(
8641
8644
  (x) => !(x.name === h.name && x.type === h.type)
8642
8645
  );
@@ -8894,14 +8897,14 @@ function Yr(t) {
8894
8897
  }
8895
8898
  );
8896
8899
  }, [d, i, r]);
8897
- function y(g, x) {
8900
+ function N(g, x) {
8898
8901
  if (m.current = g, !p.current[r.id]) {
8899
8902
  const C = g.getModel(), w = f();
8900
8903
  p.current[r.id] = C || (x == null ? void 0 : x.editor.createModel(w, t)) || g.getModel();
8901
8904
  }
8902
8905
  g.setModel(p.current[r.id]);
8903
8906
  }
8904
- return { handleEditorDidMount: y };
8907
+ return { handleEditorDidMount: N };
8905
8908
  }
8906
8909
  function Bu() {
8907
8910
  const t = O((d) => d.card.sql), n = O((d) => d.sqlGen), { setCardSql: s, setSqlGen: l } = oe(), { handleEditorDidMount: r } = Yr("sql");
@@ -9015,7 +9018,7 @@ function Ku() {
9015
9018
  setCardCustomCfg: p,
9016
9019
  setQueryResultColumns: h,
9017
9020
  setCardSql: f,
9018
- setTempQueryData: y,
9021
+ setTempQueryData: N,
9019
9022
  // setQueryError,
9020
9023
  setPythonStdOut: g,
9021
9024
  setCardPreferences: x,
@@ -9029,7 +9032,7 @@ function Ku() {
9029
9032
  (G) => G.actions.setIsSqlRunning
9030
9033
  ), {
9031
9034
  data: b,
9032
- isLoading: N,
9035
+ isLoading: y,
9033
9036
  isFetching: R,
9034
9037
  isSuccess: S,
9035
9038
  isError: P,
@@ -9048,9 +9051,9 @@ function Ku() {
9048
9051
  h(G);
9049
9052
  }
9050
9053
  }, [b, h, g]), ye(() => {
9051
- (N || R) && v(!0), (P || S) && v(!1), P && (h([]), g(""));
9054
+ (y || R) && v(!0), (P || S) && v(!1), P && (h([]), g(""));
9052
9055
  }, [
9053
- N,
9056
+ y,
9054
9057
  R,
9055
9058
  b,
9056
9059
  g,
@@ -9175,14 +9178,14 @@ ${u}` : ""}
9175
9178
  z,
9176
9179
  {
9177
9180
  title: "Shift + Enter",
9178
- disabled: N || R,
9181
+ disabled: y || R,
9179
9182
  onClick: () => {
9180
9183
  L();
9181
9184
  },
9182
9185
  className: "h-8 shrink-0",
9183
9186
  size: "sm",
9184
9187
  children: [
9185
- N || R ? /* @__PURE__ */ e(Me, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(ao, { className: "mr-2 h-4 w-4" }),
9188
+ y || R ? /* @__PURE__ */ e(Me, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(ao, { className: "mr-2 h-4 w-4" }),
9186
9189
  "Run"
9187
9190
  ]
9188
9191
  }
@@ -9308,7 +9311,7 @@ function Wu({ className: t }) {
9308
9311
  ) });
9309
9312
  }
9310
9313
  function Qu({ card: t }) {
9311
- var F, A, k, D, v, b, N, R, S, P, E;
9314
+ var F, A, k, D, v, b, y, R, S, P, E;
9312
9315
  const [n, s] = _(!1), [l, r] = _(
9313
9316
  []
9314
9317
  ), { authToken: c } = Ze(), { theme: d } = Ys(), i = no(c == null ? void 0 : c.accessToken), o = Q((T) => T.themeStyle), u = {
@@ -9316,7 +9319,7 @@ function Qu({ card: t }) {
9316
9319
  colors: ((A = (F = o == null ? void 0 : o.chart) == null ? void 0 : F.dataset) == null ? void 0 : A.backgroundColor) || []
9317
9320
  };
9318
9321
  (k = t.customCardPreferences) != null && k.inputData;
9319
- const { getCard: m } = Cn(((D = t.customCardPreferences) == null ? void 0 : D.url) || ""), p = ((v = t.customCardPreferences) == null ? void 0 : v.visualType) || "single", h = O((T) => T.frame), { setCustomCardPreferences: f } = oe(), { data: y } = $e(t), g = Ce((T, I) => {
9322
+ const { getCard: m } = Cn(((D = t.customCardPreferences) == null ? void 0 : D.url) || ""), p = ((v = t.customCardPreferences) == null ? void 0 : v.visualType) || "single", h = O((T) => T.frame), { setCustomCardPreferences: f } = oe(), { data: N } = $e(t), g = Ce((T, I) => {
9320
9323
  r((L) => ({
9321
9324
  ...L,
9322
9325
  [T]: I
@@ -9325,7 +9328,7 @@ function Qu({ card: t }) {
9325
9328
  if (!((b = t.customCardPreferences) != null && b.componentName))
9326
9329
  return null;
9327
9330
  const x = m(
9328
- (N = t.customCardPreferences) == null ? void 0 : N.componentName
9331
+ (y = t.customCardPreferences) == null ? void 0 : y.componentName
9329
9332
  );
9330
9333
  function C(T) {
9331
9334
  s(T);
@@ -9350,7 +9353,7 @@ function Qu({ card: t }) {
9350
9353
  theme: u,
9351
9354
  settings: (S = t.customCardPreferences) == null ? void 0 : S.settings,
9352
9355
  onDataChange: g,
9353
- data: (y == null ? void 0 : y.records) || []
9356
+ data: (N == null ? void 0 : N.records) || []
9354
9357
  }
9355
9358
  ),
9356
9359
  x && p === "multiple" && /* @__PURE__ */ a(q, { children: [
@@ -9400,9 +9403,9 @@ function qr({
9400
9403
  ...n
9401
9404
  }) {
9402
9405
  var b;
9403
- const s = O((N) => N.card), l = Pa(s.config), r = ((b = s.customCardPreferences) == null ? void 0 : b.showCardHeader) ?? !0, c = O((N) => N.frame), d = Q((N) => N.dashboard.filters), i = O((N) => N.actions.setRunSql), { updateFilter: o } = pt(), u = d == null ? void 0 : d.find((N) => N.id === c.filterId), { data: m, isLoading: p, isFetching: h, errorMessage: f, pagination: y } = $e(s), { setCard: g, updateCardInFrame: x } = oe(), { data: C } = wn(s), w = et(() => {
9404
- var N;
9405
- return s.type !== "pivotTable" || !((N = m == null ? void 0 : m.records) != null && N.length) ? null : {
9406
+ const s = O((y) => y.card), l = Pa(s.config), r = ((b = s.customCardPreferences) == null ? void 0 : b.showCardHeader) ?? !0, c = O((y) => y.frame), d = Q((y) => y.dashboard.filters), i = O((y) => y.actions.setRunSql), { updateFilter: o } = pt(), u = d == null ? void 0 : d.find((y) => y.id === c.filterId), { data: m, isLoading: p, isFetching: h, errorMessage: f, pagination: N } = $e(s), { setCard: g, updateCardInFrame: x } = oe(), { data: C } = wn(s), w = et(() => {
9407
+ var y;
9408
+ return s.type !== "pivotTable" || !((y = m == null ? void 0 : m.records) != null && y.length) ? null : {
9406
9409
  records: m.records,
9407
9410
  columnSubtotalMeta: m.columnSubtotalMeta,
9408
9411
  subtotalColumns: m.subtotalColumns || [],
@@ -9416,12 +9419,12 @@ function qr({
9416
9419
  m == null ? void 0 : m.subtotalColumns,
9417
9420
  m == null ? void 0 : m.pivotSchema,
9418
9421
  m == null ? void 0 : m.groupByColumns
9419
- ]), F = ro(s, w), A = (N, R) => {
9422
+ ]), F = ro(s, w), A = (y, R) => {
9420
9423
  var P, E;
9421
9424
  const S = {
9422
9425
  ...s,
9423
9426
  paginationConfig: {
9424
- page: N + 1,
9427
+ page: y + 1,
9425
9428
  // Convert to 1-based
9426
9429
  pageSize: R
9427
9430
  }
@@ -9445,8 +9448,8 @@ function qr({
9445
9448
  s.preferences,
9446
9449
  C
9447
9450
  ]);
9448
- function D(N) {
9449
- return /* @__PURE__ */ e(ja, { FallbackComponent: kn, children: /* @__PURE__ */ e(Qu, { card: N }) });
9451
+ function D(y) {
9452
+ return /* @__PURE__ */ e(ja, { FallbackComponent: kn, children: /* @__PURE__ */ e(Qu, { card: y }) });
9450
9453
  }
9451
9454
  function v() {
9452
9455
  if (m != null && m.records && (m == null ? void 0 : m.records.length) === 0 && !p && !h)
@@ -9477,7 +9480,7 @@ function qr({
9477
9480
  {
9478
9481
  card: s,
9479
9482
  data: (m == null ? void 0 : m.records) || [],
9480
- paginationMetadata: y,
9483
+ paginationMetadata: N,
9481
9484
  onPaginationChange: A,
9482
9485
  isLoading: p || h
9483
9486
  }
@@ -9489,16 +9492,16 @@ function qr({
9489
9492
  card: s,
9490
9493
  data: F.data,
9491
9494
  options: F.options,
9492
- onAggregationChange: (N) => {
9495
+ onAggregationChange: (y) => {
9493
9496
  const R = nl(
9494
- N,
9497
+ y,
9495
9498
  s.config
9496
9499
  ), S = { ...s, config: R };
9497
9500
  g(S), x(S);
9498
9501
  },
9499
- onAggregationLabelChange: (N) => {
9502
+ onAggregationLabelChange: (y) => {
9500
9503
  const R = mo(
9501
- N,
9504
+ y,
9502
9505
  s.config
9503
9506
  ), S = { ...s, config: R };
9504
9507
  g(S), x(S);
@@ -9513,11 +9516,11 @@ function qr({
9513
9516
  data: (m == null ? void 0 : m.records) || [],
9514
9517
  groupByColumns: m == null ? void 0 : m.groupByColumns,
9515
9518
  pivotSchema: m == null ? void 0 : m.pivotSchema,
9516
- paginationMetadata: y,
9519
+ paginationMetadata: N,
9517
9520
  onPaginationChange: A,
9518
- onAggregationChange: (N) => {
9521
+ onAggregationChange: (y) => {
9519
9522
  const R = nl(
9520
- N,
9523
+ y,
9521
9524
  s.config
9522
9525
  ), S = { ...s, config: R };
9523
9526
  g(S), x(S);
@@ -9540,7 +9543,7 @@ function qr({
9540
9543
  Ha,
9541
9544
  {
9542
9545
  value: s.title,
9543
- onSave: (N) => g({ ...s, title: N }),
9546
+ onSave: (y) => g({ ...s, title: y }),
9544
9547
  isEditable: !0,
9545
9548
  placeholder: "Add title",
9546
9549
  displayClassName: "text-base font-semibold",
@@ -9553,7 +9556,7 @@ function qr({
9553
9556
  Ha,
9554
9557
  {
9555
9558
  value: s.description || "",
9556
- onSave: (N) => g({ ...s, description: N }),
9559
+ onSave: (y) => g({ ...s, description: y }),
9557
9560
  isEditable: !0,
9558
9561
  placeholder: "Add description",
9559
9562
  displayClassName: "text-sm text-muted-foreground",
@@ -9566,7 +9569,7 @@ function qr({
9566
9569
  Ha,
9567
9570
  {
9568
9571
  value: u.title || u.column,
9569
- onSave: (N) => o({ ...u, title: N }),
9572
+ onSave: (y) => o({ ...u, title: y }),
9570
9573
  isEditable: !0,
9571
9574
  placeholder: "Filter",
9572
9575
  displayClassName: "text-sm",
@@ -9694,7 +9697,7 @@ const As = ({
9694
9697
  /* @__PURE__ */ e(z, { onClick: r, variant: "outline", children: "Close" })
9695
9698
  ] });
9696
9699
  function em() {
9697
- const [t, n] = _(!1), [s, l] = _(""), [r, c] = _(""), [d, i] = _(""), [o, u] = _(""), m = O((k) => k.card), p = O((k) => k.card.customCfg), h = p ? JSON.stringify(p, null, 2) : "", { data: f } = $e(m), { data: y } = wn(m), { setCardCustomCfg: g, setCustomVisualCode: x } = oe(), C = (k) => {
9700
+ const [t, n] = _(!1), [s, l] = _(""), [r, c] = _(""), [d, i] = _(""), [o, u] = _(""), m = O((k) => k.card), p = O((k) => k.card.customCfg), h = p ? JSON.stringify(p, null, 2) : "", { data: f } = $e(m), { data: N } = wn(m), { setCardCustomCfg: g, setCustomVisualCode: x } = oe(), C = (k) => {
9698
9701
  var D, v;
9699
9702
  return JSON.stringify(
9700
9703
  {
@@ -9720,7 +9723,7 @@ function em() {
9720
9723
  queryConfig: m.queryConfig,
9721
9724
  //cfg: card.cfg,
9722
9725
  preferences: m.preferences,
9723
- topoJson: y
9726
+ topoJson: N
9724
9727
  });
9725
9728
  if (k) {
9726
9729
  l(C(k)), i(((v = m.preferences) == null ? void 0 : v.customVisualCode) || "");
@@ -10266,8 +10269,8 @@ function rm() {
10266
10269
  function im({
10267
10270
  className: t
10268
10271
  }) {
10269
- var h, f, y, g, x, C, w, F;
10270
- const n = O((A) => A.card), { setCardPreferences: s, updateCardInFrame: l, setCard: r } = oe(), [c, d] = _(!1), i = ((f = (h = n.preferences) == null ? void 0 : h.displayOptions) == null ? void 0 : f.showFilterInfo) ?? !0, o = ((g = (y = n.preferences) == null ? void 0 : y.displayOptions) == null ? void 0 : g.showCardToolbar) ?? !0, u = ((C = (x = n.preferences) == null ? void 0 : x.displayOptions) == null ? void 0 : C.showChrome) ?? !0, m = ((F = (w = n.preferences) == null ? void 0 : w.displayOptions) == null ? void 0 : F.allowScroll) ?? !0, p = (A, k) => {
10272
+ var h, f, N, g, x, C, w, F;
10273
+ const n = O((A) => A.card), { setCardPreferences: s, updateCardInFrame: l, setCard: r } = oe(), [c, d] = _(!1), i = ((f = (h = n.preferences) == null ? void 0 : h.displayOptions) == null ? void 0 : f.showFilterInfo) ?? !0, o = ((g = (N = n.preferences) == null ? void 0 : N.displayOptions) == null ? void 0 : g.showCardToolbar) ?? !0, u = ((C = (x = n.preferences) == null ? void 0 : x.displayOptions) == null ? void 0 : C.showChrome) ?? !0, m = ((F = (w = n.preferences) == null ? void 0 : w.displayOptions) == null ? void 0 : F.allowScroll) ?? !0, p = (A, k) => {
10271
10274
  var b;
10272
10275
  const D = {
10273
10276
  ...n.preferences,
@@ -10399,18 +10402,18 @@ function Qr() {
10399
10402
  ] });
10400
10403
  }
10401
10404
  function om() {
10402
- const t = O((y) => y.frame), n = O((y) => y.card), { setFrame: s, setActiveTabCardId: l, setCard: r, updateCardInFrame: c } = oe(), d = (y, g) => {
10403
- y.dataTransfer.setData("tabIndex", g.toString());
10404
- }, i = (y) => {
10405
- y.preventDefault();
10406
- }, o = (y, g) => {
10407
- const x = y.dataTransfer.getData("tabIndex");
10405
+ const t = O((N) => N.frame), n = O((N) => N.card), { setFrame: s, setActiveTabCardId: l, setCard: r, updateCardInFrame: c } = oe(), d = (N, g) => {
10406
+ N.dataTransfer.setData("tabIndex", g.toString());
10407
+ }, i = (N) => {
10408
+ N.preventDefault();
10409
+ }, o = (N, g) => {
10410
+ const x = N.dataTransfer.getData("tabIndex");
10408
10411
  if (x === g.toString()) return;
10409
10412
  const C = Array.from(t.cards), [w] = C.splice(parseInt(x), 1);
10410
10413
  C.splice(g, 0, w), s({ ...t, cards: C });
10411
10414
  };
10412
- function u(y) {
10413
- const g = t.cards.filter((w) => w.id !== y), x = g[0], C = {
10415
+ function u(N) {
10416
+ const g = t.cards.filter((w) => w.id !== N), x = g[0], C = {
10414
10417
  ...t,
10415
10418
  cards: g,
10416
10419
  // update the active card to the first card in the frame
@@ -10418,32 +10421,32 @@ function om() {
10418
10421
  };
10419
10422
  s(C), l(x.id), r(x);
10420
10423
  }
10421
- function m(y, g) {
10424
+ function m(N, g) {
10422
10425
  const x = {
10423
10426
  ...t,
10424
10427
  cards: [...t.cards, g],
10425
- activeCardId: y.id
10428
+ activeCardId: N.id
10426
10429
  };
10427
10430
  s(x), l(g.id);
10428
10431
  }
10429
10432
  function p() {
10430
- const y = {
10433
+ const N = {
10431
10434
  ...n,
10432
10435
  id: wt(),
10433
10436
  title: `${n.title} Copy`,
10434
10437
  tabTitle: `${n.tabTitle || n.title} Copy`
10435
10438
  // mode: card.mode || 'explorer', // Preserve mode when copying
10436
10439
  };
10437
- m(n, y);
10440
+ m(n, N);
10438
10441
  }
10439
- function h(y) {
10442
+ function h(N) {
10440
10443
  const g = {
10441
- dataSource: y.dataSource,
10442
- connectionId: y.connectionId,
10443
- lastSelectedDatabase: y.lastSelectedDatabase,
10444
- lastSelectedSchema: y.lastSelectedSchema,
10445
- lastSelectedTable: y.lastSelectedTable,
10446
- lastSelectedDatamodelId: y.lastSelectedDatamodelId,
10444
+ dataSource: N.dataSource,
10445
+ connectionId: N.connectionId,
10446
+ lastSelectedDatabase: N.lastSelectedDatabase,
10447
+ lastSelectedSchema: N.lastSelectedSchema,
10448
+ lastSelectedTable: N.lastSelectedTable,
10449
+ lastSelectedDatamodelId: N.lastSelectedDatamodelId,
10447
10450
  id: wt(),
10448
10451
  title: "Title",
10449
10452
  description: "",
@@ -10461,10 +10464,10 @@ function om() {
10461
10464
  mode: "explorer"
10462
10465
  // Set default mode for new cards
10463
10466
  };
10464
- m(y, g);
10467
+ m(N, g);
10465
10468
  }
10466
- function f(y, g) {
10467
- return y.cards.length === 1 && (g.displayTab === !0 || g.displayTab === void 0) || y.activeCardId !== g.id && (g.displayTab === !0 || g.displayTab === void 0) ? null : /* @__PURE__ */ e(
10469
+ function f(N, g) {
10470
+ return N.cards.length === 1 && (g.displayTab === !0 || g.displayTab === void 0) || N.activeCardId !== g.id && (g.displayTab === !0 || g.displayTab === void 0) ? null : /* @__PURE__ */ e(
10468
10471
  "div",
10469
10472
  {
10470
10473
  onClick: () => {
@@ -10479,7 +10482,7 @@ function om() {
10479
10482
  );
10480
10483
  }
10481
10484
  return /* @__PURE__ */ e(Pt, { className: "group mx-4 justify-between overflow-x-auto", children: /* @__PURE__ */ a("div", { className: "flex items-center", children: [
10482
- t.cards.map((y, g) => /* @__PURE__ */ a(
10485
+ t.cards.map((N, g) => /* @__PURE__ */ a(
10483
10486
  Ve,
10484
10487
  {
10485
10488
  draggable: !0,
@@ -10487,22 +10490,22 @@ function om() {
10487
10490
  onDragOver: i,
10488
10491
  onDrop: (x) => o(x, g),
10489
10492
  className: "",
10490
- value: y.id,
10493
+ value: N.id,
10491
10494
  children: [
10492
- f(t, y),
10495
+ f(t, N),
10493
10496
  /* @__PURE__ */ e(
10494
10497
  ko,
10495
10498
  {
10496
- enabled: t.activeCardId === y.id,
10497
- text: y.tabTitle || y.title,
10499
+ enabled: t.activeCardId === N.id,
10500
+ text: N.tabTitle || N.title,
10498
10501
  onSave: (x) => {
10499
10502
  r({ ...n, tabTitle: x }), c({ ...n, tabTitle: x });
10500
10503
  },
10501
- children: y.tabTitle || y.title
10504
+ children: N.tabTitle || N.title
10502
10505
  },
10503
- y.id
10506
+ N.id
10504
10507
  ),
10505
- t.activeCardId === y.id && /* @__PURE__ */ e(
10508
+ t.activeCardId === N.id && /* @__PURE__ */ e(
10506
10509
  Do,
10507
10510
  {
10508
10511
  className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
@@ -10511,16 +10514,16 @@ function om() {
10511
10514
  }
10512
10515
  }
10513
10516
  ),
10514
- t.activeCardId === y.id && t.cards.length > 1 && /* @__PURE__ */ e(
10517
+ t.activeCardId === N.id && t.cards.length > 1 && /* @__PURE__ */ e(
10515
10518
  Ee,
10516
10519
  {
10517
10520
  className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
10518
- onClick: () => u(y.id)
10521
+ onClick: () => u(N.id)
10519
10522
  }
10520
10523
  )
10521
10524
  ]
10522
10525
  },
10523
- y.id
10526
+ N.id
10524
10527
  )),
10525
10528
  /* @__PURE__ */ e(
10526
10529
  ge,
@@ -10542,12 +10545,12 @@ function Hr() {
10542
10545
  return;
10543
10546
  }
10544
10547
  if (C != null && C.queryConfig) {
10545
- l && i(!1), y(x), c(x);
10548
+ l && i(!1), N(x), c(x);
10546
10549
  return;
10547
10550
  }
10548
- l || y(x), c(x);
10551
+ l || N(x), c(x);
10549
10552
  }
10550
- function y(x) {
10553
+ function N(x) {
10551
10554
  const C = {
10552
10555
  ...t,
10553
10556
  cards: t.cards.map((F) => F.id === n.id ? n : F),
@@ -10602,22 +10605,22 @@ function xl({
10602
10605
  runAssistant: u,
10603
10606
  setIsDevMode: m,
10604
10607
  setCardPreferences: p
10605
- } = oe(), { data: h, isLoading: f, isFetching: y, errorMessage: g, refetch: x } = $e(n), [C, w] = _(!1);
10608
+ } = oe(), { data: h, isLoading: f, isFetching: N, errorMessage: g, refetch: x } = $e(n), [C, w] = _(!1);
10606
10609
  ye(() => {
10607
- y || w(!1);
10608
- }, [y]);
10610
+ N || w(!1);
10611
+ }, [N]);
10609
10612
  function F() {
10610
- const b = JSON.stringify(h == null ? void 0 : h.records, null, 2), N = new Blob([b], { type: "application/json" }), R = URL.createObjectURL(N), S = document.createElement("a");
10613
+ const b = JSON.stringify(h == null ? void 0 : h.records, null, 2), y = new Blob([b], { type: "application/json" }), R = URL.createObjectURL(y), S = document.createElement("a");
10611
10614
  S.href = R, S.download = `${n.title}.json`, S.click();
10612
10615
  }
10613
10616
  function A() {
10614
- const N = [
10617
+ const y = [
10615
10618
  Object.keys(
10616
10619
  h == null ? void 0 : h.records.reduce((E, T) => ({ ...E, ...T }), {})
10617
10620
  ).join(","),
10618
10621
  ...((h == null ? void 0 : h.records) || []).map((E) => Object.values(E).join(","))
10619
10622
  ].join(`
10620
- `), R = new Blob([N], { type: "text/csv" }), S = URL.createObjectURL(R), P = document.createElement("a");
10623
+ `), R = new Blob([y], { type: "text/csv" }), S = URL.createObjectURL(R), P = document.createElement("a");
10621
10624
  P.href = S, P.download = `${n.title}.csv`, P.click();
10622
10625
  }
10623
10626
  function k() {
@@ -10674,7 +10677,7 @@ function xl({
10674
10677
  ge,
10675
10678
  {
10676
10679
  tooltip: "Refresh",
10677
- disabled: f || y,
10680
+ disabled: f || N,
10678
10681
  onClick: () => {
10679
10682
  w(!0), x();
10680
10683
  },
@@ -10697,11 +10700,11 @@ function xl({
10697
10700
  id: "pagination",
10698
10701
  checked: ((v = (D = n.preferences) == null ? void 0 : D.tablePrefs) == null ? void 0 : v.enableDevModePagination) ?? !1,
10699
10702
  onCheckedChange: (b) => {
10700
- var N;
10703
+ var y;
10701
10704
  p({
10702
10705
  ...n.preferences,
10703
10706
  tablePrefs: {
10704
- ...(N = n.preferences) == null ? void 0 : N.tablePrefs,
10707
+ ...(y = n.preferences) == null ? void 0 : y.tablePrefs,
10705
10708
  enableDevModePagination: b
10706
10709
  }
10707
10710
  }), x();
@@ -10871,7 +10874,7 @@ function um() {
10871
10874
  label: "",
10872
10875
  options: w || [],
10873
10876
  value: ((b = (v = t == null ? void 0 : t.dataInputCardIds) == null ? void 0 : v[D]) == null ? void 0 : b.cardId) || "",
10874
- onValueChange: (N) => m(D, N)
10877
+ onValueChange: (y) => m(D, y)
10875
10878
  }
10876
10879
  )
10877
10880
  ]
@@ -10926,7 +10929,7 @@ function um() {
10926
10929
  )
10927
10930
  ] }, F)) });
10928
10931
  }
10929
- function y(C) {
10932
+ function N(C) {
10930
10933
  t && d({
10931
10934
  ...t,
10932
10935
  visualType: C,
@@ -10965,7 +10968,7 @@ function um() {
10965
10968
  Ft,
10966
10969
  {
10967
10970
  value: c,
10968
- onValueChange: y,
10971
+ onValueChange: N,
10969
10972
  children: /* @__PURE__ */ a(Pt, { className: "h-9 w-full", children: [
10970
10973
  /* @__PURE__ */ e(Ve, { className: "h-7 w-full", value: "single", children: "Single Visual" }),
10971
10974
  /* @__PURE__ */ e(Ve, { className: "h-7 w-full", value: "multiple", children: "Multi-Visual" })
@@ -11047,8 +11050,8 @@ function oa() {
11047
11050
  (f) => f.columnIndex !== u
11048
11051
  )
11049
11052
  }), n((f) => {
11050
- const y = [...f];
11051
- return y[u] = !1, y;
11053
+ const N = [...f];
11054
+ return N[u] = !1, N;
11052
11055
  }));
11053
11056
  }
11054
11057
  function i(u, m) {
@@ -11064,12 +11067,12 @@ function oa() {
11064
11067
  }
11065
11068
  function o(u) {
11066
11069
  var m, p, h, f;
11067
- if (t != null && t[u] || (p = (m = s == null ? void 0 : s.onClickFilter) == null ? void 0 : m.find((y) => y.columnIndex === u)) != null && p.expression)
11070
+ if (t != null && t[u] || (p = (m = s == null ? void 0 : s.onClickFilter) == null ? void 0 : m.find((N) => N.columnIndex === u)) != null && p.expression)
11068
11071
  return /* @__PURE__ */ e(
11069
11072
  Ae,
11070
11073
  {
11071
- value: (f = (h = s == null ? void 0 : s.onClickFilter) == null ? void 0 : h.find((y) => y.columnIndex === u)) == null ? void 0 : f.expression,
11072
- onChange: (y) => i(u, y),
11074
+ value: (f = (h = s == null ? void 0 : s.onClickFilter) == null ? void 0 : h.find((N) => N.columnIndex === u)) == null ? void 0 : f.expression,
11075
+ onChange: (N) => i(u, N),
11073
11076
  type: "text",
11074
11077
  className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
11075
11078
  placeholder: "Expression"
@@ -11107,8 +11110,8 @@ function oa() {
11107
11110
  {
11108
11111
  onClick: () => {
11109
11112
  n((f) => {
11110
- const y = [...f];
11111
- return y[m] = !f[m], y;
11113
+ const N = [...f];
11114
+ return N[m] = !f[m], N;
11112
11115
  });
11113
11116
  },
11114
11117
  className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
@@ -11831,7 +11834,7 @@ function bm({
11831
11834
  ] });
11832
11835
  }
11833
11836
  function Cm() {
11834
- var m, p, h, f, y;
11837
+ var m, p, h, f, N;
11835
11838
  const t = O((g) => g.card.preferences), n = O(
11836
11839
  (g) => g.actions.setCardPreferences
11837
11840
  ), s = O((g) => g.card), l = Pa(s.config), r = O(
@@ -11968,7 +11971,7 @@ function Cm() {
11968
11971
  /* @__PURE__ */ e(
11969
11972
  Ae,
11970
11973
  {
11971
- value: ((y = t == null ? void 0 : t.formatNumber) == null ? void 0 : y.suffix) || "",
11974
+ value: ((N = t == null ? void 0 : t.formatNumber) == null ? void 0 : N.suffix) || "",
11972
11975
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
11973
11976
  placeholder: "K, M, B, %",
11974
11977
  onChange: (g) => {
@@ -12149,7 +12152,7 @@ const Sm = [
12149
12152
  value: t
12150
12153
  }));
12151
12154
  function Tm() {
12152
- var o, u, m, p, h, f, y, g, x, C, w, F, A, k, D, v, b, N;
12155
+ var o, u, m, p, h, f, N, g, x, C, w, F, A, k, D, v, b, y;
12153
12156
  const t = O((R) => R.card), n = (u = (o = t == null ? void 0 : t.preferences) == null ? void 0 : o.mapVisualOptions) == null ? void 0 : u.topoJsonUrl, [s, l] = _(
12154
12157
  ((p = (m = t == null ? void 0 : t.preferences) == null ? void 0 : m.mapVisualOptions) == null ? void 0 : p.customTopoJsonUrl) || ""
12155
12158
  ), { setCardPreferences: r } = oe(), { data: c } = wn(t), d = Object.keys((c == null ? void 0 : c.objects) || {}).map((R) => ({
@@ -12242,7 +12245,7 @@ function Tm() {
12242
12245
  {
12243
12246
  className: "h-9",
12244
12247
  options: Sm,
12245
- value: ((g = (y = t.preferences) == null ? void 0 : y.mapVisualOptions) == null ? void 0 : g.projection) || "",
12248
+ value: ((g = (N = t.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : g.projection) || "",
12246
12249
  label: "Projection",
12247
12250
  onValueChange: (R) => {
12248
12251
  var S;
@@ -12332,7 +12335,7 @@ function Tm() {
12332
12335
  className: `h-9 w-full ${Vt}`,
12333
12336
  type: "number",
12334
12337
  step: 10,
12335
- value: ((N = (b = (v = t.preferences) == null ? void 0 : v.mapVisualOptions) == null ? void 0 : b.projectionOffset) == null ? void 0 : N[1]) || 0,
12338
+ value: ((y = (b = (v = t.preferences) == null ? void 0 : v.mapVisualOptions) == null ? void 0 : b.projectionOffset) == null ? void 0 : y[1]) || 0,
12336
12339
  onChange: (R) => {
12337
12340
  var S, P, E, T;
12338
12341
  r({
@@ -12561,7 +12564,7 @@ function ai({ color: t, onColorChange: n, onClose: s }) {
12561
12564
  }, f = (x, C, w) => {
12562
12565
  const F = Om(x, C, w), A = Im(F.r, F.g, F.b);
12563
12566
  m(A);
12564
- }, y = (x) => {
12567
+ }, N = (x) => {
12565
12568
  if (m(x), /^#[0-9A-Fa-f]{6}$/.test(x)) {
12566
12569
  const C = yl(x);
12567
12570
  if (C) {
@@ -12637,7 +12640,7 @@ function ai({ color: t, onColorChange: n, onClose: s }) {
12637
12640
  Ae,
12638
12641
  {
12639
12642
  value: u,
12640
- onChange: (x) => y(x.target.value),
12643
+ onChange: (x) => N(x.target.value),
12641
12644
  placeholder: "#000000",
12642
12645
  className: "font-mono"
12643
12646
  }
@@ -12755,7 +12758,7 @@ const Rm = [
12755
12758
  // yellow-400
12756
12759
  ];
12757
12760
  function si() {
12758
- var F, A, k, D, v, b, N, R, S, P;
12761
+ var F, A, k, D, v, b, y, R, S, P;
12759
12762
  const t = O((E) => E.card), n = O((E) => {
12760
12763
  var T;
12761
12764
  return (T = E.card) == null ? void 0 : T.preferences;
@@ -12835,7 +12838,7 @@ function si() {
12835
12838
  preferences: L
12836
12839
  };
12837
12840
  l(M);
12838
- }, y = (E, T) => {
12841
+ }, N = (E, T) => {
12839
12842
  var X;
12840
12843
  const I = h[T % h.length], { [E]: L, ...M } = ((X = n == null ? void 0 : n.colorConfig) == null ? void 0 : X.segments) || {}, V = {
12841
12844
  ...n || {},
@@ -12853,7 +12856,7 @@ function si() {
12853
12856
  [E]: I
12854
12857
  }));
12855
12858
  };
12856
- if (!p.length || !((t == null ? void 0 : t.type) === "stackedBar" || (t == null ? void 0 : t.type) === "stackedLine" ? ((v = (D = t == null ? void 0 : t.config) == null ? void 0 : D.groupByColumns) == null ? void 0 : v.length) || ((N = (b = t == null ? void 0 : t.config) == null ? void 0 : b.pivotByColumns) == null ? void 0 : N.length) : (S = (R = t == null ? void 0 : t.config) == null ? void 0 : R.groupByColumns) == null ? void 0 : S.length) || ["table", "kpi", "text", "custom"].includes(t.type))
12859
+ if (!p.length || !((t == null ? void 0 : t.type) === "stackedBar" || (t == null ? void 0 : t.type) === "stackedLine" ? ((v = (D = t == null ? void 0 : t.config) == null ? void 0 : D.groupByColumns) == null ? void 0 : v.length) || ((y = (b = t == null ? void 0 : t.config) == null ? void 0 : b.pivotByColumns) == null ? void 0 : y.length) : (S = (R = t == null ? void 0 : t.config) == null ? void 0 : R.groupByColumns) == null ? void 0 : S.length) || ["table", "kpi", "text", "custom"].includes(t.type))
12857
12860
  return null;
12858
12861
  const C = () => {
12859
12862
  const E = {
@@ -12965,7 +12968,7 @@ function si() {
12965
12968
  {
12966
12969
  className: "flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",
12967
12970
  onClick: () => {
12968
- y(E, T), o(null);
12971
+ N(E, T), o(null);
12969
12972
  },
12970
12973
  children: [
12971
12974
  /* @__PURE__ */ e(hl, { className: "h-3 w-3" }),
@@ -13311,27 +13314,27 @@ function $n({
13311
13314
  ] });
13312
13315
  }
13313
13316
  function bl({ axis: t, label: n, type: s, config: l, onChange: r }) {
13314
- var p, h, f, y, g, x, C, w, F, A, k, D;
13317
+ var p, h, f, N, g, x, C, w, F, A, k, D;
13315
13318
  const c = (v, b) => {
13316
13319
  r({
13317
13320
  ...l,
13318
13321
  [v]: b
13319
13322
  });
13320
13323
  }, d = (v, b) => {
13321
- var N, R;
13324
+ var y, R;
13322
13325
  r({
13323
13326
  ...l,
13324
13327
  name: {
13325
- enabled: v === "enabled" ? b : ((N = l == null ? void 0 : l.name) == null ? void 0 : N.enabled) ?? !1,
13328
+ enabled: v === "enabled" ? b : ((y = l == null ? void 0 : l.name) == null ? void 0 : y.enabled) ?? !1,
13326
13329
  text: v === "text" ? b : (R = l == null ? void 0 : l.name) == null ? void 0 : R.text
13327
13330
  }
13328
13331
  });
13329
13332
  }, i = (v, b) => {
13330
- var N, R;
13333
+ var y, R;
13331
13334
  r({
13332
13335
  ...l,
13333
13336
  labels: {
13334
- enabled: v === "enabled" ? b : ((N = l == null ? void 0 : l.labels) == null ? void 0 : N.enabled) ?? !0,
13337
+ enabled: v === "enabled" ? b : ((y = l == null ? void 0 : l.labels) == null ? void 0 : y.enabled) ?? !0,
13335
13338
  rotation: v === "rotation" ? b : (R = l == null ? void 0 : l.labels) == null ? void 0 : R.rotation
13336
13339
  }
13337
13340
  });
@@ -13398,7 +13401,7 @@ function bl({ axis: t, label: n, type: s, config: l, onChange: r }) {
13398
13401
  /* @__PURE__ */ e(
13399
13402
  ut,
13400
13403
  {
13401
- checked: ((y = l == null ? void 0 : l.labels) == null ? void 0 : y.enabled) !== !1,
13404
+ checked: ((N = l == null ? void 0 : l.labels) == null ? void 0 : N.enabled) !== !1,
13402
13405
  onCheckedChange: (v) => i("enabled", v)
13403
13406
  }
13404
13407
  )
@@ -13597,7 +13600,7 @@ function li() {
13597
13600
  ] });
13598
13601
  }
13599
13602
  function ri() {
13600
- var b, N, R, S, P, E, T, I, L;
13603
+ var b, y, R, S, P, E, T, I, L;
13601
13604
  const t = O((M) => M.card), n = O(
13602
13605
  (M) => {
13603
13606
  var V, j;
@@ -13609,7 +13612,7 @@ function ri() {
13609
13612
  }), { setCardPreferences: l, updateCardInFrame: r } = oe();
13610
13613
  if (!t || !_o(t.type))
13611
13614
  return null;
13612
- const c = ((b = s == null ? void 0 : s.chartOptions) == null ? void 0 : b.indexAxis) === "y", d = t.type === "stackedBar" || t.type === "stackedLine", i = t.type === "pie" || t.type === "doughnut" || t.type === "polarArea" || t.type === "funnel", o = !i, u = (R = (N = s == null ? void 0 : s.chartOptions) == null ? void 0 : N.plugins) == null ? void 0 : R.datalabels, m = (u == null ? void 0 : u.display) !== !1 && ((u == null ? void 0 : u.anchor) || (u == null ? void 0 : u.align)), p = (n == null ? void 0 : n.enabled) !== void 0 ? n.enabled : m, h = (M, V) => {
13615
+ const c = ((b = s == null ? void 0 : s.chartOptions) == null ? void 0 : b.indexAxis) === "y", d = t.type === "stackedBar" || t.type === "stackedLine", i = t.type === "pie" || t.type === "doughnut" || t.type === "polarArea" || t.type === "funnel", o = !i, u = (R = (y = s == null ? void 0 : s.chartOptions) == null ? void 0 : y.plugins) == null ? void 0 : R.datalabels, m = (u == null ? void 0 : u.display) !== !1 && ((u == null ? void 0 : u.anchor) || (u == null ? void 0 : u.align)), p = (n == null ? void 0 : n.enabled) !== void 0 ? n.enabled : m, h = (M, V) => {
13613
13616
  const j = {
13614
13617
  ...n,
13615
13618
  [M]: V
@@ -13640,7 +13643,7 @@ function ri() {
13640
13643
  preferences: X
13641
13644
  };
13642
13645
  r(Z);
13643
- }, y = (M, V) => {
13646
+ }, N = (M, V) => {
13644
13647
  const j = {
13645
13648
  ...n,
13646
13649
  formatOptions: {
@@ -13780,7 +13783,7 @@ function ri() {
13780
13783
  type: "number",
13781
13784
  placeholder: "0",
13782
13785
  value: String(((S = n == null ? void 0 : n.formatOptions) == null ? void 0 : S.decimalPlaces) ?? (n.format === "currency" ? 2 : n.format === "percent" ? 1 : 0)),
13783
- onSave: (M) => y("decimalPlaces", Number(M)),
13786
+ onSave: (M) => N("decimalPlaces", Number(M)),
13784
13787
  className: ""
13785
13788
  }
13786
13789
  ) })
@@ -13791,7 +13794,7 @@ function ri() {
13791
13794
  me,
13792
13795
  {
13793
13796
  value: ((P = n == null ? void 0 : n.formatOptions) == null ? void 0 : P.currency) || "USD",
13794
- onValueChange: (M) => y("currency", M),
13797
+ onValueChange: (M) => N("currency", M),
13795
13798
  children: [
13796
13799
  /* @__PURE__ */ e(he, { className: "h-8 text-xs flex-1", children: /* @__PURE__ */ e(pe, {}) }),
13797
13800
  /* @__PURE__ */ e(fe, { children: D.map((M) => /* @__PURE__ */ e(H, { value: M.value, className: "text-xs", children: M.label }, M.value)) })
@@ -13805,7 +13808,7 @@ function ri() {
13805
13808
  ut,
13806
13809
  {
13807
13810
  checked: ((E = n == null ? void 0 : n.formatOptions) == null ? void 0 : E.useSuffix) ?? !1,
13808
- onCheckedChange: (M) => y("useSuffix", M)
13811
+ onCheckedChange: (M) => N("useSuffix", M)
13809
13812
  }
13810
13813
  )
13811
13814
  ] }),
@@ -13815,7 +13818,7 @@ function ri() {
13815
13818
  me,
13816
13819
  {
13817
13820
  value: ((T = n == null ? void 0 : n.formatOptions) == null ? void 0 : T.locale) || "en-US",
13818
- onValueChange: (M) => y("locale", M),
13821
+ onValueChange: (M) => N("locale", M),
13819
13822
  children: [
13820
13823
  /* @__PURE__ */ e(he, { className: "h-8 text-xs flex-1", children: /* @__PURE__ */ e(pe, {}) }),
13821
13824
  /* @__PURE__ */ e(fe, { children: v.map((M) => /* @__PURE__ */ e(H, { value: M.value, className: "text-xs", children: M.label }, M.value)) })
@@ -14091,7 +14094,7 @@ function Bm(t) {
14091
14094
  setCardSql: p,
14092
14095
  setRunSql: h,
14093
14096
  switchCardType: f,
14094
- setQueryConfig: y
14097
+ setQueryConfig: N
14095
14098
  } = oe(), g = O((Y) => Y.currentAssitantScope) || [], x = O((Y) => Y.userInputForAI), C = O((Y) => Y.triggerAIRun), w = O((Y) => Y.card), F = O(
14096
14099
  (Y) => Y.selectedDatabaseName
14097
14100
  ), A = O((Y) => Y.selectedTableName), k = O(
@@ -14102,7 +14105,7 @@ function Bm(t) {
14102
14105
  (Y) => Y.dashboard.aiScopeTables
14103
14106
  ), {
14104
14107
  errorMessage: b,
14105
- refetch: N,
14108
+ refetch: y,
14106
14109
  data: R
14107
14110
  } = $e(w), { setTriggerAIRun: S, setCurrentAssitantScope: P, setCardConfig: E } = oe(), { selectedDatamodelName: T, connectionType: I, selectedDatamodelId: L } = za(), M = (Pe = jo().data) == null ? void 0 : Pe.assistantProfileId, {
14108
14111
  messages: V,
@@ -14198,7 +14201,7 @@ function Bm(t) {
14198
14201
  s("Generating query config...");
14199
14202
  const ue = ((de = Y.input) == null ? void 0 : de.chartType) ?? ((Te = Y.args) == null ? void 0 : Te.chartType), ze = ((Fe = Y.input) == null ? void 0 : Fe.queryConfig) ?? ((be = Y.args) == null ? void 0 : be.queryConfig);
14200
14203
  ((Le = Y.input) == null ? void 0 : Le.cardConfig) ?? ((Qe = Y.args) == null || Qe.cardConfig), f(ue), E(ze), p(void 0), m(void 0);
14201
- const je = await N();
14204
+ const je = await y();
14202
14205
  if ((ca = je == null ? void 0 : je.data) != null && ca.error) {
14203
14206
  se({
14204
14207
  tool: Y.toolName,
@@ -14330,7 +14333,7 @@ function Cl({
14330
14333
  onFullscreenChange: n,
14331
14334
  fullscreenContainer: s
14332
14335
  }) {
14333
- const l = yt(null), [r, c] = _(!1), [d, i] = _(ur), [o, u] = _(!1), [m, p] = _(!1), [h, f] = _(!1), y = t ?? h, g = Jo(), { setCurrentAIContext: x } = mr(), { clearQueue: C } = Wo(), { clearFileAttachments: w } = Qo(), F = Ho("editor"), A = Q((ue) => ue.dashboard.aiContext), k = O((ue) => ue.card.dataSource), D = O((ue) => ue.actions.setCardSql), v = O((ue) => ue.actions.setRunSql), b = O((ue) => ue.showAIDialog), N = Q(
14336
+ const l = yt(null), [r, c] = _(!1), [d, i] = _(ur), [o, u] = _(!1), [m, p] = _(!1), [h, f] = _(!1), N = t ?? h, g = Jo(), { setCurrentAIContext: x } = mr(), { clearQueue: C } = Wo(), { clearFileAttachments: w } = Qo(), F = Ho("editor"), A = Q((ue) => ue.dashboard.aiContext), k = O((ue) => ue.card.dataSource), D = O((ue) => ue.actions.setCardSql), v = O((ue) => ue.actions.setRunSql), b = O((ue) => ue.showAIDialog), y = Q(
14334
14337
  (ue) => ue.handleOpenAssistantProfile
14335
14338
  ), { setShowAIDialog: R, setCardPython: S } = oe(), { setDataSource: P } = oe(), { assistantProfile: E } = Xo(), {
14336
14339
  messages: T,
@@ -14404,14 +14407,14 @@ function Cl({
14404
14407
  [t, n]
14405
14408
  );
14406
14409
  ye(() => {
14407
- if (!y) return;
14410
+ if (!N) return;
14408
14411
  function ue(ze) {
14409
14412
  ze.key === "Escape" && J(!1);
14410
14413
  }
14411
14414
  return window.addEventListener("keydown", ue), () => {
14412
14415
  window.removeEventListener("keydown", ue);
14413
14416
  };
14414
- }, [y, J]);
14417
+ }, [N, J]);
14415
14418
  const U = Ce(
14416
14419
  (ue) => {
14417
14420
  L({
@@ -14430,8 +14433,8 @@ function Cl({
14430
14433
  console.error("Failed to copy conversation", ze), re.error("Unable to copy conversation");
14431
14434
  }
14432
14435
  }, [T]), Te = Ce(() => {
14433
- J(!y);
14434
- }, [y, J]);
14436
+ J(!N);
14437
+ }, [N, J]);
14435
14438
  function Fe(ue, ze) {
14436
14439
  ze === "sql" ? (D(ue), v(!0)) : ze === "python" && (S(ue), v(!0));
14437
14440
  }
@@ -14506,7 +14509,7 @@ function Cl({
14506
14509
  "data-role": "editor-assistant",
14507
14510
  className: B(
14508
14511
  "flex h-full w-full flex-col justify-between px-6 py-4",
14509
- y && "rounded-2xl border border-border/60 bg-background px-8 pb-6 pt-6 shadow-xl"
14512
+ N && "rounded-2xl border border-border/60 bg-background px-8 pb-6 pt-6 shadow-xl"
14510
14513
  ),
14511
14514
  children: [
14512
14515
  /* @__PURE__ */ a(
@@ -14516,13 +14519,13 @@ function Cl({
14516
14519
  className: "flex items-start justify-between gap-2",
14517
14520
  children: [
14518
14521
  da(),
14519
- N && /* @__PURE__ */ e(
14522
+ y && /* @__PURE__ */ e(
14520
14523
  z,
14521
14524
  {
14522
14525
  variant: "outline",
14523
14526
  size: "sm",
14524
14527
  className: "h-7 p-2",
14525
- onClick: N,
14528
+ onClick: y,
14526
14529
  children: (E == null ? void 0 : E.name) || "Default Profile"
14527
14530
  }
14528
14531
  ),
@@ -14541,10 +14544,10 @@ function Cl({
14541
14544
  /* @__PURE__ */ e(
14542
14545
  ge,
14543
14546
  {
14544
- tooltip: y ? "Exit Fullscreen" : "Expand",
14547
+ tooltip: N ? "Exit Fullscreen" : "Expand",
14545
14548
  className: "h-7 p-2 text-muted-foreground hover:text-foreground",
14546
14549
  onClick: Te,
14547
- children: y ? /* @__PURE__ */ e(sc, { className: "size-4" }) : /* @__PURE__ */ e(nc, { className: "size-4" })
14550
+ children: N ? /* @__PURE__ */ e(sc, { className: "size-4" }) : /* @__PURE__ */ e(nc, { className: "size-4" })
14548
14551
  }
14549
14552
  ),
14550
14553
  /* @__PURE__ */ e(
@@ -14690,7 +14693,7 @@ function Cl({
14690
14693
  ]
14691
14694
  }
14692
14695
  );
14693
- return y && s ? Yc(
14696
+ return N && s ? Yc(
14694
14697
  /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute inset-0 z-50 flex bg-background px-6 pb-6 pt-[calc(var(--app-header-height,15px)+1rem)]", children: /* @__PURE__ */ e("div", { className: "flex h-full w-full", children: Kt }) }),
14695
14698
  s
14696
14699
  ) : Kt;
@@ -14760,7 +14763,7 @@ function Jm({
14760
14763
  Ln(d);
14761
14764
  const { setCardType: i, setCardPreferences: o, setIsDevMode: u } = O(
14762
14765
  (k) => k.actions
14763
- ), { setCardCustomCfg: m, setCustomCardPreferences: p, setQueryConfig: h } = oe(), [f, y] = Gn("chart-section-active", null), g = et(() => f ? [
14766
+ ), { setCardCustomCfg: m, setCustomCardPreferences: p, setQueryConfig: h } = oe(), [f, N] = Gn("chart-section-active", null), g = et(() => f ? [
14764
14767
  f,
14765
14768
  ...Sl.filter((k) => k !== f)
14766
14769
  ] : Sl, [f]);
@@ -14799,9 +14802,9 @@ function Jm({
14799
14802
  (() => {
14800
14803
  var D, v;
14801
14804
  if (t === "custom") {
14802
- const b = O.getState().card, N = (D = b == null ? void 0 : b.customCardPreferences) == null ? void 0 : D.icon, R = (v = b == null ? void 0 : b.customCardPreferences) == null ? void 0 : v.componentName;
14803
- if (N && R)
14804
- return /* @__PURE__ */ e(Wm, { icon: N, componentName: R });
14805
+ const b = O.getState().card, y = (D = b == null ? void 0 : b.customCardPreferences) == null ? void 0 : D.icon, R = (v = b == null ? void 0 : b.customCardPreferences) == null ? void 0 : v.componentName;
14806
+ if (y && R)
14807
+ return /* @__PURE__ */ e(Wm, { icon: y, componentName: R });
14805
14808
  if (R) {
14806
14809
  const S = An(R);
14807
14810
  if (S)
@@ -14842,7 +14845,7 @@ function Jm({
14842
14845
  Ka,
14843
14846
  {
14844
14847
  checked: f === "default",
14845
- onCheckedChange: (D) => y(D ? "default" : null),
14848
+ onCheckedChange: (D) => N(D ? "default" : null),
14846
14849
  className: "scale-75"
14847
14850
  }
14848
14851
  )
@@ -14883,7 +14886,7 @@ function Jm({
14883
14886
  Ka,
14884
14887
  {
14885
14888
  checked: f === "standardPlugin",
14886
- onCheckedChange: (v) => y(
14889
+ onCheckedChange: (v) => N(
14887
14890
  v ? "standardPlugin" : null
14888
14891
  ),
14889
14892
  className: "scale-75"
@@ -14926,7 +14929,7 @@ function Jm({
14926
14929
  Ka,
14927
14930
  {
14928
14931
  checked: f === "customPlugin",
14929
- onCheckedChange: (v) => y(v ? "customPlugin" : null),
14932
+ onCheckedChange: (v) => N(v ? "customPlugin" : null),
14930
14933
  className: "scale-75"
14931
14934
  }
14932
14935
  )
@@ -15089,11 +15092,11 @@ function Zm({
15089
15092
  {
15090
15093
  placeholder: "Value key",
15091
15094
  value: r,
15092
- onChange: (y) => c(y.target.value),
15095
+ onChange: (N) => c(N.target.value),
15093
15096
  className: "h-8 w-24 text-xs",
15094
- onPointerDown: (y) => y.stopPropagation(),
15095
- onKeyDown: (y) => {
15096
- y.key === "Enter" ? m(p) : y.key === "Escape" && l(null);
15097
+ onPointerDown: (N) => N.stopPropagation(),
15098
+ onKeyDown: (N) => {
15099
+ N.key === "Enter" ? m(p) : N.key === "Escape" && l(null);
15097
15100
  },
15098
15101
  "aria-label": "Edit value alias key"
15099
15102
  }
@@ -15103,11 +15106,11 @@ function Zm({
15103
15106
  {
15104
15107
  placeholder: "Alias label",
15105
15108
  value: d,
15106
- onChange: (y) => i(y.target.value),
15109
+ onChange: (N) => i(N.target.value),
15107
15110
  className: "h-8 w-24 text-xs",
15108
- onPointerDown: (y) => y.stopPropagation(),
15109
- onKeyDown: (y) => {
15110
- y.key === "Enter" ? m(p) : y.key === "Escape" && l(null);
15111
+ onPointerDown: (N) => N.stopPropagation(),
15112
+ onKeyDown: (N) => {
15113
+ N.key === "Enter" ? m(p) : N.key === "Escape" && l(null);
15111
15114
  },
15112
15115
  "aria-label": "Edit value alias label"
15113
15116
  }
@@ -15271,8 +15274,8 @@ function th({
15271
15274
  return console.error("Error fetching attribute values:", p.error), [];
15272
15275
  const h = t.name;
15273
15276
  return ((p == null ? void 0 : p.records) || []).map(
15274
- (y) => {
15275
- const g = y[h] || y[t.alias || h] || y[t.label];
15277
+ (N) => {
15278
+ const g = N[h] || N[t.alias || h] || N[t.label];
15276
15279
  return {
15277
15280
  id: g || "",
15278
15281
  value: g || "",
@@ -15317,7 +15320,7 @@ function ah({
15317
15320
  return d ? !1 : !((v = l == null ? void 0 : l.conditions) == null ? void 0 : v.some(
15318
15321
  (b) => b.field.id === k.id
15319
15322
  )) && k.label.toLowerCase().includes(u.toLowerCase());
15320
- }), y = (k) => {
15323
+ }), N = (k) => {
15321
15324
  h({
15322
15325
  ...p,
15323
15326
  field: k
@@ -15421,7 +15424,7 @@ function ah({
15421
15424
  {
15422
15425
  variant: "outline",
15423
15426
  className: "justify-start h-auto py-2 px-3",
15424
- onClick: () => y(k),
15427
+ onClick: () => N(k),
15425
15428
  children: [
15426
15429
  /* @__PURE__ */ e(Bn, { dataType: st(k.dataType) }),
15427
15430
  /* @__PURE__ */ a("div", { className: "ml-2 text-left", children: [
@@ -15486,7 +15489,7 @@ function sh({
15486
15489
  (h) => String(h.value).toLowerCase().includes(r.toLowerCase())
15487
15490
  ) : d, m = (h) => {
15488
15491
  const f = n.includes(h);
15489
- s(f ? n.filter((y) => y !== h) : [...n, h]);
15492
+ s(f ? n.filter((N) => N !== h) : [...n, h]);
15490
15493
  }, p = () => {
15491
15494
  n.length === u.length && u.length > 0 ? s([]) : s(u.map((h) => h.value));
15492
15495
  };
@@ -15564,7 +15567,7 @@ function nh({
15564
15567
  transition: p,
15565
15568
  isDragging: h
15566
15569
  } = ps({ id: t.id }), f = O((W) => W.card), {
15567
- updateLabel: y,
15570
+ updateLabel: N,
15568
15571
  handleAggregationChange: g,
15569
15572
  handleDateFormatChange: x,
15570
15573
  handleGranularityChange: C,
@@ -15575,7 +15578,7 @@ function nh({
15575
15578
  handleKpiShowTrendlineChange: D,
15576
15579
  handleKpiTrendlineWindowChange: v,
15577
15580
  handleKpiTrendlineGranularityChange: b,
15578
- handleKpiTargetValueChange: N
15581
+ handleKpiTargetValueChange: y
15579
15582
  } = _n(f), [R, S] = _(!1), [P, E] = _(!1), [T, I] = _(null), [L, M] = _(
15580
15583
  t.dateFormat || "YYYY-MM-DD"
15581
15584
  ), [V, j] = _(t.customFormat || ""), [X, Z] = _(!!t.customFormat), [G, le] = _(
@@ -15598,7 +15601,7 @@ function nh({
15598
15601
  }, Pe = (W) => {
15599
15602
  Ie(W), n === "metrics" && F(s, W);
15600
15603
  }, Y = (W) => {
15601
- y(n, s, W);
15604
+ N(n, s, W);
15602
15605
  }, ie = (W) => {
15603
15606
  var Ge;
15604
15607
  if (K(W), n === "metrics") {
@@ -15832,7 +15835,7 @@ function nh({
15832
15835
  {
15833
15836
  value: ((W = f.config) == null ? void 0 : W.targetValue) !== void 0 && ((Ge = f.config) == null ? void 0 : Ge.targetValue) !== null ? String(f.config.targetValue) : "",
15834
15837
  onSave: (Be) => {
15835
- !isNaN(Number(Be)) && Be !== null ? N(Number(Be)) : N(0);
15838
+ !isNaN(Number(Be)) && Be !== null ? y(Number(Be)) : y(0);
15836
15839
  },
15837
15840
  placeholder: "Enter target value...",
15838
15841
  type: "text"
@@ -16203,7 +16206,7 @@ function qa({
16203
16206
  d,
16204
16207
  t,
16205
16208
  p
16206
- ).isValid, [d, i, t, p]), y = (x, C) => {
16209
+ ).isValid, [d, i, t, p]), N = (x, C) => {
16207
16210
  var F;
16208
16211
  !((F = m.config) != null && F.sortByColumns) || m.config.sortByColumns.findIndex(
16209
16212
  (A) => A.id === x
@@ -16262,7 +16265,7 @@ function qa({
16262
16265
  zone: t,
16263
16266
  index: C,
16264
16267
  sortDirection: F,
16265
- onSortDirectionChange: (A) => y(x.id, A),
16268
+ onSortDirectionChange: (A) => N(x.id, A),
16266
16269
  hasPivotColumns: c,
16267
16270
  cardType: p
16268
16271
  }
@@ -16400,16 +16403,16 @@ Difference: Primary - Secondary`,
16400
16403
  }
16401
16404
  };
16402
16405
  function ih() {
16403
- var h, f, y, g, x, C, w, F, A, k, D;
16406
+ var h, f, N, g, x, C, w, F, A, k, D;
16404
16407
  const t = O((v) => v.card), { setCardPreferences: n } = oe(), s = ((h = t.config) == null ? void 0 : h.metricColumns) || [], l = ((f = t.config) == null ? void 0 : f.groupByColumns) || [], r = s.length === 2 && l.length === 0, c = s.length >= 1 && l.length > 0;
16405
16408
  if (!(t.type === "kpi" && (r || c)))
16406
16409
  return null;
16407
- const i = ((g = (y = t.preferences) == null ? void 0 : y.kpiVisualOptions) == null ? void 0 : g.metricComparison) || {}, o = (v) => {
16408
- var N;
16410
+ const i = ((g = (N = t.preferences) == null ? void 0 : N.kpiVisualOptions) == null ? void 0 : g.metricComparison) || {}, o = (v) => {
16411
+ var y;
16409
16412
  const b = {
16410
16413
  ...t.preferences,
16411
16414
  kpiVisualOptions: {
16412
- ...(N = t.preferences) == null ? void 0 : N.kpiVisualOptions,
16415
+ ...(y = t.preferences) == null ? void 0 : y.kpiVisualOptions,
16413
16416
  metricComparison: {
16414
16417
  ...i,
16415
16418
  ...v
@@ -16784,7 +16787,7 @@ function ch({
16784
16787
  "polar",
16785
16788
  "funnel",
16786
16789
  "aggregateTable"
16787
- ].includes(i), f = m && !h, y = () => i === "kpi" ? {
16790
+ ].includes(i), f = m && !h, N = () => i === "kpi" ? {
16788
16791
  label: "Trend By",
16789
16792
  placeholder: "Drop fields to trend data"
16790
16793
  } : {
@@ -16816,8 +16819,8 @@ function ch({
16816
16819
  {
16817
16820
  zone: "groupBy",
16818
16821
  fields: t,
16819
- label: y().label,
16820
- placeholder: y().placeholder,
16822
+ label: N().label,
16823
+ placeholder: N().placeholder,
16821
16824
  activeField: r
16822
16825
  }
16823
16826
  ),
@@ -16880,8 +16883,8 @@ function dh({ onEditJoins: t }) {
16880
16883
  if (r.length === 0)
16881
16884
  return null;
16882
16885
  const c = (i) => !i || i.length === 0 ? "No conditions" : i.map((o) => {
16883
- var h, f, y, g;
16884
- const u = `${(h = o.source) == null ? void 0 : h.entityName}.${(f = o.source) == null ? void 0 : f.name}`, m = `${(y = o.target) == null ? void 0 : y.entityName}.${(g = o.target) == null ? void 0 : g.name}`, p = o.operator || "=";
16886
+ var h, f, N, g;
16887
+ const u = `${(h = o.source) == null ? void 0 : h.entityName}.${(f = o.source) == null ? void 0 : f.name}`, m = `${(N = o.target) == null ? void 0 : N.entityName}.${(g = o.target) == null ? void 0 : g.name}`, p = o.operator || "=";
16885
16888
  return `${u} ${p} ${m}`;
16886
16889
  }).join(" AND "), d = (i) => !i.joinKeyGroups || i.joinKeyGroups.length === 0 ? "No conditions defined" : i.joinKeyGroups.length === 1 ? c(i.joinKeyGroups[0].keys) : i.joinKeyGroups.map((o, u) => ({
16887
16890
  id: u,
@@ -16999,9 +17002,9 @@ function uh({
16999
17002
  activeField: d
17000
17003
  }) {
17001
17004
  var v, b;
17002
- const [i, o] = _(() => Tl.getItem("chart-selector-expanded") === "true"), [u, m] = _(!1), p = O((N) => N.card), h = O(
17003
- (N) => N.actions.updateCardConfig
17004
- ), f = s.length > 0 || l.length > 0 || r.length > 0, { data: y, autoJoinMetadata: g } = $e(p), x = ((v = p == null ? void 0 : p.config) == null ? void 0 : v.joinPlan) || (g != null && g.autoResolved ? g.resolvedJoinPlan : {
17005
+ const [i, o] = _(() => Tl.getItem("chart-selector-expanded") === "true"), [u, m] = _(!1), p = O((y) => y.card), h = O(
17006
+ (y) => y.actions.updateCardConfig
17007
+ ), f = s.length > 0 || l.length > 0 || r.length > 0, { data: N, autoJoinMetadata: g } = $e(p), x = ((v = p == null ? void 0 : p.config) == null ? void 0 : v.joinPlan) || (g != null && g.autoResolved ? g.resolvedJoinPlan : {
17005
17008
  baseEntity: {
17006
17009
  type: "table",
17007
17010
  name: "",
@@ -17012,10 +17015,10 @@ function uh({
17012
17015
  dialect: "none"
17013
17016
  },
17014
17017
  joins: []
17015
- }), C = ((b = p == null ? void 0 : p.dataSource) == null ? void 0 : b.selectedEntities) || [], w = (N) => {
17018
+ }), C = ((b = p == null ? void 0 : p.dataSource) == null ? void 0 : b.selectedEntities) || [], w = (y) => {
17016
17019
  h(p.id, {
17017
17020
  ...p == null ? void 0 : p.config,
17018
- joinPlan: N
17021
+ joinPlan: y
17019
17022
  }), m(!1);
17020
17023
  }, F = () => {
17021
17024
  h(p.id, {
@@ -17034,7 +17037,7 @@ function uh({
17034
17037
  );
17035
17038
  }, [i]);
17036
17039
  const D = () => {
17037
- o((N) => !N);
17040
+ o((y) => !y);
17038
17041
  };
17039
17042
  return /* @__PURE__ */ a(
17040
17043
  "div",
@@ -17101,7 +17104,7 @@ function uh({
17101
17104
  /* @__PURE__ */ e("div", { className: B("flex justify-end gap-2 px-6 py-6"), children: /* @__PURE__ */ e(
17102
17105
  "div",
17103
17106
  {
17104
- className: B("invisible flex gap-2", { visible: f || y }),
17107
+ className: B("invisible flex gap-2", { visible: f || N }),
17105
17108
  children: /* @__PURE__ */ e(zn, {})
17106
17109
  }
17107
17110
  ) }),
@@ -17164,7 +17167,7 @@ function mh({
17164
17167
  }, u = (k) => {
17165
17168
  const D = (v) => {
17166
17169
  if (v.id === k) {
17167
- const b = i[0] || o, N = st(b.dataType) === "date";
17170
+ const b = i[0] || o, y = st(b.dataType) === "date";
17168
17171
  return {
17169
17172
  ...v,
17170
17173
  conditions: [
@@ -17172,8 +17175,8 @@ function mh({
17172
17175
  {
17173
17176
  id: `condition-${Date.now()}`,
17174
17177
  field: b,
17175
- operator: N ? "between" : "=",
17176
- value: N ? [] : ""
17178
+ operator: y ? "between" : "=",
17179
+ value: y ? [] : ""
17177
17180
  }
17178
17181
  ]
17179
17182
  };
@@ -17187,7 +17190,7 @@ function mh({
17187
17190
  }, m = (k) => {
17188
17191
  const D = (v) => {
17189
17192
  if (v.id === k) {
17190
- const b = i[0] || o, N = st(b.dataType) === "date";
17193
+ const b = i[0] || o, y = st(b.dataType) === "date";
17191
17194
  return {
17192
17195
  ...v,
17193
17196
  groups: [
@@ -17200,8 +17203,8 @@ function mh({
17200
17203
  {
17201
17204
  id: `condition-${Date.now()}`,
17202
17205
  field: b,
17203
- operator: N ? "between" : "=",
17204
- value: N ? [] : ""
17206
+ operator: y ? "between" : "=",
17207
+ value: y ? [] : ""
17205
17208
  }
17206
17209
  ],
17207
17210
  groups: []
@@ -17218,7 +17221,7 @@ function mh({
17218
17221
  }, p = (k, D) => {
17219
17222
  const v = (b) => b.id === k ? {
17220
17223
  ...b,
17221
- conditions: b.conditions.filter((N) => N.id !== D)
17224
+ conditions: b.conditions.filter((y) => y.id !== D)
17222
17225
  } : {
17223
17226
  ...b,
17224
17227
  groups: b.groups.map(v)
@@ -17227,7 +17230,7 @@ function mh({
17227
17230
  }, h = (k, D) => {
17228
17231
  const v = (b) => b.id === k ? {
17229
17232
  ...b,
17230
- groups: b.groups.filter((N) => N.id !== D)
17233
+ groups: b.groups.filter((y) => y.id !== D)
17231
17234
  } : {
17232
17235
  ...b,
17233
17236
  groups: b.groups.map(v)
@@ -17238,7 +17241,7 @@ function mh({
17238
17241
  throw new Error(
17239
17242
  "Use a dedicated method to update the field property with a Field object"
17240
17243
  );
17241
- const N = (R) => R.id === k ? {
17244
+ const y = (R) => R.id === k ? {
17242
17245
  ...R,
17243
17246
  conditions: R.conditions.map((S) => S.id === D ? {
17244
17247
  ...S,
@@ -17246,16 +17249,16 @@ function mh({
17246
17249
  } : S)
17247
17250
  } : {
17248
17251
  ...R,
17249
- groups: R.groups.map(N)
17252
+ groups: R.groups.map(y)
17250
17253
  };
17251
- l(N(s));
17252
- }, y = (k, D, v) => {
17253
- const b = (N) => N.id === k ? {
17254
- ...N,
17255
- conditions: N.conditions.map((R) => R.id === D ? { ...R, ...v } : R)
17254
+ l(y(s));
17255
+ }, N = (k, D, v) => {
17256
+ const b = (y) => y.id === k ? {
17257
+ ...y,
17258
+ conditions: y.conditions.map((R) => R.id === D ? { ...R, ...v } : R)
17256
17259
  } : {
17257
- ...N,
17258
- groups: N.groups.map(b)
17260
+ ...y,
17261
+ groups: y.groups.map(b)
17259
17262
  };
17260
17263
  l(b(s));
17261
17264
  }, g = (k, D) => {
@@ -17277,29 +17280,29 @@ function mh({
17277
17280
  };
17278
17281
  l(v(s));
17279
17282
  }, C = (k, D, v) => {
17280
- const b = (N) => N.id === k ? {
17281
- ...N,
17282
- conditions: zs(N.conditions, D, v)
17283
+ const b = (y) => y.id === k ? {
17284
+ ...y,
17285
+ conditions: zs(y.conditions, D, v)
17283
17286
  } : {
17284
- ...N,
17285
- groups: N.groups.map(b)
17287
+ ...y,
17288
+ groups: y.groups.map(b)
17286
17289
  };
17287
17290
  l(b(s));
17288
17291
  }, w = (k, D, v) => {
17289
- const b = (N) => N.id === k ? {
17290
- ...N,
17291
- groups: zs(N.groups, D, v)
17292
+ const b = (y) => y.id === k ? {
17293
+ ...y,
17294
+ groups: zs(y.groups, D, v)
17292
17295
  } : {
17293
- ...N,
17294
- groups: N.groups.map(b)
17296
+ ...y,
17297
+ groups: y.groups.map(b)
17295
17298
  };
17296
17299
  l(b(s));
17297
17300
  }, F = (k) => {
17298
17301
  if (!k || k.conditions.length === 0 && k.groups.length === 0)
17299
17302
  return "-- No filters defined";
17300
17303
  const D = (b) => {
17301
- let N = "";
17302
- typeof b.field == "object" ? N = b.field.entityName ? `${b.field.entityName}.${b.field.name}` : b.field.name : N = String(b.field);
17304
+ let y = "";
17305
+ typeof b.field == "object" ? y = b.field.entityName ? `${b.field.entityName}.${b.field.name}` : b.field.name : y = String(b.field);
17303
17306
  const R = b.operator;
17304
17307
  let S = b.value;
17305
17308
  if (b.field.dataType === "string" && !["in", "not in"].includes(b.operator))
@@ -17307,10 +17310,10 @@ function mh({
17307
17310
  else if (b.field.dataType === "date" || b.field.dataType === "datetime" || b.field.dataType === "timestamp")
17308
17311
  if (b.operator === "between" && Array.isArray(S) && S.length === 2) {
17309
17312
  const P = S[0] ? `'${S[0]}'` : "NULL", E = S[1] ? `'${S[1]}'` : "NULL";
17310
- return `${N} BETWEEN ${P} AND ${E}`;
17313
+ return `${y} BETWEEN ${P} AND ${E}`;
17311
17314
  } else if ((b.operator === "in" || b.operator === "not in") && Array.isArray(S)) {
17312
17315
  const P = S.map((E) => E ? `'${E}'` : "NULL").join(", ");
17313
- return `${N} ${R} (${P})`;
17316
+ return `${y} ${R} (${P})`;
17314
17317
  } else typeof S == "string" || S instanceof Date ? S = `'${S}'` : Array.isArray(S) && S.length > 0 && (S = `'${S[0]}'`);
17315
17318
  else if (["in", "not in"].includes(b.operator)) {
17316
17319
  let P = [];
@@ -17323,22 +17326,22 @@ function mh({
17323
17326
  }
17324
17327
  switch (R) {
17325
17328
  case "contains":
17326
- return typeof S == "string" ? `${N} LIKE '%${S.replace(/'/g, "")}'` : `${N} LIKE '%${String(S)}'`;
17329
+ return typeof S == "string" ? `${y} LIKE '%${S.replace(/'/g, "")}'` : `${y} LIKE '%${String(S)}'`;
17327
17330
  case "startsWith":
17328
- return typeof S == "string" ? `${N} LIKE '${S.replace(/'/g, "")}%'` : `${N} LIKE '${String(S)}%'`;
17331
+ return typeof S == "string" ? `${y} LIKE '${S.replace(/'/g, "")}%'` : `${y} LIKE '${String(S)}%'`;
17329
17332
  case "endsWith":
17330
- return typeof S == "string" ? `${N} LIKE '%${S.replace(/'/g, "")}'` : `${N} LIKE '%${String(S)}'`;
17333
+ return typeof S == "string" ? `${y} LIKE '%${S.replace(/'/g, "")}'` : `${y} LIKE '%${String(S)}'`;
17331
17334
  case "isNull":
17332
- return `${N} IS NULL`;
17335
+ return `${y} IS NULL`;
17333
17336
  case "isNotNull":
17334
- return `${N} IS NOT NULL`;
17337
+ return `${y} IS NOT NULL`;
17335
17338
  default:
17336
- return `${N} ${R} ${S}`;
17339
+ return `${y} ${R} ${S}`;
17337
17340
  }
17338
17341
  }, v = (b) => {
17339
- const N = b.conditions.map(D), R = b.groups.map(
17342
+ const y = b.conditions.map(D), R = b.groups.map(
17340
17343
  (T) => v(T)
17341
- ), S = [...N, ...R].filter(Boolean);
17344
+ ), S = [...y, ...R].filter(Boolean);
17342
17345
  if (S.length === 0) return "";
17343
17346
  const P = S.join(` ${b.logicalOperator} `), E = S.length > 1 ? `(${P})` : P;
17344
17347
  return b.negate ? `NOT ${E}` : E;
@@ -17355,7 +17358,7 @@ function mh({
17355
17358
  removeCondition: p,
17356
17359
  removeGroup: h,
17357
17360
  updateCondition: f,
17358
- updateConditionFields: y,
17361
+ updateConditionFields: N,
17359
17362
  updateGroupOperator: g,
17360
17363
  updateGroupNegate: x,
17361
17364
  reorderConditions: C,
@@ -17804,7 +17807,7 @@ function ii({
17804
17807
  setNodeRef: p,
17805
17808
  transform: h,
17806
17809
  transition: f,
17807
- isDragging: y
17810
+ isDragging: N
17808
17811
  } = ps({ id: t.id }), { isPending: g, error: x } = Yn(
17809
17812
  t.field
17810
17813
  ), C = {
@@ -17816,7 +17819,7 @@ function ii({
17816
17819
  {
17817
17820
  ref: p,
17818
17821
  style: C,
17819
- className: `mb-2 flex items-center gap-2 rounded p-2 hover:bg-muted/50 ${y ? "z-50 opacity-50" : ""}`,
17822
+ className: `mb-2 flex items-center gap-2 rounded p-2 hover:bg-muted/50 ${N ? "z-50 opacity-50" : ""}`,
17820
17823
  children: [
17821
17824
  /* @__PURE__ */ e(
17822
17825
  "div",
@@ -17986,7 +17989,7 @@ function Th({
17986
17989
  onAddCondition: p,
17987
17990
  onAddGroup: h,
17988
17991
  availableFields: f,
17989
- renderFilterGroup: y,
17992
+ renderFilterGroup: N,
17990
17993
  updateConditionFields: g
17991
17994
  }) {
17992
17995
  const {
@@ -17999,8 +18002,8 @@ function Th({
17999
18002
  } = ps({ id: t.id }), D = {
18000
18003
  transform: fs.Transform.toString(F),
18001
18004
  transition: A
18002
- }, v = (N) => {
18003
- const { active: R, over: S } = N;
18005
+ }, v = (y) => {
18006
+ const { active: R, over: S } = y;
18004
18007
  if (S && R.id !== S.id) {
18005
18008
  const P = t.conditions.findIndex(
18006
18009
  (T) => T.id === R.id
@@ -18009,8 +18012,8 @@ function Th({
18009
18012
  );
18010
18013
  P !== -1 && E !== -1 && u(t.id, P, E);
18011
18014
  }
18012
- }, b = (N) => {
18013
- const { active: R, over: S } = N;
18015
+ }, b = (y) => {
18016
+ const { active: R, over: S } = y;
18014
18017
  if (S && R.id !== S.id && s) {
18015
18018
  const P = t.groups.findIndex((T) => T.id === R.id), E = t.groups.findIndex((T) => T.id === S.id);
18016
18019
  P !== -1 && E !== -1 && m(s, P, E);
@@ -18048,7 +18051,7 @@ function Th({
18048
18051
  me,
18049
18052
  {
18050
18053
  value: t.logicalOperator,
18051
- onValueChange: (N) => l(t.id, N),
18054
+ onValueChange: (y) => l(t.id, y),
18052
18055
  children: [
18053
18056
  /* @__PURE__ */ e(he, { className: "h-7 w-20", children: /* @__PURE__ */ e(pe, {}) }),
18054
18057
  /* @__PURE__ */ a(fe, { children: [
@@ -18086,12 +18089,12 @@ function Th({
18086
18089
  children: /* @__PURE__ */ e(
18087
18090
  pa,
18088
18091
  {
18089
- items: t.conditions.map((N) => N.id),
18092
+ items: t.conditions.map((y) => y.id),
18090
18093
  strategy: fa,
18091
- children: t.conditions.map((N, R) => /* @__PURE__ */ e(
18094
+ children: t.conditions.map((y, R) => /* @__PURE__ */ e(
18092
18095
  ii,
18093
18096
  {
18094
- condition: N,
18097
+ condition: y,
18095
18098
  index: R,
18096
18099
  groupId: t.id,
18097
18100
  groupLogicalOperator: t.logicalOperator,
@@ -18102,7 +18105,7 @@ function Th({
18102
18105
  availableFields: f,
18103
18106
  updateConditionFields: g
18104
18107
  },
18105
- N.id
18108
+ y.id
18106
18109
  ))
18107
18110
  }
18108
18111
  )
@@ -18122,10 +18125,10 @@ function Th({
18122
18125
  children: /* @__PURE__ */ e(
18123
18126
  pa,
18124
18127
  {
18125
- items: t.groups.map((N) => N.id),
18128
+ items: t.groups.map((y) => y.id),
18126
18129
  strategy: fa,
18127
18130
  children: t.groups.map(
18128
- (N) => y(N, n + 1, t.id)
18131
+ (y) => N(y, n + 1, t.id)
18129
18132
  )
18130
18133
  }
18131
18134
  )
@@ -18181,7 +18184,7 @@ function Mh({
18181
18184
  removeGroup: p,
18182
18185
  updateCondition: h,
18183
18186
  updateConditionFields: f,
18184
- updateGroupOperator: y,
18187
+ updateGroupOperator: N,
18185
18188
  updateGroupNegate: g,
18186
18189
  reorderConditions: x,
18187
18190
  reorderGroups: C,
@@ -18209,7 +18212,7 @@ function Mh({
18209
18212
  groups: I.groups.map(T)
18210
18213
  };
18211
18214
  A(T(c));
18212
- }, N = (S, P = 0, E) => P === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg", children: /* @__PURE__ */ a("div", { className: "p-3 px-0", children: [
18215
+ }, y = (S, P = 0, E) => P === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg", children: /* @__PURE__ */ a("div", { className: "p-3 px-0", children: [
18213
18216
  /* @__PURE__ */ e(
18214
18217
  ga,
18215
18218
  {
@@ -18241,7 +18244,7 @@ function Mh({
18241
18244
  onUpdateCondition: h,
18242
18245
  onUpdateField: b,
18243
18246
  onRemoveCondition: m,
18244
- onUpdateGroupOperator: y,
18247
+ onUpdateGroupOperator: N,
18245
18248
  availableFields: d,
18246
18249
  updateConditionFields: f
18247
18250
  },
@@ -18273,7 +18276,7 @@ function Mh({
18273
18276
  items: S.groups.map((T) => T.id),
18274
18277
  strategy: fa,
18275
18278
  children: S.groups.map(
18276
- (T) => N(T, P + 1, S.id)
18279
+ (T) => y(T, P + 1, S.id)
18277
18280
  )
18278
18281
  }
18279
18282
  )
@@ -18313,7 +18316,7 @@ function Mh({
18313
18316
  group: S,
18314
18317
  depth: P,
18315
18318
  parentGroupId: E,
18316
- onUpdateGroupOperator: y,
18319
+ onUpdateGroupOperator: N,
18317
18320
  onUpdateGroupNegate: g,
18318
18321
  onRemoveGroup: p,
18319
18322
  onUpdateCondition: h,
@@ -18324,7 +18327,7 @@ function Mh({
18324
18327
  onAddCondition: o,
18325
18328
  onAddGroup: u,
18326
18329
  availableFields: d,
18327
- renderFilterGroup: N,
18330
+ renderFilterGroup: y,
18328
18331
  updateConditionFields: f
18329
18332
  },
18330
18333
  S.id
@@ -18334,7 +18337,7 @@ function Mh({
18334
18337
  i ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center p-4", children: [
18335
18338
  /* @__PURE__ */ e("div", { className: "h-5 w-5 animate-spin rounded-full border-2 border-gray-300 border-t-gray-600" }),
18336
18339
  /* @__PURE__ */ e("span", { className: "ml-2 text-sm text-gray-600", children: "Loading columns..." })
18337
- ] }) : N(c),
18340
+ ] }) : y(c),
18338
18341
  /* @__PURE__ */ e("div", { className: "mt-4 border-t border-border pt-4", children: /* @__PURE__ */ a("div", { className: "flex items-center space-x-2", children: [
18339
18342
  /* @__PURE__ */ e(
18340
18343
  ut,
@@ -18434,9 +18437,9 @@ function Ah({
18434
18437
  [n, s]
18435
18438
  ), f = Ce((w) => {
18436
18439
  c(w.active.id);
18437
- }, []), y = Ce(
18440
+ }, []), N = Ce(
18438
18441
  (w) => {
18439
- var N;
18442
+ var y;
18440
18443
  const { active: F, over: A } = w;
18441
18444
  if (!A || !t) {
18442
18445
  c(null);
@@ -18521,7 +18524,7 @@ function Ah({
18521
18524
  if (Bl(R, {
18522
18525
  joinabilityMap: m.joinabilityMap,
18523
18526
  selectedFields: S,
18524
- baseEntityName: (N = o == null ? void 0 : o.baseEntity) == null ? void 0 : N.name
18527
+ baseEntityName: (y = o == null ? void 0 : o.baseEntity) == null ? void 0 : y.name
18525
18528
  // Pass authoritative base entity
18526
18529
  }).state === "unreachable") {
18527
18530
  Ja(), c(null);
@@ -18643,7 +18646,7 @@ function Ah({
18643
18646
  activeId: r,
18644
18647
  activeField: g,
18645
18648
  handleDragStart: f,
18646
- handleDragEnd: y
18649
+ handleDragEnd: N
18647
18650
  };
18648
18651
  }
18649
18652
  function Ih({ activeView: t, onViewChange: n }) {
@@ -18812,9 +18815,9 @@ function Ph({
18812
18815
  updateCardConfig: p,
18813
18816
  setCard: h,
18814
18817
  updateCardInFrame: f,
18815
- setCardId: y,
18818
+ setCardId: N,
18816
18819
  setShowAIDialog: g
18817
- } = oe(), { updateCardId: x } = pt(), [C, w] = _(null), F = O((ae) => ae.showAIDialog), A = Q((ae) => ae.isVisualEditing), [k, D] = _(!1), [v, b] = _(!1), [N, R] = _(
18820
+ } = oe(), { updateCardId: x } = pt(), [C, w] = _(null), F = O((ae) => ae.showAIDialog), A = Q((ae) => ae.isVisualEditing), [k, D] = _(!1), [v, b] = _(!1), [y, R] = _(
18818
18821
  null
18819
18822
  ), { isConsoleMode: S } = La(), { config: P } = On(yn).tokenProps, E = (P == null ? void 0 : P.showInfoTab) !== !1, T = O(
18820
18823
  (ae) => {
@@ -19017,7 +19020,7 @@ function Ph({
19017
19020
  }
19018
19021
  const Oe = x(u.id, we);
19019
19022
  if (Oe.success) {
19020
- y(we);
19023
+ N(we);
19021
19024
  const Pe = { ...u, id: we };
19022
19025
  h(Pe), f(Pe), w(null), re.success("Card ID updated successfully");
19023
19026
  } else
@@ -19080,12 +19083,12 @@ function Ph({
19080
19083
  onClose: () => D(!1)
19081
19084
  }
19082
19085
  ),
19083
- N && /* @__PURE__ */ e(
19086
+ y && /* @__PURE__ */ e(
19084
19087
  kc,
19085
19088
  {
19086
19089
  open: v,
19087
19090
  onOpenChange: b,
19088
- feedbackData: N
19091
+ feedbackData: y
19089
19092
  }
19090
19093
  )
19091
19094
  ] })
@@ -19144,7 +19147,7 @@ function Vh() {
19144
19147
  ye(() => zh(), []);
19145
19148
  const h = (Z) => {
19146
19149
  m(Z);
19147
- }, f = O((Z) => Z.frame), y = O((Z) => Z.card);
19150
+ }, f = O((Z) => Z.frame), N = O((Z) => Z.card);
19148
19151
  O((Z) => Z.activeTabCardId), O(
19149
19152
  (Z) => Z.actions.getAvailableFields
19150
19153
  );
@@ -19158,13 +19161,13 @@ function Vh() {
19158
19161
  distance: 8
19159
19162
  }
19160
19163
  })
19161
- ), b = y, {
19162
- getFieldsForContainer: N,
19164
+ ), b = N, {
19165
+ getFieldsForContainer: y,
19163
19166
  setFieldsForContainer: R
19164
19167
  } = _n(b), { activeField: S, handleDragStart: P, handleDragEnd: E } = Ah({
19165
19168
  activeCardId: f.activeCardId,
19166
19169
  sourceFields: A,
19167
- getFieldsForContainer: N,
19170
+ getFieldsForContainer: y,
19168
19171
  setFieldsForContainer: R
19169
19172
  }), T = (Z, G) => {
19170
19173
  G && F(Z, G);
@@ -19205,10 +19208,10 @@ function Vh() {
19205
19208
  {
19206
19209
  selectedChart: p,
19207
19210
  onChartChange: h,
19208
- groupByFields: N("groupBy"),
19209
- pivotByFields: N("pivotBy"),
19210
- metricsFields: N("metrics"),
19211
- sortByFields: N("sortBy"),
19211
+ groupByFields: y("groupBy"),
19212
+ pivotByFields: y("pivotBy"),
19213
+ metricsFields: y("metrics"),
19214
+ sortByFields: y("sortBy"),
19212
19215
  activeField: S
19213
19216
  }
19214
19217
  ),
@@ -19223,11 +19226,11 @@ function Vh() {
19223
19226
  onFiltersClick: () => c(!0),
19224
19227
  filterCount: V,
19225
19228
  activeCard: b,
19226
- dataSourceState: y.dataSource || hr,
19229
+ dataSourceState: N.dataSource || hr,
19227
19230
  columns: A,
19228
19231
  columnsLoading: k,
19229
19232
  columnsError: D,
19230
- getFieldsForContainer: N,
19233
+ getFieldsForContainer: y,
19231
19234
  cards: f.cards,
19232
19235
  activeCardId: f.activeCardId,
19233
19236
  addCard: g,
@@ -19270,12 +19273,12 @@ function _h({ authToken: t, onSave: n, onClose: s }) {
19270
19273
  o("editor", D);
19271
19274
  },
19272
19275
  [o]
19273
- ), { setAuthToken: y } = pt(), { setShowAIDialog: g, setOnSave: x, setOnClose: C } = oe(), { setActiveAssistantType: w } = mr();
19276
+ ), { setAuthToken: N } = pt(), { setShowAIDialog: g, setOnSave: x, setOnClose: C } = oe(), { setActiveAssistantType: w } = mr();
19274
19277
  ye(() => {
19275
19278
  n && x(n), s && C(s);
19276
19279
  }, [n, x, s, C]), ye(() => {
19277
- t && t.accessToken && y(t);
19278
- }, [t, y]), ye(() => {
19280
+ t && t.accessToken && N(t);
19281
+ }, [t, N]), ye(() => {
19279
19282
  var D, v;
19280
19283
  r ? ((D = l.current) == null || D.resize(40), i("editor", !0), w("editor")) : ((v = l.current) == null || v.resize(0), i("editor", !1), m === "editor" && d(null), w(null));
19281
19284
  }, [
@@ -19601,11 +19604,11 @@ function Kh({
19601
19604
  formatDate: u
19602
19605
  }) {
19603
19606
  var k, D, v, b;
19604
- const { selectVisual: m } = Fa(), p = Rc(t.id), h = qh(t.id), { isConsoleMode: f } = La(), y = qe.useRef(null), [g, x] = _(!1), [C, w] = _(!1);
19607
+ const { selectVisual: m } = Fa(), p = Rc(t.id), h = qh(t.id), { isConsoleMode: f } = La(), N = qe.useRef(null), [g, x] = _(!1), [C, w] = _(!1);
19605
19608
  ye(() => {
19606
19609
  s ? (x(!0), w(!0)) : C && (x(!1), w(!1));
19607
19610
  }, [s, C]), ye(() => {
19608
- h && y.current && y.current.scrollIntoView({
19611
+ h && N.current && N.current.scrollIntoView({
19609
19612
  behavior: "smooth",
19610
19613
  block: "center"
19611
19614
  });
@@ -19616,7 +19619,7 @@ function Kh({
19616
19619
  return /* @__PURE__ */ e(
19617
19620
  Ut,
19618
19621
  {
19619
- ref: y,
19622
+ ref: N,
19620
19623
  className: B(
19621
19624
  "group cursor-pointer border border-border/50 p-3 transition-colors hover:bg-accent/50",
19622
19625
  h ? "border-purple-500" : p && "border-primary"
@@ -19655,7 +19658,7 @@ function Kh({
19655
19658
  "invisible ml-2 flex flex-shrink-0 items-center gap-1 transition-opacity duration-150 group-hover:visible",
19656
19659
  p && "visible"
19657
19660
  ),
19658
- onClick: (N) => N.stopPropagation(),
19661
+ onClick: (y) => y.stopPropagation(),
19659
19662
  children: [
19660
19663
  /* @__PURE__ */ e(
19661
19664
  z,
@@ -19663,8 +19666,8 @@ function Kh({
19663
19666
  size: "sm",
19664
19667
  variant: "ghost",
19665
19668
  className: "h-6 w-6 p-0",
19666
- onClick: (N) => {
19667
- N.stopPropagation(), l(t);
19669
+ onClick: (y) => {
19670
+ y.stopPropagation(), l(t);
19668
19671
  },
19669
19672
  title: "Add to dashboard",
19670
19673
  children: /* @__PURE__ */ e(Ke, { className: "h-3.5 w-3.5" })
@@ -19676,8 +19679,8 @@ function Kh({
19676
19679
  size: "sm",
19677
19680
  variant: "ghost",
19678
19681
  className: "h-6 w-6 p-0",
19679
- onClick: (N) => {
19680
- N.stopPropagation(), c == null || c(t);
19682
+ onClick: (y) => {
19683
+ y.stopPropagation(), c == null || c(t);
19681
19684
  },
19682
19685
  title: "Edit details",
19683
19686
  children: /* @__PURE__ */ e(ls, { className: "h-3 w-3" })
@@ -19695,8 +19698,8 @@ function Kh({
19695
19698
  /* @__PURE__ */ a(
19696
19699
  He,
19697
19700
  {
19698
- onClick: (N) => {
19699
- N.stopPropagation(), l(t);
19701
+ onClick: (y) => {
19702
+ y.stopPropagation(), l(t);
19700
19703
  },
19701
19704
  children: [
19702
19705
  /* @__PURE__ */ e(Ke, { className: "mr-2 h-3 w-3" }),
@@ -19707,8 +19710,8 @@ function Kh({
19707
19710
  /* @__PURE__ */ a(
19708
19711
  He,
19709
19712
  {
19710
- onClick: (N) => {
19711
- N.stopPropagation(), r == null || r(t);
19713
+ onClick: (y) => {
19714
+ y.stopPropagation(), r == null || r(t);
19712
19715
  },
19713
19716
  children: [
19714
19717
  /* @__PURE__ */ e(sd, { className: "mr-2 h-3 w-3" }),
@@ -19719,8 +19722,8 @@ function Kh({
19719
19722
  /* @__PURE__ */ a(
19720
19723
  He,
19721
19724
  {
19722
- onClick: (N) => {
19723
- N.preventDefault(), N.stopPropagation(), i(t.id);
19725
+ onClick: (y) => {
19726
+ y.preventDefault(), y.stopPropagation(), i(t.id);
19724
19727
  },
19725
19728
  disabled: s,
19726
19729
  children: [
@@ -19733,8 +19736,8 @@ function Kh({
19733
19736
  /* @__PURE__ */ a(
19734
19737
  He,
19735
19738
  {
19736
- onClick: (N) => {
19737
- N.stopPropagation(), c == null || c(t);
19739
+ onClick: (y) => {
19740
+ y.stopPropagation(), c == null || c(t);
19738
19741
  },
19739
19742
  children: [
19740
19743
  /* @__PURE__ */ e(ls, { className: "mr-2 h-3 w-3" }),
@@ -19745,8 +19748,8 @@ function Kh({
19745
19748
  /* @__PURE__ */ a(
19746
19749
  He,
19747
19750
  {
19748
- onClick: (N) => {
19749
- N.stopPropagation(), o(t);
19751
+ onClick: (y) => {
19752
+ y.stopPropagation(), o(t);
19750
19753
  },
19751
19754
  children: [
19752
19755
  /* @__PURE__ */ e(Ue, { className: "mr-2 h-3 w-3" }),
@@ -19758,8 +19761,8 @@ function Kh({
19758
19761
  /* @__PURE__ */ a(
19759
19762
  He,
19760
19763
  {
19761
- onClick: (N) => {
19762
- N.stopPropagation(), d(t);
19764
+ onClick: (y) => {
19765
+ y.stopPropagation(), d(t);
19763
19766
  },
19764
19767
  className: "text-destructive",
19765
19768
  disabled: n,
@@ -19943,7 +19946,7 @@ function Jh({
19943
19946
  function Wh() {
19944
19947
  const [t, n] = _(""), [s, l] = _(!1), [r, c] = _(!1), [d, i] = _(
19945
19948
  null
19946
- ), [o, u] = _(!1), [m, p] = _(null), [h, f] = _(null), [y, g] = _(
19949
+ ), [o, u] = _(!1), [m, p] = _(null), [h, f] = _(null), [N, g] = _(
19947
19950
  null
19948
19951
  ), { selectVisual: x } = Fa(), { handleEditLibraryVisual: C, handleAddLibraryVisual: w } = ia(), {
19949
19952
  resources: F,
@@ -19952,7 +19955,7 @@ function Wh() {
19952
19955
  createResource: D,
19953
19956
  updateResource: v,
19954
19957
  deleteResource: b,
19955
- duplicateResource: N,
19958
+ duplicateResource: y,
19956
19959
  isCreating: R,
19957
19960
  isDeleting: S
19958
19961
  } = Fc(
@@ -20014,7 +20017,7 @@ function Wh() {
20014
20017
  }
20015
20018
  );
20016
20019
  }, Z = (K) => {
20017
- f(K), N(K, {
20020
+ f(K), y(K, {
20018
20021
  onSettled: () => f(null)
20019
20022
  });
20020
20023
  }, G = (K) => {
@@ -20039,10 +20042,10 @@ function Wh() {
20039
20042
  title: K,
20040
20043
  description: Ne
20041
20044
  }) => {
20042
- if (!y)
20045
+ if (!N)
20043
20046
  return;
20044
20047
  const ae = {};
20045
- K !== y.title && (ae.title = K), (y.description || "") !== Ne && (ae.description = Ne), X(y.id, ae, {
20048
+ K !== N.title && (ae.title = K), (N.description || "") !== Ne && (ae.description = Ne), X(N.id, ae, {
20046
20049
  onSuccess: () => {
20047
20050
  g(null);
20048
20051
  }
@@ -20114,16 +20117,16 @@ function Wh() {
20114
20117
  }
20115
20118
  }
20116
20119
  ),
20117
- y && /* @__PURE__ */ e(
20120
+ N && /* @__PURE__ */ e(
20118
20121
  ci,
20119
20122
  {
20120
- open: !!y,
20123
+ open: !!N,
20121
20124
  resourceLabel: "Visual",
20122
- initialTitle: y.title || "",
20123
- initialDescription: y.description || "",
20125
+ initialTitle: N.title || "",
20126
+ initialDescription: N.description || "",
20124
20127
  onClose: Ie,
20125
20128
  onSave: te,
20126
- isSaving: j(y.id)
20129
+ isSaving: j(N.id)
20127
20130
  }
20128
20131
  ),
20129
20132
  /* @__PURE__ */ e(
@@ -20195,8 +20198,8 @@ function Qh({
20195
20198
  formatDate: o,
20196
20199
  onDashboardItemClick: u
20197
20200
  }) {
20198
- var b, N, R, S, P;
20199
- const { selectDashboard: m } = Fa(), p = Pc(t.id), { isConsoleMode: h } = La(), { currentUser: f, isLoading: y, isError: g } = Rt(), x = !g && (f == null ? void 0 : f.type) === "tenant" && ((b = f == null ? void 0 : f.role) == null ? void 0 : b.toUpperCase()) === "VIEWER", C = y || x, [w, F] = _(!1), [A, k] = _(!1);
20201
+ var b, y, R, S, P;
20202
+ const { selectDashboard: m } = Fa(), p = Pc(t.id), { isConsoleMode: h } = La(), { currentUser: f, isLoading: N, isError: g } = Rt(), x = !g && (f == null ? void 0 : f.type) === "tenant" && ((b = f == null ? void 0 : f.role) == null ? void 0 : b.toUpperCase()) === "VIEWER", C = N || x, [w, F] = _(!1), [A, k] = _(!1);
20200
20203
  ye(() => {
20201
20204
  s ? (F(!0), k(!0)) : A && (F(!1), k(!1));
20202
20205
  }, [s, A]);
@@ -20233,7 +20236,7 @@ function Qh({
20233
20236
  {
20234
20237
  className: "text-xs text-muted-foreground line-clamp-2",
20235
20238
  title: t.description || "No description",
20236
- children: (N = t.description) != null && N.trim() ? t.description : "No description"
20239
+ children: (y = t.description) != null && y.trim() ? t.description : "No description"
20237
20240
  }
20238
20241
  )
20239
20242
  ] }),
@@ -20351,7 +20354,7 @@ function Hh({ onRetry: t }) {
20351
20354
  function Xh(t) {
20352
20355
  const { onLoadDashboard: n, onEditDashboard: s, onDashboardItemClick: l } = t, [r, c] = _(""), [d, i] = _(!1), [o, u] = _(!1), [m, p] = _(
20353
20356
  null
20354
- ), [h, f] = _(!1), [y, g] = _(null), [x, C] = _(null), [w, F] = _(null), A = bt(
20357
+ ), [h, f] = _(!1), [N, g] = _(null), [x, C] = _(null), [w, F] = _(null), A = bt(
20355
20358
  (ee) => ee.lastSelectedDashboard
20356
20359
  ), k = bt(
20357
20360
  (ee) => ee.selectedDashboard
@@ -20359,7 +20362,7 @@ function Xh(t) {
20359
20362
  (ee) => ee.actions.selectDashboard
20360
20363
  ), v = bt(
20361
20364
  (ee) => ee.actions.clearSelectedDashboard
20362
- ), { tokenProps: b, id: N } = Ze(), { permissions: R } = Nn(), { onCreateSuccess: S } = Lc({
20365
+ ), { tokenProps: b, id: y } = Ze(), { permissions: R } = Nn(), { onCreateSuccess: S } = Lc({
20363
20366
  onDashboardSelect: l
20364
20367
  }), {
20365
20368
  resources: P,
@@ -20375,8 +20378,8 @@ function Xh(t) {
20375
20378
  } = zc(
20376
20379
  () => {
20377
20380
  f(!1);
20378
- const ee = y == null ? void 0 : y.id;
20379
- g(null), (k == null ? void 0 : k.id) === ee && (!(b != null && b.dashboard_id) && !N ? v() : A && A.id !== ee && D(A));
20381
+ const ee = N == null ? void 0 : N.id;
20382
+ g(null), (k == null ? void 0 : k.id) === ee && (!(b != null && b.dashboard_id) && !y ? v() : A && A.id !== ee && D(A));
20380
20383
  },
20381
20384
  (ee) => {
20382
20385
  i(!1), S(ee, Z);
@@ -20401,7 +20404,7 @@ function Xh(t) {
20401
20404
  }, Ie = (ee) => {
20402
20405
  g(ee), f(!0);
20403
20406
  }, te = () => {
20404
- y && M(y.id);
20407
+ N && M(N.id);
20405
20408
  }, K = (ee) => {
20406
20409
  C(ee), V(ee, {
20407
20410
  onSettled: () => C(null)
@@ -20531,7 +20534,7 @@ function Xh(t) {
20531
20534
  /* @__PURE__ */ e(pn, { children: "Delete Dashboard" }),
20532
20535
  /* @__PURE__ */ a(fn, { children: [
20533
20536
  'Are you sure you want to delete "',
20534
- y == null ? void 0 : y.title,
20537
+ N == null ? void 0 : N.title,
20535
20538
  '"? This action cannot be undone.'
20536
20539
  ] })
20537
20540
  ] }),
@@ -20600,7 +20603,7 @@ function Zh({
20600
20603
  (k) => k.actions
20601
20604
  ), {
20602
20605
  currentUser: i
20603
- } = Rt(), o = i, { permissions: u } = Nn(), p = _c() && u.canAccessVisuals, h = "dashboards", [f, y] = Gn(
20606
+ } = Rt(), o = i, { permissions: u } = Nn(), p = _c() && u.canAccessVisuals, h = "dashboards", [f, N] = Gn(
20604
20607
  "resource-management-active-tab",
20605
20608
  h
20606
20609
  ), g = p ? f : "dashboards", x = r === "overlay", C = Er(n, {
@@ -20653,7 +20656,7 @@ function Zh({
20653
20656
  Ft,
20654
20657
  {
20655
20658
  value: g,
20656
- onValueChange: p ? y : void 0,
20659
+ onValueChange: p ? N : void 0,
20657
20660
  className: "flex h-9 grow flex-col",
20658
20661
  children: [
20659
20662
  p && /* @__PURE__ */ e("div", { className: "px-4 pt-4", children: /* @__PURE__ */ a(Pt, { className: "grid w-full grid-cols-2", children: [