@databrainhq/plugin 0.17.9-beta.30 → 0.17.9-beta.31

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 (42) hide show
  1. package/dist/{Accordion-D3DbH3Cx.mjs → Accordion-BhLebRAm.mjs} +32 -25
  2. package/dist/{Chart-7AGA9h2g.mjs → Chart-BLXiGOie.mjs} +361 -361
  3. package/dist/{CreateGlobalFilter-oHjA0P9O.mjs → CreateGlobalFilter-DJ75cI8r.mjs} +200 -200
  4. package/dist/{CreateMetricV2-BGDt9B3L.mjs → CreateMetricV2-DNSbMIqg.mjs} +20 -20
  5. package/dist/{DraggableItem-7fQUo0x4.mjs → DraggableItem-HJ4Wt8qx.mjs} +11 -11
  6. package/dist/{HorizontalStackTable-CH68bWy3.mjs → HorizontalStackTable-DadBH16u.mjs} +17 -17
  7. package/dist/{ManageMetricsV2-tyQYXoAT.mjs → ManageMetricsV2-DQ0F-Sxo.mjs} +3 -3
  8. package/dist/{MetricCardV2-C2n6LzkA.mjs → MetricCardV2-ndXX9kcc.mjs} +1251 -1170
  9. package/dist/{NoDataFound-N3gF0Pse.mjs → NoDataFound-C6lIIOZF.mjs} +1 -1
  10. package/dist/{NoDataState-C6hX-CHr.mjs → NoDataState-Dx5ksEt-.mjs} +2 -2
  11. package/dist/{Panel-BeWefwKs.mjs → Panel-oW--_1YF.mjs} +1 -1
  12. package/dist/{PivotTableV2-De4TXsMc.mjs → PivotTableV2-BufQEGso.mjs} +2 -2
  13. package/dist/{PivotTableV3-2nzDp4Nc.mjs → PivotTableV3-DwleqfW7.mjs} +4 -4
  14. package/dist/{Portal-C4N01WKg.mjs → Portal-CuJ3yA9x.mjs} +1222 -1200
  15. package/dist/{RadioButton-DvzkXfzO.mjs → RadioButton-BagXnWOk.mjs} +1 -1
  16. package/dist/{ScheduleEmail-PEzbadHC.mjs → ScheduleEmail-C_H0_DNM.mjs} +220 -220
  17. package/dist/{SearchMetricData-CxmDM20t.mjs → SearchMetricData-DPWkvX0c.mjs} +237 -237
  18. package/dist/{SortPanel-DQjM_vyk.mjs → SortPanel-DctP-Eyd.mjs} +110 -110
  19. package/dist/{Table-CvDTChaZ.mjs → Table-BSKvdU4q.mjs} +4 -4
  20. package/dist/{TagInputField-C9M_Ip9e.mjs → TagInputField-B09tGuSM.mjs} +6 -6
  21. package/dist/{TextAreaField-Q78INHKO.mjs → TextAreaField-CLmioFXe.mjs} +113 -113
  22. package/dist/{TimeSeriesSettings-C8lvzgja.mjs → TimeSeriesSettings-BS9LodDk.mjs} +2 -2
  23. package/dist/{cardQueryError-3MGl4pbM.mjs → cardQueryError-Jo2LkSBF.mjs} +810 -790
  24. package/dist/{chevron-down-Dxhk-Tao.mjs → chevron-down-CTH4bR6n.mjs} +107 -106
  25. package/dist/{conditionalFormatting-BuG_4wOq.mjs → conditionalFormatting-BU6BaaPb.mjs} +1 -1
  26. package/dist/{createGlobalFilter.module-DisUwLsO.mjs → createGlobalFilter.module-Cw_A7yeo.mjs} +1 -1
  27. package/dist/data.cjs +1 -1
  28. package/dist/data.mjs +1 -1
  29. package/dist/{echarts-BE7AhqVy.mjs → echarts-Dw5Z2Ho-.mjs} +2 -2
  30. package/dist/{metric.mutation-BRWn1UMi.mjs → metric.mutation-cOoqy5Bi.mjs} +1 -1
  31. package/dist/{permissions-B5UHxn_4.mjs → permissions-CxZW60Bd.mjs} +289 -261
  32. package/dist/{pluginV3Request-Dfy8fkbS.mjs → pluginV3Request-CQzo3G0-.mjs} +1 -1
  33. package/dist/{renderer-qB-6Euan.mjs → renderer-D1fTygev.mjs} +1 -1
  34. package/dist/{timeseries-Clp-TrGQ.mjs → timeseries-D_nzmvUF.mjs} +1347 -1304
  35. package/dist/{toTasteAppearance-cIHX7fPm.mjs → toTasteAppearance-C4jy9fG3.mjs} +1 -1
  36. package/dist/{useGuesTokenUsageLog-BtooXte_.mjs → useGuesTokenUsageLog-BgjAaf3E.mjs} +1 -1
  37. package/dist/{usePublishArchivedMetrics-CM4KQARj.mjs → usePublishArchivedMetrics-CM7fUNzL.mjs} +2 -2
  38. package/dist/{useQuery-D3fpbSfw.mjs → useQuery-DhtsBbBi.mjs} +1 -1
  39. package/dist/webcomponents.css +2 -2
  40. package/dist/webcomponents.es.js +483 -459
  41. package/dist/webcomponents.umd.js +153 -153
  42. package/package.json +1 -1
@@ -3,17 +3,17 @@ import "react-dom";
3
3
  import "react-dom/client";
4
4
  import { o as e } from "./rolldown-runtime-C1JUX4Ur.mjs";
5
5
  import { c as t, s as n } from "./cardStates-DiUMQ7_o.mjs";
6
- import { Bt as r, It as i, Vt as a, Zt as o, a as s, c, l, m as u, u as d, zt as f } from "./pluginV3Request-Dfy8fkbS.mjs";
7
- import { $ as p, K as m, O as h, Q as g, U as _, X as v, Y as y, Z as b, a as ee, at as x, d as S, et as C, i as te, l as w, lt as T, q as E, s as ne, tt as D } from "./metric.mutation-BRWn1UMi.mjs";
8
- import { $t as re, Aa as ie, Bn as ae, Cn as oe, Fa as se, Fn as ce, Gn as le, Gt as ue, Ht as de, In as fe, It as pe, Jt as me, Ma as he, Mt as ge, Na as _e, Pt as ve, Rt as ye, Tn as be, Tr as O, Un as k, Vi as xe, Vn as Se, Wn as Ce, Wt as we, Yt as Te, _n as Ee, an as De, dn as Oe, en as ke, gr as Ae, hn as je, in as Me, ja as A, ji as Ne, jn as Pe, jt as Fe, ln as Ie, mn as Le, on as Re, pn as ze, qn as Be, qt as Ve, ra as He, ri as Ue, s as We, sn as Ge, ti as Ke, wa as j, wn as qe, xa as Je, xn as Ye, yt as Xe, zn as Ze, zt as Qe } from "./Portal-C4N01WKg.mjs";
9
- import { t as M } from "./useQuery-D3fpbSfw.mjs";
10
- import { i as $e } from "./chevron-down-Dxhk-Tao.mjs";
11
- import { n as et } from "./timeseries-Clp-TrGQ.mjs";
6
+ import { Bt as r, It as i, Vt as a, Zt as o, a as s, c, l, m as u, u as d, zt as f } from "./pluginV3Request-CQzo3G0-.mjs";
7
+ import { $ as p, K as m, O as h, Q as g, U as _, X as v, Y as y, Z as b, a as ee, at as x, d as S, et as C, i as te, l as w, lt as T, q as E, s as ne, tt as D } from "./metric.mutation-cOoqy5Bi.mjs";
8
+ import { $t as re, Aa as ie, Bn as ae, Cn as oe, Fa as se, Fn as ce, Gn as le, Gt as ue, Ht as de, In as fe, It as pe, Jt as me, Ma as he, Mt as ge, Na as _e, Pt as ve, Rt as ye, Tn as be, Tr as O, Un as k, Vi as xe, Vn as Se, Wn as Ce, Wt as we, Yt as Te, _n as Ee, an as De, dn as Oe, en as ke, gr as Ae, hn as je, in as Me, ja as A, ji as Ne, jn as Pe, jt as Fe, ln as Ie, mn as Le, on as Re, pn as ze, qn as Be, qt as Ve, ra as He, ri as Ue, s as We, sn as Ge, ti as Ke, wa as j, wn as qe, xa as Je, xn as Ye, yt as Xe, zn as Ze, zt as Qe } from "./Portal-CuJ3yA9x.mjs";
9
+ import { t as M } from "./useQuery-DhtsBbBi.mjs";
10
+ import { i as $e } from "./chevron-down-CTH4bR6n.mjs";
11
+ import { n as et } from "./timeseries-D_nzmvUF.mjs";
12
12
  import { i as tt } from "./text-CtrvkDIo.mjs";
13
- import { a as nt, r as rt, s as it } from "./permissions-B5UHxn_4.mjs";
14
- import { f as at, o as ot } from "./RadioButton-DvzkXfzO.mjs";
13
+ import { a as nt, r as rt, s as it } from "./permissions-CxZW60Bd.mjs";
14
+ import { f as at, o as ot } from "./RadioButton-BagXnWOk.mjs";
15
15
  import { r as st } from "./cardActions-BLBLsjcd.mjs";
16
- import { t as ct } from "./TimeSeriesSettings-C8lvzgja.mjs";
16
+ import { t as ct } from "./TimeSeriesSettings-BS9LodDk.mjs";
17
17
  import { t as lt } from "./createLucideIcon-C-N26TaJ.mjs";
18
18
  import * as ut from "react";
19
19
  import { createContext as dt, useCallback as N, useContext as ft, useEffect as P, useLayoutEffect as pt, useMemo as F, useRef as I, useState as L } from "react";
@@ -419,11 +419,11 @@ var gt = (e, t) => {
419
419
  type: "inactive"
420
420
  });
421
421
  }
