@databrainhq/plugin 0.17.9-beta.22 → 0.17.9-beta.23

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.
@@ -1834,7 +1834,7 @@ var ui = (e, t, n) => n?.length ? {
1834
1834
  clientId: t,
1835
1835
  isFrontendApp: n
1836
1836
  }
1837
- }), yi = (e, t) => e?.includes(t) ? e : [...e || [], t], bi = (e, t) => e?.includes(t) ? e.filter((e) => e !== t) : e, xi = (e, t) => !!(e && e.data?.data === t.data && e.data?.name === t.name && e.data?.description === t.description && e.isLoading === t.isLoading && e.key === t.key), Si = ({ metric: e, isAllClient: t, tenancyLevel: n, appliedMetricFilters: r, firstLoadAppliedMetricFilters: i, tableColumnFilters: a, chartSettings: o, isPythonMode: s, globalFilters: c, filterValues: l, tableLimit: u, calendarType: d, comparisonCount: f, datasourceId: p, drillConfig: m, isFrontendApp: h, guestToken: g }) => ({
1837
+ }), yi = (e, t) => e?.includes(t) ? e : [...e || [], t], bi = (e, t) => e?.includes(t) ? e.filter((e) => e !== t) : e, xi = (e, t) => !!(e && e.data?.data === t.data && e.data?.name === t.name && e.data?.description === t.description && e.isLoading === t.isLoading && e.key === t.key), Si = (e) => e.isMetric !== !1 || e.elementSettings?.elementType?.value === "metricExpression", Ci = ({ metric: e, isAllClient: t, tenancyLevel: n, appliedMetricFilters: r, firstLoadAppliedMetricFilters: i, tableColumnFilters: a, chartSettings: o, isPythonMode: s, globalFilters: c, filterValues: l, tableLimit: u, calendarType: d, comparisonCount: f, datasourceId: p, drillConfig: m, isFrontendApp: h, guestToken: g }) => ({
1838
1838
  isAllClient: t,
1839
1839
  id: e?.id,
1840
1840
  tenancyLevel: n,
@@ -1864,27 +1864,27 @@ var ui = (e, t, n) => n?.length ? {
1864
1864
  elementSettings: e?.elementSettings?.metricExpression,
1865
1865
  drillConfig: m,
1866
1866
  isEncrypted: !(h || !g)
1867
- }), Ci = (e) => {
1867
+ }), wi = (e) => {
1868
1868
  let t = e.object.customTable?.query;
1869
1869
  return e.object.wId ? !t || !t.includes("{{") : !1;
1870
- }, wi = (e, t) => e.customTable ? "" : e.tableName ? ne(e.tableName, t) : e.tableName, Ti = (e, t) => {
1870
+ }, Ti = (e, t) => e.customTable ? "" : e.tableName ? ne(e.tableName, t) : e.tableName, Ei = (e, t) => {
1871
1871
  if (!e.customColumnSql) return e.columnName ? ne(e.columnName, t) : e.columnName;
1872
- }, Ei = (e) => {
1872
+ }, Di = (e) => {
1873
1873
  let { object: t } = e, n = t.wId;
1874
1874
  return {
1875
1875
  ...t,
1876
- tableName: wi(t, n),
1877
- columnName: Ti(t, n),
1876
+ tableName: Ti(t, n),
1877
+ columnName: Ei(t, n),
1878
1878
  filter: t.filter?.length ? j(t.filter, n) : [],
1879
1879
  customTable: t.customTable?.query ? {
1880
1880
  query: ne(t.customTable.query, n),
1881
1881
  alias: ne(t.customTable.alias, n)
1882
1882
  } : t.customTable
1883
1883
  };
1884
- }, Di = async (e, t, n) => {
1885
- if (Ci(e)) try {
1884
+ }, Oi = async (e, t, n) => {
1885
+ if (wi(e)) try {
1886
1886
  let r = await t({
1887
- data: Ei(e),
1887
+ data: Di(e),
1888
1888
  encryptedClientId: n.isFrontendApp ? n.encryptedClientId || "" : n.clientId || "",
1889
1889
  isFrontendApp: !!n.isFrontendApp,
1890
1890
  token: n.token || ""
@@ -1893,7 +1893,7 @@ var ui = (e, t, n) => n?.length ? {
1893
1893
  } catch {
1894
1894
  return;
1895
1895
  }
1896
- }, Oi = async ({ entries: e, fetchColumnValues: t, ctx: n, onSeed: r, onResolved: i, onLoading: a, onSettle: o, isCancelled: s }) => {
1896
+ }, ki = async ({ entries: e, fetchColumnValues: t, ctx: n, onSeed: r, onResolved: i, onLoading: a, onSettle: o, isCancelled: s }) => {
1897
1897
  a(!0);
1898
1898
  let c = {};
1899
1899
  e?.forEach((e) => {
@@ -1904,24 +1904,24 @@ var ui = (e, t, n) => n?.length ? {
1904
1904
  if (s()) return;
1905
1905
  let o = e[r];
1906
1906
  a(!0);
1907
- let c = await Di(o, t, n);
1907
+ let c = await Oi(o, t, n);
1908
1908
  if (s()) return;
1909
1909
  c !== void 0 && i(o.element.name, c);
1910
1910
  }
1911
1911
  } finally {
1912
1912
  o();
1913
1913
  }
1914
- }, ki = "Could not generate this metric summary. Try again.", Ai = 1500, ji = /* @__PURE__ */ new Map(), Mi = (e, t) => {
1915
- ji.get(e) === t && ji.delete(e), t.abandonTimer && clearTimeout(t.abandonTimer), t.abandonTimer = void 0;
1916
- }, Ni = (e) => {
1917
- ji.forEach((t, n) => {
1918
- t.settledAt !== void 0 && e - t.settledAt >= 3e4 && Mi(n, t);
1919
- }), !(ji.size <= 24) && [...ji.entries()].filter(([, e]) => e.settledAt !== void 0).sort(([, e], [, t]) => (e.settledAt ?? 0) - (t.settledAt ?? 0)).slice(0, Math.max(0, ji.size - 24)).forEach(([e, t]) => {
1920
- Mi(e, t);
1914
+ }, Ai = "Could not generate this metric summary. Try again.", ji = 1500, Mi = /* @__PURE__ */ new Map(), Ni = (e, t) => {
1915
+ Mi.get(e) === t && Mi.delete(e), t.abandonTimer && clearTimeout(t.abandonTimer), t.abandonTimer = void 0;
1916
+ }, Pi = (e) => {
1917
+ Mi.forEach((t, n) => {
1918
+ t.settledAt !== void 0 && e - t.settledAt >= 3e4 && Ni(n, t);
1919
+ }), !(Mi.size <= 24) && [...Mi.entries()].filter(([, e]) => e.settledAt !== void 0).sort(([, e], [, t]) => (e.settledAt ?? 0) - (t.settledAt ?? 0)).slice(0, Math.max(0, Mi.size - 24)).forEach(([e, t]) => {
1920
+ Ni(e, t);
1921
1921
  });
1922
- }, Pi = (e, t, n = Date.now) => {
1923
- Ni(n());
1924
- let r = ji.get(e);
1922
+ }, Fi = (e, t, n = Date.now) => {
1923
+ Pi(n());
1924
+ let r = Mi.get(e);
1925
1925
  if (r) r.abandonTimer && (clearTimeout(r.abandonTimer), r.abandonTimer = void 0);
1926
1926
  else {
1927
1927
  let i = new AbortController(), a = {
@@ -1930,71 +1930,71 @@ var ui = (e, t, n) => n?.length ? {
1930
1930
  promise: Promise.resolve()
1931
1931
  };
1932
1932
  a.promise = t(i.signal).then((e) => (a.settledAt = n(), e), (t) => {
1933
- throw Mi(e, a), t;
1934
- }), a.promise.catch(() => void 0), ji.set(e, a), r = a;
1933
+ throw Ni(e, a), t;
1934
+ }), a.promise.catch(() => void 0), Mi.set(e, a), r = a;
1935
1935
  }
1936
1936
  let i = r;
1937
1937
  i.holders += 1;
1938
1938
  let a = !1, o = () => {
1939
1939
  a || (a = !0, --i.holders, !(i.holders > 0 || i.settledAt !== void 0) && (i.abandonTimer ||= setTimeout(() => {
1940
- i.abandonTimer = void 0, !(i.holders > 0) && (i.controller.abort(), Mi(e, i));
1941
- }, Ai)));
1940
+ i.abandonTimer = void 0, !(i.holders > 0) && (i.controller.abort(), Ni(e, i));
1941
+ }, ji)));
1942
1942
  };
1943
1943
  return {
1944
1944
  promise: i.promise,
1945
1945
  release: o,
1946
1946
  abort: () => {
1947
- o(), i.controller.abort(), Mi(e, i);
1947
+ o(), i.controller.abort(), Ni(e, i);
1948
1948
  }
1949
1949
  };
1950
- }, Fi = {
1950
+ }, Ii = {
1951
1951
  status: "idle",
1952
1952
  summary: "",
1953
1953
  error: "",
1954
1954
  empty: !1
1955
- }, Ii = {
1956
- ...Fi,
1957
- status: "failed",
1958
- error: ki
1959
1955
  }, Li = {
1956
+ ...Ii,
1957
+ status: "failed",
1958
+ error: Ai
1959
+ }, Ri = {
1960
1960
  status: "done",
1961
1961
  summary: "",
1962
1962
  error: "There is no data to summarize.",
1963
1963
  empty: !0
1964
- }, Ri = () => {
1965
- let [e, t] = R(Fi), n = L(null), r = L(null), i = P(() => {
1964
+ }, zi = () => {
1965
+ let [e, t] = R(Ii), n = L(null), r = L(null), i = P(() => {
1966
1966
  let e = r.current;
1967
- r.current = null, n.current = null, e?.abort(), t(Fi);
1967
+ r.current = null, n.current = null, e?.abort(), t(Ii);
1968
1968
  }, []), a = P(() => {
1969
1969
  let e = r.current;
1970
- r.current = null, e?.abort(), t(Fi);
1970
+ r.current = null, e?.abort(), t(Ii);
1971
1971
  }, []), o = P((e, i) => {
1972
1972
  if (n.current === e) return;
1973
1973
  if (n.current = e, r.current?.release(), r.current = null, !i) {
1974
- t(Li);
1974
+ t(Ri);
1975
1975
  return;
1976
1976
  }
1977
1977
  t({
1978
- ...Fi,
1978
+ ...Ii,
1979
1979
  status: "running"
1980
1980
  });
1981
- let a = Pi(e, async (e) => {
1981
+ let a = Fi(e, async (e) => {
1982
1982
  try {
1983
1983
  let t = await i(e), n = t && typeof t == "object" && "summary" in t && typeof t.summary == "string" ? t.summary.trim() : "";
1984
1984
  return n ? {
1985
- ...Fi,
1985
+ ...Ii,
1986
1986
  status: "done",
1987
1987
  summary: n
1988
- } : Li;
1988
+ } : Ri;
1989
1989
  } catch (e) {
1990
1990
  if (u(e)) throw e;
1991
- return Ii;
1991
+ return Li;
1992
1992
  }
1993
1993
  });
1994
1994
  r.current = a, a.promise.then((e) => {
1995
1995
  r.current === a && t(e);
1996
1996
  }, (e) => {
1997
- r.current === a && t(u(e) ? Fi : Ii);
1997
+ r.current === a && t(u(e) ? Ii : Li);
1998
1998
  });
1999
1999
  }, []);
2000
2000
  return F(() => () => {
@@ -2005,46 +2005,46 @@ var ui = (e, t, n) => n?.length ? {
2005
2005
  stop: a,
2006
2006
  reset: i
2007
2007
  };
2008
- }, zi = (e) => {
2008
+ }, Bi = (e) => {
2009
2009
  let t = L(e);
2010
2010
  return t.current !== e && !H(t.current, e) && (t.current = e), t.current;
2011
2011
  }, $ = (e) => {
2012
2012
  if (!e) return null;
2013
2013
  let t = new Date(e);
2014
2014
  return t instanceof Date && !Number.isNaN(t.getTime()) ? t : null;
2015
- }, Bi = (e) => Fe(e || {}) ? {
2015
+ }, Vi = (e) => Fe(e || {}) ? {
2016
2016
  startTime: e?.startTime,
2017
2017
  endTime: e?.endTime,
2018
2018
  isTimeFilter: !0
2019
- } : {}, Vi = ({ option: e, value: t }) => ({
2019
+ } : {}, Hi = ({ option: e, value: t }) => ({
2020
2020
  startDate: $(e?.fromDate) ?? $(e?.startDate) ?? void 0,
2021
2021
  endDate: $(e?.toDate) ?? $(e?.endDate) ?? void 0,
2022
- ...Bi(e),
2022
+ ...Vi(e),
2023
2023
  value: t,
2024
2024
  label: t
2025
- }), Hi = (e, t) => {
2025
+ }), Ui = (e, t) => {
2026
2026
  if (typeof e == "object" && e) return Reflect.get(e, t);
2027
- }, Ui = [], Wi = [], Gi = [], Ki = (e, t) => {
2027
+ }, Wi = [], Gi = [], Ki = [], qi = (e, t) => {
2028
2028
  let n = t?.configV2?.levels?.find((e) => e?.isEnable)?.chartSettings;
2029
2029
  return n ? {
2030
2030
  ...e,
2031
2031
  ...n
2032
2032
  } : e;
2033
- }, qi = ({ raw: e, selectedDims: t, selectedMetrics: n, datasetSettings: r, integrationName: i, isPythonMode: a }) => {
2033
+ }, Ji = ({ raw: e, selectedDims: t, selectedMetrics: n, datasetSettings: r, integrationName: i, isPythonMode: a }) => {
2034
2034
  let o = Jn({ data: e });
2035
- if (!o.rows.length) return Ui;
2035
+ if (!o.rows.length) return Wi;
2036
2036
  let s = se(o.rows, t || [], n || []), c = s;
2037
2037
  if (i?.toLowerCase() === "redshift" && !a) {
2038
2038
  let e = r?.selectedMetrics || [], t = [...((r?.selectedDims)?.filter((e) => !et(e?.alias)) || [])?.map((e) => e.alias), ...e?.map((e) => e.alias)];
2039
2039
  c = Ue(t, s);
2040
2040
  }
2041
2041
  let l = ot(c);
2042
- return !Array.isArray(l) || !l.length ? Ui : l;
2043
- }, Ji = ({ metric: e, globalFilters: t = {
2042
+ return !Array.isArray(l) || !l.length ? Wi : l;
2043
+ }, Yi = ({ metric: e, globalFilters: t = {
2044
2044
  tableName: "",
2045
2045
  filters: []
2046
2046
  }, rlsFilters: n, clientId: r, tenancyLevel: i, isInternalApp: a, appFilters: s, setCrossDashboardFilters: c, crossDashboardFilters: l, enableCrossFilter: u, enableCrossFilterBeforeDrill: d = !1, metricFilterOptions: m, isAllClient: h, isFrontendApp: g, guestToken: _, encryptedClientId: v, clientCacheScope: y, dashboardId: w, workspaceId: T, metricStore: D, setMetricStore: k, summaryReferencedMetricIds: ne, onServerEvent: de, clientColumnType: he, datasourceId: ye, appliedCardMetricFilters: De, onMetricFiltersChange: ke, language: Me, translationDictionary: j, calendarType: Pe, setLoadedCardMetadata: Fe, isRulePending: Le = !1, setSettledCardIds: Be, drillUrlState: M, isFullScreen: Ue, setMetricMetadata: qe, viewMetricData: N, generatingPdf: Ze, dataMartTables: et, isDisableQuery: nt = !1, token: ct, drilledLevel: lt, drillFilters: ut, drillType: dt, underlyingDataDrillFilters: ft }) => {
2047
- let [mt, ht] = R(!1), gt = ee(), [_t, vt] = R(null), { state: yt, start: bt, stop: xt, reset: St } = Ri(), Ct = yt.summary, wt = yt.error, Tt = yt.empty, Et = yt.status === "running", Dt = L(null), Ot = L(null), [kt, At] = R({
2047
+ let [mt, ht] = R(!1), gt = ee(), [_t, vt] = R(null), { state: yt, start: bt, stop: xt, reset: St } = zi(), Ct = yt.summary, wt = yt.error, Tt = yt.empty, Et = yt.status === "running", Dt = L(null), Ot = L(null), [kt, At] = R({
2048
2048
  limit: parseInt(e?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
2049
2049
  offset: 0
2050
2050
  }), [jt, Mt] = R(0), [z, Nt] = R(0), [B, Pt] = R(e?.rlsConditions || []), [Ft, It] = R([]), [Lt, Rt] = R(!1), [V, zt] = R(), [Bt, Vt] = R(""), [Ht, Ut] = R([]), [Wt, Gt] = R({
@@ -2074,7 +2074,7 @@ var ui = (e, t, n) => n?.length ? {
2074
2074
  onChange: hn.current
2075
2075
  }), r;
2076
2076
  });
2077
- }, [e?.id]), [_n, vn] = R({}), [yn, bn] = R(!1), [Sn, wn] = R(null), [G, K] = R(Ki(e?.chartOptions, e?.drillDownSettings)), Tn = L(""), [En, Dn] = R({
2077
+ }, [e?.id]), [_n, vn] = R({}), [yn, bn] = R(!1), [Sn, wn] = R(null), [G, K] = R(qi(e?.chartOptions, e?.drillDownSettings)), Tn = L(""), [En, Dn] = R({
2078
2078
  data: [],
2079
2079
  error: "",
2080
2080
  isLoading: !1,
@@ -2155,8 +2155,8 @@ var ui = (e, t, n) => n?.length ? {
2155
2155
  e?.drillDownSettings?.isEnableGroupBy,
2156
2156
  B,
2157
2157
  On
2158
- ]), Nn = I(() => JSON.stringify(Ft), [Ft]), J = zi(I(() => ({
2159
- ...Si({
2158
+ ]), Nn = I(() => JSON.stringify(Ft), [Ft]), J = Bi(I(() => ({
2159
+ ...Ci({
2160
2160
  metric: e,
2161
2161
  isAllClient: h,
2162
2162
  tenancyLevel: i,
@@ -2249,8 +2249,8 @@ var ui = (e, t, n) => n?.length ? {
2249
2249
  }, {
2250
2250
  isDisableQuery: zn,
2251
2251
  onSuccess: (e) => {
2252
- let t = Jn(e), n = ot(t.rows), r = Hi(Hi(t.error, "details"), "legacyCode");
2253
- if (Fe && Hi(t.error, "code") !== "E1001" && r !== "E1001") {
2252
+ let t = Jn(e), n = ot(t.rows), r = Ui(Ui(t.error, "details"), "legacyCode");
2253
+ if (Fe && Ui(t.error, "code") !== "E1001" && r !== "E1001") {
2254
2254
  let e = J?.id, t = !!n?.length && (G?.chartType !== A.singleValue || n?.[0]?.[G?.singleValue || ""] != null);
2255
2255
  Fe?.((n) => {
2256
2256
  let r = n?.find((t) => t?.id === e);
@@ -2269,7 +2269,7 @@ var ui = (e, t, n) => n?.length ? {
2269
2269
  F(() => {
2270
2270
  $n && tr.current !== X && (tr.current = X, p("metric.filter_not_applied", { error_code: "FILTER_NOT_APPLIED" }));
2271
2271
  }, [$n, X]);
2272
- let Q = I(() => qi({
2272
+ let Q = I(() => Ji({
2273
2273
  raw: Qn.rows,
2274
2274
  selectedDims: (e?.datasetMetricSettings)?.newDatasetSettings?.selectedDims,
2275
2275
  selectedMetrics: (e?.datasetMetricSettings)?.newDatasetSettings?.selectedMetrics,
@@ -2284,7 +2284,7 @@ var ui = (e, t, n) => n?.length ? {
2284
2284
  ]), nr = I(() => Wn(X?.metaData?.truncation, Q.length), [X, Q]), ir = I(() => Gn(nr), [nr]), ar = Ln || qn || Qn.error;
2285
2285
  F(() => {
2286
2286
  if (!ar) return;
2287
- let t = ar instanceof Error ? ar.message : Hi(ar, "message"), n = Hi(ar, "context");
2287
+ let t = ar instanceof Error ? ar.message : Ui(ar, "message"), n = Ui(ar, "context");
2288
2288
  f("metric-query-error-observed", {
2289
2289
  metricId: e?.id,
2290
2290
  metricName: e?.name,
@@ -2332,7 +2332,7 @@ var ui = (e, t, n) => n?.length ? {
2332
2332
  let n = e?.rlsConditions?.map((e) => {
2333
2333
  let n = t?.find((t) => t.name === e.name && t.datatype === e.datatype && t.tableName === e.tableName && t.columnName === e.columnName), a = e;
2334
2334
  if (m) {
2335
- let e = Xi(a, m);
2335
+ let e = Zi(a, m);
2336
2336
  if (e) {
2337
2337
  let t = a.datatype === "date" ? e.options?.find((t) => t.name === e.value) : void 0;
2338
2338
  a = {
@@ -2347,7 +2347,7 @@ var ui = (e, t, n) => n?.length ? {
2347
2347
  maxDate: $(e.maxDate) ?? void 0,
2348
2348
  fromDate: $(e.fromDate) ?? void 0,
2349
2349
  toDate: $(e.toDate) ?? void 0,
2350
- ...Bi(e)
2350
+ ...Vi(e)
2351
2351
  })) : e.options,
2352
2352
  variableOptions: a.datatype === "date" ? e.options?.map((e) => ({
2353
2353
  range: e.range,
@@ -2357,7 +2357,7 @@ var ui = (e, t, n) => n?.length ? {
2357
2357
  maxDate: $(e.maxDate) ?? void 0,
2358
2358
  fromDate: $(e.fromDate) ?? void 0,
2359
2359
  toDate: $(e.toDate) ?? void 0,
2360
- ...Bi(e),
2360
+ ...Vi(e),
2361
2361
  value: e.name,
2362
2362
  label: e.name
2363
2363
  })) : e.options?.map((e) => ({
@@ -2367,7 +2367,7 @@ var ui = (e, t, n) => n?.length ? {
2367
2367
  selectedVariableValue: e.value ? a.datatype === "string" ? {
2368
2368
  value: e.value,
2369
2369
  label: e.value
2370
- } : Vi({
2370
+ } : Hi({
2371
2371
  option: t,
2372
2372
  value: e.value
2373
2373
  }) : a.selectedVariableValue
@@ -2615,7 +2615,7 @@ var ui = (e, t, n) => n?.length ? {
2615
2615
  let e = Or.current, t = () => Or.current !== e;
2616
2616
  if (wr?.length) {
2617
2617
  let { clientId: e, encryptedClientId: n, isFrontendApp: r, token: i } = kr.current;
2618
- Oi({
2618
+ ki({
2619
2619
  entries: wr,
2620
2620
  fetchColumnValues: Ar.current,
2621
2621
  ctx: {
@@ -2777,7 +2777,7 @@ var ui = (e, t, n) => n?.length ? {
2777
2777
  label: n,
2778
2778
  endDate: i.endDate,
2779
2779
  startDate: i.startDate,
2780
- ...Bi(i),
2780
+ ...Vi(i),
2781
2781
  timeGrainValue: s
2782
2782
  }
2783
2783
  } : e) : a ? (e) => e?.map((e) => e.name === t ? {
@@ -3345,8 +3345,8 @@ var ui = (e, t, n) => n?.length ? {
3345
3345
  })) || [], [e?.datasetMetricSettings?.newDatasetSettings]), fi = I(() => e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.map((e) => ({
3346
3346
  value: e?.alias || e?.name,
3347
3347
  label: e?.alias || e?.name
3348
- })) || [], [e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), { metricFilters: mi, leftPositionedMetricFilters: Ci, rightPositionedMetricFilters: wi } = I(() => {
3349
- let t = Zi({
3348
+ })) || [], [e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), { metricFilters: mi, leftPositionedMetricFilters: wi, rightPositionedMetricFilters: Ti } = I(() => {
3349
+ let t = Qi({
3350
3350
  rlsConditions: B,
3351
3351
  isFrontendApp: g
3352
3352
  }), n = tt({
@@ -3381,7 +3381,7 @@ var ui = (e, t, n) => n?.length ? {
3381
3381
  h,
3382
3382
  he,
3383
3383
  et
3384
- ]), Ti = [
3384
+ ]), Ei = [
3385
3385
  A.pie,
3386
3386
  A.doughnut,
3387
3387
  A.rose,
@@ -3402,14 +3402,14 @@ var ui = (e, t, n) => n?.length ? {
3402
3402
  A.boxplot,
3403
3403
  A.timeSeries,
3404
3404
  A.gantt
3405
- ].includes(G?.chartType) || (G?.isMultiDimension || G?.isDynamicSeries) && G?.seriesField !== "ungrouped", Ei = P((t) => {
3405
+ ].includes(G?.chartType) || (G?.isMultiDimension || G?.isDynamicSeries) && G?.seriesField !== "ungrouped", Di = P((t) => {
3406
3406
  let n = e?.dataSecuritySettings?.csvColumns || [];
3407
3407
  return t?.length ? t?.map((e) => {
3408
3408
  let t = {};
3409
3409
  for (let r in e) n?.includes(r) || (t[r] = e[r]);
3410
3410
  return t;
3411
3411
  }) : [];
3412
- }, [e?.dataSecuritySettings]), Di = I(() => Ei(Q), [Q, Ei]);
3412
+ }, [e?.dataSecuritySettings]), Oi = I(() => Di(Q), [Q, Di]);
3413
3413
  F(() => {
3414
3414
  G || (K(e?.chartOptions), At({
3415
3415
  limit: parseInt(e?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
@@ -3425,10 +3425,10 @@ var ui = (e, t, n) => n?.length ? {
3425
3425
  G?.chartType,
3426
3426
  G?.tableSettings?.defaultRowSize
3427
3427
  ]);
3428
- let ki = L(t);
3429
- ki.current = t, F(() => {
3428
+ let Ai = L(t);
3429
+ Ai.current = t, F(() => {
3430
3430
  if (G?.chartType === A.timeSeries && G?.timeSeriesSettings?.groupBySettings?.isGlobalFilter && Mr) {
3431
- let e = ki.current?.filters?.find((e) => e.label === G?.timeSeriesSettings?.groupBySettings?.globalFilterOption?.value)?.value;
3431
+ let e = Ai.current?.filters?.find((e) => e.label === G?.timeSeriesSettings?.groupBySettings?.globalFilterOption?.value)?.value;
3432
3432
  if ((typeof e == "string" || typeof e == "object" && e?.value) && e) {
3433
3433
  let t = typeof e == "string" ? Ce(e)?.toLowerCase() : G?.timeSeriesSettings?.groupBySettings?.formatWithValue?.find((t) => t.value === Ce(e?.value))?.format?.toLowerCase() || "";
3434
3434
  it?.find((e) => e?.value?.toLowerCase() === t) && K((e) => ({
@@ -3469,17 +3469,17 @@ var ui = (e, t, n) => n?.length ? {
3469
3469
  G?.isDynamicSeries,
3470
3470
  G?.ungroupedAlias
3471
3471
  ]);
3472
- let [Ai, ji] = R(!1), Mi = (e) => {
3473
- e.key === "Control" && ji(!0);
3474
- }, Ni = (e) => {
3475
- e.key === "Control" && ji(!1);
3472
+ let [ji, Mi] = R(!1), Ni = (e) => {
3473
+ e.key === "Control" && Mi(!0);
3474
+ }, Pi = (e) => {
3475
+ e.key === "Control" && Mi(!1);
3476
3476
  };
3477
3477
  F(() => {
3478
3478
  Q?.length && Ut(Object.keys(Q?.[0] || {}));
3479
- }, [Q?.length]), F(() => (G?.customSettings?.chartZoom?.isZoomEnabled && (window.addEventListener("keydown", Mi), window.addEventListener("keyup", Ni)), () => {
3480
- window.removeEventListener("keydown", Mi), window.removeEventListener("keyup", Ni);
3479
+ }, [Q?.length]), F(() => (G?.customSettings?.chartZoom?.isZoomEnabled && (window.addEventListener("keydown", Ni), window.addEventListener("keyup", Pi)), () => {
3480
+ window.removeEventListener("keydown", Ni), window.removeEventListener("keyup", Pi);
3481
3481
  }), []);
3482
- let Pi = I(() => {
3482
+ let Fi = I(() => {
3483
3483
  let e = !1;
3484
3484
  if (Q?.length) {
3485
3485
  let t = G?.singleValue;
@@ -3490,7 +3490,7 @@ var ui = (e, t, n) => n?.length ? {
3490
3490
  Q?.length,
3491
3491
  G?.singleValue,
3492
3492
  G?.chartType === A.singleValue
3493
- ]), Fi = I(() => $e({
3493
+ ]), Ii = I(() => $e({
3494
3494
  chartOptions: G,
3495
3495
  data: Q || []
3496
3496
  }), [
@@ -3504,7 +3504,7 @@ var ui = (e, t, n) => n?.length ? {
3504
3504
  G?.isGroupXAxis,
3505
3505
  G?.timeSeriesSettings?.seriesType[0],
3506
3506
  G?.timeSeriesSettings?.groupBySettings?.fillXAxis
3507
- ]), Ii = I(() => Ee({
3507
+ ]), Li = I(() => Ee({
3508
3508
  text: ze(e?.name || "", _n) || "",
3509
3509
  selectedLanguage: Me,
3510
3510
  translationDictionary: j
@@ -3513,7 +3513,7 @@ var ui = (e, t, n) => n?.length ? {
3513
3513
  _n,
3514
3514
  j,
3515
3515
  Me
3516
- ]), Li = I(() => Ee({
3516
+ ]), Ri = I(() => Ee({
3517
3517
  text: ze(e?.longDescription || "", _n) || "",
3518
3518
  selectedLanguage: Me,
3519
3519
  translationDictionary: j
@@ -3522,7 +3522,7 @@ var ui = (e, t, n) => n?.length ? {
3522
3522
  _n,
3523
3523
  Me,
3524
3524
  j
3525
- ]), Ui = I(() => Ee({
3525
+ ]), Wi = I(() => Ee({
3526
3526
  text: ze(e?.description || "", _n) || "",
3527
3527
  selectedLanguage: Me,
3528
3528
  translationDictionary: j
@@ -3531,7 +3531,7 @@ var ui = (e, t, n) => n?.length ? {
3531
3531
  _n,
3532
3532
  Me,
3533
3533
  j
3534
- ]), Ji = I(() => Ee({
3534
+ ]), Yi = I(() => Ee({
3535
3535
  text: ze(e?.footNote || "", _n) || "",
3536
3536
  selectedLanguage: Me,
3537
3537
  translationDictionary: j
@@ -3540,7 +3540,7 @@ var ui = (e, t, n) => n?.length ? {
3540
3540
  _n,
3541
3541
  Me,
3542
3542
  j
3543
- ]), Qi = I(() => `${Q?.[0]?.dbn_metric_expression_data || "No Data Found"}`, [Q]), $i = I(() => e?.rlsConditions?.map((e) => {
3543
+ ]), $i = I(() => `${Q?.[0]?.dbn_metric_expression_data || "No Data Found"}`, [Q]), ea = I(() => e?.rlsConditions?.map((e) => {
3544
3544
  if (e?.datatype === "date" && e?.options?.find((e) => e.range === "Custom Date") && e?.isEnableDynamicDate && e?.dynamicDate?.value) {
3545
3545
  let t = pe(He?.find((t) => t.value === e?.dynamicDate?.value)?.count || 0), n = Ve(t), r = Ve(t);
3546
3546
  return {
@@ -3569,7 +3569,7 @@ var ui = (e, t, n) => n?.length ? {
3569
3569
  key: Y
3570
3570
  }), n;
3571
3571
  }), X?.data && D) {
3572
- let t = Yi(e?.id, ne) ? X?.data : void 0;
3572
+ let t = Xi(e?.id, ne) ? X?.data : void 0;
3573
3573
  k?.((n) => {
3574
3574
  if (xi(n?.get(e?.id), {
3575
3575
  data: t,
@@ -3590,34 +3590,37 @@ var ui = (e, t, n) => n?.length ? {
3590
3590
  }), r;
3591
3591
  });
3592
3592
  }
3593
- !Z && ar && k?.((t) => {
3594
- let n = t?.get(e?.id);
3595
- if (n && !n.isLoading && n.error && n.key === Y) return t;
3596
- let r = new Map(t);
3597
- return r.set(e?.id, {
3598
- data: n?.data ?? {
3599
- data: [],
3600
- name: "",
3601
- description: ""
3602
- },
3603
- isLoading: !1,
3604
- key: Y,
3605
- error: "failed"
3606
- }), r;
3607
- });
3593
+ if (!Z && ar) {
3594
+ let t = Si(e);
3595
+ k?.((n) => {
3596
+ let r = n?.get(e?.id);
3597
+ if (r && !r.isLoading && !!r.error === t && r.key === Y) return n;
3598
+ let i = new Map(n);
3599
+ return i.set(e?.id, {
3600
+ data: r?.data ?? {
3601
+ data: [],
3602
+ name: "",
3603
+ description: ""
3604
+ },
3605
+ isLoading: !1,
3606
+ key: Y,
3607
+ ...t ? { error: "failed" } : {}
3608
+ }), i;
3609
+ });
3610
+ }
3608
3611
  }, [
3609
3612
  X?.data,
3610
3613
  Z,
3611
3614
  Y,
3612
3615
  ar
3613
3616
  ]);
3614
- let ea = L(e?.id);
3615
- ea.current = e?.id;
3616
- let ta = L(D);
3617
- ta.current = D;
3618
- let na = L(k);
3619
- na.current = k, F(() => () => {
3620
- let e = ea.current, t = ta.current, n = na.current;
3617
+ let ta = L(e?.id);
3618
+ ta.current = e?.id;
3619
+ let na = L(D);
3620
+ na.current = D;
3621
+ let ra = L(k);
3622
+ ra.current = k, F(() => () => {
3623
+ let e = ta.current, t = na.current, n = ra.current;
3621
3624
  e && t && n && t.get(e)?.data?.data && n((t) => {
3622
3625
  let n = t.get(e);
3623
3626
  if (!n?.data?.data) return t;
@@ -3631,14 +3634,14 @@ var ui = (e, t, n) => n?.length ? {
3631
3634
  }), r;
3632
3635
  });
3633
3636
  }, []);
3634
- let ra = !!e?.elementSettings?.summary?.metricList?.length, [ia, aa] = R(0);
3637
+ let ia = !!e?.elementSettings?.summary?.metricList?.length, [aa, oa] = R(0);
3635
3638
  F(() => {
3636
3639
  let e = D?.subscribe;
3637
- if (ra && typeof e == "function") return e(() => aa((e) => e + 1));
3638
- }, [D, ra]), pt(() => {
3640
+ if (ia && typeof e == "function") return e(() => oa((e) => e + 1));
3641
+ }, [D, ia]), pt(() => {
3639
3642
  Dt.current !== Vn && (Dt.current = Vn, St());
3640
3643
  }, [Vn, St]);
3641
- let oa = () => !!e?.elementSettings?.summary?.metricList?.some((e) => D?.get(e.value)?.isLoading === !0);
3644
+ let sa = () => !!e?.elementSettings?.summary?.metricList?.some((e) => D?.get(e.value)?.isLoading === !0);
3642
3645
  pt(() => {
3643
3646
  let t = e?.elementSettings?.summary;
3644
3647
  if (!t?.metricList?.length || !D?.get(e?.id)) return;
@@ -3675,7 +3678,7 @@ var ui = (e, t, n) => n?.length ? {
3675
3678
  e?.name,
3676
3679
  e?.description,
3677
3680
  D,
3678
- ia,
3681
+ aa,
3679
3682
  Vn,
3680
3683
  bt,
3681
3684
  gt,
@@ -3831,7 +3834,7 @@ var ui = (e, t, n) => n?.length ? {
3831
3834
  chartType: A.singleValue
3832
3835
  }));
3833
3836
  }, [G?.chartType, G?.yAxisList?.length]);
3834
- let sa = ({ columnAlias: t, value: n, isClear: r = !1 }) => {
3837
+ let ca = ({ columnAlias: t, value: n, isClear: r = !1 }) => {
3835
3838
  let i = e?.datasetMetricSettings;
3836
3839
  i && Re({
3837
3840
  columnAlias: t,
@@ -3853,7 +3856,7 @@ var ui = (e, t, n) => n?.length ? {
3853
3856
  yAxisList: [e?.value]
3854
3857
  }));
3855
3858
  }, [G?.dynamicYAxis?.selectedOption, G?.dynamicYAxis?.isEnabled]), F(() => {
3856
- let t = N?.yAxisSettings?.find((t) => t?.yAxisSettings?.isEnable && t?.id === e?.id && t?.yAxisSettings?.yAxis && Array.isArray(t?.yAxisSettings?.yAxis) && t?.yAxisSettings?.yAxis?.length > 0), n = N?.xAxisSettings?.find((t) => t?.xAxisSettings?.isEnable && t?.id === e?.id && t?.xAxisSettings?.xaxis), r = U?.configV2?.levels?.length ? U : e?.drillDownSettings, i = Ki(e?.chartOptions, r), a = i !== e?.chartOptions;
3859
+ let t = N?.yAxisSettings?.find((t) => t?.yAxisSettings?.isEnable && t?.id === e?.id && t?.yAxisSettings?.yAxis && Array.isArray(t?.yAxisSettings?.yAxis) && t?.yAxisSettings?.yAxis?.length > 0), n = N?.xAxisSettings?.find((t) => t?.xAxisSettings?.isEnable && t?.id === e?.id && t?.xAxisSettings?.xaxis), r = U?.configV2?.levels?.length ? U : e?.drillDownSettings, i = qi(e?.chartOptions, r), a = i !== e?.chartOptions;
3857
3860
  if (!G?.dynamicYAxis?.isEnabled && !G?.dynamicXAxis?.isEnabled && !a || !t && !n && !a) {
3858
3861
  K((t) => e?.chartOptions || t);
3859
3862
  return;
@@ -3905,7 +3908,7 @@ var ui = (e, t, n) => n?.length ? {
3905
3908
  G?.chartType,
3906
3909
  G?.customSettings?.ganttTooltipKeys
3907
3910
  ]);
3908
- let ca = I(() => e?.datasetMetricSettings?.selectedDimensions?.map((e) => le(e || "none")) || Gi, [e?.datasetMetricSettings?.selectedDimensions]);
3911
+ let la = I(() => e?.datasetMetricSettings?.selectedDimensions?.map((e) => le(e || "none")) || Ki, [e?.datasetMetricSettings?.selectedDimensions]);
3909
3912
  return {
3910
3913
  drillBlockedNotice: _t,
3911
3914
  filterNotAppliedNotice: $n,
@@ -3915,7 +3918,7 @@ var ui = (e, t, n) => n?.length ? {
3915
3918
  elementSummaryEmpty: Tt,
3916
3919
  isLoadingSummary: Et,
3917
3920
  stopSummary: xt,
3918
- isMetricListLoading: oa,
3921
+ isMetricListLoading: sa,
3919
3922
  onDrillLevelClick: Qr,
3920
3923
  onDrillDown: Yr,
3921
3924
  onFilterDashboardTo: qr,
@@ -3931,17 +3934,17 @@ var ui = (e, t, n) => n?.length ? {
3931
3934
  columnName: zr,
3932
3935
  underlyingDataPoint: Br,
3933
3936
  chartParams: V,
3934
- isQueryLoading: !Ln && (Z || mt || Xn || Le && (!Q?.length || Pi)),
3937
+ isQueryLoading: !Ln && (Z || mt || Xn || Le && (!Q?.length || Fi)),
3935
3938
  isMetricUpdating: Zn,
3936
- isSingleValueNull: Pi,
3939
+ isSingleValueNull: Fi,
3937
3940
  dynamicOptions: Sn,
3938
3941
  chartSettings: G,
3939
3942
  setChartSettings: K,
3940
- isEnableZoom: Ai,
3943
+ isEnableZoom: ji,
3941
3944
  filterValues: An,
3942
3945
  containerRef: Ot,
3943
3946
  drilledLevel: H.length,
3944
- dimensions: ca,
3947
+ dimensions: la,
3945
3948
  rlsConditions: B,
3946
3949
  setRlsConditions: Pt,
3947
3950
  setTableLimit: At,
@@ -3976,19 +3979,19 @@ var ui = (e, t, n) => n?.length ? {
3976
3979
  } : t));
3977
3980
  },
3978
3981
  metricFilters: mi,
3979
- leftPositionedMetricFilters: Ci,
3980
- rightPositionedMetricFilters: wi,
3982
+ leftPositionedMetricFilters: wi,
3983
+ rightPositionedMetricFilters: Ti,
3981
3984
  drillFilters: H,
3982
3985
  underlyingDataColumnMetadata: Wr,
3983
3986
  underlyingDataDrillFilters: Ur,
3984
3987
  drillType: U?.drillType,
3985
- tableResultsDownloadData: Di,
3986
- filterCsvColumns: Ei,
3988
+ tableResultsDownloadData: Oi,
3989
+ filterCsvColumns: Di,
3987
3990
  appliedMetricFilters: W,
3988
3991
  pivotHeaderOptions: ui,
3989
3992
  pivotDrillState: En,
3990
3993
  onDrillPivotTable: Zr,
3991
- legendData: Fi,
3994
+ legendData: Ii,
3992
3995
  timeseriesDimension: Mr,
3993
3996
  isPythonMode: q,
3994
3997
  sortOrder: Bt,
@@ -3996,7 +3999,7 @@ var ui = (e, t, n) => n?.length ? {
3996
3999
  isNotFirstRender: Kt,
3997
4000
  setNotFirstRender: qt,
3998
4001
  isSorted: yn,
3999
- isInavlidForSort: Ti,
4002
+ isInavlidForSort: Ei,
4000
4003
  onAddComparison: ni,
4001
4004
  groupedRlsConditions: si,
4002
4005
  onGenerateMetricSummary: ri,
@@ -4009,33 +4012,33 @@ var ui = (e, t, n) => n?.length ? {
4009
4012
  setShowChartPropertyPanel: pn,
4010
4013
  columnList: Ht,
4011
4014
  variables: _n,
4012
- metricName: Ii,
4013
- longDescription: Li,
4014
- footNote: Ji,
4015
- description: Ui,
4015
+ metricName: Li,
4016
+ longDescription: Ri,
4017
+ footNote: Yi,
4018
+ description: Wi,
4016
4019
  drilldownCols: Jt,
4017
4020
  switchMeasureOptions: fi,
4018
- metricExpressionResult: Qi,
4021
+ metricExpressionResult: $i,
4019
4022
  dateFilter: ci,
4020
4023
  drillDownSettings: U,
4021
4024
  onDrillIntoDimension: Xr,
4022
4025
  adhocDrillDims: an,
4023
4026
  enabledCharts: ai,
4024
4027
  tableColumnFilters: Ft,
4025
- onChangePaginationColumnFilters: sa,
4028
+ onChangePaginationColumnFilters: ca,
4026
4029
  queryError: ar,
4027
4030
  queryPermissionDenied: !!qn?.isBatchAuth,
4028
4031
  refetchMetricData: Yn,
4029
4032
  customSwitchXAxis: jn,
4030
- savedMetricFilters: $i || Wi
4033
+ savedMetricFilters: ea || Gi
4031
4034
  };
4032
4035
  };
4033
- function Yi(e, t) {
4036
+ function Xi(e, t) {
4034
4037
  return t === void 0 || t.has(e);
4035
4038
  }
4036
4039
  //#endregion
4037
4040
  //#region src/helpers/getValidRlsConditionOptions.ts
4038
- var Xi = (e, t) => {
4041
+ var Zi = (e, t) => {
4039
4042
  if (!t?.[e.name]) return;
4040
4043
  let n = t?.[e.name]?.defaultOption?.toString(), r = (t?.[e.name]?.options)?.filter((t) => {
4041
4044
  if (t == null) return !1;
@@ -4082,16 +4085,16 @@ var Xi = (e, t) => {
4082
4085
  }) ? n : void 0,
4083
4086
  options: r
4084
4087
  };
4085
- }, Zi = ({ rlsConditions: e, isFrontendApp: t }) => e.filter((e) => (t || !e.isAppFilter) && !e.isHiddenInUi), Qi = (e) => !!e && e !== "null" && e !== "undefined", $i = (e) => {
4088
+ }, Qi = ({ rlsConditions: e, isFrontendApp: t }) => e.filter((e) => (t || !e.isAppFilter) && !e.isHiddenInUi), $i = (e) => !!e && e !== "null" && e !== "undefined", ea = (e) => {
4086
4089
  if (e == null) return null;
4087
4090
  let t = typeof e == "string" ? e : String(e);
4088
4091
  return t.length ? t : null;
4089
- }, ea = ({ config: e, value: t, carryFilters: n = [] }) => {
4092
+ }, ta = ({ config: e, value: t, carryFilters: n = [] }) => {
4090
4093
  if (!e?.isEnable) return {
4091
4094
  ok: !1,
4092
4095
  reason: "disabled"
4093
4096
  };
4094
- if (!Qi(e.dashboardId)) return {
4097
+ if (!$i(e.dashboardId)) return {
4095
4098
  ok: !1,
4096
4099
  reason: "no_destination"
4097
4100
  };
@@ -4100,7 +4103,7 @@ var Xi = (e, t) => {
4100
4103
  ok: !1,
4101
4104
  reason: "no_target_filter"
4102
4105
  };
4103
- let i = $i(t);
4106
+ let i = ea(t);
4104
4107
  if (i === null) return {
4105
4108
  ok: !1,
4106
4109
  reason: "no_value"
@@ -4129,7 +4132,7 @@ var Xi = (e, t) => {
4129
4132
  navigation: c.code
4130
4133
  }
4131
4134
  };
4132
- }, ta = (e, t) => {
4135
+ }, na = (e, t) => {
4133
4136
  let n = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : null, { params: r, rowFilters: i } = t, a = e?.valueColumn?.trim();
4134
4137
  if (a) {
4135
4138
  let e = (i ?? []).find((e) => e?.columnName === a);
@@ -4138,7 +4141,7 @@ var Xi = (e, t) => {
4138
4141
  if (r && r.name !== void 0 && r.name !== null) return n(r.name);
4139
4142
  let o = (i ?? []).find((e) => e?.value !== void 0 && e?.value !== null);
4140
4143
  return o ? n(o.value) : null;
4141
- }, na = lt("triangle-alert", [
4144
+ }, ra = lt("triangle-alert", [
4142
4145
  ["path", {
4143
4146
  d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
4144
4147
  key: "wmoenq"
@@ -4151,7 +4154,7 @@ var Xi = (e, t) => {
4151
4154
  d: "M12 17h.01",
4152
4155
  key: "p32p05"
4153
4156
  }]
4154
- ]), ra = (e) => e === "column" ? {
4157
+ ]), ia = (e) => e === "column" ? {
4155
4158
  code: "JOIN_COLUMN_HIDDEN",
4156
4159
  message: "A column this metric uses is hidden or no longer in the datamart.",
4157
4160
  hint: "Ask an editor to unhide it in the datamart or update the metric."
@@ -4159,44 +4162,44 @@ var Xi = (e, t) => {
4159
4162
  code: "JOIN_PATH_MISSING",
4160
4163
  message: "A join this metric uses is no longer in the datamart.",
4161
4164
  hint: "Ask an editor to add the relationship back or update the metric."
4162
- }, ia = (e) => {
4165
+ }, aa = (e) => {
4163
4166
  let t = n(e, { fallback: "The query couldn't run." });
4164
- return t.code === "JOIN_COLUMN_HIDDEN" ? n(ra("column")) : t.code === "JOIN_PATH_MISSING" ? n(ra("join")) : t;
4165
- }, aa = {
4167
+ return t.code === "JOIN_COLUMN_HIDDEN" ? n(ia("column")) : t.code === "JOIN_PATH_MISSING" ? n(ia("join")) : t;
4168
+ }, oa = {
4166
4169
  notice: "_notice_vwpz7_1",
4167
4170
  icon: "_icon_vwpz7_15"
4168
- }, oa = N(), sa = ({ text: e }) => e ? /* @__PURE__ */ (0, oa.jsxs)("div", {
4169
- className: aa.notice,
4171
+ }, sa = N(), ca = ({ text: e }) => e ? /* @__PURE__ */ (0, sa.jsxs)("div", {
4172
+ className: oa.notice,
4170
4173
  role: "status",
4171
4174
  "data-testid": "custom-sql-filter-notice",
4172
- children: [/* @__PURE__ */ (0, oa.jsx)(na, {
4173
- className: aa.icon,
4175
+ children: [/* @__PURE__ */ (0, sa.jsx)(ra, {
4176
+ className: oa.icon,
4174
4177
  "aria-hidden": "true"
4175
- }), /* @__PURE__ */ (0, oa.jsx)("span", { children: e })]
4176
- }) : null, ca = (e) => {
4178
+ }), /* @__PURE__ */ (0, sa.jsx)("span", { children: e })]
4179
+ }) : null, la = (e) => {
4177
4180
  let t = e.value ?? e.selectedVariableValue?.value;
4178
4181
  return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim().length > 0 : t != null;
4179
- }, la = (e) => {
4182
+ }, ua = (e) => {
4180
4183
  let t = e.label ?? e.name ?? e.column;
4181
4184
  return typeof t == "string" && t.trim() ? t.trim() : "Filter";
4182
- }, ua = ({ isCustomSqlMetric: e, query: t, metricId: n, filters: r }) => {
4185
+ }, da = ({ isCustomSqlMetric: e, query: t, metricId: n, filters: r }) => {
4183
4186
  if (!e) return [];
4184
4187
  let i = Be(t || "");
4185
4188
  return (r || []).flatMap((e) => {
4186
4189
  let t = e.restrictedMetrics?.some((e) => e.value === n);
4187
- if (!e.isVariableFilter || e.isFilterApplied === !1 || e.isHiddenInUi || t || !ca(e)) return [];
4190
+ if (!e.isVariableFilter || e.isFilterApplied === !1 || e.isHiddenInUi || t || !la(e)) return [];
4188
4191
  let r = (e.variableStrings || []).filter(Boolean), a = r.filter((e) => !i.includes(e));
4189
4192
  return r.length > 0 && a.length === 0 ? [] : [{
4190
- label: la(e),
4193
+ label: ua(e),
4191
4194
  missingVariables: a
4192
4195
  }];
4193
4196
  });
4194
- }, da = (e) => e.length === 1 ? e[0] : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e.at(-1)}`, fa = (e) => {
4195
- let t = ua(e);
4197
+ }, fa = (e) => e.length === 1 ? e[0] : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e.at(-1)}`, pa = (e) => {
4198
+ let t = da(e);
4196
4199
  if (!t.length) return null;
4197
4200
  let n = [...new Set(t.flatMap((e) => e.missingVariables))], r = t.length === 1 ? `${t[0].label} is not applied to this custom SQL metric.` : `${t.length} filters are not applied to this custom SQL metric.`;
4198
- return n.length ? `${r} Add ${da(n)} to the metric SQL.` : `${r} Configure matching filter variables in the metric SQL.`;
4199
- }, pa = ({ chart: e, valueColumn: t, isDrillEnabled: n, drilledLevel: r, dimensionCount: i, params: a, passAllData: o }) => {
4201
+ return n.length ? `${r} Add ${fa(n)} to the metric SQL.` : `${r} Configure matching filter variables in the metric SQL.`;
4202
+ }, ma = ({ chart: e, valueColumn: t, isDrillEnabled: n, drilledLevel: r, dimensionCount: i, params: a, passAllData: o }) => {
4200
4203
  let s = e?.chartType;
4201
4204
  return s === A.table || s === A.singleValue || n && r === i ? o ? a?.reduce((e, t) => (e[t.columnName] = t.value, e), {}) : a?.find((e) => e.columnName === t)?.value : [A.sankey, A.treeMap].includes(s) ? o ? {
4202
4205
  name: a?.name,
@@ -4206,19 +4209,19 @@ var Xi = (e, t) => {
4206
4209
  value: a?.value,
4207
4210
  columnName: a?.seriesName
4208
4211
  } : t === e?.xAxis || s === A.gauge && t === e?.gaugeSettings?.dimensions?.join(", ") ? a?.name : a?.seriesName === t || s === A.gauge && t === e?.gaugeSettings?.metric || [A.funnel].includes(s) ? a?.value : null;
4209
- }, ma = (e, t, n) => !e || t === n, ha = ({ chart: e, chartWithMetric: t, chartWithDashboard: n, isDrillEnabled: r, drilledLevel: i, dimensionCount: a, isLastConfiguredDrillLevel: o, isTableRedirectAllowed: s = !0 }) => {
4210
- let c = ma(r, i, a), l = c || !!o, u = !!e?.isEnable && l && s, d = e?.routeType === "user";
4212
+ }, ha = (e, t, n) => !e || t === n, ga = ({ chart: e, chartWithMetric: t, chartWithDashboard: n, isDrillEnabled: r, drilledLevel: i, dimensionCount: a, isLastConfiguredDrillLevel: o, isTableRedirectAllowed: s = !0 }) => {
4213
+ let c = ha(r, i, a), l = c || !!o, u = !!e?.isEnable && l && s, d = e?.routeType === "user";
4211
4214
  return {
4212
4215
  navigate: u && !d,
4213
4216
  host: u && d,
4214
4217
  openNestedMetric: !!t?.isEnable && c,
4215
4218
  openDashboard: !!n?.isEnable && l
4216
4219
  };
4217
- }, ga = ut.createContext({
4220
+ }, _a = ut.createContext({
4218
4221
  navigate: null,
4219
4222
  carryFilters: []
4220
- }), _a = [], va = ({ children: e, isEnabled: t = !1, onNavigate: n, carryFilters: r }) => {
4221
- let i = r?.length ? r : _a, a = ut.useMemo(() => ({
4223
+ }), va = [], ya = ({ children: e, isEnabled: t = !1, onNavigate: n, carryFilters: r }) => {
4224
+ let i = r?.length ? r : va, a = ut.useMemo(() => ({
4222
4225
  navigate: t && n ? n : null,
4223
4226
  carryFilters: i
4224
4227
  }), [
@@ -4226,25 +4229,25 @@ var Xi = (e, t) => {
4226
4229
  n,
4227
4230
  i
4228
4231
  ]);
4229
- return /* @__PURE__ */ (0, oa.jsx)(ga.Provider, {
4232
+ return /* @__PURE__ */ (0, sa.jsx)(_a.Provider, {
4230
4233
  value: a,
4231
4234
  children: e
4232
4235
  });
4233
- }, ya = () => {
4234
- let { navigate: e, carryFilters: t } = ut.useContext(ga), n = ut.useCallback((n, r) => {
4236
+ }, ba = () => {
4237
+ let { navigate: e, carryFilters: t } = ut.useContext(_a), n = ut.useCallback((n, r) => {
4235
4238
  if (!e) return !1;
4236
4239
  let i = n?.clickActions?.chartWithDashboard;
4237
4240
  if (!i?.isEnable) return !1;
4238
- let a = ea({
4241
+ let a = ta({
4239
4242
  config: i,
4240
- value: ta(i, r),
4243
+ value: na(i, r),
4241
4244
  carryFilters: t
4242
4245
  });
4243
4246
  return a.ok ? (e(a.intent), !0) : (typeof a.reason == "object" && a.reason.code === "unsafe_target" && console.warn(`[chartNavigation] dashboard navigation rejected: ${a.reason.navigation}`), !1);
4244
4247
  }, [e, t]);
4245
4248
  return e ? n : null;
4246
- }, ba = (e) => {
4249
+ }, xa = (e) => {
4247
4250
  if (typeof e == "function") return (t) => e(t);
4248
4251
  };
4249
4252
  //#endregion
4250
- export { mt as $, Tr as A, Qn as B, Br as C, jr as D, Nr as E, Q as F, G, Gn as H, cr as I, K as J, On as K, ar as L, Cr as M, nr as N, Lr as O, or as P, Cn as Q, $n as R, Gr as S, Mr as T, Un as U, X as V, q as W, Tn as X, En as Y, Dn as Z, li as _, pa as a, Qr as b, ra as c, ea as d, ht as et, Zi as f, si as g, ui as h, ha as i, Sr as j, wr as k, ia as l, ki as m, ba as n, fa as o, Ji as p, J as q, ya as r, sa as s, va as t, na as u, Rr as v, Dr as w, ni as x, Zr as y, er as z };
4253
+ export { mt as $, Tr as A, Qn as B, Br as C, jr as D, Nr as E, Q as F, G, Gn as H, cr as I, K as J, On as K, ar as L, Cr as M, nr as N, Lr as O, or as P, Cn as Q, $n as R, Gr as S, Mr as T, Un as U, X as V, q as W, Tn as X, En as Y, Dn as Z, li as _, ma as a, Qr as b, ia as c, ta as d, ht as et, Qi as f, si as g, ui as h, ga as i, Sr as j, wr as k, aa as l, Ai as m, xa as n, pa as o, Yi as p, J as q, ba as r, ca as s, ya as t, ra as u, Rr as v, Dr as w, ni as x, Zr as y, er as z };