@databrainhq/plugin 0.17.9-beta.32 → 0.17.9-beta.34

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.
Files changed (48) hide show
  1. package/dist/{Accordion-DwFCsJys.mjs → Accordion-DtzU-kv3.mjs} +1 -1
  2. package/dist/{Chart-DK90Btwz.mjs → Chart-BKjKglnR.mjs} +760 -760
  3. package/dist/{CreateGlobalFilter-CDz7kQ4l.mjs → CreateGlobalFilter-COJr9pxx.mjs} +195 -195
  4. package/dist/{CreateMetricV2-Dm-Yj526.mjs → CreateMetricV2-CfcDgw3E.mjs} +146 -146
  5. package/dist/{DraggableItem-zeUKOsQO.mjs → DraggableItem-B8IW0_no.mjs} +139 -139
  6. package/dist/{HorizontalStackTable-CRz3Ysjl.mjs → HorizontalStackTable-BgTor_KQ.mjs} +48 -48
  7. package/dist/{ManageMetricsV2-Do_l1O0Q.mjs → ManageMetricsV2-DM8gofxF.mjs} +3 -3
  8. package/dist/{MetricCardV2-DQ7__scR.mjs → MetricCardV2-Ff__3yWl.mjs} +146 -146
  9. package/dist/{NoDataFound-DqfFaDS2.mjs → NoDataFound-Ifpvns9-.mjs} +1 -1
  10. package/dist/{NoDataState-NCabdb95.mjs → NoDataState-DPVhHP6M.mjs} +2 -2
  11. package/dist/{Panel-DusYr6M8.mjs → Panel-BUwtA4r-.mjs} +1 -1
  12. package/dist/{PivotTableV2-C5p2Tm6Y.mjs → PivotTableV2-DQU2H33d.mjs} +2 -2
  13. package/dist/{PivotTableV3-DqbBVcNp.mjs → PivotTableV3-BLp5-cQr.mjs} +4 -4
  14. package/dist/{Portal-CsGzwm_y.mjs → Portal-BP2ivXF8.mjs} +2480 -2388
  15. package/dist/{RadioButton-CbCdIRZ-.mjs → RadioButton-oGBMxhHq.mjs} +2 -2
  16. package/dist/{ScheduleEmail-BAKc9_-V.mjs → ScheduleEmail-CiO6PMLd.mjs} +517 -517
  17. package/dist/{SearchMetricData-BhSQQqR8.mjs → SearchMetricData-C4stwNY9.mjs} +1272 -1272
  18. package/dist/{SortPanel-DAM5oTfq.mjs → SortPanel-Cy82r5dX.mjs} +1332 -1332
  19. package/dist/{Table-CbA0F_T-.mjs → Table-Cg4EZCAG.mjs} +296 -296
  20. package/dist/{TagInputField-BoexEOGa.mjs → TagInputField-DuY_whs7.mjs} +9 -9
  21. package/dist/{TextAreaField-BYWmVt9k.mjs → TextAreaField-D5O-kEVL.mjs} +297 -297
  22. package/dist/{TimeSeriesSettings-C8YubKkK.mjs → TimeSeriesSettings-TXu0_07R.mjs} +11 -11
  23. package/dist/{arrayToCsvString-D9T6ms_d.mjs → arrayToCsvString-Bj2E5XgM.mjs} +1 -1
  24. package/dist/{cardActions-BLBLsjcd.mjs → cardActions-BPRHHm2G.mjs} +21 -7
  25. package/dist/{cardQueryError-BQDAWqNF.mjs → cardQueryError-DFKFCfFx.mjs} +1274 -1274
  26. package/dist/{charts-CY0Vq7Bn.mjs → charts-C2loGjFP.mjs} +3 -3
  27. package/dist/{chevron-down-DAAEUsOt.mjs → chevron-down-BWD1dxqC.mjs} +6 -6
  28. package/dist/{conditionalFormatting-D6RjAw3N.mjs → conditionalFormatting-Ca-leGbK.mjs} +1 -1
  29. package/dist/{contrast-Clo5ZlPI.mjs → contrast-EppiiunY.mjs} +117 -112
  30. package/dist/{createGlobalFilter.module-BKBDNd1L.mjs → createGlobalFilter.module-B3yI7_04.mjs} +1 -1
  31. package/dist/data.cjs +1 -1
  32. package/dist/data.mjs +1 -1
  33. package/dist/{echarts-D2fgUAZU.mjs → echarts-CsSfDZ5q.mjs} +2 -2
  34. package/dist/{metric.mutation-CqBTyMb6.mjs → metric.mutation-hYspHj1p.mjs} +1 -1
  35. package/dist/{option-ywDB8mz_.mjs → option-B1zeYJnm.mjs} +1 -1
  36. package/dist/{permissions-BHlkdJ4i.mjs → permissions-Bc9NDT2w.mjs} +359 -359
  37. package/dist/{pluginV3Request-BlghXC7v.mjs → pluginV3Request-DFy6TETh.mjs} +1 -1
  38. package/dist/{renderer-BO0l-7XV.mjs → renderer-Bk8GbA94.mjs} +2 -2
  39. package/dist/{theme-CU-AvQm_.mjs → theme-BA-MvZE0.mjs} +1 -1
  40. package/dist/{timeseries-BBFyUgXR.mjs → timeseries-kGhqoQ6V.mjs} +1948 -1942
  41. package/dist/{toTasteAppearance-oR7SCi_i.mjs → toTasteAppearance-CGUd4zvZ.mjs} +1 -1
  42. package/dist/{useGuesTokenUsageLog-CUs9W4WA.mjs → useGuesTokenUsageLog-CVeQacbL.mjs} +1 -1
  43. package/dist/{usePublishArchivedMetrics-DQbGh3HA.mjs → usePublishArchivedMetrics-BGEBFLub.mjs} +2 -2
  44. package/dist/{useQuery-Cy8Ro28s.mjs → useQuery-CNVFkkjT.mjs} +1 -1
  45. package/dist/webcomponents.css +1 -1
  46. package/dist/webcomponents.es.js +3942 -3939
  47. package/dist/webcomponents.umd.js +185 -185
  48. package/package.json +2 -2
@@ -2,54 +2,54 @@ import "react";
2
2
  import "react-dom";
3
3
  import "react-dom/client";
4
4
  import { a as e, c as t, i as n, s as r } from "./cardStates-DiUMQ7_o.mjs";
5
- import { _t as i, p as a, vt as o } from "./pluginV3Request-BlghXC7v.mjs";
6
- import { K as s, et as c, it as l, l as u, ot as d } from "./metric.mutation-CqBTyMb6.mjs";
7
- import { $ as f, $a as p, Aa as m, En as h, Fr as g, Gr as _, Gt as ee, Ht as te, Ia as ne, Ir as re, Ji as ie, Kt as ae, Lt as oe, Mi as se, Nr as ce, On as le, Pr as ue, Sn as de, Un as v, Ur as fe, Va as pe, Wi as me, Wt as y, Xt as b, Zr as he, Zt as x, _i as ge, dn as S, en as _e, fn as ve, gi as C, gn as ye, hn as be, on as w, qr as xe, ri as Se, sn as Ce, vn as we, yi as Te, zi as Ee, zr as De } from "./Portal-CsGzwm_y.mjs";
8
- import { a as Oe } from "./timeseries-BBFyUgXR.mjs";
9
- import { c as ke, l as Ae, m as je, n as Me, s as Ne, u as Pe } from "./RadioButton-CbCdIRZ-.mjs";
10
- import { useCallback as Fe, useEffect as Ie, useMemo as T, useRef as Le, useState as E } from "react";
5
+ import { _t as i, p as a, vt as o } from "./pluginV3Request-DFy6TETh.mjs";
6
+ import { K as s, et as c, it as l, l as u, ot as d } from "./metric.mutation-hYspHj1p.mjs";
7
+ import { $ as f, Bi as p, Br as m, En as h, Fr as g, Gi as ee, Gt as _, Ha as te, Ht as ne, Ir as re, Jr as ie, Kr as ae, Kt as oe, La as se, Lr as ce, Lt as le, Ni as ue, On as v, Pr as de, Qr as fe, Sn as pe, Wn as me, Wr as y, Wt as he, Xt as b, Yi as ge, Zt as _e, _i as ve, bi as x, dn as S, en as ye, eo as be, fn as xe, gn as Se, hn as Ce, ii as we, ja as C, on as w, sn as Te, vi as Ee, vn as T } from "./Portal-BP2ivXF8.mjs";
8
+ import { a as De } from "./timeseries-kGhqoQ6V.mjs";
9
+ import { c as Oe, l as ke, m as Ae, n as je, s as Me, u as Ne } from "./RadioButton-oGBMxhHq.mjs";
10
+ import { useCallback as Pe, useEffect as Fe, useMemo as E, useRef as Ie, useState as D } from "react";
11
11
  //#region src/helpers/chartDisplayValue.ts
