react-semaphor 0.0.688 → 0.0.689
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{dashboard-plus-szKmVTpB.js → dashboard-plus-CvIEcQve.js} +746 -746
- package/dist/chunks/{dashboard-plus-BxKFGvfL.js → dashboard-plus-DzJwjJjJ.js} +12 -12
- package/dist/chunks/{index-BRk9PMc7.js → index-BATJPB8E.js} +1 -1
- package/dist/chunks/{index-BtBIrWSP.js → index-CVe9Ly3u.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e, Fragment as J } from "react/jsx-runtime";
|
|
2
|
-
import { L as le, M as wn, u as X, N as At, O as Et, P as _, Q as Ot, T as Je, V as Sn, I as pt, W as Xe, X as rt, Y as rl, Z as Ye, _ as lt, $ as it, a0 as ot, a1 as gt, a2 as U, a3 as Oe, a4 as Rt, a5 as ye, a6 as kn, a7 as xa, a8 as $i, a9 as Ar, aa as Dn, ab as G, ac as Tn, ad as Yi, ae as ll, af as qi, ag as Ki, ah as Ma, ai as he, j as Er, aj as Wi, ak as Ji, al as Wt, am as _e, an as ue, ao as De, ap as ft, aq as je, ar as _a, as as Na, at as Va, au as Hi, av as ba, aw as xt, ax as Qe, ay as Ze, az as is, aA as tt, aB as Ee, aC as et, aD as Mn, aE as Is, aF as Ia, aG as
|
|
2
|
+
import { L as le, M as wn, u as X, N as At, O as Et, P as _, Q as Ot, T as Je, V as Sn, I as pt, W as Xe, X as rt, Y as rl, Z as Ye, _ as lt, $ as it, a0 as ot, a1 as gt, a2 as U, a3 as Oe, a4 as Rt, a5 as ye, a6 as kn, a7 as xa, a8 as $i, a9 as Ar, aa as Dn, ab as G, ac as Tn, ad as Yi, ae as ll, af as qi, ag as Ki, ah as Ma, ai as he, j as Er, aj as Wi, ak as Ji, al as Wt, am as _e, an as ue, ao as De, ap as ft, aq as je, ar as _a, as as Na, at as Va, au as Hi, av as ba, aw as xt, ax as Qe, ay as Ze, az as is, aA as tt, aB as Ee, aC as et, aD as Mn, aE as Is, aF as Ia, aG as ia, aH as Ca, aI as In, aJ as An, aK as Qi, aL as os, aM as En, aN as On, aO as Rn, aP as Fn, R as Kt, aQ as il, aR as Zi, aS as Pn, aT as cs, aU as Ln, aV as zn, aW as ja, aX as Ba, aY as Ua, aZ as _n, a_ as _s, a$ as Vn, b0 as ol, b1 as cl, b2 as jn, b3 as fe, b4 as ge, b5 as xe, b6 as ve, b7 as ae, b8 as dl, b9 as ul, ba as Xi, bb as eo, bc as Ht, bd as to, be as ao, bf as Ct, bg as wt, bh as Re, bi as ut, bj as Dt, J as O, bk as Lt, bl as Vs, bm as js, bn as Bn, bo as so, bp as st, bq as Aa, br as oa, bs as As, bt as ml, bu as hl, bv as no, bw as Un, bx as Gn, by as $n, bz as Yn, bA as qn, bB as Kn, bC as Wn, bD as Jn, bE as Ss, bF as Bs, bG as ds, K as ie, bH as ro, bI as It, bJ as lo, bK as ca, bL as pl, bM as qe, bN as Hn, bO as io, bP as Qn, bQ as Es, bR as Zn, bS as ks, bT as Ga, bU as Xn, bV as oo, bW as co, bX as uo, bY as mo, bZ as ho, i as po, b_ as Os, b$ as fl, c0 as zt, c1 as _t, c2 as Vt, c3 as Qt, c4 as us, c5 as ms, c6 as hs, c7 as ps, c8 as ha, c9 as $a, ca as Ea, cb as Oa, cc as Ft, cd as fs, A as jt, r as gl, q as xl, l as Tt, ce as Pt, cf as Ge, cg as fo, ch as na, ci as aa, cj as vl, ck as go, k as yl, cl as Xa, cm as ea, cn as xo, n as sa, m as Ut, o as Gt, co as un, cp as Us, cq as Gs, cr as Ya, cs as $s, ct as ra, x as Or, cu as qa, cv as es, cw as Rr, cx as vo, cy as yo, cz as No, cA as Nl, cB as bo, cC as Co, cD as bl, cE as wo, cF as Ys, cG as So, cH as ko, cI as mn, cJ as $t, cK as We, cL as Yt, cM as Do, cN as To, cO as Mo, cP as er, cQ as Io, cR as Cl, cS as tr, cT as Ao, cU as wl, cV as Ds, cW as Sl, cX as Eo, cY as Oo, cZ as ts, c_ as Ro, c$ as ar, d0 as Fo, d1 as Po, d2 as Fr, d3 as Lo, E as gs, b as sr, d4 as zo, d5 as _o, d6 as Vo, d7 as nr, d8 as jo, d9 as Bo, da as Uo, db as kl, dc as rr, dd as Dl, de as Tl, df as Ml, dg as Il, dh as Al, di as lr, dj as ir, dk as El, dl as Ol, dm as Rl, dn as or, dp as qs, dq as Ks, dr as Go, ds as $o, dt as ua, du as Yo, dv as qo, dw as Ko, dx as Wo, dy as Jo, dz as Ho, dA as Fl, dB as mt, dC as ht, dD as Te, dE as Me, dF as Ie, dG as ta, dH as Qo, dI as Zo, dJ as Xo, dK as ec, dL as tc, y as ac, dM as Pr, dN as Pl, dO as sc, dP as nc, dQ as dt, dR as ys, dS as Lr, dT as rc, dU as zr, dV as lc, dW as ic, dX as oc, dY as cc, dZ as cr, d_ as dr, d$ as ur, e0 as Ka, e1 as mr, e2 as la, e3 as dc, e4 as Ws, e5 as Ll, e6 as uc, e7 as mc, e8 as _r, e9 as hc, ea as pc, eb as fc, ec as gc, ed as xc, w as Vr, ee as jr, ef as vc, eg as yc, eh as zl, ei as Nc, ej as _l, ek as bc, el as Cc, em as wc, en as Sc, eo as kc, ep as Dc, eq as Tc, er as Mc, es as Ic, et as Ac, eu as Ec, ev as Oc, ew as Rc, ex as Fc, ey as Pc, ez as Lc, eA as Vl, eB as zc, eC as _c, eD as hn, eE as Vc, eF as Ts, eG as Ms, eH as Wa, eI as jc, eJ as Br, eK as Bc, eL as pn, eM as jl, eN as hr, eO as Xs, eP as pr, eQ as Uc, eR as Gc, eS as $c, eT as as, eU as Yc, eV as Bl, eW as fn, eX as qc, eY as Kc, eZ as Wc, e_ as gn, e$ as xn, f0 as Rs, f1 as Ul, f2 as Ra, f3 as ss, f4 as Jc, f5 as Hc, f6 as Qc, f7 as Zc, f8 as Xc, f9 as ed, fa as td, fb as ad, fc as en, fd as sd, fe as nd, ff as rd, F as Gl, fg as ld, p as id, fh as od, B as cd, fi as dd, fj as ud, fk as md, fl as $l, fm as Yl, fn as hd, fo as ql, fp as pd, fq as fd, fr as gd, fs as xd, ft as vd, S as yd, fu as Nd, U as bd, fv as Cd, C as wd } from "./index-BATJPB8E.js";
|
|
3
3
|
import * as ma from "react";
|
|
4
4
|
import $e, { useState as V, useRef as Nt, useEffect as ke, useMemo as Ve, useCallback as Se, useContext as fr, Suspense as Kl } from "react";
|
|
5
5
|
import { createPortal as Sd } from "react-dom";
|
|
@@ -2111,7 +2111,7 @@ function ni({
|
|
|
2111
2111
|
A ? y.removeSelectedUser(C) : N ? y.removeUserFromRemove(C) : y.addSelectedUser({ id: C, role: "VIEWER" });
|
|
2112
2112
|
}), v = c || y.updateSelectedUserRole, g = u || y.addUserToRemove, b = d || ((C, A, N) => {
|
|
2113
2113
|
y.addUserToUpdate({ id: C, currentRole: A, newRole: N });
|
|
2114
|
-
}), I = l.filter((C) => C.id !== (i == null ? void 0 : i.id)),
|
|
2114
|
+
}), I = l.filter((C) => C.id !== (i == null ? void 0 : i.id)), M = h;
|
|
2115
2115
|
return /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
2116
2116
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
2117
2117
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
@@ -2159,10 +2159,10 @@ function ni({
|
|
|
2159
2159
|
}
|
|
2160
2160
|
),
|
|
2161
2161
|
!n && !s && (I == null ? void 0 : I.length) > 0 && I.map((C) => {
|
|
2162
|
-
const A = t ? Su(C, t, i) : void 0, N =
|
|
2163
|
-
(
|
|
2162
|
+
const A = t ? Su(C, t, i) : void 0, N = M.includes(C.id), S = !!A, w = S && !N, L = m.some(
|
|
2163
|
+
(D) => D.id === C.id
|
|
2164
2164
|
), k = m.find(
|
|
2165
|
-
(
|
|
2165
|
+
(D) => D.id === C.id
|
|
2166
2166
|
), z = r(C.type);
|
|
2167
2167
|
return /* @__PURE__ */ e(
|
|
2168
2168
|
Eu,
|
|
@@ -2260,7 +2260,7 @@ function Ou({
|
|
|
2260
2260
|
isUpdating: o = !1,
|
|
2261
2261
|
isRemoving: c = !1
|
|
2262
2262
|
}) {
|
|
2263
|
-
const u =
|
|
2263
|
+
const u = ia(), d = yt().filter(
|
|
2264
2264
|
(b) => b.value === "VIEWER" || b.value === "EDITOR" || b.value === "CONTRIBUTOR"
|
|
2265
2265
|
), m = n.role !== "NONE" ? n.role : "NONE", h = l ? l.newRole : m, p = n.role !== "NONE" && !i && (!l || l.newRole === m), x = l !== null && l.newRole !== m, y = i, f = m === "NONE" || !m, v = (b) => {
|
|
2266
2266
|
switch (b) {
|
|
@@ -2450,7 +2450,7 @@ function Ru({
|
|
|
2450
2450
|
isRemoving: o = !1
|
|
2451
2451
|
}) {
|
|
2452
2452
|
var $, ne;
|
|
2453
|
-
const c = Pn(), u = cs(), { searchQuery: d, setSearchQuery: m, debouncedSearchQuery: h } = Ln(), p = _a(), x = Na(), y = Va(), f =
|
|
2453
|
+
const c = Pn(), u = cs(), { searchQuery: d, setSearchQuery: m, debouncedSearchQuery: h } = Ln(), p = _a(), x = Na(), y = Va(), f = ia(), v = zn(), g = ba(), [b, I] = $e.useState("specific_users"), M = () => {
|
|
2454
2454
|
if (c === "org") return "organization";
|
|
2455
2455
|
if (c === "tenant") return "tenant";
|
|
2456
2456
|
}, C = () => {
|
|
@@ -2460,7 +2460,7 @@ function Ru({
|
|
|
2460
2460
|
debouncedSearchQuery: h,
|
|
2461
2461
|
resourceId: (t == null ? void 0 : t.id) || "",
|
|
2462
2462
|
resourceType: n,
|
|
2463
|
-
userType:
|
|
2463
|
+
userType: M(),
|
|
2464
2464
|
tenantId: C()
|
|
2465
2465
|
});
|
|
2466
2466
|
$e.useEffect(() => {
|
|
@@ -2488,9 +2488,9 @@ function Ru({
|
|
|
2488
2488
|
(Ne) => Ne.orgUserId === ee
|
|
2489
2489
|
);
|
|
2490
2490
|
de ? g.removeSelectedUser(ee) : H ? g.removeUserFromRemove(ee) : me || g.addSelectedUser({ id: ee, role: "VIEWER" });
|
|
2491
|
-
},
|
|
2491
|
+
}, D = (ee, de) => {
|
|
2492
2492
|
g.updateSelectedUserRole(ee, de);
|
|
2493
|
-
},
|
|
2493
|
+
}, T = (ee) => {
|
|
2494
2494
|
g.addUserToRemove(ee), g.removeSelectedUser(ee);
|
|
2495
2495
|
}, E = (ee) => {
|
|
2496
2496
|
g.removeUserFromRemove(ee);
|
|
@@ -2542,7 +2542,7 @@ function Ru({
|
|
|
2542
2542
|
selectedUsers: p,
|
|
2543
2543
|
selectedUserObjects: k,
|
|
2544
2544
|
onRemove: z,
|
|
2545
|
-
onRoleChange:
|
|
2545
|
+
onRoleChange: D,
|
|
2546
2546
|
getRoleOptions: yt
|
|
2547
2547
|
}
|
|
2548
2548
|
),
|
|
@@ -2576,8 +2576,8 @@ function Ru({
|
|
|
2576
2576
|
allUsers: L,
|
|
2577
2577
|
currentUser: s,
|
|
2578
2578
|
handleUserToggle: z,
|
|
2579
|
-
handleUserRoleChange:
|
|
2580
|
-
handleRemoveAccess:
|
|
2579
|
+
handleUserRoleChange: D,
|
|
2580
|
+
handleRemoveAccess: T,
|
|
2581
2581
|
handleUpdateAccess: (ee, de, H) => {
|
|
2582
2582
|
g.addUserToUpdate({ id: ee, currentRole: de, newRole: H });
|
|
2583
2583
|
}
|
|
@@ -2641,7 +2641,7 @@ function li({
|
|
|
2641
2641
|
/* @__PURE__ */ e("div", { className: "max-h-[300px] space-y-2 overflow-y-auto rounded-md border p-3", children: t.map((f) => {
|
|
2642
2642
|
const v = n == null ? void 0 : n.find(
|
|
2643
2643
|
(N) => N.groupId === f.id
|
|
2644
|
-
), g = m.some((N) => N.id === f.id), b = h.includes(f.id), I = p.find((N) => N.id === f.id),
|
|
2644
|
+
), g = m.some((N) => N.id === f.id), b = h.includes(f.id), I = p.find((N) => N.id === f.id), M = !!v && !b;
|
|
2645
2645
|
let A = (v == null ? void 0 : v.role) || "VIEWER";
|
|
2646
2646
|
if (g) {
|
|
2647
2647
|
const N = m.find((S) => S.id === f.id);
|
|
@@ -2652,7 +2652,7 @@ function li({
|
|
|
2652
2652
|
{
|
|
2653
2653
|
className: G(
|
|
2654
2654
|
"flex items-center justify-between rounded-lg p-2 transition-colors",
|
|
2655
|
-
|
|
2655
|
+
M && !b ? "border border-green-200 bg-green-50" : b ? "border border-red-200 bg-red-50" : g ? "border border-blue-200 bg-blue-50" : "hover:bg-muted/50"
|
|
2656
2656
|
),
|
|
2657
2657
|
children: [
|
|
2658
2658
|
/* @__PURE__ */ a("div", { className: "flex items-center space-x-3", children: [
|
|
@@ -2660,10 +2660,10 @@ function li({
|
|
|
2660
2660
|
et,
|
|
2661
2661
|
{
|
|
2662
2662
|
id: `group-${f.id}`,
|
|
2663
|
-
checked:
|
|
2663
|
+
checked: M ? !b : g,
|
|
2664
2664
|
disabled: !1,
|
|
2665
2665
|
onCheckedChange: () => {
|
|
2666
|
-
|
|
2666
|
+
M ? b ? x.removeGroupFromRemove(f.id) : u == null || u(f.id) : o == null || o(f.id);
|
|
2667
2667
|
}
|
|
2668
2668
|
}
|
|
2669
2669
|
),
|
|
@@ -2700,7 +2700,7 @@ function li({
|
|
|
2700
2700
|
)
|
|
2701
2701
|
] }),
|
|
2702
2702
|
/* @__PURE__ */ a("div", { className: "flex items-center space-x-2", children: [
|
|
2703
|
-
|
|
2703
|
+
M && !b ? /* @__PURE__ */ e(
|
|
2704
2704
|
ya,
|
|
2705
2705
|
{
|
|
2706
2706
|
currentRole: A,
|
|
@@ -2714,7 +2714,7 @@ function li({
|
|
|
2714
2714
|
}
|
|
2715
2715
|
) : (
|
|
2716
2716
|
/* Show role selector for newly selected groups */
|
|
2717
|
-
g && !
|
|
2717
|
+
g && !M && /* @__PURE__ */ e(
|
|
2718
2718
|
ya,
|
|
2719
2719
|
{
|
|
2720
2720
|
currentRole: A,
|
|
@@ -2724,7 +2724,7 @@ function li({
|
|
|
2724
2724
|
}
|
|
2725
2725
|
)
|
|
2726
2726
|
),
|
|
2727
|
-
|
|
2727
|
+
M && !b && !I && /* @__PURE__ */ e(
|
|
2728
2728
|
_,
|
|
2729
2729
|
{
|
|
2730
2730
|
variant: "ghost",
|
|
@@ -2831,7 +2831,7 @@ function qr({
|
|
|
2831
2831
|
isRemoving: o = !1
|
|
2832
2832
|
}) {
|
|
2833
2833
|
var Z;
|
|
2834
|
-
const { searchQuery: c, debouncedSearchQuery: u, setSearchQuery: d } = Ln(), m = _a(), h = Na(), p = Va(), x = ja(), y = Ba(), f = Ua(), v =
|
|
2834
|
+
const { searchQuery: c, debouncedSearchQuery: u, setSearchQuery: d } = Ln(), m = _a(), h = Na(), p = Va(), x = ja(), y = Ba(), f = Ua(), v = ia(), g = _s(), b = Vn(), I = cs(), M = ba(), { data: C, isLoading: A } = ol({
|
|
2835
2835
|
enabled: (s == null ? void 0 : s.type) === "organization"
|
|
2836
2836
|
}), { groups: N, isLoading: S } = cl(
|
|
2837
2837
|
"tenant",
|
|
@@ -2840,26 +2840,26 @@ function qr({
|
|
|
2840
2840
|
(s == null ? void 0 : s.type) === "organization" ? "all_tenants" : "specific_tenant_users"
|
|
2841
2841
|
);
|
|
2842
2842
|
$e.useEffect(() => {
|
|
2843
|
-
(s == null ? void 0 : s.type) === "tenant" ? (
|
|
2844
|
-
}, [
|
|
2843
|
+
(s == null ? void 0 : s.type) === "tenant" ? (M.setCurrentContext("tenant-dialog"), M.setCurrentMode("specificTenantUsers")) : (M.setCurrentContext("tenant-tab"), M.setCurrentMode("allTenants"));
|
|
2844
|
+
}, [M, s == null ? void 0 : s.type]);
|
|
2845
2845
|
const k = (B) => {
|
|
2846
2846
|
var Ae, Le, we, ze;
|
|
2847
2847
|
L(
|
|
2848
2848
|
B
|
|
2849
2849
|
);
|
|
2850
2850
|
let ce;
|
|
2851
|
-
if (B === "specific_tenant_users" ? ce = "specific_users" : B === "all_tenant_users" || B === "all_tenants" ? ce = "all_users" : B === "groups" ? ce = "groups" : ce = "specific_users", r == null || r(ce), B === "groups" ? (
|
|
2852
|
-
const Ke = (Le = (Ae =
|
|
2853
|
-
Ke && Ke.role !== void 0 &&
|
|
2851
|
+
if (B === "specific_tenant_users" ? ce = "specific_users" : B === "all_tenant_users" || B === "all_tenants" ? ce = "all_users" : B === "groups" ? ce = "groups" : ce = "specific_users", r == null || r(ce), B === "groups" ? (M.setCurrentContext("group-share"), M.setCurrentMode("specificGroups")) : (s == null ? void 0 : s.type) === "tenant" ? (M.setCurrentContext("tenant-dialog"), B === "specific_tenant_users" ? M.setCurrentMode("specificTenantUsers") : B === "all_tenant_users" && (M.setCurrentMode("allTenantUsers"), s != null && s.tenantId && M.setSelectedTenant(s.tenantId))) : (M.setCurrentContext("tenant-tab"), B === "specific_tenant_users" ? M.setCurrentMode("specificTenantUsers") : B === "all_tenant_users" ? M.setCurrentMode("allTenantUsers") : B === "all_tenants" && M.setCurrentMode("allTenants")), B === "all_tenant_users") {
|
|
2852
|
+
const Ke = (Le = (Ae = T == null ? void 0 : T.shares) == null ? void 0 : Ae.tenantWide) == null ? void 0 : Le[0];
|
|
2853
|
+
Ke && Ke.role !== void 0 && M.setTenantWideRole(Ke.role);
|
|
2854
2854
|
} else if (B === "all_tenants") {
|
|
2855
|
-
const Ke = (ze = (we =
|
|
2856
|
-
Ke && Ke.role !== void 0 &&
|
|
2855
|
+
const Ke = (ze = (we = T == null ? void 0 : T.shares) == null ? void 0 : we.allTenantsOnly) == null ? void 0 : ze[0];
|
|
2856
|
+
Ke && Ke.role !== void 0 && M.setAllTenantsRole(Ke.role);
|
|
2857
2857
|
}
|
|
2858
2858
|
}, z = (B) => {
|
|
2859
|
-
|
|
2859
|
+
M.setSelectedTenant(B);
|
|
2860
2860
|
}, {
|
|
2861
|
-
allUsers:
|
|
2862
|
-
existingShares:
|
|
2861
|
+
allUsers: D,
|
|
2862
|
+
existingShares: T,
|
|
2863
2863
|
isLoadingUsers: E,
|
|
2864
2864
|
isErrorLoadingUsers: P,
|
|
2865
2865
|
isLoadingShares: F,
|
|
@@ -2873,63 +2873,63 @@ function qr({
|
|
|
2873
2873
|
tenantId: (s == null ? void 0 : s.type) === "tenant" ? s.tenantId : I
|
|
2874
2874
|
}), j = (B) => {
|
|
2875
2875
|
var we, ze;
|
|
2876
|
-
const ce = m.some((Ke) => Ke.id === B), Ae = h.includes(B), Le = (ze = (we =
|
|
2876
|
+
const ce = m.some((Ke) => Ke.id === B), Ae = h.includes(B), Le = (ze = (we = T == null ? void 0 : T.shares) == null ? void 0 : we.specificTenantUsers) == null ? void 0 : ze.some(
|
|
2877
2877
|
(Ke) => Ke.tenantUserId === B
|
|
2878
2878
|
);
|
|
2879
|
-
ce ?
|
|
2879
|
+
ce ? M.removeSelectedUser(B) : Ae ? M.removeUserFromRemove(B) : Le || M.addSelectedUser({ id: B, role: "VIEWER" });
|
|
2880
2880
|
}, K = (B, ce) => {
|
|
2881
|
-
|
|
2881
|
+
M.updateSelectedUserRole(B, ce);
|
|
2882
2882
|
}, Q = (B) => {
|
|
2883
|
-
|
|
2883
|
+
M.addUserToRemove(B), M.removeSelectedUser(B);
|
|
2884
2884
|
}, $ = (B) => {
|
|
2885
|
-
|
|
2885
|
+
M.removeUserFromRemove(B);
|
|
2886
2886
|
}, ne = (B) => {
|
|
2887
|
-
|
|
2887
|
+
M.removeUserFromUpdate(B);
|
|
2888
2888
|
}, ee = (B, ce, Ae) => {
|
|
2889
|
-
|
|
2889
|
+
M.addUserToUpdate({ id: B, currentRole: ce, newRole: Ae });
|
|
2890
2890
|
}, de = (B, ce) => {
|
|
2891
|
-
w === "all_tenant_users" ?
|
|
2891
|
+
w === "all_tenant_users" ? M.setTenantWideRole(ce) : w === "all_tenants" && M.setAllTenantsRole(ce);
|
|
2892
2892
|
}, H = () => {
|
|
2893
|
-
w === "all_tenant_users" ?
|
|
2893
|
+
w === "all_tenant_users" ? M.setTenantWideRole("VIEWER") : w === "all_tenants" && M.setAllTenantsRole("VIEWER");
|
|
2894
2894
|
}, Y = (() => {
|
|
2895
2895
|
var B, ce, Ae, Le;
|
|
2896
|
-
return v === "allTenants" ? (ce = (B =
|
|
2896
|
+
return v === "allTenants" ? (ce = (B = T == null ? void 0 : T.shares) == null ? void 0 : B.allTenantsOnly) == null ? void 0 : ce[0] : v === "allTenantUsers" ? (Le = (Ae = T == null ? void 0 : T.shares) == null ? void 0 : Ae.tenantWide) == null ? void 0 : Le[0] : null;
|
|
2897
2897
|
})();
|
|
2898
2898
|
$e.useEffect(() => {
|
|
2899
2899
|
var B, ce, Ae, Le;
|
|
2900
2900
|
if (w === "all_tenant_users") {
|
|
2901
|
-
const we = (ce = (B =
|
|
2902
|
-
we && we.role !== void 0 &&
|
|
2901
|
+
const we = (ce = (B = T == null ? void 0 : T.shares) == null ? void 0 : B.tenantWide) == null ? void 0 : ce[0];
|
|
2902
|
+
we && we.role !== void 0 && M.setTenantWideRole(we.role);
|
|
2903
2903
|
} else if (w === "all_tenants") {
|
|
2904
|
-
const we = (Le = (Ae =
|
|
2905
|
-
we && we.role !== void 0 &&
|
|
2904
|
+
const we = (Le = (Ae = T == null ? void 0 : T.shares) == null ? void 0 : Ae.allTenantsOnly) == null ? void 0 : Le[0];
|
|
2905
|
+
we && we.role !== void 0 && M.setAllTenantsRole(we.role);
|
|
2906
2906
|
}
|
|
2907
|
-
}, [w,
|
|
2908
|
-
const W =
|
|
2907
|
+
}, [w, T, M]);
|
|
2908
|
+
const W = D.filter(
|
|
2909
2909
|
(B) => m.some((ce) => ce.id === B.id)
|
|
2910
2910
|
), Ne = (B) => {
|
|
2911
2911
|
const ce = x.some((we) => we.id === B), Ae = y.includes(B), Le = be == null ? void 0 : be.some(
|
|
2912
2912
|
(we) => we.groupId === B
|
|
2913
2913
|
);
|
|
2914
|
-
ce ?
|
|
2914
|
+
ce ? M.removeSelectedGroup(B) : Ae ? M.removeGroupFromRemove(B) : Le || M.addSelectedGroup({ id: B, role: "VIEWER" });
|
|
2915
2915
|
}, re = (B, ce) => {
|
|
2916
|
-
|
|
2916
|
+
M.updateSelectedGroupRole(B, ce);
|
|
2917
2917
|
}, Ce = (B) => {
|
|
2918
|
-
|
|
2918
|
+
M.addGroupToRemove(B), M.removeSelectedGroup(B);
|
|
2919
2919
|
}, q = (B, ce, Ae) => {
|
|
2920
|
-
|
|
2920
|
+
M.addGroupToUpdate({ id: B, currentRole: ce, newRole: Ae });
|
|
2921
2921
|
}, pe = N.filter(
|
|
2922
2922
|
(B) => x.some((ce) => ce.id === B.id)
|
|
2923
2923
|
), Fe = $e.useMemo(() => w !== "groups" ? [] : N.filter((B) => B.type !== "TENANT_GROUP" ? !1 : B.name.toLowerCase().includes(c.toLowerCase()) || B.description && B.description.toLowerCase().includes(c.toLowerCase())), [N, w, c]), be = $e.useMemo(() => {
|
|
2924
2924
|
var ce, Ae;
|
|
2925
|
-
const B = ((ce =
|
|
2925
|
+
const B = ((ce = T == null ? void 0 : T.shares) == null ? void 0 : ce.specificGroups) || ((Ae = T == null ? void 0 : T.shares) == null ? void 0 : Ae.groups) || [];
|
|
2926
2926
|
return !B || B.length === 0 ? [] : B.filter(
|
|
2927
2927
|
(Le) => {
|
|
2928
2928
|
const we = N.find((ze) => ze.id === Le.groupId);
|
|
2929
2929
|
return (we == null ? void 0 : we.type) === "TENANT_GROUP";
|
|
2930
2930
|
}
|
|
2931
2931
|
);
|
|
2932
|
-
}, [
|
|
2932
|
+
}, [T, N]), He = E || F || w === "groups" && S, Pe = P || R, se = () => (s == null ? void 0 : s.type) === "tenant" || w === "all_tenants" || w === "groups" ? !0 : I && (w === "specific_tenant_users" || w === "all_tenant_users");
|
|
2933
2933
|
return /* @__PURE__ */ a(J, { children: [
|
|
2934
2934
|
Pe && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
|
|
2935
2935
|
/* @__PURE__ */ e(jn, { className: "mx-auto mb-2 h-8 w-8 text-destructive" }),
|
|
@@ -3034,7 +3034,7 @@ function qr({
|
|
|
3034
3034
|
ei,
|
|
3035
3035
|
{
|
|
3036
3036
|
usersToRemove: h,
|
|
3037
|
-
allUsers:
|
|
3037
|
+
allUsers: D,
|
|
3038
3038
|
onRemove: $
|
|
3039
3039
|
}
|
|
3040
3040
|
),
|
|
@@ -3042,7 +3042,7 @@ function qr({
|
|
|
3042
3042
|
ti,
|
|
3043
3043
|
{
|
|
3044
3044
|
usersToUpdate: p,
|
|
3045
|
-
allUsers:
|
|
3045
|
+
allUsers: D,
|
|
3046
3046
|
onRemove: ne,
|
|
3047
3047
|
getRoleOptions: yt
|
|
3048
3048
|
}
|
|
@@ -3050,14 +3050,14 @@ function qr({
|
|
|
3050
3050
|
/* @__PURE__ */ e(
|
|
3051
3051
|
ni,
|
|
3052
3052
|
{
|
|
3053
|
-
existingShares:
|
|
3053
|
+
existingShares: T,
|
|
3054
3054
|
isInitialLoading: !!He,
|
|
3055
3055
|
isSearching: !1,
|
|
3056
3056
|
resource: t,
|
|
3057
3057
|
onShare: () => {
|
|
3058
3058
|
},
|
|
3059
3059
|
getRoleOptions: yt,
|
|
3060
|
-
allUsers:
|
|
3060
|
+
allUsers: D,
|
|
3061
3061
|
currentUser: s,
|
|
3062
3062
|
handleUserToggle: j,
|
|
3063
3063
|
handleUserRoleChange: K,
|
|
@@ -3153,11 +3153,11 @@ function Lu({
|
|
|
3153
3153
|
var P, F;
|
|
3154
3154
|
const { searchQuery: c, setSearchQuery: u } = Ln(), d = ja(), m = Ba(), h = Ua(), p = ba(), [x, y] = $e.useState("org_groups"), [f, v] = $e.useState(""), { data: g, isLoading: b } = ol({
|
|
3155
3155
|
enabled: (s == null ? void 0 : s.type) === "organization" && x === "tenant_groups"
|
|
3156
|
-
}), I = Array.isArray(g) ? g : (g == null ? void 0 : g.tenants) || [],
|
|
3156
|
+
}), I = Array.isArray(g) ? g : (g == null ? void 0 : g.tenants) || [], M = () => {
|
|
3157
3157
|
if ((s == null ? void 0 : s.type) === "organization") return "organization";
|
|
3158
3158
|
if ((s == null ? void 0 : s.type) === "tenant") return "tenant";
|
|
3159
3159
|
}, { groups: C, isLoading: A } = cl(
|
|
3160
|
-
|
|
3160
|
+
M(),
|
|
3161
3161
|
x === "tenant_groups" && (s == null ? void 0 : s.type) === "organization" ? f : s == null ? void 0 : s.tenantId
|
|
3162
3162
|
), { existingShares: N } = La({
|
|
3163
3163
|
debouncedSearchQuery: "",
|
|
@@ -3179,9 +3179,9 @@ function Lu({
|
|
|
3179
3179
|
($) => $.groupId === R
|
|
3180
3180
|
);
|
|
3181
3181
|
j ? p.removeSelectedGroup(R) : K ? p.removeGroupFromRemove(R) : Q || p.addSelectedGroup({ id: R, role: "VIEWER" });
|
|
3182
|
-
},
|
|
3182
|
+
}, D = (R, j) => {
|
|
3183
3183
|
p.updateSelectedGroupRole(R, j);
|
|
3184
|
-
},
|
|
3184
|
+
}, T = (R) => {
|
|
3185
3185
|
p.addGroupToRemove(R), p.removeSelectedGroup(R);
|
|
3186
3186
|
}, E = (R, j, K) => {
|
|
3187
3187
|
p.addGroupToUpdate({ id: R, currentRole: j, newRole: K });
|
|
@@ -3252,7 +3252,7 @@ function Lu({
|
|
|
3252
3252
|
selectedGroups: d,
|
|
3253
3253
|
groupObjects: k,
|
|
3254
3254
|
onRemove: z,
|
|
3255
|
-
onRoleChange:
|
|
3255
|
+
onRoleChange: D,
|
|
3256
3256
|
getRoleOptions: yt
|
|
3257
3257
|
}
|
|
3258
3258
|
),
|
|
@@ -3282,8 +3282,8 @@ function Lu({
|
|
|
3282
3282
|
getRoleOptions: yt,
|
|
3283
3283
|
currentUser: s,
|
|
3284
3284
|
handleGroupToggle: z,
|
|
3285
|
-
handleGroupRoleChange:
|
|
3286
|
-
handleRemoveAccess:
|
|
3285
|
+
handleGroupRoleChange: D,
|
|
3286
|
+
handleRemoveAccess: T,
|
|
3287
3287
|
handleUpdateAccess: E
|
|
3288
3288
|
}
|
|
3289
3289
|
)
|
|
@@ -3291,7 +3291,7 @@ function Lu({
|
|
|
3291
3291
|
] }) : null;
|
|
3292
3292
|
}
|
|
3293
3293
|
const oi = () => {
|
|
3294
|
-
const t = dl(), n =
|
|
3294
|
+
const t = dl(), n = ia(), s = _a(), r = Na(), l = Va(), i = ja(), o = Ba(), c = Ua(), u = cs(), d = zn(), m = Vn(), h = _s(), p = ul(), x = Ve(() => () => Xi({
|
|
3295
3295
|
currentContext: t,
|
|
3296
3296
|
currentMode: n,
|
|
3297
3297
|
selectedUsers: s,
|
|
@@ -3374,50 +3374,50 @@ function Kr({
|
|
|
3374
3374
|
currentAllUsersShare: u,
|
|
3375
3375
|
onRemoveAccess: d
|
|
3376
3376
|
}) {
|
|
3377
|
-
const m = _a(), h = Na(), p = Va(), x = cs(), y = zn(), f = Vn(), v = _s(), { buildShareData: g, validateShareData: b, isCurrentStateValid: I } = oi(),
|
|
3378
|
-
var L, k, z,
|
|
3379
|
-
if (
|
|
3377
|
+
const m = _a(), h = Na(), p = Va(), x = cs(), y = zn(), f = Vn(), v = _s(), { buildShareData: g, validateShareData: b, isCurrentStateValid: I } = oi(), M = s || r || l, C = () => {
|
|
3378
|
+
var L, k, z, D;
|
|
3379
|
+
if (M) return "Updating...";
|
|
3380
3380
|
if (c === "specific_users") {
|
|
3381
3381
|
if (m.length === 0 && h.length === 0 && p.length === 0)
|
|
3382
3382
|
return "Select users to share with";
|
|
3383
|
-
const
|
|
3384
|
-
return
|
|
3383
|
+
const T = m.length + h.length + p.length;
|
|
3384
|
+
return T === 0 ? "Select users to share with" : m.length > 0 && h.length > 0 ? `Update access for ${T} user${T !== 1 ? "s" : ""}` : h.length > 0 && m.length === 0 && p.length === 0 ? `Remove access for ${h.length} user${h.length !== 1 ? "s" : ""}` : m.length > 0 && h.length === 0 && p.length === 0 ? `Share with ${m.length} user${m.length !== 1 ? "s" : ""}` : p.length > 0 && m.length === 0 && h.length === 0 ? `Update access for ${p.length} user${p.length !== 1 ? "s" : ""}` : `Update access for ${T} user${T !== 1 ? "s" : ""}`;
|
|
3385
3385
|
} else if (c === "all_users") {
|
|
3386
3386
|
if (!u || u.role === void 0)
|
|
3387
3387
|
return "Share with All Users";
|
|
3388
|
-
const
|
|
3389
|
-
return y ===
|
|
3388
|
+
const T = u.role;
|
|
3389
|
+
return y === T ? "Remove Access" : "Update Access";
|
|
3390
3390
|
} else if (c === "all_tenants") {
|
|
3391
|
-
const
|
|
3392
|
-
if (!
|
|
3391
|
+
const T = (k = (L = n == null ? void 0 : n.shares) == null ? void 0 : L.allTenantsOnly) == null ? void 0 : k[0];
|
|
3392
|
+
if (!T || T.role === void 0)
|
|
3393
3393
|
return "Share with All Tenants";
|
|
3394
|
-
const E =
|
|
3394
|
+
const E = T.role;
|
|
3395
3395
|
return f === E ? "Remove Access" : "Update Access";
|
|
3396
3396
|
} else if (c === "all_tenant_users") {
|
|
3397
|
-
const
|
|
3398
|
-
if (!
|
|
3397
|
+
const T = (D = (z = n == null ? void 0 : n.shares) == null ? void 0 : z.tenantWide) == null ? void 0 : D[0];
|
|
3398
|
+
if (!T || T.role === void 0)
|
|
3399
3399
|
return "Share with All Tenant Users";
|
|
3400
|
-
const E =
|
|
3400
|
+
const E = T.role;
|
|
3401
3401
|
return v === E ? "Remove Access" : "Update Access";
|
|
3402
3402
|
} else if (c === "specific_tenant_users") {
|
|
3403
3403
|
if (m.length === 0 && h.length === 0 && p.length === 0)
|
|
3404
3404
|
return "Select users to share with";
|
|
3405
|
-
const
|
|
3406
|
-
return
|
|
3405
|
+
const T = m.length + h.length + p.length;
|
|
3406
|
+
return T === 0 ? "Select users to share with" : m.length > 0 && h.length > 0 ? `Update access for ${T} user${T !== 1 ? "s" : ""}` : h.length > 0 && m.length === 0 && p.length === 0 ? `Remove access for ${h.length} user${h.length !== 1 ? "s" : ""}` : m.length > 0 && h.length === 0 && p.length === 0 ? `Share with ${m.length} user${m.length !== 1 ? "s" : ""}` : p.length > 0 && m.length === 0 && h.length === 0 ? `Update access for ${p.length} user${p.length !== 1 ? "s" : ""}` : `Update access for ${T} user${T !== 1 ? "s" : ""}`;
|
|
3407
3407
|
}
|
|
3408
3408
|
return "Share";
|
|
3409
|
-
}, A = () =>
|
|
3409
|
+
}, A = () => M || !t || c === "all_tenant_users" && !x || c === "specific_tenant_users" && !x ? !0 : !I, N = () => {
|
|
3410
3410
|
const L = g();
|
|
3411
3411
|
L && b(L) && i(L);
|
|
3412
3412
|
}, S = () => {
|
|
3413
|
-
var L, k, z,
|
|
3413
|
+
var L, k, z, D;
|
|
3414
3414
|
if (c === "all_users")
|
|
3415
3415
|
if (!u || u.role === void 0) {
|
|
3416
|
-
const
|
|
3417
|
-
|
|
3416
|
+
const T = g();
|
|
3417
|
+
T && b(T) && i(T);
|
|
3418
3418
|
} else {
|
|
3419
|
-
const
|
|
3420
|
-
if (y ===
|
|
3419
|
+
const T = u.role;
|
|
3420
|
+
if (y === T)
|
|
3421
3421
|
d == null || d();
|
|
3422
3422
|
else {
|
|
3423
3423
|
const P = g();
|
|
@@ -3431,12 +3431,12 @@ function Kr({
|
|
|
3431
3431
|
}
|
|
3432
3432
|
}
|
|
3433
3433
|
else if (c === "all_tenants") {
|
|
3434
|
-
const
|
|
3435
|
-
if (!
|
|
3434
|
+
const T = (k = (L = n == null ? void 0 : n.shares) == null ? void 0 : L.allTenantsOnly) == null ? void 0 : k[0];
|
|
3435
|
+
if (!T || T.role === void 0) {
|
|
3436
3436
|
const E = g();
|
|
3437
3437
|
E && b(E) && i(E);
|
|
3438
3438
|
} else {
|
|
3439
|
-
const E =
|
|
3439
|
+
const E = T.role;
|
|
3440
3440
|
if (f === E)
|
|
3441
3441
|
d == null || d();
|
|
3442
3442
|
else {
|
|
@@ -3451,12 +3451,12 @@ function Kr({
|
|
|
3451
3451
|
}
|
|
3452
3452
|
}
|
|
3453
3453
|
} else if (c === "all_tenant_users") {
|
|
3454
|
-
const
|
|
3455
|
-
if (!
|
|
3454
|
+
const T = (D = (z = n == null ? void 0 : n.shares) == null ? void 0 : z.tenantWide) == null ? void 0 : D[0];
|
|
3455
|
+
if (!T || T.role === void 0) {
|
|
3456
3456
|
const E = g();
|
|
3457
3457
|
E && b(E) && i(E);
|
|
3458
3458
|
} else {
|
|
3459
|
-
const E =
|
|
3459
|
+
const E = T.role;
|
|
3460
3460
|
if (v === E)
|
|
3461
3461
|
d == null || d();
|
|
3462
3462
|
else {
|
|
@@ -3472,29 +3472,29 @@ function Kr({
|
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
3474
3474
|
}, w = () => {
|
|
3475
|
-
var L, k, z,
|
|
3475
|
+
var L, k, z, D;
|
|
3476
3476
|
if (c === "all_users") {
|
|
3477
3477
|
if (!u || u.role === void 0)
|
|
3478
3478
|
return "default";
|
|
3479
|
-
const
|
|
3480
|
-
return y ===
|
|
3479
|
+
const T = u.role;
|
|
3480
|
+
return y === T ? "destructive" : "default";
|
|
3481
3481
|
} else if (c === "all_tenants") {
|
|
3482
|
-
const
|
|
3483
|
-
if (!
|
|
3482
|
+
const T = (k = (L = n == null ? void 0 : n.shares) == null ? void 0 : L.allTenantsOnly) == null ? void 0 : k[0];
|
|
3483
|
+
if (!T || T.role === void 0)
|
|
3484
3484
|
return "default";
|
|
3485
|
-
const E =
|
|
3485
|
+
const E = T.role;
|
|
3486
3486
|
return f === E ? "destructive" : "default";
|
|
3487
3487
|
} else if (c === "all_tenant_users") {
|
|
3488
|
-
const
|
|
3489
|
-
if (!
|
|
3488
|
+
const T = (D = (z = n == null ? void 0 : n.shares) == null ? void 0 : z.tenantWide) == null ? void 0 : D[0];
|
|
3489
|
+
if (!T || T.role === void 0)
|
|
3490
3490
|
return "default";
|
|
3491
|
-
const E =
|
|
3491
|
+
const E = T.role;
|
|
3492
3492
|
return v === E ? "destructive" : "default";
|
|
3493
3493
|
}
|
|
3494
3494
|
return "default";
|
|
3495
3495
|
};
|
|
3496
3496
|
return /* @__PURE__ */ a(Rt, { children: [
|
|
3497
|
-
/* @__PURE__ */ a(_, { variant: "outline", onClick: o, disabled:
|
|
3497
|
+
/* @__PURE__ */ a(_, { variant: "outline", onClick: o, disabled: M, children: [
|
|
3498
3498
|
/* @__PURE__ */ e(De, { className: "mr-2 h-4 w-4" }),
|
|
3499
3499
|
"Close"
|
|
3500
3500
|
] }),
|
|
@@ -3502,14 +3502,14 @@ function Kr({
|
|
|
3502
3502
|
_,
|
|
3503
3503
|
{
|
|
3504
3504
|
onClick: N,
|
|
3505
|
-
disabled: !t ||
|
|
3505
|
+
disabled: !t || M,
|
|
3506
3506
|
variant: "default",
|
|
3507
3507
|
children: [
|
|
3508
|
-
|
|
3508
|
+
M ? /* @__PURE__ */ a(J, { children: [
|
|
3509
3509
|
/* @__PURE__ */ e(Ee, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
3510
3510
|
"Updating..."
|
|
3511
3511
|
] }) : /* @__PURE__ */ e(Ta, { className: "mr-2 h-4 w-4" }),
|
|
3512
|
-
!
|
|
3512
|
+
!M && C()
|
|
3513
3513
|
]
|
|
3514
3514
|
}
|
|
3515
3515
|
) }),
|
|
@@ -3520,11 +3520,11 @@ function Kr({
|
|
|
3520
3520
|
disabled: A(),
|
|
3521
3521
|
variant: w(),
|
|
3522
3522
|
children: [
|
|
3523
|
-
|
|
3523
|
+
M ? /* @__PURE__ */ a(J, { children: [
|
|
3524
3524
|
/* @__PURE__ */ e(Ee, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
3525
3525
|
"Updating..."
|
|
3526
3526
|
] }) : /* @__PURE__ */ e(je, { className: "mr-2 h-4 w-4" }),
|
|
3527
|
-
!
|
|
3527
|
+
!M && C()
|
|
3528
3528
|
]
|
|
3529
3529
|
}
|
|
3530
3530
|
)
|
|
@@ -3541,7 +3541,7 @@ function zu({
|
|
|
3541
3541
|
currentAllUsersShare: c
|
|
3542
3542
|
}) {
|
|
3543
3543
|
const u = _a(), d = Na(), m = Va(), h = ja(), p = Ba(), x = Ua();
|
|
3544
|
-
|
|
3544
|
+
ia(), dl();
|
|
3545
3545
|
const y = _s();
|
|
3546
3546
|
cs();
|
|
3547
3547
|
const { buildShareData: f, validateShareData: v, isCurrentStateValid: g } = oi(), b = n || s || r, I = () => {
|
|
@@ -3563,7 +3563,7 @@ function zu({
|
|
|
3563
3563
|
return y === w ? "Remove Access" : "Update Access";
|
|
3564
3564
|
}
|
|
3565
3565
|
return "Share";
|
|
3566
|
-
},
|
|
3566
|
+
}, M = () => b || !t ? !0 : !g, C = () => {
|
|
3567
3567
|
const w = f();
|
|
3568
3568
|
w && v(w) && l(w);
|
|
3569
3569
|
}, A = () => {
|
|
@@ -3635,7 +3635,7 @@ function zu({
|
|
|
3635
3635
|
_,
|
|
3636
3636
|
{
|
|
3637
3637
|
onClick: N,
|
|
3638
|
-
disabled:
|
|
3638
|
+
disabled: M(),
|
|
3639
3639
|
variant: S(),
|
|
3640
3640
|
children: [
|
|
3641
3641
|
b ? /* @__PURE__ */ a(J, { children: [
|
|
@@ -3663,7 +3663,7 @@ function _u({
|
|
|
3663
3663
|
onRemoveAccess: d
|
|
3664
3664
|
}) {
|
|
3665
3665
|
const m = ja(), h = Ba(), p = Ua();
|
|
3666
|
-
ul(),
|
|
3666
|
+
ul(), ia();
|
|
3667
3667
|
const x = () => {
|
|
3668
3668
|
i({
|
|
3669
3669
|
context: "group-share",
|
|
@@ -4061,7 +4061,7 @@ function ju(t, n, s, r) {
|
|
|
4061
4061
|
t.map((v) => {
|
|
4062
4062
|
var b, I;
|
|
4063
4063
|
const g = (I = (b = c == null ? void 0 : c.shares) == null ? void 0 : b.specificTenantUsers) == null ? void 0 : I.find(
|
|
4064
|
-
(
|
|
4064
|
+
(M) => M.tenantUserId === v
|
|
4065
4065
|
);
|
|
4066
4066
|
return {
|
|
4067
4067
|
scope: "specific_tenant_user",
|
|
@@ -4138,7 +4138,7 @@ function ju(t, n, s, r) {
|
|
|
4138
4138
|
}
|
|
4139
4139
|
}
|
|
4140
4140
|
function Bu(t, n, s) {
|
|
4141
|
-
const r = ba(), l = Na(), i = Pn(), o =
|
|
4141
|
+
const r = ba(), l = Na(), i = Pn(), o = ia(), { currentUser: c } = Ht(), { existingShares: u } = La({
|
|
4142
4142
|
debouncedSearchQuery: "",
|
|
4143
4143
|
resourceId: t || "",
|
|
4144
4144
|
resourceType: Kt.DASHBOARD,
|
|
@@ -4208,8 +4208,8 @@ function xr({
|
|
|
4208
4208
|
onShareSuccess: r,
|
|
4209
4209
|
onRemoveSuccess: l
|
|
4210
4210
|
}) {
|
|
4211
|
-
var
|
|
4212
|
-
const { currentUser: i } =
|
|
4211
|
+
var D, T, E, P, F, R, j, K;
|
|
4212
|
+
const { currentUser: i } = Ht(), [o, c] = $e.useState("specific_users"), [u, d] = $e.useState("specific_users"), [m, h] = $e.useState("specific_groups"), p = ba(), x = Pn(), y = ia(), f = to(), v = ao(), { handleShareSubmit: g, handleRemoveAccess: b } = Bu(
|
|
4213
4213
|
t.id,
|
|
4214
4214
|
(Q, $) => {
|
|
4215
4215
|
f.mutate(Q, {
|
|
@@ -4229,7 +4229,7 @@ function xr({
|
|
|
4229
4229
|
}
|
|
4230
4230
|
});
|
|
4231
4231
|
}
|
|
4232
|
-
), I = f.isPending,
|
|
4232
|
+
), I = f.isPending, M = v.isPending, C = f.isPending, { existingShares: A } = La({
|
|
4233
4233
|
debouncedSearchQuery: "",
|
|
4234
4234
|
resourceId: (t == null ? void 0 : t.id) || "",
|
|
4235
4235
|
resourceType: n,
|
|
@@ -4239,7 +4239,7 @@ function xr({
|
|
|
4239
4239
|
resourceId: (t == null ? void 0 : t.id) || "",
|
|
4240
4240
|
resourceType: n,
|
|
4241
4241
|
userType: "organization"
|
|
4242
|
-
}), S = (
|
|
4242
|
+
}), S = (T = (D = A == null ? void 0 : A.shares) == null ? void 0 : D.tenantWide) == null ? void 0 : T[0], w = (P = (E = N == null ? void 0 : N.shares) == null ? void 0 : E.orgUsersOnly) == null ? void 0 : P[0], L = () => {
|
|
4243
4243
|
if (x === "org")
|
|
4244
4244
|
return u;
|
|
4245
4245
|
switch (y) {
|
|
@@ -4291,7 +4291,7 @@ function xr({
|
|
|
4291
4291
|
onShareTabTypeChange: d,
|
|
4292
4292
|
isSharing: I,
|
|
4293
4293
|
isUpdating: C,
|
|
4294
|
-
isRemoving:
|
|
4294
|
+
isRemoving: M
|
|
4295
4295
|
}
|
|
4296
4296
|
) }) }),
|
|
4297
4297
|
/* @__PURE__ */ e(
|
|
@@ -4310,7 +4310,7 @@ function xr({
|
|
|
4310
4310
|
),
|
|
4311
4311
|
isSharing: I,
|
|
4312
4312
|
isUpdating: C,
|
|
4313
|
-
isRemoving:
|
|
4313
|
+
isRemoving: M
|
|
4314
4314
|
}
|
|
4315
4315
|
) })
|
|
4316
4316
|
}
|
|
@@ -4329,7 +4329,7 @@ function xr({
|
|
|
4329
4329
|
onShareTabTypeChange: h,
|
|
4330
4330
|
isSharing: I,
|
|
4331
4331
|
isUpdating: C,
|
|
4332
|
-
isRemoving:
|
|
4332
|
+
isRemoving: M
|
|
4333
4333
|
}
|
|
4334
4334
|
) })
|
|
4335
4335
|
}
|
|
@@ -4348,7 +4348,7 @@ function xr({
|
|
|
4348
4348
|
onShareTabTypeChange: (Q) => c(Q),
|
|
4349
4349
|
isSharing: I,
|
|
4350
4350
|
isUpdating: C,
|
|
4351
|
-
isRemoving:
|
|
4351
|
+
isRemoving: M
|
|
4352
4352
|
}
|
|
4353
4353
|
) }) })
|
|
4354
4354
|
),
|
|
@@ -4360,7 +4360,7 @@ function xr({
|
|
|
4360
4360
|
resource: t,
|
|
4361
4361
|
existingShares: N,
|
|
4362
4362
|
isSharing: I,
|
|
4363
|
-
isRemoving:
|
|
4363
|
+
isRemoving: M,
|
|
4364
4364
|
isUpdating: C,
|
|
4365
4365
|
onShare: g,
|
|
4366
4366
|
onClose: s,
|
|
@@ -4376,7 +4376,7 @@ function xr({
|
|
|
4376
4376
|
resource: t,
|
|
4377
4377
|
existingShares: A,
|
|
4378
4378
|
isSharing: I,
|
|
4379
|
-
isRemoving:
|
|
4379
|
+
isRemoving: M,
|
|
4380
4380
|
isUpdating: C,
|
|
4381
4381
|
onShare: g,
|
|
4382
4382
|
onClose: s,
|
|
@@ -4393,7 +4393,7 @@ function xr({
|
|
|
4393
4393
|
resource: t,
|
|
4394
4394
|
existingShares: N,
|
|
4395
4395
|
isSharing: I,
|
|
4396
|
-
isRemoving:
|
|
4396
|
+
isRemoving: M,
|
|
4397
4397
|
isUpdating: C,
|
|
4398
4398
|
onShare: g,
|
|
4399
4399
|
onClose: s,
|
|
@@ -4410,7 +4410,7 @@ function xr({
|
|
|
4410
4410
|
{
|
|
4411
4411
|
resource: t,
|
|
4412
4412
|
isSharing: I,
|
|
4413
|
-
isRemoving:
|
|
4413
|
+
isRemoving: M,
|
|
4414
4414
|
isUpdating: C,
|
|
4415
4415
|
onShare: g,
|
|
4416
4416
|
onClose: s,
|
|
@@ -4676,25 +4676,25 @@ function Zu({
|
|
|
4676
4676
|
tenantId: s.tenantId || void 0,
|
|
4677
4677
|
active: !0,
|
|
4678
4678
|
limit: 100
|
|
4679
|
-
}), b = Ju(), I = Hu(),
|
|
4679
|
+
}), b = Ju(), I = Hu(), M = (p == null ? void 0 : p.members) || [], C = Ve(() => new Set(M.map((D) => D.userId)), [M]), A = Ve(() => v.filter((D) => !C.has(D.id)), [v, C]), N = Ve(() => {
|
|
4680
4680
|
if (!o) return A;
|
|
4681
|
-
const
|
|
4681
|
+
const D = o.toLowerCase();
|
|
4682
4682
|
return A.filter(
|
|
4683
|
-
(
|
|
4683
|
+
(T) => {
|
|
4684
4684
|
var E, P;
|
|
4685
|
-
return ((E =
|
|
4685
|
+
return ((E = T.name) == null ? void 0 : E.toLowerCase().includes(D)) || ((P = T.email) == null ? void 0 : P.toLowerCase().includes(D));
|
|
4686
4686
|
}
|
|
4687
4687
|
);
|
|
4688
4688
|
}, [A, o]), S = Ve(() => {
|
|
4689
|
-
if (!o) return
|
|
4690
|
-
const
|
|
4691
|
-
return
|
|
4692
|
-
(
|
|
4689
|
+
if (!o) return M;
|
|
4690
|
+
const D = o.toLowerCase();
|
|
4691
|
+
return M.filter(
|
|
4692
|
+
(T) => {
|
|
4693
4693
|
var E, P, F, R;
|
|
4694
|
-
return ((P = (E =
|
|
4694
|
+
return ((P = (E = T.user) == null ? void 0 : E.name) == null ? void 0 : P.toLowerCase().includes(D)) || ((R = (F = T.user) == null ? void 0 : F.email) == null ? void 0 : R.toLowerCase().includes(D));
|
|
4695
4695
|
}
|
|
4696
4696
|
);
|
|
4697
|
-
}, [
|
|
4697
|
+
}, [M, o]), w = async () => {
|
|
4698
4698
|
if (u.length !== 0)
|
|
4699
4699
|
try {
|
|
4700
4700
|
await b.mutateAsync({
|
|
@@ -4704,8 +4704,8 @@ function Zu({
|
|
|
4704
4704
|
userType: f === "tenant" ? "tenant" : "org"
|
|
4705
4705
|
}
|
|
4706
4706
|
}), d([]), i("members"), y(), r == null || r();
|
|
4707
|
-
} catch (
|
|
4708
|
-
console.error("Failed to add members:",
|
|
4707
|
+
} catch (D) {
|
|
4708
|
+
console.error("Failed to add members:", D);
|
|
4709
4709
|
}
|
|
4710
4710
|
}, L = async () => {
|
|
4711
4711
|
if (m.length !== 0)
|
|
@@ -4716,25 +4716,25 @@ function Zu({
|
|
|
4716
4716
|
userIds: m
|
|
4717
4717
|
}
|
|
4718
4718
|
}), h([]), y(), r == null || r();
|
|
4719
|
-
} catch (
|
|
4720
|
-
console.error("Failed to remove members:",
|
|
4719
|
+
} catch (D) {
|
|
4720
|
+
console.error("Failed to remove members:", D);
|
|
4721
4721
|
}
|
|
4722
|
-
}, k = (
|
|
4722
|
+
}, k = (D) => {
|
|
4723
4723
|
d(
|
|
4724
|
-
(
|
|
4724
|
+
(T) => T.includes(D) ? T.filter((E) => E !== D) : [...T, D]
|
|
4725
4725
|
);
|
|
4726
|
-
}, z = (
|
|
4726
|
+
}, z = (D) => {
|
|
4727
4727
|
h(
|
|
4728
|
-
(
|
|
4728
|
+
(T) => T.includes(D) ? T.filter((E) => E !== D) : [...T, D]
|
|
4729
4729
|
);
|
|
4730
4730
|
};
|
|
4731
4731
|
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(rt, { open: t, onOpenChange: n, children: /* @__PURE__ */ a(lt, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
4732
4732
|
/* @__PURE__ */ a(it, { children: [
|
|
4733
4733
|
/* @__PURE__ */ e(ot, { children: s.name }),
|
|
4734
4734
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ a("p", { className: "text-sm text-muted-foreground", children: [
|
|
4735
|
-
|
|
4735
|
+
M.length,
|
|
4736
4736
|
" ",
|
|
4737
|
-
|
|
4737
|
+
M.length === 1 ? "member" : "members"
|
|
4738
4738
|
] }) }),
|
|
4739
4739
|
/* @__PURE__ */ a("p", { id: "group-members-description", className: "sr-only", children: [
|
|
4740
4740
|
"Add or remove members from the ",
|
|
@@ -4742,8 +4742,8 @@ function Zu({
|
|
|
4742
4742
|
" group"
|
|
4743
4743
|
] })
|
|
4744
4744
|
] }),
|
|
4745
|
-
/* @__PURE__ */ a(Ct, { value: l, onValueChange: (
|
|
4746
|
-
i(
|
|
4745
|
+
/* @__PURE__ */ a(Ct, { value: l, onValueChange: (D) => {
|
|
4746
|
+
i(D), c(""), h([]);
|
|
4747
4747
|
}, className: "mt-4", children: [
|
|
4748
4748
|
/* @__PURE__ */ a(wt, { className: "grid w-full grid-cols-2", children: [
|
|
4749
4749
|
/* @__PURE__ */ e(Re, { value: "members", children: "Current Members" }),
|
|
@@ -4757,23 +4757,23 @@ function Zu({
|
|
|
4757
4757
|
{
|
|
4758
4758
|
placeholder: "Search members...",
|
|
4759
4759
|
value: o,
|
|
4760
|
-
onChange: (
|
|
4760
|
+
onChange: (D) => c(D.target.value),
|
|
4761
4761
|
className: "pl-10"
|
|
4762
4762
|
}
|
|
4763
4763
|
)
|
|
4764
4764
|
] }),
|
|
4765
|
-
/* @__PURE__ */ e(st, { className: m.length > 0 ? "h-[300px]" : "h-[350px]", children: x ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((
|
|
4765
|
+
/* @__PURE__ */ e(st, { className: m.length > 0 ? "h-[300px]" : "h-[350px]", children: x ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Aa, { className: "h-16 w-full" }, D)) }) : S.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
4766
4766
|
/* @__PURE__ */ e(je, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
4767
4767
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: o ? "No members found" : "No members yet" }),
|
|
4768
4768
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: o ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
|
|
4769
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: S.map((
|
|
4769
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: S.map((D) => /* @__PURE__ */ e(
|
|
4770
4770
|
Xu,
|
|
4771
4771
|
{
|
|
4772
|
-
member:
|
|
4773
|
-
selected: m.includes(
|
|
4774
|
-
onToggle: () => z(
|
|
4772
|
+
member: D,
|
|
4773
|
+
selected: m.includes(D.userId),
|
|
4774
|
+
onToggle: () => z(D.userId)
|
|
4775
4775
|
},
|
|
4776
|
-
|
|
4776
|
+
D.id
|
|
4777
4777
|
)) }) }),
|
|
4778
4778
|
m.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
4779
4779
|
/* @__PURE__ */ a("span", { className: "text-sm text-muted-foreground", children: [
|
|
@@ -4808,23 +4808,23 @@ function Zu({
|
|
|
4808
4808
|
{
|
|
4809
4809
|
placeholder: "Search users to add...",
|
|
4810
4810
|
value: o,
|
|
4811
|
-
onChange: (
|
|
4811
|
+
onChange: (D) => c(D.target.value),
|
|
4812
4812
|
className: "pl-10"
|
|
4813
4813
|
}
|
|
4814
4814
|
)
|
|
4815
4815
|
] }),
|
|
4816
|
-
/* @__PURE__ */ e(st, { className: "h-[300px]", children: g ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((
|
|
4816
|
+
/* @__PURE__ */ e(st, { className: "h-[300px]", children: g ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Aa, { className: "h-16 w-full" }, D)) }) : N.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
4817
4817
|
/* @__PURE__ */ e(As, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
4818
4818
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
4819
4819
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: o ? "Try a different search" : "All eligible users are already members" })
|
|
4820
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: N.map((
|
|
4820
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: N.map((D) => /* @__PURE__ */ e(
|
|
4821
4821
|
em,
|
|
4822
4822
|
{
|
|
4823
|
-
user:
|
|
4824
|
-
selected: u.includes(
|
|
4825
|
-
onToggle: () => k(
|
|
4823
|
+
user: D,
|
|
4824
|
+
selected: u.includes(D.id),
|
|
4825
|
+
onToggle: () => k(D.id)
|
|
4826
4826
|
},
|
|
4827
|
-
|
|
4827
|
+
D.id
|
|
4828
4828
|
)) }) }),
|
|
4829
4829
|
u.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
4830
4830
|
/* @__PURE__ */ a("span", { className: "text-sm text-muted-foreground", children: [
|
|
@@ -4902,11 +4902,11 @@ function tm({
|
|
|
4902
4902
|
open: t,
|
|
4903
4903
|
onOpenChange: n
|
|
4904
4904
|
}) {
|
|
4905
|
-
const [s, r] = V("groups"), [l, i] = V(""), [o, c] = V(null), [u, d] = V(!1), [m, h] = V(null), { tokenProps: p } = Xe(), { currentUser: x } =
|
|
4905
|
+
const [s, r] = V("groups"), [l, i] = V(""), [o, c] = V(null), [u, d] = V(!1), [m, h] = V(null), { tokenProps: p } = Xe(), { currentUser: x } = Ht(), y = Wu(), f = (x == null ? void 0 : x.type) === "tenant", v = p == null ? void 0 : p.tenantId, { groups: g, isLoading: b, refetch: I } = no({
|
|
4906
4906
|
type: f ? "TENANT_GROUP" : "all",
|
|
4907
4907
|
tenantId: f ? v : void 0,
|
|
4908
4908
|
includeMembers: !1
|
|
4909
|
-
}),
|
|
4909
|
+
}), M = g.filter(
|
|
4910
4910
|
(S) => {
|
|
4911
4911
|
var w;
|
|
4912
4912
|
return S.name.toLowerCase().includes(l.toLowerCase()) || ((w = S.description) == null ? void 0 : w.toLowerCase().includes(l.toLowerCase()));
|
|
@@ -4956,11 +4956,11 @@ function tm({
|
|
|
4956
4956
|
}
|
|
4957
4957
|
)
|
|
4958
4958
|
] }),
|
|
4959
|
-
/* @__PURE__ */ e(st, { className: "h-[400px]", children: b ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((S) => /* @__PURE__ */ e(Aa, { className: "h-24 w-full" }, S)) }) :
|
|
4959
|
+
/* @__PURE__ */ e(st, { className: "h-[400px]", children: b ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((S) => /* @__PURE__ */ e(Aa, { className: "h-24 w-full" }, S)) }) : M.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
4960
4960
|
/* @__PURE__ */ e(je, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
4961
4961
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
|
|
4962
4962
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
|
|
4963
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
4963
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: M.map((S) => /* @__PURE__ */ e(
|
|
4964
4964
|
am,
|
|
4965
4965
|
{
|
|
4966
4966
|
group: S,
|
|
@@ -5276,13 +5276,13 @@ function wa() {
|
|
|
5276
5276
|
} = ie(), {
|
|
5277
5277
|
setIsDashboardEditing: b,
|
|
5278
5278
|
setIsVisualEditing: I,
|
|
5279
|
-
setSelectedFrameId:
|
|
5279
|
+
setSelectedFrameId: M,
|
|
5280
5280
|
clearSelectedFrameId: C,
|
|
5281
5281
|
addFrame: A,
|
|
5282
5282
|
setIsDashboardPanelOpen: N
|
|
5283
5283
|
} = pt(), S = X((E) => E.selectedSheetId), w = X((E) => E.selectedFrameId), L = X((E) => E.dashboard), k = X((E) => E.filterValues), z = ro((r == null ? void 0 : r.id) || "", {
|
|
5284
5284
|
enabled: !!(r != null && r.id) && !!(t != null && t.accessToken)
|
|
5285
|
-
}),
|
|
5285
|
+
}), D = Se(
|
|
5286
5286
|
async (E) => {
|
|
5287
5287
|
try {
|
|
5288
5288
|
l(E), C();
|
|
@@ -5345,7 +5345,7 @@ function wa() {
|
|
|
5345
5345
|
w,
|
|
5346
5346
|
k
|
|
5347
5347
|
]
|
|
5348
|
-
),
|
|
5348
|
+
), T = Se(
|
|
5349
5349
|
async (E) => {
|
|
5350
5350
|
var P;
|
|
5351
5351
|
try {
|
|
@@ -5371,7 +5371,7 @@ function wa() {
|
|
|
5371
5371
|
visualId: E.id
|
|
5372
5372
|
// Link this frame to the library visual
|
|
5373
5373
|
};
|
|
5374
|
-
return A(S, Q, "end"), b(!0),
|
|
5374
|
+
return A(S, Q, "end"), b(!0), M(Q.id), N(!1), { success: !0, fromCache: R };
|
|
5375
5375
|
} catch (F) {
|
|
5376
5376
|
return console.error("Error adding visual:", F), { success: !1, error: "Failed to add visual to dashboard" };
|
|
5377
5377
|
}
|
|
@@ -5384,7 +5384,7 @@ function wa() {
|
|
|
5384
5384
|
S,
|
|
5385
5385
|
A,
|
|
5386
5386
|
b,
|
|
5387
|
-
|
|
5387
|
+
M,
|
|
5388
5388
|
N
|
|
5389
5389
|
]
|
|
5390
5390
|
);
|
|
@@ -5393,8 +5393,8 @@ function wa() {
|
|
|
5393
5393
|
isLoading: z.isLoading,
|
|
5394
5394
|
isError: z.isError,
|
|
5395
5395
|
error: z.error,
|
|
5396
|
-
handleEditLibraryVisual:
|
|
5397
|
-
handleAddLibraryVisual:
|
|
5396
|
+
handleEditLibraryVisual: D,
|
|
5397
|
+
handleAddLibraryVisual: T,
|
|
5398
5398
|
getUpdatedFrame: lm().getUpdatedFrame,
|
|
5399
5399
|
refetch: z.refetch
|
|
5400
5400
|
};
|
|
@@ -5749,15 +5749,15 @@ function Hs() {
|
|
|
5749
5749
|
);
|
|
5750
5750
|
}
|
|
5751
5751
|
function um() {
|
|
5752
|
-
const [t, n] = V(!1), [s, r] = V(!1), [l, i] = V(null), o = O((
|
|
5753
|
-
(
|
|
5754
|
-
), { getUpdatedFrame: h } = wa(), { selectVisual: p } = ds(), { addFrame: x, setSelectedFrameId: y, setIsVisualEditing: f } = pt(), v = !!(o != null && o.visualId), g = (u == null ? void 0 : u.title) || (c == null ? void 0 : c.title) || "Untitled Visual", b = io((
|
|
5755
|
-
if (
|
|
5756
|
-
if (p(
|
|
5752
|
+
const [t, n] = V(!1), [s, r] = V(!1), [l, i] = V(null), o = O((M) => M.frame), c = O((M) => M.card), u = Bs(), d = X((M) => M.selectedSheetId), m = X(
|
|
5753
|
+
(M) => M.actions.setIsDashboardPanelOpen
|
|
5754
|
+
), { getUpdatedFrame: h } = wa(), { selectVisual: p } = ds(), { addFrame: x, setSelectedFrameId: y, setIsVisualEditing: f } = pt(), v = !!(o != null && o.visualId), g = (u == null ? void 0 : u.title) || (c == null ? void 0 : c.title) || "Untitled Visual", b = io((M) => {
|
|
5755
|
+
if (M != null && M.id) {
|
|
5756
|
+
if (p(M), s && l && d) {
|
|
5757
5757
|
const C = {
|
|
5758
5758
|
...l,
|
|
5759
5759
|
id: It(),
|
|
5760
|
-
visualId:
|
|
5760
|
+
visualId: M.id
|
|
5761
5761
|
// Link to the newly created library visual
|
|
5762
5762
|
};
|
|
5763
5763
|
x(d, C, "end"), y(C.id), r(!1), i(null), f(!1);
|
|
@@ -5768,22 +5768,22 @@ function um() {
|
|
|
5768
5768
|
return {
|
|
5769
5769
|
saveAsDialogOpen: t,
|
|
5770
5770
|
setSaveAsDialogOpen: n,
|
|
5771
|
-
handleSaveAs: async (
|
|
5771
|
+
handleSaveAs: async (M) => {
|
|
5772
5772
|
if (!d) {
|
|
5773
5773
|
he.error("No sheet selected");
|
|
5774
5774
|
return;
|
|
5775
5775
|
}
|
|
5776
5776
|
const C = h();
|
|
5777
|
-
if (
|
|
5778
|
-
r(
|
|
5777
|
+
if (M.saveToLibrary) {
|
|
5778
|
+
r(M.saveToCurrentDashboard), i(C);
|
|
5779
5779
|
const A = {
|
|
5780
|
-
title:
|
|
5781
|
-
description:
|
|
5780
|
+
title: M.name,
|
|
5781
|
+
description: M.description,
|
|
5782
5782
|
frameObject: C,
|
|
5783
5783
|
isPrivate: !1
|
|
5784
5784
|
};
|
|
5785
5785
|
b.mutate(A);
|
|
5786
|
-
} else if (
|
|
5786
|
+
} else if (M.saveToCurrentDashboard) {
|
|
5787
5787
|
const A = {
|
|
5788
5788
|
...C,
|
|
5789
5789
|
id: It(),
|
|
@@ -5791,7 +5791,7 @@ function um() {
|
|
|
5791
5791
|
// Explicitly no visualId for local visuals
|
|
5792
5792
|
cards: C.cards.map((N) => ({
|
|
5793
5793
|
...N,
|
|
5794
|
-
title: N.id === c.id ?
|
|
5794
|
+
title: N.id === c.id ? M.name : N.title
|
|
5795
5795
|
}))
|
|
5796
5796
|
};
|
|
5797
5797
|
x(d, A, "end"), y(A.id), he.success("Visual saved to dashboard"), n(!1), f(!1);
|
|
@@ -5938,7 +5938,7 @@ function pm() {
|
|
|
5938
5938
|
(Z) => Z.isDashboardEditing
|
|
5939
5939
|
), [p, x] = V(!1), [y, f] = V(!1), [v, g] = V(!1), b = X((Z) => Z.isDashboardPanelOpen), I = X(
|
|
5940
5940
|
(Z) => Z.actions.setIsDashboardPanelOpen
|
|
5941
|
-
),
|
|
5941
|
+
), M = X((Z) => Z.filterValues), C = X((Z) => Z.isVisualEditing), A = O((Z) => Z.card), N = Dt(
|
|
5942
5942
|
(Z) => Z.selectedDashboard
|
|
5943
5943
|
), S = Dt(
|
|
5944
5944
|
(Z) => Z.initialDashboard
|
|
@@ -5946,13 +5946,13 @@ function pm() {
|
|
|
5946
5946
|
X((Z) => Z.selectedFrameId), O((Z) => Z.frame);
|
|
5947
5947
|
const L = N ? (Pe = N == null ? void 0 : N.permissions) == null ? void 0 : Pe.canEdit : (He = S == null ? void 0 : S.permissions) == null ? void 0 : He.canEdit, k = X((Z) => Z.showFilters), z = X(
|
|
5948
5948
|
(Z) => Z.showDashboardJSON
|
|
5949
|
-
),
|
|
5949
|
+
), D = X((Z) => Z.onSaveFunction), T = X(
|
|
5950
5950
|
(Z) => Z.actions.setShowFilters
|
|
5951
5951
|
), { setIsDashboardEditing: E, setShowDashboardJSON: P } = X(
|
|
5952
5952
|
(Z) => Z.actions
|
|
5953
5953
|
), { setInitialDashboard: F, clearSelectedDashboard: R } = Dt(
|
|
5954
5954
|
(Z) => Z.actions
|
|
5955
|
-
), { resources: j } = co(Kt.DASHBOARD), { currentUser: K } =
|
|
5955
|
+
), { resources: j } = co(Kt.DASHBOARD), { currentUser: K } = Ht(), Q = uo(K), $ = N || S, ne = $ ? {
|
|
5956
5956
|
id: $.id,
|
|
5957
5957
|
title: (m == null ? void 0 : m.title) || $.title || "Dashboard"
|
|
5958
5958
|
} : null, { handleAddNewFrame: ee } = mo(), [de, H] = V(!1), me = ho(Kt.DASHBOARD);
|
|
@@ -6000,13 +6000,13 @@ function pm() {
|
|
|
6000
6000
|
), B = JSON.stringify(Z), ce = {
|
|
6001
6001
|
...d,
|
|
6002
6002
|
template: B,
|
|
6003
|
-
filterValues:
|
|
6003
|
+
filterValues: M
|
|
6004
6004
|
};
|
|
6005
6005
|
await yn(
|
|
6006
6006
|
n.apiServiceUrl,
|
|
6007
6007
|
ce,
|
|
6008
6008
|
t == null ? void 0 : t.accessToken
|
|
6009
|
-
), he.success("Lens saved"),
|
|
6009
|
+
), he.success("Lens saved"), D == null || D(Z), x(!1);
|
|
6010
6010
|
}
|
|
6011
6011
|
const q = (d == null ? void 0 : d.name) || m.title, Fe = j && j.length > 0 && (n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail), be = N && !(n != null && n.dashboard_id) && !s;
|
|
6012
6012
|
return /* @__PURE__ */ a(
|
|
@@ -6085,7 +6085,7 @@ function pm() {
|
|
|
6085
6085
|
{
|
|
6086
6086
|
className: "h-7 p-2",
|
|
6087
6087
|
variant: "outline",
|
|
6088
|
-
onClick: () =>
|
|
6088
|
+
onClick: () => T(!0),
|
|
6089
6089
|
size: "sm",
|
|
6090
6090
|
children: /* @__PURE__ */ e(Os, { className: "h-4 w-4" })
|
|
6091
6091
|
}
|
|
@@ -6233,7 +6233,7 @@ function fm({
|
|
|
6233
6233
|
}
|
|
6234
6234
|
) }),
|
|
6235
6235
|
/* @__PURE__ */ e(
|
|
6236
|
-
|
|
6236
|
+
Qt,
|
|
6237
6237
|
{
|
|
6238
6238
|
className: "w-full p-0",
|
|
6239
6239
|
style: { minWidth: x },
|
|
@@ -6377,10 +6377,10 @@ function gm({ column: t }) {
|
|
|
6377
6377
|
(f) => f.selectedDatamodelId
|
|
6378
6378
|
), c = O((f) => f.sqlGen), { modelItems: u, connectionType: d } = jt(), m = O((f) => f.actions.setSqlGen), h = O((f) => f.actions.setCardSql), p = O((f) => f.actions.setRunSql);
|
|
6379
6379
|
function x(f, v) {
|
|
6380
|
-
var
|
|
6381
|
-
const g = gl(f, c, v), b = (
|
|
6380
|
+
var M;
|
|
6381
|
+
const g = gl(f, c, v), b = (M = u == null ? void 0 : u.find(
|
|
6382
6382
|
(C) => C.id === o
|
|
6383
|
-
)) == null ? void 0 :
|
|
6383
|
+
)) == null ? void 0 : M.name;
|
|
6384
6384
|
m(g);
|
|
6385
6385
|
const I = xl(
|
|
6386
6386
|
g,
|
|
@@ -6476,8 +6476,8 @@ function vm({ id: t, children: n, type: s = "column" }) {
|
|
|
6476
6476
|
data: { type: s }
|
|
6477
6477
|
// Tag as a column from the left-hand side
|
|
6478
6478
|
}), c = o ? {
|
|
6479
|
-
translate:
|
|
6480
|
-
transform:
|
|
6479
|
+
translate: na.Translate.toString(o),
|
|
6480
|
+
transform: na.Transform.toString(o)
|
|
6481
6481
|
} : void 0;
|
|
6482
6482
|
return /* @__PURE__ */ e(
|
|
6483
6483
|
"div",
|
|
@@ -6494,7 +6494,7 @@ function ym({
|
|
|
6494
6494
|
onClick: t,
|
|
6495
6495
|
column: n
|
|
6496
6496
|
}) {
|
|
6497
|
-
const s =
|
|
6497
|
+
const s = aa((m) => m.activeId), r = O(
|
|
6498
6498
|
(m) => {
|
|
6499
6499
|
var h;
|
|
6500
6500
|
return (h = m.card.queryConfig) == null ? void 0 : h.groupByColumns;
|
|
@@ -6570,30 +6570,30 @@ const an = {
|
|
|
6570
6570
|
id: "__placeholder__"
|
|
6571
6571
|
}, pa = "droppable-group-by", fa = "droppable-metrics", ga = "droppable-pivot-by", Ls = "sortable-group-by", Nn = "sortable-metrics", zs = "sortable-pivot-by", bn = "droppable-filters", Cn = "sortable-filters", yr = "sortable-order-by";
|
|
6572
6572
|
function Nm() {
|
|
6573
|
-
const t =
|
|
6574
|
-
(
|
|
6573
|
+
const t = aa((T) => T.insertIndex), n = O(
|
|
6574
|
+
(T) => {
|
|
6575
6575
|
var E;
|
|
6576
|
-
return ((E =
|
|
6576
|
+
return ((E = T.card.queryConfig) == null ? void 0 : E.groupByColumns) || [];
|
|
6577
6577
|
}
|
|
6578
6578
|
), s = O(
|
|
6579
|
-
(
|
|
6579
|
+
(T) => {
|
|
6580
6580
|
var E;
|
|
6581
|
-
return ((E =
|
|
6581
|
+
return ((E = T.card.queryConfig) == null ? void 0 : E.metricColumns) || [];
|
|
6582
6582
|
}
|
|
6583
6583
|
), r = O(
|
|
6584
|
-
(
|
|
6584
|
+
(T) => {
|
|
6585
6585
|
var E;
|
|
6586
|
-
return ((E =
|
|
6586
|
+
return ((E = T.card.queryConfig) == null ? void 0 : E.filterColumns) || [];
|
|
6587
6587
|
}
|
|
6588
6588
|
), l = O(
|
|
6589
|
-
(
|
|
6589
|
+
(T) => {
|
|
6590
6590
|
var E;
|
|
6591
|
-
return ((E =
|
|
6591
|
+
return ((E = T.card.queryConfig) == null ? void 0 : E.orderBy) || [];
|
|
6592
6592
|
}
|
|
6593
6593
|
), i = O(
|
|
6594
|
-
(
|
|
6594
|
+
(T) => {
|
|
6595
6595
|
var E;
|
|
6596
|
-
return ((E =
|
|
6596
|
+
return ((E = T.card.queryConfig) == null ? void 0 : E.pivotColumns) || [];
|
|
6597
6597
|
}
|
|
6598
6598
|
), {
|
|
6599
6599
|
setInsertIndex: o,
|
|
@@ -6609,21 +6609,21 @@ function Nm() {
|
|
|
6609
6609
|
setOrderByColumns: f,
|
|
6610
6610
|
setPivotByColumns: v
|
|
6611
6611
|
} = ie(), { columns: g } = yl(), { formattedTableName: b } = jt(), I = Xa(
|
|
6612
|
-
|
|
6612
|
+
ea(xo, {
|
|
6613
6613
|
activationConstraint: {
|
|
6614
6614
|
distance: 1
|
|
6615
6615
|
}
|
|
6616
6616
|
})
|
|
6617
6617
|
// Add other sensors if needed
|
|
6618
|
-
),
|
|
6618
|
+
), M = (T) => {
|
|
6619
6619
|
var F;
|
|
6620
|
-
const { active: E, over: P } =
|
|
6620
|
+
const { active: E, over: P } = T;
|
|
6621
6621
|
if (((F = E.data.current) == null ? void 0 : F.type) === "column" && P) {
|
|
6622
6622
|
const R = P.id, j = g.find(
|
|
6623
6623
|
(ne) => ne.column_name === E.id
|
|
6624
6624
|
);
|
|
6625
6625
|
if (!j) return;
|
|
6626
|
-
const K =
|
|
6626
|
+
const K = sa(j.data_type), Q = Ut(j.data_type), $ = Gt(j.data_type);
|
|
6627
6627
|
if (Q || $) {
|
|
6628
6628
|
if (n.some(
|
|
6629
6629
|
(ee) => ee.id === R
|
|
@@ -6696,15 +6696,15 @@ function Nm() {
|
|
|
6696
6696
|
} else
|
|
6697
6697
|
u(n), d(s), m(r), h(i);
|
|
6698
6698
|
};
|
|
6699
|
-
function C(
|
|
6700
|
-
c(
|
|
6699
|
+
function C(T) {
|
|
6700
|
+
c(T.active.id), o(null), u(n), d(s), m(r), h(i);
|
|
6701
6701
|
}
|
|
6702
|
-
function A(
|
|
6703
|
-
return !r.some((E) => E.name ===
|
|
6702
|
+
function A(T) {
|
|
6703
|
+
return !r.some((E) => E.name === T.column_name);
|
|
6704
6704
|
}
|
|
6705
|
-
function N(
|
|
6706
|
-
const { column_name: P, data_type: F } =
|
|
6707
|
-
...
|
|
6705
|
+
function N(T, E = "SUM") {
|
|
6706
|
+
const { column_name: P, data_type: F } = T, R = [...s], j = t !== null ? t : s.length, K = {
|
|
6707
|
+
...T,
|
|
6708
6708
|
id: kt(P),
|
|
6709
6709
|
// Unique ID
|
|
6710
6710
|
name: P,
|
|
@@ -6715,77 +6715,77 @@ function Nm() {
|
|
|
6715
6715
|
};
|
|
6716
6716
|
R.splice(j, 0, K), x(R);
|
|
6717
6717
|
}
|
|
6718
|
-
function S(
|
|
6719
|
-
const E = Ut(
|
|
6720
|
-
Gt(
|
|
6718
|
+
function S(T) {
|
|
6719
|
+
const E = Ut(T.data_type);
|
|
6720
|
+
Gt(T.data_type);
|
|
6721
6721
|
const P = [...i], F = t !== null ? t : i.length;
|
|
6722
6722
|
let R;
|
|
6723
6723
|
E ? R = {
|
|
6724
|
-
...
|
|
6725
|
-
id: kt(
|
|
6724
|
+
...T,
|
|
6725
|
+
id: kt(T.column_name),
|
|
6726
6726
|
// Unique ID
|
|
6727
|
-
name:
|
|
6728
|
-
type:
|
|
6727
|
+
name: T.column_name,
|
|
6728
|
+
type: T.data_type,
|
|
6729
6729
|
role: "groupby"
|
|
6730
6730
|
} : R = {
|
|
6731
|
-
...
|
|
6732
|
-
id: kt(
|
|
6731
|
+
...T,
|
|
6732
|
+
id: kt(T.column_name),
|
|
6733
6733
|
// Unique ID
|
|
6734
|
-
name:
|
|
6735
|
-
type:
|
|
6734
|
+
name: T.column_name,
|
|
6735
|
+
type: T.data_type,
|
|
6736
6736
|
role: "groupby",
|
|
6737
|
-
label: za(
|
|
6737
|
+
label: za(T.column_name, "month"),
|
|
6738
6738
|
granularity: "month"
|
|
6739
6739
|
}, P.splice(F, 0, R), v(P);
|
|
6740
6740
|
}
|
|
6741
|
-
function w(
|
|
6742
|
-
const E = Ut(
|
|
6743
|
-
Gt(
|
|
6741
|
+
function w(T) {
|
|
6742
|
+
const E = Ut(T.data_type);
|
|
6743
|
+
Gt(T.data_type);
|
|
6744
6744
|
const P = [...n], F = t !== null ? t : n.length;
|
|
6745
6745
|
let R;
|
|
6746
6746
|
E ? R = {
|
|
6747
|
-
...
|
|
6748
|
-
id: kt(
|
|
6747
|
+
...T,
|
|
6748
|
+
id: kt(T.column_name),
|
|
6749
6749
|
// Unique ID
|
|
6750
|
-
name:
|
|
6751
|
-
type:
|
|
6750
|
+
name: T.column_name,
|
|
6751
|
+
type: T.data_type,
|
|
6752
6752
|
role: "groupby"
|
|
6753
6753
|
} : R = {
|
|
6754
|
-
...
|
|
6755
|
-
id: kt(
|
|
6754
|
+
...T,
|
|
6755
|
+
id: kt(T.column_name),
|
|
6756
6756
|
// Unique ID
|
|
6757
|
-
name:
|
|
6758
|
-
type:
|
|
6757
|
+
name: T.column_name,
|
|
6758
|
+
type: T.data_type,
|
|
6759
6759
|
role: "groupby",
|
|
6760
|
-
label: za(
|
|
6760
|
+
label: za(T.column_name, "month"),
|
|
6761
6761
|
granularity: "month"
|
|
6762
6762
|
}, P.splice(F, 0, R), p(P);
|
|
6763
6763
|
}
|
|
6764
|
-
function L(
|
|
6764
|
+
function L(T) {
|
|
6765
6765
|
const E = [...r], P = t !== null ? t : r.length, F = {
|
|
6766
|
-
...
|
|
6767
|
-
id: kt(
|
|
6766
|
+
...T,
|
|
6767
|
+
id: kt(T.column_name),
|
|
6768
6768
|
// Unique ID
|
|
6769
|
-
name:
|
|
6770
|
-
type:
|
|
6769
|
+
name: T.column_name,
|
|
6770
|
+
type: T.data_type,
|
|
6771
6771
|
sql: un(
|
|
6772
|
-
|
|
6772
|
+
T.data_type,
|
|
6773
6773
|
b,
|
|
6774
|
-
Tt(
|
|
6774
|
+
Tt(T.column_name)
|
|
6775
6775
|
),
|
|
6776
6776
|
role: "filter"
|
|
6777
6777
|
};
|
|
6778
6778
|
E.splice(P, 0, F), y(E);
|
|
6779
6779
|
}
|
|
6780
|
-
function k(
|
|
6780
|
+
function k(T) {
|
|
6781
6781
|
var R, j, K, Q, $, ne, ee, de;
|
|
6782
|
-
const { active: E, over: P } =
|
|
6782
|
+
const { active: E, over: P } = T, F = E.data.current;
|
|
6783
6783
|
if ((F == null ? void 0 : F.type) === "column" && P) {
|
|
6784
6784
|
const H = g.find(
|
|
6785
6785
|
(Ne) => Ne.column_name === E.id
|
|
6786
6786
|
);
|
|
6787
6787
|
if (!H) return;
|
|
6788
|
-
const me =
|
|
6788
|
+
const me = sa(H.data_type), Y = Ut(H.data_type), W = Gt(H.data_type);
|
|
6789
6789
|
(Y || W) && (P.id === pa || ((R = P.data.current) == null ? void 0 : R.type) === Ls) && w(H), (Y || W) && (P.id === ga || ((j = P.data.current) == null ? void 0 : j.type) === zs) ? S(H) : (me || Y) && (P.id === fa || ((K = P.data.current) == null ? void 0 : K.type) === Nn) ? (me && N(H), Y && N(H, "COUNT")) : A(H) && (P.id === bn || ((Q = P.data.current) == null ? void 0 : Q.type) === Cn) && L(H);
|
|
6790
6790
|
}
|
|
6791
6791
|
if (P && (($ = P.data.current) == null ? void 0 : $.type) === Ls && n.some((H) => H.id === E.id)) {
|
|
@@ -6818,10 +6818,10 @@ function Nm() {
|
|
|
6818
6818
|
Y.splice(me, 0, W), y(Y);
|
|
6819
6819
|
}
|
|
6820
6820
|
}
|
|
6821
|
-
z(
|
|
6821
|
+
z(T), c(null), o(null), u(n), d(s), m(r), h(i);
|
|
6822
6822
|
}
|
|
6823
|
-
function z(
|
|
6824
|
-
const { active: E, over: P } =
|
|
6823
|
+
function z(T) {
|
|
6824
|
+
const { active: E, over: P } = T, F = E.data.current;
|
|
6825
6825
|
if ((F == null ? void 0 : F.type) === yr && P) {
|
|
6826
6826
|
const R = l.findIndex(
|
|
6827
6827
|
(K) => Za(K.columnId) === E.id
|
|
@@ -6834,14 +6834,14 @@ function Nm() {
|
|
|
6834
6834
|
}
|
|
6835
6835
|
}
|
|
6836
6836
|
}
|
|
6837
|
-
function
|
|
6837
|
+
function D() {
|
|
6838
6838
|
c(null), o(null), u(n), d(s), m(r);
|
|
6839
6839
|
}
|
|
6840
6840
|
return {
|
|
6841
|
-
handleDragOver:
|
|
6841
|
+
handleDragOver: M,
|
|
6842
6842
|
handleDragEnd: k,
|
|
6843
6843
|
handleDragStart: C,
|
|
6844
|
-
handleDragCancel:
|
|
6844
|
+
handleDragCancel: D,
|
|
6845
6845
|
sensors: I
|
|
6846
6846
|
};
|
|
6847
6847
|
}
|
|
@@ -6929,7 +6929,7 @@ function Cm({
|
|
|
6929
6929
|
setCardSql: g,
|
|
6930
6930
|
setRunSql: b,
|
|
6931
6931
|
setSqlGen: I,
|
|
6932
|
-
setIsShowingVisual:
|
|
6932
|
+
setIsShowingVisual: M
|
|
6933
6933
|
} = ie(), { connectionType: C, modelItems: A, selectedDatamodelName: N } = jt();
|
|
6934
6934
|
function S(R) {
|
|
6935
6935
|
var j;
|
|
@@ -6983,7 +6983,7 @@ function Cm({
|
|
|
6983
6983
|
};
|
|
6984
6984
|
v(K);
|
|
6985
6985
|
}
|
|
6986
|
-
if (
|
|
6986
|
+
if (sa(R.data_type)) {
|
|
6987
6987
|
const K = {
|
|
6988
6988
|
...R,
|
|
6989
6989
|
role: "metric",
|
|
@@ -7005,7 +7005,7 @@ function Cm({
|
|
|
7005
7005
|
connectionType: C,
|
|
7006
7006
|
databaseName: h || ""
|
|
7007
7007
|
});
|
|
7008
|
-
|
|
7008
|
+
M(!1);
|
|
7009
7009
|
const j = C === "MSSQL" ? `SELECT top 10 * FROM ${R}` : `SELECT * FROM ${R} LIMIT 10`;
|
|
7010
7010
|
g(j), b(!0);
|
|
7011
7011
|
}
|
|
@@ -7021,9 +7021,9 @@ function Cm({
|
|
|
7021
7021
|
}
|
|
7022
7022
|
const k = (s == null ? void 0 : s.filter(
|
|
7023
7023
|
(R) => R.column_name.toLowerCase().includes(l.toLowerCase())
|
|
7024
|
-
)) || [], z = (R) =>
|
|
7024
|
+
)) || [], z = (R) => sa(R.data_type) ? "number" : "text", D = o === "all" ? k : k.filter(
|
|
7025
7025
|
(R) => z(R) === o
|
|
7026
|
-
),
|
|
7026
|
+
), T = k.filter(
|
|
7027
7027
|
(R) => z(R) === "text"
|
|
7028
7028
|
).length, E = k.filter(
|
|
7029
7029
|
(R) => z(R) === "number"
|
|
@@ -7044,7 +7044,7 @@ function Cm({
|
|
|
7044
7044
|
{
|
|
7045
7045
|
onClick: (j) => j.stopPropagation(),
|
|
7046
7046
|
className: "flex items-center justify-end",
|
|
7047
|
-
children:
|
|
7047
|
+
children: sa(R.data_type) && /* @__PURE__ */ e(gm, { column: R })
|
|
7048
7048
|
}
|
|
7049
7049
|
)
|
|
7050
7050
|
]
|
|
@@ -7117,7 +7117,7 @@ function Cm({
|
|
|
7117
7117
|
] }),
|
|
7118
7118
|
/* @__PURE__ */ a(Re, { value: "text", className: "text-xs", children: [
|
|
7119
7119
|
/* @__PURE__ */ e(Gs, { className: "size-4 shrink-0" }),
|
|
7120
|
-
/* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children:
|
|
7120
|
+
/* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children: T })
|
|
7121
7121
|
] }),
|
|
7122
7122
|
/* @__PURE__ */ a(Re, { value: "number", className: "text-xs", children: [
|
|
7123
7123
|
/* @__PURE__ */ e(Ya, { className: "size-4 shrink-0" }),
|
|
@@ -7132,19 +7132,19 @@ function Cm({
|
|
|
7132
7132
|
{
|
|
7133
7133
|
className: "flex-1 basis-0 overflow-y-auto px-4 pt-3",
|
|
7134
7134
|
children: [
|
|
7135
|
-
|
|
7135
|
+
D.length === 0 && l && /* @__PURE__ */ a("div", { className: "py-4 text-center text-sm text-gray-500", children: [
|
|
7136
7136
|
'No fields found matching "',
|
|
7137
7137
|
l,
|
|
7138
7138
|
'"'
|
|
7139
7139
|
] }),
|
|
7140
|
-
|
|
7140
|
+
D.length === 0 && !l && o !== "all" && /* @__PURE__ */ a("div", { className: "py-4 text-center text-sm text-gray-500", children: [
|
|
7141
7141
|
"No ",
|
|
7142
7142
|
o,
|
|
7143
7143
|
" fields found"
|
|
7144
7144
|
] }),
|
|
7145
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col gap-1", children:
|
|
7146
|
-
/* @__PURE__ */ e(
|
|
7147
|
-
/* @__PURE__ */ e(
|
|
7145
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-1", children: D == null ? void 0 : D.map((R) => /* @__PURE__ */ e("div", { children: P(R) }, R.column_name)) }),
|
|
7146
|
+
/* @__PURE__ */ e(ra, { orientation: "vertical" }),
|
|
7147
|
+
/* @__PURE__ */ e(ra, { orientation: "horizontal" })
|
|
7148
7148
|
]
|
|
7149
7149
|
}
|
|
7150
7150
|
)
|
|
@@ -7171,7 +7171,7 @@ function hi({
|
|
|
7171
7171
|
schemaItems: g,
|
|
7172
7172
|
databaseItems: b,
|
|
7173
7173
|
tableItems: I,
|
|
7174
|
-
columns:
|
|
7174
|
+
columns: M,
|
|
7175
7175
|
isConnectionsLoading: C,
|
|
7176
7176
|
isModelsLoading: A,
|
|
7177
7177
|
isConnectionsError: N,
|
|
@@ -7180,8 +7180,8 @@ function hi({
|
|
|
7180
7180
|
isDatabaseError: L,
|
|
7181
7181
|
isSchemaLoadingOrFetching: k,
|
|
7182
7182
|
isSchemaError: z,
|
|
7183
|
-
isColumnsError:
|
|
7184
|
-
isColumnsLoadingOrFetching:
|
|
7183
|
+
isColumnsError: D,
|
|
7184
|
+
isColumnsLoadingOrFetching: T,
|
|
7185
7185
|
isTableLoadingOrFetching: E,
|
|
7186
7186
|
isTableError: P,
|
|
7187
7187
|
connectionType: F,
|
|
@@ -7201,13 +7201,13 @@ function hi({
|
|
|
7201
7201
|
schemaName: re
|
|
7202
7202
|
} = jt(), { data: Ce, refetch: q } = qe(i);
|
|
7203
7203
|
function pe() {
|
|
7204
|
-
return t ? t(re, Ne,
|
|
7204
|
+
return t ? t(re, Ne, M) : /* @__PURE__ */ e(
|
|
7205
7205
|
Cm,
|
|
7206
7206
|
{
|
|
7207
7207
|
schemaName: re,
|
|
7208
7208
|
tableName: Ne,
|
|
7209
|
-
columns:
|
|
7210
|
-
status:
|
|
7209
|
+
columns: M,
|
|
7210
|
+
status: T ? "Loading..." : D ? "Error" : "Success"
|
|
7211
7211
|
}
|
|
7212
7212
|
);
|
|
7213
7213
|
}
|
|
@@ -7676,7 +7676,7 @@ function Tm() {
|
|
|
7676
7676
|
setCardType: g,
|
|
7677
7677
|
setCardPython: b,
|
|
7678
7678
|
runAssistant: I,
|
|
7679
|
-
setShowAIDialog:
|
|
7679
|
+
setShowAIDialog: M
|
|
7680
7680
|
} = ie();
|
|
7681
7681
|
O(($) => $.onSave), O(($) => $.onClose), O(($) => $.actions.setSqlGen);
|
|
7682
7682
|
const C = O(($) => $.runSql), A = O(($) => $.actions.setRunSql), N = O(
|
|
@@ -7687,8 +7687,8 @@ function Tm() {
|
|
|
7687
7687
|
isFetching: L,
|
|
7688
7688
|
isSuccess: k,
|
|
7689
7689
|
isError: z,
|
|
7690
|
-
error:
|
|
7691
|
-
errorSql:
|
|
7690
|
+
error: D,
|
|
7691
|
+
errorSql: T,
|
|
7692
7692
|
queryKey: E,
|
|
7693
7693
|
refetch: P,
|
|
7694
7694
|
errorMessage: F
|
|
@@ -7713,7 +7713,7 @@ function Tm() {
|
|
|
7713
7713
|
N,
|
|
7714
7714
|
p,
|
|
7715
7715
|
// setQueryError,
|
|
7716
|
-
|
|
7716
|
+
D
|
|
7717
7717
|
]), ke(() => {
|
|
7718
7718
|
C && (t.getQueryData(E) || P(), A(!1));
|
|
7719
7719
|
}, [C, P, A, E, t]);
|
|
@@ -7726,7 +7726,7 @@ function Tm() {
|
|
|
7726
7726
|
|
|
7727
7727
|
Error SQL:
|
|
7728
7728
|
|
|
7729
|
-
${
|
|
7729
|
+
${T}
|
|
7730
7730
|
|
|
7731
7731
|
Query:
|
|
7732
7732
|
|
|
@@ -7844,7 +7844,7 @@ ${d}` : ""}
|
|
|
7844
7844
|
/* @__PURE__ */ e(
|
|
7845
7845
|
gi,
|
|
7846
7846
|
{
|
|
7847
|
-
errorSql:
|
|
7847
|
+
errorSql: T,
|
|
7848
7848
|
sql: S == null ? void 0 : S.sql,
|
|
7849
7849
|
error: F,
|
|
7850
7850
|
onDebugWithAssistant: R
|
|
@@ -7867,7 +7867,7 @@ ${d}` : ""}
|
|
|
7867
7867
|
{
|
|
7868
7868
|
disabled: c,
|
|
7869
7869
|
onClick: () => {
|
|
7870
|
-
|
|
7870
|
+
M(!0);
|
|
7871
7871
|
},
|
|
7872
7872
|
className: "h-9 w-full cursor-text px-3 text-left text-sm text-muted-foreground",
|
|
7873
7873
|
children: c ? "" : "Type your question..."
|
|
@@ -7962,18 +7962,18 @@ function Im({ className: t }) {
|
|
|
7962
7962
|
) });
|
|
7963
7963
|
}
|
|
7964
7964
|
function Am({ card: t }) {
|
|
7965
|
-
var I,
|
|
7965
|
+
var I, M, C, A, N, S, w, L, k, z, D;
|
|
7966
7966
|
const [n, s] = V(!1), [r, l] = V(
|
|
7967
7967
|
[]
|
|
7968
|
-
), { authToken: i } = Xe(), { theme: o } = wn(), c = Mo(i == null ? void 0 : i.accessToken), u = X((
|
|
7968
|
+
), { authToken: i } = Xe(), { theme: o } = wn(), c = Mo(i == null ? void 0 : i.accessToken), u = X((T) => T.themeStyle), d = {
|
|
7969
7969
|
mode: o || "system",
|
|
7970
|
-
colors: ((
|
|
7970
|
+
colors: ((M = (I = u == null ? void 0 : u.chart) == null ? void 0 : I.dataset) == null ? void 0 : M.backgroundColor) || []
|
|
7971
7971
|
};
|
|
7972
7972
|
(C = t.customCardPreferences) != null && C.inputData;
|
|
7973
|
-
const { getCard: m } = er(((A = t.customCardPreferences) == null ? void 0 : A.url) || ""), h = ((N = t.customCardPreferences) == null ? void 0 : N.visualType) || "single", p = O((
|
|
7973
|
+
const { getCard: m } = er(((A = t.customCardPreferences) == null ? void 0 : A.url) || ""), h = ((N = t.customCardPreferences) == null ? void 0 : N.visualType) || "single", p = O((T) => T.frame), { setCustomCardPreferences: x } = ie(), { data: y } = qe(t), f = Se((T, E) => {
|
|
7974
7974
|
l((P) => ({
|
|
7975
7975
|
...P,
|
|
7976
|
-
[
|
|
7976
|
+
[T]: E
|
|
7977
7977
|
}));
|
|
7978
7978
|
}, []);
|
|
7979
7979
|
if (!((S = t.customCardPreferences) != null && S.componentName))
|
|
@@ -7981,14 +7981,14 @@ function Am({ card: t }) {
|
|
|
7981
7981
|
const v = m(
|
|
7982
7982
|
(w = t.customCardPreferences) == null ? void 0 : w.componentName
|
|
7983
7983
|
);
|
|
7984
|
-
function g(
|
|
7985
|
-
s(
|
|
7984
|
+
function g(T) {
|
|
7985
|
+
s(T);
|
|
7986
7986
|
}
|
|
7987
7987
|
const b = Object.keys(
|
|
7988
7988
|
((L = t.customCardPreferences) == null ? void 0 : L.dataInputCardIds) || {}
|
|
7989
|
-
).map((
|
|
7989
|
+
).map((T) => {
|
|
7990
7990
|
var F, R, j;
|
|
7991
|
-
const E = (R = (F = t.customCardPreferences) == null ? void 0 : F.dataInputCardIds) == null ? void 0 : R[
|
|
7991
|
+
const E = (R = (F = t.customCardPreferences) == null ? void 0 : F.dataInputCardIds) == null ? void 0 : R[T].cardId, P = (j = p == null ? void 0 : p.cards) == null ? void 0 : j.find((K) => K.id === E);
|
|
7992
7992
|
return P || null;
|
|
7993
7993
|
});
|
|
7994
7994
|
return /* @__PURE__ */ e("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ a(
|
|
@@ -8010,9 +8010,9 @@ function Am({ card: t }) {
|
|
|
8010
8010
|
v && h === "multiple" && /* @__PURE__ */ a(J, { children: [
|
|
8011
8011
|
Object.keys(
|
|
8012
8012
|
((z = t.customCardPreferences) == null ? void 0 : z.dataInputCardIds) || {}
|
|
8013
|
-
).map((
|
|
8013
|
+
).map((T) => {
|
|
8014
8014
|
var F, R, j;
|
|
8015
|
-
const E = (R = (F = t.customCardPreferences) == null ? void 0 : F.dataInputCardIds) == null ? void 0 : R[
|
|
8015
|
+
const E = (R = (F = t.customCardPreferences) == null ? void 0 : F.dataInputCardIds) == null ? void 0 : R[T].cardId, P = (j = p == null ? void 0 : p.cards) == null ? void 0 : j.find(
|
|
8016
8016
|
(K) => K.id === E
|
|
8017
8017
|
);
|
|
8018
8018
|
if (P)
|
|
@@ -8021,10 +8021,10 @@ function Am({ card: t }) {
|
|
|
8021
8021
|
{
|
|
8022
8022
|
onLoadingStatus: g,
|
|
8023
8023
|
onDataChange: f,
|
|
8024
|
-
dataInputIndex:
|
|
8024
|
+
dataInputIndex: T,
|
|
8025
8025
|
card: P
|
|
8026
8026
|
},
|
|
8027
|
-
P.id +
|
|
8027
|
+
P.id + T
|
|
8028
8028
|
);
|
|
8029
8029
|
}),
|
|
8030
8030
|
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e(
|
|
@@ -8033,18 +8033,18 @@ function Am({ card: t }) {
|
|
|
8033
8033
|
theme: d,
|
|
8034
8034
|
onDataChange: f,
|
|
8035
8035
|
settings: b.map(
|
|
8036
|
-
(
|
|
8036
|
+
(T) => {
|
|
8037
8037
|
var E;
|
|
8038
|
-
return (E =
|
|
8038
|
+
return (E = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : E.settings;
|
|
8039
8039
|
}
|
|
8040
8040
|
),
|
|
8041
|
-
data: b.map((
|
|
8041
|
+
data: b.map((T) => T != null && T.id ? r == null ? void 0 : r[T.id] : [])
|
|
8042
8042
|
}
|
|
8043
8043
|
) })
|
|
8044
8044
|
] })
|
|
8045
8045
|
]
|
|
8046
8046
|
},
|
|
8047
|
-
(
|
|
8047
|
+
(D = t.customCardPreferences) == null ? void 0 : D.componentName
|
|
8048
8048
|
) });
|
|
8049
8049
|
}
|
|
8050
8050
|
function vi({
|
|
@@ -8070,8 +8070,8 @@ function vi({
|
|
|
8070
8070
|
m == null ? void 0 : m.subtotalColumns,
|
|
8071
8071
|
m == null ? void 0 : m.pivotSchema,
|
|
8072
8072
|
m == null ? void 0 : m.groupByColumns
|
|
8073
|
-
]), I = Ao(s, b),
|
|
8074
|
-
var z,
|
|
8073
|
+
]), I = Ao(s, b), M = (w, L) => {
|
|
8074
|
+
var z, D;
|
|
8075
8075
|
const k = {
|
|
8076
8076
|
...s,
|
|
8077
8077
|
paginationConfig: {
|
|
@@ -8080,7 +8080,7 @@ function vi({
|
|
|
8080
8080
|
pageSize: L
|
|
8081
8081
|
}
|
|
8082
8082
|
};
|
|
8083
|
-
f(k), v(k), s.sql && ((
|
|
8083
|
+
f(k), v(k), s.sql && ((D = (z = s.preferences) == null ? void 0 : z.tablePrefs) != null && D.enableDevModePagination) && c(!0);
|
|
8084
8084
|
}, C = Ve(() => !s.id || !(m != null && m.records) ? null : wl({
|
|
8085
8085
|
card: s,
|
|
8086
8086
|
data: m == null ? void 0 : m.records,
|
|
@@ -8132,7 +8132,7 @@ function vi({
|
|
|
8132
8132
|
card: s,
|
|
8133
8133
|
data: (m == null ? void 0 : m.records) || [],
|
|
8134
8134
|
paginationMetadata: y,
|
|
8135
|
-
onPaginationChange:
|
|
8135
|
+
onPaginationChange: M,
|
|
8136
8136
|
isLoading: h || p
|
|
8137
8137
|
}
|
|
8138
8138
|
) });
|
|
@@ -8168,7 +8168,7 @@ function vi({
|
|
|
8168
8168
|
groupByColumns: m == null ? void 0 : m.groupByColumns,
|
|
8169
8169
|
pivotSchema: m == null ? void 0 : m.pivotSchema,
|
|
8170
8170
|
paginationMetadata: y,
|
|
8171
|
-
onPaginationChange:
|
|
8171
|
+
onPaginationChange: M,
|
|
8172
8172
|
onAggregationChange: (w) => {
|
|
8173
8173
|
const L = Fr(
|
|
8174
8174
|
w,
|
|
@@ -8395,14 +8395,14 @@ function Fm() {
|
|
|
8395
8395
|
} catch {
|
|
8396
8396
|
d("Invalid JSON configuration");
|
|
8397
8397
|
}
|
|
8398
|
-
},
|
|
8398
|
+
}, M = Object.keys(h || {}).length === 0;
|
|
8399
8399
|
return /* @__PURE__ */ a(rt, { open: t, onOpenChange: n, children: [
|
|
8400
8400
|
/* @__PURE__ */ e(rl, { asChild: !0, children: /* @__PURE__ */ e(
|
|
8401
8401
|
ye,
|
|
8402
8402
|
{
|
|
8403
8403
|
tooltip: "Customize Visual",
|
|
8404
8404
|
onClick: b,
|
|
8405
|
-
className:
|
|
8405
|
+
className: M ? "" : "text-green-600 hover:text-green-700",
|
|
8406
8406
|
children: /* @__PURE__ */ e(zo, { className: "h-4 w-4" })
|
|
8407
8407
|
}
|
|
8408
8408
|
) }),
|
|
@@ -8921,13 +8921,13 @@ function jm({
|
|
|
8921
8921
|
className: t
|
|
8922
8922
|
}) {
|
|
8923
8923
|
var p, x, y, f, v, g, b, I;
|
|
8924
|
-
const n = O((
|
|
8924
|
+
const n = O((M) => M.card), { setCardPreferences: s, updateCardInFrame: r, setCard: l } = ie(), [i, o] = V(!1), c = ((x = (p = n.preferences) == null ? void 0 : p.displayOptions) == null ? void 0 : x.showFilterInfo) ?? !0, u = ((f = (y = n.preferences) == null ? void 0 : y.displayOptions) == null ? void 0 : f.showCardToolbar) ?? !0, d = ((g = (v = n.preferences) == null ? void 0 : v.displayOptions) == null ? void 0 : g.showChrome) ?? !0, m = ((I = (b = n.preferences) == null ? void 0 : b.displayOptions) == null ? void 0 : I.allowScroll) ?? !0, h = (M, C) => {
|
|
8925
8925
|
var S;
|
|
8926
8926
|
const A = {
|
|
8927
8927
|
...n.preferences,
|
|
8928
8928
|
displayOptions: {
|
|
8929
8929
|
...(S = n.preferences) == null ? void 0 : S.displayOptions,
|
|
8930
|
-
[
|
|
8930
|
+
[M]: C
|
|
8931
8931
|
}
|
|
8932
8932
|
};
|
|
8933
8933
|
s(A);
|
|
@@ -8951,10 +8951,10 @@ function jm({
|
|
|
8951
8951
|
ua,
|
|
8952
8952
|
{
|
|
8953
8953
|
checked: c,
|
|
8954
|
-
onCheckedChange: (
|
|
8955
|
-
h("showFilterInfo",
|
|
8954
|
+
onCheckedChange: (M) => {
|
|
8955
|
+
h("showFilterInfo", M);
|
|
8956
8956
|
},
|
|
8957
|
-
onSelect: (
|
|
8957
|
+
onSelect: (M) => M.preventDefault(),
|
|
8958
8958
|
className: "pr-2",
|
|
8959
8959
|
children: [
|
|
8960
8960
|
/* @__PURE__ */ e("span", { className: "flex-1", children: "Filter Info" }),
|
|
@@ -8966,10 +8966,10 @@ function jm({
|
|
|
8966
8966
|
ua,
|
|
8967
8967
|
{
|
|
8968
8968
|
checked: u,
|
|
8969
|
-
onCheckedChange: (
|
|
8970
|
-
h("showCardToolbar",
|
|
8969
|
+
onCheckedChange: (M) => {
|
|
8970
|
+
h("showCardToolbar", M);
|
|
8971
8971
|
},
|
|
8972
|
-
onSelect: (
|
|
8972
|
+
onSelect: (M) => M.preventDefault(),
|
|
8973
8973
|
className: "pr-2",
|
|
8974
8974
|
children: [
|
|
8975
8975
|
/* @__PURE__ */ e("span", { className: "flex-1", children: "Card Toolbar" }),
|
|
@@ -8981,10 +8981,10 @@ function jm({
|
|
|
8981
8981
|
ua,
|
|
8982
8982
|
{
|
|
8983
8983
|
checked: d,
|
|
8984
|
-
onCheckedChange: (
|
|
8985
|
-
h("showChrome",
|
|
8984
|
+
onCheckedChange: (M) => {
|
|
8985
|
+
h("showChrome", M);
|
|
8986
8986
|
},
|
|
8987
|
-
onSelect: (
|
|
8987
|
+
onSelect: (M) => M.preventDefault(),
|
|
8988
8988
|
className: "pr-2",
|
|
8989
8989
|
children: [
|
|
8990
8990
|
/* @__PURE__ */ e("span", { className: "flex-1", children: "Card Chrome" }),
|
|
@@ -8996,10 +8996,10 @@ function jm({
|
|
|
8996
8996
|
ua,
|
|
8997
8997
|
{
|
|
8998
8998
|
checked: m,
|
|
8999
|
-
onCheckedChange: (
|
|
9000
|
-
h("allowScroll",
|
|
8999
|
+
onCheckedChange: (M) => {
|
|
9000
|
+
h("allowScroll", M);
|
|
9001
9001
|
},
|
|
9002
|
-
onSelect: (
|
|
9002
|
+
onSelect: (M) => M.preventDefault(),
|
|
9003
9003
|
className: "pr-2",
|
|
9004
9004
|
children: [
|
|
9005
9005
|
/* @__PURE__ */ e("span", { className: "flex-1", children: "Allow Scroll" }),
|
|
@@ -9263,12 +9263,12 @@ function Ns({
|
|
|
9263
9263
|
const S = JSON.stringify(p == null ? void 0 : p.records, null, 2), w = new Blob([S], { type: "application/json" }), L = URL.createObjectURL(w), k = document.createElement("a");
|
|
9264
9264
|
k.href = L, k.download = `${n.title}.json`, k.click();
|
|
9265
9265
|
}
|
|
9266
|
-
function
|
|
9266
|
+
function M() {
|
|
9267
9267
|
const w = [
|
|
9268
9268
|
Object.keys(
|
|
9269
|
-
p == null ? void 0 : p.records.reduce((
|
|
9269
|
+
p == null ? void 0 : p.records.reduce((D, T) => ({ ...D, ...T }), {})
|
|
9270
9270
|
).join(","),
|
|
9271
|
-
...((p == null ? void 0 : p.records) || []).map((
|
|
9271
|
+
...((p == null ? void 0 : p.records) || []).map((D) => Object.values(D).join(","))
|
|
9272
9272
|
].join(`
|
|
9273
9273
|
`), L = new Blob([w], { type: "text/csv" }), k = URL.createObjectURL(L), z = document.createElement("a");
|
|
9274
9274
|
z.href = k, z.download = `${n.title}.csv`, z.click();
|
|
@@ -9299,7 +9299,7 @@ function Ns({
|
|
|
9299
9299
|
className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",
|
|
9300
9300
|
variant: "ghost",
|
|
9301
9301
|
size: "icon",
|
|
9302
|
-
onClick:
|
|
9302
|
+
onClick: M,
|
|
9303
9303
|
children: /* @__PURE__ */ e(Ho, { className: "size-4" })
|
|
9304
9304
|
}
|
|
9305
9305
|
),
|
|
@@ -9421,7 +9421,7 @@ function Um() {
|
|
|
9421
9421
|
/* @__PURE__ */ e("div", { className: "sticky top-0 flex max-h-11 min-h-11 grow items-center font-mono text-xs font-semibold text-foreground/70", children: "Python Output" }),
|
|
9422
9422
|
/* @__PURE__ */ a(st, { className: "overflow-y-auto pt-1 font-mono text-xs text-foreground/90", children: [
|
|
9423
9423
|
/* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: n } }),
|
|
9424
|
-
/* @__PURE__ */ e(
|
|
9424
|
+
/* @__PURE__ */ e(ra, { orientation: "horizontal" })
|
|
9425
9425
|
] })
|
|
9426
9426
|
] });
|
|
9427
9427
|
}
|
|
@@ -9488,7 +9488,7 @@ function $m() {
|
|
|
9488
9488
|
);
|
|
9489
9489
|
function m(g, b) {
|
|
9490
9490
|
if (!t) return;
|
|
9491
|
-
const
|
|
9491
|
+
const M = {
|
|
9492
9492
|
...(t == null ? void 0 : t.dataInputCardIds) || {},
|
|
9493
9493
|
[g]: {
|
|
9494
9494
|
cardId: b,
|
|
@@ -9497,11 +9497,11 @@ function $m() {
|
|
|
9497
9497
|
};
|
|
9498
9498
|
o({
|
|
9499
9499
|
...t,
|
|
9500
|
-
dataInputCardIds:
|
|
9500
|
+
dataInputCardIds: M
|
|
9501
9501
|
});
|
|
9502
9502
|
}
|
|
9503
9503
|
function h(g) {
|
|
9504
|
-
var I,
|
|
9504
|
+
var I, M;
|
|
9505
9505
|
const b = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((C) => {
|
|
9506
9506
|
var A;
|
|
9507
9507
|
return ((A = C == null ? void 0 : C.customCardPreferences) == null ? void 0 : A.visualType) !== "multiple";
|
|
@@ -9509,7 +9509,7 @@ function $m() {
|
|
|
9509
9509
|
value: C.id,
|
|
9510
9510
|
label: C.tabTitle || C.title
|
|
9511
9511
|
}));
|
|
9512
|
-
return /* @__PURE__ */ e("div", { className: "space-y-2", children: (
|
|
9512
|
+
return /* @__PURE__ */ e("div", { className: "space-y-2", children: (M = g == null ? void 0 : g.dataInputs) == null ? void 0 : M.map((C, A) => {
|
|
9513
9513
|
var N, S;
|
|
9514
9514
|
return /* @__PURE__ */ a(
|
|
9515
9515
|
"div",
|
|
@@ -9533,13 +9533,13 @@ function $m() {
|
|
|
9533
9533
|
);
|
|
9534
9534
|
}) });
|
|
9535
9535
|
}
|
|
9536
|
-
function p(g, b, I = [],
|
|
9536
|
+
function p(g, b, I = [], M = "") {
|
|
9537
9537
|
var C, A;
|
|
9538
9538
|
return t ? g === "input" ? /* @__PURE__ */ e(
|
|
9539
9539
|
Oe,
|
|
9540
9540
|
{
|
|
9541
|
-
className: `h-8 w-full ${
|
|
9542
|
-
value: ((C = t == null ? void 0 : t.settings) == null ? void 0 : C[b]) ||
|
|
9541
|
+
className: `h-8 w-full ${ta}`,
|
|
9542
|
+
value: ((C = t == null ? void 0 : t.settings) == null ? void 0 : C[b]) || M,
|
|
9543
9543
|
onChange: (N) => {
|
|
9544
9544
|
o({
|
|
9545
9545
|
...t,
|
|
@@ -9557,7 +9557,7 @@ function $m() {
|
|
|
9557
9557
|
className: "h-8 w-full",
|
|
9558
9558
|
label: "",
|
|
9559
9559
|
options: I,
|
|
9560
|
-
value: ((A = t == null ? void 0 : t.settings) == null ? void 0 : A[b]) ||
|
|
9560
|
+
value: ((A = t == null ? void 0 : t.settings) == null ? void 0 : A[b]) || M,
|
|
9561
9561
|
onValueChange: (N) => {
|
|
9562
9562
|
o({
|
|
9563
9563
|
...t,
|
|
@@ -9569,13 +9569,13 @@ function $m() {
|
|
|
9569
9569
|
}
|
|
9570
9570
|
function x(g) {
|
|
9571
9571
|
const b = Object.entries((g == null ? void 0 : g.settings) || {});
|
|
9572
|
-
return /* @__PURE__ */ e("div", { className: "space-y-3", children: b.map(([I,
|
|
9573
|
-
/* @__PURE__ */ e(U, { children:
|
|
9572
|
+
return /* @__PURE__ */ e("div", { className: "space-y-3", children: b.map(([I, M]) => /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
9573
|
+
/* @__PURE__ */ e(U, { children: M.title }),
|
|
9574
9574
|
p(
|
|
9575
|
-
|
|
9575
|
+
M.ui,
|
|
9576
9576
|
I,
|
|
9577
|
-
|
|
9578
|
-
|
|
9577
|
+
M.options,
|
|
9578
|
+
M.defaultValue
|
|
9579
9579
|
)
|
|
9580
9580
|
] }, I)) });
|
|
9581
9581
|
}
|
|
@@ -9821,7 +9821,7 @@ function Ym({ idx: t }) {
|
|
|
9821
9821
|
}
|
|
9822
9822
|
return /* @__PURE__ */ a(zt, { children: [
|
|
9823
9823
|
/* @__PURE__ */ e(_t, { children: /* @__PURE__ */ e(Zl, { className: "size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
9824
|
-
/* @__PURE__ */ e(
|
|
9824
|
+
/* @__PURE__ */ e(Qt, { className: "w-fit px-2 py-1", children: /* @__PURE__ */ a("div", { className: "flex gap-1", children: [
|
|
9825
9825
|
/* @__PURE__ */ e(
|
|
9826
9826
|
"button",
|
|
9827
9827
|
{
|
|
@@ -10046,16 +10046,16 @@ function Nr() {
|
|
|
10046
10046
|
function p(x, y = "dashboard", f) {
|
|
10047
10047
|
var S;
|
|
10048
10048
|
const v = Tt(x.column_name), g = Tt(s || ""), b = Tt(r || ""), I = Tt(m);
|
|
10049
|
-
let
|
|
10049
|
+
let M = ac({
|
|
10050
10050
|
schemaName: b,
|
|
10051
10051
|
tableName: I,
|
|
10052
10052
|
connectionType: h,
|
|
10053
10053
|
databaseName: g
|
|
10054
|
-
}), C = `${
|
|
10054
|
+
}), C = `${M}.${v}`;
|
|
10055
10055
|
const A = (S = d == null ? void 0 : d.find(
|
|
10056
10056
|
(w) => w.id === n
|
|
10057
10057
|
)) == null ? void 0 : S.name;
|
|
10058
|
-
n && n !== "none" && (C = `${Pr}.${A}.${v}`,
|
|
10058
|
+
n && n !== "none" && (C = `${Pr}.${A}.${v}`, M = `${Pr}.${A}`), f != null && f.qualifiedFieldName && (C = f.qualifiedFieldName), f != null && f.entityName && (M = f.entityName);
|
|
10059
10059
|
const N = i == null ? void 0 : i.find(
|
|
10060
10060
|
(w) => w.column === C && w.table === I && (w.database === g || w.database === s)
|
|
10061
10061
|
);
|
|
@@ -10077,7 +10077,7 @@ function Nr() {
|
|
|
10077
10077
|
operation: "in",
|
|
10078
10078
|
sql: un(
|
|
10079
10079
|
x.data_type,
|
|
10080
|
-
|
|
10080
|
+
M,
|
|
10081
10081
|
v
|
|
10082
10082
|
)
|
|
10083
10083
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
@@ -10095,7 +10095,7 @@ function Nr() {
|
|
|
10095
10095
|
operation: "in",
|
|
10096
10096
|
sql: un(
|
|
10097
10097
|
x.data_type,
|
|
10098
|
-
|
|
10098
|
+
M,
|
|
10099
10099
|
v
|
|
10100
10100
|
)
|
|
10101
10101
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
@@ -10140,7 +10140,7 @@ function Km({
|
|
|
10140
10140
|
]
|
|
10141
10141
|
}
|
|
10142
10142
|
) }),
|
|
10143
|
-
/* @__PURE__ */ e(
|
|
10143
|
+
/* @__PURE__ */ e(Qt, { className: "w-[200px] p-0", children: /* @__PURE__ */ a(us, { children: [
|
|
10144
10144
|
/* @__PURE__ */ e(ms, { placeholder: "Search column", className: "h-9" }),
|
|
10145
10145
|
/* @__PURE__ */ a(hs, { children: [
|
|
10146
10146
|
/* @__PURE__ */ e(ps, { children: "No framework found." }),
|
|
@@ -10506,7 +10506,7 @@ function eh({
|
|
|
10506
10506
|
{
|
|
10507
10507
|
onChange: (u) => r(c, "start", u.target.value),
|
|
10508
10508
|
value: o.start,
|
|
10509
|
-
className: G(`h-7 ${
|
|
10509
|
+
className: G(`h-7 ${ta}`)
|
|
10510
10510
|
}
|
|
10511
10511
|
),
|
|
10512
10512
|
/* @__PURE__ */ e("span", { children: "-" }),
|
|
@@ -10515,7 +10515,7 @@ function eh({
|
|
|
10515
10515
|
{
|
|
10516
10516
|
value: o.end,
|
|
10517
10517
|
onChange: (u) => r(c, "end", u.target.value),
|
|
10518
|
-
className: G(`h-7 ${
|
|
10518
|
+
className: G(`h-7 ${ta}`)
|
|
10519
10519
|
}
|
|
10520
10520
|
),
|
|
10521
10521
|
/* @__PURE__ */ e(
|
|
@@ -10523,7 +10523,7 @@ function eh({
|
|
|
10523
10523
|
{
|
|
10524
10524
|
onChange: (u) => r(c, "color", u.target.value),
|
|
10525
10525
|
value: o.color,
|
|
10526
|
-
className: G(`h-7 min-w-14 p-0 ${
|
|
10526
|
+
className: G(`h-7 min-w-14 p-0 ${ta}`),
|
|
10527
10527
|
type: "color",
|
|
10528
10528
|
list: "presetColors"
|
|
10529
10529
|
}
|
|
@@ -10865,7 +10865,7 @@ const sh = [
|
|
|
10865
10865
|
value: t
|
|
10866
10866
|
}));
|
|
10867
10867
|
function lh() {
|
|
10868
|
-
var u, d, m, h, p, x, y, f, v, g, b, I,
|
|
10868
|
+
var u, d, m, h, p, x, y, f, v, g, b, I, M, C, A, N, S, w;
|
|
10869
10869
|
const t = O((L) => L.card), n = (d = (u = t == null ? void 0 : t.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : d.topoJsonUrl, [s, r] = V(
|
|
10870
10870
|
((h = (m = t == null ? void 0 : t.preferences) == null ? void 0 : m.mapVisualOptions) == null ? void 0 : h.customTopoJsonUrl) || ""
|
|
10871
10871
|
), { setCardPreferences: l } = ie(), { data: i } = tr(t), o = Object.keys((i == null ? void 0 : i.objects) || {}).map((L) => ({
|
|
@@ -10924,7 +10924,7 @@ function lh() {
|
|
|
10924
10924
|
});
|
|
10925
10925
|
},
|
|
10926
10926
|
value: s,
|
|
10927
|
-
className: `h-9 w-full ${
|
|
10927
|
+
className: `h-9 w-full ${ta}`,
|
|
10928
10928
|
placeholder: "Custom URL"
|
|
10929
10929
|
}
|
|
10930
10930
|
),
|
|
@@ -11002,7 +11002,7 @@ function lh() {
|
|
|
11002
11002
|
/* @__PURE__ */ e(
|
|
11003
11003
|
Oe,
|
|
11004
11004
|
{
|
|
11005
|
-
className: `h-9 w-full ${
|
|
11005
|
+
className: `h-9 w-full ${ta}`,
|
|
11006
11006
|
type: "number",
|
|
11007
11007
|
step: 0.1,
|
|
11008
11008
|
value: ((I = (b = t.preferences) == null ? void 0 : b.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
|
|
@@ -11022,19 +11022,19 @@ function lh() {
|
|
|
11022
11022
|
/* @__PURE__ */ e(
|
|
11023
11023
|
Oe,
|
|
11024
11024
|
{
|
|
11025
|
-
className: `h-9 w-full ${
|
|
11025
|
+
className: `h-9 w-full ${ta}`,
|
|
11026
11026
|
type: "number",
|
|
11027
11027
|
step: 10,
|
|
11028
|
-
value: ((A = (C = (
|
|
11028
|
+
value: ((A = (C = (M = t.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : C.projectionOffset) == null ? void 0 : A[0]) || 0,
|
|
11029
11029
|
onChange: (L) => {
|
|
11030
|
-
var k, z,
|
|
11030
|
+
var k, z, D, T;
|
|
11031
11031
|
l({
|
|
11032
11032
|
...t.preferences,
|
|
11033
11033
|
mapVisualOptions: {
|
|
11034
11034
|
...(k = t.preferences) == null ? void 0 : k.mapVisualOptions,
|
|
11035
11035
|
projectionOffset: [
|
|
11036
11036
|
Number(L.target.value),
|
|
11037
|
-
((
|
|
11037
|
+
((T = (D = (z = t.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : D.projectionOffset) == null ? void 0 : T[1]) || 0
|
|
11038
11038
|
]
|
|
11039
11039
|
}
|
|
11040
11040
|
});
|
|
@@ -11045,18 +11045,18 @@ function lh() {
|
|
|
11045
11045
|
/* @__PURE__ */ e(
|
|
11046
11046
|
Oe,
|
|
11047
11047
|
{
|
|
11048
|
-
className: `h-9 w-full ${
|
|
11048
|
+
className: `h-9 w-full ${ta}`,
|
|
11049
11049
|
type: "number",
|
|
11050
11050
|
step: 10,
|
|
11051
11051
|
value: ((w = (S = (N = t.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : S.projectionOffset) == null ? void 0 : w[1]) || 0,
|
|
11052
11052
|
onChange: (L) => {
|
|
11053
|
-
var k, z,
|
|
11053
|
+
var k, z, D, T;
|
|
11054
11054
|
l({
|
|
11055
11055
|
...t.preferences,
|
|
11056
11056
|
mapVisualOptions: {
|
|
11057
11057
|
...(k = t.preferences) == null ? void 0 : k.mapVisualOptions,
|
|
11058
11058
|
projectionOffset: [
|
|
11059
|
-
((
|
|
11059
|
+
((T = (D = (z = t.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : D.projectionOffset) == null ? void 0 : T[0]) || 0,
|
|
11060
11060
|
Number(L.target.value)
|
|
11061
11061
|
]
|
|
11062
11062
|
}
|
|
@@ -11272,11 +11272,11 @@ function Ii({ color: t, onColorChange: n, onClose: s }) {
|
|
|
11272
11272
|
const h = (v) => {
|
|
11273
11273
|
l(v), x(v, i, c);
|
|
11274
11274
|
}, p = (v) => {
|
|
11275
|
-
const g = v.currentTarget.getBoundingClientRect(), b = Math.max(0, Math.min(1, (v.clientX - g.left) / g.width)), I = Math.max(0, Math.min(1, (v.clientY - g.top) / g.height)),
|
|
11276
|
-
o(
|
|
11275
|
+
const g = v.currentTarget.getBoundingClientRect(), b = Math.max(0, Math.min(1, (v.clientX - g.left) / g.width)), I = Math.max(0, Math.min(1, (v.clientY - g.top) / g.height)), M = b * 100, C = (1 - I) * 100;
|
|
11276
|
+
o(M), u(C), x(r, M, C);
|
|
11277
11277
|
}, x = (v, g, b) => {
|
|
11278
|
-
const I = uh(v, g, b),
|
|
11279
|
-
m(
|
|
11278
|
+
const I = uh(v, g, b), M = dh(I.r, I.g, I.b);
|
|
11279
|
+
m(M);
|
|
11280
11280
|
}, y = (v) => {
|
|
11281
11281
|
if (m(v), /^#[0-9A-Fa-f]{6}$/.test(v)) {
|
|
11282
11282
|
const g = Jr(v);
|
|
@@ -11471,17 +11471,17 @@ const mh = [
|
|
|
11471
11471
|
// yellow-400
|
|
11472
11472
|
];
|
|
11473
11473
|
function Ai() {
|
|
11474
|
-
var I,
|
|
11475
|
-
const t = O((
|
|
11476
|
-
var
|
|
11477
|
-
return (
|
|
11474
|
+
var I, M, C, A, N, S, w, L, k, z;
|
|
11475
|
+
const t = O((D) => D.card), n = O((D) => {
|
|
11476
|
+
var T;
|
|
11477
|
+
return (T = D.card) == null ? void 0 : T.preferences;
|
|
11478
11478
|
}), { setCardPreferences: s, updateCardInFrame: r } = ie(), { data: l } = qe(t), [i, o] = V({}), [c, u] = V(
|
|
11479
11479
|
null
|
|
11480
11480
|
), [d, m] = V(null), h = Ve(() => {
|
|
11481
11481
|
var P, F, R, j, K, Q, $;
|
|
11482
11482
|
if (!(l != null && l.records) || l.records.length === 0) return [];
|
|
11483
|
-
const
|
|
11484
|
-
if ((
|
|
11483
|
+
const D = (t == null ? void 0 : t.type) === "stackedBar" || (t == null ? void 0 : t.type) === "stackedLine", T = (t == null ? void 0 : t.type) === "bar" || (t == null ? void 0 : t.type) === "line", E = ((P = t == null ? void 0 : t.config) == null ? void 0 : P.pivotByColumns) && t.config.pivotByColumns.length > 0;
|
|
11484
|
+
if ((D || T) && E) {
|
|
11485
11485
|
if (l.pivotSchema && Array.isArray(l.pivotSchema)) {
|
|
11486
11486
|
const ne = /* @__PURE__ */ new Set();
|
|
11487
11487
|
return l.pivotSchema.forEach((ee) => {
|
|
@@ -11504,7 +11504,7 @@ function Ai() {
|
|
|
11504
11504
|
);
|
|
11505
11505
|
}
|
|
11506
11506
|
}
|
|
11507
|
-
if ((
|
|
11507
|
+
if ((T || D) && !E && ((K = (j = t == null ? void 0 : t.config) == null ? void 0 : j.metricColumns) != null && K.length))
|
|
11508
11508
|
return t.config.metricColumns.map(
|
|
11509
11509
|
(ne) => ne.alias || ne.label || ne.name
|
|
11510
11510
|
);
|
|
@@ -11519,24 +11519,24 @@ function Ai() {
|
|
|
11519
11519
|
}, [
|
|
11520
11520
|
l,
|
|
11521
11521
|
(I = t == null ? void 0 : t.config) == null ? void 0 : I.groupByColumns,
|
|
11522
|
-
(
|
|
11522
|
+
(M = t == null ? void 0 : t.config) == null ? void 0 : M.pivotByColumns,
|
|
11523
11523
|
(C = t == null ? void 0 : t.config) == null ? void 0 : C.metricColumns,
|
|
11524
11524
|
t == null ? void 0 : t.type
|
|
11525
11525
|
]), p = Ve(() => rc(), []);
|
|
11526
11526
|
ke(() => {
|
|
11527
|
-
const
|
|
11528
|
-
h.forEach((
|
|
11529
|
-
|
|
11530
|
-
|
|
11527
|
+
const D = {};
|
|
11528
|
+
h.forEach((T, E) => {
|
|
11529
|
+
D[T] = zr(
|
|
11530
|
+
T,
|
|
11531
11531
|
E,
|
|
11532
11532
|
n == null ? void 0 : n.colorConfig
|
|
11533
11533
|
);
|
|
11534
|
-
}), o(
|
|
11534
|
+
}), o(D);
|
|
11535
11535
|
}, [h, n == null ? void 0 : n.colorConfig, p]);
|
|
11536
|
-
const x = (
|
|
11536
|
+
const x = (D, T) => {
|
|
11537
11537
|
const E = {
|
|
11538
11538
|
...i,
|
|
11539
|
-
[
|
|
11539
|
+
[D]: T
|
|
11540
11540
|
};
|
|
11541
11541
|
o(E);
|
|
11542
11542
|
const P = {
|
|
@@ -11551,9 +11551,9 @@ function Ai() {
|
|
|
11551
11551
|
preferences: P
|
|
11552
11552
|
};
|
|
11553
11553
|
r(F);
|
|
11554
|
-
}, y = (
|
|
11554
|
+
}, y = (D, T) => {
|
|
11555
11555
|
var K;
|
|
11556
|
-
const E = p[
|
|
11556
|
+
const E = p[T % p.length], { [D]: P, ...F } = ((K = n == null ? void 0 : n.colorConfig) == null ? void 0 : K.segments) || {}, R = {
|
|
11557
11557
|
...n || {},
|
|
11558
11558
|
colorConfig: {
|
|
11559
11559
|
segments: F
|
|
@@ -11566,24 +11566,24 @@ function Ai() {
|
|
|
11566
11566
|
};
|
|
11567
11567
|
r(j), o((Q) => ({
|
|
11568
11568
|
...Q,
|
|
11569
|
-
[
|
|
11569
|
+
[D]: E
|
|
11570
11570
|
}));
|
|
11571
11571
|
};
|
|
11572
11572
|
if (!h.length || !((t == null ? void 0 : t.type) === "stackedBar" || (t == null ? void 0 : t.type) === "stackedLine" ? ((N = (A = t == null ? void 0 : t.config) == null ? void 0 : A.groupByColumns) == null ? void 0 : N.length) || ((w = (S = t == null ? void 0 : t.config) == null ? void 0 : S.pivotByColumns) == null ? void 0 : w.length) : (k = (L = t == null ? void 0 : t.config) == null ? void 0 : L.groupByColumns) == null ? void 0 : k.length) || ["table", "kpi", "text", "custom"].includes(t.type))
|
|
11573
11573
|
return null;
|
|
11574
11574
|
const g = () => {
|
|
11575
|
-
const
|
|
11575
|
+
const D = {
|
|
11576
11576
|
...n || {},
|
|
11577
11577
|
colorConfig: {
|
|
11578
11578
|
segments: {}
|
|
11579
11579
|
}
|
|
11580
11580
|
};
|
|
11581
|
-
s(
|
|
11582
|
-
const
|
|
11581
|
+
s(D);
|
|
11582
|
+
const T = {
|
|
11583
11583
|
...t,
|
|
11584
|
-
preferences:
|
|
11584
|
+
preferences: D
|
|
11585
11585
|
};
|
|
11586
|
-
r(
|
|
11586
|
+
r(T);
|
|
11587
11587
|
const E = {};
|
|
11588
11588
|
h.forEach((P, F) => {
|
|
11589
11589
|
E[P] = zr(P, F, void 0);
|
|
@@ -11606,23 +11606,23 @@ function Ai() {
|
|
|
11606
11606
|
]
|
|
11607
11607
|
}
|
|
11608
11608
|
) }) }),
|
|
11609
|
-
/* @__PURE__ */ e("div", { className: "max-h-[200px] space-y-2 overflow-y-auto pr-1", children: h.map((
|
|
11610
|
-
const E = lc(i[
|
|
11609
|
+
/* @__PURE__ */ e("div", { className: "max-h-[200px] space-y-2 overflow-y-auto pr-1", children: h.map((D, T) => {
|
|
11610
|
+
const E = lc(i[D], T), P = !E;
|
|
11611
11611
|
return /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
11612
11612
|
/* @__PURE__ */ a(
|
|
11613
11613
|
zt,
|
|
11614
11614
|
{
|
|
11615
|
-
open: c ===
|
|
11616
|
-
onOpenChange: (F) => u(F ?
|
|
11615
|
+
open: c === D,
|
|
11616
|
+
onOpenChange: (F) => u(F ? D : null),
|
|
11617
11617
|
children: [
|
|
11618
11618
|
/* @__PURE__ */ e(_t, { asChild: !0, children: /* @__PURE__ */ e(
|
|
11619
11619
|
"button",
|
|
11620
11620
|
{
|
|
11621
11621
|
className: "h-5 w-5 shrink-0 rounded border border-input shadow-sm transition-colors hover:border-gray-400 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
11622
|
-
style: { backgroundColor: i[
|
|
11622
|
+
style: { backgroundColor: i[D] }
|
|
11623
11623
|
}
|
|
11624
11624
|
) }),
|
|
11625
|
-
/* @__PURE__ */ e(
|
|
11625
|
+
/* @__PURE__ */ e(Qt, { align: "start", className: "w-auto p-3", children: /* @__PURE__ */ a("div", { className: "space-y-2.5", children: [
|
|
11626
11626
|
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
11627
11627
|
/* @__PURE__ */ e("p", { className: "text-xs font-medium text-muted-foreground", children: "Theme Colors" }),
|
|
11628
11628
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-1.5", children: p.slice(0, 10).map((F, R) => /* @__PURE__ */ a(
|
|
@@ -11630,14 +11630,14 @@ function Ai() {
|
|
|
11630
11630
|
{
|
|
11631
11631
|
className: G(
|
|
11632
11632
|
"relative h-5 w-5 rounded border-2 transition-all hover:scale-110",
|
|
11633
|
-
i[
|
|
11633
|
+
i[D] === F ? "border-gray-900" : "border-transparent"
|
|
11634
11634
|
),
|
|
11635
11635
|
style: { backgroundColor: F },
|
|
11636
11636
|
onClick: () => {
|
|
11637
|
-
x(
|
|
11637
|
+
x(D, F), u(null);
|
|
11638
11638
|
},
|
|
11639
11639
|
children: [
|
|
11640
|
-
R ===
|
|
11640
|
+
R === T % p.length && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "rounded-full bg-white/90 px-0.5 text-[8px] font-bold text-gray-900 shadow-sm", children: "D" }) }),
|
|
11641
11641
|
/* @__PURE__ */ e("span", { className: "sr-only", children: F })
|
|
11642
11642
|
]
|
|
11643
11643
|
},
|
|
@@ -11651,11 +11651,11 @@ function Ai() {
|
|
|
11651
11651
|
{
|
|
11652
11652
|
className: G(
|
|
11653
11653
|
"h-5 w-5 rounded border transition-all hover:scale-110",
|
|
11654
|
-
i[
|
|
11654
|
+
i[D] === F ? "border-2 border-gray-900" : F === "#ffffff" ? "border border-gray-300" : "border border-transparent"
|
|
11655
11655
|
),
|
|
11656
11656
|
style: { backgroundColor: F },
|
|
11657
11657
|
onClick: () => {
|
|
11658
|
-
x(
|
|
11658
|
+
x(D, F), u(null);
|
|
11659
11659
|
},
|
|
11660
11660
|
children: /* @__PURE__ */ e("span", { className: "sr-only", children: F })
|
|
11661
11661
|
},
|
|
@@ -11669,8 +11669,8 @@ function Ai() {
|
|
|
11669
11669
|
className: "text-sm font-medium text-blue-600 hover:text-blue-700",
|
|
11670
11670
|
onClick: () => {
|
|
11671
11671
|
m({
|
|
11672
|
-
value:
|
|
11673
|
-
color: i[
|
|
11672
|
+
value: D,
|
|
11673
|
+
color: i[D]
|
|
11674
11674
|
}), u(null);
|
|
11675
11675
|
},
|
|
11676
11676
|
children: "Custom color"
|
|
@@ -11681,7 +11681,7 @@ function Ai() {
|
|
|
11681
11681
|
{
|
|
11682
11682
|
className: "flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",
|
|
11683
11683
|
onClick: () => {
|
|
11684
|
-
y(
|
|
11684
|
+
y(D, T), u(null);
|
|
11685
11685
|
},
|
|
11686
11686
|
children: [
|
|
11687
11687
|
/* @__PURE__ */ e(Yr, { className: "h-3 w-3" }),
|
|
@@ -11694,9 +11694,9 @@ function Ai() {
|
|
|
11694
11694
|
]
|
|
11695
11695
|
}
|
|
11696
11696
|
),
|
|
11697
|
-
/* @__PURE__ */ e("span", { className: "flex-1 truncate text-sm", children:
|
|
11697
|
+
/* @__PURE__ */ e("span", { className: "flex-1 truncate text-sm", children: D }),
|
|
11698
11698
|
P && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "(custom)" })
|
|
11699
|
-
] },
|
|
11699
|
+
] }, D);
|
|
11700
11700
|
}) }),
|
|
11701
11701
|
d && /* @__PURE__ */ a("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
|
|
11702
11702
|
/* @__PURE__ */ e(
|
|
@@ -11710,8 +11710,8 @@ function Ai() {
|
|
|
11710
11710
|
Ii,
|
|
11711
11711
|
{
|
|
11712
11712
|
color: d.color,
|
|
11713
|
-
onColorChange: (
|
|
11714
|
-
x(d.value,
|
|
11713
|
+
onColorChange: (D) => {
|
|
11714
|
+
x(d.value, D), m(null);
|
|
11715
11715
|
},
|
|
11716
11716
|
onClose: () => m(null)
|
|
11717
11717
|
}
|
|
@@ -12027,7 +12027,7 @@ function br({
|
|
|
12027
12027
|
] });
|
|
12028
12028
|
}
|
|
12029
12029
|
function Qr({ axis: t, label: n, type: s, config: r, onChange: l }) {
|
|
12030
|
-
var h, p, x, y, f, v, g, b, I,
|
|
12030
|
+
var h, p, x, y, f, v, g, b, I, M, C, A;
|
|
12031
12031
|
const i = (N, S) => {
|
|
12032
12032
|
l({
|
|
12033
12033
|
...r,
|
|
@@ -12172,7 +12172,7 @@ function Qr({ axis: t, label: n, type: s, config: r, onChange: l }) {
|
|
|
12172
12172
|
{
|
|
12173
12173
|
type: "number",
|
|
12174
12174
|
placeholder: "auto",
|
|
12175
|
-
value: ((I = r == null ? void 0 : r.scale) == null ? void 0 : I.max) === "auto" || ((
|
|
12175
|
+
value: ((I = r == null ? void 0 : r.scale) == null ? void 0 : I.max) === "auto" || ((M = r == null ? void 0 : r.scale) == null ? void 0 : M.max) === void 0 ? "" : String(r.scale.max),
|
|
12176
12176
|
onSave: (N) => u("max", N),
|
|
12177
12177
|
className: ""
|
|
12178
12178
|
}
|
|
@@ -12313,7 +12313,7 @@ function Oi() {
|
|
|
12313
12313
|
] });
|
|
12314
12314
|
}
|
|
12315
12315
|
function Ri() {
|
|
12316
|
-
var S, w, L, k, z,
|
|
12316
|
+
var S, w, L, k, z, D, T, E, P;
|
|
12317
12317
|
const t = O((F) => F.card), n = O(
|
|
12318
12318
|
(F) => {
|
|
12319
12319
|
var R, j;
|
|
@@ -12383,7 +12383,7 @@ function Ri() {
|
|
|
12383
12383
|
...(i ? ["center", "left", "right"] : ["center", "top", "bottom"]).filter((R) => R !== v),
|
|
12384
12384
|
"custom"
|
|
12385
12385
|
];
|
|
12386
|
-
const b = () => dt(v), I = ["center", "start", "end"],
|
|
12386
|
+
const b = () => dt(v), I = ["center", "start", "end"], M = ["center", "start", "end", "top", "bottom"], C = u ? ["auto", "number", "currency", "percent", "none"] : ["number", "currency", "percent", "none"], A = [
|
|
12387
12387
|
{ value: "USD", label: "USD - US Dollar" },
|
|
12388
12388
|
{ value: "EUR", label: "EUR - Euro" },
|
|
12389
12389
|
{ value: "GBP", label: "GBP - British Pound" },
|
|
@@ -12467,7 +12467,7 @@ function Ri() {
|
|
|
12467
12467
|
onValueChange: (F) => p("align", F),
|
|
12468
12468
|
children: [
|
|
12469
12469
|
/* @__PURE__ */ e(ge, { className: "h-8 text-xs flex-1", children: /* @__PURE__ */ e(xe, {}) }),
|
|
12470
|
-
/* @__PURE__ */ e(ve, { children:
|
|
12470
|
+
/* @__PURE__ */ e(ve, { children: M.map((F) => /* @__PURE__ */ e(ae, { value: F, className: "text-xs", children: dt(F) }, F)) })
|
|
12471
12471
|
]
|
|
12472
12472
|
}
|
|
12473
12473
|
)
|
|
@@ -12520,7 +12520,7 @@ function Ri() {
|
|
|
12520
12520
|
/* @__PURE__ */ e(
|
|
12521
12521
|
mt,
|
|
12522
12522
|
{
|
|
12523
|
-
checked: ((
|
|
12523
|
+
checked: ((D = n == null ? void 0 : n.formatOptions) == null ? void 0 : D.useSuffix) ?? !1,
|
|
12524
12524
|
onCheckedChange: (F) => y("useSuffix", F)
|
|
12525
12525
|
}
|
|
12526
12526
|
)
|
|
@@ -12530,7 +12530,7 @@ function Ri() {
|
|
|
12530
12530
|
/* @__PURE__ */ a(
|
|
12531
12531
|
fe,
|
|
12532
12532
|
{
|
|
12533
|
-
value: ((
|
|
12533
|
+
value: ((T = n == null ? void 0 : n.formatOptions) == null ? void 0 : T.locale) || "en-US",
|
|
12534
12534
|
onValueChange: (F) => y("locale", F),
|
|
12535
12535
|
children: [
|
|
12536
12536
|
/* @__PURE__ */ e(ge, { className: "h-8 text-xs flex-1", children: /* @__PURE__ */ e(xe, {}) }),
|
|
@@ -12739,7 +12739,7 @@ function bh() {
|
|
|
12739
12739
|
}
|
|
12740
12740
|
return /* @__PURE__ */ a(st, { className: "h-full w-full text-sm", children: [
|
|
12741
12741
|
n(t),
|
|
12742
|
-
/* @__PURE__ */ e(
|
|
12742
|
+
/* @__PURE__ */ e(ra, { orientation: "horizontal" })
|
|
12743
12743
|
] });
|
|
12744
12744
|
}
|
|
12745
12745
|
function Fi({
|
|
@@ -12807,7 +12807,7 @@ function wh({ column: t }) {
|
|
|
12807
12807
|
let s = Ch;
|
|
12808
12808
|
Ut(t.type) && (s = s.filter(
|
|
12809
12809
|
(l) => ["COUNT", "DISTINCT"].includes(l.value)
|
|
12810
|
-
)),
|
|
12810
|
+
)), sa(t.type) && (s = s.filter(
|
|
12811
12811
|
(l) => !["DISTINCT"].includes(l.value)
|
|
12812
12812
|
));
|
|
12813
12813
|
function r(l) {
|
|
@@ -12959,11 +12959,11 @@ function Th({
|
|
|
12959
12959
|
isDragging: y
|
|
12960
12960
|
} = Ka({ id: t.id, data: { type: n } }), f = p ? {
|
|
12961
12961
|
opacity: y ? 0.5 : void 0,
|
|
12962
|
-
transform:
|
|
12962
|
+
transform: na.Translate.toString(p),
|
|
12963
12963
|
transition: x
|
|
12964
12964
|
} : void 0, v = Ut(t.type);
|
|
12965
12965
|
function g(A) {
|
|
12966
|
-
const N =
|
|
12966
|
+
const N = sa(A.data_type), S = Ut(A.data_type), w = Gt(A.data_type), L = N ? "number" : S ? "string" : w ? "date" : "string";
|
|
12967
12967
|
if (r === pa) {
|
|
12968
12968
|
if (S) {
|
|
12969
12969
|
const k = {
|
|
@@ -13043,7 +13043,7 @@ function Th({
|
|
|
13043
13043
|
if ((r === pa || r === ga) && A)
|
|
13044
13044
|
return /* @__PURE__ */ e(kh, { column: t });
|
|
13045
13045
|
}
|
|
13046
|
-
function
|
|
13046
|
+
function M() {
|
|
13047
13047
|
return /* @__PURE__ */ e(
|
|
13048
13048
|
"div",
|
|
13049
13049
|
{
|
|
@@ -13090,7 +13090,7 @@ function Th({
|
|
|
13090
13090
|
/* @__PURE__ */ a("div", { className: "flex h-8 grow items-center justify-between rounded-md bg-muted", children: [
|
|
13091
13091
|
C(),
|
|
13092
13092
|
I(),
|
|
13093
|
-
|
|
13093
|
+
M()
|
|
13094
13094
|
] }),
|
|
13095
13095
|
l && b()
|
|
13096
13096
|
] }),
|
|
@@ -13119,7 +13119,7 @@ function cn({
|
|
|
13119
13119
|
var f, v;
|
|
13120
13120
|
const { setNodeRef: o, isOver: c, over: u } = mr({
|
|
13121
13121
|
id: t
|
|
13122
|
-
}), d =
|
|
13122
|
+
}), d = aa((g) => g.activeId), m = O((g) => {
|
|
13123
13123
|
var b;
|
|
13124
13124
|
return (b = g.card) == null ? void 0 : b.type;
|
|
13125
13125
|
}), h = c || ((v = (f = u == null ? void 0 : u.data) == null ? void 0 : f.current) == null ? void 0 : v.type) === l, p = d ? r : s, x = l === Ls ? "Rows" : l === zs ? "Pivot Columns" : "Columns";
|
|
@@ -13127,7 +13127,7 @@ function cn({
|
|
|
13127
13127
|
if (!p || p.length === 0)
|
|
13128
13128
|
return /* @__PURE__ */ e("div", { className: "mr-5 flex h-8 grow items-center space-x-2 rounded-md border border-dashed border-muted-foreground/80 bg-background px-2 py-1 text-sm text-muted-foreground", children: /* @__PURE__ */ e("span", { className: "invisible text-muted-foreground/70 group-hover:visible", children: "Drag here" }) });
|
|
13129
13129
|
}
|
|
13130
|
-
return /* @__PURE__ */ e(
|
|
13130
|
+
return /* @__PURE__ */ e(la, { items: s == null ? void 0 : s.map((g) => g.id), children: /* @__PURE__ */ a(
|
|
13131
13131
|
"div",
|
|
13132
13132
|
{
|
|
13133
13133
|
className: G(
|
|
@@ -13171,7 +13171,7 @@ function Li({ children: t, id: n, type: s }) {
|
|
|
13171
13171
|
isDragging: u
|
|
13172
13172
|
} = Ka({ id: n, data: { type: s } }), d = o ? {
|
|
13173
13173
|
opacity: u ? 0.5 : void 0,
|
|
13174
|
-
transform:
|
|
13174
|
+
transform: na.Translate.toString(o),
|
|
13175
13175
|
transition: c
|
|
13176
13176
|
} : void 0;
|
|
13177
13177
|
return /* @__PURE__ */ e("div", { ...l, ...r, ref: i, style: d, children: t });
|
|
@@ -13225,7 +13225,7 @@ function Ih() {
|
|
|
13225
13225
|
b && l(b);
|
|
13226
13226
|
}
|
|
13227
13227
|
return /* @__PURE__ */ e(
|
|
13228
|
-
|
|
13228
|
+
la,
|
|
13229
13229
|
{
|
|
13230
13230
|
items: t.map((g) => Za(g.columnId)),
|
|
13231
13231
|
children: /* @__PURE__ */ a("div", { className: "space-y-2 rounded-md p-4 text-sm", children: [
|
|
@@ -13296,21 +13296,21 @@ function Ah() {
|
|
|
13296
13296
|
var g;
|
|
13297
13297
|
return ((g = v.card.queryConfig) == null ? void 0 : g.groupByColumns) || [];
|
|
13298
13298
|
}
|
|
13299
|
-
), n = O((v) => v.card.type), s =
|
|
13299
|
+
), n = O((v) => v.card.type), s = aa(
|
|
13300
13300
|
(v) => v.previewGroupByColumns
|
|
13301
13301
|
), r = O(
|
|
13302
13302
|
(v) => {
|
|
13303
13303
|
var g;
|
|
13304
13304
|
return ((g = v.card.queryConfig) == null ? void 0 : g.metricColumns) || [];
|
|
13305
13305
|
}
|
|
13306
|
-
), l =
|
|
13306
|
+
), l = aa(
|
|
13307
13307
|
(v) => v.previewMetricColumns
|
|
13308
13308
|
), i = O(
|
|
13309
13309
|
(v) => {
|
|
13310
13310
|
var g;
|
|
13311
13311
|
return ((g = v.card.queryConfig) == null ? void 0 : g.pivotColumns) || [];
|
|
13312
13312
|
}
|
|
13313
|
-
), o =
|
|
13313
|
+
), o = aa(
|
|
13314
13314
|
(v) => v.previewPivotColumns
|
|
13315
13315
|
), {
|
|
13316
13316
|
// setSelectedConnectionId,
|
|
@@ -13367,7 +13367,7 @@ function Ah() {
|
|
|
13367
13367
|
),
|
|
13368
13368
|
/* @__PURE__ */ e(Ih, {})
|
|
13369
13369
|
] }),
|
|
13370
|
-
/* @__PURE__ */ e(
|
|
13370
|
+
/* @__PURE__ */ e(ra, { orientation: "horizontal" })
|
|
13371
13371
|
] })
|
|
13372
13372
|
] });
|
|
13373
13373
|
}
|
|
@@ -13446,20 +13446,20 @@ function Eh({
|
|
|
13446
13446
|
}) {
|
|
13447
13447
|
const s = X((I) => I.themeStyle), r = O(
|
|
13448
13448
|
(I) => {
|
|
13449
|
-
var
|
|
13450
|
-
return (C = (
|
|
13449
|
+
var M, C;
|
|
13450
|
+
return (C = (M = I.card) == null ? void 0 : M.queryConfig) == null ? void 0 : C.filters;
|
|
13451
13451
|
}
|
|
13452
13452
|
), l = O(
|
|
13453
13453
|
(I) => {
|
|
13454
|
-
var
|
|
13455
|
-
return (C = (
|
|
13454
|
+
var M, C;
|
|
13455
|
+
return (C = (M = I.card.queryConfig) == null ? void 0 : M.filterColumns) == null ? void 0 : C.find(
|
|
13456
13456
|
(A) => A.name === t.name
|
|
13457
13457
|
);
|
|
13458
13458
|
}
|
|
13459
13459
|
), { selectedConnectionId: i, selectedDatabaseName: o, selectedTableName: c } = jt(), u = Ve(() => {
|
|
13460
13460
|
var I;
|
|
13461
13461
|
return (I = r == null ? void 0 : r.find(
|
|
13462
|
-
(
|
|
13462
|
+
(M) => M.filterColumnName === t.name
|
|
13463
13463
|
)) == null ? void 0 : I.filterValue;
|
|
13464
13464
|
}, [r, t.name]), d = Ve(() => Array.isArray(u) ? u.map(
|
|
13465
13465
|
(I) => ({
|
|
@@ -13476,8 +13476,8 @@ function Eh({
|
|
|
13476
13476
|
// not needed
|
|
13477
13477
|
dataType: t.type
|
|
13478
13478
|
}, { data: p, isLoading: x, isFetching: y, isError: f } = Ll(h), v = Ve(() => {
|
|
13479
|
-
var
|
|
13480
|
-
return h.column ? (
|
|
13479
|
+
var M;
|
|
13480
|
+
return h.column ? (M = p == null ? void 0 : p.records) == null ? void 0 : M.map((C) => {
|
|
13481
13481
|
let A = h.column.split(".").slice(-1)[0].replace(/"/g, "");
|
|
13482
13482
|
return C[A] === void 0 && (A = A.toLowerCase()), {
|
|
13483
13483
|
id: C[A],
|
|
@@ -13488,8 +13488,8 @@ function Eh({
|
|
|
13488
13488
|
}) : [];
|
|
13489
13489
|
}, [p, h.column]);
|
|
13490
13490
|
function g(I) {
|
|
13491
|
-
const
|
|
13492
|
-
m(t.name,
|
|
13491
|
+
const M = I.map((C) => C.id);
|
|
13492
|
+
m(t.name, M);
|
|
13493
13493
|
}
|
|
13494
13494
|
function b() {
|
|
13495
13495
|
return x || y ? /* @__PURE__ */ e(
|
|
@@ -13597,7 +13597,7 @@ function Rh({
|
|
|
13597
13597
|
}
|
|
13598
13598
|
),
|
|
13599
13599
|
/* @__PURE__ */ a(
|
|
13600
|
-
|
|
13600
|
+
Qt,
|
|
13601
13601
|
{
|
|
13602
13602
|
style: {
|
|
13603
13603
|
// borderRadius: currentStyle?.chart?.options?.borderRadius,
|
|
@@ -13668,11 +13668,11 @@ function Fh({
|
|
|
13668
13668
|
// not needed
|
|
13669
13669
|
dataType: t.type
|
|
13670
13670
|
}, { isLoading: u, isFetching: d, isError: m, data: h } = Ll(c), p = h == null ? void 0 : h.records, { dateRange: x, setDateRange: y, initialDateRange: f } = mc(p), { updateEditorFilterValue: v } = ie();
|
|
13671
|
-
function g(
|
|
13671
|
+
function g(M) {
|
|
13672
13672
|
var A, N;
|
|
13673
13673
|
const C = {
|
|
13674
|
-
gte: (A =
|
|
13675
|
-
lte: (N =
|
|
13674
|
+
gte: (A = M == null ? void 0 : M.from) == null ? void 0 : A.toISOString(),
|
|
13675
|
+
lte: (N = M == null ? void 0 : M.to) == null ? void 0 : N.toISOString()
|
|
13676
13676
|
};
|
|
13677
13677
|
v(t.name, C);
|
|
13678
13678
|
}
|
|
@@ -13715,7 +13715,7 @@ function Ph({
|
|
|
13715
13715
|
var y, f;
|
|
13716
13716
|
const { setNodeRef: i, isOver: o, over: c } = mr({
|
|
13717
13717
|
id: t
|
|
13718
|
-
}), u =
|
|
13718
|
+
}), u = aa((v) => v.activeId), d = {
|
|
13719
13719
|
// borderColor: isOver ? 'green' : undefined,
|
|
13720
13720
|
}, m = o || ((f = (y = c == null ? void 0 : c.data) == null ? void 0 : y.current) == null ? void 0 : f.type) === l;
|
|
13721
13721
|
function h() {
|
|
@@ -13752,7 +13752,7 @@ function Ph({
|
|
|
13752
13752
|
);
|
|
13753
13753
|
}
|
|
13754
13754
|
const x = u ? r : s;
|
|
13755
|
-
return /* @__PURE__ */ e(
|
|
13755
|
+
return /* @__PURE__ */ e(la, { items: s == null ? void 0 : s.map((v) => v.id), children: /* @__PURE__ */ a(
|
|
13756
13756
|
"div",
|
|
13757
13757
|
{
|
|
13758
13758
|
className: G(
|
|
@@ -13778,7 +13778,7 @@ function zh() {
|
|
|
13778
13778
|
var i;
|
|
13779
13779
|
return ((i = l.card.queryConfig) == null ? void 0 : i.filterColumns) || [];
|
|
13780
13780
|
}
|
|
13781
|
-
), n =
|
|
13781
|
+
), n = aa(
|
|
13782
13782
|
(l) => l.previewFilterColumns
|
|
13783
13783
|
), { removeColumnFromFilterColumns: s } = ie();
|
|
13784
13784
|
function r(l) {
|
|
@@ -13937,7 +13937,7 @@ function jh(t) {
|
|
|
13937
13937
|
setQueryConfig: y
|
|
13938
13938
|
} = ie(), f = O((q) => q.currentAssitantScope) || [], v = O((q) => q.userInputForAI), g = O((q) => q.triggerAIRun), b = O((q) => q.card), I = O(
|
|
13939
13939
|
(q) => q.selectedDatabaseName
|
|
13940
|
-
),
|
|
13940
|
+
), M = O((q) => q.selectedTableName), C = O(
|
|
13941
13941
|
(q) => q.selectedConnectionId
|
|
13942
13942
|
), A = O(
|
|
13943
13943
|
(q) => q.selectedSchemaName
|
|
@@ -13947,7 +13947,7 @@ function jh(t) {
|
|
|
13947
13947
|
errorMessage: S,
|
|
13948
13948
|
refetch: w,
|
|
13949
13949
|
data: L
|
|
13950
|
-
} = qe(b), { setTriggerAIRun: k, setCurrentAssitantScope: z, setCardConfig:
|
|
13950
|
+
} = qe(b), { setTriggerAIRun: k, setCurrentAssitantScope: z, setCardConfig: D } = ie(), { selectedDatamodelName: T, connectionType: E, selectedDatamodelId: P } = jt(), {
|
|
13951
13951
|
messages: F,
|
|
13952
13952
|
setMessages: R,
|
|
13953
13953
|
regenerate: j,
|
|
@@ -14006,8 +14006,8 @@ function jh(t) {
|
|
|
14006
14006
|
async function H({ toolCall: q }) {
|
|
14007
14007
|
var pe, Fe, be, He, Pe, se, Z, B, ce, Ae, Le, we, ze, Ke, ka, Da;
|
|
14008
14008
|
if (["createChartFromSql", "createForecast"].includes(q.toolName)) {
|
|
14009
|
-
const
|
|
14010
|
-
x(oe), h(
|
|
14009
|
+
const Zt = ((pe = q.input) == null ? void 0 : pe.sql) ?? ((Fe = q.args) == null ? void 0 : Fe.sql), vt = ((be = q.input) == null ? void 0 : be.python) ?? ((He = q.args) == null ? void 0 : He.python), oe = ((Pe = q.input) == null ? void 0 : Pe.chartType) ?? ((se = q.args) == null ? void 0 : se.chartType);
|
|
14010
|
+
x(oe), h(Zt), m(vt), p(!0), ne({
|
|
14011
14011
|
tool: q.toolName,
|
|
14012
14012
|
toolCallId: q.toolCallId,
|
|
14013
14013
|
output: {
|
|
@@ -14038,8 +14038,8 @@ function jh(t) {
|
|
|
14038
14038
|
});
|
|
14039
14039
|
} else if (q.toolName === "generateQueryConfig") {
|
|
14040
14040
|
s("Generating query config...");
|
|
14041
|
-
const
|
|
14042
|
-
((Le = q.input) == null ? void 0 : Le.cardConfig) ?? ((we = q.args) == null || we.cardConfig), x(
|
|
14041
|
+
const Zt = ((Z = q.input) == null ? void 0 : Z.chartType) ?? ((B = q.args) == null ? void 0 : B.chartType), vt = ((ce = q.input) == null ? void 0 : ce.queryConfig) ?? ((Ae = q.args) == null ? void 0 : Ae.queryConfig);
|
|
14042
|
+
((Le = q.input) == null ? void 0 : Le.cardConfig) ?? ((we = q.args) == null || we.cardConfig), x(Zt), D(vt), h(void 0), m(void 0);
|
|
14043
14043
|
const oe = await w();
|
|
14044
14044
|
if ((ze = oe == null ? void 0 : oe.data) != null && ze.error) {
|
|
14045
14045
|
ne({
|
|
@@ -14104,9 +14104,9 @@ function jh(t) {
|
|
|
14104
14104
|
const q = {
|
|
14105
14105
|
databaseName: I || "",
|
|
14106
14106
|
schemaName: A || "",
|
|
14107
|
-
tableName:
|
|
14107
|
+
tableName: M || "",
|
|
14108
14108
|
datamodelId: P || "",
|
|
14109
|
-
datamodelName: Vr(
|
|
14109
|
+
datamodelName: Vr(T),
|
|
14110
14110
|
connectionId: C || "",
|
|
14111
14111
|
connectionType: E || ""
|
|
14112
14112
|
}, pe = jr([...f, q]);
|
|
@@ -14116,8 +14116,8 @@ function jh(t) {
|
|
|
14116
14116
|
const q = {
|
|
14117
14117
|
databaseName: I || "",
|
|
14118
14118
|
schemaName: A || "",
|
|
14119
|
-
tableName:
|
|
14120
|
-
datamodelName: Vr(
|
|
14119
|
+
tableName: M || "",
|
|
14120
|
+
datamodelName: Vr(T),
|
|
14121
14121
|
connectionId: C || "",
|
|
14122
14122
|
connectionType: E || "",
|
|
14123
14123
|
datamodelId: P || ""
|
|
@@ -14172,10 +14172,10 @@ function Zr({
|
|
|
14172
14172
|
onFullscreenChange: n,
|
|
14173
14173
|
fullscreenContainer: s
|
|
14174
14174
|
}) {
|
|
14175
|
-
const r = Nt(null), [l, i] = V(!1), [o, c] = V(zl), [u, d] = V(!1), [m, h] = V(!1), [p, x] = V(!1), y = t ?? p, f = Nc(), { setCurrentAIContext: v } = _l(), { clearQueue: g } = bc(), { clearFileAttachments: b } = Cc(), I = wc("editor"),
|
|
14175
|
+
const r = Nt(null), [l, i] = V(!1), [o, c] = V(zl), [u, d] = V(!1), [m, h] = V(!1), [p, x] = V(!1), y = t ?? p, f = Nc(), { setCurrentAIContext: v } = _l(), { clearQueue: g } = bc(), { clearFileAttachments: b } = Cc(), I = wc("editor"), M = X((oe) => oe.dashboard.aiContext), C = O((oe) => oe.card.dataSource), A = O((oe) => oe.actions.setCardSql), N = O((oe) => oe.actions.setRunSql), S = O((oe) => oe.showAIDialog), w = X(
|
|
14176
14176
|
(oe) => oe.handleOpenAssistantProfile
|
|
14177
|
-
), { setShowAIDialog: L, setCardPython: k } = ie(), { setDataSource: z } = ie(), { assistantProfile:
|
|
14178
|
-
messages:
|
|
14177
|
+
), { setShowAIDialog: L, setCardPython: k } = ie(), { setDataSource: z } = ie(), { assistantProfile: D } = Sc(), {
|
|
14178
|
+
messages: T,
|
|
14179
14179
|
setMessages: E,
|
|
14180
14180
|
sendMessage: P,
|
|
14181
14181
|
isLoading: F,
|
|
@@ -14206,7 +14206,7 @@ function Zr({
|
|
|
14206
14206
|
totalMessageCount: W,
|
|
14207
14207
|
loadMoreMessages: Ne,
|
|
14208
14208
|
resetMessageWindow: re
|
|
14209
|
-
} = kc(
|
|
14209
|
+
} = kc(T, {
|
|
14210
14210
|
maxVisibleMessages: 15,
|
|
14211
14211
|
// Reduced from 50 to 15 for better performance
|
|
14212
14212
|
initialLoadCount: 10,
|
|
@@ -14225,7 +14225,7 @@ function Zr({
|
|
|
14225
14225
|
threshold: 50,
|
|
14226
14226
|
delay: 0,
|
|
14227
14227
|
// No delay for real-time scrolling
|
|
14228
|
-
dependencies: [j,
|
|
14228
|
+
dependencies: [j, T.length]
|
|
14229
14229
|
// Also trigger on status changes and total message count
|
|
14230
14230
|
});
|
|
14231
14231
|
ke(() => {
|
|
@@ -14239,7 +14239,7 @@ function Zr({
|
|
|
14239
14239
|
isLoading: F,
|
|
14240
14240
|
sendMessage: P
|
|
14241
14241
|
});
|
|
14242
|
-
const { hasActiveTools: se } = Mc(
|
|
14242
|
+
const { hasActiveTools: se } = Mc(T), Z = Se(
|
|
14243
14243
|
(oe) => {
|
|
14244
14244
|
n == null || n(oe), t === void 0 && x(oe);
|
|
14245
14245
|
},
|
|
@@ -14263,7 +14263,7 @@ function Zr({
|
|
|
14263
14263
|
},
|
|
14264
14264
|
[P, be]
|
|
14265
14265
|
), ce = Se(async () => {
|
|
14266
|
-
const oe = JSON.stringify(
|
|
14266
|
+
const oe = JSON.stringify(T ?? [], null, 2);
|
|
14267
14267
|
try {
|
|
14268
14268
|
if (typeof navigator > "u" || !navigator.clipboard)
|
|
14269
14269
|
throw new Error("Clipboard API unavailable");
|
|
@@ -14271,7 +14271,7 @@ function Zr({
|
|
|
14271
14271
|
} catch (at) {
|
|
14272
14272
|
console.error("Failed to copy conversation", at), he.error("Unable to copy conversation");
|
|
14273
14273
|
}
|
|
14274
|
-
}, [
|
|
14274
|
+
}, [T]), Ae = Se(() => {
|
|
14275
14275
|
Z(!y);
|
|
14276
14276
|
}, [y, Z]);
|
|
14277
14277
|
function Le(oe, at) {
|
|
@@ -14279,7 +14279,7 @@ function Zr({
|
|
|
14279
14279
|
}
|
|
14280
14280
|
function we() {
|
|
14281
14281
|
f.selectedEntities.length === 0 && v({
|
|
14282
|
-
selectedEntities: (
|
|
14282
|
+
selectedEntities: (M == null ? void 0 : M.selectedEntities) || []
|
|
14283
14283
|
});
|
|
14284
14284
|
}
|
|
14285
14285
|
function ze(oe) {
|
|
@@ -14342,7 +14342,7 @@ function Zr({
|
|
|
14342
14342
|
function Da() {
|
|
14343
14343
|
return /* @__PURE__ */ e("div", { "data-role": "header", children: /* @__PURE__ */ e("div", { className: "text-lg font-semibold", children: "Assistant" }) });
|
|
14344
14344
|
}
|
|
14345
|
-
const
|
|
14345
|
+
const Zt = (ne == null ? void 0 : ne.length) === 0 && (T == null ? void 0 : T.filter((oe) => oe.role === "user").length) === 0, vt = /* @__PURE__ */ a(
|
|
14346
14346
|
"div",
|
|
14347
14347
|
{
|
|
14348
14348
|
"data-role": "editor-assistant",
|
|
@@ -14365,7 +14365,7 @@ function Zr({
|
|
|
14365
14365
|
size: "sm",
|
|
14366
14366
|
className: "h-7 p-2",
|
|
14367
14367
|
onClick: w,
|
|
14368
|
-
children: (
|
|
14368
|
+
children: (D == null ? void 0 : D.name) || "Default Profile"
|
|
14369
14369
|
}
|
|
14370
14370
|
),
|
|
14371
14371
|
/* @__PURE__ */ a("div", { "data-role": "header-actions", className: "flex items-center", children: [
|
|
@@ -14474,17 +14474,17 @@ function Zr({
|
|
|
14474
14474
|
) }),
|
|
14475
14475
|
/* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
14476
14476
|
/* @__PURE__ */ a("div", { children: [
|
|
14477
|
-
|
|
14477
|
+
Zt && !D && /* @__PURE__ */ e(
|
|
14478
14478
|
Rc,
|
|
14479
14479
|
{
|
|
14480
14480
|
onClick: ze,
|
|
14481
14481
|
placeholders: Bh
|
|
14482
14482
|
}
|
|
14483
14483
|
),
|
|
14484
|
-
/* @__PURE__ */ e("div", { children:
|
|
14484
|
+
/* @__PURE__ */ e("div", { children: Zt && D && /* @__PURE__ */ e(
|
|
14485
14485
|
Fc,
|
|
14486
14486
|
{
|
|
14487
|
-
seedQuestions:
|
|
14487
|
+
seedQuestions: D.seedQuestions || [],
|
|
14488
14488
|
handleSeedQuestionClick: Ke
|
|
14489
14489
|
}
|
|
14490
14490
|
) })
|
|
@@ -14555,47 +14555,47 @@ const wr = (t) => {
|
|
|
14555
14555
|
switch (z) {
|
|
14556
14556
|
case "groupBy":
|
|
14557
14557
|
return (t.config.groupByColumns || []).map(
|
|
14558
|
-
(
|
|
14559
|
-
id:
|
|
14560
|
-
name:
|
|
14561
|
-
dataType:
|
|
14562
|
-
label:
|
|
14563
|
-
qualifiedEntityName:
|
|
14564
|
-
entityId:
|
|
14565
|
-
entityName:
|
|
14566
|
-
entityType:
|
|
14567
|
-
dateFormat:
|
|
14568
|
-
customFormat:
|
|
14569
|
-
granularity:
|
|
14558
|
+
(D) => ({
|
|
14559
|
+
id: D.id,
|
|
14560
|
+
name: D.name,
|
|
14561
|
+
dataType: D.dataType,
|
|
14562
|
+
label: D.label !== void 0 ? D.label : D.name,
|
|
14563
|
+
qualifiedEntityName: D.qualifiedEntityName,
|
|
14564
|
+
entityId: D.entityId,
|
|
14565
|
+
entityName: D.entityName,
|
|
14566
|
+
entityType: D.entityType,
|
|
14567
|
+
dateFormat: D.dateFormat,
|
|
14568
|
+
customFormat: D.customFormat,
|
|
14569
|
+
granularity: D.granularity
|
|
14570
14570
|
})
|
|
14571
14571
|
);
|
|
14572
14572
|
case "metrics":
|
|
14573
14573
|
return t.config.metricColumns || [];
|
|
14574
14574
|
case "pivotBy":
|
|
14575
14575
|
return (t.config.pivotByColumns || []).map(
|
|
14576
|
-
(
|
|
14577
|
-
id:
|
|
14578
|
-
name:
|
|
14579
|
-
dataType:
|
|
14580
|
-
label:
|
|
14581
|
-
qualifiedEntityName:
|
|
14582
|
-
entityId:
|
|
14583
|
-
entityName:
|
|
14584
|
-
entityType:
|
|
14576
|
+
(D) => ({
|
|
14577
|
+
id: D.id,
|
|
14578
|
+
name: D.name,
|
|
14579
|
+
dataType: D.dataType,
|
|
14580
|
+
label: D.label !== void 0 ? D.label : D.name,
|
|
14581
|
+
qualifiedEntityName: D.qualifiedEntityName,
|
|
14582
|
+
entityId: D.entityId,
|
|
14583
|
+
entityName: D.entityName,
|
|
14584
|
+
entityType: D.entityType
|
|
14585
14585
|
})
|
|
14586
14586
|
);
|
|
14587
14587
|
case "sortBy":
|
|
14588
14588
|
return (t.config.sortByColumns || []).map(
|
|
14589
|
-
(
|
|
14590
|
-
id:
|
|
14591
|
-
name:
|
|
14592
|
-
dataType:
|
|
14593
|
-
label:
|
|
14594
|
-
qualifiedEntityName:
|
|
14595
|
-
entityId:
|
|
14596
|
-
entityName:
|
|
14597
|
-
entityType:
|
|
14598
|
-
direction:
|
|
14589
|
+
(D) => ({
|
|
14590
|
+
id: D.id,
|
|
14591
|
+
name: D.name,
|
|
14592
|
+
dataType: D.dataType,
|
|
14593
|
+
label: D.label !== void 0 ? D.label : D.name,
|
|
14594
|
+
qualifiedEntityName: D.qualifiedEntityName,
|
|
14595
|
+
entityId: D.entityId,
|
|
14596
|
+
entityName: D.entityName,
|
|
14597
|
+
entityType: D.entityType,
|
|
14598
|
+
direction: D.direction
|
|
14599
14599
|
})
|
|
14600
14600
|
);
|
|
14601
14601
|
case "source":
|
|
@@ -14606,30 +14606,30 @@ const wr = (t) => {
|
|
|
14606
14606
|
},
|
|
14607
14607
|
[t]
|
|
14608
14608
|
), x = Se(
|
|
14609
|
-
(z,
|
|
14609
|
+
(z, D) => {
|
|
14610
14610
|
if (h)
|
|
14611
14611
|
switch (z) {
|
|
14612
14612
|
case "groupBy": {
|
|
14613
14613
|
n(h, {
|
|
14614
|
-
groupByColumns:
|
|
14614
|
+
groupByColumns: D
|
|
14615
14615
|
});
|
|
14616
14616
|
break;
|
|
14617
14617
|
}
|
|
14618
14618
|
case "metrics": {
|
|
14619
14619
|
n(h, {
|
|
14620
|
-
metricColumns:
|
|
14620
|
+
metricColumns: D
|
|
14621
14621
|
});
|
|
14622
14622
|
break;
|
|
14623
14623
|
}
|
|
14624
14624
|
case "pivotBy": {
|
|
14625
14625
|
n(h, {
|
|
14626
|
-
pivotByColumns:
|
|
14626
|
+
pivotByColumns: D
|
|
14627
14627
|
});
|
|
14628
14628
|
break;
|
|
14629
14629
|
}
|
|
14630
14630
|
case "sortBy": {
|
|
14631
14631
|
n(h, {
|
|
14632
|
-
sortByColumns:
|
|
14632
|
+
sortByColumns: D
|
|
14633
14633
|
});
|
|
14634
14634
|
break;
|
|
14635
14635
|
}
|
|
@@ -14643,22 +14643,22 @@ const wr = (t) => {
|
|
|
14643
14643
|
// createSortByColumn,
|
|
14644
14644
|
]
|
|
14645
14645
|
), y = Se(
|
|
14646
|
-
(z,
|
|
14646
|
+
(z, D, T) => {
|
|
14647
14647
|
if (!h) return;
|
|
14648
|
-
const P = p(z)[
|
|
14648
|
+
const P = p(z)[D];
|
|
14649
14649
|
if (P)
|
|
14650
14650
|
switch (z) {
|
|
14651
14651
|
case "groupBy":
|
|
14652
|
-
s(h, P.id, { label:
|
|
14652
|
+
s(h, P.id, { label: T });
|
|
14653
14653
|
break;
|
|
14654
14654
|
case "metrics":
|
|
14655
|
-
r(h, P.id, { label:
|
|
14655
|
+
r(h, P.id, { label: T });
|
|
14656
14656
|
break;
|
|
14657
14657
|
case "pivotBy":
|
|
14658
|
-
l(h, P.id, { label:
|
|
14658
|
+
l(h, P.id, { label: T });
|
|
14659
14659
|
break;
|
|
14660
14660
|
case "sortBy":
|
|
14661
|
-
i(h, P.id, { label:
|
|
14661
|
+
i(h, P.id, { label: T });
|
|
14662
14662
|
break;
|
|
14663
14663
|
}
|
|
14664
14664
|
},
|
|
@@ -14671,58 +14671,58 @@ const wr = (t) => {
|
|
|
14671
14671
|
i
|
|
14672
14672
|
]
|
|
14673
14673
|
), f = Se(
|
|
14674
|
-
(z,
|
|
14674
|
+
(z, D) => {
|
|
14675
14675
|
if (!h) return;
|
|
14676
14676
|
const E = p("metrics")[z];
|
|
14677
14677
|
E && r(h, E.id, {
|
|
14678
|
-
aggregate:
|
|
14678
|
+
aggregate: D,
|
|
14679
14679
|
label: zc(
|
|
14680
14680
|
E.name,
|
|
14681
|
-
|
|
14681
|
+
D
|
|
14682
14682
|
)
|
|
14683
14683
|
});
|
|
14684
14684
|
},
|
|
14685
14685
|
[h, p, r]
|
|
14686
14686
|
), v = Se(
|
|
14687
|
-
(z,
|
|
14687
|
+
(z, D, T) => {
|
|
14688
14688
|
if (!h) return;
|
|
14689
14689
|
const P = p("groupBy")[z];
|
|
14690
14690
|
if (!P) return;
|
|
14691
14691
|
const F = {
|
|
14692
|
-
dateFormat:
|
|
14692
|
+
dateFormat: D
|
|
14693
14693
|
};
|
|
14694
|
-
|
|
14694
|
+
D === "custom" && T ? F.customFormat = T : F.customFormat = void 0, s(h, P.id, F);
|
|
14695
14695
|
},
|
|
14696
14696
|
[h, p, s]
|
|
14697
14697
|
), g = Se(
|
|
14698
|
-
(z,
|
|
14698
|
+
(z, D) => {
|
|
14699
14699
|
if (!h) return;
|
|
14700
14700
|
const E = p("groupBy")[z];
|
|
14701
14701
|
E && s(h, E.id, {
|
|
14702
|
-
granularity:
|
|
14702
|
+
granularity: D
|
|
14703
14703
|
});
|
|
14704
14704
|
},
|
|
14705
14705
|
[h, p, s]
|
|
14706
14706
|
), b = Se(
|
|
14707
|
-
(z,
|
|
14707
|
+
(z, D) => {
|
|
14708
14708
|
if (!h) return;
|
|
14709
14709
|
const E = p("metrics")[z];
|
|
14710
14710
|
E && r(h, E.id, {
|
|
14711
|
-
aliasTemplate:
|
|
14711
|
+
aliasTemplate: D
|
|
14712
14712
|
});
|
|
14713
14713
|
},
|
|
14714
14714
|
[h, p, r]
|
|
14715
14715
|
), I = Se(
|
|
14716
|
-
(z,
|
|
14717
|
-
if (console.log("handleValueAliasesChange", z,
|
|
14718
|
-
console.log("handleValueAliasesChange", z,
|
|
14716
|
+
(z, D) => {
|
|
14717
|
+
if (console.log("handleValueAliasesChange", z, D), !h) return;
|
|
14718
|
+
console.log("handleValueAliasesChange", z, D);
|
|
14719
14719
|
const E = p("metrics")[z];
|
|
14720
|
-
E && (console.log("handleValueAliasesChange",
|
|
14721
|
-
valueAliases:
|
|
14720
|
+
E && (console.log("handleValueAliasesChange", D), r(h, E.id, {
|
|
14721
|
+
valueAliases: D
|
|
14722
14722
|
}));
|
|
14723
14723
|
},
|
|
14724
14724
|
[h, p, r]
|
|
14725
|
-
),
|
|
14725
|
+
), M = Se(
|
|
14726
14726
|
(z) => {
|
|
14727
14727
|
h && n(h, { comparisonType: z });
|
|
14728
14728
|
},
|
|
@@ -14751,15 +14751,15 @@ const wr = (t) => {
|
|
|
14751
14751
|
(z) => {
|
|
14752
14752
|
var j;
|
|
14753
14753
|
if (!h) return;
|
|
14754
|
-
const
|
|
14754
|
+
const D = [
|
|
14755
14755
|
...p("groupBy"),
|
|
14756
14756
|
...p("pivotBy"),
|
|
14757
14757
|
...p("metrics"),
|
|
14758
14758
|
...p("sortBy")
|
|
14759
|
-
],
|
|
14759
|
+
], T = (j = t == null ? void 0 : t.config) == null ? void 0 : j.joinPlan, E = _c(
|
|
14760
14760
|
z,
|
|
14761
|
-
|
|
14762
|
-
|
|
14761
|
+
D,
|
|
14762
|
+
T
|
|
14763
14763
|
);
|
|
14764
14764
|
if (!E.isValid) {
|
|
14765
14765
|
E.showError && hn();
|
|
@@ -14767,7 +14767,7 @@ const wr = (t) => {
|
|
|
14767
14767
|
}
|
|
14768
14768
|
const P = Vc(
|
|
14769
14769
|
z,
|
|
14770
|
-
|
|
14770
|
+
D
|
|
14771
14771
|
), F = p(P);
|
|
14772
14772
|
if (Ts(z, F)) return;
|
|
14773
14773
|
const R = Ms(z, P, F);
|
|
@@ -14780,9 +14780,9 @@ const wr = (t) => {
|
|
|
14780
14780
|
x
|
|
14781
14781
|
]
|
|
14782
14782
|
), L = Se(
|
|
14783
|
-
(z,
|
|
14783
|
+
(z, D) => {
|
|
14784
14784
|
if (!h) return;
|
|
14785
|
-
const E = p(z)[
|
|
14785
|
+
const E = p(z)[D];
|
|
14786
14786
|
if (E) {
|
|
14787
14787
|
if (z !== "sortBy") {
|
|
14788
14788
|
const P = p("sortBy"), F = P.filter(
|
|
@@ -14830,7 +14830,7 @@ const wr = (t) => {
|
|
|
14830
14830
|
removeField: L,
|
|
14831
14831
|
handleFieldClick: w,
|
|
14832
14832
|
// KPI-specific handlers
|
|
14833
|
-
handleKpiComparisonTypeChange:
|
|
14833
|
+
handleKpiComparisonTypeChange: M,
|
|
14834
14834
|
handleKpiShowTrendlineChange: C,
|
|
14835
14835
|
handleKpiTrendlineWindowChange: A,
|
|
14836
14836
|
handleKpiTrendlineGranularityChange: N,
|
|
@@ -14858,7 +14858,7 @@ function Gh({ field: t }) {
|
|
|
14858
14858
|
transition: i,
|
|
14859
14859
|
isDragging: o
|
|
14860
14860
|
} = Ka({ id: t.id }), [c, u] = V(!1), d = O((y) => y.card), { handleFieldClick: m } = wr(d), h = {
|
|
14861
|
-
transform:
|
|
14861
|
+
transform: na.Transform.toString(l),
|
|
14862
14862
|
transition: i
|
|
14863
14863
|
};
|
|
14864
14864
|
Ge(t.dataType);
|
|
@@ -14965,16 +14965,16 @@ function $h() {
|
|
|
14965
14965
|
), m = (I) => {
|
|
14966
14966
|
if (I.dataType === "number" || I.dataType === "integer" || I.dataType === "float" || I.dataType === "decimal" || I.dataType === "currency")
|
|
14967
14967
|
return "metrics";
|
|
14968
|
-
const
|
|
14969
|
-
return ["date", "string", "boolean"].includes(
|
|
14968
|
+
const M = Ge(I.dataType);
|
|
14969
|
+
return ["date", "string", "boolean"].includes(M) ? "dimensions" : M === "number" ? "metrics" : "dimensions";
|
|
14970
14970
|
}, p = (s === "all" ? d : d.filter(
|
|
14971
14971
|
(I) => m(I) === s
|
|
14972
|
-
)).reduce((I,
|
|
14973
|
-
const C =
|
|
14972
|
+
)).reduce((I, M) => {
|
|
14973
|
+
const C = M.qualifiedEntityName || "Other Fields";
|
|
14974
14974
|
return I[C] || (I[C] = {
|
|
14975
|
-
label: jc(
|
|
14975
|
+
label: jc(M.entityName),
|
|
14976
14976
|
fields: []
|
|
14977
|
-
}), I[C].fields.push(
|
|
14977
|
+
}), I[C].fields.push(M), I;
|
|
14978
14978
|
}, {}), y = Object.keys(p), f = d.filter(
|
|
14979
14979
|
(I) => m(I) === "dimensions"
|
|
14980
14980
|
).length, v = d.filter(
|
|
@@ -15049,10 +15049,10 @@ function $h() {
|
|
|
15049
15049
|
type: "multiple",
|
|
15050
15050
|
defaultValue: y,
|
|
15051
15051
|
className: "space-y-2",
|
|
15052
|
-
children: Object.entries(p).map(([I,
|
|
15052
|
+
children: Object.entries(p).map(([I, M]) => {
|
|
15053
15053
|
const C = o.find((A) => A.entityName === I) || {
|
|
15054
15054
|
entityName: I,
|
|
15055
|
-
label:
|
|
15055
|
+
label: M.label
|
|
15056
15056
|
};
|
|
15057
15057
|
return /* @__PURE__ */ a(
|
|
15058
15058
|
Te,
|
|
@@ -15072,13 +15072,13 @@ function $h() {
|
|
|
15072
15072
|
{
|
|
15073
15073
|
variant: "secondary",
|
|
15074
15074
|
className: "rounded-full text-xs text-muted-foreground group-hover:bg-background",
|
|
15075
|
-
children:
|
|
15075
|
+
children: M.fields.length
|
|
15076
15076
|
}
|
|
15077
15077
|
)
|
|
15078
15078
|
]
|
|
15079
15079
|
}
|
|
15080
15080
|
) }),
|
|
15081
|
-
/* @__PURE__ */ e(Ie, { className: "pb-2", children: /* @__PURE__ */ e("div", { className: "space-y-1", children:
|
|
15081
|
+
/* @__PURE__ */ e(Ie, { className: "pb-2", children: /* @__PURE__ */ e("div", { className: "space-y-1", children: M.fields.map((A) => /* @__PURE__ */ e(Gh, { field: A }, A.id)) }) })
|
|
15082
15082
|
]
|
|
15083
15083
|
},
|
|
15084
15084
|
I
|
|
@@ -15091,8 +15091,8 @@ function $h() {
|
|
|
15091
15091
|
/* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-400", children: "Try selecting different data sources" })
|
|
15092
15092
|
] }),
|
|
15093
15093
|
Object.keys(p).length === 0 && i.length > 0 && /* @__PURE__ */ e("div", { className: "py-4 text-center text-sm text-gray-500", children: "No fields found for this category" }),
|
|
15094
|
-
/* @__PURE__ */ e(
|
|
15095
|
-
/* @__PURE__ */ e(
|
|
15094
|
+
/* @__PURE__ */ e(ra, { orientation: "horizontal" }),
|
|
15095
|
+
/* @__PURE__ */ e(ra, { orientation: "vertical" })
|
|
15096
15096
|
] })
|
|
15097
15097
|
] });
|
|
15098
15098
|
}
|
|
@@ -15143,18 +15143,18 @@ function qh({
|
|
|
15143
15143
|
}), i(new Set([...l].filter((N) => N !== A)));
|
|
15144
15144
|
}, u = (A, N) => {
|
|
15145
15145
|
var k, z;
|
|
15146
|
-
const S = s.joins.find((
|
|
15146
|
+
const S = s.joins.find((D) => D.id === A);
|
|
15147
15147
|
if (!S) return;
|
|
15148
15148
|
const w = { ...S, ...N }, L = s.joins.map(
|
|
15149
|
-
(
|
|
15149
|
+
(D) => D.id === A ? w : D
|
|
15150
15150
|
);
|
|
15151
15151
|
if ((k = w.source) != null && k.name && ((z = w.target) != null && z.name) && w.joinKeyGroups[0].keys.length === 0) {
|
|
15152
|
-
const
|
|
15152
|
+
const D = n.find(
|
|
15153
15153
|
(F) => {
|
|
15154
15154
|
var R;
|
|
15155
15155
|
return F.name === ((R = w.source) == null ? void 0 : R.name);
|
|
15156
15156
|
}
|
|
15157
|
-
),
|
|
15157
|
+
), T = n.find(
|
|
15158
15158
|
(F) => {
|
|
15159
15159
|
var R;
|
|
15160
15160
|
return F.name === ((R = w.target) == null ? void 0 : R.name);
|
|
@@ -15167,9 +15167,9 @@ function qh({
|
|
|
15167
15167
|
dataType: "",
|
|
15168
15168
|
label: "",
|
|
15169
15169
|
qualifiedFieldName: "",
|
|
15170
|
-
entityId: (
|
|
15171
|
-
entityName: (
|
|
15172
|
-
entityType: (
|
|
15170
|
+
entityId: (D == null ? void 0 : D.name) || "",
|
|
15171
|
+
entityName: (D == null ? void 0 : D.name) || "",
|
|
15172
|
+
entityType: (D == null ? void 0 : D.type) || "table"
|
|
15173
15173
|
},
|
|
15174
15174
|
target: {
|
|
15175
15175
|
id: `target-${Date.now()}`,
|
|
@@ -15177,9 +15177,9 @@ function qh({
|
|
|
15177
15177
|
dataType: "",
|
|
15178
15178
|
label: "",
|
|
15179
15179
|
qualifiedFieldName: "",
|
|
15180
|
-
entityId: (
|
|
15181
|
-
entityName: (
|
|
15182
|
-
entityType: (
|
|
15180
|
+
entityId: (T == null ? void 0 : T.name) || "",
|
|
15181
|
+
entityName: (T == null ? void 0 : T.name) || "",
|
|
15182
|
+
entityType: (T == null ? void 0 : T.type) || "table"
|
|
15183
15183
|
},
|
|
15184
15184
|
operator: "="
|
|
15185
15185
|
}, P = [...w.joinKeyGroups];
|
|
@@ -15204,8 +15204,8 @@ function qh({
|
|
|
15204
15204
|
const N = s.joins.findIndex((S) => S.id === A);
|
|
15205
15205
|
if (N > 0) {
|
|
15206
15206
|
const S = [...s.joins], w = { ...S[N] }, L = { ...S[N - 1] };
|
|
15207
|
-
S[N] = L, S[N - 1] = w, S.forEach((z,
|
|
15208
|
-
z.sequence =
|
|
15207
|
+
S[N] = L, S[N - 1] = w, S.forEach((z, D) => {
|
|
15208
|
+
z.sequence = D + 1;
|
|
15209
15209
|
});
|
|
15210
15210
|
const k = {
|
|
15211
15211
|
...s,
|
|
@@ -15218,8 +15218,8 @@ function qh({
|
|
|
15218
15218
|
const N = s.joins.findIndex((S) => S.id === A);
|
|
15219
15219
|
if (N < s.joins.length - 1) {
|
|
15220
15220
|
const S = [...s.joins], w = { ...S[N] }, L = { ...S[N + 1] };
|
|
15221
|
-
S[N] = L, S[N + 1] = w, S.forEach((z,
|
|
15222
|
-
z.sequence =
|
|
15221
|
+
S[N] = L, S[N + 1] = w, S.forEach((z, D) => {
|
|
15222
|
+
z.sequence = D + 1;
|
|
15223
15223
|
});
|
|
15224
15224
|
const k = {
|
|
15225
15225
|
...s,
|
|
@@ -15270,12 +15270,12 @@ function qh({
|
|
|
15270
15270
|
w.splice(N, 1), u(A, { joinKeyGroups: w });
|
|
15271
15271
|
},
|
|
15272
15272
|
addJoinKey: (A, N) => {
|
|
15273
|
-
const S = s.joins.find((
|
|
15273
|
+
const S = s.joins.find((D) => D.id === A);
|
|
15274
15274
|
if (!S) return;
|
|
15275
15275
|
const w = n.find(
|
|
15276
|
-
(
|
|
15276
|
+
(D) => D.name === S.source.name
|
|
15277
15277
|
), L = n.find(
|
|
15278
|
-
(
|
|
15278
|
+
(D) => D.name === S.target.name
|
|
15279
15279
|
), k = [...S.joinKeyGroups], z = {
|
|
15280
15280
|
id: `key-${Date.now()}`,
|
|
15281
15281
|
source: {
|
|
@@ -15310,25 +15310,25 @@ function qh({
|
|
|
15310
15310
|
if (!k) return;
|
|
15311
15311
|
const z = n.find(
|
|
15312
15312
|
(P) => P.name === k.source.name
|
|
15313
|
-
),
|
|
15313
|
+
), D = n.find(
|
|
15314
15314
|
(P) => P.name === k.target.name
|
|
15315
|
-
),
|
|
15316
|
-
w === "sourceColumnName" && z ?
|
|
15315
|
+
), T = [...k.joinKeyGroups], E = T[N].keys[S];
|
|
15316
|
+
w === "sourceColumnName" && z ? T[N].keys[S] = {
|
|
15317
15317
|
...E,
|
|
15318
15318
|
source: {
|
|
15319
15319
|
...E.source,
|
|
15320
15320
|
name: L
|
|
15321
15321
|
}
|
|
15322
|
-
} : w === "targetColumnName" &&
|
|
15322
|
+
} : w === "targetColumnName" && D ? T[N].keys[S] = {
|
|
15323
15323
|
...E,
|
|
15324
15324
|
target: {
|
|
15325
15325
|
...E.target,
|
|
15326
15326
|
name: L
|
|
15327
15327
|
}
|
|
15328
|
-
} : w === "operator" && (
|
|
15328
|
+
} : w === "operator" && (T[N].keys[S] = {
|
|
15329
15329
|
...E,
|
|
15330
15330
|
operator: L
|
|
15331
|
-
}), u(A, { joinKeyGroups:
|
|
15331
|
+
}), u(A, { joinKeyGroups: T });
|
|
15332
15332
|
},
|
|
15333
15333
|
removeJoinKey: (A, N, S) => {
|
|
15334
15334
|
const w = s.joins.find((k) => k.id === A);
|
|
@@ -15346,11 +15346,11 @@ function qh({
|
|
|
15346
15346
|
FROM ${N.name}`;
|
|
15347
15347
|
return A.forEach((w) => {
|
|
15348
15348
|
const L = n.find(
|
|
15349
|
-
(
|
|
15349
|
+
(D) => D.name === w.target.name
|
|
15350
15350
|
);
|
|
15351
15351
|
if (!L) return;
|
|
15352
|
-
const k = w.joinKeyGroups.filter((
|
|
15353
|
-
const
|
|
15352
|
+
const k = w.joinKeyGroups.filter((D) => D.keys && D.keys.length > 0).map((D) => {
|
|
15353
|
+
const T = D.keys.filter(
|
|
15354
15354
|
(E) => {
|
|
15355
15355
|
var P, F, R, j;
|
|
15356
15356
|
return ((P = E.source) == null ? void 0 : P.name) && ((F = E.target) == null ? void 0 : F.name) && ((R = E.source) == null ? void 0 : R.entityName) && ((j = E.target) == null ? void 0 : j.entityName);
|
|
@@ -15358,7 +15358,7 @@ FROM ${N.name}`;
|
|
|
15358
15358
|
).map(
|
|
15359
15359
|
(E) => `${E.source.entityName}.${E.source.name} ${E.operator} ${E.target.entityName}.${E.target.name}`
|
|
15360
15360
|
);
|
|
15361
|
-
return
|
|
15361
|
+
return T.length > 1 ? `(${T.join(` ${D.operator} `)})` : T[0];
|
|
15362
15362
|
}).filter(Boolean), z = k.length > 1 ? k.join(" OR ") : k[0] || "condition_here";
|
|
15363
15363
|
S += `
|
|
15364
15364
|
${w.joinType} JOIN ${L.name}
|
|
@@ -15401,7 +15401,7 @@ function Kh({
|
|
|
15401
15401
|
getAvailableTargetEntities: g,
|
|
15402
15402
|
addJoinKeyGroup: b,
|
|
15403
15403
|
updateGroupOperator: I,
|
|
15404
|
-
removeJoinKeyGroup:
|
|
15404
|
+
removeJoinKeyGroup: M,
|
|
15405
15405
|
addJoinKey: C,
|
|
15406
15406
|
updateJoinKey: A,
|
|
15407
15407
|
removeJoinKey: N,
|
|
@@ -15411,7 +15411,7 @@ function Kh({
|
|
|
15411
15411
|
initialJoinPlan: t,
|
|
15412
15412
|
availableDataSources: n
|
|
15413
15413
|
}), L = (k) => {
|
|
15414
|
-
const z = o.find((
|
|
15414
|
+
const z = o.find((D) => D.entityName === k);
|
|
15415
15415
|
return (z == null ? void 0 : z.columns) || [];
|
|
15416
15416
|
};
|
|
15417
15417
|
return /* @__PURE__ */ a("div", { className: "space-y-6", children: [
|
|
@@ -15423,7 +15423,7 @@ function Kh({
|
|
|
15423
15423
|
value: c.baseEntity.name,
|
|
15424
15424
|
onValueChange: (k) => {
|
|
15425
15425
|
const z = n.find(
|
|
15426
|
-
(
|
|
15426
|
+
(D) => D.name === k
|
|
15427
15427
|
);
|
|
15428
15428
|
d({
|
|
15429
15429
|
...c,
|
|
@@ -15476,9 +15476,9 @@ function Kh({
|
|
|
15476
15476
|
c.joins.length === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg border border-dashed py-8 text-center text-muted-foreground", children: /* @__PURE__ */ e("p", { children: "No joins configured. Add a join to connect multiple data sources." }) }) : /* @__PURE__ */ e("div", { className: "max-h-[300px] space-y-4 overflow-y-auto", children: c.joins.map((k) => {
|
|
15477
15477
|
const z = n.find(
|
|
15478
15478
|
(E) => E.name === k.source.name
|
|
15479
|
-
),
|
|
15479
|
+
), D = n.find(
|
|
15480
15480
|
(E) => E.name === k.target.name
|
|
15481
|
-
),
|
|
15481
|
+
), T = u.has(k.id);
|
|
15482
15482
|
return /* @__PURE__ */ a(Ca, { className: "border", children: [
|
|
15483
15483
|
/* @__PURE__ */ e(In, { className: "pb-3", children: /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
15484
15484
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
@@ -15486,11 +15486,11 @@ function Kh({
|
|
|
15486
15486
|
/* @__PURE__ */ a(An, { className: "text-sm", children: [
|
|
15487
15487
|
"Join ",
|
|
15488
15488
|
k.sequence,
|
|
15489
|
-
z &&
|
|
15489
|
+
z && D && /* @__PURE__ */ a("span", { className: "ml-2 font-normal text-gray-600", children: [
|
|
15490
15490
|
"(",
|
|
15491
15491
|
z.name,
|
|
15492
15492
|
" → ",
|
|
15493
|
-
|
|
15493
|
+
D.name,
|
|
15494
15494
|
")"
|
|
15495
15495
|
] })
|
|
15496
15496
|
] })
|
|
@@ -15522,7 +15522,7 @@ function Kh({
|
|
|
15522
15522
|
variant: "ghost",
|
|
15523
15523
|
size: "sm",
|
|
15524
15524
|
onClick: () => f(k.id),
|
|
15525
|
-
children:
|
|
15525
|
+
children: T ? /* @__PURE__ */ e(qa, { className: "h-4 w-4" }) : /* @__PURE__ */ e(Vt, { className: "h-4 w-4" })
|
|
15526
15526
|
}
|
|
15527
15527
|
),
|
|
15528
15528
|
/* @__PURE__ */ e(
|
|
@@ -15536,7 +15536,7 @@ function Kh({
|
|
|
15536
15536
|
)
|
|
15537
15537
|
] })
|
|
15538
15538
|
] }) }),
|
|
15539
|
-
|
|
15539
|
+
T && /* @__PURE__ */ a(os, { className: "space-y-4 pb-6", children: [
|
|
15540
15540
|
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-3", children: [
|
|
15541
15541
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
15542
15542
|
/* @__PURE__ */ e(U, { children: "Source" }),
|
|
@@ -15693,7 +15693,7 @@ function Kh({
|
|
|
15693
15693
|
)
|
|
15694
15694
|
] })
|
|
15695
15695
|
] }),
|
|
15696
|
-
k.source.name && k.target.name && z &&
|
|
15696
|
+
k.source.name && k.target.name && z && D && /* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
15697
15697
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
15698
15698
|
/* @__PURE__ */ e(U, { children: "Join Conditions" }),
|
|
15699
15699
|
/* @__PURE__ */ a(
|
|
@@ -15758,7 +15758,7 @@ function Kh({
|
|
|
15758
15758
|
type: "button",
|
|
15759
15759
|
variant: "ghost",
|
|
15760
15760
|
size: "sm",
|
|
15761
|
-
onClick: () =>
|
|
15761
|
+
onClick: () => M(
|
|
15762
15762
|
k.id,
|
|
15763
15763
|
P
|
|
15764
15764
|
),
|
|
@@ -16130,7 +16130,7 @@ FROM ${x.name}`;
|
|
|
16130
16130
|
);
|
|
16131
16131
|
if (!v) return;
|
|
16132
16132
|
const g = f.joinKeyGroups.filter((I) => I.keys && I.keys.length > 0).map((I) => {
|
|
16133
|
-
const
|
|
16133
|
+
const M = I.keys.filter(
|
|
16134
16134
|
(C) => {
|
|
16135
16135
|
var A, N, S, w;
|
|
16136
16136
|
return ((A = C.source) == null ? void 0 : A.name) && ((N = C.target) == null ? void 0 : N.name) && ((S = C.source) == null ? void 0 : S.entityName) && ((w = C.target) == null ? void 0 : w.entityName);
|
|
@@ -16138,7 +16138,7 @@ FROM ${x.name}`;
|
|
|
16138
16138
|
).map(
|
|
16139
16139
|
(C) => `${C.source.entityName}.${C.source.name} ${C.operator} ${C.target.entityName}.${C.target.name}`
|
|
16140
16140
|
);
|
|
16141
|
-
return
|
|
16141
|
+
return M.length > 1 ? `(${M.join(` ${I.operator} `)})` : M[0];
|
|
16142
16142
|
}).filter(Boolean), b = g.length > 1 ? g.join(" OR ") : g[0] || "condition_here";
|
|
16143
16143
|
y += `
|
|
16144
16144
|
${f.joinType} JOIN ${v.name}
|
|
@@ -16442,7 +16442,7 @@ function Xh({
|
|
|
16442
16442
|
// onToggleVisibility,
|
|
16443
16443
|
}) {
|
|
16444
16444
|
const [n, s] = V(!1), [r, l] = V(!1), [i, o] = V(!0), c = O((h) => h.card.dataSource);
|
|
16445
|
-
|
|
16445
|
+
Ht();
|
|
16446
16446
|
const { updateDataSource: u } = ie(), d = {
|
|
16447
16447
|
connectionId: "",
|
|
16448
16448
|
connectionType: "",
|
|
@@ -16631,10 +16631,10 @@ function ap({
|
|
|
16631
16631
|
selectedChart: t,
|
|
16632
16632
|
onChartChange: n
|
|
16633
16633
|
}) {
|
|
16634
|
-
var
|
|
16634
|
+
var M;
|
|
16635
16635
|
const [s, r] = V(!1), { data: l } = Ni();
|
|
16636
16636
|
tp();
|
|
16637
|
-
const o = ((
|
|
16637
|
+
const o = ((M = O((C) => C.card).customCardPreferences) == null ? void 0 : M.url) || "";
|
|
16638
16638
|
vr(o);
|
|
16639
16639
|
const { setCardType: c, setCardPreferences: u, setIsDevMode: d } = O(
|
|
16640
16640
|
(C) => C.actions
|
|
@@ -16700,7 +16700,7 @@ function ap({
|
|
|
16700
16700
|
]
|
|
16701
16701
|
}
|
|
16702
16702
|
) }),
|
|
16703
|
-
/* @__PURE__ */ e(
|
|
16703
|
+
/* @__PURE__ */ e(Qt, { className: "w-[300px] p-0", align: "start", children: /* @__PURE__ */ a(us, { children: [
|
|
16704
16704
|
/* @__PURE__ */ e(ms, { placeholder: "Search chart types..." }),
|
|
16705
16705
|
/* @__PURE__ */ a(hs, { className: "mb-2 max-h-[300px]", children: [
|
|
16706
16706
|
/* @__PURE__ */ e(ps, { children: "No chart type found." }),
|
|
@@ -17160,7 +17160,7 @@ function cp({
|
|
|
17160
17160
|
editingCondition: l,
|
|
17161
17161
|
onSave: i
|
|
17162
17162
|
}) {
|
|
17163
|
-
var I,
|
|
17163
|
+
var I, M;
|
|
17164
17164
|
const o = !!l, [c, u] = V(o ? "values" : "fields"), [d, m] = V(""), [h, p] = V({
|
|
17165
17165
|
id: (l == null ? void 0 : l.id) || It(),
|
|
17166
17166
|
field: (l == null ? void 0 : l.field) || null,
|
|
@@ -17237,7 +17237,7 @@ function cp({
|
|
|
17237
17237
|
return ke(() => {
|
|
17238
17238
|
t && b();
|
|
17239
17239
|
}, [t, o, l]), /* @__PURE__ */ e(rt, { open: t, onOpenChange: n, children: /* @__PURE__ */ a(lt, { className: "max-w-2xl", children: [
|
|
17240
|
-
/* @__PURE__ */ e(it, { children: /* @__PURE__ */ e(ot, { children: o ? `Edit Filter: ${(I = h.field) == null ? void 0 : I.label}` : c === "fields" ? "Select Field to Filter" : `Select Values for ${(
|
|
17240
|
+
/* @__PURE__ */ e(it, { children: /* @__PURE__ */ e(ot, { children: o ? `Edit Filter: ${(I = h.field) == null ? void 0 : I.label}` : c === "fields" ? "Select Field to Filter" : `Select Values for ${(M = h.field) == null ? void 0 : M.label}` }) }),
|
|
17241
17241
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
17242
17242
|
!o && (r == null ? void 0 : r.conditions) && r.conditions.length > 0 && c === "fields" && /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
17243
17243
|
/* @__PURE__ */ e(U, { className: "text-xs font-medium text-muted-foreground", children: "Current Filters:" }),
|
|
@@ -17423,13 +17423,13 @@ function up({
|
|
|
17423
17423
|
handleGranularityChange: g,
|
|
17424
17424
|
handleAliasTemplateChange: b,
|
|
17425
17425
|
handleValueAliasesChange: I,
|
|
17426
|
-
removeField:
|
|
17426
|
+
removeField: M,
|
|
17427
17427
|
handleKpiComparisonTypeChange: C,
|
|
17428
17428
|
handleKpiShowTrendlineChange: A,
|
|
17429
17429
|
handleKpiTrendlineWindowChange: N,
|
|
17430
17430
|
handleKpiTrendlineGranularityChange: S,
|
|
17431
17431
|
handleKpiTargetValueChange: w
|
|
17432
|
-
} = wr(x), [L, k] = V(!1), [z,
|
|
17432
|
+
} = wr(x), [L, k] = V(!1), [z, D] = V(!1), [T, E] = V(null), [P, F] = V(
|
|
17433
17433
|
t.dateFormat || "YYYY-MM-DD"
|
|
17434
17434
|
), [R, j] = V(t.customFormat || ""), [K, Q] = V(!!t.customFormat), [$, ne] = V(
|
|
17435
17435
|
t.granularity || "day"
|
|
@@ -17466,11 +17466,11 @@ function up({
|
|
|
17466
17466
|
metricColumns: nt
|
|
17467
17467
|
});
|
|
17468
17468
|
}
|
|
17469
|
-
|
|
17469
|
+
D(!1);
|
|
17470
17470
|
}, He = () => {
|
|
17471
|
-
|
|
17471
|
+
M(n, s);
|
|
17472
17472
|
}, Pe = {
|
|
17473
|
-
transform:
|
|
17473
|
+
transform: na.Transform.toString(m),
|
|
17474
17474
|
transition: h
|
|
17475
17475
|
}, se = Ge(t.dataType), Z = se === "date", B = o === "kpi", ce = (te) => {
|
|
17476
17476
|
switch (te) {
|
|
@@ -17532,7 +17532,7 @@ function up({
|
|
|
17532
17532
|
{ value: "custom", label: "Custom Format..." }
|
|
17533
17533
|
];
|
|
17534
17534
|
}
|
|
17535
|
-
}, Ae = ce($), Le = n !== "pivotBy", we = Z && n === "groupBy", ze = !B && Z && n === "groupBy", Ke = B && Z && n === "groupBy", ka = B && n === "metrics" && ((Mr = x.config) == null ? void 0 : Mr.comparisonType) === "target", Da = n === "metrics",
|
|
17535
|
+
}, Ae = ce($), Le = n !== "pivotBy", we = Z && n === "groupBy", ze = !B && Z && n === "groupBy", Ke = B && Z && n === "groupBy", ka = B && n === "metrics" && ((Mr = x.config) == null ? void 0 : Mr.comparisonType) === "target", Da = n === "metrics", Zt = () => /* @__PURE__ */ e(
|
|
17536
17536
|
"div",
|
|
17537
17537
|
{
|
|
17538
17538
|
title: `${t.entityName}.${t.name}`,
|
|
@@ -17606,7 +17606,7 @@ function up({
|
|
|
17606
17606
|
] })
|
|
17607
17607
|
] })
|
|
17608
17608
|
] }) : null, Ha = () => {
|
|
17609
|
-
var te, Be, Ue, nt,
|
|
17609
|
+
var te, Be, Ue, nt, Xt;
|
|
17610
17610
|
return Ke ? /* @__PURE__ */ a(J, { children: [
|
|
17611
17611
|
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
17612
17612
|
/* @__PURE__ */ e(U, { className: "text-xs font-medium text-muted-foreground", children: "Comparison Type" }),
|
|
@@ -17661,7 +17661,7 @@ function up({
|
|
|
17661
17661
|
/* @__PURE__ */ a(
|
|
17662
17662
|
fe,
|
|
17663
17663
|
{
|
|
17664
|
-
value: ((
|
|
17664
|
+
value: ((Xt = x.config) == null ? void 0 : Xt.trendlineGranularity) || "day",
|
|
17665
17665
|
onValueChange: S,
|
|
17666
17666
|
children: [
|
|
17667
17667
|
/* @__PURE__ */ e(ge, { className: "h-8 w-full text-xs", children: /* @__PURE__ */ e(xe, { placeholder: "Select granularity..." }) }),
|
|
@@ -17726,7 +17726,7 @@ function up({
|
|
|
17726
17726
|
{
|
|
17727
17727
|
className: "flex cursor-pointer items-center gap-2 rounded bg-muted/50 p-2 text-xs transition-colors hover:bg-muted/70",
|
|
17728
17728
|
onClick: () => {
|
|
17729
|
-
E(te),
|
|
17729
|
+
E(te), D(!0);
|
|
17730
17730
|
},
|
|
17731
17731
|
children: [
|
|
17732
17732
|
/* @__PURE__ */ a("span", { className: "font-medium", children: [
|
|
@@ -17761,16 +17761,16 @@ function up({
|
|
|
17761
17761
|
var nt;
|
|
17762
17762
|
Be.stopPropagation();
|
|
17763
17763
|
const Ue = Y.conditions.filter(
|
|
17764
|
-
(
|
|
17764
|
+
(Xt) => Xt.id !== te.id
|
|
17765
17765
|
);
|
|
17766
17766
|
if (Ue.length > 0) {
|
|
17767
|
-
const
|
|
17767
|
+
const Xt = {
|
|
17768
17768
|
...Y,
|
|
17769
17769
|
conditions: Ue
|
|
17770
17770
|
};
|
|
17771
|
-
be(
|
|
17771
|
+
be(Xt);
|
|
17772
17772
|
} else if (W(void 0), n === "metrics") {
|
|
17773
|
-
const
|
|
17773
|
+
const Xt = {
|
|
17774
17774
|
...t,
|
|
17775
17775
|
parameters: {
|
|
17776
17776
|
...t.parameters,
|
|
@@ -17779,7 +17779,7 @@ function up({
|
|
|
17779
17779
|
}, vs = [
|
|
17780
17780
|
...((nt = x.config) == null ? void 0 : nt.metricColumns) || []
|
|
17781
17781
|
];
|
|
17782
|
-
vs[s] =
|
|
17782
|
+
vs[s] = Xt, O.getState().actions.updateCardConfig(x.id, {
|
|
17783
17783
|
metricColumns: vs
|
|
17784
17784
|
});
|
|
17785
17785
|
}
|
|
@@ -17798,7 +17798,7 @@ function up({
|
|
|
17798
17798
|
size: "sm",
|
|
17799
17799
|
className: "h-8 w-full justify-start text-xs",
|
|
17800
17800
|
onClick: () => {
|
|
17801
|
-
E(null),
|
|
17801
|
+
E(null), D(!0);
|
|
17802
17802
|
},
|
|
17803
17803
|
children: [
|
|
17804
17804
|
/* @__PURE__ */ e(Os, { className: "mr-2 h-3 w-3" }),
|
|
@@ -17910,7 +17910,7 @@ function up({
|
|
|
17910
17910
|
)
|
|
17911
17911
|
] }),
|
|
17912
17912
|
L && /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
17913
|
-
|
|
17913
|
+
Zt(),
|
|
17914
17914
|
vt(),
|
|
17915
17915
|
o === "kpi" && oe(),
|
|
17916
17916
|
at(),
|
|
@@ -17926,11 +17926,11 @@ function up({
|
|
|
17926
17926
|
{
|
|
17927
17927
|
open: z,
|
|
17928
17928
|
onOpenChange: (te) => {
|
|
17929
|
-
|
|
17929
|
+
D(te), te || E(null);
|
|
17930
17930
|
},
|
|
17931
17931
|
availableFields: Bi,
|
|
17932
17932
|
existingFilters: Y,
|
|
17933
|
-
editingCondition:
|
|
17933
|
+
editingCondition: T,
|
|
17934
17934
|
onSave: (te) => {
|
|
17935
17935
|
var Be;
|
|
17936
17936
|
if (te)
|
|
@@ -18081,7 +18081,7 @@ function Cs({
|
|
|
18081
18081
|
ref: c,
|
|
18082
18082
|
className: `rounded-lg border-2 border-dashed p-1 transition-all ${o ? "border-blue-500 bg-blue-50 dark:bg-blue-950" : h ? "border-blue-200 bg-blue-50/30 dark:border-blue-800 dark:bg-blue-950/30" : "min-h-[60px] border-muted-foreground/20 bg-background"}`,
|
|
18083
18083
|
children: n.length === 0 ? /* @__PURE__ */ e("div", { className: "flex min-h-[40px] items-center justify-center text-sm text-gray-400", children: r }) : /* @__PURE__ */ e(
|
|
18084
|
-
|
|
18084
|
+
la,
|
|
18085
18085
|
{
|
|
18086
18086
|
items: n.map((y) => y.id),
|
|
18087
18087
|
strategy: as,
|
|
@@ -18157,7 +18157,7 @@ function dn({
|
|
|
18157
18157
|
"aria-label": `Change color for ${s}`
|
|
18158
18158
|
}
|
|
18159
18159
|
) }),
|
|
18160
|
-
/* @__PURE__ */ e(
|
|
18160
|
+
/* @__PURE__ */ e(Qt, { align: "start", className: "w-auto p-2", children: /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
18161
18161
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 items-center justify-items-center gap-1", children: hp.map((u) => /* @__PURE__ */ e(
|
|
18162
18162
|
"button",
|
|
18163
18163
|
{
|
|
@@ -18299,7 +18299,7 @@ function pp() {
|
|
|
18299
18299
|
}
|
|
18300
18300
|
),
|
|
18301
18301
|
(() => {
|
|
18302
|
-
var b, I,
|
|
18302
|
+
var b, I, M;
|
|
18303
18303
|
const g = i.calculationType || "difference";
|
|
18304
18304
|
return /* @__PURE__ */ a("div", { className: "space-y-2 rounded-md bg-muted/50 p-2 text-xs", children: [
|
|
18305
18305
|
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: (b = ws[g]) == null ? void 0 : b.description }),
|
|
@@ -18311,7 +18311,7 @@ function pp() {
|
|
|
18311
18311
|
/* @__PURE__ */ a("div", { className: "border-t pt-1 italic text-muted-foreground", children: [
|
|
18312
18312
|
/* @__PURE__ */ e("span", { className: "font-medium", children: "Example:" }),
|
|
18313
18313
|
" ",
|
|
18314
|
-
(
|
|
18314
|
+
(M = ws[g]) == null ? void 0 : M.example
|
|
18315
18315
|
] })
|
|
18316
18316
|
] });
|
|
18317
18317
|
})()
|
|
@@ -18813,7 +18813,7 @@ function xp({
|
|
|
18813
18813
|
sortByFields: i
|
|
18814
18814
|
}
|
|
18815
18815
|
),
|
|
18816
|
-
/* @__PURE__ */ e(
|
|
18816
|
+
/* @__PURE__ */ e(ra, { orientation: "horizontal" })
|
|
18817
18817
|
] })
|
|
18818
18818
|
]
|
|
18819
18819
|
}
|
|
@@ -18987,19 +18987,19 @@ function vp({
|
|
|
18987
18987
|
typeof k == "string" ? k = `'${k}'` : Array.isArray(k) && (k = `'${k.join(", ")}'`);
|
|
18988
18988
|
else if (S.field.dataType === "date" || S.field.dataType === "datetime" || S.field.dataType === "timestamp")
|
|
18989
18989
|
if (S.operator === "between" && Array.isArray(k) && k.length === 2) {
|
|
18990
|
-
const z = k[0] ? `'${k[0]}'` : "NULL",
|
|
18991
|
-
return `${w} BETWEEN ${z} AND ${
|
|
18990
|
+
const z = k[0] ? `'${k[0]}'` : "NULL", D = k[1] ? `'${k[1]}'` : "NULL";
|
|
18991
|
+
return `${w} BETWEEN ${z} AND ${D}`;
|
|
18992
18992
|
} else if ((S.operator === "in" || S.operator === "not in") && Array.isArray(k)) {
|
|
18993
|
-
const z = k.map((
|
|
18993
|
+
const z = k.map((D) => D ? `'${D}'` : "NULL").join(", ");
|
|
18994
18994
|
return `${w} ${L} (${z})`;
|
|
18995
18995
|
} else typeof k == "string" || k instanceof Date ? k = `'${k}'` : Array.isArray(k) && k.length > 0 && (k = `'${k[0]}'`);
|
|
18996
18996
|
else if (["in", "not in"].includes(S.operator)) {
|
|
18997
18997
|
let z = [];
|
|
18998
18998
|
Array.isArray(k) ? z = k.map(
|
|
18999
|
-
(
|
|
19000
|
-
) : typeof k == "string" ? z = k.split(",").map((
|
|
19001
|
-
const
|
|
19002
|
-
return S.field.dataType === "string" ? `'${
|
|
18999
|
+
(D) => typeof D == "string" ? `'${D}'` : String(D)
|
|
19000
|
+
) : typeof k == "string" ? z = k.split(",").map((D) => {
|
|
19001
|
+
const T = D.trim();
|
|
19002
|
+
return S.field.dataType === "string" ? `'${T}'` : T;
|
|
19003
19003
|
}) : typeof k == "number" && (z = [String(k)]), k = `(${z.join(", ")})`;
|
|
19004
19004
|
}
|
|
19005
19005
|
switch (L) {
|
|
@@ -19018,14 +19018,14 @@ function vp({
|
|
|
19018
19018
|
}
|
|
19019
19019
|
}, N = (S) => {
|
|
19020
19020
|
const w = S.conditions.map(A), L = S.groups.map(
|
|
19021
|
-
(
|
|
19021
|
+
(T) => N(T)
|
|
19022
19022
|
), k = [...w, ...L].filter(Boolean);
|
|
19023
19023
|
if (k.length === 0) return "";
|
|
19024
|
-
const z = k.join(` ${S.logicalOperator} `),
|
|
19025
|
-
return S.negate ? `NOT ${
|
|
19024
|
+
const z = k.join(` ${S.logicalOperator} `), D = k.length > 1 ? `(${z})` : z;
|
|
19025
|
+
return S.negate ? `NOT ${D}` : D;
|
|
19026
19026
|
};
|
|
19027
19027
|
return N(C);
|
|
19028
|
-
},
|
|
19028
|
+
}, M = s.conditions.length > 0 || s.groups.length > 0;
|
|
19029
19029
|
return {
|
|
19030
19030
|
currentFilters: s,
|
|
19031
19031
|
setCurrentFilters: r,
|
|
@@ -19042,7 +19042,7 @@ function vp({
|
|
|
19042
19042
|
reorderConditions: g,
|
|
19043
19043
|
reorderGroups: b,
|
|
19044
19044
|
generateSQLPreview: I,
|
|
19045
|
-
hasAnyFilters:
|
|
19045
|
+
hasAnyFilters: M
|
|
19046
19046
|
};
|
|
19047
19047
|
}
|
|
19048
19048
|
function yp({
|
|
@@ -19120,7 +19120,7 @@ function Cp({
|
|
|
19120
19120
|
]
|
|
19121
19121
|
}
|
|
19122
19122
|
) }),
|
|
19123
|
-
/* @__PURE__ */ e(
|
|
19123
|
+
/* @__PURE__ */ e(Qt, { className: "z-50 w-80 p-0", align: "start", children: /* @__PURE__ */ a(us, { children: [
|
|
19124
19124
|
/* @__PURE__ */ e(ms, { placeholder: "Search fields...", className: "h-9" }),
|
|
19125
19125
|
/* @__PURE__ */ e(ps, { children: "No fields found." }),
|
|
19126
19126
|
/* @__PURE__ */ e(hs, { className: "max-h-80", children: Object.entries(c).map(([u, d]) => /* @__PURE__ */ e(
|
|
@@ -19274,7 +19274,7 @@ function wp({
|
|
|
19274
19274
|
]
|
|
19275
19275
|
}
|
|
19276
19276
|
) }),
|
|
19277
|
-
/* @__PURE__ */ e(
|
|
19277
|
+
/* @__PURE__ */ e(Qt, { className: "z-50 w-fit overflow-auto p-0", align: "start", children: /* @__PURE__ */ a(us, { children: [
|
|
19278
19278
|
/* @__PURE__ */ e(ms, { placeholder: "Search..." }),
|
|
19279
19279
|
/* @__PURE__ */ a(hs, { children: [
|
|
19280
19280
|
/* @__PURE__ */ e(ps, { children: "No results found." }),
|
|
@@ -19488,7 +19488,7 @@ function zi({
|
|
|
19488
19488
|
} = Ka({ id: t.id }), { isPending: f, error: v } = Dr(
|
|
19489
19489
|
t.field
|
|
19490
19490
|
), g = {
|
|
19491
|
-
transform:
|
|
19491
|
+
transform: na.Transform.toString(p),
|
|
19492
19492
|
transition: x
|
|
19493
19493
|
};
|
|
19494
19494
|
return /* @__PURE__ */ a(
|
|
@@ -19527,12 +19527,12 @@ function zi({
|
|
|
19527
19527
|
{
|
|
19528
19528
|
value: t.field,
|
|
19529
19529
|
onValueChange: (b) => {
|
|
19530
|
-
const I = b,
|
|
19530
|
+
const I = b, M = Ge(I.dataType) === "date";
|
|
19531
19531
|
u(s, t.id, {
|
|
19532
19532
|
field: I,
|
|
19533
19533
|
value: "",
|
|
19534
19534
|
// For date fields, default to 'between' operator
|
|
19535
|
-
operator:
|
|
19535
|
+
operator: M ? "between" : "="
|
|
19536
19536
|
});
|
|
19537
19537
|
},
|
|
19538
19538
|
availableFields: c,
|
|
@@ -19674,26 +19674,26 @@ function Rp({
|
|
|
19674
19674
|
listeners: g,
|
|
19675
19675
|
setNodeRef: b,
|
|
19676
19676
|
transform: I,
|
|
19677
|
-
transition:
|
|
19677
|
+
transition: M,
|
|
19678
19678
|
isDragging: C
|
|
19679
19679
|
} = Ka({ id: t.id }), A = {
|
|
19680
|
-
transform:
|
|
19681
|
-
transition:
|
|
19680
|
+
transform: na.Transform.toString(I),
|
|
19681
|
+
transition: M
|
|
19682
19682
|
}, N = (w) => {
|
|
19683
19683
|
const { active: L, over: k } = w;
|
|
19684
19684
|
if (k && L.id !== k.id) {
|
|
19685
19685
|
const z = t.conditions.findIndex(
|
|
19686
|
-
(
|
|
19687
|
-
),
|
|
19688
|
-
(
|
|
19686
|
+
(T) => T.id === L.id
|
|
19687
|
+
), D = t.conditions.findIndex(
|
|
19688
|
+
(T) => T.id === k.id
|
|
19689
19689
|
);
|
|
19690
|
-
z !== -1 &&
|
|
19690
|
+
z !== -1 && D !== -1 && d(t.id, z, D);
|
|
19691
19691
|
}
|
|
19692
19692
|
}, S = (w) => {
|
|
19693
19693
|
const { active: L, over: k } = w;
|
|
19694
19694
|
if (k && L.id !== k.id && s) {
|
|
19695
|
-
const z = t.groups.findIndex((
|
|
19696
|
-
z !== -1 &&
|
|
19695
|
+
const z = t.groups.findIndex((T) => T.id === L.id), D = t.groups.findIndex((T) => T.id === k.id);
|
|
19696
|
+
z !== -1 && D !== -1 && m(s, z, D);
|
|
19697
19697
|
}
|
|
19698
19698
|
};
|
|
19699
19699
|
return /* @__PURE__ */ a(
|
|
@@ -19756,15 +19756,15 @@ function Rp({
|
|
|
19756
19756
|
Ra,
|
|
19757
19757
|
{
|
|
19758
19758
|
sensors: Xa(
|
|
19759
|
-
|
|
19760
|
-
|
|
19759
|
+
ea(Rs),
|
|
19760
|
+
ea(xn, {
|
|
19761
19761
|
coordinateGetter: gn
|
|
19762
19762
|
})
|
|
19763
19763
|
),
|
|
19764
19764
|
collisionDetection: ss,
|
|
19765
19765
|
onDragEnd: N,
|
|
19766
19766
|
children: /* @__PURE__ */ e(
|
|
19767
|
-
|
|
19767
|
+
la,
|
|
19768
19768
|
{
|
|
19769
19769
|
items: t.conditions.map((w) => w.id),
|
|
19770
19770
|
strategy: as,
|
|
@@ -19792,15 +19792,15 @@ function Rp({
|
|
|
19792
19792
|
Ra,
|
|
19793
19793
|
{
|
|
19794
19794
|
sensors: Xa(
|
|
19795
|
-
|
|
19796
|
-
|
|
19795
|
+
ea(Rs),
|
|
19796
|
+
ea(xn, {
|
|
19797
19797
|
coordinateGetter: gn
|
|
19798
19798
|
})
|
|
19799
19799
|
),
|
|
19800
19800
|
collisionDetection: ss,
|
|
19801
19801
|
onDragEnd: S,
|
|
19802
19802
|
children: /* @__PURE__ */ e(
|
|
19803
|
-
|
|
19803
|
+
la,
|
|
19804
19804
|
{
|
|
19805
19805
|
items: t.groups.map((w) => w.id),
|
|
19806
19806
|
strategy: as,
|
|
@@ -19867,36 +19867,36 @@ function Fp({
|
|
|
19867
19867
|
reorderGroups: g,
|
|
19868
19868
|
generateSQLPreview: b,
|
|
19869
19869
|
hasAnyFilters: I,
|
|
19870
|
-
setCurrentFilters:
|
|
19870
|
+
setCurrentFilters: M
|
|
19871
19871
|
} = vp({
|
|
19872
19872
|
initialFilters: t,
|
|
19873
19873
|
availableFields: n
|
|
19874
19874
|
}), C = Xa(
|
|
19875
|
-
|
|
19876
|
-
|
|
19875
|
+
ea(Rs),
|
|
19876
|
+
ea(xn, {
|
|
19877
19877
|
coordinateGetter: gn
|
|
19878
19878
|
})
|
|
19879
|
-
), [A, N] = V(!1), S = (k, z,
|
|
19880
|
-
const
|
|
19879
|
+
), [A, N] = V(!1), S = (k, z, D) => {
|
|
19880
|
+
const T = (E) => E.id === k ? {
|
|
19881
19881
|
...E,
|
|
19882
19882
|
conditions: E.conditions.map((P) => P.id === z ? {
|
|
19883
19883
|
...P,
|
|
19884
|
-
field:
|
|
19885
|
-
dataType:
|
|
19884
|
+
field: D,
|
|
19885
|
+
dataType: D.dataType
|
|
19886
19886
|
} : P)
|
|
19887
19887
|
} : {
|
|
19888
19888
|
...E,
|
|
19889
|
-
groups: E.groups.map(
|
|
19889
|
+
groups: E.groups.map(T)
|
|
19890
19890
|
};
|
|
19891
|
-
T(
|
|
19892
|
-
}, w = (k, z = 0,
|
|
19891
|
+
M(T(i));
|
|
19892
|
+
}, w = (k, z = 0, D) => z === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg", children: /* @__PURE__ */ a("div", { className: "p-3 px-0", children: [
|
|
19893
19893
|
/* @__PURE__ */ e(
|
|
19894
19894
|
Ra,
|
|
19895
19895
|
{
|
|
19896
19896
|
sensors: C,
|
|
19897
19897
|
collisionDetection: ss,
|
|
19898
|
-
onDragEnd: (
|
|
19899
|
-
const { active: E, over: P } =
|
|
19898
|
+
onDragEnd: (T) => {
|
|
19899
|
+
const { active: E, over: P } = T;
|
|
19900
19900
|
if (P && E.id !== P.id) {
|
|
19901
19901
|
const F = k.conditions.findIndex(
|
|
19902
19902
|
(j) => j.id === E.id
|
|
@@ -19907,14 +19907,14 @@ function Fp({
|
|
|
19907
19907
|
}
|
|
19908
19908
|
},
|
|
19909
19909
|
children: /* @__PURE__ */ e(
|
|
19910
|
-
|
|
19910
|
+
la,
|
|
19911
19911
|
{
|
|
19912
|
-
items: k.conditions.map((
|
|
19912
|
+
items: k.conditions.map((T) => T.id),
|
|
19913
19913
|
strategy: as,
|
|
19914
|
-
children: k.conditions.map((
|
|
19914
|
+
children: k.conditions.map((T, E) => /* @__PURE__ */ e(
|
|
19915
19915
|
zi,
|
|
19916
19916
|
{
|
|
19917
|
-
condition:
|
|
19917
|
+
condition: T,
|
|
19918
19918
|
index: E,
|
|
19919
19919
|
groupId: k.id,
|
|
19920
19920
|
groupLogicalOperator: k.logicalOperator,
|
|
@@ -19925,7 +19925,7 @@ function Fp({
|
|
|
19925
19925
|
availableFields: o,
|
|
19926
19926
|
updateConditionFields: x
|
|
19927
19927
|
},
|
|
19928
|
-
|
|
19928
|
+
T.id
|
|
19929
19929
|
))
|
|
19930
19930
|
}
|
|
19931
19931
|
)
|
|
@@ -19936,8 +19936,8 @@ function Fp({
|
|
|
19936
19936
|
{
|
|
19937
19937
|
sensors: C,
|
|
19938
19938
|
collisionDetection: ss,
|
|
19939
|
-
onDragEnd: (
|
|
19940
|
-
const { active: E, over: P } =
|
|
19939
|
+
onDragEnd: (T) => {
|
|
19940
|
+
const { active: E, over: P } = T;
|
|
19941
19941
|
if (P && E.id !== P.id) {
|
|
19942
19942
|
const F = k.groups.findIndex(
|
|
19943
19943
|
(j) => j.id === E.id
|
|
@@ -19948,12 +19948,12 @@ function Fp({
|
|
|
19948
19948
|
}
|
|
19949
19949
|
},
|
|
19950
19950
|
children: /* @__PURE__ */ e(
|
|
19951
|
-
|
|
19951
|
+
la,
|
|
19952
19952
|
{
|
|
19953
|
-
items: k.groups.map((
|
|
19953
|
+
items: k.groups.map((T) => T.id),
|
|
19954
19954
|
strategy: as,
|
|
19955
19955
|
children: k.groups.map(
|
|
19956
|
-
(
|
|
19956
|
+
(T) => w(T, z + 1, k.id)
|
|
19957
19957
|
)
|
|
19958
19958
|
}
|
|
19959
19959
|
)
|
|
@@ -19992,7 +19992,7 @@ function Fp({
|
|
|
19992
19992
|
{
|
|
19993
19993
|
group: k,
|
|
19994
19994
|
depth: z,
|
|
19995
|
-
parentGroupId:
|
|
19995
|
+
parentGroupId: D,
|
|
19996
19996
|
onUpdateGroupOperator: y,
|
|
19997
19997
|
onUpdateGroupNegate: f,
|
|
19998
19998
|
onRemoveGroup: h,
|
|
@@ -20119,8 +20119,8 @@ function Lp({
|
|
|
20119
20119
|
i(null);
|
|
20120
20120
|
return;
|
|
20121
20121
|
}
|
|
20122
|
-
const g = f.id, b = v.id, I = d(g),
|
|
20123
|
-
if (
|
|
20122
|
+
const g = f.id, b = v.id, I = d(g), M = d(b) || b;
|
|
20123
|
+
if (M === "sortBy") {
|
|
20124
20124
|
if (I === "source") {
|
|
20125
20125
|
const C = n.find((N) => N.id === g);
|
|
20126
20126
|
if (!C) {
|
|
@@ -20143,7 +20143,7 @@ function Lp({
|
|
|
20143
20143
|
return;
|
|
20144
20144
|
}
|
|
20145
20145
|
}
|
|
20146
|
-
if (I === "source" &&
|
|
20146
|
+
if (I === "source" && M === "sortBy") {
|
|
20147
20147
|
const C = [...n].find((S) => S.id === g);
|
|
20148
20148
|
if (!C) {
|
|
20149
20149
|
i(null);
|
|
@@ -20162,7 +20162,7 @@ function Lp({
|
|
|
20162
20162
|
i(null), r("sortBy", [...A, N]);
|
|
20163
20163
|
return;
|
|
20164
20164
|
}
|
|
20165
|
-
if (I === "source" &&
|
|
20165
|
+
if (I === "source" && M !== "source" && M !== "sortBy") {
|
|
20166
20166
|
const C = [...n].find((w) => w.id === g);
|
|
20167
20167
|
if (!C) {
|
|
20168
20168
|
i(null);
|
|
@@ -20195,41 +20195,41 @@ function Lp({
|
|
|
20195
20195
|
return;
|
|
20196
20196
|
}
|
|
20197
20197
|
}
|
|
20198
|
-
const N = s(
|
|
20198
|
+
const N = s(M);
|
|
20199
20199
|
if (Ts(C, N)) {
|
|
20200
20200
|
i(null);
|
|
20201
20201
|
return;
|
|
20202
20202
|
}
|
|
20203
20203
|
const S = Ms(
|
|
20204
20204
|
C,
|
|
20205
|
-
|
|
20205
|
+
M,
|
|
20206
20206
|
N
|
|
20207
20207
|
);
|
|
20208
|
-
i(null), r(
|
|
20208
|
+
i(null), r(M, [...N, S]);
|
|
20209
20209
|
return;
|
|
20210
20210
|
}
|
|
20211
|
-
if (I &&
|
|
20212
|
-
const C = s(I), A = s(
|
|
20211
|
+
if (I && M && I !== "source" && M !== "source" && I !== M) {
|
|
20212
|
+
const C = s(I), A = s(M), N = C.find((L) => L.id === g);
|
|
20213
20213
|
if (!N) {
|
|
20214
20214
|
i(null);
|
|
20215
20215
|
return;
|
|
20216
20216
|
}
|
|
20217
20217
|
const S = Ms(
|
|
20218
20218
|
N,
|
|
20219
|
-
|
|
20219
|
+
M,
|
|
20220
20220
|
A
|
|
20221
20221
|
);
|
|
20222
|
-
if (i(null),
|
|
20223
|
-
Ts(N, A) || r(
|
|
20222
|
+
if (i(null), M === "sortBy") {
|
|
20223
|
+
Ts(N, A) || r(M, [...A, S]);
|
|
20224
20224
|
return;
|
|
20225
20225
|
}
|
|
20226
20226
|
const w = C.filter(
|
|
20227
20227
|
(L) => L.id !== g
|
|
20228
20228
|
);
|
|
20229
|
-
r(I, w), r(
|
|
20229
|
+
r(I, w), r(M, [...A, S]);
|
|
20230
20230
|
return;
|
|
20231
20231
|
}
|
|
20232
|
-
if (I &&
|
|
20232
|
+
if (I && M && I === M && I !== "source") {
|
|
20233
20233
|
const C = s(I), A = C.findIndex((S) => S.id === g), N = C.findIndex((S) => S.id === b);
|
|
20234
20234
|
if (A !== N) {
|
|
20235
20235
|
const S = fn(C, A, N);
|
|
@@ -20422,9 +20422,9 @@ function Bp({
|
|
|
20422
20422
|
updateCardInFrame: x,
|
|
20423
20423
|
setCardId: y,
|
|
20424
20424
|
setShowAIDialog: f
|
|
20425
|
-
} = ie(), { updateCardId: v } = pt(), [g, b] = V(null), I = O((re) => re.showAIDialog),
|
|
20425
|
+
} = ie(), { updateCardId: v } = pt(), [g, b] = V(null), I = O((re) => re.showAIDialog), M = X((re) => re.isVisualEditing), [C, A] = V(!1), [N, S] = V(!1), [w, L] = V(
|
|
20426
20426
|
null
|
|
20427
|
-
), { isConsoleMode: k } = Ga(), { config: z } = fr(Zn).tokenProps,
|
|
20427
|
+
), { isConsoleMode: k } = Ga(), { config: z } = fr(Zn).tokenProps, D = (z == null ? void 0 : z.showInfoTab) !== !1, T = O(
|
|
20428
20428
|
(re) => {
|
|
20429
20429
|
var Ce;
|
|
20430
20430
|
return ((Ce = re.card.customCardPreferences) == null ? void 0 : Ce.url) && re.card.type === "custom";
|
|
@@ -20531,7 +20531,7 @@ function Bp({
|
|
|
20531
20531
|
"div",
|
|
20532
20532
|
{
|
|
20533
20533
|
className: G("relative flex w-0 grow flex-col", {
|
|
20534
|
-
"border-l": I &&
|
|
20534
|
+
"border-l": I && M
|
|
20535
20535
|
}),
|
|
20536
20536
|
children: [
|
|
20537
20537
|
s && de(),
|
|
@@ -20585,7 +20585,7 @@ function Bp({
|
|
|
20585
20585
|
r && zl
|
|
20586
20586
|
] })
|
|
20587
20587
|
] }),
|
|
20588
|
-
!C &&
|
|
20588
|
+
!C && T && /* @__PURE__ */ e(
|
|
20589
20589
|
ye,
|
|
20590
20590
|
{
|
|
20591
20591
|
"aria-label": "Open Chart Settings",
|
|
@@ -20609,7 +20609,7 @@ function Bp({
|
|
|
20609
20609
|
sortState: me
|
|
20610
20610
|
}
|
|
20611
20611
|
) }),
|
|
20612
|
-
t === "info" &&
|
|
20612
|
+
t === "info" && D && /* @__PURE__ */ e("div", { className: "px-6", children: /* @__PURE__ */ a("div", { className: "rounded-md bg-background", children: [
|
|
20613
20613
|
/* @__PURE__ */ a("div", { className: "mb-2", children: [
|
|
20614
20614
|
k && /* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
|
|
20615
20615
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Card ID:" }),
|
|
@@ -20757,11 +20757,11 @@ function $p() {
|
|
|
20757
20757
|
(Q) => Q.actions.getAvailableFields
|
|
20758
20758
|
);
|
|
20759
20759
|
const { addCard: f, removeCard: v, updateCard: g, setActiveCard: b, updateFilters: I } = ie(), {
|
|
20760
|
-
columns:
|
|
20760
|
+
columns: M = [],
|
|
20761
20761
|
isLoading: C,
|
|
20762
20762
|
error: A
|
|
20763
20763
|
} = Wa(), N = Xa(
|
|
20764
|
-
|
|
20764
|
+
ea(Rs, {
|
|
20765
20765
|
activationConstraint: {
|
|
20766
20766
|
distance: 8
|
|
20767
20767
|
}
|
|
@@ -20769,12 +20769,12 @@ function $p() {
|
|
|
20769
20769
|
), S = y, {
|
|
20770
20770
|
getFieldsForContainer: w,
|
|
20771
20771
|
setFieldsForContainer: L
|
|
20772
|
-
} = wr(S), { activeField: k, handleDragStart: z, handleDragEnd:
|
|
20772
|
+
} = wr(S), { activeField: k, handleDragStart: z, handleDragEnd: D } = Lp({
|
|
20773
20773
|
activeCardId: x.activeCardId,
|
|
20774
|
-
sourceFields:
|
|
20774
|
+
sourceFields: M,
|
|
20775
20775
|
getFieldsForContainer: w,
|
|
20776
20776
|
setFieldsForContainer: L
|
|
20777
|
-
}),
|
|
20777
|
+
}), T = (Q, $) => {
|
|
20778
20778
|
$ && I(Q, $);
|
|
20779
20779
|
}, E = (Q) => {
|
|
20780
20780
|
var $;
|
|
@@ -20784,7 +20784,7 @@ function $p() {
|
|
|
20784
20784
|
filters: void 0
|
|
20785
20785
|
}
|
|
20786
20786
|
});
|
|
20787
|
-
}, P =
|
|
20787
|
+
}, P = M, F = (Q) => {
|
|
20788
20788
|
if (!Q) return 0;
|
|
20789
20789
|
let $ = Q.conditions.length;
|
|
20790
20790
|
return Q.groups.forEach((ne) => {
|
|
@@ -20797,7 +20797,7 @@ function $p() {
|
|
|
20797
20797
|
sensors: N,
|
|
20798
20798
|
collisionDetection: ss,
|
|
20799
20799
|
onDragStart: z,
|
|
20800
|
-
onDragEnd:
|
|
20800
|
+
onDragEnd: D,
|
|
20801
20801
|
children: [
|
|
20802
20802
|
/* @__PURE__ */ a("div", { className: "flex h-full grow", children: [
|
|
20803
20803
|
/* @__PURE__ */ e(
|
|
@@ -20831,7 +20831,7 @@ function $p() {
|
|
|
20831
20831
|
filterCount: R,
|
|
20832
20832
|
activeCard: S,
|
|
20833
20833
|
dataSourceState: y.dataSource || Hn,
|
|
20834
|
-
columns:
|
|
20834
|
+
columns: M,
|
|
20835
20835
|
columnsLoading: C,
|
|
20836
20836
|
columnsError: A,
|
|
20837
20837
|
getFieldsForContainer: w,
|
|
@@ -20859,7 +20859,7 @@ function $p() {
|
|
|
20859
20859
|
{
|
|
20860
20860
|
cardId: S.id,
|
|
20861
20861
|
filters: ((K = S.config) == null ? void 0 : K.filters) || null,
|
|
20862
|
-
onFiltersChange:
|
|
20862
|
+
onFiltersChange: T,
|
|
20863
20863
|
onClearFilters: E,
|
|
20864
20864
|
availableFields: P,
|
|
20865
20865
|
isOpen: l,
|
|
@@ -20879,7 +20879,7 @@ function Yp({ authToken: t, onSave: n, onClose: s }) {
|
|
|
20879
20879
|
[u]
|
|
20880
20880
|
), { setAuthToken: y } = pt(), { setShowAIDialog: f, setOnSave: v, setOnClose: g } = ie(), { setActiveAssistantType: b } = _l(), {
|
|
20881
20881
|
handleDragOver: I,
|
|
20882
|
-
handleDragEnd:
|
|
20882
|
+
handleDragEnd: M,
|
|
20883
20883
|
handleDragStart: C,
|
|
20884
20884
|
handleDragCancel: A,
|
|
20885
20885
|
sensors: N
|
|
@@ -21003,7 +21003,7 @@ function Yp({ authToken: t, onSave: n, onClose: s }) {
|
|
|
21003
21003
|
{
|
|
21004
21004
|
sensors: N,
|
|
21005
21005
|
onDragStart: C,
|
|
21006
|
-
onDragEnd:
|
|
21006
|
+
onDragEnd: M,
|
|
21007
21007
|
onDragOver: I,
|
|
21008
21008
|
onDragCancel: A,
|
|
21009
21009
|
children: /* @__PURE__ */ e(
|
|
@@ -21039,7 +21039,7 @@ function qp() {
|
|
|
21039
21039
|
}
|
|
21040
21040
|
function Kp({ column: t }) {
|
|
21041
21041
|
return /* @__PURE__ */ e(xt, { children: /* @__PURE__ */ a(Qe, { children: [
|
|
21042
|
-
/* @__PURE__ */ e(Ze, { className: "shrink-0", asChild: !0, children: Ut(t.data_type) ? /* @__PURE__ */ e(ld, { className: "size-3 text-muted-foreground" }) :
|
|
21042
|
+
/* @__PURE__ */ e(Ze, { className: "shrink-0", asChild: !0, children: Ut(t.data_type) ? /* @__PURE__ */ e(ld, { className: "size-3 text-muted-foreground" }) : sa(t.data_type) ? /* @__PURE__ */ e(Jt, { className: "size-3 text-muted-foreground" }) : Gt(t.data_type) ? /* @__PURE__ */ e(Pt, { className: "size-3 text-muted-foreground" }) : id(t.data_type) ? /* @__PURE__ */ e(va, { className: "size-3 text-muted-foreground" }) : t.data_type.startsWith("json") ? /* @__PURE__ */ e(Rd, { className: "size-3 text-muted-foreground" }) : /* @__PURE__ */ e(od, { className: "size-3 text-muted-foreground" }) }),
|
|
21043
21043
|
/* @__PURE__ */ e(tt, { children: /* @__PURE__ */ e("p", { className: "text-xs", children: t.data_type }) })
|
|
21044
21044
|
] }) });
|
|
21045
21045
|
}
|
|
@@ -21169,8 +21169,8 @@ function Hp() {
|
|
|
21169
21169
|
p.map((g) => {
|
|
21170
21170
|
const b = l == null ? void 0 : l.some(
|
|
21171
21171
|
(I) => {
|
|
21172
|
-
var
|
|
21173
|
-
return I.title === g.name || ((
|
|
21172
|
+
var M;
|
|
21173
|
+
return I.title === g.name || ((M = I.column) == null ? void 0 : M.includes(g.name));
|
|
21174
21174
|
}
|
|
21175
21175
|
);
|
|
21176
21176
|
return /* @__PURE__ */ e(
|
|
@@ -21379,7 +21379,7 @@ function af({
|
|
|
21379
21379
|
block: "center"
|
|
21380
21380
|
});
|
|
21381
21381
|
}, [p]);
|
|
21382
|
-
const I = () => /* @__PURE__ */ e(Js, { className: "h-4 w-4" }),
|
|
21382
|
+
const I = () => /* @__PURE__ */ e(Js, { className: "h-4 w-4" }), M = () => {
|
|
21383
21383
|
m(t), l == null || l(t);
|
|
21384
21384
|
};
|
|
21385
21385
|
return /* @__PURE__ */ e(
|
|
@@ -21390,7 +21390,7 @@ function af({
|
|
|
21390
21390
|
"group cursor-pointer border border-border/50 p-3 transition-colors hover:bg-accent/50",
|
|
21391
21391
|
p ? "border-purple-500" : h && "border-primary"
|
|
21392
21392
|
),
|
|
21393
|
-
onClick:
|
|
21393
|
+
onClick: M,
|
|
21394
21394
|
children: /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
|
|
21395
21395
|
/* @__PURE__ */ e("div", { className: "mt-0.5 rounded bg-muted p-1.5", children: I() }),
|
|
21396
21396
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -21716,7 +21716,7 @@ function nf() {
|
|
|
21716
21716
|
null
|
|
21717
21717
|
), { selectVisual: v } = ds(), { handleEditLibraryVisual: g, handleAddLibraryVisual: b } = wa(), {
|
|
21718
21718
|
resources: I,
|
|
21719
|
-
isLoading:
|
|
21719
|
+
isLoading: M,
|
|
21720
21720
|
isError: C,
|
|
21721
21721
|
createResource: A,
|
|
21722
21722
|
updateResource: N,
|
|
@@ -21732,17 +21732,17 @@ function nf() {
|
|
|
21732
21732
|
r(!1), W && (v(W), g(W));
|
|
21733
21733
|
}
|
|
21734
21734
|
);
|
|
21735
|
-
|
|
21735
|
+
Ht();
|
|
21736
21736
|
const z = I.filter(
|
|
21737
21737
|
(W) => {
|
|
21738
21738
|
var Ne, re;
|
|
21739
21739
|
return ((Ne = W == null ? void 0 : W.title) == null ? void 0 : Ne.toLowerCase().includes(t.toLowerCase())) || ((re = W == null ? void 0 : W.description) == null ? void 0 : re.toLowerCase().includes(t.toLowerCase()));
|
|
21740
21740
|
}
|
|
21741
|
-
),
|
|
21741
|
+
), D = (W) => new Date(W).toLocaleDateString("en-US", {
|
|
21742
21742
|
month: "short",
|
|
21743
21743
|
day: "numeric",
|
|
21744
21744
|
year: "numeric"
|
|
21745
|
-
}),
|
|
21745
|
+
}), T = (W) => {
|
|
21746
21746
|
A({
|
|
21747
21747
|
title: W.title,
|
|
21748
21748
|
description: W.description,
|
|
@@ -21817,7 +21817,7 @@ function nf() {
|
|
|
21817
21817
|
}
|
|
21818
21818
|
});
|
|
21819
21819
|
};
|
|
21820
|
-
return
|
|
21820
|
+
return M ? /* @__PURE__ */ e(_i, {}) : C ? /* @__PURE__ */ e(st, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
21821
21821
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load visuals" }),
|
|
21822
21822
|
/* @__PURE__ */ e(
|
|
21823
21823
|
_,
|
|
@@ -21869,7 +21869,7 @@ function nf() {
|
|
|
21869
21869
|
onShareVisual: de,
|
|
21870
21870
|
isDeleting: k,
|
|
21871
21871
|
isDuplicating: p === W.id,
|
|
21872
|
-
formatDate:
|
|
21872
|
+
formatDate: D
|
|
21873
21873
|
},
|
|
21874
21874
|
W.id
|
|
21875
21875
|
)) }) }),
|
|
@@ -21936,7 +21936,7 @@ function nf() {
|
|
|
21936
21936
|
{
|
|
21937
21937
|
open: s,
|
|
21938
21938
|
onOpenChange: r,
|
|
21939
|
-
onSubmit:
|
|
21939
|
+
onSubmit: T,
|
|
21940
21940
|
isCreating: L
|
|
21941
21941
|
}
|
|
21942
21942
|
),
|
|
@@ -21964,12 +21964,12 @@ function rf({
|
|
|
21964
21964
|
formatDate: u,
|
|
21965
21965
|
onDashboardItemClick: d
|
|
21966
21966
|
}) {
|
|
21967
|
-
var
|
|
21968
|
-
const { selectDashboard: m } = ds(), h = pd(t.id), { isConsoleMode: p } = Ga(),
|
|
21967
|
+
var S, w, L, k, z;
|
|
21968
|
+
const { selectDashboard: m } = ds(), h = pd(t.id), { isConsoleMode: p } = Ga(), { currentUser: x, isLoading: y, isError: f } = Ht(), v = !f && (x == null ? void 0 : x.type) === "tenant" && ((S = x == null ? void 0 : x.role) == null ? void 0 : S.toUpperCase()) === "VIEWER", g = y || v, [b, I] = V(!1), [M, C] = V(!1);
|
|
21969
21969
|
ke(() => {
|
|
21970
|
-
s ? (
|
|
21971
|
-
}, [s,
|
|
21972
|
-
const
|
|
21970
|
+
s ? (I(!0), C(!0)) : M && (I(!1), C(!1));
|
|
21971
|
+
}, [s, M]);
|
|
21972
|
+
const A = () => /* @__PURE__ */ e(Ya, { className: "h-4 w-4" }), N = () => {
|
|
21973
21973
|
m(t), r(t.id), d == null || d(t.id);
|
|
21974
21974
|
};
|
|
21975
21975
|
return /* @__PURE__ */ e(
|
|
@@ -21979,9 +21979,9 @@ function rf({
|
|
|
21979
21979
|
"group cursor-pointer border border-border/50 p-3 transition-colors hover:bg-accent/50",
|
|
21980
21980
|
h && "border-primary"
|
|
21981
21981
|
),
|
|
21982
|
-
onClick:
|
|
21982
|
+
onClick: N,
|
|
21983
21983
|
children: /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
|
|
21984
|
-
/* @__PURE__ */ e("div", { className: "mt-0.5 rounded bg-muted p-1.5", children:
|
|
21984
|
+
/* @__PURE__ */ e("div", { className: "mt-0.5 rounded bg-muted p-1.5", children: A() }),
|
|
21985
21985
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
21986
21986
|
/* @__PURE__ */ a("div", { className: "mb-1 flex items-center gap-2", children: [
|
|
21987
21987
|
/* @__PURE__ */ e(
|
|
@@ -22002,7 +22002,7 @@ function rf({
|
|
|
22002
22002
|
{
|
|
22003
22003
|
className: "text-xs text-muted-foreground line-clamp-2",
|
|
22004
22004
|
title: t.description || "No description",
|
|
22005
|
-
children: (
|
|
22005
|
+
children: (w = t.description) != null && w.trim() ? t.description : "No description"
|
|
22006
22006
|
}
|
|
22007
22007
|
)
|
|
22008
22008
|
] }),
|
|
@@ -22010,35 +22010,35 @@ function rf({
|
|
|
22010
22010
|
"div",
|
|
22011
22011
|
{
|
|
22012
22012
|
className: "invisible ml-2 flex flex-shrink-0 items-center gap-1 transition-opacity duration-150 group-hover:visible",
|
|
22013
|
-
onClick: (
|
|
22013
|
+
onClick: (D) => D.stopPropagation(),
|
|
22014
22014
|
children: [
|
|
22015
|
-
t.permissions.canEdit && /* @__PURE__ */ e(
|
|
22015
|
+
t.permissions.canEdit && !g && /* @__PURE__ */ e(
|
|
22016
22016
|
_,
|
|
22017
22017
|
{
|
|
22018
22018
|
size: "sm",
|
|
22019
22019
|
variant: "ghost",
|
|
22020
22020
|
className: "h-6 w-6 p-0",
|
|
22021
|
-
onClick: (
|
|
22022
|
-
|
|
22021
|
+
onClick: (D) => {
|
|
22022
|
+
D.stopPropagation(), l == null || l(t);
|
|
22023
22023
|
},
|
|
22024
22024
|
title: "Edit details",
|
|
22025
22025
|
children: /* @__PURE__ */ e(Fs, { className: "h-3 w-3" })
|
|
22026
22026
|
}
|
|
22027
22027
|
),
|
|
22028
|
-
/* @__PURE__ */ a(
|
|
22028
|
+
!g && /* @__PURE__ */ a(
|
|
22029
22029
|
At,
|
|
22030
22030
|
{
|
|
22031
22031
|
modal: !1,
|
|
22032
|
-
open:
|
|
22033
|
-
onOpenChange:
|
|
22032
|
+
open: b,
|
|
22033
|
+
onOpenChange: I,
|
|
22034
22034
|
children: [
|
|
22035
22035
|
/* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e(_, { size: "sm", variant: "ghost", className: "h-6 w-6 p-0", children: /* @__PURE__ */ e($l, { className: "h-3 w-3" }) }) }),
|
|
22036
22036
|
/* @__PURE__ */ a(Ot, { align: "end", className: "z-[51] w-40", children: [
|
|
22037
22037
|
/* @__PURE__ */ a(
|
|
22038
22038
|
Je,
|
|
22039
22039
|
{
|
|
22040
|
-
onClick: (
|
|
22041
|
-
|
|
22040
|
+
onClick: (D) => {
|
|
22041
|
+
D.preventDefault(), D.stopPropagation(), o(t.id);
|
|
22042
22042
|
},
|
|
22043
22043
|
disabled: s,
|
|
22044
22044
|
children: [
|
|
@@ -22050,8 +22050,8 @@ function rf({
|
|
|
22050
22050
|
t.permissions.canEdit && /* @__PURE__ */ a(
|
|
22051
22051
|
Je,
|
|
22052
22052
|
{
|
|
22053
|
-
onClick: (
|
|
22054
|
-
|
|
22053
|
+
onClick: (D) => {
|
|
22054
|
+
D.stopPropagation(), l == null || l(t);
|
|
22055
22055
|
},
|
|
22056
22056
|
children: [
|
|
22057
22057
|
/* @__PURE__ */ e(Fs, { className: "mr-2 h-3 w-3" }),
|
|
@@ -22062,8 +22062,8 @@ function rf({
|
|
|
22062
22062
|
t.permissions.canEdit && /* @__PURE__ */ e(J, { children: /* @__PURE__ */ a(
|
|
22063
22063
|
Je,
|
|
22064
22064
|
{
|
|
22065
|
-
onClick: (
|
|
22066
|
-
|
|
22065
|
+
onClick: (D) => {
|
|
22066
|
+
D.stopPropagation(), c(t);
|
|
22067
22067
|
},
|
|
22068
22068
|
children: [
|
|
22069
22069
|
/* @__PURE__ */ e(je, { className: "mr-2 h-3 w-3" }),
|
|
@@ -22076,8 +22076,8 @@ function rf({
|
|
|
22076
22076
|
/* @__PURE__ */ a(
|
|
22077
22077
|
Je,
|
|
22078
22078
|
{
|
|
22079
|
-
onClick: (
|
|
22080
|
-
|
|
22079
|
+
onClick: (D) => {
|
|
22080
|
+
D.stopPropagation(), i(t);
|
|
22081
22081
|
},
|
|
22082
22082
|
className: "text-destructive",
|
|
22083
22083
|
disabled: n,
|
|
@@ -22090,9 +22090,9 @@ function rf({
|
|
|
22090
22090
|
] }),
|
|
22091
22091
|
/* @__PURE__ */ e(xa, {}),
|
|
22092
22092
|
/* @__PURE__ */ a("div", { className: "space-y-1 px-2 py-2 text-xs text-slate-500 dark:text-slate-400", children: [
|
|
22093
|
-
(((
|
|
22093
|
+
(((L = t.ownership.createdBy) == null ? void 0 : L.type) === "tenant" || ((k = t.ownership.createdBy) == null ? void 0 : k.type) === "organization" && p) && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
22094
22094
|
/* @__PURE__ */ e(Ia, { className: "h-3 w-3" }),
|
|
22095
|
-
/* @__PURE__ */ e("span", { children: ((
|
|
22095
|
+
/* @__PURE__ */ e("span", { children: ((z = t.ownership.createdBy) == null ? void 0 : z.name) || "Unknown" })
|
|
22096
22096
|
] }),
|
|
22097
22097
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
22098
22098
|
/* @__PURE__ */ e(Pt, { className: "h-3 w-3" }),
|
|
@@ -22120,7 +22120,7 @@ function lf({ onRetry: t }) {
|
|
|
22120
22120
|
function of(t) {
|
|
22121
22121
|
const { onLoadDashboard: n, onEditDashboard: s, onDashboardItemClick: r } = t, [l, i] = V(""), [o, c] = V(!1), [u, d] = V(!1), [m, h] = V(
|
|
22122
22122
|
null
|
|
22123
|
-
), [p, x] = V(!1), [y, f] = V(null), [v, g] = V(null), [b, I] = V(null),
|
|
22123
|
+
), [p, x] = V(!1), [y, f] = V(null), [v, g] = V(null), [b, I] = V(null), M = Dt(
|
|
22124
22124
|
(se) => se.lastSelectedDashboard
|
|
22125
22125
|
), C = Dt(
|
|
22126
22126
|
(se) => se.selectedDashboard
|
|
@@ -22132,8 +22132,8 @@ function of(t) {
|
|
|
22132
22132
|
onDashboardSelect: r
|
|
22133
22133
|
}), {
|
|
22134
22134
|
resources: z,
|
|
22135
|
-
isLoading:
|
|
22136
|
-
isError:
|
|
22135
|
+
isLoading: D,
|
|
22136
|
+
isError: T,
|
|
22137
22137
|
createResource: E,
|
|
22138
22138
|
updateResource: P,
|
|
22139
22139
|
deleteResource: F,
|
|
@@ -22145,12 +22145,12 @@ function of(t) {
|
|
|
22145
22145
|
() => {
|
|
22146
22146
|
x(!1);
|
|
22147
22147
|
const se = y == null ? void 0 : y.id;
|
|
22148
|
-
f(null), (C == null ? void 0 : C.id) === se && (!(S != null && S.dashboard_id) && !w ? N() :
|
|
22148
|
+
f(null), (C == null ? void 0 : C.id) === se && (!(S != null && S.dashboard_id) && !w ? N() : M && M.id !== se && A(M));
|
|
22149
22149
|
},
|
|
22150
22150
|
(se) => {
|
|
22151
22151
|
c(!1), k(se, Q);
|
|
22152
22152
|
}
|
|
22153
|
-
), { currentUser: $ } =
|
|
22153
|
+
), { currentUser: $ } = Ht(), ne = z.filter(
|
|
22154
22154
|
(se) => {
|
|
22155
22155
|
var Z, B;
|
|
22156
22156
|
return ((Z = se == null ? void 0 : se.title) == null ? void 0 : Z.toLowerCase().includes(l.toLowerCase())) || ((B = se == null ? void 0 : se.description) == null ? void 0 : B.toLowerCase().includes(l.toLowerCase()));
|
|
@@ -22234,7 +22234,7 @@ function of(t) {
|
|
|
22234
22234
|
}
|
|
22235
22235
|
});
|
|
22236
22236
|
};
|
|
22237
|
-
return
|
|
22237
|
+
return D ? /* @__PURE__ */ e(_i, {}) : T ? /* @__PURE__ */ e(lf, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ a("div", { className: "relative flex h-full flex-1 flex-col gap-4", children: [
|
|
22238
22238
|
z && z.length > 5 && /* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(
|
|
22239
22239
|
_e,
|
|
22240
22240
|
{
|
|
@@ -22369,7 +22369,7 @@ function cf({
|
|
|
22369
22369
|
(C) => C.actions
|
|
22370
22370
|
), {
|
|
22371
22371
|
currentUser: c
|
|
22372
|
-
} =
|
|
22372
|
+
} = Ht(), u = c, { permissions: d } = Xn(), h = vd() && d.canAccessVisuals, p = "dashboards", [x, y] = Sr(
|
|
22373
22373
|
"resource-management-active-tab",
|
|
22374
22374
|
p
|
|
22375
22375
|
), f = h ? x : "dashboards", v = l === "overlay", g = ai(n, {
|
|
@@ -22382,7 +22382,7 @@ function cf({
|
|
|
22382
22382
|
) : "w-full max-w-[28rem] min-w-[18rem] overflow-hidden shadow-sm",
|
|
22383
22383
|
s
|
|
22384
22384
|
), I = (C) => {
|
|
22385
|
-
},
|
|
22385
|
+
}, M = (C) => {
|
|
22386
22386
|
console.log("Editing dashboard:", C);
|
|
22387
22387
|
};
|
|
22388
22388
|
return /* @__PURE__ */ e(xt, { children: (!v || t) && /* @__PURE__ */ a("div", { ref: g, className: b, children: [
|
|
@@ -22433,7 +22433,7 @@ function cf({
|
|
|
22433
22433
|
of,
|
|
22434
22434
|
{
|
|
22435
22435
|
onLoadDashboard: I,
|
|
22436
|
-
onEditDashboard:
|
|
22436
|
+
onEditDashboard: M,
|
|
22437
22437
|
onDashboardItemClick: r
|
|
22438
22438
|
}
|
|
22439
22439
|
) }),
|