422
- }, tn = /* @__PURE__ */ new WeakSet(), nn = (e) => {
423
- if (tn.has(e)) return;
424
- tn.add(e);
422
+ }, V = /* @__PURE__ */ new WeakSet(), tn = (e) => {
423
+ if (V.has(e)) return;
424
+ V.add(e);
425
425
  let t = () => {
426
- tn.delete(e), en(e);
426
+ V.delete(e), en(e);
427
427
  }, n = globalThis.scheduler;
428
428
  if (typeof n?.postTask == "function") {
429
429
  n.postTask(t, { priority: "background" });
@@ -434,43 +434,43 @@ var gt = (e, t) => {
434
434
  return;
435
435
  }
436
436
  setTimeout(t, 0);
437
- }, V = (e) => {
437
+ }, H = (e) => {
438
438
  let t = Object.getPrototypeOf(e);
439
439
  return (t === Object.prototype || t === null) && !("toJSON" in e);
440
- }, rn = (e, t) => {
440
+ }, U = (e, t) => {
441
441
  if (e === t) return !0;
442
442
  if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
443
443
  if (Array.isArray(e)) {
444
444
  if (!Array.isArray(t) || e.length !== t.length) return !1;
445
- for (let n = 0; n < e.length; n += 1) if (!rn(e[n], t[n])) return !1;
445
+ for (let n = 0; n < e.length; n += 1) if (!U(e[n], t[n])) return !1;
446
446
  return !0;
447
447
  }
448
- if (Array.isArray(t) || !V(e) || !V(t)) return !1;
448
+ if (Array.isArray(t) || !H(e) || !H(t)) return !1;
449
449
  let n = Object.keys(e);
450
450
  if (n.length !== Object.keys(t).length) return !1;
451
- for (let r of n) if (!Object.hasOwn(t, r) || !rn(e[r], t[r])) return !1;
451
+ for (let r of n) if (!Object.hasOwn(t, r) || !U(e[r], t[r])) return !1;
452
452
  return !0;
453
- }, H = "dbn:metric-query:guest-principal:v1", an = 8, U = /* @__PURE__ */ new Map(), on = (e) => {
453
+ }, nn = "dbn:metric-query:guest-principal:v1", rn = 8, W = /* @__PURE__ */ new Map(), an = (e) => {
454
454
  if (!e) return;
455
- let t = U.get(e);
455
+ let t = W.get(e);
456
456
  if (t !== void 0) return t;
457
- let n = bt.default.HmacSHA256(e, H).toString(bt.default.enc.Hex);
458
- if (U.size >= an) {
459
- let e = U.keys().next().value;
460
- e !== void 0 && U.delete(e);
457
+ let n = bt.default.HmacSHA256(e, nn).toString(bt.default.enc.Hex);
458
+ if (W.size >= rn) {
459
+ let e = W.keys().next().value;
460
+ e !== void 0 && W.delete(e);
461
461
  }
462
- return U.set(e, n), n;
463
- }, sn = "dbn:metric-query:client-scope:v1", cn = 16, ln = /* @__PURE__ */ new Map(), un = (e) => {
462
+ return W.set(e, n), n;
463
+ }, on = "dbn:metric-query:client-scope:v1", sn = 16, cn = /* @__PURE__ */ new Map(), ln = (e) => {
464
464
  if (!e) return;
465
- let t = ln.get(e);
465
+ let t = cn.get(e);
466
466
  if (t !== void 0) return t;
467
- let n = bt.default.HmacSHA256(e, sn).toString(bt.default.enc.Hex);
468
- if (ln.size >= cn) {
469
- let e = ln.keys().next().value;
470
- e !== void 0 && ln.delete(e);
467
+ let n = bt.default.HmacSHA256(e, on).toString(bt.default.enc.Hex);
468
+ if (cn.size >= sn) {
469
+ let e = cn.keys().next().value;
470
+ e !== void 0 && cn.delete(e);
471
471
  }
472
- return ln.set(e, n), n;
473
- }, dn = [
472
+ return cn.set(e, n), n;
473
+ }, un = [
474
474
  "updatedAt",
475
475
  "query",
476
476
  "metricQuery",
@@ -483,56 +483,56 @@ var gt = (e, t) => {
483
483
  "groupBy",
484
484
  "selectedGroupBy",
485
485
  "timeGrain"
486
- ], fn = /* @__PURE__ */ new WeakMap(), pn = (e) => {
486
+ ], dn = /* @__PURE__ */ new WeakMap(), fn = (e) => {
487
487
  if (!e) return;
488
- let t = fn.get(e);
488
+ let t = dn.get(e);
489
489
  if (t !== void 0) return t;
490
- let n = e, r = bt.default.SHA256(JSON.stringify(dn.map((e) => n[e] ?? null))).toString(bt.default.enc.Hex).slice(0, 16);
491
- return fn.set(e, r), r;
492
- }, mn = (e, t, n) => {
490
+ let n = e, r = bt.default.SHA256(JSON.stringify(un.map((e) => n[e] ?? null))).toString(bt.default.enc.Hex).slice(0, 16);
491
+ return dn.set(e, r), r;
492
+ }, G = (e, t, n) => {
493
493
  if (!t) return e;
494
- let r = un(n);
494
+ let r = ln(n);
495
495
  return r ? { clientScope: r } : e;
496
- }, hn = ({ queryName: e, data: t, clientId: n, clientCacheScope: r, isFrontendApp: i, token: a, isFullScreen: o, metricRevision: s }) => [
496
+ }, pn = ({ queryName: e, data: t, clientId: n, clientCacheScope: r, isFrontendApp: i, token: a, isFullScreen: o, metricRevision: s }) => [
497
497
  e,
498
498
  t,
499
- mn(n, i, r),
499
+ G(n, i, r),
500
500
  i,
501
- a ? { guestPrincipal: on(a) } : void 0,
501
+ a ? { guestPrincipal: an(a) } : void 0,
502
502
  o,
503
503
  s
504
- ], gn = (e, t) => !e || !!t, _n = /* @__PURE__ */ new WeakMap(), vn = 512, yn = /* @__PURE__ */ new Map(), W = (e) => {
504
+ ], mn = (e, t) => !e || !!t, hn = /* @__PURE__ */ new WeakMap(), gn = 512, _n = /* @__PURE__ */ new Map(), vn = (e) => {
505
505
  switch (typeof e) {
506
506
  case "string": return JSON.stringify(e);
507
507
  case "boolean": return e ? "true" : "false";
508
508
  case "undefined": return "null";
509
509
  default: return h([e]).slice(1, -1);
510
510
  }
511
- }, bn = (e, t, n) => {
512
- if (yn.delete(e), yn.size >= vn) {
513
- let e = yn.keys().next().value;
514
- e !== void 0 && yn.delete(e);
511
+ }, yn = (e, t, n) => {
512
+ if (_n.delete(e), _n.size >= gn) {
513
+ let e = _n.keys().next().value;
514
+ e !== void 0 && _n.delete(e);
515
515
  }
516
- yn.set(e, {
516
+ _n.set(e, {
517
517
  payload: t,
518
518
  hash: n
519
519
  });
520
- }, xn = (e) => {
521
- if (typeof e != "object" || !e) return W(e);
522
- let t = _n.get(e);
520
+ }, bn = (e) => {
521
+ if (typeof e != "object" || !e) return vn(e);
522
+ let t = hn.get(e);
523
523
  if (t !== void 0) return t;
524
- let n = e.id, r = typeof n == "string" ? yn.get(n) : void 0, i = r && rn(r.payload, e) ? r.hash : W(e);
525
- return _n.set(e, i), typeof n == "string" && bn(n, e, i), i;
526
- }, Sn = (e) => `[${e.map((e, t) => t === 1 ? xn(e) : W(e)).join(",")}]`, Cn = ({ queryName: e, workspaceId: t, guestToken: n, isFrontendApp: r, encryptedClientId: i }) => [
524
+ let n = e.id, r = typeof n == "string" ? _n.get(n) : void 0, i = r && U(r.payload, e) ? r.hash : vn(e);
525
+ return hn.set(e, i), typeof n == "string" && yn(n, e, i), i;
526
+ }, xn = (e) => `[${e.map((e, t) => t === 1 ? bn(e) : vn(e)).join(",")}]`, K = ({ queryName: e, workspaceId: t, guestToken: n, isFrontendApp: r, encryptedClientId: i }) => [
527
527
  e,
528
528
  t,
529
529
  {
530
- guestPrincipal: on(n),
530
+ guestPrincipal: an(n),
531
531
  isFrontendApp: r,
532
532
  encryptedClientId: i
533
533
  }
534
- ], wn = ({ clientId: e, clientCacheScope: n, metricRevision: r, data: i, token: a, isFrontendApp: s, isFullScreen: c = "", batchHints: l, savedMetricQuery: u, savedMetricIdentifiers: d, dbName: m, timeoutMs: h = Dt }, v) => {
535
- let y = _(), b = ft(Xt), ee = !!i.id && !v?.isDisableQuery && (!s || !!e), x = hn({
534
+ ], Sn = ({ clientId: e, clientCacheScope: n, metricRevision: r, data: i, token: a, isFrontendApp: s, isFullScreen: c = "", batchHints: l, savedMetricQuery: u, savedMetricIdentifiers: d, dbName: m, timeoutMs: h = Dt }, v) => {
535
+ let y = _(), b = ft(Xt), ee = !!i.id && !v?.isDisableQuery && (!s || !!e), x = pn({
536
536
  queryName: f,
537
537
  data: i,
538
538
  clientId: e,
@@ -590,7 +590,7 @@ var gt = (e, t) => {
590
590
  });
591
591
  }, C = M({
592
592
  queryKey: x,
593
- queryKeyHashFn: Sn,
593
+ queryKeyHashFn: xn,
594
594
  queryFn: () => (D() && p("metric-query-dispatch", {
595
595
  metricId: i?.id,
596
596
  payload: T(i)
@@ -614,11 +614,11 @@ var gt = (e, t) => {
614
614
  single: S
615
615
  })),
616
616
  enabled: ee,
617
- meta: a || !gn(s, n) ? { persist: !1 } : void 0,
617
+ meta: a || !mn(s, n) ? { persist: !1 } : void 0,
618
618
  retry: (e, n) => t(n).code !== "UNAUTHORIZED_ORIGIN" && !g(n) && e < 2,
619
619
  staleTime: 3e5,
620
620
  gcTime: 9e5
621
- }), te = Sn(x), w = F(() => ({
621
+ }), te = xn(x), w = F(() => ({
622
622
  queryHash: te,
623
623
  dataUpdatedAt: C.dataUpdatedAt,
624
624
  errorUpdatedAt: C.errorUpdatedAt,
@@ -647,8 +647,8 @@ var gt = (e, t) => {
647
647
  responseDataType: typeof e?.data,
648
648
  responseRowCount: Array.isArray(e?.data) ? e?.data?.length : void 0,
649
649
  totalRecords: e?.totalRecords
650
- }), re.current?.onSuccess?.(e), nn(y);
651
- }, [w, y]), P(() => () => nn(y), [y]), P(() => {
650
+ }), re.current?.onSuccess?.(e), tn(y);
651
+ }, [w, y]), P(() => () => tn(y), [y]), P(() => {
652
652
  if (w.fetchStatus !== "idle" || !w.isSuccess && !w.isError) return;
653
653
  let e = w.data, t = w.error;
654
654
  D() && p("metric-query-settled", {
@@ -659,15 +659,15 @@ var gt = (e, t) => {
659
659
  responseRowCount: Array.isArray(e?.data) ? e?.data?.length : void 0
660
660
  }), re.current?.onSettled?.(e, t);
661
661
  }, [w]), C;
662
- }, Tn = async ({ workspaceId: e, token: t, isFrontend: n, encryptedClientId: i }) => (n && await l(), E(`${r}?id=${e}`, {
662
+ }, q = async ({ workspaceId: e, token: t, isFrontend: n, encryptedClientId: i }) => (n && await l(), E(`${r}?id=${e}`, {
663
663
  method: "GET",
664
664
  token: n ? "" : t || "",
665
665
  isFrontend: n,
666
666
  clientId: i
667
- })), En = (e, t, n, r) => {
667
+ })), Cn = (e, t, n, r) => {
668
668
  let { token: i } = se(), o = n ? "" : t || i || "";
669
669
  return M({
670
- queryKey: Cn({
670
+ queryKey: K({
671
671
  queryName: a,
672
672
  workspaceId: e,
673
673
  guestToken: o,
@@ -675,7 +675,7 @@ var gt = (e, t) => {
675
675
  encryptedClientId: r
676
676
  }),
677
677
  meta: { persist: !1 },
678
- queryFn: () => Tn({
678
+ queryFn: () => q({
679
679
  workspaceId: e,
680
680
  token: o,
681
681
  isFrontend: n,
@@ -683,17 +683,17 @@ var gt = (e, t) => {
683
683
  }),
684
684
  enabled: !!e
685
685
  });
686
- }, G = ({ language: e, translationDictionary: t }) => !e || !t ? !1 : Object.values(t).some((t) => !!t?.[e]), K = ({ language: e, translationDictionary: t }) => !G({
686
+ }, wn = ({ language: e, translationDictionary: t }) => !e || !t ? !1 : Object.values(t).some((t) => !!t?.[e]), Tn = ({ language: e, translationDictionary: t }) => !wn({
687
687
  language: e,
688
688
  translationDictionary: t
689
- }), Dn = ({ language: e, tableLimit: t, translationDictionary: n }) => K({
689
+ }), En = ({ language: e, tableLimit: t, translationDictionary: n }) => Tn({
690
690
  language: e,
691
691
  translationDictionary: n
692
692
  }) ? {
693
693
  limit: String(t.limit),
694
694
  offset: String(t.offset)
695
- } : {}, On = ({ language: e, search: t, searchColumns: n, translationDictionary: r }) => {
696
- if (!K({
695
+ } : {}, J = ({ language: e, search: t, searchColumns: n, translationDictionary: r }) => {
696
+ if (!Tn({
697
697
  language: e,
698
698
  translationDictionary: r
699
699
  })) return {};
@@ -702,13 +702,13 @@ var gt = (e, t) => {
702
702
  search: i && a ? i : void 0,
703
703
  searchColumns: i && a ? n : void 0
704
704
  };
705
- }, kn = ({ currentSearchValue: e, nextValue: t, shouldUseServerSideSearch: n, tableLimit: r }) => {
705
+ }, Dn = ({ currentSearchValue: e, nextValue: t, shouldUseServerSideSearch: n, tableLimit: r }) => {
706
706
  let i = String(t).trim() !== (e || "").trim(), a = r.offset !== 0;
707
707
  return {
708
708
  shouldResetPageOffset: a,
709
709
  shouldSetTablePending: a || n && i
710
710
  };
711
- }, q = ({ isPythonMode: e, search: t, shouldUseServerSideSearch: n }) => e ? !0 : !n, An = ({ columnName: e, disableDownloadUnderlyingDataNoFilters: t, isLoading: n, isSingleValueChart: r }) => !n && !t && !!(e || r), jn = ({ isPrev: e, nextOffset: t, prev: n, resetValue: r }) => r === void 0 ? t === void 0 ? {
711
+ }, On = ({ isPythonMode: e, search: t, shouldUseServerSideSearch: n }) => e ? !0 : !n, kn = ({ columnName: e, disableDownloadUnderlyingDataNoFilters: t, isLoading: n, isSingleValueChart: r }) => !n && !t && !!(e || r), An = ({ isPrev: e, nextOffset: t, prev: n, resetValue: r }) => r === void 0 ? t === void 0 ? {
712
712
  limit: n.limit,
713
713
  offset: e ? Math.max(n.offset - n.limit, 0) : n.offset + n.limit
714
714
  } : {
@@ -717,15 +717,15 @@ var gt = (e, t) => {
717
717
  } : {
718
718
  limit: r,
719
719
  offset: 0
720
- }, Mn = (e) => e == null ? e : Pe(e.toString()), Nn = (e, t) => [...e ?? [], ...t ?? []].some((e) => !!e?.columnName && e.value !== void 0), Pn = (e = []) => e.filter((e) => e?.columnName && e.value !== void 0), Fn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => {
721
- let o = Pn(n);
720
+ }, jn = (e) => e == null ? e : Pe(e.toString()), Mn = (e, t) => [...e ?? [], ...t ?? []].some((e) => !!e?.columnName && e.value !== void 0), Nn = (e = []) => e.filter((e) => e?.columnName && e.value !== void 0), Y = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => {
721
+ let o = Nn(n);
722
722
  return i || !e || a === void 0 ? o : [...o.filter((t) => t.columnName !== e || String(t.value) !== String(a)), {
723
723
  columnName: e,
724
724
  dataType: t,
725
725
  expressionSql: r,
726
726
  value: a
727
727
  }];
728
- }, In = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => Fn({
728
+ }, Pn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => Y({
729
729
  columnName: e,
730
730
  dataType: t,
731
731
  drillFilters: n,
@@ -736,30 +736,30 @@ var gt = (e, t) => {
736
736
  columnName: e.columnName,
737
737
  dataType: e.dataType,
738
738
  expressionSql: e.expressionSql,
739
- value: Mn(e.value)
740
- })), J = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => Fn({
739
+ value: jn(e.value)
740
+ })), Fn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => Y({
741
741
  columnName: e,
742
742
  dataType: t,
743
743
  drillFilters: n,
744
744
  expressionSql: r,
745
745
  isSingleValueChart: i,
746
746
  value: a
747
- }), Ln = ({ query: e, limit: t, offset: n, dbName: r }) => {
747
+ }), In = ({ query: e, limit: t, offset: n, dbName: r }) => {
748
748
  let i = Ae === r?.toLowerCase(), a = [Ue, Ke].includes(r?.toLowerCase() || ""), o = Ne === r?.toLowerCase(), s = (e) => n ? `OFFSET ${n} LIMIT ${e}` : `LIMIT ${e}`, c = St(e), l = (c?.toLowerCase() ?? "").includes("order"), u = parseInt(t, 10);
749
749
  if (c?.toLowerCase().includes("limit")) {
750
750
  let e = parseInt(c?.toLowerCase().split("limit")?.[1]?.trim() ?? "0", 10), r = n ? t : Math.min(e, u);
751
751
  o ? (c = c.replace(`limit ${e}`, s(r)), c = c.replace(`LIMIT ${e}`, s(r))) : a || i ? (c = c.replace(`limit ${e}`, `${l || i || o ? "" : "order by(select null)"} ${`offset ${n || 0} rows`} fetch next ${r} rows only`), c = c.replace(`LIMIT ${e}`, `${l || i || o ? "" : " ORDER BY(SELECT NULL) "} OFFSET ${n || 0} ROWS FETCH NEXT ${r} ROWS ONLY`)) : (c = c.replace(`limit ${e}`, `limit ${r} ${n ? `OFFSET ${n}` : ""}`), c = c.replace(`LIMIT ${e}`, `LIMIT ${r} ${n ? `OFFSET ${n}` : ""}`));
752
752
  } else c?.toLowerCase().includes("fetch") || c?.toLowerCase().includes("limit") || (r?.toLowerCase() === "mssql" || r?.toLowerCase() === "athena" || r?.toLowerCase() === "microsoft fabric" ? c += ` ${l || i || o ? "" : " ORDER BY(SELECT NULL) "} ${`offset ${n || 0} rows`} fetch next ${u} rows only` : c += o ? ` ${s(u)}` : ` limit ${u} ${n ? `OFFSET ${n}` : ""}`);
753
753
  return c;
754
- }, Rn = (e) => {
754
+ }, Ln = (e) => {
755
755
  try {
756
756
  return JSON.stringify(e);
757
757
  } catch {
758
758
  return String(Date.now()) + ":" + Math.random().toString(36).slice(2);
759
759
  }
760
- }, zn = (e, t) => {
760
+ }, Rn = (e, t) => {
761
761
  if (t?.error && !(Array.isArray(t?.data) && t.data.length)) {
762
- Bn(e, t.error);
762
+ zn(e, t.error);
763
763
  return;
764
764
  }
765
765
  let n = t?.data, r = typeof t?.totalRecords == "number" ? t.totalRecords : 0, i = n && Array.isArray(n) && n.length ? n : [];
@@ -767,13 +767,13 @@ var gt = (e, t) => {
767
767
  e.setTotalRecords?.(r), e.setData(i), e.setLoading(!1);
768
768
  });
769
769
  };
770
- function Bn(e, t) {
770
+ function zn(e, t) {
771
771
  e.forEach((e) => {
772
772
  e.onError?.(t), e.setData([]), e.setLoading(!1), e.setTotalRecords?.(0);
773
773
  });
774
774
  }
775
- var Vn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i, query: a, companyId: o, workspaceId: s, metricId: c, dashboardId: l, token: u, isFrontendApp: d, encryptedClientId: f, globalFilters: p, isAllClient: m, rlsConditions: h, dataMartRelationships: g, customSql: _, isEnableCustomSQL: v, drillFilters: y }) => {
776
- let { mutateAsync: b } = w(), { data: ee } = En(s, void 0, d, f), x = ee?.weekStartDay === "sunday" ? "sunday" : "monday", S = I(/* @__PURE__ */ new Map()), C = I({
775
+ var Bn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i, query: a, companyId: o, workspaceId: s, metricId: c, dashboardId: l, token: u, isFrontendApp: d, encryptedClientId: f, globalFilters: p, isAllClient: m, rlsConditions: h, dataMartRelationships: g, customSql: _, isEnableCustomSQL: v, drillFilters: y }) => {
776
+ let { mutateAsync: b } = w(), { data: ee } = Cn(s, void 0, d, f), x = ee?.weekStartDay === "sunday" ? "sunday" : "monday", S = I(/* @__PURE__ */ new Map()), C = I({
777
777
  token: u,
778
778
  epoch: 0
779
779
  });
@@ -788,7 +788,7 @@ var Vn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
788
788
  e.clear();
789
789
  };
790
790
  }, []), { getUnderlyingData: N(({ columnName: ee, dataType: C, expressionSql: w, value: T, setData: E, setLoading: ne, isSingleValueChart: D, clientColumnType: re, limit: ie, offset: ae, search: se, searchColumns: ce, setTotalRecords: le, pointFilters: ue, onError: de, withoutFilters: fe }) => {
791
- let pe = r === "MULTI_DATABASE" && t || "", me = v && _ ? _ : ie !== void 0 || ae !== void 0 ? a : Ln({
791
+ let pe = r === "MULTI_DATABASE" && t || "", me = v && _ ? _ : ie !== void 0 || ae !== void 0 ? a : In({
792
792
  query: a,
793
793
  limit: "5000",
794
794
  dbName: n
@@ -807,7 +807,7 @@ var Vn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
807
807
  isAllClient: m,
808
808
  dataMartRelationships: g,
809
809
  weekStartDay: x
810
- }), ye = D && !v ? at(ve) : ve, be = Nn(y, ue) ? In({
810
+ }), ye = D && !v ? at(ve) : ve, be = Mn(y, ue) ? Pn({
811
811
  columnName: ee,
812
812
  dataType: C,
813
813
  drillFilters: ue?.length ? [...y ?? [], ...ue] : y,
@@ -820,7 +820,7 @@ var Vn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
820
820
  query: he(ye, o),
821
821
  dataType: D ? void 0 : C,
822
822
  expressionSql: D ? void 0 : w,
823
- value: D ? void 0 : Mn(T),
823
+ value: D ? void 0 : jn(T),
824
824
  drillFilters: be.length ? be : void 0,
825
825
  workspaceId: s,
826
826
  metricId: c,
@@ -838,7 +838,7 @@ var Vn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
838
838
  isSingleValueChart: D && !v
839
839
  };
840
840
  E([]), ne(!0);
841
- let k = Rn({
841
+ let k = Ln({
842
842
  columnName: O.columnName,
843
843
  value: O.value,
844
844
  dataType: O.dataType,
@@ -876,10 +876,10 @@ var Vn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
876
876
  encryptedClientId: d && f || ""
877
877
  }).then((e) => {
878
878
  let t = S.current.get(k);
879
- S.current.delete(k), zn(t?.subscribers ?? Ce, e);
879
+ S.current.delete(k), Rn(t?.subscribers ?? Ce, e);
880
880
  }).catch((e) => {
881
881
  let t = S.current.get(k);
882
- S.current.delete(k), Bn(t?.subscribers ?? Ce, e);
882
+ S.current.delete(k), zn(t?.subscribers ?? Ce, e);
883
883
  });
884
884
  }, [
885
885
  t,
@@ -906,15 +906,15 @@ var Vn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
906
906
  x,
907
907
  s
908
908
  ]) };
909
- }, Hn = [
909
+ }, Vn = [
910
910
  "backend-cap",
911
911
  "metric-limit",
912
912
  "client-window",
913
913
  "chart-coverage"
914
- ], Un = (e) => typeof e == "string" && Hn.includes(e), Y = (e) => typeof e == "number" && Number.isFinite(e) && e >= 0, Wn = (e) => e.of === null ? Infinity : Math.max(0, e.of - e.at), Gn = (e) => {
915
- let t = e[0], n = Wn(t);
914
+ ], Hn = (e) => typeof e == "string" && Vn.includes(e), Un = (e) => typeof e == "number" && Number.isFinite(e) && e >= 0, X = (e) => e.of === null ? Infinity : Math.max(0, e.of - e.at), Wn = (e) => {
915
+ let t = e[0], n = X(t);
916
916
  for (let r = 1; r < e.length; r += 1) {
917
- let i = Wn(e[r]);
917
+ let i = X(e[r]);
918
918
  i > n && (t = e[r], n = i);
919
919
  }
920
920
  return {
@@ -923,7 +923,7 @@ var Vn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i
923
923
  by: t.by,
924
924
  stages: e
925
925
  };
926
- }, X = (e) => ({
926
+ }, Gn = (e) => ({
927
927
  rows: e,
928
928
  truncated: null
929
929
  });
@@ -937,7 +937,7 @@ function Kn(e, t, n) {
937
937
  };
938
938
  return {
939
939
  rows: n,
940
- truncated: Gn(e.truncated ? [...e.truncated.stages, a] : [a])
940
+ truncated: Wn(e.truncated ? [...e.truncated.stages, a] : [a])
941
941
  };
942
942
  }
943
943
  function qn(e, t) {
@@ -946,44 +946,44 @@ function qn(e, t) {
946
946
  for (let e of r) {
947
947
  if (!e || typeof e != "object") continue;
948
948
  let { by: t, at: n, of: r } = e;
949
- Un(t) && Y(n) && i.push({
949
+ Hn(t) && Un(n) && i.push({
950
950
  by: t,
951
951
  at: n,
952
- of: Y(r) ? r : null
952
+ of: Un(r) ? r : null
953
953
  });
954
954
  }
955
955
  if (!i.length) {
956
- if (!Un(n.by) || !Y(n.at)) return null;
956
+ if (!Hn(n.by) || !Un(n.at)) return null;
957
957
  i.push({
958
958
  by: n.by,
959
959
  at: n.at,
960
- of: Y(n.of) ? n.of : null
960
+ of: Un(n.of) ? n.of : null
961
961
  });
962
962
  }
963
- if (Y(t)) {
963
+ if (Un(t)) {
964
964
  let e = i[i.length - 1];
965
965
  e.at !== t && (i[i.length - 1] = {
966
966
  ...e,
967
967
  at: t
968
968
  });
969
969
  }
970
- return Gn(i);
970
+ return Wn(i);
971
971
  }
972
972
  function Jn(e, t = (e) => e.toLocaleString()) {
973
973
  return e ? e.of === null ? `Displaying the first ${t(e.at)} rows` : `Displaying ${t(e.at)} of ${t(e.of)}` : null;
974
974
  }
975
975
  //#endregion
976
976
  //#region src/components/Chart/metricCardResult.ts
977
- var Yn = { rows: [] }, Z = {
977
+ var Yn = { rows: [] }, Xn = {
978
978
  rows: [],
979
979
  error: {
980
980
  code: "INVALID_METRIC_RESULT",
981
981
  message: "Could not load chart data.",
982
982
  hint: "Retry the chart. If it still fails, contact your workspace admin."
983
983
  }
984
- }, Xn = (e) => typeof e == "object" && !!e && !Array.isArray(e), Zn = (e) => {
984
+ }, Zn = (e) => typeof e == "object" && !!e && !Array.isArray(e), Qn = (e) => {
985
985
  if (e == null) return Yn;
986
- if (!Xn(e)) return Z;
986
+ if (!Zn(e)) return Xn;
987
987
  let t = e.errorDetail ? n(e) ?? e.error : e.error, r = e.data;
988
988
  if (typeof r == "string") try {
989
989
  r = JSON.parse(r);
@@ -991,9 +991,9 @@ var Yn = { rows: [] }, Z = {
991
991
  return t ? {
992
992
  rows: [],
993
993
  error: t
994
- } : Z;
994
+ } : Xn;
995
995
  }
996
- if (Xn(r) && (r.error || r.errorDetail)) return {
996
+ if (Zn(r) && (r.error || r.errorDetail)) return {
997
997
  rows: [],
998
998
  error: r.errorDetail ? n(r) ?? r.error : r.error
999
999
  };
@@ -1001,33 +1001,33 @@ var Yn = { rows: [] }, Z = {
1001
1001
  rows: [],
1002
1002
  error: t
1003
1003
  };
1004
- if (Xn(r) && typeof r.code == "string" && typeof r.message == "string") return {
1004
+ if (Zn(r) && typeof r.code == "string" && typeof r.message == "string") return {
1005
1005
  rows: [],
1006
1006
  error: {
1007
1007
  code: r.code,
1008
1008
  message: r.message
1009
1009
  }
1010
1010
  };
1011
- if (!Array.isArray(r) || !r.every(Xn)) return Z;
1012
- let i = Array.isArray(e.notices) && e.notices.some((e) => Xn(e) && e.code === "FILTER_NOT_APPLIED");
1011
+ if (!Array.isArray(r) || !r.every(Zn)) return Xn;
1012
+ let i = Array.isArray(e.notices) && e.notices.some((e) => Zn(e) && e.code === "FILTER_NOT_APPLIED");
1013
1013
  return {
1014
1014
  rows: r,
1015
1015
  ...i ? { isFilterNotApplied: !0 } : {}
1016
1016
  };
1017
- }, Qn = "__dbnFullscreenDrillState", $n = (e) => typeof e == "object" && !!e, er = (e) => Array.isArray(e), tr = (e, t) => ({
1017
+ }, $n = "__dbnFullscreenDrillState", er = (e) => typeof e == "object" && !!e, tr = (e) => Array.isArray(e), nr = (e, t) => ({
1018
1018
  ...e,
1019
1019
  ...t,
1020
1020
  metric: {
1021
1021
  ...e.metric,
1022
- [Qn]: t
1022
+ [$n]: t
1023
1023
  }
1024
- }), nr = (e, t = {}) => {
1025
- let n = $n(e) && $n(e.__dbnFullscreenDrillState) ? e[Qn] : {};
1024
+ }), Z = (e, t = {}) => {
1025
+ let n = er(e) && er(e.__dbnFullscreenDrillState) ? e[$n] : {};
1026
1026
  return {
1027
1027
  drilledLevel: t.drilledLevel ?? (typeof n.drilledLevel == "number" ? n.drilledLevel : void 0),
1028
- drillFilters: t.drillFilters ?? (er(n.drillFilters) ? n.drillFilters : void 0),
1028
+ drillFilters: t.drillFilters ?? (tr(n.drillFilters) ? n.drillFilters : void 0),
1029
1029
  drillType: t.drillType ?? (typeof n.drillType == "string" ? n.drillType : void 0),
1030
- underlyingDataDrillFilters: t.underlyingDataDrillFilters ?? (er(n.underlyingDataDrillFilters) ? n.underlyingDataDrillFilters : void 0)
1030
+ underlyingDataDrillFilters: t.underlyingDataDrillFilters ?? (tr(n.underlyingDataDrillFilters) ? n.underlyingDataDrillFilters : void 0)
1031
1031
  };
1032
1032
  }, rr = (e, t) => {
1033
1033
  if (!e || e.isEnableGroupBy === !1 || t.drilledLevel === void 0 && t.drillFilters === void 0 && t.drillType === void 0 && t.underlyingDataDrillFilters === void 0) return e;
@@ -1051,15 +1051,15 @@ var Yn = { rows: [] }, Z = {
1051
1051
  }))
1052
1052
  }
1053
1053
  };
1054
- }, ir = (e) => e.includes(";;") ? e.split(";;") : e, Q = (e, t) => e === void 0 ? t : [...Array.isArray(e) ? e : [e], ...Array.isArray(t) ? t : [t]], ar = [
1054
+ }, ir = (e) => e.includes(";;") ? e.split(";;") : e, ar = (e, t) => e === void 0 ? t : [...Array.isArray(e) ? e : [e], ...Array.isArray(t) ? t : [t]], or = [
1055
1055
  "dashboardId",
1056
1056
  "configId",
1057
1057
  "embed",
1058
1058
  "isDbn"
1059
- ], or = (e) => `dbn.${e}.`, sr = "drill.", cr = (e) => {
1059
+ ], sr = (e) => `dbn.${e}.`, cr = "drill.", lr = (e) => {
1060
1060
  let t = encodeURIComponent(e.levelIndex);
1061
1061
  return e.filters?.length ? `${t}~${e.filters.map((e) => `${encodeURIComponent(e.columnName)}:${encodeURIComponent(String(e.value ?? ""))}`).join("|")}` : t;
1062
- }, lr = (e) => {
1062
+ }, ur = (e) => {
1063
1063
  if (!e) return null;
1064
1064
  let t = e.indexOf("~"), n = t === -1 ? e : e.slice(0, t), r = decodeURIComponent(n);
1065
1065
  return r ? t === -1 ? {
@@ -1077,18 +1077,18 @@ var Yn = { rows: [] }, Z = {
1077
1077
  } : null;
1078
1078
  }).filter((e) => e !== null)
1079
1079
  } : null;
1080
- }, ur = (e, t) => {
1080
+ }, dr = (e, t) => {
1081
1081
  if (!t) return {};
1082
- let n = `${or(t)}${sr}`, r = {};
1082
+ let n = `${sr(t)}${cr}`, r = {};
1083
1083
  return new URLSearchParams(e).forEach((e, t) => {
1084
1084
  if (!t.startsWith(n)) return;
1085
- let i = t.slice(n.length), a = lr(e);
1085
+ let i = t.slice(n.length), a = ur(e);
1086
1086
  i && a && (r[i] = a);
1087
1087
  }), r;
1088
- }, dr = ({ currentSearch: e, dashboardId: t, entries: n, legacyGlobals: r = {}, namespaced: i = !0 }) => {
1088
+ }, fr = ({ currentSearch: e, dashboardId: t, entries: n, legacyGlobals: r = {}, namespaced: i = !0 }) => {
1089
1089
  if (!i) {
1090
1090
  let e = new URLSearchParams();
1091
- return ar.forEach((n) => {
1091
+ return or.forEach((n) => {
1092
1092
  let i = r[n];
1093
1093
  if (n === "dashboardId") {
1094
1094
  e.set(n, t ?? "");
@@ -1101,7 +1101,7 @@ var Yn = { rows: [] }, Z = {
1101
1101
  }
1102
1102
  let a = new URLSearchParams(e);
1103
1103
  if (!t) return a;
1104
- let o = or(t), s = [];
1104
+ let o = sr(t), s = [];
1105
1105
  return a.forEach((e, t) => {
1106
1106
  t.startsWith(o) && s.push(t);
1107
1107
  }), s.forEach((e) => {
@@ -1109,7 +1109,7 @@ var Yn = { rows: [] }, Z = {
1109
1109
  }), n.forEach(({ key: e, value: t }) => {
1110
1110
  a.set(`${o}${e}`, t);
1111
1111
  }), a;
1112
- }, fr = (e, t) => {
1112
+ }, pr = (e, t) => {
1113
1113
  let n = e?.levels;
1114
1114
  if (!e || !n?.length) return null;
1115
1115
  let r = n.findIndex((e) => e?.index === t.levelIndex);
@@ -1125,9 +1125,9 @@ var Yn = { rows: [] }, Z = {
1125
1125
  filters: n > r ? [] : e?.filters
1126
1126
  })
1127
1127
  };
1128
- }, pr = (e, t) => {
1129
- let n = new URLSearchParams(e), r = {}, i = {}, a = t ? or(t) : null, o = (e, t, n) => {
1130
- e[t] = Q(e[t], ir(n));
1128
+ }, mr = (e, t) => {
1129
+ let n = new URLSearchParams(e), r = {}, i = {}, a = t ? sr(t) : null, o = (e, t, n) => {
1130
+ e[t] = ar(e[t], ir(n));
1131
1131
  };
1132
1132
  return n.forEach((e, t) => {
1133
1133
  if (a && t.startsWith(a)) {
@@ -1141,40 +1141,40 @@ var Yn = { rows: [] }, Z = {
1141
1141
  ...r,
1142
1142
  ...i
1143
1143
  };
1144
- }, mr = Symbol("cross-filter-source-metric"), hr = (e, t) => (t && Object.defineProperty(e, mr, { value: t }), e);
1145
- function gr({ filters: e, metricId: t, isGroupByEnabled: n, enableCrossFilterBeforeDrill: r = !1 }) {
1144
+ }, hr = Symbol("cross-filter-source-metric"), gr = (e, t) => (t && Object.defineProperty(e, hr, { value: t }), e);
1145
+ function _r({ filters: e, metricId: t, isGroupByEnabled: n, enableCrossFilterBeforeDrill: r = !1 }) {
1146
1146
  return r ? (e || []).filter((e) => {
1147
- let r = e[mr];
1147
+ let r = e[hr];
1148
1148
  return r ? r !== t : !n;
1149
1149
  }) : n ? [] : e || [];
1150
1150
  }
1151
- function _r(e, t, n) {
1151
+ function vr(e, t, n) {
1152
1152
  return t === "DATABASE" ? `${n}.${e?.split(".").slice(1).join(".")}` : e;
1153
1153
  }
1154
- var vr = (e) => {
1154
+ var yr = (e) => {
1155
1155
  let t = e?.table?.schemaName, n = e?.table?.tableName;
1156
1156
  if (t && n) return `${t}.${n}`;
1157
- }, yr = (e) => typeof e == "string" && !!e.trim(), br = (e, t) => t?.find((t) => t?.alias === e || t?.name === e), xr = ({ columnName: e, selectedDims: t }) => {
1158
- if (!yr(e)) return;
1157
+ }, br = (e) => typeof e == "string" && !!e.trim(), xr = (e, t) => t?.find((t) => t?.alias === e || t?.name === e), Sr = ({ columnName: e, selectedDims: t }) => {
1158
+ if (!br(e)) return;
1159
1159
  if (!t?.length) return e;
1160
- let n = br(e, t);
1161
- if (n && vr(n)) return yr(n.name) ? n.name : e;
1162
- }, Sr = "This filter column is no longer available. Refresh the metric and select a column before filtering.", Cr = ({ columnName: e, rowFilters: t, selectedDims: n, requiresSchemaMetadata: r = !1 }) => {
1160
+ let n = xr(e, t);
1161
+ if (n && yr(n)) return br(n.name) ? n.name : e;
1162
+ }, Cr = "This filter column is no longer available. Refresh the metric and select a column before filtering.", wr = ({ columnName: e, rowFilters: t, selectedDims: n, requiresSchemaMetadata: r = !1 }) => {
1163
1163
  let i = t?.length ? t.map((e) => e.columnName) : e === void 0 ? [] : [e];
1164
- return i.some((e) => !yr(e)) || (t?.length || r) && !n?.length || i.some((e) => !!n?.length && !xr({
1164
+ return i.some((e) => !br(e)) || (t?.length || r) && !n?.length || i.some((e) => !!n?.length && !Sr({
1165
1165
  columnName: e,
1166
1166
  selectedDims: n
1167
- })) ? Sr : void 0;
1167
+ })) ? Cr : void 0;
1168
1168
  };
1169
- function wr(e) {
1169
+ function Tr(e) {
1170
1170
  let t = e.value === null || e.value === void 0, n = t ? "null" : e.value;
1171
- return hr({
1171
+ return gr({
1172
1172
  columnName: e.columnName,
1173
1173
  datatype: "string",
1174
1174
  isAddOnMetrics: !0,
1175
1175
  name: "cross-filter",
1176
1176
  options: [n],
1177
- tableName: _r(e.tableName, e.tenancyLevel, e.clientId),
1177
+ tableName: vr(e.tableName, e.tenancyLevel, e.clientId),
1178
1178
  value: [n],
1179
1179
  ...t ? { filterVariant: {
1180
1180
  label: "IN",
@@ -1182,17 +1182,17 @@ function wr(e) {
1182
1182
  } } : {}
1183
1183
  }, e.sourceMetricId);
1184
1184
  }
1185
- function Tr({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filterValue: i, columnName: a, rowFilters: o, selectedDims: s, activeLevelTableName: c, tenancyLevel: l, clientId: u, sourceMetricId: d }) {
1185
+ function Er({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filterValue: i, columnName: a, rowFilters: o, selectedDims: s, activeLevelTableName: c, tenancyLevel: l, clientId: u, sourceMetricId: d }) {
1186
1186
  if (t || n) return [];
1187
- let f = i != null && yr(a);
1187
+ let f = i != null && br(a);
1188
1188
  if (!((f || o?.length) && r)) return [];
1189
1189
  if (o?.length) {
1190
1190
  let t = o.map((e) => {
1191
- let t = xr({
1191
+ let t = Sr({
1192
1192
  columnName: e?.columnName,
1193
1193
  selectedDims: s
1194
- }), n = vr(t ? br(e.columnName, s) : void 0);
1195
- if (n && t) return wr({
1194
+ }), n = yr(t ? xr(e.columnName, s) : void 0);
1195
+ if (n && t) return Tr({
1196
1196
  columnName: t,
1197
1197
  value: e?.value,
1198
1198
  tableName: n,
@@ -1204,7 +1204,7 @@ function Tr({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
1204
1204
  return [...e || [], ...t];
1205
1205
  }
1206
1206
  if (f) {
1207
- if (d) return jr({
1207
+ if (d) return Mr({
1208
1208
  existing: e,
1209
1209
  columnName: a,
1210
1210
  value: i,
@@ -1213,11 +1213,11 @@ function Tr({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
1213
1213
  clientId: u,
1214
1214
  sourceMetricId: d
1215
1215
  });
1216
- let t = xr({
1216
+ let t = Sr({
1217
1217
  columnName: a,
1218
1218
  selectedDims: s
1219
1219
  });
1220
- return t ? [...e || [], wr({
1220
+ return t ? [...e || [], Tr({
1221
1221
  columnName: t,
1222
1222
  value: i,
1223
1223
  tableName: c,
@@ -1228,7 +1228,7 @@ function Tr({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
1228
1228
  }
1229
1229
  return [];
1230
1230
  }
1231
- var Er = /* @__PURE__ */ new Set([
1231
+ var Dr = /* @__PURE__ */ new Set([
1232
1232
  j.progressBar,
1233
1233
  j.progressBarV2,
1234
1234
  j.linearGauge,
@@ -1236,34 +1236,34 @@ var Er = /* @__PURE__ */ new Set([
1236
1236
  j.gauge,
1237
1237
  j.gaugeV2
1238
1238
  ]);
1239
- function Dr({ runtimeEnabled: e, metricEnabled: t }) {
1239
+ function Or({ runtimeEnabled: e, metricEnabled: t }) {
1240
1240
  return !!e || !!t;
1241
1241
  }
1242
- function Or({ chartType: e, isDrillEnabled: t, dimensions: n, drilledLevel: r, drillLevels: i }) {
1243
- if (e && Er.has(e)) return "terminal";
1242
+ function kr({ chartType: e, isDrillEnabled: t, dimensions: n, drilledLevel: r, drillLevels: i }) {
1243
+ if (e && Dr.has(e)) return "terminal";
1244
1244
  if (!t || (n?.length ?? 0) === r) return "none";
1245
1245
  let a = i || [];
1246
1246
  return a[a.length - 1]?.isEnable ? "none" : "drill";
1247
1247
  }
1248
- function kr({ chartType: e, params: t, rowFilters: n, dimensions: r }) {
1248
+ function Ar({ chartType: e, params: t, rowFilters: n, dimensions: r }) {
1249
1249
  return e === j.table ? {
1250
1250
  name: n?.find((e) => r?.some((t) => e?.columnName === t))?.value,
1251
1251
  rowFilters: n
1252
1252
  } : t;
1253
1253
  }
1254
- function Ar(e, t) {
1255
- if (!yr(e)) return !1;
1256
- let n = br(e, t);
1257
- return !!n && !!vr(n);
1254
+ function jr(e, t) {
1255
+ if (!br(e)) return !1;
1256
+ let n = xr(e, t);
1257
+ return !!n && !!yr(n);
1258
1258
  }
1259
- function jr({ existing: e, columnName: t, value: n, mode: r = "only", selectedDims: i, tenancyLevel: a, clientId: o, sourceMetricId: s }) {
1260
- if (!yr(t) || n === void 0) return e || [];
1261
- let c = br(t, i), l = xr({
1259
+ function Mr({ existing: e, columnName: t, value: n, mode: r = "only", selectedDims: i, tenancyLevel: a, clientId: o, sourceMetricId: s }) {
1260
+ if (!br(t) || n === void 0) return e || [];
1261
+ let c = xr(t, i), l = Sr({
1262
1262
  columnName: t,
1263
1263
  selectedDims: i
1264
- }), u = vr(c);
1264
+ }), u = yr(c);
1265
1265
  if (!u || !l) return e || [];
1266
- let d = wr({
1266
+ let d = Tr({
1267
1267
  columnName: l,
1268
1268
  value: n,
1269
1269
  tableName: u,
@@ -1274,41 +1274,41 @@ function jr({ existing: e, columnName: t, value: n, mode: r = "only", selectedDi
1274
1274
  label: "NOT IN",
1275
1275
  value: "NOT IN"
1276
1276
  };
1277
- return [...f, r === "exclude" ? hr({
1277
+ return [...f, r === "exclude" ? gr({
1278
1278
  ...d,
1279
1279
  filterVariant: p
1280
1280
  }, s) : d];
1281
1281
  }
1282
1282
  //#endregion
1283
1283
  //#region src/core/metric-builder/drillPoint.ts
1284
- var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim() !== ""), Pr = (e) => !!e.columnName && Nr(e.value), Fr = (e, t) => ({
1284
+ var Nr = "Empty", Pr = (e) => e !== void 0 && (typeof e != "string" || e.trim() !== ""), Fr = (e) => !!e.columnName && Pr(e.value), Ir = (e, t) => ({
1285
1285
  columnName: e,
1286
1286
  value: t,
1287
1287
  ...t === null ? { operator: "isNull" } : {}
1288
- }), Ir = (e, t = (e) => e) => {
1288
+ }), Lr = (e, t = (e) => e) => {
1289
1289
  let n = e?.dimensions || [], r = [], i = [];
1290
1290
  return n.forEach((e) => {
1291
- if (!Pr(e)) {
1291
+ if (!Fr(e)) {
1292
1292
  e.columnName && i.push(e);
1293
1293
  return;
1294
1294
  }
1295
- r.push(t(Fr(e.columnName, e.value)));
1295
+ r.push(t(Ir(e.columnName, e.value)));
1296
1296
  }), {
1297
1297
  filters: r,
1298
1298
  skipped: i
1299
1299
  };
1300
- }, Lr = (e) => (e?.dimensions || []).filter((e) => e.value !== void 0).map((e) => ({
1300
+ }, Rr = (e) => (e?.dimensions || []).filter((e) => e.value !== void 0).map((e) => ({
1301
1301
  label: e.label || e.columnName,
1302
1302
  value: e.formatted ?? (e.value === null ? "Empty" : String(e.value)),
1303
1303
  role: e.role
1304
- })), Rr = (e) => {
1304
+ })), zr = (e) => {
1305
1305
  let t = e?.measure;
1306
1306
  if (t && t.value !== void 0) return t.formatted ?? String(t.value ?? "Empty");
1307
1307
  let n = (e?.dimensions || []).find((e) => e.value !== void 0);
1308
1308
  if (n) return n.formatted ?? String(n.value ?? "Empty");
1309
- }, zr = (e) => {
1309
+ }, Q = (e) => {
1310
1310
  if (e !== void 0) return e === null ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : String(e);
1311
- }, Br = (e) => e === void 0 ? void 0 : e === null ? Mr : String(e), Vr = (e, t) => {
1311
+ }, Br = (e) => e === void 0 ? void 0 : e === null ? Nr : String(e), Vr = (e, t) => {
1312
1312
  let n = Br(e);
1313
1313
  if (!t || typeof e != "number") return n;
1314
1314
  try {
@@ -1320,7 +1320,7 @@ var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim()
1320
1320
  let a = e?.rowFilters;
1321
1321
  if (a?.length) return {
1322
1322
  dimensions: a.filter((e) => !!e?.columnName).map((e) => {
1323
- let t = zr(e.value);
1323
+ let t = Q(e.value);
1324
1324
  return {
1325
1325
  columnName: e.columnName,
1326
1326
  value: t,
@@ -1332,7 +1332,7 @@ var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim()
1332
1332
  };
1333
1333
  let o = [];
1334
1334
  if (t?.columnName) {
1335
- let n = zr(e?.name);
1335
+ let n = Q(e?.name);
1336
1336
  o.push({
1337
1337
  columnName: t.columnName,
1338
1338
  label: t.label,
@@ -1342,7 +1342,7 @@ var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim()
1342
1342
  });
1343
1343
  }
1344
1344
  if (n?.columnName) {
1345
- let t = zr(e?.seriesName);
1345
+ let t = Q(e?.seriesName);
1346
1346
  o.push({
1347
1347
  columnName: n.columnName,
1348
1348
  label: n.label,
@@ -1351,7 +1351,7 @@ var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim()
1351
1351
  role: "series"
1352
1352
  });
1353
1353
  }
1354
- let s = zr(e?.value), c = { dimensions: o }, l = n?.columnName ? r?.columnName : r?.columnName ?? zr(e?.seriesName);
1354
+ let s = Q(e?.value), c = { dimensions: o }, l = n?.columnName ? r?.columnName : r?.columnName ?? Q(e?.seriesName);
1355
1355
  return (s !== void 0 || l) && (c.measure = {
1356
1356
  columnName: typeof l == "string" ? l : void 0,
1357
1357
  label: r?.label,
@@ -1665,7 +1665,7 @@ var Mr = "Empty", Nr = (e) => e !== void 0 && (typeof e != "string" || e.trim()
1665
1665
  outcome: "jump"
1666
1666
  };
1667
1667
  if (a) {
1668
- let t = a.parentFilters || [], n = typeof r == "string" && r.trim() === "", i = r != null && !n && !!a.columnName, l = (e) => e.filter((e) => Nr(e.value)), u = l(a.pointFilters ?? []), d = l(p.map(li).map(o)), f = u.length ? [...t, ...u] : d.length ? [...t, ...d] : i ? [...t, o({
1668
+ let t = a.parentFilters || [], n = typeof r == "string" && r.trim() === "", i = r != null && !n && !!a.columnName, l = (e) => e.filter((e) => Pr(e.value)), u = l(a.pointFilters ?? []), d = l(p.map(li).map(o)), f = u.length ? [...t, ...u] : d.length ? [...t, ...d] : i ? [...t, o({
1669
1669
  columnName: a.columnName,
1670
1670
  value: r
1671
1671
  })] : t;
@@ -1999,17 +1999,35 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
1999
1999
  } finally {
2000
2000
  o();
2001
2001
  }
2002
- }, Vi = "Could not generate this metric summary. Try again.", Hi = 1500, Ui = /* @__PURE__ */ new Map(), Wi = (e, t) => {
2003
- Ui.get(e) === t && Ui.delete(e), t.abandonTimer && clearTimeout(t.abandonTimer), t.abandonTimer = void 0;
2004
- }, Gi = (e) => {
2005
- Ui.forEach((t, n) => {
2006
- t.settledAt !== void 0 && e - t.settledAt >= 3e4 && Wi(n, t);
2007
- }), !(Ui.size <= 24) && [...Ui.entries()].filter(([, e]) => e.settledAt !== void 0).sort(([, e], [, t]) => (e.settledAt ?? 0) - (t.settledAt ?? 0)).slice(0, Math.max(0, Ui.size - 24)).forEach(([e, t]) => {
2008
- Wi(e, t);
2002
+ }, Vi = ({ savedDrillDownSettings: e, initialDrillState: t }) => {
2003
+ let [n, r] = L([]), i = t.drillFilters ?? [], a = I(i), o = I(t.underlyingDataDrillFilters), s = rr(e, t), [c, l] = L(i), [u, d] = L(s ?? {
2004
+ isEnableGroupBy: !1,
2005
+ isEnableCrossFilter: !1,
2006
+ drillType: ""
2007
+ }), [f, p] = L([]);
2008
+ return {
2009
+ drilldownCols: n,
2010
+ setDrillDownCols: r,
2011
+ initialDrillFiltersRef: a,
2012
+ initialUnderlyingDataDrillFiltersRef: o,
2013
+ drillFilters: c,
2014
+ setDrillFilters: l,
2015
+ drillDownSettings: u,
2016
+ setDrillDownSettings: d,
2017
+ adhocDrillDims: f,
2018
+ setAdhocDrillDims: p
2019
+ };
2020
+ }, Hi = "Could not generate this metric summary. Try again.", Ui = 1500, Wi = /* @__PURE__ */ new Map(), Gi = (e, t) => {
2021
+ Wi.get(e) === t && Wi.delete(e), t.abandonTimer && clearTimeout(t.abandonTimer), t.abandonTimer = void 0;
2022
+ }, Ki = (e) => {
2023
+ Wi.forEach((t, n) => {
2024
+ t.settledAt !== void 0 && e - t.settledAt >= 3e4 && Gi(n, t);
2025
+ }), !(Wi.size <= 24) && [...Wi.entries()].filter(([, e]) => e.settledAt !== void 0).sort(([, e], [, t]) => (e.settledAt ?? 0) - (t.settledAt ?? 0)).slice(0, Math.max(0, Wi.size - 24)).forEach(([e, t]) => {
2026
+ Gi(e, t);
2009
2027
  });
2010
- }, Ki = (e, t, n = Date.now) => {
2011
- Gi(n());
2012
- let r = Ui.get(e);
2028
+ }, qi = (e, t, n = Date.now) => {
2029
+ Ki(n());
2030
+ let r = Wi.get(e);
2013
2031
  if (r) r.abandonTimer && (clearTimeout(r.abandonTimer), r.abandonTimer = void 0);
2014
2032
  else {
2015
2033
  let i = new AbortController(), a = {
@@ -2018,71 +2036,71 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2018
2036
  promise: Promise.resolve()
2019
2037
  };
2020
2038
  a.promise = t(i.signal).then((e) => (a.settledAt = n(), e), (t) => {
2021
- throw Wi(e, a), t;
2022
- }), a.promise.catch(() => void 0), Ui.set(e, a), r = a;
2039
+ throw Gi(e, a), t;
2040
+ }), a.promise.catch(() => void 0), Wi.set(e, a), r = a;
2023
2041
  }
2024
2042
  let i = r;
2025
2043
  i.holders += 1;
2026
2044
  let a = !1, o = () => {
2027
2045
  a || (a = !0, --i.holders, !(i.holders > 0 || i.settledAt !== void 0) && (i.abandonTimer ||= setTimeout(() => {
2028
- i.abandonTimer = void 0, !(i.holders > 0) && (i.controller.abort(), Wi(e, i));
2029
- }, Hi)));
2046
+ i.abandonTimer = void 0, !(i.holders > 0) && (i.controller.abort(), Gi(e, i));
2047
+ }, Ui)));
2030
2048
  };
2031
2049
  return {
2032
2050
  promise: i.promise,
2033
2051
  release: o,
2034
2052
  abort: () => {
2035
- o(), i.controller.abort(), Wi(e, i);
2053
+ o(), i.controller.abort(), Gi(e, i);
2036
2054
  }
2037
2055
  };
2038
- }, qi = {
2056
+ }, Ji = {
2039
2057
  status: "idle",
2040
2058
  summary: "",
2041
2059
  error: "",
2042
2060
  empty: !1
2043
- }, Ji = {
2044
- ...qi,
2045
- status: "failed",
2046
- error: Vi
2047
2061
  }, Yi = {
2062
+ ...Ji,
2063
+ status: "failed",
2064
+ error: Hi
2065
+ }, Xi = {
2048
2066
  status: "done",
2049
2067
  summary: "",
2050
2068
  error: "There is no data to summarize.",
2051
2069
  empty: !0
2052
- }, Xi = () => {
2053
- let [e, t] = L(qi), n = I(null), r = I(null), i = N(() => {
2070
+ }, Zi = () => {
2071
+ let [e, t] = L(Ji), n = I(null), r = I(null), i = N(() => {
2054
2072
  let e = r.current;
2055
- r.current = null, n.current = null, e?.abort(), t(qi);
2073
+ r.current = null, n.current = null, e?.abort(), t(Ji);
2056
2074
  }, []), a = N(() => {
2057
2075
  let e = r.current;
2058
- r.current = null, e?.abort(), t(qi);
2076
+ r.current = null, e?.abort(), t(Ji);
2059
2077
  }, []), o = N((e, i) => {
2060
2078
  if (n.current === e) return;
2061
2079
  if (n.current = e, r.current?.release(), r.current = null, !i) {
2062
- t(Yi);
2080
+ t(Xi);
2063
2081
  return;
2064
2082
  }
2065
2083
  t({
2066
- ...qi,
2084
+ ...Ji,
2067
2085
  status: "running"
2068
2086
  });
2069
- let a = Ki(e, async (e) => {
2087
+ let a = qi(e, async (e) => {
2070
2088
  try {
2071
2089
  let t = await i(e), n = t && typeof t == "object" && "summary" in t && typeof t.summary == "string" ? t.summary.trim() : "";
2072
2090
  return n ? {
2073
- ...qi,
2091
+ ...Ji,
2074
2092
  status: "done",
2075
2093
  summary: n
2076
- } : Yi;
2094
+ } : Xi;
2077
2095
  } catch (e) {
2078
2096
  if (s(e)) throw e;
2079
- return Ji;
2097
+ return Yi;
2080
2098
  }
2081
2099
  });
2082
2100
  r.current = a, a.promise.then((e) => {
2083
2101
  r.current === a && t(e);
2084
2102
  }, (e) => {
2085
- r.current === a && t(s(e) ? qi : Ji);
2103
+ r.current === a && t(s(e) ? Ji : Yi);
2086
2104
  });
2087
2105
  }, []);
2088
2106
  return P(() => () => {
@@ -2093,88 +2111,87 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2093
2111
  stop: a,
2094
2112
  reset: i
2095
2113
  };
2096
- }, Zi = (e) => {
2114
+ }, Qi = (e) => {
2097
2115
  let t = I(e);
2098
- return t.current !== e && !rn(t.current, e) && (t.current = e), t.current;
2116
+ return t.current !== e && !U(t.current, e) && (t.current = e), t.current;
2099
2117
  }, $ = (e) => {
2100
2118
  if (!e) return null;
2101
2119
  let t = new Date(e);
2102
2120
  return t instanceof Date && !Number.isNaN(t.getTime()) ? t : null;
2103
- }, Qi = (e) => Xe(e || {}) ? {
2121
+ }, $i = (e) => Xe(e || {}) ? {
2104
2122
  startTime: e?.startTime,
2105
2123
  endTime: e?.endTime,
2106
2124
  isTimeFilter: !0
2107
- } : {}, $i = ({ option: e, value: t }) => ({
2125
+ } : {}, ea = ({ option: e, value: t }) => ({
2108
2126
  startDate: $(e?.fromDate) ?? $(e?.startDate) ?? void 0,
2109
2127
  endDate: $(e?.toDate) ?? $(e?.endDate) ?? void 0,
2110
- ...Qi(e),
2128
+ ...$i(e),
2111
2129
  value: t,
2112
2130
  label: t
2113
- }), ea = (e, t) => {
2131
+ }), ta = (e, t) => {
2114
2132
  if (typeof e == "object" && e) return Reflect.get(e, t);
2115
- }, ta = [], na = [], ra = [], ia = (e, t) => {
2133
+ }, na = [], ra = [], ia = [], aa = (e, t) => {
2116
2134
  let n = t?.configV2?.levels?.find((e) => e?.isEnable)?.chartSettings;
2117
2135
  return n ? {
2118
2136
  ...e,
2119
2137
  ...n
2120
2138
  } : e;
2121
- }, aa = ({ raw: e, selectedDims: t, selectedMetrics: n, datasetSettings: r, integrationName: i, isPythonMode: a }) => {
2122
- let o = Zn({ data: e });
2123
- if (!o.rows.length) return ta;
2139
+ }, oa = ({ raw: e, selectedDims: t, selectedMetrics: n, datasetSettings: r, integrationName: i, isPythonMode: a }) => {
2140
+ let o = Qn({ data: e });
2141
+ if (!o.rows.length) return na;
2124
2142
  let s = Fe(o.rows, t || [], n || []), c = s;
2125
2143
  if (i?.toLowerCase() === "redshift" && !a) {
2126
2144
  let e = r?.selectedMetrics || [], t = [...((r?.selectedDims)?.filter((e) => !tt(e?.alias)) || [])?.map((e) => e.alias), ...e?.map((e) => e.alias)];
2127
2145
  c = Re(t, s);
2128
2146
  }
2129
2147
  let l = it(c);
2130
- return !Array.isArray(l) || !l.length ? ta : l;
2131
- }, oa = ({ externalDashboardClientId: e, metric: t, globalFilters: n = {
2148
+ return !Array.isArray(l) || !l.length ? na : l;
2149
+ }, sa = ({ externalDashboardClientId: e, metric: t, globalFilters: n = {
2132
2150
  tableName: "",
2133
2151
  filters: []
2134
2152
  }, rlsFilters: r, clientId: a, tenancyLevel: o, isInternalApp: s, appFilters: c, setCrossDashboardFilters: l, crossDashboardFilters: u, enableCrossFilter: d, enableCrossFilterBeforeDrill: f = !1, metricFilterOptions: h, isAllClient: g, isFrontendApp: _, guestToken: v, encryptedClientId: y, clientCacheScope: b, dashboardId: w, workspaceId: E, metricStore: D, setMetricStore: ae, summaryReferencedMetricIds: se, onServerEvent: fe, clientColumnType: he, datasourceId: _e, appliedCardMetricFilters: k, onMetricFiltersChange: Ae, language: A, translationDictionary: Ne, calendarType: Pe, setLoadedCardMetadata: Re, isRulePending: Be = !1, setSettledCardIds: Ue, drillUrlState: Ke, isFullScreen: Xe, setMetricMetadata: Ze, viewMetricData: M, generatingPdf: tt, dataMartTables: at, isDisableQuery: st = !1, token: lt, drilledLevel: ut, drillFilters: dt, drillType: ft, underlyingDataDrillFilters: mt }) => {
2135
- let [ht, vt] = L(!1), yt = S(), [bt, xt] = L(null), { state: St, start: Ct, stop: wt, reset: Tt } = Xi(), Et = St.summary, Dt = St.error, Ot = St.empty, kt = St.status === "running", At = I(null), jt = I(null), [Mt, Nt] = L({
2153
+ let [ht, vt] = L(!1), yt = S(), [bt, xt] = L(null), { state: St, start: Ct, stop: wt, reset: Tt } = Zi(), Et = St.summary, Dt = St.error, Ot = St.empty, kt = St.status === "running", At = I(null), jt = I(null), [Mt, Nt] = L({
2136
2154
  limit: parseInt(t?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
2137
2155
  offset: 0
2138
2156
  }), [Pt, Ft] = L(0), [R, It] = L(0), [z, Lt] = L(t?.rlsConditions || []), [Rt, zt] = L([]), [Bt, Vt] = L(!1), [B, Ht] = L(), [Ut, Wt] = L(""), [Gt, Kt] = L([]), [qt, Jt] = L({
2139
2157
  isOpen: !1,
2140
2158
  report: "",
2141
2159
  isLoading: !1
2142
- }), [Yt, Xt] = L(!1), [Zt, Qt] = L([]), $t = dt ?? [], en = I($t), tn = I(mt), nn = rr(t?.drillDownSettings, {
2143
- drilledLevel: ut,
2144
- drillFilters: dt,
2145
- drillType: ft,
2146
- underlyingDataDrillFilters: mt
2147
- }), [V, rn] = L($t), [H, an] = L(nn ?? {
2148
- isEnableGroupBy: !1,
2149
- isEnableCrossFilter: !1,
2150
- drillType: ""
2151
- }), U = !s && f === !0, on = Dr({
2160
+ }), [Yt, Xt] = L(!1), { drilldownCols: Zt, setDrillDownCols: Qt, initialDrillFiltersRef: $t, initialUnderlyingDataDrillFiltersRef: en, drillFilters: V, setDrillFilters: tn, drillDownSettings: H, setDrillDownSettings: U, adhocDrillDims: nn, setAdhocDrillDims: rn } = Vi({
2161
+ savedDrillDownSettings: t?.drillDownSettings,
2162
+ initialDrillState: {
2163
+ drilledLevel: ut,
2164
+ drillFilters: dt,
2165
+ drillType: ft,
2166
+ underlyingDataDrillFilters: mt
2167
+ }
2168
+ }), W = !s && f === !0, an = Or({
2152
2169
  runtimeEnabled: d,
2153
2170
  metricEnabled: t?.drillDownSettings?.isEnableCrossFilter
2154
- }), [sn, cn] = L([]), [ln, un] = L([]), [dn, fn] = L(!1), [mn, hn] = L(!1), [gn, _n] = L([]), vn = I(Ae);
2155
- vn.current = Ae;
2156
- let yn = N((e) => {
2157
- _n((n) => {
2171
+ }), [on, sn] = L([]), [cn, ln] = L(!1), [un, dn] = L(!1), [G, pn] = L([]), mn = I(Ae);
2172
+ mn.current = Ae;
2173
+ let hn = N((e) => {
2174
+ pn((n) => {
2158
2175
  let r = typeof e == "function" ? e(n) : e;
2159
2176
  return Si({
2160
2177
  metricId: t?.id,
2161
2178
  filters: r,
2162
- onChange: vn.current
2179
+ onChange: mn.current
2163
2180
  }), r;
2164
2181
  });
2165
- }, [t?.id]), [W, bn] = L({}), [xn, Sn] = L(!1), [Cn, Tn] = L([]), [G, K] = L(ia(t?.chartOptions, t?.drillDownSettings)), Dn = I(""), [On, kn] = L({
2182
+ }, [t?.id]), [gn, _n] = L({}), [vn, yn] = L(!1), [bn, xn] = L([]), [K, q] = L(aa(t?.chartOptions, t?.drillDownSettings)), wn = I(""), [Tn, En] = L({
2166
2183
  data: [],
2167
2184
  error: "",
2168
2185
  isLoading: !1,
2169
2186
  currentValue: ""
2170
- }), q = F(() => !!t?.datasetMetricSettings?.newDatasetSettings?.isPythonMode, [t?.datasetMetricSettings?.newDatasetSettings?.isPythonMode]), An = F(() => vi(t?.datasetMetricSettings), [t?.datasetMetricSettings]), jn = N((e) => qe(e) ? !0 : e?.isAddOnMetrics && e?.datatype === "date" ? !1 : !!(e?.isAddOnMetrics && e?.client?.isEnable && e?.client?.columnName && e?.client?.as && !g && a), [a, g]), Mn = F(() => t?.externalDashboardMetrics?.[0]?.externalDashboard?.companyWorkspace?.datamart?.datamartRelationships || [], [t]), Nn = F(() => {
2187
+ }), J = F(() => !!t?.datasetMetricSettings?.newDatasetSettings?.isPythonMode, [t?.datasetMetricSettings?.newDatasetSettings?.isPythonMode]), Dn = F(() => vi(t?.datasetMetricSettings), [t?.datasetMetricSettings]), On = N((e) => qe(e) ? !0 : e?.isAddOnMetrics && e?.datatype === "date" ? !1 : !!(e?.isAddOnMetrics && e?.client?.isEnable && e?.client?.columnName && e?.client?.as && !g && a), [a, g]), kn = F(() => t?.externalDashboardMetrics?.[0]?.externalDashboard?.companyWorkspace?.datamart?.datamartRelationships || [], [t]), An = F(() => {
2171
2188
  let e = {};
2172
2189
  if (r?.values) for (let t in r.values) {
2173
2190
  let n = `${t}_variable`;
2174
2191
  e[n] = r.values[t];
2175
2192
  }
2176
2193
  return e;
2177
- }, [r?.values]), Pn = F(() => {
2194
+ }, [r?.values]), jn = F(() => {
2178
2195
  let e = t?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable;
2179
2196
  return (at?.find((t) => t.tableName === e?.tableName))?.customColumnFields?.map((n) => ({
2180
2197
  value: n?.columnName,
@@ -2207,54 +2224,54 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2207
2224
  t?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable,
2208
2225
  t?.companyIntegration?.name,
2209
2226
  at
2210
- ]), Fn = F(() => {
2227
+ ]), Mn = F(() => {
2211
2228
  let e = t?.drillDownSettings?.isEnableGroupBy;
2212
- return (U ? [...z?.length ? z : [], ...gr({
2229
+ return (W ? [...z?.length ? z : [], ..._r({
2213
2230
  filters: u,
2214
2231
  metricId: t?.id,
2215
2232
  isGroupByEnabled: e,
2216
2233
  enableCrossFilterBeforeDrill: !0
2217
2234
  })] : e ? z || [] : [...z?.length ? z : [], ...u || []]).filter((e) => e.isAddOnMetrics).map((e) => s ? {
2218
2235
  ...e,
2219
- dimensionColumn: G?.xAxis || "",
2220
- measureColumn: G?.yAxisList?.[0] || "",
2236
+ dimensionColumn: K?.xAxis || "",
2237
+ measureColumn: K?.yAxisList?.[0] || "",
2221
2238
  options: e.datatype === "date" ? e.options : [],
2222
2239
  variableOptions: e.datatype === "date" ? e.variableOptions : []
2223
2240
  } : {
2224
2241
  ...e,
2225
- dimensionColumn: G?.xAxis || "",
2226
- measureColumn: G?.yAxisList?.[0] || "",
2242
+ dimensionColumn: K?.xAxis || "",
2243
+ measureColumn: K?.yAxisList?.[0] || "",
2227
2244
  value: e.isAppFilter ? e.datatype === "date" ? Te(c?.values?.[e.name], e?.datePresetOptions || e?.presetDateOptions) || (e?.options)?.find((t) => t.name === (c?.values?.[e.name] ?? e.value)) : c?.values?.[e.name] ?? e.value : e.value,
2228
2245
  options: e.datatype === "date" ? e?.options?.map((t) => Pe === "ind" && e.datatype === "date" ? {
2229
2246
  ...t,
2230
2247
  isFiscal: !0
2231
2248
  } : t) : [],
2232
2249
  variableOptions: e.datatype === "date" ? e.variableOptions : []
2233
- }).filter((e) => jn(e));
2250
+ }).filter((e) => On(e));
2234
2251
  }, [
2235
2252
  c?.values,
2236
2253
  Pe,
2237
- G?.xAxis,
2238
- G?.yAxisList,
2254
+ K?.xAxis,
2255
+ K?.yAxisList,
2239
2256
  u,
2240
2257
  t?.id,
2241
- U,
2258
+ W,
2242
2259
  s,
2243
2260
  t?.drillDownSettings?.isEnableGroupBy,
2244
2261
  z,
2245
- jn
2246
- ]), In = F(() => JSON.stringify(Rt), [Rt]), J = Zi(F(() => ({
2262
+ On
2263
+ ]), Nn = F(() => JSON.stringify(Rt), [Rt]), Y = Qi(F(() => ({
2247
2264
  ...Pi({
2248
2265
  metric: t,
2249
2266
  isAllClient: g,
2250
2267
  tenancyLevel: o,
2251
- appliedMetricFilters: gn,
2252
- firstLoadAppliedMetricFilters: Fn,
2268
+ appliedMetricFilters: G,
2269
+ firstLoadAppliedMetricFilters: Mn,
2253
2270
  tableColumnFilters: Rt,
2254
- chartSettings: G,
2255
- isPythonMode: q,
2271
+ chartSettings: K,
2272
+ isPythonMode: J,
2256
2273
  globalFilters: n,
2257
- filterValues: Nn,
2274
+ filterValues: An,
2258
2275
  tableLimit: Mt,
2259
2276
  calendarType: Pe,
2260
2277
  comparisonCount: R,
@@ -2265,13 +2282,13 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2265
2282
  }),
2266
2283
  dashboardId: w
2267
2284
  }), [
2268
- G,
2285
+ K,
2269
2286
  g,
2270
2287
  t,
2271
- gn,
2272
- Fn,
2273
- q,
2274
- Nn,
2288
+ G,
2289
+ Mn,
2290
+ J,
2291
+ An,
2275
2292
  V,
2276
2293
  o,
2277
2294
  n,
@@ -2284,21 +2301,21 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2284
2301
  v,
2285
2302
  _,
2286
2303
  w,
2287
- In
2288
- ])), Ln = F(() => JSON.stringify(J), [J]), Rn = wi(G, t?.datasetMetricSettings), zn = t?.datasetMetricSettings, Bn = Se(zn), Hn = st || Rn.renderEmpty || !!Bn, Un = _ ? y || "" : a || "", Y = F(() => ki({
2289
- query: J,
2290
- clientId: Un,
2304
+ Nn
2305
+ ])), Pn = F(() => JSON.stringify(Y), [Y]), Fn = wi(K, t?.datasetMetricSettings), In = t?.datasetMetricSettings, Ln = Se(In), Rn = st || Fn.renderEmpty || !!Ln, zn = _ ? y || "" : a || "", Vn = F(() => ki({
2306
+ query: Y,
2307
+ clientId: zn,
2291
2308
  isFrontendApp: _
2292
2309
  }), [
2293
- Un,
2310
+ zn,
2294
2311
  _,
2295
- J
2296
- ]), Wn = F(() => Oi({
2297
- clientId: Un,
2312
+ Y
2313
+ ]), Hn = F(() => Oi({
2314
+ clientId: zn,
2298
2315
  guestToken: v,
2299
2316
  isFrontendApp: _
2300
2317
  }), [
2301
- Un,
2318
+ zn,
2302
2319
  v,
2303
2320
  _
2304
2321
  ]);
@@ -2306,40 +2323,40 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2306
2323
  p("metric-query-payload-prepared", {
2307
2324
  metricId: t?.id,
2308
2325
  metricName: t?.name,
2309
- chartType: G?.chartType,
2310
- payload: T(J)
2326
+ chartType: K?.chartType,
2327
+ payload: T(Y)
2311
2328
  });
2312
2329
  }, [
2313
- J,
2330
+ Y,
2314
2331
  t?.id,
2315
2332
  t?.name,
2316
- G?.chartType
2333
+ K?.chartType
2317
2334
  ]);
2318
- let Gn = F(() => pn(t), [t]), { data: X, dataUpdatedAt: Kn, isFetching: Yn, isLoading: Z, error: Xn, refetch: Qn } = wn({
2319
- data: J,
2335
+ let Un = F(() => fn(t), [t]), { data: X, dataUpdatedAt: Wn, isFetching: Gn, isLoading: Kn, error: Yn, refetch: Xn } = Sn({
2336
+ data: Y,
2320
2337
  clientId: _ ? y || "" : a,
2321
2338
  clientCacheScope: _ ? b : void 0,
2322
- metricRevision: Gn,
2339
+ metricRevision: Un,
2323
2340
  token: v,
2324
2341
  isFrontendApp: _,
2325
2342
  isFullScreen: Xe,
2326
2343
  savedMetricQuery: t?.isMetric === !1 || !t?.query ? void 0 : ie(t?.query, t?.companyId),
2327
- savedMetricIdentifiers: zn,
2344
+ savedMetricIdentifiers: In,
2328
2345
  dbName: t?.companyIntegration?.name || t?.integrationName,
2329
2346
  batchHints: {
2330
- chartType: G?.chartType,
2331
- isEnableComparisonFilter: !!G?.isEnableComparisonFilter,
2332
- isMultiDimension: !!G?.isMultiDimension,
2333
- isDynamicSeries: !!G?.isDynamicSeries,
2334
- seriesField: G?.seriesField,
2347
+ chartType: K?.chartType,
2348
+ isEnableComparisonFilter: !!K?.isEnableComparisonFilter,
2349
+ isMultiDimension: !!K?.isMultiDimension,
2350
+ isDynamicSeries: !!K?.isDynamicSeries,
2351
+ seriesField: K?.seriesField,
2335
2352
  isDataMartQuery: !!(t?.datasetMetricSettings)?.newDatasetSettings?.isDataMartQuery
2336
2353
  }
2337
2354
  }, {
2338
- isDisableQuery: Hn,
2355
+ isDisableQuery: Rn,
2339
2356
  onSuccess: (e) => {
2340
- let t = Zn(e), n = it(t.rows), r = ea(ea(t.error, "details"), "legacyCode");
2341
- if (Re && ea(t.error, "code") !== "E1001" && r !== "E1001") {
2342
- let e = J?.id, t = !!n?.length && (G?.chartType !== j.singleValue || n?.[0]?.[G?.singleValue || ""] != null);
2357
+ let t = Qn(e), n = it(t.rows), r = ta(ta(t.error, "details"), "legacyCode");
2358
+ if (Re && ta(t.error, "code") !== "E1001" && r !== "E1001") {
2359
+ let e = Y?.id, t = !!n?.length && (K?.chartType !== j.singleValue || n?.[0]?.[K?.singleValue || ""] != null);
2343
2360
  Re?.((n) => {
2344
2361
  let r = n?.find((t) => t?.id === e);
2345
2362
  return r && r.isDataFound === t ? n : [...n?.filter((t) => t?.id !== e) || [], {
@@ -2350,58 +2367,58 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2350
2367
  }
2351
2368
  },
2352
2369
  onSettled: () => {
2353
- let e = J?.id;
2370
+ let e = Y?.id;
2354
2371
  Ue && e && Ue((t) => Ai(t, e));
2355
2372
  }
2356
- }), $n = Ei(Z), er = Yn && !Z && Kn > 0, tr = F(() => Zn(X), [X]), nr = !Hn && !Yn && !Xn && tr.isFilterNotApplied ? "This drill filter could not be applied to a custom SQL metric." : void 0, ir = I(void 0);
2373
+ }), Zn = Ei(Kn), $n = Gn && !Kn && Wn > 0, er = F(() => Qn(X), [X]), tr = !Rn && !Gn && !Yn && er.isFilterNotApplied ? "This drill filter could not be applied to a custom SQL metric." : void 0, nr = I(void 0);
2357
2374
  P(() => {
2358
- nr && ir.current !== X && (ir.current = X, m("metric.filter_not_applied", { error_code: "FILTER_NOT_APPLIED" }));
2359
- }, [nr, X]);
2360
- let Q = F(() => aa({
2361
- raw: tr.rows,
2375
+ tr && nr.current !== X && (nr.current = X, m("metric.filter_not_applied", { error_code: "FILTER_NOT_APPLIED" }));
2376
+ }, [tr, X]);
2377
+ let Z = F(() => oa({
2378
+ raw: er.rows,
2362
2379
  selectedDims: (t?.datasetMetricSettings)?.newDatasetSettings?.selectedDims,
2363
2380
  selectedMetrics: (t?.datasetMetricSettings)?.newDatasetSettings?.selectedMetrics,
2364
2381
  datasetSettings: t?.datasetMetricSettings?.newDatasetSettings,
2365
2382
  integrationName: t?.companyIntegration?.name,
2366
- isPythonMode: q
2383
+ isPythonMode: J
2367
2384
  }), [
2368
- tr.rows,
2385
+ er.rows,
2369
2386
  t?.datasetMetricSettings,
2370
2387
  t?.companyIntegration?.name,
2371
- q
2372
- ]), ar = F(() => qn(X?.metaData?.truncation, Q.length), [X, Q]), or = F(() => Jn(ar), [ar]), sr = Bn || Xn || tr.error;
2388
+ J
2389
+ ]), ir = F(() => qn(X?.metaData?.truncation, Z.length), [X, Z]), ar = F(() => Jn(ir), [ir]), or = Ln || Yn || er.error;
2373
2390
  P(() => {
2374
- if (!sr) return;
2375
- let e = sr instanceof Error ? sr.message : ea(sr, "message"), n = ea(sr, "context");
2391
+ if (!or) return;
2392
+ let e = or instanceof Error ? or.message : ta(or, "message"), n = ta(or, "context");
2376
2393
  p("metric-query-error-observed", {
2377
2394
  metricId: t?.id,
2378
2395
  metricName: t?.name,
2379
- chartType: G?.chartType,
2396
+ chartType: K?.chartType,
2380
2397
  message: e,
2381
2398
  context: n,
2382
- payload: T(J)
2399
+ payload: T(Y)
2383
2400
  });
2384
2401
  }, [
2385
- sr,
2402
+ or,
2386
2403
  t?.id,
2387
2404
  t?.name,
2388
- G?.chartType
2405
+ K?.chartType
2389
2406
  ]), P(() => {
2390
- let e = J?.id;
2391
- Hn && Ue && e && Ue((t) => Ai(t, e));
2407
+ let e = Y?.id;
2408
+ Rn && Ue && e && Ue((t) => Ai(t, e));
2392
2409
  }, [
2393
- Hn,
2394
- J?.id,
2410
+ Rn,
2411
+ Y?.id,
2395
2412
  Ue
2396
2413
  ]), P(() => {
2397
- let e = J?.id;
2398
- !Hn && Ue && e && Ue((t) => ji(t, e));
2414
+ let e = Y?.id;
2415
+ !Rn && Ue && e && Ue((t) => ji(t, e));
2399
2416
  }, [
2400
- Hn,
2401
- Ln,
2417
+ Rn,
2418
+ Pn,
2402
2419
  Ue
2403
2420
  ]);
2404
- let { data: lr } = En(E, void 0, _, y), ur = F(() => lr?.weekStartDay === "sunday" ? "sunday" : "monday", [lr]), { mutate: dr } = te(), { mutateAsync: pr } = ee(), mr = F(() => JSON.stringify({
2421
+ let { data: sr } = Cn(E, void 0, _, y), cr = F(() => sr?.weekStartDay === "sunday" ? "sunday" : "monday", [sr]), { mutate: ur } = te(), { mutateAsync: dr } = ee(), fr = F(() => JSON.stringify({
2405
2422
  metricViewFilters: M?.metricViewFilters || [],
2406
2423
  xAxisSettings: M?.xAxisSettings || [],
2407
2424
  yAxisSettings: M?.yAxisSettings || []
@@ -2409,13 +2426,13 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2409
2426
  M?.metricViewFilters,
2410
2427
  M?.xAxisSettings,
2411
2428
  M?.yAxisSettings
2412
- ]), hr = F(() => JSON.stringify(k || []), [k]), _r = I(M);
2413
- _r.current = M;
2414
- let vr = I(k);
2415
- vr.current = k;
2416
- let yr = I(t?.id);
2417
- yr.current = t?.id, P(() => {
2418
- let e = _r.current, n = vr.current, r = yr.current, i = Dn.current !== mr, s = [...e?.metricViewFilters?.find((e) => e.id === r)?.filters?.filter((e) => !n?.find((t) => e?.name === t?.name)) || [], ...n || []];
2429
+ ]), mr = F(() => JSON.stringify(k || []), [k]), hr = I(M);
2430
+ hr.current = M;
2431
+ let gr = I(k);
2432
+ gr.current = k;
2433
+ let vr = I(t?.id);
2434
+ vr.current = t?.id, P(() => {
2435
+ let e = hr.current, n = gr.current, r = vr.current, i = wn.current !== fr, s = [...e?.metricViewFilters?.find((e) => e.id === r)?.filters?.filter((e) => !n?.find((t) => e?.name === t?.name)) || [], ...n || []];
2419
2436
  Lt((e) => {
2420
2437
  let n = t?.rlsConditions?.map((t) => {
2421
2438
  let n = e?.find((e) => e.name === t.name && e.datatype === t.datatype && e.tableName === t.tableName && e.columnName === t.columnName), r = t;
@@ -2435,7 +2452,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2435
2452
  maxDate: $(e.maxDate) ?? void 0,
2436
2453
  fromDate: $(e.fromDate) ?? void 0,
2437
2454
  toDate: $(e.toDate) ?? void 0,
2438
- ...Qi(e)
2455
+ ...$i(e)
2439
2456
  })) : e.options,
2440
2457
  variableOptions: r.datatype === "date" ? e.options?.map((e) => ({
2441
2458
  range: e.range,
@@ -2445,7 +2462,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2445
2462
  maxDate: $(e.maxDate) ?? void 0,
2446
2463
  fromDate: $(e.fromDate) ?? void 0,
2447
2464
  toDate: $(e.toDate) ?? void 0,
2448
- ...Qi(e),
2465
+ ...$i(e),
2449
2466
  value: e.name,
2450
2467
  label: e.name
2451
2468
  })) : e.options?.map((e) => ({
@@ -2455,7 +2472,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2455
2472
  selectedVariableValue: e.value ? r.datatype === "string" ? {
2456
2473
  value: e.value,
2457
2474
  label: e.value
2458
- } : $i({
2475
+ } : ea({
2459
2476
  option: t,
2460
2477
  value: e.value
2461
2478
  }) : r.selectedVariableValue
@@ -2499,28 +2516,28 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2499
2516
  h,
2500
2517
  o,
2501
2518
  a,
2502
- hr,
2503
- mr
2519
+ mr,
2520
+ fr
2504
2521
  ]), P(() => {
2505
- Dn.current = mr;
2506
- }, [mr]), P(() => {
2507
- t?.id && Ze && !q && t?.isMetric && Ze?.((e) => {
2522
+ wn.current = fr;
2523
+ }, [fr]), P(() => {
2524
+ t?.id && Ze && !J && t?.isMetric && Ze?.((e) => {
2508
2525
  let n = {
2509
- filters: [...gn || [], ...G?.tableSettings?.isServerSidePagination && G?.chartType === j.table ? Rt?.map((e) => e.condition)?.filter((e) => qe(e)) : []],
2526
+ filters: [...G || [], ...K?.tableSettings?.isServerSidePagination && K?.chartType === j.table ? Rt?.map((e) => e.condition)?.filter((e) => qe(e)) : []],
2510
2527
  xAxisSettings: {
2511
- isEnable: !!(G?.dynamicXAxis?.isEnabled || G?.enduserMeasureAndDimensions?.isEnabled) && xe.includes(G?.chartType || ""),
2512
- xaxis: G?.xAxis || ""
2528
+ isEnable: !!(K?.dynamicXAxis?.isEnabled || K?.enduserMeasureAndDimensions?.isEnabled) && xe.includes(K?.chartType || ""),
2529
+ xaxis: K?.xAxis || ""
2513
2530
  },
2514
2531
  yAxisSettings: {
2515
- isEnable: !(G?.dynamicYAxis?.isEnabled && G?.dynamicYAxis?.selectedOption && !Array.isArray(G?.dynamicYAxis?.selectedOption)),
2516
- yAxis: G?.dynamicYAxis?.selectedOption || ""
2532
+ isEnable: !(K?.dynamicYAxis?.isEnabled && K?.dynamicYAxis?.selectedOption && !Array.isArray(K?.dynamicYAxis?.selectedOption)),
2533
+ yAxis: K?.dynamicYAxis?.selectedOption || ""
2517
2534
  },
2518
2535
  id: t?.id,
2519
2536
  metricRequestData: {
2520
2537
  isAllClient: g,
2521
- timeseriesSettings: q ? void 0 : {
2522
- format: G?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase() || "monthly",
2523
- seriesField: G?.seriesField || "",
2538
+ timeseriesSettings: J ? void 0 : {
2539
+ format: K?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase() || "monthly",
2540
+ seriesField: K?.seriesField || "",
2524
2541
  isFiscal: Pe === "ind"
2525
2542
  }
2526
2543
  }
@@ -2530,17 +2547,17 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2530
2547
  }, [
2531
2548
  t?.id,
2532
2549
  t?.isMetric,
2533
- gn,
2534
- G?.timeSeriesSettings,
2535
- G?.seriesField,
2536
- q,
2550
+ G,
2551
+ K?.timeSeriesSettings,
2552
+ K?.seriesField,
2553
+ J,
2537
2554
  Pe,
2538
2555
  g,
2539
2556
  Rt,
2540
- G?.tableSettings?.isServerSidePagination,
2541
- G?.chartType,
2542
- G?.dynamicYAxis,
2543
- G?.dynamicXAxis
2557
+ K?.tableSettings?.isServerSidePagination,
2558
+ K?.chartType,
2559
+ K?.dynamicYAxis,
2560
+ K?.dynamicXAxis
2544
2561
  ]), P(() => {
2545
2562
  if (t?.drillDownSettings?.isEnableGroupBy) {
2546
2563
  let e = t?.datasetMetricSettings;
@@ -2552,46 +2569,47 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2552
2569
  levels: oi({
2553
2570
  selectedDims: e?.newDatasetSettings?.selectedDims,
2554
2571
  selectedMetrics: e?.newDatasetSettings?.selectedMetrics,
2555
- chartSettings: G,
2572
+ chartSettings: K,
2556
2573
  drilldownChartSettings: t?.drillDownSettings?.drilldownChartSettings,
2557
2574
  makeIndex: () => ye(4)
2558
2575
  })
2559
2576
  }
2560
2577
  };
2561
- an(() => rr(n, {
2578
+ U(() => rr(n, {
2562
2579
  drilledLevel: ut,
2563
2580
  drillFilters: dt,
2564
2581
  drillType: ft,
2565
2582
  underlyingDataDrillFilters: mt
2566
2583
  }) ?? n);
2567
- } else H?.isEnableGroupBy || an(t?.drillDownSettings);
2584
+ } else H?.isEnableGroupBy || U(t?.drillDownSettings);
2568
2585
  }
2569
2586
  }, [
2570
2587
  t?.drillDownSettings?.isEnableGroupBy,
2571
2588
  t?.drillDownSettings?.configV2,
2572
2589
  t?.datasetMetricSettings,
2573
- G,
2590
+ K,
2574
2591
  dt,
2575
2592
  ut,
2576
2593
  ft,
2577
- mt
2594
+ mt,
2595
+ U
2578
2596
  ]);
2579
- let br = I(!1);
2597
+ let yr = I(!1);
2580
2598
  P(() => {
2581
- if (br.current) return;
2599
+ if (yr.current) return;
2582
2600
  let e = Ke?.position;
2583
2601
  if (!Ke?.enabled || !e || !t?.id) return;
2584
2602
  let n = H?.configV2;
2585
2603
  if (!n?.levels?.length) return;
2586
- br.current = !0;
2587
- let r = fr(n, e);
2604
+ yr.current = !0;
2605
+ let r = pr(n, e);
2588
2606
  if (!r) return;
2589
- an((e) => ({
2607
+ U((e) => ({
2590
2608
  ...e,
2591
2609
  configV2: r
2592
2610
  }));
2593
2611
  let i = r.levels?.find((e) => e?.isEnable);
2594
- i?.chartSettings && K((e) => ({
2612
+ i?.chartSettings && q((e) => ({
2595
2613
  ...e,
2596
2614
  ...i.chartSettings
2597
2615
  })), p("drill-restored-from-url", {
@@ -2603,26 +2621,27 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2603
2621
  Ke?.enabled,
2604
2622
  Ke?.position,
2605
2623
  H?.configV2,
2606
- t?.id
2624
+ t?.id,
2625
+ U
2607
2626
  ]);
2608
- let xr = I(void 0);
2627
+ let br = I(void 0);
2609
2628
  P(() => {
2610
2629
  if (!Ke?.enabled || !Ke.onChange || !t?.id) return;
2611
- let e = H?.configV2?.levels || [], n = e.findIndex((e) => e?.isEnable), r = n >= 0 ? e[n] : void 0, i = n > 0 && r?.index ? cr({
2630
+ let e = H?.configV2?.levels || [], n = e.findIndex((e) => e?.isEnable), r = n >= 0 ? e[n] : void 0, i = n > 0 && r?.index ? lr({
2612
2631
  levelIndex: r.index,
2613
2632
  filters: (r.filters || []).filter((e) => e?.columnName).map((e) => ({
2614
2633
  columnName: String(e.columnName),
2615
2634
  value: String(e.value ?? "")
2616
2635
  }))
2617
2636
  }) : null;
2618
- xr.current !== i && (xr.current = i, Ke.onChange(t.id, i));
2637
+ br.current !== i && (br.current = i, Ke.onChange(t.id, i));
2619
2638
  }, [
2620
2639
  Ke?.enabled,
2621
2640
  Ke?.onChange,
2622
2641
  H?.configV2,
2623
2642
  t?.id
2624
2643
  ]);
2625
- let { mutateAsync: Sr } = ne(), wr = F(() => JSON.stringify(n?.filters), [n?.filters]), Er = F(() => {
2644
+ let { mutateAsync: xr } = ne(), Sr = F(() => JSON.stringify(n?.filters), [n?.filters]), Cr = F(() => {
2626
2645
  let e = t?.datasetMetricSettings?.metricVariables || [];
2627
2646
  if (!e || !Array.isArray(e) || !e?.length) return [];
2628
2647
  let r = [];
@@ -2635,15 +2654,15 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2635
2654
  isAllClient: g,
2636
2655
  clientColumnType: he || "STRING",
2637
2656
  dbName: t?.companyIntegration?.name,
2638
- rlsConditions: gn?.filter((e) => e.isVariableFilter),
2657
+ rlsConditions: G?.filter((e) => e.isVariableFilter),
2639
2658
  globalFilters: {
2640
2659
  ...n,
2641
2660
  filters: n?.filters?.filter((e) => e?.isVariableFilter && !!(Array.isArray(e?.value) ? e?.value?.length : e))
2642
2661
  },
2643
- weekStartDay: ur
2662
+ weekStartDay: cr
2644
2663
  }),
2645
2664
  alias: O
2646
- } : void 0, u = s.dependOnOptions?.length ? gn?.filter((e) => s.dependOnOptions.some((t) => t.type === "metric" && t.filter?.value === e.name && t.column)) : [], d = s.dependOnOptions?.length ? n?.filters?.filter((e) => Array.isArray(e?.value) ? e?.value?.length : e && s.dependOnOptions.some((t) => t.type === "dashboard" && t.filter?.value === e.label && t.column)) : [], f = u?.map((e) => {
2665
+ } : void 0, u = s.dependOnOptions?.length ? G?.filter((e) => s.dependOnOptions.some((t) => t.type === "metric" && t.filter?.value === e.name && t.column)) : [], d = s.dependOnOptions?.length ? n?.filters?.filter((e) => Array.isArray(e?.value) ? e?.value?.length : e && s.dependOnOptions.some((t) => t.type === "dashboard" && t.filter?.value === e.label && t.column)) : [], f = u?.map((e) => {
2647
2666
  let t = le(e);
2648
2667
  return e.datatype === "date" && t === void 0 ? null : {
2649
2668
  columnName: s.dependOnOptions.find((t) => e.name === t.filter?.value)?.column || "",
@@ -2682,59 +2701,59 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2682
2701
  return r;
2683
2702
  }, [
2684
2703
  t?.datasetMetricSettings?.metricVariables,
2685
- wr,
2686
- gn,
2704
+ Sr,
2705
+ G,
2687
2706
  he,
2688
2707
  E,
2689
2708
  o,
2690
2709
  a,
2691
2710
  g,
2692
2711
  _e
2693
- ]), Or = F(() => JSON.stringify(Er), [Er]), kr = I(null), Ar = I(0), Mr = I({
2712
+ ]), Tr = F(() => JSON.stringify(Cr), [Cr]), Dr = I(null), kr = I(0), Ar = I({
2694
2713
  clientId: a,
2695
2714
  encryptedClientId: y,
2696
2715
  isFrontendApp: _,
2697
2716
  token: lt
2698
2717
  });
2699
- Mr.current.clientId = a, Mr.current.encryptedClientId = y, Mr.current.isFrontendApp = _, Mr.current.token = lt;
2700
- let Nr = I(Sr);
2701
- Nr.current = Sr, P(() => {
2702
- Ar.current += 1;
2703
- let e = Ar.current, t = () => Ar.current !== e;
2704
- if (Er?.length) {
2705
- let { clientId: e, encryptedClientId: n, isFrontendApp: r, token: i } = Mr.current;
2718
+ Ar.current.clientId = a, Ar.current.encryptedClientId = y, Ar.current.isFrontendApp = _, Ar.current.token = lt;
2719
+ let jr = I(xr);
2720
+ jr.current = xr, P(() => {
2721
+ kr.current += 1;
2722
+ let e = kr.current, t = () => kr.current !== e;
2723
+ if (Cr?.length) {
2724
+ let { clientId: e, encryptedClientId: n, isFrontendApp: r, token: i } = Ar.current;
2706
2725
  Bi({
2707
- entries: Er,
2708
- fetchColumnValues: Nr.current,
2726
+ entries: Cr,
2727
+ fetchColumnValues: jr.current,
2709
2728
  ctx: {
2710
2729
  clientId: e,
2711
2730
  encryptedClientId: n,
2712
2731
  isFrontendApp: r,
2713
2732
  token: i
2714
2733
  },
2715
- onSeed: (e) => bn(e),
2716
- onResolved: (e, t) => bn((n) => ({
2734
+ onSeed: (e) => _n(e),
2735
+ onResolved: (e, t) => _n((n) => ({
2717
2736
  ...n,
2718
2737
  [e]: t
2719
2738
  })),
2720
2739
  onLoading: (e) => vt(e),
2721
2740
  onSettle: () => {
2722
- kr.current && clearTimeout(kr.current), kr.current = setTimeout(() => {
2723
- kr.current = null, vt(!1);
2741
+ Dr.current && clearTimeout(Dr.current), Dr.current = setTimeout(() => {
2742
+ Dr.current = null, vt(!1);
2724
2743
  }, 200);
2725
2744
  },
2726
2745
  isCancelled: t
2727
2746
  }).catch(() => {});
2728
2747
  }
2729
2748
  return () => {
2730
- Ar.current += 1, kr.current &&= (clearTimeout(kr.current), null);
2749
+ kr.current += 1, Dr.current &&= (clearTimeout(Dr.current), null);
2731
2750
  };
2732
- }, [Or]);
2733
- let Pr = F(() => (t?.datasetMetricSettings)?.newDatasetSettings?.selectedDims?.[0]?.name, [t]);
2751
+ }, [Tr]);
2752
+ let Nr = F(() => (t?.datasetMetricSettings)?.newDatasetSettings?.selectedDims?.[0]?.name, [t]);
2734
2753
  F(() => Ve(t?.datasetMetricSettings?.selectedDimensions?.[V.length < t?.datasetMetricSettings?.selectedDimensions?.length ? V.length : 0] || ""), [t?.datasetMetricSettings, V]);
2735
- let Fr = F(() => {
2754
+ let Pr = F(() => {
2736
2755
  let e = t?.drillDownSettings?.isEnableGroupBy;
2737
- return U ? [...z?.length ? z : [], ...gr({
2756
+ return W ? [...z?.length ? z : [], ..._r({
2738
2757
  filters: u,
2739
2758
  metricId: t?.id,
2740
2759
  isGroupByEnabled: e,
@@ -2743,68 +2762,68 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2743
2762
  }, [
2744
2763
  u,
2745
2764
  t?.id,
2746
- U,
2765
+ W,
2747
2766
  t?.drillDownSettings?.isEnableGroupBy,
2748
2767
  z
2749
- ]), Lr = N((e = []) => e.filter((e) => e.isAddOnMetrics).map((e) => s ? {
2768
+ ]), Fr = N((e = []) => e.filter((e) => e.isAddOnMetrics).map((e) => s ? {
2750
2769
  ...e,
2751
- dimensionColumn: G?.xAxis || "",
2752
- measureColumn: G?.yAxisList?.[0] || "",
2770
+ dimensionColumn: K?.xAxis || "",
2771
+ measureColumn: K?.yAxisList?.[0] || "",
2753
2772
  options: e.datatype === "date" ? e.options : [],
2754
2773
  variableOptions: e.datatype === "date" ? e.variableOptions : []
2755
2774
  } : {
2756
2775
  ...e,
2757
- dimensionColumn: G?.xAxis || "",
2758
- measureColumn: G?.yAxisList?.[0] || "",
2776
+ dimensionColumn: K?.xAxis || "",
2777
+ measureColumn: K?.yAxisList?.[0] || "",
2759
2778
  value: e.isAppFilter ? e.datatype === "date" ? Te(c?.values?.[e.name], e?.datePresetOptions || e?.presetDateOptions) || (e?.options)?.find((t) => t.name === (c?.values?.[e.name] ?? e.value)) : c?.values?.[e.name] ?? e.value : e.value,
2760
2779
  options: e.datatype === "date" ? e?.options?.map((t) => Pe === "ind" && e.datatype === "date" ? {
2761
2780
  ...t,
2762
2781
  isFiscal: !0
2763
2782
  } : t) : [],
2764
2783
  variableOptions: e.datatype === "date" ? e.variableOptions : []
2765
- }).filter((e) => jn(e)), [
2784
+ }).filter((e) => On(e)), [
2766
2785
  c?.values,
2767
2786
  Pe,
2768
- G?.xAxis,
2769
- G?.yAxisList,
2787
+ K?.xAxis,
2788
+ K?.yAxisList,
2770
2789
  s,
2771
- jn
2790
+ On
2772
2791
  ]);
2773
- F(() => Lr(Fr), [Lr, Fr]), P(() => {
2774
- Fr?.some((e) => e.isAddOnMetrics) ? yn(Lr(Fr)) : yn([]);
2775
- }, [Lr, Fr]);
2776
- let Rr = F(() => G?.chartType === j.singleValue && !!G?.customSettings?.comparisonValueShow && !!G?.customSettings?.comparisonTimeGrain && !!G?.customSettings?.comparisonTimePeriod && !!G?.singleValue, [G]);
2792
+ F(() => Fr(Pr), [Fr, Pr]), P(() => {
2793
+ Pr?.some((e) => e.isAddOnMetrics) ? hn(Fr(Pr)) : hn([]);
2794
+ }, [Fr, Pr]);
2795
+ let Ir = F(() => K?.chartType === j.singleValue && !!K?.customSettings?.comparisonValueShow && !!K?.customSettings?.comparisonTimeGrain && !!K?.customSettings?.comparisonTimePeriod && !!K?.singleValue, [K]);
2777
2796
  P(() => {
2778
2797
  let e = X;
2779
- if (kn({
2798
+ if (En({
2780
2799
  data: [],
2781
2800
  error: "",
2782
2801
  isLoading: !1,
2783
2802
  currentValue: ""
2784
- }), G?.chartType === j.table) {
2803
+ }), K?.chartType === j.table) {
2785
2804
  let t = e?.totalRecords;
2786
2805
  typeof t == "number" && Ft(t);
2787
2806
  }
2788
2807
  p("metric-query-response-applied", {
2789
2808
  metricId: t?.id,
2790
2809
  metricName: t?.name,
2791
- chartType: G?.chartType,
2792
- rowCount: Q?.length || 0,
2793
- columns: Object.keys(Q?.[0] || {}),
2810
+ chartType: K?.chartType,
2811
+ rowCount: Z?.length || 0,
2812
+ columns: Object.keys(Z?.[0] || {}),
2794
2813
  totalRecords: e?.totalRecords,
2795
- truncation: ar,
2814
+ truncation: ir,
2796
2815
  drillConfig: x(H?.configV2)
2797
2816
  });
2798
2817
  let n = !!H?.isEnableGroupBy && !!H?.configV2?.isEnable && !!H?.configV2?.levels?.some((e) => e?.isEnable);
2799
- if (t?.datasetMetricSettings?.isUseRawSQL && !(An && n)) {
2800
- let e = Object.keys(Q?.[0] || {});
2801
- K((t) => ({
2818
+ if (t?.datasetMetricSettings?.isUseRawSQL && !(Dn && n)) {
2819
+ let e = Object.keys(Z?.[0] || {});
2820
+ q((t) => ({
2802
2821
  ...t,
2803
2822
  yAxisList: e.length ? e : t?.yAxisList || []
2804
2823
  }));
2805
2824
  }
2806
2825
  let r = e?.metaData;
2807
- un(me(r?.groupbyColumnList)), Jt((e) => ({
2826
+ sn(me(r?.groupbyColumnList)), Jt((e) => ({
2808
2827
  ...e,
2809
2828
  report: "",
2810
2829
  isLoading: e?.isLoading,
@@ -2813,38 +2832,38 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2813
2832
  }, [
2814
2833
  X,
2815
2834
  t?.datasetMetricSettings,
2816
- Q,
2817
- ar,
2818
- An,
2835
+ Z,
2836
+ ir,
2837
+ Dn,
2819
2838
  H?.isEnableGroupBy,
2820
2839
  H?.configV2
2821
2840
  ]), P(() => {
2822
- t?.datasetMetricSettings?.createdSorts?.length ? Sn(!0) : Sn(!1);
2841
+ t?.datasetMetricSettings?.createdSorts?.length ? yn(!0) : yn(!1);
2823
2842
  }, [t?.datasetMetricSettings?.createdSorts?.length]), P(() => {
2824
- G?.chartType === j.timeSeries && G?.timeSeriesSettings?.groupBySettings?.value && !q && K((e) => ({
2843
+ K?.chartType === j.timeSeries && K?.timeSeriesSettings?.groupBySettings?.value && !J && q((e) => ({
2825
2844
  ...e,
2826
- xAxis: `${G?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase()} of ${Pr}`
2845
+ xAxis: `${K?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase()} of ${Nr}`
2827
2846
  }));
2828
2847
  }, [
2829
- Q,
2830
- G?.chartType,
2831
- G?.timeSeriesSettings,
2832
- q
2848
+ Z,
2849
+ K?.chartType,
2850
+ K?.timeSeriesSettings,
2851
+ J
2833
2852
  ]), P(() => {
2834
- if (G?.isEnableComparisonFilter && [j.line].includes(G?.chartType)) {
2835
- let e = t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics || [], n = Object?.keys(Q?.[0] || {});
2836
- K((t) => ({
2853
+ if (K?.isEnableComparisonFilter && [j.line].includes(K?.chartType)) {
2854
+ let e = t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics || [], n = Object?.keys(Z?.[0] || {});
2855
+ q((t) => ({
2837
2856
  ...t,
2838
2857
  yAxisList: [...n.filter((t) => e?.some((e) => t.startsWith(e.alias)))]
2839
2858
  }));
2840
2859
  }
2841
2860
  }, [
2842
- Q,
2843
- G?.isEnableComparisonFilter,
2861
+ Z,
2862
+ K?.isEnableComparisonFilter,
2844
2863
  R,
2845
- G?.chartType
2864
+ K?.chartType
2846
2865
  ]);
2847
- let zr = N((e, n, r, a, o, s) => {
2866
+ let Rr = N((e, n, r, a, o, s) => {
2848
2867
  C("metric-filter-applied", {
2849
2868
  metricId: t?.id,
2850
2869
  hasCustomValue: !!a,
@@ -2870,7 +2889,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2870
2889
  label: n,
2871
2890
  endDate: a.endDate,
2872
2891
  startDate: a.startDate,
2873
- ...Qi(a),
2892
+ ...$i(a),
2874
2893
  timeGrainValue: s
2875
2894
  }
2876
2895
  } : t) : o ? (t) => t?.map((t) => t.name === e ? {
@@ -2889,11 +2908,11 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2889
2908
  label: r || n
2890
2909
  }
2891
2910
  } : t));
2892
- }, []), Br = N((e) => {
2911
+ }, []), zr = N((e) => {
2893
2912
  e?.event && e?.event?.event?.preventDefault(), p("chart-click-params-captured", {
2894
2913
  metricId: t?.id,
2895
2914
  metricName: t?.name,
2896
- chartType: G?.chartType,
2915
+ chartType: K?.chartType,
2897
2916
  name: e?.name,
2898
2917
  value: e?.value,
2899
2918
  seriesName: e?.seriesName,
@@ -2903,10 +2922,10 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2903
2922
  }, [
2904
2923
  t?.id,
2905
2924
  t?.name,
2906
- G?.chartType,
2925
+ K?.chartType,
2907
2926
  H?.configV2
2908
- ]), Vr = F(() => {
2909
- let e = Array.isArray(Q) && Q.length && B?.name != null ? Q?.map((e) => Object.entries(e).find(([, e]) => (typeof e == "number" && typeof B?.name == "string" ? e?.toString() : e) === B.name)?.[0]).filter((e) => e)[0] : "";
2927
+ ]), Q = F(() => {
2928
+ let e = Array.isArray(Z) && Z.length && B?.name != null ? Z?.map((e) => Object.entries(e).find(([, e]) => (typeof e == "number" && typeof B?.name == "string" ? e?.toString() : e) === B.name)?.[0]).filter((e) => e)[0] : "";
2910
2929
  if (!e) return e;
2911
2930
  let n = t?.datasetMetricSettings?.newDatasetSettings, r = [...n?.selectedDims || [], ...n?.selectedMetrics || []], i = H?.configV2?.levels?.flatMap((e) => e?.dimensions || []) || [];
2912
2931
  return ze(e, {
@@ -2915,70 +2934,70 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2915
2934
  dbName: t?.companyIntegration?.name
2916
2935
  });
2917
2936
  }, [
2918
- Q,
2937
+ Z,
2919
2938
  B?.name,
2920
2939
  t?.datasetMetricSettings,
2921
2940
  t?.companyIntegration?.name,
2922
2941
  H?.configV2?.levels
2923
- ]), Ur = F(() => {
2942
+ ]), Br = F(() => {
2924
2943
  if (!B) return;
2925
- let e = G?.isMultiDimension || G?.isDynamicSeries ? G?.seriesField : void 0, t = e === "ungrouped" ? void 0 : e, n = !t && typeof B.seriesName == "string" ? B.seriesName : G?.yAxisList?.[0] || G?.singleValue, r = $e(G);
2944
+ let e = K?.isMultiDimension || K?.isDynamicSeries ? K?.seriesField : void 0, t = e === "ungrouped" ? void 0 : e, n = !t && typeof B.seriesName == "string" ? B.seriesName : K?.yAxisList?.[0] || K?.singleValue, r = $e(K);
2926
2945
  return Hr({
2927
2946
  params: B,
2928
- axisDimension: Vr ? { columnName: Vr } : void 0,
2947
+ axisDimension: Q ? { columnName: Q } : void 0,
2929
2948
  seriesDimension: t ? { columnName: t } : void 0,
2930
2949
  measure: n ? { columnName: n } : void 0,
2931
2950
  formatMeasure: r ? (e) => r(e, n) : void 0
2932
2951
  });
2933
2952
  }, [
2934
2953
  B,
2935
- Vr,
2936
- G
2937
- ]), Wr = F(() => {
2954
+ Q,
2955
+ K
2956
+ ]), Vr = F(() => {
2938
2957
  let e = t?.datasetMetricSettings?.newDatasetSettings;
2939
2958
  return {
2940
2959
  selectedDims: e?.selectedDims,
2941
2960
  selectedMetrics: e?.selectedMetrics,
2942
2961
  levelDimensions: H?.configV2?.levels?.flatMap((e) => e?.dimensions || []) || []
2943
2962
  };
2944
- }, [H?.configV2?.levels, t?.datasetMetricSettings]), Gr = N((e) => ve({
2963
+ }, [H?.configV2?.levels, t?.datasetMetricSettings]), Ur = N((e) => ve({
2945
2964
  filter: e,
2946
- ...Wr
2947
- }), [Wr]), Kr = F(() => {
2948
- if (tn.current !== void 0 && V === en.current) return tn.current;
2965
+ ...Vr
2966
+ }), [Vr]), Wr = F(() => {
2967
+ if (en.current !== void 0 && V === $t.current) return en.current;
2949
2968
  let e = H?.configV2?.levels?.find((e) => e?.isEnable)?.filters || [];
2950
- return (e.length ? e : V).map(Gr);
2969
+ return (e.length ? e : V).map(Ur);
2951
2970
  }, [
2952
2971
  H?.configV2?.levels,
2953
2972
  V,
2954
- Gr,
2955
- en,
2956
- tn
2957
- ]), qr = F(() => Le({
2958
- columnName: Vr,
2959
- ...Wr
2960
- }), [Vr, Wr]), { getUnderlyingData: Jr } = Vn({
2973
+ Ur,
2974
+ $t,
2975
+ en
2976
+ ]), Gr = F(() => Le({
2977
+ columnName: Q,
2978
+ ...Vr
2979
+ }), [Q, Vr]), { getUnderlyingData: Kr } = Bn({
2961
2980
  clientName: a,
2962
2981
  dbName: t?.companyIntegration?.name,
2963
2982
  tenancyType: o,
2964
- values: Nn,
2983
+ values: An,
2965
2984
  companyId: t?.companyId,
2966
2985
  query: ie(t?.query, t?.companyId),
2967
2986
  workspaceId: E,
2968
2987
  metricId: t?.id,
2969
2988
  dashboardId: w,
2970
- rlsConditions: gn,
2989
+ rlsConditions: G,
2971
2990
  globalFilters: n,
2972
2991
  isAllClient: !!g,
2973
- dataMartRelationships: Mn,
2992
+ dataMartRelationships: kn,
2974
2993
  customSql: t?.clickActions?.underlyingData?.sql,
2975
- isEnableCustomSQL: G?.chartType === j.singleValue && t?.clickActions?.underlyingData?.isEnable && t?.clickActions?.underlyingData?.sql,
2994
+ isEnableCustomSQL: K?.chartType === j.singleValue && t?.clickActions?.underlyingData?.isEnable && t?.clickActions?.underlyingData?.sql,
2976
2995
  datasourceId: _e,
2977
- drillFilters: Kr,
2996
+ drillFilters: Wr,
2978
2997
  token: lt || "",
2979
2998
  isFrontendApp: _,
2980
2999
  encryptedClientId: _ ? y || "" : a || ""
2981
- }), Yr = async (e, n, r, i, s, c) => {
3000
+ }), qr = async (e, n, r, i, s, c) => {
2982
3001
  p("drill-config-change-start", {
2983
3002
  metricId: t?.id,
2984
3003
  metricName: t?.name,
@@ -2991,7 +3010,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
2991
3010
  stateConfig: x(H?.configV2)
2992
3011
  });
2993
3012
  let d = t?.datasetMetricSettings;
2994
- if (!e || !An && !d?.newDatasetSettings?.configuration || !t?.companyIntegration?.name) {
3013
+ if (!e || !Dn && !d?.newDatasetSettings?.configuration || !t?.companyIntegration?.name) {
2995
3014
  p("drill-config-change-skipped", {
2996
3015
  metricId: t?.id,
2997
3016
  hasStateConfig: !!H?.configV2,
@@ -3005,13 +3024,13 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3005
3024
  return;
3006
3025
  }
3007
3026
  let f = n?.name, h = (e?.levels || []).find((e) => r ? e?.index === r : e?.isEnable), g = h?.dimensions?.[0]?.alias, _ = n?.rowFilters || [], { config: v, outcome: y } = ui({
3008
- config: An && bi(e) || e,
3027
+ config: Dn && bi(e) || e,
3009
3028
  clickedLevelIndex: r,
3010
3029
  isReset: i,
3011
3030
  clickedValue: f,
3012
3031
  rowFilters: n?.rowFilters,
3013
3032
  adhocDescent: c,
3014
- enrichFilter: Gr
3033
+ enrichFilter: Ur
3015
3034
  });
3016
3035
  if (p("drill-config-level-change-resolved", {
3017
3036
  metricId: t?.id,
@@ -3030,8 +3049,8 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3030
3049
  });
3031
3050
  return;
3032
3051
  }
3033
- let b = v, ee = [...s || [], ...sn], S = ee.length ? [...d?.newDatasetSettings?.selectedDims || [], ...ee] : d?.newDatasetSettings?.selectedDims;
3034
- if (b = An ? b : Ie({
3052
+ let b = v, ee = [...s || [], ...nn], S = ee.length ? [...d?.newDatasetSettings?.selectedDims || [], ...ee] : d?.newDatasetSettings?.selectedDims;
3053
+ if (b = Dn ? b : Ie({
3035
3054
  config: b,
3036
3055
  selectedDims: S,
3037
3056
  selectedMetrics: d?.newDatasetSettings?.selectedMetrics,
@@ -3049,10 +3068,10 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3049
3068
  }
3050
3069
  xt(null);
3051
3070
  let C = b?.levels?.find((e) => e?.isEnable), te = !!b?.levels?.[b?.levels?.length - 1]?.isEnable, w = b?.levels?.[0]?.isEnable, T = ii({
3052
- parentSettings: G,
3071
+ parentSettings: K,
3053
3072
  levelSettings: C?.chartSettings,
3054
3073
  measures: C?.measures
3055
- }) || G, E = T?.chartType === j.table, ne = [...C?.dimensions?.map((e) => e.alias) || [], ...C?.measures?.map((e) => e.alias) || []], D = {
3074
+ }) || K, E = T?.chartType === j.table, ne = [...C?.dimensions?.map((e) => e.alias) || [], ...C?.measures?.map((e) => e.alias) || []], D = {
3056
3075
  ...T,
3057
3076
  xAxis: C?.dimensions?.[0]?.alias || "",
3058
3077
  yAxisList: te && !T?.chartType || E ? ne : C?.measures?.map((e) => e.alias) || [],
@@ -3072,7 +3091,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3072
3091
  yAxisList: D?.yAxisList,
3073
3092
  tableColumns: ne,
3074
3093
  updatedConfig: x(b)
3075
- }), an((e) => ({
3094
+ }), U((e) => ({
3076
3095
  ...e,
3077
3096
  configV2: {
3078
3097
  ...b || {},
@@ -3081,7 +3100,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3081
3100
  chartSettings: D
3082
3101
  } : e) || []
3083
3102
  }
3084
- })), K((e) => D), y === "descend" || y === "adhoc-descend") {
3103
+ })), q((e) => D), y === "descend" || y === "adhoc-descend") {
3085
3104
  let e = jt.current, t = e ? e.querySelector("[data-chart-engine=\"v2\"]") ? "v2" : "v1" : void 0;
3086
3105
  m("metric.drilled", {
3087
3106
  level: b.levels?.findIndex((e) => e.isEnable) ?? -1,
@@ -3093,8 +3112,8 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3093
3112
  chartType: D?.chartType,
3094
3113
  activeLevelIndex: C?.index,
3095
3114
  drillConfig: x(b)
3096
- }), on && !An) {
3097
- let e = Tr({
3115
+ }), an && !Dn) {
3116
+ let e = Er({
3098
3117
  existing: u,
3099
3118
  isReset: i,
3100
3119
  levelIndex: r,
@@ -3106,8 +3125,8 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3106
3125
  activeLevelTableName: re,
3107
3126
  tenancyLevel: o,
3108
3127
  clientId: a,
3109
- sourceMetricId: U ? t?.id : void 0
3110
- }), n = !i && !r ? Cr({
3128
+ sourceMetricId: W ? t?.id : void 0
3129
+ }), n = !i && !r ? wr({
3111
3130
  columnName: g,
3112
3131
  rowFilters: _,
3113
3132
  selectedDims: d?.newDatasetSettings?.selectedDims
@@ -3125,9 +3144,9 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3125
3144
  error_code: "DRILL_COLUMN_UNAVAILABLE"
3126
3145
  })) : l?.(e);
3127
3146
  }
3128
- }, Xr = ({ columnName: e, value: n, mode: r = "only" }) => {
3129
- if (!on) return;
3130
- let i = t?.datasetMetricSettings, s = Cr({
3147
+ }, Jr = ({ columnName: e, value: n, mode: r = "only" }) => {
3148
+ if (!an) return;
3149
+ let i = t?.datasetMetricSettings, s = wr({
3131
3150
  columnName: e,
3132
3151
  selectedDims: i?.newDatasetSettings?.selectedDims,
3133
3152
  requiresSchemaMetadata: !0
@@ -3143,7 +3162,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3143
3162
  });
3144
3163
  return;
3145
3164
  }
3146
- let c = jr({
3165
+ let c = Mr({
3147
3166
  existing: u,
3148
3167
  columnName: e,
3149
3168
  value: n,
@@ -3151,7 +3170,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3151
3170
  selectedDims: i?.newDatasetSettings?.selectedDims,
3152
3171
  tenancyLevel: o,
3153
3172
  clientId: a,
3154
- sourceMetricId: U ? t?.id : void 0
3173
+ sourceMetricId: W ? t?.id : void 0
3155
3174
  });
3156
3175
  p("point-cross-filter-committed", {
3157
3176
  metricId: t?.id,
@@ -3159,9 +3178,9 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3159
3178
  mode: r,
3160
3179
  crossFilterCount: c?.length || 0
3161
3180
  }), l?.(c);
3162
- }, Zr = ({ columnName: e, value: n, mode: r = "only" }) => {
3181
+ }, Yr = ({ columnName: e, value: n, mode: r = "only" }) => {
3163
3182
  if (!t?.id) return;
3164
- let i = t?.datasetMetricSettings, s = Cr({
3183
+ let i = t?.datasetMetricSettings, s = wr({
3165
3184
  columnName: e,
3166
3185
  selectedDims: i?.newDatasetSettings?.selectedDims,
3167
3186
  requiresSchemaMetadata: !0
@@ -3177,7 +3196,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3177
3196
  });
3178
3197
  return;
3179
3198
  }
3180
- let c = jr({
3199
+ let c = Mr({
3181
3200
  existing: k,
3182
3201
  columnName: e,
3183
3202
  value: n,
@@ -3192,7 +3211,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3192
3211
  mode: r,
3193
3212
  filterCount: c?.length || 0
3194
3213
  }), Ae?.(t.id, c);
3195
- }, Qr = async (e, n) => {
3214
+ }, Xr = async (e, n) => {
3196
3215
  p("drill-down-handler-start", {
3197
3216
  metricId: t?.id,
3198
3217
  metricName: t?.name,
@@ -3201,11 +3220,11 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3201
3220
  paramsSeriesName: e?.seriesName,
3202
3221
  rowFilters: e?.rowFilters || n,
3203
3222
  drillConfig: x(H?.configV2)
3204
- }), await Yr(H?.configV2, e), p("drill-down-handler-complete", {
3223
+ }), await qr(H?.configV2, e), p("drill-down-handler-complete", {
3205
3224
  metricId: t?.id,
3206
3225
  metricName: t?.name
3207
3226
  });
3208
- }, $r = async ({ dimension: e, params: n, point: r }) => {
3227
+ }, Zr = async ({ dimension: e, params: n, point: r }) => {
3209
3228
  if (!e?.alias) return;
3210
3229
  let i = t?.datasetMetricSettings, a = H?.configV2, o = a?.levels || [], s = o.findIndex((e) => e?.isEnable), c = (s >= 0 ? o.slice(0, s + 1) : []).map((e) => ({
3211
3230
  ...e,
@@ -3214,7 +3233,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3214
3233
  dimension: e,
3215
3234
  measures: i?.newDatasetSettings?.selectedMetrics || [],
3216
3235
  index: ye(4),
3217
- chartSettings: G
3236
+ chartSettings: K
3218
3237
  }), u = {
3219
3238
  ...a || {},
3220
3239
  isEnable: !0,
@@ -3222,7 +3241,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3222
3241
  }, d = c[c.length - 1], f = {
3223
3242
  columnName: d?.dimensions?.[0]?.alias || i?.newDatasetSettings?.selectedDims?.[0]?.alias,
3224
3243
  parentFilters: d?.filters || [],
3225
- pointFilters: Ir(r, Gr).filters
3244
+ pointFilters: Lr(r, Ur).filters
3226
3245
  };
3227
3246
  p("adhoc-drill-start", {
3228
3247
  metricId: t?.id,
@@ -3230,17 +3249,17 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3230
3249
  clickedValue: n?.name,
3231
3250
  seededConfig: !a,
3232
3251
  drillConfig: x(u)
3233
- }), cn((t) => t.some((t) => t?.alias === e?.alias) ? t : [...t, e]), an((e) => ({
3252
+ }), rn((t) => t.some((t) => t?.alias === e?.alias) ? t : [...t, e]), U((e) => ({
3234
3253
  ...e,
3235
3254
  isEnableGroupBy: !0,
3236
3255
  configV2: u
3237
- })), await Yr(u, n, void 0, !1, [e], f);
3238
- }, ei = ({ filters: e, nextLevel: r, currentValue: i }) => {
3239
- let o = t?.datasetMetricSettings?.newDatasetSettings, s = o?.configuration, c = o?.selectedDims || [], l = o?.selectedMetrics || [], u = t?.datasetMetricSettings?.createdSorts || [], { headerColumns: d, nonHeaderColumns: f } = c.reduce((e, t) => (G?.pivotTableSettings2?.headers?.includes(t.alias) ? e.headerColumns.push(t) : e.nonHeaderColumns.push(t), e), {
3256
+ })), await qr(u, n, void 0, !1, [e], f);
3257
+ }, Qr = ({ filters: e, nextLevel: r, currentValue: i }) => {
3258
+ let o = t?.datasetMetricSettings?.newDatasetSettings, s = o?.configuration, c = o?.selectedDims || [], l = o?.selectedMetrics || [], u = t?.datasetMetricSettings?.createdSorts || [], { headerColumns: d, nonHeaderColumns: f } = c.reduce((e, t) => (K?.pivotTableSettings2?.headers?.includes(t.alias) ? e.headerColumns.push(t) : e.nonHeaderColumns.push(t), e), {
3240
3259
  headerColumns: [],
3241
3260
  nonHeaderColumns: []
3242
3261
  }), p = e?.map((e) => `${e.columnName};;${e.value}`).join(";;");
3243
- kn((e) => ({
3262
+ En((e) => ({
3244
3263
  ...e,
3245
3264
  data: e.data.filter((e) => e.key !== p),
3246
3265
  error: "",
@@ -3272,9 +3291,9 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3272
3291
  isApplyGlobalFilter: !0,
3273
3292
  isApplyMetricFilter: !0,
3274
3293
  globalFilters: n,
3275
- rlsConditions: gn
3294
+ rlsConditions: G
3276
3295
  };
3277
- dr({
3296
+ ur({
3278
3297
  data: {
3279
3298
  configuration: C,
3280
3299
  id: E,
@@ -3287,7 +3306,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3287
3306
  isFrontendApp: _
3288
3307
  }, { onSuccess(e) {
3289
3308
  let n = e?.error, r = e?.data;
3290
- if (n?.message) kn((e) => ({
3309
+ if (n?.message) En((e) => ({
3291
3310
  ...e,
3292
3311
  error: n?.message,
3293
3312
  isLoading: !1,
@@ -3295,7 +3314,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3295
3314
  }));
3296
3315
  else {
3297
3316
  let e = Fe(Array.isArray(r) ? r : [], c, l), n = it(e);
3298
- kn((e) => ({
3317
+ En((e) => ({
3299
3318
  data: [...e.data, {
3300
3319
  key: p,
3301
3320
  data: n
@@ -3303,24 +3322,24 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3303
3322
  error: "",
3304
3323
  isLoading: !1,
3305
3324
  currentValue: ""
3306
- })), K((e) => ({
3325
+ })), q((e) => ({
3307
3326
  ...e,
3308
3327
  pivotTableSettings2: {
3309
- ...G?.pivotTableSettings2,
3328
+ ...K?.pivotTableSettings2,
3310
3329
  dimensions: Qe(f, t?.companyIntegration?.name || ""),
3311
3330
  headers: Qe(d, t?.companyIntegration?.name || "")
3312
3331
  }
3313
3332
  }));
3314
3333
  }
3315
3334
  } });
3316
- }, ti = N(async (e, n) => {
3335
+ }, $r = N(async (e, n) => {
3317
3336
  p("drill-level-click-handler-start", {
3318
3337
  metricId: t?.id,
3319
3338
  metricName: t?.name,
3320
3339
  clickedLevelIndex: e,
3321
3340
  isReset: !!n,
3322
3341
  drillConfig: x(H?.configV2)
3323
- }), n && cn([]), xt(null), await Yr(H?.configV2, void 0, e, n), p("drill-level-click-handler-complete", {
3342
+ }), n && rn([]), xt(null), await qr(H?.configV2, void 0, e, n), p("drill-level-click-handler-complete", {
3324
3343
  metricId: t?.id,
3325
3344
  metricName: t?.name,
3326
3345
  clickedLevelIndex: e,
@@ -3329,8 +3348,9 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3329
3348
  }, [
3330
3349
  H?.configV2,
3331
3350
  t?.id,
3332
- t?.name
3333
- ]), ni = N((e) => {
3351
+ t?.name,
3352
+ rn
3353
+ ]), ei = N((e) => {
3334
3354
  if (e) Lt((e) => [...e?.filter((e) => e.group !== `${R}`)]), It((e) => e - 1);
3335
3355
  else {
3336
3356
  let e = z.filter((e) => !e?.group)?.map((e) => ({
@@ -3350,7 +3370,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3350
3370
  }));
3351
3371
  e.length && (Lt((t) => [...t, ...e]), It((e) => e + 1));
3352
3372
  }
3353
- }, [z]), ri = N(async () => {
3373
+ }, [z]), ti = N(async () => {
3354
3374
  qt.report ? Jt((e) => ({
3355
3375
  ...e,
3356
3376
  isOpen: !0
@@ -3358,9 +3378,9 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3358
3378
  report: "",
3359
3379
  isLoading: !0,
3360
3380
  isOpen: !0
3361
- }), await pr({
3381
+ }), await dr({
3362
3382
  data: {
3363
- data: Q,
3383
+ data: Z,
3364
3384
  wId: E
3365
3385
  },
3366
3386
  clientId: _ ? y || "" : a,
@@ -3384,15 +3404,15 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3384
3404
  }
3385
3405
  }));
3386
3406
  }, [
3387
- Q,
3407
+ Z,
3388
3408
  a,
3389
3409
  _,
3390
3410
  v,
3391
3411
  y,
3392
3412
  a,
3393
3413
  qt
3394
- ]), ci = F(() => {
3395
- let e = t?.datasetMetricSettings?.newDatasetSettings, n = e?.configuration, r = Ye(Q || []), i = r, a = e?.selectedDims?.some((e) => De(e?.datatype)) || Me(Q?.[0] || ""), o = e?.selectedDims?.length > 1 && e?.selectedMetrics?.length > 0, s = [
3414
+ ]), ni = F(() => {
3415
+ let e = t?.datasetMetricSettings?.newDatasetSettings, n = e?.configuration, r = Ye(Z || []), i = r, a = e?.selectedDims?.some((e) => De(e?.datatype)) || Me(Z?.[0] || ""), o = e?.selectedDims?.length > 1 && e?.selectedMetrics?.length > 0, s = [
3396
3416
  j.pivot,
3397
3417
  j.pivotV2,
3398
3418
  j.pivotV3,
@@ -3406,48 +3426,48 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3406
3426
  ], c = !!n?.aggregates?.length && !!n?.dimensions?.length;
3407
3427
  return c && a && (i = [...r?.filter((e) => !s?.includes(e)), ...s]), c && !a && (i = [...r?.filter((e) => !s?.includes(e)), ...s?.filter((e) => e !== j.timeSeries)]), !c && a && (i = [...r?.filter((e) => !s?.includes(e)), j.timeSeries]), !c && !a && (i = r?.filter((e) => !s?.includes(e))), H?.isEnableGroupBy && H?.configV2 && (i = i?.filter((e) => Je?.includes(e))), o || (i = i?.filter((e) => e !== j.bubbleV2)), i;
3408
3428
  }, [
3409
- Q,
3410
- G?.xAxis,
3429
+ Z,
3430
+ K?.xAxis,
3411
3431
  H?.isEnableGroupBy,
3412
3432
  H?.configV2,
3413
3433
  t?.datasetMetricSettings?.newDatasetSettings?.configuration?.aggregates,
3414
3434
  t?.datasetMetricSettings?.newDatasetSettings?.configuration?.dimensions
3415
- ]), li = (e) => {
3416
- let n = t?.datasetMetricSettings?.newDatasetSettings, r = n?.configuration, i = n?.selectedDims || [], a = n?.selectedMetrics || [], o = t?.companyIntegration?.name, s = G?.enduserMeasureAndDimensions?.isEnabled;
3435
+ ]), ri = (e) => {
3436
+ let n = t?.datasetMetricSettings?.newDatasetSettings, r = n?.configuration, i = n?.selectedDims || [], a = n?.selectedMetrics || [], o = t?.companyIntegration?.name, s = K?.enduserMeasureAndDimensions?.isEnabled;
3417
3437
  je({
3418
- chartAggregateColumns: re(Qe(a?.filter((e) => e.configType === "AGGREGATE" && s ? G?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias) : !0) || [], o), Q || []),
3419
- chartDimensions: re(Qe(i?.filter((e) => !s || G?.enduserMeasureAndDimensions?.dimensions?.some((t) => t.value === e.alias)) || [], o), Q || []),
3420
- chartMetrics: re(Qe(a?.filter((e) => !s || G?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias)) || [], o), Q || []),
3421
- chartSettings: G,
3438
+ chartAggregateColumns: re(Qe(a?.filter((e) => e.configType === "AGGREGATE" && s ? K?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias) : !0) || [], o), Z || []),
3439
+ chartDimensions: re(Qe(i?.filter((e) => !s || K?.enduserMeasureAndDimensions?.dimensions?.some((t) => t.value === e.alias)) || [], o), Z || []),
3440
+ chartMetrics: re(Qe(a?.filter((e) => !s || K?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias)) || [], o), Z || []),
3441
+ chartSettings: K,
3422
3442
  chartTimeColumns: Qe(i?.filter((e) => De(e.datatype)), o),
3423
3443
  chartType: e,
3424
3444
  configAggregates: r?.aggregates,
3425
3445
  configuration: n?.configuration,
3426
3446
  dbName: o,
3427
3447
  pivotHeaderColumns: [],
3428
- resultData: Q || [],
3429
- setChartSettings: K
3448
+ resultData: Z || [],
3449
+ setChartSettings: q
3430
3450
  });
3431
- }, di = F(() => ce(z.filter((e) => e.group && e.isAddOnMetrics && !e.isHiddenInUi && !e.isAppFilter), "group"), [z]), fi = F(() => G?.customSettings?.comparisonValueShow && G?.chartType === j.singleValue ? n?.filters?.find((e) => e?.as === "date") : void 0, [
3432
- G?.customSettings?.comparisonValueShow,
3433
- G?.chartType,
3451
+ }, ci = F(() => ce(z.filter((e) => e.group && e.isAddOnMetrics && !e.isHiddenInUi && !e.isAppFilter), "group"), [z]), li = F(() => K?.customSettings?.comparisonValueShow && K?.chartType === j.singleValue ? n?.filters?.find((e) => e?.as === "date") : void 0, [
3452
+ K?.customSettings?.comparisonValueShow,
3453
+ K?.chartType,
3434
3454
  n?.filters?.find((e) => e?.as === "date")
3435
3455
  ]);
3436
3456
  P(() => {
3437
- Q?.length && ln.length ? fn(!0) : fn(!1);
3457
+ Z?.length && on.length ? ln(!0) : ln(!1);
3438
3458
  }, [
3439
- Q,
3440
- ln.length,
3459
+ Z,
3460
+ on.length,
3441
3461
  t?.integrationName,
3442
3462
  t?.query
3443
3463
  ]);
3444
- let pi = F(() => t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.some((e) => e.configType === "AGGREGATE") && t?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.map((e) => ({
3464
+ let di = F(() => t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.some((e) => e.configType === "AGGREGATE") && t?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.map((e) => ({
3445
3465
  value: e.alias,
3446
3466
  label: e.alias
3447
- })) || [], [t?.datasetMetricSettings?.newDatasetSettings]), mi = F(() => t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.map((e) => ({
3467
+ })) || [], [t?.datasetMetricSettings?.newDatasetSettings]), fi = F(() => t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.map((e) => ({
3448
3468
  value: e?.alias || e?.name,
3449
3469
  label: e?.alias || e?.name
3450
- })) || [], [t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), { metricFilters: gi, leftPositionedMetricFilters: _i, rightPositionedMetricFilters: yi } = F(() => {
3470
+ })) || [], [t?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), { metricFilters: pi, leftPositionedMetricFilters: mi, rightPositionedMetricFilters: gi } = F(() => {
3451
3471
  let n = _t({
3452
3472
  rlsConditions: z,
3453
3473
  isFrontendApp: _
@@ -3487,7 +3507,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3487
3507
  g,
3488
3508
  he,
3489
3509
  at
3490
- ]), xi = [
3510
+ ]), _i = [
3491
3511
  j.pie,
3492
3512
  j.doughnut,
3493
3513
  j.rose,
@@ -3508,36 +3528,36 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3508
3528
  j.boxplot,
3509
3529
  j.timeSeries,
3510
3530
  j.gantt
3511
- ].includes(G?.chartType) || (G?.isMultiDimension || G?.isDynamicSeries) && G?.seriesField !== "ungrouped", Ci = N((e) => {
3531
+ ].includes(K?.chartType) || (K?.isMultiDimension || K?.isDynamicSeries) && K?.seriesField !== "ungrouped", yi = N((e) => {
3512
3532
  let n = t?.dataSecuritySettings?.csvColumns || [];
3513
3533
  return e?.length ? e?.map((e) => {
3514
3534
  let t = {};
3515
3535
  for (let r in e) n?.includes(r) || (t[r] = e[r]);
3516
3536
  return t;
3517
3537
  }) : [];
3518
- }, [t?.dataSecuritySettings]), Ti = F(() => Ci(Q), [Q, Ci]);
3538
+ }, [t?.dataSecuritySettings]), xi = F(() => yi(Z), [Z, yi]);
3519
3539
  P(() => {
3520
- G || (K(t?.chartOptions), Nt({
3540
+ K || (q(t?.chartOptions), Nt({
3521
3541
  limit: parseInt(t?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
3522
3542
  offset: 0
3523
3543
  }));
3524
- }, [t?.chartOptions, G]), P(() => {
3525
- G?.tableSettings?.isServerSidePagination && G?.chartType === j.table && Nt({
3526
- limit: parseInt(G?.tableSettings?.defaultRowSize || "100", 10),
3544
+ }, [t?.chartOptions, K]), P(() => {
3545
+ K?.tableSettings?.isServerSidePagination && K?.chartType === j.table && Nt({
3546
+ limit: parseInt(K?.tableSettings?.defaultRowSize || "100", 10),
3527
3547
  offset: 0
3528
3548
  });
3529
3549
  }, [
3530
- G?.tableSettings?.isServerSidePagination,
3531
- G?.chartType,
3532
- G?.tableSettings?.defaultRowSize
3550
+ K?.tableSettings?.isServerSidePagination,
3551
+ K?.chartType,
3552
+ K?.tableSettings?.defaultRowSize
3533
3553
  ]);
3534
- let Fi = I(n);
3535
- Fi.current = n, P(() => {
3536
- if (G?.chartType === j.timeSeries && G?.timeSeriesSettings?.groupBySettings?.isGlobalFilter && Pr) {
3537
- let e = Fi.current?.filters?.find((e) => e.label === G?.timeSeriesSettings?.groupBySettings?.globalFilterOption?.value)?.value;
3554
+ let Ci = I(n);
3555
+ Ci.current = n, P(() => {
3556
+ if (K?.chartType === j.timeSeries && K?.timeSeriesSettings?.groupBySettings?.isGlobalFilter && Nr) {
3557
+ let e = Ci.current?.filters?.find((e) => e.label === K?.timeSeriesSettings?.groupBySettings?.globalFilterOption?.value)?.value;
3538
3558
  if ((typeof e == "string" || typeof e == "object" && e?.value) && e) {
3539
- let t = typeof e == "string" ? be(e)?.toLowerCase() : G?.timeSeriesSettings?.groupBySettings?.formatWithValue?.find((t) => t.value === be(e?.value))?.format?.toLowerCase() || "";
3540
- ct?.find((e) => e?.value?.toLowerCase() === t) && K((e) => ({
3559
+ let t = typeof e == "string" ? be(e)?.toLowerCase() : K?.timeSeriesSettings?.groupBySettings?.formatWithValue?.find((t) => t.value === be(e?.value))?.format?.toLowerCase() || "";
3560
+ ct?.find((e) => e?.value?.toLowerCase() === t) && q((e) => ({
3541
3561
  ...e,
3542
3562
  timeSeriesSettings: {
3543
3563
  ...e?.timeSeriesSettings,
@@ -3546,107 +3566,107 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3546
3566
  value: t
3547
3567
  }
3548
3568
  },
3549
- xAxis: q ? e.xAxis : `${t} of ${Pr}`
3569
+ xAxis: J ? e.xAxis : `${t} of ${Nr}`
3550
3570
  }));
3551
3571
  }
3552
3572
  }
3553
3573
  }, [
3554
- wr,
3555
- G?.chartType,
3556
- G?.timeSeriesSettings?.groupBySettings?.isGlobalFilter,
3557
- G?.timeSeriesSettings?.groupBySettings?.globalFilterOption,
3558
- Pr
3574
+ Sr,
3575
+ K?.chartType,
3576
+ K?.timeSeriesSettings?.groupBySettings?.isGlobalFilter,
3577
+ K?.timeSeriesSettings?.groupBySettings?.globalFilterOption,
3578
+ Nr
3559
3579
  ]), P(() => {
3560
- G?.isDynamicSeries && (G?.seriesOptions?.includes("ungrouped") ? G?.ungroupedAlias ? Tn(G?.seriesOptions?.map((e) => e === "ungrouped" ? {
3580
+ K?.isDynamicSeries && (K?.seriesOptions?.includes("ungrouped") ? K?.ungroupedAlias ? xn(K?.seriesOptions?.map((e) => e === "ungrouped" ? {
3561
3581
  value: e,
3562
- label: G?.ungroupedAlias
3582
+ label: K?.ungroupedAlias
3563
3583
  } : {
3564
3584
  value: e,
3565
3585
  label: e
3566
- })) : Tn(G?.seriesOptions?.map((e) => ({
3586
+ })) : xn(K?.seriesOptions?.map((e) => ({
3567
3587
  value: e,
3568
3588
  label: e
3569
- }))) : Tn([...G?.seriesOptions?.map((e) => ({
3589
+ }))) : xn([...K?.seriesOptions?.map((e) => ({
3570
3590
  value: e,
3571
3591
  label: e
3572
3592
  })) ?? []]));
3573
3593
  }, [
3574
- G?.seriesOptions,
3575
- G?.isDynamicSeries,
3576
- G?.ungroupedAlias
3594
+ K?.seriesOptions,
3595
+ K?.isDynamicSeries,
3596
+ K?.ungroupedAlias
3577
3597
  ]);
3578
- let [Ii, Li] = L(!1), Ri = (e) => {
3579
- e.key === "Control" && Li(!0);
3580
- }, zi = (e) => {
3581
- e.key === "Control" && Li(!1);
3598
+ let [Ti, Fi] = L(!1), Ii = (e) => {
3599
+ e.key === "Control" && Fi(!0);
3600
+ }, Li = (e) => {
3601
+ e.key === "Control" && Fi(!1);
3582
3602
  };
3583
3603
  P(() => {
3584
- Q?.length && Kt(Object.keys(Q?.[0] || {}));
3585
- }, [Q?.length]), P(() => (G?.customSettings?.chartZoom?.isZoomEnabled && (window.addEventListener("keydown", Ri), window.addEventListener("keyup", zi)), () => {
3586
- window.removeEventListener("keydown", Ri), window.removeEventListener("keyup", zi);
3604
+ Z?.length && Kt(Object.keys(Z?.[0] || {}));
3605
+ }, [Z?.length]), P(() => (K?.customSettings?.chartZoom?.isZoomEnabled && (window.addEventListener("keydown", Ii), window.addEventListener("keyup", Li)), () => {
3606
+ window.removeEventListener("keydown", Ii), window.removeEventListener("keyup", Li);
3587
3607
  }), []);
3588
- let Vi = F(() => {
3608
+ let Ri = F(() => {
3589
3609
  let e = !1;
3590
- if (Q?.length) {
3591
- let t = G?.singleValue;
3592
- e = Q[0][t] === null && G?.chartType === j.singleValue;
3610
+ if (Z?.length) {
3611
+ let t = K?.singleValue;
3612
+ e = Z[0][t] === null && K?.chartType === j.singleValue;
3593
3613
  }
3594
3614
  return e;
3595
3615
  }, [
3596
- Q?.length,
3597
- G?.singleValue,
3598
- G?.chartType === j.singleValue
3599
- ]), Hi = F(() => et({
3600
- chartOptions: G,
3601
- data: Q || []
3616
+ Z?.length,
3617
+ K?.singleValue,
3618
+ K?.chartType === j.singleValue
3619
+ ]), zi = F(() => et({
3620
+ chartOptions: K,
3621
+ data: Z || []
3602
3622
  }), [
3603
- Q,
3604
- G?.xAxis,
3605
- G?.yAxisList,
3606
- G?.dynamicXAxis?.isEnabled,
3607
- G?.chartType,
3608
- G?.seriesField,
3609
- G?.customSettings?.cumulativeBar,
3610
- G?.isGroupXAxis,
3611
- G?.timeSeriesSettings?.seriesType[0],
3612
- G?.timeSeriesSettings?.groupBySettings?.fillXAxis
3613
- ]), Ui = F(() => Ee({
3614
- text: Oe(t?.name || "", W) || "",
3623
+ Z,
3624
+ K?.xAxis,
3625
+ K?.yAxisList,
3626
+ K?.dynamicXAxis?.isEnabled,
3627
+ K?.chartType,
3628
+ K?.seriesField,
3629
+ K?.customSettings?.cumulativeBar,
3630
+ K?.isGroupXAxis,
3631
+ K?.timeSeriesSettings?.seriesType[0],
3632
+ K?.timeSeriesSettings?.groupBySettings?.fillXAxis
3633
+ ]), Hi = F(() => Ee({
3634
+ text: Oe(t?.name || "", gn) || "",
3615
3635
  selectedLanguage: A,
3616
3636
  translationDictionary: Ne
3617
3637
  }), [
3618
3638
  t?.name,
3619
- W,
3639
+ gn,
3620
3640
  Ne,
3621
3641
  A
3622
- ]), Wi = F(() => Ee({
3623
- text: Oe(t?.longDescription || "", W) || "",
3642
+ ]), Ui = F(() => Ee({
3643
+ text: Oe(t?.longDescription || "", gn) || "",
3624
3644
  selectedLanguage: A,
3625
3645
  translationDictionary: Ne
3626
3646
  }), [
3627
3647
  t?.longDescription,
3628
- W,
3648
+ gn,
3629
3649
  A,
3630
3650
  Ne
3631
- ]), Gi = F(() => Ee({
3632
- text: Oe(t?.description || "", W) || "",
3651
+ ]), Wi = F(() => Ee({
3652
+ text: Oe(t?.description || "", gn) || "",
3633
3653
  selectedLanguage: A,
3634
3654
  translationDictionary: Ne
3635
3655
  }), [
3636
3656
  t?.description,
3637
- W,
3657
+ gn,
3638
3658
  A,
3639
3659
  Ne
3640
- ]), Ki = F(() => Ee({
3641
- text: Oe(t?.footNote || "", W) || "",
3660
+ ]), Gi = F(() => Ee({
3661
+ text: Oe(t?.footNote || "", gn) || "",
3642
3662
  selectedLanguage: A,
3643
3663
  translationDictionary: Ne
3644
3664
  }), [
3645
3665
  t?.footNote,
3646
- W,
3666
+ gn,
3647
3667
  A,
3648
3668
  Ne
3649
- ]), qi = F(() => `${Q?.[0]?.dbn_metric_expression_data || "No Data Found"}`, [Q]), Ji = F(() => t?.rlsConditions?.map((e) => {
3669
+ ]), Ki = F(() => `${Z?.[0]?.dbn_metric_expression_data || "No Data Found"}`, [Z]), qi = F(() => t?.rlsConditions?.map((e) => {
3650
3670
  if (e?.datatype === "date" && e?.options?.find((e) => e.range === "Custom Date") && e?.isEnableDynamicDate && e?.dynamicDate?.value) {
3651
3671
  let t = de(He?.find((t) => t.value === e?.dynamicDate?.value)?.count || 0), n = We(t), r = We(t);
3652
3672
  return {
@@ -3662,8 +3682,8 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3662
3682
  return e;
3663
3683
  }), [t?.rlsConditions]);
3664
3684
  pt(() => {
3665
- if (Z && ae?.((e) => {
3666
- if (Di(e?.get(t?.id), Y)) return e;
3685
+ if (Kn && ae?.((e) => {
3686
+ if (Di(e?.get(t?.id), Vn)) return e;
3667
3687
  let n = new Map(e);
3668
3688
  return n.set(t?.id, {
3669
3689
  data: {
@@ -3671,18 +3691,18 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3671
3691
  name: "",
3672
3692
  description: ""
3673
3693
  },
3674
- isLoading: Z,
3675
- key: Y
3694
+ isLoading: Kn,
3695
+ key: Vn
3676
3696
  }), n;
3677
3697
  }), X?.data && D) {
3678
- let e = sa(t?.id, se) ? X?.data : void 0;
3698
+ let e = ca(t?.id, se) ? X?.data : void 0;
3679
3699
  ae?.((n) => {
3680
3700
  if (Mi(n?.get(t?.id), {
3681
3701
  data: e,
3682
3702
  name: t?.name || "",
3683
3703
  description: t?.description || "",
3684
- isLoading: Z,
3685
- key: Y
3704
+ isLoading: Kn,
3705
+ key: Vn
3686
3706
  })) return n;
3687
3707
  let r = new Map(n);
3688
3708
  return r.set(t?.id, {
@@ -3691,16 +3711,16 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3691
3711
  name: t?.name || "",
3692
3712
  description: t?.description || ""
3693
3713
  },
3694
- isLoading: Z,
3695
- key: Y
3714
+ isLoading: Kn,
3715
+ key: Vn
3696
3716
  }), r;
3697
3717
  });
3698
3718
  }
3699
- if (!Z && sr) {
3719
+ if (!Kn && or) {
3700
3720
  let e = Ni(t);
3701
3721
  ae?.((n) => {
3702
3722
  let r = n?.get(t?.id);
3703
- if (r && !r.isLoading && !!r.error === e && r.key === Y) return n;
3723
+ if (r && !r.isLoading && !!r.error === e && r.key === Vn) return n;
3704
3724
  let i = new Map(n);
3705
3725
  return i.set(t?.id, {
3706
3726
  data: r?.data ?? {
@@ -3709,24 +3729,24 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3709
3729
  description: ""
3710
3730
  },
3711
3731
  isLoading: !1,
3712
- key: Y,
3732
+ key: Vn,
3713
3733
  ...e ? { error: "failed" } : {}
3714
3734
  }), i;
3715
3735
  });
3716
3736
  }
3717
3737
  }, [
3718
3738
  X?.data,
3719
- Z,
3720
- Y,
3721
- sr
3739
+ Kn,
3740
+ Vn,
3741
+ or
3722
3742
  ]);
3723
- let Yi = I(t?.id);
3724
- Yi.current = t?.id;
3725
- let ta = I(D);
3726
- ta.current = D;
3727
- let oa = I(ae);
3728
- oa.current = ae, P(() => () => {
3729
- let e = Yi.current, t = ta.current, n = oa.current;
3743
+ let Ji = I(t?.id);
3744
+ Ji.current = t?.id;
3745
+ let Yi = I(D);
3746
+ Yi.current = D;
3747
+ let Xi = I(ae);
3748
+ Xi.current = ae, P(() => () => {
3749
+ let e = Ji.current, t = Yi.current, n = Xi.current;
3730
3750
  e && t && n && t.get(e)?.data?.data && n((t) => {
3731
3751
  let n = t.get(e);
3732
3752
  if (!n?.data?.data) return t;
@@ -3740,14 +3760,14 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3740
3760
  }), r;
3741
3761
  });
3742
3762
  }, []);
3743
- let ca = !!t?.elementSettings?.summary?.metricList?.length, [la, ua] = L(0);
3763
+ let na = !!t?.elementSettings?.summary?.metricList?.length, [sa, la] = L(0);
3744
3764
  P(() => {
3745
3765
  let e = D?.subscribe;
3746
- if (ca && typeof e == "function") return e(() => ua((e) => e + 1));
3747
- }, [D, ca]), pt(() => {
3748
- At.current !== Wn && (At.current = Wn, Tt());
3749
- }, [Wn, Tt]);
3750
- let da = () => !!t?.elementSettings?.summary?.metricList?.some((e) => D?.get(e.value)?.isLoading === !0);
3766
+ if (na && typeof e == "function") return e(() => la((e) => e + 1));
3767
+ }, [D, na]), pt(() => {
3768
+ At.current !== Hn && (At.current = Hn, Tt());
3769
+ }, [Hn, Tt]);
3770
+ let ua = () => !!t?.elementSettings?.summary?.metricList?.some((e) => D?.get(e.value)?.isLoading === !0);
3751
3771
  pt(() => {
3752
3772
  let e = t?.elementSettings?.summary;
3753
3773
  if (!e?.metricList?.length || !D?.get(t?.id)) return;
@@ -3757,7 +3777,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3757
3777
  keys: n.map((e) => [e?.key, !!e?.data?.data?.length]),
3758
3778
  prompt: e.summaryPrompt,
3759
3779
  id: t?.id,
3760
- identity: Wn
3780
+ identity: Hn
3761
3781
  }), i = n.map((e) => ({
3762
3782
  data: e?.data?.data || [],
3763
3783
  metricName: e?.data?.name,
@@ -3784,8 +3804,8 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3784
3804
  t?.name,
3785
3805
  t?.description,
3786
3806
  D,
3787
- la,
3788
- Wn,
3807
+ sa,
3808
+ Hn,
3789
3809
  Ct,
3790
3810
  yt,
3791
3811
  E,
@@ -3794,21 +3814,21 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3794
3814
  y,
3795
3815
  a
3796
3816
  ]), P(() => {
3797
- let e = nt(G?.customSettings?.comboAxisSettings || []), t = e?.flatMap((e) => e?.measures), n = G?.yAxisList?.every((e) => t?.includes(e));
3798
- if (G?.yAxisList?.length && G?.yAxisList?.length !== t?.length && !t?.length && [
3817
+ let e = nt(K?.customSettings?.comboAxisSettings || []), t = e?.flatMap((e) => e?.measures), n = K?.yAxisList?.every((e) => t?.includes(e));
3818
+ if (K?.yAxisList?.length && K?.yAxisList?.length !== t?.length && !t?.length && [
3799
3819
  j.combo,
3800
3820
  j.timeSeries,
3801
3821
  j.horizontalCombo
3802
- ].includes(G?.chartType || "")) {
3803
- let e = G?.yAxisList?.filter((e) => !G?.comboBarList?.includes(e))?.filter((e) => !t?.includes(e)), n = G?.customSettings?.comboStackAxisSymbols?.name || "", r = G?.customSettings?.comboLabelFormatter?.find((e) => e.axis === (n || "stack"))?.formatter, i = G?.comboBarList?.join(" and "), a = G?.customSettings?.comboLabelFormatter?.find((e) => e.axis === i)?.formatter;
3804
- K((t) => ({
3822
+ ].includes(K?.chartType || "")) {
3823
+ let e = K?.yAxisList?.filter((e) => !K?.comboBarList?.includes(e))?.filter((e) => !t?.includes(e)), n = K?.customSettings?.comboStackAxisSymbols?.name || "", r = K?.customSettings?.comboLabelFormatter?.find((e) => e.axis === (n || "stack"))?.formatter, i = K?.comboBarList?.join(" and "), a = K?.customSettings?.comboLabelFormatter?.find((e) => e.axis === i)?.formatter;
3824
+ q((t) => ({
3805
3825
  ...t,
3806
3826
  customSettings: {
3807
3827
  ...t.customSettings,
3808
3828
  comboAxisSettings: nt([
3809
3829
  ...t.customSettings?.comboAxisSettings || [],
3810
3830
  ...e?.map((e) => {
3811
- let t = G?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = G?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
3831
+ let t = K?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = K?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
3812
3832
  return {
3813
3833
  axis: e,
3814
3834
  measures: [e],
@@ -3816,36 +3836,36 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3816
3836
  axis: e,
3817
3837
  type: "line"
3818
3838
  }],
3819
- numberFormatter: G?.customSettings?.numberFormatter,
3839
+ numberFormatter: K?.customSettings?.numberFormatter,
3820
3840
  labelFormatter: t,
3821
3841
  prefix: n?.prefix || "",
3822
3842
  suffix: n?.suffix || "",
3823
3843
  isEnableLabelFormatter: !!t?.length
3824
3844
  };
3825
3845
  }),
3826
- ...G?.comboBarList?.length && (G?.customSettings?.isCombineBarAxis || G?.customSettings?.isStackBar) ? [{
3827
- axis: G?.customSettings?.isStackBar && n || i,
3828
- measures: G?.comboBarList,
3829
- chartTypes: G?.comboBarList?.map((e) => ({
3846
+ ...K?.comboBarList?.length && (K?.customSettings?.isCombineBarAxis || K?.customSettings?.isStackBar) ? [{
3847
+ axis: K?.customSettings?.isStackBar && n || i,
3848
+ measures: K?.comboBarList,
3849
+ chartTypes: K?.comboBarList?.map((e) => ({
3830
3850
  axis: e,
3831
3851
  type: "bar"
3832
3852
  })),
3833
- isEnableStackBar: G?.customSettings?.isStackBar,
3834
- numberFormatter: G?.customSettings?.numberFormatter,
3835
- ...G?.customSettings?.isStackBar ? {
3836
- prefix: G?.customSettings?.comboStackAxisSymbols?.prefix || "",
3837
- suffix: G?.customSettings?.comboStackAxisSymbols?.suffix || "",
3853
+ isEnableStackBar: K?.customSettings?.isStackBar,
3854
+ numberFormatter: K?.customSettings?.numberFormatter,
3855
+ ...K?.customSettings?.isStackBar ? {
3856
+ prefix: K?.customSettings?.comboStackAxisSymbols?.prefix || "",
3857
+ suffix: K?.customSettings?.comboStackAxisSymbols?.suffix || "",
3838
3858
  labelFormatter: r,
3839
3859
  isEnableLabelFormatter: !!r?.length
3840
3860
  } : {
3841
- prefix: G?.customSettings?.combinedAxisPrefix || "",
3842
- suffix: G?.customSettings?.combinedAxisSuffix || "",
3861
+ prefix: K?.customSettings?.combinedAxisPrefix || "",
3862
+ suffix: K?.customSettings?.combinedAxisSuffix || "",
3843
3863
  labelFormatter: a,
3844
3864
  isEnableLabelFormatter: !!a?.length
3845
3865
  }
3846
3866
  }] : [],
3847
- ...G?.comboBarList?.length && !G?.customSettings?.isCombineBarAxis && !G?.customSettings?.isStackBar ? G?.comboBarList?.map((e) => {
3848
- let t = G?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = G?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
3867
+ ...K?.comboBarList?.length && !K?.customSettings?.isCombineBarAxis && !K?.customSettings?.isStackBar ? K?.comboBarList?.map((e) => {
3868
+ let t = K?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = K?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
3849
3869
  return {
3850
3870
  axis: e,
3851
3871
  measures: [e],
@@ -3853,7 +3873,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3853
3873
  axis: e,
3854
3874
  type: "bar"
3855
3875
  }],
3856
- numberFormatter: G?.customSettings?.numberFormatter,
3876
+ numberFormatter: K?.customSettings?.numberFormatter,
3857
3877
  labelFormatter: t,
3858
3878
  prefix: n?.prefix || "",
3859
3879
  suffix: n?.suffix || "",
@@ -3872,15 +3892,15 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3872
3892
  comboBarList: []
3873
3893
  }));
3874
3894
  }
3875
- if (t?.length && G?.yAxisList?.length && (G?.yAxisList?.length !== t?.length || G?.yAxisList?.length === t?.length && !n) && [
3895
+ if (t?.length && K?.yAxisList?.length && (K?.yAxisList?.length !== t?.length || K?.yAxisList?.length === t?.length && !n) && [
3876
3896
  j.combo,
3877
3897
  j.timeSeries,
3878
3898
  j.horizontalCombo
3879
- ].includes(G?.chartType || "")) {
3880
- let e = G?.yAxisList?.filter((e) => !t?.includes(e));
3881
- (t?.filter((e) => !G?.yAxisList?.includes(e)))?.forEach((e) => {
3882
- let t = G?.customSettings?.comboAxisSettings?.find((t) => t.measures?.includes(e)), n = t?.axis, r = (t?.measures?.length || 0) > 1;
3883
- K((t) => ({
3899
+ ].includes(K?.chartType || "")) {
3900
+ let e = K?.yAxisList?.filter((e) => !t?.includes(e));
3901
+ (t?.filter((e) => !K?.yAxisList?.includes(e)))?.forEach((e) => {
3902
+ let t = K?.customSettings?.comboAxisSettings?.find((t) => t.measures?.includes(e)), n = t?.axis, r = (t?.measures?.length || 0) > 1;
3903
+ q((t) => ({
3884
3904
  ...t,
3885
3905
  customSettings: {
3886
3906
  ...t.customSettings,
@@ -3890,7 +3910,7 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3890
3910
  } : t)?.filter((e) => e?.measures?.length) || [] : t.customSettings?.comboAxisSettings?.filter((e) => e.axis !== n && e?.measures?.length) || [])
3891
3911
  }
3892
3912
  }));
3893
- }), e?.length && K((t) => ({
3913
+ }), e?.length && q((t) => ({
3894
3914
  ...t,
3895
3915
  customSettings: {
3896
3916
  ...t.customSettings,
@@ -3905,11 +3925,11 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3905
3925
  }
3906
3926
  }));
3907
3927
  }
3908
- t?.length && G?.yAxisList?.length && G?.yAxisList?.length === t?.length && n && [
3928
+ t?.length && K?.yAxisList?.length && K?.yAxisList?.length === t?.length && n && [
3909
3929
  j.combo,
3910
3930
  j.timeSeries,
3911
3931
  j.horizontalCombo
3912
- ].includes(G?.chartType || "") && G?.customSettings?.comboAxisSettings?.length !== e?.length && K((t) => ({
3932
+ ].includes(K?.chartType || "") && K?.customSettings?.comboAxisSettings?.length !== e?.length && q((t) => ({
3913
3933
  ...t,
3914
3934
  customSettings: {
3915
3935
  ...t?.customSettings,
@@ -3917,30 +3937,30 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3917
3937
  }
3918
3938
  }));
3919
3939
  }, [
3920
- G?.yAxisList,
3921
- G?.customSettings?.comboAxisSettings,
3922
- G?.comboBarList,
3923
- G?.customSettings?.isCombineBarAxis,
3924
- G?.customSettings?.isStackBar,
3925
- G?.customSettings?.comboStackAxisSymbols?.name,
3926
- G?.customSettings?.comboStackAxisSymbols?.prefix,
3927
- G?.customSettings?.comboStackAxisSymbols?.suffix,
3928
- G?.customSettings?.comboLabelFormatter,
3929
- G?.customSettings?.comboAxisSymbols,
3930
- G?.customSettings?.numberFormatter,
3931
- G?.customSettings?.combinedAxisPrefix,
3932
- G?.customSettings?.combinedAxisSuffix,
3933
- G?.chartType
3940
+ K?.yAxisList,
3941
+ K?.customSettings?.comboAxisSettings,
3942
+ K?.comboBarList,
3943
+ K?.customSettings?.isCombineBarAxis,
3944
+ K?.customSettings?.isStackBar,
3945
+ K?.customSettings?.comboStackAxisSymbols?.name,
3946
+ K?.customSettings?.comboStackAxisSymbols?.prefix,
3947
+ K?.customSettings?.comboStackAxisSymbols?.suffix,
3948
+ K?.customSettings?.comboLabelFormatter,
3949
+ K?.customSettings?.comboAxisSymbols,
3950
+ K?.customSettings?.numberFormatter,
3951
+ K?.customSettings?.combinedAxisPrefix,
3952
+ K?.customSettings?.combinedAxisSuffix,
3953
+ K?.chartType
3934
3954
  ]), P(() => {
3935
- G?.yAxisList?.length && G?.yAxisList?.length < 5 && G?.chartType === j.boxplot && K((e) => ({
3955
+ K?.yAxisList?.length && K?.yAxisList?.length < 5 && K?.chartType === j.boxplot && q((e) => ({
3936
3956
  ...e,
3937
3957
  chartType: j.line
3938
- })), !G?.yAxisList?.length && G?.chartType === j.funnelV2 && K((e) => ({
3958
+ })), !K?.yAxisList?.length && K?.chartType === j.funnelV2 && q((e) => ({
3939
3959
  ...e,
3940
3960
  chartType: j.singleValue
3941
3961
  }));
3942
- }, [G?.chartType, G?.yAxisList?.length]);
3943
- let fa = ({ columnAlias: e, value: n, isClear: r = !1 }) => {
3962
+ }, [K?.chartType, K?.yAxisList?.length]);
3963
+ let da = ({ columnAlias: e, value: n, isClear: r = !1 }) => {
3944
3964
  let i = t?.datasetMetricSettings;
3945
3965
  i && Ge({
3946
3966
  columnAlias: e,
@@ -3951,9 +3971,9 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3951
3971
  });
3952
3972
  };
3953
3973
  P(() => {
3954
- if (!G?.dynamicYAxis?.isEnabled || !G?.dynamicYAxis?.selectedOption || Array.isArray(G?.dynamicYAxis?.selectedOption)) return;
3955
- let e = G?.dynamicYAxis?.selectedOption;
3956
- K((t) => ({
3974
+ if (!K?.dynamicYAxis?.isEnabled || !K?.dynamicYAxis?.selectedOption || Array.isArray(K?.dynamicYAxis?.selectedOption)) return;
3975
+ let e = K?.dynamicYAxis?.selectedOption;
3976
+ q((t) => ({
3957
3977
  ...t,
3958
3978
  dynamicYAxis: {
3959
3979
  ...t?.dynamicYAxis,
@@ -3961,14 +3981,14 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3961
3981
  },
3962
3982
  yAxisList: [e?.value]
3963
3983
  }));
3964
- }, [G?.dynamicYAxis?.selectedOption, G?.dynamicYAxis?.isEnabled]), P(() => {
3965
- let e = M?.yAxisSettings?.find((e) => e?.yAxisSettings?.isEnable && e?.id === t?.id && e?.yAxisSettings?.yAxis && Array.isArray(e?.yAxisSettings?.yAxis) && e?.yAxisSettings?.yAxis?.length > 0), n = M?.xAxisSettings?.find((e) => e?.xAxisSettings?.isEnable && e?.id === t?.id && e?.xAxisSettings?.xaxis), r = H?.configV2?.levels?.length ? H : t?.drillDownSettings, i = ia(t?.chartOptions, r), a = i !== t?.chartOptions;
3966
- if (!G?.dynamicYAxis?.isEnabled && !G?.dynamicXAxis?.isEnabled && !a || !e && !n && !a) {
3967
- K((e) => t?.chartOptions || e);
3984
+ }, [K?.dynamicYAxis?.selectedOption, K?.dynamicYAxis?.isEnabled]), P(() => {
3985
+ let e = M?.yAxisSettings?.find((e) => e?.yAxisSettings?.isEnable && e?.id === t?.id && e?.yAxisSettings?.yAxis && Array.isArray(e?.yAxisSettings?.yAxis) && e?.yAxisSettings?.yAxis?.length > 0), n = M?.xAxisSettings?.find((e) => e?.xAxisSettings?.isEnable && e?.id === t?.id && e?.xAxisSettings?.xaxis), r = H?.configV2?.levels?.length ? H : t?.drillDownSettings, i = aa(t?.chartOptions, r), a = i !== t?.chartOptions;
3986
+ if (!K?.dynamicYAxis?.isEnabled && !K?.dynamicXAxis?.isEnabled && !a || !e && !n && !a) {
3987
+ q((e) => t?.chartOptions || e);
3968
3988
  return;
3969
3989
  }
3970
3990
  let o = e?.yAxisSettings?.yAxis?.[0];
3971
- K((e) => {
3991
+ q((e) => {
3972
3992
  let t = a ? {
3973
3993
  ...e,
3974
3994
  ...i
@@ -3994,15 +4014,15 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
3994
4014
  M?.yAxisSettings,
3995
4015
  t?.id,
3996
4016
  M?.xAxisSettings,
3997
- G?.dynamicYAxis?.isEnabled,
3998
- G?.dynamicXAxis?.isEnabled,
4017
+ K?.dynamicYAxis?.isEnabled,
4018
+ K?.dynamicXAxis?.isEnabled,
3999
4019
  H,
4000
4020
  H?.configV2?.isEnable,
4001
4021
  H?.configV2?.levels,
4002
4022
  t?.chartOptions,
4003
4023
  t?.drillDownSettings
4004
4024
  ]), P(() => {
4005
- G?.customSettings?.isShowDuration && G?.chartType === j.gantt && !G?.customSettings?.ganttTooltipKeys?.includes("Duration") && K((e) => ({
4025
+ K?.customSettings?.isShowDuration && K?.chartType === j.gantt && !K?.customSettings?.ganttTooltipKeys?.includes("Duration") && q((e) => ({
4006
4026
  ...e,
4007
4027
  customSettings: {
4008
4028
  ...e?.customSettings,
@@ -4010,47 +4030,47 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
4010
4030
  }
4011
4031
  }));
4012
4032
  }, [
4013
- G?.customSettings?.isShowDuration,
4014
- G?.chartType,
4015
- G?.customSettings?.ganttTooltipKeys
4033
+ K?.customSettings?.isShowDuration,
4034
+ K?.chartType,
4035
+ K?.customSettings?.ganttTooltipKeys
4016
4036
  ]);
4017
- let pa = F(() => t?.datasetMetricSettings?.selectedDimensions?.map((e) => Ve(e || "none")) || ra, [t?.datasetMetricSettings?.selectedDimensions]);
4037
+ let fa = F(() => t?.datasetMetricSettings?.selectedDimensions?.map((e) => Ve(e || "none")) || ia, [t?.datasetMetricSettings?.selectedDimensions]);
4018
4038
  return {
4019
4039
  drillBlockedNotice: bt,
4020
- filterNotAppliedNotice: nr,
4040
+ filterNotAppliedNotice: tr,
4021
4041
  dismissDrillBlockedNotice: () => xt(null),
4022
4042
  elementSummary: Et,
4023
4043
  elementSummaryError: Dt,
4024
4044
  elementSummaryEmpty: Ot,
4025
4045
  isLoadingSummary: kt,
4026
4046
  stopSummary: wt,
4027
- isMetricListLoading: da,
4028
- onDrillLevelClick: ti,
4029
- onDrillDown: Qr,
4030
- onFilterDashboardTo: Xr,
4031
- onFilterMetricTo: Zr,
4032
- handleChartClick: Br,
4033
- dataDb: Q,
4034
- truncation: ar,
4035
- truncationNotice: or,
4036
- getUnderlyingData: Jr,
4037
- onChangeFilterValue: zr,
4047
+ isMetricListLoading: ua,
4048
+ onDrillLevelClick: $r,
4049
+ onDrillDown: Xr,
4050
+ onFilterDashboardTo: Jr,
4051
+ onFilterMetricTo: Yr,
4052
+ handleChartClick: zr,
4053
+ dataDb: Z,
4054
+ truncation: ir,
4055
+ truncationNotice: ar,
4056
+ getUnderlyingData: Kr,
4057
+ onChangeFilterValue: Rr,
4038
4058
  isShowChartPopup: Bt,
4039
4059
  setShowChartPopup: Vt,
4040
- columnName: Vr,
4041
- underlyingDataPoint: Ur,
4060
+ columnName: Q,
4061
+ underlyingDataPoint: Br,
4042
4062
  chartParams: B,
4043
- isQueryLoading: !Bn && (Z || ht || $n || Be && (!Q?.length || Vi)),
4044
- isMetricUpdating: er,
4045
- isSingleValueNull: Vi,
4046
- dynamicOptions: Cn,
4047
- chartSettings: G,
4048
- setChartSettings: K,
4049
- isEnableZoom: Ii,
4050
- filterValues: Nn,
4063
+ isQueryLoading: !Ln && (Kn || ht || Zn || Be && (!Z?.length || Ri)),
4064
+ isMetricUpdating: $n,
4065
+ isSingleValueNull: Ri,
4066
+ dynamicOptions: bn,
4067
+ chartSettings: K,
4068
+ setChartSettings: q,
4069
+ isEnableZoom: Ti,
4070
+ filterValues: An,
4051
4071
  containerRef: jt,
4052
4072
  drilledLevel: V.length,
4053
- dimensions: pa,
4073
+ dimensions: fa,
4054
4074
  rlsConditions: z,
4055
4075
  setRlsConditions: Lt,
4056
4076
  setTableLimit: Nt,
@@ -4073,9 +4093,9 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
4073
4093
  };
4074
4094
  });
4075
4095
  },
4076
- isExternalChart: G?.tableSettings?.isServerSidePagination && G?.chartType === j.table,
4077
- isEnablePivotTable: dn,
4078
- groupByList: ln,
4096
+ isExternalChart: K?.tableSettings?.isServerSidePagination && K?.chartType === j.table,
4097
+ isEnablePivotTable: cn,
4098
+ groupByList: on,
4079
4099
  hasNumberKeys: !0,
4080
4100
  isEnableGauge: !0,
4081
4101
  updateFilter: (e) => {
@@ -4084,76 +4104,76 @@ var gi = (e) => typeof e == "object" && !!e && !Array.isArray(e), _i = (e) => ty
4084
4104
  isAddOnMetrics: !t.isAddOnMetrics
4085
4105
  } : t));
4086
4106
  },
4087
- metricFilters: gi,
4088
- leftPositionedMetricFilters: _i,
4089
- rightPositionedMetricFilters: yi,
4107
+ metricFilters: pi,
4108
+ leftPositionedMetricFilters: mi,
4109
+ rightPositionedMetricFilters: gi,
4090
4110
  drillFilters: V,
4091
- underlyingDataColumnMetadata: qr,
4092
- underlyingDataDrillFilters: Kr,
4111
+ underlyingDataColumnMetadata: Gr,
4112
+ underlyingDataDrillFilters: Wr,
4093
4113
  drillType: H?.drillType,
4094
- tableResultsDownloadData: Ti,
4095
- filterCsvColumns: Ci,
4096
- appliedMetricFilters: gn,
4097
- pivotHeaderOptions: pi,
4098
- pivotDrillState: On,
4099
- onDrillPivotTable: ei,
4100
- legendData: Hi,
4101
- timeseriesDimension: Pr,
4102
- isPythonMode: q,
4114
+ tableResultsDownloadData: xi,
4115
+ filterCsvColumns: yi,
4116
+ appliedMetricFilters: G,
4117
+ pivotHeaderOptions: di,
4118
+ pivotDrillState: Tn,
4119
+ onDrillPivotTable: Qr,
4120
+ legendData: zi,
4121
+ timeseriesDimension: Nr,
4122
+ isPythonMode: J,
4103
4123
  sortOrder: Ut,
4104
4124
  setSortOrder: Wt,
4105
4125
  isNotFirstRender: Yt,
4106
4126
  setNotFirstRender: Xt,
4107
- isSorted: xn,
4108
- isInavlidForSort: xi,
4109
- onAddComparison: ni,
4110
- groupedRlsConditions: di,
4111
- onGenerateMetricSummary: ri,
4127
+ isSorted: vn,
4128
+ isInavlidForSort: _i,
4129
+ onAddComparison: ei,
4130
+ groupedRlsConditions: ci,
4131
+ onGenerateMetricSummary: ti,
4112
4132
  summary: qt,
4113
4133
  setSummary: Jt,
4114
- dataMartRelationships: Mn,
4115
- onChartChange: li,
4116
- isCompareValue: Rr,
4117
- isShowChartPropertyPanel: mn,
4118
- setShowChartPropertyPanel: hn,
4134
+ dataMartRelationships: kn,
4135
+ onChartChange: ri,
4136
+ isCompareValue: Ir,
4137
+ isShowChartPropertyPanel: un,
4138
+ setShowChartPropertyPanel: dn,
4119
4139
  columnList: Gt,
4120
- variables: W,
4121
- metricName: Ui,
4122
- longDescription: Wi,
4123
- footNote: Ki,
4124
- description: Gi,
4140
+ variables: gn,
4141
+ metricName: Hi,
4142
+ longDescription: Ui,
4143
+ footNote: Gi,
4144
+ description: Wi,
4125
4145
  drilldownCols: Zt,
4126
- switchMeasureOptions: mi,
4127
- metricExpressionResult: qi,
4128
- dateFilter: fi,
4146
+ switchMeasureOptions: fi,
4147
+ metricExpressionResult: Ki,
4148
+ dateFilter: li,
4129
4149
  drillDownSettings: H,
4130
- onDrillIntoDimension: $r,
4131
- adhocDrillDims: sn,
4132
- enabledCharts: ci,
4150
+ onDrillIntoDimension: Zr,
4151
+ adhocDrillDims: nn,
4152
+ enabledCharts: ni,
4133
4153
  tableColumnFilters: Rt,
4134
- onChangePaginationColumnFilters: fa,
4135
- queryError: sr,
4136
- queryPermissionDenied: !!Xn?.isBatchAuth,
4137
- refetchMetricData: Qn,
4138
- customSwitchXAxis: Pn,
4139
- savedMetricFilters: Ji || na
4154
+ onChangePaginationColumnFilters: da,
4155
+ queryError: or,
4156
+ queryPermissionDenied: !!Yn?.isBatchAuth,
4157
+ refetchMetricData: Xn,
4158
+ customSwitchXAxis: jn,
4159
+ savedMetricFilters: qi || ra
4140
4160
  };
4141
4161
  };
4142
- function sa(e, t) {
4162
+ function ca(e, t) {
4143
4163
  return t === void 0 || t.has(e);
4144
4164
  }
4145
4165
  //#endregion
4146
4166
  //#region ../core/src/metric-builder/dashboardNavigation.ts
4147
- var ca = (e) => !!e && e !== "null" && e !== "undefined", la = (e) => {
4167
+ var la = (e) => !!e && e !== "null" && e !== "undefined", ua = (e) => {
4148
4168
  if (e == null) return null;
4149
4169
  let t = typeof e == "string" ? e : String(e);
4150
4170
  return t.length ? t : null;
4151
- }, ua = ({ config: e, value: t, carryFilters: n = [] }) => {
4171
+ }, da = ({ config: e, value: t, carryFilters: n = [] }) => {
4152
4172
  if (!e?.isEnable) return {
4153
4173
  ok: !1,
4154
4174
  reason: "disabled"
4155
4175
  };
4156
- if (!ca(e.dashboardId)) return {
4176
+ if (!la(e.dashboardId)) return {
4157
4177
  ok: !1,
4158
4178
  reason: "no_destination"
4159
4179
  };
@@ -4162,7 +4182,7 @@ var ca = (e) => !!e && e !== "null" && e !== "undefined", la = (e) => {
4162
4182
  ok: !1,
4163
4183
  reason: "no_target_filter"
4164
4184
  };
4165
- let i = la(t);
4185
+ let i = ua(t);
4166
4186
  if (i === null) return {
4167
4187
  ok: !1,
4168
4188
  reason: "no_value"
@@ -4191,7 +4211,7 @@ var ca = (e) => !!e && e !== "null" && e !== "undefined", la = (e) => {
4191
4211
  navigation: c.code
4192
4212
  }
4193
4213
  };
4194
- }, da = (e, t) => {
4214
+ }, fa = (e, t) => {
4195
4215
  let n = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : null, { params: r, rowFilters: i } = t, a = e?.valueColumn?.trim();
4196
4216
  if (a) {
4197
4217
  let e = (i ?? []).find((e) => e?.columnName === a);
@@ -4200,7 +4220,7 @@ var ca = (e) => !!e && e !== "null" && e !== "undefined", la = (e) => {
4200
4220
  if (r && r.name !== void 0 && r.name !== null) return n(r.name);
4201
4221
  let o = (i ?? []).find((e) => e?.value !== void 0 && e?.value !== null);
4202
4222
  return o ? n(o.value) : null;
4203
- }, fa = lt("triangle-alert", [
4223
+ }, pa = lt("triangle-alert", [
4204
4224
  ["path", {
4205
4225
  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",
4206
4226
  key: "wmoenq"
@@ -4213,41 +4233,41 @@ var ca = (e) => !!e && e !== "null" && e !== "undefined", la = (e) => {
4213
4233
  d: "M12 17h.01",
4214
4234
  key: "p32p05"
4215
4235
  }]
4216
- ]), pa = {
4236
+ ]), ma = {
4217
4237
  notice: "_notice_vwpz7_1",
4218
4238
  icon: "_icon_vwpz7_15"
4219
- }, ma = ({ text: e }) => e ? /* @__PURE__ */ ht("div", {
4220
- className: pa.notice,
4239
+ }, ha = ({ text: e }) => e ? /* @__PURE__ */ ht("div", {
4240
+ className: ma.notice,
4221
4241
  role: "status",
4222
4242
  "data-testid": "custom-sql-filter-notice",
4223
- children: [/* @__PURE__ */ mt(fa, {
4224
- className: pa.icon,
4243
+ children: [/* @__PURE__ */ mt(pa, {
4244
+ className: ma.icon,
4225
4245
  "aria-hidden": "true"
4226
4246
  }), /* @__PURE__ */ mt("span", { children: e })]
4227
- }) : null, ha = (e) => {
4247
+ }) : null, ga = (e) => {
4228
4248
  let t = e.value ?? e.selectedVariableValue?.value;
4229
4249
  return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim().length > 0 : t != null;
4230
- }, ga = (e) => {
4250
+ }, _a = (e) => {
4231
4251
  let t = e.label ?? e.name ?? e.column;
4232
4252
  return typeof t == "string" && t.trim() ? t.trim() : "Filter";
4233
- }, _a = ({ isCustomSqlMetric: e, query: t, metricId: n, filters: r }) => {
4253
+ }, va = ({ isCustomSqlMetric: e, query: t, metricId: n, filters: r }) => {
4234
4254
  if (!e) return [];
4235
4255
  let i = fe(t || "");
4236
4256
  return (r || []).flatMap((e) => {
4237
4257
  let t = e.restrictedMetrics?.some((e) => e.value === n);
4238
- if (!e.isVariableFilter || e.isFilterApplied === !1 || e.isHiddenInUi || t || !ha(e)) return [];
4258
+ if (!e.isVariableFilter || e.isFilterApplied === !1 || e.isHiddenInUi || t || !ga(e)) return [];
4239
4259
  let r = (e.variableStrings || []).filter(Boolean), a = r.filter((e) => !i.includes(e));
4240
4260
  return r.length > 0 && a.length === 0 ? [] : [{
4241
- label: ga(e),
4261
+ label: _a(e),
4242
4262
  missingVariables: a
4243
4263
  }];
4244
4264
  });
4245
- }, va = (e) => e.length === 1 ? e[0] : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e.at(-1)}`, ya = (e) => {
4246
- let t = _a(e);
4265
+ }, ya = (e) => e.length === 1 ? e[0] : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e.at(-1)}`, ba = (e) => {
4266
+ let t = va(e);
4247
4267
  if (!t.length) return null;
4248
4268
  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.`;
4249
- return n.length ? `${r} Add ${va(n)} to the metric SQL.` : `${r} Configure matching filter variables in the metric SQL.`;
4250
- }, ba = ({ chart: e, valueColumn: t, isDrillEnabled: n, drilledLevel: r, dimensionCount: i, params: a, passAllData: o }) => {
4269
+ return n.length ? `${r} Add ${ya(n)} to the metric SQL.` : `${r} Configure matching filter variables in the metric SQL.`;
4270
+ }, xa = ({ chart: e, valueColumn: t, isDrillEnabled: n, drilledLevel: r, dimensionCount: i, params: a, passAllData: o }) => {
4251
4271
  let s = e?.chartType;
4252
4272
  return s === j.table || s === j.singleValue || n && r === i ? o ? a?.reduce((e, t) => (e[t.columnName] = t.value, e), {}) : a?.find((e) => e.columnName === t)?.value : [j.sankey, j.treeMap].includes(s) ? o ? {
4253
4273
  name: a?.name,
@@ -4257,19 +4277,19 @@ var ca = (e) => !!e && e !== "null" && e !== "undefined", la = (e) => {
4257
4277
  value: a?.value,
4258
4278
  columnName: a?.seriesName
4259
4279
  } : t === e?.xAxis || s === j.gauge && t === e?.gaugeSettings?.dimensions?.join(", ") ? a?.name : a?.seriesName === t || s === j.gauge && t === e?.gaugeSettings?.metric || [j.funnel].includes(s) ? a?.value : null;
4260
- }, xa = (e, t, n) => !e || t === n, Sa = ({ chart: e, chartWithMetric: t, chartWithDashboard: n, isDrillEnabled: r, drilledLevel: i, dimensionCount: a, isLastConfiguredDrillLevel: o, isTableRedirectAllowed: s = !0 }) => {
4261
- let c = xa(r, i, a), l = c || !!o, u = !!e?.isEnable && l && s, d = e?.routeType === "user";
4280
+ }, Sa = (e, t, n) => !e || t === n, Ca = ({ chart: e, chartWithMetric: t, chartWithDashboard: n, isDrillEnabled: r, drilledLevel: i, dimensionCount: a, isLastConfiguredDrillLevel: o, isTableRedirectAllowed: s = !0 }) => {
4281
+ let c = Sa(r, i, a), l = c || !!o, u = !!e?.isEnable && l && s, d = e?.routeType === "user";
4262
4282
  return {
4263
4283
  navigate: u && !d,
4264
4284
  host: u && d,
4265
4285
  openNestedMetric: !!t?.isEnable && c,
4266
4286
  openDashboard: !!n?.isEnable && l
4267
4287
  };
4268
- }, Ca = ut.createContext({
4288
+ }, wa = ut.createContext({
4269
4289
  navigate: null,
4270
4290
  carryFilters: []
4271
- }), wa = [], Ta = ({ children: e, isEnabled: t = !1, onNavigate: n, carryFilters: r }) => {
4272
- let i = r?.length ? r : wa, a = ut.useMemo(() => ({
4291
+ }), Ta = [], Ea = ({ children: e, isEnabled: t = !1, onNavigate: n, carryFilters: r }) => {
4292
+ let i = r?.length ? r : Ta, a = ut.useMemo(() => ({
4273
4293
  navigate: t && n ? n : null,
4274
4294
  carryFilters: i
4275
4295
  }), [
@@ -4277,26 +4297,26 @@ var ca = (e) => !!e && e !== "null" && e !== "undefined", la = (e) => {
4277
4297
  n,
4278
4298
  i
4279
4299
  ]);
4280
- return /* @__PURE__ */ mt(Ca.Provider, {
4300
+ return /* @__PURE__ */ mt(wa.Provider, {
4281
4301
  value: a,
4282
4302
  children: e
4283
4303
  });
4284
- }, Ea = () => {
4285
- let { navigate: e, carryFilters: t } = ut.useContext(Ca), n = ut.useCallback((n, r) => {
4304
+ }, Da = () => {
4305
+ let { navigate: e, carryFilters: t } = ut.useContext(wa), n = ut.useCallback((n, r) => {
4286
4306
  if (!e) return !1;
4287
4307
  let i = n?.clickActions?.chartWithDashboard;
4288
4308
  if (!i?.isEnable) return !1;
4289
- let a = ua({
4309
+ let a = da({
4290
4310
  config: i,
4291
- value: da(i, r),
4311
+ value: fa(i, r),
4292
4312
  carryFilters: t
4293
4313
  });
4294
4314
  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);
4295
4315
  }, [e, t]);
4296
4316
  return e ? n : null;
4297
- }, Da = (e) => {
4317
+ }, Oa = (e) => {
4298
4318
  if (typeof e == "function") return (t) => e(t);
4299
- }, Oa = (e) => e === "column" ? {
4319
+ }, ka = (e) => e === "column" ? {
4300
4320
  code: "JOIN_COLUMN_HIDDEN",
4301
4321
  message: "A column this metric uses is hidden or no longer in the datamart.",
4302
4322
  hint: "Ask an editor to unhide it in the datamart or update the metric."
@@ -4304,9 +4324,9 @@ var ca = (e) => !!e && e !== "null" && e !== "undefined", la = (e) => {
4304
4324
  code: "JOIN_PATH_MISSING",
4305
4325
  message: "A join this metric uses is no longer in the datamart.",
4306
4326
  hint: "Ask an editor to add the relationship back or update the metric."
4307
- }, ka = (e) => {
4327
+ }, Aa = (e) => {
4308
4328
  let n = t(e, { fallback: "The query couldn't run." });
4309
- return n.code === "JOIN_COLUMN_HIDDEN" ? t(Oa("column")) : n.code === "JOIN_PATH_MISSING" ? t(Oa("join")) : n;
4329
+ return n.code === "JOIN_COLUMN_HIDDEN" ? t(ka("column")) : n.code === "JOIN_PATH_MISSING" ? t(ka("join")) : n;
4310
4330
  };
4311
4331
  //#endregion
4312
- export { yt as $, Dr as A, X as B, Mr as C, Hr as D, Ir as E, pr as F, jn as G, Kn as H, ur as I, kn as J, J as K, nr as L, sr as M, dr as N, kr as O, or as P, vt as Q, rr as R, Gr as S, Rr as T, An as U, Jn as V, K as W, q as X, On as Y, En as Z, Ur as _, Ea as a, ci as b, ya as c, ua as d, _t as et, oa as f, hi as g, pi as h, Da as i, Or as j, Ar as k, ma as l, xi as m, ka as n, Sa as o, Vi as p, Dn as q, Ta as r, ba as s, Oa as t, fa as u, ni as v, Lr as w, Xr as x, ri as y, tr as z };
4332
+ export { yt as $, Or as A, Gn as B, Nr as C, Hr as D, Lr as E, mr as F, An as G, Kn as H, dr as I, Dn as J, Fn as K, Z as L, cr as M, fr as N, Ar as O, sr as P, vt as Q, rr as R, Gr as S, zr as T, kn as U, Jn as V, Tn as W, On as X, J as Y, Cn as Z, Ur as _, Da as a, ci as b, ba as c, da as d, _t as et, sa as f, hi as g, pi as h, Oa as i, kr as j, jr as k, ha as l, xi as m, Aa as n, Ca as o, Hi as p, En as q, Ea as r, xa as s, ka as t, pa as u, ni as v, Rr as w, Xr as x, ri as y, nr as z };