12
- var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
12
+ var O = (e, t = /* @__PURE__ */ new WeakSet()) => {
13
13
  if (typeof e != "object" || !e) return e;
14
14
  if (e instanceof Date) return e.toJSON();
15
15
  if (t.has(e)) return "[Circular]";
16
16
  if (t.add(e), Array.isArray(e)) {
17
- let n = e.map((e) => D(e, t));
17
+ let n = e.map((e) => O(e, t));
18
18
  return t.delete(e), n;
19
19
  }
20
- let n = Object.keys(e).sort().reduce((n, r) => (n[r] = D(e[r], t), n), {});
20
+ let n = Object.keys(e).sort().reduce((n, r) => (n[r] = O(e[r], t), n), {});
21
21
  return t.delete(e), n;
22
- }, O = (e) => {
22
+ }, k = (e) => {
23
23
  if (e == null) return "";
24
24
  if (typeof e != "object") return `${e}`;
25
25
  try {
26
- return JSON.stringify(D(e));
26
+ return JSON.stringify(O(e));
27
27
  } catch {
28
28
  return `${e}`;
29
29
  }
30
- }, Re = (e) => !e || typeof e != "object" || Array.isArray(e) ? e : Object.keys(e).reduce((t, n) => {
30
+ }, Le = (e) => !e || typeof e != "object" || Array.isArray(e) ? e : Object.keys(e).reduce((t, n) => {
31
31
  let r = e[n];
32
- return t[n] = typeof r == "object" && r ? O(r) : r, t;
33
- }, {}), ze = (e) => Array.isArray(e) ? e.map(Re) : e, Be = (e, t) => e?.label || t || e?.tableName || "", k = (e) => {
32
+ return t[n] = typeof r == "object" && r ? k(r) : r, t;
33
+ }, {}), Re = (e) => Array.isArray(e) ? e.map(Le) : e, ze = (e, t) => e?.label || t || e?.tableName || "", A = (e) => {
34
34
  let t = /* @__PURE__ */ new Set();
35
35
  return e.filter((e) => {
36
36
  let n = JSON.stringify(e?.measures?.sort());
37
37
  return !t.has(n) && (t.add(n), !0);
38
38
  });
39
- }, Ve = (e) => e?.dataMartColumnAlias || e?.name || "", He = ({ configuration: e, savedConfiguration: t }) => e.table?.name?.trim() ? e : t?.table?.name?.trim() ? t : e, A = (e) => {
39
+ }, Be = (e) => e?.dataMartColumnAlias || e?.name || "", Ve = ({ configuration: e, savedConfiguration: t }) => e.table?.name?.trim() ? e : t?.table?.name?.trim() ? t : e, j = (e) => {
40
40
  let t = /* @__PURE__ */ new Map();
41
41
  e.alias && e.name && t.set(e.alias, e.name);
42
42
  for (let n of e.joins || []) n.alias && n.name && t.set(n.alias, n.name);
43
43
  return t;
44
- }, j = (e, t, n) => {
44
+ }, M = (e, t, n) => {
45
45
  let r = e.firstOperand, i = e.secondOperand, a = r?.parentAlias ? t.get(r.parentAlias) : void 0, o = i?.parentAlias ? t.get(i.parentAlias) : void 0;
46
46
  return !a || !o || !r?.columnName || !i?.columnName ? !1 : n.some((e) => e.parentTableName === a && e.parentColumnName === r.columnName && e.childTableName === o && e.childColumnName === i.columnName || e.parentTableName === o && e.parentColumnName === i.columnName && e.childTableName === a && e.childColumnName === r.columnName);
47
- }, Ue = (e, t) => {
47
+ }, He = (e, t) => {
48
48
  let n = e.table, r = n?.joins || [];
49
49
  if (!r.length || !t.length) return e;
50
- let i = A(n), a = !1, o = r.map((e) => {
50
+ let i = j(n), a = !1, o = r.map((e) => {
51
51
  let n = e.conditions || [], r = n.filter((e) => {
52
- let n = j(e, i, t);
52
+ let n = M(e, i, t);
53
53
  return a ||= n, !n;
54
54
  });
55
55
  return r.length === n.length ? e : {
@@ -64,10 +64,10 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
64
64
  joins: o
65
65
  }
66
66
  } : e;
67
- }, M = (e, t, n) => j(e, A(t), n), We = (e) => !!e && e.operandType === "number", Ge = (e) => e.configType === "AGGREGATE" ? "number" : e.helperFunction ? "string" : e.cast?.value && e?.cast?.value !== "NONE" ? e?.cast?.value : e.datatype, N = (e, t = []) => {
67
+ }, Ue = (e, t, n) => M(e, j(t), n), We = (e) => !!e && e.operandType === "number", Ge = (e) => e.configType === "AGGREGATE" ? "number" : e.helperFunction ? "string" : e.cast?.value && e?.cast?.value !== "NONE" ? e?.cast?.value : e.datatype, N = (e, t = []) => {
68
68
  let n = new Set(t.filter((e) => e?.name).map((e) => e.name));
69
69
  return e.filter((e) => ["ASC", "DESC"].includes(e?.defaultSort || "")).map((e) => {
70
- let t = De.includes(e?.helperFunction || ""), n = b([e])?.dimensions?.[0];
70
+ let t = m.includes(e?.helperFunction || ""), n = b([e])?.dimensions?.[0];
71
71
  return e?.helperFunction === "date format" && e?.functionConfiguration ? {
72
72
  method: e.defaultSort,
73
73
  name: e?.alias || e?.name,
@@ -122,7 +122,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
122
122
  }, u = (e) => {
123
123
  let t = s(c[e.parentAlias]);
124
124
  return t ? ` in table ${Ye(t)}` : "";
125
- }, d = a.flatMap((e) => (e?.conditions || []).flatMap((e) => M(e, i, r) ? [] : [e?.firstOperand, e?.secondOperand])).find(l);
125
+ }, d = a.flatMap((e) => (e?.conditions || []).flatMap((e) => Ue(e, i, r) ? [] : [e?.firstOperand, e?.secondOperand])).find(l);
126
126
  if (d) return {
127
127
  code: "JOIN_COLUMN_HIDDEN",
128
128
  message: `A column${u(d)} is hidden from viewers, but this join needs it.`,
@@ -134,27 +134,27 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
134
134
  message: `A column${f ? u(f) : ""} is hidden from viewers, but this metric uses it.`,
135
135
  hint: "Ask your admin to unhide it in the datamart, or pick another column."
136
136
  };
137
- }, Ze = ({ type: e, firstOperand: t, secondOperand: n }) => e === "METRIC" || Ee.includes(t?.helperFunction || "") || Ee.includes(n?.helperFunction || "") ? "AGGREGATE" : "DIMENSION", Qe = ({ clientId: r, shouldApplyClientDataScope: Ee, clientSubsetData: D, setChartSettings: O, setError: Re, dbName: k = "", chartSettings: A, setData: j, setQuery: M, setLoading: N, setGroupByList: qe, data: F, limit: Ye, setDatasetSettings: Qe, token: $e, workspaceId: et, isDatabaseTenancy: tt, companyTenancyType: nt, clientColumnType: rt, setDrillDownSettings: it, drillDownSettings: I, datasourceId: at, datasetSettings: L, dashboardId: ot, id: R, companyId: st, isIncrementalJoin: z, onServerEvent: ct, metricEncryptedQuery: lt, rlsConditions: ut, isFrontendApp: dt, encryptedClientId: ft }) => {
138
- let { mutate: pt } = u(), mt = p(), [ht, gt] = E(null), B = Fe((t) => {
137
+ }, Ze = ({ type: e, firstOperand: t, secondOperand: n }) => e === "METRIC" || p.includes(t?.helperFunction || "") || p.includes(n?.helperFunction || "") ? "AGGREGATE" : "DIMENSION", Qe = ({ clientId: r, shouldApplyClientDataScope: p, clientSubsetData: O, setChartSettings: k, setError: Le, dbName: A = "", chartSettings: j, setData: M, setQuery: Ue, setLoading: N, setGroupByList: qe, data: F, limit: Ye, setDatasetSettings: Qe, token: $e, workspaceId: et, isDatabaseTenancy: tt, companyTenancyType: nt, clientColumnType: rt, setDrillDownSettings: it, drillDownSettings: I, datasourceId: at, datasetSettings: L, dashboardId: ot, id: R, companyId: st, isIncrementalJoin: z, onServerEvent: ct, metricEncryptedQuery: lt, rlsConditions: ut, isFrontendApp: dt, encryptedClientId: ft }) => {
138
+ let { mutate: pt } = u(), mt = be(), [ht, gt] = D(null), B = Pe((t) => {
139
139
  let r = typeof t == "string" && t && e() === "viewer" ? Je(t, mt, R) : t;
140
140
  if (typeof r == "string" || r == null) {
141
- gt(null), Re(r);
141
+ gt(null), Le(r);
142
142
  return;
143
143
  }
144
- gt(r), Re(n(r));
144
+ gt(r), Le(n(r));
145
145
  }, [
146
- Re,
146
+ Le,
147
147
  mt,
148
148
  R
149
- ]), [_t, vt] = E(!0), [V, yt] = E(), [H, bt] = E([]), [xt, St] = E([]), [Ct, wt] = E([]), [Tt, Et] = E({
149
+ ]), [_t, vt] = D(!0), [V, yt] = D(), [H, bt] = D([]), [xt, St] = D([]), [Ct, wt] = D([]), [Tt, Et] = D({
150
150
  data: [],
151
151
  error: "",
152
152
  isLoading: !1,
153
153
  currentValue: ""
154
- }), [U, W] = E(_), [G, K] = E([]), [q, J] = E([]), [Dt, Ot] = E({
154
+ }), [U, W] = D(ae), [G, K] = D([]), [q, J] = D([]), [Dt, Ot] = D({
155
155
  value: "",
156
156
  label: ""
157
- }), [kt, At] = E([]), [jt, Mt] = E([]), [Y, Nt] = E([]), { data: Pt } = pe(), Ft = nt || (tt ? "DATABASE" : "TABLE"), It = nt || Pt?.companyTenancyType || (tt ? "DATABASE" : void 0), Lt = !!tt || Me(It), { mutate: Rt, error: zt } = f(), X = T(() => {
157
+ }), [kt, At] = D([]), [jt, Mt] = D([]), [Y, Nt] = D([]), { data: Pt } = te(), Ft = nt || (tt ? "DATABASE" : "TABLE"), It = nt || Pt?.companyTenancyType || (tt ? "DATABASE" : void 0), Lt = !!tt || je(It), { mutate: Rt, error: zt } = f(), X = E(() => {
158
158
  if (z) {
159
159
  if (U?.table?.name && V?.tableName) {
160
160
  if (U?.table?.joins?.length) return H?.filter((e) => e.tableName === U?.table?.name || U?.table?.joins?.[0]?.name === e.tableName);
@@ -172,35 +172,35 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
172
172
  U,
173
173
  z,
174
174
  Ct
175
- ]), Bt = T(() => U.dimensions.length > 1 && !!U.aggregates.length, [U.dimensions, U.aggregates]), Vt = T(() => [
176
- m.boxplot,
177
- m.funnel,
178
- m.funnelV2,
179
- m.gauge,
180
- m.geoBarMap,
181
- m.geoMap,
182
- m.geoScatterMap,
183
- m.horizontalStackTable,
184
- m.pivot,
185
- m.pivotV2,
186
- m.pivotV3,
187
- m.sankey,
188
- m.singleValue,
189
- m.timeSeries,
190
- m.treeMap
191
- ].includes(A.chartType), [A.chartType]), Z = T(() => G.length + q.length === 0, [G, q]), Ht = T(() => [he, ge].includes(k?.toLowerCase() || ""), [k]), Ut = T(() => ({ sorting: {
175
+ ]), Bt = E(() => U.dimensions.length > 1 && !!U.aggregates.length, [U.dimensions, U.aggregates]), Vt = E(() => [
176
+ C.boxplot,
177
+ C.funnel,
178
+ C.funnelV2,
179
+ C.gauge,
180
+ C.geoBarMap,
181
+ C.geoMap,
182
+ C.geoScatterMap,
183
+ C.horizontalStackTable,
184
+ C.pivot,
185
+ C.pivotV2,
186
+ C.pivotV3,
187
+ C.sankey,
188
+ C.singleValue,
189
+ C.timeSeries,
190
+ C.treeMap
191
+ ].includes(j.chartType), [j.chartType]), Z = E(() => G.length + q.length === 0, [G, q]), Ht = E(() => [fe, Ee].includes(A?.toLowerCase() || ""), [A]), Ut = E(() => ({ sorting: {
192
192
  isEnabled: !0,
193
193
  isEnabledAutoSort: !1,
194
194
  sortingType: "both-axis",
195
195
  list: G,
196
196
  setList: K
197
- } }), [G]), Wt = T(() => ({ sorting: {
197
+ } }), [G]), Wt = E(() => ({ sorting: {
198
198
  isEnabled: !0,
199
199
  isEnabledAutoSort: !1,
200
200
  sortingType: "both-axis",
201
201
  list: q,
202
202
  setList: J
203
- } }), [q]), Gt = T(() => A.chartType === m.timeSeries, [A.chartType]), Kt = Le(null), qt = T(() => V ? V?.type === "custom" ? {
203
+ } }), [q]), Gt = E(() => j.chartType === C.timeSeries, [j.chartType]), Kt = Ie(null), qt = E(() => V ? V?.type === "custom" ? {
204
204
  value: `none^^^^^^${V?.sql}^^^^^^${V?.alias || "dbn_sql_table"}^^^^^^custom`,
205
205
  label: V?.alias || "dbn_sql_table",
206
206
  icon: "table"
@@ -212,8 +212,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
212
212
  value: "",
213
213
  label: "",
214
214
  icon: "table"
215
- }, [V]), Jt = T(() => {
216
- let [e, t, n, r] = Dt.value?.split("^^^^^^"), i = r === "custom" ? n || "dbn_sql_table" : `${w(e, k)}_${t?.replaceAll(" ", "_")?.replace("*", "_")}`;
215
+ }, [V]), Jt = E(() => {
216
+ let [e, t, n, r] = Dt.value?.split("^^^^^^"), i = r === "custom" ? n || "dbn_sql_table" : `${w(e, A)}_${t?.replaceAll(" ", "_")?.replace("*", "_")}`;
217
217
  return r === "custom" ? (X?.find((e) => e.tableName === n)?.columnsWithDataType || [])?.map((e) => ({
218
218
  value: `${n}^^^^^^${e.name}^^^^^^${e.dataType || ""}^^^^^^none^^^^^^${n}`,
219
219
  label: `${e?.label || e.dataMartColumnAlias || e.name}`,
@@ -240,36 +240,36 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
240
240
  }, [
241
241
  X,
242
242
  Dt.value,
243
- k
244
- ]), Yt = T(() => {
243
+ A
244
+ ]), Yt = E(() => {
245
245
  let e = U?.table?.joins?.map((e) => X?.find((t) => t?.schemaName === e?.schema && t?.tableName === e?.name))?.filter((e) => e) || [], t = X?.find((e) => e?.schemaName === U?.table?.schema && e?.tableName === U?.table?.name);
246
246
  return (t ? [t, ...e?.filter((e) => e?.tableName !== t?.tableName) || []] : e || [])?.map((e) => ({
247
247
  value: `${e.schemaName}^^^^^^${e.tableName}`,
248
- label: Be(e),
248
+ label: ze(e),
249
249
  table: e
250
250
  })) || [];
251
- }, [U, X]), Xt = T(() => {
252
- A?.pivotTableSettings2;
253
- let e = A?.chartType === m.timeSeries, [t, n, r] = Dt?.value?.split("^^^^^^");
251
+ }, [U, X]), Xt = E(() => {
252
+ j?.pivotTableSettings2;
253
+ let e = j?.chartType === C.timeSeries, [t, n, r] = Dt?.value?.split("^^^^^^");
254
254
  return [...q, ...G?.filter((t) => !(S(t.cast?.value?.toLowerCase() || t.datatype?.toLowerCase()) && e))].filter((e) => e.table?.type === "custom" ? e.table?.alias === r : e.table?.tableName === n && e.table?.schemaName === t)?.map((e) => ({
255
255
  value: `${e.parentAlias}^^^^^^${e.name || e.alias}^^^^^^${e.datatype}^^^^^^${e?.table?.schemaName}^^^^^^${e.table?.tableName}^^^^^^new`,
256
- label: `${x(e) || e?.alias}`,
256
+ label: `${_e(e) || e?.alias}`,
257
257
  badge: "New",
258
258
  column: e
259
259
  }));
260
260
  }, [
261
- A?.pivotTableSettings2,
262
- A.chartType,
261
+ j?.pivotTableSettings2,
262
+ j.chartType,
263
263
  Dt?.value,
264
264
  q,
265
265
  G
266
- ]), Zt = T(() => {
266
+ ]), Zt = E(() => {
267
267
  if (!V) return [];
268
268
  let e = U?.table?.joins?.map((e) => X?.find((t) => t?.schemaName === e?.schema && t?.tableName === e?.name))?.filter((e) => e) || [], t = X?.find((e) => tt ? e?.tableName === U?.table?.name : e?.tableName === U?.table?.name && e?.schemaName === U?.table?.schema);
269
269
  return (t ? [...e, t] : [...e]).flatMap((e) => {
270
- let t = X?.find((t) => tt ? t?.tableName === e?.tableName : t?.tableName === e?.tableName && t?.schemaName === e?.schemaName) || e, n = t?.type === "custom" ? t?.alias || "dbn_sql_table" : `${w(t?.schemaName, k)}_${t?.tableName?.replaceAll(" ", "_")?.replace("*", "_")}`;
270
+ let t = X?.find((t) => tt ? t?.tableName === e?.tableName : t?.tableName === e?.tableName && t?.schemaName === e?.schemaName) || e, n = t?.type === "custom" ? t?.alias || "dbn_sql_table" : `${w(t?.schemaName, A)}_${t?.tableName?.replaceAll(" ", "_")?.replace("*", "_")}`;
271
271
  return t?.columnsWithDataType?.map((e) => ({
272
- alias: Ve(e),
272
+ alias: Be(e),
273
273
  label: e?.label || e?.dataMartColumnAlias || e?.name,
274
274
  configType: e?.isAggregate ? "AGGREGATE" : "DIMENSION",
275
275
  isApplyTimezone: e?.isApplyTimezone,
@@ -290,11 +290,11 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
290
290
  })) || [];
291
291
  });
292
292
  }, [
293
- k,
293
+ A,
294
294
  U?.table,
295
295
  X
296
- ]), Qt = T(() => {
297
- let [e, t, n, r] = Dt?.value?.split("^^^^^^"), i = r === "custom" ? n || "dbn_sql_table" : `${w(e, k)}_${t?.replaceAll(" ", "_")?.replace("*", "_")}`, a = Jt?.filter((e) => {
296
+ ]), Qt = E(() => {
297
+ let [e, t, n, r] = Dt?.value?.split("^^^^^^"), i = r === "custom" ? n || "dbn_sql_table" : `${w(e, A)}_${t?.replaceAll(" ", "_")?.replace("*", "_")}`, a = Jt?.filter((e) => {
298
298
  let [t, n] = e?.value?.split("^^^^^^");
299
299
  return ![...G, ...q].some((e) => t === e?.parentAlias && n === e?.name && !e?.helperFunction);
300
300
  })?.map((e) => ({
@@ -304,7 +304,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
304
304
  let t = Ge(e);
305
305
  return {
306
306
  value: `${e?.parentAlias}^^^^^^${e?.name || e?.alias}^^^^^^${t}^^^^^^${e?.table?.schemaName}^^^^^^${e?.table?.tableName}^^^^^^${e?.helperFunction}^^^^^^${e?.alias}^^^^^^${e?.configType}^^^^^^${e?.isApplyTimezone}`,
307
- label: `${x(e)}`,
307
+ label: `${_e(e)}`,
308
308
  badge: "New",
309
309
  column: e,
310
310
  dimension: {
@@ -326,9 +326,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
326
326
  ]), $t = (e, t) => {
327
327
  let n = e?.cast?.value === "NONE" ? void 0 : e?.cast?.value, r = t || n || e?.datatype;
328
328
  if (r) {
329
- if (S(r)) return A.chartType === m.timeSeries ? [] : re;
330
- if (C.includes(r?.toLowerCase()) || r?.toLowerCase()?.startsWith("decimal") || r?.toLowerCase()?.startsWith("numeric")) return ce;
331
- if (se.includes(r?.toLowerCase()) || r?.toLowerCase()?.includes("char")) return Ht ? r?.toLowerCase() === "keyword" || r?.toLowerCase().includes("keyword") || e?.datatype?.toLowerCase() === "keyword" || e?.name && e.name.endsWith(".keyword") || r && (se.includes(r?.toLowerCase()) || r?.toLowerCase()?.includes("char")) && !r?.toLowerCase().includes("text") ? [
329
+ if (S(r)) return j.chartType === C.timeSeries ? [] : ce;
330
+ if (ve.includes(r?.toLowerCase()) || r?.toLowerCase()?.startsWith("decimal") || r?.toLowerCase()?.startsWith("numeric")) return de;
331
+ if (ue.includes(r?.toLowerCase()) || r?.toLowerCase()?.includes("char")) return Ht ? r?.toLowerCase() === "keyword" || r?.toLowerCase().includes("keyword") || e?.datatype?.toLowerCase() === "keyword" || e?.name && e.name.endsWith(".keyword") || r && (ue.includes(r?.toLowerCase()) || r?.toLowerCase()?.includes("char")) && !r?.toLowerCase().includes("text") ? [
332
332
  {
333
333
  value: "lowercase",
334
334
  label: "Lowercase"
@@ -344,9 +344,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
344
344
  ] : [{
345
345
  value: "NONE",
346
346
  label: "Original Value"
347
- }] : t ? g.filter((e) => !Se.includes(e.value)) : g;
347
+ }] : t ? re.filter((e) => !we.includes(e.value)) : re;
348
348
  }
349
- return ue;
349
+ return g;
350
350
  }, Q = (e) => {
351
351
  let t = /* @__PURE__ */ new Map();
352
352
  return [
@@ -356,7 +356,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
356
356
  ].forEach((e) => {
357
357
  let n = e?.uniqueId || e?.alias;
358
358
  n && t.set(n, e);
359
- }), ee(e, k || "", [...t.values()]);
359
+ }), _(e, A || "", [...t.values()]);
360
360
  }, en = (e, t) => e?.isDataMartLabel ? Q([e])?.[0] === t : e?.alias === t, tn = (e, t) => e?.find((e) => en(e, t)), nn = (e, t) => {
361
361
  if ((t || F)?.length) {
362
362
  let n = Object.keys((t || F)?.[0] || {});
@@ -370,24 +370,24 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
370
370
  "<=",
371
371
  ">",
372
372
  ">="
373
- ].includes(t), l = C.includes(n) || n?.startsWith("decimal") || n?.startsWith("numeric");
373
+ ].includes(t), l = ve.includes(n) || n?.startsWith("decimal") || n?.startsWith("numeric");
374
374
  return r ? "NULL" : t === "BETWEEN" ? "DATE_RANGE" : o ? "INPUT_TEXT_FIELD" : s && (a && !i || c) ? "TIME_FILTER" : l && !r ? i ? "MULTI_FILTER_DROPDOWN" : "INPUT_NUMBER_FIELD" : i ? "MULTI_FILTER_DROPDOWN" : "FILTER_DROPDOWN";
375
375
  }, an = (e) => {
376
376
  if (e) return H?.find((t) => e?.type === "custom" || t?.type === "custom" ? t?.alias === e?.alias : t?.schemaName === e?.schemaName && t?.tableName === e?.tableName);
377
377
  }, on = (e) => {
378
- let t = (e) => e?.schema ? `${e.schema}.${e.name}` : e?.name || "", n = (e) => e?.schemaName ? `${e.schemaName}.${e.tableName}` : e?.tableName || "", r = e?.table?.type === "custom" || !!Ne({
378
+ let t = (e) => e?.schema ? `${e.schema}.${e.name}` : e?.name || "", n = (e) => e?.schemaName ? `${e.schemaName}.${e.tableName}` : e?.tableName || "", r = e?.table?.type === "custom" || !!Me({
379
379
  candidates: H || [],
380
380
  getName: n,
381
381
  target: t(e?.table),
382
382
  companyTenancyType: Ft,
383
- dbName: k
384
- }), i = (e?.table?.joins || []).every((e) => !!Ne({
383
+ dbName: A
384
+ }), i = (e?.table?.joins || []).every((e) => !!Me({
385
385
  candidates: H || [],
386
386
  getName: n,
387
387
  target: t(e),
388
388
  companyTenancyType: Ft,
389
- dbName: k
390
- })), a = D?.relationships || [], o = Ae(e?.table?.joins || [], a, !0, Ft, k, e?.table), s = ke(Ue(e, a), D?.tableList || [], !0, Ft, k);
389
+ dbName: A
390
+ })), a = O?.relationships || [], o = ke(e?.table?.joins || [], a, !0, Ft, A, e?.table), s = Oe(He(e, a), O?.tableList || [], !0, Ft, A);
391
391
  return {
392
392
  isValid: r && i && o && s,
393
393
  tableExists: r,
@@ -397,19 +397,19 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
397
397
  tenancyType: Ft
398
398
  };
399
399
  }, sn = () => {
400
- M(""), N(!1), H?.length ? yt(H?.[0]) : yt(void 0), j([]), At([]), Mt([]), K([]), J([]), W(_), O((e) => ({
400
+ Ue(""), N(!1), H?.length ? yt(H?.[0]) : yt(void 0), M([]), At([]), Mt([]), K([]), J([]), W(ae), k((e) => ({
401
401
  ...e,
402
402
  isDynamicSeries: !1,
403
403
  seriesField: "ungrouped",
404
404
  seriesOptions: []
405
405
  }));
406
406
  }, cn = ({ chartType: e, chartDimensions: t, chartMetrics: n, chartAggregateColumns: r, resultData: i, configAggregates: a, pivotHeaderColumns: o, chartTimeColumns: s, seriesName: c, isRemoveGroupBy: l }) => {
407
- let u = t ?? nn(Q(G), i || F), d = n ?? nn(Q(q), i || F), f = r ?? nn(Q(q.filter((e) => e.configType === "AGGREGATE")), i || F), p = fe;
407
+ let u = t ?? nn(Q(G), i || F), d = n ?? nn(Q(q), i || F), f = r ?? nn(Q(q.filter((e) => e.configType === "AGGREGATE")), i || F), p = y;
408
408
  if ([
409
- m.progressBar,
410
- m.linearGauge,
411
- m.progressBarV2
412
- ].includes(e || "") && (O((t) => ({
409
+ C.progressBar,
410
+ C.linearGauge,
411
+ C.progressBarV2
412
+ ].includes(e || "") && (k((t) => ({
413
413
  ...t,
414
414
  chartType: e || t.chartType,
415
415
  progressColumn: d?.[0] || "",
@@ -417,30 +417,30 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
417
417
  progressMaxColumn: d?.length > 2 ? d?.[2] : d?.[1] || ""
418
418
  })), p = {
419
419
  ...p,
420
- chartType: e || m.progressBar,
420
+ chartType: e || C.progressBar,
421
421
  progressColumn: d?.[0] || "",
422
422
  progressMinColumn: d?.length > 2 ? d?.[1] : "",
423
423
  progressMaxColumn: d?.length > 2 ? d?.[2] : d?.[1] || ""
424
- }), e === m.singleValue) O((t) => ({
424
+ }), e === C.singleValue) k((t) => ({
425
425
  ...t,
426
426
  chartType: e || t.chartType,
427
427
  singleValue: d?.[0] || u?.[0],
428
428
  dateColumns: s
429
429
  })), p = {
430
430
  ...p,
431
- chartType: e || m.singleValue,
431
+ chartType: e || C.singleValue,
432
432
  singleValue: d?.[0] || u?.[0],
433
433
  dateColumns: s
434
434
  };
435
435
  else if (f.length && [
436
- m.pivot,
437
- m.treeMap,
438
- m.gantt
439
- ].includes(e || "") && (F?.length || i?.length)) O((t) => ({
436
+ C.pivot,
437
+ C.treeMap,
438
+ C.gantt
439
+ ].includes(e || "") && (F?.length || i?.length)) k((t) => ({
440
440
  ...t,
441
441
  chartType: e || t.chartType,
442
442
  pivotTableSettings: {
443
- ...A.pivotTableSettings,
443
+ ...j.pivotTableSettings,
444
444
  columns: u,
445
445
  rows: f
446
446
  },
@@ -448,20 +448,20 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
448
448
  dateColumns: s
449
449
  })), p = {
450
450
  ...p,
451
- chartType: e || m.pivot,
451
+ chartType: e || C.pivot,
452
452
  pivotTableSettings: {
453
- ...A.pivotTableSettings,
453
+ ...j.pivotTableSettings,
454
454
  columns: u,
455
455
  rows: f
456
456
  },
457
457
  yAxisList: [...u, ...f],
458
458
  dateColumns: s
459
459
  };
460
- else if (f.length && [m.pivotV2].includes(e || A.chartType) && (F?.length || i?.length)) O((n) => ({
460
+ else if (f.length && [C.pivotV2].includes(e || j.chartType) && (F?.length || i?.length)) k((n) => ({
461
461
  ...n,
462
462
  chartType: e || n.chartType,
463
463
  pivotTableSettings2: {
464
- ...A.pivotTableSettings2,
464
+ ...j.pivotTableSettings2,
465
465
  dimensions: u,
466
466
  headers: o || [],
467
467
  measures: f,
@@ -471,9 +471,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
471
471
  dateColumns: s
472
472
  })), p = {
473
473
  ...p,
474
- chartType: e || m.pivot,
474
+ chartType: e || C.pivot,
475
475
  pivotTableSettings2: {
476
- ...A.pivotTableSettings2,
476
+ ...j.pivotTableSettings2,
477
477
  dimensions: u,
478
478
  headers: o || [],
479
479
  measures: f,
@@ -482,11 +482,11 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
482
482
  },
483
483
  dateColumns: s
484
484
  };
485
- else if (f.length && [m.pivotV3].includes(e || A.chartType) && (F?.length || i?.length)) O((n) => ({
485
+ else if (f.length && [C.pivotV3].includes(e || j.chartType) && (F?.length || i?.length)) k((n) => ({
486
486
  ...n,
487
487
  chartType: e || n.chartType,
488
488
  pivotTableSettings3: {
489
- ...A.pivotTableSettings3,
489
+ ...j.pivotTableSettings3,
490
490
  columns: [...u, ...d],
491
491
  rows: o || [],
492
492
  dims: t || Q(G) || [],
@@ -495,9 +495,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
495
495
  dateColumns: s
496
496
  })), p = {
497
497
  ...p,
498
- chartType: e || m.pivot,
498
+ chartType: e || C.pivot,
499
499
  pivotTableSettings3: {
500
- ...A.pivotTableSettings3,
500
+ ...j.pivotTableSettings3,
501
501
  columns: [...u, ...d],
502
502
  rows: o || [],
503
503
  dims: t || Q(G) || [],
@@ -505,9 +505,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
505
505
  },
506
506
  dateColumns: s
507
507
  };
508
- else if ([m.table, m.trendAnalyzer].includes(e || "")) {
508
+ else if ([C.table, C.trendAnalyzer].includes(e || "")) {
509
509
  let { numberKeys: t } = h(i || F || []);
510
- O((n) => ({
510
+ k((n) => ({
511
511
  ...n,
512
512
  chartType: e || n.chartType,
513
513
  yAxisList: [...u, ...d],
@@ -515,12 +515,12 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
515
515
  dateColumns: s
516
516
  })), p = {
517
517
  ...p,
518
- chartType: e || m.table,
518
+ chartType: e || C.table,
519
519
  yAxisList: [...u, ...d],
520
520
  numberColumns: t,
521
521
  dateColumns: s
522
522
  };
523
- } else if ([m.waterfall, m.waterfallV2].includes(e || "")) O((t) => ({
523
+ } else if ([C.waterfall, C.waterfallV2].includes(e || "")) k((t) => ({
524
524
  ...t,
525
525
  chartType: e || t.chartType,
526
526
  xAxis: u?.[0],
@@ -528,12 +528,12 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
528
528
  dateColumns: s
529
529
  })), p = {
530
530
  ...p,
531
- chartType: e || m.waterfall,
531
+ chartType: e || C.waterfall,
532
532
  xAxis: u?.[0],
533
533
  yAxisList: [d?.[0]],
534
534
  dateColumns: s
535
535
  };
536
- else if (e === m.sankey) {
536
+ else if (e === C.sankey) {
537
537
  let t = u?.length > 1 ? [
538
538
  u?.[0],
539
539
  u?.[1],
@@ -543,7 +543,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
543
543
  d?.[1],
544
544
  d?.[2]
545
545
  ];
546
- O((n) => ({
546
+ k((n) => ({
547
547
  ...n,
548
548
  chartType: e || n.chartType,
549
549
  sankeyValues: t,
@@ -551,12 +551,12 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
551
551
  dateColumns: s
552
552
  })), p = {
553
553
  ...p,
554
- chartType: e || m.sankey,
554
+ chartType: e || C.sankey,
555
555
  sankeyValues: t,
556
556
  yAxisList: t,
557
557
  dateColumns: s
558
558
  };
559
- } else [m.funnel, m.funnelV2].includes(e || "") ? (O((t) => ({
559
+ } else [C.funnel, C.funnelV2].includes(e || "") ? (k((t) => ({
560
560
  ...t,
561
561
  chartType: e || t.chartType,
562
562
  step: u?.[0] || "",
@@ -566,13 +566,13 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
566
566
  dateColumns: s
567
567
  })), p = {
568
568
  ...p,
569
- chartType: e || m.funnel,
569
+ chartType: e || C.funnel,
570
570
  step: u?.[0] || "",
571
571
  measure: d?.[0],
572
572
  xAxis: u?.[0] || "",
573
573
  yAxisList: [d?.[0]],
574
574
  dateColumns: s
575
- }) : e === m.horizontalStackTable ? (O((t) => ({
575
+ }) : e === C.horizontalStackTable ? (k((t) => ({
576
576
  ...t,
577
577
  chartType: e || t.chartType,
578
578
  stackTableCols: d || [],
@@ -580,11 +580,11 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
580
580
  dateColumns: s
581
581
  })), p = {
582
582
  ...p,
583
- chartType: e || m.horizontalStackTable,
583
+ chartType: e || C.horizontalStackTable,
584
584
  stackTableCols: d || [],
585
585
  yAxisList: u,
586
586
  dateColumns: s
587
- }) : [m.gauge, m.gaugeV2].includes(e || "") ? (O((t) => ({
587
+ }) : [C.gauge, C.gaugeV2].includes(e || "") ? (k((t) => ({
588
588
  ...t,
589
589
  chartType: e || t.chartType,
590
590
  gaugeSettings: {
@@ -595,14 +595,14 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
595
595
  dateColumns: s
596
596
  })), p = {
597
597
  ...p,
598
- chartType: e || m.gauge,
598
+ chartType: e || C.gauge,
599
599
  gaugeSettings: {
600
600
  dimensions: u,
601
601
  metric: f?.[0] || d?.[0]
602
602
  },
603
603
  yAxisList: [...u, ...d],
604
604
  dateColumns: s
605
- }) : [m.bubbleV2].includes(e || "") ? (O((t) => ({
605
+ }) : [C.bubbleV2].includes(e || "") ? (k((t) => ({
606
606
  ...t,
607
607
  chartType: e || t?.chartType,
608
608
  xAxis: u?.[0],
@@ -616,7 +616,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
616
616
  yAxisList: d,
617
617
  dateColumns: s,
618
618
  bubbleDims: [u?.[0] || "", u?.[1] || ""]
619
- }) : (O((t) => ({
619
+ }) : (k((t) => ({
620
620
  ...t,
621
621
  chartType: e || t.chartType,
622
622
  xAxis: u?.[0],
@@ -632,7 +632,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
632
632
  dateColumns: s,
633
633
  seriesField: l ? "" : c || p?.seriesField
634
634
  });
635
- O((e) => ({
635
+ k((e) => ({
636
636
  ...e,
637
637
  seriesField: l ? "" : c || e?.seriesField,
638
638
  isMultiDimension: !l && !!(c || e?.seriesField && e?.seriesField !== "ungrouped")
@@ -651,26 +651,26 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
651
651
  aggregates: r,
652
652
  orders: Ke(e?.orders || [], t)
653
653
  };
654
- }, $ = ({ prevConfiguration: e, onSuccess: n, prevLimit: i, chartFieldParams: a, updatedDims: o, updatedMetrics: u, selectedMainTable: f, isTimeseriesAction: p, isPivotAction: h, isGroupByAction: g, isAddComparisonAction: _, sqlChartType: ee, updatedSqlColumnList: te, updatedTable: re, isRemoveGroupBy: ae, queryConfiguration: se }) => {
655
- let ce = !!se, le = I?.isEnableGroupBy && I?.configV2?.isEnable ? de({
654
+ }, $ = ({ prevConfiguration: e, onSuccess: n, prevLimit: i, chartFieldParams: a, updatedDims: o, updatedMetrics: u, selectedMainTable: f, isTimeseriesAction: m, isPivotAction: h, isGroupByAction: g, isAddComparisonAction: ee, sqlChartType: _, updatedSqlColumnList: te, updatedTable: ne, isRemoveGroupBy: re, queryConfiguration: ae }) => {
655
+ let oe = !!ae, ce = I?.isEnableGroupBy && I?.configV2?.isEnable ? pe({
656
656
  config: I.configV2,
657
657
  selectedDims: o || G,
658
658
  selectedMetrics: u || q,
659
659
  previousSelectedDims: G,
660
660
  previousSelectedMetrics: q
661
661
  }) : !1;
662
- _ || O((e) => ({
662
+ ee || k((e) => ({
663
663
  ...e,
664
664
  isEnableComparisonFilter: !1
665
665
  }));
666
- let ue = ee || a?.chartType || A.chartType, v = !u?.length && ue === m.combo ? m.line : ue, fe = !ce && !h && [m.pivotV2, m.pivotV3].includes(v), pe = !ce && !p && v === m.timeSeries, me = !ce && !g && !!A.isMultiDimension && A.seriesField !== "ungrouped" && [
667
- m.line,
668
- m.bar,
669
- m.stack,
670
- m.row,
671
- m.horizontalStack
666
+ let ue = _ || a?.chartType || j.chartType, v = !u?.length && ue === C.combo ? C.line : ue, de = !oe && !h && [C.pivotV2, C.pivotV3].includes(v), fe = !oe && !m && v === C.timeSeries, me = !oe && !g && !!j.isMultiDimension && j.seriesField !== "ungrouped" && [
667
+ C.line,
668
+ C.bar,
669
+ C.stack,
670
+ C.row,
671
+ C.horizontalStack
672
672
  ].includes(v);
673
- fe && Et({
673
+ de && Et({
674
674
  data: [],
675
675
  error: "",
676
676
  isLoading: !1,
@@ -679,13 +679,13 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
679
679
  let y = e ? {
680
680
  ...e,
681
681
  isAllClient: !1
682
- } : void 0, he = se ? {
683
- ...se,
682
+ } : void 0, he = ae ? {
683
+ ...ae,
684
684
  isAllClient: !1
685
685
  } : void 0;
686
686
  y && W(y);
687
- let x = {
688
- selectedTable: re || qt,
687
+ let _e = {
688
+ selectedTable: ne || qt,
689
689
  selectedJoins: [],
690
690
  configuration: {
691
691
  ...y || U,
@@ -708,14 +708,14 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
708
708
  label: "",
709
709
  value: ""
710
710
  },
711
- forecast: xe,
711
+ forecast: ie,
712
712
  createdNewColumnOptions: [],
713
713
  selectedCustomColumns: [],
714
714
  selectedManageColumns: [],
715
715
  selectedNewManageColumns: [],
716
716
  createdFilters: kt,
717
717
  createdSorts: jt,
718
- comparisonLagSettings: ie,
718
+ comparisonLagSettings: ge,
719
719
  selectedCustomGroups: [],
720
720
  selectedGroupColumns: [],
721
721
  metrics: (y || U).aggregates?.map((e) => ({
@@ -747,162 +747,162 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
747
747
  isAutoCompleteMode: !1,
748
748
  isDataMartQuery: !1
749
749
  }
750
- }, ge = I?.isEnableGroupBy && I?.configV2?.isEnable && !le ? be({
750
+ }, ve = I?.isEnableGroupBy && I?.configV2?.isEnable && !ce ? Ce({
751
751
  config: I.configV2,
752
- selectedDims: x.newDatasetSettings?.selectedDims,
753
- selectedMetrics: x.newDatasetSettings?.selectedMetrics,
752
+ selectedDims: _e.newDatasetSettings?.selectedDims,
753
+ selectedMetrics: _e.newDatasetSettings?.selectedMetrics,
754
754
  previousSelectedDims: G,
755
755
  previousSelectedMetrics: q
756
756
  }) : void 0;
757
- if (Qe(x), B(""), N(!0), j([]), ge && it((e) => ({
757
+ if (Qe(_e), B(""), N(!0), M([]), ve && it((e) => ({
758
758
  ...e,
759
- configV2: ge
760
- })), le && it((e) => ({
759
+ configV2: ve
760
+ })), ce && it((e) => ({
761
761
  ...e,
762
762
  isEnableGroupBy: !1,
763
763
  isEnableCrossFilter: !1,
764
764
  drilldownChartSettings: void 0,
765
765
  drillType: "",
766
766
  configV2: void 0
767
- })), (x.newDatasetSettings?.selectedDims?.length || 0) + (x.newDatasetSettings?.selectedMetrics?.length || 0) === 0) {
767
+ })), (_e.newDatasetSettings?.selectedDims?.length || 0) + (_e.newDatasetSettings?.selectedMetrics?.length || 0) === 0) {
768
768
  sn();
769
769
  return;
770
770
  }
771
- let C = he || y || U, ye = [], Se = [], Ce = [];
772
- if (fe) {
773
- let e = A.pivotTableSettings2?.headers || [], { headerColumns: t, nonHeaderColumns: n } = (o || G).reduce((t, n) => (e.some((e) => en(n, e)) ? t.headerColumns.push(n) : t.nonHeaderColumns.push(n), t), {
771
+ let x = he || y || U, be = [], Se = [], we = [];
772
+ if (de) {
773
+ let e = j.pivotTableSettings2?.headers || [], { headerColumns: t, nonHeaderColumns: n } = (o || G).reduce((t, n) => (e.some((e) => en(n, e)) ? t.headerColumns.push(n) : t.nonHeaderColumns.push(n), t), {
774
774
  headerColumns: [],
775
775
  nonHeaderColumns: []
776
776
  });
777
- ye = n.slice(0, 1), Se = u || q, Ce = t;
777
+ be = n.slice(0, 1), Se = u || q, we = t;
778
778
  let r = [
779
- ...ye,
779
+ ...be,
780
780
  ...u || q,
781
781
  ...t
782
782
  ], { aggregates: i, dimensions: a } = b(r);
783
- C = {
784
- ...C,
783
+ x = {
784
+ ...x,
785
785
  dimensions: a,
786
786
  aggregates: i,
787
- orders: P(C?.orders || [], r)
788
- }, W(C);
787
+ orders: P(x?.orders || [], r)
788
+ }, W(x);
789
789
  }
790
- let we = {
790
+ let Te = {
791
791
  chartDimensions: a?.chartDimensions,
792
792
  chartMetrics: Q(Se),
793
793
  chartAggregateColumns: Q(Se.filter((e) => e.configType === "AGGREGATE")),
794
- pivotHeaderColumns: Q(Ce)
795
- }, Te = [], De = [];
796
- if (pe) {
797
- let e = A?.seriesField || "", t = A?.timeSeriesSettings?.groupBySettings?.value || "montly", n = e && e !== "ungrouped", r = (o || G).find((e) => {
794
+ pivotHeaderColumns: Q(we)
795
+ }, Ee = [], T = [];
796
+ if (fe) {
797
+ let e = j?.seriesField || "", t = j?.timeSeriesSettings?.groupBySettings?.value || "montly", n = e && e !== "ungrouped", r = (o || G).find((e) => {
798
798
  let t = e.cast?.value && e?.cast?.value !== "NONE" ? e.cast.value : e.datatype || "";
799
799
  return S(t);
800
800
  });
801
801
  if (!r) {
802
- B("Date column is not found for Timeseries chart"), N(!1), j([]), M("");
802
+ B("Date column is not found for Timeseries chart"), N(!1), M([]), Ue("");
803
803
  return;
804
804
  }
805
805
  let i = {
806
806
  ...r,
807
807
  helperFunction: "date format",
808
- functionConfiguration: { dateFormat: Oe({
808
+ functionConfiguration: { dateFormat: De({
809
809
  label: t,
810
810
  value: t
811
- }, k) }
811
+ }, A) }
812
812
  };
813
813
  K((e) => e?.map((e) => e.alias === r.alias ? i : e));
814
814
  let a = n ? tn(o || G, e) : void 0, s = a ? [i, a] : [i];
815
- Te = s, De = u || q;
816
- let c = [...s, ...De], { aggregates: l, dimensions: d } = b(c), f = [{
815
+ Ee = s, T = u || q;
816
+ let c = [...s, ...T], { aggregates: l, dimensions: d } = b(c), f = [{
817
817
  method: "ASC",
818
818
  name: r.alias,
819
819
  type: "selected_column"
820
820
  }];
821
- C = {
822
- ...C,
821
+ x = {
822
+ ...x,
823
823
  dimensions: d,
824
824
  aggregates: l,
825
- orders: P([...f, ...Ke(C?.orders || [], c).filter((e) => e?.name !== r?.alias && !f.some((t) => t?.name === e?.name))], c)
826
- }, W(C);
825
+ orders: P([...f, ...Ke(x?.orders || [], c).filter((e) => e?.name !== r?.alias && !f.some((t) => t?.name === e?.name))], c)
826
+ }, W(x);
827
827
  }
828
- let ke = {
829
- chartDimensions: Q(Te),
830
- chartMetrics: Q(De),
831
- chartAggregateColumns: Q(De.filter((e) => e.configType === "AGGREGATE"))
832
- }, Ae = [], je = [];
828
+ let Oe = {
829
+ chartDimensions: Q(Ee),
830
+ chartMetrics: Q(T),
831
+ chartAggregateColumns: Q(T.filter((e) => e.configType === "AGGREGATE"))
832
+ }, ke = [], Ae = [];
833
833
  if (me) {
834
- let e = A?.seriesField || "", t = e && e !== "ungrouped" ? tn(o || G, e) : void 0, n = (o || G)?.[0], r = t ? [n, t] : [n];
835
- je = u || q, Ae = r;
836
- let i = [...r, ...je], { aggregates: a, dimensions: s } = b(i);
837
- C = {
838
- ...C,
834
+ let e = j?.seriesField || "", t = e && e !== "ungrouped" ? tn(o || G, e) : void 0, n = (o || G)?.[0], r = t ? [n, t] : [n];
835
+ Ae = u || q, ke = r;
836
+ let i = [...r, ...Ae], { aggregates: a, dimensions: s } = b(i);
837
+ x = {
838
+ ...x,
839
839
  dimensions: s,
840
840
  aggregates: a,
841
- orders: P(C?.orders || [], i),
841
+ orders: P(x?.orders || [], i),
842
842
  isApplyMetricFilter: !0,
843
843
  rlsConditions: (y || U)?.rlsConditions || []
844
- }, W(C);
844
+ }, W(x);
845
845
  }
846
- let Me = {
847
- chartDimensions: Q(Ae),
848
- chartMetrics: Q(je),
849
- chartAggregateColumns: Q(je.filter((e) => e.configType === "AGGREGATE"))
850
- }, Ne = H?.find((e) => e.tableName === C?.table?.name && e.schemaName === C?.table?.schema), Pe = C?.table?.joins?.map((e) => H?.find((t) => t?.schemaName === e?.schema && t?.tableName === e?.name))?.filter((e) => e) || [], Fe = (Ne ? [...Pe || [], Ne] : Pe)?.map((e) => ({
846
+ let je = {
847
+ chartDimensions: Q(ke),
848
+ chartMetrics: Q(Ae),
849
+ chartAggregateColumns: Q(Ae.filter((e) => e.configType === "AGGREGATE"))
850
+ }, Me = H?.find((e) => e.tableName === x?.table?.name && e.schemaName === x?.table?.schema), Ne = x?.table?.joins?.map((e) => H?.find((t) => t?.schemaName === e?.schema && t?.tableName === e?.name))?.filter((e) => e) || [], Pe = (Me ? [...Ne || [], Me] : Ne)?.map((e) => ({
851
851
  name: e?.clientColumn || "",
852
852
  datatype: e?.columnsWithDataType?.find((t) => t.name === e?.clientColumn)?.dataType || "",
853
853
  table: e
854
- }))?.filter((e) => e.name) || [], Ie = Ee && Fe?.map((e) => ({
854
+ }))?.filter((e) => e.name) || [], Fe = p && Pe?.map((e) => ({
855
855
  alias: e.name,
856
856
  columnName: e.name,
857
857
  dataType: e.datatype,
858
858
  method: "=",
859
- parentAlias: `${w(e?.table?.schemaName || "", k)}_${e?.table?.tableName}`,
859
+ parentAlias: `${w(e?.table?.schemaName || "", A)}_${e?.table?.tableName}`,
860
860
  type: "client",
861
861
  value: rt === "NUMBER" ? Number(r) : r,
862
862
  relationOperator: "AND",
863
863
  isApplyTimezone: !1
864
864
  })) || [];
865
- if (C?.dimensions?.some((e) => e?.helperFunction?.toLowerCase() === "distinct") && ["mssql", "microsoft fabric"].includes(k?.toLowerCase() || "") && C?.orders?.length && !C?.orders?.some((e) => C?.dimensions?.some((t) => t?.alias === e?.name))) {
865
+ if (x?.dimensions?.some((e) => e?.helperFunction?.toLowerCase() === "distinct") && ["mssql", "microsoft fabric"].includes(A?.toLowerCase() || "") && x?.orders?.length && !x?.orders?.some((e) => x?.dimensions?.some((t) => t?.alias === e?.name))) {
866
866
  c("generate-metric-blocked", {
867
867
  reason: "MSSQL_DISTINCT_ORDER_BY",
868
- dbName: k,
869
- orderCount: C?.orders?.length || 0,
870
- dimensionCount: C?.dimensions?.length || 0
871
- }), B("Error: Select list must be in order by clause if distinct is used"), j([]), N(!1);
868
+ dbName: A,
869
+ orderCount: x?.orders?.length || 0,
870
+ dimensionCount: x?.dimensions?.length || 0
871
+ }), B("Error: Select list must be in order by clause if distinct is used"), M([]), N(!1);
872
872
  return;
873
873
  }
874
- let T = on(C);
875
- if (!T.isValid) {
874
+ let E = on(x);
875
+ if (!E.isValid) {
876
876
  c("generate-metric-blocked", {
877
877
  reason: "INVALID_DATASET_CONFIG",
878
- tableExists: T.tableExists,
879
- joinsExist: T.joinsExist,
880
- relationshipPresent: T.relationshipPresent,
881
- columnPresent: T.columnPresent,
882
- tenancyType: T.tenancyType,
878
+ tableExists: E.tableExists,
879
+ joinsExist: E.joinsExist,
880
+ relationshipPresent: E.relationshipPresent,
881
+ columnPresent: E.columnPresent,
882
+ tenancyType: E.tenancyType,
883
883
  subsetTableCount: H?.length || 0,
884
- ...l(C)
884
+ ...l(x)
885
885
  });
886
- let e = t(Xe(T, C, D?.tableList || [], D?.relationships || []), { surface: "builder" });
887
- s("metric.builder_validation_failed", { error_code: e.code }), mt("builder", e, void 0, { metricId: R }), B(e), j([]), M(""), N(!1);
886
+ let e = t(Xe(E, x, O?.tableList || [], O?.relationships || []), { surface: "builder" });
887
+ s("metric.builder_validation_failed", { error_code: e.code }), mt("builder", e, void 0, { metricId: R }), B(e), M([]), Ue(""), N(!1);
888
888
  return;
889
889
  }
890
- let Le = Date.now();
890
+ let Ie = Date.now();
891
891
  c("generate-metric-start", {
892
892
  hasWorkspaceId: !!et,
893
893
  hasDatasourceId: !!at,
894
894
  hasToken: !!$e,
895
895
  chartType: v,
896
896
  limit: i || Ye,
897
- clientColumnFilterCount: Ie?.length || 0,
897
+ clientColumnFilterCount: Fe?.length || 0,
898
898
  isDatabaseTenancy: !!tt,
899
- ...l(C)
899
+ ...l(x)
900
900
  }), Rt({
901
901
  data: {
902
902
  cId: r,
903
903
  configuration: {
904
- ...C,
905
- filters: !Lt && Ie?.length ? [...C?.filters, ...Ie] : C?.filters,
904
+ ...x,
905
+ filters: !Lt && Fe?.length ? [...x?.filters, ...Fe] : x?.filters,
906
906
  limit: i || Ye
907
907
  },
908
908
  id: et,
@@ -914,37 +914,37 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
914
914
  }, {
915
915
  onSuccess(e) {
916
916
  let t = e?.error, r = e?.data, i = e?.query;
917
- i &&= ne(i, st || "");
917
+ i &&= se(i, st || "");
918
918
  let s = e?.metaData;
919
919
  if (t || zt) {
920
920
  c("generate-metric-failed", {
921
921
  source: "response-error",
922
- durationMs: Date.now() - Le,
922
+ durationMs: Date.now() - Ie,
923
923
  hasGenerateError: !!zt,
924
924
  ...d(t || zt)
925
- }), B(Je(t || zt, mt, R)), N(!1), j([]), M("");
925
+ }), B(Je(t || zt, mt, R)), N(!1), M([]), Ue("");
926
926
  return;
927
927
  }
928
928
  if ((!r || !i) && c("generate-metric-indeterminate", {
929
- durationMs: Date.now() - Le,
929
+ durationMs: Date.now() - Ie,
930
930
  hasResult: !!r,
931
931
  hasOutputQuery: !!i,
932
932
  hasMetaData: !!s
933
933
  }), r && i) {
934
934
  c("generate-metric-success", {
935
- durationMs: Date.now() - Le,
935
+ durationMs: Date.now() - Ie,
936
936
  rowCount: Array.isArray(r) ? r.length : 0,
937
937
  columnCount: Object.keys(r?.[0] || {}).length,
938
938
  queryLength: i?.length || 0,
939
939
  chartType: v
940
940
  }), B(""), N(!1);
941
- let e = [...C?.aggregates?.map((e) => e?.alias), ...C?.dimensions?.map((e) => e?.alias)], t = (t) => Array.isArray(t) ? k?.toLowerCase() === "redshift" ? ve(e, t) : t : [], n = oe(r, o || G, u || q);
942
- n = t(n), n = ze(n), j(() => n), cn(fe ? {
943
- ...we,
941
+ let e = [...x?.aggregates?.map((e) => e?.alias), ...x?.dimensions?.map((e) => e?.alias)], t = (t) => Array.isArray(t) ? A?.toLowerCase() === "redshift" ? xe(e, t) : t : [], n = le(r, o || G, u || q);
942
+ n = t(n), n = Re(n), M(() => n), cn(de ? {
943
+ ...Te,
944
944
  resultData: n,
945
945
  configAggregates: y?.aggregates,
946
946
  seriesName: a?.seriesName,
947
- isRemoveGroupBy: ae
947
+ isRemoveGroupBy: re
948
948
  } : {
949
949
  chartType: v,
950
950
  chartDimensions: a?.chartDimensions,
@@ -953,27 +953,27 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
953
953
  resultData: n,
954
954
  configAggregates: y?.aggregates,
955
955
  pivotHeaderColumns: a?.pivotHeaderColumns,
956
- ...pe ? ke : {},
957
- ...me ? Me : {},
956
+ ...fe ? Oe : {},
957
+ ...me ? je : {},
958
958
  chartTimeColumns: a?.chartTimeColumns,
959
959
  seriesName: a?.seriesName,
960
- isRemoveGroupBy: ae
961
- }), _ || M(i), qe?.(_e(s?.groupbyColumnList));
960
+ isRemoveGroupBy: re
961
+ }), ee || Ue(i), qe?.(ye(s?.groupbyColumnList));
962
962
  }
963
963
  n?.();
964
964
  },
965
965
  onError(e) {
966
966
  c("generate-metric-failed", {
967
967
  source: "network",
968
- durationMs: Date.now() - Le,
968
+ durationMs: Date.now() - Ie,
969
969
  ...d(e)
970
- }), B(Je(e, mt, R)), N(!1), j([]), M("");
970
+ }), B(Je(e, mt, R)), N(!1), M([]), Ue("");
971
971
  }
972
972
  });
973
973
  }, dn = (e, t) => {
974
974
  let n = (e) => H?.find((t) => t.tableName === e), r = (t) => {
975
975
  let r = n(t)?.schemaName || e.schemaName;
976
- return `${w(r, k)}_${t.replaceAll(" ", "_")?.replace("*", "_")}`;
976
+ return `${w(r, A)}_${t.replaceAll(" ", "_")?.replace("*", "_")}`;
977
977
  }, i = /* @__PURE__ */ new Map();
978
978
  t.forEach((e) => {
979
979
  i.has(e.parentTableName) || i.set(e.parentTableName, []), i.has(e.childTableName) || i.set(e.childTableName, []), i.get(e.parentTableName).push(e), i.get(e.childTableName).push(e);
@@ -1008,7 +1008,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1008
1008
  };
1009
1009
  return s(e.tableName), o;
1010
1010
  }, fn = (e, t, n) => {
1011
- let r = n.find((n) => n.parentTableName === e.tableName && n.childTableName === t.tableName || n.parentTableName === t.tableName && n.childTableName === e.tableName), i = e.type === "custom" ? e.alias || "dbn_sql_table" : `${w(e?.schemaName, k)}_${e.tableName.replaceAll(" ", "_")?.replace("*", "_")}`, a = t.type === "custom" ? t.alias || "dbn_sql_table" : `${w(t?.schemaName, k)}_${t.tableName.replaceAll(" ", "_")?.replace("*", "_")}`, o = r?.parentTableName === e.tableName, s = r ? [{
1011
+ let r = n.find((n) => n.parentTableName === e.tableName && n.childTableName === t.tableName || n.parentTableName === t.tableName && n.childTableName === e.tableName), i = e.type === "custom" ? e.alias || "dbn_sql_table" : `${w(e?.schemaName, A)}_${e.tableName.replaceAll(" ", "_")?.replace("*", "_")}`, a = t.type === "custom" ? t.alias || "dbn_sql_table" : `${w(t?.schemaName, A)}_${t.tableName.replaceAll(" ", "_")?.replace("*", "_")}`, o = r?.parentTableName === e.tableName, s = r ? [{
1012
1012
  alias: o ? a : i,
1013
1013
  name: o ? t.tableName : e.tableName,
1014
1014
  schema: o ? t.schemaName : e.schemaName,
@@ -1035,7 +1035,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1035
1035
  type: o ? e.type === "custom" ? "custom" : "default" : t.type === "custom" ? "custom" : "default"
1036
1036
  };
1037
1037
  }, pn = ({ column: e, table: t, sorting: n, type: r, identifier: a }) => {
1038
- let s = [...G], c = [...q], l = t.type === "custom" ? t.alias || "dbn_sql_table" : `${w(t?.schemaName, k)}_${t.tableName.replaceAll(" ", "_")?.replace("*", "_")}`;
1038
+ let s = [...G], c = [...q], l = t.type === "custom" ? t.alias || "dbn_sql_table" : `${w(t?.schemaName, A)}_${t.tableName.replaceAll(" ", "_")?.replace("*", "_")}`;
1039
1039
  if (Z) {
1040
1040
  let e = t.type === "custom" ? {
1041
1041
  value: `none^^^^^^${t.sql}^^^^^^${l}^^^^^^custom`,
@@ -1053,24 +1053,24 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1053
1053
  "metrics",
1054
1054
  "aggregate_dimensions",
1055
1055
  "aggregate_metrics"
1056
- ].includes(a?.type || ""), p = f ? [...G, ...q].find((e) => e?.alias === a?.id) : void 0, h = r === "METRIC" ? ae({
1056
+ ].includes(a?.type || ""), p = f ? [...G, ...q].find((e) => e?.alias === a?.id) : void 0, m = r === "METRIC" ? oe({
1057
1057
  allowAggregate: e?.allowAggregate,
1058
1058
  defaultAggregation: e?.defaultAggregation
1059
- }) : void 0, g = r === "METRIC" && h && !f ? `${le(`${h.toLowerCase()} of`, k || "")} ${e?.dataMartColumnAlias || e?.name}` : d;
1060
- a?.type === "column" && [...G, ...q].some((e) => g === e?.alias) && (g = `${g}_${y(4)?.toLowerCase()}`), g = k?.toLowerCase() === "opensearch" ? g.replaceAll(" ", "_")?.replace("*", "_") : g;
1061
- let _ = {
1062
- uniqueId: y(10),
1063
- alias: g,
1064
- configType: h || e.isAggregate ? "AGGREGATE" : "DIMENSION",
1059
+ }) : void 0, h = r === "METRIC" && m && !f ? `${v(`${m.toLowerCase()} of`, A || "")} ${e?.dataMartColumnAlias || e?.name}` : d;
1060
+ a?.type === "column" && [...G, ...q].some((e) => h === e?.alias) && (h = `${h}_${he(4)?.toLowerCase()}`), h = A?.toLowerCase() === "opensearch" ? h.replaceAll(" ", "_")?.replace("*", "_") : h;
1061
+ let g = {
1062
+ uniqueId: he(10),
1063
+ alias: h,
1064
+ configType: m || e.isAggregate ? "AGGREGATE" : "DIMENSION",
1065
1065
  isApplyTimezone: e.isApplyTimezone,
1066
1066
  datatype: e.dataType,
1067
1067
  dropType: r,
1068
1068
  index: r === "DIMENSION" ? G.length : q.length,
1069
- name: e?.type === "custom" && k?.toLowerCase() === "opensearch" ? e?.name?.replaceAll(" ", "_")?.replace("*", "_") : e?.name,
1069
+ name: e?.type === "custom" && A?.toLowerCase() === "opensearch" ? e?.name?.replaceAll(" ", "_")?.replace("*", "_") : e?.name,
1070
1070
  parentAlias: l,
1071
1071
  table: t,
1072
1072
  type: e.type === "custom" ? "CUSTOM" : e.type === "python" ? "PYTHON" : "DEFAULT",
1073
- helperFunction: h,
1073
+ helperFunction: m,
1074
1074
  sql: e.sql || "",
1075
1075
  draggableItemData: {
1076
1076
  column: e,
@@ -1089,43 +1089,43 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1089
1089
  switch (r) {
1090
1090
  case "DIMENSION":
1091
1091
  K((t) => {
1092
- let r = t.findIndex((e) => e.alias === g);
1093
- a?.type === "metrics" && J((t) => (c = [...t.filter((t) => t.alias !== g && t.alias !== e.dataMartColumnAlias)], c));
1094
- let i = Z ? [_] : r === -1 ? [...t, _] : t;
1092
+ let r = t.findIndex((e) => e.alias === h);
1093
+ a?.type === "metrics" && J((t) => (c = [...t.filter((t) => t.alias !== h && t.alias !== e.dataMartColumnAlias)], c));
1094
+ let i = Z ? [g] : r === -1 ? [...t, g] : t;
1095
1095
  if (n) {
1096
1096
  let { before: e, after: t } = n.sortingIndexes;
1097
1097
  return s = [...n.ArrayElementSwap(e, t, i)], s;
1098
1098
  }
1099
1099
  return s = [...i], i;
1100
- }), ct?.(i, g);
1100
+ }), ct?.(i, h);
1101
1101
  break;
1102
1102
  case "METRIC":
1103
1103
  J((t) => {
1104
- let r = t.findIndex((e) => e.alias === g);
1105
- a?.type === "dimensions" && K((t) => (s = [...t.filter((t) => t.alias !== g && t.alias !== e.dataMartColumnAlias)], s));
1106
- let i = Z ? [_] : r === -1 ? [...t, _] : t;
1104
+ let r = t.findIndex((e) => e.alias === h);
1105
+ a?.type === "dimensions" && K((t) => (s = [...t.filter((t) => t.alias !== h && t.alias !== e.dataMartColumnAlias)], s));
1106
+ let i = Z ? [g] : r === -1 ? [...t, g] : t;
1107
1107
  if (n) {
1108
1108
  let { before: e, after: t } = n.sortingIndexes;
1109
1109
  return c = [...n.ArrayElementSwap(e, t, i)], c;
1110
1110
  }
1111
1111
  return c = [...i], i;
1112
- }), ct?.(o, g);
1112
+ }), ct?.(o, h);
1113
1113
  break;
1114
1114
  default: console.warn("Invalid Drop");
1115
1115
  }
1116
1116
  let ee = [
1117
- m.line,
1118
- m.bar,
1119
- m.stack,
1120
- m.row,
1121
- m.horizontalStack
1122
- ].includes(A?.chartType), te = Z ? r === "DIMENSION" ? [_] : [] : s, ne = Z ? r === "METRIC" ? [_] : [] : c, re, ie = !1;
1123
- ee && (te.length === 2 && ne.length === 1 ? re = Q([te[1]])?.[0] : ie = !0);
1124
- let oe = Z ? [_] : [...s, ...c], { aggregates: se, dimensions: ce } = b(oe), ue = !Z && z && U?.table?.name !== t.tableName, de = {
1117
+ C.line,
1118
+ C.bar,
1119
+ C.stack,
1120
+ C.row,
1121
+ C.horizontalStack
1122
+ ].includes(j?.chartType), _ = Z ? r === "DIMENSION" ? [g] : [] : s, te = Z ? r === "METRIC" ? [g] : [] : c, ne, re = !1;
1123
+ ee && (_.length === 2 && te.length === 1 ? ne = Q([_[1]])?.[0] : re = !0);
1124
+ let ie = Z ? [g] : [...s, ...c], { aggregates: ae, dimensions: se } = b(ie), ce = !Z && z && U?.table?.name !== t.tableName, le = {
1125
1125
  ...U,
1126
- dimensions: ce,
1127
- aggregates: se,
1128
- orders: P(U?.orders || [], oe),
1126
+ dimensions: se,
1127
+ aggregates: ae,
1128
+ orders: P(U?.orders || [], ie),
1129
1129
  table: Z ? {
1130
1130
  alias: l,
1131
1131
  id: t.id,
@@ -1134,23 +1134,23 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1134
1134
  schema: t.schemaName,
1135
1135
  type: t.type === "custom" ? "custom" : "default"
1136
1136
  } : U.table
1137
- }, v = H?.find((e) => e.tableName === U?.table?.name);
1138
- ue && v && !U?.table?.joins?.length && (de = {
1139
- ...de,
1140
- table: fn(v, t, Ct || [])
1141
- }), W(de), $({
1142
- prevConfiguration: de,
1137
+ }, ue = H?.find((e) => e.tableName === U?.table?.name);
1138
+ ce && ue && !U?.table?.joins?.length && (le = {
1139
+ ...le,
1140
+ table: fn(ue, t, Ct || [])
1141
+ }), W(le), $({
1142
+ prevConfiguration: le,
1143
1143
  chartFieldParams: {
1144
- chartDimensions: Q(oe.filter((e) => e.dropType === "DIMENSION")),
1145
- chartMetrics: Q(oe.filter((e) => e.dropType === "METRIC")),
1146
- chartAggregateColumns: Q(oe.filter((e) => e.configType === "AGGREGATE")),
1147
- chartTimeColumns: Q(oe?.filter((e) => S(e?.datatype))),
1148
- seriesName: re
1144
+ chartDimensions: Q(ie.filter((e) => e.dropType === "DIMENSION")),
1145
+ chartMetrics: Q(ie.filter((e) => e.dropType === "METRIC")),
1146
+ chartAggregateColumns: Q(ie.filter((e) => e.configType === "AGGREGATE")),
1147
+ chartTimeColumns: Q(ie?.filter((e) => S(e?.datatype))),
1148
+ seriesName: ne
1149
1149
  },
1150
- isRemoveGroupBy: ie,
1151
- isGroupByAction: !!re,
1152
- updatedDims: r === "DIMENSION" ? Z ? [_] : [...s] : void 0,
1153
- updatedMetrics: r === "METRIC" ? Z ? [_] : [...c] : void 0,
1150
+ isRemoveGroupBy: re,
1151
+ isGroupByAction: !!ne,
1152
+ updatedDims: r === "DIMENSION" ? Z ? [g] : [...s] : void 0,
1153
+ updatedMetrics: r === "METRIC" ? Z ? [g] : [...c] : void 0,
1154
1154
  selectedMainTable: Z ? t : void 0
1155
1155
  });
1156
1156
  }, mn = (e, t) => {
@@ -1160,7 +1160,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1160
1160
  generatedAlias: r ? n : void 0
1161
1161
  };
1162
1162
  }, hn = ({ alias: e, column: t, type: n, cast: r, isColumnCasted: i }) => {
1163
- let a = k?.toLowerCase() === "opensearch" ? e.replaceAll(" ", "_")?.replace("*", "_") : e, o = [...G, ...q].filter((e) => e?.alias !== t?.alias).map((e) => e?.alias).filter((e) => !!e), s = Ce(a, o, () => y(4)?.toLowerCase(), { caseInsensitive: k?.toLowerCase() === Te }), c = n === "DIMENSION" ? G?.map((e) => e.alias === t.alias ? {
1163
+ let a = A?.toLowerCase() === "opensearch" ? e.replaceAll(" ", "_")?.replace("*", "_") : e, o = [...G, ...q].filter((e) => e?.alias !== t?.alias).map((e) => e?.alias).filter((e) => !!e), s = Te(a, o, () => he(4)?.toLowerCase(), { caseInsensitive: A?.toLowerCase() === x }), c = n === "DIMENSION" ? G?.map((e) => e.alias === t.alias ? {
1164
1164
  ...e,
1165
1165
  alias: s,
1166
1166
  ...mn(e, s),
@@ -1184,12 +1184,12 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1184
1184
  break;
1185
1185
  default: console.warn("Invalid Drop");
1186
1186
  }
1187
- let u = [...c, ...l], d = ye({
1187
+ let u = [...c, ...l], d = Se({
1188
1188
  drillFilters: U.drillFilters || Y,
1189
1189
  drilldownChartSettings: I?.drilldownChartSettings,
1190
1190
  previousDims: G,
1191
1191
  selectedDims: c
1192
- }), f = I?.configV2?.levels?.length ? be({
1192
+ }), f = I?.configV2?.levels?.length ? Ce({
1193
1193
  config: I.configV2,
1194
1194
  selectedDims: c,
1195
1195
  selectedMetrics: l,
@@ -1220,8 +1220,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1220
1220
  updatedMetrics: n === "METRIC" ? l : void 0
1221
1221
  });
1222
1222
  }, gn = ({ column: e, helperFunction: t, type: n, functionConfiguration: r, percentileValue: i, partitionBy: o, partitionByColumns: s }) => {
1223
- let c = t.value === "NONE", l = me?.includes(t?.value || "") && G?.length && G?.[0]?.helperFunction !== "distinct", u = l ? `${le("distinct of", k || "")} ${G?.[0]?.dataMartColumnAlias || G?.[0]?.name}` : "", d = `${c ? e.dataMartColumnAlias || e.name : `${le(`${t.label?.toLowerCase()} of`, k || "")} ${e.dataMartColumnAlias || e.name}`}`;
1224
- [...G, ...q].some((e) => d === e?.alias) && (d = `${d}_${y(4)?.toLowerCase()}`), d = k?.toLowerCase() === "opensearch" ? d.replaceAll(" ", "_")?.replace("*", "_") : d, ct?.(a, e.dataMartColumnAlias || e.name);
1223
+ let c = t.value === "NONE", l = ee?.includes(t?.value || "") && G?.length && G?.[0]?.helperFunction !== "distinct", u = l ? `${v("distinct of", A || "")} ${G?.[0]?.dataMartColumnAlias || G?.[0]?.name}` : "", d = `${c ? e.dataMartColumnAlias || e.name : `${v(`${t.label?.toLowerCase()} of`, A || "")} ${e.dataMartColumnAlias || e.name}`}`;
1224
+ [...G, ...q].some((e) => d === e?.alias) && (d = `${d}_${he(4)?.toLowerCase()}`), d = A?.toLowerCase() === "opensearch" ? d.replaceAll(" ", "_")?.replace("*", "_") : d, ct?.(a, e.dataMartColumnAlias || e.name);
1225
1225
  let f = n === "DIMENSION" ? G?.map((n) => n.alias === e.alias ? {
1226
1226
  ...n,
1227
1227
  helperFunction: t.value,
@@ -1257,12 +1257,12 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1257
1257
  break;
1258
1258
  default: console.warn("Invalid Drop");
1259
1259
  }
1260
- let m = [...f, ...p], h = ye({
1260
+ let m = [...f, ...p], h = Se({
1261
1261
  drillFilters: U.drillFilters || Y,
1262
1262
  drilldownChartSettings: I?.drilldownChartSettings,
1263
1263
  previousDims: G,
1264
1264
  selectedDims: f
1265
- }), g = I?.configV2?.levels?.length ? be({
1265
+ }), g = I?.configV2?.levels?.length ? Ce({
1266
1266
  config: I.configV2,
1267
1267
  selectedDims: f,
1268
1268
  selectedMetrics: p,
@@ -1274,15 +1274,15 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1274
1274
  drilldownChartSettings: n === "DIMENSION" ? h.drilldownChartSettings : e.drilldownChartSettings,
1275
1275
  configV2: g
1276
1276
  }))), Mt((e) => e.filter((e) => m?.some((t) => t.alias === (e.columnName?.column?.alias || e.columnName?.label))));
1277
- let { aggregates: _, dimensions: ee } = b(m), te = {
1277
+ let { aggregates: _, dimensions: te } = b(m), ne = {
1278
1278
  ...U,
1279
- dimensions: ee,
1279
+ dimensions: te,
1280
1280
  aggregates: _,
1281
1281
  drillFilters: h.drillFilters,
1282
1282
  orders: P(U?.orders || [], m)
1283
1283
  };
1284
- W(te), $({
1285
- prevConfiguration: te,
1284
+ W(ne), $({
1285
+ prevConfiguration: ne,
1286
1286
  chartFieldParams: {
1287
1287
  chartDimensions: Q(f),
1288
1288
  chartMetrics: Q(p),
@@ -1298,10 +1298,10 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1298
1298
  return i ? [...n?.filter((e) => !a(e)), r] : [...n, r];
1299
1299
  }, vn = ({ alias: e, column: t, type: n, editCol: r, editColumn: i }) => {
1300
1300
  if (!t) return;
1301
- let a = k?.toLowerCase() === "opensearch" ? e.replaceAll(" ", "_")?.replace("*", "_") : e, o = i || (r ? (n === "DIMENSION" ? G : q).find((e) => e?.alias === r) : void 0), s = [...G, ...q].filter((e) => o?.uniqueId ? e?.uniqueId !== o.uniqueId : !o || !(e === o || o.arithmeticConfig && e?.arithmeticConfig === o.arithmeticConfig)).map((e) => e?.alias).filter((e) => !!e), c = Ce(a, s, () => y(4)?.toLowerCase(), { caseInsensitive: k?.toLowerCase() === Te }), l = We(t.firstOperand) ? void 0 : t.firstOperand, u = We(t.secondOperand) ? void 0 : t.secondOperand, d = l || u;
1301
+ let a = A?.toLowerCase() === "opensearch" ? e.replaceAll(" ", "_")?.replace("*", "_") : e, o = i || (r ? (n === "DIMENSION" ? G : q).find((e) => e?.alias === r) : void 0), s = [...G, ...q].filter((e) => o?.uniqueId ? e?.uniqueId !== o.uniqueId : !o || !(e === o || o.arithmeticConfig && e?.arithmeticConfig === o.arithmeticConfig)).map((e) => e?.alias).filter((e) => !!e), c = Te(a, s, () => he(4)?.toLowerCase(), { caseInsensitive: A?.toLowerCase() === x }), l = We(t.firstOperand) ? void 0 : t.firstOperand, u = We(t.secondOperand) ? void 0 : t.secondOperand, d = l || u;
1302
1302
  if (!d) return;
1303
1303
  let f = {
1304
- uniqueId: o?.uniqueId || y(10),
1304
+ uniqueId: o?.uniqueId || he(10),
1305
1305
  alias: c,
1306
1306
  configType: Ze({
1307
1307
  type: n,
@@ -1348,7 +1348,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1348
1348
  break;
1349
1349
  default: console.warn("Invalid Drop");
1350
1350
  }
1351
- O((e) => ({
1351
+ k((e) => ({
1352
1352
  ...e,
1353
1353
  dynamicXAxis: {
1354
1354
  ...e.dynamicXAxis,
@@ -1373,13 +1373,13 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1373
1373
  }]
1374
1374
  }
1375
1375
  }));
1376
- let h = [...p, ...m], { aggregates: g, dimensions: _ } = b(h), ee = {
1376
+ let h = [...p, ...m], { aggregates: g, dimensions: ee } = b(h), _ = {
1377
1377
  ...U,
1378
- dimensions: _,
1378
+ dimensions: ee,
1379
1379
  aggregates: g
1380
1380
  };
1381
- W(ee), $({
1382
- prevConfiguration: ee,
1381
+ W(_), $({
1382
+ prevConfiguration: _,
1383
1383
  chartFieldParams: {
1384
1384
  chartDimensions: Q(p),
1385
1385
  chartMetrics: Q(m),
@@ -1419,9 +1419,9 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1419
1419
  joins: []
1420
1420
  } : e;
1421
1421
  };
1422
- return Ie(() => {
1423
- let e = D?.error, t = D;
1424
- if (e || !D) B(e ? Je(e, mt, R) : void 0);
1422
+ return Fe(() => {
1423
+ let e = O?.error, t = O;
1424
+ if (e || !O) B(e ? Je(e, mt, R) : void 0);
1425
1425
  else if (t?.tableList?.length) {
1426
1426
  let e = t?.tableList || [], n = t?.relationships || [];
1427
1427
  wt(n);
@@ -1431,7 +1431,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1431
1431
  let n = [], r = /* @__PURE__ */ new Set();
1432
1432
  return t.forEach((t) => {
1433
1433
  let i = e.filter((e) => {
1434
- let n = Pe(t, e.tableName, { caseInsensitive: !0 }), r = e.wildcard === t;
1434
+ let n = Ne(t, e.tableName, { caseInsensitive: !0 }), r = e.wildcard === t;
1435
1435
  return n || r;
1436
1436
  });
1437
1437
  if (i.length > 0) {
@@ -1477,7 +1477,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1477
1477
  defaultSort: t?.defaultSort || null,
1478
1478
  transform: n
1479
1479
  };
1480
- }) || [], { prefix: n, name: r } = v(e.tableName);
1480
+ }) || [], { prefix: n, name: r } = me(e.tableName);
1481
1481
  return {
1482
1482
  id: "",
1483
1483
  tableName: e.wildcard ? e.wildcard : r,
@@ -1495,17 +1495,17 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1495
1495
  bt(r), r?.length && !R && yt(r?.[0]);
1496
1496
  }
1497
1497
  }, [
1498
- D,
1498
+ O,
1499
1499
  Pt?.dataMartTables,
1500
1500
  R
1501
- ]), Ie(() => {
1501
+ ]), Fe(() => {
1502
1502
  let e = [...G || [], ...q || []].filter((e) => e.transform && e.transform !== "original").map((e) => ({
1503
1503
  columns: [e.alias || e.name],
1504
1504
  formatter: e.transform,
1505
1505
  prefix: "",
1506
1506
  suffix: ""
1507
1507
  }));
1508
- e.length > 0 && O((t) => ({
1508
+ e.length > 0 && k((t) => ({
1509
1509
  ...t,
1510
1510
  tableSettings: (() => {
1511
1511
  let n = [...t.tableSettings?.tableNumberFormatter || [], ...e.filter((e) => !t.tableSettings?.tableNumberFormatter?.some((t) => t.columns?.[0] === e.columns?.[0]))];
@@ -1519,8 +1519,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1519
1519
  }, [
1520
1520
  G,
1521
1521
  q,
1522
- O
1523
- ]), Ie(() => {
1522
+ k
1523
+ ]), Fe(() => {
1524
1524
  if (!L && R && _t && H?.length) {
1525
1525
  let e = H[0];
1526
1526
  yt(e), lt && (N(!0), pt({
@@ -1530,7 +1530,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1530
1530
  workspaceId: et,
1531
1531
  metricId: R,
1532
1532
  isCustomSql: !0,
1533
- databaseName: k || "",
1533
+ databaseName: A || "",
1534
1534
  datasourceId: at
1535
1535
  },
1536
1536
  token: $e || "",
@@ -1540,8 +1540,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1540
1540
  onSuccess(t) {
1541
1541
  let n = t?.data;
1542
1542
  if (Array.isArray(n) && n.length) {
1543
- j(ze(n));
1544
- let t = A?.xAxis, r = A?.yAxisList || [], i = e || {}, a = `${w(i?.schemaName || "", k)}_${(i?.tableName || "").replaceAll(" ", "_")?.replace("*", "_")}`, o = (e) => {
1543
+ M(Re(n));
1544
+ let t = j?.xAxis, r = j?.yAxisList || [], i = e || {}, a = `${w(i?.schemaName || "", A)}_${(i?.tableName || "").replaceAll(" ", "_")?.replace("*", "_")}`, o = (e) => {
1545
1545
  let t = {
1546
1546
  percentile_cont_: "PERCENTILE_CONT",
1547
1547
  percentile_disc_: "PERCENTILE_DISC",
@@ -1559,7 +1559,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1559
1559
  }, s = (e, t, n) => {
1560
1560
  let r = t === "METRIC" ? o(e) : void 0;
1561
1561
  return {
1562
- uniqueId: y(10),
1562
+ uniqueId: he(10),
1563
1563
  alias: e,
1564
1564
  configType: t === "METRIC" ? "AGGREGATE" : "DIMENSION",
1565
1565
  datatype: t === "METRIC" ? "number" : "string",
@@ -1593,23 +1593,23 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1593
1593
  return;
1594
1594
  }
1595
1595
  if (L && R && _t && H?.length) {
1596
- let e = L?.configuration || _, t = D?.relationships || [], n = !Ae(e?.table?.joins || [], t, !0, Ft, k, e?.table) || !ke(Ue(e, t), D?.tableList || [], !0, Ft, k), r = L?.newDatasetSettings?.isChatMode || !1, i = je(L, an), a = i?.newDatasetSettings?.selectedMainTable || (r ? H?.[0] : void 0), o = i?.newDatasetSettings?.selectedDims || [], s = i?.newDatasetSettings?.selectedMetrics || [], c = {
1597
- ...L?.configuration || _,
1596
+ let e = L?.configuration || ae, t = O?.relationships || [], n = !ke(e?.table?.joins || [], t, !0, Ft, A, e?.table) || !Oe(He(e, t), O?.tableList || [], !0, Ft, A), r = L?.newDatasetSettings?.isChatMode || !1, i = Ae(L, an), a = i?.newDatasetSettings?.selectedMainTable || (r ? H?.[0] : void 0), o = i?.newDatasetSettings?.selectedDims || [], s = i?.newDatasetSettings?.selectedMetrics || [], c = {
1597
+ ...L?.configuration || ae,
1598
1598
  rlsConditions: ut
1599
1599
  };
1600
1600
  if (W(c), At(L?.createdFilters?.map((e) => ({
1601
1601
  ...e,
1602
- tableName: we(e.tableName),
1603
- columnName: we(e.columnName)
1602
+ tableName: T(e.tableName),
1603
+ columnName: T(e.columnName)
1604
1604
  }))?.filter((e) => e.type !== "client") || []), Mt(L?.createdSorts?.map((e) => ({
1605
1605
  ...e,
1606
- columnName: we(e.columnName),
1607
- tableName: we(e.tableName)
1608
- })) || []), Ot(L?.selectedTable?.value ? we(L.selectedTable) : {
1606
+ columnName: T(e.columnName),
1607
+ tableName: T(e.tableName)
1608
+ })) || []), Ot(L?.selectedTable?.value ? T(L.selectedTable) : {
1609
1609
  label: "",
1610
1610
  value: ""
1611
1611
  }), K(o), J(s), yt(a), n && !r) {
1612
- B("Something went wrong! Please try again later."), j([]), M(""), N(!1), vt(!1);
1612
+ B("Something went wrong! Please try again later."), M([]), Ue(""), N(!1), vt(!1);
1613
1613
  return;
1614
1614
  }
1615
1615
  if (r) {
@@ -1637,7 +1637,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1637
1637
  dt,
1638
1638
  ft,
1639
1639
  Ft,
1640
- k
1640
+ A
1641
1641
  ]), {
1642
1642
  selectedMainTable: V,
1643
1643
  companySubsetTableList: X,
@@ -1673,14 +1673,14 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1673
1673
  default: console.warn("Invalid Drop");
1674
1674
  }
1675
1675
  let r = t === "DIMENSION" ? G.filter((t) => t.uniqueId ? t.uniqueId !== e?.uniqueId : t.alias !== e.alias) : G, i = t === "METRIC" ? q.filter((t) => t.uniqueId ? t.uniqueId !== e?.uniqueId : t.alias !== e.alias) : q, a = [
1676
- m.line,
1677
- m.bar,
1678
- m.stack,
1679
- m.row,
1680
- m.horizontalStack
1681
- ].includes(A?.chartType), o, s = !1;
1676
+ C.line,
1677
+ C.bar,
1678
+ C.stack,
1679
+ C.row,
1680
+ C.horizontalStack
1681
+ ].includes(j?.chartType), o, s = !1;
1682
1682
  a && (r.length === 2 && i.length === 1 ? o = Q([r[1]])?.[0] : s = !0);
1683
- let c = [...r, ...i], l = [...G, ...q], u = P(te(n).filter((e) => e.name), c), d = U.table;
1683
+ let c = [...r, ...i], l = [...G, ...q], u = P(ne(n).filter((e) => e.name), c), d = U.table;
1684
1684
  z && (d = yn(d, G.filter((t) => t.uniqueId ? t.uniqueId !== e?.uniqueId : t.alias !== e.alias), q.filter((t) => t.uniqueId ? t.uniqueId !== e?.uniqueId : t.alias !== e.alias), kt, n));
1685
1685
  let f = {
1686
1686
  ...U,
@@ -1789,7 +1789,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1789
1789
  method: "",
1790
1790
  name: ""
1791
1791
  };
1792
- let i = De.includes(r?.helperFunction || "");
1792
+ let i = m.includes(r?.helperFunction || "");
1793
1793
  if (r?.helperFunction && r.helperFunction === "date format" && r?.functionConfiguration) return {
1794
1794
  method: n,
1795
1795
  name: r?.alias || e.columnName.label,
@@ -1829,7 +1829,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1829
1829
  setCreatedFilters: At,
1830
1830
  getFilterDropDownType: rn,
1831
1831
  onSelectTimeSeries: (e) => {
1832
- if (e !== m.timeSeries) return;
1832
+ if (e !== C.timeSeries) return;
1833
1833
  let t = G.find((e) => {
1834
1834
  let t = e.cast?.value && e?.cast?.value !== "NONE" ? e.cast.value : e.datatype || "";
1835
1835
  return S(t);
@@ -1838,10 +1838,10 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1838
1838
  let n = `monthly of ${t.name}`, r = {
1839
1839
  ...t,
1840
1840
  helperFunction: "date format",
1841
- functionConfiguration: { dateFormat: Oe({
1841
+ functionConfiguration: { dateFormat: De({
1842
1842
  value: "monthly",
1843
1843
  label: "monthly"
1844
- }, k) },
1844
+ }, A) },
1845
1845
  alias: n
1846
1846
  };
1847
1847
  K((e) => e?.map((e) => e.alias === t.alias ? r : e));
@@ -1893,7 +1893,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1893
1893
  });
1894
1894
  },
1895
1895
  onDrillPivotTable: ({ filters: e, nextLevel: t, currentValue: n }) => {
1896
- let { headerColumns: i, nonHeaderColumns: a } = G.reduce((e, t) => (A.pivotTableSettings2?.headers?.includes(t.alias) ? e.headerColumns.push(t) : e.nonHeaderColumns.push(t), e), {
1896
+ let { headerColumns: i, nonHeaderColumns: a } = G.reduce((e, t) => (j.pivotTableSettings2?.headers?.includes(t.alias) ? e.headerColumns.push(t) : e.nonHeaderColumns.push(t), e), {
1897
1897
  headerColumns: [],
1898
1898
  nonHeaderColumns: []
1899
1899
  }), o = e?.map((e) => `${e.columnName};;${e.value}`).join(";;");
@@ -1905,7 +1905,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1905
1905
  currentValue: n
1906
1906
  }));
1907
1907
  let s = a.slice(0, t), c = e?.map((e) => {
1908
- let t = G.find((t) => t.alias === e.columnName || x(t) === e.columnName);
1908
+ let t = G.find((t) => t.alias === e.columnName || _e(t) === e.columnName);
1909
1909
  if (t) return {
1910
1910
  alias: t.alias || "",
1911
1911
  columnName: t.name,
@@ -1921,14 +1921,14 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1921
1921
  ...s,
1922
1922
  ...q,
1923
1923
  ...i
1924
- ], { aggregates: u, dimensions: d } = b(l), f = P(te(jt), l), p = {
1924
+ ], { aggregates: u, dimensions: d } = b(l), f = P(ne(jt), l), m = {
1925
1925
  ...U,
1926
1926
  dimensions: d,
1927
1927
  aggregates: u,
1928
1928
  filters: [...U.filters, ...c],
1929
1929
  isApplyMetricFilter: !0,
1930
1930
  orders: f
1931
- }, m = H?.find((e) => e.tableName === p?.table?.name && e.schemaName === p?.table?.schema), h = p?.table?.joins?.map((e) => H?.find((t) => t?.schemaName === e?.schema && t?.tableName === e?.name))?.filter(Boolean) || [], g = m ? [...h, m] : h, _ = Ee && g?.map((e) => ({
1931
+ }, h = H?.find((e) => e.tableName === m?.table?.name && e.schemaName === m?.table?.schema), g = m?.table?.joins?.map((e) => H?.find((t) => t?.schemaName === e?.schema && t?.tableName === e?.name))?.filter(Boolean) || [], ee = h ? [...g, h] : g, _ = p && ee?.map((e) => ({
1932
1932
  name: e?.clientColumn || "",
1933
1933
  datatype: e?.columnsWithDataType?.find((t) => t.name === e?.clientColumn)?.dataType || "",
1934
1934
  table: e
@@ -1937,7 +1937,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1937
1937
  columnName: e.name,
1938
1938
  dataType: e.datatype,
1939
1939
  method: "=",
1940
- parentAlias: `${w(e.table?.schemaName || "", k)}_${e.table?.tableName}`,
1940
+ parentAlias: `${w(e.table?.schemaName || "", A)}_${e.table?.tableName}`,
1941
1941
  type: "client",
1942
1942
  value: rt === "NUMBER" ? Number(r) : r,
1943
1943
  relationOperator: "AND",
@@ -1947,8 +1947,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1947
1947
  data: {
1948
1948
  cId: r,
1949
1949
  configuration: {
1950
- ...p,
1951
- filters: !Lt && _?.length ? [...p?.filters, ..._] : p?.filters
1950
+ ...m,
1951
+ filters: !Lt && _?.length ? [...m?.filters, ..._] : m?.filters
1952
1952
  },
1953
1953
  id: et,
1954
1954
  datasourceId: at,
@@ -1965,7 +1965,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1965
1965
  currentValue: ""
1966
1966
  }));
1967
1967
  else {
1968
- let e = ze(oe(Array.isArray(n) ? n : [], G, q));
1968
+ let e = Re(le(Array.isArray(n) ? n : [], G, q));
1969
1969
  Et((t) => ({
1970
1970
  data: [...t.data, {
1971
1971
  key: o,
@@ -1974,10 +1974,10 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1974
1974
  error: "",
1975
1975
  isLoading: !1,
1976
1976
  currentValue: ""
1977
- })), O((e) => ({
1977
+ })), k((e) => ({
1978
1978
  ...e,
1979
1979
  pivotTableSettings2: {
1980
- ...A.pivotTableSettings2,
1980
+ ...j.pivotTableSettings2,
1981
1981
  dimensions: Q(a),
1982
1982
  headers: Q(i)
1983
1983
  }
@@ -1995,11 +1995,11 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
1995
1995
  let { headerColumns: n, nonHeaderColumns: r } = G.reduce((e, n) => (t.includes(n.alias) ? e.headerColumns.push(n) : e.nonHeaderColumns.push(n), e), {
1996
1996
  headerColumns: [],
1997
1997
  nonHeaderColumns: []
1998
- }), i = r.slice(0, 1), a = e === m.pivotV3 ? [...G, ...q] : [
1998
+ }), i = r.slice(0, 1), a = e === C.pivotV3 ? [...G, ...q] : [
1999
1999
  ...i,
2000
2000
  ...q,
2001
2001
  ...n
2002
- ], { aggregates: o, dimensions: s } = b(a), c = He({
2002
+ ], { aggregates: o, dimensions: s } = b(a), c = Ve({
2003
2003
  configuration: U,
2004
2004
  savedConfiguration: L?.configuration
2005
2005
  }), l = {
@@ -2025,7 +2025,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
2025
2025
  });
2026
2026
  },
2027
2027
  onChangeChartGroupByValue: (e) => {
2028
- let t = e || A?.seriesField || "", n = t && t !== "ungrouped" ? tn(G, t) : void 0, r = G?.[0], i = n ? [r, n] : [r], a = [...i, ...q], { aggregates: o, dimensions: s } = b(a), c = {
2028
+ let t = e || j?.seriesField || "", n = t && t !== "ungrouped" ? tn(G, t) : void 0, r = G?.[0], i = n ? [r, n] : [r], a = [...i, ...q], { aggregates: o, dimensions: s } = b(a), c = {
2029
2029
  ...U,
2030
2030
  dimensions: s,
2031
2031
  aggregates: o,
@@ -2046,8 +2046,8 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
2046
2046
  });
2047
2047
  },
2048
2048
  onChangeTimeseriesFormat: (e, t) => {
2049
- if (A.chartType !== m.timeSeries) return;
2050
- let n = t || A?.seriesField || "", r = n && n !== "ungrouped", i = G.find((e) => {
2049
+ if (j.chartType !== C.timeSeries) return;
2050
+ let n = t || j?.seriesField || "", r = n && n !== "ungrouped", i = G.find((e) => {
2051
2051
  let t = e.cast?.value && e?.cast?.value !== "NONE" ? e.cast.value : e.datatype || "";
2052
2052
  return S(t);
2053
2053
  });
@@ -2055,7 +2055,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
2055
2055
  let a = `${e.value} of ${i.name}`, o = {
2056
2056
  ...i,
2057
2057
  helperFunction: "date format",
2058
- functionConfiguration: { dateFormat: Oe(e, k) },
2058
+ functionConfiguration: { dateFormat: De(e, A) },
2059
2059
  alias: `${e.value} of ${i.name}`
2060
2060
  };
2061
2061
  K((e) => e?.map((e) => e.alias === i.alias ? o : e));
@@ -2113,7 +2113,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
2113
2113
  ...e,
2114
2114
  drilldownChartSettings: [...e.drilldownChartSettings?.filter((e) => e.name !== s) || [], {
2115
2115
  name: s,
2116
- chartSettings: A
2116
+ chartSettings: j
2117
2117
  }]
2118
2118
  }));
2119
2119
  }
@@ -2127,29 +2127,29 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
2127
2127
  onChangeChartType: (e) => {
2128
2128
  let t = q, n = G;
2129
2129
  ([
2130
- m.singleValue,
2131
- m.gaugeV2,
2132
- m.progressBarV2,
2133
- m.funnelV2,
2134
- m.waterfall,
2135
- m.treeMap
2130
+ C.singleValue,
2131
+ C.gaugeV2,
2132
+ C.progressBarV2,
2133
+ C.funnelV2,
2134
+ C.waterfall,
2135
+ C.treeMap
2136
2136
  ].includes(e) && q?.length > 1 || [
2137
- m.rose,
2138
- m.pie,
2139
- m.doughnut
2140
- ].includes(e) && G?.length) && (t = [q?.[0]], J(t)), ![m.table, m.pivotV2].includes(e) && !([
2141
- m.line,
2142
- m.bar,
2143
- m.stack,
2144
- m.row,
2145
- m.horizontalStack
2137
+ C.rose,
2138
+ C.pie,
2139
+ C.doughnut
2140
+ ].includes(e) && G?.length) && (t = [q?.[0]], J(t)), ![C.table, C.pivotV2].includes(e) && !([
2141
+ C.line,
2142
+ C.bar,
2143
+ C.stack,
2144
+ C.row,
2145
+ C.horizontalStack
2146
2146
  ].includes(e) && G?.length === 2 && q?.length === 1) && G?.length > 1 && (n = [G?.[0]], K(n));
2147
2147
  let r = [
2148
- m.line,
2149
- m.bar,
2150
- m.stack,
2151
- m.row,
2152
- m.horizontalStack
2148
+ C.line,
2149
+ C.bar,
2150
+ C.stack,
2151
+ C.row,
2152
+ C.horizontalStack
2153
2153
  ].includes(e), i, a = !1;
2154
2154
  r && n.length === 2 && t.length === 1 ? i = Q([n[1]])?.[0] : a = !0;
2155
2155
  let o = [...n, ...t], { aggregates: s, dimensions: c } = b(o), l = {
@@ -2179,7 +2179,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
2179
2179
  setCurrentSelectedTable: Ot,
2180
2180
  arithmeticColumnOptions: Zt,
2181
2181
  onSaveArithMetricOption: vn,
2182
- onSaveMetricFilter: Fe((e, t) => {
2182
+ onSaveMetricFilter: Pe((e, t) => {
2183
2183
  let n = (e) => (e || "").trim().toLowerCase(), r = n(e.name), i = n(t);
2184
2184
  if ((U?.rlsConditions || []).some((e) => {
2185
2185
  let t = n(e.name);
@@ -2203,7 +2203,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
2203
2203
  $,
2204
2204
  Qe
2205
2205
  ]),
2206
- onRemoveMetricFilter: Fe((e) => {
2206
+ onRemoveMetricFilter: Pe((e) => {
2207
2207
  let t = {
2208
2208
  ...U,
2209
2209
  rlsConditions: (U?.rlsConditions || []).filter((t) => t.name !== e)
@@ -2221,7 +2221,7 @@ var D = (e, t = /* @__PURE__ */ new WeakSet()) => {
2221
2221
  $,
2222
2222
  Qe
2223
2223
  ]),
2224
- onChangeMetricFilterValue: Fe((e, t, n, r, i, a) => {
2224
+ onChangeMetricFilterValue: Pe((e, t, n, r, i, a) => {
2225
2225
  let o = (U?.rlsConditions || []).map((o) => o.name === e ? r ? {
2226
2226
  ...o,
2227
2227
  value: t,
@@ -2287,4 +2287,4 @@ function $e(e, t) {
2287
2287
  };
2288
2288
  }
2289
2289
  //#endregion
2290
- export { k as a, Qe as i, F as n, Be as o, P as r, ze as s, $e as t };
2290
+ export { A as a, Qe as i, F as n, ze as o, P as r, Re as s, $e as t };